@arcgis/map-components 5.0.0-next.170 → 5.0.0-next.171

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/cdn/{W464NEUQ.js → 4ITR6UMJ.js} +1 -1
  2. package/dist/cdn/{3AYU4UID.js → DUYG46XN.js} +1 -1
  3. package/dist/cdn/{67G4OVIE.js → KRRRO6DS.js} +1 -1
  4. package/dist/cdn/{EGCQFNG3.js → PLMTV34R.js} +1 -1
  5. package/dist/cdn/SLLNF2VM.js +2 -0
  6. package/dist/cdn/{GNCHWVNF.js → TAV52LGP.js} +1 -1
  7. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.en.json +1 -1
  8. package/dist/cdn/index.js +1 -1
  9. package/dist/cdn/main.css +1 -1
  10. package/dist/components/arcgis-daylight/customElement.js +141 -139
  11. package/dist/components/arcgis-feature-templates-legacy/customElement.d.ts +126 -0
  12. package/dist/components/{arcgis-feature-templates → arcgis-feature-templates-legacy}/customElement.js +2 -2
  13. package/dist/components/arcgis-paste/customElement.js +2 -2
  14. package/dist/components/arcgis-paste/index.js +1 -1
  15. package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +15 -8
  16. package/dist/components/arcgis-utility-network-trace-location/customElement.js +1 -1
  17. package/dist/components/arcgis-utility-network-trace-results/customElement.js +34 -31
  18. package/dist/docs/api.json +1 -1
  19. package/dist/docs/docs.json +1 -1
  20. package/dist/docs/vscode.html-custom-data.json +1 -1
  21. package/dist/docs/web-types.json +1 -1
  22. package/dist/index.d.ts +7 -7
  23. package/dist/loader.js +1 -1
  24. package/dist/types/lumina.d.ts +7 -7
  25. package/dist/types/preact.d.ts +8 -8
  26. package/dist/types/react.d.ts +9 -9
  27. package/dist/types/stencil.d.ts +7 -7
  28. package/package.json +4 -4
  29. package/dist/cdn/2KXVCJMQ.js +0 -2
  30. package/dist/components/arcgis-feature-templates/customElement.d.ts +0 -218
  31. /package/dist/components/{arcgis-feature-templates → arcgis-feature-templates-legacy}/index.d.ts +0 -0
  32. /package/dist/components/{arcgis-feature-templates → arcgis-feature-templates-legacy}/index.js +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{a as v}from"./CAYSZWRK.js";import"./UFWKXIL5.js";import"./KCQB4NNK.js";import"./ZNBKMZP7.js";import{O as T,U as _,a as L,b as f,p as c,x as y}from"./MQTZFCXF.js";import"./ALDX5YZO.js";export default $arcgis.t(([S,m,u,x,I,P,b,w])=>{var C=L`calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}.add-location-button{--calcite-button-border-color: var(--calcite-color-border-1);--calcite-button-icon-color: var(--calcite-color-text-1);--calcite-button-text-color: var(--calcite-color-text-1)}.button-container{justify-content:center;display:grid}.clear-button{--calcite-button-border-color: transparent}`,k=class extends T{constructor(){super(...arguments),this.messages=v({blocking:!0}),this.isSelectWaiting=!1,this.traceLocationType="starting-point",this.spatialTolerance=.05,this.autoDestroyDisabled=!1,this.arcgisTraceLocationChange=y(),this.arcgisTraceLocationSelectEnd=y(),this.arcgisTraceLocationSelectStart=y()}static{this.properties={isSelectWaiting:16,beforeTraceLocationSelectStart:0,afterHitTest:0,view:0,traceLocationType:1,traceLocations:0,filterLayers:0,sketchViewModel:0,flagLayer:0,spatialTolerance:9,autoDestroyDisabled:5,utilityNetwork:0}}static{this.styles=C}async destroy(){this._resetAfterSketch(!1),await this.manager.destroy()}async load(){u.isLoaded()||await u.load()}_createPolyline(t,e){return new x({hasZ:!1,hasM:!0,paths:t,spatialReference:new I({wkid:e})})}_calculatePercentAlong(t,e){let r=t.spatialReference,a=this._createPolyline(t.paths,r.wkid),n=e.x-.5,o=e.x+.5,s=e.y-.5,i=e.y+.5,l=[[[n,s],[o,i]]],h=this._createPolyline(l,e.spatialReference.wkid),d=u.execute(h,r);if(!d)return c("error",this,"Unable to project flag geometry to source geometry spatial reference."),.5;let p=S.execute(a,d);if(p.length>0){let A=m.execute(a,{unit:"feet"}),g;return p[0].paths[0][0][0]===a.paths[0][0][0]?g=m.execute(p[0],{unit:"feet"}):p.length>1?g=m.execute(p[1],{unit:"feet"}):g=0,g/A}return c("warn",this,"Unable to cut the source geometry with the flag geometry."),.5}async _ensureNecessaryAttributes(t){let e=(t.layer?.type,t.layer),r=e.fieldsIndex?.get("assetgroup")??!1,a=e.fieldsIndex?.get("assetgroup")?.name??"assetgroup",n=e.fieldsIndex?.get("assettype")??!1,o=e.fieldsIndex?.get("assettype")?.name??"assettype",s=t.getGlobalId(),i=t.getObjectId(),l=r?!!t.getAttribute(a):!0,h=n?!!t.getAttribute(o):!0;if(s&&i&&l&&h)return t;let d=e.createQuery();return d.objectIds=[i],(await e.queryFeatures(d))?.features[0]||null}async _ensureNecessaryAttributesAndGenerateTraceLocation(t,e){let{view:r}=this;if(!r||t.length===0){c("error",this,"`view` is unavailable or there are no results to process.");return}let a=t[0],n=t.map(i=>{let l=i,h=l.graphic;return h.origin=l.layer,h}),o=this.afterHitTest?await this.afterHitTest(n).catch(()=>(this._resetAfterSketch(!0),null)):a.graphic;if(!o){c("error",this,"No graphic available from hit test results.");return}let s=await this._ensureNecessaryAttributes(o);if(!s){c("error",this,"Unable to ensure necessary attributes on the selected graphic.");return}await this._generateTraceLocation(s,e)}_createFlagSymbol(){let{traceLocationType:t}=this,e=[244,21,21,.6],r=[21,244,21,.6];return t==="stopping-point"?new w({color:e,style:"x",size:12,outline:{color:e,width:2}}):t==="barrier"?new w({color:e,style:"square",size:12,outline:{color:e,width:0}}):new w({color:r,style:"circle",size:12,outline:{color:r,width:0}})}_addFlagGraphic(t,e,r){let{flagLayer:a,view:n}=this;if(!a||!n)return c("error",this,"The properties `flagLayer` and `view` are required but either one or both are missing."),null;let o=e.geometry?.type;if(this.traceLocations?.some(l=>l.traceLocation.globalId===t)&&o!=="polyline")return c("warn",this,"A flag with the same globalId already exists."),null;let s=this._createFlagSymbol(),i=new P({geometry:r,symbol:s,attributes:e.attributes});return a.add(i),i}async _generateItemTitle(t){let{messages:e}=this,r=(t.layer?.type,t.layer);return("getFeatureTitle"in r?await r.getFeatureTitle(t):null)||t?.getObjectId()?.toString()||e.labels.unknown}async _generateFlagInfo(t,e){let{traceLocationType:r,utilityNetwork:a}=this,n=t.getGlobalId()??"",o=t.geometry?.type,s=await this._generateItemTitle(t);if(o==="point"||o==="polygon"){let i=a?.getTerminalConfiguration(t),l=i?i.terminals[0].id:1;return{traceLocation:new b({type:r,isFilterBarrier:!1,globalId:n,terminalId:l}),flagProperties:{title:s,expanded:!1,terminalConfiguration:i??void 0,selectedTerminals:i?new Set([l]):void 0},spatialProperties:{mapPoint:e,mapGraphic:t}}}else if(o==="polyline"){let i=this._calculatePercentAlong(t.geometry,e);return{traceLocation:new b({type:r,isFilterBarrier:!1,globalId:n,percentAlong:i}),flagProperties:{title:s,expanded:!1},spatialProperties:{mapPoint:e,mapGraphic:t}}}else if(!o){let i=a?.getTerminalConfiguration(t),l=i?i.terminals[0].id:1;return{traceLocation:new b({type:r,isFilterBarrier:!1,globalId:n,terminalId:l}),flagProperties:{title:s,expanded:!1,terminalConfiguration:i??void 0,selectedTerminals:i?new Set([l]):void 0},spatialProperties:{mapPoint:e}}}return null}async _generateTraceLocation(t,e){let{traceLocations:r}=this,a=t.getGlobalId()??"",n=t.geometry?.type,o=await this._generateFlagInfo(t,e);if(!o){c("error",this,"Unable to generate flag info for trace location.");return}let s=r?.filter(i=>i.spatialProperties.mapGraphic?.getGlobalId()===a)??[];if(s.length===0||n==="polyline"){if(n==="polyline"&&s.length>0&&s.some(l=>Math.abs(l.traceLocation.percentAlong-o.traceLocation.percentAlong)<=this.spatialTolerance)){c("warn",this,"A flag with the same globalId already exists within tolerance.");return}let i=this._addFlagGraphic(a,t,e);if(!i){c("warn",this,"Unable to add flag graphic.");return}o.spatialProperties.flagGraphic=i,r?.add(o);return}c("warn",this,"A flag with the same globalId already exists.")}async _hitTest(t){let{view:e,utilityNetwork:r}=this;if(!e||!r)return c("error",this,"Either `utilityNetwork` or `view` is unavailable for hit test."),!0;let a=t.graphic?.geometry,n=this.view?.toScreen(a);if(!n)return c("warn",this,"No screen point available for hit test."),!1;let o=(await e.hitTest(n,{include:this.filterLayers})).results.filter(s=>s.type==="graphic"&&s?.layer&&s.graphic);return o.length===0?(c("info",this,"No usable hit test results found."),!1):(await this._ensureNecessaryAttributesAndGenerateTraceLocation(o,a),this._resetAfterSketch(!0),!0)}_resetAfterSketch(t=!1){let{view:e}=this;if(!e){c("error",this,"View is not available to reset after sketch.");return}this._clickHandler?.remove(),this._clickHandler=void 0,"acquireCursor"in e&&e.acquireCursor("default"),t&&this.arcgisTraceLocationSelectEnd.emit()}_handleSketchComplete(t){let{sketchViewModel:e,view:r}=this;if(!e||!r){c("error",this,"Either `sketchViewModel` or `view` is not available in sketch complete handler.");return}if(t.state==="complete"&&t.graphic){e.layer.remove(t.graphic),this._hitTest(t).then(a=>{a?this._resetAfterSketch():this._initiateHitTest()});return}t.state==="cancel"&&this._resetAfterSketch(!0)}async _initiateHitTest(){let{view:t,sketchViewModel:e}=this;if(!t||!e){c("error",this,"Cannot initiate hit test; either `view` or `sketchViewModel` not found.");return}this._clickHandler?.remove(),this._clickHandler=e.on("create",this._handleSketchComplete.bind(this)),"acquireCursor"in t&&t.acquireCursor("crosshair"),this.sketchViewModel?.create("point")}async _handleAddButtonClick(){let{view:t,sketchViewModel:e}=this;if(!(t&&e)){c("error",this,"Cannot add trace location; `view` not found.");return}if(this.beforeTraceLocationSelectStart){this.isSelectWaiting=!0;try{await this.beforeTraceLocationSelectStart()}finally{this.isSelectWaiting=!1}}this.arcgisTraceLocationSelectStart.emit({cancelSelect:()=>e.cancel()}).defaultPrevented||await this._initiateHitTest()}_handleClearButtonClick(){let{flagLayer:t,traceLocations:e}=this;e?.forEach(r=>{r.spatialProperties.flagGraphic&&t&&t.remove(r.spatialProperties.flagGraphic)}),e?.removeAll()}renderAddLocationBlock(){let{traceLocationType:t,messages:e,traceLocations:r}=this,a=t==="starting-point"?e.types.startingPoint:t==="barrier"?e.types.barrier:e.types.stoppingPoint,n=a.heading,o=a.description,s=a.buttonText;return f`<calcite-block .heading=${n} .label=${n} expanded .description=${o}>${r?.length?f`<calcite-button class="clear-button" slot=actions-end appearance=transparent .label=${e.buttons.clear} @click=${()=>this._handleClearButtonClick()}>${e.buttons.clear}</calcite-button>`:null}<arcgis-utility-network-trace-location-list .traceLocations=${r} .traceLocationType=${t}></arcgis-utility-network-trace-location-list><div class="button-container"><calcite-button .loading=${this.isSelectWaiting} class="add-location-button" icon-start=select appearance=outline .label=${s} @click=${()=>this._handleAddButtonClick()}>${s}</calcite-button></div></calcite-block>`}render(){return f`<div class="root">${this.renderAddLocationBlock()}</div>`}};_("arcgis-utility-network-trace-location",k);return k},"geometry/operators/cutOperator","geometry/operators/lengthOperator","geometry/operators/projectOperator","geometry/Polyline","geometry/SpatialReference","Graphic","rest/networks/support/TraceLocation","symbols/SimpleMarkerSymbol")
