@arcgis/core 4.29.4 → 4.29.5

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 (28) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{9f0c5822e9f2761054ea.js → 07ef6a6c4f3fce7508eb.js} +1 -1
  3. package/assets/esri/core/workers/chunks/47504e296bf82357f6bb.js +1 -0
  4. package/assets/esri/core/workers/chunks/{686a76adc741eef369ee.js → 5db9739e00f15613d1ea.js} +1 -1
  5. package/kernel.js +1 -1
  6. package/layers/support/Sublayer.js +1 -1
  7. package/package.json +1 -1
  8. package/support/revision.js +1 -1
  9. package/symbols/support/urlUtils.js +1 -1
  10. package/views/2d/engine/Stage.js +1 -1
  11. package/views/2d/engine/webgl/shaderGraph/techniques/Technique.js +1 -1
  12. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js +1 -1
  13. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  14. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +5 -0
  15. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  16. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  17. package/views/2d/layers/StreamLayerView2D.js +1 -1
  18. package/views/2d/layers/features/Processor.js +1 -1
  19. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  20. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  21. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  22. package/views/2d/layers/support/handleNoEngineError.js +5 -0
  23. package/views/MapView.js +1 -1
  24. package/widgets/BasemapLayerList.js +1 -1
  25. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  26. package/widgets/LayerList/support/layerListUtils.js +1 -1
  27. package/widgets/LayerList.js +1 -1
  28. package/assets/esri/core/workers/chunks/a48201b109e9e9aab2d6.js +0 -1
