// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
define("dojo/_base/declare dijit/_WidgetBase dojo/_base/lang dojo/_base/html dojo/on dojo/mouse dojo/_base/fx dojo/topic dojo/Evented".split(" "),function(l,m,b,c,d,g,h,k,n){var e=1E3,f=1E4;return l([m,n],{baseClass:"jimu-appstate-popup",declaredClass:"jimu.dijit.AppStatePopup",currentState:0,timeoutHandler:void 0,constructor:function(a){this.inherited(arguments);"animationDuration"in a&&(e=a.animationDuration);"autoCloseInterval"in a&&(f=a.autoCloseInterval)},postCreate:function(){window.appInfo.isRunInMobile&&
c.addClass(this.domNode,"mobile");var a=c.create("div",{"class":"appstate-header"});c.create("div",{"class":"appstate-title",innerHTML:this.nls.title},a);var p=c.create("div",{"class":"appstate-close"},a);c.place(a,this.domNode);a=c.create("div",{"class":"appstate-tips",innerHTML:this.nls.restoreMap});c.place(a,this.domNode);this.own(d(a,"click",b.hitch(this,function(){this.emit("applyAppState");this.hide()})));this.own(d(p,"click",b.hitch(this,function(){this.hide()})));this.own(d(this.domNode,g.enter,
b.hitch(this,function(){this._timerStop()})));this.own(d(this.domNode,g.leave,b.hitch(this,function(){this._timerStart()})))},show:function(){h.animateProperty({node:this.domNode,duration:e,properties:window.appInfo.isRunInMobile?{top:{start:-120,end:0}}:{bottom:{start:-100,end:10}},onEnd:b.hitch(this,function(){this.currentState=1})}).play();k.subscribe("splashPopupShow",b.hitch(this,function(){this._timerStop()}));k.subscribe("splashPopupHide",b.hitch(this,function(){this._timerStart()}));this.timeoutHandler=
setTimeout(b.hitch(this,this.hide),f)},hide:function(){0!==this.currentState&&h.animateProperty({node:this.domNode,duration:e,properties:window.appInfo.isRunInMobile?{top:{start:0,end:-120}}:{bottom:{start:10,end:-100}},onEnd:b.hitch(this,function(){this.currentState=0;c.setStyle(this.domNode,"display","none")})}).play()},_timerStart:function(){1!==this.currentState||this.timeoutHandler||(this.timeoutHandler=setTimeout(b.hitch(this,this.hide),f))},_timerStop:function(){this.timeoutHandler&&(clearTimeout(this.timeoutHandler),
this.timeoutHandler=void 0)}})});