@arcgis/core 4.24.0-next.20220508 → 4.24.0-next.20220511

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 (338) hide show
  1. package/AggregateGraphic.js +1 -1
  2. package/analysis/Analysis.js +1 -1
  3. package/analysis/DimensioningAnalysis.js +1 -1
  4. package/analysis/LengthDimension.d.ts +4 -0
  5. package/analysis/LengthDimension.js +5 -0
  6. package/analysis/dimensionUtils.js +5 -0
  7. package/arcade/Dictionary.js +1 -1
  8. package/arcade/Feature.js +1 -1
  9. package/arcade/arcade.js +1 -1
  10. package/arcade/arcadeAsyncRuntime.js +1 -1
  11. package/arcade/arcadeCompiler.js +1 -1
  12. package/arcade/credentials.js +1 -1
  13. package/arcade/featureSetCollection.js +1 -1
  14. package/arcade/featureSetUtils.js +1 -1
  15. package/arcade/featureset/actions/Adapted.js +1 -1
  16. package/arcade/featureset/actions/AttributeFilter.js +1 -1
  17. package/arcade/featureset/actions/GroupBy.js +1 -1
  18. package/arcade/featureset/actions/OrderBy.js +1 -1
  19. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  20. package/arcade/featureset/actions/Top.js +1 -1
  21. package/arcade/featureset/sources/Empty.js +1 -1
  22. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  23. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  24. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  25. package/arcade/featureset/support/FeatureSet.js +1 -1
  26. package/arcade/featureset/support/FeatureSetIterator.js +1 -1
  27. package/arcade/featureset/support/shared.js +1 -1
  28. package/arcade/featureset/support/stats.js +1 -1
  29. package/arcade/functions/featuresetbase.js +1 -1
  30. package/arcade/functions/featuresetgeom.js +1 -1
  31. package/arcade/functions/featuresetstats.js +1 -1
  32. package/arcade/functions/featuresetstring.js +1 -1
  33. package/arcade/functions/geomasync.js +1 -1
  34. package/arcade/languageUtils.js +1 -1
  35. package/arcade/request.js +1 -1
  36. package/assets/esri/core/workers/RemoteClient.js +1 -1
  37. package/assets/esri/core/workers/chunks/0564f1cfa3d17ff1aad3.js +1 -0
  38. package/assets/esri/core/workers/chunks/0806d5d706a864542bfb.js +1 -0
  39. package/assets/esri/core/workers/chunks/0a6977144ea1abf96fbf.js +1 -0
  40. package/assets/esri/core/workers/chunks/13387f56acbc3291561a.js +1 -0
  41. package/assets/esri/core/workers/chunks/16c4e0a32d50d4db984d.js +1 -0
  42. package/assets/esri/core/workers/chunks/{076d1b1101b59af0d389.js → 1c010202b4c7e1d15f23.js} +1 -1
  43. package/assets/esri/core/workers/chunks/26827ec144676e6385f8.js +1 -0
  44. package/assets/esri/core/workers/chunks/287c484fd40eee643f3a.js +1 -0
  45. package/assets/esri/core/workers/chunks/5210f0b42dba27945226.js +1 -0
  46. package/assets/esri/core/workers/chunks/{db6c5b3b4efe8d804f9c.js → 52478ee2d2a1354b6900.js} +1 -1
  47. package/assets/esri/core/workers/chunks/5759af97f96f24c40105.js +1 -0
  48. package/assets/esri/core/workers/chunks/{b85218d44c6094b7e5e6.js → 6d7e2a23a0a5dd9ded1d.js} +1 -1
  49. package/assets/esri/core/workers/chunks/70b6356357e7640c4e8b.js +1 -0
  50. package/assets/esri/core/workers/chunks/7574316b3af61c389e8f.js +1 -0
  51. package/assets/esri/core/workers/chunks/7bc828fbdd54c0b28aac.js +1 -0
  52. package/assets/esri/core/workers/chunks/7e5c22b5a32ac74b1b6e.js +1 -0
  53. package/assets/esri/core/workers/chunks/8102bb78fe96e6197e4e.js +1 -0
  54. package/assets/esri/core/workers/chunks/88384e7cafbfd2348598.js +1 -0
  55. package/assets/esri/core/workers/chunks/9d7533aaeac3b8d145c4.js +1 -0
  56. package/assets/esri/core/workers/chunks/{1eecae5227318f491263.js → 9f4d892abf55e8625bc9.js} +3 -3
  57. package/assets/esri/core/workers/chunks/{98607a0da63626cc4614.js → a054a52712a118c6d505.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{69a20e4d9e28c3e599fc.js → a3bb600bfcb0282622f1.js} +1 -1
  59. package/assets/esri/core/workers/chunks/aa49841b14c6e6df2a07.js +1 -0
  60. package/assets/esri/core/workers/chunks/b089058b64db3912478f.js +1 -0
  61. package/assets/esri/core/workers/chunks/b28539c5a6bedb71b038.js +1 -0
  62. package/assets/esri/core/workers/chunks/b4f171db73355c6f766e.js +1 -0
  63. package/assets/esri/core/workers/chunks/b7572b0921b23aef8b9d.js +1 -0
  64. package/assets/esri/core/workers/chunks/b758f3c419edc2306784.js +1 -0
  65. package/assets/esri/core/workers/chunks/c3e7290fb128d4fefd44.js +1 -0
  66. package/assets/esri/core/workers/chunks/c51c9b5da855f84b9a48.js +1 -0
  67. package/assets/esri/core/workers/chunks/c66ac36da6392b6bf331.js +1 -0
  68. package/assets/esri/core/workers/chunks/d16b328d32a6ddc2fdb9.js +1 -0
  69. package/assets/esri/core/workers/chunks/d94c5f36d52cf71f0bb9.js +1 -0
  70. package/assets/esri/core/workers/chunks/db937849b2c1af87b481.js +1 -0
  71. package/assets/esri/core/workers/chunks/{66cd99e91dad60c5274c.js → dc3ed59f450283d97a19.js} +1 -1
  72. package/assets/esri/core/workers/chunks/dcd0653191cd4a1ccaae.js +2 -0
  73. package/assets/esri/core/workers/chunks/{31df729c17470245288c.js.LICENSE.txt → dcd0653191cd4a1ccaae.js.LICENSE.txt} +2 -2
  74. package/assets/esri/core/workers/chunks/e4fdd1eaf987977d0a51.js +1 -0
  75. package/assets/esri/core/workers/chunks/e51f0e71f2a55af604d3.js +1 -0
  76. package/assets/esri/core/workers/chunks/eb3855d3753d6b8334bd.js +1 -0
  77. package/assets/esri/core/workers/chunks/{7c290763920f52a1f504.js → eeed138930a4a805691d.js} +1 -1
  78. package/assets/esri/core/workers/chunks/f435dc615fdc8917f6ca.js +1 -0
  79. package/assets/esri/core/workers/chunks/{d5c5b9f7f5401f36a3a5.js → f7f3dde4c8f9c687cc1e.js} +1 -1
  80. package/assets/esri/core/workers/chunks/fc6beaf9466ea3898549.js +1 -0
  81. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  82. package/assets/esri/themes/base/widgets/_Tooltip.scss +1 -0
  83. package/assets/esri/themes/base/widgets/_Weather.scss +1 -2
  84. package/assets/esri/themes/dark/main.css +1 -1
  85. package/assets/esri/themes/light/main.css +1 -1
  86. package/assets/esri/themes/light/view.css +1 -1
  87. package/chunks/BlendLayers.glsl.js +6 -6
  88. package/chunks/arcade.js +1 -1
  89. package/chunks/array.js +1 -1
  90. package/chunks/languageUtils.js +1 -1
  91. package/config.js +1 -1
  92. package/core/sql/StandardizedFunctions.js +1 -1
  93. package/geohash/GeohashTree.js +1 -1
  94. package/geometry/support/contains.js +1 -1
  95. package/geometry/support/heightModelInfoUtils.js +1 -1
  96. package/geometry/support/intersects.js +1 -1
  97. package/geometry/support/intersectsBase.js +1 -1
  98. package/geometry/support/normalizeUtilsCommon.js +1 -1
  99. package/geometry/support/spatialReferenceUtils.js +1 -1
  100. package/interfaces.d.ts +685 -37
  101. package/layers/MediaLayer.d.ts +4 -0
  102. package/layers/MediaLayer.js +5 -0
  103. package/layers/VoxelLayer.js +1 -1
  104. package/layers/VoxelWasmPerSceneView.js +5 -0
  105. package/layers/graphics/OptimizedGeometry.js +1 -1
  106. package/layers/graphics/data/BoundsStore.js +1 -1
  107. package/layers/support/CornersGeoreference.d.ts +4 -0
  108. package/layers/support/CornersGeoreference.js +5 -0
  109. package/layers/support/ExtentAndRotationGeoreference.d.ts +4 -0
  110. package/layers/support/ExtentAndRotationGeoreference.js +5 -0
  111. package/layers/support/FeatureReduction.js +1 -1
  112. package/layers/support/FeatureReductionBinning.js +5 -0
  113. package/layers/support/GeoreferenceBase.js +5 -0
  114. package/layers/support/ImageElement.d.ts +4 -0
  115. package/layers/support/ImageElement.js +5 -0
  116. package/layers/support/LocalMediaElementSource.d.ts +4 -0
  117. package/layers/support/LocalMediaElementSource.js +5 -0
  118. package/layers/support/MediaElementBase.d.ts +4 -0
  119. package/layers/support/MediaElementBase.js +5 -0
  120. package/layers/support/RouteStopSymbols.d.ts +4 -0
  121. package/layers/support/RouteSymbols.d.ts +4 -0
  122. package/layers/support/VoxelFormat.d.ts +4 -0
  123. package/layers/support/VoxelStyle.d.ts +4 -0
  124. package/layers/support/VoxelVariable.d.ts +4 -0
  125. package/layers/support/VoxelVolume.d.ts +4 -0
  126. package/layers/support/VoxelVolumeStyle.d.ts +4 -0
  127. package/layers/support/arcgisLayerUrl.js +1 -1
  128. package/layers/support/featureReductionUtils.js +1 -1
  129. package/layers/support/fieldUtils.js +1 -1
  130. package/layers/support/rasterFormats/Lerc.js +1 -1
  131. package/package.json +3 -3
  132. package/request.js +1 -1
  133. package/support/requestUtils.js +1 -1
  134. package/support/revision.js +1 -1
  135. package/symbols/Font.js +1 -1
  136. package/symbols/support/textUtils.js +1 -1
  137. package/views/2d/engine/brushes.js +1 -1
  138. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  139. package/views/2d/engine/webgl/Overlay.js +5 -0
  140. package/views/2d/engine/webgl/OverlayContainer.js +5 -0
  141. package/views/2d/engine/webgl/brushes/BrushOverlay.js +5 -0
  142. package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
  143. package/views/2d/engine/webgl/shaders/OverlayPrograms.js +5 -0
  144. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  145. package/views/2d/layerViewModuleImportUtils.js +1 -1
  146. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  147. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  148. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  149. package/views/2d/layers/MediaLayerView2D.js +5 -0
  150. package/views/2d/layers/StreamLayerView2D.js +1 -1
  151. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  152. package/views/2d/layers/features/FeatureStore2D.js +1 -1
  153. package/views/2d/layers/features/Pipeline.js +1 -1
  154. package/views/2d/layers/features/Store2D.js +1 -1
  155. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  156. package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
  157. package/views/2d/layers/features/schemaUtils.js +1 -1
  158. package/views/2d/layers/features/sources/GeoEventSource.js +1 -1
  159. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  160. package/views/2d/layers/features/support/BinStore.js +5 -0
  161. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  162. package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
  163. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  164. package/views/2d/layers/support/clusterUtils.js +1 -1
  165. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  166. package/views/2d/navigation/actions/Pinch.js +1 -1
  167. package/views/2d/viewpointUtils.js +1 -1
  168. package/views/3d/analysis/AnalysisView3D.js +1 -1
  169. package/views/3d/analysis/Dimensioning/DimensioningTool.js +5 -0
  170. package/views/3d/analysis/Dimensioning/DimensioningVisualization.js +1 -1
  171. package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +5 -0
  172. package/views/3d/analysis/Dimensioning/{LinearDimensionVisualization.js → LengthDimensionVisualization.js} +1 -1
  173. package/views/3d/analysis/Dimensioning/settings.js +5 -0
  174. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  175. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  176. package/views/3d/interactive/SegmentLabels3D.js +5 -0
  177. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  178. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  179. package/views/3d/interactive/editingTools/reshapeGraphic/GraphicReshapeTool.js +1 -1
  180. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  181. package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
  182. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateObjectSymbol3DAdapter.js +1 -1
  183. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  184. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  185. package/views/3d/layerViewModuleImportUtils.js +1 -1
  186. package/views/3d/layers/I3SMeshView3D.js +1 -1
  187. package/views/3d/layers/MediaLayerView3D.js +5 -0
  188. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  189. package/views/3d/layers/i3s/IDBCache.js +1 -1
  190. package/views/3d/state/controllers/RotateController.js +1 -1
  191. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  192. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  193. package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
  194. package/views/3d/support/ResourceController.js +1 -1
  195. package/views/3d/support/sunUtils.js +1 -1
  196. package/views/3d/terrain/TerrainRenderer.js +1 -1
  197. package/views/3d/terrain/TerrainSurface.js +1 -1
  198. package/views/3d/terrain/TileCompositor.js +1 -1
  199. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  200. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  201. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
  202. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  203. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  204. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  205. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  206. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  207. package/views/DOMContainer.js +1 -1
  208. package/views/GroundView.js +1 -1
  209. package/views/SceneView.js +1 -1
  210. package/views/ToolViewManager.js +1 -1
  211. package/views/View.js +1 -1
  212. package/views/draw/DrawOperation.js +1 -1
  213. package/views/draw/support/Reshape.js +1 -1
  214. package/views/interactive/GraphicManipulator.js +1 -1
  215. package/views/interactive/InteractiveToolBase.js +1 -1
  216. package/views/interactive/SegmentLabels.js +5 -0
  217. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  218. package/views/interactive/snapping/LineSnapper.js +1 -1
  219. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  220. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  221. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  222. package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
  223. package/views/interactive/snapping/SnappingManager.js +1 -1
  224. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  225. package/views/interactive/snapping/snappingUtils.js +1 -1
  226. package/views/interactive/support/viewUtils.js +5 -0
  227. package/views/interactive/tooltip/DrawPointTooltipInfo.js +5 -0
  228. package/views/interactive/tooltip/DrawPolygonTooltipInfo.js +5 -0
  229. package/views/interactive/tooltip/DrawPolylineTooltipInfo.js +5 -0
  230. package/views/interactive/tooltip/Tooltip.js +1 -1
  231. package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
  232. package/views/interactive/tooltip/support/measurements.js +5 -0
  233. package/views/layers/FeatureLayerView.js +1 -1
  234. package/views/layers/GroupLayerView.js +1 -1
  235. package/views/overlay/TextOverlayItem.js +1 -1
  236. package/views/support/Scheduler.js +1 -1
  237. package/views/support/screenUtils.js +1 -1
  238. package/webscene/Slide.js +1 -1
  239. package/widgets/Attribution/AttributionViewModel.js +1 -1
  240. package/widgets/Bookmarks.js +1 -1
  241. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  242. package/widgets/Editor/EditorViewModel.js +1 -1
  243. package/widgets/Editor/UpdateWorkflow.js +1 -1
  244. package/widgets/Editor/workflowUtils.js +1 -1
  245. package/widgets/Editor.js +1 -1
  246. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  247. package/widgets/ElevationProfile.js +1 -1
  248. package/widgets/Feature/FeatureAttachments.js +1 -1
  249. package/widgets/Feature/FeatureContent/FeatureContentViewModel.js +1 -1
  250. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  251. package/widgets/Feature/FeatureExpression.js +1 -1
  252. package/widgets/Feature/FeatureFields.js +1 -1
  253. package/widgets/Feature/FeatureViewModel.js +1 -1
  254. package/widgets/Feature.js +1 -1
  255. package/widgets/FeatureForm/InputFieldGroup.js +1 -1
  256. package/widgets/FeatureForm.js +1 -1
  257. package/widgets/FeatureTable/FieldColumn.js +1 -1
  258. package/widgets/FeatureTable/Grid/Column.js +1 -1
  259. package/widgets/FeatureTable/Grid/Grid.js +11 -11
  260. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  261. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  262. package/widgets/FeatureTemplates/TemplateItem.js +1 -1
  263. package/widgets/FeatureTemplates.js +1 -1
  264. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  265. package/widgets/FloorFilter.js +1 -1
  266. package/widgets/HistogramRangeSlider.js +1 -1
  267. package/widgets/LayerList/LayerListViewModel.js +1 -1
  268. package/widgets/LayerList/ListItem.js +1 -1
  269. package/widgets/LayerList/ListItemPanel.js +1 -1
  270. package/widgets/LayerList.js +1 -1
  271. package/widgets/Legend/LegendViewModel.js +1 -1
  272. package/widgets/Legend/styles/Card.js +1 -1
  273. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  274. package/widgets/Legend.js +1 -1
  275. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  276. package/widgets/Measurement.js +1 -1
  277. package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
  278. package/widgets/Popup/PopupViewModel.js +1 -1
  279. package/widgets/Popup.js +1 -1
  280. package/widgets/Print/FileLink.js +1 -1
  281. package/widgets/Print.js +1 -1
  282. package/widgets/ScaleBar.js +1 -1
  283. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  284. package/widgets/ScaleRangeSlider.js +1 -1
  285. package/widgets/Search/SearchViewModel.js +1 -1
  286. package/widgets/Search.js +1 -1
  287. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  288. package/widgets/Sketch/SketchViewModel.js +1 -1
  289. package/widgets/Sketch.js +1 -1
  290. package/widgets/TableList/ListItem.js +1 -1
  291. package/widgets/Weather/LabeledSlider.js +1 -1
  292. package/widgets/Weather/VisibleElements.js +5 -0
  293. package/widgets/Weather/css.js +1 -1
  294. package/widgets/Weather.js +1 -1
  295. package/widgets/support/AnalysisViewModel.js +1 -1
  296. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  297. package/analysis/LinearDimension.d.ts +0 -4
  298. package/analysis/LinearDimension.js +0 -5
  299. package/assets/esri/core/workers/chunks/0018053ac16a09feba70.js +0 -1
  300. package/assets/esri/core/workers/chunks/042938ca73f0b9e5a7e2.js +0 -1
  301. package/assets/esri/core/workers/chunks/048645611caa28dca7cd.js +0 -1
  302. package/assets/esri/core/workers/chunks/0b72d123386dc4ec7538.js +0 -1
  303. package/assets/esri/core/workers/chunks/13b04d5bf348ab5054c2.js +0 -1
  304. package/assets/esri/core/workers/chunks/215007e7c44811d90777.js +0 -1
  305. package/assets/esri/core/workers/chunks/31df729c17470245288c.js +0 -2
  306. package/assets/esri/core/workers/chunks/36272141b3c33cb19026.js +0 -1
  307. package/assets/esri/core/workers/chunks/36c8e8de9c3f67d32572.js +0 -1
  308. package/assets/esri/core/workers/chunks/37c428489c59df4b597b.js +0 -1
  309. package/assets/esri/core/workers/chunks/493169fd978fd543ef3b.js +0 -1
  310. package/assets/esri/core/workers/chunks/4f378ad6f4299183df85.js +0 -1
  311. package/assets/esri/core/workers/chunks/58e4c6ce1580427e7b55.js +0 -1
  312. package/assets/esri/core/workers/chunks/6c5441da675a8af35be2.js +0 -1
  313. package/assets/esri/core/workers/chunks/6ea16f6a0df946de480b.js +0 -1
  314. package/assets/esri/core/workers/chunks/7dfd70f4fa1096e56641.js +0 -1
  315. package/assets/esri/core/workers/chunks/88193e61072d7bf957f5.js +0 -1
  316. package/assets/esri/core/workers/chunks/8ccbde593c86c872e525.js +0 -1
  317. package/assets/esri/core/workers/chunks/9c6be39f1f21ab8b1c2d.js +0 -1
  318. package/assets/esri/core/workers/chunks/a73795cce722ba15b3da.js +0 -1
  319. package/assets/esri/core/workers/chunks/a8ed1a938dc164b401d9.js +0 -1
  320. package/assets/esri/core/workers/chunks/a9a73bc4875a5aeaf1b9.js +0 -1
  321. package/assets/esri/core/workers/chunks/adcc5bce6c0971c1b592.js +0 -1
  322. package/assets/esri/core/workers/chunks/afddfe620e6539991e6b.js +0 -1
  323. package/assets/esri/core/workers/chunks/b340c9bdabdb37995c8f.js +0 -1
  324. package/assets/esri/core/workers/chunks/b4c23630d6c85f7b59c0.js +0 -1
  325. package/assets/esri/core/workers/chunks/c180c40838246985479d.js +0 -1
  326. package/assets/esri/core/workers/chunks/caed2365bd296fcc8a75.js +0 -1
  327. package/assets/esri/core/workers/chunks/d85b5b73a151c6fbb658.js +0 -1
  328. package/assets/esri/core/workers/chunks/da6261673c3e1537b6a6.js +0 -1
  329. package/assets/esri/core/workers/chunks/dafe120243db6648a4ab.js +0 -1
  330. package/assets/esri/core/workers/chunks/ec6d138e8183e193f977.js +0 -1
  331. package/assets/esri/core/workers/chunks/ed4519ac9533a4d340f1.js +0 -1
  332. package/assets/esri/core/workers/chunks/f206300eef4560611728.js +0 -1
  333. package/assets/esri/core/workers/chunks/f55cbaf5a1d6ee6ac171.js +0 -1
  334. package/layers/GeoreferencedImageLayer.d.ts +0 -4
  335. package/layers/GeoreferencedImageLayer.js +0 -5
  336. package/layers/VoxelWasmManager.js +0 -5
  337. package/layers/VoxelWasmPerScene.js +0 -5
  338. package/views/3d/interactive/measurementTools/support/viewUtils.js +0 -5
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7340],{32078:(e,t,r)=>{r.d(t,{D:()=>q,b:()=>W});var i=r(70586),n=r(13598),o=r(1391),a=r(62707),s=r(18361),l=r(51546),c=r(77171),u=r(47624),d=r(64267),h=r(37099),f=r(76056),p=r(135),m=r(11317),g=r(15719),_=r(92555),v=r(22019),T=r(15817),x=r(66242),b=r(14482),A=r(83603),E=r(19419),S=r(26322),M=r(85504),R=r(51103),C=r(82550),w=r(96310),y=r(85787),O=r(93396),P=r(90692),N=r(93669),I=r(172),D=r(71250),L=r(21437),F=r(74709),B=r(8319),H=r(33680),U=r(98069),z=r(47026),G=r(35065),V=r(9749);function W(e){const t=new H.kG,r=t.vertex.code,W=t.fragment.code;t.include(O.a,{name:"Default Material Shader",output:e.output});const q=(0,N.S)(t,e);return t.include(h.f),t.varyings.add("vpos","vec3"),t.include(C.k,e),t.include(u.f,e),t.include(_.L,e),e.output!==s.H.Color&&e.output!==s.H.Alpha||((0,N.h)(t.vertex,e),t.include(d.O,e),t.include(c.w,{linearDepth:!1,hasModelTransformation:e.hasModelTransformation}),e.normalType===d.h.Attribute&&e.offsetBackfaces&&t.include(a.w),t.include(T.Q,e),t.include(g.Bb,e),e.instancedColor&&t.attributes.add(G.T.INSTANCECOLOR,"vec4"),t.varyings.add("localvpos","vec3"),t.include(p.D,e),t.include(o.q,e),t.include(f.R,e),t.include(m.c,e),t.vertex.uniforms.add(new D.N("externalColor",(e=>e.externalColor))),t.varyings.add("vcolorExt","vec4"),e.hasMultipassTerrain&&t.varyings.add("depth","float"),e.hasModelTransformation&&t.vertex.uniforms.add(new B.g("model",(e=>(0,i.pC)(e.modelTransformation)?e.modelTransformation:n.I))),r.add(F.H`
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[751],{32078:(e,t,r)=>{r.d(t,{D:()=>q,b:()=>W});var i=r(70586),n=r(13598),o=r(1391),a=r(62707),s=r(18361),l=r(51546),c=r(77171),u=r(47624),d=r(64267),h=r(37099),f=r(76056),p=r(135),m=r(11317),g=r(15719),_=r(92555),v=r(22019),T=r(15817),x=r(66242),b=r(14482),A=r(83603),E=r(19419),S=r(26322),M=r(85504),R=r(51103),C=r(82550),w=r(96310),y=r(85787),O=r(93396),P=r(90692),N=r(93669),I=r(172),D=r(71250),L=r(21437),F=r(74709),B=r(8319),H=r(33680),U=r(98069),z=r(47026),G=r(35065),V=r(9749);function W(e){const t=new H.kG,r=t.vertex.code,W=t.fragment.code;t.include(O.a,{name:"Default Material Shader",output:e.output});const q=(0,N.S)(t,e);return t.include(h.f),t.varyings.add("vpos","vec3"),t.include(C.k,e),t.include(u.f,e),t.include(_.L,e),e.output!==s.H.Color&&e.output!==s.H.Alpha||((0,N.h)(t.vertex,e),t.include(d.O,e),t.include(c.w,{linearDepth:!1,hasModelTransformation:e.hasModelTransformation}),e.normalType===d.h.Attribute&&e.offsetBackfaces&&t.include(a.w),t.include(T.Q,e),t.include(g.Bb,e),e.instancedColor&&t.attributes.add(G.T.INSTANCECOLOR,"vec4"),t.varyings.add("localvpos","vec3"),t.include(p.D,e),t.include(o.q,e),t.include(f.R,e),t.include(m.c,e),t.vertex.uniforms.add(new D.N("externalColor",(e=>e.externalColor))),t.varyings.add("vcolorExt","vec4"),e.hasMultipassTerrain&&t.varyings.add("depth","float"),e.hasModelTransformation&&t.vertex.uniforms.add(new B.g("model",(e=>(0,i.pC)(e.modelTransformation)?e.modelTransformation:n.I))),r.add(F.H`
2
2
  void main(void) {
3
3
  forwardNormalizedVertexColor();
4
4
  vcolorExt = externalColor;
@@ -156,7 +156,7 @@
156
156
  gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
157
157
  ${e.transparencyPassType===D.Am.Color?"gl_FragColor = premultiplyAlpha(gl_FragColor);":""}
158
158
  }
159
- `)),t.include(m.s,e),t}const H=Object.freeze(Object.defineProperty({__proto__:null,build:B},Symbol.toStringTag,{value:"Module"}))},21787:(e,t,r)=>{r.d(t,{a:()=>s,f:()=>n,i:()=>c,t:()=>o});var i=r(46851);function n(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function o(e,t){if(e===t){const r=t[1],i=t[2],n=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=n}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function a(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],f=r[1],p=r[2],m=r[3],g=r[4],_=r[5],v=r[6],T=r[7],x=r[8];return e[0]=h*i+f*a+p*c,e[1]=h*n+f*s+p*u,e[2]=h*o+f*l+p*d,e[3]=m*i+g*a+_*c,e[4]=m*n+g*s+_*u,e[5]=m*o+g*l+_*d,e[6]=v*i+T*a+x*c,e[7]=v*n+T*s+x*u,e[8]=v*o+T*l+x*d,e}function s(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15],v=r*s-i*a,T=r*l-n*a,x=r*c-o*a,b=i*l-n*s,A=i*c-o*s,E=n*c-o*l,S=u*m-d*p,M=u*g-h*p,R=u*_-f*p,C=d*g-h*m,w=d*_-f*m,y=h*_-f*g;let O=v*y-T*w+x*C+b*R-A*M+E*S;return O?(O=1/O,e[0]=(s*y-l*w+c*C)*O,e[1]=(l*R-a*y-c*M)*O,e[2]=(a*w-s*R+c*S)*O,e[3]=(n*w-i*y-o*C)*O,e[4]=(r*y-n*R+o*M)*O,e[5]=(i*R-r*w-o*S)*O,e[6]=(m*E-g*A+_*b)*O,e[7]=(g*x-p*E-_*T)*O,e[8]=(p*A-m*x+_*v)*O,e):null}function l(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function c(e){const t=i.E,r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8];return Math.abs(1-(r*r+a*a+c*c))<=t&&Math.abs(1-(n*n+s*s+u*u))<=t&&Math.abs(1-(o*o+l*l+d*d))<=t}const u=a,d=l;Object.freeze(Object.defineProperty({__proto__:null,fromMat4:n,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},set:function(e,t,r,i,n,o,a,s,l,c){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:o,invert:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=u*a-s*c,h=-u*o+s*l,f=c*o-a*l;let p=r*d+i*h+n*f;return p?(p=1/p,e[0]=d*p,e[1]=(-u*i+n*c)*p,e[2]=(s*i-n*a)*p,e[3]=h*p,e[4]=(u*r-n*l)*p,e[5]=(-s*r+n*o)*p,e[6]=f*p,e[7]=(-c*r+i*l)*p,e[8]=(a*r-i*o)*p,e):null},adjoint:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=a*u-s*c,e[1]=n*c-i*u,e[2]=i*s-n*a,e[3]=s*l-o*u,e[4]=r*u-n*l,e[5]=n*o-r*s,e[6]=o*c-a*l,e[7]=i*l-r*c,e[8]=r*a-i*o,e},determinant:function(e){const t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*(c*o-a*l)+r*(-c*n+a*s)+i*(l*n-o*s)},multiply:a,translate:function(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],f=r[1];return e[0]=i,e[1]=n,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=h*i+f*a+c,e[7]=h*n+f*s+u,e[8]=h*o+f*l+d,e},rotate:function(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=Math.sin(r),f=Math.cos(r);return e[0]=f*i+h*a,e[1]=f*n+h*s,e[2]=f*o+h*l,e[3]=f*a-h*i,e[4]=f*s-h*n,e[5]=f*l-h*o,e[6]=c,e[7]=u,e[8]=d,e},scale:function(e,t,r){const i=r[0],n=r[1],o=r[2];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e[6]=o*t[6],e[7]=o*t[7],e[8]=o*t[8],e},scaleByVec2:function(e,t,r){const i=r[0],n=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},fromRotation:function(e,t){const r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromQuat:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=r+r,s=i+i,l=n+n,c=r*a,u=i*a,d=i*s,h=n*a,f=n*s,p=n*l,m=o*a,g=o*s,_=o*l;return e[0]=1-d-p,e[3]=u-_,e[6]=h+g,e[1]=u+_,e[4]=1-c-p,e[7]=f-m,e[2]=h-g,e[5]=f+m,e[8]=1-c-d,e},normalFromMat4Legacy:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[4],a=t[5],s=t[6],l=t[8],c=t[9],u=t[10],d=u*a-s*c,h=-u*o+s*l,f=c*o-a*l,p=r*d+i*h+n*f;if(!p)return null;const m=1/p;return e[0]=d*m,e[1]=(-u*i+n*c)*m,e[2]=(s*i-n*a)*m,e[3]=h*m,e[4]=(u*r-n*l)*m,e[5]=(-s*r+n*o)*m,e[6]=f*m,e[7]=(-c*r+i*l)*m,e[8]=(a*r-i*o)*m,e},normalFromMat4:s,projection:function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},subtract:l,multiplyScalar:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},multiplyScalarAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},equals:function(e,t){const r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=t[0],f=t[1],p=t[2],m=t[3],g=t[4],_=t[5],v=t[6],T=t[7],x=t[8];return Math.abs(r-h)<=i.E*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-f)<=i.E*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(o-p)<=i.E*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=i.E*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(s-g)<=i.E*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-_)<=i.E*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(c-v)<=i.E*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(u-T)<=i.E*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(d-x)<=i.E*Math.max(1,Math.abs(d),Math.abs(x))},isOrthoNormal:c,mul:u,sub:d},Symbol.toStringTag,{value:"Module"}))},46521:(e,t,r)=>{function i(){return[1,0,0,0,1,0,0,0,1]}function n(e,t){return new Float64Array(e,t,9)}r.d(t,{a:()=>n,c:()=>i}),Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},fromValues:function(e,t,r,i,n,o,a,s,l){return[e,t,r,i,n,o,a,s,l]},createView:n},Symbol.toStringTag,{value:"Module"}))},13598:(e,t,r)=>{function i(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function n(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}function o(e,t){return new Float64Array(e,t,16)}r.d(t,{I:()=>a,a:()=>o,b:()=>n,c:()=>i});const a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:n,fromValues:function(e,t,r,i,n,o,a,s,l,c,u,d,h,f,p,m){return[e,t,r,i,n,o,a,s,l,c,u,d,h,f,p,m]},createView:o,IDENTITY:a},Symbol.toStringTag,{value:"Module"}))},51305:(e,t,r)=>{r.d(t,{c:()=>f,g:()=>u,j:()=>w,k:()=>m,m:()=>d,s:()=>c});var i=r(46521),n=r(94961),o=r(65617),a=r(46851),s=r(17896),l=r(98766);function c(e,t,r){r*=.5;const i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function u(e,t){const r=2*Math.acos(t[3]),i=Math.sin(r/2);return i>a.E?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r}function d(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+a*s+n*c-o*l,e[1]=n*u+a*l+o*s-i*c,e[2]=o*u+a*c+i*l-n*s,e[3]=a*u-i*s-n*l-o*c,e}function h(e,t,r,i){const n=t[0],o=t[1],s=t[2],l=t[3];let c,u,d,h,f,p=r[0],m=r[1],g=r[2],_=r[3];return u=n*p+o*m+s*g+l*_,u<0&&(u=-u,p=-p,m=-m,g=-g,_=-_),1-u>a.E?(c=Math.acos(u),d=Math.sin(c),h=Math.sin((1-i)*c)/d,f=Math.sin(i*c)/d):(h=1-i,f=i),e[0]=h*n+f*p,e[1]=h*o+f*m,e[2]=h*s+f*g,e[3]=h*l+f*_,e}function f(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function p(e,t){const r=t[0]+t[4]+t[8];let i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const n=(r+1)%3,o=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*n+n]-t[3*o+o]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*n+o]-t[3*o+n])*i,e[n]=(t[3*n+r]+t[3*r+n])*i,e[o]=(t[3*o+r]+t[3*r+o])*i}return e}function m(e,t,r,i){const n=.5*Math.PI/180;t*=n,r*=n,i*=n;const o=Math.sin(t),a=Math.cos(t),s=Math.sin(r),l=Math.cos(r),c=Math.sin(i),u=Math.cos(i);return e[0]=o*l*u-a*s*c,e[1]=a*s*u+o*l*c,e[2]=a*l*c-o*s*u,e[3]=a*l*u+o*s*c,e}const g=l.c,_=l.s,v=l.a,T=d,x=l.b,b=l.d,A=l.l,E=l.e,S=E,M=l.f,R=M,C=l.n,w=l.g,y=l.h,O=(0,o.c)(),P=(0,o.f)(1,0,0),N=(0,o.f)(0,1,0),I=(0,n.a)(),D=(0,n.a)(),L=(0,i.c)();Object.freeze(Object.defineProperty({__proto__:null,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},setAxisAngle:c,getAxisAngle:u,multiply:d,rotateX:function(e,t,r){r*=.5;const i=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+a*s,e[1]=n*l+o*s,e[2]=o*l-n*s,e[3]=a*l-i*s,e},rotateY:function(e,t,r){r*=.5;const i=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l-o*s,e[1]=n*l+a*s,e[2]=o*l+i*s,e[3]=a*l-n*s,e},rotateZ:function(e,t,r){r*=.5;const i=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+n*s,e[1]=n*l-i*s,e[2]=o*l+a*s,e[3]=a*l-o*s,e},calculateW:function(e,t){const r=t[0],i=t[1],n=t[2];return e[0]=r,e[1]=i,e[2]=n,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),e},slerp:h,random:function(e){const t=(0,a.R)(),r=(0,a.R)(),i=(0,a.R)(),n=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=n*Math.sin(2*Math.PI*r),e[1]=n*Math.cos(2*Math.PI*r),e[2]=o*Math.sin(2*Math.PI*i),e[3]=o*Math.cos(2*Math.PI*i),e},invert:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=r*r+i*i+n*n+o*o,s=a?1/a:0;return e[0]=-r*s,e[1]=-i*s,e[2]=-n*s,e[3]=o*s,e},conjugate:f,fromMat3:p,fromEuler:m,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},copy:g,set:_,add:v,mul:T,scale:x,dot:b,lerp:A,length:E,len:S,squaredLength:M,sqrLen:R,normalize:C,exactEquals:w,equals:y,rotationTo:function(e,t,r){const i=(0,s.e)(t,r);return i<-.999999?((0,s.f)(O,P,t),(0,s.u)(O)<1e-6&&(0,s.f)(O,N,t),(0,s.n)(O,O),c(e,O,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,s.f)(O,t,r),e[0]=O[0],e[1]=O[1],e[2]=O[2],e[3]=1+i,C(e,e))},sqlerp:function(e,t,r,i,n,o){return h(I,t,n,o),h(D,r,i,o),h(e,I,D,2*o*(1-o)),e},setAxes:function(e,t,r,i){const n=L;return n[0]=r[0],n[3]=r[1],n[6]=r[2],n[1]=i[0],n[4]=i[1],n[7]=i[2],n[2]=-t[0],n[5]=-t[1],n[8]=-t[2],C(e,p(e,n))}},Symbol.toStringTag,{value:"Module"}))},94961:(e,t,r)=>{function i(){return[0,0,0,1]}function n(e){return[e[0],e[1],e[2],e[3]]}function o(e,t){return new Float64Array(e,t,4)}r.d(t,{I:()=>a,a:()=>i,b:()=>n,c:()=>o});const a=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:n,fromValues:function(e,t,r,i){return[e,t,r,i]},createView:o,IDENTITY:a},Symbol.toStringTag,{value:"Module"}))},2643:(e,t,r)=>{r.d(t,{b:()=>_,c:()=>g,d:()=>v,g:()=>T,i:()=>A,m:()=>y}),r(80442);var i,n,o=r(92604),a=r(22021),s=r(70586),l=r(52138),c=r(17896),u=r(65617),d=r(98766),h=r(88669);(n=i||(i={}))[n.X=0]="X",n[n.Y=1]="Y",n[n.Z=2]="Z";var f=r(78341);(0,u.c)(),(0,u.c)();var p=r(12981);const m=o.Z.getLogger("esri.geometry.support.sphere");function g(){return(0,h.c)()}function _(e,t=g()){return(0,d.c)(t,e)}function v(e){return e[3]}function T(e){return e}function x(e,t,r){if((0,s.Wi)(t))return!1;const{origin:i,direction:n}=t,o=b;o[0]=i[0]-e[0],o[1]=i[1]-e[1],o[2]=i[2]-e[2];const a=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],l=2*(n[0]*o[0]+n[1]*o[1]+n[2]*o[2]),c=l*l-4*a*(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]-e[3]*e[3]);if(c<0)return!1;const u=Math.sqrt(c);let d=(-l-u)/(2*a);const h=(-l+u)/(2*a);return(d<0||h<d&&h>0)&&(d=h),!(d<0||(r&&(r[0]=i[0]+n[0]*d,r[1]=i[1]+n[1]*d,r[2]=i[2]+n[2]*d),0))}const b=(0,u.c)();function A(e,t){return x(e,t,null)}function E(e,t,r){const i=p.WM.get(),n=p.MP.get();(0,c.f)(i,t.origin,t.direction);const o=v(e);(0,c.f)(r,i,t.origin),(0,c.g)(r,r,1/(0,c.l)(r)*o);const s=M(e,t.origin),u=function(e,t){const r=(0,c.e)(e,t)/((0,c.l)(e)*(0,c.l)(t));return-(0,a.ZF)(r)}(t.origin,r);return(0,l.d)(n,u+s,i),(0,c.m)(r,r,n),r}function S(e,t,r){const i=(0,c.b)(p.WM.get(),t,e),n=(0,c.g)(p.WM.get(),i,e[3]/(0,c.l)(i));return(0,c.a)(r,n,e)}function M(e,t){const r=(0,c.b)(p.WM.get(),t,e),i=(0,c.l)(r),n=v(e),o=n+Math.abs(n-i);return(0,a.ZF)(n/o)}const R=(0,u.c)();function C(e,t,r,n){const o=(0,c.b)(R,t,e);switch(r){case i.X:{const e=(0,a.jE)(o,R)[2];return(0,c.s)(n,-Math.sin(e),Math.cos(e),0)}case i.Y:{const e=(0,a.jE)(o,R),t=e[1],r=e[2],i=Math.sin(t);return(0,c.s)(n,-i*Math.cos(r),-i*Math.sin(r),Math.cos(t))}case i.Z:return(0,c.n)(n,o);default:return}}function w(e,t){const r=(0,c.b)(O,t,e);return(0,c.l)(r)-e[3]}function y(e,t){const r=(0,c.d)(e,t),i=v(e);return r<=i*i}const O=(0,u.c)(),P=g();Object.freeze(Object.defineProperty({__proto__:null,create:g,copy:_,fromCenterAndRadius:function(e,t){return(0,h.f)(e[0],e[1],e[2],t)},wrap:function(e){return e},clear:function(e){e[0]=e[1]=e[2]=e[3]=0},fromRadius:function(e,t){return e[0]=e[1]=e[2]=0,e[3]=t,e},getRadius:v,getCenter:T,fromValues:function(e,t,r,i){return(0,h.f)(e,t,r,i)},elevate:function(e,t,r){return e!==r&&(0,c.c)(r,e),r[3]=e[3]+t,r},setExtent:function(e,t,r){return m.error("sphere.setExtent is not yet supported"),e===r?r:_(e,r)},intersectRay:x,intersectsRay:A,intersectRayClosestSilhouette:function(e,t,r){if(x(e,t,r))return r;const i=E(e,t,p.WM.get());return(0,c.a)(r,t.origin,(0,c.g)(p.WM.get(),t.direction,(0,c.i)(t.origin,i)/(0,c.l)(t.direction))),r},closestPointOnSilhouette:E,closestPoint:function(e,t,r){return x(e,t,r)?r:((0,f.JI)(t,e,r),S(e,r,r))},projectPoint:S,distanceToSilhouette:function(e,t){const r=(0,c.b)(p.WM.get(),t,e),i=(0,c.p)(r),n=e[3]*e[3];return Math.sqrt(Math.abs(i-n))},angleToSilhouette:M,axisAt:C,altitudeAt:w,setAltitudeAt:function(e,t,r,n){const o=w(e,t),a=C(e,t,i.Z,O),s=(0,c.g)(O,a,r-o);return(0,c.a)(n,t,s)},containsPoint:y,tmpSphere:P},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>o,b:()=>l,n:()=>s,s:()=>a,t:()=>n});var i=r(72220);function n(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const n=e.count,o=r[0],a=r[1],s=r[2],l=r[4],c=r[5],u=r[6],d=r[8],h=r[9],f=r[10],p=r[12],m=r[13],g=r[14],_=e.typedBuffer,v=e.typedBufferStride,T=t.typedBuffer,x=t.typedBufferStride;for(let e=0;e<n;e++){const t=e*v,r=e*x,i=T[r],n=T[r+1],b=T[r+2];_[t]=o*i+l*n+d*b+p,_[t+1]=a*i+c*n+h*b+m,_[t+2]=s*i+u*n+f*b+g}}function o(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const n=e.count,o=r[0],a=r[1],s=r[2],l=r[3],c=r[4],u=r[5],d=r[6],h=r[7],f=r[8],p=e.typedBuffer,m=e.typedBufferStride,g=t.typedBuffer,_=t.typedBufferStride;for(let e=0;e<n;e++){const t=e*m,r=e*_,i=g[r],n=g[r+1],v=g[r+2];p[t]=o*i+l*n+d*v,p[t+1]=a*i+c*n+h*v,p[t+2]=s*i+u*n+f*v}}function a(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*o,i=e*s;n[t]=r*a[i],n[t+1]=r*a[i+1],n[t+2]=r*a[i+2]}}function s(e,t){const r=Math.min(e.count,t.count),i=e.typedBuffer,n=e.typedBufferStride,o=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*n,r=e*a,s=o[r],l=o[r+1],c=o[r+2],u=s*s+l*l+c*c;if(u>0){const e=1/Math.sqrt(u);i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function l(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*o,i=e*s;n[t]=a[i]>>r,n[t+1]=a[i+1]>>r,n[t+2]=a[i+2]>>r}}Object.freeze(Object.defineProperty({__proto__:null,transformMat4:n,transformMat3:o,scale:a,normalize:s,shiftRight:l},Symbol.toStringTag,{value:"Module"}))},56067:(e,t,r)=>{function i(e,t,r){const i=e.typedBuffer,n=e.typedBufferStride,o=t.typedBuffer,a=t.typedBufferStride,s=r?r.count:t.count;let l=(r&&r.dstIndex?r.dstIndex:0)*n,c=(r&&r.srcIndex?r.srcIndex:0)*a;for(let e=0;e<s;++e)i[l]=o[c],i[l+1]=o[c+1],i[l+2]=o[c+2],l+=n,c+=a}function n(e,t,r,i,n){const o=e.typedBuffer,a=e.typedBufferStride,s=n?.count??e.count;let l=(n?.dstIndex??0)*a;for(let e=0;e<s;++e)o[l]=t,o[l+1]=r,o[l+2]=i,l+=a}r.d(t,{c:()=>i,f:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,copy:i,fill:n},Symbol.toStringTag,{value:"Module"}))},72119:(e,t,r)=>{function i(){return new Float32Array(3)}function n(e,t,r){const i=new Float32Array(3);return i[0]=e,i[1]=t,i[2]=r,i}function o(){return i()}function a(){return n(1,1,1)}function s(){return n(1,0,0)}function l(){return n(0,1,0)}function c(){return n(0,0,1)}r.d(t,{c:()=>i,f:()=>n});const u=o(),d=a(),h=s(),f=l(),p=c();Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:n,createView:function(e,t){return new Float32Array(e,t,3)},zeros:o,ones:a,unitX:s,unitY:l,unitZ:c,ZEROS:u,ONES:d,UNIT_X:h,UNIT_Y:f,UNIT_Z:p},Symbol.toStringTag,{value:"Module"}))},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function n(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(o)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>n});const o=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,o,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},78341:(e,t,r)=>{r.d(t,{JI:()=>l,Ue:()=>a,re:()=>s}),r(67676);var i=r(22807),n=r(17896),o=r(65617);function a(e){return e?{origin:(0,o.a)(e.origin),direction:(0,o.a)(e.direction)}:{origin:(0,o.c)(),direction:(0,o.c)()}}function s(e,t){const r=c.get();return r.origin=e,r.direction=t,r}function l(e,t,r){const i=(0,n.e)(e.direction,(0,n.b)(r,t,e.origin));return(0,n.a)(r,e.origin,(0,n.g)(r,e.direction,i)),r}r(12981);const c=new i.x((function(){return{origin:null,direction:null}}))},87340:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>Lr,gltfToEngineResources:()=>Br,parseUrl:()=>Fr});var i=r(32243),n=r(70586),o=r(21787),a=r(46521),s=r(52138),l=r(13598),c=r(17896),u=r(65617),d=r(60437),h=r(56481),f=r(20773),p=r(11077),m=r(8323),g=r(40270),_=r(88246),v=r(91911),T=r(3172),x=r(66643),b=r(20102),A=r(92604),E=r(95330),S=r(23670);async function M(e,t){const{data:r}=await(0,T.default)(e,{responseType:"image",...t});return r}var R=r(47026),C=r(44553),w=r(11726);class y{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this.center=(0,u.c)(),(0,w.hu)(e.length>=1),(0,w.hu)(r.length%this._numIndexPerPrimitive==0),(0,w.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,w.hu)(3===i.size||4===i.size);const{data:n,size:o}=i,a=e.length;let s=o*r[this._numIndexPerPrimitive*e[0]];O.clear(),O.push(s),this.bbMin=(0,u.f)(n[s],n[s+1],n[s+2]),this.bbMax=(0,u.a)(this.bbMin);for(let t=0;t<a;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=o*r[i+e],O.push(s);let t=n[s];this.bbMin[0]=Math.min(t,this.bbMin[0]),this.bbMax[0]=Math.max(t,this.bbMax[0]),t=n[s+1],this.bbMin[1]=Math.min(t,this.bbMin[1]),this.bbMax[1]=Math.max(t,this.bbMax[1]),t=n[s+2],this.bbMin[2]=Math.min(t,this.bbMin[2]),this.bbMax[2]=Math.max(t,this.bbMax[2])}}(0,c.h)(this.center,this.bbMin,this.bbMax,.5),this.radius=.5*Math.max(Math.max(this.bbMax[0]-this.bbMin[0],this.bbMax[1]-this.bbMin[1]),this.bbMax[2]-this.bbMin[2]);let l=this.radius*this.radius;for(let e=0;e<O.length;++e){s=O.getItemAt(e);const t=n[s]-this.center[0],r=n[s+1]-this.center[1],i=n[s+2]-this.center[2],o=t*t+r*r+i*i;if(o<=l)continue;const a=Math.sqrt(o),c=.5*(a-this.radius);this.radius=this.radius+c,l=this.radius*this.radius;const u=c/a;this.center[0]+=t*u,this.center[1]+=r*u,this.center[2]+=i*u}O.clear()}getCenter(){return this.center}getBSRadius(){return this.radius}getBBMin(){return this.bbMin}getBBMax(){return this.bbMax}getChildren(){if(this._children)return this._children;if((0,c.d)(this.bbMin,this.bbMax)>1){const e=(0,c.h)((0,u.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:n,size:o}=this.position;for(let a=0;a<t;++a){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=o*this.indices[s],c=n[l],u=n[l+1],d=n[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=o*this.indices[s+e];const t=n[l],r=n[l+1],i=n[l+2];t<c&&(c=t),r<u&&(u=r),i<d&&(d=i)}c<e[0]&&(t|=1),u<e[1]&&(t|=2),d<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array(8);for(let e=0;e<8;++e)void 0!==s[e]&&(this._children[e]=new y(s[e],this._numIndexPerPrimitive,this.indices,this.position))}return this._children}static prune(){O.prune()}}const O=new C.Z({deallocator:null});var P=r(17662),N=r(4726),I=r(17753),D=r(35065);class L extends P.c{constructor(e,t=[],r=R.MX.Triangle,i=-1){super(),this._primitiveType=r,this.edgeIndicesLength=i,this.type=N.U.Geometry,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[t,r]of e)r&&this._vertexAttributes.set(t,{...r});if(null==t||0===t.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,I.p)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,r]of t)r&&(this._indices.set(e,F(r)),e===D.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}cloneShallow(){const e=new L([],void 0,this._primitiveType,void 0),{_vertexAttributes:t,_indices:r}=e;return this._vertexAttributes.forEach(((e,r)=>{t.set(r,e)})),this._indices.forEach(((e,t)=>{r.set(t,e)})),e.screenToWorldRatio=this.screenToWorldRatio,e._boundingInfo=this._boundingInfo,e}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){const t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t.data=Array.from(t.data),t.exclusive=!0),t}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get primitiveType(){return this._primitiveType}get faceCount(){return this.indexCount/3}get boundingInfo(){return(0,n.Wi)(this._boundingInfo)&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return this.primitiveType===R.MX.Triangle?this._computeAttachmentOriginTriangles(e):this._computeAttachmentOriginPoints(e)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(D.T.POSITION),r=this.vertexAttributes.get(D.T.POSITION);return(0,I.cM)(r,t,e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(D.T.POSITION),r=this.vertexAttributes.get(D.T.POSITION);return(0,I.NO)(r,t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(D.T.POSITION);if(0===e.length)return null;const t=this.primitiveType===R.MX.Triangle?3:1;(0,w.hu)(e.length%t==0,"Indexing error: "+e.length+" not divisible by "+t);const r=(0,I.p)(e.length/t),i=this.vertexAttributes.get(D.T.POSITION);return new y(r,t,e,i)}}function F(e){if(e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT)return e;for(const t of e)if(t>=65536)return e;return new Uint16Array(e)}var B=r(74085),H=r(32448),U=r(22021),z=r(1533),G=r(17452),V=r(85958),W=r(99880);let q;var k;!function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"}(k||(k={}));var $=r(35371),X=r(75656);function j(e,t,r,i,n=0){const o=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);void 0===r&&console.error(`There is no location for vertex attribute '${e.name}' defined.`);const i=n*e.stride;if(e.count<=4)o.vertexAttribPointer(r,e.count,e.type,e.normalized,e.stride,e.offset+i),o.enableVertexAttribArray(r),e.divisor>0&&a&&a.vertexAttribDivisor(r,e.divisor);else if(9===e.count)for(let t=0;t<3;t++)o.vertexAttribPointer(r+t,3,e.type,e.normalized,e.stride,e.offset+12*t+i),o.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else if(16===e.count)for(let t=0;t<4;t++)o.vertexAttribPointer(r+t,4,e.type,e.normalized,e.stride,e.offset+16*t+i),o.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else console.error("Unsupported vertex attribute element count: "+e.count)}}function J(e,t,r,i){const n=e.gl,o=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);if(e.count<=4)n.disableVertexAttribArray(r),e.divisor&&e.divisor>0&&o&&o.vertexAttribDivisor(r,0);else if(9===e.count)for(let t=0;t<3;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&o&&o.vertexAttribDivisor(r+t,0);else if(16===e.count)for(let t=0;t<4;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&o&&o.vertexAttribDivisor(r+t,0);else console.error("Unsupported vertex attribute element count: "+e.count)}e.unbindBuffer($.w0.ARRAY_BUFFER)}function Y(e){switch(e){case $.VI.ALPHA:case $.VI.LUMINANCE:case $.VI.RED:case $.VI.RED_INTEGER:case $.lP.R8:case $.lP.R8I:case $.lP.R8UI:case $.lP.R8_SNORM:case $.Tg.STENCIL_INDEX8:return 1;case $.VI.LUMINANCE_ALPHA:case $.VI.RG:case $.VI.RG_INTEGER:case $.lP.RGBA4:case $.lP.R16F:case $.lP.R16I:case $.lP.R16UI:case $.lP.RG8:case $.lP.RG8I:case $.lP.RG8UI:case $.lP.RG8_SNORM:case $.lP.RGB565:case $.lP.RGB5_A1:case $.Tg.DEPTH_COMPONENT16:return 2;case $.VI.DEPTH_COMPONENT:case $.VI.RGB:case $.VI.RGB_INTEGER:case $.lP.RGB8:case $.lP.RGB8I:case $.lP.RGB8UI:case $.lP.RGB8_SNORM:case $.lP.SRGB8:case $.Tg.DEPTH_COMPONENT24:return 3;case $.VI.DEPTH_STENCIL:case $.VI.RGBA:case $.VI.RGBA_INTEGER:case $.lP.RGBA8:case $.lP.R32F:case $.lP.R11F_G11F_B10F:case $.lP.RG16F:case $.lP.R32I:case $.lP.R32UI:case $.lP.RG16I:case $.lP.RG16UI:case $.lP.RGBA8I:case $.lP.RGBA8UI:case $.lP.RGBA8_SNORM:case $.lP.SRGB8_ALPHA8:case $.lP.RGB9_E5:case $.lP.RGB10_A2UI:case $.lP.RGB10_A2:case $.Tg.DEPTH_STENCIL:case $.Tg.DEPTH_COMPONENT32F:case $.Tg.DEPTH24_STENCIL8:return 4;case $.Tg.DEPTH32F_STENCIL8:return 5;case $.lP.RGB16F:case $.lP.RGB16I:case $.lP.RGB16UI:return 6;case $.lP.RG32F:case $.lP.RG32I:case $.lP.RG32UI:case $.lP.RGBA16F:case $.lP.RGBA16I:case $.lP.RGBA16UI:return 8;case $.lP.RGB32F:case $.lP.RGB32I:case $.lP.RGB32UI:return 12;case $.lP.RGBA32F:case $.lP.RGBA32I:case $.lP.RGBA32UI:return 16;case $.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case $.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case $.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case $.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case $.q_.COMPRESSED_R11_EAC:case $.q_.COMPRESSED_SIGNED_R11_EAC:case $.q_.COMPRESSED_RGB8_ETC2:case $.q_.COMPRESSED_SRGB8_ETC2:case $.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case $.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case $.q_.COMPRESSED_RG11_EAC:case $.q_.COMPRESSED_SIGNED_RG11_EAC:case $.q_.COMPRESSED_RGBA8_ETC2_EAC:case $.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function Z(e){if((0,n.Wi)(e))return 0;if("descriptor"in e)return e.glName?Z(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return Y(t)*i*r}r(80442);let K=null,Q=null;async function ee(){return(0,n.Wi)(Q)&&(Q=function(){if((0,n.Wi)(q)){const e=e=>(0,W.V)(`esri/libs/basisu/${e}`);q=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return q}(),K=await Q),Q}function te(e,t,r,i,n){const o=Y(t?$.q_.COMPRESSED_RGBA8_ETC2_EAC:$.q_.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function re(e){return e.getNumImages()>=1&&!e.isUASTC()}function ie(e){return e.getFaces()>=1&&e.isETC1S()}function ne(e,t,r,i,n,o,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,d]=l?i?[k.ETC2_RGBA,$.q_.COMPRESSED_RGBA8_ETC2_EAC]:[k.ETC1_RGB,$.q_.COMPRESSED_RGB8_ETC2]:c?i?[k.BC3_RGBA,$.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[k.BC1_RGB,$.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[k.RGBA32,$.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(a(e,u))),s(e,u,f[e]);const p=f.length>1,m=p?$.cw.LINEAR_MIPMAP_LINEAR:$.cw.LINEAR,g={...t,samplingMode:m,hasMipmap:p,internalFormat:d,width:n,height:o};return new X.x(e,g,{type:"compressed",levels:f})}const oe=A.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function ae(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const se=ae("DXT1"),le=ae("DXT3"),ce=ae("DXT5");var ue=r(83475),de=r(21968);new de.G(D.T.POSITION,3,$.g.FLOAT,0,12),new de.G(D.T.POSITION,3,$.g.FLOAT,0,20),new de.G(D.T.UV0,2,$.g.FLOAT,12,20),new de.G(D.T.POSITION,3,$.g.FLOAT,0,32),new de.G(D.T.NORMAL,3,$.g.FLOAT,12,32),new de.G(D.T.UV0,2,$.g.FLOAT,24,32),new de.G(D.T.POSITION,3,$.g.FLOAT,0,16),new de.G(D.T.COLOR,4,$.g.UNSIGNED_BYTE,12,16);const he=[new de.G(D.T.POSITION,2,$.g.FLOAT,0,8)],fe=[new de.G(D.T.POSITION,2,$.g.FLOAT,0,16),new de.G(D.T.UV0,2,$.g.FLOAT,8,16)];var pe=r(67676),me=r(49300),ge=r(54738);const _e=A.Z.getLogger("esri.views.webgl.BufferObject");class ve{constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment($._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,me.zu)(this._context.gl),i&&this.setData(i)}static createIndex(e,t,r){return new ve(e,$.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new ve(e,$.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==ge.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new ve(e,$.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=$.l1.STREAM_READ,r){if(e.type!==ge.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new ve(e,$.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=$.l1.STREAM_DRAW,r){if(e.type!==ge.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new ve(e,$.w0.PIXEL_UNPACK_BUFFER,t,r)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===$.w0.ELEMENT_ARRAY_BUFFER?this._indexType===$.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===$.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===$.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement($._g.BufferObject,this),this._context=null):this._glName&&_e.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&_e.error("Buffer size needs to be positive!"),this.bufferType===$.w0.ELEMENT_ARRAY_BUFFER&&(0,n.pC)(t))switch(this._indexType=t,t){case $.g.UNSIGNED_SHORT:e*=2;break;case $.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===$.w0.ELEMENT_ARRAY_BUFFER&&((0,z.Uc)(e)&&(t/=2,this._indexType=$.g.UNSIGNED_SHORT),(0,z.ZY)(e)&&(t/=4,this._indexType=$.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;(0,n.pC)(t)?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,me.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t=0,r=0,i=e.byteLength){if(!e)return;(t<0||t>=this._size)&&_e.error("offset is out of range!");let n=t,o=r,a=i,s=e.byteLength;this.bufferType===$.w0.ELEMENT_ARRAY_BUFFER&&((0,z.Uc)(e)?(s/=2,n*=2,o*=2,a*=2):(0,z.ZY)(e)&&(s/=4,n*=4,o*=4,a*=4)),void 0===i&&(i=s-1),r>=i&&_e.error("end must be bigger than start!"),t+r-i>this._size&&_e.error("An attempt to write beyond the end of the buffer!");const l=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const c=this._context.gl,u=ArrayBuffer.isView(e)?e.buffer:e,d=0===o&&a===e.byteLength?u:u.slice(o,a);c.bufferSubData(this.bufferType,n,d),(0,me.zu)(c),this._isVAOAware&&this._context.bindVAO(l)}setSubDataFromView(e,t,r,i){if(!e)return;(t<0||t>=this._size)&&_e.error("offset is out of range!"),r>=i&&_e.error("end must be bigger than start!"),t+r-i>this._size&&_e.error("An attempt to write beyond the end of the buffer!");const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const o=this._context.gl;if(this._context.type===ge.zO.WEBGL2)o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const n=0===r&&i===e.length?e:e.subarray(r,i);o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,n)}(0,me.zu)(o),this._isVAOAware&&this._context.bindVAO(n)}getSubData(e,t=0,r,i){if(this._context.type!==ge.zO.WEBGL2)return void _e.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void _e.error("Problem getting subdata: offset and length were less than zero!");const n=function(e){return(0,pe.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(n*((r??0)+(i??0))>e.byteLength)return void _e.error("Problem getting subdata: offset and length exceeded destination size!");t+n*(i??0)>this.byteSize&&_e.warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;this._context.bindBuffer(this,$.w0.COPY_READ_BUFFER),o.getBufferSubData($.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer($.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===ge.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):_e.error("Get buffer subdata is supported in WebGL2 only!")}}const Te=A.Z.getLogger("esri.views.webgl.VertexArrayObject");class xe{constructor(e,t,r,i,n=null){this._context=e,this._locations=t,this._layout=r,this._buffers=i,this._indexBuffer=n,this._glName=null,this._initialized=!1,e.instanceCounter.increment($._g.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((e,t)=>e+this._buffers[t].size),(0,n.pC)(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(this._context){if(this._glName){const e=this._context?.capabilities?.vao;e?(e.deleteVertexArray(this._glName),this._glName=null):Te.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const e in this._buffers)this._buffers[e].dispose(),delete this._buffers[e];this._indexBuffer=(0,n.O3)(this._indexBuffer)}this._context.instanceCounter.decrement($._g.VertexArrayObject,this),this._context=null}else(this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&Te.warn("Leaked WebGL VAO")}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||Te.error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const r in e){const i=e[r];i||Te.error("Vertex buffer is uninitialized!");const n=t[r];n||Te.error("Vertex element descriptor is empty!"),j(this._context,this._locations,i,n)}(0,n.pC)(r)&&(this._context.capabilities.vao?i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:t}=this;e||Te.error("Vertex buffer dictionary is empty!");for(const r in e){const i=e[r];i||Te.error("Vertex buffer is uninitialized!");const n=t[r];J(this._context,this._locations,i,n)}(0,n.pC)(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}class be{constructor(e,t){this._context=e,this._desc=t,this.type="renderbuffer",this._context.instanceCounter.increment($._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:n,internalFormat:o,multisampled:a}=t;if(a){if(this._context.type!==ge.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,i,n)}else r.renderbufferStorage(r.RENDERBUFFER,o,i,n)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}resize(e,t){const r=this._desc;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement($._g.Renderbuffer,this),this._context=null)}}const Ae=A.Z.getLogger("esri.views.webgl.FrameBufferObject");class Ee{constructor(e,t,r=null,i=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._initialized=!1,this._desc={...t},e.instanceCounter.increment($._g.FramebufferObject,this),(0,n.pC)(r)){Array.isArray(r)||(r=[r]);for(let e=0;e<r.length;++e){const t=r[e],i=$.VY.COLOR_ATTACHMENT0+e;let n;Re(t)?(Se(t)?(n=t.descriptor,this._colorAttachments.set(i,t)):(n=t,this._colorAttachments.set(i,new X.x(this._context,n))),Ce(n,this._desc)):(Me(t)?(n=t.descriptor,this._colorAttachments.set(i,t)):(n=t,this._colorAttachments.set(i,new be(this._context,n))),we(n,this._desc)),this._validateColorAttachmentPoint(i)}}if((0,n.pC)(i)){let e,t;if(Re(i))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),Se(i)?(t=i.descriptor,this._depthStencilTexture=i):(t=i,this._depthStencilTexture=new X.x(this._context,t)),Ce(t,this._desc);else{Me(i)?(t=i.descriptor,e=i):(t=i,e=new be(this._context,t));const r=this._desc.depthStencilTarget??$.OU.DEPTH_STENCIL_RENDER_BUFFER;r===$.OU.STENCIL_RENDER_BUFFER?this._stencilAttachment=e:r===$.OU.DEPTH_RENDER_BUFFER||r===$.OU.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=e:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),we(t,this._desc)}}}dispose(){if(!this._desc)return;const e=this._context.getBoundFramebufferObject();this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement($._g.FramebufferObject,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const e=this._colorAttachments.get($.VY.COLOR_ATTACHMENT0);return e&&Se(e)?e:null}get colorAttachment(){return this._colorAttachments.get($.VY.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width}get height(){return this._desc.height}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+Z(r)),0)+Z(this.depthStencilAttachment)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&Se(t)?t:null}attachColorTexture(e,t=$.VY.COLOR_ATTACHMENT0){e&&(this._validateColorAttachmentPoint(t),Ce(e.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e))}detachColorTexture(e=$.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(Se(t)){const r=t;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),r}}setColorTextureTarget(e,t=$.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);Se(r)&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencilTexture(e){if((0,n.Wi)(e))return;const t=e.descriptor;t.pixelFormat!==$.VI.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==$.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),Ce(t,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==$.OU.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=$.OU.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,$.Lu)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,$.Lu)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if((0,n.Wi)(e))return;const t=e.descriptor;if(t.internalFormat!==$.Tg.DEPTH_STENCIL&&t.internalFormat!==$.Tg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),we(t,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=t.internalFormat===$.Tg.DEPTH_STENCIL?$.OU.DEPTH_STENCIL_RENDER_BUFFER:$.OU.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._desc.depthStencilTarget===$.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer($.qi.FRAMEBUFFER,r,t.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,t=this._depthAttachment;if(t&&this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===$.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer($.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}return this._depthAttachment=null,t}detachAll(){this._colorAttachments.forEach(((e,t)=>this._detachColorAttachment(t))),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,t,r,i,n,o,a){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=this._desc,l=a.descriptor;a.descriptor.target!==$.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(e+r>s.width||t+i>s.height||n+r>l.width||o+i>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,u=c.bindTexture(a,X.x.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(X.x.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D($.No.TEXTURE_2D,0,n,o,e,t,r,i),c.bindTexture(u,X.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,n,o,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,n,o,a)}async readPixelsAsync(e,t,r,i,n,o,a){if(this._context.type!==ge.zO.WEBGL2)return(0,me.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,n,o,a);const s=this._context.gl,l=ve.createPixelPack(this._context,$.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,n,o,0),this._context.unbindBuffer($.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){const r=this._desc;if(r.width!==e||r.height!==t){if(!this._initialized)return r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,t));r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(e,t):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,t),this._stencilAttachment&&this._stencilAttachment.resize(e,t)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=$.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=this._context,i=t.createFramebuffer(),n=this._desc,o=n.colorTarget??$.Lm.RENDER_BUFFER,a=n.width??1,s=n.height??1;if(t.bindFramebuffer(e,i),0===this._colorAttachments.size)if(o===$.Lm.TEXTURE||o===$.Lm.CUBEMAP)this._colorAttachments.set($.VY.COLOR_ATTACHMENT0,function(e,t,r){return new X.x(e,{target:r,pixelFormat:$.VI.RGBA,dataType:$.Br.UNSIGNED_BYTE,samplingMode:$.cw.NEAREST,wrapMode:$.e8.CLAMP_TO_EDGE,width:t.width,height:t.height})}(r,n,this.descriptor.colorTarget===$.Lm.CUBEMAP?$.No.TEXTURE_CUBE_MAP:$.No.TEXTURE_2D));else{const e=new be(r,{internalFormat:$.lP.RGBA4,width:a,height:s});this._colorAttachments.set($.VY.COLOR_ATTACHMENT0,e)}this._colorAttachments.forEach(((r,i)=>{r&&(Se(r)?this._framebufferTexture2D(r.glName,i,ye(r),e):t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,r.glName))}));const l=n.depthStencilTarget??$.OU.NONE;switch(l){case $.OU.DEPTH_RENDER_BUFFER:case $.OU.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new be(r,{internalFormat:n.depthStencilTarget===$.OU.DEPTH_RENDER_BUFFER?$.Tg.DEPTH_COMPONENT16:$.Tg.DEPTH_STENCIL,width:a,height:s}));const i=l===$.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,this._depthAttachment.glName);break}case $.OU.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new be(r,{internalFormat:$.Tg.STENCIL_INDEX8,width:a,height:s})),t.framebufferRenderbuffer(e,t.STENCIL_ATTACHMENT,t.RENDERBUFFER,this._stencilAttachment.glName);break;case $.OU.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){r.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const e={target:$.No.TEXTURE_2D,pixelFormat:$.VI.DEPTH_STENCIL,dataType:$.Br.UNSIGNED_INT_24_8,samplingMode:$.cw.NEAREST,wrapMode:$.e8.CLAMP_TO_EDGE,width:a,height:s};this._depthStencilTexture=new X.x(r,e)}this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,ye(this._depthStencilTexture),e)}(0,me.CG)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=i,this._initialized=!0}_framebufferTexture2D(e,t=$.VY.COLOR_ATTACHMENT0,r=$.No.TEXTURE_2D,i=$.qi.FRAMEBUFFER,n=0){this._context.gl.framebufferTexture2D(i,t,r,e,n)}_detachColorAttachment(e){(0,me.hZ)()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const t=this._context.gl,r=this._colorAttachments.get(e);return Se(r)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)):this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer($.qi.FRAMEBUFFER,e,t.RENDERBUFFER,null)),this._colorAttachments.delete(e),r}_disposeColorAttachments(){this._colorAttachments.forEach(((e,t)=>{this._detachColorAttachment(t),e.dispose()})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===$.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer($.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer($.qi.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(e){if(-1===Ee._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;Ee._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else Ee._MAX_COLOR_ATTACHMENTS=1}const t=e-$.VY.COLOR_ATTACHMENT0;t+1>Ee._MAX_COLOR_ATTACHMENTS&&Ae.error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${Ee._MAX_COLOR_ATTACHMENTS} color attachments`)}}function Se(e){return"type"in e&&"texture"===e.type}function Me(e){return"type"in e&&"renderbuffer"===e.type}function Re(e){return Se(e)||"pixelFormat"in e}function Ce(e,t){e.target!==$.No.TEXTURE_2D&&e.target!==$.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function we(e,t){void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function ye(e){return e.descriptor.target===$.No.TEXTURE_CUBE_MAP?$.No.TEXTURE_CUBE_MAP_POSITIVE_X:$.No.TEXTURE_2D}Ee._MAX_COLOR_ATTACHMENTS=-1;var Oe,Pe,Ne=r(46314);class Ie extends P.c{constructor(e,t){super(),this.data=e,this.type=N.U.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new H.Z,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:$.e8.REPEAT,t:$.e8.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||R.CE.STRETCH,this.estimatedTexMemRequired=Ie._estimateTexMemRequired(this.data,this.params),this._startPreload()}_startPreload(){const e=this.data;(0,n.Wi)(e)||(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){(0,G.jc)(e.src)||"auto"===e.preload&&e.crossOrigin||(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src)}_startPreloadImageElement(e){(0,G.HK)(e.src)||(0,G.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if((0,n.Wi)(e))return 0;if((0,z.eP)(e)||(0,z.lq)(e))return t.encoding===Ie.KTX2_ENCODING?function(e,t){if((0,n.Wi)(K))return e.byteLength;const r=new K.KTX2File(new Uint8Array(e)),i=ie(r)?te(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,t.mipmap):t.encoding===Ie.BASIS_ENCODING?function(e,t){if((0,n.Wi)(K))return e.byteLength;const r=new K.BasisFile(new Uint8Array(e)),i=re(r)?te(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Ie._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this.data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){return{target:$.No.TEXTURE_2D,pixelFormat:$.VI.RGBA,dataType:$.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?$.cw.LINEAR_MIPMAP_LINEAR:$.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:this.params.maxAnisotropy??(this.params.mipmap?e.parameters.maxMaxAnisotropy:1)}}get glTexture(){return this._glTexture}load(e,t){if((0,n.pC)(this._glTexture))return this._glTexture;if((0,n.pC)(this._loadingPromise))return this._loadingPromise;const r=this.data;return(0,n.Wi)(r)?(this._glTexture=new X.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof r?this._loadFromURL(e,t,r):r instanceof Image?this._loadFromImageElement(e,t,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,t,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r,t):((0,z.eP)(r)||(0,z.lq)(r))&&this.params.encoding===Ie.DDS_ENCODING?(this.data=void 0,this._loadFromDDSData(e,r)):((0,z.eP)(r)||(0,z.lq)(r))&&this.params.encoding===Ie.KTX2_ENCODING?(this.data=void 0,this._loadFromKTX2(e,r)):((0,z.eP)(r)||(0,z.lq)(r))&&this.params.encoding===Ie.BASIS_ENCODING?(this.data=void 0,this._loadFromBasis(e,r)):(0,z.lq)(r)?this._loadFromPixelData(e,r):(0,z.eP)(r)?this._loadFromPixelData(e,new Uint8Array(r)):null}get requiresFrameUpdates(){return this.data instanceof HTMLVideoElement}frameUpdate(e,t,r){if(!(this.data instanceof HTMLVideoElement)||(0,n.Wi)(this._glTexture))return r;if(this.data.readyState<Oe.HAVE_CURRENT_DATA||r===this.data.currentTime)return r;if((0,n.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:r,vao:i,sourceTexture:n}=this._powerOfTwoStretchInfo;n.setData(this.data),this._drawStretchedTexture(e,t,r,i,n,this._glTexture)}else{const{width:e,height:t}=this.data,{width:r,height:i}=this._glTexture.descriptor;e!==r||t!==i?this._glTexture.updateData(0,0,0,Math.min(e,r),Math.min(t,i),this.data):this._glTexture.setData(this.data)}return this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.data.currentTime}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const{textureData:i,internalFormat:n,width:o,height:a}=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return oe.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return oe.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case se:n=8,o=$.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case le:n=16,o=$.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case ce:n=16,o=$.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return oe.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(oe.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,u=l;let d,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7])),1===a||(0,U.wt)(s)&&(0,U.wt)(l)||(oe.warn("Ignoring mipmaps of non power of two sized compressed texture."),a=1);let f=r[1]+4;const p=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*n,d=new Uint8Array(e,f,h),p.push(d),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:o,width:c,height:u}}(r,t.hasMipmap);return t.samplingMode=i.levels.length>1?$.cw.LINEAR_MIPMAP_LINEAR:$.cw.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=n,t.width=o,t.height=a,new X.x(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){(0,n.Wi)(K)&&(K=await ee());const i=new K.KTX2File(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=ne(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){(0,n.Wi)(K)&&(K=await ee());const i=new K.BasisFile(new Uint8Array(r));if(!re(i))return null;i.startTranscoding();const o=ne(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,w.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?$.VI.LUMINANCE:3===this.params.components?$.VI.RGB:$.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new X.x(e,r,t),this._glTexture}_loadFromURL(e,t,r){return this._loadAsync((async i=>{const n=await M(r,{signal:i});return(0,E.k_)(i),this._loadFromImage(e,n,t)}))}_loadFromImageElement(e,t,r){return r.complete?this._loadFromImage(e,r,t):this._loadAsync((async i=>{const n=await(0,V.f)(r,r.src,!1,i);return(0,E.k_)(i),this._loadFromImage(e,n,t)}))}_loadFromVideoElement(e,t,r){return r.readyState>=Oe.HAVE_CURRENT_DATA?this._loadFromImage(e,r,t):this._loadFromVideoElementAsync(e,t,r)}_loadFromVideoElementAsync(e,t,r){return this._loadAsync((i=>new Promise(((o,a)=>{const s=()=>{r.removeEventListener("loadeddata",l),r.removeEventListener("error",c),(0,n.hw)(u)},l=()=>{r.readyState>=Oe.HAVE_CURRENT_DATA&&(s(),o(this._loadFromImage(e,r,t)))},c=e=>{s(),a(e||new b.Z("Failed to load video"))};r.addEventListener("loadeddata",l),r.addEventListener("error",c);const u=(0,E.fu)(i,(()=>c((0,E.zE)())))}))))}_loadFromImage(e,t,r){const i=Ie._getDataDimensions(t);this.params.width=i.width,this.params.height=i.height;const n=this._createDescriptor(e);return n.pixelFormat=3===this.params.components?$.VI.RGB:$.VI.RGBA,!this._requiresPowerOfTwo(e,n)||(0,U.wt)(i.width)&&(0,U.wt)(i.height)?(n.width=i.width,n.height=i.height,this._glTexture=new X.x(e,n,t),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(e,t,i,n,r),this._glTexture)}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}_requiresPowerOfTwo(e,t){const r=$.e8.CLAMP_TO_EDGE,i="number"==typeof t.wrapMode?t.wrapMode===r:t.wrapMode.s===r&&t.wrapMode.t===r;return!(0,Ne.Z)(e.gl)&&(t.hasMipmap||!i)}_makePowerOfTwoTexture(e,t,r,i,n){const{width:o,height:a}=r,s=(0,U.Sf)(o),l=(0,U.Sf)(a);let c;switch(i.width=s,i.height=l,this.params.powerOfTwoResizeMode){case R.CE.PAD:i.textureCoordinateScaleFactor=[o/s,a/l],c=new X.x(e,i),c.updateData(0,0,0,o,a,t);break;case R.CE.STRETCH:case null:case void 0:c=this._stretchToPowerOfTwo(e,t,i,n());break;default:(0,B.Bg)(this.params.powerOfTwoResizeMode)}return i.hasMipmap&&c.generateMipmap(),c}_stretchToPowerOfTwo(e,t,r,i){const n=new X.x(e,r),o=new Ee(e,{colorTarget:$.Lm.TEXTURE,depthStencilTarget:$.OU.NONE},n),a=new X.x(e,{target:$.No.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:$.Br.UNSIGNED_BYTE,wrapMode:$.e8.CLAMP_TO_EDGE,samplingMode:$.cw.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},t),s=function(e,t=he,r=ue.i,i=-1,n=1){let o=null;return o=t===fe?new Float32Array([i,i,0,0,n,i,1,0,i,n,0,1,n,n,1,1]):new Float32Array([i,i,n,i,i,n,n,n]),new xe(e,r,{geometry:t},{geometry:ve.createVertex(e,$.l1.STATIC_DRAW,o)})}(e),l=e.getBoundFramebufferObject();return this._drawStretchedTexture(e,i,o,s,a,n),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:s,sourceTexture:a,framebuffer:o}:(s.dispose(!0),a.dispose(),o.detachColorTexture(),o.dispose()),e.bindFramebuffer(l),n}_drawStretchedTexture(e,t,r,i,n,o){e.bindFramebuffer(r);const a=e.getViewport();e.setViewport(0,0,o.descriptor.width,o.descriptor.height);const s=e.bindTechnique(t);s.setUniform4f("uColor",1,1,1,1),s.bindTexture("tex",n),e.bindVAO(i),e.drawArrays($.MX.TRIANGLE_STRIP,0,function(e,t){return e.vertexBuffers[t].size/function(e){return e[0].stride}(e.layout[t])}(i,"geometry")),e.bindFramebuffer(null),e.setViewport(a.x,a.y,a.width,a.height)}unload(){if((0,n.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:e,vao:t,sourceTexture:r}=this._powerOfTwoStretchInfo;t.dispose(!0),r.dispose(),e.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if((0,n.pC)(this._glTexture)&&(this._glTexture.dispose(),this._glTexture=null),(0,n.pC)(this._loadingController)){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}Ie.DDS_ENCODING="image/vnd-ms.dds",Ie.KTX2_ENCODING="image/ktx2",Ie.BASIS_ENCODING="image/x.basis",(Pe=Oe||(Oe={}))[Pe.HAVE_NOTHING=0]="HAVE_NOTHING",Pe[Pe.HAVE_METADATA=1]="HAVE_METADATA",Pe[Pe.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Pe[Pe.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Pe[Pe.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var De=r(64822),Le=r(65576),Fe=r(18361),Be=r(64267),He=r(19419),Ue=r(85504),ze=r(60537),Ge=r(82791);function Ve(e,t,r=$.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}const We={face:$.LR.BACK,mode:$.Wf.CCW},qe={face:$.LR.FRONT,mode:$.Wf.CCW},ke=e=>e===R.Vr.Back?We:e===R.Vr.Front?qe:null,$e={zNear:0,zFar:1},Xe={r:!0,g:!0,b:!0,a:!0};function je(e){return nt.intern(e)}function Je(e){return at.intern(e)}function Ye(e){return lt.intern(e)}function Ze(e){return ut.intern(e)}function Ke(e){return ht.intern(e)}function Qe(e){return pt.intern(e)}function et(e){return gt.intern(e)}function tt(e){return vt.intern(e)}class rt{constructor(e,t){this.makeKey=e,this.makeRef=t,this.interns=new Map}intern(e){if(!e)return null;const t=this.makeKey(e),r=this.interns;return r.has(t)||r.set(t,this.makeRef(e)),r.get(t)}}function it(e){return"["+e.join(",")+"]"}const nt=new rt(ot,(e=>({__tag:"Blending",...e})));function ot(e){return e?it([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const at=new rt(st,(e=>({__tag:"Culling",...e})));function st(e){return e?it([e.face,e.mode]):null}const lt=new rt(ct,(e=>({__tag:"PolygonOffset",...e})));function ct(e){return e?it([e.factor,e.units]):null}const ut=new rt(dt,(e=>({__tag:"DepthTest",...e})));function dt(e){return e?it([e.func]):null}const ht=new rt(ft,(e=>({__tag:"StencilTest",...e})));function ft(e){return e?it([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const pt=new rt(mt,(e=>({__tag:"DepthWrite",...e})));function mt(e){return e?it([e.zNear,e.zFar]):null}const gt=new rt(_t,(e=>({__tag:"ColorWrite",...e})));function _t(e){return e?it([e.r,e.g,e.b,e.a]):null}const vt=new rt(Tt,(e=>({__tag:"StencilWrite",...e})));function Tt(e){return e?it([e.mask]):null}const xt=new rt((function(e){return e?it([ot(e.blending),st(e.culling),ct(e.polygonOffset),dt(e.depthTest),ft(e.stencilTest),mt(e.depthWrite),_t(e.colorWrite),Tt(e.stencilWrite)]):null}),(e=>({blending:je(e.blending),culling:Je(e.culling),polygonOffset:Ye(e.polygonOffset),depthTest:Ze(e.depthTest),stencilTest:Ke(e.stencilTest),depthWrite:Qe(e.depthWrite),colorWrite:et(e.colorWrite),stencilWrite:tt(e.stencilWrite)}))),bt=function(e,t,r,i,n=$.db.ADD,o=$.db.ADD,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}($.zi.SRC_ALPHA,$.zi.ONE,$.zi.ONE_MINUS_SRC_ALPHA,$.zi.ONE_MINUS_SRC_ALPHA),At=Ve($.zi.ONE,$.zi.ONE),Et=Ve($.zi.ZERO,$.zi.ONE_MINUS_SRC_ALPHA);function St(e){return e===R.Am.FrontFace?null:e===R.Am.Alpha?Et:At}const Mt={factor:-1,units:-2};function Rt(e,t=$.wb.LESS){return e===R.Am.NONE||e===R.Am.FrontFace?t:$.wb.LEQUAL}var Ct=r(50173),wt=r(97995),yt=r(51305),Ot=r(94961),Pt=r(72119),Nt=r(2643);const It=(0,u.c)(),Dt=(0,u.c)(),Lt=(0,u.c)(),Ft=new class{constructor(e=0){this.offset=e,this.sphere=(0,Nt.c)(),this.tmpVertex=(0,u.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let n=i[0]*e+i[4]*t+i[8]*r+i[12],o=i[1]*e+i[5]*t+i[9]*r+i[13],a=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(n*n+o*o+a*a);n+=n*s,o+=o*s,a+=a*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*n+l[4]*o+l[8]*a+l[12],this.tmpVertex[1]=l[1]*n+l[5]*o+l[9]*a+l[13],this.tmpVertex[2]=l[2]*n+l[6]*o+l[10]*a+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.offset=e,this.componentLocalOriginLength=0,this.tmpVertex=(0,u.c)(),this.mbs=(0,Nt.c)(),this.obb={center:(0,u.c)(),halfSize:(0,Pt.c)(),quaternion:null}}set localOrigin(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,n=t,o=r+this.componentLocalOriginLength,a=this.offset/Math.sqrt(i*i+n*n+o*o);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+n*a,this.tmpVertex[2]=r+o*a,this.tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,n=e[3],o=e[4],a=e[5]+this.componentLocalOriginLength,s=this.offset/Math.sqrt(t*t+r*r+i*i);e[0]+=t*s,e[1]+=r*s,e[2]+=i*s;const l=this.offset/Math.sqrt(n*n+o*o+a*a);return e[3]+=n*l,e[4]+=o*l,e[5]+=a*l,e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.mbs[0]=e[0]+e[0]*r,this.mbs[1]=e[1]+e[1]*r,this.mbs[2]=e[2]+e[2]*r,this.mbs[3]=e[3]+e[3]*this.offset/t,this.mbs}applyToObb(e){const t=e.center,r=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.obb.center[0]=t[0]+t[0]*r,this.obb.center[1]=t[1]+t[1]*r,this.obb.center[2]=t[2]+t[2]*r,(0,c.q)(this.obb.halfSize,e.halfSize,e.quaternion),(0,c.a)(this.obb.halfSize,this.obb.halfSize,e.center);const i=this.offset/Math.sqrt(this.obb.halfSize[0]*this.obb.halfSize[0]+this.obb.halfSize[1]*this.obb.halfSize[1]+this.obb.halfSize[2]*this.obb.halfSize[2]);return this.obb.halfSize[0]+=this.obb.halfSize[0]*i,this.obb.halfSize[1]+=this.obb.halfSize[1]*i,this.obb.halfSize[2]+=this.obb.halfSize[2]*i,(0,c.b)(this.obb.halfSize,this.obb.halfSize,e.center),(0,yt.c)(Bt,e.quaternion),(0,c.q)(this.obb.halfSize,this.obb.halfSize,Bt),this.obb.halfSize[0]*=this.obb.halfSize[0]<0?-1:1,this.obb.halfSize[1]*=this.obb.halfSize[1]<0?-1:1,this.obb.halfSize[2]*=this.obb.halfSize[2]<0?-1:1,this.obb.quaternion=e.quaternion,this.obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,u.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],n=t+this.localOrigin[1],o=r+this.localOrigin[2],a=this.offset/Math.sqrt(i*i+n*n+o*o);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+n*a,this.tmpVertex[2]=r+o*a,this.tmpVertex}applyToAabb(e){for(let t=0;t<3;++t)It[t]=e[0+t]+this.localOrigin[t],Dt[t]=e[3+t]+this.localOrigin[t],Lt[t]=It[t];const t=this.applyToVertex(It[0],It[1],It[2]);for(let r=0;r<3;++r)e[r]=t[r],e[r+3]=t[r];const r=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t+0]=Math.min(e[t+0],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let t=0;t<3;++t)Lt[t]=0==(e&1<<t)?It[t]:Dt[t];r(Lt)}let i=0;for(let e=0;e<3;++e)It[e]*Dt[e]<0&&(i|=1<<e);if(0!==i&&7!==i)for(let e=0;e<8;++e)if(0==(i&e)){for(let t=0;t<3;++t)i[t]?Lt[t]=0:Lt[t]=0!=(e&1<<t)?It[t]:Dt[t];r(Lt)}for(let t=0;t<3;++t)e[t+0]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Bt=(0,Ot.a)();function Ht(e,t,r,i){const n=r.typedBuffer,o=r.typedBufferStride,a=e.length;i*=o;for(let r=0;r<a;++r){const a=2*e[r];n[i]=t[a],n[i+1]=t[a+1],i+=o}}function Ut(e,t,r,i,n){const o=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==n||1===n)for(let r=0;r<s;++r){const n=3*e[r];o[i]=t[n],o[i+1]=t[n+1],o[i+2]=t[n+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<n;++e)o[i]=t[s],o[i+1]=t[s+1],o[i+2]=t[s+2],i+=a}}function zt(e,t,r,i,n,o=1){if(!r)return void Ut(e,t,i,n,o);const a=i.typedBuffer,s=i.typedBufferStride,l=e.length,c=r[0],u=r[1],d=r[2],h=r[4],f=r[5],p=r[6],m=r[8],g=r[9],_=r[10],v=r[12],T=r[13],x=r[14];if(n*=s,1===o)for(let r=0;r<l;++r){const i=3*e[r],o=t[i],l=t[i+1],b=t[i+2];a[n]=c*o+h*l+m*b+v,a[n+1]=u*o+f*l+g*b+T,a[n+2]=d*o+p*l+_*b+x,n+=s}else for(let r=0;r<l;++r){const i=3*e[r],l=t[i],b=t[i+1],A=t[i+2],E=c*l+h*b+m*A+v,S=u*l+f*b+g*A+T,M=d*l+p*b+_*A+x;for(let e=0;e<o;++e)a[n]=E,a[n+1]=S,a[n+2]=M,n+=s}}function Gt(e,t,r,i,n,o=1){if(!r)return void Ut(e,t,i,n,o);const a=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=a[0],h=a[1],f=a[2],p=a[4],m=a[5],g=a[6],_=a[8],v=a[9],T=a[10],x=!(0,s.p)(a),b=1e-6,A=1-b;if(n*=c,1===o)for(let r=0;r<u;++r){const i=3*e[r],o=t[i],a=t[i+1],s=t[i+2];let u=d*o+p*a+_*s,E=h*o+m*a+v*s,S=f*o+g*a+T*s;if(x){const e=u*u+E*E+S*S;if(e<A&&e>b){const t=1/Math.sqrt(e);u*=t,E*=t,S*=t}}l[n+0]=u,l[n+1]=E,l[n+2]=S,n+=c}else for(let r=0;r<u;++r){const i=3*e[r],a=t[i],s=t[i+1],u=t[i+2];let E=d*a+p*s+_*u,S=h*a+m*s+v*u,M=f*a+g*s+T*u;if(x){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}for(let e=0;e<o;++e)l[n+0]=E,l[n+1]=S,l[n+2]=M,n+=c}}function Vt(e,t,r,i,n,o=1){if(!r)return void function(e,t,r,i,n=1){const o=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===n)for(let r=0;r<s;++r){const n=4*e[r];o[i]=t[n],o[i+1]=t[n+1],o[i+2]=t[n+2],o[i+3]=t[n+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<n;++e)o[i]=t[s],o[i+1]=t[s+1],o[i+2]=t[s+2],o[i+3]=t[s+3],i+=a}}(e,t,i,n,o);const a=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=a[0],h=a[1],f=a[2],p=a[4],m=a[5],g=a[6],_=a[8],v=a[9],T=a[10],x=!(0,s.p)(a),b=1e-6,A=1-b;if(n*=c,1===o)for(let r=0;r<u;++r){const i=4*e[r],o=t[i],a=t[i+1],s=t[i+2],u=t[i+3];let E=d*o+p*a+_*s,S=h*o+m*a+v*s,M=f*o+g*a+T*s;if(x){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}l[n+0]=E,l[n+1]=S,l[n+2]=M,l[n+3]=u,n+=c}else for(let r=0;r<u;++r){const i=4*e[r],a=t[i],s=t[i+1],u=t[i+2],E=t[i+3];let S=d*a+p*s+_*u,M=h*a+m*s+v*u,R=f*a+g*s+T*u;if(x){const e=S*S+M*M+R*R;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,M*=t,R*=t}}for(let e=0;e<o;++e)l[n+0]=S,l[n+1]=M,l[n+2]=R,l[n+3]=E,n+=c}}function Wt(e,t,r,i,n,o=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(n*=s,1===o){if(4===r)for(let r=0;r<l;++r){const i=4*e[r];a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=t[i+3],n+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=255,n+=s}}else if(4===r)for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<o;++e)a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=t[i+3],n+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<o;++e)a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=255,n+=s}}var qt=r(37782),kt=r(88669),$t=r(135),Xt=r(15719),jt=r(96310),Jt=r(89243);class Yt{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}var Zt=r(67498);class Kt{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new C.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBind(Zt.P.Pass,this),this.bindDraw=t.generateBind(Zt.P.Draw,this),this._fragmentUniforms=(0,me.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get isCompiled(){return this._glProgram.isCompiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2f(e,t,r){this._glProgram.setUniform2f(e,t,r)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3f(e,t,r,i){this._glProgram.setUniform3f(e,t,r,i)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4f(e,t,r,i,n){this._glProgram.setUniform4f(e,t,r,i,n)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if((0,n.Wi)(t)||null==t.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),(0,n.pC)(this._fragmentUniforms)&&this._fragmentUniforms.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}$.wb.LESS,$.wb.ALWAYS;const Qt={mask:255},er={function:{func:$.wb.ALWAYS,ref:R.hU.OutlineVisualElementMask,mask:R.hU.OutlineVisualElementMask},operation:{fail:$.xS.KEEP,zFail:$.xS.KEEP,zPass:$.xS.ZERO}},tr={function:{func:$.wb.ALWAYS,ref:R.hU.OutlineVisualElementMask,mask:R.hU.OutlineVisualElementMask},operation:{fail:$.xS.KEEP,zFail:$.xS.KEEP,zPass:$.xS.REPLACE}};$.wb.EQUAL,R.hU.OutlineVisualElementMask,R.hU.OutlineVisualElementMask,$.xS.KEEP,$.xS.KEEP,$.xS.KEEP,$.wb.NOTEQUAL,R.hU.OutlineVisualElementMask,R.hU.OutlineVisualElementMask,$.xS.KEEP,$.xS.KEEP,$.xS.KEEP;var rr=r(32078);class ir extends Xt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,u.f)(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=R.Vr.Back,this.emissiveFactor=(0,u.f)(0,0,0),this.instancedDoublePrecision=!1,this.normals="default",this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,u.f)(.2,.2,.2),this.diffuse=(0,u.f)(.8,.8,.8),this.externalColor=(0,kt.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,u.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSizeEnabled=!1,this.vvSizeMinSize=[1,1,1],this.vvSizeMaxSize=[100,100,100],this.vvSizeOffset=[0,0,0],this.vvSizeFactor=[1,1,1],this.vvSizeValue=[1,1,1],this.vvColorEnabled=!1,this.vvColorValues=[0,0,0,0,0,0,0,0],this.vvColorColors=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],this.vvSymbolAnchor=[0,0,0],this.vvSymbolRotationMatrix=(0,a.c)(),this.vvOpacityEnabled=!1,this.vvOpacityValues=[],this.vvOpacityOpacities=[],this.transparent=!1,this.writeDepth=!0,this.customDepthTest=R.Gv.Less,this.textureAlphaMode=R.JJ.Blend,this.textureAlphaCutoff=jt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ge.yD.Occlude}}class nr extends class{constructor(e,t,r){this.release=r,t&&(this.initializeConfiguration(e,t),this._configuration=t.snapshot()),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=(0,n.O3)(this._program),this._pipeline=this._configuration=null}reload(e){(0,n.O3)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.isCompiled}get key(){return this._configuration.key}get configuration(){return this._configuration}bindPass(e,t){this.program.bindPass(e,t)}bindDraw(e,t){this.program.bindDraw(e,t),this.program.rebindTextures()}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return $.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}{initializeConfiguration(e,t){t.spherical=e.viewingMode===De.JY.Global,t.doublePrecisionRequiresObfuscation=(0,Jt.I)(e.rctx),t.textureCoordinateType=t.hasColorTexture||t.hasMetalnessAndRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?$t.N.Default:$t.N.None}initializeProgram(e){return this._initializeProgram(e,nr.shader)}_initializeProgram(e,t){const r=t.get().build(this.configuration);return new Kt(e.rctx,r,ue.i)}_convertDepthTestFunction(e){return e===R.Gv.Lequal?$.wb.LEQUAL:$.wb.LESS}_setPipeline(e,t){const r=this.configuration,i=e===R.Am.NONE,n=e===R.Am.FrontFace;return function(e){return xt.intern(e)}({blending:r.output!==Fe.H.Color&&r.output!==Fe.H.Alpha||!r.transparent?null:i?bt:St(e),culling:or(r)&&ke(r.cullFace),depthTest:{func:Rt(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:i||n?r.writeDepth&&$e:null,colorWrite:Xe,stencilWrite:r.hasOccludees?Qt:null,stencilTest:r.hasOccludees?t?tr:er:null,polygonOffset:i||n?null:(o=r.enableOffset,o?Mt:null)});var o}initializePipeline(){return this._occludeePipelineState=this._setPipeline(this.configuration.transparencyPassType,!0),this._setPipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function or(e){return e.cullFace!==R.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}nr.shader=new Yt(rr.D,(()=>r.e(9291).then(r.bind(r,79291))));var ar=r(43697);function sr(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,n=e.count||2,o=Math.ceil(Math.log2(n)),a=t._parameterBits??[0];let s=0;for(;a[s]+o>16;)s++,s>=a.length&&a.push(0);t._parameterBits=a;const l=a[s],c=(1<<o)-1<<l;a[s]+=o,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw"Configuration value for "+r+" must be boolean or number, got "+typeof e}})}}}class lr extends class{constructor(){this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}{}(0,ar._)([sr({constValue:!0})],lr.prototype,"hasSliceHighlight",void 0),(0,ar._)([sr({constValue:!1})],lr.prototype,"hasSliceInVertexProgram",void 0),(0,ar._)([sr({constValue:!1})],lr.prototype,"instancedDoublePrecision",void 0),(0,ar._)([sr({constValue:!1})],lr.prototype,"isGround",void 0),(0,ar._)([sr({constValue:Zt.P.Pass})],lr.prototype,"pbrTextureBindType",void 0);class cr extends lr{constructor(){super(...arguments),this.output=Fe.H.Color,this.alphaDiscardMode=R.JJ.Opaque,this.doubleSidedMode=He.q.None,this.pbrMode=Ue.f7.Disabled,this.cullFace=R.Vr.None,this.transparencyPassType=R.Am.NONE,this.normalType=Be.h.Attribute,this.textureCoordinateType=$t.N.None,this.customDepthTest=R.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetalnessAndRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1}}(0,ar._)([sr({count:Fe.H.COUNT})],cr.prototype,"output",void 0),(0,ar._)([sr({count:R.JJ.COUNT})],cr.prototype,"alphaDiscardMode",void 0),(0,ar._)([sr({count:He.q.COUNT})],cr.prototype,"doubleSidedMode",void 0),(0,ar._)([sr({count:Ue.f7.COUNT})],cr.prototype,"pbrMode",void 0),(0,ar._)([sr({count:R.Vr.COUNT})],cr.prototype,"cullFace",void 0),(0,ar._)([sr({count:R.Am.COUNT})],cr.prototype,"transparencyPassType",void 0),(0,ar._)([sr({count:Be.h.COUNT})],cr.prototype,"normalType",void 0),(0,ar._)([sr({count:$t.N.COUNT})],cr.prototype,"textureCoordinateType",void 0),(0,ar._)([sr({count:R.Gv.COUNT})],cr.prototype,"customDepthTest",void 0),(0,ar._)([sr()],cr.prototype,"spherical",void 0),(0,ar._)([sr()],cr.prototype,"hasVertexColors",void 0),(0,ar._)([sr()],cr.prototype,"hasSymbolColors",void 0),(0,ar._)([sr()],cr.prototype,"hasVerticalOffset",void 0),(0,ar._)([sr()],cr.prototype,"hasSlicePlane",void 0),(0,ar._)([sr()],cr.prototype,"hasSliceHighlight",void 0),(0,ar._)([sr()],cr.prototype,"hasColorTexture",void 0),(0,ar._)([sr()],cr.prototype,"hasMetalnessAndRoughnessTexture",void 0),(0,ar._)([sr()],cr.prototype,"hasEmissionTexture",void 0),(0,ar._)([sr()],cr.prototype,"hasOcclusionTexture",void 0),(0,ar._)([sr()],cr.prototype,"hasNormalTexture",void 0),(0,ar._)([sr()],cr.prototype,"hasScreenSizePerspective",void 0),(0,ar._)([sr()],cr.prototype,"hasVertexTangents",void 0),(0,ar._)([sr()],cr.prototype,"hasOccludees",void 0),(0,ar._)([sr()],cr.prototype,"hasMultipassTerrain",void 0),(0,ar._)([sr()],cr.prototype,"hasModelTransformation",void 0),(0,ar._)([sr()],cr.prototype,"offsetBackfaces",void 0),(0,ar._)([sr()],cr.prototype,"vvSize",void 0),(0,ar._)([sr()],cr.prototype,"vvColor",void 0),(0,ar._)([sr()],cr.prototype,"receiveShadows",void 0),(0,ar._)([sr()],cr.prototype,"receiveAmbientOcclusion",void 0),(0,ar._)([sr()],cr.prototype,"textureAlphaPremultiplied",void 0),(0,ar._)([sr()],cr.prototype,"instanced",void 0),(0,ar._)([sr()],cr.prototype,"instancedColor",void 0),(0,ar._)([sr()],cr.prototype,"instancedDoublePrecision",void 0),(0,ar._)([sr()],cr.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,ar._)([sr()],cr.prototype,"writeDepth",void 0),(0,ar._)([sr()],cr.prototype,"transparent",void 0),(0,ar._)([sr()],cr.prototype,"enableOffset",void 0),(0,ar._)([sr()],cr.prototype,"cullAboveGround",void 0),(0,ar._)([sr({constValue:!0})],cr.prototype,"hasVvInstancing",void 0),(0,ar._)([sr({constValue:!1})],cr.prototype,"useCustomDTRExponentForWater",void 0),(0,ar._)([sr({constValue:!1})],cr.prototype,"supportsTextureAtlas",void 0),(0,ar._)([sr({constValue:!0})],cr.prototype,"useFillLights",void 0);var ur=r(41846);class dr extends nr{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetalnessAndRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Be.h.Attribute,t.doubleSidedMode=He.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,dr.shader)}}dr.shader=new Yt(ur.R,(()=>r.e(8096).then(r.bind(r,38096))));class hr extends Ge.F5{constructor(e){super(e,pr),this.supportsEdges=!0,this.techniqueConfig=new cr,this.vertexBufferLayout=function(e){const t=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId,r=(0,Le.U$)().vec3f(D.T.POSITION).vec3f(D.T.NORMAL);return e.hasVertexTangents&&r.vec4f(D.T.TANGENT),t&&r.vec2f(D.T.UV0),e.hasVertexColors&&r.vec4u8(D.T.COLOR),e.hasSymbolColors&&r.vec4u8(D.T.SYMBOLCOLOR),r}(this.parameters),this.instanceBufferLayout=e.instanced?function(e){let t=(0,Le.U$)();return t=e.instancedDoublePrecision?t.vec3f(D.T.MODELORIGINHI).vec3f(D.T.MODELORIGINLO).mat3f(D.T.MODEL).mat3f(D.T.MODELNORMAL):t.mat4f(D.T.MODEL).mat4f(D.T.MODELNORMAL),(0,n.pC)(e.instanced)&&e.instanced.includes("color")&&(t=t.vec4f(D.T.INSTANCECOLOR)),(0,n.pC)(e.instanced)&&e.instanced.includes("featureAttribute")&&(t=t.vec4f(D.T.INSTANCEFEATUREATTRIBUTE)),t}(this.parameters):null}isVisibleInPass(e){return e!==Ct.C.MATERIAL_DEPTH_SHADOWMAP_ALL&&e!==Ct.C.MATERIAL_DEPTH_SHADOWMAP_DEFAULT&&e!==Ct.C.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{instanced:t,hasVertexColors:r,hasSymbolColors:i,vvColorEnabled:o}=e,a=(0,n.pC)(t)&&t.includes("color"),s="replace"===e.colorMixMode,l=e.opacity>0,c=e.externalColor&&e.externalColor[3]>0;return r&&(a||o||i)?!!s||l:r?s?c:l:a||o||i?!!s||l:s?c:l}getConfiguration(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.hasNormalTexture=!!this.parameters.normalTextureId,this.techniqueConfig.hasColorTexture=!!this.parameters.textureId,this.techniqueConfig.hasVertexTangents=this.parameters.hasVertexTangents,this.techniqueConfig.instanced=!!this.parameters.instanced,this.techniqueConfig.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this.techniqueConfig.vvSize=this.parameters.vvSizeEnabled,this.techniqueConfig.hasVerticalOffset=(0,n.pC)(this.parameters.verticalOffset),this.techniqueConfig.hasScreenSizePerspective=(0,n.pC)(this.parameters.screenSizePerspective),this.techniqueConfig.hasSlicePlane=this.parameters.hasSlicePlane,this.techniqueConfig.hasSliceHighlight=this.parameters.hasSliceHighlight,this.techniqueConfig.alphaDiscardMode=this.parameters.textureAlphaMode,this.techniqueConfig.normalType="screenDerivative"===this.parameters.normals?Be.h.ScreenDerivative:Be.h.Attribute,this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.writeDepth=this.parameters.writeDepth,(0,n.pC)(this.parameters.customDepthTest)&&(this.techniqueConfig.customDepthTest=this.parameters.customDepthTest),this.techniqueConfig.hasOccludees=this.parameters.hasOccludees,this.techniqueConfig.cullFace=this.parameters.hasSlicePlane?R.Vr.None:this.parameters.cullFace,this.techniqueConfig.hasMultipassTerrain=t.multipassTerrain.enabled,this.techniqueConfig.cullAboveGround=t.multipassTerrain.cullAboveGround,this.techniqueConfig.hasModelTransformation=(0,n.pC)(this.parameters.modelTransformation),e!==Fe.H.Color&&e!==Fe.H.Alpha||(this.techniqueConfig.hasVertexColors=this.parameters.hasVertexColors,this.techniqueConfig.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this.techniqueConfig.doubleSidedMode=He.q.WindingOrder:this.techniqueConfig.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?He.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?He.q.WindingOrder:He.q.None,this.techniqueConfig.instancedColor=(0,n.pC)(this.parameters.instanced)&&this.parameters.instanced.includes("color"),this.techniqueConfig.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this.techniqueConfig.receiveAmbientOcclusion=!!t.ssaoHelper.ready&&this.parameters.receiveSSAO,this.techniqueConfig.vvColor=this.parameters.vvColorEnabled,this.techniqueConfig.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this.techniqueConfig.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Ue.f7.Schematic:Ue.f7.Normal:Ue.f7.Disabled,this.techniqueConfig.hasMetalnessAndRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this.techniqueConfig.hasEmissionTexture=!!this.parameters.emissiveTextureId,this.techniqueConfig.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this.techniqueConfig.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.enableOffset=t.camera.relativeElevation<5e5),this.techniqueConfig}intersect(e,t,r,i,o,a,s){if((0,n.pC)(this.parameters.verticalOffset)){const e=i.camera;(0,c.s)(br,r[12],r[13],r[14]);let t=null;switch(i.viewingMode){case De.JY.Global:t=(0,c.n)(Tr,br);break;case De.JY.Local:t=(0,c.c)(Tr,vr)}let n=0;const s=(0,c.b)(Ar,br,e.eye),l=(0,c.l)(s),u=(0,c.g)(s,s,1/l);let d=null;this.parameters.screenSizePerspective&&(d=(0,c.e)(t,u)),n+=(0,qt.Hx)(e,l,this.parameters.verticalOffset,d,this.parameters.screenSizePerspective),(0,c.g)(t,t,n),(0,c.t)(xr,t,i.transform.inverseRotation),o=(0,c.b)(gr,o,xr),a=(0,c.b)(_r,a,xr)}var l;(0,qt.Bw)(e,t,i,o,a,(l=i.verticalOffset,(0,n.pC)(l)?(Ft.offset=l,Ft):null),s)}requiresSlot(e){return e===(this.parameters.transparent?this.parameters.writeDepth?wt.r.TRANSPARENT_MATERIAL:wt.r.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:wt.r.OPAQUE_MATERIAL)||e===wt.r.DRAPED_MATERIAL}createGLMaterial(e){return e.output===Fe.H.Color||e.output===Fe.H.Alpha||e.output===Fe.H.Depth||e.output===Fe.H.Normal||e.output===Fe.H.Shadow||e.output===Fe.H.Highlight?new fr(e):null}createBufferWriter(){return new mr(this.vertexBufferLayout,this.instanceBufferLayout)}}class fr extends ze.F{constructor(e){super({...e,...e.material.parameters})}_updateParameters(e){const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,c.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?dr:nr,e)}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==Fe.H.Color&&this._output!==Fe.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this._updateParameters(e)}}const pr=new class extends ir{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}};class mr{constructor(e,t){this.vertexBufferLayout=e,this.instanceBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(D.T.POSITION).length}write(e,t,r,i){!function(e,t,r,i,n,o){for(const a of t.fieldNames){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)switch(a){case D.T.POSITION:{(0,w.hu)(3===t.size);const e=n.getField(a,h.ct);e&&zt(s,t.data,r,e,o);break}case D.T.NORMAL:{(0,w.hu)(3===t.size);const e=n.getField(a,h.ct);e&&Gt(s,t.data,i,e,o);break}case D.T.UV0:{(0,w.hu)(2===t.size);const e=n.getField(a,h.Eu);e&&Ht(s,t.data,e,o);break}case D.T.COLOR:{(0,w.hu)(3===t.size||4===t.size);const e=n.getField(a,h.mc);e&&Wt(s,t.data,t.size,e,o);break}case D.T.SYMBOLCOLOR:{(0,w.hu)(3===t.size||4===t.size);const e=n.getField(a,h.mc);e&&Wt(s,t.data,t.size,e,o);break}case D.T.TANGENT:{(0,w.hu)(4===t.size);const e=n.getField(a,h.ek);e&&Vt(s,t.data,i,e,o);break}}}}(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,i)}}const gr=(0,u.c)(),_r=(0,u.c)(),vr=(0,u.f)(0,0,1),Tr=(0,u.c)(),xr=(0,u.c)(),br=(0,u.c)(),Ar=(0,u.c)(),Er=A.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Sr(e){throw new b.Z("",`Request for object resource failed: ${e}`)}function Mr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Er.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Er.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Er.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Er.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Er.warn("Indexed geometries must specify faces"),i=!1;break}default:Er.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Er.warn("Geometry requires material"),i=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(Er.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Rr(e){const t=(0,d.cS)();return e.forEach((e=>{const r=e.boundingInfo;(0,n.pC)(r)&&((0,d.pp)(t,r.getBBMin()),(0,d.pp)(t,r.getBBMax()))})),t}async function Cr(e,t){const r=[];for(const i in e){const o=e[i],a=o.images[0].data;if(!a){Er.warn("Externally referenced texture data is not yet supported");continue}const s=o.encoding+";base64,"+a,l="/textureDefinitions/"+i,c="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",u={noUnpackFlip:!0,wrap:{s:$.e8.REPEAT,t:$.e8.REPEAT},preMultiplyAlpha:wr(c)!==R.JJ.Opaque},d=(0,n.pC)(t)&&t.disableTextures?Promise.resolve(null):M(s,t);r.push(d.then((e=>({refId:l,image:e,params:u,alphaChannelUsage:c}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}function wr(e){switch(e){case"mask":return R.JJ.Mask;case"maskAndTransparency":return R.JJ.MaskBlend;case"none":return R.JJ.Opaque;default:return R.JJ.Blend}}function yr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Or=new S.G(1,2,"wosr");var Pr=r(57758),Nr=r(10816),Ir=r(75488),Dr=r(56067);async function Lr(e,t){const r=Fr((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=(0,n.pC)(t)&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,x.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,E.r9)(i.error),Sr(i.error.details.url)}(e,r,t);const i=await(0,x.q6)((0,T.default)(e,(0,n.Wg)(t)));if(!0===i.ok)return i.value.data;(0,E.r9)(i.error),Sr(i.error)}(e,t);return{resource:r,textures:await Cr(r.textureDefinitions,t)}}(r.url,t)),i=function(e,t){const r=[],i=[],o=[],a=[],s=e.resource,l=S.G.parse(s.version||"1.0","wosr");Or.validate(l);const c=s.model.name,d=s.model.geometries,h=s.materialDefinitions,f=e.textures;let p=0;const m=new Map;for(let e=0;e<d.length;e++){const s=d[e];if(!Mr(s))continue;const l=yr(s),c=s.params.vertexAttributes,g=[];for(const e in c){const t=c[e],r=t.values;g.push([e,{data:r,size:t.valuesPerElement,exclusive:!0}])}const _=[];if("PerAttributeArray"!==s.params.topology){const e=s.params.faces;for(const t in e)_.push([t,new Uint32Array(e[t].values)])}const v=f&&f[l.texture];if(v&&!m.has(l.texture)){const{image:e,params:t}=v,r=new Ie(e,t);a.push(r),m.set(l.texture,r)}const T=m.get(l.texture),x=T?T.id:void 0;let b=o[l.material]?o[l.material][l.texture]:null;if(!b){const e=h[l.material.substring(l.material.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=v&&v.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,a=v?wr(v.alphaChannelUsage):void 0,s={ambient:(0,u.d)(e.diffuse),diffuse:(0,u.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:a,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:R.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!v&&!!v.params.preMultiplyAlpha};(0,n.pC)(t)&&t.materialParamsMixin&&Object.assign(s,t.materialParamsMixin),b=new hr(s),o[l.material]||(o[l.material]={}),o[l.material][l.texture]=b}i.push(b);const A=new L(g,_);p+=_.position?_.position.length:0,r.push(A)}return{name:c,stageResources:{textures:a,materials:i,geometries:r},pivotOffset:s.model.pivotOffset,boundingBox:Rr(r),numberOfVertices:p,lodThreshold:null}}(e,t);return{lods:[i],referenceBoundingBox:i.boundingBox,isEsriSymbolResource:!1,isWosr:!0,remove:e.remove}}const o=await(t.cache?t.cache.loadGLTF(r.url,t,t.usePBR):(0,_.z)(new g.C(t.streamDataRequester),r.url,t,t.usePBR)),a=(0,n.U2)(o.model.meta,"ESRI_proxyEllipsoid");o.meta.isEsriSymbolResource&&(0,n.pC)(a)&&o.meta.uri.includes("/RealisticTrees/")&&function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];e.customMeta.esriTreeRendering=!0;for(const o of i.parts){const i=o.attributes.normal;if((0,n.Wi)(i))return;const a=o.attributes.position,d=a.count,f=(0,u.c)(),p=(0,u.c)(),g=(0,u.c)(),_=(0,m.gS)(h.mc,d),v=(0,m.gS)(h.ct,d),T=(0,s.a)((0,l.c)(),o.transform);for(let n=0;n<d;n++){a.getVec(n,p),i.getVec(n,f),(0,c.m)(p,p,o.transform),(0,c.b)(g,p,t.center),(0,c.E)(g,g,t.radius);const s=g[2],l=(0,c.l)(g),u=Math.min(.45+.55*l*l,1);(0,c.E)(g,g,t.radius),(0,c.m)(g,g,T),(0,c.n)(g,g),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.h)(g,g,f,s>-1?.2:Math.min(-4*s-3.8,1)),v.setVec(n,g),_.set(n,0,255*u),_.set(n,1,255*u),_.set(n,2,255*u),_.set(n,3,255)}o.attributes.normal=v,o.attributes.color=_}}}(o,a);const d=o.meta.isEsriSymbolResource?{usePBR:t.usePBR,isSchematic:!1,treeRendering:!!o.customMeta.esriTreeRendering,mrrFactors:[0,1,.2]}:{usePBR:t.usePBR,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},f={...t.materialParamsMixin,treeRendering:!!o.customMeta.esriTreeRendering};if(null!=r.specifiedLodIndex){const e=Br(o,d,f,r.specifiedLodIndex);let t=e[0].boundingBox;return 0!==r.specifiedLodIndex&&(t=Br(o,d,f,0)[0].boundingBox),{lods:e,referenceBoundingBox:t,isEsriSymbolResource:o.meta.isEsriSymbolResource,isWosr:!1,remove:o.remove}}const p=Br(o,d,f);return{lods:p,referenceBoundingBox:p[0].boundingBox,isEsriSymbolResource:o.meta.isEsriSymbolResource,isWosr:!1,remove:o.remove}}function Fr(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function Br(e,t,r,i){const s=e.model,l=(0,a.c)(),c=new Array,u=new Map,g=new Map;return s.lods.forEach(((e,a)=>{if(void 0!==i&&a!==i)return;const _={name:e.name,stageResources:{textures:new Array,materials:new Array,geometries:new Array},lodThreshold:(0,n.pC)(e.lodThreshold)?e.lodThreshold:null,pivotOffset:[0,0,0],numberOfVertices:0,boundingBox:(0,d.cS)()};c.push(_),e.parts.forEach((e=>{const i=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),a=s.materials.get(e.material),c=(0,n.pC)(e.attributes.texCoord0),T=(0,n.pC)(e.attributes.normal),x=function(e){switch(e){case"BLEND":return R.JJ.Blend;case"MASK":return R.JJ.Mask;case"OPAQUE":case null:case void 0:return R.JJ.Opaque}}(a.alphaMode);if(!u.has(i)){if(c){if((0,n.pC)(a.textureColor)&&!g.has(a.textureColor)){const e=s.textures.get(a.textureColor),t={...e.parameters,preMultiplyAlpha:x!==R.JJ.Opaque};g.set(a.textureColor,new Ie(e.data,t))}if((0,n.pC)(a.textureNormal)&&!g.has(a.textureNormal)){const e=s.textures.get(a.textureNormal);g.set(a.textureNormal,new Ie(e.data,e.parameters))}if((0,n.pC)(a.textureOcclusion)&&!g.has(a.textureOcclusion)){const e=s.textures.get(a.textureOcclusion);g.set(a.textureOcclusion,new Ie(e.data,e.parameters))}if((0,n.pC)(a.textureEmissive)&&!g.has(a.textureEmissive)){const e=s.textures.get(a.textureEmissive);g.set(a.textureEmissive,new Ie(e.data,e.parameters))}if((0,n.pC)(a.textureMetallicRoughness)&&!g.has(a.textureMetallicRoughness)){const e=s.textures.get(a.textureMetallicRoughness);g.set(a.textureMetallicRoughness,new Ie(e.data,e.parameters))}}const o=a.color[0]**(1/Pr.K),l=a.color[1]**(1/Pr.K),d=a.color[2]**(1/Pr.K),h=a.emissiveFactor[0]**(1/Pr.K),f=a.emissiveFactor[1]**(1/Pr.K),p=a.emissiveFactor[2]**(1/Pr.K),m=(0,n.pC)(a.textureColor)&&c?g.get(a.textureColor):null;u.set(i,new hr({...t,transparent:x===R.JJ.Blend,customDepthTest:R.Gv.Lequal,textureAlphaMode:x,textureAlphaCutoff:a.alphaCutoff,diffuse:[o,l,d],ambient:[o,l,d],opacity:a.opacity,doubleSided:a.doubleSided,doubleSidedType:"winding-order",cullFace:a.doubleSided?R.Vr.None:R.Vr.Back,hasVertexColors:!!e.attributes.color,hasVertexTangents:!!e.attributes.tangent,normals:T?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,textureId:(0,n.pC)(m)?m.id:void 0,colorMixMode:a.colorMixMode,normalTextureId:(0,n.pC)(a.textureNormal)&&c?g.get(a.textureNormal).id:void 0,textureAlphaPremultiplied:(0,n.pC)(m)&&!!m.params.preMultiplyAlpha,occlusionTextureId:(0,n.pC)(a.textureOcclusion)&&c?g.get(a.textureOcclusion).id:void 0,emissiveTextureId:(0,n.pC)(a.textureEmissive)&&c?g.get(a.textureEmissive).id:void 0,metallicRoughnessTextureId:(0,n.pC)(a.textureMetallicRoughness)&&c?g.get(a.textureMetallicRoughness).id:void 0,emissiveFactor:[h,f,p],mrrFactors:[a.metallicFactor,a.roughnessFactor,t.mrrFactors[2]],isSchematic:!1,...r}))}const b=function(e,t){switch(t){case $.MX.TRIANGLES:return(0,v.nh)(e);case $.MX.TRIANGLE_STRIP:return(0,v.DA)(e);case $.MX.TRIANGLE_FAN:return(0,v.jX)(e)}}(e.indices||e.attributes.position.count,e.primitiveType),A=e.attributes.position.count,E=(0,m.gS)(h.ct,A);(0,f.t)(E,e.attributes.position,e.transform);const S=[[D.T.POSITION,{data:E.typedBuffer,size:E.elementCount,exclusive:!0}]],M=[[D.T.POSITION,b]];if((0,n.pC)(e.attributes.normal)){const t=(0,m.gS)(h.ct,A);(0,o.a)(l,e.transform),(0,f.a)(t,e.attributes.normal,l),S.push([D.T.NORMAL,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([D.T.NORMAL,b])}if((0,n.pC)(e.attributes.tangent)){const t=(0,m.gS)(h.ek,A);(0,o.a)(l,e.transform),(0,p.t)(t,e.attributes.tangent,l),S.push([D.T.TANGENT,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([D.T.TANGENT,b])}if((0,n.pC)(e.attributes.texCoord0)){const t=(0,m.gS)(h.Eu,A);(0,Nr.n)(t,e.attributes.texCoord0),S.push([D.T.UV0,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([D.T.UV0,b])}if((0,n.pC)(e.attributes.color)){const t=(0,m.gS)(h.mc,A);if(4===e.attributes.color.elementCount)e.attributes.color instanceof h.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof h.mc?(0,Ir.c)(t,e.attributes.color):e.attributes.color instanceof h.v6&&(0,p.s)(t,e.attributes.color,1/256);else{(0,Ir.f)(t,255,255,255,255);const r=new h.ne(t.buffer,0,4);e.attributes.color instanceof h.ct?(0,f.s)(r,e.attributes.color,255):e.attributes.color instanceof h.ne?(0,Dr.c)(r,e.attributes.color):e.attributes.color instanceof h.mw&&(0,f.s)(r,e.attributes.color,1/256)}S.push([D.T.COLOR,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([D.T.COLOR,b])}const C=new L(S,M);_.stageResources.geometries.push(C),_.stageResources.materials.push(u.get(i)),c&&((0,n.pC)(a.textureColor)&&_.stageResources.textures.push(g.get(a.textureColor)),(0,n.pC)(a.textureNormal)&&_.stageResources.textures.push(g.get(a.textureNormal)),(0,n.pC)(a.textureOcclusion)&&_.stageResources.textures.push(g.get(a.textureOcclusion)),(0,n.pC)(a.textureEmissive)&&_.stageResources.textures.push(g.get(a.textureEmissive)),(0,n.pC)(a.textureMetallicRoughness)&&_.stageResources.textures.push(g.get(a.textureMetallicRoughness))),_.numberOfVertices+=A;const w=C.boundingInfo;(0,n.pC)(w)&&((0,d.pp)(_.boundingBox,w.getBBMin()),(0,d.pp)(_.boundingBox,w.getBBMax()))}))})),c}},6206:(e,t,r)=>{var i,n;r.d(t,{a9:()=>i}),r(22021),(n=i||(i={}))[n.Multiply=1]="Multiply",n[n.Ignore=2]="Ignore",n[n.Replace=3]="Replace",n[n.Tint=4]="Tint"},65576:(e,t,r)=>{r.d(t,{U$:()=>s});var i=r(56481),n=r(79583);class o{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fieldNames){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new o(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t,r,i){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}}}class a{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(e,t){return this._appendField(e,i.Eu,t),this}vec2f64(e,t){return this._appendField(e,i.q6,t),this}vec3f(e,t){return this._appendField(e,i.ct,t),this}vec3f64(e,t){return this._appendField(e,i.fP,t),this}vec4f(e,t){return this._appendField(e,i.ek,t),this}vec4f64(e,t){return this._appendField(e,i.Cd,t),this}mat3f(e,t){return this._appendField(e,i.gK,t),this}mat3f64(e,t){return this._appendField(e,i.ey,t),this}mat4f(e,t){return this._appendField(e,i.bj,t),this}mat4f64(e,t){return this._appendField(e,i.O1,t),this}vec4u8(e,t){return this._appendField(e,i.mc,t),this}f32(e,t){return this._appendField(e,i.ly,t),this}f64(e,t){return this._appendField(e,i.oS,t),this}u8(e,t){return this._appendField(e,i.D_,t),this}u16(e,t){return this._appendField(e,i.av,t),this}i8(e,t){return this._appendField(e,i.Hz,t),this}vec2i8(e,t){return this._appendField(e,i.Vs,t),this}vec2i16(e,t){return this._appendField(e,i.or,t),this}vec2u8(e,t){return this._appendField(e,i.xA,t),this}vec4u16(e,t){return this._appendField(e,i.v6,t),this}u32(e,t){return this._appendField(e,i.Nu,t),this}_appendField(e,t,r){const i=t.ElementCount*(0,n.n1)(t.ElementType),o=this.stride;this.fields.set(e,{size:i,constructor:t,offset:o,optional:r}),this.stride+=i,this.fieldNames.push(e)}alignTo(e){return this.stride=Math.floor((this.stride+e-1)/e)*e,this}hasField(e){return this.fieldNames.includes(e)}createBuffer(e){return new o(this,e)}createView(e){return new o(this,e)}clone(){const e=new a;return e.stride=this.stride,e.fields=new Map,this.fields.forEach(((t,r)=>e.fields.set(r,t))),e.fieldNames=this.fieldNames.slice(),e.BufferType=this.BufferType,e}}function s(){return new a}},1391:(e,t,r)=>{r.d(t,{q:()=>s});var i=r(18361),n=r(2095),o=r(19693),a=r(74709);function s(e,t){t.output===i.H.Color&&t.receiveShadows?(e.varyings.add("linearDepth","float"),e.vertex.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`)):t.output===i.H.Depth||t.output===i.H.Shadow?(e.include(n.up,t),e.varyings.add("linearDepth","float"),e.vertex.uniforms.add(new o.A("nearFar",((e,t)=>t.camera.nearFar))),e.vertex.code.add(a.H`void forwardLinearDepth() {
159
+ `)),t.include(m.s,e),t}const H=Object.freeze(Object.defineProperty({__proto__:null,build:B},Symbol.toStringTag,{value:"Module"}))},21787:(e,t,r)=>{r.d(t,{a:()=>s,f:()=>n,i:()=>c,t:()=>o});var i=r(46851);function n(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function o(e,t){if(e===t){const r=t[1],i=t[2],n=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=n}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function a(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],f=r[1],p=r[2],m=r[3],g=r[4],_=r[5],v=r[6],T=r[7],x=r[8];return e[0]=h*i+f*a+p*c,e[1]=h*n+f*s+p*u,e[2]=h*o+f*l+p*d,e[3]=m*i+g*a+_*c,e[4]=m*n+g*s+_*u,e[5]=m*o+g*l+_*d,e[6]=v*i+T*a+x*c,e[7]=v*n+T*s+x*u,e[8]=v*o+T*l+x*d,e}function s(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15],v=r*s-i*a,T=r*l-n*a,x=r*c-o*a,b=i*l-n*s,A=i*c-o*s,E=n*c-o*l,S=u*m-d*p,M=u*g-h*p,R=u*_-f*p,C=d*g-h*m,w=d*_-f*m,y=h*_-f*g;let O=v*y-T*w+x*C+b*R-A*M+E*S;return O?(O=1/O,e[0]=(s*y-l*w+c*C)*O,e[1]=(l*R-a*y-c*M)*O,e[2]=(a*w-s*R+c*S)*O,e[3]=(n*w-i*y-o*C)*O,e[4]=(r*y-n*R+o*M)*O,e[5]=(i*R-r*w-o*S)*O,e[6]=(m*E-g*A+_*b)*O,e[7]=(g*x-p*E-_*T)*O,e[8]=(p*A-m*x+_*v)*O,e):null}function l(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function c(e){const t=i.E,r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8];return Math.abs(1-(r*r+a*a+c*c))<=t&&Math.abs(1-(n*n+s*s+u*u))<=t&&Math.abs(1-(o*o+l*l+d*d))<=t}const u=a,d=l;Object.freeze(Object.defineProperty({__proto__:null,fromMat4:n,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},set:function(e,t,r,i,n,o,a,s,l,c){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:o,invert:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=u*a-s*c,h=-u*o+s*l,f=c*o-a*l;let p=r*d+i*h+n*f;return p?(p=1/p,e[0]=d*p,e[1]=(-u*i+n*c)*p,e[2]=(s*i-n*a)*p,e[3]=h*p,e[4]=(u*r-n*l)*p,e[5]=(-s*r+n*o)*p,e[6]=f*p,e[7]=(-c*r+i*l)*p,e[8]=(a*r-i*o)*p,e):null},adjoint:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=a*u-s*c,e[1]=n*c-i*u,e[2]=i*s-n*a,e[3]=s*l-o*u,e[4]=r*u-n*l,e[5]=n*o-r*s,e[6]=o*c-a*l,e[7]=i*l-r*c,e[8]=r*a-i*o,e},determinant:function(e){const t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*(c*o-a*l)+r*(-c*n+a*s)+i*(l*n-o*s)},multiply:a,translate:function(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],f=r[1];return e[0]=i,e[1]=n,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=h*i+f*a+c,e[7]=h*n+f*s+u,e[8]=h*o+f*l+d,e},rotate:function(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=Math.sin(r),f=Math.cos(r);return e[0]=f*i+h*a,e[1]=f*n+h*s,e[2]=f*o+h*l,e[3]=f*a-h*i,e[4]=f*s-h*n,e[5]=f*l-h*o,e[6]=c,e[7]=u,e[8]=d,e},scale:function(e,t,r){const i=r[0],n=r[1],o=r[2];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e[6]=o*t[6],e[7]=o*t[7],e[8]=o*t[8],e},scaleByVec2:function(e,t,r){const i=r[0],n=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},fromRotation:function(e,t){const r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromQuat:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=r+r,s=i+i,l=n+n,c=r*a,u=i*a,d=i*s,h=n*a,f=n*s,p=n*l,m=o*a,g=o*s,_=o*l;return e[0]=1-d-p,e[3]=u-_,e[6]=h+g,e[1]=u+_,e[4]=1-c-p,e[7]=f-m,e[2]=h-g,e[5]=f+m,e[8]=1-c-d,e},normalFromMat4Legacy:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[4],a=t[5],s=t[6],l=t[8],c=t[9],u=t[10],d=u*a-s*c,h=-u*o+s*l,f=c*o-a*l,p=r*d+i*h+n*f;if(!p)return null;const m=1/p;return e[0]=d*m,e[1]=(-u*i+n*c)*m,e[2]=(s*i-n*a)*m,e[3]=h*m,e[4]=(u*r-n*l)*m,e[5]=(-s*r+n*o)*m,e[6]=f*m,e[7]=(-c*r+i*l)*m,e[8]=(a*r-i*o)*m,e},normalFromMat4:s,projection:function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},subtract:l,multiplyScalar:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},multiplyScalarAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},equals:function(e,t){const r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=t[0],f=t[1],p=t[2],m=t[3],g=t[4],_=t[5],v=t[6],T=t[7],x=t[8];return Math.abs(r-h)<=i.E*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-f)<=i.E*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(o-p)<=i.E*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=i.E*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(s-g)<=i.E*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-_)<=i.E*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(c-v)<=i.E*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(u-T)<=i.E*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(d-x)<=i.E*Math.max(1,Math.abs(d),Math.abs(x))},isOrthoNormal:c,mul:u,sub:d},Symbol.toStringTag,{value:"Module"}))},46521:(e,t,r)=>{function i(){return[1,0,0,0,1,0,0,0,1]}function n(e,t){return new Float64Array(e,t,9)}r.d(t,{a:()=>n,c:()=>i}),Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},fromValues:function(e,t,r,i,n,o,a,s,l){return[e,t,r,i,n,o,a,s,l]},createView:n},Symbol.toStringTag,{value:"Module"}))},13598:(e,t,r)=>{function i(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function n(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}function o(e,t){return new Float64Array(e,t,16)}r.d(t,{I:()=>a,a:()=>o,b:()=>n,c:()=>i});const a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:n,fromValues:function(e,t,r,i,n,o,a,s,l,c,u,d,h,f,p,m){return[e,t,r,i,n,o,a,s,l,c,u,d,h,f,p,m]},createView:o,IDENTITY:a},Symbol.toStringTag,{value:"Module"}))},51305:(e,t,r)=>{r.d(t,{c:()=>f,g:()=>u,j:()=>w,k:()=>m,m:()=>d,s:()=>c});var i=r(46521),n=r(94961),o=r(65617),a=r(46851),s=r(17896),l=r(98766);function c(e,t,r){r*=.5;const i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function u(e,t){const r=2*Math.acos(t[3]),i=Math.sin(r/2);return i>a.E?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r}function d(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3],s=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+a*s+n*c-o*l,e[1]=n*u+a*l+o*s-i*c,e[2]=o*u+a*c+i*l-n*s,e[3]=a*u-i*s-n*l-o*c,e}function h(e,t,r,i){const n=t[0],o=t[1],s=t[2],l=t[3];let c,u,d,h,f,p=r[0],m=r[1],g=r[2],_=r[3];return u=n*p+o*m+s*g+l*_,u<0&&(u=-u,p=-p,m=-m,g=-g,_=-_),1-u>a.E?(c=Math.acos(u),d=Math.sin(c),h=Math.sin((1-i)*c)/d,f=Math.sin(i*c)/d):(h=1-i,f=i),e[0]=h*n+f*p,e[1]=h*o+f*m,e[2]=h*s+f*g,e[3]=h*l+f*_,e}function f(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function p(e,t){const r=t[0]+t[4]+t[8];let i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const n=(r+1)%3,o=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*n+n]-t[3*o+o]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*n+o]-t[3*o+n])*i,e[n]=(t[3*n+r]+t[3*r+n])*i,e[o]=(t[3*o+r]+t[3*r+o])*i}return e}function m(e,t,r,i){const n=.5*Math.PI/180;t*=n,r*=n,i*=n;const o=Math.sin(t),a=Math.cos(t),s=Math.sin(r),l=Math.cos(r),c=Math.sin(i),u=Math.cos(i);return e[0]=o*l*u-a*s*c,e[1]=a*s*u+o*l*c,e[2]=a*l*c-o*s*u,e[3]=a*l*u+o*s*c,e}const g=l.c,_=l.s,v=l.a,T=d,x=l.b,b=l.d,A=l.l,E=l.e,S=E,M=l.f,R=M,C=l.n,w=l.g,y=l.h,O=(0,o.c)(),P=(0,o.f)(1,0,0),N=(0,o.f)(0,1,0),I=(0,n.a)(),D=(0,n.a)(),L=(0,i.c)();Object.freeze(Object.defineProperty({__proto__:null,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},setAxisAngle:c,getAxisAngle:u,multiply:d,rotateX:function(e,t,r){r*=.5;const i=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+a*s,e[1]=n*l+o*s,e[2]=o*l-n*s,e[3]=a*l-i*s,e},rotateY:function(e,t,r){r*=.5;const i=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l-o*s,e[1]=n*l+a*s,e[2]=o*l+i*s,e[3]=a*l-n*s,e},rotateZ:function(e,t,r){r*=.5;const i=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+n*s,e[1]=n*l-i*s,e[2]=o*l+a*s,e[3]=a*l-o*s,e},calculateW:function(e,t){const r=t[0],i=t[1],n=t[2];return e[0]=r,e[1]=i,e[2]=n,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),e},slerp:h,random:function(e){const t=(0,a.R)(),r=(0,a.R)(),i=(0,a.R)(),n=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=n*Math.sin(2*Math.PI*r),e[1]=n*Math.cos(2*Math.PI*r),e[2]=o*Math.sin(2*Math.PI*i),e[3]=o*Math.cos(2*Math.PI*i),e},invert:function(e,t){const r=t[0],i=t[1],n=t[2],o=t[3],a=r*r+i*i+n*n+o*o,s=a?1/a:0;return e[0]=-r*s,e[1]=-i*s,e[2]=-n*s,e[3]=o*s,e},conjugate:f,fromMat3:p,fromEuler:m,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},copy:g,set:_,add:v,mul:T,scale:x,dot:b,lerp:A,length:E,len:S,squaredLength:M,sqrLen:R,normalize:C,exactEquals:w,equals:y,rotationTo:function(e,t,r){const i=(0,s.e)(t,r);return i<-.999999?((0,s.f)(O,P,t),(0,s.u)(O)<1e-6&&(0,s.f)(O,N,t),(0,s.n)(O,O),c(e,O,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,s.f)(O,t,r),e[0]=O[0],e[1]=O[1],e[2]=O[2],e[3]=1+i,C(e,e))},sqlerp:function(e,t,r,i,n,o){return h(I,t,n,o),h(D,r,i,o),h(e,I,D,2*o*(1-o)),e},setAxes:function(e,t,r,i){const n=L;return n[0]=r[0],n[3]=r[1],n[6]=r[2],n[1]=i[0],n[4]=i[1],n[7]=i[2],n[2]=-t[0],n[5]=-t[1],n[8]=-t[2],C(e,p(e,n))}},Symbol.toStringTag,{value:"Module"}))},94961:(e,t,r)=>{function i(){return[0,0,0,1]}function n(e){return[e[0],e[1],e[2],e[3]]}function o(e,t){return new Float64Array(e,t,4)}r.d(t,{I:()=>a,a:()=>i,b:()=>n,c:()=>o});const a=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:n,fromValues:function(e,t,r,i){return[e,t,r,i]},createView:o,IDENTITY:a},Symbol.toStringTag,{value:"Module"}))},2643:(e,t,r)=>{r.d(t,{b:()=>_,c:()=>g,d:()=>v,g:()=>T,i:()=>A,m:()=>y}),r(80442);var i,n,o=r(92604),a=r(22021),s=r(70586),l=r(52138),c=r(17896),u=r(65617),d=r(98766),h=r(88669);(n=i||(i={}))[n.X=0]="X",n[n.Y=1]="Y",n[n.Z=2]="Z";var f=r(78341);(0,u.c)(),(0,u.c)();var p=r(12981);const m=o.Z.getLogger("esri.geometry.support.sphere");function g(){return(0,h.c)()}function _(e,t=g()){return(0,d.c)(t,e)}function v(e){return e[3]}function T(e){return e}function x(e,t,r){if((0,s.Wi)(t))return!1;const{origin:i,direction:n}=t,o=b;o[0]=i[0]-e[0],o[1]=i[1]-e[1],o[2]=i[2]-e[2];const a=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],l=2*(n[0]*o[0]+n[1]*o[1]+n[2]*o[2]),c=l*l-4*a*(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]-e[3]*e[3]);if(c<0)return!1;const u=Math.sqrt(c);let d=(-l-u)/(2*a);const h=(-l+u)/(2*a);return(d<0||h<d&&h>0)&&(d=h),!(d<0||(r&&(r[0]=i[0]+n[0]*d,r[1]=i[1]+n[1]*d,r[2]=i[2]+n[2]*d),0))}const b=(0,u.c)();function A(e,t){return x(e,t,null)}function E(e,t,r){const i=p.WM.get(),n=p.MP.get();(0,c.f)(i,t.origin,t.direction);const o=v(e);(0,c.f)(r,i,t.origin),(0,c.g)(r,r,1/(0,c.l)(r)*o);const s=M(e,t.origin),u=function(e,t){const r=(0,c.e)(e,t)/((0,c.l)(e)*(0,c.l)(t));return-(0,a.ZF)(r)}(t.origin,r);return(0,l.d)(n,u+s,i),(0,c.m)(r,r,n),r}function S(e,t,r){const i=(0,c.b)(p.WM.get(),t,e),n=(0,c.g)(p.WM.get(),i,e[3]/(0,c.l)(i));return(0,c.a)(r,n,e)}function M(e,t){const r=(0,c.b)(p.WM.get(),t,e),i=(0,c.l)(r),n=v(e),o=n+Math.abs(n-i);return(0,a.ZF)(n/o)}const R=(0,u.c)();function C(e,t,r,n){const o=(0,c.b)(R,t,e);switch(r){case i.X:{const e=(0,a.jE)(o,R)[2];return(0,c.s)(n,-Math.sin(e),Math.cos(e),0)}case i.Y:{const e=(0,a.jE)(o,R),t=e[1],r=e[2],i=Math.sin(t);return(0,c.s)(n,-i*Math.cos(r),-i*Math.sin(r),Math.cos(t))}case i.Z:return(0,c.n)(n,o);default:return}}function w(e,t){const r=(0,c.b)(O,t,e);return(0,c.l)(r)-e[3]}function y(e,t){const r=(0,c.d)(e,t),i=v(e);return r<=i*i}const O=(0,u.c)(),P=g();Object.freeze(Object.defineProperty({__proto__:null,create:g,copy:_,fromCenterAndRadius:function(e,t){return(0,h.f)(e[0],e[1],e[2],t)},wrap:function(e){return e},clear:function(e){e[0]=e[1]=e[2]=e[3]=0},fromRadius:function(e,t){return e[0]=e[1]=e[2]=0,e[3]=t,e},getRadius:v,getCenter:T,fromValues:function(e,t,r,i){return(0,h.f)(e,t,r,i)},elevate:function(e,t,r){return e!==r&&(0,c.c)(r,e),r[3]=e[3]+t,r},setExtent:function(e,t,r){return m.error("sphere.setExtent is not yet supported"),e===r?r:_(e,r)},intersectRay:x,intersectsRay:A,intersectRayClosestSilhouette:function(e,t,r){if(x(e,t,r))return r;const i=E(e,t,p.WM.get());return(0,c.a)(r,t.origin,(0,c.g)(p.WM.get(),t.direction,(0,c.i)(t.origin,i)/(0,c.l)(t.direction))),r},closestPointOnSilhouette:E,closestPoint:function(e,t,r){return x(e,t,r)?r:((0,f.JI)(t,e,r),S(e,r,r))},projectPoint:S,distanceToSilhouette:function(e,t){const r=(0,c.b)(p.WM.get(),t,e),i=(0,c.p)(r),n=e[3]*e[3];return Math.sqrt(Math.abs(i-n))},angleToSilhouette:M,axisAt:C,altitudeAt:w,setAltitudeAt:function(e,t,r,n){const o=w(e,t),a=C(e,t,i.Z,O),s=(0,c.g)(O,a,r-o);return(0,c.a)(n,t,s)},containsPoint:y,tmpSphere:P},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>o,b:()=>l,n:()=>s,s:()=>a,t:()=>n});var i=r(72220);function n(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const n=e.count,o=r[0],a=r[1],s=r[2],l=r[4],c=r[5],u=r[6],d=r[8],h=r[9],f=r[10],p=r[12],m=r[13],g=r[14],_=e.typedBuffer,v=e.typedBufferStride,T=t.typedBuffer,x=t.typedBufferStride;for(let e=0;e<n;e++){const t=e*v,r=e*x,i=T[r],n=T[r+1],b=T[r+2];_[t]=o*i+l*n+d*b+p,_[t+1]=a*i+c*n+h*b+m,_[t+2]=s*i+u*n+f*b+g}}function o(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const n=e.count,o=r[0],a=r[1],s=r[2],l=r[3],c=r[4],u=r[5],d=r[6],h=r[7],f=r[8],p=e.typedBuffer,m=e.typedBufferStride,g=t.typedBuffer,_=t.typedBufferStride;for(let e=0;e<n;e++){const t=e*m,r=e*_,i=g[r],n=g[r+1],v=g[r+2];p[t]=o*i+l*n+d*v,p[t+1]=a*i+c*n+h*v,p[t+2]=s*i+u*n+f*v}}function a(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*o,i=e*s;n[t]=r*a[i],n[t+1]=r*a[i+1],n[t+2]=r*a[i+2]}}function s(e,t){const r=Math.min(e.count,t.count),i=e.typedBuffer,n=e.typedBufferStride,o=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*n,r=e*a,s=o[r],l=o[r+1],c=o[r+2],u=s*s+l*l+c*c;if(u>0){const e=1/Math.sqrt(u);i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function l(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*o,i=e*s;n[t]=a[i]>>r,n[t+1]=a[i+1]>>r,n[t+2]=a[i+2]>>r}}Object.freeze(Object.defineProperty({__proto__:null,transformMat4:n,transformMat3:o,scale:a,normalize:s,shiftRight:l},Symbol.toStringTag,{value:"Module"}))},56067:(e,t,r)=>{function i(e,t,r){const i=e.typedBuffer,n=e.typedBufferStride,o=t.typedBuffer,a=t.typedBufferStride,s=r?r.count:t.count;let l=(r&&r.dstIndex?r.dstIndex:0)*n,c=(r&&r.srcIndex?r.srcIndex:0)*a;for(let e=0;e<s;++e)i[l]=o[c],i[l+1]=o[c+1],i[l+2]=o[c+2],l+=n,c+=a}function n(e,t,r,i,n){const o=e.typedBuffer,a=e.typedBufferStride,s=n?.count??e.count;let l=(n?.dstIndex??0)*a;for(let e=0;e<s;++e)o[l]=t,o[l+1]=r,o[l+2]=i,l+=a}r.d(t,{c:()=>i,f:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,copy:i,fill:n},Symbol.toStringTag,{value:"Module"}))},72119:(e,t,r)=>{function i(){return new Float32Array(3)}function n(e,t,r){const i=new Float32Array(3);return i[0]=e,i[1]=t,i[2]=r,i}function o(){return i()}function a(){return n(1,1,1)}function s(){return n(1,0,0)}function l(){return n(0,1,0)}function c(){return n(0,0,1)}r.d(t,{c:()=>i,f:()=>n});const u=o(),d=a(),h=s(),f=l(),p=c();Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:n,createView:function(e,t){return new Float32Array(e,t,3)},zeros:o,ones:a,unitX:s,unitY:l,unitZ:c,ZEROS:u,ONES:d,UNIT_X:h,UNIT_Y:f,UNIT_Z:p},Symbol.toStringTag,{value:"Module"}))},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function n(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(o)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>n});const o=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,o,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},78341:(e,t,r)=>{r.d(t,{JI:()=>l,Ue:()=>a,re:()=>s}),r(67676);var i=r(22807),n=r(17896),o=r(65617);function a(e){return e?{origin:(0,o.a)(e.origin),direction:(0,o.a)(e.direction)}:{origin:(0,o.c)(),direction:(0,o.c)()}}function s(e,t){const r=c.get();return r.origin=e,r.direction=t,r}function l(e,t,r){const i=(0,n.e)(e.direction,(0,n.b)(r,t,e.origin));return(0,n.a)(r,e.origin,(0,n.g)(r,e.direction,i)),r}r(12981);const c=new i.x((function(){return{origin:null,direction:null}}))},90751:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>Br,gltfToEngineResources:()=>Ur,parseUrl:()=>Hr});var i=r(32243),n=r(70586),o=r(21787),a=r(46521),s=r(52138),l=r(13598),c=r(17896),u=r(65617),d=r(60437),h=r(56481),f=r(20773),p=r(11077),m=r(8323),g=r(40270),_=r(88246),v=r(91911),T=r(3172),x=r(66643),b=r(20102),A=r(92604),E=r(95330),S=r(23670);async function M(e,t){const{data:r}=await(0,T.default)(e,{responseType:"image",...t});return r}var R=r(47026),C=r(44553),w=r(11726);class y{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this.center=(0,u.c)(),(0,w.hu)(e.length>=1),(0,w.hu)(r.length%this._numIndexPerPrimitive==0),(0,w.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,w.hu)(3===i.size||4===i.size);const{data:n,size:o}=i,a=e.length;let s=o*r[this._numIndexPerPrimitive*e[0]];O.clear(),O.push(s),this.bbMin=(0,u.f)(n[s],n[s+1],n[s+2]),this.bbMax=(0,u.a)(this.bbMin);for(let t=0;t<a;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=o*r[i+e],O.push(s);let t=n[s];this.bbMin[0]=Math.min(t,this.bbMin[0]),this.bbMax[0]=Math.max(t,this.bbMax[0]),t=n[s+1],this.bbMin[1]=Math.min(t,this.bbMin[1]),this.bbMax[1]=Math.max(t,this.bbMax[1]),t=n[s+2],this.bbMin[2]=Math.min(t,this.bbMin[2]),this.bbMax[2]=Math.max(t,this.bbMax[2])}}(0,c.h)(this.center,this.bbMin,this.bbMax,.5),this.radius=.5*Math.max(Math.max(this.bbMax[0]-this.bbMin[0],this.bbMax[1]-this.bbMin[1]),this.bbMax[2]-this.bbMin[2]);let l=this.radius*this.radius;for(let e=0;e<O.length;++e){s=O.getItemAt(e);const t=n[s]-this.center[0],r=n[s+1]-this.center[1],i=n[s+2]-this.center[2],o=t*t+r*r+i*i;if(o<=l)continue;const a=Math.sqrt(o),c=.5*(a-this.radius);this.radius=this.radius+c,l=this.radius*this.radius;const u=c/a;this.center[0]+=t*u,this.center[1]+=r*u,this.center[2]+=i*u}O.clear()}getCenter(){return this.center}getBSRadius(){return this.radius}getBBMin(){return this.bbMin}getBBMax(){return this.bbMax}getChildren(){if(this._children)return this._children;if((0,c.d)(this.bbMin,this.bbMax)>1){const e=(0,c.h)((0,u.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:n,size:o}=this.position;for(let a=0;a<t;++a){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=o*this.indices[s],c=n[l],u=n[l+1],d=n[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=o*this.indices[s+e];const t=n[l],r=n[l+1],i=n[l+2];t<c&&(c=t),r<u&&(u=r),i<d&&(d=i)}c<e[0]&&(t|=1),u<e[1]&&(t|=2),d<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array(8);for(let e=0;e<8;++e)void 0!==s[e]&&(this._children[e]=new y(s[e],this._numIndexPerPrimitive,this.indices,this.position))}return this._children}static prune(){O.prune()}}const O=new C.Z({deallocator:null});var P=r(17662),N=r(4726),I=r(17753),D=r(35065);class L extends P.c{constructor(e,t=[],r=R.MX.Triangle,i=-1){super(),this._primitiveType=r,this.edgeIndicesLength=i,this.type=N.U.Geometry,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[t,r]of e)r&&this._vertexAttributes.set(t,{...r});if(null==t||0===t.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,I.p)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,r]of t)r&&(this._indices.set(e,F(r)),e===D.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}cloneShallow(){const e=new L([],void 0,this._primitiveType,void 0),{_vertexAttributes:t,_indices:r}=e;return this._vertexAttributes.forEach(((e,r)=>{t.set(r,e)})),this._indices.forEach(((e,t)=>{r.set(t,e)})),e.screenToWorldRatio=this.screenToWorldRatio,e._boundingInfo=this._boundingInfo,e}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){const t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t.data=Array.from(t.data),t.exclusive=!0),t}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get primitiveType(){return this._primitiveType}get faceCount(){return this.indexCount/3}get boundingInfo(){return(0,n.Wi)(this._boundingInfo)&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return this.primitiveType===R.MX.Triangle?this._computeAttachmentOriginTriangles(e):this._computeAttachmentOriginPoints(e)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(D.T.POSITION),r=this.vertexAttributes.get(D.T.POSITION);return(0,I.cM)(r,t,e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(D.T.POSITION),r=this.vertexAttributes.get(D.T.POSITION);return(0,I.NO)(r,t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(D.T.POSITION);if(0===e.length)return null;const t=this.primitiveType===R.MX.Triangle?3:1;(0,w.hu)(e.length%t==0,"Indexing error: "+e.length+" not divisible by "+t);const r=(0,I.p)(e.length/t),i=this.vertexAttributes.get(D.T.POSITION);return new y(r,t,e,i)}}function F(e){if(e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT)return e;for(const t of e)if(t>=65536)return e;return new Uint16Array(e)}var B=r(74085),H=r(32448),U=r(22021),z=r(1533),G=r(17452),V=r(85958),W=r(99880);let q;var k;!function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"}(k||(k={}));var $=r(35371),X=r(75656);function j(e,t,r,i,n=0){const o=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);void 0===r&&console.error(`There is no location for vertex attribute '${e.name}' defined.`);const i=n*e.stride;if(e.count<=4)o.vertexAttribPointer(r,e.count,e.type,e.normalized,e.stride,e.offset+i),o.enableVertexAttribArray(r),e.divisor>0&&a&&a.vertexAttribDivisor(r,e.divisor);else if(9===e.count)for(let t=0;t<3;t++)o.vertexAttribPointer(r+t,3,e.type,e.normalized,e.stride,e.offset+12*t+i),o.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else if(16===e.count)for(let t=0;t<4;t++)o.vertexAttribPointer(r+t,4,e.type,e.normalized,e.stride,e.offset+16*t+i),o.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else console.error("Unsupported vertex attribute element count: "+e.count)}}function J(e,t,r,i){const n=e.gl,o=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);if(e.count<=4)n.disableVertexAttribArray(r),e.divisor&&e.divisor>0&&o&&o.vertexAttribDivisor(r,0);else if(9===e.count)for(let t=0;t<3;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&o&&o.vertexAttribDivisor(r+t,0);else if(16===e.count)for(let t=0;t<4;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&o&&o.vertexAttribDivisor(r+t,0);else console.error("Unsupported vertex attribute element count: "+e.count)}e.unbindBuffer($.w0.ARRAY_BUFFER)}function Y(e){switch(e){case $.VI.ALPHA:case $.VI.LUMINANCE:case $.VI.RED:case $.VI.RED_INTEGER:case $.lP.R8:case $.lP.R8I:case $.lP.R8UI:case $.lP.R8_SNORM:case $.Tg.STENCIL_INDEX8:return 1;case $.VI.LUMINANCE_ALPHA:case $.VI.RG:case $.VI.RG_INTEGER:case $.lP.RGBA4:case $.lP.R16F:case $.lP.R16I:case $.lP.R16UI:case $.lP.RG8:case $.lP.RG8I:case $.lP.RG8UI:case $.lP.RG8_SNORM:case $.lP.RGB565:case $.lP.RGB5_A1:case $.Tg.DEPTH_COMPONENT16:return 2;case $.VI.DEPTH_COMPONENT:case $.VI.RGB:case $.VI.RGB_INTEGER:case $.lP.RGB8:case $.lP.RGB8I:case $.lP.RGB8UI:case $.lP.RGB8_SNORM:case $.lP.SRGB8:case $.Tg.DEPTH_COMPONENT24:return 3;case $.VI.DEPTH_STENCIL:case $.VI.RGBA:case $.VI.RGBA_INTEGER:case $.lP.RGBA8:case $.lP.R32F:case $.lP.R11F_G11F_B10F:case $.lP.RG16F:case $.lP.R32I:case $.lP.R32UI:case $.lP.RG16I:case $.lP.RG16UI:case $.lP.RGBA8I:case $.lP.RGBA8UI:case $.lP.RGBA8_SNORM:case $.lP.SRGB8_ALPHA8:case $.lP.RGB9_E5:case $.lP.RGB10_A2UI:case $.lP.RGB10_A2:case $.Tg.DEPTH_STENCIL:case $.Tg.DEPTH_COMPONENT32F:case $.Tg.DEPTH24_STENCIL8:return 4;case $.Tg.DEPTH32F_STENCIL8:return 5;case $.lP.RGB16F:case $.lP.RGB16I:case $.lP.RGB16UI:return 6;case $.lP.RG32F:case $.lP.RG32I:case $.lP.RG32UI:case $.lP.RGBA16F:case $.lP.RGBA16I:case $.lP.RGBA16UI:return 8;case $.lP.RGB32F:case $.lP.RGB32I:case $.lP.RGB32UI:return 12;case $.lP.RGBA32F:case $.lP.RGBA32I:case $.lP.RGBA32UI:return 16;case $.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case $.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case $.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case $.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case $.q_.COMPRESSED_R11_EAC:case $.q_.COMPRESSED_SIGNED_R11_EAC:case $.q_.COMPRESSED_RGB8_ETC2:case $.q_.COMPRESSED_SRGB8_ETC2:case $.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case $.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case $.q_.COMPRESSED_RG11_EAC:case $.q_.COMPRESSED_SIGNED_RG11_EAC:case $.q_.COMPRESSED_RGBA8_ETC2_EAC:case $.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function Z(e){if((0,n.Wi)(e))return 0;if("descriptor"in e)return e.glName?Z(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return Y(t)*i*r}r(80442);let K=null,Q=null;async function ee(){return(0,n.Wi)(Q)&&(Q=function(){if((0,n.Wi)(q)){const e=e=>(0,W.V)(`esri/libs/basisu/${e}`);q=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return q}(),K=await Q),Q}function te(e,t,r,i,n){const o=Y(t?$.q_.COMPRESSED_RGBA8_ETC2_EAC:$.q_.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function re(e){return e.getNumImages()>=1&&!e.isUASTC()}function ie(e){return e.getFaces()>=1&&e.isETC1S()}function ne(e,t,r,i,n,o,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,d]=l?i?[k.ETC2_RGBA,$.q_.COMPRESSED_RGBA8_ETC2_EAC]:[k.ETC1_RGB,$.q_.COMPRESSED_RGB8_ETC2]:c?i?[k.BC3_RGBA,$.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[k.BC1_RGB,$.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[k.RGBA32,$.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(a(e,u))),s(e,u,f[e]);const p=f.length>1,m=p?$.cw.LINEAR_MIPMAP_LINEAR:$.cw.LINEAR,g={...t,samplingMode:m,hasMipmap:p,internalFormat:d,width:n,height:o};return new X.x(e,g,{type:"compressed",levels:f})}const oe=A.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function ae(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const se=ae("DXT1"),le=ae("DXT3"),ce=ae("DXT5");var ue=r(83475),de=r(21968);new de.G(D.T.POSITION,3,$.g.FLOAT,0,12),new de.G(D.T.POSITION,3,$.g.FLOAT,0,20),new de.G(D.T.UV0,2,$.g.FLOAT,12,20),new de.G(D.T.POSITION,3,$.g.FLOAT,0,32),new de.G(D.T.NORMAL,3,$.g.FLOAT,12,32),new de.G(D.T.UV0,2,$.g.FLOAT,24,32),new de.G(D.T.POSITION,3,$.g.FLOAT,0,16),new de.G(D.T.COLOR,4,$.g.UNSIGNED_BYTE,12,16);const he=[new de.G(D.T.POSITION,2,$.g.FLOAT,0,8)],fe=[new de.G(D.T.POSITION,2,$.g.FLOAT,0,16),new de.G(D.T.UV0,2,$.g.FLOAT,8,16)];var pe=r(67676),me=r(49300),ge=r(54738);const _e=A.Z.getLogger("esri.views.webgl.BufferObject");class ve{constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment($._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,me.zu)(this._context.gl),i&&this.setData(i)}static createIndex(e,t,r){return new ve(e,$.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new ve(e,$.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==ge.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new ve(e,$.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=$.l1.STREAM_READ,r){if(e.type!==ge.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new ve(e,$.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=$.l1.STREAM_DRAW,r){if(e.type!==ge.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new ve(e,$.w0.PIXEL_UNPACK_BUFFER,t,r)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===$.w0.ELEMENT_ARRAY_BUFFER?this._indexType===$.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===$.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===$.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement($._g.BufferObject,this),this._context=null):this._glName&&_e.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&_e.error("Buffer size needs to be positive!"),this.bufferType===$.w0.ELEMENT_ARRAY_BUFFER&&(0,n.pC)(t))switch(this._indexType=t,t){case $.g.UNSIGNED_SHORT:e*=2;break;case $.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===$.w0.ELEMENT_ARRAY_BUFFER&&((0,z.Uc)(e)&&(t/=2,this._indexType=$.g.UNSIGNED_SHORT),(0,z.ZY)(e)&&(t/=4,this._indexType=$.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;(0,n.pC)(t)?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,me.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t=0,r=0,i=e.byteLength){if(!e)return;(t<0||t>=this._size)&&_e.error("offset is out of range!");let n=t,o=r,a=i,s=e.byteLength;this.bufferType===$.w0.ELEMENT_ARRAY_BUFFER&&((0,z.Uc)(e)?(s/=2,n*=2,o*=2,a*=2):(0,z.ZY)(e)&&(s/=4,n*=4,o*=4,a*=4)),void 0===i&&(i=s-1),r>=i&&_e.error("end must be bigger than start!"),t+r-i>this._size&&_e.error("An attempt to write beyond the end of the buffer!");const l=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const c=this._context.gl,u=ArrayBuffer.isView(e)?e.buffer:e,d=0===o&&a===e.byteLength?u:u.slice(o,a);c.bufferSubData(this.bufferType,n,d),(0,me.zu)(c),this._isVAOAware&&this._context.bindVAO(l)}setSubDataFromView(e,t,r,i){if(!e)return;(t<0||t>=this._size)&&_e.error("offset is out of range!"),r>=i&&_e.error("end must be bigger than start!"),t+r-i>this._size&&_e.error("An attempt to write beyond the end of the buffer!");const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const o=this._context.gl;if(this._context.type===ge.zO.WEBGL2)o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const n=0===r&&i===e.length?e:e.subarray(r,i);o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,n)}(0,me.zu)(o),this._isVAOAware&&this._context.bindVAO(n)}getSubData(e,t=0,r,i){if(this._context.type!==ge.zO.WEBGL2)return void _e.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void _e.error("Problem getting subdata: offset and length were less than zero!");const n=function(e){return(0,pe.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(n*((r??0)+(i??0))>e.byteLength)return void _e.error("Problem getting subdata: offset and length exceeded destination size!");t+n*(i??0)>this.byteSize&&_e.warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;this._context.bindBuffer(this,$.w0.COPY_READ_BUFFER),o.getBufferSubData($.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer($.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===ge.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):_e.error("Get buffer subdata is supported in WebGL2 only!")}}const Te=A.Z.getLogger("esri.views.webgl.VertexArrayObject");class xe{constructor(e,t,r,i,n=null){this._context=e,this._locations=t,this._layout=r,this._buffers=i,this._indexBuffer=n,this._glName=null,this._initialized=!1,e.instanceCounter.increment($._g.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((e,t)=>e+this._buffers[t].size),(0,n.pC)(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(this._context){if(this._glName){const e=this._context?.capabilities?.vao;e?(e.deleteVertexArray(this._glName),this._glName=null):Te.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const e in this._buffers)this._buffers[e].dispose(),delete this._buffers[e];this._indexBuffer=(0,n.O3)(this._indexBuffer)}this._context.instanceCounter.decrement($._g.VertexArrayObject,this),this._context=null}else(this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&Te.warn("Leaked WebGL VAO")}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||Te.error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const r in e){const i=e[r];i||Te.error("Vertex buffer is uninitialized!");const n=t[r];n||Te.error("Vertex element descriptor is empty!"),j(this._context,this._locations,i,n)}(0,n.pC)(r)&&(this._context.capabilities.vao?i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:t}=this;e||Te.error("Vertex buffer dictionary is empty!");for(const r in e){const i=e[r];i||Te.error("Vertex buffer is uninitialized!");const n=t[r];J(this._context,this._locations,i,n)}(0,n.pC)(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}class be{constructor(e,t){this._context=e,this._desc=t,this.type="renderbuffer",this._context.instanceCounter.increment($._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:n,internalFormat:o,multisampled:a}=t;if(a){if(this._context.type!==ge.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,i,n)}else r.renderbufferStorage(r.RENDERBUFFER,o,i,n)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}resize(e,t){const r=this._desc;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement($._g.Renderbuffer,this),this._context=null)}}const Ae=A.Z.getLogger("esri.views.webgl.FrameBufferObject");class Ee{constructor(e,t,r=null,i=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._initialized=!1,this._desc={...t},e.instanceCounter.increment($._g.FramebufferObject,this),(0,n.pC)(r)){Array.isArray(r)||(r=[r]);for(let e=0;e<r.length;++e){const t=r[e],i=$.VY.COLOR_ATTACHMENT0+e;let n;Re(t)?(Se(t)?(n=t.descriptor,this._colorAttachments.set(i,t)):(n=t,this._colorAttachments.set(i,new X.x(this._context,n))),Ce(n,this._desc)):(Me(t)?(n=t.descriptor,this._colorAttachments.set(i,t)):(n=t,this._colorAttachments.set(i,new be(this._context,n))),we(n,this._desc)),this._validateColorAttachmentPoint(i)}}if((0,n.pC)(i)){let e,t;if(Re(i))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),Se(i)?(t=i.descriptor,this._depthStencilTexture=i):(t=i,this._depthStencilTexture=new X.x(this._context,t)),Ce(t,this._desc);else{Me(i)?(t=i.descriptor,e=i):(t=i,e=new be(this._context,t));const r=this._desc.depthStencilTarget??$.OU.DEPTH_STENCIL_RENDER_BUFFER;r===$.OU.STENCIL_RENDER_BUFFER?this._stencilAttachment=e:r===$.OU.DEPTH_RENDER_BUFFER||r===$.OU.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=e:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),we(t,this._desc)}}}dispose(){if(!this._desc)return;const e=this._context.getBoundFramebufferObject();this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement($._g.FramebufferObject,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const e=this._colorAttachments.get($.VY.COLOR_ATTACHMENT0);return e&&Se(e)?e:null}get colorAttachment(){return this._colorAttachments.get($.VY.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width}get height(){return this._desc.height}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+Z(r)),0)+Z(this.depthStencilAttachment)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&Se(t)?t:null}attachColorTexture(e,t=$.VY.COLOR_ATTACHMENT0){e&&(this._validateColorAttachmentPoint(t),Ce(e.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e))}detachColorTexture(e=$.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(Se(t)){const r=t;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),r}}setColorTextureTarget(e,t=$.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);Se(r)&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencilTexture(e){if((0,n.Wi)(e))return;const t=e.descriptor;t.pixelFormat!==$.VI.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==$.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),Ce(t,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==$.OU.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=$.OU.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,$.Lu)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,$.Lu)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if((0,n.Wi)(e))return;const t=e.descriptor;if(t.internalFormat!==$.Tg.DEPTH_STENCIL&&t.internalFormat!==$.Tg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),we(t,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=t.internalFormat===$.Tg.DEPTH_STENCIL?$.OU.DEPTH_STENCIL_RENDER_BUFFER:$.OU.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._desc.depthStencilTarget===$.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer($.qi.FRAMEBUFFER,r,t.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,t=this._depthAttachment;if(t&&this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===$.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer($.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}return this._depthAttachment=null,t}detachAll(){this._colorAttachments.forEach(((e,t)=>this._detachColorAttachment(t))),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,t,r,i,n,o,a){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=this._desc,l=a.descriptor;a.descriptor.target!==$.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(e+r>s.width||t+i>s.height||n+r>l.width||o+i>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,u=c.bindTexture(a,X.x.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(X.x.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D($.No.TEXTURE_2D,0,n,o,e,t,r,i),c.bindTexture(u,X.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,n,o,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,n,o,a)}async readPixelsAsync(e,t,r,i,n,o,a){if(this._context.type!==ge.zO.WEBGL2)return(0,me.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,n,o,a);const s=this._context.gl,l=ve.createPixelPack(this._context,$.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,n,o,0),this._context.unbindBuffer($.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){const r=this._desc;if(r.width!==e||r.height!==t){if(!this._initialized)return r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,t));r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(e,t):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,t),this._stencilAttachment&&this._stencilAttachment.resize(e,t)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=$.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=this._context,i=t.createFramebuffer(),n=this._desc,o=n.colorTarget??$.Lm.RENDER_BUFFER,a=n.width??1,s=n.height??1;if(t.bindFramebuffer(e,i),0===this._colorAttachments.size)if(o===$.Lm.TEXTURE||o===$.Lm.CUBEMAP)this._colorAttachments.set($.VY.COLOR_ATTACHMENT0,function(e,t,r){return new X.x(e,{target:r,pixelFormat:$.VI.RGBA,dataType:$.Br.UNSIGNED_BYTE,samplingMode:$.cw.NEAREST,wrapMode:$.e8.CLAMP_TO_EDGE,width:t.width,height:t.height})}(r,n,this.descriptor.colorTarget===$.Lm.CUBEMAP?$.No.TEXTURE_CUBE_MAP:$.No.TEXTURE_2D));else{const e=new be(r,{internalFormat:$.lP.RGBA4,width:a,height:s});this._colorAttachments.set($.VY.COLOR_ATTACHMENT0,e)}this._colorAttachments.forEach(((r,i)=>{r&&(Se(r)?this._framebufferTexture2D(r.glName,i,ye(r),e):t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,r.glName))}));const l=n.depthStencilTarget??$.OU.NONE;switch(l){case $.OU.DEPTH_RENDER_BUFFER:case $.OU.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new be(r,{internalFormat:n.depthStencilTarget===$.OU.DEPTH_RENDER_BUFFER?$.Tg.DEPTH_COMPONENT16:$.Tg.DEPTH_STENCIL,width:a,height:s}));const i=l===$.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,this._depthAttachment.glName);break}case $.OU.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new be(r,{internalFormat:$.Tg.STENCIL_INDEX8,width:a,height:s})),t.framebufferRenderbuffer(e,t.STENCIL_ATTACHMENT,t.RENDERBUFFER,this._stencilAttachment.glName);break;case $.OU.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){r.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const e={target:$.No.TEXTURE_2D,pixelFormat:$.VI.DEPTH_STENCIL,dataType:$.Br.UNSIGNED_INT_24_8,samplingMode:$.cw.NEAREST,wrapMode:$.e8.CLAMP_TO_EDGE,width:a,height:s};this._depthStencilTexture=new X.x(r,e)}this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,ye(this._depthStencilTexture),e)}(0,me.CG)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=i,this._initialized=!0}_framebufferTexture2D(e,t=$.VY.COLOR_ATTACHMENT0,r=$.No.TEXTURE_2D,i=$.qi.FRAMEBUFFER,n=0){this._context.gl.framebufferTexture2D(i,t,r,e,n)}_detachColorAttachment(e){(0,me.hZ)()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const t=this._context.gl,r=this._colorAttachments.get(e);return Se(r)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)):this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer($.qi.FRAMEBUFFER,e,t.RENDERBUFFER,null)),this._colorAttachments.delete(e),r}_disposeColorAttachments(){this._colorAttachments.forEach(((e,t)=>{this._detachColorAttachment(t),e.dispose()})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===$.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer($.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer($.qi.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(e){if(-1===Ee._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;Ee._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else Ee._MAX_COLOR_ATTACHMENTS=1}const t=e-$.VY.COLOR_ATTACHMENT0;t+1>Ee._MAX_COLOR_ATTACHMENTS&&Ae.error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${Ee._MAX_COLOR_ATTACHMENTS} color attachments`)}}function Se(e){return"type"in e&&"texture"===e.type}function Me(e){return"type"in e&&"renderbuffer"===e.type}function Re(e){return Se(e)||"pixelFormat"in e}function Ce(e,t){e.target!==$.No.TEXTURE_2D&&e.target!==$.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function we(e,t){void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function ye(e){return e.descriptor.target===$.No.TEXTURE_CUBE_MAP?$.No.TEXTURE_CUBE_MAP_POSITIVE_X:$.No.TEXTURE_2D}Ee._MAX_COLOR_ATTACHMENTS=-1;var Oe,Pe,Ne=r(46314);class Ie extends P.c{constructor(e,t){super(),this.data=e,this.type=N.U.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new H.Z,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:$.e8.REPEAT,t:$.e8.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||R.CE.STRETCH,this.estimatedTexMemRequired=Ie._estimateTexMemRequired(this.data,this.params),this._startPreload()}_startPreload(){const e=this.data;(0,n.Wi)(e)||(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){(0,G.jc)(e.src)||"auto"===e.preload&&e.crossOrigin||(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src)}_startPreloadImageElement(e){(0,G.HK)(e.src)||(0,G.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if((0,n.Wi)(e))return 0;if((0,z.eP)(e)||(0,z.lq)(e))return t.encoding===Ie.KTX2_ENCODING?function(e,t){if((0,n.Wi)(K))return e.byteLength;const r=new K.KTX2File(new Uint8Array(e)),i=ie(r)?te(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,t.mipmap):t.encoding===Ie.BASIS_ENCODING?function(e,t){if((0,n.Wi)(K))return e.byteLength;const r=new K.BasisFile(new Uint8Array(e)),i=re(r)?te(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Ie._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this.data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){return{target:$.No.TEXTURE_2D,pixelFormat:$.VI.RGBA,dataType:$.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?$.cw.LINEAR_MIPMAP_LINEAR:$.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:this.params.maxAnisotropy??(this.params.mipmap?e.parameters.maxMaxAnisotropy:1)}}get glTexture(){return this._glTexture}load(e,t){if((0,n.pC)(this._glTexture))return this._glTexture;if((0,n.pC)(this._loadingPromise))return this._loadingPromise;const r=this.data;return(0,n.Wi)(r)?(this._glTexture=new X.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof r?this._loadFromURL(e,t,r):r instanceof Image?this._loadFromImageElement(e,t,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,t,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r,t):((0,z.eP)(r)||(0,z.lq)(r))&&this.params.encoding===Ie.DDS_ENCODING?(this.data=void 0,this._loadFromDDSData(e,r)):((0,z.eP)(r)||(0,z.lq)(r))&&this.params.encoding===Ie.KTX2_ENCODING?(this.data=void 0,this._loadFromKTX2(e,r)):((0,z.eP)(r)||(0,z.lq)(r))&&this.params.encoding===Ie.BASIS_ENCODING?(this.data=void 0,this._loadFromBasis(e,r)):(0,z.lq)(r)?this._loadFromPixelData(e,r):(0,z.eP)(r)?this._loadFromPixelData(e,new Uint8Array(r)):null}get requiresFrameUpdates(){return this.data instanceof HTMLVideoElement}frameUpdate(e,t,r){if(!(this.data instanceof HTMLVideoElement)||(0,n.Wi)(this._glTexture))return r;if(this.data.readyState<Oe.HAVE_CURRENT_DATA||r===this.data.currentTime)return r;if((0,n.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:r,vao:i,sourceTexture:n}=this._powerOfTwoStretchInfo;n.setData(this.data),this._drawStretchedTexture(e,t,r,i,n,this._glTexture)}else{const{width:e,height:t}=this.data,{width:r,height:i}=this._glTexture.descriptor;e!==r||t!==i?this._glTexture.updateData(0,0,0,Math.min(e,r),Math.min(t,i),this.data):this._glTexture.setData(this.data)}return this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.data.currentTime}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const{textureData:i,internalFormat:n,width:o,height:a}=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return oe.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return oe.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case se:n=8,o=$.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case le:n=16,o=$.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case ce:n=16,o=$.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return oe.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(oe.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,u=l;let d,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7])),1===a||(0,U.wt)(s)&&(0,U.wt)(l)||(oe.warn("Ignoring mipmaps of non power of two sized compressed texture."),a=1);let f=r[1]+4;const p=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*n,d=new Uint8Array(e,f,h),p.push(d),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:o,width:c,height:u}}(r,t.hasMipmap);return t.samplingMode=i.levels.length>1?$.cw.LINEAR_MIPMAP_LINEAR:$.cw.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=n,t.width=o,t.height=a,new X.x(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){(0,n.Wi)(K)&&(K=await ee());const i=new K.KTX2File(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=ne(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){(0,n.Wi)(K)&&(K=await ee());const i=new K.BasisFile(new Uint8Array(r));if(!re(i))return null;i.startTranscoding();const o=ne(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,w.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?$.VI.LUMINANCE:3===this.params.components?$.VI.RGB:$.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new X.x(e,r,t),this._glTexture}_loadFromURL(e,t,r){return this._loadAsync((async i=>{const n=await M(r,{signal:i});return(0,E.k_)(i),this._loadFromImage(e,n,t)}))}_loadFromImageElement(e,t,r){return r.complete?this._loadFromImage(e,r,t):this._loadAsync((async i=>{const n=await(0,V.fY)(r,r.src,!1,i);return(0,E.k_)(i),this._loadFromImage(e,n,t)}))}_loadFromVideoElement(e,t,r){return r.readyState>=Oe.HAVE_CURRENT_DATA?this._loadFromImage(e,r,t):this._loadFromVideoElementAsync(e,t,r)}_loadFromVideoElementAsync(e,t,r){return this._loadAsync((i=>new Promise(((o,a)=>{const s=()=>{r.removeEventListener("loadeddata",l),r.removeEventListener("error",c),(0,n.hw)(u)},l=()=>{r.readyState>=Oe.HAVE_CURRENT_DATA&&(s(),o(this._loadFromImage(e,r,t)))},c=e=>{s(),a(e||new b.Z("Failed to load video"))};r.addEventListener("loadeddata",l),r.addEventListener("error",c);const u=(0,E.fu)(i,(()=>c((0,E.zE)())))}))))}_loadFromImage(e,t,r){const i=Ie._getDataDimensions(t);this.params.width=i.width,this.params.height=i.height;const n=this._createDescriptor(e);return n.pixelFormat=3===this.params.components?$.VI.RGB:$.VI.RGBA,!this._requiresPowerOfTwo(e,n)||(0,U.wt)(i.width)&&(0,U.wt)(i.height)?(n.width=i.width,n.height=i.height,this._glTexture=new X.x(e,n,t),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(e,t,i,n,r),this._glTexture)}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}_requiresPowerOfTwo(e,t){const r=$.e8.CLAMP_TO_EDGE,i="number"==typeof t.wrapMode?t.wrapMode===r:t.wrapMode.s===r&&t.wrapMode.t===r;return!(0,Ne.Z)(e.gl)&&(t.hasMipmap||!i)}_makePowerOfTwoTexture(e,t,r,i,n){const{width:o,height:a}=r,s=(0,U.Sf)(o),l=(0,U.Sf)(a);let c;switch(i.width=s,i.height=l,this.params.powerOfTwoResizeMode){case R.CE.PAD:i.textureCoordinateScaleFactor=[o/s,a/l],c=new X.x(e,i),c.updateData(0,0,0,o,a,t);break;case R.CE.STRETCH:case null:case void 0:c=this._stretchToPowerOfTwo(e,t,i,n());break;default:(0,B.Bg)(this.params.powerOfTwoResizeMode)}return i.hasMipmap&&c.generateMipmap(),c}_stretchToPowerOfTwo(e,t,r,i){const n=new X.x(e,r),o=new Ee(e,{colorTarget:$.Lm.TEXTURE,depthStencilTarget:$.OU.NONE},n),a=new X.x(e,{target:$.No.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:$.Br.UNSIGNED_BYTE,wrapMode:$.e8.CLAMP_TO_EDGE,samplingMode:$.cw.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},t),s=function(e,t=he,r=ue.i,i=-1,n=1){let o=null;return o=t===fe?new Float32Array([i,i,0,0,n,i,1,0,i,n,0,1,n,n,1,1]):new Float32Array([i,i,n,i,i,n,n,n]),new xe(e,r,{geometry:t},{geometry:ve.createVertex(e,$.l1.STATIC_DRAW,o)})}(e),l=e.getBoundFramebufferObject();return this._drawStretchedTexture(e,i,o,s,a,n),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:s,sourceTexture:a,framebuffer:o}:(s.dispose(!0),a.dispose(),o.detachColorTexture(),o.dispose()),e.bindFramebuffer(l),n}_drawStretchedTexture(e,t,r,i,n,o){e.bindFramebuffer(r);const a=e.getViewport();e.setViewport(0,0,o.descriptor.width,o.descriptor.height);const s=e.bindTechnique(t);s.setUniform4f("uColor",1,1,1,1),s.bindTexture("tex",n),e.bindVAO(i),e.drawArrays($.MX.TRIANGLE_STRIP,0,function(e,t){return e.vertexBuffers[t].size/function(e){return e[0].stride}(e.layout[t])}(i,"geometry")),e.bindFramebuffer(null),e.setViewport(a.x,a.y,a.width,a.height)}unload(){if((0,n.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:e,vao:t,sourceTexture:r}=this._powerOfTwoStretchInfo;t.dispose(!0),r.dispose(),e.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if((0,n.pC)(this._glTexture)&&(this._glTexture.dispose(),this._glTexture=null),(0,n.pC)(this._loadingController)){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}Ie.DDS_ENCODING="image/vnd-ms.dds",Ie.KTX2_ENCODING="image/ktx2",Ie.BASIS_ENCODING="image/x.basis",(Pe=Oe||(Oe={}))[Pe.HAVE_NOTHING=0]="HAVE_NOTHING",Pe[Pe.HAVE_METADATA=1]="HAVE_METADATA",Pe[Pe.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Pe[Pe.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Pe[Pe.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var De=r(64822),Le=r(65576),Fe=r(18361),Be=r(64267),He=r(19419),Ue=r(85504),ze=r(60537),Ge=r(82791);function Ve(e,t,r=$.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}const We={face:$.LR.BACK,mode:$.Wf.CCW},qe={face:$.LR.FRONT,mode:$.Wf.CCW},ke=e=>e===R.Vr.Back?We:e===R.Vr.Front?qe:null,$e={zNear:0,zFar:1},Xe={r:!0,g:!0,b:!0,a:!0};function je(e){return nt.intern(e)}function Je(e){return at.intern(e)}function Ye(e){return lt.intern(e)}function Ze(e){return ut.intern(e)}function Ke(e){return ht.intern(e)}function Qe(e){return pt.intern(e)}function et(e){return gt.intern(e)}function tt(e){return vt.intern(e)}class rt{constructor(e,t){this.makeKey=e,this.makeRef=t,this.interns=new Map}intern(e){if(!e)return null;const t=this.makeKey(e),r=this.interns;return r.has(t)||r.set(t,this.makeRef(e)),r.get(t)}}function it(e){return"["+e.join(",")+"]"}const nt=new rt(ot,(e=>({__tag:"Blending",...e})));function ot(e){return e?it([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const at=new rt(st,(e=>({__tag:"Culling",...e})));function st(e){return e?it([e.face,e.mode]):null}const lt=new rt(ct,(e=>({__tag:"PolygonOffset",...e})));function ct(e){return e?it([e.factor,e.units]):null}const ut=new rt(dt,(e=>({__tag:"DepthTest",...e})));function dt(e){return e?it([e.func]):null}const ht=new rt(ft,(e=>({__tag:"StencilTest",...e})));function ft(e){return e?it([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const pt=new rt(mt,(e=>({__tag:"DepthWrite",...e})));function mt(e){return e?it([e.zNear,e.zFar]):null}const gt=new rt(_t,(e=>({__tag:"ColorWrite",...e})));function _t(e){return e?it([e.r,e.g,e.b,e.a]):null}const vt=new rt(Tt,(e=>({__tag:"StencilWrite",...e})));function Tt(e){return e?it([e.mask]):null}const xt=new rt((function(e){return e?it([ot(e.blending),st(e.culling),ct(e.polygonOffset),dt(e.depthTest),ft(e.stencilTest),mt(e.depthWrite),_t(e.colorWrite),Tt(e.stencilWrite)]):null}),(e=>({blending:je(e.blending),culling:Je(e.culling),polygonOffset:Ye(e.polygonOffset),depthTest:Ze(e.depthTest),stencilTest:Ke(e.stencilTest),depthWrite:Qe(e.depthWrite),colorWrite:et(e.colorWrite),stencilWrite:tt(e.stencilWrite)}))),bt=function(e,t,r,i,n=$.db.ADD,o=$.db.ADD,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}($.zi.SRC_ALPHA,$.zi.ONE,$.zi.ONE_MINUS_SRC_ALPHA,$.zi.ONE_MINUS_SRC_ALPHA),At=Ve($.zi.ONE,$.zi.ONE),Et=Ve($.zi.ZERO,$.zi.ONE_MINUS_SRC_ALPHA);function St(e){return e===R.Am.FrontFace?null:e===R.Am.Alpha?Et:At}const Mt={factor:-1,units:-2};function Rt(e,t=$.wb.LESS){return e===R.Am.NONE||e===R.Am.FrontFace?t:$.wb.LEQUAL}var Ct,wt,yt,Ot;(Ot=Ct||(Ct={}))[Ot.MATERIAL=0]="MATERIAL",Ot[Ot.MATERIAL_ALPHA=1]="MATERIAL_ALPHA",Ot[Ot.MATERIAL_DEPTH=2]="MATERIAL_DEPTH",Ot[Ot.MATERIAL_NORMAL=3]="MATERIAL_NORMAL",Ot[Ot.MATERIAL_DEPTH_SHADOWMAP_ALL=4]="MATERIAL_DEPTH_SHADOWMAP_ALL",Ot[Ot.MATERIAL_HIGHLIGHT=5]="MATERIAL_HIGHLIGHT",Ot[Ot.MATERIAL_DEPTH_SHADOWMAP_DEFAULT=6]="MATERIAL_DEPTH_SHADOWMAP_DEFAULT",Ot[Ot.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT=7]="MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT",(yt=wt||(wt={}))[yt.INTEGRATED_MESH=0]="INTEGRATED_MESH",yt[yt.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",yt[yt.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",yt[yt.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",yt[yt.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",yt[yt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",yt[yt.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",yt[yt.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",yt[yt.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",yt[yt.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",yt[yt.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",yt[yt.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",yt[yt.LASERLINES=12]="LASERLINES",yt[yt.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",yt[yt.HUD_MATERIAL=14]="HUD_MATERIAL",yt[yt.LABEL_MATERIAL=15]="LABEL_MATERIAL",yt[yt.LINE_CALLOUTS=16]="LINE_CALLOUTS",yt[yt.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",yt[yt.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",yt[yt.DRAPED_WATER=19]="DRAPED_WATER",yt[yt.VOXEL=20]="VOXEL",yt[yt.MAX_SLOTS=21]="MAX_SLOTS";var Pt=r(51305),Nt=r(94961),It=r(72119),Dt=r(2643);const Lt=(0,u.c)(),Ft=(0,u.c)(),Bt=(0,u.c)(),Ht=new class{constructor(e=0){this.offset=e,this.sphere=(0,Dt.c)(),this.tmpVertex=(0,u.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let n=i[0]*e+i[4]*t+i[8]*r+i[12],o=i[1]*e+i[5]*t+i[9]*r+i[13],a=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(n*n+o*o+a*a);n+=n*s,o+=o*s,a+=a*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*n+l[4]*o+l[8]*a+l[12],this.tmpVertex[1]=l[1]*n+l[5]*o+l[9]*a+l[13],this.tmpVertex[2]=l[2]*n+l[6]*o+l[10]*a+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.offset=e,this.componentLocalOriginLength=0,this.tmpVertex=(0,u.c)(),this.mbs=(0,Dt.c)(),this.obb={center:(0,u.c)(),halfSize:(0,It.c)(),quaternion:null}}set localOrigin(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,n=t,o=r+this.componentLocalOriginLength,a=this.offset/Math.sqrt(i*i+n*n+o*o);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+n*a,this.tmpVertex[2]=r+o*a,this.tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,n=e[3],o=e[4],a=e[5]+this.componentLocalOriginLength,s=this.offset/Math.sqrt(t*t+r*r+i*i);e[0]+=t*s,e[1]+=r*s,e[2]+=i*s;const l=this.offset/Math.sqrt(n*n+o*o+a*a);return e[3]+=n*l,e[4]+=o*l,e[5]+=a*l,e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.mbs[0]=e[0]+e[0]*r,this.mbs[1]=e[1]+e[1]*r,this.mbs[2]=e[2]+e[2]*r,this.mbs[3]=e[3]+e[3]*this.offset/t,this.mbs}applyToObb(e){const t=e.center,r=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.obb.center[0]=t[0]+t[0]*r,this.obb.center[1]=t[1]+t[1]*r,this.obb.center[2]=t[2]+t[2]*r,(0,c.q)(this.obb.halfSize,e.halfSize,e.quaternion),(0,c.a)(this.obb.halfSize,this.obb.halfSize,e.center);const i=this.offset/Math.sqrt(this.obb.halfSize[0]*this.obb.halfSize[0]+this.obb.halfSize[1]*this.obb.halfSize[1]+this.obb.halfSize[2]*this.obb.halfSize[2]);return this.obb.halfSize[0]+=this.obb.halfSize[0]*i,this.obb.halfSize[1]+=this.obb.halfSize[1]*i,this.obb.halfSize[2]+=this.obb.halfSize[2]*i,(0,c.b)(this.obb.halfSize,this.obb.halfSize,e.center),(0,Pt.c)(Ut,e.quaternion),(0,c.q)(this.obb.halfSize,this.obb.halfSize,Ut),this.obb.halfSize[0]*=this.obb.halfSize[0]<0?-1:1,this.obb.halfSize[1]*=this.obb.halfSize[1]<0?-1:1,this.obb.halfSize[2]*=this.obb.halfSize[2]<0?-1:1,this.obb.quaternion=e.quaternion,this.obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,u.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],n=t+this.localOrigin[1],o=r+this.localOrigin[2],a=this.offset/Math.sqrt(i*i+n*n+o*o);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+n*a,this.tmpVertex[2]=r+o*a,this.tmpVertex}applyToAabb(e){for(let t=0;t<3;++t)Lt[t]=e[0+t]+this.localOrigin[t],Ft[t]=e[3+t]+this.localOrigin[t],Bt[t]=Lt[t];const t=this.applyToVertex(Lt[0],Lt[1],Lt[2]);for(let r=0;r<3;++r)e[r]=t[r],e[r+3]=t[r];const r=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t+0]=Math.min(e[t+0],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let t=0;t<3;++t)Bt[t]=0==(e&1<<t)?Lt[t]:Ft[t];r(Bt)}let i=0;for(let e=0;e<3;++e)Lt[e]*Ft[e]<0&&(i|=1<<e);if(0!==i&&7!==i)for(let e=0;e<8;++e)if(0==(i&e)){for(let t=0;t<3;++t)i[t]?Bt[t]=0:Bt[t]=0!=(e&1<<t)?Lt[t]:Ft[t];r(Bt)}for(let t=0;t<3;++t)e[t+0]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Ut=(0,Nt.a)();function zt(e,t,r,i){const n=r.typedBuffer,o=r.typedBufferStride,a=e.length;i*=o;for(let r=0;r<a;++r){const a=2*e[r];n[i]=t[a],n[i+1]=t[a+1],i+=o}}function Gt(e,t,r,i,n){const o=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==n||1===n)for(let r=0;r<s;++r){const n=3*e[r];o[i]=t[n],o[i+1]=t[n+1],o[i+2]=t[n+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<n;++e)o[i]=t[s],o[i+1]=t[s+1],o[i+2]=t[s+2],i+=a}}function Vt(e,t,r,i,n,o=1){if(!r)return void Gt(e,t,i,n,o);const a=i.typedBuffer,s=i.typedBufferStride,l=e.length,c=r[0],u=r[1],d=r[2],h=r[4],f=r[5],p=r[6],m=r[8],g=r[9],_=r[10],v=r[12],T=r[13],x=r[14];if(n*=s,1===o)for(let r=0;r<l;++r){const i=3*e[r],o=t[i],l=t[i+1],b=t[i+2];a[n]=c*o+h*l+m*b+v,a[n+1]=u*o+f*l+g*b+T,a[n+2]=d*o+p*l+_*b+x,n+=s}else for(let r=0;r<l;++r){const i=3*e[r],l=t[i],b=t[i+1],A=t[i+2],E=c*l+h*b+m*A+v,S=u*l+f*b+g*A+T,M=d*l+p*b+_*A+x;for(let e=0;e<o;++e)a[n]=E,a[n+1]=S,a[n+2]=M,n+=s}}function Wt(e,t,r,i,n,o=1){if(!r)return void Gt(e,t,i,n,o);const a=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=a[0],h=a[1],f=a[2],p=a[4],m=a[5],g=a[6],_=a[8],v=a[9],T=a[10],x=!(0,s.p)(a),b=1e-6,A=1-b;if(n*=c,1===o)for(let r=0;r<u;++r){const i=3*e[r],o=t[i],a=t[i+1],s=t[i+2];let u=d*o+p*a+_*s,E=h*o+m*a+v*s,S=f*o+g*a+T*s;if(x){const e=u*u+E*E+S*S;if(e<A&&e>b){const t=1/Math.sqrt(e);u*=t,E*=t,S*=t}}l[n+0]=u,l[n+1]=E,l[n+2]=S,n+=c}else for(let r=0;r<u;++r){const i=3*e[r],a=t[i],s=t[i+1],u=t[i+2];let E=d*a+p*s+_*u,S=h*a+m*s+v*u,M=f*a+g*s+T*u;if(x){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}for(let e=0;e<o;++e)l[n+0]=E,l[n+1]=S,l[n+2]=M,n+=c}}function qt(e,t,r,i,n,o=1){if(!r)return void function(e,t,r,i,n=1){const o=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===n)for(let r=0;r<s;++r){const n=4*e[r];o[i]=t[n],o[i+1]=t[n+1],o[i+2]=t[n+2],o[i+3]=t[n+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<n;++e)o[i]=t[s],o[i+1]=t[s+1],o[i+2]=t[s+2],o[i+3]=t[s+3],i+=a}}(e,t,i,n,o);const a=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=a[0],h=a[1],f=a[2],p=a[4],m=a[5],g=a[6],_=a[8],v=a[9],T=a[10],x=!(0,s.p)(a),b=1e-6,A=1-b;if(n*=c,1===o)for(let r=0;r<u;++r){const i=4*e[r],o=t[i],a=t[i+1],s=t[i+2],u=t[i+3];let E=d*o+p*a+_*s,S=h*o+m*a+v*s,M=f*o+g*a+T*s;if(x){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}l[n+0]=E,l[n+1]=S,l[n+2]=M,l[n+3]=u,n+=c}else for(let r=0;r<u;++r){const i=4*e[r],a=t[i],s=t[i+1],u=t[i+2],E=t[i+3];let S=d*a+p*s+_*u,M=h*a+m*s+v*u,R=f*a+g*s+T*u;if(x){const e=S*S+M*M+R*R;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,M*=t,R*=t}}for(let e=0;e<o;++e)l[n+0]=S,l[n+1]=M,l[n+2]=R,l[n+3]=E,n+=c}}function kt(e,t,r,i,n,o=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(n*=s,1===o){if(4===r)for(let r=0;r<l;++r){const i=4*e[r];a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=t[i+3],n+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=255,n+=s}}else if(4===r)for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<o;++e)a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=t[i+3],n+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<o;++e)a[n]=t[i],a[n+1]=t[i+1],a[n+2]=t[i+2],a[n+3]=255,n+=s}}var $t=r(37782),Xt=r(88669),jt=r(135),Jt=r(15719),Yt=r(96310),Zt=r(89243);class Kt{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}var Qt=r(67498);class er{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new C.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBind(Qt.P.Pass,this),this.bindDraw=t.generateBind(Qt.P.Draw,this),this._fragmentUniforms=(0,me.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get isCompiled(){return this._glProgram.isCompiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2f(e,t,r){this._glProgram.setUniform2f(e,t,r)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3f(e,t,r,i){this._glProgram.setUniform3f(e,t,r,i)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4f(e,t,r,i,n){this._glProgram.setUniform4f(e,t,r,i,n)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if((0,n.Wi)(t)||null==t.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),(0,n.pC)(this._fragmentUniforms)&&this._fragmentUniforms.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}$.wb.LESS,$.wb.ALWAYS;const tr={mask:255},rr={function:{func:$.wb.ALWAYS,ref:R.hU.OutlineVisualElementMask,mask:R.hU.OutlineVisualElementMask},operation:{fail:$.xS.KEEP,zFail:$.xS.KEEP,zPass:$.xS.ZERO}},ir={function:{func:$.wb.ALWAYS,ref:R.hU.OutlineVisualElementMask,mask:R.hU.OutlineVisualElementMask},operation:{fail:$.xS.KEEP,zFail:$.xS.KEEP,zPass:$.xS.REPLACE}};$.wb.EQUAL,R.hU.OutlineVisualElementMask,R.hU.OutlineVisualElementMask,$.xS.KEEP,$.xS.KEEP,$.xS.KEEP,$.wb.NOTEQUAL,R.hU.OutlineVisualElementMask,R.hU.OutlineVisualElementMask,$.xS.KEEP,$.xS.KEEP,$.xS.KEEP;var nr=r(32078);class or extends Jt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,u.f)(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=R.Vr.Back,this.emissiveFactor=(0,u.f)(0,0,0),this.instancedDoublePrecision=!1,this.normals="default",this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,u.f)(.2,.2,.2),this.diffuse=(0,u.f)(.8,.8,.8),this.externalColor=(0,Xt.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,u.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSizeEnabled=!1,this.vvSizeMinSize=[1,1,1],this.vvSizeMaxSize=[100,100,100],this.vvSizeOffset=[0,0,0],this.vvSizeFactor=[1,1,1],this.vvSizeValue=[1,1,1],this.vvColorEnabled=!1,this.vvColorValues=[0,0,0,0,0,0,0,0],this.vvColorColors=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],this.vvSymbolAnchor=[0,0,0],this.vvSymbolRotationMatrix=(0,a.c)(),this.vvOpacityEnabled=!1,this.vvOpacityValues=[],this.vvOpacityOpacities=[],this.transparent=!1,this.writeDepth=!0,this.customDepthTest=R.Gv.Less,this.textureAlphaMode=R.JJ.Blend,this.textureAlphaCutoff=Yt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ge.yD.Occlude}}class ar extends class{constructor(e,t,r){this.release=r,t&&(this.initializeConfiguration(e,t),this._configuration=t.snapshot()),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=(0,n.O3)(this._program),this._pipeline=this._configuration=null}reload(e){(0,n.O3)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.isCompiled}get key(){return this._configuration.key}get configuration(){return this._configuration}bindPass(e,t){this.program.bindPass(e,t)}bindDraw(e,t){this.program.bindDraw(e,t),this.program.rebindTextures()}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return $.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}{initializeConfiguration(e,t){t.spherical=e.viewingMode===De.JY.Global,t.doublePrecisionRequiresObfuscation=(0,Zt.I)(e.rctx),t.textureCoordinateType=t.hasColorTexture||t.hasMetalnessAndRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?jt.N.Default:jt.N.None}initializeProgram(e){return this._initializeProgram(e,ar.shader)}_initializeProgram(e,t){const r=t.get().build(this.configuration);return new er(e.rctx,r,ue.i)}_convertDepthTestFunction(e){return e===R.Gv.Lequal?$.wb.LEQUAL:$.wb.LESS}_setPipeline(e,t){const r=this.configuration,i=e===R.Am.NONE,n=e===R.Am.FrontFace;return function(e){return xt.intern(e)}({blending:r.output!==Fe.H.Color&&r.output!==Fe.H.Alpha||!r.transparent?null:i?bt:St(e),culling:sr(r)&&ke(r.cullFace),depthTest:{func:Rt(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:i||n?r.writeDepth&&$e:null,colorWrite:Xe,stencilWrite:r.hasOccludees?tr:null,stencilTest:r.hasOccludees?t?ir:rr:null,polygonOffset:i||n?null:(o=r.enableOffset,o?Mt:null)});var o}initializePipeline(){return this._occludeePipelineState=this._setPipeline(this.configuration.transparencyPassType,!0),this._setPipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function sr(e){return e.cullFace!==R.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}ar.shader=new Kt(nr.D,(()=>r.e(9291).then(r.bind(r,79291))));var lr=r(43697);function cr(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,n=e.count||2,o=Math.ceil(Math.log2(n)),a=t._parameterBits??[0];let s=0;for(;a[s]+o>16;)s++,s>=a.length&&a.push(0);t._parameterBits=a;const l=a[s],c=(1<<o)-1<<l;a[s]+=o,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw"Configuration value for "+r+" must be boolean or number, got "+typeof e}})}}}class ur extends class{constructor(){this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}{}(0,lr._)([cr({constValue:!0})],ur.prototype,"hasSliceHighlight",void 0),(0,lr._)([cr({constValue:!1})],ur.prototype,"hasSliceInVertexProgram",void 0),(0,lr._)([cr({constValue:!1})],ur.prototype,"instancedDoublePrecision",void 0),(0,lr._)([cr({constValue:!1})],ur.prototype,"isGround",void 0),(0,lr._)([cr({constValue:Qt.P.Pass})],ur.prototype,"pbrTextureBindType",void 0);class dr extends ur{constructor(){super(...arguments),this.output=Fe.H.Color,this.alphaDiscardMode=R.JJ.Opaque,this.doubleSidedMode=He.q.None,this.pbrMode=Ue.f7.Disabled,this.cullFace=R.Vr.None,this.transparencyPassType=R.Am.NONE,this.normalType=Be.h.Attribute,this.textureCoordinateType=jt.N.None,this.customDepthTest=R.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetalnessAndRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1}}(0,lr._)([cr({count:Fe.H.COUNT})],dr.prototype,"output",void 0),(0,lr._)([cr({count:R.JJ.COUNT})],dr.prototype,"alphaDiscardMode",void 0),(0,lr._)([cr({count:He.q.COUNT})],dr.prototype,"doubleSidedMode",void 0),(0,lr._)([cr({count:Ue.f7.COUNT})],dr.prototype,"pbrMode",void 0),(0,lr._)([cr({count:R.Vr.COUNT})],dr.prototype,"cullFace",void 0),(0,lr._)([cr({count:R.Am.COUNT})],dr.prototype,"transparencyPassType",void 0),(0,lr._)([cr({count:Be.h.COUNT})],dr.prototype,"normalType",void 0),(0,lr._)([cr({count:jt.N.COUNT})],dr.prototype,"textureCoordinateType",void 0),(0,lr._)([cr({count:R.Gv.COUNT})],dr.prototype,"customDepthTest",void 0),(0,lr._)([cr()],dr.prototype,"spherical",void 0),(0,lr._)([cr()],dr.prototype,"hasVertexColors",void 0),(0,lr._)([cr()],dr.prototype,"hasSymbolColors",void 0),(0,lr._)([cr()],dr.prototype,"hasVerticalOffset",void 0),(0,lr._)([cr()],dr.prototype,"hasSlicePlane",void 0),(0,lr._)([cr()],dr.prototype,"hasSliceHighlight",void 0),(0,lr._)([cr()],dr.prototype,"hasColorTexture",void 0),(0,lr._)([cr()],dr.prototype,"hasMetalnessAndRoughnessTexture",void 0),(0,lr._)([cr()],dr.prototype,"hasEmissionTexture",void 0),(0,lr._)([cr()],dr.prototype,"hasOcclusionTexture",void 0),(0,lr._)([cr()],dr.prototype,"hasNormalTexture",void 0),(0,lr._)([cr()],dr.prototype,"hasScreenSizePerspective",void 0),(0,lr._)([cr()],dr.prototype,"hasVertexTangents",void 0),(0,lr._)([cr()],dr.prototype,"hasOccludees",void 0),(0,lr._)([cr()],dr.prototype,"hasMultipassTerrain",void 0),(0,lr._)([cr()],dr.prototype,"hasModelTransformation",void 0),(0,lr._)([cr()],dr.prototype,"offsetBackfaces",void 0),(0,lr._)([cr()],dr.prototype,"vvSize",void 0),(0,lr._)([cr()],dr.prototype,"vvColor",void 0),(0,lr._)([cr()],dr.prototype,"receiveShadows",void 0),(0,lr._)([cr()],dr.prototype,"receiveAmbientOcclusion",void 0),(0,lr._)([cr()],dr.prototype,"textureAlphaPremultiplied",void 0),(0,lr._)([cr()],dr.prototype,"instanced",void 0),(0,lr._)([cr()],dr.prototype,"instancedColor",void 0),(0,lr._)([cr()],dr.prototype,"instancedDoublePrecision",void 0),(0,lr._)([cr()],dr.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,lr._)([cr()],dr.prototype,"writeDepth",void 0),(0,lr._)([cr()],dr.prototype,"transparent",void 0),(0,lr._)([cr()],dr.prototype,"enableOffset",void 0),(0,lr._)([cr()],dr.prototype,"cullAboveGround",void 0),(0,lr._)([cr({constValue:!0})],dr.prototype,"hasVvInstancing",void 0),(0,lr._)([cr({constValue:!1})],dr.prototype,"useCustomDTRExponentForWater",void 0),(0,lr._)([cr({constValue:!1})],dr.prototype,"supportsTextureAtlas",void 0),(0,lr._)([cr({constValue:!0})],dr.prototype,"useFillLights",void 0);var hr=r(41846);class fr extends ar{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetalnessAndRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Be.h.Attribute,t.doubleSidedMode=He.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,fr.shader)}}fr.shader=new Kt(hr.R,(()=>r.e(8096).then(r.bind(r,38096))));class pr extends Ge.F5{constructor(e){super(e,gr),this.supportsEdges=!0,this.techniqueConfig=new dr,this.vertexBufferLayout=function(e){const t=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId,r=(0,Le.U$)().vec3f(D.T.POSITION).vec3f(D.T.NORMAL);return e.hasVertexTangents&&r.vec4f(D.T.TANGENT),t&&r.vec2f(D.T.UV0),e.hasVertexColors&&r.vec4u8(D.T.COLOR),e.hasSymbolColors&&r.vec4u8(D.T.SYMBOLCOLOR),r}(this.parameters),this.instanceBufferLayout=e.instanced?function(e){let t=(0,Le.U$)();return t=e.instancedDoublePrecision?t.vec3f(D.T.MODELORIGINHI).vec3f(D.T.MODELORIGINLO).mat3f(D.T.MODEL).mat3f(D.T.MODELNORMAL):t.mat4f(D.T.MODEL).mat4f(D.T.MODELNORMAL),(0,n.pC)(e.instanced)&&e.instanced.includes("color")&&(t=t.vec4f(D.T.INSTANCECOLOR)),(0,n.pC)(e.instanced)&&e.instanced.includes("featureAttribute")&&(t=t.vec4f(D.T.INSTANCEFEATUREATTRIBUTE)),t}(this.parameters):null}isVisibleInPass(e){return e!==Ct.MATERIAL_DEPTH_SHADOWMAP_ALL&&e!==Ct.MATERIAL_DEPTH_SHADOWMAP_DEFAULT&&e!==Ct.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{instanced:t,hasVertexColors:r,hasSymbolColors:i,vvColorEnabled:o}=e,a=(0,n.pC)(t)&&t.includes("color"),s="replace"===e.colorMixMode,l=e.opacity>0,c=e.externalColor&&e.externalColor[3]>0;return r&&(a||o||i)?!!s||l:r?s?c:l:a||o||i?!!s||l:s?c:l}getConfiguration(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.hasNormalTexture=!!this.parameters.normalTextureId,this.techniqueConfig.hasColorTexture=!!this.parameters.textureId,this.techniqueConfig.hasVertexTangents=this.parameters.hasVertexTangents,this.techniqueConfig.instanced=!!this.parameters.instanced,this.techniqueConfig.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this.techniqueConfig.vvSize=this.parameters.vvSizeEnabled,this.techniqueConfig.hasVerticalOffset=(0,n.pC)(this.parameters.verticalOffset),this.techniqueConfig.hasScreenSizePerspective=(0,n.pC)(this.parameters.screenSizePerspective),this.techniqueConfig.hasSlicePlane=this.parameters.hasSlicePlane,this.techniqueConfig.hasSliceHighlight=this.parameters.hasSliceHighlight,this.techniqueConfig.alphaDiscardMode=this.parameters.textureAlphaMode,this.techniqueConfig.normalType="screenDerivative"===this.parameters.normals?Be.h.ScreenDerivative:Be.h.Attribute,this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.writeDepth=this.parameters.writeDepth,(0,n.pC)(this.parameters.customDepthTest)&&(this.techniqueConfig.customDepthTest=this.parameters.customDepthTest),this.techniqueConfig.hasOccludees=this.parameters.hasOccludees,this.techniqueConfig.cullFace=this.parameters.hasSlicePlane?R.Vr.None:this.parameters.cullFace,this.techniqueConfig.hasMultipassTerrain=t.multipassTerrain.enabled,this.techniqueConfig.cullAboveGround=t.multipassTerrain.cullAboveGround,this.techniqueConfig.hasModelTransformation=(0,n.pC)(this.parameters.modelTransformation),e!==Fe.H.Color&&e!==Fe.H.Alpha||(this.techniqueConfig.hasVertexColors=this.parameters.hasVertexColors,this.techniqueConfig.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this.techniqueConfig.doubleSidedMode=He.q.WindingOrder:this.techniqueConfig.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?He.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?He.q.WindingOrder:He.q.None,this.techniqueConfig.instancedColor=(0,n.pC)(this.parameters.instanced)&&this.parameters.instanced.includes("color"),this.techniqueConfig.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this.techniqueConfig.receiveAmbientOcclusion=!!t.ssaoHelper.ready&&this.parameters.receiveSSAO,this.techniqueConfig.vvColor=this.parameters.vvColorEnabled,this.techniqueConfig.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this.techniqueConfig.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Ue.f7.Schematic:Ue.f7.Normal:Ue.f7.Disabled,this.techniqueConfig.hasMetalnessAndRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this.techniqueConfig.hasEmissionTexture=!!this.parameters.emissiveTextureId,this.techniqueConfig.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this.techniqueConfig.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.enableOffset=t.camera.relativeElevation<5e5),this.techniqueConfig}intersect(e,t,r,i,o,a,s){if((0,n.pC)(this.parameters.verticalOffset)){const e=i.camera;(0,c.s)(Er,r[12],r[13],r[14]);let t=null;switch(i.viewingMode){case De.JY.Global:t=(0,c.n)(br,Er);break;case De.JY.Local:t=(0,c.c)(br,xr)}let n=0;const s=(0,c.b)(Sr,Er,e.eye),l=(0,c.l)(s),u=(0,c.g)(s,s,1/l);let d=null;this.parameters.screenSizePerspective&&(d=(0,c.e)(t,u)),n+=(0,$t.Hx)(e,l,this.parameters.verticalOffset,d,this.parameters.screenSizePerspective),(0,c.g)(t,t,n),(0,c.t)(Ar,t,i.transform.inverseRotation),o=(0,c.b)(vr,o,Ar),a=(0,c.b)(Tr,a,Ar)}var l;(0,$t.Bw)(e,t,i,o,a,(l=i.verticalOffset,(0,n.pC)(l)?(Ht.offset=l,Ht):null),s)}requiresSlot(e){return e===(this.parameters.transparent?this.parameters.writeDepth?wt.TRANSPARENT_MATERIAL:wt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:wt.OPAQUE_MATERIAL)||e===wt.DRAPED_MATERIAL}createGLMaterial(e){return e.output===Fe.H.Color||e.output===Fe.H.Alpha||e.output===Fe.H.Depth||e.output===Fe.H.Normal||e.output===Fe.H.Shadow||e.output===Fe.H.Highlight?new mr(e):null}createBufferWriter(){return new _r(this.vertexBufferLayout,this.instanceBufferLayout)}}class mr extends ze.F{constructor(e){super({...e,...e.material.parameters})}_updateParameters(e){const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,c.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?fr:ar,e)}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==Fe.H.Color&&this._output!==Fe.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this._updateParameters(e)}}const gr=new class extends or{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}};class _r{constructor(e,t){this.vertexBufferLayout=e,this.instanceBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(D.T.POSITION).length}write(e,t,r,i){!function(e,t,r,i,n,o){for(const a of t.fieldNames){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)switch(a){case D.T.POSITION:{(0,w.hu)(3===t.size);const e=n.getField(a,h.ct);e&&Vt(s,t.data,r,e,o);break}case D.T.NORMAL:{(0,w.hu)(3===t.size);const e=n.getField(a,h.ct);e&&Wt(s,t.data,i,e,o);break}case D.T.UV0:{(0,w.hu)(2===t.size);const e=n.getField(a,h.Eu);e&&zt(s,t.data,e,o);break}case D.T.COLOR:{(0,w.hu)(3===t.size||4===t.size);const e=n.getField(a,h.mc);e&&kt(s,t.data,t.size,e,o);break}case D.T.SYMBOLCOLOR:{(0,w.hu)(3===t.size||4===t.size);const e=n.getField(a,h.mc);e&&kt(s,t.data,t.size,e,o);break}case D.T.TANGENT:{(0,w.hu)(4===t.size);const e=n.getField(a,h.ek);e&&qt(s,t.data,i,e,o);break}}}}(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,i)}}const vr=(0,u.c)(),Tr=(0,u.c)(),xr=(0,u.f)(0,0,1),br=(0,u.c)(),Ar=(0,u.c)(),Er=(0,u.c)(),Sr=(0,u.c)(),Mr=A.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Rr(e){throw new b.Z("",`Request for object resource failed: ${e}`)}function Cr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Mr.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Mr.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Mr.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Mr.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Mr.warn("Indexed geometries must specify faces"),i=!1;break}default:Mr.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Mr.warn("Geometry requires material"),i=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(Mr.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function wr(e){const t=(0,d.cS)();return e.forEach((e=>{const r=e.boundingInfo;(0,n.pC)(r)&&((0,d.pp)(t,r.getBBMin()),(0,d.pp)(t,r.getBBMax()))})),t}async function yr(e,t){const r=[];for(const i in e){const o=e[i],a=o.images[0].data;if(!a){Mr.warn("Externally referenced texture data is not yet supported");continue}const s=o.encoding+";base64,"+a,l="/textureDefinitions/"+i,c="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",u={noUnpackFlip:!0,wrap:{s:$.e8.REPEAT,t:$.e8.REPEAT},preMultiplyAlpha:Or(c)!==R.JJ.Opaque},d=(0,n.pC)(t)&&t.disableTextures?Promise.resolve(null):M(s,t);r.push(d.then((e=>({refId:l,image:e,params:u,alphaChannelUsage:c}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}function Or(e){switch(e){case"mask":return R.JJ.Mask;case"maskAndTransparency":return R.JJ.MaskBlend;case"none":return R.JJ.Opaque;default:return R.JJ.Blend}}function Pr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Nr=new S.G(1,2,"wosr");var Ir=r(57758),Dr=r(10816),Lr=r(75488),Fr=r(56067);async function Br(e,t){const r=Hr((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=(0,n.pC)(t)&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,x.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,E.r9)(i.error),Rr(i.error.details.url)}(e,r,t);const i=await(0,x.q6)((0,T.default)(e,(0,n.Wg)(t)));if(!0===i.ok)return i.value.data;(0,E.r9)(i.error),Rr(i.error)}(e,t);return{resource:r,textures:await yr(r.textureDefinitions,t)}}(r.url,t)),i=function(e,t){const r=[],i=[],o=[],a=[],s=e.resource,l=S.G.parse(s.version||"1.0","wosr");Nr.validate(l);const c=s.model.name,d=s.model.geometries,h=s.materialDefinitions,f=e.textures;let p=0;const m=new Map;for(let e=0;e<d.length;e++){const s=d[e];if(!Cr(s))continue;const l=Pr(s),c=s.params.vertexAttributes,g=[];for(const e in c){const t=c[e],r=t.values;g.push([e,{data:r,size:t.valuesPerElement,exclusive:!0}])}const _=[];if("PerAttributeArray"!==s.params.topology){const e=s.params.faces;for(const t in e)_.push([t,new Uint32Array(e[t].values)])}const v=f&&f[l.texture];if(v&&!m.has(l.texture)){const{image:e,params:t}=v,r=new Ie(e,t);a.push(r),m.set(l.texture,r)}const T=m.get(l.texture),x=T?T.id:void 0;let b=o[l.material]?o[l.material][l.texture]:null;if(!b){const e=h[l.material.substring(l.material.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=v&&v.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,a=v?Or(v.alphaChannelUsage):void 0,s={ambient:(0,u.d)(e.diffuse),diffuse:(0,u.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:a,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:R.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!v&&!!v.params.preMultiplyAlpha};(0,n.pC)(t)&&t.materialParamsMixin&&Object.assign(s,t.materialParamsMixin),b=new pr(s),o[l.material]||(o[l.material]={}),o[l.material][l.texture]=b}i.push(b);const A=new L(g,_);p+=_.position?_.position.length:0,r.push(A)}return{name:c,stageResources:{textures:a,materials:i,geometries:r},pivotOffset:s.model.pivotOffset,boundingBox:wr(r),numberOfVertices:p,lodThreshold:null}}(e,t);return{lods:[i],referenceBoundingBox:i.boundingBox,isEsriSymbolResource:!1,isWosr:!0,remove:e.remove}}const o=await(t.cache?t.cache.loadGLTF(r.url,t,t.usePBR):(0,_.z)(new g.C(t.streamDataRequester),r.url,t,t.usePBR)),a=(0,n.U2)(o.model.meta,"ESRI_proxyEllipsoid");o.meta.isEsriSymbolResource&&(0,n.pC)(a)&&o.meta.uri.includes("/RealisticTrees/")&&function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];e.customMeta.esriTreeRendering=!0;for(const o of i.parts){const i=o.attributes.normal;if((0,n.Wi)(i))return;const a=o.attributes.position,d=a.count,f=(0,u.c)(),p=(0,u.c)(),g=(0,u.c)(),_=(0,m.gS)(h.mc,d),v=(0,m.gS)(h.ct,d),T=(0,s.a)((0,l.c)(),o.transform);for(let n=0;n<d;n++){a.getVec(n,p),i.getVec(n,f),(0,c.m)(p,p,o.transform),(0,c.b)(g,p,t.center),(0,c.E)(g,g,t.radius);const s=g[2],l=(0,c.l)(g),u=Math.min(.45+.55*l*l,1);(0,c.E)(g,g,t.radius),(0,c.m)(g,g,T),(0,c.n)(g,g),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.h)(g,g,f,s>-1?.2:Math.min(-4*s-3.8,1)),v.setVec(n,g),_.set(n,0,255*u),_.set(n,1,255*u),_.set(n,2,255*u),_.set(n,3,255)}o.attributes.normal=v,o.attributes.color=_}}}(o,a);const d=o.meta.isEsriSymbolResource?{usePBR:t.usePBR,isSchematic:!1,treeRendering:!!o.customMeta.esriTreeRendering,mrrFactors:[0,1,.2]}:{usePBR:t.usePBR,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},f={...t.materialParamsMixin,treeRendering:!!o.customMeta.esriTreeRendering};if(null!=r.specifiedLodIndex){const e=Ur(o,d,f,r.specifiedLodIndex);let t=e[0].boundingBox;return 0!==r.specifiedLodIndex&&(t=Ur(o,d,f,0)[0].boundingBox),{lods:e,referenceBoundingBox:t,isEsriSymbolResource:o.meta.isEsriSymbolResource,isWosr:!1,remove:o.remove}}const p=Ur(o,d,f);return{lods:p,referenceBoundingBox:p[0].boundingBox,isEsriSymbolResource:o.meta.isEsriSymbolResource,isWosr:!1,remove:o.remove}}function Hr(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function Ur(e,t,r,i){const s=e.model,l=(0,a.c)(),c=new Array,u=new Map,g=new Map;return s.lods.forEach(((e,a)=>{if(void 0!==i&&a!==i)return;const _={name:e.name,stageResources:{textures:new Array,materials:new Array,geometries:new Array},lodThreshold:(0,n.pC)(e.lodThreshold)?e.lodThreshold:null,pivotOffset:[0,0,0],numberOfVertices:0,boundingBox:(0,d.cS)()};c.push(_),e.parts.forEach((e=>{const i=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),a=s.materials.get(e.material),c=(0,n.pC)(e.attributes.texCoord0),T=(0,n.pC)(e.attributes.normal),x=function(e){switch(e){case"BLEND":return R.JJ.Blend;case"MASK":return R.JJ.Mask;case"OPAQUE":case null:case void 0:return R.JJ.Opaque}}(a.alphaMode);if(!u.has(i)){if(c){if((0,n.pC)(a.textureColor)&&!g.has(a.textureColor)){const e=s.textures.get(a.textureColor),t={...e.parameters,preMultiplyAlpha:x!==R.JJ.Opaque};g.set(a.textureColor,new Ie(e.data,t))}if((0,n.pC)(a.textureNormal)&&!g.has(a.textureNormal)){const e=s.textures.get(a.textureNormal);g.set(a.textureNormal,new Ie(e.data,e.parameters))}if((0,n.pC)(a.textureOcclusion)&&!g.has(a.textureOcclusion)){const e=s.textures.get(a.textureOcclusion);g.set(a.textureOcclusion,new Ie(e.data,e.parameters))}if((0,n.pC)(a.textureEmissive)&&!g.has(a.textureEmissive)){const e=s.textures.get(a.textureEmissive);g.set(a.textureEmissive,new Ie(e.data,e.parameters))}if((0,n.pC)(a.textureMetallicRoughness)&&!g.has(a.textureMetallicRoughness)){const e=s.textures.get(a.textureMetallicRoughness);g.set(a.textureMetallicRoughness,new Ie(e.data,e.parameters))}}const o=a.color[0]**(1/Ir.K),l=a.color[1]**(1/Ir.K),d=a.color[2]**(1/Ir.K),h=a.emissiveFactor[0]**(1/Ir.K),f=a.emissiveFactor[1]**(1/Ir.K),p=a.emissiveFactor[2]**(1/Ir.K),m=(0,n.pC)(a.textureColor)&&c?g.get(a.textureColor):null;u.set(i,new pr({...t,transparent:x===R.JJ.Blend,customDepthTest:R.Gv.Lequal,textureAlphaMode:x,textureAlphaCutoff:a.alphaCutoff,diffuse:[o,l,d],ambient:[o,l,d],opacity:a.opacity,doubleSided:a.doubleSided,doubleSidedType:"winding-order",cullFace:a.doubleSided?R.Vr.None:R.Vr.Back,hasVertexColors:!!e.attributes.color,hasVertexTangents:!!e.attributes.tangent,normals:T?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,textureId:(0,n.pC)(m)?m.id:void 0,colorMixMode:a.colorMixMode,normalTextureId:(0,n.pC)(a.textureNormal)&&c?g.get(a.textureNormal).id:void 0,textureAlphaPremultiplied:(0,n.pC)(m)&&!!m.params.preMultiplyAlpha,occlusionTextureId:(0,n.pC)(a.textureOcclusion)&&c?g.get(a.textureOcclusion).id:void 0,emissiveTextureId:(0,n.pC)(a.textureEmissive)&&c?g.get(a.textureEmissive).id:void 0,metallicRoughnessTextureId:(0,n.pC)(a.textureMetallicRoughness)&&c?g.get(a.textureMetallicRoughness).id:void 0,emissiveFactor:[h,f,p],mrrFactors:[a.metallicFactor,a.roughnessFactor,t.mrrFactors[2]],isSchematic:!1,...r}))}const b=function(e,t){switch(t){case $.MX.TRIANGLES:return(0,v.nh)(e);case $.MX.TRIANGLE_STRIP:return(0,v.DA)(e);case $.MX.TRIANGLE_FAN:return(0,v.jX)(e)}}(e.indices||e.attributes.position.count,e.primitiveType),A=e.attributes.position.count,E=(0,m.gS)(h.ct,A);(0,f.t)(E,e.attributes.position,e.transform);const S=[[D.T.POSITION,{data:E.typedBuffer,size:E.elementCount,exclusive:!0}]],M=[[D.T.POSITION,b]];if((0,n.pC)(e.attributes.normal)){const t=(0,m.gS)(h.ct,A);(0,o.a)(l,e.transform),(0,f.a)(t,e.attributes.normal,l),S.push([D.T.NORMAL,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([D.T.NORMAL,b])}if((0,n.pC)(e.attributes.tangent)){const t=(0,m.gS)(h.ek,A);(0,o.a)(l,e.transform),(0,p.t)(t,e.attributes.tangent,l),S.push([D.T.TANGENT,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([D.T.TANGENT,b])}if((0,n.pC)(e.attributes.texCoord0)){const t=(0,m.gS)(h.Eu,A);(0,Dr.n)(t,e.attributes.texCoord0),S.push([D.T.UV0,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([D.T.UV0,b])}if((0,n.pC)(e.attributes.color)){const t=(0,m.gS)(h.mc,A);if(4===e.attributes.color.elementCount)e.attributes.color instanceof h.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof h.mc?(0,Lr.c)(t,e.attributes.color):e.attributes.color instanceof h.v6&&(0,p.s)(t,e.attributes.color,1/256);else{(0,Lr.f)(t,255,255,255,255);const r=new h.ne(t.buffer,0,4);e.attributes.color instanceof h.ct?(0,f.s)(r,e.attributes.color,255):e.attributes.color instanceof h.ne?(0,Fr.c)(r,e.attributes.color):e.attributes.color instanceof h.mw&&(0,f.s)(r,e.attributes.color,1/256)}S.push([D.T.COLOR,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([D.T.COLOR,b])}const C=new L(S,M);_.stageResources.geometries.push(C),_.stageResources.materials.push(u.get(i)),c&&((0,n.pC)(a.textureColor)&&_.stageResources.textures.push(g.get(a.textureColor)),(0,n.pC)(a.textureNormal)&&_.stageResources.textures.push(g.get(a.textureNormal)),(0,n.pC)(a.textureOcclusion)&&_.stageResources.textures.push(g.get(a.textureOcclusion)),(0,n.pC)(a.textureEmissive)&&_.stageResources.textures.push(g.get(a.textureEmissive)),(0,n.pC)(a.textureMetallicRoughness)&&_.stageResources.textures.push(g.get(a.textureMetallicRoughness))),_.numberOfVertices+=A;const w=C.boundingInfo;(0,n.pC)(w)&&((0,d.pp)(_.boundingBox,w.getBBMin()),(0,d.pp)(_.boundingBox,w.getBBMax()))}))})),c}},6206:(e,t,r)=>{var i,n;r.d(t,{a9:()=>i}),r(22021),(n=i||(i={}))[n.Multiply=1]="Multiply",n[n.Ignore=2]="Ignore",n[n.Replace=3]="Replace",n[n.Tint=4]="Tint"},65576:(e,t,r)=>{r.d(t,{U$:()=>s});var i=r(56481),n=r(79583);class o{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fieldNames){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new o(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t,r,i){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}}}class a{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(e,t){return this._appendField(e,i.Eu,t),this}vec2f64(e,t){return this._appendField(e,i.q6,t),this}vec3f(e,t){return this._appendField(e,i.ct,t),this}vec3f64(e,t){return this._appendField(e,i.fP,t),this}vec4f(e,t){return this._appendField(e,i.ek,t),this}vec4f64(e,t){return this._appendField(e,i.Cd,t),this}mat3f(e,t){return this._appendField(e,i.gK,t),this}mat3f64(e,t){return this._appendField(e,i.ey,t),this}mat4f(e,t){return this._appendField(e,i.bj,t),this}mat4f64(e,t){return this._appendField(e,i.O1,t),this}vec4u8(e,t){return this._appendField(e,i.mc,t),this}f32(e,t){return this._appendField(e,i.ly,t),this}f64(e,t){return this._appendField(e,i.oS,t),this}u8(e,t){return this._appendField(e,i.D_,t),this}u16(e,t){return this._appendField(e,i.av,t),this}i8(e,t){return this._appendField(e,i.Hz,t),this}vec2i8(e,t){return this._appendField(e,i.Vs,t),this}vec2i16(e,t){return this._appendField(e,i.or,t),this}vec2u8(e,t){return this._appendField(e,i.xA,t),this}vec4u16(e,t){return this._appendField(e,i.v6,t),this}u32(e,t){return this._appendField(e,i.Nu,t),this}_appendField(e,t,r){const i=t.ElementCount*(0,n.n1)(t.ElementType),o=this.stride;this.fields.set(e,{size:i,constructor:t,offset:o,optional:r}),this.stride+=i,this.fieldNames.push(e)}alignTo(e){return this.stride=Math.floor((this.stride+e-1)/e)*e,this}hasField(e){return this.fieldNames.includes(e)}createBuffer(e){return new o(this,e)}createView(e){return new o(this,e)}clone(){const e=new a;return e.stride=this.stride,e.fields=new Map,this.fields.forEach(((t,r)=>e.fields.set(r,t))),e.fieldNames=this.fieldNames.slice(),e.BufferType=this.BufferType,e}}function s(){return new a}},1391:(e,t,r)=>{r.d(t,{q:()=>s});var i=r(18361),n=r(2095),o=r(19693),a=r(74709);function s(e,t){t.output===i.H.Color&&t.receiveShadows?(e.varyings.add("linearDepth","float"),e.vertex.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`)):t.output===i.H.Depth||t.output===i.H.Shadow?(e.include(n.up,t),e.varyings.add("linearDepth","float"),e.vertex.uniforms.add(new o.A("nearFar",((e,t)=>t.camera.nearFar))),e.vertex.code.add(a.H`void forwardLinearDepth() {
160
160
  linearDepth = (-vPosition_view.z - nearFar[0]) / (nearFar[1] - nearFar[0]);
161
161
  }`)):e.vertex.code.add(a.H`void forwardLinearDepth() {}`)}},62707:(e,t,r)=>{r.d(t,{w:()=>n});var i=r(74709);function n(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
162
162
  vec3 camToVert = posWorld - camPosWorld;
@@ -970,4 +970,4 @@ const vec4 RGBA_2_FLOAT_FACTORS = vec4(
970
970
  );
971
971
  float rgba2float(vec4 rgba) {
972
972
  return dot(rgba, RGBA_2_FLOAT_FACTORS);
973
- }`)}},93669:(e,t,r)=>{r.d(t,{h:()=>f,S:()=>p});var i=r(52138),n=r(10937),o=r(17896),a=r(65617),s=r(70582),l=r(172),c=r(79884),u=r(67498);class d extends c.x{constructor(e,t){super(e,"mat4",u.P.Draw,((r,i,n)=>r.setUniformMatrix4fv(e,t(i,n))))}}var h=r(8319);function f(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,o.s)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function p(e,t){if(e.vertex.uniforms.add(new h.g("proj",((e,t)=>t.camera.projectionMatrix))),t.instancedDoublePrecision){const t=(e,t)=>(0,o.s)(g,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]);e.vertex.uniforms.add(new h.g("view",((e,r)=>(0,i.j)(m,r.camera.viewMatrix,t(e,r)))));const r=new l.J("localOrigin",t);return e.vertex.uniforms.add(r),r}e.vertex.uniforms.add(new d("view",((e,t)=>(0,i.j)(m,t.camera.viewMatrix,e.origin))));const r=new s.B("localOrigin",(e=>e.origin));return e.vertex.uniforms.add(r),r}const m=(0,n.c)(),g=(0,a.c)()},19693:(e,t,r)=>{r.d(t,{A:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"vec2",n.P.Pass,((r,i,n)=>r.setUniform2fv(e,t(i,n))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"vec3",n.P.Draw,((r,i,n)=>r.setUniform3fv(e,t(i,n))))}}},172:(e,t,r)=>{r.d(t,{J:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"vec3",n.P.Pass,((r,i,n)=>r.setUniform3fv(e,t(i,n))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"vec4",n.P.Pass,((r,i,n)=>r.setUniform4fv(e,t(i,n))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"float",n.P.Pass,((r,i,n)=>r.setUniform1f(e,t(i,n))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"int",n.P.Pass,((r,i,n)=>r.setUniform1i(e,t(i,n))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"mat3",n.P.Draw,((r,i,n)=>r.setUniformMatrix3fv(e,t(i,n))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"mat3",n.P.Pass,((r,i,n)=>r.setUniformMatrix3fv(e,t(i,n))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"mat4",n.P.Pass,((r,i,n)=>r.setUniformMatrix4fv(e,t(i,n))))}}},85594:(e,t,r)=>{r.d(t,{B:()=>n});var i=r(79884);class n extends i.x{constructor(e){super(e,"mat4")}}},33680:(e,t,r)=>{r.d(t,{kG:()=>l});var i=r(20102),n=r(92604),o=r(70586);const a=n.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this.includedModules=new Map}include(e,t){if(this.includedModules.has(e)){const r=this.includedModules.get(e);if(r!==t){a.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this.includedModules.set(e,t),e(this.builder,t)}}class l extends s{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new h,this.varyings=new f,this.extensions=new p,this.constants=new m}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s="vertex"===e?_:g,l=this.constants.generateSource().concat(n.constants.generateSource());return`\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${o.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${a.join("\n")}`}generateBind(e,t){const r=new Map;this.vertex.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,o.pC)(i)&&r.set(t.name,i)})),this.fragment.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,o.pC)(i)&&r.set(t.name,i)}));const i=Array.from(r.values()),n=i.length;return(e,r)=>{for(let o=0;o<n;++o)i[o](t,e,r)}}}class c{constructor(){this._entries=new Map}add(e){if(!Array.isArray(e))return this._add(e);for(const t of e)this._add(t)}_add(e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}generateSource(){return Array.from(this._entries.values()).map((e=>(0,o.pC)(e.arraySize)?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class u{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class d extends s{constructor(){super(...arguments),this.uniforms=new c,this.code=new u,this.constants=new m}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`attribute ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(){return this._entries.map((e=>`varying ${e[1]} ${e[0]};`))}}class p{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?p.ALLOWLIST_VERTEX:p.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}p.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],p.ALLOWLIST_VERTEX=[];class m{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=m._numberToFloatStr(r);break;case"int":i=m._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${m._numberToFloatStr(r[0])}, ${m._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${m._numberToFloatStr(r[0])}, ${m._numberToFloatStr(r[1])}, ${m._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${m._numberToFloatStr(r[0])}, ${m._numberToFloatStr(r[1])}, ${m._numberToFloatStr(r[2])}, ${m._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${m._numberToIntStr(r[0])}, ${m._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${m._numberToIntStr(r[0])}, ${m._numberToIntStr(r[1])}, ${m._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${m._numberToIntStr(r[0])}, ${m._numberToIntStr(r[1])}, ${m._numberToIntStr(r[2])}, ${m._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>m._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",_="precision highp float;\nprecision highp sampler2D;"},46826:(e,t,r)=>{r.d(t,{F:()=>u});var i=r(70586),n=r(4307),o=r(97323),a=r(79884),s=r(67498);class l extends a.x{constructor(e,t){super(e,"vec2",s.P.Draw,((r,i,n)=>r.setUniform2fv(e,t(i,n))))}}class c extends a.x{constructor(e,t){super(e,"sampler2D",s.P.Draw,((r,i,n)=>r.bindTexture(e,t(i,n))))}}function u(e,t,r){const a=[new c(e,t)];if(r){const r=e+"Size";a.push(new l(r,((e,r)=>{const a=t(e,r);return(0,i.pC)(a)?(0,n.a)(d,a.descriptor.width,a.descriptor.height):o.Z})))}return a}const d=(0,o.a)()},98069:(e,t,r)=>{r.d(t,{A:()=>c,J:()=>u});var i=r(70586),n=r(4307),o=r(97323),a=r(19693),s=r(79884),l=r(67498);class c extends s.x{constructor(e,t){super(e,"sampler2D",l.P.Pass,((r,i,n)=>r.bindTexture(e,t(i,n))))}}function u(e,t,r){const s=[new c(e,t)];if(r){const r=e+"Size";s.push(new a.A(r,((e,r)=>{const a=t(e,r);return(0,i.pC)(a)?(0,n.a)(d,a.descriptor.width,a.descriptor.height):o.Z})))}return s}const d=(0,o.a)()},79884:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(70586),n=r(67498);class o{constructor(e,t,r,o,a=null){this.name=e,this.type=t,this.arraySize=a,this.bind={[n.P.Pass]:null,[n.P.Draw]:null},(0,i.pC)(r)&&(0,i.pC)(o)&&(this.bind[r]=o)}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>n,K:()=>i});class i{}function n(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}!function(e){e.int=function(e){return Math.round(e).toString()},e.float=function(e){return e.toPrecision(8)}}(n||(n={}))},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},17662:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(99001);class n{constructor(){this.id=(0,i.D)()}unload(){}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Geometry=2]="Geometry",e[e.Material=3]="Material",e[e.Texture=4]="Texture",e[e.COUNT=5]="COUNT"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>n});var i=r(35065);const n=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.INSTANCECOLOR,7],[i.T.MODEL,8],[i.T.MODELNORMAL,12],[i.T.MODELORIGINHI,11],[i.T.MODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>s});var i=r(70586),n=r(95330),o=r(74709),a=r(47026);class s extends class{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}ensureTechnique(e,t,r=this._output){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(r,t),this._technique),this._technique}ensureResources(e){return a.Rw.LOADED}}{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?a.Rw.LOADED:a.Rw.LOADING}get textureBindParameters(){return new l((0,i.pC)(this._texture)?this._texture.glTexture:null,(0,i.pC)(this._textureNormal)?this._textureNormal.glTexture:null,(0,i.pC)(this._textureEmissive)?this._textureEmissive.glTexture:null,(0,i.pC)(this._textureOcclusion)?this._textureOcclusion.glTexture:null,(0,i.pC)(this._textureMetallicRoughness)?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){((0,i.Wi)(this._texture)||e!==this._texture.id)&&(this._texture=(0,i.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if((0,i.Wi)(e))return void t(null);const r=this._textureRepository.acquire(e);if((0,n.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class l extends o.K{constructor(e=null,t=null,r=null,i=null,n=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=n}}},82791:(e,t,r)=>{r.d(t,{F5:()=>u,yD:()=>i});var i,n,o=r(70586),a=(r(74709),r(17662)),s=r(4726),l=r(83475),c=r(37782);class u extends a.c{constructor(e,t){super(),this.type=s.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=l.i,this._parameters=(0,c.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,c.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleInPass(e.pass)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleInPass(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){(0,o.pC)(this.repository)&&this.repository.materialChanged(this)}}(n=i||(i={}))[n.Occlude=1]="Occlude",n[n.Transparent=2]="Transparent",n[n.OccludeAndTransparent=4]="OccludeAndTransparent",n[n.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",n[n.Opaque=16]="Opaque"},50173:(e,t,r)=>{var i;r.d(t,{C:()=>i}),function(e){e[e.MATERIAL=0]="MATERIAL",e[e.MATERIAL_ALPHA=1]="MATERIAL_ALPHA",e[e.MATERIAL_DEPTH=2]="MATERIAL_DEPTH",e[e.MATERIAL_NORMAL=3]="MATERIAL_NORMAL",e[e.MATERIAL_DEPTH_SHADOWMAP_ALL=4]="MATERIAL_DEPTH_SHADOWMAP_ALL",e[e.MATERIAL_HIGHLIGHT=5]="MATERIAL_HIGHLIGHT",e[e.MATERIAL_DEPTH_SHADOWMAP_DEFAULT=6]="MATERIAL_DEPTH_SHADOWMAP_DEFAULT",e[e.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT=7]="MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT"}(i||(i={}))},97995:(e,t,r)=>{var i;r.d(t,{r:()=>i}),function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",e[e.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",e[e.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",e[e.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",e[e.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",e[e.LASERLINES=12]="LASERLINES",e[e.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",e[e.HUD_MATERIAL=14]="HUD_MATERIAL",e[e.LABEL_MATERIAL=15]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=16]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",e[e.DRAPED_WATER=19]="DRAPED_WATER",e[e.VOXEL=20]="VOXEL",e[e.MAX_SLOTS=21]="MAX_SLOTS"}(i||(i={}))},11726:(e,t,r)=>{r.d(t,{hu:()=>n,yK:()=>o}),r(97323),r(98766),(0,r(88669).c)();class i{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}}function n(e,t){if(!e)throw t=t||"assert",console.log(new Error(t).stack),new i(t)}function o(e,t,r,i){let n,o=(r[0]-e[0])/t[0],a=(i[0]-e[0])/t[0];o>a&&(n=o,o=a,a=n);let s=(r[1]-e[1])/t[1],l=(i[1]-e[1])/t[1];if(s>l&&(n=s,s=l,l=n),o>l||s>a)return!1;s>o&&(o=s),l<a&&(a=l);let c=(r[2]-e[2])/t[2],u=(i[2]-e[2])/t[2];return c>u&&(n=c,c=u,u=n),!(o>u||c>a||(u<a&&(a=u),a<0))}},35065:(e,t,r)=>{var i;r.d(t,{T:()=>i}),function(e){e.POSITION="position",e.NORMAL="normal",e.UV0="uv0",e.AUXPOS1="auxpos1",e.AUXPOS2="auxpos2",e.MAPPOS="mapPos",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.TANGENT="tangent",e.OFFSET="offset",e.SUBDIVISIONFACTOR="subdivisionFactor",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.NORMALCOMPRESSED="normalCompressed",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.FEATUREVALUE="featureValue",e.MODELORIGINHI="modelOriginHi",e.MODELORIGINLO="modelOriginLo",e.MODEL="model",e.MODELNORMAL="modelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMALA="normalA",e.NORMALB="normalB",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.U8PADDING="u8padding",e.U16PADDING="u16padding",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.EXTRUDE="extrude"}(i||(i={}))},47026:(e,t,r)=>{var i,n,o,a,s,l,c,u,d,h,f,p,m,g;r.d(t,{Am:()=>a,CE:()=>f,Gv:()=>n,JJ:()=>m,MX:()=>h,Rw:()=>l,Vr:()=>i,hU:()=>c}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(n||(n={})),function(e){e[e.NONE=0]="NONE",e[e.SMAA=1]="SMAA"}(o||(o={})),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(a||(a={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(s||(s={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(l||(l={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(c||(c={})),function(e){e[e.ASYNC=0]="ASYNC",e[e.SYNC=1]="SYNC"}(u||(u={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(d||(d={})),function(e){e[e.Triangle=0]="Triangle",e[e.Point=1]="Point",e[e.Line=2]="Line"}(h||(h={})),function(e){e[e.STRETCH=1]="STRETCH",e[e.PAD=2]="PAD"}(f||(f={})),function(e){e[e.CHANGED=0]="CHANGED",e[e.UNCHANGED=1]="UNCHANGED"}(p||(p={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(m||(m={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(g||(g={}))},9749:(e,t,r)=>{r.d(t,{V:()=>n}),r(17896);var i=r(65617);r(22021),(0,i.c)();const n=.4;(0,i.c)()},37782:(e,t,r)=>{r.d(t,{FZ:()=>w,Uf:()=>M,Bw:()=>g,LO:()=>R,Hx:()=>S});var i=r(67676),n=r(22021),o=r(70586),a=r(17896),s=r(65617),l=r(60437),c=r(47026);function u(e,t){return Math.max((0,n.t7)(e*t.scale,e,t.factor),function(e,t){return 0===e?t.minPixelSize:t.minPixelSize*(1+2*t.paddingPixels/e)}(e,t))}r(64822),(0,n.Vl)(10),(0,n.Vl)(12),(0,n.Vl)(70),(0,n.Vl)(40);const d={scale:0,factor:0,minPixelSize:0,paddingPixels:0};var h=r(11726),f=r(35065),p=(r(52138),r(13598));r(9820),new Float64Array(3),new Float32Array(6),(0,p.c)();const m=(0,l.Ue)();function g(e,t,r,i,n,a,s){if(!function(e){return!!(0,o.pC)(e)&&!e.visible}(t))if(e.boundingInfo){(0,h.hu)(e.primitiveType===c.MX.Triangle);const t=r.tolerance;v(e.boundingInfo,i,n,t,a,s)}else{const t=e.indices.get(f.T.POSITION),r=e.vertexAttributes.get(f.T.POSITION);x(i,n,0,t.length/3,t,r,void 0,a,s)}}const _=(0,s.c)();function v(e,t,r,i,n,s){if((0,o.Wi)(e))return;const c=function(e,t,r){return(0,a.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,_);if((0,l.op)(m,e.getBBMin()),(0,l.Tn)(m,e.getBBMax()),(0,o.pC)(n)&&n.applyToAabb(m),function(e,t,r,i){return function(e,t,r,i,n){const o=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(o,a),l=Math.max(o,a);const c=(e[1]-i-t[1])*r[1],u=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,u)),l<0)return!1;if(s=Math.max(s,Math.min(c,u)),s>l)return!1;const d=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(d,h)),!(l<0)&&(s=Math.max(s,Math.min(d,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(m,t,c,i)){const{primitiveIndices:o,indices:a,position:l}=e,c=o?o.length:a.length/3;if(c>y){const o=e.getChildren();if(void 0!==o){for(let e=0;e<8;++e)void 0!==o[e]&&v(o[e],t,r,i,n,s);return}}x(t,r,0,c,a,l,o,n,s)}}const T=(0,s.c)();function x(e,t,r,i,n,a,s,l,c){if(s)return function(e,t,r,i,n,a,s,l,c){const u=a.data,d=a.stride||a.size,h=e[0],f=e[1],p=e[2],m=t[0]-h,g=t[1]-f,_=t[2]-p;for(let e=r;e<i;++e){const t=s[e];let r=3*t,i=d*n[r++],a=u[i++],v=u[i++],x=u[i];i=d*n[r++];let b=u[i++],A=u[i++],S=u[i];i=d*n[r];let M=u[i++],R=u[i++],C=u[i];(0,o.pC)(l)&&([a,v,x]=l.applyToVertex(a,v,x,e),[b,A,S]=l.applyToVertex(b,A,S,e),[M,R,C]=l.applyToVertex(M,R,C,e));const w=b-a,y=A-v,O=S-x,P=M-a,N=R-v,I=C-x,D=g*I-N*_,L=_*P-I*m,F=m*N-P*g,B=w*D+y*L+O*F;if(Math.abs(B)<=Number.EPSILON)continue;const H=h-a,U=f-v,z=p-x,G=H*D+U*L+z*F;if(B>0){if(G<0||G>B)continue}else if(G>0||G<B)continue;const V=U*O-y*z,W=z*w-O*H,q=H*y-w*U,k=m*V+g*W+_*q;if(B>0){if(k<0||G+k>B)continue}else if(k>0||G+k<B)continue;const $=(P*V+N*W+I*q)/B;$>=0&&c($,E(w,y,O,P,N,I,T),t,!1)}}(e,t,r,i,n,a,s,l,c);const u=a.data,d=a.stride||a.size,h=e[0],f=e[1],p=e[2],m=t[0]-h,g=t[1]-f,_=t[2]-p;for(let e=r,t=3*r;e<i;++e){let r=d*n[t++],i=u[r++],a=u[r++],s=u[r];r=d*n[t++];let v=u[r++],x=u[r++],b=u[r];r=d*n[t++];let A=u[r++],S=u[r++],M=u[r];(0,o.pC)(l)&&([i,a,s]=l.applyToVertex(i,a,s,e),[v,x,b]=l.applyToVertex(v,x,b,e),[A,S,M]=l.applyToVertex(A,S,M,e));const R=v-i,C=x-a,w=b-s,y=A-i,O=S-a,P=M-s,N=g*P-O*_,I=_*y-P*m,D=m*O-y*g,L=R*N+C*I+w*D;if(Math.abs(L)<=Number.EPSILON)continue;const F=h-i,B=f-a,H=p-s,U=F*N+B*I+H*D;if(L>0){if(U<0||U>L)continue}else if(U>0||U<L)continue;const z=B*w-C*H,G=H*R-w*F,V=F*C-R*B,W=m*z+g*G+_*V;if(L>0){if(W<0||U+W>L)continue}else if(W>0||U+W<L)continue;const q=(y*z+O*G+P*V)/L;q>=0&&c(q,E(R,C,w,y,O,P,T),e,!1)}}const b=(0,s.c)(),A=(0,s.c)();function E(e,t,r,i,n,o,s){return(0,a.s)(b,e,t,r),(0,a.s)(A,i,n,o),(0,a.f)(s,b,A),(0,a.n)(s,s),s}function S(e,t,r,i,a){let s=(r.screenLength||0)*e.pixelRatio;(0,o.pC)(a)&&(s=function(e,t,r,i){return u(e,function(e,t,r){const i=r.parameters,n=r.paddingPixelsOverride;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d.minPixelSize=i.minPixelSize,d.paddingPixels=n,d}(t,r,i))}(s,i,t,a));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.uZ)(l*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function M(e,t){const r=t?M(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=C(i)),null==i&&t in r||(r[t]=i)}return r}function R(e,t){let r=!1;for(const n in t){const o=t[n];void 0!==o&&(Array.isArray(o)?null===e[n]?(e[n]=o.slice(),r=!0):(0,i.Vx)(e[n],o)&&(r=!0):e[n]!==o&&(r=!0,e[n]=o))}return r}function C(e){const t=[];return e.forEach((e=>t.push(e))),t}const w={multiply:1,ignore:2,replace:3,tint:4},y=1e3},64822:(e,t,r)=>{var i;r.d(t,{JY:()=>i}),function(e){e[e.Global=1]="Global",e[e.Local=2]="Local"}(i||(i={}))},75656:(e,t,r)=>{r.d(t,{x:()=>c}),r(80442);var i=r(22021),n=r(70586),o=r(49300),a=r(54738),s=r(35371),l=r(46314);class c{constructor(e,t,r=null){if(this._context=e,this.type="texture",this._glName=null,this._descriptor=void 0,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(s._g.Texture,this),this._descriptor={target:s.No.TEXTURE_2D,samplingMode:s.cw.LINEAR,wrapMode:s.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1,...t},e.type!==a.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),h(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(s._g.Texture,this))}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=s.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=s.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const i=this._descriptor;t??(t=i.target);const a=h(t);null===e&&(i.width=i.width||4,i.height=i.height||4,a&&(i.depth=i.depth??1));const p=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),c._validateTexture(this._context,i),this._configurePixelStorage();const m=i.pixelFormat;let g=i.internalFormat?i.internalFormat:this._deriveInternalFormat(m,i.dataType);if(d(e)){let n=e.width,s=e.height;const l=1;e instanceof HTMLVideoElement&&(n=e.videoWidth,s=e.videoHeight),i.width&&i.height,a&&i.depth,i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,g,i.hasMipmap,n,s,l),this._texImage(t,0,g,n,s,l,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap(),void 0===i.width&&(i.width=n),void 0===i.height&&(i.height=s),a&&void 0===i.depth&&(i.depth=l)}else{const{width:c,height:d,depth:h}=i;if(null!=c&&null!=d||console.error("Width and height must be specified!"),a&&null==h&&console.error("Depth must be specified!"),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,g,i.hasMipmap,c,d,h),r.DEPTH24_STENCIL8&&g===r.DEPTH_STENCIL&&(g=r.DEPTH24_STENCIL8),u(e)){const n=e.levels,o=f(t,c,d,h),a=Math.min(o-1,n.length-1);(0,l.Z)(r)?r.texParameteri(i.target,r.TEXTURE_MAX_LEVEL,a):i.hasMipmap=i.hasMipmap&&o===n.length;const u=g;if(!function(e){return e in s.q_}(u))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel(((e,r,i,o)=>{const a=n[Math.min(e,n.length-1)];this._compressedTexImage(t,e,u,r,i,o,a)}),a)}else(0,n.pC)(e)?(this._texImage(t,0,g,c,d,h,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((e,i,n,a)=>{this._texImage(t,e,g,i,n,a,null),(0,o.zu)(r)}))}c._applySamplingMode(r,this._descriptor),c._applyWrapMode(r,this._descriptor),c._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,o.zu)(r),this._context.bindTexture(p,c.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,i,n,o){o||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const a=this._context.gl,s=this._descriptor,{pixelFormat:l,internalFormat:h,dataType:f,isImmutable:p,target:m}=s;if(p&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const g=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);(t<0||r<0||i>s.width||n>s.height||t+i>s.width||r+n>s.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),d(o)?a.texSubImage2D(m,e,t,r,l,f,o):u(o)?a.compressedTexSubImage2D(m,e,t,r,i,n,h,o.levels[e]):a.texSubImage2D(m,e,t,r,i,n,l,f,o),this._context.bindTexture(g,c.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,i,n,o,a,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const d=this._context.gl;if(!(0,l.Z)(d))throw new Error("3D textures are not supported in WebGL1");const f=this._descriptor,{pixelFormat:p,dataType:m,isImmutable:g,target:_,internalFormat:v}=f;if(g&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");h(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const T=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||i<0||n>f.width||o>f.height||a>f.depth||t+n>f.width||r+o>f.height||i+a>f.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),u(s))s=s.levels[e],d.compressedTexSubImage3D(_,e,t,r,i,n,o,a,v,s);else{const l=s;d.texSubImage3D(_,e,t,r,i,n,o,a,p,m,l)}this._context.bindTexture(T,c.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,c._validateTexture(this._context,e)}e.samplingMode===s.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=s.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===s.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=s.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,c.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,c._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(c._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(c._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===a.zO.WEBGL1)return e;switch(t){case s.Br.FLOAT:switch(e){case s.VI.RGBA:return s.lP.RGBA32F;case s.VI.RGB:return s.lP.RGB32F;default:throw new Error("Unable to derive format")}case s.Br.UNSIGNED_BYTE:switch(e){case s.VI.RGBA:return s.lP.RGBA8;case s.VI.RGB:return s.lP.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,i,n,o){const a=this._context.gl;if(!(0,l.Z)(a))throw new Error("Immutable textures are not supported in WebGL1");if(!function(e){return e in s.lP}(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?f(e,i,n,o):1;h(e)?a.texStorage3D(e,c,t,i,n,o):a.texStorage2D(e,c,t,i,n),this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,o,s,l){const c=this._context.gl;let u=null;const f=this._context.type===a.zO.WEBGL2,p=h(e),{isImmutable:m,pixelFormat:g,dataType:_}=this._descriptor;if(f&&(u=c),f||!d(l))if(m){if((0,n.pC)(l)){const r=l;p?u.texSubImage3D(e,t,0,0,0,i,o,s,g,_,r):c.texSubImage2D(e,t,0,0,i,o,g,_,r)}}else{const a=(0,n.Wg)(l);p?u.texImage3D(e,t,r,i,o,s,0,g,_,a):c.texImage2D(e,t,r,i,o,0,g,_,a)}else c.texImage2D(e,0,r,g,_,l)}_compressedTexImage(e,t,r,i,o,s,l){const c=this._context.gl;let u=null;const d=h(e),f=this._descriptor.isImmutable;if(d){if(this._context.type!==a.zO.WEBGL2)throw new Error("3D textures are not supported in WebGL1");u=c}f?(0,n.pC)(l)&&(d?u.compressedTexSubImage3D(e,t,0,0,0,i,o,s,r,l):c.compressedTexSubImage2D(e,t,0,0,i,o,r,l)):d?u.compressedTexImage3D(e,t,r,i,o,s,0,l):c.compressedTexImage2D(e,t,r,i,o,0,l)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:n,hasMipmap:o,target:a}=this._descriptor;const l=a===s.No.TEXTURE_3D;for(let a=0;e(a,r,i,n),o&&(1!==r||1!==i||l&&1!==n)&&!(a>=t);++a)r=Math.max(1,r>>1),i=Math.max(1,i>>1),l&&(n=Math.max(1,n>>1))}static _validateTexture(e,t){(t.width<0||t.height<0||t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=(0,l.Z)(e.gl),n=(0,i.wt)(t.width)&&(0,i.wt)(t.height);r||!t.isImmutable&&!h(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||n||("number"==typeof t.wrapMode?t.wrapMode!==s.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===s.e8.CLAMP_TO_EDGE&&t.wrapMode.t===s.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let r=t.samplingMode,i=t.samplingMode;r===s.cw.LINEAR_MIPMAP_NEAREST||r===s.cw.LINEAR_MIPMAP_LINEAR?(r=s.cw.LINEAR,t.hasMipmap||(i=s.cw.LINEAR)):r!==s.cw.NEAREST_MIPMAP_NEAREST&&r!==s.cw.NEAREST_MIPMAP_LINEAR||(r=s.cw.NEAREST,t.hasMipmap||(i=s.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}function u(e){return(0,n.pC)(e)&&"type"in e&&"compressed"===e.type}function d(e){return(0,n.pC)(e)&&!u(e)&&!function(e){return(0,n.pC)(e)&&"byteLength"in e}(e)}function h(e){return e===s.No.TEXTURE_3D||e===s.No.TEXTURE_2D_ARRAY}function f(e,t,r,i=1){let n=Math.max(t,r);return e===s.No.TEXTURE_3D&&(n=Math.max(n,i)),Math.round(Math.log(n)/Math.LN2)+1}c.TEXTURE_UNIT_FOR_UPDATES=0},21968:(e,t,r)=>{r.d(t,{G:()=>i});class i{constructor(e,t,r,i,n,o=!1,a=0){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=a}}},46314:(e,t,r)=>{function i(e){return window.WebGL2RenderingContext&&e instanceof window.WebGL2RenderingContext}r.d(t,{Z:()=>i})},49300:(e,t,r)=>{r.d(t,{CG:()=>l,hZ:()=>s,zu:()=>c});var i=r(20102),n=r(80442);const o=r(92604).Z.getLogger("esri/views/webgl"),a=!!(0,n.Z)("enable-feature:webgl-debug");function s(){return a}function l(){return a}function c(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),n=(new Error).stack;o.error(new i.Z("webgl-error","WebGL error occured",{message:r,stack:n}))}}}},54738:(e,t,r)=>{r.d(t,{Sh:()=>a,kr:()=>s,zO:()=>i});var i,n,o=r(80442);function a(e){const t=(0,o.Z)("esri-force-webgl");if(t===i.WEBGL1||t===i.WEBGL2)return[t];switch(e){case"2d":case"3d":return[i.WEBGL2,i.WEBGL1]}}function s(e,t,r={}){const n=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let o=null;for(const t of n){try{o=e.getContext(t,r)}catch(e){}if(o)break}return o}(n=i||(i={}))[n.WEBGL1=1]="WEBGL1",n[n.WEBGL2=2]="WEBGL2"},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)o[0]=e[i],t[i]=o[0];return t}function n(e,t){const r=e.length;for(let i=0;i<r;++i)o[0]=e[i],o[1]=e[i]-o[0],t[i]=o[1];return t}r.d(t,{GB:()=>n,U8:()=>i});const o=new Float32Array(2)}}]);
973
+ }`)}},93669:(e,t,r)=>{r.d(t,{h:()=>f,S:()=>p});var i=r(52138),n=r(10937),o=r(17896),a=r(65617),s=r(70582),l=r(172),c=r(79884),u=r(67498);class d extends c.x{constructor(e,t){super(e,"mat4",u.P.Draw,((r,i,n)=>r.setUniformMatrix4fv(e,t(i,n))))}}var h=r(8319);function f(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,o.s)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function p(e,t){if(e.vertex.uniforms.add(new h.g("proj",((e,t)=>t.camera.projectionMatrix))),t.instancedDoublePrecision){const t=(e,t)=>(0,o.s)(g,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]);e.vertex.uniforms.add(new h.g("view",((e,r)=>(0,i.j)(m,r.camera.viewMatrix,t(e,r)))));const r=new l.J("localOrigin",t);return e.vertex.uniforms.add(r),r}e.vertex.uniforms.add(new d("view",((e,t)=>(0,i.j)(m,t.camera.viewMatrix,e.origin))));const r=new s.B("localOrigin",(e=>e.origin));return e.vertex.uniforms.add(r),r}const m=(0,n.c)(),g=(0,a.c)()},19693:(e,t,r)=>{r.d(t,{A:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"vec2",n.P.Pass,((r,i,n)=>r.setUniform2fv(e,t(i,n))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"vec3",n.P.Draw,((r,i,n)=>r.setUniform3fv(e,t(i,n))))}}},172:(e,t,r)=>{r.d(t,{J:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"vec3",n.P.Pass,((r,i,n)=>r.setUniform3fv(e,t(i,n))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"vec4",n.P.Pass,((r,i,n)=>r.setUniform4fv(e,t(i,n))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"float",n.P.Pass,((r,i,n)=>r.setUniform1f(e,t(i,n))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"int",n.P.Pass,((r,i,n)=>r.setUniform1i(e,t(i,n))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"mat3",n.P.Draw,((r,i,n)=>r.setUniformMatrix3fv(e,t(i,n))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"mat3",n.P.Pass,((r,i,n)=>r.setUniformMatrix3fv(e,t(i,n))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>o});var i=r(79884),n=r(67498);class o extends i.x{constructor(e,t){super(e,"mat4",n.P.Pass,((r,i,n)=>r.setUniformMatrix4fv(e,t(i,n))))}}},85594:(e,t,r)=>{r.d(t,{B:()=>n});var i=r(79884);class n extends i.x{constructor(e){super(e,"mat4")}}},33680:(e,t,r)=>{r.d(t,{kG:()=>l});var i=r(20102),n=r(92604),o=r(70586);const a=n.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this.includedModules=new Map}include(e,t){if(this.includedModules.has(e)){const r=this.includedModules.get(e);if(r!==t){a.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this.includedModules.set(e,t),e(this.builder,t)}}class l extends s{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new h,this.varyings=new f,this.extensions=new p,this.constants=new m}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s="vertex"===e?_:g,l=this.constants.generateSource().concat(n.constants.generateSource());return`\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${o.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${a.join("\n")}`}generateBind(e,t){const r=new Map;this.vertex.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,o.pC)(i)&&r.set(t.name,i)})),this.fragment.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,o.pC)(i)&&r.set(t.name,i)}));const i=Array.from(r.values()),n=i.length;return(e,r)=>{for(let o=0;o<n;++o)i[o](t,e,r)}}}class c{constructor(){this._entries=new Map}add(e){if(!Array.isArray(e))return this._add(e);for(const t of e)this._add(t)}_add(e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}generateSource(){return Array.from(this._entries.values()).map((e=>(0,o.pC)(e.arraySize)?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class u{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class d extends s{constructor(){super(...arguments),this.uniforms=new c,this.code=new u,this.constants=new m}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`attribute ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(){return this._entries.map((e=>`varying ${e[1]} ${e[0]};`))}}class p{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?p.ALLOWLIST_VERTEX:p.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}p.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],p.ALLOWLIST_VERTEX=[];class m{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=m._numberToFloatStr(r);break;case"int":i=m._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${m._numberToFloatStr(r[0])}, ${m._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${m._numberToFloatStr(r[0])}, ${m._numberToFloatStr(r[1])}, ${m._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${m._numberToFloatStr(r[0])}, ${m._numberToFloatStr(r[1])}, ${m._numberToFloatStr(r[2])}, ${m._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${m._numberToIntStr(r[0])}, ${m._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${m._numberToIntStr(r[0])}, ${m._numberToIntStr(r[1])}, ${m._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${m._numberToIntStr(r[0])}, ${m._numberToIntStr(r[1])}, ${m._numberToIntStr(r[2])}, ${m._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>m._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",_="precision highp float;\nprecision highp sampler2D;"},46826:(e,t,r)=>{r.d(t,{F:()=>u});var i=r(70586),n=r(4307),o=r(97323),a=r(79884),s=r(67498);class l extends a.x{constructor(e,t){super(e,"vec2",s.P.Draw,((r,i,n)=>r.setUniform2fv(e,t(i,n))))}}class c extends a.x{constructor(e,t){super(e,"sampler2D",s.P.Draw,((r,i,n)=>r.bindTexture(e,t(i,n))))}}function u(e,t,r){const a=[new c(e,t)];if(r){const r=e+"Size";a.push(new l(r,((e,r)=>{const a=t(e,r);return(0,i.pC)(a)?(0,n.a)(d,a.descriptor.width,a.descriptor.height):o.Z})))}return a}const d=(0,o.a)()},98069:(e,t,r)=>{r.d(t,{A:()=>c,J:()=>u});var i=r(70586),n=r(4307),o=r(97323),a=r(19693),s=r(79884),l=r(67498);class c extends s.x{constructor(e,t){super(e,"sampler2D",l.P.Pass,((r,i,n)=>r.bindTexture(e,t(i,n))))}}function u(e,t,r){const s=[new c(e,t)];if(r){const r=e+"Size";s.push(new a.A(r,((e,r)=>{const a=t(e,r);return(0,i.pC)(a)?(0,n.a)(d,a.descriptor.width,a.descriptor.height):o.Z})))}return s}const d=(0,o.a)()},79884:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(70586),n=r(67498);class o{constructor(e,t,r,o,a=null){this.name=e,this.type=t,this.arraySize=a,this.bind={[n.P.Pass]:null,[n.P.Draw]:null},(0,i.pC)(r)&&(0,i.pC)(o)&&(this.bind[r]=o)}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>n,K:()=>i});class i{}function n(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}!function(e){e.int=function(e){return Math.round(e).toString()},e.float=function(e){return e.toPrecision(8)}}(n||(n={}))},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},17662:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(99001);class n{constructor(){this.id=(0,i.D)()}unload(){}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Geometry=2]="Geometry",e[e.Material=3]="Material",e[e.Texture=4]="Texture",e[e.COUNT=5]="COUNT"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>n});var i=r(35065);const n=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.INSTANCECOLOR,7],[i.T.MODEL,8],[i.T.MODELNORMAL,12],[i.T.MODELORIGINHI,11],[i.T.MODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>s});var i=r(70586),n=r(95330),o=r(74709),a=r(47026);class s extends class{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}ensureTechnique(e,t,r=this._output){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(r,t),this._technique),this._technique}ensureResources(e){return a.Rw.LOADED}}{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?a.Rw.LOADED:a.Rw.LOADING}get textureBindParameters(){return new l((0,i.pC)(this._texture)?this._texture.glTexture:null,(0,i.pC)(this._textureNormal)?this._textureNormal.glTexture:null,(0,i.pC)(this._textureEmissive)?this._textureEmissive.glTexture:null,(0,i.pC)(this._textureOcclusion)?this._textureOcclusion.glTexture:null,(0,i.pC)(this._textureMetallicRoughness)?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){((0,i.Wi)(this._texture)||e!==this._texture.id)&&(this._texture=(0,i.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if((0,i.Wi)(e))return void t(null);const r=this._textureRepository.acquire(e);if((0,n.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class l extends o.K{constructor(e=null,t=null,r=null,i=null,n=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=n}}},82791:(e,t,r)=>{r.d(t,{F5:()=>u,yD:()=>i});var i,n,o=r(70586),a=(r(74709),r(17662)),s=r(4726),l=r(83475),c=r(37782);class u extends a.c{constructor(e,t){super(),this.type=s.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=l.i,this._parameters=(0,c.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,c.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleInPass(e.pass)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleInPass(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){(0,o.pC)(this.repository)&&this.repository.materialChanged(this)}}(n=i||(i={}))[n.Occlude=1]="Occlude",n[n.Transparent=2]="Transparent",n[n.OccludeAndTransparent=4]="OccludeAndTransparent",n[n.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",n[n.Opaque=16]="Opaque"},11726:(e,t,r)=>{r.d(t,{hu:()=>n,yK:()=>o}),r(97323),r(98766),(0,r(88669).c)();class i{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}}function n(e,t){if(!e)throw t=t||"assert",console.log(new Error(t).stack),new i(t)}function o(e,t,r,i){let n,o=(r[0]-e[0])/t[0],a=(i[0]-e[0])/t[0];o>a&&(n=o,o=a,a=n);let s=(r[1]-e[1])/t[1],l=(i[1]-e[1])/t[1];if(s>l&&(n=s,s=l,l=n),o>l||s>a)return!1;s>o&&(o=s),l<a&&(a=l);let c=(r[2]-e[2])/t[2],u=(i[2]-e[2])/t[2];return c>u&&(n=c,c=u,u=n),!(o>u||c>a||(u<a&&(a=u),a<0))}},35065:(e,t,r)=>{var i;r.d(t,{T:()=>i}),function(e){e.POSITION="position",e.NORMAL="normal",e.UV0="uv0",e.AUXPOS1="auxpos1",e.AUXPOS2="auxpos2",e.MAPPOS="mapPos",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.TANGENT="tangent",e.OFFSET="offset",e.SUBDIVISIONFACTOR="subdivisionFactor",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.NORMALCOMPRESSED="normalCompressed",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.FEATUREVALUE="featureValue",e.MODELORIGINHI="modelOriginHi",e.MODELORIGINLO="modelOriginLo",e.MODEL="model",e.MODELNORMAL="modelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMALA="normalA",e.NORMALB="normalB",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.U8PADDING="u8padding",e.U16PADDING="u16padding",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.EXTRUDE="extrude"}(i||(i={}))},47026:(e,t,r)=>{var i,n,o,a,s,l,c,u,d,h,f,p,m,g;r.d(t,{Am:()=>a,CE:()=>f,Gv:()=>n,JJ:()=>m,MX:()=>h,Rw:()=>l,Vr:()=>i,hU:()=>c}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(n||(n={})),function(e){e[e.NONE=0]="NONE",e[e.SMAA=1]="SMAA"}(o||(o={})),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(a||(a={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(s||(s={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(l||(l={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(c||(c={})),function(e){e[e.ASYNC=0]="ASYNC",e[e.SYNC=1]="SYNC"}(u||(u={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(d||(d={})),function(e){e[e.Triangle=0]="Triangle",e[e.Point=1]="Point",e[e.Line=2]="Line"}(h||(h={})),function(e){e[e.STRETCH=1]="STRETCH",e[e.PAD=2]="PAD"}(f||(f={})),function(e){e[e.CHANGED=0]="CHANGED",e[e.UNCHANGED=1]="UNCHANGED"}(p||(p={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(m||(m={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(g||(g={}))},9749:(e,t,r)=>{r.d(t,{V:()=>n}),r(17896);var i=r(65617);r(22021),(0,i.c)();const n=.4;(0,i.c)()},37782:(e,t,r)=>{r.d(t,{FZ:()=>w,Uf:()=>M,Bw:()=>g,LO:()=>R,Hx:()=>S});var i=r(67676),n=r(22021),o=r(70586),a=r(17896),s=r(65617),l=r(60437),c=r(47026);function u(e,t){return Math.max((0,n.t7)(e*t.scale,e,t.factor),function(e,t){return 0===e?t.minPixelSize:t.minPixelSize*(1+2*t.paddingPixels/e)}(e,t))}r(64822),(0,n.Vl)(10),(0,n.Vl)(12),(0,n.Vl)(70),(0,n.Vl)(40);const d={scale:0,factor:0,minPixelSize:0,paddingPixels:0};var h=r(11726),f=r(35065),p=(r(52138),r(13598));r(9820),new Float64Array(3),new Float32Array(6),(0,p.c)();const m=(0,l.Ue)();function g(e,t,r,i,n,a,s){if(!function(e){return!!(0,o.pC)(e)&&!e.visible}(t))if(e.boundingInfo){(0,h.hu)(e.primitiveType===c.MX.Triangle);const t=r.tolerance;v(e.boundingInfo,i,n,t,a,s)}else{const t=e.indices.get(f.T.POSITION),r=e.vertexAttributes.get(f.T.POSITION);x(i,n,0,t.length/3,t,r,void 0,a,s)}}const _=(0,s.c)();function v(e,t,r,i,n,s){if((0,o.Wi)(e))return;const c=function(e,t,r){return(0,a.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,_);if((0,l.op)(m,e.getBBMin()),(0,l.Tn)(m,e.getBBMax()),(0,o.pC)(n)&&n.applyToAabb(m),function(e,t,r,i){return function(e,t,r,i,n){const o=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(o,a),l=Math.max(o,a);const c=(e[1]-i-t[1])*r[1],u=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,u)),l<0)return!1;if(s=Math.max(s,Math.min(c,u)),s>l)return!1;const d=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(d,h)),!(l<0)&&(s=Math.max(s,Math.min(d,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(m,t,c,i)){const{primitiveIndices:o,indices:a,position:l}=e,c=o?o.length:a.length/3;if(c>y){const o=e.getChildren();if(void 0!==o){for(let e=0;e<8;++e)void 0!==o[e]&&v(o[e],t,r,i,n,s);return}}x(t,r,0,c,a,l,o,n,s)}}const T=(0,s.c)();function x(e,t,r,i,n,a,s,l,c){if(s)return function(e,t,r,i,n,a,s,l,c){const u=a.data,d=a.stride||a.size,h=e[0],f=e[1],p=e[2],m=t[0]-h,g=t[1]-f,_=t[2]-p;for(let e=r;e<i;++e){const t=s[e];let r=3*t,i=d*n[r++],a=u[i++],v=u[i++],x=u[i];i=d*n[r++];let b=u[i++],A=u[i++],S=u[i];i=d*n[r];let M=u[i++],R=u[i++],C=u[i];(0,o.pC)(l)&&([a,v,x]=l.applyToVertex(a,v,x,e),[b,A,S]=l.applyToVertex(b,A,S,e),[M,R,C]=l.applyToVertex(M,R,C,e));const w=b-a,y=A-v,O=S-x,P=M-a,N=R-v,I=C-x,D=g*I-N*_,L=_*P-I*m,F=m*N-P*g,B=w*D+y*L+O*F;if(Math.abs(B)<=Number.EPSILON)continue;const H=h-a,U=f-v,z=p-x,G=H*D+U*L+z*F;if(B>0){if(G<0||G>B)continue}else if(G>0||G<B)continue;const V=U*O-y*z,W=z*w-O*H,q=H*y-w*U,k=m*V+g*W+_*q;if(B>0){if(k<0||G+k>B)continue}else if(k>0||G+k<B)continue;const $=(P*V+N*W+I*q)/B;$>=0&&c($,E(w,y,O,P,N,I,T),t,!1)}}(e,t,r,i,n,a,s,l,c);const u=a.data,d=a.stride||a.size,h=e[0],f=e[1],p=e[2],m=t[0]-h,g=t[1]-f,_=t[2]-p;for(let e=r,t=3*r;e<i;++e){let r=d*n[t++],i=u[r++],a=u[r++],s=u[r];r=d*n[t++];let v=u[r++],x=u[r++],b=u[r];r=d*n[t++];let A=u[r++],S=u[r++],M=u[r];(0,o.pC)(l)&&([i,a,s]=l.applyToVertex(i,a,s,e),[v,x,b]=l.applyToVertex(v,x,b,e),[A,S,M]=l.applyToVertex(A,S,M,e));const R=v-i,C=x-a,w=b-s,y=A-i,O=S-a,P=M-s,N=g*P-O*_,I=_*y-P*m,D=m*O-y*g,L=R*N+C*I+w*D;if(Math.abs(L)<=Number.EPSILON)continue;const F=h-i,B=f-a,H=p-s,U=F*N+B*I+H*D;if(L>0){if(U<0||U>L)continue}else if(U>0||U<L)continue;const z=B*w-C*H,G=H*R-w*F,V=F*C-R*B,W=m*z+g*G+_*V;if(L>0){if(W<0||U+W>L)continue}else if(W>0||U+W<L)continue;const q=(y*z+O*G+P*V)/L;q>=0&&c(q,E(R,C,w,y,O,P,T),e,!1)}}const b=(0,s.c)(),A=(0,s.c)();function E(e,t,r,i,n,o,s){return(0,a.s)(b,e,t,r),(0,a.s)(A,i,n,o),(0,a.f)(s,b,A),(0,a.n)(s,s),s}function S(e,t,r,i,a){let s=(r.screenLength||0)*e.pixelRatio;(0,o.pC)(a)&&(s=function(e,t,r,i){return u(e,function(e,t,r){const i=r.parameters,n=r.paddingPixelsOverride;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d.minPixelSize=i.minPixelSize,d.paddingPixels=n,d}(t,r,i))}(s,i,t,a));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.uZ)(l*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function M(e,t){const r=t?M(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=C(i)),null==i&&t in r||(r[t]=i)}return r}function R(e,t){let r=!1;for(const n in t){const o=t[n];void 0!==o&&(Array.isArray(o)?null===e[n]?(e[n]=o.slice(),r=!0):(0,i.Vx)(e[n],o)&&(r=!0):e[n]!==o&&(r=!0,e[n]=o))}return r}function C(e){const t=[];return e.forEach((e=>t.push(e))),t}const w={multiply:1,ignore:2,replace:3,tint:4},y=1e3},64822:(e,t,r)=>{var i;r.d(t,{JY:()=>i}),function(e){e[e.Global=1]="Global",e[e.Local=2]="Local"}(i||(i={}))},75656:(e,t,r)=>{r.d(t,{x:()=>c}),r(80442);var i=r(22021),n=r(70586),o=r(49300),a=r(54738),s=r(35371),l=r(46314);class c{constructor(e,t,r=null){if(this._context=e,this.type="texture",this._glName=null,this._descriptor=void 0,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(s._g.Texture,this),this._descriptor={target:s.No.TEXTURE_2D,samplingMode:s.cw.LINEAR,wrapMode:s.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1,...t},e.type!==a.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),h(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(s._g.Texture,this))}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=s.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=s.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const i=this._descriptor;t??(t=i.target);const a=h(t);null===e&&(i.width=i.width||4,i.height=i.height||4,a&&(i.depth=i.depth??1));const p=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),c._validateTexture(this._context,i),this._configurePixelStorage();const m=i.pixelFormat;let g=i.internalFormat?i.internalFormat:this._deriveInternalFormat(m,i.dataType);if(d(e)){let n=e.width,s=e.height;const l=1;e instanceof HTMLVideoElement&&(n=e.videoWidth,s=e.videoHeight),i.width&&i.height,a&&i.depth,i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,g,i.hasMipmap,n,s,l),this._texImage(t,0,g,n,s,l,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap(),void 0===i.width&&(i.width=n),void 0===i.height&&(i.height=s),a&&void 0===i.depth&&(i.depth=l)}else{const{width:c,height:d,depth:h}=i;if(null!=c&&null!=d||console.error("Width and height must be specified!"),a&&null==h&&console.error("Depth must be specified!"),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,g,i.hasMipmap,c,d,h),r.DEPTH24_STENCIL8&&g===r.DEPTH_STENCIL&&(g=r.DEPTH24_STENCIL8),u(e)){const n=e.levels,o=f(t,c,d,h),a=Math.min(o-1,n.length-1);(0,l.Z)(r)?r.texParameteri(i.target,r.TEXTURE_MAX_LEVEL,a):i.hasMipmap=i.hasMipmap&&o===n.length;const u=g;if(!function(e){return e in s.q_}(u))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel(((e,r,i,o)=>{const a=n[Math.min(e,n.length-1)];this._compressedTexImage(t,e,u,r,i,o,a)}),a)}else(0,n.pC)(e)?(this._texImage(t,0,g,c,d,h,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((e,i,n,a)=>{this._texImage(t,e,g,i,n,a,null),(0,o.zu)(r)}))}c._applySamplingMode(r,this._descriptor),c._applyWrapMode(r,this._descriptor),c._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,o.zu)(r),this._context.bindTexture(p,c.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,i,n,o){o||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const a=this._context.gl,s=this._descriptor,{pixelFormat:l,internalFormat:h,dataType:f,isImmutable:p,target:m}=s;if(p&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const g=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);(t<0||r<0||i>s.width||n>s.height||t+i>s.width||r+n>s.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),d(o)?a.texSubImage2D(m,e,t,r,l,f,o):u(o)?a.compressedTexSubImage2D(m,e,t,r,i,n,h,o.levels[e]):a.texSubImage2D(m,e,t,r,i,n,l,f,o),this._context.bindTexture(g,c.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,i,n,o,a,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const d=this._context.gl;if(!(0,l.Z)(d))throw new Error("3D textures are not supported in WebGL1");const f=this._descriptor,{pixelFormat:p,dataType:m,isImmutable:g,target:_,internalFormat:v}=f;if(g&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");h(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const T=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||i<0||n>f.width||o>f.height||a>f.depth||t+n>f.width||r+o>f.height||i+a>f.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),u(s))s=s.levels[e],d.compressedTexSubImage3D(_,e,t,r,i,n,o,a,v,s);else{const l=s;d.texSubImage3D(_,e,t,r,i,n,o,a,p,m,l)}this._context.bindTexture(T,c.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,c._validateTexture(this._context,e)}e.samplingMode===s.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=s.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===s.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=s.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(c.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,c.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,c._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(c._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(c._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===a.zO.WEBGL1)return e;switch(t){case s.Br.FLOAT:switch(e){case s.VI.RGBA:return s.lP.RGBA32F;case s.VI.RGB:return s.lP.RGB32F;default:throw new Error("Unable to derive format")}case s.Br.UNSIGNED_BYTE:switch(e){case s.VI.RGBA:return s.lP.RGBA8;case s.VI.RGB:return s.lP.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,i,n,o){const a=this._context.gl;if(!(0,l.Z)(a))throw new Error("Immutable textures are not supported in WebGL1");if(!function(e){return e in s.lP}(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?f(e,i,n,o):1;h(e)?a.texStorage3D(e,c,t,i,n,o):a.texStorage2D(e,c,t,i,n),this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,o,s,l){const c=this._context.gl;let u=null;const f=this._context.type===a.zO.WEBGL2,p=h(e),{isImmutable:m,pixelFormat:g,dataType:_}=this._descriptor;if(f&&(u=c),f||!d(l))if(m){if((0,n.pC)(l)){const r=l;p?u.texSubImage3D(e,t,0,0,0,i,o,s,g,_,r):c.texSubImage2D(e,t,0,0,i,o,g,_,r)}}else{const a=(0,n.Wg)(l);p?u.texImage3D(e,t,r,i,o,s,0,g,_,a):c.texImage2D(e,t,r,i,o,0,g,_,a)}else c.texImage2D(e,0,r,g,_,l)}_compressedTexImage(e,t,r,i,o,s,l){const c=this._context.gl;let u=null;const d=h(e),f=this._descriptor.isImmutable;if(d){if(this._context.type!==a.zO.WEBGL2)throw new Error("3D textures are not supported in WebGL1");u=c}f?(0,n.pC)(l)&&(d?u.compressedTexSubImage3D(e,t,0,0,0,i,o,s,r,l):c.compressedTexSubImage2D(e,t,0,0,i,o,r,l)):d?u.compressedTexImage3D(e,t,r,i,o,s,0,l):c.compressedTexImage2D(e,t,r,i,o,0,l)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:n,hasMipmap:o,target:a}=this._descriptor;const l=a===s.No.TEXTURE_3D;for(let a=0;e(a,r,i,n),o&&(1!==r||1!==i||l&&1!==n)&&!(a>=t);++a)r=Math.max(1,r>>1),i=Math.max(1,i>>1),l&&(n=Math.max(1,n>>1))}static _validateTexture(e,t){(t.width<0||t.height<0||t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=(0,l.Z)(e.gl),n=(0,i.wt)(t.width)&&(0,i.wt)(t.height);r||!t.isImmutable&&!h(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||n||("number"==typeof t.wrapMode?t.wrapMode!==s.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===s.e8.CLAMP_TO_EDGE&&t.wrapMode.t===s.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let r=t.samplingMode,i=t.samplingMode;r===s.cw.LINEAR_MIPMAP_NEAREST||r===s.cw.LINEAR_MIPMAP_LINEAR?(r=s.cw.LINEAR,t.hasMipmap||(i=s.cw.LINEAR)):r!==s.cw.NEAREST_MIPMAP_NEAREST&&r!==s.cw.NEAREST_MIPMAP_LINEAR||(r=s.cw.NEAREST,t.hasMipmap||(i=s.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}function u(e){return(0,n.pC)(e)&&"type"in e&&"compressed"===e.type}function d(e){return(0,n.pC)(e)&&!u(e)&&!function(e){return(0,n.pC)(e)&&"byteLength"in e}(e)}function h(e){return e===s.No.TEXTURE_3D||e===s.No.TEXTURE_2D_ARRAY}function f(e,t,r,i=1){let n=Math.max(t,r);return e===s.No.TEXTURE_3D&&(n=Math.max(n,i)),Math.round(Math.log(n)/Math.LN2)+1}c.TEXTURE_UNIT_FOR_UPDATES=0},21968:(e,t,r)=>{r.d(t,{G:()=>i});class i{constructor(e,t,r,i,n,o=!1,a=0){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=a}}},46314:(e,t,r)=>{function i(e){return window.WebGL2RenderingContext&&e instanceof window.WebGL2RenderingContext}r.d(t,{Z:()=>i})},49300:(e,t,r)=>{r.d(t,{CG:()=>l,hZ:()=>s,zu:()=>c});var i=r(20102),n=r(80442);const o=r(92604).Z.getLogger("esri/views/webgl"),a=!!(0,n.Z)("enable-feature:webgl-debug");function s(){return a}function l(){return a}function c(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),n=(new Error).stack;o.error(new i.Z("webgl-error","WebGL error occured",{message:r,stack:n}))}}}},54738:(e,t,r)=>{r.d(t,{Sh:()=>a,kr:()=>s,zO:()=>i});var i,n,o=r(80442);function a(e){const t=(0,o.Z)("esri-force-webgl");if(t===i.WEBGL1||t===i.WEBGL2)return[t];switch(e){case"2d":case"3d":return[i.WEBGL2,i.WEBGL1]}}function s(e,t,r={}){const n=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let o=null;for(const t of n){try{o=e.getContext(t,r)}catch(e){}if(o)break}return o}(n=i||(i={}))[n.WEBGL1=1]="WEBGL1",n[n.WEBGL2=2]="WEBGL2"},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)o[0]=e[i],t[i]=o[0];return t}function n(e,t){const r=e.length;for(let i=0;i<r;++i)o[0]=e[i],o[1]=e[i]-o[0],t[i]=o[1];return t}r.d(t,{GB:()=>n,U8:()=>i});const o=new Float32Array(2)}}]);