@arcgis/core 4.34.0-next.74 → 4.34.0-next.76
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.
- package/PopupTemplate.js +1 -1
- package/applications/Components/QuantityFormatter.js +1 -1
- package/applications/Components/arcadeEditorUtils.d.ts +4 -0
- package/applications/Components/arcadeEditorUtils.js +5 -0
- package/applications/Components/featureUtils.d.ts +1 -0
- package/applications/Components/featureUtils.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/Pixel.js +5 -0
- package/arcade/Voxel.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/OrderBy.js +1 -1
- package/arcade/featureset/support/FeatureSetIterator.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/fieldStats.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/maths.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/009556f323e58271bc7a.js +1 -0
- package/assets/esri/core/workers/chunks/{11acefc48c0354e675df.js → 0309d008e50e55c7ff1d.js} +1 -1
- package/assets/esri/core/workers/chunks/13de06e614adf92239fe.js +1 -0
- package/assets/esri/core/workers/chunks/14a22d1a0eefa970efa1.js +1 -0
- package/assets/esri/core/workers/chunks/16d66770ef841564ee3f.js +1 -0
- package/assets/esri/core/workers/chunks/17103e6542aae53c7301.js +1 -0
- package/assets/esri/core/workers/chunks/{dd447dfc50ee7f511b84.js → 19c1f1431c0b2f4525a2.js} +1 -1
- package/assets/esri/core/workers/chunks/{5c30252c1bb8350cae5f.js → 1c52999a6392370844a6.js} +1 -1
- package/assets/esri/core/workers/chunks/21bfad7283620766d9cd.js +1 -0
- package/assets/esri/core/workers/chunks/{7219ceab0b6fae2e69b6.js → 280af3640f8e93c1024e.js} +2 -2
- package/assets/esri/core/workers/chunks/{49f7a5523462aebf90fc.js.LICENSE.txt → 280af3640f8e93c1024e.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/3064320d54a9b48bd697.js +1 -0
- package/assets/esri/core/workers/chunks/3a5f0c759dd2f4638343.js +1 -0
- package/assets/esri/core/workers/chunks/{d12f373fcf5848ddcd8a.js → 3f523bc8551e712c9bd4.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b7e5ec6aea1f7f9b005.js → 3fecfe4f8ca2a5fd7360.js} +1 -1
- package/assets/esri/core/workers/chunks/4832faefd3b7edc17c84.js +1 -0
- package/assets/esri/core/workers/chunks/{78b33c6d73824085c6d1.js → 48449abe795cb7a831eb.js} +1 -1
- package/assets/esri/core/workers/chunks/4d47187bc0821413492d.js +1 -0
- package/assets/esri/core/workers/chunks/5102c20645d9708c34b4.js +1 -0
- package/assets/esri/core/workers/chunks/541bffd61006d0e36166.js +1 -0
- package/assets/esri/core/workers/chunks/58cc06ed86301f4cee75.js +1 -0
- package/assets/esri/core/workers/chunks/{e12e8d69c05c182b6a69.js → 61bb39597ccf89f99a72.js} +1 -1
- package/assets/esri/core/workers/chunks/{f4e9640306f64b1af7a3.js → 65ec21d29e8563fdbc55.js} +1 -1
- package/assets/esri/core/workers/chunks/67d9cfe02613cb73ee37.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{6dc62c170e9583222df2.js → 70367da4ba916376f40c.js} +1 -1
- package/assets/esri/core/workers/chunks/{fb669a2e50ca7aacac25.js → 71fef0a33b7ed9456e47.js} +1 -1
- package/assets/esri/core/workers/chunks/7430c462c350fdd26349.js +1 -0
- package/assets/esri/core/workers/chunks/{ff3fe5c97a98c8cab4ac.js → 7a23b127f551bf13ef54.js} +2 -2
- package/assets/esri/core/workers/chunks/{ff3fe5c97a98c8cab4ac.js.LICENSE.txt → 7a23b127f551bf13ef54.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/7b73a808922b52755abd.js +1 -0
- package/assets/esri/core/workers/chunks/{d682dd49bb9ee7f48f93.js → 9304c3cdf732745577fd.js} +1 -1
- package/assets/esri/core/workers/chunks/{8d642b34d40edfe02d8e.js → 9c64b78c5c9b35b31d98.js} +2 -2
- package/assets/esri/core/workers/chunks/{8d642b34d40edfe02d8e.js.LICENSE.txt → 9c64b78c5c9b35b31d98.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/a0edff37fd4a3f2cb2eb.js +1 -0
- package/assets/esri/core/workers/chunks/a6533bab3b2fbc1e2a47.js +1 -0
- package/assets/esri/core/workers/chunks/a9f6054d86982b9e5a7c.js +1 -0
- package/assets/esri/core/workers/chunks/{10ec10ca361842efce92.js → ab005fe84952f0676020.js} +1 -1
- package/assets/esri/core/workers/chunks/{5c53deb45bc142219c76.js → b15ff6c9ef2de8a49853.js} +2 -2
- package/assets/esri/core/workers/chunks/{5a476e6743902e35f81a.js.LICENSE.txt → b15ff6c9ef2de8a49853.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/b70d71144a060f7eeeeb.js +1 -0
- package/assets/esri/core/workers/chunks/b8d02f1b73c374767a5f.js +1 -0
- package/assets/esri/core/workers/chunks/ba6452acee3d6defb37e.js +1 -0
- package/assets/esri/core/workers/chunks/bccecd678faff927ac76.js +1 -0
- package/assets/esri/core/workers/chunks/{ce1f4508487298ab57b6.js → bd2dc1282c49125ede89.js} +1 -1
- package/assets/esri/core/workers/chunks/bfbbf180c2c8fdbb6731.js +1 -0
- package/assets/esri/core/workers/chunks/{f542bdc994a5ea3aa9d1.js → c38360d912f256519e06.js} +1 -1
- package/assets/esri/core/workers/chunks/{e3ad0a390387c5847aca.js → c6fecf2bbd2a711f15d3.js} +1 -1
- package/assets/esri/core/workers/chunks/c86f5bb199cf046b8952.js +1 -0
- package/assets/esri/core/workers/chunks/cd1869e183001266c4c1.js +2 -0
- package/assets/esri/core/workers/chunks/{626c18c1bbc50b3b16b2.js.LICENSE.txt → cd1869e183001266c4c1.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{90321feb56f3a84f6e58.js → d153b29c542c37ae1636.js} +2 -2
- package/assets/esri/core/workers/chunks/{90321feb56f3a84f6e58.js.LICENSE.txt → d153b29c542c37ae1636.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{b5f197e24982f6e14468.js → d1f181f91b36351f1d3b.js} +2 -2
- package/assets/esri/core/workers/chunks/d55c55d39a253630d228.js +1 -0
- package/assets/esri/core/workers/chunks/{49f7a5523462aebf90fc.js → d66cdb9bb494da19696b.js} +2 -2
- package/assets/esri/core/workers/chunks/{5c53deb45bc142219c76.js.LICENSE.txt → d66cdb9bb494da19696b.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{9c00c2263e52ad51c2a2.js → d95554f43694b4769675.js} +1 -1
- package/assets/esri/core/workers/chunks/dd587d51dad2d82708d1.js +1 -0
- package/assets/esri/core/workers/chunks/ecac5ca00c742bfb5898.js +1 -0
- package/assets/esri/core/workers/chunks/ed773dab5965e42a2879.js +2 -0
- package/assets/esri/core/workers/chunks/{7219ceab0b6fae2e69b6.js.LICENSE.txt → ed773dab5965e42a2879.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{0d946a226b846b3c0849.js → fc06014fb484fc8c697e.js} +1 -1
- package/assets/esri/images/portal/xrexperience16.png +0 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/chunks/Compositing.glsl.js +4 -3
- package/chunks/Fog.glsl.js +6 -6
- package/chunks/GlowComposition.glsl.js +31 -12
- package/chunks/LineMarker.glsl.js +37 -36
- package/chunks/RibbonLine.glsl.js +83 -83
- package/chunks/array.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/config.js +1 -1
- package/core/quantityFormatUtils.js +1 -1
- package/core/sql.d.ts +1 -0
- package/core/unitFormatUtils.js +1 -1
- package/core/unitUtils.js +1 -1
- package/form/FormTemplate.js +1 -1
- package/geometry/support/curves/circleUtils.js +1 -1
- package/geometry/support/curves/circularArcUtils.js +1 -1
- package/geometry/support/curves/closestPointOnCurve.js +1 -1
- package/geometry/support/curves/curveExtent.js +1 -1
- package/geometry/support/curves/lineUtils.js +5 -0
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/normalizeUtils.js +1 -1
- package/geometry/support/spatialReferenceUtils.js +1 -1
- package/interfaces.d.ts +315 -18
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/Lyr3DWorkerHandle.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/networks/CircuitManager.js +1 -1
- package/networks/support/Circuit.js +1 -1
- package/networks/support/CircuitSection.js +1 -1
- package/networks/support/Subcircuit.js +1 -1
- package/package.json +2 -2
- package/portal/PortalItem.js +1 -1
- package/renderers/ClassBreaksRenderer.js +1 -1
- package/renderers/DictionaryRenderer.js +1 -1
- package/renderers/DotDensityRenderer.js +1 -1
- package/renderers/HeatmapRenderer.js +1 -1
- package/renderers/PieChartRenderer.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/renderers/mixins/VisualVariablesMixin.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/loadArcade.js +1 -1
- package/support/modeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/CIMSymbol.js +1 -1
- package/symbols/support/FeatureExpressionInfo.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/Slice/ResizeManipulator.js +1 -1
- package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
- package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MarkerVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/Lyr3DWorker.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
- package/views/3d/state/SurfaceCollisionConstraint.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/cameraUtilsSpherical.js +1 -1
- package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/flow/FlowWorker.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/flow/loadUtils.js +1 -1
- package/{layers/support/GaussianSplatAtlasPageAllocator.js → views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js} +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianTile.js +5 -0
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +23 -13
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +37 -25
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +11 -11
- package/views/3d/webgl-engine/core/shaderLibrary/util/NoPerspective.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +10 -11
- package/views/GroundView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/interactive/snapping/allLayerSnapping.js +1 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/support/widget.js +1 -1
- package/assets/esri/core/workers/chunks/06bd58c219678315cf5c.js +0 -1
- package/assets/esri/core/workers/chunks/0751f539db31bdb5caec.js +0 -1
- package/assets/esri/core/workers/chunks/19228ab0fe7944c554e5.js +0 -1
- package/assets/esri/core/workers/chunks/2a19a4d7d1c580121065.js +0 -1
- package/assets/esri/core/workers/chunks/3d2629357242492afcfa.js +0 -1
- package/assets/esri/core/workers/chunks/5a476e6743902e35f81a.js +0 -2
- package/assets/esri/core/workers/chunks/5a95688651d7e8b7101d.js +0 -1
- package/assets/esri/core/workers/chunks/5c4ba165816809e06340.js +0 -1
- package/assets/esri/core/workers/chunks/5f239972cb95afdfa77a.js +0 -1
- package/assets/esri/core/workers/chunks/626c18c1bbc50b3b16b2.js +0 -2
- package/assets/esri/core/workers/chunks/6963ded8428cc8d51d85.js +0 -1
- package/assets/esri/core/workers/chunks/6c3ae96c6ef764fb9552.js +0 -1
- package/assets/esri/core/workers/chunks/6da298da2ec09cced0b5.js +0 -1
- package/assets/esri/core/workers/chunks/76ec3d2646ba64e3442f.js +0 -1
- package/assets/esri/core/workers/chunks/8b1d2bbb2b2eb1830921.js +0 -1
- package/assets/esri/core/workers/chunks/925ad2665c2fe0f47cc3.js +0 -1
- package/assets/esri/core/workers/chunks/a2f4b6d8da93f106852c.js +0 -1
- package/assets/esri/core/workers/chunks/ada8e07ff12bc5d4a1d9.js +0 -1
- package/assets/esri/core/workers/chunks/b03dcbc31bccb9fdf9fe.js +0 -1
- package/assets/esri/core/workers/chunks/b0de01f8c9b1c3182e0c.js +0 -1
- package/assets/esri/core/workers/chunks/c7ba8f2aca0fbd6ceded.js +0 -1
- package/assets/esri/core/workers/chunks/c908184d747d33366881.js +0 -1
- package/assets/esri/core/workers/chunks/d1711256493d55eca523.js +0 -1
- package/assets/esri/core/workers/chunks/d305ca524837c5dc81c8.js +0 -1
- package/assets/esri/core/workers/chunks/e6e4e2fb9568319c6207.js +0 -1
- package/assets/esri/core/workers/chunks/e6f2ac738df16fb5e13a.js +0 -1
- package/assets/esri/core/workers/chunks/e8d25d4ca9b335883f34.js +0 -1
- package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +0 -1
- package/assets/esri/core/workers/chunks/f060a52a9b69eb250d63.js +0 -1
- package/layers/support/gaussianSplatUtils.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1303],{2272:(e,t,i)=>{i.d(t,{Dl:()=>u,gf:()=>c,jV:()=>l,lF:()=>h});var s=i(92602),n=i(70333),r=i(4718),o=i(84952),a=i(926);function l(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function u(e){return"string"==typeof e?(0,o.An)(e):(0,r.o8)(e)}function h(e,t,i){const s={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))s[n]=r.map(e=>h(e));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(i?.[n]);s[n]=t?e:JSON.stringify(e)}else s[n]=t?r:JSON.stringify(r);else s[n]=r}return s}async function c(e,t,r){const o=function(e,t){return e?t&&(0,a.Qc)(e)?t:(0,a.CG)(e)??n.id?.findCredential(e)?.token:null}(e,t);if(o)return o;!n.id&&s.A.request.useIdentity&&await Promise.all([i.e(7330),i.e(168),i.e(3747)]).then(i.bind(i,73747));const l=await n.id.getCredential(e,r);return l?.token}},6518:(e,t,i)=>{i.d(t,{F:()=>a});var s=i(44208),n=i(75503),r=i(19419);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.wq(9,(0,s.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((i,s)=>{e[t++]=s}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.Ie)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,i){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,i)}(this._index,e,e=>t(this._idByBounds.get(e)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},9762:(e,t,i)=>{i.r(t),i.d(t,{projectBuffer:()=>n});var s=i(37539);function n(e,t,i,n,r,o,a=Math.floor(e.length/3)){const l=(0,s.jd)(t,r);if(null==l)return!1;if(l===s.pO){if(e===n&&i===o)return!0;const t=i+3*a;for(let s=i,r=o;s<t;s++,r++)n[r]=e[s];return!0}const u=i+3*a;for(let t=i,s=o;t<u;t+=3,s+=3)l(e,t,n,s);return!0}},12543:(e,t,i)=>{i.r(t),i.d(t,{default:()=>me});var s=i(31635),n=i(65529),r=i(74887),o=i(36708),a=i(10107),l=(i(44208),i(53966)),u=(i(87811),i(40608)),h=i(79897),c=i(16930),d=i(65864),f=i(83221),p=i(56390),_=i(87045),m=i(61956),g=i(88625),y=i(66344),v=i(91869),w=i(83047),x=i(16271);function I(e=!1,t){if(e){const{elevationInfo:e,alignPointsInFeatures:i}=t;return new b(e,i)}return new M}class M{async alignCandidates(e,t,i){return e}notifyElevationSourceChange(){}}class b{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new y.q(1024),this._cacheVersion=0}async alignCandidates(e,t,i){const s=this._elevationInfo;return null==s||"absolute-height"!==s.mode||s.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,i):(function(e,t,i){const{offset:s,unit:n}=i;if(null==s)return;const r=(0,w.G9)(t),o=s*((0,x.Ao)(n??"meters")/r);for(const t of e)switch(t.type){case"edge":t.start.z+=o,t.end.z+=o;continue;case"vertex":t.target.z+=o;continue}}(e,t,s),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}async _alignComputedElevationCandidates(e,t,i){const s=new Map;for(const t of e)(0,v.tE)(s,t.objectId,F).push(t);const[n,o,a]=this._prepareQuery(s,t),l=await this._alignPointsInFeatures(n,i);if((0,r.Te)(i),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,i);this._applyCacheAndResponse(n,l,o);const{drapedObjectIds:u,failedObjectIds:h}=l,c=[];for(const t of e){const{objectId:e}=t;u.has(e)&&"edge"===t.type&&(t.draped=!0),h.has(e)||c.push(t)}return c}_prepareQuery(e,t){const i=[],s=[];for(const[t,n]of e){const e=[];for(const i of n)this._addToQueriesOrCachedResult(t,i.target,e,s),"edge"===i.type&&(this._addToQueriesOrCachedResult(t,i.start,e,s),this._addToQueriesOrCachedResult(t,i.end,e,s));0!==e.length&&i.push({objectId:t,points:e})}return[{spatialReference:t.toJSON(),pointsInFeatures:i},s,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,i,s){const n=C(e,t),r=this._alignmentsCache.get(n);null==r?i.push(t):s.push(new S(t,r))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:i,failedObjectIds:s},n){for(const e of n)e.apply();let r=0;const o=this._alignmentsCache;for(const{objectId:n,points:a}of e.pointsInFeatures){if(s.has(n)){r+=a.length;continue}const e=!i.has(n);for(const i of a){const s=C(n,i),a=t[r++];i.z=a,e&&o.put(s,a,1)}}}}class S{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function C(e,{x:t,y:i,z:s,spatialReference:n}){return`${e}-${t}-${i}-${s??0}}-wkid:${n?.wkid}`}function F(){return[]}class T{filter(e,t){return t}notifyElevationSourceChange(){}}class z{filter(e,t){const{point:i,distance:s}=e,{z:n}=i;if(null==n)return t;if(0===t.length)return t;const r=function(e){return"number"==typeof e?{x:e,y:e,z:e}:e}(s),o=this._updateCandidatesTo3D(t,i,r).filter(R);return o.sort(P),o}_updateCandidatesTo3D(e,t,i){for(const s of e)switch(s.type){case"edge":E(s,t,i);continue;case"vertex":A(s,t,i);continue}return e}}function R(e){return e.distance<=1}function B(e=!1){return e?new z:new T}function E(e,t,{x:i,y:s,z:n}){const{start:r,end:o,target:a}=e;e.draped||function(e,t,i,s){const n=s.x-i.x,r=s.y-i.y,o=s.z-i.z,a=n*n+r*r+o*o,l=(t.x-i.x)*n+(t.y-i.y)*r+o*(t.z-i.z),u=Math.min(1,Math.max(0,l/a)),h=i.x+n*u,c=i.y+r*u,d=i.z+o*u;e.x=h,e.y=c,e.z=d}(a,t,r,o);const l=(t.x-a.x)/i,u=(t.y-a.y)/s,h=(t.z-a.z)/n;e.distance=Math.sqrt(l*l+u*u+h*h)}function A(e,t,{x:i,y:s,z:n}){const{target:r}=e,o=(t.x-r.x)/i,a=(t.y-r.y)/s,l=(t.z-r.z)/n,u=Math.sqrt(o*o+a*a+l*l);e.distance=u}function P(e,t){return e.distance-t.distance}var j=i(4718),O=i(799);function k(e=!1,t){return e?new q(t):new Z}class Z{async fetch(){return[]}notifySymbologyChange(){}}class q{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new y.q(1024),this._cacheVersion=0}async fetch(e,t){if(0===e.length)return[];const i=[],s=[],n=this._candidatesCache;for(const t of e){const e=L(t),r=n.get(e);if(r)for(const e of r)s.push((0,j.o8)(e));else i.push(t),n.put(e,[],1)}if(0===i.length)return s;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(i,t);if((0,r.Te)(t),o!==this._cacheVersion)return this.fetch(e,t);const u=[],{length:h}=a;for(let e=0;e<h;++e){const t=a[e],s=L(i[l[e]]),r=n.get(s);r.push(t),n.put(s,r,r.length),u.push((0,j.o8)(t))}return s.concat(u)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function L(e){switch(e.type){case"vertex":{const{objectId:t,target:i}=e,s=`${t}-vertex-${i.x}-${i.y}-${i.z??0}`;return(0,O.Wm)(s).toString()}case"edge":{const{objectId:t,start:i,end:s}=e,n=`${t}-edge-${i.x}-${i.y}-${i.z??0}-to-${s.x}-${s.y}-${s.z??0}`;return(0,O.Wm)(n).toString()}default:return""}}var H=i(65008),Y=i(4576),X=i(60999),N=i(3483),U=i(13069),$=i(5443),G=i(19419),D=i(90708),J=i(60694),K=i(69418),Q=i(80893);class V{constructor(e,t){this.data=e,this.resolution=t,this.state={type:0},this.alive=!0}process(e){switch(this.state.type){case 0:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case 1:case 3:break;case 2:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case 4:this.state=this._goToDone(this.state,e)}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case 0:case 1:return 0;case 2:return this.state.featureCount;case 3:return this.state.previous.featureCount;case 4:return this.state.features.length;case 5:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case 0:return"created";case 1:return"fetch-count";case 2:return"fetched-count";case 3:return"fetch-features";case 4:return"fetched-features";case 5:return"done"}}_gotoFetchCount(e,t){return{type:1,previous:e,task:(0,X.UT)(async e=>{const i=await(0,X.DZ)(t.fetchCount(this,e));1===this.state.type&&(this.state=function(e,t){return{type:2,featureCount:t,previous:e}}(this.state,i.ok?i.value:1/0))})}}_gotoFetchFeatures(e,t){return{type:3,previous:e,task:(0,X.UT)(async i=>{const s=await(0,X.DZ)(t.fetchFeatures(this,e.featureCount,i));3===this.state.type&&(this.state=function(e,t){return{type:4,previous:e,features:t}}(this.state,s.ok?s.value:[]))})}}_goToDone(e,t){return t.finish(this,e.features),{type:5,previous:e}}reset(){const e=this.state;switch(this.state={type:0},e.type){case 0:case 2:case 4:case 5:break;case 1:case 3:e.task.abort()}}intersects(e){return null==e||!this.data.extent||((0,G.VY)(e,W),(0,G.HY)(this.data.extent,W))}}const W=(0,G.vt)();let ee=class extends H.A{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),i=(0,N.KC)(e,this._mandatoryOutFields);(0,N.aI)(i,t)||(this._set("outFields",i),(0,N.Yy)(i,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new h.U}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,()=>{this._updatePriorities(),this._process()},{sync:!0,initial:!0,equals:(e,t)=>(0,Y.aI)(e,t,({id:e},{id:t})=>e===t)}),this.addHandles((0,o.z7)(()=>!this.suspended,()=>this._process()))}_updatePriorities(){this.store.setPriorityOrderByKey(this.tilesOfInterest.map(e=>e.id??"")??[])}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const e of this._pendingTiles.values())e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t))},i=(0,X.UT)(async e=>{try{await this.store.processEdits(t,(e,t)=>this._queryFeaturesById(e,t),e),this._processPendingTiles()}catch(e){(0,r.QP)(e),l.A.getLogger(this).warn("Failed to apply edits",e)}});this.addHandles(i),await this._updatingHandles.addPromise(i.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,J.Wo)(this.url))return;const e=(0,X.UT)(async e=>{try{const t=await(0,Q.Jf)(this.url,new m.A({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=$.A.fromJSON(t.data?.extent)}catch(e){(0,r.QP)(e),l.A.getLogger(this).warn("Failed to fetch data extent",e)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:i}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(const t of this.tilesOfInterest){const i=this.store.process(t,(e,t)=>this._verifyTileComplexity(e,t),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<se}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const i=this.tileSize*t;return e*(ne/(i*i))<re}_ensureFetchAllCounts(e){let t=!0;for(const i of this._pendingTiles.values())i.state.type<2&&this._updatingHandles.addPromise(i.process(e)),i.state.type<=1&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new V(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:ie,signal:t})}async _fetchFeatures(e,t,i){let s=0;const n=[];let r=0,o=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,s,o),{features:u,exceededTransferLimit:h}=await this._queryFeatures(a,i);l&&(s+=a.num),r+=u.length;for(const e of u)n.push(e);if(o=t-r,!l||!h||o<=0)return n}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let s=null;const n=e?(0,U.AG)(e):e;if(this.store.featureStore.forEach(e=>{n===(0,U.AG)(e.attributes[t])&&(s=e.objectId??e.attributes[i])}),null==s)throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await(0,Q.IJ)(this.url,e,new K.S({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,D.eY)(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await(0,Q.eW)(this.url,e,i,{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,D.q3)(s,{type:"object-id",fieldName:this.objectIdField})}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),i=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,s=(0,N.KC)((0,N.iv)(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(s),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new m.A({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:null!=this.tileInfo&&null!=e?(0,G.w1)(e.data.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:n,tileMaxRecordCount:r,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=s?m.A.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||n)&&r?r:o||te);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"url",void 0),(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"objectIdField",void 0),(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"globalIdField",void 0),(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"capabilities",void 0),(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"sourceSpatialReference",void 0),(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"spatialReference",void 0),(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"store",void 0),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],ee.prototype,"_minimumVerticesPerFeature",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"_mandatoryOutFields",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"outFields",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"suspended",void 0),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"_historicMoment",void 0),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"filter",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"customParameters",null),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],ee.prototype,"_configuration",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"tileInfo",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"tileSize",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"tilesOfInterest",void 0),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],ee.prototype,"updating",null),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],ee.prototype,"availability",void 0),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"hasZ",null),ee=(0,s.Cg)([(0,u.$)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],ee);const te=2e3,ie=6e5,se=1e6,ne=25,re=1;var oe=i(6518),ae=i(72802);class le{constructor(){this._store=new Map,this._priorities=new Map}get size(){return this._store.size}setPriorityOrderByKey(e){this._priorities.clear();for(let t=e.length-1;t>=0;t--)this._priorities.set(e[t],e.length-t)}hasLowerPriority(e){const t=this._priorities.get(e);if(null==t)return!0;for(const[e]of this._store){const i=this._priorities.get(e);if(null==i||i<t)return!0}return!1}someFromLowestToHighestPriority(e){const{_priorities:t}=this;for(const[i,s]of this._store)if(!t.has(i)&&e(s,i))return!0;for(const[i]of t){const t=this._store.get(i);if(t&&e(t,i))return!0}return!1}set(e,t){this._store.set(e,t)}delete(e){return this._store.delete(e)}get(e){return this._store.get(e)}has(e){return this._store.has(e)}clear(){this._store.clear()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}let ue=class extends H.A{setPriorityOrderByKey(e){this._tiles.setPriorityOrderByKey(e)}get _memoryLimitExceeded(){return this.featureStore.usedMemory>=this.maximumByteSize}constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10485760,this._tileBounds=new oe.F,this._tiles=new le,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,G.vt)()}add(e,t){for(const e of t)this._referenceFeature(e.objectId);const i=this.featureStore.upsertMany(t),s=i.map(e=>new Set(Object.keys(e.attributes))).reduce((e,t)=>(0,N.E$)(e,t),new Set(Object.keys(i[0]?.attributes??[]))),n=this._memoryLimitExceeded;this._addTileStorage(e,new Set(i.map(e=>e.objectId)),s),n&&this._applyCacheMemoryLimits()}_applyCacheMemoryLimits(){if(!this._memoryLimitExceeded)return;const{_tiles:e,featureStore:t,maximumByteSize:i}=this;e.someFromLowestToHighestPriority(e=>!this._memoryLimitExceeded||t.usedMemory-this._estimateRemoveTileMemoryReduction(e)<i||(this._removeTileStorage(e),!1))}_estimateRemoveTileMemoryReduction(e){let t=0;for(const i of e.objectIds)if(1===this._refCounts.get(i)){const e=this.featureStore.getFeature(i);e&&(t+=this.featureStore.estimateFeatureUsedMemory?.(e)??0)}return t}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,i){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,i)}_addTileStorage(e,t,i){const s=e.id;this._tiles.set(s,new he(e,t,i)),this._tileBounds.set(s,e.extent),this._tileFeatureCounts.set(s,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)1===this._unreferenceFeature(i)&&t.push(i);this.featureStore.removeManyById(t);const i=e.data.id;this._tiles.delete(i),this._tileBounds.delete(i)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const i of e)t.objectIds.delete(i);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,i){if(!e.length)return;const s=(await t(e,i)).features,{hasZ:n,hasM:r}=this.featureStore;for(const e of s){const t=(0,D.jQ)(this._tmpBoundingRect,e.geometry,n,r);null!=t&&this._tileBounds.forEachInBounds(t,t=>{const i=this._tiles.get(t);this.featureStore.add(e);const s=e.objectId;i.objectIds.has(s)||(i.objectIds.add(s),this._referenceFeature(s),this._tileFeatureCounts.set(i.data.id,i.objectIds.size))})}}process(e,t=()=>!0,i){if(null==this.tileInfo||!e.extent||null!=this.extent&&!(0,G.HY)((0,G.VY)(this.extent,this._tmpBoundingRect),e.extent))return new de(e);if(this._memoryLimitExceeded&&!this._tiles.hasLowerPriority(e.id??""))return new de(e);const s=this.getAttributesForTile(e.id);if((0,N.Yy)(i,s))return new de(e);const n=this._createTileTree(e,this.tileInfo);return this._simplify(n,t,null,0,1),this._collectMissingTiles(e,n,this.tileInfo,i)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,i,s){const n=this._tileFeatureCounts.get(e.id);if(null!=n)return n;const r=await(0,Q.gW)(t,i,s);return this._tileFeatureCounts.set(e.id,r.data.count),r.data.count}_createTileTree(e,t){const i=new ce(e.level,e.row,e.col);return t.updateTileInfo(i,1),this._tileBounds.forEachInBounds(e.extent,s=>{const n=this._tiles.get(s)?.data;n&&function(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const i=e.level<t.level,s=i?e:t,n=i?t:e,r=1<<n.level-s.level;return Math.floor(n.row/r)===s.row&&Math.floor(n.col/r)===s.col}(e,n)&&this._populateChildren(i,n,t,this._tileFeatureCounts.get(n.id)||0)}),i}_populateChildren(e,t,i,s){const n=t.level-e.level-1;if(n<0)return void(e.isLeaf=!0);const r=t.row>>n,o=t.col>>n,a=e.row<<1,l=o-(e.col<<1)+(r-a<<1),u=e.children[l];if(null!=u)this._populateChildren(u,t,i,s);else{const n=new ce(e.level+1,r,o);i.updateTileInfo(n,1),e.children[l]=n,this._populateChildren(n,t,i,s)}}_simplify(e,t,i,s,n){const r=n*n;if(e.isLeaf)return t(this.getFeatureCount(e),n)?0:(this._remove(e),null!=i&&(i.children[s]=null),r);const o=n/2,a=o*o;let l=0;for(let i=0;i<e.children.length;i++){const s=e.children[i];l+=null!=s?this._simplify(s,t,e,i,o):a}return 0===l?this._mergeChildren(e):1-l/r<pe&&(this._purge(e),null!=i&&(i.children[s]=null),l=r),l}_mergeChildren(e){const t=new Set;let i;this._forEachLeaf(e,e=>{const s=this._tiles.get(e.id);if(s){i=i?(0,N.E$)(i,s.attributeKeys):new Set(s.attributeKeys);for(const e of s.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}}),this._addTileStorage(e,t,i??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const i of e.children)null!=i&&(i.isLeaf?t(i):this._forEachLeaf(i,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const i=e.children[t];this._purge(i),e.children[t]=null}}_collectMissingTiles(e,t,i,s){const n=new fe(i,e,this.extent);return this._collectMissingTilesRecurse(t,n,1,s),n.info}_collectMissingTilesRecurse(e,t,i,s){const n=this.getAttributesForTile(e.id),r=n&&!(0,N.Yy)(s,n);if(r&&t.addMissing(e.level,e.row,e.col,i),e.isLeaf)return;if(!e.hasChildren)return void(r||t.addMissing(e.level,e.row,e.col,i));const o=i/2;for(let i=0;i<e.children.length;i++){const n=e.children[i];null==n?t.addMissing(e.level+1,(e.row<<1)+((2&i)>>1),(e.col<<1)+(1&i),o):this._collectMissingTilesRecurse(n,t,o,s)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?0:2}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),1):(t>0&&this._refCounts.set(e,t),2)}get test(){}};(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ue.prototype,"featureStore",void 0),(0,s.Cg)([(0,a.MZ)()],ue.prototype,"tileInfo",void 0),(0,s.Cg)([(0,a.MZ)()],ue.prototype,"extent",void 0),(0,s.Cg)([(0,a.MZ)()],ue.prototype,"maximumByteSize",void 0),ue=(0,s.Cg)([(0,u.$)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],ue);class he{constructor(e,t,i){this.data=e,this.objectIds=t,this.attributeKeys=i}}class ce{constructor(e,t,i){this.level=e,this.row=t,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class de{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,G.Wc)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class fe{constructor(e,t,i){this._tileInfo=e,this._extent=null,this.info=new de(t),null!=i&&(this._extent=(0,G.VY)(i))}addMissing(e,t,i,s){const n=new ae.U(null,e,t,i);this._tileInfo.updateTileInfo(n,1),null==n.extent||null!=this._extent&&!(0,G.HY)(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:s}),this.info.coveredArea-=(0,G.Wc)(n.extent))}}const pe=.18751;let _e=class extends n.nJ{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=(0,r.Tw)(),this._elevationAligner=I(),this._elevationFilter=B(),this._symbologyCandidatesFetcher=k(),this._updatingHandles=new h.U,this._alignPointsInFeatures=async(e,t)=>{const i={query:e},s=await this.remoteClient.invoke("alignElevation",i,{signal:t});return(0,r.Te)(t),s},this._getSymbologyCandidates=async(e,t)=>{const i={candidates:e,spatialReference:this._spatialReference.toJSON()},s=await this.remoteClient.invoke("getSymbologyCandidates",i,{signal:t});return(0,r.Te)(t),s}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:i,timeInfo:s,fieldsIndex:n}=e.serviceInfo,{hasZ:r}=e,a=c.A.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new f.A({...e.serviceInfo,hasZ:r,hasM:!1}),this._featureStore.estimateFeatureUsedMemory=e=>e.usedMemory,this._queryEngine=new p.do({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:n,hasZ:r,hasM:!1,featureIdInfo:{type:"object-id",fieldName:i},timeInfo:s}),this._featureFetcher=new ee({store:new ue({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:c.A.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const l="3d"===e.configuration.viewType;return this._elevationAligner=I(l,{elevationInfo:null!=e.elevationInfo?g.A.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=B(l),this.addHandles([(0,o.wB)(()=>this._featureFetcher.availability,e=>this.emit("notify-availability",{availability:e}),o.OH),(0,o.wB)(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),ge}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.Te)(t),this._featureFetcher.suspended=e,ge}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.Te)(t),this._featureFetcher.outFields=new Set(e??[]),ge}async fetchCandidates(e,t){await this._whenSetup.promise,(0,r.Te)(t);const i=function(e,t){const i=!!t||void 0;if(!e.filter)return{...e,query:{where:"1=1",returnZ:i}};const{distance:s,units:n,spatialRel:r,where:o,timeExtent:a,objectIds:l}=e.filter,u={geometry:e.filter.geometry?(0,d.rS)(e.filter.geometry):void 0,distance:s,units:n,spatialRel:r,timeExtent:a,objectIds:l,returnZ:i,where:o??"1=1"};return{...e,query:u}}(e,this._featureStore.hasZ),s=t?.signal,n=await this._queryEngine.executeQueryForSnapping(i,s);(0,r.Te)(s);const o=await this._elevationAligner.alignCandidates(n.candidates,c.A.fromJSON(e.point.spatialReference)??c.A.WGS84,s);(0,r.Te)(s);const a=await this._symbologyCandidatesFetcher.fetch(o,s);(0,r.Te)(s);const l=0===a.length?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(i,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.Te)(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?_.A.fromJSON(e.tileInfo):null,ge}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.Te)(t),this._featureFetcher.refresh(),ge}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.Te)(t),await(0,o.C_)(()=>!this.updating,t),(0,r.Te)(t),ge}async getDebugInfo(e,t){return(0,r.Te)(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.Te)(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),(0,r.Te)(t),ge}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),ge}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),ge}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),ge}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=k(e,this._getSymbologyCandidates),ge}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?m.A.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,s.Cg)([(0,a.MZ)({readOnly:!0})],_e.prototype,"updating",null),(0,s.Cg)([(0,a.MZ)()],_e.prototype,"_isInitializing",void 0),_e=(0,s.Cg)([(0,u.$)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],_e);const me=_e,ge={result:{}}},16271:(e,t,i)=>{i.d(t,{Ao:()=>r,KQ:()=>o});var s=i(4576),n=i(31756);function r(e){return 1/(n.j[e]||1)}const o=function(){const e=Object.keys(n.j);return(0,s.TF)(e,"decimal-degrees"),e.sort(),e}()},31756:(e,t,i)=>{i.d(t,{j:()=>r});var s=i(83047),n=i(79258);const r={unknown:1,inches:(0,s.oU)(1,"meters","inches"),feet:(0,s.oU)(1,"meters","feet"),"us-feet":(0,s.oU)(1,"meters","us-feet"),yards:(0,s.oU)(1,"meters","yards"),miles:(0,s.oU)(1,"meters","miles"),"nautical-miles":(0,s.oU)(1,"meters","nautical-miles"),millimeters:(0,s.oU)(1,"meters","millimeters"),centimeters:(0,s.oU)(1,"meters","centimeters"),decimeters:(0,s.oU)(1,"meters","decimeters"),meters:(0,s.oU)(1,"meters","meters"),kilometers:(0,s.oU)(1,"meters","kilometers"),"decimal-degrees":1/(0,s.vl)(1,"meters",n.$O.radius)}},36708:(e,t,i)=>{i.d(t,{C_:()=>d,OH:()=>_,Vh:()=>m,on:()=>c,pc:()=>g,wB:()=>l,z7:()=>u});var s=i(37955),n=i(36563),r=i(97768),o=i(74887),a=i(14012);function l(e,t,i={}){return h(e,t,i,f)}function u(e,t,i={}){return h(e,t,i,p)}function h(e,t,i={},s){let n=null;const o=i.once?(e,i)=>{s(e)&&((0,r.xt)(n),t(e,i))}:(e,i)=>{s(e)&&t(e,i)};if(n=(0,a.Cn)(e,o,i.sync,i.equals),i.initial){const t=e();o(t,t)}return n}function c(e,t,i,o={}){let a=null,u=null,h=null;function c(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(e){o.once&&o.once&&(0,r.xt)(h),i(e)}const f=l(e,(e,i)=>{c(),(0,s.wb)(e)&&(a=e,u=(0,s.on)(e,t,d),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return h=(0,n.hA)(()=>{f.remove(),c()}),h}function d(e,t){return function(e,t,i){if((0,o.G4)(i))return Promise.reject((0,o.NK)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,r.xt)(a)}return new Promise((s,r)=>{a=(0,n.vE)([(0,o.u7)(i,()=>{l(),r((0,o.NK)())}),h(e,e=>{l(),s(e)},{sync:!1,once:!0},t??f)])})}(e,p,t)}function f(e){return!0}function p(e){return!!e}i(80559);const _={sync:!0},m={initial:!0},g={sync:!0,initial:!0}},37539:(e,t,i)=>{i.d(t,{pO:()=>_,jd:()=>d,Tp:()=>f,w5:()=>c});var s=i(34727),n=i(83047),r=i(73941),o=i(79258);Math.PI;const a=o.$O.radius,l=o.$O.eccentricitySquared,u={a1:a*l,a2:a*l*a*l,a3:a*l*l/2,a4:a*l*a*l*2.5,a5:a*l+a*l*l/2,a6:1-l};o.$O.radius,o.$O.flattening,o.Sw.radius,o.Sw.flattening,o.sH.radius,o.sH.flattening,o.sH.radius;var h=i(21325);const c={2:{5:_,7:null,9:null,10:_,1:M,6:null,8:null,0:null,3:g,11:y,2:_,4:T},5:{5:_,7:null,9:null,10:_,1:M,6:null,8:null,0:null,3:g,11:y,2:_,4:T},7:{5:null,7:_,9:null,10:_,1:null,6:I,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:_,10:_,1:null,6:null,8:x,0:null,3:null,11:null,2:null,4:null},3:{5:m,7:null,9:null,10:m,1:function(e,t,i,s){const n=e[t]/P,r=A-2*Math.atan(Math.exp(-e[t+1]/P)),o=P+e[t+2],a=Math.cos(r)*o;i[s]=Math.cos(n)*a,i[s+1]=Math.sin(n)*a,i[s+2]=Math.sin(r)*o},6:null,8:null,0:null,3:_,11:function(e,t,i,s){m(e,t,i,s),y(i,s,i,s)},2:m,4:function(e,t,i,s){m(e,t,i,s),T(i,s,i,s)}},4:{5:z,7:null,9:null,10:z,1:function(e,t,i,s){z(e,t,i,s),M(i,s,i,s)},6:null,8:null,0:null,3:function(e,t,i,s){z(e,t,i,s),g(i,s,i,s)},11:function(e,t,i,s){z(e,t,i,s),y(i,s,i,s)},2:z,4:_},1:{5:F,7:null,9:null,10:F,1:_,6:null,8:null,0:null,3:function(e,t,i,s){F(e,t,i,s),g(i,s,i,s)},11:function(e,t,i,s){F(e,t,i,s),y(i,s,i,s)},2:F,4:function(e,t,i,s){F(e,t,i,s),T(i,s,i,s)}},6:{5:null,7:C,9:null,10:C,1:null,6:_,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:S,10:S,1:null,6:null,8:_,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:_,3:null,11:null,2:null,4:null},10:{5:_,7:_,9:_,10:_,1:M,6:I,8:x,0:null,3:g,11:y,2:_,4:T},11:{5:v,7:null,9:null,10:v,1:function(e,t,i,s){v(e,t,i,s),M(i,s,i,s)},6:null,8:null,0:null,3:function(e,t,i,s){v(e,t,i,s),g(i,s,i,s)},11:_,2:v,4:function(e,t,i,s){v(e,t,i,s),T(i,s,i,s)}}};function d(e,t){return f(e,t)?.projector}function f(e,t){if(null==e||null==t)return null;if(R.source.spatialReference===e&&R.dest.spatialReference===t)return R;const i=p(e,R.source),s=p(t,R.dest);return 0===i&&0===s?(0,h.aI)(e,t)?R.projector=_:R.projector=null:R.projector=c[i][s],R}function p(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,n.GA)(e,1)),(0,r.jA)(e)?t.spatialReferenceId=1:(0,h.oT)(e)?t.spatialReferenceId=2:(0,h.K8)(e)?t.spatialReferenceId=3:(0,h.r1)(e)?t.spatialReferenceId=11:e.wkt===r.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===r.FY.wkt?t.spatialReferenceId=6:e.wkt===r.LJ.wkt?t.spatialReferenceId=8:(0,h.q8)(e)?t.spatialReferenceId=7:(0,h.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function _(e,t,i,s){e!==i&&(i[s++]=e[t++],i[s++]=e[t++],i[s]=e[t])}function m(e,t,i,s){i[s]=E*(e[t]/P),i[s+1]=E*(A-2*Math.atan(Math.exp(-e[t+1]/P))),i[s+2]=e[t+2]}function g(e,t,i,n){!function(e,t,i,n,r){const o=.4999999*Math.PI,a=(0,s.qE)(B*e[t+1],-o,o),l=Math.sin(a);i[n++]=B*e[t]*r.radius,i[n++]=r.halfSemiMajorAxis*Math.log((1+l)/(1-l)),i[n]=e[t+2]}(e,t,i,n,o.$O)}function y(e,t,i,s){i[s]=e[t]*j,i[s+1]=e[t+1]*j,i[s+2]=e[t+2]}function v(e,t,i,s){i[s]=e[t]*O,i[s+1]=e[t+1]*O,i[s+2]=e[t+2]}function w(e,t,i,s,n){const r=n+e[t+2],o=B*e[t+1],a=B*e[t],l=Math.cos(o)*r;i[s]=Math.cos(a)*l,i[s+1]=Math.sin(a)*l,i[s+2]=Math.sin(o)*r}function x(e,t,i,s){w(e,t,i,s,o.Sw.radius)}function I(e,t,i,s){w(e,t,i,s,o.sH.radius)}function M(e,t,i,s){w(e,t,i,s,o.$O.radius)}function b(e,t,i,n,r){const o=e[t],a=e[t+1],l=e[t+2],u=Math.sqrt(o*o+a*a+l*l),h=(0,s.YN)(l/(0===u?1:u)),c=Math.atan2(a,o);i[n++]=E*c,i[n++]=E*h,i[n]=u-r}function S(e,t,i,s){b(e,t,i,s,o.Sw.radius)}function C(e,t,i,s){b(e,t,i,s,o.sH.radius)}function F(e,t,i,s){b(e,t,i,s,o.$O.radius)}function T(e,t,i,s){!function(e,t,i,s,n){const r=B*e[t],o=B*e[t+1],a=e[t+2],l=Math.sin(o),u=Math.cos(o),h=n.radius/Math.sqrt(1-n.eccentricitySquared*l*l);i[s++]=(h+a)*u*Math.cos(r),i[s++]=(h+a)*u*Math.sin(r),i[s++]=(h*(1-n.eccentricitySquared)+a)*l}(e,t,i,s,o.$O)}function z(e,t,i,s){const n=u,r=e[t],a=e[t+1],l=e[t+2];let h,c,d,f,p,_,m,g,y,v,w,x,I,M,b,S,C,F,T,z,R;h=Math.abs(l),c=r*r+a*a,d=Math.sqrt(c),f=c+l*l,p=Math.sqrt(f),z=Math.atan2(a,r),_=l*l/f,m=c/f,M=n.a2/p,b=n.a3-n.a4/p,m>.3?(g=h/p*(1+m*(n.a1+M+_*b)/p),T=Math.asin(g),v=g*g,y=Math.sqrt(1-v)):(y=d/p*(1-_*(n.a5-M-m*b)/p),T=Math.acos(y),v=1-y*y,g=Math.sqrt(v)),w=1-o.$O.eccentricitySquared*v,x=o.$O.radius/Math.sqrt(w),I=n.a6*x,M=d-x*y,b=h-I*g,C=y*M+g*b,S=y*b-g*M,F=S/(I/w+C),T+=F,R=C+S*F/2,l<0&&(T=-T),i[s++]=E*z,i[s++]=E*T,i[s]=R}const R={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:_},B=(0,s.kU)(1),E=(0,s.KJ)(1),A=.5*Math.PI,P=o.$O.radius,j=P*Math.PI/180,O=180/(P*Math.PI)},60999:(e,t,i)=>{i.d(t,{DZ:()=>p,Ke:()=>f,Tj:()=>h,UT:()=>_,jJ:()=>u});var s=i(31635),n=i(65008),r=i(97768),o=i(74887),a=i(10107),l=i(40608);function u(e,t,i){return(0,o.Lx)(e.map((e,s)=>t.apply(i,[e,s])))}async function h(e,t,i){return(await(0,o.Lx)(e.map((e,s)=>t.apply(i,[e,s])))).map(e=>e.value)}function c(e){return{ok:!0,value:e}}function d(e){return{ok:!1,error:e}}async function f(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return c(await e)}catch(e){return d(e)}}async function p(e){try{return c(await e)}catch(e){return(0,o.QP)(e),d(e)}}function _(e,t){return new m(e,t)}let m=class extends n.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,r.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:i}=this._abortController;this.promise=e(i),this.promise.then(e=>{this._result=c(e),this._cleanup()},e=>{this._result=d(e),this._cleanup()}),this._abortHandle=(0,o.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,r.xt)(this._abortHandle),this._abortController=null}};(0,s.Cg)([(0,a.MZ)()],m.prototype,"value",null),(0,s.Cg)([(0,a.MZ)()],m.prototype,"error",null),(0,s.Cg)([(0,a.MZ)()],m.prototype,"finished",null),(0,s.Cg)([(0,a.MZ)()],m.prototype,"promise",void 0),(0,s.Cg)([(0,a.MZ)()],m.prototype,"_result",void 0),m=(0,s.Cg)([(0,l.$)("esri.core.asyncUtils.ReactiveTask")],m)},62815:(e,t,i)=>{i.d(t,{N:()=>o});var s=i(83047),n=i(73941),r=i(21325);function o(e,t,i){if(null==t||null==i||i.vcsWkid||(0,r.aI)(t,i)||(0,n.xP)(t)||(0,n.xP)(i))return null;const o=(0,s.G9)(t)/(0,s.G9)(i);if(1===o)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,o);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const i of e.paths)for(const e of i)e.length>2&&(e[2]*=t)}(e,o);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const i of e.rings)for(const e of i)e.length>2&&(e[2]*=t)}(e,o);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}(e,o);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,o);default:return null}}},66344:(e,t,i)=>{i.d(t,{q:()=>a});const s=!!(0,i(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class n{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._users=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._users.clear(),this._db=null}register(e){this._users.set(e.id.slice(0,-1),e)}deregister(e){this.clear(e),this._sizeLimits.delete(e),this._users.delete(e.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const i=this._db.get(e.id+t);return i?.size??0}put(e,t,i,n,o){t=e.id+t;const a=this._db.get(t);if(a&&(this._size-=a.size,e.size-=a.size,this._db.delete(t),a.entry!==i&&this._notifyRemove(t,a.entry,a.size,0)),n>this._maxSize)return void this._notifyRemove(t,i,n,0);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return s||console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,i,0,0);const l=1+Math.max(o,-4)- -3;this._db.set(t,new r(i,n,l)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t){t=e.id+t;const i=this._db.get(t);if(!i)return;this._size-=i.size,e.size-=i.size;let s=i.entry.usedMemory;for(;s>this._maxSize;){const e=this._notifyRemove(t,i.entry,s,1);if(!(null!=e&&e>0))return void this._db.delete(t);s=e}i.size=s,this._size+=s,e.size+=s,this._checkSize()}pop(e,t){t=e.id+t;const i=this._db.get(t);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(e,t){t=e.id+t;const i=this._db.get(t);if(void 0!==i)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}peek(e,t){const i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},i=new Array;this._db.forEach((e,s)=>{const n=e.lifetime;i[n]=(i[n]||0)+e.size,this._users.forEach(i=>{const{id:n,name:r}=i;if(s.startsWith(n)){const i=t[r]||0;t[r]=i+e.size}})});const s={};this._users.forEach(e=>{const i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[i]||0;t[i]=n,s[i]=Math.round(100*e.hitRate)+"%"}else s[i]="0%"});const n=Object.keys(t);n.sort((e,i)=>t[i]-t[e]),n.forEach(i=>e[i]=Math.round(t[i]/2**20)+"MB / "+s[i]);for(let t=i.length-1;t>=0;--t){const s=i[t];s&&(e["Priority "+(t+-3-1)]=Math.round(s/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forEach(e=>e.resetHitRate())}clear(e){const t=e.id;this._db.forEach((e,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,e.size,0))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,0)),this._users.forEach(e=>e.size=0),this._size=0,this._db.clear()}*values(e){for(const[t,i]of this._db)t.startsWith(e.id)&&(yield i.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i,s){const n=this._users.get(e.split(o)[0])?.removeFunc,r=n?.(t,s,i);return"number"==typeof r?r:null}_checkSize(){this._sizeLimits.forEach((e,t)=>this._checkSizeLimits(e,t)),this._checkSizeLimits(this.maxSize)}setMaxSize(e,t){null==t||t<=0?this._sizeLimits.delete(e):this._sizeLimits.set(e,t)}_checkSizeLimits(e,t){const i=t??this;if(i.size<=e)return;const s=t?.id;let n=!0;for(;n;){n=!1;for(const[r,a]of this._db)if(0===a.lifetime&&(!s||r.startsWith(s))){const s=t??this._users.get(r.split(o)[0]);if(this._purgeItem(r,a,s),i.size<=.9*e)return;n||=this._db.has(r)}}for(const[n,r]of this._db)if(!s||n.startsWith(s)){const s=t??this._users.get(n.split(o)[0]);if(this._purgeItem(n,r,s),i.size<=.9*e)return}}_purgeItem(e,t,i){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);const s=this._notifyRemove(e,t.entry,t.size,1);null!=s&&s>0&&(this._size+=s,i&&(i.size+=s),t.lives=t.lifetime,t.size=s,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}new n(0);class r{constructor(e,t,i){this.entry=e,this.size=t,this.lifetime=i,this.lives=i}}const o=":";class a{constructor(e,t){this.removeFunc=t,this._storage=new n,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy(),this._storage=null}put(e,t,i=1){this._storage.put(this,e,t,i,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},69540:(e,t,i)=>{i.d(t,{OU:()=>h,Pw:()=>c});var s=i(31635),n=i(65008),r=(i(44208),i(4718)),o=(i(53966),i(97768)),a=i(88620),l=i(40608);const u=Symbol("ClonableMixin"),h=e=>{var t;const i=e;let n=class extends i{constructor(){super(...arguments),this[t]=!0}static{t=u}clone(e){const t=(0,a.oY)(this);(0,o.Lw)(t,"unable to clone instance of non-accessor class");const i=t.metadata,s=t.store,n={},l=new Map;for(const t in i){const o=i[t],a=s?.originOf(t),u=o.clonable;if(o.readOnly||!1===u||7!==a&&0!==a&&5!==a&&4!==a)continue;const h=this[t];let c=null;if("function"==typeof u)c=u(h,e);else if("reference"===u)c=h;else if(c=(0,r.TU)(h,e),null!=h&&null==c)continue;0===a?l.set(t,c):n[t]=c}const u=new(0,Object.getPrototypeOf(this).constructor)(n);if(l.size){const e=(0,a.oY)(u)?.store;if(e)for(const[t,i]of l)e.set(t,i,0)}return u}};return n=(0,s.Cg)([(0,l.$)("esri.core.Clonable")],n),n},c=h(n.A)},75503:(e,t,i)=>{i.d(t,{EC:()=>S,wq:()=>a});var s=i(4576),n=i(21818),r=(i(44208),i(15142)),o=i(11006);class a{constructor(e=9,t){this._compareMinX=d,this._compareMinY=f,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),I.prune(),M.prune(),b.prune()}all(e){l(this._data,e)}search(e,t){let i=this._data;const s=this._toBBox;if(v(e,i))for(x.clear();i;){for(let n=0,r=i.children.length;n<r;n++){const r=i.children[n],o=i.leaf?s(r):r;v(e,o)&&(i.leaf?t(r):y(e,o)?l(r,t):x.push(r))}i=x.pop()}}collides(e){let t=this._data;const i=this._toBBox;if(!v(e,t))return!1;for(x.clear();t;){for(let s=0,n=t.children.length;s<n;s++){const n=t.children[s],r=t.leaf?i(n):n;if(v(e,r)){if(t.leaf||y(e,r))return!0;x.push(n)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new F([]),this}remove(e){if(!e)return this;let t,i=this._data,r=null,o=0,a=!1;const l=this._toBBox(e);for(M.clear(),b.clear();i||M.length>0;){if(i||(i=M.pop(),r=M.data[M.length-1],o=b.pop()??0,a=!0),i.leaf&&(t=(0,s.qh)(i.children,(0,n.zI)(e),i.children.length,i.indexHint),-1!==t))return i.children.splice(t,1),M.push(i),this._condense(M),this;a||i.leaf||!y(i,l)?r?(o++,i=r.children[o],a=!1):i=null:(M.push(i),b.push(o),o=0,r=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,i,s){const n=i-t+1;let r=this._maxEntries;if(n<=r){const s=new F(e.slice(t,i+1));return u(s,this._toBBox),s}s||(s=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(s-1)));const o=new T([]);o.height=s;const a=Math.ceil(n/r),l=a*Math.ceil(Math.sqrt(r));w(e,t,i,l,this._compareMinX);for(let n=t;n<=i;n+=l){const t=Math.min(n+l-1,i);w(e,n,t,a,this._compareMinY);for(let i=n;i<=t;i+=a){const n=Math.min(i+a-1,t);o.children.push(this._build(e,i,n,s-1))}}return u(o,this._toBBox),o}_insert(e,t,i){const s=this._toBBox,n=i?e:s(e);M.clear();const r=function(e,t,i,s){for(;s.push(t),!0!==t.leaf&&s.length-1!==i;){let i,s=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=p(o),l=m(e,o)-a;l<n?(n=l,s=a<s?a:s,i=o):l===n&&a<s&&(s=a,i=o)}t=i||t.children[0]}return t}(n,this._data,t,M);for(r.children.push(e),c(r,n);t>=0&&M.data[t].children.length>this._maxEntries;)this._split(M,t),t--;!function(e,t,i){for(let s=i;s>=0;s--)c(t.data[s],e)}(n,M,t)}_split(e,t){const i=e.data[t],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);const r=this._chooseSplitIndex(i,n,s);if(!r)return;const o=i.children.splice(r,i.children.length-r),a=i.leaf?new F(o):new T(o);a.height=i.height,u(i,this._toBBox),u(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this._data=new T([e,t]),this._data.height=e.height+1,u(this._data,this._toBBox)}_chooseSplitIndex(e,t,i){let s,n,r;s=n=1/0;for(let o=t;o<=i-t;o++){const t=h(e,0,o,this._toBBox),a=h(e,o,i,this._toBBox),l=g(t,a),u=p(t)+p(a);l<s?(s=l,r=o,n=u<n?u:n):l===s&&u<n&&(n=u,r=o)}return r}_chooseSplitAxis(e,t,i){const s=e.leaf?this._compareMinX:d,n=e.leaf?this._compareMinY:f;this._allDistMargin(e,t,i,s)<this._allDistMargin(e,t,i,n)&&e.children.sort(s)}_allDistMargin(e,t,i,s){e.children.sort(s);const n=this._toBBox,r=h(e,0,t,n),o=h(e,i-t,i,n);let a=_(r)+_(o);for(let s=t;s<i-t;s++){const t=e.children[s];c(r,e.leaf?n(t):t),a+=_(r)}for(let s=i-t-1;s>=t;s--){const t=e.children[s];c(o,e.leaf?n(t):t),a+=_(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const i=e.data[t];if(0===i.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,s.qh)(r,i,r.length,n.indexHint),1)}else this.clear();else u(i,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let i=e;for(I.clear();i;){if(!0===i.leaf)for(const e of i.children)t((0,n.zI)(e));else I.pushArray(i.children);i=I.pop()??null}}function u(e,t){h(e,0,e.children.length,t,e)}function h(e,t,i,s,n){n||(n=new F([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<i;o++)r=e.children[o],c(n,e.leaf?s(r):r);return n}function c(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function d(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function p(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function _(e){return e.maxX-e.minX+(e.maxY-e.minY)}function m(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){const i=Math.max(e.minX,t.minX),s=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,r-s)}function y(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function v(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function w(e,t,i,s,n){const r=[t,i];for(;r.length;){const t=r.pop(),i=r.pop();if(t-i<=s)continue;const a=i+Math.ceil((t-i)/s/2)*s;(0,o.q)(e,a,i,t,n),r.push(i,a,a,t)}}const x=new r.A,I=new r.A,M=new r.A,b=new r.A({deallocator:void 0});class S{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class C extends S{constructor(){super(...arguments),this.height=1,this.indexHint=new s.vW}}class F extends C{constructor(e){super(),this.children=e,this.leaf=!0}}class T extends C{constructor(e){super(),this.children=e,this.leaf=!1}}},79677:(e,t,i)=>{i.d(t,{A:()=>d});var s,n=i(31635),r=i(25482),o=i(88930),a=i(10107),l=(i(44208),i(53966),i(87811),i(36005)),u=i(40608),h=i(43937),c=i(98623);let d=class extends r.o{static{s=this}static get allTime(){return f}static get empty(){return p}static fromArray(e){return new s({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(s.allTime)}get isEmpty(){return this.equals(s.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new s({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,i=this.end?.getTime()??this.end,s=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===s&&i===n}expandTo(e,t=c.qU){if(this.isEmpty||this.isAllTime)return this.clone();let i=this.start;i&&(i=(0,o.lL)(i,e,t));let n=this.end;if(n){const i=(0,o.lL)(n,e,t);n=n.getTime()===i.getTime()?i:(0,o.S1)(i,1,e,t)}return new s({start:i,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return s.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,i=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let o,a;return n>=t&&n<=i?o=n:t>=n&&t<=r&&(o=t),i>=n&&i<=r?a=i:r>=t&&r<=i&&(a=r),null==o||null==a||isNaN(o)||isNaN(a)?s.empty:new s({start:o===-1/0?null:new Date(o),end:a===1/0?null:new Date(a)})}offset(e,t,i=c.qU){if(this.isEmpty||this.isAllTime)return this.clone();const n=new s,{start:r,end:a}=this;return null!=r&&(n.start=(0,o.S1)(r,e,t,i)),null!=a&&(n.end=(0,o.S1)(a,e,t,i)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return f.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new s({start:t,end:i})}};(0,n.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,n.Cg)([(0,l.w)("end")],d.prototype,"readEnd",null),(0,n.Cg)([(0,h.K)("end")],d.prototype,"writeEnd",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,n.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,n.Cg)([(0,l.w)("start")],d.prototype,"readStart",null),(0,n.Cg)([(0,h.K)("start")],d.prototype,"writeStart",null),d=s=(0,n.Cg)([(0,u.$)("esri.time.TimeExtent")],d);const f=new d,p=new d({start:void 0,end:void 0})},83221:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(4576),n=i(49186),r=i(65529),o=i(53966),a=i(70328),l=i(19419),u=i(90708),h=i(6518),c=i(51441),d=i(37730);const f=(0,a.vt)();class p{constructor(e){this.geometryInfo=e,this._boundsStore=new h.F,this._featuresById=new Map,this._usedMemory=0,this.events=new r.bk,this.featureAdapter=d.T}get usedMemory(){return this._usedMemory}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,i,s,n]=this.fullBounds;return{xmin:t,ymin:i,xmax:s,ymax:n,spatialReference:(0,c.ag)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map(e=>this._upsert(e));return this._emitChanged(),t.filter(s.Ru)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged(),this._usedMemory=0}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const i of e){const e=this._boundsStore.get(i.objectId);e&&t((0,a.Jt)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,e=>{t(this._featuresById.get(e))})}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.A("featurestore:invalid-feature","feature id is missing",{feature:e}));const i=this._featuresById.get(t);let s;if(i?(e.displayId=i.displayId,s=this._boundsStore.get(t),this._boundsStore.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);s=(0,u.jQ)(null!=s?s:(0,l.vt)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=s&&this._boundsStore.set(t,s),this._featuresById.set(t,e),this._usedMemory+=this.estimateFeatureUsedMemory?.(e)??0}_upsert(e){const t=e?.objectId;if(null==t)return o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.A("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const i=this._featuresById.get(t);if(!i)return this._add(e),e;this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0;const{geometry:s,attributes:r}=e;for(const e in r)i.attributes[e]=r[e];return s&&(i.geometry=s,this._boundsStore.set(t,(0,u.jQ)((0,l.vt)(),s,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),this._usedMemory+=this.estimateFeatureUsedMemory?.(i)??0,i}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._boundsStore.delete(t),this._featuresById.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(e)??0,e}}},88625:(e,t,i)=>{i.d(t,{A:()=>v});var s,n=i(31635),r=i(69540),o=i(66552),a=i(25482),l=i(97768),u=i(10107),h=(i(44208),i(53966),i(87811),i(36005)),c=i(40608),d=i(43937),f=i(30524);let p=s=class extends a.o{constructor(e){super(e),this.expression=void 0,this.title=void 0}async collectRequiredFields(e,t){return(0,f.Dx)(e,t,this.expression)}clone(){return new s({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,n.Cg)([(0,u.MZ)({type:String,json:{write:{isRequired:!0}}})],p.prototype,"expression",void 0),(0,n.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],p.prototype,"title",void 0),p=s=(0,n.Cg)([(0,c.$)("esri.symbols.support.FeatureExpressionInfo")],p);const _=p;var m=i(16271);const g=(0,o.O)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),y=new o.J({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let v=class extends((0,r.OU)(a.o)){constructor(e){super(e),this.featureExpressionInfo=void 0,this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e.expression?e:void 0:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,i,s){t[i]=e.write({},s),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,l.CM)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,n.Cg)([(0,u.MZ)({type:_,json:{write:!0}})],v.prototype,"featureExpressionInfo",void 0),(0,n.Cg)([(0,h.w)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],v.prototype,"readFeatureExpressionInfo",null),(0,n.Cg)([(0,d.K)("featureExpressionInfo",{featureExpressionInfo:{type:_},"featureExpression.value":{type:[0]}})],v.prototype,"writeFeatureExpressionInfo",null),(0,n.Cg)([(0,u.MZ)({type:g.apiValues,nonNullable:!0,json:{type:g.jsonValues,read:g.read,write:{writer:g.write,isRequired:!0}}})],v.prototype,"mode",null),(0,n.Cg)([(0,u.MZ)({type:Number,json:{write:!0}})],v.prototype,"offset",void 0),(0,n.Cg)([(0,u.MZ)({type:m.KQ,json:{type:String,read:y.read,write:y.write}})],v.prototype,"unit",null),v=(0,n.Cg)([(0,c.$)("esri.symbols.support.ElevationInfo")],v)},98453:(e,t,i)=>{i.d(t,{m:()=>s});const s=new(i(66552).J)({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"})},98988:(e,t,i)=>{i.r(t),i.d(t,{canProjectWithoutEngine:()=>G,getTransformation:()=>L,getTransformations:()=>H,initializeProjection:()=>J,isEqualBaseGCS:()=>D,isLoaded:()=>B,isLoadedOrLoad:()=>E,isLoadedOrLoadFor:()=>A,load:()=>j,project:()=>O,projectExtent:()=>re,projectMany:()=>k,projectMultipoint:()=>W,projectOrLoad:()=>Z,projectOrLoadMany:()=>q,projectPoint:()=>Q,projectPolygon:()=>se,projectPolyline:()=>te,projectWithZConversion:()=>$,projectWithoutEngine:()=>K,requiresLoad:()=>P,test:()=>N,tryProjectWithZConversion:()=>U,unload:()=>X});var s=i(49186),n=i(74887),r=i(62788),o=i(95488),a=i(51850),l=i(21276),u=i(73941),h=i(5443),c=i(48526),d=i(83290),f=i(86738),p=i(39829),_=i(82799),m=i(16930),g=i(9762),y=i(37539);function v(e,t,i,s,n,r){return w[0]=e,w[1]=t,w[2]=i,(0,g.projectBuffer)(w,s,0,n,r,0)}const w=(0,a.vt)();let x=0;class I{static fromGE(e){const t=new I;return t._wkt=e.wkt,t._wkid=e.wkid,t._isInverse=e.isInverse,t}constructor(e){this.uid=x++,e?(this._wkt=null!=e.wkt?e.wkt:null,this._wkid=null!=e.wkid?e.wkid:-1,this._isInverse=null!=e.isInverse&&!0===e.isInverse):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}get wkt(){return this._wkt}set wkt(e){this._wkt=e,this.uid=x++}get wkid(){return this._wkid}set wkid(e){this._wkid=e,this.uid=x++}get isInverse(){return this._isInverse}set isInverse(e){this._isInverse=e,this.uid=x++}getInverse(){const e=new I;return e._wkt=this.wkt,e._wkid=this._wkid,e._isInverse=!this.isInverse,e}}class M{static cacheKey(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}static fromGE(e){const t=new M;let i="";for(const s of e.steps){const e=I.fromGE(s);t.steps.push(e),i+=e.uid.toString()+","}return t._cachedProjection={},t._gtlistentry=null,t._chain=i,t}constructor(e){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,e?.steps)for(const t of e.steps)t instanceof I?this.steps.push(t):this.steps.push(new I({wkid:t.wkid,wkt:t.wkt,isInverse:t.isInverse}))}getInverse(){const e=new M;e.steps=[];for(let t=this.steps.length-1;t>=0;t--){const i=this.steps[t];e.steps.push(i.getInverse())}return e}getGTListEntry(){let e="";for(const t of this.steps)e+=t.uid.toString()+",";return e!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=e),this._gtlistentry}assignCachedGe(e,t,i){this._cachedProjection[M.cacheKey(e,t)]=i}getCachedGeTransformation(e,t){let i="";for(const e of this.steps)i+=e.uid.toString()+",";i!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=i);const s=this._cachedProjection[M.cacheKey(e,t)];return void 0===s?null:s}}var b=i(21325),S=i(62815);let C=null,F=null,T=null,z={};const R=new o.I;function B(){return!!C&&(0,d.i)()}function E(){return!!B()||((0,r.gc)(R),j(),!1)}function A(e,t){return!e||!t||G(e,t)||E()}function P(e,t){return!G(e,t)&&!B()}function j(e){return null==T&&(T=Promise.all([(0,d.l)(),i.e(9930).then(i.bind(i,49930)).then(e=>e.g),i.e(2731).then(i.bind(i,12731))])),T.then(([,t,{hydratedAdapter:i}])=>{(0,n.Te)(e),F=i,C=t.default,C._enableProjection(d.p),R.notify()})}function O(e,t,i=null,s=null){return Array.isArray(e)?0===e.length?[]:((0,l.H)(e),k(F,e,e[0].spatialReference,t,i,s)):((0,l.f)(e),k(F,[e],e.spatialReference,t,i,s)[0])}function k(e,t,i,s,n=null,r=null){if(null==i||null==s)return t;if(G(i,s,n))return t.map(e=>K(e,i,s));if(null==n&&(0,u.jA)(i))return t.map(e=>K(e,i,m.A.WGS84)).map(e=>U(e,s));if(null==n&&(0,u.jA)(s))return t.map(e=>U(e,m.A.WGS84)).map(e=>K(e,m.A.WGS84,s));if(null==n){const e=M.cacheKey(i,s);void 0!==z[e]?n=z[e]:(null==(n=L(i,s,void 0))&&(n=new M),z[e]=n)}if(null==C||null==e)throw new Y;return null!=r?C._project(e,t,i,s,n,r):C._project(e,t,i,s,n)}function Z(e,t){const i=q([e],t);return null!=i.pending?{pending:i.pending,geometry:null}:null!=i.geometries?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function q(e,t){if(!B())for(const i of e)if(null!=i&&!(0,b.aI)(i.spatialReference,t)&&(0,b.fn)(i.spatialReference)&&(0,b.fn)(t)&&!G(i.spatialReference,t))return(0,r.gc)(R),{pending:j(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,b.aI)(e.spatialReference,t)?e:(0,b.fn)(e.spatialReference)&&(0,b.fn)(t)?U(e,t):null)}}function L(e,t,i=null){if(null==e||null==t)return null;if(null==C||null==F)throw new Y;const s=C._getTransformation(F,e,t,i,i?.spatialReference);return null!==s?M.fromGE(s):null}function H(e,t,i=null){if(null==C||null==F)throw new Y;const s=C._getTransformationBySuitability(F,e,t,i,i?.spatialReference);if(null!==s){const e=[];for(const t of s)e.push(M.fromGE(t));return e}return[]}class Y extends s.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function X(){C=null,F=null,T=null,z={}}const N={get loadPromise(){return T}};function U(e,t){try{const i=O(e,t);if(null==i)return null;"xmin"in e&&"xmin"in i&&(i.zmin=e.zmin,i.zmax=e.zmax);const s=(0,S.N)(i.type,e.spatialReference,t);return null!=s&&s(i),i}catch(e){if(!(e instanceof Y))throw e;return null}}async function $(e,t,i){const s=e.spatialReference;return null!=s&&null!=t&&await J(s,t,null,i),U(e,t)}function G(e,t,i){return!i&&(!!(0,b.aI)(e,t)||(0,b.fn)(e)&&(0,b.fn)(t)&&!!(0,y.jd)(e,t))}function D(e,t){if((0,b.aI)(e,t))return!0;if(!(0,b.fn)(e)||!(0,b.fn)(t))return!1;const i=(0,b.oT)(e)||(0,b.K8)(e)||(0,b.x1)(e),s=(0,b.oT)(t)||(0,b.K8)(t)||(0,b.x1)(t);return i&&s}async function J(e,t,i,s){if(B())return(0,n.NO)(s);if(Array.isArray(e)){for(const{source:t,dest:i,geographicTransformation:n}of e)if(t&&i&&!G(t,i,n))return j(s)}else if(e&&t&&!G(e,t,i))return j(s);return(0,n.NO)(s)}function K(e,t,i){return e?"x"in e?V(e,t,new f.A,i,0):"xmin"in e?oe(e,t,new h.A,i,0):"rings"in e?ne(e,t,new p.A,i,0):"paths"in e?ie(e,t,new _.A,i,0):"points"in e?ee(e,t,new c.A,i,0):null:null}function Q(e,t,i=t.spatialReference,s=0){return null!=i&&null!=e.spatialReference&&null!=V(e,e.spatialReference,t,i,s)}function V(e,t,i,s,n){le[0]=e.x,le[1]=e.y;const r=e.z;return le[2]=void 0!==r?r:n,(0,g.projectBuffer)(le,t,0,le,s,0)?(i.x=le[0],i.y=le[1],i.spatialReference=s,void 0!==r||(0,u.xP)(s)?(i.z=le[2],i.hasZ=!0):(i.z=void 0,i.hasZ=!1),void 0===e.m?(i.m=void 0,i.hasM=!1):(i.m=e.m,i.hasM=!0),i):null}function W(e,t,i=t.spatialReference,s=0){return null!=e.spatialReference&&null!=i&&null!=ee(e,e.spatialReference,t,i,s)}function ee(e,t,i,s,n){const{points:r,hasZ:o,hasM:a}=e,l=[],h=r.length,c=[];for(const e of r)c.push(e[0],e[1],o?e[2]:n);if(!(0,g.projectBuffer)(c,t,0,c,s,0,h))return null;const d=o||(0,u.xP)(s);for(let e=0;e<h;++e){const t=3*e,i=c[t],s=c[t+1];d&&a?l.push([i,s,c[t+2],r[e][3]]):d?l.push([i,s,c[t+2]]):a?l.push([i,s,r[e][2]]):l.push([i,s])}return i.points=l,i.spatialReference=s,i.hasZ=o,i.hasM=a,i}function te(e,t,i=t.spatialReference,s=0){return null!=e.spatialReference&&null!=i&&null!=ie(e,e.spatialReference,t,i,s)}function ie(e,t,i,s,n){const{paths:r,hasZ:o,hasM:a}=e,l=[];if(!ae(r,o??!1,a??!1,t,l,s,n))return null;const h=o||(0,u.xP)(s);return i.paths=l,i.spatialReference=s,i.hasZ=h,i.hasM=a,i}function se(e,t,i=t.spatialReference,s=0){return null!=e.spatialReference&&null!=i&&null!=ne(e,e.spatialReference,t,i,s)}function ne(e,t,i,s,n){const{rings:r,hasZ:o,hasM:a}=e,l=[];if(!ae(r,o??!1,a??!1,t,l,s,n))return null;const h=o||(0,u.xP)(s);return i.rings=l,i.spatialReference=s,i.hasZ=h,i.hasM=a,i}function re(e,t,i=t.spatialReference,s=0){return null!=e.spatialReference&&null!=i&&null!=oe(e,e.spatialReference,t,i,s)}function oe(e,t,i,s,n){const{xmin:r,ymin:o,xmax:a,ymax:l,hasZ:h,hasM:c}=e;if(!v(r,o,h?e.zmin:n,t,le,s))return null;const d=h||(0,u.xP)(s);return i.xmin=le[0],i.ymin=le[1],d&&(i.zmin=le[2]),v(a,l,h?e.zmax:n,t,le,s)?(i.xmax=le[0],i.ymax=le[1],d&&(i.zmax=le[2]),c&&(i.mmin=e.mmin,i.mmax=e.mmax),i.spatialReference=s,i):null}function ae(e,t,i,s,n,r,o=0){const a=new Array;for(const i of e)for(const e of i)a.push(e[0],e[1],t?e[2]:o);if(!(0,g.projectBuffer)(a,s,0,a,r,0))return!1;let l=0;n.length=0;const h=t||(0,u.xP)(r);for(const t of e){const e=new Array;for(const s of t)h&&i?e.push([a[l++],a[l++],a[l++],s[3]]):h?e.push([a[l++],a[l++],a[l++]]):i?(e.push([a[l++],a[l++],s[2]]),l++):(e.push([a[l++],a[l++]]),l++);n.push(e)}return!0}const le=(0,a.vt)()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1303],{2272:(e,t,i)=>{i.d(t,{Dl:()=>u,gf:()=>c,jV:()=>l,lF:()=>h});var s=i(92602),n=i(70333),r=i(4718),o=i(84952),a=i(926);function l(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function u(e){return"string"==typeof e?(0,o.An)(e):(0,r.o8)(e)}function h(e,t,i){const s={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))s[n]=r.map(e=>h(e));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(i?.[n]);s[n]=t?e:JSON.stringify(e)}else s[n]=t?r:JSON.stringify(r);else s[n]=r}return s}async function c(e,t,r){const o=function(e,t){return e?t&&(0,a.Qc)(e)?t:(0,a.CG)(e)??n.id?.findCredential(e)?.token:null}(e,t);if(o)return o;!n.id&&s.A.request.useIdentity&&await Promise.all([i.e(7330),i.e(168),i.e(3747)]).then(i.bind(i,73747));const l=await n.id.getCredential(e,r);return l?.token}},6518:(e,t,i)=>{i.d(t,{F:()=>a});var s=i(44208),n=i(75503),r=i(19419);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.wq(9,(0,s.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((i,s)=>{e[t++]=s}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.Ie)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,i){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,i)}(this._index,e,e=>t(this._idByBounds.get(e)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},9762:(e,t,i)=>{i.r(t),i.d(t,{projectBuffer:()=>n});var s=i(37539);function n(e,t,i,n,r,o,a=Math.floor(e.length/3)){const l=(0,s.jd)(t,r);if(null==l)return!1;if(l===s.pO){if(e===n&&i===o)return!0;const t=i+3*a;for(let s=i,r=o;s<t;s++,r++)n[r]=e[s];return!0}const u=i+3*a;for(let t=i,s=o;t<u;t+=3,s+=3)l(e,t,n,s);return!0}},12543:(e,t,i)=>{i.r(t),i.d(t,{default:()=>me});var s=i(31635),n=i(65529),r=i(74887),o=i(36708),a=i(10107),l=(i(44208),i(53966)),u=(i(87811),i(40608)),h=i(79897),c=i(16930),d=i(65864),f=i(83221),p=i(56390),_=i(87045),m=i(61956),g=i(88625),y=i(66344),v=i(91869),w=i(83047),x=i(16271);function I(e=!1,t){if(e){const{elevationInfo:e,alignPointsInFeatures:i}=t;return new b(e,i)}return new M}class M{async alignCandidates(e,t,i){return e}notifyElevationSourceChange(){}}class b{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new y.q(1024),this._cacheVersion=0}async alignCandidates(e,t,i){const s=this._elevationInfo;return null==s||"absolute-height"!==s.mode||s.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,i):(function(e,t,i){const{offset:s,unit:n}=i;if(null==s)return;const r=(0,w.G9)(t),o=s*((0,x.Ao)(n??"meters")/r);for(const t of e)switch(t.type){case"edge":t.start.z+=o,t.end.z+=o;continue;case"vertex":t.target.z+=o;continue}}(e,t,s),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}async _alignComputedElevationCandidates(e,t,i){const s=new Map;for(const t of e)(0,v.tE)(s,t.objectId,F).push(t);const[n,o,a]=this._prepareQuery(s,t),l=await this._alignPointsInFeatures(n,i);if((0,r.Te)(i),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,i);this._applyCacheAndResponse(n,l,o);const{drapedObjectIds:u,failedObjectIds:h}=l,c=[];for(const t of e){const{objectId:e}=t;u.has(e)&&"edge"===t.type&&(t.draped=!0),h.has(e)||c.push(t)}return c}_prepareQuery(e,t){const i=[],s=[];for(const[t,n]of e){const e=[];for(const i of n)this._addToQueriesOrCachedResult(t,i.target,e,s),"edge"===i.type&&(this._addToQueriesOrCachedResult(t,i.start,e,s),this._addToQueriesOrCachedResult(t,i.end,e,s));0!==e.length&&i.push({objectId:t,points:e})}return[{spatialReference:t.toJSON(),pointsInFeatures:i},s,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,i,s){const n=C(e,t),r=this._alignmentsCache.get(n);null==r?i.push(t):s.push(new S(t,r))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:i,failedObjectIds:s},n){for(const e of n)e.apply();let r=0;const o=this._alignmentsCache;for(const{objectId:n,points:a}of e.pointsInFeatures){if(s.has(n)){r+=a.length;continue}const e=!i.has(n);for(const i of a){const s=C(n,i),a=t[r++];i.z=a,e&&o.put(s,a,1)}}}}class S{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function C(e,{x:t,y:i,z:s,spatialReference:n}){return`${e}-${t}-${i}-${s??0}}-wkid:${n?.wkid}`}function F(){return[]}class T{filter(e,t){return t}notifyElevationSourceChange(){}}class z{filter(e,t){const{point:i,distance:s}=e,{z:n}=i;if(null==n)return t;if(0===t.length)return t;const r=function(e){return"number"==typeof e?{x:e,y:e,z:e}:e}(s),o=this._updateCandidatesTo3D(t,i,r).filter(R);return o.sort(P),o}_updateCandidatesTo3D(e,t,i){for(const s of e)switch(s.type){case"edge":E(s,t,i);continue;case"vertex":A(s,t,i);continue}return e}}function R(e){return e.distance<=1}function B(e=!1){return e?new z:new T}function E(e,t,{x:i,y:s,z:n}){const{start:r,end:o,target:a}=e;e.draped||function(e,t,i,s){const n=s.x-i.x,r=s.y-i.y,o=s.z-i.z,a=n*n+r*r+o*o,l=(t.x-i.x)*n+(t.y-i.y)*r+o*(t.z-i.z),u=Math.min(1,Math.max(0,l/a)),h=i.x+n*u,c=i.y+r*u,d=i.z+o*u;e.x=h,e.y=c,e.z=d}(a,t,r,o);const l=(t.x-a.x)/i,u=(t.y-a.y)/s,h=(t.z-a.z)/n;e.distance=Math.sqrt(l*l+u*u+h*h)}function A(e,t,{x:i,y:s,z:n}){const{target:r}=e,o=(t.x-r.x)/i,a=(t.y-r.y)/s,l=(t.z-r.z)/n,u=Math.sqrt(o*o+a*a+l*l);e.distance=u}function P(e,t){return e.distance-t.distance}var j=i(4718),O=i(799);function k(e=!1,t){return e?new q(t):new Z}class Z{async fetch(){return[]}notifySymbologyChange(){}}class q{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new y.q(1024),this._cacheVersion=0}async fetch(e,t){if(0===e.length)return[];const i=[],s=[],n=this._candidatesCache;for(const t of e){const e=L(t),r=n.get(e);if(r)for(const e of r)s.push((0,j.o8)(e));else i.push(t),n.put(e,[],1)}if(0===i.length)return s;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(i,t);if((0,r.Te)(t),o!==this._cacheVersion)return this.fetch(e,t);const u=[],{length:h}=a;for(let e=0;e<h;++e){const t=a[e],s=L(i[l[e]]),r=n.get(s);r.push(t),n.put(s,r,r.length),u.push((0,j.o8)(t))}return s.concat(u)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function L(e){switch(e.type){case"vertex":{const{objectId:t,target:i}=e,s=`${t}-vertex-${i.x}-${i.y}-${i.z??0}`;return(0,O.Wm)(s).toString()}case"edge":{const{objectId:t,start:i,end:s}=e,n=`${t}-edge-${i.x}-${i.y}-${i.z??0}-to-${s.x}-${s.y}-${s.z??0}`;return(0,O.Wm)(n).toString()}default:return""}}var H=i(65008),Y=i(4576),X=i(60999),N=i(3483),U=i(13069),$=i(5443),G=i(19419),D=i(90708),J=i(60694),K=i(69418),Q=i(80893);class V{constructor(e,t){this.data=e,this.resolution=t,this.state={type:0},this.alive=!0}process(e){switch(this.state.type){case 0:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case 1:case 3:break;case 2:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case 4:this.state=this._goToDone(this.state,e)}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case 0:case 1:return 0;case 2:return this.state.featureCount;case 3:return this.state.previous.featureCount;case 4:return this.state.features.length;case 5:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case 0:return"created";case 1:return"fetch-count";case 2:return"fetched-count";case 3:return"fetch-features";case 4:return"fetched-features";case 5:return"done"}}_gotoFetchCount(e,t){return{type:1,previous:e,task:(0,X.UT)(async e=>{const i=await(0,X.DZ)(t.fetchCount(this,e));1===this.state.type&&(this.state=function(e,t){return{type:2,featureCount:t,previous:e}}(this.state,i.ok?i.value:1/0))})}}_gotoFetchFeatures(e,t){return{type:3,previous:e,task:(0,X.UT)(async i=>{const s=await(0,X.DZ)(t.fetchFeatures(this,e.featureCount,i));3===this.state.type&&(this.state=function(e,t){return{type:4,previous:e,features:t}}(this.state,s.ok?s.value:[]))})}}_goToDone(e,t){return t.finish(this,e.features),{type:5,previous:e}}reset(){const e=this.state;switch(this.state={type:0},e.type){case 0:case 2:case 4:case 5:break;case 1:case 3:e.task.abort()}}intersects(e){return null==e||!this.data.extent||((0,G.VY)(e,W),(0,G.HY)(this.data.extent,W))}}const W=(0,G.vt)();let ee=class extends H.A{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),i=(0,N.KC)(e,this._mandatoryOutFields);(0,N.aI)(i,t)||(this._set("outFields",i),(0,N.Yy)(i,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new h.U}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,()=>{this._updatePriorities(),this._process()},{sync:!0,initial:!0,equals:(e,t)=>(0,Y.aI)(e,t,({id:e},{id:t})=>e===t)}),this.addHandles((0,o.z7)(()=>!this.suspended,()=>this._process()))}_updatePriorities(){this.store.setPriorityOrderByKey(this.tilesOfInterest.map(e=>e.id??"")??[])}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const e of this._pendingTiles.values())e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t))},i=(0,X.UT)(async e=>{try{await this.store.processEdits(t,(e,t)=>this._queryFeaturesById(e,t),e),this._processPendingTiles()}catch(e){(0,r.QP)(e),l.A.getLogger(this).warn("Failed to apply edits",e)}});this.addHandles(i),await this._updatingHandles.addPromise(i.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,J.Wo)(this.url))return;const e=(0,X.UT)(async e=>{try{const t=await(0,Q.Jf)(this.url,new m.A({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=$.A.fromJSON(t.data?.extent)}catch(e){(0,r.QP)(e),l.A.getLogger(this).warn("Failed to fetch data extent",e)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:i}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(const t of this.tilesOfInterest){const i=this.store.process(t,(e,t)=>this._verifyTileComplexity(e,t),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<se}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const i=this.tileSize*t;return e*(ne/(i*i))<re}_ensureFetchAllCounts(e){let t=!0;for(const i of this._pendingTiles.values())i.state.type<2&&this._updatingHandles.addPromise(i.process(e)),i.state.type<=1&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new V(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:ie,signal:t})}async _fetchFeatures(e,t,i){let s=0;const n=[];let r=0,o=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,s,o),{features:u,exceededTransferLimit:h}=await this._queryFeatures(a,i);l&&(s+=a.num),r+=u.length;for(const e of u)n.push(e);if(o=t-r,!l||!h||o<=0)return n}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let s=null;const n=e?(0,U.AG)(e):e;if(this.store.featureStore.forEach(e=>{n===(0,U.AG)(e.attributes[t])&&(s=e.objectId??e.attributes[i])}),null==s)throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await(0,Q.IJ)(this.url,e,new K.S({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,D.eY)(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await(0,Q.eW)(this.url,e,i,{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,D.q3)(s,{type:"object-id",fieldName:this.objectIdField})}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),i=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,s=(0,N.KC)((0,N.iv)(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(s),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new m.A({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:null!=this.tileInfo&&null!=e?(0,G.w1)(e.data.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:n,tileMaxRecordCount:r,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=s?m.A.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||n)&&r?r:o||te);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"url",void 0),(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"objectIdField",void 0),(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"globalIdField",void 0),(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"capabilities",void 0),(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"sourceSpatialReference",void 0),(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"spatialReference",void 0),(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ee.prototype,"store",void 0),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],ee.prototype,"_minimumVerticesPerFeature",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"_mandatoryOutFields",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"outFields",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"suspended",void 0),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"_historicMoment",void 0),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"filter",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"customParameters",null),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],ee.prototype,"_configuration",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"tileInfo",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"tileSize",null),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"tilesOfInterest",void 0),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],ee.prototype,"updating",null),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],ee.prototype,"availability",void 0),(0,s.Cg)([(0,a.MZ)()],ee.prototype,"hasZ",null),ee=(0,s.Cg)([(0,u.$)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],ee);const te=2e3,ie=6e5,se=1e6,ne=25,re=1;var oe=i(6518),ae=i(72802);class le{constructor(){this._store=new Map,this._priorities=new Map}get size(){return this._store.size}setPriorityOrderByKey(e){this._priorities.clear();for(let t=e.length-1;t>=0;t--)this._priorities.set(e[t],e.length-t)}hasLowerPriority(e){const t=this._priorities.get(e);if(null==t)return!0;for(const[e]of this._store){const i=this._priorities.get(e);if(null==i||i<t)return!0}return!1}someFromLowestToHighestPriority(e){const{_priorities:t}=this;for(const[i,s]of this._store)if(!t.has(i)&&e(s,i))return!0;for(const[i]of t){const t=this._store.get(i);if(t&&e(t,i))return!0}return!1}set(e,t){this._store.set(e,t)}delete(e){return this._store.delete(e)}get(e){return this._store.get(e)}has(e){return this._store.has(e)}clear(){this._store.clear()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}let ue=class extends H.A{setPriorityOrderByKey(e){this._tiles.setPriorityOrderByKey(e)}get _memoryLimitExceeded(){return this.featureStore.usedMemory>=this.maximumByteSize}constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10485760,this._tileBounds=new oe.F,this._tiles=new le,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,G.vt)()}add(e,t){for(const e of t)this._referenceFeature(e.objectId);const i=this.featureStore.upsertMany(t),s=i.map(e=>new Set(Object.keys(e.attributes))).reduce((e,t)=>(0,N.E$)(e,t),new Set(Object.keys(i[0]?.attributes??[]))),n=this._memoryLimitExceeded;this._addTileStorage(e,new Set(i.map(e=>e.objectId)),s),n&&this._applyCacheMemoryLimits()}_applyCacheMemoryLimits(){if(!this._memoryLimitExceeded)return;const{_tiles:e,featureStore:t,maximumByteSize:i}=this;e.someFromLowestToHighestPriority(e=>!this._memoryLimitExceeded||t.usedMemory-this._estimateRemoveTileMemoryReduction(e)<i||(this._removeTileStorage(e),!1))}_estimateRemoveTileMemoryReduction(e){let t=0;for(const i of e.objectIds)if(1===this._refCounts.get(i)){const e=this.featureStore.getFeature(i);e&&(t+=this.featureStore.estimateFeatureUsedMemory?.(e)??0)}return t}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,i){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,i)}_addTileStorage(e,t,i){const s=e.id;this._tiles.set(s,new he(e,t,i)),this._tileBounds.set(s,e.extent),this._tileFeatureCounts.set(s,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)1===this._unreferenceFeature(i)&&t.push(i);this.featureStore.removeManyById(t);const i=e.data.id;this._tiles.delete(i),this._tileBounds.delete(i)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const i of e)t.objectIds.delete(i);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,i){if(!e.length)return;const s=(await t(e,i)).features,{hasZ:n,hasM:r}=this.featureStore;for(const e of s){const t=(0,D.jQ)(this._tmpBoundingRect,e.geometry,n,r);null!=t&&this._tileBounds.forEachInBounds(t,t=>{const i=this._tiles.get(t);this.featureStore.add(e);const s=e.objectId;i.objectIds.has(s)||(i.objectIds.add(s),this._referenceFeature(s),this._tileFeatureCounts.set(i.data.id,i.objectIds.size))})}}process(e,t=()=>!0,i){if(null==this.tileInfo||!e.extent||null!=this.extent&&!(0,G.HY)((0,G.VY)(this.extent,this._tmpBoundingRect),e.extent))return new de(e);if(this._memoryLimitExceeded&&!this._tiles.hasLowerPriority(e.id??""))return new de(e);const s=this.getAttributesForTile(e.id);if((0,N.Yy)(i,s))return new de(e);const n=this._createTileTree(e,this.tileInfo);return this._simplify(n,t,null,0,1),this._collectMissingTiles(e,n,this.tileInfo,i)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,i,s){const n=this._tileFeatureCounts.get(e.id);if(null!=n)return n;const r=await(0,Q.gW)(t,i,s);return this._tileFeatureCounts.set(e.id,r.data.count),r.data.count}_createTileTree(e,t){const i=new ce(e.level,e.row,e.col);return t.updateTileInfo(i,1),this._tileBounds.forEachInBounds(e.extent,s=>{const n=this._tiles.get(s)?.data;n&&function(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const i=e.level<t.level,s=i?e:t,n=i?t:e,r=1<<n.level-s.level;return Math.floor(n.row/r)===s.row&&Math.floor(n.col/r)===s.col}(e,n)&&this._populateChildren(i,n,t,this._tileFeatureCounts.get(n.id)||0)}),i}_populateChildren(e,t,i,s){const n=t.level-e.level-1;if(n<0)return void(e.isLeaf=!0);const r=t.row>>n,o=t.col>>n,a=e.row<<1,l=o-(e.col<<1)+(r-a<<1),u=e.children[l];if(null!=u)this._populateChildren(u,t,i,s);else{const n=new ce(e.level+1,r,o);i.updateTileInfo(n,1),e.children[l]=n,this._populateChildren(n,t,i,s)}}_simplify(e,t,i,s,n){const r=n*n;if(e.isLeaf)return t(this.getFeatureCount(e),n)?0:(this._remove(e),null!=i&&(i.children[s]=null),r);const o=n/2,a=o*o;let l=0;for(let i=0;i<e.children.length;i++){const s=e.children[i];l+=null!=s?this._simplify(s,t,e,i,o):a}return 0===l?this._mergeChildren(e):1-l/r<pe&&(this._purge(e),null!=i&&(i.children[s]=null),l=r),l}_mergeChildren(e){const t=new Set;let i;this._forEachLeaf(e,e=>{const s=this._tiles.get(e.id);if(s){i=i?(0,N.E$)(i,s.attributeKeys):new Set(s.attributeKeys);for(const e of s.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}}),this._addTileStorage(e,t,i??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const i of e.children)null!=i&&(i.isLeaf?t(i):this._forEachLeaf(i,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const i=e.children[t];this._purge(i),e.children[t]=null}}_collectMissingTiles(e,t,i,s){const n=new fe(i,e,this.extent);return this._collectMissingTilesRecurse(t,n,1,s),n.info}_collectMissingTilesRecurse(e,t,i,s){const n=this.getAttributesForTile(e.id),r=n&&!(0,N.Yy)(s,n);if(r&&t.addMissing(e.level,e.row,e.col,i),e.isLeaf)return;if(!e.hasChildren)return void(r||t.addMissing(e.level,e.row,e.col,i));const o=i/2;for(let i=0;i<e.children.length;i++){const n=e.children[i];null==n?t.addMissing(e.level+1,(e.row<<1)+((2&i)>>1),(e.col<<1)+(1&i),o):this._collectMissingTilesRecurse(n,t,o,s)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?0:2}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),1):(t>0&&this._refCounts.set(e,t),2)}get test(){}};(0,s.Cg)([(0,a.MZ)({constructOnly:!0})],ue.prototype,"featureStore",void 0),(0,s.Cg)([(0,a.MZ)()],ue.prototype,"tileInfo",void 0),(0,s.Cg)([(0,a.MZ)()],ue.prototype,"extent",void 0),(0,s.Cg)([(0,a.MZ)()],ue.prototype,"maximumByteSize",void 0),ue=(0,s.Cg)([(0,u.$)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],ue);class he{constructor(e,t,i){this.data=e,this.objectIds=t,this.attributeKeys=i}}class ce{constructor(e,t,i){this.level=e,this.row=t,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class de{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,G.Wc)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class fe{constructor(e,t,i){this._tileInfo=e,this._extent=null,this.info=new de(t),null!=i&&(this._extent=(0,G.VY)(i))}addMissing(e,t,i,s){const n=new ae.U(null,e,t,i);this._tileInfo.updateTileInfo(n,1),null==n.extent||null!=this._extent&&!(0,G.HY)(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:s}),this.info.coveredArea-=(0,G.Wc)(n.extent))}}const pe=.18751;let _e=class extends n.nJ{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=(0,r.Tw)(),this._elevationAligner=I(),this._elevationFilter=B(),this._symbologyCandidatesFetcher=k(),this._updatingHandles=new h.U,this._alignPointsInFeatures=async(e,t)=>{const i={query:e},s=await this.remoteClient.invoke("alignElevation",i,{signal:t});return(0,r.Te)(t),s},this._getSymbologyCandidates=async(e,t)=>{const i={candidates:e,spatialReference:this._spatialReference.toJSON()},s=await this.remoteClient.invoke("getSymbologyCandidates",i,{signal:t});return(0,r.Te)(t),s}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:i,timeInfo:s,fieldsIndex:n}=e.serviceInfo,{hasZ:r}=e,a=c.A.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new f.A({...e.serviceInfo,hasZ:r,hasM:!1}),this._featureStore.estimateFeatureUsedMemory=e=>e.usedMemory,this._queryEngine=new p.do({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:n,hasZ:r,hasM:!1,featureIdInfo:{type:"object-id",fieldName:i},timeInfo:s}),this._featureFetcher=new ee({store:new ue({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:c.A.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const l="3d"===e.configuration.viewType;return this._elevationAligner=I(l,{elevationInfo:null!=e.elevationInfo?g.A.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=B(l),this.addHandles([(0,o.wB)(()=>this._featureFetcher.availability,e=>this.emit("notify-availability",{availability:e}),o.OH),(0,o.wB)(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),ge}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.Te)(t),this._featureFetcher.suspended=e,ge}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.Te)(t),this._featureFetcher.outFields=new Set(e??[]),ge}async fetchCandidates(e,t){await this._whenSetup.promise,(0,r.Te)(t);const i=function(e,t){const i=!!t||void 0;if(!e.filter)return{...e,query:{where:"1=1",returnZ:i}};const{distance:s,units:n,spatialRel:r,where:o,timeExtent:a,objectIds:l}=e.filter,u={geometry:e.filter.geometry?(0,d.rS)(e.filter.geometry):void 0,distance:s,units:n,spatialRel:r,timeExtent:a,objectIds:l,returnZ:i,where:o??"1=1"};return{...e,query:u}}(e,this._featureStore.hasZ),s=t?.signal,n=await this._queryEngine.executeQueryForSnapping(i,s);(0,r.Te)(s);const o=await this._elevationAligner.alignCandidates(n.candidates,c.A.fromJSON(e.point.spatialReference)??c.A.WGS84,s);(0,r.Te)(s);const a=await this._symbologyCandidatesFetcher.fetch(o,s);(0,r.Te)(s);const l=0===a.length?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(i,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.Te)(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?_.A.fromJSON(e.tileInfo):null,ge}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.Te)(t),this._featureFetcher.refresh(),ge}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.Te)(t),await(0,o.C_)(()=>!this.updating,t),(0,r.Te)(t),ge}async getDebugInfo(e,t){return(0,r.Te)(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.Te)(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),(0,r.Te)(t),ge}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),ge}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),ge}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),ge}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=k(e,this._getSymbologyCandidates),ge}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?m.A.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,s.Cg)([(0,a.MZ)({readOnly:!0})],_e.prototype,"updating",null),(0,s.Cg)([(0,a.MZ)()],_e.prototype,"_isInitializing",void 0),_e=(0,s.Cg)([(0,u.$)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],_e);const me=_e,ge={result:{}}},16271:(e,t,i)=>{i.d(t,{Ao:()=>r,KQ:()=>o});var s=i(4576),n=i(31756);function r(e){return 1/(n.j[e]||1)}const o=function(){const e=Object.keys(n.j);return(0,s.TF)(e,"decimal-degrees"),e.sort(),e}()},31756:(e,t,i)=>{i.d(t,{j:()=>r});var s=i(83047),n=i(79258);const r={unknown:1,inches:(0,s.oU)(1,"meters","inches"),feet:(0,s.oU)(1,"meters","feet"),"us-feet":(0,s.oU)(1,"meters","us-feet"),yards:(0,s.oU)(1,"meters","yards"),miles:(0,s.oU)(1,"meters","miles"),"nautical-miles":(0,s.oU)(1,"meters","nautical-miles"),millimeters:(0,s.oU)(1,"meters","millimeters"),centimeters:(0,s.oU)(1,"meters","centimeters"),decimeters:(0,s.oU)(1,"meters","decimeters"),meters:(0,s.oU)(1,"meters","meters"),kilometers:(0,s.oU)(1,"meters","kilometers"),"decimal-degrees":1/(0,s.vl)(1,"meters",n.$O.radius)}},36708:(e,t,i)=>{i.d(t,{C_:()=>d,OH:()=>_,Vh:()=>m,on:()=>c,pc:()=>g,wB:()=>l,z7:()=>u});var s=i(37955),n=i(36563),r=i(97768),o=i(74887),a=i(14012);function l(e,t,i={}){return h(e,t,i,f)}function u(e,t,i={}){return h(e,t,i,p)}function h(e,t,i={},s){let n=null;const o=i.once?(e,i)=>{s(e)&&((0,r.xt)(n),t(e,i))}:(e,i)=>{s(e)&&t(e,i)};if(n=(0,a.Cn)(e,o,i.sync,i.equals),i.initial){const t=e();o(t,t)}return n}function c(e,t,i,o={}){let a=null,u=null,h=null;function c(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(e){o.once&&o.once&&(0,r.xt)(h),i(e)}const f=l(e,(e,i)=>{c(),(0,s.wb)(e)&&(a=e,u=(0,s.on)(e,t,d),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return h=(0,n.hA)(()=>{f.remove(),c()}),h}function d(e,t){return function(e,t,i){if((0,o.G4)(i))return Promise.reject((0,o.NK)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,r.xt)(a)}return new Promise((s,r)=>{a=(0,n.vE)([(0,o.u7)(i,()=>{l(),r((0,o.NK)())}),h(e,e=>{l(),s(e)},{sync:!1,once:!0},t??f)])})}(e,p,t)}function f(e){return!0}function p(e){return!!e}i(80559);const _={sync:!0},m={initial:!0},g={sync:!0,initial:!0}},37539:(e,t,i)=>{i.d(t,{pO:()=>_,jd:()=>d,Tp:()=>f,w5:()=>c});var s=i(34727),n=i(83047),r=i(73941),o=i(79258);Math.PI;const a=o.$O.radius,l=o.$O.eccentricitySquared,u={a1:a*l,a2:a*l*a*l,a3:a*l*l/2,a4:a*l*a*l*2.5,a5:a*l+a*l*l/2,a6:1-l};o.$O.radius,o.$O.flattening,o.Sw.radius,o.Sw.flattening,o.sH.radius,o.sH.flattening,o.sH.radius;var h=i(21325);const c={2:{5:_,7:null,9:null,10:_,1:M,6:null,8:null,0:null,3:g,11:y,2:_,4:T},5:{5:_,7:null,9:null,10:_,1:M,6:null,8:null,0:null,3:g,11:y,2:_,4:T},7:{5:null,7:_,9:null,10:_,1:null,6:I,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:_,10:_,1:null,6:null,8:x,0:null,3:null,11:null,2:null,4:null},3:{5:m,7:null,9:null,10:m,1:function(e,t,i,s){const n=e[t]/P,r=A-2*Math.atan(Math.exp(-e[t+1]/P)),o=P+e[t+2],a=Math.cos(r)*o;i[s]=Math.cos(n)*a,i[s+1]=Math.sin(n)*a,i[s+2]=Math.sin(r)*o},6:null,8:null,0:null,3:_,11:function(e,t,i,s){m(e,t,i,s),y(i,s,i,s)},2:m,4:function(e,t,i,s){m(e,t,i,s),T(i,s,i,s)}},4:{5:z,7:null,9:null,10:z,1:function(e,t,i,s){z(e,t,i,s),M(i,s,i,s)},6:null,8:null,0:null,3:function(e,t,i,s){z(e,t,i,s),g(i,s,i,s)},11:function(e,t,i,s){z(e,t,i,s),y(i,s,i,s)},2:z,4:_},1:{5:F,7:null,9:null,10:F,1:_,6:null,8:null,0:null,3:function(e,t,i,s){F(e,t,i,s),g(i,s,i,s)},11:function(e,t,i,s){F(e,t,i,s),y(i,s,i,s)},2:F,4:function(e,t,i,s){F(e,t,i,s),T(i,s,i,s)}},6:{5:null,7:C,9:null,10:C,1:null,6:_,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:S,10:S,1:null,6:null,8:_,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:_,3:null,11:null,2:null,4:null},10:{5:_,7:_,9:_,10:_,1:M,6:I,8:x,0:null,3:g,11:y,2:_,4:T},11:{5:v,7:null,9:null,10:v,1:function(e,t,i,s){v(e,t,i,s),M(i,s,i,s)},6:null,8:null,0:null,3:function(e,t,i,s){v(e,t,i,s),g(i,s,i,s)},11:_,2:v,4:function(e,t,i,s){v(e,t,i,s),T(i,s,i,s)}}};function d(e,t){return f(e,t)?.projector}function f(e,t){if(null==e||null==t)return null;if(R.source.spatialReference===e&&R.dest.spatialReference===t)return R;const i=p(e,R.source),s=p(t,R.dest);return 0===i&&0===s?(0,h.aI)(e,t)?R.projector=_:R.projector=null:R.projector=c[i][s],R}function p(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,n.GA)(e,1)),(0,r.jA)(e)?t.spatialReferenceId=1:(0,h.oT)(e)?t.spatialReferenceId=2:(0,h.K8)(e)?t.spatialReferenceId=3:(0,h.r1)(e)?t.spatialReferenceId=11:e.wkt===r.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===r.FY.wkt?t.spatialReferenceId=6:e.wkt===r.LJ.wkt?t.spatialReferenceId=8:(0,h.q8)(e)?t.spatialReferenceId=7:(0,h.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function _(e,t,i,s){e!==i&&(i[s++]=e[t++],i[s++]=e[t++],i[s]=e[t])}function m(e,t,i,s){i[s]=E*(e[t]/P),i[s+1]=E*(A-2*Math.atan(Math.exp(-e[t+1]/P))),i[s+2]=e[t+2]}function g(e,t,i,n){!function(e,t,i,n,r){const o=.4999999*Math.PI,a=(0,s.qE)(B*e[t+1],-o,o),l=Math.sin(a);i[n++]=B*e[t]*r.radius,i[n++]=r.halfSemiMajorAxis*Math.log((1+l)/(1-l)),i[n]=e[t+2]}(e,t,i,n,o.$O)}function y(e,t,i,s){i[s]=e[t]*j,i[s+1]=e[t+1]*j,i[s+2]=e[t+2]}function v(e,t,i,s){i[s]=e[t]*O,i[s+1]=e[t+1]*O,i[s+2]=e[t+2]}function w(e,t,i,s,n){const r=n+e[t+2],o=B*e[t+1],a=B*e[t],l=Math.cos(o)*r;i[s]=Math.cos(a)*l,i[s+1]=Math.sin(a)*l,i[s+2]=Math.sin(o)*r}function x(e,t,i,s){w(e,t,i,s,o.Sw.radius)}function I(e,t,i,s){w(e,t,i,s,o.sH.radius)}function M(e,t,i,s){w(e,t,i,s,o.$O.radius)}function b(e,t,i,n,r){const o=e[t],a=e[t+1],l=e[t+2],u=Math.sqrt(o*o+a*a+l*l),h=(0,s.YN)(l/(0===u?1:u)),c=Math.atan2(a,o);i[n++]=E*c,i[n++]=E*h,i[n]=u-r}function S(e,t,i,s){b(e,t,i,s,o.Sw.radius)}function C(e,t,i,s){b(e,t,i,s,o.sH.radius)}function F(e,t,i,s){b(e,t,i,s,o.$O.radius)}function T(e,t,i,s){!function(e,t,i,s,n){const r=B*e[t],o=B*e[t+1],a=e[t+2],l=Math.sin(o),u=Math.cos(o),h=n.radius/Math.sqrt(1-n.eccentricitySquared*l*l);i[s++]=(h+a)*u*Math.cos(r),i[s++]=(h+a)*u*Math.sin(r),i[s++]=(h*(1-n.eccentricitySquared)+a)*l}(e,t,i,s,o.$O)}function z(e,t,i,s){const n=u,r=e[t],a=e[t+1],l=e[t+2];let h,c,d,f,p,_,m,g,y,v,w,x,I,M,b,S,C,F,T,z,R;h=Math.abs(l),c=r*r+a*a,d=Math.sqrt(c),f=c+l*l,p=Math.sqrt(f),z=Math.atan2(a,r),_=l*l/f,m=c/f,M=n.a2/p,b=n.a3-n.a4/p,m>.3?(g=h/p*(1+m*(n.a1+M+_*b)/p),T=Math.asin(g),v=g*g,y=Math.sqrt(1-v)):(y=d/p*(1-_*(n.a5-M-m*b)/p),T=Math.acos(y),v=1-y*y,g=Math.sqrt(v)),w=1-o.$O.eccentricitySquared*v,x=o.$O.radius/Math.sqrt(w),I=n.a6*x,M=d-x*y,b=h-I*g,C=y*M+g*b,S=y*b-g*M,F=S/(I/w+C),T+=F,R=C+S*F/2,l<0&&(T=-T),i[s++]=E*z,i[s++]=E*T,i[s]=R}const R={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:_},B=(0,s.kU)(1),E=(0,s.KJ)(1),A=.5*Math.PI,P=o.$O.radius,j=P*Math.PI/180,O=180/(P*Math.PI)},60999:(e,t,i)=>{i.d(t,{DZ:()=>p,Ke:()=>f,Tj:()=>h,UT:()=>_,jJ:()=>u});var s=i(31635),n=i(65008),r=i(97768),o=i(74887),a=i(10107),l=i(40608);function u(e,t,i){return(0,o.Lx)(e.map((e,s)=>t.apply(i,[e,s])))}async function h(e,t,i){return(await(0,o.Lx)(e.map((e,s)=>t.apply(i,[e,s])))).map(e=>e.value)}function c(e){return{ok:!0,value:e}}function d(e){return{ok:!1,error:e}}async function f(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return c(await e)}catch(e){return d(e)}}async function p(e){try{return c(await e)}catch(e){return(0,o.QP)(e),d(e)}}function _(e,t){return new m(e,t)}let m=class extends n.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,r.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:i}=this._abortController;this.promise=e(i),this.promise.then(e=>{this._result=c(e),this._cleanup()},e=>{this._result=d(e),this._cleanup()}),this._abortHandle=(0,o.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,r.xt)(this._abortHandle),this._abortController=null}};(0,s.Cg)([(0,a.MZ)()],m.prototype,"value",null),(0,s.Cg)([(0,a.MZ)()],m.prototype,"error",null),(0,s.Cg)([(0,a.MZ)()],m.prototype,"finished",null),(0,s.Cg)([(0,a.MZ)()],m.prototype,"promise",void 0),(0,s.Cg)([(0,a.MZ)()],m.prototype,"_result",void 0),m=(0,s.Cg)([(0,l.$)("esri.core.asyncUtils.ReactiveTask")],m)},62815:(e,t,i)=>{i.d(t,{N:()=>o});var s=i(83047),n=i(73941),r=i(21325);function o(e,t,i){if(null==t||null==i||i.vcsWkid||(0,r.aI)(t,i)||(0,n.xP)(t)||(0,n.xP)(i))return null;const o=(0,s.G9)(t)/(0,s.G9)(i);if(1===o)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,o);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const i of e.paths)for(const e of i)e.length>2&&(e[2]*=t)}(e,o);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const i of e.rings)for(const e of i)e.length>2&&(e[2]*=t)}(e,o);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}(e,o);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,o);default:return null}}},66344:(e,t,i)=>{i.d(t,{q:()=>a});const s=!!(0,i(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class n{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._users=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._users.clear(),this._db=null}register(e){this._users.set(e.id.slice(0,-1),e)}deregister(e){this.clear(e),this._sizeLimits.delete(e),this._users.delete(e.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const i=this._db.get(e.id+t);return i?.size??0}put(e,t,i,n,o){t=e.id+t;const a=this._db.get(t);if(a&&(this._size-=a.size,e.size-=a.size,this._db.delete(t),a.entry!==i&&this._notifyRemove(t,a.entry,a.size,0)),n>this._maxSize)return void this._notifyRemove(t,i,n,0);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return s||console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,i,0,0);const l=1+Math.max(o,-4)- -3;this._db.set(t,new r(i,n,l)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t){t=e.id+t;const i=this._db.get(t);if(!i)return;this._size-=i.size,e.size-=i.size;let s=i.entry.usedMemory;for(;s>this._maxSize;){const e=this._notifyRemove(t,i.entry,s,1);if(!(null!=e&&e>0))return void this._db.delete(t);s=e}i.size=s,this._size+=s,e.size+=s,this._checkSize()}pop(e,t){t=e.id+t;const i=this._db.get(t);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(e,t){t=e.id+t;const i=this._db.get(t);if(void 0!==i)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}peek(e,t){const i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},i=new Array;this._db.forEach((e,s)=>{const n=e.lifetime;i[n]=(i[n]||0)+e.size,this._users.forEach(i=>{const{id:n,name:r}=i;if(s.startsWith(n)){const i=t[r]||0;t[r]=i+e.size}})});const s={};this._users.forEach(e=>{const i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[i]||0;t[i]=n,s[i]=Math.round(100*e.hitRate)+"%"}else s[i]="0%"});const n=Object.keys(t);n.sort((e,i)=>t[i]-t[e]),n.forEach(i=>e[i]=Math.round(t[i]/2**20)+"MB / "+s[i]);for(let t=i.length-1;t>=0;--t){const s=i[t];s&&(e["Priority "+(t+-3-1)]=Math.round(s/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forEach(e=>e.resetHitRate())}clear(e){const t=e.id;this._db.forEach((e,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,e.size,0))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,0)),this._users.forEach(e=>e.size=0),this._size=0,this._db.clear()}*values(e){for(const[t,i]of this._db)t.startsWith(e.id)&&(yield i.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i,s){const n=this._users.get(e.split(o)[0])?.removeFunc,r=n?.(t,s,i);return"number"==typeof r?r:null}_checkSize(){this._sizeLimits.forEach((e,t)=>this._checkSizeLimits(e,t)),this._checkSizeLimits(this.maxSize)}setMaxSize(e,t){null==t||t<=0?this._sizeLimits.delete(e):this._sizeLimits.set(e,t)}_checkSizeLimits(e,t){const i=t??this;if(i.size<=e)return;const s=t?.id;let n=!0;for(;n;){n=!1;for(const[r,a]of this._db)if(0===a.lifetime&&(!s||r.startsWith(s))){const s=t??this._users.get(r.split(o)[0]);if(this._purgeItem(r,a,s),i.size<=.9*e)return;n||=this._db.has(r)}}for(const[n,r]of this._db)if(!s||n.startsWith(s)){const s=t??this._users.get(n.split(o)[0]);if(this._purgeItem(n,r,s),i.size<=.9*e)return}}_purgeItem(e,t,i){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);const s=this._notifyRemove(e,t.entry,t.size,1);null!=s&&s>0&&(this._size+=s,i&&(i.size+=s),t.lives=t.lifetime,t.size=s,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}new n(0);class r{constructor(e,t,i){this.entry=e,this.size=t,this.lifetime=i,this.lives=i}}const o=":";class a{constructor(e,t){this.removeFunc=t,this._storage=new n,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy(),this._storage=null}put(e,t,i=1){this._storage.put(this,e,t,i,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},69540:(e,t,i)=>{i.d(t,{OU:()=>h,Pw:()=>c});var s=i(31635),n=i(65008),r=(i(44208),i(4718)),o=(i(53966),i(97768)),a=i(88620),l=i(40608);const u=Symbol("ClonableMixin"),h=e=>{var t;const i=e;let n=class extends i{constructor(){super(...arguments),this[t]=!0}static{t=u}clone(e){const t=(0,a.oY)(this);(0,o.Lw)(t,"unable to clone instance of non-accessor class");const i=t.metadata,s=t.store,n={},l=new Map;for(const t in i){const o=i[t],a=s?.originOf(t),u=o.clonable;if(o.readOnly||!1===u||7!==a&&0!==a&&5!==a&&4!==a)continue;const h=this[t];let c=null;if("function"==typeof u)c=u(h,e);else if("reference"===u)c=h;else if(c=(0,r.TU)(h,e),null!=h&&null==c)continue;0===a?l.set(t,c):n[t]=c}const u=new(0,Object.getPrototypeOf(this).constructor)(n);if(l.size){const e=(0,a.oY)(u)?.store;if(e)for(const[t,i]of l)e.set(t,i,0)}return u}};return n=(0,s.Cg)([(0,l.$)("esri.core.Clonable")],n),n},c=h(n.A)},75503:(e,t,i)=>{i.d(t,{EC:()=>S,wq:()=>a});var s=i(4576),n=i(21818),r=(i(44208),i(15142)),o=i(11006);class a{constructor(e=9,t){this._compareMinX=d,this._compareMinY=f,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),I.prune(),M.prune(),b.prune()}all(e){l(this._data,e)}search(e,t){let i=this._data;const s=this._toBBox;if(v(e,i))for(x.clear();i;){for(let n=0,r=i.children.length;n<r;n++){const r=i.children[n],o=i.leaf?s(r):r;v(e,o)&&(i.leaf?t(r):y(e,o)?l(r,t):x.push(r))}i=x.pop()}}collides(e){let t=this._data;const i=this._toBBox;if(!v(e,t))return!1;for(x.clear();t;){for(let s=0,n=t.children.length;s<n;s++){const n=t.children[s],r=t.leaf?i(n):n;if(v(e,r)){if(t.leaf||y(e,r))return!0;x.push(n)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new F([]),this}remove(e){if(!e)return this;let t,i=this._data,r=null,o=0,a=!1;const l=this._toBBox(e);for(M.clear(),b.clear();i||M.length>0;){if(i||(i=M.pop(),r=M.data[M.length-1],o=b.pop()??0,a=!0),i.leaf&&(t=(0,s.qh)(i.children,(0,n.zI)(e),i.children.length,i.indexHint),-1!==t))return i.children.splice(t,1),M.push(i),this._condense(M),this;a||i.leaf||!y(i,l)?r?(o++,i=r.children[o],a=!1):i=null:(M.push(i),b.push(o),o=0,r=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,i,s){const n=i-t+1;let r=this._maxEntries;if(n<=r){const s=new F(e.slice(t,i+1));return u(s,this._toBBox),s}s||(s=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(s-1)));const o=new T([]);o.height=s;const a=Math.ceil(n/r),l=a*Math.ceil(Math.sqrt(r));w(e,t,i,l,this._compareMinX);for(let n=t;n<=i;n+=l){const t=Math.min(n+l-1,i);w(e,n,t,a,this._compareMinY);for(let i=n;i<=t;i+=a){const n=Math.min(i+a-1,t);o.children.push(this._build(e,i,n,s-1))}}return u(o,this._toBBox),o}_insert(e,t,i){const s=this._toBBox,n=i?e:s(e);M.clear();const r=function(e,t,i,s){for(;s.push(t),!0!==t.leaf&&s.length-1!==i;){let i,s=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=p(o),l=m(e,o)-a;l<n?(n=l,s=a<s?a:s,i=o):l===n&&a<s&&(s=a,i=o)}t=i||t.children[0]}return t}(n,this._data,t,M);for(r.children.push(e),c(r,n);t>=0&&M.data[t].children.length>this._maxEntries;)this._split(M,t),t--;!function(e,t,i){for(let s=i;s>=0;s--)c(t.data[s],e)}(n,M,t)}_split(e,t){const i=e.data[t],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);const r=this._chooseSplitIndex(i,n,s);if(!r)return;const o=i.children.splice(r,i.children.length-r),a=i.leaf?new F(o):new T(o);a.height=i.height,u(i,this._toBBox),u(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this._data=new T([e,t]),this._data.height=e.height+1,u(this._data,this._toBBox)}_chooseSplitIndex(e,t,i){let s,n,r;s=n=1/0;for(let o=t;o<=i-t;o++){const t=h(e,0,o,this._toBBox),a=h(e,o,i,this._toBBox),l=g(t,a),u=p(t)+p(a);l<s?(s=l,r=o,n=u<n?u:n):l===s&&u<n&&(n=u,r=o)}return r}_chooseSplitAxis(e,t,i){const s=e.leaf?this._compareMinX:d,n=e.leaf?this._compareMinY:f;this._allDistMargin(e,t,i,s)<this._allDistMargin(e,t,i,n)&&e.children.sort(s)}_allDistMargin(e,t,i,s){e.children.sort(s);const n=this._toBBox,r=h(e,0,t,n),o=h(e,i-t,i,n);let a=_(r)+_(o);for(let s=t;s<i-t;s++){const t=e.children[s];c(r,e.leaf?n(t):t),a+=_(r)}for(let s=i-t-1;s>=t;s--){const t=e.children[s];c(o,e.leaf?n(t):t),a+=_(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const i=e.data[t];if(0===i.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,s.qh)(r,i,r.length,n.indexHint),1)}else this.clear();else u(i,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let i=e;for(I.clear();i;){if(!0===i.leaf)for(const e of i.children)t((0,n.zI)(e));else I.pushArray(i.children);i=I.pop()??null}}function u(e,t){h(e,0,e.children.length,t,e)}function h(e,t,i,s,n){n||(n=new F([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<i;o++)r=e.children[o],c(n,e.leaf?s(r):r);return n}function c(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function d(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function p(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function _(e){return e.maxX-e.minX+(e.maxY-e.minY)}function m(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){const i=Math.max(e.minX,t.minX),s=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,r-s)}function y(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function v(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function w(e,t,i,s,n){const r=[t,i];for(;r.length;){const t=r.pop(),i=r.pop();if(t-i<=s)continue;const a=i+Math.ceil((t-i)/s/2)*s;(0,o.q)(e,a,i,t,n),r.push(i,a,a,t)}}const x=new r.A,I=new r.A,M=new r.A,b=new r.A({deallocator:void 0});class S{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class C extends S{constructor(){super(...arguments),this.height=1,this.indexHint=new s.vW}}class F extends C{constructor(e){super(),this.children=e,this.leaf=!0}}class T extends C{constructor(e){super(),this.children=e,this.leaf=!1}}},79677:(e,t,i)=>{i.d(t,{A:()=>d});var s,n=i(31635),r=i(25482),o=i(88930),a=i(10107),l=(i(44208),i(53966),i(87811),i(36005)),u=i(40608),h=i(43937),c=i(98623);let d=class extends r.o{static{s=this}static get allTime(){return f}static get empty(){return p}static fromArray(e){return new s({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(s.allTime)}get isEmpty(){return this.equals(s.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new s({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,i=this.end?.getTime()??this.end,s=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===s&&i===n}expandTo(e,t=c.qU){if(this.isEmpty||this.isAllTime)return this.clone();let i=this.start;i&&(i=(0,o.lL)(i,e,t));let n=this.end;if(n){const i=(0,o.lL)(n,e,t);n=n.getTime()===i.getTime()?i:(0,o.S1)(i,1,e,t)}return new s({start:i,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return s.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,i=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let o,a;return n>=t&&n<=i?o=n:t>=n&&t<=r&&(o=t),i>=n&&i<=r?a=i:r>=t&&r<=i&&(a=r),null==o||null==a||isNaN(o)||isNaN(a)?s.empty:new s({start:o===-1/0?null:new Date(o),end:a===1/0?null:new Date(a)})}offset(e,t,i=c.qU){if(this.isEmpty||this.isAllTime)return this.clone();const n=new s,{start:r,end:a}=this;return null!=r&&(n.start=(0,o.S1)(r,e,t,i)),null!=a&&(n.end=(0,o.S1)(a,e,t,i)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return f.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new s({start:t,end:i})}};(0,n.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,n.Cg)([(0,l.w)("end")],d.prototype,"readEnd",null),(0,n.Cg)([(0,h.K)("end")],d.prototype,"writeEnd",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,n.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,n.Cg)([(0,l.w)("start")],d.prototype,"readStart",null),(0,n.Cg)([(0,h.K)("start")],d.prototype,"writeStart",null),d=s=(0,n.Cg)([(0,u.$)("esri.time.TimeExtent")],d);const f=new d,p=new d({start:void 0,end:void 0})},83221:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(4576),n=i(49186),r=i(65529),o=i(53966),a=i(70328),l=i(19419),u=i(90708),h=i(6518),c=i(51441),d=i(37730);const f=(0,a.vt)();class p{constructor(e){this.geometryInfo=e,this._boundsStore=new h.F,this._featuresById=new Map,this._usedMemory=0,this.events=new r.bk,this.featureAdapter=d.T}get usedMemory(){return this._usedMemory}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,i,s,n]=this.fullBounds;return{xmin:t,ymin:i,xmax:s,ymax:n,spatialReference:(0,c.ag)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map(e=>this._upsert(e));return this._emitChanged(),t.filter(s.Ru)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged(),this._usedMemory=0}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const i of e){const e=this._boundsStore.get(i.objectId);e&&t((0,a.Jt)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,e=>{t(this._featuresById.get(e))})}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.A("featurestore:invalid-feature","feature id is missing",{feature:e}));const i=this._featuresById.get(t);let s;if(i?(e.displayId=i.displayId,s=this._boundsStore.get(t),this._boundsStore.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);s=(0,u.jQ)(null!=s?s:(0,l.vt)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=s&&this._boundsStore.set(t,s),this._featuresById.set(t,e),this._usedMemory+=this.estimateFeatureUsedMemory?.(e)??0}_upsert(e){const t=e?.objectId;if(null==t)return o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.A("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const i=this._featuresById.get(t);if(!i)return this._add(e),e;this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0;const{geometry:s,attributes:r}=e;for(const e in r)i.attributes[e]=r[e];return s&&(i.geometry=s,this._boundsStore.set(t,(0,u.jQ)((0,l.vt)(),s,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),this._usedMemory+=this.estimateFeatureUsedMemory?.(i)??0,i}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._boundsStore.delete(t),this._featuresById.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(e)??0,e}}},88625:(e,t,i)=>{i.d(t,{A:()=>v});var s,n=i(31635),r=i(69540),o=i(66552),a=i(25482),l=i(97768),u=i(10107),h=(i(44208),i(53966),i(87811),i(36005)),c=i(40608),d=i(43937),f=i(30524);let p=s=class extends a.o{constructor(e){super(e),this.expression=void 0,this.title=void 0}async collectRequiredFields(e,t){return(0,f.Dx)(e,t,null,this.expression)}clone(){return new s({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,n.Cg)([(0,u.MZ)({type:String,json:{write:{isRequired:!0}}})],p.prototype,"expression",void 0),(0,n.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],p.prototype,"title",void 0),p=s=(0,n.Cg)([(0,c.$)("esri.symbols.support.FeatureExpressionInfo")],p);const _=p;var m=i(16271);const g=(0,o.O)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),y=new o.J({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let v=class extends((0,r.OU)(a.o)){constructor(e){super(e),this.featureExpressionInfo=void 0,this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e.expression?e:void 0:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,i,s){t[i]=e.write({},s),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,l.CM)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,n.Cg)([(0,u.MZ)({type:_,json:{write:!0}})],v.prototype,"featureExpressionInfo",void 0),(0,n.Cg)([(0,h.w)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],v.prototype,"readFeatureExpressionInfo",null),(0,n.Cg)([(0,d.K)("featureExpressionInfo",{featureExpressionInfo:{type:_},"featureExpression.value":{type:[0]}})],v.prototype,"writeFeatureExpressionInfo",null),(0,n.Cg)([(0,u.MZ)({type:g.apiValues,nonNullable:!0,json:{type:g.jsonValues,read:g.read,write:{writer:g.write,isRequired:!0}}})],v.prototype,"mode",null),(0,n.Cg)([(0,u.MZ)({type:Number,json:{write:!0}})],v.prototype,"offset",void 0),(0,n.Cg)([(0,u.MZ)({type:m.KQ,json:{type:String,read:y.read,write:y.write}})],v.prototype,"unit",null),v=(0,n.Cg)([(0,c.$)("esri.symbols.support.ElevationInfo")],v)},98453:(e,t,i)=>{i.d(t,{m:()=>s});const s=new(i(66552).J)({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"})},98988:(e,t,i)=>{i.r(t),i.d(t,{canProjectWithoutEngine:()=>G,getTransformation:()=>L,getTransformations:()=>H,initializeProjection:()=>J,isEqualBaseGCS:()=>D,isLoaded:()=>B,isLoadedOrLoad:()=>E,isLoadedOrLoadFor:()=>A,load:()=>j,project:()=>O,projectExtent:()=>re,projectMany:()=>k,projectMultipoint:()=>W,projectOrLoad:()=>Z,projectOrLoadMany:()=>q,projectPoint:()=>Q,projectPolygon:()=>se,projectPolyline:()=>te,projectWithZConversion:()=>$,projectWithoutEngine:()=>K,requiresLoad:()=>P,test:()=>N,tryProjectWithZConversion:()=>U,unload:()=>X});var s=i(49186),n=i(74887),r=i(62788),o=i(95488),a=i(51850),l=i(21276),u=i(73941),h=i(5443),c=i(48526),d=i(83290),f=i(86738),p=i(39829),_=i(82799),m=i(16930),g=i(9762),y=i(37539);function v(e,t,i,s,n,r){return w[0]=e,w[1]=t,w[2]=i,(0,g.projectBuffer)(w,s,0,n,r,0)}const w=(0,a.vt)();let x=0;class I{static fromGE(e){const t=new I;return t._wkt=e.wkt,t._wkid=e.wkid,t._isInverse=e.isInverse,t}constructor(e){this.uid=x++,e?(this._wkt=null!=e.wkt?e.wkt:null,this._wkid=null!=e.wkid?e.wkid:-1,this._isInverse=null!=e.isInverse&&!0===e.isInverse):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}get wkt(){return this._wkt}set wkt(e){this._wkt=e,this.uid=x++}get wkid(){return this._wkid}set wkid(e){this._wkid=e,this.uid=x++}get isInverse(){return this._isInverse}set isInverse(e){this._isInverse=e,this.uid=x++}getInverse(){const e=new I;return e._wkt=this.wkt,e._wkid=this._wkid,e._isInverse=!this.isInverse,e}}class M{static cacheKey(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}static fromGE(e){const t=new M;let i="";for(const s of e.steps){const e=I.fromGE(s);t.steps.push(e),i+=e.uid.toString()+","}return t._cachedProjection={},t._gtlistentry=null,t._chain=i,t}constructor(e){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,e?.steps)for(const t of e.steps)t instanceof I?this.steps.push(t):this.steps.push(new I({wkid:t.wkid,wkt:t.wkt,isInverse:t.isInverse}))}getInverse(){const e=new M;e.steps=[];for(let t=this.steps.length-1;t>=0;t--){const i=this.steps[t];e.steps.push(i.getInverse())}return e}getGTListEntry(){let e="";for(const t of this.steps)e+=t.uid.toString()+",";return e!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=e),this._gtlistentry}assignCachedGe(e,t,i){this._cachedProjection[M.cacheKey(e,t)]=i}getCachedGeTransformation(e,t){let i="";for(const e of this.steps)i+=e.uid.toString()+",";i!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=i);const s=this._cachedProjection[M.cacheKey(e,t)];return void 0===s?null:s}}var b=i(21325),S=i(62815);let C=null,F=null,T=null,z={};const R=new o.I;function B(){return!!C&&(0,d.i)()}function E(){return!!B()||((0,r.gc)(R),j(),!1)}function A(e,t){return!e||!t||G(e,t)||E()}function P(e,t){return!G(e,t)&&!B()}function j(e){return null==T&&(T=Promise.all([(0,d.l)(),i.e(9930).then(i.bind(i,49930)).then(e=>e.g),i.e(2731).then(i.bind(i,12731))])),T.then(([,t,{hydratedAdapter:i}])=>{(0,n.Te)(e),F=i,C=t.default,C._enableProjection(d.p),R.notify()})}function O(e,t,i=null,s=null){return Array.isArray(e)?0===e.length?[]:((0,l.H)(e),k(F,e,e[0].spatialReference,t,i,s)):((0,l.f)(e),k(F,[e],e.spatialReference,t,i,s)[0])}function k(e,t,i,s,n=null,r=null){if(null==i||null==s)return t;if(G(i,s,n))return t.map(e=>K(e,i,s));if(null==n&&(0,u.jA)(i))return t.map(e=>K(e,i,m.A.WGS84)).map(e=>U(e,s));if(null==n&&(0,u.jA)(s))return t.map(e=>U(e,m.A.WGS84)).map(e=>K(e,m.A.WGS84,s));if(null==n){const e=M.cacheKey(i,s);void 0!==z[e]?n=z[e]:(null==(n=L(i,s,void 0))&&(n=new M),z[e]=n)}if(null==C||null==e)throw new Y;return null!=r?C._project(e,t,i,s,n,r):C._project(e,t,i,s,n)}function Z(e,t){const i=q([e],t);return null!=i.pending?{pending:i.pending,geometry:null}:null!=i.geometries?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function q(e,t){if(!B())for(const i of e)if(null!=i&&!(0,b.aI)(i.spatialReference,t)&&(0,b.fn)(i.spatialReference)&&(0,b.fn)(t)&&!G(i.spatialReference,t))return(0,r.gc)(R),{pending:j(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,b.aI)(e.spatialReference,t)?e:(0,b.fn)(e.spatialReference)&&(0,b.fn)(t)?U(e,t):null)}}function L(e,t,i=null){if(null==e||null==t)return null;if(null==C||null==F)throw new Y;const s=C._getTransformation(F,e,t,i,i?.spatialReference);return null!==s?M.fromGE(s):null}function H(e,t,i=null){if(null==C||null==F)throw new Y;const s=C._getTransformationBySuitability(F,e,t,i,i?.spatialReference);if(null!==s){const e=[];for(const t of s)e.push(M.fromGE(t));return e}return[]}class Y extends s.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function X(){C=null,F=null,T=null,z={}}const N={get loadPromise(){return T}};function U(e,t){try{const i=O(e,t);if(null==i)return null;"xmin"in e&&"xmin"in i&&(i.zmin=e.zmin,i.zmax=e.zmax);const s=(0,S.N)(i.type,e.spatialReference,t);return null!=s&&s(i),i}catch(e){if(!(e instanceof Y))throw e;return null}}async function $(e,t,i){const s=e.spatialReference;return null!=s&&null!=t&&await J(s,t,null,i),U(e,t)}function G(e,t,i){return!i&&(!!(0,b.aI)(e,t)||(0,b.fn)(e)&&(0,b.fn)(t)&&!!(0,y.jd)(e,t))}function D(e,t){if((0,b.aI)(e,t))return!0;if(!(0,b.fn)(e)||!(0,b.fn)(t))return!1;const i=(0,b.oT)(e)||(0,b.K8)(e)||(0,b.x1)(e),s=(0,b.oT)(t)||(0,b.K8)(t)||(0,b.x1)(t);return i&&s}async function J(e,t,i,s){if(B())return(0,n.NO)(s);if(Array.isArray(e)){for(const{source:t,dest:i,geographicTransformation:n}of e)if(t&&i&&!G(t,i,n))return j(s)}else if(e&&t&&!G(e,t,i))return j(s);return(0,n.NO)(s)}function K(e,t,i){return e?"x"in e?V(e,t,new f.A,i,0):"xmin"in e?oe(e,t,new h.A,i,0):"rings"in e?ne(e,t,new p.A,i,0):"paths"in e?ie(e,t,new _.A,i,0):"points"in e?ee(e,t,new c.A,i,0):null:null}function Q(e,t,i=t.spatialReference,s=0){return null!=i&&null!=e.spatialReference&&null!=V(e,e.spatialReference,t,i,s)}function V(e,t,i,s,n){le[0]=e.x,le[1]=e.y;const r=e.z;return le[2]=void 0!==r?r:n,(0,g.projectBuffer)(le,t,0,le,s,0)?(i.x=le[0],i.y=le[1],i.spatialReference=s,void 0!==r||(0,u.xP)(s)?(i.z=le[2],i.hasZ=!0):(i.z=void 0,i.hasZ=!1),void 0===e.m?(i.m=void 0,i.hasM=!1):(i.m=e.m,i.hasM=!0),i):null}function W(e,t,i=t.spatialReference,s=0){return null!=e.spatialReference&&null!=i&&null!=ee(e,e.spatialReference,t,i,s)}function ee(e,t,i,s,n){const{points:r,hasZ:o,hasM:a}=e,l=[],h=r.length,c=[];for(const e of r)c.push(e[0],e[1],o?e[2]:n);if(!(0,g.projectBuffer)(c,t,0,c,s,0,h))return null;const d=o||(0,u.xP)(s);for(let e=0;e<h;++e){const t=3*e,i=c[t],s=c[t+1];d&&a?l.push([i,s,c[t+2],r[e][3]]):d?l.push([i,s,c[t+2]]):a?l.push([i,s,r[e][2]]):l.push([i,s])}return i.points=l,i.spatialReference=s,i.hasZ=o,i.hasM=a,i}function te(e,t,i=t.spatialReference,s=0){return null!=e.spatialReference&&null!=i&&null!=ie(e,e.spatialReference,t,i,s)}function ie(e,t,i,s,n){const{paths:r,hasZ:o,hasM:a}=e,l=[];if(!ae(r,o??!1,a??!1,t,l,s,n))return null;const h=o||(0,u.xP)(s);return i.paths=l,i.spatialReference=s,i.hasZ=h,i.hasM=a,i}function se(e,t,i=t.spatialReference,s=0){return null!=e.spatialReference&&null!=i&&null!=ne(e,e.spatialReference,t,i,s)}function ne(e,t,i,s,n){const{rings:r,hasZ:o,hasM:a}=e,l=[];if(!ae(r,o??!1,a??!1,t,l,s,n))return null;const h=o||(0,u.xP)(s);return i.rings=l,i.spatialReference=s,i.hasZ=h,i.hasM=a,i}function re(e,t,i=t.spatialReference,s=0){return null!=e.spatialReference&&null!=i&&null!=oe(e,e.spatialReference,t,i,s)}function oe(e,t,i,s,n){const{xmin:r,ymin:o,xmax:a,ymax:l,hasZ:h,hasM:c}=e;if(!v(r,o,h?e.zmin:n,t,le,s))return null;const d=h||(0,u.xP)(s);return i.xmin=le[0],i.ymin=le[1],d&&(i.zmin=le[2]),v(a,l,h?e.zmax:n,t,le,s)?(i.xmax=le[0],i.ymax=le[1],d&&(i.zmax=le[2]),c&&(i.mmin=e.mmin,i.mmax=e.mmax),i.spatialReference=s,i):null}function ae(e,t,i,s,n,r,o=0){const a=new Array;for(const i of e)for(const e of i)a.push(e[0],e[1],t?e[2]:o);if(!(0,g.projectBuffer)(a,s,0,a,r,0))return!1;let l=0;n.length=0;const h=t||(0,u.xP)(r);for(const t of e){const e=new Array;for(const s of t)h&&i?e.push([a[l++],a[l++],a[l++],s[3]]):h?e.push([a[l++],a[l++],a[l++]]):i?(e.push([a[l++],a[l++],s[2]]),l++):(e.push([a[l++],a[l++]]),l++);n.push(e)}return!0}const le=(0,a.vt)()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4649,7136],{4197:(e,t,i)=>{i.d(t,{Vj:()=>u,cj:()=>l,jh:()=>r,l5:()=>o,xm:()=>a});var s=i(34275),n=i(9093);function r(e){return e<=s.y9?new Array(e).fill(0):new Float64Array(e)}function a(e){return((0,s.iu)(e)?e.byteLength/8:e.length)<=s.y9?Array.from(e):new Float64Array(e)}function o(e,t,i){return Array.isArray(e)?e.slice(t,t+i):e.subarray(t,t+i)}function l(e){return[...e]}function u(e){const t=(0,n.vt)();for(let i=0;i<16;++i)t[i]=e[i];return t}},5834:(e,t,i)=>{i.d(t,{A:()=>h});var s=i(31635),n=i(93637),r=i(10107),a=i(56507),o=(i(44208),i(87811),i(93223)),l=i(40608),u=i(41266),c=i(41366);function d(e,t,i){(0,n.sM)(i,e instanceof Date?e.getTime():e,t)}let h=class extends((0,c.K)(u.A)){constructor(e){super(e),this.numBins=null,this.end=null,this.start=null,this.type="auto-interval"}};(0,s.Cg)([(0,r.MZ)({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],h.prototype,"numBins",void 0),(0,s.Cg)([(0,r.MZ)({json:{name:"parameters.end",write:{writer:d}}})],h.prototype,"end",void 0),(0,s.Cg)([(0,r.MZ)({json:{name:"parameters.start",write:{writer:d}}})],h.prototype,"start",void 0),(0,s.Cg)([(0,o.e)({autoIntervalBin:"auto-interval"},{readOnly:!0})],h.prototype,"type",void 0),h=(0,s.Cg)([(0,l.$)("esri.rest.support.AutoIntervalBinParameters")],h),h.from=(0,a.dp)(h)},7320:(e,t,i)=>{i.d(t,{g:()=>s});const s={convertToGEGeometry:function(e,t){return null==t?null:e.convertJSONToGeometry(t)},exportPoint:function(e,t,i){const s=new n(e.getPointX(t),e.getPointY(t),i),r=e.hasZ(t),a=e.hasM(t);return r&&(s.z=e.getPointZ(t)),a&&(s.m=e.getPointM(t)),s},exportPolygon:function(e,t,i){return new r(e.exportPaths(t),i,e.hasZ(t),e.hasM(t))},exportPolyline:function(e,t,i){return new a(e.exportPaths(t),i,e.hasZ(t),e.hasM(t))},exportMultipoint:function(e,t,i){return new o(e.exportPoints(t),i,e.hasZ(t),e.hasM(t))},exportExtent:function(e,t,i){const s=e.hasZ(t),n=e.hasM(t),r=new l(e.getXMin(t),e.getYMin(t),e.getXMax(t),e.getYMax(t),i);if(s){const i=e.getZExtent(t);r.zmin=i.vmin,r.zmax=i.vmax}if(n){const i=e.getMExtent(t);r.mmin=i.vmin,r.mmax=i.vmax}return r}};class n{constructor(e,t,i){this.x=e,this.y=t,this.spatialReference=i,this.z=void 0,this.m=void 0}}class r{constructor(e,t,i,s){this.rings=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}class a{constructor(e,t,i,s){this.paths=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}class o{constructor(e,t,i,s){this.points=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}class l{constructor(e,t,i,s,n){this.xmin=e,this.ymin=t,this.xmax=i,this.ymax=s,this.spatialReference=n,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},8384:(e,t,i)=>{i.d(t,{G:()=>R});var s=i(4718),n=i(12359),r=i(90634),a=i(62577),o=i(21325),l=i(29441),u=i(51441),c=i(30524),d=i(87445),h=i(1873),p=i(43668);class m{constructor(e,t,i){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=i,this.featureAdapter=t;const s=e.outFields;if(s&&!s.includes("*")){this.outFields=s;let e=0;for(const t of s){const s=(0,l.Wq)(t),n=this.fieldsIndex.get(s),r=n?null:(0,l.j4)(s,i),a=n?n.name:(0,l.SY)(t)||"FIELD_EXP_"+e++;this._fieldDataCache.set(t,{alias:a,clause:r})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach(e=>this.getAttributes(e)),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,i){const s=i?i.name:t;let n=null;return this._fieldDataCache.has(s)?n=this._fieldDataCache.get(s)?.clause:i||(n=(0,l.j4)(t,this.fieldsIndex),this._fieldDataCache.set(s,{alias:s,clause:n})),i?this.featureAdapter.getAttribute(e,s):n?.calculateValue(e,this.featureAdapter)}getDataValues(e,t,i=!0){const s=t.normalizationType,n=t.normalizationTotal,r=this.fieldsIndex.get(t.field),a=(0,c.zD)(r)||(0,c.Ah)(r),o=(0,c.OH)(r);return e.map(e=>{let r=t.field&&this.getFieldValue(e,t.field,this.fieldsIndex.get(t.field));if(t.field2?(r=`${(0,h.gJ)(r)}${t.fieldDelimiter}${(0,h.gJ)(this.getFieldValue(e,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(r=`${r}${t.fieldDelimiter}${(0,h.gJ)(this.getFieldValue(e,t.field3,this.fieldsIndex.get(t.field3)))}`)):"string"==typeof r&&i&&(a?r=r?new Date(r).getTime():null:o&&(r=r?(0,d.rb)(r):null)),s&&Number.isFinite(r)){const i="field"===s&&t.normalizationField?this.getFieldValue(e,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;r=(0,h.zS)(r,s,i,n)}return r})}async getExpressionValues(e,t,i,s,n){const{arcadeUtils:r}=await(0,p.l)(),a=r.hasGeometryOperations(t);a&&await r.enableGeometryOperations();const o=r.createFunction(t),l=r.getViewInfo(i),c={fields:this.fieldsIndex.fields};return e.map(e=>{const t={attributes:this.featureAdapter.getAttributes(e),layer:c,geometry:a?{...(0,u.pL)(s.geometryType,s.hasZ,s.hasM,this.featureAdapter.getGeometry(e)),spatialReference:i?.spatialReference}:null},d=r.createExecContext(t,l,n);return r.executeFunction(o,d)})}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,l.j4)(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,l.j4)(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t?.length)return this.featureAdapter.getAttributes(e);const i={};for(const s of t){const{alias:t,clause:n}=this._fieldDataCache.get(s);i[t]=n?n.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,t)}return i}_processAttributesForDistinctValues(e){if(null==e||!this.returnDistinctValues)return e;const t=this.outFields,i=[];if(t)for(const s of t){const{alias:t}=this._fieldDataCache.get(s);i.push(e[t])}else for(const t in e)i.push(e[t]);const s=`${(t||["*"]).join(",")}=${i.join(",")}`;let n=this._returnDistinctMap.get(s)||0;return this._returnDistinctMap.set(s,++n),n>1?null:e}}var f=i(31464),y=i(58727);function g(e,t,i){return{objectId:e,target:t,distance:i,type:"vertex"}}function x(e,t,i,s,n,r=!1){return{objectId:e,target:t,distance:i,type:"edge",start:s,end:n,draped:r}}var F=i(5834),_=i(59977),v=i(57231),w=i(11440),S=i(60909),I=i(98623),T=i(96285);const M="bin";class R{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new m(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:s}=this.query,n=t?.length;if(!n)return 1;const r=new Map,a=new Map,o=new Set;for(const n of s){const{statisticType:s}=n,l="exceedslimit"!==s?n.onStatisticField:void 0;if(!a.has(l)){const i=[];for(const s of t){const t=this._getAttributeValues(e,s,this.items,r);i.push(t)}a.set(l,this._calculateUniqueValues(i,this.items,e.returnDistinctValues))}const u=a.get(l);for(const t in u){const{data:s,items:n}=u[t],r=s.join(",");i&&!e.validateItems(n,i)||o.add(r)}}return o.size}async createQueryResponse(){let e;if(e=this.query.outStatistics?this.query.outStatistics.some(e=>"exceedslimit"===e.statisticType)?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items):this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;(0,o.fn)(this.query.outSR)&&!(0,o.aI)(t.spatialReference,this.query.outSR)?e.queryGeometry=(0,u.ag)({spatialReference:this.query.outSR,...(0,f.Cv)(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=(0,u.ag)({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,i){const s=this.featureAdapter,n=A(this.hasZ,this.hasM),{point:r,mode:a}=e,o="number"==typeof e.distance?e.distance:e.distance.x,l="number"==typeof e.distance?e.distance:e.distance.y,u={candidates:[]},c="esriGeometryPolygon"===this.geometryType,d="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,h=this._getPointCreator(a,t,this.spatialReference,i),p=new C(null,0),m=new C(null,0),f={x:0,y:0,z:0};for(const t of this.items){const i=s.getGeometry(t);if(null==i)continue;const{coords:a}=i,y=i.isPoint?z:i.lengths;if(p.coords=a,m.coords=a,e.returnEdge){let e=0;for(let i=0;i<y.length;i++){const a=y[i],d=e;for(let i=0;i<a;i++,e+=n){if(!c&&i===a-1)continue;const y=p;y.coordsIndex=e;const g=m;g.coordsIndex=i===a-1?d:e+n;const F=f;if(!b(f,r,y,g))continue;const _=(r.x-F.x)/o,v=(r.y-F.y)/l,w=_*_+v*v;w<=1&&u.candidates.push(x(s.getObjectId(t),h(F),Math.sqrt(w),h(y),h(g)))}}}if("all"===e.vertexMode){let e=0;for(let i=0;i<y.length;i++){const a=y[i],d=e,f=m;f.coordsIndex=d;for(let i=0;i<a;i++,e+=n){const n=p;if(n.coordsIndex=e,c&&i===a-1&&n.x===f.x&&n.y===f.y)continue;const d=(r.x-n.x)/o,m=(r.y-n.y)/l,y=d*d+m*m;y<=1&&u.candidates.push(g(s.getObjectId(t),h(n),Math.sqrt(y)))}}}else if(d&&"ends"===e.vertexMode){let e=0;const i=[];for(let t=0;t<y.length;t++){i.push(e);const s=y[t];e+=s*n,!c&&s>1&&i.push(e-n)}for(const e of i){const i=p;i.coordsIndex=e;const n=(r.x-i.x)/o,a=(r.y-i.y)/l,c=n*n+a*a;c<=1&&u.candidates.push(g(s.getObjectId(t),h(i),Math.sqrt(c)))}}}return u.candidates.sort((e,t)=>e.distance-t.distance),u}_getPointCreator(e,t,i,s){const n=null==s||(0,o.aI)(i,s)?e=>e:e=>(0,f.Cv)(e,i,s),{hasZ:r}=this;return"3d"===e?r&&t?({x:e,y:t,z:i})=>n({x:e,y:t,z:i}):({x:e,y:t})=>n({x:e,y:t,z:0}):({x:e,y:t})=>n({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:n,normalizationTotal:r,minValue:a,maxValue:o,scale:l,timeZone:u,outStatisticTypes:d}=e,p=this.fieldsIndex.get(t),m=(0,c.vE)(p)||(0,c.zD)(p)||(0,c.Ah)(p),f=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:n,normalizationTotal:r,scale:l,timeZone:u},this.items),y=(0,h.Vb)({normalizationType:n,normalizationField:s,minValue:a,maxValue:o}),g={value:.5,fieldType:p?.type},x=(0,c.yM)(p)?(0,h.z9)({values:f,supportsNullCount:y,percentileParams:g,outStatisticTypes:d}):(0,h.G_)({values:f,minValue:a,maxValue:o,useSampleStdDev:!n,supportsNullCount:y,percentileParams:g,outStatisticTypes:d});return(0,h.oZ)(x,d,m)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:s,returnAllCodedValues:n,scale:r,timeZone:a}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:r,timeZone:a},this.items,!1),l=(0,h.b3)(o);return(0,h.lv)(l,s,n,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:n,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:d,timeZone:p}=e,m=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:n,normalizationTotal:r,scale:d,timeZone:p},this.items),f=(0,h.Rw)(m,{field:t,normalizationField:s,normalizationType:n,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return(0,h.jM)(f,a)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:n,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:d,timeZone:p}=e,m=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:n,normalizationTotal:r,scale:d,timeZone:p},this.items);return(0,h.$y)(m,{field:t,normalizationField:s,normalizationType:n,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&t?.length)for(const s of t.slice().reverse()){const t=s.split(" "),n=t[0],r=this.fieldsIndex.get(n),a=!!t[1]&&"desc"===t[1].toLowerCase(),o=(0,h.FM)(r?.type,a);e.sort((e,t)=>{const s=i(e,n,r),a=i(t,n,r);return o(s,a)})}}_createFeatureQueryResponse(e){const{items:t,geometryType:i,hasM:s,hasZ:n,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:c,quantizationParameters:d,resultRecordCount:h,resultOffset:p,returnZ:m,returnM:f}=e,y=null!=h&&t.length>(p||0)+h,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(e=>this.fieldsIndex.get(e)));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:i,hasM:s&&f,hasZ:n&&m,objectIdFieldName:r,spatialReference:(0,u.ag)(c||o),transform:d&&(0,a.VV)(d)||null}}_createFeatures(e,t){const i=new m(e,this.featureAdapter,this.fieldsIndex),{hasM:s,hasZ:n}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:c,maxAllowableOffset:d,resultOffset:h,resultRecordCount:p,returnZ:f=!1,returnM:y=!1}=e,g=n&&f,x=s&&y;let F=[],_=0;const v=[...t];if(this._sortFeatures(v,r,(e,t,s)=>i.getFieldValue(e,t,s)),this.geometryType&&(l||c)){const e=(0,a.VV)(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(l&&!c)for(const s of v){const n=this.featureAdapter.getGeometry(s),r=this._addFeatureJSONMetadata(s,{attributes:i.getAttributes(s),geometry:(0,u.pL)(this.geometryType,this.hasZ,this.hasM,n,d,e,g,x)});t&&n&&!r.geometry&&(r.centroid=(0,u.LQ)(this,this.featureAdapter.getCentroid(s,this),e)),F[_++]=r}else if(!l&&c)for(const t of v)F[_++]=this._addFeatureJSONMetadata(t,{attributes:i.getAttributes(t),centroid:(0,u.LQ)(this,this.featureAdapter.getCentroid(t,this),e)});else for(const t of v)F[_++]=this._addFeatureJSONMetadata(t,{attributes:i.getAttributes(t),centroid:(0,u.LQ)(this,this.featureAdapter.getCentroid(t,this),e),geometry:(0,u.pL)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),d,e,g,x)})}else for(const e of v){const t=i.getAttributes(e);t&&(F[_++]=this._addFeatureJSONMetadata(e,{attributes:t}))}const w=h||0;if(null!=p){const e=w+p;F=F.slice(w,Math.min(F.length,e))}return F}_addFeatureJSONMetadata(e,t){const i=this.featureAdapter.getMetadata?.(e);return void 0!==i&&(t.metadata=i),t}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const e of this.query.outStatistics??[])if("exceedslimit"===e.statisticType){t=null!=e.maxPointCount?e.maxPointCount:Number.POSITIVE_INFINITY,i=null!=e.maxRecordCount?e.maxRecordCount:Number.POSITIVE_INFINITY,s=null!=e.maxVertexCount?e.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>i)e=!0;else{const t=A(this.hasZ,this.hasM),i=this.featureAdapter;e=this.items.reduce((e,t)=>{const s=i.getGeometry(t);return e+(null!=s&&s.coords.length||0)},0)/t>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,i={attributes:{}}){const s=[],n=new Map,r=new Map,a=new Map,o=new Map,l=new m(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:d,having:h,orderByFields:p,resultRecordCount:f}=e,y=d?.length,g=!!y,x=g?d[0]:null,F=g&&!this.fieldsIndex.get(x);for(const e of u??[]){const{outStatisticFieldName:u,statisticType:p}=e,m=e,f="exceedslimit"!==p?e.onStatisticField:void 0,_="percentile_disc"===p||"percentile_cont"===p,v="EnvelopeAggregate"===p||"CentroidAggregate"===p||"ConvexHullAggregate"===p,w=g&&1===y&&(f===x||F)&&"count"===p;if(g){if(!a.has(f)){const e=[];for(const i of d){const s=this._getAttributeValues(l,i,t,n);e.push(s)}a.set(f,this._calculateUniqueValues(e,t,!v&&l.returnDistinctValues))}const e=a.get(f);if(!e)continue;const i=Object.keys(e);for(const s of i){const{count:i,data:r,items:a,itemPositions:c}=e[s],p=r.join(",");if(!h||l.validateItems(a,h)){const e=o.get(p)||{attributes:{}};if(v){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:t,outStatisticFieldName:i}=await this._getAggregateGeometry(m,a);e.aggregateGeometries[i]=t}else{let s=null;if(w)s=i;else{const e=this._getAttributeValues(l,f,t,n),i=c.map(t=>e[t]);s=_&&"statisticParameters"in m?this._getPercentileValue(m,i):this._getStatisticValue(m,i,null,l.returnDistinctValues)}e.attributes[u]=s}let s=0;d.forEach((t,i)=>e.attributes[this.fieldsIndex.get(t)?t:"EXPR_"+ ++s]=r[i]),o.set(p,e)}}}else if(v){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(m,t);i.aggregateGeometries[s]=e}else{const e=this._getAttributeValues(l,f,t,n);i.attributes[u]=_&&"statisticParameters"in m?this._getPercentileValue(m,e):this._getStatisticValue(m,e,r,l.returnDistinctValues)}const S="min"!==p&&"max"!==p||!(0,c.yM)(this.fieldsIndex.get(f))&&!this._isAnyDateField(f)?null:this.fieldsIndex.get(f)?.type;s.push({name:u,alias:u,type:S||"esriFieldTypeDouble"})}const _=g?Array.from(o.values()):[i];return this._sortFeatures(_,p,(e,t)=>e.attributes[t]),f&&(_.length=Math.min(f,_.length)),{fields:s,features:_}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return(0,c.vE)(t)||(0,c.zD)(t)||(0,c.Ah)(t)||(0,c.OH)(t)}async _getAggregateGeometry(e,t){const{convexHull:s,union:a}=await Promise.all([i.e(9930),i.e(9940)]).then(i.bind(i,47559)),{statisticType:o,outStatisticFieldName:l}=e,{featureAdapter:c,spatialReference:d,geometryType:h,hasZ:p,hasM:m}=this,f=t.map(e=>(0,u.pL)(h,p,m,c.getGeometry(e))),y=s(d,f,!0)[0],g={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===o){const e=y?(0,r.v)(y):(0,r.HA)(a(d,f));g.aggregateGeometries={...e,spatialReference:d},g.outStatisticFieldName=l||"extent"}else if("CentroidAggregate"===o){const e=y?(0,n.l8)(y):(0,n.Z4)((0,r.HA)(a(d,f)));g.aggregateGeometries={x:e[0],y:e[1],spatialReference:d},g.outStatisticFieldName=l||"centroid"}else"ConvexHullAggregate"===o&&(g.aggregateGeometries=y,g.outStatisticFieldName=l||"convexHull");return g}_getStatisticValue(e,t,i,s){const{onStatisticField:n,statisticType:r}=e;let a=null;return a=i?.has(n)?i.get(n):(0,c.yM)(this.fieldsIndex.get(n))||this._isAnyDateField(n)?(0,h.z9)({values:t,returnDistinct:s}):(0,h.G_)({values:s?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(n,a),a["var"===r?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:s,statisticType:n}=e,{value:r,orderBy:a}=s,o=this.fieldsIndex.get(i);return(0,h.qg)(t,{value:r,orderBy:a,fieldType:o?.type,isDiscrete:"percentile_disc"===n})}_getAttributeValues(e,t,i,s){if(s.has(t))return s.get(t);const n=this.fieldsIndex.get(t),r=i.map(i=>e.getFieldValue(i,t,n));return s.set(t,r),r}_calculateUniqueValues(e,t,i){const s={},n=t.length;for(let r=0;r<n;r++){const n=t[r],a=[];for(const t of e)a.push(t[r]);const o=a.join(",");null==s[o]?s[o]={count:1,data:a,items:[n],itemPositions:[r]}:(i||s[o].count++,s[o].items.push(n),s[o].itemPositions.push(r))}return s}async _getDataValues(e,t,i=!0){const n=new m(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:r,scale:a,timeZone:o}=e;return r?n.getExpressionValues(t,r,{viewingMode:"map",scale:a,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):n.getDataValues(t,(0,s.o8)(e),i)}_calculateHistogramBins(e,t,i){if(null==t.min&&null==t.max)return[];const s=t.intervals,n=t.min??0,r=t.max??0,a=s.map(([e,t])=>({minValue:e,maxValue:t,count:0,items:[]}));for(let t=0;t<e.length;t++){const o=e[t],l=i[t];if(null!=o&&o>=n&&o<=r){const e=(0,h.Ak)(s,o);e>-1&&(a[e].count++,a[e].items.push(l))}}return a}async createQueryBinsResponse(e){const t=e.bin?.splitBy;if(!t)return this._createBinsResponse(e);const{value:i,outAlias:s,valueType:n}=t,r=[],a=[{name:s??i,alias:s??i,type:n??"esriFieldTypeString"},{name:M,alias:M,type:"esriFieldTypeInteger"}],o=new m(e,this.featureAdapter,this.fieldsIndex),l=new Map,u=[...this.items];this._sortFeatures(u,[i],(e,t,i)=>o.getFieldValue(e,t,i));const c=this._getAttributeValues(o,i,u,l),d=this._calculateUniqueValues([c],u,o.returnDistinctValues);for(const t in d){const{items:n}=d[t],o=await this._createBinsResponse(e,n);if(r.push(...o.features.map(e=>({...e,attributes:{...e.attributes,[s??i]:t}}))),o.fields)for(const e of o.fields)a.some(t=>t.name===e.name)||a.push(e)}return{fields:a,features:r}}async _createBinsResponse(e,t){const i=e.bin;switch(t=t??this.items,i.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(F.A.fromJSON(i),e,t);case"dateBin":return this._createDateBinsResponse(_.A.fromJSON(i),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(w.A.fromJSON(i),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(S.A.fromJSON(i),e,t)}}async _createAutoIntervalBinsResponse(e,t,i){const{field:s,normalizationField:n,numBins:r,normalizationType:a,normalizationTotal:o,start:l,end:u}=e,c=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),d=(0,h.sU)(c,{field:s,normalizationField:n,normalizationType:a,normalizationTotal:o,numBins:r,minValue:(0,y.dO)(l,!1),maxValue:(0,y.dO)(u,!1)}),p=this._calculateHistogramBins(c,d,i);return this._createFeaturesFromHistogramBins(p,t)}async _createDateBinsResponse(e,t,i){const{field:s,interval:n,start:r,end:a,snapToData:o,returnFullIntervalBin:l}=e,u=n.unit,d=await this._getDataValues({field:e.field,timeZone:t.outTimeReference?.ianaTimeZone},i),h=(0,c.OH)(this.fieldsIndex.get(s)),p=v.g.toJSON(u),m=d.filter(Boolean).sort((e,t)=>e-t),f=null!=r?(0,y.dO)(r,h):m[0],g=null!=a?(0,y.dO)(a,h):m[m.length-1],x={zone:t.outTimeReference?.ianaTimeZone??I.n$},F=T.c9.fromMillis(f,x),_=T.c9.fromMillis(g,x),w=[];if("last"===o){let e=_;for(;e>F;){const t=e.minus({[p]:n.value});if(t<F){w.unshift([l?t.toMillis():F.toMillis(),e.toMillis()]);break}w.unshift([t.toMillis(),e.toMillis()]),e=t}}else{let e="first"===o?F:F.startOf(p);for(;e<=_;){const t=e.plus({[p]:n.value});if(t>_){w.push([e.toMillis(),l?t.toMillis():_.toMillis()]);break}w.push([e.toMillis(),t.toMillis()]),e=t}}const S=this._calculateHistogramBins(d,{intervals:w,min:f,max:g},i);return this._createFeaturesFromHistogramBins(S,t)}async _createFixedBoundariesBinsResponse(e,t,i){const{field:s}=e,n=await this._getDataValues({field:s,timeZone:t.outTimeReference?.ianaTimeZone},i),r=(0,c.OH)(this.fieldsIndex.get(s)),a=e.boundaries.map(e=>(0,y.dO)(e,r)).sort((e,t)=>e-t),o=[];for(let e=0;e<a.length-1;e++)o.push([a[e],a[e+1]]);const l={intervals:o,min:a.at(0),max:a.at(-1)},u=this._calculateHistogramBins(n,l,i);return this._createFeaturesFromHistogramBins(u,t)}async _createFixedIntervalBinsResponse(e,t,i){const{field:s,interval:n,start:r,end:a}=e,o=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),l=(0,c.OH)(this.fieldsIndex.get(s)),u=(0,h.sU)(o,{field:s,classificationMethod:"defined-interval",definedInterval:n,minValue:(0,y.dO)(r,l),maxValue:(0,y.dO)(a,l)},!0),d=this._calculateHistogramBins(o,u,i);return this._createFeaturesFromHistogramBins(d,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:i,lowerBoundaryAlias:s}=t,n=s||"lowerBoundary",r=i||"upperBoundary",a=[],o=[{name:n,alias:n,type:"esriFieldTypeDouble"},{name:r,alias:r,type:"esriFieldTypeDouble"}],l=t.bin?.stackBy?.value,u=t.bin?.stackBy?.outAlias;l&&o.push({name:M,alias:M,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;const d="dateBin"===t.bin.type,h=t.outTimeReference?.ianaTimeZone;for(const i of e){const{minValue:e,maxValue:s,items:p}=i,m={attributes:{}};let f;if(m.attributes[n]=d&&h&&null!=e?T.c9.fromMillis(e,{zone:h}).toISO():e,m.attributes[r]=d&&h&&null!=s?T.c9.fromMillis(s,{zone:h}).toISO():s,l?(f=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},p),m.attributes[M]=++c,"flat"===t.bin.jsonStyle?a.push(...f.features.map(({attributes:{EXPR_1:e,...t},...i})=>({...i,attributes:u??e?{...t,[u??e]:e,...m.attributes}:{...t,...m.attributes}}))):(m.stackedAttributes=f.features.map(({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t),a.push(m))):(t.bin?.splitBy&&(m.attributes[M]=++c),f=await this._createStatisticsQueryResponse(t,p,m),a.push(m)),f.fields)for(const e of f.fields)o.some(t=>t.name===e.name)||o.push(e)}return"desc"===t.binOrder&&a.reverse(),{fields:o,features:a}}}function b(e,t,i,s){const n=s.x-i.x,r=s.y-i.y,a=t.x-i.x,o=t.y-i.y,l=n*n+r*r;if(0===l)return!1;const u=a*n+o*r,c=Math.min(1,Math.max(0,u/l));return e.x=i.x+n*c,e.y=i.y+r*c,!0}function A(e,t){return e?t?4:3:t?3:2}class C{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const z=[1]},9093:(e,t,i)=>{function s(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function n(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}i.d(t,{o8:()=>n,vt:()=>s,zK:()=>r});const r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:r,clone:n,create:s,fromValues:function(e,t,i,s,n,r,a,o,l,u,c,d,h,p,m,f){return[e,t,i,s,n,r,a,o,l,u,c,d,h,p,m,f]}},Symbol.toStringTag,{value:"Module"}))},11006:(e,t,i)=>{function s(e,t,i,s,r){n(e,t,i||0,s||e.length-1,r||a)}function n(e,t,i,s,a){for(;s>i;){if(s-i>600){var o=s-i+1,l=t-i+1,u=Math.log(o),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(o-c)/o)*(l-o/2<0?-1:1);n(e,t,Math.max(i,Math.floor(t-l*c/o+d)),Math.min(s,Math.floor(t+(o-l)*c/o+d)),a)}var h=e[t],p=i,m=s;for(r(e,i,t),a(e[s],h)>0&&r(e,i,s);p<m;){for(r(e,p,m),p++,m--;a(e[p],h)<0;)p++;for(;a(e[m],h)>0;)m--}0===a(e[i],h)?r(e,i,m):r(e,++m,s),m<=t&&(i=m+1),t<=m&&(s=m-1)}}function r(e,t,i){var s=e[t];e[t]=e[i],e[i]=s}function a(e,t){return e<t?-1:e>t?1:0}i.d(t,{q:()=>s})},11440:(e,t,i)=>{i.d(t,{A:()=>c});var s=i(31635),n=i(93637),r=i(10107),a=i(56507),o=(i(44208),i(87811),i(93223)),l=i(40608),u=i(41266);let c=class extends u.A{constructor(e){super(e),this.boundaries=[],this.type="fixed-boundaries"}};(0,s.Cg)([(0,r.MZ)({json:{name:"parameters.boundaries",write:{writer:function(e,t,i){(0,n.sM)(i,e&&function(e){return e[0]instanceof Date}(e)?e.map(e=>e.getTime()):e,t)}}}})],c.prototype,"boundaries",void 0),(0,s.Cg)([(0,o.e)({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],c.prototype,"type",void 0),c=(0,s.Cg)([(0,l.$)("esri.rest.support.FixedBoundariesBinParameters")],c),c.from=(0,a.dp)(c)},17136:(e,t,i)=>{i.d(t,{Y_:()=>R,O7:()=>T,el:()=>I});var s=i(92602),n=i(69052),r=i(49186),a=i(53966),o=i(39829),l=i(82799),u=i(16930),c=i(80754),d=i(21325),h=i(28735),p=i(78888),m=i(65864),f=i(2272),y=i(84952),g=i(92300);const x=()=>a.A.getLogger("esri.geometry.support.normalizeUtils");function F(e){return"polygon"===e[0].type}function _(e){return"polyline"===e[0].type}function v(e,t,i){if(t){const t=function(e,t){if(!(e instanceof l.A||e instanceof o.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw x().error(e),new r.A("internal:geometry",e)}const i=(0,c.r8)(e),s=[];for(const e of i){const i=[];s.push(i),i.push([e[0][0],e[0][1]]);for(let s=0;s<e.length-1;s++){const n=e[s][0],r=e[s][1],a=e[s+1][0],o=e[s+1][1],l=Math.sqrt((a-n)*(a-n)+(o-r)*(o-r)),u=(o-r)/l,c=(a-n)/l,d=l/t;if(d>1){for(let e=1;e<=d-1;e++){const s=e*t,a=c*s+n,o=u*s+r;i.push([a,o])}const e=(l+Math.floor(d-1)*t)/2,s=c*e+n,a=u*e+r;i.push([s,a])}i.push([a,o])}}return function(e){return"polygon"===e.type}(e)?new o.A({rings:s,spatialReference:e.spatialReference}):new l.A({paths:s,spatialReference:e.spatialReference})}(e,1e6);e=(0,h.ci)(t,!0)}return i&&(e=(0,c.kS)(e,i)),e}function w(e,t,i){if(Array.isArray(e)){const s=e[0];if(s>t){const i=(0,c.kd)(s,t);e[0]=s+i*(-2*t)}else if(s<i){const t=(0,c.kd)(s,i);e[0]=s+t*(-2*i)}}else{const s=e.x;if(s>t){const i=(0,c.kd)(s,t);e=e.clone().offset(i*(-2*t),0)}else if(s<i){const t=(0,c.kd)(s,i);e=e.clone().offset(t*(-2*i),0)}}return e}function S(e,t){let i=-1;for(let s=0;s<t.cutIndexes.length;s++){const n=t.cutIndexes[s],r=t.geometries[s],a=(0,c.r8)(r);for(let e=0;e<a.length;e++){const t=a[e];t.some(i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const s=t[e][0];i=s>i?s:i}i=Number(i.toFixed(9));const s=-360*(0,c.kd)(i,180);for(let i=0;i<t.length;i++){const t=r.getPoint(e,i);r.setPoint(e,i,t.clone().offset(s,0))}return!0}})}if(n===i){if(F(e))for(const t of(0,c.r8)(r))e[n]=e[n].addRing(t);else if(_(e))for(const t of(0,c.r8)(r))e[n]=e[n].addPath(t)}else i=n,e[n]=r}return e}async function I(e,t,i){if(!Array.isArray(e))return I([e],t);t&&"string"!=typeof t&&x().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??s.A.geometryServiceUrl;let r,a,u,F,_,T,M,R,b=0;const A=[],C=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,a=(0,d.Vp)(r),u=r.isWebMercator,T=u?102100:4326,F=c.j7[T].maxX,_=c.j7[T].minX,M=c.j7[T].plus180Line,R=c.j7[T].minus180Line),a)if("mesh"===t.type)C.push(t);else if("point"===t.type)C.push(w(t.clone(),F,_));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>w(e,F,_)),C.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,a);C.push(e.rings?new o.A(e):e)}else if(t.extent){const e=t.extent,i=(0,c.kd)(e.xmin,_)*(2*F);let s=0===i?t.clone():(0,c.kS)(t.clone(),i);e.offset(i,0);let{xmin:n,xmax:r}=e;n=Number(n.toFixed(9)),r=Number(r.toFixed(9)),e.intersects(M)&&r!==F?(b=r>b?r:b,s=v(s,u),A.push(s),C.push("cut")):e.intersects(R)&&n!==_?(b=r*(2*F)>b?r*(2*F):b,s=v(s,u,360),A.push(s),C.push("cut")):C.push(s)}else C.push(t.clone());else C.push(t);else C.push(t);let z=(0,c.kd)(b,F),B=-90;const N=z,G=new l.A;for(;z>0;){const e=360*z-180;G.addPath([[e,B],[e,-1*B]]),B*=-1,z--}if(A.length>0&&N>0){const t=S(A,await async function(e,t,i,s){const n=(0,f.Dl)(e),r=t[0].spatialReference,a={...s,responseType:"json",query:{...n.query,f:"json",sr:(0,d.YX)(r),target:JSON.stringify({geometryType:(0,m.$B)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},o=await(0,p.A)(n.path+"/cut",a),{cutIndexes:l,geometries:u=[]}=o.data;return{cutIndexes:l,geometries:u.map(e=>{const t=(0,m.rS)(e);return t.spatialReference=r,t})}}(n,A,G,i)),s=[],r=[];for(let i=0;i<C.length;i++){const n=C[i];if("cut"!==n)r.push(n);else{const n=t.shift(),a=e[i];null!=a&&"polygon"===a.type&&a.rings&&a.rings.length>1&&n.rings.length>=a.rings.length?(s.push(n),r.push("simplify")):r.push(u?(0,h.Gh)(n):n)}}if(!s.length)return r;const a=await async function(e,t,i){const s="string"==typeof e?(0,y.An)(e):e,n=t[0].spatialReference,r=(0,m.$B)(t[0]),a={...i,query:{...s.query,f:"json",sr:(0,d.YX)(n),geometries:JSON.stringify((0,g.X)(t))}},{data:o}=await(0,p.A)(s.path+"/simplify",a);return(0,g.V)(o.geometries,r,n)}(n,s,i),o=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?o.push(t):o.push(u?(0,h.Gh)(a.shift()):a.shift())}return o}const E=[];for(let e=0;e<C.length;e++){const t=C[e];if("cut"!==t)E.push(t);else{const e=A.shift();E.push(!0===u?(0,h.Gh)(e):e)}}return E}function T(e,t,i){const s=(0,d.Vp)(i);if(null==s)return e;const[n,r]=s.valid,a=2*r;let o=0,l=0;t>r?o=Math.ceil(Math.abs(t-r)/a):t<n&&(o=-Math.ceil(Math.abs(t-n)/a)),e>r?l=Math.ceil(Math.abs(e-r)/a):e<n&&(l=-Math.ceil(Math.abs(e-n)/a));let u=e+(o-l)*a;const c=u-t;return c>r?u-=a:c<n&&(u+=a),u}function M(e){const t=(0,d.Vp)(e);if(null==t)return null;const[i,s]=t.valid;return new n.hr(i,s)}const R=M(u.A.WGS84);M(u.A.WebMercator)},29441:(e,t,i)=>{i.d(t,{MG:()=>x,SN:()=>p,SY:()=>g,VW:()=>c,Wq:()=>y,eD:()=>m,j4:()=>f,vl:()=>u});var s=i(49186),n=i(44123),r=i(98453);const a=new n.WhereClauseCache(50,500),o="unsupported-query",l=" as ",u=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),c=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),d=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...u,...c]);function h(e,t,i={}){const n=f(t,e);if(!n){const i=a.getError(t,e);throw new s.A(o,"invalid SQL expression",{expression:t,error:i})}const r=i.expressionName||"expression";if(i.validateStandardized&&!n.isStandardized)throw new s.A(o,`${r} is not standard`,{expression:t});if(i.validateAggregate&&!n.isAggregate)throw new s.A(o,`${r} does not contain a valid aggregate function`,{expression:t});return n.fieldNames}function p(e,t,i,s){if(!i)return!0;const n="where clause";return x(e,t,h(e,i,{validateStandardized:!0,expressionName:n}),{expressionName:n,query:s}),!0}function m(e,t,i,n,r){if(!i)return!0;const a="having clause",l=h(e,i,{validateAggregate:!0,expressionName:a});x(e,t,l,{expressionName:a,query:r});const u=f(i,e),c=u?.getExpressions().every(t=>{const{aggregateType:i,field:s}=t,r=e.get(s)?.name;return n.some(t=>{const{onStatisticField:s,statisticType:n}=t,a=e.get(s)?.name;return a===r&&n.toLowerCase().trim()===i})});if(!c)throw new s.A(o,"expressions in having clause should also exist in outStatistics",{having:i});return!0}function f(e,t){return e?a.get(e,t):null}function y(e){return/\((.*?)\)/.test(e)?e:e.split(l)[0]}function g(e){return e.split(l)[1]}function x(e,t,i,n={}){const r=new Map;if(function(e,t,i,s,n){const r=n.includes("*")?[...i,...n.filter(e=>"*"!==e)]:n;for(const n of r)if(t.get(n))F(e,t,i,s,n);else try{const r=h(t,y(n),{validateStandardized:!0});for(const n of r)F(e,t,i,s,n)}catch(t){e.set(n,{type:"expression-error",expression:n,error:t})}}(r,e,t,n.allowedFieldTypes??d,i),r.size){const e=n.expressionName??"expression";throw new s.A(o,`${e} contains invalid or missing fields`,{errors:Array.from(r.values()),query:n.query})}}function F(e,t,i,s,n){const a=t.get(n);a?i.has(a.name)?"all"!==s&&!1===s?.has(a.type)&&e.set(n,{type:"invalid-type",fieldName:a.name,fieldType:r.m.fromJSON(a.type),allowedFieldTypes:Array.from(s,e=>r.m.fromJSON(e))}):e.set(n,{type:"missing-field",fieldName:a.name}):e.set(n,{type:"invalid-field",fieldName:n})}},31464:(e,t,i)=>{i.d(t,{Cv:()=>y,Nk:()=>p,lK:()=>x});var s=i(4576),n=i(74887),r=i(98988),a=i(7320),o=i(21325),l=i(28735);const u=[0,0];function c(e,t){if(!t)return null;if("x"in t){const i={x:0,y:0};return[i.x,i.y]=e(t.x,t.y,u),null!=t.z&&(i.z=t.z),null!=t.m&&(i.m=t.m),i}if("xmin"in t){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=e(t.xmin,t.ymin,u),[i.xmax,i.ymax]=e(t.xmax,t.ymax,u),t.hasZ&&(i.zmin=t.zmin,i.zmax=t.zmax,i.hasZ=!0),t.hasM&&(i.mmin=t.mmin,i.mmax=t.mmax,i.hasM=!0),i}return"rings"in t?{rings:d(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:d(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:h(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function d(e,t){const i=[];for(const s of e)i.push(h(s,t));return i}function h(e,t){const i=[];for(const s of e){const e=t(s[0],s[1],[0,0]);i.push(e),s.length>2&&e.push(s[2]),s.length>3&&e.push(s[3])}return i}async function p(e,t){if(!e||!t)return;const i=Array.isArray(e)?e.map(e=>null!=e.geometry?e.geometry.spatialReference:null).filter(s.Ru):[e];await(0,r.initializeProjection)(i.map(e=>({source:e,dest:t})))}const m=c.bind(null,l.je),f=c.bind(null,l.tD);function y(e,t,i,s){if(!e)return null;if(i||(i=t,t=e.spatialReference),!(0,o.fn)(t)||!(0,o.fn)(i)||(0,o.aI)(t,i))return e;if((0,l.y7)(t,i)){const t=(0,o.K8)(i)?m(e):f(e);return t.spatialReference=i,t}return(0,r.projectMany)(a.g,[e],t,i,null,s)[0]}const g=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,i,s){if(!e?.length||!t||!i||(0,o.aI)(t,i))return e;const r={geometries:e,inSpatialReference:t,outSpatialReference:i,geographicTransformation:s,resolve:(0,n.Tw)()};return this._jobs.push(r),this._timer??=setTimeout(this._process,10),r.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:i,outSpatialReference:s,resolve:n,geographicTransformation:u}=e;(0,l.y7)(i,s)?(0,o.K8)(s)?n(t.map(m)):n(t.map(f)):n((0,r.projectMany)(a.g,t,i,s,u,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function x(e,t,i,s){return g.push(e,t,i,s)}},41266:(e,t,i)=>{i.d(t,{A:()=>y});var s=i(31635),n=i(69540),r=i(66552),a=i(25482),o=i(10107),l=(i(44208),i(53966),i(87811),i(93223)),u=i(40608),c=i(56507);const d=new r.J({esriFieldTypeInteger:"integer",esriFieldTypeString:"string"});let h=class extends((0,n.OU)(a.o)){constructor(e){super(e),this.alias=null,this.responseType=null,this.type=null,this.value=null,this.valueType=null}};(0,s.Cg)([(0,o.MZ)({type:String,json:{name:"outAlias",write:!0}})],h.prototype,"alias",void 0),(0,s.Cg)([(0,o.MZ)({type:String})],h.prototype,"responseType",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],h.prototype,"type",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],h.prototype,"value",void 0),(0,s.Cg)([(0,l.e)(d)],h.prototype,"valueType",void 0),h=(0,s.Cg)([(0,u.$)("esri.rest.support.AttributeBinsGrouping")],h);const p=h;h.from=(0,c.dp)(h);const m=new r.J({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeDate:"date",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"}),f=new r.J({naturalLog:"natural-log",squareRoot:"square-root"});let y=class extends((0,n.OU)(a.o)){constructor(e){super(e),this.expression=null,this.expressionValueType=null,this.field=null,this.firstDayOfWeek=null,this.hideUpperBound=null,this.splitBy=null,this.stackBy=null,this.transformation=null}};(0,s.Cg)([(0,o.MZ)({type:String,json:{name:"onExpression.value",write:!0}})],y.prototype,"expression",void 0),(0,s.Cg)([(0,l.e)(m,{name:"onExpression.valueType"})],y.prototype,"expressionValueType",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{name:"onField",write:!0}})],y.prototype,"field",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"firstDayOfWeek",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"hideUpperBound",void 0),(0,s.Cg)([(0,o.MZ)({type:p,json:{write:{overridePolicy(){return{enabled:null!=this.splitBy?.value||null!=this.splitBy?.type}}}}})],y.prototype,"splitBy",void 0),(0,s.Cg)([(0,o.MZ)({type:p,json:{write:{target:{stackBy:{type:p},jsonStyle:{type:String}},writer:(e,t)=>{e&&(t.stackBy=e.toJSON(),null!=e.responseType&&(t.jsonStyle=e.responseType))},overridePolicy(){return{enabled:null!=this.stackBy?.value||null!=this.stackBy?.type}}},read:{source:["stackBy","jsonStyle"],reader:(e,t)=>p.fromJSON({...t.stackBy,responseType:t.jsonStyle})}}})],y.prototype,"stackBy",void 0),(0,s.Cg)([(0,l.e)(f)],y.prototype,"transformation",void 0),y=(0,s.Cg)([(0,u.$)("esri.rest.support.BinParametersBase")],y)},41366:(e,t,i)=>{i.d(t,{K:()=>h,Q:()=>u});var s=i(31635),n=i(66552),r=i(53966),a=i(10107),o=(i(44208),i(87811),i(93223)),l=i(40608);const u=(0,n.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),c="percent-of-total",d="field",h=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=null!=this.normalizationTotal;return t||i?(e=t&&d||i&&c||null,t&&i&&r.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==d&&e!==c||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,s.Cg)([(0,a.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],i.prototype,"normalizationField",void 0),(0,s.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],i.prototype,"normalizationMaxValue",void 0),(0,s.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],i.prototype,"normalizationMinValue",void 0),(0,s.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],i.prototype,"normalizationTotal",void 0),(0,s.Cg)([(0,o.e)(u,{name:"parameters.normalizationType"})],i.prototype,"normalizationType",null),i=(0,s.Cg)([(0,l.$)("esri.rest.support.NormalizationBinParametersMixin")],i),i}},44123:(e,t,i)=>{i.r(t),i.d(t,{WhereClauseCache:()=>r});var s=i(66344),n=i(88368);class r{constructor(e,t){this._cache=new s.q(e),this._invalidCache=new s.q(t)}get(e,t){const i=`${t?.uid}:${e}`,s=this._cache.get(i);if(s)return s;if(null!=this._invalidCache.get(i))return null;try{const s=n.A.create(e,{fieldsIndex:t});return this._cache.put(i,s),s}catch(e){return this._invalidCache.put(i,e),null}}getError(e,t){const i=`${t?.uid}:${e}`;return this._invalidCache.get(i)??null}}},44794:(e,t,i)=>{i.d(t,{v:()=>o});var s=i(4718),n=i(62788),r=i(95488);class a{constructor(e,t){this._observable=new r.I,this._value=e,this._equalityFunction=t}get value(){return(0,n.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function o(e,t=s.gh){return new a(e,t)}},51441:(e,t,i)=>{i.d(t,{LQ:()=>u,ag:()=>d,pL:()=>c});var s=i(90708),n=i(92722);const r=new n.A,a=new n.A,o=new n.A,l={esriGeometryPoint:s.DF,esriGeometryPolyline:s.BW,esriGeometryPolygon:s.z5,esriGeometryMultipoint:s.qK};function u(e,t,i,n=e.hasZ,r=e.hasM){if(null==t)return null;const a=e.hasZ&&n,l=e.hasM&&r;if(i){const u=(0,s.Nl)(o,t,e.hasZ,e.hasM,"esriGeometryPoint",i,n,r);return(0,s.DF)(u,a,l)}return(0,s.DF)(t,a,l)}function c(e,t,i,n,u,c,d=t,h=i){const p=t&&d,m=i&&h,f=null!=n?"coords"in n?n:n.geometry:null;if(null==f)return null;if(u){let n=(0,s.kz)(a,f,t,i,e,u,d,h);return c&&(n=(0,s.Nl)(o,n,p,m,e,c)),l[e]?.(n,p,m)??null}if(c){const n=(0,s.Nl)(o,f,t,i,e,c,d,h);return l[e]?.(n,p,m)??null}return(0,s.Q4)(r,f,t,i,d,h),l[e]?.(r,p,m)??null}function d(e){return e&&h in e?JSON.parse(JSON.stringify(e,p)):e}const h="_geVersion",p=(e,t)=>e===h?void 0:t},54339:(e,t,i)=>{function s(e,t){switch(t.type){case"object-id":case"unique-id-simple":return e.attributes[t.fieldName];case"unique-id-composite":{const i=[];for(const s of t.fieldNames)i.push(e.attributes[s]??null);return JSON.stringify(i)}}}function n(e,t){if("uniqueIdFields"in t&&t.uniqueIdFields?.length){if(1===t.uniqueIdFields.length)return e.attributes?.[t.uniqueIdFields[0]];const i=t.uniqueIdFields.map(t=>e.attributes?.[t]);return JSON.stringify(i)}return"objectIdField"in t&&t.objectIdField?e.attributes?.[t.objectIdField]:null}i.d(t,{W:()=>s,r:()=>n})},56390:(e,t,i)=>{i.d(t,{do:()=>L,Wc:()=>U});var s=i(4576),n=i(21818),r=i(49186),a=(i(44208),i(4718)),o=i(97768),l=i(74887),u=i(83047),c=i(12195),d=i(98988),h=i(70328),p=i(19419),m=i(6606),f=i(65864),y=i(17136),g=i(21325),x=i(90708),F=i(29441),_=i(51441),v=i(31464);class w{constructor(){this._storage=new Map,this._purgeInterval=5,this._sweep=()=>{if(this._timer=void 0,!this._storage)return;const e=1e3*this._purgeInterval,t=performance.now()-e;for(const[i,s]of this._storage){if(!(s.time<t))return void(this._storage.size>0&&(this._timer=setTimeout(this._sweep,e)));this._storage.delete(i)}}}destroy(){this._storage?.clear(),this._storage=null,clearTimeout(this._timer)}put(e,t){this._storage?.set(e,new I(t)),this._scheduleSweep()}get(e){const t=this._storage?.get(e);if(t)return this._storage?.delete(e),t.time=performance.now(),this._storage?.set(e,t),t.items}clear(){this._storage?.clear()}_scheduleSweep(){this._storage&&(this._timer??=setTimeout(this._sweep,1e3*this._purgeInterval))}get test(){}}let S=0;class I{constructor(e){this.items=e,this.time=performance.now(),this.id=S++}}var T=i(99352),M=i(8384),R=i(58727),b=i(62660),A=i(43668);const C="unsupported-query";async function z(e,{fieldsIndex:t,geometryType:i,spatialReference:s,availableFields:n}){if(null!=e.geometryPrecision||e.multipatchOption&&"xyFootprint"!==e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new r.A(C,"Unsupported query options",{query:e});return B(t,n,e),function(e,t,i){const{outStatistics:s,groupByFieldsForStatistics:n,having:a}=i,o=n?.length,l=s?.length;if(a){if(!o||!l)throw new r.A(C,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:i});(0,F.eD)(e,t,a,s,i)}if(l){if(null==(u=s)||!u.every(e=>"exceedslimit"!==e.statisticType))return;const a=s.map(e=>e.onStatisticField).filter(Boolean);(0,F.MG)(e,t,a,{expressionName:"onStatisticFields",query:i}),o&&(0,F.MG)(e,t,n,{expressionName:"groupByFieldsForStatistics",query:i});for(const n of s){const{onStatisticField:s,statisticType:a}=n;if("percentile_disc"!==a&&"percentile_cont"!==a||!("statisticParameters"in n))e.get(s)&&"count"!==a&&"min"!==a&&"max"!==a&&(0,F.MG)(e,t,[s],{expressionName:`outStatistics with '${a}' statistic type`,allowedFieldTypes:N,query:i});else{const{statisticParameters:e}=n;if(!e)throw new r.A(C,"statisticParameters should be set for percentile type",{definition:n,query:i})}}}var u}(t,n,e),Promise.all([(0,b.c0)(e,i,s),(0,v.Nk)(s,e.outSR)]).then(()=>e)}function B(e,t,i){const{returnDistinctValues:s,outStatistics:n}=i,a=n?n.map(e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if("orderByFields"in i&&i.orderByFields&&i.orderByFields.length>0){const s=" asc",n=" desc",r=i.orderByFields.map(e=>{const t=e.toLowerCase();return t.includes(s)?t.split(s)[0]:t.includes(n)?t.split(n)[0]:e}).filter(e=>!a.includes(e));(0,F.MG)(e,t,r,{expressionName:"orderByFields",query:i})}if("outFields"in i)if(i.outFields?.length)(0,F.MG)(e,t,i.outFields,{expressionName:"outFields",query:i,allowedFieldTypes:"all"});else if(s)throw new r.A(C,"outFields should be specified for returnDistinctValues",{query:i});(0,F.SN)(e,t,i.where,i)}const N=new Set([...F.vl,...F.VW]);async function G(e,t,i,s){let n=[];if(i.valueExpression){const{arcadeUtils:e}=await(0,A.l)();n=e.extractFieldNames(i.valueExpression)}if(i.field&&n.push(i.field),i.field2&&n.push(i.field2),i.field3&&n.push(i.field3),i.normalizationField&&n.push(i.normalizationField),!n.length&&!i.valueExpression)throw new r.A(C,"field or valueExpression is required",{params:i});(0,F.MG)(e,t,n,{expressionName:"statistics",query:s})}var E=i(86420),q=i(95466),O=(i(53966),i(36708),i(44794),i(78659)),P=i(31635),D=i(65008),Z=i(10107),V=(i(87811),i(40608));let Q=class extends D.A{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,P.Cg)([(0,Z.MZ)()],Q.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,P.Cg)([(0,Z.MZ)()],Q.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),Q=(0,P.Cg)([(0,V.$)("esri.views.support.debugFlags")],Q),new Q,Symbol("Yield");new Map([["immediate",0],["schedule",4],["slide",0],["stream loader",0],["elevation query",0],["terrain",1],["surface geometry updates",1],["LoD renderer",2],["Graphics3D",2],["I3S",2],["point cloud",2],["feature fetcher",2],["stream controller",2],["clouds generator",2],["overlay",4],["overlay renderer",4],["stage",4],["graphics deconflictor",4],["Graphics3D filter visibility",4],["Graphics3D scale visibility",4],["Graphics3D frustum visibility",4],["POI frequent",6],["POI infrequent",30],["labeler",8],["feature query",8],["feature tile tree",16],["fast feature tile tree",0],["elevation alignment",12],["elevation alignment scene",14],["text texture atlas",12],["texture unload",12],["line of sight tool",16],["interactive line of sight tool",0],["snapping",0],["shadow accumulator",30],["flow generator",12],["mapview fetch queue",0],["mapview layerview update",2],["mapview vector tile parsing queue",0]]),(0,O.l5)(6.5),(0,O.l5)(1),(0,O.l5)(30),(0,O.l5)(1e3/30),(0,O.l5)(100);const j=new class{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}};j.enabled=!1;const k=new class{remove(){}processQueue(){}schedule(e,t,i){try{if((0,l.G4)(t)){const e=(0,l.NK)();return i?Promise.resolve(i(e)):Promise.reject(e)}return(0,l.z7)(e(j))}catch(e){return Promise.reject(e)}}reschedule(e,t,i){return this.schedule(e,t,i)}async scheduleGenerator(e,t,i){if((0,l.G4)(t)){const e=(0,l.NK)();if(i)return i(e);throw e}const s=e(j);for(;;){const e=s.next(j),n=(0,l.$X)(e)?await e:e;if((0,l.G4)(t)){const e=(0,l.NK)();if(i){const t=i(e);return s.return(null),t}throw s.throw(e),e}if(n.done)return n.value}}};class L{constructor(e){this._changeHandle=null,this.capabilities={query:T.F},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._cache=e.cache??new w,this.timeInfo=e.timeInfo,this.featureIdInfo=e.featureIdInfo,"object-id"===e.featureIdInfo.type&&(this.objectIdField=e.featureIdInfo.fieldName),this._changeHandle=this.featureStore.events.on("changed",()=>this._clearCache()),this.fieldsIndex=(0,c.W)(e.fieldsIndex)?e.fieldsIndex:q.A.fromJSON(e.fieldsIndex),!e.availableFields||1===e.availableFields.length&&"*"===e.availableFields[0]?this.availableFields=new Set(this.fieldsIndex.fields.map(e=>e.name)):this.availableFields=new Set(e.availableFields.map(e=>this.fieldsIndex.get(e)?.name).filter(e=>null!=e)),e.scheduler&&e.priority?this._frameTask=e.scheduler.registerTask(e.priority):this._frameTask=k}destroy(){this._changeHandle=(0,o.xt)(this._changeHandle),this._frameTask=(0,o.xt)(this._frameTask),this._clearCache(),(0,o.pR)(this._cache)}get featureAdapter(){return this.featureStore.featureAdapter}async executeQuery(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryFeatureSet(e),i)}async executeQueryForCount(e={},t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForCount(e),i)}async executeQueryForExtent(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForExtent(e),i)}async executeQueryForIds(e,t){return Array.from(await this.executeQueryForIdSet(e,t))}async executeQueryForIdSet(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForIdSet(e),i)}async executeQueryForLatestObservations(e,t){const i=(0,l.Mq)(t);if(!this.timeInfo?.trackIdField)throw new r.A("unsupported-query","Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});return await this._frameTask.scheduleGenerator(()=>this._executeQueryForLatestObservations(e),i)}async executeQueryForOpaqueFeatures(e,t){const i=(0,l.Mq)(t);return(await this._frameTask.scheduleGenerator(()=>this._executeQuery(e,{}),i)).items}async executeAttributeBinsQuery(e,t){const i=(0,l.Mq)(t);return e=(0,a.o8)(e),await this._frameTask.scheduleGenerator(()=>this._executeAttributeBinsQuery(e),i)}async executeQueryForSummaryStatistics(e={},t,i){const s=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForSummaryStatistics(e,t),s)}async executeQueryForUniqueValues(e={},t,i){const s=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForUniqueValues(e,t),s)}async executeQueryForClassBreaks(e={},t,i){const s=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForClassBreaks(e,t),s)}async executeQueryForHistogram(e={},t,i){const s=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForHistogram(e,t),s)}async executeQueryForSnapping(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForSnapping(e,i),i)}async fetchRecomputedExtents(e){const t=(0,l.Mq)(e);this._timeExtentPromise||=(0,E.W)(this.timeInfo,this.featureStore);const[i,s]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return(0,l.Te)(t),{fullExtent:i,timeExtent:s}}_clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async*_executeQueryFeatureSet(e){try{const t=yield*this._executeQuery(e,{});return yield,await t.createQueryResponse()}catch(t){if(t!==R.v8)throw t;return await new M.G([],e,this).createQueryResponse()}}async*_executeQueryForCount(e){try{const t=yield*this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null});return yield,t.createQueryResponseForCount()}catch(e){if(e!==R.v8)throw e;return 0}}async*_executeQueryForExtent(e){const t=e.outSR;try{const i=yield*this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null});yield;const s=i.size;if(!s)return{count:0,extent:null};const n=await this._getBounds(i.items,i.spatialReference,t??this.spatialReference);return yield,{count:s,extent:n}}catch(e){if(e===R.v8)return{count:0,extent:null};throw e}}async*_executeQueryForIdSet(e){try{const t=yield*this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null});yield;const i=t.items,s=new Set;for(const e of i)s.add(t.featureAdapter.getObjectId(e));return s}catch(e){if(e===R.v8)return new Set;throw e}}async*_executeQueryForLatestObservations(e){try{const t=yield*this._executeQuery(e,{});return yield,this._filterLatest(t),yield,await t.createQueryResponse()}catch(t){if(t!==R.v8)throw t;return await new M.G([],e,this).createQueryResponse()}}async*_executeAttributeBinsQuery(e){let t;try{e=await(0,R.iJ)(e,this.definitionExpression,this.spatialReference),yield,e=await async function(e,t){const i=e.bin;if(!i.onField&&!i.onExpression?.value||"autoIntervalBin"===i.type&&null==i.parameters.numberOfBins||"dateBin"===i.type&&(null==i.parameters.number||null==i.parameters.unit)||"fixedBoundariesBin"===i.type&&null==i.parameters.boundaries||"fixedIntervalBin"===i.type&&null==i.parameters.interval)throw new r.A(C,"Unsupported query options",{query:e});return z(e,t)}(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield;const i=yield*this._executeSceneFilterQuery(e);yield,t=yield*this._executeGeometryQuery(e,i),yield,this._executeAggregateIdsQuery(t),yield,this._executeObjectIdsQuery(t),yield,this._executeTimeQuery(t),yield,this._executeAttributesQuery(t),yield}catch(i){if(i!==R.v8)throw i;t=new M.G([],e,this)}return await t.createQueryBinsResponse(e)}async*_executeQueryForSummaryStatistics(e={},t){const{field:i,normalizationField:s,valueExpression:n}=t,r=yield*this._executeQueryForStatistics(e,{field:i,normalizationField:s,valueExpression:n});return yield,await r.createSummaryStatisticsResponse(t)}async*_executeQueryForUniqueValues(e={},t){const{field:i,field2:s,field3:n,valueExpression:r}=t,a=yield*this._executeQueryForStatistics(e,{field:i,field2:s,field3:n,valueExpression:r});return yield,await a.createUniqueValuesResponse(t)}async*_executeQueryForClassBreaks(e,t){const{field:i,normalizationField:s,valueExpression:n}=t,r=yield*this._executeQueryForStatistics(e,{field:i,normalizationField:s,valueExpression:n});return yield,await r.createClassBreaksResponse(t)}async*_executeQueryForHistogram(e,t){const{field:i,normalizationField:s,valueExpression:n}=t,r=yield*this._executeQueryForStatistics(e,{field:i,normalizationField:s,valueExpression:n});return yield,await r.createHistogramResponse(t)}async*_executeQueryForSnapping(e,t){const{point:i,distance:s,returnEdge:n,vertexMode:r}=e;if(!n&&"none"===r)return{candidates:[]};let o=(0,a.o8)(e.query);o=await(0,R.T2)(o,this.definitionExpression,this.spatialReference),yield,o=await z(o,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield;const l=!(0,g.aI)(i.spatialReference,this.spatialReference);l&&(await(0,v.Nk)(i.spatialReference,this.spatialReference),yield);const u="number"==typeof s?s:s.x,c="number"==typeof s?s:s.y,d={xmin:i.x-u,xmax:i.x+u,ymin:i.y-c,ymax:i.y+c,spatialReference:i.spatialReference},h=l?(0,v.Cv)(d,this.spatialReference):d;if(!h)return{candidates:[]};const p=(await(0,y.el)((0,f.rS)(i),null,{signal:t}))[0];yield;const m=(await(0,y.el)((0,f.rS)(h),null,{signal:t}))[0];if(yield,null==p||null==m)return{candidates:[]};const x=await this._searchFeatures(J(m.toJSON()));yield;const F=new M.G(x,o,this);this._executeObjectIdsQuery(F),yield,this._executeTimeQuery(F),yield,this._executeAttributesQuery(F),yield,yield*this._executeGeometryQueryForSnapping(F),yield;const _=p.toJSON(),w=l?(0,v.Cv)(_,this.spatialReference):_,S=l?Math.max(h.xmax-h.xmin,h.ymax-h.ymin)/2:s;return F.createSnappingResponse({...e,point:w,distance:S},o.returnZ,i.spatialReference)}async _getBounds(e,t,i){const s=(0,h.hZ)((0,h.vt)(),h.qv);return await this.featureStore.forEachBounds(e,e=>(0,h.RF)(s,e)),U(s,t,i,this.spatialReference,this.hasZ)}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference)),this._fullExtentPromise}async _getAllFeaturesQueryEngineResult(e){return new M.G(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>await this.featureStore.forEach(t=>e.push(t)))().then(()=>(0,n.zI)(e))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async*_executeQuery(e,t){e=(0,a.o8)(e),e=await(0,R.GC)(e,this.definitionExpression,this.spatialReference),yield,e=await z(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield,e={...e,...t};const i=yield*this._executeSceneFilterQuery(e);yield;const s=yield*this._executeGeometryQuery(e,i);return yield,this._executeAggregateIdsQuery(s),yield,this._executeObjectIdsQuery(s),yield,this._executeTimeQuery(s),yield,this._executeAttributesQuery(s),s}async*_executeSceneFilterQuery(e){if(null==e.sceneFilter)return null;const{outSR:t,returnGeometry:i,returnCentroid:s}=e,n=this.featureStore.featureSpatialReference,r=e.sceneFilter.geometry,a=null==n||(0,g.aI)(n,r.spatialReference)?r:(0,v.Cv)(r,n);if(!a)return null;const o=i||s,l=(0,g.fn)(t)&&!(0,g.aI)(this.spatialReference,t)&&o?async e=>this._project(e,t):e=>e;yield;const u=this.featureAdapter,c=await this._searchFeatures(J(a));if(yield,"disjoint"===e.sceneFilter.spatialRelationship){if(!c.length)return null;const t=new Set;for(const e of c)t.add(u.getObjectId(e));const i=await this._getAllFeatures();yield;const s=await(0,b.xt)("esriSpatialRelDisjoint",a,this.geometryType,this.hasZ,this.hasM);yield;const n=e=>!t.has(u.getObjectId(e))||s(u.getGeometry(e)),r=yield*this._runSpatialFilter(i,n);yield;const o=new M.G(r,e,this);return await l(o)}if(!c.length)return new M.G([],e,this);if(this._canExecuteSinglePass(a,e))return await l(new M.G(c,e,this));const d=await(0,b.xt)("esriSpatialRelContains",a,this.geometryType,this.hasZ,this.hasM);yield;const h=yield*this._runSpatialFilter(c,e=>d(u.getGeometry(e)));return yield,await l(new M.G(h,e,this))}async*_executeGeometryQuery(e,t){if(null!=t&&0===t.items.length)return t;const{geometry:i,outSR:n,returnGeometry:r,returnCentroid:a}=e,o=t?null:this._getCacheKey(e),l=o?this._cache.get(o):null;if(l)return new M.G(l,e,this);const u=(0,g.fn)(n)&&!(0,g.aI)(this.spatialReference,n),c=r||a,d=async e=>(u&&c&&await this._project(e,n),o&&this._cache.put(o,e.items),e),h=this.featureStore.featureSpatialReference,p=!i||null==h||(0,g.aI)(h,i.spatialReference)?i:(0,v.Cv)(i,h);if(!p)return await d(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));yield;const m=this.featureAdapter;let f=await this._searchFeatures(J(i));yield;const y=e.spatialRel??"esriSpatialRelIntersects";if("esriSpatialRelDisjoint"===y){if(!f.length)return await d(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const i=new Set;for(const e of f)i.add(m.getObjectId(e));let s;null!=t?s=t.items:(yield,s=await this._getAllFeatures(),yield);const n=await(0,b.xt)(y,p,this.geometryType,this.hasZ,this.hasM);yield;const r=e=>!i.has(m.getObjectId(e))||n(m.getGeometry(e)),a=yield*this._runSpatialFilter(s,r);yield;const o=new M.G(a,e,this);return await d(o)}if(null!=t){const e=new s.vW;f=f.filter(i=>(0,s.qh)(t.items,i,t.items.length,e)>=0)}if(!f.length){const t=new M.G([],e,this);return o&&this._cache.put(o,t.items),t}if(this._canExecuteSinglePass(p,e))return await d(new M.G(f,e,this));const x=await(0,b.xt)(y,p,this.geometryType,this.hasZ,this.hasM);yield;const F=yield*this._runSpatialFilter(f,e=>x(m.getGeometry(e)));return yield,await d(new M.G(F,e,this))}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds?.length||null==this.aggregateAdapter)return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach(e=>t.add(e));const i=this.featureAdapter.getObjectId;e.items=e.items.filter(e=>t.has(i(e)))}_executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),i=this.featureAdapter.getObjectId;e.items=e.items.filter(e=>t.has(i(e)))}_executeTimeQuery(e){if(0===e.items.length)return;const t=(0,E.I)(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(0===e.items.length)return;const t=(0,F.j4)(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(e=>t.testFeature(e,this.featureAdapter))}}async*_executeGeometryQueryForSnapping(e){const{query:t}=e,{spatialRel:i}=t;if(!e?.items?.length||!t.geometry||!i)return;const s=await(0,b.xt)(i,t.geometry,this.geometryType,this.hasZ,this.hasM);yield;const n=this.featureAdapter,r=yield*this._runSpatialFilter(e.items,e=>s(n.getGeometry(e)));e.items=r}*_runSpatialFilter(e,t){if(!t)return e;if(null==this._frameTask)return e.filter(e=>t(e));let i=yield;const s=new Array;for(const n of e)t(n)&&s.push(n),i.madeProgress(),i.done&&(i=yield);return s}_filterLatest(e){const{trackIdField:t,startTimeField:i,endTimeField:s}=this.timeInfo,n=s||i,r=new Map,a=this.featureAdapter.getAttribute;for(const i of e.items){const e=a(i,t),s=a(i,n),o=r.get(e);(!o||s>a(o,n))&&r.set(e,i)}e.items=Array.from(r.values())}_getCacheKey(e){const{geometry:t,spatialRel:i,returnGeometry:s,returnCentroid:n,outSR:r,resultType:a,cacheHint:o}=e;if("tile"!==a&&!o)return null;const l=s||n;return(0,g.fn)(r)&&!(0,g.aI)(this.spatialReference,r)&&l?JSON.stringify([t,i,r]):JSON.stringify([t,i])}_canExecuteSinglePass(e,t){const{spatialRel:i}=t;return(0,b.tC)(e)&&("esriSpatialRelEnvelopeIntersects"===i||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===i||"esriSpatialRelContains"===i))}async _project(e,t){if(!t||(0,g.aI)(this.spatialReference,t))return e;const i=this.featureAdapter;let s;try{const e=await this._getFullExtent();s=(0,d.getTransformation)(this.spatialReference,t,e)}catch{}const r=await(0,v.lK)(e.items.map(e=>(0,_.pL)(this.geometryType,this.hasZ,this.hasM,i.getGeometry(e))),this.spatialReference,t,s);return e.items=(0,n.zI)(r.map((t,s)=>i.cloneWithGeometry(e.items[s],(0,x.Ux)(t,this.hasZ,this.hasM)))),e}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(e=>this.featureStore.forEachInBounds(e,e=>t.add(e))));const i=Array.from(t.values());return t.clear(),i}async*_executeQueryForStatistics(e,t){e=(0,a.o8)(e);try{e=await(0,R.GC)(e,this.definitionExpression,this.spatialReference),yield,e=await async function(e,t,{fieldsIndex:i,geometryType:s,spatialReference:n,availableFields:a}){if(null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new r.A(C,"Unsupported query options",{query:e});return B(i,a,e),Promise.all([G(i,a,t,e),(0,b.c0)(e,s,n),(0,v.Nk)(n,e.outSR)]).then(()=>e)}(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield;const i=yield*this._executeSceneFilterQuery(e);yield;const s=yield*this._executeGeometryQuery(e,i);return yield,this._executeAggregateIdsQuery(s),yield,this._executeObjectIdsQuery(s),yield,this._executeTimeQuery(s),yield,this._executeAttributesQuery(s),yield,s}catch(t){if(t!==R.v8)throw t;return new M.G([],e,this)}}get test(){}}function J(e){if((0,b.tC)(e)){if((0,f.ZC)(e))return[(0,p.fA)(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if((0,f.Bi)(e))return e.rings.map(e=>(0,p.fA)(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1])))}return[(0,m.Rg)((0,p.vt)(),e)]}function U(e,t,i,s,n){const r={xmin:e[0],ymin:e[1],xmax:e[3],ymax:e[4],spatialReference:(0,_.ag)(s)};n&&isFinite(e[2])&&isFinite(e[5])&&(r.zmin=e[2],r.zmax=e[5],r.hasZ=!0);const a=(0,v.Cv)(r,t,i);if(a.spatialReference=(0,_.ag)(i),a.xmax-a.xmin===0){const e=(0,u.GA)(a.spatialReference);a.xmin-=e,a.xmax+=e}if(a.ymax-a.ymin===0){const e=(0,u.GA)(a.spatialReference);a.ymin-=e,a.ymax+=e}if(n&&null!=a.zmin&&null!=a.zmax&&a.zmax-a.zmin===0){const e=(0,u.GA)(a.spatialReference);a.zmin-=e,a.zmax+=e}return a}},57231:(e,t,i)=>{i.d(t,{g:()=>s});const s=(0,i(66552).O)()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"})},58727:(e,t,i)=>{i.d(t,{GC:()=>y,T2:()=>g,VY:()=>h,dO:()=>F,iJ:()=>f,v8:()=>p});var s=i(49186),n=i(66552),r=i(83047),a=i(98988),o=i(90634),l=i(65864),u=i(17136),c=i(21325),d=i(31464);const h=new n.J({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),p=Object.freeze({}),m="frequency";async function f(e,t,i){const s=e.bin;return s.onField&&(s.onField=s.onField.trim()),s.onExpression?.value&&(s.onExpression.value=s.onExpression.value.trim()),s.splitBy&&(s.splitBy.value&&(s.splitBy.value=s.splitBy.value.trim()),s.splitBy.outAlias&&(s.splitBy.outAlias=s.splitBy.outAlias.trim())),s.stackBy&&(s.stackBy.value&&(s.stackBy.value=s.stackBy.value.trim()),s.stackBy.outAlias&&(s.stackBy.outAlias=s.stackBy.outAlias.trim())),"normalizationField"in s.parameters&&s.parameters.normalizationField&&(s.parameters.normalizationField=s.parameters.normalizationField.trim()),e.outStatistics?.length||(e.outStatistics=[{statisticType:"count",onStatisticField:"1",outStatisticFieldName:m}]),y(e,t,i)}async function y(e,t,i){const{outFields:s,orderByFields:n,groupByFieldsForStatistics:r,outStatistics:a}=e;if(s)for(let e=0;e<s.length;e++)s[e]=s[e].trim();if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(a)for(let e=0;e<a.length;e++)a[e].onStatisticField&&(a[e].onStatisticField=a[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),g(e,t,i)}async function g(e,t,n){if(!e)return null;let{where:a}=e;if(e.where=a=a?.trim(),(!a||/^1 *= *1$/.test(a)||t&&t===a)&&(e.where=null),!e.geometry)return e;let m=await async function(e){const{distance:t,units:n}=e,a=e.geometry;if(null==t||"vertexAttributes"in a)return a;const o=a.spatialReference,u=n?h.fromJSON(n):(0,r.Ij)(o),p=o&&((0,c.EA)(o)||(0,c.K8)(o))?a:await(0,d.Nk)(o,c.KK).then(()=>(0,d.Cv)(a,c.KK)),m=await i.e(9159).then(i.bind(i,49159));await m.load();const f=m.execute(p,t||1,{unit:u})??void 0;if(!f||!(0,l.Bi)(f)||0===f.rings.length)throw new s.A("unsupported-query:invalid-parameters","Invalid parameters for query by distance");return f}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;m=(0,o.HA)(m),m.spatialReference=t}if(m){await(0,d.Nk)(m.spatialReference,n),m=function(e,t){const i=e.spatialReference;return x(e,t)&&(0,l.ZC)(e)?{spatialReference:i,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(m,n);const t=(await(0,u.el)((0,l.rS)(m)))[0];if(null==t)throw p;const i="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,s=i&&x(m,n)?{densificationStep:8*i}:void 0,r=t.toJSON(),a=(0,d.Cv)(r,r.spatialReference,n,s);if(!a)throw p;a.spatialReference=n,e.geometry=a}return e}function x(e,t){if(!e)return!1;const i=e.spatialReference;return((0,l.ZC)(e)||(0,l.Bi)(e)||(0,l.Rg)(e))&&!(0,c.aI)(i,t)&&!(0,a.canProjectWithoutEngine)(i,t)}function F(e,t){return null==e?null:"string"==typeof e?t?new Date(`1970-01-01T${e}Z`).getTime():new Date(e).getTime():e instanceof Date?e.getTime():e}},59977:(e,t,i)=>{i.d(t,{A:()=>g});var s=i(31635),n=i(93637),r=i(10107),a=i(56507),o=(i(44208),i(87811),i(93223)),l=i(40608),u=i(41266),c=i(69540),d=i(25482),h=i(57231);let p=class extends((0,c.OU)(d.o)){constructor(e){super(e),this.value=null,this.unit=null}};(0,s.Cg)([(0,r.MZ)({type:Number,json:{name:"number",write:!0}})],p.prototype,"value",void 0),(0,s.Cg)([(0,o.e)(h.g)],p.prototype,"unit",void 0),p=(0,s.Cg)([(0,l.$)("esri.rest.support.DateBinTimeInterval")],p);const m=p;function f(e,t,i){(0,n.sM)(i,"string"==typeof e?e:e?.getTime(),t)}function y(e,t){const i=e.parameters[t];return i?"string"==typeof i?i:new Date(i):null}p.from=(0,a.dp)(p);let g=class extends u.A{constructor(e){super(e),this.end=null,this.interval=null,this.offset=null,this.returnFullIntervalBin=!1,this.start=null,this.snapToData=null,this.type="date"}};(0,s.Cg)([(0,r.MZ)({cast:e=>null!=e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.end",read:{reader:(e,t)=>y(t,"end")},write:{writer:f}}})],g.prototype,"end",void 0),(0,s.Cg)([(0,r.MZ)({type:m,json:{name:"parameters",write:!0}})],g.prototype,"interval",void 0),(0,s.Cg)([(0,r.MZ)({type:m,json:{name:"parameters.offset",write:!0}})],g.prototype,"offset",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean,json:{name:"parameters.returnFullIntervalBin",write:!0}})],g.prototype,"returnFullIntervalBin",void 0),(0,s.Cg)([(0,r.MZ)({cast:e=>null!=e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.start",read:{reader:(e,t)=>y(t,"start")},write:{writer:f}}})],g.prototype,"start",void 0),(0,s.Cg)([(0,r.MZ)({type:String,json:{name:"parameters.snapToData",write:!0}})],g.prototype,"snapToData",void 0),(0,s.Cg)([(0,o.e)({dateBin:"date"},{readOnly:!0})],g.prototype,"type",void 0),g=(0,s.Cg)([(0,l.$)("esri.rest.support.DateBinParameters")],g),g.from=(0,a.dp)(g)},60909:(e,t,i)=>{i.d(t,{A:()=>h});var s=i(31635),n=i(93637),r=i(10107),a=i(56507),o=(i(44208),i(87811),i(93223)),l=i(40608),u=i(41266),c=i(41366);function d(e,t,i){(0,n.sM)(i,e instanceof Date?e.getTime():e,t)}let h=class extends((0,c.K)(u.A)){constructor(e){super(e),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};(0,s.Cg)([(0,r.MZ)({json:{name:"parameters.end",write:{writer:d}}})],h.prototype,"end",void 0),(0,s.Cg)([(0,r.MZ)({type:Number,json:{name:"parameters.interval",write:!0}})],h.prototype,"interval",void 0),(0,s.Cg)([(0,r.MZ)({json:{name:"parameters.start",write:{writer:d}}})],h.prototype,"start",void 0),(0,s.Cg)([(0,o.e)({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],h.prototype,"type",void 0),h=(0,s.Cg)([(0,l.$)("esri.rest.support.FixedIntervalBinParameters")],h),h.from=(0,a.dp)(h)},62660:(e,t,i)=>{i.d(t,{tC:()=>v,c0:()=>_,xt:()=>F});var s=i(49186),n=i(94078),r=i(12176),a=i(65864),o=i(21325);function l(e,t){return e?t?4:3:t?3:2}function u(e,t,i,s,n,r){const a=l(n,r),{coords:o,lengths:u}=s;if(!u)return!1;for(let s=0,n=0;s<u.length;s++,n+=a)if(!c(e,t,i,o[n],o[n+1]))return!1;return!0}function c(e,t,i,s,n){if(!e)return!1;const r=l(t,i),{coords:a,lengths:o}=e;let u=!1,c=0;for(const e of o)u=d(u,a,r,c,e,s,n),c+=e*r;return u}function d(e,t,i,s,n,r,a){let o=e,l=s;for(let e=s,u=s+n*i;e<u;e+=i){l=e+i,l===u&&(l=s);const n=t[e],c=t[e+1],d=t[l],h=t[l+1];(c<a&&h>=a||h<a&&c>=a)&&n+(a-c)/(h-c)*(d-n)<r&&(o=!o)}return o}var h=i(90708),p=i(92722),m=i(51441),f=i(31464);const y="unsupported-query",g={spatialRelationship:{esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},queryGeometry:{esriGeometryPoint:!0,esriGeometryMultiPatch:!1,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},layerGeometry:{esriGeometryPoint:!0,esriGeometryMultiPatch:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1}},x={esriSpatialRelIntersects:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(7360)]).then(i.bind(i,55284)),esriSpatialRelContains:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(1867)]).then(i.bind(i,29127)),esriSpatialRelCrosses:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(9700)]).then(i.bind(i,85672)),esriSpatialRelDisjoint:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(1598)]).then(i.bind(i,7978)),esriSpatialRelEnvelopeIntersects:null,esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(1414)]).then(i.bind(i,46178)),esriSpatialRelTouches:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(2503)]).then(i.bind(i,83547)),esriSpatialRelWithin:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(9265)]).then(i.bind(i,85445)),esriSpatialRelRelation:null};async function F(e,t,i,s,o){if((0,a.Bi)(t)){if("esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e)){const e=(0,h.Ye)(new p.A,t,!1,!1);return t=>function(e,t,i,s){return c(e,!1,!1,s.coords[0],s.coords[1])}(e,0,0,t)}if("esriGeometryMultipoint"===i){const i=(0,h.Ye)(new p.A,t,!1,!1);if("esriSpatialRelContains"===e)return e=>u(i,!1,!1,e,s,o)}}if((0,a.ZC)(t)){if("esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e))return e=>(0,n.qz)(t,(0,m.pL)(i,s,o,e));if("esriGeometryMultipoint"===i&&"esriSpatialRelContains"===e)return e=>(0,n.rL)(t,(0,m.pL)(i,s,o,e));if("esriSpatialRelIntersects"===e){const e="mesh"===(l=i)?r.xB:(0,r.xK)(l);return n=>e(t,(0,m.pL)(i,s,o,n))}}var l;"esriSpatialRelEnvelopeIntersects"===e&&(e="esriSpatialRelIntersects");const d=await function(e){const t=x[e];if(null==t)throw new Error(`Cannot load unsupported spatial operator: ${e}`);return t()}(e);return e=>d.execute(t,(0,m.pL)(i,s,o,e))}async function _(e,t,i){const{spatialRel:n,geometry:r}=e;if(r){if(!function(e){return null!=e&&!0===g.spatialRelationship[e]}(n))throw new s.A(y,"Unsupported query spatial relationship",{query:e});if((0,o.fn)(r.spatialReference)&&(0,o.fn)(i)){if(!function(e){return null!=e&&!0===g.queryGeometry[(0,a.$B)(e)]}(r))throw new s.A(y,"Unsupported query geometry type",{query:e});if(!function(e){return null!=e&&!0===g.layerGeometry[e]}(t))throw new s.A(y,"Unsupported layer geometry type",{query:e});if(e.outSR)return(0,f.Nk)(e.geometry?.spatialReference,e.outSR)}}}function v(e){if((0,a.ZC)(e))return!0;if((0,a.Bi)(e)){for(const t of e.rings){if(5!==t.length)return!1;if(t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1}return!0}return!1}},69052:(e,t,i)=>{i.d(t,{hr:()=>n,ie:()=>l,uC:()=>o});var s=i(34727);class n{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,i=!1){return r(this.range,this.min,this.max,e,t,i)}clamp(e,t=0){return(0,s.qE)(e-t,this.min,this.max)+t}monotonic(e,t,i){return e<t?t:t+a(this.range,e-t,i)}minimalMonotonic(e,t,i){return r(this.range,e,e+this.range,t,i)}center(e,t,i){return t=this.monotonic(e,t,i),this.normalize((e+t)/2,i)}diff(e,t,i){return this.monotonic(e,t,i)-e}shortestSignedDiff(e,t){e=this.normalize(e);const i=(t=this.normalize(t))-e,s=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(i)<Math.abs(s)?i:s}contains(e,t,i){return t=this.minimalMonotonic(e,t),(i=this.minimalMonotonic(e,i))>e&&i<t}}function r(e,t,i,s,n=0,r=!1){return(s-=n)<t?s+=a(e,t-s):s>i&&(s-=a(e,s-i)),r&&s===i&&(s=t),s+n}function a(e,t,i=0){return Math.ceil((t-i)/e)*e+i}const o=new n(0,2*Math.PI),l=(new n(-Math.PI,Math.PI),new n(0,360))},70328:(e,t,i)=>{i.d(t,{BI:()=>F,DC:()=>d,Ej:()=>p,Ie:()=>g,Jt:()=>x,Ne:()=>m,RF:()=>c,aI:()=>v,fA:()=>a,gE:()=>l,hZ:()=>y,iT:()=>h,is:()=>_,qv:()=>w,vI:()=>f,vY:()=>o,v_:()=>S,vt:()=>r,w1:()=>u});var s=i(5443),n=(i(19419),i(4197));function r(e=S){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function a(e,t,i,s,n,a,o=r()){return o[0]=e,o[1]=t,o[2]=i,o[3]=s,o[4]=n,o[5]=a,o}function o(e,t=r()){return function(e,t,i,s=r()){return y(s,w),function(e,t,i=0,s=t.length/3){let n=e[0],r=e[1],a=e[2],o=e[3],l=e[4],u=e[5];for(let e=0;e<s;e++)n=Math.min(n,t[i+3*e]),r=Math.min(r,t[i+3*e+1]),a=Math.min(a,t[i+3*e+2]),o=Math.max(o,t[i+3*e]),l=Math.max(l,t[i+3*e+1]),u=Math.max(u,t[i+3*e+2]);e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=l,e[5]=u}(s,e,t,i),s}(e,0,e.length/3,t)}function l(e,t=(0,n.jh)(24)){const[i,s,r,a,o,l]=e;return t[0]=i,t[1]=s,t[2]=r,t[3]=i,t[4]=s,t[5]=l,t[6]=i,t[7]=o,t[8]=r,t[9]=i,t[10]=o,t[11]=l,t[12]=a,t[13]=s,t[14]=r,t[15]=a,t[16]=s,t[17]=l,t[18]=a,t[19]=o,t[20]=r,t[21]=a,t[22]=o,t[23]=l,t}function u(e,t){const i=isFinite(e[2])||isFinite(e[5]);return new s.A(i?{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 c(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 d(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[3]=Math.max(e[3],t[2]),e[4]=Math.max(e[4],t[3])}function h(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 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 m(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function f(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[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 g(e){return e?y(e,w):r(w)}function x(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 F(e,t,i,s,n){return e[0]=t,e[1]=i,e[2]=Number.NEGATIVE_INFINITY,e[3]=s,e[4]=n,e[5]=Number.POSITIVE_INFINITY,e}function _(e){return 6===e.length}function v(e,t,i){if(null==e||null==t)return e===t;if(!_(e)||!_(t))return!1;if(i){for(let s=0;s<e.length;s++)if(!i(e[s],t[s]))return!1}else for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}const w=[1/0,1/0,1/0,-1/0,-1/0,-1/0],S=[0,0,0,0,0,0];r()},80754:(e,t,i)=>{i.d(t,{j7:()=>a,kS:()=>l,kd:()=>o,r8:()=>u});var s=i(82799),n=i(16930),r=i(65864);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new s.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator}),minus180Line:new s.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new s.A({paths:[[[180,-180],[180,180]]],spatialReference:n.A.WGS84}),minus180Line:new s.A({paths:[[[-180,-180],[-180,180]]],spatialReference:n.A.WGS84})}};function o(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const i=u(e);for(const e of i)for(const i of e)i[0]+=t;return e}function u(e){return(0,r.Bi)(e)?e.rings:e.paths}},86420:(e,t,i)=>{i.d(t,{I:()=>r,W:()=>n});var s=i(21818);async function n(e,t){if(!e)return null;const i=t.featureAdapter,{startTimeField:n,endTimeField:r}=e;let a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if(n&&r)await t.forEach(e=>{const t=i.getAttribute((0,s.zI)(e),n),l=i.getAttribute((0,s.zI)(e),r);null==t||isNaN(t)||(a=Math.min(a,t)),null==l||isNaN(l)||(o=Math.max(o,l))});else{const e=n||r;await t.forEach(t=>{const n=i.getAttribute((0,s.zI)(t),e);null==n||isNaN(n)||(a=Math.min(a,n),o=Math.max(o,n))})}return{start:a,end:o}}function r(e,t,i){if(!t||!e)return null;const{startTimeField:s,endTimeField:n}=e;if(!s&&!n)return null;const{start:r,end:a}=t;if(null===r&&null===a)return null;if(void 0===r&&void 0===a)return()=>!1;const o=i.getAttributeAsTimestamp?.bind(i)??i.getAttribute.bind(i);return s&&n?function(e,t,i,s,n){return null!=s&&null!=n?r=>{const a=e(r,t),o=e(r,i);return(null==a||a<=n)&&(null==o||o>=s)}:null!=s?t=>{const n=e(t,i);return null==n||n>=s}:null!=n?i=>{const s=e(i,t);return null==s||s<=n}:void 0}(o,s,n,r,a):function(e,t,i,s){return null!=i&&null!=s&&i===s?s=>e(s,t)===i:null!=i&&null!=s?n=>{const r=e(n,t);return null!=r&&r>=i&&r<=s}:null!=i?s=>{const n=e(s,t);return null!=n&&n>=i}:null!=s?i=>{const n=e(i,t);return null!=n&&n<=s}:void 0}(o,s||n,r,a)}},92300:(e,t,i)=>{i.d(t,{V:()=>r,X:()=>n});var s=i(65864);function n(e){return{geometryType:(0,s.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function r(e,t,i){const n=(0,s.xD)(t);return e.map(e=>{const t=n.fromJSON(e);return t.spatialReference=i,t})}},95466:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(49186),n=i(53966),r=i(91869),a=i(3330),o=i(12195),l=i(30524),u=i(98623),c=i(56400),d=i(96285);const h=new Map;class p{static fromJSON(e){return new p(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new p(e.fields??[],g(e))}static fromLayerJSON(e){return new p(e.fields??[],g(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 i=[];for(const e of this.fields){const t=e?.name,s=f(t);if(t&&s){const n=m(t);this._fieldsMap.set(t,e),this._fieldsMap.set(n,e),this._normalizedFieldsMap.set(s,e),i.push(`${n}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,l.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,l.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,l.te)(e)||(0,l.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}i.sort(),this.uid=i.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,l.te)(e)||(0,l.Xz)(e)||e.nullable||void 0!==(0,l.lD)(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(m(e))??this._normalizedFieldsMap.get(f(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.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new s.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):y.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?a.GB.instance:t===u.n$?d.mQ.utcInstance:(0,r.tE)(h,t,()=>d.oh.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,l.OH)(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,o.W)(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function m(e){return e.trim().toLowerCase()}function f(e){return(0,l.rS)(e)?.toLowerCase()??""}const y=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function g(e){const t=new Map;if(!e.fields)return t;const i=!0===e.datesInUnknownTimezone,{timeInfo:s,editFieldsInfo:n}=e,r=(s?"startField"in s?s.startField:s.startTimeField:"")??"",a=(s?"endField"in s?s.endField:s.endTimeField:"")??"",o=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,c.ZS)(e.dateFieldsTimeReference):null,l=n?function(e){return"timeZone"in e}(n)?n.timeZone??o:n.dateFieldsTimeReference?(0,c.ZS)(n.dateFieldsTimeReference):o??u.n$:null,d=s?function(e){return"timeZone"in e}(s)?s.timeZone??o:s.timeReference?(0,c.ZS)(s.timeReference):o:null,h=new Map([[m(n?.creationDateField??""),l],[m(n?.editDateField??""),l],[m(r),d],[m(a),d]]);for(const{name:s,type:n}of e.fields)if(y.has(n))t.set(s,u.L5);else if("date"!==n&&"esriFieldTypeDate"!==n)t.set(s,null);else if(i)t.set(s,u.L5);else{const e=h.get(m(s??""))??o;t.set(s,e)}return t}},99352:(e,t,i)=>{i.d(t,{F:()=>s,P:()=>n});const s={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,maxUniqueIDCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},n={supportsDate:!0,supportsFixedInterval:!0,supportsAutoInterval:!0,supportsFixedBoundaries:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!0,supportedStatistics:{count:!0,sum:!0,avg:!0,var:!0,stddev:!0,min:!0,max:!0,percentileContinuous:!0,percentileDiscrete:!0,envelope:!0,centroid:!0,convexHull:!0},supportedNormalizationTypes:{field:!0,log:!0,naturalLog:!0,percentOfTotal:!0,squareRoot:!0}}}}]);
|