";window.open("data:text/html;charset=utf-8,"+encodeURIComponent(t))},getAccessibleDebugHTML:function(){function t(i,r){e+=r+s((i.isRootInstance?"":i.node.tagName)+" "+i.toString())+"
",i.children.forEach(function(e){t(e,r+n)})}var e="",i="font-weight: bold; font-size: 120%; margin-top: 5px;",n="    ";e+='
Accessible Instances

',t(this._rootAccessibleInstance,""),e+='
Parallel DOM

';for(var r=this._rootAccessibleInstance.peer.primarySibling.outerHTML,a=(r=r.replace(/\>\\n<")).split("\n"),o="",l=0;l",u||(o+=n)}return e},foreignObjectRasterization:function(t){function i(t){t.id||(t.id="unknown-canvas-"+s++),r[t.id]=t.toDataURL()}function n(t){if(t.blocks)_.each(t.blocks,function(t){n(t)});else if(t.firstDrawable&&t.lastDrawable){for(var e=t.firstDrawable;e!==t.lastDrawable;e=e.nextDrawable)n(e);n(t.lastDrawable),t.canvas&&t.canvas instanceof window.HTMLCanvasElement&&i(t.canvas)}y.DOMDrawable&&t instanceof y.DOMDrawable&&(t.domElement instanceof window.HTMLCanvasElement&&i(t.domElement),Array.prototype.forEach.call(t.domElement.getElementsByTagName("canvas"),function(t){i(t)}))}var r={},s=0;n(this._rootBackbone);var a=document.implementation.createHTMLDocument("");a.documentElement.innerHTML=this.domElement.outerHTML,a.documentElement.setAttribute("xmlns",a.documentElement.namespaceURI);var o=a.documentElement.getElementsByTagName("canvas");o=Array.prototype.slice.call(o);for(var l=0;l
'+(new window.XMLSerializer).serializeToString(t)+"
",o=new window.Image;o.onload=function(){s.drawImage(o,0,0),n(r.toDataURL())},o.onerror=function(){n(null)};var l=new window.TextEncoderLite("utf-8").encode(a),h=window.fromByteArray(l);o.src="data:image/svg+xml;base64,"+h},set focus(t){if(window.phet&&phet.phetio&&phet.chipper.accessibility&&t)t.trail.lastNode();var e;this.focusProperty.value&&(e=this.focusedNode).focusChangedEmitter.emit(!1),this.focusProperty.value=t,t?t.trail.lastNode().focusChangedEmitter.emit(!0):e&&e.blur()},get focus(){return this.focusProperty.value},getFocusedNode:function(){var t=null,e=this.focusProperty.get();return e&&(t=e.trail.lastNode()),t},get focusedNode(){return this.getFocusedNode()}}),e.prototype.dispose=function(){this._input&&this.detachEvents(),this._rootNode.removeRootedDisplay(this),this._accessible&&this._rootAccessibleInstance.dispose()},e.customCursors={"scenery-grab-pointer":["grab","-moz-grab","-webkit-grab","pointer"],"scenery-grabbing-pointer":["grabbing","-moz-grabbing","-webkit-grabbing","pointer"]},e.focusProperty=new c(null,window.phet&&phet.chipper&&phet.chipper.accessibility?{tandem:m.generalTandem.createTandem("focusProperty"),phetioType:p(R(C)),phetioState:!1,phetioReadOnly:!0}:{}),e.userGestureEmitter=new r,e.keyStateTracker=new h,e.assertSubtreeDisposed=function(t){},e.windowHasFocusProperty=new d(!1),e.attachToWindow=function(){e.globallyAttached||(e.attachedWindowFocusListener=function(){e.windowHasFocusProperty.value=!0},e.attachedWindowBlurListener=function(){e.windowHasFocusProperty.value=!1},window.addEventListener("focus",e.attachedWindowFocusListener),window.addEventListener("blur",e.attachedWindowBlurListener),e.windowHasFocusProperty.value=document.hasFocus(),e.globallyAttached=!0)},e.detachFromWindow=function(){window.removeEventListener("focus",e.attachedWindowFocusListener),window.removeEventListener("blur",e.attachedWindowBlurListener),e.windowHasFocusProperty.value=document.hasFocus(),e.globallyAttached=!1},e.globallyAttached=!1,e}),i("SCENERY/util/DisplayedProperty",["require","AXON/BooleanProperty","SCENERY/scenery"],function(t){"use strict";var e=t("AXON/BooleanProperty"),i=t("SCENERY/scenery"),n=function(t){function i(t,e,n){_classCallCheck(this,i);var r=_possibleConstructorReturn(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,!1,n));r.node=t,r.display=e,r.updateListener=r.updateValue.bind(r),r.addedInstancelistener=r.addedInstance.bind(r),r.removedInstancelistener=r.removedInstance.bind(r),t.onStatic("addedInstance",r.addedInstancelistener),t.onStatic("removedInstance",r.removedInstancelistener);for(var s=t.instances,a=0;a=o.AA_VOLTAGE?this.batteryText.centerY=-7:t>=.1&&(this.batteryText.centerY=-m/2-12)}})}),i("OHMS_LAW/ohms-law/view/BatteriesView",["require","OHMS_LAW/ohms-law/view/BatteryView","PHET_CORE/inherit","SCENERY/nodes/Node","OHMS_LAW/ohmsLaw","OHMS_LAW/ohms-law/OhmsLawA11yStrings","OHMS_LAW/ohms-law/OhmsLawConstants","PHETCOMMON/util/StringUtils","DOT/Util"],function(t){"use strict";function e(t,e,n){r.call(this,{tandem:e,tagName:"li"});for(var s=this,a=[],c=e.createGroupTandem("battery"),d=0;d0,e.visible&&e.setVoltage(n)}),s.innerContent=l.fillIn(u,{voltage:h.toFixed(t,o.VOLTAGE_SIG_FIGS)})}),this.mutate(n)}var i=t("OHMS_LAW/ohms-law/view/BatteryView"),n=t("PHET_CORE/inherit"),r=t("SCENERY/nodes/Node"),s=t("OHMS_LAW/ohmsLaw"),a=t("OHMS_LAW/ohms-law/OhmsLawA11yStrings"),o=t("OHMS_LAW/ohms-law/OhmsLawConstants"),l=t("PHETCOMMON/util/StringUtils"),h=t("DOT/Util"),u=a.batteriesSupplyPattern.value;return s.register("BatteriesView",e),n(r,e)}),i("string!OHMS_LAW/current",function(){return window.phet.chipper.strings.get("OHMS_LAW/current")}),i("string!OHMS_LAW/currentUnits",function(){return window.phet.chipper.strings.get("OHMS_LAW/currentUnits")}),i("OHMS_LAW/ohms-law/view/ReadoutPanel",["require","SCENERY/nodes/HBox","PHET_CORE/inherit","OHMS_LAW/ohmsLaw","OHMS_LAW/ohms-law/OhmsLawConstants","OHMS_LAW/ohms-law/model/OhmsLawModel","SUN/Panel","SCENERY_PHET/PhetColorScheme","SCENERY_PHET/PhetFont","SCENERY/nodes/Rectangle","SCENERY/nodes/Text","DOT/Util","string!OHMS_LAW/current","string!OHMS_LAW/currentUnits"],function(t){"use strict";function e(t,e,n){n=_.extend({xMargin:30,yMargin:8,lineWidth:3,resize:!1,tandem:e},n);var r=new c(p,{font:f,fill:l.RED_COLORBLIND,tandem:e.createTandem("currentStringText")}),s=new c("=",{font:f,fill:"black",tandem:e.createTandem("equalsSign")}),h=new c(d.toFixed(a.getMaxCurrent(),1),{font:f,fill:"black",tandem:e.createTandem("currentValue")}),E=new u.bounds(h.bounds,{children:[h]}),y=new c(m,{font:f,fill:l.RED_COLORBLIND,tandem:e.createTandem("currentUnit")}),A=new i({spacing:11.3,children:[r,s,E,y]});A.width>g&&A.scale(g/A.width),t.currentProperty.link(function(t){var e=h.right;h.text=d.toFixed(t,1),h.right=e}),o.call(this,A,n)}var i=t("SCENERY/nodes/HBox"),n=t("PHET_CORE/inherit"),r=t("OHMS_LAW/ohmsLaw"),s=t("OHMS_LAW/ohms-law/OhmsLawConstants"),a=t("OHMS_LAW/ohms-law/model/OhmsLawModel"),o=t("SUN/Panel"),l=t("SCENERY_PHET/PhetColorScheme"),h=t("SCENERY_PHET/PhetFont"),u=t("SCENERY/nodes/Rectangle"),c=t("SCENERY/nodes/Text"),d=t("DOT/Util"),p=t("string!OHMS_LAW/current"),m=t("string!OHMS_LAW/currentUnits"),f=new h(32),g=.63*s.WIRE_WIDTH;return r.register("ReadoutPanel",e),n(o,e)}),i("OHMS_LAW/ohms-law/view/ResistorNode",["require","SCENERY/nodes/Circle","PHET_CORE/inherit","DOT/LinearFunction","SCENERY/util/LinearGradient","SCENERY/nodes/Node","OHMS_LAW/ohmsLaw","OHMS_LAW/ohms-law/OhmsLawA11yStrings","OHMS_LAW/ohms-law/OhmsLawConstants","SCENERY/nodes/Path","KITE/Shape","PHETCOMMON/util/StringUtils","DOT/Util"],function(t){"use strict";function e(t,e,n){n=_.extend({tagName:"li"},n),a.call(this);var r=this,s=new u((new c).moveTo(-S/2,T/2).horizontalLineToRelative(S).ellipticalArc(S/2,0,C*T/2,T/2,0,Math.PI/2,3*Math.PI/2,!0).horizontalLineToRelative(-S),{stroke:"black",fill:P,tandem:e.createTandem("bodyPath")});this.addChild(s);var o=new u(c.ellipse(-S/2,0,T*C/2,T/2),{stroke:"black",fill:"#ff9f9f",tandem:e.createTandem("endPath")});this.addChild(o);var l=new u((new c).moveTo(5-S/2,0).horizontalLineToRelative(-15),{stroke:"#000",lineWidth:10,tandem:e.createTandem("stubWirePath")});this.addChild(l);for(var h=e.createTandem("dotsNode"),d=new a({tandem:h}),p=h.createGroupTandem("dot"),m=0;me&&(i=o.RELATIVE_SIZE_STRINGS.length-1),o.RELATIVE_SIZE_STRINGS[i].toLowerCase()}})}),i("sound!OHMS_LAW/slider-click-001.mp3",function(){return{base64:"data:audio/mpeg;base64,//swxAAABriDQRQRgAEmkW2XHpAAAJQAAHgAAGAAAABIDu4cDd3/r/1wAAAAAARC/9EREd3d3PQDFg/D/lAfflAx/BMH9QP/ghBDaMSKQDL9Jl8zrxkLJ1driXbAMCtXKORoVLbBiwvIKx8m21HBZEfMq/0x/+KVG0Sv/////Uc0dO+i8Kkj3feKlhICwuZ+X8KkA4p+8BQpQAET//syxAOAB+BfSzzDADDmiiFBjAzgIQWVhDQDISg5HQzTHx2LQbHxpFGUeaRR9PJpFGqnPX9VQTICeoDA0eWdqBpYb9GV2lga/wVf/Boz4EawwCWbQYHfhmyxUqUCkE48QHSMRwuglOIhIgJrr1hocKgoLSa/2MFBBwSJBQkaQDIkNVC6Xfi9TEFNRTMuOTkuM1VVVVVVVVVVVVVVVQ=="}}),i("OHMS_LAW/ohms-law/view/OhmsLawScreenView",["require","SCENERY_PHET/accessibility/nodes/ControlAreaNode","OHMS_LAW/ohms-law/view/ControlPanel","OHMS_LAW/ohms-law/view/CurrentSoundGenerator","TAMBO/sound-generators/DiscreteSoundGenerator","OHMS_LAW/ohms-law/view/FormulaNode","PHET_CORE/inherit","TAMBO/InvertedBooleanProperty","OHMS_LAW/ohmsLaw","OHMS_LAW/ohms-law/OhmsLawConstants","OHMS_LAW/ohms-law/view/OhmsLawScreenSummaryNode","SCENERY_PHET/accessibility/nodes/PlayAreaNode","SCENERY_PHET/buttons/ResetAllButton","TAMBO/sound-generators/ResetAllSoundGenerator","JOIST/ScreenView","TAMBO/soundManager","OHMS_LAW/ohms-law/view/WireBox","sound!OHMS_LAW/slider-click-001.mp3"],function(t){"use strict";function e(t,e){var o=this;f.call(this,{tandem:e,addScreenSummaryNode:!0});var h=new a(t,e.createTandem("formulaNode"),{pickable:!1}),A=new E(t,e.createTandem("wireBox"),{pickable:!1});this.screenSummaryNode.addChild(new c(t));var v=new n(t.voltageProperty,t.resistanceProperty,t.currentProperty,e.createTandem("controlPanel")),b=new l(t.resetInProgressProperty);g.addSoundGenerator(new s(t.voltageProperty,u.VOLTAGE_RANGE,{sound:y,numBins:6,enableControlProperties:[b],initialOutputLevel:.25,alwaysPlayOnChangesProperty:v.sliderBeingDraggedByKeyboard})),g.addSoundGenerator(new s(t.resistanceProperty,u.RESISTANCE_RANGE,{sound:y,numBins:6,enableControlProperties:[b],initialOutputLevel:.2,alwaysPlayOnChangesProperty:v.sliderBeingDraggedByKeyboard})),this.currentSoundGenerator=new r(t.currentProperty,{initialOutputLevel:.4}),g.addSoundGenerator(this.currentSoundGenerator);var S=new p({radius:28,listener:function(){t.reset(),o.currentSoundGenerator.reset()},tandem:e.createTandem("resetAllButton")});g.addSoundGenerator(new m(t.resetInProgressProperty,{initialOutputLevel:.7}));var T=new d;this.addChild(T);var C=new i;this.addChild(C),T.addChild(h),T.addChild(A),T.addChild(v),C.addChild(S),h.centerY=this.layoutBounds.bottom/4.75,A.centerX=h.centerX,A.centerY=.74*this.layoutBounds.bottom,v.right=this.layoutBounds.width-50,v.centerY=this.layoutBounds.centerY-S.height/2,S.right=v.right,S.bottom=this.layoutBounds.bottom-20}var i=t("SCENERY_PHET/accessibility/nodes/ControlAreaNode"),n=t("OHMS_LAW/ohms-law/view/ControlPanel"),r=t("OHMS_LAW/ohms-law/view/CurrentSoundGenerator"),s=t("TAMBO/sound-generators/DiscreteSoundGenerator"),a=t("OHMS_LAW/ohms-law/view/FormulaNode"),o=t("PHET_CORE/inherit"),l=t("TAMBO/InvertedBooleanProperty"),h=t("OHMS_LAW/ohmsLaw"),u=t("OHMS_LAW/ohms-law/OhmsLawConstants"),c=t("OHMS_LAW/ohms-law/view/OhmsLawScreenSummaryNode"),d=t("SCENERY_PHET/accessibility/nodes/PlayAreaNode"),p=t("SCENERY_PHET/buttons/ResetAllButton"),m=t("TAMBO/sound-generators/ResetAllSoundGenerator"),f=t("JOIST/ScreenView"),g=t("TAMBO/soundManager"),E=t("OHMS_LAW/ohms-law/view/WireBox"),y=t("sound!OHMS_LAW/slider-click-001.mp3");return h.register("OhmsLawScreenView",e),o(f,e,{step:function(t){this.currentSoundGenerator.step(t)}})}),i("JOIST/JoistA11yStrings",["require","JOIST/joist"],function(t){"use strict";var e=t("JOIST/joist"),i={hotKeysAndHelp:{value:"Keyboard Shortcuts"},tabToGetStarted:{value:"Tab to get started."},playArea:{value:"Play Area"},controlArea:{value:"Control Area"},simScreens:{value:"Sim Screens"},simScreen:{value:"Sim Screen"},screenNumberPattern:{value:"Screen {{number}}"},screenNamePattern:{value:"{{name}} Screen"},screenSimPattern:{value:"{{screenName}}, {{simName}}"},home:{value:"Home"},homeScreen:{value:"Home Screen"},homeScreenDescription:{value:"Go to Home Screen."},homeScreenDescriptionPattern:{value:"Come explore with {{name}}. It has {{screens}} screens."},simResourcesAndTools:{value:"Sim Resources"},simScreensResourcesAndTools:{value:"Sim Screens, Resources, and Tools"},simSoundOnString:{value:"Sim sound on."},simSoundOffString:{value:"Sim sound off."},soundOnOffButton:{value:"Mute Sound"},checkOutShortcuts:{value:"If needed, checkout keyboard shortcuts under Sim Resources."},phet:{value:"PhET Menu"}};if("xss"===phet.chipper.queryParameters.stringTest)for(var n in i)i[n].value+='';return e.register("JoistA11yStrings",i),i}),i("JOIST/Screen",["require","AXON/BooleanProperty","DOT/Dimension2","PHET_CORE/inherit","JOIST/joist","JOIST/JoistA11yStrings","SCENERY/nodes/Path","AXON/Property","SCENERY/nodes/Rectangle","SCENERY_PHET/accessibility/nodes/ScreenSummaryNode","KITE/Shape","PHETCOMMON/util/StringUtils","TANDEM/Tandem"],function(t){"use strict";function e(t,e,n){(n=_.extend({name:null,backgroundColorProperty:new l("white"),homeScreenIcon:null,showUnselectedHomeScreenIconFrame:!1,navigationBarIcon:null,showScreenIconFrameForNavigationBarFill:null,maxDT:.5,tandem:d.required,descriptionContent:null},n)).homeScreenIcon||(n.homeScreenIcon=new h(0,0,g.width,g.height,{fill:n.backgroundColorProperty.value,stroke:"black"})),n.navigationBarIcon||(n.navigationBarIcon=n.homeScreenIcon),v(n.homeScreenIcon,g,A,"homeScreenIcon"),v(n.navigationBarIcon,E,y,"navigationBarIcon"),this.screenTandem=n.tandem,this.backgroundColorProperty=n.backgroundColorProperty,this.name=n.name,this.homeScreenIcon=n.homeScreenIcon,this.navigationBarIcon=n.navigationBarIcon,this.showUnselectedHomeScreenIconFrame=n.showUnselectedHomeScreenIconFrame,this.showScreenIconFrameForNavigationBarFill=n.showScreenIconFrameForNavigationBarFill,this.maxDT=n.maxDT,this.createModel=t,this.createView=e,this._model=null,this._view=null,this.activeProperty=new i(!0,{tandem:n.tandem.createTandem("activeProperty"),phetioReadOnly:!0,phetioDocumentation:"Indicates whether the screen is active. For single-screen simulations, the screen is always active."}),this.descriptionContent="",n.descriptionContent?this.descriptionContent=n.descriptionContent:this.name?this.descriptionContent=c.fillIn(p,{name:this.name}):this.descriptionContent=f}var i=t("AXON/BooleanProperty"),n=t("DOT/Dimension2"),r=t("PHET_CORE/inherit"),s=t("JOIST/joist"),a=t("JOIST/JoistA11yStrings"),o=t("SCENERY/nodes/Path"),l=t("AXON/Property"),h=t("SCENERY/nodes/Rectangle"),u=(t("SCENERY_PHET/accessibility/nodes/ScreenSummaryNode"),t("KITE/Shape")),c=t("PHETCOMMON/util/StringUtils"),d=t("TANDEM/Tandem"),p=a.screenNamePattern.value,m=a.screenSimPattern.value,f=a.simScreen.value,g=new n(548,373),E=new n(147,100),y=E.width/E.height,A=g.width/g.height;s.register("Screen",e);var v=function(t,e,i,n){t.width,t.height};return r(Object,e,{reset:function(){},get model(){return this._model},get view(){return this._view},initializeModel:function(){this._model=this.createModel()},initializeView:function(t,e){if(this._view=this.createView(this.model),this._view.setVisible(!1),phet.chipper.queryParameters.dev&&this._view.addChild(function(t){return new o(u.bounds(t),{stroke:"red",lineWidth:3,pickable:!1})}(this._view.layoutBounds)),phet.chipper.queryParameters.showVisibleBounds&&this._view.addChild(function(t){var e=new o(u.bounds(t.visibleBoundsProperty.value),{stroke:"blue",lineWidth:6,pickable:!1});return t.visibleBoundsProperty.link(function(t){e.shape=u.bounds(t)}),e}(this._view)),t){if(1===e)this._view.labelContent=t;else{var i=c.fillIn(p,{name:this.name});this._view.labelContent=c.fillIn(m,{screenName:i,simName:t})}this._view.screenSummaryNode&&this._view.screenSummaryNode.setIntroString(t,e)}},initializeModelAndView:function(){this.initializeModel(),this.initializeView()}},{MINIMUM_HOME_SCREEN_ICON_SIZE:g,HOME_SCREEN_ICON_ASPECT_RATIO:A,MINIMUM_NAVBAR_ICON_SIZE:E})}),i("OHMS_LAW/ohms-law/OhmsLawScreen",["require","SCENERY/util/Color","SCENERY/util/ColorIO","PHET_CORE/inherit","OHMS_LAW/ohmsLaw","OHMS_LAW/ohms-law/model/OhmsLawModel","OHMS_LAW/ohms-law/view/OhmsLawScreenView","AXON/Property","AXON/PropertyIO","JOIST/Screen"],function(t){"use strict";function e(t){u.call(this,function(){return new a(t.createTandem("model"))},function(e){return new o(e,t.createTandem("view"))},{backgroundColorProperty:new l(new i("#ffffdf"),{tandem:t.createTandem("backgroundColorProperty"),phetioType:h(n)}),tandem:t})}var i=t("SCENERY/util/Color"),n=t("SCENERY/util/ColorIO"),r=t("PHET_CORE/inherit"),s=t("OHMS_LAW/ohmsLaw"),a=t("OHMS_LAW/ohms-law/model/OhmsLawModel"),o=t("OHMS_LAW/ohms-law/view/OhmsLawScreenView"),l=t("AXON/Property"),h=t("AXON/PropertyIO"),u=t("JOIST/Screen");return s.register("OhmsLawScreen",e),r(u,e)}),i("SCENERY/listeners/FireListener",["require","AXON/Emitter","PHET_CORE/inherit","TANDEM/PhetioObject","SCENERY/listeners/PressListener","SCENERY/scenery","TANDEM/Tandem"],function(t){"use strict";function e(t){t=_.extend({fire:_.noop,fireOnDown:!1,tandem:o.required},t),s.call(this,t),this._fireOnDown=t.fireOnDown,this.firedEmitter=new i({tandem:t.tandem.createTandem("firedEmitter"),phetioEventType:r.EventType.USER}),this.firedEmitter.addListener(t.fire)}var i=t("AXON/Emitter"),n=t("PHET_CORE/inherit"),r=t("TANDEM/PhetioObject"),s=t("SCENERY/listeners/PressListener"),a=t("SCENERY/scenery"),o=t("TANDEM/Tandem");return a.register("FireListener",e),n(s,e,{fire:function(t){this.firedEmitter.emit()},press:function(t,e,i){var n=this;return s.prototype.press.call(this,t,e,function(){n._fireOnDown&&n.fire(t),i&&i()})},release:function(t,e){var i=this;s.prototype.release.call(this,t,function(){i._fireOnDown||!i.isHoveringProperty.value||i.interrupted||i.fire(),e&&e()})},dispose:function(){this.firedEmitter.dispose(),s.prototype.dispose.call(this)}}),e}),i("SCENERY/nodes/Plane",["require","PHET_CORE/inherit","SCENERY/scenery","SCENERY/nodes/Rectangle"],function(t){"use strict";function e(t){r.call(this,-2e3,-2e3,6e3,6e3,t)}var i=t("PHET_CORE/inherit"),n=t("SCENERY/scenery"),r=t("SCENERY/nodes/Rectangle");return n.register("Plane",e),i(r,e)}),i("SCENERY_PHET/BarrierRectangle",["require","SCENERY/listeners/FireListener","TANDEM/PhetioObject","SCENERY/nodes/Plane","SCENERY_PHET/sceneryPhet","TANDEM/Tandem"],function(t){"use strict";var e=t("SCENERY/listeners/FireListener"),i=t("TANDEM/PhetioObject"),n=t("SCENERY/nodes/Plane"),r=t("SCENERY_PHET/sceneryPhet"),s=t("TANDEM/Tandem"),a=function(t){function r(t,n){_classCallCheck(this,r),n=_.extend({tandem:s.required,phetioDocumentation:"Shown when a dialog is present, so that clicking on the invisible barrier rectangle will dismiss the dialog",phetioReadOnly:!0,phetioEventType:i.EventType.USER,phetioComponentOptions:{phetioState:!1}},n);var a=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,n)),o=function(t){a.visible=t>0};return t.lengthProperty.link(o),a.addInputListener(new e({tandem:n.tandem.createTandem("inputListener"),fire:function(){t.get(t.length-1).hide()}})),a.disposeBarrierRectangle=function(){t.lengthProperty.unlink(o)},a}return _inherits(r,n),_createClass(r,[{key:"dispose",value:function(){this.disposeBarrierRectangle(),_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"dispose",this).call(this)}}]),r}();return r.register("BarrierRectangle",a)}),i("BRAND/../../js/brand",["require","PHET_CORE/Namespace"],function(t){"use strict";return new(t("PHET_CORE/Namespace"))("brand")}),i("string!JOIST/termsPrivacyAndLicensing",function(){return window.phet.chipper.strings.get("JOIST/termsPrivacyAndLicensing")}),i("string!JOIST/translation.credits.link",function(){return window.phet.chipper.strings.get("JOIST/translation.credits.link")}),i("string!JOIST/thirdParty.credits.link",function(){return window.phet.chipper.strings.get("JOIST/thirdParty.credits.link")}),i("BRAND/Brand",["require","BRAND/../../js/brand","string!JOIST/termsPrivacyAndLicensing","string!JOIST/translation.credits.link","string!JOIST/thirdParty.credits.link"],function(t){"use strict";var e=t("BRAND/../../js/brand"),i=t("string!JOIST/termsPrivacyAndLicensing"),n=t("string!JOIST/translation.credits.link"),r=t("string!JOIST/thirdParty.credits.link"),s={id:"phet",name:"PhET™ Interactive Simulations",copyright:"Copyright © 2002-{{year}} University of Colorado Boulder",isPhetApp:phet.chipper.queryParameters["phet-app"]||phet.chipper.queryParameters["phet-android-app"],getLinks:function(t,e){return[{text:i,url:"http://phet.colorado.edu/en/licensing/html"},{text:n,url:"http://phet.colorado.edu/translation-credits?simName="+encodeURIComponent(t)+"&locale="+encodeURIComponent(e)},{text:r,url:"http://phet.colorado.edu/third-party-credits?simName="+encodeURIComponent(t)+"&locale="+encodeURIComponent(e)+"#"+t}]}};return e.register("Brand",s),s}),i("JOIST/Heartbeat",["require","JOIST/joist"],function(t){"use strict";var e=!1,i={start:function(t){e=!0;var i=document.createElement("div");i.style.opacity=0,i.style.position="absolute",i.style.left="0",i.style.top="0",i.style.width="0",i.style.height="0",i.style.clip="rect(0,0,0,0)",i.setAttribute("aria-hidden",!0),t.display.domElement.appendChild(i),t.frameStartedEmitter.addListener(function(){t.frameCounter%1e3==0&&(i.innerHTML=phet.joist.random.nextDouble())})}};return t("JOIST/joist").register("Heartbeat",i),i}),i("JOIST/Frame",["require","DOT/Bounds2","PHET_CORE/inherit","JOIST/joist","SCENERY/util/LinearGradient","SCENERY/nodes/Node","SCENERY/nodes/Rectangle"],function(t){"use strict";function e(t,e){e=_.extend({xMargin1:6,yMargin1:6,cornerRadius:0},e),a.call(this);var n=t.width+2*e.xMargin1,r=t.height+2*e.yMargin1;this.gradient=new s(0,0,n,0).addColorStop(0,"#fbff41").addColorStop(.1475,"#fef98b").addColorStop(.465,"#feff40").addColorStop(.77,"#fffccd").addColorStop(1,"#fbff41"),this.rectangle=new o(0,0,n,r,e.cornerRadius,e.cornerRadius,{stroke:this.gradient,lineWidth:3,x:t.x-e.xMargin1,y:t.y-e.yMargin1}),this.addChild(this.rectangle),this.mutate(e),this.frameWidth=n,this.frameHeight=r;var l=i.rect(this.rectangle.x,this.rectangle.y,this.frameWidth,this.frameHeight);this.highlightRectangle=o.bounds(l.dilated(.75),{stroke:"transparent",lineWidth:4.5}),this.addChild(this.highlightRectangle)}var i=t("DOT/Bounds2"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("SCENERY/util/LinearGradient"),a=t("SCENERY/nodes/Node"),o=t("SCENERY/nodes/Rectangle");return r.register("Frame",e),n(a,e,{setHighlighted:function(t){this.highlightRectangle.stroke=t?this.gradient:"transparent"}}),e}),i("JOIST/ScreenButton",["require","SCENERY/listeners/FireListener","JOIST/Frame","PHET_CORE/inherit","JOIST/joist","SCENERY/nodes/Node","SCENERY_PHET/PhetColorScheme","SCENERY_PHET/PhetFont","TANDEM/PhetioObject","SCENERY/nodes/Rectangle","KITE/Shape","SCENERY/nodes/Text","SCENERY/input/Touch","DOT/Util","SCENERY/nodes/VBox"],function(t){"use strict";function e(t,e,r,s,E,y){y=_.extend({showUnselectedHomeScreenIconFrame:!1,opacity:1,tandem:E,phetioEventType:h.EventType.USER,phetioDocumentation:"A pressable button in the simulation, in the home screen"},y);var A=e.screens[r],v=m.linear(2,4,.875,.5,e.screens.length);e.screens.length>=5&&(v=.4);var b=t?g:v*g,S=new a({opacity:y.opacity,children:[A.homeScreenIcon],scale:b/A.homeScreenIcon.height}),T=t?new n(S):new u(0,0,S.width,S.height,{stroke:y.showUnselectedHomeScreenIconFrame?o.SCREEN_ICON_FRAME:null,lineWidth:.7}),C=new a({opacity:y.opacity,children:[T,S]}),w=new d(A.name,{font:new l(t?42:18),fill:t?o.BUTTON_YELLOW:"gray",tandem:E.createTandem("text")});w.maxWidth=C.width,s.link(function(e){var i=e===r;T.setHighlighted&&T.setHighlighted(i),S.opacity=t||i?1:.5,w.fill=t||i?"white":"gray"}),f.call(this,{children:[C,w]});var R=new i({fireOnDown:!0,fire:t?function(){e.showHomeScreenProperty.value=!1,s.value=-1}:function(){e.screenIndexProperty.value=r},tandem:y.tandem.createTandem("inputListener")});this.addInputListener(R),this.addInputListener({click:function(){t&&R.fire()}}),this.addInputListener({focus:function(){!t&&R.fire()}}),this.addInputListener({focus:function(){s.value=r},blur:function(){s.value=-1}}),t||(this.highlightListener={over:function(t){s.value=r},out:function(t){s.value=-1}},this.addInputListener({over:function(t){t.pointer instanceof p&&(e.screenIndexProperty.value=r)}})),this.mouseArea=this.touchArea=c.bounds(this.bounds),this.disposeScreenButton=function(){s.unlink()},this.mutate(y)}var i=t("SCENERY/listeners/FireListener"),n=t("JOIST/Frame"),r=t("PHET_CORE/inherit"),s=t("JOIST/joist"),a=t("SCENERY/nodes/Node"),o=t("SCENERY_PHET/PhetColorScheme"),l=t("SCENERY_PHET/PhetFont"),h=t("TANDEM/PhetioObject"),u=t("SCENERY/nodes/Rectangle"),c=t("KITE/Shape"),d=t("SCENERY/nodes/Text"),p=t("SCENERY/input/Touch"),m=t("DOT/Util"),f=t("SCENERY/nodes/VBox"),g=140;return s.register("ScreenButton",e),r(f,e,{dispose:function(){this.disposeScreenButton(),f.prototype.dispose.call(this)}})}),i("JOIST/HomeScreenView",["require","DOT/Bounds2","SCENERY/nodes/HBox","PHET_CORE/inherit","JOIST/joist","JOIST/JoistA11yStrings","SCENERY/nodes/Node","SCENERY_PHET/PhetFont","AXON/Property","JOIST/ScreenButton","JOIST/ScreenView","PHETCOMMON/util/StringUtils","SCENERY/nodes/Text"],function(t){"use strict";function e(t,e,i){var r=this;i=_.extend({warningNode:null},i),c.call(this,{layoutBounds:E,tandem:e,labelContent:t.name,descriptionContent:d.fillIn(g,{name:t.name,screens:t.screens.length})});var s=new p(t.name,{font:new l({size:52,family:y}),fill:"white",y:130,tandem:e.createTandem("title")});this.addChild(s),s.scale(Math.min(1,.9*this.layoutBounds.width/s.width)),s.centerX=this.layoutBounds.centerX;var a=new h(-1),A=_.map(t.screens,function(i,n){var r=e.createTandem(i.screenTandem.tail+"LargeButton"),s={tagName:"button",innerContent:i.name,descriptionContent:i.descriptionContent,appendDescription:!0,containerTagName:"li"},o=new u(!0,t,n,a,r,_.extend(s,{resize:!1,cursor:"pointer"})),l=e.createTandem(i.screenTandem.tail+"SmallButton"),h=new u(!1,t,n,a,l,_.extend(s,{spacing:3,cursor:"pointer",showUnselectedHomeScreenIconFrame:i.showUnselectedHomeScreenIconFrame}));h.addInputListener(h.highlightListener),o.addInputListener(h.highlightListener);var c=function(){h.visible&&h.focus(),o.visible&&o.focus()};return h.addInputListener({focus:c}),o.addInputListener({click:c}),h.setAccessibleAttribute("aria-roledescription",f),o.setAccessibleAttribute("aria-roledescription",f),{screen:i,small:h,large:o,index:n}}),v=new o({tagName:"nav",ariaLabel:m}),b=new o({tagName:"ol"});v.addChild(b),this.addChild(v);var S=60;4===t.screens.length&&(S=33),t.screens.length>=5&&(S=20);var T=null;if(this.highlightedScreenButton=null,t.screenIndexProperty.link(function(t){T&&(T.removeAllChildren(),b.removeChild(T));var e=_.map(A,function(e){return e.index===t&&(r.highlightedScreenButton=e.large),e.index===t?e.large:e.small});T=new n({spacing:S,children:e,align:"top",resize:!1,maxWidth:r.layoutBounds.width-118}),b.addChild(T),b.centerX=r.layoutBounds.width/2,b.top=r.layoutBounds.height/3+20}),i.warningNode){var C=i.warningNode;this.addChild(C),C.centerX=this.layoutBounds.centerX,C.bottom=this.layoutBounds.maxY-2}}var i=t("DOT/Bounds2"),n=t("SCENERY/nodes/HBox"),r=t("PHET_CORE/inherit"),s=t("JOIST/joist"),a=t("JOIST/JoistA11yStrings"),o=t("SCENERY/nodes/Node"),l=t("SCENERY_PHET/PhetFont"),h=t("AXON/Property"),u=t("JOIST/ScreenButton"),c=t("JOIST/ScreenView"),d=t("PHETCOMMON/util/StringUtils"),p=t("SCENERY/nodes/Text"),m=a.simScreens.value,f=a.simScreen.value,g=a.homeScreenDescriptionPattern.value,E=new i(0,0,768,504),y="Century Gothic, Futura";return s.register("HomeScreenView",e),r(c,e,{focusHighlightedScreenButton:function(){this.highlightedScreenButton.focus()}},{TITLE_FONT_FAMILY:y,LAYOUT_BOUNDS:E})}),i("JOIST/HomeScreen",["require","JOIST/HomeScreenView","PHET_CORE/inherit","JOIST/joist","AXON/Property","JOIST/Screen"],function(t){"use strict";function e(t,e,n){(n=_.extend({backgroundColorProperty:new s(o)},n)).tandem=e,a.call(this,function(){return{}},function(){return new i(t,e.createTandem("view"),_.pick(n,["warningNode"]))},n)}var i=t("JOIST/HomeScreenView"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("AXON/Property"),a=t("JOIST/Screen"),o="black";return r.register("HomeScreen",e),n(a,e,{},{BACKGROUND_COLOR:o})}),i("SCENERY/input/InputFuzzer",["require","PHET_CORE/inherit","DOT/Random","SCENERY/scenery","DOT/Vector2"],function(t){"use strict";function e(t,e){var i=this;this.display=t,this.touches=[],this.nextTouchID=1,this.isMouseDown=!1,this.mousePosition=new s(0,0),this.random=new n({seed:e}),this.mouseToggleAction=function(){i.mouseToggle()},this.mouseMoveAction=function(){i.mouseMove()},this.touchStartAction=function(){var t=i.createTouch(i.getRandomPosition());i.touchStart(t)},this.touchMoveAction=function(){var t=i.random.sample(i.touches);i.touchMove(t)},this.touchEndAction=function(){var t=i.random.sample(i.touches);i.touchEnd(t),i.removeTouch(t)},this.touchCancelAction=function(){var t=i.random.sample(i.touches);i.touchCancel(t),i.removeTouch(t)}}var i=t("PHET_CORE/inherit"),n=t("DOT/Random"),r=t("SCENERY/scenery"),s=t("DOT/Vector2");return r.register("InputFuzzer",e),i(Object,e,{fuzzEvents:function(t,e,i,n){for(;this.random.nextDouble()<1-1/(t+1);){var r=this.touches.length+(this.isMouseDown?1:0)=this.windowSize},updateRunningAverage:function(t){return this.numSamples=Math.min(this.windowSize,this.numSamples+1),this.total-=this.samples[this.sampleIndex],this.total+=t,this.samples[this.sampleIndex]=t,this.sampleIndex=(this.sampleIndex+1)%this.windowSize,this.getRunningAverage()}})}),i("JOIST/MemoryMonitor",["require","JOIST/joist","DOT/RunningAverage"],function(t){"use strict";var e=t("JOIST/joist"),i=t("DOT/RunningAverage"),n=1048576,r=!1,s=function(){function t(e){_classCallCheck(this,t),e=_.extend({windowSize:2e3,memoryLimit:phet.chipper.queryParameters.memoryLimit},e),this.memoryLimit=e.memoryLimit*n,this.runningAverage=new i(e.windowSize),this.lastMemory=0}return _createClass(t,[{key:"measure",value:function(){if(window.performance&&window.performance.memory&&window.performance.memory.usedJSHeapSize){var e=window.performance.memory.usedJSHeapSize;this.lastMemory=e;var i=this.runningAverage.updateRunningAverage(e);if(this.memoryLimit&&this.runningAverage.isSaturated()&&!r&&i>this.memoryLimit&&e>.5*this.memoryLimit)throw r=!0,new Error("Average memory used ("+t.memoryString(i)+") is above our memoryLimit ("+t.memoryString(this.memoryLimit)+"). Current memory: "+t.memoryString(e)+".")}}}],[{key:"memoryString",value:function(t){return Math.ceil(t/n)+"MB"}}]),t}();return e.register("MemoryMonitor",s)}),i("SCENERY/display/drawables/ImageCanvasDrawable",["require","SCENERY/display/CanvasSelfDrawable","PHET_CORE/inherit","PHET_CORE/Poolable","SCENERY/scenery"],function(t){"use strict";function e(t,e){this.initializeCanvasSelfDrawable(t,e)}var i=t("SCENERY/display/CanvasSelfDrawable"),n=t("PHET_CORE/inherit"),r=t("PHET_CORE/Poolable");return t("SCENERY/scenery").register("ImageCanvasDrawable",e),n(i,e,{paintCanvas:function(t,e,i){var n=1!==e._imageOpacity;if(e._image&&0!==e._image.width&&0!==e._image.height){if(n&&(t.context.save(),t.context.globalAlpha*=e._imageOpacity),e._mipmap&&e.hasMipmaps()){var r=e.getMipmapLevel(i),s=e.getMipmapCanvas(r),a=Math.pow(2,r);t.context.drawImage(s,0,0,s.width*a,s.height*a)}else t.context.drawImage(e._image,0,0);n&&t.context.restore()}},markDirtyImage:function(){this.markPaintDirty()},markDirtyMipmap:function(){this.markPaintDirty()},markDirtyImageOpacity:function(){this.markPaintDirty()}}),r.mixInto(e),e}),i("SCENERY/display/drawables/ImageStatefulDrawable",["require","PHET_CORE/inheritance","SCENERY/scenery","SCENERY/display/SelfDrawable"],function(t){"use strict";t("PHET_CORE/inheritance");var e=t("SCENERY/scenery"),i=(t("SCENERY/display/SelfDrawable"),{mixInto:function(t){var e=t.prototype;e.initializeState=function(t,e){return this.paintDirty=!0,this.dirtyImage=!0,this.dirtyImageOpacity=!0,this.dirtyMipmap=!0,this},e.disposeState=function(){},e.markPaintDirty=function(){this.paintDirty=!0,this.markDirty()},e.markDirtyImage=function(){this.dirtyImage=!0,this.markPaintDirty()},e.markDirtyImageOpacity=function(){this.dirtyImageOpacity=!0,this.markPaintDirty()},e.markDirtyMipmap=function(){this.dirtyMipmap=!0,this.markPaintDirty()},e.setToCleanState=function(){this.paintDirty=!1,this.dirtyImage=!1,this.dirtyImageOpacity=!1,this.dirtyMipmap=!1}}});return e.register("ImageStatefulDrawable",i),i}),i("SCENERY/display/drawables/ImageDOMDrawable",["require","SCENERY/display/DOMSelfDrawable","SCENERY/display/drawables/ImageStatefulDrawable","PHET_CORE/inherit","PHET_CORE/Poolable","SCENERY/scenery","SCENERY/util/Util"],function(t){"use strict";function e(t,e){this.initializeDOMSelfDrawable(t,e),this.initializeState(t,e),this.domElement||(this.domElement=document.createElement("img"),this.domElement.style.display="block",this.domElement.style.position="absolute",this.domElement.style.pointerEvents="none",this.domElement.style.left="0",this.domElement.style.top="0"),this.hasOpacity=!1,a.Util.prepareForTransform(this.domElement,this.forceAcceleration)}var i=t("SCENERY/display/DOMSelfDrawable"),n=t("SCENERY/display/drawables/ImageStatefulDrawable"),r=t("PHET_CORE/inherit"),s=t("PHET_CORE/Poolable"),a=t("SCENERY/scenery");t("SCENERY/util/Util");return a.register("ImageDOMDrawable",e),r(i,e,{updateDOM:function(){var t=this.node,e=this.domElement;this.paintDirty&&this.dirtyImage&&(e.src=t._image?t._image.src:"//:0"),this.dirtyImageOpacity&&(1===t._imageOpacity?this.hasOpacity&&(this.hasOpacity=!1,e.style.opacity=""):(this.hasOpacity=!0,e.style.opacity=t._imageOpacity)),this.transformDirty&&a.Util.applyPreparedTransform(this.getTransformMatrix(),this.domElement,this.forceAcceleration),this.setToCleanState(),this.transformDirty=!1},dispose:function(){this.disposeState(),i.prototype.dispose.call(this)}}),n.mixInto(e),s.mixInto(e),e}),i("SCENERY/display/drawables/ImageSVGDrawable",["require","SCENERY/display/drawables/ImageStatefulDrawable","PHET_CORE/inherit","PHET_CORE/platform","PHET_CORE/Poolable","SCENERY/scenery","SCENERY/display/SVGSelfDrawable"],function(t){"use strict";function e(t,e){this.initializeSVGSelfDrawable(t,e,!1,l);var i=this;this.svgElement=this.svgElement||document.createElementNS(a.svgns,"image"),this.svgElement.setAttribute("x",0),this.svgElement.setAttribute("y",0),this.hasOpacity=!1,this._usingMipmap=!1,this._mipmapLevel=-1,this._mipmapTransformListener=this._mipmapTransformListener||function(){i.markDirtyMipmap()},this._mipmapListener=this._mipmapListener||function(){i.markDirtyMipmap(),i.updateMipmapStatus(i.node._mipmap)},this.node.onStatic("mipmap",this._mipmapListener),this.updateMipmapStatus(e.node._mipmap)}var i=t("SCENERY/display/drawables/ImageStatefulDrawable"),n=t("PHET_CORE/inherit"),r=t("PHET_CORE/platform"),s=t("PHET_CORE/Poolable"),a=t("SCENERY/scenery"),o=t("SCENERY/display/SVGSelfDrawable"),l=!0;return a.register("ImageSVGDrawable",e),n(o,e,{updateSVGSelf:function(){var t=this.svgElement;this.dirtyImage?this.node._image?this.updateURL(t,!0):(t.setAttribute("width","0"),t.setAttribute("height","0"),t.setAttributeNS(a.xlinkns,"xlink:href","//:0")):this.dirtyMipmap&&this.node._image&&this.updateURL(t,!1),this.dirtyImageOpacity&&(1===this.node._imageOpacity?this.hasOpacity&&(this.hasOpacity=!1,t.removeAttribute("opacity")):(this.hasOpacity=!0,t.setAttribute("opacity",this.node._imageOpacity)))},updateURL:function(t,e){var i=-1;if(this.node._mipmap&&(i=this.node.getMipmapLevel(this.instance.relativeTransform.matrix)),e||i!==this._mipmapLevel)if(this._mipmapLevel>=0&&-1===i&&(r.ie9||r.ie10?t.setAttribute("transform",""):t.removeAttribute("transform")),this._mipmapLevel=i,this.node._mipmap&&this.node.hasMipmaps()){var n=this.node.getMipmapURL(i),s=this.node.getMipmapCanvas(i);t.setAttribute("width",s.width+"px"),t.setAttribute("height",s.height+"px"),t.setAttribute("transform","scale("+Math.pow(2,i).toFixed(20)+")"),t.setAttributeNS(a.xlinkns,"xlink:href",n)}else t.setAttribute("width",this.node.getImageWidth()+"px"),t.setAttribute("height",this.node.getImageHeight()+"px"),t.setAttributeNS(a.xlinkns,"xlink:href",this.node.getImageURL())},updateMipmapStatus:function(t){this._usingMipmap!==t&&(this._usingMipmap=t,t?(this.instance.relativeTransform.addListener(this._mipmapTransformListener),this.instance.relativeTransform.addPrecompute()):(this.instance.relativeTransform.removeListener(this._mipmapTransformListener),this.instance.relativeTransform.removePrecompute()),this.markDirtyMipmap())},dispose:function(){this.updateMipmapStatus(!1),this.node.offStatic("mipmap",this._mipmapListener),o.prototype.dispose.call(this)}}),i.mixInto(e),s.mixInto(e),e}),i("SCENERY/display/drawables/ImageWebGLDrawable",["require","SCENERY/display/drawables/ImageStatefulDrawable","PHET_CORE/inherit","PHET_CORE/Poolable","SCENERY/display/Renderer","SCENERY/scenery","DOT/Vector2","SCENERY/display/WebGLSelfDrawable"],function(t){"use strict";function e(t,e){this.initializeWebGLSelfDrawable(t,e),this.vertexArray||(this.vertexArray=new Float32Array(6*h)),this.upperLeft=new o(0,0),this.lowerLeft=new o(0,0),this.upperRight=new o(0,0),this.lowerRight=new o(0,0),this.xyDirty=!0,this.uvDirty=!0,this.updatedOnce=!1,this.sprite=null}var i=t("SCENERY/display/drawables/ImageStatefulDrawable"),n=t("PHET_CORE/inherit"),r=t("PHET_CORE/Poolable"),s=t("SCENERY/display/Renderer"),a=t("SCENERY/scenery"),o=t("DOT/Vector2"),l=t("SCENERY/display/WebGLSelfDrawable"),h=5,u=0*h,c=1*h,d=2*h,p=3*h,m=4*h,f=5*h;return a.register("ImageWebGLDrawable",e),n(l,e,{webglRenderer:s.webglTexturedTriangles,onAddToBlock:function(t){this.webglBlock=t,this.markDirty(),this.reserveSprite()},onRemoveFromBlock:function(t){this.unreserveSprite()},reserveSprite:function(){if(this.sprite){if(this.sprite.image===this.node._image)return;this.unreserveSprite()}var t=this.node.getImageWidth(),e=this.node.getImageHeight();this.sprite=t>0&&e>0?this.webglBlock.addSpriteSheetImage(this.node._image,t,e):null,this.xyDirty=!0,this.uvDirty=!0},unreserveSprite:function(){this.sprite&&this.webglBlock.removeSpriteSheetImage(this.sprite),this.sprite=null},markTransformDirty:function(){this.xyDirty=!0,l.prototype.markTransformDirty.call(this)},markPaintDirty:function(){this.xyDirty=!0,this.uvDirty=!0,this.markDirty()},update:function(){if(!l.prototype.update.call(this))return!1;if(this.reserveSprite(),!this.dirtyImageOpacity&&this.updatedOnce||(this.vertexArray[u+4]=this.node._imageOpacity,this.vertexArray[c+4]=this.node._imageOpacity,this.vertexArray[d+4]=this.node._imageOpacity,this.vertexArray[p+4]=this.node._imageOpacity,this.vertexArray[m+4]=this.node._imageOpacity,this.vertexArray[f+4]=this.node._imageOpacity),this.updatedOnce=!0,!this.sprite)return!1;if(this.uvDirty){this.uvDirty=!1;var t=this.sprite.uvBounds;this.vertexArray[u+2]=t.minX,this.vertexArray[u+3]=t.minY,this.vertexArray[c+2]=t.minX,this.vertexArray[c+3]=t.maxY,this.vertexArray[d+2]=t.maxX,this.vertexArray[d+3]=t.minY,this.vertexArray[p+2]=t.maxX,this.vertexArray[p+3]=t.minY,this.vertexArray[m+2]=t.minX,this.vertexArray[m+3]=t.maxY,this.vertexArray[f+2]=t.maxX,this.vertexArray[f+3]=t.maxY}if(this.xyDirty){this.xyDirty=!1;var e=this.node.getImageWidth(),i=this.node.getImageHeight(),n=this.instance.relativeTransform.matrix;n.multiplyVector2(this.upperLeft.setXY(0,0)),n.multiplyVector2(this.lowerLeft.setXY(0,i)),n.multiplyVector2(this.upperRight.setXY(e,0)),n.multiplyVector2(this.lowerRight.setXY(e,i)),this.vertexArray[u+0]=this.upperLeft.x,this.vertexArray[u+1]=this.upperLeft.y,this.vertexArray[c+0]=this.lowerLeft.x,this.vertexArray[c+1]=this.lowerLeft.y,this.vertexArray[d+0]=this.upperRight.x,this.vertexArray[d+1]=this.upperRight.y,this.vertexArray[p+0]=this.upperRight.x,this.vertexArray[p+1]=this.upperRight.y,this.vertexArray[m+0]=this.lowerLeft.x,this.vertexArray[m+1]=this.lowerLeft.y,this.vertexArray[f+0]=this.lowerRight.x,this.vertexArray[f+1]=this.lowerRight.y}return!0},dispose:function(){l.prototype.dispose.call(this)}}),i.mixInto(e),r.mixInto(e),e}),i("SCENERY/nodes/Image",["require","DOT/Bounds2","PHET_CORE/cleanArray","PHET_CORE/extendDefined","SCENERY/display/drawables/ImageCanvasDrawable","SCENERY/display/drawables/ImageDOMDrawable","SCENERY/display/drawables/ImageSVGDrawable","SCENERY/display/drawables/ImageWebGLDrawable","PHET_CORE/inherit","SCENERY/nodes/Node","SCENERY/display/Renderer","SCENERY/scenery","SCENERY/util/SpriteSheet","DOT/Util"],function(t){"use strict";function e(t,e){this._initialWidth=g.initialWidth,this._initialHeight=g.initialHeight,this._imageOpacity=g.imageOpacity,this._mipmap=g.mipmap,this._mipmapBias=g.mipmapBias,this._mipmapInitialLevel=g.mipmapInitialLevel,this._mipmapMaxLevel=g.mipmapMaxLevel,this._mipmapCanvases=[],this._mipmapURLs=[],this._mipmapData=null,this._imageLoadListener=this.onImageLoad.bind(this),this._imageLoadListenerAttached=!1,e=r({image:t},e),u.call(this,e),this.invalidateSupportedRenderers()}var i=t("DOT/Bounds2"),n=t("PHET_CORE/cleanArray"),r=t("PHET_CORE/extendDefined"),s=t("SCENERY/display/drawables/ImageCanvasDrawable"),a=t("SCENERY/display/drawables/ImageDOMDrawable"),o=t("SCENERY/display/drawables/ImageSVGDrawable"),l=t("SCENERY/display/drawables/ImageWebGLDrawable"),h=t("PHET_CORE/inherit"),u=t("SCENERY/nodes/Node"),c=t("SCENERY/display/Renderer"),d=t("SCENERY/scenery"),p=t("SCENERY/util/SpriteSheet"),m=t("DOT/Util"),f=Math.log2||function(t){return Math.log(t)/Math.LN2},g={imageOpacity:1,initialWidth:0,initialHeight:0,mipmap:!1,mipmapBias:0,mipmapInitialLevel:4,mipmapMaxLevel:5};return d.register("Image",e),h(u,e,{_mutatorKeys:["image","imageOpacity","initialWidth","initialHeight","mipmap","mipmapBias","mipmapInitialLevel","mipmapMaxLevel"].concat(u.prototype._mutatorKeys),drawableMarkFlags:u.prototype.drawableMarkFlags.concat(["image","imageOpacity","mipmap"]),setImage:function(t){var e=this._image!==t;if(e&&"string"==typeof t&&(this._image&&t===this._image.src&&(e=!1),t===this._mipmapData&&(e=!1)),e){if(this._initialWidth=0,this._initialHeight=0,this._image&&this._imageLoadListenerAttached&&this.detachImageLoadListener(),this._mipmapData=null,"string"==typeof t){var i=t;(t=document.createElement("img")).src=i}else Array.isArray(t)&&(this._mipmapData=t,t=t[0].img,this._mipmapInitialLevel=this._mipmapMaxLevel=this._mipmapData.length,this._mipmap=!0);this._image=t,!(this._image instanceof HTMLImageElement)||this._image.width&&this._image.height||this.attachImageLoadListener(),this.invalidateImage()}return this},set image(t){this.setImage(t)},getImage:function(){return this._image},get image(){return this.getImage()},invalidateImage:function(){this._image?this.invalidateSelf(new i(0,0,this.getImageWidth(),this.getImageHeight())):this.invalidateSelf(i.NOTHING);for(var t=this._drawables.length,e=0;e2){var i=document.createElement("canvas");if(i.width=Math.ceil(e.width/2),i.height=Math.ceil(e.height/2),i.width>0&&i.height>0){var n=i.getContext("2d");n.scale(.5,.5),n.drawImage(e,0,0),this._mipmapCanvases.push(i),this._mipmapURLs.push(i.toDataURL())}}},invalidateMipmaps:function(){if(n(this._mipmapCanvases),n(this._mipmapURLs),this._image&&this._mipmap)if(this._mipmapData)for(var t=0;t=1)return 0;var i=f(1/e);if((i=m.roundSymmetric(i+this._mipmapBias-.7))<0&&(i=0),i>this._mipmapMaxLevel&&(i=this._mipmapMaxLevel),this.mipmap&&!this._mipmapCanvases[i]){for(var n=this._mipmapCanvases.length-1;++n<=i;)this.constructNextMipmap();return Math.min(i,this._mipmapCanvases.length-1)}return i},getMipmapCanvas:function(t){return this._mipmapData&&this._mipmapData[t]&&this._mipmapData[t].updateCanvas&&this._mipmapData[t].updateCanvas(),this._mipmapCanvases[t]},getMipmapURL:function(t){return this._mipmapURLs[t]},hasMipmaps:function(){return this._mipmapCanvases.length>0},getImageWidth:function(){var t=this._mipmapData?this._mipmapData[0].width:this._image.naturalWidth||this._image.width;return 0===t?this._initialWidth:t},get imageWidth(){return this.getImageWidth()},getImageHeight:function(){var t=this._mipmapData?this._mipmapData[0].height:this._image.naturalHeight||this._image.height;return 0===t?this._initialHeight:t},get imageHeight(){return this.getImageHeight()},getImageURL:function(){return this._image.src},isPainted:function(){return!0},canvasPaintSelf:function(t,e){s.prototype.paintCanvas(t,this,e)},createDOMDrawable:function(t,e){return a.createFromPool(t,e)},createSVGDrawable:function(t,e){return o.createFromPool(t,e)},createCanvasDrawable:function(t,e){return s.createFromPool(t,e)},createWebGLDrawable:function(t,e){return l.createFromPool(t,e)},attachImageLoadListener:function(){this.isDisposed||(this._image.addEventListener("load",this._imageLoadListener),this._imageLoadListenerAttached=!0)},detachImageLoadListener:function(){this._image.removeEventListener("load",this._imageLoadListener),this._imageLoadListenerAttached=!1},onImageLoad:function(){this.invalidateImage(),this.detachImageLoadListener()},dispose:function(){this._image&&this._imageLoadListenerAttached&&this.detachImageLoadListener(),u.prototype.dispose.call(this)}}),e.createSVGImage=function(t,e,i){var n=document.createElementNS(d.svgns,"image");return n.setAttribute("x",0),n.setAttribute("y",0),n.setAttribute("width",e+"px"),n.setAttribute("height",i+"px"),n.setAttributeNS(d.xlinkns,"xlink:href",t),n},e.createFastMipmapFromCanvas=function(t){var e=[],i=t.toDataURL(),n=new window.Image;n.src=i,e.push({img:n,url:i,width:t.width,height:t.height,canvas:t});for(var r=t;r.width>=2&&r.height>=2;){var s={},a=document.createElement("canvas");a.width=s.width=Math.ceil(r.width/2),a.height=s.height=Math.ceil(r.height/2);var o=a.getContext("2d");o.setTransform(.5,0,0,.5,0,0),o.drawImage(r,0,0),s.canvas=a,s.url=a.toDataURL(),s.img=new window.Image,s.img.src=s.url,r=a,e.push(s)}return e},e.DEFAULT_OPTIONS=_.extend({},u.DEFAULT_OPTIONS,g),e}),i("JOIST/HighlightNode",["require","SCENERY/util/Color","SCENERY/nodes/HBox","PHET_CORE/inherit","JOIST/joist","SCENERY/util/LinearGradient","SCENERY/nodes/Rectangle"],function(t){"use strict";function e(t,e,r){var s=(r=_.extend({fill:"white",highlightWidth:1,pickable:!1},r)).fill,l=i.toColor(s).withAlpha(0),h={fill:new a(0,0,0,e).addColorStop(0,l).addColorStop(.5,s).addColorStop(1,l)},u=new o(0,0,r.highlightWidth,e,h),c=new o(0,0,r.highlightWidth,e,h);r.children=[u,c],r.spacing=t,n.call(this,r)}var i=t("SCENERY/util/Color"),n=t("SCENERY/nodes/HBox"),r=t("PHET_CORE/inherit"),s=t("JOIST/joist"),a=t("SCENERY/util/LinearGradient"),o=t("SCENERY/nodes/Rectangle");return s.register("HighlightNode",e),r(n,e)}),i("JOIST/JoistButton",["require","SUN/buttons/ButtonInteractionState","SCENERY/accessibility/FocusHighlightPath","JOIST/HighlightNode","PHET_CORE/inherit","JOIST/joist","SCENERY/nodes/Node","AXON/Property","SUN/buttons/PushButtonInteractionStateProperty","SUN/buttons/PushButtonModel","KITE/Shape"],function(t){"use strict";function e(t,e,s,a){(a=_.extend({cursor:"pointer",listener:null,highlightExtensionWidth:0,highlightExtensionHeight:0,highlightCenterOffsetX:0,highlightCenterOffsetY:0},a)).tandem=s,this.buttonModel=new u(a);var d=function(e){return new r(t.width+a.highlightExtensionWidth,t.height+a.highlightExtensionHeight,{centerX:t.centerX+a.highlightCenterOffsetX,centerY:t.centerY+a.highlightCenterOffsetY,fill:e,pickable:!1})},p=d("white"),m=d("black");o.call(this,_.extend({children:[t,p,m]}));var f=new h(this.buttonModel);this.interactionStateProperty=f,l.multilink([f,e],function(t,e){var n="black"!==e;p.visible=!n&&(t===i.OVER||t===i.PRESSED),m.visible=n&&(t===i.OVER||t===i.PRESSED)});var g=this.buttonModel.createListener({tandem:s.createTandem("pressListener")});this.addInputListener(g),this.mouseArea=this.touchArea=c.bounds(this.bounds),this.mutate(a);var E=n.getOuterLineWidthFromNode(this);this.focusHighlight=c.bounds(this.bounds.shiftedY(-E))}var i=t("SUN/buttons/ButtonInteractionState"),n=t("SCENERY/accessibility/FocusHighlightPath"),r=t("JOIST/HighlightNode"),s=t("PHET_CORE/inherit"),a=t("JOIST/joist"),o=t("SCENERY/nodes/Node"),l=t("AXON/Property"),h=t("SUN/buttons/PushButtonInteractionStateProperty"),u=t("SUN/buttons/PushButtonModel"),c=t("KITE/Shape");return a.register("JoistButton",e),s(o,e)}),i("SUN/DialogIO",["require","SCENERY/nodes/NodeIO","TANDEM/phetioInherit","SUN/sun"],function(t){"use strict";function e(t,e){i.call(this,t,e)}var i=t("SCENERY/nodes/NodeIO"),n=t("TANDEM/phetioInherit"),r=t("SUN/sun");return n(i,"DialogIO",e,{},{documentation:"A dialog panel",validator:{isValidValue:function(t){return t instanceof phet.sun.Dialog}}}),r.register("DialogIO",e),e}),i("SUN/buttons/RectangularButtonView",["require","SCENERY/nodes/AlignBox","DOT/Bounds2","SUN/buttons/ButtonInteractionState","SCENERY/util/Color","SUN/ColorConstants","AXON/DerivedProperty","PHET_CORE/inherit","SCENERY/util/LinearGradient","SCENERY/nodes/Node","SCENERY/util/PaintColorProperty","SCENERY/nodes/Path","KITE/Shape","SUN/sun","TANDEM/Tandem"],function(t){"use strict";function e(t,a,l){function h(t){w.cursor=t===s.DISABLED||t===s.DISABLED_PRESSED?null:"pointer"}l=_.extend({content:null,minWidth:y+A,minHeight:E+A,cursor:"pointer",baseColor:v,disabledBaseColor:o.LIGHT_GRAY,xMargin:8,yMargin:5,fireOnDown:!1,touchAreaXDilation:0,touchAreaYDilation:0,mouseAreaXDilation:0,mouseAreaYDilation:0,stroke:void 0,lineWidth:.5,xAlign:"center",yAlign:"center",cornerRadius:4,leftTopCornerRadius:null,rightTopCornerRadius:null,leftBottomCornerRadius:null,rightBottomCornerRadius:null,buttonAppearanceStrategy:e.ThreeDAppearanceStrategy,contentAppearanceStrategy:e.FadeContentWhenDisabled,tagName:"button",tandem:g.optional},l),this.buttonModel=t,c.call(this);var u=l.content;this._pressListener=t.createListener({tandem:l.tandem.createTandem("pressListener"),accessibleClick:l.accessibleClick}),this.addInputListener(this._pressListener),this.baseColorProperty=new d(l.baseColor);var m=Math.max(u?u.width+2*l.xMargin:0,l.minWidth),f=Math.max(u?u.height+2*l.yMargin:0,l.minHeight),b=new p(i(m,f,l),{fill:l.baseColor,lineWidth:l.lineWidth});if(this.addChild(b),u){u&&(u.pickable=!1);var S=new n(u,{alignBounds:new r(l.xMargin,l.yMargin,b.width-l.xMargin,f-l.yMargin),xAlign:l.xAlign,yAlign:l.yAlign});this.addChild(S)}var T=new l.buttonAppearanceStrategy(b,a,this.baseColorProperty,l),C=new l.contentAppearanceStrategy(u,a,l),w=this;a.link(h),this.touchArea=b.localBounds.dilatedXY(l.touchAreaXDilation,l.touchAreaYDilation),this.mouseArea=b.localBounds.dilatedXY(l.mouseAreaXDilation,l.mouseAreaYDilation),this.mutate(l),this.disposeRectangularButtonView=function(){T.dispose(),C.dispose(),this.baseColorProperty.dispose(),this._pressListener.dispose(),a.hasListener(h)&&a.unlink(h),u&&S.dispose()}}function i(t,e,i){return m.roundedRectangleWithRadii(0,0,t,e,{topLeft:null!==i.leftTopCornerRadius?i.leftTopCornerRadius:i.cornerRadius,topRight:null!==i.rightTopCornerRadius?i.rightTopCornerRadius:i.cornerRadius,bottomLeft:null!==i.leftBottomCornerRadius?i.leftBottomCornerRadius:i.cornerRadius,bottomRight:null!==i.rightBottomCornerRadius?i.rightBottomCornerRadius:i.cornerRadius})}var n=t("SCENERY/nodes/AlignBox"),r=t("DOT/Bounds2"),s=t("SUN/buttons/ButtonInteractionState"),a=t("SCENERY/util/Color"),o=t("SUN/ColorConstants"),l=t("AXON/DerivedProperty"),h=t("PHET_CORE/inherit"),u=t("SCENERY/util/LinearGradient"),c=t("SCENERY/nodes/Node"),d=t("SCENERY/util/PaintColorProperty"),p=t("SCENERY/nodes/Path"),m=t("KITE/Shape"),f=t("SUN/sun"),g=t("TANDEM/Tandem"),E=7,y=7,A=3,v=o.LIGHT_BLUE;return f.register("RectangularButtonView",e),e.ThreeDAppearanceStrategy=function(t,e,n,r){function o(e){switch(e){case s.IDLE:t.fill=B,X.stroke=h,X.fill=H;break;case s.OVER:t.fill=q,X.stroke=h,X.fill=F;break;case s.PRESSED:t.fill=G,X.stroke=h,X.fill=F;break;case s.DISABLED:t.fill=U,t.stroke=c,X.stroke=c,X.fill=W;break;case s.DISABLED_PRESSED:t.fill=z,t.stroke=c,X.stroke=c,X.fill=W;break;default:throw new Error("unsupported interactionState: "+e)}}var h,c,m=t.width,f=t.height,g=Math.min(E/f,1),v=Math.max(1-A/f,0),b=Math.min(y/m,1),S=Math.max(1-A/m,0),T=new a(255,255,255,.7),C=new d(n,{luminanceFactor:.7}),w=new d(n,{luminanceFactor:.5}),_=new d(n,{luminanceFactor:.2}),R=new d(n,{luminanceFactor:-.3}),N=new d(n,{luminanceFactor:-.4}),P=new d(n,{luminanceFactor:-.5}),O=new d(r.disabledBaseColor),I=new d(r.disabledBaseColor,{luminanceFactor:.7}),D=new d(r.disabledBaseColor,{luminanceFactor:.5}),x=new d(r.disabledBaseColor,{luminanceFactor:.2}),k=new d(r.disabledBaseColor,{luminanceFactor:-.3}),M=new d(r.disabledBaseColor,{luminanceFactor:-.4}),V=new d(r.disabledBaseColor,{luminanceFactor:-.5}),L=new l([n],function(t){return t.withAlpha(0)}),Y=new l([O],function(t){return t.withAlpha(0)}),B=new u(0,0,0,f).addColorStop(0,C).addColorStop(g,n).addColorStop(v,n).addColorStop(1,P),H=new u(0,0,m,0).addColorStop(0,T).addColorStop(b,L).addColorStop(S,L).addColorStop(1,P),q=new u(0,0,0,f).addColorStop(0,C).addColorStop(g,w).addColorStop(v,w).addColorStop(1,P),F=new u(0,0,m,0).addColorStop(0,T).addColorStop(b/2,new a(255,255,255,0)).addColorStop(S,L).addColorStop(1,R),G=new u(0,0,0,f).addColorStop(0,C).addColorStop(.67*g,R).addColorStop(v,_).addColorStop(1,P),U=new u(0,0,0,f).addColorStop(0,I).addColorStop(g,D).addColorStop(v,D).addColorStop(1,V),W=new u(0,0,m,0).addColorStop(0,I).addColorStop(b,Y).addColorStop(S,Y).addColorStop(1,V),z=new u(0,0,0,f).addColorStop(0,I).addColorStop(.67*g,k).addColorStop(v,x).addColorStop(1,V);null===r.stroke?(h=null,c=null):void 0===r.stroke?(h=N,c=M):(h=r.stroke,c=M);var X=new p(i(m,f,r),{lineWidth:r.lineWidth,pickable:!1});t.addChild(X),t.cachedPaints=[B,q,G,U,z,c],X.cachedPaints=[H,F,W,h,c],e.link(o),this.dispose=function(){e.hasListener(o)&&e.unlink(o),L.dispose(),Y.dispose(),O.dispose(),C.dispose(),w.dispose(),_.dispose(),R.dispose(),N.dispose(),P.dispose(),I.dispose(),D.dispose(),x.dispose(),k.dispose(),M.dispose(),V.dispose()}},e.FlatAppearanceStrategy=function(t,e,i,n){function r(e){switch(e){case s.IDLE:t.fill=c,t.stroke=a;break;case s.OVER:t.fill=p,t.stroke=a;break;case s.PRESSED:t.fill=m,t.stroke=a;break;case s.DISABLED:t.fill=f,t.stroke=o;break;case s.DISABLED_PRESSED:t.fill=g,t.stroke=o;break;default:throw new Error("unsupported interactionState: "+e)}}var a,o,l=new d(i,{luminanceFactor:.4}),h=new d(i,{luminanceFactor:-.4}),u=new d(n.disabledBaseColor,{luminanceFactor:-.4}),c=i,p=l,m=h,f=n.disabledBaseColor,g=f;null===n.stroke?(a=null,o=null):void 0===n.stroke?(a=h,o=u):(a=n.stroke,o=u),t.cachedPaints=[c,p,m,f,g,a,o],e.link(r),this.dispose=function(){e.hasListener(r)&&e.unlink(r),l.dispose(),h.dispose(),u.dispose()}},e.FadeContentWhenDisabled=function(t,e){function i(e){t&&(t.opacity=e===s.DISABLED||e===s.DISABLED_PRESSED?.3:1)}e.link(i),this.dispose=function(){e.hasListener(i)&&e.unlink(i)}},h(c,e,{setEnabled:function(t){this.buttonModel.enabledProperty.set(t)},set enabled(t){this.setEnabled(t)},getEnabled:function(){return this.buttonModel.enabledProperty.get()},get enabled(){return this.getEnabled()},setBaseColor:function(t){this.baseColorProperty.paint=t},set baseColor(t){this.setBaseColor(t)},getBaseColor:function(){return this.baseColorProperty.value},get baseColor(){return this.getBaseColor()},a11yClick:function(){this._pressListener.click()},dispose:function(){this.disposeRectangularButtonView(),c.prototype.dispose.call(this)}})}),i("SUN/buttons/RectangularPushButton",["require","PHET_CORE/inherit","PHET_CORE/documentation/InstanceRegistry","SUN/buttons/PushButtonInteractionStateProperty","SUN/buttons/PushButtonModel","SUN/buttons/RectangularButtonView","SUN/sun","TANDEM/Tandem"],function(t){"use strict";function e(t){var e=(t=_.extend({tandem:o.required},t)).listener;t=_.omit(t,["listener"]),this.buttonModel=new r(t),e&&this.addListener(e),s.call(this,this.buttonModel,new n(this.buttonModel),t),this.disposeRectangularPushButton=function(){this.buttonModel.dispose()}}var i=t("PHET_CORE/inherit"),n=(t("PHET_CORE/documentation/InstanceRegistry"),t("SUN/buttons/PushButtonInteractionStateProperty")),r=t("SUN/buttons/PushButtonModel"),s=t("SUN/buttons/RectangularButtonView"),a=t("SUN/sun"),o=t("TANDEM/Tandem");return a.register("RectangularPushButton",e),i(s,e,{dispose:function(){this.disposeRectangularPushButton(),s.prototype.dispose.call(this)},addListener:function(t){this.buttonModel.addListener(t)},removeListener:function(t){this.buttonModel.removeListener(t)}})}),i("SUN/SunA11yStrings",["require","SUN/sun"],function(t){"use strict";var e=t("SUN/sun"),i={accordionBoxCollapse:{value:"Collapse"},accordionBoxExpand:{value:"Expand"},close:{value:"Close"}};if("xss"===phet.chipper.queryParameters.stringTest)for(var n in i)i[n].value+='';return e.register("SunA11yStrings",i),i}),i("SUN/Dialog",["require","SCENERY/accessibility/AccessibilityUtil","SCENERY/accessibility/AccessiblePeer","SCENERY/nodes/AlignBox","AXON/BooleanProperty","SUN/DialogIO","SCENERY/display/Display","SCENERY/util/FullScreen","SCENERY/nodes/HBox","PHET_CORE/inherit","SCENERY/accessibility/KeyboardUtil","SUN/Panel","SCENERY/nodes/Path","AXON/Property","SUN/buttons/RectangularButtonView","SUN/buttons/RectangularPushButton","KITE/Shape","SUN/sun","SUN/SunA11yStrings","TANDEM/Tandem","SCENERY/nodes/VBox"],function(t){"use strict";function e(t,c){var m=this;(c=_.extend({xSpacing:10,ySpacing:10,topMargin:15,bottomMargin:15,leftMargin:null,closeButtonTopMargin:10,closeButtonRightMargin:10,modal:!0,title:null,titleAlign:"center",layoutStrategy:e.DEFAULT_LAYOUT_STRATEGY,closeButtonListener:function(){return m.hide()},closeButtonTouchAreaXDilation:0,closeButtonTouchAreaYDilation:0,closeButtonMouseAreaXDilation:0,closeButtonMouseAreaYDilation:0,showCallback:null,hideCallback:null,cornerRadius:10,resize:!0,fill:"white",stroke:"black",backgroundPickable:!0,tandem:b.optional,phetioType:o,phetioReadOnly:!1,phetioState:!1,tagName:"div",ariaRole:"dialog",focusOnCloseNode:null,addAriaLabelledByFromTitle:!0},c)).tandem=b.optional,c.xMargin=0,c.yMargin=0,null===c.leftMargin&&(c.leftMargin=c.xSpacing+C+c.closeButtonRightMargin),this.isModal=c.modal,this.showCallback=c.showCallback,this.hideCallback=c.hideCallback,this.isShowingProperty=new a(!1,{tandem:c.tandem.createTandem("isShowingProperty"),phetioReadOnly:!0,phetioState:c.phetioState});var g=new i({iconLength:C,listener:function(){c.closeButtonListener(),g.buttonModel.isA11yClicking()&&m.focusActiveElement()},tandem:c.tandem.createTandem("closeButton"),phetioReadOnly:c.phetioReadOnly,phetioState:c.phetioState,tagName:"button",innerContent:T});g.touchArea=g.bounds.dilatedXY(c.closeButtonTouchAreaXDilation,c.closeButtonTouchAreaYDilation),g.mouseArea=g.bounds.dilatedXY(c.closeButtonMouseAreaXDilation,c.closeButtonMouseAreaYDilation),this.closeButton=g;var E=new S({children:c.title?[c.title,t]:[t],spacing:c.ySpacing,align:c.titleAlign}),y=new s(E,{topMargin:c.topMargin,bottomMargin:c.bottomMargin,leftMargin:c.leftMargin}),A=new s(g,{topMargin:c.closeButtonTopMargin,rightMargin:c.closeButtonRightMargin}),v=new u({children:[y,A],spacing:c.xSpacing,align:"top"});p.call(this,v,c);var w=window.phet.joist.sim;this.updateLayoutMultilink=f.multilink([w.boundsProperty,w.screenBoundsProperty,w.scaleProperty],function(t,e,i){t&&e&&i&&c.layoutStrategy(m,t,e,i)}),this.sim=w,this.accessibleOrder=[g,c.title,t].filter(function(t){return void 0!==t}),c.title&&c.title.tagName&&c.addAriaLabelledByFromTitle&&this.addAriaLabelledbyAssociation({thisElementName:r.PRIMARY_SIBLING,otherNode:c.title,otherElementName:r.PRIMARY_SIBLING}),this.activeElement=c.focusOnCloseNode||null;var R={keydown:function(t){var e=t.domEvent;if(e.keyCode===d.KEY_ESCAPE)e.preventDefault(),m.hide(),m.focusActiveElement();else if(e.keyCode===d.KEY_TAB&&h.isFullScreen()){var i=l.focus.trail.getUniqueId(),r=n.getNextFocusable().id===i,s=n.getPreviousFocusable().id===i;r&&s&&e.preventDefault()}}};this.addInputListener(R),this.disposeDialog=function(){m.updateLayoutMultilink.dispose(),m.removeInputListener(R),m.isShowingProperty.dispose(),g.dispose(),v.removeAllChildren(),v.detach()}}function i(t){t=_.extend({iconLength:7,baseColor:"transparent",buttonAppearanceStrategy:g.FlatAppearanceStrategy,xMargin:0,yMargin:0,listener:null},t);var e=(new y).moveTo(-t.iconLength/2,-t.iconLength/2).lineTo(t.iconLength/2,t.iconLength/2).moveTo(t.iconLength/2,-t.iconLength/2).lineTo(-t.iconLength/2,t.iconLength/2);t.content=new m(e,{stroke:"black",lineCap:"round",lineWidth:2}),E.call(this,t)}var n=t("SCENERY/accessibility/AccessibilityUtil"),r=t("SCENERY/accessibility/AccessiblePeer"),s=t("SCENERY/nodes/AlignBox"),a=t("AXON/BooleanProperty"),o=t("SUN/DialogIO"),l=t("SCENERY/display/Display"),h=t("SCENERY/util/FullScreen"),u=t("SCENERY/nodes/HBox"),c=t("PHET_CORE/inherit"),d=t("SCENERY/accessibility/KeyboardUtil"),p=t("SUN/Panel"),m=t("SCENERY/nodes/Path"),f=t("AXON/Property"),g=t("SUN/buttons/RectangularButtonView"),E=t("SUN/buttons/RectangularPushButton"),y=t("KITE/Shape"),A=t("SUN/sun"),v=t("SUN/SunA11yStrings"),b=t("TANDEM/Tandem"),S=t("SCENERY/nodes/VBox"),T=v.close.value,C=14;return A.register("Dialog",e),e.DEFAULT_LAYOUT_STRATEGY=function(t,e,i,n){t.center=e.center.times(1/n)},c(p,e,{show:function(){this.isShowingProperty.value||(window.phet.joist.sim.showPopup(this,this.isModal),this.isShowingProperty.value=!0,this.activeElement=this.activeElement||l.focusedNode,this.sim.setAccessibleViewsVisible(!1),this.showCallback&&this.showCallback())},hide:function(){this.isShowingProperty.value&&(window.phet.joist.sim.hidePopup(this,this.isModal),this.isShowingProperty.value=!1,this.sim.setAccessibleViewsVisible(!0),this.hideCallback&&this.hideCallback())},dispose:function(){this.hide(),this.disposeDialog(),p.prototype.dispose.call(this)},focusActiveElement:function(){this.activeElement&&this.activeElement.focus()},focusCloseButton:function(){this.closeButton.focus()}}),c(E,i),e}),i("string!JOIST/keyboardShortcuts.title",function(){return window.phet.chipper.strings.get("JOIST/keyboardShortcuts.title")}),i("string!JOIST/keyboardShortcuts.toGetStarted",function(){return window.phet.chipper.strings.get("JOIST/keyboardShortcuts.toGetStarted")}),i("JOIST/KeyboardHelpDialog",["require","SCENERY/accessibility/AccessiblePeer","SUN/Dialog","SCENERY/nodes/HBox","SCENERY_PHET/keyboard/help/KeyboardHelpSection","PHET_CORE/inherit","JOIST/joist","JOIST/JoistA11yStrings","SCENERY_PHET/PhetFont","SCENERY_PHET/keyboard/TabKeyNode","TANDEM/Tandem","SCENERY/nodes/Text","SCENERY/nodes/VBox","string!JOIST/keyboardShortcuts.title","string!JOIST/keyboardShortcuts.toGetStarted"],function(t){"use strict";function e(t,e){e=_.extend({titleAlign:"center",fill:"rgb( 214, 237, 249 )",ySpacing:15,tandem:c.required,addAriaLabelledByFromTitle:!1},e);var a=new d(f,{font:new h({weight:"bold",size:18}),maxWidth:m,tagName:"h1",innerContent:E}),o=s.labelWithIcon(g,new u,y,{iconOptions:{tagName:"p"}});e.title=new p({children:[a,new r({children:[o.icon,o.label],spacing:4})],spacing:5,tagName:"div"}),t.tagName=t.tagName||"div",n.call(this,t,e),this.addAriaLabelledbyAssociation({thisElementName:i.PRIMARY_SIBLING,otherNode:a,otherElementName:i.PRIMARY_SIBLING})}var i=t("SCENERY/accessibility/AccessiblePeer"),n=t("SUN/Dialog"),r=t("SCENERY/nodes/HBox"),s=t("SCENERY_PHET/keyboard/help/KeyboardHelpSection"),a=t("PHET_CORE/inherit"),o=t("JOIST/joist"),l=t("JOIST/JoistA11yStrings"),h=t("SCENERY_PHET/PhetFont"),u=t("SCENERY_PHET/keyboard/TabKeyNode"),c=t("TANDEM/Tandem"),d=t("SCENERY/nodes/Text"),p=t("SCENERY/nodes/VBox"),m=500,f=t("string!JOIST/keyboardShortcuts.title"),g=t("string!JOIST/keyboardShortcuts.toGetStarted"),E=l.hotKeysAndHelp.value,y=l.tabToGetStarted.value;return o.register("KeyboardHelpDialog",e),a(n,e)}),function(t){function e(t,e){function i(t,e){if(!function(t,e){return t0)&&(e.drawImage(t.img,0,0),delete t.updateCanvas)}}),t}),i("mipmap!JOIST/keyboard-icon-on-white.png",function(){var t=window.phet.chipper.mipmaps["JOIST/keyboard-icon-on-white.png"];return window.phetImages=window.phetImages||[],t.forEach(function(t){t.img=new Image,window.phetImages.push(t.img),t.img.src=t.url,t.canvas=document.createElement("canvas"),t.canvas.width=t.width,t.canvas.height=t.height;var e=t.canvas.getContext("2d");t.updateCanvas=function(){t.img.complete&&(void 0===t.img.naturalWidth||t.img.naturalWidth>0)&&(e.drawImage(t.img,0,0),delete t.updateCanvas)}}),t}),i("JOIST/KeyboardHelpButton",["require","SCENERY/nodes/Image","PHET_CORE/inherit","JOIST/joist","JOIST/JoistA11yStrings","JOIST/JoistButton","JOIST/KeyboardHelpDialog","mipmap!JOIST/keyboard-icon.png","mipmap!JOIST/keyboard-icon-on-white.png"],function(t){"use strict";function e(t,e,n,r){var s=this,d=null;(r=_.extend({highlightExtensionWidth:5,highlightExtensionHeight:10,highlightCenterOffsetY:2,tagName:"button",innerContent:u},r)).listener=function(){d||(d=new o(t,{focusOnCloseNode:s,tandem:n.createTandem("keyboardHelpDialog")})),d.show(),s.buttonModel.isA11yClicking()&&d.focusCloseButton()};var p=new i(l,{scale:c,pickable:!1});a.call(this,p,e,n,r),e.link(function(t){p.image="black"===t?l:h})}var i=t("SCENERY/nodes/Image"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("JOIST/JoistA11yStrings"),a=t("JOIST/JoistButton"),o=t("JOIST/KeyboardHelpDialog"),l=t("mipmap!JOIST/keyboard-icon.png"),h=t("mipmap!JOIST/keyboard-icon-on-white.png"),u=s.hotKeysAndHelp.value,c=.3/l[0].height*67;return r.register("KeyboardHelpButton",e),n(a,e)}),i("SUN/ToggleNode",["require","TANDEM/Tandem","PHET_CORE/inherit","SCENERY/nodes/Node","SUN/sun"],function(t){"use strict";function e(t,n,s){s=_.extend({alignChildren:e.CENTER,tandem:i.optional},s);var a=function(t){for(var e=0;eS.maxButtonWidth?(O.maxWidth=C.maxWidth=S.maxButtonWidth-(this.width-I.width),D.setRect(0,0,I.width,D.height),D.center=I.center,k.spacing=M.spacing=D.width+2*A,k.center=M.center=I.center):O.maxWidth=this.width,this.setAccessibleAttribute("aria-roledescription",v);var V=n.getOuterLineWidthFromNode(this);this.focusHighlight=m.bounds(this.bounds.setMinY(this.bounds.minY-V/2)),this.mutate(S)}var i=t("AXON/DerivedProperty"),n=t("SCENERY/accessibility/FocusHighlightPath"),r=t("JOIST/HighlightNode"),s=t("PHET_CORE/inherit"),a=t("JOIST/joist"),o=t("JOIST/JoistA11yStrings"),l=t("SCENERY/nodes/Node"),h=t("SCENERY_PHET/PhetColorScheme"),u=t("SCENERY_PHET/PhetFont"),c=t("AXON/Property"),d=t("SUN/buttons/PushButtonModel"),p=t("SCENERY/nodes/Rectangle"),m=t("KITE/Shape"),f=t("PHETCOMMON/util/StringUtils"),g=t("TANDEM/Tandem"),E=t("SCENERY/nodes/Text"),y=(t("DOT/Util"),t("SCENERY/nodes/VBox")),A=4,v=o.simScreen.value,b=o.screenNumberPattern.value;return a.register("NavigationBarScreenButton",e),s(l,e)}),i("JOIST/KebabMenuIcon",["require","JOIST/joist","SCENERY/nodes/Path","KITE/Shape"],function(t){"use strict";var e=t("JOIST/joist"),i=t("SCENERY/nodes/Path"),n=t("KITE/Shape"),r=2.5,s=function(t){function e(t){_classCallCheck(this,e);for(var i=new n,s=0;s<3;s++)i.circle(0,3.543*s*r,r);return _possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,i,t))}return _inherits(e,i),e}();return e.register("KebabMenuIcon",s)}),i("JOIST/PhetButtonIO",["require","TANDEM/types/BooleanIO","JOIST/joist","SCENERY/util/NodeProperty","TANDEM/types/NullableIO","TANDEM/types/ObjectIO","TANDEM/phetioInherit","AXON/PropertyIO"],function(t){"use strict";function e(t,e){a.call(this,t,e);var n=new r(t,"pickability","pickable",{phetioReadOnly:t.phetioReadOnly,tandem:t.tandem.createTandem("pickableProperty"),phetioType:l(s(i)),phetioDocumentation:"Set whether the phetButton will be pickable (and hence interactive), see the NodeIO documentation for more details"});this.disposePhetButtonIO=function(){n.dispose()}}var i=t("TANDEM/types/BooleanIO"),n=t("JOIST/joist"),r=t("SCENERY/util/NodeProperty"),s=t("TANDEM/types/NullableIO"),a=t("TANDEM/types/ObjectIO"),o=t("TANDEM/phetioInherit"),l=t("AXON/PropertyIO");o(a,"PhetButtonIO",e,{dispose:function(){this.disposePhetButtonIO()}},{documentation:"The PhET Button in the bottom right of the screen",validator:{isValidValue:function(t){return t instanceof phet.joist.PhetButton}},toStateObject:function(){},fromStateObject:function(t){return t}}),n.register("PhetButtonIO",e);return function t(){_classCallCheck(this,t)}.hello="true",e}),i("string!JOIST/credits.contributors",function(){return window.phet.chipper.strings.get("JOIST/credits.contributors")}),i("string!JOIST/credits.graphicArts",function(){return window.phet.chipper.strings.get("JOIST/credits.graphicArts")}),i("string!JOIST/credits.leadDesign",function(){return window.phet.chipper.strings.get("JOIST/credits.leadDesign")}),i("string!JOIST/credits.qualityAssurance",function(){return window.phet.chipper.strings.get("JOIST/credits.qualityAssurance")}),i("string!JOIST/credits.softwareDevelopment",function(){return window.phet.chipper.strings.get("JOIST/credits.softwareDevelopment")}),i("string!JOIST/credits.soundDesign",function(){return window.phet.chipper.strings.get("JOIST/credits.soundDesign")}),i("string!JOIST/credits.team",function(){return window.phet.chipper.strings.get("JOIST/credits.team")}),i("string!JOIST/credits.thanks",function(){return window.phet.chipper.strings.get("JOIST/credits.thanks")}),i("string!JOIST/credits.title",function(){return window.phet.chipper.strings.get("JOIST/credits.title")}),i("string!JOIST/credits.translation",function(){return window.phet.chipper.strings.get("JOIST/credits.translation")}),i("JOIST/CreditsNode",["require","PHET_CORE/inherit","JOIST/joist","SCENERY_PHET/PhetFont","SCENERY/nodes/RichText","PHETCOMMON/util/StringUtils","SCENERY/nodes/Text","SCENERY/nodes/VBox","SCENERY/nodes/VStrut","string!JOIST/credits.contributors","string!JOIST/credits.graphicArts","string!JOIST/credits.leadDesign","string!JOIST/credits.qualityAssurance","string!JOIST/credits.softwareDevelopment","string!JOIST/credits.soundDesign","string!JOIST/credits.team","string!JOIST/credits.thanks","string!JOIST/credits.title","string!JOIST/credits.translation"],function(t){"use strict";function e(t,e){e=_.extend({align:"left",spacing:1,maxWidth:550},e);var i=new r({size:14,weight:"bold"}),n={font:new r(12),align:"left",lineWrap:e.maxWidth,tagName:"p"},v=[];if(v.push(new o(y,{font:i,tagName:"h2",innerContent:y})),t.leadDesign){var b=a.format(d,"‪"+t.leadDesign+"‬");v.push(new s(b,_.extend({innerContent:b},n)))}if(t.softwareDevelopment){var S=a.format(m,"‪"+t.softwareDevelopment+"‬");v.push(new s(S,_.extend({innerContent:S},n)))}if(t.team){var T=a.format(g,"‪"+t.team+"‬");v.push(new s(T,_.extend({innerContent:T},n)))}if(t.contributors){var C=a.format(u,"‪"+t.contributors+"‬");v.push(new s(C,_.extend({innerContent:C},n)))}if(t.qualityAssurance){var w=a.format(p,"‪"+t.qualityAssurance+"‬");v.push(new s(w,_.extend({innerContent:w},n)))}if(t.graphicArts){var R=a.format(c,"‪"+t.graphicArts+"‬");v.push(new s(R,_.extend({innerContent:R},n)))}if(t.soundDesign){var N=a.format(f,"‪"+t.soundDesign+"‬");v.push(new s(N,_.extend({innerContent:N},n)))}if(t.translation&&(v.length>0&&v.push(new h(10)),v.push(new o(A,{font:i,tagName:"h2",innerContent:A})),v.push(new s(t.translation,n))),t.thanks){v.length>0&&v.push(new h(10)),v.push(new o(E,{font:i,tagName:"h2",innerContent:E}));var P=new s(t.thanks,n);P.innerContent=t.thanks,v.push(P)}e.children=v,l.call(this,e),this.disposeCreditsNode=function(){v.forEach(function(t){t.dispose&&t.dispose()})}}var i=t("PHET_CORE/inherit"),n=t("JOIST/joist"),r=t("SCENERY_PHET/PhetFont"),s=t("SCENERY/nodes/RichText"),a=t("PHETCOMMON/util/StringUtils"),o=t("SCENERY/nodes/Text"),l=t("SCENERY/nodes/VBox"),h=t("SCENERY/nodes/VStrut"),u=t("string!JOIST/credits.contributors"),c=t("string!JOIST/credits.graphicArts"),d=t("string!JOIST/credits.leadDesign"),p=t("string!JOIST/credits.qualityAssurance"),m=t("string!JOIST/credits.softwareDevelopment"),f=t("string!JOIST/credits.soundDesign"),g=t("string!JOIST/credits.team"),E=t("string!JOIST/credits.thanks"),y=t("string!JOIST/credits.title"),A=t("string!JOIST/credits.translation");return n.register("CreditsNode",e),i(l,e,{dispose:function(){this.disposeCreditsNode(),l.prototype.dispose.call(this)}})}),i("JOIST/packageJSON",["require","JOIST/joist","text!REPOSITORY/package.json"],function(t){"use strict";var e=t("JOIST/joist"),i=t("text!REPOSITORY/package.json"),n=JSON.parse(i);return e.register("packageJSON",n),n}),i("JOIST/SimVersion",["require","PHET_CORE/inherit","JOIST/joist"],function(t){"use strict";function e(t){this.major=t.major,this.minor=t.minor,this.maintenance=t.maintenance,this.suffix=t.suffix,this.buildTimestamp=t.buildTimestamp}var i=t("PHET_CORE/inherit");return t("JOIST/joist").register("SimVersion",e),i(Object,e,{compare:function(t){return this.majort.major?1:this.minort.minor?1:this.maintenancet.maintenance?1:0},get isSimNotPublished(){return this.major<1||1===this.major&&0===this.minor&&0===this.maintenance&&this.suffix},toString:function(){return this.major+"."+this.minor+"."+this.maintenance+(this.suffix?"-"+this.suffix:"")}},{parse:function(t,i){var n=t.match(/(\d+)\.(\d+)\.(\d+)(-(.+))?/);if(!n)throw new Error("could not parse version: "+t);return new e({major:parseInt(n[1],10),minor:parseInt(n[2],10),maintenance:parseInt(n[3],10),suffix:n[5],buildTimestamp:i})}})}),i("JOIST/UpdateCheck",["require","BRAND/Brand","PHET_CORE/inherit","JOIST/joist","JOIST/packageJSON","AXON/Property","JOIST/SimVersion"],function(t){"use strict";function e(){this.stateProperty=new a("unchecked",{validValues:["up-to-date","out-of-date","checking","offline","unchecked"]}),this.latestVersionProperty=new a(null),this.ourVersion=h,this.timeoutCallback=this.timeout.bind(this)}var i=t("BRAND/Brand"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("JOIST/packageJSON"),a=t("AXON/Property"),o=t("JOIST/SimVersion"),l=s.name,h=o.parse(s.version,phet.chipper.buildTimestamp),u="https:"===document.location.protocol?"https:":"http:";n(Object,e,{areUpdatesChecked:"phet"===i.id&&!i.isPhetApp&&phet.chipper.queryParameters.yotta,updateURL:"http://phet.colorado.edu/html-sim-update?simulation="+encodeURIComponent(l)+"&version="+encodeURIComponent(h.toString())+"&buildTimestamp="+encodeURIComponent(""+phet.chipper.buildTimestamp),timeoutId:-1,timeoutMilliseconds:15e3,clearTimeout:function(){window.clearTimeout(this.timeoutId)},setTimeout:function(){this.timeoutId=window.setTimeout(this.timeoutCallback,this.timeoutMilliseconds)},resetTimeout:function(){"checking"===this.stateProperty.value&&(this.clearTimeout(),this.setTimeout())},timeout:function(){this.stateProperty.value="offline"},check:function(){var t=this;if(this.areUpdatesChecked&&("unchecked"===t.stateProperty.value||"offline"===t.stateProperty.value))if(this.ourVersion.isSimNotPublished)t.stateProperty.value="up-to-date";else{var e=new XMLHttpRequest;"withCredentials"in e&&(t.stateProperty.value="checking",t.setTimeout(),e.onload=function(){t.clearTimeout();try{var i=JSON.parse(e.responseText);i.error?(console.log("Update check failure: "+i.error),t.stateProperty.value="offline"):(t.updateURL&&(t.updateURL=i.updateURL),t.latestVersion=o.parse(i.latestVersion,i.buildTimestamp),"out-of-date"===i.state||"up-to-date"===i.state?t.stateProperty.value=i.state:(console.log("Failed to get proper state: "+i.state),t.stateProperty.value="offline"))}catch(e){t.stateProperty.value="offline"}},e.onerror=function(){t.clearTimeout(),t.stateProperty.value="offline"},e.open("post",u+"//phet.colorado.edu/services/check-html-updates",!0),e.send(JSON.stringify({api:"1.0",simulation:l,locale:phet.joist.sim.locale,currentVersion:t.ourVersion.toString(),buildTimestamp:phet.chipper.buildTimestamp})))}}});var c=new e;return r.register("UpdateCheck",c),c}),i("SCENERY_PHET/SpinningIndicatorNode",["require","SCENERY/nodes/Circle","SCENERY/util/Color","PHET_CORE/inherit","SCENERY/nodes/Node","SCENERY/util/PaintColorProperty","SCENERY/nodes/Rectangle","SCENERY_PHET/sceneryPhet","TANDEM/Tandem"],function(t){"use strict";function e(t){h.indicateUninstrumentedCode(),t=_.extend({indicatorSize:15,indicatorSpeed:1,elementFactory:e.rectangleFactory,elementQuantity:16,activeColor:"rgba(0,0,0,1)",inactiveColor:"rgba(0,0,0,0.15)"},t),this.options=t,s.call(this,t),this.indicatorRotation=2*Math.PI,this.activeColorProperty=new a(t.activeColor),this.inactiveColorProperty=new a(t.inactiveColor),this.angleDelta=2*Math.PI/t.elementQuantity,this.elements=[];for(var i=0,n=0;n'+A+"",{links:{url:c.updateURL},font:S})],tagName:"div"},t))},createOutOfDateDialogNode:function(t,e,n,s){return new d(_.extend({spacing:15,maxWidth:550,children:[new d({spacing:5,align:"left",children:[new h(l.format(g,n),{font:new r(16),fontWeight:"bold"}),new h(l.format(b,e),{font:S})]}),new i({spacing:25,children:[new u(f,{baseColor:"#6f6",font:S,listener:function(){if(!window.phet||!phet.chipper||!phet.chipper.queryParameters||phet.chipper.queryParameters.allowLinks){var t=window.open(c.updateURL,"_blank");t&&t.focus()}}}),new u(E,{baseColor:"#ddd",font:S,listener:function(){t.hide()}})]})]},s))},createOfflineNode:function(t){return new i(_.extend({spacing:0,maxWidth:550,children:[new p(20),new h(y,{font:new r(t.big?16:14),fontWeight:t.big?"bold":"normal"})],tagName:"p",innerContent:y},t))}};return n.register("UpdateNodes",T),T}),i("string!JOIST/versionPattern",function(){return window.phet.chipper.strings.get("JOIST/versionPattern")}),i("JOIST/AboutDialog",["require","SCENERY/accessibility/AccessiblePeer","JOIST/CreditsNode","SUN/Dialog","PHET_CORE/inherit","JOIST/joist","SCENERY/nodes/Node","JOIST/packageJSON","SCENERY_PHET/PhetFont","SCENERY/nodes/RichText","PHETCOMMON/util/StringUtils","SCENERY/nodes/Text","AXON/timer","JOIST/UpdateCheck","JOIST/UpdateNodes","SCENERY/nodes/VBox","SCENERY/nodes/VStrut","string!JOIST/versionPattern"],function(t){"use strict";function e(t,e,s,a,p,b,S){var T=[],C=new d(t,{font:new h(28),maxWidth:A,tagName:"h1",innerContent:t});T.push(C);var w=c.format(y,e);if(T.push(new d(w,{font:new h(20),maxWidth:A,tagName:"p",innerContent:w})),phet.chipper.buildTimestamp&&T.push(new d(phet.chipper.buildTimestamp,{font:new h(13),maxWidth:A,tagName:"p",innerContent:phet.chipper.buildTimestamp})),m.areUpdatesChecked){var _={left:0,top:0},R=f.createCheckingNode(_),N=f.createUpToDateNode(_),P=f.createOutOfDateAboutNode(_),O=f.createOfflineNode(_);this.updateStepListener=R.stepListener,this.updateVisibilityListener=function(t){R.visible="checking"===t,N.visible="up-to-date"===t,P.visible="out-of-date"===t,O.visible="offline"===t,R.accessibleContentDisplayed=R.visible,N.accessibleContentDisplayed=N.visible,P.accessibleContentDisplayed=P.visible,O.accessibleContentDisplayed=O.visible},T.push(new o({children:[R,N,P,O],maxWidth:A}))}var I=[];if(a.name&&I.push(new u(a.name,{font:new h(16),supScale:.5,supYOffset:2,maxWidth:A,tagName:"h2",innerContent:a.name})),a.copyright){var D=phet.chipper.buildTimestamp?phet.chipper.buildTimestamp.split("-")[0]:(new Date).getFullYear(),x=c.fillIn(a.copyright,{year:D});I.push(new d(x,{font:new h(12),maxWidth:A,tagName:"p",innerContent:x}))}a.additionalLicenseStatement&&(this.additionalLicenseStatement=new u(a.additionalLicenseStatement,{font:new h(10),fill:"gray",align:"left",maxWidth:A,tagName:"p",innerContent:a.additionalLicenseStatement}),I.push(this.additionalLicenseStatement)),I.length>0&&(T.push(new E(15)),T=T.concat(I)),!s||"phet"!==a.id&&"phet-io"!==a.id||(T.push(new E(15)),this.creditsNode=new n(s,{maxWidth:A}),T.push(this.creditsNode));var k=a.getLinks(l.name,p);if(k&&k.length>0){T.push(new E(15));for(var M=S.createGroupTandem("link"),V=0;V'+L.text+"",{links:{url:L.url},font:new h(14),maxWidth:A,tandem:M.createNextTandem(),phetioReadOnly:!0,phetioState:!1}))}}var Y=new g({align:"left",spacing:5,children:T,tagName:"div"});r.call(this,Y,{focusOnCloseNode:b,tandem:S,phetioReadOnly:!0,phetioState:!1,xSpacing:20,topMargin:20,bottomMargin:20,leftMargin:20,rightMargin:20,maxHeight:464-2*v,layoutStrategy:function(t,e,i,n){t.center=i.center.times(1/n)}}),this.addAriaLabelledbyAssociation({thisElementName:i.PRIMARY_SIBLING,otherNode:C,otherElementName:i.PRIMARY_SIBLING}),this.disposeAboutDialog=function(){this.creditsNode&&this.creditsNode.dispose(),this.additionalLicenseStatement&&this.additionalLicenseStatement.dispose()}}var i=t("SCENERY/accessibility/AccessiblePeer"),n=t("JOIST/CreditsNode"),r=t("SUN/Dialog"),s=t("PHET_CORE/inherit"),a=t("JOIST/joist"),o=t("SCENERY/nodes/Node"),l=t("JOIST/packageJSON"),h=t("SCENERY_PHET/PhetFont"),u=t("SCENERY/nodes/RichText"),c=t("PHETCOMMON/util/StringUtils"),d=t("SCENERY/nodes/Text"),p=t("AXON/timer"),m=t("JOIST/UpdateCheck"),f=t("JOIST/UpdateNodes"),g=t("SCENERY/nodes/VBox"),E=t("SCENERY/nodes/VStrut"),y=t("string!JOIST/versionPattern"),A=550,v=12;return a.register("AboutDialog",e),s(r,e,{show:function(){m.areUpdatesChecked&&!this.isShowingProperty.value&&(m.resetTimeout(),"offline"!==m.stateProperty.value&&"unchecked"!==m.stateProperty.value||m.check(),p.addListener(this.updateStepListener),m.stateProperty.link(this.updateVisibilityListener)),r.prototype.show.call(this)},hide:function(){this.isShowingProperty.value&&(r.prototype.hide.call(this),m.areUpdatesChecked&&(m.stateProperty.unlink(this.updateVisibilityListener),p.removeListener(this.updateStepListener)))},dispose:function(){this.disposeAboutDialog(),r.prototype.dispose.call(this)}})}),i("SUN/MenuItem",["require","SCENERY/accessibility/AccessibilityUtil","SCENERY/listeners/FireListener","SUN/FontAwesomeNode","PHET_CORE/inherit","SCENERY/nodes/Node","SCENERY_PHET/PhetFont","TANDEM/PhetioObject","SCENERY/nodes/Rectangle","SUN/sun","TANDEM/Tandem","SCENERY/nodes/Text"],function(t){"use strict";function e(t,e,r,s,u,T){var C=this;T=_.extend({cursor:"pointer",tandem:c.optional,textFill:"black",phetioDocumentation:"Item buttons shown in a popup menu",phetioEventType:l.EventType.USER,tagName:"button",focusAfterCallback:!1,containerTagName:"li",containerAriaRole:"none",innerContent:s,ariaRole:"menuitem"},T),a.call(this);var w=new d(s,{font:new o(m),fill:T.textFill,maxWidth:g}),R=new h(0,0,t+A+v+y,e+b+b,S,S);this.addChild(R),this.addChild(w),w.left=R.left+A+y,w.centerY=R.centerY,this.addInputListener({enter:function(){R.fill=f},exit:function(){R.fill=null}});var N=function(t){r(t),u(t)};this.addInputListener(new n({tandem:T.tandem.createTandem("inputListener"),fire:N})),this.separatorBefore=T.separatorBefore;var P;if(T.checkedProperty){var O=new a({children:[p],right:w.left-E,centerY:w.centerY});P=function(t){O.visible=t},T.checkedProperty.link(P),this.addChild(O)}var I={click:function(t){N();var e=phet.joist.display.accessibleDOMElement;T.focusAfterCallback&&i.getNextFocusable(e).focus()}};this.addInputListener(I),this.mutate(T),this.disposeMenuItem=function(){T.checkedProperty&&T.checkedProperty.unlink(P),C.removeInputListener(I)}}var i=t("SCENERY/accessibility/AccessibilityUtil"),n=t("SCENERY/listeners/FireListener"),r=t("SUN/FontAwesomeNode"),s=t("PHET_CORE/inherit"),a=t("SCENERY/nodes/Node"),o=t("SCENERY_PHET/PhetFont"),l=t("TANDEM/PhetioObject"),h=t("SCENERY/nodes/Rectangle"),u=t("SUN/sun"),c=t("TANDEM/Tandem"),d=t("SCENERY/nodes/Text"),p=new r("check",{fill:"rgba(0,0,0,0.7)",scale:.4}),m=18,f="#a6d2f4",g=400,E=2,y=p.width+E,A=2,v=5,b=3,S=5;return u.register("MenuItem",e),s(a,e,{dispose:function(){this.disposeMenuItem(),a.prototype.dispose.call(this)}})}),i("JOIST/OptionsDialogIO",["require","SUN/DialogIO","JOIST/joist","TANDEM/phetioInherit"],function(t){"use strict";function e(t,e){i.call(this,t,e)}var i=t("SUN/DialogIO"),n=t("JOIST/joist");return t("TANDEM/phetioInherit")(i,"OptionsDialogIO",e,{},{documentation:"A dialog panel",validator:{isValidValue:function(t){return t instanceof phet.joist.OptionsDialog}}}),n.register("OptionsDialogIO",e),e}),i("string!JOIST/options.title",function(){return window.phet.chipper.strings.get("JOIST/options.title")}),i("JOIST/OptionsDialog",["require","SUN/Dialog","PHET_CORE/inherit","JOIST/joist","JOIST/OptionsDialogIO","SCENERY_PHET/PhetFont","TANDEM/Tandem","SCENERY/nodes/Text","string!JOIST/options.title"],function(t){"use strict";function e(t,e){(e=_.extend({titleAlign:"center",bottomMargin:20,ySpacing:20,tandem:o.required,phetioType:s},e)).title||(e.title=new l(h,{font:new a(30),maxWidth:400})),i.call(this,t,e),this.disposeOptionsDialog=function(){e.title&&e.title.dispose()}}var i=t("SUN/Dialog"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("JOIST/OptionsDialogIO"),a=t("SCENERY_PHET/PhetFont"),o=t("TANDEM/Tandem"),l=t("SCENERY/nodes/Text"),h=t("string!JOIST/options.title");return r.register("OptionsDialog",e),n(i,e,{dispose:function(){this.disposeOptionsDialog(),i.prototype.dispose.call(this)}},{DEFAULT_FONT:new a(15),DEFAULT_SPACING:10})}),i("JOIST/PhetMenuIO",["require","JOIST/joist","TANDEM/types/ObjectIO","TANDEM/phetioInherit"],function(t){"use strict";function e(t,e){n.call(this,t,e)}var i=t("JOIST/joist"),n=t("TANDEM/types/ObjectIO");return t("TANDEM/phetioInherit")(n,"PhetMenuIO",e,{},{documentation:"The PhET Menu in the bottom right of the screen",validator:{isValidValue:function(t){return t instanceof phet.joist.PhetMenu}}}),i.register("PhetMenuIO",e),e}),i("JOIST/ScreenshotGenerator",["require","SCENERY/util/CanvasContextWrapper","PHET_CORE/inherit","JOIST/joist"],function(t){"use strict";function e(){}var i=t("SCENERY/util/CanvasContextWrapper"),n=t("PHET_CORE/inherit");return t("JOIST/joist").register("ScreenshotGenerator",e),n(Object,e,{},{generateScreenshot:function(t,e){e=e||"image/png";var n=document.createElement("canvas");n.width=t.display.width,n.height=t.display.height;var r=n.getContext("2d");r.fillStyle=t.display.domElement.style.backgroundColor,r.fillRect(0,0,n.width,n.height);var s=new i(n,r);t.rootNode.renderToCanvasSubtree(s);return n.toDataURL(e)}})}),i("JOIST/UpdateDialog",["require","SUN/Dialog","PHET_CORE/inherit","JOIST/joist","SCENERY/nodes/Node","AXON/timer","JOIST/UpdateCheck","JOIST/UpdateNodes"],function(t){"use strict";function e(t){function e(){var t=o.latestVersion?o.latestVersion.toString():"x.x.xx",e=o.ourVersion.toString();u.children=[l.createOutOfDateDialogNode(n,e,t,r)]}var n=this,r={centerX:0,centerY:0,big:!0},a=l.createCheckingNode(r),h=l.createUpToDateNode(r),u=new s({tagName:"div"}),c=l.createOfflineNode(r);e(),this.updateStepListener=a.stepListener,this.updateVisibilityListener=function(t){"out-of-date"===t&&e(),a.visible="checking"===t,h.visible="up-to-date"===t,u.visible="out-of-date"===t,c.visible="offline"===t,a.accessibleContentDisplayed=a.visible,h.accessibleContentDisplayed=h.visible,u.accessibleContentDisplayed=u.visible,c.accessibleContentDisplayed=c.visible};var d=new s({children:[a,h,u,c],tagName:"div"});i.call(this,d,{focusOnCloseNode:t})}var i=t("SUN/Dialog"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("SCENERY/nodes/Node"),a=t("AXON/timer"),o=t("JOIST/UpdateCheck"),l=t("JOIST/UpdateNodes");return r.register("UpdateDialog",e),n(i,e,{show:function(){o.areUpdatesChecked&&!this.isShowingProperty.value&&(o.resetTimeout(),"offline"!==o.stateProperty.value&&"unchecked"!==o.stateProperty||o.check(),a.addListener(this.updateStepListener),o.stateProperty.link(this.updateVisibilityListener)),i.prototype.show.call(this)},hide:function(){this.isShowingProperty.value&&(i.prototype.hide.call(this),o.areUpdatesChecked&&(o.stateProperty.unlink(this.updateVisibilityListener),a.removeListener(this.updateStepListener)))}})}),i("string!JOIST/menuItem.about",function(){return window.phet.chipper.strings.get("JOIST/menuItem.about")}),i("string!JOIST/menuItem.enhancedSound",function(){return window.phet.chipper.strings.get("JOIST/menuItem.enhancedSound")}),i("string!JOIST/menuItem.fullscreen",function(){return window.phet.chipper.strings.get("JOIST/menuItem.fullscreen")}),i("string!JOIST/menuItem.getUpdate",function(){return window.phet.chipper.strings.get("JOIST/menuItem.getUpdate")}),i("string!JOIST/menuItem.mailInputEventsLog",function(){return window.phet.chipper.strings.get("JOIST/menuItem.mailInputEventsLog")}),i("string!JOIST/menuItem.options",function(){return window.phet.chipper.strings.get("JOIST/menuItem.options")}),i("string!JOIST/menuItem.outputInputEventsLog",function(){return window.phet.chipper.strings.get("JOIST/menuItem.outputInputEventsLog")}),i("string!JOIST/menuItem.phetWebsite",function(){return window.phet.chipper.strings.get("JOIST/menuItem.phetWebsite")}),i("string!JOIST/menuItem.reportAProblem",function(){return window.phet.chipper.strings.get("JOIST/menuItem.reportAProblem")}),i("string!JOIST/menuItem.screenshot",function(){return window.phet.chipper.strings.get("JOIST/menuItem.screenshot")}),i("string!JOIST/menuItem.submitInputEventsLog",function(){return window.phet.chipper.strings.get("JOIST/menuItem.submitInputEventsLog")}),i("JOIST/PhetMenu",["require","JOIST/AboutDialog","SCENERY/accessibility/AccessibilityUtil","BRAND/Brand","AXON/DerivedProperty","SCENERY/display/Display","SCENERY/util/FullScreen","PHET_CORE/inherit","JOIST/joist","SCENERY/accessibility/KeyboardUtil","SUN/MenuItem","SCENERY/nodes/Node","JOIST/OptionsDialog","SCENERY/nodes/Path","SCENERY_PHET/PhetFont","JOIST/PhetMenuIO","PHET_CORE/platform","SCENERY/nodes/Rectangle","JOIST/ScreenshotGenerator","KITE/Shape","TAMBO/soundManager","PHETCOMMON/util/StringUtils","SCENERY/nodes/Text","JOIST/UpdateCheck","JOIST/UpdateDialog","string!JOIST/menuItem.about","string!JOIST/menuItem.enhancedSound","string!JOIST/menuItem.fullscreen","string!JOIST/menuItem.getUpdate","string!JOIST/menuItem.mailInputEventsLog","string!JOIST/menuItem.options","string!JOIST/menuItem.outputInputEventsLog","string!JOIST/menuItem.phetWebsite","string!JOIST/menuItem.reportAProblem","string!JOIST/menuItem.screenshot","string!JOIST/menuItem.submitInputEventsLog"],function(t){"use strict";function e(t,e,l,h){var y="phet"===r.id,F=r.isPhetApp;(h=_.extend({showSaveAndLoad:!1,phetioType:g,phetioState:!1,phetioDocumentation:"This menu is displayed when the PhET button is pressed.",tagName:"ul",ariaRole:"menu"},h)).tandem=l;var G=this;d.call(this);var U,W=null,z=null,X=null,j=[{text:D,present:!!t.options.optionsNode,callback:function(){z||(z=new p(t.options.optionsNode,{tandem:l.createTandem("optionsDialog")})),z.show()},tandem:l.createTandem("optionsMenuItem"),phetioDocumentation:"This menu item shows an options dialog.",phetioState:!1,tagName:"button",focusAfterCallback:!0},{text:k,present:y,callback:function(){if(!H&&(!window.phet||!phet.chipper||!phet.chipper.queryParameters||phet.chipper.queryParameters.allowLinks)){var e=window.open("http://phet.colorado.edu/"+t.locale,"_blank");e&&e.focus()}},tagName:"button"},{text:x,present:!!t.options.recordInputEventLog,callback:function(){console.log(t.getRecordedInputEventLogString())},tagName:"button"},{text:L,present:!!t.options.recordInputEventLog,callback:function(){t.submitEventLog()},tagName:"button"},{text:I,present:!!t.options.recordInputEventLog,callback:function(){t.mailEventLog()},tagName:"button"},{text:M,present:y&&!F,callback:function(){var e="http://phet.colorado.edu/files/troubleshooting/?sim="+encodeURIComponent(t.name)+"&version="+encodeURIComponent(t.version+" "+(phet.chipper.buildTimestamp?phet.chipper.buildTimestamp:"(require.js)"))+"&url="+encodeURIComponent(window.location.href)+"&dependencies="+encodeURIComponent(JSON.stringify({}));if(!H&&(!window.phet||!phet.chipper||!phet.chipper.queryParameters||phet.chipper.queryParameters.allowLinks)){var i=window.open(e,"_blank");i&&i.focus()}},tagName:"button"},{text:"QR code",present:phet.chipper.queryParameters.qrCode,callback:function(){if(!H){var t=window.open("http://api.qrserver.com/v1/create-qr-code/?data="+encodeURIComponent(window.location.href)+"&size=220x220&margin=0","_blank");t&&t.focus()}},tagName:"button"},{text:O,present:C.areUpdatesChecked,textFill:new s([C.stateProperty],function(t){return"out-of-date"===t?"#0a0":"#000"}),callback:function(){X||(X=new w(e)),X.show()},tagName:"button",focusAfterCallback:!0},{text:V,present:!E.ie9&&!F,callback:function(){var e=A.generateScreenshot(t);if(window.Blob&&new window.Blob){for(var i=e.slice("data:image/png;base64,".length),n=window.atob(i),r=new window.Uint8Array(n.length),s=0;s0)&&(e.drawImage(t.img,0,0),delete t.updateCanvas)}}),t}),i("mipmap!BRAND/logo-on-white.png",function(){var t=window.phet.chipper.mipmaps["BRAND/logo-on-white.png"];return window.phetImages=window.phetImages||[],t.forEach(function(t){t.img=new Image,window.phetImages.push(t.img),t.img.src=t.url,t.canvas=document.createElement("canvas"),t.canvas.width=t.width,t.canvas.height=t.height;var e=t.canvas.getContext("2d");t.updateCanvas=function(){t.img.complete&&(void 0===t.img.naturalWidth||t.img.naturalWidth>0)&&(e.drawImage(t.img,0,0),delete t.updateCanvas)}}),t}),i("JOIST/PhetButton",["require","SCENERY/nodes/Image","PHET_CORE/inherit","JOIST/joist","JOIST/JoistA11yStrings","JOIST/JoistButton","JOIST/KebabMenuIcon","SCENERY/nodes/Node","JOIST/PhetButtonIO","JOIST/PhetMenu","AXON/Property","JOIST/UpdateCheck","mipmap!BRAND/logo.png","mipmap!BRAND/logo-on-white.png"],function(t){"use strict";function e(t,e,n){var r=this,s=new u(t,this,n.createTandem("phetMenu"),{showSaveAndLoad:t.options.showSaveAndLoad,closeCallback:function(){s.hide()}});c.multilink([t.boundsProperty,t.screenBoundsProperty,t.scaleProperty],function(t,e,i){if(t&&e&&i){s.right=t.right/i-2/i;var n=t.height-e.height;s.bottom=e.bottom/i+n/2/i}});var E={highlightExtensionWidth:6,highlightExtensionHeight:5,highlightCenterOffsetY:4,listener:function(){s.show()},phetioType:h,phetioDocumentation:"The button that appears at the right side of the navigation bar, which shows a menu when pressed",tagName:"button",innerContent:p},y=new i(m,{scale:g,pickable:!1}),A=new o({left:y.width+8,bottom:y.bottom-.5,pickable:!1}),v=new l({children:[y,A]});a.call(this,v,e,n,E),c.multilink([e,t.showHomeScreenProperty,d.stateProperty],function(t,e,i){var n="black"!==t&&!e,r="out-of-date"===i;A.fill=n?r?"#0a0":"#222":r?"#3F3":"white",y.image=n?f:m}),this.on("pickability",function(){A.visible=!1!==r.pickable}),this.addInputListener({click:function(){s.show(),s.items[0].focus()}}),this.setAccessibleAttribute("aria-haspopup",!0)}var i=t("SCENERY/nodes/Image"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("JOIST/JoistA11yStrings"),a=t("JOIST/JoistButton"),o=t("JOIST/KebabMenuIcon"),l=t("SCENERY/nodes/Node"),h=t("JOIST/PhetButtonIO"),u=t("JOIST/PhetMenu"),c=t("AXON/Property"),d=t("JOIST/UpdateCheck"),p=s.phet.value,m=t("mipmap!BRAND/logo.png"),f=t("mipmap!BRAND/logo-on-white.png"),g=.28/m[0].height*108;return r.register("PhetButton",e),n(a,e)}),i("string!JOIST/simTitleWithScreenNamePattern",function(){return window.phet.chipper.strings.get("JOIST/simTitleWithScreenNamePattern")}),i("JOIST/NavigationBar",["require","JOIST/A11yButtonsHBox","SCENERY/accessibility/AccessiblePeer","AXON/DerivedProperty","DOT/Dimension2","JOIST/HomeButton","JOIST/HomeScreen","JOIST/HomeScreenView","PHET_CORE/inherit","JOIST/joist","JOIST/JoistA11yStrings","JOIST/NavigationBarScreenButton","SCENERY/nodes/Node","JOIST/PhetButton","SCENERY_PHET/PhetFont","SCENERY/nodes/Rectangle","PHETCOMMON/util/StringUtils","SCENERY/nodes/Text","string!JOIST/simTitleWithScreenNamePattern"],function(t){"use strict";function e(t,e,s,h){var u=this;this.screens=e,p.call(this,{tagName:"div",ariaRole:"region",labelTagName:"h2",labelContent:1===e.length?b:v}),this.navigationBarFillProperty=new r([s,t.lookAndFeel.navigationBarFillProperty],function(t,e){return t?o.BACKGROUND_COLOR:e}),this.background=new g(0,0,T.width,T.height,{pickable:!0,fill:this.navigationBarFillProperty}),this.addChild(this.background),this.barContents=new p,this.addChild(this.barContents);var c=t.name;if(phet.chipper.queryParameters.screens&&1===phet.chipper.queryParameters.screens.length&&e[0].name&&(c=E.fillIn(A,{simName:t.name,screenName:e[0].name})),this.titleTextNode=new y(c,{font:new f(16),fill:t.lookAndFeel.navigationBarTextFillProperty,tandem:h.createTandem("titleTextNode"),phetioDocumentation:"Displays the title of the simulation in the navigation bar (bottom left)"}),this.titleTextNode.setVisible(!1),this.barContents.addChild(this.titleTextNode),this.phetButton=new m(t,this.navigationBarFillProperty,h.createTandem("phetButton")),this.barContents.addChild(this.phetButton),this.a11yButtonsHBox=new i(t,this.navigationBarFillProperty,h.createTandem("a11yButtonsHBox")),this.barContents.addChild(this.a11yButtonsHBox),this.addAriaLabelledbyAssociation({thisElementName:n.PRIMARY_SIBLING,otherNode:this,otherElementName:n.LABEL_SIBLING}),1===e.length)this.titleTextNode.maxWidth=l.LAYOUT_BOUNDS.width-C-w-R-this.a11yButtonsHBox.width-R-this.phetButton.width-N;else{var k=Math.min(this.titleTextNode.width,.2*l.LAYOUT_BOUNDS.width),M=new p({tagName:"nav",ariaLabel:S}),V=new p({tagName:"ol"});M.addChild(V),M.setVisible(!1),this.barContents.addChild(M),this.homeButton=new a(T.height,t.lookAndFeel.navigationBarFillProperty,h.createTandem("homeButton"),{listener:function(){t.showHomeScreenProperty.value=!0,u.homeButton.buttonModel.isA11yClicking()&&t.homeScreen.view.focusHighlightedScreenButton()}}),phet.chipper.queryParameters.homeScreen&&V.addChild(this.homeButton);for(var L=l.LAYOUT_BOUNDS.width/2-C-k-w-O-this.homeButton.width-I,Y=l.LAYOUT_BOUNDS.width/2-R-this.a11yButtonsHBox.width-R-this.phetButton.width-N,B=2*Math.min(L,Y),H=(B-(e.length-1)*D)/e.length,q=_.map(e,function(e){return new d(t.lookAndFeel.navigationBarFillProperty,t.screenIndexProperty,t.screens,e,T.height,{maxButtonWidth:H,tandem:h.createTandem(e.screenTandem.tail+"Button")})}),F=Math.max(x,_.maxBy(q,function(t){return t.width}).width)+D,G=0;G0&&(this.a11yButtonsHBox.centerY=this.phetButton.centerY),1!==this.screens.length&&(this.screenButtonsContainer.centerY=T.height/2,this.homeButton.centerY=T.height/2),this.layout(1,T.width,T.height),this.accessibleOrder=[M,this.a11yButtonsHBox,this.phetButton].filter(function(t){return void 0!==t}),s.link(function(t){u.titleTextNode.setVisible(!t),M&&M.setVisible(!t)})}var i=t("JOIST/A11yButtonsHBox"),n=t("SCENERY/accessibility/AccessiblePeer"),r=t("AXON/DerivedProperty"),s=t("DOT/Dimension2"),a=t("JOIST/HomeButton"),o=t("JOIST/HomeScreen"),l=t("JOIST/HomeScreenView"),h=t("PHET_CORE/inherit"),u=t("JOIST/joist"),c=t("JOIST/JoistA11yStrings"),d=t("JOIST/NavigationBarScreenButton"),p=t("SCENERY/nodes/Node"),m=t("JOIST/PhetButton"),f=t("SCENERY_PHET/PhetFont"),g=t("SCENERY/nodes/Rectangle"),E=t("PHETCOMMON/util/StringUtils"),y=t("SCENERY/nodes/Text"),A=t("string!JOIST/simTitleWithScreenNamePattern"),v=c.simScreensResourcesAndTools.value,b=c.simResourcesAndTools.value,S=c.simScreens.value,T=new s(l.LAYOUT_BOUNDS.width,40),C=10,w=25,R=6,N=10,P=0,O=5,I=O,D=0,x=60;return u.register("NavigationBar",e),h(p,e,{layout:function(t,e,i){this.background.rectWidth=e,this.background.rectHeight=i,this.barContents.setScaleMagnitude(t);var n;n=T.width*t0&&(this.a11yButtonsHBox.right=this.phetButton.left-R),1!==this.screens.length&&(this.screenButtonsContainer.x=n/2,this.homeButton.right=this.screenButtonsContainer.left-I,this.titleTextNode.maxWidth=this.homeButton.left-C-w)}},{NAVIGATION_BAR_SIZE:T})}),i("JOIST/Profiler",["require","PHET_CORE/inherit","JOIST/joist","DOT/Util"],function(t){"use strict";function e(){this.allTimes=[],this.histogram=[],this.longTimes=[],this.frameStartTime=0,this.previousFrameStartTime=0;for(var t=0;t')}var i=t("PHET_CORE/inherit"),n=t("JOIST/joist"),r=t("DOT/Util"),s=30;return n.register("Profiler",e),i(Object,e,{frameStarted:function(){this.frameStartTime=Date.now()},frameEnded:function(){if(this.allTimes.length>0&&this.allTimes.length%60==0){for(var t=0,e=0;e0&&(this.longTimes.sort(function(t,e){return e-t}),i=i+" — "+this.longTimes),$("#phetProfiler").html(i),e=0;ee.length-1)throw new Error("invalid screen index: "+t);P.push(e[i])}),0!==E){var D=_.indexOf(P,e[E-1]);E=D+1}e=P}s=_.extend({showHomeScreen:e.length>1&&A&&0===E,screenIndex:0===E?0:E-1,credits:{},optionsNode:null,homeScreenWarningNode:null,recordInputEventLog:!1,inputEventLogName:void 0,showSaveAndLoad:!1,accessibility:!1,keyboardHelpNode:null,supportsSound:!1,supportsEnhancedSound:!1,rootRenderer:"svg",allowBackingScaleAntialiasing:!0},s),this.options=s,s.rootRenderer=phet.chipper.queryParameters.rootRenderer||s.rootRenderer,this.showHomeScreenProperty=new a(s.showHomeScreen,e.length>1?{tandem:V.generalTandem.createTandem("showHomeScreenProperty"),phetioFeatured:!0}:{}),this.screenIndexProperty=new N(s.screenIndex,{tandem:V.generalTandem.createTandem("screenIndexProperty"),phetioFeatured:!0,phetioDocumentation:"Indicates which screen is selected (0-indexed)",validValues:_.range(0,e.length),numberType:"Integer"}),this.activeProperty=new a(!phet.joist.playbackModeEnabledProperty.value,{tandem:V.generalTandem.createTandem("activeProperty"),phetioFeatured:!0,phetioDocumentation:"Determines whether the entire simulation is running and processing user input. Setting this property to false pauses the simulation, and prevents user interaction."}),this.browserTabVisibleProperty=new a(!0,{tandem:V.generalTandem.createTandem("browserTabVisibleProperty"),phetioDocumentation:"Indicates whether the browser tab containing the simulation is currently visible",phetioReadOnly:!0}),document.addEventListener("visibilitychange",function(){c.browserTabVisibleProperty.set("visible"===document.visibilityState)},!1),this.scaleProperty=new x(1),this.boundsProperty=new x(null),this.screenBoundsProperty=new x(null),this.currentScreenProperty=new x(null),this.lookAndFeel=new S,this.destroyed=!1,this.memoryMonitor=new T,phet.chipper.accessibility=phet.chipper.accessibility||s.accessibility,phet.chipper.accessibility&&(r.initialize(),H.initialize()),this.keyboardHelpNode=s.keyboardHelpNode,this.supportsSound=(phet.chipper.queryParameters.supportsSound||s.supportsSound)&&("enabled"===phet.chipper.queryParameters.sound||"muted"===phet.chipper.queryParameters.sound)&&!I.ie,this.supportsEnhancedSound=this.supportsSound&&(phet.chipper.queryParameters.supportsEnhancedSound||s.supportsEnhancedSound),this.supportsSound&&M.initialize(this.browserTabVisibleProperty,this.activeProperty),window.phet.joist.sim=this,window.phet.joist.ScreenshotGenerator=k,this.name=t,this.version=O.version,this.credits=s.credits,this.frameCounter=0,this.resizePending=!0,this.locale=phet.chipper.locale||"en",QueryStringMachine.containsKey("locale")&&$("title").html(t),phet.chipper.queryParameters.recordInputEventLog&&(s.recordInputEventLog=!0,s.inputEventLogName=phet.chipper.queryParameters.recordInputEventLog),phet.chipper.queryParameters.playbackInputEventLog&&(s.playbackInputEventLog=!0,s.inputEventLogName=phet.chipper.queryParameters.playbackInputEventLog),(phet.chipper.queryParameters.fuzz||phet.chipper.queryParameters.fuzzMouse||phet.chipper.queryParameters.fuzzTouch||phet.chipper.queryParameters.fuzzBoard)&&(window.open=function(){return{focus:function(){},blur:function(){}}});$("body").css("padding","0").css("margin","0").css("overflow","hidden");var Y=document.getElementById("aria-live-elements");Y&&(Y.style[p.userSelect]="none"),document.getElementById("sim")&&document.getElementById("sim").parentNode===document.body&&document.body.removeChild(document.getElementById("sim")),document.onselectstart=function(){return!1},this.rootNode=new w({renderer:s.rootRenderer}),this.display=new u(c.rootNode,{allowSceneOverflow:!1,allowWebGL:phet.chipper.queryParameters.webgl,accessibility:phet.chipper.accessibility,isApplication:!1,assumeFullWindow:!0,allowBackingScaleAntialiasing:s.allowBackingScaleAntialiasing});var B=phet.chipper.queryParameters.randomSeed*Math.PI;this.inputFuzzer=new y(this.display,B),this.keyboardFuzzer=new v(this.display,B),this.activeProperty.link(function(t){c.display.interactive=t}),c.display.domElement.id="sim",document.body.appendChild(c.display.domElement),m.start(this),phet.chipper.queryParameters.sceneryLog&&this.display.scenery.enableLogging(phet.chipper.queryParameters.sceneryLog),phet.chipper.queryParameters.sceneryStringLog&&this.display.scenery.switchLogToString(),this.display.initializeEvents({tandem:V.generalTandem.createTandem("controller").createTandem("input")}),window.phet.joist.rootNode=this.rootNode,window.phet.joist.display=this.display,c.display.setPointerDisplayVisible(phet.chipper.queryParameters.showPointers),c.display.setPointerAreaDisplayVisible(phet.chipper.queryParameters.showPointerAreas),c.display.setCanvasNodeBoundsVisible(phet.chipper.queryParameters.showCanvasNodeBounds),c.display.setFittedBlockBoundsVisible(phet.chipper.queryParameters.showFittedBlockBounds),this.screens=e,e.length>1?(this.homeScreen=new f(this,V.rootTandem.createTandem("homeScreen"),{warningNode:s.homeScreenWarningNode}),this.homeScreen.initializeModelAndView()):this.homeScreen=null,this.navigationBar=new C(this,e,this.showHomeScreenProperty,V.rootTandem.createTandem("navigationBar")),this.updateBackground=function(){c.lookAndFeel.backgroundColorProperty.value=c.currentScreenProperty.value?c.currentScreenProperty.value.backgroundColorProperty.value:c.homeScreen.backgroundColorProperty.value},this.lookAndFeel.backgroundColorProperty.link(function(t){c.display.backgroundColor=t}),phet.phetio&&q.initializeSim(),x.multilink([this.showHomeScreenProperty,this.screenIndexProperty],function(t,i){c.currentScreenProperty.value=t&&c.homeScreen?null:e[i],c.updateBackground()}),this.currentScreenProperty.lazyLink(function(t,e){null===e?c.homeScreen.view.interruptSubtreeInput():e.view.interruptSubtreeInput()}),window.addEventListener("pageshow",function(t){t.persisted&&window.location.reload()}),phet.chipper.queryParameters.legendsOfLearning&&new b(this).start()}var i=t("AXON/Action"),n=t("AXON/ActionIO"),r=t("SCENERY_PHET/accessibility/ariaHerald"),s=t("SCENERY_PHET/BarrierRectangle"),a=t("AXON/BooleanProperty"),o=t("DOT/Bounds2"),l=t("BRAND/Brand"),h=t("DOT/Dimension2"),u=t("SCENERY/display/Display"),c=t("DOT/Util"),d=t("AXON/Emitter"),p=t("SCENERY/util/Features"),m=t("JOIST/Heartbeat"),f=t("JOIST/HomeScreen"),g=t("JOIST/HomeScreenView"),E=t("PHET_CORE/inherit"),y=t("SCENERY/input/InputFuzzer"),A=t("JOIST/joist"),v=t("SCENERY/accessibility/KeyboardFuzzer"),b=t("JOIST/thirdPartySupport/LegendsOfLearningSupport"),S=t("JOIST/LookAndFeel"),T=t("JOIST/MemoryMonitor"),C=t("JOIST/NavigationBar"),w=t("SCENERY/nodes/Node"),R=t("TANDEM/types/NumberIO"),N=t("AXON/NumberProperty"),P=t("AXON/ObservableArray"),O=t("JOIST/packageJSON"),I=t("PHET_CORE/platform"),D=t("JOIST/Profiler"),x=t("AXON/Property"),k=t("JOIST/ScreenshotGenerator"),M=t("TAMBO/soundManager"),V=t("TANDEM/Tandem"),L=t("AXON/timer"),Y=t("JOIST/UpdateCheck"),B=t("SCENERY/util/Util"),H=t("SCENERY_PHET/accessibility/utteranceQueue"),q=t("ifphetio!PHET_IO/phetioEngine");return phet.joist.elapsedTime=0,phet.joist.playbackModeEnabledProperty=new a(phet.chipper.queryParameters.playbackMode),A.register("Sim",e),E(Object,e,{finishInit:function(t){var e=this;this.homeScreen&&this.rootNode.addChild(this.homeScreen.view),_.each(t,function(t){t.view.layerSplit=!0,e.rootNode.addChild(t.view)}),this.rootNode.addChild(this.navigationBar),x.multilink([this.showHomeScreenProperty,this.screenIndexProperty],function(i,n){e.homeScreen&&(i?(e.homeScreen.activeProperty.set(!0),e.homeScreen.view.setVisible(!0)):(e.homeScreen.view.setVisible(!1),e.homeScreen.activeProperty.set(!1)));for(var r=0;r=0&&this.stepSimulation(i)},getSelectedScreen:function(){return this.showHomeScreenProperty.value?null:this.screens[this.screenIndexProperty.value]},stepSimulation:function(t){this.stepSimulationEmitter.emit(t),this.frameEndedEmitter.emit()},setAccessibleViewsVisible:function(t){for(var e=0;e=0||i.indexOf("/")<0||i.indexOf("..")>=0)){var n=i.slice(0,i.indexOf("/")),r=i.slice(i.lastIndexOf("/")+1),s=n.toLowerCase().split("_"),a=[s[0]].concat(s.slice(1).map(function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join("");if(r!==a&&r!==a+"Namespace"){var o=phet[a]&&phet[a][r];o||e("not namespaced: "+a+"."+r),o&&o!==t[i]&&e(a+"."+r+" is different than the expected namespaced object")}}};e(function(t){console.log(t)}),e(function(t){})};return t("JOIST/joist").register("checkNamespaces",e),e}),i("PHET_IO/phetioCommandProcessor",function(){return function(){return function(){}}}),i("JOIST/SimLauncher",["require","TANDEM/Tandem","JOIST/checkNamespaces","JOIST/joist","DOT/Random","ifphetio!PHET_IO/dataStream","ifphetio!PHET_IO/phetioCommandProcessor"],function(t){"use strict";var e=t("TANDEM/Tandem"),i=(t("JOIST/checkNamespaces"),t("JOIST/joist")),n=t("DOT/Random"),r=t("ifphetio!PHET_IO/dataStream"),s=t("ifphetio!PHET_IO/phetioCommandProcessor"),a={launch:function(t){function i(){window.phet.joist.launchSimulation=function(){e.launch(),r.launch&&r.launch(),phet.joist.random=new n({staticSeed:!0}),t()},phet.phetio&&s.initialize(),phet.chipper.queryParameters.postMessageOnReady&&window.parent!==window&&window.parent.postMessage(JSON.stringify({type:"ready",url:window.location.href}),"*"),phet.phetio&&!phet.phetio.queryParameters.phetioStandalone||phet.chipper.queryParameters.playbackMode||window.phet.joist.launchSimulation()}function a(t){return!!t.complete&&(void 0===t.naturalWidth||0!==t.naturalWidth)}window.phet.joist.launchCalled=!0;var o=[],l=0;if(window.phetImages)for(var h=0;h