//>>built
define("dojox/mobile/ScreenSizeAware","dojo/_base/kernel dojo/_base/array dojo/_base/config dojo/_base/connect dojo/_base/declare dojo/_base/lang dojo/_base/window dojo/dom dijit/registry".split(" "),function(g,c,n,f,h,k,l,p,d){g.experimental("dojox.mobile.ScreenSizeAware");var e=h("dojox.mobile.ScreenSizeAware",null,{splitterId:"",leftPaneId:"",rightPaneId:"",leftViewId:"",leftListId:"",constructor:function(a){a&&k.mixin(this,a);f.subscribe("/dojox/mobile/screenSize/tablet",this,function(b){this.transformUI("tablet")});
f.subscribe("/dojox/mobile/screenSize/phone",this,function(b){this.transformUI("phone")})},init:function(){!this._initialized&&(this._initialized=!0,this.splitter=this.splitterId?d.byId(this.splitterId):c.filter(d.findWidgets(l.body()),function(a){return-1!==a.declaredClass.indexOf("Splitter")})[0])&&(this.leftPane=this.leftPaneId?d.byId(this.leftPaneId):this.splitter.getChildren()[0])&&(this.rightPane=this.rightPaneId?d.byId(this.rightPaneId):this.splitter.getChildren()[1])&&(this.leftView=this.leftViewId?
d.byId(this.leftViewId):c.filter(d.findWidgets(this.leftPane.containerNode),function(a){return-1!==a.declaredClass.indexOf("View")})[0])&&(this.leftList=this.leftListId?d.byId(this.leftListId):c.filter(d.findWidgets(this.leftView.containerNode),function(a){return-1!==a.declaredClass.indexOf("List")||-1!==a.declaredClass.indexOf("IconContainer")})[0])},isPhone:function(){return"phone"===this._currentMode},getShowingView:function(){var a=c.filter(this.rightPane.getChildren(),function(b){return-1!==
b.declaredClass.indexOf("View")})[0];return a?a.getShowingView()||c.filter(this.rightPane.getChildren(),function(b){return b.selected})[0]||a:null},updateStateful:function(){this.leftList.set("stateful",!this.isPhone())},getDestinationId:function(a){return a.moveTo},updateBackButton:function(){c.forEach(this.leftList.getChildren(),function(a){a=this.getDestinationId(a);if(a=d.byId(a))a=c.filter(a.getChildren(),function(b){return-1!==b.declaredClass.indexOf("Heading")})[0],a.backButton&&(a.backButton.domNode.style.display=
this.isPhone()?"":"none"),a.backBtnNode&&(a.backBtnNode.style.display=this.isPhone()?"":"none")},this)},updateTransition:function(){var a=this.isPhone()?"slide":"none";c.forEach(this.leftList.getChildren(),function(b){b.set("transition",a)})},moveList:function(){(this.isPhone()?this.rightPane:this.leftPane).containerNode.appendChild(this.leftView.domNode)},showLeftView:function(){this.leftPane.domNode.style.display=this.isPhone()?"none":"";this.leftView.show()},showRightView:function(){if(!this.isPhone()){var a=
this.getShowingView();a?a.show():this.leftItemSelected()}},updateSelectedItem:function(){var a=this.getShowingView();if(a&&!this.isPhone())var b=a.id;b?(a=c.filter(this.leftList.getChildren(),function(m){return this.getDestinationId(m)===b},this))&&0<a.length&&a[0].set("selected",!0):this.leftList.deselectAll&&this.leftList.deselectAll()},leftItemSelected:function(){},transformUI:function(a){this.init();a!==this._currentMode&&(this._currentMode=a,this.updateStateful(),this.updateBackButton(),this.updateTransition(),
this.moveList(),this.showLeftView(),this.showRightView(),this.updateSelectedItem())}});e._instance=null;e.getInstance=function(){e._instance||(e._instance=new e);return e._instance};return e});