//>>built
define("dojox/widget/Rotator","dojo/aspect dojo/_base/declare dojo/_base/Deferred dojo/_base/lang dojo/_base/array dojo/_base/fx dojo/dom dojo/dom-attr dojo/dom-construct dojo/dom-geometry dojo/dom-style dojo/topic dojo/on dojo/parser dojo/query dojo/fx/easing dojo/NodeList-dom".split(" "),function(y,r,z,k,p,A,B,n,q,t,l,u,E,C,x){r=r("dojox.widget.Rotator",null,{transition:"dojox.widget.rotator.swap",transitionParams:"duration:500",panes:null,constructor:function(c,b){k.mixin(this,c);var a=this,e=
a.transition,g=a._transitions={};a._idMap={};var h=a.transitionParams=eval("({ "+a.transitionParams+" })");b=a._domNode=B.byId(b);a._domNodeContentBox=t.getContentBox(b);a.id=b.id||(new Date).getTime();"static"==l.get(b,"position")&&l.set(b,"position","relative");g[e]=k.getObject(e);g[e]||(this._transitionWarn(e,"dojox.widget.rotator.swap"),g[a.transition="dojox.widget.rotator.swap"]=k.getObject("dojox.widget.rotator.swap"));h.duration||(h.duration=500);p.forEach(a.panes,function(f){q.create("div",
f,b)});a.panes=[];x("\x3e *",b).forEach(function(f,d){a._initializePane(f,d)});a._controlSub=u.subscribe(a.id+"/rotator/control",k.hitch(a,this.control))},insert:function(c,b){var a=this.panes;null==b&&(b=a.length);b<a.length?(a=a[b],q.place(c,a.node,"before")):q.place(c,this._domNode,"last");this._initializePane(c,b)},remove:function(c){function b(f){var d=e.splice(f,1)[0];d&&(d.id&&(a._idMap[d.id]=void 0),a._domNode.removeChild(d.node));a.idx>f&&a.idx--}var a=this,e=this.panes;if("number"===typeof c)var g=
c;else{for(var h=0;h<e.length;h++)if(e[h].node===c){g=h;break}if(null==g)return}if(g===this.idx&&(c=this.go(this.idx-1)))return c.then(function(){b(g)});b(g)},destroy:function(){p.forEach([this._controlSub,this.wfe],function(c){c&&c.remove()});q.destroy(this._domNode);this.panes=[]},next:function(){return this.go(this.idx+1)},prev:function(){return this.go(this.idx-1)},go:function(c){var b=this,a=b.idx,e=b.panes,g=e.length,h=b._idMap[c];b._resetWaitForEvent();c=null!=h?h:c||0;c=c<g?0>c?g-1:c:0;if(c==
a||b.anim)return null;var f=e[a],d=e[c];l.set(f.node,"zIndex",2);l.set(d.node,"zIndex",1);var m={current:f,next:d,rotator:b};if(a=b.anim=b._transitions[d.trans](k.mixin({rotatorBox:b._domNodeContentBox},m,d.params))){var v=new z,w=d.waitForEvent,D=y.after(a,"onEnd",function(){l.set(f.node,{display:"none",left:0,opacity:1,top:0,zIndex:0});D.remove();b.anim=null;b.idx=c;if(f.onAfterOut)f.onAfterOut(m);if(d.onAfterIn)d.onAfterIn(m);b.onUpdate("onAfterTransition");w||(b._resetWaitForEvent(),v.callback())},
!0);b.wfe=w?u.subscribe(w,function(){b._resetWaitForEvent();v.callback(!0)}):null;b.onUpdate("onBeforeTransition");if(f.onBeforeOut)f.onBeforeOut(m);if(d.onBeforeIn)d.onBeforeIn(m);a.play();return v}},onUpdate:function(c,b){u.publish(this.id+"/rotator/update",c,this,b||{})},_initializePane:function(c,b){var a={node:c,idx:b,params:k.mixin({},this.transitionParams,eval("({ "+(n.get(c,"transitionParams")||"")+" })"))},e=a.trans=n.get(c,"transition")||this.transition,g=this._transitions,h=this.panes,
f={left:0,top:0,position:"absolute",display:"none"};p.forEach(["id","title","duration","waitForEvent"],function(d){a[d]=n.get(c,d)});a.id&&(this._idMap[a.id]=b);g[e]||(g[e]=k.getObject(e))||this._transitionWarn(e,a.trans=this.transition);if(null==this.idx||n.get(c,"selected"))null!=this.idx&&l.set(h[this.idx].node,"display","none"),this.idx=b,f.display="";l.set(c,f);x("\x3e script[type^\x3d'dojo/method']",c).orphan().forEach(function(d){var m=n.get(d,"event");m&&(a[m]=C._functionFromScript(d))});
h.splice(b,0,a)},_resetWaitForEvent:function(){this.wfe&&(this.wfe.remove(),delete this.wfe)},control:function(c){var b=k._toArray(arguments),a=this;b.shift();a._resetWaitForEvent();a[c]&&((b=a[c].apply(a,b))&&b.addCallback(function(){a.onUpdate(c)}),a.onManualChange(c))},resize:function(c,b){var a=this._domNodeContentBox={w:c,h:b};t.setContentSize(this._domNode,a);p.forEach(this.panes,function(e){t.setContentSize(e.node,a)})},onManualChange:function(){},_transitionWarn:function(c,b){}});k.setObject("dojox.widget.rotator.swap",
function(c){return new A.Animation({play:function(){l.set(c.current.node,"display","none");l.set(c.next.node,"display","");this._fire("onEnd")}})});return r});