@arcgis/core 4.33.0-next.20250402 → 4.33.0-next.20250404

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/WebScene.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0669220e7acacd9c652a.js +1 -0
  4. package/assets/esri/core/workers/chunks/0cec53e6f1464c69448d.js +1 -0
  5. package/assets/esri/core/workers/chunks/{30a047bd66f333bb7d2d.js → 1364744b15b327abd5a1.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{628395830c78b95b46dc.js → 290aed587aa647226b46.js} +1 -1
  7. package/assets/esri/core/workers/chunks/358a3a9326615d5e6d3b.js +1 -0
  8. package/assets/esri/core/workers/chunks/35ab75010817f1525e54.js +1 -0
  9. package/assets/esri/core/workers/chunks/386ea90e87254b0282ec.js +1 -0
  10. package/assets/esri/core/workers/chunks/61737e442b1f8e86164e.js +1 -0
  11. package/assets/esri/core/workers/chunks/69e606267dc5842ebf9d.js +1 -0
  12. package/assets/esri/core/workers/chunks/7099564a8853b81ba181.js +1 -0
  13. package/assets/esri/core/workers/chunks/8221f2e540abe1e0f048.js +1 -0
  14. package/assets/esri/core/workers/chunks/b06e3ba73f353592c81d.js +1 -0
  15. package/assets/esri/core/workers/chunks/{322cb1b1871d03b69f0a.js → baab3f0bdf78b6165fd6.js} +102 -102
  16. package/assets/esri/core/workers/chunks/c20ec58c7bc7d5893049.js +1 -0
  17. package/assets/esri/core/workers/chunks/c2d0fc13f4b746318a38.js +1 -0
  18. package/assets/esri/core/workers/chunks/{7e00122014d0a55363a8.js → ccb289911e7445b17763.js} +1 -1
  19. package/assets/esri/core/workers/chunks/eaead9e927ebadcf2cc3.js +1 -0
  20. package/assets/esri/core/workers/chunks/ed517687b3728fd2eb64.js +1 -0
  21. package/core/typedArrayUtil.js +1 -1
  22. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  23. package/geometry/Polygon.js +1 -1
  24. package/geometry/support/HalfFloatArray.js +1 -1
  25. package/geometry/support/buffer/BufferView.js +1 -1
  26. package/geometry/support/buffer/internals/Vec2.js +1 -1
  27. package/geometry/support/float16.js +5 -0
  28. package/interfaces.d.ts +591 -26
  29. package/layers/BuildingSceneLayer.js +1 -1
  30. package/layers/ParquetLayer.d.ts +4 -0
  31. package/layers/SceneLayer.js +1 -1
  32. package/package.json +2 -2
  33. package/portal/schemas/definitions.js +1 -1
  34. package/support/revision.js +1 -1
  35. package/undoredo/support/Services.js +1 -1
  36. package/views/2d/engine/Stage.js +1 -1
  37. package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +1 -1
  38. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  39. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  40. package/views/2d/engine/webgl/Painter.js +1 -1
  41. package/views/2d/engine/webgl/effects/highlight/HighlightSurfaces.js +1 -1
  42. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  43. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
  44. package/views/2d/layers/StreamLayerView2D.js +1 -1
  45. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  46. package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
  47. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  48. package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
  49. package/views/3d/layers/DrapedSubView3D.js +1 -1
  50. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  51. package/views/3d/terrain/PatchGeometry.js +1 -1
  52. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  53. package/views/3d/terrain/TerrainAttributes.js +1 -1
  54. package/views/3d/terrain/support/MultiSizeFramebuffer.js +1 -1
  55. package/views/3d/webgl/formats.js +1 -1
  56. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  57. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +16 -16
  58. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +5 -5
  59. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  60. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  61. package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
  62. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  63. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  64. package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
  65. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  66. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  67. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  68. package/views/3d/webgl-engine/lib/ChangeSet.js +1 -1
  69. package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
  70. package/views/3d/webgl-engine/lib/ITexture.js +1 -1
  71. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  72. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  73. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  74. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  75. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  76. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  77. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  78. package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
  79. package/views/3d/webgl-engine/lib/TextureUpdater.js +5 -0
  80. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  81. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  82. package/views/3d/webgl-engine/lib/rendererUtils.js +1 -1
  83. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  84. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  85. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  86. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  87. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  88. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  89. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  90. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  91. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  92. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  93. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  94. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  95. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  96. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  97. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  98. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  99. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  100. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  101. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  102. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  103. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  104. package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
  105. package/views/SceneView.js +1 -1
  106. package/views/layers/ParquetLayerView.d.ts +4 -0
  107. package/views/support/TextureCompressionWorker.js +1 -1
  108. package/views/webgl/FramebufferObject.js +1 -1
  109. package/views/webgl/Texture.js +1 -1
  110. package/views/webgl/Util.js +1 -1
  111. package/views/webgl/checkWebGLError.js +1 -1
  112. package/views/webgl/enums.js +1 -1
  113. package/views/webgl/renderState.js +1 -1
  114. package/views/webgl/testFloatBufferBlend.js +1 -1
  115. package/views/webgl/textureUtils.js +1 -1
  116. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  117. package/widgets/Editor/UpdateWorkflow.js +1 -1
  118. package/widgets/Editor/workflowUtils.js +1 -1
  119. package/widgets/Editor.js +1 -1
  120. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  121. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  122. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  123. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
  124. package/widgets/FeatureForm.js +1 -1
  125. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  126. package/widgets/support/GridControls.js +1 -1
  127. package/widgets/support/UtilityNetworkAssociations/utils/getFeatureTitle.js +1 -1
  128. package/assets/esri/core/workers/chunks/1d322685016263f86cf5.js +0 -1
  129. package/assets/esri/core/workers/chunks/2219d970ece5676ca6ee.js +0 -1
  130. package/assets/esri/core/workers/chunks/401ff3c83789c72e9ac9.js +0 -1
  131. package/assets/esri/core/workers/chunks/555c95b149e3a82a4460.js +0 -1
  132. package/assets/esri/core/workers/chunks/6828e4936db0121a9638.js +0 -1
  133. package/assets/esri/core/workers/chunks/6e679703b5d6fc1b91a5.js +0 -1
  134. package/assets/esri/core/workers/chunks/6f3731f19497cbc6ea74.js +0 -1
  135. package/assets/esri/core/workers/chunks/7649d59b0b7d53818a29.js +0 -1
  136. package/assets/esri/core/workers/chunks/a56da688088404259481.js +0 -1
  137. package/assets/esri/core/workers/chunks/e6469173c65531d6524a.js +0 -1
  138. package/assets/esri/core/workers/chunks/e8312c999b3f0c9ef09e.js +0 -1
  139. package/assets/esri/core/workers/chunks/e9e517a2141e504eec64.js +0 -1
  140. package/assets/esri/core/workers/chunks/fa9ef9e8eae505371965.js +0 -1
  141. package/assets/esri/core/workers/chunks/fb5b852d0f72df014377.js +0 -1
@@ -316,4 +316,4 @@ gl_Position = posProjCenter;
316
316
  gl_PointSize = 1.0;`),a.main.add(s.H`fragColor = vec4(1);
317
317
  if(discardByTerrainDepth()) {
318
318
  fragColor.g = 0.5;
319
- }`)}},66208:(e,t,r)=>{r.d(t,{m:()=>i});var n=r(53655);function i(e,t){const r=(0,n.SH)(e,t),i=r.queryResult.featureResult,s=r.queryResult.queryGeometry,a=r.queryResult.queryGeometryType;if(i&&i.features&&i.features.length&&i.objectIdFieldName){const e=i.objectIdFieldName;for(const t of i.features)t.attributes&&(t.objectId=t.attributes[e])}return i&&(i.queryGeometry=s,i.queryGeometryType=a),i}},66344:(e,t,r)=>{var n,i;r.d(t,{q:()=>l}),(i=n||(n={}))[i.ALL=0]="ALL",i[i.SOME=1]="SOME";class s{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()}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 r=this._db.get(e.id+t);return r?.size??0}put(e,t,r,i,s){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==r&&this._notifyRemove(t,o.entry,o.size,n.ALL)),i>this._maxSize)return void this._notifyRemove(t,r,i,n.ALL);if(void 0===r)return void console.warn("Refusing to cache undefined entry ");if(!i||i<0)return console.warn(`Refusing to cache entry with size ${i} for key ${t}`),void this._notifyRemove(t,r,0,n.ALL);const l=1+Math.max(s,-4)- -3;this._db.set(t,new a(r,i,l)),this._size+=i,e.size+=i,this._checkSize()}updateSize(e,t,r,i){t=e.id+t;const s=this._db.get(t);if(s&&s.entry===r){for(this._size-=s.size,e.size-=s.size;i>this._maxSize;){const e=this._notifyRemove(t,r,i,n.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);i=e}s.size=i,this._size+=i,e.size+=i,this._checkSize()}}pop(e,t){t=e.id+t;const r=this._db.get(t);if(r)return this._size-=r.size,e.size-=r.size,this._db.delete(t),++this._hit,r.entry;++this._miss}get(e,t){t=e.id+t;const r=this._db.get(t);if(void 0!==r)return this._db.delete(t),r.lives=r.lifetime,this._db.set(t,r),++this._hit,r.entry;++this._miss}peek(e,t){const r=this._db.get(e.id+t);return r?++this._hit:++this._miss,r?.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={},r=new Array;this._db.forEach(((e,n)=>{const i=e.lifetime;r[i]=(r[i]||0)+e.size,this._users.forEach((r=>{const{id:i,name:s}=r;if(n.startsWith(i)){const r=t[s]||0;t[s]=r+e.size}}))}));const n={};this._users.forEach((e=>{const r=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const i=t[r]||0;t[r]=i,n[r]=Math.round(100*e.hitRate)+"%"}else n[r]="0%"}));const i=Object.keys(t);i.sort(((e,r)=>t[r]-t[e])),i.forEach((r=>e[r]=Math.round(t[r]/2**20)+"MB / "+n[r]));for(let t=r.length-1;t>=0;--t){const n=r[t];n&&(e["Priority "+(t+-3-1)]=Math.round(n/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,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,e.size,n.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,n.ALL))),this._users.forEach((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,r,n){const i=this._users.get(e.split(o)[0])?.removeFunc,s=i?.(t,n,r);return"number"==typeof s?s: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 r=t??this;if(r.size<=e)return;const n=t?.id;let i=!0;for(;i;){i=!1;for(const[s,a]of this._db)if(0===a.lifetime&&(!n||s.startsWith(n))){const n=t??this._users.get(s.split(o)[0]);if(this._purgeItem(s,a,n),r.size<=.9*e)return;i||=this._db.has(s)}}for(const[i,s]of this._db)if(!n||i.startsWith(n)){const n=t??this._users.get(i.split(o)[0]);if(this._purgeItem(i,s,n),r.size<=.9*e)return}}_purgeItem(e,t,r){if(this._db.delete(e),t.lives<=1){this._size-=t.size,r&&(r.size-=t.size);const i=this._notifyRemove(e,t.entry,t.size,n.SOME);null!=i&&i>0&&(this._size+=i,r&&(r.size+=i),t.lives=t.lifetime,t.size=i,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}class a{constructor(e,t,r){this.entry=e,this.size=t,this.lifetime=r,this.lives=r}}const o=":";class l{constructor(e,t){this.removeFunc=t,this._storage=new s,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,r=1){this._storage.put(this,e,t,r,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(){}}},67063:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Lr});var n=r(90237),i=r(65529),s=r(74887),a=r(36708),o=r(10107),l=r(44208),c=(r(53966),r(87811),r(40608)),d=r(5443),u=r(80586),h=r(16930),f=r(68298),p=r(61956),m=r(69622),g=r(4576),y=r(32587),_=r(44794),b=r(19419),v=r(69397),x=r(24326);function w(e=""){return`${e}${(0,x.c)()}`}r(37539),new Float64Array(3);class S{constructor(e,t){this._parent=e,this._subsetIndices=t,this.id=w(`featureDataSubset-${e.id}-`)}get extent(){return this._parent.extent}get featureCount(){return this._subsetIndices.length}get usedMemory(){return this._parent.usedMemory+v.qK+this._subsetIndices.byteLength}get isFullyEnabled(){for(const e of this._subsetIndices)if(!this._parent.getEnabled(e))return!1;return!0}getObjectId(e){return this._parent.getObjectId(this._subsetIndices[e])}getAttribute(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributeAsTimestamp(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributes(e){return this._parent.getAttributes(this._subsetIndices[e])}getCoordinates(e,t,r){return this._parent.getCoordinates(this._subsetIndices[e],t,r)}getOptimizedGeometry(e){return this._parent.getOptimizedGeometry(this._subsetIndices[e])}getCentroid(e,t){return this._parent.getCentroid(this._subsetIndices[e],t)}getBounds(e){return this._parent.getBounds(this._subsetIndices[e])}getBoundingBox(e){return this._parent.getBoundingBox(this._subsetIndices[e])}getObjectIdsArray(e,t,r){return this._parent.getObjectIdsArray(e,this._translatedIndices(t),r)}getCoordinatesArray(e,t,r){return this._parent.getCoordinatesArray(e,this._translatedIndices(t),r)}objectIds(e){return this._parent.objectIds(this._translatedIndices(e))}subset(e){const{_subsetIndices:t}=this,r=new Uint32Array(e.length);for(let n=0;n<r.length;++n)r[n]=t[e[n]];return new S(this._parent,r)}disableObjectIds(e){if(0===e.size)return;const{featureCount:t}=this,r=new Array;for(let n=0;n<t;++n)this.getEnabled(n)&&e.has(this.getObjectId(n))&&r.push(n);if(0!==r.length)for(const e of r)this.setEnabled(e,!1)}setEnabled(e,t){this._parent.setEnabled(this._subsetIndices[e],t)}getEnabled(e){return this._parent.getEnabled(this._subsetIndices[e])}enableAll(){const{_subsetIndices:e,_parent:t}=this;for(const r of e)t.setEnabled(r,!0)}getVisibilityArray(e,t,r){return this._parent.getVisibilityArray(e,this._translatedIndices(t),r)}enabledObjectIds(e){return this._parent.enabledObjectIds(this._translatedIndices(e))}*_translatedIndices(e){const{_subsetIndices:t}=this;if(null!=e)for(const r of e)yield t[r];else yield*t}}class A{constructor(e){this._tile=e,this.id=w(`featureData-${e.id}-`),this._enabled=new Array(e.featureCount).fill(!0)}get featureCount(){return this._tile.featureCount}get usedMemory(){return v.qK+(0,v.$B)(this.id)}get extent(){return this._tile.descriptor.extent}get isFullyEnabled(){return this._enabled.every((e=>e))}getObjectId(e){return this._tile.getObjectId(e)}getAttribute(e,t){return this._tile.getAttribute(e,t)}getAttributeAsTimestamp(e,t){return this._tile.getAttribute(e,t)}getAttributes(e){return this._tile.getAttributes(e)}getCoordinates(e,t,r){return this._tile.getCoordinates(e,t,r)}getOptimizedGeometry(e){return this._tile.getOptimizedGeometry(e)}getCentroid(e,t){return this._tile.getCentroid(e,t)}getBounds(e){return this._tile.getBounds(e)}getBoundingBox(e){return this._tile.getBoundingBox(e)}getObjectIdsArray(e,t,r){return this._tile.getObjectIdsArray(e,t,r)}getCoordinatesArray(e,t,r){return this._tile.getCoordinatesArray(e,t,r)}objectIds(e){return this._tile.objectIds(e)}subset(e){return new S(this,e)}disableObjectIds(e){if(0===e.size)return;const{_enabled:t}=this,r=new Array;for(const n of this._allFeatureIndices())t[n]&&e.has(this.getObjectId(n))&&r.push(n);if(0!==r.length)for(const e of r)t[e]=!1}setEnabled(e,t){this._enabled[e]=t}getEnabled(e){return this._enabled[e]}enableAll(){this._enabled.fill(!0)}getVisibilityArray(e,t=this._allFeatureIndices(),r=0){const{_enabled:n}=this;for(const i of t)e[r++]=Number(n[i]);return r}*enabledObjectIds(e=this._allFeatureIndices()){const{_enabled:t}=this;for(const r of e)t[r]&&(yield this.getObjectId(r))}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}}let C=class extends m.A{constructor(e){super(e),this._updatingCount=0,this.extent=null,this._tileHandles=new y.A,this._wanted=new y.A}destroy(){for(const e of this._tileHandles.values())e.abort();this._tileHandles.clear(),this._wanted.clear()}get updating(){return this._updatingCount>0}get _boundingRect(){const{extent:e}=this;return null==e?null:(0,b.VY)(e)}get _missingTiles(){const e=new Array,t=this._wanted;for(const r of this._tileHandles.values())t.has(r.id)&&!O(r)&&e.push(r);return e}async onTileTreeChange(e){++this._updatingCount;try{const{added:t,removed:r}=e,n=this._tileHandles,{_boundingRect:i}=this,s=null!=i?t.filter((e=>(0,b.HY)(i,e.extent))):t,a=this._wanted,o=new Array;for(const e of r){const{id:r}=e;if(a.delete(r),t.some((t=>I(t,e)||I(e,t))))continue;const i=n.get(r);null!=i&&o.push(this._removeTile(i))}for(const e of s)a.set(e.id,e),o.push(this._addTile(e));await Promise.allSettled(o)}finally{--this._updatingCount}}async _removeTile(e){this._tileHandles.delete(e.id),this._validate(),e.abort();const{featureData:t}=e,r=new R(e.untilSettled(),null!=t?this.createRemoveFeatureDataCommand(t.id):null);e.nextEvent=null;const{command:n}=await r.getCommand();n?.execute()}async _addTile(e){const{_tileHandles:t}=this,r=t.get(e.id);if(null!=r)return!O(r)||r.featureData.isFullyEnabled||(r.featureData.enableAll(),r.nextEvent=this._onTileLoad(r)),void await r.untilSettled();const n=new T(e);this._tileHandles.set(n.id,n);const i=this.loadTile(e,n.signal);n.nextEvent=i;const a=await i;if(n.aborted)throw(0,s.NK)();n.featureData=new A(a),function(e){if(!O(e))throw new Error}(n),n.nextEvent=this._onTileLoad(n),await n.untilSettled()}async _onTileLoad(e){const{_wanted:t,_tileHandles:r,_missingTiles:n}=this,i=e.descriptor,s=new Array,a=new Array,o=new Set;for(const l of r.values()){if(l===e)continue;const{descriptor:c,id:d}=l;if(t.has(d)||n.some((({descriptor:e})=>I(e,c)||I(c,e)))){if(O(l)){if(I(i,c)){const e=l.featureData;for(const t of e.objectIds())o.add(t)}if(I(c,i)){const t=e.featureData,r=new Set(t.objectIds()),{featureData:n}=l;n.disableObjectIds(r);const i=AbortSignal.any([l.signal,e.signal]),o=l.untilSettled();s.push(new R(o,this.createUpdateFeatureDataVisibilityCommand(n),i)),a.push(l),this._validateRemoval(n,r)}}}else{l.abort(),r.delete(d);const{featureData:e}=l;null!=e&&s.push(new R(l.untilSettled(),this.createRemoveFeatureDataCommand(e.id))),l.nextEvent=null}}o.size>0&&(e.featureData.disableObjectIds(o),this._validateRemoval(e.featureData,o)),this._validate(),s.push(new R(e.untilSettled(),this.createAddFeatureDataCommand(e.featureData,e.signal),e.signal)),a.push(e);const l=this._joinCommands(s);for(const e of a)e.nextEvent=l;await l}async _joinCommands(e){const t=(await Promise.allSettled(e.map((async e=>e.getCommand())))).map((e=>"fulfilled"!==e.status||e.value.signal?.aborted?null:e.value.command)).filter(g.Ru);0!==t.length&&t.reduce(((e,t)=>(e.append(t),e))).execute()}_validate(){if(!(0,l.A)("feature-pipeline-3d-test-validation"))return;const e=new Array;for(const t of this._tileHandles.values()){if(!O(t))continue;const{featureData:r}=t;e.push({featureData:r,objectIds:new Set(r.enabledObjectIds())})}for(let t=0;t<e.length;++t){const{featureData:r,objectIds:n}=e[t];for(let i=t+1;i<e.length;++i){const{featureData:t,objectIds:s}=e[i];for(const e of s)if(n.has(e))throw new Error(`${r.id} and ${t.id} both contain ${e}.`)}}}_validateRemoval(e,t){if((0,l.A)("feature-pipeline-3d-test-validation"))for(const r of e.enabledObjectIds())if(t.has(r))throw new Error(`Failed to remove ${r} from ${e.id}!`)}};function I({lij:[e,t,r]},{lij:[n,i,s]}){const a=n-e;return a>=0&&t===i>>a&&r===s>>a}(0,n._)([(0,o.MZ)()],C.prototype,"updating",null),(0,n._)([(0,o.MZ)({constructOnly:!0})],C.prototype,"loadTile",void 0),(0,n._)([(0,o.MZ)({constructOnly:!0})],C.prototype,"createAddFeatureDataCommand",void 0),(0,n._)([(0,o.MZ)({constructOnly:!0})],C.prototype,"createRemoveFeatureDataCommand",void 0),(0,n._)([(0,o.MZ)({constructOnly:!0})],C.prototype,"createUpdateFeatureDataVisibilityCommand",void 0),(0,n._)([(0,o.MZ)()],C.prototype,"_updatingCount",void 0),(0,n._)([(0,o.MZ)()],C.prototype,"extent",void 0),(0,n._)([(0,o.MZ)()],C.prototype,"_boundingRect",null),(0,n._)([(0,o.MZ)()],C.prototype,"_missingTiles",null),C=(0,n._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],C);class T{constructor(e){this.descriptor=e,this._controller=new AbortController,this._featureData=(0,_.v)(null),this.nextEvent=null}get id(){return this.descriptor.id}get featureData(){return this._featureData.value}set featureData(e){this._featureData.value=e}get signal(){return this._controller.signal}abort(){this._controller.abort()}get aborted(){return this._controller.signal.aborted}async untilSettled(){try{await this.nextEvent}catch(e){(0,s.zf)(e)||console.error(e)}}}function O(e){return null!=e.featureData}class R{constructor(e,t,r){this.previousEventSettled=e,this.commandPromise=t,this.signal=r}async getCommand(){const{previousEventSettled:e,commandPromise:t,signal:r}=this,[n]=await Promise.all([t,e]);if(r?.aborted)throw(0,s.NK)();return{command:n,signal:r}}}var M=r(75503),E=r(27647),P=r(92722);class z{constructor(e,t){this._index=e,this._view=t}get usedMemory(){return v.qK+v.RS}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new F(this._index,this._view,e)}}class F extends z{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return(0,E.Q)(new P.A,this._geometryOverride,e.hasZ,e.hasM)}}class D{constructor(e,t){this.featureData=e,this.bounds=t}}class B{constructor(){this._tileBounds=new Map,this.events=new i.A,this.featureAdapter=j.shared}get usedMemory(){return v.qK+v.qK*this._tileBounds.size}addTile(e){const{featureCount:t}=e;if(0===t)return;const r=new M.w(9,(t=>e.getBounds(t))),n=new Array;for(let e=0;e<t;++e)n[e]=e;r.load(n),this._tileBounds.set(e.id,new D(e,r)),this.events.emit("changed")}removeTile(e){this._tileBounds.delete(e),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(e){for(const{featureData:t,bounds:r}of this._tileBounds.values())r.all((r=>{t.getEnabled(r)&&e(new z(r,t))}))}forEachInBounds(e,t){V.minX=e[0],V.minY=e[1],V.maxX=e[2],V.maxY=e[3];for(const{featureData:e,bounds:r}of this._tileBounds.values())r.search(V,(r=>{e.getEnabled(r)&&t(new z(r,e))}))}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const{bounds:e}of this._tileBounds.values()){const{minX:s,minY:a,maxX:o,maxY:l}=e.toJSON();t=Math.min(t,s),r=Math.min(r,a),n=Math.min(n,o),i=Math.min(i,l)}return{xmin:t,ymin:r,xmax:n,ymax:i,spatialReference:e}}}class j{static{this.shared=new j}getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}}const V=new M.E;var k=r(80893);class U{constructor(e,t,r){this.descriptor=e,this._pages=t,this._pageSize=r;const n=v.ez+t.reduce(((e,{usedMemory:t})=>e+t),0),i=3*v.RS;this.usedMemory=v.qK+n+i,this.featureCount=t.reduce(((e,t)=>e+t.featureCount),0)}get id(){return this.descriptor.id}getObjectId(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getObjectId(r)}getAttribute(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getAttribute(n,t)}getAttributeAsTimestamp(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getAttributeAsTimestamp(n,t)}getAttributes(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getAttributes(r)}getCoordinates(e,t,r){const{pageIndex:n,featurePageIndex:i}=this._translateIndex(e);this._pages[n].getCoordinates(i,t,r)}getOptimizedGeometry(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getOptimizedGeometry(r)}getCentroid(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getCentroid(n,t)}getBounds(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBounds(r)}getBoundingBox(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBoundingBox(r)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){let n=r;for(const{page:r,indices:i}of this._batchPageIndices(t))n=r.getObjectIdsArray(e,i,n);return n}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){let n=r;for(const{page:r,indices:i}of this._batchPageIndices(t))n=r.getCoordinatesArray(e,i,n);return n}*objectIds(e=this._allFeatureIndices()){for(const{page:t,indices:r}of this._batchPageIndices(e))for(const e of t.objectIds(r))yield e}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_translateIndex(e){const{_pageSize:t}=this;return{pageIndex:Math.floor(e/t),featurePageIndex:e%t}}*_batchPageIndices(e){const t=new Array;{let r=0,n=new Array;for(const i of e){const{pageIndex:e,featurePageIndex:s}=this._translateIndex(i);r!==e&&(0!==n.length&&t.push({pageIndex:r,indices:n}),r=e,n=[]),n.push(s)}0!==n.length&&t.push({pageIndex:r,indices:n})}const{_pages:r}=this;for(const{pageIndex:e,indices:n}of t)yield{page:r[e],indices:n}}}var N=r(49186),L=r(51624),q=r(51850),H=r(70328),G=r(62577),$=r(95466),Y=r(53655);class W{constructor(e){this._reader=new L.A(new Uint8Array(e),new DataView(e)),this._index=function(e){for(;e.next();){if(2===e.tag())return X(e.getMessage());e.skip()}Q()}(this._reader)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}get usedMemory(){return this._reader.usedMemory}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:n}}=this,i=r.get(t)?.index;if(null==i)return;const s=n[e*r.fields.length+i],a=this._reader;return a.move(s),J(a)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,n=e*t.fields.length,i=this._reader,s={};for(const e of t.fields){const t=r[n+e.index];i.move(t),s[e.name]=J(i)}return s}getCoordinates(e,t,r=0){const n=this._reader,{transform:i,featureIndices:s}=this._index,{scale:a,translate:o}=i;n.move(s[e]),this._readCoordinates(a,o,t,r)}getOptimizedGeometry(e){const t=(0,q.vt)();return this.getCoordinates(e,t),new P.A([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,K);const[n,i,s]=K,a=[n,i];return t&&(a[3]=s),r&&(a[t?4:3]=0),new P.A([],a)}getBounds(e){this.getCoordinates(e,K);const[t,r]=K,n=new M.E;return n.minX=t,n.minY=r,n.maxX=t,n.maxY=r,n}getBoundingBox(e){this.getCoordinates(e,K);const[t,r,n]=K;return(0,H.fA)(t,r,n,t,r,n)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){const n=this._reader,{objectIdFieldName:i,attributeIndices:s,fieldsIndex:a}=this._index,o=a.get(i).index,l=a.fields.length;for(const i of t){const t=s[i*l+o];n.move(t),e[r++]=J(n)}return r}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){const n=this._reader,{transform:i,featureIndices:s}=this._index,{scale:a,translate:o}=i;for(const i of t){const t=s[i];n.move(t),r=this._readCoordinates(a,o,e,r)}return r}*objectIds(e=this._allFeatureIndices()){const t=this._reader,{objectIdFieldName:r,attributeIndices:n,fieldsIndex:i}=this._index,s=i.get(r).index,a=i.fields.length;for(const r of e){const e=n[r*a+s];t.move(e),yield J(t)}}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_readCoordinates([e,t,r],[n,i,s],a,o){const l=this._reader,c=l.getLength(),d=l.pos()+c;for(;l.pos()<d&&l.next();)switch(l.tag()){case 2:{const c=l.getLength(),d=l.pos()+c;for(;l.pos()<d&&l.next();)3===l.tag()?(l.getUInt32(),a[o++]=n+e*l.getSInt64(),a[o++]=i+t*l.getSInt64(),a[o++]=s+r*l.getSInt64()):l.skip();break}default:l.skip()}return o}}function X(e){for(;e.next();){if(1===e.tag())return Z(e.getMessage());e.skip()}Q()}function Z(e){let t,r,n=!1,i=!1,s=0;const a=new Array,o=new Array,l=new Array;for(;e.next();)switch(e.tag()){case 1:r=e.getString();break;case 7:0!==e.getEnum()&&Q();break;case 9:n=e.getBool()??!1;break;case 12:t=(0,G.Q1)(e.processMessage(Y.ae));break;case 13:{const t=e.processMessage(Y.cn);t.index=s++,a.push(t);break}case 15:{o.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)1===e.tag()?(l.push(e.pos()),e.skip()):e.skip();break}case 10:i=e.getBool()??!1;break;default:e.skip()}const c=new $.A(a);return null!=t&&i&&null!=r&&c.has(r)||Q(),{transform:t,exceededTransferLimit:n,fieldsIndex:c,objectIdFieldName:r,featureIndices:o,attributeIndices:l}}function Q(){const e=new N.A("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(e),e}function J(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}const K=(0,q.vt)();class ee{constructor(e,t,r,n,i){this.spatialReference=e,this.url=r,this.objectIdField=n,this.capabilities=i;const{supportsMaxRecordCountFactor:s,maxRecordCount:a}=this.capabilities.query,o=s?4:1,l=(a??8e3)*o;this._pageSize=Math.min(8e3,l);const c=t.clone();c.cacheHint=!0,c.resultType="tile",c.outSpatialReference=e,c.returnGeometry=!0,c.returnZ=!0,c.maxRecordCountFactor=o,c.num=this._pageSize,c.outFields=[n],this._baseQuery=c}async fetch(e,t){const{spatialReference:r,_pageSize:n}=this,i=(0,b.w1)(e.extent,r),a=this._baseQuery.clone();a.geometry=i;const o=new Array;let l=0,c=!1,d=1;for(;!c;){const e=[];for(let r=0;r<d;++r)e.push(this._fetchPage(a,l++,t));const r=await Promise.all(e);(0,s.Te)(t);for(const e of r){const t=0!==e.featureCount;c||=!e.exceededTransferLimit||!t,t&&o.push(e)}d=Math.min(d+1,4)}return new U(e,o,n)}async _fetchPage(e,t,r){const n=e.clone();n.start=t*this._pageSize;const i=(await(0,k.kS)(this.url,n,{signal:r})).data;return(0,s.Te)(r),new W(i)}}var te=r(58083),re=r(9093),ne=r(97146),ie=r(24151),se=r(29920),ae=r(46540),oe=r(51768),le=r(34727),ce=r(77690),de=r(29242),ue=r(37585),he=r(48163),fe=r(38954),pe=r(91829);var me=r(13030),ge=r(78662),ye=r(26857),_e=r(1843),be=r(49255),ve=r(40268),xe=r(16943),we=r(25634),Se=r(11725),Ae=r(13464),Ce=r(77194),Ie=r(620);class Te{constructor(){this.scale=0,this.factor=0,this.minScaleFactor=0}}var Oe=r(59907),Re=r(43616),Me=r(13259),Ee=r(97220),Pe=r(98958),ze=r(59643),Fe=r(33524),De=r(63907),Be=r(90644);class je extends Pe.w{constructor(e,t){super(e,t,new Ee.$(Me.H,(()=>r.e(8241).then(r.bind(r,48241))))),this.primitiveType=t.occlusionPass?De.WR.POINTS:De.WR.TRIANGLES}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:n,output:i,depthTestEnabled:s,occlusionPass:a}=e,o=t===ze.Y.NONE,l=t===ze.Y.ColorAlpha,c=i===be.V.Highlight,d=s&&!n&&!l&&!a&&!c;return(0,Be.Ey)({blending:(0,be.RN)(i)?o?Be.Os:(0,Fe.ez)(t):null,depthTest:s&&!n?{func:De.MT.LEQUAL}:null,depthWrite:d?Be.Uy:null,drawBuffers:(0,Fe.m6)(t,i),colorWrite:Be.kn,polygonOffset:r?Ve:null})}}const Ve={factor:0,units:-4};var ke=r(53466),Ue=r(22911),Ne=r(51976),Le=r(35256);class qe extends Le.E{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.objectAndLayerIdColorInstanced=!1,this.horizonCullingEnabled=!0,this.isFocused=!0,this.textureCoordinateType=ke.I.None,this.emissionSource=Ue.ZX.None,this.discardInvisibleFragments=!0,this.hasVvInstancing=!1}}(0,n._)([(0,Ne.W)()],qe.prototype,"screenCenterOffsetUnitsEnabled",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"occlusionTestEnabled",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"signedDistanceFieldEnabled",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"vvSize",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"vvColor",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"hasVerticalOffset",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"hasScreenSizePerspective",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"hasRotation",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"debugDrawLabelBorder",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"hasPolygonOffset",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"depthTestEnabled",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"pixelSnappingEnabled",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"draped",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"terrainDepthTest",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"cullAboveTerrain",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"occlusionPass",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"occludedFragmentFade",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"objectAndLayerIdColorInstanced",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"horizonCullingEnabled",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"isFocused",void 0);var He=r(49788);class Ge extends Se.im{constructor(e,t){super(e,mt),this.produces=new Map([[Ae.N.HUD_MATERIAL,e=>(0,be.Mb)(e)&&!this.parameters.drawAsLabel],[Ae.N.LABEL_MATERIAL,e=>(0,be.Mb)(e)&&this.parameters.drawAsLabel],[Ae.N.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[Ae.N.DRAPED_MATERIAL,e=>this.parameters.draped&&(0,be.Mb)(e)]]),this._visible=!0,this._configuration=new qe(t)}getConfiguration(e,t){const r=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=r,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===Ae.N.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=!r&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||t.slot===Ae.N.OCCLUSION_PIXELS,(0,be.RN)(e)&&(this._configuration.debugDrawLabelBorder=!!ye.b.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,r,n,i,s){const{options:{selectionMode:a,hud:o,excludeLabels:l},point:c,camera:d}=r,{parameters:u}=this;if(!a||!o||l&&u.isLabel||!e.visible||!c)return;const h=e.attributes.get(ae.r.FEATUREATTRIBUTE),f=null==h?null:(0,pe.ci)(h.data,ct),{scaleX:p,scaleY:m}=bt(f,u,d.pixelRatio);(0,ce.z0)(nt,t),e.attributes.has(ae.r.FEATUREATTRIBUTE)&&function(e){const t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],d=1/Math.sqrt(t*t+r*r+n*n),u=1/Math.sqrt(i*i+s*s+a*a),h=1/Math.sqrt(o*o+l*l+c*c);e[0]=t*d,e[1]=r*d,e[2]=n*d,e[3]=i*u,e[4]=s*u,e[5]=a*u,e[6]=o*h,e[7]=l*h,e[8]=c*h}(nt);const g=e.attributes.get(ae.r.POSITION),y=e.attributes.get(ae.r.SIZE),_=e.attributes.get(ae.r.NORMAL),b=e.attributes.get(ae.r.ROTATION),v=e.attributes.get(ae.r.CENTEROFFSETANDDISTANCE);(0,Ie.vA)(g.size>=3);const x=(0,Me.c)(u),w="screen"===this.parameters.centerOffsetUnits;for(let e=0;e<g.data.length/g.size;e++){const n=e*g.size;(0,fe.i)(Ze,g.data[n],g.data[n+1],g.data[n+2]),(0,fe.t)(Ze,Ze,t),(0,fe.t)(Ze,Ze,d.viewMatrix);const i=e*v.size;if((0,fe.i)(ot,v.data[i],v.data[i+1],v.data[i+2]),!w&&(Ze[0]+=ot[0],Ze[1]+=ot[1],0!==ot[2])){const e=ot[2];(0,fe.n)(ot,Ze),(0,fe.d)(Ze,Ze,(0,fe.h)(ot,ot,e))}const a=e*_.size;if((0,fe.i)(Qe,_.data[a],_.data[a+1],_.data[a+2]),Ye(Qe,nt,d,dt),vt(this.parameters,Ze,dt,d,Xe),d.applyProjection(Ze,Je),Je[0]>-1){w&&(ot[0]||ot[1])&&(Je[0]+=ot[0]*d.pixelRatio,0!==ot[1]&&(Je[1]+=(0,Ce.m0)(ot[1],Xe.factorAlignment)*d.pixelRatio),d.unapplyProjection(Je,Ze)),Je[0]+=this.parameters.screenOffset[0]*d.pixelRatio,Je[1]+=this.parameters.screenOffset[1]*d.pixelRatio,Je[0]=Math.floor(Je[0]),Je[1]=Math.floor(Je[1]);const t=e*y.size;ft[0]=y.data[t],ft[1]=y.data[t+1],(0,Ce.MD)(ft,Xe.factor,ft);const n=ut*d.pixelRatio;let i=0;u.textureIsSignedDistanceField&&(i=Math.min(u.outlineSize,.5*ft[0])*d.pixelRatio/2),ft[0]*=p,ft[1]*=m;const a=e*b.size,o=u.rotation+b.data[a];if(We(c,Je[0],Je[1],ft,n,i,o,u,x)){const e=r.ray;if((0,fe.t)(et,Ze,(0,te.B8)(st,d.viewMatrix)),Je[0]=c[0],Je[1]=c[1],d.unprojectFromRenderScreen(Je,Ze)){const t=(0,q.vt)();(0,fe.c)(t,e.direction);const r=1/(0,fe.l)(t);(0,fe.h)(t,t,r),s((0,fe.j)(e.origin,Ze)*r,t,-1,!0,1,et)}}}}}intersectDraped(e,t,r,n,i,s){const a=e.attributes.get(ae.r.POSITION),o=e.attributes.get(ae.r.SIZE),l=e.attributes.get(ae.r.ROTATION),c=this.parameters,d=(0,Me.c)(c),u=e.attributes.get(ae.r.FEATUREATTRIBUTE),h=null==u?null:(0,pe.ci)(u.data,ct),{scaleX:f,scaleY:p}=bt(h,c,e.screenToWorldRatio),m=ht*e.screenToWorldRatio;for(let t=0;t<a.data.length/a.size;t++){const r=t*a.size,u=a.data[r],h=a.data[r+1],g=t*o.size;ft[0]=o.data[g],ft[1]=o.data[g+1];let y=0;c.textureIsSignedDistanceField&&(y=Math.min(c.outlineSize,.5*ft[0])*e.screenToWorldRatio/2),ft[0]*=f,ft[1]*=p;const _=t*l.size,b=c.rotation+l.data[_];We(n,u,h,ft,m,y,b,c,d)&&i(s.dist,s.normal,-1,!1)}}createBufferWriter(){return new _t}applyShaderOffsetsView(e,t,r,n,i,s,a){const o=Ye(t,r,i,dt);return this._applyVerticalGroundOffsetView(e,o,i,a),vt(this.parameters,a,o,i,s),this._applyPolygonOffsetView(a,o,n[3],i,a),this._applyCenterOffsetView(a,n,a),a}applyShaderOffsetsNDC(e,t,r,n,i){return this._applyCenterOffsetNDC(e,t,r,n),null!=i&&(0,fe.c)(i,n),this._applyPolygonOffsetNDC(n,t,r,n),n}_applyPolygonOffsetView(e,t,r,n,i){const s=n.aboveGround?1:-1;let a=Math.sign(r);0===a&&(a=s);const o=s*a;if(this.parameters.shaderPolygonOffset<=0)return(0,fe.c)(i,e);const l=(0,le.qE)(Math.abs(t.cosAngle),.01,1),c=1-Math.sqrt(1-l*l)/l/n.viewport[2];return(0,fe.h)(i,e,o>0?c:1/c),i}_applyVerticalGroundOffsetView(e,t,r,n){const i=(0,fe.l)(e),s=r.aboveGround?1:-1,a=r.computeRenderPixelSizeAtDist(i)*ve.R,o=(0,fe.h)(Ze,t.normal,s*a);return(0,fe.g)(n,e,o),n}_applyCenterOffsetView(e,t,r){const n="screen"!==this.parameters.centerOffsetUnits;return r!==e&&(0,fe.c)(r,e),n&&(r[0]+=t[0],r[1]+=t[1],t[2]&&((0,fe.n)(Qe,r),(0,fe.g)(r,r,(0,fe.h)(Qe,Qe,t[2])))),r}_applyCenterOffsetNDC(e,t,r,n){const i="screen"!==this.parameters.centerOffsetUnits;return n!==e&&(0,fe.c)(n,e),i||(n[0]+=t[0]/r.fullWidth*2,n[1]+=t[1]/r.fullHeight*2),n}_applyPolygonOffsetNDC(e,t,r,n){const i=this.parameters.shaderPolygonOffset;if(e!==n&&(0,fe.c)(n,e),i){const e=r.aboveGround?1:-1,s=e*Math.sign(t[3]);n[2]-=(s||e)*i}return n}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:r}=this.parameters,n=e[3]>=He.Q||t>=He.Q&&r[3]>=He.Q;return this._visible&&n}createGLMaterial(e){return new $e(e)}calculateRelativeScreenBounds(e,t,r=(0,b.vt)()){return function(e,t,r,n){n[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,n[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class $e extends we.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(je,e)}}function Ye(e,t,r,n){return function(e){return(t=e)instanceof Float32Array&&t.length>=16||function(e){return Array.isArray(e)&&e.length>=16}(e);var t}(t)&&(t=(0,ce.z0)(it,t)),(0,fe.q)(n.normal,e,t),(0,fe.t)(n.normal,n.normal,r.viewInverseTransposeMatrix),n.cosAngle=(0,fe.f)(Ke,pt),n}function We(e,t,r,n,i,s,a,o,l){let c=t-i-n[0]*l[0],d=c+n[0]+2*i,u=r-i-n[1]*l[1],h=u+n[1]+2*i;const f=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&null!=f&&(c+=n[0]*f[0],u+=n[1]*f[1],d-=n[0]*(1-f[2]),h-=n[1]*(1-f[3]),c-=s,d+=s,u-=s,h+=s),(0,ue.hZ)(rt,t,r),(0,ue.e$)(tt,e,rt,(0,le.kU)(a)),tt[0]>c&&tt[0]<d&&tt[1]>u&&tt[1]<h}const Xe=new class{constructor(){this.factor=new Te,this.factorAlignment=new Te}},Ze=(0,q.vt)(),Qe=(0,q.vt)(),Je=(0,pe.vt)(),Ke=(0,q.vt)(),et=(0,q.vt)(),tt=(0,he.vt)(),rt=(0,he.vt)(),nt=(0,de.vt)(),it=(0,de.vt)(),st=(0,re.vt)(),at=(0,pe.vt)(),ot=(0,q.vt)(),lt=(0,q.vt)(),ct=(0,pe.vt)(),dt={normal:Ke,cosAngle:0},ut=1,ht=2,ft=(0,he.fA)(0,0),pt=(0,q.fA)(0,0,1);class mt extends we.NV{constructor(){super(...arguments),this.renderOccluded=Se.m$.Occlude,this.isDecoration=!1,this.color=(0,pe.CN)(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=(0,he.fA)(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=(0,pe.CN)(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=(0,pe.vt)(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusEffect="none",this.draped=!1,this.isLabel=!1}}const gt=(0,_e.BP)().vec3f(ae.r.POSITION).vec3f(ae.r.NORMAL).vec2i16(ae.r.UVI).vec4u8(ae.r.COLOR).vec2f(ae.r.SIZE).f32(ae.r.ROTATION).vec4f(ae.r.CENTEROFFSETANDDISTANCE).vec4f(ae.r.FEATUREATTRIBUTE),yt=gt.clone().vec4u8(ae.r.OLIDCOLOR);class _t{constructor(){this.vertexBufferLayout=(0,xe.E)()?yt:gt}elementCount(e){return 6*e.get(ae.r.POSITION).indices.length}write(e,t,r,n,i,s){const{position:a,normal:o,uvi:l,color:c,size:d,rotation:u,centerOffsetAndDistance:h,featureAttribute:f}=i;(0,Oe.Hk)(r.get(ae.r.POSITION),e,a,s,6),(0,Oe.p1)(r.get(ae.r.NORMAL),t,o,s,6);const p=r.get(ae.r.UVI)?.data;let m=0,g=0,y=-1-Me.f,_=-1-Me.f;p&&p.length>=4&&(m=p[0],g=p[1],y=-1-p[2],_=-1-p[3]);let b=r.get(ae.r.POSITION).indices.length,v=s;for(let e=0;e<b;++e)l.set(v,0,m),l.set(v,1,g),v++,l.set(v,0,y),l.set(v,1,g),v++,l.set(v,0,y),l.set(v,1,_),v++,l.set(v,0,y),l.set(v,1,_),v++,l.set(v,0,m),l.set(v,1,_),v++,l.set(v,0,m),l.set(v,1,g),v++;(0,Oe.tb)(r.get(ae.r.COLOR),4,c,s,6);const{data:x,indices:w}=r.get(ae.r.SIZE);b=w.length,v=s;for(let e=0;e<b;++e){const t=x[2*w[e]],r=x[2*w[e]+1];for(let e=0;e<6;++e)d.set(v,0,t),d.set(v,1,r),v++}if((0,Oe.uO)(r.get(ae.r.ROTATION),u,s,6),r.get(ae.r.CENTEROFFSETANDDISTANCE)?(0,Oe.Ut)(r.get(ae.r.CENTEROFFSETANDDISTANCE),h,s,6):(0,Oe.Pq)(h,s,6*b),r.get(ae.r.FEATUREATTRIBUTE)?(0,Oe.Ut)(r.get(ae.r.FEATUREATTRIBUTE),f,s,6):(0,Oe.Pq)(f,s,6*b),null!=n){const e=r.get(ae.r.POSITION)?.indices;if(e){const t=e.length,r=i.getField(ae.r.OLIDCOLOR,me.XP);(0,Oe.vx)(n,r,t,s,6)}}return{numVerticesPerItem:6,numItems:b}}intersect(e,t,r,n,i,s,a){const{options:{selectionMode:o,hud:l,excludeLabels:c},point:d,camera:u}=n;if(!o||!l||c&&t.isLabel||!d)return;const h=this.vertexBufferLayout.createView(e),f=h.getField(ae.r.POSITION,me.xs),p=h.getField(ae.r.NORMAL,me.xs),m=h.getField(ae.r.ROTATION,me.Y$),g=h.getField(ae.r.SIZE,me.gH),y=h.getField(ae.r.FEATUREATTRIBUTE,me.Eq),_=h.getField(ae.r.CENTEROFFSETANDDISTANCE,me.Eq),b="screen"===t.centerOffsetUnits,v=(0,Me.c)(t);if(null==f||null==p||null==m||null==g||null==_)return;const x=null==y?null:y.getVec(0,ct),{scaleX:w,scaleY:S}=bt(x,t,u.pixelRatio),A=f.count/6;for(let e=0;e<A;e++){const i=6*e;if(f.getVec(i,Ze),null!=r&&(0,fe.g)(Ze,Ze,r),(0,fe.t)(Ze,Ze,u.viewMatrix),_.getVec(i,at),(0,fe.i)(ot,at[0],at[1],at[2]),!b&&(Ze[0]+=ot[0],Ze[1]+=ot[1],0!==ot[2])){const e=ot[2];(0,fe.n)(ot,Ze),(0,fe.d)(Ze,Ze,(0,fe.h)(ot,ot,e))}if(p.getVec(i,Qe),Ye(Qe,nt,u,dt),vt(t,Ze,dt,u,Xe),u.applyProjection(Ze,Je),Je[0]>-1){b&&(ot[0]||ot[1])&&(Je[0]+=ot[0]*u.pixelRatio,0!==ot[1]&&(Je[1]+=(0,Ce.m0)(ot[1],Xe.factorAlignment)*u.pixelRatio),u.unapplyProjection(Je,Ze)),Je[0]+=t.screenOffset[0]*u.pixelRatio,Je[1]+=t.screenOffset[1]*u.pixelRatio,Je[0]=Math.floor(Je[0]),Je[1]=Math.floor(Je[1]),g.getVec(i,ft),(0,Ce.MD)(ft,Xe.factor,ft);const r=ut*u.pixelRatio;let s=0;t.textureIsSignedDistanceField&&(s=Math.min(t.outlineSize,.5*ft[0])*u.pixelRatio/2),ft[0]*=w,ft[1]*=S;const o=m.get(i),l=t.rotation+o;if(We(d,Je[0],Je[1],ft,r,s,l,t,v)){const t=n.ray;if((0,fe.t)(et,Ze,(0,te.B8)(st,u.viewMatrix)),Je[0]=d[0],Je[1]=d[1],u.unprojectFromRenderScreen(Je,Ze)){const r=(0,q.vt)();(0,fe.c)(r,t.direction);const n=1/(0,fe.l)(r);(0,fe.h)(r,r,n),a((0,fe.j)(t.origin,Ze)*n,r,e,!0,1,et)}}}}}}function bt(e,t,r){return null==e||null==t.vvSize?{scaleX:r,scaleY:r}:((0,ge.VC)(lt,t,e),{scaleX:lt[0]*r,scaleY:lt[1]*r})}function vt(e,t,r,n,i){if(!e.verticalOffset?.screenLength)return e.screenSizePerspective||e.screenSizePerspectiveAlignment?xt(e,i,(0,fe.l)(t),r.cosAngle):(i.factor.scale=1,i.factorAlignment.scale=1),t;const s=(0,fe.l)(t),a=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=(0,Re.kE)(n,s,e.verticalOffset,r.cosAngle,a);return xt(e,i,s,r.cosAngle),(0,fe.h)(r.normal,r.normal,o),(0,fe.g)(t,t,r.normal)}function xt(e,t,r,n){null!=e.screenSizePerspective?(0,Ce.cJ)(n,r,e.screenSizePerspective,t.factor):(t.factor.scale=1,t.factor.factor=0,t.factor.minScaleFactor=0),null!=e.screenSizePerspectiveAlignment?(0,Ce.cJ)(n,r,e.screenSizePerspectiveAlignment,t.factorAlignment):(t.factorAlignment.factor=t.factor.factor,t.factorAlignment.scale=t.factor.scale,t.factorAlignment.minScaleFactor=t.factor.minScaleFactor)}class wt{constructor(e,t){this._mainThreadDelegate=t,this._bufferWriters=new Map,this._sharedTextures=new Map,this.globalViewingMode=e===ie.RT.Global}createRenderCommandBuffer(){return{commands:[],transferList:[]}}mergeRenderCommandBuffers(e){const t=this.createRenderCommandBuffer();for(const r of e)null!=r&&(t.commands.push(...r.commands),t.transferList.push(...r.transferList));return t}async getOrCreateSharedTexture(e,t){const{data:r,parameters:n}=t(),i=await this._mainThreadDelegate.createTexture(r,n);return this._sharedTextures.set(e,i),i}async releaseSharedTexture(e){const t=this._sharedTextures,r=t.get(e);null!=r&&(t.delete(e),await this._mainThreadDelegate.releaseTexture(r))}async createMaterial(e){const{type:t,parameters:r}=e,n=w("material");let i,s;switch(t){case"default":i=new oe.$U(e.parameters,{spherical:this.globalViewingMode}),s={type:t,id:n,parameters:e.parameters};break;case"hud":i=new Ge(r,this.globalViewingMode),s={type:t,id:n,parameters:e.parameters}}return this._bufferWriters.set(n,i.createBufferWriter()),await this._mainThreadDelegate.createMaterial(s),n}async createDirectRenderer(e){return await this._mainThreadDelegate.createDirectRenderer(e),e}addDirectRendererGeometry(e,t,r){const{materialId:n}=t;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.addDirectRendererGeometryBuffer(n,e,i,s,r)}updateDirectRendererGeometry(e,t,r){const{materialId:n}=t;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.updateDirectRendererGeometryBuffer(n,e,i,s,r)}addDirectRendererGeometryBuffer(e,t,r,n,i){const{objectIds:s,visibilities:a}=n;return{commands:[{id:"add-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:n,localOrigin:i}],transferList:[r.data,s.buffer,a.buffer]}}updateDirectRendererGeometryBuffer(e,t,r,n,i){const{objectIds:s,visibilities:a}=n;return{commands:[{id:"update-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:n,localOrigin:i}],transferList:[r.data,s.buffer,a.buffer]}}removeDirectRendererGeometryBuffer(e,t){return{commands:[{id:"remove-direct-renderer-geometry-buffer",rendererId:e,groupId:t}],transferList:[]}}async createLodRenderer(e){const t=w("lod-renderer"),r=new Set,n={levels:e.levels.map((e=>({components:e.components.map((e=>{const t=e.attributes.get(ae.r.POSITION);if(!t||0===t.indices.length)throw new Error("positions attribute expected");const n=(0,ne.tM)(t.indices.length/3),i=new se.j(n,3,t);if(null==this._bufferWriters.get(e.materialId))throw new Error("writer not found");const{renderGeometryBuffer:s}=this.createRenderGeometryBuffer(e,null);return r.add(s.data),{materialId:e.materialId,renderGeometryBuffer:s,boundingInfo:{bbMax:i.bbMax,bbMin:i.bbMin}}})),minScreenSpaceRadius:e.minScreenSpaceRadius})))};return await this._mainThreadDelegate.createLodRenderer(t,n,Array.from(r)),t}addLodInstances(e,t,r){return{commands:[{id:"add-lod-instances",rendererId:e,groupId:t,data:r}],transferList:[r.featureIds.buffer,r.globalTransforms.buffer,r.localTransforms.buffer,r.visibility.buffer]}}removeLodInstances(e,t){return{commands:[{id:"remove-lod-instances",rendererId:e,groupId:t}],transferList:[]}}updateLodInstancesData(e,t,r){return{commands:[{id:"update-lod-instance-data",rendererId:e,groupId:t,globalTransforms:r}],transferList:[r.buffer]}}updateVisibility(e,t,r){return{commands:[{id:"update-visibility",rendererId:e,groupId:t,visibility:r}],transferList:[r.buffer]}}async dispatchRenderCommands(e){0!==e.commands.length&&await this._mainThreadDelegate.executeRenderCommands(e)}createRenderGeometryBuffer(e,t){const{materialId:r,visibilities:n,objectIds:i}=e,s=this._bufferWriters.get(r);if(null==s)throw new Error("no registered bufferWriter for material found");let a=null;if(e.transformation&&t)(0,te.C)(St,e.transformation),St[12]-=t[0],St[13]-=t[1],St[14]-=t[2],a=St;else{if(t)throw new Error("not implemented");e.transformation&&(a=e.transformation)}let o=null;a&&((0,te.B8)(At,St),(0,te.mg)(At,At),o=At);const l=e.attributes,c=s.elementCount(l),d=s.vertexBufferLayout.stride/4;c>Math.floor(Ct/d)&&console.warn("geometry with very large number of elements encountered");const u=s.vertexBufferLayout.createBuffer(c),h=s.write(a,o,l,e.objectAndLayerIdColor,u,0);if(null==h)throw new Error("Bufferwriter.write does not provide item information.");if(n.length!==h.numItems||i.length!==h.numItems)throw new Error("Unexpected mismatch between number of RenderGeometryBufferItems and provided objectIds/visibility flags.");return{renderGeometryBuffer:{data:u.buffer,elementCount:c},renderGeometryBufferItems:{objectIds:i,visibilities:n,ranges:{numVertices:h.numVerticesPerItem,numItems:h.numItems}}}}}const St=(0,re.vt)(),At=(0,re.vt)(),Ct=4194304;class It{constructor(e,t,r){this.renderCommandContext=e,this.renderCommandBuffer=t,this.pipelineStateCommands=r}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const t of e)this.appendPipelineStateCommand(t)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}}var Tt=r(9762),Ot=r(27993);function Rt(e){const{featureCount:t}=e;if(0===t)return new Uint32Array;const r=new Uint32Array(t);return e.getObjectIdsArray(r),r}function Mt(e){const{featureCount:t}=e;if(0===t)return new Float64Array;const r=new Float64Array(3*t);return e.getCoordinatesArray(r),r}function Et(e,t){const r=t.viewSpatialReference,n=t.renderSpatialReference,{extent:i}=e,s=(0,b.gX)(i),a=(0,q.vt)();return(0,Ot.F)([s[0],s[1],0],r,a,n),a}var Pt=r(48353),zt=r(8887),Ft=r(83047);function Dt(e){const t=new Map;for(const[r,n]of e)t.set(r,{...n,indices:(0,ne.Dg)(n.indices)});return t}r(87317),r(12359),r(95108),r(27615),r(52106),r(4718),r(34275),r(65864);var Bt,jt,Vt=r(57917),kt=r(72385),Ut=(r(4197),r(11868)),Nt=r(240),Lt=(r(71351),r(46610));(jt=Bt||(Bt={})).length=function(e,t){const r=e[t],n=e[t+1],i=e[t+2];return Math.sqrt(r*r+n*n+i*i)},jt.normalize=function(e,t){const r=e[t],n=e[t+1],i=e[t+2],s=1/Math.sqrt(r*r+n*n+i*i);e[t]*=s,e[t+1]*=s,e[t+2]*=s},jt.scale=function(e,t,r){e[t]*=r,e[t+1]*=r,e[t+2]*=r},jt.add=function(e,t,r,n,i,s=t){(i=i||e)[s]=e[t]+r[n],i[s+1]=e[t+1]+r[n+1],i[s+2]=e[t+2]+r[n+2]},jt.subtract=function(e,t,r,n,i,s=t){(i=i||e)[s]=e[t]-r[n],i[s+1]=e[t+1]-r[n+1],i[s+2]=e[t+2]-r[n+2]},r(96672),r(87170);const qt=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)qt[6*e+t]=e;const Ht=new Array(36);for(let e=0;e<6;e++)Ht[6*e]=0,Ht[6*e+1]=1,Ht[6*e+2]=2,Ht[6*e+3]=2,Ht[6*e+4]=3,Ht[6*e+5]=0;const Gt=(0,kt.fA)(-.5,0,-.5),$t=(0,kt.fA)(.5,0,-.5),Yt=(0,kt.fA)(0,0,.5),Wt=(0,kt.fA)(0,.5,0),Xt=(0,kt.vt)(),Zt=(0,kt.vt)(),Qt=(0,kt.vt)(),Jt=(0,kt.vt)(),Kt=(0,kt.vt)();function er(e,t){switch(e){case"cone":return((e,r,n=!1)=>({levels:e.map((e=>{const i=Dt(r(e.tesselation));return n&&function(e){const t=e,r=t.get(ae.r.POSITION).data,n=t.get(ae.r.NORMAL).data;if(n){const t=tr(e,ae.r.NORMAL).data;for(let e=0;e<n.length;e+=3){const r=n[e+1];t[e+1]=-n[e+2],t[e+2]=r}}if(r){const t=tr(e,ae.r.POSITION).data;for(let e=0;e<r.length;e+=3){const n=r[e+1];t[e+1]=-r[e+2],t[e+2]=n}}}(i),{components:[{attributes:i,objectAndLayerIdColor:void 0,transformation:null,materialId:t,visibilities:new Uint8Array([1]),objectIds:new Uint32Array([-1])}],minScreenSpaceRadius:e.minScreenSpaceRadius}}))}))(rr,(e=>function(e,t,r,n,i=!0,s=!0){let a=0;const o=t,l=e;let c=(0,kt.fA)(0,a,0),d=(0,kt.fA)(0,a+l,0),u=(0,kt.fA)(0,-1,0),h=(0,kt.fA)(0,1,0);n&&(a=l,d=(0,kt.fA)(0,0,0),c=(0,kt.fA)(0,a,0),u=(0,kt.fA)(0,1,0),h=(0,kt.fA)(0,-1,0));const f=[d,c],p=[u,h],m=r+2,g=Math.sqrt(l*l+o*o);if(n)for(let e=r-1;e>=0;e--){const t=e*(2*Math.PI/r),n=(0,kt.fA)(Math.cos(t)*o,a,Math.sin(t)*o);f.push(n);const i=(0,kt.fA)(l*Math.cos(t)/g,-o/g,l*Math.sin(t)/g);p.push(i)}else for(let e=0;e<r;e++){const t=e*(2*Math.PI/r),n=(0,kt.fA)(Math.cos(t)*o,a,Math.sin(t)*o);f.push(n);const i=(0,kt.fA)(l*Math.cos(t)/g,o/g,l*Math.sin(t)/g);p.push(i)}const y=new Array,_=new Array;if(i){for(let e=3;e<f.length;e++)y.push(1),y.push(e-1),y.push(e),_.push(0),_.push(0),_.push(0);y.push(f.length-1),y.push(2),y.push(1),_.push(0),_.push(0),_.push(0)}if(s){for(let e=3;e<f.length;e++)y.push(e),y.push(e-1),y.push(0),_.push(e),_.push(e-1),_.push(1);y.push(0),y.push(2),y.push(f.length-1),_.push(1),_.push(2),_.push(p.length-1)}const b=(0,Ut.oe)(3*m);for(let e=0;e<m;e++)b[3*e]=f[e][0],b[3*e+1]=f[e][1],b[3*e+2]=f[e][2];const v=(0,Ut.oe)(3*m);for(let e=0;e<m;e++)v[3*e]=p[e][0],v[3*e+1]=p[e][1],v[3*e+2]=p[e][2];return[[ae.r.POSITION,new Lt.n(b,y,3,!0)],[ae.r.NORMAL,new Lt.n(v,_,3,!0)]]}(1,.5,e,!1)),!0);case"sphere":case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function tr(e,t){let r=e.get(t);return r&&!r.exclusive&&(r={...r,exclusive:!0,data:(0,Vt.S)(r.data)},e.set(t,r)),r}(0,fe.d)(Xt,Gt,Wt),(0,fe.d)(Zt,Gt,$t),(0,fe.e)(Qt,Xt,Zt),(0,fe.n)(Qt,Qt),(0,fe.d)(Xt,$t,Wt),(0,fe.d)(Zt,$t,Yt),(0,fe.e)(Jt,Xt,Zt),(0,fe.n)(Jt,Jt),(0,fe.d)(Xt,Yt,Wt),(0,fe.d)(Zt,Yt,Gt),(0,fe.e)(Kt,Xt,Zt),(0,fe.n)(Kt,Kt),Qt[0],Qt[1],Qt[2],Jt[0],Jt[1],Jt[2],Kt[0],Kt[1],Kt[2],(0,q.vt)();const rr=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];var nr=r(74810);class ir{constructor(e){this._context=e,this.lodRendererId=null,this._loaded=!1,this._loadingPromise=null,this._primitive="cone"}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const e=this._context.renderCommandContext,t={usePBR:!0,isSchematic:!0,mrrFactors:nr.Bt,ambient:q.Un,diffuse:q.Un,hasSlicePlane:!1,castShadows:!0,offsetTransparentBackfaces:!1,screenSizePerspective:{}};t.externalColor=pe.Un,t.isInstanced=!0;const r=await e.createMaterial({type:"default",parameters:t}),n=er(this._primitive,r);this.lodRendererId=await e.createLodRenderer(n),this._loaded=!0}async createAddCommand(e){const t=this._context,{renderCommandContext:r,mainThreadDelegate:n}=t;if(null==this.lodRendererId)throw new Error("expected lod renderer id to not be null");const{featureCount:i}=e;if(0===i)return r.createRenderCommandBuffer();const s=(0,H.vt)((0,zt.Fq)(this._primitive)),a=(0,q.ci)((0,H.Ej)(s)),o=(0,q.ci)((0,zt.Bb)(a,{isPrimitive:!0,width:100,depth:null,height:null})),l=new Float64Array(16*i),c=new Float64Array(16*i),d=Mt(e),u=await n.applyElevationAlignmentTo(d);for(let e=0;e<i;++e){const t=e,r=u[3*e+0],n=u[3*e+1],i=u[3*e+2],s=this._computeGlobalTransform(r,n,i,this._context.viewSpatialReference,or),d=this._computeLocalTransform(o,a,ar);this._writeMatrixToTypedBuffer(l,t,d),this._writeMatrixToTypedBuffer(c,t,s)}const h=Rt(e),f=new Uint8Array(i);e.getVisibilityArray(f);const p={featureIds:new Uint32Array(h),visibility:f,localTransforms:l,globalTransforms:c};return r.addLodInstances(this.lodRendererId,e.id,p)}async createRemoveCommand(e){const{_context:t,lodRendererId:r}=this,n=t.renderCommandContext;return null==r?n.createRenderCommandBuffer():n.removeLodInstances(r,e)}async createUpdateVisibilityCommand(e){const{lodRendererId:t,_context:r}=this,n=r.renderCommandContext;if(null==t)return n.createRenderCommandBuffer();const i=new Uint8Array(e.featureCount);return e.getVisibilityArray(i),n.updateVisibility(t,e.id,i)}async createUpdateElevationCommand(e){const{_context:t,lodRendererId:r}=this,{renderCommandContext:n,mainThreadDelegate:i}=t,{featureCount:s,id:a}=e;if(null==r||0===s)return n.createRenderCommandBuffer();const o=new Float64Array(16*s),l=Mt(e),c=await i.applyElevationAlignmentTo(l);for(let e=0;e<s;++e){const t=e,r=c[3*e+0],n=c[3*e+1],i=c[3*e+2],s=this._computeGlobalTransform(r,n,i,this._context.viewSpatialReference,or);this._writeMatrixToTypedBuffer(o,t,s)}return n.updateLodInstancesData(r,a,o)}_writeMatrixToTypedBuffer(e,t,r){let n=16*t;for(let t=0;t<16;t++)e[n++]=r[t]}_computeGlobalTransform(e,t,r,n,i){return sr[0]=e,sr[1]=t,sr[2]=r,(0,Pt.l)(n,sr,i,this._context.renderSpatialReference),i}_computeLocalTransform(e,t,r){return(0,te.D_)(r),this._applyObjectScale(e,t,r),r}_applyObjectScale(e,t,r){const n=function(e=q.Un,t,r,n=1){const i=new Array(3);if(null==t||null==r)i[0]=1,i[1]=1,i[2]=1;else{let n,s=0;for(let a=2;a>=0;a--){const o=e[a],l=null!=o,c=0===a&&!n&&!l,d=r[a];let u;"symbol-value"===o||c?u=0!==d?t[a]/d:1:l&&"proportional"!==o&&isFinite(o)&&(u=0!==d?o/d:1),null!=u&&(i[a]=u,n=u,s=Math.max(s,Math.abs(u)))}for(let e=2;e>=0;e--)null==i[e]?i[e]=n:0===i[e]&&(i[e]=.001*s)}for(let e=2;e>=0;e--)i[e]/=n;return(0,q.ci)(i)}(e,e,t,this._context.renderCoordsHelper.unitInMeters);1===n[0]&&1===n[1]&&1===n[2]||(0,te.hs)(r,r,n)}}const sr=(0,q.vt)(),ar=(0,re.vt)(),or=(0,re.vt)();var lr=r(97768);new Map,(()=>{let e="";for(let t=32;t<127;t++)e+=String.fromCharCode(t)})();const cr=[];{const e=16;for(let t=0;t<360;t+=360/e)cr.push([Math.cos(Math.PI*t/180),Math.sin(Math.PI*t/180)])}var dr,ur;(ur=dr||(dr={}))[ur.Left=0]="Left",ur[ur.Center=1]="Center",ur[ur.Right=2]="Right",Object.freeze({left:0,center:.5,right:1});const hr=Object.freeze({"bottom-left":(0,he.fA)(0,0),bottom:(0,he.fA)(.5,0),"bottom-right":(0,he.fA)(1,0),left:(0,he.fA)(0,.5),center:(0,he.fA)(.5,.5),right:(0,he.fA)(1,.5),"top-left":(0,he.fA)(0,1),top:(0,he.fA)(.5,1),"top-right":(0,he.fA)(1,1)});var fr=r(40804);r(48833);const pr=(0,pe.CN)(.25,.25,.75,.75);function mr(e){return"cross"===e||"x"===e}function gr(e,t=128,r=.5*t,n=0){switch(e){case"circle":default:return function(e,t){const r=e/2-.5;return xr(e,br(r,r,t/2))}(t,r);case"square":return function(e,t){return yr(e,t,!1)}(t,r);case"cross":return function(e,t,r=0){return _r(e,t,!1,r)}(t,r,n);case"x":return function(e,t,r=0){return _r(e,t,!0,r)}(t,r,n);case"kite":return function(e,t){return yr(e,t,!0)}(t,r);case"triangle":return function(e,t){return xr(e,vr(e/2,t,t/2))}(t,r);case"arrow":return function(e,t){const r=t,n=t/2,i=e/2,s=.8*r,a=br(i,(e-t)/2-s,Math.sqrt(s*s+n*n)),o=vr(i,r,n);return xr(e,((e,t)=>Math.max(o(e,t),-a(e,t))))}(t,r)}}function yr(e,t,r){return r&&(t/=Math.SQRT2),xr(e,((n,i)=>{let s=n-.5*e+.25,a=.5*e-i-.75;if(r){const e=(s+a)/Math.SQRT2;a=(a-s)/Math.SQRT2,s=e}return Math.max(Math.abs(s),Math.abs(a))-.5*t}))}function _r(e,t,r,n=0){t-=n,r&&(t*=Math.SQRT2);const i=.5*t;return xr(e,((t,s)=>{let a,o=t-.5*e,l=.5*e-s-1;if(r){const e=(o+l)/Math.SQRT2;l=(l-o)/Math.SQRT2,o=e}return o=Math.abs(o),l=Math.abs(l),a=o>l?o>i?Math.sqrt((o-i)*(o-i)+l*l):l:l>i?Math.sqrt(o*o+(l-i)*(l-i)):o,a-=n/2,a}))}function br(e,t,r){return(n,i)=>{const s=n-e,a=i-t;return Math.sqrt(s*s+a*a)-r}}function vr(e,t,r){const n=Math.sqrt(t*t+r*r);return(i,s)=>{const a=Math.abs(i-e)-r,o=s-e+t/2+.75,l=(t*a+r*o)/n,c=-o;return Math.max(l,c)}}function xr(e,t){const r=new Uint8Array(4*e*e);for(let n=0;n<e;n++)for(let i=0;i<e;i++){const s=i+e*n;let a=t(i,n);a=a/e+.5,(0,fr.U)(a,r,4*s)}return r}class wr{constructor(e){this._context=e,this.materialId=null,this._loaded=!1,this._loadingPromise=null,this._iconTexture=null}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}destroy(){this._iconTexture=(0,lr.xt)(this._iconTexture)}async _load(){const e=this._context.renderCommandContext,t=await e.getOrCreateSharedTexture("circle-icon",(()=>function(e,t=128,r=.5*t,n=0){return{data:gr(e,t,r,n),parameters:{mipmap:!1,wrap:{s:De.pF.CLAMP_TO_EDGE,t:De.pF.CLAMP_TO_EDGE},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0}}}("circle")));this._iconTexture={remove:()=>e.releaseSharedTexture("circle-icon")};const r={anchorPosition:hr.center,occlusionTest:!0,hasSlicePlane:!1,color:[1,0,0,1],outlineColor:[0,0,0,1],outlineSize:1,distanceFieldBoundingBox:pr,textureId:t,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:mr("circle")};this.materialId=await e.createMaterial({type:"hud",parameters:r}),await e.createDirectRenderer(this.materialId),this._loaded=!0}async createAddCommand(e){const{materialId:t,_context:r}=this,{renderCommandContext:n}=r;if(null==t)throw new Error("expected material not to be null");const i=await this._createGeometry(e);if(null==i)return n.createRenderCommandBuffer();const s=Et(e,r);return n.addDirectRendererGeometry(e.id,i,s)}async _createGeometry(e){const{materialId:t,_context:r}=this,{mainThreadDelegate:n}=r,{featureCount:i}=e;if(0===i||null==t)return null;const s=Rt(e),a=Mt(e),o=function(e,t){const r=e.length/3,n=t.viewSpatialReference,i=t.renderSpatialReference,s=new Float64Array(3*r);if(!(0,Tt.projectBuffer)(e,n,0,s,i,0,r))throw new Error("Failed to project coordinates");return s}(await n.applyElevationAlignmentTo(a),r),l=new Float64Array([0,0,1]),c=new Float64Array([255,255,255,255]),d=new Float64Array([24,24]),u=new Float64Array([0,0,0,1]),h=new Float64Array([0,0]),f=new Float64Array([0]),p=new Uint32Array(i);for(let e=0;e<i;++e)p[e]=e;const m=new Uint32Array(i);for(let e=0;e<i;++e)m[e]=0;const g=new Lt.n(o,p,3,!0),y=new Lt.n(l,m,3,!0),_=new Lt.n(h,m,2,!0),b=new Lt.n(c,m,4,!0),v=new Lt.n(f,m,1,!0),x=new Lt.n(d,m,2,!0),w=new Lt.n(u,m,4,!0),S=[[ae.r.POSITION,g],[ae.r.NORMAL,y],[ae.r.UV0,_],[ae.r.COLOR,b],[ae.r.ROTATION,v],[ae.r.SIZE,x],[ae.r.CENTEROFFSETANDDISTANCE,w]],A=new Uint8Array(i);return e.getVisibilityArray(A),{attributes:Dt(S),objectAndLayerIdColor:void 0,transformation:(0,re.vt)(),materialId:t,objectIds:s,visibilities:A}}async createRemoveCommand(e){const{materialId:t,_context:r}=this,n=r.renderCommandContext;return null==t?n.createRenderCommandBuffer():n.removeDirectRendererGeometryBuffer(t,e)}async createUpdateVisibilityCommand(e){const{materialId:t,_context:r}=this,n=r.renderCommandContext;if(null==t)return n.createRenderCommandBuffer();const i=new Uint8Array(e.featureCount);return e.getVisibilityArray(i),n.updateVisibility(t,e.id,i)}async createUpdateElevationCommand(e){const{materialId:t,_context:r}=this,{renderCommandContext:n}=r,{featureCount:i,id:s}=e;if(null==t||0===i)return n.createRenderCommandBuffer();const a=await this._createGeometry(e);if(null==a)return n.createRenderCommandBuffer();const o=Et(e,r);return n.updateDirectRendererGeometry(s,a,o)}}class Sr{constructor(e){this._symbols=new Array,this._featureDataPartitioning=new Map,this._context=e}async load(){this._symbols[0]=new wr(this._context),this._symbols[1]=new ir(this._context)}async createAddCommand(e){const t=this._partition(e),r=await Promise.all(t.map((async({index:e,features:t})=>{const r=await this._provisionSymbol(e);return await(r?.createAddCommand(t))}))),n=this._context.renderCommandContext;return new It(n,n.mergeRenderCommandBuffers(r),[()=>{this._featureDataPartitioning.set(e.id,t)}])}async createRemoveCommand(e){const{_featureDataPartitioning:t,_context:r}=this,n=r.renderCommandContext,i=t.get(e);if(null==i)return new It(n,n.createRenderCommandBuffer(),[]);const s=await Promise.all(i.map((async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createRemoveCommand(t.id))})));return new It(n,n.mergeRenderCommandBuffers(s),[()=>{t.delete(e)}])}async createUpdateVisibilityCommand(e){const{_featureDataPartitioning:t,_context:r}=this,n=r.renderCommandContext,i=t.get(e.id);if(null==i)return new It(n,n.createRenderCommandBuffer(),[]);const s=await Promise.all(i.map((async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateVisibilityCommand(t))})));return new It(n,n.mergeRenderCommandBuffers(s),[])}async createUpdateElevationCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=t.renderCommandContext,n=[];for(const t of e.values()){const e=t.map((async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateElevationCommand(t))}));n.push(...e)}const i=await Promise.all(n);return new It(r,r.mergeRenderCommandBuffers(i),[])}async _provisionSymbol(e){if(null==e)return null;const t=this._symbols[e];return t?(t.loaded||await t.load(),t):null}_getLoadedSymbol(e){if(null==e)return null;const t=this._symbols[e];return null!=t&&t.loaded?t:null}_partition(e){const t=Rt(e);if(null==t)throw new Error("unable to fetch objectIds");const{featureCount:r}=e,n=[[],[]];for(let e=0;e<r;++e)n[t[e]%2].push(e);return n.map(((t,r)=>new Ar(r,e.subset(new Uint32Array(t))))).filter((e=>e.features.featureCount>0))}}class Ar{constructor(e,t){this.index=e,this.features=t}}var Cr=r(73941),Ir=r(98764),Tr=r(65806);const Or=(0,q.vt)();var Rr=r(88582),Mr=r(17352),Er=r(97937);function Pr(e,t,r=function(e){return{operations:e,value:e.create()}}(e)){return r.operations=e,e.copy(t,r.value),r}const zr=2**50;function Fr(e,t,r,n){return e.operations.setAltitudeAt(e.value,t,r,n)}function Dr(e,t,r){return e.operations.elevate(e.value,t,r.value)}const Br=(0,q.vt)();(0,q.vt)();var jr=r(44280),Vr=r(32114);function kr(e){return"point"===e.type}class Ur{constructor(e,t,r,n){this.viewingMode=e,this.spatialReference=t,this.unitInMeters=r,this._coordinateSystem=n,this._tmpCoordinateSystem=function(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}(n),this.referenceEllipsoid=(0,Cr.tO)(t),this.sphericalPCPF=(0,Ir.lO)(t)}set extent(e){e&&function(e,t,r){e.operations.setExtent(e.value,t,r.value)}(this._coordinateSystem,e,this._coordinateSystem)}get extent(){return function(e,t){return e.operations.getExtent(e.value,t),t}(this._coordinateSystem,(0,b.vt)())}getAltitude(e){return function(e,t){return e.operations.altitudeAt(e.value,t)}(this._coordinateSystem,e)}setAltitude(e,t,r=e){return Fr(this._coordinateSystem,r,t,e)}setAltitudeOfTransformation(e,t){!function(e,t,r,n){t!==n&&(0,te.C)(n,t),(0,fe.i)(Br,n[12],n[13],n[14]),Fr(e,Br,r,Br),n[12]=Br[0],n[13]=Br[1],n[14]=Br[2]}(this._coordinateSystem,t,e,t)}worldUpAtPosition(e,t){return function(e,t,r){return e.operations.axisAt(e.value,t,Rr._.Z,r)}(this._coordinateSystem,e,t)}worldBasisAtPosition(e,t,r){return function(e,t,r,n){return e.operations.axisAt(e.value,t,r,n)}(this._coordinateSystem,e,t,r)}basisMatrixAtPosition(e,t){const r=this.worldBasisAtPosition(e,Rr._.X,Vr.rq.get()),n=this.worldBasisAtPosition(e,Rr._.Y,Vr.rq.get()),i=this.worldBasisAtPosition(e,Rr._.Z,Vr.rq.get());return(0,te.hZ)(t,r[0],r[1],r[2],0,n[0],n[1],n[2],0,i[0],i[1],i[2],0,0,0,0,1),t}headingAtPosition(e,t){const r=this.worldUpAtPosition(e,Vr.rq.get()),n=this.worldBasisAtPosition(e,Rr._.Y,Vr.rq.get()),i=(0,jr.EJ)(t,n,r);return(0,le.KJ)(i)}intersectManifoldClosestSilhouette(e,t,r){return Dr(this._coordinateSystem,t,this._tmpCoordinateSystem),function(e,t,r){e.operations.intersectRayClosestSilhouette(e.value,t,r)}(this._tmpCoordinateSystem,e,r),r}intersectManifold(e,t,r){Dr(this._coordinateSystem,t,this._tmpCoordinateSystem);const n=Vr.rq.get();return function(e,t,r){return e.operations.intersectRay(e.value,t,r)}(this._tmpCoordinateSystem,e,n)?(0,fe.c)(r,n):null}intersectInfiniteManifold(e,t,r){if(this.viewingMode===ie.RT.Global)return this.intersectManifold(e,t,r);Dr(this._coordinateSystem,t,this._tmpCoordinateSystem);const n=this._tmpCoordinateSystem.value,i=Vr.rq.get();return(0,Nt.Ui)(n.plane,e,i)?(0,fe.c)(r,i):null}toRenderCoords(e,t,r){return kr(e)?(0,Tr.g)(e,t,this.spatialReference):(0,Ot.F)(e,t,r,this.spatialReference)}fromRenderCoords(e,t,r=null){return kr(t)?(null!=r&&(t.spatialReference=r),function(e,t,r){return!!(0,Ot.F)(e,t,Or,r.spatialReference)&&(r.x=Or[0],r.y=Or[1],r.z=Or[2],!0)}(e,this.spatialReference,t)?t:null):(0,Ot.F)(e,this.spatialReference,t,r)?t:null}static create(e,t){switch(e){case ie.RT.Local:return new Ur(ie.RT.Local,t,(0,Ft.GA)(t),Pr(Mr.b,(0,Mr.f)([0,0,0],[zr,0,0],[0,zr,0])));case ie.RT.Global:return new Ur(ie.RT.Global,t,1,function(e){return Pr(Er.s,(0,Er.f)(0,0,0,(0,Cr.tO)(e).radius))}(t))}}static renderUnitScaleFactor(e,t){return(0,Ft.KX)(e)/(0,Ft.KX)(t)}}let Nr=class extends i.A.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new B,this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,baseQuery:n,url:i,objectIdField:s,capabilities:o,fieldsIndex:l,timeInfo:c,elevationInfo:m,fullExtent:g}){const y=h.A.fromJSON(e),_=h.A.fromJSON(t);this._fetcher=new ee(y,p.A.fromJSON(n),i,s,o),this._queryEngine=new f.do({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",objectIdField:s,fieldsIndex:l,availableFields:[s],spatialReference:e,featureStore:this._featureStore,timeInfo:c});const b={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const n={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",n,{transferList:r})},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})}};this._renderer=new Sr({viewSpatialReference:y,renderSpatialReference:_,renderCoordsHelper:Ur.create(r,_),renderCommandContext:new wt(r,b),elevationInfo:m??{},mainThreadDelegate:b}),this._defaultQueryJSON=new p.A({outSpatialReference:y}).toJSON();let v=null;if(null!=g){const e=d.A.fromJSON(g);await(0,u.initializeProjection)(e.spatialReference,y),v=(0,u.project)(e,y)}return this._tileManager=new C({loadTile:(e,t)=>this._fetcher.fetch(e,t),createAddFeatureDataCommand:(e,t)=>this._createAddFeatureDataCommand(e,t),createRemoveFeatureDataCommand:e=>this._createRemoveFeatureDataCommand(e),createUpdateFeatureDataVisibilityCommand:(e,t)=>this._createUpdateFeatureDataVisibilityCommand(e,t),extent:v}),this.addHandles((0,a.wB)((()=>this.updating),(e=>{this.emit("notify-updating",{updating:e})})),a.Vh),await this._renderer.load(),qr}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async onTileTreeChange(e){return await this._tileManager.onTileTreeChange(e),qr}async onElevationChange(e){return qr}async _createAddFeatureDataCommand(e,t){const r=this._featureStore,n=await this._renderer.createAddCommand(e);return(0,s.Te)(t),n.appendPipelineStateCommand((()=>{r.addTile(e)})),n}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer,n=await r.createRemoveCommand(e);return n.appendPipelineStateCommand((()=>{t.removeTile(e)})),n}async _createUpdateFeatureDataVisibilityCommand(e,t){const r=this._renderer,n=await r.createUpdateVisibilityCommand(e);return(0,s.Te)(t),n}_ensureQuery(e){return e??this._defaultQueryJSON}};(0,n._)([(0,o.MZ)()],Nr.prototype,"updating",null),Nr=(0,n._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],Nr);const Lr=Nr,qr={result:void 0}},69418:(e,t,r)=>{r.d(t,{S:()=>c,z:()=>l});var n=r(83047),i=r(21325),s=r(43334),a=r(58512),o=r(92722);const l=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class c{constructor(e){this._options=e,this.geometryTypes=l,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new a.A}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e?.features||!e.hasZ||!this._options.sourceSpatialReference||!e.spatialReference||(0,i.aI)(e.spatialReference,this._options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=(0,n.G9)(this._options.sourceSpatialReference)/(0,n.G9)(e.spatialReference);if(1!==t)for(const r of e.features){if(!(0,s.N3)(r))continue;const e=r.geometry.coords;for(let r=2;r<e.length;r+=3)e[r]*=t}}addFeature(e,t){e.features.push(t)}createFeature(){return new s.Om(null,{},null,0)}createSpatialReference(){return{wkid:0}}createGeometry(){return new o.A}addField(e,t){e.fields.push(t)}allocateCoordinates(e){e.coords.length=e.lengths.reduce(((e,t)=>e+t),0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new o.A}}},72385:(e,t,r)=>{function n(){return new Float32Array(3)}function i(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function s(e,t,r){const n=new Float32Array(3);return n[0]=e,n[1]=t,n[2]=r,n}function a(){return n()}function o(){return s(1,1,1)}function l(){return s(1,0,0)}function c(){return s(0,1,0)}function d(){return s(0,0,1)}r.d(t,{fA:()=>s,o8:()=>i,vt:()=>n});const u=a(),h=o(),f=l(),p=c(),m=d();Object.freeze(Object.defineProperty({__proto__:null,ONES:h,UNIT_X:f,UNIT_Y:p,UNIT_Z:m,ZEROS:u,clone:i,create:n,fromValues:s,ones:o,unitX:l,unitY:c,unitZ:d,zeros:a},Symbol.toStringTag,{value:"Module"}))},75503:(e,t,r)=>{r.d(t,{E:()=>C,w:()=>o});var n=r(4576),i=r(21818),s=(r(44208),r(3694)),a=r(11006);class o{constructor(e=9,t){this._compareMinX=h,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(),w.prune(),S.prune(),A.prune()}all(e){l(this._data,e)}search(e,t){let r=this._data;const n=this._toBBox;if(b(e,r))for(x.clear();r;){for(let i=0,s=r.children.length;i<s;i++){const s=r.children[i],a=r.leaf?n(s):s;b(e,a)&&(r.leaf?t(s):_(e,a)?l(s,t):x.push(s))}r=x.pop()}}collides(e){let t=this._data;const r=this._toBBox;if(!b(e,t))return!1;for(x.clear();t;){for(let n=0,i=t.children.length;n<i;n++){const i=t.children[n],s=t.leaf?r(i):i;if(b(e,s)){if(t.leaf||_(e,s))return!0;x.push(i)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,r=e.length;t<r;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 T([]),this}remove(e){if(!e)return this;let t,r=this._data,s=null,a=0,o=!1;const l=this._toBBox(e);for(S.clear(),A.clear();r||S.length>0;){if(r||(r=S.pop(),s=S.data[S.length-1],a=A.pop()??0,o=!0),r.leaf&&(t=(0,n.qh)(r.children,(0,i.zI)(e),r.children.length,r.indexHint),-1!==t))return r.children.splice(t,1),S.push(r),this._condense(S),this;o||r.leaf||!_(r,l)?s?(a++,r=s.children[a],o=!1):r=null:(S.push(r),A.push(a),a=0,s=r,r=r.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,r,n){const i=r-t+1;let s=this._maxEntries;if(i<=s){const n=new T(e.slice(t,r+1));return c(n,this._toBBox),n}n||(n=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/s**(n-1)));const a=new O([]);a.height=n;const o=Math.ceil(i/s),l=o*Math.ceil(Math.sqrt(s));v(e,t,r,l,this._compareMinX);for(let i=t;i<=r;i+=l){const t=Math.min(i+l-1,r);v(e,i,t,o,this._compareMinY);for(let r=i;r<=t;r+=o){const i=Math.min(r+o-1,t);a.children.push(this._build(e,r,i,n-1))}}return c(a,this._toBBox),a}_insert(e,t,r){const n=this._toBBox,i=r?e:n(e);S.clear();const s=function(e,t,r,n){for(;n.push(t),!0!==t.leaf&&n.length-1!==r;){let r,n=1/0,i=1/0;for(let s=0,a=t.children.length;s<a;s++){const a=t.children[s],o=p(a),l=g(e,a)-o;l<i?(i=l,n=o<n?o:n,r=a):l===i&&o<n&&(n=o,r=a)}t=r||t.children[0]}return t}(i,this._data,t,S);for(s.children.push(e),u(s,i);t>=0&&S.data[t].children.length>this._maxEntries;)this._split(S,t),t--;!function(e,t,r){for(let n=r;n>=0;n--)u(t.data[n],e)}(i,S,t)}_split(e,t){const r=e.data[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);const s=this._chooseSplitIndex(r,i,n);if(!s)return;const a=r.children.splice(s,r.children.length-s),o=r.leaf?new T(a):new O(a);o.height=r.height,c(r,this._toBBox),c(o,this._toBBox),t?e.data[t-1].children.push(o):this._splitRoot(r,o)}_splitRoot(e,t){this._data=new O([e,t]),this._data.height=e.height+1,c(this._data,this._toBBox)}_chooseSplitIndex(e,t,r){let n,i,s;n=i=1/0;for(let a=t;a<=r-t;a++){const t=d(e,0,a,this._toBBox),o=d(e,a,r,this._toBBox),l=y(t,o),c=p(t)+p(o);l<n?(n=l,s=a,i=c<i?c:i):l===n&&c<i&&(i=c,s=a)}return s}_chooseSplitAxis(e,t,r){const n=e.leaf?this._compareMinX:h,i=e.leaf?this._compareMinY:f;this._allDistMargin(e,t,r,n)<this._allDistMargin(e,t,r,i)&&e.children.sort(n)}_allDistMargin(e,t,r,n){e.children.sort(n);const i=this._toBBox,s=d(e,0,t,i),a=d(e,r-t,r,i);let o=m(s)+m(a);for(let n=t;n<r-t;n++){const t=e.children[n];u(s,e.leaf?i(t):t),o+=m(s)}for(let n=r-t-1;n>=t;n--){const t=e.children[n];u(a,e.leaf?i(t):t),o+=m(a)}return o}_condense(e){for(let t=e.length-1;t>=0;t--){const r=e.data[t];if(0===r.children.length)if(t>0){const i=e.data[t-1],s=i.children;s.splice((0,n.qh)(s,r,s.length,i.indexHint),1)}else this.clear();else c(r,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 r=e;for(w.clear();r;){if(!0===r.leaf)for(const e of r.children)t((0,i.zI)(e));else w.pushArray(r.children);r=w.pop()??null}}function c(e,t){d(e,0,e.children.length,t,e)}function d(e,t,r,n,i){i||(i=new T([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let s,a=t;a<r;a++)s=e.children[a],u(i,e.leaf?n(s):s);return i}function u(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 h(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 m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function g(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 y(e,t){const r=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,i-r)*Math.max(0,s-n)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function b(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e,t,r,n,i){const s=[t,r];for(;s.length;){const t=s.pop(),r=s.pop();if(t-r<=n)continue;const o=r+Math.ceil((t-r)/n/2)*n;(0,a.q)(e,o,r,t,i),s.push(r,o,o,t)}}const x=new s.A,w=new s.A,S=new s.A,A=new s.A({deallocator:void 0});class C{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class I extends C{constructor(){super(...arguments),this.height=1,this.indexHint=new n.vW}}class T extends I{constructor(e){super(),this.children=e,this.leaf=!0}}class O extends I{constructor(e){super(),this.children=e,this.leaf=!1}}},76357:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(90237),i=r(66552),s=r(25482),a=r(10107),o=(r(44208),r(53966),r(87811),r(93223)),l=r(40608);const c=new i.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let d=class extends s.A{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,a.MZ)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,n._)([(0,o.e)(c),(0,a.MZ)({json:{write:{isRequired:!0}}})],d.prototype,"type",void 0),d=(0,n._)([(0,l.$)("esri.layers.support.Domain")],d);const u=d},79677:(e,t,r)=>{r.d(t,{A:()=>f});var n,i=r(90237),s=r(25482),a=r(88930),o=r(10107),l=(r(44208),r(53966),r(87811),r(36005)),c=r(40608),d=r(43937),u=r(98623);let h=class extends s.A{static{n=this}static get allTime(){return p}static get empty(){return m}static fromArray(e){return new n({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(n.allTime)}get isEmpty(){return this.equals(n.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new n({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,n=e.start?.getTime()??e.start,i=e.end?.getTime()??e.end;return t===n&&r===i}expandTo(e,t=u.qU){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,a.lL)(r,e,t));let i=this.end;if(i){const r=(0,a.lL)(i,e,t);i=i.getTime()===r.getTime()?r:(0,a.S1)(r,1,e,t)}return new n({start:r,end:i})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return n.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,i=e.start?.getTime()??-1/0,s=e.end?.getTime()??1/0;let a,o;return i>=t&&i<=r?a=i:t>=i&&t<=s&&(a=t),r>=i&&r<=s?o=r:s>=t&&s<=r&&(o=s),null==a||null==o||isNaN(a)||isNaN(o)?n.empty:new n({start:a===-1/0?null:new Date(a),end:o===1/0?null:new Date(o)})}offset(e,t,r=u.qU){if(this.isEmpty||this.isAllTime)return this.clone();const i=new n,{start:s,end:o}=this;return null!=s&&(i.start=(0,a.S1)(s,e,t,r)),null!=o&&(i.end=(0,a.S1)(o,e,t,r)),i}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 p.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new n({start:t,end:r})}};(0,i._)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"end",void 0),(0,i._)([(0,l.w)("end")],h.prototype,"readEnd",null),(0,i._)([(0,d.K)("end")],h.prototype,"writeEnd",null),(0,i._)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],h.prototype,"isAllTime",null),(0,i._)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],h.prototype,"isEmpty",null),(0,i._)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"start",void 0),(0,i._)([(0,l.w)("start")],h.prototype,"readStart",null),(0,i._)([(0,d.K)("start")],h.prototype,"writeStart",null),h=n=(0,i._)([(0,c.$)("esri.time.TimeExtent")],h);const f=h,p=new h,m=new h({start:void 0,end:void 0})},80451:(e,t,r)=>{r.d(t,{rS:()=>g,gK:()=>m}),r(44208);var n,i=r(53177),s=r(76357),a=r(90237),o=(r(53966),r(87811),r(49186),r(93223)),l=r(40608);let c=class extends s.A{static{n=this}constructor(e){super(e),this.type="inherited"}clone(){return new n}};(0,a._)([(0,o.e)({inherited:"inherited"})],c.prototype,"type",void 0),c=n=(0,a._)([(0,l.$)("esri.layers.support.InheritedDomain")],c);const d=c;var u,h=r(10107);let f=class extends s.A{static{u=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new u({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,a._)([(0,h.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,r){t[r]=[this.minValue||0,e]},isRequired:!0}}})],f.prototype,"maxValue",void 0),(0,a._)([(0,h.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,r){t[r]=[e,this.maxValue||0]},isRequired:!0}}})],f.prototype,"minValue",void 0),(0,a._)([(0,o.e)({range:"range"})],f.prototype,"type",void 0),f=u=(0,a._)([(0,l.$)("esri.layers.support.RangeDomain")],f);const p=f,m={key:"type",base:s.A,typeMap:{range:p,"coded-value":i.A,inherited:d}};function g(e){if(!e?.type)return null;switch(e.type){case"range":return p.fromJSON(e);case"codedValue":return i.A.fromJSON(e);case"inherited":return d.fromJSON(e)}return null}},80893:(e,t,r)=>{r.d(t,{IJ:()=>p,Jf:()=>_,Pk:()=>g,eW:()=>f,gW:()=>y,kS:()=>m});var n=r(78888),i=r(84952),s=r(65864),a=r(17136),o=r(21325),l=r(10536),c=r(66208),d=r(58501);const u="Layer does not support extent calculation.";function h(e,t){const r=e.geometry,n=e.toJSON();delete n.compactGeometryEnabled,delete n.defaultSpatialReferenceEnabled;const i=n;let a,l,c;if(null!=r&&(l=r.spatialReference,c=(0,o.YX)(l),i.geometryType=(0,s.$B)(r),i.geometry=function(e,t){if(t&&"extent"===e.type)return`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`;if(t&&"point"===e.type)return`${e.x},${e.y}`;const r=e.toJSON();return delete r.spatialReference,JSON.stringify(r)}(r,e.compactGeometryEnabled),i.inSR=c),n.groupByFieldsForStatistics&&(i.groupByFieldsForStatistics=n.groupByFieldsForStatistics.join(",")),n.objectIds&&(i.objectIds=n.objectIds.join(",")),n.orderByFields&&(i.orderByFields=n.orderByFields.join(",")),!n.outFields||!n.returnDistinctValues&&(t?.returnCountOnly||t?.returnExtentOnly||t?.returnIdsOnly)?delete i.outFields:n.outFields.includes("*")?i.outFields="*":i.outFields=n.outFields.join(","),n.outSR?(i.outSR=(0,o.YX)(n.outSR),a=e.outSpatialReference):r&&(n.returnGeometry||n.returnCentroid)&&(i.outSR=i.inSR,a=l),n.returnGeometry&&delete n.returnGeometry,n.outStatistics&&(i.outStatistics=JSON.stringify(n.outStatistics)),n.fullText&&(i.fullText=JSON.stringify(n.fullText)),n.pixelSize&&(i.pixelSize=JSON.stringify(n.pixelSize)),n.quantizationParameters&&(e.defaultSpatialReferenceEnabled&&null!=l&&null!=e.quantizationParameters?.extent&&l.equals(e.quantizationParameters.extent.spatialReference)&&delete n.quantizationParameters.extent.spatialReference,i.quantizationParameters=JSON.stringify(n.quantizationParameters)),n.parameterValues&&(i.parameterValues=JSON.stringify(n.parameterValues)),n.rangeValues&&(i.rangeValues=JSON.stringify(n.rangeValues)),n.dynamicDataSource&&(i.layer=JSON.stringify({source:n.dynamicDataSource}),delete n.dynamicDataSource),n.timeExtent){const e=n.timeExtent,{start:t,end:r}=e;null==t&&null==r||(i.time=t===r?t:`${t??"null"},${r??"null"}`),delete n.timeExtent}return e.defaultSpatialReferenceEnabled&&null!=l&&null!=a&&l.equals(a)&&(i.defaultSR=i.inSR,delete i.inSR,delete i.outSR),i}async function f(e,t,r,n){const i=null!=t.timeExtent&&t.timeExtent.isEmpty?{data:{features:[]}}:await b(e,t,"json",n);return(0,d.q)(t,r,i.data),i}async function p(e,t,r,n){if(null!=t.timeExtent&&t.timeExtent.isEmpty)return{data:r.createFeatureResult()};const i=await m(e,t,n),s=i;return s.data=(0,c.m)(i.data,r),s}function m(e,t,r){return b(e,t,"pbf",r)}function g(e,t,r){return null!=t.timeExtent&&t.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):b(e,t,"json",r,{returnIdsOnly:!0})}function y(e,t,r){return null!=t.timeExtent&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):b(e,t,"json",r,{returnIdsOnly:!0,returnCountOnly:!0})}async function _(e,t,r){if(null!=t.timeExtent&&t.timeExtent.isEmpty)return{data:{count:0,extent:null}};const n=await b(e,t,"json",r,{returnExtentOnly:!0,returnCountOnly:!0}),i=n.data;if(i.hasOwnProperty("extent"))return n;if(i.features)throw new Error(u);if(i.hasOwnProperty("count"))throw new Error(u);return n}async function b(e,t,r,s={},o={}){const c="string"==typeof e?(0,i.An)(e):e,d=t.geometry?[t.geometry]:[],u=await(0,a.el)(d,null,{signal:s.signal}),f=u?.[0];null!=f&&((t=t.clone()).geometry=f);const p=(0,l.z)({...c.query,f:r,...o,...h(t,o)});return(0,n.A)((0,i.fj)(c.path,(m=o,null==t.formatOf3DObjects||m.returnCountOnly||m.returnExtentOnly||m.returnIdsOnly?"query":"query3d")),{...s,responseType:"pbf"===r?"array-buffer":"json",query:{...p,...s.query}});var m}},95696:(e,t,r)=>{r.d(t,{A:()=>u});var n,i=r(90237),s=r(69540),a=r(25482),o=r(10107),l=(r(44208),r(53966),r(87811),r(93223)),c=r(40608);let d=class extends(s.A.ClonableMixin(a.A)){static{n=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new n}};(0,i._)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],d.prototype,"type",void 0),(0,i._)([(0,o.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],d.prototype,"origin",void 0),d=n=(0,i._)([(0,c.$)("esri.geometry.support.MeshGeoreferencedVertexSpace")],d);const u=d}}]);
319
+ }`)}},66208:(e,t,r)=>{r.d(t,{m:()=>i});var n=r(53655);function i(e,t){const r=(0,n.SH)(e,t),i=r.queryResult.featureResult,s=r.queryResult.queryGeometry,a=r.queryResult.queryGeometryType;if(i&&i.features&&i.features.length&&i.objectIdFieldName){const e=i.objectIdFieldName;for(const t of i.features)t.attributes&&(t.objectId=t.attributes[e])}return i&&(i.queryGeometry=s,i.queryGeometryType=a),i}},66344:(e,t,r)=>{var n,i;r.d(t,{q:()=>l}),(i=n||(n={}))[i.ALL=0]="ALL",i[i.SOME=1]="SOME";class s{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()}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 r=this._db.get(e.id+t);return r?.size??0}put(e,t,r,i,s){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==r&&this._notifyRemove(t,o.entry,o.size,n.ALL)),i>this._maxSize)return void this._notifyRemove(t,r,i,n.ALL);if(void 0===r)return void console.warn("Refusing to cache undefined entry ");if(!i||i<0)return console.warn(`Refusing to cache entry with size ${i} for key ${t}`),void this._notifyRemove(t,r,0,n.ALL);const l=1+Math.max(s,-4)- -3;this._db.set(t,new a(r,i,l)),this._size+=i,e.size+=i,this._checkSize()}updateSize(e,t,r,i){t=e.id+t;const s=this._db.get(t);if(s&&s.entry===r){for(this._size-=s.size,e.size-=s.size;i>this._maxSize;){const e=this._notifyRemove(t,r,i,n.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);i=e}s.size=i,this._size+=i,e.size+=i,this._checkSize()}}pop(e,t){t=e.id+t;const r=this._db.get(t);if(r)return this._size-=r.size,e.size-=r.size,this._db.delete(t),++this._hit,r.entry;++this._miss}get(e,t){t=e.id+t;const r=this._db.get(t);if(void 0!==r)return this._db.delete(t),r.lives=r.lifetime,this._db.set(t,r),++this._hit,r.entry;++this._miss}peek(e,t){const r=this._db.get(e.id+t);return r?++this._hit:++this._miss,r?.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={},r=new Array;this._db.forEach(((e,n)=>{const i=e.lifetime;r[i]=(r[i]||0)+e.size,this._users.forEach((r=>{const{id:i,name:s}=r;if(n.startsWith(i)){const r=t[s]||0;t[s]=r+e.size}}))}));const n={};this._users.forEach((e=>{const r=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const i=t[r]||0;t[r]=i,n[r]=Math.round(100*e.hitRate)+"%"}else n[r]="0%"}));const i=Object.keys(t);i.sort(((e,r)=>t[r]-t[e])),i.forEach((r=>e[r]=Math.round(t[r]/2**20)+"MB / "+n[r]));for(let t=r.length-1;t>=0;--t){const n=r[t];n&&(e["Priority "+(t+-3-1)]=Math.round(n/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,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,e.size,n.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,n.ALL))),this._users.forEach((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,r,n){const i=this._users.get(e.split(o)[0])?.removeFunc,s=i?.(t,n,r);return"number"==typeof s?s: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 r=t??this;if(r.size<=e)return;const n=t?.id;let i=!0;for(;i;){i=!1;for(const[s,a]of this._db)if(0===a.lifetime&&(!n||s.startsWith(n))){const n=t??this._users.get(s.split(o)[0]);if(this._purgeItem(s,a,n),r.size<=.9*e)return;i||=this._db.has(s)}}for(const[i,s]of this._db)if(!n||i.startsWith(n)){const n=t??this._users.get(i.split(o)[0]);if(this._purgeItem(i,s,n),r.size<=.9*e)return}}_purgeItem(e,t,r){if(this._db.delete(e),t.lives<=1){this._size-=t.size,r&&(r.size-=t.size);const i=this._notifyRemove(e,t.entry,t.size,n.SOME);null!=i&&i>0&&(this._size+=i,r&&(r.size+=i),t.lives=t.lifetime,t.size=i,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}class a{constructor(e,t,r){this.entry=e,this.size=t,this.lifetime=r,this.lives=r}}const o=":";class l{constructor(e,t){this.removeFunc=t,this._storage=new s,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,r=1){this._storage.put(this,e,t,r,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(){}}},67063:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Lr});var n=r(90237),i=r(65529),s=r(74887),a=r(36708),o=r(10107),l=r(44208),c=(r(53966),r(87811),r(40608)),d=r(5443),u=r(80586),h=r(16930),f=r(68298),p=r(61956),m=r(69622),g=r(4576),y=r(32587),_=r(44794),b=r(19419),v=r(69397),x=r(24326);function w(e=""){return`${e}${(0,x.c)()}`}r(37539),new Float64Array(3);class S{constructor(e,t){this._parent=e,this._subsetIndices=t,this.id=w(`featureDataSubset-${e.id}-`)}get extent(){return this._parent.extent}get featureCount(){return this._subsetIndices.length}get usedMemory(){return this._parent.usedMemory+v.qK+this._subsetIndices.byteLength}get isFullyEnabled(){for(const e of this._subsetIndices)if(!this._parent.getEnabled(e))return!1;return!0}getObjectId(e){return this._parent.getObjectId(this._subsetIndices[e])}getAttribute(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributeAsTimestamp(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributes(e){return this._parent.getAttributes(this._subsetIndices[e])}getCoordinates(e,t,r){return this._parent.getCoordinates(this._subsetIndices[e],t,r)}getOptimizedGeometry(e){return this._parent.getOptimizedGeometry(this._subsetIndices[e])}getCentroid(e,t){return this._parent.getCentroid(this._subsetIndices[e],t)}getBounds(e){return this._parent.getBounds(this._subsetIndices[e])}getBoundingBox(e){return this._parent.getBoundingBox(this._subsetIndices[e])}getObjectIdsArray(e,t,r){return this._parent.getObjectIdsArray(e,this._translatedIndices(t),r)}getCoordinatesArray(e,t,r){return this._parent.getCoordinatesArray(e,this._translatedIndices(t),r)}objectIds(e){return this._parent.objectIds(this._translatedIndices(e))}subset(e){const{_subsetIndices:t}=this,r=new Uint32Array(e.length);for(let n=0;n<r.length;++n)r[n]=t[e[n]];return new S(this._parent,r)}disableObjectIds(e){if(0===e.size)return;const{featureCount:t}=this,r=new Array;for(let n=0;n<t;++n)this.getEnabled(n)&&e.has(this.getObjectId(n))&&r.push(n);if(0!==r.length)for(const e of r)this.setEnabled(e,!1)}setEnabled(e,t){this._parent.setEnabled(this._subsetIndices[e],t)}getEnabled(e){return this._parent.getEnabled(this._subsetIndices[e])}enableAll(){const{_subsetIndices:e,_parent:t}=this;for(const r of e)t.setEnabled(r,!0)}getVisibilityArray(e,t,r){return this._parent.getVisibilityArray(e,this._translatedIndices(t),r)}enabledObjectIds(e){return this._parent.enabledObjectIds(this._translatedIndices(e))}*_translatedIndices(e){const{_subsetIndices:t}=this;if(null!=e)for(const r of e)yield t[r];else yield*t}}class A{constructor(e){this._tile=e,this.id=w(`featureData-${e.id}-`),this._enabled=new Array(e.featureCount).fill(!0)}get featureCount(){return this._tile.featureCount}get usedMemory(){return v.qK+(0,v.$B)(this.id)}get extent(){return this._tile.descriptor.extent}get isFullyEnabled(){return this._enabled.every((e=>e))}getObjectId(e){return this._tile.getObjectId(e)}getAttribute(e,t){return this._tile.getAttribute(e,t)}getAttributeAsTimestamp(e,t){return this._tile.getAttribute(e,t)}getAttributes(e){return this._tile.getAttributes(e)}getCoordinates(e,t,r){return this._tile.getCoordinates(e,t,r)}getOptimizedGeometry(e){return this._tile.getOptimizedGeometry(e)}getCentroid(e,t){return this._tile.getCentroid(e,t)}getBounds(e){return this._tile.getBounds(e)}getBoundingBox(e){return this._tile.getBoundingBox(e)}getObjectIdsArray(e,t,r){return this._tile.getObjectIdsArray(e,t,r)}getCoordinatesArray(e,t,r){return this._tile.getCoordinatesArray(e,t,r)}objectIds(e){return this._tile.objectIds(e)}subset(e){return new S(this,e)}disableObjectIds(e){if(0===e.size)return;const{_enabled:t}=this,r=new Array;for(const n of this._allFeatureIndices())t[n]&&e.has(this.getObjectId(n))&&r.push(n);if(0!==r.length)for(const e of r)t[e]=!1}setEnabled(e,t){this._enabled[e]=t}getEnabled(e){return this._enabled[e]}enableAll(){this._enabled.fill(!0)}getVisibilityArray(e,t=this._allFeatureIndices(),r=0){const{_enabled:n}=this;for(const i of t)e[r++]=Number(n[i]);return r}*enabledObjectIds(e=this._allFeatureIndices()){const{_enabled:t}=this;for(const r of e)t[r]&&(yield this.getObjectId(r))}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}}let C=class extends m.A{constructor(e){super(e),this._updatingCount=0,this.extent=null,this._tileHandles=new y.A,this._wanted=new y.A}destroy(){for(const e of this._tileHandles.values())e.abort();this._tileHandles.clear(),this._wanted.clear()}get updating(){return this._updatingCount>0}get _boundingRect(){const{extent:e}=this;return null==e?null:(0,b.VY)(e)}get _missingTiles(){const e=new Array,t=this._wanted;for(const r of this._tileHandles.values())t.has(r.id)&&!O(r)&&e.push(r);return e}async onTileTreeChange(e){++this._updatingCount;try{const{added:t,removed:r}=e,n=this._tileHandles,{_boundingRect:i}=this,s=null!=i?t.filter((e=>(0,b.HY)(i,e.extent))):t,a=this._wanted,o=new Array;for(const e of r){const{id:r}=e;if(a.delete(r),t.some((t=>I(t,e)||I(e,t))))continue;const i=n.get(r);null!=i&&o.push(this._removeTile(i))}for(const e of s)a.set(e.id,e),o.push(this._addTile(e));await Promise.allSettled(o)}finally{--this._updatingCount}}async _removeTile(e){this._tileHandles.delete(e.id),this._validate(),e.abort();const{featureData:t}=e,r=new R(e.untilSettled(),null!=t?this.createRemoveFeatureDataCommand(t.id):null);e.nextEvent=null;const{command:n}=await r.getCommand();n?.execute()}async _addTile(e){const{_tileHandles:t}=this,r=t.get(e.id);if(null!=r)return!O(r)||r.featureData.isFullyEnabled||(r.featureData.enableAll(),r.nextEvent=this._onTileLoad(r)),void await r.untilSettled();const n=new T(e);this._tileHandles.set(n.id,n);const i=this.loadTile(e,n.signal);n.nextEvent=i;const a=await i;if(n.aborted)throw(0,s.NK)();n.featureData=new A(a),function(e){if(!O(e))throw new Error}(n),n.nextEvent=this._onTileLoad(n),await n.untilSettled()}async _onTileLoad(e){const{_wanted:t,_tileHandles:r,_missingTiles:n}=this,i=e.descriptor,s=new Array,a=new Array,o=new Set;for(const l of r.values()){if(l===e)continue;const{descriptor:c,id:d}=l;if(t.has(d)||n.some((({descriptor:e})=>I(e,c)||I(c,e)))){if(O(l)){if(I(i,c)){const e=l.featureData;for(const t of e.objectIds())o.add(t)}if(I(c,i)){const t=e.featureData,r=new Set(t.objectIds()),{featureData:n}=l;n.disableObjectIds(r);const i=AbortSignal.any([l.signal,e.signal]),o=l.untilSettled();s.push(new R(o,this.createUpdateFeatureDataVisibilityCommand(n),i)),a.push(l),this._validateRemoval(n,r)}}}else{l.abort(),r.delete(d);const{featureData:e}=l;null!=e&&s.push(new R(l.untilSettled(),this.createRemoveFeatureDataCommand(e.id))),l.nextEvent=null}}o.size>0&&(e.featureData.disableObjectIds(o),this._validateRemoval(e.featureData,o)),this._validate(),s.push(new R(e.untilSettled(),this.createAddFeatureDataCommand(e.featureData,e.signal),e.signal)),a.push(e);const l=this._joinCommands(s);for(const e of a)e.nextEvent=l;await l}async _joinCommands(e){const t=(await Promise.allSettled(e.map((async e=>e.getCommand())))).map((e=>"fulfilled"!==e.status||e.value.signal?.aborted?null:e.value.command)).filter(g.Ru);0!==t.length&&t.reduce(((e,t)=>(e.append(t),e))).execute()}_validate(){if(!(0,l.A)("feature-pipeline-3d-test-validation"))return;const e=new Array;for(const t of this._tileHandles.values()){if(!O(t))continue;const{featureData:r}=t;e.push({featureData:r,objectIds:new Set(r.enabledObjectIds())})}for(let t=0;t<e.length;++t){const{featureData:r,objectIds:n}=e[t];for(let i=t+1;i<e.length;++i){const{featureData:t,objectIds:s}=e[i];for(const e of s)if(n.has(e))throw new Error(`${r.id} and ${t.id} both contain ${e}.`)}}}_validateRemoval(e,t){if((0,l.A)("feature-pipeline-3d-test-validation"))for(const r of e.enabledObjectIds())if(t.has(r))throw new Error(`Failed to remove ${r} from ${e.id}!`)}};function I({lij:[e,t,r]},{lij:[n,i,s]}){const a=n-e;return a>=0&&t===i>>a&&r===s>>a}(0,n._)([(0,o.MZ)()],C.prototype,"updating",null),(0,n._)([(0,o.MZ)({constructOnly:!0})],C.prototype,"loadTile",void 0),(0,n._)([(0,o.MZ)({constructOnly:!0})],C.prototype,"createAddFeatureDataCommand",void 0),(0,n._)([(0,o.MZ)({constructOnly:!0})],C.prototype,"createRemoveFeatureDataCommand",void 0),(0,n._)([(0,o.MZ)({constructOnly:!0})],C.prototype,"createUpdateFeatureDataVisibilityCommand",void 0),(0,n._)([(0,o.MZ)()],C.prototype,"_updatingCount",void 0),(0,n._)([(0,o.MZ)()],C.prototype,"extent",void 0),(0,n._)([(0,o.MZ)()],C.prototype,"_boundingRect",null),(0,n._)([(0,o.MZ)()],C.prototype,"_missingTiles",null),C=(0,n._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],C);class T{constructor(e){this.descriptor=e,this._controller=new AbortController,this._featureData=(0,_.v)(null),this.nextEvent=null}get id(){return this.descriptor.id}get featureData(){return this._featureData.value}set featureData(e){this._featureData.value=e}get signal(){return this._controller.signal}abort(){this._controller.abort()}get aborted(){return this._controller.signal.aborted}async untilSettled(){try{await this.nextEvent}catch(e){(0,s.zf)(e)||console.error(e)}}}function O(e){return null!=e.featureData}class R{constructor(e,t,r){this.previousEventSettled=e,this.commandPromise=t,this.signal=r}async getCommand(){const{previousEventSettled:e,commandPromise:t,signal:r}=this,[n]=await Promise.all([t,e]);if(r?.aborted)throw(0,s.NK)();return{command:n,signal:r}}}var M=r(75503),E=r(27647),P=r(92722);class z{constructor(e,t){this._index=e,this._view=t}get usedMemory(){return v.qK+v.RS}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new F(this._index,this._view,e)}}class F extends z{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return(0,E.Q)(new P.A,this._geometryOverride,e.hasZ,e.hasM)}}class D{constructor(e,t){this.featureData=e,this.bounds=t}}class B{constructor(){this._tileBounds=new Map,this.events=new i.A,this.featureAdapter=j.shared}get usedMemory(){return v.qK+v.qK*this._tileBounds.size}addTile(e){const{featureCount:t}=e;if(0===t)return;const r=new M.w(9,(t=>e.getBounds(t))),n=new Array;for(let e=0;e<t;++e)n[e]=e;r.load(n),this._tileBounds.set(e.id,new D(e,r)),this.events.emit("changed")}removeTile(e){this._tileBounds.delete(e),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(e){for(const{featureData:t,bounds:r}of this._tileBounds.values())r.all((r=>{t.getEnabled(r)&&e(new z(r,t))}))}forEachInBounds(e,t){V.minX=e[0],V.minY=e[1],V.maxX=e[2],V.maxY=e[3];for(const{featureData:e,bounds:r}of this._tileBounds.values())r.search(V,(r=>{e.getEnabled(r)&&t(new z(r,e))}))}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const{bounds:e}of this._tileBounds.values()){const{minX:s,minY:a,maxX:o,maxY:l}=e.toJSON();t=Math.min(t,s),r=Math.min(r,a),n=Math.min(n,o),i=Math.min(i,l)}return{xmin:t,ymin:r,xmax:n,ymax:i,spatialReference:e}}}class j{static{this.shared=new j}getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}}const V=new M.E;var k=r(80893);class U{constructor(e,t,r){this.descriptor=e,this._pages=t,this._pageSize=r;const n=v.ez+t.reduce(((e,{usedMemory:t})=>e+t),0),i=3*v.RS;this.usedMemory=v.qK+n+i,this.featureCount=t.reduce(((e,t)=>e+t.featureCount),0)}get id(){return this.descriptor.id}getObjectId(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getObjectId(r)}getAttribute(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getAttribute(n,t)}getAttributeAsTimestamp(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getAttributeAsTimestamp(n,t)}getAttributes(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getAttributes(r)}getCoordinates(e,t,r){const{pageIndex:n,featurePageIndex:i}=this._translateIndex(e);this._pages[n].getCoordinates(i,t,r)}getOptimizedGeometry(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getOptimizedGeometry(r)}getCentroid(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getCentroid(n,t)}getBounds(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBounds(r)}getBoundingBox(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBoundingBox(r)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){let n=r;for(const{page:r,indices:i}of this._batchPageIndices(t))n=r.getObjectIdsArray(e,i,n);return n}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){let n=r;for(const{page:r,indices:i}of this._batchPageIndices(t))n=r.getCoordinatesArray(e,i,n);return n}*objectIds(e=this._allFeatureIndices()){for(const{page:t,indices:r}of this._batchPageIndices(e))for(const e of t.objectIds(r))yield e}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_translateIndex(e){const{_pageSize:t}=this;return{pageIndex:Math.floor(e/t),featurePageIndex:e%t}}*_batchPageIndices(e){const t=new Array;{let r=0,n=new Array;for(const i of e){const{pageIndex:e,featurePageIndex:s}=this._translateIndex(i);r!==e&&(0!==n.length&&t.push({pageIndex:r,indices:n}),r=e,n=[]),n.push(s)}0!==n.length&&t.push({pageIndex:r,indices:n})}const{_pages:r}=this;for(const{pageIndex:e,indices:n}of t)yield{page:r[e],indices:n}}}var N=r(49186),L=r(51624),q=r(51850),H=r(70328),G=r(62577),$=r(95466),Y=r(53655);class W{constructor(e){this._reader=new L.A(new Uint8Array(e),new DataView(e)),this._index=function(e){for(;e.next();){if(2===e.tag())return X(e.getMessage());e.skip()}Q()}(this._reader)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}get usedMemory(){return this._reader.usedMemory}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:n}}=this,i=r.get(t)?.index;if(null==i)return;const s=n[e*r.fields.length+i],a=this._reader;return a.move(s),J(a)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,n=e*t.fields.length,i=this._reader,s={};for(const e of t.fields){const t=r[n+e.index];i.move(t),s[e.name]=J(i)}return s}getCoordinates(e,t,r=0){const n=this._reader,{transform:i,featureIndices:s}=this._index,{scale:a,translate:o}=i;n.move(s[e]),this._readCoordinates(a,o,t,r)}getOptimizedGeometry(e){const t=(0,q.vt)();return this.getCoordinates(e,t),new P.A([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,K);const[n,i,s]=K,a=[n,i];return t&&(a[3]=s),r&&(a[t?4:3]=0),new P.A([],a)}getBounds(e){this.getCoordinates(e,K);const[t,r]=K,n=new M.E;return n.minX=t,n.minY=r,n.maxX=t,n.maxY=r,n}getBoundingBox(e){this.getCoordinates(e,K);const[t,r,n]=K;return(0,H.fA)(t,r,n,t,r,n)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){const n=this._reader,{objectIdFieldName:i,attributeIndices:s,fieldsIndex:a}=this._index,o=a.get(i).index,l=a.fields.length;for(const i of t){const t=s[i*l+o];n.move(t),e[r++]=J(n)}return r}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){const n=this._reader,{transform:i,featureIndices:s}=this._index,{scale:a,translate:o}=i;for(const i of t){const t=s[i];n.move(t),r=this._readCoordinates(a,o,e,r)}return r}*objectIds(e=this._allFeatureIndices()){const t=this._reader,{objectIdFieldName:r,attributeIndices:n,fieldsIndex:i}=this._index,s=i.get(r).index,a=i.fields.length;for(const r of e){const e=n[r*a+s];t.move(e),yield J(t)}}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_readCoordinates([e,t,r],[n,i,s],a,o){const l=this._reader,c=l.getLength(),d=l.pos()+c;for(;l.pos()<d&&l.next();)switch(l.tag()){case 2:{const c=l.getLength(),d=l.pos()+c;for(;l.pos()<d&&l.next();)3===l.tag()?(l.getUInt32(),a[o++]=n+e*l.getSInt64(),a[o++]=i+t*l.getSInt64(),a[o++]=s+r*l.getSInt64()):l.skip();break}default:l.skip()}return o}}function X(e){for(;e.next();){if(1===e.tag())return Z(e.getMessage());e.skip()}Q()}function Z(e){let t,r,n=!1,i=!1,s=0;const a=new Array,o=new Array,l=new Array;for(;e.next();)switch(e.tag()){case 1:r=e.getString();break;case 7:0!==e.getEnum()&&Q();break;case 9:n=e.getBool()??!1;break;case 12:t=(0,G.Q1)(e.processMessage(Y.ae));break;case 13:{const t=e.processMessage(Y.cn);t.index=s++,a.push(t);break}case 15:{o.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)1===e.tag()?(l.push(e.pos()),e.skip()):e.skip();break}case 10:i=e.getBool()??!1;break;default:e.skip()}const c=new $.A(a);return null!=t&&i&&null!=r&&c.has(r)||Q(),{transform:t,exceededTransferLimit:n,fieldsIndex:c,objectIdFieldName:r,featureIndices:o,attributeIndices:l}}function Q(){const e=new N.A("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(e),e}function J(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}const K=(0,q.vt)();class ee{constructor(e,t,r,n,i){this.spatialReference=e,this.url=r,this.objectIdField=n,this.capabilities=i;const{supportsMaxRecordCountFactor:s,maxRecordCount:a}=this.capabilities.query,o=s?4:1,l=(a??8e3)*o;this._pageSize=Math.min(8e3,l);const c=t.clone();c.cacheHint=!0,c.resultType="tile",c.outSpatialReference=e,c.returnGeometry=!0,c.returnZ=!0,c.maxRecordCountFactor=o,c.num=this._pageSize,c.outFields=[n],this._baseQuery=c}async fetch(e,t){const{spatialReference:r,_pageSize:n}=this,i=(0,b.w1)(e.extent,r),a=this._baseQuery.clone();a.geometry=i;const o=new Array;let l=0,c=!1,d=1;for(;!c;){const e=[];for(let r=0;r<d;++r)e.push(this._fetchPage(a,l++,t));const r=await Promise.all(e);(0,s.Te)(t);for(const e of r){const t=0!==e.featureCount;c||=!e.exceededTransferLimit||!t,t&&o.push(e)}d=Math.min(d+1,4)}return new U(e,o,n)}async _fetchPage(e,t,r){const n=e.clone();n.start=t*this._pageSize;const i=(await(0,k.kS)(this.url,n,{signal:r})).data;return(0,s.Te)(r),new W(i)}}var te=r(58083),re=r(9093),ne=r(97146),ie=r(24151),se=r(29920),ae=r(46540),oe=r(51768),le=r(34727),ce=r(77690),de=r(29242),ue=r(37585),he=r(48163),fe=r(38954),pe=r(91829);var me=r(13030),ge=r(78662),ye=r(26857),_e=r(1843),be=r(49255),ve=r(40268),xe=r(16943),we=r(25634),Se=r(11725),Ae=r(13464),Ce=r(77194),Ie=r(620);class Te{constructor(){this.scale=0,this.factor=0,this.minScaleFactor=0}}var Oe=r(59907),Re=r(43616),Me=r(13259),Ee=r(97220),Pe=r(98958),ze=r(59643),Fe=r(33524),De=r(63907),Be=r(90644);class je extends Pe.w{constructor(e,t){super(e,t,new Ee.$(Me.H,(()=>r.e(8241).then(r.bind(r,48241))))),this.primitiveType=t.occlusionPass?De.WR.POINTS:De.WR.TRIANGLES}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:n,output:i,depthTestEnabled:s,occlusionPass:a}=e,o=t===ze.Y.NONE,l=t===ze.Y.ColorAlpha,c=i===be.V.Highlight,d=s&&!n&&!l&&!a&&!c;return(0,Be.Ey)({blending:(0,be.RN)(i)?o?Be.RC:(0,Fe.ez)(t):null,depthTest:s&&!n?{func:De.MT.LEQUAL}:null,depthWrite:d?Be.Uy:null,drawBuffers:(0,Fe.m6)(t,i),colorWrite:Be.kn,polygonOffset:r?Ve:null})}}const Ve={factor:0,units:-4};var ke=r(53466),Ue=r(22911),Ne=r(51976),Le=r(35256);class qe extends Le.E{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.objectAndLayerIdColorInstanced=!1,this.horizonCullingEnabled=!0,this.isFocused=!0,this.textureCoordinateType=ke.I.None,this.emissionSource=Ue.ZX.None,this.discardInvisibleFragments=!0,this.hasVvInstancing=!1}}(0,n._)([(0,Ne.W)()],qe.prototype,"screenCenterOffsetUnitsEnabled",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"occlusionTestEnabled",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"signedDistanceFieldEnabled",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"vvSize",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"vvColor",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"hasVerticalOffset",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"hasScreenSizePerspective",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"hasRotation",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"debugDrawLabelBorder",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"hasPolygonOffset",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"depthTestEnabled",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"pixelSnappingEnabled",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"draped",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"terrainDepthTest",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"cullAboveTerrain",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"occlusionPass",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"occludedFragmentFade",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"objectAndLayerIdColorInstanced",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"horizonCullingEnabled",void 0),(0,n._)([(0,Ne.W)()],qe.prototype,"isFocused",void 0);var He=r(49788);class Ge extends Se.im{constructor(e,t){super(e,mt),this.produces=new Map([[Ae.N.HUD_MATERIAL,e=>(0,be.Mb)(e)&&!this.parameters.drawAsLabel],[Ae.N.LABEL_MATERIAL,e=>(0,be.Mb)(e)&&this.parameters.drawAsLabel],[Ae.N.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[Ae.N.DRAPED_MATERIAL,e=>this.parameters.draped&&(0,be.Mb)(e)]]),this._visible=!0,this._configuration=new qe(t)}getConfiguration(e,t){const r=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=r,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===Ae.N.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=!r&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||t.slot===Ae.N.OCCLUSION_PIXELS,(0,be.RN)(e)&&(this._configuration.debugDrawLabelBorder=!!ye.b.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,r,n,i,s){const{options:{selectionMode:a,hud:o,excludeLabels:l},point:c,camera:d}=r,{parameters:u}=this;if(!a||!o||l&&u.isLabel||!e.visible||!c)return;const h=e.attributes.get(ae.r.FEATUREATTRIBUTE),f=null==h?null:(0,pe.ci)(h.data,ct),{scaleX:p,scaleY:m}=bt(f,u,d.pixelRatio);(0,ce.z0)(nt,t),e.attributes.has(ae.r.FEATUREATTRIBUTE)&&function(e){const t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],d=1/Math.sqrt(t*t+r*r+n*n),u=1/Math.sqrt(i*i+s*s+a*a),h=1/Math.sqrt(o*o+l*l+c*c);e[0]=t*d,e[1]=r*d,e[2]=n*d,e[3]=i*u,e[4]=s*u,e[5]=a*u,e[6]=o*h,e[7]=l*h,e[8]=c*h}(nt);const g=e.attributes.get(ae.r.POSITION),y=e.attributes.get(ae.r.SIZE),_=e.attributes.get(ae.r.NORMAL),b=e.attributes.get(ae.r.ROTATION),v=e.attributes.get(ae.r.CENTEROFFSETANDDISTANCE);(0,Ie.vA)(g.size>=3);const x=(0,Me.c)(u),w="screen"===this.parameters.centerOffsetUnits;for(let e=0;e<g.data.length/g.size;e++){const n=e*g.size;(0,fe.i)(Ze,g.data[n],g.data[n+1],g.data[n+2]),(0,fe.t)(Ze,Ze,t),(0,fe.t)(Ze,Ze,d.viewMatrix);const i=e*v.size;if((0,fe.i)(ot,v.data[i],v.data[i+1],v.data[i+2]),!w&&(Ze[0]+=ot[0],Ze[1]+=ot[1],0!==ot[2])){const e=ot[2];(0,fe.n)(ot,Ze),(0,fe.d)(Ze,Ze,(0,fe.h)(ot,ot,e))}const a=e*_.size;if((0,fe.i)(Qe,_.data[a],_.data[a+1],_.data[a+2]),Ye(Qe,nt,d,dt),vt(this.parameters,Ze,dt,d,Xe),d.applyProjection(Ze,Je),Je[0]>-1){w&&(ot[0]||ot[1])&&(Je[0]+=ot[0]*d.pixelRatio,0!==ot[1]&&(Je[1]+=(0,Ce.m0)(ot[1],Xe.factorAlignment)*d.pixelRatio),d.unapplyProjection(Je,Ze)),Je[0]+=this.parameters.screenOffset[0]*d.pixelRatio,Je[1]+=this.parameters.screenOffset[1]*d.pixelRatio,Je[0]=Math.floor(Je[0]),Je[1]=Math.floor(Je[1]);const t=e*y.size;ft[0]=y.data[t],ft[1]=y.data[t+1],(0,Ce.MD)(ft,Xe.factor,ft);const n=ut*d.pixelRatio;let i=0;u.textureIsSignedDistanceField&&(i=Math.min(u.outlineSize,.5*ft[0])*d.pixelRatio/2),ft[0]*=p,ft[1]*=m;const a=e*b.size,o=u.rotation+b.data[a];if(We(c,Je[0],Je[1],ft,n,i,o,u,x)){const e=r.ray;if((0,fe.t)(et,Ze,(0,te.B8)(st,d.viewMatrix)),Je[0]=c[0],Je[1]=c[1],d.unprojectFromRenderScreen(Je,Ze)){const t=(0,q.vt)();(0,fe.c)(t,e.direction);const r=1/(0,fe.l)(t);(0,fe.h)(t,t,r),s((0,fe.j)(e.origin,Ze)*r,t,-1,!0,1,et)}}}}}intersectDraped(e,t,r,n,i,s){const a=e.attributes.get(ae.r.POSITION),o=e.attributes.get(ae.r.SIZE),l=e.attributes.get(ae.r.ROTATION),c=this.parameters,d=(0,Me.c)(c),u=e.attributes.get(ae.r.FEATUREATTRIBUTE),h=null==u?null:(0,pe.ci)(u.data,ct),{scaleX:f,scaleY:p}=bt(h,c,e.screenToWorldRatio),m=ht*e.screenToWorldRatio;for(let t=0;t<a.data.length/a.size;t++){const r=t*a.size,u=a.data[r],h=a.data[r+1],g=t*o.size;ft[0]=o.data[g],ft[1]=o.data[g+1];let y=0;c.textureIsSignedDistanceField&&(y=Math.min(c.outlineSize,.5*ft[0])*e.screenToWorldRatio/2),ft[0]*=f,ft[1]*=p;const _=t*l.size,b=c.rotation+l.data[_];We(n,u,h,ft,m,y,b,c,d)&&i(s.dist,s.normal,-1,!1)}}createBufferWriter(){return new _t}applyShaderOffsetsView(e,t,r,n,i,s,a){const o=Ye(t,r,i,dt);return this._applyVerticalGroundOffsetView(e,o,i,a),vt(this.parameters,a,o,i,s),this._applyPolygonOffsetView(a,o,n[3],i,a),this._applyCenterOffsetView(a,n,a),a}applyShaderOffsetsNDC(e,t,r,n,i){return this._applyCenterOffsetNDC(e,t,r,n),null!=i&&(0,fe.c)(i,n),this._applyPolygonOffsetNDC(n,t,r,n),n}_applyPolygonOffsetView(e,t,r,n,i){const s=n.aboveGround?1:-1;let a=Math.sign(r);0===a&&(a=s);const o=s*a;if(this.parameters.shaderPolygonOffset<=0)return(0,fe.c)(i,e);const l=(0,le.qE)(Math.abs(t.cosAngle),.01,1),c=1-Math.sqrt(1-l*l)/l/n.viewport[2];return(0,fe.h)(i,e,o>0?c:1/c),i}_applyVerticalGroundOffsetView(e,t,r,n){const i=(0,fe.l)(e),s=r.aboveGround?1:-1,a=r.computeRenderPixelSizeAtDist(i)*ve.R,o=(0,fe.h)(Ze,t.normal,s*a);return(0,fe.g)(n,e,o),n}_applyCenterOffsetView(e,t,r){const n="screen"!==this.parameters.centerOffsetUnits;return r!==e&&(0,fe.c)(r,e),n&&(r[0]+=t[0],r[1]+=t[1],t[2]&&((0,fe.n)(Qe,r),(0,fe.g)(r,r,(0,fe.h)(Qe,Qe,t[2])))),r}_applyCenterOffsetNDC(e,t,r,n){const i="screen"!==this.parameters.centerOffsetUnits;return n!==e&&(0,fe.c)(n,e),i||(n[0]+=t[0]/r.fullWidth*2,n[1]+=t[1]/r.fullHeight*2),n}_applyPolygonOffsetNDC(e,t,r,n){const i=this.parameters.shaderPolygonOffset;if(e!==n&&(0,fe.c)(n,e),i){const e=r.aboveGround?1:-1,s=e*Math.sign(t[3]);n[2]-=(s||e)*i}return n}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:r}=this.parameters,n=e[3]>=He.Q||t>=He.Q&&r[3]>=He.Q;return this._visible&&n}createGLMaterial(e){return new $e(e)}calculateRelativeScreenBounds(e,t,r=(0,b.vt)()){return function(e,t,r,n){n[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,n[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class $e extends we.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(je,e)}}function Ye(e,t,r,n){return function(e){return(t=e)instanceof Float32Array&&t.length>=16||function(e){return Array.isArray(e)&&e.length>=16}(e);var t}(t)&&(t=(0,ce.z0)(it,t)),(0,fe.q)(n.normal,e,t),(0,fe.t)(n.normal,n.normal,r.viewInverseTransposeMatrix),n.cosAngle=(0,fe.f)(Ke,pt),n}function We(e,t,r,n,i,s,a,o,l){let c=t-i-n[0]*l[0],d=c+n[0]+2*i,u=r-i-n[1]*l[1],h=u+n[1]+2*i;const f=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&null!=f&&(c+=n[0]*f[0],u+=n[1]*f[1],d-=n[0]*(1-f[2]),h-=n[1]*(1-f[3]),c-=s,d+=s,u-=s,h+=s),(0,ue.hZ)(rt,t,r),(0,ue.e$)(tt,e,rt,(0,le.kU)(a)),tt[0]>c&&tt[0]<d&&tt[1]>u&&tt[1]<h}const Xe=new class{constructor(){this.factor=new Te,this.factorAlignment=new Te}},Ze=(0,q.vt)(),Qe=(0,q.vt)(),Je=(0,pe.vt)(),Ke=(0,q.vt)(),et=(0,q.vt)(),tt=(0,he.vt)(),rt=(0,he.vt)(),nt=(0,de.vt)(),it=(0,de.vt)(),st=(0,re.vt)(),at=(0,pe.vt)(),ot=(0,q.vt)(),lt=(0,q.vt)(),ct=(0,pe.vt)(),dt={normal:Ke,cosAngle:0},ut=1,ht=2,ft=(0,he.fA)(0,0),pt=(0,q.fA)(0,0,1);class mt extends we.NV{constructor(){super(...arguments),this.renderOccluded=Se.m$.Occlude,this.isDecoration=!1,this.color=(0,pe.CN)(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=(0,he.fA)(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=(0,pe.CN)(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=(0,pe.vt)(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusEffect="none",this.draped=!1,this.isLabel=!1}}const gt=(0,_e.BP)().vec3f(ae.r.POSITION).vec3f(ae.r.NORMAL).vec2i16(ae.r.UVI).vec4u8(ae.r.COLOR).vec2f(ae.r.SIZE).f32(ae.r.ROTATION).vec4f(ae.r.CENTEROFFSETANDDISTANCE).vec4f(ae.r.FEATUREATTRIBUTE),yt=gt.clone().vec4u8(ae.r.OLIDCOLOR);class _t{constructor(){this.vertexBufferLayout=(0,xe.E)()?yt:gt}elementCount(e){return 6*e.get(ae.r.POSITION).indices.length}write(e,t,r,n,i,s){const{position:a,normal:o,uvi:l,color:c,size:d,rotation:u,centerOffsetAndDistance:h,featureAttribute:f}=i;(0,Oe.Hk)(r.get(ae.r.POSITION),e,a,s,6),(0,Oe.p1)(r.get(ae.r.NORMAL),t,o,s,6);const p=r.get(ae.r.UVI)?.data;let m=0,g=0,y=-1-Me.f,_=-1-Me.f;p&&p.length>=4&&(m=p[0],g=p[1],y=-1-p[2],_=-1-p[3]);let b=r.get(ae.r.POSITION).indices.length,v=s;for(let e=0;e<b;++e)l.set(v,0,m),l.set(v,1,g),v++,l.set(v,0,y),l.set(v,1,g),v++,l.set(v,0,y),l.set(v,1,_),v++,l.set(v,0,y),l.set(v,1,_),v++,l.set(v,0,m),l.set(v,1,_),v++,l.set(v,0,m),l.set(v,1,g),v++;(0,Oe.tb)(r.get(ae.r.COLOR),4,c,s,6);const{data:x,indices:w}=r.get(ae.r.SIZE);b=w.length,v=s;for(let e=0;e<b;++e){const t=x[2*w[e]],r=x[2*w[e]+1];for(let e=0;e<6;++e)d.set(v,0,t),d.set(v,1,r),v++}if((0,Oe.uO)(r.get(ae.r.ROTATION),u,s,6),r.get(ae.r.CENTEROFFSETANDDISTANCE)?(0,Oe.Ut)(r.get(ae.r.CENTEROFFSETANDDISTANCE),h,s,6):(0,Oe.Pq)(h,s,6*b),r.get(ae.r.FEATUREATTRIBUTE)?(0,Oe.Ut)(r.get(ae.r.FEATUREATTRIBUTE),f,s,6):(0,Oe.Pq)(f,s,6*b),null!=n){const e=r.get(ae.r.POSITION)?.indices;if(e){const t=e.length,r=i.getField(ae.r.OLIDCOLOR,me.XP);(0,Oe.vx)(n,r,t,s,6)}}return{numVerticesPerItem:6,numItems:b}}intersect(e,t,r,n,i,s,a){const{options:{selectionMode:o,hud:l,excludeLabels:c},point:d,camera:u}=n;if(!o||!l||c&&t.isLabel||!d)return;const h=this.vertexBufferLayout.createView(e),f=h.getField(ae.r.POSITION,me.xs),p=h.getField(ae.r.NORMAL,me.xs),m=h.getField(ae.r.ROTATION,me.Y$),g=h.getField(ae.r.SIZE,me.gH),y=h.getField(ae.r.FEATUREATTRIBUTE,me.Eq),_=h.getField(ae.r.CENTEROFFSETANDDISTANCE,me.Eq),b="screen"===t.centerOffsetUnits,v=(0,Me.c)(t);if(null==f||null==p||null==m||null==g||null==_)return;const x=null==y?null:y.getVec(0,ct),{scaleX:w,scaleY:S}=bt(x,t,u.pixelRatio),A=f.count/6;for(let e=0;e<A;e++){const i=6*e;if(f.getVec(i,Ze),null!=r&&(0,fe.g)(Ze,Ze,r),(0,fe.t)(Ze,Ze,u.viewMatrix),_.getVec(i,at),(0,fe.i)(ot,at[0],at[1],at[2]),!b&&(Ze[0]+=ot[0],Ze[1]+=ot[1],0!==ot[2])){const e=ot[2];(0,fe.n)(ot,Ze),(0,fe.d)(Ze,Ze,(0,fe.h)(ot,ot,e))}if(p.getVec(i,Qe),Ye(Qe,nt,u,dt),vt(t,Ze,dt,u,Xe),u.applyProjection(Ze,Je),Je[0]>-1){b&&(ot[0]||ot[1])&&(Je[0]+=ot[0]*u.pixelRatio,0!==ot[1]&&(Je[1]+=(0,Ce.m0)(ot[1],Xe.factorAlignment)*u.pixelRatio),u.unapplyProjection(Je,Ze)),Je[0]+=t.screenOffset[0]*u.pixelRatio,Je[1]+=t.screenOffset[1]*u.pixelRatio,Je[0]=Math.floor(Je[0]),Je[1]=Math.floor(Je[1]),g.getVec(i,ft),(0,Ce.MD)(ft,Xe.factor,ft);const r=ut*u.pixelRatio;let s=0;t.textureIsSignedDistanceField&&(s=Math.min(t.outlineSize,.5*ft[0])*u.pixelRatio/2),ft[0]*=w,ft[1]*=S;const o=m.get(i),l=t.rotation+o;if(We(d,Je[0],Je[1],ft,r,s,l,t,v)){const t=n.ray;if((0,fe.t)(et,Ze,(0,te.B8)(st,u.viewMatrix)),Je[0]=d[0],Je[1]=d[1],u.unprojectFromRenderScreen(Je,Ze)){const r=(0,q.vt)();(0,fe.c)(r,t.direction);const n=1/(0,fe.l)(r);(0,fe.h)(r,r,n),a((0,fe.j)(t.origin,Ze)*n,r,e,!0,1,et)}}}}}}function bt(e,t,r){return null==e||null==t.vvSize?{scaleX:r,scaleY:r}:((0,ge.VC)(lt,t,e),{scaleX:lt[0]*r,scaleY:lt[1]*r})}function vt(e,t,r,n,i){if(!e.verticalOffset?.screenLength)return e.screenSizePerspective||e.screenSizePerspectiveAlignment?xt(e,i,(0,fe.l)(t),r.cosAngle):(i.factor.scale=1,i.factorAlignment.scale=1),t;const s=(0,fe.l)(t),a=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=(0,Re.kE)(n,s,e.verticalOffset,r.cosAngle,a);return xt(e,i,s,r.cosAngle),(0,fe.h)(r.normal,r.normal,o),(0,fe.g)(t,t,r.normal)}function xt(e,t,r,n){null!=e.screenSizePerspective?(0,Ce.cJ)(n,r,e.screenSizePerspective,t.factor):(t.factor.scale=1,t.factor.factor=0,t.factor.minScaleFactor=0),null!=e.screenSizePerspectiveAlignment?(0,Ce.cJ)(n,r,e.screenSizePerspectiveAlignment,t.factorAlignment):(t.factorAlignment.factor=t.factor.factor,t.factorAlignment.scale=t.factor.scale,t.factorAlignment.minScaleFactor=t.factor.minScaleFactor)}class wt{constructor(e,t){this._mainThreadDelegate=t,this._bufferWriters=new Map,this._sharedTextures=new Map,this.globalViewingMode=e===ie.RT.Global}createRenderCommandBuffer(){return{commands:[],transferList:[]}}mergeRenderCommandBuffers(e){const t=this.createRenderCommandBuffer();for(const r of e)null!=r&&(t.commands.push(...r.commands),t.transferList.push(...r.transferList));return t}async getOrCreateSharedTexture(e,t){const{data:r,parameters:n}=t(),i=await this._mainThreadDelegate.createTexture(r,n);return this._sharedTextures.set(e,i),i}async releaseSharedTexture(e){const t=this._sharedTextures,r=t.get(e);null!=r&&(t.delete(e),await this._mainThreadDelegate.releaseTexture(r))}async createMaterial(e){const{type:t,parameters:r}=e,n=w("material");let i,s;switch(t){case"default":i=new oe.$U(e.parameters,{spherical:this.globalViewingMode}),s={type:t,id:n,parameters:e.parameters};break;case"hud":i=new Ge(r,this.globalViewingMode),s={type:t,id:n,parameters:e.parameters}}return this._bufferWriters.set(n,i.createBufferWriter()),await this._mainThreadDelegate.createMaterial(s),n}async createDirectRenderer(e){return await this._mainThreadDelegate.createDirectRenderer(e),e}addDirectRendererGeometry(e,t,r){const{materialId:n}=t;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.addDirectRendererGeometryBuffer(n,e,i,s,r)}updateDirectRendererGeometry(e,t,r){const{materialId:n}=t;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.updateDirectRendererGeometryBuffer(n,e,i,s,r)}addDirectRendererGeometryBuffer(e,t,r,n,i){const{objectIds:s,visibilities:a}=n;return{commands:[{id:"add-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:n,localOrigin:i}],transferList:[r.data,s.buffer,a.buffer]}}updateDirectRendererGeometryBuffer(e,t,r,n,i){const{objectIds:s,visibilities:a}=n;return{commands:[{id:"update-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:n,localOrigin:i}],transferList:[r.data,s.buffer,a.buffer]}}removeDirectRendererGeometryBuffer(e,t){return{commands:[{id:"remove-direct-renderer-geometry-buffer",rendererId:e,groupId:t}],transferList:[]}}async createLodRenderer(e){const t=w("lod-renderer"),r=new Set,n={levels:e.levels.map((e=>({components:e.components.map((e=>{const t=e.attributes.get(ae.r.POSITION);if(!t||0===t.indices.length)throw new Error("positions attribute expected");const n=(0,ne.tM)(t.indices.length/3),i=new se.j(n,3,t);if(null==this._bufferWriters.get(e.materialId))throw new Error("writer not found");const{renderGeometryBuffer:s}=this.createRenderGeometryBuffer(e,null);return r.add(s.data),{materialId:e.materialId,renderGeometryBuffer:s,boundingInfo:{bbMax:i.bbMax,bbMin:i.bbMin}}})),minScreenSpaceRadius:e.minScreenSpaceRadius})))};return await this._mainThreadDelegate.createLodRenderer(t,n,Array.from(r)),t}addLodInstances(e,t,r){return{commands:[{id:"add-lod-instances",rendererId:e,groupId:t,data:r}],transferList:[r.featureIds.buffer,r.globalTransforms.buffer,r.localTransforms.buffer,r.visibility.buffer]}}removeLodInstances(e,t){return{commands:[{id:"remove-lod-instances",rendererId:e,groupId:t}],transferList:[]}}updateLodInstancesData(e,t,r){return{commands:[{id:"update-lod-instance-data",rendererId:e,groupId:t,globalTransforms:r}],transferList:[r.buffer]}}updateVisibility(e,t,r){return{commands:[{id:"update-visibility",rendererId:e,groupId:t,visibility:r}],transferList:[r.buffer]}}async dispatchRenderCommands(e){0!==e.commands.length&&await this._mainThreadDelegate.executeRenderCommands(e)}createRenderGeometryBuffer(e,t){const{materialId:r,visibilities:n,objectIds:i}=e,s=this._bufferWriters.get(r);if(null==s)throw new Error("no registered bufferWriter for material found");let a=null;if(e.transformation&&t)(0,te.C)(St,e.transformation),St[12]-=t[0],St[13]-=t[1],St[14]-=t[2],a=St;else{if(t)throw new Error("not implemented");e.transformation&&(a=e.transformation)}let o=null;a&&((0,te.B8)(At,St),(0,te.mg)(At,At),o=At);const l=e.attributes,c=s.elementCount(l),d=s.vertexBufferLayout.stride/4;c>Math.floor(Ct/d)&&console.warn("geometry with very large number of elements encountered");const u=s.vertexBufferLayout.createBuffer(c),h=s.write(a,o,l,e.objectAndLayerIdColor,u,0);if(null==h)throw new Error("Bufferwriter.write does not provide item information.");if(n.length!==h.numItems||i.length!==h.numItems)throw new Error("Unexpected mismatch between number of RenderGeometryBufferItems and provided objectIds/visibility flags.");return{renderGeometryBuffer:{data:u.buffer,elementCount:c},renderGeometryBufferItems:{objectIds:i,visibilities:n,ranges:{numVertices:h.numVerticesPerItem,numItems:h.numItems}}}}}const St=(0,re.vt)(),At=(0,re.vt)(),Ct=4194304;class It{constructor(e,t,r){this.renderCommandContext=e,this.renderCommandBuffer=t,this.pipelineStateCommands=r}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const t of e)this.appendPipelineStateCommand(t)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}}var Tt=r(9762),Ot=r(27993);function Rt(e){const{featureCount:t}=e;if(0===t)return new Uint32Array;const r=new Uint32Array(t);return e.getObjectIdsArray(r),r}function Mt(e){const{featureCount:t}=e;if(0===t)return new Float64Array;const r=new Float64Array(3*t);return e.getCoordinatesArray(r),r}function Et(e,t){const r=t.viewSpatialReference,n=t.renderSpatialReference,{extent:i}=e,s=(0,b.gX)(i),a=(0,q.vt)();return(0,Ot.F)([s[0],s[1],0],r,a,n),a}var Pt=r(48353),zt=r(8887),Ft=r(83047);function Dt(e){const t=new Map;for(const[r,n]of e)t.set(r,{...n,indices:(0,ne.Dg)(n.indices)});return t}r(87317),r(12359),r(95108),r(27615),r(52106),r(4718),r(34275),r(65864);var Bt,jt,Vt=r(57917),kt=r(72385),Ut=(r(4197),r(11868)),Nt=r(240),Lt=(r(71351),r(46610));(jt=Bt||(Bt={})).length=function(e,t){const r=e[t],n=e[t+1],i=e[t+2];return Math.sqrt(r*r+n*n+i*i)},jt.normalize=function(e,t){const r=e[t],n=e[t+1],i=e[t+2],s=1/Math.sqrt(r*r+n*n+i*i);e[t]*=s,e[t+1]*=s,e[t+2]*=s},jt.scale=function(e,t,r){e[t]*=r,e[t+1]*=r,e[t+2]*=r},jt.add=function(e,t,r,n,i,s=t){(i=i||e)[s]=e[t]+r[n],i[s+1]=e[t+1]+r[n+1],i[s+2]=e[t+2]+r[n+2]},jt.subtract=function(e,t,r,n,i,s=t){(i=i||e)[s]=e[t]-r[n],i[s+1]=e[t+1]-r[n+1],i[s+2]=e[t+2]-r[n+2]},r(96672),r(87170);const qt=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)qt[6*e+t]=e;const Ht=new Array(36);for(let e=0;e<6;e++)Ht[6*e]=0,Ht[6*e+1]=1,Ht[6*e+2]=2,Ht[6*e+3]=2,Ht[6*e+4]=3,Ht[6*e+5]=0;const Gt=(0,kt.fA)(-.5,0,-.5),$t=(0,kt.fA)(.5,0,-.5),Yt=(0,kt.fA)(0,0,.5),Wt=(0,kt.fA)(0,.5,0),Xt=(0,kt.vt)(),Zt=(0,kt.vt)(),Qt=(0,kt.vt)(),Jt=(0,kt.vt)(),Kt=(0,kt.vt)();function er(e,t){switch(e){case"cone":return((e,r,n=!1)=>({levels:e.map((e=>{const i=Dt(r(e.tesselation));return n&&function(e){const t=e,r=t.get(ae.r.POSITION).data,n=t.get(ae.r.NORMAL).data;if(n){const t=tr(e,ae.r.NORMAL).data;for(let e=0;e<n.length;e+=3){const r=n[e+1];t[e+1]=-n[e+2],t[e+2]=r}}if(r){const t=tr(e,ae.r.POSITION).data;for(let e=0;e<r.length;e+=3){const n=r[e+1];t[e+1]=-r[e+2],t[e+2]=n}}}(i),{components:[{attributes:i,objectAndLayerIdColor:void 0,transformation:null,materialId:t,visibilities:new Uint8Array([1]),objectIds:new Uint32Array([-1])}],minScreenSpaceRadius:e.minScreenSpaceRadius}}))}))(rr,(e=>function(e,t,r,n,i=!0,s=!0){let a=0;const o=t,l=e;let c=(0,kt.fA)(0,a,0),d=(0,kt.fA)(0,a+l,0),u=(0,kt.fA)(0,-1,0),h=(0,kt.fA)(0,1,0);n&&(a=l,d=(0,kt.fA)(0,0,0),c=(0,kt.fA)(0,a,0),u=(0,kt.fA)(0,1,0),h=(0,kt.fA)(0,-1,0));const f=[d,c],p=[u,h],m=r+2,g=Math.sqrt(l*l+o*o);if(n)for(let e=r-1;e>=0;e--){const t=e*(2*Math.PI/r),n=(0,kt.fA)(Math.cos(t)*o,a,Math.sin(t)*o);f.push(n);const i=(0,kt.fA)(l*Math.cos(t)/g,-o/g,l*Math.sin(t)/g);p.push(i)}else for(let e=0;e<r;e++){const t=e*(2*Math.PI/r),n=(0,kt.fA)(Math.cos(t)*o,a,Math.sin(t)*o);f.push(n);const i=(0,kt.fA)(l*Math.cos(t)/g,o/g,l*Math.sin(t)/g);p.push(i)}const y=new Array,_=new Array;if(i){for(let e=3;e<f.length;e++)y.push(1),y.push(e-1),y.push(e),_.push(0),_.push(0),_.push(0);y.push(f.length-1),y.push(2),y.push(1),_.push(0),_.push(0),_.push(0)}if(s){for(let e=3;e<f.length;e++)y.push(e),y.push(e-1),y.push(0),_.push(e),_.push(e-1),_.push(1);y.push(0),y.push(2),y.push(f.length-1),_.push(1),_.push(2),_.push(p.length-1)}const b=(0,Ut.oe)(3*m);for(let e=0;e<m;e++)b[3*e]=f[e][0],b[3*e+1]=f[e][1],b[3*e+2]=f[e][2];const v=(0,Ut.oe)(3*m);for(let e=0;e<m;e++)v[3*e]=p[e][0],v[3*e+1]=p[e][1],v[3*e+2]=p[e][2];return[[ae.r.POSITION,new Lt.n(b,y,3,!0)],[ae.r.NORMAL,new Lt.n(v,_,3,!0)]]}(1,.5,e,!1)),!0);case"sphere":case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function tr(e,t){let r=e.get(t);return r&&!r.exclusive&&(r={...r,exclusive:!0,data:(0,Vt.S)(r.data)},e.set(t,r)),r}(0,fe.d)(Xt,Gt,Wt),(0,fe.d)(Zt,Gt,$t),(0,fe.e)(Qt,Xt,Zt),(0,fe.n)(Qt,Qt),(0,fe.d)(Xt,$t,Wt),(0,fe.d)(Zt,$t,Yt),(0,fe.e)(Jt,Xt,Zt),(0,fe.n)(Jt,Jt),(0,fe.d)(Xt,Yt,Wt),(0,fe.d)(Zt,Yt,Gt),(0,fe.e)(Kt,Xt,Zt),(0,fe.n)(Kt,Kt),Qt[0],Qt[1],Qt[2],Jt[0],Jt[1],Jt[2],Kt[0],Kt[1],Kt[2],(0,q.vt)();const rr=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];var nr=r(74810);class ir{constructor(e){this._context=e,this.lodRendererId=null,this._loaded=!1,this._loadingPromise=null,this._primitive="cone"}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const e=this._context.renderCommandContext,t={usePBR:!0,isSchematic:!0,mrrFactors:nr.Bt,ambient:q.Un,diffuse:q.Un,hasSlicePlane:!1,castShadows:!0,offsetTransparentBackfaces:!1,screenSizePerspective:{}};t.externalColor=pe.Un,t.isInstanced=!0;const r=await e.createMaterial({type:"default",parameters:t}),n=er(this._primitive,r);this.lodRendererId=await e.createLodRenderer(n),this._loaded=!0}async createAddCommand(e){const t=this._context,{renderCommandContext:r,mainThreadDelegate:n}=t;if(null==this.lodRendererId)throw new Error("expected lod renderer id to not be null");const{featureCount:i}=e;if(0===i)return r.createRenderCommandBuffer();const s=(0,H.vt)((0,zt.Fq)(this._primitive)),a=(0,q.ci)((0,H.Ej)(s)),o=(0,q.ci)((0,zt.Bb)(a,{isPrimitive:!0,width:100,depth:null,height:null})),l=new Float64Array(16*i),c=new Float64Array(16*i),d=Mt(e),u=await n.applyElevationAlignmentTo(d);for(let e=0;e<i;++e){const t=e,r=u[3*e+0],n=u[3*e+1],i=u[3*e+2],s=this._computeGlobalTransform(r,n,i,this._context.viewSpatialReference,or),d=this._computeLocalTransform(o,a,ar);this._writeMatrixToTypedBuffer(l,t,d),this._writeMatrixToTypedBuffer(c,t,s)}const h=Rt(e),f=new Uint8Array(i);e.getVisibilityArray(f);const p={featureIds:new Uint32Array(h),visibility:f,localTransforms:l,globalTransforms:c};return r.addLodInstances(this.lodRendererId,e.id,p)}async createRemoveCommand(e){const{_context:t,lodRendererId:r}=this,n=t.renderCommandContext;return null==r?n.createRenderCommandBuffer():n.removeLodInstances(r,e)}async createUpdateVisibilityCommand(e){const{lodRendererId:t,_context:r}=this,n=r.renderCommandContext;if(null==t)return n.createRenderCommandBuffer();const i=new Uint8Array(e.featureCount);return e.getVisibilityArray(i),n.updateVisibility(t,e.id,i)}async createUpdateElevationCommand(e){const{_context:t,lodRendererId:r}=this,{renderCommandContext:n,mainThreadDelegate:i}=t,{featureCount:s,id:a}=e;if(null==r||0===s)return n.createRenderCommandBuffer();const o=new Float64Array(16*s),l=Mt(e),c=await i.applyElevationAlignmentTo(l);for(let e=0;e<s;++e){const t=e,r=c[3*e+0],n=c[3*e+1],i=c[3*e+2],s=this._computeGlobalTransform(r,n,i,this._context.viewSpatialReference,or);this._writeMatrixToTypedBuffer(o,t,s)}return n.updateLodInstancesData(r,a,o)}_writeMatrixToTypedBuffer(e,t,r){let n=16*t;for(let t=0;t<16;t++)e[n++]=r[t]}_computeGlobalTransform(e,t,r,n,i){return sr[0]=e,sr[1]=t,sr[2]=r,(0,Pt.l)(n,sr,i,this._context.renderSpatialReference),i}_computeLocalTransform(e,t,r){return(0,te.D_)(r),this._applyObjectScale(e,t,r),r}_applyObjectScale(e,t,r){const n=function(e=q.Un,t,r,n=1){const i=new Array(3);if(null==t||null==r)i[0]=1,i[1]=1,i[2]=1;else{let n,s=0;for(let a=2;a>=0;a--){const o=e[a],l=null!=o,c=0===a&&!n&&!l,d=r[a];let u;"symbol-value"===o||c?u=0!==d?t[a]/d:1:l&&"proportional"!==o&&isFinite(o)&&(u=0!==d?o/d:1),null!=u&&(i[a]=u,n=u,s=Math.max(s,Math.abs(u)))}for(let e=2;e>=0;e--)null==i[e]?i[e]=n:0===i[e]&&(i[e]=.001*s)}for(let e=2;e>=0;e--)i[e]/=n;return(0,q.ci)(i)}(e,e,t,this._context.renderCoordsHelper.unitInMeters);1===n[0]&&1===n[1]&&1===n[2]||(0,te.hs)(r,r,n)}}const sr=(0,q.vt)(),ar=(0,re.vt)(),or=(0,re.vt)();var lr=r(97768);new Map,(()=>{let e="";for(let t=32;t<127;t++)e+=String.fromCharCode(t)})();const cr=[];{const e=16;for(let t=0;t<360;t+=360/e)cr.push([Math.cos(Math.PI*t/180),Math.sin(Math.PI*t/180)])}var dr,ur;(ur=dr||(dr={}))[ur.Left=0]="Left",ur[ur.Center=1]="Center",ur[ur.Right=2]="Right",Object.freeze({left:0,center:.5,right:1});const hr=Object.freeze({"bottom-left":(0,he.fA)(0,0),bottom:(0,he.fA)(.5,0),"bottom-right":(0,he.fA)(1,0),left:(0,he.fA)(0,.5),center:(0,he.fA)(.5,.5),right:(0,he.fA)(1,.5),"top-left":(0,he.fA)(0,1),top:(0,he.fA)(.5,1),"top-right":(0,he.fA)(1,1)});var fr=r(40804);r(48833);const pr=(0,pe.CN)(.25,.25,.75,.75);function mr(e){return"cross"===e||"x"===e}function gr(e,t=128,r=.5*t,n=0){switch(e){case"circle":default:return function(e,t){const r=e/2-.5;return xr(e,br(r,r,t/2))}(t,r);case"square":return function(e,t){return yr(e,t,!1)}(t,r);case"cross":return function(e,t,r=0){return _r(e,t,!1,r)}(t,r,n);case"x":return function(e,t,r=0){return _r(e,t,!0,r)}(t,r,n);case"kite":return function(e,t){return yr(e,t,!0)}(t,r);case"triangle":return function(e,t){return xr(e,vr(e/2,t,t/2))}(t,r);case"arrow":return function(e,t){const r=t,n=t/2,i=e/2,s=.8*r,a=br(i,(e-t)/2-s,Math.sqrt(s*s+n*n)),o=vr(i,r,n);return xr(e,((e,t)=>Math.max(o(e,t),-a(e,t))))}(t,r)}}function yr(e,t,r){return r&&(t/=Math.SQRT2),xr(e,((n,i)=>{let s=n-.5*e+.25,a=.5*e-i-.75;if(r){const e=(s+a)/Math.SQRT2;a=(a-s)/Math.SQRT2,s=e}return Math.max(Math.abs(s),Math.abs(a))-.5*t}))}function _r(e,t,r,n=0){t-=n,r&&(t*=Math.SQRT2);const i=.5*t;return xr(e,((t,s)=>{let a,o=t-.5*e,l=.5*e-s-1;if(r){const e=(o+l)/Math.SQRT2;l=(l-o)/Math.SQRT2,o=e}return o=Math.abs(o),l=Math.abs(l),a=o>l?o>i?Math.sqrt((o-i)*(o-i)+l*l):l:l>i?Math.sqrt(o*o+(l-i)*(l-i)):o,a-=n/2,a}))}function br(e,t,r){return(n,i)=>{const s=n-e,a=i-t;return Math.sqrt(s*s+a*a)-r}}function vr(e,t,r){const n=Math.sqrt(t*t+r*r);return(i,s)=>{const a=Math.abs(i-e)-r,o=s-e+t/2+.75,l=(t*a+r*o)/n,c=-o;return Math.max(l,c)}}function xr(e,t){const r=new Uint8Array(4*e*e);for(let n=0;n<e;n++)for(let i=0;i<e;i++){const s=i+e*n;let a=t(i,n);a=a/e+.5,(0,fr.U)(a,r,4*s)}return r}class wr{constructor(e){this._context=e,this.materialId=null,this._loaded=!1,this._loadingPromise=null,this._iconTexture=null}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}destroy(){this._iconTexture=(0,lr.xt)(this._iconTexture)}async _load(){const e=this._context.renderCommandContext,t=await e.getOrCreateSharedTexture("circle-icon",(()=>function(e,t=128,r=.5*t,n=0){return{data:gr(e,t,r,n),parameters:{mipmap:!1,wrap:{s:De.pF.CLAMP_TO_EDGE,t:De.pF.CLAMP_TO_EDGE},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0}}}("circle")));this._iconTexture={remove:()=>e.releaseSharedTexture("circle-icon")};const r={anchorPosition:hr.center,occlusionTest:!0,hasSlicePlane:!1,color:[1,0,0,1],outlineColor:[0,0,0,1],outlineSize:1,distanceFieldBoundingBox:pr,textureId:t,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:mr("circle")};this.materialId=await e.createMaterial({type:"hud",parameters:r}),await e.createDirectRenderer(this.materialId),this._loaded=!0}async createAddCommand(e){const{materialId:t,_context:r}=this,{renderCommandContext:n}=r;if(null==t)throw new Error("expected material not to be null");const i=await this._createGeometry(e);if(null==i)return n.createRenderCommandBuffer();const s=Et(e,r);return n.addDirectRendererGeometry(e.id,i,s)}async _createGeometry(e){const{materialId:t,_context:r}=this,{mainThreadDelegate:n}=r,{featureCount:i}=e;if(0===i||null==t)return null;const s=Rt(e),a=Mt(e),o=function(e,t){const r=e.length/3,n=t.viewSpatialReference,i=t.renderSpatialReference,s=new Float64Array(3*r);if(!(0,Tt.projectBuffer)(e,n,0,s,i,0,r))throw new Error("Failed to project coordinates");return s}(await n.applyElevationAlignmentTo(a),r),l=new Float64Array([0,0,1]),c=new Float64Array([255,255,255,255]),d=new Float64Array([24,24]),u=new Float64Array([0,0,0,1]),h=new Float64Array([0,0]),f=new Float64Array([0]),p=new Uint32Array(i);for(let e=0;e<i;++e)p[e]=e;const m=new Uint32Array(i);for(let e=0;e<i;++e)m[e]=0;const g=new Lt.n(o,p,3,!0),y=new Lt.n(l,m,3,!0),_=new Lt.n(h,m,2,!0),b=new Lt.n(c,m,4,!0),v=new Lt.n(f,m,1,!0),x=new Lt.n(d,m,2,!0),w=new Lt.n(u,m,4,!0),S=[[ae.r.POSITION,g],[ae.r.NORMAL,y],[ae.r.UV0,_],[ae.r.COLOR,b],[ae.r.ROTATION,v],[ae.r.SIZE,x],[ae.r.CENTEROFFSETANDDISTANCE,w]],A=new Uint8Array(i);return e.getVisibilityArray(A),{attributes:Dt(S),objectAndLayerIdColor:void 0,transformation:(0,re.vt)(),materialId:t,objectIds:s,visibilities:A}}async createRemoveCommand(e){const{materialId:t,_context:r}=this,n=r.renderCommandContext;return null==t?n.createRenderCommandBuffer():n.removeDirectRendererGeometryBuffer(t,e)}async createUpdateVisibilityCommand(e){const{materialId:t,_context:r}=this,n=r.renderCommandContext;if(null==t)return n.createRenderCommandBuffer();const i=new Uint8Array(e.featureCount);return e.getVisibilityArray(i),n.updateVisibility(t,e.id,i)}async createUpdateElevationCommand(e){const{materialId:t,_context:r}=this,{renderCommandContext:n}=r,{featureCount:i,id:s}=e;if(null==t||0===i)return n.createRenderCommandBuffer();const a=await this._createGeometry(e);if(null==a)return n.createRenderCommandBuffer();const o=Et(e,r);return n.updateDirectRendererGeometry(s,a,o)}}class Sr{constructor(e){this._symbols=new Array,this._featureDataPartitioning=new Map,this._context=e}async load(){this._symbols[0]=new wr(this._context),this._symbols[1]=new ir(this._context)}async createAddCommand(e){const t=this._partition(e),r=await Promise.all(t.map((async({index:e,features:t})=>{const r=await this._provisionSymbol(e);return await(r?.createAddCommand(t))}))),n=this._context.renderCommandContext;return new It(n,n.mergeRenderCommandBuffers(r),[()=>{this._featureDataPartitioning.set(e.id,t)}])}async createRemoveCommand(e){const{_featureDataPartitioning:t,_context:r}=this,n=r.renderCommandContext,i=t.get(e);if(null==i)return new It(n,n.createRenderCommandBuffer(),[]);const s=await Promise.all(i.map((async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createRemoveCommand(t.id))})));return new It(n,n.mergeRenderCommandBuffers(s),[()=>{t.delete(e)}])}async createUpdateVisibilityCommand(e){const{_featureDataPartitioning:t,_context:r}=this,n=r.renderCommandContext,i=t.get(e.id);if(null==i)return new It(n,n.createRenderCommandBuffer(),[]);const s=await Promise.all(i.map((async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateVisibilityCommand(t))})));return new It(n,n.mergeRenderCommandBuffers(s),[])}async createUpdateElevationCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=t.renderCommandContext,n=[];for(const t of e.values()){const e=t.map((async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateElevationCommand(t))}));n.push(...e)}const i=await Promise.all(n);return new It(r,r.mergeRenderCommandBuffers(i),[])}async _provisionSymbol(e){if(null==e)return null;const t=this._symbols[e];return t?(t.loaded||await t.load(),t):null}_getLoadedSymbol(e){if(null==e)return null;const t=this._symbols[e];return null!=t&&t.loaded?t:null}_partition(e){const t=Rt(e);if(null==t)throw new Error("unable to fetch objectIds");const{featureCount:r}=e,n=[[],[]];for(let e=0;e<r;++e)n[t[e]%2].push(e);return n.map(((t,r)=>new Ar(r,e.subset(new Uint32Array(t))))).filter((e=>e.features.featureCount>0))}}class Ar{constructor(e,t){this.index=e,this.features=t}}var Cr=r(73941),Ir=r(98764),Tr=r(65806);const Or=(0,q.vt)();var Rr=r(88582),Mr=r(17352),Er=r(97937);function Pr(e,t,r=function(e){return{operations:e,value:e.create()}}(e)){return r.operations=e,e.copy(t,r.value),r}const zr=2**50;function Fr(e,t,r,n){return e.operations.setAltitudeAt(e.value,t,r,n)}function Dr(e,t,r){return e.operations.elevate(e.value,t,r.value)}const Br=(0,q.vt)();(0,q.vt)();var jr=r(44280),Vr=r(32114);function kr(e){return"point"===e.type}class Ur{constructor(e,t,r,n){this.viewingMode=e,this.spatialReference=t,this.unitInMeters=r,this._coordinateSystem=n,this._tmpCoordinateSystem=function(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}(n),this.referenceEllipsoid=(0,Cr.tO)(t),this.sphericalPCPF=(0,Ir.lO)(t)}set extent(e){e&&function(e,t,r){e.operations.setExtent(e.value,t,r.value)}(this._coordinateSystem,e,this._coordinateSystem)}get extent(){return function(e,t){return e.operations.getExtent(e.value,t),t}(this._coordinateSystem,(0,b.vt)())}getAltitude(e){return function(e,t){return e.operations.altitudeAt(e.value,t)}(this._coordinateSystem,e)}setAltitude(e,t,r=e){return Fr(this._coordinateSystem,r,t,e)}setAltitudeOfTransformation(e,t){!function(e,t,r,n){t!==n&&(0,te.C)(n,t),(0,fe.i)(Br,n[12],n[13],n[14]),Fr(e,Br,r,Br),n[12]=Br[0],n[13]=Br[1],n[14]=Br[2]}(this._coordinateSystem,t,e,t)}worldUpAtPosition(e,t){return function(e,t,r){return e.operations.axisAt(e.value,t,Rr._.Z,r)}(this._coordinateSystem,e,t)}worldBasisAtPosition(e,t,r){return function(e,t,r,n){return e.operations.axisAt(e.value,t,r,n)}(this._coordinateSystem,e,t,r)}basisMatrixAtPosition(e,t){const r=this.worldBasisAtPosition(e,Rr._.X,Vr.rq.get()),n=this.worldBasisAtPosition(e,Rr._.Y,Vr.rq.get()),i=this.worldBasisAtPosition(e,Rr._.Z,Vr.rq.get());return(0,te.hZ)(t,r[0],r[1],r[2],0,n[0],n[1],n[2],0,i[0],i[1],i[2],0,0,0,0,1),t}headingAtPosition(e,t){const r=this.worldUpAtPosition(e,Vr.rq.get()),n=this.worldBasisAtPosition(e,Rr._.Y,Vr.rq.get()),i=(0,jr.EJ)(t,n,r);return(0,le.KJ)(i)}intersectManifoldClosestSilhouette(e,t,r){return Dr(this._coordinateSystem,t,this._tmpCoordinateSystem),function(e,t,r){e.operations.intersectRayClosestSilhouette(e.value,t,r)}(this._tmpCoordinateSystem,e,r),r}intersectManifold(e,t,r){Dr(this._coordinateSystem,t,this._tmpCoordinateSystem);const n=Vr.rq.get();return function(e,t,r){return e.operations.intersectRay(e.value,t,r)}(this._tmpCoordinateSystem,e,n)?(0,fe.c)(r,n):null}intersectInfiniteManifold(e,t,r){if(this.viewingMode===ie.RT.Global)return this.intersectManifold(e,t,r);Dr(this._coordinateSystem,t,this._tmpCoordinateSystem);const n=this._tmpCoordinateSystem.value,i=Vr.rq.get();return(0,Nt.Ui)(n.plane,e,i)?(0,fe.c)(r,i):null}toRenderCoords(e,t,r){return kr(e)?(0,Tr.g)(e,t,this.spatialReference):(0,Ot.F)(e,t,r,this.spatialReference)}fromRenderCoords(e,t,r=null){return kr(t)?(null!=r&&(t.spatialReference=r),function(e,t,r){return!!(0,Ot.F)(e,t,Or,r.spatialReference)&&(r.x=Or[0],r.y=Or[1],r.z=Or[2],!0)}(e,this.spatialReference,t)?t:null):(0,Ot.F)(e,this.spatialReference,t,r)?t:null}static create(e,t){switch(e){case ie.RT.Local:return new Ur(ie.RT.Local,t,(0,Ft.GA)(t),Pr(Mr.b,(0,Mr.f)([0,0,0],[zr,0,0],[0,zr,0])));case ie.RT.Global:return new Ur(ie.RT.Global,t,1,function(e){return Pr(Er.s,(0,Er.f)(0,0,0,(0,Cr.tO)(e).radius))}(t))}}static renderUnitScaleFactor(e,t){return(0,Ft.KX)(e)/(0,Ft.KX)(t)}}let Nr=class extends i.A.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new B,this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,baseQuery:n,url:i,objectIdField:s,capabilities:o,fieldsIndex:l,timeInfo:c,elevationInfo:m,fullExtent:g}){const y=h.A.fromJSON(e),_=h.A.fromJSON(t);this._fetcher=new ee(y,p.A.fromJSON(n),i,s,o),this._queryEngine=new f.do({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",objectIdField:s,fieldsIndex:l,availableFields:[s],spatialReference:e,featureStore:this._featureStore,timeInfo:c});const b={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const n={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",n,{transferList:r})},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})}};this._renderer=new Sr({viewSpatialReference:y,renderSpatialReference:_,renderCoordsHelper:Ur.create(r,_),renderCommandContext:new wt(r,b),elevationInfo:m??{},mainThreadDelegate:b}),this._defaultQueryJSON=new p.A({outSpatialReference:y}).toJSON();let v=null;if(null!=g){const e=d.A.fromJSON(g);await(0,u.initializeProjection)(e.spatialReference,y),v=(0,u.project)(e,y)}return this._tileManager=new C({loadTile:(e,t)=>this._fetcher.fetch(e,t),createAddFeatureDataCommand:(e,t)=>this._createAddFeatureDataCommand(e,t),createRemoveFeatureDataCommand:e=>this._createRemoveFeatureDataCommand(e),createUpdateFeatureDataVisibilityCommand:(e,t)=>this._createUpdateFeatureDataVisibilityCommand(e,t),extent:v}),this.addHandles((0,a.wB)((()=>this.updating),(e=>{this.emit("notify-updating",{updating:e})})),a.Vh),await this._renderer.load(),qr}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async onTileTreeChange(e){return await this._tileManager.onTileTreeChange(e),qr}async onElevationChange(e){return qr}async _createAddFeatureDataCommand(e,t){const r=this._featureStore,n=await this._renderer.createAddCommand(e);return(0,s.Te)(t),n.appendPipelineStateCommand((()=>{r.addTile(e)})),n}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer,n=await r.createRemoveCommand(e);return n.appendPipelineStateCommand((()=>{t.removeTile(e)})),n}async _createUpdateFeatureDataVisibilityCommand(e,t){const r=this._renderer,n=await r.createUpdateVisibilityCommand(e);return(0,s.Te)(t),n}_ensureQuery(e){return e??this._defaultQueryJSON}};(0,n._)([(0,o.MZ)()],Nr.prototype,"updating",null),Nr=(0,n._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],Nr);const Lr=Nr,qr={result:void 0}},69418:(e,t,r)=>{r.d(t,{S:()=>c,z:()=>l});var n=r(83047),i=r(21325),s=r(43334),a=r(58512),o=r(92722);const l=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class c{constructor(e){this._options=e,this.geometryTypes=l,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new a.A}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e?.features||!e.hasZ||!this._options.sourceSpatialReference||!e.spatialReference||(0,i.aI)(e.spatialReference,this._options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=(0,n.G9)(this._options.sourceSpatialReference)/(0,n.G9)(e.spatialReference);if(1!==t)for(const r of e.features){if(!(0,s.N3)(r))continue;const e=r.geometry.coords;for(let r=2;r<e.length;r+=3)e[r]*=t}}addFeature(e,t){e.features.push(t)}createFeature(){return new s.Om(null,{},null,0)}createSpatialReference(){return{wkid:0}}createGeometry(){return new o.A}addField(e,t){e.fields.push(t)}allocateCoordinates(e){e.coords.length=e.lengths.reduce(((e,t)=>e+t),0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new o.A}}},72385:(e,t,r)=>{function n(){return new Float32Array(3)}function i(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function s(e,t,r){const n=new Float32Array(3);return n[0]=e,n[1]=t,n[2]=r,n}function a(){return n()}function o(){return s(1,1,1)}function l(){return s(1,0,0)}function c(){return s(0,1,0)}function d(){return s(0,0,1)}r.d(t,{fA:()=>s,o8:()=>i,vt:()=>n});const u=a(),h=o(),f=l(),p=c(),m=d();Object.freeze(Object.defineProperty({__proto__:null,ONES:h,UNIT_X:f,UNIT_Y:p,UNIT_Z:m,ZEROS:u,clone:i,create:n,fromValues:s,ones:o,unitX:l,unitY:c,unitZ:d,zeros:a},Symbol.toStringTag,{value:"Module"}))},75503:(e,t,r)=>{r.d(t,{E:()=>C,w:()=>o});var n=r(4576),i=r(21818),s=(r(44208),r(3694)),a=r(11006);class o{constructor(e=9,t){this._compareMinX=h,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(),w.prune(),S.prune(),A.prune()}all(e){l(this._data,e)}search(e,t){let r=this._data;const n=this._toBBox;if(b(e,r))for(x.clear();r;){for(let i=0,s=r.children.length;i<s;i++){const s=r.children[i],a=r.leaf?n(s):s;b(e,a)&&(r.leaf?t(s):_(e,a)?l(s,t):x.push(s))}r=x.pop()}}collides(e){let t=this._data;const r=this._toBBox;if(!b(e,t))return!1;for(x.clear();t;){for(let n=0,i=t.children.length;n<i;n++){const i=t.children[n],s=t.leaf?r(i):i;if(b(e,s)){if(t.leaf||_(e,s))return!0;x.push(i)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,r=e.length;t<r;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 T([]),this}remove(e){if(!e)return this;let t,r=this._data,s=null,a=0,o=!1;const l=this._toBBox(e);for(S.clear(),A.clear();r||S.length>0;){if(r||(r=S.pop(),s=S.data[S.length-1],a=A.pop()??0,o=!0),r.leaf&&(t=(0,n.qh)(r.children,(0,i.zI)(e),r.children.length,r.indexHint),-1!==t))return r.children.splice(t,1),S.push(r),this._condense(S),this;o||r.leaf||!_(r,l)?s?(a++,r=s.children[a],o=!1):r=null:(S.push(r),A.push(a),a=0,s=r,r=r.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,r,n){const i=r-t+1;let s=this._maxEntries;if(i<=s){const n=new T(e.slice(t,r+1));return c(n,this._toBBox),n}n||(n=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/s**(n-1)));const a=new O([]);a.height=n;const o=Math.ceil(i/s),l=o*Math.ceil(Math.sqrt(s));v(e,t,r,l,this._compareMinX);for(let i=t;i<=r;i+=l){const t=Math.min(i+l-1,r);v(e,i,t,o,this._compareMinY);for(let r=i;r<=t;r+=o){const i=Math.min(r+o-1,t);a.children.push(this._build(e,r,i,n-1))}}return c(a,this._toBBox),a}_insert(e,t,r){const n=this._toBBox,i=r?e:n(e);S.clear();const s=function(e,t,r,n){for(;n.push(t),!0!==t.leaf&&n.length-1!==r;){let r,n=1/0,i=1/0;for(let s=0,a=t.children.length;s<a;s++){const a=t.children[s],o=p(a),l=g(e,a)-o;l<i?(i=l,n=o<n?o:n,r=a):l===i&&o<n&&(n=o,r=a)}t=r||t.children[0]}return t}(i,this._data,t,S);for(s.children.push(e),u(s,i);t>=0&&S.data[t].children.length>this._maxEntries;)this._split(S,t),t--;!function(e,t,r){for(let n=r;n>=0;n--)u(t.data[n],e)}(i,S,t)}_split(e,t){const r=e.data[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);const s=this._chooseSplitIndex(r,i,n);if(!s)return;const a=r.children.splice(s,r.children.length-s),o=r.leaf?new T(a):new O(a);o.height=r.height,c(r,this._toBBox),c(o,this._toBBox),t?e.data[t-1].children.push(o):this._splitRoot(r,o)}_splitRoot(e,t){this._data=new O([e,t]),this._data.height=e.height+1,c(this._data,this._toBBox)}_chooseSplitIndex(e,t,r){let n,i,s;n=i=1/0;for(let a=t;a<=r-t;a++){const t=d(e,0,a,this._toBBox),o=d(e,a,r,this._toBBox),l=y(t,o),c=p(t)+p(o);l<n?(n=l,s=a,i=c<i?c:i):l===n&&c<i&&(i=c,s=a)}return s}_chooseSplitAxis(e,t,r){const n=e.leaf?this._compareMinX:h,i=e.leaf?this._compareMinY:f;this._allDistMargin(e,t,r,n)<this._allDistMargin(e,t,r,i)&&e.children.sort(n)}_allDistMargin(e,t,r,n){e.children.sort(n);const i=this._toBBox,s=d(e,0,t,i),a=d(e,r-t,r,i);let o=m(s)+m(a);for(let n=t;n<r-t;n++){const t=e.children[n];u(s,e.leaf?i(t):t),o+=m(s)}for(let n=r-t-1;n>=t;n--){const t=e.children[n];u(a,e.leaf?i(t):t),o+=m(a)}return o}_condense(e){for(let t=e.length-1;t>=0;t--){const r=e.data[t];if(0===r.children.length)if(t>0){const i=e.data[t-1],s=i.children;s.splice((0,n.qh)(s,r,s.length,i.indexHint),1)}else this.clear();else c(r,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 r=e;for(w.clear();r;){if(!0===r.leaf)for(const e of r.children)t((0,i.zI)(e));else w.pushArray(r.children);r=w.pop()??null}}function c(e,t){d(e,0,e.children.length,t,e)}function d(e,t,r,n,i){i||(i=new T([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let s,a=t;a<r;a++)s=e.children[a],u(i,e.leaf?n(s):s);return i}function u(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 h(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 m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function g(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 y(e,t){const r=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,i-r)*Math.max(0,s-n)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function b(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e,t,r,n,i){const s=[t,r];for(;s.length;){const t=s.pop(),r=s.pop();if(t-r<=n)continue;const o=r+Math.ceil((t-r)/n/2)*n;(0,a.q)(e,o,r,t,i),s.push(r,o,o,t)}}const x=new s.A,w=new s.A,S=new s.A,A=new s.A({deallocator:void 0});class C{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class I extends C{constructor(){super(...arguments),this.height=1,this.indexHint=new n.vW}}class T extends I{constructor(e){super(),this.children=e,this.leaf=!0}}class O extends I{constructor(e){super(),this.children=e,this.leaf=!1}}},76357:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(90237),i=r(66552),s=r(25482),a=r(10107),o=(r(44208),r(53966),r(87811),r(93223)),l=r(40608);const c=new i.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let d=class extends s.A{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,a.MZ)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,n._)([(0,o.e)(c),(0,a.MZ)({json:{write:{isRequired:!0}}})],d.prototype,"type",void 0),d=(0,n._)([(0,l.$)("esri.layers.support.Domain")],d);const u=d},79677:(e,t,r)=>{r.d(t,{A:()=>f});var n,i=r(90237),s=r(25482),a=r(88930),o=r(10107),l=(r(44208),r(53966),r(87811),r(36005)),c=r(40608),d=r(43937),u=r(98623);let h=class extends s.A{static{n=this}static get allTime(){return p}static get empty(){return m}static fromArray(e){return new n({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(n.allTime)}get isEmpty(){return this.equals(n.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new n({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,n=e.start?.getTime()??e.start,i=e.end?.getTime()??e.end;return t===n&&r===i}expandTo(e,t=u.qU){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,a.lL)(r,e,t));let i=this.end;if(i){const r=(0,a.lL)(i,e,t);i=i.getTime()===r.getTime()?r:(0,a.S1)(r,1,e,t)}return new n({start:r,end:i})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return n.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,i=e.start?.getTime()??-1/0,s=e.end?.getTime()??1/0;let a,o;return i>=t&&i<=r?a=i:t>=i&&t<=s&&(a=t),r>=i&&r<=s?o=r:s>=t&&s<=r&&(o=s),null==a||null==o||isNaN(a)||isNaN(o)?n.empty:new n({start:a===-1/0?null:new Date(a),end:o===1/0?null:new Date(o)})}offset(e,t,r=u.qU){if(this.isEmpty||this.isAllTime)return this.clone();const i=new n,{start:s,end:o}=this;return null!=s&&(i.start=(0,a.S1)(s,e,t,r)),null!=o&&(i.end=(0,a.S1)(o,e,t,r)),i}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 p.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new n({start:t,end:r})}};(0,i._)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"end",void 0),(0,i._)([(0,l.w)("end")],h.prototype,"readEnd",null),(0,i._)([(0,d.K)("end")],h.prototype,"writeEnd",null),(0,i._)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],h.prototype,"isAllTime",null),(0,i._)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],h.prototype,"isEmpty",null),(0,i._)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"start",void 0),(0,i._)([(0,l.w)("start")],h.prototype,"readStart",null),(0,i._)([(0,d.K)("start")],h.prototype,"writeStart",null),h=n=(0,i._)([(0,c.$)("esri.time.TimeExtent")],h);const f=h,p=new h,m=new h({start:void 0,end:void 0})},80451:(e,t,r)=>{r.d(t,{rS:()=>g,gK:()=>m}),r(44208);var n,i=r(53177),s=r(76357),a=r(90237),o=(r(53966),r(87811),r(49186),r(93223)),l=r(40608);let c=class extends s.A{static{n=this}constructor(e){super(e),this.type="inherited"}clone(){return new n}};(0,a._)([(0,o.e)({inherited:"inherited"})],c.prototype,"type",void 0),c=n=(0,a._)([(0,l.$)("esri.layers.support.InheritedDomain")],c);const d=c;var u,h=r(10107);let f=class extends s.A{static{u=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new u({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,a._)([(0,h.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,r){t[r]=[this.minValue||0,e]},isRequired:!0}}})],f.prototype,"maxValue",void 0),(0,a._)([(0,h.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,r){t[r]=[e,this.maxValue||0]},isRequired:!0}}})],f.prototype,"minValue",void 0),(0,a._)([(0,o.e)({range:"range"})],f.prototype,"type",void 0),f=u=(0,a._)([(0,l.$)("esri.layers.support.RangeDomain")],f);const p=f,m={key:"type",base:s.A,typeMap:{range:p,"coded-value":i.A,inherited:d}};function g(e){if(!e?.type)return null;switch(e.type){case"range":return p.fromJSON(e);case"codedValue":return i.A.fromJSON(e);case"inherited":return d.fromJSON(e)}return null}},80893:(e,t,r)=>{r.d(t,{IJ:()=>p,Jf:()=>_,Pk:()=>g,eW:()=>f,gW:()=>y,kS:()=>m});var n=r(78888),i=r(84952),s=r(65864),a=r(17136),o=r(21325),l=r(10536),c=r(66208),d=r(58501);const u="Layer does not support extent calculation.";function h(e,t){const r=e.geometry,n=e.toJSON();delete n.compactGeometryEnabled,delete n.defaultSpatialReferenceEnabled;const i=n;let a,l,c;if(null!=r&&(l=r.spatialReference,c=(0,o.YX)(l),i.geometryType=(0,s.$B)(r),i.geometry=function(e,t){if(t&&"extent"===e.type)return`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`;if(t&&"point"===e.type)return`${e.x},${e.y}`;const r=e.toJSON();return delete r.spatialReference,JSON.stringify(r)}(r,e.compactGeometryEnabled),i.inSR=c),n.groupByFieldsForStatistics&&(i.groupByFieldsForStatistics=n.groupByFieldsForStatistics.join(",")),n.objectIds&&(i.objectIds=n.objectIds.join(",")),n.orderByFields&&(i.orderByFields=n.orderByFields.join(",")),!n.outFields||!n.returnDistinctValues&&(t?.returnCountOnly||t?.returnExtentOnly||t?.returnIdsOnly)?delete i.outFields:n.outFields.includes("*")?i.outFields="*":i.outFields=n.outFields.join(","),n.outSR?(i.outSR=(0,o.YX)(n.outSR),a=e.outSpatialReference):r&&(n.returnGeometry||n.returnCentroid)&&(i.outSR=i.inSR,a=l),n.returnGeometry&&delete n.returnGeometry,n.outStatistics&&(i.outStatistics=JSON.stringify(n.outStatistics)),n.fullText&&(i.fullText=JSON.stringify(n.fullText)),n.pixelSize&&(i.pixelSize=JSON.stringify(n.pixelSize)),n.quantizationParameters&&(e.defaultSpatialReferenceEnabled&&null!=l&&null!=e.quantizationParameters?.extent&&l.equals(e.quantizationParameters.extent.spatialReference)&&delete n.quantizationParameters.extent.spatialReference,i.quantizationParameters=JSON.stringify(n.quantizationParameters)),n.parameterValues&&(i.parameterValues=JSON.stringify(n.parameterValues)),n.rangeValues&&(i.rangeValues=JSON.stringify(n.rangeValues)),n.dynamicDataSource&&(i.layer=JSON.stringify({source:n.dynamicDataSource}),delete n.dynamicDataSource),n.timeExtent){const e=n.timeExtent,{start:t,end:r}=e;null==t&&null==r||(i.time=t===r?t:`${t??"null"},${r??"null"}`),delete n.timeExtent}return e.defaultSpatialReferenceEnabled&&null!=l&&null!=a&&l.equals(a)&&(i.defaultSR=i.inSR,delete i.inSR,delete i.outSR),i}async function f(e,t,r,n){const i=null!=t.timeExtent&&t.timeExtent.isEmpty?{data:{features:[]}}:await b(e,t,"json",n);return(0,d.q)(t,r,i.data),i}async function p(e,t,r,n){if(null!=t.timeExtent&&t.timeExtent.isEmpty)return{data:r.createFeatureResult()};const i=await m(e,t,n),s=i;return s.data=(0,c.m)(i.data,r),s}function m(e,t,r){return b(e,t,"pbf",r)}function g(e,t,r){return null!=t.timeExtent&&t.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):b(e,t,"json",r,{returnIdsOnly:!0})}function y(e,t,r){return null!=t.timeExtent&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):b(e,t,"json",r,{returnIdsOnly:!0,returnCountOnly:!0})}async function _(e,t,r){if(null!=t.timeExtent&&t.timeExtent.isEmpty)return{data:{count:0,extent:null}};const n=await b(e,t,"json",r,{returnExtentOnly:!0,returnCountOnly:!0}),i=n.data;if(i.hasOwnProperty("extent"))return n;if(i.features)throw new Error(u);if(i.hasOwnProperty("count"))throw new Error(u);return n}async function b(e,t,r,s={},o={}){const c="string"==typeof e?(0,i.An)(e):e,d=t.geometry?[t.geometry]:[],u=await(0,a.el)(d,null,{signal:s.signal}),f=u?.[0];null!=f&&((t=t.clone()).geometry=f);const p=(0,l.z)({...c.query,f:r,...o,...h(t,o)});return(0,n.A)((0,i.fj)(c.path,(m=o,null==t.formatOf3DObjects||m.returnCountOnly||m.returnExtentOnly||m.returnIdsOnly?"query":"query3d")),{...s,responseType:"pbf"===r?"array-buffer":"json",query:{...p,...s.query}});var m}},95696:(e,t,r)=>{r.d(t,{A:()=>u});var n,i=r(90237),s=r(69540),a=r(25482),o=r(10107),l=(r(44208),r(53966),r(87811),r(93223)),c=r(40608);let d=class extends(s.A.ClonableMixin(a.A)){static{n=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new n}};(0,i._)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],d.prototype,"type",void 0),(0,i._)([(0,o.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],d.prototype,"origin",void 0),d=n=(0,i._)([(0,c.$)("esri.geometry.support.MeshGeoreferencedVertexSpace")],d);const u=d}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7061],{37061:(t,n,r)=>{r.r(n),r.d(n,{Float16Array:()=>In,f16round:()=>Dn,getFloat16:()=>Cn,hfround:()=>Dn,isFloat16Array:()=>Pn,isTypedArray:()=>Un,setFloat16:()=>Mn});const e="This constructor is not a subclass of Float16Array",o="The constructor property value is not an object",i="Attempting to access detached ArrayBuffer",s="Cannot convert undefined or null to object",u="Cannot mix BigInt and other types, use explicit conversions",c="@@iterator property is not callable",f="Reduce of empty array with no initial value",h="Offset is out of bounds";function l(t){return(n,...r)=>w(t,n,r)}function a(t,n){return l(g(t,n).get)}const{apply:w,construct:y,defineProperty:p,get:d,getOwnPropertyDescriptor:g,getPrototypeOf:v,has:b,ownKeys:A,set:_,setPrototypeOf:E}=Reflect,m=Proxy,{EPSILON:x,MAX_SAFE_INTEGER:T,isFinite:O,isNaN:S}=Number,{iterator:P,species:j,toStringTag:F,for:k}=Symbol,R=Object,{create:B,defineProperty:L,freeze:I,is:N}=R,U=R.prototype,C=U.__lookupGetter__?l(U.__lookupGetter__):(t,n)=>{if(null==t)throw Bt(s);let r=R(t);do{const t=g(r,n);if(void 0!==t)return M(t,"get")?t.get:void 0}while(null!==(r=v(r)))},M=R.hasOwn||l(U.hasOwnProperty),D=Array,W=D.isArray,G=D.prototype,V=l(G.join),Y=l(G.push),z=l(G.toLocaleString),K=G[P],X=l(K),{abs:q,trunc:H}=Math,J=ArrayBuffer,Q=J.isView,Z=J.prototype,$=l(Z.slice),tt=a(Z,"byteLength"),nt="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:null,rt=nt&&a(nt.prototype,"byteLength"),et=v(Uint8Array),ot=et.from,it=et.prototype,st=it[P],ut=l(it.keys),ct=l(it.values),ft=l(it.entries),ht=l(it.set),lt=l(it.reverse),at=l(it.fill),wt=l(it.copyWithin),yt=l(it.sort),pt=l(it.slice),dt=l(it.subarray),gt=a(it,"buffer"),vt=a(it,"byteOffset"),bt=a(it,"length"),At=a(it,F),_t=Uint8Array,Et=Uint16Array,mt=(...t)=>w(ot,Et,t),xt=Uint32Array,Tt=Float32Array,Ot=v([][P]()),St=l(Ot.next),Pt=l(function*(){}().next),jt=v(Ot),Ft=DataView.prototype,kt=l(Ft.getUint16),Rt=l(Ft.setUint16),Bt=TypeError,Lt=RangeError,It=WeakSet,Nt=It.prototype,Ut=l(Nt.add),Ct=l(Nt.has),Mt=WeakMap,Dt=Mt.prototype,Wt=l(Dt.get),Gt=l(Dt.has),Vt=l(Dt.set),Yt=new Mt,zt=B(null,{next:{value:function(){const t=Wt(Yt,this);return St(t)}},[P]:{value:function(){return this}}});function Kt(t){if(t[P]===K&&Ot.next===St)return t;const n=B(zt);return Vt(Yt,n,X(t)),n}const Xt=new Mt,qt=B(jt,{next:{value:function(){const t=Wt(Xt,this);return Pt(t)},writable:!0,configurable:!0}});for(const t of A(Ot))"next"!==t&&L(qt,t,g(Ot,t));function Ht(t){const n=B(qt);return Vt(Xt,n,t),n}function Jt(t){return null!==t&&"object"==typeof t||"function"==typeof t}function Qt(t){return null!==t&&"object"==typeof t}function Zt(t){return void 0!==At(t)}function $t(t){const n=At(t);return"BigInt64Array"===n||"BigUint64Array"===n}function tn(t){if(null===nt)return!1;try{return rt(t),!0}catch(t){return!1}}function nn(t){return!!W(t)&&t[P]===K&&Ot.next===St}function rn(t){if("string"!=typeof t)return!1;const n=+t;return t===n+""&&!!O(n)&&n===H(n)}const en=k("__Float16Array__"),on=1/x,sn=6103515625e-14,un=65504,cn=.0009765625,fn=cn*sn,hn=cn*on;function ln(t){const n=+t;if(!O(n)||0===n)return n;const r=n>0?1:-1,e=q(n);if(e<sn)return r*function(t){return t+on-on}(e/fn)*fn;const o=(1+hn)*e,i=o-(o-e);return i>un||S(i)?r*(1/0):r*i}const an=new J(4),wn=new Tt(an),yn=new xt(an),pn=new Et(512),dn=new _t(512);for(let t=0;t<256;++t){const n=t-127;n<-24?(pn[t]=0,pn[256|t]=32768,dn[t]=24,dn[256|t]=24):n<-14?(pn[t]=1024>>-n-14,pn[256|t]=1024>>-n-14|32768,dn[t]=-n-1,dn[256|t]=-n-1):n<=15?(pn[t]=n+15<<10,pn[256|t]=n+15<<10|32768,dn[t]=13,dn[256|t]=13):n<128?(pn[t]=31744,pn[256|t]=64512,dn[t]=24,dn[256|t]=24):(pn[t]=31744,pn[256|t]=64512,dn[t]=13,dn[256|t]=13)}function gn(t){wn[0]=ln(t);const n=yn[0],r=n>>23&511;return pn[r]+((8388607&n)>>dn[r])}const vn=new xt(2048);for(let t=1;t<1024;++t){let n=t<<13,r=0;for(;!(8388608&n);)n<<=1,r-=8388608;n&=-8388609,r+=947912704,vn[t]=n|r}for(let t=1024;t<2048;++t)vn[t]=939524096+(t-1024<<13);const bn=new xt(64);for(let t=1;t<31;++t)bn[t]=t<<23;bn[31]=1199570944,bn[32]=2147483648;for(let t=33;t<63;++t)bn[t]=2147483648+(t-32<<23);bn[63]=3347054592;const An=new Et(64);for(let t=1;t<64;++t)32!==t&&(An[t]=1024);function _n(t){const n=t>>10;return yn[0]=vn[An[n]+(1023&t)]+bn[n],wn[0]}function En(t){const n=+t;return S(n)||0===n?0:H(n)}function mn(t){const n=En(t);return n<0?0:n<T?n:T}function xn(t,n){if(!Jt(t))throw Bt("This is not an object");const r=t.constructor;if(void 0===r)return n;if(!Jt(r))throw Bt(o);const e=r[j];return null==e?n:e}function Tn(t){if(tn(t))return!1;try{return $(t,0,0),!1}catch(t){}return!0}function On(t,n){const r=S(t),e=S(n);if(r&&e)return 0;if(r)return 1;if(e)return-1;if(t<n)return-1;if(t>n)return 1;if(0===t&&0===n){const r=N(t,0),e=N(n,0);if(!r&&e)return-1;if(r&&!e)return 1}return 0}const Sn=new Mt;function Pn(t){return Gt(Sn,t)||!Q(t)&&function(t){if(!Qt(t))return!1;const n=v(t);if(!Qt(n))return!1;const r=n.constructor;if(void 0===r)return!1;if(!Jt(r))throw Bt(o);return b(r,en)}(t)}function jn(t){if(!Pn(t))throw Bt("This is not a Float16Array object")}function Fn(t,n){const r=Pn(t),e=Zt(t);if(!r&&!e)throw Bt("Species constructor didn't return TypedArray object");if("number"==typeof n){let e;if(r){const n=kn(t);e=bt(n)}else e=bt(t);if(e<n)throw Bt("Derived constructor created TypedArray object which was too small length")}if($t(t))throw Bt(u)}function kn(t){const n=Wt(Sn,t);if(void 0!==n){if(Tn(gt(n)))throw Bt(i);return n}const r=t.buffer;if(Tn(r))throw Bt(i);const e=y(In,[r,t.byteOffset,t.length],t.constructor);return Wt(Sn,e)}function Rn(t){const n=bt(t),r=[];for(let e=0;e<n;++e)r[e]=_n(t[e]);return r}const Bn=new It;for(const t of A(it)){if(t===F)continue;const n=g(it,t);M(n,"get")&&"function"==typeof n.get&&Ut(Bn,n.get)}const Ln=I({get:(t,n,r)=>rn(n)&&M(t,n)?_n(d(t,n)):Ct(Bn,C(t,n))?d(t,n):d(t,n,r),set:(t,n,r,e)=>rn(n)&&M(t,n)?_(t,n,gn(r)):_(t,n,r,e),getOwnPropertyDescriptor(t,n){if(rn(n)&&M(t,n)){const r=g(t,n);return r.value=_n(r.value),r}return g(t,n)},defineProperty:(t,n,r)=>rn(n)&&M(t,n)&&M(r,"value")?(r.value=gn(r.value),p(t,n,r)):p(t,n,r)});class In{constructor(t,n,r){let e;if(Pn(t))e=y(Et,[kn(t)],new.target);else if(!Jt(t)||(function(t){try{return!W(t)&&(tt(t),!0)}catch(t){return!1}}(o=t)||tn(o)))e=y(Et,arguments,new.target);else{let n,r;if(Zt(t)){if(n=t,r=bt(t),Tn(gt(t)))throw Bt(i);if($t(t))throw Bt(u);const o=new J(2*r);e=y(Et,[o],new.target)}else{const o=t[P];if(null!=o&&"function"!=typeof o)throw Bt(c);null!=o?nn(t)?(n=t,r=t.length):(n=[...t],r=n.length):(n=t,r=mn(n.length)),e=y(Et,[r],new.target)}for(let t=0;t<r;++t)e[t]=gn(n[t])}var o;const s=new m(e,Ln);return Vt(Sn,s,e),s}static from(t,...n){const r=this;if(!b(r,en))throw Bt(e);if(r===In){if(Pn(t)&&0===n.length){const n=kn(t),r=new Et(gt(n),vt(n),bt(n));return new In(gt(pt(r)))}if(0===n.length)return new In(gt(mt(t,gn)));const r=n[0],e=n[1];return new In(gt(mt(t,(function(t,...n){return gn(w(r,this,[t,...Kt(n)]))}),e)))}let o,i;const u=t[P];if(null!=u&&"function"!=typeof u)throw Bt(c);if(null!=u)nn(t)?(o=t,i=t.length):Zt(f=t)&&f[P]===st&&Ot.next===St?(o=t,i=bt(t)):(o=[...t],i=o.length);else{if(null==t)throw Bt(s);o=R(t),i=mn(o.length)}var f;const h=new r(i);if(0===n.length)for(let t=0;t<i;++t)h[t]=o[t];else{const t=n[0],r=n[1];for(let n=0;n<i;++n)h[n]=w(t,r,[o[n],n])}return h}static of(...t){const n=this;if(!b(n,en))throw Bt(e);const r=t.length;if(n===In){const n=new In(r),e=kn(n);for(let n=0;n<r;++n)e[n]=gn(t[n]);return n}const o=new n(r);for(let n=0;n<r;++n)o[n]=t[n];return o}keys(){jn(this);const t=kn(this);return ut(t)}values(){jn(this);const t=kn(this);return Ht(function*(){for(const n of ct(t))yield _n(n)}())}entries(){jn(this);const t=kn(this);return Ht(function*(){for(const[n,r]of ft(t))yield[n,_n(r)]}())}at(t){jn(this);const n=kn(this),r=bt(n),e=En(t),o=e>=0?e:r+e;if(!(o<0||o>=r))return _n(n[o])}with(t,n){jn(this);const r=kn(this),e=bt(r),o=En(t),i=o>=0?o:e+o,s=+n;if(i<0||i>=e)throw Lt(h);const u=new Et(gt(r),vt(r),bt(r)),c=new In(gt(pt(u)));return kn(c)[i]=gn(s),c}map(t,...n){jn(this);const r=kn(this),e=bt(r),o=n[0],i=xn(r,In);if(i===In){const n=new In(e),i=kn(n);for(let n=0;n<e;++n){const e=_n(r[n]);i[n]=gn(w(t,o,[e,n,this]))}return n}const s=new i(e);Fn(s,e);for(let n=0;n<e;++n){const e=_n(r[n]);s[n]=w(t,o,[e,n,this])}return s}filter(t,...n){jn(this);const r=kn(this),e=bt(r),o=n[0],i=[];for(let n=0;n<e;++n){const e=_n(r[n]);w(t,o,[e,n,this])&&Y(i,e)}const s=new(xn(r,In))(i);return Fn(s),s}reduce(t,...n){jn(this);const r=kn(this),e=bt(r);if(0===e&&0===n.length)throw Bt(f);let o,i;0===n.length?(o=_n(r[0]),i=1):(o=n[0],i=0);for(let n=i;n<e;++n)o=t(o,_n(r[n]),n,this);return o}reduceRight(t,...n){jn(this);const r=kn(this),e=bt(r);if(0===e&&0===n.length)throw Bt(f);let o,i;0===n.length?(o=_n(r[e-1]),i=e-2):(o=n[0],i=e-1);for(let n=i;n>=0;--n)o=t(o,_n(r[n]),n,this);return o}forEach(t,...n){jn(this);const r=kn(this),e=bt(r),o=n[0];for(let n=0;n<e;++n)w(t,o,[_n(r[n]),n,this])}find(t,...n){jn(this);const r=kn(this),e=bt(r),o=n[0];for(let n=0;n<e;++n){const e=_n(r[n]);if(w(t,o,[e,n,this]))return e}}findIndex(t,...n){jn(this);const r=kn(this),e=bt(r),o=n[0];for(let n=0;n<e;++n){const e=_n(r[n]);if(w(t,o,[e,n,this]))return n}return-1}findLast(t,...n){jn(this);const r=kn(this),e=bt(r),o=n[0];for(let n=e-1;n>=0;--n){const e=_n(r[n]);if(w(t,o,[e,n,this]))return e}}findLastIndex(t,...n){jn(this);const r=kn(this),e=bt(r),o=n[0];for(let n=e-1;n>=0;--n){const e=_n(r[n]);if(w(t,o,[e,n,this]))return n}return-1}every(t,...n){jn(this);const r=kn(this),e=bt(r),o=n[0];for(let n=0;n<e;++n)if(!w(t,o,[_n(r[n]),n,this]))return!1;return!0}some(t,...n){jn(this);const r=kn(this),e=bt(r),o=n[0];for(let n=0;n<e;++n)if(w(t,o,[_n(r[n]),n,this]))return!0;return!1}set(t,...n){jn(this);const r=kn(this),e=En(n[0]);if(e<0)throw Lt(h);if(null==t)throw Bt(s);if($t(t))throw Bt(u);if(Pn(t))return ht(kn(this),kn(t),e);if(Zt(t)&&Tn(gt(t)))throw Bt(i);const o=bt(r),c=R(t),f=mn(c.length);if(e===1/0||f+e>o)throw Lt(h);for(let t=0;t<f;++t)r[t+e]=gn(c[t])}reverse(){jn(this);const t=kn(this);return lt(t),this}toReversed(){jn(this);const t=kn(this),n=new Et(gt(t),vt(t),bt(t)),r=new In(gt(pt(n))),e=kn(r);return lt(e),r}fill(t,...n){jn(this);const r=kn(this);return at(r,gn(t),...Kt(n)),this}copyWithin(t,n,...r){jn(this);const e=kn(this);return wt(e,t,n,...Kt(r)),this}sort(t){jn(this);const n=kn(this),r=void 0!==t?t:On;return yt(n,((t,n)=>r(_n(t),_n(n)))),this}toSorted(t){jn(this);const n=kn(this);if(void 0!==t&&"function"!=typeof t)throw new Bt("The comparison function must be either a function or undefined");const r=void 0!==t?t:On,e=new Et(gt(n),vt(n),bt(n)),o=new In(gt(pt(e))),i=kn(o);return yt(i,((t,n)=>r(_n(t),_n(n)))),o}slice(t,n){jn(this);const r=kn(this),e=xn(r,In);if(e===In){const e=new Et(gt(r),vt(r),bt(r));return new In(gt(pt(e,t,n)))}const o=bt(r),s=En(t),u=void 0===n?o:En(n);let c,f;c=s===-1/0?0:s<0?o+s>0?o+s:0:o<s?o:s,f=u===-1/0?0:u<0?o+u>0?o+u:0:o<u?o:u;const h=f-c>0?f-c:0,l=new e(h);if(Fn(l,h),0===h)return l;if(Tn(gt(r)))throw Bt(i);let a=0;for(;c<f;)l[a]=_n(r[c]),++c,++a;return l}subarray(t,n){jn(this);const r=kn(this),e=xn(r,In),o=new Et(gt(r),vt(r),bt(r)),i=dt(o,t,n),s=new e(gt(i),vt(i),bt(i));return Fn(s),s}indexOf(t,...n){jn(this);const r=kn(this),e=bt(r);let o=En(n[0]);if(o===1/0)return-1;o<0&&(o+=e,o<0&&(o=0));for(let n=o;n<e;++n)if(M(r,n)&&_n(r[n])===t)return n;return-1}lastIndexOf(t,...n){jn(this);const r=kn(this),e=bt(r);let o=n.length>=1?En(n[0]):e-1;if(o===-1/0)return-1;o>=0?o=o<e-1?o:e-1:o+=e;for(let n=o;n>=0;--n)if(M(r,n)&&_n(r[n])===t)return n;return-1}includes(t,...n){jn(this);const r=kn(this),e=bt(r);let o=En(n[0]);if(o===1/0)return!1;o<0&&(o+=e,o<0&&(o=0));const i=S(t);for(let n=o;n<e;++n){const e=_n(r[n]);if(i&&S(e))return!0;if(e===t)return!0}return!1}join(t){jn(this);const n=Rn(kn(this));return V(n,t)}toLocaleString(...t){jn(this);const n=Rn(kn(this));return z(n,...Kt(t))}get[F](){if(Pn(this))return"Float16Array"}}L(In,"BYTES_PER_ELEMENT",{value:2}),L(In,en,{}),E(In,et);const Nn=In.prototype;function Un(t){return Zt(t)||Pn(t)}function Cn(t,n,...r){return _n(kt(t,n,...Kt(r)))}function Mn(t,n,r,...e){return Rt(t,n,gn(r),...Kt(e))}function Dn(t){return ln(t)}L(Nn,"BYTES_PER_ELEMENT",{value:2}),L(Nn,P,{value:Nn.values,writable:!0,configurable:!0}),E(Nn,it)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5404],{95404:(e,r,t)=>{t.d(r,{computeObjectLayerResourceSize:()=>u}),t(78888);var i=t(49186),o=t(66344),n=t(51850),s=t(70328),l=t(8887);let c=new o.q(50);async function u(e,r=null){if(!e.isPrimitive){const r=e.resource?.href;if(!r)throw new i.A("symbol:invalid-resource","The symbol does not have a valid resource");const o=c.get(r);if(void 0!==o)return o;const{fetch:l}=await Promise.all([t.e(6213),t.e(3030),t.e(2944),t.e(9899),t.e(3383),t.e(1349)]).then(t.bind(t,64304)),u=await l(r,{disableTextures:!0,spherical:!0}),a=(0,s.Ej)(u.referenceBoundingBox,(0,n.vt)());return c.put(r,a),a}if(!e.resource?.primitive)throw new i.A("symbol:invalid-resource","The symbol does not have a valid resource");const o=(0,s.vt)((0,l.Fq)(e.resource.primitive));if(null!=r)for(let e=0;e<o.length;e++)o[e]*=r;return(0,s.Ej)(o,(0,n.vt)())}}}]);
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"./has.js";function n(n){return n instanceof ArrayBuffer}function r(n){return"Int8Array"===n?.constructor?.name}function t(n){return"Uint8Array"===n?.constructor?.name}function o(n){return"Uint8ClampedArray"===n?.constructor?.name}function u(n){return"Int16Array"===n?.constructor?.name}function c(n){return"Uint16Array"===n?.constructor?.name}function e(n){return"Int32Array"===n?.constructor?.name}function a(n){return"Uint32Array"===n?.constructor?.name}function i(n){return"Float16Array"===n?.constructor?.name}function f(n){return"Float32Array"===n?.constructor?.name}function s(n){return"Float64Array"===n?.constructor?.name}function m(n){return"buffer"in n}const y=1024;function A(n){return s(n)||f(n)||e(n)||u(n)||r(n)}function l(n){return s(n)||f(n)}function U(n){return s(n)?179769e303:i(n)?65504:f(n)?3402823e32:a(n)?4294967295:c(n)?65535:t(n)||o(n)?255:e(n)?2147483647:u(n)?32767:r(n)?127:256}const p=-32768,F=-2147483648;export{n as isArrayBuffer,l as isFloat,i as isFloat16Array,f as isFloat32Array,s as isFloat64Array,u as isInt16Array,e as isInt32Array,r as isInt8Array,A as isSigned,m as isTypedArray,c as isUint16Array,a as isUint32Array,t as isUint8Array,o as isUint8ClampedArray,U as maximumValue,p as minInt16,F as minInt32,y as nativeArrayMaxSize};
5
+ import"./has.js";function n(n){return n instanceof ArrayBuffer}function r(n){return"Int8Array"===n?.constructor?.name}function t(n){return"Uint8Array"===n?.constructor?.name}function o(n){return"Uint8ClampedArray"===n?.constructor?.name}function u(n){return"Int16Array"===n?.constructor?.name}function c(n){return"Uint16Array"===n?.constructor?.name}function e(n){return"Int32Array"===n?.constructor?.name}function a(n){return"Uint32Array"===n?.constructor?.name}function i(n){return"Float16Array"===n?.constructor?.name}function f(n){return"Float32Array"===n?.constructor?.name}function s(n){return"Float64Array"===n?.constructor?.name}function m(n){return"buffer"in n}const y=1024;function A(n){return s(n)||f(n)||e(n)||u(n)||r(n)}function l(n){return s(n)||f(n)}function U(n){return s(n)?179769e303:i(n)?65504:f(n)?3402823e32:a(n)?4294967295:c(n)?65535:t(n)||o(n)?255:e(n)?2147483647:u(n)?32767:r(n)?127:256}const p=-32768,F=-2147483648,I=65535,b=2**32-1;export{n as isArrayBuffer,l as isFloat,i as isFloat16Array,f as isFloat32Array,s as isFloat64Array,u as isInt16Array,e as isInt32Array,r as isInt8Array,A as isSigned,m as isTypedArray,c as isUint16Array,a as isUint32Array,t as isUint8Array,o as isUint8ClampedArray,I as maxUint16,b as maxUint32,U as maximumValue,p as minInt16,F as minInt32,y as nativeArrayMaxSize};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import r from"../../core/Accessor.js";import{makeHandle as o}from"../../core/handleUtils.js";import{getOrCreateMapValue as s}from"../../core/MapUtils.js";import{abortMaybe as i}from"../../core/maybe.js";import{onAbort as a,throwIfAborted as l,createAbortError as n,throwIfAbortError as c,createResolver as p}from"../../core/promiseUtils.js";import{watch as u}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import{isSharedGroupTemplate as m,isSharedPresetTemplate as h,isSharedFeatureTemplate as y}from"../templateUtils.js";import{SharedTemplateMissingTemplatesError as w,SharedTemplateLayerResolverError as v,SharedTemplateUtilityNetworkResolverError as k,SharedTemplateRequestError as g,SharedTemplateLayerUnavailableError as S}from"./support/sharedTemplateErrors.js";import{isFeatureLayer as _,isSubtypeGroupLayer as b}from"../../layers/support/layerUtils.js";import{UtilityNetworkLookupHelper as j}from"../../networks/support/UtilityNetworkLookupHelper.js";import{getServices as N}from"../../undoredo/support/Services.js";import{isWebMap as R}from"../../webmap/utils.js";const T=new Map;function C(e,t){return s(T,e,(()=>{const r=new I({layerResolver:t?.layerResolver??F(e),makeSharedTemplateFromJSON:t.makeSharedTemplateFromJSON,utilityNetworkResolver:t?.utilityNetworkResolver??J(e),view:e});return e.addHandles(o((()=>{T.delete(e),r.destroy()}))),r}))}let I=class extends r{constructor(e){super(e),this._abortController=null,this._cache=new Map,this._pending=new Map,this._utilityNetworkLookupHelperCache=new Map,this.layerResolver=null,this.makeSharedTemplateFromJSON=null,this.utilityNetworkResolver=null,this.view=null}initialize(){this.addHandles(u((()=>this.view.spatialReference),(()=>this._reset())))}destroy(){this._abortController=i(this._abortController)}async getTemplates({templateIds:e,featureService:t,signal:r}){const o=this._cache,s=this._pending,i=[],n=new Set,c=new Set,p=Symbol();for(const a of new Set(e)){const e=U(t,a);if(o.has(e))i.push(o.get(e));else if(s.has(e)){const t=s.get(e);t.subscribers.add(p),c.add(t)}else n.add(a),s.set(e,O())}if(i.length===e.length)return i;const u=()=>{for(const{subscribers:e}of c)e.delete(p)},d=a(r,u);try{const e=await this._loadTemplates({templateIds:Array.from(n),featureService:t,signal:r}),o=await Promise.all(Array.from(c).map((({resolver:e})=>e.promise)));i.push(...e),i.push(...o)}catch(f){u();for(const e of n){const r=U(t,e),o=s.get(r);o?.resolver.reject(f),s.delete(r)}throw f}finally{d?.remove()}return l(r),i}async _loadTemplates({templateIds:e,featureService:t,signal:r}){if(0===e.length)return[];const o=this._cache,s=this._pending,i=this._abortController=new AbortController,l=a(r,(()=>{for(const r of e){if(L(s.get(U(t,r))))return}i.abort()})),c=await H({featureService:t,templateIds:e,signal:i.signal,spatialReference:this.view.spatialReference});if(c.length<e.length)throw new w(e,c);const p=await Promise.all(c.map((e=>this._makeTemplate({json:e,featureService:t}))));for(const a of p){const e=U(t,a.templateId),i=s.get(e);!r?.aborted||L(i)?(o.set(e,a),i?.resolver.resolve(a)):i?.resolver.reject(n()),s.delete(e)}return l?.remove(),p}async _makeTemplate({json:e,featureService:t}){const{view:r}=this,o=this.makeSharedTemplateFromJSON(e);o.featureService=t,o.view=r;const{layerIds:s,subtypeCode:i}=o;try{o.layer=await this.layerResolver({featureService:t,layerIds:s,subtypeCode:i})}catch(a){throw new v(o.templateId,a)}if(m(o)&&o.definition?.createUtilityNetworkAssociations){let e=null;try{e=await this.utilityNetworkResolver(t)}catch(a){throw new k(o.templateId,a)}if(e){o.definition.utilityNetwork=await this._getOrCreateUtilityNetworkLookupHelper(e);const t=await e.loadAssociationsTable();o.definition.utilityNetworkAssociationsTable=t,N(r).additionalLayers.add(t)}}if(h(o)&&o.definition){o.definition.spatialReference=r.spatialReference;for(const e of o.definition.allParts)e.geometry&&(e.geometry.spatialReference=r.spatialReference)}if(y(o)&&o.definition?.defaultValues){const e=o.definition.defaultValues,t={},{fieldsIndex:r}=o.layer;for(const s in o.definition.defaultValues)t[r.get(s)?.name??s]=e[s];o.definition.defaultValues=t}return o}async _getOrCreateUtilityNetworkLookupHelper(e){const t=this._utilityNetworkLookupHelperCache.get(e);if(t)return t;const r=await new j({utilityNetwork:e}).load();this._utilityNetworkLookupHelperCache.set(e,r);const s=o((()=>{r.destroy(),this._utilityNetworkLookupHelperCache.delete(e)}));return e.addHandles(s),this.addHandles(s),r}_reset(){this._abortController?.abort(),this._cache.clear(),this._pending.clear()}};async function H({templateIds:e,featureService:r,spatialReference:o,signal:s}){const i=`${r.url}/sharedTemplates/templates`,a=await t(i,{query:{f:"json",outSR:o,ids:e.join(",")},signal:s}).catch((t=>{throw c(t),new g(e,t)}));return a.data?.templates??[]}function L(e){return null!=e&&e.subscribers.size>0}function O(){return{resolver:p(),subscribers:new Set}}function U(e,t){return`${e.url}/${t}`}function A(e){return _(e)||b(e)}function F(e){return async({featureService:t,layerIds:r})=>{const o=new Set(r),{allLayers:s,allTables:i}=e.map,a=s.concat(i).find((e=>e.url===t.url&&A(e)&&o.has(e.layerId)));if(null==a)throw new S(r);return a}}function J(e){return async t=>{const{map:r}=e;if(!R(r)||!r.utilityNetworks)return null;for(const e of r.utilityNetworks)if(e.featureServiceUrl===t.url)return e.load();return null}}e([d()],I.prototype,"_abortController",void 0),e([d()],I.prototype,"_cache",void 0),e([d()],I.prototype,"_pending",void 0),e([d({constructOnly:!0})],I.prototype,"layerResolver",void 0),e([d({constructOnly:!0})],I.prototype,"makeSharedTemplateFromJSON",void 0),e([d({constructOnly:!0})],I.prototype,"utilityNetworkResolver",void 0),e([d({constructOnly:!0})],I.prototype,"view",void 0),I=e([f("esri.editing.sharedTemplates.SharedTemplateProvider")],I);export{I as SharedTemplateProvider,C as getSharedTemplateProvider};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import r from"../../core/Accessor.js";import{makeHandle as o}from"../../core/handleUtils.js";import{getOrCreateMapValue as s}from"../../core/MapUtils.js";import{abortMaybe as i}from"../../core/maybe.js";import{onAbort as a,throwIfAborted as l,createAbortError as n,throwIfAbortError as c,createResolver as p}from"../../core/promiseUtils.js";import{watch as u}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import{isSharedGroupTemplate as m,isSharedPresetTemplate as h,isSharedFeatureTemplate as y}from"../templateUtils.js";import{SharedTemplateMissingTemplatesError as w,SharedTemplateLayerResolverError as v,SharedTemplateUtilityNetworkResolverError as k,SharedTemplateRequestError as g,SharedTemplateLayerUnavailableError as S}from"./support/sharedTemplateErrors.js";import{isFeatureLayer as _,isSubtypeGroupLayer as b}from"../../layers/support/layerUtils.js";import{getServices as j}from"../../undoredo/support/Services.js";import{isWebMap as N}from"../../webmap/utils.js";const R=new Map;function T(e,t){return s(R,e,(()=>{const r=new C({layerResolver:t?.layerResolver??A(e),makeSharedTemplateFromJSON:t.makeSharedTemplateFromJSON,utilityNetworkResolver:t?.utilityNetworkResolver??F(e),view:e});return e.addHandles(o((()=>{R.delete(e),r.destroy()}))),r}))}let C=class extends r{constructor(e){super(e),this._abortController=null,this._cache=new Map,this._pending=new Map,this._utilityNetworkLookupHelperCache=new Map,this.layerResolver=null,this.makeSharedTemplateFromJSON=null,this.utilityNetworkResolver=null,this.view=null}initialize(){this.addHandles(u((()=>this.view.spatialReference),(()=>this._reset())))}destroy(){this._abortController=i(this._abortController)}async getTemplates({templateIds:e,featureService:t,signal:r}){const o=this._cache,s=this._pending,i=[],n=new Set,c=new Set,p=Symbol();for(const a of new Set(e)){const e=U(t,a);if(o.has(e))i.push(o.get(e));else if(s.has(e)){const t=s.get(e);t.subscribers.add(p),c.add(t)}else n.add(a),s.set(e,L())}if(i.length===e.length)return i;const u=()=>{for(const{subscribers:e}of c)e.delete(p)},d=a(r,u);try{const e=await this._loadTemplates({templateIds:Array.from(n),featureService:t,signal:r}),o=await Promise.all(Array.from(c).map((({resolver:e})=>e.promise)));i.push(...e),i.push(...o)}catch(f){u();for(const e of n){const r=U(t,e),o=s.get(r);o?.resolver.reject(f),s.delete(r)}throw f}finally{d?.remove()}return l(r),i}async _loadTemplates({templateIds:e,featureService:t,signal:r}){if(0===e.length)return[];const o=this._cache,s=this._pending,i=this._abortController=new AbortController,l=a(r,(()=>{for(const r of e){if(H(s.get(U(t,r))))return}i.abort()})),c=await I({featureService:t,templateIds:e,signal:i.signal,spatialReference:this.view.spatialReference});if(c.length<e.length)throw new w(e,c);const p=await Promise.all(c.map((e=>this._makeTemplate({json:e,featureService:t}))));for(const a of p){const e=U(t,a.templateId),i=s.get(e);!r?.aborted||H(i)?(o.set(e,a),i?.resolver.resolve(a)):i?.resolver.reject(n()),s.delete(e)}return l?.remove(),p}async _makeTemplate({json:e,featureService:t}){const{view:r}=this,o=this.makeSharedTemplateFromJSON(e);o.featureService=t,o.view=r;const{layerIds:s,subtypeCode:i}=o;try{o.layer=await this.layerResolver({featureService:t,layerIds:s,subtypeCode:i})}catch(a){throw new v(o.templateId,a)}if(m(o)&&o.definition?.createUtilityNetworkAssociations){let e=null;try{e=await this.utilityNetworkResolver(t)}catch(a){throw new k(o.templateId,a)}if(e){o.definition.utilityNetwork=await this._getOrCreateUtilityNetworkLookupHelper(e);const t=await e.loadAssociationsTable();o.definition.utilityNetworkAssociationsTable=t,j(r).additionalLayers.add(t)}}if(h(o)&&o.definition){o.definition.spatialReference=r.spatialReference;for(const e of o.definition.allParts)e.geometry&&(e.geometry.spatialReference=r.spatialReference)}if(y(o)&&o.definition?.defaultValues){const e=o.definition.defaultValues,t={},{fieldsIndex:r}=o.layer;for(const s in o.definition.defaultValues)t[r.get(s)?.name??s]=e[s];o.definition.defaultValues=t}return o}async _getOrCreateUtilityNetworkLookupHelper(e){const t=this._utilityNetworkLookupHelperCache.get(e);if(t)return t;const{UtilityNetworkLookupHelper:r}=await import("../../networks/support/UtilityNetworkLookupHelper.js"),s=await new r({utilityNetwork:e}).load();this._utilityNetworkLookupHelperCache.set(e,s);const i=o((()=>{s.destroy(),this._utilityNetworkLookupHelperCache.delete(e)}));return e.addHandles(i),this.addHandles(i),s}_reset(){this._abortController?.abort(),this._cache.clear(),this._pending.clear()}};async function I({templateIds:e,featureService:r,spatialReference:o,signal:s}){const i=`${r.url}/sharedTemplates/templates`,a=await t(i,{query:{f:"json",outSR:o,ids:e.join(",")},signal:s}).catch((t=>{throw c(t),new g(e,t)}));return a.data?.templates??[]}function H(e){return null!=e&&e.subscribers.size>0}function L(){return{resolver:p(),subscribers:new Set}}function U(e,t){return`${e.url}/${t}`}function O(e){return _(e)||b(e)}function A(e){return async({featureService:t,layerIds:r})=>{const o=new Set(r),{allLayers:s,allTables:i}=e.map,a=s.concat(i).find((e=>e.url===t.url&&O(e)&&o.has(e.layerId)));if(null==a)throw new S(r);return a}}function F(e){return async t=>{const{map:r}=e;if(!N(r)||!r.utilityNetworks)return null;for(const e of r.utilityNetworks)if(e.featureServiceUrl===t.url)return e.load();return null}}e([d()],C.prototype,"_abortController",void 0),e([d()],C.prototype,"_cache",void 0),e([d()],C.prototype,"_pending",void 0),e([d({constructOnly:!0})],C.prototype,"layerResolver",void 0),e([d({constructOnly:!0})],C.prototype,"makeSharedTemplateFromJSON",void 0),e([d({constructOnly:!0})],C.prototype,"utilityNetworkResolver",void 0),e([d({constructOnly:!0})],C.prototype,"view",void 0),C=e([f("esri.editing.sharedTemplates.SharedTemplateProvider")],C);export{C as SharedTemplateProvider,T as getSharedTemplateProvider};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../chunks/tslib.es6.js";import{equals as e}from"../core/arrayUtils.js";import{clone as r}from"../core/lang.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../core/accessorSupport/decorators/writer.js";import o from"./Extent.js";import a from"./Geometry.js";import l from"./Point.js";import h from"./SpatialReference.js";import{polygonCentroid as p}from"./support/centroid.js";import{polygonContainsPoint as c}from"./support/contains.js";import{isClockwise as u}from"./support/coordsUtils.js";import{getPolygonExtent as m}from"./support/extentUtils.js";import{isSelfIntersecting as f}from"./support/intersectsBase.js";import{project as g}from"./support/webMercatorUtils.js";import{updateSupportFromPoint as y}from"./support/zmUtils.js";var R;function d(t){return!Array.isArray(t[0])}function w(t){return"number"==typeof t[0]?.[0]}function v(t){if(!t)return;let{rings:e,hasM:r,hasZ:s,spatialReference:i}=t;switch(e??=[],w(e)&&(e=[e]),e[0]?.[0]?.length){case 4:s??=!0,r??=!0;break;case 3:s??=!0!==r,r??=!s;break;default:s??=!1,r??=!1}return i??=h.WGS84,{...t,hasM:r,hasZ:s,rings:e,spatialReference:i}}let x=R=class extends a{static fromExtent(t){const e=t.clone().normalize(),{spatialReference:r}=t;let s=!1,i=!1;for(const o of e)o.hasZ&&(s=!0),o.hasM&&(i=!0);const n={rings:e.map((t=>{const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];if(s&&t.hasZ){const r=t.zmin+.5*(t.zmax-t.zmin);for(let t=0;t<e.length;t++)e[t].push(r)}if(i&&t.hasM){const r=t.mmin+.5*(t.mmax-t.mmin);for(let t=0;t<e.length;t++)e[t].push(r)}return e})),spatialReference:r};return s&&(n.hasZ=!0),i&&(n.hasM=!0),new R(n)}constructor(t){super(v(t)),this.curveRings=void 0,this.rings=[],this.type="polygon"}get cache(){return this.commitProperty("curveRings"),this.commitProperty("hasM"),this.commitProperty("hasZ"),this.commitProperty("rings"),this.commitProperty("spatialReference"),{}}get centroid(){const t=p(this);if(!t||isNaN(t[0])||isNaN(t[1])||this.hasZ&&isNaN(t[2]))return null;const e=new l;return e.x=t[0],e.y=t[1],e.spatialReference=this.spatialReference,this.hasZ&&(e.z=t[2]),e}writeCurveRings(t,e){e.curveRings=r(t)}get extent(){const t=m(this),{spatialReference:e}=this;return t?new o({...t,spatialReference:e}):null}get isSelfIntersecting(){return f(this.rings)}writeRings(t,e){e.rings=r(this.rings)}addRing(t){if(!t)return;const e=this.rings,r=e.length;if(d(t)){const s=[];for(let e=0,r=t.length;e<r;e++)s[e]=t[e].toArray();e[r]=s}else e[r]=t.slice();return this.notifyChange("rings"),this}clone(){const t=new R;return t.spatialReference=this.spatialReference,t.rings=r(this.rings),t.curveRings=r(this.curveRings),t.hasZ=this.hasZ,t.hasM=this.hasM,t}equals(t){if(this===t)return!0;if(null==t)return!1;const r=this.spatialReference,s=t.spatialReference;if(null!=r!=(null!=s))return!1;if(null!=r&&null!=s&&!r.equals(s))return!1;if(this.rings.length!==t.rings.length)return!1;const i=([t,e,r,s],[i,n,o,a])=>t===i&&e===n&&(null==r&&null==o||r===o)&&(null==s&&null==a||s===a);for(let n=0;n<this.rings.length;n++){const r=this.rings[n],s=t.rings[n];if(!e(r,s,i))return!1}return!0}contains(t){if(!t)return!1;const e=g(t,this.spatialReference);return c(this,null!=e?e:t)}isClockwise(t){const e=d(t)?t.map((t=>this.hasZ?this.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])):t;return u(e)}getPoint(t,e){if(!this._validateInputs(t,e))return null;const r=this.rings[t][e],s=this.hasZ,i=this.hasM;return s&&!i?new l(r[0],r[1],r[2],void 0,this.spatialReference):i&&!s?new l(r[0],r[1],void 0,r[2],this.spatialReference):s&&i?new l(r[0],r[1],r[2],r[3],this.spatialReference):new l(r[0],r[1],this.spatialReference)}insertPoint(t,e,r){return this._validateInputs(t,e,!0)?(y(this,r),Array.isArray(r)||(r=r.toArray()),this.rings[t].splice(e,0,r),this.notifyChange("rings"),this):this}removePoint(t,e){if(!this._validateInputs(t,e))return null;const r=new l(this.rings[t].splice(e,1)[0],this.spatialReference);return this.notifyChange("rings"),r}removeRing(t){if(!this._validateInputs(t,null))return null;const e=this.rings.splice(t,1)[0],r=this.spatialReference,s=e.map((t=>new l(t,r)));return this.notifyChange("rings"),s}setPoint(t,e,r){return this._validateInputs(t,e)?(y(this,r),Array.isArray(r)||(r=r.toArray()),this.rings[t][e]=r,this.notifyChange("rings"),this):this}_validateInputs(t,e,r=!1){if(null==t||t<0||t>=this.rings.length)return!1;if(null!=e){const s=this.rings[t];if(r&&(e<0||e>s.length))return!1;if(!r&&(e<0||e>=s.length))return!1}return!0}toJSON(t){return this.write({},t)}};t([s({readOnly:!0})],x.prototype,"cache",null),t([s({readOnly:!0})],x.prototype,"centroid",null),t([s({json:{write:!0,origins:{"portal-item":{write:!1},"web-map":{write:!1},"web-scene":{write:!1}}}})],x.prototype,"curveRings",void 0),t([n("curveRings")],x.prototype,"writeCurveRings",null),t([s({readOnly:!0})],x.prototype,"extent",null),t([s({readOnly:!0})],x.prototype,"isSelfIntersecting",null),t([s({type:[[[Number]]],json:{write:{isRequired:!0}}})],x.prototype,"rings",void 0),t([n("rings")],x.prototype,"writeRings",null),x=R=t([i("esri.geometry.Polygon")],x);const j=x;x.prototype.toJSON.isDefaultToJSON=!0;export{j as default};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import{equals as e}from"../core/arrayUtils.js";import{deprecatedProperty as r}from"../core/deprecate.js";import{clone as s}from"../core/lang.js";import i from"../core/Logger.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../core/accessorSupport/decorators/writer.js";import l from"./Extent.js";import p from"./Geometry.js";import c from"./Point.js";import h from"./SpatialReference.js";import{polygonCentroid as u}from"./support/centroid.js";import{polygonContainsPoint as m}from"./support/contains.js";import{isClockwise as f}from"./support/coordsUtils.js";import{getPolygonExtent as g}from"./support/extentUtils.js";import{isSelfIntersecting as y}from"./support/intersectsBase.js";import{project as R}from"./support/webMercatorUtils.js";import{updateSupportFromPoint as d}from"./support/zmUtils.js";var w;function v(t){return!Array.isArray(t[0])}function j(t){return"number"==typeof t[0]?.[0]}function x(t){if(!t)return;let{rings:e,hasM:r,hasZ:s,spatialReference:i}=t;switch(e??=[],j(e)&&(e=[e]),e[0]?.[0]?.length){case 4:s??=!0,r??=!0;break;case 3:s??=!0!==r,r??=!s;break;default:s??=!1,r??=!1}return i??=h.WGS84,{...t,hasM:r,hasZ:s,rings:e,spatialReference:i}}let P=w=class extends p{static fromExtent(t){const e=t.clone().normalize(),{spatialReference:r}=t;let s=!1,i=!1;for(const o of e)o.hasZ&&(s=!0),o.hasM&&(i=!0);const n={rings:e.map((t=>{const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];if(s&&t.hasZ){const r=t.zmin+.5*(t.zmax-t.zmin);for(let t=0;t<e.length;t++)e[t].push(r)}if(i&&t.hasM){const r=t.mmin+.5*(t.mmax-t.mmin);for(let t=0;t<e.length;t++)e[t].push(r)}return e})),spatialReference:r};return s&&(n.hasZ=!0),i&&(n.hasM=!0),new w(n)}constructor(t){super(x(t)),this.curveRings=void 0,this.rings=[],this.type="polygon"}get cache(){return this.commitProperty("curveRings"),this.commitProperty("hasM"),this.commitProperty("hasZ"),this.commitProperty("rings"),this.commitProperty("spatialReference"),{}}get centroid(){const t=u(this);if(!t||isNaN(t[0])||isNaN(t[1])||this.hasZ&&isNaN(t[2]))return null;const e=new c;return e.x=t[0],e.y=t[1],e.spatialReference=this.spatialReference,this.hasZ&&(e.z=t[2]),e}writeCurveRings(t,e){e.curveRings=s(t)}get extent(){const t=g(this),{spatialReference:e}=this;return t?new l({...t,spatialReference:e}):null}get isSelfIntersecting(){return r(i.getLogger(this),"isSelfIntersecting",{replacement:"Please use simplifyOperator.isSimple() instead.",version:"4.33",warnOnce:!0}),y(this.rings)}writeRings(t,e){e.rings=s(this.rings)}addRing(t){if(!t)return;const e=this.rings,r=e.length;if(v(t)){const s=[];for(let e=0,r=t.length;e<r;e++)s[e]=t[e].toArray();e[r]=s}else e[r]=t.slice();return this.notifyChange("rings"),this}clone(){const t=new w;return t.spatialReference=this.spatialReference,t.rings=s(this.rings),t.curveRings=s(this.curveRings),t.hasZ=this.hasZ,t.hasM=this.hasM,t}equals(t){if(this===t)return!0;if(null==t)return!1;const r=this.spatialReference,s=t.spatialReference;if(null!=r!=(null!=s))return!1;if(null!=r&&null!=s&&!r.equals(s))return!1;if(this.rings.length!==t.rings.length)return!1;const i=([t,e,r,s],[i,n,o,a])=>t===i&&e===n&&(null==r&&null==o||r===o)&&(null==s&&null==a||s===a);for(let n=0;n<this.rings.length;n++){const r=this.rings[n],s=t.rings[n];if(!e(r,s,i))return!1}return!0}contains(t){if(!t)return!1;const e=R(t,this.spatialReference);return m(this,null!=e?e:t)}isClockwise(t){const e=v(t)?t.map((t=>this.hasZ?this.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])):t;return f(e)}getPoint(t,e){if(!this._validateInputs(t,e))return null;const r=this.rings[t][e],s=this.hasZ,i=this.hasM;return s&&!i?new c(r[0],r[1],r[2],void 0,this.spatialReference):i&&!s?new c(r[0],r[1],void 0,r[2],this.spatialReference):s&&i?new c(r[0],r[1],r[2],r[3],this.spatialReference):new c(r[0],r[1],this.spatialReference)}insertPoint(t,e,r){return this._validateInputs(t,e,!0)?(d(this,r),Array.isArray(r)||(r=r.toArray()),this.rings[t].splice(e,0,r),this.notifyChange("rings"),this):this}removePoint(t,e){if(!this._validateInputs(t,e))return null;const r=new c(this.rings[t].splice(e,1)[0],this.spatialReference);return this.notifyChange("rings"),r}removeRing(t){if(!this._validateInputs(t,null))return null;const e=this.rings.splice(t,1)[0],r=this.spatialReference,s=e.map((t=>new c(t,r)));return this.notifyChange("rings"),s}setPoint(t,e,r){return this._validateInputs(t,e)?(d(this,r),Array.isArray(r)||(r=r.toArray()),this.rings[t][e]=r,this.notifyChange("rings"),this):this}_validateInputs(t,e,r=!1){if(null==t||t<0||t>=this.rings.length)return!1;if(null!=e){const s=this.rings[t];if(r&&(e<0||e>s.length))return!1;if(!r&&(e<0||e>=s.length))return!1}return!0}toJSON(t){return this.write({},t)}};t([n({readOnly:!0})],P.prototype,"cache",null),t([n({readOnly:!0})],P.prototype,"centroid",null),t([n({json:{write:!0,origins:{"portal-item":{write:!1},"web-map":{write:!1},"web-scene":{write:!1}}}})],P.prototype,"curveRings",void 0),t([a("curveRings")],P.prototype,"writeCurveRings",null),t([n({readOnly:!0})],P.prototype,"extent",null),t([n({readOnly:!0})],P.prototype,"isSelfIntersecting",null),t([n({type:[[[Number]]],json:{write:{isRequired:!0}}})],P.prototype,"rings",void 0),t([a("rings")],P.prototype,"writeRings",null),P=w=t([o("esri.geometry.Polygon")],P);const S=P;P.prototype.toJSON.isDefaultToJSON=!0;export{S as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{Float16Array as r}from"@petamoriken/float16";import{nativeArrayMaxSize as n}from"../../core/typedArrayUtil.js";function e(e,t=!1){return e<=n?t?new Array(e).fill(0):new Array(e):new r(e)}function t(e){return Array.isArray(e)?e.length<n?e:new r(e):e.length<n?Array.from(e):e}function a(e){return(Array.isArray(e)?e.length:e.byteLength/8)<=n?Array.from(e):new r(e)}function o(r,n,e){return Array.isArray(r)?r.slice(n,n+e):r.subarray(n,n+e)}export{t as compactHalfFloatArray,a as floatArrayFrom,o as floatSubArray,e as newHalfFloatArray};
5
+ import{nativeArrayMaxSize as r}from"../../core/typedArrayUtil.js";import{makeFloat16Array as t}from"./float16.js";function n(n,e=!1){return n<=r?e?new Array(n).fill(0):new Array(n):t(n)}function e(n){return Array.isArray(n)?n.length<r?n:t(n):n.length<r?Array.from(n):n}function a(n){return(Array.isArray(n)?n.length:n.byteLength/8)<=r?Array.from(n):t(n)}function y(r,t,n){return Array.isArray(r)?r.slice(t,t+n):r.subarray(t,t+n)}export{e as compactHalfFloatArray,a as floatArrayFrom,y as floatSubArray,n as newHalfFloatArray};