package/views/MapView.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,sync as p,syncAndInitial as l}from"../core/reactiveUtils.js";import{initialize as h}from"../core/workers/workers.js";import{property as g}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import{isLoadedOrLoadFor as m}from"../geometry/projection.js";import y from"../layers/support/TileInfo.js";import{BreakpointsOwner as w}from"./BreakpointsOwner.js";import{DOMContainer as f}from"./DOMContainer.js";import{PopupView as M}from"./PopupView.js";import V from"./View.js";import v from"./2d/AnimationManager.js";import b from"./2d/FrameTask.js";import{GoToManager as _}from"./2d/GoToManager.js";import{layerView2DImporter as S}from"./2d/layerViewModuleImportUtils.js";import j from"./2d/MapViewConstraints.js";import T from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as L}from"./2d/viewpointUtils.js";import{ViewStateManager as O}from"./2d/ViewStateManager.js";import k from"./2d/input/MapViewInputManager.js";import R from"./2d/layers/features/support/TileStore.js";import C from"./2d/support/HighlightOptions.js";import{hitTest as x}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as D,takeScreenshot as E}from"./2d/support/screenshotUtils.js";import{StationaryManager as P}from"./2d/support/StationaryManager.js";import{Timeline as z}from"./2d/support/Timeline.js";import{isSupportedScreenPointEvent as G,createScreenPointFromSupportedEvent as q}from"./support/screenUtils.js";import{check as I}from"./support/WebGLRequirements.js";import U from"./ui/DefaultUI.js";import A from"./ui/2d/DefaultUI2D.js";import{isWebMap as F}from"../webmap/utils.js";import N from"../webmap/background/ColorBackground.js";let W,$,H,B,Z,J;async function K(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,Stage:a}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);$=e,H=t,B=i,Z=r,J=s,W=a}let Q=class extends(w(M(f(V)))){constructor(e){super(e),this._magnifierView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new _({view:this}),this.graphicsView=null,this.stateManager=new O({constraints:new j({view:this})}),this.stationaryManager=new P,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new b(this),this.floors=new i,this.highlightOptions=new C,this.inputManager=new k({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new z,this.type="2d",this.ui=new A,this.test={takeScreenshot:async e=>D(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([o((()=>this.viewpoint),(()=>this.stationaryManager.flip()),p),this.on("resize",(e=>this.stateManager.resize(e.width,e.height)))]),h()}destroy(){this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new R(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get state(){return this.stateManager.state}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return m(t.spatialReference,i)}set animation(e){const t=this._get("animation");if(e===t)return;if(t&&t.stop(),e!==this.animationManager.animation&&this.animationManager.stop(),!e||e.isFulfilled())return this._set("animation",null),void(this.frameTask.animationInProgress=!1);this._set("animation",e),this.frameTask.animationInProgress=!0;const i=()=>{this.destroyed||(e===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame()),this.frameTask.animationInProgress=!1)};e.when(i,i)}get background(){return F(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return this.stateManager?.constraints}set constraints(e){e.view=this;const t=this.stateManager.constraints;this.stateManager.constraints=e,t?.destroy()}get extent(){return this.stateManager?.extent??null}set extent(e){this.stateManager.extent=e}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(e){this.stateManager.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(e){const{rotationEnabled:t}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=e,this.constraints.rotationEnabled=t}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get updating(){const e=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)));if(has("esri-2d-log-updating")){const t=this.allLayerViews.reduce(((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating})),{});console.log(`Updating MapView: ${e}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(t)}\n`)}return e}get viewpoint(){return this.stateManager.viewpoint??null}set viewpoint(e){this.stateManager.viewpoint=e,this.frameTask.requestFrame()}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}goTo(e,t){return this.goToManager.goTo(e,t)}async hitTest(e,t){return x(this,e,t)}async takeScreenshot(e){return E(this._getScreenshotView(e),e)}toMap(e){if(!this.ready)return null;const t=G(e)?q(this,e):e;return this.stateManager.toMap(t)}toScreen(e,t){return this.stateManager.toScreen(e,t)}on(e,t,i,r){const s=this.inputManager&&this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return F(this.map)?this.map.initialViewProperties.timeZone:null}hasLayerViewModule(e){return S.hasLayerViewModule(e)}importLayerView(e){return S.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().reverse(),s=new globalThis.Map(r.map((e=>[e.layer.uid,e]))),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const p=s.get(e?.graphic.layer?.uid);if((!e||p)&&o<r.length&&r.at(o)!==p){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:p}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=I(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e)throw a.getLogger(this).warn("#validate()",e.message),e}loadAsyncDependencies(){return K()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),p=n?.viewpoint,l=p?.targetGeometry?.extent??i,h=l?.center,g=p?.rotation??0,d=p?.scale||l&&L(l,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new W(this.surface,{canvas:this.renderCanvas,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=t,this._magnifierView=new J,this._magnifierView.magnifier=this.magnifier;const i=new B({view:this});this._set("labelManager",i);const r=new v({view:this});this._set("animationManager",r);const s=new Z({view:this,animationManager:r});this._set("mapViewNavigation",s),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),t.on("webgl-error",(e=>this.fatalError=e.error)),o((()=>this.stationary),(e=>t.stationary=e),l),o((()=>this.background),(e=>{t.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color}),l),o((()=>this.magnifier),(e=>this._magnifierView.magnifier=e),l),o((()=>this.renderingOptions),(e=>t.renderingOptions=e),l),o((()=>this.highlightOptions),(e=>t.highlightOptions=e),l),o((()=>this.state.id),(()=>t.state=this.state),l)],"map-view"),this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach((e=>e(this))),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this.stage.addChild(e.container)}));const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView)}_setupSpatialReferenceDependentProperties(){const e=new T(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new $({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new H(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}};Q.type="2d",e([g({readOnly:!0})],Q.prototype,"animationManager",void 0),e([g({constructOnly:!0})],Q.prototype,"deactivatedWebGLExtensions",void 0),e([g({constructOnly:!0})],Q.prototype,"debugWebGLExtensions",void 0),e([g({readOnly:!0})],Q.prototype,"featuresTilingScheme",void 0),e([g({readOnly:!0})],Q.prototype,"fullOpacity",void 0),e([g()],Q.prototype,"goToManager",void 0),e([g({readOnly:!0})],Q.prototype,"graphicsTileStore",null),e([g()],Q.prototype,"graphicsView",void 0),e([g()],Q.prototype,"stateManager",void 0),e([g()],Q.prototype,"constraintsInfo",null),e([g({readOnly:!0})],Q.prototype,"state",null),e([g()],Q.prototype,"initialExtentRequired",null),e([g()],Q.prototype,"labelManager",void 0),e([g({readOnly:!0})],Q.prototype,"mapViewNavigation",void 0),e([g({constructOnly:!0})],Q.prototype,"renderCanvas",void 0),e([g()],Q.prototype,"renderingOptions",void 0),e([g({constructOnly:!0})],Q.prototype,"supersampleScreenshotsEnabled",void 0),e([g({readOnly:!0})],Q.prototype,"supportsGround",void 0),e([g()],Q.prototype,"_defaultsFromMapSettings",null),e([g({readOnly:!0})],Q.prototype,"typeSpecificPreconditionsReady",null),e([g()],Q.prototype,"animation",null),e([g({type:N})],Q.prototype,"background",null),e([g()],Q.prototype,"center",null),e([g({type:j})],Q.prototype,"constraints",null),e([g()],Q.prototype,"extent",null),e([g()],Q.prototype,"floors",void 0),e([g({type:C})],Q.prototype,"highlightOptions",void 0),e([g({readOnly:!0})],Q.prototype,"inputManager",void 0),e([g()],Q.prototype,"map",void 0),e([g()],Q.prototype,"padding",null),e([g({readOnly:!0})],Q.prototype,"rendering",null),e([g()],Q.prototype,"resizeAlign",null),e([g({readOnly:!0})],Q.prototype,"resolution",null),e([g()],Q.prototype,"rotation",null),e([g()],Q.prototype,"scale",null),e([g({constructOnly:!0})],Q.prototype,"spatialReferenceLocked",void 0),e([g()],Q.prototype,"stationary",null),e([g({type:z,readOnly:!0})],Q.prototype,"timeline",void 0),e([g({readOnly:!0})],Q.prototype,"type",void 0),e([g({readOnly:!0})],Q.prototype,"updating",null),e([g()],Q.prototype,"viewpoint",null),e([g()],Q.prototype,"zoom",null),e([g({readOnly:!0})],Q.prototype,"navigating",null),e([g(),d((e=>e instanceof U?e:c(A,e)))],Q.prototype,"ui",void 0),Q=e([u("esri.views.MapView")],Q);const X=Q;export{X as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,sync as p,syncAndInitial as l}from"../core/reactiveUtils.js";import{initialize as h}from"../core/workers/workers.js";import{property as g}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import{isLoadedOrLoadFor as m}from"../geometry/projection.js";import y from"../layers/support/TileInfo.js";import{BreakpointsOwner as w}from"./BreakpointsOwner.js";import{DOMContainer as f}from"./DOMContainer.js";import{PopupView as M}from"./PopupView.js";import V from"./View.js";import v from"./2d/AnimationManager.js";import b from"./2d/FrameTask.js";import{GoToManager as _}from"./2d/GoToManager.js";import{layerView2DImporter as S}from"./2d/layerViewModuleImportUtils.js";import j from"./2d/MapViewConstraints.js";import T from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as L}from"./2d/viewpointUtils.js";import{ViewStateManager as O}from"./2d/ViewStateManager.js";import k from"./2d/input/MapViewInputManager.js";import R from"./2d/layers/features/support/TileStore.js";import C from"./2d/support/HighlightOptions.js";import{hitTest as x}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as D,takeScreenshot as E}from"./2d/support/screenshotUtils.js";import{StationaryManager as P}from"./2d/support/StationaryManager.js";import{Timeline as z}from"./2d/support/Timeline.js";import{isSupportedScreenPointEvent as G,createScreenPointFromSupportedEvent as q}from"./support/screenUtils.js";import{check as I}from"./support/WebGLRequirements.js";import U from"./ui/DefaultUI.js";import A from"./ui/2d/DefaultUI2D.js";import{isWebMap as F}from"../webmap/utils.js";import N from"../webmap/background/ColorBackground.js";let W,$,H,B,Z,J;async function K(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,Stage:a}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);$=e,H=t,B=i,Z=r,J=s,W=a}let Q=class extends(w(M(f(V)))){constructor(e){super(e),this._magnifierView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new _({view:this}),this.graphicsView=null,this.stateManager=new O({constraints:new j({view:this})}),this.stationaryManager=new P,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new b(this),this.floors=new i,this.highlightOptions=new C,this.inputManager=new k({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new z,this.type="2d",this.ui=new A,this.test={takeScreenshot:async e=>D(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([o((()=>this.viewpoint),(()=>this.stationaryManager.flip()),p),this.on("resize",(e=>this.stateManager.resize(e.width,e.height)))]),h()}destroy(){this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new R(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get state(){return this.stateManager.state}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return m(t.spatialReference,i)}set animation(e){const t=this._get("animation");if(e===t)return;if(t&&t.stop(),e!==this.animationManager.animation&&this.animationManager.stop(),!e||e.isFulfilled())return this._set("animation",null),void(this.frameTask.animationInProgress=!1);this._set("animation",e),this.frameTask.animationInProgress=!0;const i=()=>{this.destroyed||(e===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame()),this.frameTask.animationInProgress=!1)};e.when(i,i)}get background(){return F(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return this.stateManager?.constraints}set constraints(e){e.view=this;const t=this.stateManager.constraints;this.stateManager.constraints=e,t?.destroy()}get extent(){return this.stateManager?.extent??null}set extent(e){this.stateManager.extent=e}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(e){this.stateManager.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(e){const{rotationEnabled:t}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=e,this.constraints.rotationEnabled=t}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get updating(){const e=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)));if(has("esri-2d-log-updating")){const t=this.allLayerViews.reduce(((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating})),{});console.log(`Updating MapView: ${e}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(t)}\n`)}return e}get viewpoint(){return this.stateManager.viewpoint??null}set viewpoint(e){this.stateManager.viewpoint=e,this.frameTask.requestFrame()}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}goTo(e,t){return this.goToManager.goTo(e,t)}async hitTest(e,t){return x(this,e,t)}async takeScreenshot(e){return E(this._getScreenshotView(e),e)}toMap(e){if(!this.ready)return null;const t=G(e)?q(this,e):e;return this.stateManager.toMap(t)}toScreen(e,t){return this.stateManager.toScreen(e,t)}on(e,t,i,r){const s=this.inputManager&&this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return F(this.map)?this.map.initialViewProperties.timeZone:null}hasLayerViewModule(e){return S.hasLayerViewModule(e)}importLayerView(e){return S.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().reverse(),s=new globalThis.Map(r.map((e=>[e.layer.uid,e]))),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const p=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||p)&&o<r.length&&r.at(o)!==p){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:p}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=I(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e)throw a.getLogger(this).warn("#validate()",e.message),e}loadAsyncDependencies(){return K()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),p=n?.viewpoint,l=p?.targetGeometry?.extent??i,h=l?.center,g=p?.rotation??0,d=p?.scale||l&&L(l,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new W(this.surface,{canvas:this.renderCanvas,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=t,this._magnifierView=new J,this._magnifierView.magnifier=this.magnifier;const i=new B({view:this});this._set("labelManager",i);const r=new v({view:this});this._set("animationManager",r);const s=new Z({view:this,animationManager:r});this._set("mapViewNavigation",s),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),t.on("webgl-error",(e=>this.fatalError=e.error)),o((()=>this.stationary),(e=>t.stationary=e),l),o((()=>this.background),(e=>{t.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color}),l),o((()=>this.magnifier),(e=>this._magnifierView.magnifier=e),l),o((()=>this.renderingOptions),(e=>t.renderingOptions=e),l),o((()=>this.highlightOptions),(e=>t.highlightOptions=e),l),o((()=>this.state.id),(()=>t.state=this.state),l)],"map-view"),this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach((e=>e(this))),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this.stage.addChild(e.container)}));const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView)}_setupSpatialReferenceDependentProperties(){const e=new T(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new $({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new H(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}};Q.type="2d",e([g({readOnly:!0})],Q.prototype,"animationManager",void 0),e([g({constructOnly:!0})],Q.prototype,"deactivatedWebGLExtensions",void 0),e([g({constructOnly:!0})],Q.prototype,"debugWebGLExtensions",void 0),e([g({readOnly:!0})],Q.prototype,"featuresTilingScheme",void 0),e([g({readOnly:!0})],Q.prototype,"fullOpacity",void 0),e([g()],Q.prototype,"goToManager",void 0),e([g({readOnly:!0})],Q.prototype,"graphicsTileStore",null),e([g()],Q.prototype,"graphicsView",void 0),e([g()],Q.prototype,"stateManager",void 0),e([g()],Q.prototype,"constraintsInfo",null),e([g({readOnly:!0})],Q.prototype,"state",null),e([g()],Q.prototype,"initialExtentRequired",null),e([g()],Q.prototype,"labelManager",void 0),e([g({readOnly:!0})],Q.prototype,"mapViewNavigation",void 0),e([g({constructOnly:!0})],Q.prototype,"renderCanvas",void 0),e([g()],Q.prototype,"renderingOptions",void 0),e([g({constructOnly:!0})],Q.prototype,"supersampleScreenshotsEnabled",void 0),e([g({readOnly:!0})],Q.prototype,"supportsGround",void 0),e([g()],Q.prototype,"_defaultsFromMapSettings",null),e([g({readOnly:!0})],Q.prototype,"typeSpecificPreconditionsReady",null),e([g()],Q.prototype,"animation",null),e([g({type:N})],Q.prototype,"background",null),e([g()],Q.prototype,"center",null),e([g({type:j})],Q.prototype,"constraints",null),e([g()],Q.prototype,"extent",null),e([g()],Q.prototype,"floors",void 0),e([g({type:C})],Q.prototype,"highlightOptions",void 0),e([g({readOnly:!0})],Q.prototype,"inputManager",void 0),e([g()],Q.prototype,"map",void 0),e([g()],Q.prototype,"padding",null),e([g({readOnly:!0})],Q.prototype,"rendering",null),e([g()],Q.prototype,"resizeAlign",null),e([g({readOnly:!0})],Q.prototype,"resolution",null),e([g()],Q.prototype,"rotation",null),e([g()],Q.prototype,"scale",null),e([g({constructOnly:!0})],Q.prototype,"spatialReferenceLocked",void 0),e([g()],Q.prototype,"stationary",null),e([g({type:z,readOnly:!0})],Q.prototype,"timeline",void 0),e([g({readOnly:!0})],Q.prototype,"type",void 0),e([g({readOnly:!0})],Q.prototype,"updating",null),e([g()],Q.prototype,"viewpoint",null),e([g()],Q.prototype,"zoom",null),e([g({readOnly:!0})],Q.prototype,"navigating",null),e([g(),d((e=>e instanceof U?e:c(A,e)))],Q.prototype,"ui",void 0),Q=e([u("esri.views.MapView")],Q);const X=Q;export{X as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import{deprecatedProperty as i}from"../core/deprecate.js";import s from"../core/Logger.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import{getActionIcon as l,getActionStyles as r}from"../support/actions/actionUtils.js";import a from"./Widget.js";import c from"./BasemapLayerList/BasemapLayerListViewModel.js";import d from"./BasemapLayerList/BasemapLayerListVisibleElements.js";import{css as m}from"./BasemapLayerList/css.js";import p from"./LayerList/ListItem.js";import{minFilterItems as u,getItem as h,getLayerType as g,getStatusIcon as b,getVisibilityIcon as f,sortableRoot as v,sortLayersToIds as _,sortChildLayersToIds as y,listItemHasChildren as I,canSortSublayers as E}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as L}from"./support/componentsUtils.js";import{globalCss as w}from"./support/globalCss.js";import{incrementHeadingLevel as F}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as C}from"./support/decorators/messageBundle.js";import{vmEvent as T}from"./support/decorators/vmEvent.js";import{tsx as M}from"./support/jsxFactory.js";const A=t.ofType(p),k="basemap",S=".*\\S+.*";let x=class extends a{constructor(e,t){super(e,t),this._activeItem=null,this._tooltipReferenceMap=new Map,this._editTitleInput=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusEditingFlowItem=!1,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this.collapsed=!1,this.dragEnabled=!1,this.editingTitle=!1,this.filterPlaceholder="",this.baseFilterText="",this.referenceFilterText="",this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.headingLevel=2,this.iconClass=m.widgetIcon,this.messages=null,this.messagesCommon=null,this.minFilterItems=u,this.selectedItems=new A,this.selectionMode="none",this.viewModel=new c,this.visibilityAppearance="default",this.visibleElements=new d,this._canMove=({dragEl:e,fromEl:t,toEl:i},s)=>{const n="pull"===s?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,o=h(e);if(!o?.sortable)return!1;const l=h(t),r=g(t),a=h(i),c=g(i),d=!!r&&!!c&&r===c,m={selected:o,from:l,to:a};return t.group&&i.group&&"function"==typeof n?n.call(null,m):d&&"sublayer"!==o?.layer?.type&&"map-image"!==l?.layer?.type&&"map-image"!==a?.layer?.type},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find((e=>e.classList?.contains(m.item)));this._activeItem=h(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:s,dragEl:n,newIndex:o}=e;if(!s||!i||t?.newIndex===o&&t?.dragEl===n&&t?.toEl===i&&t?.fromEl===s)return;this._lastDragDetail=e;const l=s,r=i;if(l!==r)this._moveLayerFromChildList({toEl:r,fromEl:l,dragEl:n,newIndex:o});else{const e=Array.from(s.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));this._sortLayers(l,e)}}}normalizeCtorArgs(e){return null!=e?.editingEnabled&&null!=e.visibleElements?{...e,visibleElements:new d({...e.visibleElements,editTitleButton:e.editingEnabled})}:e}loadDependencies(){return L({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group.js"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu.js"),block:()=>import("@esri/calcite-components/dist/components/calcite-block.js"),label:()=>import("@esri/calcite-components/dist/components/calcite-label.js"),input:()=>import("@esri/calcite-components/dist/components/calcite-input.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}destroy(){this._tooltipReferenceMap.clear()}get _baseFilterEnabled(){return this.viewModel.totalBaseItems>=this.minFilterItems&&this.visibleElements.filter}get _referenceFilterEnabled(){return this.viewModel.totalReferenceItems>=this.minFilterItems&&this.visibleElements.filter}get basemapTitle(){return this.viewModel.basemapTitle}set basemapTitle(e){this.viewModel.basemapTitle=e}get baseListItemCreatedFunction(){return this.viewModel.baseListItemCreatedFunction}set baseListItemCreatedFunction(e){this.viewModel.baseListItemCreatedFunction=e}get editingEnabled(){return i(s.getLogger(this),"editingEnabled",{replacement:"selectionMode, dragEnabled, visibleElements.editTitleButton",version:"4.29",warnOnce:!0}),"none"!==this.selectionMode&&this.dragEnabled&&this.visibleElements.editTitleButton}set editingEnabled(e){i(s.getLogger(this),"editingEnabled",{replacement:"selectionMode, dragEnabled, visibleElements.editTitleButton",version:"4.29",warnOnce:!0}),this.dragEnabled=e,this.visibleElements.editTitleButton=e,this.selectionMode=e?this.multipleSelectionEnabled?"multiple":"single":"none"}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get multipleSelectionEnabled(){return i(s.getLogger(this),"multipleSelectionEnabled",{replacement:"selectionMode",version:"4.29",warnOnce:!0}),"multiple"===this.selectionMode}set multipleSelectionEnabled(e){i(s.getLogger(this),"multipleSelectionEnabled",{replacement:"selectionMode",version:"4.29",warnOnce:!0}),this.selectionMode=e?"multiple":this.editingEnabled?"single":"none"}get referenceListItemCreatedFunction(){return this.viewModel.referenceListItemCreatedFunction}set referenceListItemCreatedFunction(e){this.viewModel.referenceListItemCreatedFunction=e}get baseItems(){return this.viewModel.baseItems}get referenceItems(){return this.viewModel.referenceItems}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const{state:e}=this.viewModel,t={[w.hidden]:"loading"===e,[w.disabled]:"disabled"===e};return M("div",{class:this.classes(m.base,w.widget,w.panel,t)},this._renderItems())}_renderItemTooltip(e){return e?M("calcite-tooltip",{key:`tooltip-${e.layer.uid}`,referenceElement:this._tooltipReferenceMap.get(e.layer.uid)},this.messages.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter((e=>!e.hidden)).toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderItemTooltips(e){return e?.toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderPanelFlowItems(e){return e?e.flatten((e=>e.children)).filter((e=>!e.hidden)).toArray().filter((({panel:e})=>e?.open&&!e.disabled&&e.flowEnabled)).map((({title:e,panel:t})=>{const i=()=>this._handlePanelFlowItemBack(t);return M("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:e,heading:t.title,headingLevel:this.headingLevel,key:`flow-panel-${t.uid}`,onCalciteFlowItemBack:e=>{e.preventDefault(),i()}},t.render(),M("calcite-button",{appearance:"transparent",onclick:i,slot:"footer-actions",width:"full"},this.messagesCommon.back))})):[]}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusEditingFlowItemNode(e){this._focusEditingFlowItem&&(this._focusEditingFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_renderItemMessage(e){return e.error?M("div",{class:m.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},M("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},M("div",{slot:"message"},this.messages.layerError))):e.incompatible?M("div",{class:m.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},M("calcite-notice",{afterCreate:t=>this._setTooltipReference(t,e),afterRemoved:()=>this._removeTooltipReference(e),icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},M("div",{slot:"message"},this.messages.layerIncompatible))):null}_renderItem(e,t,i,s,n){const{_activeItem:o,_selectedDragItemLayerUid:l,selectionMode:r,selectedItems:a,messages:c}=this,d=e.title||c.untitledLayer,p=e.visibleAtCurrentScale?d:`${d} (${c.layerInvisibleAtScale})`,u=this._filterActions(e.actionsSections),h=this._countActions(u);return M("calcite-list-item",{afterCreate:t=>this._focusSelectedDragEl(t,e),afterUpdate:t=>this._focusSelectedDragEl(t,e),class:this.classes(m.item,{[m.itemActive]:o===e}),"data-item":e,dragDisabled:!e.sortable||i,dragSelected:e.layer.uid===l,id:e.layer.uid,key:`list-item-${e.layer.uid}`,label:d,metadata:{parentTitles:n,title:d},open:e.open,selected:"none"!==r&&a.includes(e),title:p,value:e.layer.uid,onCalciteListItemDragHandleChange:t=>this._handleCalciteListItemDragHandleChange(t,e),onCalciteListItemSelect:t=>this._handleCalciteListItemSelect(t,e,s),onCalciteListItemToggle:t=>this._handleCalciteListItemToggle(t,e)},M("div",{class:this.classes({[m.itemContent]:!0,[m.itemInvisibleAtScale]:!e.visibleAtCurrentScale}),slot:"content"},d),this._renderItemStatus(e,s),this._renderItemToggle(e,s),this._renderItemTemporaryIcon(e),this._renderChildList(e,t,n),this._renderItemMessage(e),this._renderPanel(e.panel),this._renderPanelAction(e.panel),h>1?this._renderActionsSections(e,u):1===h?this._renderAction({item:e,action:this._getSingleActionButton(u),textEnabled:!1}):null)}_renderItemStatus(e,t){const{visibleElements:i}=this;if(!i.statusIndicators)return null;const{connectionStatus:s,publishing:n,updating:o}=e,l=o&&!t,r=!!s;return M("calcite-icon",{class:this.classes({[m.statusIndicator]:!0,[m.publishing]:n,[m.updating]:l,[m.connectionStatus]:r,[m.connectionStatusConnected]:r&&"connected"===s}),icon:b({connectionStatus:s,publishing:n}),key:"layer-item-status",scale:"s",slot:"actions-end"})}_renderItemTemporaryIcon(e){return this.visibleElements.temporaryLayerIndicators&&"persistenceEnabled"in e.layer&&!e.layer.persistenceEnabled?M("calcite-icon",{class:m.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"actions-start",title:this.messages.temporary}):null}_renderItemToggle(e,t){const{messages:i,visibilityAppearance:s}=this,{visible:n}=e,o=t?.visibilityMode;if("inherited"===o)return null;const l=f({visible:n,exclusive:"exclusive"===o,visibilityAppearance:s}),r="checkbox"===s;return M("calcite-action",{appearance:"transparent",class:m.visibleToggle,icon:r?l:void 0,key:"visibility-toggle",onclick:()=>this._toggleVisibility(e,t),scale:"s",slot:r?"actions-start":"actions-end",text:i.layerVisibility,title:i.layerVisibility},r?null:M("calcite-icon",{class:this.classes({[m.visibleIcon]:"exclusive"!==o&&n}),icon:l,scale:"s"}))}_renderPanel(e){return!e?.open||e.disabled||e.flowEnabled?null:M("div",{class:m.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}_renderPanelAction(e){if(!e?.visible)return null;const{open:t,title:i,disabled:s}=e;return M("calcite-action",{active:t,appearance:"transparent",disabled:s,icon:l(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}_renderActionsSections(e,t){return M("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:this.messagesCommon.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:t=>e.actionsOpen=t.target.open},M("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:this.messagesCommon.options,title:this.messagesCommon.options}),t.toArray().map(((t,i)=>this._renderActionSection(e,t,i))))}_renderActionSection(e,t,i){return M("calcite-action-group",{key:`action-section-${i}`},t.toArray().map((t=>this._renderAction({item:e,action:t,textEnabled:!0}))))}_renderFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const s="image"in e?e.image:void 0,n={[m.itemActionIcon]:!!t,[m.itemActionImage]:!!s};return t&&(n[t]=!0),s||t?M("span",{"aria-hidden":"true",class:this.classes(m.itemActionIcon,n),key:"icon",styles:r(s)}):null}_renderAction(e){const{item:t,action:i,textEnabled:s}=e,{active:n,disabled:o,title:r,type:a,indicator:c}=i;return M("calcite-action",{active:"toggle"===a&&i.value,appearance:"transparent",disabled:o,icon:l(i),indicator:c,key:`action-${i.uid}`,loading:n,onclick:()=>this._triggerAction(t,i),scale:"s",slot:s?void 0:"actions-end",text:r??"",textEnabled:s,title:r??void 0},this._renderFallbackIcon(i))}_setTooltipReference(e,t){this._tooltipReferenceMap.set(t.layer.uid,e)}_removeTooltipReference(e){this._tooltipReferenceMap.delete(e.layer.uid)}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:s}){const n=h(i),o=h(e),l=h(t),r=j(t),a=j(e);r&&a&&this.viewModel.moveListItem({targetItem:n,fromParentItem:l,toParentItem:o,newIndex:s,from:r,to:a})}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:s}=e;t.insertBefore(i,t.children[s])}_sortLayers(e,t){if(e)if(e.group===v){const i=j(e),s="base"===i?this.view?.map?.basemap?.baseLayers:"reference"===i?this.view?.map?.basemap?.referenceLayers:null;_(s,t)}else{const i=h(e);if(!i)return;y(i,t)}}_getSingleActionButton(e){return e.reduce((e=>e)).filter((e=>e&&"button"===e.type)).at(0)}_filterActions(e){return e.map((e=>e.filter((e=>e.visible))))}_countActions(e){return e.reduce(((e,t)=>e+t.length),0)}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.triggerAction(t,e))}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const s=e.target.selectedItems.map((e=>h(e))).filter(Boolean);i.removeAll(),i.addMany(s)}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.open}_focusSelectedDragEl(e,t){this._selectedDragItemLayerUid===t.layer.uid&&requestAnimationFrame((()=>e?.setFocus()))}_handleCalciteListItemDragHandleChange(e,t){e.stopPropagation();const i=e.target.dragSelected;this._selectedDragItemLayerUid=i?t.layer.uid:null}_handleCalciteListItemSelect(e,t,i){h(e.target)===t&&"none"===this.selectionMode&&"inherited"!==i?.visibilityMode&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&(this._focusPanelFlowItem=!0)}_toggleVisibility(e,t){if(!e)return;const i=t?.visibilityMode;"exclusive"===i&&e.visible||(e.visible=!e.visible)}_renderEditingInput(){const{messages:e}=this,{basemapTitle:t}=this.viewModel;return M("div",{class:m.editing},M("calcite-label",null,e.basemapTitle,M("calcite-input",{afterCreate:e=>this._editTitleInput=e,label:e.basemapTitle,name:"basemaptitle",pattern:S,placeholder:e.basemapTitle,required:!0,title:e.basemapTitle,type:"text",value:t??void 0})))}_renderCancelButton(){const{messagesCommon:{cancel:e}}=this;return M("calcite-button",{appearance:"outline",bind:this,label:e,onclick:this._toggleEditingTitle,slot:"footer",title:e,width:"half"},e)}_renderSubmitButton(){const{messagesCommon:e}=this;return M("calcite-button",{label:e.form.submit,slot:"footer",title:e.form.submit,type:"submit",width:"half"},e.form.ok)}_renderEditingForm(){return this.editingTitle?M("form",{bind:this,onsubmit:this._formSubmit},M("calcite-flow-item",{afterCreate:this._focusEditingFlowItemNode,afterUpdate:this._focusEditingFlowItemNode,bind:this,heading:this.visibleElements.heading?this.messages.basemapTitle:void 0,headingLevel:this.headingLevel,onCalciteFlowItemBack:e=>{e.preventDefault(),this._toggleEditingTitle()}},this._renderEditingInput(),this._renderCancelButton(),this._renderSubmitButton())):null}_renderEditTitleButton(){const{editingTitle:e,visibleElements:{editTitleButton:t},messagesCommon:{edit:i}}=this;return t&&!e?M("calcite-action",{bind:this,icon:"pencil",label:i,onclick:this._toggleEditingTitle,slot:"header-actions-end",text:i,title:i}):null}_renderNoLayersInfoMessage(e){return M("div",{slot:"message"},e)}_renderNoLayersInfo(e,t){return M("div",{class:m.itemMessage},M("calcite-notice",{icon:"information",key:t,kind:"info",open:!0,scale:"m",width:"full"},this._renderNoLayersInfoMessage(e)))}_getFilteredItems(e){return e?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}_renderItems(){const{collapsed:e,visible:t,visibleElements:{closeButton:i,collapseButton:s,heading:n,flow:o},messages:l,viewModel:r,referenceItems:a,baseItems:c}=this,d=this.visibleElements.referenceLayers?this._getFilteredItems(a):null,m=this.visibleElements.baseLayers?this._getFilteredItems(c):null,p=[M("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:i,closed:!t,collapsed:e,collapsible:s,heading:n?r.basemapTitle??l.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",onCalciteFlowItemClose:()=>this.visible=!1},this._renderEditTitleButton(),this._renderReferenceSection(d),this._renderBaseSection(m,1===m?.length)),this._renderEditingForm(),this._renderPanelFlowItems(m),this._renderPanelFlowItems(d)];return t?[o?M("calcite-flow",{key:"root-flow"},p):p,this._renderItemTooltips(d),this._renderItemTooltips(m)]:null}_renderChildList(e,t,i=[]){const{dragEnabled:s}=this,{children:n}=e,o=I(e),l=!o&&s&&"group"===e.layer?.type;return o||l?M("calcite-list",{canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-basemap-layer-type":t,"data-item":e,"data-layer-type":k,dragEnabled:!!s&&(e.childrenSortable&&E(e)),group:e.layer.uid},n?.filter((e=>!e.hidden)).toArray().map((s=>this._renderItem(s,t,!1,e,[...i,e.title])))):null}_renderList(e,t,i){const{messages:s,dragEnabled:n,selectionMode:o,filterPlaceholder:l,baseFilterText:r,referenceFilterText:a,_baseFilterEnabled:c,_referenceFilterEnabled:d}=this,p="reference"===t?s.noReferenceLayers:s.noBaseLayers,u="reference"===t?d:c;return M("calcite-block",{class:m.section,collapsible:!0,heading:"reference"===t?s.referenceHeading:s.baseHeading,headingLevel:F(this.headingLevel),key:`block-${t}`,open:!0},0===e?.length?this._renderNoLayersInfo(p,t):null,M("calcite-list",{afterCreate:e=>{e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-basemap-layer-type":t,"data-layer-type":k,dragEnabled:n,filterEnabled:u,filterPlaceholder:l,filterText:u?"reference"===t?a:r:"",group:v,key:`list-${t}`,label:s.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:o,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this["reference"===t?"referenceFilterText":"baseFilterText"]=e.target?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},e?.toArray().map((e=>this._renderItem(e,t,i))),e?.length&&u?M("div",{class:m.filterNoResults,slot:"filter-no-results"},M("calcite-notice",{kind:"info",open:!0,scale:"m",width:"full"},this._renderNoLayersInfoMessage(p))):null))}_renderBaseSection(e,t){return this.visibleElements.baseLayers?this._renderList(e,"base",t):null}_renderReferenceSection(e){return this.visibleElements.referenceLayers?this._renderList(e,"reference",!1):null}_toggleEditingTitle(){const{editingTitle:e}=this,t=!e;this.editingTitle=t,t?this._focusEditingFlowItem=!0:this._focusRootFlowItem=!0}_formSubmit(e){e.preventDefault();const t=this._editTitleInput?.value;t?.trim()&&(this.basemapTitle=t),this._toggleEditingTitle()}};function j(e){return e?.getAttribute("data-basemap-layer-type")}e([n()],x.prototype,"_activeItem",void 0),e([n()],x.prototype,"_tooltipReferenceMap",void 0),e([n()],x.prototype,"_focusRootFlowItem",void 0),e([n()],x.prototype,"_focusPanelFlowItem",void 0),e([n()],x.prototype,"_focusEditingFlowItem",void 0),e([n()],x.prototype,"_baseFilterEnabled",null),e([n()],x.prototype,"_referenceFilterEnabled",null),e([n()],x.prototype,"basemapTitle",null),e([n()],x.prototype,"collapsed",void 0),e([n()],x.prototype,"dragEnabled",void 0),e([n()],x.prototype,"editingTitle",void 0),e([n()],x.prototype,"filterPlaceholder",void 0),e([n()],x.prototype,"baseFilterText",void 0),e([n()],x.prototype,"referenceFilterText",void 0),e([n()],x.prototype,"listItemCanGiveFunction",void 0),e([n()],x.prototype,"listItemCanReceiveFunction",void 0),e([n()],x.prototype,"baseListItemCreatedFunction",null),e([n()],x.prototype,"editingEnabled",null),e([n()],x.prototype,"headingLevel",void 0),e([n()],x.prototype,"iconClass",void 0),e([n()],x.prototype,"label",null),e([n(),C("esri/widgets/BasemapLayerList/t9n/BasemapLayerList")],x.prototype,"messages",void 0),e([n(),C("esri/t9n/common")],x.prototype,"messagesCommon",void 0),e([n()],x.prototype,"minFilterItems",void 0),e([n()],x.prototype,"multipleSelectionEnabled",null),e([n()],x.prototype,"referenceListItemCreatedFunction",null),e([n({readOnly:!0})],x.prototype,"baseItems",null),e([n({readOnly:!0})],x.prototype,"referenceItems",null),e([n()],x.prototype,"selectedItems",void 0),e([n()],x.prototype,"selectionMode",void 0),e([n()],x.prototype,"view",null),e([T("trigger-action"),n({type:c})],x.prototype,"viewModel",void 0),e([n()],x.prototype,"visibilityAppearance",void 0),e([n({type:d,nonNullable:!0})],x.prototype,"visibleElements",void 0),x=e([o("esri.widgets.BasemapLayerList")],x);const B=x;export{B as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import{deprecatedProperty as i}from"../core/deprecate.js";import s from"../core/Logger.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import{getActionIcon as l,getActionStyles as r}from"../support/actions/actionUtils.js";import a from"./Widget.js";import c from"./BasemapLayerList/BasemapLayerListViewModel.js";import d from"./BasemapLayerList/BasemapLayerListVisibleElements.js";import{css as m}from"./BasemapLayerList/css.js";import p from"./LayerList/ListItem.js";import{minFilterItems as u,getItem as h,getLayerType as g,getStatusIcon as b,getVisibilityIcon as f,sortableRoot as v,sortLayersToIds as _,sortChildLayersToIds as y,listItemHasChildren as I,areChildrenHidden as E,canSortSublayers as L}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import{globalCss as F}from"./support/globalCss.js";import{incrementHeadingLevel as C}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as T}from"./support/decorators/messageBundle.js";import{vmEvent as M}from"./support/decorators/vmEvent.js";import{tsx as A}from"./support/jsxFactory.js";const k=t.ofType(p),S="basemap",x=".*\\S+.*";let j=class extends a{constructor(e,t){super(e,t),this._activeItem=null,this._tooltipReferenceMap=new Map,this._editTitleInput=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusEditingFlowItem=!1,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this.collapsed=!1,this.dragEnabled=!1,this.editingTitle=!1,this.filterPlaceholder="",this.baseFilterText="",this.referenceFilterText="",this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.headingLevel=2,this.iconClass=m.widgetIcon,this.messages=null,this.messagesCommon=null,this.minFilterItems=u,this.selectedItems=new k,this.selectionMode="none",this.viewModel=new c,this.visibilityAppearance="default",this.visibleElements=new d,this._canMove=({dragEl:e,fromEl:t,toEl:i},s)=>{const n="pull"===s?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,o=h(e);if(!o?.sortable)return!1;const l=h(t),r=g(t),a=h(i),c=g(i),d=!!r&&!!c&&r===c,m={selected:o,from:l,to:a};return t.group&&i.group&&"function"==typeof n?n.call(null,m):d&&"sublayer"!==o?.layer?.type&&"map-image"!==l?.layer?.type&&"map-image"!==a?.layer?.type},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find((e=>e.classList?.contains(m.item)));this._activeItem=h(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:s,dragEl:n,newIndex:o}=e;if(!s||!i||t?.newIndex===o&&t?.dragEl===n&&t?.toEl===i&&t?.fromEl===s)return;this._lastDragDetail=e;const l=s,r=i;if(l!==r)this._moveLayerFromChildList({toEl:r,fromEl:l,dragEl:n,newIndex:o});else{const e=Array.from(s.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));this._sortLayers(l,e)}}}normalizeCtorArgs(e){return null!=e?.editingEnabled&&null!=e.visibleElements?{...e,visibleElements:new d({...e.visibleElements,editTitleButton:e.editingEnabled})}:e}loadDependencies(){return w({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group.js"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu.js"),block:()=>import("@esri/calcite-components/dist/components/calcite-block.js"),label:()=>import("@esri/calcite-components/dist/components/calcite-label.js"),input:()=>import("@esri/calcite-components/dist/components/calcite-input.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}destroy(){this._tooltipReferenceMap.clear()}get _baseFilterEnabled(){return this.viewModel.totalBaseItems>=this.minFilterItems&&this.visibleElements.filter}get _referenceFilterEnabled(){return this.viewModel.totalReferenceItems>=this.minFilterItems&&this.visibleElements.filter}get basemapTitle(){return this.viewModel.basemapTitle}set basemapTitle(e){this.viewModel.basemapTitle=e}get baseListItemCreatedFunction(){return this.viewModel.baseListItemCreatedFunction}set baseListItemCreatedFunction(e){this.viewModel.baseListItemCreatedFunction=e}get editingEnabled(){return i(s.getLogger(this),"editingEnabled",{replacement:"selectionMode, dragEnabled, visibleElements.editTitleButton",version:"4.29",warnOnce:!0}),"none"!==this.selectionMode&&this.dragEnabled&&this.visibleElements.editTitleButton}set editingEnabled(e){i(s.getLogger(this),"editingEnabled",{replacement:"selectionMode, dragEnabled, visibleElements.editTitleButton",version:"4.29",warnOnce:!0}),this.dragEnabled=e,this.visibleElements.editTitleButton=e,this.selectionMode=e?this.multipleSelectionEnabled?"multiple":"single":"none"}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get multipleSelectionEnabled(){return i(s.getLogger(this),"multipleSelectionEnabled",{replacement:"selectionMode",version:"4.29",warnOnce:!0}),"multiple"===this.selectionMode}set multipleSelectionEnabled(e){i(s.getLogger(this),"multipleSelectionEnabled",{replacement:"selectionMode",version:"4.29",warnOnce:!0}),this.selectionMode=e?"multiple":this.editingEnabled?"single":"none"}get referenceListItemCreatedFunction(){return this.viewModel.referenceListItemCreatedFunction}set referenceListItemCreatedFunction(e){this.viewModel.referenceListItemCreatedFunction=e}get baseItems(){return this.viewModel.baseItems}get referenceItems(){return this.viewModel.referenceItems}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const{state:e}=this.viewModel,t={[F.hidden]:"loading"===e,[F.disabled]:"disabled"===e};return A("div",{class:this.classes(m.base,F.widget,F.panel,t)},this._renderItems())}_renderItemTooltip(e){return e?A("calcite-tooltip",{key:`tooltip-${e.layer.uid}`,referenceElement:this._tooltipReferenceMap.get(e.layer.uid)},this.messages.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter((e=>!e.hidden)).toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderItemTooltips(e){return e?.toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderPanelFlowItems(e){return e?e.flatten((e=>e.children)).filter((e=>!e.hidden)).toArray().filter((({panel:e})=>e?.open&&!e.disabled&&e.flowEnabled)).map((({title:e,panel:t})=>{const i=()=>this._handlePanelFlowItemBack(t);return A("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:e,heading:t.title,headingLevel:this.headingLevel,key:`flow-panel-${t.uid}`,onCalciteFlowItemBack:e=>{e.preventDefault(),i()}},t.render(),A("calcite-button",{appearance:"transparent",onclick:i,slot:"footer-actions",width:"full"},this.messagesCommon.back))})):[]}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusEditingFlowItemNode(e){this._focusEditingFlowItem&&(this._focusEditingFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_renderItemMessage(e){return e.error?A("div",{class:m.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},A("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},A("div",{slot:"message"},this.messages.layerError))):e.incompatible?A("div",{class:m.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},A("calcite-notice",{afterCreate:t=>this._setTooltipReference(t,e),afterRemoved:()=>this._removeTooltipReference(e),icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},A("div",{slot:"message"},this.messages.layerIncompatible))):null}_renderItem(e,t,i,s,n){const{_activeItem:o,_selectedDragItemLayerUid:l,selectionMode:r,selectedItems:a,messages:c}=this,d=e.title||c.untitledLayer,p=e.visibleAtCurrentScale?d:`${d} (${c.layerInvisibleAtScale})`,u=this._filterActions(e.actionsSections),h=this._countActions(u);return A("calcite-list-item",{afterCreate:t=>this._focusSelectedDragEl(t,e),afterUpdate:t=>this._focusSelectedDragEl(t,e),class:this.classes(m.item,{[m.itemActive]:o===e}),"data-item":e,dragDisabled:!e.sortable||i,dragSelected:e.layer.uid===l,id:e.layer.uid,key:`list-item-${e.layer.uid}`,label:d,metadata:{parentTitles:n,title:d},open:e.open,selected:"none"!==r&&a.includes(e),title:p,value:e.layer.uid,onCalciteListItemDragHandleChange:t=>this._handleCalciteListItemDragHandleChange(t,e),onCalciteListItemSelect:t=>this._handleCalciteListItemSelect(t,e,s),onCalciteListItemToggle:t=>this._handleCalciteListItemToggle(t,e)},A("div",{class:this.classes({[m.itemContent]:!0,[m.itemInvisibleAtScale]:!e.visibleAtCurrentScale}),slot:"content"},d),this._renderItemStatus(e,s),this._renderItemToggle(e,s),this._renderItemTemporaryIcon(e),this._renderChildList(e,t,n),this._renderItemMessage(e),this._renderPanel(e.panel),this._renderPanelAction(e.panel),h>1?this._renderActionsSections(e,u):1===h?this._renderAction({item:e,action:this._getSingleActionButton(u),textEnabled:!1}):null)}_renderItemStatus(e,t){const{visibleElements:i}=this;if(!i.statusIndicators)return null;const{connectionStatus:s,publishing:n,updating:o}=e,l=o&&!t,r=!!s;return A("calcite-icon",{class:this.classes({[m.statusIndicator]:!0,[m.publishing]:n,[m.updating]:l,[m.connectionStatus]:r,[m.connectionStatusConnected]:r&&"connected"===s}),icon:b({connectionStatus:s,publishing:n}),key:"layer-item-status",scale:"s",slot:"actions-end"})}_renderItemTemporaryIcon(e){return this.visibleElements.temporaryLayerIndicators&&"persistenceEnabled"in e.layer&&!e.layer.persistenceEnabled?A("calcite-icon",{class:m.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"actions-start",title:this.messages.temporary}):null}_renderItemToggle(e,t){const{messages:i,visibilityAppearance:s}=this,{visible:n}=e,o=t?.visibilityMode;if("inherited"===o)return null;const l=f({visible:n,exclusive:"exclusive"===o,visibilityAppearance:s}),r="checkbox"===s;return A("calcite-action",{appearance:"transparent",class:m.visibleToggle,icon:r?l:void 0,key:"visibility-toggle",onclick:()=>this._toggleVisibility(e,t),scale:"s",slot:r?"actions-start":"actions-end",text:i.layerVisibility,title:i.layerVisibility},r?null:A("calcite-icon",{class:this.classes({[m.visibleIcon]:"exclusive"!==o&&n}),icon:l,scale:"s"}))}_renderPanel(e){return!e?.open||e.disabled||e.flowEnabled?null:A("div",{class:m.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}_renderPanelAction(e){if(!e?.visible)return null;const{open:t,title:i,disabled:s}=e;return A("calcite-action",{active:t,appearance:"transparent",disabled:s,icon:l(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}_renderActionsSections(e,t){return A("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:this.messagesCommon.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:t=>e.actionsOpen=t.target.open},A("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:this.messagesCommon.options,title:this.messagesCommon.options}),t.toArray().map(((t,i)=>this._renderActionSection(e,t,i))))}_renderActionSection(e,t,i){return A("calcite-action-group",{key:`action-section-${i}`},t.toArray().map((t=>this._renderAction({item:e,action:t,textEnabled:!0}))))}_renderFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const s="image"in e?e.image:void 0,n={[m.itemActionIcon]:!!t,[m.itemActionImage]:!!s};return t&&(n[t]=!0),s||t?A("span",{"aria-hidden":"true",class:this.classes(m.itemActionIcon,n),key:"icon",styles:r(s)}):null}_renderAction(e){const{item:t,action:i,textEnabled:s}=e,{active:n,disabled:o,title:r,type:a,indicator:c}=i;return A("calcite-action",{active:"toggle"===a&&i.value,appearance:"transparent",disabled:o,icon:l(i),indicator:c,key:`action-${i.uid}`,loading:n,onclick:()=>this._triggerAction(t,i),scale:"s",slot:s?void 0:"actions-end",text:r??"",textEnabled:s,title:r??void 0},this._renderFallbackIcon(i))}_setTooltipReference(e,t){this._tooltipReferenceMap.set(t.layer.uid,e)}_removeTooltipReference(e){this._tooltipReferenceMap.delete(e.layer.uid)}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:s}){const n=h(i),o=h(e),l=h(t),r=B(t),a=B(e);r&&a&&this.viewModel.moveListItem({targetItem:n,fromParentItem:l,toParentItem:o,newIndex:s,from:r,to:a})}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:s}=e;t.insertBefore(i,t.children[s])}_sortLayers(e,t){if(e)if(e.group===v){const i=B(e),s="base"===i?this.view?.map?.basemap?.baseLayers:"reference"===i?this.view?.map?.basemap?.referenceLayers:null;_(s,t)}else{const i=h(e);if(!i)return;y(i,t)}}_getSingleActionButton(e){return e.reduce((e=>e)).filter((e=>e&&"button"===e.type)).at(0)}_filterActions(e){return e.map((e=>e.filter((e=>e.visible))))}_countActions(e){return e.reduce(((e,t)=>e+t.length),0)}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.triggerAction(t,e))}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const s=e.target.selectedItems.map((e=>h(e))).filter(Boolean);i.removeAll(),i.addMany(s)}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.open}_focusSelectedDragEl(e,t){this._selectedDragItemLayerUid===t.layer.uid&&requestAnimationFrame((()=>e?.setFocus()))}_handleCalciteListItemDragHandleChange(e,t){e.stopPropagation();const i=e.target.dragSelected;this._selectedDragItemLayerUid=i?t.layer.uid:null}_handleCalciteListItemSelect(e,t,i){h(e.target)===t&&"none"===this.selectionMode&&"inherited"!==i?.visibilityMode&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&(this._focusPanelFlowItem=!0)}_toggleVisibility(e,t){if(!e)return;const i=t?.visibilityMode;"exclusive"===i&&e.visible||(e.visible=!e.visible)}_renderEditingInput(){const{messages:e}=this,{basemapTitle:t}=this.viewModel;return A("div",{class:m.editing},A("calcite-label",null,e.basemapTitle,A("calcite-input",{afterCreate:e=>this._editTitleInput=e,label:e.basemapTitle,name:"basemaptitle",pattern:x,placeholder:e.basemapTitle,required:!0,title:e.basemapTitle,type:"text",value:t??void 0})))}_renderCancelButton(){const{messagesCommon:{cancel:e}}=this;return A("calcite-button",{appearance:"outline",bind:this,label:e,onclick:this._toggleEditingTitle,slot:"footer",title:e,width:"half"},e)}_renderSubmitButton(){const{messagesCommon:e}=this;return A("calcite-button",{label:e.form.submit,slot:"footer",title:e.form.submit,type:"submit",width:"half"},e.form.ok)}_renderEditingForm(){return this.editingTitle?A("form",{bind:this,onsubmit:this._formSubmit},A("calcite-flow-item",{afterCreate:this._focusEditingFlowItemNode,afterUpdate:this._focusEditingFlowItemNode,bind:this,heading:this.visibleElements.heading?this.messages.basemapTitle:void 0,headingLevel:this.headingLevel,onCalciteFlowItemBack:e=>{e.preventDefault(),this._toggleEditingTitle()}},this._renderEditingInput(),this._renderCancelButton(),this._renderSubmitButton())):null}_renderEditTitleButton(){const{editingTitle:e,visibleElements:{editTitleButton:t},messagesCommon:{edit:i}}=this;return t&&!e?A("calcite-action",{bind:this,icon:"pencil",label:i,onclick:this._toggleEditingTitle,slot:"header-actions-end",text:i,title:i}):null}_renderNoLayersInfoMessage(e){return A("div",{slot:"message"},e)}_renderNoLayersInfo(e,t){return A("div",{class:m.itemMessage},A("calcite-notice",{icon:"information",key:t,kind:"info",open:!0,scale:"m",width:"full"},this._renderNoLayersInfoMessage(e)))}_getFilteredItems(e){return e?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}_renderItems(){const{collapsed:e,visible:t,visibleElements:{closeButton:i,collapseButton:s,heading:n,flow:o},messages:l,viewModel:r,referenceItems:a,baseItems:c}=this,d=this.visibleElements.referenceLayers?this._getFilteredItems(a):null,m=this.visibleElements.baseLayers?this._getFilteredItems(c):null,p=[A("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:i,closed:!t,collapsed:e,collapsible:s,heading:n?r.basemapTitle??l.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",onCalciteFlowItemClose:()=>this.visible=!1},this._renderEditTitleButton(),this._renderReferenceSection(d),this._renderBaseSection(m,1===m?.length)),this._renderEditingForm(),this._renderPanelFlowItems(m),this._renderPanelFlowItems(d)];return t?[o?A("calcite-flow",{key:"root-flow"},p):p,this._renderItemTooltips(d),this._renderItemTooltips(m)]:null}_renderChildList(e,t,i=[]){const{dragEnabled:s}=this,{children:n}=e,o=I(e),l=!E(e.layer)&&!o&&s&&"group"===e.layer?.type;return o||l?A("calcite-list",{canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-basemap-layer-type":t,"data-item":e,"data-layer-type":S,dragEnabled:!!s&&(e.childrenSortable&&L(e)),group:e.layer.uid},n?.filter((e=>!e.hidden)).toArray().map((s=>this._renderItem(s,t,!1,e,[...i,e.title])))):null}_renderList(e,t,i){const{messages:s,dragEnabled:n,selectionMode:o,filterPlaceholder:l,baseFilterText:r,referenceFilterText:a,_baseFilterEnabled:c,_referenceFilterEnabled:d}=this,p="reference"===t?s.noReferenceLayers:s.noBaseLayers,u="reference"===t?d:c;return A("calcite-block",{class:m.section,collapsible:!0,heading:"reference"===t?s.referenceHeading:s.baseHeading,headingLevel:C(this.headingLevel),key:`block-${t}`,open:!0},0===e?.length?this._renderNoLayersInfo(p,t):null,A("calcite-list",{afterCreate:e=>{e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-basemap-layer-type":t,"data-layer-type":S,dragEnabled:n,filterEnabled:u,filterPlaceholder:l,filterText:u?"reference"===t?a:r:"",group:v,key:`list-${t}`,label:s.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:o,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this["reference"===t?"referenceFilterText":"baseFilterText"]=e.target?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},e?.toArray().map((e=>this._renderItem(e,t,i))),e?.length&&u?A("div",{class:m.filterNoResults,slot:"filter-no-results"},A("calcite-notice",{kind:"info",open:!0,scale:"m",width:"full"},this._renderNoLayersInfoMessage(p))):null))}_renderBaseSection(e,t){return this.visibleElements.baseLayers?this._renderList(e,"base",t):null}_renderReferenceSection(e){return this.visibleElements.referenceLayers?this._renderList(e,"reference",!1):null}_toggleEditingTitle(){const{editingTitle:e}=this,t=!e;this.editingTitle=t,t?this._focusEditingFlowItem=!0:this._focusRootFlowItem=!0}_formSubmit(e){e.preventDefault();const t=this._editTitleInput?.value;t?.trim()&&(this.basemapTitle=t),this._toggleEditingTitle()}};function B(e){return e?.getAttribute("data-basemap-layer-type")}e([n()],j.prototype,"_activeItem",void 0),e([n()],j.prototype,"_tooltipReferenceMap",void 0),e([n()],j.prototype,"_focusRootFlowItem",void 0),e([n()],j.prototype,"_focusPanelFlowItem",void 0),e([n()],j.prototype,"_focusEditingFlowItem",void 0),e([n()],j.prototype,"_baseFilterEnabled",null),e([n()],j.prototype,"_referenceFilterEnabled",null),e([n()],j.prototype,"basemapTitle",null),e([n()],j.prototype,"collapsed",void 0),e([n()],j.prototype,"dragEnabled",void 0),e([n()],j.prototype,"editingTitle",void 0),e([n()],j.prototype,"filterPlaceholder",void 0),e([n()],j.prototype,"baseFilterText",void 0),e([n()],j.prototype,"referenceFilterText",void 0),e([n()],j.prototype,"listItemCanGiveFunction",void 0),e([n()],j.prototype,"listItemCanReceiveFunction",void 0),e([n()],j.prototype,"baseListItemCreatedFunction",null),e([n()],j.prototype,"editingEnabled",null),e([n()],j.prototype,"headingLevel",void 0),e([n()],j.prototype,"iconClass",void 0),e([n()],j.prototype,"label",null),e([n(),T("esri/widgets/BasemapLayerList/t9n/BasemapLayerList")],j.prototype,"messages",void 0),e([n(),T("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([n()],j.prototype,"minFilterItems",void 0),e([n()],j.prototype,"multipleSelectionEnabled",null),e([n()],j.prototype,"referenceListItemCreatedFunction",null),e([n({readOnly:!0})],j.prototype,"baseItems",null),e([n({readOnly:!0})],j.prototype,"referenceItems",null),e([n()],j.prototype,"selectedItems",void 0),e([n()],j.prototype,"selectionMode",void 0),e([n()],j.prototype,"view",null),e([M("trigger-action"),n({type:c})],j.prototype,"viewModel",void 0),e([n()],j.prototype,"visibilityAppearance",void 0),e([n({type:d,nonNullable:!0})],j.prototype,"visibleElements",void 0),j=e([o("esri.widgets.BasemapLayerList")],j);const P=j;export{P as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{getOrCreateMapValue as s}from"../../core/MapUtils.js";import{isAbortError as r,createResolver as o}from"../../core/promiseUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";const n="#JSAPI_FORM_EXPRESSIONS_MANAGER_GEOMETRY",l="esri.widgets.FeatureForm.FormExpressionsManager";let c=class extends t{constructor(e){super(e),this._fieldReferencesLookup=new Map,this._fieldsAffectedLookup=new Map,this.preserveFieldValuesWhenHidden=!0,this._latestFieldValues={...e.feature.attributes}}initialize(){this._dependencyGraph=this._buildDependencyGraph()}destroy(){this.resetExecutors()}get _asyncExecutors(){return this.executors.filter((e=>e.isAsync))}get _baseContext(){const{editType:e,layer:t,map:s,originalFeature:r,spatialReference:o,timeZone:a}=this.arcadeContextInfo,i="feature"===t?.type?t:"scene"===t?.type&&null!=t.associatedLayer?t.associatedLayer:void 0;return[{$originalfeature:r,$editcontext:{editType:e},$layer:i,$featureset:i,$datastore:t?.url,$map:s},{rawOutput:!0,spatialReference:o??void 0,timeZone:a}]}set feature(e){this._latestFieldValues={...e?.attributes},this._set("feature",e)}evaluateAll(){return this._evaluate(this.executors)}evaluateAsyncExpressions(){return this._evaluate(this._asyncExecutors)}evaluateExpressions(e){return this._evaluate(e)}evaluateInvalidated(e){const{_fieldReferencesLookup:t,_latestFieldValues:s,feature:r}=this,o=new Set;for(const a of e)if(s[a]=r.getAttribute(a),t.has(a))for(const e of t.get(a))o.add(e);return this._evaluate([...o])}async evaluateInvalidatedByGeometry(){if(this._fieldReferencesLookup.has(n))return this._evaluate([...this._fieldReferencesLookup.get(n)])}resetExecutors(){for(const e of this.executors)e.reset()}_buildDependencyGraph(){const{_fieldReferencesLookup:e,_fieldsAffectedLookup:t,executors:r,preserveFieldValuesWhenHidden:o}=this,a=new Map(this.fieldInputs.map((e=>[e.name,e]))),i=!1===o,l=new Map(r.map((e=>[e,new Array])));for(const c of r){for(const r of c.fieldsUsed){s(e,r,(()=>new Set)).add(c);const o=a.get(r);[o?.valueExpressionExecutor,o?.editableExpressionExecutor,i?o?.group?.visibilityExpressionExecutor:null,i?o?.visibilityExpressionExecutor:null].filter((e=>null!=e&&e!==c)).forEach((e=>{l.get(e).push(c);s(t,e,(()=>new Set)).add(o)}))}if(c.geometryUsed){s(e,n,(()=>new Set)).add(c)}}return l}async _evaluate(e){const t=new Map,{_dependencyGraph:s,_fieldsAffectedLookup:o,_latestFieldValues:a}=this;for(const r of e)u(r,t,s);for(const[n,{resolver:l,dependencyPromises:c}]of t){Promise.all(c).then((async()=>{const[e,t]=this._makeContext(a);return n.executeAsync(e,t)})).then((()=>{if(o.has(n))for(const e of o.get(n))this._latestFieldValues[e.name]=e.value;l.resolve()}),(e=>{!e||r(e)||p(e)||n.markStale(),l.reject(e)}))}const i=(await Promise.allSettled(Array.from(t.values(),(({resolver:e})=>e.promise)))).filter((e=>"rejected"===e.status&&!(r(e.reason)||p(e.reason))));if(i.length>0)throw new AggregateError(i,"One or more expression executions failed")}_makeContext(e){const[t,s]=this._baseContext,r=this.feature.clone();return r.attributes=e,[{...t,$feature:r},s]}};e([a()],c.prototype,"_asyncExecutors",null),e([a()],c.prototype,"_baseContext",null),e([a()],c.prototype,"feature",null),e([a({constructOnly:!0})],c.prototype,"preserveFieldValuesWhenHidden",void 0),e([a()],c.prototype,"executors",void 0),e([a()],c.prototype,"fieldInputs",void 0),e([a()],c.prototype,"arcadeContextInfo",void 0),c=e([i(l)],c);const u=(e,t,s)=>{if(t.has(e))return;const r=o();t.set(e,{resolver:r,dependencyPromises:[]}),e.abort();const a=s.get(e);for(const o of a)u(o,t,s),t.get(o).dependencyPromises.push(r.promise)},p=e=>e&&"object"==typeof e&&"message"in e&&"Cancelled"===e.message;export{c as FormExpressionsManager};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{getOrCreateMapValue as s}from"../../core/MapUtils.js";import{isAbortError as r,createResolver as o}from"../../core/promiseUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";const i="#JSAPI_FORM_EXPRESSIONS_MANAGER_GEOMETRY",l="esri.widgets.FeatureForm.FormExpressionsManager";let c=class extends t{constructor(e){super(e),this._fieldReferencesLookup=new Map,this._fieldsAffectedLookup=new Map,this.preserveFieldValuesWhenHidden=!0,this._latestFieldValues={...e.feature.attributes}}initialize(){this._dependencyGraph=this._buildDependencyGraph()}destroy(){this.resetExecutors()}get _asyncExecutors(){return this.executors.filter((e=>e.isAsync))}get _baseContext(){const{editType:e,layer:t,map:s,originalFeature:r,spatialReference:o,timeZone:a}=this.arcadeContextInfo,n="scene"===t?.type&&null!=t.associatedLayer?t.associatedLayer:t;return[{$originalfeature:r,$editcontext:{editType:e},$layer:n,$featureset:n,$datastore:t?.url,$map:s},{rawOutput:!0,spatialReference:o??void 0,timeZone:a}]}set feature(e){this._latestFieldValues={...e?.attributes},this._set("feature",e)}evaluateAll(){return this._evaluate(this.executors)}evaluateAsyncExpressions(){return this._evaluate(this._asyncExecutors)}evaluateExpressions(e){return this._evaluate(e)}evaluateInvalidated(e){const{_fieldReferencesLookup:t,_latestFieldValues:s,feature:r}=this,o=new Set;for(const a of e)if(s[a]=r.getAttribute(a),t.has(a))for(const e of t.get(a))o.add(e);return this._evaluate([...o])}async evaluateInvalidatedByGeometry(){if(this._fieldReferencesLookup.has(i))return this._evaluate([...this._fieldReferencesLookup.get(i)])}resetExecutors(){for(const e of this.executors)e.reset()}_buildDependencyGraph(){const{_fieldReferencesLookup:e,_fieldsAffectedLookup:t,executors:r,preserveFieldValuesWhenHidden:o}=this,a=new Map(this.fieldInputs.map((e=>[e.name,e]))),n=!1===o,l=new Map(r.map((e=>[e,new Array])));for(const c of r){for(const r of c.fieldsUsed){s(e,r,(()=>new Set)).add(c);const o=a.get(r);[o?.valueExpressionExecutor,o?.editableExpressionExecutor,n?o?.group?.visibilityExpressionExecutor:null,n?o?.visibilityExpressionExecutor:null].filter((e=>null!=e&&e!==c)).forEach((e=>{l.get(e).push(c);s(t,e,(()=>new Set)).add(o)}))}if(c.geometryUsed){s(e,i,(()=>new Set)).add(c)}}return l}async _evaluate(e){const t=new Map,{_dependencyGraph:s,_fieldsAffectedLookup:o,_latestFieldValues:a}=this;for(const r of e)u(r,t,s);for(const[i,{resolver:l,dependencyPromises:c}]of t){Promise.all(c).then((async()=>{const[e,t]=this._makeContext(a);return i.executeAsync(e,t)})).then((()=>{if(o.has(i))for(const e of o.get(i))this._latestFieldValues[e.name]=e.value;l.resolve()}),(e=>{!e||r(e)||p(e)||i.markStale(),l.reject(e)}))}const n=(await Promise.allSettled(Array.from(t.values(),(({resolver:e})=>e.promise)))).filter((e=>"rejected"===e.status&&!(r(e.reason)||p(e.reason))));if(n.length>0)throw new AggregateError(n,"One or more expression executions failed")}_makeContext(e){const[t,s]=this._baseContext,r=this.feature.clone();return r.attributes=e,[{...t,$feature:r},s]}get test(){return{baseContext:this._baseContext}}};e([a()],c.prototype,"_asyncExecutors",null),e([a()],c.prototype,"_baseContext",null),e([a()],c.prototype,"feature",null),e([a({constructOnly:!0})],c.prototype,"preserveFieldValuesWhenHidden",void 0),e([a()],c.prototype,"executors",void 0),e([a()],c.prototype,"fieldInputs",void 0),e([a()],c.prototype,"arcadeContextInfo",void 0),c=e([n(l)],c);const u=(e,t,s)=>{if(t.has(e))return;const r=o();t.set(e,{resolver:r,dependencyPromises:[]}),e.abort();const a=s.get(e);for(const o of a)u(o,t,s),t.get(o).dependencyPromises.push(r.promise)},p=e=>e&&"object"==typeof e&&"message"in e&&"Cancelled"===e.message;export{c as FormExpressionsManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- const n={hide:"hide",hideChildren:"hide-children"},i="root",e=10,t=2;function r({exclusive:n,visible:i,visibilityAppearance:e}){const t="checkbox"===e;return i?n?"circle-f":t?"check-square-f":"view-visible":n?"circle":t?"square":"view-hide"}function l({connectionStatus:n,publishing:i}){return n?"connected"===n?"beacon":"offline":i?"stop-square":"bullet-point"}function u(n){if(n)return null!=n.listMode?n.listMode:void 0}function a(n){return null!=n&&"minScale"in n&&null!=n.minScale?n.minScale:void 0}function s(n){return null!=n&&"maxScale"in n&&null!=n.maxScale?n.maxScale:void 0}function o(n){if(!n)return"inherited";const i=x(m(n)?n.layer:n);return null!=i?i?"independent":"inherited":"visibilityMode"in n&&null!=n.visibilityMode?n.visibilityMode:"independent"}function c(i){if(i&&(!("type"in i)||"wmts"!==i.type)&&i.listMode!==n.hideChildren)return"sublayers"in i?"sublayers":"layers"in i?"layers":void 0}function d(n){const i=(n?.layer&&m(n.layer)?n.layer.layer:void 0)??n?.layer;return!!i&&(S(i)??!0)}function y(i){return u(i)!==n.hide}function f(n,i){if(!n||null==i||isNaN(i))return!1;const e=a(n),t=s(n),r=null!=e&&!isNaN(e)&&e>0&&i>e,l=null!=t&&!isNaN(t)&&t>0&&i<t;return r||l}function p(n,i){n?.sort(((n,e)=>{const t="uid"in n?i.indexOf(n.uid):-1,r="uid"in e?i.indexOf(e.uid):-1;return t>r?-1:t<r?1:0}))}function b(n,i){const e=n?.layer;if(!e)return;const t=c(e);if(!t)return;let r;"layers"===t&&"layers"in e?r=e.layers:"sublayers"===t&&"sublayers"in e&&(r=e.sublayers),p(r,i)}function h(n){const i=n?.layer;return i&&"layers"in i?i.layers:null}function v(n){const i=m(n)?n:null,e=n?.parent,t=null!=e&&"type"in e&&"map-image"===e.type?i?.source:null,r="";return t&&e?{layer:e,title:r,sublayerIds:[t.mapLayerId]}:{layer:n,title:r}}function m(n){return null!=n&&"layer"in n&&null!=n.layer}function x(n){const i=M(n);return null!=i&&"supportsSublayerVisibility"in i?i.supportsSublayerVisibility:void 0}function S(n){const i=M(n);return null!=i&&"supportsDynamicLayers"in i?i.supportsDynamicLayers:void 0}function M(n){return n&&"capabilities"in n&&null!=n.capabilities&&"exportMap"in n.capabilities?n.capabilities.exportMap:void 0}function N(n){return n?.["data-item"]}function g(n){return n?.getAttribute("data-layer-type")}function q({children:n,error:i,incompatible:e}){return!!n?.filter((n=>!n.hidden)).length&&!i&&!e}export{y as canDisplayLayer,d as canSortSublayers,u as findLayerListMode,s as findLayerMaxScale,a as findLayerMinScale,o as findLayerVisibilityMode,N as getItem,h as getItemLayers,g as getLayerType,v as getLegendLayerInfo,c as getNormalizedChildLayerProperty,l as getStatusIcon,r as getVisibilityIcon,f as isLayerOutsideScaleRange,m as isSublayer,q as listItemHasChildren,t as minDragEnabledItems,e as minFilterItems,b as sortChildLayersToIds,p as sortLayersToIds,i as sortableRoot};
5
+ const n={hide:"hide",hideChildren:"hide-children"},i="root",e=10,t=2;function r({exclusive:n,visible:i,visibilityAppearance:e}){const t="checkbox"===e;return i?n?"circle-f":t?"check-square-f":"view-visible":n?"circle":t?"square":"view-hide"}function l({connectionStatus:n,publishing:i}){return n?"connected"===n?"beacon":"offline":i?"stop-square":"bullet-point"}function u(i){return!!i&&i.listMode===n.hideChildren}function a(n){if(n)return null!=n.listMode?n.listMode:void 0}function o(n){return null!=n&&"minScale"in n&&null!=n.minScale?n.minScale:void 0}function s(n){return null!=n&&"maxScale"in n&&null!=n.maxScale?n.maxScale:void 0}function c(n){if(!n)return"inherited";const i=S(x(n)?n.layer:n);return null!=i?i?"independent":"inherited":"visibilityMode"in n&&null!=n.visibilityMode?n.visibilityMode:"independent"}function d(n){if(!(!n||"type"in n&&"wmts"===n.type||u(n)))return"sublayers"in n?"sublayers":"layers"in n?"layers":void 0}function y(n){const i=(n?.layer&&x(n.layer)?n.layer.layer:void 0)??n?.layer;return!!i&&(M(i)??!0)}function f(i){return a(i)!==n.hide}function p(n,i){if(!n||null==i||isNaN(i))return!1;const e=o(n),t=s(n),r=null!=e&&!isNaN(e)&&e>0&&i>e,l=null!=t&&!isNaN(t)&&t>0&&i<t;return r||l}function b(n,i){n?.sort(((n,e)=>{const t="uid"in n?i.indexOf(n.uid):-1,r="uid"in e?i.indexOf(e.uid):-1;return t>r?-1:t<r?1:0}))}function h(n,i){const e=n?.layer;if(!e)return;const t=d(e);if(!t)return;let r;"layers"===t&&"layers"in e?r=e.layers:"sublayers"===t&&"sublayers"in e&&(r=e.sublayers),b(r,i)}function v(n){const i=n?.layer;return i&&"layers"in i?i.layers:null}function m(n){const i=x(n)?n:null,e=n?.parent,t=null!=e&&"type"in e&&"map-image"===e.type?i?.source:null,r="";return t&&e?{layer:e,title:r,sublayerIds:[t.mapLayerId]}:{layer:n,title:r}}function x(n){return null!=n&&"layer"in n&&null!=n.layer}function S(n){const i=N(n);return null!=i&&"supportsSublayerVisibility"in i?i.supportsSublayerVisibility:void 0}function M(n){const i=N(n);return null!=i&&"supportsDynamicLayers"in i?i.supportsDynamicLayers:void 0}function N(n){return n&&"capabilities"in n&&null!=n.capabilities&&"exportMap"in n.capabilities?n.capabilities.exportMap:void 0}function g(n){return n?.["data-item"]}function q(n){return n?.getAttribute("data-layer-type")}function w({children:n,error:i,incompatible:e}){return!!n?.filter((n=>!n.hidden)).length&&!i&&!e}export{u as areChildrenHidden,f as canDisplayLayer,y as canSortSublayers,a as findLayerListMode,s as findLayerMaxScale,o as findLayerMinScale,c as findLayerVisibilityMode,g as getItem,v as getItemLayers,q as getLayerType,m as getLegendLayerInfo,d as getNormalizedChildLayerProperty,l as getStatusIcon,r as getVisibilityIcon,p as isLayerOutsideScaleRange,x as isSublayer,w as listItemHasChildren,t as minDragEnabledItems,e as minFilterItems,h as sortChildLayersToIds,b as sortLayersToIds,i as sortableRoot};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import{deprecatedProperty as i}from"../core/deprecate.js";import o from"../core/Logger.js";import s from"../core/ReactiveMap.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{getActionIcon as r,getActionStyles as a}from"../support/actions/actionUtils.js";import c from"./Widget.js";import{css as d}from"./LayerList/css.js";import m from"./LayerList/LayerListViewModel.js";import p from"./LayerList/LayerListVisibleElements.js";import u from"./LayerList/ListItem.js";import{minDragEnabledItems as h,minFilterItems as g,getItem as v,getLayerType as y,sortableRoot as f,listItemHasChildren as _,canSortSublayers as b,getStatusIcon as I,getVisibilityIcon as w,sortLayersToIds as E,sortChildLayersToIds as L}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{globalCss as A}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{vmEvent as F}from"./support/decorators/vmEvent.js";import{tsx as k}from"./support/jsxFactory.js";const S=t.ofType(u),j="operational";let x=class extends c{constructor(e,t){super(e,t),this._activeItem=null,this._tooltipReferenceMap=new s,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.icon=null,this.iconClass=d.widgetIcon,this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=h,this.minFilterItems=g,this.selectedItems=new S,this.selectionMode="none",this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new p,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=v(e);if(!l?.sortable)return!1;const n=v(t),r=y(t),a=v(i),c=y(i),d=!!r&&!!c&&r===c,m={selected:l,from:n,to:a};return t.group&&i.group&&"function"==typeof s?s.call(null,m):d&&"sublayer"!==l?.layer?.type&&"map-image"!==n?.layer?.type&&"map-image"!==a?.layer?.type},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find((e=>e.classList?.contains(d.item)));this._activeItem=v(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o))if(this._lastDragDetail=e,o!==i)this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l});else{const e=Array.from(o.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));this._sortLayers(o,e)}}}loadDependencies(){return C({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group.js"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}destroy(){this._tooltipReferenceMap.clear()}get _dragEnabled(){return this.viewModel.totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get multipleSelectionEnabled(){return i(o.getLogger(this),"multipleSelectionEnabled",{replacement:"selectionMode",version:"4.29",warnOnce:!0}),"multiple"===this.selectionMode}set multipleSelectionEnabled(e){i(o.getLogger(this),"multipleSelectionEnabled",{replacement:"selectionMode",version:"4.29",warnOnce:!0}),this.selectionMode=e?"multiple":this.selectionEnabled?"single":"none"}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get selectionEnabled(){return i(o.getLogger(this),"selectionEnabled",{replacement:"selectionMode, dragEnabled",version:"4.29",warnOnce:!0}),"none"!==this.selectionMode&&this.dragEnabled}set selectionEnabled(e){i(o.getLogger(this),"selectionEnabled",{replacement:"selectionMode, dragEnabled",version:"4.29",warnOnce:!0}),this.dragEnabled=e,this.selectionMode=e?this.multipleSelectionEnabled?"multiple":"single":"none"}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[A.hidden]:"loading"===e,[A.disabled]:"disabled"===e},i=this.operationalItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)));return k("div",{class:this.classes(d.base,A.widget,A.panel,t)},i?.length?[this._renderItemTooltips(i),this._renderItems(i)]:this._renderNoItems())}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?k("calcite-tooltip",{key:`tooltip-${e.layer.uid}`,referenceElement:t.get(e.layer.uid)},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter((e=>!e.hidden)).toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderItemTooltips(e){return e?.toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderNoItemsMessage(){return k("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return k("div",{class:d.itemMessage,key:"esri-layer-list__no-items"},k("calcite-notice",{icon:"information",kind:"info",open:!0,scale:"m",width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(e){return e?e.flatten((e=>e.children)).filter((e=>!e.hidden)).toArray().filter((({panel:e})=>e?.open&&!e.disabled&&e.flowEnabled)).map((({title:e,panel:t})=>{const i=()=>this._handlePanelFlowItemBack(t);return k("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:e,heading:t.title,headingLevel:this.headingLevel,key:`flow-panel-${t.uid}`,onCalciteFlowItemBack:e=>{e.preventDefault(),i()}},t.render(),k("calcite-button",{appearance:"transparent",onclick:i,slot:"footer-actions",width:"full"},this.messagesCommon.back))})):[]}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_renderItems(e){const{visible:t,collapsed:i,_filterEnabled:o,visibleElements:{closeButton:s,collapseButton:l,heading:n,flow:r},_dragEnabled:a,selectionMode:c,filterText:m,filterPlaceholder:p,messages:u}=this,h=[k("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:s,closed:!t,collapsed:i,collapsible:l,heading:n?u.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",onCalciteFlowItemClose:()=>this.visible=!1},k("calcite-list",{afterCreate:e=>{e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":j,dragEnabled:a,filterEnabled:o,filterPlaceholder:p,filterText:o?m:"",group:f,key:"root-list",label:u.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:c,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.target?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},e?.toArray().map((e=>this._renderItem(e))),e?.length&&o?k("div",{class:d.filterNoResults,slot:"filter-no-results"},k("calcite-notice",{kind:"info",open:!0,scale:"m",width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(e)];return t?r?k("calcite-flow",{key:"root-flow"},h):h:null}_renderChildList(e,t=[]){const{_dragEnabled:i}=this,{children:o}=e,s=_(e),l=!s&&i&&"group"===e.layer?.type;return s||l?k("calcite-list",{canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-item":e,"data-layer-type":j,dragEnabled:!!i&&(e.childrenSortable&&b(e)),group:e.layer.uid},o?.filter((e=>!e.hidden)).toArray().map((i=>this._renderItem(i,e,[...t,e.title])))):null}_renderItemMessage(e){return e.error?k("div",{class:d.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},k("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},k("div",{slot:"message"},this.messages.layerError))):e.incompatible?k("div",{class:d.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},k("calcite-notice",{afterCreate:t=>this._setTooltipReference(t,e),afterRemoved:()=>this._removeTooltipReference(e),bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},k("div",{slot:"message"},this.messages.layerIncompatible))):null}_renderItem(e,t,i){const{_activeItem:o,_selectedDragItemLayerUid:s,selectionMode:l,selectedItems:n,messages:r}=this,a=e.title||r.untitledLayer,c=e.visibleAtCurrentScale?a:`${a} (${r.layerInvisibleAtScale})`,m=this._filterActions(e.actionsSections),p=this._countActions(m);return k("calcite-list-item",{afterCreate:t=>this._focusSelectedDragEl(t,e),afterUpdate:t=>this._focusSelectedDragEl(t,e),class:this.classes(d.item,{[d.itemActive]:o===e}),"data-item":e,dragDisabled:!e.sortable,dragSelected:e.layer.uid===s,id:e.layer.uid,key:`list-item-${e.layer.uid}`,label:a,metadata:{parentTitles:i,title:a},open:e.open,selected:"none"!==l&&n.includes(e),title:c,value:e.layer.uid,onCalciteListItemDragHandleChange:t=>this._handleCalciteListItemDragHandleChange(t,e),onCalciteListItemSelect:i=>this._handleCalciteListItemSelect(i,e,t),onCalciteListItemToggle:t=>this._handleCalciteListItemToggle(t,e)},k("div",{class:this.classes({[d.itemContent]:!0,[d.itemInvisibleAtScale]:!e.visibleAtCurrentScale}),slot:"content"},a),this._renderItemStatus(e,t),this._renderItemToggle(e,t),this._renderItemTemporaryIcon(e),this._renderChildList(e,i),this._renderItemMessage(e),this._renderPanel(e.panel),this._renderPanelAction(e.panel),p>1?this._renderActionsSections(e,m):1===p?this._renderAction({item:e,action:this._getSingleActionButton(m),textEnabled:!1}):null)}_renderItemStatus(e,t){const{visibleElements:i}=this;if(!i.statusIndicators)return null;const{connectionStatus:o,publishing:s,updating:l}=e,n=l&&!t,r=!!o;return k("calcite-icon",{class:this.classes({[d.statusIndicator]:!0,[d.publishing]:s,[d.updating]:n,[d.connectionStatus]:r,[d.connectionStatusConnected]:r&&"connected"===o}),icon:I({connectionStatus:o,publishing:s}),key:"layer-item-status",scale:"s",slot:"actions-end"})}_renderItemTemporaryIcon(e){return this.visibleElements.temporaryLayerIndicators&&"persistenceEnabled"in e.layer&&!e.layer.persistenceEnabled?k("calcite-icon",{class:d.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"actions-start",title:this.messages.temporary}):null}_renderItemToggle(e,t){const{messages:i,visibilityAppearance:o}=this,{visible:s}=e,l=t?.visibilityMode;if("inherited"===l)return null;const n=w({visible:s,exclusive:"exclusive"===l,visibilityAppearance:o}),r="checkbox"===o;return k("calcite-action",{appearance:"transparent",class:d.visibleToggle,icon:r?n:void 0,key:"visibility-toggle",onclick:()=>this._toggleVisibility(e,t),scale:"s",slot:r?"actions-start":"actions-end",text:i.layerVisibility,title:i.layerVisibility},r?null:k("calcite-icon",{class:this.classes({[d.visibleIcon]:"exclusive"!==l&&s}),icon:n,scale:"s"}))}_renderPanel(e){return!e?.open||e.disabled||e.flowEnabled?null:k("div",{class:d.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}_renderPanelAction(e){if(!e?.visible)return null;const{open:t,title:i,disabled:o}=e;return k("calcite-action",{active:t,appearance:"transparent",disabled:o,icon:r(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}_renderActionsSections(e,t){return k("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:this.messagesCommon.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:t=>e.actionsOpen=t.target.open},k("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:this.messagesCommon.options,title:this.messagesCommon.options}),t.toArray().map(((t,i)=>this._renderActionSection(e,t,i))))}_renderActionSection(e,t,i){return k("calcite-action-group",{key:`action-section-${i}`},t.toArray().map((t=>this._renderAction({item:e,action:t,textEnabled:!0}))))}_renderFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o="image"in e?e.image:void 0,s={[d.itemActionIcon]:!!t,[d.itemActionImage]:!!o};return t&&(s[t]=!0),o||t?k("span",{"aria-hidden":"true",class:this.classes(d.itemActionIcon,s),key:"icon",styles:a(o)}):null}_renderAction(e){const{item:t,action:i,textEnabled:o}=e,{active:s,disabled:l,title:n,type:a,indicator:c}=i;return k("calcite-action",{active:"toggle"===a&&i.value,appearance:"transparent",disabled:l,icon:r(i),indicator:c,key:`action-${i.uid}`,loading:s,onclick:()=>this._triggerAction(t,i),scale:"s",slot:o?void 0:"actions-end",text:n??"",textEnabled:o,title:n??void 0},this._renderFallbackIcon(i))}_setTooltipReference(e,t){this._tooltipReferenceMap.set(t.layer.uid,e)}_removeTooltipReference(e){this._tooltipReferenceMap.delete(e.layer.uid)}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=v(i),l=v(e),n=v(t);this.viewModel.moveListItem(s,n,l,o)}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_sortLayers(e,t){if(e)if(e.group===f)E(this.view?.map?.layers,t);else{const i=v(e);if(!i)return;L(i,t)}}_getSingleActionButton(e){return e.reduce((e=>e)).filter((e=>e&&"button"===e.type)).at(0)}_filterActions(e){return e.map((e=>e.filter((e=>e.visible))))}_countActions(e){return e.reduce(((e,t)=>e+t.length),0)}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.triggerAction(t,e))}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map((e=>v(e))).filter(Boolean);i.removeAll(),i.addMany(o)}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.open}_focusSelectedDragEl(e,t){this._selectedDragItemLayerUid===t.layer.uid&&requestAnimationFrame((()=>e?.setFocus()))}_handleCalciteListItemDragHandleChange(e,t){e.stopPropagation();const i=e.target.dragSelected;this._selectedDragItemLayerUid=i?t.layer.uid:null}_handleCalciteListItemSelect(e,t,i){v(e.target)===t&&"none"===this.selectionMode&&"inherited"!==i?.visibilityMode&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&(this._focusPanelFlowItem=!0)}_toggleVisibility(e,t){if(!e)return;const i=t?.visibilityMode;"exclusive"===i&&e.visible||(e.visible=!e.visible)}};e([l()],x.prototype,"_activeItem",void 0),e([l()],x.prototype,"_tooltipReferenceMap",void 0),e([l()],x.prototype,"_focusRootFlowItem",void 0),e([l()],x.prototype,"_focusPanelFlowItem",void 0),e([l()],x.prototype,"_dragEnabled",null),e([l()],x.prototype,"_filterEnabled",null),e([l()],x.prototype,"collapsed",void 0),e([l()],x.prototype,"dragEnabled",void 0),e([l()],x.prototype,"filterPlaceholder",void 0),e([l()],x.prototype,"filterText",void 0),e([l()],x.prototype,"headingLevel",void 0),e([l()],x.prototype,"icon",void 0),e([l()],x.prototype,"iconClass",void 0),e([l()],x.prototype,"label",null),e([l()],x.prototype,"listItemCanGiveFunction",void 0),e([l()],x.prototype,"listItemCanReceiveFunction",void 0),e([l()],x.prototype,"listItemCreatedFunction",null),e([l(),M("esri/widgets/LayerList/t9n/LayerList")],x.prototype,"messages",void 0),e([l(),M("esri/t9n/common")],x.prototype,"messagesCommon",void 0),e([l()],x.prototype,"minDragEnabledItems",void 0),e([l()],x.prototype,"minFilterItems",void 0),e([l()],x.prototype,"multipleSelectionEnabled",null),e([l()],x.prototype,"operationalItems",null),e([l()],x.prototype,"selectionEnabled",null),e([l()],x.prototype,"selectedItems",void 0),e([l()],x.prototype,"selectionMode",void 0),e([l()],x.prototype,"view",null),e([F("trigger-action"),l({type:m})],x.prototype,"viewModel",void 0),e([l()],x.prototype,"visibilityAppearance",void 0),e([l({type:p,nonNullable:!0})],x.prototype,"visibleElements",void 0),x=e([n("esri.widgets.LayerList")],x);const P=x;export{P as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import{deprecatedProperty as i}from"../core/deprecate.js";import o from"../core/Logger.js";import s from"../core/ReactiveMap.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{getActionIcon as r,getActionStyles as a}from"../support/actions/actionUtils.js";import c from"./Widget.js";import{css as d}from"./LayerList/css.js";import m from"./LayerList/LayerListViewModel.js";import p from"./LayerList/LayerListVisibleElements.js";import u from"./LayerList/ListItem.js";import{minDragEnabledItems as h,minFilterItems as g,getItem as v,getLayerType as y,sortableRoot as f,listItemHasChildren as _,areChildrenHidden as b,canSortSublayers as I,getStatusIcon as w,getVisibilityIcon as E,sortLayersToIds as L,sortChildLayersToIds as C}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as A}from"./support/componentsUtils.js";import{globalCss as M}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as F}from"./support/decorators/messageBundle.js";import{vmEvent as k}from"./support/decorators/vmEvent.js";import{tsx as S}from"./support/jsxFactory.js";const j=t.ofType(u),x="operational";let P=class extends c{constructor(e,t){super(e,t),this._activeItem=null,this._tooltipReferenceMap=new s,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.icon=null,this.iconClass=d.widgetIcon,this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=h,this.minFilterItems=g,this.selectedItems=new j,this.selectionMode="none",this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new p,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=v(e);if(!l?.sortable)return!1;const n=v(t),r=y(t),a=v(i),c=y(i),d=!!r&&!!c&&r===c,m={selected:l,from:n,to:a};return t.group&&i.group&&"function"==typeof s?s.call(null,m):d&&"sublayer"!==l?.layer?.type&&"map-image"!==n?.layer?.type&&"map-image"!==a?.layer?.type},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find((e=>e.classList?.contains(d.item)));this._activeItem=v(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o))if(this._lastDragDetail=e,o!==i)this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l});else{const e=Array.from(o.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));this._sortLayers(o,e)}}}loadDependencies(){return A({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group.js"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}destroy(){this._tooltipReferenceMap.clear()}get _dragEnabled(){return this.viewModel.totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get multipleSelectionEnabled(){return i(o.getLogger(this),"multipleSelectionEnabled",{replacement:"selectionMode",version:"4.29",warnOnce:!0}),"multiple"===this.selectionMode}set multipleSelectionEnabled(e){i(o.getLogger(this),"multipleSelectionEnabled",{replacement:"selectionMode",version:"4.29",warnOnce:!0}),this.selectionMode=e?"multiple":this.selectionEnabled?"single":"none"}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get selectionEnabled(){return i(o.getLogger(this),"selectionEnabled",{replacement:"selectionMode, dragEnabled",version:"4.29",warnOnce:!0}),"none"!==this.selectionMode&&this.dragEnabled}set selectionEnabled(e){i(o.getLogger(this),"selectionEnabled",{replacement:"selectionMode, dragEnabled",version:"4.29",warnOnce:!0}),this.dragEnabled=e,this.selectionMode=e?this.multipleSelectionEnabled?"multiple":"single":"none"}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[M.hidden]:"loading"===e,[M.disabled]:"disabled"===e},i=this.operationalItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)));return S("div",{class:this.classes(d.base,M.widget,M.panel,t)},i?.length?[this._renderItemTooltips(i),this._renderItems(i)]:this._renderNoItems())}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?S("calcite-tooltip",{key:`tooltip-${e.layer.uid}`,referenceElement:t.get(e.layer.uid)},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter((e=>!e.hidden)).toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderItemTooltips(e){return e?.toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderNoItemsMessage(){return S("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return S("div",{class:d.itemMessage,key:"esri-layer-list__no-items"},S("calcite-notice",{icon:"information",kind:"info",open:!0,scale:"m",width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(e){return e?e.flatten((e=>e.children)).filter((e=>!e.hidden)).toArray().filter((({panel:e})=>e?.open&&!e.disabled&&e.flowEnabled)).map((({title:e,panel:t})=>{const i=()=>this._handlePanelFlowItemBack(t);return S("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:e,heading:t.title,headingLevel:this.headingLevel,key:`flow-panel-${t.uid}`,onCalciteFlowItemBack:e=>{e.preventDefault(),i()}},t.render(),S("calcite-button",{appearance:"transparent",onclick:i,slot:"footer-actions",width:"full"},this.messagesCommon.back))})):[]}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_renderItems(e){const{visible:t,collapsed:i,_filterEnabled:o,visibleElements:{closeButton:s,collapseButton:l,heading:n,flow:r},_dragEnabled:a,selectionMode:c,filterText:m,filterPlaceholder:p,messages:u}=this,h=[S("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:s,closed:!t,collapsed:i,collapsible:l,heading:n?u.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",onCalciteFlowItemClose:()=>this.visible=!1},S("calcite-list",{afterCreate:e=>{e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":x,dragEnabled:a,filterEnabled:o,filterPlaceholder:p,filterText:o?m:"",group:f,key:"root-list",label:u.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:c,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.target?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},e?.toArray().map((e=>this._renderItem(e))),e?.length&&o?S("div",{class:d.filterNoResults,slot:"filter-no-results"},S("calcite-notice",{kind:"info",open:!0,scale:"m",width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(e)];return t?r?S("calcite-flow",{key:"root-flow"},h):h:null}_renderChildList(e,t=[]){const{_dragEnabled:i}=this,{children:o}=e,s=_(e),l=!b(e.layer)&&!s&&i&&"group"===e.layer?.type;return s||l?S("calcite-list",{canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-item":e,"data-layer-type":x,dragEnabled:!!i&&(e.childrenSortable&&I(e)),group:e.layer.uid},o?.filter((e=>!e.hidden)).toArray().map((i=>this._renderItem(i,e,[...t,e.title])))):null}_renderItemMessage(e){return e.error?S("div",{class:d.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},S("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},S("div",{slot:"message"},this.messages.layerError))):e.incompatible?S("div",{class:d.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},S("calcite-notice",{afterCreate:t=>this._setTooltipReference(t,e),afterRemoved:()=>this._removeTooltipReference(e),bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},S("div",{slot:"message"},this.messages.layerIncompatible))):null}_renderItem(e,t,i){const{_activeItem:o,_selectedDragItemLayerUid:s,selectionMode:l,selectedItems:n,messages:r}=this,a=e.title||r.untitledLayer,c=e.visibleAtCurrentScale?a:`${a} (${r.layerInvisibleAtScale})`,m=this._filterActions(e.actionsSections),p=this._countActions(m);return S("calcite-list-item",{afterCreate:t=>this._focusSelectedDragEl(t,e),afterUpdate:t=>this._focusSelectedDragEl(t,e),class:this.classes(d.item,{[d.itemActive]:o===e}),"data-item":e,dragDisabled:!e.sortable,dragSelected:e.layer.uid===s,id:e.layer.uid,key:`list-item-${e.layer.uid}`,label:a,metadata:{parentTitles:i,title:a},open:e.open,selected:"none"!==l&&n.includes(e),title:c,value:e.layer.uid,onCalciteListItemDragHandleChange:t=>this._handleCalciteListItemDragHandleChange(t,e),onCalciteListItemSelect:i=>this._handleCalciteListItemSelect(i,e,t),onCalciteListItemToggle:t=>this._handleCalciteListItemToggle(t,e)},S("div",{class:this.classes({[d.itemContent]:!0,[d.itemInvisibleAtScale]:!e.visibleAtCurrentScale}),slot:"content"},a),this._renderItemStatus(e,t),this._renderItemToggle(e,t),this._renderItemTemporaryIcon(e),this._renderChildList(e,i),this._renderItemMessage(e),this._renderPanel(e.panel),this._renderPanelAction(e.panel),p>1?this._renderActionsSections(e,m):1===p?this._renderAction({item:e,action:this._getSingleActionButton(m),textEnabled:!1}):null)}_renderItemStatus(e,t){const{visibleElements:i}=this;if(!i.statusIndicators)return null;const{connectionStatus:o,publishing:s,updating:l}=e,n=l&&!t,r=!!o;return S("calcite-icon",{class:this.classes({[d.statusIndicator]:!0,[d.publishing]:s,[d.updating]:n,[d.connectionStatus]:r,[d.connectionStatusConnected]:r&&"connected"===o}),icon:w({connectionStatus:o,publishing:s}),key:"layer-item-status",scale:"s",slot:"actions-end"})}_renderItemTemporaryIcon(e){return this.visibleElements.temporaryLayerIndicators&&"persistenceEnabled"in e.layer&&!e.layer.persistenceEnabled?S("calcite-icon",{class:d.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"actions-start",title:this.messages.temporary}):null}_renderItemToggle(e,t){const{messages:i,visibilityAppearance:o}=this,{visible:s}=e,l=t?.visibilityMode;if("inherited"===l)return null;const n=E({visible:s,exclusive:"exclusive"===l,visibilityAppearance:o}),r="checkbox"===o;return S("calcite-action",{appearance:"transparent",class:d.visibleToggle,icon:r?n:void 0,key:"visibility-toggle",onclick:()=>this._toggleVisibility(e,t),scale:"s",slot:r?"actions-start":"actions-end",text:i.layerVisibility,title:i.layerVisibility},r?null:S("calcite-icon",{class:this.classes({[d.visibleIcon]:"exclusive"!==l&&s}),icon:n,scale:"s"}))}_renderPanel(e){return!e?.open||e.disabled||e.flowEnabled?null:S("div",{class:d.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}_renderPanelAction(e){if(!e?.visible)return null;const{open:t,title:i,disabled:o}=e;return S("calcite-action",{active:t,appearance:"transparent",disabled:o,icon:r(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}_renderActionsSections(e,t){return S("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:this.messagesCommon.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:t=>e.actionsOpen=t.target.open},S("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:this.messagesCommon.options,title:this.messagesCommon.options}),t.toArray().map(((t,i)=>this._renderActionSection(e,t,i))))}_renderActionSection(e,t,i){return S("calcite-action-group",{key:`action-section-${i}`},t.toArray().map((t=>this._renderAction({item:e,action:t,textEnabled:!0}))))}_renderFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o="image"in e?e.image:void 0,s={[d.itemActionIcon]:!!t,[d.itemActionImage]:!!o};return t&&(s[t]=!0),o||t?S("span",{"aria-hidden":"true",class:this.classes(d.itemActionIcon,s),key:"icon",styles:a(o)}):null}_renderAction(e){const{item:t,action:i,textEnabled:o}=e,{active:s,disabled:l,title:n,type:a,indicator:c}=i;return S("calcite-action",{active:"toggle"===a&&i.value,appearance:"transparent",disabled:l,icon:r(i),indicator:c,key:`action-${i.uid}`,loading:s,onclick:()=>this._triggerAction(t,i),scale:"s",slot:o?void 0:"actions-end",text:n??"",textEnabled:o,title:n??void 0},this._renderFallbackIcon(i))}_setTooltipReference(e,t){this._tooltipReferenceMap.set(t.layer.uid,e)}_removeTooltipReference(e){this._tooltipReferenceMap.delete(e.layer.uid)}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=v(i),l=v(e),n=v(t);this.viewModel.moveListItem(s,n,l,o)}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_sortLayers(e,t){if(e)if(e.group===f)L(this.view?.map?.layers,t);else{const i=v(e);if(!i)return;C(i,t)}}_getSingleActionButton(e){return e.reduce((e=>e)).filter((e=>e&&"button"===e.type)).at(0)}_filterActions(e){return e.map((e=>e.filter((e=>e.visible))))}_countActions(e){return e.reduce(((e,t)=>e+t.length),0)}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.triggerAction(t,e))}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map((e=>v(e))).filter(Boolean);i.removeAll(),i.addMany(o)}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.open}_focusSelectedDragEl(e,t){this._selectedDragItemLayerUid===t.layer.uid&&requestAnimationFrame((()=>e?.setFocus()))}_handleCalciteListItemDragHandleChange(e,t){e.stopPropagation();const i=e.target.dragSelected;this._selectedDragItemLayerUid=i?t.layer.uid:null}_handleCalciteListItemSelect(e,t,i){v(e.target)===t&&"none"===this.selectionMode&&"inherited"!==i?.visibilityMode&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&(this._focusPanelFlowItem=!0)}_toggleVisibility(e,t){if(!e)return;const i=t?.visibilityMode;"exclusive"===i&&e.visible||(e.visible=!e.visible)}};e([l()],P.prototype,"_activeItem",void 0),e([l()],P.prototype,"_tooltipReferenceMap",void 0),e([l()],P.prototype,"_focusRootFlowItem",void 0),e([l()],P.prototype,"_focusPanelFlowItem",void 0),e([l()],P.prototype,"_dragEnabled",null),e([l()],P.prototype,"_filterEnabled",null),e([l()],P.prototype,"collapsed",void 0),e([l()],P.prototype,"dragEnabled",void 0),e([l()],P.prototype,"filterPlaceholder",void 0),e([l()],P.prototype,"filterText",void 0),e([l()],P.prototype,"headingLevel",void 0),e([l()],P.prototype,"icon",void 0),e([l()],P.prototype,"iconClass",void 0),e([l()],P.prototype,"label",null),e([l()],P.prototype,"listItemCanGiveFunction",void 0),e([l()],P.prototype,"listItemCanReceiveFunction",void 0),e([l()],P.prototype,"listItemCreatedFunction",null),e([l(),F("esri/widgets/LayerList/t9n/LayerList")],P.prototype,"messages",void 0),e([l(),F("esri/t9n/common")],P.prototype,"messagesCommon",void 0),e([l()],P.prototype,"minDragEnabledItems",void 0),e([l()],P.prototype,"minFilterItems",void 0),e([l()],P.prototype,"multipleSelectionEnabled",null),e([l()],P.prototype,"operationalItems",null),e([l()],P.prototype,"selectionEnabled",null),e([l()],P.prototype,"selectedItems",void 0),e([l()],P.prototype,"selectionMode",void 0),e([l()],P.prototype,"view",null),e([k("trigger-action"),l({type:m})],P.prototype,"viewModel",void 0),e([l()],P.prototype,"visibilityAppearance",void 0),e([l({type:p,nonNullable:!0})],P.prototype,"visibleElements",void 0),P=e([n("esri.widgets.LayerList")],P);const T=P;export{T as default};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1248],{83536:(e,t,r)=>{r.d(t,{c:()=>u});var i=r(41948),s=r(2952),n=(r(40196),r(20744),r(66360),r(37176),r(41168)),o=r(1580),a=r(12552);let l=class extends s.c{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles((0,n.ox)((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const e=null!=this.getCollections?this.getCollections():null;if(null==e)return void this.removeAll();let t=0;for(const r of e)null!=r&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new s.c(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction??(e=>!!e);for(const i of t)if(i){if(r(i)){const t=this.indexOf(i,e);t>=0?t!==e&&this.reorder(i,e):this.add(i,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(i);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,i._)([(0,o.qq)()],l.prototype,"getCollections",void 0),(0,i._)([(0,o.qq)()],l.prototype,"getChildrenFunction",void 0),(0,i._)([(0,o.qq)()],l.prototype,"itemFilterFunction",void 0),l=(0,i._)([(0,a.c)("esri.core.CollectionFlattener")],l);const u=l},44247:(e,t,r)=>{async function i(e,t){const{WhereClause:i}=await Promise.all([r.e(3220),r.e(988)]).then(r.bind(r,63220));return i.create(e,t)}function s(e,t){return null!=e&&""!==e?null!=t&&""!==t?`(${e}) AND (${t})`:e:t}r.d(t,{_:()=>s,u:()=>i})},75824:(e,t,r)=>{r.d(t,{Md:()=>n,m0:()=>o,qG:()=>s});var i=r(39452);class s{}function n(e){return e instanceof i.C?e===s.instance:"unknown"===e?.toString().toLowerCase()}function o(e){return n(e)?s.instance:e}s.instance=new i._C("Etc/UTC")},77048:(e,t,r)=>{r.d(t,{C6:()=>d,FZ:()=>h,K:()=>S,K8:()=>l,MZ:()=>a,Qv:()=>f,Su:()=>s,UN:()=>v,WK:()=>n,WO:()=>y,WU:()=>o,eC:()=>p,is:()=>g,mK:()=>c,qe:()=>u,qy:()=>m,yK:()=>b});var i=r(95247);function s(e=v){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function n(e,t,r,i,n,o,a=s()){return a[0]=e,a[1]=t,a[2]=r,a[3]=i,a[4]=n,a[5]=o,a}function o(e,t){const r=isFinite(e[2])||isFinite(e[5]);return new i.c(r?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function a(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function l(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function u(e,t,r=0,i=t.length/3){let s=e[0],n=e[1],o=e[2],a=e[3],l=e[4],u=e[5];for(let e=0;e<i;e++)s=Math.min(s,t[r+3*e]),n=Math.min(n,t[r+3*e+1]),o=Math.min(o,t[r+3*e+2]),a=Math.max(a,t[r+3*e]),l=Math.max(l,t[r+3*e+1]),u=Math.max(u,t[r+3*e+2]);e[0]=s,e[1]=n,e[2]=o,e[3]=a,e[4]=l,e[5]=u}function p(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function d(e,t,r=e){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r!==e&&(r[3]=e[3],r[4]=e[4],r[5]=e[5]),r}function c(e,t,r=e){return r[3]=t[0],r[4]=t[1],r[5]=t[2],r!==e&&(r[0]=e[0],r[1]=e[1],r[2]=e[2]),e}function y(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function h(e){return e?y(e,S):s(S)}function f(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function m(e,t,r,i,s){return e[0]=t,e[1]=r,e[2]=Number.NEGATIVE_INFINITY,e[3]=i,e[4]=s,e[5]=Number.POSITIVE_INFINITY,e}function g(e){return 6===e.length}function b(e,t,r){if(null==e||null==t)return e===t;if(!g(e)||!g(t))return!1;if(r){for(let i=0;i<e.length;i++)if(!r(e[i],t[i]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}r(83372);const S=[1/0,1/0,1/0,-1/0,-1/0,-1/0],v=[0,0,0,0,0,0];s()},38724:(e,t,r)=>{r.d(t,{C:()=>o});var i=r(41948),s=r(1580),n=(r(9456),r(66360),r(72052),r(12552));const o=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i._)([(0,s.qq)({type:String})],t.prototype,"apiKey",null),t=(0,i._)([(0,n.c)("esri.layers.mixins.APIKeyMixin")],t),t}},50864:(e,t,r)=>{r.d(t,{I:()=>b});var i=r(41948),s=r(2600),n=r(86916),o=r(10860),a=r(28176),l=r(95728),u=r(1580),p=(r(9456),r(66360),r(72052),r(33600)),d=r(12552),c=r(71448),y=r(95247),h=r(56156),f=r(48212),m=r(21488),g=r(46940);const b=e=>{let t=class extends e{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(e,t){const r=t.capabilities&&t.capabilities.split(",").map((e=>e.toLowerCase().trim()));if(!r)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const i=this.type,s="tile"!==i&&!!t.supportsDynamicLayers,n=r.includes("query"),o=r.includes("map"),a=!!t.exportTilesAllowed,u=r.includes("tilemap"),p=r.includes("data"),d="tile"!==i&&(!t.tileInfo||s),c="tile"!==i&&(!t.tileInfo||s),y="tile"!==i,h=t.cimVersion&&l.a.parse(t.cimVersion),f=h?.since(1,4)??!1,m=h?.since(2,0)??!1;return{operations:{supportsExportMap:o,supportsExportTiles:a,supportsIdentify:n,supportsQuery:p,supportsTileMap:u},exportMap:o?{supportsArcadeExpressionForLabeling:f,supportsSublayersChanges:y,supportsDynamicLayers:s,supportsSublayerVisibility:d,supportsSublayerDefinitionExpression:c,supportsCIMSymbols:m}:null,exportTiles:a?{maxExportTilesCount:+t.maxExportTilesCount}:null}}readVersion(e,t){let r=t.currentVersion;return r||(r=t.hasOwnProperty("capabilities")||t.hasOwnProperty("tables")?10:t.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),r}async fetchRelatedService(e){const t=this.portalItem;if(!t||!(0,g.mU)(t))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=t.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},e).then((e=>e.find((e=>"Feature Service"===e.type))??null),(()=>null)));const r=await this._relatedFeatureServicePromise;return(0,o.wp)(e),r?{itemId:r.id,url:r.url}:null}async fetchSublayerInfo(e,t){const{source:r}=e;if(this?.portalItem&&"tile"===this.type&&"map-layer"===r?.type&&(0,g.mU)(this.portalItem)&&e.originIdOf("url")<c.sT.SERVICE){const i=await this.fetchRelatedService(t);i&&(e.url=(0,a.kn)(i.url,r.mapLayerId.toString()),e.layerItemId=i.itemId)}const{url:i}=e;let n;if("data-layer"===r.type)n=(await(0,s.c)(i,{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey},...t})).data;else if(i&&e.originIdOf("url")>c.sT.SERVICE)try{const e=await this._fetchAllLayersAndTablesFromService(i),t=(0,f.K0)(i)?.sublayer??r.mapLayerId;n=e.get(t)}catch{}else{let i=e.id;"map-layer"===r?.type&&(i=r.mapLayerId);try{n=(await this.fetchAllLayersAndTables(t)).get(i)}catch{}}return n}async fetchAllLayersAndTables(e){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,e)}async _fetchAllLayersAndTablesFromService(e,t){await this.load(t),this._allLayersAndTablesMap||=new Map;const r=(0,f.K0)(e),i=(0,n.wJ)(this._allLayersAndTablesMap,r?.url.path,(()=>(0,s.c)((0,a.kn)(r?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then((e=>{const t=new Map;for(const r of e.data.layers)t.set(r.id,r);return{result:t}}),(e=>({error:e}))))),l=await i;if((0,o.wp)(t),"result"in l)return l.result;throw l.error}};return(0,i._)([(0,u.qq)({readOnly:!0})],t.prototype,"capabilities",void 0),(0,i._)([(0,p.E)("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],t.prototype,"readCapabilities",null),(0,i._)([(0,u.qq)({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,i._)([(0,u.qq)({type:y.c})],t.prototype,"fullExtent",void 0),(0,i._)([(0,u.qq)(m.id)],t.prototype,"id",void 0),(0,i._)([(0,u.qq)({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],t.prototype,"legendEnabled",void 0),(0,i._)([(0,u.qq)(m.Ou)],t.prototype,"popupEnabled",void 0),(0,i._)([(0,u.qq)({type:h.c})],t.prototype,"spatialReference",void 0),(0,i._)([(0,u.qq)({readOnly:!0})],t.prototype,"version",void 0),(0,i._)([(0,p.E)("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],t.prototype,"readVersion",null),t=(0,i._)([(0,d.c)("esri.layers.mixins.ArcGISMapService")],t),t}},49664:(e,t,r)=>{r.d(t,{s:()=>g});var i=r(41948),s=r(2952),n=r(83536),o=r(20744),a=r(66360),l=r(57896),u=r(1580),p=(r(9456),r(72052),r(20916)),d=r(12552),c=r(71448),y=r(84632),h=r(11856);const f=s.c.ofType(y.c);function m(e,t){e&&e.forEach((e=>{t(e),e.sublayers&&e.sublayers.length&&m(e.sublayers,t)}))}const g=e=>{let t=class extends e{constructor(...e){super(...e),this.allSublayers=new n.c({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.sublayersSourceJSON={[c.sT.SERVICE]:{},[c.sT.PORTAL_ITEM]:{},[c.sT.WEB_SCENE]:{},[c.sT.WEB_MAP]:{}},this.addHandles((0,l.aE)((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),l.du))}destroy(){this.allSublayers.destroy()}readSublayers(e,t){if(!t||!e)return;const{sublayersSourceJSON:r}=this,i=(0,c.CQ)(t.origin);if(i<c.sT.SERVICE)return;if(r[i]={context:t,visibleLayers:e.visibleLayers||r[i].visibleLayers,layers:e.layers||r[i].layers},i>c.sT.SERVICE)return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:s,origin:n}=this.createSublayersForOrigin("web-document"),o=(0,p.m6)(this);o.setDefaultOrigin(n),this._set("sublayers",new f(s)),o.setDefaultOrigin("user")}findSublayerById(e){return this.allSublayers.find((t=>t.id===e))}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(e){const t=(0,c.CQ)("web-document"===e?"web-map":e);let r=c.sT.SERVICE,i=this.sublayersSourceJSON[c.sT.SERVICE].layers,s=this.sublayersSourceJSON[c.sT.SERVICE].context,n=null;const o=[c.sT.PORTAL_ITEM,c.sT.WEB_SCENE,c.sT.WEB_MAP].filter((e=>e<=t));for(const e of o){const t=this.sublayersSourceJSON[e];(0,h.gH)(t.layers)&&(r=e,i=t.layers,s=t.context,t.visibleLayers&&(n={visibleLayers:t.visibleLayers,context:t.context}))}const a=[c.sT.PORTAL_ITEM,c.sT.WEB_SCENE,c.sT.WEB_MAP].filter((e=>e>r&&e<=t));let l=null;for(const e of a){const{layers:t,visibleLayers:r,context:i}=this.sublayersSourceJSON[e];t&&(l={layers:t,context:i}),r&&(n={visibleLayers:r,context:i})}const u=function(e,t){const r=[],i={};return e?(e.forEach((e=>{const s=new y.c;if(s.read(e,t),i[s.id]=s,null!=e.parentLayerId&&-1!==e.parentLayerId){const t=i[e.parentLayerId];t.sublayers||(t.sublayers=[]),t.sublayers.unshift(s)}else r.unshift(s)})),r):r}(i,s),p=new Map,d=new Set;if(l)for(const e of l.layers)p.set(e.id,e);if(n?.visibleLayers)for(const e of n.visibleLayers)d.add(e);return m(u,(e=>{l&&e.read(p.get(e.id),l.context),n&&e.read({defaultVisibility:d.has(e.id)},n.context)})),{origin:(0,c.Qz)(r),sublayers:new f({items:u})}}read(e,t){super.read(e,t),this.readSublayers(e,t)}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this.removeHandles("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this,e.layer=this})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))],"sublayers-owner"),"tile"===this.type&&this.addHandles(e.on("before-changes",(e=>{a.c.getLogger("esri.layers.TileLayer").error(new o.c("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),e.preventDefault()})),"sublayers-owner"))}};return(0,i._)([(0,u.qq)({readOnly:!0})],t.prototype,"allSublayers",void 0),(0,i._)([(0,u.qq)({readOnly:!0,type:s.c.ofType(y.c)})],t.prototype,"serviceSublayers",void 0),(0,i._)([(0,u.qq)({value:null,type:f,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],t.prototype,"sublayers",void 0),(0,i._)([(0,u.qq)({readOnly:!0})],t.prototype,"sublayersSourceJSON",void 0),t=(0,i._)([(0,d.c)("esri.layers.mixins.SublayersOwner")],t),t}},87352:(e,t,r)=>{r.d(t,{c:()=>d});var i=r(41948),s=r(3856),n=r(14628),o=r(40504),a=r(1580),l=(r(9456),r(66360),r(72052),r(12552));const u=new n.O({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let p=class extends((0,s.q)(o.am)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,i._)([(0,a.qq)({json:{write:!0}})],p.prototype,"name",void 0),(0,i._)([(0,a.qq)({json:{write:!0}})],p.prototype,"description",void 0),(0,i._)([(0,a.qq)({json:{read:u.read,write:u.write}})],p.prototype,"drawingTool",void 0),(0,i._)([(0,a.qq)({json:{write:!0}})],p.prototype,"prototype",void 0),(0,i._)([(0,a.qq)({json:{write:!0}})],p.prototype,"thumbnail",void 0),p=(0,i._)([(0,l.c)("esri.layers.support.FeatureTemplate")],p);const d=p},79648:(e,t,r)=>{r.d(t,{c:()=>y});var i=r(41948),s=r(3856),n=r(40504),o=r(1580),a=(r(9456),r(66360),r(72052),r(33600)),l=r(12552),u=r(18996),p=r(89812),d=r(87352);let c=class extends((0,s.q)(n.am)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,p.h4)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,i._)([(0,o.qq)({json:{write:!0}})],c.prototype,"id",void 0),(0,i._)([(0,o.qq)({json:{write:!0}})],c.prototype,"name",void 0),(0,i._)([(0,o.qq)({json:{write:!0}})],c.prototype,"domains",void 0),(0,i._)([(0,a.E)("domains")],c.prototype,"readDomains",null),(0,i._)([(0,u.G)("domains")],c.prototype,"writeDomains",null),(0,i._)([(0,o.qq)({type:[d.c],json:{write:!0}})],c.prototype,"templates",void 0),c=(0,i._)([(0,l.c)("esri.layers.support.FeatureType")],c);const y=c},600:(e,t,r)=>{r.d(t,{c:()=>m});var i,s=r(41948),n=r(14628),o=r(40504),a=r(1580),l=r(53368),u=(r(72052),r(9456),r(9968)),p=r(33600),d=r(12552),c=r(89812),y=r(36408);const h=new n.O({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let f=i=class extends o.am{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?.value??null}readValueType(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?h.fromJSON(r.fieldValueType):null}clone(){return new i({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,s._)([(0,a.qq)({type:String,json:{write:!0}})],f.prototype,"alias",void 0),(0,s._)([(0,a.qq)({type:[String,Number],json:{write:{allowNull:!0}}})],f.prototype,"defaultValue",void 0),(0,s._)([(0,a.qq)()],f.prototype,"description",void 0),(0,s._)([(0,p.E)("description")],f.prototype,"readDescription",null),(0,s._)([(0,a.qq)({types:c.i2,json:{read:{reader:c.h4},write:!0}})],f.prototype,"domain",void 0),(0,s._)([(0,a.qq)({type:Boolean,json:{write:!0}})],f.prototype,"editable",void 0),(0,s._)([(0,a.qq)({type:l.Ab,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],f.prototype,"length",void 0),(0,s._)([(0,a.qq)({type:String,json:{write:!0}})],f.prototype,"name",void 0),(0,s._)([(0,a.qq)({type:Boolean,json:{write:!0}})],f.prototype,"nullable",void 0),(0,s._)([(0,u.G)(y.M)],f.prototype,"type",void 0),(0,s._)([(0,a.qq)()],f.prototype,"valueType",void 0),(0,s._)([(0,p.E)("valueType",["description"])],f.prototype,"readValueType",null),(0,s._)([(0,a.qq)({type:Boolean,json:{read:!1}})],f.prototype,"visible",void 0),f=i=(0,s._)([(0,d.c)("esri.layers.support.Field")],f);const m=f},16424:(e,t,r)=>{r.d(t,{c:()=>c});var i=r(20744),s=r(40504),n=r(66360),o=r(86916),a=r(75824),l=r(564),u=r(28484),p=r(39452);const d=new Map;class c{static fromJSON(e){return new c(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new c(e.fields??[],m(e))}static fromLayerJSON(e){return new c(e.fields??[],m(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const r=[];for(const e of this.fields){const t=e?.name,i=h(t);if(t&&i){const s=y(t);this._fieldsMap.set(t,e),this._fieldsMap.set(s,e),this._normalizedFieldsMap.set(i,e),r.push(`${s}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,l.gp)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,l.iW)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,l.Mz)(e)||(0,l.w1)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}r.sort(),this.uid=r.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,l.Mz)(e)||(0,l.w1)(e)||e.nullable||void 0!==(0,l.gB)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(y(e))??this._normalizedFieldsMap.get(h(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(n.c.getLogger("esri.layers.support.FieldsIndex").error(new i.c("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.Gw):f.has(t.type)?u.OI:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.OI?a.qG.instance:t===u.Gw?p.Kq.utcInstance:(0,o.wJ)(d,t,(()=>p._C.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,l.eM)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>(0,s.wt)(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function y(e){return e.trim().toLowerCase()}function h(e){return(0,l.gP)(e)?.toLowerCase()??""}const f=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function m(e){const t=new Map;if(!e.fields)return t;const r=!0===e.datesInUnknownTimezone,{timeInfo:i,editFieldsInfo:s}=e,n=(i?"startField"in i?i.startField:i.startTimeField:"")??"",o=(i?"endField"in i?i.endField:i.endTimeField:"")??"",a=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,u.Mt)(e.dateFieldsTimeReference):null,l=s?function(e){return"timeZone"in e}(s)?s.timeZone??a:s.dateFieldsTimeReference?(0,u.Mt)(s.dateFieldsTimeReference):a??u.Gw:null,p=i?function(e){return"timeZone"in e}(i)?i.timeZone??a:i.timeReference?(0,u.Mt)(i.timeReference):a:null,d=new Map([[y(s?.creationDateField??""),l],[y(s?.editDateField??""),l],[y(n),p],[y(o),p]]);for(const{name:i,type:s}of e.fields)if(f.has(s))t.set(i,u.OI);else if("date"!==s&&"esriFieldTypeDate"!==s)t.set(i,null);else if(r)t.set(i,u.OI);else{const e=d.get(y(i??""))??a;t.set(i,e)}return t}},24144:(e,t,r)=>{r.d(t,{c:()=>p});var i,s=r(41948),n=r(2952),o=r(40504),a=r(1580),l=(r(9456),r(66360),r(72052),r(12552));let u=i=class extends o.am{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new n.c}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,s._)([(0,a.qq)({type:String,json:{write:!0}})],u.prototype,"floorField",void 0),(0,s._)([(0,a.qq)({json:{read:!1,write:!1}})],u.prototype,"viewAllMode",void 0),(0,s._)([(0,a.qq)({json:{read:!1,write:!1}})],u.prototype,"viewAllLevelIds",void 0),u=i=(0,s._)([(0,l.c)("esri.layers.support.LayerFloorInfo")],u);const p=u},84632:(e,t,r)=>{r.d(t,{c:()=>W});var i,s=r(41948),n=(r(60708),r(82692)),o=(r(99704),r(73868),r(90200),r(12836),r(63718),r(2360),r(64624),r(24948),r(70236),r(37284)),a=r(2600),l=r(17988),u=r(2952),p=r(20744),d=r(9456),c=r(22156),y=r(62088),h=r(95800),f=r(66360),m=r(26496),g=r(44247),b=r(28176),S=r(1580),v=r(33392),w=r(33600),_=r(12552),q=r(18996),I=r(53368),T=r(71448),F=r(20916),x=r(95468),E=r(79648),O=r(600),A=r(16424),C=r(6168),L=r(34880),M=r(24144),D=r(54712),R=r(88204),N=r(75384),P=r(19212),V=r(95776),j=r(65548),Q=r(95247),G=r(97492);function z(e){return null!=e&&"esriSMS"===e.type}function U(e,t,r){const i=this.originIdOf(t)>=(0,T.CQ)(r.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!r&&"map-image"===r.layer?.type&&(r.writeSublayerStructure||i)}}function B(e,t,r){return{enabled:!!r&&"tile"===r.layer?.type&&(r.origin&&this.originIdOf(t)>=(0,T.CQ)(r.origin)||this._isOverridden(t))}}function J(e,t,r){return{ignoreOrigin:!0,enabled:r&&r.writeSublayerStructure||!1}}function k(e,t,r){return{ignoreOrigin:!0,enabled:!!r&&(r.writeSublayerStructure||this.originIdOf(t)>=(0,T.CQ)(r.origin))}}let $=0;const Z=new Set;Z.add("layer"),Z.add("parent"),Z.add("loaded"),Z.add("loadStatus"),Z.add("loadError"),Z.add("loadWarnings");let K=i=class extends((0,m.U)((0,c.MR)(h.c))){constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:t,url:r}=this;if(!t&&!r)throw new p.c("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=t?await t.fetchSublayerInfo(this,e):(await(0,a.c)(r,{responseType:"json",query:{f:"json"},...e})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service"}))})()),this}readCapabilities(e,t){t=t.layerDefinition||t;const{operations:{supportsQuery:r,supportsQueryAttachments:i},query:{supportsFormatPBF:s},data:{supportsAttachment:n},queryRelated:o}=(0,D.S)(t,this.url);return{exportMap:{supportsModification:!!t.canModifyLayer},operations:{supportsQuery:r,supportsQueryAttachments:i},data:{supportsAttachment:n},query:{supportsFormatPBF:s},queryRelated:o}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}readMaxScaleRange(e,t){return{minScale:(t=t.layerDefinition||t).minScale??0,maxScale:t.maxScale??0}}get fieldsIndex(){return new A.c(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields)for(const e of t.fields)if("esriFieldTypeGlobalID"===e.type)return e.name}get id(){return this._get("id")??$++}set id(e){this._get("id")!==e&&(!1!==this.layer?.capabilities?.exportMap?.supportsDynamicLayers?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,t,r,i){e&&e.length&&(t.layerDefinition={drawingInfo:{labelingInfo:e.map((e=>e.write({},i)))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach((t=>t.layer=e))}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,t){return t.minScale||t.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,t){return t.maxScale||t.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,t){if((t=t.layerDefinition||t).objectIdField)return t.objectIdField;if(t.fields)for(const e of t.fields)if("esriFieldTypeOID"===e.type)return e.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,t){const r=t.layerDefinition;return 1-.01*((null!=r?.transparency?r.transparency:r?.drawingInfo?.transparency)??0)}writeOpacity(e,t,r,i){t.layerDefinition={drawingInfo:{transparency:100-100*e}}}writeParent(e,t){this.parent&&this.parent!==this.layer?t.parentLayerId=(0,I.Wu)(this.parent.id):t.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{spatialReference:e}=this.layer,t="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:r,fieldsIndex:i}=this,s=(0,d.c)("featurelayer-pbf")&&r?.query.supportsFormatPBF,n=r?.operations?.supportsQueryAttachments??!1;return new x.c({url:this.url,pbfSupported:s,fieldsIndex:i,gdbVersion:t,sourceSpatialReference:e,queryAttachmentsSupported:n})}set renderer(e){if(e)for(const t of e.getSymbols())if((0,l._8)(t)){f.c.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new N.E({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return(0,I.ey)(u.c.ofType(i),e)}writeSublayers(e,t,r){this.sublayers?.length&&(t[r]=this.sublayers.map((e=>e.id)).toArray().reverse())}readTitle(e,t){return t.layerDefinition?.name??t.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,t=this.source;if(!e)return null;if(this._lastParsedUrl=e,"map-layer"===t?.type)return`${e.path}/${t.mapLayerId}`;const r={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${(0,b.GK)(r)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,t,r,i){t[r]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=(0,F.m6)(this),t=new i;return(0,F.m6)(t).store=e.clone(Z),this.commitProperty("url"),t._lastParsedUrl=this._lastParsedUrl,t}createPopupTemplate(e){return(0,j.Ap)(this,e)}createQuery(){return new V.c({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await Promise.all([r.e(9512),r.e(2664),r.e(6556),r.e(672)]).then(r.bind(r,672))).default,{layer:t,url:i}=this;let s;if(i&&this.originIdOf("url")>T.sT.SERVICE)s=new e({url:i});else{if(!t?.parsedUrl)throw new p.c("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const r=t.parsedUrl;s=new e({url:r.path}),r&&this.source&&("map-layer"===this.source.type?s.layerId=this.source.mapLayerId:s.dynamicDataSource=this.source)}}return null!=t?.refreshInterval&&(s.refreshInterval=t.refreshInterval),this.definitionExpression&&(s.definitionExpression=this.definitionExpression),this.floorInfo&&(s.floorInfo=(0,y.ct)(this.floorInfo)),this.originIdOf("labelingInfo")>T.sT.SERVICE&&(s.labelingInfo=(0,y.ct)(this.labelingInfo)),this.originIdOf("labelsVisible")>T.sT.DEFAULTS&&(s.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>T.sT.DEFAULTS&&(s.legendEnabled=this.legendEnabled),this.originIdOf("visible")>T.sT.DEFAULTS&&(s.visible=this.visible),this.originIdOf("minScale")>T.sT.DEFAULTS&&(s.minScale=this.minScale),this.originIdOf("maxScale")>T.sT.DEFAULTS&&(s.maxScale=this.maxScale),this.originIdOf("opacity")>T.sT.DEFAULTS&&(s.opacity=this.opacity),this.originIdOf("popupTemplate")>T.sT.DEFAULTS&&(s.popupTemplate=(0,y.ct)(this.popupTemplate)),this.originIdOf("renderer")>T.sT.SERVICE&&(s.renderer=(0,y.ct)(this.renderer)),"data-layer"===this.source?.type&&(s.dynamicDataSource=this.source.clone()),this.originIdOf("title")>T.sT.DEFAULTS&&(s.title=this.title),"map-image"===t?.type&&t.originIdOf("customParameters")>T.sT.DEFAULTS&&(s.customParameters=t.customParameters),"tile"===t?.type&&t.originIdOf("customParameters")>T.sT.DEFAULTS&&(s.customParameters=t.customParameters),s}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){const{typeIdField:t,types:r}=this;if(!t||!e)return null;const i=e.attributes?e.attributes[t]:void 0;if(null==i)return null;let s=null;return r?.some((e=>{const{id:t}=e;return null!=t&&(t.toString()===i.toString()&&(s=e),!!s)})),s}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){await this.load(),e=P.c.from(e);const r=this.capabilities;if(!r?.data?.supportsAttachment)throw new p.c("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:n,num:o,size:a,start:l,where:u}=e;if(!r?.operations?.supportsQueryAttachments&&(i?.length>0||n?.length>0||a?.length>0||o||l||u))throw new p.c("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(s?.length||n?.length||u))throw new p.c("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,t)}async queryFeatures(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new p.c("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new p.c("queryFeatures:not-supported","this layer has no url.");const r=await this.queryTask.execute(e,{...t,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(r?.features)for(const e of r.features)e.sourceLayer=this;return r}toExportImageJSON(e){const t={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},r=(0,g._)(e,this.definitionExpression);null!=r&&(t.definitionExpression=r);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce(((e,t)=>(e[t]=this.originIdOf(t),e)),{}),s=Object.keys(i).some((e=>i[e]>T.sT.SERVICE));if(s){const e=t.drawingInfo={};if(i.renderer>T.sT.SERVICE&&(e.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>T.sT.SERVICE&&(e.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>T.sT.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some((e=>!e.labelPlacement))&&f.c.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let t=this.labelingInfo;null!=this.geometryType&&(t=(0,L.M)(this.labelingInfo,G.U.toJSON(this.geometryType))),e.showLabels=!0,e.labelingInfo=t.filter((e=>e.labelPlacement)).map((e=>e.toJSON({origin:"service",layer:this.layer})))}else e.showLabels=!1;i.opacity>T.sT.SERVICE&&(e.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(e.renderer)}return t}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,(e=>{e.color||"esriSMSX"!==e.style&&"esriSMSCross"!==e.style||(e.outline?.color?e.color=e.outline.color:e.color=[0,0,0,0])}))}_forEachSimpleMarkerSymbols(e,t){if(e){const r=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const e of r)z(e.symbol)&&t(e.symbol);"symbol"in e&&z(e.symbol)&&t(e.symbol),"defaultSymbol"in e&&z(e.defaultSymbol)&&t(e.defaultSymbol)}}_setAndNotifyLayer(e,t){const r=this.layer,i=this._get(e);let s,n;switch(e){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":s="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":s="supportsDynamicLayers",n="supportsModification"}const o=(0,F.m6)(this).getDefaultOrigin();if("service"!==o){if(s&&!1===this.layer?.capabilities?.exportMap?.[s])return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${s}'`);if(n&&!1===this.capabilities?.exportMap[n])return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${n}'`)}"source"!==e||"not-loaded"===this.loadStatus?(this._set(e,t),"service"!==o&&i!==t&&r&&r.emit&&r.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this.removeAllHandles()),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null})),e.on("before-changes",(e=>{const t=this.layer?.capabilities?.exportMap?.supportsSublayersChanges;null==t||t||(f.c.getLogger(this).error(new p.c("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),e.preventDefault())}))]))}_logLockedError(e,t){const{layer:r,declaredClass:i}=this;f.c.getLogger(i).error(new p.c("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${r?.id}'`,{reason:t,sublayer:this,layer:r}))}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};K.test={isMapImageLayerOverridePolicy:e=>e===J||e===U,isTileImageLayerOverridePolicy:e=>e===B},(0,s._)([(0,S.qq)({readOnly:!0})],K.prototype,"capabilities",void 0),(0,s._)([(0,w.E)("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],K.prototype,"readCapabilities",null),(0,s._)([(0,S.qq)()],K.prototype,"defaultPopupTemplate",null),(0,s._)([(0,S.qq)({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:U}}})],K.prototype,"definitionExpression",null),(0,s._)([(0,S.qq)({readOnly:!0})],K.prototype,"effectiveScaleRange",null),(0,s._)([(0,w.E)("service","maxScaleRange",["minScale","maxScale"])],K.prototype,"readMaxScaleRange",null),(0,s._)([(0,S.qq)({type:[O.c],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],K.prototype,"fields",void 0),(0,s._)([(0,S.qq)({readOnly:!0})],K.prototype,"fieldsIndex",null),(0,s._)([(0,S.qq)({type:M.c,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:U},origins:{"web-scene":{read:!1,write:!1}}}})],K.prototype,"floorInfo",null),(0,s._)([(0,S.qq)({type:Q.c,json:{read:{source:"layerDefinition.extent"}}})],K.prototype,"fullExtent",void 0),(0,s._)([(0,S.qq)({type:G.U.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:G.U.read}}}}})],K.prototype,"geometryType",void 0),(0,s._)([(0,S.qq)({type:String})],K.prototype,"globalIdField",void 0),(0,s._)([(0,w.E)("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],K.prototype,"readGlobalIdFieldFromService",null),(0,s._)([(0,S.qq)({type:I.Ab,json:{write:{ignoreOrigin:!0}}})],K.prototype,"id",null),(0,s._)([(0,S.qq)({value:null,type:[C.c],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:J}}})],K.prototype,"labelingInfo",null),(0,s._)([(0,q.G)("labelingInfo")],K.prototype,"writeLabelingInfo",null),(0,s._)([(0,S.qq)({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:J}}})],K.prototype,"labelsVisible",null),(0,s._)([(0,S.qq)({value:null})],K.prototype,"layer",null),(0,s._)([(0,S.qq)({type:String,json:{write:{overridePolicy:B}}})],K.prototype,"layerItemId",void 0),(0,s._)([(0,S.qq)({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:k}}})],K.prototype,"legendEnabled",void 0),(0,s._)([(0,S.qq)({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],K.prototype,"listMode",null),(0,s._)([(0,S.qq)({type:Number,value:0,json:{write:{overridePolicy:J}}})],K.prototype,"minScale",null),(0,s._)([(0,w.E)("minScale",["minScale","layerDefinition.minScale"])],K.prototype,"readMinScale",null),(0,s._)([(0,S.qq)({type:Number,value:0,json:{write:{overridePolicy:J}}})],K.prototype,"maxScale",null),(0,s._)([(0,w.E)("maxScale",["maxScale","layerDefinition.maxScale"])],K.prototype,"readMaxScale",null),(0,s._)([(0,S.qq)({type:String})],K.prototype,"objectIdField",void 0),(0,s._)([(0,w.E)("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],K.prototype,"readObjectIdFieldFromService",null),(0,s._)([(0,S.qq)({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:J}}})],K.prototype,"opacity",null),(0,s._)([(0,w.E)("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],K.prototype,"readOpacity",null),(0,s._)([(0,q.G)("opacity")],K.prototype,"writeOpacity",null),(0,s._)([(0,S.qq)({json:{type:I.Ab,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:J}}})],K.prototype,"parent",void 0),(0,s._)([(0,q.G)("parent")],K.prototype,"writeParent",null),(0,s._)([(0,S.qq)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy:k,writer(e,t,r){t[r]=!e}}}})],K.prototype,"popupEnabled",void 0),(0,s._)([(0,S.qq)({type:n.c,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:k}}})],K.prototype,"popupTemplate",void 0),(0,s._)([(0,S.qq)({readOnly:!0})],K.prototype,"queryTask",null),(0,s._)([(0,S.qq)({types:o.U,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:J},origins:{"web-scene":{types:o.Q,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:J}}}}})],K.prototype,"renderer",null),(0,s._)([(0,S.qq)({types:{key:"type",base:null,typeMap:{"data-layer":R.U,"map-layer":N.E}},cast(e){if(e){if("mapLayerId"in e)return(0,I.uY)(N.E,e);if("dataSource"in e)return(0,I.uY)(R.U,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:J}}})],K.prototype,"source",null),(0,s._)([(0,S.qq)()],K.prototype,"sourceJSON",void 0),(0,s._)([(0,S.qq)({value:null,json:{type:[I.Ab],write:{target:"subLayerIds",allowNull:!0,overridePolicy:J}}})],K.prototype,"sublayers",null),(0,s._)([(0,v.W)("sublayers")],K.prototype,"castSublayers",null),(0,s._)([(0,q.G)("sublayers")],K.prototype,"writeSublayers",null),(0,s._)([(0,S.qq)({type:String,json:{name:"name",write:{overridePolicy:k}}})],K.prototype,"title",void 0),(0,s._)([(0,w.E)("service","title",["name","layerDefinition.name"])],K.prototype,"readTitle",null),(0,s._)([(0,S.qq)({type:String})],K.prototype,"typeIdField",void 0),(0,s._)([(0,S.qq)({json:{read:!1},readOnly:!0,value:"sublayer"})],K.prototype,"type",void 0),(0,s._)([(0,w.E)("typeIdField",["layerDefinition.typeIdField"])],K.prototype,"readTypeIdField",null),(0,s._)([(0,S.qq)({type:[E.c],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],K.prototype,"types",void 0),(0,s._)([(0,S.qq)({type:String,json:{name:"layerUrl",write:{overridePolicy:B}}})],K.prototype,"url",null),(0,s._)([(0,S.qq)({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:J}}})],K.prototype,"visible",null),(0,s._)([(0,q.G)("visible")],K.prototype,"writeVisible",null),K=i=(0,s._)([(0,_.c)("esri.layers.support.Sublayer")],K);const W=K},89812:(e,t,r)=>{r.d(t,{h4:()=>I,i2:()=>q}),r(9456);var i,s=r(41948),n=r(62088),o=r(1580),a=(r(66360),r(9968)),l=r(12552),u=r(40504);r(72052);let p=i=class extends u.am{constructor(e){super(e),this.name=null,this.code=null}clone(){return new i({name:this.name,code:this.code})}};(0,s._)([(0,o.qq)({type:String,json:{write:!0}})],p.prototype,"name",void 0),(0,s._)([(0,o.qq)({type:[String,Number],json:{write:!0}})],p.prototype,"code",void 0),p=i=(0,s._)([(0,l.c)("esri.layers.support.CodedValue")],p);const d=new(r(14628).O)({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends u.am{constructor(e){super(e),this.name=null,this.type=null}};(0,s._)([(0,o.qq)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,s._)([(0,a.G)(d)],c.prototype,"type",void 0),c=(0,s._)([(0,l.c)("esri.layers.support.Domain")],c);const y=c;var h;let f=h=class extends y{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const r=String(e);this.codedValues.some((e=>(String(e.code)===r&&(t=e.name),!!t)))}return t}clone(){return new h({codedValues:(0,n.ct)(this.codedValues),name:this.name})}};(0,s._)([(0,o.qq)({type:[p],json:{write:!0}})],f.prototype,"codedValues",void 0),(0,s._)([(0,a.G)({codedValue:"coded-value"})],f.prototype,"type",void 0),f=h=(0,s._)([(0,l.c)("esri.layers.support.CodedValueDomain")],f);const m=f;var g;r(20744);let b=g=class extends y{constructor(e){super(e),this.type="inherited"}clone(){return new g}};(0,s._)([(0,a.G)({inherited:"inherited"})],b.prototype,"type",void 0),b=g=(0,s._)([(0,l.c)("esri.layers.support.InheritedDomain")],b);const S=b;var v;let w=v=class extends y{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new v({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,s._)([(0,o.qq)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,r){t[r]=[this.minValue||0,e]}}}})],w.prototype,"maxValue",void 0),(0,s._)([(0,o.qq)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,r){t[r]=[e,this.maxValue||0]}}}})],w.prototype,"minValue",void 0),(0,s._)([(0,a.G)({range:"range"})],w.prototype,"type",void 0),w=v=(0,s._)([(0,l.c)("esri.layers.support.RangeDomain")],w);const _=w,q={key:"type",base:y,typeMap:{range:w,"coded-value":m,inherited:S}};function I(e){if(!e?.type)return null;switch(e.type){case"range":return _.fromJSON(e);case"codedValue":return m.fromJSON(e);case"inherited":return S.fromJSON(e)}return null}},36408:(e,t,r)=>{r.d(t,{M:()=>i});const i=new(r(14628).O)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},80428:(e,t,r)=>{r.d(t,{E:()=>n,G:()=>o});var i=r(20744),s=r(10860);async function n(e,t,r){let n;try{n=await createImageBitmap(e)}catch(e){throw new i.c("request:server",`Unable to load ${t}`,{url:t,error:e})}return(0,s.wp)(r),n}async function o(e,t,r,n,o){let a;try{a=await createImageBitmap(e)}catch(e){throw new i.c("request:server",`Unable to load tile ${t}/${r}/${n}`,{error:e,level:t,row:r,col:n})}return(0,s.wp)(o),a}},4144:(e,t,r)=>{r.d(t,{GC:()=>q,I5:()=>f,Wi:()=>g,Y$:()=>h,cF:()=>m,wf:()=>b,y6:()=>y});var i=r(88264);const s="__begin__",n="__end__",o=new RegExp(s,"ig"),a=new RegExp(n,"ig"),l=new RegExp("^"+s,"i"),u=new RegExp(n+"$","i"),p='"',d=p+" + ",c=" + "+p;function y(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function h(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function f(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=y(e.labelExpression),t.type="conventional"),t}function m(e){const t=f(e);if(!t)return null;switch(t.type){case"conventional":return b(t.expression);case"arcade":return t.expression}return null}function g(e){const t=f(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(S);return t?.[1].trim()||null}(t.expression);case"arcade":return q(t.expression)}return null}function b(e){let t;return e?(t=(0,i.qq)(e,(e=>s+'$feature["'+e+'"]'+n)),t=l.test(t)?t.replace(l,""):p+t,t=u.test(t)?t.replace(u,""):t+p,t=t.replaceAll(o,d).replaceAll(a,c)):t='""',t}const S=/^\s*\{([^}]+)\}\s*$/i,v=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,w=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,_=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function q(e){if(!e)return null;let t=v.exec(e)||w.exec(e);return t?t[1]||t[3]:(t=_.exec(e),t?t[2]:null)}},54712:(e,t,r)=>{r.d(t,{S:()=>d});var i=r(9456),s=r(48212);function n(e,t,r){return!!a(e,t,r)}function o(e,t,r){return a(e,t,r)}function a(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}const l={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function u(e){const t=e?.supportedSpatialAggregationStatistics?.map((e=>e.toLowerCase()));return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}function p(e,t){const r=e?.supportedOperationsWithCacheHint?.map((e=>e.toLowerCase()));return!!r?.includes(t.toLowerCase())}function d(e,t){return{analytics:c(e),attachment:y(e),data:h(e),metadata:f(e),operations:m(e.capabilities,e,t),query:g(e,t),queryRelated:b(e),queryTopFeatures:S(e),editing:v(e)}}function c(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryAnalytics")}}function y(e){const t=e.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:p(e.advancedQueryCapabilities,"queryAttachments"),supportsResize:n(e,"supportsAttachmentsResizing",!1)};return t&&Array.isArray(t)&&t.forEach((e=>{const t=l[e.name];t&&(r[t]=!!e.isEnabled)})),r}function h(e){return{isVersioned:n(e,"isDataVersioned",!1),supportsAttachment:n(e,"hasAttachments",!1),supportsM:n(e,"hasM",!1),supportsZ:n(e,"hasZ",!1)}}function f(e){return{supportsAdvancedFieldProperties:n(e,"supportsFieldDescriptionProperty",!1)}}function m(e,t,r){const i=e?e.toLowerCase().split(",").map((e=>e.trim())):[],o=r?(0,s.K0)(r):null,a=i.includes(null!=o&&"MapServer"===o.serverType?"data":"query"),l=i.includes("editing")&&!t.datesInUnknownTimezone;let u=l&&i.includes("create"),p=l&&i.includes("delete"),d=l&&i.includes("update");const c=i.includes("changetracking"),y=t.advancedQueryCapabilities;return l&&!(u||p||d)&&(u=p=d=!0),{supportsCalculate:n(t,"supportsCalculate",!1),supportsTruncate:n(t,"supportsTruncate",!1),supportsValidateSql:n(t,"supportsValidateSql",!1),supportsAdd:u,supportsDelete:p,supportsEditing:l,supportsChangeTracking:c,supportsQuery:a,supportsQueryAnalytics:n(y,"supportsQueryAnalytic",!1),supportsQueryAttachments:n(y,"supportsQueryAttachments",!1),supportsQueryTopFeatures:n(y,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:n(t,"supportsAttachmentsResizing",!1),supportsSync:i.includes("sync"),supportsUpdate:d,supportsExceedsLimitStatistics:n(t,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:n(t,"supportsAsyncConvert3D",!1)}}function g(e,t){const r=e.advancedQueryCapabilities,a=e.ownershipBasedAccessControlForFeatures,l=e.archivingInfo,d=e.currentVersion,c=t?.includes("MapServer"),y=!c||d>=(0,i.c)("mapserver-pbf-version-support"),h=(0,s.Wq)(t),f=new Set((e.supportedQueryFormats??"").split(",").map((e=>e.toLowerCase().trim())));return{supportsStatistics:n(r,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:n(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:n(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:u(r),supportsCentroid:n(r,"supportsReturningGeometryCentroid",!1),supportsDistance:n(r,"supportsQueryWithDistance",!1),supportsDistinct:n(r,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:n(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:n(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:n(r,"supportsHavingClause",!1),supportsOrderBy:n(r,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:n(r,"supportsPagination",!1),supportsQuantization:n(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:n(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:n(e,"supportsReturningQueryGeometry",!1),supportsResultType:n(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:n(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:n(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:n(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:n(r,"supportsTopFeaturesQuery",!1),supportsQueryByAnonymous:n(a,"allowAnonymousToQuery",!0),supportsQueryByOthers:n(a,"allowOthersToQuery",!0),supportsHistoricMoment:n(l,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:y&&f.has("pbf"),supportsDisjointSpatialRelationship:n(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:n(r,"supportsQueryWithCacheHint",!1)||p(r,"query"),supportsDefaultSpatialReference:n(r,"supportsDefaultSR",!1),supportsCompactGeometry:h,supportsFullTextSearch:n(r,"supportsFullTextSearch",!1),maxRecordCountFactor:o(e,"maxRecordCountFactor",void 0),maxRecordCount:o(e,"maxRecordCount",void 0),standardMaxRecordCount:o(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:o(e,"tileMaxRecordCount",void 0)}}function b(e){const t=e.advancedQueryCapabilities,r=n(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:n(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:p(t,"queryRelated")}}function S(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryTopFilter")}}function v(e){const t=e.ownershipBasedAccessControlForFeatures,r=e?e.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:n(e,"allowGeometryUpdates",!0),supportsGlobalId:n(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:n(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:n(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:n(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:n(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:n(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:n(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:n(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:n(t,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:n(r,"supportsAsyncApplyEdits",!1),zDefault:o(e,"zDefault",void 0)}}},11856:(e,t,r)=>{r.d(t,{I$:()=>n,gH:()=>a,oR:()=>s});var i=r(71448);function s(e,t,r){const i=t.flatten((({sublayers:e})=>e)).length;return i!==e.length||!!e.some((e=>e.originIdOf("minScale")>r||e.originIdOf("maxScale")>r||e.originIdOf("renderer")>r||e.originIdOf("labelingInfo")>r||e.originIdOf("opacity")>r||e.originIdOf("labelsVisible")>r||e.originIdOf("source")>r))||!o(e,t)}function n(e,t,r){return!!e.some((e=>{const t=e.source;return!(!t||"map-layer"===t.type&&t.mapLayerId===e.id&&(null==t.gdbVersion||t.gdbVersion===r))||e.originIdOf("renderer")>i.sT.SERVICE||e.originIdOf("labelingInfo")>i.sT.SERVICE||e.originIdOf("opacity")>i.sT.SERVICE||e.originIdOf("labelsVisible")>i.sT.SERVICE}))||!o(e,t)}function o(e,t){if(!e?.length||null==t)return!0;const r=t.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).map((e=>e.id)).toArray();if(e.length>r.length)return!1;let i=0;const s=r.length;for(const{id:t}of e){for(;i<s&&r[i]!==t;)i++;if(i>=s)return!1}return!0}function a(e){return!!e&&e.some((e=>null!=e.minScale||null!=e.layerDefinition?.minScale))}},21012:(e,t,r)=>{r.d(t,{M:()=>s});var i=r(37924);function s(e,t,r){if(!r?.features||!r.hasZ)return;const s=(0,i.O)(r.geometryType,t,e.outSpatialReference);if(null!=s)for(const e of r.features)s(e.geometry)}},59500:(e,t,r)=>{r.d(t,{c:()=>S});var i,s=r(41948),n=r(60708),o=r(6444),a=r(14628),l=r(40504),u=r(62088),p=r(1580),d=(r(9456),r(66360),r(33600)),c=r(12552),y=r(18996),h=r(56156),f=r(6704),m=r(600);const g=new a.O({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let b=i=class extends l.am{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=h.c.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const s=e[t],n=o.c.fromJSON(s),a=s.geometry?.spatialReference;null==n.geometry||a||(n.geometry.spatialReference=r);const l=s.aggregateGeometries,u=n.aggregateGeometries;if(l&&null!=u)for(const e in u){const t=u[e],i=l[e],s=i?.spatialReference;null==t||s||(t.spatialReference=r)}i.push(n)}return i}writeGeometryType(e,t,r,i){if(e)return void g.write(e,t,r,i);const{features:s}=this;if(s)for(const e of s)if(null!=e?.geometry)return void g.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,i=(0,f.h4)(e);return i&&!r&&t.spatialReference&&(i.spatialReference=h.c.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,u.ct)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const i=t.features[r];if(i.geometry){const t=e?.[r];i.geometry=t?.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,r],translate:[i,s]}=e,n=this.features,o=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-i)/t)),(e=>Math.round((s-e)/r)));for(let e=0,t=n.length;e<t;e++)o?.(n[e].geometry)||(n.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[i,s],scale:[n,o]}=r;let a=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,(e=>e*n+i),(e=>s-e*o),a,l);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}_quantizePoints(e,t,r){let i,s;const n=[];for(let o=0,a=e.length;o<a;o++){const a=e[o];if(o>0){const e=t(a[0]),o=r(a[1]);e===i&&o===s||(n.push([e-i,o-s]),i=e,s=o)}else i=t(a[0]),s=r(a[1]),n.push([i,s])}return n.length>0?n:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const i=(0,f.Cs)(e)?e.rings:e.paths,s=[];for(let e=0,n=i.length;e<n;e++){const n=i[e],o=this._quantizePoints(n,t,r);o&&s.push(o)}return s.length>0?((0,f.Cs)(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,r);return i&&i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,i,s){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),i&&(e.z=i(e.z))}:"polyline"===e||"polygon"===e?e=>{const n=(0,f.Cs)(e)?e.rings:e.paths;let o,a;for(let e=0,i=n.length;e<i;e++){const i=n[e];for(let e=0,s=i.length;e<s;e++){const s=i[e];e>0?(o+=s[0],a+=s[1]):(o=s[0],a=s[1]),s[0]=t(o),s[1]=r(a)}}if(i&&s)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2]),r[3]=s(r[3])}}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}else if(s)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),i&&null!=e.zmax&&null!=e.zmin&&(e.zmax=i(e.zmax),e.zmin=i(e.zmin)),s&&null!=e.mmax&&null!=e.mmin&&(e.mmax=s(e.mmax),e.mmin=s(e.mmin))}:"multipoint"===e?e=>{const n=e.points;let o,a;for(let e=0,i=n.length;e<i;e++){const i=n[e];e>0?(o+=i[0],a+=i[1]):(o=i[0],a=i[1]),i[0]=t(o),i[1]=r(a)}if(i&&s)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=i(t[2]),t[3]=s(t[3])}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=i(t[2])}else if(s)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=s(t[2])}}:null}};(0,s._)([(0,p.qq)({type:String,json:{write:!0}})],b.prototype,"displayFieldName",void 0),(0,s._)([(0,p.qq)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"exceededTransferLimit",void 0),(0,s._)([(0,p.qq)({type:[o.c],json:{write:!0}})],b.prototype,"features",void 0),(0,s._)([(0,d.E)("features")],b.prototype,"readFeatures",null),(0,s._)([(0,p.qq)({type:[m.c],json:{write:!0}})],b.prototype,"fields",void 0),(0,s._)([(0,p.qq)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],b.prototype,"geometryType",void 0),(0,s._)([(0,y.G)("geometryType")],b.prototype,"writeGeometryType",null),(0,s._)([(0,p.qq)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasM",void 0),(0,s._)([(0,p.qq)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasZ",void 0),(0,s._)([(0,p.qq)({types:n.Su,json:{write:!0}})],b.prototype,"queryGeometry",void 0),(0,s._)([(0,d.E)("queryGeometry")],b.prototype,"readQueryGeometry",null),(0,s._)([(0,p.qq)({type:h.c,json:{write:!0}})],b.prototype,"spatialReference",void 0),(0,s._)([(0,y.G)("spatialReference")],b.prototype,"writeSpatialReference",null),(0,s._)([(0,p.qq)({json:{write:!0}})],b.prototype,"transform",void 0),b=i=(0,s._)([(0,c.c)("esri.rest.support.FeatureSet")],b),b.prototype.toJSON.isDefaultToJSON=!0;const S=b},45704:(e,t,r)=>{r.d(t,{Sg:()=>p,Uj:()=>u,Uz:()=>l,YP:()=>d}),r(9456);var i=r(47472),s=r(7432),n=r(49736),o=r(28652),a=r(9504);const l=n.c.fromJSON(a.qe),u=s.c.fromJSON(a.MZ),p=i.c.fromJSON(a.yq),d=o.c.fromJSON(a.gF);n.c.fromJSON(a.gP),s.c.fromJSON(a.aV),i.c.fromJSON(a.wp)},9504:(e,t,r)=>{r.d(t,{MZ:()=>n,aV:()=>u,gF:()=>a,gP:()=>l,qe:()=>s,wp:()=>p,yq:()=>o});const i=[252,146,31,255],s={type:"esriSMS",style:"esriSMSCircle",size:6,color:i,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},n={type:"esriSLS",style:"esriSLSSolid",width:.75,color:i},o={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},p={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);