‪Molecule Shapes: Basics‬ (2024)

`)}popupDebug(){window.open(this.getDebugURI())}iframeDebug(){const e=document.createElement("iframe");e.width=""+window.innerWidth,e.height=""+window.innerHeight,e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.zIndex="10000",document.body.appendChild(e),e.contentWindow.document.open(),e.contentWindow.document.write(this.getDebugHTML()),e.contentWindow.document.close(),e.contentWindow.document.body.style.background="white";const t=document.createElement("button");t.style.position="absolute",t.style.top="0",t.style.right="0",t.style.zIndex="10001",document.body.appendChild(t),t.textContent="close",["pointerdown","click","touchdown"].forEach(i=>{t.addEventListener(i,()=>{document.body.removeChild(e),document.body.removeChild(t)},!0)})}getPDOMDebugHTML(){let e="";const t="font-weight: bold; font-size: 120%; margin-top: 5px;",i="";e+=`

Accessible Instances

`,function t(s,n){e+=n+Ln(`${s.isRootInstance?"":s.node.tagName} ${s.toString()}`)+"
",s.children.forEach(e=>{t(e,n+i)})}(this._rootPDOMInstance,""),e+=`

Parallel DOM

`;let s=this._rootPDOMInstance.peer.primarySibling.outerHTML;s=s.replace(/>\n<");const n=s.split("\n");let r="";for(let o=0;o",s||(r+=i)}return e}foreignObjectRasterization(e){const t={};let i=0;function s(e){e.id||(e.id="unknown-canvas-"+i++),t[e.id]=e.toDataURL()}!function e(t){if(t instanceof Mu)_.each(t.blocks,t=>{e(t)});else if(t instanceof nu&&t.firstDrawable&&t.lastDrawable){for(let i=t.firstDrawable;i!==t.lastDrawable;i=i.nextDrawable)e(i);e(t.lastDrawable),(t instanceof cu||t instanceof Vu)&&t.canvas&&t.canvas instanceof window.HTMLCanvasElement&&s(t.canvas)}Qd&&t instanceof Qd&&(t.domElement instanceof window.HTMLCanvasElement&&s(t.domElement),Array.prototype.forEach.call(t.domElement.getElementsByTagName("canvas"),e=>{s(e)}))}(this._rootBackbone);const n=document.implementation.createHTMLDocument("");n.documentElement.innerHTML=this.domElement.outerHTML,n.documentElement.setAttribute("xmlns",n.documentElement.namespaceURI),n.documentElement.appendChild(document.createElement("style")).innerHTML=`.${fi.ROOT_CLASS_NAME} { display:none; } `;let r=n.documentElement.getElementsByTagName("canvas");r=Array.prototype.slice.call(r);for(let u=0;u{$u.elementToSVGDataURL(n.documentElement,o,a,e)};let l=0,d=!1;const c=Array.prototype.slice.call(n.documentElement.getElementsByTagName("image"));for(let u=0;u{const i=new window.Image,s=e;i.onload=()=>{const e=document.createElement("canvas");e.width=i.width,e.height=i.height,e.getContext("2d").drawImage(i,0,0),s.setAttribute("xlink:href",e.toDataURL()),0==--l&&h()},i.onerror=()=>{0==--l&&h()},i.src=t})())}d||h()}popupRasterization(){this.foreignObjectRasterization(e=>{e&&window.open(e)})}getTrailFromPDOMIndicesString(e){if(!this._rootPDOMInstance)return null;let t=this._rootPDOMInstance;const i=e.split(_i.PDOM_UNIQUE_ID_SEPARATOR);for(let s=0;s

${(new window.XMLSerializer).serializeToString(e)}

`,a=new window.Image;a.onload=()=>{r.drawImage(a,0,0),s(n.toDataURL())},a.onerror=()=>{s(null)};const h=new window.TextEncoderLite("utf-8").encode(o),l=window.fromByteArray(h);a.src="data:image/svg+xml;base64,"+l}static assertSubtreeDisposed(e){0}static addInputListener(e){_.includes($u.inputListeners,e)||$u.inputListeners.push(e)}static removeInputListener(e){$u.inputListeners.splice(_.indexOf($u.inputListeners,e),1)}static interruptInput(){const e=$u.inputListeners.slice(0);for(let t=0;t0&&s=0&&s{const t={index:null};return e.parents[0]&&(t.index=e.parents[0].indexOfChild(e)),t},applyState:(e,t)=>{const i=e.parents[0];if(i&&t.index){const s=i.children;s[i.indexOfChild(e)]=s[t.index],s[t.index]=e,i.setChildren(s)}},stateSchema:{index:(0,dt.Z)(ee.Z)},methods:{linkIndex:{returnType:ee.Z,parameterTypes:[(0,ep.Z)(_n.Z,[ee.Z])],documentation:"Following the PropertyIO.link pattern, subscribe for notifications when the index in the parent changes, and receive a callback with the current value. The return value is a numeric ID for use with clearLinkIndex.",implementation:function(e){const t=()=>{const t=this.parents[0].indexOfChild(this);e(t)};this.parents[0].childrenChangedEmitter.addListener(t),t();const i=ip;return tp[i]=t,ip++,i}},unlinkIndex:{returnType:_n.Z,parameterTypes:[ee.Z],documentation:"Unlink a listener that has been added using linkIndex, by its numerical ID (like setTimeout/clearTimeout)",implementation:function(e){const t=tp[e];this.parents[0].childrenChangedEmitter.removeListener(t),delete tp[e]}},clearLinkIndex:{returnType:_n.Z,parameterTypes:[ee.Z],documentation:'Deprecated, see "unlinkIndex".',implementation:function(e){const t=tp[e];this.parents[0].childrenChangedEmitter.removeListener(t),delete tp[e]}},moveForward:{returnType:_n.Z,parameterTypes:[],implementation:function(){var e;(e=this)._parents.forEach(t=>sp(t,e,1))},documentation:"Move this Node one index forward in each of its parents, skipping invisible Nodes. If the Node is already at the front, this is a no-op."},moveBackward:{returnType:_n.Z,parameterTypes:[],implementation:function(){var e;(e=this)._parents.forEach(t=>sp(t,e,-1))},documentation:"Move this Node one index backward in each of its parents, skipping invisible Nodes. If the Node is already at the back, this is a no-op."}}});W.register("IndexedNodeIO",np);const rp=np;class op extends fo.ZP{constructor(e,t,i){i=(0,Mt.Z)({nodeTandem:Pe.Z.REQUIRED},i),super([new kt.Z(!0,{tandem:i.nodeTandem.createTandem("visibleProperty")}),...e],(function(e){for(var i=arguments.length,s=new Array(i>1?i-1:0),n=1;n{const e=window.phet.chipper.queryParameters.gameUpLogging,t=window.phet.chipper.queryParameters.gameUp,i=window.phet.chipper.queryParameters.gameUpTestHarness,s=t=>e&&console.log(t);if(t){s("Enabled Game Up Camera");const e=".brainpop.com";let t=!1,n=0;const r=()=>{!t&&n<10&&(parent.postMessage("captureReady","*"),n++,s("Posted captureReady, number of checks: "+n),setTimeout(r,1e3))},o=n=>{if(-1!==n.origin.indexOf(e,n.origin.length-e.length)||i)if("captureImage"===n.data){const e=window.phet.joist.ScreenshotGenerator.generateScreenshot(window.phet.joist.sim,"image/jpeg");a(e,n.origin,n.source),s("Sent image")}else"GameUpCaptureReady"===n.data&&(s("GameUpCaptureReady"),t=!0)},a=(e,t,i)=>{e=e.replace("data:image/jpeg;base64,",""),i.postMessage(e,t)};window.addEventListener?window.addEventListener("message",o,!1):window.attachEvent&&window.attachEvent("onmessage",o),r()}},7298:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(4974);class n extends Error{constructor(){super("CouldNotYetDeserializeError")}}s.Z.register("CouldNotYetDeserializeError",n);const r=n},2976:(e,t,i)=>{"use strict";var s;let n;i.d(t,{Z:()=>c});var r=i(2956),o=i(4676),a=i(1091),h=i(4974),l=i(3409);n=a.Z.EVENT_TYPE_MODEL;class d extends o.Z{}_defineProperty(d,"USER",new(s=d)),_defineProperty(d,n,new s),_defineProperty(d,"WRAPPER",new s),_defineProperty(d,"OPT_OUT",new s),_defineProperty(d,"enumeration",new r.Z(s)),_defineProperty(d,"phetioType",(0,l.Z)(s)),h.Z.register("EventType",d);const c=d},5281:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>y});var n=i(4974),r=i(3600),o=i(2550),a=i(1005),h=i(538),l=i(516),d=i(3061),c=i(1617);const u=[];class p extends l.Z{constructor(e,t){const i=(0,o.ZP)()({parameters:u,phetioOuterType:p.PhetioActionIO,tandem:a.Z.OPTIONAL,phetioState:!1,phetioReadOnly:c.Z.DEFAULT_OPTIONS.phetioReadOnly,phetioHighFrequency:c.Z.DEFAULT_OPTIONS.phetioHighFrequency,phetioEventType:c.Z.DEFAULT_OPTIONS.phetioEventType,phetioDocumentation:"A class that wraps a function, adding API to execute that function and data stream capture."},t);super(i),this.action=e,this.isExecutingCount=0,this.disposeOnExecuteCompletion=!1,this.executedEmitter=new d.Z({parameters:i.parameters,tandem:i.tandem.createTandem("executedEmitter"),phetioState:i.phetioState,phetioReadOnly:i.phetioReadOnly,phetioHighFrequency:i.phetioHighFrequency,phetioEventType:i.phetioEventType,phetioDocumentation:"Emitter that emits when this actions work is complete"}),this.disposePhetioAction=()=>{this.executedEmitter.dispose()}}execute(){this.isExecutingCount++;for(var e=arguments.length,t=new Array(e),i=0;i0?this.disposeOnExecuteCompletion=!0:this.disposePhetioAction(),super.dispose()}}s=p,_defineProperty(p,"PhetioActionIO",e=>{const t=e.map(m).join(",");return g.has(t)||g.set(t,new r.Z(`PhetioActionIO<${e.map(m).join(", ")}>`,{valueType:s,documentation:"Executes when an event occurs",events:["executed"],parameterTypes:e,metadataDefaults:{phetioState:!1},methods:{execute:{returnType:h.Z,parameterTypes:e,implementation:function(){const e=this.getValidationErrors(...arguments);if(e.length>0)throw new Error("Validation errors: "+e.join(", "));this.execute(...arguments)},documentation:"Executes the function the PhetioAction is wrapping.",invocableForReadOnlyElements:!1}}})),g.get(t)});const m=e=>e.typeName,g=new Map;n.Z.register("PhetioAction",p);const y=p},516:(e,t,i)=>{"use strict";i.d(t,{Z:()=>m});i(6212);var s=i(2550),n=i(1617),r=i(1005),o=i(7922),a=i(7959),h=i(4865);const l={validateValidator:!1},d=[],c=(["name","phetioType","phetioDocumentation","phetioPrivate"].concat(h.Z.VALIDATOR_KEYS),e=>e.phetioType),u=e=>e.name;class p extends n.Z{constructor(e){const t=(0,s.ZP)()({parameters:d,tandem:r.Z.OPTIONAL,phetioPlayback:n.Z.DEFAULT_OPTIONS.phetioPlayback,phetioEventMetadata:n.Z.DEFAULT_OPTIONS.phetioEventMetadata,phetioDocumentation:""},e),i=t.parameters.filter(c);t.phetioType=t.phetioOuterType(i.map(c)),t.phetioPlayback&&(t.phetioEventMetadata=t.phetioEventMetadata||{},t.phetioEventMetadata.dataKeys=t.parameters.map(u)),t.phetioDocumentation=p.getPhetioDocumentation(t.phetioDocumentation,i),super(t),this.parameters=t.parameters}static validateParameters(e,t){(0,a.Z)(e,{valueType:Array});let i=!1;for(let s=0;s0){e={};for(var t=arguments.length,i=new Array(t),s=0;sNo parameters.":`
The parameters are:
    ${t.map(e=>{const t=e.phetioDocumentation?" - "+e.phetioDocumentation:"";return`
  1. ${e.name}: ${e.phetioType.typeName}${t}
  2. `}).join("
    ")}
`)}}o.Z.register("PhetioDataHandler",p);const m=p},1617:(e,t,i)=>{"use strict";i.d(t,{V:()=>v,Z:()=>V});i(732),i(7959);var s=i(9059),n=(i(6212),i(831)),r=i(2550),o=i(2976),a=i(1005),h=i(4974),l=i(3600),d=i(2643);const c=new l.Z("LinkedElementIO",{isValidValue:()=>!0,documentation:"A LinkedElement",toStateObject:e=>({elementID:e.element.tandem.phetioID}),applyState:_.noop,stateSchema:{elementID:d.Z}});h.Z.register("LinkedElementIO",c);const u=c,p=["phetioDynamicElement","phetioEventType","phetioIsArchetype","phetioPlayback","phetioReadOnly","phetioState","phetioTypeName"];const m=new class{constructor(){_defineProperty(this,"apiMismatches",[]),_defineProperty(this,"simHasStarted",!1),_defineProperty(this,"enabled",!1),_defineProperty(this,"everyPhetioType",{})}onSimStarted(){this.enabled&&phet.joist.sim.allScreensCreated&&(this.validateOverridesFile(),this.validatePreferencesModel()),phet.preloads.phetio.queryParameters.phetioPrintAPIProblems&&this.apiMismatches&&console.log("PhET-iO api problems detected: ",this.apiMismatches),this.simHasStarted=!0}validatePreferencesModel(){Object.keys(phet.phetio.phetioEngine.phetioObjectMap).filter(e=>e.includes(".preferencesModel.")).forEach(e=>{let t=phet.phetio.phetioEngine.phetioObjectMap[e];for(;t instanceof v;)t=t.element})}onPhetioObjectRemoved(e){if(!this.enabled)return;const t=e.tandem.phetioID;e.phetioDynamicElement||this.assertAPIError({phetioID:t,ruleInViolation:"2. Any static, registered PhetioObject can never be deregistered."})}onPhetioObjectAdded(e){if(!this.enabled)return;const t=e.phetioType;this.everyPhetioType[t.typeName]||(this.everyPhetioType[t.typeName]=t),this.simHasStarted&&phet.axon.animationFrameTimer.runOnNextTick(()=>{if(e.phetioDynamicElement){if(phet.preloads.phetio.createArchetypes&&!e.isDisposed){const t=e.tandem.getArchetypalPhetioID(),i=phet.phetio.phetioEngine.getPhetioObject(t).getMetadata();this.checkDynamicInstanceAgainstArchetype(e,i,"simulation archetype")}}else this.assertAPIError({phetioID:e.tandem.phetioID,ruleInViolation:"1. After startup, only dynamic instances prescribed by the baseline file can be registered."})})}validateOverridesFile(){const e=phet.phetio.phetioEngine.getPhetioElementsBaseline();for(const t in window.phet.preloads.phetio.phetioElementsOverrides){t.includes(a.i);if(phet.preloads.phetio.createArchetypes||e.hasOwnProperty(t))if(e.hasOwnProperty(t)){const i=window.phet.preloads.phetio.phetioElementsOverrides[t],s=e[t];0===Object.keys(i).length&&this.assertAPIError({phetioID:t,ruleInViolation:"4. Any schema entries in the overrides file must be different from its baseline counterpart.",message:"no metadata keys found for this override."});for(const e in i)s.hasOwnProperty(e)||this.assertAPIError({phetioID:t,ruleInViolation:"8. Any schema entries in the overrides file must be different from its baseline counterpart.",message:"phetioID metadata key not found in the baseline: "+e}),i[e]===s[e]&&this.assertAPIError({phetioID:t,ruleInViolation:"8. Any schema entries in the overrides file must be different from its baseline counterpart.",message:"phetioID metadata override value is the same as the corresponding metadata value in the baseline."})}else this.assertAPIError({phetioID:t,ruleInViolation:"3. Any schema entries in the overrides file must exist in the baseline file.",message:"phetioID expected in the baseline file but does not exist"});else;}}assertAPIError(e){e.phetioID?(e.phetioID,e.ruleInViolation):e.ruleInViolation;this.apiMismatches.push(e),this.simHasStarted||phet.preloads.phetio.queryParameters.phetioPrintAPIProblems}checkDynamicInstanceAgainstArchetype(e,t,i){const s=e.getMetadata();p.forEach(n=>{"phetioDynamicElement"!==n&&"phetioArchetypePhetioID"!==n&&"phetioIsArchetype"!==n&&t[n]!==s[n]&&e.tandem&&this.assertAPIError({phetioID:e.tandem.phetioID,ruleInViolation:"5. Dynamic element metadata should match the archetype in the API.",source:i,message:"mismatched metadata: "+n})})}};h.Z.register("phetioAPIValidation",m);const g=m;var y=i(1091),f=i(1731);const A=a.Z.PHET_IO_ENABLED,b=(l.Z,o.Z,e=>e.tandem.phetioID),P={tandem:a.Z.OPTIONAL,phetioType:l.Z.ObjectIO,phetioDocumentation:y.Z.PHET_IO_OBJECT_METADATA_DEFAULTS.phetioDocumentation,phetioState:y.Z.PHET_IO_OBJECT_METADATA_DEFAULTS.phetioState,phetioReadOnly:y.Z.PHET_IO_OBJECT_METADATA_DEFAULTS.phetioReadOnly,phetioEventType:o.Z.MODEL,phetioHighFrequency:y.Z.PHET_IO_OBJECT_METADATA_DEFAULTS.phetioHighFrequency,phetioPlayback:y.Z.PHET_IO_OBJECT_METADATA_DEFAULTS.phetioPlayback,phetioFeatured:y.Z.PHET_IO_OBJECT_METADATA_DEFAULTS.phetioFeatured,phetioDynamicElement:y.Z.PHET_IO_OBJECT_METADATA_DEFAULTS.phetioDynamicElement,phetioDesigned:y.Z.PHET_IO_OBJECT_METADATA_DEFAULTS.phetioDesigned,phetioEventMetadata:null,tandemNameSuffix:null};class V extends f.Z{constructor(e){super(e),this.tandem=P.tandem,this.phetioID=this.tandem.phetioID,this.phetioObjectInitialized=!1,e&&this.initializePhetioObject({},e)}initializePhetioObject(e,t){if(t.tandem&&a.Z.onMissingTandem(t.tandem),a.Z.VALIDATION&&t.tandem&&t.tandem.required,!(A&&t.tandem&&t.tandem.supplied))return void(t.tandem&&(this.tandem=t.tandem,this.phetioID=this.tandem.phetioID));const i=(0,r.JA)({},P,e);let s=(0,r.ZP)()(i,t);this.phetioIsArchetype=!1,this.phetioBaselineMetadata=g.enabled||phet.preloads.phetio.queryParameters.phetioEmitAPIBaseline?this.getMetadata((0,n.Z)({phetioIsArchetype:this.phetioIsArchetype,phetioArchetypePhetioID:this.phetioArchetypePhetioID},s)):null;const o=s.tandem.getArchetypalPhetioID();if(window.phet.preloads.phetio.phetioElementsOverrides){const e=window.phet.preloads.phetio.phetioElementsOverrides[o];e&&(s=(0,r.ZP)()(s,e))}this.tandem=s.tandem,this.phetioID=this.tandem.phetioID,this._phetioType=s.phetioType,this._phetioState=s.phetioState,this._phetioReadOnly=s.phetioReadOnly,this._phetioDocumentation=s.phetioDocumentation,this._phetioEventType=s.phetioEventType,this._phetioHighFrequency=s.phetioHighFrequency,this._phetioPlayback=s.phetioPlayback,this._phetioDynamicElement=s.phetioDynamicElement,this._phetioFeatured=s.phetioFeatured,this._phetioEventMetadata=s.phetioEventMetadata,this._phetioDesigned=s.phetioDesigned,this.phetioArchetypePhetioID=null,this.linkedElements=[],this.phetioNotifiedObjectCreated=!1,this.phetioMessageStack=[],this._phetioPlayback&&(this._phetioEventMetadata=this._phetioEventMetadata||{},this._phetioEventMetadata.playback=!0),this.tandem.addPhetioObject(this),this.phetioObjectInitialized=!0}static swapCaseOfFirstCharacter(e){const t=e[0];return(t===t.toLowerCase()?t.toUpperCase():t.toLowerCase())+e.substring(1)}get phetioType(){return this._phetioType}get phetioState(){return this._phetioState}get phetioReadOnly(){return this._phetioReadOnly}get phetioDocumentation(){return this._phetioDocumentation}get phetioEventType(){return this._phetioEventType}get phetioHighFrequency(){return this._phetioHighFrequency}get phetioPlayback(){return this._phetioPlayback}get phetioDynamicElement(){return this._phetioDynamicElement}get phetioFeatured(){return this._phetioFeatured}get phetioEventMetadata(){return this._phetioEventMetadata}get phetioDesigned(){return this._phetioDesigned}phetioStartEvent(e,t){if(A&&this.isPhetioInstrumented()){const i=(0,r.ZP)()({data:null,getData:null},t);if(!_.hasIn(window,"phet.phetio.dataStream"))return void this.phetioMessageStack.push(-1);const s=this.phetioHighFrequency&&_.hasIn(window,"phet.preloads.phetio.queryParameters")&&!window.phet.preloads.phetio.queryParameters.phetioEmitHighFrequencyEvents&&!phet.phetio.dataStream.isEmittingLowFrequencyEvent(),n=!_.hasIn(window,"phet.phetio.dataStream");if(s||this.phetioEventType===o.Z.OPT_OUT||n)return void this.phetioMessageStack.push(-1);const a=i.getData?i.getData():i.data;this.phetioMessageStack.push(phet.phetio.dataStream.start(this.phetioEventType,this.tandem.phetioID,this.phetioType,e,a,this.phetioEventMetadata,this.phetioHighFrequency)),this.phetioPlayback&&phet.phetio.dataStream.pushNonPlaybackable()}}phetioEndEvent(){if(A&&this.isPhetioInstrumented()){const e=this.phetioMessageStack.pop();if(-1===e)return;this.phetioPlayback&&phet.phetio.dataStream.popNonPlaybackable(),phet.phetio.dataStream.end(e)}}propagateDynamicFlagsToDescendants(){const e=phet.phetio.phetioEngine,t=a.Z.launched?[]:a.Z.bufferedPhetioObjects.map(b);this.tandem.iterateDescendants(i=>{const s=i.phetioID;if(e.hasPhetioObject(s)||!a.Z.launched&&t.includes(s)){const i=e.hasPhetioObject(s)?e.getPhetioObject(s):a.Z.bufferedPhetioObjects[t.indexOf(s)];i.phetioIsArchetype=this.phetioIsArchetype,i.setPhetioDynamicElement(this.phetioDynamicElement),i.phetioBaselineMetadata&&(i.phetioBaselineMetadata.phetioIsArchetype=this.phetioIsArchetype)}})}setPhetioDynamicElement(e){this._phetioDynamicElement=!this.phetioIsArchetype&&e,this.phetioArchetypePhetioID=e?this.tandem.getArchetypalPhetioID():null,this.phetioBaselineMetadata&&(this.phetioBaselineMetadata.phetioDynamicElement=this.phetioDynamicElement)}markDynamicElementArchetype(){this.phetioIsArchetype=!0,this.setPhetioDynamicElement(!1),this.phetioBaselineMetadata&&(this.phetioBaselineMetadata.phetioIsArchetype=this.phetioIsArchetype),a.Z.PHET_IO_ENABLED&&this.propagateDynamicFlagsToDescendants()}isPhetioInstrumented(){return this.tandem&&this.tandem.supplied}addLinkedElement(e,t){this.isPhetioInstrumented()?A&&e.isPhetioInstrumented()&&this.linkedElements.push(new v(e,t)):this.linkedElements=null}removeLinkedElements(e){if(this.isPhetioInstrumented()&&this.linkedElements){this.linkedElements.filter(t=>t.element===e).forEach(e=>{e.dispose(),(0,s.Z)(this.linkedElements,e)})}}onSimulationConstructionCompleted(){this.phetioBaselineMetadata=null}dispose(){const e=[];if(a.Z.PHET_IO_ENABLED&&this.tandem.supplied){const t=phet.phetio.phetioEngine;this.tandem.iterateDescendants(i=>{t.hasPhetioObject(i.phetioID)&&e.push(t.getPhetioObject(i.phetioID))})}this.phetioObjectInitialized&&this.tandem.removePhetioObject(this),this.linkedElements&&(this.linkedElements.forEach(e=>e.dispose()),this.linkedElements.length=0),super.dispose()}getMetadata(e){const t={phetioTypeName:(e=e||this).phetioType.typeName,phetioDocumentation:e.phetioDocumentation,phetioState:e.phetioState,phetioReadOnly:e.phetioReadOnly,phetioEventType:o.Z.phetioType.toStateObject(e.phetioEventType),phetioHighFrequency:e.phetioHighFrequency,phetioPlayback:e.phetioPlayback,phetioDynamicElement:e.phetioDynamicElement,phetioIsArchetype:e.phetioIsArchetype,phetioFeatured:e.phetioFeatured,phetioDesigned:e.phetioDesigned};return e.phetioArchetypePhetioID&&(t.phetioArchetypePhetioID=e.phetioArchetypePhetioID),t}static create(e){return new V(e)}}_defineProperty(V,"DEFAULT_OPTIONS",P);class v extends V{constructor(e,t){const i=(0,r.ZP)()({phetioType:u,phetioState:!0},t);i.phetioReadOnly=!0,i.phetioFeatured=e.phetioFeatured,super(i),this.element=e}getMetadata(e){const t=super.getMetadata(e);return delete t.phetioFeatured,t}}h.Z.register("PhetioObject",V)},1005:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>S,i:()=>y});var n=i(9059),r=i(831),o=i(2550),a=i(4974);const h=_.hasIn(window,"phet.chipper.packageObject")?phet.chipper.packageObject:{name:"placeholder"},l=_.hasIn(window,"phet.preloads.phetio"),d=l&&phet.preloads.phetio.queryParameters.phetioPrintMissingTandems,c=!_.hasIn(h,"phet.phet-io.validation")||!!h.phet["phet-io"].validation,u=window.QueryStringMachine&&QueryStringMachine.containsKey("phetioValidation"),p=l&&u?!!phet.preloads.phetio.queryParameters.phetioValidation:l&&c,m=l&&p&&!d,g=phetio.PhetioIDUtils.INTER_TERM_SEPARATOR,y="archetype",f={required:[],optional:[]},A=[],b=[];class P{constructor(e,t,i){_defineProperty(this,"children",{}),_defineProperty(this,"isDisposed",!1),this.parentTandem=e,this.name=t,this.phetioID=this.parentTandem?window.phetio.PhetioIDUtils.append(this.parentTandem.phetioID,this.name):this.name;const s=(0,o.ZP)()({required:!0,supplied:!0,isValidTandemName:e=>/^[a-zA-Z0-9[\],]+$/.test(e)},i);this.children={},this.parentTandem&&this.parentTandem.addChild(t,this),this.required=s.required,this.supplied=s.supplied}static onMissingTandem(e){if(d&&!e.supplied){const t=(new Error).stack;e.required?f.required.push({phetioID:e.phetioID,stack:t}):t.includes("Font")||f.optional.push({phetioID:e.phetioID,stack:t})}}addPhetioObject(e){if(l){if(!this.required&&!this.supplied)return;if(P.launched)for(let t=0;te.includes("_")?y:e).join(g)}return e}createGroupTandem(e){return this.children[e]?this.children[e]:new w(this,e)}equals(e){return this.phetioID===e.phetioID}static addPhetioObjectListener(e){A.push(e)}static launch(){for(P.launched=!0;b.length>0;)b.shift()()}static unlaunch(){P.launched=!1,P.bufferedPhetioObjects.length=0,b.length=0}static addLaunchListener(e){b.push(e)}createTandemFromPhetioID(e){return this.createTandem(e.split(window.phetio.PhetioIDUtils.SEPARATOR).join(g),{isValidTandemName:e=>/^[a-zA-Z0-9[\],-_]+$/.test(e)})}}s=P,_defineProperty(P,"SCREEN_TANDEM_NAME_SUFFIX","Screen"),_defineProperty(P,"missingTandems",f),_defineProperty(P,"PHET_IO_ENABLED",l),_defineProperty(P,"API_GENERATION",s.PHET_IO_ENABLED&&(phet.preloads.phetio.queryParameters.phetioPrintAPI||phet.preloads.phetio.queryParameters.phetioCompareAPI)),_defineProperty(P,"VALIDATION",m),_defineProperty(P,"METADATA_KEY","_metadata"),_defineProperty(P,"DATA_KEY","_data"),_defineProperty(P,"launched",!1),_defineProperty(P,"bufferedPhetioObjects",[]),P.addLaunchListener(()=>{for(;P.bufferedPhetioObjects.length>0;){const e=P.bufferedPhetioObjects.shift();e.tandem.addPhetioObject(e)}});P.ROOT=new class extends P{createTandem(e,t){if(P.VALIDATION){e===window.phetio.PhetioIDUtils.GLOBAL_COMPONENT_NAME||"requiredTandem"===e||"optionalTandem"===e||"test"===e||e===window.phetio.PhetioIDUtils.GENERAL_COMPONENT_NAME||_.endsWith(e,P.SCREEN_TANDEM_NAME_SUFFIX)}return super.createTandem(e,t)}}(null,_.camelCase(h.name));const V=P.ROOT.createTandem(window.phetio.PhetioIDUtils.GENERAL_COMPONENT_NAME);P.ROOT_TEST=P.ROOT.createTandem("test"),P.GENERAL_MODEL=V.createTandem(window.phetio.PhetioIDUtils.MODEL_COMPONENT_NAME),P.GENERAL_VIEW=V.createTandem(window.phetio.PhetioIDUtils.VIEW_COMPONENT_NAME),P.GENERAL_CONTROLLER=V.createTandem(window.phetio.PhetioIDUtils.CONTROLLER_COMPONENT_NAME);const v=P.ROOT.createTandem(window.phetio.PhetioIDUtils.GLOBAL_COMPONENT_NAME);P.GLOBAL_MODEL=v.createTandem(window.phetio.PhetioIDUtils.MODEL_COMPONENT_NAME),P.GLOBAL_VIEW=v.createTandem(window.phetio.PhetioIDUtils.VIEW_COMPONENT_NAME),P.COLORS=P.GLOBAL_VIEW.createTandem(window.phetio.PhetioIDUtils.COLORS_COMPONENT_NAME),P.OPTIONAL=P.ROOT.createTandem("optionalTandem",{required:!1,supplied:!1}),P.OPT_OUT=P.OPTIONAL,P.REQUIRED=P.ROOT.createTandem("requiredTandem",{required:m||d,supplied:!1}),P.PREFERENCES=P.GLOBAL_MODEL.createTandem("preferences");class w extends P{constructor(e,t){super(e,t),this.groupName=t,this.groupMemberIndex=0}createNextTandem(){const e=this.parentTandem.createTandem(`${this.groupName}${this.groupMemberIndex}`);return this.groupMemberIndex++,e}}a.Z.register("Tandem",P);const S=P},1091:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});const s={OBJECT_IO_TYPE_NAME:"ObjectIO",EVENT_TYPE_MODEL:"MODEL",PHET_IO_OBJECT_METADATA_DEFAULTS:{phetioTypeName:"ObjectIO",phetioDocumentation:"",phetioState:!0,phetioReadOnly:!1,phetioEventType:"MODEL",phetioHighFrequency:!1,phetioPlayback:!1,phetioDynamicElement:!1,phetioIsArchetype:!1,phetioFeatured:!1,phetioDesigned:!1,phetioArchetypePhetioID:null},METADATA_KEY_NAME:"_metadata",DATA_KEY_NAME:"_data"};i(4974).Z.register("TandemConstants",s);const n=s},4974:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s=new(i(2492).Z)("tandem")},0:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(4865),n=i(4974),r=i(3600),o=i(9196);const a=new Map,h=e=>(a.has(e)||a.set(e,new r.Z(`ArrayIO<${e.typeName}>`,{valueType:Array,isValidValue:t=>_.every(t,t=>s.Z.isValueValid(t,e.validator)),parameterTypes:[e],toStateObject:t=>t.map(e.toStateObject),fromStateObject:t=>t.map(e.fromStateObject),documentation:"IO Type for the built-in JS array type, with the element type specified.",stateSchema:o.Z.asValue(`Array<${e.typeName}>`,{isValidValue:t=>_.every(t,t=>e.isStateObjectValid(t))})})),a.get(e));n.Z.register("ArrayIO",h);const l=h},5602:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(4974),n=i(3600),r=i(9196),o=i(6540);const a=new n.Z("BooleanIO",{supertype:o.Z,valueType:"boolean",documentation:"IO Type for Javascript's boolean primitive type",stateSchema:r.Z.asValue("boolean",{valueType:"boolean"}),toStateObject:_.identity});s.Z.register("BooleanIO",a);const h=a},3409:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(3600),n=i(9196),r=i(4974);const o=new Map,a=e=>e.join("|"),h=e=>{const t=e.enumeration;if(!o.has(t)){const e=t.phetioDocumentation?" "+t.phetioDocumentation:"",i=t.keys,r=t.values,h=`EnumerationIO(${a(i)})`;o.set(t,new s.Z(h,{validValues:r,documentation:`Possible values: ${i.join(", ")}.${e}`,toStateObject:e=>t.getKey(e),fromStateObject:e=>t.getValue(e),stateSchema:n.Z.asValue(""+a(i),{isValidValue:e=>i.includes(e)})}))}return o.get(t)};r.Z.register("EnumerationIO",h);const l=h},6292:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(4974),n=i(3600);const r=new Map,o=(e,t)=>{for(let s=0;se.typeName).join(",")}`;if(!r.has(i)){let s=t.map(e=>e.typeName).join(", ");""===s&&(s="none");const o=t.map(e=>e.typeName).join(",");r.set(i,new n.Z(`FunctionIO(${o})=>${e.typeName}`,{valueType:"function",isFunctionType:!0,parameterTypes:t.concat([e]),documentation:`Wrapper for the built-in JS function type.
Arguments: ${s}
Return Type: `+e.typeName}))}return r.get(i)};s.Z.register("FunctionIO",o);const a=o},3600:(e,t,i)=>{"use strict";i.d(t,{Z:()=>p});var s=i(7959),n=i(4865),r=i(2550),o=i(4974);const a={IO_TYPE_SUFFIX:"IO"};o.Z.register("PhetioConstants",a);const h=a;var l=i(1091),d=i(9196);const c={validateValidator:!1},u=e=>{const t=e.indexOf(h.IO_TYPE_SUFFIX);return e.substring(0,t)};class p{constructor(e,t){this.typeName=e;const i=t.supertype||p.ObjectIO,o=!!t.toStateObject,a=!!t.applyState,h=!!t.stateSchema,l=(0,r.ZP)()({supertype:p.ObjectIO,methods:{},events:[],metadataDefaults:{},dataDefaults:{},methodOrder:[],parameterTypes:[],documentation:"IO Type for "+u(e),isFunctionType:!1,toStateObject:i&&i.toStateObject,fromStateObject:i&&i.fromStateObject,stateObjectToCreateElementArguments:i&&i.stateObjectToCreateElementArguments,applyState:i&&i.applyState,stateSchema:null,defaultDeserializationMethod:"fromStateObject",addChildElement:i&&i.addChildElement},t);if(this.supertype=i,this.documentation=l.documentation,this.methods=l.methods,this.events=l.events,this.metadataDefaults=l.metadataDefaults,this.dataDefaults=l.dataDefaults,this.methodOrder=l.methodOrder,this.parameterTypes=l.parameterTypes,this.validator=_.pick(l,n.Z.VALIDATOR_KEYS),this.validator.validationMessage=this.validator.validationMessage||"Validation failed IOType Validator: "+this.typeName,this.defaultDeserializationMethod=l.defaultDeserializationMethod,null===l.stateSchema||l.stateSchema instanceof d.Z)this.stateSchema=l.stateSchema;else{const e="function"==typeof l.stateSchema?l.stateSchema(this):l.stateSchema;this.stateSchema=new d.Z({compositeSchema:e})}this.toStateObject=e=>{let t;return(0,s.Z)(e,this.validator,c),t=!o&&h&&this.stateSchema&&this.stateSchema.isComposite()?this.stateSchema.defaultToStateObject(e):l.toStateObject(e),t},this.fromStateObject=l.fromStateObject,this.stateObjectToCreateElementArguments=l.stateObjectToCreateElementArguments,this.applyState=(e,t)=>{(0,s.Z)(e,this.validator,c),!a&&h&&this.stateSchema&&this.stateSchema.isComposite()?this.stateSchema.defaultApplyState(e,t):l.applyState(e,t)},this.isFunctionType=l.isFunctionType,this.addChildElement=l.addChildElement}getTypeHierarchy(){const e=[];let t=this;for(;t;)e.push(t),t=t.supertype;return e}extends(e){return this.getTypeHierarchy().includes(e)}getAllMetadataDefaults(){return _.merge({},this.supertype?this.supertype.getAllMetadataDefaults():{},this.metadataDefaults)}getAllDataDefaults(){return _.merge({},this.supertype?this.supertype.getAllDataDefaults():{},this.dataDefaults)}isStateObjectValid(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],n=!0;if(this.stateSchema){const n=this.stateSchema.checkStateObjectValid(e,t,i,s);if(null!==n)return n}if(this.supertype)return n&&this.supertype.isStateObjectValid(e,t,i,s);if(!this.supertype&&e&&"string"!=typeof e&&!Array.isArray(e)){const t=(e,t)=>{const r=("public"===e?i:s).includes(t);r||(n=!1)};return Object.keys(e).filter(e=>"_private"!==e).forEach(e=>t("public",e)),e._private&&Object.keys(e._private).forEach(e=>t("private",e)),n}return!0}validateStateObject(e){this.isStateObjectValid(e,!0)}toString(){return this.typeName}}p.ObjectIO=new p(l.Z.OBJECT_IO_TYPE_NAME,{isValidValue:()=>!0,supertype:null,documentation:"The root of the IO Type hierarchy",toStateObject:e=>(phet&&phet.tandem&&phet.tandem.Tandem.VALIDATION,null),fromStateObject:()=>{throw new Error("ObjectIO.fromStateObject should not be called")},stateObjectToCreateElementArguments:e=>[],applyState:_.noop,metadataDefaults:l.Z.PHET_IO_OBJECT_METADATA_DEFAULTS,dataDefaults:{initialState:null},stateSchema:null}),o.Z.register("IOType",p)},4792:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(4974),n=i(3600),r=i(9196);const o=new n.Z("InfiniteNumberIO",{valueType:"number",documentation:"IO Type for Javascript's number primitive type",toStateObject:e=>e===Number.POSITIVE_INFINITY?"POSITIVE_INFINITY":e===Number.NEGATIVE_INFINITY?"NEGATIVE_INFINITY":e,fromStateObject:e=>"POSITIVE_INFINITY"===e?Number.POSITIVE_INFINITY:"NEGATIVE_INFINITY"===e?Number.NEGATIVE_INFINITY:e,stateSchema:r.Z.asValue("'POSITIVE_INFINITY'|'NEGATIVE_INFINITY'|number",{isValidValue:e=>"POSITIVE_INFINITY"===e||"NEGATIVE_INFINITY"===e||"number"==typeof e&&!isNaN(e)})});s.Z.register("InfiniteNumberIO",o);const a=o},2306:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(4865),n=i(4974),r=i(3600),o=i(9196);const a=new Map,h=e=>(a.has(e)||a.set(e,new r.Z(`NullableIO<${e.typeName}>`,{documentation:"An IOType adding support for null in addition to the behavior of its parameter.",isValidValue:t=>null===t||s.Z.isValueValid(t,e.validator),parameterTypes:[e],toStateObject:t=>null===t?null:e.toStateObject(t),fromStateObject:t=>null===t?null:e.fromStateObject(t),stateSchema:o.Z.asValue(`null|<${e.typeName}>`,{isValidValue:t=>null===t||e.isStateObjectValid(t)})})),a.get(e));n.Z.register("NullableIO",h);const l=h},8585:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(4974),n=i(3600),r=i(9196);const o=new n.Z("NumberIO",{valueType:"number",documentation:"IO Type for Javascript's number primitive type",toStateObject:_.identity,fromStateObject:e=>e,stateSchema:r.Z.asValue("number",{isValidValue:e=>"number"==typeof e&&!isNaN(e)&&e!==Number.POSITIVE_INFINITY&&e!==Number.NEGATIVE_INFINITY})});s.Z.register("NumberIO",o);const a=o},170:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(4974),n=i(3600),r=i(9196),o=i(6540);const a=e=>Object.getPrototypeOf(e)===Object.prototype,h=new n.Z("ObjectLiteralIO",{documentation:"IO Type for object literals",isValidValue:a,supertype:o.Z,stateSchema:r.Z.asValue("object",{valueType:Object,isValidValue:a}),toStateObject:_.identity});s.Z.register("ObjectLiteralIO",h);const l=h},1039:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(4865),n=i(4974),r=i(3600),o=i(9196);const a=new Map,h=e=>{const t=e.map(e=>e.typeName),i=t.join(",");if(!a.has(i)){const n=t=>{for(let i=0;i`,{documentation:"An IOType adding support for a composite type that can be any of its parameters.",parameterTypes:e,isValidValue:n,toStateObject:t=>{for(let i=0;ie[t.index].fromStateObject(t.state),stateSchema:o.Z.asValue(""+t.join("|"),{isValidValue:t=>"number"==typeof t.index&&e[t.index].isStateObjectValid(t.state)})}))}return a.get(i)};n.Z.register("OrIO",h);const l=h},9883:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(4865),n=i(7298),r=i(4974),o=i(3600),a=i(2643);const h=new Map,l=e=>{const t=e;return h.has(t)||h.set(t,new o.Z(`ReferenceIO<${e.typeName}>`,{isValidValue:t=>s.Z.isValueValid(t,e.validator),documentation:"Uses reference identity for serializing and deserializing, and validates based on its parameter IO Type.",parameterTypes:[e],toStateObject:e=>({phetioID:e.tandem.phetioID}),stateSchema:{phetioID:a.Z},fromStateObject(e){if(phet.phetio.phetioEngine.hasPhetioObject(e.phetioID))return phet.phetio.phetioEngine.getPhetioObject(e.phetioID);throw new n.Z},applyState(e){}})),h.get(t)};r.Z.register("ReferenceIO",l);const d=l},9196:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(7959),n=i(4865),r=(i(6212),i(2550)),o=i(4974),a=i(3600);class h{constructor(e){const t=(0,r.ZP)()({displayString:"",validator:null,compositeSchema:null},e);this.displayString=t.displayString,this.validator=t.validator,this.compositeSchema=t.compositeSchema}validateStateSchema(e){0}defaultApplyState(e,t){const i=(t,s)=>{for(const n in t)if(t.hasOwnProperty(n))if("_private"===n)i(t._private,s._private);else{const i=t[n];"fromStateObject"===i.defaultDeserializationMethod?e[n]=t[n].fromStateObject(s[n]):t[n].applyState(e[n],s[n])}};i(this.compositeSchema,t)}defaultToStateObject(e){const t=i=>{const s={};for(const n in i)i.hasOwnProperty(n)&&("_private"===n?s._private=t(i._private):s[n]=i[n].toStateObject(e[n]));return s};return t(this.compositeSchema)}isComposite(){return!!this.compositeSchema}checkStateObjectValid(e,t,i,r){if(this.isComposite()){const t=e,s=this.compositeSchema;let n=null;const o=(e,t,i,s)=>{t?Object.keys(e).filter(e=>e!==s).forEach(s=>{const r=t.hasOwnProperty(s);r||(n=!1),e[s].validateStateObject(t[s]),i.push(s)}):n=!1};return o(s,t,i,"_private"),s._private&&o(s._private,t._private,r,null),n}{const i=e;return t&&(0,s.Z)(i,this.validator),n.Z.isValueValid(i,this.validator)}}getRelatedTypes(){const e=[],t=t=>{Object.keys(t).forEach(i=>{t[i]instanceof a.Z&&e.push(t[i])})};return this.compositeSchema&&(t(this.compositeSchema),this.compositeSchema._private&&t(this.compositeSchema._private)),e}getStateSchemaAPI(){if(this.isComposite()){const e=_.mapValues(this.compositeSchema,e=>e.typeName);return this.compositeSchema._private&&(e._private=_.mapValues(this.compositeSchema._private,e=>e.typeName)),e}return this.displayString}static asValue(e,t){return new h({validator:t,displayString:e})}}o.Z.register("StateSchema",h)},2643:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(4974),n=i(3600),r=i(9196),o=i(6540);const a=new n.Z("StringIO",{supertype:o.Z,valueType:"string",documentation:"IO Type for Javascript's string primitive type",stateSchema:r.Z.asValue("string",{valueType:"string"}),toStateObject:_.identity});s.Z.register("StringIO",a);const h=a},6540:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(4974),n=i(3600),r=i(9196);const o=new n.Z("ValueIO",{isValidValue:_.stubTrue,supertype:n.Z.ObjectIO,toStateObject:e=>e,fromStateObject:e=>e,stateSchema:r.Z.asValue("*",{isValidValue:_.stubTrue})});s.Z.register("ValueIO",o);const a=o},538:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(4974);const n=new(i(3600).Z)("VoidIO",{isValidValue:()=>!0,documentation:"Type for which there is no instance, usually to mark functions without a return value",toStateObject:()=>{}});s.Z.register("VoidIO",n);const r=n},2391:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>y});var n=i(3061),r=i(2550),o=i(1617),a=i(1005),h=i(3600),l=i(2306),d=i(8585),c=i(1039),u=i(2643),p=i(428),m=i(6692);class g extends o.Z{constructor(e){const t=(0,r.ZP)()({respectResponseCollectorProperties:!0,tandem:a.Z.OPTIONAL,phetioType:g.AnnouncerIO,phetioState:!1},e);super(t),_defineProperty(this,"readyToAnnounce",!0),_defineProperty(this,"hasSpoken",!1),this.respectResponseCollectorProperties=t.respectResponseCollectorProperties,this.announcementCompleteEmitter=new n.Z({parameters:[{name:"utterance",phetioType:p.Z.UtteranceIO},{name:"text",phetioType:(0,l.Z)((0,c.Z)([u.Z,d.Z]))}],tandem:t.tandem.createTandem("announcementCompleteEmitter"),phetioReadOnly:!0,phetioDocumentation:"The announcement that has just completed. The Utterance text could potentially differ from the exact text that was announced, so both are emitted. Use `text` for an exact match of what was announced."})}shouldUtteranceCancelOther(e,t){return t.priorityProperty.value{"use strict";i.d(t,{Z:()=>d});var s=i(5264),n=i(8292),r=i(2550),o=i(6975),a=i(6692);const h={nameResponse:null,objectResponse:null,contextResponse:null,hintResponse:null,ignoreProperties:!1,responsePatternCollection:o.Z.DEFAULT_RESPONSE_PATTERNS};class l{constructor(e){const t=(0,r.lB)()({},h,e);this._nameResponse=t.nameResponse,this._objectResponse=t.objectResponse,this._contextResponse=t.contextResponse,this._hintResponse=t.hintResponse,this.ignoreProperties=t.ignoreProperties,this.responsePatternCollection=t.responsePatternCollection}getNameResponse(){return l.getResponseText(this._nameResponse)}get nameResponse(){return this.getNameResponse()}set nameResponse(e){this.setNameResponse(e)}setNameResponse(e){this._nameResponse=e}getObjectResponse(){return l.getResponseText(this._objectResponse)}get objectResponse(){return this.getObjectResponse()}set objectResponse(e){this.setObjectResponse(e)}setObjectResponse(e){this._objectResponse=e}getContextResponse(){return l.getResponseText(this._contextResponse)}get contextResponse(){return this.getContextResponse()}set contextResponse(e){this.setContextResponse(e)}setContextResponse(e){this._contextResponse=e}getHintResponse(){return l.getResponseText(this._hintResponse)}get hintResponse(){return this.getHintResponse()}set hintResponse(e){this.setHintResponse(e)}setHintResponse(e){this._hintResponse=e}static getResponseText(e){return e instanceof s.Z||e instanceof n.Z?e.value:"function"==typeof e?e():e}copy(){return new l(this.serialize())}serialize(){return{nameResponse:this.nameResponse,objectResponse:this.objectResponse,contextResponse:this.contextResponse,hintResponse:this.hintResponse,ignoreProperties:this.ignoreProperties,responsePatternCollection:this.responsePatternCollection}}}_defineProperty(l,"DEFAULT_OPTIONS",h),a.Z.register("ResponsePacket",l);const d=l},6975:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(2550),n=i(6692);const r={nameObjectContextHint:"{{NAME}}, {{OBJECT}}, {{CONTEXT}} {{HINT}}",nameObjectContext:"{{NAME}}, {{OBJECT}}, {{CONTEXT}}",nameObjectHint:"{{NAME}}, {{OBJECT}}, {{HINT}}",nameContextHint:"{{NAME}}, {{CONTEXT}} {{HINT}}",nameObject:"{{NAME}}, {{OBJECT}}",nameContext:"{{NAME}}, {{CONTEXT}}",nameHint:"{{NAME}}, {{HINT}}",name:"{{NAME}}",objectContextHint:"{{OBJECT}}, {{CONTEXT}} {{HINT}}",objectContext:"{{OBJECT}}, {{CONTEXT}}",objectHint:"{{OBJECT}}, {{HINT}}",contextHint:"{{CONTEXT}} {{HINT}}",object:"{{OBJECT}}",context:"{{CONTEXT}}",hint:"{{HINT}}"};class o{constructor(e){const t=(0,s.lB)()({},r,e);this.nameObjectContextHint=t.nameObjectContextHint,this.nameObjectContext=t.nameObjectContext,this.nameObjectHint=t.nameObjectHint,this.nameContextHint=t.nameContextHint,this.nameObject=t.nameObject,this.nameContext=t.nameContext,this.nameHint=t.nameHint,this.name=t.name,this.objectContextHint=t.objectContextHint,this.objectContext=t.objectContext,this.objectHint=t.objectHint,this.contextHint=t.contextHint,this.object=t.object,this.context=t.context,this.hint=t.hint}getResponsePattern(e){const t=this[e];return t}static createPatternKey(e,t,i,s){let n="";return e&&(n=n.concat("NAME".concat("_"))),t&&(n=n.concat("OBJECT".concat("_"))),i&&(n=n.concat("CONTEXT".concat("_"))),s&&(n=n.concat("HINT".concat("_"))),_.camelCase(n)}}_defineProperty(o,"DEFAULT_RESPONSE_PATTERNS",new o),n.Z.register("ResponsePatternCollection",o);const a=o},621:(e,t,i)=>{"use strict";i.d(t,{Z:()=>D});var s=i(9806),n=i(4075),r=i(3061),o=i(4317),a=i(8036),h=i(592),l=i(5428),d=i(2550),c=i(8377),u=i(2391),p=i(428),m=i(6692);const g={initialize(){if(window.speechSynthesis||window.SpeechSynthesis||window.SpeechSynthesisUtterance)throw new Error("SpeechSynthesis is supported here, the polyfill should not overwrite it");window.SpeechSynthesis=window.parent.SpeechSynthesis,window.speechSynthesis=new window.parent.SpeechSynthesis,window.SpeechSynthesisUtterance=window.parent.SpeechSynthesisUtterance}};m.Z.register("SpeechSynthesisParentPolyfill",g);const y=g;var f=i(2221),A=i(2823),b=i(9969),P=i(1005),V=i(3600),v=i(2306),w=i(7959),S=i(4865);window.phet&&phet.chipper&&phet.chipper.queryParameters&&phet.chipper.queryParameters.speechSynthesisFromParent&&y.initialize();const T=["Albert","Bad News","Bahh","Bells","Boing","Bubbles","Cellos","Good News","Jester","Organ","Superstar","Trinoids","Whisper","Wobble","Zarvox","Flo","Grandma","Grandpa","Junior"],E={cancelSelf:!0,cancelOther:!0};class x extends u.Z{constructor(e){const t=(0,d.ZP)()({respectResponseCollectorProperties:!1,debug:!1,tandem:P.Z.OPTIONAL},e);super(t),this.debug=t.debug,this.voiceProperty=new h.Z(null,{tandem:t.tandem.createTandem("voiceProperty"),phetioValueType:(0,v.Z)(I),phetioState:!1}),this.voiceRateProperty=new a.Z(1,{range:new l.Z(.75,2),tandem:t.tandem.createTandem("voiceRateProperty"),phetioState:!1}),this.voicePitchProperty=new a.Z(1,{range:new l.Z(.5,2),tandem:t.tandem.createTandem("voicePitchProperty"),phetioState:!1}),this.voiceVolumeProperty=new a.Z(1,{range:new l.Z(0,1)}),this.hasSpoken=!1,this.timeSinceWakingEngine=0,this.timeSincePauseResume=0,this.timeSincePendingUtterance=0,this.timeSinceUtteranceEnd=125,this.startSpeakingEmitter=new r.Z({parameters:[{valueType:"string"},{valueType:p.Z}]}),this.endSpeakingEmitter=new r.Z({parameters:[{valueType:"string"},{valueType:p.Z}]}),this.enabledComponentImplementation=new o.Z({enabled:!1,tandem:t.tandem,enabledPropertyOptions:{phetioState:!1,phetioFeatured:!1}}),this.enabledProperty=this.enabledComponentImplementation.enabledProperty,this.mainWindowVoicingEnabledProperty=new s.Z(!0,{tandem:t.tandem.createTandem("mainWindowVoicingEnabledProperty"),phetioState:!1}),this.voicingFullyEnabledProperty=n.ZP.and([this.enabledProperty,this.mainWindowVoicingEnabledProperty]),this._speechAllowedAndFullyEnabledProperty=new s.Z(!1),this.speechAllowedAndFullyEnabledProperty=this._speechAllowedAndFullyEnabledProperty,this.synth=null,this.voicesProperty=new h.Z([]),this.speakingSpeechSynthesisUtteranceWrapper=null,this.isInitializedProperty=new s.Z(!1),this.canSpeakProperty=null,this.boundHandleCanSpeakChange=this.handleCanSpeakChange.bind(this),this.boundHandleCanAnnounceChange=this.handleCanAnnounceChange.bind(this),this.debug&&(this.announcementCompleteEmitter.addListener((e,t)=>{console.log("announcement complete",t)}),this.startSpeakingEmitter.addListener(e=>{this.debug&&console.log("startSpeakingListener",e)}),this.endSpeakingEmitter.addListener(e=>{this.debug&&console.log("endSpeakingListener",e)}))}get initialized(){return this.isInitializedProperty.value}initialize(e,t){const i=(0,d.ZP)()({speechAllowedProperty:new s.Z(!0)},t);this.synth=window.speechSynthesis,this.canSpeakProperty=n.ZP.and([i.speechAllowedProperty,this.enabledProperty]),this.canSpeakProperty.link(this.boundHandleCanSpeakChange),b.Z.multilink([i.speechAllowedProperty,this.voicingFullyEnabledProperty],(e,t)=>{this._speechAllowedAndFullyEnabledProperty.value=e&&t}),this.getSynth().onvoiceschanged=()=>{this.populateVoices()},this.populateVoices();const r=()=>{this.timeSinceWakingEngine=5e3,e.removeListener(r)};e.addListener(r),f.Z.addListener(this.step.bind(this)),this.isInitializedProperty.value=!0}step(e){e*=1e3;const t=this.getSynth();this.initialized&&t&&(this.hasSpoken||(this.hasSpoken=t.speaking),this.timeSinceUtteranceEnd=t.speaking?0:this.timeSinceUtteranceEnd+e,this.timeSincePendingUtterance=this.speakingSpeechSynthesisUtteranceWrapper&&!this.speakingSpeechSynthesisUtteranceWrapper.started?this.timeSincePendingUtterance+e:0,this.timeSincePendingUtterance>5e3&&(this.handleSpeechSynthesisEnd(this.speakingSpeechSynthesisUtteranceWrapper.announceText,this.speakingSpeechSynthesisUtteranceWrapper),this.speakingSpeechSynthesisUtteranceWrapper=null,this.cancelSynth()),this.timeSinceUtteranceEnd>125&&!this.speakingSpeechSynthesisUtteranceWrapper&&(this.readyToAnnounce=!0),A.Z.chromium&&!A.Z.android&&this.voiceProperty.value&&!this.voiceProperty.value.localService&&(this.timeSincePauseResume=t.speaking?this.timeSincePauseResume+e:0,this.timeSincePauseResume>1e4&&(this.timeSincePauseResume=0,t.pause(),t.resume())),this.timeSinceWakingEngine+=e,!t.speaking&&this.timeSinceWakingEngine>5e3&&(this.timeSinceWakingEngine=0,t.speak(new SpeechSynthesisUtterance(" "))))}handleCanSpeakChange(e){e||this.cancel()}populateVoices(){const e=this.getSynth();e&&(this.voicesProperty.value=_.uniqBy(e.getVoices(),e=>e.name))}getPrioritizedVoices(){const e=this.voicesProperty.value.slice(),t=_.filter(e,e=>!_.some(T,t=>e.name.includes(t))),i=e=>e.name.includes("Google")?-1:e.name.includes("Fred")?t.length:t.indexOf(e);return t.sort((e,t)=>i(e)-i(t))}getEnglishPrioritizedVoices(){return _.filter(this.getPrioritizedVoices(),e=>"en-US"===e.lang||"en_US"===e.lang)}getPrioritizedVoicesForLocale(e){const t=e,i=e.replace("_","-");return _.filter(this.getPrioritizedVoices(),e=>e.lang.includes(t)||e.lang.includes(i))}announce(e,t){this.initialized&&this.canSpeakProperty&&this.canSpeakProperty.value?this.requestSpeech(e,t):this.handleAnnouncementFailure(t,e)}handleAnnouncementFailure(e,t){this.debug&&console.log("announcement failure",t),this.announcementCompleteEmitter.emit(e,t)}speakIgnoringEnabled(e){this.initialized&&(this.cancel(),this.requestSpeech(e.getAlertText(this.respectResponseCollectorProperties),e))}requestSpeech(e,t){if(this.debug&&console.log("requestSpeech",e),!e)return void this.handleAnnouncementFailure(t,e);const i=(0,c.Z)(e+"").split("
").join(" ").split("
").join(" ");(0,w.Z)(i,S.Z.STRING_WITHOUT_TEMPLATE_VARS_VALIDATOR);const s=new SpeechSynthesisUtterance(i);s.voice=this.voiceProperty.value,s.pitch=this.voicePitchProperty.value,s.rate=this.voiceRateProperty.value,s.volume=this.voiceVolumeProperty.value;const n=()=>{this.startSpeakingEmitter.emit(i,t),this.speakingSpeechSynthesisUtteranceWrapper.started=!0,s.removeEventListener("start",n)},r=()=>{this.handleSpeechSynthesisEnd(i,o)},o=new C(t,e,s,!1,r,n);this.speakingSpeechSynthesisUtteranceWrapper=o,s.addEventListener("start",n),s.addEventListener("end",r),s.addEventListener("error",r),this.readyToAnnounce=!1,this.timeSinceUtteranceEnd=0,t.canAnnounceProperty.link(this.boundHandleCanAnnounceChange),t.voicingCanAnnounceProperty.link(this.boundHandleCanAnnounceChange),this.getSynth().speak(s)}handleCanAnnounceChange(){this.speakingSpeechSynthesisUtteranceWrapper&&this.cancelUtteranceIfCanAnnounceFalse(this.speakingSpeechSynthesisUtteranceWrapper.utterance)}cancelUtteranceIfCanAnnounceFalse(e){e.canAnnounceProperty.value&&e.voicingCanAnnounceProperty.value||this.cancelUtterance(e)}handleSpeechSynthesisEnd(e,t){this.endSpeakingEmitter.emit(e,t.utterance),this.announcementCompleteEmitter.emit(t.utterance,t.speechSynthesisUtterance.text),t.speechSynthesisUtterance.removeEventListener("error",t.endListener),t.speechSynthesisUtterance.removeEventListener("end",t.endListener),t.speechSynthesisUtterance.removeEventListener("start",t.startListener);const i=t.utterance.canAnnounceProperty;i.hasListener(this.boundHandleCanAnnounceChange)&&i.unlink(this.boundHandleCanAnnounceChange);const s=t.utterance.voicingCanAnnounceProperty;s.hasListener(this.boundHandleCanAnnounceChange)&&s.unlink(this.boundHandleCanAnnounceChange),this.speakingSpeechSynthesisUtteranceWrapper=null}getSynth(){return this.synth}cancel(){this.initialized&&this.speakingSpeechSynthesisUtteranceWrapper&&this.cancelUtterance(this.speakingSpeechSynthesisUtteranceWrapper.utterance)}cancelUtterance(e){const t=this.speakingSpeechSynthesisUtteranceWrapper;t&&e===t.utterance&&(this.handleSpeechSynthesisEnd(t.announceText,t),this.cancelSynth())}shouldUtteranceCancelOther(e,t){const i=(0,d.lB)()({},E,e.announcerOptions);let s;return t.priorityProperty.value!==e.priorityProperty.value?s=t.priorityProperty.value!0,toStateObject:e=>e.name});m.Z.register("SpeechSynthesisAnnouncer",x);const D=x},428:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>w});var n=i(4075),r=i(5264),o=i(8292),a=i(1383),h=i(8036),l=i(2550),d=i(3600),c=i(2643),u=i(6103),p=i(6629),m=i(6692),g=i(2306),y=i(8585),f=i(1039),A=i(592),b=i(1731);let P=1;class V extends b.Z{constructor(e){const t=(0,l.ZP)()({alert:null,predicate:function(){return!0},canAnnounceProperties:[],descriptionCanAnnounceProperties:[],voicingCanAnnounceProperties:[],alertStableDelay:200,alertMaximumDelay:Number.MAX_VALUE,announcerOptions:{},priority:1},e);super(t),this.id=P++,this._alert=t.alert,this.predicate=t.predicate,this.canAnnounceProperty=new v({dependentProperties:t.canAnnounceProperties}),this.descriptionCanAnnounceProperty=new v({dependentProperties:t.descriptionCanAnnounceProperties}),this.voicingCanAnnounceProperty=new v({dependentProperties:t.voicingCanAnnounceProperties}),this.alertStableDelay=t.alertStableDelay,this.alertMaximumDelay=t.alertMaximumDelay,this.announcerOptions=t.announcerOptions,this.priorityProperty=new h.Z(t.priority),this.previousAlertText=null}static getAlertStringFromResponsePacket(e,t){const i=e.serialize();return t||(i.ignoreProperties=!0),u.Z.collectResponses(i)}getAlertText(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=V.alertableToText(this._alert,e);return this.previousAlertText=t,t}getAlert(){return this._alert}get alert(){return this.getAlert()}set alert(e){this.setAlert(e)}setAlert(e){this._alert=e}setAlertStableDelay(e){this.alertStableDelay=e}toString(){return`Utterance_${this.id}#${this.getAlertText()}`}toStateObject(){return{alert:(0,g.Z)((0,f.Z)([c.Z,y.Z])).toStateObject(this.getAlertText())}}reset(){this.previousAlertText=null}setCanAnnounceProperties(e){this.canAnnounceProperty.setDependentProperties(e)}set canAnnounceProperties(e){this.setCanAnnounceProperties(e)}get canAnnounceProperties(){return this.getCanAnnounceProperties()}getCanAnnounceProperties(){return this.canAnnounceProperty.getDependentProperties()}setDescriptionCanAnnounceProperties(e){this.descriptionCanAnnounceProperty.setDependentProperties(e)}set descriptionCanAnnounceProperties(e){this.setDescriptionCanAnnounceProperties(e)}get descriptionCanAnnounceProperties(){return this.getDescriptionCanAnnounceProperties()}getDescriptionCanAnnounceProperties(){return this.descriptionCanAnnounceProperty.getDependentProperties()}setVoicingCanAnnounceProperties(e){this.voicingCanAnnounceProperty.setDependentProperties(e)}set voicingCanAnnounceProperties(e){this.setVoicingCanAnnounceProperties(e)}get voicingCanAnnounceProperties(){return this.getVoicingCanAnnounceProperties()}getVoicingCanAnnounceProperties(){return this.voicingCanAnnounceProperty.getDependentProperties()}dispose(){this.canAnnounceProperty.dispose(),this.descriptionCanAnnounceProperty.dispose(),this.voicingCanAnnounceProperty.dispose(),this.priorityProperty.dispose(),super.dispose()}static alertableToText(e){let t,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("function"==typeof e)t=e();else if(e instanceof p.Z)t=V.getAlertStringFromResponsePacket(e,i);else{if(e instanceof V)return e.getAlertText(i);t=e instanceof r.Z||e instanceof o.Z?e.value:e}return t}}s=V,_defineProperty(V,"TOP_PRIORITY",10),_defineProperty(V,"HIGH_PRIORITY",5),_defineProperty(V,"MEDIUM_PRIORITY",2),_defineProperty(V,"DEFAULT_PRIORITY",1),_defineProperty(V,"LOW_PRIORITY",0),_defineProperty(V,"UtteranceIO",new d.Z("UtteranceIO",{valueType:s,documentation:"Announces text to a specific browser technology (like aria-live or web speech)",toStateObject:e=>e.toStateObject(),stateSchema:{alert:(0,g.Z)((0,f.Z)([c.Z,y.Z]))}}));class v extends a.Z{constructor(e){const t=(0,l.ZP)()({dependentProperties:[]},e),i=new A.Z(new o.Z(!1));super(i),this._dependentProperties=[],this.implementationProperty=i,this.setDependentProperties(t.dependentProperties)}setDependentProperties(e){this.implementationProperty.value&&this.implementationProperty.value.dispose();const t=0===e.length?[new o.Z(!0)]:e;this.implementationProperty.value=n.ZP.and(t),this._dependentProperties=e}set dependentProperties(e){this.setDependentProperties(e)}get dependentProperties(){return this.getDependentProperties()}getDependentProperties(){return this._dependentProperties.slice(0)}dispose(){this.implementationProperty.dispose(),this._dependentProperties=[],super.dispose()}}m.Z.register("Utterance",V);const w=V},6103:(e,t,i)=>{"use strict";i.d(t,{Z:()=>p});var s=i(9806),n=i(6114),r=i(6692),o=i(6629),a=i(6975),h=i(2550),l=i(1005),d=i(1617);class c extends d.Z{constructor(e){super(),this.nameResponsesEnabledProperty=new s.Z(!0,{tandem:e.tandem.createTandem("nameResponsesEnabledProperty"),phetioState:!1}),this.objectResponsesEnabledProperty=new s.Z(!1,{tandem:e.tandem.createTandem("objectResponsesEnabledProperty"),phetioState:!1}),this.contextResponsesEnabledProperty=new s.Z(!1,{tandem:e.tandem.createTandem("contextResponsesEnabledProperty"),phetioState:!1}),this.hintResponsesEnabledProperty=new s.Z(!1,{tandem:e.tandem.createTandem("hintResponsesEnabledProperty"),phetioState:!1})}reset(){this.nameResponsesEnabledProperty.reset(),this.objectResponsesEnabledProperty.reset(),this.contextResponsesEnabledProperty.reset(),this.hintResponsesEnabledProperty.reset()}collectResponses(e){const t=(0,h.lB)()({},o.Z.DEFAULT_OPTIONS,e),i=!(!t.nameResponse||!this.nameResponsesEnabledProperty.get()&&!t.ignoreProperties),s=!(!t.objectResponse||!this.objectResponsesEnabledProperty.get()&&!t.ignoreProperties),r=!(!t.contextResponse||!this.contextResponsesEnabledProperty.get()&&!t.ignoreProperties),l=!(!t.hintResponse||!this.hintResponsesEnabledProperty.get()&&!t.ignoreProperties),d=a.Z.createPatternKey(i,s,r,l);let c="";if(d){const e=t.responsePatternCollection.getResponsePattern(d);c=n.Z.fillIn(e,{NAME:t.nameResponse,OBJECT:t.objectResponse,CONTEXT:t.contextResponse,HINT:t.hintResponse})}return c}}const u=new c({tandem:l.Z.GENERAL_MODEL.createTandem("responseCollector"),phetioState:!1,phetioDocumentation:'A collection of Properties that determine what level of responses to provide through the "voicing" feature.'});r.Z.register("responseCollector",u);const p=u},6692:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s=new(i(2492).Z)("utteranceQueue")}},t={};function i(s){var n=t[s];if(void 0!==n)return n.exports;var r=t[s]={id:s,loaded:!1,exports:{}};return e[s](r,r.exports,i),r.loaded=!0,r.exports}i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},((e,t,s,n,r,o,a,h,l,d,c,u,p,m,g,y,f,A,b,P,V)=>{"use strict";var v=i(3180),w=i(6103),S=i(9806),T=i(9362);let E=null;class x{constructor(){_defineProperty(this,"enabled",!0),_defineProperty(this,"registedProperties",[]);try{window.localStorage.setItem("test","test")}catch(e){if(this.enabled=!1,e instanceof Error){if(!(window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"))||!e.message.includes("QuotaExceededError"))throw e;console.log("It looks like you are browsing with private mode in Safari. Please turn that setting off if you want to use PreferencesStorage")}}}registerToLocalStorage(e,t){const i="PREFERENCES:"+t;window.localStorage.getItem(i)&&(e.value=JSON.parse(window.localStorage.getItem(i))),e.link(e=>{window.localStorage.setItem(i,JSON.stringify(e))}),this.registedProperties.push(e)}static register(e,t){return phet.chipper.queryParameters.preferencesStorage?(E||(E=new x),E.enabled&&E.registerToLocalStorage(e,t),e):e}}T.Z.register("PreferencesStorage",x);const C=x;var I=i(8964),D=i(1617),L=i(1005),k=i(2530);const M=(e,t)=>{const i=t.replace(new RegExp("^.*,"),""),s=atob(i),n=new Uint8Array(s.length);for(let r=0;r{W||(Y(),W=!0)},X=F.decodeAudioData(z.buffer,e=>{null===G.audioBufferProperty.value&&(G.audioBufferProperty.set(e),U())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),G.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),U()});X&&X.then(e=>{null===G.audioBufferProperty.value&&(G.audioBufferProperty.set(e),U())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),U()});const K=G,j=[],Q=[],J={addStateChangeListener(e,t){let i,s=j.indexOf(e);-1===s?(j.push(e),s=j.length-1,i=[],Q.push(i),e.onstatechange=()=>{_.clone(i).forEach(t=>{t(e.state)})}):i=Q[s],i.push(t)},removeStateChangeListener(e,t){const i=j.indexOf(e),s=Q[i],n=s.indexOf(t);s.splice(n,1)},hasListener(e,t){let i=!1;const s=j.indexOf(e);if(s>=0){const e=Q[s];e&&(i=e.includes(t))}return i}};R.register("audioContextStateChangeMonitor",J);const ee=J,te={DEFAULT_PARAM_CHANGE_TIME_CONSTANT:.015,DEFAULT_LINEAR_GAIN_CHANGE_TIME:.1,TWELFTH_ROOT_OF_TWO:Math.pow(2,1/12)};R.register("soundConstants",te);const ie=te;var se=i(2956),ne=i(4676);class re extends ne.Z{}_defineProperty(re,"BASIC",new(e=re)),_defineProperty(re,"EXTRA",new e),_defineProperty(re,"enumeration",new se.Z(e,{phetioDocumentation:"describes whether a sound is considered part of the basic or the extra sounds for the sim"})),R.register("SoundScope",re);const oe=re;var ae=i(2550),he=i(9969),le=i(9059),de=i(1453);const ce=ie.DEFAULT_LINEAR_GAIN_CHANGE_TIME;class ue extends D.Z{constructor(e){super({tandem:e,phetioState:!1,phetioDocumentation:"Controls the simulation's sound. For sims that do not support sound, this element and its children can be ignored."}),this.enabledProperty=new S.Z(phet.chipper.queryParameters.supportsSound,{tandem:e.createTandem("enabledProperty"),phetioState:!1,phetioDocumentation:"Determines whether sound is enabled."}),this.extraSoundEnabledProperty=new S.Z(phet.chipper.queryParameters.extraSoundInitiallyEnabled,{tandem:e.createTandem("extraSoundEnabledProperty"),phetioState:!1,phetioDocumentation:"Determines whether extra sound is enabled. Extra sound is additional sounds that can serve to improve the learning experience for individuals with visual disabilities. Note that not all simulations that support sound also support extra sound. Also note that the value is irrelevant when enabledProperty is false."}),this.soundGeneratorInfoArray=[],this._masterOutputLevel=1,this._reverbLevel=.02,this.gainNodesForCategories=new Map,this.duckingProperties=(0,de.Z)(),this.initialized=!1,this.soundGeneratorsAwaitingAdd=[],this.masterGainNode=null,this.duckingGainNode=null,this.convolver=null,this.reverbGainNode=null,this.dryGainNode=null}initialize(e,t,i,s,n,r){const o=(0,ae.ZP)()({categories:["sim-specific","user-interface"]},r),a=F.currentTime,h=F.createDynamicsCompressor();h.threshold.setValueAtTime(-6,a),h.knee.setValueAtTime(5,a),h.ratio.setValueAtTime(12,a),h.attack.setValueAtTime(0,a),h.release.setValueAtTime(.25,a),h.connect(F.destination),this.duckingGainNode=F.createGain(),this.duckingGainNode.connect(h),this.masterGainNode=F.createGain(),this.masterGainNode.connect(this.duckingGainNode),this.convolver=F.createConvolver();const l=e=>{e&&(this.convolver.buffer=e,K.audioBufferProperty.unlink(l))};K.audioBufferProperty.link(l),this.reverbGainNode=F.createGain(),this.reverbGainNode.connect(this.masterGainNode),this.reverbGainNode.gain.setValueAtTime(this._reverbLevel,F.currentTime),this.convolver.connect(this.reverbGainNode),this.dryGainNode=F.createGain(),this.dryGainNode.gain.setValueAtTime(1-this._reverbLevel,F.currentTime),this.dryGainNode.gain.linearRampToValueAtTime(1-this._reverbLevel,F.currentTime+ce),this.dryGainNode.connect(this.masterGainNode),o.categories.forEach(e=>{const t=F.createGain();t.connect(this.convolver),t.connect(this.dryGainNode),this.gainNodesForCategories.set(e,t)}),he.Z.multilink([this.enabledProperty,t,e,i,s,n],(e,t,i,s,n,r)=>{const o=e&&t&&i&&s&&n&&!r?this._masterOutputLevel:0;this.masterGainNode.gain.linearRampToValueAtTime(o,F.currentTime+ce)});const d=new S.Z(!1),c=()=>{d.value=this.duckingProperties.reduce((e,t)=>e||t.value,!1)};d.lazyLink(e=>{var t,i;const s=e?.05:.5,n=F.currentTime;null===(t=this.duckingGainNode)||void 0===t||t.gain.cancelScheduledValues(n),null===(i=this.duckingGainNode)||void 0===i||i.gain.setTargetAtTime(e?.15:1,n,s)}),this.duckingProperties.addItemAddedListener(e=>{e.link(c);const t=i=>{i===e&&(i.unlink(c),this.duckingProperties.removeItemRemovedListener(t))};this.duckingProperties.addItemRemovedListener(t)});const u=()=>{window.removeEventListener("touchstart",p,!1),v.sSl.userGestureEmitter.hasListener(p)&&v.sSl.userGestureEmitter.removeListener(p)},p=()=>{"running"!==F.state?(phet.log&&phet.log("audio context not running, attempting to resume, state = "+F.state),F.resume().then(()=>{phet.log&&phet.log("resume appears to have succeeded, phetAudioContext.state = "+F.state),u()}).catch(e=>{const t="error when trying to resume audio context, err = "+e;console.error(t)})):u()};window.addEventListener("touchstart",p,!1),v.sSl.userGestureEmitter.addListener(p);let m=F.state;ee.addStateChangeListener(F,e=>{phet.log&&phet.log(`audio context state changed, old state = ${m}, new state = ${e}, audio context time = ${F.currentTime}`),"running"!==e?(window.addEventListener("touchstart",p,!1),v.sSl.userGestureEmitter.hasListener(p)||v.sSl.userGestureEmitter.addListener(p)):console.log("AudioContext is now running."),m=e}),this.initialized=!0,this.soundGeneratorsAwaitingAdd.forEach(e=>{this.addSoundGenerator(e.soundGenerator,e.soundGeneratorAddOptions)}),this.soundGeneratorsAwaitingAdd.length=0}hasSoundGenerator(e){return _.some(this.soundGeneratorInfoArray,t=>t.soundGenerator===e)}addSoundGenerator(e,t){if(void 0===t&&(t={}),!this.initialized)return void this.soundGeneratorsAwaitingAdd.push({soundGenerator:e,soundGeneratorAddOptions:t});this.hasSoundGenerator(e);const i=(0,ae.ZP)()({sonificationLevel:oe.BASIC,associatedViewNode:null,categoryName:null},t);null===i.categoryName?(e.connect(this.convolver),e.connect(this.dryGainNode)):e.connect(this.gainNodesForCategories.get(i.categoryName));const s={soundGenerator:e,sonificationLevel:i.sonificationLevel};this.soundGeneratorInfoArray.push(s),e.addEnableControlProperty(this.enabledProperty),i.sonificationLevel===oe.EXTRA&&e.addEnableControlProperty(this.extraSoundEnabledProperty),i.associatedViewNode&&e.addEnableControlProperty(new v.ljG(i.associatedViewNode))}removeSoundGenerator(e){if(!this.initialized){const t=this.soundGeneratorsAwaitingAdd.filter(t=>t.soundGenerator===e);for(;t.length>0;)(0,le.Z)(this.soundGeneratorsAwaitingAdd,t[0]),t.shift();return void console.warn("an attempt was made to remove a sound generator from an uninitialized sound manager, ignoring")}let t=null;for(let i=0;i{e.isConnectedTo(t)&&e.disconnect(t)}),t&&this.soundGeneratorInfoArray.splice(this.soundGeneratorInfoArray.indexOf(t),1)}setMasterOutputLevel(e){this.initialized?(this._masterOutputLevel=e,this.enabledProperty.value&&this.masterGainNode.gain.linearRampToValueAtTime(e,F.currentTime+ce)):console.warn("an attempt was made to set the master output level on an uninitialized sound manager, ignoring")}set masterOutputLevel(e){this.setMasterOutputLevel(e)}get masterOutputLevel(){return this.getMasterOutputLevel()}getMasterOutputLevel(){return this._masterOutputLevel}setOutputLevelForCategory(e,t){if(!this.initialized)return void console.warn("an attempt was made to set the output level for a sound category on an uninitialized sound manager, ignoring");const i=this.gainNodesForCategories.get(e);i&&i.gain.setValueAtTime(t,F.currentTime)}addDuckingProperty(e){this.duckingProperties.add(e)}removeDuckingProperty(e){this.duckingProperties.remove(e)}getOutputLevelForCategory(e){if(!this.initialized)return console.warn("an attempt was made to get the output level for a sound category on an uninitialized sound manager, returning 0"),0;const t=this.gainNodesForCategories.get(e);return t.gain.value}setReverbLevel(e){if(this.initialized){if(e!==this._reverbLevel){const t=F.currentTime;this.reverbGainNode.gain.linearRampToValueAtTime(e,t+ce),this.dryGainNode.gain.linearRampToValueAtTime(1-e,t+ce),this._reverbLevel=e}}else console.warn("an attempt was made to set the reverb level on an uninitialized sound manager, ignoring")}set reverbLevel(e){this.setReverbLevel(e)}get reverbLevel(){return this.getReverbLevel()}getReverbLevel(){return this._reverbLevel}set enabled(e){this.enabledProperty.value=e}get enabled(){return this.enabledProperty.value}set sonificationLevel(e){this.extraSoundEnabledProperty.value=e===oe.EXTRA}get sonificationLevel(){return this.extraSoundEnabledProperty.value?oe.EXTRA:oe.BASIC}logGain(e,t){t=t||1;Date.now()}logMasterGain(e){this.masterGainNode&&this.logGain(this.masterGainNode,e)}logReverbGain(e){this.reverbGainNode&&this.logGain(this.reverbGainNode,e)}}const pe=new ue(L.Z.GENERAL_VIEW.createTandem("soundManager"));R.register("soundManager",pe);const me=pe;var ge=i(4075);class ye extends D.Z{constructor(e){super({tandem:e,phetioState:!1,phetioDocumentation:"Controls the simulation's audio features. This includes sound and voicing. For sims that do not support these features, this element and its children can be ignored."}),this.audioEnabledProperty=new S.Z("enabled"===phet.chipper.queryParameters.audio,{tandem:e.createTandem("audioEnabledProperty"),phetioFeatured:!0,phetioDocumentation:"determines whether audio features are enabled for this simulation"}),this.audioAndSoundEnabledProperty=ge.ZP.and([this.audioEnabledProperty,me.enabledProperty]),this.audioAndVoicingEnabledProperty=ge.ZP.and([this.audioEnabledProperty,v.LY3.enabledProperty]),this.anySubcomponentEnabledProperty=new ge.ZP([me.enabledProperty,v.LY3.enabledProperty],(e,t)=>e||t),this.anyOutputEnabledProperty=new ge.ZP([this.audioEnabledProperty,this.anySubcomponentEnabledProperty],(e,t)=>e&&t)}initialize(e){if(e.preferencesModel.audioModel.supportsSound&&me.initialize(e.isConstructionCompleteProperty,this.audioEnabledProperty,e.browserTabVisibleProperty,e.activeProperty,e.isSettingPhetioStateProperty),e.preferencesModel.audioModel.supportsVoicing&&v.LY3.initialize(v.sSl.userGestureEmitter,{speechAllowedProperty:new ge.ZP([e.isConstructionCompleteProperty,e.browserTabVisibleProperty,e.activeProperty,e.isSettingPhetioStateProperty,this.audioEnabledProperty],(e,t,i,s,n)=>e&&t&&i&&!s&&n)}),e.preferencesModel.audioModel.supportsSound&&e.preferencesModel.audioModel.supportsVoicing){const e=new S.Z(!1);v.LY3.startSpeakingEmitter.addListener(()=>e.set(!0)),v.LY3.endSpeakingEmitter.addListener(()=>e.set(!1)),me.addDuckingProperty(e)}}}const fe=new ye(L.Z.GENERAL_VIEW.createTandem("audioManager"));T.Z.register("audioManager",fe);const Ae=fe;var be=i(592);const Pe=new class{constructor(){this.regionAndCultureProperty=new be.Z(null)}};T.Z.register("regionAndCultureManager",Pe);const Ve=Pe;var ve=i(621),we=i(8588),Se=i(831),Te=i(3600),Ee=i(5602);class _e extends D.Z{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=phet.chipper.queryParameters,i={...(0,ae.ZP)()({tandem:L.Z.GENERAL_MODEL.createTandem("preferencesModel"),phetioType:_e.PreferencesModelIO,phetioFeatured:!0,phetioState:!1,phetioReadOnly:!0},e),simulationOptions:(0,ae.ZP)()({tandemName:"simulationModel",customPreferences:[]},e.simulationOptions),visualOptions:(0,ae.ZP)()({tandemName:"visualModel",supportsProjectorMode:!1,supportsInteractiveHighlights:t.supportsInteractiveHighlights,customPreferences:[]},e.visualOptions),audioOptions:(0,ae.ZP)()({tandemName:"audioModel",supportsVoicing:t.supportsVoicing,supportsSound:t.supportsSound,supportsExtraSound:t.supportsExtraSound,customPreferences:[]},e.audioOptions),inputOptions:(0,ae.ZP)()({tandemName:"inputModel",supportsGestureControl:t.supportsGestureControl,customPreferences:[]},e.inputOptions),localizationOptions:(0,ae.ZP)()({tandemName:"localizationModel",supportsDynamicLocales:!!we.Z.validValues&&we.Z.validValues.length>1&&phet.chipper.allowLocaleSwitching,characterSets:[],customPreferences:[],includeLocalePanel:!0},e.localizationOptions)};super(i),this.simulationModel=i.simulationOptions;const s=i.tandem.createTandem("visualModel");this.visualModel=(0,Se.Z)({interactiveHighlightsEnabledProperty:new S.Z(phet.chipper.queryParameters.interactiveHighlightsInitiallyEnabled,{tandem:s.createTandem("interactiveHighlightsEnabledProperty"),phetioState:!1}),colorProfileProperty:v.CEW},i.visualOptions);const n=i.audioOptions.supportsVoicing&&ve.Z.isSpeechSynthesisSupported()&&(phet.chipper.locale.startsWith("en")||phet.chipper.allowLocaleSwitching&&_.some(we.Z.validValues,e=>e.startsWith("en"))),r="disabled"!==phet.chipper.queryParameters.audio;this.audioModel={supportsVoicing:n&&r,supportsSound:i.audioOptions.supportsSound&&r,supportsExtraSound:i.audioOptions.supportsExtraSound&&r,audioEnabledProperty:Ae.audioEnabledProperty,soundEnabledProperty:me.enabledProperty,extraSoundEnabledProperty:me.extraSoundEnabledProperty,voicingEnabledProperty:v.LY3.enabledProperty,voicingMainWindowVoicingEnabledProperty:v.LY3.mainWindowVoicingEnabledProperty,voicingObjectResponsesEnabledProperty:w.Z.objectResponsesEnabledProperty,voicingContextResponsesEnabledProperty:w.Z.contextResponsesEnabledProperty,voicingHintResponsesEnabledProperty:w.Z.hintResponsesEnabledProperty,voicePitchProperty:v.LY3.voicePitchProperty,voiceRateProperty:v.LY3.voiceRateProperty,voiceProperty:v.LY3.voiceProperty,toolbarEnabledProperty:new S.Z(!0,{tandem:i.tandem.createTandem("audioModel").createTandem("toolbarEnabledProperty"),phetioState:!1}),customPreferences:i.audioOptions.customPreferences,tandemName:i.audioOptions.tandemName};const o=i.tandem.createTandem("inputModel");if(this.inputModel=(0,Se.Z)({gestureControlsEnabledProperty:new S.Z(!1,{tandem:o.createTandem("gestureControlsEnabledProperty"),phetioState:!1})},i.inputOptions),this.localizationModel=(0,Se.Z)({localeProperty:we.Z,regionAndCultureProperty:Ve.regionAndCultureProperty},i.localizationOptions),i.localizationOptions.characterSets.length>0&&(Ve.regionAndCultureProperty.value=i.localizationOptions.characterSets[0],this.localizationModel.regionAndCultureProperty=Ve.regionAndCultureProperty),this.audioModel.supportsExtraSound,this.addPhetioLinkedElementsForModel(i.tandem,this.simulationModel),this.addPhetioLinkedElementsForModel(i.tandem,this.visualModel,[{property:this.visualModel.colorProfileProperty}]),this.addPhetioLinkedElementsForModel(i.tandem,this.audioModel,[{property:this.audioModel.audioEnabledProperty,tandemName:"audioEnabledProperty"},{property:this.audioModel.soundEnabledProperty,tandemName:"soundEnabledProperty"},{property:this.audioModel.extraSoundEnabledProperty,tandemName:"extraSoundEnabledProperty"},{property:this.audioModel.voicingEnabledProperty,tandemName:"voicingEnabledProperty"},{property:this.audioModel.voicingMainWindowVoicingEnabledProperty,tandemName:"voicingMainWindowVoicingEnabledProperty"},{property:this.audioModel.voicingObjectResponsesEnabledProperty,tandemName:"voicingObjectResponsesEnabledProperty"},{property:this.audioModel.voicingContextResponsesEnabledProperty,tandemName:"voicingContextResponsesEnabledProperty"},{property:this.audioModel.voicingHintResponsesEnabledProperty,tandemName:"voicingHintResponsesEnabledProperty"},{property:this.audioModel.voicePitchProperty,tandemName:"voicePitchProperty"},{property:this.audioModel.voiceRateProperty,tandemName:"voiceRateProperty"},{property:this.audioModel.voiceProperty,tandemName:"voiceProperty"}]),this.addPhetioLinkedElementsForModel(i.tandem,this.inputModel),this.addPhetioLinkedElementsForModel(i.tandem,this.localizationModel,[{property:this.localizationModel.localeProperty,tandemName:"localeProperty"}]),n){v.LY3.enabledProperty.value=phet.chipper.queryParameters.voicingInitiallyEnabled;let e=!1;we.Z.link(t=>{const i=t.startsWith("en");v.LY3.enabledProperty.value?(v.LY3.enabledProperty.value=i,e=!0):e&&i&&(v.LY3.enabledProperty.value=!0,e=!1)}),v.LY3.enabledProperty.link(e=>{v.KsW.enabled=e,!e&&v.KsW.clear()}),phet.chipper.queryParameters.voicingInitiallyEnabled&&(w.Z.objectResponsesEnabledProperty.value=!0,w.Z.contextResponsesEnabledProperty.value=!0,w.Z.hintResponsesEnabledProperty.value=!0,v.LY3.voicesProperty.link(e=>{e.length>0&&(v.LY3.voiceProperty.value=v.LY3.getEnglishPrioritizedVoices()[0])}))}phet.chipper.queryParameters.printVoicingResponses&&v.LY3.startSpeakingEmitter.addListener(e=>console.log(e)),this.registerPreferencesStorage()}registerPreferencesStorage(){this.visualModel.supportsInteractiveHighlights&&C.register(this.visualModel.interactiveHighlightsEnabledProperty,"interactiveHighlightsEnabledProperty"),this.audioModel.supportsVoicing&&(C.register(this.audioModel.voicingObjectResponsesEnabledProperty,"objectResponsesEnabledProperty"),C.register(this.audioModel.voicingContextResponsesEnabledProperty,"contextResponsesEnabledProperty"),C.register(this.audioModel.voicingHintResponsesEnabledProperty,"hintResponsesEnabledProperty"),C.register(this.audioModel.voiceRateProperty,"voiceRateProperty"),C.register(this.audioModel.voicePitchProperty,"voicePitchProperty")),this.audioModel.supportsExtraSound&&C.register(this.audioModel.extraSoundEnabledProperty,"extraSoundEnabledProperty"),this.inputModel.supportsGestureControl&&C.register(this.inputModel.gestureControlsEnabledProperty,"gestureControlsEnabledProperty")}addPhetioLinkedElementsForModel(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const s=e.createTandem(t.tandemName),n=i;for(let r=0;r0}supportsSimulationPreferences(){return this.preferenceModelHasCustom(this.simulationModel)}supportsVisualPreferences(){return this.visualModel.supportsInteractiveHighlights||this.visualModel.supportsProjectorMode||this.preferenceModelHasCustom(this.visualModel)}supportsAudioPreferences(){return this.audioModel.supportsSound||this.audioModel.supportsExtraSound||this.audioModel.supportsVoicing||this.preferenceModelHasCustom(this.audioModel)}supportsInputPreferences(){return this.inputModel.supportsGestureControl||this.preferenceModelHasCustom(this.inputModel)}supportsLocalizationPreferences(){return this.localizationModel.supportsDynamicLocales||this.localizationModel.characterSets.length>0||this.preferenceModelHasCustom(this.localizationModel)}shouldShowDialog(){return this.supportsSimulationPreferences()||this.supportsVisualPreferences()||this.supportsInputPreferences()||this.supportsLocalizationPreferences()||this.supportsAudioPreferences()}}t=_e,_defineProperty(_e,"PreferencesModelIO",new Te.Z("PreferencesModelIO",{valueType:t,toStateObject:e=>({supportsProjectorMode:e.visualModel.supportsProjectorMode,supportsInteractiveHighlights:e.visualModel.supportsInteractiveHighlights,supportsVoicing:e.audioModel.supportsVoicing,supportsSound:e.audioModel.supportsSound,supportsExtraSound:e.audioModel.supportsExtraSound,supportsGestureControl:e.inputModel.supportsGestureControl,supportsDynamicLocales:e.localizationModel.supportsDynamicLocales,supportsAudioPreferences:e.supportsAudioPreferences(),supportsInputPreferences:e.supportsInputPreferences(),supportsLocalizationPreferences:e.supportsLocalizationPreferences(),supportsSimulationPreferences:e.supportsSimulationPreferences(),supportsVisualPreferences:e.supportsVisualPreferences()}),stateSchema:{supportsProjectorMode:Ee.Z,supportsInteractiveHighlights:Ee.Z,supportsVoicing:Ee.Z,supportsSound:Ee.Z,supportsExtraSound:Ee.Z,supportsGestureControl:Ee.Z,supportsDynamicLocales:Ee.Z,supportsAudioPreferences:Ee.Z,supportsInputPreferences:Ee.Z,supportsLocalizationPreferences:Ee.Z,supportsSimulationPreferences:Ee.Z,supportsVisualPreferences:Ee.Z}})),T.Z.register("PreferencesModel",_e);var xe=i(732),Ce=i(3061),Ie=i(8036),De=i(2221),Le=i(1603),ke=i(6243),Me=(i(7023),i(2823)),Oe=i(6114),Ne=i(2976),Re=i(6918);const Be=new N.Z("sceneryPhet");class Ze extends v.JOQ{constructor(e,t){const i=(0,ae.ZP)()({fill:"rgba( 0, 0, 0, 0.3 )",pickable:!0,phetioReadOnly:!0,phetioEventType:Ne.Z.USER,visiblePropertyOptions:{phetioState:!1}},t);super(i);const s=e=>{this.visible=e>0};e.lengthProperty.link(s),this.addInputListener(new v.eMb({tandem:i.tandem.createTandem("inputListener"),phetioReadOnly:i.phetioReadOnly,fire(){(!phet.chipper.isFuzzEnabled()||Re.Z.nextDouble()<.005)&&e.get(e.length-1).hide()}})),this.disposeBarrierRectangle=()=>{e.lengthProperty.hasListener(s)&&e.lengthProperty.unlink(s)}}dispose(){this.disposeBarrierRectangle(),super.dispose()}}Be.register("BarrierRectangle",Ze);i(535);var qe=i(5281),Fe=i(8585);let He=!1,ze=!0;const Ye={start:function(e){He=!0;const t=document.createElement("div");t.style.opacity="0",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.width="0",t.style.height="0",t.style.clip="rect(0,0,0,0)",t.setAttribute("aria-hidden","true"),e.display.domElement.appendChild(t),e.frameStartedEmitter.addListener(()=>{e.frameCounter%1e3==0&&(ze=!ze,t.innerHTML=""+ze)})}};T.Z.register("Heartbeat",Ye);const Ge=Ye;var We=i(7922),Ue=i(1383);class Xe extends Ue.Z{constructor(e,t){super(new O.Z(e),t)}}We.Z.register("MappedProperty",Xe);var Ke=i(668),je=i(2560),Qe=i(6572),Je=i(8378);const $e={};class et{static registerDataURL(e,t,i){if(phet.chipper.queryParameters.binder){const n=`${e}/${t}`;$e[n]=$e[n]||[];try{i.toDataURL(e=>{$e[n].push(e)})}catch(s){}}}}et.map=$e,Je.Z.register("InstanceRegistry",et);var tt=i(369),it=i(2643);const st=new Image,nt=k.Z.createLock(st);st.onload=nt,st.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAYAAAA6oTAqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYm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95aVcwJubXwu64cLf5EJecaGfaNDYu3SHjB3Js/PiIRVKKO/uSIDwAJDTJocBlDFPsiJKfDwyJ91qDU5fGd8zo5S2uCRQK6EaTZG5c6eRih/h00gMAo5ycVLYef0B6UOgHB7HjrkubrG52UH+BD1ZPlp/Ex6xUc9TU/l8wSgmIA9bEBHrIRXawu8w5z5Mq7WPTY6UKpvXAmFlhPZrFMfLrQ5N+X9xoCKyegR7AGNBPEP0zP/ifAAMAmVerrtl2FKkAAAAASUVORK5CYII=";const rt=st,ot=QueryStringMachine.getAll({backgroundColor:{type:"string",defaultValue:"white"},slider:{type:"string",defaultValue:null},component:{type:"string",defaultValue:null},fontFamily:{type:"string",defaultValue:"Arial"}});Be.register("sceneryPhetQueryParameters",ot);const at=ot;class ht extends v.Zxw{constructor(e){let t;t="number"==typeof e||"string"==typeof e?{size:e}:e||{},t=(0,ae.JA)({family:at.fontFamily},t),t.family=t.family+", sans-serif",super(t)}}Be.register("PhetFont",ht);var lt=i(2797);const dt=(0,lt.Z)("SCENERY_PHET");Be.register("SceneryPhetStrings",dt);const ct=dt;class ut extends v.NBX{constructor(e,t){const i=(0,ae.ZP)()({basePositionProperty:new je.Z(new Ke.Z(0,0)),tipPositionProperty:new je.Z(new Ke.Z(1,0)),hasValue:!0,dragBounds:Le.Z.EVERYTHING,textPosition:new Ke.Z(0,30),modelViewTransform:tt.Z.createIdentity(),significantFigures:1,textColor:"white",textBackgroundColor:null,textBackgroundXMargin:4,textBackgroundYMargin:2,textBackgroundCornerRadius:2,textMaxWidth:200,textFont:new ht({size:16,weight:"bold"}),baseScale:.8,lineColor:"gray",tapeLineWidth:2,tipCircleColor:"rgba(0,0,0,0.1)",tipCircleRadius:10,crosshairColor:"rgb(224, 95, 32)",crosshairSize:5,crosshairLineWidth:2,isBaseCrosshairRotating:!0,isTipCrosshairRotating:!0,isTipDragBounded:!0,interactive:!0,baseDragStarted:_.noop,baseDragEnded:_.noop,tandem:L.Z.OPTIONAL},t);super(),this.unitsProperty=e,this.significantFigures=i.significantFigures,this.dragBounds=i.dragBounds,this.modelViewTransformProperty=new be.Z(i.modelViewTransform),this.isTipDragBounded=i.isTipDragBounded,this.basePositionProperty=i.basePositionProperty,this.tipPositionProperty=i.tipPositionProperty,this._isTipUserControlledProperty=new be.Z(!1),this.isTipUserControlledProperty=this._isTipUserControlledProperty,this._isBaseUserControlledProperty=new be.Z(!1),this.isBaseUserControlledProperty=this._isBaseUserControlledProperty,this.measuredDistanceProperty=new ge.ZP([this.basePositionProperty,this.tipPositionProperty],(e,t)=>e.distance(t),{tandem:i.tandem.createTandem("measuredDistanceProperty"),phetioDocumentation:"The distance measured by the measuring tape",phetioValueType:Fe.Z,units:this.basePositionProperty.units});const s=(new Qe.bn).moveTo(-i.crosshairSize,0).moveTo(-i.crosshairSize,0).lineTo(i.crosshairSize,0).moveTo(0,-i.crosshairSize).lineTo(0,i.crosshairSize),n=new v.y$t(s,{stroke:i.crosshairColor,lineWidth:i.crosshairLineWidth}),r=new v.y$t(s,{stroke:i.crosshairColor,lineWidth:i.crosshairLineWidth}),o=new v.Cdc(i.tipCircleRadius,{fill:i.tipCircleColor}),a=new v.e8H({interactiveHighlightEnabled:!1});this.baseImage=new v.Eep(rt,{scale:i.baseScale,cursor:"pointer"}),a.addChild(this.baseImage);const h=new v.x12(this.basePositionProperty.value,this.tipPositionProperty.value,{stroke:i.lineColor,lineWidth:i.tapeLineWidth}),l=new v.e8H({children:[o,r],cursor:"pointer",interactiveHighlightEnabled:!1}),d=new ge.ZP([this.unitsProperty,this.measuredDistanceProperty,ct.measuringTapeReadoutPatternStringProperty],(e,t,i)=>{const s=I.Z.toFixed(e.multiplier*t,this.significantFigures);return Oe.Z.fillIn(i,{distance:s,units:e.name})},{tandem:i.tandem.createTandem("readoutStringProperty"),phetioValueType:it.Z,phetioDocumentation:"The text content of the readout on the measuring tape"});this.valueNode=new v.xvT(d,{font:i.textFont,fill:i.textColor,maxWidth:i.textMaxWidth}),this.valueBackgroundNode=new v.AeJ(0,0,1,1,{cornerRadius:i.textBackgroundCornerRadius,fill:i.textBackgroundColor});const c=()=>{const e=this.valueNode.width+2*i.textBackgroundXMargin,t=this.valueNode.height+2*i.textBackgroundYMargin;this.valueBackgroundNode.setRect(0,0,e,t),this.valueBackgroundNode.center=this.valueNode.center};let u;if(this.valueNode.boundsProperty.lazyLink(c),c(),l.touchArea=l.localBounds.dilated(15),this.baseImage.touchArea=this.baseImage.localBounds.dilated(20),this.baseImage.mouseArea=this.baseImage.localBounds.dilated(10),this.addChild(h),this.addChild(n),this.addChild(a),this.valueContainer=new v.NBX({children:[this.valueBackgroundNode,this.valueNode]}),i.hasValue&&this.addChild(this.valueContainer),this.addChild(l),this.baseDragListener=null,i.interactive){let e;a.interactiveHighlightEnabled=!0,l.interactiveHighlightEnabled=!0,this.baseDragListener=new v._U3({tandem:i.tandem.createTandem("baseDragListener"),start:e=>{this.moveToFront(),i.baseDragStarted(),this._isBaseUserControlledProperty.value=!0;const t=this.modelViewTransformProperty.value.modelToViewPosition(this.basePositionProperty.value);u=e.currentTarget.globalToParentPoint(e.pointer.point).minus(t)},drag:(e,t)=>{const s=t.currentTarget.globalToParentPoint(e.pointer.point).minus(u),n=this.modelViewTransformProperty.value.viewToModelPosition(s),r=this.dragBounds.closestPointTo(n),o=r.minus(this.basePositionProperty.value);if(this.basePositionProperty.set(r),!this.isTipUserControlledProperty.value){const e=o.add(this.tipPositionProperty.value);if(i.isTipDragBounded){const t=this.dragBounds.closestPointTo(e);this.tipPositionProperty.set(t)}else this.tipPositionProperty.set(e)}},end:()=>{this._isBaseUserControlledProperty.value=!1,i.baseDragEnded()}}),this.baseImage.addInputListener(this.baseDragListener);const t=new v._U3({tandem:i.tandem.createTandem("tipDragListener"),start:t=>{this.moveToFront(),this._isTipUserControlledProperty.value=!0;const i=this.modelViewTransformProperty.value.modelToViewPosition(this.tipPositionProperty.value);e=t.currentTarget.globalToParentPoint(t.pointer.point).minus(i)},drag:(t,s)=>{const n=s.currentTarget.globalToParentPoint(t.pointer.point).minus(e),r=this.modelViewTransformProperty.value.viewToModelPosition(n);i.isTipDragBounded?this.tipPositionProperty.value=this.dragBounds.closestPointTo(r):this.tipPositionProperty.value=r},end:()=>{this._isTipUserControlledProperty.value=!1}});l.addInputListener(t)}const p=()=>{this.valueNode.centerTop=this.baseImage.center.plus(i.textPosition.times(i.baseScale))};d.link(p);const m=he.Z.multilink([this.measuredDistanceProperty,e,this.modelViewTransformProperty,this.tipPositionProperty,this.basePositionProperty],(e,t,s,r,o)=>{const a=s.modelToViewPosition(r),d=s.modelToViewPosition(o),c=this.baseImage.getRotation(),u=Math.atan2(a.y-d.y,a.x-d.x),m=u-c;n.center=d,l.center=a,this.baseImage.setRotation(0),this.baseImage.rightBottom=d,this.baseImage.rotateAround(this.baseImage.rightBottom,u),h.setLine(d.x,d.y,a.x,a.y),i.isTipCrosshairRotating&&l.rotateAround(a,m),i.isBaseCrosshairRotating&&n.rotateAround(d,m),p()});this.disposeMeasuringTapeNode=()=>{m.dispose(),d.dispose(),a.dispose(),l.dispose()},this.mutate(i)}reset(){this.basePositionProperty.reset(),this.tipPositionProperty.reset()}dispose(){this.disposeMeasuringTapeNode(),super.dispose()}setDragBounds(e){this.dragBounds=e.copy(),this.basePositionProperty.value=this.dragBounds.closestPointTo(this.basePositionProperty.value),this.isTipDragBounded&&(this.tipPositionProperty.value=this.dragBounds.closestPointTo(this.tipPositionProperty.value))}getDragBounds(){return this.dragBounds.copy()}getLocalBaseCenter(){return new Ke.Z(-this.baseImage.imageWidth/2,-this.baseImage.imageHeight/2)}getLocalBaseBounds(){return this.baseImage.bounds.copy()}startBaseDrag(e){this.baseDragListener&&this.baseDragListener.press(e)}static createIcon(e){const t=(0,ae.ZP)()({tapeLength:30},e),i=new ut(new be.Z({name:"",multiplier:1}),{tipPositionProperty:new je.Z(new Ke.Z(t.tapeLength,0)),hasValue:!1,interactive:!1});t.children=[i];const s=new v.NBX(t);return i.toImage(e=>s.setChildren([new v.Eep(e)])),s}}Be.register("MeasuringTapeNode",ut);const pt=ut,mt=new N.Z("sun"),gt={fill:"white",stroke:"black",lineWidth:1,lineDash:[],xMargin:5,yMargin:5,cornerRadius:10,resize:!0,backgroundPickable:!0,excludeInvisibleChildrenFromBounds:!0,align:"left",minWidth:0,minHeight:0,tandem:L.Z.OPTIONAL};class yt extends((0,v.tTM)(v.NBX)){constructor(e,t){const i=(0,ae.lB)()({},gt,t);super(),this._content=e,this._backgroundContainer=new v.NBX,this._background=new v.AeJ(0,0,1,1,{lineWidth:i.lineWidth,pickable:i.backgroundPickable,lineDash:i.lineDash,cornerRadius:i.cornerRadius}),this.setStroke(i.stroke),this.setFill(i.fill),this.addChild(this._backgroundContainer),this.addChild(e),this.constraint=new ft(this,i),this.constraint.updateLayout(),this.constraint.enabled=i.resize,this.mutate(i)}getStroke(){return this._background.stroke}get stroke(){return this.getStroke()}set stroke(e){this.setStroke(e)}setStroke(e){this._background.stroke=e,this.constraint&&this.constraint.updateLayoutAutomatically()}getFill(){return this._background.fill}get fill(){return this.getFill()}set fill(e){this.setFill(e)}setFill(e){this._background.fill=e}setExcludeInvisibleChildrenFromBounds(e){super.setExcludeInvisibleChildrenFromBounds(e),this.constraint.updateLayoutAutomatically()}dispose(){this.constraint.dispose(),super.dispose()}}_defineProperty(yt,"DEFAULT_PANEL_OPTIONS",gt);class ft extends v.dmK{constructor(e,t){super(e),this.panel=e,this.minWidth=t.minWidth,this.minHeight=t.minHeight,this.xMargin=t.xMargin,this.yMargin=t.yMargin,this.lineWidth=t.lineWidth,this.align=t.align,this.panel.localPreferredWidthProperty.lazyLink(this._updateLayoutListener),this.panel.localPreferredHeightProperty.lazyLink(this._updateLayoutListener),this.addNode(e._content)}layout(){super.layout();const e=this.panel,t=e._content,i=e._background,s=null===e.stroke?0:this.lineWidth,n=e.isChildIncludedInLayout(t);if(e._backgroundContainer.children=n?[i]:[],!n)return e.localMinimumWidth=null,void(e.localMinimumHeight=null);const r=(0,v.S3T)(t)&&null!==t.minimumWidth?t.minimumWidth:t.width,o=(0,v.fJO)(t)&&null!==t.minimumHeight?t.minimumHeight:t.height,a=Math.max(this.minWidth,r+2*this.xMargin)+s,h=Math.max(this.minHeight,o+2*this.yMargin)+s,l=null===e.localPreferredWidth?a:e.localPreferredWidth,d=null===e.localPreferredHeight?h:e.localPreferredHeight;(0,v.S3T)(t)&&null!==e.localPreferredWidth&&(t.preferredWidth=l-s-2*this.xMargin),(0,v.fJO)(t)&&null!==e.localPreferredHeight&&(t.preferredHeight=d-s-2*this.yMargin),i.setRect(0,0,l-s,d-s),"center"===this.align?t.center=i.center:"left"===this.align?(t.left=i.centerX-i.rectWidth/2+this.xMargin,t.centerY=i.centerY):(t.right=i.centerX+i.rectWidth/2-this.xMargin,t.centerY=i.centerY),e.localMinimumWidth=a,e.localMinimumHeight=h}dispose(){this.panel.localPreferredWidthProperty.unlink(this._updateLayoutListener),this.panel.localPreferredHeightProperty.unlink(this._updateLayoutListener),super.dispose()}}mt.register("Panel",yt);const At="data:audio/mpeg;base64,//tQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAFAAAE5AAzMzMzMzMzMzMzMzMzMzMzMzMzZmZmZmZmZmZmZmZmZmZmZmZmZmaZmZmZmZmZmZmZmZmZmZmZmZmZmczMzMzMzMzMzMzMzMzMzMzMzMzM//////////////////////////8AAAA5TEFNRTMuOTlyAaUAAAAAAAAAABRAJAZmQgAAQAAABOTGvClKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/7UMQAAAjxrv+ggLoZGTXh9oJQAa222FG3ASABBG51MY/j4AAB4AYI3/H3//Pqd/zv0Jp/8//zn3n6Mmf/J7f//8jf+fOeeggHA4RXkGh8XEwHAMHD4udyCYuhAALhgJqWJAEDGMYxvHlyAHxc9P76dP//T/Rm//p+v9tvb0Tzr1XyfnelP/3b0//5vo86Mlm0dHQrscccRQg5oSYpziaiB52oQCkxnR6LQisRCEMhluyeqEhIiWMiSvQjhwDTCt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VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==",bt=M(F,At),Pt=k.Z.createLock(At),Vt=new Z;let vt=!1;const wt=()=>{vt||(Pt(),vt=!0)},St=F.decodeAudioData(bt.buffer,e=>{null===Vt.audioBufferProperty.value&&(Vt.audioBufferProperty.set(e),wt())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),Vt.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),wt()});St&&St.then(e=>{null===Vt.audioBufferProperty.value&&(Vt.audioBufferProperty.set(e),wt())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),wt()});const Tt=Vt,Et={detectSoundBounds:e=>{const t=e.length,i=[],s=[];for(let r=0;r{let s,n=0,r=!1;for(s=0;si&&e[s+1]>e[s]&&(n=s,r=!0);let o=0;for(r=!1,s=n;s>0&&!r;s--){const t=e[s];t<=0&&(o=0===t?s:s+1,r=!0)}let a=0,h=0;for(s=0;s{let s,n=t-1,r=!1;for(s=t-1;s>0&&!r;s--)e[s]<=-i&&e[s-1]=0&&(o=s,r=!0);let a=0,h=0;for(s=o;s{this.fullyEnabledProperty.value=_.every(this.enableControlProperties,e=>e.value)};this.enableControlProperties.addItemAddedListener(e=>{e.link(i);const t=s=>{s===e&&(s.unlink(i),this.enableControlProperties.removeItemRemovedListener(t))};this.enableControlProperties.addItemRemovedListener(t)}),t.enableControlProperties.forEach(e=>{this.addEnableControlProperty(e)}),this.locallyEnabledProperty=new S.Z(!0),this.addEnableControlProperty(this.locallyEnabledProperty),this.masterGainNode=this.audioContext.createGain(),this.masterGainNode.gain.setValueAtTime(this._outputLevel,this.audioContext.currentTime),t.connectImmediately&&this.masterGainNode.connect(this.audioContext.destination),this.fullyEnabledProperty.link(e=>{const t=e?0:this._outputLevel,i=e?this._outputLevel:0,s=this.audioContext.currentTime;this.masterGainNode.gain.setValueAtTime(t,s),this.masterGainNode.gain.linearRampToValueAtTime(i,this.audioContext.currentTime+ie.DEFAULT_LINEAR_GAIN_CHANGE_TIME)}),this.soundSourceDestination=this.masterGainNode;for(let s=t.additionalAudioNodes.length-1;s>=0;s--){const e=t.additionalAudioNodes[s];e.connect(this.soundSourceDestination),this.soundSourceDestination=e}L.Z.PHET_IO_ENABLED&&!t.enabledDuringPhetioStateSetting&&(L.Z.launched?this.addEnableControlProperty(Dt):L.Z.addLaunchListener(()=>{Dt||(Dt=ge.ZP.not(phet.phetio.phetioEngine.phetioStateEngine.isSettingStateProperty)),this.addEnableControlProperty(Dt)})),this.disposeSoundGenerator=()=>{this.enableControlProperties.clear()}}connect(e){this.masterGainNode.connect(e),this.connectionList.push(e)}disconnect(e){this.masterGainNode.disconnect(e),this.connectionList=_.without(this.connectionList,e)}isConnectedTo(e){return this.connectionList.includes(e)}setOutputLevel(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:It;if(e!==this._outputLevel){const i=this.audioContext.currentTime;this.fullyEnabledProperty.value&&(this.masterGainNode.gain.cancelScheduledValues(i),0===t?this.masterGainNode.gain.setValueAtTime(e,i):"running"===this.audioContext.state?this.masterGainNode.gain.setTargetAtTime(e,i,t):this.masterGainNode.gain.linearRampToValueAtTime(e,i+ie.DEFAULT_LINEAR_GAIN_CHANGE_TIME)),this._outputLevel=e}}set outputLevel(e){this.setOutputLevel(e)}get outputLevel(){return this.getOutputLevel()}getOutputLevel(){return this._outputLevel}addEnableControlProperty(e){this.enableControlProperties.push(e)}removeEnableControlProperty(e){this.enableControlProperties.remove(e)}get locallyEnabled(){return this.locallyEnabledProperty.value}set locallyEnabled(e){this.locallyEnabledProperty.value=e}get fullyEnabled(){return this.fullyEnabledProperty.value}dispose(){this.disposeSoundGenerator()}}R.register("SoundGenerator",Lt);const kt=Lt,Mt=ie.DEFAULT_PARAM_CHANGE_TIME_CONSTANT;class Ot extends kt{constructor(e,t){const i=(0,ae.ZP)()({loop:!1,trimSilence:!0,initialPlaybackRate:1,initiateWhenDisabled:!1,rateChangesAffectPlayingSounds:!0},t);if(super(i),this.wrappedAudioBuffer=e,this.loop=i.loop,this.rateChangesAffectPlayingSounds=i.rateChangesAffectPlayingSounds,this.initiateWhenDisabled=i.initiateWhenDisabled,this.soundStart=0,this.soundEnd=null,i.trimSilence){const e=t=>{if(t){const i=Ct.detectSoundBounds(t);this.soundStart=i.soundStart,this.soundEnd=i.soundEnd,this.wrappedAudioBuffer.audioBufferProperty.unlink(e)}};this.wrappedAudioBuffer.audioBufferProperty.link(e)}this.activeBufferSources=[],this.localGainNode=this.audioContext.createGain(),this.localGainNode.connect(this.soundSourceDestination),this._playbackRate=i.initialPlaybackRate,this.isPlayingProperty=new S.Z(!1),this.timeOfDeferredPlayRequest=Number.NEGATIVE_INFINITY,this.audioContextStateChangeListener=e=>{"running"===e&&((this.loop||(Date.now()-this.timeOfDeferredPlayRequest)/1e3<.2)&&this.play(.1),ee.removeStateChangeListener(this.audioContext,this.audioContextStateChangeListener))},this.fullyEnabledProperty.lazyLink(e=>{this.loop||e||this.stop()})}play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if("running"===this.audioContext.state&&this.wrappedAudioBuffer.audioBufferProperty.value){const t=this.audioContext.currentTime;if(this.loop&&!this.isPlayingProperty.get()||!this.loop&&(this.fullyEnabled||this.initiateWhenDisabled)){const i=this.audioContext.createBufferSource();i.buffer=this.wrappedAudioBuffer.audioBufferProperty.value,i.loop=this.loop,i.loopStart=this.soundStart,this.soundEnd&&(i.loopEnd=this.soundEnd),this.localGainNode.gain.cancelScheduledValues(t),this.localGainNode.gain.setValueAtTime(1,t),i.connect(this.soundSourceDestination),this.activeBufferSources.push(i),this.loop||(i.onended=()=>{const e=this.activeBufferSources.indexOf(i);e>-1&&this.activeBufferSources.splice(e,1),this.isPlayingProperty.value=this.activeBufferSources.length>0}),i.playbackRate.setValueAtTime(this._playbackRate,t),i.start(t+e,this.soundStart),this.isPlayingProperty.value=!0}}else"suspended"===this.audioContext.state&&(this.timeOfDeferredPlayRequest=Date.now(),ee.hasListener(this.audioContext,this.audioContextStateChangeListener)||ee.addStateChangeListener(this.audioContext,this.audioContextStateChangeListener))}stop(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.1;const t=e>0?e/4.61:ie.DEFAULT_PARAM_CHANGE_TIME_CONSTANT,i=this.audioContext.currentTime,s=i+e;this.localGainNode.gain.cancelScheduledValues(i),this.localGainNode.gain.setTargetAtTime(0,i,t),this.activeBufferSources.forEach(e=>{e.stop(s)}),this.activeBufferSources.length=0,this.isPlayingProperty.value=!1,ee.hasListener(this.audioContext,this.audioContextStateChangeListener)&&ee.removeStateChangeListener(this.audioContext,this.audioContextStateChangeListener)}setPlaybackRate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mt;if(this.rateChangesAffectPlayingSounds){const i=this.audioContext.currentTime;this.activeBufferSources.forEach(s=>{s.playbackRate.cancelScheduledValues(i),s.playbackRate.setTargetAtTime(e,i,t)})}this._playbackRate=e}getPlaybackRate(){return this._playbackRate}get playbackRate(){return this.getPlaybackRate()}get isPlaying(){return this.isPlayingProperty.value}getNumberOfPlayingInstances(){return this.activeBufferSources.length}}R.register("SoundClip",Ot);const Nt=Ot;class Rt{constructor(e,t){this.soundPlayer=e,this.playbackRate=t}play(){this.soundPlayer.setPlaybackRate(this.playbackRate),this.soundPlayer.play()}stop(){this.soundPlayer.stop()}}const Bt=new class{constructor(){this._basisSoundClip=null,this.soundPlayers=[]}getSoundClipInstance(){return this._basisSoundClip||(this._basisSoundClip=new Nt(Tt,{initialOutputLevel:.7,rateChangesAffectPlayingSounds:!1}),me.addSoundGenerator(this._basisSoundClip,{categoryName:"user-interface"})),this._basisSoundClip}getSelectionSoundPlayer(e){if(!this.soundPlayers[e]){const t=Math.pow(2,-e/12);this.soundPlayers[e]=new Rt(this.getSoundClipInstance(),t)}return this.soundPlayers[e]}};R.register("multiSelectionSoundPlayerFactory",Bt);const Zt=Bt;class qt extends((0,v.CHP)(v.NBX)){constructor(e,t,i,s){const n=(0,ae.ZP)()({centerColor:"black",radius:qt.DEFAULT_RADIUS,selectedColor:"rgb( 143, 197, 250 )",deselectedColor:"white",xSpacing:8,stroke:"black",soundPlayer:Zt.getSelectionSoundPlayer(0),a11yNameAttribute:null,cursor:"pointer",disabledOpacity:v.iaM.DISABLED_OPACITY,tandem:L.Z.REQUIRED,tandemNameSuffix:"RadioButton",visiblePropertyOptions:{phetioFeatured:!0},phetioEnabledPropertyInstrumented:!0,tagName:"input",inputType:"radio",containerTagName:"li",labelTagName:"label",appendLabel:!0,appendDescription:!0},s);super(),this.value=t;const r=new v.NBX,o=new v.Cdc(n.radius/3,{fill:n.centerColor}),a=new v.Cdc(n.radius,{fill:n.selectedColor,stroke:n.stroke}),h=new v.NBX({children:[a,o]});r.addChild(h),r.addChild(i);const l=new v.NBX,d=new v.Cdc(n.radius,{fill:n.deselectedColor,stroke:n.stroke});l.addChild(d),l.addChild(i);const c=()=>{i.left=d.right+n.xSpacing,i.centerY=d.centerY};i.boundsProperty.link(c);const u=new v.AeJ(r.bounds.union(l.bounds));r.pickable=l.pickable=!1,this.addChild(u),this.addChild(r),this.addChild(l);const p=e=>{r.visible=e===t,l.visible=!r.visible};e.link(p);const m=()=>{e.set(t),n.soundPlayer.play()},g=new v.eMb({fire:m,tandem:n.tandem.createTandem("fireListener")});this.addInputListener(g);const y={change:m};this.addInputListener(y),e.value===t&&this.setPDOMAttribute("checked","checked");const f=e=>{this.pdomChecked=e===t};e.link(f),null!==n.a11yNameAttribute&&this.setPDOMAttribute("name",n.a11yNameAttribute),this.mutate(n),this.disposeAquaRadioButton=()=>{this.removeInputListener(g),this.removeInputListener(y),e.unlink(f),e.unlink(p),i.boundsProperty.hasListener(c)&&i.boundsProperty.unlink(c),g.dispose()}}dispose(){this.disposeAquaRadioButton(),super.dispose()}}function Ft(e,t){return e.map(e=>e.createNode(e.tandemName?t.createTandem(e.tandemName):L.Z.OPTIONAL))}_defineProperty(qt,"DEFAULT_RADIUS",7),_defineProperty(qt,"TANDEM_NAME_SUFFIX","RadioButton"),mt.register("AquaRadioButton",qt);let Ht=0;class zt extends v.N52{constructor(e,t,i){Ht++;const s=(0,ae.ZP)()({touchAreaXDilation:0,touchAreaYDilation:0,mouseAreaXDilation:0,mouseAreaYDilation:0,orientation:"vertical",spacing:3,disabledOpacity:v.iaM.DISABLED_OPACITY,tandem:L.Z.REQUIRED,tandemNameSuffix:"RadioButtonGroup",visiblePropertyOptions:{phetioFeatured:!0},phetioEnabledPropertyInstrumented:!0,tagName:"ul",labelTagName:"h3",ariaRole:"radiogroup",groupFocusHighlight:!0},i),n=Ft(t,s.tandem),r=_.maxBy(n,e=>e.width).width,o=[];for(let h=0;h{"vertical"===s.orientation?(d.mouseArea=e.dilatedXY(s.mouseAreaXDilation,s.spacing/2),d.touchArea=e.dilatedXY(s.touchAreaXDilation,s.spacing/2)):(d.mouseArea=e.dilatedXY(s.mouseAreaXDilation,s.mouseAreaYDilation),d.touchArea=e.dilatedXY(s.touchAreaXDilation,s.touchAreaYDilation))}),o.push(d)}s.children=o,super(s),this.addAriaLabelledbyAssociation({thisElementName:v.Grz.PRIMARY_SIBLING,otherNode:this,otherElementName:v.Grz.LABEL_SIBLING});const a={keydown:e=>e.pointer.reserveForKeyboardDrag()};this.addInputListener(a),this.addLinkedElement(e,{tandem:s.tandem.createTandem("property")}),this.disposeAquaRadioButtonGroup=()=>{this.removeInputListener(a),o.forEach(e=>e.dispose()),n.forEach(e=>e.dispose())},this.radioButtons=o}dispose(){this.disposeAquaRadioButtonGroup(),super.dispose()}getButton(e){const t=_.find(this.radioButtons,t=>t.value===e);return t}}mt.register("AquaRadioButtonGroup",zt);var Yt=i(7959),Gt=i(9972);const Wt=new Qe.bn("M1120 1280h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v832q0 66 -47 113t-113 47zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q119 0 203.5 -84.5t84.5 -203.5z").makeImmutable(),Ut=new Qe.bn("M1408 606v-318q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-10 -10 -23 -10q-3 0 -9 2q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832 q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v254q0 13 9 22l64 64q10 10 23 10q6 0 12 -3q20 -8 20 -29zM1639 1095l-814 -814q-24 -24 -57 -24t-57 24l-430 430q-24 24 -24 57t24 57l110 110q24 24 57 24t57 -24l263 -263l647 647q24 24 57 24t57 -24l110 -110 q24 -24 24 -57t-24 -57z").makeImmutable(),Xt="data:audio/mpeg;base64,//twxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAARAAAWCgAPDw8PDx4eHh4eHi0tLS0tLTw8PDw8PEtLS0tLS1paWlpaWmlpaWlpaXh4eHh4eIeHh4eHlpaWlpaWpaWlpaWltLS0tLS0w8PDw8PD0tLS0tLS4eHh4eHh8PDw8PDw//////8AAAA3TEFNRTMuOThyAc0AAAAAAAAAABRgJAZTQgAAYAAAFgoMxGP1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/7cMQAAA7gbOxVvYACW5Fntz3AA5QAAyAQIBEys3MtCTFFg5TGPm8D3KgDTJuEccMxAZkMFHzKy0ykhAROIho0JQOFfTbU8iRzFi4zYwMgBiUFMRDxoHLdpJtwSEMGBAMAKWRFL8swriCVA0i2X2oxYpIxKJZScr2+g+8oCBQ5//5cP////y4P/y4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VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7cMS2A9IFejpDGM3IAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",Kt=M(F,Xt),jt=k.Z.createLock(Xt),Qt=new Z;let Jt=!1;const $t=()=>{Jt||(jt(),Jt=!0)},ei=F.decodeAudioData(Kt.buffer,e=>{null===Qt.audioBufferProperty.value&&(Qt.audioBufferProperty.set(e),$t())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),Qt.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),$t()});ei&&ei.then(e=>{null===Qt.audioBufferProperty.value&&(Qt.audioBufferProperty.set(e),$t())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),$t()});const ti=Qt;class ii{constructor(e,t){const i=(0,ae.ZP)()({soundClipOptions:{},soundManagerOptions:{}},t);this._soundClip=new Nt(e,i.soundClipOptions),me.addSoundGenerator(this._soundClip,i.soundManagerOptions)}play(){this._soundClip.play()}stop(){this._soundClip.stop()}getSoundClip(){return this._soundClip}}R.register("SoundClipPlayer",ii);const si=ii,ni=new si(ti,{soundClipOptions:{initialOutputLevel:.7},soundManagerOptions:{categoryName:"user-interface"}});R.register("checkboxCheckedSo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VLM1lJzEbCWPFrmxBNqHM4RC+k5ZUzwUcEaSmKZZCdwJRBNZkJiwDdFN36YdSqdqUT6pYDZ5ScxSDVfZPSpL8M//b6NxDNtjDhTpxDmMDKQMMw1k08tNDTxrGMKLQxRDCMevDKlACBZi1WYsoiEOBwEwdI9e0vdBptNKZfgzJsVH29qtOpUET8k9v4mAAAExTEHgUKP/7MsQEggfQUyJNc0QA2AklmY2YpukjMG6N4KPFG4xmOjdBnIQqBgcbgGQGmcNGdaHtBQplqcsNdnbkroa0zXiUXxyr9wz/WF9usagQAkSHDHulGU3DjA44xIgQwADplHVAGUl7G/MbPAcXSMAgRGUSoN9OUp+zGuLf///V3//+ugKcCSTofFaj5oNcoyUgyJfAIDMwsQBGeEBQiGf/+zLEDgJHUD8UDOksQN6F39wxsAA60sBDGHr5bR5oZBEMkscKhnEIJPCh6j//////+n6AmBgKjhFZNEIgmCyGD2UQjAVEweC2peqxVyOIpL/WDXZ7cNcFTtQdJCEFQVGLPFgaUHJ6dhojDlVttOCJU4BB0qsXplV/tncqptv/p//+n//6abf////9QTTTTRVV9UEJK0kIixWmqoc///swxBiDxvgCi4CEYAgAADSAAAAE/1TTVEWK6UxBTUUzLjk5LjNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",ai=M(F,oi),hi=k.Z.createLock(oi),li=new Z;let di=!1;const ci=()=>{di||(hi(),di=!0)},ui=F.decodeAudioData(ai.buffer,e=>{null===li.audioBufferProperty.value&&(li.audioBufferProperty.set(e),ci())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),li.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),ci()});ui&&ui.then(e=>{null===li.audioBufferProperty.value&&(li.audioBufferProperty.set(e),ci())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),ci()});const pi=new si(li,{soundClipOptions:{initialOutputLevel:.7},soundManagerOptions:{categoryName:"user-interface"}});R.register("checkboxUncheckedSoundPlayer",pi);const mi=pi;var gi=i(428);const yi={valueType:"boolean"},fi=Gt.Z.pool.create(.025,0,0,0,-.025,0,0,0,1),Ai=Wt.transformed(fi),bi=Ut.transformed(fi);class Pi extends((0,v.pL8)((0,v.CHP)(v.NBX))){constructor(e,t,i){const s=(0,ae.ZP)()({spacing:5,boxWidth:21,checkboxColor:"black",checkboxColorBackground:"white",touchAreaXDilation:0,touchAreaYDilation:0,mouseAreaXDilation:0,mouseAreaYDilation:0,checkedSoundPlayer:ri,uncheckedSoundPlayer:mi,phetioLinkProperty:!0,cursor:"pointer",disabledOpacity:v.iaM.DISABLED_OPACITY,tandem:L.Z.REQUIRED,tandemNameSuffix:"Checkbox",phetioEventType:Ne.Z.USER,visiblePropertyOptions:{phetioFeatured:!0},phetioEnabledPropertyInstrumented:!0,phetioReadOnly:D.Z.DEFAULT_OPTIONS.phetioReadOnly,tagName:"input",inputType:"checkbox",appendDescription:!0,voicingCheckedObjectResponse:null,voicingUncheckedObjectResponse:null,checkedContextResponse:null,uncheckedContextResponse:null,voiceNameResponseOnSelection:!0},i);super(),_defineProperty(this,"_isMouseAreaCustomized",!1),_defineProperty(this,"_isTouchAreaCustomized",!1),_defineProperty(this,"_isSettingAreas",!1);const n=new qe.Z(()=>{e.value=!e.value,(0,Yt.Z)(e.value,yi),e.value?(s.checkedSoundPlayer.play(),s.checkedContextResponse&&this.alertDescriptionUtterance(s.checkedContextResponse),this.voicingSpeakResponse({nameResponse:s.voiceNameResponseOnSelection?this.voicingNameResponse:null,objectResponse:gi.Z.alertableToText(s.voicingCheckedObjectResponse),contextResponse:gi.Z.alertableToText(s.checkedContextResponse)})):(s.uncheckedSoundPlayer.play(),s.uncheckedContextResponse&&this.alertDescriptionUtterance(s.uncheckedContextResponse),this.voicingSpeakResponse({nameResponse:s.voiceNameResponseOnSelection?this.voicingNameResponse:null,objectResponse:gi.Z.alertableToText(s.voicingUncheckedObjectResponse),contextResponse:gi.Z.alertableToText(s.uncheckedContextResponse)}))},{parameters:[],tandem:s.tandem.createTandem("toggleAction"),phetioDocumentation:"Emits when user input causes the checkbox to toggle, emitting a single arg: the new boolean value of the checkbox state.",phetioReadOnly:!0,phetioEventType:Ne.Z.USER});this.backgroundNode=new v.AeJ(0,-s.boxWidth,.95*s.boxWidth,.95*s.boxWidth,.2*s.boxWidth,.2*s.boxWidth,{fill:s.checkboxColorBackground}),this.uncheckedNode=new v.y$t(Ai,{fill:s.checkboxColor});const r=s.boxWidth/this.uncheckedNode.width;this.uncheckedNode.scale(r),this.checkedNode=new v.y$t(bi,{scale:r,fill:s.checkboxColor});const o=new v.NBX({children:[this.backgroundNode,this.checkedNode,this.uncheckedNode]}),a=new v.AeJ({});this.children=[o,t,a],this.constraint=new Vi(this,o,this.checkedNode,t,a,s),this.constraint.updateLayout(),t.pickable=!1,t.pdomVisible=!1;const h=new v.eMb({fire:()=>n.execute(),tandem:s.tandem.createTandem("fireListener")});this.addInputListener(h);const l=e=>{this.checkedNode.visible=e,this.uncheckedNode.visible=!e,this.pdomChecked=e};e.link(l),this.mutate(s),this.setExcludeLabelSiblingFromInput(),s.phetioLinkProperty&&this.addLinkedElement(e,{tandem:s.tandem.createTandem("property")}),this.disposeCheckbox=()=>{a.dispose(),this.backgroundNode.dispose(),this.uncheckedNode.dispose(),this.checkedNode.dispose(),o.dispose(),h.dispose(),e.hasListener(l)&&e.unlink(l),n.dispose()}}dispose(){this.constraint.dispose(),this.disposeCheckbox(),super.dispose()}setCheckboxColorBackground(e){this.backgroundNode.fill=e}set checkboxColorBackground(e){this.setCheckboxColorBackground(e)}get checkboxColorBackground(){return this.getCheckboxColorBackground()}getCheckboxColorBackground(){return this.backgroundNode.fill}setCheckboxColor(e){this.checkedNode.fill=this.uncheckedNode.fill=e}set checkboxColor(e){this.setCheckboxColor(e)}get checkboxColor(){return this.getCheckboxColor()}getCheckboxColor(){return this.checkedNode.fill}setMouseArea(e){return this._isSettingAreas||(this._isMouseAreaCustomized=!0),super.setMouseArea(e)}setTouchArea(e){return this._isSettingAreas||(this._isTouchAreaCustomized=!0),super.setTouchArea(e)}}class Vi extends v.dmK{constructor(e,t,i,s,n,r){super(e),this.checkbox=e,this.checkboxNode=t,this.checkedNode=i,this.content=s,this.rectangle=n,this.options=r,this.checkbox.localPreferredWidthProperty.lazyLink(this._updateLayoutListener),this.addNode(s)}layout(){super.layout();const e=this.createLayoutProxy(this.content),t=e.minimumWidth,i=this.checkedNode.right-this.checkboxNode.left,s=i+this.options.spacing+t,n=null===this.checkbox.localPreferredWidth?s:this.checkbox.localPreferredWidth;(0,v.S3T)(this.content)&&(e.preferredWidth=n-i-this.options.spacing),e.left=this.checkedNode.right+this.options.spacing,e.centerY=this.checkedNode.centerY,this.rectangle.rectBounds=this.checkboxNode.bounds.union(e.bounds).withMaxX(Math.max(this.checkboxNode.left+n,e.right)),this.checkbox._isSettingAreas=!0,this.checkbox._isTouchAreaCustomized||(this.checkbox.touchArea=this.checkbox.localBounds.dilatedXY(this.options.touchAreaXDilation,this.options.touchAreaYDilation)),this.checkbox._isMouseAreaCustomized||(this.checkbox.mouseArea=this.checkbox.localBounds.dilatedXY(this.options.mouseAreaXDilation,this.options.mouseAreaYDilation)),this.checkbox._isSettingAreas=!1,e.dispose(),this.checkbox.localMinimumWidth=s}dispose(){this.checkbox.localPreferredWidthProperty.unlink(this._updateLayoutListener),super.dispose()}}mt.register("Checkbox",Pi);var vi=i(1243),wi=i(5264),Si=i(3409);class Ti extends be.Z{constructor(e,t){const i=(0,ae.ZP)()({enumeration:e.enumeration},t);super(e,(0,ae.ZP)()({validValues:i.enumeration.values,phetioValueType:(0,Si.Z)({enumeration:i.enumeration})},i))}}We.Z.register("EnumerationProperty",Ti);const Ei="data:audio/mpeg;base64,//swxAAABlAhPLTAgDE1De+/HoACAH4CwkCAJDo5gDgP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VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==",_i=M(F,Ei),xi=k.Z.createLock(Ei),Ci=new Z;let Ii=!1;const Di=()=>{Ii||(xi(),Ii=!0)},Li=F.decodeAudioData(_i.buffer,e=>{null===Ci.audioBufferProperty.value&&(Ci.audioBufferProperty.set(e),Di())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),Ci.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),Di()});Li&&Li.then(e=>{null===Ci.audioBufferProperty.value&&(Ci.audioBufferProperty.set(e),Di())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),Di()});const ki=new si(Ci,{soundClipOptions:{initialOutputLevel:.5},soundManagerOptions:{categoryName:"user-interface"}});R.register("pushButtonSoundPlayer",ki);const Mi=ki;class Oi extends ne.Z{}_defineProperty(Oi,"IDLE",new(s=Oi)),_defineProperty(Oi,"OVER",new s),_defineProperty(Oi,"PRESSED",new s),_defineProperty(Oi,"enumeration",new se.Z(s)),mt.register("ButtonInteractionState",Oi);class Ni extends ge.Nt{constructor(e){super([e.focusedProperty,e.overProperty,e.looksOverProperty,e.looksPressedProperty],(e,t,i,s)=>i&&!s?Oi.OVER:(t||e)&&s?Oi.PRESSED:Oi.IDLE,{valueType:Oi})}}mt.register("PushButtonInteractionStateProperty",Ni);var Ri=i(2558),Bi=i(4317);class Zi extends Bi.Z{constructor(e){const t=(0,ae.ZP)()({startCallback:_.noop,endCallback:_.noop,tandem:L.Z.REQUIRED,phetioState:D.Z.DEFAULT_OPTIONS.phetioState,phetioReadOnly:D.Z.DEFAULT_OPTIONS.phetioReadOnly,phetioFeatured:D.Z.DEFAULT_OPTIONS.phetioFeatured},e);t.enabledPropertyOptions=(0,ae.JA)({phetioState:t.phetioState,phetioReadOnly:t.phetioReadOnly,phetioDocumentation:"When disabled, the button is grayed out and cannot be pressed",phetioFeatured:!0},t.enabledPropertyOptions),super(t),this.overProperty=new S.Z(!1),this.downProperty=new S.Z(!1,{reentrant:!0}),this.focusedProperty=new S.Z(!1),this.looksPressedProperty=new S.Z(!1),this.looksOverProperty=new S.Z(!1),this.produceSoundEmitter=new Ce.Z,this.interrupted=!1,this.listeners=[],this.looksPressedMultilink=null,this.looksOverMultilink=null,this.downProperty.lazyLink(e=>{e?t.startCallback():t.endCallback(this.looksOverProperty.get())}),this.enabledProperty.link(e=>{if(!e)for(let t=0;t{this.overProperty.dispose(),this.downProperty.dispose(),this.produceSoundEmitter.dispose(),this.looksPressedMultilink&&this.looksPressedMultilink.dispose(),this.looksOverMultilink&&this.looksOverMultilink.dispose(),this.listeners=[]}}dispose(){this.disposeButtonModel(),super.dispose()}createPressListener(e){var t=this;e=(0,ae.JA)({canStartPress:()=>this.enabledProperty.value},e);const i=new v.$o8(e);this.listeners.push(i),i.isPressedProperty.lazyLink(e=>{this.interrupted=i.interrupted,this.downProperty.set(e)}),i.isOverProperty.lazyLink(this.overProperty.set.bind(this.overProperty)),i.isFocusedProperty.lazyLink(this.focusedProperty.set.bind(this.focusedProperty)),this.looksPressedMultilink&&this.looksPressedMultilink.dispose(),this.looksOverMultilink&&this.looksOverMultilink.dispose();const s=this.listeners.map(e=>e.looksPressedProperty);s.push(this.downProperty),this.looksPressedMultilink=he.Z.multilinkAny(s,(function(){for(var e=arguments.length,i=new Array(e),s=0;se||t,!1)}));const n=this.listeners.map(e=>e.looksOverProperty);return this.looksOverMultilink=he.Z.multilinkAny(n,(function(){for(var e=arguments.length,i=new Array(e),s=0;se||t,!1)})),i}}mt.register("ButtonModel",Zi);class qi extends Zi{constructor(e){const t=(0,ae.ZP)()({fireOnDown:!1,listener:null,fireOnHold:!1,fireOnHoldDelay:400,fireOnHoldInterval:100,tandem:L.Z.REQUIRED,phetioReadOnly:D.Z.DEFAULT_OPTIONS.phetioReadOnly},e);super(t),this.isFiringProperty=new S.Z(!1),this.firedEmitter=new Ce.Z({tandem:t.tandem.createTandem("firedEmitter"),phetioDocumentation:"Emits when the button is fired",phetioReadOnly:t.phetioReadOnly,phetioEventType:Ne.Z.USER}),null!==t.listener&&this.firedEmitter.addListener(t.listener),t.fireOnHold&&(this.timer=new Ri.Z({callback:this.fire.bind(this),delay:t.fireOnHoldDelay,interval:t.fireOnHoldInterval}));const i=e=>{if(e)this.enabledProperty.get()&&(t.fireOnDown&&this.fire(),this.timer&&this.timer.start(),(t.fireOnDown||this.timer)&&this.produceSoundEmitter.emit());else{const e=!t.fireOnDown&&(this.overProperty.get()||this.focusedProperty.get())&&this.enabledProperty.get()&&!this.interrupted;this.timer?this.timer.stop(e):e&&(this.produceSoundEmitter.emit(),this.fire())}};this.downProperty.link(i);const s=e=>{!e&&this.timer&&this.timer.stop(!1)};this.enabledProperty.link(s),this.disposePushButtonModel=()=>{this.isFiringProperty.value=!1,this.isFiringProperty.dispose(),this.firedEmitter.dispose(),this.downProperty.unlink(i),this.enabledProperty.unlink(s),this.timer&&(this.timer.dispose(),this.timer=null)}}dispose(){this.disposePushButtonModel(),super.dispose()}addListener(e){this.firedEmitter.addListener(e)}removeListener(e){this.firedEmitter.removeListener(e)}fire(){this.isFiringProperty.value=!0,this.firedEmitter.emit(),this.isFiringProperty.value=!1}}mt.register("PushButtonModel",qi);const Fi={LIGHT_BLUE:new v.Ilk(153,206,255),LIGHT_GRAY:new v.Ilk(220,220,220)},Hi=new v.mnm(.7),zi=new v.UlH(1.2);class Yi extends((0,v.tTM)((0,v.CHP)(v.NBX))){constructor(e,t,i,s){const n=(0,ae.ZP)()({content:null,minUnstrokedWidth:null,minUnstrokedHeight:null,xMargin:10,yMargin:5,xAlign:"center",yAlign:"center",xContentOffset:0,yContentOffset:0,baseColor:Fi.LIGHT_BLUE,cursor:"pointer",buttonAppearanceStrategy:Yi.FlatAppearanceStrategy,buttonAppearanceStrategyOptions:{},contentAppearanceStrategy:null,contentAppearanceStrategyOptions:{},enabledAppearanceStrategy:(e,t,i,s)=>{i.filters=e?[]:[Hi,zi],s&&(s.filters=e?[]:[v.P5k.FULL],s.opacity=e?1:v.iaM.DISABLED_OPACITY)},disabledColor:Fi.LIGHT_GRAY,tagName:"button",tandem:L.Z.OPTIONAL,visiblePropertyOptions:{phetioFeatured:!0},phetioEnabledPropertyInstrumented:!0},s);n.listenerOptions=(0,ae.JA)({tandem:n.tandem.createTandem("pressListener")},n.listenerOptions),n.enabledProperty=e.enabledProperty,super(),_defineProperty(this,"buttonNodeConstraint",null),this.content=n.content,this.buttonModel=e,this._settableBaseColorProperty=new v.M4p(n.baseColor),this._disabledColorProperty=new v.M4p(n.disabledColor),this.baseColorProperty=new ge.ZP([this._settableBaseColorProperty,this.enabledProperty,this._disabledColorProperty],(e,t,i)=>t?e:i),this._pressListener=e.createPressListener(n.listenerOptions),this.addInputListener(this._pressListener),t.fill=this.baseColorProperty,this.addChild(t);const r=new n.buttonAppearanceStrategy(t,i,this.baseColorProperty,n.buttonAppearanceStrategyOptions);let o;n.contentAppearanceStrategy&&n.content&&(o=new n.contentAppearanceStrategy(n.content,i,n.contentAppearanceStrategyOptions)),this.maxLineWidth=r.maxLineWidth;let a=null,h=null;if(n.content){const e=n.content;e.pickable=!1,this.buttonNodeConstraint=new Gi(this,{content:n.content,xMargin:n.xMargin,yMargin:n.yMargin,maxLineWidth:this.maxLineWidth,minUnstrokedWidth:n.minUnstrokedWidth,minUnstrokedHeight:n.minUnstrokedHeight}),this.layoutSizeProperty=this.buttonNodeConstraint.layoutSizeProperty,a=new v.DbO(e,{xAlign:n.xAlign,yAlign:n.yAlign,leftMargin:n.xMargin+n.xContentOffset,rightMargin:n.xMargin-n.xContentOffset,topMargin:n.yMargin+n.yContentOffset,bottomMargin:n.yMargin-n.yContentOffset}),h=he.Z.multilink([t.boundsProperty,this.layoutSizeProperty],(e,t)=>{a.alignBounds=Le.Z.point(e.center).dilatedXY(t.width/2,t.height/2)}),this.addChild(a)}else this.layoutSizeProperty=new O.Z(new ke.Z(n.minUnstrokedWidth+this.maxLineWidth,n.minUnstrokedHeight+this.maxLineWidth));this.mutate(n),this.enabledProperty.link(e=>n.enabledAppearanceStrategy(e,this,t,a)),this.disposeButtonNode=()=>{a&&a.dispose(),h&&h.dispose(),r.dispose&&r.dispose(),o&&o.dispose&&o.dispose(),this._pressListener.dispose(),this.baseColorProperty.dispose()}}dispose(){this.buttonNodeConstraint&&this.buttonNodeConstraint.dispose(),this.disposeButtonNode(),super.dispose()}setBaseColor(e){this._settableBaseColorProperty.paint=e}set baseColor(e){this.setBaseColor(e)}get baseColor(){return this.getBaseColor()}getBaseColor(){return this._settableBaseColorProperty.paint}pdomClick(){this._pressListener.click(null)}isPDOMClicking(){return this._pressListener.pdomClickingProperty.get()}}class Gi extends v.dmK{constructor(e,t){super(e),_defineProperty(this,"layoutSizeProperty",new O.Z(new ke.Z(0,0))),_defineProperty(this,"isFirstLayout",!0),_defineProperty(this,"localPreferredWidth",0),_defineProperty(this,"localPreferredHeight",0),this.buttonNode=e,this.content=t.content,this.xMargin=t.xMargin,this.yMargin=t.yMargin,this.maxLineWidth=t.maxLineWidth,this.minUnstrokedWidth=t.minUnstrokedWidth,this.minUnstrokedHeight=t.minUnstrokedHeight,this.buttonNode.localPreferredWidthProperty.lazyLink(this._updateLayoutListener),this.buttonNode.localPreferredHeightProperty.lazyLink(this._updateLayoutListener),this.addNode(this.content,!1),this.layout()}layout(){super.layout();const e=this.buttonNode,t=this.content,i=Math.max(this.isFirstLayout||e.widthSizable?((0,v.S3T)(t)?t.minimumWidth||0:t.width)+2*this.xMargin:e.localMinimumWidth,null===this.minUnstrokedWidth?0:this.minUnstrokedWidth+this.maxLineWidth),s=Math.max(this.isFirstLayout||e.heightSizable?((0,v.fJO)(t)?t.minimumHeight||0:t.height)+2*this.yMargin:e.localMinimumHeight,null===this.minUnstrokedHeight?0:this.minUnstrokedHeight+this.maxLineWidth);this.localPreferredWidth=this.isFirstLayout||(0,v.S3T)(e)?null===e.localPreferredWidth?i:e.localPreferredWidth:this.localPreferredWidth,this.localPreferredHeight=this.isFirstLayout||(0,v.fJO)(e)?null===e.localPreferredHeight?s:e.localPreferredHeight:this.localPreferredHeight,this.isFirstLayout=!1,this.layoutSizeProperty.value=new ke.Z(this.localPreferredWidth,this.localPreferredHeight),e.localMinimumWidth=i,e.localMinimumHeight=s}dispose(){this.buttonNode.localPreferredWidthProperty.unlink(this._updateLayoutListener),this.buttonNode.localPreferredHeightProperty.unlink(this._updateLayoutListener),super.dispose()}}Yi.FlatAppearanceStrategy=class{constructor(e,t,i,s){const n=new v.M4p(i,{luminanceFactor:.4}),r=new v.M4p(i,{luminanceFactor:-.4}),o=i,a=n,h=r,l=(0,ae.JA)({stroke:r},s),d="number"==typeof l.lineWidth?l.lineWidth:1;function c(t){switch(t){case Oi.IDLE:e.fill=o;break;case Oi.OVER:e.fill=a;break;case Oi.PRESSED:e.fill=h;break;default:throw new Error("unsupported interactionState: "+t)}}e.stroke=l.stroke||r,e.lineWidth=d,this.maxLineWidth=e.hasStroke()?d:0,e.cachedPaints=[o,a,h],t.link(c),this.disposeFlatAppearanceStrategy=()=>{t.hasListener(c)&&t.unlink(c),n.dispose(),r.dispose()}}dispose(){this.disposeFlatAppearanceStrategy()}},mt.register("ButtonNode",Yi);class Wi extends Yi{constructor(e,t,i){const s=(0,ae.ZP)()({size:null,minWidth:10,minHeight:10,xMargin:8,yMargin:5,touchAreaXDilation:0,touchAreaYDilation:0,mouseAreaXDilation:0,mouseAreaYDilation:0,touchAreaXShift:0,touchAreaYShift:0,mouseAreaXShift:0,mouseAreaYShift:0,stroke:null,lineWidth:.5,cornerRadius:4,leftTopCornerRadius:null,rightTopCornerRadius:null,leftBottomCornerRadius:null,rightBottomCornerRadius:null,buttonAppearanceStrategy:Wi.ThreeDAppearanceStrategy},i);let n,r;s.content,s.size?(s.minUnstrokedWidth=s.size.width,s.minUnstrokedHeight=s.size.height):(void 0!==s.minWidth&&(s.minUnstrokedWidth=s.minWidth),void 0!==s.minHeight&&(s.minUnstrokedHeight=s.minHeight)),s.buttonAppearanceStrategyOptions||(s.buttonAppearanceStrategyOptions={stroke:s.stroke,lineWidth:s.lineWidth}),s.size?(n=s.size.width,r=s.size.height):(n=Math.max(s.content?s.content.width+2*s.xMargin:0,s.minWidth),r=Math.max(s.content?s.content.height+2*s.yMargin:0,s.minHeight));const o=new v.y$t(Ui(n,r,s));if(s.size&&s.content){const e=s.content,t=Math.min((s.size.width-2*s.xMargin)/e.width,(s.size.height-2*s.yMargin)/e.height);s.content=new v.NBX({children:[e],scale:t})}super(e,o,t,s);let a=!0;he.Z.multilink([this.isWidthResizableProperty,this.isHeightResizableProperty,this.layoutSizeProperty],(e,t,i)=>{(e||t)&&(o.shape=Ui(e?i.width-this.maxLineWidth:n,t?i.height-this.maxLineWidth:r,s)),(a||e||t)&&(this.touchArea=o.localBounds.dilatedXY(s.touchAreaXDilation,s.touchAreaYDilation).shiftedXY(s.touchAreaXShift,s.touchAreaYShift),this.mouseArea=o.localBounds.dilatedXY(s.mouseAreaXDilation,s.mouseAreaYDilation).shiftedXY(s.mouseAreaXShift,s.mouseAreaYShift)),a=!1})}}function Ui(e,t,i){const s=Math.min(e/2,t/2);return Qe.bn.roundedRectangleWithRadii(0,0,e,t,{topLeft:Math.min(s,null!==i.leftTopCornerRadius?i.leftTopCornerRadius:i.cornerRadius),topRight:Math.min(s,null!==i.rightTopCornerRadius?i.rightTopCornerRadius:i.cornerRadius),bottomLeft:Math.min(s,null!==i.leftBottomCornerRadius?i.leftBottomCornerRadius:i.cornerRadius),bottomRight:Math.min(s,null!==i.rightBottomCornerRadius?i.rightBottomCornerRadius:i.cornerRadius)})}Wi.ThreeDAppearanceStrategy=class{constructor(e,t,i,s){const n=s&&s.stroke?s.stroke:new v.M4p(i,{luminanceFactor:-.4}),r=s&&void 0!==s.lineWidth?s.lineWidth:.5,o=(0,ae.ZP)()({stroke:n,lineWidth:r,overStroke:n,overLineWidth:r,overFill:i,overButtonOpacity:1,selectedStroke:n,selectedLineWidth:r,selectedButtonOpacity:1,deselectedStroke:n,deselectedLineWidth:r,deselectedButtonOpacity:1},s),a=new v.M4p(i,{luminanceFactor:.7}),h=new v.M4p(i,{luminanceFactor:.5}),l=new v.M4p(i,{luminanceFactor:.2}),d=new v.M4p(i,{luminanceFactor:-.3}),c=new v.M4p(i,{luminanceFactor:-.4}),u=new v.M4p(i,{luminanceFactor:-.5}),p=new ge.ZP([i],e=>e.withAlpha(0)),m=new v.Ilk(255,255,255,.7),g=new v.y$t(null,{stroke:o.stroke,lineWidth:o.lineWidth,pickable:!1});let y;e.addChild(g),this.maxLineWidth="number"==typeof o.lineWidth?o.lineWidth:0;const f=()=>{const s=e.shape.bounds.width,n=e.shape.bounds.height;g.shape=e.shape;const r=Math.min(7/n,1),c=Math.max(1-3/n,0),f=Math.min(7/s,1),A=Math.max(1-3/s,0),b=new v.oas(0,0,0,n).addColorStop(0,a).addColorStop(r,i).addColorStop(c,i).addColorStop(1,u),P=new v.oas(0,0,s,0).addColorStop(0,m).addColorStop(f,p).addColorStop(A,p).addColorStop(1,u),V=new v.oas(0,0,0,n).addColorStop(0,a).addColorStop(r,h).addColorStop(c,h).addColorStop(1,u),w=new v.oas(0,0,s,0).addColorStop(0,m).addColorStop(f/2,new v.Ilk(255,255,255,0)).addColorStop(A,p).addColorStop(1,d),S=new v.oas(0,0,0,n).addColorStop(0,a).addColorStop(.67*r,d).addColorStop(c,l).addColorStop(1,u);e.cachedPaints=[b,V,S],g.cachedPaints=[P,w],y&&t.unlink(y),y=t=>{switch(t){case Oi.IDLE:e.fill=b,e.stroke=o.deselectedStroke,e.lineWidth=o.deselectedLineWidth,e.opacity=o.deselectedButtonOpacity,g.fill=P,g.opacity=o.deselectedButtonOpacity;break;case Oi.OVER:e.fill=V,e.stroke=o.overStroke,e.lineWidth=o.overLineWidth,e.opacity=o.overButtonOpacity,g.fill=w,g.opacity=o.overButtonOpacity;break;case Oi.PRESSED:e.fill=S,e.stroke=o.selectedStroke,e.lineWidth=o.selectedLineWidth,e.opacity=o.selectedButtonOpacity,g.fill=w,g.opacity=o.selectedButtonOpacity;break;default:throw new Error("unsupported interactionState: "+t)}},t.link(y)};e.selfBoundsProperty.link(f),this.disposeThreeDAppearanceStrategy=()=>{e.selfBoundsProperty.unlink(f),t.hasListener(y)&&t.unlink(y),a.dispose(),h.dispose(),l.dispose(),d.dispose(),c.dispose(),u.dispose(),p.dispose()}}dispose(){this.disposeThreeDAppearanceStrategy()}},mt.register("RectangularButton",Wi);class Xi extends Wi{constructor(e){const t=(0,ae.ZP)()({soundPlayer:Mi,tandem:L.Z.REQUIRED,tandemNameSuffix:"Button"},e),i=t.listener,s=_.omit(t,["listener"]),n=new qi(s);super(n,new Ni(n),s),this.pushButtonModel=n,i&&this.addListener(i);const r=()=>{t.soundPlayer.play()};n.produceSoundEmitter.addListener(r),this.disposeRectangularPushButton=function(){n.produceSoundEmitter.removeListener(r),n.dispose()}}dispose(){super.dispose(),this.disposeRectangularPushButton()}addListener(e){this.pushButtonModel.addListener(e)}removeListener(e){this.pushButtonModel.removeListener(e)}}mt.register("RectangularPushButton",Xi);class Ki extends v.NBX{constructor(e,t,i){const s=(0,ae.ZP)()({alignChildren:Ki.CENTER,tandem:L.Z.OPTIONAL},i),n=Ft(t,s.tandem.createTandem("elements")),r=e=>{for(let i=0;ie.dispose())}}dispose(){this.disposeToggleNode(),super.dispose()}static CENTER(e){for(let t=1;tt},{value:!1,createNode:()=>i}],s)}}mt.register("BooleanToggleNode",ji);const Qi="data:audio/mpeg;base64,//swxAAABdzxBVQRADFFHaWrNxAA6lqlJJEQAExvBGPAACkboRpPkaQjfnfz5z/zvk6HfzvO//6nzn/8n8Wo50RIcE5h04AwQBAIwAHAAGGKl44UnQFxrI7b6JARZgWfzRC7X2cjUCZG/TgeAfXziIB7AOgm3/Dlw5chhj/4aoJEnxOhr/+bkURTNP+37dN///zd5/WqMcFKOhHs//syxAMACFBlQBnXgAEQCuRbvLAAMh2cNcpzMDxDOxVSMlAjYsYOAlbMUQJ8hAkSABkLAPbGhQfrk7xotjWuYO3uc9FKLMWDXX39eK91WL8a4ARAYAYFAQZg2BpmMcTuZ9zx5rwEJFAZZgjA1mC8BuLASofGAOAMhs/U/GV40k0Dkso2K6Npbban/lI2Pnd6J3///t66ABTcYocjaf/7MsQDgAX8JTutseaw6RRnNZCJDkFdpsKMGTznDUOCFN3UBmSx0M4MasPlPO6Ar07embS//T/2f27SK//YUG03dpZI2oMaBN8MJA5tI6MkldtNZgLZ+dUe9LvQy6Odv9a9cr9VPRUaBtgq9EWmz6Xj3KZTzOv1ylUAC+0kk0oAEUn+I0HZ6jICCWahweFTlrz07qq2Ls9T3N/Xljr/+zLEEgAFSBMjQWBgUI8CIvA3vAbc1Vf//uoAABTglUoQoEElDJAFw2zpqMe6sqMzu59/9uvz32/t/onv/5FMQU1FMy45OS41VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//swxC8DwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",Ji=M(F,Qi),$i=k.Z.createLock(Qi),es=new Z;let ts=!1;const is=()=>{ts||($i(),ts=!0)},ss=F.decodeAudioData(Ji.buffer,e=>{null===es.audioBufferProperty.value&&(es.audioBufferProperty.set(e),is())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),es.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),is()});ss&&ss.then(e=>{null===es.audioBufferProperty.value&&(es.audioBufferProperty.set(e),is())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),is()});const ns=new si(es,{soundClipOptions:{initialOutputLevel:.7},soundManagerOptions:{categoryName:"user-interface"}});R.register("toggleOffSoundPlayer",ns);const rs=ns,os="data:audio/mpeg;base64,//swxAAAByAnDnWRADEZkyy3M0ALJQcEAMk013znpOVkWGNCg9vD4oJlTQcNxQBIJ0PxSUlJSCwfB8Hz+CAIAN/DH/gg78EHS7//9QIJSLq/wFHg+AwFAAAAAAfFvo6+SmoCLgXFVlJaBRlrks8EfgdfwNGNDIX1icAtgSPunkTDV42yCf+OWMmXBP4hJ/+RAZg8nmowgLA3CbIw//syxAOACDxjRhnXgAEOCqVnuqAERLIypm8wTCMyMagDMoYEAyRAAgCAQ9za/ELra7bNcNI9BMVmPx3pF7P7a/wstMTOL6//gwrwjSeVKioAAkqgEBggJpjMDZgiPBm+0xy7jJ482ppET4kOhhSHhg8CKMhgGASP09uliMpAaC+Gyqiiyjd9/QiJjzxL//////p9lUBqv86UKJp6wP/7MsQEgAWgKTMsbMLwvwUmdaCI3g146KXMwJVAHDYhAjvxQKf+SIBJPJWbIrZ/1aVs/k7Lf2//7QQilFbJGkVBjWeEsADYyEamuw0dNdmGxS1qmJCrAKrGJZ+TX/V+1zX0fitWyROXKQQiijI22kTAod9keTOhUgChZfu1VSXOv2ubHdG+h4jXu2fLMV00rQvomqNH8kAAAARGFj3/+zLEGgDFrBkvoeWAcKKCYxBngBYhtAWgNUjlVDuFH+de4qlT5ENEZ7/8t7K3cKjB1Q/kmOcRTEFNRTMuOTkuNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//swxDMDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",as=M(F,os),hs=k.Z.createLock(os),ls=new Z;let ds=!1;const cs=()=>{ds||(hs(),ds=!0)},us=F.decodeAudioData(as.buffer,e=>{null===ls.audioBufferProperty.value&&(ls.audioBufferProperty.set(e),cs())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),ls.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),cs()});us&&us.then(e=>{null===ls.audioBufferProperty.value&&(ls.audioBufferProperty.set(e),cs())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),cs()});const ps=new si(ls,{soundClipOptions:{initialOutputLevel:.7},soundManagerOptions:{categoryName:"user-interface"}});R.register("toggleOnSoundPlayer",ps);const ms=ps;class gs extends ge.WZ{constructor(e){super([e.looksOverProperty,e.looksPressedProperty],(e,t)=>e&&!t?Oi.OVER:t?Oi.PRESSED:Oi.IDLE,{valueType:Oi})}}mt.register("ToggleButtonInteractionStateProperty",gs);class ys extends Zi{constructor(e,t,i,s){const n=(0,ae.ZP)()({tandem:L.Z.REQUIRED},s);super(n),this.valueOff=e,this.valueOn=t,this.valueProperty=i;const r=e=>{(this.overProperty.get()||this.focusedProperty.get())&&this.enabledProperty.get()&&!this.interrupted&&(e||this.toggle())};this.downProperty.link(r),this.toggledEmitter=new Ce.Z({tandem:n.tandem.createTandem("toggledEmitter"),phetioDocumentation:"Emits when the button is toggled",phetioEventType:Ne.Z.USER});this.toggledEmitter.addListener(()=>{this.valueProperty.value=this.valueProperty.value===this.valueOff?this.valueOn:this.valueOff}),this.disposeToggleButtonModel=()=>{this.downProperty.unlink(r),this.toggledEmitter.dispose()}}dispose(){this.disposeToggleButtonModel(),super.dispose()}toggle(){this.toggledEmitter.emit(),this.produceSoundEmitter.emit()}}mt.register("ToggleButtonModel",ys);class fs extends Wi{constructor(e,t,i,s){const n=(0,ae.ZP)()({valueOffSoundPlayer:rs,valueOnSoundPlayer:ms,tandem:L.Z.REQUIRED,tandemNameSuffix:"Button"},s),r=new ys(t,i,e,n),o=new gs(r);super(r,o,n),this.addLinkedElement(e,{tandem:n.tandem.createTandem("property")});const a=()=>{e.value===t?n.valueOffSoundPlayer.play():e.value===i&&n.valueOnSoundPlayer.play()};this.buttonModel.produceSoundEmitter.addListener(a),this.disposeRectangularToggleButton=()=>{this.buttonModel.produceSoundEmitter.removeListener(a),r.dispose()}}dispose(){this.disposeRectangularToggleButton(),super.dispose()}}mt.register("RectangularToggleButton",fs);class As extends fs{constructor(e,t,i,s){const n=new ji(e,t,i);super(e,!1,!0,(0,ae.ZP)()({content:n,tandem:L.Z.REQUIRED,tandemNameSuffix:"Button"},s)),this.disposeBooleanRectangularToggleButton=()=>{n.dispose()}}dispose(){this.disposeBooleanRectangularToggleButton(),super.dispose()}}mt.register("BooleanRectangularToggleButton",As);class bs extends As{constructor(e,t){const i=(0,ae.ZP)()({sideLength:25,stroke:"black",touchAreaXDilation:5,touchAreaYDilation:5,tandem:L.Z.REQUIRED,tandemNameSuffix:"Button"},t);i.cornerRadius=.1*i.sideLength,i.xMargin=.2*i.sideLength,i.yMargin=i.xMargin,i.buttonAppearanceStrategy=Yi.FlatAppearanceStrategy;const s=.6*i.sideLength,n={lineWidth:.15*i.sideLength,stroke:"white",centerX:i.sideLength/2,centerY:i.sideLength/2,pickable:!1},r=(new Qe.bn).moveTo(s/2,0).lineTo(s/2,s).moveTo(0,s/2).lineTo(s,s/2),o=new v.y$t(r,n),a=(new Qe.bn).moveTo(-s/2,0).lineTo(s/2,0),h=new v.y$t(a,n);super(e,h,o,i);const l=e=>{this.baseColor=e?"rgb( 255, 85, 0 )":"rgb( 0, 179, 0 )",this.setPDOMAttribute("aria-expanded",e)};e.link(l),this.disposeExpandCollapseButton=()=>{e.unlink(l)}}dispose(){this.disposeExpandCollapseButton(),super.dispose()}}mt.register("ExpandCollapseButton",bs);const Ps=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return I.Z.toFixed(e,t)};class Vs extends ne.Z{}_defineProperty(Vs,"MOUSE",new(n=Vs)),_defineProperty(Vs,"TOUCH",new n),_defineProperty(Vs,"NONE",new n),_defineProperty(Vs,"enumeration",new se.Z(n));class vs{constructor(e,t){this.sim=e,this.simDisplay=t,this.activeProperty=new O.Z(!1),this.visualTreeVisibleProperty=new S.Z(!1,{tandem:L.Z.OPT_OUT}),this.pdomTreeVisibleProperty=new S.Z(!1,{tandem:L.Z.OPT_OUT}),this.underPointerVisibleProperty=new S.Z(!0,{tandem:L.Z.OPT_OUT}),this.optionsVisibleProperty=new S.Z(!0,{tandem:L.Z.OPT_OUT}),this.previewVisibleProperty=new S.Z(!1,{tandem:L.Z.OPT_OUT}),this.selectedNodeContentVisibleProperty=new S.Z(!0,{tandem:L.Z.OPT_OUT}),this.selectedTrailContentVisibleProperty=new S.Z(!0,{tandem:L.Z.OPT_OUT}),this.highlightVisibleProperty=new S.Z(!0,{tandem:L.Z.OPT_OUT}),this.boundsVisibleProperty=new S.Z(!0,{tandem:L.Z.OPT_OUT}),this.selfBoundsVisibleProperty=new S.Z(!1,{tandem:L.Z.OPT_OUT}),this.getHelperNodeVisibleProperty=new S.Z(!0,{tandem:L.Z.OPT_OUT}),this.helperVisibleProperty=new S.Z(!0,{tandem:L.Z.OPT_OUT}),this.inputBasedPickingProperty=new S.Z(!0,{tandem:L.Z.OPT_OUT}),this.useLeafNodeProperty=new S.Z(!1,{tandem:L.Z.OPT_OUT}),this.pointerAreaTypeProperty=new Ti(Vs.MOUSE,{tandem:L.Z.OPT_OUT}),this.pointerPositionProperty=new O.Z(Ke.Z.ZERO),this.overInterfaceProperty=new S.Z(!1,{tandem:L.Z.OPT_OUT}),this.selectedTrailProperty=new O.Z(null),this.treeHoverTrailProperty=new O.Z(null),this.pointerTrailProperty=new ge.ZP([this.pointerPositionProperty,this.overInterfaceProperty,this.pointerAreaTypeProperty,this.inputBasedPickingProperty],(e,i,s,n)=>{if(i)return null;if(!n)return Ns(t.rootNode,e);let r=t.rootNode.hitTest(e,s===Vs.MOUSE,s===Vs.TOUCH);if(r&&!this.useLeafNodeProperty.value){for(;r.length>0&&0===r.lastNode().inputListeners.length;)r.removeDescendant();if(0===r.length)r=null;else{const e=r.lastNode().inputListeners[0];e instanceof v.$o8&&e.targetNode&&e.targetNode!==r.lastNode()&&r.containsNode(e.targetNode)&&(r=r.subtrailTo(e.targetNode))}}return r},{tandem:L.Z.OPT_OUT,valueComparisonStrategy:"equalsFunction"}),this.previewTrailProperty=new ge.ZP([this.selectedTrailProperty,this.treeHoverTrailProperty,this.pointerTrailProperty],(e,t,i)=>e||(t||i)),this.previewShapeProperty=new ge.ZP([this.previewTrailProperty,this.inputBasedPickingProperty,this.pointerAreaTypeProperty],(e,t,i)=>e?t?Zs(e,i===Vs.MOUSE,i===Vs.TOUCH):Zs(e,!1,!1):null),this.helperNodeProperty=new ge.ZP([this.selectedTrailProperty],e=>{if(e){const t=e.lastNode();return(e=>!!e.getHelperNode)(t)?t.getHelperNode():null}return null}),this.screenViewProperty=new O.Z(null),this.imageDataProperty=new O.Z(null),this.colorProperty=new ge.ZP([this.pointerPositionProperty,this.imageDataProperty],(e,t)=>{if(!t)return v.Ilk.TRANSPARENT;const i=Math.floor(e.x/this.simDisplay.width*t.width),s=Math.floor(e.y/this.simDisplay.height*t.height),n=4*(i+t.width*s);return i<0||s<0||i>t.width||s>t.height?v.Ilk.TRANSPARENT:new v.Ilk(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3]/255)},{tandem:L.Z.OPT_OUT});const i=new S.Z(phet.chipper.queryParameters.fuzz,{tandem:L.Z.OPT_OUT});i.lazyLink(e=>{phet.chipper.queryParameters.fuzz=e});const s=new S.Z(!1,{tandem:L.Z.OPT_OUT}),n=new O.Z({name:"view units",multiplier:0}),r=new O.Z(Le.Z.NOTHING),o=new v.NBX({renderer:"svg"}),a=new Xe(this.pointerPositionProperty,{tandem:L.Z.OPT_OUT,bidirectional:!0,map:e=>{const t=this.screenViewProperty.value;if(t){const i=t.globalToLocalPoint(e);return`global: x: ${Ps(e.x)}, y: ${Ps(e.y)}
view: x: ${Ps(i.x)}, y: ${Ps(i.y)}`}return"-"}}),h=new v.Hof(a,{font:new ht(12)}),l=new Xe(this.colorProperty,{tandem:L.Z.OPT_OUT,bidirectional:!0,map:e=>`${e.toHexString()} ${e.toCSS()}`}),d=new v.Hof(l,{font:new ht(12)});this.colorProperty.link(e=>{d.fill=v.Ilk.getLuminance(e)>128?v.Ilk.BLACK:v.Ilk.WHITE});const c=new v.Ilk("#804000"),u=new v.Ilk("#208020"),p=new v.Ilk(255,100,0),m=new v.Ilk(0,0,255),g=new v.Ilk(255,0,0),y=new v.Ilk(200,0,200),f=new ge.ZP([this.inputBasedPickingProperty,this.pointerAreaTypeProperty],(e,t)=>e?t===Vs.MOUSE?m:t===Vs.TOUCH?g:y:p,{tandem:L.Z.OPT_OUT}),A=new yt(d,{cornerRadius:0,stroke:null,fill:this.colorProperty}),b=new v.NBX({visibleProperty:this.previewVisibleProperty}),P=new v.AeJ(0,0,200,200,{fill:new v.eQt(new v.NBX({children:[new v.AeJ(0,0,10,10,{fill:"#ddd"}),new v.AeJ(10,10,10,10,{fill:"#ddd"}),new v.AeJ(0,10,10,10,{fill:"#fafafa"}),new v.AeJ(10,0,10,10,{fill:"#fafafa"})]}),2,0,0,20,20),stroke:"black",visibleProperty:this.previewVisibleProperty});this.previewTrailProperty.link(e=>{if(b.removeAllChildren(),e){b.addChild(P);const t=e.lastNode();if(t.bounds.isValid()){const e=.9*window.devicePixelRatio*Math.min(P.selfBounds.width/t.width,P.selfBounds.height/t.height);b.addChild(new v.NBX({scale:e/window.devicePixelRatio,center:P.center,children:[t.rasterized({resolution:e,sourceBounds:t.bounds.dilated(.01*t.bounds.width).roundedOut()})]}))}}});const V=new v.SHm({spacing:3,align:"left",visibleProperty:this.selectedNodeContentVisibleProperty});this.previewTrailProperty.link(e=>{V.children=e?ks(e):[]});const w=new ws(i,"Fuzz"),T=new ws(s,"Measuring Tape"),E=new ws(this.visualTreeVisibleProperty,"Visual Tree"),x=new ws(this.pdomTreeVisibleProperty,"PDOM Tree"),C=new ws(this.inputBasedPickingProperty,"Input-based"),I=new ws(this.useLeafNodeProperty,"Use Leaf",{enabledProperty:this.inputBasedPickingProperty}),D=new ws(this.highlightVisibleProperty,"Highlight",{labelOptions:{fill:f}}),k=new ws(this.boundsVisibleProperty,"Bounds",{labelOptions:{fill:c}}),M=new ws(this.selfBoundsVisibleProperty,"Self Bounds",{labelOptions:{fill:u}}),N=new ws(this.getHelperNodeVisibleProperty,"getHelperNode()"),R=new zt(this.pointerAreaTypeProperty,[{value:Vs.MOUSE,createNode:e=>new v.xvT("Mouse",{fontSize:12})},{value:Vs.TOUCH,createNode:e=>new v.xvT("Touch",{fontSize:12})},{value:Vs.NONE,createNode:e=>new v.xvT("None",{fontSize:12})}],{orientation:"horizontal",enabledProperty:this.inputBasedPickingProperty,radioButtonOptions:{xSpacing:3},spacing:10,tandem:L.Z.OPT_OUT}),B=new v.SHm({align:"left",visibleProperty:this.selectedTrailContentVisibleProperty});this.previewTrailProperty.link(e=>{if(B.children=[],e){e.nodes.slice().forEach((t,i)=>{B.addChild(new v.Hof(`${i>0?e.nodes[i-1].children.indexOf(t):"-"} ${t.constructor.name}`,{font:new ht(12),fill:i===e.nodes.length-1?"black":"#bbb",layoutOptions:{leftMargin:10*i},cursor:"pointer",inputListeners:[new v.eMb({fire:()=>{this.selectedTrailProperty.value=e.subtrailTo(t),F()},tandem:L.Z.OPT_OUT})]}))}),e.lastNode().children.forEach((t,i)=>{B.addChild(new v.Hof(`${e.lastNode().children.indexOf(t)} ${t.constructor.name}`,{font:new ht(12),fill:"#88f",layoutOptions:{leftMargin:10*e.nodes.length},cursor:"pointer",inputListeners:[new v.eMb({fire:()=>{this.selectedTrailProperty.value=e.copy().addDescendant(t,i),F()},tandem:L.Z.OPT_OUT})]}))}),e.isVisible()||B.addChild(new v.xvT("invisible",{fill:"#60a",fontSize:12})),1!==e.getOpacity()&&B.addChild(new v.xvT("opacity: "+e.getOpacity(),{fill:"#888",fontSize:12}));const t=_.some(e.nodes,e=>!1===e.pickable||!e.visible),i=_.some(e.nodes,e=>e.inputListeners.length>0||!0===e.pickable);!t&&i&&B.addChild(new v.xvT("Hit Tested",{fill:"#f00",fontSize:12})),e.getMatrix().isIdentity()||B.addChild(new v.NBX({children:[new Is(e.getMatrix())]}))}});const Z=new _s(this.visualTreeVisibleProperty,this,()=>new Ts(new v.Qn1(t.rootNode),this)),q=new _s(this.pdomTreeVisibleProperty,this,()=>new Es(t._rootPDOMInstance,this)),F=()=>{Z.focusSelected(),q.focusSelected()},H=new v.y$t(null,{visibleProperty:this.boundsVisibleProperty,stroke:c,fill:c.withAlpha(.1),lineDash:[2,2],lineDashOffset:2});this.previewTrailProperty.link(e=>{e&&e.lastNode().localBounds.isValid()?H.shape=Qe.bn.bounds(e.lastNode().localBounds).transformed(e.getMatrix()):H.shape=null});const z=new v.y$t(null,{visibleProperty:this.selfBoundsVisibleProperty,stroke:u,fill:u.withAlpha(.1),lineDash:[2,2],lineDashOffset:1});this.previewTrailProperty.link(e=>{e&&e.lastNode().selfBounds.isValid()?z.shape=Qe.bn.bounds(e.lastNode().selfBounds).transformed(e.getMatrix()):z.shape=null});const Y=new ge.ZP([f],e=>e.withAlpha(.2),{tandem:L.Z.OPT_OUT}),G=new v.y$t(null,{stroke:f,lineDash:[2,2],fill:Y,visibleProperty:this.highlightVisibleProperty});this.previewShapeProperty.link(e=>{G.shape=e});const W=new v.NBX({visibleProperty:this.getHelperNodeVisibleProperty});this.selectedTrailProperty.link(e=>{e&&(W.matrix=e.getMatrix())}),this.helperNodeProperty.link(e=>{W.removeAllChildren(),e&&W.addChild(e)}),o.addChild(H),o.addChild(z),o.addChild(G);const U=new v.NBX;U.addInputListener(new v.$o8({press:()=>{this.selectedTrailProperty.value=this.pointerTrailProperty.value,F()},tandem:L.Z.OPT_OUT})),o.addChild(U),o.addChild(W);const X=new v.N52({orientation:"vertical",spacing:5,align:"left",children:[h,A],visibleProperty:this.underPointerVisibleProperty}),K=new v.SHm({spacing:3,align:"left",children:[xs("Tools"),new v.SHm({spacing:3,align:"left",children:[new v.BET({spacing:10,children:[w,T]}),new v.BET({spacing:10,children:[E,...t._accessible?[x]:[]]})]}),xs("Picking",void 0,{layoutOptions:{topMargin:3}}),new v.SHm({spacing:3,align:"left",children:[new v.BET({spacing:10,children:[C,I]}),R]}),xs("Show",void 0,{layoutOptions:{topMargin:3}}),new v.SHm({spacing:3,align:"left",children:[new v.BET({spacing:10,children:[D,N]}),new v.BET({spacing:10,children:[k,M]})]})],visibleProperty:this.optionsVisibleProperty}),j=new v.SHm({spacing:5,align:"left",children:[Cs("Under Pointer",this.underPointerVisibleProperty,X,{layoutOptions:{topMargin:0}}),X,Cs("Options",this.optionsVisibleProperty,K),K,Cs("Preview",this.previewVisibleProperty,b),b,Cs("Selected Trail",this.selectedTrailContentVisibleProperty,B),B,Cs("Selected Node",this.selectedNodeContentVisibleProperty,V),V],visibleProperty:this.helperVisibleProperty}),Q=new v.SHm({spacing:5,align:"left",children:[Cs("Helper",this.helperVisibleProperty,j),new v.qYj,j]}),J=new yt(Q,{fill:"rgba(255,255,255,0.85)",stroke:"rgba(0,0,0,0.85)",cornerRadius:0});J.addInputListener(new v._U3({translateNode:!0,targetNode:J,tandem:L.Z.OPT_OUT})),J.addInputListener({wheel:e=>{const t=e.domEvent.deltaY;J.y-=1*t}}),o.addChild(J),o.addChild(Z),o.addChild(q);const $=new pt(n,{visibleProperty:s,textBackgroundColor:"rgba(0,0,0,0.5)"});$.basePositionProperty.value=new Ke.Z(100,300),$.tipPositionProperty.value=new Ke.Z(200,300),o.addChild($);const ee=e=>{this.helperDisplay.width=e.width,this.helperDisplay.height=e.height,r.value=r.value.withMaxX(e.width).withMaxY(e.height),U.mouseArea=new Le.Z(0,0,e.width,e.height),U.touchArea=new Le.Z(0,0,e.width,e.height),Z.resize(e),q.resize(e)},te=e=>{var t;this.overInterfaceProperty.value=J.bounds.containsPoint(this.pointerPositionProperty.value)||this.visualTreeVisibleProperty.value&&Z.bounds.containsPoint(this.pointerPositionProperty.value)||this.pdomTreeVisibleProperty.value&&q.bounds.containsPoint(this.pointerPositionProperty.value)||W.containsPoint(this.pointerPositionProperty.value),null===(t=this.helperDisplay)||void 0===t||t.updateDisplay()};document.addEventListener("keyup",e=>{"Escape"===e.key&&(this.selectedTrailProperty.value=null)}),this.activeProperty.lazyLink(t=>{if(t){e.activeProperty.value=!1;const t=e.selectedScreenProperty.value;t.hasView()?this.screenViewProperty.value=t.view:this.screenViewProperty.value=null,this.helperDisplay=new v.sSl(o,{assumeFullWindow:!0}),this.helperDisplay.initializeEvents(),e.dimensionProperty.link(ee),xe.Z.addListener(te),document.body.appendChild(this.helperDisplay.domElement),this.helperDisplay.domElement.style.zIndex="10000";const i=e=>{this.pointerPositionProperty.value=e.pointer.point};this.helperDisplay.addInputListener({move:i,down:i,up:i}),this.screenViewProperty.value&&(n.value={name:"view units",multiplier:this.screenViewProperty.value.getGlobalToLocalMatrix().getScaleVector().x}),this.simDisplay.foreignObjectRasterization(e=>{if(e){const t=document.createElement("img");t.addEventListener("load",()=>{const e=t.width,i=t.height,s=document.createElement("canvas"),n=s.getContext("2d");s.width=e,s.height=i,n.drawImage(t,0,0),this.activeProperty.value&&(this.imageDataProperty.value=n.getImageData(0,0,e,i))}),t.src=e}else console.log("Could not load foreign object rasterization")})}else e.dimensionProperty.unlink(ee),xe.Z.removeListener(te),document.body.removeChild(this.helperDisplay.domElement),this.helperDisplay.dispose(),e.activeProperty.value=!0,this.imageDataProperty.value=null,this.visualTreeVisibleProperty.value=!1})}static initialize(e,t){document.addEventListener("keydown",i=>{i.ctrlKey&&"H"===i.key&&(vs.helper||(vs.helper=new vs(e,t)),vs.helper.activeProperty.value=!vs.helper.activeProperty.value)})}}T.Z.register("Helper",vs);class ws extends Pi{constructor(e,t,i){const s=(0,ae.ZP)()({tandem:L.Z.OPT_OUT,boxWidth:14,labelOptions:{font:new ht(12)}},i);super(e,new v.Hof(t,s.labelOptions),s)}}class Ss extends v.NBX{constructor(e,t){const i=(0,ae.ZP)()({createChildren:()=>[],spacing:0,indent:5},t);super({excludeInvisibleChildrenFromBounds:!0}),this.selfNode=e,this.selfNode.centerY=0,this.expandedProperty=new O.Z(!0),this.childTreeNodes=(0,de.Z)({elements:i.createChildren()});const s=(new Qe.bn).moveToPoint(Ke.Z.createPolar(4.8,3/4*Math.PI).plusXY(1.5,0)).lineTo(1.5,0).lineToPoint(Ke.Z.createPolar(4.8,5/4*Math.PI).plusXY(1.5,0));this.expandCollapseButton=new v.AeJ(-6,-6,12,12,{children:[new v.y$t(s,{stroke:"#888",lineCap:"round",lineWidth:1.5})],visible:!1,cursor:"pointer",right:0}),this.expandedProperty.link(e=>{this.expandCollapseButton.rotation=e?Math.PI/2:0}),this.expandCollapseButton.addInputListener(new v.eMb({fire:()=>{this.expandedProperty.value=!this.expandedProperty.value},tandem:L.Z.OPT_OUT})),this.addChild(this.expandCollapseButton),this.childContainer=new v.N52({orientation:"vertical",align:"left",spacing:i.spacing,children:this.childTreeNodes,x:i.indent,y:this.selfNode.bottom+i.spacing,visibleProperty:this.expandedProperty}),this.addChild(this.childContainer),this.addChild(e);const n=()=>{this.childContainer.children=this.childTreeNodes,this.expandCollapseButton.visible=this.childTreeNodes.length>0};this.childTreeNodes.addItemAddedListener(()=>{n()}),this.childTreeNodes.addItemRemovedListener(()=>{n()}),n(),this.mutate(i)}expand(){this.expandedProperty.value=!0}collapse(){this.expandedProperty.value=!1}expandRecusively(){this.expandedProperty.value=!0,this.childTreeNodes.forEach(e=>{e.expandRecusively()})}collapseRecursively(){this.expandedProperty.value=!1,this.childTreeNodes.forEach(e=>{e.collapseRecursively()})}}class Ts extends Ss{constructor(e,t){const i=e.lastNode(),s=e.isVisible(),n=new v.Zxw({size:12}),r=new v.BET({spacing:5}),o=i.constructor.name;o&&r.addChild(new v.xvT(o,{font:n,pickable:!1,fill:s?"#000":"#60a"})),i instanceof v.xvT&&r.addChild(new v.xvT('"'+i.text+'"',{font:n,pickable:!1,fill:"#666"}));const a=v.AeJ.bounds(r.bounds,{children:[r],cursor:"pointer",fill:new ge.ZP([t.selectedTrailProperty,t.pointerTrailProperty],(t,i)=>t&&e.equals(t)?"rgba(0,128,255,0.4)":i&&e.equals(i)?"rgba(0,128,255,0.2)":"transparent",{tandem:L.Z.OPT_OUT})});a.addInputListener({enter:()=>{t.treeHoverTrailProperty.value=e},exit:()=>{t.treeHoverTrailProperty.value=null}}),a.addInputListener(new v.eMb({fire:()=>{t.selectedTrailProperty.value=e},tandem:L.Z.OPT_OUT})),super(a,{createChildren:()=>e.lastNode().children.map(i=>new Ts(e.copy().addDescendant(i),t))}),i.visible||(this.expandedProperty.value=!1),this.trail=e}find(e){if(e.equals(this.trail))return this;{const t=_.find(this.childTreeNodes,t=>e.isExtensionOf(t.trail,!0));return t?t.find(e):null}}}class Es extends Ss{constructor(e,t){const i=e.trail,s=i.isPDOMVisible(),n=new v.Zxw({size:12}),r=new v.BET({spacing:5});if(i.nodes.length){const t=s?"#000":"#60a",o=i.lastNode();o.tagName&&r.addChild(new v.xvT(o.tagName,{font:new v.Zxw({size:12,weight:"bold"}),fill:t})),o.labelContent&&r.addChild(new v.xvT(o.labelContent,{font:n,fill:"#800"})),o.innerContent&&r.addChild(new v.xvT(o.innerContent,{font:n,fill:"#080"})),o.descriptionContent&&r.addChild(new v.xvT(o.descriptionContent,{font:n,fill:"#444"}));const a=e.parent?e.parent.trail:new v.Qn1,h=i.nodes.slice(a.nodes.length).map(e=>e.constructor.name).filter(e=>"Node"!==e).join(",");h&&r.addChild(new v.xvT(`(${h})`,{font:n,fill:"#008"}))}else r.addChild(new v.xvT("(root)",{font:n}));const o=v.AeJ.bounds(r.bounds,{children:[r],cursor:"pointer",fill:new ge.ZP([t.selectedTrailProperty,t.pointerTrailProperty],(e,t)=>e&&i.equals(e)?"rgba(0,128,255,0.4)":t&&i.equals(t)?"rgba(0,128,255,0.2)":"transparent",{tandem:L.Z.OPT_OUT})});i.length&&(o.addInputListener({enter:()=>{t.treeHoverTrailProperty.value=i},exit:()=>{t.treeHoverTrailProperty.value=null}}),o.addInputListener(new v.eMb({fire:()=>{t.selectedTrailProperty.value=i},tandem:L.Z.OPT_OUT}))),super(o,{createChildren:()=>e.children.map(e=>new Es(e,t))}),this.instance=e,this.trail=i}find(e){if(e.equals(this.instance.trail))return this;{const t=_.find(this.childTreeNodes,t=>e.isExtensionOf(t.instance.trail,!0));return t?t.find(e):null}}}class _s extends v.AeJ{constructor(e,t,i){super({fill:"rgba(255,255,255,0.85)",stroke:"black",rectWidth:400,visibleProperty:e,pickable:!0}),this.helper=t,this.treeContainer=new v.NBX,this.addChild(this.treeContainer),this.addInputListener(new v._U3({targetNode:this,drag:(e,t)=>{this.x=this.x+t.modelDelta.x},tandem:L.Z.OPT_OUT})),this.addInputListener({wheel:e=>{const t=e.domEvent.deltaX,i=e.domEvent.deltaY;this.treeNode&&(this.treeNode.x-=1*t,this.treeNode.y-=1*i),this.constrainTree()}}),t.pointerTrailProperty.lazyLink(()=>{t.selectedTrailProperty.value||this.focusPointer()}),he.Z.multilink([t.activeProperty,e],(e,t)=>{e&&t?(this.treeNode=i(),this.treeNode.x=500,this.treeNode.y=500,this.treeContainer.children=[this.treeNode],this.focusSelected(),this.constrainTree()):this.treeContainer.children=[]})}resize(e){this.rectHeight=e.height,this.right=e.width,this.treeContainer.clipArea=Qe.bn.bounds(this.localBounds.dilated(10))}constrainTree(){this.treeNode&&(this.treeNode.bottomthis.selfBounds.top+5&&(this.treeNode.top=this.selfBounds.top+5),this.treeNode.rightthis.selfBounds.left+8&&(this.treeNode.left=this.selfBounds.left+8))}focusTrail(e){if(this.treeNode){const t=this.treeNode.find(e);if(t){const e=t.localToGlobalPoint(t.selfNode.center).y-this.centerY;this.treeNode.y-=e,this.constrainTree()}}}focusPointer(){this.helper.pointerTrailProperty.value&&this.focusTrail(this.helper.pointerTrailProperty.value)}focusSelected(){null!==this.helper.selectedTrailProperty.value&&this.focusTrail(this.helper.selectedTrailProperty.value)}}const xs=(e,t,i)=>new v.xvT(e,(0,Se.Z)({fontSize:14,fontWeight:"bold",visibleProperty:t?new ge.ZP([t.boundsProperty],e=>!e.isEmpty()):new O.Z(!0)},i)),Cs=(e,t,i,s)=>{const n=xs(e,i,s);return n.addInputListener(new v.eMb({fire:()=>{t.value=!t.value},tandem:L.Z.OPT_OUT})),n.cursor="pointer",new v.BET({spacing:7,children:[new bs(t,{tandem:L.Z.OPT_OUT,sideLength:14}),n],visibleProperty:n.visibleProperty})};class Is extends v.zch{constructor(e){super({xSpacing:5,ySpacing:0,children:[new v.xvT(e.m00(),{layoutOptions:{column:0,row:0}}),new v.xvT(e.m01(),{layoutOptions:{column:1,row:0}}),new v.xvT(e.m02(),{layoutOptions:{column:2,row:0}}),new v.xvT(e.m10(),{layoutOptions:{column:0,row:1}}),new v.xvT(e.m11(),{layoutOptions:{column:1,row:1}}),new v.xvT(e.m12(),{layoutOptions:{column:2,row:1}}),new v.xvT(e.m20(),{layoutOptions:{column:0,row:2}}),new v.xvT(e.m21(),{layoutOptions:{column:1,row:2}}),new v.xvT(e.m22(),{layoutOptions:{column:2,row:2}})]})}}class Ds extends v.y$t{constructor(e){super(e,{maxWidth:15,maxHeight:15,stroke:"black",cursor:"pointer",strokePickable:!0}),this.addInputListener(new v.eMb({fire:()=>Rs(e.getSVGPath()),tandem:L.Z.OPT_OUT}))}}class Ls extends v.Eep{constructor(e){super(e.getImage(),{maxWidth:15,maxHeight:15})}}const ks=e=>{const t=[],i=e.lastNode(),s=(0,vi.Z)(i.constructor).map(e=>e.name).filter(e=>e&&"Object"!==e),n=s.includes("Node")?s.slice(0,s.indexOf("Node")):s;n.length>0&&t.push(new v.Hof(n.map((e,t)=>0===t?`${e}`:`
${_.repeat(" ",t)}extends ${e}`).join(""),{font:new ht(12)}));const r=(e,i)=>{t.push(new v.BET({spacing:0,align:"top",children:[new v.xvT(e+": ",{fontSize:12}),i]}))},o=(e,t)=>{void 0!==t&&r(e,new v.Hof(""+t,{lineWrap:400,font:new ht(12),cursor:"pointer",inputListeners:[new v.eMb({fire:()=>Rs(""+t),tandem:L.Z.OPT_OUT})]}))},a=e=>new v.BET({spacing:4,children:[new v.AeJ(0,0,10,10,{fill:e,stroke:"black",lineWidth:.5}),new v.xvT(e.toHexString(),{fontSize:12}),new v.xvT(e.toCSS(),{fontSize:12})],cursor:"pointer",inputListeners:[new v.eMb({fire:()=>Rs(e.toHexString()),tandem:L.Z.OPT_OUT})]}),h=(e,t)=>{const i=e=>new v.BET({spacing:3,children:[new v.xvT(e.ratio,{fontSize:12}),a(Ms(e.color)||v.Ilk.TRANSPARENT)]});t instanceof v.wGU?t instanceof v.oas?r(e,new v.SHm({align:"left",spacing:3,children:[new v.xvT(`LinearGradient (${t.start.x},${t.start.y}) => (${t.end.x},${t.end.y})`,{fontSize:12}),...t.stops.map(i)]})):t instanceof v.XMe?r(e,new v.SHm({align:"left",spacing:3,children:[new v.xvT(`RadialGradient (${t.start.x},${t.start.y}) ${t.startRadius} => (${t.end.x},${t.end.y}) ${t.endRadius}`,{fontSize:12}),...t.stops.map(i)]})):t instanceof v.cfY&&r(e,new v.SHm({align:"left",spacing:3,children:[new v.xvT("Pattern",{fontSize:12}),new v.Eep(t.image,{maxWidth:10,maxHeight:10})]})):((e,t)=>{const i=Ms(t);null!==i&&r(e,a(i))})(e,t)},l=(e,t)=>{t.equals(Le.Z.NOTHING)||(t.equals(Le.Z.EVERYTHING)?o(e,"everything"):r(e,new v.Hof(`x: [${t.minX}, ${t.maxX}]
y: [${t.minY}, ${t.maxY}]`,{font:new ht(12)})))},d=(e,t)=>r(e,new Ds(t));return i.tandem.supplied&&o("tandem",i.tandem.phetioID.split(".").join(" ")),i instanceof v.SOl&&o("element",i.element.constructor.name),(0,v.AXx)(i)&&(!i.widthSizable&&o("widthSizable",i.widthSizable),null!==i.preferredWidth&&o("preferredWidth",i.preferredWidth),i.preferredWidth!==i.localPreferredWidth&&o("localPreferredWidth",i.localPreferredWidth),null!==i.minimumWidth&&o("minimumWidth",i.minimumWidth),i.minimumWidth!==i.localMinimumWidth&&o("localMinimumWidth",i.localMinimumWidth)),(0,v.cWU)(i)&&(!i.heightSizable&&o("heightSizable",i.heightSizable),null!==i.preferredHeight&&o("preferredHeight",i.preferredHeight),i.preferredHeight!==i.localPreferredHeight&&o("localPreferredHeight",i.localPreferredHeight),null!==i.minimumHeight&&o("minimumHeight",i.minimumHeight),i.minimumHeight!==i.localMinimumHeight&&o("localMinimumHeight",i.localMinimumHeight)),i.layoutOptions&&o("layoutOptions",JSON.stringify(i.layoutOptions,null,2)),i instanceof v.BjU&&(!i.resize&&o("resize",i.resize),!i.layoutOrigin.equals(Ke.Z.ZERO)&&o("layoutOrigin",i.layoutOrigin)),i instanceof v.N52&&(o("orientation",i.orientation),o("align",i.align),i.spacing&&o("spacing",i.spacing),i.lineSpacing&&o("lineSpacing",i.lineSpacing),o("justify",i.justify),i.justifyLines&&o("justifyLines",i.justifyLines),i.wrap&&o("wrap",i.wrap),i.stretch&&o("stretch",i.stretch),i.grow&&o("grow",i.grow),i.leftMargin&&o("leftMargin",i.leftMargin),i.rightMargin&&o("rightMargin",i.rightMargin),i.topMargin&&o("topMargin",i.topMargin),i.bottomMargin&&o("bottomMargin",i.bottomMargin),null!==i.minContentWidth&&o("minContentWidth",i.minContentWidth),null!==i.minContentHeight&&o("minContentHeight",i.minContentHeight),null!==i.maxContentWidth&&o("maxContentWidth",i.maxContentWidth),null!==i.maxContentHeight&&o("maxContentHeight",i.maxContentHeight)),i instanceof v.zch&&(o("xAlign",i.xAlign),o("yAlign",i.yAlign),i.xSpacing&&o("xSpacing",i.xSpacing),i.ySpacing&&o("ySpacing",i.ySpacing),i.xStretch&&o("xStretch",i.xStretch),i.yStretch&&o("yStretch",i.yStretch),i.xGrow&&o("xGrow",i.xGrow),i.yGrow&&o("yGrow",i.yGrow),i.leftMargin&&o("leftMargin",i.leftMargin),i.rightMargin&&o("rightMargin",i.rightMargin),i.topMargin&&o("topMargin",i.topMargin),i.bottomMargin&&o("bottomMargin",i.bottomMargin),null!==i.minContentWidth&&o("minContentWidth",i.minContentWidth),null!==i.minContentHeight&&o("minContentHeight",i.minContentHeight),null!==i.maxContentWidth&&o("maxContentWidth",i.maxContentWidth),null!==i.maxContentHeight&&o("maxContentHeight",i.maxContentHeight)),i instanceof v.AeJ&&(l("rectBounds",i.rectBounds),(i.cornerXRadius||i.cornerYRadius)&&(i.cornerXRadius===i.cornerYRadius?o("cornerRadius",i.cornerRadius):(o("cornerXRadius",i.cornerXRadius),o("cornerYRadius",i.cornerYRadius)))),i instanceof v.x12&&(o("x1",i.x1),o("y1",i.y1),o("x2",i.x2),o("y2",i.y2)),i instanceof v.Cdc&&o("radius",i.radius),i instanceof v.xvT&&(o("text",i.text),o("font",i.font),"hybrid"!==i.boundsMethod&&o("boundsMethod",i.boundsMethod)),i instanceof v.Hof&&(o("text",i.string),o("font",i.font instanceof v.Zxw?i.font.getFont():i.font),h("fill",i.fill),h("stroke",i.stroke),"hybrid"!==i.boundsMethod&&o("boundsMethod",i.boundsMethod),null!==i.lineWrap&&o("lineWrap",i.lineWrap)),i instanceof v.Eep&&(r("image",new Ls(i)),o("imageWidth",i.imageWidth),o("imageHeight",i.imageHeight),1!==i.imageOpacity&&o("imageOpacity",i.imageOpacity),i.imageBounds&&l("imageBounds",i.imageBounds),i.initialWidth&&o("initialWidth",i.initialWidth),i.initialHeight&&o("initialHeight",i.initialHeight),i.hitTestPixels&&o("hitTestPixels",i.hitTestPixels)),(i instanceof v.mxV||i instanceof v.HDe)&&l("canvasBounds",i.canvasBounds),i instanceof v.y$t&&(i.shape&&d("shape",i.shape),"accurate"!==i.boundsMethod&&o("boundsMethod",i.boundsMethod)),(i instanceof v.y$t||i instanceof v.xvT)&&(h("fill",i.fill),h("stroke",i.stroke),i.lineDash.length&&o("lineDash",i.lineDash),i.fillPickable||o("fillPickable",i.fillPickable),i.strokePickable&&o("strokePickable",i.strokePickable),1!==i.lineWidth&&o("lineWidth",i.lineWidth),"butt"!==i.lineCap&&o("lineCap",i.lineCap),"miter"!==i.lineJoin&&o("lineJoin",i.lineJoin),0!==i.lineDashOffset&&o("lineDashOffset",i.lineDashOffset),10!==i.miterLimit&&o("miterLimit",i.miterLimit)),i.tagName&&o("tagName",i.tagName),i.accessibleName&&o("accessibleName",i.accessibleName),i.helpText&&o("helpText",i.helpText),i.pdomHeading&&o("pdomHeading",i.pdomHeading),i.containerTagName&&o("containerTagName",i.containerTagName),i.containerAriaRole&&o("containerAriaRole",i.containerAriaRole),i.innerContent&&o("innerContent",i.innerContent),i.inputType&&o("inputType",i.inputType),i.inputValue&&o("inputValue",i.inputValue),i.pdomNamespace&&o("pdomNamespace",i.pdomNamespace),i.ariaLabel&&o("ariaLabel",i.ariaLabel),i.ariaRole&&o("ariaRole",i.ariaRole),i.ariaValueText&&o("ariaValueText",i.ariaValueText),i.labelTagName&&o("labelTagName",i.labelTagName),i.labelContent&&o("labelContent",i.labelContent),i.appendLabel&&o("appendLabel",i.appendLabel),i.descriptionTagName&&o("descriptionTagName",i.descriptionTagName),i.descriptionContent&&o("descriptionContent",i.descriptionContent),i.appendDescription&&o("appendDescription",i.appendDescription),i.pdomVisible||o("pdomVisible",i.pdomVisible),i.pdomOrder&&o("pdomOrder",i.pdomOrder.map(e=>null===e?"null":e.constructor.name)),i.visible||o("visible",i.visible),1!==i.opacity&&((e,t)=>{o(e,t)})("opacity",i.opacity),null!==i.pickable&&o("pickable",i.pickable),i.enabled||o("enabled",i.enabled),i.inputEnabled||o("inputEnabled",i.inputEnabled),null!==i.cursor&&o("cursor",i.cursor),i.transformBounds&&o("transformBounds",i.transformBounds),i.renderer&&o("renderer",i.renderer),i.usesOpacity&&o("usesOpacity",i.usesOpacity),i.layerSplit&&o("layerSplit",i.layerSplit),i.cssTransform&&o("cssTransform",i.cssTransform),i.excludeInvisible&&o("excludeInvisible",i.excludeInvisible),i.preventFit&&o("preventFit",i.preventFit),null!==i.webglScale&&o("webglScale",i.webglScale),i.matrix.isIdentity()||((e,t)=>{r(e,new Is(t))})("matrix",i.matrix),null!==i.maxWidth&&o("maxWidth",i.maxWidth),null!==i.maxHeight&&o("maxHeight",i.maxHeight),null!==i.clipArea&&d("clipArea",i.clipArea),null!==i.mouseArea&&(i.mouseArea instanceof Le.Z?l("mouseArea",i.mouseArea):d("mouseArea",i.mouseArea)),null!==i.touchArea&&(i.touchArea instanceof Le.Z?l("touchArea",i.touchArea):d("touchArea",i.touchArea)),i.inputListeners.length&&o("inputListeners",i.inputListeners.map(e=>e.constructor.name).join(", ")),t.push(new v.LZC(5,5)),l("localBounds",i.localBounds),i.localBoundsOverridden&&o("localBoundsOverridden",i.localBoundsOverridden),l("bounds",i.bounds),isFinite(i.width)&&o("width",i.width),isFinite(i.height)&&o("height",i.height),t.push(new Xi({content:new v.xvT("Copy Path",{fontSize:12}),listener:()=>Rs("phet.joist.display.rootNode"+e.indices.map(e=>`.children[ ${e} ]`).join("")),tandem:L.Z.OPT_OUT})),t},Ms=e=>{const t=e instanceof wi.Z||e instanceof O.Z?e.value:e;return null===t?null:v.Ilk.toColor(t)},Os=e=>{if(e instanceof v.wGU)return!0;{const t=Ms(e);return!!t&&t.alpha>0}},Ns=(e,t)=>{if(!e.visible)return null;const i=e._transform.getInverse().timesVector2(t),s=e.clipArea;if(null!==s&&!s.containsPoint(i))return null;for(let n=e._children.length-1;n>=0;n--){const t=e._children[n],s=Ns(t,i);if(s)return s.addAncestor(e,n)}if(e.selfBounds.containsPoint(i))if(e instanceof v.y$t&&e.hasShape()){if(Os(e.fill)&&e.getShape().containsPoint(i))return new v.Qn1(e);if(Os(e.stroke)&&e.getStrokedShape().containsPoint(i))return new v.Qn1(e)}else if(e.containsPointSelf(i))return new v.Qn1(e);return null},Rs=async e=>{var t;await(null===(t=navigator.clipboard)||void 0===t?void 0:t.writeText(e))},Bs=(e,t,i)=>{let s=Qe.bn.union([...t&&e.mouseArea?[e.mouseArea instanceof Qe.bn?e.mouseArea:Qe.bn.bounds(e.mouseArea)]:[],...i&&e.touchArea?[e.touchArea instanceof Qe.bn?e.touchArea:Qe.bn.bounds(e.touchArea)]:[],e.getSelfShape(),...e.children.filter(e=>e.visible&&!1!==e.pickable).map(e=>Bs(e,t,i).transformed(e.matrix))].filter(e=>e.bounds.isValid()));return e.hasClipArea()&&(s=s.shapeIntersection(e.clipArea)),s},Zs=(e,t,i)=>{let s=Bs(e.lastNode(),t,i);for(let n=e.nodes.length-1;n>=0;n--){const t=e.nodes[n];t.hasClipArea()&&(s=s.shapeIntersection(t.clipArea)),s=s.transformed(t.matrix)}return s};var qs=i(1685);class Fs extends v.NBX{constructor(e,t){const i=(0,ae.ZP)()({keyFill:"white",keyShadowFill:"black",lineWidth:1.3,cornerRadius:2,xShadowOffset:1.7,yShadowOffset:1.7,xMargin:0,yMargin:0,xAlign:"center",yAlign:"center",xPadding:4,yPadding:4,keyHeight:23,minKeyWidth:23,forceSquareKey:!1},t),s=new v.NBX({children:[e]}),n=new v.NBX({children:[s]}),r=new v.DbO(n,{xAlign:i.xAlign,yAlign:i.yAlign,xMargin:i.xMargin,yMargin:i.yMargin}),o=new v.AeJ(0,0,1,1,i.cornerRadius,i.cornerRadius,{fill:i.keyShadowFill}),a=new v.AeJ(0,0,1,1,i.cornerRadius,i.cornerRadius,{fill:i.keyFill,stroke:"black",lineWidth:i.lineWidth});e.boundsProperty.link(()=>{let t=1;const h=i.keyHeight-i.yPadding;e.height>h&&(t=h/e.height),s.setScaleMagnitude(t);let l=Math.max(i.minKeyWidth,s.width+i.xPadding);if(i.forceSquareKey){const t=i.minKeyWidth-i.xPadding;let s=1;e.width>t&&(s=t/e.width),l=i.keyHeight,n.setScaleMagnitude(s)}r.setAlignBounds(new Le.Z(0,0,l,i.keyHeight)),o.setRectBounds(r.bounds.shiftedXY(i.xShadowOffset,i.yShadowOffset)),a.setRectBounds(r.bounds)}),i.children=[o,a,r],super(i)}}Be.register("KeyNode",Fs);class Hs extends Fs{constructor(e,t){const i=(0,ae.ZP)()({font:new ht({size:16}),fill:"black",textMaxWidth:55,xPadding:11,disposeEmitter:new qs.Z},t);super(new v.Hof(e,{font:i.font,fill:i.fill,maxWidth:i.textMaxWidth,disposer:i.disposeEmitter}),i)}static getAltKeyString(){return Me.Z.mac?ct.key.optionStringProperty:ct.key.altStringProperty}static altOrOption(e){return new Hs(Hs.getAltKeyString(),e)}static capsLock(e){return new Hs(ct.key.capsLockStringProperty,e)}static esc(e){return new Hs(ct.key.escStringProperty,e)}static end(e){return new Hs(ct.key.endStringProperty,e)}static enter(e){return new Hs(ct.key.enterStringProperty,e)}static fn(e){return new Hs(ct.key.fnStringProperty,e)}static home(e){return new Hs(ct.key.homeStringProperty,e)}static pageDown(e){return new Hs(ct.key.pageDownStringProperty,e)}static pageUp(e){return new Hs(ct.key.pageUpStringProperty,e)}static space(e){return new Hs(ct.key.spaceStringProperty,e)}static shift(e){return new Hs(ct.key.shiftStringProperty,e)}static tab(e){return new Hs(ct.key.tabStringProperty,e)}}Be.register("TextKeyNode",Hs);class zs extends Qe.bn{constructor(e){super();const t=e.width/2-e.height/2,i=e.width/2+e.height/2;this.moveTo(t,0).lineTo(i,0).lineTo(i,t).lineTo(e.width,t).lineTo(e.width,i).lineTo(i,i).lineTo(i,e.width).lineTo(t,e.width).lineTo(t,i).lineTo(0,i).lineTo(0,t).lineTo(t,t).close()}}Be.register("PlusShape",zs);const Ys=new ke.Z(20,5);class Gs extends v.y$t{constructor(e){const t=(0,ae.ZP)()({size:Ys,fill:"black"},e);super(new zs(t.size),t)}}Be.register("PlusNode",Gs);const Ws=.6*Math.sqrt(3)*10,Us={up:0,down:Math.PI,left:-Math.PI/2,right:Math.PI/2};class Xs extends Fs{constructor(e,t){const i=(0,ae.ZP)()({arrowFill:"black",arrowStroke:"black",arrowLineJoin:"round",arrowLineWidth:3,arrowHeight:10,arrowWidth:Ws,yPadding:13,forceSquareKey:!0},t),s=i.arrowHeight,n=i.arrowWidth,r=i.arrowLineJoin,o=i.arrowLineWidth,a=i.arrowFill,h=i.arrowStroke,l=new Qe.bn;l.moveTo(s/2,0).lineTo(s,n+0).lineTo(0,n+0).close(),super(new v.y$t(l,{fill:a,stroke:h,lineJoin:r,lineWidth:o,rotation:Us[e]}),i)}}Be.register("ArrowKeyNode",Xs);class Ks extends Hs{constructor(e,t){super(e,(0,ae.ZP)()({xPadding:5,forceSquareKey:!0},t))}}Be.register("LetterKeyNode",Ks);const js=new ht(16);class Qs{constructor(){}static iconRow(e,t){const i=(0,ae.ZP)()({spacing:1.3,children:e},t);return new v.BET(i)}static iconOrIcon(e,t,i){const s=(0,ae.JA)({spacing:Qs.DEFAULT_ICON_SPACING},i),n=new v.xvT(ct.keyboardHelpDialog.orStringProperty,{font:js,maxWidth:16}),r=Qs.iconRow([new v.NBX({children:[e]}),n,new v.NBX({children:[t]})],s);return n.disposer=r,r}static iconToIcon(e,t,i){const s=(0,ae.JA)({spacing:Qs.DEFAULT_ICON_SPACING/2},i),n=new v.xvT(ct.keyboardHelpDialog.hyphenStringProperty,{font:js,maxWidth:16}),r=Qs.iconRow([new v.NBX({children:[e]}),n,new v.NBX({children:[t]})],s);return n.disposer=n,r}static iconPlusIcon(e,t,i){return Qs.iconPlusIconRow([e,t],i)}static iconPlusIconRow(e,t){const i=(0,ae.JA)({plusIconSize:new ke.Z(8,1.2),spacing:Qs.DEFAULT_ICON_SPACING},t),s=[];for(let n=0;n{e.dispose(),t.dispose()}),i}static upOrDown(){const e=new Xs("up"),t=new Xs("down"),i=Qs.iconOrIcon(e,t);return i.disposeEmitter.addListener(()=>{e.dispose(),t.dispose()}),i}static wasdRowIcon(e){const t=(0,ae.ZP)()({spacing:1.3},e),i=new Ks("W"),s=new Ks("A"),n=new Ks("S"),r=new Ks("D"),o=[i,s,n,r],a=Qs.iconRow(o,t);return a.disposeEmitter.addListener(()=>{i.dispose(),s.dispose(),n.dispose(),r.dispose()}),a}static arrowKeysRowIcon(e){const t=(0,ae.ZP)()({spacing:1.3},e),i=new Xs("up"),s=new Xs("left"),n=new Xs("down"),r=new Xs("right"),o=Qs.iconRow([i,s,n,r],t);return o.disposeEmitter.addListener(()=>{i.dispose(),n.dispose(),s.dispose(),r.dispose()}),o}static arrowOrWasdKeysRowIcon(e){const t=(0,ae.ZP)()({spacing:Qs.DEFAULT_ICON_SPACING},e),i=Qs.arrowKeysRowIcon(),s=Qs.wasdRowIcon(),n=Qs.iconOrIcon(i,s,t);return n.disposeEmitter.addListener(()=>{i.dispose(),s.dispose()}),n}static pageUpPageDownRowIcon(e){const t=(0,ae.ZP)()({spacing:Qs.DEFAULT_ICON_SPACING},e),i=Hs.pageUp(),s=Hs.pageDown(),n=[i,s],r=Qs.iconRow(n,t);return r.disposeEmitter.addListener(()=>{i.dispose(),s.dispose()}),r}static upDownArrowKeysRowIcon(e){const t=new Xs("up"),i=new Xs("down"),s=Qs.iconRow([t,i],e);return t.disposer=s,i.disposer=s,s}static leftRightArrowKeysRowIcon(e){const t=new Xs("left"),i=new Xs("right"),s=Qs.iconRow([t,i],e);return s.disposeEmitter.addListener(()=>{t.dispose(),i.dispose()}),s}}_defineProperty(Qs,"DEFAULT_ICON_SPACING",6.5),Be.register("KeyboardHelpIconFactory",Qs);var Js=i(8311),$s=i(7857),en=i(6629);const tn=new ht({size:19,weight:"bold"});class sn extends((0,v.KwY)(v.SHm)){constructor(e,t,i){const s=(0,ae.ZP)()({headingOptions:{font:tn,maxWidth:335,tagName:"h2",innerContent:e},textMaxWidth:235,vBoxOptions:{align:"left",spacing:13},a11yContentTagName:"ul",spacing:13,align:"left"},i),n=new v.xvT(e,s.headingOptions),r=[],o=[];for(let c=0;c{d.dispose(),t.forEach(e=>e.dispose()),this.keyboardHelpSectionRows=[]}}dispose(){this.disposeKeyboardHelpSection(),super.dispose()}createReadingBlockResponseProperty(){const e=[this.headingStringProperty];for(let t=0;t{let e="";return e+=this.headingStringProperty.value+", ",this.keyboardHelpSectionRows.forEach(t=>{t.readingBlockContent&&(e+=en.Z.getResponseText(t.readingBlockContent)+" ")}),e})}static alignHelpSectionIcons(e){const t=_.maxBy(e,e=>e.iconVBox.left),i=t.iconVBox.left;e.forEach(e=>{e.contentHBox.spacing=e.contentHBox.spacing+i-e.iconVBox.left})}}_defineProperty(sn,"DEFAULT_VERTICAL_ICON_SPACING",13),Be.register("KeyboardHelpSection",sn);var nn=i(1731);const rn=new ht(16);class on extends nn.Z{constructor(e,t,i,s){const n=(0,ae.ZP)()({readingBlockContent:null},s);super(n),this.text=e,this.label=t,this.icon=i,this.readingBlockContent=n.readingBlockContent}static labelWithIcon(e,t,i){const s=(0,ae.ZP)()({labelInnerContent:null,readingBlockContent:null,labelOptions:{font:rn},iconOptions:{tagName:"li"}},i),n=new v.Hof(e,s.labelOptions),r=new v.Lkj({matchHorizontal:!1}),o=r.createBox(n),a=r.createBox(new v.NBX({children:[t]}),s.iconOptions);a.innerContent=s.labelInnerContent;const h=new on(n,o,a,{readingBlockContent:s.readingBlockContent||s.labelInnerContent});return n.disposer=h,r.disposer=h,h}static createKeysRowFromStrings(e,t,i){return on.createKeysRow(e.map(e=>new Ks(e)),t,i)}static createKeysRow(e,t,i){let s=null;for(let n=0;n{o.dispose(),n.dispose(),c.dispose(),r.forEach(e=>e.dispose())}),m}}_defineProperty(on,"LABEL_FONT",rn),Be.register("KeyboardHelpSectionRow",on);const an=on;class hn extends sn{constructor(e){const t=(0,ae.ZP)()({withCheckboxContent:!1},e),i=Hs.tab(),s=an.labelWithIcon(ct.keyboardHelpDialog.moveToNextItemOrGroupStringProperty,i,{labelInnerContent:ct.a11y.keyboardHelpDialog.general.tabGroupDescriptionStringProperty}),n=Qs.shiftPlusIcon(i),r=an.labelWithIcon(ct.keyboardHelpDialog.moveToPreviousItemOrGroupStringProperty,n,{labelInnerContent:ct.a11y.keyboardHelpDialog.general.shiftTabGroupDescriptionStringProperty}),o=Qs.leftRightArrowKeysRowIcon(),a=Qs.upDownArrowKeysRowIcon(),h=Qs.iconOrIcon(o,a),l=an.labelWithIcon(ct.keyboardHelpDialog.moveBetweenItemsInAGroupStringProperty,h,{labelInnerContent:ct.a11y.keyboardHelpDialog.general.groupNavigationDescriptionStringProperty}),d=Hs.space(),c=Hs.enter(),u=Qs.iconOrIcon(d,c),p=[s,r,l,an.labelWithIcon(ct.keyboardHelpDialog.pressButtonsStringProperty,u,{labelInnerContent:ct.a11y.keyboardHelpDialog.general.pressButtonsDescriptionStringProperty})];if(t.withCheckboxContent){const e=an.labelWithIcon(ct.keyboardHelpDialog.toggleCheckboxesStringProperty,d,{labelInnerContent:ct.a11y.keyboardHelpDialog.general.toggleCheckboxesDescriptionStringProperty});p.push(e)}const m=Hs.altOrOption(),g=new Ks("R"),y=Qs.iconPlusIcon(m,g),f=an.labelWithIcon(ct.keyboardHelpDialog.resetAllStringProperty,y,{labelInnerContent:Oe.Z.fillIn(ct.a11y.keyboardHelpDialog.general.resetAllDescriptionPatternStringProperty,{altOrOption:Hs.getAltKeyString()})});p.push(f);const A=Hs.esc(),b=an.labelWithIcon(ct.keyboardHelpDialog.exitADialogStringProperty,A,{labelInnerContent:ct.a11y.keyboardHelpDialog.general.exitDialogDescriptionStringProperty});p.push(b),super(ct.keyboardHelpDialog.basicActionsStringProperty,p,t),this.disposeBasicActionsKeyboardHelpSection=()=>{A.dispose(),n.dispose(),i.dispose(),h.dispose(),o.dispose(),a.dispose(),d.dispose(),c.dispose(),u.dispose(),m.dispose(),g.dispose(),y.dispose()}}dispose(){this.disposeBasicActionsKeyboardHelpSection(),super.dispose()}}Be.register("BasicActionsKeyboardHelpSection",hn);class ln extends v.NBX{constructor(){const e=new hn;super({children:[e]}),this.disposeHomeScreenKeyboardHelpContent=()=>{e.dispose()}}dispose(){this.disposeHomeScreenKeyboardHelpContent(),super.dispose()}}T.Z.register("HomeScreenKeyboardHelpContent",ln);const dn=ln;var cn=i(9883),un=i(7055);class pn extends v.NBX{constructor(e,t){const i=(0,ae.ZP)()({size:Tn.MINIMUM_HOME_SCREEN_ICON_SIZE,maxIconWidthProportion:.85,maxIconHeightProportion:.85,fill:"white",stroke:null},t),s=new v.AeJ(0,0,i.size.width,i.size.height,{fill:i.fill,stroke:i.stroke});e.pickable=!1;const n=()=>{e.setScaleMagnitude(1),e.setScaleMagnitude(Math.min(i.maxIconWidthProportion*s.width/e.width,i.maxIconHeightProportion*s.height/e.height)),e.center=s.center};e.localBoundsProperty.link(n),i.children=[s,e],super(i),this.disposeScreenIcon=()=>{e.localBoundsProperty.hasListener(n)&&e.localBoundsProperty.unlink(n)}}dispose(){this.disposeScreenIcon(),super.dispose()}}T.Z.register("ScreenIcon",pn);const mn=e=>""+e;class gn extends ge.ZP{constructor(e,t,i){const s=(0,ae.ZP)()({formatNames:[],decimalPlaces:null,phetioValueType:it.Z},i),n=[e],r={},o=Object.keys(t);o.forEach(e=>{const i=t[e];(i instanceof wi.Z||i instanceof O.Z)&&n.push(i);let o=mn;if(null!==s.decimalPlaces&&("number"==typeof s.decimalPlaces||null!==s.decimalPlaces[e])){const t="number"==typeof s.decimalPlaces||null===s.decimalPlaces?s.decimalPlaces:s.decimalPlaces[e];o=e=>mn("number"==typeof e?I.Z.toFixed(e,t):e)}s.maps&&s.maps.hasOwnProperty(e)?r[e]=t=>o(s.maps[e](t)):r[e]=o}),super(n,(function(){for(var i=arguments.length,a=new Array(i),h=0;h{const t=n.indexOf(e);return t>=0?a[t]:e};let d=""+l(e);s.formatNames.forEach((e,t)=>{d=d.replace(new RegExp(`\\{${t}\\}`,"g"),`{{${e}}}`)});const c=d.match(/\{\{[^{}]+\}\}/g)||[];for(let e=0;enull===e?"":Oe.Z.fillIn(yn,{name:e})),this.maxDT=s.maxDT,this.createModel=e,this.createView=t,this._model=null,this._view=null,this.activeProperty=new S.Z(!0,{tandem:s.tandem.createTandem("activeProperty"),phetioReadOnly:!0,phetioDocumentation:"Indicates whether the screen is currently displayed in the simulation. For single-screen simulations, there is only one screen and it is always active."}),this.descriptionContent="",s.descriptionContent?this.descriptionContent=s.descriptionContent:this.nameProperty.value?this.descriptionContent=new gn(yn,{name:this.nameProperty}):this.descriptionContent=An}get model(){return this._model}get view(){return this._view}hasModel(){return!!this._model}hasView(){return!!this._view}reset(){}initializeModel(){this._model=this.createModel()}initializeView(e,t,i,s){var n;this._view=this.createView(this.model),this._view.setVisible(!1),phet.chipper.queryParameters.dev&&this._view.addChild((n=this._view.layoutBounds,new v.y$t(Qe.bn.bounds(n),{stroke:"red",lineWidth:3,pickable:!1}))),phet.chipper.queryParameters.showVisibleBounds&&this._view.addChild(function(e){const t=new v.y$t(Qe.bn.bounds(e.visibleBoundsProperty.value),{stroke:"blue",lineWidth:6,pickable:!1});return e.visibleBoundsProperty.link(e=>{t.shape=Qe.bn.bounds(e)}),t}(this._view)),he.Z.multilink([t,e,this.pdomDisplayNameProperty],(e,t,n)=>{let r;r=1===i?e:s?t:Oe.Z.fillIn(fn,{screenName:n,simName:t}),this._view.setScreenSummaryIntroAndTitle(t,n,r,i>1)})}}function Sn(e,t,i,s){e.width,e.height}r=wn,_defineProperty(wn,"HOME_SCREEN_ICON_ASPECT_RATIO",vn),_defineProperty(wn,"MINIMUM_HOME_SCREEN_ICON_SIZE",bn),_defineProperty(wn,"MINIMUM_NAVBAR_ICON_SIZE",Pn),_defineProperty(wn,"ScreenIO",new Te.Z("ScreenIO",{valueType:r,supertype:(0,cn.Z)(Te.Z.ObjectIO),documentation:"Section of a simulation which has its own model and view."})),T.Z.register("Screen",wn);const Tn=wn;class En{constructor(e,t,i,s){this.simScreens=t,this.screenProperty=e,this.activeSimScreensProperty=i,this.selectedScreenProperty=new be.Z(t[0],{validValues:t,phetioValueType:Tn.ScreenIO,tandem:s.createTandem("selectedScreenProperty"),phetioFeatured:!0}),this.screenProperty.link(e=>{_.includes(t,e)&&(this.selectedScreenProperty.value=e)})}reset(){}}T.Z.register("HomeScreenModel",En);const _n=En,xn=new v.Ilk(0,200,0),Cn=new v.Ilk(255,85,0),In=new v.Ilk(0,135,0),Dn=new v.Ilk(106,206,245),Ln=new v.Ilk(254,225,5),kn={ACCELERATION:new v.Ilk(255,255,50),APPLIED_FORCE:new v.Ilk(236,153,55),BUTTON_YELLOW:Ln,ELASTIC_POTENTIAL_ENERGY:new v.Ilk(0,204,255),FRICTION_FORCE:Cn,GRAVITATIONAL_FORCE:new v.Ilk(50,130,215),GRAVITATIONAL_POTENTIAL_ENERGY:new v.Ilk(55,130,215),HEAT_THERMAL_ENERGY:Cn,IMAGINARY_PART:new v.Ilk(153,51,102),KINETIC_ENERGY:new v.Ilk(30,200,45),MOMENTUM:new v.Ilk(50,50,255),NET_WORK:xn,NORMAL_FORCE:new v.Ilk(255,235,0),PHET_LOGO_BLUE:Dn,PHET_LOGO_YELLOW:Ln,POSITION:v.Ilk.BLUE,REAL_PART:new v.Ilk(255,153,0),RED_COLORBLIND:Cn,RESET_ALL_BUTTON_BASE_COLOR:new v.Ilk(247,151,34),GREEN_COLORBLIND:In,TOTAL_ENERGY:new v.Ilk(180,180,0),TOTAL_FORCE:xn,VELOCITY:new v.Ilk(50,255,50),WALL_FORCE:new v.Ilk(153,51,0),SCREEN_ICON_FRAME:"#dddddd"};Be.register("PhetColorScheme",kn);const Mn=kn;class On extends v.NBX{constructor(e,t){const i=(0,ae.ZP)()({xMargin1:6,yMargin1:6,cornerRadius:0},t);super();const s=e.width+2*i.xMargin1,n=e.height+2*i.yMargin1;this.gradient=new v.oas(0,0,s,0).addColorStop(0,"#fbff41").addColorStop(.1475,"#fef98b").addColorStop(.465,"#feff40").addColorStop(.77,"#fffccd").addColorStop(1,"#fbff41");const r=new v.AeJ(0,0,s,n,i.cornerRadius,i.cornerRadius,{stroke:this.gradient,lineWidth:3,x:e.x-i.xMargin1,y:e.y-i.yMargin1});this.addChild(r),this.mutate(i);const o=Le.Z.rect(r.x,r.y,s,n);this.highlightRectangle=v.AeJ.bounds(o.dilated(.75),{stroke:"transparent",lineWidth:4.5}),this.addChild(this.highlightRectangle)}setHighlighted(e){this.highlightRectangle.stroke=e?this.gradient:"transparent"}}T.Z.register("Frame",On);const Nn=On;class Rn extends((0,v.CHP)(v.SHm)){constructor(e,t,i){const s=(0,ae.ZP)()({cursor:"pointer",showUnselectedHomeScreenIconFrame:!1,tagName:"button",appendDescription:!0,containerTagName:"li",phetioEventType:Ne.Z.USER,phetioDocumentation:"A button on the home screen for choosing a simulation screen"},i),n=new ge.ZP([t.selectedScreenProperty],t=>t===e),r=new S.Z(!1);let o=I.Z.linear(2,4,.875,.5,t.simScreens.length);t.simScreens.length>=5&&(o=.4);const a=140*o,h=e.homeScreenIcon,l=new v.NBX({children:[h],scale:a/h.height}),d=new v.NBX({children:[h],scale:140/h.height}),c=new v.AeJ(0,0,l.width,l.height,{stroke:s.showUnselectedHomeScreenIconFrame?Mn.SCREEN_ICON_FRAME:null,lineWidth:.7}),u=new Nn(d),p=new v.NBX({children:[c,l]}),m=new v.NBX({children:[u,d]}),g=new v.NBX({pdomVisible:!1}),y=new v.xvT(e.nameProperty,{tandem:s.tandem.createTandem("text"),stringPropertyOptions:{phetioReadOnly:!0}});super((0,Se.Z)({children:[g,y]},s)),this.screen=e,this.addAriaDescribedbyAssociation({otherNode:this,otherElementName:v.Grz.DESCRIPTION_SIBLING,thisElementName:v.Grz.PRIMARY_SIBLING});const f={small:{node:[p],font:new ht(18),spacing:3},large:{node:[m],font:new ht(42),spacing:0}},A=()=>{const e=n.value||r.value?1:.5;d.opacity=e,l.opacity=e,y.fill=n.value||r.value?"white":"gray"};n.link(e=>{const t=e?f.large:f.small;g.children=t.node,y.font=t.font,y.maxWidth=g.width,A(),this.setSpacing(t.spacing)}),r.link(e=>{u.setHighlighted(e),A()});const b=new gi.Z;let P=!1;const V=new v.eMb({fire:()=>{const i=V.pointer&&V.pointer.isTouchLike();!n.value||i&&!P?(t.selectedScreenProperty.value=e,this.voicingSpeakFullResponse({objectResponse:null,contextResponse:null})):(t.screenProperty.value=e,this.voicingSpeakFullResponse({objectResponse:null,hintResponse:null,utterance:b}))},tandem:s.tandem.createTandem("inputListener")});this.addInputListener(V),this.addInputListener({focus:e=>{!n.value&&V.fire(e)}}),this.addInputListener({click:()=>this.focus()}),this.addInputListener({focus:()=>r.set(!0),blur:()=>r.set(!1),over:()=>r.set(!0),out:()=>r.set(!1)});const w=()=>{P=t.selectedScreenProperty.value===e,t.selectedScreenProperty.value=e};this.addInputListener({touchover:w,penover:w}),this.boundsProperty.link(()=>{this.mouseArea=this.touchArea=Qe.bn.bounds(this.localBounds)})}}T.Z.register("HomeScreenButton",Rn);const Bn=Rn;class Zn extends kt{constructor(e,t){const i=(0,ae.ZP)()({initialPlaybackRate:1},t);super(i),this.activeBufferSources=[],this.valueToWrappedAudioBufferMap=e,this.localGainNode=this.audioContext.createGain(),this.localGainNode.connect(this.soundSourceDestination),this.fullyEnabledProperty.lazyLink(e=>{e||this.stopAll()}),this.playbackRate=void 0===i.initialPlaybackRate?1:i.initialPlaybackRate,this.audioContextStateChangeListener=null,this.timeOfDeferredPlayRequest=Number.NEGATIVE_INFINITY}playAssociatedSound(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=this.valueToWrappedAudioBufferMap.get(e);if("running"===this.audioContext.state){if(this.fullyEnabled&&i.audioBufferProperty.value){const e=this.audioContext.currentTime;this.localGainNode.gain.cancelScheduledValues(e),this.localGainNode.gain.setValueAtTime(1,e);const s=this.audioContext.createBufferSource();s.buffer=i.audioBufferProperty.value,s.playbackRate.setValueAtTime(this.playbackRate,this.audioContext.currentTime),s.connect(this.localGainNode),this.activeBufferSources.push(s),s.onended=()=>{const e=this.activeBufferSources.indexOf(s);e>-1&&this.activeBufferSources.splice(e,1)},s.start(e+t)}}else this.audioContextStateChangeListener&&ee.removeStateChangeListener(this.audioContext,this.audioContextStateChangeListener),this.timeOfDeferredPlayRequest=Date.now(),this.audioContextStateChangeListener=()=>{(Date.now()-this.timeOfDeferredPlayRequest)/1e3<.2&&this.playAssociatedSound(e,.1),ee.removeStateChangeListener(this.audioContext,this.audioContextStateChangeListener),this.audioContextStateChangeListener=null},ee.addStateChangeListener(this.audioContext,this.audioContextStateChangeListener)}setPlaybackRate(e){this.playbackRate=e}stopAll(){const e=this.audioContext.currentTime+.1;this.localGainNode.gain.linearRampToValueAtTime(0,e),this.activeBufferSources.forEach(t=>{t.stop(e)}),this.activeBufferSources.length=0}}R.register("MultiClip",Zn);const qn=Zn,Fn="data:audio/mpeg;base64,//swxAAAA3QZA7SQgDGEjym3NTiCAAACbs2AAAGqCgEAwSYujQIIOnKgQlAxTrlAGAggCQSAwInoJvJduAAez8PpG6ltDAnjvbjMiRIIeZ8jCLEDtPfa*gSK7XQEZTQi1GA3iTA+IE+k480aDYsDtQDcS3fBEADmMTmT7e3jeDG4gGOAxR8Dh/nLqSno12c54A6EAACGqr6gAAAAA//syxAUACNxrZVmngBkFD2oftpAHABnBKKR1MTRk5pB4lkDgpMUXQGD5aKBVhLL7yiBQtJJbSRasLM2vlmJJ7KBLb7LG/VsXXJ6ZJ5SxZ6RWtABLeAAAoGBF5hGFGFph7YsPDQYVllF5t1d2H3GaasV236GdJGCNHUMVnJKgsG0NOEKNNzCr2k41Wf/8hCjU042QqgpQAAJuUucYCP/7MsQEggiQZ0JuaMdZDw3n3c0k5ghh0TnRSUDh0ZOwRw5BvmqI4OALrQGXEBz3OA5dNBcMujKItB6BklEt6WFYbCwQeiK0w0pK0LiIuuHfwJMYAgEMyZRovoQqkyGMhIsnM3ke44YZMBSS1FMk/7MVZy1uLQU21dhHaFJhX2xsNMS+0zwdHdIjDKXvck1R//////oqAAAPTAAACWr/+zLEBAIING03Tukm4Q0NpundmN4fJflgDAAa5oUHQqNpmhsZYyi0Mzo0SQsOSuizOZSXxLGBhuga0pqTcRtCm8oKCKaNTxVT8MblG/bABJMCyAXHyRNYgYDAGafAqIQsNPoMPRBASOmOF6GzuwfZb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sRlgEZkMOZs7wRguogddPY9R1VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+zLEeIPE+C79zOHmeAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",Hn=M(F,Fn),zn=k.Z.createLock(Fn),Yn=new Z;let Gn=!1;const Wn=()=>{Gn||(zn(),Gn=!0)},Un=F.decodeAudioData(Hn.buffer,e=>{null===Yn.audioBufferProperty.value&&(Yn.audioBufferProperty.set(e),Wn())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),Yn.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),Wn()});Un&&Un.then(e=>{null===Yn.audioBufferProperty.value&&(Yn.audioBufferProperty.set(e),Wn())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),Wn()});const Xn=Yn,Kn="data:audio/mpeg;base64,//swxAACBbQfAa1vAjjzBGF2uiAGAAAAVtwAAAB7yZwNh6oRieZxJ6ZAiC/ATEjWf4paPzHKWsS3vMPHu8R6o/M8eAnZcHGwD9C4jQ2xTmNgzZHbzxk5zD0HTBEWTHspzBMqDK8KxIF37fd35ff/MUdUL/Ebxn9X8v1v6Fr/qUoAAAAEOAWfACgXUDbgA1LRszBjFcN1Q5A37hmD//syxA4ACgAhKbngkhD9BGDHvgAGGWHvMr8isweRLzBiAgMNQMkxCAAAEEEBgeVczyMNGKtsf6F4Giv/rT/odb3f/NeU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VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+zLEVwBDmBsIjeeAOI2FXrW9GE5VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//swxHqDxWAq183lZngAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",jn=M(F,Kn),Qn=k.Z.createLock(Kn),Jn=new Z;let $n=!1;const er=()=>{$n||(Qn(),$n=!0)},tr=F.decodeAudioData(jn.buffer,e=>{null===Jn.audioBufferProperty.value&&(Jn.audioBufferProperty.set(e),er())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),Jn.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),er()});tr&&tr.then(e=>{null===Jn.audioBufferProperty.value&&(Jn.audioBufferProperty.set(e),er())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),er()});const ir=Jn;class sr extends ne.Z{}_defineProperty(sr,"HOME_SCREEN_SELECTED",new(o=sr)),_defineProperty(sr,"DIFFERENT_ICON_SELECTED",new o),_defineProperty(sr,"enumeration",new se.Z(o));class nr extends qn{constructor(e,t){super(new Map([[sr.HOME_SCREEN_SELECTED,Xn],[sr.DIFFERENT_ICON_SELECTED,ir]]),t),e.screenProperty.lazyLink(t=>{t.model===e&&this.playAssociatedSound(sr.HOME_SCREEN_SELECTED)}),e.selectedScreenProperty.lazyLink(()=>{e.screenProperty.value.model===e&&this.playAssociatedSound(sr.DIFFERENT_ICON_SELECTED)})}}T.Z.register("HomeScreenSoundGenerator",nr);const rr=nr;class or extends v.NBX{constructor(e,t){super((0,ae.ZP)()({containerTagName:"section",tagName:"div",labelContent:e,labelTagName:"h2"},t))}}Be.register("PDOMSectionNode",or);class ar extends or{constructor(e){super(ct.a11y.simSection.controlAreaStringProperty,e)}}Be.register("ControlAreaNode",ar);class hr extends or{constructor(e){super(ct.a11y.simSection.playAreaStringProperty,e)}}Be.register("PlayAreaNode",hr);class lr extends v.NBX{constructor(){super(),this.openingSummaryNode=new v.NBX({tagName:"p"});const e=new v.NBX({tagName:"p",innerContent:ct.a11y.simSection.screenSummary.keyboardShortcutsHintStringProperty});this.addChild(this.openingSummaryNode),this.addChild(e),this.pdomOrder=[this.openingSummaryNode,null,e]}setIntroString(e,t,i){this.openingSummaryNode.innerContent=i&&t?Oe.Z.fillIn(ct.a11y.simSection.screenSummary.multiScreenIntroStringProperty,{screen:t}):Oe.Z.fillIn(ct.a11y.simSection.screenSummary.singleScreenIntroPatternStringProperty,{sim:e})}}Be.register("ScreenSummaryNode",lr);const dr=new Le.Z(0,0,1024,618);class cr extends v.NBX{constructor(e){const t=(0,ae.ZP)()({layoutBounds:dr.copy(),layerSplit:!0,excludeInvisible:!0,tandem:L.Z.REQUIRED,visiblePropertyOptions:{phetioState:!1,phetioReadOnly:!0},containerTagName:"article",tagName:"div",screenSummaryContent:null,includePDOMNodes:!0},e);super(t),this.layoutBounds=t.layoutBounds,this.visibleBoundsProperty=new be.Z(t.layoutBounds),this.pdomTitleNode=new v.NBX({tagName:"h1",focusHighlight:"invisible"}),this.pdomPlayAreaNode=new hr,this.pdomControlAreaNode=new ar,this.pdomScreenSummaryNode=new lr,this.screenSummaryContent=null,t.screenSummaryContent&&this.setScreenSummaryContent(t.screenSummaryContent),this.visibleProperty.lazyLink(e=>{e?(this.pdomTitleNode.focusable=!0,this.pdomTitleNode.focus()):this.pdomTitleNode.focusable=!1}),this.pdomTitleNode.addInputListener({blur:()=>{this.pdomTitleNode.focusable=!1}}),this.pdomParentNode=new v.NBX({children:t.includePDOMNodes?[this.pdomTitleNode,this.pdomScreenSummaryNode,this.pdomControlAreaNode,this.pdomPlayAreaNode]:[this.pdomTitleNode]}),this.addChild(this.pdomParentNode),this.pdomParentNode.pdomOrder=t.includePDOMNodes?[this.pdomTitleNode,this.pdomScreenSummaryNode,this.pdomPlayAreaNode,this.pdomControlAreaNode]:[this.pdomTitleNode]}setPDOMOrder(e){throw new Error("should not need to set accessible order on a ScreenView")}setChildren(e){return v.NBX.prototype.setChildren.call(this,e),this.pdomParentNode&&!this.hasChild(this.pdomParentNode)&&(this.addChild(this.pdomParentNode),this.pdomParentNode.moveToBack()),this}getLayoutScale(e){return cr.getLayoutScale(this.layoutBounds,e)}layout(e){this.matrix=cr.getLayoutMatrix(this.layoutBounds,e),this.visibleBoundsProperty.value=this.parentToLocalBounds(e)}setScreenSummaryContent(e){this.screenSummaryContent&&this.pdomScreenSummaryNode.removeChild(this.screenSummaryContent),this.screenSummaryContent=e,this.pdomScreenSummaryNode.addChild(e)}setScreenSummaryIntroAndTitle(e,t,i,s){this.pdomScreenSummaryNode.setIntroString(e,t,s),this.pdomTitleNode.innerContent=i}getVoicingOverviewContent(){throw new Error("The ScreenView should implement getVoicingOverviewContent if Voicing is enabled")}getVoicingDetailsContent(){throw new Error("The ScreenView should implement getVoicingDetailsContent when the Voicing feature is enabled.")}getVoicingHintContent(){throw new Error("The ScreenView should implement getVoicingHintContent when Voicing is enabled.")}static getLayoutScale(e,t){return Math.min(t.width/e.width,t.height/e.height)}static getLayoutMatrix(e,t,i){const s=(0,ae.ZP)()({verticalAlign:"center"},i),n=t.width,r=t.height,o=cr.getLayoutScale(e,t);let a=0,h=0;return o===n/e.width?(h=r/o-e.height,"center"===s.verticalAlign&&(h/=2)):o===r/e.height&&(a=(n/o-e.width)/2),Gt.Z.rowMajor(o,0,a*o+t.left,0,o,h*o+t.top,0,0,1)}step(e){}}_defineProperty(cr,"DEFAULT_LAYOUT_BOUNDS",dr),T.Z.register("ScreenView",cr);const ur=cr;class pr extends ur{constructor(e,t,i){const s=(0,ae.ZP)()({layoutBounds:pr.LAYOUT_BOUNDS,warningNode:null,includePDOMNodes:!1},i);super(s);const n=new v.NBX({tagName:"p"});this.addChild(n),this.selectedScreenProperty=t.selectedScreenProperty;const r=new v.xvT(e,{font:new ht({size:52,family:pr.TITLE_FONT_FAMILY}),fill:"white",y:130,maxWidth:this.layoutBounds.width-10,tandem:s.tandem.createTandem("titleText"),stringPropertyOptions:{phetioReadOnly:!0}});r.localBoundsProperty.link(()=>{r.centerX=this.layoutBounds.centerX}),this.addChild(r);const o=s.tandem.createTandem("buttonGroup");this.screenButtons=_.map(t.simScreens,e=>{const i=new Bn(e,t,{showUnselectedHomeScreenIconFrame:e.showUnselectedHomeScreenIconFrame,descriptionContent:e.descriptionContent,voicingHintResponse:e.descriptionContent,tandem:o.createTandem(e.tandem.name+"Button")});return i.voicingNameResponse=e.pdomDisplayNameProperty,i.innerContent=e.pdomDisplayNameProperty,i});let a=60;4===t.simScreens.length&&(a=33),t.simScreens.length>=5&&(a=20),this.homeScreenScreenSummaryIntroProperty=new gn(un.Z.a11y.homeScreenDescriptionPatternStringProperty,{name:e,screens:t.simScreens.length}),n.innerContent=new gn(un.Z.a11y.homeScreenIntroPatternStringProperty,{description:this.homeScreenScreenSummaryIntroProperty,hint:un.Z.a11y.homeScreenHintStringProperty}),this.screenButtons.forEach(t=>{t.voicingContextResponse=e});const h=new v.BET({spacing:a,align:"top",maxWidth:this.layoutBounds.width-118,tagName:"ol"});if(t.activeSimScreensProperty.link(e=>{h.children=e.map(e=>_.find(this.screenButtons,t=>t.screen===e))}),this.addChild(new v.DbO(h,{alignBounds:this.layoutBounds,yAlign:"top",topMargin:this.layoutBounds.height/3+20})),me.addSoundGenerator(new rr(t,{initialOutputLevel:.5}),{categoryName:"user-interface"}),s.warningNode){const e=s.warningNode;this.addChild(e),e.centerX=this.layoutBounds.centerX,e.bottom=this.layoutBounds.maxY-2}}focusHighlightedScreenButton(){for(let e=0;e{""!==e&&(e+=" "),e+=Oe.Z.fillIn(un.Z.a11y.homeScreenButtonDetailsPattern,{name:t.screen.pdomDisplayNameProperty.value,screenHint:t.screen.descriptionContent})}),e}getVoicingHintContent(){return un.Z.a11y.homeScreenHintStringProperty}}_defineProperty(pr,"LAYOUT_BOUNDS",new Le.Z(0,0,768,504)),_defineProperty(pr,"TITLE_FONT_FAMILY","Century Gothic, Futura"),T.Z.register("HomeScreenView",pr);const mr=pr,gr=un.Z.a11y.homeStringProperty,yr=v.Ilk.BLACK;class fr extends Tn{constructor(e,t,i,s,n){const r=(0,ae.ZP)()({backgroundColorProperty:new be.Z(yr),name:gr,createKeyboardHelpNode:()=>new dn,instrumentNameProperty:!1},n);super(()=>new _n(t(),i,s,r.tandem.createTandem("model")),t=>new mr(e,t,{warningNode:r.warningNode,tandem:r.tandem.createTandem("view")}),r)}}_defineProperty(fr,"BACKGROUND_COLOR",yr),T.Z.register("HomeScreen",fr);const Ar=fr;class br{constructor(){this.backgroundColorProperty=new be.Z(v.Ilk.BLACK),this.navigationBarDarkProperty=new ge.ZP([this.backgroundColorProperty],e=>e.equals(v.Ilk.BLACK)),this.navigationBarFillProperty=new ge.ZP([this.navigationBarDarkProperty],e=>e?v.Ilk.WHITE:v.Ilk.BLACK),this.navigationBarTextFillProperty=new ge.ZP([this.navigationBarFillProperty],e=>e.equals(v.Ilk.BLACK)?v.Ilk.WHITE:v.Ilk.BLACK)}reset(){this.backgroundColorProperty.reset()}}T.Z.register("LookAndFeel",br);const Pr=br;var Vr=i(7464);class vr{constructor(e){this.windowSize=e,this.samples=new Array(e),this.sampleIndex=0,this.total=0,this.numSamples=0,this.clear()}clear(){this.total=0,this.numSamples=0;for(let e=0;e=this.windowSize}updateRunningAverage(e){return this.numSamples=Math.min(this.windowSize,this.numSamples+1),this.total-=this.samples[this.sampleIndex],this.total+=e,this.samples[this.sampleIndex]=e,this.sampleIndex=(this.sampleIndex+1)%this.windowSize,this.getRunningAverage()}}Vr.Z.register("RunningAverage",vr);const wr=vr;let Sr=!1;class Tr{constructor(e){const t=(0,ae.ZP)()({windowSize:2e3,memoryLimit:phet.chipper.queryParameters.memoryLimit},e);this.memoryLimit=1048576*t.memoryLimit,this.runningAverage=new wr(t.windowSize),this.lastMemory=0}measure(){if(!window.performance||!window.performance.memory||!window.performance.memory.usedJSHeapSize)return;const e=window.performance.memory.usedJSHeapSize;this.lastMemory=e;const t=this.runningAverage.updateRunningAverage(e);if(this.memoryLimit&&this.runningAverage.isSaturated()&&!Sr&&t>this.memoryLimit&&e>.5*this.memoryLimit)throw Sr=!0,new Error(`Average memory used (${Tr.memoryString(t)}) is above our memoryLimit (${Tr.memoryString(this.memoryLimit)}). Current memory: ${Tr.memoryString(e)}.`)}static memoryString(e){return Math.ceil(e/1048576)+"MB"}}T.Z.register("MemoryMonitor",Tr);const Er=Tr,_r=e=>{const t=_.get(window,e);return void 0!==t?t:null};Je.Z.register("getGlobal",_r);const xr=_r;class Cr extends Xi{constructor(e){const t=(0,ae.ZP)()({iconLength:16,pathOptions:{stroke:"white",lineWidth:2.5,lineCap:"round"},baseColor:Mn.RED_COLORBLIND,xMargin:4,yMargin:4,innerContent:ct.a11y.closeStringProperty,voicingNameResponse:ct.a11y.closeStringProperty},e),i=(new Qe.bn).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 v.y$t(i,t.pathOptions),super(t)}}Be.register("CloseButton",Cr);const Ir="data:audio/mpeg;base64,//swxAAAB5gnMzRhAAEHDWyDNLAAAAAaAQAu7tjAQAAABgMBgNNiBBAWD7ykMQf1g+D5/qBMHwfB/iAEPWCDv+o5wfPg+8EAQBMHz6gQB8Hwfsu2uWDrkw/a9xgUaMwFxxwCLsWS7MHN7VJki8fVT75eTqpn7/Xt1QxW//lJVbnfNuFRTzwrLn/5GVBnKMy/FVs5dTYABARKCMRm//syxAQACHBHWZ2kAAEJi+jxpg1Qlry2AYclVGyMwNoFJ29hqHqa1TRqRMCoetKstcqUzHBxQdCJmVcSJ/EQdEo0FXSoNLGkav/ljqPtEvjAoAE0zuEoM3lMJlLY3Uj65AMeMzQN6QWeLFdCcxLNFy4dBVXVfZ1L+gIki4KPQVBb4dERU6CrsFSoaLVHv/Ev9Hw4ANdAAG7VBBhVdP/7MsQFAAh8YybVowABG49vdx6AAm8ODBg8FDy9pmwIBsHPVGiPMueyERxZdIFnSpkzI8fezb+0z6OJVv7HHw7XBWdXwa6/y34l6sq7uitTjFTEgsFYrFQqFQDAGrQXMbpbb3ZGQWPWvTnyyeKKHgQ/nvlUf/u74oOHp/8v3R/dl/UcSXDz+kMBEHI0p5efiDJqb/64foFiBSWqB2r/+zLEA4AIVDlivZGAAQePKiWmDNhtwTYmBYyxnJdmZwmMtZ8ZjInEMMpo+VFWESqmhsWBoClhKKEhCW5UNPCsFVgqImyWS6KTAhEUrYoO7kaAWIJCwQzbgl5XrFBB27xoQwfnY6kozJtFz0SgICsWM3VIKWs6qr0tgI15/pQomHhblqjycRUCWe1dUOpxFOiJ/ooQC+IEEBlVdh0r//swxAUACGCjMy0kSsDoiCAA95gpQaBI041ceup5PSlsv5QNXMyixFLVkTXWpYUBYy/lEl4YCdWlLoZ//zGlKUBEhV0SiFT+us7WdBXqAbQ2hdxgDfH4RQsI+kgo2RnWVECiCa0TrUSNjalrUVVKyg0yapYqqVlRTNVLFf/2P/1qVadsTFKlitVMQU1FMy45OS4zVVVVVVVVVVVV",Dr=M(F,Ir),Lr=k.Z.createLock(Ir),kr=new Z;let Mr=!1;const Or=()=>{Mr||(Lr(),Mr=!0)},Nr=F.decodeAudioData(Dr.buffer,e=>{null===kr.audioBufferProperty.value&&(kr.audioBufferProperty.set(e),Or())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),kr.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),Or()});Nr&&Nr.then(e=>{null===kr.audioBufferProperty.value&&(kr.audioBufferProperty.set(e),Or())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),Or()});const Rr=new si(kr,{soundClipOptions:{initialOutputLevel:.4},soundManagerOptions:{categoryName:"user-interface"}});R.register("generalCloseSoundPlayer",Rr);const Br=Rr,Zr="data:audio/mpeg;base64,//swxAAABswbPzQxABEQFyzDMlAAAAGoGRIdz0AAARQAAAAAMCd5QEAxBA4sPlz/BAMfw+ooc8EA/EAYKAh/qBBYfwfD4jB/4nD98ZXetEKIxIqnuursF7pTGkY4dNYcaZhOjzgxDNndb75ggdCsIvV3qoeM9HIX215a6Hftuc5FhwFRhvuJuhxbMPp+ir0KlAaCTHVtZuCsLISS//syxAYACGhJXR2jABEVIGmw8YpieZwGg6y5/p6bf69uls4kMS9HVvrXl8hI5WPBY8FawqGh3PYlLA0HQm6ZHvUe/4UB4ChNzls1AZIAAxJNQMBOy4KAeSsL0QgRcxFInzpyhsQ6tvdvaM160ZnbY/2bY19dTlJVJmhrQpT/Vf0eVjfzG////6PMYzmtqJdg0WqADvRwaGDBgBO5T//7MsQFgAkEZSA1swABDRYvdx5QAhmAEZHdFc2HHLBy/LcmfqWvq1yftVsQSJAxzSi25i5w6qqvMy/cjgNSoKu2Q1LHp1S4NCJQsHfLUSINPxK6oxocyIhmMRkMhQAQBuyhLerW2u5zoV4af2nULcHzwOiPxQjFU/nvIyflMKARabfnQqGI/v/FAIV6UJnPAgAca//9NZUgFEnVWuP/+zLEA4AIVL1vnYQAEQkIajDMpMja7T9a7DL+uzSEg2RRajlNmUzFPCBtL7Uyoa/iVlabnj1+Pi9f61X5WuJ9V1XhkOmtYltLGPI1//8s/0PMAKmLuWQPy0Hrh0Uy4C5MCaWoC5bwOjrQpVOQIn9JNDksr2zEBLvAp3LCI8Is9BX1FTsS50j5Us8OCIqEg73ZZ9QByyIAiddlUPU0//swxAUCSEyXLMywatDDBOHA8zBIRfBtlFDU3P7EItHsWE51WgaTVpJLPMzOMYE1qUSth4pRSd1WkZLqqrnGPUobBm4oDUDHol//+rJBUlwL0rYuAoOSuFITEsfTp5a46IhKRBQ6FQkBQCWJESR0KhIeNASKGnsJgJCf///1VUxBTUUzLjk5LjNVVVVVVVVVVVVVVVVVVVVVVVVV",qr=M(F,Zr),Fr=k.Z.createLock(Zr),Hr=new Z;let zr=!1;const Yr=()=>{zr||(Fr(),zr=!0)},Gr=F.decodeAudioData(qr.buffer,e=>{null===Hr.audioBufferProperty.value&&(Hr.audioBufferProperty.set(e),Yr())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),Hr.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),Yr()});Gr&&Gr.then(e=>{null===Hr.audioBufferProperty.value&&(Hr.audioBufferProperty.set(e),Yr())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),Yr()});const Wr=new si(Hr,{soundClipOptions:{initialOutputLevel:.4},soundManagerOptions:{categoryName:"user-interface"}});R.register("generalOpenSoundPlayer",Wr);const Ur=Wr;const Xr=new class{play(){}stop(){}};R.register("nullSoundPlayer",Xr);const Kr=Xr;var jr=i(4974);const Qr=new Te.Z("DynamicMarkerIO",{supertype:Te.Z.ObjectIO,applyState:_.noop,toStateObject:()=>({}),isValidValue:_.stubTrue,documentation:"IO Type used as a place holder for dynamic elements to be created when set for state."});jr.Z.register("DynamicMarkerIO",Qr);const Jr=Qr,$r=e=>{const t=e.split("."),i=t.pop(),s=_.get(window,t);return s?s[i].bind(s):null};Je.Z.register("gracefulBind",$r);const eo=$r,to=(e,t)=>class extends e{constructor(){for(var e=arguments.length,i=new Array(e),s=0;s{e?a.showPopup(this.popupParent,a.isModal):a.hidePopup(this.popupParent,a.isModal)})}layout(e){this.layoutBounds&&(this.popupParent.matrix=ur.getLayoutMatrix(this.layoutBounds,e))}show(){this._nodeToFocusOnHide=this._focusOnHideNode||v.IKS.pdomFocusedNode,this.isShowingProperty.value=!0,this._focusOnShowNode&&this._focusOnShowNode.focusable&&this._focusOnShowNode.focus()}hide(){this.interruptSubtreeInput(),this.isShowingProperty.value=!1,this._nodeToFocusOnHide&&this._nodeToFocusOnHide.focusable&&this._nodeToFocusOnHide.focus()}dispose(){this.hide(),this.isShowingProperty.dispose(),super.dispose()}};class io extends v.NBX{constructor(e,t){const i=(0,ae.ZP)()({children:[e]},t);super(i),this.show=i.show,this.hide=i.hide,this.layout=i.layout}}mt.register("Popupable",to);const so=to,no=(0,lt.Z)("SUN");mt.register("SunStrings",no);const ro=no;class oo extends(so(yt,1)){constructor(e,t){const i=(0,ae.ZP)()({xSpacing:10,ySpacing:10,topMargin:15,bottomMargin:15,leftMargin:null,maxWidthMargin:12,maxHeightMargin:12,closeButtonLength:18.2,closeButtonTopMargin:10,closeButtonRightMargin:10,title:null,titleAlign:"center",addAriaLabelledByFromTitle:!0,layoutStrategy:ao,closeButtonListener:()=>this.hide(),closeButtonColor:"black",closeButtonTouchAreaXDilation:0,closeButtonTouchAreaYDilation:0,closeButtonMouseAreaXDilation:0,closeButtonMouseAreaYDilation:0,closeButtonVoicingDialogTitle:null,closeButtonLastInPDOM:!1,openedSoundPlayer:Ur,closedSoundPlayer:Br,sim:xr("phet.joist.sim"),showCallback:null,hideCallback:null,layoutBounds:ur.DEFAULT_LAYOUT_BOUNDS,focusOnShowNode:null,cornerRadius:10,resize:!0,fill:"white",stroke:"black",backgroundPickable:!0,maxHeight:null,maxWidth:null,tandem:L.Z.OPTIONAL,phetioType:oo.DialogIO,phetioReadOnly:D.Z.DEFAULT_OPTIONS.phetioReadOnly,phetioState:D.Z.DEFAULT_OPTIONS.phetioState,visiblePropertyOptions:{phetioReadOnly:!0},tagName:"div",ariaRole:"dialog"},t);i.xMargin=0,i.yMargin=0,null===i.leftMargin&&(i.leftMargin=i.xSpacing+i.closeButtonLength+i.closeButtonRightMargin),!i.maxWidth&&i.layoutBounds&&(i.maxWidth=ho(i.layoutBounds.width,i.maxWidthMargin)),!i.maxHeight&&i.layoutBounds&&(i.maxHeight=ho(i.layoutBounds.height,i.maxHeightMargin));const s=new gi.Z({priority:gi.Z.MEDIUM_PRIORITY,voicingCanAnnounceProperties:[v.LY3.voicingFullyEnabledProperty]}),n=new Cr({iconLength:i.closeButtonLength,baseColor:"transparent",buttonAppearanceStrategy:Yi.FlatAppearanceStrategy,xMargin:0,yMargin:0,listener:()=>{n.voicingSpeakContextResponse({utterance:s}),i.closeButtonListener()},pathOptions:{stroke:i.closeButtonColor},tandem:i.tandem.createTandem("closeButton"),phetioReadOnly:i.phetioReadOnly,phetioState:!1,visiblePropertyOptions:{phetioFeatured:!1,phetioState:!1},enabledPropertyOptions:{phetioFeatured:!1},soundPlayer:Kr,tagName:"button",innerContent:ro.a11y.closeStringProperty,voicingContextResponse:ro.a11y.closedStringProperty});let r;if(i.closeButtonVoicingDialogTitle){const e="string"==typeof i.closeButtonVoicingDialogTitle?new O.Z(i.closeButtonVoicingDialogTitle):i.closeButtonVoicingDialogTitle;r=n.voicingNameResponse=new gn(ro.a11y.titleClosePatternStringProperty,{title:e})}n.touchArea=n.bounds.dilatedXY(i.closeButtonTouchAreaXDilation,i.closeButtonTouchAreaYDilation),n.mouseArea=n.bounds.dilatedXY(i.closeButtonMouseAreaXDilation,i.closeButtonMouseAreaYDilation);let o=[i.title,e];i.closeButtonLastInPDOM?o.push(n):o.unshift(n),o=o.filter(e=>null!=e),i.focusOnShowNode=i.focusOnShowNode?i.focusOnShowNode:o[0].focusable?o[0]:n;const a=new v.SHm({children:i.title?[i.title,e]:[e],spacing:i.ySpacing,align:i.titleAlign}),h=new v.DbO(a,{topMargin:i.topMargin,bottomMargin:i.bottomMargin,leftMargin:i.leftMargin}),l=new v.DbO(n,{topMargin:i.closeButtonTopMargin,rightMargin:i.closeButtonRightMargin}),d=new v.BET({children:[h,l],spacing:i.xSpacing,align:"top"});super(d,i),this.isShowingProperty.lazyLink(e=>{e?(i.openedSoundPlayer.play(),i.showCallback&&i.showCallback()):(i.closedSoundPlayer.play(),i.hideCallback&&i.hideCallback())}),this.sim=i.sim,this.closeButton=n;const c=he.Z.multilink([this.sim.boundsProperty,this.sim.screenBoundsProperty,this.sim.scaleProperty,this.sim.selectedScreenProperty,this.isShowingProperty,this.localBoundsProperty],(e,t,s)=>{e&&t&&s&&i.layoutStrategy(this,e,t,s)});this.pdomOrder=o,i.title&&i.title.tagName&&i.addAriaLabelledByFromTitle&&this.addAriaLabelledbyAssociation({thisElementName:v.Grz.PRIMARY_SIBLING,otherNode:i.title,otherElementName:v.Grz.PRIMARY_SIBLING});const u={keydown:e=>{const t=e.domEvent;if(v.ntP.isKeyEvent(e.domEvent,v.ntP.KEY_ESCAPE))t.preventDefault(),this.hide();else if(v.ntP.isKeyEvent(e.domEvent,v.ntP.KEY_TAB)&&v.ITT.isFullScreen()){const e=v.IKS.pdomFocus.trail.getUniqueId(),i=v.eDZ.getNextFocusable().id===e,s=v.eDZ.getPreviousFocusable().id===e;i&&s&&t.preventDefault()}}};this.addInputListener(u),this.disposeDialog=()=>{c.dispose(),l.dispose(),this.removeInputListener(u),r&&r.dispose(),n.dispose(),a.dispose(),d.removeAllChildren(),d.detach()}}dispose(){this.disposeDialog(),super.dispose()}}function ao(e,t,i,s){e.layoutBounds&&(e.center=e.layoutBounds.center)}function ho(e,t){return e>2*t?e-2*t:e}a=oo,_defineProperty(oo,"DialogIO",new Te.Z("DialogIO",{valueType:a,supertype:Jr})),mt.register("Dialog",oo);class lo extends L.Z{constructor(e,t,i){super(e,t,{...i,isValidTandemName:e=>/^[a-zA-Z0-9_]+$/.test(e)})}getArchetypalPhetioID(){return window.phetio.PhetioIDUtils.append(this.parentTandem.getArchetypalPhetioID(),L.i)}}_defineProperty(lo,"DYNAMIC_ARCHETYPE_NAME",L.i),jr.Z.register("DynamicTandem",lo);const co=lo;class uo extends D.Z{constructor(e,t,i){const s=(0,ae.ZP)()({phetioState:!1,tandem:L.Z.OPTIONAL,supportsDynamicState:!0,containerSuffix:"Container",phetioDynamicElementName:void 0},i);if(Array.isArray(t),s.phetioDynamicElementName=s.tandem.name.slice(0,s.tandem.name.length-s.containerSuffix.length),super(s),this.supportsDynamicState=s.supportsDynamicState,this.phetioDynamicElementName=s.phetioDynamicElementName,this.createElement=e,this.defaultArguments=t,this._archetype=this.createArchetype(),this.elementCreatedEmitter=new Ce.Z({parameters:[{valueType:D.Z,phetioType:s.phetioType.parameterTypes[0],name:"element"},{name:"phetioID",phetioType:it.Z}],tandem:s.tandem.createTandem("elementCreatedEmitter"),phetioDocumentation:"Emitter that fires whenever a new dynamic element is added to the container."}),this.elementDisposedEmitter=new Ce.Z({parameters:[{valueType:D.Z,phetioType:s.phetioType.parameterTypes[0],name:"element"},{name:"phetioID",phetioType:it.Z}],tandem:s.tandem.createTandem("elementDisposedEmitter"),phetioDocumentation:"Emitter that fires whenever a dynamic element is removed from the container."}),L.Z.PHET_IO_ENABLED&&(this.elementCreatedEmitter.addListener(e=>this.createdEventListener(e)),this.elementDisposedEmitter.addListener(e=>this.disposedEventListener(e))),this.notificationsDeferred=!1,this.deferredCreations=[],this.deferredDisposals=[],L.Z.PHET_IO_ENABLED&&this.supportsDynamicState&&!this.phetioIsArchetype){const e=phet.phetio.phetioEngine.phetioStateEngine;e.clearDynamicElementsEmitter.addListener((e,t)=>{this.tandem.hasAncestor(t)&&(this.clear(),this.setNotificationsDeferred(!0))}),e.stateSetEmitter.addListener(()=>{this.notificationsDeferred&&this.setNotificationsDeferred(!1)}),e.addSetStateHelper((e,t)=>{let i=!1,s=0;for(;this.deferredCreations.length>0;){if(s>200)throw new Error("Too many iterations in deferred creations, stillToSetIDs = "+t.join(", "));const e=this.deferredCreations[0];this.stateSetOnAllChildrenOfDynamicElement(e.tandem.phetioID,t)&&(this.notifyElementCreatedWhileDeferred(e),i=!0),s++}return i})}}stateSetOnAllChildrenOfDynamicElement(e,t){for(let i=0;i0;)this.notifyElementCreatedWhileDeferred(this.deferredCreations[0]);for(;this.deferredDisposals.length>0;)this.notifyElementDisposedWhileDeferred(this.deferredDisposals[0])}this.notificationsDeferred=e}get archetype(){return function(e){if(null===e)throw new Error("archetype should exist");return e}(this._archetype)}getMetadata(e){const t=super.getMetadata(e);return(0,Se.Z)({phetioDynamicElementName:this.phetioDynamicElementName},t)}}jr.Z.register("PhetioDynamicElementContainer",uo);const po=uo,mo=new Map;class go extends po{constructor(e,t,i){super(e,t,i=(0,ae.ZP)()({tandem:L.Z.OPTIONAL,containerSuffix:"Capsule"},i)),this.element=null}disposeElement(){super.disposeElement(this.element),this.element=null}hasElement(){return null!==this.element}getElement(){if(!this.element){for(var e=arguments.length,t=new Array(e),i=0;i1&&void 0!==arguments[1]&&arguments[1];return this.element=this.createDynamicElement(this.phetioDynamicElementName,e,L.Z.PHET_IO_ENABLED?this.phetioType.parameterTypes[0]:null),this.notifyElementCreated(this.element),this.element}}h=go,_defineProperty(go,"PhetioCapsuleIO",e=>(mo.has(e)||mo.set(e,new Te.Z(`PhetioCapsuleIO<${e.typeName}>`,{valueType:h,documentation:"An array that sends notifications when its values have changed.",parameterTypes:[e],metadataDefaults:{phetioDynamicElementName:null},addChildElement(t,i,s){const n=e.stateObjectToCreateElementArguments(s);return t.create(n,!0)}})),mo.get(e))),jr.Z.register("PhetioCapsule",go);const yo=go,fo=new Image,Ao=k.Z.createLock(fo);fo.onload=Ao,fo.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAAA+CAYAAABuv5bfAAAACXBIWXMAABhMAAAYTAGIN/zbAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAxlJREFUeNrsW8tx2zAQBWPfpWNupiswc8oxcgVhbr6ZJbADswSWoBJQAtwBVUHoDqhbcmIWnuVEhpfSYkhKILU7s8MR/CgsnoH9AFDUtq1akkRRVMDj5aDpEcZoxuzji1qerKfuYImkJULa8JlWj+4CluTTwJ/F8Ph92Abji2Sm9RNmZ5h2mnd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YWR5ccllPAAAAttJREFUeNrsW91RwzAMdnu8txsQJqiZoGECyhtvlAmaDSgbZIRuQEYIG4QJCBukb7yFiHPvgisV+fJTJ5XudL24MpI/9Ge7mZRlqUZG24pfas93FadtKpiq8dG8awVjBE0LaM09LW9bwWRkOS2o+NNeo3jaaQ9LrLGPLhRdjSB/hYbvke/TLpQOKTyDGkjwuWTMuekip/nuaQDQ2nxeO8zbVxx1AZjvoMUVbxznQA7bGS66MszX8MSqIOVRqeGkK88aiqdtT3z3bgACoLJzGOerp0Fozayw2yItxVnIR09bWYAdxnJfDPSxuQ2t5y+fAMM8LUSM7pserefvf3JcH5TU8+chp2lTphdK6FQBgjRRAGiBQXEmuLD6wHBqXF8A4xFEYgSeVgoWbt4moLXYcsBlxERYvQ6lTxuspwkJaOfbe87V8fVYytwKZQo/37LlcmLLpNXfW6aCOOEIDP9nI7YWysZjKnEKoahanCFyESIXI3IJIhchcgUipwkbNSJbMG1MmDZuMcUu4bkg/mOYV3DksLEZU67p/LmDHslpUggGABp28Zq1PIbpgMKwt8b2RMHg2thb9QytfEVVsEgdH0unxBnVrZVLMgI0bVVFqspybewNtELxb6y5ctwFUSA1sVFymhQCAe2yQdvBBoLBK2TuCpGLiW1QYcllJ/JhXa5AtlDK6LF1L/sC7YkppxuMBUhXv2DuUGYEaFrCU3La+EHbjxwL9k+zXJpbTeQMTsMaI01nTjTFd8zF3CInE1hju25gd2PQuF35UHcTktOkEAhowyeXnBYjjWKE5Ja1YV+Ia+POcKugbYjtEWbQ0iPQXGzcSXhKThPQLqYQPCCFICYS78qjNXJtTLoALWH+4Uyd6aUIB2pko4SngCagDa4QQPMXCjw4BvJDZXf6gvD8EBycKAVPg37lTbBgERz566npvZ4FDxZgv+/F11+SDRX/PP3SKDM7ixwefgQYAIqW2LtFfuBbAAAAAElFTkSuQmCC";const vo=Po;class wo extends v.BET{constructor(e,t,i){const s=(0,ae.ZP)()({fill:"white",highlightWidth:1,pickable:!1},i);s.spacing=e;const n=s.fill,r=v.Ilk.toColor(n).withAlpha(0),o={fill:new v.oas(0,0,0,t).addColorStop(0,r).addColorStop(.5,n).addColorStop(1,r)},a=new v.AeJ(0,0,s.highlightWidth,t,o),h=new v.AeJ(0,0,s.highlightWidth,t,o);s.children=[a,h],super(s)}}T.Z.register("HighlightNode",wo);const So=wo;class To extends((0,v.CHP)(v.NBX)){constructor(e,t,i){const s=(0,ae.ZP)()({cursor:"pointer",listener:null,highlightExtensionWidth:0,highlightExtensionHeight:0,highlightCenterOffsetX:0,highlightCenterOffsetY:0,pointerAreaDilationX:0,pointerAreaDilationY:0,enabledPropertyOptions:{phetioFeatured:!1},disabledOpacity:v.iaM.DISABLED_OPACITY,tagName:"button"},i),n=function(t){return new So(e.width+s.highlightExtensionWidth,e.height+s.highlightExtensionHeight,{centerX:e.centerX+s.highlightCenterOffsetX,centerY:e.centerY+s.highlightCenterOffsetY,fill:t,pickable:!1})},r=n("white"),o=n("black");s.children=[e,r,o],super(s),this.buttonModel=new qi(s);const a=new Ni(this.buttonModel);this.interactionStateProperty=a,he.Z.multilink([a,t,this.buttonModel.enabledProperty],(e,t,i)=>{const s=!t.equals(v.Ilk.BLACK);r.visible=!s&&i&&(e===Oi.OVER||e===Oi.PRESSED),o.visible=s&&i&&(e===Oi.OVER||e===Oi.PRESSED)}),this.buttonModel.enabledProperty.link(e=>{this.cursor=e?s.cursor:null}),this._pressListener=this.buttonModel.createPressListener({tandem:s.tandem.createTandem("pressListener")}),this.addInputListener(this._pressListener),this.mouseArea=this.touchArea=Qe.bn.bounds(this.bounds.dilatedXY(s.pointerAreaDilationX,s.pointerAreaDilationY));const h=v.YiU.getOuterLineWidthFromNode(this);this.focusHighlight=Qe.bn.bounds(this.bounds.shiftedY(-h))}isPDOMClicking(){return this._pressListener.pdomClickingProperty.get()}}T.Z.register("JoistButton",To);const Eo=un.Z.a11y.keyboardHelp.tabToGetStartedStringProperty;class _o extends oo{constructor(e,t,i){const s=(0,ae.ZP)()({titleAlign:"center",fill:"rgb( 214, 237, 249 )",ySpacing:15,phetioReadOnly:!0,phetioDynamicElement:!0,closeButtonVoicingDialogTitle:un.Z.keyboardShortcuts.titleStringProperty,addAriaLabelledByFromTitle:!1},i),n=new v.NBX({tagName:"div"}),r=s.tandem.createTandem("content"),o=[];e.forEach(e=>{const t=r.createTandem(e.tandem.name),i=e.createKeyboardHelpNode(t);o.push(i)});const a=new v.JxC(un.Z.keyboardShortcuts.titleStringProperty,{font:new ht({weight:"bold",size:24}),maxWidth:670,tagName:"h1",innerContent:un.Z.a11y.keyboardHelp.keyboardShortcutsStringProperty}),h=new xo,l=new v.SHm({children:[a,h],spacing:5,tagName:"div"});s.title=l,super(n,s);const d=he.Z.multilink([t,this.isShowingProperty],(t,i)=>{const s=o[e.indexOf(t)];i&&(n.children=[s])});this.addAriaLabelledbyAssociation({thisElementName:v.Grz.PRIMARY_SIBLING,otherNode:a,otherElementName:v.Grz.PRIMARY_SIBLING}),this.disposeKeyboardHelpDialog=()=>{d.dispose(),h.dispose(),a.dispose(),o.forEach(e=>e.dispose()),o.length=0,n.dispose()}}dispose(){this.disposeKeyboardHelpDialog(),super.dispose()}}class xo extends((0,v.KwY)(v.NBX)){constructor(e){const t=(0,ae.ZP)()({readingBlockNameResponse:Eo},e);super();const i=an.labelWithIcon(un.Z.keyboardShortcuts.toGetStartedStringProperty,Hs.tab({disposer:this}),{labelInnerContent:Eo,iconOptions:{tagName:"p"}});i.disposer=this;const s=new v.BET({children:[i.icon,i.label],spacing:4,disposer:this});this.addChild(s),this.mutate(t)}}T.Z.register("KeyboardHelpDialog",_o);const Co=un.Z.a11y.keyboardHelp.keyboardShortcutsStringProperty;class Io extends To{constructor(e,t,i,s){const n=(0,ae.ZP)()({highlightExtensionWidth:8.6,highlightExtensionHeight:10,highlightCenterOffsetY:2,visiblePropertyOptions:{phetioFeatured:!0},innerContent:Co,voicingNameResponse:Co},s);let r=null;n.listener=()=>{r.getElement().show()};const o=new v.Eep(vo,{scale:.3/vo.height*67*.85,pickable:!1});super(o,i,n),r=new yo(i=>new _o(e,t,{tandem:i,focusOnHideNode:this}),[],{tandem:n.tandem.createTandem("keyboardHelpDialogCapsule"),phetioType:yo.PhetioCapsuleIO(oo.DialogIO)}),i.link(e=>{o.image=e.equals(v.Ilk.BLACK)?vo:bo})}}T.Z.register("KeyboardHelpButton",Io);const Do=Io;var Lo=i(6692);class ko extends gi.Z{constructor(e){const t=(0,ae.ZP)()({alertStableDelay:500},e);super(t)}}Lo.Z.register("ActivationUtterance",ko);const Mo=Math.PI/2.7,Oo=-1*Mo;class No extends To{constructor(e,t,i){const s=(0,ae.ZP)()({highlightExtensionWidth:8.6,highlightExtensionHeight:10,highlightCenterOffsetY:0,enabled:!(phet.chipper.isFuzzEnabled()&&phet.chipper.queryParameters.supportsVoicing),visiblePropertyOptions:{phetioFeatured:!0},innerContent:un.Z.a11y.soundToggle.labelStringProperty,voicingNameResponse:un.Z.a11y.soundToggle.labelStringProperty},i);s.listener=()=>e.set(!e.get());const n=new v.NBX,r=new v.NBX,o=new v.AeJ(0,0,24.86,22,{fill:"transparent"});n.addChild(o),r.addChild(o);const a=new v.y$t((new Qe.bn).moveTo(9.8252,0).lineTo(4.519592,(16.94-5.929)/2).lineTo(1,(16.94-5.929)/2).arc(1,(16.94-5.929)/2+1,1,1.5*Math.PI,Math.PI,!0).lineToRelative(0,5.929-2).arc(1,10.4345,1,Math.PI,.5*Math.PI,!0).lineToRelative(4.519592-1,0).lineTo(9.8252,16.94).lineTo(9.8252,0).close(),{stroke:"black",lineWidth:1.5,lineJoin:"round",centerY:r.centerY,left:0});n.addChild(a),r.addChild(a);const h=new v.y$t((new Qe.bn).moveTo(0,0).lineTo(16.94*.52,16.94*.52).moveTo(0,16.94*.52).lineTo(16.94*.52,0),{stroke:"black",lineWidth:1.7,lineCap:"round",right:r.width,centerY:r.centerY});r.addChild(h);const l=new v.y$t((new Qe.bn).arc(0,0,10.6722,Mo,Oo,!0).moveToPoint(new Ke.Z(6.776,0).rotated(Mo)).arc(0,0,6.776,Mo,Oo,!0).moveToPoint(new Ke.Z(6.776-16.94*.23,0).rotated(Mo)).arc(0,0,6.776-16.94*.23,Mo,Oo,!0),{stroke:"black",lineWidth:1.7,lineCap:"round",right:n.width,centerY:n.centerY});n.addChild(l),super(new Ki(Ae.anyOutputEnabledProperty,[{value:!0,createNode:()=>n},{value:!1,createNode:()=>r}],{maxHeight:18.7}),t,s),this.addLinkedElement(e,{tandem:s.tandem.createTandem("property")});const d=new ko;e.lazyLink(e=>{s.supportsAudioPreferences&&(this.setPDOMAttribute("aria-pressed",e),d.alert=e?un.Z.a11y.soundToggle.alert.simSoundOnStringProperty:un.Z.a11y.soundToggle.alert.simSoundOffStringProperty,this.alertDescriptionUtterance(d),v.LY3.voicingFullyEnabledProperty.value&&v.LY3.speakIgnoringEnabled(d))}),this.setPDOMAttribute("aria-pressed",e.get()),Ae.anySubcomponentEnabledProperty.link(e=>{this.enabled=e}),t.link(e=>{const t=e.equals(v.Ilk.BLACK)?"white":"black";a.stroke=t,h.stroke=t,l.stroke=t})}}T.Z.register("NavigationBarAudioToggleButton",No);const Ro=No,Bo=new Qe.bn("M610.5 373.3c2.6-14.1 2.6-28.5 0-42.6l25.8-14.9c3-1.7 4.3-5.2 3.3-8.5-6.7-21.6-18.2-41.2-33.2-57.4-2.3-2.5-6-3.1-9-1.4l-25.8 14.9c-10.9-9.3-23.4-16.5-36.9-21.3v-29.8c0-3.4-2.4-6.4-5.7-7.1-22.3-5-45-4.8-66.2 0-3.3.7-5.7 3.7-5.7 7.1v29.8c-13.5 4.8-26 12-36.9 21.3l-25.8-14.9c-2.9-1.7-6.7-1.1-9 1.4-15 16.2-26.5 35.8-33.2 57.4-1 3.3.4 6.8 3.3 8.5l25.8 14.9c-2.6 14.1-2.6 28.5 0 42.6l-25.8 14.9c-3 1.7-4.3 5.2-3.3 8.5 6.7 21.6 18.2 41.1 33.2 57.4 2.3 2.5 6 3.1 9 1.4l25.8-14.9c10.9 9.3 23.4 16.5 36.9 21.3v29.8c0 3.4 2.4 6.4 5.7 7.1 22.3 5 45 4.8 66.2 0 3.3-.7 5.7-3.7 5.7-7.1v-29.8c13.5-4.8 26-12 36.9-21.3l25.8 14.9c2.9 1.7 6.7 1.1 9-1.4 15-16.2 26.5-35.8 33.2-57.4 1-3.3-.4-6.8-3.3-8.5l-25.8-14.9zM496 400.5c-26.8 0-48.5-21.8-48.5-48.5s21.8-48.5 48.5-48.5 48.5 21.8 48.5 48.5-21.7 48.5-48.5 48.5zM224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm201.2 226.5c-2.3-1.2-4.6-2.6-6.8-3.9l-7.9 4.6c-6 3.4-12.8 5.3-19.6 5.3-10.9 0-21.4-4.6-28.9-12.6-18.3-19.8-32.3-43.9-40.2-69.6-5.5-17.7 1.9-36.4 17.9-45.7l7.9-4.6c-.1-2.6-.1-5.2 0-7.8l-7.9-4.6c-16-9.2-23.4-28-17.9-45.7.9-2.9 2.2-5.8 3.2-8.7-3.8-.3-7.5-1.2-11.4-1.2h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c10.1 0 19.5-3.2 27.2-8.5-1.2-3.8-2-7.7-2-11.8v-9.2z").makeImmutable();class Zo extends v.zch{constructor(e){const t=(0,ae.ZP)()({headingControl:!1,labelSpacing:10,valueLabelXSpacing:8,ySpacing:5,nestedContent:[],grow:1,layoutOptions:{stretch:!(null!=e&&e.headingControl)}},e);super(t),t.controlNode&&(this.enabledProperty.link(e=>{t.controlNode.enabled=e}),t.controlNode.layoutOptions={row:0,column:1,xAlign:"right"},this.addChild(t.controlNode)),t.labelNode&&(t.labelNode.layoutOptions={row:0,column:0,xAlign:"left",rightMargin:t.labelSpacing},this.addChild(t.labelNode)),t.descriptionNode&&t.labelNode?(t.descriptionNode.layoutOptions={row:1,column:0,horizontalSpan:2,xAlign:"left"},this.addChild(t.descriptionNode)):t.descriptionNode&&(t.descriptionNode.layoutOptions={row:0,column:0,xAlign:"left"},this.addChild(t.descriptionNode)),this.disabledOpacity=v.iaM.DISABLED_OPACITY}}T.Z.register("PreferencesControl",Zo);const qo=Zo,Fo="data:audio/mpeg;base64,//swxAAAA8ADNZQRgDGHni23MIAC1bbaiNgdgM+wEHBiogUAbxA4MT+////gh//8Mf4YzNI0kYiNYjDZaLJCYAZZgbhKQTNx5Vp34WpSu/bhLvzLYwWSHokUhx0EBR4FA/Mp8sOz3gcWfL9YqH7kKIkzd9fLvSkB201St7337UyHKf7X9Pf//Ue9/6irjy/l3s5gqCo1lPVlVSBj//syxAOACFB7hZyUgDEUCu008ZpKfZq0pMq3UhCDwXYfD+n5X+IUp5YiEYMB0CgRCwfQF0AmAUjAlZVJuE4ZaTbKK0AIJCxUAwrWLf////l1oFP9Yo2m1QI89G8bsISUXc8TjPs5pDlVUzUq1VJLFYcIlvdQS0P1lohZFx5hFpVDCPaSKlRsdgIslDzfeqxt8iVd+v6aClA3ydRso//7MsQDgAhYV13sGEqhEJFpcZMJqE0gGS8ZU3ekWmMRbO4kqZnMgAHAFiPmBRdQFgRZHZrTNwZcRTYLKU4qxy3ieKohBwSNif5UwYc4W/ywiEYAtIWoggTByJ+YPcFxgdYE5MVlD41ZJSYBdPF8gQIZtZPy/cZWxBR5Bm7WwZdGkolTRTQXLpSOcoUvf3in/dyBZwzRXAF3ieJEAxD/+zLEBAAIkJlXlYaAARIWb3MegACpLHqwdgk0mfJ913UT0LiL5W+nIh+DsKATQJ4F0E4PF8c7FxaaaCZ80SpqZbfX7J/99fN0p/Onf+zSaVmKSAKAgKAgMAAAAAEBCVMt4sfsyRdHO3PTH0SBFi4jhEgNBinEXeeDSKeby9zBMKun3/pKZ6L//H/6T/p/82bkkAyj/5m7WOWuRFpI//swxAOACDgvi7zDADEQkW289AoWMABHxkZCUEwfjodDiYmpiWw9NWjIAhJEFkFSo4GnxwiDsrBoGn/g0DT64Kgq9BUFQWBo3WFDf4B//ljZRUwaFSyREkApYqDmkM8qYgtylZx9ZL7knEF4rFKLgqfa4GHahJbD5q+ZdeybNpd1LOzqJVWdmJgs9uNUoK61I9Pf1runDP5da2kA//syxAQACHita6eYTzEMFSdkzAigHGL2uEMDLL6xtFmUuujunUP9ODzjFKbt2J5yt77uOmiJWXQ6GAbIjvu17WVn/dDEccwhLJLW6dXU/dcsEAvP8BAST22Qg8WJEX2Cxxs84/BnOt15rGZwVs2FEtKWVPRHZitdbuySkumtHlb0M/U5QwcQRYSLI91T/epbUqPPogEGy4Ldq0ABj//7MsQEgAfcrTesFG1owIRiqMyYmD9U8MBcisSsURTFgBykNZkSUjL+oDB8VGCT310AYfb2ZlVRgEvbASNp8ptD8y7lYYlvxtFsCgAAYAQABAzjzrwIrmT2cuLIZOOOhHHQELC2rOtlix709VXnYiej4dx2rz2Vd/xL6QQAAHCikADAVHicCJrfesiRcXCNaoKuuneW+r1dXxFDvZf/+zLEEQBFcCEJoLHi8JuFVvDMGGz/vqeWI50KHuGnJHLWAAQIl4qgkpSn8oGq1rUCoSk3UAhEYtCgKWWwwIDo////4sLVTEFNRTMuOTkuNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",Ho=M(F,Fo),zo=k.Z.createLock(Fo),Yo=new Z;let Go=!1;const Wo=()=>{Go||(zo(),Go=!0)},Uo=F.decodeAudioData(Ho.buffer,e=>{null===Yo.audioBufferProperty.value&&(Yo.audioBufferProperty.set(e),Wo())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),Yo.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),Wo()});Uo&&Uo.then(e=>{null===Yo.audioBufferProperty.value&&(Yo.audioBufferProperty.set(e),Wo())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),Wo()});const Xo=new si(Yo,{soundClipOptions:{initialOutputLevel:.2},soundManagerOptions:{categoryName:"user-interface"}});R.register("switchToLeftSoundPlayer",Xo);const Ko=Xo,jo="data:audio/mpeg;base64,//swxAAABQQDHVQRABFbki33MLACAFiANEhrgagQWfE6eUcJxwPv5wuD/ynh/aXfLvD/9HlwfD//EEEPD7ZhOAkFSjlaqEIiQQAEs4eiJWJc1P1YWHlShsUzcufWA094Hx1uq0G20l0OwMrP+XF59gcKx8JP77pO3m998s/Yw/nLVXnrrpQBsXJUFMLEnmlFmN/yDRSkA2wbEgAA//syxAQACKRzd7zHgAkGB+81hgxyg9V/KSvjePEM6MTwDABAfIScR33O56q5d4xqkH7v3jiaZMD6kY9sjxrY2dnb1HHfvNR/kWIABj/dYQ11+H0jIKJAJJKoO2kaXeWiJIkiSIKkCp6SSSRawEonOLl37VSoUBXLB1R4RArEQNHoKne/wVBU9wWDv4KhL8s9QNP/QiqohANaOyIgAP/7MsQEgAhwYVvmPMihFovqvMwtRAH6Ae14cRCJA0gkI0l3oAaVhTxL2UFGwRUl00mkOm7spnrNztCVjBca9pe1ZAAImV6HsdkkYbqCJBixaWQQZZKZsggAaovjuRz0ay4sAStsBa8qCRLYzJqRvdo6N8kxL5ulvc1t68seeejKSpp09k0Niw9j0xU7cwYDINIb9ZH0VZtohLZJIkj/+zLEA4AIWItlrCBPcRURrbawIAYAJxeV16k/ZdmXyuGXKtUDPLTyWvc8HhHuEmbDWxZs3a26Jzoe0n+dLpP9moqDULbjgomp6BR7tp47Kkb/Yy7HHGiQALQa4vBYdia742/8Tg6Ha/Yveot5iAggAUDAwPPgRG2IQAAAAjEAwP1yvoQIToEAAAQ5YPg+BwcOf+D4PhgAJtta7sOB//swxAOACHRxgbj0gAENjex3sIAAQAgIBAQABwvF95I9BqsaLjRfG8H8voXioPoFOTnP5fr6BAbTCiaJqU//xNPUyOwkrvuV+H0skfwwkh/8uGgaN7U4ykgBI0Wl0NRp9iTTuOtTP3h74fLq2RJI5YD4IhSIZoj1X1UVJEZr6+eMZ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VQ==",Qo=M(F,jo),Jo=k.Z.createLock(jo),$o=new Z;let ea=!1;const ta=()=>{ea||(Jo(),ea=!0)},ia=F.decodeAudioData(Qo.buffer,e=>{null===$o.audioBufferProperty.value&&($o.audioBufferProperty.set(e),ta())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),$o.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),ta()});ia&&ia.then(e=>{null===$o.audioBufferProperty.value&&($o.audioBufferProperty.set(e),ta())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),ta()});const sa=new si($o,{soundClipOptions:{initialOutputLevel:.2},soundManagerOptions:{categoryName:"user-interface"}});R.register("switchToRightSoundPlayer",sa);const na=sa;i(6212);const ra=new ke.Z(60,30);class oa extends((0,v.CHP)(v.NBX)){constructor(e,t,i,s){const n=(0,ae.ZP)()({size:ra,toggleWhileDragging:null,dragThreshold:3,toggleThreshold:1,thumbFill:null,thumbStroke:"black",thumbTouchAreaXDilation:8,thumbTouchAreaYDilation:8,thumbMouseAreaXDilation:0,thumbMouseAreaYDilation:0,trackFillLeft:null,trackFillRight:null,trackStroke:"black",cursor:"pointer",disabledOpacity:v.iaM.DISABLED_OPACITY,switchToLeftSoundPlayer:Ko,switchToRightSoundPlayer:na,tandem:L.Z.REQUIRED,tandemNameSuffix:"Switch",phetioEventType:Ne.Z.USER,phetioReadOnly:D.Z.DEFAULT_OPTIONS.phetioReadOnly,visiblePropertyOptions:{phetioFeatured:!0},phetioEnabledPropertyInstrumented:!0,tagName:"button",ariaRole:"switch",a11yName:null,leftValueContextResponse:null,rightValueContextResponse:null},s);let r=null;n.trackFillLeft&&n.trackFillRight||(r=new v.oas(0,0,0,n.size.height).addColorStop(0,"rgb( 40, 40, 40 )").addColorStop(1,"rgb( 200, 200, 200 )")),n.trackFillLeft=n.trackFillLeft||r,n.trackFillRight=n.trackFillRight||r,n.thumbFill=n.thumbFill||new v.oas(0,0,0,n.size.height).addColorStop(0,"white").addColorStop(1,"rgb( 200, 200, 200 )"),n.a11yName&&(n.voicingNameResponse=n.a11yName,n.innerContent=n.a11yName),super();const o=n.size.height/2,a=new v.AeJ(0,0,n.size.width,n.size.height,o,o,{stroke:n.trackStroke,fill:n.trackFillLeft});this.addChild(a);const h=new v.AeJ(0,0,n.size.width,n.size.height,o,o,{stroke:n.trackStroke,fill:n.trackFillRight});this.addChild(h);const l=new v.AeJ(0,0,.5*n.size.width,n.size.height,o,o,{fill:n.thumbFill,stroke:n.thumbStroke});this.addChild(l),(n.thumbTouchAreaXDilation||n.thumbTouchAreaYDilation)&&(l.touchArea=Qe.bn.roundRect(-n.thumbTouchAreaXDilation,-n.thumbTouchAreaYDilation,.5*n.size.width+2*n.thumbTouchAreaXDilation,n.size.height+2*n.thumbTouchAreaYDilation,o,o)),(n.thumbMouseAreaXDilation||n.thumbMouseAreaYDilation)&&(l.mouseArea=Qe.bn.roundRect(-n.thumbMouseAreaXDilation,-n.thumbMouseAreaYDilation,.5*n.size.width+2*n.thumbMouseAreaXDilation,n.size.height+2*n.thumbMouseAreaYDilation,o,o));const d=e=>{const i=a.lineWidth/2;e===t?l.left=-i:l.right=n.size.width+i,h.rectWidth=l.right-i,this.setPDOMAttribute("aria-pressed",e!==t),this.setPDOMAttribute("aria-checked",e!==t)};e.link(d);const c=n.dragThreshold*n.dragThreshold,u=new Ke.Z(0,0);let p=!1;const m=new qe.Z(s=>{e.value=s,s===t?n.switchToLeftSoundPlayer.play():n.switchToRightSoundPlayer.play();const r=s===i?n.rightValueContextResponse:n.leftValueContextResponse;r&&(this.alertDescriptionUtterance(r),this.voicingSpeakResponse({contextResponse:gi.Z.alertableToText(r)}))},{parameters:[{validValues:[t,i],phetioPrivate:!0}],tandem:n.tandem.createTandem("toggleAction"),phetioDocumentation:"Occurs when the switch is toggled via user interaction",phetioReadOnly:n.phetioReadOnly,phetioEventType:Ne.Z.USER}),g=()=>l.centerX!e||"move"!==e.type&&"enter"!==e.type||_.includes(e.trail.nodes,l),start:()=>{u.setXY(0,0),p=!1},drag:(t,i)=>{u.add(i.modelDelta),p=p||u.magnitudeSquared>c;const s=i.getCurrentTarget().globalToLocalPoint(t.pointer.point),r=l.width/2,o=a.lineWidth/2;l.centerX=I.Z.clamp(s.x,r-o,n.size.width-r+o),h.rectWidth=l.right-o;const d=s.x<(1-2*n.toggleThreshold)*r||s.x>(2*n.toggleThreshold-1)*r+n.size.width,y=g();(!0===n.toggleWhileDragging||d&&null===n.toggleWhileDragging)&&e.value!==y&&m.execute(y)},end:()=>{const s=e.value===t?i:t,n=p?g():s;e.value!==n&&m.execute(n),d(n)},canClick:!0});this.addInputListener(y),this.mutate(n),this.addLinkedElement(e,{tandem:n.tandem.createTandem("property")}),this.switchToLeftSoundPlayer=n.switchToLeftSoundPlayer,this.switchToRightSoundPlayer=n.switchToRightSoundPlayer,this.disposeToggleSwitch=()=>{a.dispose(),h.dispose(),e.unlink(d),m.dispose(),y.dispose()}}dispose(){this.disposeToggleSwitch(),super.dispose()}}mt.register("ToggleSwitch",oa);class aa extends v.SHm{constructor(e){const t=(0,ae.ZP)()({spacing:Fd.CONTENT_SPACING,titleNode:null,contentNode:null,contentNodeOptions:{},contentLeftMargin:30},e),i=new v.Lkj({matchVertical:!1}),s=[];if(t.titleNode&&s.push(i.createBox(t.titleNode,{xAlign:"left"})),t.contentNode){const e=(0,ae.JA)({children:[t.contentNode]},t.contentNodeOptions);s.push(i.createBox(new v.NBX(e),{leftMargin:t.contentLeftMargin,xAlign:"left"}))}t.children=s,super(t),this.disposePreferencesPanelSection=()=>{i.dispose()}}dispose(){this.disposePreferencesPanelSection(),super.dispose()}}T.Z.register("PreferencesPanelSection",aa);const ha=aa,la=new ht({weight:"bold",size:16}),da=new ht(16),ca={TOGGLE_SWITCH_OPTIONS:{size:new ke.Z(36,18),trackFillRight:"#64bd5a",enabled:!(phet.chipper.isFuzzEnabled()&&phet.chipper.queryParameters.supportsVoicing),voicingIgnoreVoicingManagerProperties:!0,tandem:L.Z.OPT_OUT},CONTROL_LABEL_OPTIONS:{font:la,maxWidth:360},CONTROL_DESCRIPTION_OPTIONS:{font:da,maxWidth:500,lineWrap:480}},ua=un.Z.preferences.tabs.audio.sounds.titleStringProperty,pa=un.Z.preferences.tabs.audio.sounds.extraSounds.titleStringProperty,ma=un.Z.preferences.tabs.audio.sounds.descriptionStringProperty,ga=un.Z.preferences.tabs.audio.sounds.extraSounds.descriptionStringProperty,ya=un.Z.a11y.preferences.tabs.audio.sounds.soundsOnStringProperty,fa=un.Z.a11y.preferences.tabs.audio.sounds.soundsOffStringProperty,Aa=un.Z.a11y.preferences.tabs.audio.sounds.extraSounds.extraSoundsOnStringProperty,ba=un.Z.a11y.preferences.tabs.audio.sounds.extraSounds.extraSoundsOffStringProperty,Pa=un.Z.a11y.preferences.tabs.labelledDescriptionPatternStringProperty;class Va extends ha{constructor(e,t){const i=(0,ae.ZP)()({includeTitleToggleSwitch:!0},t),s=new v.xvT(ua,Fd.PANEL_SECTION_LABEL_OPTIONS),n=new gn(Pa,{label:ua,description:ma}),r=new v.JxC(ma,(0,Se.Z)({},Fd.PANEL_SECTION_CONTENT_OPTIONS,{readingBlockNameResponse:n})),o=new oa(e.soundEnabledProperty,!1,!0,(0,ae.JA)({visible:i.includeTitleToggleSwitch,a11yName:ua,leftValueContextResponse:fa,rightValueContextResponse:ya},ca.TOGGLE_SWITCH_OPTIONS)),a=new qo({labelNode:s,descriptionNode:r,controlNode:o});let h=null;if(e.supportsExtraSound){const t=new v.xvT(pa,Fd.PANEL_SECTION_CONTENT_OPTIONS),i=new Pi(e.extraSoundEnabledProperty,t,{labelTagName:"label",labelContent:pa,voicingNameResponse:pa,voicingIgnoreVoicingManagerProperties:!0,voiceNameResponseOnSelection:!1,checkedContextResponse:Aa,uncheckedContextResponse:ba,tandem:L.Z.OPT_OUT}),s=new gn(Pa,{label:pa,description:ga}),n=new v.yhY(ga,(0,Se.Z)({},Fd.PANEL_SECTION_CONTENT_OPTIONS,{lineWrap:300,maxHeight:100,readingBlockNameResponse:s}));h=new v.SHm({children:[i,n],align:"left",spacing:5,tagName:"div"});const r=e=>{h.enabled=e,i.inputEnabled=e};e.soundEnabledProperty.link(r),h.disposeEmitter.addListener(()=>{t.dispose(),i.dispose(),n.dispose(),s.dispose(),e.soundEnabledProperty.unlink(r)})}super({titleNode:a,contentNode:h}),this.disposeSoundPanelSection=()=>{s.dispose(),o.dispose(),r.dispose(),n.dispose(),h&&h.dispose()}}dispose(){this.disposeSoundPanelSection(),super.dispose()}}T.Z.register("SoundPanelSection",Va);const va=Va;var wa=i(5428);class Sa extends Xi{constructor(e,t,i){const s=(0,ae.ZP)()({cursor:"pointer",baseColor:"white",stroke:"black",lineWidth:1,cornerRadius:4,xMargin:7,yMargin:5,touchAreaXDilation:7,touchAreaYDilation:7,arrowHeight:20,arrowWidth:20*Math.sqrt(3)/2,arrowFill:"black",arrowStroke:null,arrowLineWidth:1,numberOfArrows:1,arrowSpacing:-10,fireOnHold:!0,fireOnHoldDelay:400,fireOnHoldInterval:100,startCallback:_.noop,endCallback:_.noop},i);s.listener=t;const n=new Qe.bn;for(let r=0;re.x).concat(e.points.map(e=>e.x)))}getIntersectedXValues(e){const t=this.getCombinedXValues(e),i=[];for(let n=0;ns)&&(n===t.length-2||o.xnew Ke.Z(i,t(this.evaluate(i),e.evaluate(i)))))}binaryPointwiseOperation(e,t){return this.binaryXOperation(e,t,this.getCombinedXValues(e))}binaryIntersectingOperation(e,t){return this.binaryXOperation(e,t,this.getIntersectedXValues(e))}plus(e){return this.binaryPointwiseOperation(e,(e,t)=>e+t)}minus(e){return this.binaryPointwiseOperation(e,(e,t)=>e-t)}min(e){return this.binaryIntersectingOperation(e,Math.min)}max(e){return this.binaryIntersectingOperation(e,Math.max)}withXValues(e){return new Ea(e.map(e=>new Ke.Z(e,this.evaluate(e))))}inverted(){const e=this.points.map(e=>new Ke.Z(e.y,e.x));return e.length>1&&e[0].x>e[1].x&&e.reverse(),new Ea(e)}static sum(){for(var e=arguments.length,t=new Array(e),i=0;ie.plus(t))}static min(){for(var e=arguments.length,t=new Array(e),i=0;ie.min(t))}static max(){for(var e=arguments.length,t=new Array(e),i=0;ie.max(t))}static constant(e){return new Ea([new Ke.Z(0,e)])}static linear(e,t){return new Ea([new Ke.Z(0,t),new Ke.Z(1,e+t)])}static sortedUniqueEpsilon(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e-10;e=_.sortBy(e);for(let i=0;i{let s=xa,n=xa;return e.hasOwnProperty(t)&&(s=e[t]),e.hasOwnProperty(i)&&(n=e[i]),s!==xa?e[i]=s:delete e[i],n!==xa?e[t]=n:delete e[t],e};Je.Z.register("swapObjectKeys",Ca);const Ia=Ca,Da="data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA//tAwAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAAJAAAIpwB1dXV1dXV1dXV1dZmZmZmZmZmZmZmZt7e3t7e3t7e3t7fDw8PDw8PDw8PDw8/Pz8/Pz8/Pz8/P29vb29vb29vb29vn5+fn5+fn5+fn5/Pz8/Pz8/Pz8/Pz//////////////8AAAAATGF2YzU4LjU0AAAAAAAAAAAAAAAAJAaRAAAAAAAACKfAKvQnAAAAAAD/+9DEAAAOsE9AdZGAK8QbJPc/sEAAG+3c2nDeiOKI2kELTFZOe88bTlVNYoyijKIMQAuIoIxCHLCJXfiAAGBu7u7iwAAQAAAAPH/+hH//+Hh63//h///9Dw//wAHfmHh/+AAH/HDw//AAB2YeHh48AAAAARh4eHjwAAAABGHh4ePAAAAAEYeHh72AAAAAAgIGjKTaAgAAADF5zj41poBnMb3YuDrZ4lswWUT3NCZKkDBJA0IwPgKfMOfCCjBCwXEwfcFTMAZAMjBZAUkwToD3MJ5BHTAtQIwwN8BSIAB8wl6OBagd3mygBhQ4n2aSoGCCpjg+gjBRXLFBUc1FzFBNYIwECT6EgFQMwcYTWZjN8zetdqYr7OMFgASAmvSFbs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qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xDE1gPAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg==",La=M(F,Da),ka=k.Z.createLock(Da),Ma=new Z;let Oa=!1;const Na=()=>{Oa||(ka(),Oa=!0)},Ra=F.decodeAudioData(La.buffer,e=>{null===Ma.audioBufferProperty.value&&(Ma.audioBufferProperty.set(e),Na())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),Ma.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),Na()});Ra&&Ra.then(e=>{null===Ma.audioBufferProperty.value&&(Ma.audioBufferProperty.set(e),Na())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),Na()});const Ba=Ma,Za="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAAEAAAE/QCbm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5vBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHB4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4P////////////////////////////////8AAAAUTEFNRTMuMTAwBJgAAAAAAAAAABUgJAXmQQABpAAABP2CPnqIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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VVVVV//sQxNYDwAAB/gAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",qa=M(F,Za),Fa=k.Z.createLock(Za),Ha=new Z;let za=!1;const Ya=()=>{za||(Fa(),za=!0)},Ga=F.decodeAudioData(qa.buffer,e=>{null===Ha.audioBufferProperty.value&&(Ha.audioBufferProperty.set(e),Ya())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),Ha.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),Ya()});Ga&&Ga.then(e=>{null===Ha.audioBufferProperty.value&&(Ha.audioBufferProperty.set(e),Ya())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),Ya()});const Wa=Ha,Ua=new si(Ba,{soundClipOptions:{initialOutputLevel:.2},soundManagerOptions:{categoryName:"user-interface"}});R.register("generalBoundaryBoopSoundPlayer",Ua);const Xa=Ua,Ka=new si(Wa,{soundClipOptions:{initialOutputLevel:.2},soundManagerOptions:{categoryName:"user-interface"}});R.register("generalSoftClickSoundPlayer",Ka);const ja=Ka,Qa=new si(Ba,{soundClipOptions:{initialOutputLevel:.2,initialPlaybackRate:1/Math.pow(2,1/6)},soundManagerOptions:{categoryName:"user-interface"}}),Ja=new si(Wa,{soundClipOptions:{initialOutputLevel:.2,initialPlaybackRate:1/Math.pow(2,1/6)},soundManagerOptions:{categoryName:"user-interface"}}),$a=e=>I.Z.roundToInterval(e,1e-9),eh=()=>1;class th{constructor(e,t){const i=(0,ae.ZP)()({middleMovingUpSoundPlayer:ja,middleMovingDownSoundPlayer:Ja,middleMovingUpPlaybackRateMapper:eh,middleMovingDownPlaybackRateMapper:eh,numberOfMiddleThresholds:null,interThresholdDelta:null,constrainValue:$a,minSoundPlayer:Qa,maxSoundPlayer:Xa,minimumInterMiddleSoundTime:.035},t);null===i.numberOfMiddleThresholds&&null===i.interThresholdDelta&&(i.numberOfMiddleThresholds=5),null!==i.numberOfMiddleThresholds?this.interThresholdDistance=e.getLength()/(i.numberOfMiddleThresholds+1):null!==i.interThresholdDelta?this.interThresholdDistance=i.interThresholdDelta:this.interThresholdDistance=e.getLength()/2,this.valueRange=e,this.middleMovingUpSoundPlayer=i.middleMovingUpSoundPlayer,this.middleMovingDownSoundPlayer=i.middleMovingDownSoundPlayer,this.middleMovingUpPlaybackRateMapper=i.middleMovingUpPlaybackRateMapper,this.middleMovingDownPlaybackRateMapper=i.middleMovingDownPlaybackRateMapper,this.minSoundPlayer=i.minSoundPlayer,this.maxSoundPlayer=i.maxSoundPlayer,this.minimumInterMiddleSoundTime=i.minimumInterMiddleSoundTime,this.timeOfMostRecentMiddleSound=0,this.constrainValue=i.constrainValue}playSoundIfThresholdReached(e,t){if(e!==t){const i=this.constrainValue(e),s=this.constrainValue(t),n=this.getSurroundingThresholds(s),r=this.getSurroundingThresholds(i),o=1===n.length&&1===r.length&&Math.abs(n[0]-r[0])>this.interThresholdDistance||1===n.length&&2===r.length&&n[0]!==r[0]&&n[0]!==r[1]||2===n.length&&1===r.length&&r[0]!==n[0]&&r[0]!==n[1]||2===n.length&&2===r.length&&r[0]!==n[0],a=1===r.length&&(2===n.length||n[0]!==r[0]);(o||a||i===this.valueRange.min||i===this.valueRange.max)&&this.playSoundForValueChange(e,t)}}playSoundForValueChange(e,t){const i=this.constrainValue(e),s=this.constrainValue(t);if(i!==s||t!==e&&(e===this.valueRange.min||e===this.valueRange.max))if(e===this.valueRange.min)this.minSoundPlayer.play();else if(e===this.valueRange.max)this.maxSoundPlayer.play();else{const t=F.currentTime;if(t-this.timeOfMostRecentMiddleSound>this.minimumInterMiddleSoundTime){let n,r;i>s?(n=this.middleMovingUpPlaybackRateMapper,r=this.middleMovingUpSoundPlayer):(n=this.middleMovingUpPlaybackRateMapper,r=this.middleMovingDownSoundPlayer),n!==eh&&r.setPlaybackRate(n(e)),r.play(),this.timeOfMostRecentMiddleSound=t}}}getSurroundingThresholds(e){const t=Math.floor(I.Z.roundToInterval((e-this.valueRange.min)/this.interThresholdDistance,1e-7)),i=I.Z.roundToInterval(t*this.interThresholdDistance+this.valueRange.min,1e-7),s=[i];if(i!==e){const e=Math.min(I.Z.roundToInterval(i+this.interThresholdDistance,1e-7),this.valueRange.max);e>i&&s.push(e)}return s}}_defineProperty(th,"NO_SOUND",new th(new wa.Z(0,1),{middleMovingUpSoundPlayer:Kr,minSoundPlayer:Kr,maxSoundPlayer:Kr})),R.register("ValueChangeSoundPlayer",th);const ih=th;var sh=i(2573);const nh=e=>""+e,rh={withNameResponse:!1,withObjectResponse:!0,onlyOnValueChange:!0},oh=QueryStringMachine.containsKey("aFunTest"),ah=(e,t)=>class extends((0,v.CHP)(e)){constructor(){for(var e=arguments.length,i=new Array(e),s=0;s{const t=this._getMappedValue(e.min),i=this._getMappedValue(e.max);this.setPDOMAttribute("min",t),this.setPDOMAttribute("max",i),this._updateSiblingStepAttribute()};this._enabledRangeProperty.link(h);const l=()=>{const e=this._getMappedValue();this.setPDOMAttribute("aria-valuenow",e),this.inputValue=e};this._valueProperty.link(l),this._disposeAccessibleValueHandler=()=>{this._enabledRangeProperty.unlink(h),this._valueProperty.unlink(l),this._dependenciesMultilink&&this._dependenciesMultilink.dispose(),this._panTargetNode=null}}setA11yDependencies(e){this._dependenciesMultilink&&this._dependenciesMultilink.dispose(),this._dependenciesMultilink=he.Z.multilinkAny(e.concat([this._valueProperty]),()=>{this._updateAriaValueText(this._oldValue),this._oldValue=this._valueProperty.value})}_updateAriaValueText(e){const t=this._getMappedValue(),i=this._a11yCreateAriaValueText(t,this._valueProperty.value,e);let s=v.eDZ.unwrapStringProperty(i);this._a11yRepeatEqualValueText&&this.ariaValueText&&s===this.ariaValueText.replace(new RegExp(" ","g"),"")&&(s=this.ariaValueText+" "),this.ariaValueText=s}alertContextResponse(){let e=!1;if(this._a11yCreateContextResponseAlert){const t=this._getMappedValue(),i=this._a11yCreateContextResponseAlert(t,this._valueProperty.value,this._valueOnStart);i&&(this._contextResponseUtterance.alert=i,this.forEachUtteranceQueue(t=>{e||(t.hasUtterance(this._contextResponseUtterance)?(e=!0,this._timesChangedBeforeAlerting++):this._timesChangedBeforeAlerting=1),this._contextResponseUtterance.alertStableDelay=Math.min(this._contextResponseMaxDelay,this._timesChangedBeforeAlerting*this._contextResponsePerValueChangeDelay),t.addToBack(this._contextResponseUtterance)}))}}reset(){this._a11yCreateAriaValueText.reset&&this._a11yCreateAriaValueText.reset(),this._a11yCreateContextResponseAlert&&this._a11yCreateContextResponseAlert.reset&&this._a11yCreateContextResponseAlert.reset(),this._timesChangedBeforeAlerting=0,this._updateAriaValueText(null)}_getMappedValue(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._valueProperty.value;return this._a11yMapPDOMValue(e)}getAccessibleValueHandlerInputListener(){return{keydown:this.handleKeyDown.bind(this),keyup:this.handleKeyUp.bind(this),input:this.handleInput.bind(this),change:this.handleChange.bind(this),blur:this.handleBlur.bind(this)}}handleKeyDown(e){const t=e.domEvent,i=v.ntP.getEventCode(t);if(i&&(this._shiftKey=t.shiftKey,v.ntP.isKeyEvent(t,v.ntP.KEY_TAB)&&(this._blockInput=!0),this.enabledProperty.get()&&v.ntP.isRangeKey(t)&&(t.preventDefault(),!t.metaKey))){e.pointer.reserveForKeyboardDrag();let s=!0;this._anyKeysDown()||this._onInteractionStart(e),this._rangeKeysDown[i]=!0;let n=this._valueProperty.get();if(v.ntP.isAnyKeyEvent(t,[v.ntP.KEY_END,v.ntP.KEY_HOME]))i===v.ntP.KEY_END?n=this._enabledRangeProperty.get().max:i===v.ntP.KEY_HOME&&(n=this._enabledRangeProperty.get().min);else{let e;i===v.ntP.KEY_PAGE_UP||i===v.ntP.KEY_PAGE_DOWN?(e=this.pageKeyboardStep,i===v.ntP.KEY_PAGE_UP?n=this._valueProperty.get()+e:i===v.ntP.KEY_PAGE_DOWN&&(n=this._valueProperty.get()-e)):v.ntP.isArrowKey(t)&&(e=t.shiftKey?this.shiftKeyboardStep:this.keyboardStep,s=!t.shiftKey,i===v.ntP.KEY_RIGHT_ARROW||i===v.ntP.KEY_UP_ARROW?n=this._valueProperty.get()+e:i!==v.ntP.KEY_LEFT_ARROW&&i!==v.ntP.KEY_DOWN_ARROW||(n=this._valueProperty.get()-e),this._roundToStepSize&&(n=hh(n,this._valueProperty.get(),e)))}const r=this._a11yMapValue(n,this._valueProperty.get());let o=r;s&&(o=this._constrainValue(r)),this._valueProperty.set(I.Z.clamp(o,this._enabledRangeProperty.get().min,this._enabledRangeProperty.get().max)),this._onInput(e)}}handleKeyUp(e){const t=v.ntP.getEventCode(e.domEvent);this._allKeysUp()||(v.ntP.SHIFT_KEYS.includes(t)&&(this._shiftKey=!1),this.enabledProperty.get()&&v.ntP.isRangeKey(e.domEvent)&&(this._rangeKeysDown[t]=!1,this._allKeysUp()&&this._onInteractionEnd(e)))}handleChange(e){this._a11yInputHandled||this.handleInput(e),this._a11yInputHandled=!1}handleInput(e){if(this.enabledProperty.get()&&!this._blockInput){this._a11yInputHandled=!0;let t=this._valueProperty.get();const i=parseFloat(e.domEvent.target.value),s=this._shiftKey?this.shiftKeyboardStep:this.keyboardStep,n=this._getMappedValue();this._onInteractionStart(e),i>n?t=this._valueProperty.get()+s:i!e)}_anyKeysDown(){return!!_.find(this._rangeKeysDown,e=>e)}_updateSiblingStepAttribute(){const e=Math.min(this.keyboardStep,this.shiftKeyboardStep,this.pageKeyboardStep);let t=Math.pow(10,-I.Z.numberOfDecimalPlaces(e));const i=this._getMappedValue(this._enabledRangeProperty.get().min),s=this._getMappedValue(this._enabledRangeProperty.get().max);t/(s-i)<1e-5&&(t=s/100),this.setPDOMAttribute("step",t)}voicingOnEndResponse(e,t){const i=(0,ae.JA)({},this._voicingOnEndResponseOptions,t),s=e!==this._valueProperty.value,n=this._valueProperty.value===this._enabledRangeProperty.value.min||this._valueProperty.value===this._enabledRangeProperty.value.max;(!i.onlyOnValueChange||n||s)&&this.voicingSpeakFullResponse({nameResponse:i.withNameResponse?this.voicingNameResponse:null,objectResponse:i.withObjectResponse?this.voicingObjectResponse:null,hintResponse:null})}dispose(){this._disposeAccessibleValueHandler(),super.dispose()}};mt.register("AccessibleValueHandler",ah);const hh=function(e,t,i){let s=e;return 0!==i&&(s=I.Z.roundSymmetric(s/i)*i,s=lh(s,t,i)),s},lh=function(e,t,i){let s=e;const n=Math.abs(e-t),r=n>i,o=I.Z.equalsEpsilon(n,i,1e-14);return r&&!o&&(s+=e>t?-1*i:i),s};ah.DEFAULT_TAG_NAME="input";const dh=ah,ch=(e,t)=>class extends(dh(e,t)){constructor(){for(var e=arguments.length,i=new Array(e),s=0;s{this.removeInputListener(o)}}dispose(){this._disposeAccessibleSlider(),super.dispose()}};mt.register("AccessibleSlider",ch);const uh=ch;class ph{constructor(e,t,i,s){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.a1=e,this.a2=t,this.b1=i,this.b2=s,this.clamp=n}evaluate(e){return mh(this.a1,this.a2,this.b1,this.b2,e,this.clamp)}inverse(e){return mh(this.b1,this.b2,this.a1,this.a2,e,this.clamp)}}const mh=(e,t,i,s,n,r)=>{let o=I.Z.linear(e,t,i,s,n);if(r){const e=Math.max(i,s),t=Math.min(i,s);o=I.Z.clamp(o,t,e)}return o};Vr.Z.register("LinearFunction",ph);class gh extends((0,v.pL8)(v.NBX)){constructor(e,t,i,s){super(),this.rangeProperty=i instanceof wa.Z?new O.Z(i):i;const n=(0,ae.ZP)()({size:new ke.Z(100,5),startDrag:_.noop,drag:_.noop,endDrag:_.noop,constrainValue:_.identity,enabledRangeProperty:this.rangeProperty,soundGenerator:wh.DEFAULT_SOUND,valueChangeSoundGeneratorOptions:{},voicingOnEndResponse:_.noop,leftVisualOverflow:0,rightVisualOverflow:0,tandem:L.Z.REQUIRED,tandemNameSuffix:"TrackNode"},s);n.soundGenerator===wh.DEFAULT_SOUND?n.soundGenerator=new ih(this.rangeProperty.value,n.valueChangeSoundGeneratorOptions||{}):null===n.soundGenerator&&(n.soundGenerator=ih.NO_SOUND),this.leftVisualOverflow=n.leftVisualOverflow,this.rightVisualOverflow=n.rightVisualOverflow,this.minimumSize=n.size,this.minimumWidth=this.minimumSize.width,this.internalWidthProperty=new ge.ZP([this.localPreferredWidthProperty],e=>(null===e?this.minimumSize.width:Math.max(this.minimumSize.width,e))-n.leftVisualOverflow-n.rightVisualOverflow),this.sizeProperty=new ge.ZP([this.internalWidthProperty],e=>new ke.Z(e,this.minimumSize.height)),this.valueToPositionProperty=new ge.ZP([this.rangeProperty,this.internalWidthProperty],(e,t)=>new ph(e.min,e.max,0,t,!0));const r=(t,i)=>{const s=e.value,r=i.subtrailTo(this).getTransform().inversePosition2(t.pointer.point).x,o=this.valueToPositionProperty.value.inverse(r),a=n.enabledRangeProperty.value.constrainValue(o),h=n.constrainValue(a);e.set(h),"down"===t.type&&n.soundGenerator.playSoundIfThresholdReached(h,s)};this.addChild(t);let o=e.value;this.dragListener=new v._U3({tandem:n.tandem.createTandem("dragListener"),start:(t,i)=>{n.startDrag(t),o=e.value,r(t,i.pressedTrail)},drag:(e,t)=>{n.drag(e),r(e,t.pressedTrail)},end:e=>{n.endDrag(e),n.voicingOnEndResponse(o)}}),t.addInputListener(this.dragListener),this.mutate(n),this.disposeSliderTrack=()=>{t.removeInputListener(this.dragListener),this.dragListener.dispose()}}dispose(){this.disposeSliderTrack(),super.dispose()}}mt.register("SliderTrack",gh);class yh extends gh{constructor(e,t,i){const s=(0,ae.ZP)()({fillEnabled:"white",fillDisabled:"gray",stroke:"black",lineWidth:1,cornerRadius:0},i),n=new v.AeJ({fill:s.fillDisabled,stroke:s.stroke,lineWidth:s.lineWidth,cornerRadius:s.cornerRadius,cursor:"default",pickable:!1}),r=new v.AeJ({fill:s.fillEnabled,stroke:s.stroke,lineWidth:s.lineWidth,cornerRadius:s.cornerRadius});super(e,new v.NBX({children:[n,r]}),t,(0,ae.JA)({leftVisualOverflow:null!==s.stroke?s.lineWidth/2:0,rightVisualOverflow:null!==s.stroke?s.lineWidth/2:0},s));const o=he.Z.multilink([s.enabledRangeProperty,this.valueToPositionProperty,this.sizeProperty],(e,t,i)=>{const s=t.evaluate(e.min),o=t.evaluate(e.max);n.setRect(0,0,i.width,i.height),r.setRect(s,0,o-s,i.height)});this.disposeDefaultSliderTrack=()=>{o.dispose()}}dispose(){this.disposeDefaultSliderTrack(),super.dispose()}}mt.register("DefaultSliderTrack",yh);class fh extends v.AeJ{constructor(e){const t=(0,ae.ZP)()({size:new ke.Z(22,45),fillHighlighted:"rgb( 71, 207, 255 )",centerLineStroke:"white",fill:"rgb( 50, 145, 184 )",stroke:"black",lineWidth:1,tandem:L.Z.REQUIRED,tandemNameSuffix:"ThumbNode"},e);void 0===t.cornerRadius&&(t.cornerRadius=.25*t.size.width),t.cachedPaints=[t.fill,t.fillHighlighted],super(0,0,t.size.width,t.size.height,t);const i=v.AeJ.bounds(this.bounds.dilated(5),{fill:"transparent",localBounds:this.bounds,pickable:!1});this.addChild(i);this.addChild(new v.y$t(Qe.bn.lineSegment(t.size.width/2,3,t.size.width/2,t.size.height-3),{stroke:t.centerLineStroke}));const s=new v.$o8({attach:!1,tandem:L.Z.OPT_OUT});s.isHighlightedProperty.link(e=>{this.fill=e?t.fillHighlighted:t.fill}),this.addInputListener(s)}}mt.register("SliderThumb",fh);const Ah={VALUE_NAMED_PLACEHOLDER:"{{value}}",VALUE_NUMBERED_PLACEHOLDER:"{0}",SLIDER_VERTICAL_ROTATION:-Math.PI/2};mt.register("SunConstants",Ah);const bh=Ah;class Ph{constructor(e,t,i,s,n,r,o,a,h){this.parent=e,this.value=t,this.label=i,this.labelXProperty=new ge.ZP([h.valueToPositionProperty],e=>e.evaluate(t)),this.tickNode=new v.NBX,e.addChild(this.tickNode);const l=new v.y$t((new Qe.bn).moveTo(0,h.top).lineTo(0,h.top-s),{stroke:n,lineWidth:r});this.labelXProperty.link(e=>{l.x=e}),this.tickNode.addChild(l),i&&(a===Ta.Z.VERTICAL&&(i.rotation=-bh.SLIDER_VERTICAL_ROTATION),this.tickNode.addChild(i),this.manualConstraint=v.bGt.create(this.tickNode,[l,i],(e,t)=>{t.centerX=e.centerX,t.bottom=e.top-o.tickLabelSpacing}),i.pickable=!1)}dispose(){this.parent.removeChild(this.tickNode),this.labelXProperty.dispose(),this.manualConstraint&&this.manualConstraint.dispose()}}mt.register("SliderTick",Ph);const Vh=new ke.Z(100,5),vh=new ke.Z(17,34);class wh extends((0,v.tTM)(uh(v.NBX,0))){constructor(e,t,i){const s=(0,ae.ZP)()({orientation:Ta.Z.HORIZONTAL,trackNode:null,trackSize:null,trackFillEnabled:"white",trackFillDisabled:"gray",trackStroke:"black",trackLineWidth:1,trackCornerRadius:0,trackPickable:!0,thumbNode:null,thumbSize:null,thumbFill:"rgb(50,145,184)",thumbFillHighlighted:"rgb(71,207,255)",thumbStroke:"black",thumbLineWidth:1,thumbCenterLineStroke:"white",thumbTouchAreaXDilation:11,thumbTouchAreaYDilation:11,thumbMouseAreaXDilation:0,thumbMouseAreaYDilation:0,thumbYOffset:0,tickLabelSpacing:6,majorTickLength:25,majorTickStroke:"black",majorTickLineWidth:1,minorTickLength:10,minorTickStroke:"black",minorTickLineWidth:1,cursor:"pointer",startDrag:_.noop,drag:_.noop,endDrag:_.noop,constrainValue:_.identity,disabledOpacity:v.iaM.DISABLED_OPACITY,soundGenerator:wh.DEFAULT_SOUND,valueChangeSoundGeneratorOptions:{},phetioLinkedProperty:null,tandem:L.Z.REQUIRED,tandemNameSuffix:"Slider",phetioType:wh.SliderIO,visiblePropertyOptions:{phetioFeatured:!0},phetioEnabledPropertyInstrumented:!0},i),n=t instanceof wa.Z?new O.Z(t):t;if(s.ariaOrientation=s.orientation,s.soundGenerator===wh.DEFAULT_SOUND?s.soundGenerator=new ih(n.value,s.valueChangeSoundGeneratorOptions||{}):null===s.soundGenerator&&(s.soundGenerator=ih.NO_SOUND),s.soundGenerator!==ih.NO_SOUND){let t=e.value;const i=s.drag;s.drag=n=>{n.isFromPDOM()?s.soundGenerator.playSoundForValueChange(e.value,t):s.soundGenerator.playSoundIfThresholdReached(e.value,t),i(n),t=e.value}}const r=_.pick(s,v.NBX.REQUIRES_BOUNDS_OPTION_KEYS),o=_.omit(s,v.NBX.REQUIRES_BOUNDS_OPTION_KEYS);o.orientation===Ta.Z.VERTICAL&&(o.trackSize&&(o.trackSize=o.trackSize.swapped()),o.thumbSize&&(o.thumbSize=o.thumbSize.swapped()),Ia(o,"thumbTouchAreaXDilation","thumbTouchAreaYDilation"),Ia(o,"thumbMouseAreaXDilation","thumbMouseAreaYDilation")),o.trackSize=o.trackSize||Vh,o.thumbSize=o.thumbSize||vh;const a=s.tandem.createTandem(wh.THUMB_NODE_TANDEM_NAME);L.Z.VALIDATION&&o.thumbNode;const h=o.thumbNode||new fh({size:o.thumbSize,fill:o.thumbFill,fillHighlighted:o.thumbFillHighlighted,stroke:o.thumbStroke,lineWidth:o.thumbLineWidth,centerLineStroke:o.thumbCenterLineStroke,tandem:a}),l=!o.enabledRangeProperty;o.enabledRangeProperty=o.enabledRangeProperty||(t instanceof wa.Z?new be.Z(t,{valueType:wa.Z,isValidValue:e=>e.min>=t.min&&e.max<=t.max,tandem:s.tandem.createTandem("enabledRangeProperty"),phetioValueType:wa.Z.RangeIO,phetioDocumentation:"Sliders support two ranges: the outer range which specifies the min and max of the track and the enabledRangeProperty, which determines how low and high the thumb can be dragged within the track."}):t),o.panTargetNode=h,o.valueProperty=e,super(o),_defineProperty(this,"ticks",(0,de.Z)()),_defineProperty(this,"proposedValue",null),this.orientation=o.orientation,this.enabledRangeProperty=o.enabledRangeProperty,this.tickOptions=_.pick(s,"tickLabelSpacing","majorTickLength","majorTickStroke","majorTickLineWidth","minorTickLength","minorTickStroke","minorTickLineWidth");const d=[];this.majorTicksParent=new v.NBX,this.minorTicksParent=new v.NBX,d.push(this.majorTicksParent),d.push(this.minorTicksParent);const c=s.tandem.createTandem(wh.TRACK_NODE_TANDEM_NAME);L.Z.VALIDATION&&s.trackNode;const u=new v.NBX;d.push(u),this.track=s.trackNode||new yh(e,t,{size:o.trackSize,fillEnabled:o.trackFillEnabled,fillDisabled:o.trackFillDisabled,stroke:o.trackStroke,lineWidth:o.trackLineWidth,cornerRadius:o.trackCornerRadius,startDrag:o.startDrag,drag:o.drag,endDrag:o.endDrag,constrainValue:o.constrainValue,enabledRangeProperty:this.enabledRangeProperty,soundGenerator:s.soundGenerator,pickable:o.trackPickable,voicingOnEndResponse:this.voicingOnEndResponse.bind(this),tandem:c}),d.push(this.track),h.setCenterY(this.track.centerY+s.thumbYOffset),d.push(h);const p=new v.NBX({children:d});s.orientation===Ta.Z.VERTICAL&&(p.rotation=bh.SLIDER_VERTICAL_ROTATION),this.addChild(p),s.thumbNode||!s.thumbTouchAreaXDilation&&!s.thumbTouchAreaYDilation||(h.touchArea=h.localBounds.dilatedXY(s.thumbTouchAreaXDilation,s.thumbTouchAreaYDilation)),s.thumbNode||!s.thumbMouseAreaXDilation&&!s.thumbMouseAreaYDilation||(h.mouseArea=h.localBounds.dilatedXY(s.thumbMouseAreaXDilation,s.thumbMouseAreaYDilation));let m=0,g=e.value;const y=new v._U3({tandem:h.tandem.createTandem("dragListener"),start:(t,i)=>{if(this.enabledProperty.get()){g=e.value,s.startDrag(t);const n=i.pressedTrail.subtrailTo(p).getTransform();m=n.inversePosition2(t.pointer.point).x-h.centerX}},drag:(t,i)=>{if(this.enabledProperty.get()){const n=i.pressedTrail.subtrailTo(p).getTransform().inversePosition2(t.pointer.point).x-m;this.proposedValue=this.track.valueToPositionProperty.value.inverse(n);const r=this.enabledRangeProperty.get().constrainValue(this.proposedValue);e.set(s.constrainValue(r)),s.drag(t)}},end:e=>{this.enabledProperty.get()&&(s.endDrag(e),this.voicingOnEndResponse(g)),this.proposedValue=null}});h.addInputListener(y),this.thumbDragListener=y,this.trackDragListener=this.track.dragListener;const f=he.Z.multilink([e,this.track.valueToPositionProperty],(e,t)=>{h.centerX=t.evaluate(e)}),A=t=>{if(!e.isPhetioInstrumented()||!phet.joist.sim.isSettingPhetioStateProperty.value)if(null===this.proposedValue)e.set(I.Z.clamp(e.value,t.min,t.max));else{const i=I.Z.clamp(this.proposedValue,t.min,t.max),n=s.constrainValue(i);e.set(n)}};this.enabledRangeProperty.link(A);const b=new Sh(this,this.track,h,p,s.orientation,u,this.ticks);this.disposeSlider=()=>{b.dispose(),h.dispose&&h.dispose(),this.track.dispose&&this.track.dispose(),l?this.enabledRangeProperty.dispose():this.enabledRangeProperty.unlink(A),f.dispose(),y.dispose()},this.focusHighlight=new v.UQs(h);const P=s.phetioLinkedProperty||(e instanceof wi.Z?e:null);P&&this.addLinkedElement(P,{tandem:s.tandem.createTandem("valueProperty")}),!l&&this.enabledRangeProperty instanceof wi.Z&&this.addLinkedElement(this.enabledRangeProperty,{tandem:s.tandem.createTandem("enabledRangeProperty")}),this.mutate(r)}get majorTicksVisible(){return this.getMajorTicksVisible()}set majorTicksVisible(e){this.setMajorTicksVisible(e)}get minorTicksVisible(){return this.getMinorTicksVisible()}set minorTicksVisible(e){this.setMinorTicksVisible(e)}dispose(){this.disposeSlider(),this.ticks.forEach(e=>{e.dispose()}),super.dispose()}addMajorTick(e,t){this.addTick(this.majorTicksParent,e,t,this.tickOptions.majorTickLength,this.tickOptions.majorTickStroke,this.tickOptions.majorTickLineWidth)}addMinorTick(e,t){this.addTick(this.minorTicksParent,e,t,this.tickOptions.minorTickLength,this.tickOptions.minorTickStroke,this.tickOptions.minorTickLineWidth)}addTick(e,t,i,s,n,r){this.ticks.push(new Ph(e,t,i,s,n,r,this.tickOptions,this.orientation,this.track))}setMajorTicksVisible(e){this.majorTicksParent.visible=e}getMajorTicksVisible(){return this.majorTicksParent.visible}setMinorTicksVisible(e){this.minorTicksParent.visible=e}getMinorTicksVisible(){return this.minorTicksParent.visible}}d=wh,_defineProperty(wh,"DEFAULT_SOUND",new ih(new wa.Z(0,1))),_defineProperty(wh,"THUMB_NODE_TANDEM_NAME","thumbNode"),_defineProperty(wh,"TRACK_NODE_TANDEM_NAME","trackNode"),_defineProperty(wh,"SliderIO",new Te.Z("SliderIO",{valueType:d,documentation:"A traditional slider component, with a knob and possibly tick marks",supertype:v.NBX.NodeIO}));class Sh extends v.dmK{constructor(e,t,i,s,n,r,o){super(e),this.slider=e,this.track=t,this.thumb=i,this.sliderPartsNode=s,this.orientation=n,this.trackSpacer=r,this.ticks=o,n===Ta.Z.HORIZONTAL?(e.heightSizable=!1,this.preferredProperty=this.slider.localPreferredWidthProperty):(e.widthSizable=!1,this.preferredProperty=this.slider.localPreferredHeightProperty),this.preferredProperty.lazyLink(this._updateLayoutListener),this.track.rangeProperty.lazyLink(this._updateLayoutListener),this.thumb.localBoundsProperty.lazyLink(this._updateLayoutListener);const a=e=>{e.tickNode.localBoundsProperty.lazyLink(this._updateLayoutListener),o.addItemRemovedListener(t=>{t===e&&t.tickNode.localBoundsProperty.hasListener(this._updateLayoutListener)&&e.tickNode.localBoundsProperty.unlink(this._updateLayoutListener)})};o.addItemAddedListener(a),this.addNode(t),this.layout(),this.disposeSliderConstraint=()=>{o.removeItemAddedListener(a),this.preferredProperty.unlink(this._updateLayoutListener),this.track.rangeProperty.unlink(this._updateLayoutListener),this.thumb.localBoundsProperty.unlink(this._updateLayoutListener)}}layout(){super.layout();const e=this.slider,t=this.track,i=this.thumb;this.trackSpacer.localBounds=t.localBounds.dilatedX(i.width/2);const s=t.leftVisualOverflow+t.rightVisualOverflow,n=t.minimumWidth,r=n-s,o=e=>I.Z.linear(t.rangeProperty.value.min,t.rangeProperty.value.max,0,1,e),a=-i.width/2-t.leftVisualOverflow,h=i.width/2-t.leftVisualOverflow,l=new wa.Z(a,n+h);if(this.ticks.forEach(e=>{const t=r*o(e.value),i=e.tickNode.width/2;l.includeRange(new wa.Z(-i,i).shifted(t))}),e.widthSizable&&null!==this.preferredProperty.value){const e=_a.max(_a.linear(1,h),...this.ticks.map(e=>{const t=o(e.value);return _a.linear(t,e.tickNode.width/2-s*t)})).minus(_a.min(_a.constant(a),...this.ticks.map(e=>{const t=o(e.value);return _a.linear(t,-e.tickNode.width/2-s*t)}))),i=e.withXValues([n-1,n,...e.points.map(e=>e.x).filter(e=>e>n+1e-10)]).inverted();t.preferredWidth=Math.max(n,i.evaluate(this.preferredProperty.value))}else t.preferredWidth=t.minimumWidth;const d=l.getLength();this.orientation===Ta.Z.HORIZONTAL?e.localMinimumWidth=d:e.localMinimumHeight=d}dispose(){this.disposeSliderConstraint(),super.dispose()}}mt.register("Slider",wh);class Th extends wh{constructor(e,t,i){super(e,t,(0,ae.ZP)()({orientation:Ta.Z.HORIZONTAL},i))}}mt.register("HSlider",Th);const Eh={PLUS:"+",MINUS:"−",TIMES:"×",DIVIDE:"÷",DOT:"⋅",UNARY_PLUS:"+",UNARY_MINUS:"-",EQUAL_TO:"=",NOT_EQUAL_TO:"≠",GREATER_THAN:">",LESS_THAN:"<",LESS_THAN_OR_EQUAL:"≤",GREATER_THAN_OR_EQUAL:"≥",PERCENT:"%",INFINITY:"∞",PI:"π",PLUS_MINUS:"±",THETA:"θ",NO_VALUE:"—",DEGREES:"°"};Be.register("MathSymbols",Eh);const _h=Eh,xh=new ht(20);class Ch extends v.NBX{constructor(e,t,i){const s=(0,ae.ZP)()({align:"right",valuePattern:bh.VALUE_NAMED_PLACEHOLDER,decimalPlaces:0,numberFormatter:null,useRichText:!1,useFullHeight:!1,textOptions:{font:xh,fill:"black",maxWidth:null,phetioReadOnly:!0},xMargin:8,yMargin:2,cornerRadius:0,backgroundFill:"white",backgroundStroke:"lightGray",backgroundLineWidth:1,backgroundLineDash:[],minBackgroundWidth:0,noValueString:_h.NO_VALUE,noValueAlign:null,noValuePattern:null,tandem:L.Z.OPTIONAL,phetioType:Ch.NumberDisplayIO},i);const n=new O.Z(s.numberFormatter?s.numberFormatter:e=>null===s.decimalPlaces?""+e:I.Z.toFixed(e,s.decimalPlaces));s.noValueAlign||(s.noValueAlign=s.align);const r=e=>e.includes(bh.VALUE_NUMBERED_PLACEHOLDER)?Oe.Z.format(e,bh.VALUE_NAMED_PLACEHOLDER):e,o="string"==typeof s.valuePattern?new O.Z(r(s.valuePattern)):new ge.ZP([s.valuePattern],r);s.noValuePattern||(s.noValuePattern=new ge.ZP([o],e=>e));const a="string"==typeof s.noValuePattern?new O.Z(s.noValuePattern):s.noValuePattern,h=new ge.ZP([n],e=>Ih(t.min,s.noValueString,e)),l=new ge.ZP([n],e=>Ih(t.max,s.noValueString,e)),d=new ge.ZP([o,h,l],(e,t,i)=>Oe.Z.fillIn(e,{value:t.length>i.length?t:i})),c=s.useRichText?v.Hof:v.xvT,u=s.tandem.createTandem("valueText"),p=new ge.ZP([e,a,o,n],(e,t,i,n)=>{const r=null===e&&t?t:i,o=Ih(e,s.noValueString,n);return Oe.Z.fillIn(r,{value:o})},{tandem:u.createTandem(v.xvT.STRING_PROPERTY_TANDEM_NAME),phetioValueType:it.Z}),m=(0,ae.JA)({},s.textOptions,{maxWidth:null}),g=new c(p,(0,ae.JA)({tandem:u},m)),y=g.height,f=new v.AeJ({cornerRadius:s.cornerRadius,fill:s.backgroundFill,stroke:s.backgroundStroke,lineWidth:s.backgroundLineWidth,lineDash:s.backgroundLineDash});d.link(e=>{const t=new c(e,_.omit(m,"tandem"));g.maxWidth=null!==s.textOptions.maxWidth?s.textOptions.maxWidth:0!==t.width?t.width:null,t.maxWidth=g.maxWidth,f.rectWidth=Math.max(s.minBackgroundWidth,t.width+2*s.xMargin),f.rectHeight=(s.useFullHeight?y:t.height)+2*s.yMargin}),s.children=[f,g],super(),this.numberFormatterProperty=n,this.valueText=g,this.backgroundNode=f,v.bGt.create(this,[g,f],(t,i)=>{const n=null===e.value?s.noValueAlign:s.align;"center"===n?t.centerX=i.centerX:"left"===n?t.left=i.left+s.xMargin:t.right=i.right-s.xMargin,t.centerY=i.centerY}),this.mutate(s),this.disposeNumberDisplay=()=>{p.dispose(),o.dispose()}}setNumberFormatter(e){this.numberFormatterProperty.value=e}recomputeText(){}dispose(){this.disposeNumberDisplay(),super.dispose()}setNumberFont(e){this.valueText.font=e}set numberFont(e){this.setNumberFont(e)}setNumberFill(e){this.valueText.fill=e}set numberFill(e){this.setNumberFill(e)}setBackgroundFill(e){this.backgroundNode.fill=e}set backgroundFill(e){this.setBackgroundFill(e)}get backgroundFill(){return this.getBackgroundFill()}getBackgroundFill(){return this.backgroundNode.fill}setBackgroundStroke(e){this.backgroundNode.stroke=e}set backgroundStroke(e){this.setBackgroundStroke(e)}getBackgroundWidth(){return this.backgroundNode.getRectWidth()}setBackgroundWidth(e){this.backgroundNode.setRectWidth(e)}get backgroundWidth(){return this.getBackgroundWidth()}set backgroundWidth(e){this.setBackgroundWidth(e)}}c=Ch,_defineProperty(Ch,"NumberDisplayIO",new Te.Z("NumberDisplayIO",{valueType:c,supertype:v.NBX.NodeIO,documentation:"A numeric readout with a background"})),Be.register("NumberDisplay",Ch);const Ih=(e,t,i)=>{let s=t;return null!==e&&(s=i(e)),s},Dh=["startDrag","endDrag","leftStart","leftEnd","rightStart","rightEnd"],Lh=["touchAreaXDilation","touchAreaYDilation","mouseAreaXDilation","mouseAreaYDilation"];class kh extends v.NBX{constructor(e,t,i,s){!function(e){!e.startCallback&&e.endCallback;let t=!1,i=!1;e.arrowButtonOptions&&(t=Mh(e.arrowButtonOptions));e.sliderOptions&&(i=Mh(e.sliderOptions))}(s||{});const n=(0,ae.ZP)()({numberDisplayOptions:{},sliderOptions:{},arrowButtonOptions:{},titleNodeOptions:{},startCallback:_.noop,endCallback:_.noop,delta:1,disabledOpacity:.5,layoutFunction:kh.createLayoutFunction1(),includeArrowButtons:!0,tandem:L.Z.REQUIRED,tandemNameSuffix:"Control",phetioType:kh.NumberControlIO,phetioEnabledPropertyInstrumented:!0,visiblePropertyOptions:{phetioFeatured:!0}},s);super();const r=n.arrowButtonOptions&&n.arrowButtonOptions.hasOwnProperty("scale"),o=()=>h.enabledRangeProperty?h.enabledRangeProperty.value:i,a=e=>{const t=I.Z.roundToInterval(e,h.delta);return o().constrainValue(t)},h=(0,ae.JA)({arrowButtonOptions:{touchAreaXDilation:3.5,touchAreaYDilation:7,mouseAreaXDilation:0,mouseAreaYDilation:0,enabledEpsilon:0,leftStart:n.startCallback,leftEnd:n.endCallback,rightStart:n.startCallback,rightEnd:n.endCallback,enabledPropertyOptions:{phetioReadOnly:!0,phetioFeatured:!1}},sliderOptions:{startDrag:n.startCallback,endDrag:n.endCallback,majorTickLength:20,minorTickStroke:"rgba( 0, 0, 0, 0.3 )",majorTicks:[],minorTickSpacing:0,constrainValue:a,valueChangeSoundGeneratorOptions:{interThresholdDelta:n.delta,constrainValue:a},tandem:n.tandem.createTandem(kh.SLIDER_TANDEM_NAME)},numberDisplayOptions:{textOptions:{font:new ht(12),stringPropertyOptions:{phetioFeatured:!0}},tandem:n.tandem.createTandem("numberDisplay"),visiblePropertyOptions:{phetioFeatured:!0}},titleNodeOptions:{font:new ht(12),maxWidth:null,fill:"black",tandem:n.tandem.createTandem("titleText")}},n);h.enabledRangeProperty&&(h.sliderOptions.enabledRangeProperty=h.enabledRangeProperty);const l=_.pick(h.arrowButtonOptions,Lh);h.arrowButtonOptions=_.omit(h.arrowButtonOptions,Lh),h.arrowButtonOptions.tagName=null,this.groupFocusHighlight=h.includeArrowButtons,h.sliderOptions.trackNode||(h.sliderOptions=(0,ae.JA)({trackSize:new ke.Z(180,3)},h.sliderOptions)),h.sliderOptions.thumbNode||(h.sliderOptions=(0,ae.JA)({thumbSize:new ke.Z(17,34),thumbTouchAreaXDilation:6},h.sliderOptions)),h.sliderOptions=(0,ae.JA)({shiftKeyboardStep:h.delta,phetioType:wh.SliderIO},h.sliderOptions),h.sliderOptions.thumbFill&&!h.sliderOptions.thumbFillHighlighted&&(this.thumbFillProperty=new v.M4p(h.sliderOptions.thumbFill),h.sliderOptions.thumbFillHighlighted=new ge.ZP([this.thumbFillProperty],e=>e.brighterColor()));const d=new v.xvT(e,h.titleNodeOptions),c=new Ch(t,i,h.numberDisplayOptions);this.slider=new Th(t,i,h.sliderOptions);let u=null,p=null,m=null;if(h.includeArrowButtons){if(u=new Sa("left",()=>{let e=t.get()-h.delta;e=I.Z.roundToInterval(e,h.delta),e=Math.max(e,o().min),t.set(e)},(0,ae.JA)({startCallback:h.arrowButtonOptions.leftStart,endCallback:h.arrowButtonOptions.leftEnd,tandem:h.tandem.createTandem("decrementButton")},h.arrowButtonOptions)),p=new Sa("right",()=>{let e=t.get()+h.delta;e=I.Z.roundToInterval(e,h.delta),e=Math.min(e,o().max),t.set(e)},(0,ae.JA)({startCallback:h.arrowButtonOptions.rightStart,endCallback:h.arrowButtonOptions.rightEnd,tandem:h.tandem.createTandem("incrementButton")},h.arrowButtonOptions)),!r){u.setScaleMagnitude(1);const e=c.localBounds.height/u.height;u.setScaleMagnitude(e),p.setScaleMagnitude(e)}u.touchArea=u.localBounds.dilatedXY(l.touchAreaXDilation,l.touchAreaYDilation).shiftedX(-l.touchAreaXDilation),p.touchArea=p.localBounds.dilatedXY(l.touchAreaXDilation,l.touchAreaYDilation).shiftedX(l.touchAreaXDilation),u.mouseArea=u.localBounds.dilatedXY(l.mouseAreaXDilation,l.mouseAreaYDilation).shiftedX(-l.mouseAreaXDilation),p.mouseArea=p.localBounds.dilatedXY(l.mouseAreaXDilation,l.mouseAreaYDilation).shiftedX(l.mouseAreaXDilation),m=()=>{const e=t.value;u.enabled=e-h.arrowButtonOptions.enabledEpsilon>o().min&&!this.slider.isFocused(),p.enabled=e+h.arrowButtonOptions.enabledEpsilon{u.enabled=!1,p.enabled=!1},blur:()=>m()})}const g=h.sliderOptions.majorTicks;for(let y=0;y0)for(let y=i.min;y<=i.max;)_.find(g,e=>e.value===y)||this.slider.addMinorTick(y),y+=h.sliderOptions.minorTickSpacing;h.children=[h.layoutFunction(d,c,this.slider,u,p)],this.mutate(h),this.numberDisplay=c,this.disposeNumberControl=()=>{d.dispose(),c.dispose(),this.slider.dispose(),this.thumbFillProperty&&this.thumbFillProperty.dispose(),u&&u.dispose(),p&&p.dispose(),m&&t.unlink(m),m&&h.enabledRangeProperty&&h.enabledRangeProperty.unlink(m)}}redrawNumberDisplay(){this.numberDisplay.recomputeText()}dispose(){this.disposeNumberControl(),super.dispose()}setNumberFormatter(e){this.numberDisplay.setNumberFormatter(e)}static withMinMaxTicks(e,t,i,s){const n=(0,ae.ZP)()({tickLabelFont:new ht(12)},s);return n.sliderOptions=(0,ae.JA)({majorTicks:[{value:i.min,label:new v.xvT(i.min,{font:n.tickLabelFont})},{value:i.max,label:new v.xvT(i.max,{font:n.tickLabelFont})}]},n.sliderOptions),new kh(e,t,i,n)}static createLayoutFunction1(e){const t=(0,ae.ZP)()({align:"center",titleXSpacing:5,arrowButtonsXSpacing:15,ySpacing:5},e);return(e,i,s,n,r)=>new v.SHm({align:t.align,spacing:t.ySpacing,children:[new v.BET({spacing:t.titleXSpacing,children:[e,i]}),new v.BET({spacing:t.arrowButtonsXSpacing,resize:!1,children:[n,s,r]})]})}static createLayoutFunction2(e){const t=(0,ae.ZP)()({align:"center",xSpacing:5,ySpacing:5},e);return(e,i,s,n,r)=>new v.SHm({align:t.align,spacing:t.ySpacing,resize:!1,children:[new v.BET({spacing:t.xSpacing,children:[e,n,i,r]}),s]})}static createLayoutFunction3(e){const t=(0,ae.ZP)()({alignTitle:"center",alignNumber:"center",titleLeftIndent:0,xSpacing:5,ySpacing:5},e);return(e,i,s,n,r)=>{const o=new v.SHm({spacing:t.ySpacing,resize:!1,align:t.alignTitle,children:[new v.DbO(e,{leftMargin:t.titleLeftIndent}),new v.SHm({spacing:t.ySpacing,resize:!1,align:t.alignNumber,children:[new v.BET({spacing:t.xSpacing,children:[n,i,r]}),s]})]});return e.boundsProperty.lazyLink(()=>{o.updateLayout()}),o}}static createLayoutFunction4(e){const t=(0,ae.ZP)()({sliderPadding:0,verticalSpacing:5,arrowButtonSpacing:5,hasReadoutProperty:null,layoutInvisibleButtons:!1,createBottomContent:null},e);return(e,i,s,n,r)=>{const o=!!n,a=new v.BET({spacing:t.arrowButtonSpacing,children:o?[n,s,r]:[s],excludeInvisibleChildrenFromBounds:!t.layoutInvisibleButtons});return new v.SHm({spacing:t.verticalSpacing,children:[new v.BET({spacing:t.sliderPadding,children:[e,new v.NBX({children:[i],visibleProperty:t.hasReadoutProperty||null,excludeInvisibleChildrenFromBounds:!0})],layoutOptions:{stretch:!0}}),new v.NBX({children:[t.createBottomContent?t.createBottomContent(a):a],layoutOptions:{xMargin:t.sliderPadding}})]})}}}function Mh(e){const t=Object.keys(e);return Dh.filter(e=>_.includes(t,e)).length>0}u=kh,_defineProperty(kh,"NumberControlIO",new Te.Z("NumberControlIO",{valueType:u,documentation:"A number control with a title, slider and +/- buttons",supertype:v.NBX.NodeIO})),_defineProperty(kh,"SLIDER_TANDEM_NAME","slider"),Be.register("NumberControl",kh);const Oh=(e,t,i)=>(t.labelTagName="p",t.labelContent=i,t);class Nh extends Xi{constructor(e,t,i,s){const n=(0,ae.ZP)()({align:"left",arrowDirection:"down",arrowFill:"black",comboBoxVoicingNameResponsePattern:bh.VALUE_NAMED_PLACEHOLDER,cursor:"pointer",baseColor:"white",buttonAppearanceStrategy:Yi.FlatAppearanceStrategy,xMargin:12,yMargin:8,stroke:"black",lineWidth:1,soundPlayer:Kr,enabledPropertyOptions:{phetioFeatured:!1},visiblePropertyOptions:{phetioFeatured:!1},localPreferredWidthProperty:new O.Z(null),localMinimumWidthProperty:new O.Z(null),tandem:L.Z.OPTIONAL,containerTagName:"div",accessibleNameBehavior:Oh},s),r=n.xMargin,o=n.yMargin,a=Fh.getMaxItemWidthProperty(i),h=Fh.getMaxItemHeightProperty(i),l=new v.y$t(null,{fill:n.arrowFill}),d=_.find(t,t=>t.value===e.value),c=t.indexOf(d),u=new v.NBX({layoutOptions:{yMargin:o,grow:1,xAlign:n.align},children:[i[c]]}),p=new v.x12(0,0,0,0,{stroke:"black",lineWidth:n.lineWidth});n.content=new v.zch({rows:[[u,p,l]]}),he.Z.multilink([a,h],(e,t)=>{const i=t+2*o,s=i,a=.35*s,h=2*a*Math.sqrt(3)/3,d=r,c=r-n.lineWidth/2,m=-n.lineWidth/2;var g,y,f;l.shape=(g=n.arrowDirection,y=h,f=a,"up"===g?(new Qe.bn).moveTo(0,f).lineTo(y/2,0).lineTo(y,f).close():(new Qe.bn).moveTo(0,0).lineTo(y,0).lineTo(y/2,f).close()),l.mutateLayoutOptions({minContentWidth:s,minContentHeight:s}),u.mutateLayoutOptions({minContentWidth:e,minContentHeight:t,leftMargin:d,rightMargin:c}),p.y2=i,p.mutateLayoutOptions({rightMargin:m})}),n.xMargin=0,n.yMargin=0,super(n),this.minimumWidthProperty.link(e=>{n.localMinimumWidthProperty.value=e});const m=e=>{this.preferredWidth=e};n.localPreferredWidthProperty.link(m),this._blockNextVoicingFocusListener=!1,this.voicingFocusListener=()=>{!this._blockNextVoicingFocusListener&&this.defaultFocusListener(),this._blockNextVoicingFocusListener=!1};let g=null,y=null;const f=e=>{u.removeAllChildren(),y=_.find(t,t=>t.value===e);const s=t.indexOf(y),r=i[s];u.addChild(r),this.innerContent=y.a11yName||null;const o="string"==typeof n.comboBoxVoicingNameResponsePattern?new be.Z(n.comboBoxVoicingNameResponsePattern):n.comboBoxVoicingNameResponsePattern;g&&g.dispose(),this.voicingNameResponse=g=new gn(o,{value:y.a11yName})};e.link(f),this.ariaLabelledbyAssociations=[{otherNode:this,otherElementName:v.Grz.LABEL_SIBLING,thisElementName:v.Grz.PRIMARY_SIBLING},{otherNode:this,otherElementName:v.Grz.PRIMARY_SIBLING,thisElementName:v.Grz.PRIMARY_SIBLING}],v.uai.mutateNode(this,"listbox"),this.disposeComboBoxButton=()=>{a.dispose(),h.dispose(),e.unlink(f),n.localPreferredWidthProperty.unlink(m),g&&g.dispose()},this.arrow=l,this.separatorLine=p}setDisplayOnly(e){this.arrow.visible=!e,this.separatorLine.visible=!e}blockNextVoicingFocusListener(){this._blockNextVoicingFocusListener=!0}dispose(){this.disposeComboBoxButton(),super.dispose()}}mt.register("ComboBoxButton",Nh);class Rh extends((0,v.CHP)(v.NBX)){constructor(e,t,i,s,n){const r=(0,ae.ZP)()({cursor:"pointer",align:"left",xMargin:6,highlightFill:"rgb( 245, 245, 245 )",highlightCornerRadius:4,tagName:"li",focusable:!0,ariaRole:"option",positionInPDOM:!0,voicingFocusListener:()=>this.comboBoxListItemNodeVoicingFocusListener(),comboBoxVoicingNameResponsePattern:bh.VALUE_NAMED_PLACEHOLDER,tandem:L.Z.REQUIRED,tandemNameSuffix:"Item",phetioType:v.RnV,phetioState:!0,visiblePropertyOptions:{phetioFeatured:!0}},n);r.comboBoxVoicingNameResponsePattern=r.comboBoxVoicingNameResponsePattern.get?r.comboBoxVoicingNameResponsePattern.get():r.comboBoxVoicingNameResponsePattern,r.innerContent=e.a11yName||null,r.voicingObjectResponse=e.a11yName||null;const o="string"==typeof r.comboBoxVoicingNameResponsePattern?new be.Z(r.comboBoxVoicingNameResponsePattern):r.comboBoxVoicingNameResponsePattern,a=new gn(o,{value:e.a11yName});r.voicingNameResponse=a;const h=new v.AeJ({cornerRadius:r.highlightCornerRadius}),l=new v.NBX({children:[t]}),d=e=>{h.rectWidth=e,l.maxWidth=e};i.link(d);const c=e=>{h.rectHeight=e,l.maxHeight=e};s.link(c);const u=()=>{"left"===r.align?l.left=h.left+r.xMargin:"right"===r.align?l.right=h.right-r.xMargin:l.centerX=h.centerX,l.centerY=h.centerY};l.boundsProperty.lazyLink(u),u(),r.children=[h,l],super(r),this._supplyOpenResponseOnNextFocus=!1,this.item=e,this.localBoundsProperty.link(e=>{this.focusHighlight=Qe.bn.bounds(e)}),this.addInputListener({enter(){h.fill=r.highlightFill},exit(){h.fill=null}}),this.disposeComboBoxListItemNode=()=>{a.dispose(),i.unlink(d),s.unlink(c)}}supplyOpenResponseOnNextFocus(){this._supplyOpenResponseOnNextFocus=!0}dispose(){this.disposeComboBoxListItemNode(),super.dispose()}comboBoxListItemNodeVoicingFocusListener(){this.voicingSpeakFullResponse({nameResponse:this._supplyOpenResponseOnNextFocus?this.voicingNameResponse:null,objectResponse:this._supplyOpenResponseOnNextFocus?null:this.voicingObjectResponse,contextResponse:null,hintResponse:this._supplyOpenResponseOnNextFocus?this.voicingHintResponse:null}),this._supplyOpenResponseOnNextFocus=!1}}mt.register("ComboBoxListItemNode",Rh);class Bh extends yt{constructor(e,t,i,s,n,r,o,a){const h=(0,ae.ZP)()({highlightFill:"rgb( 245, 245, 245 )",comboBoxListItemNodeOptions:{},xMargin:12,yMargin:8,backgroundPickable:!0,tagName:"ul",ariaRole:"listbox",groupFocusHighlight:!0,focusable:!0,openedSoundPlayer:Ur,closedNoChangeSoundPlayer:Br,visiblePropertyOptions:{phetioReadOnly:!0}},a),l=new qe.Z(t=>{const i=t.currentTarget;this.selectionOnFireAction=i;const r=e.value;n(),e.value=this.selectionOnFireAction.item.value,s(),this.voiceOnNewSelection(e.value,r,i),t.abort()},{parameters:[{phetioPrivate:!0,valueType:v.IAx}],tandem:o.createTandem("fireAction"),phetioEventType:Ne.Z.USER}),d={up(e){l.execute(e)},keyup:e=>{e.domEvent&&v.ntP.isAnyKeyEvent(e.domEvent,[v.ntP.KEY_ENTER,v.ntP.KEY_SPACE])&&l.execute(e)},click:e=>{l.execute(e)}},c=Fh.getMaxItemWidthProperty(i),u=Fh.getMaxItemHeightProperty(i),p=new ge.ZP([c],e=>e+h.xMargin),m=new ge.ZP([u],e=>e+h.yMargin),g=[];t.forEach((e,t)=>{const s=new Rh(e,i[t],p,m,(0,ae.JA)({align:h.align,highlightFill:h.highlightFill,highlightCornerRadius:h.cornerRadius,xMargin:.5*h.xMargin,tandem:e.tandemName?o.createTandem(e.tandemName):L.Z.OPTIONAL},h.comboBoxListItemNodeOptions));g.push(s),s.addInputListener(d)});const y=new v.SHm({spacing:0,excludeInvisibleChildrenFromBounds:!0,children:g});super(y,(0,ae.JA)({},h,{xMargin:h.xMargin/2,yMargin:h.yMargin/2})),this.content=y,this.voiceOnSelectionNode=r,this.selectionOnFireAction=this.getListItemNode(e.value);const f=t.map(e=>Zt.getSelectionSoundPlayer(t.indexOf(e)));let A;this.visibleProperty.lazyLink(t=>{if(t)h.openedSoundPlayer.play(),A=this.getListItemNode(e.value);else if(A===this.selectionOnFireAction)h.closedNoChangeSoundPlayer.play();else{const e=this.selectionOnFireAction.item;if(e.soundPlayer)e.soundPlayer.play();else{const e=this.getVisibleListItemNodes().indexOf(this.selectionOnFireAction);f[e].play()}}}),this.addInputListener({focus:()=>{if(this.visible){const t=this.getListItemNode(e.value);t.supplyOpenResponseOnNextFocus(),t.focus()}},keydown:e=>{const t=this.getVisibleListItemNodes();if(e.domEvent&&v.ntP.isAnyKeyEvent(e.domEvent,[v.ntP.KEY_ESCAPE,v.ntP.KEY_TAB]))s(),n();else if(e.domEvent&&v.ntP.isAnyKeyEvent(e.domEvent,[v.ntP.KEY_DOWN_ARROW,v.ntP.KEY_UP_ARROW])){e.domEvent.preventDefault();const i=v.ntP.isKeyEvent(e.domEvent,v.ntP.KEY_DOWN_ARROW)?1:-1,s=t.indexOf(this.getFocusedItemNode()),n=s+i;t[n]&&t[n].focus(),e.pointer.reserveForKeyboardDrag()}else e.domEvent&&v.ntP.isKeyEvent(e.domEvent,v.ntP.KEY_HOME)?t[0].focus():e.domEvent&&v.ntP.isKeyEvent(e.domEvent,v.ntP.KEY_END)&&t[t.length-1].focus()}}),this.disposeComboBoxListBox=()=>{for(let e=0;ee.visible)}getListItemNode(e){const t=_.find(this.getAllListItemNodes(),t=>t.item.value===e);return t}getFocusedItemNode(){const e=_.find(this.getAllListItemNodes(),e=>e.focused);return e}focusListItemNode(e){let t=this.getListItemNode(e);t.visible||(t=_.find(this.getAllListItemNodes(),e=>e.visible)),t&&(t.supplyOpenResponseOnNextFocus(),t.focus())}voiceOnNewSelection(e,t,i){const s={nameResponse:i.voicingNameResponse,objectResponse:null,contextResponse:i.voicingContextResponse,hintResponse:null};t===e&&(s.contextResponse=null),this.voiceOnSelectionNode.voicingSpeakResponse(s)}}mt.register("ComboBoxListBox",Bh);const Zh=(e,t,i,s)=>(s.push(()=>{e.button.accessibleName=i}),t),qh=(e,t,i,s)=>(s.push(()=>{e.button.helpText=i}),t);class Fh extends((0,v.pL8)(v.NBX)){constructor(e,t,i,s){const n=(0,ae.ZP)()({align:"left",listPosition:"below",labelXSpacing:10,disabledOpacity:.5,cornerRadius:4,highlightFill:"rgb( 245, 245, 245 )",xMargin:12,yMargin:8,buttonFill:"white",buttonStroke:"black",buttonLineWidth:1,buttonTouchAreaXDilation:0,buttonTouchAreaYDilation:0,buttonMouseAreaXDilation:0,buttonMouseAreaYDilation:0,listFill:"white",listStroke:"black",listLineWidth:1,openedSoundPlayer:Ur,closedNoChangeSoundPlayer:Br,tagName:"div",accessibleNameBehavior:Zh,helpTextBehavior:qh,comboBoxVoicingNameResponsePattern:bh.VALUE_NAMED_PLACEHOLDER,comboBoxVoicingContextResponse:null,comboBoxVoicingHintResponse:null,tandem:L.Z.REQUIRED,tandemNameSuffix:"ComboBox",phetioType:Fh.ComboBoxIO,phetioEventType:Ne.Z.USER,visiblePropertyOptions:{phetioFeatured:!0},phetioEnabledPropertyInstrumented:!0},s),r=!!t[0].node?t.map(e=>e.node):Ft(t,n.tandem.createTandem("items")),o=[];for(let h=0;h{this.button.blockNextVoicingFocusListener(),this.button.focus()},this.button,n.tandem.createTandem("listBox"),{align:n.align,highlightFill:n.highlightFill,xMargin:n.xMargin,yMargin:n.yMargin,cornerRadius:n.cornerRadius,fill:n.listFill,stroke:n.listStroke,lineWidth:n.listLineWidth,visible:!1,comboBoxListItemNodeOptions:{comboBoxVoicingNameResponsePattern:n.comboBoxVoicingNameResponsePattern,voicingContextResponse:n.comboBoxVoicingContextResponse,voicingHintResponse:n.comboBoxVoicingHintResponse},openedSoundPlayer:n.openedSoundPlayer,closedNoChangeSoundPlayer:n.closedNoChangeSoundPlayer,ariaLabelledbyAssociations:[{otherNode:this.button,otherElementName:v.Grz.LABEL_SIBLING,thisElementName:v.Grz.PRIMARY_SIBLING}]}),i.addChild(this.listBox),this.listParent=i;const a=new v.z$X(this.button,this.listParent,{fromCoordinateFrame:"parent",toCoordinateFrame:"local"});he.Z.multilink([a,this.button.localBoundsProperty,this.listBox.localBoundsProperty],(e,t,i)=>{e&&("above"===this.listPosition?this.listBox.leftBottom=e.timesVector2(this.button.leftTop):this.listBox.leftTop=e.timesVector2(this.button.leftBottom))}),this.opacityProperty.link(e=>{this.listBox.opacityProperty.value=e}),this.mutate(n),this.button.addListener(()=>{this.listBox.visibleProperty.value=!this.listBox.visibleProperty.value,this.listBox.visibleProperty.value&&this.listBox.focusListItemNode(e.value)}),this.display=null,this.clickToDismissListener={down:e=>{(!phet.chipper.isFuzzEnabled()||Re.Z.nextDouble()<.005)&&(e.trail.containsNode(this.button)||e.trail.containsNode(this.listBox)||this.hideListBox())}},this.dismissWithFocusListener=e=>{e&&!e.trail.containsNode(this.listBox)&&this.hideListBox()},v.IKS.pdomFocusProperty.link(this.dismissWithFocusListener),this.listBox.visibleProperty.link(e=>{e?(this.scaleListBox(),this.listBox.moveToFront(),this.display=this.getUniqueTrail().rootNode().getRootedDisplays()[0],this.display.addInputListener(this.clickToDismissListener)):this.display&&this.display.hasInputListener(this.clickToDismissListener)&&(this.display.removeInputListener(this.clickToDismissListener),this.display=null)}),this.displayOnlyProperty=new S.Z(!1,{tandem:n.tandem.createTandem("displayOnlyProperty"),phetioFeatured:!0,phetioDocumentation:"disables interaction with the ComboBox and makes it appear like a display that shows the current selection"}),this.displayOnlyProperty.link(e=>{this.hideListBox(),this.button.setDisplayOnly(e),this.pickable=!e}),this.addLinkedElement(e,{tandem:n.tandem.createTandem("property")}),this.disposeComboBox=()=>{a.dispose(),r.forEach(e=>e.dispose()),this.display&&this.display.hasInputListener(this.clickToDismissListener)&&this.display.removeInputListener(this.clickToDismissListener),v.IKS.pdomFocusProperty.unlink(this.dismissWithFocusListener),this.displayOnlyProperty.dispose(),this.listBox.dispose(),this.button.dispose()}}dispose(){this.disposeComboBox(),super.dispose()}showListBox(){this.listBox.visibleProperty.value=!0}hideListBox(){this.listBox.visibleProperty.value=!1}scaleListBox(){if(!this.listBox.localBounds.isEmpty()){const e=this.button.localToGlobalBounds(this.button.localBounds).width/this.button.localBounds.width,t=this.listBox.localToGlobalBounds(this.listBox.localBounds).width/this.listBox.localBounds.width;this.listBox.scale(e/t)}}setItemVisible(e,t){this.listBox.setItemVisible(e,t)}isItemVisible(e){return this.listBox.isItemVisible(e)}static getMaxItemWidthProperty(e){const t=_.flatten(e.map(e=>{const t=[e.boundsProperty];return(0,v.AXx)(e)&&(t.push(e.isWidthResizableProperty),t.push(e.minimumWidthProperty)),t}));return ge.ZP.deriveAny(t,()=>Math.max(...e.map(e=>(0,v.S3T)(e)?e.minimumWidth||0:e.width)))}static getMaxItemHeightProperty(e){const t=e.map(e=>e.boundsProperty);return ge.ZP.deriveAny(t,()=>Math.max(...e.map(e=>e.height)))}}p=Fh,_defineProperty(Fh,"ITEM_TANDEM_NAME_SUFFIX","Item"),_defineProperty(Fh,"ComboBoxIO",new Te.Z("ComboBoxIO",{valueType:p,documentation:"A combo box is composed of a push button and a listbox. The listbox contains items that represent choices. Pressing the button pops up the listbox. Selecting from an item in the listbox sets the value of an associated Property. The button shows the item that is currently selected.",supertype:v.NBX.NodeIO,events:["listBoxShown","listBoxHidden"]})),mt.register("ComboBox",Fh);const Hh=un.Z.a11y.preferences.tabs.audio.voicing.titleStringProperty,zh=un.Z.a11y.preferences.tabs.audio.voicing.toolbar.titleStringProperty,Yh=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.rate.titleStringProperty,Gh=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.rate.labelStringStringProperty,Wh=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.pitch.titleStringProperty,Uh=un.Z.a11y.preferences.tabs.audio.voicing.voicingOnStringProperty,Xh=un.Z.a11y.preferences.tabs.audio.voicing.voicingOffStringProperty,Kh=un.Z.a11y.preferences.tabs.audio.voicing.voicingOffOnlyAvailableInEnglishStringProperty,jh=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.variablesPatternStringProperty,Qh=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.titleStringProperty,Jh=un.Z.a11y.preferences.tabs.audio.voicing.toolbar.toolbarRemovedStringProperty,$h=un.Z.a11y.preferences.tabs.audio.voicing.toolbar.toolbarAddedStringProperty,el=un.Z.a11y.preferences.tabs.audio.voicing.simVoicingOptions.titleStringProperty,tl=un.Z.a11y.preferences.tabs.audio.voicing.simVoicingOptions.descriptionStringProperty,il=un.Z.a11y.preferences.tabs.audio.voicing.simVoicingOptions.objectDetails.labelStringProperty,sl=un.Z.a11y.preferences.tabs.audio.voicing.simVoicingOptions.contextChanges.labelStringProperty,nl=un.Z.a11y.preferences.tabs.audio.voicing.simVoicingOptions.helpfulHints.labelStringProperty,rl=un.Z.a11y.preferences.tabs.audio.voicing.simVoicingOptions.objectDetails.enabledAlertStringProperty,ol=un.Z.a11y.preferences.tabs.audio.voicing.simVoicingOptions.objectDetails.disabledAlertStringProperty,al=un.Z.a11y.preferences.tabs.audio.voicing.simVoicingOptions.contextChanges.enabledAlertStringProperty,hl=un.Z.a11y.preferences.tabs.audio.voicing.simVoicingOptions.contextChanges.disabledAlertStringProperty,ll=un.Z.a11y.preferences.tabs.audio.voicing.simVoicingOptions.helpfulHints.enabledAlertStringProperty,dl=un.Z.a11y.preferences.tabs.audio.voicing.simVoicingOptions.helpfulHints.disabledAlertStringProperty,cl=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.voice.titleStringProperty,ul=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.voice.titlePatternStringProperty,pl=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.voice.noVoicesAvailableStringProperty,ml=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.expandedAlertStringProperty,gl=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.collapsedAlertStringProperty,yl=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.writtenVariablesPatternStringProperty,fl=un.Z.a11y.preferences.tabs.labelledDescriptionPatternStringProperty,Al=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.rate.rangeDescriptions.voiceRateNormalStringProperty,bl=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.rate.rangeDescriptions.lowStringProperty,Pl=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.rate.rangeDescriptions.normalStringProperty,Vl=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.rate.rangeDescriptions.aboveNormalStringProperty,vl=un.Z.a11y.preferences.tabs.audio.voicing.customizeVoice.rate.rangeDescriptions.highStringProperty,wl=un.Z.preferences.tabs.audio.voicing.titleEnglishOnlyStringProperty,Sl=un.Z.preferences.tabs.audio.voicing.descriptionStringProperty,Tl=new Map;Tl.set(new wa.Z(.5,.75),bl),Tl.set(new wa.Z(.75,1.25),Pl),Tl.set(new wa.Z(1.25,1.5),Vl),Tl.set(new wa.Z(1.5,2),vl);const El=new ke.Z(13,26),_l=new ke.Z(100,5);class xl extends ha{constructor(e,t){const i=we.Z.validValues&&we.Z.validValues.length>1?wl:Hh,s=new v.xvT(i,Fd.PANEL_SECTION_LABEL_OPTIONS),n=new gn(fl,{label:i,description:Sl}),r=new v.JxC(Sl,(0,Se.Z)({},Fd.PANEL_SECTION_CONTENT_OPTIONS,{readingBlockNameResponse:n})),o=new oa(e.voicingEnabledProperty,!1,!0,(0,ae.JA)({a11yName:i},ca.TOGGLE_SWITCH_OPTIONS)),a=new qo({labelNode:s,descriptionNode:r,controlNode:o}),h=new v.xvT(zh,Fd.PANEL_SECTION_LABEL_OPTIONS),l=new oa(e.toolbarEnabledProperty,!1,!0,(0,ae.JA)({a11yName:zh,leftValueContextResponse:Jh,rightValueContextResponse:$h},ca.TOGGLE_SWITCH_OPTIONS)),d=new qo({labelNode:h,controlNode:l}),c=new v.xvT(el,(0,Se.Z)({},Fd.PANEL_SECTION_LABEL_OPTIONS,{tagName:"h3",innerContent:el})),u=new gn(fl,{label:el,description:tl}),p=new v.JxC(tl,(0,Se.Z)({},Fd.PANEL_SECTION_CONTENT_OPTIONS,{readingBlockNameResponse:u})),m=(e,t,i,s,n)=>{const r=new v.xvT(e,Fd.PANEL_SECTION_CONTENT_OPTIONS),o=new Pi(t,r,{labelTagName:"label",labelContent:e,voicingNameResponse:e,voicingIgnoreVoicingManagerProperties:!0,voiceNameResponseOnSelection:!1,checkedContextResponse:i,uncheckedContextResponse:s,disposer:n,tandem:L.Z.OPT_OUT});return r.disposer=o,o},g=new v.NBX,y=new v.SHm({align:"left",spacing:5,children:[m(il,e.voicingObjectResponsesEnabledProperty,rl,ol,c),m(sl,e.voicingContextResponsesEnabledProperty,al,hl,c),m(nl,e.voicingHintResponsesEnabledProperty,ll,dl,c)]});g.children=[c,p,y],p.leftTop=c.leftBottom.plusXY(0,5),y.leftTop=p.leftBottom.plusXY(Fd.CONTENT_INDENTATION_SPACING,5);const f=new Cl(Yh,Gh,e.voiceRateProperty),A=new Dl(Wh,e.voicePitchProperty),b=new v.SHm({spacing:5,align:"left",children:[f,A]}),P=new v.xvT(Qh,(0,Se.Z)({},Fd.PANEL_SECTION_LABEL_OPTIONS,{cursor:"pointer"})),V=new S.Z(!1),w=new bs(V,{sideLength:16,innerContent:Qh,voicingNameResponse:Qh,voicingIgnoreVoicingManagerProperties:!0,tandem:L.Z.OPT_OUT}),T=new v.NBX({children:[P,w]}),E=new v.$o8({press:()=>{V.toggle()},tandem:L.Z.OPT_OUT});P.addInputListener(E);const _=new v.NBX({children:[g,d,T,b]});d.leftTop=g.leftBottom.plusXY(0,20),P.leftTop=d.leftBottom.plusXY(0,20),w.leftCenter=P.rightCenter.plusXY(10,0),b.leftTop=P.leftBottom.plusXY(0,10),V.link(e=>{b.visible=e}),w.focusHighlight=new v.UQs(T),super({titleNode:a,contentNode:_});const x=e=>{_.visible=e};e.voicingEnabledProperty.link(x);const C=e=>{a.enabledProperty.value=e.startsWith("en")};we.Z.link(C);const I=new gi.Z,D=t=>{e.voicingMainWindowVoicingEnabledProperty.value&&(I.alert=t?Uh:we.Z.value.startsWith("en")?Xh:Kh,this.isInsidePhetioArchetype()||v.LY3.speakIgnoringEnabled(I),this.alertDescriptionUtterance(I))};e.voicingEnabledProperty.lazyLink(D);let k=null;const M=t=>{k&&(b.removeChild(k),k.dispose());let i=[];if(t.length>0){i=v.LY3.getEnglishPrioritizedVoices().slice(0,12)}const s=phet.joist.sim.topLayer||new v.NBX;k=new Il(e.voiceProperty,i,s),b.addChild(k)};v.LY3.voicesProperty.link(M),V.lazyLink(e=>{const t=e?ml:gl;w.voicingSpeakContextResponse({contextResponse:t}),this.alertDescriptionUtterance(t)}),this.disposeVoicingPanelSection=()=>{h.dispose(),c.dispose(),P.dispose(),s.dispose(),A.dispose(),f.dispose(),e.voicingEnabledProperty.unlink(D),e.voicingEnabledProperty.unlink(x),v.LY3.voicesProperty.unlink(M),we.Z.unlink(C),a.dispose(),V.dispose(),w.dispose(),d.dispose(),l.dispose(),I.dispose(),o.dispose(),r.dispose(),p.dispose(),n.dispose(),u.dispose(),k&&k.dispose()}}dispose(){this.disposeVoicingPanelSection(),super.dispose()}}class Cl extends kh{constructor(e,t,i){super(e,i,i.range,{includeArrowButtons:!1,layoutFunction:kh.createLayoutFunction4(),delta:.25,titleNodeOptions:(0,Se.Z)({},Fd.PANEL_SECTION_CONTENT_OPTIONS,{maxWidth:45}),numberDisplayOptions:{decimalPlaces:2,valuePattern:jh,textOptions:(0,Se.Z)({},Fd.PANEL_SECTION_CONTENT_OPTIONS,{maxWidth:45})},sliderOptions:{thumbSize:El,trackSize:_l,keyboardStep:.25,minorTickSpacing:.25,labelTagName:"label",labelContent:t,voicingOnEndResponseOptions:{withNameResponse:!0}},tandem:L.Z.OPT_OUT}),this.slider.voicingNameResponse=t,this.slider.voicingIgnoreVoicingManagerProperties=!0;const s=new gn(yl,{value:i}),n=new ge.ZP([i,Al,s],(e,t,i)=>1===e?t:i);this.slider.voicingObjectResponse=n,this.disposeVoiceRateNumberControl=()=>{n.dispose(),s.dispose()}}dispose(){this.disposeVoiceRateNumberControl(),super.dispose()}}class Il extends Fh{constructor(e,t,i,s){const n=(0,ae.ZP)()({listPosition:"above",accessibleName:cl,comboBoxVoicingNameResponsePattern:ul.value,tandem:L.Z.OPT_OUT},s),r=[];0===t.length&&r.push({value:null,createNode:e=>new v.xvT(pl,Fd.PANEL_SECTION_CONTENT_OPTIONS),a11yName:pl}),t.forEach(e=>{r.push({value:e,createNode:t=>new v.xvT(e.name,Fd.PANEL_SECTION_CONTENT_OPTIONS),a11yName:e.name})}),e.set(r[0].value),super(e,r,i,n),this.button.voicingIgnoreVoicingManagerProperties=!0,this.disposeVoiceComboBox=()=>{r.forEach(e=>{e.value=null})}}dispose(){this.disposeVoiceComboBox(),super.dispose()}}class Dl extends v.SHm{constructor(e,t){const i=new v.xvT(e,Fd.PANEL_SECTION_CONTENT_OPTIONS),s=t.range,n=new Th(t,s,{majorTickLength:10,thumbSize:El,trackSize:_l,keyboardStep:.25,shiftKeyboardStep:.1,constrainValue:e=>I.Z.roundToInterval(e,.01),labelTagName:"label",labelContent:e,voicingNameResponse:e,voicingIgnoreVoicingManagerProperties:!0,tandem:L.Z.OPT_OUT}),r=new v.xvT("Low",{font:new ht(14)});n.addMajorTick(s.min,r);const o=new v.xvT("High",{font:new ht(14)});n.addMajorTick(s.max,o),super();const a=(e,t)=>{n.voicingObjectResponse=this.getPitchDescriptionString(e)};t.link(a),this.mutate({children:[i,n],spacing:5}),this.disposeVoicePitchSlider=()=>{i.dispose(),n.dispose(),r.dispose(),o.dispose(),t.unlink(a)}}dispose(){this.disposeVoicePitchSlider(),super.dispose()}getPitchDescriptionString(e){let t="";return Tl.forEach((i,s)=>{s.contains(e)&&(t=i)}),t}}T.Z.register("VoicingPanelSection",xl);const Ll=xl;class kl extends v.NBX{constructor(e,t,i,s){super((0,ae.ZP)()({tagName:"div",labelTagName:"h2",tandem:L.Z.OPTIONAL},s));const n=he.Z.multilink([t,i],(t,i)=>{this.visible=t===e&&i});this.disposePreferencesPanel=()=>{he.Z.unmultilink(n)}}dispose(){this.disposePreferencesPanel(),super.dispose()}}T.Z.register("PreferencesPanel",kl);const Ml=kl;class Ol extends ne.Z{}_defineProperty(Ol,"OVERVIEW",new(m=Ol)),_defineProperty(Ol,"SIMULATION",new m),_defineProperty(Ol,"VISUAL",new m),_defineProperty(Ol,"AUDIO",new m),_defineProperty(Ol,"INPUT",new m),_defineProperty(Ol,"LOCALIZATION",new m),_defineProperty(Ol,"enumeration",new se.Z(m)),T.Z.register("PreferencesType",Ol);const Nl=un.Z.preferences.tabs.audio.audioFeatures.titleStringProperty;class Rl extends Ml{constructor(e,t,i,s){super(Ol.AUDIO,t,i,{labelContent:Nl});const n={align:"left",spacing:Fd.CONTENT_SPACING,excludeInvisibleChildrenFromBounds:!1},r=new v.SHm(n),o=new v.SHm(n);if(e.supportsVoicing){const t=new Ll(e);r.addChild(t),this.disposeEmitter.addListener(()=>t.dispose())}if(e.supportsSound){const t=e.supportsVoicing!==e.supportsSound,i=new va(e,{includeTitleToggleSwitch:!t});o.addChild(i),this.disposeEmitter.addListener(()=>i.dispose())}const a=new v.BET({align:"top",spacing:10,children:[r,o],tagName:"div"});e.customPreferences.forEach((e,t)=>{const i=t%2==0?r:o,n=e.createContent(s.tandem),a=new ha({contentNode:n,contentNodeOptions:{excludeInvisibleChildrenFromBounds:!0},contentLeftMargin:0});i.addChild(a),this.disposeEmitter.addListener(()=>{n.dispose(),a.dispose()})});const h=new v.xvT(Nl,Fd.PANEL_SECTION_LABEL_OPTIONS),l=new oa(e.audioEnabledProperty,!1,!0,(0,ae.JA)({a11yName:Nl,disposer:this},ca.TOGGLE_SWITCH_OPTIONS)),d=new qo({labelNode:h,controlNode:l,headingControl:!0}),c=e=>{a.enabled=e};e.audioEnabledProperty.link(c);const u=new v.SHm({align:"center",spacing:25,children:[d,a]});this.addChild(u),this.disposeAudioPreferencesPanel=()=>{r.dispose(),o.dispose(),d.dispose(),h.dispose(),a.dispose(),u.dispose(),e.audioEnabledProperty.unlink(c)}}dispose(){this.disposeAudioPreferencesPanel(),super.dispose()}}T.Z.register("AudioPreferencesTabPanel",Rl);const Bl=Rl;class Zl extends Ml{constructor(e,t,i,s){const n=(0,ae.ZP)()({labelContent:"Simulation",phetioVisiblePropertyInstrumented:!1},s);super(Ol.SIMULATION,t,i,n);const r=new v.SHm({align:"left",spacing:Fd.CONTENT_SPACING});this.addChild(r);const o=[];e.customPreferences.forEach(e=>{const t=e.createContent(n.tandem),i=new ha({contentNode:t});this.disposeEmitter.addListener(()=>{i.dispose(),t.dispose()}),o.push(i)}),r.children=o,this.disposeSimulationPreferencesPanel=()=>{r.dispose()}}dispose(){this.disposeSimulationPreferencesPanel(),super.dispose()}}T.Z.register("SimulationPreferencesPanel",Zl);const ql=Zl,Fl=un.Z.a11y.preferences.tabs.input.gestureControl.enabledAlertStringProperty,Hl=un.Z.a11y.preferences.tabs.input.gestureControl.disabledAlertStringProperty,zl=un.Z.a11y.preferences.tabs.labelledDescriptionPatternStringProperty;class Yl extends Ml{constructor(e,t,i,s){super(Ol.INPUT,t,i,{labelContent:"Input"});const n=new v.SHm({spacing:Fd.CONTENT_SPACING,align:"left"});if(this.addChild(n),e.supportsGestureControl){const t=new v.xvT("Gesture Control",(0,Se.Z)({disposer:this},Fd.PANEL_SECTION_LABEL_OPTIONS)),i=new v.yhY("Use touch with custom swipes and taps instead. No direct touch with gesture control enabled.",(0,Se.Z)({},Fd.PANEL_SECTION_CONTENT_OPTIONS,{lineWrap:350,maxHeight:100,disposer:this,readingBlockNameResponse:Oe.Z.fillIn(zl,{label:"Gesture Control",description:"Use touch with custom swipes and taps instead. No direct touch with gesture control enabled."})})),s=new oa(e.gestureControlsEnabledProperty,!1,!0,(0,ae.JA)({a11yName:"Gesture Control",leftValueContextResponse:Hl,rightValueContextResponse:Fl,disposer:this},ca.TOGGLE_SWITCH_OPTIONS)),r=new qo({labelNode:t,descriptionNode:i,controlNode:s,disposer:this}),o=new ha({titleNode:r,contentLeftMargin:0,disposer:this});n.addChild(o)}const r=new v.SHm({spacing:Fd.CONTENT_SPACING,align:"left"});e.customPreferences.forEach(e=>{const t=e.createContent(s.tandem);this.disposeEmitter.addListener(()=>t.dispose()),r.addChild(new v.NBX({children:[t]}))});const o=new ha({contentNode:r,contentLeftMargin:0});n.addChild(o),this.disposeInputPreferencesPanel=()=>{n.dispose(),o.dispose(),r.children.forEach(e=>e.dispose()),r.dispose()}}dispose(){this.disposeInputPreferencesPanel(),super.dispose()}}T.Z.register("InputPreferencesPanel",Yl);const Gl=Yl;class Wl extends qo{constructor(e,t){const i=new v.JxC(un.Z.projectorModeStringProperty,Fd.PANEL_SECTION_LABEL_OPTIONS),s=new v.JxC(un.Z.preferences.tabs.visual.projectorModeDescriptionStringProperty,Fd.PANEL_SECTION_CONTENT_OPTIONS),n=phet.chipper.colorProfiles.find(e=>e!==v.iaM.PROJECTOR_COLOR_PROFILE),r=new oa(e,n,v.iaM.PROJECTOR_COLOR_PROFILE,ca.TOGGLE_SWITCH_OPTIONS),o=new gn(un.Z.a11y.preferences.tabs.labelledDescriptionPatternStringProperty,{label:un.Z.projectorModeStringProperty,description:un.Z.preferences.tabs.visual.projectorModeDescriptionStringProperty});s.readingBlockNameResponse=o,super((0,ae.ZP)()({labelNode:i,descriptionNode:s,controlNode:r},t)),this.disposeProjectorModeToggleSwitch=()=>{i.dispose(),s.dispose(),r.dispose(),o.dispose()}}dispose(){this.disposeProjectorModeToggleSwitch(),super.dispose()}}T.Z.register("ProjectorModeToggleSwitch",Wl);const Ul=Wl,Xl=un.Z.preferences.tabs.visual.interactiveHighlightsStringProperty,Kl=un.Z.preferences.tabs.visual.interactiveHighlightsDescriptionStringProperty,jl=un.Z.a11y.preferences.tabs.visual.interactiveHighlights.enabledAlertStringProperty,Ql=un.Z.a11y.preferences.tabs.visual.interactiveHighlights.disabledAlertStringProperty,Jl=un.Z.a11y.preferences.tabs.labelledDescriptionPatternStringProperty;class $l extends Ml{constructor(e,t,i,s){const n=(0,ae.ZP)()({labelContent:"Visual"},s),r=n.tandem;n.tandem=L.Z.OPTIONAL,super(Ol.VISUAL,t,i,n);const o=new v.SHm({spacing:Fd.CONTENT_SPACING,align:"left"});if(e.supportsProjectorMode){const t=new Ul(e.colorProfileProperty);o.addChild(t),this.disposeEmitter.addListener(()=>t.dispose())}if(e.supportsInteractiveHighlights){const t=new v.xvT(Xl,Fd.PANEL_SECTION_LABEL_OPTIONS);t.disposer=this;const i=new gn(Jl,{label:Xl,description:Kl},{disposer:this}),s=new v.JxC(Kl,(0,Se.Z)({},Fd.PANEL_SECTION_CONTENT_OPTIONS,{readingBlockNameResponse:i,disposer:this})),n=new oa(e.interactiveHighlightsEnabledProperty,!1,!0,(0,ae.JA)({a11yName:Xl,leftValueContextResponse:Ql,rightValueContextResponse:jl,disposer:this},ca.TOGGLE_SWITCH_OPTIONS)),r=new qo({labelNode:t,descriptionNode:s,controlNode:n,disposer:this});o.addChild(r)}e.customPreferences.forEach(e=>{const t=e.createContent(r),i=new v.NBX({children:[t]});o.addChild(i),this.disposeEmitter.addListener(()=>{t.dispose(),i.dispose()})});const a=new ha({contentNode:o,contentLeftMargin:0});this.addChild(a),this.disposeVisualPreferencesPanel=()=>{a.dispose(),o.dispose()}}dispose(){this.disposeVisualPreferencesPanel(),super.dispose()}}T.Z.register("VisualPreferencesPanel",$l);const ed=$l;class td extends Fh{constructor(e,t,i){const s=(0,ae.ZP)()({yMargin:3,tandem:L.Z.OPT_OUT},i);super(e,t.map((e,t)=>{const i=new v.NBX({children:[e.icon]}),s=new v.BET({children:[i,new v.xvT(e.label,Fd.PANEL_SECTION_CONTENT_OPTIONS)],spacing:10});return{value:e,createNode:e=>s}}),phet.joist.sim.topLayer,s)}}T.Z.register("RegionAndCultureComboBox",td);const id=td;var sd=i(9187);class nd extends v.AeJ{constructor(e,t){const i=phet.chipper.queryParameters.dev?`${sd.Z[t].localizedName} (${t})`:sd.Z[t].localizedName,s=new v.xvT(i,{font:Fd.CONTENT_FONT});super(s.bounds.dilated(5),{cursor:"pointer",tagName:"button"}),s.center=this.center,this.addChild(s),this.locale=t;const n=new v.eMb({fire:()=>{e.value=t},tandem:L.Z.OPT_OUT});this.addInputListener(n),n.isOverProperty.link(e=>{this.stroke=e?v.JPB.getInnerGroupHighlightColor():v.Ilk.TRANSPARENT});const r=e=>{this.fill=e===t?Mn.PHET_LOGO_BLUE:null};e.link(r),this.disposeLanguageSelectionNode=()=>{s.dispose(),e.unlink(r),this.removeInputListener(n),n.dispose()}}dispose(){this.disposeLanguageSelectionNode(),super.dispose()}}T.Z.register("LanguageSelectionNode",nd);class rd extends yt{constructor(e){const t=new v.zch({xMargin:5,xAlign:"left",autoRows:15,maxWidth:1e3,resize:!1,children:e.validValues.map(t=>new nd(e,t))});super(t),this.disposeLocalePanel=()=>{t.children.forEach(e=>{e.dispose()}),t.dispose()}}dispose(){this.disposeLocalePanel(),super.dispose()}}T.Z.register("LocalePanel",rd);const od=rd,ad=un.Z.preferences.tabs.localization.titleStringProperty,hd=un.Z.preferences.tabs.localization.regionAndCulture.titleStringProperty;class ld extends Ml{constructor(e,t,i,s){const n=(0,ae.ZP)()({labelContent:ad},s);super(Ol.LOCALIZATION,t,i,n);const r=new v.SHm({spacing:Fd.CONTENT_SPACING});if(e.regionAndCultureProperty.value){const t=new id(e.regionAndCultureProperty,e.characterSets);r.addChild(new v.BET({spacing:10,children:[new v.xvT(hd,Fd.PANEL_SECTION_CONTENT_OPTIONS),t]})),this.disposeEmitter.addListener(()=>t.dispose())}if(e.supportsDynamicLocales&&e.includeLocalePanel){const t=new od(e.localeProperty);r.addChild(t),this.disposeEmitter.addListener(()=>t.dispose())}e.customPreferences.forEach(e=>{const t=e.createContent(s.tandem);this.disposeEmitter.addListener(()=>t.dispose()),r.addChild(new v.NBX({children:[t]}))}),r.align=r.children.length>1?"left":"center";const o=new ha({contentNode:r,contentLeftMargin:0});this.addChild(o)}}T.Z.register("LocalizationPreferencesPanel",ld);const dd=ld,cd=new ge.ZP([we.Z],e=>"ltr"===sd.Z[e].direction);T.Z.register("isLeftToRightProperty",cd);const ud=cd;class pd extends Ml{constructor(e,t){super(Ol.OVERVIEW,e,t);const i=(0,Se.Z)({},Fd.PANEL_SECTION_CONTENT_OPTIONS,{maxWidth:null,lineWrap:600,maxHeight:600,tagName:"p"}),s=[new v.yhY(un.Z.preferences.tabs.general.accessibilityIntroStringProperty,i),new v.yhY(un.Z.preferences.tabs.general.moreAccessibilityStringProperty,i)],n=new v.SHm({spacing:10,children:s});this.addChild(n);const r=e=>{s.forEach(t=>{const i=e?"left":"right";t.align=i,n.align=i})};ud.link(r),this.disposeOverviewPreferencesPanel=()=>{ud.unlink(r),n.dispose(),s.forEach(e=>e.dispose())}}dispose(){this.disposeOverviewPreferencesPanel(),super.dispose()}}T.Z.register("OverviewPreferencesPanel",pd);const md=pd;class gd extends v.NBX{constructor(e,t,i,s,n){const r=(0,ae.ZP)()({phetioVisiblePropertyInstrumented:!1},n);super(r),_defineProperty(this,"content",[]),this.selectedTabProperty=i;const o=new v.Lkj({matchVertical:!1});let a=null;if(t.includes(Ol.OVERVIEW)){a=new md(i,s.getTabVisibleProperty(Ol.OVERVIEW));const e=o.createBox(a);this.addChild(e),this.content.push(new yd(a,Ol.OVERVIEW))}let h=null;if(t.includes(Ol.SIMULATION)){h=new ql(e.simulationModel,i,s.getTabVisibleProperty(Ol.SIMULATION),{tandem:r.tandem.createTandem("simulationPreferencesPanel")});const t=o.createBox(h);this.addChild(t),this.content.push(new yd(h,Ol.SIMULATION))}let l=null;if(t.includes(Ol.VISUAL)){l=new ed(e.visualModel,i,s.getTabVisibleProperty(Ol.VISUAL),{tandem:r.tandem.createTandem("visualPreferencesPanel")});const t=o.createBox(l);this.addChild(t),this.content.push(new yd(l,Ol.VISUAL))}let d=null;if(t.includes(Ol.AUDIO)){d=new Bl(e.audioModel,i,s.getTabVisibleProperty(Ol.AUDIO),{tandem:r.tandem.createTandem("audioPreferencesPanel")});const t=o.createBox(d);this.addChild(t),this.content.push(new yd(d,Ol.AUDIO))}let c=null;if(t.includes(Ol.INPUT)){c=new Gl(e.inputModel,i,s.getTabVisibleProperty(Ol.INPUT),{tandem:r.tandem.createTandem("inputPreferencesPanel")});const t=o.createBox(c);this.addChild(t),this.content.push(new yd(c,Ol.INPUT))}let u=null;if(t.includes(Ol.LOCALIZATION)){u=new dd(e.localizationModel,i,s.getTabVisibleProperty(Ol.LOCALIZATION),{tandem:r.tandem.createTandem("localizationPreferencesPanel")});const t=o.createBox(u);this.addChild(t),this.content.push(new yd(u,Ol.LOCALIZATION))}this.disposePreferencesPanel=()=>{o.dispose(),this.content.forEach(e=>e.dispose()),a&&a.dispose(),h&&h.dispose(),l&&l.dispose(),d&&d.dispose(),c&&c.dispose(),u&&u.dispose()}}dispose(){this.disposePreferencesPanel(),super.dispose()}getSelectedContent(){for(let e=0;e{e.focusable=!1}})}}T.Z.register("PreferencesPanels",gd);const fd=gd,Ad=new Qe.bn("M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z").makeImmutable();class bd extends((0,v.CHP)(v.NBX)){constructor(e,t,i,s){const n=(0,ae.ZP)()({iconNode:null,phetioFeatured:!0,visiblePropertyOptions:{phetioFeatured:!0},cursor:"pointer",tagName:"button",innerContent:e,ariaRole:"tab",focusable:!0,containerTagName:"li",containerAriaRole:"presentation"},s),r=new v.xvT(e,Fd.TAB_OPTIONS),o=[r];n.iconNode&&o.push(n.iconNode);const a=new v.BET({children:o,spacing:8}),h=new v.AeJ({children:[a]}),l=new v.x12(0,0,0,0,{stroke:v.YiU.INNER_FOCUS_COLOR,lineWidth:5});a.boundsProperty.link(e=>{h.rectBounds=e.dilatedXY(15,10),l.x2=e.width,l.centerTop=e.centerBottom.plusXY(0,5)}),super(n),this.children=[h,l],this.value=i;const d=new gn(un.Z.a11y.preferences.tabs.tabResponsePatternStringProperty,{title:e});this.voicingNameResponse=d;const c=new v.$o8({press:()=>{t.set(i),this.voicingSpeakNameResponse()},tandem:L.Z.OPT_OUT});this.addInputListener(c);const u=he.Z.multilink([t,c.isOverProperty],(e,t)=>{h.opacity=e===i?1:t?.8:.6,this.focusable=e===i,l.visible=e===i});this.disposePreferencesTab=()=>{u.dispose(),c.dispose(),d.dispose(),a.dispose(),h.dispose(),r.dispose()}}dispose(){this.disposePreferencesTab(),super.dispose()}}T.Z.register("PreferencesTab",bd);const Pd=bd;class Vd extends v.BET{constructor(e,t,i){const s=(0,ae.ZP)()({tagName:"ul",ariaRole:"tablist",groupFocusHighlight:!0,spacing:10},i);super(s),_defineProperty(this,"selectedButton",null),_defineProperty(this,"content",[]),this.selectedPanelProperty=t;const n=t=>_.includes(e,t);n(Ol.OVERVIEW)&&this.content.push(new Pd(un.Z.preferences.tabs.overview.titleStringProperty,t,Ol.OVERVIEW,{tandem:s.tandem.createTandem("overviewTab")})),n(Ol.SIMULATION)&&this.content.push(new Pd(un.Z.preferences.tabs.simulation.titleStringProperty,t,Ol.SIMULATION,{tandem:s.tandem.createTandem("simulationTab")})),n(Ol.VISUAL)&&this.content.push(new Pd(un.Z.preferences.tabs.visual.titleStringProperty,t,Ol.VISUAL,{tandem:s.tandem.createTandem("visualTab")})),n(Ol.AUDIO)&&this.content.push(new Pd(un.Z.preferences.tabs.audio.titleStringProperty,t,Ol.AUDIO,{tandem:s.tandem.createTandem("audioTab")})),n(Ol.INPUT)&&this.content.push(new Pd(un.Z.preferences.tabs.input.titleStringProperty,t,Ol.INPUT,{tandem:s.tandem.createTandem("inputTab")})),n(Ol.LOCALIZATION)&&this.content.push(new Pd(un.Z.preferences.tabs.localization.titleStringProperty,t,Ol.LOCALIZATION,{iconNode:new v.y$t(Ad,{scale:.04,fill:"black"}),tandem:s.tandem.createTandem("localizationTab")})),this.children=this.content;const r=he.Z.multilinkAny([t,...this.content.map(e=>e.visibleProperty)],()=>{if(!this.content.find(e=>e.value===t.value).visibleProperty.value){const e=this.content.find(e=>e.visibleProperty.value);e&&(t.value=e.value)}}),o={keydown:e=>{e.pointer.reserveForKeyboardDrag()},keyup:e=>{if(v.ntP.isAnyKeyEvent(e.domEvent,[v.ntP.KEY_RIGHT_ARROW,v.ntP.KEY_LEFT_ARROW])){e.domEvent.preventDefault();const i=v.ntP.isKeyEvent(e.domEvent,v.ntP.KEY_RIGHT_ARROW)?1:-1;for(let e=0;e{this.content.forEach(e=>{e.value===this.selectedPanelProperty.value&&(this.selectedButton=e)})};t.link(a),1===e.length&&(this.focusable=!1,this.inputEnabledProperty.value=!1),this.disposePreferencesTabs=()=>{this.removeInputListener(o),t.unlink(a),he.Z.unmultilink(r),this.content.forEach(e=>e.dispose())}}getTabVisibleProperty(e){const t=_.find(this.content,t=>t.value===e);return t.visibleProperty}focusSelectedTab(){this.content.forEach(e=>{e.value===this.selectedPanelProperty.value&&e.focus()})}dispose(){this.disposePreferencesTabs(),super.dispose()}}T.Z.register("PreferencesTabs",Vd);const vd=Vd,wd="data:audio/mpeg;base64,//u0xAAA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VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",Sd=M(F,wd),Td=k.Z.createLock(wd),Ed=new Z;let _d=!1;const xd=()=>{_d||(Td(),_d=!0)},Cd=F.decodeAudioData(Sd.buffer,e=>{null===Ed.audioBufferProperty.value&&(Ed.audioBufferProperty.set(e),xd())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),Ed.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),xd()});Cd&&Cd.then(e=>{null===Ed.audioBufferProperty.value&&(Ed.audioBufferProperty.set(e),xd())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),xd()});const Id=Ed;class Dd extends Nt{constructor(e,t){super(Id,t);const i=()=>{this.play()};e.lazyLink(i),this.disposePreferencesTabSwitchSoundGenerator=()=>{e.unlink(i)}}dispose(){this.disposePreferencesTabSwitchSoundGenerator(),super.dispose()}}T.Z.register("PreferencesTabSwitchSoundGenerator",Dd);const Ld=Dd,kd=new ht({size:24,weight:"bold"}),Md=new ht(20),Od={font:Md,maxWidth:120},Nd=new ht(16),Rd={font:Nd,maxWidth:500},Bd=new ht({weight:"bold",size:16}),Zd={font:Bd,maxWidth:360};class qd extends oo{constructor(e,t){const i=new v.xvT(un.Z.preferences.titleStringProperty,{font:kd,tagName:"h1",innerContent:un.Z.preferences.titleStringProperty,stringProperty:un.Z.preferences.titleStringProperty}),s=(0,ae.ZP)()({titleAlign:"center",title:i,phetioDynamicElement:!0,closeButtonVoicingDialogTitle:un.Z.preferences.titleStringProperty,positionInPDOM:!0},t),n=[Ol.OVERVIEW];e.supportsSimulationPreferences()&&n.push(Ol.SIMULATION),e.supportsVisualPreferences()&&n.push(Ol.VISUAL),e.supportsAudioPreferences()&&n.push(Ol.AUDIO),e.supportsInputPreferences()&&n.push(Ol.INPUT),e.supportsLocalizationPreferences()&&n.push(Ol.LOCALIZATION);const r=new Ti(Ol.OVERVIEW,{validValues:n,tandem:s.tandem.createTandem("selectedTabProperty")}),o=new vd(n,r,{tandem:s.tandem.createTandem("preferencesTabs")}),a=new fd(e,n,r,o,{tandem:s.tandem.createTandem("preferencesPanels")}),h=new v.SHm({children:[o,new v.qYj({layoutOptions:{bottomMargin:20,stretch:!0}}),a]}),l=new Ld(r,{initialOutputLevel:.2});me.addSoundGenerator(l,{categoryName:"user-interface"}),super(h,s),this.preferencesTabs=o,this.preferencesPanels=a,o.addInputListener({keydown:e=>{v.ntP.isKeyEvent(e.domEvent,v.ntP.KEY_DOWN_ARROW)&&this.focusSelectedPanel()}}),h.addInputListener({keydown:e=>{v.ntP.isKeyEvent(e.domEvent,v.ntP.KEY_UP_ARROW)&&this.preferencesPanels.isFocusableSelectedContent(e.target)&&this.focusSelectedTab()}}),this.disposePreferencesDialog=()=>{h.dispose(),me.removeSoundGenerator(l),l.dispose(),o.dispose(),r.dispose(),a.dispose(),i.dispose()}}focusSelectedTab(){this.preferencesTabs.focusSelectedTab()}focusSelectedPanel(){this.preferencesPanels.focusSelectedPanel()}dispose(){this.disposePreferencesDialog(),super.dispose()}}_defineProperty(qd,"TAB_FONT",Md),_defineProperty(qd,"TAB_OPTIONS",Od),_defineProperty(qd,"TITLE_FONT",kd),_defineProperty(qd,"CONTENT_FONT",Nd),_defineProperty(qd,"CONTENT_MAX_WIDTH",500),_defineProperty(qd,"PANEL_SECTION_CONTENT_OPTIONS",Rd),_defineProperty(qd,"PANEL_SECTION_LABEL_FONT",Bd),_defineProperty(qd,"PANEL_SECTION_LABEL_MAX_WIDTH",360),_defineProperty(qd,"PANEL_SECTION_LABEL_OPTIONS",Zd),_defineProperty(qd,"CONTENT_SPACING",20),_defineProperty(qd,"CONTENT_INDENTATION_SPACING",15),_defineProperty(qd,"LABEL_CONTENT_SPACING",10),T.Z.register("PreferencesDialog",qd);const Fd=qd;class Hd extends To{constructor(e,t,i){const s=(0,ae.ZP)()({listener:()=>{const e=r.getElement();e.show(),e.focusSelectedTab()},highlightExtensionWidth:8.6,highlightExtensionHeight:10,innerContent:un.Z.preferences.titleStringProperty,positionInPDOM:!0,voicingNameResponse:un.Z.preferences.titleStringProperty,visiblePropertyOptions:{phetioFeatured:!0}},i),n=new v.y$t(Bo,{maxWidth:21.25});super(n,t,s);const r=new yo(t=>new Fd(e,{tandem:t,focusOnHideNode:this}),[],{tandem:s.tandem.createTandem("preferencesDialogCapsule"),phetioType:yo.PhetioCapsuleIO(oo.DialogIO)});t.link(e=>{n.fill=e.equals(v.Ilk.BLACK)?"white":"black"}),this.setPDOMAttribute("aria-haspopup",!0)}}T.Z.register("NavigationBarPreferencesButton",Hd);const zd=Hd;class Yd extends v.BET{constructor(e,t,i){const s=(0,ae.ZP)()({align:"center",spacing:2,tandem:L.Z.REQUIRED},i),n=[];if(e.preferencesModel.shouldShowDialog()){const i=new zd(e.preferencesModel,t,{tandem:s.tandem.createTandem("preferencesButton"),pointerAreaDilationX:1,pointerAreaDilationY:1});n.push(i)}const r=e.preferencesModel.supportsAudioPreferences(),o=new Ro(Ae.audioEnabledProperty,t,{tandem:s.tandem.createTandem("audioToggleButton"),pointerAreaDilationX:1,pointerAreaDilationY:.15,supportsAudioPreferences:r});if(r&&n.push(o),e.hasKeyboardHelpContent){const i=new Do(e.screens,e.selectedScreenProperty,t,{tandem:s.tandem.createTandem("keyboardHelpButton"),pointerAreaDilationX:1,pointerAreaDilationY:1});phet.chipper.queryParameters.supportsInteractiveDescription&&!Me.Z.mobileSafari&&n.push(i)}s.children=n,super(_.omit(s,"tandem"))}}T.Z.register("A11yButtonsHBox",Yd);const Gd=Yd,Wd=new Qe.bn("M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z").makeImmutable(),Ud=un.Z.a11y.homeScreenDescriptionStringProperty;class Xd extends To{constructor(e,t,i,s){const n=(0,ae.ZP)()({highlightExtensionWidth:4,containerTagName:"li",descriptionContent:Ud,appendDescription:!0,voicingHintResponse:Ud},s),r=new v.y$t(Wd);r.setScaleMagnitude(.48*e/r.height*.85);const o=new v.AeJ(0,0,r.width/.85+12,e);r.center=o.center;const a=new v.NBX({children:[o,r]}),h=new gi.Z,l=n.listener;n.listener=()=>{l&&l(),this.voicingSpeakFullResponse({objectResponse:null,hintResponse:null,utterance:h})},super(a,t,n);const d=v.YiU.getOuterLineWidthFromNode(this);this.focusHighlight=Qe.bn.bounds(this.bounds.setMaxY(this.bounds.maxY-d/2)),he.Z.multilink([this.interactionStateProperty,t],(e,t)=>{t.equals(v.Ilk.BLACK)?r.fill=e===Oi.PRESSED?"gray":"white":r.fill=e===Oi.PRESSED?"#444":"#222"}),this.addInputListener({focus:()=>{this.voicingSpeakFullResponse({objectResponse:null,contextResponse:null})}}),i.link(e=>{this.innerContent=e,this.voicingNameResponse=e})}}T.Z.register("HomeButton",Xd);const Kd=e=>e.width+8;class jd extends((0,v.CHP)(v.NBX)){constructor(e,t,i,s,n,r){const o=(0,ae.ZP)()({cursor:"pointer",phetioDocumentation:`Button in the navigation bar that selects the '${i.tandem.name}' screen`,maxButtonWidth:null,tagName:"button",containerTagName:"li",descriptionContent:i.descriptionContent,appendDescription:!0,voicingHintResponse:i.descriptionContent},r);super(),this.screen=i,i.pdomDisplayNameProperty.link(e=>{this.innerContent=e,this.voicingNameResponse=e});const a=new v.NBX({children:[i.navigationBarIcon],maxHeight:.625*n,tandem:o.tandem.createTandem("icon"),pdomVisible:!1}),h=new v.AeJ(0,0,a.width,a.height),l=new v.NBX({children:[a,h]}),d=new v.xvT(i.nameProperty,{font:new ht(10),tandem:o.tandem.createTandem("text"),stringPropertyOptions:{phetioReadOnly:!0}}),c=new v.SHm({children:[l,d],pickable:!1,usesOpacity:!0,maxHeight:n}),u=new v.AeJ({rectBounds:c.bounds}),p=Kd(u),m=new So(p,u.height,{center:c.center,fill:"white"}),g=new So(p,u.height,{center:c.center,fill:"black"}),y=new ge.ZP([t],e=>e===i);this.buttonModel=new qi({listener:()=>{t.value!==i&&this.voicingSpeakFullResponse({objectResponse:null,hintResponse:null}),t.value=i},tandem:o.tandem,enabledPropertyOptions:{phetioFeatured:!1}});const f=this.buttonModel.createPressListener({tandem:o.tandem.createTandem("pressListener")});this.addInputListener(f),this.addInputListener({focus:()=>{this.voicingSpeakFullResponse({objectResponse:null,contextResponse:null})}}),he.Z.multilink([y,this.buttonModel.looksPressedProperty,this.buttonModel.looksOverProperty,e,this.buttonModel.enabledProperty],(e,t,s,n,r)=>{const o=!n.equals(v.Ilk.BLACK),a=o?"black":Mn.BUTTON_YELLOW,l=o?"gray":"white";d.fill=e?a:l,c.opacity=e?1:t?.65:.5,m.visible=!o&&r&&(s||t),g.visible=o&&r&&(s||t),"black"===i.showScreenIconFrameForNavigationBarFill&&n.equals(v.Ilk.BLACK)?h.stroke=Mn.SCREEN_ICON_FRAME:"white"===i.showScreenIconFrameForNavigationBarFill&&n.equals(v.Ilk.WHITE)?h.stroke="black":h.stroke="transparent"}),this.buttonModel.enabledProperty.link(e=>{this.cursor=e?o.cursor:null});const A=()=>{c.spacing=I.Z.clamp(12-d.height,0,3),u.setRectBounds(c.bounds),m.spacing=g.spacing=Kd(u),m.center=g.center=c.center};c.boundsProperty.lazyLink(A),d.boundsProperty.link(A),this.children=[c,u,m,g];const b=o.maxButtonWidth&&this.width>o.maxButtonWidth;d.maxWidth=b?a.maxWidth=o.maxButtonWidth-(this.width-c.width):this.width;const P=v.YiU.getOuterLineWidthFromNode(this);this.focusHighlight=Qe.bn.bounds(this.bounds.withMinY(this.bounds.minY-P/2)),this.mutate(o)}}T.Z.register("NavigationBarScreenButton",jd);const Qd=jd;class Jd extends v.y$t{constructor(e){const t=new Qe.bn;for(let i=0;i<3;i++)t.circle(0,3.543*i*2.5,2.5);super(t,e)}}T.Z.register("KebabMenuIcon",Jd);const $d=Jd;var ec=i(8377);const tc=new Qe.bn("M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z").makeImmutable(),ic=new v.y$t(tc,{fill:"rgba(0,0,0,0.7)",maxWidth:15.5}),sc=ic.width+2;class nc extends((0,v.pL8)((0,v.CHP)(v.NBX))){constructor(e,t,i,s,n,r){const o=(0,ae.ZP)()({separatorBefore:!1,checkedProperty:null,handleFocusCallback:null,textFill:"black",cursor:"pointer",tandem:L.Z.OPTIONAL,phetioDocumentation:"Item buttons shown in a popup menu",phetioEventType:Ne.Z.USER,tagName:"button",containerTagName:"li",containerAriaRole:"none",ariaRole:"menuitem",positionInPDOM:!0},r);super(),n&&this.setVisibleProperty(v.U2N);const a=e=>{this.innerContent=e,this.voicingNameResponse=e};t.link(a),this.present=s;const h=new v.xvT(t,{font:new ht(18),fill:o.textFill,maxWidth:400}),l=new v.AeJ({cornerRadius:5});h.boundsProperty.link(e=>{this.localMinimumWidth=e.width+2+5+sc,l.rectHeight=e.height+3+3}),this.localPreferredWidthProperty.link(e=>{null===e&&(e=this.localMinimumWidth),e&&(l.rectWidth=e)}),this.addChild(l),this.addChild(h),v.bGt.create(this,[l,h],(e,t)=>{t.left=e.left+2+sc,t.centerY=e.centerY}),this.addInputListener({enter:()=>{l.fill="#a6d2f4"},exit:()=>{l.fill=null}}),this.addInputListener(new v.eMb({tandem:o.tandem.createTandem("inputListener"),fire:t=>{e(t),i(t),o.handleFocusCallback&&o.handleFocusCallback(t)}})),this.separatorBefore=o.separatorBefore;let d=null;if(o.checkedProperty){const e=new v.NBX({children:[ic],right:h.left-2,centerY:h.centerY});d=t=>{e.visible=t},o.checkedProperty.link(d),this.addChild(e)}this.mutate(o),this.disposem*nuItem=()=>{o.checkedProperty&&d&&o.checkedProperty.hasListener(d)&&o.checkedProperty.unlink(d),t.hasListener(a)&&t.unlink(a),h.dispose()}}dispose(){this.disposem*nuItem(),super.dispose()}}mt.register("MenuItem",nc);class rc extends v.SHm{constructor(e,t){const i={font:(t=(0,ae.ZP)()({titleFont:new ht({size:18,weight:"bold"}),textFont:new ht(16),align:"left",spacing:1,maxWidth:550},t)).textFont,align:"left",lineWrap:t.maxWidth,tagName:"p"},s=[];s.push(new v.JxC(un.Z.credits.titleStringProperty,{font:t.titleFont,tagName:"h2"}));const n=(e,t)=>new ge.ZP([e],e=>Oe.Z.format(e,`‪${t}‬`));if(e.leadDesign){const t=n(un.Z.credits.leadDesignStringProperty,e.leadDesign);s.push(new v.yhY(t,i))}if(e.softwareDevelopment){const t=n(un.Z.credits.softwareDevelopmentStringProperty,e.softwareDevelopment);s.push(new v.yhY(t,i))}if(e.team){const t=n(un.Z.credits.teamStringProperty,e.team);s.push(new v.yhY(t,i))}if(e.contributors){const t=n(un.Z.credits.contributorsStringProperty,e.contributors);s.push(new v.yhY(t,i))}if(e.qualityAssurance){const t=n(un.Z.credits.qualityAssuranceStringProperty,e.qualityAssurance);s.push(new v.yhY(t,i))}if(e.graphicArts){const t=n(un.Z.credits.graphicArtsStringProperty,e.graphicArts);s.push(new v.yhY(t,i))}if(e.soundDesign){const t=n(un.Z.credits.soundDesignStringProperty,e.soundDesign);s.push(new v.yhY(t,i))}if(e.thanks){s.length>0&&s.push(new v.mE$(13)),s.push(new v.JxC(un.Z.credits.thanksStringProperty,{font:t.titleFont,tagName:"h2"}));const n=new v.yhY(e.thanks,i);n.innerContent=e.thanks,s.push(n)}t.children=s,super(t),this.disposeCreditsNode=()=>{s.forEach(e=>{e.dispose&&e.dispose()})}}dispose(){this.disposeCreditsNode(),super.dispose()}}T.Z.register("CreditsNode",rc);const oc=JSON.stringify(window.phet&&phet.chipper?phet.chipper.packageObject:{name:"placeholder"}),ac=JSON.parse(oc);T.Z.register("packageJSON",ac);const hc=ac;class lc extends ne.Z{}_defineProperty(lc,"UP_TO_DATE",new(g=lc)),_defineProperty(lc,"OUT_OF_DATE",new g),_defineProperty(lc,"CHECKING",new g),_defineProperty(lc,"OFFLINE",new g),_defineProperty(lc,"UNCHECKED",new g),_defineProperty(lc,"enumeration",new se.Z(g,{phetioDocumentation:"Describes the states that can occur during an Update check"})),T.Z.register("UpdateState",lc);const dc=phet.preloads.chipper.SimVersion,cc=hc.name,uc=dc.parse(hc.version,phet.chipper.buildTimestamp),pc="https:"===document.location.protocol?"https:":"http:";const mc=new class{constructor(){this.stateProperty=new Ti(lc.UNCHECKED),this.latestVersion=null,this.ourVersion=uc,this.timeoutCallback=this.timeout.bind(this),this.areUpdatesChecked="phet"===phet.chipper.brand&&!phet.chipper.isApp&&phet.chipper.queryParameters.yotta,this.updateURL=`http://phet.colorado.edu/html-sim-update?simulation=${encodeURIComponent(cc)}&version=${encodeURIComponent(uc.toString())}&buildTimestamp=${encodeURIComponent(""+phet.chipper.buildTimestamp)}`,this.timeoutId=-1}clearTimeout(){window.clearTimeout(this.timeoutId)}setTimeout(){this.timeoutId=window.setTimeout(this.timeoutCallback,15e3)}resetTimeout(){this.stateProperty.value===lc.CHECKING&&(this.clearTimeout(),this.setTimeout())}timeout(){this.stateProperty.value=lc.OFFLINE}check(){if(!this.areUpdatesChecked||this.stateProperty.value!==lc.UNCHECKED&&this.stateProperty.value!==lc.OFFLINE)return;if(this.ourVersion.isSimNotPublished)return void(this.stateProperty.value=lc.UP_TO_DATE);const e=new XMLHttpRequest;"withCredentials"in e&&(this.stateProperty.value=lc.CHECKING,this.setTimeout(),e.onload=()=>{this.clearTimeout();try{const t=JSON.parse(e.responseText);t.error?(console.log("Update check failure: "+t.error),this.stateProperty.value=lc.OFFLINE):(this.updateURL&&(this.updateURL=t.updateURL),this.latestVersion=dc.parse(t.latestVersion,t.buildTimestamp),"out-of-date"===t.state?this.stateProperty.value=lc.OUT_OF_DATE:"up-to-date"===t.state?this.stateProperty.value=lc.UP_TO_DATE:(console.log("Failed to get proper state: "+t.state),this.stateProperty.value=lc.OFFLINE))}catch(t){this.stateProperty.value=lc.OFFLINE}},e.onerror=()=>{this.clearTimeout(),this.stateProperty.value=lc.OFFLINE},e.open("post",pc+"//phet.colorado.edu/services/check-html-updates",!0),e.send(JSON.stringify({api:"1.0",simulation:cc,locale:phet.joist.sim.locale,currentVersion:this.ourVersion.toString(),buildTimestamp:phet.chipper.buildTimestamp})))}};T.Z.register("updateCheck",mc);const gc=mc;class yc extends v.NBX{constructor(e){const t=(0,ae.ZP)()({diameter:15,speed:1,numberOfElements:16,elementFactory:yc.rectangleFactory,activeColor:"rgba( 0, 0, 0, 1 )",inactiveColor:"rgba( 0, 0, 0, 0.15 )"},e);super(t),this.indicatorRotation=2*Math.PI,this.angleDelta=2*Math.PI/t.numberOfElements,this.activeColorProperty=new v.M4p(t.activeColor),this.inactiveColorProperty=new v.M4p(t.inactiveColor),this.speed=t.speed,this.elements=[];let i=0;for(let s=0;st?`${e}`:e),i={url:gc.updateURL},s=new v.Hof(t,{links:i,font:bc});return new v.BET((0,Se.Z)({spacing:8,maxWidth:550,children:[new v.y$t(fc,{fill:"#E87600",scale:.03}),s],tagName:"div"},e))},createOutOfDateDialogNode:function(e,t,i,s){const n=new ge.ZP([un.Z.updates.newVersionAvailableStringProperty],e=>Oe.Z.format(e,i)),r=new ge.ZP([un.Z.updates.yourCurrentVersionStringProperty],e=>Oe.Z.format(e,t));return new v.SHm((0,Se.Z)({spacing:15,maxWidth:550,children:[new v.SHm({spacing:5,align:"left",children:[new v.JxC(n,{font:new ht(16),fontWeight:"bold"}),new v.JxC(r,{font:bc})]}),new v.BET({spacing:25,children:[new Ac(un.Z.updates.getUpdateStringProperty,{visibleProperty:v.U2N,baseColor:"#6f6",font:bc,listener:function(){(0,v.MwI)(gc.updateURL)}}),new Ac(un.Z.updates.noThanksStringProperty,{baseColor:"#ddd",font:bc,listener:function(){e.hide()}})]})]},s))},createOfflineNode:function(e){return new v.BET((0,Se.Z)({spacing:0,maxWidth:550,children:[new v.mE$(20),new v.JxC(un.Z.updates.offlineStringProperty,{font:new ht(e.big?16:14),fontWeight:e.big?"bold":"normal"})]},e))}};T.Z.register("UpdateNodes",Pc);const Vc=Pc;class vc extends oo{constructor(e,t,i,s,n){const r=(0,ae.ZP)()({xSpacing:26,topMargin:26,bottomMargin:26,leftMargin:26,phetioReadOnly:!0,phetioDynamicElement:!0,tandem:L.Z.REQUIRED},n),o=phet.brand.Brand;let a=[];const h=new v.JxC(e,{font:new ht(32),maxWidth:550,tagName:"h1"});a.push(h);const l=new ge.ZP([un.Z.versionPatternStringProperty],e=>Oe.Z.format(e,t));a.push(new v.JxC(l,{font:new ht(16),maxWidth:550,tagName:"p"})),phet.chipper.buildTimestamp&&a.push(new v.JxC(phet.chipper.buildTimestamp,{font:new ht(10.4),maxWidth:550,tagName:"p",innerContent:phet.chipper.buildTimestamp}));let d=null,c=null,u=null;if(gc.areUpdatesChecked){const e={left:0,top:0},t=Vc.createCheckingNode(e),i=Vc.createUpToDateNode(e),s=Vc.createOutOfDateAboutNode(e),n=Vc.createOfflineNode(e);d=t.stepListener,c=e=>{t.visible=e===lc.CHECKING,i.visible=e===lc.UP_TO_DATE,s.visible=e===lc.OUT_OF_DATE,n.visible=e===lc.OFFLINE,t.pdomVisible=t.visible,i.pdomVisible=i.visible,s.pdomVisible=s.visible,n.pdomVisible=n.visible},u=new v.NBX({children:[t,i,s,n],maxWidth:550,visibleProperty:v.U2N}),a.push(u)}const p=[];if(o.name&&p.push(new v.yhY(o.name,{font:new ht(16),supScale:.5,supYOffset:3,maxWidth:550,tagName:"h2",innerContent:o.name})),o.copyright){const e=phet.chipper.buildTimestamp?phet.chipper.buildTimestamp.split("-")[0]:(new Date).getFullYear(),t=Oe.Z.fillIn(o.copyright,{year:e});p.push(new v.JxC(t,{font:new ht(12),maxWidth:550,tagName:"p",innerContent:t}))}let m=null;o.additionalLicenseStatement&&(m=new v.yhY(o.additionalLicenseStatement,{font:new ht(10.4),fill:"gray",align:"left",maxWidth:550,tagName:"p",innerContent:o.additionalLicenseStatement}),p.push(m)),p.length>0&&(a.push(new v.mE$(15)),a=a.concat(p));let g=null;"phet"!==o.id&&"phet-io"!==o.id||(a.push(new v.mE$(15)),g=new rc(i,{titleFont:new ht({size:16,weight:"bold"}),textFont:new ht(12),maxWidth:550}),a.push(g));const y=[],f=o.getLinks(hc.name,s);if(f&&f.length>0){y.push(new v.mE$(15));for(let t=0;tt?`${i}`:`${i}: ${e.url}`);y.push(new v.Hof(i,{links:{url:e.url},font:new ht(16),tandem:r.tandem.createTandem(e.tandemName),phetioReadOnly:!0}))}const e=new v.SHm({spacing:6,align:"left",children:y,maxWidth:550});a.push(e)}super(new v.SHm({align:"left",spacing:6,children:a,tagName:"div"}),r),this.updateStepListener=d,this.updateVisibilityListener=c,this.addAriaLabelledbyAssociation({thisElementName:v.Grz.PRIMARY_SIBLING,otherElementName:v.Grz.PRIMARY_SIBLING,otherNode:h}),this.disposeAboutDialog=()=>{g&&g.dispose(),m&&m.dispose(),y.forEach(e=>e.dispose&&e.dispose())}}show(){gc.areUpdatesChecked&&!this.isShowingProperty.value&&(gc.resetTimeout(),gc.stateProperty.value!==lc.OFFLINE&&gc.stateProperty.value!==lc.UNCHECKED||gc.check(),this.updateStepListener&&De.Z.addListener(this.updateStepListener),this.updateVisibilityListener&&gc.stateProperty.link(this.updateVisibilityListener)),super.show()}hide(){this.isShowingProperty.value&&(super.hide(),gc.areUpdatesChecked&&(this.updateVisibilityListener&&gc.stateProperty.unlink(this.updateVisibilityListener),this.updateStepListener&&De.Z.removeListener(this.updateStepListener)))}dispose(){this.disposeAboutDialog(),super.dispose()}}T.Z.register("AboutDialog",vc);class wc{static generateScreenshotAtIncreasedResolution(e,t){const i=document.createElement("canvas"),s=i.getContext("2d"),n=v.cQK.backingScale(s)*t;i.width=e.display.width*n,i.height=e.display.height*n,s.scale(n,n),s.fillStyle=e.display.domElement.style.backgroundColor,s.fillRect(0,0,i.width,i.height);const r=new v.LdF(i,s);return e.rootNode.renderToCanvasSubtree(r,Gt.Z.scaling(n)),i}static renderAtScale(e,t){const i=document.createElement("canvas"),s=i.getContext("2d");return i.width=e.width*t,i.height=e.height*t,s.scale(t,t),s.drawImage(e,0,0),i}static generateScreenshot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png";const i=wc.generateScreenshotAtIncreasedResolution(e,2);return wc.renderAtScale(i,.5).toDataURL(t)}}T.Z.register("ScreenshotGenerator",wc);const Sc=wc;class Tc extends oo{constructor(e){const t={centerX:0,centerY:0,big:!0},i=Vc.createCheckingNode(t),s=Vc.createUpToDateNode(t),n=new v.NBX({tagName:"div"}),r=Vc.createOfflineNode(t);super(new v.NBX({children:[i,s,n,r],tagName:"div"}),e);const o=()=>{const e=gc.latestVersion?gc.latestVersion.toString():"x.x.xx",i=gc.ourVersion.toString();n.children=[Vc.createOutOfDateDialogNode(this,i,e,t)]};o(),this.updateStepListener=i.stepListener,this.updateVisibilityListener=e=>{e===lc.OUT_OF_DATE&&o(),i.visible=e===lc.CHECKING,s.visible=e===lc.UP_TO_DATE,n.visible=e===lc.OUT_OF_DATE,r.visible=e===lc.OFFLINE,i.pdomVisible=i.visible,s.pdomVisible=s.visible,n.pdomVisible=n.visible,r.pdomVisible=r.visible}}show(){gc.areUpdatesChecked&&!this.isShowingProperty.value&&(gc.resetTimeout(),gc.stateProperty.value!==lc.OFFLINE&&gc.stateProperty.value!==lc.UNCHECKED||gc.check(),De.Z.addListener(this.updateStepListener),gc.stateProperty.link(this.updateVisibilityListener)),super.show()}hide(){this.isShowingProperty.value&&(super.hide(),gc.areUpdatesChecked&&(gc.stateProperty.unlink(this.updateVisibilityListener),De.Z.removeListener(this.updateStepListener)))}}T.Z.register("UpdateDialog",Tc);class Ec extends v.NBX{constructor(e,t){const i="phet"===phet.chipper.brand,s=phet.chipper.isApp,n=(0,ae.ZP)()({showPopup:eo("phet.joist.sim.showPopup"),hidePopup:eo("phet.joist.sim.hidePopup"),phetioType:Ec.PhetMenuIO,phetioState:!1,phetioDocumentation:"This menu is displayed when the PhET button is pressed.",visiblePropertyOptions:{phetioReadOnly:!0},tagName:"ul",ariaRole:"menu"},t);super(),_defineProperty(this,"isShowing",!1),this.focusOnHideNode=null,this.showPopup=n.showPopup,this.hidePopup=n.hidePopup;const r=new yo(t=>new vc(e.simNameProperty,e.version,e.credits,e.locale,{tandem:t,focusOnHideNode:this.focusOnHideNode}),[],{tandem:n.tandem.createTandem("aboutDialogCapsule"),phetioType:yo.PhetioCapsuleIO(oo.DialogIO)}),o=()=>this.restoreFocus();let a=null;const h=[{textStringProperty:un.Z.menuItem.phetWebsiteStringProperty,present:i,shouldBeHiddenWhenLinksAreNotAllowed:!0,callback:()=>{phet.chipper.isFuzzEnabled()||(0,v.MwI)("https://phet.colorado.edu/"+e.locale)},options:{handleFocusCallback:o}},{textStringProperty:un.Z.menuItem.reportAProblemStringProperty,present:i&&!s,shouldBeHiddenWhenLinksAreNotAllowed:!0,callback:()=>{if(!phet.chipper.isFuzzEnabled()){const t=`https://phet.colorado.edu/files/troubleshooting/?sim=${encodeURIComponent(e.simNameProperty.value)}&version=${encodeURIComponent(`${e.version} ${phet.chipper.buildTimestamp?phet.chipper.buildTimestamp:"(unbuilt)"}`)}&url=${encodeURIComponent(window.location.href)}&dependencies=${encodeURIComponent(JSON.stringify({}))}`;(0,v.MwI)(t)}},options:{handleFocusCallback:o}},{textStringProperty:new O.Z("QR code"),present:phet.chipper.queryParameters.qrCode,shouldBeHiddenWhenLinksAreNotAllowed:!0,callback:()=>{phet.chipper.isFuzzEnabled()||(0,v.MwI)(`http://api.qrserver.com/v1/create-qr-code/?data=${encodeURIComponent(window.location.href)}&size=220x220&margin=0`)},options:{handleFocusCallback:o}},{textStringProperty:un.Z.menuItem.getUpdateStringProperty,present:gc.areUpdatesChecked,shouldBeHiddenWhenLinksAreNotAllowed:!0,callback:()=>{a||(a=new Tc({focusOnHideNode:this.focusOnHideNode})),a.show()},options:{textFill:new ge.ZP([gc.stateProperty],e=>e===lc.OUT_OF_DATE?"#0a0":"#000")}},{textStringProperty:un.Z.menuItem.screenshotStringProperty,present:!s,shouldBeHiddenWhenLinksAreNotAllowed:!1,callback:()=>{const t=Sc.generateScreenshot(e);if(window.Blob&&new window.Blob){const i="data:image/png;base64,",s=t.slice(i.length),n=window.atob(s),r=new window.Uint8Array(n.length);for(let e=0;e{phet.chipper.isFuzzEnabled()||v.ITT.toggleFullScreen(e.display)},options:{checkedProperty:v.ITT.isFullScreenProperty,tandem:n.tandem.createTandem("fullScreenMenuItem"),phetioDocumentation:"This menu item requests full-screen access for the simulation display.",visiblePropertyOptions:{phetioFeatured:!0},handleFocusCallback:o}},{textStringProperty:un.Z.menuItem.aboutStringProperty,present:!0,shouldBeHiddenWhenLinksAreNotAllowed:!1,callback:()=>r.getElement().show(),options:{separatorBefore:i,tandem:n.tandem.createTandem("aboutMenuItem"),phetioDocumentation:"This menu item shows a dialog with information about the simulation.",visiblePropertyOptions:{phetioFeatured:!0}}}].filter(e=>e.present||e.options&&e.options.tandem).map(e=>new nc(n.closeCallback,e.textStringProperty,e.callback,e.present,e.shouldBeHiddenWhenLinksAreNotAllowed,e.options)).filter(e=>e.present);this.items=h;const l=new v.SHm({stretch:!0,spacing:2,children:_.flatten(h.map(e=>e.separatorBefore?[new v.qYj({stroke:"gray"}),e]:[e]))}),d=new v.y$t(null,{fill:"white",stroke:"black"});l.localBoundsProperty.link(()=>{l.left=5,l.top=5}),l.boundsProperty.link(e=>{d.shape=_c(e.width+10,e.height+10)}),this.addChild(d),this.addChild(l);const c={keydown:e=>{const t=e.domEvent,i=this.items[0],s=this.items[this.items.length-1],r=v.ntP.getEventCode(t);if(v.ntP.isArrowKey(t)&&t.preventDefault(),r===v.ntP.KEY_DOWN_ARROW){(s.focused?i:v.eDZ.getNextFocusable()).focus()}else if(r===v.ntP.KEY_UP_ARROW){(i.focused?s:v.eDZ.getPreviousFocusable()).focus()}else r!==v.ntP.KEY_ESCAPE&&r!==v.ntP.KEY_TAB||(n.closeCallback(),this.restoreFocus());e.pointer.reserveForKeyboardDrag()}};this.addInputListener(c);const u=e=>{e&&!_.includes(e.trail.nodes,this)&&this.hide()};v.IKS.pdomFocusProperty.lazyLink(u),this.mutate(n),this.disposePhetMenu=()=>{this.removeInputListener(c),v.IKS.pdomFocusProperty.unlink(u)}}show(){this.isShowing||(v.IKS.pdomFocus=null,this.showPopup(this,!0),this.isShowing=!0)}hide(){this.isShowing&&(this.isShowing=!1,this.hidePopup(this,!0))}dispose(){this.disposePhetMenu(),_.each(this.items,e=>e.dispose()),super.dispose()}setFocusOnHideNode(e){this.focusOnHideNode=e}restoreFocus(){const e=this.focusOnHideNode||v.IKS.pdomFocusedNode;e&&e.focus()}}y=Ec,_defineProperty(Ec,"PhetMenuIO",new Te.Z("PhetMenuIO",{valueType:y,documentation:"The PhET Menu in the bottom right of the screen"}));const _c=(e,t)=>{const i=(new Qe.bn).moveTo(e-20,t).lineToRelative(0,20).lineToRelative(-20,-20).close();return Qe.bn.roundRect(0,0,e,t,8,8).shapeUnion(i)};T.Z.register("PhetMenu",Ec);const xc=Ec;class Cc extends To{constructor(e,t,i){const s=phet.brand.Brand,n=s.logoOnBlackBackground,r=s.logoOnWhiteBackground,o=new xc(e,{closeCallback:()=>o.hide(),tandem:i.createTandem("phetMenu")});he.Z.multilink([e.boundsProperty,e.screenBoundsProperty,e.scaleProperty,o.localBoundsProperty],(e,t,i)=>{if(e&&t&&i){o.setScaleMagnitude(i),o.right=e.right-2;const s=e.height-t.height;o.bottom=t.bottom+s/2}});const a=new v.Eep(n,{scale:.28/n.height*108*.85,pickable:!1}),h=new $d({scale:.83,left:a.width+8,bottom:a.bottom-.5,pickable:!1}),l=[a,h];super(new v.NBX({children:l}),t,{highlightExtensionWidth:6,highlightExtensionHeight:5,highlightCenterOffsetY:4,listener:()=>{o.show(),o.items[0].focus(),Mi.play()},tandem:i,phetioType:Cc.PhetButtonIO,phetioDocumentation:"The button that appears at the right side of the navigation bar, which shows a menu when pressed",enabledPropertyOptions:{phetioFeatured:!0},visiblePropertyOptions:{phetioReadOnly:!0},innerContent:un.Z.a11y.phetMenuStringProperty,voicingNameResponse:un.Z.a11y.phetMenuStringProperty}),o.setFocusOnHideNode(this),he.Z.multilink([t,e.selectedScreenProperty,gc.stateProperty],(t,i,s)=>{const o=i===e.homeScreen,l=!t.equals(v.Ilk.BLACK)&&!o,d=s===lc.OUT_OF_DATE;h.fill=l?d?"#0a0":"#222":d?"#3F3":"white",a.image=l?r:n}),this.buttonModel.enabledProperty.link(e=>{h.visible=e}),v.uai.mutateNode(this,!0)}}f=Cc,_defineProperty(Cc,"PhetButtonIO",new Te.Z("PhetButtonIO",{valueType:f,documentation:"The PhET Button in the bottom right of the screen"})),T.Z.register("PhetButton",Cc);const Ic=Cc,Dc=new ke.Z(mr.LAYOUT_BOUNDS.width,40);class Lc extends v.NBX{constructor(e,t){super(),_defineProperty(this,"homeButton",null),this.navigationBarFillProperty=new ge.ZP([e.selectedScreenProperty,e.lookAndFeel.navigationBarFillProperty],(t,i)=>t===e.homeScreen?Ar.BACKGROUND_COLOR:i),this.background=new v.AeJ(0,0,Dc.width,Dc.height,{pickable:!0,fill:this.navigationBarFillProperty}),this.addChild(this.background),this.barContents=new v.NBX,this.addChild(this.barContents);const i=new v.xvT(e.displayedSimNameProperty,{font:new ht(16),fill:e.lookAndFeel.navigationBarTextFillProperty,tandem:t.createTandem("titleText"),phetioDocumentation:"Displays the title of the simulation in the navigation bar (bottom left)",visiblePropertyOptions:{phetioFeatured:!0},stringPropertyOptions:{phetioReadOnly:!0}}),s=new v.NBX({children:[i],visibleProperty:new ge.ZP([e.selectedScreenProperty],t=>t!==e.homeScreen)});this.barContents.addChild(s);const n=new Ic(e,this.navigationBarFillProperty,t.createTandem("phetButton"));let r;this.barContents.addChild(n),this.a11yButtonsHBox=new Gd(e,this.navigationBarFillProperty,{tandem:t}),this.barContents.addChild(this.a11yButtonsHBox),this.localeNode&&this.barContents.addChild(this.localeNode),this.addAriaLabelledbyAssociation({thisElementName:v.Grz.PRIMARY_SIBLING,otherNode:this,otherElementName:v.Grz.LABEL_SIBLING});const o=this.a11yButtonsHBox.bounds.isValid()?this.a11yButtonsHBox.width:0;if(1===e.simScreens.length)i.maxWidth=mr.LAYOUT_BOUNDS.width-10-25-6-o-(this.localeNode?this.localeNode.width:0)-6-n.width-10;else{const s=Math.min(i.width,.2*mr.LAYOUT_BOUNDS.width),a=new S.Z(!0,{tandem:L.Z.GENERAL_MODEL.createTandem("screens").createTandem("isUserNavigableProperty"),phetioFeatured:!0,phetioDocumentation:"If the screens are user navigable, icons are displayed in the navigation bar and the user can switch between screens."});r=new v.NBX({tagName:"ol",containerTagName:"nav",labelTagName:"h2",labelContent:un.Z.a11y.simScreensStringProperty,visibleProperty:new ge.ZP([e.activeSimScreensProperty,e.selectedScreenProperty,a],(t,i,s)=>i!==e.homeScreen&&t.length>1&&s)}),r.ariaLabelledbyAssociations=[{thisElementName:v.Grz.CONTAINER_PARENT,otherElementName:v.Grz.LABEL_SIBLING,otherNode:r}],this.barContents.addChild(r),this.homeButton=new Xd(Dc.height,e.lookAndFeel.navigationBarFillProperty,e.homeScreen?e.homeScreen.pdomDisplayNameProperty:new Js.Z("NO HOME SCREEN"),{listener:()=>{e.selectedScreenProperty.value=e.homeScreen,this.homeButton.isPDOMClicking()&&e.homeScreen.view.focusHighlightedScreenButton()},tandem:t.createTandem("homeButton"),centerY:Dc.height/2}),e.homeScreen&&r.addChild(this.homeButton);const h=mr.LAYOUT_BOUNDS.width/2-10-s-25-5-this.homeButton.width-5,l=mr.LAYOUT_BOUNDS.width/2-6-o-(this.localeNode?this.localeNode.width:0)-6-n.width-10,d=2*Math.min(h,l),c=(d-0*(e.simScreens.length-1))/e.simScreens.length,u=e.simScreens.map(i=>new Qd(e.lookAndFeel.navigationBarFillProperty,e.selectedScreenProperty,i,e.simScreens.indexOf(i),Dc.height,{maxButtonWidth:c,tandem:t.createTandem(i.tandem.name+"Button")})),p=[this.homeButton,...u],m=Math.max(60,_.maxBy(u,e=>e.width).width),g=_.maxBy(u,e=>e.height).height,y=new Map;u.forEach(e=>{y.set(e.screen,new v.DbO(e,{excludeInvisibleChildrenFromBounds:!0,alignBounds:new Le.Z(0,0,m,g),visibleProperty:e.visibleProperty}))});const f=new v.BET({spacing:0,maxWidth:d});r.addChild(f),e.activeSimScreensProperty.link(e=>{f.children=e.map(e=>y.get(e))}),v.bGt.create(this,[this.background,f],(e,t)=>{t.center=e.center}),v.$1I.create(this.barContents,[this.homeButton,...u],(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;se&&e.visible);e&&n.length>0&&(e.right=Math.min(...n.map(e=>e.left))-5)})),v.bGt.create(this.barContents,[this.homeButton,i],(e,t)=>{t.maxWidth=e.left-10-25}),e.simNameProperty.link(e=>{p.forEach(t=>{t.voicingContextResponse=e})})}i.left=10,i.centerY=Dc.height/2,n.centerY=Dc.height/2,v.bGt.create(this,[this.background,n],(e,t)=>{t.right=e.right-10}),v.bGt.create(this.barContents,[n,this.a11yButtonsHBox],(e,t)=>{t.right=e.left-6,t.centerY=e.centerY}),this.localeNode&&v.bGt.create(this.barContents,[n,this.a11yButtonsHBox,this.localeNode],(e,t,i)=>{t.right=e.left-6,t.centerY=e.centerY,i.centerY=e.centerY,i.right=Math.min(t.left,e.left)-6}),this.layout(1,Dc.width,Dc.height);const a=new v.NBX({tagName:"div",containerTagName:"section",labelTagName:"h2",labelContent:un.Z.a11y.simResourcesStringProperty,pdomOrder:[this.a11yButtonsHBox,n].filter(e=>void 0!==e)});a.ariaLabelledbyAssociations=[{thisElementName:v.Grz.CONTAINER_PARENT,otherElementName:v.Grz.LABEL_SIBLING,otherNode:a}],this.addChild(a)}layout(e,t,i){this.background.rectWidth=t,this.background.rectHeight=i,this.barContents.setScaleMagnitude(e)}}_defineProperty(Lc,"NAVIGATION_BAR_SIZE",Dc),T.Z.register("NavigationBar",Lc);const kc=Lc;class Mc{constructor(){_defineProperty(this,"allTimes",[]),_defineProperty(this,"histogram",[]),_defineProperty(this,"longTimes",[]),_defineProperty(this,"frameStartTime",0),_defineProperty(this,"previousFrameStartTime",0);for(let e=0;e<30;e++)this.histogram.push(0);$("body").append('')}static start(e){const t=new Mc;e.frameStartedEmitter.addListener(()=>t.frameStarted()),e.frameEndedEmitter.addListener(()=>t.frameEnded())}frameStarted(){this.frameStartTime=Date.now()}frameEnded(){if(this.allTimes.length>0&&this.allTimes.length%60==0){let e=0;for(let i=0;i0&&(this.longTimes.sort((e,t)=>t-e),t=t+" — "+this.longTimes),$("#phetProfiler").html(t);for(let i=0;i<30;i++)this.histogram[i]=0;this.longTimes.length=0,this.allTimes.length=0}if(this.previousFrameStartTime){const e=this.frameStartTime-this.previousFrameStartTime;this.allTimes.push(e),e<30?this.histogram[e]++:this.longTimes.push(e)}this.previousFrameStartTime=this.frameStartTime}}T.Z.register("Profiler",Mc);const Oc=Mc,Nc=new Image,Rc=k.Z.createLock(Nc);Nc.onload=Rc,Nc.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH0AAAEUCAYAAAAGDDkDAAAACXBIWXMAABcSAAAXEgFnn9JSAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAALgRJREFUeNrsfQuUFdWV9qFpaASFC/KK0PZFkTCo0MYXJFEvOiqZSaQzSsZJjL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JUDms1j/yV5wge9ScxTCKZHVz8Wmv0oZOZoShVZuPNJhTQz4CRtgr2G3MSAe3P8HO9jLlRa3ir4lLcJhQQPVE/5OzZv7LSODaUR4SDULqJ9HdHT79q1E7zCLS7xAhyBvu4ySNHabLmNJpdVvMCAvUNqPH8XnnOaNFdi6TZiUWqz72zuxYuYzvEAHBri3xLy8mphpPRjzIj+azjV+GdEROWDQXi8akjF49gN7VioBu/f9fUq4pErdCk+cikspGsAs33d37SDAKdppCwI6j/MW8MQDgMfImsASCIgv8WMOlR0J2O6SUlTfXMhMorDCnq2j16jIkq8hKAR4UGlWtr7Hx3FIXUw6wdU33R+i+2coUo+h6a73F6+1nFXf88yUqT33pc+1v/dVN/YIoulOtJRRf6+yeak7VJjVluBYlNYvUwNAMihCZJmtHJijeGi1WVtwVNK8bUZPt9rBRHwKFGod12yDxqU248BjB+1flrBq9YD/VAETuk6Ff4FnHfsl97ZiBgBJNjGfiQSW/xVgAMkWcFCGKJWfAAAAAElFTkSuQmCC";const Bc=Nc;class Zc extends oo{constructor(e,t){const i=(0,ae.ZP)()({topMargin:20,bottomMargin:20,tandem:L.Z.OPTIONAL,phetioType:Zc.OopsDialogIO},t),s=new v.Hof(e,(0,ae.ZP)()({font:new ht(20),maxWidth:600,maxHeight:400,tandem:i.tandem.createTandem("text")},i.richTextOptions)),n=i.iconNode||new v.Eep(Bc,{maxHeight:132});super(new v.BET({spacing:20,children:[s,n]}),i),this.disposeOopsDialog=()=>{s.dispose()}}dispose(){this.disposeOopsDialog(),super.dispose()}}A=Zc,_defineProperty(Zc,"OopsDialogIO",new Te.Z("OopsDialogIO",{valueType:A,supertype:oo.DialogIO})),Be.register("OopsDialog",Zc);class qc extends Zc{constructor(e,t){const i=(0,ae.ZP)()({richTextOptions:{font:new ht(16)},title:new v.xvT(un.Z.queryParametersWarningDialog.invalidQueryParametersStringProperty,{font:new ht(28)})},t);let s=un.Z.queryParametersWarningDialog.oneOrMoreQueryParametersStringProperty.value+"

";e.forEach(e=>{s+=`${e.key}=${e.value}
`}),s+="
"+un.Z.queryParametersWarningDialog.theSimulationWillStartStringProperty.value,super(s,i)}}T.Z.register("QueryParametersWarningDialog",qc);const Fc=qc,Hc="data:audio/mpeg;base64,//swxAAABEw23pTEgDl2DiczO0AALSjcthgsLBXEsG4NyeLwnEsG4NxHJ4jn92FwTAGBsnpBgAAAAQBAGQ6EAAAABvIDAOYYEoLAkYzitYnDKoTjfBJjYPrz3Sv6fQ6UpkyHJrgVpj+gGB6coHn6gERAB7vA5psDBhQMKBA3sQG0Rm/DBYuAnGAXNAOCgBBwyn0PJlRAC4AA6amr//syxAOBCFRXRN3MADEPCqaOuYAGMoWIgCYUIZpi6HoVgZtMRkolmKgeKgQwyHBkBl0Xihp41hlrBVweOQOE80Zsc1/2s4rayxxw+M3LVZd4KAsACb4OBCv0bBGCzHAuNt9Y3KPjAQ7EhkPBUGgwtMYFBTL4El8Zi2KyRLLT3mp7Ou/rGzytf/fOY0vcTN///W7/8jVnVDB3ZVeYiP/7MsQEAAikW3XZjAAQ/Yrmz7rwBpkAAAAACOlUi2kT+JSpXpJpfA7TYbxAgOINiEti4FzsveeNP0nIjahW7k4JOfl1Uk3d/WH+4NBFJBR0le2SxAAA4SYi0lNm/FADABRm0lUGUZYGHQQmGQPoippMPf2H2cs5nQ5bU4ZoBEXpXRq11hyxeJb/2fRqvBsfiv6lAAIBCMUfIOILiVr/+zLEBYIICEcoTPRlsQcI5V2PbIZ78mSCXnxannEwaGJxDGH5SAUG0yAKAy2E1JqRU2TLHBVnIhJg62sJnBcEywiU9P//////+gJJbsYCtxb9oqmAdMG+MA0U8xSlAT74UzNHM3OQMULGqwlVfctlEvYlHHwUVuZ38cv5n+pGtCdPb3d/tp/kf7Ef6QA7qAC0w2k0+dMZo8wSUF4z//swxAiDCBg7Hmz7ZFEUCeVJnuCWkI+DKxCcMAsL86TrM7BjBAEsCq6xGINrTtgedABQPWCkKF0VHfq3iyk/29/d+j+kTzAVXVOsI2cAHHemY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qr/+zLEvAPAHAIAAQAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq//syxLuDwAABpAAAACAAADSAAAAEqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg==",zc=M(F,Hc),Yc=k.Z.createLock(Hc),Gc=new Z;let Wc=!1;const Uc=()=>{Wc||(Yc(),Wc=!0)},Xc=F.decodeAudioData(zc.buffer,e=>{null===Gc.audioBufferProperty.value&&(Gc.audioBufferProperty.set(e),Uc())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),Gc.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),Uc()});Xc&&Xc.then(e=>{null===Gc.audioBufferProperty.value&&(Gc.audioBufferProperty.set(e),Uc())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),Uc()});const Kc=Gc;class jc extends Nt{constructor(e,t,i){super(Kc,i),e.lazyLink(e=>{e!==t&&this.play()})}}T.Z.register("ScreenSelectionSoundGenerator",jc);const Qc=jc;function Jc(e,t,i,s,n,r,o,a,h){if(1===e.length&&i&&t){const e="cannot specify homeScreen=true for single-screen sims";QueryStringMachine.addWarning("homeScreen",t,e)}let l=[];if(o&&r)for(let p=0;p

=0&&i1&&t&&(u=h(l),d.unshift(u)),c=u&&0===s?u:0===s?l[0]:e[s-1],!d.includes(c))throw new Error("screen not found: "+s);return{homeScreen:u,initialScreen:c,selectedSimScreens:l,screens:d,allScreensCreated:_.isEqual(new Set(e),new Set(l))&&(!(e.length>1)||!!u)}}T.Z.register("selectScreens",Jc);class $c{constructor(){_defineProperty(this,"stringFactor",1),_defineProperty(this,"stride",0)}handleEvent(e){"ArrowLeft"===e.code?this.halveStrings():"ArrowRight"===e.code?this.doubleStrings():"ArrowUp"===e.code?this.setStride(this.stride+1):"ArrowDown"===e.code?this.setStride(this.stride-1):"Space"===e.code&&this.reset()}doubleStrings(){this.setStringFactor(Math.min(2*this.stringFactor,8))}halveStrings(){this.setStringFactor(Math.max(.5*this.stringFactor,.01))}setStringFactor(e){this.stringFactor=e,console.log("stringFactor = "+this.stringFactor),function(e){lt.j.forEach(t=>{if(t.restoreInitialValue("en"),1!==e){const i=t.property.value.replace(/[\u202A\u202B\u202C]/g,"");t.property.value=function(e,t){if(e>1)return function(e,t){let i=e;for(;t>1;)i+=e,t-=1;return i}(t,e);{const i=t.match(/{{(.+?)}}/g)||[],s=t.replace(/{{(.+?)}}/g,""),n=I.Z.toFixedNumber(s.length*e+1,0);return s.substring(0,n)+i.join("")}}(e,i)}})}(this.stringFactor)}setStride(e){const t=$c.WORDS;e>t.length-1?e=0:e<0&&(e=t.length-1),this.stride=e,console.log("stride = "+this.stride),lt.j.forEach((e,i)=>{e.property.value=t[(i+this.stride)%t.length]})}reset(){this.setStride(0),this.setStringFactor(1)}}_defineProperty($c,"WORDS","Sometimes when Hippopotomonstrosesquippedaliophobia want lyrics you turn to Shakespeare like the following text copied from some work To be or not to be that is the question Supercalifragilisticexpeladocious tis nobler in the mind to suffer The slings and arrows of antidisestablishmentarianism fortune Or to take Incomprehensibility against a sea of Floccinaucinihilipilification".split(" ")),T.Z.register("DynamicStringTest",$c);class eu{constructor(e,t){_defineProperty(this,"initialPointerPoint",null),_defineProperty(this,"relativePointerDistance",0),this.display=e;const i={move:this.handleMove.bind(this)},s=()=>{this.display.focusManager.pdomFocusHighlightsVisibleProperty.value=!0},n={};if(["click","input","change","keydown","keyup"].forEach(e=>{n[e]=s}),this.display.addInputListener(n),v.MMl.keyupEmitter.addListener(e=>{v.ntP.isKeyEvent(e,v.ntP.KEY_TAB)&&s()}),t.visualModel.supportsInteractiveHighlights){t.visualModel.interactiveHighlightsEnabledProperty.link(e=>{this.display.focusManager.interactiveHighlightsVisibleProperty.value=e});const e=t.visualModel.interactiveHighlightsEnabledProperty,s=this.display.focusManager.pdomFocusHighlightsVisibleProperty;he.Z.multilink([e,s],(e,t)=>{e&&t?(this.display.addInputListener(i),this.initialPointerPoint=null,this.relativePointerDistance=0):this.display.hasInputListener(i)&&this.display.removeInputListener(i)})}this.display.addInputListener({down:e=>{this.display.bounds.containsPoint(e.pointer.point)&&(this.display.focusManager.pdomFocusHighlightsVisibleProperty.value=!1,v.IKS.pdomFocusedNode&&(e.trail.nodes.includes(v.IKS.pdomFocusedNode)||(v.IKS.pdomFocus=null)))}})}handleMove(e){null===this.initialPointerPoint?this.initialPointerPoint=e.pointer.point:(this.relativePointerDistance=e.pointer.point.distance(this.initialPointerPoint),this.relativePointerDistance>100&&(this.display.focusManager.pdomFocusHighlightsVisibleProperty.value=!1,this.display.focusManager.interactiveHighlightsVisibleProperty.value=!0))}}T.Z.register("HighlightVisibilityController",eu);const tu=eu;class iu extends v.sSl{constructor(e){const t=(0,ae.ZP)()({rootRenderer:"svg",webgl:iu.DEFAULT_WEBGL,allowBackingScaleAntialiasing:!0,allowSceneOverflow:!1,allowWebGL:phet.chipper.queryParameters.webgl,assumeFullWindow:!0,accessibility:phet.chipper.queryParameters.supportsInteractiveDescription,tandem:L.Z.REQUIRED},e);t.supportsInteractiveHighlights=t.preferencesModel.visualModel.supportsInteractiveHighlights,t.rootRenderer=phet.chipper.queryParameters.rootRenderer||t.rootRenderer,QueryStringMachine.containsKey("webgl")&&(t.webgl=phet.chipper.queryParameters.webgl),v.cQK.setWebGLEnabled(t.webgl),phet.chipper.isFuzzEnabled()&&(window.open=function(){return{focus:_.noop,blur:_.noop}}),$("body").css("padding","0").css("margin","0").css("overflow","hidden"),document.getElementById("sim")&&document.getElementById("sim").parentNode===document.body&&document.body.removeChild(document.getElementById("sim")),document.onselectstart=function(){return!1},super(new v.NBX({renderer:t.rootRenderer}),t),_defineProperty(this,"simulationRoot",new v.NBX),this.simulationRoot=new v.NBX,this.rootNode.addChild(this.simulationRoot);const i=phet.chipper.queryParameters.randomSeed*Math.PI;if(this.inputFuzzer=new v.$AB(this,i),this.keyboardFuzzer=new v.eXg(this,i),this.supportsPanAndZoomProperty=new S.Z(phet.chipper.queryParameters.supportsPanAndZoom,{tandem:t.tandem.createTandem("supportsPanAndZoomProperty"),phetioFeatured:!0}),this.domElement.id="sim",phet.chipper.queryParameters.supportsInteractiveDescription&&(this.pdomRootElement.lang="en"),this.highlightVisibilityController=new tu(this,t.preferencesModel),phet.chipper.queryParameters.sceneryLog&&v.QF$.enableLogging(phet.chipper.queryParameters.sceneryLog),phet.chipper.queryParameters.sceneryStringLog&&v.QF$.switchLogToString(),"dynamic"===phet.chipper.queryParameters.stringTest){const e=new $c;window.addEventListener("keydown",t=>e.handleEvent(t))}this.initializeEvents({tandem:L.Z.GENERAL_CONTROLLER.createTandem("input")}),window.phet.joist.rootNode=this.rootNode,window.phet.joist.display=this,this.setPointerDisplayVisible(phet.chipper.queryParameters.showPointers),this.setPointerAreaDisplayVisible(phet.chipper.queryParameters.showPointerAreas),this.setHitAreaDisplayVisible(phet.chipper.queryParameters.showHitAreas),this.setCanvasNodeBoundsVisible(phet.chipper.queryParameters.showCanvasNodeBounds),this.setFittedBlockBoundsVisible(phet.chipper.queryParameters.showFittedBlockBounds),v.Yj2.initialize(this.simulationRoot,{tandem:L.Z.GENERAL_VIEW.createTandem("panZoomListener")});const s=v.Yj2.listener;this.supportsPanAndZoomProperty.link(e=>{e?this.addInputListener(s):this.hasInputListener(s)&&this.removeInputListener(s)}),window.addEventListener("pageshow",e=>{e.persisted&&window.location.reload()})}fuzzInputEvents(){const e=phet.chipper.queryParameters.fuzzTouch||phet.chipper.queryParameters.fuzz,t=phet.chipper.queryParameters.fuzzMouse||phet.chipper.queryParameters.fuzz;(t||e)&&this.inputFuzzer.fuzzEvents(phet.chipper.queryParameters.fuzzRate,t,e,phet.chipper.queryParameters.fuzzPointers),phet.chipper.queryParameters.fuzzBoard&&document.hasFocus()&&this.keyboardFuzzer.fuzzBoardEvents(phet.chipper.queryParameters.fuzzRate)}step(e){this.supportsPanAndZoomProperty.value&&v.Yj2.listener.step(e)}}_defineProperty(iu,"DEFAULT_WEBGL",!1),T.Z.register("SimDisplay",iu);var su=i(0),nu=i(2306),ru=i(170);class ou extends D.Z{constructor(e){let t,i,s;super({tandem:L.Z.GENERAL_MODEL.createTandem("simInfo"),phetioType:ou.SimInfoIO,phetioReadOnly:!0,phetioDocumentation:"A collection of data about the runtime and simulation. Available in the simStarted PhET-iO data stream event, as well as on demand in the PhET-iO state."}),_defineProperty(this,"info",{}),this.putInfo("url",window.location.href),this.putInfo("randomSeed",window.phet.chipper.queryParameters.randomSeed),this.putInfo("userAgent",window.navigator.userAgent),this.putInfo("language",window.navigator.language),this.putInfo("window",`${window.innerWidth}x${window.innerHeight}`),this.putInfo("referrer",document.referrer),this.putInfo("checkIE11StencilSupport",v.cQK.checkIE11StencilSupport()),phet.chipper.queryParameters.webgl&&this.putInfo("isWebGLSupported",v.cQK.isWebGLSupported);const n=[];window.navigator.pointerEnabled&&n.push("pointerEnabled"),window.navigator.msPointerEnabled&&n.push("msPointerEnabled"),window.navigator.onLine||n.push("offline");try{t=document.createElement("canvas"),i=t.getContext("2d"),s=v.cQK.backingStorePixelRatio(i),this.putInfo("pixelRatio",`${window.devicePixelRatio||1}/${s}`),(window.devicePixelRatio||1)/s!=1&&n.push("pixelRatioScaling")}catch(r){}this.putInfo("flags",n.join(", ")),t=null,this.putInfo("simName",e.simNameProperty.value),this.putInfo("simVersion",e.version),this.putInfo("repoName",hc.name),this.putInfo("screens",e.screens.map(t=>{const i={name:t.nameProperty.value||e.simNameProperty.value};return L.Z.PHET_IO_ENABLED&&(i.phetioID=t.tandem.phetioID),i})),L.Z.PHET_IO_ENABLED&&(this.putInfo("screenPropertyValue",e.selectedScreenProperty.value.tandem.phetioID),this.putInfo("wrapperMetadata",phet.preloads.phetio.simStartedMetadata),this.putInfo("dataStreamVersion",phet.phetio.dataStream.VERSION),this.putInfo("phetioCommandProcessorProtocol",phet.phetio.phetioCommandProcessor.PHET_IO_PROTOCOL))}putInfo(e,t){void 0===t&&(t="{{undefined}}"),this.info[e]=t}}b=ou,_defineProperty(ou,"SimInfoIO",new Te.Z("SimInfoIO",{valueType:b,toStateObject:e=>({simName:e.info.simName,screens:e.info.screens,repoName:e.info.repoName,screenPropertyValue:e.info.screenPropertyValue,dataStreamVersion:e.info.dataStreamVersion,phetioCommandProcessorProtocol:e.info.phetioCommandProcessorProtocol,simVersion:L.Z.API_GENERATION?null:e.info.simVersion,wrapperMetadata:L.Z.API_GENERATION?null:e.info.wrapperMetadata,randomSeed:L.Z.API_GENERATION?null:e.info.randomSeed,url:L.Z.API_GENERATION?null:e.info.url,userAgent:L.Z.API_GENERATION?null:e.info.userAgent,window:L.Z.API_GENERATION?null:e.info.window,referrer:L.Z.API_GENERATION?null:e.info.referrer,language:L.Z.API_GENERATION?null:e.info.language,pixelRatio:L.Z.API_GENERATION?null:e.info.pixelRatio,isWebGLSupported:L.Z.API_GENERATION?null:e.info.isWebGLSupported,checkIE11StencilSupport:L.Z.API_GENERATION?null:e.info.checkIE11StencilSupport,flags:L.Z.API_GENERATION?null:e.info.flags||null}),stateSchema:{simName:it.Z,screens:(0,su.Z)(ru.Z),repoName:it.Z,screenPropertyValue:it.Z,wrapperMetadata:(0,nu.Z)(ru.Z),dataStreamVersion:it.Z,phetioCommandProcessorProtocol:it.Z,simVersion:(0,nu.Z)(it.Z),randomSeed:(0,nu.Z)(Fe.Z),url:(0,nu.Z)(it.Z),userAgent:(0,nu.Z)(it.Z),window:(0,nu.Z)(it.Z),referrer:(0,nu.Z)(it.Z),language:(0,nu.Z)(it.Z),pixelRatio:(0,nu.Z)(it.Z),isWebGLSupported:(0,nu.Z)(Ee.Z),checkIE11StencilSupport:(0,nu.Z)(Ee.Z),flags:(0,nu.Z)(it.Z)}})),T.Z.register("SimInfo",ou);const au=ou;class hu{constructor(e){this.sim=e,window.addEventListener("message",t=>{"pause"===t.data.messageName?(e.stepOneFrame(),e.activeProperty.value=!1):"resume"===t.data.messageName&&(e.activeProperty.value=!0)})}start(){this.sim.isConstructionCompleteProperty.link(e=>{e&&window.parent!==window&&window.parent.postMessage({message:"init"},"*")})}}T.Z.register("LegendsOfLearningSupport",hu);const lu=hu;class du extends Yi{constructor(e,t,i){const s=(0,ae.ZP)()({radius:i&&i.content?null:30,lineWidth:.5,stroke:null,touchAreaDilation:0,mouseAreaDilation:0,touchAreaXShift:0,touchAreaYShift:0,mouseAreaXShift:0,mouseAreaYShift:0,cursor:"pointer",xMargin:5,yMargin:5,buttonAppearanceStrategy:du.ThreeDAppearanceStrategy},i);s.content,s.radius&&(s.minUnstrokedWidth=2*s.radius,s.minUnstrokedHeight=2*s.radius),s.buttonAppearanceStrategyOptions||(s.buttonAppearanceStrategyOptions={stroke:s.stroke,lineWidth:s.lineWidth});const n=s.radius||Math.max(s.content.width+2*s.xMargin,s.content.height+2*s.yMargin)/2;if(s.content&&s.radius){const e=s.content,t=Math.min(2*(s.radius-s.xMargin)/e.width,2*(s.radius-s.yMargin)/e.height);s.content=new v.NBX({children:[e],scale:t})}const r=new v.Cdc(n);super(e,r,t,s);const o=r.localBounds.width/2;this.touchArea=Qe.bn.circle(s.touchAreaXShift,s.touchAreaYShift,o+s.touchAreaDilation),this.mouseArea=Qe.bn.circle(s.mouseAreaXShift,s.mouseAreaYShift,o+s.mouseAreaDilation),this.focusHighlight=Qe.bn.circle(0,0,o+5)}}du.ThreeDAppearanceStrategy=class{constructor(e,t,i,s){const n=s&&s.stroke?s.stroke:new v.M4p(i,{luminanceFactor:-.4}),r=s&&void 0!==s.lineWidth?s.lineWidth:.3,o=(0,ae.ZP)()({stroke:n,lineWidth:r,overStroke:n,overLineWidth:r,overButtonOpacity:1,selectedStroke:n,selectedLineWidth:r,selectedButtonOpacity:1,deselectedStroke:n,deselectedLineWidth:r,deselectedButtonOpacity:1,overFill:i},s),a=new v.M4p(i,{luminanceFactor:.8}),h=new v.M4p(i,{luminanceFactor:.7}),l=new v.M4p(i,{luminanceFactor:.3}),d=new v.M4p(i,{luminanceFactor:-.1}),c=new v.M4p(i,{luminanceFactor:-.2}),u=new v.M4p(i,{luminanceFactor:-.4}),p=new v.M4p(i,{luminanceFactor:-.5}),m=new ge.ZP([i],e=>e.withAlpha(0)),g=e.width/2,y=g-2.5,f=g+2.5,A=new v.XMe(2.5,2.5,y,2.5,2.5,f).addColorStop(0,i).addColorStop(1,h),b=new v.XMe(-2.5,-2.5,y,-2.5,-2.5,f).addColorStop(0,m).addColorStop(1,p),P=new v.XMe(2.5,2.5,y,2.5,2.5,f).addColorStop(0,l).addColorStop(1,a),V=new v.XMe(-2.5,-2.5,y,-2.5,-2.5,f).addColorStop(0,m).addColorStop(1,p),w=new v.XMe(-2.5,-2.5,0,0,0,f).addColorStop(0,d).addColorStop(.6,c).addColorStop(.8,i).addColorStop(1,a),S=new v.Cdc(g,{stroke:o.stroke?o.stroke:u,lineWidth:o.lineWidth,pickable:!1});function T(t){switch(t){case Oi.IDLE:e.fill=A,e.stroke=o.deselectedStroke,e.lineWidth=o.deselectedLineWidth,e.opacity=o.deselectedButtonOpacity,S.fill=b,S.opacity=o.deselectedButtonOpacity;break;case Oi.OVER:e.fill=P,e.stroke=o.overStroke,e.lineWidth=o.overLineWidth,e.opacity=o.overButtonOpacity,S.fill=V,S.opacity=o.overButtonOpacity;break;case Oi.PRESSED:e.fill=w,e.stroke=o.selectedStroke,e.lineWidth=o.selectedLineWidth,e.opacity=o.selectedButtonOpacity,S.fill=V,S.opacity=o.selectedButtonOpacity;break;default:throw new Error("unsupported interactionState: "+t)}}e.addChild(S),this.maxLineWidth=S.hasStroke()&&o&&"number"==typeof o.lineWidth?o.lineWidth:0,e.cachedPaints=[A,P,w],S.cachedPaints=[b,V],t.link(T),this.disposeThreeDAppearanceStrategy=()=>{t.hasListener(T)&&t.unlink(T),a.dispose(),h.dispose(),l.dispose(),d.dispose(),c.dispose(),u.dispose(),p.dispose(),m.dispose()}}dispose(){this.disposeThreeDAppearanceStrategy()}},mt.register("RoundButton",du);class cu extends du{constructor(e){const t=(0,ae.ZP)()({soundPlayer:Mi,tandem:L.Z.REQUIRED,tandemNameSuffix:"Button"},e),i=t.listener,s=_.omit(t,["listener"]),n=new qi(s);super(n,new Ni(n),s),this.pushButtonModel=n,i&&this.addListener(i);const r=()=>{t.soundPlayer.play()};n.produceSoundEmitter.addListener(r),this.disposeRoundPushButton=()=>{n.produceSoundEmitter.removeListener(r),n.dispose()}}dispose(){super.dispose(),this.disposeRoundPushButton()}addListener(e){this.pushButtonModel.addListener(e)}removeListener(e){this.pushButtonModel.removeListener(e)}}mt.register("RoundPushButton",cu);class uu{constructor(e){this.screenProperty=e}createOverviewContent(){const e=this.screenProperty.value.view;return e.getVoicingOverviewContent()}createDetailsContent(){const e=this.screenProperty.value.view;return e.getVoicingDetailsContent()}createHintContent(){this.screenProperty.value.view;return this.screenProperty.value.view.getVoicingHintContent()}}T.Z.register("VoicingToolbarAlertManager",uu);const pu=uu,mu={DEFAULT_BUTTON_RADIUS:20.8,PLAY_CONTROL_BUTTON_RADIUS:28};Be.register("SceneryPhetConstants",mu);const gu=mu;class yu extends Qe.bn{constructor(e){super(),this.rect(0,0,e,e)}}Be.register("StopIconShape",yu);class fu extends du{constructor(e,t,i,s){const n=(0,ae.ZP)()({valueOffSoundPlayer:rs,valueOnSoundPlayer:ms,tandem:L.Z.REQUIRED,tandemNameSuffix:"Button"},s),r=new ys(t,i,e,n),o=new gs(r);super(r,o,n),this.addLinkedElement(e,{tandem:n.tandem.createTandem("property")});const a=()=>{e.value===t?n.valueOffSoundPlayer.play():e.value===i&&n.valueOnSoundPlayer.play()};this.buttonModel.produceSoundEmitter.addListener(a),this.disposeRoundToggleButton=()=>{this.buttonModel.produceSoundEmitter.removeListener(a),r.dispose()}}dispose(){this.disposeRoundToggleButton(),super.dispose()}}mt.register("RoundToggleButton",fu);class Au extends fu{constructor(e,t,i,s){const n=(0,ae.ZP)()({content:null,tandem:L.Z.REQUIRED,tandemNameSuffix:"Button"},s),r=new ji(e,t,i,{tandem:n.tandem.createTandem("toggleNode")});n.content=r,super(e,!1,!0,n),this.disposeBooleanRoundToggleButton=function(){r.dispose()}}dispose(){this.disposeBooleanRoundToggleButton(),super.dispose()}}mt.register("BooleanRoundToggleButton",Au);const bu=Au,Pu="data:audio/mpeg;base64,//swxAAAB2hBNHWcgAERC69/MPJDBoAAAtMAQkIoPyFQTJPM0NVYzRy8xtWHpkcxxIacuJ3vlqjpzPGMBRuMl4kQ0yrG38dh/IxSHA+Ud4fETABABElVYiJ4AAAAAAAAeAdHFiQc0wxqaGxfhl+WkXVkI2k9KiBoVzKRtDAElVmeqzlTNtkS+ZRMG1PvI/W94/8ELbWAAAKoJCoT//syxAOCCCw5LF3NACkKh2SdrfVGCg3Cg4Dj8ZLARh41mQxkBgoIjEZTBJjYImACgZ3Whtm3GSfKawL4ECw4WNm+OWqNGSDA0WpZbZ9C6EEKACABE0OQGPHNUOioNqeFiRxh4iSHaHIzHSEHQ1Jm18aQhHVbAGKIIGHgDI2DoEkwGpiSm7L+3Ke0FOb7v////5YAAD0BgIAI2mkGDP/7MsQFgghcPzNM64Zw/QYk3a9tRtoYE52cH2GYQxknpylpgYwBvmhj+eXdR8AmmfACBiUXVYPBUD8AQFVjXou6mqSrKnaY//2////YEwSUMBfK8BUeuUwFk1FU36M5CIHFkGAKBBjYwHg1zDUTtMZwHcHz4KD0zG7NbljlV7oLAI3vKqf/u6v/7v/1qk9RWgGiAmk5gVFlBg4jA27/+zLECAJIVDscbXdqMQsJZSGu6Q607qEyoUsyYQsa4WZFjwf3IccSied99GKhYQEJ6KBkQAznes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JQLGSB085gjDsBjGE8D7VPjHMCTPeo+TNASqLBV3LH6z5L/o/tT/bX//6P7UgSNtX+nGmxYvehgEMjUQzL//syxCSCRxQrE0z3ZnDVhaEprmDWgZMFVM3NDjHRJMXkk6wLyZHFDW+g7VLV49ezholVp8r/Qr//6wAAABbcAAAA6LXY4+6lq+QsIEjGLAqZgi52qDiyVMnI0y0FDIIQQCvFXsMFOQWxJKvzkvJIpCAASxGAAIKpjJFvUBNi4iFEpDNEgF+JiuDqFNJIhYC+F4Xt0jupWUFPRFS1TP/7MsQxgEaMQP+s8MbwtAdd/PeYf0FNRTMuOTkuNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",Vu=M(F,Pu),vu=k.Z.createLock(Pu),wu=new Z;let Su=!1;const Tu=()=>{Su||(vu(),Su=!0)},Eu=F.decodeAudioData(Vu.buffer,e=>{null===wu.audioBufferProperty.value&&(wu.audioBufferProperty.set(e),Tu())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),wu.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),Tu()});Eu&&Eu.then(e=>{null===wu.audioBufferProperty.value&&(wu.audioBufferProperty.set(e),Tu())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),Tu()});const _u=new si(wu,{soundClipOptions:{initialOutputLevel:.7},soundManagerOptions:{categoryName:"user-interface"}});R.register("pauseSoundPlayer",_u);const xu=_u,Cu="data:audio/mpeg;base64,//swxAAAB1BHOnWmABEWjO23MPACAM4AAka0C2CViDZjzZoUIKXmGQHLmnHZgZuIghjiBjgxeiMuWAQDhMhMyefxsGZPP38oscKBjgh7vuRIAKJJltl/4AAAAAAAeIQEujEqiqRmMJCES5WG2gJpbTG4Ow/M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kwzhjwsOWNJM2elOSgTRFJwgCZsX4M8Ey4BGGYWAqYuJyfIDeDjBMHwQMDgAS9MnhnJgUlrzvaptVGAQec6lMQ/3f/6jPXTHReMiqMGMWUxc1k858QWJowORAyihcwxFJBEEAcYEiIZKisXjRJa1CZRJpRjQWbPNYwE6FUu//4kDgOawFnzmmWBnQC1CtjH4cMxyw6//swxCcDhzBpGA10R4DYByKNjmTKvZANJytIEhBhR0LrVuwNjTP9fxs5asiIqWf/Lf/////+tQnIJAGuAaNRprSJykgqQzgLjF/HCsDeTcUqKus9P66P1f/4oZYBGjiY1AXQLGWOYOSMStAB/8FTIsVCgeAoqKt7ajS0MdUhaVJ/rUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVV//syxDKCRnwlDGNh4vBbgB4kMIwOVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==",Iu=M(F,Cu),Du=k.Z.createLock(Cu),Lu=new Z;let ku=!1;const Mu=()=>{ku||(Du(),ku=!0)},Ou=F.decodeAudioData(Iu.buffer,e=>{null===Lu.audioBufferProperty.value&&(Lu.audioBufferProperty.set(e),Mu())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),Lu.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),Mu()});Ou&&Ou.then(e=>{null===Lu.audioBufferProperty.value&&(Lu.audioBufferProperty.set(e),Mu())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),Mu()});const Nu=new si(Lu,{soundClipOptions:{initialOutputLevel:.7},soundManagerOptions:{categoryName:"user-interface"}});R.register("playSoundPlayer",Nu);const Ru=Nu;class Bu extends Qe.bn{constructor(e,t){super(),this.moveTo(0,0),this.lineTo(e,t/2),this.lineTo(0,t),this.close()}}Be.register("PlayIconShape",Bu);class Zu extends bu{constructor(e,t,i){const s=(0,ae.ZP)()({radius:gu.PLAY_CONTROL_BUTTON_RADIUS,scaleFactorWhenNotPlaying:1,includeGlobalHotkey:!1,startPlayingLabel:ct.a11y.playControlButton.playStringProperty,endPlayingLabel:null,valueOffSoundPlayer:xu,valueOnSoundPlayer:Ru,xMargin:0,yMargin:0},i),n=.8*s.radius,r=s.radius,o=new v.y$t(new Bu(n,r),{fill:"black",centerX:.05*s.radius,centerY:0}),a=new v.Cdc(s.radius,{children:[o]});t.centerX=0,t.centerY=0;const h=new v.Cdc(s.radius,{children:[t]});super(e,h,a,s);const l=(e,t)=>{this.innerContent=e?s.endPlayingLabel:s.startPlayingLabel;const i=null===t?1:1/s.scaleFactorWhenNotPlaying;this.scale(e?i:s.scaleFactorWhenNotPlaying)};let d;e.link(l),s.includeGlobalHotkey?(d=t=>{if(phet.chipper.queryParameters.supportsInteractiveDescription&&this.pdomDisplayed&&this.buttonModel.enabledProperty.get()&&v.MMl.altKeyDown&&v.ntP.isKeyEvent(t,v.ntP.KEY_K)){e.set(!e.get());const t=e.get()?s.valueOnSoundPlayer:s.valueOffSoundPlayer;t&&t.play()}},v.MMl.keyupEmitter.addListener(d)):d=null,this.disposePlayStopButton=()=>{e.hasListener(l)&&e.unlink(l),d&&v.MMl.keyupEmitter.hasListener(d)&&v.MMl.keyupEmitter.removeListener(d)}}dispose(){this.disposePlayStopButton(),super.dispose()}}Be.register("PlayControlButton",Zu);class qu extends Zu{constructor(e,t){const i=(0,ae.ZP)()({radius:gu.PLAY_CONTROL_BUTTON_RADIUS,endPlayingLabel:ct.a11y.playControlButton.stopStringProperty},t),s=.75*i.radius;super(e,new v.y$t(new yu(s),{fill:"black"}),i)}}Be.register("PlayStopButton",qu);const Fu=un.Z.a11y.toolbar.voicing.titleStringProperty,Hu=un.Z.a11y.toolbar.voicing.quickInfoStringProperty,zu=un.Z.a11y.toolbar.voicing.simVoicingOnAlertStringProperty,Yu=un.Z.a11y.toolbar.voicing.simVoicingOffAlertStringProperty,Gu=un.Z.a11y.toolbar.titleStringProperty,Wu=un.Z.a11y.toolbar.voicing.playOverviewLabelStringProperty,Uu=un.Z.a11y.toolbar.voicing.playDetailsLabelStringProperty,Xu=un.Z.a11y.toolbar.voicing.playHintLabelStringProperty,Ku=un.Z.a11y.toolbar.voicing.overviewLabelStringProperty,ju=un.Z.a11y.toolbar.voicing.detailsLabelStringProperty,Qu=un.Z.a11y.toolbar.voicing.hintLabelStringProperty;class Ju extends v.NBX{constructor(e,t,i){const s=(0,ae.ZP)()({tagName:"section",labelTagName:"h2",labelContent:Gu,visiblePropertyOptions:{phetioReadOnly:!0}},i);super(s);const n={font:new ht(14),fill:t.navigationBarTextFillProperty,maxWidth:90},r=new v.xvT(Fu,n),o=new v.JxC(Hu,n);o.focusHighlight=new v.qLK(o,{innerStroke:"white"});const a=new oa(v.LY3.mainWindowVoicingEnabledProperty,!1,!0,(0,ae.JA)({a11yName:Fu,rightValueContextResponse:zu,leftValueContextResponse:Yu,tandem:s.tandem.createTandem("muteSpeechSwitch")},ca.TOGGLE_SWITCH_OPTIONS)),h=new qo({labelNode:r,controlNode:a,tandem:s.tandem.createTandem("muteSpeechControl")}),l=new v.Lkj,d=new v.Lkj,c=new $u(Ku,Wu,l,d,t,e.createOverviewContent.bind(e)),u=new $u(ju,Uu,l,d,t,e.createDetailsContent.bind(e)),p=new $u(Qu,Xu,l,d,t,e.createHintContent.bind(e));this.children=[h,o,c.content,u.content,p.content],o.leftTop=h.leftBottom.plusXY(0,10),c.content.leftTop=o.leftBottom.plusXY(20,10),u.content.leftTop=c.content.leftBottom.plusXY(0,10),p.content.leftTop=u.content.leftBottom.plusXY(0,10);const m=[c,u,p],g=[c.playingProperty,u.playingProperty,p.playingProperty];m.forEach(e=>{e.playingProperty.link(t=>{e.playContent(g)})}),this.disposeVoicingToolbarItem=()=>{o.dispose(),r.dispose()}}dispose(){this.disposeVoicingToolbarItem(),super.dispose()}}class $u{constructor(e,t,i,s,n,r){this.lookAndFeel=n,this.objectResponseUtterance=new gi.Z,this.createAlert=r,this.playingProperty=new S.Z(!1,{reentrant:!0}),this.playStopButton=new qu(this.playingProperty,{startPlayingLabel:t,voicingNameResponse:t,voicingIgnoreVoicingManagerProperties:!0,radius:12,tandem:L.Z.OPT_OUT});const o=new v.xvT(e,{font:new ht(12),fill:this.lookAndFeel.navigationBarTextFillProperty,maxWidth:100}),a=i.createBox(o,{xAlign:"left"}),h=s.createBox(this.playStopButton,{xAlign:"right"});this.content=new v.BET({children:[a,h],spacing:10}),v.LY3.endSpeakingEmitter.addListener((e,t)=>{t===this.objectResponseUtterance&&(this.playingProperty.set(!1),v.sSl.inputListeners.includes(d)&&v.sSl.removeInputListener(d))});const l=e=>{e.trail.nodes.includes(this.playStopButton)||(v.sSl.removeInputListener(d),this.objectResponseUtterance.priorityProperty.value=gi.Z.LOW_PRIORITY)},d={down:l,focus:l};v.LY3.startSpeakingEmitter.addListener((e,t)=>{t===this.objectResponseUtterance&&v.sSl.addInputListener(d)})}playContent(e){if(this.playingProperty.value){_.without(e,this.playingProperty).forEach(e=>{e.value=!1}),this.objectResponseUtterance.priorityProperty.value=gi.Z.TOP_PRIORITY,this.playStopButton.voicingSpeakResponse({objectResponse:this.createAlert(),utterance:this.objectResponseUtterance})}else v.KsW.cancelUtterance(this.objectResponseUtterance)}}T.Z.register("VoicingToolbarItem",Ju);const ep=Ju,tp=un.Z.a11y.toolbar.openToolbarStringProperty,ip=un.Z.a11y.toolbar.closeToolbarStringProperty,sp=un.Z.a11y.toolbar.hideToolbarStringProperty,np=un.Z.a11y.toolbar.showToolbarStringProperty,rp=un.Z.a11y.toolbar.toolbarShownStringProperty,op=un.Z.a11y.toolbar.toolbarHiddenStringProperty;class ap extends v.NBX{constructor(e,t,i,s){const n=(0,ae.JA)({tagName:"div",visiblePropertyOptions:{phetioReadOnly:!0}},s);super(n),_defineProperty(this,"layoutScale",1),this.isEnabledProperty=e,this.backgroundRectangle=new v.AeJ(0,0,0,0,{fill:i.navigationBarFillProperty}),this.openProperty=new S.Z(!0),this.isShowingProperty=ge.ZP.and([this.isEnabledProperty,v.LY3.enabledProperty,Ae.audioEnabledProperty]);const r=new pu(t);this.menuContent=new ep(r,i,{tandem:n.tandem.createTandem("menuContent")});const o=new hp;this.openButton=new cu({content:o,listener:()=>this.openProperty.toggle(),buttonAppearanceStrategy:Yi.FlatAppearanceStrategy,baseColor:"lightgrey",tandem:L.Z.OPT_OUT}),this.contentWidth=this.menuContent.localBounds.width,this.contentMargin=this.openButton.localBounds.width,this.rightPositionProperty=new Ie.Z(this.getHiddenPosition()),this.rightDestinationPosition=0;const a=new v.NBX({children:[this.backgroundRectangle,this.menuContent,this.openButton]});this.addChild(a);De.Z.addListener(e=>{this.step(e)});const h=(e,t)=>{if(o.matrix=e?Gt.Z.scaling(-1,1):Gt.Z.IDENTITY,this.menuContent.pdomVisible=e,this.openButton.innerContent=e?ip:tp,this.openButton.voicingNameResponse=e?sp:np,this.updateDestinationPosition(),null!==t){const t=e?rp:op;this.openButton.voicingSpeakContextResponse({contextResponse:t}),this.alertDescriptionUtterance(t)}};this.openProperty.link(h);const l=e=>{this.updateDestinationPosition(),a.pdomVisible=e};this.isShowingProperty.link(l),this.disposeToolbar=()=>{this.isShowingProperty.unlink(l),this.openProperty.unlink(h)}}getDisplayedWidth(){return this.rightPositionProperty.value*this.layoutScale+this.openButton.width/2}getHiddenPosition(){return-this.contentMargin/2}updateDestinationPosition(){this.isShowingProperty.value?this.rightDestinationPosition=this.openProperty.value?this.contentWidth+2*this.contentMargin:this.contentMargin:this.rightDestinationPosition=this.getHiddenPosition()}step(e){const t=Math.abs(this.rightPositionProperty.value-this.rightDestinationPosition);if(0!==t){const i=Math.min(t,250*e),s=this.rightPositionProperty.value;this.rightPositionProperty.value=this.rightDestinationPosition>s?s+i:s-i}}layout(e,t){this.layoutScale=e,this.menuContent.setScaleMagnitude(e),this.openButton.setScaleMagnitude(e),this.backgroundRectangle.rectWidth=e*(this.contentWidth+2*this.contentMargin),this.backgroundRectangle.rectHeight=t,this.backgroundRectangle.right=this.rightPositionProperty.value*e,this.openButton.center=this.backgroundRectangle.rightCenter,this.menuContent.centerTop=this.backgroundRectangle.centerTop.plusXY(0,15)}dispose(){this.disposeToolbar(),super.dispose()}}class hp extends v.y$t{constructor(){const e=new Qe.bn;for(let t=0;t<2;t++){const i=8*t;e.moveTo(i,0),e.lineTo(i+5,6),e.lineTo(i,12)}super(e,{stroke:"black",lineWidth:3.5,lineCap:"round"})}}T.Z.register("Toolbar",ap);const lp=ap;class dp{constructor(e){this.inclusions=e}size(){return this.inclusions.length}includes(e){return this.inclusions[e]}apply(e){return e.filter((e,t)=>this.inclusions[t])}inverted(){return new dp(this.inclusions.map(e=>!e))}getIncludedIndices(){return _.range(0,this.size()).filter(e=>this.inclusions[e])}toString(){return`C[${this.inclusions.map(e=>e?"1":"0").join("")}]`}equals(e){return this.inclusions.length===e.inclusions.length&&_.isEqual(this.inclusions,e.inclusions)}static empty(e){return new dp(_.range(0,e).map(()=>!1))}static full(e){return new dp(_.range(0,e).map(()=>!0))}static combinations(e){const t=[],i=[];return function s(n){n===e?t.push(new dp(i.slice())):(i.push(!1),s(n+1),i.pop(),i.push(!0),s(n+1),i.pop())}(0),t}static forEachCombination(e,t){const i=[];!function s(n){n===e.length?t(i):(s(n+1),i.push(e[n]),s(n+1),i.pop())}(0)}static combinationsOf(e){const t=[];return dp.forEachCombination(e,e=>{t.push(e.slice())}),t}}Vr.Z.register("Combination",dp);const cp=dp;var up=i(2238);const pp=Me.Z.android||Me.Z.mobileSafari;phet.joist.elapsedTime=0,phet.joist.playbackModeEnabledProperty=new S.Z(phet.chipper.queryParameters.playbackMode);class mp extends D.Z{constructor(e,t,i){window.phetSplashScreenDownloadComplete();const s=(0,ae.ZP)()({credits:{},homeScreenWarningNode:null,preferencesModel:null,webgl:iu.DEFAULT_WEBGL,phetioState:!1,phetioReadOnly:!0,tandem:L.Z.ROOT},i);s.preferencesModel||(s.preferencesModel=new _e);const n={webgl:s.webgl,tandem:L.Z.GENERAL_VIEW.createTandem("display"),preferencesModel:s.preferencesModel};super(s),_defineProperty(this,"_isConstructionCompleteProperty",new be.Z(!1)),_defineProperty(this,"isConstructionCompleteProperty",this._isConstructionCompleteProperty),_defineProperty(this,"frameStartedEmitter",new Ce.Z),_defineProperty(this,"frameEndedEmitter",new Ce.Z({tandem:L.Z.GENERAL_MODEL.createTandem("frameEndedEmitter"),phetioHighFrequency:!0})),_defineProperty(this,"activeProperty",new S.Z(!0,{tandem:L.Z.GENERAL_MODEL.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."})),_defineProperty(this,"scaleProperty",new Ie.Z(1)),_defineProperty(this,"boundsProperty",new be.Z(null)),_defineProperty(this,"screenBoundsProperty",new be.Z(null)),_defineProperty(this,"lookAndFeel",new Pr),_defineProperty(this,"memoryMonitor",new Er),_defineProperty(this,"version",hc.version),_defineProperty(this,"frameCounter",0),_defineProperty(this,"resizePending",!0),_defineProperty(this,"locale",phet.chipper.locale||"en"),_defineProperty(this,"toolbar",null),_defineProperty(this,"modalNodeStack",(0,de.Z)()),_defineProperty(this,"barrierRectangle",new Ze(this.modalNodeStack,{tandem:L.Z.GENERAL_VIEW.createTandem("barrierRectangle"),phetioDocumentation:"Semi-transparent barrier used to block input events when a dialog is shown, also fades out the background"})),_defineProperty(this,"topLayer",new v.NBX({children:[this.barrierRectangle]})),_defineProperty(this,"lastStepTime",-1),_defineProperty(this,"lastAnimationFrameTime",-1),this.credits=s.credits,this.simNameProperty=e,phet.joist.playbackModeEnabledProperty.lazyLink(()=>{throw new Error("playbackModeEnabledProperty cannot be changed after Sim construction has begun")});const r=new be.Z(new ke.Z(0,0),{valueComparisonStrategy:"equalsFunction"});this.dimensionProperty=r,this.resizeAction=new qe.Z((e,t)=>{if(r.value=new ke.Z(e,t),0===e||0===t)return;const i=Math.min(e/mr.LAYOUT_BOUNDS.width,t/mr.LAYOUT_BOUNDS.height),s=i*kc.NAVIGATION_BAR_SIZE.height;this.navigationBar.layout(i,e,s),this.navigationBar.y=t-s,this.display.setSize(new ke.Z(e,t));const n=t-this.navigationBar.height;this.toolbar&&this.toolbar.layout(i,n);const o=this.toolbar?this.toolbar.getDisplayedWidth():0,a=new Le.Z(o,0,e,n);_.each(this.screens,e=>e.view.layout(a)),this.topLayer.children.forEach(e=>{e.layout&&e.layout(a)}),Me.Z.mobileSafari&&window.scrollTo(0,0),this.scaleProperty.value=i,this.boundsProperty.value=new Le.Z(0,0,e,t),this.screenBoundsProperty.value=a.copy(),v.Yj2.listener.setTargetScale(i),v.Yj2.listener.setTargetBounds(this.boundsProperty.value),v.Yj2.listener.setPanBounds(this.boundsProperty.value)},{tandem:L.Z.GENERAL_MODEL.createTandem("resizeAction"),parameters:[{name:"width",phetioType:Fe.Z},{name:"height",phetioType:Fe.Z}],phetioPlayback:!0,phetioEventMetadata:{alwaysPlaybackableOverride:!0},phetioDocumentation:"Executes when the sim is resized. Values are the sim dimensions in CSS pixels."}),this.stepSimulationAction=new qe.Z(e=>{this.frameStartedEmitter.emit(),this.frameCounter++,e*=phet.chipper.queryParameters.speed,this.resizePending&&this.resizeToWindow();const t=this.selectedScreenProperty.value;e=Math.min(e,t.maxDT),phet.joist.elapsedTime+=1e3*e,De.Z.emit(e),t.model.step&&e&&t.model.step(e),window.TWEEN&&window.TWEEN.update(phet.joist.elapsedTime),this.display.step(e),t.view.step(e),L.Z.PHET_IO_ENABLED&&!phet.phetio.phetioEngine.isReadyForDisplay||this.display.updateDisplay(),phet.chipper.queryParameters.memoryLimit&&this.memoryMonitor.measure(),this.frameEndedEmitter.emit()},{tandem:L.Z.GENERAL_MODEL.createTandem("stepSimulationAction"),parameters:[{name:"dt",phetioType:Fe.Z,phetioDocumentation:"The amount of time stepped in each call, in seconds."}],phetioHighFrequency:!0,phetioPlayback:!0,phetioDocumentation:"A function that steps time forward."});const o=L.Z.GENERAL_MODEL.createTandem("screens"),a=Jc(t,phet.chipper.queryParameters.homeScreen,QueryStringMachine.containsKey("homeScreen"),phet.chipper.queryParameters.initialScreen,QueryStringMachine.containsKey("initialScreen"),phet.chipper.queryParameters.screens,QueryStringMachine.containsKey("screens"),e=>{const i=e.map(e=>t.indexOf(e)+1),s=_.flatten(cp.combinationsOf(i).map(e=>up.Z.permutationsOf(e))).filter(e=>e.length>0).sort();this.availableScreensProperty=new be.Z(i,{tandem:o.createTandem("availableScreensProperty"),isValidValue:e=>_.some(s,t=>_.isEqual(e,t)),phetioFeatured:!0,phetioValueType:(0,su.Z)(Fe.Z),phetioDocumentation:"Controls which screens are available, and the order they are displayed."}),this.activeSimScreensProperty=new ge.ZP([this.availableScreensProperty],e=>e.map(e=>t[e-1]))},e=>new Ar(this.simNameProperty,()=>this.selectedScreenProperty,e,this.activeSimScreensProperty,{tandem:s.tandem.createTandem(window.phetio.PhetioIDUtils.HOME_SCREEN_COMPONENT_NAME),warningNode:s.homeScreenWarningNode}));this.homeScreen=a.homeScreen,this.simScreens=a.selectedSimScreens,this.screens=a.screens,this.allScreensCreated=a.allScreensCreated,this.selectedScreenProperty=new be.Z(a.initialScreen,{tandem:o.createTandem("selectedScreenProperty"),phetioFeatured:!0,phetioDocumentation:"Determines which screen is selected in the simulation",validValues:this.screens,phetioValueType:Tn.ScreenIO}),this.activeSimScreensProperty.lazyLink(e=>{const t=this.selectedScreenProperty.value;t===this.homeScreen?1===e.length?this.selectedScreenProperty.value=e[0]:e.includes(this.homeScreen.model.selectedScreenProperty.value)||(this.homeScreen.model.selectedScreenProperty.value=e[0]):e.includes(t)||(this.selectedScreenProperty.value=e[0])}),this.displayedSimNameProperty=new ge.ZP([this.availableScreensProperty,this.simNameProperty,this.selectedScreenProperty,un.Z.simTitleWithScreenNamePatternStringProperty,ge.ZP.deriveAny(this.simScreens.map(e=>e.nameProperty),(function(){for(var e=arguments.length,t=new Array(e),i=0;i{const r=s.nameProperty.value,o=1===e.length&&t.length>1;return o&&i&&r?Oe.Z.fillIn(n,{simName:i,screenName:r}):o&&r?r:i},{tandem:L.Z.GENERAL_MODEL.createTandem("displayedSimNameProperty"),phetioValueType:it.Z});const h=new S.Z(!0,{tandem:L.Z.GENERAL_MODEL.createTandem("browserTabVisibleProperty"),phetioDocumentation:"Indicates whether the browser tab containing the simulation is currently visible",phetioReadOnly:!0,phetioFeatured:!0});this.browserTabVisibleProperty=h,document.addEventListener("visibilitychange",()=>{h.set("visible"===document.visibilityState)},!1),this.supportsGestureDescription=phet.chipper.queryParameters.supportsInteractiveDescription&&pp,this.hasKeyboardHelpContent=_.some(this.simScreens,e=>!!e.createKeyboardHelpNode),window.phet.joist.sim=this,this.isSettingPhetioStateProperty=L.Z.PHET_IO_ENABLED?phet.phetio.phetioEngine.phetioStateEngine.isSettingStateProperty:new S.Z(!1),this.isClearingPhetioDynamicElementsProperty=L.Z.PHET_IO_ENABLED?phet.phetio.phetioEngine.phetioStateEngine.isClearingDynamicElementsProperty:new S.Z(!1),this.preferencesModel=s.preferencesModel,Ae.initialize(this),this.preferencesModel.audioModel.supportsSound&&me.addSoundGenerator(new Qc(this.selectedScreenProperty,this.homeScreen,{initialOutputLevel:.5}),{categoryName:"user-interface"}),window.phet.joist.ScreenshotGenerator=Sc,this.simNameProperty.link(e=>{document.title=e}),this.preferencesModel.audioModel.supportsVoicing&&(this.toolbar=new lp(this.preferencesModel.audioModel.toolbarEnabledProperty,this.selectedScreenProperty,this.lookAndFeel,{tandem:L.Z.GENERAL_VIEW.createTandem("toolbar")}),this.toolbar.rightPositionProperty.lazyLink(()=>{this.resize(this.boundsProperty.value.width,this.boundsProperty.value.height)})),this.display=new iu(n),this.rootNode=this.display.rootNode,vs.initialize(this,this.display),he.Z.multilink([this.activeProperty,phet.joist.playbackModeEnabledProperty],(e,t)=>{t?(this.display.interactive=!0,v.MMl.enabled=!0):(this.display.interactive=e,v.MMl.enabled=e)}),document.body.appendChild(this.display.domElement),Ge.start(this),this.navigationBar=new kc(this,L.Z.GENERAL_VIEW.createTandem("navigationBar")),this.updateBackground=()=>{this.lookAndFeel.backgroundColorProperty.value=v.Ilk.toColor(this.selectedScreenProperty.value.backgroundColorProperty.value)},this.lookAndFeel.backgroundColorProperty.link(e=>{this.display.backgroundColor=e}),this.selectedScreenProperty.link(()=>this.updateBackground()),this.selectedScreenProperty.lazyLink((e,t)=>t.view.interruptSubtreeInput()),this.simInfo=new au(this),L.Z.PHET_IO_ENABLED&&phet.phetio.phetioEngine.onSimConstructionStarted(this.simInfo,this.isConstructionCompleteProperty,this.frameEndedEmitter,this.display),this.isSettingPhetioStateProperty.lazyLink(e=>{e||this.updateViews()}),this.boundRunAnimationLoop=this.runAnimationLoop.bind(this),phet.chipper.queryParameters.legendsOfLearning&&new lu(this).start()}updateViews(){this.resizeToWindow(),this.selectedScreenProperty.value.view.step&&this.selectedScreenProperty.value.view.step(0),this.display.descriptionUtteranceQueue.clear(),v.KsW.clear(),xe.Z.runOnNextTick(()=>phet.joist.display.updateDisplay())}finishInit(e){_.each(e,e=>{e.view.layerSplit=!0,this.display.simulationRoot.addChild(e.view)}),this.display.simulationRoot.addChild(this.navigationBar),this.preferencesModel.audioModel.supportsVoicing&&(this.display.simulationRoot.addChild(this.toolbar),this.display.simulationRoot.pdomOrder=[this.toolbar],v.LY3.voicingFullyEnabledProperty.link(e=>{this.setSimVoicingVisible(e)})),this.selectedScreenProperty.link(t=>{e.forEach(e=>{const i=e===t;i&&e.activeProperty.set(i),e.view.setVisible(i),i||e.activeProperty.set(i)}),this.updateBackground(),this.isSettingPhetioStateProperty.value||v.Yj2.listener.resetTransform()}),this.display.simulationRoot.addChild(this.topLayer);const t=()=>{phet.joist.playbackModeEnabledProperty.value||(this.resizePending=!0)};if($(window).resize(t),window.addEventListener("resize",t),window.addEventListener("orientationchange",t),window.visualViewport&&window.visualViewport.addEventListener("resize",t),this.resizeToWindow(),gc.check(),QueryStringMachine.warnings.length){const e=new Fc(QueryStringMachine.warnings,{closeButtonListener:()=>{e.hide(),e.dispose()}});e.show()}}showPopup(e,t){t&&(this.rootNode.interruptSubtreeInput(),this.modalNodeStack.push(e),this.setPDOMViewsVisible(!1),this.setNonModalVoicingVisible(!1)),e.layout&&e.layout(this.screenBoundsProperty.value),this.topLayer.addChild(e)}hidePopup(e,t){t&&(this.modalNodeStack.remove(e),0===this.modalNodeStack.length&&(this.setNonModalVoicingVisible(v.LY3.voicingFullyEnabledProperty.value),this.setPDOMViewsVisible(!0))),this.topLayer.removeChild(e)}resizeToWindow(){this.resizePending=!1,this.resize(window.innerWidth,window.innerHeight)}resize(e,t){this.resizeAction.execute(e,t)}start(){const e=[];this.screens.forEach(t=>{e.push(()=>{t.backgroundColorProperty.hasListener(this.updateBackground)||t.backgroundColorProperty.link(this.updateBackground),t.initializeModel()}),e.push(()=>{t.initializeView(this.simNameProperty,this.displayedSimNameProperty,this.screens.length,this.homeScreen===t)})});const t=i=>{setTimeout(()=>{e[i]();const s=I.Z.linear(0,e.length-1,.25,1,i);document.getElementById("progressBarForeground")&&document.getElementById("progressBarForeground").setAttribute("width",""+273*s),i+1{if(this.finishInit(this.screens),v.cQK.polyfillRequestAnimationFrame(),phet.chipper.queryParameters.profiler&&Oc.start(this),this._isConstructionCompleteProperty.value=!0,this.boundRunAnimationLoop(),phet.joist.playbackModeEnabledProperty.value){0,De.Z.emit(0)}L.Z.PHET_IO_ENABLED&&!phet.preloads.phetio.queryParameters.phetioStandalone||window.phetSplashScreen.dispose(),phet.chipper.brand,phet.chipper.queryParameters.continuousTest&&phet.chipper.reportContinuousTestResult({type:"continuous-test-load"}),phet.chipper.queryParameters.postMessageOnLoad&&window.parent&&window.parent.postMessage(JSON.stringify({type:"load",url:window.location.href}),"*")},25)},30/e.length)};t(0)}runAnimationLoop(){window.requestAnimationFrame(this.boundRunAnimationLoop),this.activeProperty.value&&!phet.joist.playbackModeEnabledProperty.value&&(this.frameCounter>0&&this.display.fuzzInputEvents(),this.stepOneFrame());const e=Date.now();xe.Z.emit(gp(this.lastAnimationFrameTime,e)),this.lastAnimationFrameTime=e,L.Z.PHET_IO_ENABLED&&phet.phetio.phetioCommandProcessor.onAnimationLoop(this)}stepOneFrame(){const e=Date.now(),t=gp(this.lastStepTime,e);this.lastStepTime=e,t>0&&this.stepSimulation(t)}stepSimulation(e){this.stepSimulationAction.execute(e)}setPDOMViewsVisible(e){for(let t=0;tfp()).catch(e=>console.log(e)),L.Z.PHET_IO_ENABLED){const e=k.Z.createLock({name:"phetioEngine"});Promise.resolve().then((function(){var e=new Error("Cannot find module '../../phet-io/js/phetioEngine.js'");throw e.code="MODULE_NOT_FOUND",e})).then(t=>{yp=t.default,e()}).catch(e=>console.log(e))}const Ap=k.Z.createLock({name:"launch"});const bp=new class{constructor(){this.launchComplete=!1}launch(e){k.Z.addListener(()=>{var t;(window.phet.joist.launchSimulation=()=>{var t;(this.launchComplete=!0,L.Z.PHET_IO_ENABLED)&&(null===(t=yp)||void 0===t||t.onCrossFrameListenersReady());e()},L.Z.PHET_IO_ENABLED)&&(null===(t=yp)||void 0===t||t.initialize());phet.chipper.queryParameters.postMessageOnReady&&window.parent&&window.parent.postMessage(JSON.stringify({type:"ready",url:window.location.href}),"*"),L.Z.PHET_IO_ENABLED&&!phet.preloads.phetio.queryParameters.phetioStandalone||phet.chipper.queryParameters.playbackMode||window.phet.joist.launchSimulation()}),Ap(),window.phet.joist.launchCalled=!0}};T.Z.register("simLauncher",bp);const Pp=bp,Vp=new N.Z("moleculeShapes"),vp=QueryStringMachine.getAll({showOuterLonePairs:{type:"flag",public:!0},maxConnections:{type:"number",defaultValue:6,public:!0}});Vp.register("MoleculeShapesQueryParameters",vp);const wp=vp,Sp={backgroundProperty:new v.rtN(Vp,"background",{default:new v.Ilk(0,0,0),basics:new v.Ilk(198,226,246),projector:new v.Ilk(255,255,255)}),centralAtomProperty:new v.rtN(Vp,"centralAtom",{default:new v.Ilk(159,102,218),basics:new v.Ilk(153,90,216)}),atomProperty:new v.rtN(Vp,"atom",{default:new v.Ilk(255,255,255),projector:new v.Ilk(153,153,153)}),bondProperty:new v.rtN(Vp,"bond",{default:new v.Ilk(255,255,255),basics:new v.Ilk(230,230,230)}),controlPanelBorderProperty:new v.rtN(Vp,"controlPanelBorder",{default:new v.Ilk(210,210,210),basics:new v.Ilk(30,30,30),projector:new v.Ilk(30,30,30)}),controlPanelTitleProperty:new v.rtN(Vp,"controlPanelTitle",{default:new v.Ilk(240,240,240),projector:new v.Ilk(0,0,0),basics:new v.Ilk(0,0,0)}),controlPanelTextProperty:new v.rtN(Vp,"controlPanelText",{default:new v.Ilk(230,230,230),projector:new v.Ilk(0,0,0),basics:new v.Ilk(0,0,0)}),realExampleFormulaProperty:new v.rtN(Vp,"realExampleFormula",{default:new v.Ilk(230,230,230),projector:new v.Ilk(0,0,0)}),realExampleBorderProperty:new v.rtN(Vp,"realExampleBorder",{default:new v.Ilk(60,60,60),projector:new v.Ilk(230,230,230)}),lonePairShellProperty:new v.rtN(Vp,"lonePairShell",{default:new v.Ilk(255,255,255,.7),projector:new v.Ilk(178,178,178,.7)}),lonePairElectronProperty:new v.rtN(Vp,"lonePairElectron",{default:new v.Ilk(255,255,0,.8),projector:new v.Ilk(0,0,0,.8)}),moleculeGeometryNameProperty:new v.rtN(Vp,"moleculeGeometryName",{default:new v.Ilk(255,255,140),basics:new v.Ilk(0,0,0),projector:new v.Ilk(102,0,204)}),electronGeometryNameProperty:new v.rtN(Vp,"electronGeometryName",{default:new v.Ilk(255,204,102),basics:new v.Ilk(0,0,0),projector:new v.Ilk(0,102,102)}),bondAngleReadoutProperty:new v.rtN(Vp,"bondAngleReadout",{default:new v.Ilk(255,255,255),basics:new v.Ilk(0,0,0),projector:new v.Ilk(0,0,0)}),bondAngleSweepProperty:new v.rtN(Vp,"bondAngleSweep",{default:new v.Ilk(128,128,128),basics:new v.Ilk(84,122,165),projector:new v.Ilk(156,156,156)}),bondAngleArcProperty:new v.rtN(Vp,"bondAngleArc",{default:new v.Ilk(255,0,0),basics:new v.Ilk(0,0,0)}),removeButtonTextProperty:new v.rtN(Vp,"removeButtonText",{default:new v.Ilk(0,0,0)}),removeButtonBackgroundProperty:new v.rtN(Vp,"removeButtonBackground",{default:new v.Ilk(255,200,0)}),checkboxProperty:new v.rtN(Vp,"checkbox",{default:new v.Ilk(230,230,230),basics:new v.Ilk(0,0,0),projector:new v.Ilk(0,0,0)}),checkboxBackgroundProperty:new v.rtN(Vp,"checkboxBackground",{default:new v.Ilk(30,30,30),basics:new v.Ilk(255,255,255),projector:new v.Ilk(255,255,255)}),removePairGroupProperty:new v.rtN(Vp,"removePairGroup",{default:new v.Ilk("#d00")})};Vp.register("MoleculeShapesColors",Sp);const Tp=Sp,Ep={showOuterLonePairsProperty:new S.Z(wp.showOuterLonePairs,{tandem:"molecule-shapes-basics"===phet.chipper.packageObject.name?L.Z.OPT_OUT:L.Z.PREFERENCES.createTandem("showOuterLonePairsProperty")}),checkboxOptions:{checkboxColor:Tp.checkboxProperty,checkboxColorBackground:Tp.checkboxBackgroundProperty}};Vp.register("MoleculeShapesGlobals",Ep);let _p=phet.chipper.queryParameters.webgl&&v.cQK.isWebGLSupported;navigator.userAgent.indexOf("Firefox/")>=0&&navigator.userAgent.match(/OS X 10\.1[0123]/)&&(_p=!1);const xp=_p&&v.cQK.checkIE11StencilSupport();(0,Se.Z)(Ep,{hasBasicWebGLSupportProperty:new be.Z(_p),useWebGLProperty:new be.Z(xp),linkColor:function(e,t){const i=function(t){e.color.setHex(t.toNumber())};return t.link(i),function(){t.unlink(i)}},toColorProperty:function(e){let t;if("string"==typeof e&&(e=new v.Ilk(e)),e instanceof v.Ilk)t=new be.Z(e);else{if(!(e instanceof wi.Z))throw new Error("bad color passed to MoleculeShapesGlobals.toColorProperty");t=e}return t}});const Cp=Ep,Ip=(0,lt.Z)("MOLECULE_SHAPES");Vp.register("MoleculeShapesStrings",Ip);const Dp=Ip;class Lp extends v.SHm{constructor(e,t,i){const s=[];let n=null;if(!e){const e=t.createTandem("showOuterLonePairsCheckbox");n=new v.xvT(Dp.options.showOuterLonePairsStringProperty,{font:Fd.CONTENT_FONT,maxWidth:350,tandem:e.createTandem("labelText")}),s.push(new Pi(Cp.showOuterLonePairsProperty,n,{tandem:e}))}super({children:s,spacing:Fd.CONTENT_SPACING,align:"left"}),this.checkboxes=s,this.label=n}dispose(){this.checkboxes.forEach(e=>e.dispose()),this.label&&this.label.dispose(),super.dispose()}}Vp.register("SimulationPreferencesContentNode",Lp);var kp=i(8002);const Mp=new N.Z("nitroglycerin");class Op{constructor(e,t,i,s,n,r){this.symbol=e,this.covalentRadius=t,this.vanDerWaalsRadius=i,this.electronegativity=s,this.atomicWeight=n,this.color=r}static getElementBySymbol(e){const t=Op.elementMap.get(e);return t}isSameElement(e){return e.symbol===this.symbol}isHydrogen(){return this.isSameElement(Op.H)}isCarbon(){return this.isSameElement(Op.C)}isOxygen(){return this.isSameElement(Op.O)}toString(){return this.symbol}}_defineProperty(Op,"Ar",new(P=Op)("Ar",97,188,null,39.948,"#FFAFAF")),_defineProperty(Op,"B",new P("B",85,192,2.04,10.811,"rgb(255,170,119)")),_defineProperty(Op,"Be",new P("Be",105,153,1.57,9.012182,"rgb(194,255,95)")),_defineProperty(Op,"Br",new P("Br",114,185,2.96,79.904,"rgb(190,30,20)")),_defineProperty(Op,"C",new P("C",77,170,2.55,12.0107,"rgb(178,178,178)")),_defineProperty(Op,"Cl",new P("Cl",100,175,3.16,35.4527,"rgb(136,242,21)")),_defineProperty(Op,"F",new P("F",72,147,3.98,18.9984032,"rgb(245,255,36)")),_defineProperty(Op,"H",new P("H",37,120,2.2,1.00794,"#ffffff")),_defineProperty(Op,"I",new P("I",133,198,2.66,126.90447,"#940094")),_defineProperty(Op,"N",new P("N",75,155,3.04,14.00674,"#0000ff")),_defineProperty(Op,"Ne",new P("Ne",69,154,null,20.1797,"#1AFFFB")),_defineProperty(Op,"O",new P("O",73,152,3.44,15.9994,Mn.RED_COLORBLIND)),_defineProperty(Op,"P",new P("P",110,180,2.19,30.973762,"rgb(255,154,0)")),_defineProperty(Op,"S",new P("S",103,180,2.58,32.066,"rgb(212,181,59)")),_defineProperty(Op,"Si",new P("Si",118,210,1.9,28.0855,"rgb(240,200,160)")),_defineProperty(Op,"Sn",new P("Sn",145,217,1.96,118.71,"#668080")),_defineProperty(Op,"Xe",new P("Xe",108,216,2.6,131.293,"#429eb0")),_defineProperty(Op,"elements",[P.Ar,P.B,P.Be,P.Br,P.C,P.Cl,P.F,P.H,P.I,P.N,P.Ne,P.O,P.P,P.S,P.Si,P.Sn,P.Xe]),_defineProperty(Op,"elementMap",function(e){const t=new Map;return e.forEach(e=>t.set(e.symbol,e)),t}(P.elements)),Mp.register("Element",Op);var Np=i(8676),Rp=i(5076);class Bp extends be.Z{constructor(e,t,i){(0,Np.Z)("Use EnumerationProperty. EnumerationDeprecated should be exchanged for classes that extend EnumerationValue, see WilderEnumerationPatterns for examples."),super(t,i=(0,Se.Z)({valueType:e,phetioValueType:(0,Si.Z)(e),validValues:e.VALUES},i)),this.enumeration=e}}We.Z.register("EnumerationDeprecatedProperty",Bp);const Zp=Bp,qp=new N.Z("mobius"),Fp=new Te.Z("ThreeQuaternionIO",{valueType:THREE.Quaternion,documentation:"A numerical object representing a quaternion",toStateObject:e=>({x:e.x,y:e.y,z:e.z,w:e.w}),stateSchema:{x:Fe.Z,y:Fe.Z,z:Fe.Z,w:Fe.Z},fromStateObject:e=>new THREE.Quaternion(e.x,e.y,e.z,e.w),applyState:(e,t)=>{e.set(t.x,t.y,t.z,t.w)},stateObjectToCreateElementArguments:e=>[e.x,e.y,e.z,e.w]});qp.register("ThreeQuaternionIO",Fp);const Hp=Fp;class zp{constructor(e,t,i,s){this.a=e,this.b=t,this.order=i,this.length=s}toString(){return`{${this.a.toString()} => ${this.b.toString()}}`}contains(e){return this.a===e||this.b===e}getOtherAtom(e){return this.a===e?this.b:this.a}toStateObject(e){return{a:e.indexOf(this.a),b:e.indexOf(this.b),order:this.order,length:this.length}}static fromStateObject(e,t){return new zp(t[e.a],t[e.b],e.order,e.length)}}zp.BondIO=new Te.Z("BondIO",{valueType:zp,stateSchema:{a:Fe.Z,b:Fe.Z,order:Fe.Z,length:Fe.Z}}),Vp.register("Bond",zp);const Yp=zp,Gp=-19.471220333*Math.PI/180;class Wp{constructor(e,t){this.stringProperty=e,this.unitVectors=t}}const Up=new Js.Z("",{tandem:L.Z.GLOBAL_MODEL.createTandem("emptyElectronGeometryStringProperty"),phetioState:!1,phetioFeatured:!1,phetioDocumentation:"Should only be the empty string",phetioReadOnly:!0}),Xp=Rp.Z.byMap({EMPTY:new Wp(Up,[]),DIATOMIC:new Wp(Dp.geometry.diatomicStringProperty,[new kp.Z(1,0,0)]),LINEAR:new Wp(Dp.geometry.linearStringProperty,[new kp.Z(1,0,0),new kp.Z(-1,0,0)]),TRIGONAL_PLANAR:new Wp(Dp.geometry.trigonalPlanarStringProperty,[new kp.Z(1,0,0),new kp.Z(Math.cos(2*Math.PI/3),Math.sin(2*Math.PI/3),0),new kp.Z(Math.cos(4*Math.PI/3),Math.sin(4*Math.PI/3),0)]),TETRAHEDRAL:new Wp(Dp.geometry.tetrahedralStringProperty,[new kp.Z(0,0,1),new kp.Z(Math.cos(0)*Math.cos(Gp),Math.sin(0)*Math.cos(Gp),Math.sin(Gp)),new kp.Z(Math.cos(2*Math.PI/3)*Math.cos(Gp),Math.sin(2*Math.PI/3)*Math.cos(Gp),Math.sin(Gp)),new kp.Z(Math.cos(4*Math.PI/3)*Math.cos(Gp),Math.sin(4*Math.PI/3)*Math.cos(Gp),Math.sin(Gp))]),TRIGONAL_BIPYRAMIDAL:new Wp(Dp.geometry.trigonalBipyramidalStringProperty,[new kp.Z(0,1,0),new kp.Z(0,Math.cos(2*Math.PI/3),Math.sin(2*Math.PI/3)),new kp.Z(0,Math.cos(4*Math.PI/3),Math.sin(4*Math.PI/3)),new kp.Z(1,0,0),new kp.Z(-1,0,0)]),OCTAHEDRAL:new Wp(Dp.geometry.octahedralStringProperty,[new kp.Z(0,0,1),new kp.Z(0,0,-1),new kp.Z(0,1,0),new kp.Z(0,-1,0),new kp.Z(1,0,0),new kp.Z(-1,0,0)])},{beforeFreeze:e=>{e.byNumberOfGroupsMap={0:e.EMPTY,1:e.DIATOMIC,2:e.LINEAR,3:e.TRIGONAL_PLANAR,4:e.TETRAHEDRAL,5:e.TRIGONAL_BIPYRAMIDAL,6:e.OCTAHEDRAL},e.getConfiguration=t=>e.byNumberOfGroupsMap[t]}});Vp.register("ElectronGeometry",Xp);const Kp=Xp;function jp(e,t){const i=[],s=[],n=e.length;for(let r=0;r3*e+t,set3(e,t){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]},transpose3(e,t){const i=e[3],s=e[6],n=e[1],r=e[7],o=e[2],a=e[5];t[0]=e[0],t[1]=i,t[2]=s,t[3]=n,t[4]=e[4],t[5]=r,t[6]=o,t[7]=a,t[8]=e[8]},det3:e=>e[0]*e[4]*e[8]+e[1]*e[5]*e[6]+e[2]*e[3]*e[7]-e[2]*e[4]*e[6]-e[1]*e[3]*e[8]-e[0]*e[5]*e[7],mult3(e,t,i){const s=e[0]*t[0]+e[1]*t[3]+e[2]*t[6],n=e[0]*t[1]+e[1]*t[4]+e[2]*t[7],r=e[0]*t[2]+e[1]*t[5]+e[2]*t[8],o=e[3]*t[0]+e[4]*t[3]+e[5]*t[6],a=e[3]*t[1]+e[4]*t[4]+e[5]*t[7],h=e[3]*t[2]+e[4]*t[5]+e[5]*t[8],l=e[6]*t[0]+e[7]*t[3]+e[8]*t[6],d=e[6]*t[1]+e[7]*t[4]+e[8]*t[7],c=e[6]*t[2]+e[7]*t[5]+e[8]*t[8];i[0]=s,i[1]=n,i[2]=r,i[3]=o,i[4]=a,i[5]=h,i[6]=l,i[7]=d,i[8]=c},mult3LeftTranspose(e,t,i){const s=e[0]*t[0]+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=h,i[6]=l,i[7]=d,i[8]=c},mult3Vector3(e,t,i){const s=e[0]*t.x+e[1]*t.y+e[2]*t.z,n=e[3]*t.x+e[4]*t.y+e[5]*t.z,r=e[6]*t.x+e[7]*t.y+e[8]*t.z;i.x=s,i.y=n,i.z=r},swapNegateColumn(e,t,i){const s=e[t],n=e[t+3],r=e[t+6];e[t]=e[i],e[t+3]=e[i+3],e[t+6]=e[i+6],e[i]=-s,e[i+3]=-n,e[i+6]=-r},setIdentity3(e){e[0]=e[4]=e[8]=1,e[1]=e[2]=e[3]=e[5]=e[6]=e[7]=0},setGivens3(e,t,i,s,n){this.setIdentity3(e),e[this.index3(s,s)]=t,e[this.index3(n,n)]=t,e[this.index3(s,n)]=i,e[this.index3(n,s)]=-i},preMult3Givens(e,t,i,s,n){const r=3*s,o=3*n,a=t*e[r+0]+i*e[o+0],h=t*e[o+0]-i*e[r+0],l=t*e[r+1]+i*e[o+1],d=t*e[o+1]-i*e[r+1],c=t*e[r+2]+i*e[o+2],u=t*e[o+2]-i*e[r+2];e[r+0]=a,e[o+0]=h,e[r+1]=l,e[o+1]=d,e[r+2]=c,e[o+2]=u},postMult3Givens(e,t,i,s,n){const r=t*e[s+0]+i*e[n+0],o=t*e[n+0]-i*e[s+0],a=t*e[s+3]+i*e[n+3],h=t*e[n+3]-i*e[s+3],l=t*e[s+6]+i*e[n+6],d=t*e[n+6]-i*e[s+6];e[s+0]=r,e[n+0]=o,e[s+3]=a,e[n+3]=h,e[s+6]=l,e[n+6]=d},applyJacobi3(e,t,i,s){const n=e[3*i+i],r=e[3*i+s],o=e[3*s+s],a=r*r;let h=n-o;h*=h;const l=a0?1:0,r=0;else{const e=1/Math.sqrt(h+l);n=e*o,r=e*a}this.preMult3Givens(t,n,r,s,i),this.postMult3Givens(e,n,r,s,i)},svd3(e,t,i,s,n){const r=i,o=n,a=s;this.mult3LeftTranspose(e,e,a),this.setIdentity3(r),this.jacobiIteration3(a,r,t),this.transpose3(r,o),this.mult3(e,o,a);let h,l=a[0]*a[0]+a[3]*a[3]+a[6]*a[6],d=a[1]*a[1]+a[4]*a[4]+a[7]*a[7],c=a[2]*a[2]+a[5]*a[5]+a[8]*a[8];lt*i+s,transpose(e,t,i,s){for(let n=0;n1)for(let s=0;s{this.orientation.set(e),e.magnitude>0&&this.orientation.normalize()}),this.isLonePair=t,this.isCentralAtom=!1,this.element=i.element}attractToIdealDistance(e,t,i){if(this.userControlledProperty.value)return;const s=i.getOtherAtom(this).positionProperty.value,n=!s.equals(kp.Z.ZERO),r=i.length;Math.abs(this.positionProperty.value.minus(s).magnitude-r)>Math.abs(t-r)&&(this.positionProperty.value=this.orientation.times(t).plus(s));const o=this.positionProperty.value.minus(s),a=o.magnitude;if(0!==a){const t=o.normalized(),i=r-a;let s=Math.min(.1*e/.016,1);n&&(s=1),this.positionProperty.value=this.positionProperty.value.plus(t.times(s*i))}}getRepulsionImpulse(e,t,i){if(this.positionProperty.value.equalsEpsilon(e.positionProperty.value,1e-6))return new kp.Z(0,0,0);const s=om(rm.BONDED_PAIR_DISTANCE,this.positionProperty.value.magnitude,i),n=om(rm.BONDED_PAIR_DISTANCE,e.positionProperty.value.magnitude,i),r=this.orientation.times(s),o=0===e.positionProperty.value.magnitude?new kp.Z(0,0,0):e.orientation.times(n),a=r.minus(o),h=a.withMagnitude(t*rm.ELECTRON_PAIR_REPULSION_SCALE/(a.magnitude*a.magnitude)),l=rm.getTimescaleImpulseFactor(t);return h.times(l)}repulseFrom(e,t,i){this.addVelocity(this.getRepulsionImpulse(e,t,i))}addPosition(e){this.userControlledProperty.value||this.isCentralAtom||(this.positionProperty.value=this.positionProperty.value.plus(e))}addVelocity(e){this.userControlledProperty.value||this.isCentralAtom||(this.velocityProperty.value=this.velocityProperty.value.plus(e))}stepForward(e){if(this.userControlledProperty.value)return;const t=this.velocityProperty.value.dot(this.orientation);this.positionProperty.value.magnitude>0&&(this.velocityProperty.value=this.velocityProperty.value.minus(this.orientation.times(t))),this.positionProperty.value=this.positionProperty.value.plus(this.velocityProperty.value.times(e));let i=1-rm.DAMPING_FACTOR;i=Math.pow(i,e/.017),this.velocityProperty.value=this.velocityProperty.value.times(i)}dragToPosition(e){this.positionProperty.value=e,this.velocityProperty.value=new kp.Z(0,0,0)}toStateObject(e){return{position:this.positionProperty.value.toStateObject(),velocity:this.velocityProperty.value.toStateObject(),isLonePair:this.isLonePair,element:null===this.element?null:this.element.symbol,isCentralAtom:this===e}}static fromStateObject(e){const t=kp.Z.fromStateObject(e.position),i=kp.Z.fromStateObject(e.velocity),s=e.isLonePair,n=null===e.element?null:Op.getElementBySymbol(e.element),r=new rm(t,s,{element:n});return r.isCentralAtom=e.isCentralAtom,r.velocityProperty.value=i,r}static getTimescaleImpulseFactor(e){return Math.sqrt(e>.017?.017/e:1)}}function om(e,t,i){return e*(1-i)+t*i}Vp.register("PairGroup",rm),rm.BONDED_PAIR_DISTANCE=10,rm.LONE_PAIR_DISTANCE=7,rm.ELECTRON_PAIR_REPULSION_SCALE=3e4,rm.ANGLE_REPULSION_SCALE=3,rm.JITTER_SCALE=.001,rm.DAMPING_FACTOR=.1,rm.PairGroupIO=new Te.Z("PairGroupIO",{valueType:rm,stateSchema:{position:kp.Z.Vector3IO,velocity:kp.Z.Vector3IO,isLonePair:Ee.Z,element:(0,nu.Z)(it.Z),isCentralAtom:Ee.Z}});const am=rm,hm={};Vp.register("AttractorModel",hm),hm.applyAttractorForces=(e,t,i,s,n,r,o)=>{const a=_.map(e,e=>e.positionProperty.value.minus(n).normalized()),h=hm.findClosestMatchingConfiguration(a,i,s,o),l=n.equals(kp.Z.ZERO);let d,c=0;for(d=0;d{const n=e.length,r=dm;tm.setVectors3(e,r);const o=lm,a=cm;function h(e){tm.permuteColumns(3,n,a,e,o);const t=new Jp.Z(3,3);hm.computeRotationMatrixWithTranspose(n,o,r,t.entries);const i=new Jp.Z(3,n);tm.mult(3,3,n,t.entries,o,i.entries);let s=0;for(let o=0;o<3*n;o++){const e=r[o]-i.entries[o];s+=e*e}return new hm.ResultMapping(s,i,e,t)}tm.setVectors3(t,a);let l=void 0!==s?h(s):null;for(let d=0;d2&&null!==l&&l.permutation!==s){const i=t[s.indices[0]],n=t[s.indices[1]],r=4-4*Math.cos(Math.abs(Math.acos(I.Z.clamp(i.dot(e[0]),-1,1))-Math.acos(I.Z.clamp(n.dot(e[1]),-1,1))));if(l.error_.map(e,e=>e.orientation);const um=new tm.Array(9),pm=new tm.Array(9),mm=new tm.Array(9),gm=new tm.Array(9);hm.computeRotationMatrixWithTranspose=(e,t,i,s)=>{const n=um;tm.multRightTranspose(3,e,3,t,i,n),tm.svd3(n,5,pm,mm,gm),tm.mult3RightTranspose(gm,pm,s)},hm.ResultMapping=class{constructor(e,t,i,s){this.error=e,this.target=t,this.permutation=i,this.rotation=s}rotateVector(e){const t=Jp.Z.columnVector3(e);return this.rotation.times(t).extractVector3(0)}},hm.forEachMultiplePermutations=(e,t)=>{if(0===e.length)t(e);else{const i=e.slice(0),s=i[0];i.splice(0,1),hm.forEachPermutation(s,[],s=>{hm.forEachMultiplePermutations(i,i=>{const n=new Array(e.length);n[0]=s;for(let e=0;e{if(0===e.length)i(t);else for(let s=0;s{let t="";for(let i=0;i{hm.forEachMultiplePermutations([["A","B"],["C"],["D","E","F"]],e=>{console.log(hm.listPrint(e))})};const ym=hm;class fm{constructor(e,t,i,s){this.allowedPermutations=e,this.centralAtom=t,this.groups=i,this.idealOrientations=s}applyAttraction(e){return ym.applyAttractorForces(this.groups,e,this.idealOrientations,this.allowedPermutations,this.centralAtom.positionProperty.value,!1).error}applyAngleAttractionRepulsion(e,t){return ym.applyAttractorForces(this.groups,e,this.idealOrientations,this.allowedPermutations,this.centralAtom.positionProperty.value,!0,t).mapping}static permuteListWithIndices(e,t){if(t.length<2)return e;const i=[];for(let s=0;se.indexOf(t),s=Qp(e,e=>e.isLonePair),n=s[0],r=s[1];return t=fm.permuteListWithIndices(t,_.map(n,i)),t=fm.permuteListWithIndices(t,_.map(r,i)),t}static realPermutations(e){let t=[];t.push(up.Z.identity(e.length));const i=t=>e.indexOf(t),s=_.filter(e,e=>e.isLonePair);t=fm.permuteListWithIndices(t,_.map(s,i));const n=_.filter(e,e=>!e.isLonePair),r=_.uniq(_.map(n,e=>e.element));for(let o=0;ot.element===e);t=fm.permuteListWithIndices(t,_.map(s,i))}return t}}Vp.register("LocalShape",fm);const Am=fm;class bm{constructor(e,t){this.x=e,this.stringProperty=t}}const Pm=new Js.Z("",{tandem:L.Z.GLOBAL_MODEL.createTandem("emptyMoleculeGeometryStringProperty"),phetioState:!1,phetioFeatured:!1,phetioDocumentation:"Should only be the empty string",phetioReadOnly:!0}),Vm=Rp.Z.byMap({EMPTY:new bm(0,Pm),DIATOMIC:new bm(1,Dp.shape.diatomicStringProperty),LINEAR:new bm(2,Dp.shape.linearStringProperty),BENT:new bm(2,Dp.shape.bentStringProperty),TRIGONAL_PLANAR:new bm(3,Dp.shape.trigonalPlanarStringProperty),TRIGONAL_PYRAMIDAL:new bm(3,Dp.shape.trigonalPyramidalStringProperty),T_SHAPED:new bm(3,Dp.shape.tShapedStringProperty),TETRAHEDRAL:new bm(4,Dp.shape.tetrahedralStringProperty),SEESAW:new bm(4,Dp.shape.seesawStringProperty),SQUARE_PLANAR:new bm(4,Dp.shape.squarePlanarStringProperty),TRIGONAL_BIPYRAMIDAL:new bm(5,Dp.shape.trigonalBipyramidalStringProperty),SQUARE_PYRAMIDAL:new bm(5,Dp.shape.squarePyramidalStringProperty),OCTAHEDRAL:new bm(6,Dp.shape.octahedralStringProperty)},{beforeFreeze:e=>{e.getConfiguration=(t,i)=>{if(0===t)return e.EMPTY;if(1===t)return e.DIATOMIC;if(2===t){if(0===i||3===i||4===i)return e.LINEAR;if(1===i||2===i)return e.BENT;throw new Error(`invalid x: ${t}, e: ${i}`)}if(3===t){if(0===i)return e.TRIGONAL_PLANAR;if(1===i)return e.TRIGONAL_PYRAMIDAL;if(2===i||3===i)return e.T_SHAPED;throw new Error(`invalid x: ${t}, e: ${i}`)}if(4===t){if(0===i)return e.TETRAHEDRAL;if(1===i)return e.SEESAW;if(2===i)return e.SQUARE_PLANAR;throw new Error(`invalid x: ${t}, e: ${i}`)}if(5===t){if(0===i)return e.TRIGONAL_BIPYRAMIDAL;if(1===i)return e.SQUARE_PYRAMIDAL;throw new Error(`invalid x: ${t}, e: ${i}`)}if(6===t){if(0===i)return e.OCTAHEDRAL;throw new Error(`invalid x: ${t}, e: ${i}`)}throw new Error(`unknown VSEPR configuration x: ${t}, e: ${i}`)}}});Vp.register("MoleculeGeometry",Vm);const vm=Vm,wm={};class Sm{constructor(e,t){this.x=e,this.e=t,this.moleculeGeometry=vm.getConfiguration(e,t),this.electronGeometry=Kp.getConfiguration(e+t),this.bondOrientations=[],this.lonePairOrientations=[],this.allOrientations=this.electronGeometry.unitVectors;for(let i=0;ithis.bondChangedEmitter.emit(e)),this.bondRemovedEmitter.addListener(e=>this.bondChangedEmitter.emit(e)),this.groupAddedEmitter.addListener(e=>this.groupChangedEmitter.emit(e)),this.groupRemovedEmitter.addListener(e=>this.groupChangedEmitter.emit(e))}getLocalShape(e){throw new Error("abstract method")}getMaximumBondLength(){throw new Error("abstract method")}update(e){const t=this.groups.length;for(let i=0;it.contains(e))}getNeighbors(e){return _.map(this.getBondsAround(e),t=>t.getOtherAtom(e))}getNeighborCount(e){let t=0;for(let i=0;ii.getOtherAtom(e)===t)[0]||null}}getParent(e){return this.getParentBond(e).getOtherAtom(e)}addCentralAtom(e){this.centralAtom=e,this.addGroup(e,!0),e.isCentralAtom=!0}addGroupAndBond(e,t,i,s){this.addGroup(e,!1),s=s||e.positionProperty.value.minus(t.positionProperty.value).magnitude,this.addBond(new Yp(e,t,i,s)),this.groupAddedEmitter.emit(e)}addGroup(e,t){_m(this.groups,e,e.isLonePair),e.isLonePair?_m(this.lonePairs,e,e.isLonePair):_m(this.atoms,e,e.isLonePair),t&&this.groupAddedEmitter.emit(e)}addBond(e){const t=0===e.order;if(_m(this.bonds,e,t),e.contains(this.centralAtom)){const i=e.getOtherAtom(this.centralAtom);_m(this.radialGroups,i,t),i.isLonePair?_m(this.radialLonePairs,i,t):_m(this.radialAtoms,i,t)}this.bondAddedEmitter.emit(e)}removeBond(e){if((0,le.Z)(this.bonds,e),e.contains(this.centralAtom)){const t=e.getOtherAtom(this.centralAtom);(0,le.Z)(this.radialGroups,t),t.isLonePair?(0,le.Z)(this.radialLonePairs,t):(0,le.Z)(this.radialAtoms,t)}this.bondRemovedEmitter.emit(e)}removeGroup(e){let t;const i=this.getBondsAround(e);for(t=0;t!_.includes(e,t))}getLocalVSEPRShape(e){const t=this.getNeighbors(e);let i=0;for(let n=0;n1){const s=this.getLocalShape(t).applyAngleAttractionRepulsion(e,this.lastPermutations[i]||void 0).permutation;this.lastPermutations[i]=s}}}getLocalShape(e){return this.localShapeMap[e.id]}getMaximumBondLength(){}}Vp.register("RealMolecule",Im);const Dm=Im;let Lm=1;class km{constructor(e){this.element=e,this.symbol=e.symbol,this.covalentRadius=e.covalentRadius,this.covalentDiameter=2*e.covalentRadius,this.electronegativity=e.electronegativity,this.atomicWeight=e.atomicWeight,this.color=e.color,this.reference=(Lm++).toString(16),this.id=`${this.symbol}_${this.reference}`}static createAtomFromSymbol(e){return new km(Op.getElementBySymbol(e))}hasSameElement(e){return this.element.isSameElement(e.element)}isHydrogen(){return this.element.isHydrogen()}isCarbon(){return this.element.isCarbon()}isOxygen(){return this.element.isOxygen()}toString(){return this.symbol}}Mp.register("Atom",km);class Mm extends km{constructor(e,t,i){super(e),this.position=t,this.orientation=t.magnitude>0?t.normalized():t.copy(),this.lonePairCount=i||0}}Vp.register("RealAtomPosition",Mm);const Om=Mm;class Nm{constructor(e,t){this.displayName=e,this.bondLengthOverride=5.5*t,this.atoms=[],this.bonds=[],this.centralAtom=null,this.centralAtomCount=0}addAtom(e){this.atoms.push(e)}addBond(e,t,i,s){this.bonds.push(new Yp(e,t,i,s)),e!==this.centralAtom&&t!==this.centralAtom||this.centralAtomCount++}addCentralAtom(e){this.addAtom(e),this.centralAtom=e}addRadialAtom(e,t){e.position.normalize().multiplyScalar(this.bondLengthOverride),this.addAtom(e),this.addBond(e,this.centralAtom,t,this.bondLengthOverride)}toString(){return this.displayName}}Vp.register("RealMoleculeShape",Nm);const Rm=(e,t,i)=>{const s=new Nm(e,t);return i(s),s},Bm=Op.B,Zm=Op.Be,qm=Op.Br,Fm=Op.C,Hm=Op.Cl,zm=Op.F,Ym=Op.H,Gm=Op.N,Wm=Op.O,Um=Op.P,Xm=Op.S,Km=Op.Xe;Nm.BERYLLIUM_CHLORIDE=Rm("BeCl2",1.8,e=>{e.addCentralAtom(new Om(Zm,new kp.Z(0,0,0))),e.addRadialAtom(new Om(Hm,new kp.Z(1.8,0,0),3),1),e.addRadialAtom(new Om(Hm,new kp.Z(-1.8,0,0),3),1)}),Nm.BORON_TRIFLUORIDE=Rm("BF3",1.313,e=>{e.addCentralAtom(new Om(Bm,new kp.Z(0,0,0)));const t=2*Math.PI/3;e.addRadialAtom(new Om(zm,new kp.Z(1.313*Math.cos(0*t),1.313*Math.sin(0*t),0),3),1),e.addRadialAtom(new Om(zm,new kp.Z(1.313*Math.cos(1*t),1.313*Math.sin(1*t),0),3),1),e.addRadialAtom(new Om(zm,new kp.Z(1.313*Math.cos(2*t),1.313*Math.sin(2*t),0),3),1)}),Nm.BROMINE_PENTAFLUORIDE=Rm("BrF5",1.774,e=>{e.addCentralAtom(new Om(qm,new kp.Z(0,0,0),1));const t=I.Z.toRadians(84.8),i=1.774*Math.sin(t),s=1.774*Math.cos(t);e.addRadialAtom(new Om(zm,new kp.Z(0,-1.689,0),3),1),e.addRadialAtom(new Om(zm,new kp.Z(i,-s,0),3),1),e.addRadialAtom(new Om(zm,new kp.Z(0,-s,i),3),1),e.addRadialAtom(new Om(zm,new kp.Z(-i,-s,0),3),1),e.addRadialAtom(new Om(zm,new kp.Z(0,-s,-i),3),1)}),Nm.METHANE=Rm("CH4",1.087,e=>{e.addCentralAtom(new Om(Fm,new kp.Z(0,0,0)));const t=Kp.getConfiguration(4).unitVectors;for(let i=0;i{e.addCentralAtom(new Om(Hm,new kp.Z(0,0,0),2)),e.addRadialAtom(new Om(zm,new kp.Z(0,-1.598,0),3),1);const t=I.Z.toRadians(87.5),i=1.698*Math.sin(t),s=1.698*Math.cos(t);e.addRadialAtom(new Om(zm,new kp.Z(i,-s,0),3),1),e.addRadialAtom(new Om(zm,new kp.Z(-i,-s,0),3),1)}),Nm.CARBON_DIOXIDE=Rm("CO2",1.163,e=>{e.addCentralAtom(new Om(Fm,new kp.Z(0,0,0))),e.addRadialAtom(new Om(Wm,new kp.Z(-1.163,0,0),2),2),e.addRadialAtom(new Om(Wm,new kp.Z(1.163,0,0),2),2)}),Nm.WATER=Rm("H2O",.957,e=>{e.addCentralAtom(new Om(Wm,new kp.Z(0,0,0),2));const t=I.Z.toRadians(104.5)/2;e.addRadialAtom(new Om(Ym,new kp.Z(Math.sin(t),-Math.cos(t),0).times(.957)),1),e.addRadialAtom(new Om(Ym,new kp.Z(-Math.sin(t),-Math.cos(t),0).times(.957)),1)}),Nm.AMMONIA=Rm("NH3",1.017,e=>{e.addCentralAtom(new Om(Gm,new kp.Z(0,0,0),1));const t=2*Math.PI/3,i=1.017*Math.sin(1.202623030417028),s=1.017*Math.cos(1.202623030417028);e.addRadialAtom(new Om(Ym,new kp.Z(i*Math.cos(0*t),-s,i*Math.sin(0*t))),1),e.addRadialAtom(new Om(Ym,new kp.Z(i*Math.cos(1*t),-s,i*Math.sin(1*t))),1),e.addRadialAtom(new Om(Ym,new kp.Z(i*Math.cos(2*t),-s,i*Math.sin(2*t))),1)}),Nm.PHOSPHORUS_PENTACHLORIDE=Rm("PCl5",2.02,e=>{e.addCentralAtom(new Om(Um,new kp.Z(0,0,0))),e.addRadialAtom(new Om(Hm,new kp.Z(2.14,0,0),3),1),e.addRadialAtom(new Om(Hm,new kp.Z(-2.14,0,0),3),1);const t=2*Math.PI/3;e.addRadialAtom(new Om(Hm,new kp.Z(0,Math.cos(0*t),Math.sin(0*t)).times(2.02),3),1),e.addRadialAtom(new Om(Hm,new kp.Z(0,Math.cos(1*t),Math.sin(1*t)).times(2.02),3),1),e.addRadialAtom(new Om(Hm,new kp.Z(0,Math.cos(2*t),Math.sin(2*t)).times(2.02),3),1)}),Nm.SULFUR_TETRAFLUORIDE=Rm("SF4",1.595,e=>{e.addCentralAtom(new Om(Xm,new kp.Z(0,0,0),1));const t=I.Z.toRadians(173.1)/2,i=I.Z.toRadians(101.6)/2;e.addRadialAtom(new Om(zm,new kp.Z(Math.sin(t),-Math.cos(t),0).times(1.646),3),1),e.addRadialAtom(new Om(zm,new kp.Z(-Math.sin(t),-Math.cos(t),0).times(1.646),3),1),e.addRadialAtom(new Om(zm,new kp.Z(0,-Math.cos(i),Math.sin(i)).times(1.545),3),1),e.addRadialAtom(new Om(zm,new kp.Z(0,-Math.cos(i),-Math.sin(i)).times(1.545),3),1)}),Nm.SULFUR_HEXAFLUORIDE=Rm("SF6",1.564,e=>{e.addCentralAtom(new Om(Xm,new kp.Z(0,0,0)));const t=Kp.getConfiguration(6).unitVectors;for(let i=0;i{const t=I.Z.toRadians(119)/2;e.addCentralAtom(new Om(Xm,new kp.Z(0,0,0),1)),e.addRadialAtom(new Om(Wm,new kp.Z(Math.sin(t),-Math.cos(t),0).times(1.431),2),2),e.addRadialAtom(new Om(Wm,new kp.Z(-Math.sin(t),-Math.cos(t),0).times(1.431),2),2)}),Nm.XENON_DIFLUORIDE=Rm("XeF2",1.977,e=>{e.addCentralAtom(new Om(Km,new kp.Z(0,0,0),3)),e.addRadialAtom(new Om(zm,new kp.Z(1.977,0,0),3),1),e.addRadialAtom(new Om(zm,new kp.Z(-1.977,0,0),3),1)}),Nm.XENON_TETRAFLUORIDE=Rm("XeF4",1.953,e=>{e.addCentralAtom(new Om(Km,new kp.Z(0,0,0),2)),e.addRadialAtom(new Om(zm,new kp.Z(1.953,0,0),3),1),e.addRadialAtom(new Om(zm,new kp.Z(-1.953,0,0),3),1),e.addRadialAtom(new Om(zm,new kp.Z(0,0,1.953),3),1),e.addRadialAtom(new Om(zm,new kp.Z(0,0,-1.953),3),1)}),Nm.TAB_2_BASIC_MOLECULES=[Nm.BERYLLIUM_CHLORIDE,Nm.BORON_TRIFLUORIDE,Nm.METHANE,Nm.PHOSPHORUS_PENTACHLORIDE,Nm.SULFUR_HEXAFLUORIDE],Nm.TAB_2_MOLECULES=[Nm.WATER,Nm.CARBON_DIOXIDE,Nm.SULFUR_DIOXIDE,Nm.XENON_DIFLUORIDE,Nm.BORON_TRIFLUORIDE,Nm.CHLORINE_TRIFLUORIDE,Nm.AMMONIA,Nm.METHANE,Nm.SULFUR_TETRAFLUORIDE,Nm.XENON_TETRAFLUORIDE,Nm.BROMINE_PENTAFLUORIDE,Nm.PHOSPHORUS_PENTACHLORIDE,Nm.SULFUR_HEXAFLUORIDE];const jm={};[Nm.BERYLLIUM_CHLORIDE,Nm.BORON_TRIFLUORIDE,Nm.BROMINE_PENTAFLUORIDE,Nm.METHANE,Nm.CHLORINE_TRIFLUORIDE,Nm.CARBON_DIOXIDE,Nm.WATER,Nm.AMMONIA,Nm.PHOSPHORUS_PENTACHLORIDE,Nm.SULFUR_TETRAFLUORIDE,Nm.SULFUR_HEXAFLUORIDE,Nm.SULFUR_DIOXIDE,Nm.XENON_DIFLUORIDE,Nm.XENON_TETRAFLUORIDE].forEach(e=>{jm[e.displayName]=e});const Qm=new Te.Z("RealMoleculeShapeIO",{valueType:Nm,documentation:"Represents a real molecule with 3d atom positions",stateSchema:{displayName:it.Z},toStateObject:e=>({displayName:e.displayName}),fromStateObject:e=>jm[e.displayName]});Nm.RealMoleculeShapeIO=Qm;const Jm=Nm;class $m extends Cm{constructor(){super(!1),this.bondLengthOverride=null}update(e){super.update(e);const t=this.radialGroups;for(let i=0;i1)if(s.isCentralAtom){const i=this.getLocalShape(s).applyAttraction(e),n=Math.max(0,Math.min(1,Math.log(i+1)-.5));for(let s=0;s{const e=this.moleculeProperty.value.getCentralVSEPRConfiguration();this.electronGeometryProperty.value=e.electronGeometry,this.moleculeGeometryProperty.value=e.moleculeGeometry};this.moleculeProperty.link((e,t)=>{t&&t.bondChangedEmitter.removeListener(s),e&&e.bondChangedEmitter.addListener(s),s()})}reset(){this.moleculeProperty.reset(),this.moleculeQuaternionProperty.reset(),this.showBondAnglesProperty.reset(),this.showLonePairsProperty.reset(),this.showMoleculeGeometryProperty.reset(),this.showElectronGeometryProperty.reset()}step(e){this.moleculeProperty.value.update(Math.min(e,.2))}}tg.MoleculeShapesModelIO=new Te.Z("MoleculeShapesModelIO",{valueType:tg,toStateObject:e=>{const t=e.moleculeProperty.value,i={isReal:t.isReal,groups:t.groups.map(e=>e.toStateObject(t.centralAtom)),bonds:t.bonds.map(e=>e.toStateObject(t.groups)),lastMidpoint:null===t.lastMidpoint?null:kp.Z.Vector3IO.toStateObject(t.lastMidpoint)},s=i;return t.isReal?(s.realMoleculeShape=Jm.RealMoleculeShapeIO.toStateObject(t.realMoleculeShape),s.bondLengthOverride=null):(s.bondLengthOverride=t.bondLengthOverride||null,s.realMoleculeShape=null),i},applyState:(e,t)=>{const i=t;let s;if(i.isReal){s=new Dm(Jm.RealMoleculeShapeIO.fromStateObject(i.realMoleculeShape)),i.groups.map(e=>am.fromStateObject(e)).forEach((e,t)=>{s.groups[t].positionProperty.value=e.positionProperty.value,s.groups[t].velocityProperty.value=e.velocityProperty.value})}else{s=new eg,s.bondLengthOverride=i.bondLengthOverride;const e=i.groups.map(e=>am.fromStateObject(e));e.filter(e=>e.isCentralAtom).forEach(e=>{s.addCentralAtom(e)}),e.filter(e=>!e.isCentralAtom).forEach(e=>{s.addGroup(e,!1)}),i.bonds.forEach(t=>{s.addBond(Yp.fromStateObject(t,e))})}s.lastMidpoint=null===t.lastMidpoint?null:kp.Z.Vector3IO.fromStateObject(t.lastMidpoint),e.moleculeProperty.value=s},stateSchema:{isReal:Ee.Z,groups:(0,su.Z)(am.PairGroupIO),bonds:(0,su.Z)(Yp.BondIO),lastMidpoint:(0,nu.Z)(kp.Z.Vector3IO),realMoleculeShape:(0,nu.Z)(Jm.RealMoleculeShapeIO),bondLengthOverride:(0,nu.Z)(Fe.Z)}}),Vp.register("MoleculeShapesModel",tg);const ig=tg;class sg{constructor(e,t){this.normal=e,this.distance=t}intersectWithRay(e){return e.pointAtDistance(e.distanceToPlane(this))}static fromTriangle(e,t,i){const s=i.minus(e).cross(t.minus(e));return 0===s.magnitude?null:(s.normalize(),new sg(s,s.dot(e)))}}_defineProperty(sg,"XY",new(V=sg)(new kp.Z(0,0,1),0)),_defineProperty(sg,"XZ",new V(new kp.Z(0,1,0),0)),_defineProperty(sg,"YZ",new V(new kp.Z(1,0,0),0)),Vr.Z.register("Plane3",sg);class ng{constructor(e,t){this.position=e,this.direction=t}shifted(e){return new ng(this.pointAtDistance(e),this.direction)}pointAtDistance(e){return this.position.plus(this.direction.timesScalar(e))}distanceToPlane(e){return(e.distance-this.position.dot(e.normal))/this.direction.dot(e.normal)}toString(){return`${this.position.toString()} => ${this.direction.toString()}`}}Vr.Z.register("Ray3",ng);class rg{constructor(e,t){this.center=e,this.radius=t}intersect(e,t){const i=e.direction,s=e.position,n=s.minus(this.center),r=i.dot(n),o=4*r*r-4*(n.magnitudeSquared-this.radius*this.radius);if(o{cg||(lg(),cg=!0)},pg=F.decodeAudioData(hg.buffer,e=>{null===dg.audioBufferProperty.value&&(dg.audioBufferProperty.set(e),ug())},e=>{console.warn("decode of audio data failed, using stubbed sound, error: "+e),dg.audioBufferProperty.set(F.createBuffer(1,1,F.sampleRate)),ug()});pg&&pg.then(e=>{null===dg.audioBufferProperty.value&&(dg.audioBufferProperty.set(e),ug())}).catch(e=>{console.warn("promise rejection caught for audio decode, error = "+e),ug()});const mg=new si(dg,{soundClipOptions:{initialOutputLevel:.39,enabledDuringPhetioStateSetting:!0},soundManagerOptions:{categoryName:"user-interface"}});R.register("resetAllSoundPlayer",mg);const gg=mg;class yg extends Qe.bn{constructor(e){super();const t=.4*e,i=.625*e,s=2.25*(i-t),n=.35*-Math.PI,r=-2*Math.PI*.85,o=.18*-Math.PI;this.moveTo(t*Math.cos(n),t*Math.sin(n)),this.lineTo(i*Math.cos(n),i*Math.sin(n));const a=n+r;this.arc(0,0,i,n,a,!0);const h=(s-(i-t))/2;this.lineTo((i+h)*Math.cos(a),(i+h)*Math.sin(a));const l=.55*(i+t);this.lineTo(l*Math.cos(a+o),l*Math.sin(a+o)),this.lineTo((t-h)*Math.cos(a),(t-h)*Math.sin(a)),this.lineTo(t*Math.cos(a),t*Math.sin(a)),this.arc(0,0,t,a,n),this.close()}}Be.register("ResetShape",yg);class fg extends cu{constructor(e){const t=e&&e.radius?e.radius:24,i=(0,ae.ZP)()({radius:t,arrowColor:"black",baseColor:"white",xMargin:6,yMargin:6,xContentOffset:-.03*t,yContentOffset:-.0125*t,tandem:L.Z.REQUIRED,tandemNameSuffix:"ResetButton"},e),s=new yg(i.radius),n=new v.y$t(s,{fill:i.arrowColor}),r=new v.y$t(s.transformed(Gt.Z.scaling(-1,-1)));n.localBounds=n.localBounds.union(r.localBounds),i.content=n,super(i)}}Be.register("ResetButton",fg);const Ag=5/gu.DEFAULT_BUTTON_RADIUS;class bg extends fg{constructor(e){const t=(0,ae.ZP)()({radius:gu.DEFAULT_BUTTON_RADIUS,phetioRestoreScreenStateOnReset:!0,touchAreaDilation:5.2,baseColor:Mn.RESET_ALL_BUTTON_BASE_COLOR,arrowColor:"white",listener:_.noop,tandem:L.Z.REQUIRED,tandemNameSuffix:"ResetAllButton",phetioDocumentation:"The orange, round button that can be used to restore the initial state",soundPlayer:gg,innerContent:ct.a11y.resetAll.labelStringProperty,voicingNameResponse:ct.a11y.resetAll.labelStringProperty,voicingContextResponse:ct.a11y.voicing.resetAll.contextResponseStringProperty},e),i=t.listener;t.listener=()=>{i&&i(),L.Z.PHET_IO_ENABLED&&t.phetioRestoreScreenStateOnReset&&this.isPhetioInstrumented()&&phet.phetio.phetioEngine.phetioStateEngine.restoreStateForScreen(t.tandem)},t.xMargin=t.yMargin=t.radius*Ag,super(t);const s=new ko({alert:ct.a11y.resetAll.alertStringProperty});let n=v.KsW.enabled;const r=new Map;this.pushButtonModel.isFiringProperty.lazyLink(e=>{e?(n=v.KsW.enabled,v.KsW.enabled=!1,v.KsW.clear()):(v.KsW.enabled=n,this.voicingSpeakFullResponse()),this.forEachUtteranceQueue(t=>{e?(r.set(t,t.enabled),t.enabled=!1,t.clear()):(t.enabled=r.get(t)||t.enabled,t.addToBack(s))})});const o=new v.F3H({keys:["alt+r"],callback:()=>this.pdomClick(),global:!0,listenerFireTrigger:"up"});this.addInputListener(o),this.disposeResetAllButton=()=>{this.removeInputListener(o),r.clear()}}dispose(){this.disposeResetAllButton(),super.dispose()}}Be.register("ResetAllButton",bg);class Pg extends oo{constructor(e){const t=(0,ae.ZP)()({reload:()=>window.location.reload(),xSpacing:30,topMargin:30,bottomMargin:30,leftMargin:30},e),i=new v.y$t(fc,{fill:"#E87600",scale:.048}),s=new v.xvT(ct.webglWarning.contextLossFailureStringProperty,{font:new ht(12)}),n=new Ac(ct.webglWarning.contextLossReloadStringProperty,{font:new ht(12),baseColor:"#E87600",listener:()=>this.hide()});super(new v.BET({children:[i,s,n],spacing:10}),t),this.reload=t.reload,this.disposeContextLossFailureDialog=()=>{s.dispose(),n.dispose()}}dispose(){this.disposeContextLossFailureDialog(),super.dispose()}hide(){this.reload(),super.hide()}hideWithoutReload(){super.hide()}}Be.register("ContextLossFailureDialog",Pg);class Vg{constructor(e){this.textureFactory=e,this.renderers=[],this.textures=[]}get(e){for(let i=0;i{const e=new THREE.Texture(_g);return e.needsUpdate=!0,e.minFilter=THREE.LinearMipMapLinearFilter,e}),Cg=Sg[0].advance,Ig=3*Sg[0].advance+Sg["."].advance+Sg["°"].advance,Dg=Sg[0].advance+Ig,Lg=["varying vec2 vUv;","void main() {"," vUv = uv;"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),kg=["varying vec2 vUv;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","const float scaleCenter = 0.4;","void main() {"," vec4 texLookup = texture2D( map, vUv );"," float rescaled = ( texLookup.r - scaleCenter ) * 2.0 + scaleCenter;"," gl_FragColor = vec4( color, opacity * clamp( rescaled, 0.0, 1.0 ) );","}"].join("\n"),Mg={map:{type:"t",value:null},opacity:{type:"f",value:0},color:{type:"3f"}};class Og extends THREE.Mesh{constructor(e){const t=[],i=xg.get(e),s=new THREE.Geometry;let n=0;for(let o=0;o<"000.0°".length;o++){s.vertices.push(new THREE.Vector3(n,0,0)),s.vertices.push(new THREE.Vector3(n+Tg,0,0)),s.vertices.push(new THREE.Vector3(n+Tg,Eg,0)),s.vertices.push(new THREE.Vector3(n+0,Eg,0)),n+=Sg["000.0°"[o]].advance,t.push(new THREE.Vector3),t.push(new THREE.Vector3),t.push(new THREE.Vector3),t.push(new THREE.Vector3);const e=4*o;s.faces.push(new THREE.Face3(e,e+1,e+2)),s.faceVertexUvs[0].push([t[e],t[e+1],t[e+2]]),s.faces.push(new THREE.Face3(e,e+2,e+3)),s.faceVertexUvs[0].push([t[e],t[e+2],t[e+3]])}s.dynamic=!0,s.uvsNeedUpdate=!0;const r=JSON.parse(JSON.stringify(Mg));r.map.value=i,Tp.bondAngleReadoutProperty.link(e=>{r.color.value=[e.r/255,e.g/255,e.b/255]}),super(s,Cp.useWebGLProperty.value?new THREE.ShaderMaterial({vertexShader:Lg,fragmentShader:kg,side:THREE.DoubleSide,transparent:!0,uniforms:r}):new THREE.MeshBasicMaterial({side:THREE.DoubleSide,transparent:!0,map:i})),this.uvs=t,this.materialUniforms=r,this.unsetLabel()}setLabel(e,t,i,s,n){this.setString(e),this.materialUniforms.opacity.value=t;const r=.13*n;this.scale.x=this.scale.y=this.scale.z=r;const o=6===e.length?-Dg/2:-Cg-Ig/2,a=-Eg/2,h=s.minus(i),l=h.normalized().componentMultiply(new Ke.Z(.38,.2)).magnitude;this.position.x=s.x+h.x*l+o*r,this.position.y=s.y+h.y*l+a*r}unsetLabel(){this.materialUniforms.opacity.value=0}setString(e){let t=0;6===e.length?this.setGlyph(0,e[t++]):this.unsetGlyph(0),this.setGlyph(1,e[t++]),this.setGlyph(2,e[t++]),this.setGlyph(3,e[t++]),this.setGlyph(4,e[t++]),this.setGlyph(5,e[t++])}setGlyph(e,t){const i=Sg[t],s=i.bounds.minX,n=i.bounds.maxX,r=1-i.bounds.maxY,o=1-i.bounds.minY;this.setUVs(e,s,r,n,o)}unsetGlyph(e){this.setUVs(e,0,0,0,0)}setUVs(e,t,i,s,n){const r=4*e;this.uvs[r].x=t,this.uvs[r].y=n,this.uvs[r+1].x=s,this.uvs[r+1].y=n,this.uvs[r+2].x=s,this.uvs[r+2].y=i,this.uvs[r+3].x=t,this.uvs[r+3].y=i,this.geometry.uvsNeedUpdate=!0}}Vp.register("LabelWebGLView",Og);const Ng=Og;class Rg extends Pi{constructor(e,t,i){super(e,t,i),Tp.checkboxProperty.linkAttribute(this,"checkboxColor"),Tp.checkboxBackgroundProperty.linkAttribute(this,"checkboxColorBackground")}}Vp.register("MoleculeShapesCheckbox",Rg);const Bg=Rg;class Zg extends((0,v.tTM)(v.NBX)){constructor(e,t,i){super({excludeInvisibleChildrenFromBounds:!0});const s=new((0,v.pL8)(v.NBX))({children:[t],visibleProperty:t.visibleProperty});s.localPreferredWidthProperty.link(e=>{t.widthSizable&&(t.preferredWidth=e)}),he.Z.multilink([t.minimumWidthProperty,e.boundsProperty],(e,t)=>{s.localMinimumWidth=Math.max(e,t.width+2*i.yMargin)}),i=(0,Se.Z)({},yt.DEFAULT_PANEL_OPTIONS,i),this.titleNode=e,this.titleBackgroundNode=new v.AeJ(0,0,5,5,0,0,{fill:i.fill,visibleProperty:e.visibleProperty,pickable:!1}),this.panel=new yt(s,{lineWidth:i.lineWidth,xMargin:i.xMargin,yMargin:i.yMargin,cornerRadius:i.cornerRadius,resize:i.resize,backgroundPickable:i.backgroundPickable,align:i.align}),this.setStroke(i.stroke),this.setFill(i.fill),this.titleContainer=new v.NBX,he.Z.multilink([this.panel.boundsProperty,t.visibleProperty,t.boundsProperty],(e,t,i)=>{const s=e.isFinite()&&i.isFinite()&&t;this.titleContainer.children=s?[this.titleBackgroundNode,this.titleNode]:[]}),this.addChild(this.panel),this.addChild(this.titleContainer),s.boundsProperty.lazyLink(this.updateTitlePosition.bind(this)),t.boundsProperty.lazyLink(this.updateTitlePosition.bind(this)),this.panel.boundsProperty.lazyLink(this.updateTitlePosition.bind(this)),e.localBoundsProperty.lazyLink(this.updateTitlePosition.bind(this)),this.updateTitlePosition(),this.panel.minimumWidthProperty.link(e=>{this.localMinimumWidth=e}),this.panel.minimumHeightProperty.link(e=>{this.localMinimumHeight=e}),this.localPreferredWidthProperty.link(e=>{this.panel.preferredWidth=e}),this.localPreferredHeightProperty.link(e=>{this.panel.preferredHeight=e}),this.mutate(i)}updateTitlePosition(){this.panel.bounds.isFinite()&&(this.titleNode.centerX=this.panel.centerX,this.titleNode.centerY=this.panel.top,this.titleBackgroundNode.setRectBounds(this.titleNode.bounds.dilatedX(10)))}getStroke(){return this.panel.stroke}get stroke(){return this.getStroke()}setStroke(e){this.panel.stroke=e}set stroke(e){this.setStroke(e)}getFill(){return this.panel.fill}get fill(){return this.getFill()}setFill(e){this.panel.fill=e,this.titleBackgroundNode.fill=e}set fill(e){this.setFill(e)}}Vp.register("TitledPanel",Zg);const qg=Zg;class Fg extends qg{constructor(e,t,i,s){s=(0,Se.Z)({lineWidth:1.5,xMargin:Fg.xMargin,yMargin:15,cornerRadius:15,backgroundPickable:!0,pickable:!0,fill:Tp.backgroundProperty,stroke:Tp.controlPanelBorderProperty},s),super(new v.xvT(e,{font:new ht(18),fill:Tp.controlPanelTitleProperty,tandem:i.createTandem("titleText"),phetioVisiblePropertyInstrumented:!0,pickable:!1,maxWidth:280}),t,s)}}Fg.xMargin=15,Vp.register("MoleculeShapesPanel",Fg);const Hg=Fg,zg=[Up,Dp.geometry.diatomicStringProperty,Dp.geometry.linearStringProperty,Dp.geometry.trigonalPlanarStringProperty,Dp.geometry.tetrahedralStringProperty,Dp.geometry.trigonalBipyramidalStringProperty,Dp.geometry.octahedralStringProperty],Yg=[Pm,Dp.shape.diatomicStringProperty,Dp.shape.linearStringProperty,Dp.shape.bentStringProperty,Dp.shape.trigonalPlanarStringProperty,Dp.shape.trigonalPyramidalStringProperty,Dp.shape.tShapedStringProperty,Dp.shape.tetrahedralStringProperty,Dp.shape.seesawStringProperty,Dp.shape.squarePlanarStringProperty,Dp.shape.trigonalBipyramidalStringProperty,Dp.shape.squarePyramidalStringProperty,Dp.shape.octahedralStringProperty],Gg=new ht(16);function Wg(e){return new ge.ZP(e,(function(){for(var e=arguments.length,t=new Array(e),i=0;inew v.xvT(e,{font:Gg}).width)))}))}const Ug=Wg(zg),Xg=Wg(Yg);class Kg extends Hg{constructor(e,t,i){i=(0,Se.Z)({fill:Tp.backgroundProperty,tandem:t},i);const s=new v.zch({xSpacing:20,ySpacing:10});super(Dp.control.geometryNameStringProperty,s,t),this.model=e;const n=new ht(14),r=t.createTandem("moleculeGeometryCheckbox");this.moleculeGeometryCheckbox=new Bg(e.showMoleculeGeometryProperty,new v.xvT(Dp.control.moleculeGeometryStringProperty,{font:n,fill:Tp.moleculeGeometryNameProperty,tandem:r.createTandem("labelText")}),{tandem:r,layoutOptions:{column:1,row:0}});const o=e.isBasicsVersion?L.Z.OPT_OUT:t.createTandem("electronGeometryCheckbox");this.electronGeometryCheckbox=new Bg(e.showElectronGeometryProperty,new v.xvT(Dp.control.electronGeometryStringProperty,{font:n,fill:Tp.electronGeometryNameProperty,tandem:o.createTandem("labelText")}),{tandem:o,layoutOptions:{column:0,row:0}}),this.moleculeText=new v.xvT("X",{visibleProperty:e.showMoleculeGeometryProperty,font:Gg,pickable:!1,fill:Tp.moleculeGeometryNameProperty,maxWidth:420}),this.electronText=new v.xvT("Y",{visibleProperty:e.showElectronGeometryProperty,font:Gg,pickable:!1,fill:Tp.electronGeometryNameProperty,maxWidth:420});const a=new v.NBX({visibleProperty:this.moleculeGeometryCheckbox.visibleProperty,children:[this.moleculeText],layoutOptions:{column:1,row:1,minContentHeight:this.moleculeText.height}});if(Xg.link(e=>{a.mutateLayoutOptions({minContentWidth:e})}),s.addChild(this.moleculeGeometryCheckbox),s.addChild(a),he.Z.multilink([this.moleculeGeometryCheckbox.boundsProperty,a.boundsProperty,s.boundsProperty],()=>{let e=this.moleculeGeometryCheckbox.localBounds.union(this.moleculeGeometryCheckbox.boundsOf(a));e.width{e.mutateLayoutOptions({minContentWidth:t})}),s.addChild(this.electronGeometryCheckbox),s.addChild(e),he.Z.multilink([this.electronGeometryCheckbox.boundsProperty,e.boundsProperty,s.boundsProperty],()=>{let t=this.electronGeometryCheckbox.localBounds.union(this.electronGeometryCheckbox.boundsOf(e));t.width{t&&t.bondChangedEmitter.removeListener(h),e&&e.bondChangedEmitter.addListener(h),h()}),this.mutate(i)}updateNames(){this.moleculeText.stringProperty=this.getMoleculeGeometryName(),this.electronText.stringProperty=this.getElectronGeometryName(),this.moleculeText.centerX=this.moleculeGeometryCheckbox.centerX,this.electronText.centerX=this.electronGeometryCheckbox.centerX}getMoleculeGeometryName(){const e=this.model.moleculeProperty.value.getCentralVSEPRConfiguration().moleculeGeometry.stringProperty;return null===e?Pm:e}getElectronGeometryName(){const e=this.model.moleculeProperty.value.getCentralVSEPRConfiguration().electronGeometry.stringProperty;return null===e?Up:e}}Vp.register("GeometryNamePanel",Kg);const jg=Kg;class Qg extends v.xvT{constructor(){super("",{font:new ht(16),visible:!1})}setLabel(e,t,i,s,n){this.text=e,this.visible=!0;const r=this.globalToParentPoint(i),o=this.globalToParentPoint(s);this.center=o.plus(o.minus(r).times(.3)),this.fill=Tp.bondAngleReadoutProperty.value.withAlpha(t)}unsetLabel(){this.visible=!1}}Vp.register("LabelFallbackNode",Qg);const Jg=Qg;class $g extends ur{constructor(e,t){super({tandem:t});const i=this;this.model=e,this.backgroundEventTarget=v.AeJ.bounds(this.layoutBounds,{}),this.addChild(this.backgroundEventTarget),this.activeScale=1,this.screenWidth=null,this.screenHeight=null,this.threeScene=new THREE.Scene,this.threeCamera=new THREE.PerspectiveCamera,this.threeCamera.near=1,this.threeCamera.far=100,this.threeRenderer=Cp.useWebGLProperty.value?new THREE.WebGLRenderer({antialias:!0,preserveDrawingBuffer:phet.chipper.queryParameters.preserveDrawingBuffer}):new THREE.CanvasRenderer({devicePixelRatio:1}),this.threeRenderer.setPixelRatio(window.devicePixelRatio||1),this.contextLossDialog=null,Cp.useWebGLProperty.value&&this.threeRenderer.context.canvas.addEventListener("webglcontextlost",e=>{e.preventDefault(),this.showContextLossDialog(),"phet.colorado.edu"===document.domain&&window._gaq&&window._gaq.push(["_trackEvent","WebGL Context Loss","molecule-shapes "+phet.joist.sim.version,document.URL])}),Tp.backgroundProperty.link(e=>{this.threeRenderer.setClearColor(e.toNumber(),1)}),$g.addLightsToScene(this.threeScene),this.threeCamera.position.copy($g.cameraPosition),this.moleculeNode=new v.SOl(this.threeRenderer.domElement,{preventTransform:!0,pickable:!1,tandem:t.createTandem("moleculeNode")}),this.moleculeNode.invalidateDOM=()=>this.moleculeNode.invalidateSelf(new Le.Z(0,0,0,0)),this.moleculeNode.invalidateDOM(),this.moleculeNode.invalidateDOM(),this.moleculeNode.renderToCanvasSelf=(e,t)=>{let i=null;const s=t.timesMatrix(this.getUniqueTrail().getMatrix().inverted()).m00(),n=Math.ceil(s*this.screenWidth),r=Math.ceil(s*this.screenHeight);if(Cp.useWebGLProperty.value){const e=new THREE.WebGLRenderTarget(n,r,{minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat});this.render(e);const t=new window.ArrayBuffer(n*r*4),s=new window.Uint8ClampedArray(t),o=new window.Uint8Array(t),a=this.threeRenderer.getContext();a.readPixels(0,0,n,r,a.RGBA,a.UNSIGNED_BYTE,o),i=document.createElement("canvas"),i.width=n,i.height=r;const h=i.getContext("2d"),l=h.createImageData(n,r);l.data.set(s),h.putImageData(l,0,0)}else i=this.threeRenderer.domElement;const o=e.context;o.save();const a=1/(window.devicePixelRatio||1);Cp.useWebGLProperty.value?o.setTransform(1,0,0,-1,0,r):o.setTransform(a,0,0,a,0,0),o.drawImage(i,0,0),o.restore()},this.addChild(this.moleculeNode),this.overlayScene=new THREE.Scene,this.overlayCamera=new THREE.OrthographicCamera,this.overlayCamera.position.z=50,this.addChild(new bg({right:this.layoutBounds.maxX-10,bottom:this.layoutBounds.maxY-10,listener:()=>{e.reset()},tandem:t.createTandem("resetAllButton")})),this.addChild(new v.DbO(new jg(e,t.createTandem("namePanel")),{alignBounds:this.layoutBounds,xAlign:"left",yAlign:"bottom",margin:10}));let s=0,n=!1;const r={down:function(t,r){if(!t.canStartPress())return;if(n)return;let o=null,a=null;const h=t.pointer,l=i.getElectronPairUnderPointer(h,!(h instanceof v.TKz));if(l&&!l.userControlledProperty.value)o="pairExistingSpherical",a=l,l.userControlledProperty.value=!0,s++;else{if(0!==s||!v.Yj2.listener.matrixProperty.value.equalsEpsilon(Gt.Z.IDENTITY,1e-7))return;o="modelRotate",n=!0}const d=h.point.copy();"pairExistingSpherical"===o&&h.reserveForDrag();const c=function(e,t){"pairExistingSpherical"===o?(a.userControlledProperty.value=!1,s--):"modelRotate"===o&&(n=!1),h.removeInputListener(this),h.cursor=null};h.cursor="pointer",h.addInputListener({up:function(e,t){this.endDrag(e,t)},cancel:function(e,t){this.endDrag(e,t)},move:function(t,s){if("modelRotate"===o){const t=h.point.minus(d);d.set(h.point);const s=.007/i.activeScale,n=(new THREE.Quaternion).setFromEuler(new THREE.Euler(t.y*s,t.x*s,0));n.multiply(e.moleculeQuaternionProperty.value),e.moleculeQuaternionProperty.value=n}else"pairExistingSpherical"===o&&_.includes(e.moleculeProperty.value.groups,a)&&a.dragToPosition(i.getSphericalMoleculePosition(h.point,a))},endDrag:c,interrupt:c},!0)}};this.backgroundEventTarget.addInputListener(r),this.backgroundEventTarget.addInputListener({mousemove:e=>{this.backgroundEventTarget.cursor=this.getElectronPairUnderPointer(e.pointer,!1)?"pointer":null}}),e.moleculeQuaternionProperty.link(e=>{this.moleculeView&&(this.moleculeView.quaternion.copy(e),this.moleculeView.updateMatrix(),this.moleculeView.updateMatrixWorld())}),this.angleLabels=[];for(let o=0;o<15;o++)if(Cp.useWebGLProperty.value){const e=new Ng(this.threeRenderer);this.angleLabels.push(e),this.overlayScene.add(e)}else{const e=new Jg;this.angleLabels.push(e),this.addChild(e)}this.layoutListener=()=>{const e=this.screenWidth,t=this.screenHeight;phet.joist.sim.dimensionProperty.value;if(e&&t){const e=this.localToGlobalBounds(new Le.Z(0,0,this.layoutBounds.width,this.layoutBounds.height)),t=this.threeCamera.near*Math.tan(Math.PI/360*this.threeCamera.fov)/this.threeCamera.zoom,i=this.threeCamera.aspect*t,s=new Le.Z(0,0,this.screenWidth,this.screenHeight).shifted(e.center.negated()),n=e.width,r=e.height,o=-i,a=t,h=(s.left*i/(.5*e.width)-o)*n/(2*i),l=(a- -s.top*t/(.5*e.height))*r/(2*t);this.threeCamera.setViewOffset(n,r,h,l,this.screenWidth,this.screenHeight),this.threeCamera.aspect=e.width/e.height,this.threeCamera.updateProjectionMatrix()}this.moleculeNode.invalidateDOM()},v.Yj2.listener.matrixProperty.lazyLink(this.layoutListener),this.hasStepped=!1,this.initialStepListener=()=>{this.step(0)}}static addLightsToScene(e){const t=new THREE.AmbientLight(1644825);e.add(t);const i=new THREE.DirectionalLight(16777215,.8*.9);i.position.set(-1,.5,2),e.add(i);const s=new THREE.DirectionalLight(16777215,.54);s.position.set(2,-1,1),e.add(s)}static createAPIStub(e){return{threeRenderer:e,checkOutLabel:()=>({setLabel:()=>{},unsetLabel:()=>{}}),returnLabel:()=>{}}}showContextLossDialog(){this.contextLossDialog||(this.contextLossDialog=new Pg),this.contextLossDialog.show()}checkOutLabel(){const e=this.angleLabels.pop();return e}returnLabel(e){this.angleLabels.push(e),e.unsetLabel()}addMoleculeView(e){this.threeScene.add(e),this.moleculeView.quaternion.copy(this.model.moleculeQuaternionProperty.value),this.moleculeView.updateMatrix(),this.moleculeView.updateMatrixWorld()}removeMoleculeView(e){this.threeScene.remove(e)}getRaycasterFromScreenPoint(e){const t=2*e.x/this.screenWidth-1,i=2*(1-e.y/this.screenHeight)-1,s=new THREE.Vector3(t,i,0),n=new THREE.Raycaster;return n.setFromCamera(s,this.threeCamera),n}convertScreenPointFromGlobalPoint(e){e.project(this.threeCamera)}getRayFromScreenPoint(e){const t=this.getRaycasterFromScreenPoint(e).ray;return new ng(new kp.Z(0,0,0).set(t.origin),new kp.Z(0,0,0).set(t.direction).normalize())}getElectronPairUnderPointer(e,t){const i=this.getRaycasterFromScreenPoint(e.point).ray,s=i.origin;let n=Number.POSITIVE_INFINITY,r=null;const o=this.moleculeView.radialViews.length;for(let a=0;an?n:r,this.layoutListener(),this.overlayCamera.left=0,this.overlayCamera.right=i,this.overlayCamera.top=0,this.overlayCamera.bottom=s,this.overlayCamera.near=1,this.overlayCamera.far=100,this.overlayCamera.updateProjectionMatrix()),this.hasStepped||phet.joist.sim.frameEndedEmitter.hasListener(this.initialStepListener)||phet.joist.sim.frameEndedEmitter.addListener(this.initialStepListener)}step(e){this.moleculeView.updateView(),this.render(void 0),this.hasStepped||(phet.joist.sim.frameEndedEmitter.removeListener(this.initialStepListener),this.hasStepped=!0)}render(e){this.threeRenderer.render(this.threeScene,this.threeCamera,e),this.threeRenderer.autoClear=!1,this.threeRenderer.render(this.overlayScene,this.overlayCamera,e),this.threeRenderer.autoClear=!0}}$g.cameraPosition=new THREE.Vector3(6,-1.25,40),Vp.register("MoleculeShapesScreenView",$g);const ey=$g;class ty{constructor(e){this.masterGeometry=e,this.renderers=[],this.geometries=[]}get(e){for(let i=0;i{this.setColor(e)}),t.uniformColor&&Cp.toColorProperty(t.uniformColor).link(e=>{this.setUniformColor(e)})}get(e){for(let i=0;i{i.uniforms[e].value=t})}setColor(e){const t=e.toNumber();this.masterMaterial.color.setHex(t),_.each(this.materials,e=>{e.color.setHex(t)})}setUniformColor(e){const t=[e.r/255,e.g/255,e.b/255];this.setUniform("color",t)}}Vp.register("LocalMaterial",sy);const ny=sy,ry=Cp.useWebGLProperty.value?64:12,oy=Cp.useWebGLProperty.value?0:.5,ay=new iy(new THREE.SphereGeometry(2,ry,ry)),hy={},ly=new og(kp.Z.ZERO,2),dy=new og(kp.Z.ZERO,3);class cy extends THREE.Mesh{constructor(e,t,i){super(ay.get(t),i.get(t)),this.group=e,phet.chipper.queryParameters.showPointerAreas&&i!==cy.centralAtomLocalMaterial&&this.add(new THREE.Mesh(new THREE.SphereGeometry(3,ry,ry),new THREE.MeshBasicMaterial({color:16711680,transparent:!0,opacity:.4,depthWrite:!1})))}intersect(e,t){const i=new THREE.Matrix4,s=new THREE.Ray,n=t?dy:ly;i.getInverse(this.matrixWorld),s.copy(e).applyMatrix4(i);const r=n.intersect(new ng(new kp.Z(0,0,0).set(s.origin),new kp.Z(0,0,0).set(s.direction)),1e-5);if(null===r)return null;const o=r.hitPoint;return(new THREE.Vector3).copy(o).applyMatrix4(this.matrixWorld)}static getElementLocalMaterial(e){let t=hy[e.symbol];return t||(t=hy[e.symbol]=new ny(new THREE.MeshLambertMaterial({color:new v.Ilk(e.color).toNumber(),overdraw:oy}))),t}}cy.centralAtomLocalMaterial=new ny(new THREE.MeshLambertMaterial({overdraw:oy}),{color:Tp.centralAtomProperty}),cy.atomLocalMaterial=new ny(new THREE.MeshLambertMaterial({overdraw:oy}),{color:Tp.atomProperty}),Vp.register("AtomView",cy);const uy=cy;class py extends THREE.Object3D{initialize(e,t,i,s,n,r){this.aGroup=s,this.bGroup=n,this.label=r,this.midpoint=null,this.radius=5,this.screenView=e,this.showBondAnglesProperty=t,this.molecule=i,this.viewOpacity=0,this.viewAngle=0,this.midpointUnit=null,this.planarUnit=null}dispose(){this.aGroup=null,this.bGroup=null}updateView(e,t){const i=this.aGroup.orientation,s=this.bGroup.orientation;if(this.viewOpacity=this.showBondAnglesProperty.value?py.calculateBrightness(i,s,t,this.molecule.radialAtoms.length):0,this.viewAngle=Math.acos(I.Z.clamp(i.dot(s),-1,1)),py.isApproximateSemicircle(i,s)){e||(e=kp.Z.Y_UNIT.times(py.radius));const t=e.normalized(),n=i.cross(t).plus(t.cross(s)),r=n.magnitude>0?n.normalized():new kp.Z(0,0,1),o=i.minus(s).normalized();this.planarUnit=o.minus(r.times(r.dot(o))).normalized(),this.midpointUnit=r.cross(this.planarUnit).normalized()}else this.midpointUnit=i.plus(s).normalized(),this.planarUnit=i.minus(this.midpointUnit.times(i.dot(this.midpointUnit))),this.planarUnit.magnitude>0&&this.planarUnit.normalize();if(this.midpoint=this.midpointUnit.times(py.radius),0!==this.viewOpacity){const e=new THREE.Vector3,t=(new THREE.Vector3).copy(this.midpoint);this.parent.localToWorld(e),this.parent.localToWorld(t),this.screenView.convertScreenPointFromGlobalPoint(e),this.screenView.convertScreenPointFromGlobalPoint(t);const n=this.screenView.getLayoutScale(new Le.Z(0,0,this.screenView.screenWidth,this.screenView.screenHeight))*v.Yj2.listener.matrixProperty.value.getScaleVector().x,r=180*i.angleBetween(s)/Math.PI;if(isFinite(e.x)&&isFinite(e.y)){const i=new Ke.Z((e.x+1)*this.screenView.screenWidth/2,(1-e.y)*this.screenView.screenHeight/2),s=new Ke.Z((t.x+1)*this.screenView.screenWidth/2,(1-t.y)*this.screenView.screenHeight/2);let o=I.Z.toFixed(r,1)+"°";for(;o.length<5;)o="0"+o;this.label.setLabel(o,this.viewOpacity,i,s,n)}else this.label.unsetLabel()}else this.label.unsetLabel()}static calculateBrightness(e,t,i,s){if(s<=2)return 1;const n=Math.abs(e.cross(t).dot(i)),r=py.LOW_THRESHOLDS[s],o=py.HIGH_THRESHOLDS[s],a=n/(o-r)-r/(o-r);return I.Z.clamp(a,0,1)}static isApproximateSemicircle(e,t){return Math.acos(I.Z.clamp(e.dot(t),-1,1))>=3.12414}}py.LOW_THRESHOLDS=[0,0,0,.1,.35,.45,.5],py.HIGH_THRESHOLDS=[0,0,0,.5,.55,.65,.75],py.radius=5,Vp.register("BondAngleView",py);const my=py;class gy{constructor(e,t){this.name=e,this.objectFactory=t,this.renderers=[],this.objects=[],this.quantityOutside=0,this.quantityInside=0}get(e){for(let t=0;t{},Vp.register("LocalPool",gy);const yy=gy;class fy extends my{constructor(e){super(),this.renderer=e,this.arcVertices=[];for(let t=0;t<24;t++)this.arcVertices.push(new THREE.Vector3);this.arcGeometry=function(e){const t=new THREE.Geometry;for(let i=0;inew fy(e)),Vp.register("BondAngleFallbackView",fy);const Ay=fy;const by=new iy(function(){const e=new THREE.Geometry;e.vertices.push(new THREE.Vector3(0,0,0));for(let t=0;t<24;t++){const i=t/23;e.vertices.push(new THREE.Vector3(i,my.radius,0))}for(let t=0;t<23;t++)e.faces.push(new THREE.Face3(0,t+1,t+2));return e}()),Py=new iy(function(){const e=new THREE.Geometry;for(let t=0;t<24;t++){const i=t/23;e.vertices.push(new THREE.Vector3(i,my.radius,0))}return e}()),Vy=["uniform float angle;","uniform vec3 midpointUnit;","uniform vec3 planarUnit;","void main() {"," float theta = ( position.x - 0.5 ) * angle;"," vec3 point = position.y * ( cos( theta ) * midpointUnit + sin( theta ) * planarUnit );"," gl_Position = projectionMatrix * modelViewMatrix * vec4( point, 1.0 );","}"].join("\n"),vy=["uniform float opacity;","uniform vec3 color;","void main() {"," gl_FragColor = vec4( color, opacity );","}"].join("\n"),wy={opacity:{type:"f",value:.5},color:{type:"3f",value:[1,1,1]},angle:{type:"f",value:Math.PI/2},midpointUnit:{type:"3f",value:[0,1,0]},planarUnit:{type:"3f",value:[1,0,0]}};class Sy extends my{constructor(e){super(),this.renderer=e,this.arcGeometry=Py.get(e),this.sectorGeometry=by.get(e),this.sectorMaterial=new THREE.ShaderMaterial({vertexShader:Vy,fragmentShader:vy,side:THREE.DoubleSide,transparent:!0,depthWrite:!1,uniforms:JSON.parse(JSON.stringify(wy))}),this.sweepColorListener=e=>{this.sectorMaterial.uniforms.color.value=[e.r/255,e.g/255,e.b/255]},Tp.bondAngleSweepProperty.link(this.sweepColorListener),this.arcMaterial=new THREE.ShaderMaterial({vertexShader:Vy,fragmentShader:vy,transparent:!0,depthWrite:!1,uniforms:JSON.parse(JSON.stringify(wy))}),this.arcColorListener=e=>{this.arcMaterial.uniforms.color.value=[e.r/255,e.g/255,e.b/255]},Tp.bondAngleArcProperty.link(this.arcColorListener),this.sectorView=new THREE.Mesh(this.sectorGeometry,this.sectorMaterial),this.arcView=new THREE.Line(this.arcGeometry,this.arcMaterial),this.sectorView.renderDepth=10,this.arcView.renderDepth=11,this.add(this.sectorView),this.add(this.arcView)}initialize(e,t,i,s,n,r){return super.initialize(e,t,i,s,n,r),this}dispose(){super.dispose(),Sy.pool.put(this,this.renderer)}updateView(e,t){super.updateView(e,t),this.sectorMaterial.uniforms.opacity.value=.5*this.viewOpacity,this.arcMaterial.uniforms.opacity.value=.7*this.viewOpacity,this.sectorMaterial.uniforms.angle.value=this.viewAngle,this.arcMaterial.uniforms.angle.value=this.viewAngle;const i=[this.midpointUnit.x,this.midpointUnit.y,this.midpointUnit.z],s=[this.planarUnit.x,this.planarUnit.y,this.planarUnit.z];this.sectorMaterial.uniforms.midpointUnit.value=i,this.arcMaterial.uniforms.midpointUnit.value=i,this.sectorMaterial.uniforms.planarUnit.value=s,this.arcMaterial.uniforms.planarUnit.value=s}}Sy.pool=new yy("BondAngleWebGLView",e=>new Sy(e)),Vp.register("BondAngleWebGLView",Sy);const Ty=Sy,Ey=Cp.useWebGLProperty.value?32:8,_y=Cp.useWebGLProperty.value?1:8,xy=new iy(new THREE.CylinderGeometry(1,1,1,Ey,_y,!1)),Cy=new ny(new THREE.MeshLambertMaterial({overdraw:Cp.useWebGLProperty.value?0:.5}),{color:Tp.bondProperty});class Iy extends THREE.Object3D{constructor(e,t,i,s,n,r){super(),this.aMaterial=Cy.get(e),this.bMaterial=Cy.get(e),this.bondGeometry=xy.get(e),this.bond=t,this.aPositionProperty=i,this.bPositionProperty=s,this.bondOrder=t.order,this.bondRadius=n,this.maxLength=r,this.aBonds=[],this.bBonds=[];for(let o=0;o{this.add(e)}),_.each(this.bBonds,e=>{this.add(e)})}updateView(e){const t=this.aPositionProperty.value,i=this.bPositionProperty.value,s=i.minus(t).normalized(),n=t.distance(i);let r,o=0;null!==this.maxLength&&n>this.maxLength?(r=this.maxLength,o=n-this.maxLength):r=n;const a=t.times(.5).plus(i.times(.5)).plus(s.times(o/2)),h=a.minus(i).normalized().cross(a.minus(e).normalized()).normalized();let l;const d=2.4*this.bondRadius;switch(this.bondOrder){case 1:l=[new kp.Z(0,0,0)];break;case 2:l=[h.times(d/2),h.times(-d/2)];break;case 3:l=[kp.Z.ZERO,h.times(d),h.times(-d)];break;default:throw new Error("bad bond order: "+this.bondOrder)}const c=s.times(r/4),u=new THREE.Vector3(0,1,0),p=(new THREE.Vector3).copy(s);for(let m=0;m{const t=e.minus(this.parentAtom.positionProperty.value),i=t.normalized();let s;s=t.magnitude>am.LONE_PAIR_DISTANCE?e.minus(i.times(am.LONE_PAIR_DISTANCE)):this.parentAtom.positionProperty.value,this.position.set(s.x,s.y,s.z),this.quaternion.setFromUnitVectors(new THREE.Vector3(0,1,0),(new THREE.Vector3).copy(i))}}initialize(e,t,i){return this.group=e,this.parentAtom=t,this.visibilityProperty=i,this.visibilityListener=i.linkAttribute(this,"visible"),e.positionProperty.link(this.positionListener),this}dispose(){this.visibilityListener&&this.visibilityProperty.unlink(this.visibilityListener),this.group.positionProperty.unlink(this.positionListener),this.group=null,this.parentAtom=null,this.visibilityProperty=null,this.visibilityListener=null,Yy.pool.put(this,this.renderer)}intersect(e,t){const i=new THREE.Matrix4,s=new THREE.Ray,n=t?zy:Hy;i.getInverse(this.shell.matrixWorld),s.copy(e).applyMatrix4(i);const r=n.vertices,o=n.faces.length;for(let a=0;anew Yy(e)),Vp.register("LonePairView",Yy);const Gy=Yy;class Wy extends THREE.Object3D{constructor(e,t,i,s){super(),this.isDisposed=!1,this.model=e,this.screenView=t,this.renderer=t.threeRenderer,this.molecule=i,this.atomViews=[],this.lonePairViews=[],this.bondViews=[],this.angleViews=[],this.radialViews=[],this.addGroupListener=this.addGroup.bind(this),this.removeGroupListener=this.removeGroup.bind(this),this.addBondListener=this.addBond.bind(this),this.removeBondListener=this.removeBond.bind(this),this.molecule.groupAddedEmitter.addListener(this.addGroupListener),this.molecule.groupRemovedEmitter.addListener(this.removeGroupListener),this.molecule.bondAddedEmitter.addListener(this.addBondListener),this.molecule.bondRemovedEmitter.addListener(this.removeBondListener),_.each(i.radialGroups,this.addGroup.bind(this)),_.each(i.getDistantLonePairs(),this.addGroup.bind(this)),_.each(i.getBondsAround(i.centralAtom),this.addBond.bind(this)),i.isReal?this.centerAtomView=new uy(i.centralAtom,this.renderer,uy.getElementLocalMaterial(i.centralAtom.element)):this.centerAtomView=new uy(i.centralAtom,this.renderer,uy.centralAtomLocalMaterial),this.add(this.centerAtomView)}updateView(){const e=(new THREE.Vector3).copy(ey.cameraPosition);this.worldToLocal(e);const t=new kp.Z(0,0,0).set(e).normalized();for(let i=0;i{s.position.set(e.x,e.y,e.z)});for(let e=0;e=0;t--){const i=this.angleViews[t];i.aGroup!==e&&i.bGroup!==e||(this.remove(i),this.screenView.returnLabel(i.label),this.angleViews.splice(t,1),i.dispose())}}for(t=0;t=0;t--){const i=this.bondViews[t];i.bond===e&&(this.remove(i),this.bondViews.splice(t,1))}}hideCentralAtom(){this.centerAtomView.visible=!1}tweakViewScales(e,t,i){this.scale.x=this.scale.y=this.scale.z=e,this.centerAtomView.scale.x=this.centerAtomView.scale.y=this.centerAtomView.scale.z=t,_.each(this.atomViews,e=>{e.scale.x=e.scale.y=e.scale.z=t}),_.each(this.bondViews,e=>{_.each(e.children,t=>{t.scale.x=t.scale.z=i,e.bondOrder>1&&(t.position.y*=2*i)})})}}Vp.register("MoleculeView",Wy);const Uy=Wy,Xy=new THREE.Scene;ey.addLightsToScene(Xy);const Ky=Cp.useWebGLProperty.value?new THREE.WebGLRenderer({antialias:!0,preserveDrawingBuffer:!0,alpha:!0}):new THREE.CanvasRenderer,jy=new THREE.PerspectiveCamera;function Qy(e,t){return t?Math.PI/2:e?I.Z.toRadians(120)/2:I.Z.toRadians(104.5)/2}function Jy(e){return e?.95:1}function $y(e){return e?Op.C:Op.O}function ef(e){return e?Op.O:Op.H}function tf(e,t){const i=Qy(e,t),s=e?void 0:$y(t),n=e?void 0:ef(t),r=t?2:1,o=new eg;e||(o.isReal=!0);const a=new am(new kp.Z(0,0,0),!1,{element:s});o.addCentralAtom(a),o.addGroupAndBond(new am(new kp.Z(Math.sin(i),-Math.cos(i),0).times(am.BONDED_PAIR_DISTANCE),!1,{element:n}),a,r),o.addGroupAndBond(new am(new kp.Z(-Math.sin(i),-Math.cos(i),0).times(am.BONDED_PAIR_DISTANCE),!1,{element:n}),a,r);const h=new ig(!1,{initialMolecule:o},L.Z.OPT_OUT),l=new Uy(h,ey.createAPIStub(Ky),o,{showLabel:()=>{},finishedAddingLabels:()=>{}},L.Z.OPT_OUT);l.updateView();const d=4.5*Jy(t);l.tweakViewScales(d,2,1);const c=function(e,t,i,s){return Xy.add(e),Ky.setClearColor(s?13034230:3355443,1),jy.position.set(0,s?0:-10,200),jy.fov=25,jy.aspect=t/i,jy.near=1,jy.far=300,jy.updateProjectionMatrix(),Ky.setSize(t,i),Ky.render(Xy,jy),Xy.remove(e),Ky.domElement.toDataURL()}(l,Tn.MINIMUM_HOME_SCREEN_ICON_SIZE.width,Tn.MINIMUM_HOME_SCREEN_ICON_SIZE.height,t);return l.dispose(),c}class sf extends v.NBX{constructor(e,t){super(),this.localBounds=Tn.MINIMUM_HOME_SCREEN_ICON_SIZE.toBounds();const i=tf(e,t);this.addChild(new v.Eep(i,{initialWidth:Tn.MINIMUM_HOME_SCREEN_ICON_SIZE.width,initialHeight:Tn.MINIMUM_HOME_SCREEN_ICON_SIZE.height}));const s=e?"A":$y(t).symbol,n=e?"X":ef(t).symbol,r=192*Jy(t),o=Qy(e,t),a=.5*Tn.MINIMUM_HOME_SCREEN_ICON_SIZE.width,h=Tn.MINIMUM_HOME_SCREEN_ICON_SIZE.height*(t?.5:.4);this.addChild(new v.xvT(s,{fontSize:80,fill:"black",centerX:a,centerY:h})),this.addChild(new v.xvT(n,{fontSize:80,fill:"black",centerX:a+Math.sin(o)*r,centerY:h+Math.cos(o)*r})),this.addChild(new v.xvT(n,{fontSize:80,fill:"black",centerX:a-Math.sin(o)*r,centerY:h+Math.cos(o)*r}))}}Vp.register("ScreenIconNode",sf);const nf=sf;class rf extends ig{constructor(e,t){super(e,{initialMolecule:new eg},t),this.moleculeProperty.value.addCentralAtom(new am(new kp.Z(0,0,0),!1)),this.setupInitialMoleculeState()}setupInitialMoleculeState(){const e=this.moleculeProperty.value.centralAtom;this.moleculeProperty.value.addGroupAndBond(new am(new kp.Z(8,0,3).setMagnitude(am.BONDED_PAIR_DISTANCE),!1),e,1),this.moleculeProperty.value.addGroupAndBond(new am(new kp.Z(2,8,-5).setMagnitude(am.BONDED_PAIR_DISTANCE),!1),e,1)}reset(){super.reset(),this.moleculeProperty.value.removeAllGroups(),this.setupInitialMoleculeState()}}Vp.register("ModelMoleculesModel",rf);const of=rf;class af extends v.SHm{constructor(e,t){const i=(0,ae.ZP)()({touchAreaXDilation:5,mouseAreaXDilation:5,spacing:10,align:"left",tandem:L.Z.REQUIRED},t),s=Ft(e,i.tandem),n=[];let r=0;for(let o=0;o{n.forEach(e=>e.dispose()),s.forEach(e=>e.dispose())}}dispose(){this.disposeVerticalCheckboxGroup(),super.dispose()}}mt.register("VerticalCheckboxGroup",af);const hf=new ht(14);class lf extends af{constructor(e,t,i){const s=(0,ae.ZP)()({touchAreaXDilation:10,tandem:t},i);super([...e.isBasicsVersion?[]:[{property:e.showLonePairsProperty,createNode:e=>new v.xvT(Dp.control.showLonePairsStringProperty,{font:hf,fill:Tp.controlPanelTextProperty,tandem:e.createTandem("labelText"),maxWidth:280}),tandemName:"showLonePairsCheckbox",options:(0,ae.JA)({},Cp.checkboxOptions)}],{property:e.showBondAnglesProperty,createNode:e=>new v.xvT(Dp.control.showBondAnglesStringProperty,{font:hf,fill:Tp.controlPanelTextProperty,tandem:e.createTandem("labelText"),maxWidth:280}),tandemName:"showBondAnglesCheckbox",options:Cp.checkboxOptions}],s)}}Vp.register("OptionsNode",lf);const df=lf,cf=new v.y$t((new Qe.bn).moveTo(0,0).lineTo(10,10).moveTo(0,10).lineTo(10,0),{stroke:"#fff",lineWidth:3});class uf extends Xi{constructor(e){super((0,Se.Z)({content:new v.NBX({children:[cf]}),xMargin:5,yMargin:5},e)),Tp.removePairGroupProperty.link(e=>{this.baseColor=e})}}Vp.register("RemovePairGroupButton",uf);const pf=uf,mf=new THREE.Scene;ey.addLightsToScene(mf);const gf=Cp.useWebGLProperty.value?new THREE.WebGLRenderer({antialias:!0,preserveDrawingBuffer:!0,alpha:!0}):new THREE.CanvasRenderer;Tp.backgroundProperty.link(e=>gf.setClearColor(e.toNumber(),1));const yf=new THREE.OrthographicCamera;yf.position.set(0,0,40),yf.near=1,yf.far=100;function ff(e){const t=new eg,i=new am(new kp.Z(0,0,0),!1);t.addCentralAtom(i),t.addGroupAndBond(new am(kp.Z.X_UNIT.times(0===e?am.LONE_PAIR_DISTANCE:am.BONDED_PAIR_DISTANCE),0===e),i,e);const s=new ig(!1,{initialMolecule:t},L.Z.OPT_OUT),n=new Uy(s,ey.createAPIStub(gf),t,{showLabel:()=>{},finishedAddingLabels:()=>{}},L.Z.OPT_OUT);n.updateView(),n.hideCentralAtom();const r=function(e,t,i,s){return mf.add(e),yf.left=0,yf.right=s,yf.top=s*i/t/2,yf.bottom=-s*i/t/2,yf.updateProjectionMatrix(),gf.setSize(t,i),gf.render(mf,yf),mf.remove(e),gf.domElement}(n,3*(0===e?78:120),3*(0===e?55:42),0===e?1.07*am.LONE_PAIR_DISTANCE:1.22*am.BONDED_PAIR_DISTANCE);let o=r.toDataURL();if(n.dispose(),Me.Z.firefox){const e=document.createElement("canvas"),t=e.getContext("2d");e.width=r.width,e.height=r.height,t.drawImage(r,0,0),o=v.E0.createFastMipmapFromCanvas(e)}return o}class Af extends v.BET{constructor(e,t,i,s,n,r){super({tandem:n,align:"center",widthSizable:!1}),this.model=e,this.bondOrder=t;let o=!0,a=0;const h=new v.AeJ(0,0,120,0!==t?42:55,0,0,r);h.addInputListener({enter:()=>{a++,m()},exit:()=>{a--,m()}}),h.addInputListener(new v.eMb({canStartPress:()=>o,tandem:n.createTandem("fireListener"),fireOnDown:!0,fire:()=>i(t,h.localToGlobalBounds(h.localBounds))})),h.touchArea=h.localBounds.dilatedY(4).withMinX(-10);const l=new v.Eep(ff(t),{scale:1/3});function d(){l.image=ff(t)}l.localBounds=0===t?new Le.Z(0,0,234,165):new Le.Z(0,0,360,126),l.center=h.center,0===t?(Tp.lonePairShellProperty.lazyLink(d),Tp.lonePairElectronProperty.lazyLink(d)):(Tp.atomProperty.lazyLink(d),Tp.bondProperty.lazyLink(d)),Tp.backgroundProperty.lazyLink(d),0===t&&(l.right=h.right-10);const c=new v.NBX({children:[l,h]}),u=new pf({listener:()=>{s(t)},visiblePropertyOptions:{phetioReadOnly:!0},enabledPropertyOptions:{phetioReadOnly:!0},touchAreaXShift:5,touchAreaXDilation:15,touchAreaYDilation:14,tandem:n.createTandem("removeButton")});function p(){o=e.moleculeProperty.value.wouldAllowBondOrder(t),0===t&&(o=o&&e.showLonePairsProperty.value),h.cursor=o?"pointer":null,u.visible=_.filter(e.moleculeProperty.value.getBondsAround(e.moleculeProperty.value.centralAtom),e=>e.order===t).length>0,m()}function m(){let e;e=o?a>0?0:.1:.4,h.fill=Tp.backgroundProperty.value.withAlpha(e)}e.moleculeProperty.link((e,t)=>{t&&t.bondChangedEmitter.removeListener(p),e&&e.bondChangedEmitter.addListener(p),p()}),e.showLonePairsProperty.link(p),Cm.maxConnectionsProperty.lazyLink(p),Tp.backgroundProperty.lazyLink(p),this.mutate((0,Se.Z)({children:[c,u],spacing:10,align:"center",excludeInvisibleChildrenFromBounds:!1},r))}}Vp.register("BondGroupNode",Af);const bf=Af;class Pf extends ey{constructor(e,t){super(e,t),this.model=e,this.moleculeView=new Uy(e,this,e.moleculeProperty.value,t.createTandem("moleculeView")),this.addMoleculeView(this.moleculeView);const i=this.addPairGroup.bind(this),s=this.removePairGroup.bind(this),n=t.createTandem("optionsPanel"),r=t.createTandem("bondingPanel"),o=e.isBasicsVersion?L.Z.OPT_OUT:t.createTandem("lonePairPanel"),a=new df(e,n.createTandem("optionsCheckboxGroup")),h=new v.SHm({children:[new bf(e,1,i,s,r.createTandem("singleBondNode"),{}),new bf(e,2,i,s,r.createTandem("doubleBondNode"),{}),new bf(e,3,i,s,r.createTandem("tripleBondNode"),{})],spacing:10,align:"center"}),l=new bf(e,0,i,s,o.createTandem("lonePairNode"),{}),d=new Ac(Dp.control.removeAllStringProperty,{baseColor:Tp.removeButtonBackgroundProperty,font:new ht(16),textFill:Tp.removeButtonTextProperty.value,maxTextWidth:260,textNodeOptions:{tandem:L.Z.OPT_OUT},layoutOptions:{topMargin:5,align:"center",stretch:!1},touchAreaXDilation:30,touchAreaYDilation:10,listener:()=>{e.moleculeProperty.value.removeAllGroups()},tandem:t.createTandem("removeAllButton"),enabledPropertyOptions:{phetioReadOnly:!0}});function c(){d.enabled=e.moleculeProperty.value.radialGroups.length>0}e.moleculeProperty.link((e,t)=>{t&&t.bondChangedEmitter.removeListener(c),e&&e.bondChangedEmitter.addListener(c),c()});const u=new v.N52({spacing:15,orientation:"vertical",stretch:!0,children:[new Hg(Dp.control.bondingStringProperty,h,r,{tandem:r,align:"center"}),...e.isBasicsVersion?[]:[new Hg(Dp.control.lonePairStringProperty,l,o,{tandem:o,align:"center"})],d,new Hg(Dp.control.optionsStringProperty,a,n,{layoutOptions:{topMargin:10},tandem:n})]});this.addChild(new v.DbO(u,{alignBounds:this.layoutBounds,xAlign:"right",yAlign:"top",margin:10})),e.moleculeProperty.lazyLink((i,s)=>{this.removeMoleculeView(this.moleculeView),this.moleculeView.dispose(),this.moleculeView=new Uy(e,this,i,t.createTandem("moleculeView")),this.addMoleculeView(this.moleculeView)})}addPairGroup(e,t){const i=t.leftCenter,s=this.getPlanarMoleculePosition(i),n=new am(new kp.Z(0,0,0).set(s).multiplyScalar(1.2),0===e);this.model.moleculeProperty.value.addGroupAndBond(n,this.model.moleculeProperty.value.centralAtom,e,0===e?am.LONE_PAIR_DISTANCE:am.BONDED_PAIR_DISTANCE)}removePairGroup(e){const t=this.model.moleculeProperty.value,i=t.getBondsAround(t.centralAtom);for(let s=i.length-1;s>=0;s--)if(i[s].order===e){const e=i[s].getOtherAtom(t.centralAtom);t.removeGroup(e);break}}}Vp.register("ModelMoleculesScreenView",Pf);const Vf=Pf;class vf extends Tn{constructor(e,t){super(()=>new of(e,t.createTandem("model")),e=>new Vf(e,t.createTandem("view")),{name:Dp.screen.modelStringProperty,backgroundColorProperty:Tp.backgroundProperty,homeScreenIcon:new pn(new nf(!0,e),{maxIconWidthProportion:1,maxIconHeightProportion:1}),tandem:t})}}Vp.register("ModelMoleculesScreen",vf);const wf=vf;class Sf extends ig{constructor(e,t){const i=e?Jm.TAB_2_BASIC_MOLECULES:Jm.TAB_2_MOLECULES,s=i[0];super(e,{initialMolecule:new Dm(s),phetioType:Tf},t),this.realMoleculeShapeProperty=new be.Z(s,{tandem:t.createTandem("realMoleculeShapeProperty"),phetioValueType:Jm.RealMoleculeShapeIO,validValues:i,phetioState:!1}),this.showRealViewProperty=new S.Z(!0,{tandem:e?L.Z.OPT_OUT:t.createTandem("showRealViewProperty"),phetioState:!1}),this.showRealViewProperty.lazyLink(()=>this.rebuildMolecule(!1)),this.realMoleculeShapeProperty.lazyLink(()=>{this.rebuildMolecule(!0),this.moleculeQuaternionProperty.reset()})}reset(){super.reset(),this.realMoleculeShapeProperty.reset(),this.showRealViewProperty.reset(),this.rebuildMolecule(!0)}rebuildMolecule(e){const t=this.moleculeProperty.value,i=this.realMoleculeShapeProperty.value.centralAtomCount,s=this.realMoleculeShapeProperty.value.centralAtom.lonePairCount,n=Tm.getConfiguration(i,s);let r,o,a;if(r=e?new Dm(this.realMoleculeShapeProperty.value):t,this.showRealViewProperty.value){if(o=new Dm(this.realMoleculeShapeProperty.value),!e){const e=new Dm(this.realMoleculeShapeProperty.value).radialGroups;a=ym.findClosestMatchingConfiguration(ym.getOrientationsFromOrigin(r.radialGroups),_.map(e,e=>e.orientation),Am.vseprPermutations(r.radialGroups)),_.each(o.groups,e=>{e!==o.centralAtom&&(e.positionProperty.value=a.rotateVector(e.positionProperty.value))})}}else{a=n.getIdealGroupRotationToPositions(r.radialGroups);const e=a.permutation.inverted(),t=n.allOrientations;o=new eg;const h=new am(new kp.Z(0,0,0),!1);o.addCentralAtom(h);for(let n=0;ne.isLonePair).length)}}}e||(o.lastMidpoint=t.lastMidpoint),this.moleculeProperty.value=o}}const Tf=new Te.Z("RealMoleculesModelIO",{supertype:ig.MoleculeShapesModelIO,valueType:Sf,stateSchema:{realMoleculeShape:Jm.RealMoleculeShapeIO,showRealView:Ee.Z},toStateObject:e=>{const t=ig.MoleculeShapesModelIO.toStateObject(e);return t.realMoleculeShape=Jm.RealMoleculeShapeIO.toStateObject(e.realMoleculeShapeProperty.value),t.showRealView=e.showRealViewProperty.value,t},applyState:(e,t)=>{e.realMoleculeShapeProperty.value=Jm.RealMoleculeShapeIO.fromStateObject(t.realMoleculeShape),e.showRealViewProperty.value=t.showRealView,ig.MoleculeShapesModelIO.applyState(e,t)}});Sf.RealMoleculesModelIO=Tf,Vp.register("RealMoleculesModel",Sf);const Ef=Sf,_f={createSymbol:function(e){return _f.toSubscript(_f.createSymbolWithoutSubscripts(e))},createSymbolWithoutSubscripts:function(e){let t="",i=1;const s=e.length;for(let n=0;n1&&(t+=i),i=1,t+=e[n].symbol);return i>1&&(t+=i),t},nonCarbonHillSortValue:function(e){let t=1e3*e.symbol.charCodeAt(0);return e.symbol.length>1&&(t+=e.symbol.charCodeAt(1)),t},carbonHillSortValue:function(e){return e.isCarbon()?0:e.isHydrogen()?1:_f.nonCarbonHillSortValue(e)},toSubscript:function(e){let t="",i=!1;const s=e=>e>="0"&&e<="9";for(let n=0;n",i=!0):i&&!s(r)&&(t+="",i=!1),t+=r}return i&&(t+="",i=!1),t},hillOrderedSymbol:function(e){const t=_.some(e,e=>e.isCarbon())?_f.carbonHillSortValue:_f.nonCarbonHillSortValue,i=_.sortBy(e,t);return _f.createSymbol(i)}};Mp.register("ChemUtils",_f);const xf=_f;class Cf extends ey{constructor(e,t){super(e,t),this.model=e,this.moleculeView=new Uy(e,this,e.moleculeProperty.value,t.createTandem("moleculeView")),this.addMoleculeView(this.moleculeView);const i=t.createTandem("moleculePanel"),s=t.createTandem("optionsPanel"),n=new v.NBX,r=_.map(e.realMoleculeShapeProperty.validValues,e=>({value:e,node:new v.Hof(xf.toSubscript(e.displayName)),tandemName:`${e.displayName}${Fh.ITEM_TANDEM_NAME_SUFFIX}`})),o=new Fh(e.realMoleculeShapeProperty,r,n,{xMargin:13,yMargin:10,cornerRadius:8,tandem:i.createTandem("moleculeComboBox"),widthSizable:!1}),a=new df(e,s.createTandem("optionsCheckboxGroup")),h=new v.N52({spacing:15,orientation:"vertical",stretch:!0,children:[new Hg(Dp.control.moleculeStringProperty,o,i,{tandem:i,align:"center"}),new Hg(Dp.control.optionsStringProperty,a,s,{tandem:s})]});if(this.addChild(new v.DbO(h,{alignBounds:this.layoutBounds,xAlign:"right",yAlign:"top",margin:10})),this.addChild(n),!e.isBasicsVersion){const i=this.layoutBounds.width/2-100,s=30,n=.7,r=new zt(e.showRealViewProperty,[{createNode:e=>new v.xvT(Dp.control.realView,{font:new ht(28),fill:Tp.controlPanelTextProperty,tandem:e.createTandem("text"),stringProperty:Dp.control.realViewStringProperty}),value:!0,tandemName:"realRadioButton"},{createNode:e=>new v.xvT(Dp.control.modelView,{font:new ht(28),fill:Tp.controlPanelTextProperty,tandem:e.createTandem("text"),stringProperty:Dp.control.modelViewStringProperty}),value:!1,tandemName:"modelRadioButton"}],{radioButtonOptions:{radius:16,scale:n,maxWidth:320},tandem:t.createTandem("realModelRadioButtonGroup"),touchAreaYDilation:10,spacing:s,orientation:"horizontal"});r.localBoundsProperty.link(()=>{r.top=this.layoutBounds.top+20,r.centerX=i}),this.addChild(r)}e.moleculeProperty.lazyLink((i,s)=>{this.removeMoleculeView(this.moleculeView),this.moleculeView.dispose(),this.moleculeView=new Uy(e,this,i,t.createTandem("moleculeView")),this.addMoleculeView(this.moleculeView)})}}Vp.register("RealMoleculesScreenView",Cf);const If=Cf;class Df extends Tn{constructor(e,t){super(()=>new Ef(e,t.createTandem("model")),e=>new If(e,t.createTandem("view")),{name:Dp.screen.realMoleculesStringProperty,backgroundColorProperty:Tp.backgroundProperty,homeScreenIcon:new pn(new nf(!1,e),{maxIconWidthProportion:1,maxIconHeightProportion:1}),tandem:t})}}Vp.register("RealMoleculesScreen",Df);const Lf=Df;class kf extends v.BET{constructor(){const e=new v.xvT(ct.webglWarning.titleStringProperty,{font:new ht(14),fill:"#ddd"}),t=new v.xvT(ct.webglWarning.bodyStringProperty,{font:new ht(10),fill:"#999"});super({children:[new v.y$t(fc,{fill:"#E87600",scale:.048}),new v.SHm({children:[e,t],spacing:3,align:"left"})],spacing:12,align:"center",cursor:"pointer"}),this.mouseArea=this.touchArea=this.localBounds,this.addInputListener({up:function(){(0,v.MwI)("https://phet.colorado.edu/webgl-disabled-page?simLocale="+phet.joist.sim.locale)}}),this.disposeCanvasWarningNode=()=>{e.dispose(),t.dispose()}}dispose(){this.disposeCanvasWarningNode(),super.dispose()}}Be.register("CanvasWarningNode",kf);const Mf=new N.Z("moleculeShapesBasics"),Of=(0,lt.Z)("MOLECULE_SHAPES_BASICS");Mf.register("MoleculeShapesBasicsStrings",Of);const Nf=Of["molecule-shapes-basics"].titleStringProperty,Rf={credits:{leadDesign:"Emily B. Moore",softwareDevelopment:"Jonathan Olson",team:"Julia Chamberlain, Kelly Lancaster, Ariel Paul, Kathy Perkins, Amy Rouinfar",qualityAssurance:"Steele Dalton, Jaron Droder, Bryce Griebenow, Clifford Hardin, Brooklyn Lash, Emily Miller, Elise Morgan, Liam Mulhall, Oliver Orejola, Jacob Romero, Nancy Salpepi, Kathryn Woessner, Bryan Yoelin"},webgl:!0,preferencesModel:new _e({simulationOptions:{customPreferences:[]},visualOptions:{supportsProjectorMode:!0}}),homeScreenWarningNode:Cp.useWebGLProperty.get()?null:new kf};Pp.launch(()=>{new mp(Nf,[new wf(!0,L.Z.ROOT.createTandem("modelScreen")),new Lf(!0,L.Z.ROOT.createTandem("realMoleculesScreen"))],Rf).start()})})()})()};

‪Molecule Shapes: Basics‬ (2024)
Top Articles
Latest Posts
Article information

Author: Manual Maggio

Last Updated:

Views: 6578

Rating: 4.9 / 5 (49 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Manual Maggio

Birthday: 1998-01-20

Address: 359 Kelvin Stream, Lake Eldonview, MT 33517-1242

Phone: +577037762465

Job: Product Hospitality Supervisor

Hobby: Gardening, Web surfing, Video gaming, Amateur radio, Flag Football, Reading, Table tennis

Introduction: My name is Manual Maggio, I am a thankful, tender, adventurous, delightful, fantastic, proud, graceful person who loves writing and wants to share my knowledge and understanding with you.