@arcgis/core 4.33.0-next.20250410 → 4.33.0-next.20250412

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 (81) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{1364744b15b327abd5a1.js → 37716880cef8155259f5.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{ccb289911e7445b17763.js → 3a84ee5d0434362286a6.js} +10 -10
  4. package/assets/esri/core/workers/chunks/4deeeceb784e4390441d.js +1 -0
  5. package/assets/esri/core/workers/chunks/5a991c8e0febb0cf9be1.js +1 -0
  6. package/assets/esri/core/workers/chunks/7f86c9ec45f4fae1fb49.js +1 -0
  7. package/assets/esri/core/workers/chunks/{b06e3ba73f353592c81d.js → b6361cec92003997bfe5.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{4bbe6160eda3fb5d58ec.js → d88544ac332be633e3fe.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{35ab75010817f1525e54.js → e6a97f9b6f7be8076f85.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{5fa5bfc70512994f5ec1.js → e7cb4003c45e42b48ea6.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{b308bef7ff08e0e635b5.js → fe1ad9ed0d32f557e5a3.js} +23 -23
  12. package/assets/esri/themes/base/widgets/_BuildingDisciplinesTree.scss +0 -1
  13. package/assets/esri/themes/dark/main.css +1 -1
  14. package/assets/esri/themes/light/main.css +1 -1
  15. package/assets/esri/themes/light/view.css +1 -1
  16. package/chunks/BloomBlur.glsl.js +4 -6
  17. package/chunks/BloomComposition.glsl.js +12 -12
  18. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  19. package/interfaces.d.ts +47 -2
  20. package/package.json +1 -1
  21. package/support/revision.js +1 -1
  22. package/symbols/cim/CurveHelper.js +1 -1
  23. package/symbols/cim/GeometryWalker.js +1 -1
  24. package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
  25. package/symbols/cim/placements/PlacementOnLine.js +1 -1
  26. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  27. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  28. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/utils.js +1 -1
  29. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  30. package/views/3d/layers/ElevationLayerView3DModifications.js +1 -1
  31. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  32. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  33. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  34. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  35. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  36. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  37. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  38. package/views/3d/layers/graphics/Labeler.js +1 -1
  39. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  40. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  41. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  42. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
  43. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  44. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
  45. package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
  46. package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
  47. package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
  48. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  49. package/views/3d/support/MemoryController.js +1 -1
  50. package/views/3d/terrain/OverlayManager.js +1 -1
  51. package/views/3d/terrain/OverlayRenderer.js +1 -1
  52. package/views/3d/terrain/PatchRenderData.js +1 -1
  53. package/views/3d/terrain/TextureFader.js +1 -1
  54. package/views/3d/terrain/TileRenderer.js +1 -1
  55. package/views/3d/terrain/TileTexture.js +1 -1
  56. package/views/3d/webgl/formats.js +1 -1
  57. package/views/3d/webgl-engine/Stage.js +1 -1
  58. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  59. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  60. package/views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js +1 -1
  61. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  62. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  63. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  64. package/views/3d/webgl-engine/lib/RendererBase.js +5 -0
  65. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  66. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  67. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  68. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  69. package/views/3d/webgl-engine/materials/renderers/VaoCache.js +1 -1
  70. package/views/FocusAreas.js +1 -1
  71. package/views/webgl/VertexArrayObject.js +1 -1
  72. package/views/webgl/enums.js +1 -1
  73. package/views/webgl/textureUtils.js +1 -1
  74. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  75. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  76. package/widgets/Feature/support/featureUtils.js +1 -1
  77. package/widgets/Features.js +1 -1
  78. package/widgets/Search.js +1 -1
  79. package/assets/esri/core/workers/chunks/386ea90e87254b0282ec.js +0 -1
  80. package/assets/esri/core/workers/chunks/4046ec636723c20d3e28.js +0 -1
  81. package/assets/esri/core/workers/chunks/ec83af4fb3bf59df7759.js +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5933],{10536:(e,t,r)=>{function n(e){const t={};for(const r in e){if("declaredClass"===r)continue;const i=e[r];if(null!=i&&"function"!=typeof i)if(Array.isArray(i)){t[r]=[];for(let e=0;e<i.length;e++)t[r][e]=n(i[e])}else"object"==typeof i?i.toJSON&&(t[r]=JSON.stringify(i)):t[r]=i}return t}r.d(t,{z:()=>n})},13259:(e,t,r)=>{r.d(t,{H:()=>U,b:()=>F,c:()=>B,f:()=>V,s:()=>z});var n=r(37585),i=r(48163),s=r(91829),a=r(79258),o=r(49255),l=r(76591),c=r(36782),d=r(47522),u=r(40268),h=r(63578),f=r(13755),p=r(42593),m=r(42398),g=r(63365),y=r(26835),_=r(52587),b=r(20693),v=r(47286),x=r(14314),w=r(81961),S=r(71988),A=r(33094),C=r(20304),I=r(31821),T=r(12791),O=r(63761),R=r(59643),M=r(46540),E=r(14113),P=r(49788);const z={occludedFadeFactor:1};function F(e){const t=new E.N5,{signedDistanceFieldEnabled:r,occlusionTestEnabled:i,horizonCullingEnabled:z,pixelSnappingEnabled:F,hasScreenSizePerspective:V,debugDrawLabelBorder:U,vvSize:N,vvColor:L,hasRotation:q,occludedFragmentFade:H,sampleSignedDistanceFieldTexelCenter:G}=e;t.include(u.Q,e),t.vertex.include(l.rA,e);const{occlusionPass:$,output:Y,oitPass:W}=e;if($)return t.include(h.I,e),t;const{vertex:X,fragment:Z}=t;t.include(_.Y6),t.include(m.A,e),t.include(c.g,e),i&&t.include(f.y),Z.include(y.W),Z.include(g.a),t.varyings.add("vcolor","vec4"),t.varyings.add("vtc","vec2"),t.varyings.add("vsize","vec2");const Q=Y===o.V.Highlight,J=Q&&i;J&&t.varyings.add("voccluded","float"),X.uniforms.add(new x.I("viewport",(e=>e.camera.fullViewport)),new v.G("screenOffset",((e,t)=>(0,n.hZ)(j,2*e.screenOffset[0]*t.camera.pixelRatio,2*e.screenOffset[1]*t.camera.pixelRatio))),new v.G("anchorPosition",(e=>B(e))),new S.E("materialColor",(e=>e.color)),new C.m("materialRotation",(e=>e.rotation)),new O.N("tex",(e=>e.texture))),(0,b.Nz)(X),r&&(X.uniforms.add(new S.E("outlineColor",(e=>e.outlineColor))),Z.uniforms.add(new S.E("outlineColor",(e=>D(e)?e.outlineColor:s.uY)),new C.m("outlineSize",(e=>D(e)?e.outlineSize:0)))),z&&X.uniforms.add(new w.V("pointDistanceSphere",((e,t)=>{const r=t.camera.eye,n=e.origin;return(0,s.fA)(n[0]-r[0],n[1]-r[1],n[2]-r[2],a.$O.radius)}))),F&&X.include(d.K),V&&((0,_.pM)(X),(0,_.OH)(X)),U&&t.varyings.add("debugBorderCoords","vec4"),t.attributes.add(M.r.UVI,"vec2"),t.attributes.add(M.r.COLOR,"vec4"),t.attributes.add(M.r.SIZE,"vec2"),t.attributes.add(M.r.ROTATION,"float"),t.attributes.add(M.r.FEATUREATTRIBUTE,"vec4"),X.code.add(z?I.H`bool behindHorizon(vec3 posModel) {
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5933],{10536:(e,t,r)=>{function n(e){const t={};for(const r in e){if("declaredClass"===r)continue;const i=e[r];if(null!=i&&"function"!=typeof i)if(Array.isArray(i)){t[r]=[];for(let e=0;e<i.length;e++)t[r][e]=n(i[e])}else"object"==typeof i?i.toJSON&&(t[r]=JSON.stringify(i)):t[r]=i}return t}r.d(t,{z:()=>n})},13259:(e,t,r)=>{r.d(t,{H:()=>k,b:()=>F,c:()=>B,f:()=>V,s:()=>z});var n=r(37585),i=r(48163),s=r(91829),a=r(79258),o=r(49255),l=r(76591),c=r(36782),d=r(47522),u=r(40268),h=r(63578),f=r(13755),p=r(42593),m=r(42398),g=r(63365),y=r(26835),_=r(52587),b=r(20693),v=r(47286),x=r(14314),w=r(81961),S=r(71988),A=r(33094),C=r(20304),I=r(31821),T=r(12791),O=r(63761),R=r(59643),M=r(46540),E=r(14113),P=r(49788);const z={occludedFadeFactor:1};function F(e){const t=new E.N5,{signedDistanceFieldEnabled:r,occlusionTestEnabled:i,horizonCullingEnabled:z,pixelSnappingEnabled:F,hasScreenSizePerspective:V,debugDrawLabelBorder:k,vvSize:N,vvColor:L,hasRotation:q,occludedFragmentFade:H,sampleSignedDistanceFieldTexelCenter:G}=e;t.include(u.Q,e),t.vertex.include(l.rA,e);const{occlusionPass:$,output:Y,oitPass:W}=e;if($)return t.include(h.I,e),t;const{vertex:X,fragment:Z}=t;t.include(_.Y6),t.include(m.A,e),t.include(c.g,e),i&&t.include(f.y),Z.include(y.W),Z.include(g.a),t.varyings.add("vcolor","vec4"),t.varyings.add("vtc","vec2"),t.varyings.add("vsize","vec2");const Q=Y===o.V.Highlight,J=Q&&i;J&&t.varyings.add("voccluded","float"),X.uniforms.add(new x.I("viewport",(e=>e.camera.fullViewport)),new v.G("screenOffset",((e,t)=>(0,n.hZ)(j,2*e.screenOffset[0]*t.camera.pixelRatio,2*e.screenOffset[1]*t.camera.pixelRatio))),new v.G("anchorPosition",(e=>B(e))),new S.E("materialColor",(e=>e.color)),new C.m("materialRotation",(e=>e.rotation)),new O.N("tex",(e=>e.texture))),(0,b.Nz)(X),r&&(X.uniforms.add(new S.E("outlineColor",(e=>e.outlineColor))),Z.uniforms.add(new S.E("outlineColor",(e=>D(e)?e.outlineColor:s.uY)),new C.m("outlineSize",(e=>D(e)?e.outlineSize:0)))),z&&X.uniforms.add(new w.V("pointDistanceSphere",((e,t)=>{const r=t.camera.eye,n=e.origin;return(0,s.fA)(n[0]-r[0],n[1]-r[1],n[2]-r[2],a.$O.radius)}))),F&&X.include(d.K),V&&((0,_.pM)(X),(0,_.OH)(X)),k&&t.varyings.add("debugBorderCoords","vec4"),t.attributes.add(M.r.UVI,"vec2"),t.attributes.add(M.r.COLOR,"vec4"),t.attributes.add(M.r.SIZE,"vec2"),t.attributes.add(M.r.ROTATION,"float"),t.attributes.add(M.r.FEATUREATTRIBUTE,"vec4"),X.code.add(z?I.H`bool behindHorizon(vec3 posModel) {
2
2
  vec3 camToEarthCenter = pointDistanceSphere.xyz - localOrigin;
3
3
  vec3 camToPos = pointDistanceSphere.xyz + posModel;
4
4
  float earthRadius = pointDistanceSphere.w;
@@ -38,7 +38,7 @@ return b > 0.0 && b < a && b * b > a * c;
38
38
  bool visible = testHUDVisibility(posProj);
39
39
  if (!visible) {
40
40
  vtc = vec2(0.0);
41
- ${(0,I.If)(U,"debugBorderCoords = vec4(0.5, 0.5, 1.5 / combinedSize);")}
41
+ ${(0,I.If)(k,"debugBorderCoords = vec4(0.5, 0.5, 1.5 / combinedSize);")}
42
42
  return;
43
43
  }`)}
44
44
  ${(0,I.If)(J,I.H`voccluded = visible ? 0.0 : 1.0;`)}
@@ -46,8 +46,8 @@ return b > 0.0 && b < a && b * b > a * c;
46
46
  vec2 uvi1 = vec2(uvi.x < 0.0 ? 1.0 : 0.0, uvi.y < 0.0 ? 1.0 : 0.0);
47
47
  vec2 uv = abs(uvi + uvi1);
48
48
  vec2 texSize = vec2(textureSize(tex, 0));
49
- uv.x = uv.x >= ${k} ? 1.0 : uv.x / texSize.x;
50
- uv.y = uv.y >= ${k} ? 1.0 : uv.y / texSize.y;
49
+ uv.x = uv.x >= ${U} ? 1.0 : uv.x / texSize.x;
50
+ uv.y = uv.y >= ${U} ? 1.0 : uv.y / texSize.y;
51
51
  quadOffset.xy = (uvi1 - anchorPosition) * 2.0 * combinedSize;
52
52
 
53
53
  ${(0,I.If)(q,I.H`
@@ -82,10 +82,10 @@ posProj = alignToPixelOrigin(posProj, viewport.zw);
82
82
 
83
83
  vtc = uv;
84
84
 
85
- ${(0,I.If)(U,I.H`debugBorderCoords = vec4(uv01, 1.5 / combinedSize);`)}
85
+ ${(0,I.If)(k,I.H`debugBorderCoords = vec4(uv01, 1.5 / combinedSize);`)}
86
86
  vsize = inputSize;
87
- `),Z.uniforms.add(new O.N("tex",(e=>e.texture))),H&&!Q&&Z.uniforms.add(new T.x("depthMap",(e=>e.mainDepth)),new A.U("occludedOpacity",(e=>e.hudOccludedFragmentOpacity)));const te=U?I.H`(isBorder > 0.0 ? 0.0 : ${I.H.float(P.Q)})`:I.H.float(P.Q),re=I.H`
88
- ${(0,I.If)(U,I.H`float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`)}
87
+ `),Z.uniforms.add(new O.N("tex",(e=>e.texture))),H&&!Q&&Z.uniforms.add(new T.x("depthMap",(e=>e.mainDepth)),new A.U("occludedOpacity",(e=>e.hudOccludedFragmentOpacity)));const te=k?I.H`(isBorder > 0.0 ? 0.0 : ${I.H.float(P.Q)})`:I.H.float(P.Q),re=I.H`
88
+ ${(0,I.If)(k,I.H`float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`)}
89
89
 
90
90
  vec2 samplePos = vtc;
91
91
 
@@ -156,7 +156,7 @@ posProj = alignToPixelOrigin(posProj, viewport.zw);
156
156
  }
157
157
  `)}
158
158
 
159
- ${(0,I.If)(!Q&&U,I.H`fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`)}
159
+ ${(0,I.If)(!Q&&k,I.H`fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`)}
160
160
  `;switch(Y){case o.V.Color:case o.V.ColorEmission:t.outputs.add("fragColor","vec4",0),Y===o.V.ColorEmission&&t.outputs.add("fragEmission","vec4",1),W===R.Y.ColorAlpha&&t.outputs.add("fragAlpha","float",Y===o.V.ColorEmission?2:1),Z.main.add(I.H`
161
161
  ${re}
162
162
  ${(0,I.If)(W===R.Y.FrontFace,I.H`fragColor.rgb /= fragColor.a;`)}
@@ -165,7 +165,7 @@ posProj = alignToPixelOrigin(posProj, viewport.zw);
165
165
  ${re}
166
166
  outputObjectAndLayerIdColor();`);break;case o.V.Highlight:t.include(p.Q,e),Z.main.add(I.H`
167
167
  ${re}
168
- outputHighlight(${(0,I.If)(J,I.H`voccluded == 1.0`,I.H`false`)});`)}return t}function D(e){return e.outlineColor[3]>0&&e.outlineSize>0}function B(e){return e.textureIsSignedDistanceField?(t=e.anchorPosition,r=e.distanceFieldBoundingBox,i=j,(0,n.hZ)(i,t[0]*(r[2]-r[0])+r[0],t[1]*(r[3]-r[1])+r[1])):(0,n.C)(j,e.anchorPosition),j;var t,r,i}const j=(0,i.vt)(),V=32e3,k=I.H.float(V),U=Object.freeze(Object.defineProperty({__proto__:null,build:F,calculateAnchorPosition:B,fullUV:V,shaderSettings:z},Symbol.toStringTag,{value:"Module"}))},13755:(e,t,r)=>{r.d(t,{y:()=>c});var n,i=r(47522);!function(e){e[e.Occluded=0]="Occluded",e[e.NotOccluded=1]="NotOccluded",e[e.Both=2]="Both",e[e.COUNT=3]="COUNT"}(n||(n={}));var s=r(14314),a=r(33094),o=r(31821),l=r(12791);function c(e){e.vertex.uniforms.add(new a.U("renderTransparentlyOccludedHUD",(e=>e.hudRenderStyle===n.Occluded?1:e.hudRenderStyle===n.NotOccluded?0:.75)),new s.I("viewport",(e=>e.camera.fullViewport)),new l.x("hudVisibilityTexture",(e=>e.hudVisibility?.getTexture()))),e.vertex.include(i.K),e.vertex.code.add(o.H`bool testHUDVisibility(vec4 posProj) {
168
+ outputHighlight(${(0,I.If)(J,I.H`voccluded == 1.0`,I.H`false`)});`)}return t}function D(e){return e.outlineColor[3]>0&&e.outlineSize>0}function B(e){return e.textureIsSignedDistanceField?(t=e.anchorPosition,r=e.distanceFieldBoundingBox,i=j,(0,n.hZ)(i,t[0]*(r[2]-r[0])+r[0],t[1]*(r[3]-r[1])+r[1])):(0,n.C)(j,e.anchorPosition),j;var t,r,i}const j=(0,i.vt)(),V=32e3,U=I.H.float(V),k=Object.freeze(Object.defineProperty({__proto__:null,build:F,calculateAnchorPosition:B,fullUV:V,shaderSettings:z},Symbol.toStringTag,{value:"Module"}))},13755:(e,t,r)=>{r.d(t,{y:()=>c});var n,i=r(47522);!function(e){e[e.Occluded=0]="Occluded",e[e.NotOccluded=1]="NotOccluded",e[e.Both=2]="Both",e[e.COUNT=3]="COUNT"}(n||(n={}));var s=r(14314),a=r(33094),o=r(31821),l=r(12791);function c(e){e.vertex.uniforms.add(new a.U("renderTransparentlyOccludedHUD",(e=>e.hudRenderStyle===n.Occluded?1:e.hudRenderStyle===n.NotOccluded?0:.75)),new s.I("viewport",(e=>e.camera.fullViewport)),new l.x("hudVisibilityTexture",(e=>e.hudVisibility?.getTexture()))),e.vertex.include(i.K),e.vertex.code.add(o.H`bool testHUDVisibility(vec4 posProj) {
169
169
  vec4 posProjCenter = alignToPixelCenter(posProj, viewport.zw);
170
170
  vec4 occlusionPixel = texture(hudVisibilityTexture, .5 + .5 * posProjCenter.xy / posProjCenter.w);
171
171
  if (renderTransparentlyOccludedHUD > 0.5) {
@@ -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.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}}]);
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 U=r(80893);class k{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 k(e,o,n)}async _fetchPage(e,t,r){const n=e.clone();n.start=t*this._pageSize;const i=(await(0,U.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 Ue=r(53466),ke=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=Ue.I.None,this.emissionSource=ke.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,materialId:n,parameters:e.parameters};break;case"hud":i=new Ge(r,this.globalViewingMode),s={type:t,materialId:n,parameters:e.parameters}}return this._bufferWriters.set(n,i.createBufferWriter()),await this._mainThreadDelegate.createMaterial(s),n}updateMaterial(e){return{commands:[{...e,id:"update-material"}],transferList:[]}}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),Ut=r(72385),kt=(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,Ut.fA)(-.5,0,-.5),$t=(0,Ut.fA)(.5,0,-.5),Yt=(0,Ut.fA)(0,0,.5),Wt=(0,Ut.fA)(0,.5,0),Xt=(0,Ut.vt)(),Zt=(0,Ut.vt)(),Qt=(0,Ut.vt)(),Jt=(0,Ut.vt)(),Kt=(0,Ut.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,Ut.fA)(0,a,0),d=(0,Ut.fA)(0,a+l,0),u=(0,Ut.fA)(0,-1,0),h=(0,Ut.fA)(0,1,0);n&&(a=l,d=(0,Ut.fA)(0,0,0),c=(0,Ut.fA)(0,a,0),u=(0,Ut.fA)(0,1,0),h=(0,Ut.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,Ut.fA)(Math.cos(t)*o,a,Math.sin(t)*o);f.push(n);const i=(0,Ut.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,Ut.fA)(Math.cos(t)*o,a,Math.sin(t)*o);f.push(n);const i=(0,Ut.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,kt.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,kt.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",this._primitiveMaterialId=null}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._primitiveMaterialId=r,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 createUpdateLayerOpacityCommand(e){const{_context:t}=this,r=t.renderCommandContext,n=this._primitiveMaterialId;return null==n?r.createRenderCommandBuffer():r.updateMaterial({type:"default",materialId:n,parameters:{opacity:e}})}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 createUpdateLayerOpacityCommand(e){const{_context:t}=this;return t.renderCommandContext.createRenderCommandBuffer()}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 createUpdateLayerOpacityCommand(e){const t=this._context.renderCommandContext,r=[];for(let t=0;t<this._symbols.length;++t){const n=this._symbols[t];null!=n&&n.loaded&&r.push(n.createUpdateLayerOpacityCommand(e))}const n=await Promise.all(r);return new It(t,t.mergeRenderCommandBuffers(n),[])}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 Ur(e){return"point"===e.type}class kr{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 Ur(e)?(0,Tr.g)(e,t,this.spatialReference):(0,Ot.F)(e,t,r,this.spatialReference)}fromRenderCoords(e,t,r=null){return Ur(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 kr(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 kr(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:kr.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 onLayerOpacityChange(e){const t=await this._renderer.createUpdateLayerOpacityCommand(e);return await t.execute(),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([[5902],{63907:(_,E,R)=>{var A,T,N,S,I,C,O,e,G,D,t,n,L,B,P,M,U,F,r,a,i,c,u,o,s,l,f;R.d(E,{Ab:()=>M,Ac:()=>e,Ap:()=>B,CQ:()=>d,Cj:()=>n,Fq:()=>V,H0:()=>U,H3:()=>P,Hr:()=>f,MT:()=>D,NV:()=>A,SB:()=>a,Tb:()=>I,WR:()=>N,Xo:()=>i,Y7:()=>O,bh:()=>x,dn:()=>S,eA:()=>t,iE:()=>r,j7:()=>F,ld:()=>c,nI:()=>Y,pF:()=>L,pe:()=>G,r6:()=>H,vt:()=>l,yI:()=>X}),function(_){_[_.DEPTH=256]="DEPTH",_[_.STENCIL=1024]="STENCIL",_[_.COLOR=16384]="COLOR"}(A||(A={})),function(_){_[_.COLOR=6144]="COLOR",_[_.DEPTH=6145]="DEPTH",_[_.STENCIL=6146]="STENCIL",_[_.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(T||(T={})),function(_){_[_.POINTS=0]="POINTS",_[_.LINES=1]="LINES",_[_.LINE_LOOP=2]="LINE_LOOP",_[_.LINE_STRIP=3]="LINE_STRIP",_[_.TRIANGLES=4]="TRIANGLES",_[_.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",_[_.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(N||(N={})),function(_){_[_.ZERO=0]="ZERO",_[_.ONE=1]="ONE",_[_.SRC_COLOR=768]="SRC_COLOR",_[_.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",_[_.SRC_ALPHA=770]="SRC_ALPHA",_[_.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",_[_.DST_ALPHA=772]="DST_ALPHA",_[_.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",_[_.DST_COLOR=774]="DST_COLOR",_[_.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",_[_.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",_[_.CONSTANT_COLOR=32769]="CONSTANT_COLOR",_[_.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",_[_.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",_[_.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(S||(S={})),function(_){_[_.ADD=32774]="ADD",_[_.MIN=32775]="MIN",_[_.MAX=32776]="MAX",_[_.SUBTRACT=32778]="SUBTRACT",_[_.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(I||(I={})),function(_){_[_.ARRAY_BUFFER=34962]="ARRAY_BUFFER",_[_.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",_[_.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",_[_.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",_[_.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",_[_.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",_[_.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",_[_.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER"}(C||(C={})),function(_){_[_.FRONT=1028]="FRONT",_[_.BACK=1029]="BACK",_[_.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(O||(O={})),function(_){_[_.CW=2304]="CW",_[_.CCW=2305]="CCW"}(e||(e={})),function(_){_[_.BYTE=5120]="BYTE",_[_.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",_[_.SHORT=5122]="SHORT",_[_.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",_[_.INT=5124]="INT",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.FLOAT=5126]="FLOAT",_[_.HALF_FLOAT=5131]="HALF_FLOAT"}(G||(G={})),function(_){_[_.NEVER=512]="NEVER",_[_.LESS=513]="LESS",_[_.EQUAL=514]="EQUAL",_[_.LEQUAL=515]="LEQUAL",_[_.GREATER=516]="GREATER",_[_.NOTEQUAL=517]="NOTEQUAL",_[_.GEQUAL=518]="GEQUAL",_[_.ALWAYS=519]="ALWAYS"}(D||(D={})),function(_){_[_.ZERO=0]="ZERO",_[_.KEEP=7680]="KEEP",_[_.REPLACE=7681]="REPLACE",_[_.INCR=7682]="INCR",_[_.DECR=7683]="DECR",_[_.INVERT=5386]="INVERT",_[_.INCR_WRAP=34055]="INCR_WRAP",_[_.DECR_WRAP=34056]="DECR_WRAP"}(t||(t={})),function(_){_[_.NEAREST=9728]="NEAREST",_[_.LINEAR=9729]="LINEAR",_[_.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",_[_.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",_[_.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",_[_.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(n||(n={})),function(_){_[_.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",_[_.REPEAT=10497]="REPEAT",_[_.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(L||(L={})),function(_){_[_.TEXTURE_2D=3553]="TEXTURE_2D",_[_.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",_[_.TEXTURE_3D=32879]="TEXTURE_3D",_[_.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",_[_.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",_[_.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",_[_.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",_[_.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",_[_.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",_[_.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(B||(B={})),function(_){_[_.MIN_LOD=33082]="MIN_LOD",_[_.MAX_LOD=33083]="MAX_LOD",_[_.BASE_LEVEL=33084]="BASE_LEVEL",_[_.MAX_LEVEL=33085]="MAX_LEVEL",_[_.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE"}(P||(P={})),function(_){_[_.ALPHA=6406]="ALPHA",_[_.RGB=6407]="RGB",_[_.RGBA=6408]="RGBA",_[_.LUMINANCE=6409]="LUMINANCE",_[_.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",_[_.RED=6403]="RED",_[_.RG=33319]="RG",_[_.RED_INTEGER=36244]="RED_INTEGER",_[_.RG_INTEGER=33320]="RG_INTEGER",_[_.RGB_INTEGER=36248]="RGB_INTEGER",_[_.RGBA_INTEGER=36249]="RGBA_INTEGER"}(M||(M={})),function(_){_[_.RGBA4=32854]="RGBA4",_[_.R16F=33325]="R16F",_[_.RG16F=33327]="RG16F",_[_.RGB32F=34837]="RGB32F",_[_.RGBA16F=34842]="RGBA16F",_[_.R32F=33326]="R32F",_[_.RG32F=33328]="RG32F",_[_.RGBA32F=34836]="RGBA32F",_[_.R11F_G11F_B10F=35898]="R11F_G11F_B10F",_[_.RGB8=32849]="RGB8",_[_.RGBA8=32856]="RGBA8",_[_.RGB5_A1=32855]="RGB5_A1",_[_.R8=33321]="R8",_[_.RG8=33323]="RG8",_[_.R8I=33329]="R8I",_[_.R8UI=33330]="R8UI",_[_.R16I=33331]="R16I",_[_.R16UI=33332]="R16UI",_[_.R32I=33333]="R32I",_[_.R32UI=33334]="R32UI",_[_.RG8I=33335]="RG8I",_[_.RG8UI=33336]="RG8UI",_[_.RG16I=33337]="RG16I",_[_.RG16UI=33338]="RG16UI",_[_.RG32I=33339]="RG32I",_[_.RG32UI=33340]="RG32UI",_[_.RGB16F=34843]="RGB16F",_[_.RGB9_E5=35901]="RGB9_E5",_[_.SRGB8=35905]="SRGB8",_[_.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",_[_.RGB565=36194]="RGB565",_[_.RGBA32UI=36208]="RGBA32UI",_[_.RGB32UI=36209]="RGB32UI",_[_.RGBA16UI=36214]="RGBA16UI",_[_.RGB16UI=36215]="RGB16UI",_[_.RGBA8UI=36220]="RGBA8UI",_[_.RGB8UI=36221]="RGB8UI",_[_.RGBA32I=36226]="RGBA32I",_[_.RGB32I=36227]="RGB32I",_[_.RGBA16I=36232]="RGBA16I",_[_.RGB16I=36233]="RGB16I",_[_.RGBA8I=36238]="RGBA8I",_[_.RGB8I=36239]="RGB8I",_[_.R8_SNORM=36756]="R8_SNORM",_[_.RG8_SNORM=36757]="RG8_SNORM",_[_.RGB8_SNORM=36758]="RGB8_SNORM",_[_.RGBA8_SNORM=36759]="RGBA8_SNORM",_[_.RGB10_A2=32857]="RGB10_A2",_[_.RGB10_A2UI=36975]="RGB10_A2UI"}(U||(U={})),function(_){_[_.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",_[_.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(F||(F={})),function(_){_[_.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",_[_.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(r||(r={})),function(_){_[_.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",_[_.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",_[_.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F"}(a||(a={})),function(_){_[_.STENCIL_INDEX8=36168]="STENCIL_INDEX8"}(i||(i={})),function(_){_[_.FLOAT=5126]="FLOAT",_[_.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",_[_.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",_[_.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",_[_.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",_[_.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",_[_.BYTE=5120]="BYTE",_[_.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",_[_.SHORT=5122]="SHORT",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.INT=5124]="INT",_[_.HALF_FLOAT=5131]="HALF_FLOAT",_[_.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",_[_.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",_[_.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",_[_.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(c||(c={})),function(_){_[_.STATIC_DRAW=35044]="STATIC_DRAW",_[_.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",_[_.STREAM_DRAW=35040]="STREAM_DRAW",_[_.STATIC_READ=35045]="STATIC_READ",_[_.DYNAMIC_READ=35049]="DYNAMIC_READ",_[_.STREAM_READ=35041]="STREAM_READ",_[_.STATIC_COPY=35046]="STATIC_COPY",_[_.DYNAMIC_COPY=35050]="DYNAMIC_COPY",_[_.STREAM_COPY=35042]="STREAM_COPY"}(u||(u={})),function(_){_[_.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",_[_.VERTEX_SHADER=35633]="VERTEX_SHADER"}(o||(o={})),function(_){_[_.FRAMEBUFFER=36160]="FRAMEBUFFER",_[_.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",_[_.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(s||(s={})),function(_){_[_.Texture=0]="Texture",_[_.TileTexture=1]="TileTexture",_[_.BufferObject=2]="BufferObject",_[_.VertexArrayObject=3]="VertexArrayObject",_[_.Shader=4]="Shader",_[_.Program=5]="Program",_[_.FramebufferObject=6]="FramebufferObject",_[_.Renderbuffer=7]="Renderbuffer",_[_.TransformFeedback=8]="TransformFeedback",_[_.Sync=9]="Sync",_[_.UNCOUNTED=10]="UNCOUNTED",_[_.LinesOfCode=10]="LinesOfCode",_[_.Uniform=11]="Uniform",_[_.COUNT=12]="COUNT"}(l||(l={})),function(_){_[_.NONE=0]="NONE",_[_.BACK=1029]="BACK"}(f||(f={}));const H=36064,X=36065,V=36066,Y=33306;var d,h,p,m,w,y,b,x,W;!function(_){_[_.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",_[_.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",_[_.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",_[_.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",_[_.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",_[_.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",_[_.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",_[_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",_[_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",_[_.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",_[_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"}(d||(d={})),function(_){_[_.FLOAT=5126]="FLOAT",_[_.FLOAT_VEC2=35664]="FLOAT_VEC2",_[_.FLOAT_VEC3=35665]="FLOAT_VEC3",_[_.FLOAT_VEC4=35666]="FLOAT_VEC4",_[_.INT=5124]="INT",_[_.INT_VEC2=35667]="INT_VEC2",_[_.INT_VEC3=35668]="INT_VEC3",_[_.INT_VEC4=35669]="INT_VEC4",_[_.BOOL=35670]="BOOL",_[_.BOOL_VEC2=35671]="BOOL_VEC2",_[_.BOOL_VEC3=35672]="BOOL_VEC3",_[_.BOOL_VEC4=35673]="BOOL_VEC4",_[_.FLOAT_MAT2=35674]="FLOAT_MAT2",_[_.FLOAT_MAT3=35675]="FLOAT_MAT3",_[_.FLOAT_MAT4=35676]="FLOAT_MAT4",_[_.SAMPLER_2D=35678]="SAMPLER_2D",_[_.SAMPLER_CUBE=35680]="SAMPLER_CUBE",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",_[_.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",_[_.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",_[_.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",_[_.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",_[_.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",_[_.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",_[_.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",_[_.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",_[_.SAMPLER_3D=35679]="SAMPLER_3D",_[_.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",_[_.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",_[_.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",_[_.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",_[_.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",_[_.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",_[_.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",_[_.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",_[_.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",_[_.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",_[_.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",_[_.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(h||(h={})),function(_){_[_.OBJECT_TYPE=37138]="OBJECT_TYPE",_[_.SYNC_CONDITION=37139]="SYNC_CONDITION",_[_.SYNC_STATUS=37140]="SYNC_STATUS",_[_.SYNC_FLAGS=37141]="SYNC_FLAGS"}(p||(p={})),function(_){_[_.UNSIGNALED=37144]="UNSIGNALED",_[_.SIGNALED=37145]="SIGNALED"}(m||(m={})),function(_){_[_.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",_[_.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",_[_.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",_[_.WAIT_FAILED=37149]="WAIT_FAILED"}(w||(w={})),function(_){_[_.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(y||(y={})),function(_){_[_.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}(b||(b={})),function(_){_[_.INVALID_ENUM=1280]="INVALID_ENUM",_[_.INVALID_VALUE=1281]="INVALID_VALUE",_[_.INVALID_OPERATION=1282]="INVALID_OPERATION",_[_.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",_[_.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",_[_.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL"}(x||(x={})),function(_){_[_.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR"}(W||(W={}))},92993:(_,E,R)=>{var A;R.d(E,{n:()=>A}),function(_){_[_.ETC1_RGB=0]="ETC1_RGB",_[_.ETC2_RGBA=1]="ETC2_RGBA",_[_.BC1_RGB=2]="BC1_RGB",_[_.BC3_RGBA=3]="BC3_RGBA",_[_.BC4_R=4]="BC4_R",_[_.BC5_RG=5]="BC5_RG",_[_.BC7_M6_RGB=6]="BC7_M6_RGB",_[_.BC7_M5_RGBA=7]="BC7_M5_RGBA",_[_.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",_[_.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",_[_.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",_[_.ATC_RGB=11]="ATC_RGB",_[_.ATC_RGBA=12]="ATC_RGBA",_[_.FXT1_RGB=17]="FXT1_RGB",_[_.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",_[_.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",_[_.ETC2_EAC_R11=20]="ETC2_EAC_R11",_[_.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",_[_.RGBA32=13]="RGBA32",_[_.RGB565=14]="RGB565",_[_.BGR565=15]="BGR565",_[_.RGBA4444=16]="RGBA4444"}(A||(A={}))},95902:(_,E,R)=>{R.r(E),R.d(E,{TextureCompressionWorkerOutput:()=>D,compress:()=>t,compressRGBADataToKTX2:()=>B,createTextureDataKTX2:()=>P,initializeBasisEncoder:()=>n,initializeDXTEncoder:()=>L});var A=R(2741);let T;var N=R(92993);let S;var I=R(63907);let C,O,e=null,G=null;class D{constructor(_,E){this.internalFormat=_,this.compressedTexture=E}}async function t(_){let E=function(_){const E=new OffscreenCanvas(_.width,_.height),R=E.getContext("2d");return R.drawImage(_,0,0),R.getImageData(0,0,E.width,E.height).data}(_.data);if(_.hasS3TC){G||await L();const R=new Uint8Array(E.length);if(G?.encode(E,_.width,_.height,_.premultiplyAlpha,R)){const _=function(_){const E=new Int32Array(_.buffer,_.byteOffset,M);let R,A;switch(E[c]){case s:R=8,A=I.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case l:R=16,A=I.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case f:R=16,A=I.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}let T=1,N=E[a],S=E[r];(3&N||3&S)&&(N=N+3&-4,S=S+3&-4);const C=N,O=S;let e,G;E[F]&u&&(T=Math.max(1,E[i]));let D=_.byteOffset+E[U]+4;const t=[];for(let E=0;E<T;++E)G=(N+3>>2)*(S+3>>2)*R,e=new Uint8Array(_.buffer,D,G),t.push(e),D+=G,N=Math.max(1,N>>1),S=Math.max(1,S>>1);return{textureData:{type:"compressed",levels:t},internalFormat:A,width:C,height:O}}(R),E=[R.buffer];return{result:new D(_?.internalFormat??null,_?.textureData??null),transferList:E}}return{result:new D(null,null)}}if(_.hasETC){if(e||await n(),_.premultiplyAlpha&&!G&&await L(),_.premultiplyAlpha){const R=new Uint8ClampedArray(E.length);G?.premultiply(new Uint8Array(E),_.width,_.height,R),E=R}const R=await B(E,_.width,_.height,_.hasMipmap),A=R?await P(R):null,T=A?.compressedTexture?.levels.map((_=>_.buffer))||[];return{result:new D(A?.internalFormat??null,A?.compressedTexture??null),transferList:T}}return{result:new D(null,null)}}async function n(){e||(e=await(C??=(T??=(async()=>{const _=await R.e(2372).then(R.bind(R,62372)),E=await _.default({locateFile:_=>(0,A.s)(`esri/libs/basisu/${_}`)});return E.initializeBasis(),E})(),T)))}async function L(){G||(G=await(O??=(S??=(async()=>{const _=await R.e(8714).then(R.bind(R,98714));return await _.default({locateFile:_=>(0,A.s)(`esri/libs/dxtEncoder/${_}`)})})(),S)))}async function B(_,E,R,A,T=255,N=0,S=!1,I=!1){if(!e)return null;const C=new e.BasisEncoder;C.setPerceptual(!I),C.setCheckForAlpha(!0),C.setForceAlpha(!1),C.setRenormalize(I),C.setMipGen(A),C.setMipSRGB(!I),C.setCreateKTX2File(!0),C.setKTX2SRGBTransferFunc(!I),C.setQualityLevel(T),C.setCompressionLevel(N);const O=new Uint8Array(_.byteLength);C.setSliceSourceImage(0,new Uint8Array(_),E,R,S);const G=C.encode(O),D=new Uint8Array(O.buffer,0,G),t=new e.KTX2File(new Uint8Array(D));return t.isValid()?(C.delete(),D):(t.close(),t.delete(),C.delete(),null)}async function P(_){if(!e)return new D(null,null);const E=new e.KTX2File(new Uint8Array(_));E.startTranscoding();const[R,A]=E.getHasAlpha()?[N.n.ETC2_RGBA,I.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[N.n.ETC1_RGB,I.CQ.COMPRESSED_RGB8_ETC2],T=E.getLevels(),S=[];for(let _=0;_<T;_++)S.push(new Uint8Array(E.getImageTranscodedSizeInBytes(_,0,0,R))),E.transcodeImage(S[_],_,0,0,R,0,-1,-1);return E.close(),E.delete(),{internalFormat:A,compressedTexture:{type:"compressed",levels:S}}}const M=31,U=1,F=2,r=3,a=4,i=7,c=21,u=131072;function o(_){return _.charCodeAt(0)+(_.charCodeAt(1)<<8)+(_.charCodeAt(2)<<16)+(_.charCodeAt(3)<<24)}const s=o("DXT1"),l=o("DXT3"),f=o("DXT5")}}]);