2
+ import{a as v}from"./CAYSZWRK.js";import"./UFWKXIL5.js";import"./KCQB4NNK.js";import"./ZNBKMZP7.js";import{O as L,U as T,a as _,b as f,p as c,x as y}from"./MQTZFCXF.js";import"./ALDX5YZO.js";export default $arcgis.t(([S,m,u,x,I,P,b,w])=>{var C=_`calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}.add-location-button{--calcite-button-border-color: var(--calcite-color-border-1);--calcite-button-icon-color: var(--calcite-color-text-1);--calcite-button-text-color: var(--calcite-color-text-1)}.button-container{justify-content:center;display:grid}.clear-button{--calcite-button-border-color: transparent}`,k=class extends L{constructor(){super(...arguments),this.messages=v({blocking:!0}),this.isSelectWaiting=!1,this.traceLocationType="starting-point",this.spatialTolerance=.05,this.autoDestroyDisabled=!1,this.arcgisTraceLocationChange=y(),this.arcgisTraceLocationSelectEnd=y(),this.arcgisTraceLocationSelectStart=y()}static{this.properties={isSelectWaiting:16,beforeTraceLocationSelectStart:0,afterHitTest:0,view:0,traceLocationType:1,traceLocations:0,filterLayers:0,sketchViewModel:0,flagLayer:0,spatialTolerance:9,autoDestroyDisabled:5,utilityNetwork:0}}static{this.styles=C}async destroy(){this._resetAfterSketch(!1),await this.manager.destroy()}async load(){u.isLoaded()||await u.load()}_createPolyline(t,e){return new x({hasZ:!1,hasM:!0,paths:t,spatialReference:new I({wkid:e})})}_calculatePercentAlong(t,e){let r=t.spatialReference,a=this._createPolyline(t.paths,r.wkid),n=e.x-.5,o=e.x+.5,s=e.y-.5,i=e.y+.5,l=[[[n,s],[o,i]]],h=this._createPolyline(l,e.spatialReference.wkid),d=u.execute(h,r);if(!d)return c("error",this,"Unable to project flag geometry to source geometry spatial reference."),.5;let p=S.execute(a,d);if(p.length>0){let A=m.execute(a,{unit:"feet"}),g;return p[0].paths[0][0][0]===a.paths[0][0][0]?g=m.execute(p[0],{unit:"feet"}):p.length>1?g=m.execute(p[1],{unit:"feet"}):g=0,g/A}return c("warn",this,"Unable to cut the source geometry with the flag geometry."),.5}async _ensureNecessaryAttributes(t){let e=(t.layer?.type,t.layer),r=e.fieldsIndex?.get("assetgroup")??!1,a=e.fieldsIndex?.get("assetgroup")?.name??"assetgroup",n=e.fieldsIndex?.get("assettype")??!1,o=e.fieldsIndex?.get("assettype")?.name??"assettype",s=t.getGlobalId(),i=t.getObjectId(),l=r?!!t.getAttribute(a):!0,h=n?!!t.getAttribute(o):!0;if(s&&i&&l&&h)return t;let d=e.createQuery();return d.objectIds=[i],(await e.queryFeatures(d))?.features[0]||null}async _ensureNecessaryAttributesAndGenerateTraceLocation(t,e){let{view:r}=this;if(!r||t.length===0){c("error",this,"`view` is unavailable or there are no results to process.");return}let a=t[0],n=t.map(i=>{let l=i,h=l.graphic;return h.origin=l.layer,h}),o=this.afterHitTest?await this.afterHitTest(n).catch(()=>(this._resetAfterSketch(!0),null)):a.graphic;if(!o){c("error",this,"No graphic available from hit test results.");return}let s=await this._ensureNecessaryAttributes(o);if(!s){c("error",this,"Unable to ensure necessary attributes on the selected graphic.");return}await this._generateTraceLocation(s,e)}_createFlagSymbol(){let{traceLocationType:t}=this,e=[244,21,21,.6],r=[21,244,21,.6];return t==="stopping-point"?new w({color:e,style:"x",size:12,outline:{color:e,width:2}}):t==="barrier"?new w({color:e,style:"square",size:12,outline:{color:e,width:0}}):new w({color:r,style:"circle",size:12,outline:{color:r,width:0}})}_addFlagGraphic(t,e,r){let{flagLayer:a,view:n}=this;if(!a||!n)return c("error",this,"The properties `flagLayer` and `view` are required but either one or both are missing."),null;let o=e.geometry?.type;if(this.traceLocations?.some(l=>l.traceLocation.globalId===t)&&o!=="polyline")return c("warn",this,"A flag with the same globalId already exists."),null;let s=this._createFlagSymbol(),i=new P({geometry:r,symbol:s,attributes:e.attributes});return a.add(i),i}async _generateItemTitle(t){let{messages:e}=this,r=(t.layer?.type,t.layer);return("getFeatureTitle"in r?await r.getFeatureTitle(t):null)||t?.getObjectId()?.toString()||e.labels.unknown}async _generateFlagInfo(t,e){let{traceLocationType:r,utilityNetwork:a}=this,n=t.getGlobalId()??"",o=t.geometry?.type,s=await this._generateItemTitle(t);if(o==="point"||o==="polygon"){let i=a?.getTerminalConfiguration(t),l=i?i.terminals[0].id:1;return{traceLocation:new b({type:r,isFilterBarrier:!1,globalId:n,terminalId:l}),flagProperties:{title:s,expanded:!1,terminalConfiguration:i??void 0,selectedTerminals:i?new Set([l]):void 0},spatialProperties:{mapPoint:e,mapGraphic:t}}}else if(o==="polyline"){let i=this._calculatePercentAlong(t.geometry,e);return{traceLocation:new b({type:r,isFilterBarrier:!1,globalId:n,percentAlong:i}),flagProperties:{title:s,expanded:!1},spatialProperties:{mapPoint:e,mapGraphic:t}}}else if(!o){let i=a?.getTerminalConfiguration(t),l=i?i.terminals[0].id:1;return{traceLocation:new b({type:r,isFilterBarrier:!1,globalId:n,terminalId:l}),flagProperties:{title:s,expanded:!1,terminalConfiguration:i??void 0,selectedTerminals:i?new Set([l]):void 0},spatialProperties:{mapPoint:e}}}return null}async _generateTraceLocation(t,e){let{traceLocations:r}=this,a=t.getGlobalId()??"",n=t.geometry?.type,o=await this._generateFlagInfo(t,e);if(!o){c("error",this,"Unable to generate flag info for trace location.");return}let s=r?.filter(i=>i.spatialProperties.mapGraphic?.getGlobalId()===a)??[];if(s.length===0||n==="polyline"){if(n==="polyline"&&s.length>0&&s.some(l=>Math.abs(l.traceLocation.percentAlong-o.traceLocation.percentAlong)<=this.spatialTolerance)){c("warn",this,"A flag with the same globalId already exists within tolerance.");return}let i=this._addFlagGraphic(a,t,e);if(!i){c("warn",this,"Unable to add flag graphic.");return}o.spatialProperties.flagGraphic=i,r?.add(o);return}c("warn",this,"A flag with the same globalId already exists.")}async _hitTest(t){let{view:e,utilityNetwork:r}=this;if(!e||!r)return c("error",this,"Either `utilityNetwork` or `view` is unavailable for hit test."),!0;let a=t.graphic?.geometry,n=this.view?.toScreen(a);if(!n)return c("warn",this,"No screen point available for hit test."),!1;let o=(await e.hitTest(n,{include:this.filterLayers})).results.filter(s=>s.type==="graphic"&&s?.layer&&s.graphic);return o.length===0?(c("info",this,"No usable hit test results found."),!1):(this._resetAfterSketch(!1),await this._ensureNecessaryAttributesAndGenerateTraceLocation(o,a),this._resetAfterSketch(!0),!0)}_resetAfterSketch(t=!1){let{view:e}=this;if(!e){c("error",this,"View is not available to reset after sketch.");return}this._clickHandler?.remove(),this._clickHandler=void 0,"acquireCursor"in e&&e.acquireCursor("default"),t&&this.arcgisTraceLocationSelectEnd.emit()}_handleSketchComplete(t){let{sketchViewModel:e,view:r}=this;if(!e||!r){c("error",this,"Either `sketchViewModel` or `view` is not available in sketch complete handler.");return}if(t.state==="complete"&&t.graphic){e.layer.remove(t.graphic),this._hitTest(t).then(a=>{a?this._resetAfterSketch():this._initiateHitTest()});return}t.state==="cancel"&&this._resetAfterSketch(!0)}async _initiateHitTest(){let{view:t,sketchViewModel:e}=this;if(!t||!e){c("error",this,"Cannot initiate hit test; either `view` or `sketchViewModel` not found.");return}this._clickHandler?.remove(),this._clickHandler=e.on("create",this._handleSketchComplete.bind(this)),"acquireCursor"in t&&t.acquireCursor("crosshair"),this.sketchViewModel?.create("point")}async _handleAddButtonClick(){let{view:t,sketchViewModel:e}=this;if(!(t&&e)){c("error",this,"Cannot add trace location; `view` not found.");return}if(this.beforeTraceLocationSelectStart){this.isSelectWaiting=!0;try{await this.beforeTraceLocationSelectStart()}finally{this.isSelectWaiting=!1}}this.arcgisTraceLocationSelectStart.emit({cancelSelect:()=>e.cancel()}).defaultPrevented||await this._initiateHitTest()}_handleClearButtonClick(){let{flagLayer:t,traceLocations:e}=this;e?.forEach(r=>{r.spatialProperties.flagGraphic&&t&&t.remove(r.spatialProperties.flagGraphic)}),e?.removeAll()}renderAddLocationBlock(){let{traceLocationType:t,messages:e,traceLocations:r}=this,a=t==="starting-point"?e.types.startingPoint:t==="barrier"?e.types.barrier:e.types.stoppingPoint,n=a.heading,o=a.description,s=a.buttonText;return f`<calcite-block .heading=${n} .label=${n} expanded .description=${o}>${r?.length?f`<calcite-button class="clear-button" slot=actions-end appearance=transparent .label=${e.buttons.clear} @click=${()=>this._handleClearButtonClick()}>${e.buttons.clear}</calcite-button>`:null}<arcgis-utility-network-trace-location-list .traceLocations=${r} .traceLocationType=${t}></arcgis-utility-network-trace-location-list><div class="button-container"><calcite-button .loading=${this.isSelectWaiting} class="add-location-button" icon-start=select appearance=outline .label=${s} @click=${()=>this._handleAddButtonClick()}>${s}</calcite-button></div></calcite-block>`}render(){return f`<div class="root">${this.renderAddLocationBlock()}</div>`}};T("arcgis-utility-network-trace-location",k);return k},"geometry/operators/cutOperator","geometry/operators/lengthOperator","geometry/operators/projectOperator","geometry/Polyline","geometry/SpatialReference","Graphic","rest/networks/support/TraceLocation","symbols/SimpleMarkerSymbol")
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import a from"./GYSZA7D4.js";import"./MATFNQVX.js";import{a as w}from"./CAYSZWRK.js";import"./UFWKXIL5.js";import"./KCQB4NNK.js";import"./ZNBKMZP7.js";import{M as b,N as u,O as v,U as $,a as _,b as i,p as d,r as m,s as f,x as o}from"./MQTZFCXF.js";import"./ALDX5YZO.js";export default $arcgis.t(([{queryAllJSON:R},C,,g,,T,{r:p}])=>{var E=_`:host{min-height:var(--arcgis-internal-panel-height-sm, 240px);height:100%}arcgis-features{height:100%}calcite-flow{min-height:var(--arcgis-internal-panel-height-sm, 240px);height:100%}calcite-table{--calcite-table-border-color: none}calcite-table-row{--calcite-table-row-border-color: var(--calcite-color-border-3)}.white-panel-background{--calcite-panel-background-color: var(--calcite-color-foreground-1)}.aggregated-geometry-container{display:flex;justify-content:space-between;padding:0 var(--calcite-spacing-md) var(--calcite-spacing-md) var(--calcite-spacing-md)}#elements-list-item{border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm);margin:0 var(--calcite-spacing-sm)}.no-selectable-results{padding:0 var(--calcite-spacing-md);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size)}.results-heading{display:flex;flex-direction:column;margin:var(--calcite-spacing-md);gap:var(--calcite-spacing-xs)}.results-heading .results-heading-title{font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.results-heading .results-heading-subtitle{font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3)}.functions-heading{padding:var(--calcite-spacing-md) var(--calcite-spacing-md) var(--calcite-spacing-xxs) var(--calcite-spacing-md);font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.no-results-landing{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;margin:var(--calcite-spacing-sm) var(--calcite-spacing-xl) var(--calcite-spacing-xl) var(--calcite-spacing-xl);gap:var(--calcite-spacing-md)}.no-results-landing calcite-icon{margin-bottom:var(--calcite-spacing-sm);--calcite-icon-color: var(--calcite-color-text-3)}.no-results-landing .no-results-heading{font-size:var(--calcite-font-size-2)}.no-results-landing .no-results-description{color:var(--calcite-color-text-3)}`,F={dirtyAreasDiscovered:-2147208511,noValidControllers:-2147208935},y=class extends v{constructor(){super(...arguments),this._defaultPopupTemplateEnabled=!0,this._messages=w({blocking:!0}),this._elementsWithoutLayer=[],this._popoverRef=b(),this._featuresFromSelectedLayer=[],this._layerIdToFeatures=new Map,this._layerIdToLayer=new Map,this._subtypeCodeToFeatures=new Map,this._sourceIdToElements=new Map,this._unLayers=[],this._compareByFeatureTitle=(e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0}),this._compareByLayerTitle=([,e],[,t])=>{let s=e[0].feature.layer,a=t[0].feature.layer,l=s?.title??"",c=a?.title??"";return l.localeCompare(c,void 0,{numeric:!0})},this._queryFeaturesOnLayer=async([e,t])=>{let s=this.utilityNetwork?.getLayerIdBySourceId(e),a=this._getLayerByLayerId(s);if(s==null||!a){this._elementsWithoutLayer.push(...t);return}let l=a.createQuery();l.gdbVersion=this.utilityNetwork?.gdbVersion,l.objectIds=t.map(r=>r.objectId),l.outFields=["*"];let{features:c}=T.fromJSON(await R(a,l)),n=await Promise.all(c.map(async r=>{r.layer=a.type==="subtype-group"?a.findSublayerForFeature(r):a,r.origin=r.layer;let h=r.layer;if(r.getEffectivePopupTemplate(this._defaultPopupTemplateEnabled)||(r.popupTemplate=h.createPopupTemplate()),h&&"getFeatureTitle"in h){let L=await h.getFeatureTitle(r)||p(r);return{feature:r,label:L}}return{feature:r,label:p(r)}}));a.type==="subtype-group"?n.forEach(r=>this._addOrCreateMapValue(this._subtypeCodeToFeatures,r.feature.layer.subtypeCode,r)):this._layerIdToFeatures.set(s,n)},this._aggregateGeometryRefChange=e=>{e&&(this._aggregatedGeometryComponentElement=e)},this._featuresRefChange=e=>{e&&(this._featuresComponentElement=e)},this._aggregatedGeometryDisabled=!1,this.aggregatedGeometryGraphicsColor=new C([255,255,0,.6]),this.hideFeatureResults=!1,this.isElementsSelected=!1,this.layers=[],this.state="ready",this.traceResultFeatures=[],this.autoDestroyDisabled=!1,this.arcgisAggregatedGeometryGraphicsColorChange=o(),this.arcgisHideGraphicsChange=o(),this.arcgisSelectedLayerChange=o(),this.arcgisSelectedResultTypeChange=o(),this.arcgisTraceResultFeaturesReady=o(),this._renderLayerListItem=([,e])=>{if(!e.length)return null;let t=e[0].feature.layer,s=t?.title||this._messages.unknown;return i`<calcite-list-item .label=${s} @calciteListItemSelect=${()=>this._setSelectedLayerAndFeatures(t)}><calcite-chip .label=${this._messages.labels.numElements} slot=content-end scale=s>${e.length}</calcite-chip><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item>`},this._renderFeatureListItem=e=>{let{feature:t,label:s}=e;return i`<calcite-list-item .label=${s} @calciteListItemSelect=${()=>this.selectedFeature=t}><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item>`}}static{this.properties={_aggregatedGeometryDisabled:16,aggregatedGeometryGraphicsColor:0,hideFeatureResults:5,featuresFromSelectedLayer:32,isElementsSelected:5,layers:0,messageOverrides:0,referenceElement:1,selectedFeature:0,selectedLayer:0,state:1,traceConfigTitle:1,traceError:0,traceResult:0,traceResultFeatures:0,utilityNetwork:0,view:0,autoDestroyDisabled:5}}static{this.styles=E}get featuresFromSelectedLayer(){return this._featuresFromSelectedLayer.map(({feature:e})=>e)}clearAggregatedGeometryGraphics(){this._aggregatedGeometryComponentElement?.destroy()}async destroy(){this._layerIdToFeatures.clear(),this._subtypeCodeToFeatures.clear(),this._sourceIdToElements.clear(),this._aggregatedGeometryComponentElement?.destroy(),this._featuresComponentElement?.destroy(),await this.manager.destroy()}load(){this.traceResult&&(this._setSourceIdToElements(),this._loadDependencies().then(()=>this._queryTraceResultsFeatures()).then(()=>this._loadProjectOperator()).finally(()=>{this.arcgisTraceResultFeaturesReady.emit(),this.state="ready"}))}willUpdate(e){e.has("isElementsSelected")&&this.arcgisSelectedResultTypeChange.emit(),e.has("selectedLayer")&&this.arcgisSelectedLayerChange.emit(),e.has("traceResult")&&(this.isElementsSelected=!1),(e.has("layers")||e.has("utilityNetwork"))&&this._loadDependencies()}loaded(){this.utilityNetwork||d("warn",this,m("utilityNetwork")),this.layers.length===0&&d("warn",this,f("layers")),this.view||d("warn",this,m("view"))}disconnectedCallback(){super.disconnectedCallback(),this._layerIdToLayer.clear()}_addOrCreateMapValue(e,t,s){let a=e.get(t);a==null?e.set(t,[s]):a.push(s)}_getLayerByLayerId(e){if(e==null)return;let{_layerIdToLayer:t,_unLayers:s}=this;if(t.get(e))return t.get(e);let a=s.find(l=>"layerId"in l&&l.layerId===e);return a&&t.set(e,a),a}_handleHideGraphicsChange(e){e.stopPropagation();let t=e.detail;this.arcgisHideGraphicsChange.emit(t),this._aggregatedGeometryDisabled=t,t&&this._popoverRef.value?.open&&(this._popoverRef.value.open=!1)}async _loadDependencies(){let{layers:e,utilityNetwork:t}=this;if(!t)return;t.loaded||(this.state="loading",await t.load()),this._unLayers=e.filter(a=>t.isUtilityLayer(a));let s=this._unLayers.filter(a=>!a.loaded).map(a=>a.load());s.length>0&&(this.state="loading",await Promise.allSettled(s))}async _loadProjectOperator(){let{aggregatedGeometry:e}=this.traceResult;e&&!g.isLoaded()&&await g.load()}async _queryTraceResultsFeatures(){let e=Array.from(this._sourceIdToElements.entries());if(!e.length)return;this.state="loading";let t=e.map(this._queryFeaturesOnLayer);(await Promise.allSettled(t)).forEach((l,c)=>{if(l.status==="rejected"){let[n]=e[c];d("error",this,`Failed to query features for source ${n}. Reason: ${l.reason}`)}});let s=Array.from(this._layerIdToFeatures.values()),a=Array.from(this._subtypeCodeToFeatures.values());this.traceResultFeatures=s.concat(a).flat().map(({feature:l})=>l)}_setSelectedLayerAndFeatures(e){let t;if(!e)t=[];else if(e.type==="subtype-sublayer"){let{subtypeCode:s}=e;t=this._subtypeCodeToFeatures.get(s)??[]}else{let{layerId:s}=e;t=this._layerIdToFeatures.get(s)??[]}this._featuresFromSelectedLayer=t.sort(this._compareByFeatureTitle),this.selectedLayer=e}_setSourceIdToElements(){this.traceResult.elements?.forEach(e=>this._addOrCreateMapValue(this._sourceIdToElements,e.networkSourceId,e))}render(){let{traceError:e,traceResult:t}=this;if(e)return this._renderErrorLanding(e);if(!t)return this._renderNoTraceLanding();let{elements:s,globalFunctionResults:a,aggregatedGeometry:l}=t;if(!s.length&&!a.length&&!l)return this._renderNoResultsLanding();if(this.state==="loading")return this._renderGettingResults();if(this.selectedFeature){let n=this._featuresComponentElement,r=n?.selectedFeature?[n.selectedFeature]:[this.selectedFeature];return i`<arcgis-features .referenceElement=${this.referenceElement} .features=${r} .view=${this.view} open .defaultPopupTemplateEnabled=${this._defaultPopupTemplateEnabled} @arcgisClose=${()=>this.selectedFeature=void 0} .autoDestroyDisabled=${this.autoDestroyDisabled} ${u(this._featuresRefChange)}></arcgis-features>`}let c=s.length>0&&!a.length&&!l;return this.hideFeatureResults&&c?this._renderFeaturesAreHidden():i`<calcite-flow>${c?null:i`<calcite-flow-item .selected=${!this.isElementsSelected}>${this._renderLanding(t)}</calcite-flow-item>`}<calcite-flow-item .heading=${this._messages.headings.features} .description=${this._messages.headings.totalFeatures.replace("{number}",this.traceResultFeatures.length.toString())} .selected=${(c||this.isElementsSelected)&&!this.selectedLayer} @calciteFlowItemBack=${()=>this.isElementsSelected=!1}>${this._renderLayerList()}</calcite-flow-item><calcite-flow-item .heading=${this.selectedLayer?.title??void 0} .description=${this._messages.headings.totalFeatures.replace("{number}",this._featuresFromSelectedLayer.length.toString())} .selected=${!!this.selectedLayer} @calciteFlowItemBack=${()=>this.selectedLayer=void 0}>${this._renderFeaturesList()}</calcite-flow-item></calcite-flow>`}_renderGettingResults(){return i`<calcite-panel class="white-panel-background"><calcite-loader .label=${this._messages.gettingResults} .text=${this._messages.gettingResults}></calcite-loader></calcite-panel>`}_renderLanding(e){let{elements:t,globalFunctionResults:s,aggregatedGeometry:a}=e;return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}${a!=null?this._renderAggregatedGeometry(a):null}${a!=null&&!t.length?this._renderNoSelectableResults():null}${t.length>0?this.hideFeatureResults?this._renderFeaturesAreHidden():this._renderElementsResults():null}${s.length>0?this._renderFunctionsResults(s):null}</calcite-panel>`}_renderAggregatedGeometry(e){return i`<div class="aggregated-geometry-container"><arcgis-utility-network-aggregated-geometry .graphicsColor=${this.aggregatedGeometryGraphicsColor} .geometry=${e} .view=${this.view} @arcgisHideGraphicsChange=${this._handleHideGraphicsChange} .autoDestroyDisabled=${this.autoDestroyDisabled} ${u(this._aggregateGeometryRefChange)}></arcgis-utility-network-aggregated-geometry><calcite-swatch id=geometry-color-swatch .label=${this._messages.labels.aggregatedGeometryGraphicsColor} .color=${this.aggregatedGeometryGraphicsColor.toCss()} .disabled=${this._aggregatedGeometryDisabled}></calcite-swatch><calcite-popover .heading=${this._messages.headings.setColor} .label=${this._messages.headings.setColor} reference-element=geometry-color-swatch closable ${u(this._popoverRef)}><calcite-color-picker alpha-channel channels-disabled clearable hex-disabled saved-disabled .value=${this.aggregatedGeometryGraphicsColor} @calciteColorPickerChange=${t=>{let s=t.target.value;this.arcgisAggregatedGeometryGraphicsColorChange.emit(s)}} .disabled=${this._aggregatedGeometryDisabled}></calcite-color-picker></calcite-popover></div>`}_renderFeaturesAreHidden(){return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-selectable-results">${this._messages.resultFeaturesAreHidden}</div></calcite-panel>`}_renderNoSelectableResults(){return i`<div class="no-selectable-results">${this._messages.noSelectableFeatures}</div>`}_renderElementsResults(){return i`<calcite-list .label=${this._messages.headings.traceResultsGeneric}><calcite-list-item id=elements-list-item .label=${this._messages.headings.features} @calciteListItemSelect=${()=>this.isElementsSelected=!0}><calcite-chip .label=${this._messages.labels.numFeatures} scale=s slot=content-end>${this.traceResultFeatures.length}</calcite-chip><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item></calcite-list>`}_renderFunctionsResults(e){return i`<div class="functions-heading">${this._messages.headings.functions}</div><calcite-table .caption=${this._messages.labels.functionResults}>${e.filter(t=>t.networkAttributeName!=null&&t.result!=null).map(t=>i`<calcite-table-row><calcite-table-cell>${t.networkAttributeName}</calcite-table-cell><calcite-table-cell>${t.result}</calcite-table-cell></calcite-table-row>`)}</calcite-table>`}_renderLayerList(){let e=Array.from(this._layerIdToFeatures.entries()),t=Array.from(this._subtypeCodeToFeatures.entries()),s=e.concat(t).sort(this._compareByLayerTitle).map(this._renderLayerListItem);return this._elementsWithoutLayer.length>0&&s.push(this._renderUnknownListItem()),i`<calcite-list .label=${this._messages.labels.traceResultElementsByLayer} .loading=${this.state==="loading"}>${s}</calcite-list>`}_renderUnknownListItem(){return i`<calcite-list-item .label=${this._messages.unknown}><calcite-chip .label=${this._messages.labels.numElements} slot=content-end scale=s>${this._elementsWithoutLayer.length}</calcite-chip></calcite-list-item>`}_renderFeaturesList(){return i`<calcite-list .label=${this._messages.headings.traceResultsGeneric}>${this._featuresFromSelectedLayer.map(this._renderFeatureListItem)}</calcite-list>`}_renderTraceResultsHeading(){return i`<div class="results-heading"><div class="results-heading-title">${this._messages.headings.traceResultsGeneric}</div>${this.traceConfigTitle?i`<div class="results-heading-subtitle">${this.traceConfigTitle}</div>`:null}</div>`}_renderErrorLanding(e){let t=e.message;switch(e.details?.raw?.extendedCode){case F.dirtyAreasDiscovered:t=this._messages.traceErrors.dirtyAreasDiscovered;break;case F.noValidControllers:t=this._messages.traceErrors.noValidControllers;break}return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${this._messages.traceFailedHeading}</div><div class="no-results-description">${this._messages.traceFailedDescription}</div><div class="no-results-description">${t}</div></div></calcite-panel>`}_renderNoResultsLanding(){return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${this._messages.noResultsHeading}</div><div class="no-results-description">${this._messages.noResultsDescription}</div></div></calcite-panel>`}_renderNoTraceLanding(){return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=utility-network-trace scale=l></calcite-icon><div class="no-results-heading">${this._messages.noTraceConfigHeading}</div><div class="no-results-description">${this._messages.noTraceConfigDescription}</div></div></calcite-panel>`}};$("arcgis-utility-network-trace-results",y);return y},"applications/Components/featureUtils","Color","core/Error","geometry/operators/shapePreservingProjectOperator","Graphic","rest/support/FeatureSet",a)
2
+ import a from"./GYSZA7D4.js";import"./MATFNQVX.js";import{a as w}from"./CAYSZWRK.js";import"./UFWKXIL5.js";import"./KCQB4NNK.js";import"./ZNBKMZP7.js";import{M as b,N as u,O as v,U as $,a as _,b as r,p as d,r as m,s as f,x as o}from"./MQTZFCXF.js";import"./ALDX5YZO.js";export default $arcgis.t(([{queryAllJSON:R},C,,g,,T,{r:p}])=>{var E=_`:host{min-height:var(--arcgis-internal-panel-height-sm, 240px);height:100%}arcgis-features{height:100%}calcite-flow{min-height:var(--arcgis-internal-panel-height-sm, 240px);height:100%}calcite-table{--calcite-table-border-color: none}calcite-table-row{--calcite-table-row-border-color: var(--calcite-color-border-3)}.white-panel-background{--calcite-panel-background-color: var(--calcite-color-foreground-1)}.aggregated-geometry-container{display:flex;justify-content:space-between;padding:0 var(--calcite-spacing-md) var(--calcite-spacing-md) var(--calcite-spacing-md)}#elements-list-item{border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm);margin:0 var(--calcite-spacing-sm)}.no-selectable-results{padding:0 var(--calcite-spacing-md);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size)}.results-heading{display:flex;flex-direction:column;margin:var(--calcite-spacing-md);gap:var(--calcite-spacing-xs)}.results-heading .results-heading-title{font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.results-heading .results-heading-subtitle{font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3)}.functions-heading{padding:var(--calcite-spacing-md) var(--calcite-spacing-md) var(--calcite-spacing-xxs) var(--calcite-spacing-md);font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.no-results-landing{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;margin:var(--calcite-spacing-sm) var(--calcite-spacing-xl) var(--calcite-spacing-xl) var(--calcite-spacing-xl);gap:var(--calcite-spacing-md)}.no-results-landing calcite-icon{margin-bottom:var(--calcite-spacing-sm);--calcite-icon-color: var(--calcite-color-text-3)}.no-results-landing .no-results-heading{font-size:var(--calcite-font-size-2)}.no-results-landing .no-results-description{color:var(--calcite-color-text-3)}`,F={dirtyAreasDiscovered:-2147208511,noValidControllers:-2147208935},y=class extends v{constructor(){super(...arguments),this._defaultPopupTemplateEnabled=!0,this._messages=w({blocking:!0}),this._elementsWithoutLayer=[],this._popoverRef=b(),this._featuresFromSelectedLayer=[],this._layerIdToFeatures=new Map,this._layerIdToLayer=new Map,this._subtypeCodeToFeatures=new Map,this._sourceIdToElements=new Map,this._unLayers=[],this._compareByFeatureTitle=(e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0}),this._compareByLayerTitle=([,e],[,t])=>{let s=e[0].feature.layer,a=t[0].feature.layer,l=s?.title??"",c=a?.title??"";return l.localeCompare(c,void 0,{numeric:!0})},this._queryFeaturesOnLayer=async([e,t])=>{let s=this.utilityNetwork?.getLayerIdBySourceId(e),a=this._getLayerByLayerId(s);if(s==null||!a){this._elementsWithoutLayer.push(...t);return}let l=a.createQuery();l.gdbVersion=this.utilityNetwork?.gdbVersion,l.objectIds=t.map(i=>i.objectId),l.outFields=["*"];let{features:c}=T.fromJSON(await R(a,l)),n=await Promise.all(c.map(async i=>{i.layer=a.type==="subtype-group"?a.findSublayerForFeature(i):a,i.origin=i.layer;let h=i.layer;if(i.getEffectivePopupTemplate(this._defaultPopupTemplateEnabled)||(i.popupTemplate=h.createPopupTemplate()),h&&"getFeatureTitle"in h){let L=await h.getFeatureTitle(i)||p(i);return{feature:i,label:L}}return{feature:i,label:p(i)}}));a.type==="subtype-group"?n.forEach(i=>this._addOrCreateMapValue(this._subtypeCodeToFeatures,i.feature.layer.subtypeCode,i)):this._layerIdToFeatures.set(s,n)},this._aggregateGeometryRefChange=e=>{e&&(this._aggregatedGeometryComponentElement=e)},this._featuresRefChange=e=>{e&&(this._featuresComponentElement=e)},this._aggregatedGeometryDisabled=!1,this.aggregatedGeometryGraphicsColor=new C([255,255,0,.6]),this.hideFeatureResults=!1,this.isElementsSelected=!1,this.layers=[],this.state="ready",this.traceResultFeatures=[],this.autoDestroyDisabled=!1,this.arcgisAggregatedGeometryGraphicsColorChange=o(),this.arcgisHideGraphicsChange=o(),this.arcgisSelectedLayerChange=o(),this.arcgisSelectedResultTypeChange=o(),this.arcgisTraceResultFeaturesReady=o(),this._renderLayerListItem=([,e])=>{if(!e.length)return null;let t=e[0].feature.layer,s=t?.title||this._messages.unknown;return r`<calcite-list-item .label=${s} @calciteListItemSelect=${()=>this._setSelectedLayerAndFeatures(t)}><calcite-chip .label=${this._messages.labels.numElements} slot=content-end scale=s>${e.length}</calcite-chip><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item>`},this._renderFeatureListItem=e=>{let{feature:t,label:s}=e;return r`<calcite-list-item .label=${s} @calciteListItemSelect=${()=>this.selectedFeature=t}><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item>`}}static{this.properties={_aggregatedGeometryDisabled:16,aggregatedGeometryGraphicsColor:0,hideFeatureResults:5,featuresFromSelectedLayer:32,isElementsSelected:5,layers:0,messageOverrides:0,referenceElement:1,selectedFeature:0,selectedLayer:0,state:1,traceConfigTitle:1,traceError:0,traceResult:0,traceResultFeatures:0,utilityNetwork:0,view:0,autoDestroyDisabled:5}}static{this.styles=E}get featuresFromSelectedLayer(){return this._featuresFromSelectedLayer.map(({feature:e})=>e)}clearAggregatedGeometryGraphics(){this._aggregatedGeometryComponentElement?.destroy()}async destroy(){this._layerIdToFeatures.clear(),this._subtypeCodeToFeatures.clear(),this._sourceIdToElements.clear(),this._aggregatedGeometryComponentElement?.destroy(),this._featuresComponentElement?.destroy(),await this.manager.destroy()}load(){this.traceResult&&(this._setSourceIdToElements(),this._loadDependencies().then(()=>this._queryTraceResultsFeatures()).then(()=>this._loadProjectOperator()).finally(()=>{this.arcgisTraceResultFeaturesReady.emit(),this.state="ready"}))}willUpdate(e){e.has("isElementsSelected")&&this.arcgisSelectedResultTypeChange.emit(),e.has("selectedLayer")&&this.arcgisSelectedLayerChange.emit(),e.has("traceResult")&&(this.isElementsSelected=!1),(e.has("layers")||e.has("utilityNetwork"))&&this._loadDependencies()}loaded(){this.utilityNetwork||d("warn",this,m("utilityNetwork")),this.layers.length===0&&d("warn",this,f("layers")),this.view||d("warn",this,m("view"))}disconnectedCallback(){super.disconnectedCallback(),this._layerIdToLayer.clear()}_addOrCreateMapValue(e,t,s){let a=e.get(t);a==null?e.set(t,[s]):a.push(s)}_getLayerByLayerId(e){if(e==null)return;let{_layerIdToLayer:t,_unLayers:s}=this;if(t.get(e))return t.get(e);let a=s.find(l=>"layerId"in l&&l.layerId===e);return a&&t.set(e,a),a}_handleHideGraphicsChange(e){e.stopPropagation();let t=e.detail;this.arcgisHideGraphicsChange.emit(t),this._aggregatedGeometryDisabled=t,t&&this._popoverRef.value?.open&&(this._popoverRef.value.open=!1)}async _loadDependencies(){let{layers:e,utilityNetwork:t}=this;if(!t)return;t.loaded||(this.state="loading",await t.load()),this._unLayers=e.filter(a=>t.isUtilityLayer(a));let s=this._unLayers.filter(a=>!a.loaded).map(a=>a.load());s.length>0&&(this.state="loading",await Promise.allSettled(s))}async _loadProjectOperator(){let{aggregatedGeometry:e}=this.traceResult;e&&!g.isLoaded()&&await g.load()}async _queryTraceResultsFeatures(){let e=Array.from(this._sourceIdToElements.entries());if(!e.length)return;this.state="loading";let t=e.map(this._queryFeaturesOnLayer);(await Promise.allSettled(t)).forEach((l,c)=>{if(l.status==="rejected"){let[n]=e[c];d("error",this,`Failed to query features for source ${n}. Reason: ${l.reason}`)}});let s=Array.from(this._layerIdToFeatures.values()),a=Array.from(this._subtypeCodeToFeatures.values());this.traceResultFeatures=s.concat(a).flat().map(({feature:l})=>l)}_setSelectedLayerAndFeatures(e){let t;if(!e)t=[];else if(e.type==="subtype-sublayer"){let{subtypeCode:s}=e;t=this._subtypeCodeToFeatures.get(s)??[]}else{let{layerId:s}=e;t=this._layerIdToFeatures.get(s)??[]}this._featuresFromSelectedLayer=t.sort(this._compareByFeatureTitle),this.selectedLayer=e}_setSourceIdToElements(){this.traceResult.elements?.forEach(e=>this._addOrCreateMapValue(this._sourceIdToElements,e.networkSourceId,e))}render(){let{traceError:e,traceResult:t}=this;if(e)return this._renderErrorLanding(e);if(!t)return this._renderNoTraceLanding();let{elements:s,globalFunctionResults:a,aggregatedGeometry:l}=t;if(!s.length&&!a.length&&!l)return this._renderNoResultsLanding();if(this.state==="loading")return this._renderGettingResults();if(this.selectedFeature){let n=this._featuresComponentElement,i=n?.selectedFeature?[n.selectedFeature]:[this.selectedFeature];return r`<arcgis-features .referenceElement=${this.referenceElement} .features=${i} .view=${this.view} open .defaultPopupTemplateEnabled=${this._defaultPopupTemplateEnabled} @arcgisClose=${()=>this.selectedFeature=void 0} .autoDestroyDisabled=${this.autoDestroyDisabled} ${u(this._featuresRefChange)}></arcgis-features>`}let c=s.length>0&&!a.length&&!l;return this.hideFeatureResults&&c?this._renderFeaturesAreHiddenLanding():r`<calcite-flow>${c?null:r`<calcite-flow-item .selected=${!this.isElementsSelected}>${this._renderLanding(t)}</calcite-flow-item>`}<calcite-flow-item .heading=${this._messages.headings.features} .description=${this._messages.headings.totalFeatures.replace("{number}",this.traceResultFeatures.length.toString())} .selected=${(c||this.isElementsSelected)&&!this.selectedLayer} @calciteFlowItemBack=${()=>this.isElementsSelected=!1}>${this._renderLayerList()}</calcite-flow-item><calcite-flow-item .heading=${this.selectedLayer?.title??void 0} .description=${this._messages.headings.totalFeatures.replace("{number}",this._featuresFromSelectedLayer.length.toString())} .selected=${!!this.selectedLayer} @calciteFlowItemBack=${()=>this.selectedLayer=void 0}>${this._renderFeaturesList()}</calcite-flow-item></calcite-flow>`}_renderGettingResults(){return r`<calcite-panel class="white-panel-background"><calcite-loader .label=${this._messages.gettingResults} .text=${this._messages.gettingResults}></calcite-loader></calcite-panel>`}_renderLanding(e){let{elements:t,globalFunctionResults:s,aggregatedGeometry:a}=e;return r`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}${a!=null?this._renderAggregatedGeometry(a):null}${a!=null&&!t.length?this._renderNoSelectableResults():null}${t.length>0?this.hideFeatureResults?this._renderFeaturesAreHidden():this._renderElementsResults():null}${s.length>0?this._renderFunctionsResults(s):null}</calcite-panel>`}_renderAggregatedGeometry(e){return r`<div class="aggregated-geometry-container"><arcgis-utility-network-aggregated-geometry .graphicsColor=${this.aggregatedGeometryGraphicsColor} .geometry=${e} .view=${this.view} @arcgisHideGraphicsChange=${this._handleHideGraphicsChange} .autoDestroyDisabled=${this.autoDestroyDisabled} ${u(this._aggregateGeometryRefChange)}></arcgis-utility-network-aggregated-geometry><calcite-swatch id=geometry-color-swatch .label=${this._messages.labels.aggregatedGeometryGraphicsColor} .color=${this.aggregatedGeometryGraphicsColor.toCss()} .disabled=${this._aggregatedGeometryDisabled}></calcite-swatch><calcite-popover .heading=${this._messages.headings.setColor} .label=${this._messages.headings.setColor} reference-element=geometry-color-swatch closable ${u(this._popoverRef)}><calcite-color-picker alpha-channel channels-disabled clearable hex-disabled saved-disabled .value=${this.aggregatedGeometryGraphicsColor} @calciteColorPickerChange=${t=>{let s=t.target.value;this.arcgisAggregatedGeometryGraphicsColorChange.emit(s)}} .disabled=${this._aggregatedGeometryDisabled}></calcite-color-picker></calcite-popover></div>`}_renderFeaturesAreHiddenLanding(){return r`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}${this._renderFeaturesAreHidden()}</calcite-panel>`}_renderFeaturesAreHidden(){return r`<div class="no-selectable-results">${this._messages.resultFeaturesAreHidden}</div>`}_renderNoSelectableResults(){return r`<div class="no-selectable-results">${this._messages.noSelectableFeatures}</div>`}_renderElementsResults(){return r`<calcite-list .label=${this._messages.headings.traceResultsGeneric}><calcite-list-item id=elements-list-item .label=${this._messages.headings.features} @calciteListItemSelect=${()=>this.isElementsSelected=!0}><calcite-chip .label=${this._messages.labels.numFeatures} scale=s slot=content-end>${this.traceResultFeatures.length}</calcite-chip><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item></calcite-list>`}_renderFunctionsResults(e){return r`<div class="functions-heading">${this._messages.headings.functions}</div><calcite-table .caption=${this._messages.labels.functionResults}>${e.filter(t=>t.networkAttributeName!=null&&t.result!=null).map(t=>r`<calcite-table-row><calcite-table-cell>${t.networkAttributeName}</calcite-table-cell><calcite-table-cell>${t.result}</calcite-table-cell></calcite-table-row>`)}</calcite-table>`}_renderLayerList(){let e=Array.from(this._layerIdToFeatures.entries()),t=Array.from(this._subtypeCodeToFeatures.entries()),s=e.concat(t).sort(this._compareByLayerTitle).map(this._renderLayerListItem);return this._elementsWithoutLayer.length>0&&s.push(this._renderUnknownListItem()),r`<calcite-list .label=${this._messages.labels.traceResultElementsByLayer} .loading=${this.state==="loading"}>${s}</calcite-list>`}_renderUnknownListItem(){return r`<calcite-list-item .label=${this._messages.unknown}><calcite-chip .label=${this._messages.labels.numElements} slot=content-end scale=s>${this._elementsWithoutLayer.length}</calcite-chip></calcite-list-item>`}_renderFeaturesList(){return r`<calcite-list .label=${this._messages.headings.traceResultsGeneric}>${this._featuresFromSelectedLayer.map(this._renderFeatureListItem)}</calcite-list>`}_renderTraceResultsHeading(){return r`<div class="results-heading"><div class="results-heading-title">${this._messages.headings.traceResultsGeneric}</div>${this.traceConfigTitle?r`<div class="results-heading-subtitle">${this.traceConfigTitle}</div>`:null}</div>`}_renderErrorLanding(e){let t=e.message;switch(e.details?.raw?.extendedCode){case F.dirtyAreasDiscovered:t=this._messages.traceErrors.dirtyAreasDiscovered;break;case F.noValidControllers:t=this._messages.traceErrors.noValidControllers;break}return r`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${this._messages.traceFailedHeading}</div><div class="no-results-description">${this._messages.traceFailedDescription}</div><div class="no-results-description">${t}</div></div></calcite-panel>`}_renderNoResultsLanding(){return r`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${this._messages.noResultsHeading}</div><div class="no-results-description">${this._messages.noResultsDescription}</div></div></calcite-panel>`}_renderNoTraceLanding(){return r`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=utility-network-trace scale=l></calcite-icon><div class="no-results-heading">${this._messages.noTraceConfigHeading}</div><div class="no-results-description">${this._messages.noTraceConfigDescription}</div></div></calcite-panel>`}};$("arcgis-utility-network-trace-results",y);return y},"applications/Components/featureUtils","Color","core/Error","geometry/operators/shapePreservingProjectOperator","Graphic","rest/support/FeatureSet",a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{e as M,f as k,g as T,h as ae,i as m}from"./6C7SMFB2.js";import{a as U}from"./76KXMQ3Y.js";import{a as Y}from"./VB66GDWY.js";import{a as D}from"./WCESLPME.js";import b from"./DXIOCBFP.js";import"./E7SYUWIQ.js";import"./AGY724TJ.js";import"./VEYJ5V4O.js";import{a as ie}from"./CAYSZWRK.js";import"./DHVEHATY.js";import a from"./DXJ7TMEQ.js";import"./UFWKXIL5.js";import"./KCQB4NNK.js";import"./74XVTUIU.js";import"./ZNBKMZP7.js";import{M as R,N as B,O as X,Q as G,R as O,U as ee,a as W,b as p,x as j}from"./MQTZFCXF.js";import"./ALDX5YZO.js";export default $arcgis.t(([{watch:oe,when:ye,whenOnce:De},me,Se,ke,{createTrackingTarget:Te,runTracked:le,signal:$e},{a:te},{e:re,f:se,g:ne}])=>{function Pe(t,e){return t/15}function Ce(t,e){let i=t?.[0];if(i==null)return null;e||(e={hours:0,minutes:0,seconds:0}),e.hours=Pe(i);let r=e.hours%1;e.hours-=r,e.minutes=r*60;let s=e.minutes%1;return e.minutes-=s,e.seconds=Math.round(s*60),e}function ze(t){let e=Ce([t.longitude,t.latitude]);return e==null?0:Math.round(e.hours+e.minutes/60+e.seconds/3600)}function _e(t,e){return(t%e+e)%e}var q=class{#i;#r;#s=Te(()=>{this.#t()});constructor(e){this.#r=e;let i;le(this.#s,()=>{i=e()}),this.#i=$e(i)}#t(){let e=this.#i.value;le(this.#s,()=>{this.#i.value=this.#r(e)})}mutate(e){this.#i.value=e}get value(){return this.#i.value}};function F(t){return new q(t)}var N=Math.PI,g=Math.sin,$=Math.cos,Oe=Math.asin,Ue=Math.acos,w=N/180,fe=1e3*60*60*24,be=2440588,ve=2451545;function Me(t){return t.valueOf()/fe-.5+be}function E(t){return new Date((t+.5-be)*fe)}function Ee(t){return Me(t)-ve}var ce=w*23.4397;function Le(t,e){return Oe(g(e)*$(ce)+$(e)*g(ce)*g(t))}function Ae(t){return w*(357.5291+.98560028*t)}function Ne(t){return w*(1.9148*g(t)+.02*g(2*t)+3e-4*g(3*t))}function He(t,e){var i=w*102.9372;return t+e+i+N}var S={};S.PolarException={NORMAL:0,MIDNIGHT_SUN:1,POLAR_NIGHT:2};var Z=[[-.83,"sunrise","sunset"]],we=9e-4;function Ie(t,e){return Math.round(t-we-e/(2*N))}function de(t,e,i){return we+(t+e)/(2*N)+i}function he(t,e,i){return ve+t+.0053*g(e)-.0069*g(2*i)}function je(t,e,i){return Ue((g(t)-g(e)*g(i))/($(e)*$(i)))}S.getTimes=function(t,e,i){var r=w*-i,s=w*e,n=Ee(t),a=Ie(n,r),l=de(0,r,a),o=Ae(l),d=Ne(o),c=He(o,d),h=Le(c,0),u=he(l,o,c);function x(I){var z=je(I,s,h),xe=de(z,r,a);return he(xe,o,c)}function y(I){var z=(g(I)-g(s)*g(h))/($(s)*$(h));return z<-1?S.PolarException.MIDNIGHT_SUN:z>1?S.PolarException.POLAR_NIGHT:S.PolarException.NORMAL}var f={solarNoon:E(u),nadir:E(u-.5),polarException:S.PolarException.NORMAL},v,_,C,H,Q;for(v=0,_=Z.length;v<_;v+=1)C=Z[v],H=x(C[0]*w),Q=u-(H-u),f[C[1]]=E(Q),f[C[2]]=E(H);return f.polarException=y(Z[0][0]*w),f};var Re={spring:{dayOfMonth:20,month:2},summer:{dayOfMonth:21,month:5},fall:{dayOfMonth:23,month:8},winter:{dayOfMonth:21,month:11}},V=["spring","summer","fall","winter"];function P(t,e,i){let r=K(e,i),{dayOfMonth:s,month:n}=Re[r],a=new Date(t.getTime());return a.setMonth(n,s),a}function Be(t,e){let i=Ge(t);return K(i,e)}function Ge(t){let e=t.getTime(),i=P(t,"spring","northern").getTime(),r=P(t,"summer","northern").getTime(),s=P(t,"fall","northern").getTime(),n=P(t,"winter","northern").getTime();return e>=i&&e<r?"spring":e>=r&&e<s?"summer":e>=s&&e<n?"fall":"winter"}function K(t,e){return e==="northern"?t:Ye(t)}function ge(t){return t>=0?"northern":"southern"}function Ye(t){let e=V.indexOf(t);return V[(e+2)%4]}var Fe=1440,Ze=864e5;function qe(t,e,i,r){let s=S.getTimes(t,e,i),n=s.sunrise,a=s.sunset,l=k(t,r),o=k(n,r),d=k(a,r);if(l.getUTCDate()!==o.getUTCDate()||l.getUTCDate()!==d.getUTCDate()){let c=l.getTime()-o.getTime()>0?1:-1;n.setUTCDate(n.getUTCDate()+c),a.setUTCDate(a.getUTCDate()+c)}return{sunrise:n,sunset:a}}var Ve=100,Je=1e3,b=12e5,L=72e5;function ue(t,e){return _e(t+e,24)}function Ke({mode:t,lighting:e,getPlaySpeed:i,onProgress:r,beforeProgress:s}){let n=-1;function a(l=Date.now()){let o=e.date,d=Date.now()-(l??0);if(t==="day"){l=Date.now();let c=i()/Ve*d;if(c>0){let h=new Date(o.getTime()+c),u=e.displayUTCOffset??0,x=ue(h.getUTCHours(),u),y=ue(o.getUTCHours(),u);x<y&&(h=new Date(o.getTime()+c-Ze));let f=e.clone();s?.(),e.date=h,r?.(f,e)}}else if(d>Je){l=Date.now();let c=(o.getUTCMonth()+1)%12,h=new Date(o.getTime());h.setUTCMonth(c);let u=e.clone();s?.(),e.date=h,r?.(u,e)}n=requestAnimationFrame(()=>a(l))}return a(),U(()=>cancelAnimationFrame(n))}var A=b/4;function Qe(t,e,i,r){let{day:s,night:n=s,twilight:a=s}=r,l=s*A,o=n*A,d=a*A;if(t==null||e==null||Number.isNaN(t.getTime())&&Number.isNaN(e.getTime()))return l;let c=i.getTime(),h=t.getTime(),u=e.getTime(),x=h-L/2,y=h+L/2,f=u-L/3*2,v=u+L/3,_=l;return c>=x&&c<=y?c-x<=b?_=o-(c-x)/b*(o-d):y-c<=b/2?_=l-(y-c)/b*2*(l-d):_=d:c>=f&&c<=v?c-f<=b/2?_=l-(c-f)/b*2*(l-d):v-c<=b?_=o-(v-c)/b*(o-d):_=d:(c<h||c>u)&&(_=o),_}var We=W`.esri-widget__heading{color:var(--calcite-color-text-2);margin:0 0 .5rem;font-weight:var(--calcite-font-weight-semibold)}h1.esri-widget__heading{font-size:var(--calcite-font-size-xl)}h2.esri-widget__heading{font-size:var(--calcite-font-size-md)}h3.esri-widget__heading,h4.esri-widget__heading,h5.esri-widget__heading,h6.esri-widget__heading{font-size:var(--calcite-font-size)}.esri-widget{box-sizing:border-box;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget *,.esri-widget :before,.esri-widget :after{box-sizing:inherit}.esri-widget.esri-widget--disabled>*{opacity:.4;pointer-events:none}.esri-widget.esri-widget--compact{--esri-widget-padding-y: 0;--esri-widget-padding-x: 0}.esri-widget__anchor{color:var(--calcite-color-text-2)}.esri-widget__anchor:hover{color:var(--calcite-color-text-3)}.esri-widget__anchor:hover,.esri-widget__anchor:focus{text-decoration:underline}.esri-widget__anchor--disabled{opacity:.4;pointer-events:none}.esri-widget__header{background-color:var(--calcite-color-foreground-1);flex:1 0 100%;justify-content:space-between;align-items:center;width:100%;min-height:48px;padding:12px 0 12px 15px;display:flex}.esri-widget__heading{word-break:break-word}.esri-widget__header .esri-widget__heading{width:calc(100% - 48px);text-align:initial;color:var(--calcite-color-text-1);align-items:center;margin:0;padding:0;display:flex}.esri-widget__header-button{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);border:none;flex:0 0 48px;justify-content:center;align-self:stretch;align-items:center;width:48px;padding:0;display:flex}.esri-widget__footer{background-color:var(--calcite-color-foreground-1);justify-content:center;align-items:center;width:100%;min-height:48px;display:flex}.esri-widget__footer-pagination{color:var(--calcite-color-text-2);justify-content:space-between;align-items:center;display:flex}.esri-widget__footer-pagination-previous-button,.esri-widget__footer-pagination-next-button{cursor:pointer;background-color:var(--calcite-color-foreground-1);border:0;margin:0 7px;padding:12px 15px;transition:background-color .125s ease-in-out}.esri-widget__footer-pagination-previous-button:hover,.esri-widget__footer-pagination-previous-button:focus,.esri-widget__footer-pagination-next-button:hover,.esri-widget__footer-pagination-next-button:focus{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1)}.esri-menu{visibility:hidden;z-index:1;background-clip:padding;background-color:var(--calcite-color-foreground-1);background-clip:padding-box;width:100%;max-height:0;margin:2px 0 0;padding:0;font-size:var(--calcite-font-size);line-height:var(--calcite-spacing-xl);position:absolute;top:100%;left:0;overflow:hidden;box-shadow:0 1px 2px #0000004d}.esri-menu .esri-menu__header{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse);padding:6px 12px}.esri-menu__list{margin:0;padding:0;list-style:none}.esri-menu__list-item{cursor:pointer;border-top:1px solid #adadad4d;border-left:3px solid #0000;padding:.8em 1em}.esri-menu__list-item [class^=esri-icon-],.esri-menu__list-item [class*=" esri-icon-"]{padding-right:2.8px}.esri-menu__list-item:first-child{border-top:none}.esri-menu__list-item--focus,.esri-menu__list-item:hover,.esri-menu__list-item:focus{background-color:var(--calcite-color-foreground-1)}.esri-menu__list-item:active{background-color:var(--calcite-color-foreground-current)}.esri-menu__list-item--active,.esri-menu__list-item--active:hover,.esri-menu__list-item--active:focus{background-color:var(--calcite-color-foreground-1);border-left-color:var(--calcite-color-brand)}.esri-widget__table{border-collapse:collapse;color:var(--calcite-color-text-1);border:none;width:100%;line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget__table tr:nth-child(odd){background-color:var(--calcite-color-transparent)}.esri-widget__table tr:nth-child(2n){background-color:var(--calcite-color-transparent-press)}.esri-widget__table tr a{color:var(--calcite-color-text-2)}.esri-widget__table tr a:hover,.esri-widget__table tr a:focus{color:var(--calcite-color-text-1)}.esri-widget__table tr td,.esri-widget__table tr th{vertical-align:top;word-break:break-word;padding:.5em .7em;font-size:var(--calcite-font-size-sm);font-weight:var(--calcite-font-weight-regular)}.esri-widget__table tr th{text-align:left;border-right:3px solid #0000000d;width:50%}.esri-widget__table tr td{width:50%}.esri-input{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1);border:1px solid #959595;font-size:var(--calcite-font-size)}.esri-input::-ms-clear{display:none}.esri-input::placeholder{opacity:1;color:var(--calcite-color-text-2)}.esri-input:placeholder-shown{text-overflow:ellipsis}.esri-input[type=text],.esri-input[type=password],.esri-input[type=number]{height:32px;padding:0 .5em}calcite-combobox.esri-input{border:none}.esri-widget__content--empty{text-align:center;color:var(--calcite-color-border-input);flex-flow:column wrap;align-items:center;padding:18px 22px;display:flex}.esri-widget__content--empty h1.esri-widget__heading,.esri-widget__content--empty h2.esri-widget__heading,.esri-widget__content--empty h3.esri-widget__heading,.esri-widget__content--empty h4.esri-widget__heading,.esri-widget__content--empty h5.esri-widget__heading{font-weight:var(--calcite-font-weight-regular)}.esri-widget__content-illustration--empty{width:128px;padding:1rem 0}.esri-widget__content-icon--empty{width:32px;padding:.5rem 0}.esri-select{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background:var(--calcite-color-foreground-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 -8 32 32' width='32' height='32'%3E%3Cpath d='M8 11.207l-4-4V5.793l4 4 4-4v1.414z' fill='%23adadad' fillrule='nonzero'/%3E%3C/svg%3E") 100% no-repeat;border:1px solid #959595;border-radius:0;width:100%;height:32px;margin:0;padding:0 .5em;font-family:inherit;font-size:.85em;display:block}.esri-select[disabled]{cursor:auto}.esri-select::-ms-expand{display:none}.esri-disabled a,.esri-disabled [role=menu],.esri-disabled [role=checkbox],.esri-disabled [class^=esri-icon-],.esri-disabled [class*=" esri-icon-"]{color:var(--calcite-color-text-3)}.keynav-mode .esri-widget:focus,.keynav-mode .esri-widget :focus{z-index:1;outline-offset:2px;outline:2px solid #adadad}.esri-widget__loader-animation{border:.15em solid #adadad4d;border-top-color:var(--calcite-color-border-input);border-radius:100%;width:1em;height:1em;font-size:var(--calcite-font-size-md);animation:1.25s linear infinite esri-rotate;display:block;transform:translateZ(0)}:dir(rtl) .esri-widget__table th{text-align:right;border-left:3px solid #0000000d;border-right:none}:dir(rtl) .esri-select{background-position:0}:dir(rtl) .esri-menu__list-item{border-left:none;border-right:3px solid #0000}:dir(rtl) .esri-menu__list-item [class^=esri-icon-],:dir(rtl) .esri-menu__list-item [class*=" esri-icon-"]{padding-left:2px;padding-right:0}:dir(rtl) .esri-menu__list-item--active{border-right-color:var(--calcite-color-brand)}.esri-icon-font-fallback-text{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.esri-rotating{animation:1.25s linear infinite esri-rotate;transform:translateZ(0)}.esri-clearfix:before,.esri-clearfix:after{content:" ";display:table}.esri-clearfix:after{clear:both}.esri-interactive{cursor:pointer}.esri-hidden{display:none!important}.esri-invisible{visibility:hidden!important}.esri-offscreen{position:absolute;top:-999em;left:-999em}.esri-match-height{flex-direction:column;flex:auto;display:flex;overflow:hidden}@supports (-ms-ime-align: auto){.esri-slider__anchor:focus{outline:1px dotted var(--calcite-color-foreground-current)}}.esri-slider{-webkit-user-select:none;user-select:none;direction:ltr;width:100%;height:100%;display:flex}.esri-disabled{pointer-events:none}.esri-disabled .esri-slider__content,.esri-disabled .esri-slider__min,.esri-disabled .esri-slider__max{opacity:var(--calcite-opacity-light)}.esri-slider--reversed.esri-slider--horizontal{flex-direction:row-reverse}.esri-slider--reversed.esri-slider--vertical{flex-direction:column}.esri-slider--horizontal{flex-direction:row}.esri-slider--horizontal .esri-slider__content{height:auto}.esri-slider--horizontal .esri-slider__track{width:100%;height:2px}.esri-slider--horizontal .esri-slider__segment--interactive:hover{cursor:ew-resize}.esri-slider--horizontal .esri-slider__anchor{width:1px;height:100%}.esri-slider--horizontal .esri-slider__label{text-align:center;margin:0 11px;top:-30px;left:-50px}.esri-slider--horizontal .esri-slider__label-input{text-align:center}.esri-slider--horizontal .esri-slider__max,.esri-slider--horizontal .esri-slider__min{flex:none;width:50px;height:auto;margin:auto}.esri-slider--horizontal .esri-slider__ticks{width:100%;margin:9px 0 0;top:100%;left:0}.esri-slider--horizontal .esri-slider__tick{width:1px;height:5px}.esri-slider--horizontal .esri-slider__tick-label{margin-top:18px}.esri-slider--vertical{flex-direction:column-reverse}.esri-slider--vertical .esri-slider__content{flex-direction:column;width:auto}.esri-slider--vertical .esri-slider__track{flex-direction:column;flex:1 0 0;width:2px;height:100%}.esri-slider--vertical .esri-slider__segment--interactive:hover{cursor:ns-resize}.esri-slider--vertical .esri-slider__anchor{width:100%;height:1px}.esri-slider--vertical .esri-slider__label{text-align:left;top:-10px;left:20px}.esri-slider--vertical .esri-slider__max,.esri-slider--vertical .esri-slider__min{flex:0 0 22px;width:100%;margin:auto}.esri-slider--vertical .esri-slider__ticks{margin:0 0 0 11px;top:0;left:100%}.esri-slider--vertical .esri-slider__tick{width:5px;height:1px}.esri-slider--vertical .esri-slider__tick-label{margin-left:30px}.esri-slider__content{z-index:0;flex:1 0 auto;justify-content:center;align-items:center;margin:auto;line-height:0;display:flex;position:relative}.esri-slider__track{touch-action:none;background-color:var(--calcite-color-border-ghost);display:inline-block;position:relative}.esri-slider__segment{transform-origin:0 0;will-change:transform;touch-action:none;width:100%;height:100%;position:absolute;top:0;left:0}.esri-slider__segment:hover{cursor:pointer}.esri-slider__anchor{touch-action:none;-webkit-user-select:none;user-select:none;background-color:var(--calcite-color-brand);position:absolute}.esri-slider__anchor:focus .esri-slider__thumb,.esri-slider__anchor:focus .esri-slider__label{outline:inherit}.esri-slider__anchor--moving:focus .esri-slider__thumb{cursor:grabbing;border:3px solid var(--calcite-color-brand-press)}.esri-slider__anchor--moving .esri-slider__label:hover,.esri-slider__anchor--moving .esri-slider__label--interactive:hover{cursor:grabbing}.esri-slider__thumb{box-sizing:border-box;z-index:1;touch-action:none;background-color:var(--calcite-color-foreground-2);border:2px solid var(--calcite-color-brand);border-radius:16px;width:16px;height:16px;transition:all .125s ease-in-out;position:absolute;top:-7px;left:-7px}.esri-slider__thumb:hover{cursor:grab;border-width:3px;border-color:var(--calcite-color-brand-press);width:19.2px;height:19.2px;top:-8.6px;left:-8.6px}.esri-slider__label{min-width:80px;line-height:var(--calcite-font-line-height-fixed-xl);position:absolute}.esri-slider__label:hover{cursor:grab}.esri-slider__label--interactive:hover,.esri-slider__max--interactive:hover,.esri-slider__min--interactive:hover{cursor:pointer;text-decoration:underline}.esri-slider__label-input{z-index:1;width:100%;position:relative}.esri-slider__extra-content{display:inline-block}.esri-slider__max,.esri-slider__min{text-align:center;justify-content:center;align-items:center;height:22px;line-height:var(--calcite-font-line-height-fixed-xl);display:flex}.esri-slider__max--interactive:hover,.esri-slider__min--interactive:hover{background-color:var(--calcite-color-foreground-2)}.esri-slider__range-input{text-align:center;width:100%;padding:1px 0}.esri-slider__ticks{z-index:0;height:100%;display:inline-block;position:absolute}.esri-slider__tick{background:var(--calcite-color-foreground-1);position:absolute}.esri-slider__tick-label{width:max-content;position:absolute}:dir(rtl) .esri-slider__label,:dir(rtl) .esri-slider__max,:dir(rtl) .esri-slider__min,:dir(rtl) .esri-slider__tick-label{direction:rtl;unicode-bidi:plaintext}:dir(rtl) .esri-slider__range-input,:dir(rtl) .esri-slider__label-input{unicode-bidi:plaintext}:host{width:350px}.root{display:flex;flex-direction:column;overflow:hidden;gap:var(--calcite-spacing-md);justify-content:space-between;padding:var(--arcgis-internal-padding);position:relative;calcite-label{--calcite-label-margin-bottom: 0}&.loading>*:not(calcite-scrim){opacity:0}}.unsupported{padding:0 var(--calcite-spacing-lg);animation:esri-fade-in .25s ease-in-out}.slider{margin-block-start:0rem}.time-configuration{--date-play-button-offset: 11px;--slider-play-button-offset: var(--calcite-spacing-md-plus);display:grid;gap:var(--calcite-spacing-md);grid-template-columns:1fr min-content;.slider-container{grid-column:1;+calcite-button{grid-column:2;transform:translateY(var(--slider-play-button-offset))}}.timezone-input-container{grid-column:1;min-width:0;+span{grid-column:2}}.date-picker-container{grid-column:1;+calcite-button{grid-column:2;transform:translateY(var(--date-play-button-offset))}}calcite-button{place-self:center}}`,Xe={day:1,night:6,twilight:2/3},J=class extends X{constructor(){super(...arguments),this.messages=ie({blocking:!0}),this.#r="none",this.#s=null,this.#a=R(),this.#o=R(),this.#d=200,this.#h=200,this.#e={},this._offset=F(e=>m(this._lighting)?this._lighting.displayUTCOffset??e:e),this._timesliderPosition=F(e=>{if(m(this._lighting)){let i=this._lighting.displayUTCOffset??0,r=this._lighting.date;if(M(r)){let{minutesSinceMidnight:s}=T(r,i);return s}else return e}return e}),this._localDate=F(e=>ae(this._view)??e),this.view=te(this),this.autoDestroyDisabled=!1,this.dateOrSeason="date",this.headingLevel=2,this.hideDatePicker=!1,this.hideHeader=!1,this.hidePlayButtons=!1,this.hideShadowsToggle=!1,this.hideSunLightingToggle=!1,this.hideTimezone=!1,this.icon="brightness",this.playSpeedMultiplier=1,this.timeSliderSteps=5,this.arcgisReady=j(),this.arcgisUserDateTimeChange=j(),this.#c=!1}static{this.properties={view:0,_playingState:16,_sunlightingDisabled:16,autoDestroyDisabled:5,currentSeason:1,dateOrSeason:3,dayPlaying:5,_directShadowsDisabled:16,headingLevel:9,hideDatePicker:5,hideHeader:5,hidePlayButtons:5,hideShadowsToggle:5,hideSunLightingToggle:5,hideTimezone:5,icon:3,label:1,playSpeedMultiplier:9,referenceElement:1,timeSliderSteps:9,utcOffset:9,timeSliderPosition:9,localDate:1,yearPlaying:5}}static{this.styles=We}get _view(){return this.view?.type==="3d"?this.view:void 0}#i;#r;#s;#t;#a;#o;#d;#h;#l(){if(this.#t)return;let e=se(()=>{if(this.#t?.remove(),m(this._lighting)){let i=this.utcOffset??0,r=this.timeSliderPosition??0,s=this.localDate,n=r-i*60,a=k(s,n,"minutes");this._lighting.date=a,this._lighting.displayUTCOffset=i}},{timeout:this.#d});this.#t=U(()=>{ne(e),this.#t=void 0})}#u({scale:e,disabled:i}){let{messages:r}=this;return p`<calcite-label .scale=${e} class="date-picker-container">${r.date}${ei({disabled:i,scale:e,date:this.localDateAsString,onDateChange:s=>{let n=s.currentTarget.value,a=Array.isArray(n)?n[0]:n;this._stopPlaying(),this.localDate=a,this._emitUserDateTimeChangeEvent()}})}</calcite-label>${D({hidden:this.hidePlayButtons,children:pe({playing:this.yearPlaying,disabled:i,label:r.playYear,onClick:()=>{this._playingState==="year"?this._playingState="none":this._playingState="year"},scale:e})})}`}#p({scale:e,disabled:i}){let{messages:r}=this;return p`<calcite-label .scale=${e} class="date-picker-container">${r.season}${ii({scale:e,selectedSeason:this.currentSeason,disabled:i,messages:r,onSeasonChange:s=>{this._stopPlaying(),this.currentSeason=s.currentTarget.value}})}</calcite-label>`}#e;get#g(){return this.#o?.value?.startTime}get localDateAsString(){return this._localDate.value??""}get _playingState(){return this.#r}set _playingState(e){this.#r=e,this.#n?.remove(),e==="none"?this.#i?.remove():(this._play(e),this._emitUserDateTimeChangeEvent())}get _lighting(){return this._view?.environment?.lighting}get _sunlightingDisabled(){return!m(this._lighting)}set _sunlightingDisabled(e){this.#e.sunlightingDisabled=e;let i=this._view?.environment;if(i==null)return;let r=i.lighting,s=this.#s;this.#s=r;let n={directShadowsEnabled:r.directShadowsEnabled,glow:r.glow};m(r)&&(n.cameraTrackingEnabled=r.cameraTrackingEnabled);let a=e?"virtual":"sun",l;s?.type===a?l=s:l=e?new ke:new Se,l.set(n),i.lighting=l,e||(this._stopPlaying(),this.#a.value&&(this.#a.value.open=!1))}get currentSeason(){let e=this._view?.camera?.position?.latitude??0,i=ge(e);return Be(this.localDate,i)}set currentSeason(e){this._stopPlaying();let i=this._view?.camera?.position?.latitude??0,r=ge(i),s=K(e,r);this.localDate=P(this.localDate,s,"northern"),this._emitUserDateTimeChangeEvent()}get dayPlaying(){return this._playingState==="day"}set dayPlaying(e){this._playingState=e?"day":"none"}get _directShadowsDisabled(){return!this._lighting?.directShadowsEnabled}set _directShadowsDisabled(e){this.#e.directShadowsDisabled=e,this._lighting&&(this._lighting.directShadowsEnabled=!e)}get utcOffset(){return this._offset.value}set utcOffset(e){this._offset.mutate(e),this.#l()}get timeSliderPosition(){return this._timesliderPosition.value}set timeSliderPosition(e){this._timesliderPosition.mutate(_e(e??0,Fe)),this.#l()}get localDate(){return this._localDate.value!=null?new Date(this._localDate.value):new Date}set localDate(e){let i=new Date(e);if(M(i)){i.setUTCFullYear(i.getFullYear(),i.getMonth(),i.getDate());let r=i.toISOString().slice(0,10);this._localDate.mutate(r),this.#l()}}get yearPlaying(){return this._playingState==="year"}set yearPlaying(e){this._playingState=e?"year":"none"}async destroy(){await this.manager.destroy()}async load(){this.#e.utcOffset=this.utcOffset,this.#e.timeSliderPosition=this.timeSliderPosition,this.#e.localDate=this.localDateAsString,this.manager.onLifecycle(()=>[oe(()=>{let e=null;if(m(this._lighting)){let i=this._lighting.displayUTCOffset??0,r=this._lighting.date;if(M(r)){let{minutesSinceMidnight:s}=T(r,i);e=s}}return e},e=>{let i=this.#g;e!=null&&i!==e&&this._emitUserDateTimeChangeEvent()},{sync:!0}),oe(()=>{let e=this._view?.camera?.position;return e?ze(e):void 0},e=>{let i=this._lighting;m(i)&&i.cameraTrackingEnabled&&(i.displayUTCOffset=e)},{sync:!0,initial:!0}),ye(()=>!m(this._lighting),()=>{this._stopPlaying()}),me.onLocaleChange(()=>{this.requestUpdate()})]),this.manager.onDisconnected(()=>{this.#i?.remove(),this.#t?.remove(),this.#n?.remove()})}willUpdate(e){if(super.willUpdate(e),!!this.#c&&m(this._lighting)&&e.has("utcOffset")){let i=this.utcOffset??0,r=this._lighting.displayUTCOffset??0,s=this.timeSliderPosition??0,n=this.localDate,a=s-r*60,l=k(n,a,"minutes"),{minutesSinceMidnight:o,localDate:d}=T(l,i);this._timesliderPosition.mutate(o),this._localDate.mutate(d)}}#c;async loaded(){let e=new AbortController;this.manager.onDisconnected(()=>({remove:()=>{e.abort()}})),await re(De(()=>this._view?.ready,{signal:e.signal}).then(()=>{this.utcOffset=this.#e.utcOffset??this.utcOffset,this.timeSliderPosition=this.#e.timeSliderPosition??this.timeSliderPosition,this.localDate=this.#e.localDate??this.localDate,this.#e.directShadowsDisabled!=null&&(this._directShadowsDisabled=this.#e.directShadowsDisabled),this.#e.sunlightingDisabled!=null&&(this._sunlightingDisabled=this.#e.sunlightingDisabled),this.#e={}})),this.#c=!0}_emitUserDateTimeChangeEvent(){this.isConnected&&this.arcgisUserDateTimeChange.emit()}_stopPlaying(){this._playingState="none"}#n;#m(e){if(this.#n)return;let i=setTimeout(()=>{let r=e.displayUTCOffset??0,s=e.date,{minutesSinceMidnight:n}=T(s,r);this._timesliderPosition.mutate(n),this.#n?.remove()},this.#h);this.#n=U(()=>{clearTimeout(i),this.#n=void 0;let r=this._lighting;if(m(r)){let s=r.displayUTCOffset??0,n=r.date,{minutesSinceMidnight:a}=T(n,s);this._timesliderPosition.mutate(a)}})}_play(e){this.#i?.remove();let i=this._view;if(i==null||this._sunlightingDisabled)return;let r=i.environment.lighting;if(!m(r))return;let s=0;this.#i=Ke({mode:e,lighting:r,beforeProgress:()=>{s=this.#g??0},onProgress:(n,a)=>{this._timesliderPosition.mutate(s),this.#m(a)},getPlaySpeed:()=>{let n=this._view,a=this._view?.environment.lighting;if(n!=null&&m(a)){let l=n.camera.position.latitude??0,o=n.camera.position.longitude??0,{sunrise:d,sunset:c}=qe(a.date,l,o,a.displayUTCOffset??0);return Qe(d,c,a.date,Xe)*this.playSpeedMultiplier}else return A*this.playSpeedMultiplier}})}render(){let{messages:e,dateOrSeason:i}=this,r=this._sunlightingDisabled,s="m";if(this._view?.type!=="3d")return Y({class:"root",label:e.componentLabel,title:e.title,hideHeader:this.hideHeader,headingLevel:this.headingLevel,children:p`<div class="unsupported"><p>${e.unsupported}</p></div>`});let n=(this.utcOffset??0)*60,a=this.view?.ready===!0,l=Array.isArray(this.timeSliderSteps)?this.timeSliderSteps.at(0):this.timeSliderSteps;return Y({class:{root:!0,loading:!a},label:e.componentLabel,title:e.title,hideHeader:this.hideHeader,headingLevel:this.headingLevel,children:p`${a?void 0:p`<calcite-scrim loading></calcite-scrim>`}<div class="time-configuration" style=${G({columnGap:this.hidePlayButtons?"0":void 0})}><calcite-label class="slider-container" .scale=${s}>${e.timeSliderLabel}<arcgis-time-of-day-slider class="slider" .disabled=${this._sunlightingDisabled} mode=single .startTime=${this.timeSliderPosition??0} .steps=${l} style=${G({gridArea:"slider"})} @arcgisTimeChange=${({currentTarget:o})=>{this._stopPlaying(),this._emitUserDateTimeChangeEvent(),this.timeSliderPosition=o.startTime}} ${B(this.#o)}></arcgis-time-of-day-slider></calcite-label>${D({hidden:this.hidePlayButtons,children:pe({disabled:this._sunlightingDisabled,playing:this.dayPlaying,label:e.playDay,onClick:()=>{this._playingState==="day"?this._stopPlaying():this._playingState="day"},scale:s})})}${D({hidden:this.hideTimezone,children:p`<calcite-label .scale=${s} class="timezone-input-container">${e.timezone}<calcite-input-time-zone mode=offset overlay-positioning=fixed .scale=${s} .disabled=${this._sunlightingDisabled} .value=${`${n}`} .referenceDate=${this.localDateAsString} @calciteInputTimeZoneChange=${o=>{let d=+o.target.value;this.utcOffset=d/60,this._stopPlaying()}} ${B(this.#a)}></calcite-input-time-zone></calcite-label><span></span>`})}${D({hidden:this.hideDatePicker,children:i==="date"?this.#u({scale:s,disabled:r}):this.#p({scale:s,disabled:r})})}</div>${D({hidden:this.hideSunLightingToggle,children:ti({scale:s,messages:e.sunLightingToggle,sunlightingEnabled:!this._sunlightingDisabled,onSunLightingToggle:o=>{this._sunlightingDisabled=!o}})})}${D({hidden:this.hideShadowsToggle,children:ri({scale:s,messages:e.shadowsToggle,onShadowCheckboxChange:o=>{this._directShadowsDisabled=!o},shadowEnabled:!this._directShadowsDisabled})})}`})}};function pe({disabled:t,playing:e,onClick:i,label:r,scale:s="m"}){return p`<calcite-button appearance=solid .scale=${s} .disabled=${t} .iconStart=${e?"pause-f":"play-f"} .label=${r} @click=${i} round title=${r??O} type=button></calcite-button>`}function ei({disabled:t,date:e,onDateChange:i,scale:r}){return p`<calcite-input-date-picker data-testid=daylight-date-picker .disabled=${t} overlay-positioning=fixed placement=bottom .value=${e} .scale=${r} @calciteInputDatePickerChange=${i}></calcite-input-date-picker>`}function ii({messages:t,disabled:e,scale:i,selectedSeason:r,onSeasonChange:s}){return p`<calcite-select .disabled=${e} .label=${t.season} .scale=${i} .value=${r} @calciteSelectChange=${n=>{s(n)}}>${V.map(n=>p`<calcite-option .selected=${r===n} .value=${n}>${t[n]}</calcite-option>`)}</calcite-select>`}function ti({messages:t,sunlightingEnabled:e,onSunLightingToggle:i,scale:r}){return p`<calcite-label layout=inline .scale=${r} title=${t?.tooltip??O}><calcite-checkbox .scale=${r} .checked=${e} @calciteCheckboxChange=${s=>i(s.target.checked)}></calcite-checkbox>${t?.label}</calcite-label>`}function ri({messages:t,shadowEnabled:e,onShadowCheckboxChange:i,scale:r}){return p`<calcite-label layout=inline .scale=${r} title=${t?.tooltip??O}><calcite-checkbox .checked=${e} @calciteCheckboxChange=${s=>i(s.target.checked)}></calcite-checkbox>${t.label}</calcite-label>`}ee("arcgis-daylight",J);return J},"core/reactiveUtils","intl","views/3d/environment/SunLighting","views/3d/environment/VirtualLighting","applications/Components/reactiveUtils",a,b)
2
+ import{e as M,f as k,g as T,h as ae,i as m}from"./6C7SMFB2.js";import{a as U}from"./76KXMQ3Y.js";import{a as Y}from"./VB66GDWY.js";import{a as S}from"./WCESLPME.js";import b from"./DXIOCBFP.js";import"./E7SYUWIQ.js";import"./AGY724TJ.js";import"./VEYJ5V4O.js";import{a as ie}from"./CAYSZWRK.js";import"./DHVEHATY.js";import a from"./DXJ7TMEQ.js";import"./UFWKXIL5.js";import"./KCQB4NNK.js";import"./74XVTUIU.js";import"./ZNBKMZP7.js";import{M as R,N as B,O as X,Q as G,R as O,U as ee,a as W,b as p,x as j}from"./MQTZFCXF.js";import"./ALDX5YZO.js";export default $arcgis.t(([{watch:oe,when:ye,whenOnce:Se},me,De,ke,{createTrackingTarget:Te,runTracked:le,signal:$e},{a:te},{e:re,f:se,g:ne}])=>{function Pe(t,e){return t/15}function Ce(t,e){let i=t?.[0];if(i==null)return null;e||(e={hours:0,minutes:0,seconds:0}),e.hours=Pe(i);let r=e.hours%1;e.hours-=r,e.minutes=r*60;let s=e.minutes%1;return e.minutes-=s,e.seconds=Math.round(s*60),e}function ze(t){let e=Ce([t.longitude,t.latitude]);return e==null?0:Math.round(e.hours+e.minutes/60+e.seconds/3600)}function _e(t,e){return(t%e+e)%e}var q=class{#i;#r;#s=Te(()=>{this.#t()});constructor(e){this.#r=e;let i;le(this.#s,()=>{i=e()}),this.#i=$e(i)}#t(){let e=this.#i.value;le(this.#s,()=>{this.#i.value=this.#r(e)})}mutate(e){this.#i.value=e}get value(){return this.#i.value}};function F(t){return new q(t)}var N=Math.PI,g=Math.sin,$=Math.cos,Oe=Math.asin,Ue=Math.acos,w=N/180,fe=1e3*60*60*24,be=2440588,ve=2451545;function Me(t){return t.valueOf()/fe-.5+be}function E(t){return new Date((t+.5-be)*fe)}function Ee(t){return Me(t)-ve}var ce=w*23.4397;function Le(t,e){return Oe(g(e)*$(ce)+$(e)*g(ce)*g(t))}function Ae(t){return w*(357.5291+.98560028*t)}function Ne(t){return w*(1.9148*g(t)+.02*g(2*t)+3e-4*g(3*t))}function He(t,e){var i=w*102.9372;return t+e+i+N}var D={};D.PolarException={NORMAL:0,MIDNIGHT_SUN:1,POLAR_NIGHT:2};var Z=[[-.83,"sunrise","sunset"]],we=9e-4;function Ie(t,e){return Math.round(t-we-e/(2*N))}function de(t,e,i){return we+(t+e)/(2*N)+i}function he(t,e,i){return ve+t+.0053*g(e)-.0069*g(2*i)}function je(t,e,i){return Ue((g(t)-g(e)*g(i))/($(e)*$(i)))}D.getTimes=function(t,e,i){var r=w*-i,s=w*e,n=Ee(t),a=Ie(n,r),l=de(0,r,a),o=Ae(l),d=Ne(o),c=He(o,d),h=Le(c,0),u=he(l,o,c);function x(I){var z=je(I,s,h),xe=de(z,r,a);return he(xe,o,c)}function y(I){var z=(g(I)-g(s)*g(h))/($(s)*$(h));return z<-1?D.PolarException.MIDNIGHT_SUN:z>1?D.PolarException.POLAR_NIGHT:D.PolarException.NORMAL}var f={solarNoon:E(u),nadir:E(u-.5),polarException:D.PolarException.NORMAL},v,_,C,H,Q;for(v=0,_=Z.length;v<_;v+=1)C=Z[v],H=x(C[0]*w),Q=u-(H-u),f[C[1]]=E(Q),f[C[2]]=E(H);return f.polarException=y(Z[0][0]*w),f};var Re={spring:{dayOfMonth:20,month:2},summer:{dayOfMonth:21,month:5},fall:{dayOfMonth:23,month:8},winter:{dayOfMonth:21,month:11}},V=["spring","summer","fall","winter"];function P(t,e,i){let r=K(e,i),{dayOfMonth:s,month:n}=Re[r],a=new Date(t.getTime());return a.setMonth(n,s),a}function Be(t,e){let i=Ge(t);return K(i,e)}function Ge(t){let e=t.getTime(),i=P(t,"spring","northern").getTime(),r=P(t,"summer","northern").getTime(),s=P(t,"fall","northern").getTime(),n=P(t,"winter","northern").getTime();return e>=i&&e<r?"spring":e>=r&&e<s?"summer":e>=s&&e<n?"fall":"winter"}function K(t,e){return e==="northern"?t:Ye(t)}function ge(t){return t>=0?"northern":"southern"}function Ye(t){let e=V.indexOf(t);return V[(e+2)%4]}var Fe=1440,Ze=864e5;function qe(t,e,i,r){let s=D.getTimes(t,e,i),n=s.sunrise,a=s.sunset,l=k(t,r),o=k(n,r),d=k(a,r);if(l.getUTCDate()!==o.getUTCDate()||l.getUTCDate()!==d.getUTCDate()){let c=l.getTime()-o.getTime()>0?1:-1;n.setUTCDate(n.getUTCDate()+c),a.setUTCDate(a.getUTCDate()+c)}return{sunrise:n,sunset:a}}var Ve=100,Je=1e3,b=12e5,L=72e5;function ue(t,e){return _e(t+e,24)}function Ke({mode:t,lighting:e,getPlaySpeed:i,onProgress:r,beforeProgress:s}){let n=-1;function a(l=Date.now()){let o=e.date,d=Date.now()-(l??0);if(t==="day"){l=Date.now();let c=i()/Ve*d;if(c>0){let h=new Date(o.getTime()+c),u=e.displayUTCOffset??0,x=ue(h.getUTCHours(),u),y=ue(o.getUTCHours(),u);x<y&&(h=new Date(o.getTime()+c-Ze));let f=e.clone();s?.(),e.date=h,r?.(f,e)}}else if(d>Je){l=Date.now();let c=(o.getUTCMonth()+1)%12,h=new Date(o.getTime());h.setUTCMonth(c);let u=e.clone();s?.(),e.date=h,r?.(u,e)}n=requestAnimationFrame(()=>a(l))}return a(),U(()=>cancelAnimationFrame(n))}var A=b/4;function Qe(t,e,i,r){let{day:s,night:n=s,twilight:a=s}=r,l=s*A,o=n*A,d=a*A;if(t==null||e==null||Number.isNaN(t.getTime())&&Number.isNaN(e.getTime()))return l;let c=i.getTime(),h=t.getTime(),u=e.getTime(),x=h-L/2,y=h+L/2,f=u-L/3*2,v=u+L/3,_=l;return c>=x&&c<=y?c-x<=b?_=o-(c-x)/b*(o-d):y-c<=b/2?_=l-(y-c)/b*2*(l-d):_=d:c>=f&&c<=v?c-f<=b/2?_=l-(c-f)/b*2*(l-d):v-c<=b?_=o-(v-c)/b*(o-d):_=d:(c<h||c>u)&&(_=o),_}var We=W`.esri-widget__heading{color:var(--calcite-color-text-2);margin:0 0 .5rem;font-weight:var(--calcite-font-weight-semibold)}h1.esri-widget__heading{font-size:var(--calcite-font-size-xl)}h2.esri-widget__heading{font-size:var(--calcite-font-size-md)}h3.esri-widget__heading,h4.esri-widget__heading,h5.esri-widget__heading,h6.esri-widget__heading{font-size:var(--calcite-font-size)}.esri-widget{box-sizing:border-box;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget *,.esri-widget :before,.esri-widget :after{box-sizing:inherit}.esri-widget.esri-widget--disabled>*{opacity:.4;pointer-events:none}.esri-widget.esri-widget--compact{--esri-widget-padding-y: 0;--esri-widget-padding-x: 0}.esri-widget__anchor{color:var(--calcite-color-text-2)}.esri-widget__anchor:hover{color:var(--calcite-color-text-3)}.esri-widget__anchor:hover,.esri-widget__anchor:focus{text-decoration:underline}.esri-widget__anchor--disabled{opacity:.4;pointer-events:none}.esri-widget__header{background-color:var(--calcite-color-foreground-1);flex:1 0 100%;justify-content:space-between;align-items:center;width:100%;min-height:48px;padding:12px 0 12px 15px;display:flex}.esri-widget__heading{word-break:break-word}.esri-widget__header .esri-widget__heading{width:calc(100% - 48px);text-align:initial;color:var(--calcite-color-text-1);align-items:center;margin:0;padding:0;display:flex}.esri-widget__header-button{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);border:none;flex:0 0 48px;justify-content:center;align-self:stretch;align-items:center;width:48px;padding:0;display:flex}.esri-widget__footer{background-color:var(--calcite-color-foreground-1);justify-content:center;align-items:center;width:100%;min-height:48px;display:flex}.esri-widget__footer-pagination{color:var(--calcite-color-text-2);justify-content:space-between;align-items:center;display:flex}.esri-widget__footer-pagination-previous-button,.esri-widget__footer-pagination-next-button{cursor:pointer;background-color:var(--calcite-color-foreground-1);border:0;margin:0 7px;padding:12px 15px;transition:background-color .125s ease-in-out}.esri-widget__footer-pagination-previous-button:hover,.esri-widget__footer-pagination-previous-button:focus,.esri-widget__footer-pagination-next-button:hover,.esri-widget__footer-pagination-next-button:focus{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1)}.esri-menu{visibility:hidden;z-index:1;background-clip:padding;background-color:var(--calcite-color-foreground-1);background-clip:padding-box;width:100%;max-height:0;margin:2px 0 0;padding:0;font-size:var(--calcite-font-size);line-height:var(--calcite-spacing-xl);position:absolute;top:100%;left:0;overflow:hidden;box-shadow:0 1px 2px #0000004d}.esri-menu .esri-menu__header{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse);padding:6px 12px}.esri-menu__list{margin:0;padding:0;list-style:none}.esri-menu__list-item{cursor:pointer;border-top:1px solid #adadad4d;border-left:3px solid #0000;padding:.8em 1em}.esri-menu__list-item [class^=esri-icon-],.esri-menu__list-item [class*=" esri-icon-"]{padding-right:2.8px}.esri-menu__list-item:first-child{border-top:none}.esri-menu__list-item--focus,.esri-menu__list-item:hover,.esri-menu__list-item:focus{background-color:var(--calcite-color-foreground-1)}.esri-menu__list-item:active{background-color:var(--calcite-color-foreground-current)}.esri-menu__list-item--active,.esri-menu__list-item--active:hover,.esri-menu__list-item--active:focus{background-color:var(--calcite-color-foreground-1);border-left-color:var(--calcite-color-brand)}.esri-widget__table{border-collapse:collapse;color:var(--calcite-color-text-1);border:none;width:100%;line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget__table tr:nth-child(odd){background-color:var(--calcite-color-transparent)}.esri-widget__table tr:nth-child(2n){background-color:var(--calcite-color-transparent-press)}.esri-widget__table tr a{color:var(--calcite-color-text-2)}.esri-widget__table tr a:hover,.esri-widget__table tr a:focus{color:var(--calcite-color-text-1)}.esri-widget__table tr td,.esri-widget__table tr th{vertical-align:top;word-break:break-word;padding:.5em .7em;font-size:var(--calcite-font-size-sm);font-weight:var(--calcite-font-weight-regular)}.esri-widget__table tr th{text-align:left;border-right:3px solid #0000000d;width:50%}.esri-widget__table tr td{width:50%}.esri-input{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1);border:1px solid #959595;font-size:var(--calcite-font-size)}.esri-input::-ms-clear{display:none}.esri-input::placeholder{opacity:1;color:var(--calcite-color-text-2)}.esri-input:placeholder-shown{text-overflow:ellipsis}.esri-input[type=text],.esri-input[type=password],.esri-input[type=number]{height:32px;padding:0 .5em}calcite-combobox.esri-input{border:none}.esri-widget__content--empty{text-align:center;color:var(--calcite-color-border-input);flex-flow:column wrap;align-items:center;padding:18px 22px;display:flex}.esri-widget__content--empty h1.esri-widget__heading,.esri-widget__content--empty h2.esri-widget__heading,.esri-widget__content--empty h3.esri-widget__heading,.esri-widget__content--empty h4.esri-widget__heading,.esri-widget__content--empty h5.esri-widget__heading{font-weight:var(--calcite-font-weight-regular)}.esri-widget__content-illustration--empty{width:128px;padding:1rem 0}.esri-widget__content-icon--empty{width:32px;padding:.5rem 0}.esri-select{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background:var(--calcite-color-foreground-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 -8 32 32' width='32' height='32'%3E%3Cpath d='M8 11.207l-4-4V5.793l4 4 4-4v1.414z' fill='%23adadad' fillrule='nonzero'/%3E%3C/svg%3E") 100% no-repeat;border:1px solid #959595;border-radius:0;width:100%;height:32px;margin:0;padding:0 .5em;font-family:inherit;font-size:.85em;display:block}.esri-select[disabled]{cursor:auto}.esri-select::-ms-expand{display:none}.esri-disabled a,.esri-disabled [role=menu],.esri-disabled [role=checkbox],.esri-disabled [class^=esri-icon-],.esri-disabled [class*=" esri-icon-"]{color:var(--calcite-color-text-3)}.keynav-mode .esri-widget:focus,.keynav-mode .esri-widget :focus{z-index:1;outline-offset:2px;outline:2px solid #adadad}.esri-widget__loader-animation{border:.15em solid #adadad4d;border-top-color:var(--calcite-color-border-input);border-radius:100%;width:1em;height:1em;font-size:var(--calcite-font-size-md);animation:1.25s linear infinite esri-rotate;display:block;transform:translateZ(0)}:dir(rtl) .esri-widget__table th{text-align:right;border-left:3px solid #0000000d;border-right:none}:dir(rtl) .esri-select{background-position:0}:dir(rtl) .esri-menu__list-item{border-left:none;border-right:3px solid #0000}:dir(rtl) .esri-menu__list-item [class^=esri-icon-],:dir(rtl) .esri-menu__list-item [class*=" esri-icon-"]{padding-left:2px;padding-right:0}:dir(rtl) .esri-menu__list-item--active{border-right-color:var(--calcite-color-brand)}.esri-icon-font-fallback-text{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.esri-rotating{animation:1.25s linear infinite esri-rotate;transform:translateZ(0)}.esri-clearfix:before,.esri-clearfix:after{content:" ";display:table}.esri-clearfix:after{clear:both}.esri-interactive{cursor:pointer}.esri-hidden{display:none!important}.esri-invisible{visibility:hidden!important}.esri-offscreen{position:absolute;top:-999em;left:-999em}.esri-match-height{flex-direction:column;flex:auto;display:flex;overflow:hidden}@supports (-ms-ime-align: auto){.esri-slider__anchor:focus{outline:1px dotted var(--calcite-color-foreground-current)}}.esri-slider{-webkit-user-select:none;user-select:none;direction:ltr;width:100%;height:100%;display:flex}.esri-disabled{pointer-events:none}.esri-disabled .esri-slider__content,.esri-disabled .esri-slider__min,.esri-disabled .esri-slider__max{opacity:var(--calcite-opacity-light)}.esri-slider--reversed.esri-slider--horizontal{flex-direction:row-reverse}.esri-slider--reversed.esri-slider--vertical{flex-direction:column}.esri-slider--horizontal{flex-direction:row}.esri-slider--horizontal .esri-slider__content{height:auto}.esri-slider--horizontal .esri-slider__track{width:100%;height:2px}.esri-slider--horizontal .esri-slider__segment--interactive:hover{cursor:ew-resize}.esri-slider--horizontal .esri-slider__anchor{width:1px;height:100%}.esri-slider--horizontal .esri-slider__label{text-align:center;margin:0 11px;top:-30px;left:-50px}.esri-slider--horizontal .esri-slider__label-input{text-align:center}.esri-slider--horizontal .esri-slider__max,.esri-slider--horizontal .esri-slider__min{flex:none;width:50px;height:auto;margin:auto}.esri-slider--horizontal .esri-slider__ticks{width:100%;margin:9px 0 0;top:100%;left:0}.esri-slider--horizontal .esri-slider__tick{width:1px;height:5px}.esri-slider--horizontal .esri-slider__tick-label{margin-top:18px}.esri-slider--vertical{flex-direction:column-reverse}.esri-slider--vertical .esri-slider__content{flex-direction:column;width:auto}.esri-slider--vertical .esri-slider__track{flex-direction:column;flex:1 0 0;width:2px;height:100%}.esri-slider--vertical .esri-slider__segment--interactive:hover{cursor:ns-resize}.esri-slider--vertical .esri-slider__anchor{width:100%;height:1px}.esri-slider--vertical .esri-slider__label{text-align:left;top:-10px;left:20px}.esri-slider--vertical .esri-slider__max,.esri-slider--vertical .esri-slider__min{flex:0 0 22px;width:100%;margin:auto}.esri-slider--vertical .esri-slider__ticks{margin:0 0 0 11px;top:0;left:100%}.esri-slider--vertical .esri-slider__tick{width:5px;height:1px}.esri-slider--vertical .esri-slider__tick-label{margin-left:30px}.esri-slider__content{z-index:0;flex:1 0 auto;justify-content:center;align-items:center;margin:auto;line-height:0;display:flex;position:relative}.esri-slider__track{touch-action:none;background-color:var(--calcite-color-border-ghost);display:inline-block;position:relative}.esri-slider__segment{transform-origin:0 0;will-change:transform;touch-action:none;width:100%;height:100%;position:absolute;top:0;left:0}.esri-slider__segment:hover{cursor:pointer}.esri-slider__anchor{touch-action:none;-webkit-user-select:none;user-select:none;background-color:var(--calcite-color-brand);position:absolute}.esri-slider__anchor:focus .esri-slider__thumb,.esri-slider__anchor:focus .esri-slider__label{outline:inherit}.esri-slider__anchor--moving:focus .esri-slider__thumb{cursor:grabbing;border:3px solid var(--calcite-color-brand-press)}.esri-slider__anchor--moving .esri-slider__label:hover,.esri-slider__anchor--moving .esri-slider__label--interactive:hover{cursor:grabbing}.esri-slider__thumb{box-sizing:border-box;z-index:1;touch-action:none;background-color:var(--calcite-color-foreground-2);border:2px solid var(--calcite-color-brand);border-radius:16px;width:16px;height:16px;transition:all .125s ease-in-out;position:absolute;top:-7px;left:-7px}.esri-slider__thumb:hover{cursor:grab;border-width:3px;border-color:var(--calcite-color-brand-press);width:19.2px;height:19.2px;top:-8.6px;left:-8.6px}.esri-slider__label{min-width:80px;line-height:var(--calcite-font-line-height-fixed-xl);position:absolute}.esri-slider__label:hover{cursor:grab}.esri-slider__label--interactive:hover,.esri-slider__max--interactive:hover,.esri-slider__min--interactive:hover{cursor:pointer;text-decoration:underline}.esri-slider__label-input{z-index:1;width:100%;position:relative}.esri-slider__extra-content{display:inline-block}.esri-slider__max,.esri-slider__min{text-align:center;justify-content:center;align-items:center;height:22px;line-height:var(--calcite-font-line-height-fixed-xl);display:flex}.esri-slider__max--interactive:hover,.esri-slider__min--interactive:hover{background-color:var(--calcite-color-foreground-2)}.esri-slider__range-input{text-align:center;width:100%;padding:1px 0}.esri-slider__ticks{z-index:0;height:100%;display:inline-block;position:absolute}.esri-slider__tick{background:var(--calcite-color-foreground-1);position:absolute}.esri-slider__tick-label{width:max-content;position:absolute}:dir(rtl) .esri-slider__label,:dir(rtl) .esri-slider__max,:dir(rtl) .esri-slider__min,:dir(rtl) .esri-slider__tick-label{direction:rtl;unicode-bidi:plaintext}:dir(rtl) .esri-slider__range-input,:dir(rtl) .esri-slider__label-input{unicode-bidi:plaintext}:host{width:350px}.root{display:flex;flex-direction:column;overflow:hidden;gap:var(--calcite-spacing-md);justify-content:space-between;padding:var(--arcgis-internal-padding);position:relative;calcite-label{--calcite-label-margin-bottom: 0}&.loading>*:not(calcite-scrim){opacity:0}}.unsupported{padding:0 var(--calcite-spacing-lg);animation:esri-fade-in .25s ease-in-out}.slider{margin-block-start:0rem}.time-configuration{--date-play-button-offset: 11px;--slider-play-button-offset: var(--calcite-spacing-md-plus);display:grid;gap:var(--calcite-spacing-md);grid-template-columns:1fr min-content;.slider-container{grid-column:1;+calcite-button{grid-column:2;transform:translateY(var(--slider-play-button-offset))}}.timezone-input-container{grid-column:1;min-width:0;+span{grid-column:2}}.date-picker-container{grid-column:1;+calcite-button{grid-column:2;transform:translateY(var(--date-play-button-offset))}}calcite-button{place-self:center}}`,Xe={day:1,night:6,twilight:2/3},J=class extends X{constructor(){super(...arguments),this.messages=ie({blocking:!0}),this.#r="none",this.#s=null,this.#a=R(),this.#o=R(),this.#d=200,this.#h=200,this.#e={},this._offset=F(e=>m(this._lighting)?this._lighting.displayUTCOffset??e:e),this._timesliderPosition=F(e=>{if(m(this._lighting)){let i=this._lighting.displayUTCOffset??0,r=this._lighting.date;if(M(r)){let{minutesSinceMidnight:s}=T(r,i);return s}else return e}return e}),this._localDate=F(e=>ae(this._view)??e),this.view=te(this),this.autoDestroyDisabled=!1,this.dateOrSeason="date",this.headingLevel=2,this.hideDatePicker=!1,this.hideHeader=!1,this.hidePlayButtons=!1,this.hideShadowsToggle=!1,this.hideSunLightingToggle=!1,this.hideTimezone=!1,this.icon="brightness",this.playSpeedMultiplier=1,this.timeSliderSteps=5,this.arcgisReady=j(),this.arcgisUserDateTimeChange=j(),this.#c=!1}static{this.properties={view:0,_playingState:16,_sunlightingDisabled:16,autoDestroyDisabled:5,currentSeason:1,dateOrSeason:3,dayPlaying:5,_directShadowsDisabled:16,headingLevel:9,hideDatePicker:5,hideHeader:5,hidePlayButtons:5,hideShadowsToggle:5,hideSunLightingToggle:5,hideTimezone:5,icon:3,label:1,playSpeedMultiplier:9,referenceElement:1,timeSliderSteps:9,utcOffset:9,timeSliderPosition:9,localDate:1,yearPlaying:5}}static{this.styles=We}get _view(){return this.view?.type==="3d"?this.view:void 0}#i;#r;#s;#t;#a;#o;#d;#h;#l(){if(this.#t)return;let e=se(()=>{if(this.#t?.remove(),m(this._lighting)){let i=this.utcOffset??0,r=this.timeSliderPosition??0,s=this.localDate,n=r-i*60,a=k(s,n,"minutes");this._lighting.date=a,this._lighting.displayUTCOffset=i}},{timeout:this.#d});this.#t=U(()=>{ne(e),this.#t=void 0})}#u({scale:e,disabled:i}){let{messages:r}=this;return p`<calcite-label .scale=${e} class="date-picker-container">${r.date}${ei({disabled:i,scale:e,date:this.localDateAsString,onDateChange:s=>{let n=s.currentTarget.value,a=Array.isArray(n)?n[0]:n;this._stopPlaying(),this.localDate=a,this._emitUserDateTimeChangeEvent()}})}</calcite-label>${S({hidden:this.hidePlayButtons,children:pe({playing:this.yearPlaying,disabled:i,label:r.playYear,onClick:()=>{this._playingState==="year"?this._playingState="none":this._playingState="year"},scale:e})})}`}#p({scale:e,disabled:i}){let{messages:r}=this;return p`<calcite-label .scale=${e} class="date-picker-container">${r.season}${ii({scale:e,selectedSeason:this.currentSeason,disabled:i,messages:r,onSeasonChange:s=>{this._stopPlaying(),this.currentSeason=s.currentTarget.value}})}</calcite-label>`}#e;get#g(){return this.#o?.value?.startTime}get localDateAsString(){return this._localDate.value??""}get _playingState(){return this.#r}set _playingState(e){this.#r=e,this.#n?.remove(),e==="none"?this.#i?.remove():(this._play(e),this._emitUserDateTimeChangeEvent())}get _lighting(){return this._view?.environment?.lighting}get _sunlightingDisabled(){return!m(this._lighting)}set _sunlightingDisabled(e){this.#e.sunlightingDisabled=e;let i=this._view?.environment;if(i==null)return;let r=i.lighting,s=this.#s;this.#s=r;let n={directShadowsEnabled:r.directShadowsEnabled,glow:r.glow};m(r)&&(n.cameraTrackingEnabled=r.cameraTrackingEnabled);let a=e?"virtual":"sun",l;s?.type===a?l=s:l=e?new ke:new De,l.set(n),i.lighting=l,e||(this._stopPlaying(),this.#a.value&&(this.#a.value.open=!1))}get currentSeason(){let e=this._view?.camera?.position?.latitude??0,i=ge(e);return Be(this.localDate,i)}set currentSeason(e){this._stopPlaying();let i=this._view?.camera?.position?.latitude??0,r=ge(i),s=K(e,r);this.localDate=P(this.localDate,s,"northern"),this._emitUserDateTimeChangeEvent()}get dayPlaying(){return this._playingState==="day"}set dayPlaying(e){this._playingState=e?"day":"none"}get _directShadowsDisabled(){return!this._lighting?.directShadowsEnabled}set _directShadowsDisabled(e){this.#e.directShadowsDisabled=e,this._lighting&&(this._lighting.directShadowsEnabled=!e)}get utcOffset(){return this._offset.value}set utcOffset(e){this._offset.mutate(e),this.#l()}get timeSliderPosition(){return this._timesliderPosition.value}set timeSliderPosition(e){this._timesliderPosition.mutate(_e(e??0,Fe)),this.#l()}get localDate(){return this._localDate.value!=null?new Date(this._localDate.value):new Date}set localDate(e){let i=new Date(e);if(M(i)){i.setUTCFullYear(i.getFullYear(),i.getMonth(),i.getDate());let r=i.toISOString().slice(0,10);this._localDate.mutate(r),this.#l()}}get yearPlaying(){return this._playingState==="year"}set yearPlaying(e){this._playingState=e?"year":"none"}async destroy(){await this.manager.destroy()}async load(){this.#e.utcOffset=this.utcOffset,this.#e.timeSliderPosition=this.timeSliderPosition,this.#e.localDate=this.localDateAsString,this.manager.onLifecycle(()=>[oe(()=>{let e=null;if(m(this._lighting)){let i=this._lighting.displayUTCOffset??0,r=this._lighting.date;if(M(r)){let{minutesSinceMidnight:s}=T(r,i);e=s}}return e},e=>{let i=this.#g;e!=null&&i!==e&&this._emitUserDateTimeChangeEvent()},{sync:!0}),oe(()=>{let e=this._view?.camera?.position;return e?ze(e):void 0},e=>{let i=this._lighting;m(i)&&i.cameraTrackingEnabled&&(i.displayUTCOffset=e)},{sync:!0,initial:!0}),ye(()=>!m(this._lighting),()=>{this._stopPlaying()}),me.onLocaleChange(()=>{this.requestUpdate()})]),this.manager.onDisconnected(()=>{this.#i?.remove(),this.#t?.remove(),this.#n?.remove()})}willUpdate(e){if(super.willUpdate(e),!!this.#c&&m(this._lighting)&&e.has("utcOffset")){let i=this.utcOffset??0,r=this._lighting.displayUTCOffset??0,s=this.timeSliderPosition??0,n=this.localDate,a=s-r*60,l=k(n,a,"minutes"),{minutesSinceMidnight:o,localDate:d}=T(l,i);this._timesliderPosition.mutate(o),this._localDate.mutate(d)}}#c;async loaded(){let e=new AbortController;this.manager.onDisconnected(()=>({remove:()=>{e.abort()}})),await re(Se(()=>this._view?.ready,{signal:e.signal}).then(()=>{this.utcOffset=this.#e.utcOffset??this.utcOffset,this.timeSliderPosition=this.#e.timeSliderPosition??this.timeSliderPosition,this.localDate=this.#e.localDate??this.localDate,this.#e.directShadowsDisabled!=null&&(this._directShadowsDisabled=this.#e.directShadowsDisabled),this.#e.sunlightingDisabled!=null&&(this._sunlightingDisabled=this.#e.sunlightingDisabled),this.#e={};let i=this._playingState;i!=="none"&&this.#i==null&&this._play(i)})),this.#c=!0}_emitUserDateTimeChangeEvent(){this.isConnected&&this.arcgisUserDateTimeChange.emit()}_stopPlaying(){this._playingState="none"}#n;#m(e){if(this.#n)return;let i=setTimeout(()=>{let r=e.displayUTCOffset??0,s=e.date,{minutesSinceMidnight:n}=T(s,r);this._timesliderPosition.mutate(n),this.#n?.remove()},this.#h);this.#n=U(()=>{clearTimeout(i),this.#n=void 0;let r=this._lighting;if(m(r)){let s=r.displayUTCOffset??0,n=r.date,{minutesSinceMidnight:a}=T(n,s);this._timesliderPosition.mutate(a)}})}_play(e){this.#i?.remove();let i=this._view;if(i==null||this._sunlightingDisabled)return;let r=i.environment.lighting;if(!m(r))return;let s=0;this.#i=Ke({mode:e,lighting:r,beforeProgress:()=>{s=this.#g??0},onProgress:(n,a)=>{this._timesliderPosition.mutate(s),this.#m(a)},getPlaySpeed:()=>{let n=this._view,a=this._view?.environment.lighting;if(n!=null&&m(a)){let l=n.camera.position.latitude??0,o=n.camera.position.longitude??0,{sunrise:d,sunset:c}=qe(a.date,l,o,a.displayUTCOffset??0);return Qe(d,c,a.date,Xe)*this.playSpeedMultiplier}else return A*this.playSpeedMultiplier}})}render(){let{messages:e,dateOrSeason:i}=this,r=this._sunlightingDisabled,s="m";if(this._view?.type!=="3d")return Y({class:"root",label:e.componentLabel,title:e.title,hideHeader:this.hideHeader,headingLevel:this.headingLevel,children:p`<div class="unsupported"><p>${e.unsupported}</p></div>`});let n=(this.utcOffset??0)*60,a=this.view?.ready===!0,l=Array.isArray(this.timeSliderSteps)?this.timeSliderSteps.at(0):this.timeSliderSteps;return Y({class:{root:!0,loading:!a},label:e.componentLabel,title:e.title,hideHeader:this.hideHeader,headingLevel:this.headingLevel,children:p`${a?void 0:p`<calcite-scrim loading></calcite-scrim>`}<div class="time-configuration" style=${G({columnGap:this.hidePlayButtons?"0":void 0})}><calcite-label class="slider-container" .scale=${s}>${e.timeSliderLabel}<arcgis-time-of-day-slider class="slider" .disabled=${this._sunlightingDisabled} mode=single .startTime=${this.timeSliderPosition??0} .steps=${l} style=${G({gridArea:"slider"})} @arcgisTimeChange=${({currentTarget:o})=>{this._stopPlaying(),this._emitUserDateTimeChangeEvent(),this.timeSliderPosition=o.startTime}} ${B(this.#o)}></arcgis-time-of-day-slider></calcite-label>${S({hidden:this.hidePlayButtons,children:pe({disabled:this._sunlightingDisabled,playing:this.dayPlaying,label:e.playDay,onClick:()=>{this._playingState==="day"?this._stopPlaying():this._playingState="day"},scale:s})})}${S({hidden:this.hideTimezone,children:p`<calcite-label .scale=${s} class="timezone-input-container">${e.timezone}<calcite-input-time-zone mode=offset overlay-positioning=fixed .scale=${s} .disabled=${this._sunlightingDisabled} .value=${`${n}`} .referenceDate=${this.localDateAsString} @calciteInputTimeZoneChange=${o=>{let d=+o.target.value;this.utcOffset=d/60,this._stopPlaying()}} ${B(this.#a)}></calcite-input-time-zone></calcite-label><span></span>`})}${S({hidden:this.hideDatePicker,children:i==="date"?this.#u({scale:s,disabled:r}):this.#p({scale:s,disabled:r})})}</div>${S({hidden:this.hideSunLightingToggle,children:ti({scale:s,messages:e.sunLightingToggle,sunlightingEnabled:!this._sunlightingDisabled,onSunLightingToggle:o=>{this._sunlightingDisabled=!o}})})}${S({hidden:this.hideShadowsToggle,children:ri({scale:s,messages:e.shadowsToggle,onShadowCheckboxChange:o=>{this._directShadowsDisabled=!o},shadowEnabled:!this._directShadowsDisabled})})}`})}};function pe({disabled:t,playing:e,onClick:i,label:r,scale:s="m"}){return p`<calcite-button appearance=solid .scale=${s} .disabled=${t} .iconStart=${e?"pause-f":"play-f"} .label=${r} @click=${i} round title=${r??O} type=button></calcite-button>`}function ei({disabled:t,date:e,onDateChange:i,scale:r}){return p`<calcite-input-date-picker data-testid=daylight-date-picker .disabled=${t} overlay-positioning=fixed placement=bottom .value=${e} .scale=${r} @calciteInputDatePickerChange=${i}></calcite-input-date-picker>`}function ii({messages:t,disabled:e,scale:i,selectedSeason:r,onSeasonChange:s}){return p`<calcite-select .disabled=${e} .label=${t.season} .scale=${i} .value=${r} @calciteSelectChange=${n=>{s(n)}}>${V.map(n=>p`<calcite-option .selected=${r===n} .value=${n}>${t[n]}</calcite-option>`)}</calcite-select>`}function ti({messages:t,sunlightingEnabled:e,onSunLightingToggle:i,scale:r}){return p`<calcite-label layout=inline .scale=${r} title=${t?.tooltip??O}><calcite-checkbox .scale=${r} .checked=${e} @calciteCheckboxChange=${s=>i(s.target.checked)}></calcite-checkbox>${t?.label}</calcite-label>`}function ri({messages:t,shadowEnabled:e,onShadowCheckboxChange:i,scale:r}){return p`<calcite-label layout=inline .scale=${r} title=${t?.tooltip??O}><calcite-checkbox .checked=${e} @calciteCheckboxChange=${s=>i(s.target.checked)}></calcite-checkbox>${t.label}</calcite-label>`}ee("arcgis-daylight",J);return J},"core/reactiveUtils","intl","views/3d/environment/SunLighting","views/3d/environment/VirtualLighting","applications/Components/reactiveUtils",a,b)