@arcgis/core 4.25.0-next.20220718 → 4.25.0-next.20220721

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 (284) hide show
  1. package/Camera.js +1 -1
  2. package/analysis/DimensioningAnalysis.js +1 -1
  3. package/analysis/LineOfSightAnalysis.js +1 -1
  4. package/analysis/SliceAnalysis.js +1 -1
  5. package/arcade/featureset/support/RecentlyUsedCache.js +1 -1
  6. package/arcade/functions/featuresetgeom.js +1 -1
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/1751de504354d98ac3fd.js +1 -0
  9. package/assets/esri/core/workers/chunks/1f4f1896880bfa6801c5.js +1 -0
  10. package/assets/esri/core/workers/chunks/290cd411d0d18b1d0efd.js +1 -0
  11. package/assets/esri/core/workers/chunks/{ab3bd5fecdb97f2d690e.js → 3b5be512567d9c1c6fe6.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{c3236a7058e64ea3b939.js → 3c9da9b88777700879aa.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{f96e8724ae3458f5e262.js → 4a7aa1b9de61eb013647.js} +1 -1
  14. package/assets/esri/core/workers/chunks/4cb64ccb5fba126f9a66.js +1 -0
  15. package/assets/esri/core/workers/chunks/{68f19e58aae01791944e.js → 579ba109718bc2554008.js} +1 -1
  16. package/assets/esri/core/workers/chunks/59845b02b07a8ed7ce81.js +1 -0
  17. package/assets/esri/core/workers/chunks/{c705f907ce60a646d9aa.js → 652d36523efbe5c9ebb2.js} +1 -1
  18. package/assets/esri/core/workers/chunks/888d8e4471c9a2cd5009.js +1 -0
  19. package/assets/esri/core/workers/chunks/9493a8e5d6001b6bf275.js +1 -0
  20. package/assets/esri/core/workers/chunks/9d824cdfbcdf3cb3246f.js +1 -0
  21. package/assets/esri/core/workers/chunks/bf348f6f52701fa6016e.js +987 -0
  22. package/assets/esri/core/workers/chunks/d02881954c0cc0d39dfb.js +1 -0
  23. package/assets/esri/core/workers/chunks/{1ecbf642debc2207b762.js → da54483123f377e9b3e1.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{61b71b8e028eda10ccab.js → e4ad2cf5d6bded02e392.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{3bfab05ae07ac18a75fe.js → f298a70f3b6f27675d53.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{d499cce61c1c5c367380.js → f40290cfad3fe6fb4ef9.js} +1 -1
  27. package/assets/esri/layers/support/rasterFormats/lerc-wasm.wasm +0 -0
  28. package/assets/esri/themes/base/widgets/_Tooltip.scss +1 -1
  29. package/assets/esri/themes/dark/main.css +1 -1
  30. package/assets/esri/themes/light/main.css +1 -1
  31. package/assets/esri/themes/light/view.css +1 -1
  32. package/chunks/ComponentShader.glsl.js +39 -33
  33. package/chunks/Laserlines.glsl.js +4 -4
  34. package/chunks/Precipitation.glsl.js +2 -2
  35. package/chunks/RibbonLine.glsl.js +46 -44
  36. package/chunks/Stars.glsl.js +2 -2
  37. package/chunks/Terrain.glsl.js +25 -17
  38. package/chunks/boundedPlane.js +1 -1
  39. package/chunks/lerc-wasm.js +1 -1
  40. package/chunks/mat2d.js +1 -1
  41. package/chunks/quatf32.js +1 -1
  42. package/core/BidiEngine.js +1 -1
  43. package/core/accessorSupport/watch.js +1 -1
  44. package/core/libs/gl-matrix-2/factories/quatf32.js +1 -1
  45. package/core/libs/gl-matrix-2/math/mat2d.js +1 -1
  46. package/core/perspectiveUtils.js +1 -1
  47. package/core/promiseUtils.js +1 -1
  48. package/core/reactiveUtils.js +1 -1
  49. package/core/unitUtils.js +1 -1
  50. package/geometry/projection.js +1 -1
  51. package/geometry/projectionEllipsoid.js +1 -1
  52. package/geometry/support/MeshTexture.js +1 -1
  53. package/geometry/support/axisAngleDegrees.js +1 -1
  54. package/geometry/support/coordinateSystem.js +1 -1
  55. package/geometry/support/geodesicUtils.js +1 -1
  56. package/geometry/support/meshUtils/exporters/gltf/index.js +1 -1
  57. package/geometry/support/meshUtils/loadExternal.js +1 -1
  58. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  59. package/geometry/support/scaleUtils.js +1 -1
  60. package/geometry/support/spatialReferenceUtils.js +1 -1
  61. package/identity/IdentityManagerBase.js +1 -1
  62. package/identity/IdentityModal.js +1 -1
  63. package/interfaces.d.ts +3 -33
  64. package/layers/FeatureLayer.js +1 -1
  65. package/layers/effects/parser.js +1 -1
  66. package/layers/graphics/hydratedFeatures.js +1 -1
  67. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  68. package/layers/mixins/ArcGISImageService.js +1 -1
  69. package/layers/ogc/wfsUtils.js +1 -1
  70. package/layers/support/ContingentValue.js +1 -1
  71. package/layers/support/ElevationQuery.js +1 -1
  72. package/layers/support/PixelBlock.js +1 -1
  73. package/layers/support/kmlUtils.js +1 -1
  74. package/layers/support/rasterDatasets/CloudRaster.js +1 -1
  75. package/layers/support/rasterDatasets/EphemeralBlockCache.js +1 -1
  76. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  77. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  78. package/layers/support/rasterFormats/ImageCanvasDecoder.js +1 -1
  79. package/layers/support/rasterFormats/JpgPlus.js +1 -1
  80. package/layers/support/rasterFormats/Lerc.js +1 -1
  81. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  82. package/layers/support/rasterFormats/Raw.js +1 -1
  83. package/layers/support/rasterFormats/TiffTags.js +1 -1
  84. package/layers/support/rasterFunctions/vectorFieldUtils.js +1 -1
  85. package/layers/support/vectorTileLayerLoader.js +1 -1
  86. package/layers/support/wmtsUtils.js +1 -1
  87. package/package.json +1 -1
  88. package/renderers/RasterShadedReliefRenderer.js +1 -1
  89. package/renderers/RasterStretchRenderer.js +1 -1
  90. package/renderers/UniqueValueRenderer.js +1 -1
  91. package/renderers/support/AuthoringInfo.js +1 -1
  92. package/renderers/support/RasterSymbolizer.js +1 -1
  93. package/rest/query/operations/query.js +1 -1
  94. package/rest/query/operations/queryTopFeatures.js +1 -1
  95. package/rest/support/DirectionsFeatureSet.js +1 -1
  96. package/rest/support/ImageHistogramParameters.js +1 -1
  97. package/rest/support/ImageSampleParameters.js +1 -1
  98. package/smartMapping/labels/clusters.js +1 -1
  99. package/smartMapping/renderers/relationship.js +1 -1
  100. package/smartMapping/support/adapters/support/utils.js +1 -1
  101. package/support/basemapUtils.js +1 -1
  102. package/support/revision.js +1 -1
  103. package/symbols/LabelSymbol3D.js +1 -1
  104. package/symbols/PointSymbol3D.js +1 -1
  105. package/symbols/cim/CIMCursor.js +1 -1
  106. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  107. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  108. package/symbols/support/previewSymbol3D.js +1 -1
  109. package/symbols/support/webStyleSymbolUtils.js +1 -1
  110. package/views/2d/ViewState.js +1 -1
  111. package/views/2d/engine/vectorTiles/Feature.js +1 -1
  112. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  113. package/views/2d/engine/webgl/SDFConverter.js +1 -1
  114. package/views/2d/engine/webgl/TurboLine.js +1 -1
  115. package/views/2d/engine/webgl/brushes/BrushClip.js +1 -1
  116. package/views/2d/engine/webgl/brushes/BrushOverlay.js +1 -1
  117. package/views/2d/engine/webgl/brushes/WGLGeometryBrushLabel.js +1 -1
  118. package/views/2d/engine/webgl/brushes/WGLGeometryBrushLine.js +1 -1
  119. package/views/2d/engine/webgl/brushes/WGLGeometryBrushText.js +1 -1
  120. package/views/2d/engine/webgl/collisions/MetricReader.js +1 -1
  121. package/views/2d/engine/webgl/cpuMapped/DisplayRecordReader.js +1 -1
  122. package/views/2d/engine/webgl/cpuMapped/FreeList.js +1 -1
  123. package/views/2d/engine/webgl/mesh/heuristics.js +1 -1
  124. package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
  125. package/views/2d/engine/webgl/mesh/templates/WGLDynamicLineTemplate.js +1 -1
  126. package/views/2d/engine/webgl/mesh/templates/WGLDynamicMarkerTemplate.js +1 -1
  127. package/views/2d/engine/webgl/mesh/templates/WGLDynamicTextTemplate.js +1 -1
  128. package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
  129. package/views/2d/engine/webgl/mesh/templates/WGLLineTemplate.js +1 -1
  130. package/views/2d/engine/webgl/mesh/templates/WGLMarkerTemplate.js +1 -1
  131. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  132. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  133. package/views/2d/input/MapViewInputManager.js +1 -1
  134. package/views/2d/layers/features/createSymbolSchema.js +1 -1
  135. package/views/2d/viewpointUtils.js +1 -1
  136. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  137. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  138. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  139. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  140. package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
  141. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  142. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  143. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  144. package/views/3d/camera/constraintUtils/distance.js +1 -1
  145. package/views/3d/environment/ChapmanAtmosphereTechniqueConfiguration.js +1 -1
  146. package/views/3d/environment/CloudsComposition.js +1 -1
  147. package/views/3d/environment/FogTechnique.js +1 -1
  148. package/views/3d/glTF/internal/Resource.js +1 -1
  149. package/views/3d/input/SceneInputManager.js +1 -1
  150. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  151. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  152. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  153. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  154. package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
  155. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateObjectSymbol3DAdapter.js +1 -1
  156. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  157. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  158. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  159. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  160. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  161. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  162. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  163. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  164. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  165. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  166. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  167. package/views/3d/layers/graphics/lineUtils.js +1 -1
  168. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  169. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  170. package/views/3d/layers/i3s/IDBCache.js +1 -1
  171. package/views/3d/layers/i3s/IDBMockCache.js +1 -1
  172. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  173. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  174. package/views/3d/state/ViewState.js +1 -1
  175. package/views/3d/support/cameraUtils.js +1 -1
  176. package/views/3d/support/orientedBoundingBox.js +1 -1
  177. package/views/3d/support/viewpointUtils.js +1 -1
  178. package/views/3d/terrain/Overlay.js +1 -1
  179. package/views/3d/terrain/OverlayRenderTarget.js +1 -1
  180. package/views/3d/terrain/OverlayRenderer.js +1 -1
  181. package/views/3d/terrain/TerrainRenderer.js +1 -1
  182. package/views/3d/terrain/TerrainSurface.js +1 -1
  183. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  184. package/views/3d/terrain/interfaces.js +1 -1
  185. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  186. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  187. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  188. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  189. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  190. package/views/3d/webgl-engine/collections/Component/RenderGeometry.js +1 -1
  191. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  192. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  193. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  194. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +2 -2
  195. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
  196. package/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js +9 -0
  197. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +18 -17
  198. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  199. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  200. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  201. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +5 -0
  202. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  203. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  204. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  205. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  206. package/views/3d/webgl-engine/lib/TextureTechniqueConfiguration.js +1 -1
  207. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  208. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  209. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  210. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  211. package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
  212. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  213. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  214. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  215. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  216. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  217. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  218. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  219. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  220. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  221. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  222. package/views/3d/webgl-engine/shaders/LaserlinePathTechniqueConfiguration.js +1 -1
  223. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  224. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  225. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  226. package/views/DOMContainer.js +1 -1
  227. package/views/MapView.js +1 -1
  228. package/views/SceneView.js +1 -1
  229. package/views/View.js +1 -1
  230. package/views/analysis/analysisViewUtils.js +1 -1
  231. package/views/animation/pointToPoint/apex/planning.js +1 -1
  232. package/views/draw/PolygonDrawAction.js +1 -1
  233. package/views/draw/PolylineDrawAction.js +1 -1
  234. package/views/draw/support/createUtils.js +1 -1
  235. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  236. package/views/input/InputManager.js +1 -1
  237. package/views/input/handlers/LatestPointer.js +1 -1
  238. package/views/input/handlers/MultiTouch.js +5 -0
  239. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  240. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  241. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileCache.js +1 -1
  242. package/views/interactive/tooltip/Tooltip.js +1 -1
  243. package/views/interactive/tooltip/support/measurements.js +1 -1
  244. package/views/layers/GroupLayerView.js +1 -1
  245. package/views/navigation/FilteredFiniteDifference.js +1 -1
  246. package/views/navigation/MomentumEstimator.js +1 -1
  247. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  248. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  249. package/views/navigation/RotationMomentumEstimator.js +1 -1
  250. package/views/support/GroundViewElevationSampler.js +1 -1
  251. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  252. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  253. package/views/support/screenshotUtils.js +1 -1
  254. package/views/webgl/BufferObject.js +1 -1
  255. package/views/webgl/FramebufferObject.js +1 -1
  256. package/views/webgl/Texture.js +1 -1
  257. package/views/webgl/capabilities/Capabilities.js +1 -1
  258. package/views/webgl/capabilities.js +1 -1
  259. package/views/webgl/renderState.js +1 -1
  260. package/webscene/spec-certification/api.js +1 -1
  261. package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
  262. package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
  263. package/widgets/ElevationProfile/ElevationProfileLineInput.js +1 -1
  264. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  265. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  266. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  267. package/widgets/Expand.js +1 -1
  268. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  269. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  270. package/widgets/Popup/PopupViewModel.js +1 -1
  271. package/widgets/Popup/actionUtils.js +1 -1
  272. package/widgets/ScaleRangeSlider.js +1 -1
  273. package/widgets/Slider/SliderViewModel.js +1 -1
  274. package/widgets/Widget.js +1 -1
  275. package/assets/esri/core/workers/chunks/04ea469cb081e181ca82.js +0 -1
  276. package/assets/esri/core/workers/chunks/16c2626ca47132700519.js +0 -1
  277. package/assets/esri/core/workers/chunks/1e4e5d147263e98536bc.js +0 -1
  278. package/assets/esri/core/workers/chunks/35083def3c658d1ae9ff.js +0 -1
  279. package/assets/esri/core/workers/chunks/40032d2bf404a46b8f80.js +0 -1
  280. package/assets/esri/core/workers/chunks/613e82a3e13442685ac4.js +0 -1
  281. package/assets/esri/core/workers/chunks/64b4f1dbf61439cde801.js +0 -1
  282. package/assets/esri/core/workers/chunks/abd68b7ba3be4696611c.js +0 -1
  283. package/assets/esri/core/workers/chunks/b8a062c0c9c626acf61e.js +0 -982
  284. package/assets/esri/core/workers/chunks/e08686088be0aaca1a99.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2133],{93860:(e,t,r)=>{function n(e,t){const r=e.count;t||(t=new e.TypedArrayConstructor(r));for(let n=0;n<r;n++)t[n]=e.get(n);return t}r.d(t,{m:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,copy:function(e,t,r){const n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride,i=r?r.count:t.count;let u=(r&&r.dstIndex?r.dstIndex:0)*o,c=(r&&r.srcIndex?r.srcIndex:0)*a;for(let e=0;e<i;++e)n[u]=s[c],u+=o,c+=a},makeDense:n},Symbol.toStringTag,{value:"Module"}))},10816:(e,t,r)=>{r.d(t,{f:()=>a,n:()=>s});var n=r(79583);function o(e,t,r){const n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride,i=r?r.count:t.count;let u=(r&&r.dstIndex?r.dstIndex:0)*o,c=(r&&r.srcIndex?r.srcIndex:0)*a;for(let e=0;e<i;++e)n[u]=s[c],n[u+1]=s[c+1],u+=o,c+=a}function s(e,t,r){const s=e.typedBuffer,a=e.typedBufferStride,i=t.typedBuffer,u=t.typedBufferStride,c=r?r.count:t.count;let d=(r&&r.dstIndex?r.dstIndex:0)*a,f=(r&&r.srcIndex?r.srcIndex:0)*u;if((0,n.U)(t.elementType)){const e=(0,n.Op)(t.elementType);if((0,n.B3)(t.elementType))for(let t=0;t<c;++t)s[d]=Math.max(i[f]/e,-1),s[d+1]=Math.max(i[f+1]/e,-1),d+=a,f+=u;else for(let t=0;t<c;++t)s[d]=i[f]/e,s[d+1]=i[f+1]/e,d+=a,f+=u}else o(e,t,r);return e}function a(e,t,r,n){const o=e.typedBuffer,s=e.typedBufferStride,a=n?.count??e.count;let i=(n?.dstIndex??0)*s;for(let e=0;e<a;++e)o[i]=t,o[i+1]=r,i+=s}Object.freeze(Object.defineProperty({__proto__:null,copy:o,normalizeIntegerBuffer:s,fill:a},Symbol.toStringTag,{value:"Module"}))},11077:(e,t,r)=>{r.d(t,{a:()=>i,n:()=>s,s:()=>a,t:()=>o});var n=r(72220);function o(e,t,r){if(e.count!==t.count)return void n.c.error("source and destination buffers need to have the same number of elements");const o=e.count,s=r[0],a=r[1],i=r[2],u=r[3],c=r[4],d=r[5],f=r[6],l=r[7],p=r[8],h=e.typedBuffer,m=e.typedBufferStride,y=t.typedBuffer,_=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*m,r=e*_,n=y[r],o=y[r+1],b=y[r+2],T=y[r+3];h[t]=s*n+u*o+f*b,h[t+1]=a*n+c*o+l*b,h[t+2]=i*n+d*o+p*b,h[t+3]=T}}function s(e,t){const r=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*o,r=e*a,i=s[r],u=s[r+1],c=s[r+2],d=i*i+u*u+c*c;if(d>0){const e=1/Math.sqrt(d);n[t]=e*i,n[t+1]=e*u,n[t+2]=e*c}}}function a(e,t,r){const n=Math.min(e.count,t.count),o=e.typedBuffer,s=e.typedBufferStride,a=t.typedBuffer,i=t.typedBufferStride;for(let e=0;e<n;e++){const t=e*s,n=e*i;o[t]=r*a[n],o[t+1]=r*a[n+1],o[t+2]=r*a[n+2],o[t+3]=r*a[n+3]}}function i(e,t,r){const n=Math.min(e.count,t.count),o=e.typedBuffer,s=e.typedBufferStride,a=t.typedBuffer,i=t.typedBufferStride;for(let e=0;e<n;e++){const t=e*s,n=e*i;o[t]=a[n]>>r,o[t+1]=a[n+1]>>r,o[t+2]=a[n+2]>>r,o[t+3]=a[n+3]>>r}}Object.freeze(Object.defineProperty({__proto__:null,transformMat4:function(e,t,r){if(e.count!==t.count)return void n.c.error("source and destination buffers need to have the same number of elements");const o=e.count,s=r[0],a=r[1],i=r[2],u=r[3],c=r[4],d=r[5],f=r[6],l=r[7],p=r[8],h=r[9],m=r[10],y=r[11],_=r[12],b=r[13],T=r[14],x=r[15],g=e.typedBuffer,w=e.typedBufferStride,S=t.typedBuffer,I=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*w,r=e*I,n=S[r],o=S[r+1],A=S[r+2],O=S[r+3];g[t]=s*n+c*o+p*A+_*O,g[t+1]=a*n+d*o+h*A+b*O,g[t+2]=i*n+f*o+m*A+T*O,g[t+3]=u*n+l*o+y*A+x*O}},transformMat3:o,normalize:s,scale:a,shiftRight:i},Symbol.toStringTag,{value:"Module"}))},75488:(e,t,r)=>{function n(e,t,r){const n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride,i=r?r.count:t.count;let u=(r&&r.dstIndex?r.dstIndex:0)*o,c=(r&&r.srcIndex?r.srcIndex:0)*a;for(let e=0;e<i;++e)n[u]=s[c],n[u+1]=s[c+1],n[u+2]=s[c+2],n[u+3]=s[c+3],u+=o,c+=a}function o(e,t,r,n,o,s){const a=e.typedBuffer,i=e.typedBufferStride,u=s?.count??e.count;let c=(s?.dstIndex??0)*i;for(let e=0;e<u;++e)a[c]=t,a[c+1]=r,a[c+2]=n,a[c+3]=o,c+=i}r.d(t,{c:()=>n,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,copy:n,fill:o},Symbol.toStringTag,{value:"Module"}))},23670:(e,t,r)=>{r.d(t,{G:()=>o});var n=r(20102);class o{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new n.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new o(this.major,this.minor,this._context)}static parse(e,t=""){const[r,s]=e.split("."),a=/^\s*\d+\s*$/;if(!r||!r.match||!r.match(a))throw new n.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!s||!s.match||!s.match(a))throw new n.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const i=parseInt(r,10),u=parseInt(s,10);return new o(i,u,t)}}},8323:(e,t,r)=>{r.d(t,{gS:()=>o});var n=r(79583);function o(e,t){return new e(new ArrayBuffer(t*e.ElementCount*(0,n.n1)(e.ElementType)))}Object.freeze(Object.defineProperty({__proto__:null,copy:function(e,t,r){const n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride,i=r?r.count:t.count;let u=(r&&r.dstIndex?r.dstIndex:0)*o,c=(r&&r.srcIndex?r.srcIndex:0)*a;for(let e=0;e<i;++e){for(let e=0;e<9;++e)n[u+e]=s[c+e];u+=o,c+=a}}},Symbol.toStringTag,{value:"Module"})),Object.freeze(Object.defineProperty({__proto__:null,copy:function(e,t,r){const n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride,i=r?r.count:t.count;let u=(r&&r.dstIndex?r.dstIndex:0)*o,c=(r&&r.srcIndex?r.srcIndex:0)*a;for(let e=0;e<i;++e){for(let e=0;e<16;++e)n[u+e]=s[c+e];u+=o,c+=a}}},Symbol.toStringTag,{value:"Module"})),r(93860),r(10816),r(56067),r(75488)},40270:(e,t,r)=>{r.d(t,{C:()=>c});var n=r(3172),o=r(66643),s=r(20102),a=r(70586),i=r(95330),u=r(17452);class c{constructor(e){this._streamDataRequester=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,u.HK)(e)?((0,i.k_)(t),(0,u.AH)(e)):this._load("binary",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){if((0,a.Wi)(this._streamDataRequester))return(await(0,n.default)(t,{responseType:d[e]})).data;const u=await(0,o.q6)(this._streamDataRequester.request(t,e,r));if(!0===u.ok)return u.value;throw(0,i.r9)(u.error),new s.Z("",`Request for resource failed: ${u.error}`)}}const d={image:"image",binary:"array-buffer",json:"json"}},91911:(e,t,r)=>{r.d(t,{DA:()=>a,jX:()=>i,nh:()=>s});var n=r(1533),o=r(17753);function s(e,t=o.p){return"number"==typeof e?t(e):(0,n.Uc)(e)||(0,n.lq)(e)?new Uint32Array(e):e}function a(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,n=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(n[e++]=t,n[e++]=t+1,n[e++]=t+2):(n[e++]=t+1,n[e++]=t,n[e++]=t+2)}else{let t=0;for(let o=0;o<r;o+=1)if(o%2==0){const r=e[o],s=e[o+1],a=e[o+2];n[t++]=r,n[t++]=s,n[t++]=a}else{const r=e[o+1],s=e[o],a=e[o+2];n[t++]=r,n[t++]=s,n[t++]=a}}return n}function i(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,n=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)n[e++]=0,n[e++]=t+1,n[e++]=t+2;return n}{const t=e[0];let o=e[1],s=0;for(let a=0;a<r;++a){const r=e[a+2];n[s++]=t,n[s++]=o,n[s++]=r,o=r}return n}}},88246:(e,t,r)=>{r.d(t,{z:()=>F});var n,o,s=r(70586),a=r(13598),i=r(20102),u=r(92604),c=r(35371),d=r(74085),f=r(30175),l=r(17452),p=r(23670),h=r(52138),m=r(51305),y=r(94961),_=r(56481),b=r(93860);class T{constructor(e){this._data=e,this._offset4=0,this._dataUint32=new Uint32Array(this._data,0,Math.floor(this._data.byteLength/4))}readUint32(){const e=this._offset4;return this._offset4+=1,this._dataUint32[e]}readUint8Array(e){const t=4*this._offset4;return this._offset4+=e/4,new Uint8Array(this._data,t,e)}remainingBytes(){return this._data.byteLength-4*this._offset4}}!function(e){e.SCALAR="SCALAR",e.VEC2="VEC2",e.VEC3="VEC3",e.VEC4="VEC4",e.MAT2="MAT2",e.MAT3="MAT3",e.MAT4="MAT4"}(n||(n={})),function(e){e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"}(o||(o={}));const x={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1},g={pbrMetallicRoughness:x,emissiveFactor:[0,0,0],alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1},w={ESRI_externalColorMixMode:"tint"},S=(e={})=>{const t={...x,...e.pbrMetallicRoughness},r=function(e){switch(e.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:(0,d.Bg)(e.ESRI_externalColorMixMode),e.ESRI_externalColorMixMode="tint"}return e}({...w,...e.extras});return{...g,...e,pbrMetallicRoughness:t,extras:r}},I={magFilter:c.cw.LINEAR,minFilter:c.cw.LINEAR_MIPMAP_LINEAR,wrapS:c.e8.REPEAT,wrapT:c.e8.REPEAT},A=e=>({...I,...e}),O=1179937895;class E{constructor(e,t,r,n,o){this._context=e,this._errorContext=t,this.uri=r,this.json=n,this._glbBuffer=o,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._baseUri=function(e){let t,r;return e.replace(/^(.*\/)?([^/]*)$/,((e,n,o)=>(t=n||"",r=o||"",""))),{dirPart:t,filePart:r}}(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.errorUnsupportedIf(null==n.scenes,"Scenes must be defined."),t.errorUnsupportedIf(null==n.meshes,"Meshes must be defined"),t.errorUnsupportedIf(null==n.nodes,"Nodes must be defined."),this._computeNodeParents()}static async load(e,t,r,n){if((0,l.HK)(r)){const n=(0,l.sJ)(r);if("model/gltf-binary"!==n.mediaType)try{const o=JSON.parse(n.isBase64?atob(n.data):n.data);return new E(e,t,r,o)}catch{}const o=(0,l.AH)(r);if(E._isGLBData(o))return this._fromGLBData(e,t,r,o)}if(r.endsWith(".gltf")){const o=await e.loadJSON(r,n);return new E(e,t,r,o)}const o=await e.loadBinary(r,n);if(E._isGLBData(o))return this._fromGLBData(e,t,r,o);const s=await e.loadJSON(r,n);return new E(e,t,r,s)}static _isGLBData(e){const t=new T(e);return t.remainingBytes()>=4&&t.readUint32()===O}static async _fromGLBData(e,t,r,n){const o=await E._parseGLBData(t,n);return new E(e,t,r,o.json,o.binaryData)}static async _parseGLBData(e,t){const r=new T(t);e.assert(r.remainingBytes()>=12,"GLB binary data is insufficiently large.");const n=r.readUint32(),o=r.readUint32(),s=r.readUint32();e.assert(n===O,"Magic first 4 bytes do not fit to expected GLB value."),e.assert(t.byteLength>=s,"GLB binary data is smaller than header specifies."),e.errorUnsupportedIf(2!==o,"An unsupported GLB container version was detected. Only version 2 is supported.");let a,i,u=0;for(;r.remainingBytes()>=8;){const t=r.readUint32(),n=r.readUint32();0===u?(e.assert(1313821514===n,"First GLB chunk must be JSON."),e.assert(t>=0,"No JSON data found."),a=await v(r.readUint8Array(t))):1===u?(e.errorUnsupportedIf(5130562!==n,"Second GLB chunk expected to be BIN."),i=r.readUint8Array(t)):e.warnUnsupported("More than 2 GLB chunks detected. Skipping."),u+=1}return a||e.error("No GLB JSON chunk detected."),{json:a,binaryData:i}}async getBuffer(e,t){const r=this.json.buffers[e],n=this._errorContext;if(null==r.uri)return n.assert(null!=this._glbBuffer,"GLB buffer not present"),this._glbBuffer;const o=await this._getBufferLoader(e,t);return n.assert(o.byteLength===r.byteLength,"Buffer byte lengths should match."),o}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const n=this.json.buffers[e],o=this._context.loadBinary(this._resolveUri(n.uri),t).then((e=>new Uint8Array(e)));return this._bufferLoaders.set(e,o),o}async getAccessor(e,t){const r=this._errorContext;r.errorUnsupportedIf(!this.json.accessors,"Accessors missing.");const o=this.json.accessors[e];r.errorUnsupportedIf(null==o?.bufferView,"Some accessor does not specify a bufferView."),r.errorUnsupportedIf(o.type in[n.MAT2,n.MAT3,n.MAT4],`AttributeType ${o.type} is not supported`);const s=this.json.bufferViews[o.bufferView],a=await this.getBuffer(s.buffer,t),i=C[o.type],u=B[o.componentType],c=i*u,d=s.byteStride||c;return{raw:a.buffer,byteStride:d,byteOffset:a.byteOffset+(s.byteOffset||0)+(o.byteOffset||0),entryCount:o.count,isDenselyPacked:d===c,componentCount:i,componentByteSize:u,componentType:o.componentType,min:o.min,max:o.max,normalized:!!o.normalized}}async getIndexData(e,t){if(null==e.indices)return null;const r=await this.getAccessor(e.indices,t);if(r.isDenselyPacked)switch(r.componentType){case c.g.UNSIGNED_BYTE:return new Uint8Array(r.raw,r.byteOffset,r.entryCount);case c.g.UNSIGNED_SHORT:return new Uint16Array(r.raw,r.byteOffset,r.entryCount);case c.g.UNSIGNED_INT:return new Uint32Array(r.raw,r.byteOffset,r.entryCount)}else switch(r.componentType){case c.g.UNSIGNED_BYTE:return(0,b.m)(this._wrapAccessor(_.D_,r));case c.g.UNSIGNED_SHORT:return(0,b.m)(this._wrapAccessor(_.av,r));case c.g.UNSIGNED_INT:return(0,b.m)(this._wrapAccessor(_.Nu,r))}}async getPositionData(e,t){const r=this._errorContext;r.errorUnsupportedIf(null==e.attributes.POSITION,"No POSITION vertex data found.");const n=await this.getAccessor(e.attributes.POSITION,t);return r.errorUnsupportedIf(n.componentType!==c.g.FLOAT,"Expected type FLOAT for POSITION vertex attribute, but found "+M[n.componentType]),r.errorUnsupportedIf(3!==n.componentCount,"POSITION vertex attribute must have 3 components, but found "+n.componentCount.toFixed()),this._wrapAccessor(_.ct,n)}async getNormalData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.NORMAL,"No NORMAL vertex data found.");const n=await this.getAccessor(e.attributes.NORMAL,t);return r.errorUnsupportedIf(n.componentType!==c.g.FLOAT,"Expected type FLOAT for NORMAL vertex attribute, but found "+M[n.componentType]),r.errorUnsupportedIf(3!==n.componentCount,"NORMAL vertex attribute must have 3 components, but found "+n.componentCount.toFixed()),this._wrapAccessor(_.ct,n)}async getTangentData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TANGENT,"No TANGENT vertex data found.");const n=await this.getAccessor(e.attributes.TANGENT,t);return r.errorUnsupportedIf(n.componentType!==c.g.FLOAT,"Expected type FLOAT for TANGENT vertex attribute, but found "+M[n.componentType]),r.errorUnsupportedIf(4!==n.componentCount,"TANGENT vertex attribute must have 4 components, but found "+n.componentCount.toFixed()),new _.ek(n.raw,n.byteOffset,n.byteStride,n.byteOffset+n.byteStride*n.entryCount)}async getTextureCoordinates(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TEXCOORD_0,"No TEXCOORD_0 vertex data found.");const n=await this.getAccessor(e.attributes.TEXCOORD_0,t);return r.errorUnsupportedIf(2!==n.componentCount,"TEXCOORD_0 vertex attribute must have 2 components, but found "+n.componentCount.toFixed()),n.componentType===c.g.FLOAT?this._wrapAccessor(_.Eu,n):(r.errorUnsupportedIf(!n.normalized,"Integer component types are only supported for a normalized accessor for TEXCOORD_0."),function(e){switch(e.componentType){case c.g.BYTE:return new _.Vs(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case c.g.UNSIGNED_BYTE:return new _.xA(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case c.g.SHORT:return new _.or(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case c.g.UNSIGNED_SHORT:return new _.TS(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case c.g.UNSIGNED_INT:return new _.qt(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case c.g.FLOAT:return new _.Eu(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);default:return void(0,d.Bg)(e.componentType)}}(n))}async getVertexColors(e,t){const r=this._errorContext;r.assert(null!=e.attributes.COLOR_0,"No COLOR_0 vertex data found.");const n=await this.getAccessor(e.attributes.COLOR_0,t);if(r.errorUnsupportedIf(4!==n.componentCount&&3!==n.componentCount,"COLOR_0 attribute must have 3 or 4 components, but found "+n.componentCount.toFixed()),4===n.componentCount){if(n.componentType===c.g.FLOAT)return this._wrapAccessor(_.ek,n);if(n.componentType===c.g.UNSIGNED_BYTE)return this._wrapAccessor(_.mc,n);if(n.componentType===c.g.UNSIGNED_SHORT)return this._wrapAccessor(_.v6,n)}else if(3===n.componentCount){if(n.componentType===c.g.FLOAT)return this._wrapAccessor(_.ct,n);if(n.componentType===c.g.UNSIGNED_BYTE)return this._wrapAccessor(_.ne,n);if(n.componentType===c.g.UNSIGNED_SHORT)return this._wrapAccessor(_.mw,n)}r.errorUnsupported("Unsupported component type for COLOR_0 attribute: "+M[n.componentType])}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let n=this._materialCache.get(e.material);if(!n){const o=null!=e.material?S(this.json.materials[e.material]):S(),s=o.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(s.baseColorTexture,t),u=this.getTexture(o.normalTexture,t),c=r?this.getTexture(o.occlusionTexture,t):null,d=r?this.getTexture(o.emissiveTexture,t):null,f=r?this.getTexture(s.metallicRoughnessTexture,t):null,l=null!=e.material?e.material:-1;n={alphaMode:o.alphaMode,alphaCutoff:o.alphaCutoff,color:s.baseColorFactor,doubleSided:!!o.doubleSided,colorTexture:await i,normalTexture:await u,name:o.name,id:l,occlusionTexture:await c,emissiveTexture:await d,emissiveFactor:o.emissiveFactor,metallicFactor:s.metallicFactor,roughnessFactor:s.roughnessFactor,metallicRoughnessTexture:await f,hasVertexColors:a,ESRI_externalColorMixMode:o.extras.ESRI_externalColorMixMode}}return n}async getTexture(e,t){if(!e)return null;this._errorContext.errorUnsupportedIf(0!==(e.texCoord||0),"Only TEXCOORD with index 0 is supported.");const r=e.index,n=this._errorContext,o=this.json.textures[r],s=A(null!=o.sampler?this.json.samplers[o.sampler]:{});n.errorUnsupportedIf(null==o.source,"Source is expected to be defined for a texture.");const a=this.json.images[o.source],i=await this._loadTextureImageData(r,o,t);return(0,f.s1)(this._textureCache,r,(()=>{const e=e=>33071===e||33648===e||10497===e,t=e=>(n.error(`Unexpected TextureSampler WrapMode: ${e}. Using default REPEAT(10497).`),10497);return{data:i,wrapS:e(s.wrapS)?s.wrapS:t(s.wrapS),wrapT:e(s.wrapT)?s.wrapT:t(s.wrapT),minFilter:s.minFilter,name:a.name,id:r}}))}getNodeTransform(e){if(void 0===e)return U;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),n=this.json.nodes[e];n.matrix?t=(0,h.m)((0,a.c)(),r,n.matrix):n.translation||n.rotation||n.scale?(t=(0,a.b)(r),n.translation&&(0,h.h)(t,t,n.translation),n.rotation&&(R[3]=(0,m.g)(R,n.rotation),(0,h.e)(t,t,R[3],R)),n.scale&&(0,h.l)(t,t,n.scale)):t=r,this._nodeTransformCache.set(e,t)}return t}_wrapAccessor(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}_resolveUri(e){return(0,l.hF)(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=p.G.parse(this.json.asset.version,"glTF");N.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json,t=this._errorContext;e.extensionsRequired&&0!==e.extensionsRequired.length&&t.errorUnsupported("gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach(((e,t)=>{e.children&&e.children.forEach((e=>{this._nodeParentMap.set(e,t)}))}))}async _loadTextureImageData(e,t,r){const n=this._textureLoaders.get(e);if(n)return n;const o=this._createTextureLoader(t,r);return this._textureLoaders.set(e,o),o}async _createTextureLoader(e,t){const r=this.json.images[e.source];if(r.uri)return this._context.loadImage(this._resolveUri(r.uri),t);const n=this._errorContext;n.errorUnsupportedIf(null==r.bufferView,"Image bufferView must be defined."),n.errorUnsupportedIf(null==r.mimeType,"Image mimeType must be defined.");const o=this.json.bufferViews[r.bufferView],s=await this.getBuffer(o.buffer,t);return n.errorUnsupportedIf(null!=o.byteStride,"byteStride not supported for image buffer"),async function(e,t){return new Promise(((r,n)=>{const o=new Blob([e],{type:t}),s=URL.createObjectURL(o),a=new Image;a.addEventListener("load",(()=>{URL.revokeObjectURL(s),"decode"in a?a.decode().then((()=>r(a)),(()=>r(a))):r(a)})),a.addEventListener("error",(e=>{URL.revokeObjectURL(s),n(e)})),a.src=s}))}(new Uint8Array(s.buffer,s.byteOffset+(o.byteOffset||0),o.byteLength),r.mimeType)}}const N=new p.G(2,0,"glTF"),U=(0,h.w)((0,a.c)(),Math.PI/2),R=(0,y.a)(),C={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},B={[c.g.BYTE]:1,[c.g.UNSIGNED_BYTE]:1,[c.g.SHORT]:2,[c.g.UNSIGNED_SHORT]:2,[c.g.FLOAT]:4,[c.g.UNSIGNED_INT]:4};async function v(e){return new Promise(((t,r)=>{const n=new Blob([e]),o=new FileReader;o.onload=()=>{const e=o.result;t(JSON.parse(e))},o.onerror=e=>{r(e)},o.readAsText(n)}))}const M={5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5125:"UNSIGNED_INT",5126:"FLOAT"};let L=0;async function F(e,t,r={},n=!0){const o=await E.load(e,k,t,r),i="gltf_"+L++,u={lods:[],materials:new Map,textures:new Map,meta:D(o)},d=!(!o.json.asset.extras||"symbolResource"!==o.json.asset.extras.ESRI_type),f=new Map;await j(o,(async(e,t,d,l)=>{const p=f.get(d)??0;f.set(d,p+1);const h=void 0!==e.mode?e.mode:c.MX.TRIANGLES,m=h===c.MX.TRIANGLES||h===c.MX.TRIANGLE_STRIP||h===c.MX.TRIANGLE_FAN?h:null;if((0,s.Wi)(m))return void k.warnUnsupported("Unsupported primitive mode ("+z[h]+"). Skipping primitive.");if(!o.hasPositions(e))return void k.warn("Skipping primitive without POSITION vertex attribute.");const y=o.getPositionData(e,r),_=o.getMaterial(e,r,n),b=o.hasNormals(e)?o.getNormalData(e,r):null,T=o.hasTangents(e)?o.getTangentData(e,r):null,x=o.hasTextureCoordinates(e)?o.getTextureCoordinates(e,r):null,g=o.hasVertexColors(e)?o.getVertexColors(e,r):null,w=o.getIndexData(e,r),S={transform:(0,a.b)(t),attributes:{position:await y,normal:b?await b:null,texCoord0:x?await x:null,color:g?await g:null,tangent:T?await T:null},indices:await w,primitiveType:m,material:P(u,await _,i)};let I=null;(0,s.pC)(u.meta)&&(0,s.pC)(u.meta.ESRI_lod)&&"screenSpaceRadius"===u.meta.ESRI_lod.metric&&(I=u.meta.ESRI_lod.thresholds[d]),u.lods[d]=u.lods[d]||{parts:[],name:l,lodThreshold:I},u.lods[d].parts[p]=S}));for(const e of u.lods)e.parts=e.parts.filter((e=>!!e));return{model:u,meta:{isEsriSymbolResource:d,uri:o.uri},customMeta:{}}}function D(e){const t=e.json;let r=null;return t.nodes.forEach((e=>{const t=e.extras;(0,s.pC)(t)&&(t.ESRI_proxyEllipsoid||t.ESRI_lod)&&(r=t)})),r}async function j(e,t){const r=e.json,n=r.scenes[r.scene||0].nodes,o=n.length>1,s=[];for(const e of n){const t=r.nodes[e];s.push(a(e,0)),G(t)&&!o&&t.extensions.MSFT_lod.ids.forEach(((e,t)=>a(e,t+1)))}async function a(n,o){const i=r.nodes[n],u=e.getNodeTransform(n);if(k.warnUnsupportedIf(null!=i.weights,"Morph targets are not supported."),null!=i.mesh){const e=r.meshes[i.mesh];for(const r of e.primitives)s.push(t(r,u,o,e.name))}for(const e of i.children||[])s.push(a(e,o))}await Promise.all(s)}function G(e){return e.extensions&&e.extensions.MSFT_lod&&Array.isArray(e.extensions.MSFT_lod.ids)}function P(e,t,r){const n=t=>{const n=`${r}_tex_${t&&t.id}${t&&t.name?"_"+t.name:""}`;if(t&&!e.textures.has(n)){const r=function(e,t={}){return{data:e,parameters:{wrap:{s:c.e8.REPEAT,t:c.e8.REPEAT,...t.wrap},noUnpackFlip:!0,mipmap:!1,...t}}}(t.data,{wrap:{s:t.wrapS,t:t.wrapT},mipmap:V.includes(t.minFilter),noUnpackFlip:!0});e.textures.set(n,r)}return n},o=`${r}_mat_${t.id}_${t.name}`;if(!e.materials.has(o)){const r=function(e={}){return{color:[1,1,1],opacity:1,alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1,castShadows:!0,receiveShadows:!0,receiveAmbientOcclustion:!0,textureColor:null,textureNormal:null,textureOcclusion:null,textureEmissive:null,textureMetallicRoughness:null,emissiveFactor:[0,0,0],metallicFactor:1,roughnessFactor:1,colorMixMode:"multiply",...e}}({color:[t.color[0],t.color[1],t.color[2]],opacity:t.color[3],alphaMode:t.alphaMode,alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,colorMixMode:t.ESRI_externalColorMixMode,textureColor:t.colorTexture?n(t.colorTexture):void 0,textureNormal:t.normalTexture?n(t.normalTexture):void 0,textureOcclusion:t.occlusionTexture?n(t.occlusionTexture):void 0,textureEmissive:t.emissiveTexture?n(t.emissiveTexture):void 0,textureMetallicRoughness:t.metallicRoughnessTexture?n(t.metallicRoughnessTexture):void 0,emissiveFactor:[t.emissiveFactor[0],t.emissiveFactor[1],t.emissiveFactor[2]],metallicFactor:t.metallicFactor,roughnessFactor:t.roughnessFactor});e.materials.set(o,r)}return o}const k=new class{error(e){throw new i.Z("gltf-loader-error",e)}errorUnsupported(e){throw new i.Z("gltf-loader-unsupported-feature",e)}errorUnsupportedIf(e,t){e&&this.errorUnsupported(t)}assert(e,t){e||this.error(t)}warn(e){u.Z.getLogger("esri.views.3d.glTF").warn(e)}warnUnsupported(e){this.warn("[Unsupported Feature] "+e)}warnUnsupportedIf(e,t){e&&this.warnUnsupported(t)}},V=[c.cw.LINEAR_MIPMAP_LINEAR,c.cw.LINEAR_MIPMAP_NEAREST],z=["POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLES","TRIANGLE_STRIP","TRIANGLE_FAN"]},17753:(e,t,r)=>{r.d(t,{NO:()=>y,cM:()=>m,p:()=>p,DX:()=>h});var n=r(17896),o=r(65617),s=r(22807),a=r(16996);function i(e,t,r){return(0,n.b)(u,t,e),(0,n.b)(c,r,e),(0,n.l)((0,n.f)(u,u,c))/2}r(12981),new s.x(a.Ue),new s.x((()=>{return e?{p0:(0,o.a)(e.p0),p1:(0,o.a)(e.p1),p2:(0,o.a)(e.p2)}:{p0:(0,o.c)(),p1:(0,o.c)(),p2:(0,o.c)()};var e}));const u=(0,o.c)(),c=(0,o.c)();let d=(()=>{const e=new Uint32Array(131072);for(let t=0;t<e.length;++t)e[t]=t;return e})();const f=new Uint16Array([0]),l=(()=>{const e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function p(e){if(1===e)return f;if(e<l.length)return new Uint16Array(l.buffer,0,e);if(e>d.length){const t=Math.max(2*d.length,e);d=new Uint32Array(t);for(let e=0;e<d.length;e++)d[e]=e}return new Uint32Array(d.buffer,0,e)}function h(e){if(1===e)return new Uint16Array(f);if(e<l.length)return new Uint16Array(l.slice(0,e));if(e>d.length){const t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}return new Uint32Array(d.slice(0,e))}function m(e,t,r){if(!e)return!1;const{size:o,data:s}=e;(0,n.s)(r,0,0,0),(0,n.s)(x,0,0,0);let a=0,u=0;for(let e=0;e<t.length-2;e+=3){const c=t[e+0]*o,d=t[e+1]*o,f=t[e+2]*o;(0,n.s)(_,s[c+0],s[c+1],s[c+2]),(0,n.s)(b,s[d+0],s[d+1],s[d+2]),(0,n.s)(T,s[f+0],s[f+1],s[f+2]);const l=i(_,b,T);l?((0,n.a)(_,_,b),(0,n.a)(_,_,T),(0,n.g)(_,_,1/3*l),(0,n.a)(r,r,_),a+=l):((0,n.a)(x,x,_),(0,n.a)(x,x,b),(0,n.a)(x,x,T),u+=3)}return!(0===u&&0===a||(0!==a?((0,n.g)(r,r,1/a),0):0===u||((0,n.g)(r,x,1/u),0)))}function y(e,t,r){if(!e||!t)return!1;const{size:o,data:s}=e;(0,n.s)(r,0,0,0);let a=-1,i=0;for(let e=0;e<t.length;e++){const n=t[e]*o;a!==n&&(r[0]+=s[n+0],r[1]+=s[n+1],r[2]+=s[n+2],i++),a=n}return i>1&&(0,n.g)(r,r,1/i),i>0}const _=(0,o.c)(),b=(0,o.c)(),T=(0,o.c)(),x=(0,o.c)()},57758:(e,t,r)=>{r.d(t,{K:()=>n});const n=2.1}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6233],{26233:(t,n,e)=>{e.r(n),e.d(n,{l:()=>s});var r,i,o,u={exports:{}};r=u,i="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(i=i||__filename),o=function(t){var n,e;(t=void 0!==(t=t||{})?t:{}).ready=new Promise((function(t,r){n=t,e=r}));var r,o={};for(r in t)t.hasOwnProperty(r)&&(o[r]=t[r]);var u,s,a,f,c,l="object"==typeof window,p="function"==typeof importScripts,h="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,d="";h?(d=p?require("path").dirname(d)+"/":__dirname+"/",u=function(t,n){return f||(f=require("fs")),c||(c=require("path")),t=c.normalize(t),f.readFileSync(t,n?null:"utf8")},a=function(t){var n=u(t,!0);return n.buffer||(n=new Uint8Array(n)),function(t,n){t||W("Assertion failed: "+void 0)}(n.buffer),n},s=function(t,n,e){f||(f=require("fs")),c||(c=require("path")),t=c.normalize(t),f.readFile(t,(function(t,r){t?e(t):n(r.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof N))throw t})),process.on("unhandledRejection",W),t.inspect=function(){return"[Emscripten Module object]"}):(l||p)&&(p?d=self.location.href:"undefined"!=typeof document&&document.currentScript&&(d=document.currentScript.src),i&&(d=i),d=0!==d.indexOf("blob:")?d.substr(0,d.lastIndexOf("/")+1):"",u=function(t){var n=new XMLHttpRequest;return n.open("GET",t,!1),n.send(null),n.responseText},p&&(a=function(t){var n=new XMLHttpRequest;return n.open("GET",t,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}),s=function(t,n,e){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?n(r.response):e()},r.onerror=e,r.send(null)}),t.print||console.log.bind(console);var m,y,g=t.printErr||console.warn.bind(console);for(r in o)o.hasOwnProperty(r)&&(t[r]=o[r]);o=null,t.arguments&&t.arguments,t.thisProgram&&t.thisProgram,t.quit&&t.quit,t.wasmBinary&&(m=t.wasmBinary),t.noExitRuntime,"object"!=typeof WebAssembly&&W("no native wasm support detected");var _,w,b,v,A,R=!1,S="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function P(t,n){return t?function(t,n,e){for(var r=n+e,i=n;t[i]&&!(i>=r);)++i;if(i-n>16&&t.subarray&&S)return S.decode(t.subarray(n,i));for(var o="";n<i;){var u=t[n++];if(128&u){var s=63&t[n++];if(192!=(224&u)){var a=63&t[n++];if((u=224==(240&u)?(15&u)<<12|s<<6|a:(7&u)<<18|s<<12|a<<6|63&t[n++])<65536)o+=String.fromCharCode(u);else{var f=u-65536;o+=String.fromCharCode(55296|f>>10,56320|1023&f)}}else o+=String.fromCharCode((31&u)<<6|s)}else o+=String.fromCharCode(u)}return o}(b,t,n):""}function E(t,n){return t%n>0&&(t+=n-t%n),t}function I(n){_=n,t.HEAP8=w=new Int8Array(n),t.HEAP16=new Int16Array(n),t.HEAP32=v=new Int32Array(n),t.HEAPU8=b=new Uint8Array(n),t.HEAPU16=new Uint16Array(n),t.HEAPU32=new Uint32Array(n),t.HEAPF32=new Float32Array(n),t.HEAPF64=new Float64Array(n)}t.INITIAL_MEMORY;var x=[],T=[],C=[];function j(t){x.unshift(t)}function D(t){C.unshift(t)}var H,M=0,O=null;function W(n){t.onAbort&&t.onAbort(n),g(n+=""),R=!0,n="abort("+n+"). Build with -s ASSERTIONS=1 for more info.";var r=new WebAssembly.RuntimeError(n);throw e(r),r}function k(t){return t.startsWith("data:application/octet-stream;base64,")}function q(t){return t.startsWith("file://")}function U(t){try{if(t==H&&m)return new Uint8Array(m);if(a)return a(t);throw"both async and sync fetching of the wasm failed"}catch(t){W(t)}}function F(n){for(;n.length>0;){var e=n.shift();if("function"!=typeof e){var r=e.func;"number"==typeof r?void 0===e.arg?A.get(r)():A.get(r)(e.arg):r(void 0===e.arg?null:e.arg)}else e(t)}}function B(t){this.excPtr=t,this.ptr=t-16,this.set_type=function(t){v[this.ptr+4>>2]=t},this.get_type=function(){return v[this.ptr+4>>2]},this.set_destructor=function(t){v[this.ptr+8>>2]=t},this.get_destructor=function(){return v[this.ptr+8>>2]},this.set_refcount=function(t){v[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,w[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=w[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,w[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=w[this.ptr+13>>0]},this.init=function(t,n){this.set_type(t),this.set_destructor(n),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=v[this.ptr>>2];v[this.ptr>>2]=t+1},this.release_ref=function(){var t=v[this.ptr>>2];return v[this.ptr>>2]=t-1,1===t}}function z(t){try{return y.grow(t-_.byteLength+65535>>>16),I(y.buffer),1}catch(t){}}t.preloadedImages={},t.preloadedAudios={},k(H="lerc-wasm.wasm")||(H=function(n){return t.locateFile?t.locateFile(n,d):d+n}(H));var L={a:function(t,n,e,r){W("Assertion failed: "+P(t)+", at: "+[n?P(n):"unknown filename",e,r?P(r):"unknown function"])},c:function(t){return X(t+16)+16},b:function(t,n,e){throw new B(t).init(n,e),t},f:function(){W()},d:function(t,n,e){b.copyWithin(t,n,n+e)},e:function(t){var n=b.length,e=2147483648;if((t>>>=0)>e)return!1;for(var r=1;r<=4;r*=2){var i=n*(1+.2/r);if(i=Math.min(i,t+100663296),z(Math.min(e,E(Math.max(t,i),65536))))return!0}return!1}};(function(){var n={a:L};function r(n,e){var r=n.exports;t.asm=r,I((y=t.asm.g).buffer),A=t.asm.m,function(t){T.unshift(t)}(t.asm.h),function(n){if(M--,t.monitorRunDependencies&&t.monitorRunDependencies(M),0==M&&O){var e=O;O=null,e()}}()}function i(t){r(t.instance)}function o(t){return function(){if(!m&&(l||p)){if("function"==typeof fetch&&!q(H))return fetch(H,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+H+"'";return t.arrayBuffer()})).catch((function(){return U(H)}));if(s)return new Promise((function(t,n){s(H,(function(n){t(new Uint8Array(n))}),n)}))}return Promise.resolve().then((function(){return U(H)}))}().then((function(t){return WebAssembly.instantiate(t,n)})).then(t,(function(t){g("failed to asynchronously prepare wasm: "+t),W(t)}))}if(M++,t.monitorRunDependencies&&t.monitorRunDependencies(M),t.instantiateWasm)try{return t.instantiateWasm(n,r)}catch(t){return g("Module.instantiateWasm callback failed with error: "+t),!1}(m||"function"!=typeof WebAssembly.instantiateStreaming||k(H)||q(H)||"function"!=typeof fetch?o(i):fetch(H,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,n).then(i,(function(t){return g("wasm streaming compile failed: "+t),g("falling back to ArrayBuffer instantiation"),o(i)}))}))).catch(e)})(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.h).apply(null,arguments)},t._lerc_getBlobInfo=function(){return(t._lerc_getBlobInfo=t.asm.i).apply(null,arguments)},t._lerc_getDataRanges=function(){return(t._lerc_getDataRanges=t.asm.j).apply(null,arguments)},t._lerc_decode=function(){return(t._lerc_decode=t.asm.k).apply(null,arguments)},t._lerc_decode_4D=function(){return(t._lerc_decode_4D=t.asm.l).apply(null,arguments)};var G,X=t._malloc=function(){return(X=t._malloc=t.asm.n).apply(null,arguments)};function N(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Y(e){function r(){G||(G=!0,t.calledRun=!0,R||(F(T),n(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),function(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)D(t.postRun.shift());F(C)}()))}M>0||(function(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)j(t.preRun.shift());F(x)}(),M>0||(t.setStatus?(t.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t.setStatus("")}),1),r()}),1)):r()))}if(t._free=function(){return(t._free=t.asm.o).apply(null,arguments)},O=function t(){G||Y(),G||(O=t)},t.run=Y,t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return Y(),t.ready},r.exports=o;const s=function(t,n){for(var e=0;e<n.length;e++){const r=n[e];if("string"!=typeof r&&!Array.isArray(r))for(const n in r)if("default"!==n&&!(n in t)){const e=Object.getOwnPropertyDescriptor(r,n);e&&Object.defineProperty(t,n,e.get?e:{enumerable:!0,get:()=>r[n]})}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}({__proto__:null,default:u.exports},[u.exports])}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[934],{46521:(t,e,n)=>{function r(){return[1,0,0,0,1,0,0,0,1]}function i(t,e){return new Float64Array(t,e,9)}n.d(e,{a:()=>i,c:()=>r}),Object.freeze(Object.defineProperty({__proto__:null,create:r,clone:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},fromValues:function(t,e,n,r,i,o,s,c,a){return[t,e,n,r,i,o,s,c,a]},createView:i},Symbol.toStringTag,{value:"Module"}))},13598:(t,e,n)=>{function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function i(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}function o(t,e){return new Float64Array(t,e,16)}n.d(e,{I:()=>s,a:()=>o,b:()=>i,c:()=>r});const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,create:r,clone:i,fromValues:function(t,e,n,r,i,o,s,c,a,u,l,d,h,f,_,T){return[t,e,n,r,i,o,s,c,a,u,l,d,h,f,_,T]},createView:o,IDENTITY:s},Symbol.toStringTag,{value:"Module"}))},94961:(t,e,n)=>{function r(){return[0,0,0,1]}function i(t){return[t[0],t[1],t[2],t[3]]}function o(t,e){return new Float64Array(t,e,4)}n.d(e,{I:()=>s,a:()=>r,b:()=>i,c:()=>o});const s=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,create:r,clone:i,fromValues:function(t,e,n,r){return[t,e,n,r]},createView:o,IDENTITY:s},Symbol.toStringTag,{value:"Module"}))},29268:(t,e,n)=>{n.d(e,{a:()=>m,c:()=>g,g:()=>O,h:()=>p,j:()=>A,m:()=>v}),n(80442);var r,i,o=n(92604),s=n(22021),c=n(70586),a=n(52138),u=n(17896),l=n(65617),d=n(98766),h=n(88669);(i=r||(r={}))[i.X=0]="X",i[i.Y=1]="Y",i[i.Z=2]="Z";var f=n(78341),_=n(61277),T=n(12981);function g(){return(0,h.c)()}function p(t,e=g()){return(0,d.c)(e,t)}function m(t){return t[3]}function O(t){return t}function N(t,e,n){if((0,c.Wi)(e))return!1;const{origin:r,direction:i}=e,o=E;o[0]=r[0]-t[0],o[1]=r[1]-t[1],o[2]=r[2]-t[2];const s=i[0]*i[0]+i[1]*i[1]+i[2]*i[2],a=2*(i[0]*o[0]+i[1]*o[1]+i[2]*o[2]),u=a*a-4*s*(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]-t[3]*t[3]);if(u<0)return!1;const l=Math.sqrt(u);let d=(-a-l)/(2*s);const h=(-a+l)/(2*s);return(d<0||h<d&&h>0)&&(d=h),!(d<0||(n&&(n[0]=r[0]+i[0]*d,n[1]=r[1]+i[1]*d,n[2]=r[2]+i[2]*d),0))}const E=(0,l.c)();function A(t,e){return N(t,e,null)}function I(t,e,n){const r=T.WM.get(),i=T.MP.get();(0,u.f)(r,e.origin,e.direction);const o=m(t);(0,u.f)(n,r,e.origin),(0,u.g)(n,n,1/(0,u.l)(n)*o);const s=b(t,e.origin),c=(0,_.EU)(e.origin,n);return(0,a.d)(i,c+s,r),(0,u.m)(n,n,i),n}function R(t,e,n){const r=(0,u.b)(T.WM.get(),e,t),i=(0,u.g)(T.WM.get(),r,t[3]/(0,u.l)(r));return(0,u.a)(n,i,t)}function b(t,e){const n=(0,u.b)(T.WM.get(),e,t),r=(0,u.l)(n),i=m(t),o=i+Math.abs(i-r);return(0,s.ZF)(i/o)}const S=(0,l.c)();function F(t,e,n,i){const o=(0,u.b)(S,e,t);switch(n){case r.X:{const t=(0,s.jE)(o,S)[2];return(0,u.s)(i,-Math.sin(t),Math.cos(t),0)}case r.Y:{const t=(0,s.jE)(o,S),e=t[1],n=t[2],r=Math.sin(e);return(0,u.s)(i,-r*Math.cos(n),-r*Math.sin(n),Math.cos(e))}case r.Z:return(0,u.n)(i,o);default:return}}function M(t,e){const n=(0,u.b)(y,e,t);return(0,u.l)(n)-t[3]}function v(t,e){const n=(0,u.d)(t,e),r=m(t);return n<=r*r}const y=(0,l.c)(),w=g();Object.freeze(Object.defineProperty({__proto__:null,create:g,copy:p,fromCenterAndRadius:function(t,e){return(0,h.f)(t[0],t[1],t[2],e)},wrap:function(t){return t},clear:function(t){t[0]=t[1]=t[2]=t[3]=0},fromRadius:function(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t},getRadius:m,getCenter:O,fromValues:function(t,e,n,r){return(0,h.f)(t,e,n,r)},elevate:function(t,e,n){return t!==n&&(0,u.c)(n,t),n[3]=t[3]+e,n},setExtent:function(t,e,n){return o.Z.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),t===n?n:p(t,n)},intersectRay:N,intersectsRay:A,intersectRayClosestSilhouette:function(t,e,n){if(N(t,e,n))return n;const r=I(t,e,T.WM.get());return(0,u.a)(n,e.origin,(0,u.g)(T.WM.get(),e.direction,(0,u.i)(e.origin,r)/(0,u.l)(e.direction))),n},closestPointOnSilhouette:I,closestPoint:function(t,e,n){return N(t,e,n)?n:((0,f.JI)(e,t,n),R(t,n,n))},projectPoint:R,distanceToSilhouette:function(t,e){const n=(0,u.b)(T.WM.get(),e,t),r=(0,u.p)(n),i=t[3]*t[3];return Math.sqrt(Math.abs(r-i))},angleToSilhouette:b,axisAt:F,altitudeAt:M,setAltitudeAt:function(t,e,n,i){const o=M(t,e),s=F(t,e,r.Z,y),c=(0,u.g)(y,s,n-o);return(0,u.a)(i,e,c)},containsPoint:v,tmpSphere:w},Symbol.toStringTag,{value:"Module"}))},88669:(t,e,n)=>{function r(){return[0,0,0,0]}function i(t,e,n,r){return[t,e,n,r]}function o(t,e){return new Float64Array(t,e,4)}function s(){return i(1,1,1,1)}function c(){return i(1,0,0,0)}function a(){return i(0,1,0,0)}function u(){return i(0,0,1,0)}function l(){return i(0,0,0,1)}n.d(e,{a:()=>o,c:()=>r,f:()=>i});const d=s(),h=c(),f=a(),_=u(),T=l();Object.freeze(Object.defineProperty({__proto__:null,create:r,clone:function(t){return[t[0],t[1],t[2],t[3]]},fromValues:i,fromArray:function(t){const e=[0,0,0,0],n=Math.min(4,t.length);for(let r=0;r<n;++r)e[r]=t[r];return e},createView:o,zeros:function(){return[0,0,0,0]},ones:s,unitX:c,unitY:a,unitZ:u,unitW:l,ZEROS:[0,0,0,0],ONES:d,UNIT_X:h,UNIT_Y:f,UNIT_Z:_,UNIT_W:T},Symbol.toStringTag,{value:"Module"}))},47545:(t,e,n)=>{n.d(e,{d:()=>i});var r=n(22021);function i(t,e,n){const i=t.byteLength/(4*e),u=new Uint32Array(t,0,i*e);let l=new Uint32Array(i);const d=n?.minReduction??0,h=n?.originalIndices||null,f=h?h.length:0,_=n?.componentOffsets||null;let T=0;if(_)for(let t=0;t<_.length-1;t++){const e=_[t+1]-_[t];e>T&&(T=e)}else T=i;const g=Math.floor(1.1*T)+1;(null==a||a.length<2*g)&&(a=new Uint32Array((0,r.Sf)(2*g)));for(let t=0;t<2*g;t++)a[t]=0;let p=0;const m=!!_&&!!h,O=m?f:i,N=m?new Uint32Array(f):null,E=1.96;let A=0!==d?Math.ceil(4*E*E/(d*d)*d*(1-d)):O,I=1,R=_?_[1]:O;for(let t=0;t<O;t++){if(t===A){const e=1-p/t;if(e+E*Math.sqrt(e*(1-e)/t)<d)return null;A*=2}if(t===R){for(let t=0;t<2*g;t++)a[t]=0;if(h)for(let t=_[I-1];t<_[I];t++)N[t]=l[h[t]];R=_[++I]}const n=m?h[t]:t,r=n*e,i=c(u,r,e);let s=i%g,f=p;for(;0!==a[2*s+1];){if(a[2*s]===i){const t=a[2*s+1]-1;if(o(u,r,t*e,e)){f=l[t];break}}s++,s>=g&&(s-=g)}f===p&&(a[2*s]=i,a[2*s+1]=n+1,p++),l[n]=f}if(0!==d&&1-p/i<d)return null;if(m){for(let t=_[I-1];t<N.length;t++)N[t]=l[h[t]];l=N}const b=new Uint32Array(e*p);p=0;for(let t=0;t<O;t++)l[t]===p&&(s(u,(m?h[t]:t)*e,b,p*e,e),p++);if(h&&!m){const t=new Uint32Array(f);for(let e=0;e<t.length;e++)t[e]=l[h[e]];l=t}return{buffer:b.buffer,indices:l,uniqueCount:p}}function o(t,e,n,r){for(let i=0;i<r;i++)if(t[e+i]!==t[n+i])return!1;return!0}function s(t,e,n,r,i){for(let o=0;o<i;o++)n[r+o]=t[e+o]}function c(t,e,n){let r=0;for(let i=0;i<n;i++)r=t[e+i]+r|0,r=r+(r<<11)+(r>>>2)|0;return r>>>0}let a=null},78341:(t,e,n)=>{n.d(e,{JI:()=>u,Ue:()=>s,re:()=>a}),n(67676);var r=n(22807),i=n(17896),o=n(65617);function s(t){return t?c((0,o.a)(t.origin),(0,o.a)(t.direction)):c((0,o.c)(),(0,o.c)())}function c(t,e){return{origin:t,direction:e}}function a(t,e){const n=l.get();return n.origin=t,n.direction=e,n}function u(t,e,n){const r=(0,i.e)(t.direction,(0,i.b)(n,e,t.origin));return(0,i.a)(n,t.origin,(0,i.g)(n,t.direction,r)),n}n(12981);const l=new r.x((()=>s()))},61277:(t,e,n)=>{n.d(e,{EU:()=>s});var r=n(22021),i=n(17896),o=n(65617);function s(t,e){const n=(0,i.e)(t,e)/((0,i.l)(t)*(0,i.l)(e));return-(0,r.ZF)(n)}(0,o.c)(),(0,o.c)()},65576:(t,e,n)=>{n.d(e,{U$:()=>c});var r=n(56481),i=n(79583);class o{constructor(t,e){this.layout=t,this.buffer="number"==typeof e?new ArrayBuffer(e*t.stride):e;for(const e of t.fieldNames){const n=t.fields.get(e);this[e]=new n.constructor(this.buffer,n.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(t,e){const n=this[t];return n&&n.elementCount===e.ElementCount&&n.elementType===e.ElementType?n:null}slice(t,e){return new o(this.layout,this.buffer.slice(t*this.stride,e*this.stride))}copyFrom(t,e,n,r){const i=this.stride;if(i%4==0){const o=new Uint32Array(t.buffer,e*i,r*i/4);new Uint32Array(this.buffer,n*i,r*i/4).set(o)}else{const o=new Uint8Array(t.buffer,e*i,r*i);new Uint8Array(this.buffer,n*i,r*i).set(o)}}}class s{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(t,e){return this._appendField(t,r.Eu,e),this}vec2f64(t,e){return this._appendField(t,r.q6,e),this}vec3f(t,e){return this._appendField(t,r.ct,e),this}vec3f64(t,e){return this._appendField(t,r.fP,e),this}vec4f(t,e){return this._appendField(t,r.ek,e),this}vec4f64(t,e){return this._appendField(t,r.Cd,e),this}mat3f(t,e){return this._appendField(t,r.gK,e),this}mat3f64(t,e){return this._appendField(t,r.ey,e),this}mat4f(t,e){return this._appendField(t,r.bj,e),this}mat4f64(t,e){return this._appendField(t,r.O1,e),this}vec4u8(t,e){return this._appendField(t,r.mc,e),this}f32(t,e){return this._appendField(t,r.ly,e),this}f64(t,e){return this._appendField(t,r.oS,e),this}u8(t,e){return this._appendField(t,r.D_,e),this}u16(t,e){return this._appendField(t,r.av,e),this}i8(t,e){return this._appendField(t,r.Hz,e),this}vec2i8(t,e){return this._appendField(t,r.Vs,e),this}vec2i16(t,e){return this._appendField(t,r.or,e),this}vec2u8(t,e){return this._appendField(t,r.xA,e),this}vec4u16(t,e){return this._appendField(t,r.v6,e),this}u32(t,e){return this._appendField(t,r.Nu,e),this}_appendField(t,e,n){const r=e.ElementCount*(0,i.n1)(e.ElementType),o=this.stride;this.fields.set(t,{size:r,constructor:e,offset:o,optional:n}),this.stride+=r,this.fieldNames.push(t)}alignTo(t){return this.stride=Math.floor((this.stride+t-1)/t)*t,this}hasField(t){return this.fieldNames.includes(t)}createBuffer(t){return new o(this,t)}createView(t){return new o(this,t)}clone(){const t=new s;return t.stride=this.stride,t.fields=new Map,this.fields.forEach(((e,n)=>t.fields.set(n,e))),t.fieldNames=this.fieldNames.slice(),t.BufferType=this.BufferType,t}}function c(){return new s}},5329:(t,e,n)=>{n.d(e,{K:()=>o});var r=n(35371),i=n(21968);function o(t,e=0){const n=t.stride;return t.fieldNames.filter((e=>{const n=t.fields.get(e).optional;return!(n&&n.glPadding)})).map((r=>{const o=t.fields.get(r),c=o.constructor.ElementCount,a=s(o.constructor.ElementType),u=o.offset,l=!(!o.optional||!o.optional.glNormalized);return new i.G(r,c,a,u,n,l,e)}))}function s(t){const e=c[t];if(e)return e;throw new Error("BufferType not supported in WebGL")}const c={u8:r.g.UNSIGNED_BYTE,u16:r.g.UNSIGNED_SHORT,u32:r.g.UNSIGNED_INT,i8:r.g.BYTE,i16:r.g.SHORT,i32:r.g.INT,f32:r.g.FLOAT}},11726:(t,e,n)=>{n.d(e,{hu:()=>i,yK:()=>o}),n(97323),n(98766),(0,n(88669).c)();class r{constructor(t){this.message=t}toString(){return`AssertException: ${this.message}`}}function i(t,e){if(!t)throw e=e||"assert",console.log(new Error(e).stack),new r(e)}function o(t,e,n,r){let i,o=(n[0]-t[0])/e[0],s=(r[0]-t[0])/e[0];o>s&&(i=o,o=s,s=i);let c=(n[1]-t[1])/e[1],a=(r[1]-t[1])/e[1];if(c>a&&(i=c,c=a,a=i),o>a||c>s)return!1;c>o&&(o=c),a<s&&(s=a);let u=(n[2]-t[2])/e[2],l=(r[2]-t[2])/e[2];return u>l&&(i=u,u=l,l=i),!(o>l||u>s||(l<s&&(s=l),s<0))}},35065:(t,e,n)=>{var r;n.d(e,{T:()=>r}),function(t){t.POSITION="position",t.NORMAL="normal",t.UV0="uv0",t.AUXPOS1="auxpos1",t.AUXPOS2="auxpos2",t.MAPPOS="mapPos",t.COLOR="color",t.SYMBOLCOLOR="symbolColor",t.SIZE="size",t.TANGENT="tangent",t.OFFSET="offset",t.SUBDIVISIONFACTOR="subdivisionFactor",t.COLORFEATUREATTRIBUTE="colorFeatureAttribute",t.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",t.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",t.DISTANCETOSTART="distanceToStart",t.UVMAPSPACE="uvMapSpace",t.BOUNDINGRECT="boundingRect",t.UVREGION="uvRegion",t.NORMALCOMPRESSED="normalCompressed",t.PROFILERIGHT="profileRight",t.PROFILEUP="profileUp",t.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",t.FEATUREVALUE="featureValue",t.MODELORIGINHI="modelOriginHi",t.MODELORIGINLO="modelOriginLo",t.MODEL="model",t.MODELNORMAL="modelNormal",t.INSTANCECOLOR="instanceColor",t.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",t.LOCALTRANSFORM="localTransform",t.GLOBALTRANSFORM="globalTransform",t.BOUNDINGSPHERE="boundingSphere",t.MODELORIGIN="modelOrigin",t.MODELSCALEFACTORS="modelScaleFactors",t.FEATUREATTRIBUTE="featureAttribute",t.STATE="state",t.LODLEVEL="lodLevel",t.POSITION0="position0",t.POSITION1="position1",t.NORMALA="normalA",t.NORMALB="normalB",t.COMPONENTINDEX="componentIndex",t.VARIANTOFFSET="variantOffset",t.VARIANTSTROKE="variantStroke",t.VARIANTEXTENSION="variantExtension",t.U8PADDING="u8padding",t.U16PADDING="u16padding",t.SIDENESS="sideness",t.START="start",t.END="end",t.UP="up",t.EXTRUDE="extrude"}(r||(r={}))},17288:(t,e,n)=>{n.d(e,{Hr:()=>l,dG:()=>u,tf:()=>s});var r=n(5329),i=n(65576),o=n(35065);const s=(0,i.U$)().vec3f(o.T.POSITION).u16(o.T.COMPONENTINDEX).u16(o.T.U16PADDING),c=(0,i.U$)().vec2u8(o.T.SIDENESS),a=((0,r.K)(c),(0,i.U$)().vec3f(o.T.POSITION0).vec3f(o.T.POSITION1).u16(o.T.COMPONENTINDEX).u8(o.T.VARIANTOFFSET,{glNormalized:!0}).u8(o.T.VARIANTSTROKE).u8(o.T.VARIANTEXTENSION,{glNormalized:!0}).u8(o.T.U8PADDING,{glPadding:!0}).u16(o.T.U16PADDING,{glPadding:!0})),u=a.clone().vec3f(o.T.NORMAL),l=a.clone().vec3f(o.T.NORMALA).vec3f(o.T.NORMALB);new Map([[o.T.POSITION0,0],[o.T.POSITION1,1],[o.T.COMPONENTINDEX,2],[o.T.VARIANTOFFSET,3],[o.T.VARIANTSTROKE,4],[o.T.VARIANTEXTENSION,5],[o.T.NORMAL,6],[o.T.NORMALA,6],[o.T.NORMALB,7],[o.T.SIDENESS,8]])},97411:(t,e,n)=>{n.d(e,{n:()=>d});var r=n(67676),i=n(22021),o=n(1533),s=n(17896),c=n(65617);const a=-1;var u,l;function d(t,e,n,c=m){const u=t.vertices.position,l=t.vertices.componentIndex,d=(0,i.Vl)(c.anglePlanar),p=(0,i.Vl)(c.angleSignificantEdge),O=Math.cos(p),N=Math.cos(d),E=g.edge,A=E.position0,I=E.position1,R=E.faceNormal0,b=E.faceNormal1,S=T(t),F=function(t){const e=t.faces.length/3,n=t.faces,r=t.neighbors;let i=0;for(let t=0;t<e;t++){const e=r[3*t+0],o=r[3*t+1],s=r[3*t+2],c=n[3*t+0],u=n[3*t+1],l=n[3*t+2];i+=e===a||c<u?1:0,i+=o===a||u<l?1:0,i+=s===a||l<c?1:0}const o=new Int32Array(4*i);let s=0;for(let t=0;t<e;t++){const e=r[3*t+0],i=r[3*t+1],c=r[3*t+2],u=n[3*t+0],l=n[3*t+1],d=n[3*t+2];(e===a||u<l)&&(o[s++]=u,o[s++]=l,o[s++]=t,o[s++]=e),(i===a||l<d)&&(o[s++]=l,o[s++]=d,o[s++]=t,o[s++]=i),(c===a||d<u)&&(o[s++]=d,o[s++]=u,o[s++]=t,o[s++]=c)}return o}(t),M=F.length/4,v=e.allocate(M);let y=0;const w=M,L=n.allocate(w);let P=0,C=0,x=0;const D=(0,r.w6)(0,M),U=new Float32Array(M);(0,o.Ed)(U,((t,e,n)=>{u.getVec(F[4*e+0],A),u.getVec(F[4*e+1],I),n[e]=(0,s.i)(A,I)})),D.sort(((t,e)=>U[e]-U[t]));const B=new Array,j=new Array;for(let t=0;t<M;t++){const r=D[t],i=U[r],o=F[4*r+0],c=F[4*r+1],T=F[4*r+2],g=F[4*r+3],p=g===a;if(u.getVec(o,A),u.getVec(c,I),p)(0,s.s)(R,S[3*T+0],S[3*T+1],S[3*T+2]),(0,s.c)(b,R),E.componentIndex=l.get(o),E.cosAngle=(0,s.e)(R,b);else{if((0,s.s)(R,S[3*T+0],S[3*T+1],S[3*T+2]),(0,s.s)(b,S[3*g+0],S[3*g+1],S[3*g+2]),E.componentIndex=l.get(o),E.cosAngle=(0,s.e)(R,b),f(E,N))continue;E.cosAngle<-.9999&&(0,s.c)(b,R)}C+=i,x++,p||h(E,O)?(e.write(v,y++,E),B.push(i)):_(E,d)&&(n.write(L,P++,E),j.push(i))}const V=new Float32Array(B.reverse()),G=new Float32Array(j.reverse());return{regular:{instancesData:e.trim(v,y),lodInfo:{lengths:V}},silhouette:{instancesData:n.trim(L,P),lodInfo:{lengths:G}},averageEdgeLength:C/x}}function h(t,e){return t.cosAngle<e}function f(t,e){return t.cosAngle>e}function _(t,e){const n=(0,i.ZF)(t.cosAngle),r=g.fwd,o=g.ortho;return(0,s.r)(r,t.position1,t.position0),n*((0,s.e)((0,s.f)(o,t.faceNormal0,t.faceNormal1),r)>0?-1:1)>e}function T(t){const e=t.faces.length/3,n=t.vertices.position,r=t.faces,i=p.v0,o=p.v1,c=p.v2,a=new Float32Array(3*e);for(let t=0;t<e;t++){const e=r[3*t+0],u=r[3*t+1],l=r[3*t+2];n.getVec(e,i),n.getVec(u,o),n.getVec(l,c),(0,s.b)(o,o,i),(0,s.b)(c,c,i),(0,s.f)(i,o,c),(0,s.n)(i,i),a[3*t+0]=i[0],a[3*t+1]=i[1],a[3*t+2]=i[2]}return a}(l=u||(u={}))[l.SOLID=0]="SOLID",l[l.SKETCH=1]="SKETCH";const g={edge:{position0:(0,c.c)(),position1:(0,c.c)(),faceNormal0:(0,c.c)(),faceNormal1:(0,c.c)(),componentIndex:0,cosAngle:0},ortho:(0,c.c)(),fwd:(0,c.c)()},p={v0:(0,c.c)(),v1:(0,c.c)(),v2:(0,c.c)()},m={anglePlanar:4,angleSignificantEdge:35}},212:(t,e,n)=>{n.d(e,{Kl:()=>R,n_:()=>v,kY:()=>b,Yr:()=>M});var r=n(47545);function i(t,e,n){const r=e/3,i=new Uint32Array(n+1),o=new Uint32Array(n+1),s=(t,e)=>{t<e?i[t+1]++:o[e+1]++};for(let e=0;e<r;e++){const n=t[3*e],r=t[3*e+1],i=t[3*e+2];s(n,r),s(r,i),s(i,n)}let c=0,a=0;for(let t=0;t<n;t++){const e=i[t+1],n=o[t+1];i[t+1]=c,o[t+1]=a,c+=e,a+=n}const u=new Uint32Array(6*r),l=i[n],d=(t,e,n)=>{if(t<e){const r=i[t+1]++;u[2*r]=e,u[2*r+1]=n}else{const r=o[e+1]++;u[2*l+2*r]=t,u[2*l+2*r+1]=n}};for(let e=0;e<r;e++){const n=t[3*e],r=t[3*e+1],i=t[3*e+2];d(n,r,e),d(r,i,e),d(i,n,e)}const h=(t,e)=>{const n=2*t,r=e-t;for(let t=1;t<r;t++){const e=u[n+2*t],r=u[n+2*t+1];let i=t-1;for(;i>=0&&u[n+2*i]>e;i--)u[n+2*i+2]=u[n+2*i],u[n+2*i+3]=u[n+2*i+1];u[n+2*i+2]=e,u[n+2*i+3]=r}};for(let t=0;t<n;t++)h(i[t],i[t+1]),h(l+o[t],l+o[t+1]);const f=new Int32Array(3*r),_=(e,n)=>e===t[3*n]?0:e===t[3*n+1]?1:e===t[3*n+2]?2:-1,T=(t,e)=>{const n=_(t,e);f[3*e+n]=-1},g=(t,e,n,r)=>{const i=_(t,e);f[3*e+i]=r;const o=_(n,r);f[3*r+o]=e};for(let t=0;t<n;t++){let e=i[t];const n=i[t+1];let r=o[t];const s=o[t+1];for(;e<n&&r<s;){const n=u[2*e],i=u[2*l+2*r];n===i?(g(t,u[2*e+1],i,u[2*l+2*r+1]),e++,r++):n<i?(T(t,u[2*e+1]),e++):(T(i,u[2*l+2*r+1]),r++)}for(;e<n;)T(t,u[2*e+1]),e++;for(;r<s;)T(u[2*l+2*r],u[2*l+2*r+1]),r++}return f}var o=n(65576),s=n(35065),c=n(17288),a=n(77734),u=n(17896),l=n(65617),d=n(5329);class h{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?p:g}write(t,e,n){const r=this._edgeHashFunction(n);A.seed=r;const i=A.getIntRange(0,255),o=A.getIntRange(0,this.settings.variants-1),s=A.getFloat(),c=255*(.5*function(t,e){const n=t<0?-1:1;return Math.abs(t)**1.2*n}(-(1-Math.min(s/.7,1))+Math.max(0,s-.7)/(1-.7))+.5);t.position0.setVec(e,n.position0),t.position1.setVec(e,n.position1),t.componentIndex.set(e,n.componentIndex),t.variantOffset.set(e,i),t.variantStroke.set(e,o),t.variantExtension.set(e,c)}trim(t,e){return t.slice(0,e)}}const f=new Float32Array(6),_=new Uint32Array(f.buffer),T=new Uint32Array(1);function g(t){const e=f;e[0]=t.position0[0],e[1]=t.position0[1],e[2]=t.position0[2],e[3]=t.position1[0],e[4]=t.position1[1],e[5]=t.position1[2],T[0]=5381;for(let t=0;t<_.length;t++)T[0]=31*T[0]+_[t];return T[0]}function p(t){const e=f;e[0]=m(t.position0[0]),e[1]=m(t.position0[1]),e[2]=m(t.position0[2]),e[3]=m(t.position1[0]),e[4]=m(t.position1[1]),e[5]=m(t.position1[2]),T[0]=5381;for(let t=0;t<_.length;t++)T[0]=31*T[0]+_[t];return T[0]}function m(t){return Math.round(1e4*t)/1e4}class O{constructor(){this._commonWriter=new h}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return c.dG.createBuffer(t)}write(t,e,n){this._commonWriter.write(t,e,n),(0,u.a)(E,n.faceNormal0,n.faceNormal1),(0,u.n)(E,E),t.normal.setVec(e,E)}trim(t,e){return this._commonWriter.trim(t,e)}}O.Layout=c.dG,O.glLayout=(0,d.K)(c.dG,1);class N{constructor(){this._commonWriter=new h}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return c.Hr.createBuffer(t)}write(t,e,n){this._commonWriter.write(t,e,n),t.normalA.setVec(e,n.faceNormal0),t.normalB.setVec(e,n.faceNormal1)}trim(t,e){return this._commonWriter.trim(t,e)}}N.Layout=c.Hr,N.glLayout=(0,d.K)(c.Hr,1);const E=(0,l.c)(),A=new a.Z;var I=n(97411);function R(t){const e=b(t.data,t.skipDeduplicate,t.indices,t.indicesLength);return S.updateSettings(t.writerSettings),F.updateSettings(t.writerSettings),(0,I.n)(e,S,F)}function b(t,e,n,o){if(e)return{faces:n,facesLength:o,neighbors:i(n,o,t.count),vertices:t};const s=(0,r.d)(t.buffer,t.stride/4,{originalIndices:n,originalIndicesLength:o}),a=i(s.indices,o,s.uniqueCount);return{faces:s.indices,facesLength:s.indices.length,neighbors:a,vertices:c.tf.createView(s.buffer)}}const S=new O,F=new N,M=(0,o.U$)().vec3f(s.T.POSITION0).vec3f(s.T.POSITION1),v=(0,o.U$)().vec3f(s.T.POSITION0).vec3f(s.T.POSITION1).u16(s.T.COMPONENTINDEX).u16(s.T.U16PADDING,{glPadding:!0})},40614:(t,e,n)=>{n.r(e),n.d(e,{default:()=>et});var r,i,o,s,c,a,u,l=n(43697),d=n(70586),h=n(95330),f=(n(92604),n(75215),n(67676),n(80442),n(20102),n(52011)),_=n(17896),T=n(65617),g=n(16996),p=n(29268),m=n(98370),O=n(71143),N=n(44553),E=n(22807),A=(n(52138),n(98766),n(88669)),I=n(78341);function R(t){return t?{ray:(0,I.Ue)(t.ray),c0:t.c0,c1:t.c1}:{ray:(0,I.Ue)(),c0:0,c1:Number.MAX_VALUE}}function b(t,e){for(let n=0;n<a.NUM;n++){const r=t[n];if(r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]>=e[3])return!1}return!0}n(12981),new E.x((()=>R())),n(22021),n(61277),(0,T.c)(),(0,T.c)(),(0,T.c)(),(0,T.c)(),(0,T.c)(),(0,T.c)(),(0,T.c)(),(0,T.c)(),(0,T.c)(),(0,T.c)(),(i=r||(r={}))[i.NONE=0]="NONE",i[i.CLAMP=1]="CLAMP",i[i.INFINITE_MIN=4]="INFINITE_MIN",i[i.INFINITE_MAX=8]="INFINITE_MAX",r.INFINITE_MIN,r.INFINITE_MAX,r.INFINITE_MAX,(c=o||(o={}))[c.LEFT=0]="LEFT",c[c.RIGHT=1]="RIGHT",c[c.BOTTOM=2]="BOTTOM",c[c.TOP=3]="TOP",c[c.NEAR=4]="NEAR",c[c.FAR=5]="FAR",function(t){t[t.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",t[t.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",t[t.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",t[t.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",t[t.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",t[t.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",t[t.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",t[t.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(s||(s={})),s.FAR_BOTTOM_RIGHT,s.NEAR_BOTTOM_RIGHT,s.NEAR_BOTTOM_LEFT,s.FAR_BOTTOM_LEFT,s.NEAR_BOTTOM_LEFT,s.NEAR_BOTTOM_RIGHT,s.NEAR_TOP_RIGHT,s.NEAR_TOP_LEFT,s.FAR_BOTTOM_RIGHT,s.FAR_BOTTOM_LEFT,s.FAR_TOP_LEFT,s.FAR_TOP_RIGHT,s.NEAR_BOTTOM_RIGHT,s.FAR_BOTTOM_RIGHT,s.FAR_TOP_RIGHT,s.NEAR_TOP_RIGHT,s.FAR_BOTTOM_LEFT,s.NEAR_BOTTOM_LEFT,s.NEAR_TOP_LEFT,s.FAR_TOP_LEFT,s.FAR_TOP_LEFT,s.NEAR_TOP_LEFT,s.NEAR_TOP_RIGHT,s.FAR_TOP_RIGHT,function(t){t[t.NUM=6]="NUM"}(a||(a={})),function(t){t[t.NUM=8]="NUM"}(u||(u={})),(0,A.f)(-1,-1,-1,1),(0,A.f)(1,-1,-1,1),(0,A.f)(1,1,-1,1),(0,A.f)(-1,1,-1,1),(0,A.f)(-1,-1,1,1),(0,A.f)(1,-1,1,1),(0,A.f)(1,1,1,1),(0,A.f)(-1,1,1,1),new E.x(R),(0,T.c)(),(0,T.c)(),(0,T.c)(),(0,T.c)(),(0,T.c)(),(0,T.c)(),(0,T.c)(),(0,T.c)();var S=n(11726);class F{constructor(t,e){this._objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new M,this._objectCount=0,e&&(void 0!==e.maximumObjectsPerNode&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),void 0!==e.maximumDepth&&(this._maximumDepth=e.maximumDepth))}get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}destroy(){this._degenerateObjects.clear(),M.clearPool(),j[0]=null,W.prune(),Y.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=M.acquire();for(let r=0;r<e;r++){const e=t[r];this._isDegenerate(e)?this._degenerateObjects.add(e):(n.init(this._root),this._add(e,n))}M.release(n)}remove(t,e=null){this._objectCount-=t.length;const n=M.acquire();for(const r of t){const t=(0,d.pC)(e)?e:(0,p.h)(this._objectToBoundingSphere(r),k);x(t[3])?(n.init(this._root),this._remove(r,t,n)):this._degenerateObjects.delete(r)}M.release(n),this._shrink()}update(t,e){if(!x(e[3])&&this._isDegenerate(t))return;const n=function(t){return j[0]=t,j}(t);this.remove(n,e),this.add(n)}forEachAlongRay(t,e,n){const r=(0,I.re)(t,e);this._forEachNode(this._root,(t=>{if(!this._intersectsNode(r,t))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObject(r,t)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObject(r,t)&&n(t)})),!0}))}forEachAlongRayWithVerticalOffset(t,e,n,r){const i=(0,I.re)(t,e);this._forEachNode(this._root,(t=>{if(!this._intersectsNodeWithOffset(i,t,r))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObjectWithOffset(i,t,r)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObjectWithOffset(i,t,r)&&n(t)})),!0}))}forEach(t){this._forEachNode(this._root,(e=>{const n=e.node;return n.terminals.forAll(t),null!==n.residents&&n.residents.forAll(t),!0})),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,r=(()=>!0),i=1/0){let o=1/0,s=1/0,c=null;const a=P(t,e),u=a=>{if(--i,!r(a))return;const u=this._objectToBoundingSphere(a);if(!b(n,u))return;const l=C(t,e,(0,p.g)(u)),d=l-u[3],h=l+u[3];d<o&&(o=d,s=h,c=a)};return this._forEachNodeDepthOrdered(this._root,(r=>{if(i<=0||!b(n,r.bounds))return!1;if((0,_.g)(G,a,r.halfSize),(0,_.a)(G,G,r.bounds),C(t,e,G)>s)return!1;const o=r.node;return o.terminals.forAll((t=>u(t))),null!==o.residents&&o.residents.forAll((t=>u(t))),!0}),t,e),c}forEachInDepthRange(t,e,n,r,i,o,s){let c=-1/0,a=1/0;const u={setRange:t=>{n===F.DepthOrder.FRONT_TO_BACK?(c=Math.max(c,t.near),a=Math.min(a,t.far)):(c=Math.max(c,-t.far),a=Math.min(a,-t.near))}};u.setRange(r);const l=C(e,n,t),d=P(e,n),h=P(e,-n),f=t=>{if(!s(t))return;const r=this._objectToBoundingSphere(t),d=(0,p.g)(r),h=C(e,n,d)-l,f=h-r[3],_=h+r[3];f>a||_<c||!b(o,r)||i(t,u)};this._forEachNodeDepthOrdered(this._root,(t=>{if(!b(o,t.bounds))return!1;if((0,_.g)(G,d,t.halfSize),(0,_.a)(G,G,t.bounds),C(e,n,G)-l>a)return!1;if((0,_.g)(G,h,t.halfSize),(0,_.a)(G,G,t.bounds),C(e,n,G)-l<c)return!1;const r=t.node;return r.terminals.forAll((t=>f(t))),null!==r.residents&&r.residents.forAll((t=>f(t))),!0}),e,n)}forEachNode(t){this._forEachNode(this._root,(e=>t(e.node,e.bounds,e.halfSize)))}forEachNeighbor(t,e){const n=(0,p.a)(e),r=(0,p.g)(e),i=e=>{const i=this._objectToBoundingSphere(e),o=(0,p.a)(i),s=n+o;(0,_.d)((0,p.g)(i),r)-s*s<=0&&t(e)};this._forEachNode(this._root,(t=>{const e=(0,p.a)(t.bounds),o=n+e;if((0,_.d)((0,p.g)(t.bounds),r)-o*o>0)return!1;const s=t.node;return s.terminals.forAll((t=>i(t))),null!==s.residents&&s.residents.forAll((t=>i(t))),!0})),this.forEachDegenerateObject(i)}_intersectsNode(t,e){return w(e.bounds,2*-e.halfSize,z),w(e.bounds,2*e.halfSize,H),(0,S.yK)(t.origin,t.direction,z,H)}_intersectsNodeWithOffset(t,e,n){return w(e.bounds,2*-e.halfSize,z),w(e.bounds,2*e.halfSize,H),n.applyToMinMax(z,H),(0,S.yK)(t.origin,t.direction,z,H)}_intersectsObject(t,e){const n=this._objectToBoundingSphere(e);return!(n[3]>0)||(0,p.j)(n,t)}_intersectsObjectWithOffset(t,e,n){const r=this._objectToBoundingSphere(e);return!(r[3]>0)||(0,p.j)(n.applyToBoundingSphere(r),t)}_forEachNode(t,e){let n=M.acquire().init(t);const r=[n];for(;0!==r.length;){if(n=r.pop(),e(n)&&!n.isLeaf())for(let t=0;t<n.node.children.length;t++)n.node.children[t]&&r.push(M.acquire().init(n).advance(t));M.release(n)}}_forEachNodeDepthOrdered(t,e,n,r=F.DepthOrder.FRONT_TO_BACK){let i=M.acquire().init(t);const o=[i];for(function(t,e,n){if(!Y.length)for(let t=0;t<8;++t)Y.push({index:0,distance:0});for(let n=0;n<8;++n){const r=D[n];Y.data[n].index=n,Y.data[n].distance=C(t,e,r)}Y.sort(((t,e)=>t.distance-e.distance));for(let t=0;t<8;++t)n[t]=Y.data[t].index}(n,r,$);0!==o.length;){if(i=o.pop(),e(i)&&!i.isLeaf())for(let t=7;t>=0;--t){const e=$[t];i.node.children[e]&&o.push(M.acquire().init(i).advance(e))}M.release(i)}}_remove(t,e,n){W.clear();const r=n.advanceTo(e,((t,e)=>{W.push(t.node),W.push(e)}))?n.node.terminals:n.node.residents;if(r.removeUnordered(t),0===r.length)for(let t=W.length-2;t>=0;t-=2){const e=W.data[t],n=W.data[t+1];if(!this._purge(e,n))break}}_nodeIsEmpty(t){if(0!==t.terminals.length)return!1;if(null!==t.residents)return 0===t.residents.length;for(let e=0;e<t.children.length;e++)if(t.children[e])return!1;return!0}_purge(t,e){return e>=0&&(t.children[e]=null),!!this._nodeIsEmpty(t)&&(null===t.residents&&(t.residents=new N.Z({shrink:!0})),!0)}_add(t,e){e.advanceTo(this._objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depth<this._maximumDepth&&this._split(e))}_split(t){const e=t.node.residents;t.node.residents=null;for(let n=0;n<e.length;n++){const r=M.acquire().init(t);this._add(e.getItemAt(n),r),M.release(r)}}_grow(t,e){if(0!==e&&(L(t,e,(t=>this._objectToBoundingSphere(t)),X),x(X[3])&&!this._fitsInsideTree(X)))if(this._nodeIsEmpty(this._root.node))(0,p.h)(X,this._root.bounds),this._root.halfSize=1.25*X[3];else{const t=this._rootBoundsForRootAsSubNode(X);this._placingRootViolatesMaxDepth(t)?this._rebuildTree(X,t):this._growRootAsSubNode(t),M.release(t)}}_rebuildTree(t,e){(0,_.c)(K,e.bounds),K[3]=e.halfSize,L([t,K],2,(t=>t),Z);const n=M.acquire().init(this._root);this._root.initFrom(null,Z,1.25*Z[3]),this._forEachNode(n,(t=>(this.add(t.node.terminals.data,t.node.terminals.length),null!==t.node.residents&&this.add(t.node.residents.data,t.node.residents.length),!0))),M.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return this._forEachNode(this._root,(t=>(n=Math.max(n,t.depth),n+e<=this._maximumDepth))),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let r=-1/0;const i=this._root.bounds,o=this._root.halfSize;for(let t=0;t<3;t++){const s=i[t]-o-(n[t]-e),c=n[t]+e-(i[t]+o),a=Math.max(0,Math.ceil(s/(2*o))),u=Math.max(0,Math.ceil(c/(2*o)))+1,l=2**Math.ceil(Math.log(a+u)*Math.LOG2E);r=Math.max(r,l),q[t].min=a,q[t].max=u}for(let t=0;t<3;t++){let e=q[t].min,n=q[t].max;const s=(r-(e+n))/2;e+=Math.ceil(s),n+=Math.floor(s);const c=i[t]-o-e*o*2;V[t]=c+(n+e)*o}return V[3]=r*o*B,M.acquire().initFrom(null,V,r*o,0)}_growRootAsSubNode(t){const e=this._root.node;(0,_.c)(X,this._root.bounds),X[3]=this._root.halfSize,this._root.init(t),t.advanceTo(X,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(-1===t)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,r=0;for(;r<e.length&&null==t;)n=r++,t=e[n];for(;r<e.length;)if(e[r++])return-1;return n}_isDegenerate(t){return!x(this._objectToBoundingSphere(t)[3])}_fitsInsideTree(t){const e=this._root.bounds,n=this._root.halfSize;return t[3]<=n&&t[0]>=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}}class M{constructor(){this.bounds=(0,p.c)(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,r=this.depth){return this.node=(0,d.pC)(t)?t:M.createEmptyNode(),(0,d.pC)(e)&&(0,p.h)(e,this.bounds),this.halfSize=n,this.depth=r,this}advance(t){let e=this.node.children[t];e||(e=M.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=D[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.bounds[3]=this.halfSize*B,this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const r=this._childIndex(t);e&&e(this,r),this.advance(r)}}isLeaf(){return null!=this.node.residents}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]<t[0]?1:0)+(e[1]<t[1]?2:0)+(e[2]<t[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new N.Z({shrink:!0}),residents:new N.Z({shrink:!0})}}static acquire(){return M._pool.acquire()}static release(t){M._pool.release(t)}static clearPool(){M._pool.prune()}}function v(t,e){t[0]=Math.min(t[0],e[0]-e[3]),t[1]=Math.min(t[1],e[1]-e[3]),t[2]=Math.min(t[2],e[2]-e[3])}function y(t,e){t[0]=Math.max(t[0],e[0]+e[3]),t[1]=Math.max(t[1],e[1]+e[3]),t[2]=Math.max(t[2],e[2]+e[3])}function w(t,e,n){n[0]=t[0]+e,n[1]=t[1]+e,n[2]=t[2]+e}function L(t,e,n,r){if(1===e){const e=n(t[0]);(0,p.h)(e,r)}else{z[0]=1/0,z[1]=1/0,z[2]=1/0,H[0]=-1/0,H[1]=-1/0,H[2]=-1/0;for(let r=0;r<e;r++){const e=n(t[r]);x(e[3])&&(v(z,e),y(H,e))}(0,_.h)(r,z,H,.5),r[3]=Math.max(H[0]-z[0],H[1]-z[1],H[2]-z[2])/2}}function P(t,e){let n=1/0,r=null;for(let i=0;i<8;++i){const o=C(t,e,U[i]);o<n&&(n=o,r=U[i])}return r}function C(t,e,n){return e*(t[0]*n[0]+t[1]*n[1]+t[2]*n[2])}function x(t){return!isNaN(t)&&t!==-1/0&&t!==1/0&&t>0}M._pool=new O.Z(M),function(t){var e;(e=t.DepthOrder||(t.DepthOrder={}))[e.FRONT_TO_BACK=1]="FRONT_TO_BACK",e[e.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(F||(F={}));const D=[(0,T.f)(-1,-1,-1),(0,T.f)(1,-1,-1),(0,T.f)(-1,1,-1),(0,T.f)(1,1,-1),(0,T.f)(-1,-1,1),(0,T.f)(1,-1,1),(0,T.f)(-1,1,1),(0,T.f)(1,1,1)],U=[(0,T.f)(-1,-1,-1),(0,T.f)(-1,-1,1),(0,T.f)(-1,1,-1),(0,T.f)(-1,1,1),(0,T.f)(1,-1,-1),(0,T.f)(1,-1,1),(0,T.f)(1,1,-1),(0,T.f)(1,1,1)],B=Math.sqrt(3),j=[null],V=(0,p.c)(),G=(0,T.c)(),z=(0,T.c)(),H=(0,T.c)(),W=new N.Z,k=(0,p.c)(),X=(0,p.c)(),K=(0,p.c)(),Z=(0,p.c)(),q=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],Y=new N.Z,$=[0,0,0,0,0,0,0,0],J=F;var Q=n(212);let tt=class{constructor(){this._idToComponent=new Map,this._components=new J((t=>t.bounds)),this._edges=new J((t=>t.bounds)),this._tmpLineSegment=(0,g.Ue)(),this._tmpP1=(0,T.c)(),this._tmpP2=(0,T.c)(),this._tmpP3=(0,T.c)(),this.remoteClient=null}async fetchCandidates(t,e){await Promise.resolve(),(0,h.k_)(e),await this._ensureEdgeLocations(t,e);const n=[];return this._edges.forEachNeighbor((e=>this._addCandidates(t,e,n)),t.bounds),{result:{candidates:n}}}async _ensureEdgeLocations(t,e){const n=[];if(this._components.forEachNeighbor((t=>{if((0,d.Wi)(t.info)){const{id:e,uid:r}=t;n.push({id:e,uid:r})}}),t.bounds),!n.length)return;const r={components:n},i=await this.remoteClient.invoke("fetchAllEdgeLocations",r,(0,d.Pt)(e,{}));for(const t of i.components)this._setFetchEdgeLocations(t)}async add(t){const e=new nt(t.id,t.bounds);return this._idToComponent.set(e.id,e),this._components.add([e]),{result:{}}}async remove(t){const e=this._idToComponent.get(t.id);if(e){const t=[];this._edges.forEachNeighbor((n=>{n.component===e&&t.push(n)}),e.bounds),this._edges.remove(t),this._components.remove([e]),this._idToComponent.delete(e.id)}return{result:{}}}_setFetchEdgeLocations(t){const e=this._idToComponent.get(t.id);if((0,d.Wi)(e)||t.uid!==e.uid)return;const n=Q.n_.createView(t.locations),r=new Array(n.count),i=(0,T.c)(),o=(0,T.c)();for(let s=0;s<n.count;s++){const c=(0,p.c)(),a=(0,p.g)(c);n.position0.getVec(s,i),n.position1.getVec(s,o),(0,_.C)(a,a,i,.5),(0,_.C)(a,a,o,.5),(0,_.a)(a,a,t.origin),c[3]=(0,_.i)(a,i);const u=new rt(e,s,c);r[s]=u}this._edges.add(r);const{objectIds:s,origin:c}=t;e.info={locations:n,objectIds:s,origin:c}}_addCandidates(t,e,n){const{locations:r,origin:i,objectIds:o}=e.component.info,s=r.position0.getVec(e.index,this._tmpP1),c=r.position1.getVec(e.index,this._tmpP2);(0,_.a)(s,s,i),(0,_.a)(c,c,i);const a=o[r.componentIndex.get(e.index)];this._addEdgeCandidate(t,a,s,c,n),this._addVertexCandidate(t,a,s,n),this._addVertexCandidate(t,a,c,n)}_addEdgeCandidate(t,e,n,r,i){if(!(t.types&m.r.EDGE))return;const o=(0,p.g)(t.bounds),s=(0,g.zk)(n,r,this._tmpLineSegment),c=(0,g.nF)(s,o,this._tmpP3);if(!(0,p.m)(t.bounds,c))return null;i.push({type:"edge",objectId:e,target:(0,T.a)(c),distance:(0,_.i)(o,c),start:(0,T.a)(n),end:(0,T.a)(r)})}_addVertexCandidate(t,e,n,r){if(!(t.types&m.r.VERTEX))return;const i=(0,p.g)(t.bounds);if(!(0,p.m)(t.bounds,n))return null;r.push({type:"vertex",objectId:e,target:(0,T.a)(n),distance:(0,_.i)(i,n)})}};tt=(0,l._)([(0,f.j)("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],tt);const et=tt;class nt{constructor(t,e){this.id=t,this.bounds=e,this.info=null,this.uid=++nt.uid}}nt.uid=0;class rt{constructor(t,e,n){this.component=t,this.index=e,this.bounds=n}}},21968:(t,e,n)=>{n.d(e,{G:()=>r});class r{constructor(t,e,n,r,i,o=!1,s=0){this.name=t,this.count=e,this.type=n,this.offset=r,this.stride=i,this.normalized=o,this.divisor=s}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9594],{46851:(t,n,e)=>{e.d(n,{R:()=>i,g:()=>E});let r=1e-6;function E(){return r}const i=Math.random,o=Math.PI/180,_=180/Math.PI;Object.freeze(Object.defineProperty({__proto__:null,getEpsilon:E,setEpsilon:function(t){r=t},RANDOM:i,toRadian:function(t){return t*o},toDegree:function(t){return t*_},equals:function(t,n){return Math.abs(t-n)<=r*Math.max(1,Math.abs(t),Math.abs(n))}},Symbol.toStringTag,{value:"Module"}))},17896:(t,n,e)=>{e.d(n,{C:()=>c,H:()=>A,a:()=>s,b:()=>T,c:()=>o,d:()=>N,e:()=>I,f:()=>S,g:()=>R,h:()=>l,i:()=>u,k:()=>d,l:()=>i,m:()=>M,n:()=>O,p:()=>f,q:()=>L,r:()=>P,s:()=>_,t:()=>C,u:()=>g});var r=e(65617),E=e(46851);function i(t){const n=t[0],e=t[1],r=t[2];return Math.sqrt(n*n+e*e+r*r)}function o(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function _(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}function s(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function T(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function a(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t}function A(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t}function R(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function c(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t}function u(t,n){const e=n[0]-t[0],r=n[1]-t[1],E=n[2]-t[2];return Math.sqrt(e*e+r*r+E*E)}function N(t,n){const e=n[0]-t[0],r=n[1]-t[1],E=n[2]-t[2];return e*e+r*r+E*E}function f(t){const n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function O(t,n){const e=n[0],r=n[1],E=n[2];let i=e*e+r*r+E*E;return i>0&&(i=1/Math.sqrt(i),t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i),t}function I(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function S(t,n,e){const r=n[0],E=n[1],i=n[2],o=e[0],_=e[1],s=e[2];return t[0]=E*s-i*_,t[1]=i*o-r*s,t[2]=r*_-E*o,t}function l(t,n,e,r){const E=n[0],i=n[1],o=n[2];return t[0]=E+r*(e[0]-E),t[1]=i+r*(e[1]-i),t[2]=o+r*(e[2]-o),t}function M(t,n,e){const r=n[0],E=n[1],i=n[2];return t[0]=e[0]*r+e[4]*E+e[8]*i+e[12],t[1]=e[1]*r+e[5]*E+e[9]*i+e[13],t[2]=e[2]*r+e[6]*E+e[10]*i+e[14],t}function C(t,n,e){const r=n[0],E=n[1],i=n[2];return t[0]=r*e[0]+E*e[3]+i*e[6],t[1]=r*e[1]+E*e[4]+i*e[7],t[2]=r*e[2]+E*e[5]+i*e[8],t}function L(t,n,e){const r=e[0],E=e[1],i=e[2],o=e[3],_=n[0],s=n[1],T=n[2];let a=E*T-i*s,A=i*_-r*T,R=r*s-E*_,c=E*R-i*A,u=i*a-r*R,N=r*A-E*a;const f=2*o;return a*=f,A*=f,R*=f,c*=2,u*=2,N*=2,t[0]=_+a+c,t[1]=s+A+u,t[2]=T+R+N,t}const h=(0,r.c)(),D=(0,r.c)();function d(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function P(t,n,e){const r=e[0]-n[0],E=e[1]-n[1],i=e[2]-n[2];let o=r*r+E*E+i*i;return o>0?(o=1/Math.sqrt(o),t[0]=r*o,t[1]=E*o,t[2]=i*o,t):(t[0]=0,t[1]=0,t[2]=0,t)}const U=T,G=a,F=A,B=u,p=N,g=i,m=f;Object.freeze(Object.defineProperty({__proto__:null,length:i,copy:o,set:_,add:s,subtract:T,multiply:a,divide:A,ceil:function(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t},floor:function(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t},abs:function(t,n){return t[0]=Math.abs(n[0]),t[1]=Math.abs(n[1]),t[2]=Math.abs(n[2]),t},sign:function(t,n){return t[0]=Math.sign(n[0]),t[1]=Math.sign(n[1]),t[2]=Math.sign(n[2]),t},min:function(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t[2]=Math.min(n[2],e[2]),t},max:function(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t[2]=Math.max(n[2],e[2]),t},round:function(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t},scale:R,scaleAndAdd:c,distance:u,squaredDistance:N,squaredLength:f,negate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t},inverse:function(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t},normalize:O,dot:I,cross:S,lerp:l,hermite:function(t,n,e,r,E,i){const o=i*i,_=o*(2*i-3)+1,s=o*(i-2)+i,T=o*(i-1),a=o*(3-2*i);return t[0]=n[0]*_+e[0]*s+r[0]*T+E[0]*a,t[1]=n[1]*_+e[1]*s+r[1]*T+E[1]*a,t[2]=n[2]*_+e[2]*s+r[2]*T+E[2]*a,t},bezier:function(t,n,e,r,E,i){const o=1-i,_=o*o,s=i*i,T=_*o,a=3*i*_,A=3*s*o,R=s*i;return t[0]=n[0]*T+e[0]*a+r[0]*A+E[0]*R,t[1]=n[1]*T+e[1]*a+r[1]*A+E[1]*R,t[2]=n[2]*T+e[2]*a+r[2]*A+E[2]*R,t},random:function(t,n){n=n||1;const e=E.R,r=2*e()*Math.PI,i=2*e()-1,o=Math.sqrt(1-i*i)*n;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=i*n,t},transformMat4:M,transformMat3:C,transformQuat:L,rotateX:function(t,n,e,r){const E=[],i=[];return E[0]=n[0]-e[0],E[1]=n[1]-e[1],E[2]=n[2]-e[2],i[0]=E[0],i[1]=E[1]*Math.cos(r)-E[2]*Math.sin(r),i[2]=E[1]*Math.sin(r)+E[2]*Math.cos(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t},rotateY:function(t,n,e,r){const E=[],i=[];return E[0]=n[0]-e[0],E[1]=n[1]-e[1],E[2]=n[2]-e[2],i[0]=E[2]*Math.sin(r)+E[0]*Math.cos(r),i[1]=E[1],i[2]=E[2]*Math.cos(r)-E[0]*Math.sin(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t},rotateZ:function(t,n,e,r){const E=[],i=[];return E[0]=n[0]-e[0],E[1]=n[1]-e[1],E[2]=n[2]-e[2],i[0]=E[0]*Math.cos(r)-E[1]*Math.sin(r),i[1]=E[0]*Math.sin(r)+E[1]*Math.cos(r),i[2]=E[2],t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t},angle:function(t,n){o(h,t),o(D,n),O(h,h),O(D,D);const e=I(h,D);return e>1?0:e<-1?Math.PI:Math.acos(e)},str:function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},exactEquals:d,equals:function(t,n){if(t===n)return!0;const e=t[0],r=t[1],i=t[2],o=n[0],_=n[1],s=n[2],T=(0,E.g)();return Math.abs(e-o)<=T*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(r-_)<=T*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-s)<=T*Math.max(1,Math.abs(i),Math.abs(s))},direction:P,sub:U,mul:G,div:F,dist:B,sqrDist:p,len:g,sqrLen:m},Symbol.toStringTag,{value:"Module"}))},65617:(t,n,e)=>{function r(){return[0,0,0]}function E(t){return[t[0],t[1],t[2]]}function i(t,n,e){return[t,n,e]}function o(t){const n=[0,0,0],e=Math.min(3,t.length);for(let r=0;r<e;++r)n[r]=t[r];return n}function _(t,n){return new Float64Array(t,n,3)}function s(){return i(1,1,1)}function T(){return i(1,0,0)}function a(){return i(0,1,0)}function A(){return i(0,0,1)}e.d(n,{O:()=>c,Z:()=>R,a:()=>E,b:()=>_,c:()=>r,d:()=>o,f:()=>i});const R=[0,0,0],c=s(),u=T(),N=a(),f=A();Object.freeze(Object.defineProperty({__proto__:null,create:r,clone:E,fromValues:i,fromArray:o,createView:_,zeros:function(){return[0,0,0]},ones:s,unitX:T,unitY:a,unitZ:A,ZEROS:R,ONES:c,UNIT_X:u,UNIT_Y:N,UNIT_Z:f},Symbol.toStringTag,{value:"Module"}))},98766:(t,n,e)=>{e.d(n,{a:()=>o,b:()=>a,c:()=>E,d:()=>f,e:()=>c,f:()=>u,g:()=>I,h:()=>S,l:()=>O,n:()=>N,s:()=>i});var r=e(46851);function E(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function i(t,n,e,r,E){return t[0]=n,t[1]=e,t[2]=r,t[3]=E,t}function o(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t}function _(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t}function s(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t[3]=n[3]*e[3],t}function T(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t[3]=n[3]/e[3],t}function a(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t}function A(t,n){const e=n[0]-t[0],r=n[1]-t[1],E=n[2]-t[2],i=n[3]-t[3];return Math.sqrt(e*e+r*r+E*E+i*i)}function R(t,n){const e=n[0]-t[0],r=n[1]-t[1],E=n[2]-t[2],i=n[3]-t[3];return e*e+r*r+E*E+i*i}function c(t){const n=t[0],e=t[1],r=t[2],E=t[3];return Math.sqrt(n*n+e*e+r*r+E*E)}function u(t){const n=t[0],e=t[1],r=t[2],E=t[3];return n*n+e*e+r*r+E*E}function N(t,n){const e=n[0],r=n[1],E=n[2],i=n[3];let o=e*e+r*r+E*E+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e*o,t[1]=r*o,t[2]=E*o,t[3]=i*o),t}function f(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function O(t,n,e,r){const E=n[0],i=n[1],o=n[2],_=n[3];return t[0]=E+r*(e[0]-E),t[1]=i+r*(e[1]-i),t[2]=o+r*(e[2]-o),t[3]=_+r*(e[3]-_),t}function I(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function S(t,n){const e=t[0],E=t[1],i=t[2],o=t[3],_=n[0],s=n[1],T=n[2],a=n[3],A=(0,r.g)();return Math.abs(e-_)<=A*Math.max(1,Math.abs(e),Math.abs(_))&&Math.abs(E-s)<=A*Math.max(1,Math.abs(E),Math.abs(s))&&Math.abs(i-T)<=A*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(o-a)<=A*Math.max(1,Math.abs(o),Math.abs(a))}const l=_,M=s,C=T,L=A,h=R,D=c,d=u;Object.freeze(Object.defineProperty({__proto__:null,copy:E,set:i,add:o,subtract:_,multiply:s,divide:T,ceil:function(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t[3]=Math.ceil(n[3]),t},floor:function(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t[3]=Math.floor(n[3]),t},min:function(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t[2]=Math.min(n[2],e[2]),t[3]=Math.min(n[3],e[3]),t},max:function(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t[2]=Math.max(n[2],e[2]),t[3]=Math.max(n[3],e[3]),t},round:function(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t[3]=Math.round(n[3]),t},scale:a,scaleAndAdd:function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t},distance:A,squaredDistance:R,length:c,squaredLength:u,negate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=-n[3],t},inverse:function(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t[3]=1/n[3],t},normalize:N,dot:f,lerp:O,random:function(t,n){const e=r.R;let E,i,o,_,s,T;n=n||1;do{E=2*e()-1,i=2*e()-1,s=E*E+i*i}while(s>=1);do{o=2*e()-1,_=2*e()-1,T=o*o+_*_}while(T>=1);const a=Math.sqrt((1-s)/T);return t[0]=n*E,t[1]=n*i,t[2]=n*o*a,t[3]=n*_*a,t},transformMat4:function(t,n,e){const r=n[0],E=n[1],i=n[2],o=n[3];return t[0]=e[0]*r+e[4]*E+e[8]*i+e[12]*o,t[1]=e[1]*r+e[5]*E+e[9]*i+e[13]*o,t[2]=e[2]*r+e[6]*E+e[10]*i+e[14]*o,t[3]=e[3]*r+e[7]*E+e[11]*i+e[15]*o,t},transformQuat:function(t,n,e){const r=n[0],E=n[1],i=n[2],o=e[0],_=e[1],s=e[2],T=e[3],a=T*r+_*i-s*E,A=T*E+s*r-o*i,R=T*i+o*E-_*r,c=-o*r-_*E-s*i;return t[0]=a*T+c*-o+A*-s-R*-_,t[1]=A*T+c*-_+R*-o-a*-s,t[2]=R*T+c*-s+a*-_-A*-o,t[3]=n[3],t},str:function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},exactEquals:I,equals:S,sub:l,mul:M,div:C,dist:L,sqrDist:h,len:D,sqrLen:d},Symbol.toStringTag,{value:"Module"}))},22021:(t,n,e)=>{e.d(n,{BV:()=>A,Kt:()=>c,Sf:()=>i,Vl:()=>a,ZF:()=>R,fp:()=>s,jE:()=>O,oK:()=>N,oc:()=>I,t7:()=>T,uZ:()=>o,wt:()=>_});var r=e(17896);e(98766);const E=new Float32Array(1);function i(t){--t;for(let n=1;n<32;n<<=1)t|=t>>n;return t+1}function o(t,n,e){return Math.min(Math.max(t,n),e)}function _(t){return 0==(t&t-1)}function s(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}function T(t,n,e){return t+(n-t)*e}function a(t){return t*Math.PI/180}function A(t){return 180*t/Math.PI}function R(t){return Math.acos(o(t,-1,1))}function c(t){return Math.asin(o(t,-1,1))}function u(t,n,e=1e-6){return!isNaN(t)&&!isNaN(n)&&(t>n?t-n:n-t)<=e}function N(t){return f(Math.max(-S,Math.min(t,S)))}function f(t){return E[0]=t,E[0]}function O(t,n){const e=(0,r.l)(t),E=c(t[2]/e),i=Math.atan2(t[1]/e,t[0]/e);return(0,r.s)(n,e,E,i),n}function I(t){const n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],e=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],r=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(u(n,1)&&u(e,1)&&u(r,1))}const S=f(34028234663852886e22)},79583:(t,n,e)=>{function r(t){switch(t){case"u8":case"i8":return 1;case"u16":case"i16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}function E(t){switch(t){case"u8":case"u16":case"u32":return!1;case"i8":case"i16":case"i32":case"f32":case"f64":return!0}}function i(t){switch(t){case"u8":case"u16":case"u32":case"i8":case"i16":case"i32":return!0;case"f32":case"f64":return!1}}function o(t){switch(t){case"u8":return 255;case"u16":return 65535;case"u32":return 4294967295;case"i8":return 127;case"i16":return 32767;case"i32":return 2147483647;case"f32":return 3402823e32;case"f64":return 179769e303}}e.d(n,{B3:()=>E,Op:()=>o,U:()=>i,n1:()=>r})},47545:(t,n,e)=>{e.d(n,{d:()=>E});var r=e(22021);function E(t,n,e){const E=t.byteLength/(4*n),T=new Uint32Array(t,0,E*n);let a=new Uint32Array(E);const A=e?.minReduction??0,R=e?.originalIndices||null,c=R?R.length:0,u=e?.componentOffsets||null;let N=0;if(u)for(let t=0;t<u.length-1;t++){const n=u[t+1]-u[t];n>N&&(N=n)}else N=E;const f=Math.floor(1.1*N)+1;(null==s||s.length<2*f)&&(s=new Uint32Array((0,r.Sf)(2*f)));for(let t=0;t<2*f;t++)s[t]=0;let O=0;const I=!!u&&!!R,S=I?c:E,l=I?new Uint32Array(c):null,M=1.96;let C=0!==A?Math.ceil(4*M*M/(A*A)*A*(1-A)):S,L=1,h=u?u[1]:S;for(let t=0;t<S;t++){if(t===C){const n=1-O/t;if(n+M*Math.sqrt(n*(1-n)/t)<A)return null;C*=2}if(t===h){for(let t=0;t<2*f;t++)s[t]=0;if(R)for(let t=u[L-1];t<u[L];t++)l[t]=a[R[t]];h=u[++L]}const e=I?R[t]:t,r=e*n,E=_(T,r,n);let o=E%f,c=O;for(;0!==s[2*o+1];){if(s[2*o]===E){const t=s[2*o+1]-1;if(i(T,r,t*n,n)){c=a[t];break}}o++,o>=f&&(o-=f)}c===O&&(s[2*o]=E,s[2*o+1]=e+1,O++),a[e]=c}if(0!==A&&1-O/E<A)return null;if(I){for(let t=u[L-1];t<l.length;t++)l[t]=a[R[t]];a=l}const D=new Uint32Array(n*O);O=0;for(let t=0;t<S;t++)a[t]===O&&(o(T,(I?R[t]:t)*n,D,O*n,n),O++);if(R&&!I){const t=new Uint32Array(c);for(let n=0;n<t.length;n++)t[n]=a[R[n]];a=t}return{buffer:D.buffer,indices:a,uniqueCount:O}}function i(t,n,e,r){for(let E=0;E<r;E++)if(t[n+E]!==t[e+E])return!1;return!0}function o(t,n,e,r,E){for(let i=0;i<E;i++)e[r+i]=t[n+i]}function _(t,n,e){let r=0;for(let E=0;E<e;E++)r=t[n+E]+r|0,r=r+(r<<11)+(r>>>2)|0;return r>>>0}let s=null},65576:(t,n,e)=>{e.d(n,{U$:()=>_});var r=e(56481),E=e(79583);class i{constructor(t,n){this.layout=t,this.buffer="number"==typeof n?new ArrayBuffer(n*t.stride):n;for(const n of t.fieldNames){const e=t.fields.get(n);this[n]=new e.constructor(this.buffer,e.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(t,n){const e=this[t];return e&&e.elementCount===n.ElementCount&&e.elementType===n.ElementType?e:null}slice(t,n){return new i(this.layout,this.buffer.slice(t*this.stride,n*this.stride))}copyFrom(t,n,e,r){const E=this.stride;if(E%4==0){const i=new Uint32Array(t.buffer,n*E,r*E/4);new Uint32Array(this.buffer,e*E,r*E/4).set(i)}else{const i=new Uint8Array(t.buffer,n*E,r*E);new Uint8Array(this.buffer,e*E,r*E).set(i)}}}class o{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(t,n){return this._appendField(t,r.Eu,n),this}vec2f64(t,n){return this._appendField(t,r.q6,n),this}vec3f(t,n){return this._appendField(t,r.ct,n),this}vec3f64(t,n){return this._appendField(t,r.fP,n),this}vec4f(t,n){return this._appendField(t,r.ek,n),this}vec4f64(t,n){return this._appendField(t,r.Cd,n),this}mat3f(t,n){return this._appendField(t,r.gK,n),this}mat3f64(t,n){return this._appendField(t,r.ey,n),this}mat4f(t,n){return this._appendField(t,r.bj,n),this}mat4f64(t,n){return this._appendField(t,r.O1,n),this}vec4u8(t,n){return this._appendField(t,r.mc,n),this}f32(t,n){return this._appendField(t,r.ly,n),this}f64(t,n){return this._appendField(t,r.oS,n),this}u8(t,n){return this._appendField(t,r.D_,n),this}u16(t,n){return this._appendField(t,r.av,n),this}i8(t,n){return this._appendField(t,r.Hz,n),this}vec2i8(t,n){return this._appendField(t,r.Vs,n),this}vec2i16(t,n){return this._appendField(t,r.or,n),this}vec2u8(t,n){return this._appendField(t,r.xA,n),this}vec4u16(t,n){return this._appendField(t,r.v6,n),this}u32(t,n){return this._appendField(t,r.Nu,n),this}_appendField(t,n,e){const r=n.ElementCount*(0,E.n1)(n.ElementType),i=this.stride;this.fields.set(t,{size:r,constructor:n,offset:i,optional:e}),this.stride+=r,this.fieldNames.push(t)}alignTo(t){return this.stride=Math.floor((this.stride+t-1)/t)*t,this}hasField(t){return this.fieldNames.includes(t)}createBuffer(t){return new i(this,t)}createView(t){return new i(this,t)}clone(){const t=new o;return t.stride=this.stride,t.fields=new Map,this.fields.forEach(((n,e)=>t.fields.set(e,n))),t.fieldNames=this.fieldNames.slice(),t.BufferType=this.BufferType,t}}function _(){return new o}},5329:(t,n,e)=>{e.d(n,{K:()=>i});var r=e(35371),E=e(21968);function i(t,n=0){const e=t.stride;return t.fieldNames.filter((n=>{const e=t.fields.get(n).optional;return!(e&&e.glPadding)})).map((r=>{const i=t.fields.get(r),_=i.constructor.ElementCount,s=o(i.constructor.ElementType),T=i.offset,a=!(!i.optional||!i.optional.glNormalized);return new E.G(r,_,s,T,e,a,n)}))}function o(t){const n=_[t];if(n)return n;throw new Error("BufferType not supported in WebGL")}const _={u8:r.g.UNSIGNED_BYTE,u16:r.g.UNSIGNED_SHORT,u32:r.g.UNSIGNED_INT,i8:r.g.BYTE,i16:r.g.SHORT,i32:r.g.INT,f32:r.g.FLOAT}},35065:(t,n,e)=>{var r;e.d(n,{T:()=>r}),function(t){t.POSITION="position",t.NORMAL="normal",t.UV0="uv0",t.AUXPOS1="auxpos1",t.AUXPOS2="auxpos2",t.MAPPOS="mapPos",t.COLOR="color",t.SYMBOLCOLOR="symbolColor",t.SIZE="size",t.TANGENT="tangent",t.OFFSET="offset",t.SUBDIVISIONFACTOR="subdivisionFactor",t.COLORFEATUREATTRIBUTE="colorFeatureAttribute",t.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",t.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",t.DISTANCETOSTART="distanceToStart",t.UVMAPSPACE="uvMapSpace",t.BOUNDINGRECT="boundingRect",t.UVREGION="uvRegion",t.NORMALCOMPRESSED="normalCompressed",t.PROFILERIGHT="profileRight",t.PROFILEUP="profileUp",t.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",t.FEATUREVALUE="featureValue",t.MODELORIGINHI="modelOriginHi",t.MODELORIGINLO="modelOriginLo",t.MODEL="model",t.MODELNORMAL="modelNormal",t.INSTANCECOLOR="instanceColor",t.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",t.LOCALTRANSFORM="localTransform",t.GLOBALTRANSFORM="globalTransform",t.BOUNDINGSPHERE="boundingSphere",t.MODELORIGIN="modelOrigin",t.MODELSCALEFACTORS="modelScaleFactors",t.FEATUREATTRIBUTE="featureAttribute",t.STATE="state",t.LODLEVEL="lodLevel",t.POSITION0="position0",t.POSITION1="position1",t.NORMALA="normalA",t.NORMALB="normalB",t.COMPONENTINDEX="componentIndex",t.VARIANTOFFSET="variantOffset",t.VARIANTSTROKE="variantStroke",t.VARIANTEXTENSION="variantExtension",t.U8PADDING="u8padding",t.U16PADDING="u16padding",t.SIDENESS="sideness",t.START="start",t.END="end",t.UP="up",t.EXTRUDE="extrude"}(r||(r={}))},49594:(t,n,e)=>{e.r(n),e.d(n,{default:()=>R});var r=e(56481);function E(t,n){return n.push(t.buffer),{buffer:t.buffer,layout:i(t.layout)}}function i(t){const n=new Array;return t.fields.forEach(((t,e)=>{const r={...t,constructor:_(t.constructor)};n.push([e,r])})),{stride:t.stride,fields:n,fieldNames:t.fieldNames}}e(65576);const o=[r.ly,r.Eu,r.ct,r.ek,r.gK,r.bj,r.oS,r.q6,r.fP,r.Cd,r.ey,r.O1,r.D_,r.xA,r.ne,r.mc,r.av,r.TS,r.mw,r.v6,r.Nu,r.qt,r.G5,r.hu,r.Hz,r.Vs,r.P_,r.ir,r.o7,r.or,r.n1,r.zO,r.Jj,r.wA,r.PP,r.TN];function _(t){return`${t.ElementType}_${t.ElementCount}`}const s=new Map;o.forEach((t=>s.set(_(t),t)));var T=e(17288),a=e(97411),A=e(212);class R{async extract(t){const n=c(t),e=(0,A.Kl)(n),r=[n.data.buffer];return{result:u(e,r),transferList:r}}async extractComponentsEdgeLocations(t){const n=c(t),e=(0,A.kY)(n.data,n.skipDeduplicate,n.indices,n.indicesLength),r=[];return{result:E((0,a.n)(e,f,O).regular.instancesData,r),transferList:r}}async extractEdgeLocations(t){const n=c(t),e=(0,A.kY)(n.data,n.skipDeduplicate,n.indices,n.indicesLength),r=[];return{result:E((0,a.n)(e,N,O).regular.instancesData,r),transferList:r}}}function c(t){return{data:T.tf.createView(t.dataBuffer),indices:"Uint32Array"===t.indicesType?new Uint32Array(t.indicesBuffer):"Uint16Array"===t.indicesType?new Uint16Array(t.indicesBuffer):void 0,indicesLength:t.indicesLength,writerSettings:t.writerSettings,skipDeduplicate:t.skipDeduplicate}}function u(t,n){return n.push(t.regular.lodInfo.lengths.buffer),n.push(t.silhouette.lodInfo.lengths.buffer),{regular:{instancesData:E(t.regular.instancesData,n),lodInfo:{lengths:t.regular.lodInfo.lengths.buffer}},silhouette:{instancesData:E(t.silhouette.instancesData,n),lodInfo:{lengths:t.silhouette.lodInfo.lengths.buffer}},averageEdgeLength:t.averageEdgeLength}}const N=new class{allocate(t){return A.Yr.createBuffer(t)}trim(t,n){return t.slice(0,n)}write(t,n,e){t.position0.setVec(n,e.position0),t.position1.setVec(n,e.position1)}},f=new class{allocate(t){return A.n_.createBuffer(t)}trim(t,n){return t.slice(0,n)}write(t,n,e){t.position0.setVec(n,e.position0),t.position1.setVec(n,e.position1),t.componentIndex.set(n,e.componentIndex)}},O={allocate:()=>null,write:()=>{},trim:()=>null}},17288:(t,n,e)=>{e.d(n,{Hr:()=>a,dG:()=>T,tf:()=>o});var r=e(5329),E=e(65576),i=e(35065);const o=(0,E.U$)().vec3f(i.T.POSITION).u16(i.T.COMPONENTINDEX).u16(i.T.U16PADDING),_=(0,E.U$)().vec2u8(i.T.SIDENESS),s=((0,r.K)(_),(0,E.U$)().vec3f(i.T.POSITION0).vec3f(i.T.POSITION1).u16(i.T.COMPONENTINDEX).u8(i.T.VARIANTOFFSET,{glNormalized:!0}).u8(i.T.VARIANTSTROKE).u8(i.T.VARIANTEXTENSION,{glNormalized:!0}).u8(i.T.U8PADDING,{glPadding:!0}).u16(i.T.U16PADDING,{glPadding:!0})),T=s.clone().vec3f(i.T.NORMAL),a=s.clone().vec3f(i.T.NORMALA).vec3f(i.T.NORMALB);new Map([[i.T.POSITION0,0],[i.T.POSITION1,1],[i.T.COMPONENTINDEX,2],[i.T.VARIANTOFFSET,3],[i.T.VARIANTSTROKE,4],[i.T.VARIANTEXTENSION,5],[i.T.NORMAL,6],[i.T.NORMALA,6],[i.T.NORMALB,7],[i.T.SIDENESS,8]])},97411:(t,n,e)=>{e.d(n,{n:()=>A});var r=e(67676),E=e(22021),i=e(1533),o=e(17896),_=e(65617);const s=-1;var T,a;function A(t,n,e,_=I){const T=t.vertices.position,a=t.vertices.componentIndex,A=(0,E.Vl)(_.anglePlanar),O=(0,E.Vl)(_.angleSignificantEdge),S=Math.cos(O),l=Math.cos(A),M=f.edge,C=M.position0,L=M.position1,h=M.faceNormal0,D=M.faceNormal1,d=N(t),P=function(t){const n=t.faces.length/3,e=t.faces,r=t.neighbors;let E=0;for(let t=0;t<n;t++){const n=r[3*t+0],i=r[3*t+1],o=r[3*t+2],_=e[3*t+0],T=e[3*t+1],a=e[3*t+2];E+=n===s||_<T?1:0,E+=i===s||T<a?1:0,E+=o===s||a<_?1:0}const i=new Int32Array(4*E);let o=0;for(let t=0;t<n;t++){const n=r[3*t+0],E=r[3*t+1],_=r[3*t+2],T=e[3*t+0],a=e[3*t+1],A=e[3*t+2];(n===s||T<a)&&(i[o++]=T,i[o++]=a,i[o++]=t,i[o++]=n),(E===s||a<A)&&(i[o++]=a,i[o++]=A,i[o++]=t,i[o++]=E),(_===s||A<T)&&(i[o++]=A,i[o++]=T,i[o++]=t,i[o++]=_)}return i}(t),U=P.length/4,G=n.allocate(U);let F=0;const B=U,p=e.allocate(B);let g=0,m=0,H=0;const b=(0,r.w6)(0,U),V=new Float32Array(U);(0,i.Ed)(V,((t,n,e)=>{T.getVec(P[4*n+0],C),T.getVec(P[4*n+1],L),e[n]=(0,o.i)(C,L)})),b.sort(((t,n)=>V[n]-V[t]));const v=new Array,w=new Array;for(let t=0;t<U;t++){const r=b[t],E=V[r],i=P[4*r+0],_=P[4*r+1],N=P[4*r+2],f=P[4*r+3],O=f===s;if(T.getVec(i,C),T.getVec(_,L),O)(0,o.s)(h,d[3*N+0],d[3*N+1],d[3*N+2]),(0,o.c)(D,h),M.componentIndex=a.get(i),M.cosAngle=(0,o.e)(h,D);else{if((0,o.s)(h,d[3*N+0],d[3*N+1],d[3*N+2]),(0,o.s)(D,d[3*f+0],d[3*f+1],d[3*f+2]),M.componentIndex=a.get(i),M.cosAngle=(0,o.e)(h,D),c(M,l))continue;M.cosAngle<-.9999&&(0,o.c)(D,h)}m+=E,H++,O||R(M,S)?(n.write(G,F++,M),v.push(E)):u(M,A)&&(e.write(p,g++,M),w.push(E))}const y=new Float32Array(v.reverse()),Y=new Float32Array(w.reverse());return{regular:{instancesData:n.trim(G,F),lodInfo:{lengths:y}},silhouette:{instancesData:e.trim(p,g),lodInfo:{lengths:Y}},averageEdgeLength:m/H}}function R(t,n){return t.cosAngle<n}function c(t,n){return t.cosAngle>n}function u(t,n){const e=(0,E.ZF)(t.cosAngle),r=f.fwd,i=f.ortho;return(0,o.r)(r,t.position1,t.position0),e*((0,o.e)((0,o.f)(i,t.faceNormal0,t.faceNormal1),r)>0?-1:1)>n}function N(t){const n=t.faces.length/3,e=t.vertices.position,r=t.faces,E=O.v0,i=O.v1,_=O.v2,s=new Float32Array(3*n);for(let t=0;t<n;t++){const n=r[3*t+0],T=r[3*t+1],a=r[3*t+2];e.getVec(n,E),e.getVec(T,i),e.getVec(a,_),(0,o.b)(i,i,E),(0,o.b)(_,_,E),(0,o.f)(E,i,_),(0,o.n)(E,E),s[3*t+0]=E[0],s[3*t+1]=E[1],s[3*t+2]=E[2]}return s}(a=T||(T={}))[a.SOLID=0]="SOLID",a[a.SKETCH=1]="SKETCH";const f={edge:{position0:(0,_.c)(),position1:(0,_.c)(),faceNormal0:(0,_.c)(),faceNormal1:(0,_.c)(),componentIndex:0,cosAngle:0},ortho:(0,_.c)(),fwd:(0,_.c)()},O={v0:(0,_.c)(),v1:(0,_.c)(),v2:(0,_.c)()},I={anglePlanar:4,angleSignificantEdge:35}},212:(t,n,e)=>{e.d(n,{Kl:()=>h,n_:()=>G,kY:()=>D,Yr:()=>U});var r=e(47545);function E(t,n,e){const r=n/3,E=new Uint32Array(e+1),i=new Uint32Array(e+1),o=(t,n)=>{t<n?E[t+1]++:i[n+1]++};for(let n=0;n<r;n++){const e=t[3*n],r=t[3*n+1],E=t[3*n+2];o(e,r),o(r,E),o(E,e)}let _=0,s=0;for(let t=0;t<e;t++){const n=E[t+1],e=i[t+1];E[t+1]=_,i[t+1]=s,_+=n,s+=e}const T=new Uint32Array(6*r),a=E[e],A=(t,n,e)=>{if(t<n){const r=E[t+1]++;T[2*r]=n,T[2*r+1]=e}else{const r=i[n+1]++;T[2*a+2*r]=t,T[2*a+2*r+1]=e}};for(let n=0;n<r;n++){const e=t[3*n],r=t[3*n+1],E=t[3*n+2];A(e,r,n),A(r,E,n),A(E,e,n)}const R=(t,n)=>{const e=2*t,r=n-t;for(let t=1;t<r;t++){const n=T[e+2*t],r=T[e+2*t+1];let E=t-1;for(;E>=0&&T[e+2*E]>n;E--)T[e+2*E+2]=T[e+2*E],T[e+2*E+3]=T[e+2*E+1];T[e+2*E+2]=n,T[e+2*E+3]=r}};for(let t=0;t<e;t++)R(E[t],E[t+1]),R(a+i[t],a+i[t+1]);const c=new Int32Array(3*r),u=(n,e)=>n===t[3*e]?0:n===t[3*e+1]?1:n===t[3*e+2]?2:-1,N=(t,n)=>{const e=u(t,n);c[3*n+e]=-1},f=(t,n,e,r)=>{const E=u(t,n);c[3*n+E]=r;const i=u(e,r);c[3*r+i]=n};for(let t=0;t<e;t++){let n=E[t];const e=E[t+1];let r=i[t];const o=i[t+1];for(;n<e&&r<o;){const e=T[2*n],E=T[2*a+2*r];e===E?(f(t,T[2*n+1],E,T[2*a+2*r+1]),n++,r++):e<E?(N(t,T[2*n+1]),n++):(N(E,T[2*a+2*r+1]),r++)}for(;n<e;)N(t,T[2*n+1]),n++;for(;r<o;)N(T[2*a+2*r],T[2*a+2*r+1]),r++}return c}var i=e(65576),o=e(35065),_=e(17288),s=e(77734),T=e(17896),a=e(65617),A=e(5329);class R{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?O:f}write(t,n,e){const r=this._edgeHashFunction(e);C.seed=r;const E=C.getIntRange(0,255),i=C.getIntRange(0,this.settings.variants-1),o=C.getFloat(),_=255*(.5*function(t,n){const e=t<0?-1:1;return Math.abs(t)**1.2*e}(-(1-Math.min(o/.7,1))+Math.max(0,o-.7)/(1-.7))+.5);t.position0.setVec(n,e.position0),t.position1.setVec(n,e.position1),t.componentIndex.set(n,e.componentIndex),t.variantOffset.set(n,E),t.variantStroke.set(n,i),t.variantExtension.set(n,_)}trim(t,n){return t.slice(0,n)}}const c=new Float32Array(6),u=new Uint32Array(c.buffer),N=new Uint32Array(1);function f(t){const n=c;n[0]=t.position0[0],n[1]=t.position0[1],n[2]=t.position0[2],n[3]=t.position1[0],n[4]=t.position1[1],n[5]=t.position1[2],N[0]=5381;for(let t=0;t<u.length;t++)N[0]=31*N[0]+u[t];return N[0]}function O(t){const n=c;n[0]=I(t.position0[0]),n[1]=I(t.position0[1]),n[2]=I(t.position0[2]),n[3]=I(t.position1[0]),n[4]=I(t.position1[1]),n[5]=I(t.position1[2]),N[0]=5381;for(let t=0;t<u.length;t++)N[0]=31*N[0]+u[t];return N[0]}function I(t){return Math.round(1e4*t)/1e4}class S{constructor(){this._commonWriter=new R}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return _.dG.createBuffer(t)}write(t,n,e){this._commonWriter.write(t,n,e),(0,T.a)(M,e.faceNormal0,e.faceNormal1),(0,T.n)(M,M),t.normal.setVec(n,M)}trim(t,n){return this._commonWriter.trim(t,n)}}S.Layout=_.dG,S.glLayout=(0,A.K)(_.dG,1);class l{constructor(){this._commonWriter=new R}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return _.Hr.createBuffer(t)}write(t,n,e){this._commonWriter.write(t,n,e),t.normalA.setVec(n,e.faceNormal0),t.normalB.setVec(n,e.faceNormal1)}trim(t,n){return this._commonWriter.trim(t,n)}}l.Layout=_.Hr,l.glLayout=(0,A.K)(_.Hr,1);const M=(0,a.c)(),C=new s.Z;var L=e(97411);function h(t){const n=D(t.data,t.skipDeduplicate,t.indices,t.indicesLength);return d.updateSettings(t.writerSettings),P.updateSettings(t.writerSettings),(0,L.n)(n,d,P)}function D(t,n,e,i){if(n)return{faces:e,facesLength:i,neighbors:E(e,i,t.count),vertices:t};const o=(0,r.d)(t.buffer,t.stride/4,{originalIndices:e,originalIndicesLength:i}),s=E(o.indices,i,o.uniqueCount);return{faces:o.indices,facesLength:o.indices.length,neighbors:s,vertices:_.tf.createView(o.buffer)}}const d=new S,P=new l,U=(0,i.U$)().vec3f(o.T.POSITION0).vec3f(o.T.POSITION1),G=(0,i.U$)().vec3f(o.T.POSITION0).vec3f(o.T.POSITION1).u16(o.T.COMPONENTINDEX).u16(o.T.U16PADDING,{glPadding:!0})},21968:(t,n,e)=>{e.d(n,{G:()=>r});class r{constructor(t,n,e,r,E,i=!1,o=0){this.name=t,this.count=n,this.type=e,this.offset=r,this.stride=E,this.normalized=i,this.divisor=o}}},35371:(t,n,e)=>{var r,E,i,o,_,s,T,a,A,R,c,u,N,f,O,I,S,l,M,C,L,h,D,d;e.d(n,{Br:()=>I,LR:()=>s,Lm:()=>L,Lu:()=>P,MX:()=>E,No:()=>N,OU:()=>h,Tg:()=>S,VI:()=>f,VY:()=>d,Wf:()=>T,_g:()=>D,cw:()=>c,db:()=>o,e8:()=>u,g:()=>a,l1:()=>l,lP:()=>O,q_:()=>U,qi:()=>C,w0:()=>_,wb:()=>A,xS:()=>R,zi:()=>i}),function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT"}(r||(r={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(E||(E={})),function(t){t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(i||(i={})),function(t){t[t.ADD=32774]="ADD",t[t.SUBTRACT=32778]="SUBTRACT",t[t.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(o||(o={})),function(t){t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER"}(_||(_={})),function(t){t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(s||(s={})),function(t){t[t.CW=2304]="CW",t[t.CCW=2305]="CCW"}(T||(T={})),function(t){t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT"}(a||(a={})),function(t){t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS"}(A||(A={})),function(t){t[t.ZERO=0]="ZERO",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP"}(R||(R={})),function(t){t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(c||(c={})),function(t){t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(u||(u={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(N||(N={})),function(t){t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.RED=6403]="RED",t[t.RG=33319]="RG",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER"}(f||(f={})),function(t){t[t.RGBA4=32854]="RGBA4",t[t.R16F=33325]="R16F",t[t.RG16F=33327]="RG16F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.R32F=33326]="R32F",t[t.RG32F=33328]="RG32F",t[t.RGBA32F=34836]="RGBA32F",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB5_A1=32855]="RGB5_A1",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.RGB16F=34843]="RGB16F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.RGB565=36194]="RGB565",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2=32857]="RGB10_A2",t[t.RGB10_A2UI=36975]="RGB10_A2UI"}(O||(O={})),function(t){t[t.FLOAT=5126]="FLOAT",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.INT=5124]="INT",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(I||(I={})),function(t){t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(S||(S={})),function(t){t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_READ=35045]="STATIC_READ",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.STREAM_COPY=35042]="STREAM_COPY"}(l||(l={})),function(t){t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER"}(M||(M={})),function(t){t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(C||(C={})),function(t){t[t.TEXTURE=0]="TEXTURE",t[t.RENDER_BUFFER=1]="RENDER_BUFFER",t[t.CUBEMAP=2]="CUBEMAP"}(L||(L={})),function(t){t[t.NONE=0]="NONE",t[t.DEPTH_RENDER_BUFFER=1]="DEPTH_RENDER_BUFFER",t[t.STENCIL_RENDER_BUFFER=2]="STENCIL_RENDER_BUFFER",t[t.DEPTH_STENCIL_RENDER_BUFFER=3]="DEPTH_STENCIL_RENDER_BUFFER",t[t.DEPTH_STENCIL_TEXTURE=4]="DEPTH_STENCIL_TEXTURE"}(h||(h={})),function(t){t[t.Texture=0]="Texture",t[t.BufferObject=1]="BufferObject",t[t.VertexArrayObject=2]="VertexArrayObject",t[t.Shader=3]="Shader",t[t.Program=4]="Program",t[t.FramebufferObject=5]="FramebufferObject",t[t.Renderbuffer=6]="Renderbuffer",t[t.Sync=7]="Sync",t[t.COUNT=8]="COUNT"}(D||(D={})),function(t){t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15"}(d||(d={}));const P=33306;var U,G,F,B,p,g,m;!function(t){t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"}(U||(U={})),function(t){t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT=5124]="INT",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(G||(G={})),function(t){t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS"}(F||(F={})),function(t){t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED"}(B||(B={})),function(t){t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED"}(p||(p={})),function(t){t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(g||(g={})),function(t){t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}(m||(m={}))}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9032,4889],{78346:(e,t,r)=>{r.d(t,{bA:()=>A});var i=r(20102),s=r(80442),n=r(95330),a=r(80903),o=r(25045),l=r(40330),c=r(92604),u=r(70586),h=r(94362),f=r(99880),d=r(68773),p=(r(2587),r(17452));const m={};function g(e){const t={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages&&e.packages.concat()||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(t.async=!0),e.hasOwnProperty("isDebug")||(t.isDebug=!1),e.baseUrl||(t.baseUrl=m.baseUrl),m.packages?.forEach((e=>{!function(e,t){for(const r of e)if(r.name===t.name)return;e.push(t)}(t.packages??[],e)})),t}var y=r(41213);class x{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach((t=>{this[t]=(...r)=>e[t](...r)}))}}class w{constructor(){this._dispatcher=new x,this._workerPostMessage({type:h.Cs.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){(0,y.Y)((()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))}))}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){(0,y.Y)((()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))}))}async _workerMessageHandler(e){const t=(0,h.QM)(e);if(t&&t.type===h.Cs.OPEN){const{modulePath:e,jobId:r}=t;let i=await o.default.loadWorker(e);i||(i=await import(e));const s=o.default.connect(i);this._workerPostMessage({type:h.Cs.OPENED,jobId:r,data:s})}}}var b=r(70171),I=r(17202);const v=c.Z.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:_}=h.Cs;let C,S;const R="Failed to create Worker. Fallback to execute module in main thread";async function k(e){return new Promise((t=>{function r(s){const n=(0,h.QM)(s);n&&n.type===_&&(e.removeEventListener("message",r),e.removeEventListener("error",i),t(e))}function i(t){t.preventDefault(),e.removeEventListener("message",r),e.removeEventListener("error",i),v.warn("Failed to create Worker. Fallback to execute module in main thread",t),(e=new w).addEventListener("message",r),e.addEventListener("error",i)}e.addEventListener("message",r),e.addEventListener("error",i)}))}let T=0;const{ABORT:P,INVOKE:M,OPEN:O,OPENED:E,RESPONSE:F}=h.Cs;class D{constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",(e=>{e.preventDefault(),c.Z.getLogger("esri.core.workers.WorkerOwner").error(e)}))}static async create(e){const t=await async function(){if(!(0,s.Z)("esri-workers")||((0,s.Z)("mozilla"),0))return k(new w);if(!C&&!S)try{const e='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,buildDate:r,version:t}=configuration.kernelInfo,{revision:n,buildDate:i,version:s}=e.kernelInfo;o!==n&&console.warn(`[esri.core.workers] Version mismatch detected between ArcGIS API for JavaScript and assets:\\nAPI version: ${t} [Date: ${r}, Revision: ${o.slice(0,8)}]\nAssets version: ${s} [Date: ${i}, Revision: ${n.slice(0,8)}]`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let e;function t(o){const t=e.connect(o);self.postMessage({type:2,jobId:r,data:t},[t])}"function"==typeof define&&define.amd?require([workerPath],(r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((r=>(e=r.default,checkWorkerRevision(e),e.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),e=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(e),e.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const e=outgoing.get(r);outgoing.delete(r),o.error?e.reject(JSON.parse(o.error)):e.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.replace('"{CONFIGURATION}"',`'${function(){let e;if(null!=d.Z.default){const t={...d.Z};delete t.default,e=JSON.parse(JSON.stringify(t))}else e=JSON.parse(JSON.stringify(d.Z));e.assetsPath=(0,p.hF)(e.assetsPath),e.request.interceptors=[],e.log.interceptors=[],e.locale=(0,b.Kd)(),e.has={"esri-csp-restrictions":(0,s.Z)("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":(0,s.Z)("esri-2d-update-debug"),"esri-2d-query-centroid-enabled":(0,s.Z)("esri-2d-query-centroid-enabled"),"featurelayer-pbf":(0,s.Z)("featurelayer-pbf"),"featurelayer-simplify-thresholds":(0,s.Z)("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":(0,s.Z)("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":(0,s.Z)("featurelayer-simplify-mobile-factor"),"esri-atomics":(0,s.Z)("esri-atomics"),"esri-shared-array-buffer":(0,s.Z)("esri-shared-array-buffer"),"esri-tiles-debug":(0,s.Z)("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":(0,s.Z)("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":(0,s.Z)("feature-polyline-generalization-factor"),"host-webworker":1},e.workers.loaderUrl&&(e.workers.loaderUrl=(0,p.hF)(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=(0,p.hF)(e.workers.workerPath):e.workers.workerPath=(0,p.hF)((0,f.V)("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=d.Z.workers.loaderConfig,r=g({baseUrl:t?.baseUrl,locale:(0,b.Kd)(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...t?.has},map:{...t?.map},paths:{...t?.paths},packages:t?.packages||[]}),i={version:l.i8,buildDate:I.r,revision:I.$};return JSON.stringify({esriConfig:e,loaderConfig:r,kernelInfo:i})}()}'`);C=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){S=e||{}}let e;if(C)try{e=new Worker(C,{name:"esri-worker-"+T++})}catch(t){v.warn(R,S),e=new w}else v.warn(R,S),e=new w;return k(e)}();return new D(t,e)}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,i=(0,h.jt)();return new Promise(((t,s)=>{const a={resolve:t,reject:s,abortHandle:(0,n.$F)(r,(()=>{this._outJobs.delete(i),this._post({type:P,jobId:i})}))};this._outJobs.set(i,a),this._post({type:O,jobId:i,modulePath:e})}))}_onMessage(e){const t=(0,h.QM)(e);if(t)switch(t.type){case E:this._onOpenedMessage(t);break;case F:this._onResponseMessage(t);break;case P:this._onAbortMessage(t);break;case M:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,i=t.get(r);i&&(i.controller&&i.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:i,abortable:s}=e,a=s?new AbortController:null,o=this._inJobs,c=l.Nv[t];let u;try{if("function"!=typeof c)throw new TypeError(`${t} is not a function`);u=c.call(null,i,{signal:a?a.signal:null})}catch(e){return void this._post({type:F,jobId:r,error:(0,h.AB)(e)})}(0,n.y8)(u)?(o.set(r,{controller:a,promise:u}),u.then((e=>{o.has(r)&&(o.delete(r),this._post({type:F,jobId:r},e))}),(e=>{o.has(r)&&(o.delete(r),e||(e={message:"Error encountered at method"+t}),(0,n.D_)(e)||this._post({type:F,jobId:r,error:(0,h.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:F,jobId:r},u)}_onOpenedMessage(e){const{jobId:t,data:r}=e,i=this._outJobs.get(t);i&&(this._outJobs.delete(t),(0,u.hw)(i.abortHandle),i.resolve(r))}_onResponseMessage(e){const{jobId:t,error:r,data:s}=e,n=this._outJobs.get(t);n&&(this._outJobs.delete(t),(0,u.hw)(n.abortHandle),r?n.reject(i.Z.fromJSON(JSON.parse(r))):n.resolve(s))}_post(e,t,r){return(0,h.oi)(this.worker,e,t,r)}}let B=(0,s.Z)("esri-workers-debug")?1:(0,s.Z)("host-browser")?navigator.hardwareConcurrency-1:0;B||(B=(0,s.Z)("safari")&&(0,s.Z)("mac")||(0,s.Z)("trident")?7:2);let N=0;const z=[];async function L(e,t){const r=new a.Z;return await r.open(e,t),r}async function A(e,t={}){if("string"!=typeof e)throw new i.Z("workers:undefined-module","modulePath is missing");let r=t.strategy||"distributed";if((0,s.Z)("host-webworker")&&!(0,s.Z)("esri-workers")&&(r="local"),"local"===r){let r=await o.default.loadWorker(e);r||(r=await import(e)),(0,n.k_)(t.signal);const i=t.client||r;return L([o.default.connect(r)],{...t,client:i})}if(await async function(){if(Z)return Z;H=new AbortController;const e=[];for(let t=0;t<B;t++){const r=D.create(t).then((e=>(z[t]=e,e)));e.push(r)}return Z=Promise.all(e),Z}(),(0,n.k_)(t.signal),"dedicated"===r){const r=N++%B;return L([await z[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,B);if(r<B){const i=new Array(r);for(let s=0;s<r;++s){const r=N++%B;i[s]=z[r].open(e,t)}return L(i,t)}}return L(z.map((r=>r.open(e,t))),t)}let H,Z=null},2587:(e,t,r)=>{r(90344),r(18848),r(940),r(70171);var i=r(94443),s=r(3172),n=r(20102),a=r(70586);async function o(e){if((0,a.pC)(c.fetchBundleAsset))return c.fetchBundleAsset(e);const t=await(0,s.default)(e,{responseType:"text"});return JSON.parse(t.data)}class l{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let i;i="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=i,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,s){const a=t.exec(r);if(!a)throw new n.Z("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=a[1]?`${a[1]}/`:"",c=a[2],u=(0,i.Su)(s),h=`${l}${c}.json`,f=u?`${l}${c}_${u}.json`:h;let d;try{d=await o(e(f))}catch(t){if(f===h)throw new n.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{d=await o(e(h))}catch(e){throw new n.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return d}(this.getAssetUrl,this.matcher,e,t)}}const c={};var u,h=r(99880);(0,i.tz)((u={pattern:"esri/",location:h.V},new l(u)))},940:(e,t,r)=>{r.d(t,{n:()=>c});var i=r(92604),s=r(78286),n=r(19153),a=r(90344),o=r(18848);const l=i.Z.getLogger("esri.intl.substitute");function c(e,t,r={}){const{format:i={}}=r;return(0,n.gx)(e,(e=>function(e,t,r){let i,n;const a=e.indexOf(":");if(-1===a?i=e.trim():(i=e.slice(0,a).trim(),n=e.slice(a+1).trim()),!i)return"";const o=(0,s.hS)(i,t);if(null==o)return"";const l=(n?r?.[n]:null)??r?.[i];return l?u(o,l):n?h(o,n):f(o)}(e,t,i)))}function u(e,t){switch(t.type){case"date":return(0,a.p6)(e,t.intlOptions);case"number":return(0,o.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),f(e)}}function h(e,t){switch(t.toLowerCase()){case"dateformat":return(0,a.p6)(e);case"numberformat":return(0,o.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,a.p6)(e):/^numberformat/i.test(t)?(0,o.uf)(e):f(e)}}function f(e){switch(typeof e){case"string":return e;case"number":return(0,o.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,a.p6)(e):""}}},52294:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ke});var i=r(43697),s=r(51773),n=r(30030),a=r(20102),o=r(70586),l=r(16453),c=r(95330),u=r(17445),h=r(5600),f=(r(67676),r(80442)),d=r(75215),p=r(36030),m=r(71715),g=r(52011),y=r(87085),x=r(71612),w=r(17017),b=r(3172),I=r(92604),v=r(8744),_=r(66677),C=r(21506),S=r(35956),R=r(88281),k=r(11145),T=r(99815),P=r(80676),M=r(67058),O=r(91219),E=r(23808);const F=I.Z.getLogger("esri.layers.mixins.ImageryTileMixin"),D=e=>{let t=class extends e{constructor(){super(...arguments),this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalDefinition=null,this.raster=null,this.sourceJSON=null,this.symbolizer=null}get fullExtent(){return this.rasterInfo?.extent}get rasterInfo(){return this.raster?.rasterInfo}get spatialReference(){return this.rasterInfo?.spatialReference}get tileInfo(){return this.rasterInfo?.storageInfo.tileInfo}set url(e){this._set("url",(0,_.Nm)(e,F))}set renderer(e){this._set("renderer",e),this.updateRenderer()}async convertVectorFieldData(e,t){if((0,o.Wi)(e))return null;const r=this._rasterJobHandler.instance,i=this.rasterInfo.dataType;return r?r.convertVectorFieldData({pixelBlock:e,dataType:i},t):(0,P.KC)(e,i)}async createFlowMesh(e,t){const r=this._rasterJobHandler.instance;return r?r.createFlowMesh(e,t):(0,E.GE)(e.meshType,e.simulationSettings,e.flowData,(0,o.pC)(t.signal)?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.rasterInfo;if((0,o.Wi)(t))return e;let r=e.multidimensionalDefinition||this.multidimensionalDefinition;!(0,o.Wi)(r)&&r.length||(r=(0,T.Tj)(this.raster.rasterInfo));const i=e.timeExtent||this.timeExtent;if((0,o.pC)(r)&&(0,o.pC)(i)&&((0,o.pC)(i.start)||(0,o.pC)(i.end))){r=r.map((e=>e.clone()));const s=t.variables.find((({name:e})=>e===r[0].variableName))?.dimensions?.find((({name:e})=>"StdTime"===e)),n=r.find((({dimensionName:e})=>"StdTime"===e));if(!s||!n)return{...e,multidimensionalDefinition:null};const{start:a,end:l}=i,c=(0,o.Wi)(a)?null:a.getTime(),u=(0,o.Wi)(l)?null:l.getTime(),h=c??u,f=u??c;if((0,o.pC)(s.values)){const e=s.values.filter((e=>{if(Array.isArray(e)){if(h===f)return e[0]<=h&&e[1]>=h;const t=e[0]<=h&&e[1]>h||e[0]<f&&e[1]>=f,r=e[0]>=h&&e[1]<=f||e[0]<h&&e[1]>f;return t||r}return h===f?e===h:e>=h&&e<=f}));if(e.length){const t=e.sort(((e,t)=>h===f?(e[0]??e)-(t[0]??t):Math.abs((e[1]??e)-f)-Math.abs((t[1]??t)-f)))[0];n.values=[t]}else r=null}else if(s.hasRegularIntervals&&s.extent){const[e,t]=s.extent;h>t||f<e?r=null:n.values=h===f?[h]:[Math.max(e,h),Math.min(t,f)]}}return{...e,multidimensionalDefinition:r}}async updateRenderer(){if(!this.loaded)return;if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(this.renderer))return;const e=this._rasterJobHandler.instance;e&&(this.symbolizer.rendererJSON=(0,M.ol)(this.renderer.toJSON()),this.symbolizer.bind(),await e.updateSymbolizer(this.symbolizer),this._cachedRendererJson=this.renderer.toJSON())}async applyRenderer(e,t){const r=e&&e.pixelBlock;if(!((0,o.pC)(r)&&r.pixels&&r.pixels.length>0))return null;let i;await this.updateRenderer();const s=this._rasterJobHandler.instance,{bandIds:n}=this;return i=s?await s.symbolize({...e,simpleStretchParams:t,bandIds:n}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:n}),i}getTileUrl(e,t,r){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${r}`:""}getCompatibleTileInfo(e,t,r=!1){if(!this.loaded||(0,o.Wi)(t))return null;if(r&&e.equals(this.spatialReference))return this.tileInfo;const i=(0,v.C5)(e);return k.Z.create({size:256,spatialReference:e,origin:i?{x:i.origin[0],y:i.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,r,i={}){if(i.requestAsImageElement){const s=this.getTileUrl(e,t,r);return(0,b.default)(s,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:i.signal}).then((e=>e.data))}if((0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(i=this.normalizeRasterFetchOptions(i),(0,o.Wi)(i.multidimensionalDefinition))){const s=i.tileInfo||this.rasterInfo.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,r,s),pixelBlock:null}}return await this._initJobHandler(),"raster-shaded-relief"===this.renderer.type&&(i={...i,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,r,i)}async fetchPixels(e,t,r,i={}){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(i=this.normalizeRasterFetchOptions(i),(0,o.Wi)(i.multidimensionalDefinition))?{extent:e,pixelBlock:null}:(await this._initJobHandler(),this.raster.fetchPixels(e,t,r,i))}async identify(e,t={}){return!(0,o.pC)(this.rasterInfo.multidimensionalInfo)||this.rasterInfo.hasMultidimensionalTranspose&&((0,T.WU)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||(t=this.normalizeRasterFetchOptions(t),!(0,o.Wi)(t.multidimensionalDefinition))?this.raster.identify(e,t):{location:e,value:null}}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const e=this.rasterInfo.multidimensionalInfo;if((0,o.Wi)(e)||"standard-time"!==this.rasterInfo.dataType)return!1;const t=this.multidimensionalDefinition[0]?.variableName;return e.variables.some((e=>e.name===t&&e.dimensions.some((e=>"StdTime"===e.name))))}getStandardTimeValue(e){return new Date(24*(e-25569)*3600*1e3).toString()}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,T.Tj)(this.raster.rasterInfo)),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new R.Z;return this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,this.renderer&&this.updateRenderer()})).catch((()=>null)),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this.raster.rasterJobHandler=null,this._cachedRendererJson=null}_configDefaultInterpolation(){if(null==this.interpolation){const e=(0,M.In)(this.rasterInfo,this.raster.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",e)}}_configDefaultRenderer(){const e=this.raster.rasterInfo;if(this.bandIds||(this.bandIds=(0,M.YD)(e)),!this.renderer){const t=(0,M.Ob)(e,{bandIds:this.bandIds,variableName:(0,o.pC)(this.multidimensionalDefinition)?this.multidimensionalDefinition[0]?.variableName:null});"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===t.type&&(e.statistics?.[0].max>1e24||e.statistics?.[0].min<-1e24)&&(t.dynamicRangeAdjustment=!0,t.statistics=null,"none"===t.stretchType&&(t.stretchType="min-max")),this.renderer=t}this.symbolizer?(this.symbolizer.rendererJSON=(0,M.ol)(this.renderer.toJSON()),this.symbolizer.rasterInfo=e):this.symbolizer=new O.Z({rendererJSON:this.renderer.toJSON(),rasterInfo:e});const t=this.symbolizer.bind();t.success||F.warn("imagery-tile-mixin",t.error||"The given renderer is not supported by the layer.")}};return(0,i._)([(0,h.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"_compatibleFullExtent",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"bandIds",void 0),(0,i._)([(0,h.Cb)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,i._)([(0,h.Cb)({json:{read:!1}})],t.prototype,"fullExtent",null),(0,i._)([(0,h.Cb)()],t.prototype,"interpolation",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"ioConfig",void 0),(0,i._)([(0,h.Cb)({type:[S.Z]})],t.prototype,"multidimensionalDefinition",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"raster",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"rasterInfo",null),(0,i._)([(0,h.Cb)()],t.prototype,"sourceJSON",void 0),(0,i._)([(0,h.Cb)({json:{read:!1}})],t.prototype,"spatialReference",null),(0,i._)([(0,h.Cb)({json:{read:!1}})],t.prototype,"tileInfo",null),(0,i._)([(0,h.Cb)(C.HQ)],t.prototype,"url",null),(0,i._)([(0,h.Cb)({types:n.dr})],t.prototype,"renderer",null),(0,i._)([(0,h.Cb)()],t.prototype,"symbolizer",void 0),t=(0,i._)([(0,g.j)("esri.layers.ImageryTileMixin")],t),t};var B=r(38009),N=r(16859),z=r(34760),L=r(72965),A=r(28294),H=r(1231),Z=r(69608),W=(r(66577),r(48526)),J=r(36679),j=r(96674),q=r(609),G=r(73506),U=r(13473);const $=new Map,V=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const r=e+"/"+t,i=this._cachedBlocks;if(i.has(r)){const e=i.get(r);return e.refCount--,e.refCount<=0&&(i.delete(r),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const r=e+"/"+t,i=this._cachedBlocks;if(i.has(r)){const e=i.get(r);return e.ts=Date.now(),e.refCount++,i.delete(r),i.set(r,e),e.block}return null}putBlock(e,t,r,i=null){const s=this._cachedBlocks,n=e+"/"+t;if(s.has(n)){const e=s.get(n);e.ts=Date.now(),e.refCount++}else s.set(n,{block:r,ts:Date.now(),refCount:1,controller:i});this._trim(),this._updateTimer()}deleteBlock(e,t){const r=this._cachedBlocks,i=e+"/"+t;r.has(i)&&r.delete(i)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),r=Date.now();for(let i=0;i<t.length&&t[i][1].ts<=r-this._duration;i++)e.delete(t[i][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let r=0;r<t.length-this._size;r++)e.delete(t[r][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function Y(e,t){return null==t?e:`${e}?sliceId=${t}`}function K(e,t,r){if(!$.has(e))return null==t?V.getBlock(e,r):null;const i=$.get(e);if(null==i[t]){for(let e=0;e<i.length;e++)if(i[e]&&i[e].cache.has(r)){const t=i[e].cache.get(r);return t.refCount++,t.block}return V.getBlock(e,r)}const s=i[t].cache;if(s.has(r)){const e=s.get(r);return e.refCount++,e.block}for(let e=0;e<i.length;e++)if(e!==t&&i[e]&&i[e]&&i[e].cache.has(r)){const t=i[e].cache.get(r);return t.refCount++,s.set(r,t),t.block}return null}function X(e,t,r,i,s=null){if(!$.has(e))return void(null==t&&V.putBlock(e,r,i,s));const n=$.get(e);if(null==n[t])return void V.putBlock(e,r,i,s);const a={refCount:1,block:i,isResolved:!1,isRejected:!1,controller:s};i.then((()=>a.isResolved=!0)).catch((()=>a.isRejected=!0)),n[t].cache.set(r,a)}var Q=r(75993),ee=r(55914),te=r(6570);let re=class extends((0,q.v)(j.wq)){constructor(){super(...arguments),this.rasterJobHandler=null,this.datasetName=null,this.datasetFormat=null,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=(0,G.zD)();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:k.Z.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,G.ut)(e.spatialReference);return(0,o.pC)(t)&&e.extent.width>=t/2}set url(e){this._set("url",(0,_.Nm)(e,I.Z.getLogger(this.declaredClass)))}async open(e){throw new a.Z("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,r,i={}){const s=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,n=this.getTileExtentFromTileInfo(e,t,r,s);return this.fetchPixels(n,s.size[0],s.size[1],i)}async identify(e,t={}){const{multidimensionalDefinition:r,timeExtent:i}=t,{hasMultidimensionalTranspose:s,multidimensionalInfo:n}=this.rasterInfo;let{transposedVariableName:a}=t;const l=(0,o.pC)(n)&&s&&(null!=i||(0,T.WU)(r));l&&!a&&(a=(0,o.pC)(r)&&r.length>0?r[0].variableName:n.variables[0].name,t={...t,transposedVariableName:a}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=this.rasterInfo,{datumTransformation:h}=t;let f=(0,G.nF)(e,c,h);if(!u.intersects(f))return{location:f,value:null};if((0,o.pC)(this.rasterInfo.transform)){const e=this.rasterInfo.transform.inverseTransform(f);if(!this.rasterInfo.nativeExtent.intersects(e))return{location:e,value:null};f=e}let d=0;const p=a&&(0,o.pC)(n)&&this.rasterInfo.hasMultidimensionalTranspose;if(!p)if(t.srcResolution)d=(0,G.kr)(t.srcResolution,this.rasterInfo,this.ioConfig.sampling).pyramidLevel;else if(d=await this.computeBestPyramidLevelForLocation(e,t),null==d)return{location:f,value:null};const m=this.identifyPixelLocation(f,d,null,p);if(null===m)return{location:f,value:null};const{row:g,col:y,rowOffset:x,colOffset:w,blockWidth:b}=m,I=a??(0,o.Wg)(t.sliceId),v=Y(this.url,I),_=`${d}/${g}/${y}`;let C=K(v,null,_);(0,o.Wi)(C)&&(C=this.fetchRawTile(d,g,y,t),X(v,null,_,C));const S=await C;if((0,o.Wi)(S)||!S.pixels?.length)return{location:f,value:null};const R=x*b+w;return this._processIdentifyResult(S,{srcLocation:f,position:R,pyramidLevel:d,useTransposedTile:p,requestSomeSlices:l,identifyOptions:t})}async fetchPixels(e,t,r,i={}){if(e=(0,G.kZ)(e),(i=this._getRequestOptionsWithSliceId(i)).requestRawData)return this._fetchPixels(e,t,r,i);const s=(0,G.ut)(e.spatialReference),n=(0,G.Hq)(e);if((0,o.Wi)(s)||0===n||1===n&&this._isGlobalWrappableSource)return this._fetchPixels(e,t,r,i);if(n>=3)return{extent:e,pixelBlock:null};const a=[],{xmin:l,xmax:c}=e,u=Math.round(s/(c-l)*t),h=u-Math.round((s/2-l)/(c-l)*t);let f=0;const d=[];for(let o=0;o<=n;o++){const p=new te.Z({xmin:0===o?l:-s/2,xmax:o===n?c-s*o:s/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),m=0===o?u-h:o===n?t-f:u;f+=m,d.push(m);const g=i.disableWrapAround&&o>0?null:this._fetchPixels(p,m,r,i);a.push(g)}const p=(await Promise.all(a)).map((e=>e?.pixelBlock));let m=null;const g={width:t,height:r};return m=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:g,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:d},i)).pixelBlock:(0,ee.us)(p,g,{blockWidths:d}),{extent:e,srcExtent:(0,G.tB)(e,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:m}}async fetchRawPixels(e,t,r,i={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const s=await this._fetchRawTiles(e,t,r,i),{nativeExtent:n,nativePixelSize:a,storageInfo:l}=this.rasterInfo,c=2**e,u=a.x*c,h=a.y*c,f=new te.Z({xmin:n.xmin+u*t.x,xmax:n.xmin+u*(t.x+r.width-1),ymin:n.ymax-h*(t.y+r.height-1),ymax:n.ymax-h*t.y,spatialReference:n.spatialReference});if(!s)return{extent:f,srcExtent:f,pixelBlock:null};const{pixelBlocks:d,mosaicSize:p}=s;if(1===d.length&&(0,o.pC)(d[0])&&d[0].width===r.width&&d[0].height===r.height)return{extent:f,srcExtent:f,pixelBlock:s.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,g=e>0?l.pyramidBlockHeight:l.blockHeight,y={x:t.x%m,y:t.y%g};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:p,destDimension:r,clipOffset:y,clipSize:r,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i)).pixelBlock:(0,ee.us)(d,p,{clipOffset:y,clipSize:r}),{extent:f,srcExtent:f,pixelBlock:x}}fetchRawTile(e,t,r,i){throw new a.Z("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,G.tB)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,Q.J)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,r){const{customFetchParameters:i}=this.ioConfig,{range:s,query:n,headers:a}=t;r=r??t.retryCount??this.ioConfig.retryCount;const o=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await(0,b.default)(e,{...t,query:{...n,...i},headers:{...a,...o}})}catch(i){if(r>0)return r--,this.request(e,t,r);throw i}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return(0,o.Wi)(t)||(0,o.Wi)(e)||0===e.length?null:(0,T.gk)(e,t)}getTileExtentFromTileInfo(e,t,r,i){const s=i.lodAt(e);return this.getTileExtent({x:s.resolution,y:s.resolution},t,r,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:r,pixelSize:i}=this.rasterInfo;if(!e.tileInfo){const s=[],n=e.maximumPyramidLevel||0;let a=Math.max(i.x,i.y),o=1/.0254*96*a;for(let e=0;e<=n;e++)s.push({level:n-e,resolution:a,scale:o}),a*=2,o*=2;const l=new U.Z({x:r.xmin,y:r.ymax,spatialReference:t});e.tileInfo=new k.Z({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:s}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,r=512,i){const{width:s,height:n,nativeExtent:a,pixelSize:o,spatialReference:l}=e,c=new U.Z({x:a.xmin,y:a.ymax,spatialReference:l});null==i&&(i=Math.max(0,Math.round(Math.log(Math.max(s,n))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],i);e.storageInfo=new J.Z({blockWidth:t,blockHeight:r,pyramidBlockWidth:t,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,r,i,s,n=0,a=2){if(1===s.length&&n>0){s=[...s];let{x:e,y:t}=s[0];for(let r=0;r<n;r++)e*=a,t*=a,s.push({x:e,y:t})}const o=[],{x:l,y:c}=i;for(let i=0;i<s.length;i++){const{x:n,y:a}=s[i];o.push({minCol:Math.floor((e.xmin-l+.1*n)/t/n),maxCol:Math.floor((e.xmax-l-.1*n)/t/n),minRow:Math.floor((c-e.ymax+.1*a)/r/a),maxRow:Math.floor((c-e.ymin-.1*a)/r/a)})}return o}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:r,pyramidScalingFactor:i}=this.rasterInfo.storageInfo;if(0===e)return t;if((0,o.pC)(r)&&r.length)return r[e-1];const s=i**e;return{x:t.x*s,y:t.y*s}}identifyPixelLocation(e,t,r,i){const{spatialReference:s,nativeExtent:n,storageInfo:a}=this.rasterInfo,{maximumPyramidLevel:l,origin:c,transposeInfo:u}=a,h=i&&(0,o.pC)(u)?u.tileSize[0]:a.blockWidth,f=i&&(0,o.pC)(u)?u.tileSize[1]:a.blockHeight,d=(0,G.nF)(e,s,r);if(!n.intersects(d))return null;if(t<0||t>l)return null;const p=this.getPyramidPixelSize(t),{x:m,y:g}=p,y=(c.y-d.y)/g/f,x=(d.x-c.x)/m/h,w=Math.min(f-1,Math.floor((y-Math.floor(y))*f)),b=Math.min(h-1,Math.floor((x-Math.floor(x))*h));return{pyramidLevel:t,row:Math.floor(y),col:Math.floor(x),rowOffset:w,colOffset:b,blockWidth:h,srcLocation:d}}getTileExtent(e,t,r,i,s,n){const[a,o]=n,l=i.x+r*a*e.x,c=l+a*e.x,u=i.y-t*o*e.y,h=u-o*e.y;return new te.Z({xmin:l,xmax:c,ymin:h,ymax:u,spatialReference:s})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,r){const i=this.rasterInfo.storageInfo.blockBoundary[e];return!i||i.maxRow<t||i.maxCol<r||i.minRow>t||i.minCol>r}async _fetchPixels(e,t,r,i={}){let s=(0,G.Hq)(e);if(s>=2)return{extent:e,pixelBlock:null};const n=this._getSourceDataInfo(e,t,r,i),{pyramidLevel:a,pyramidResolution:l,srcResolution:c,srcExtent:u,srcWidth:h,srcHeight:f}=n;if(0===h||0===f)return{extent:e,srcExtent:u,pixelBlock:null};const d=(0,o.Wg)(this.rasterInfo.transform),p="gcs-shift"===d?.type,m=(0,o.pC)((0,G.ut)(e.spatialReference));!p&&m||(s=(0,G.Hq)(n.srcExtent,p));const g=this.rasterInfo.storageInfo,y={x:Math.floor((u.xmin-g.origin.x)/l.x+.1),y:Math.floor((g.origin.y-u.ymax)/l.y+.1)},x=await this._fetchRawTiles(a,y,{width:h,height:f,wrapCount:s},i);if(!x)return{extent:e,srcExtent:u,pixelBlock:null};const w=a>0?g.pyramidBlockWidth:g.blockWidth,b=a>0?g.pyramidBlockHeight:g.blockHeight,I=w===h&&b===f&&y.x%w==0&&y.y%b==0,v=new U.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference}),_=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:C}=i;if(!_&&I&&1===x.pixelBlocks.length&&w===t&&b===r&&c.x===v.x&&c.y===v.y)return{extent:e,srcExtent:u,pixelBlock:x.pixelBlocks[0]};const S=m&&(0,o.pC)((0,G.ut)(u.spatialReference)),R=i.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");R&&!this.rasterJobHandler&&await(0,G.zD)();const k=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:v.toJSON(),datumTransformation:C,rasterTransform:d,hasWrapAround:s>0||S,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:R},i):(0,G.Qp)({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:v,datumTransformation:C,rasterTransform:d,hasWrapAround:s>0||S,isAdaptive:!1,includeGCSGrid:R});let T;const M=!i.requestRawData,O={rows:k.spacing[0],cols:k.spacing[1]},E=(0,o.Wg)(this._getRasterTileAlignmentInfo(a,x.extent.xmin)),{pixelBlocks:F,mosaicSize:D,isPartiallyFilled:B}=x;let N=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:F,srcMosaicSize:D,destDimension:M?{width:t,height:r}:null,coefs:M?k.coefficients:null,sampleSpacing:M?O:null,projectDirections:R,gcsGrid:R?k.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:i.interpolation,alignmentInfo:E,blockWidths:null},i);({pixelBlock:T,localNorthDirections:N}=e)}else{const e=(0,ee.us)(F,D,{alignmentInfo:E});T=M?(0,ee.Uk)(e,{width:t,height:r},k.coefficients,O,i.interpolation):e,R&&k.gcsGrid&&(N=(0,ee.Qh)({width:t,height:r},k.gcsGrid),T=(0,P.xQ)(T,this.rasterInfo.dataType,N))}return i.requestRawData||R?{srcExtent:u,pixelBlock:T,transformGrid:k,localNorthDirections:N,extent:e,isPartiallyFilled:B}:{srcExtent:u,extent:e,pixelBlock:T}}async _fetchRawTiles(e,t,r,i){const{origin:s,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:l}=this.getBlockWidthHeight(e);let{x:c,y:u}=t,{width:h,height:f,wrapCount:d}=r;const p=this._getRasterTileAlignmentInfo(e,0);i.buffer&&(c-=i.buffer.cols,u-=i.buffer.rows,h+=2*i.buffer.cols,f+=2*i.buffer.rows);let m=0,g=0,y=0;d&&(0,o.pC)(p)&&(({worldColumnCountFromOrigin:g,originColumnOffset:y,rightPadding:m}=p),g*p.blockWidth-m>=c+h&&(m=0));const x=Math.floor(c/a),w=Math.floor(u/l),b=Math.floor((c+h+m-1)/a),I=Math.floor((u+f+m-1)/l),v=n[e];if(!v)return null;const{minRow:_,minCol:C,maxCol:S,maxRow:R}=v;if(0===d&&(I<_||b<C||w>R||x>S))return null;const k=new Array;let T=!1;const P=null==this.ioConfig.allowPartialFill?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=w;t<=I;t++)for(let r=x;r<=b;r++){let s=r;if(!i.disableWrapAround&&d&&(0,o.pC)(p)&&g<=r&&(s=r-g-y),t>=_&&s>=C&&R>=t&&S>=s){const r=this._fetchRawTile(e,t,s,i);P?k.push(new Promise((e=>{r.then((t=>e(t))).catch((()=>{T=!0,e(null)}))}))):k.push(r)}else k.push(null)}if(0===k.length)return null;const M=await Promise.all(k),O={height:(I-w+1)*l,width:(b-x+1)*a},{spatialReference:E}=this.rasterInfo,F=this.getPyramidPixelSize(e),{x:D,y:B}=F;return{extent:new te.Z({xmin:s.x+x*a*D,xmax:s.x+(b+1)*a*D,ymin:s.y-(I+1)*l*B,ymax:s.y-w*l*B,spatialReference:E}),pixelBlocks:M,mosaicSize:O,isPartiallyFilled:T}}_fetchRawTile(e,t,r,i){const s=this.rasterInfo.storageInfo.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:n,minCol:a,maxCol:l,maxRow:u}=s;if(t<n||r<a||t>u||r>l)return Promise.resolve(null);const h=Y(this.url,i.sliceId),f=`${e}/${t}/${r}`;let d=K(h,i.registryId,f);if((0,o.Wi)(d)){const s=new AbortController;d=this.fetchRawTile(e,t,r,{...i,signal:s.signal}),X(h,i.registryId,f,d,s),d.catch((()=>function(e,t,r){if(!$.has(e))return void(null==t&&V.deleteBlock(e,r));const i=$.get(e);null!=i[t]?i[t].cache.delete(r):V.deleteBlock(e,r)}(h,i.registryId,f)))}return i.signal&&(0,c.fu)(i,(()=>{!function(e,t,r){if(!$.has(e))return null==t?V.decreaseRefCount(e,r):0;const i=$.get(e);if(null==i[t])return V.decreaseRefCount(e,r);const s=i[t].cache;if(s.has(r)){const e=s.get(r);if(e.refCount--,0===e.refCount){s.delete(r);for(let e=0;e<i.length;e++)i[e]&&i[e].cache.has(r)&&i[e].cache.delete(r);e.controller&&e.controller.abort()}e.refCount}}(h,i.registryId,f)})),d}_computeMagDirValues(e){const{bandCount:t,dataType:r}=this.rasterInfo;if((2!==t||"vector-magdir"!==r)&&"vector-uv"!==r||2!==e?.length||!e[0]?.length)return null;const i=e[0].length;if("vector-magdir"===r){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[s,n]=e,a=[],o=[];for(let e=0;e<i;e++){const[t,r]=(0,P.Tg)([s[e],n[e]]);a.push(t),o.push(r)}return[a,o]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=(0,G.P_)(this.rasterInfo)),(0,o.Wi)(this._rasterTileAlighmentInfo.pyramidsInfo)?null:{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,r,i={}){const s={datumTransformation:i.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0};i.srcResolution&&(s.srcResolution=i.srcResolution,this._updateSourceDataInfo(e,s));const n=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:a,srcHeight:o,pyramidLevel:l}=s,c=a/t,u=o/r,h=l<n&&c*u>=16;if(h||l===n&&(c>8||u>8)||0===a||0===o){const a=new U.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference});let o=(0,G.VO)(a,this.rasterInfo.spatialReference,e,s.datumTransformation);const f=!o||i.srcResolution&&o.x+o.y<i.srcResolution.x+i.srcResolution.y;if(h&&i.srcResolution&&f){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(n-l+3>=e){const t=2**e;o={x:i.srcResolution.x*t,y:i.srcResolution.y*t}}}o&&(s.srcResolution=o,this._updateSourceDataInfo(e,s))}return(s.srcWidth/t>8||s.srcHeight/r>8)&&(s.srcWidth=0,s.srcHeight=0),s}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const r=this.rasterInfo.spatialReference,{srcResolution:i,datumTransformation:s}=t,{pyramidLevel:n,pyramidResolution:a,excessiveReading:l}=(0,G.kr)(i,this.rasterInfo,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||(0,G.tB)(e,r,s);if(null==c)return;const u=(0,o.Wg)(this.rasterInfo.transform);u&&(c=u.inverseTransform(c)),t.srcExtent=c;const h=Math.ceil((c.xmax-c.xmin)/a.x-.1),f=Math.ceil((c.ymax-c.ymin)/a.y-.1);t.pyramidLevel=n,t.pyramidResolution=a,t.srcWidth=h,t.srcHeight=f}_getRequestOptionsWithSliceId(e){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:r,position:i,pyramidLevel:s,useTransposedTile:n}=t,a=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[i])return{location:r,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if((0,o.Wi)(l)||!n){const t=e.pixels.map((e=>e[i])),n={location:r,value:t,pyramidLevel:s},a=this._computeMagDirValues(t.map((e=>[e])));return a?.length&&(n.magdirValue=a.map((e=>e[0]))),n}let c=e.pixels.map((e=>Array.prototype.slice.call(e,i*a,i*a+a))),u=this._computeMagDirValues(c);const{requestSomeSlices:h,identifyOptions:f}=t;let d=(0,T.MO)(l,f.transposedVariableName);if(h){const e=(0,T.Ur)(d,(0,o.Wg)(f.multidimensionalDefinition),(0,o.Wg)(f.timeExtent));c=c.map((t=>e.map((e=>t[e])))),u=u?.map((t=>e.map((e=>t[e])))),d=e.map((e=>d[e]))}return{location:r,value:null,dataSeries:d.map(((e,t)=>{const r={value:c.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition,variableName:e.multidimensionalDefinition[0].variableName,dimensionValues:{}};return u?.length&&(r.magdirValue=[u[0][t],u[1][t]]),e.multidimensionalDefinition.forEach((e=>r.dimensionValues[e.dimensionName]=e.values[0])),r})),pyramidLevel:s}}};(0,i._)([(0,h.Cb)()],re.prototype,"_rasterTileAlighmentInfo",void 0),(0,i._)([(0,h.Cb)({readOnly:!0})],re.prototype,"_isGlobalWrappableSource",null),(0,i._)([(0,h.Cb)(C.HQ)],re.prototype,"url",null),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],re.prototype,"datasetName",void 0),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],re.prototype,"datasetFormat",void 0),(0,i._)([(0,h.Cb)()],re.prototype,"rasterInfo",void 0),(0,i._)([(0,h.Cb)()],re.prototype,"ioConfig",void 0),(0,i._)([(0,h.Cb)()],re.prototype,"sourceJSON",void 0),re=(0,i._)([(0,g.j)("esri.layers.support.rasterDatasets.BaseRaster")],re);const ie=re;var se=r(20095);function ne(e){const t=e.fields,r=e.records,i=t.some((e=>"oid"===e.name.toLowerCase()))?"OBJECTID":"OID",s=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map((e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name})))),n=s.map((e=>e.name)),a=[];let o=0,l=0;return r.forEach((e=>{const t={};for(t[i]=o++,l=1;l<n.length;l++)t[n[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:"",fields:s,features:a}}class ae{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),r=3&t.getUint8(0);if(3!==r)return{header:{version:r},recordSet:null};const i=t.getUint32(4,!0),s=t.getUint16(8,!0),n=t.getUint16(10,!0),a={version:r,recordCount:i,headerByteCount:s,recordByteCount:n};let o=32;const l=[],c=[];let u;if(3===r){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,se.f)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<i&&e.byteLength-o>n;){const r=[];32===t.getUint8(o)?(o+=1,l.forEach((t=>{if("C"===t.type)r.push((0,se.f)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)r.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)r.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const i=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();r.push(new Date(parseInt(i.substring(0,4),10),parseInt(i.substring(4,6),10)-1,parseInt(i.substring(6,8),10)))}o+=t.length})),c.push(r)):o+=n}}return{header:a,fields:l,records:c,recordSet:ne({fields:l,records:c})}}}var oe=r(87521),le=r(74889),ce=r(82971);const ue=new Map;ue.set("int16","esriFieldTypeSmallInteger"),ue.set("int32","esriFieldTypeInteger"),ue.set("int64","esriFieldTypeInteger"),ue.set("float32","esriFieldTypeSingle"),ue.set("float64","esriFieldTypeDouble"),ue.set("text","esriFieldTypeString");let he=class extends ie{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:t}=await this.request(this.url+"/conf.json",{signal:e?.signal});if(!this._validateHeader(t))throw new a.Z("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:r,rasterInfo:i}=this._parseHeader(t);if("thematic"===i.dataType){const e=await this._fetchAuxiliaryInformation();i.attributeTable=e}this._set("storageInfo",r),this._set("rasterInfo",i),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,r,i={}){const{transposeInfo:s}=this.rasterInfo.storageInfo,{transposedVariableName:n}=i,a=!(!s||!n),o=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(o<0)return null;const l=this._buildCacheFilePath(o,t,r,i.multidimensionalDefinition,n),c=this._getIndexRecordFromBundle(t,r,a),u=await this.request(l,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:i.signal});if(!u)return null;const h=new Uint8Array(u.data),f=this._getTileEndAndContentType(h,c);if(0===f.recordSize)return null;const d=await this.request(l,{range:{from:f.position,to:f.position+f.recordSize},responseType:"array-buffer",signal:i.signal});if(!d)return null;const[p,m]=this._getTileSize(a);return this.decodePixelBlock(d.data,{width:p,height:m,planes:null,pixelType:null,returnPixelInterleavedDims:a})}_validateHeader(e){return e&&"RasterInfo"===e.type&&!["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"].some((t=>!e[t]))}_parseHeader(e){const t=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:r,histograms:i,colormap:s,blockWidth:n,blockHeight:a,firstPyramidLevel:o,maximumPyramidLevel:l}=e,c=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),u=e.extent.spatialReference,h=e.geodataXform?.spatialReference,f=new ce.Z(u?.wkid||u?.wkt?u:h);let d=new te.Z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:f});const p=new U.Z({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:f}),m=Math.round((d.xmax-d.xmin)/p.x),g=Math.round((d.ymax-d.ymin)/p.y),y=this._parseTransform(e.geodataXform),x=y?d:null;y&&(d=y.forwardTransform(d),p.x=(d.xmax-d.xmin)/m,p.y=(d.ymax-d.ymin)/g);const w=e.properties??{},b=e.format.toLowerCase().replace("cache/",""),I=new U.Z(e.origin.x,e.origin.y,f);let v,_,C,S;if(s&&s.colors)for(v=[],_=0;_<s.colors.length;_++)C=s.colors[_],S=s.values?s.values[_]:_,v.push([S,255&C,C<<16>>>24,C<<8>>>24,C>>>24]);const R=e.LODInfos,T=[];for(_=0;_<R.levels.length;_++)T.push({level:R.levels[_],resolution:R.resolutions[_],scale:96/.0254*R.resolutions[_]});const P=new k.Z({dpi:96,lods:T,format:b,origin:I,size:[n,a],spatialReference:f}),M={recordSize:8,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*8+64},O=[{maxCol:Math.ceil(m/n)-1,maxRow:Math.ceil(g/a)-1,minCol:0,minRow:0}];let E=2;if(l>0)for(_=0;_<l;_++)O.push({maxCol:Math.ceil(m/E/n)-1,maxRow:Math.ceil(g/E/a)-1,minCol:0,minRow:0}),E*=2;const F=e.mdInfo;let D=null;if(F&&w._yxs){const e=w._yxs;D={packetSize:e.PacketSize,tileSize:[e.TileXSize,e.TileYSize]}}return{storageInfo:M,rasterInfo:new W.Z({width:m,height:g,pixelType:t,bandCount:r,extent:d,nativeExtent:x,transform:y,spatialReference:f,pixelSize:p,keyProperties:w,statistics:c,histograms:i,multidimensionalInfo:F,colormap:v,storageInfo:new J.Z({blockWidth:n,blockHeight:a,pyramidBlockWidth:n,pyramidBlockHeight:a,origin:I,tileInfo:P,transposeInfo:D,firstPyramidLevel:o,maximumPyramidLevel:l,blockBoundary:O})})}}_parseTransform(e){if(!(0,oe.j)(e))throw new a.Z("cloudraster:open","the data contains unsupported geodata transform types");const t=(0,oe.c)(e);if("identity"===t.type)return null;if("polynomial"!==t.type||!t.forwardCoefficients?.length||!t.inverseCoefficients?.length)throw new a.Z("cloudraster:open","the data contains unsupported geodata transforms - both forward and inverse coefficients are required currently");return t}async _fetchAuxiliaryInformation(e){const t=this.request(this.url+"/conf.vat.json",{signal:e}).then((e=>e.data)).catch((()=>null)),r=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then((e=>e.data)).catch((()=>null)),i=await Promise.all([t,r]);let s;if(i[0]){let e=i[0].fields;const t=i[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":ue.get(e.type),name:e.name,alias:e.alias||e.name})));const r=t.map((e=>({attributes:e})));e&&t&&(s={fields:e,features:r})}}return!s&&i[1]&&(s=ae.parse(i[1]).recordSet),le.default.fromJSON(s)}_buildCacheFilePath(e,t,r,i,s){const n=this._getPackageSize(!!s),a=Math.floor(t/n)*n,l=Math.floor(r/n)*n,c="R"+this._toHexString4(a)+"C"+this._toHexString4(l);let u="L";u+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:h}=this.rasterInfo,f=i?.[0];if((0,o.Wi)(h)||!f)return`${this.url}/_alllayers/${u}/${c}.bundle`;let d="_yxs";if(!s){d=h.variables.find((e=>e.name===f.variableName)).dimensions[0].values.indexOf(f.values[0]).toString(16);const e=4-d.length;for(let t=0;t<e;t++)d="0"+d;d="S"+d}const p=this._getVariableFolderName(s||f.variableName);return`${this.url}/_alllayers/${p}/${d}/${u}/${c}.bundle`}_getPackageSize(e=!1){const{transposeInfo:t}=this.rasterInfo.storageInfo;return e&&(0,o.pC)(t)?t.packetSize:this.storageInfo.packetSize}_getTileSize(e=!1){const{storageInfo:t}=this.rasterInfo,{transposeInfo:r}=t;return e&&(0,o.pC)(r)?r.tileSize:t.tileInfo.size}_getVariableFolderName(e){return""===(e=e.trim())?"_v":e.replace(/[\{|\}\-]/g,"_").replace("\\*","_v")}_getIndexRecordFromBundle(e,t,r=!1){const i=this._getPackageSize(r),s=i*(e%i)+t%i;if(s<0)throw"Invalid level / row / col";return 20+s*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const r=e.subarray(t,t+8);let i,s=0;for(i=0;i<5;i++)s|=(255&r[i])<<8*i;const n=0xffffffffff&s;for(s=0,i=5;i<8;i++)s|=(255&r[i])<<8*(i-5);return{position:n,recordSize:0xffffffffff&s}}_toHexString4(e){let t=e.toString(16);if(4!==t.length){let e=4-t.length;for(;e-- >0;)t="0"+t}return t}};(0,i._)([(0,h.Cb)({readOnly:!0})],he.prototype,"storageInfo",void 0),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],he.prototype,"datasetFormat",void 0),he=(0,i._)([(0,g.j)("esri.layers.support.rasterDatasets.CloudRaster")],he);const fe=he;var de=r(15612);let pe=class extends ie{constructor(){super(...arguments),this.datasetFormat="MEMORY"}async open(e){await this.init();const{pixelBlock:t,statistics:r,histograms:i,name:s,keyProperties:n,nativeExtent:a,transform:o}=this.data,{width:l,height:c,pixelType:u}=t,h=this.data.extent||new te.Z({xmin:-.5,ymin:.5,xmax:l-.5,ymax:c-.5,spatialReference:new ce.Z({wkid:3857})}),f=this.data.isPseudoSpatialReference??!this.data.extent,d={x:h.width/l,y:h.height/c},p=new W.Z({width:l,height:c,pixelType:u,extent:h,nativeExtent:a,transform:o,pixelSize:d,spatialReference:h.spatialReference,bandCount:3,keyProperties:n||{},statistics:r,isPseudoSpatialReference:f,histograms:i});this.createRemoteDatasetStorageInfo(p,512,512),this._set("rasterInfo",p),this.updateTileInfo(),await this._buildInMemoryRaster(t,{width:512,height:512},e),this.datasetName=s,this.url="/InMemory/"+s}fetchRawTile(e,t,r,i={}){const s=this._pixelBlockTiles.get(`${e}/${t}/${r}`);return Promise.resolve(s)}async _buildInMemoryRaster(e,t,r){const i=this.rasterInfo.storageInfo.maximumPyramidLevel,s=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:i},r):Promise.resolve((0,ee.Vl)(e,t,i)),n=(0,o.pC)(this.rasterInfo.statistics),l=(0,o.pC)(this.rasterInfo.histograms),u=n?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},r):Promise.resolve((0,de.Hv)(e)),h=await(0,c.as)([s,u]);if(!h[0].value&&h[1].value)throw new a.Z("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=h[0].value,n||(this.rasterInfo.statistics=h[1].value?.statistics),l||(this.rasterInfo.histograms=h[1].value?.histograms)}};(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],pe.prototype,"datasetFormat",void 0),(0,i._)([(0,h.Cb)()],pe.prototype,"data",void 0),pe=(0,i._)([(0,g.j)("esri.layers.support.rasterDatasets.InMemoryRaster")],pe);const me=pe;function ge(e,t){if(!e||!t)return[];let r=t;t.includes("/")?(r=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const i=[];if(t){const s=ge(e,r);for(let e=0;e<s.length;e++)ge(s[e],t).forEach((e=>i.push(e)));return i}const s=e.getElementsByTagNameNS("*",r);if(!s||0===s.length)return[];for(let e=0;e<s.length;e++)i.push(s[e]||s.item[e]);return i}function ye(e,t){if(!e||!t)return null;let r=t;t.includes("/")?(r=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const i=ge(e,r);return i.length>0?t?ye(i[0],t):i[0]:null}function xe(e,t=null){const r=t?ye(e,t):e;let i;return r?(i=r.textContent||r.nodeValue,i?i.trim():null):null}function we(e,t){return function(e,t){const r=ge(e,t),i=[];let s;for(let e=0;e<r.length;e++)s=r[e].textContent||r[e].nodeValue,s&&(s=s.trim(),""!==s&&i.push(s));return i}(e,t).map((e=>Number(e)))}function be(e,t){const r=xe(e,t);return Number(r)}function Ie(e,t){const r=e?.nodeName?.toLowerCase(),i=t.toLowerCase();return r.slice(r.lastIndexOf(":")+1)===i}var ve=r(87390);function _e(e,t){if(!e||!t)return null;const r=[];for(let i=0;i<e.length;i++)r.push(e[i]),r.push(t[i]);return r}function Ce(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new ce.Z({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const r=e.indexOf("VERTCS"),i=e.indexOf("PROJCS"),s=i>-1?i:e.indexOf("GEOGCS");if(-1===s)return null;const n=e.slice(s,e.lastIndexOf("]",r)+1).trim(),a=e.slice(r,e.lastIndexOf("]")).trim();t=Se(n);const o=new ce.Z(t?{wkid:t}:{wkt:n}),l=Se(a);return l&&(o.vcsWkid=l),o}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=Se(e),new ce.Z(0!==t?{wkid:t}:{wkt:e})):null}function Se(e){const t=e.replace(/\]/g,"[").replace(/\"/g,"").split("[").map((e=>e.trim())).filter((e=>""!==e)),r=t[t.length-1].split(","),i=r[0]?.toLowerCase();if(("epsg"===i||"esri"===i)&&e.endsWith('"]]')){const e=Number(r[1]);if(!isNaN(e)&&0!==e)return e}return 0}function Re(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach((e=>{if(1===e.nodeType)if(Ie(e,"SRS")){if(!t.spatialReference){const r=xe(e);t.spatialReference=Ce(r)}}else if(Ie(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:r,transform:i}=function(e){const t=ye(e,"GeodataXform"),r=Ce(be(t,"SpatialReference/WKID")||xe(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:r,transform:null};const i=be(t,"PolynomialOrder")??1,s=we(t,"CoeffX/Double"),n=we(t,"CoeffY/Double"),a=we(t,"InverseCoeffX/Double"),o=we(t,"InverseCoeffY/Double"),l=_e(s,n),c=_e(a,o);return{spatialReference:r,transform:new ve.Z({spatialReference:r,polynomialOrder:i,forwardCoefficients:l,inverseCoefficients:c})}}(e);t.transform=i,t.spatialReference||(t.spatialReference=r)}else ge(e,"MDI").forEach((e=>t.metadata[e.getAttribute("key")]=xe(e)));else if(Ie(e,"PAMRasterBand")){const r=function(e){const t=be(e,"NoDataValue"),r=ye(e,"Histograms/HistItem"),i=be(r,"HistMin"),s=be(r,"HistMax"),n=be(r,"BucketCount"),a=xe(r,"HistCounts")?.split("|").map((e=>Number(e)));let o,l,c,u;ge(e,"Metadata/MDI").forEach((e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}}));const h=be(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:a?.length&&null!=o&&null!=l?{min:i,max:s,size:n||a.length,counts:a}:null,sourceBandIndex:h,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=r.sourceBandIndex&&null==t.rasterBands[r.sourceBandIndex]?t.rasterBands[r.sourceBandIndex]=r:t.rasterBands.push(r)}}));const r=t.rasterBands;if(r){const e=!!r[0].statistics;t.statistics=e?r.map((e=>e.statistics)):null;const i=!!r[0].histogram;t.histograms=i?r.map((e=>e.histogram)):null}return t}let ke=class extends ie{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:r,statistics:i,histograms:s,transform:n}=await this._fetchAuxiliaryData(e);const a=!r;a&&(r=new ce.Z({wkid:3857})),s?.length&&null==i&&(i=(0,de.Oh)(s));const{width:o,height:l}=t;let c=new te.Z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:r});const u=n?n.forwardTransform(c):c;let h=!0;if(n){const e=n.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(n=null,c=u)}const f=new me({data:{extent:u,nativeExtent:c,transform:n,pixelBlock:t,statistics:i,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await f.open(),f.data=null,this._set("rasterInfo",f.rasterInfo),this._inMemoryRaster=f}fetchRawTile(e,t,r,i={}){return this._inMemoryRaster.fetchRawTile(e,t,r,i)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),r=(0,Q.y)(t).toUpperCase();if("JPG"!==r&&"PNG"!==r&&"GIF"!==r&&"BMP"!==r)throw new a.Z("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",r);const i=r.toLowerCase(),s="gif"===i||"bmp"===i||!(0,f.Z)("ios");return await this.decodePixelBlock(t,{format:i,useCanvas:s,hasNoZlibMask:!0})}async _fetchAuxiliaryData(e){const t=(0,o.Wg)(e?.signal),r=this.ioConfig.skipExtensions??[],i=r.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),s=this.datasetFormat,n="JPG"===s?"jgw":"PNG"===s?"pgw":"BMP"===s?"bpw":null,a=r.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),l=await(0,c.as)([i,a]);if(t?.aborted)throw(0,c.zE)();const u=Re(l[0].value?.data);if(!u.transform){const e=l[1].value?l[1].value.data.split("\n").slice(0,6).map((e=>Number(e))):null;u.transform=6===e?.length?new ve.Z({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return u}};(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],ke.prototype,"datasetFormat",void 0),ke=(0,i._)([(0,g.j)("esri.layers.support.rasterDatasets.ImageAuxRaster")],ke);const Te=ke;var Pe=r(17452),Me=r(45322),Oe=r(56608),Ee=r(29680),Fe=r(26059);let De=class extends ie{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer"}async open(e){await this.init();const t=e&&e.signal,r=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const i=r.data;if(this.sourceJSON=i,!i)throw new a.Z("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!i.tileInfo)throw new a.Z("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=i.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(i.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===i.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=i.name?.slice(i.name.indexOf("/")+1)??"";const s=await this._fetchRasterInfo({signal:t});if((0,o.Wi)(s))throw new a.Z("image-server-raster:open","cannot initialize image service");const n="Map"===this.tileType?(0,Me.d)(i.tileInfo,i):k.Z.fromJSON(i.tileInfo),[l,c]=this._computeMinMaxLOD(s,n),{extent:u,pixelSize:h}=s,f=.5/s.width*h.x,d=Math.max(h.x,h.y),{lods:p}=n;("Map"!==this.tileType&&0!==i.maxScale||Math.abs(h.x-h.y)>f||!p.some((e=>Math.abs(e.resolution-d)<f)))&&(h.x=h.y=l.resolution,s.width=Math.ceil((u.xmax-u.xmin)/h.x-.1),s.height=Math.ceil((u.ymax-u.ymin)/h.y-.1));const m=l.level-c.level,[g,y]=n.size,x=[];p.forEach((e=>{e.level>=c.level&&e.level<=l.level&&x.push({x:e.resolution,y:e.resolution})})),x.sort(((e,t)=>e.x-t.x));const w=this.computeBlockBoundary(u,g,y,n.origin,x,m),b=x.length>1?x.slice(1):null;let I;if(i.transposeInfo&&(I={tileSize:[i.transposeInfo.rows,i.transposeInfo.cols],packetSize:s.keyProperties?._yxs.PacketSize??0}),s.storageInfo=new J.Z({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:b,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:m,tileInfo:n,transposeInfo:I,blockBoundary:w}),this._fixGCSShift(s),this._set("rasterInfo",s),i.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:s.storageInfo.tileInfo,parsedUrl:(0,Pe.mN)(this.url),url:this.url,tileServers:[],type:"tile"};this._tilemapCache=new Oe.y({layer:e})}}async fetchRawTile(e,t,r,i={}){const{storageInfo:s,extent:n}=this.rasterInfo,{transposeInfo:a}=s,l=(0,o.pC)(a)&&!!i.transposedVariableName;if(this._slices&&!l&&null==i.sliceId)return null;const c=l?0:s.maximumPyramidLevel-e+this._levelOffset,u=`${this.url}/tile/${c}/${t}/${r}`,h=this._slices?l?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,{data:f}=await this.request(u,{query:h,responseType:"array-buffer",signal:i.signal});if(!f)return null;const d=l?a.tileSize:s.tileInfo.size,p=await this.decodePixelBlock(f,{width:d[0],height:d[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnPixelInterleavedDims:l}),m=s.blockBoundary[e];if("jpg"!==s.compression||r>m.minCol&&r<m.maxCol&&t>m.minRow&&t<m.maxRow)return p;const{origin:g,blockWidth:y,blockHeight:x}=s,{x:w,y:b}=this.getPyramidPixelSize(e),I=Math.round((n.xmin-g.x)/w)%y,v=Math.round((n.xmax-g.x)/w)%y||y,_=Math.round((g.y-n.ymax)/b)%x,C=Math.round((g.y-n.ymin)/b)%x||x,S=r===m.minCol?I:0,R=t===m.minRow?_:0,k=r===m.maxCol?v:y,T=t===m.maxRow?C:x;return(0,ee.pW)(p,{x:S,y:R},{width:k-S,height:T-R}),p}getSliceIndex(e){if(!this._slices||(0,o.Wi)(e)||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const r=this._slices[e].multidimensionalDefinition;if(r.length===t.length&&!r.some((e=>{const r=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));return!r||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(r.values[0])?`${r.values[0][0]}-${r.values[0][1]}`:r.values[0])})))return e}return null}async fetchVariableStatisticsHistograms(e,t){const r=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.statistics)),i=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.histograms)),s=await Promise.all([r,i]);return s[0]&&s[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let r=this.identifyPixelLocation(e,0,(0,o.Wg)(t.datumTransformation));if(null===r)return null;let i=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let n=s-i+this._levelOffset;const a=r.srcLocation;for(;n>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(n,r.row,r.col,t))break}catch{}if(n--,i++,r=this.identifyPixelLocation(a,i,(0,o.Wg)(t.datumTransformation)),null===r)return null}return-1===n||null==r?null:i}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,r=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),i=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),s=ce.Z.fromJSON(t.spatialReference||e.spatialReference),n=new U.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:s});return new W.Z({width:r,height:i,bandCount:3,extent:te.Z.fromJSON(e),spatialReference:s,pixelSize:n,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:r}=e,i=(0,Fe.g)(this.url,this.sourceJSON,{signal:r,query:this.ioConfig.customFetchParameters}),s=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:r}).then((e=>e.data&&e.data.slices)).catch((()=>null)):null,n=await Promise.all([i,s]);return this._slices=n[1],n[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:r}=e;0===t.xmin&&360===t.xmax&&r.wkid&&r.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Ee.Z,e.extent=e.transform.forwardTransform(t))}_computeMinMaxLOD(e,t){const{pixelSize:r}=e,i=.5/e.width*r.x,{lods:s}=t,n=t.lodAt(Math.max.apply(null,s.map((e=>e.level)))),a=t.lodAt(Math.min.apply(null,s.map((e=>e.level)))),{tileType:o}=this;if("Map"===o)return this._levelOffset=s[0].level,[n,a];if("Raster"===o)return[s.find((e=>e.resolution===r.x))??n,a];const{minScale:l,maxScale:c}=this.sourceJSON;let u=n;c>0&&(u=s.find((e=>Math.abs(e.scale-c)<i)),u||(u=s.filter((e=>e.scale>c)).sort(((e,t)=>e.scale>t.scale?1:-1))[0]??n));let h=a;return l>0&&(h=s.find((e=>Math.abs(e.scale-l)<i))??a,this._levelOffset=h.level-a.level),[u,h]}};(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],De.prototype,"datasetFormat",void 0),(0,i._)([(0,h.Cb)()],De.prototype,"tileType",void 0),De=(0,i._)([(0,g.j)("esri.layers.support.rasterDatasets.ImageServerRaster")],De);const Be=De;var Ne=r(5847),ze=r(48279);const Le=new Map;Le.set("Int8","s8"),Le.set("UInt8","u8"),Le.set("Int16","s16"),Le.set("UInt16","u16"),Le.set("Int32","s32"),Le.set("UInt32","u32"),Le.set("Float32","f32"),Le.set("Float64","f32"),Le.set("Double64","f32");const Ae=new Map;Ae.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Ae.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Ae.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Ae.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let He=class extends ie{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(e){await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?(0,o.Wg)(e.signal):null,r=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:i,files:s}=this._parseHeader(r.data);if(-1===this.ioConfig.skipExtensions?.indexOf("aux.xml")){const t=await this._fetchAuxiliaryData(e);null!=t&&(i.statistics=t.statistics??i.statistics,i.histograms=t.histograms,t.histograms&&(0,o.Wi)(i.statistics)&&(i.statistics=(0,de.Oh)(t.histograms)))}this._set("rasterInfo",i),this._files=s;const n=await this.request(s.index,{responseType:"array-buffer",signal:t});this._storageIndex=this._parseIndex(n.data);const{blockWidth:a,blockHeight:l}=this.rasterInfo.storageInfo,c=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:u,height:h}=this.rasterInfo,f=[],d=this._getBandSegmentCount();let p=0,m=-1;for(;p<this._storageIndex.length;){m++;const e=Math.ceil(u/a/c**m)-1,t=Math.ceil(h/l/c**m)-1;p+=(e+1)*(t+1)*d*4,f.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=f,m>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=m),this.updateTileInfo()}async fetchRawTile(e,t,r,i={}){const{blockWidth:s,blockHeight:n,blockBoundary:a}=this.rasterInfo.storageInfo,l=a[e];if(!l||l.maxRow<t||l.maxCol<r||l.minRow>t||l.minCol>r)return null;const{bandCount:c,pixelType:u}=this.rasterInfo,{ranges:h,actualTileWidth:f,actualTileHeight:d}=this._getTileLocation(e,t,r);if(!h||0===h.length)return null;if(0===h[0].from&&0===h[0].to){const e=new Uint8Array(s*n);return new Ne.Z({width:s,height:n,pixels:null,mask:e,validPixelCount:0})}const{bandIds:p}=this.ioConfig,m=this._getBandSegmentCount(),g=[];let y=0;for(y=0;y<m;y++)(!p||p.indexOf[y]>-1)&&g.push(this.request(this._files.data,{range:{from:h[y].from,to:h[y].to},responseType:"array-buffer",signal:i.signal}));const x=await Promise.all(g),w=x.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),b=new Uint8Array(w);let I=0;for(y=0;y<m;y++)b.set(new Uint8Array(x[y].data),I),I+=x[y].data.byteLength;const v=Ae.get(this.rasterInfo.storageInfo.compression).decoderFormat,_=await this.decodePixelBlock(b.buffer,{width:s,height:n,format:v,planes:p?.length||c,pixelType:u});if((0,o.pC)(this.rasterInfo.noDataValue)&&"lerc"!==v&&!_.mask){const e=this.rasterInfo.noDataValue[0];if(null!=e){const t=_.width*_.height,r=new Uint8Array(t);if(Math.abs(e)>1e24)for(y=0;y<t;y++)Math.abs((_.pixels[0][y]-e)/e)>1e-6&&(r[y]=1);else for(y=0;y<t;y++)_.pixels[0][y]!==e&&(r[y]=1);_.mask=r}}let C=0,S=0;if(f!==s||d!==n){let e=_.mask;if(e)for(y=0;y<n;y++)if(S=y*s,y<d)for(C=f;C<s;C++)e[S+C]=0;else for(C=0;C<s;C++)e[S+C]=0;else for(e=new Uint8Array(s*n),_.mask=e,y=0;y<d;y++)for(S=y*s,C=0;C<f;C++)e[S+C]=1}return _}_parseIndex(e){if(e.byteLength%16>0)throw"invalid array buffer must be multiples of 16";let t,r,i,s,n,a;if(ze.f){for(r=new Uint8Array(e),s=new ArrayBuffer(e.byteLength),i=new Uint8Array(s),n=0;n<e.byteLength/4;n++)for(a=0;a<4;a++)i[4*n+a]=r[4*n+3-a];t=new Uint32Array(s)}else t=new Uint32Array(e);return t}_getBandSegmentCount(){return Ae.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,r){const{blockWidth:i,blockHeight:s,pyramidScalingFactor:n}=this.rasterInfo.storageInfo,{width:a,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,h,f=0,d=0;for(h=0;h<e;h++)d=n**h,c=Math.ceil(a/i/d),u=Math.ceil(o/s/d),f+=c*u;d=n**e,c=Math.ceil(a/i/d),u=Math.ceil(o/s/d),f+=t*c+r,f*=4*l;const p=this._storageIndex.subarray(f,f+4*l);let m=0,g=0;const y=[];for(let e=0;e<l;e++)m=p[4*e+0]*2**32+p[4*e+1],g=m+p[4*e+2]*2**32+p[4*e+3],y.push({from:m,to:g});return{ranges:y,actualTileWidth:r<c-1?i:Math.ceil(a/d)-i*(c-1),actualTileHeight:t<u-1?s:Math.ceil(o/d)-s*(u-1)}}_parseHeader(e){const t=ye(e,"MRF_META/Raster");if(!t)throw new a.Z("mrf:open","not a valid MRF format");const r=ye(t,"Size"),i=parseInt(r.getAttribute("x"),10),s=parseInt(r.getAttribute("y"),10),n=parseInt(r.getAttribute("c"),10),o=(xe(t,"Compression")||"none").toLowerCase();if(!Ae.has(o))throw new a.Z("mrf:open","currently does not support compression "+o);const l=xe(t,"DataType")||"UInt8",c=Le.get(l);if(null==c)throw new a.Z("mrf:open","currently does not support pixel type "+l);const u=ye(t,"PageSize"),h=parseInt(u.getAttribute("x"),10),f=parseInt(u.getAttribute("y"),10),d=ye(t,"DataValues");let p,m;if(d&&(m=d.getAttribute("NoData"),null!=m&&(p=m.trim().split(" ").map((e=>parseFloat(e))))),ye(e,"MRF_META/CachedSource"))throw new a.Z("mrf:open","currently does not support MRF referencing other data files");const g=ye(e,"MRF_META/GeoTags"),y=ye(g,"BoundingBox");let x,w=!1;if(null!=y){const e=parseFloat(y.getAttribute("minx")),t=parseFloat(y.getAttribute("miny")),r=parseFloat(y.getAttribute("maxx")),i=parseFloat(y.getAttribute("maxy")),s=xe(g,"Projection")||"";let n;if("LOCAL_CS[]"!==s)if(s.toLowerCase().startsWith("epsg:")){const e=Number(s.slice(5));isNaN(e)||0===e||(n=new ce.Z({wkid:e}))}else n=Ce(s);else w=!0,n=new ce.Z({wkid:3857});x=new te.Z(e,t,r,i),x.spatialReference=n}else w=!0,x=new te.Z({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:new ce.Z({wkid:3857})});const b=ye(e,"MRF_META/Rsets"),I=parseInt(b&&b.getAttribute("scale")||"2",10),v=x.spatialReference,_=new J.Z({origin:new U.Z({x:x.xmin,y:x.ymax,spatialReference:v}),blockWidth:h,blockHeight:f,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:o,pyramidScalingFactor:I}),C=new U.Z({x:x.width/i,y:x.height/s,spatialReference:v}),S=new W.Z({width:i,height:s,extent:x,isPseudoSpatialReference:w,spatialReference:v,bandCount:n,pixelType:c,pixelSize:C,noDataValue:p,storageInfo:_}),R=xe(e,"datafile"),k=xe(e,"IndexFile");return{rasterInfo:S,files:{mrf:this.url,index:k||this.url.replace(".mrf",".idx"),data:R||this.url.replace(".mrf",Ae.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Re(t)}catch{return null}}};(0,i._)([(0,h.Cb)()],He.prototype,"_files",void 0),(0,i._)([(0,h.Cb)()],He.prototype,"_storageIndex",void 0),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],He.prototype,"datasetFormat",void 0),He=(0,i._)([(0,g.j)("esri.layers.support.rasterIO.MRFRaster")],He);const Ze=He;var We=r(94793),Je=r(9832);const je=(e,t)=>{const r=e.get(t);return r&&r.values},qe=(e,t)=>{const r=e.get(t);return r&&r.values[0]};let Ge=class extends ie{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){await this.init();const t=e?(0,o.Wg)(e.signal):null,{data:r}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!r)throw new a.Z("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{littleEndian:i,firstIFD:s,isBigTiff:n}=(0,We.cK)(r),l=[];await this._readIFDs(l,r,i,s,0,n?8:4,t);const{imageInfo:c,rasterInfo:u}=this._parseIFDs(l);if(this._headerInfo={littleEndian:i,isBigTiff:n,ifds:l,...c},this._set("rasterInfo",u),!this._headerInfo.isSupported)throw new a.Z("tiffraster:open","this tiff is not supported: "+this._headerInfo.message);if(!this.ioConfig.skipExtensions?.includes("aux.xml")){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&this._processPAMInfo(t,u)}1!==u.bandCount||"u8"!==u.pixelType||this.ioConfig.skipExtensions?.includes("vat.dbf")||(u.attributeTable=await this._fetchAuxiliaryTable(e),(0,o.pC)(u.attributeTable)&&(u.keyProperties.DataType="thematic")),this.updateTileInfo()}async fetchRawTile(e,t,r,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,r))return null;const s=this._getTileLocation(e,t,r);if(!s)return null;const{ranges:n,actualTileWidth:a,actualTileHeight:o,ifd:l}=s,c=n.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:i.signal}))),u=await Promise.all(c),h=u.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),f=1===u.length?u[0].data:new ArrayBuffer(h),d=[0],p=[0];if(u.length>1){const e=new Uint8Array(f);for(let t=0,r=0;t<u.length;t++){const i=u[t].data;e.set(new Uint8Array(i),r),d[t]=r,r+=i.byteLength,p[t]=i.byteLength}}const{blockWidth:m,blockHeight:g}=this.getBlockWidthHeight(e),y=await this.decodePixelBlock(f,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:l,offsets:d,sizes:p},width:m,height:g,planes:null,pixelType:null});let x,w,b;if(a!==m||o!==g){let e=y.mask;if(e)for(x=0;x<g;x++)if(b=x*m,x<o)for(w=a;w<m;w++)e[b+w]=0;else for(w=0;w<m;w++)e[b+w]=0;else for(e=new Uint8Array(m*g),y.mask=e,x=0;x<o;x++)for(b=x*m,w=0;w<a;w++)e[b+w]=1}return y}_parseIFDs(e){const t=(0,We.FI)(e),{width:r,height:i,tileWidth:s,tileHeight:n,planes:a,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:h,pyramidBlockHeight:f,tileBoundary:d,affine:p,metadata:m}=t;let g=Ce(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),y=!1;null==g&&(y=!0,g=new ce.Z({wkid:3857}));const x=new te.Z({...t.extent,spatialReference:g}),w=new U.Z(x?{x:x.xmin,y:x.ymax,spatialReference:g}:{x:0,y:0}),b=new J.Z({blockWidth:s,blockHeight:n,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:l,origin:w,firstPyramidLevel:c,maximumPyramidLevel:u,blockBoundary:d}),I=new U.Z({x:(x.xmax-x.xmin)/r,y:(x.ymax-x.ymin)/i,spatialReference:g}),v=m?{BandProperties:m.bandProperties,DataType:m.dataType}:{},_=new W.Z({width:r,height:i,bandCount:a,pixelType:o,compression:l,pixelSize:I,storageInfo:b,spatialReference:g,isPseudoSpatialReference:y,keyProperties:v,extent:x,statistics:m?m.statistics:null});return p?.length&&(_.nativeExtent=new te.Z({xmin:-.5,ymin:.5-i,xmax:r-.5,ymax:.5,spatialReference:g}),_.transform=new ve.Z({polynomialOrder:1,forwardCoefficients:[p[2]+p[0]/2,p[5]-p[3]/2,p[0],p[3],-p[1],-p[4]]}),_.extent=_.transform.forwardTransform(_.nativeExtent),_.pixelSize=new U.Z({x:(x.xmax-x.xmin)/r,y:(x.ymax-x.ymin)/i,spatialReference:g}),b.origin.x=-.5,b.origin.y=.5),{imageInfo:t,rasterInfo:_}}_processPAMInfo(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&(0,o.Wi)(t.statistics)&&(t.statistics=(0,de.Oh)(e.histograms)),e.transform&&(0,o.Wi)(t.transform)){t.transform=e.transform,t.nativeExtent=t.extent;const r=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new U.Z({x:(r.xmax-r.xmin)/t.width,y:(r.ymax-r.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=r}t.spatialReference||(t.spatialReference=e.spatialReference)}async _readIFDs(e,t,r,i,s,n=4,a){if(!i)return null;(i>=t.byteLength||i<0)&&(t=(await this.request(this.url,{range:{from:i+s,to:i+s+this._bufferSize},responseType:"array-buffer",signal:a})).data,s=i+s,i=0);const o=await this._readIFD(t,r,i,s,Je.Z.TIFF_TAGS,n,a);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,r,o.nextIFD-s,s,n,a)}async _readIFD(e,t,r,i,s=Je.Z.TIFF_TAGS,n=4,a){if(!e)return null;const o=(0,We.vr)(e,t,r,i,s,n);if(o.success){const r=[];if(o.ifd.forEach((e=>{e.values||r.push(e)})),r.length>0){const s=r.map((e=>e.offlineOffsetSize)),n=Math.min.apply(null,s.map((e=>e[0])));if(Math.min.apply(null,s.map((e=>e[0]+e[1])))-n<=this._bufferSize){const{data:s}=await this.request(this.url,{range:{from:n,to:n+this._bufferSize},responseType:"array-buffer",signal:a});e=s,i=n,r.forEach((r=>(0,We.Dq)(e,t,r,i)))}}if(o.ifd.has("GEOKEYDIRECTORY")){const r=o.ifd.get("GEOKEYDIRECTORY"),s=r.values;if(s&&s.length>4){const n=s[0]+"."+s[1]+"."+s[2],o=await this._readIFD(e,t,r.valueOffset+6-i,i,Je.Z.GEO_KEYS,2,a);r.data=o.ifd,r.data&&r.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[n]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==e.byteLength){const r=await this.request(this.url,{range:{from:i,to:i+o.requiredBufferSize+4},responseType:"array-buffer",signal:a});return(e=r.data).byteLength<o.requiredBufferSize?null:this._readIFD(e,t,0,i,Je.Z.TIFF_TAGS,4,a)}}_getTileLocation(e,t,r){const{firstPyramidLevel:i,blockBoundary:s}=this.rasterInfo.storageInfo,n=0===e?0:e-(i-1),a=this._headerInfo.ifds[n];if(!a)return null;const o=(0,We.If)(a,this._headerInfo),l=je(a,"TILEOFFSETS");if(void 0===l)return null;const c=je(a,"TILEBYTECOUNTS"),{minRow:u,minCol:h,maxRow:f,maxCol:d}=s[n];if(t>f||r>d||t<u||r<h)return null;const p=qe(a,"IMAGEWIDTH"),m=qe(a,"IMAGELENGTH"),g=qe(a,"TILEWIDTH"),y=qe(a,"TILELENGTH"),x=o?this.rasterInfo.bandCount:1,w=x*t*(d+1)+r,b=[{from:l[w],to:l[w+x-1]+c[w+x-1]-1}];if(o){let e=!0;for(let t=0;t<x;t++)if(l[w+t]+c[w+t]!==l[w+t+1]){e=!1;break}if(!e)for(let e=0;e<x;e++)b[e]={from:l[w+e],to:l[w+e]+c[w+e]-1}}const I=l[w],v=c[w];return null==I||null==v?null:{ranges:b,ifd:a,actualTileWidth:r===d?p%g:g,actualTileHeight:t===f?m%y:y}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Re(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),r=ae.parse(t);return r?.recordSet?le.default.fromJSON(r.recordSet):null}catch{return null}}};(0,i._)([(0,h.Cb)()],Ge.prototype,"_files",void 0),(0,i._)([(0,h.Cb)()],Ge.prototype,"_headerInfo",void 0),(0,i._)([(0,h.Cb)()],Ge.prototype,"_bufferSize",void 0),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],Ge.prototype,"datasetFormat",void 0),Ge=(0,i._)([(0,g.j)("esri.layers.support.rasterDatasets.TIFFRaster")],Ge);const Ue=Ge,$e=new Map;$e.set("CRF",{desc:"Cloud Raster Format",constructor:fe}),$e.set("MRF",{desc:"Meta Raster Format",constructor:Ze}),$e.set("TIFF",{desc:"GeoTIFF",constructor:Ue}),$e.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Be}),$e.set("JPG",{desc:"JPG Raster Format",constructor:Te}),$e.set("PNG",{desc:"PNG Raster Format",constructor:Te}),$e.set("GIF",{desc:"GIF Raster Format",constructor:Te}),$e.set("BMP",{desc:"BMP Raster Format",constructor:Te});var Ve=r(32163);let Ye=class extends((0,x.h)((0,L.M)((0,B.q)((0,N.I)((0,w.N)(D((0,A.n)((0,z.Q)((0,l.R)(y.Z)))))))))){constructor(...e){super(...e),this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.title=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=(0,o.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(c.r9).then((()=>this._openRaster(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){let e=[new H.Z({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"})];const{rasterInfo:t}=this,{attributeTable:r}=t,i=(0,o.pC)(r)?r.fields:null;if(i){const t=i.filter((e=>"oid"!==e.type&&"value"!==e.name.toLowerCase())).map((e=>{const t=e.clone();return t.name="Raster."+e.name,t}));e=e.concat(t)}const{dataType:s,multidimensionalInfo:n}=t;if(("vector-magdir"===s||"vector-uv"===s)&&(0,o.pC)(n)){const t=n.variables[0].unit?.trim(),r="Magnitude"+(t?` (${t})`:"");e.push(new H.Z({name:"Raster.Magnitude",alias:r,domain:null,editable:!1,type:"double"})),e.push(new H.Z({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return e}set renderer(e){this._set("renderer",e),this.updateRenderer()}readRenderer(e,t,r){const i=t&&t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.renderer,s=(0,n.ij)(i,r)||void 0;if(null!=s)return s}createPopupTemplate(e){return(0,Ve.eZ)({fields:this.rasterFields,title:this.title},e)}write(e,t){const{raster:r}=this;if(this.loaded?"RasterTileServer"===r.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t&&t.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new a.Z("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){this.raster?(this.raster.rasterInfo||await this.raster.open(),this.url=this.raster.url):this.raster=await class{static get supportedFormats(){const e=new Set;return $e.forEach(((t,r)=>e.add(r))),e}static async open(e){const{url:t,ioConfig:r,sourceJSON:i}=e;let s=e.datasetFormat;null==s&&t.lastIndexOf(".")&&(s=t.slice(t.lastIndexOf(".")+1).toUpperCase()),"OVR"===s||"TIF"===s?s="TIFF":"JPG"!==s&&"JPEG"!==s&&"JFIF"!==s||(s="JPG"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(s="RasterTileServer");const n={url:t,sourceJSON:i,datasetFormat:s,ioConfig:r||{bandIds:null,sampling:null}};let o,l;if(this.supportedFormats.has(s)){if("CRF"===s&&!r.enableCRF)throw new a.Z("rasterfactory:open",`cannot open raster: ${t}`);return o=$e.get(s).constructor,l=new o(n),await l.open({signal:e.signal}),l}if(s)throw new a.Z("rasterfactory:open","not a supported format "+s);const c=Array.from($e.keys());let u=0;const h=()=>(s=c[u++],s&&("CRF"!==s||r.enableCRF)?(o=$e.get(s).constructor,l=new o(n),l.open({signal:e.signal}).then((()=>l)).catch((()=>h()))):null);return h()}static register(e,t,r){$e.has(e.toUpperCase())||$e.set(e.toUpperCase(),{desc:t,constructor:r})}}.open({url:this.url,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});const{rasterInfo:t}=this.raster;if(!t)throw new a.Z("imagery-tile-layer:load","cannot load resources on "+this.url);if(this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}null==this.title&&(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,u.YP)((()=>this.customParameters),(e=>{this.raster.ioConfig.customFetchParameters=e})))}};(0,i._)([(0,h.Cb)({type:[d.z8],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],Ye.prototype,"bandIds",void 0),(0,i._)([(0,h.Cb)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,p.J)(Z.c)],Ye.prototype,"interpolation",void 0),(0,i._)([(0,h.Cb)({json:{write:!0}})],Ye.prototype,"multidimensionalDefinition",void 0),(0,i._)([(0,h.Cb)(C.rn)],Ye.prototype,"legendEnabled",void 0),(0,i._)([(0,h.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Ye.prototype,"isReference",void 0),(0,i._)([(0,h.Cb)({type:["show","hide"]})],Ye.prototype,"listMode",void 0),(0,i._)([(0,h.Cb)({json:{read:!0,write:!0}})],Ye.prototype,"blendMode",void 0),(0,i._)([(0,h.Cb)()],Ye.prototype,"sourceJSON",void 0),(0,i._)([(0,h.Cb)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],Ye.prototype,"version",void 0),(0,i._)([(0,h.Cb)()],Ye.prototype,"title",void 0),(0,i._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],Ye.prototype,"type",void 0),(0,i._)([(0,h.Cb)({type:["ArcGISTiledImageServiceLayer"]})],Ye.prototype,"operationalLayerType",void 0),(0,i._)([(0,h.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,r){t[r]=!e}}}})],Ye.prototype,"popupEnabled",void 0),(0,i._)([(0,h.Cb)({type:s.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],Ye.prototype,"popupTemplate",void 0),(0,i._)([(0,h.Cb)({readOnly:!0})],Ye.prototype,"defaultPopupTemplate",null),(0,i._)([(0,h.Cb)({readOnly:!0,type:[H.Z]})],Ye.prototype,"fields",void 0),(0,i._)([(0,h.Cb)({readOnly:!0,type:[H.Z]})],Ye.prototype,"rasterFields",null),(0,i._)([(0,h.Cb)({types:n.dr,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:n.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],Ye.prototype,"renderer",null),(0,i._)([(0,m.r)("renderer")],Ye.prototype,"readRenderer",null),Ye=(0,i._)([(0,g.j)("esri.layers.ImageryTileLayer")],Ye);const Ke=Ye},74889:(e,t,r)=>{r.r(t),r.d(t,{default:()=>b});var i,s=r(43697),n=r(66577),a=r(38171),o=r(35454),l=r(96674),c=r(22974),u=r(70586),h=r(5600),f=(r(75215),r(71715)),d=r(52011),p=r(30556),m=r(82971),g=r(33955),y=r(1231);const x=new o.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let w=i=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=m.Z.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const s=e[t],n=a.Z.fromJSON(s),o=s.geometry&&s.geometry.spatialReference;(0,u.pC)(n.geometry)&&!o&&(n.geometry.spatialReference=r);const l=s.aggregateGeometries,c=n.aggregateGeometries;if(l&&(0,u.pC)(c))for(const e in c){const t=c[e],i=l[e]?.spatialReference;(0,u.pC)(t)&&!i&&(t.spatialReference=r)}i.push(n)}return i}writeGeometryType(e,t,r,i){if(e)return void x.write(e,t,r,i);const{features:s}=this;if(s)for(const e of s)if(e&&(0,u.pC)(e.geometry))return void x.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,i=(0,g.im)(e);return!r&&t.spatialReference&&(i.spatialReference=m.Z.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,u.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,c.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const i=t.features[r];if(i.geometry){const t=e&&e[r];i.geometry=t&&t.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,r],translate:[i,s]}=e,n=this.features,a=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-i)/t)),(e=>Math.round((s-e)/r)));for(let e=0,t=n.length;e<t;e++)a((0,u.Wg)(n[e].geometry))||(n.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[i,s],scale:[n,a]}=r,o=this._getHydrationFunction(e,(e=>e*n+i),(e=>s-e*a));for(const{geometry:e}of t)(0,u.pC)(e)&&o(e);return this.transform=null,this}_quantizePoints(e,t,r){let i,s;const n=[];for(let a=0,o=e.length;a<o;a++){const o=e[a];if(a>0){const e=t(o[0]),a=r(o[1]);e===i&&a===s||(n.push([e-i,a-s]),i=e,s=a)}else i=t(o[0]),s=r(o[1]),n.push([i,s])}return n.length>0?n:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const i=(0,g.oU)(e)?e.rings:e.paths,s=[];for(let e=0,n=i.length;e<n;e++){const n=i[e],a=this._quantizePoints(n,t,r);a&&s.push(a)}return s.length>0?((0,g.oU)(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,r);return i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const i=(0,g.oU)(e)?e.rings:e.paths;let s,n;for(let e=0,a=i.length;e<a;e++){const a=i[e];for(let e=0,i=a.length;e<i;e++){const i=a[e];e>0?(s+=i[0],n+=i[1]):(s=i[0],n=i[1]),i[0]=t(s),i[1]=r(n)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const i=e.points;let s,n;for(let e=0,a=i.length;e<a;e++){const a=i[e];e>0?(s+=a[0],n+=a[1]):(s=a[0],n=a[1]),a[0]=t(s),a[1]=r(n)}}:void 0}};(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],w.prototype,"displayFieldName",void 0),(0,s._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"exceededTransferLimit",void 0),(0,s._)([(0,h.Cb)({type:[a.Z],json:{write:!0}})],w.prototype,"features",void 0),(0,s._)([(0,f.r)("features")],w.prototype,"readFeatures",null),(0,s._)([(0,h.Cb)({type:[y.Z],json:{write:!0}})],w.prototype,"fields",void 0),(0,s._)([(0,h.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:x.read}}})],w.prototype,"geometryType",void 0),(0,s._)([(0,p.c)("geometryType")],w.prototype,"writeGeometryType",null),(0,s._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasM",void 0),(0,s._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasZ",void 0),(0,s._)([(0,h.Cb)({types:n.qM,json:{write:!0}})],w.prototype,"queryGeometry",void 0),(0,s._)([(0,f.r)("queryGeometry")],w.prototype,"readQueryGeometry",null),(0,s._)([(0,h.Cb)({type:m.Z,json:{write:!0}})],w.prototype,"spatialReference",void 0),(0,s._)([(0,p.c)("spatialReference")],w.prototype,"writeSpatialReference",null),(0,s._)([(0,h.Cb)({json:{write:!0}})],w.prototype,"transform",void 0),w=i=(0,s._)([(0,d.j)("esri.rest.support.FeatureSet")],w),w.prototype.toJSON.isDefaultToJSON=!0;const b=w}}]);