@arcgis/core 4.34.0-next.20 → 4.34.0-next.22

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 (252) hide show
  1. package/analysis/VolumeMeasurement/CutFillOptions.js +5 -0
  2. package/analysis/VolumeMeasurement/volumeMeasurementUtils.js +5 -0
  3. package/analysis/VolumeMeasurementAnalysis.d.ts +4 -0
  4. package/analysis/VolumeMeasurementAnalysis.js +5 -0
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/{bcaf6edf887e4afbbdd2.js → 02dc6e31b1244e5bb785.js} +1 -1
  7. package/assets/esri/core/workers/chunks/04c17957c15234ca0321.js +1 -0
  8. package/assets/esri/core/workers/chunks/084236ca316aad980192.js +1 -0
  9. package/assets/esri/core/workers/chunks/0b484224a92b52c34330.js +1 -0
  10. package/assets/esri/core/workers/chunks/{822b32aaeec05a347c84.js → 0ba6177ba118a0f032e2.js} +1 -1
  11. package/assets/esri/core/workers/chunks/12723e79b996969e304e.js +1 -0
  12. package/assets/esri/core/workers/chunks/{bd7b985f7962b1cc7b8a.js → 146520d263b910b5bdc7.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{445ddf57d2f503a0b98b.js → 15064c3b21b325d5c2f6.js} +1 -1
  14. package/assets/esri/core/workers/chunks/19ae76283a0cb0fe4dee.js +346 -0
  15. package/assets/esri/core/workers/chunks/{28b525963420f022fb0a.js → 1cc30073f8200b67cff6.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{82a5000296134834d1ac.js → 1d75cb1747ffb7b8b050.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{55ce214a10fb6fc2e901.js → 24fe862b607ec927e07f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/30fae1f066dc3cd781f1.js +1 -0
  19. package/assets/esri/core/workers/chunks/32756905bcf11699b3f7.js +1 -0
  20. package/assets/esri/core/workers/chunks/{7ec73f63929b1623de72.js → 3793f282ddaccd3465f2.js} +1 -1
  21. package/assets/esri/core/workers/chunks/3fcd73ba832cb53d3a07.js +1 -0
  22. package/assets/esri/core/workers/chunks/41f487713c6278d389a1.js +1 -0
  23. package/assets/esri/core/workers/chunks/{5e7f35bf1aab93cb1c52.js → 4cea5170939c8d363ef7.js} +1 -1
  24. package/assets/esri/core/workers/chunks/5253cca467fe9bc0a210.js +1 -0
  25. package/assets/esri/core/workers/chunks/{735d96d2b951cc1df3a3.js → 576e408fb0834f3948e8.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{2a784da5fa3f502d1803.js → 58e74681ddef30ba9cb6.js} +1 -1
  27. package/assets/esri/core/workers/chunks/5b276962c46c57155166.js +1 -0
  28. package/assets/esri/core/workers/chunks/5ce62d9fff80d014d186.js +1 -0
  29. package/assets/esri/core/workers/chunks/5e805c9e9012dd39ec86.js +1 -0
  30. package/assets/esri/core/workers/chunks/{27c9d3f6cebca087a123.js → 6136bf09950adc46bc33.js} +1 -1
  31. package/assets/esri/core/workers/chunks/66757fc16316a5c50e1e.js +1 -0
  32. package/assets/esri/core/workers/chunks/6a0fbc54638f7de138c1.js +1 -0
  33. package/assets/esri/core/workers/chunks/{dfd9ac2e28c96900c53e.js → 6c33ecffbc783cb8f944.js} +1 -1
  34. package/assets/esri/core/workers/chunks/6ca764b4baadef5c1515.js +1 -0
  35. package/assets/esri/core/workers/chunks/{fcdf714339060731fe1c.js → 7051bcc178eb512819f6.js} +1 -1
  36. package/assets/esri/core/workers/chunks/7cfba5cec425221962e8.js +1 -0
  37. package/assets/esri/core/workers/chunks/{3a753ce4de2e6ad40f7b.js → 86d6007c45f2aa643ac8.js} +1 -1
  38. package/assets/esri/core/workers/chunks/8b19fe829a9dc26fb3fe.js +1 -0
  39. package/assets/esri/core/workers/chunks/8eea6251aa09725e654e.js +1 -0
  40. package/assets/esri/core/workers/chunks/916691122d7fb38497d6.js +1 -0
  41. package/assets/esri/core/workers/chunks/919d2fd7ebc0c840a759.js +1 -0
  42. package/assets/esri/core/workers/chunks/92ad9098006568358550.js +1 -0
  43. package/assets/esri/core/workers/chunks/{2ed698579befe73caafd.js → 94d75f3b215e3bd1b4d7.js} +1 -1
  44. package/assets/esri/core/workers/chunks/97324f030738fc0d456b.js +1 -0
  45. package/assets/esri/core/workers/chunks/9c510df592befb9ff892.js +1 -0
  46. package/assets/esri/core/workers/chunks/{15d1ab71aaf6bcf3145b.js → a7a5b89c2bb69f3af59c.js} +1 -1
  47. package/assets/esri/core/workers/chunks/aba520714efc01bead36.js +1 -0
  48. package/assets/esri/core/workers/chunks/accff253af360c34e8a8.js +1 -0
  49. package/assets/esri/core/workers/chunks/ad3871f497ecea1a08c9.js +1 -0
  50. package/assets/esri/core/workers/chunks/ae6eed26fc932bc08356.js +1 -0
  51. package/assets/esri/core/workers/chunks/b4512d62b6cb26fc6b25.js +1 -0
  52. package/assets/esri/core/workers/chunks/{63e984a65ee670449a4a.js → b4bb461955a4c2bce072.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{abc75c945f3cfb1629b0.js → ba5b24beebeb703b5919.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{51afd0e71df1825d7593.js → c64fa94cba71ba2794e2.js} +1 -1
  55. package/assets/esri/core/workers/chunks/c94cc026c4ed330408fb.js +1 -0
  56. package/assets/esri/core/workers/chunks/cab1a1067f44ce374673.js +1 -0
  57. package/assets/esri/core/workers/chunks/{3f4a8c874c022dace9be.js → d1b363c418a67b087306.js} +1 -1
  58. package/assets/esri/core/workers/chunks/d45383d76ba99718b6d9.js +1 -0
  59. package/assets/esri/core/workers/chunks/{f806e9221dff7fcfc2f9.js → e2cb295104ed2f8cd2ff.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{9432a5466eec397710a4.js → e49a135a2933306a6105.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{d31fa648497b0af97dc1.js → e9a9174c4d1a0a9effb6.js} +1 -1
  62. package/assets/esri/core/workers/chunks/f3d5d92e0aefc2593208.js +1 -0
  63. package/assets/esri/core/workers/chunks/f3e3c2340452c1d60c95.js +1 -0
  64. package/assets/esri/core/workers/chunks/{85b0e2a898251d048dda.js → f42155b7a4e6c5e80757.js} +1 -1
  65. package/assets/esri/core/workers/chunks/f43110391f124b8a179c.js +1009 -0
  66. package/assets/esri/core/workers/chunks/{080a8a1c6fe2d215142d.js → fb5e2b1ced03eef28e96.js} +1 -1
  67. package/assets/esri/core/workers/chunks/fe73e74e3e4278aedcc3.js +1 -0
  68. package/config.js +1 -1
  69. package/core/Clonable.js +1 -1
  70. package/core/lang.js +1 -1
  71. package/core/libs/rbush/PooledRBush.js +1 -1
  72. package/core/scheduling.js +1 -1
  73. package/geometry/Mesh.js +1 -1
  74. package/geometry/support/MeshComponent.js +1 -1
  75. package/geometry/support/MeshMaterial.js +1 -1
  76. package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
  77. package/geometry/support/MeshTexture.js +1 -1
  78. package/geometry/support/MeshTransform.js +1 -1
  79. package/geometry/support/MeshVertexAttributes.js +1 -1
  80. package/geometry/support/buffer/BufferView.js +1 -1
  81. package/geometry/support/float16.js +1 -1
  82. package/geometry/support/meshUtils/convertMeshVertexSpace.js +1 -1
  83. package/geometry/support/meshUtils/merge.js +1 -1
  84. package/geometry/support/meshUtils/meshCloneUtils.js +5 -0
  85. package/interfaces.d.ts +1134 -156
  86. package/kernel.js +1 -1
  87. package/layers/SubtypeGroupLayer.js +1 -1
  88. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  89. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  90. package/layers/mixins/ArcGISMapService.js +1 -1
  91. package/layers/save/mapImageLayerUtils.js +1 -1
  92. package/layers/support/TilemapCache.js +1 -1
  93. package/layers/support/TitleCreator.js +1 -1
  94. package/layers/support/arcgisLayerUrl.js +1 -1
  95. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  96. package/package.json +1 -1
  97. package/rest/knowledgeGraph/GraphAddFieldIndexResult.d.ts +4 -0
  98. package/rest/knowledgeGraph/GraphAddPropertyResult.d.ts +4 -0
  99. package/rest/knowledgeGraph/GraphDataModelOperationResult.d.ts +4 -0
  100. package/rest/knowledgeGraph/GraphDeleteFieldIndexResult.d.ts +4 -0
  101. package/rest/knowledgeGraph/GraphDeletePropertyResult.d.ts +4 -0
  102. package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.d.ts +4 -0
  103. package/rest/knowledgeGraph/GraphUpdatePropertyResult.d.ts +4 -0
  104. package/rest/knowledgeGraph/GraphUpdateSearchIndexResult.d.ts +4 -0
  105. package/rest/knowledgeGraphService.d.ts +7 -0
  106. package/support/requestUtils.js +1 -1
  107. package/support/revision.js +1 -1
  108. package/views/2d/engine/ManagedCanvas.js +1 -1
  109. package/views/2d/engine/ParentChildStage.js +5 -0
  110. package/views/2d/engine/Stage.js +1 -1
  111. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  112. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  113. package/views/2d/engine/webgl/Painter.js +1 -1
  114. package/views/2d/engine/webgl/VideoScreenRenderer.js +5 -0
  115. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueType.js +1 -1
  116. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js +5 -0
  117. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +5 -0
  118. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  119. package/views/2d/layers/MediaLayerView2D.js +1 -1
  120. package/views/2d/layers/TileLayerView2D.js +1 -1
  121. package/views/2d/layers/features/Processor.js +1 -1
  122. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  123. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  124. package/views/2d/mapViewDeps.js +1 -1
  125. package/views/3d/analysis/AnalysisViewManager3D.js +1 -1
  126. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +4 -0
  127. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +5 -0
  128. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  129. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  130. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  131. package/views/3d/layers/graphics/DeconflictAABR.js +1 -1
  132. package/views/3d/layers/graphics/ExtentSet.js +1 -1
  133. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  134. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  135. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  136. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  137. package/views/3d/layers/graphics/Labeler.js +1 -1
  138. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  139. package/views/3d/layers/i3s/I3SAsyncElevationUpdater.js +1 -1
  140. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  141. package/views/3d/layers/i3s/I3SLodHandling.js +1 -1
  142. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  143. package/views/3d/layers/support/FeatureTileDescriptor.js +1 -1
  144. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  145. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  146. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  147. package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
  148. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  149. package/views/3d/state/GoToOperation.js +1 -1
  150. package/views/3d/state/ViewStateManager.js +1 -1
  151. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  152. package/views/3d/support/StreamDataLoader.js +1 -1
  153. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  154. package/views/3d/support/cameraUtils.js +1 -1
  155. package/views/3d/support/viewingModeUtils.js +5 -0
  156. package/views/3d/support/viewpointUtils.js +1 -1
  157. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  158. package/views/3d/terrain/OverlayManager.js +1 -1
  159. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  160. package/views/3d/terrain/OverlayRenderer.js +1 -1
  161. package/views/3d/terrain/TerrainSurface.js +1 -1
  162. package/views/3d/webgl/ManagedFBOResource.js +1 -1
  163. package/views/3d/webgl-engine/Stage.js +1 -1
  164. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  165. package/views/3d/webgl-engine/core/FBOPool.js +1 -1
  166. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  167. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  168. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  169. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  170. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  171. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  172. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  173. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  174. package/views/3d/webgl.d.ts +2 -0
  175. package/views/3d/webgl.js +1 -1
  176. package/views/SceneView.js +1 -1
  177. package/views/VideoView.js +1 -1
  178. package/views/View2D.js +1 -1
  179. package/views/Viewport2DBaseMixin.js +5 -0
  180. package/views/Viewport2DMixin.js +1 -1
  181. package/views/layers/FeatureLayerView.js +1 -1
  182. package/views/support/Scheduler.js +1 -1
  183. package/views/support/layerViewUtils.js +1 -1
  184. package/views/video/VideoOperationalDataView.js +5 -0
  185. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  186. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.d.ts +4 -0
  187. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
  188. package/widgets/BatchAttributeForm/inputs/EditableInput.d.ts +4 -0
  189. package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
  190. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +4 -0
  191. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  192. package/widgets/BatchAttributeForm/inputs/GroupInput.d.ts +4 -0
  193. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  194. package/widgets/BatchAttributeForm/inputs/InputBase.d.ts +4 -0
  195. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  196. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  197. package/widgets/Directions.js +1 -1
  198. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  199. package/widgets/Editor/Edits.js +1 -1
  200. package/widgets/FeatureForm/EditableInput.d.ts +2 -2
  201. package/widgets/FeatureForm/FieldInput.d.ts +2 -2
  202. package/widgets/FeatureForm/GroupInput.d.ts +2 -2
  203. package/widgets/FeatureForm/InputBase.d.ts +2 -2
  204. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  205. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  206. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  207. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  208. package/widgets/OrientedImageryViewer.js +1 -1
  209. package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
  210. package/widgets/VideoPlayer.js +1 -1
  211. package/widgets/support/SelectionList/FeatureItem.js +1 -1
  212. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  213. package/widgets/support/SelectionList/LayerItem.js +1 -1
  214. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  215. package/widgets/support/SelectionList.js +1 -1
  216. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  217. package/assets/esri/core/workers/chunks/034950f7d0596e77a7dd.js +0 -1
  218. package/assets/esri/core/workers/chunks/0808b7b2a18331ac0cf6.js +0 -1
  219. package/assets/esri/core/workers/chunks/093938edee5f0532d7da.js +0 -1
  220. package/assets/esri/core/workers/chunks/0f5643d5437f48c63225.js +0 -1
  221. package/assets/esri/core/workers/chunks/116bbff428cc2dc1832e.js +0 -1
  222. package/assets/esri/core/workers/chunks/1646699188ed0cd4ce24.js +0 -1
  223. package/assets/esri/core/workers/chunks/1c7393bcd6e85ba25e1b.js +0 -1
  224. package/assets/esri/core/workers/chunks/2999ae2a7d4d1ad6447b.js +0 -1
  225. package/assets/esri/core/workers/chunks/2e3f620c79ec04033a6e.js +0 -1
  226. package/assets/esri/core/workers/chunks/2e54be3094e41fd3026d.js +0 -346
  227. package/assets/esri/core/workers/chunks/3541714d448958c9bc38.js +0 -1
  228. package/assets/esri/core/workers/chunks/48953ddf0bbcf3d77e04.js +0 -1
  229. package/assets/esri/core/workers/chunks/5b7464137aacf1c5fd78.js +0 -1
  230. package/assets/esri/core/workers/chunks/629a257509b148ff38c0.js +0 -1
  231. package/assets/esri/core/workers/chunks/6b5fc9da8ae34c889b83.js +0 -1
  232. package/assets/esri/core/workers/chunks/707b34e15937c4f7902f.js +0 -1
  233. package/assets/esri/core/workers/chunks/770e609a6bd3533ceda9.js +0 -1
  234. package/assets/esri/core/workers/chunks/7925e8ffa8027b59410e.js +0 -1
  235. package/assets/esri/core/workers/chunks/8235a997acb45ab43173.js +0 -1
  236. package/assets/esri/core/workers/chunks/851baab753d9c8e967bd.js +0 -1
  237. package/assets/esri/core/workers/chunks/aa6c37f116c07ddca5fb.js +0 -1
  238. package/assets/esri/core/workers/chunks/bac5e1d50b69f0d94694.js +0 -1
  239. package/assets/esri/core/workers/chunks/bc0c3b5a5ab3fcb8f77a.js +0 -1
  240. package/assets/esri/core/workers/chunks/bcefb413d03d59506b5a.js +0 -1009
  241. package/assets/esri/core/workers/chunks/c96fed4889712f5a9135.js +0 -1
  242. package/assets/esri/core/workers/chunks/cac281604a41af9b1759.js +0 -1
  243. package/assets/esri/core/workers/chunks/cb4c49d5b70f9563bc46.js +0 -1
  244. package/assets/esri/core/workers/chunks/d25c8c30ce4058937d4f.js +0 -1
  245. package/assets/esri/core/workers/chunks/d638ae7814acf6c0fb8e.js +0 -1
  246. package/assets/esri/core/workers/chunks/d6ce99a713afdb03e332.js +0 -1
  247. package/assets/esri/core/workers/chunks/dc3816eef53d17074eab.js +0 -1
  248. package/assets/esri/core/workers/chunks/dd70b060ea4f632c2430.js +0 -1
  249. package/assets/esri/core/workers/chunks/e2e5e8bd3406609d8996.js +0 -1
  250. package/assets/esri/core/workers/chunks/e9aa1d9ded8a52a40c57.js +0 -1
  251. package/assets/esri/core/workers/chunks/f65ad6a41c0c69bf1b21.js +0 -1
  252. package/assets/esri/core/workers/chunks/f6c815f7d3ca072172ce.js +0 -1
@@ -0,0 +1,1009 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[432],{6625:(e,t,r)=>{var i;r.d(t,{d:()=>i}),function(e){e[e.TextureDescriptor=0]="TextureDescriptor",e[e.Texture=1]="Texture",e[e.Renderbuffer=2]="Renderbuffer"}(i||(i={}))},6867:(e,t,r)=>{r.d(t,{i:()=>u});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351),d=r(29878);class u{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.g)(m,this.ray.direction,this.distance),(0,o.l)(m))}withinDistance(e){return!!h(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!h(this)&&((0,o.g)(m,this.ray.direction,this.distance),(0,o.f)(e,this.ray.origin,m),!0)}getTransformedNormal(e){return(0,o.c)(p,this.normal),p[3]=0,(0,s.t)(p,p,this.transformation),(0,o.c)(e,p),(0,o.n)(e,e)}constructor(e){this.intersector=d.d.OBJECT,this.normal=(0,a.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=d.d.OBJECT,(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,d){this.intersector=e,this.distance=r,(0,o.c)(this.normal,s??a.Cb),(0,i.C)(this.transformation,l??n.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=d}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,o.c)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function h(e){return null!=e?.distance}const m=(0,a.vt)(),p=(0,l.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>n});var i=r(31821);function n(e,t){t.snowCover&&(e.code.add(i.H`float getSnow(vec3 normal, vec3 normalGround) {
2
+ return smoothstep(0.5, 0.55, dot(normal, normalGround));
3
+ }`),e.code.add(i.H`vec3 applySnowToMRR(vec3 mrr, float snow) {
4
+ return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
5
+ }
6
+ vec4 snowCoverForEmissions(vec4 emission, float snow) {
7
+ return mix(emission, vec4(0.0), snow);
8
+ }`))}},11725:(e,t,r)=>{r.d(t,{im:()=>u,m$:()=>i});var i,n,o=r(24326),a=r(49255),s=r(39341),l=r(35256),c=r(43616),d=r(65786);class u{constructor(e,t){this.id=(0,o.c)(),this.supportsEdges=!1,this.vertexAttributeLocations=s.D,this._renderPriority=0,this._parameters=new t,(0,c.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,c.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:i.None}get hasEmissions(){return!1}getConfiguration(e,t,r=new l.E){return r.output=e,r.hasHighlightMixTexture=e===a.V.Highlight&&null!=t.highlightMixTexture,r}}(n=i||(i={}))[n.None=0]="None",n[n.Occlude=1]="Occlude",n[n.Transparent=2]="Transparent",n[n.OccludeAndTransparent=4]="OccludeAndTransparent",n[n.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",n[n.Opaque=16]="Opaque",d.Y},11964:(e,t,r)=>{r.d(t,{Cr:()=>d,H6:()=>m,LV:()=>c,_I:()=>h,kb:()=>u,vt:()=>l});var i=r(34727),n=r(4341),o=r(38954),a=r(51850),s=r(32114);function l(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function c(e,t){const r=p.get();return r.origin=e,r.vector=t,r}function d(e,t,r=l()){return(0,o.c)(r.origin,e),(0,o.d)(r.vector,t,e),r}function u(e,t){const r=(0,o.d)(s.rq.get(),t,e.origin),n=(0,o.e)(e.vector,r),a=(0,o.e)(e.vector,e.vector),l=(0,i.qE)(n/a,0,1),c=(0,o.d)(s.rq.get(),(0,o.g)(s.rq.get(),e.vector,l),r);return(0,o.e)(c,c)}function h(e,t,r){return m(e,t,0,1,r)}function m(e,t,r,n,a){const{vector:l,origin:c}=e,d=(0,o.d)(s.rq.get(),t,c),u=(0,o.e)(l,d)/(0,o.k)(l);return(0,o.g)(a,l,(0,i.qE)(u,r,n)),(0,o.f)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)();const p=new n.I(()=>l())},12541:(e,t,r)=>{r.d(t,{CR:()=>c,Eo:()=>g,FV:()=>f,Kv:()=>m,QE:()=>s,QJ:()=>d,Qp:()=>h,mq:()=>v,re:()=>p,tl:()=>u,tr:()=>l});var i=r(49186),n=r(53966),o=r(63907);const a=()=>n.A.getLogger("esri/views/webgl/textureUtils");function s(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&a().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=e;if(n&&(c(n)||d(n))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:n}=e;n&&a().error("Depth textures cannot have mipmaps"),t?i!==o.Cj.LINEAR&&i!==o.Cj.NEAREST&&a().error("Depth textures cannot sample mipmaps"):(i!==o.Cj.NEAREST&&a().error("Depth textures without filtering must use NEAREST filtering"),r&&a().error("Depth textures without filtering cannot use compare function"))}}function l(e){return e in o.H0}function c(e){return e in o.SB}function d(e){return e in o.iE}function u(e){return null!=e&&e in o.CQ}function h(e){return null!=e&&"type"in e&&"compressed"===e.type}function m(e){return null!=e&&!h(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function p(e){return e===o.Ap.TEXTURE_3D||e===o.Ap.TEXTURE_2D_ARRAY}function f(e,t,r,i=1){let n=Math.max(t,r);return e===o.Ap.TEXTURE_3D&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function v(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case o.ld.FLOAT:switch(e.pixelFormat){case o.Ab.RGBA:return o.H0.RGBA32F;case o.Ab.RGB:return o.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case o.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case o.Ab.RGBA:return o.H0.RGBA8;case o.Ab.RGB:return o.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=t===o.j7.DEPTH_STENCIL?o.iE.DEPTH24_STENCIL8:t===o.j7.DEPTH_COMPONENT?o.SB.DEPTH_COMPONENT24:t,e.internalFormat}function g(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}},12791:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t){super(e,"sampler2D",i.c.Bind,(r,i)=>r.bindTexture(e,t(i)))}}},13464:(e,t,r)=>{var i;r.d(t,{N:()=>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.OPAQUE_MATERIAL_WITHOUT_NORMALS=3]="OPAQUE_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_MATERIAL_WITHOUT_NORMALS=5]="TRANSPARENT_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_MATERIAL_WITHOUT_DEPTH=7]="TRANSPARENT_MATERIAL_WITHOUT_DEPTH",e[e.OCCLUDED_GROUND=8]="OCCLUDED_GROUND",e[e.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",e[e.HUD_MATERIAL=12]="HUD_MATERIAL",e[e.LABEL_MATERIAL=13]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=14]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=15]="LINE_CALLOUTS_HUD_DEPTH",e[e.OVERLAY=16]="OVERLAY",e[e.DRAPED_MATERIAL=17]="DRAPED_MATERIAL",e[e.DRAPED_WATER=18]="DRAPED_WATER",e[e.VOXEL=19]="VOXEL",e[e.MAX_SLOTS=20]="MAX_SLOTS"}(i||(i={}))},14113:(e,t,r)=>{r.d(t,{N5:()=>l});var i=r(49186),n=(r(44208),r(53966)),o=r(69270);const a=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class l extends s{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new p,this.extensions=new f,this.outputs=new v}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!1){const r=this.extensions.generateSource(e),i=this.attributes.generateSource(e),n=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,a=o.uniforms.generateSource(),s=o.code.generateSource(),l=o.main.generateSource(t),c="vertex"===e?T:_,d=o.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${r.join("\n")}\n${c}\n${d.join("\n")}\n${a.join("\n")}\n${i.join("\n")}\n${n.join("\n")}\n${u.join("\n")}\n${s.join("\n")}\n${l.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[o.c.Bind];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[o.c.Bind];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[o.c.Pass];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[o.c.Pass];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[o.c.Draw];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[o.c.Draw];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let a=0;a<i;++a)r[a](e,o,t,n)}}}class c{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else a().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class d{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class h extends s{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new d(this),this.code=new u(this),this.constants=new g(this)}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}}class p{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?a().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1,flat:r?.flat??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+(r.flat||"int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class f{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?f.ALLOWLIST_VERTEX:f.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(e=>t.includes(e)).map(e=>`#extension ${e} : enable`)}static{this.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"]}static{this.ALLOWLIST_VERTEX=[]}}class v{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):a().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:v.DEFAULT_NAME,type:v.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class g{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=g._numberToFloatStr(r);break;case"int":i=g._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])}, ${g._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>g._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}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 _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",T="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"vec4",i.c.Bind,(i,n)=>i.setUniform4fv(e,t(n),r))}}},15581:(e,t,r)=>{r.d(t,{S:()=>T,b:()=>v,g:()=>g});var i=r(37585),n=r(48163),o=r(82048),a=r(52540),s=r(34845),l=r(77108),c=r(47286),d=r(33094),u=r(20304),h=r(31821),m=r(63761),p=r(14113);const f=16;function v(){const e=new p.N5,t=e.fragment;return e.include(o.c),e.include(s.Ir),t.include(a.E),t.uniforms.add(new d.U("radius",e=>g(e.camera))).code.add(h.H`vec3 sphere[16] = vec3[16](
9
+ vec3(0.186937, 0.0, 0.0),
10
+ vec3(0.700542, 0.0, 0.0),
11
+ vec3(-0.864858, -0.481795, -0.111713),
12
+ vec3(-0.624773, 0.102853, -0.730153),
13
+ vec3(-0.387172, 0.260319, 0.007229),
14
+ vec3(-0.222367, -0.642631, -0.707697),
15
+ vec3(-0.01336, -0.014956, 0.169662),
16
+ vec3(0.122575, 0.1544, -0.456944),
17
+ vec3(-0.177141, 0.85997, -0.42346),
18
+ vec3(-0.131631, 0.814545, 0.524355),
19
+ vec3(-0.779469, 0.007991, 0.624833),
20
+ vec3(0.308092, 0.209288,0.35969),
21
+ vec3(0.359331, -0.184533, -0.377458),
22
+ vec3(0.192633, -0.482999, -0.065284),
23
+ vec3(0.233538, 0.293706, -0.055139),
24
+ vec3(0.417709, -0.386701, 0.442449)
25
+ );
26
+ float fallOffFunction(float vv, float vn, float bias) {
27
+ float f = max(radius * radius - vv, 0.0);
28
+ return f * f * f * max(vn - bias, 0.0);
29
+ }`),t.code.add(h.H`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) {
30
+ vec3 v = Q - C;
31
+ float vv = dot(v, v);
32
+ float vn = dot(normalize(v), n_C);
33
+ return fallOffFunction(vv, vn, 0.1);
34
+ }`),e.outputs.add("fragOcclusion","float"),t.uniforms.add(new m.N("normalMap",e=>e.normalTexture),new m.N("depthMap",e=>e.depthTexture),new u.m("projScale",e=>e.projScale),new m.N("rnm",e=>e.noiseTexture),new c.G("rnmScale",(e,t)=>(0,i.hZ)(_,t.camera.fullWidth/e.noiseTexture.descriptor.width,t.camera.fullHeight/e.noiseTexture.descriptor.height)),new u.m("intensity",e=>e.intensity),new l.E("screenSize",e=>(0,i.hZ)(_,e.camera.fullWidth,e.camera.fullHeight))).main.add(h.H`
35
+ float depth = depthFromTexture(depthMap, uv);
36
+
37
+ // Early out if depth is out of range, such as in the sky
38
+ if (depth >= 1.0 || depth <= 0.0) {
39
+ fragOcclusion = 1.0;
40
+ return;
41
+ }
42
+
43
+ // get the normal of current fragment
44
+ ivec2 iuv = ivec2(uv * vec2(textureSize(normalMap, 0)));
45
+ vec4 norm4 = texelFetch(normalMap, iuv, 0);
46
+ if(norm4.a != 1.0) {
47
+ fragOcclusion = 1.0;
48
+ return;
49
+ }
50
+ vec3 norm = normalize(norm4.xyz * 2.0 - 1.0);
51
+
52
+ float currentPixelDepth = linearizeDepth(depth);
53
+ vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth);
54
+
55
+ float sum = 0.0;
56
+ vec3 tapPixelPos;
57
+
58
+ vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0);
59
+
60
+ // note: the factor 2.0 should not be necessary, but makes ssao much nicer.
61
+ // bug or deviation from CE somewhere else?
62
+ float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y);
63
+
64
+ for(int i = 0; i < ${h.H.int(f)}; ++i) {
65
+ vec2 unitOffset = reflect(sphere[i], fres).xy;
66
+ vec2 offset = vec2(-unitOffset * radius * ps);
67
+
68
+ // don't use current or very nearby samples
69
+ if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){
70
+ continue;
71
+ }
72
+
73
+ vec2 tc = vec2(gl_FragCoord.xy + offset);
74
+ if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue;
75
+ vec2 tcTap = tc / screenSize;
76
+ float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap);
77
+
78
+ tapPixelPos = reconstructPosition(tc, occluderFragmentDepth);
79
+
80
+ sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos);
81
+ }
82
+
83
+ // output the result
84
+ float A = max(1.0 - sum * intensity / float(${h.H.int(f)}), 0.0);
85
+
86
+ // Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2
87
+ A = (pow(A, 0.2) + 1.2 * A * A * A * A) / 2.2;
88
+
89
+ fragOcclusion = A;
90
+ `),e}function g(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const _=(0,n.vt)(),T=Object.freeze(Object.defineProperty({__proto__:null,build:v,getRadius:g},Symbol.toStringTag,{value:"Module"}))},15976:(e,t,r)=>{r.d(t,{o:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t){super(e,"sampler2D",i.c.Draw,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},16396:(e,t,r)=>{r.d(t,{ou:()=>c}),r(77690),r(29242),r(58083),r(9093);var i=r(38954),n=r(51850),o=r(97937),a=r(24151),s=r(57005);const l=new class{constructor(e=0){this.offset=e,this.sphere=(0,o.c)(),this.tmpVertex=(0,n.vt)()}applyToVertex(e,t,r){const n=this.objectTransform.transform,o=(0,i.i)(d,e,t,r),a=(0,i.t)(o,o,n),s=this.offset/(0,i.l)(a);(0,i.b)(a,a,a,s);const l=this.objectTransform.inverse;return(0,i.t)(this.tmpVertex,a,l),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,i.l)(e);(0,i.b)(e,e,e,r);const n=this.offset/(0,i.l)(t);(0,i.b)(t,t,t,n)}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=(0,i.l)((0,o.a)(e)),r=this.offset/t;return(0,i.b)((0,o.a)(this.sphere),(0,o.a)(e),(0,o.a)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};function c(e){return null!=e?(l.offset=e,l):null}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,n.vt)(),this._tmpMbs=(0,o.c)(),this._tmpObb=new s.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,i.l)(e)}applyToVertex(e,t,r){const n=(0,i.i)(d,e,t,r),o=(0,i.i)(u,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,i.l)(o);return(0,i.b)(this._tmpVertex,n,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),d=Math.abs(n),u=Math.abs(o),h=Math.abs(a),m=Math.abs(s),p=.5*(1+Math.sign(r*o))*Math.min(l,u),f=.5*(1+Math.sign(i*a))*Math.min(c,h),v=.5*(1+Math.sign(n*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),T=Math.max(d,m),x=Math.sqrt(p*p+f*f+v*v),E=Math.sign(l+r),M=Math.sign(c+i),A=Math.sign(d+n),w=Math.sign(u+o),b=Math.sign(h+a),R=Math.sign(m+s),O=this._totalOffset;if(x<O)return e[0]-=(1-E)*O,e[1]-=(1-M)*O,e[2]-=(1-A)*O,e[3]+=w*O,e[4]+=b*O,e[5]+=R*O,e;const S=O/Math.sqrt(g*g+_*_+T*T),y=O/x,C=y-S,I=-C;return e[0]+=r*(E*I+y),e[1]+=i*(M*I+y),e[2]+=n*(A*I+y),e[3]+=o*(w*C+S),e[4]+=a*(b*C+S),e[5]+=s*(R*C+S),e}applyToMbs(e){const t=(0,i.l)((0,o.a)(e)),r=this._totalOffset/t;return(0,i.b)((0,o.a)(this._tmpMbs),(0,o.a)(e),(0,o.a)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,s.gm)(e,this._totalOffset,this._totalOffset,a.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,n.vt)()}applyToVertex(e,t,r){const n=(0,i.i)(d,e,t,r),o=(0,i.f)(u,n,this.localOrigin),a=this.offset/(0,i.l)(o);return(0,i.b)(this.tmpVertex,n,o,a),this.tmpVertex}applyToAabb(e){const t=h,r=m,i=p;for(let n=0;n<3;++n)t[n]=e[0+n]+this.localOrigin[n],r[n]=e[3+n]+this.localOrigin[n],i[n]=t[n];const n=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=n[t],e[t+3]=n[t];const o=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let n=0;n<3;++n)i[n]=e&1<<n?r[n]:t[n];o(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0===(a&e)){for(let n=0;n<3;++n)i[n]=a&1<<n?0:e&1<<n?t[n]:r[n];o(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const d=(0,n.vt)(),u=(0,n.vt)(),h=(0,n.vt)(),m=(0,n.vt)(),p=(0,n.vt)()},16943:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(44208);function n(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},17352:(e,t,r)=>{r.d(t,{b:()=>j,f:()=>x}),r(44208);var i=r(53966),n=r(34727),o=r(4341),a=r(58083),s=r(9093),l=r(38954),c=r(51850),d=r(19419),u=r(88582),h=r(11964),m=r(27921),p=r(71351),f=r(44280),v=r(32114);const g=()=>i.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function _(e=L){return{plane:(0,m.vt)(e.plane),origin:(0,c.o8)(e.origin),basis1:(0,c.o8)(e.basis1),basis2:(0,c.o8)(e.basis2)}}function T(e,t=_()){return x(e.origin,e.basis1,e.basis2,t)}function x(e,t,r,i=_()){return(0,l.c)(i.origin,e),(0,l.c)(i.basis1,t),(0,l.c)(i.basis2,r),E(i),function(e,t){Math.abs((0,l.e)(e.basis1,e.basis2)/((0,l.l)(e.basis1)*(0,l.l)(e.basis2)))>1e-6&&g().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,l.e)(e.basis1,I(e)))>1e-6&&g().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,l.e)(I(e),e.origin)-e.plane[3])>1e-6&&g().warn(t,"Plane offset is not consistent with plane origin")}(i,"fromValues()"),i}function E(e){(0,m.mR)(e.basis2,e.basis1,e.origin,e.plane)}function M(e,t,r){e!==r&&T(e,r);const i=(0,l.g)(v.rq.get(),I(e),t);return(0,l.f)(r.origin,r.origin,i),r.plane[3]-=t,r}function A(e,t=_()){const r=(e[2]-e[0])/2,i=(e[3]-e[1])/2;return(0,l.i)(t.origin,e[0]+r,e[1]+i,0),(0,l.i)(t.basis1,r,0,0),(0,l.i)(t.basis2,0,i,0),(0,m.fA)(0,0,1,0,t.plane),t}function w(e,t,r){return!!(0,m.Ui)(e.plane,t,r)&&N(e,r)}function b(e,t,r){const i=H.get();F(e,t,i,H.get());let o=Number.POSITIVE_INFINITY;for(const a of z){const s=D(e,a,B.get()),c=v.rq.get();if((0,m.T7)(i,s,c)){const e=(0,l.E)(v.rq.get(),t.origin,c),i=Math.abs((0,n.XM)((0,l.e)(t.direction,e)));i<o&&(o=i,(0,l.c)(r,c))}}return o===Number.POSITIVE_INFINITY?R(e,t,r):r}function R(e,t,r){if(w(e,t,r))return r;const i=H.get(),n=H.get();F(e,t,i,n);let o=Number.POSITIVE_INFINITY;for(const a of z){const s=D(e,a,B.get()),c=v.rq.get();if((0,m.gv)(i,s,c)){const e=(0,p.kb)(t,c);if(!(0,m.Tj)(n,c))continue;e<o&&(o=e,(0,l.c)(r,c))}}return y(e,t.origin)<o&&O(e,t.origin,r),r}function O(e,t,r){const i=(0,m._I)(e.plane,t,v.rq.get()),n=(0,h.H6)(P(e,e.basis1),i,-1,1,v.rq.get()),o=(0,h.H6)(P(e,e.basis2),i,-1,1,v.rq.get());return(0,l.d)(r,(0,l.f)(v.rq.get(),n,o),e.origin),r}function S(e,t,r){const{origin:i,basis1:n,basis2:o}=e,a=(0,l.d)(v.rq.get(),t,i),s=(0,f.gr)(n,a),c=(0,f.gr)(o,a),d=(0,f.gr)(I(e),a);return(0,l.i)(r,s,c,d)}function y(e,t){const r=S(e,t,v.rq.get()),{basis1:i,basis2:n}=e,o=(0,l.l)(i),a=(0,l.l)(n),s=Math.max(Math.abs(r[0])-o,0),c=Math.max(Math.abs(r[1])-a,0),d=r[2];return s*s+c*c+d*d}function C(e,t){const r=-e.plane[3];return(0,f.gr)(I(e),t)-r}function I(e){return(0,m.Qj)(e.plane)}function N(e,t){const r=(0,l.d)(v.rq.get(),t,e.origin),i=(0,l.k)(e.basis1),n=(0,l.k)(e.basis2),o=(0,l.e)(e.basis1,r),a=(0,l.e)(e.basis2,r);return-o-i<0&&o-i<0&&-a-n<0&&a-n<0}function P(e,t){const r=B.get();return(0,l.c)(r.origin,e.origin),(0,l.c)(r.vector,t),r}function D(e,t,r){const{basis1:i,basis2:n,origin:o}=e,a=(0,l.g)(v.rq.get(),i,t.origin[0]),s=(0,l.g)(v.rq.get(),n,t.origin[1]);(0,l.f)(r.origin,a,s),(0,l.f)(r.origin,r.origin,o);const c=(0,l.g)(v.rq.get(),i,t.direction[0]),d=(0,l.g)(v.rq.get(),n,t.direction[1]);return(0,l.g)(r.vector,(0,l.f)(c,c,d),2),r}function F(e,t,r,i){const n=I(e);(0,m.mR)(n,t.direction,t.origin,r),(0,m.mR)((0,m.Qj)(r),n,t.origin,i)}const L={plane:(0,m.vt)(),origin:(0,c.fA)(0,0,0),basis1:(0,c.fA)(1,0,0),basis2:(0,c.fA)(0,1,0)},H=new o.I(m.vt),B=new o.I(h.vt),G=(0,c.vt)(),U=new o.I(()=>_()),z=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],V=(0,s.vt)(),W=(0,s.vt)(),j=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:class{constructor(){this.plane=(0,m.vt)(),this.origin=(0,c.vt)(),this.basis1=(0,c.vt)(),this.basis2=(0,c.vt)()}},altitudeAt:C,axisAt:function(e,t,r,i){return function(e,t,r){switch(t){case u._.X:(0,l.c)(r,e.basis1),(0,l.n)(r,r);break;case u._.Y:(0,l.c)(r,e.basis2),(0,l.n)(r,r);break;case u._.Z:(0,l.c)(r,I(e))}return r}(e,r,i)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:R,closestPointOnSilhouette:b,copy:T,copyWithoutVerify:function(e,t){(0,l.c)(t.origin,e.origin),(0,l.c)(t.basis1,e.basis1),(0,l.c)(t.basis2,e.basis2),(0,m.C)(t.plane,e.plane)},create:_,distance:function(e,t){return Math.sqrt(y(e,t))},distance2:y,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const i of z){const n=D(e,i,B.get()),o=(0,h.kb)(n,t);o>r&&(r=o)}return Math.sqrt(r)},elevate:M,equals:function(e,t){return(0,l.q)(e.basis1,t.basis1)&&(0,l.q)(e.basis2,t.basis2)&&(0,l.q)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,m.Tj)(e.plane,t)&&N(e,t)},fromAABoundingRect:A,fromValues:x,getExtent:function(e,t){const r=e.basis1[0],i=e.basis2[1],[n,o]=e.origin;return(0,d.fA)(n-r,o-i,n+r,o+i,t)},intersectRay:w,intersectRayClosestSilhouette:function(e,t,r){if(w(e,t,r))return r;const i=b(e,t,v.rq.get());return(0,l.f)(r,t.origin,(0,l.g)(v.rq.get(),t.direction,(0,l.j)(t.origin,i)/(0,l.l)(t.direction))),r},normal:I,projectPoint:O,projectPointLocal:S,rotate:function(e,t,r,i){return e!==i&&T(e,i),(0,a.$0)(W,t,r),(0,l.t)(i.basis1,e.basis1,W),(0,l.t)(i.basis2,e.basis2,W),E(i),i},setAltitudeAt:function(e,t,r,i){const n=C(e,t),o=(0,l.g)(G,I(e),r-n);return(0,l.f)(i,t,o),i},setExtent:function(e,t,r){return A(t,r),M(r,C(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&T(e,r),(0,a.B8)(V,t),(0,a.mg)(V,V),(0,l.t)(r.basis1,e.basis1,V),(0,l.t)(r.basis2,e.basis2,V),(0,l.t)((0,m.Qj)(r.plane),(0,m.Qj)(e.plane),V),(0,l.t)(r.origin,e.origin,t),(0,m.mP)(r.plane,r.plane,r.origin),r},up:L,updateUnboundedPlane:E,wrap:function(e,t,r){const i=U.get();return i.origin=e,i.basis1=t,i.basis2=r,i.plane=(0,m.LV)(0,0,0,0),E(i),i}},Symbol.toStringTag,{value:"Module"}))},20304:(e,t,r)=>{r.d(t,{m:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"float",i.c.Pass,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},20693:(e,t,r)=>{r.d(t,{yu:()=>p,Nz:()=>T,NB:()=>f,S7:()=>_});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(23205),l=r(40710),c=r(33094),d=r(58029),u=r(69270),h=r(74333);class m extends h.n{constructor(e,t,r){super(e,"mat4",u.c.Draw,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}function p(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new l.W("cameraPosition",(e,t)=>(0,o.i)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2])))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new d.F("proj",e=>e.camera.projectionMatrix),new m("view",(e,t)=>(0,i.Tl)(v,t.camera.viewMatrix,e.origin)),new l.W("localOrigin",e=>e.origin));const r=({camera:e})=>(0,o.i)(g,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11]);e.uniforms.add(new d.F("proj",e=>e.camera.projectionMatrix),new d.F("view",e=>(0,i.Tl)(v,e.camera.viewMatrix,r(e))),new s.d("localOrigin",e=>r(e)))}const v=(0,n.vt)(),g=(0,a.vt)();function _(e){e.uniforms.add(new d.F("viewNormal",e=>e.camera.viewInverseTransposeMatrix))}function T(e){e.uniforms.add(new c.U("pixelRatio",e=>e.camera.pixelRatio/e.overlayStretch))}},21231:(e,t,r)=>{r.d(t,{g:()=>p});var i=r(49186),n=(r(44208),r(53966)),o=r(97768),a=r(74887),s=r(94656),l=r(63907),c=r(6625),d=r(67171),u=r(12541);class h extends d.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=l.Ab.RED;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=l.Ab.RED_INTEGER}}static validate(e,t){return new h(e,t)}}const m=()=>n.A.getLogger("esri/views/webgl/Texture");let p=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=c.d.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=h.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}this._descriptor.target===l.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return(0,d.e)(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this._descriptor.context.gl&&this.hasWebGLTextureObject&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===l.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!(0,u.Qp)(e)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in l.CQ&&(this._descriptor.internalFormat=void 0),this._setData(e),!(0,u.Qp)(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(t,r,n,o,a,s,l=0){s||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=(0,u.mq)(c);const{context:d,pixelFormat:h,dataType:p,target:f,isImmutable:v}=c;if(v&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const g=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||n<0||r+o>c.width||n+a>c.height)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:_}=d;l&&(o&&a||m().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),_.pixelStorei(_.UNPACK_SKIP_ROWS,l)),(0,u.Kv)(s)?_.texSubImage2D(f,t,r,n,o,a,h,p,s):(0,u.Qp)(s)?_.compressedTexSubImage2D(f,t,r,n,o,a,c.internalFormat,s.levels[t]):_.texSubImage2D(f,t,r,n,o,a,h,p,s),l&&_.pixelStorei(_.UNPACK_SKIP_ROWS,0),d.bindTexture(g,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,n,o,a,s,l,c){c||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=(0,u.mq)(d);const{context:h,pixelFormat:p,dataType:f,isImmutable:v,target:g}=d;if(v&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,u.re)(g)||m().warn("Attempting to set 3D texture data on a non-3D texture");const _=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||n<0||o<0||r+a>d.width||n+s>d.height||o+l>d.depth)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=h;if((0,u.Qp)(c))c=c.levels[t],T.compressedTexSubImage3D(g,t,r,n,o,a,s,l,d.internalFormat,c);else{const e=c;T.texSubImage3D(g,t,r,n,o,a,s,l,p,f,e)}h.bindTexture(_,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,(0,u.QE)(t)}t.samplingMode===l.Cj.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=l.Cj.LINEAR_MIPMAP_NEAREST):t.samplingMode===l.Cj.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=l.Cj.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,(0,u.QE)(e)}e.samplingMode===l.Cj.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=l.Cj.LINEAR):e.samplingMode===l.Cj.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=l.Cj.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,(0,u.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?l.Cj.LINEAR:l.Cj.NEAREST),(0,u.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,o.DC)(this._compressionAbortController)}_setData(t,r){const n=this._descriptor,o=n.context?.gl;if(!o)return;(0,s.Y2)(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),n.context.instanceCounter.increment(l.vt.Texture,this)),(0,u.QE)(n);const a=n.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);n.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,s.Y2)(o);const c=r??n.target,d=(0,u.re)(c);if((0,u.Kv)(t))this._setDataFromTexImageSource(t,c);else{const{width:e,height:r,depth:a}=n;if(null==e||null==r)throw new i.A("texture:missing-size","Width and height must be specified!");if(d&&null==a)throw new i.A("texture:missing-depth","Depth must be specified!");if(n.internalFormat=(0,u.mq)(n),n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(c,n.internalFormat,n.hasMipmap,e,r,a),(0,u.Qp)(t)){if(!(0,u.tl)(n.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,n.internalFormat,c)}else this._texImage(c,0,n.internalFormat,e,r,a,t),(0,s.Y2)(o),n.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,s.Y2)(o),n.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=l.Ap.TEXTURE_CUBE_MAP_POSITIVE_X;t<=l.Ap.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.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)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=(0,u.mq)(i);const n=(0,u.re)(t),{width:o,height:a,depth:l}=(0,u.Eo)(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=a),n&&i.depth,n&&(i.depth=l),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,a,l),this._texImage(t,0,i.internalFormat,o,a,l,e),(0,s.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,s.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:a}=i,s=e.levels,c=(0,u.FV)(r,n,o,a),d=Math.min(c,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,l.H3.MAX_LEVEL,d),this._forEachMipmapLevel((e,i,n,o)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,n,o,a)},d)}_texStorage(e,t,r,n,o,a){const{gl:s}=this._descriptor.context;if(!(0,u.tr)(t)&&!(0,u.CR)(t)&&!(0,u.QJ)(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?(0,u.FV)(e,n,o,a):1;if((0,u.re)(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,n,o,a)}else s.texStorage2D(e,l,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,a,s){const l=this._descriptor.context.gl,c=(0,u.re)(e),{isImmutable:d,pixelFormat:h,dataType:m}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,n,o,a,h,m,r)}else l.texSubImage2D(e,t,0,0,n,o,h,m,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,n,o,a,0,h,m,d)}else l.texImage2D(e,t,r,n,o,0,h,m,d)}}_compressedTexImage(e,t,r,n,o,a,s){const l=this._descriptor.context.gl,c=(0,u.re)(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,n,o,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,n,o,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,n,o,a,0,s)}else l.compressedTexImage2D(e,t,r,n,o,0,s)}async _compressOnWorker(t){const{width:r,height:i,context:n,flipped:o,preMultiplyAlpha:s,hasMipmap:c}=this._descriptor,d=this._descriptor.compress?.compressionTracker,u=this._descriptor.compress?.compressionCallback,{compressedTextureETC:h,compressedTextureS3TC:p}=n.capabilities;if(!e.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!h&&!p)return;this.abortCompression();const f=new AbortController;this._compressionAbortController=f,d?.increment();try{let n;t instanceof Uint8Array?n=t.buffer:(n=await createImageBitmap(t,{imageOrientation:o?"flipY":"none"}),(0,a.Te)(f));const d={data:n,width:r,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:this._descriptor.pixelFormat===l.Ab.RGBA?4:3,preMultiplyAlpha:s,hasMipmap:c,hasETC:!!h,hasS3TC:!!p},m=await e.compressionWorkerHandle.invoke(d,f.signal,"low");if((0,a.Te)(f),m.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=m.internalFormat,this._setData(m.compressedTexture),u?.(e-this.usedMemory)}}catch(e){(0,a.zf)(e)||m().error("Texture compression failed!")}finally{d?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null)}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:a,target:s}=this._descriptor;const c=s===l.Ap.TEXTURE_3D;if(null==r||null==n||c&&null==o)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),a&&(1!==r||1!==n||c&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),c&&(o=Math.max(1,o>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;r===l.Cj.LINEAR_MIPMAP_NEAREST||r===l.Cj.LINEAR_MIPMAP_LINEAR?(r=l.Cj.LINEAR,e.hasMipmap||(i=l.Cj.LINEAR)):r!==l.Cj.NEAREST_MIPMAP_NEAREST&&r!==l.Cj.NEAREST_MIPMAP_LINEAR||(r=l.Cj.NEAREST,e.hasMipmap||(i=l.Cj.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,s.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},22393:(e,t,r)=>{r.d(t,{c:()=>s});var i=r(31821);function n(e){e.code.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
91
+ return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
92
+ }`),e.code.add(i.H`float integratedRadiance(float cosTheta2, float roughness) {
93
+ return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
94
+ }`),e.code.add(i.H`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness) {
95
+ float cosTheta2 = 1.0 - RdotNG * RdotNG;
96
+ float intRadTheta = integratedRadiance(cosTheta2, roughness);
97
+ float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
98
+ float sky = 2.0 - ground;
99
+ return (ground * ambientGround + sky * ambientSky) * 0.5;
100
+ }`)}var o=r(59469),a=r(89786);function s(e,t){e.include(a.p),t.pbrMode!==o.A9.Normal&&t.pbrMode!==o.A9.Schematic&&t.pbrMode!==o.A9.Simplified&&t.pbrMode!==o.A9.TerrainWithWater||(e.code.add(i.H`float normalDistribution(float NdotH, float roughness)
101
+ {
102
+ float a = NdotH * roughness;
103
+ float b = roughness / (1.0 - NdotH * NdotH + a * a);
104
+ return b * b * INV_PI;
105
+ }`),e.code.add(i.H`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
106
+ const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040);
107
+ const vec2 c2 = vec2(-1.04, 1.04);
108
+ vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
109
+ vec4 r = roughness * c0 + c1;
110
+ float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
111
+ return c2 * a004 + r.zw;
112
+ }`)),t.pbrMode!==o.A9.Normal&&t.pbrMode!==o.A9.Schematic||(e.include(n),e.code.add(i.H`struct PBRShadingInfo
113
+ {
114
+ float NdotV;
115
+ float LdotH;
116
+ float NdotNG;
117
+ float RdotNG;
118
+ float NdotAmbDir;
119
+ float NdotH_Horizon;
120
+ vec3 skyRadianceToSurface;
121
+ vec3 groundRadianceToSurface;
122
+ vec3 skyIrradianceToSurface;
123
+ vec3 groundIrradianceToSurface;
124
+ float averageAmbientRadiance;
125
+ float ssao;
126
+ vec3 albedoLinear;
127
+ vec3 f0;
128
+ vec3 f90;
129
+ vec3 diffuseColor;
130
+ float metalness;
131
+ float roughness;
132
+ };`),e.code.add(i.H`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
133
+ vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG);
134
+ vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness);
135
+ vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;
136
+ vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);
137
+ vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
138
+ vec3 specularComponent = specularColor * indirectSpecular;
139
+ return (diffuseComponent + specularComponent);
140
+ }`))}},22911:(e,t,r)=>{r.d(t,{NL:()=>f,ZX:()=>i});var i,n,o=r(49255),a=r(99208),s=r(40710),l=r(33079),c=r(28421),d=r(20304),u=r(31821),h=r(15976),m=r(63761),p=(r(25634),r(69270));function f(e,t){if(!(0,o.RN)(t.output))return;const{emissionSource:r,hasEmissiveTextureTransform:n,bindType:f}=t,v=r===i.Texture;v&&(e.include(a.r,t),e.fragment.uniforms.add(f===p.c.Pass?new m.N("texEmission",e=>e.textureEmissive):new h.o("texEmission",e=>e.textureEmissive)));const g=r===i.EmissiveColor||v;g&&e.fragment.uniforms.add(f===p.c.Pass?new l.t("emissiveBaseColor",e=>e.emissiveBaseColor):new s.W("emissiveBaseColor",e=>e.emissiveBaseColor));const _=r!==i.None;_&&e.fragment.uniforms.add(f===p.c.Pass?new d.m("emissiveStrength",e=>e.emissiveStrength):new c.J("emissiveStrength",e=>e.emissiveStrength));const T=r===i.SymbolColor;e.fragment.code.add(u.H`
141
+ vec4 getEmissions(vec3 symbolColor) {
142
+ vec4 emissions = ${g?"vec4(emissiveBaseColor, 1.0)":T?"vec4(symbolColor, 1.0)":"vec4(0.0)"};
143
+ ${(0,u.If)(v,`emissions *= textureLookup(texEmission, ${n?"emissiveUV":"vuv0"});\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
144
+ ${(0,u.If)(_,"emissions.rgb *= emissiveStrength;")}
145
+ return emissions;
146
+ }
147
+ `)}(n=i||(i={}))[n.None=0]="None",n[n.SymbolColor=1]="SymbolColor",n[n.EmissiveColor=2]="EmissiveColor",n[n.Texture=3]="Texture",n[n.COUNT=4]="COUNT"},23205:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"vec3",i.c.Bind,(i,n)=>i.setUniform3fv(e,t(n),r))}}},24321:(e,t,r)=>{r.d(t,{v:()=>a});var i=r(43519),n=r(31821),o=r(46540);function a(e,t){t.instancedColor?(e.attributes.add(o.r.INSTANCECOLOR,"vec4"),e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.vertex.code.add(n.H`
148
+ MaskedColor applyInstanceColor(MaskedColor color) {
149
+ return multiplyMaskedColors( color, createMaskedFromUInt8NaNColor(${o.r.INSTANCECOLOR}));
150
+ }
151
+ `)):e.vertex.code.add(n.H`MaskedColor applyInstanceColor(MaskedColor color) {
152
+ return color;
153
+ }`)}},25634:(e,t,r)=>{r.d(t,{m8:()=>l,NV:()=>d});var i=r(97768),n=r(74887),o=r(89192);class a{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context.stippleTextures}get _markerTextures(){return this._techniques.context.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return o.Am.LOADED}}var s=r(65786);class l extends a{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),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(){super.dispose(),this._texture=(0,i.Gz)(this._texture),this._textureNormal=(0,i.Gz)(this._textureNormal),this._textureEmissive=(0,i.Gz)(this._textureEmissive),this._textureOcclusion=(0,i.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?o.Am.LOADED:o.Am.LOADING}get textureBindParameters(){return new d(this._texture?.glTexture??null,this._textureNormal?.glTexture??null,this._textureEmissive?.glTexture??null,this._textureOcclusion?.glTexture??null,this._textureMetallicRoughness?.glTexture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,n.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,i.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class c extends s.Y{constructor(e=null){super(),this.textureEmissive=e}}class d extends c{constructor(e,t,r,i,n,o,a){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.scale=o,this.normalTextureTransformMatrix=a}}},26425:(e,t,r)=>{r.d(t,{u:()=>o});var i=r(33094),n=r(31821);function o({code:e,uniforms:t},r){t.add(new i.U("dpDummy",()=>1)),e.add(n.H`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
154
+ vec3 hiD = hiA + hiB;
155
+ vec3 loD = loA + loB;
156
+ return dpDummy * hiD + loD;
157
+ }`)}},26857:(e,t,r)=>{r.d(t,{b:()=>l});var i=r(90237),n=r(69622),o=r(10107),a=(r(44208),r(53966),r(87811),r(40608));let s=class extends n.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1}};(0,i._)([(0,o.MZ)()],s.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"LABELS_SHOW_BORDER",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"TEXT_SHOW_BORDER",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"SHOW_POI",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i._)([(0,o.MZ)()],s.prototype,"LINE_WIREFRAMES",void 0),s=(0,i._)([(0,a.$)("esri.views.3d.support.debugFlags")],s);const l=new s},27950:(e,t,r)=>{r.d(t,{N:()=>a});var i=r(66104),n=r(63365),o=r(31821);function a(e){e.include(n.a),e.code.add(o.H`
158
+ vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
159
+ // workaround for artifacts in macOS using Intel Iris Pro
160
+ // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
161
+ vec3 internalMixed = internalColor * textureColor;
162
+ vec3 allMixed = internalMixed * externalColor;
163
+
164
+ if (mode == ${o.H.int(i.k5.Multiply)}) {
165
+ return allMixed;
166
+ }
167
+ if (mode == ${o.H.int(i.k5.Ignore)}) {
168
+ return internalMixed;
169
+ }
170
+ if (mode == ${o.H.int(i.k5.Replace)}) {
171
+ return externalColor;
172
+ }
173
+
174
+ // tint (or something invalid)
175
+ float vIn = rgb2v(internalMixed);
176
+ vec3 hsvTint = rgb2hsv(externalColor);
177
+ vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);
178
+ return hsv2rgb(hsvOut);
179
+ }
180
+
181
+ float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
182
+ // workaround for artifacts in macOS using Intel Iris Pro
183
+ // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
184
+ float internalMixed = internalOpacity * textureOpacity;
185
+ float allMixed = internalMixed * externalOpacity;
186
+
187
+ if (mode == ${o.H.int(i.k5.Ignore)}) {
188
+ return internalMixed;
189
+ }
190
+ if (mode == ${o.H.int(i.k5.Replace)}) {
191
+ return externalOpacity;
192
+ }
193
+
194
+ // multiply or tint (or something invalid)
195
+ return allMixed;
196
+ }
197
+ `)}},27993:(e,t,r)=>{r.d(t,{F:()=>o}),r(98988);var i=r(16930),n=r(65806);function o(e,t,r,i,o){return!(null==t||null==i||e.length<2)&&(a.x=e[0],a.y=e[1],a.z=e[2],a.spatialReference=t,(0,n.g)(a,r,i,o))}const a={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:i.A.WGS84,type:"point"}},28421:(e,t,r)=>{r.d(t,{J:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"float",i.c.Draw,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},28491:(e,t,r)=>{r.d(t,{D:()=>j,b:()=>W});var i=r(46686),n=r(32680),o=r(49255),a=r(76591),s=r(76597),l=r(24321),c=r(60864),d=r(43519),u=r(96336),h=r(71955),m=r(53466),p=r(92700),f=r(72824),v=r(35640),g=r(40261),_=r(77695),T=r(53802),x=r(89390),E=r(98619),M=r(62602),A=r(22393),w=r(59469),b=r(39168),R=r(96598),O=r(51406),S=r(42398),y=r(58614),C=r(27950),I=r(20693),N=r(33079),P=r(71988),D=r(20304),F=r(31821),L=r(63761),H=r(10906),B=r(46540),G=r(43616),U=r(60517),z=r(14113),V=r(49788);function W(e){const t=new z.N5,{attributes:r,vertex:W,fragment:j,varyings:k}=t,{output:q,normalType:$,offsetBackfaces:Y,spherical:Z,receiveShadows:X,snowCover:J,pbrMode:K,textureAlphaPremultiplied:Q,instancedDoublePrecision:ee,hasVertexColors:te,hasVertexTangents:re,hasColorTexture:ie,hasNormalTexture:ne,hasNormalTextureTransform:oe,hasColorTextureTransform:ae,hasBloom:se}=e;if((0,I.NB)(W,e),r.add(B.r.POSITION,"vec3"),k.add("vpos","vec3",{invariant:!0}),t.include(S.A,e),t.include(c.B,e),t.include(v.Ge,e),t.include(O.q2,e),!(0,o.RN)(q))return t.include(g.E,e),t;t.include(O.Sx,e),t.include(O.MU,e),t.include(O.O1,e),t.include(O.QM,e),(0,I.yu)(W,e),t.include(u.Y,e),t.include(s.d,e);const le=$===u.W.Attribute||$===u.W.Compressed;return le&&Y&&t.include(n.M),t.include(_.W,e),t.include(f.Mh,e),t.include(l.v,e),k.add("vPositionLocal","vec3"),t.include(m.U,e),t.include(i.oD,e),t.include(h.K,e),t.include(p.c,e),W.uniforms.add(new P.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),k.add("vcolorExt","vec4"),t.include(R.Z,e),W.include(d.WD),W.include(d.oF),W.main.add(F.H`
198
+ forwardNormalizedVertexColor();
199
+
200
+ MaskedColor maskedColorExt =
201
+ applySymbolColor(applyVVColor(applyInstanceColor(createMaskedFromNaNColor(externalColor))));
202
+
203
+ vcolorExt = maskedColorExt.color;
204
+ forwardColorMixMode(maskedColorExt.mask);
205
+
206
+ vpos = getVertexInLocalOriginSpace();
207
+ vPositionLocal = vpos - view[3].xyz;
208
+ vpos = subtractOrigin(vpos);
209
+ ${(0,F.If)(le,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
210
+ vpos = addVerticalOffset(vpos, localOrigin);
211
+ ${(0,F.If)(re,"vTangent = dpTransformVertexTangent(tangent);")}
212
+ gl_Position = transformPosition(proj, view, vpos);
213
+ ${(0,F.If)(le&&Y,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
214
+
215
+ forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
216
+ forwardLinearDepth();
217
+ forwardTextureCoordinates();
218
+ forwardColorUV();
219
+ forwardNormalUV();
220
+ forwardEmissiveUV();
221
+ forwardOcclusionUV();
222
+ forwardMetallicRoughnessUV();
223
+
224
+ if (opacityMixMode != ${F.H.int(G.Um.ignore)} && vcolorExt.a < ${F.H.float(V.Q)}) {
225
+ gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
226
+ }
227
+ `),t.include(x.kA,e),j.include(T.n,e),t.include(y.S,e),t.include(ee?b.G:b.Bz,e),j.include(a.HQ,e),t.include(U.z,e),(0,I.yu)(j,e),j.uniforms.add(W.uniforms.get("localOrigin"),new N.t("ambient",e=>e.ambient),new N.t("diffuse",e=>e.diffuse),new D.m("opacity",e=>e.opacity),new D.m("layerOpacity",e=>e.layerOpacity)),ie&&j.uniforms.add(new L.N("tex",e=>e.texture)),t.include(w._Z,e),j.include(A.c,e),j.include(C.N),t.include(M.r,e),j.include(H.b,e),(0,x.a8)(j),(0,x.eU)(j),(0,E.O4)(j),j.main.add(F.H`
228
+ discardBySlice(vpos);
229
+ discardByTerrainDepth();
230
+ ${ie?F.H`
231
+ vec4 texColor = texture(tex, ${ae?"colorUV":"vuv0"});
232
+ ${(0,F.If)(Q,"texColor.rgb /= texColor.a;")}
233
+ discardOrAdjustAlpha(texColor);`:F.H`vec4 texColor = vec4(1.0);`}
234
+ shadingParams.viewDirection = normalize(vpos - cameraPosition);
235
+ ${$===u.W.ScreenDerivative?F.H`vec3 normal = screenDerivativeNormal(vPositionLocal);`:F.H`shadingParams.normalView = vNormalWorld;
236
+ vec3 normal = shadingNormal(shadingParams);`}
237
+ applyPBRFactors();
238
+ float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
239
+
240
+ vec3 posWorld = vpos + localOrigin;
241
+
242
+ float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
243
+ float shadow = ${X?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,F.If)(Z,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
244
+
245
+ vec3 matColor = max(ambient, diffuse);
246
+ vec3 albedo = mixExternalColor(${(0,F.If)(te,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
247
+ float opacity_ = layerOpacity * mixExternalOpacity(${(0,F.If)(te,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, opacityMixMode);
248
+
249
+ ${ne?`mat3 tangentSpace = computeTangentSpace(${re?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${oe?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
250
+ vec3 normalGround = ${Z?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
251
+
252
+ ${(0,F.If)(J,F.H`
253
+ float snow = getSnow(normal, normalGround);
254
+ albedo = mix(albedo, vec3(1), snow);
255
+ shadingNormal = mix(shadingNormal, normal, snow);
256
+ ssao = mix(ssao, 1.0, snow);`)}
257
+
258
+ vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
259
+
260
+ ${K===w.A9.Normal||K===w.A9.Schematic?F.H`
261
+ float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
262
+ vec4 emission = ${se?"vec4(0.0)":"getEmissions(albedo)"};
263
+ ${(0,F.If)(J,"mrr = applySnowToMRR(mrr, snow);\n emission = snowCoverForEmissions(emission, snow);")}
264
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:F.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
265
+ vec4 finalColor = vec4(shadedColor, opacity_);
266
+ outputColorHighlightOID(finalColor, vpos, albedo ${(0,F.If)(J,", snow")});
267
+ `),t}const j=Object.freeze(Object.defineProperty({__proto__:null,build:W},Symbol.toStringTag,{value:"Module"}))},29878:(e,t,r)=>{var i;r.d(t,{d:()=>i}),function(e){e[e.OBJECT=0]="OBJECT",e[e.HUD=1]="HUD",e[e.TERRAIN=2]="TERRAIN",e[e.OVERLAY=3]="OVERLAY",e[e.I3S=4]="I3S",e[e.PCL=5]="PCL",e[e.LOD=6]="LOD",e[e.VOXEL=7]="VOXEL",e[e.TILES3D=8]="TILES3D"}(i||(i={}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(3694),n=r(38954),o=r(51850),a=r(620);class s{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:c}=r;(0,a.vA)(c.length%this._numIndexPerPrimitive===0),(0,a.vA)(c.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*c[this._numIndexPerPrimitive*e[0]];l.clear(),l.push(u);const h=(0,o.fA)(i[u],i[u+1],i[u+2]),m=(0,o.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*c[r+e],l.push(u);let t=i[u];h[0]=Math.min(t,h[0]),m[0]=Math.max(t,m[0]),t=i[u+1],h[1]=Math.min(t,h[1]),m[1]=Math.max(t,m[1]),t=i[u+2],h[2]=Math.min(t,h[2]),m[2]=Math.max(t,m[2])}}this.bbMin=h,this.bbMax=m;const p=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(m[0]-h[0],m[1]-h[1]),m[2]-h[2]);let f=this.radius*this.radius;for(let e=0;e<l.length;++e){u=l.at(e);const t=i[u]-p[0],r=i[u+1]-p[1],n=i[u+2]-p[2],o=t*t+r*r+n*n;if(o<=f)continue;const a=Math.sqrt(o),s=.5*(a-this.radius);this.radius=this.radius+s,f=this.radius*this.radius;const c=s/a;p[0]+=t*c,p[1]+=r*c,p[2]+=n*c}this.center=p,l.clear()}getChildren(){if(this._children||(0,n.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,n.m)((0,o.vt)(),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:a,size:l,indices:c}=this.position;for(let n=0;n<t;++n){let t=0;const o=this._numIndexPerPrimitive*this.primitiveIndices[n];let s=l*c[o],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=l*c[o+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[n]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[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];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){l.prune()}}const l=new i.A({deallocator:null})},31821:(e,t,r)=>{function i(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 n(e,t,r=""){return e?t:r}r.d(t,{H:()=>i,If:()=>n}),function(e){e.int=function(e){return Math.round(e).toString()},e.float=function(e){return e.toPrecision(8)}}(i||(i={}))},32680:(e,t,r)=>{r.d(t,{M:()=>n});var i=r(31821);function n(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
268
+ vec3 camToVert = posWorld - camPosWorld;
269
+ bool isBackface = dot(camToVert, normalWorld) > 0.0;
270
+ if (isBackface) {
271
+ posClip.z += 0.0000003 * posClip.w;
272
+ }
273
+ return posClip;
274
+ }`)}},32976:(e,t,r)=>{r.d(t,{o:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t){super(e,"bool",i.c.Bind,(r,i)=>r.setUniform1b(e,t(i)))}}},33079:(e,t,r)=>{r.d(t,{t:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"vec3",i.c.Pass,(i,n,o)=>i.setUniform3fv(e,t(n,o),r))}}},33094:(e,t,r)=>{r.d(t,{U:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"float",i.c.Bind,(i,n)=>i.setUniform1f(e,t(n),r))}}},33524:(e,t,r)=>{r.d(t,{K_:()=>p,Yf:()=>c,ez:()=>l,m6:()=>f,mE:()=>m,xt:()=>u,z5:()=>d});var i=r(49255),n=r(59643),o=r(63907),a=r(90644);const s=(0,a.p3)(o.dn.ONE,o.dn.ZERO,o.dn.ONE,o.dn.ONE_MINUS_SRC_ALPHA);function l(e){return e===n.Y.FrontFace?null:s}function c(e){switch(e){case n.Y.NONE:return a.T8;case n.Y.ColorAlpha:return s;case n.Y.FrontFace:case n.Y.COUNT:return null}}function d(e){if(e.draped)return null;switch(e.oitPass){case n.Y.NONE:case n.Y.FrontFace:return e.writeDepth?a.Uy:null;case n.Y.ColorAlpha:case n.Y.COUNT:return null}}const u=5e5,h={factor:-1,units:-2};function m({oitPass:e,enableOffset:t}){return t&&e===n.Y.ColorAlpha?h:null}function p(e,t=o.MT.LESS){return e===n.Y.NONE||e===n.Y.FrontFace?t:o.MT.LEQUAL}function f(e,t){const r=(0,i.LG)(t);return e===n.Y.ColorAlpha?r?{buffers:[o.r6,o.yI,o.Fq]}:{buffers:[o.r6,o.yI]}:r?{buffers:[o.r6,o.yI]}:null}},33752:(e,t,r)=>{r.d(t,{EM:()=>g,dO:()=>v,em:()=>f});var i=r(29242),n=r(9093),o=r(51850),a=r(26425),s=r(40710),l=r(33079),c=r(31821),d=r(98353),u=r(35644),h=r(40095),m=r(46540),p=r(65786);function f(e,t){const{attributes:r,vertex:i,varyings:n,fragment:o}=e;i.include(a.u,t),r.add(m.r.POSITION,"vec3"),n.add("vPositionWorldCameraRelative","vec3"),n.add("vPosition_view","vec3",{invariant:!0}),i.uniforms.add(new l.t("transformWorldFromViewTH",e=>e.transformWorldFromViewTH),new l.t("transformWorldFromViewTL",e=>e.transformWorldFromViewTL),new u.k("transformViewFromCameraRelativeRS",e=>e.transformViewFromCameraRelativeRS),new h.X("transformProjFromView",e=>e.transformProjFromView),new d.h("transformWorldFromModelRS",e=>e.transformWorldFromModelRS),new s.W("transformWorldFromModelTH",e=>e.transformWorldFromModelTH),new s.W("transformWorldFromModelTL",e=>e.transformWorldFromModelTL)),i.code.add(c.H`vec3 positionWorldCameraRelative() {
275
+ vec3 rotatedModelPosition = transformWorldFromModelRS * position;
276
+ vec3 transform_CameraRelativeFromModel = dpAdd(
277
+ transformWorldFromModelTL,
278
+ transformWorldFromModelTH,
279
+ -transformWorldFromViewTL,
280
+ -transformWorldFromViewTH
281
+ );
282
+ return transform_CameraRelativeFromModel + rotatedModelPosition;
283
+ }`),i.code.add(c.H`
284
+ void forwardPosition(float fOffset) {
285
+ vPositionWorldCameraRelative = positionWorldCameraRelative();
286
+ if (fOffset != 0.0) {
287
+ vPositionWorldCameraRelative += fOffset * ${t.spherical?c.H`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:c.H`vec3(0.0, 0.0, 1.0)`};
288
+ }
289
+
290
+ vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
291
+ gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
292
+ }
293
+ `),o.uniforms.add(new l.t("transformWorldFromViewTL",e=>e.transformWorldFromViewTL)),i.code.add(c.H`vec3 positionWorld() {
294
+ return transformWorldFromViewTL + vPositionWorldCameraRelative;
295
+ }`),o.code.add(c.H`vec3 positionWorld() {
296
+ return transformWorldFromViewTL + vPositionWorldCameraRelative;
297
+ }`)}class v extends p.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,o.vt)(),this.transformWorldFromViewTL=(0,o.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)(),this.transformProjFromView=(0,n.vt)()}}class g extends p.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,o.vt)(),this.transformWorldFromModelTL=(0,o.vt)()}}},34845:(e,t,r)=>{r.d(t,{Ir:()=>d});var i=r(37585),n=r(48163),o=r(87317),a=r(91829),s=r(77108),l=r(14314),c=r(31821);function d(e){e.fragment.uniforms.add(new l.I("projInfo",e=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,o.s)(u,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,o.s)(u,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(e.camera))),e.fragment.uniforms.add(new s.E("zScale",e=>0===e.camera.projectionMatrix[11]?(0,i.hZ)(h,0,1):(0,i.hZ)(h,1,0))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
298
+ return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
299
+ }`)}const u=(0,a.vt)(),h=(0,n.vt)()},35256:(e,t,r)=>{r.d(t,{E:()=>c});var i=r(90237),n=r(49255),o=r(51976);class a extends o.K{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}var s=r(59643),l=r(69270);class c extends a{constructor(){super(...arguments),this.output=n.V.Color,this.oitPass=s.Y.NONE,this.hasSlicePlane=!1,this.hasHighlightMixTexture=!1,this.bindType=l.c.Pass,this.writeDepth=!0}}(0,i._)([(0,o.W)({count:n.V.COUNT})],c.prototype,"output",void 0),(0,i._)([(0,o.W)({count:s.Y.COUNT})],c.prototype,"oitPass",void 0),(0,i._)([(0,o.W)()],c.prototype,"hasSlicePlane",void 0),(0,i._)([(0,o.W)()],c.prototype,"hasHighlightMixTexture",void 0)},35640:(e,t,r)=>{r.d(t,{Ge:()=>c,VQ:()=>u});var i=r(87317),n=r(91829),o=r(52587),a=r(20693),s=r(71988),l=r(31821);function c(e,t){const r=e.vertex;t.hasVerticalOffset?(u(r),t.hasScreenSizePerspective&&(e.include(o.Y6),(0,o.OH)(r),(0,a.yu)(e.vertex,t)),r.code.add(l.H`
300
+ vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
301
+ float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
302
+ ${t.spherical?l.H`vec3 worldNormal = normalize(worldPos + localOrigin);`:l.H`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
303
+ ${t.hasScreenSizePerspective?l.H`
304
+ float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
305
+ float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:l.H`
306
+ float verticalOffsetScreenHeight = verticalOffset.x;`}
307
+ // Screen sized offset in world space, used for example for line callouts
308
+ float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
309
+ return worldNormal * worldOffset;
310
+ }
311
+
312
+ vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
313
+ return worldPos + calculateVerticalOffset(worldPos, localOrigin);
314
+ }
315
+ `)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const d=(0,n.vt)();function u(e){e.uniforms.add(new s.E("verticalOffset",(e,t)=>{const{minWorldLength:r,maxWorldLength:n,screenLength:o}=e.verticalOffset,a=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),s=t.camera.pixelRatio||1;return(0,i.s)(d,o*s,a,r,n)}))}},35644:(e,t,r)=>{r.d(t,{k:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"mat3",i.c.Pass,(i,n,o)=>i.setUniformMatrix3fv(e,t(n,o),r))}}},35818:(e,t,r)=>{r.d(t,{W:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t){super(e,"int",i.c.Bind,(r,i)=>r.setUniform1i(e,t(i)))}}},36782:(e,t,r)=>{r.d(t,{g:()=>a});var i=r(49255),n=r(31821),o=r(46540);function a(e,t){if(t.output!==i.V.ObjectAndLayerIdColor)return e.vertex.code.add(n.H`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(n.H`void outputObjectAndLayerIdColor() {}`);const r=t.objectAndLayerIdColorInstanced;e.varyings.add("objectAndLayerIdColorVarying","vec4"),e.attributes.add(r?o.r.INSTANCEOBJECTANDLAYERIDCOLOR:o.r.OLIDCOLOR,"vec4"),e.vertex.code.add(n.H`
316
+ void forwardObjectAndLayerIdColor() {
317
+ objectAndLayerIdColorVarying = ${r?"instanceObjectAndLayerIdColor":"objectAndLayerIdColor"} * 0.003921568627451;
318
+ }`),e.fragment.code.add(n.H`void outputObjectAndLayerIdColor() {
319
+ fragColor = objectAndLayerIdColorVarying;
320
+ }`)}},38969:(e,t,r)=>{r.d(t,{i:()=>n});var i=r(37955);function n(e,t){return new Promise((r,n)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",n)))})}},39168:(e,t,r)=>{r.d(t,{Bz:()=>g,G:()=>v}),r(51850);var i=r(14314),n=r(31821),o=r(35818),a=r(69270),s=r(74333);class l extends s.n{constructor(e,t,r,i){super(e,"mat4",a.c.Draw,(r,n,o,a)=>r.setUniformMatrix4fv(e,t(n,o,a),i),r)}}class c extends s.n{constructor(e,t,r,i){super(e,"mat4",a.c.Pass,(r,n,o)=>r.setUniformMatrix4fv(e,t(n,o),i),r)}}var d=r(65786);function u(e){e.fragment.uniforms.add(new c("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),m(e)}function h(e){e.fragment.uniforms.add(new l("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),m(e)}function m(e){const{fragment:t}=e;t.uniforms.add(new i.I("cascadeDistances",e=>e.shadowMap.cascadeDistances),new o.W("numCascades",e=>e.shadowMap.numCascades)),t.code.add(n.H`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
321
+ vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
322
+ vec4 lv = mat * vec4(_vpos, 1.0);
323
+ lv.xy /= lv.w;
324
+ return 0.5 * lv.xyz + vec3(0.5);
325
+ }
326
+ vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) {
327
+ float xScale = float(textureSize.y) / float(textureSize.x);
328
+ return vec2((float(i) + lvpos.x) * xScale, lvpos.y);
329
+ }
330
+ vec3 calculateUVZShadow(in vec3 _worldPos, in float _linearDepth, in ivec2 shadowMapSize) {
331
+ int i = _linearDepth < cascadeDistances[1] ? 0 : _linearDepth < cascadeDistances[2] ? 1 : _linearDepth < cascadeDistances[3] ? 2 : 3;
332
+ if (i >= numCascades) {
333
+ return invalidShadowmapUVZ;
334
+ }
335
+ mat4 shadowMatrix = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
336
+ vec3 lvpos = lightSpacePosition(_worldPos, shadowMatrix);
337
+ if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) {
338
+ return invalidShadowmapUVZ;
339
+ }
340
+ vec2 uvShadow = cascadeCoordinates(i, shadowMapSize, lvpos);
341
+ return vec3(uvShadow, lvpos.z);
342
+ }`)}function p(e){e.fragment.code.add(n.H`float readShadowMapUVZ(vec3 uvzShadow, sampler2DShadow _shadowMap) {
343
+ return texture(_shadowMap, uvzShadow);
344
+ }`)}d.Y;class f extends s.n{constructor(e,t){super(e,"sampler2DShadow",a.c.Bind,(r,i)=>r.bindTexture(e,t(i)))}}function v(e,t){t.receiveShadows&&(e.include(u),_(e))}function g(e,t){t.receiveShadows&&(e.include(h),_(e))}function _(e){e.include(p);const{fragment:t}=e;t.uniforms.add(new f("shadowMap",e=>e.shadowMap.depthTexture)),t.code.add(n.H`float readShadowMap(const in vec3 _worldPos, float _linearDepth) {
345
+ vec3 uvzShadow = calculateUVZShadow(_worldPos, _linearDepth, textureSize(shadowMap,0));
346
+ if (uvzShadow.z < 0.0) {
347
+ return 0.0;
348
+ }
349
+ return readShadowMapUVZ(uvzShadow, shadowMap);
350
+ }`)}d.Y},39341:(e,t,r)=>{r.d(t,{D:()=>n});var i=r(46540);const n=new Map([[i.r.POSITION,0],[i.r.NORMAL,1],[i.r.NORMALCOMPRESSED,1],[i.r.UV0,2],[i.r.UVI,2],[i.r.COLOR,3],[i.r.COLORFEATUREATTRIBUTE,3],[i.r.SIZE,4],[i.r.TANGENT,4],[i.r.CENTEROFFSETANDDISTANCE,5],[i.r.SYMBOLCOLOR,5],[i.r.FEATUREATTRIBUTE,6],[i.r.INSTANCEFEATUREATTRIBUTE,6],[i.r.OLIDCOLOR,6],[i.r.INSTANCEOBJECTANDLAYERIDCOLOR,6],[i.r.INSTANCECOLOR,7],[i.r.ROTATION,8],[i.r.INSTANCEMODEL,8],[i.r.INSTANCEMODELNORMAL,12],[i.r.INSTANCEMODELORIGINHI,11],[i.r.INSTANCEMODELORIGINLO,15]])},40095:(e,t,r)=>{r.d(t,{X:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"mat4",i.c.Pass,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}},40261:(e,t,r)=>{r.d(t,{E:()=>T});var i=r(46686),n=r(49255),o=r(76591),a=r(76597),s=r(96336),l=r(36782),c=r(53466),d=r(72824),u=r(31821);function h(e,t){switch(t.output){case n.V.Shadow:case n.V.ShadowHighlight:case n.V.ShadowExcludeHighlight:case n.V.ViewshedShadow:e.fragment.code.add(u.H`float _calculateFragDepth(const in float depth) {
351
+ const float SLOPE_SCALE = 2.0;
352
+ const float BIAS = 20.0 * .000015259;
353
+ float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
354
+ return depth + SLOPE_SCALE * m + BIAS;
355
+ }
356
+ void outputDepth(float _linearDepth){
357
+ float fragDepth = _calculateFragDepth(_linearDepth);
358
+ gl_FragDepth = fragDepth;
359
+ }`)}}var m=r(42593),p=r(42398),f=r(58614),v=r(20693),g=r(63761),_=r(89192);function T(e,t){const{vertex:r,fragment:T,varyings:x}=e,{hasColorTexture:E,alphaDiscardMode:M}=t,A=E&&M!==_.sf.Opaque,{output:w,normalType:b,hasColorTextureTransform:R}=t;switch(w){case n.V.Depth:(0,v.NB)(r,t),e.include(a.d,t),T.include(o.HQ,t),e.include(c.U,t),A&&T.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(u.H`vpos = getVertexInLocalOriginSpace();
360
+ vpos = subtractOrigin(vpos);
361
+ vpos = addVerticalOffset(vpos, localOrigin);
362
+ gl_Position = transformPosition(proj, view, vpos);
363
+ forwardTextureCoordinates();`),e.include(f.S,t),T.main.add(u.H`
364
+ discardBySlice(vpos);
365
+ ${(0,u.If)(A,u.H`vec4 texColor = texture(tex, ${R?"colorUV":"vuv0"});
366
+ discardOrAdjustAlpha(texColor);`)}`);break;case n.V.Shadow:case n.V.ShadowHighlight:case n.V.ShadowExcludeHighlight:case n.V.ViewshedShadow:case n.V.ObjectAndLayerIdColor:(0,v.NB)(r,t),e.include(a.d,t),e.include(c.U,t),e.include(p.A,t),e.include(h,t),T.include(o.HQ,t),e.include(l.g,t),(0,i.xJ)(e),x.add("depth","float",{invariant:!0}),A&&T.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(u.H`vpos = getVertexInLocalOriginSpace();
367
+ vpos = subtractOrigin(vpos);
368
+ vpos = addVerticalOffset(vpos, localOrigin);
369
+ gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
370
+ forwardTextureCoordinates();
371
+ forwardObjectAndLayerIdColor();`),e.include(f.S,t),T.main.add(u.H`
372
+ discardBySlice(vpos);
373
+ ${(0,u.If)(A,u.H`vec4 texColor = texture(tex, ${R?"colorUV":"vuv0"});
374
+ discardOrAdjustAlpha(texColor);`)}
375
+ ${w===n.V.ObjectAndLayerIdColor?u.H`outputObjectAndLayerIdColor();`:u.H`outputDepth(depth);`}`);break;case n.V.Normal:{(0,v.NB)(r,t),e.include(a.d,t),e.include(s.Y,t),e.include(d.Mh,t),e.include(c.U,t),e.include(p.A,t),A&&T.uniforms.add(new g.N("tex",e=>e.texture)),b===s.W.ScreenDerivative&&x.add("vPositionView","vec3",{invariant:!0});const i=b===s.W.Attribute||b===s.W.Compressed;r.main.add(u.H`
376
+ vpos = getVertexInLocalOriginSpace();
377
+ ${i?u.H`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:u.H`vPositionView = (view * vec4(vpos, 1.0)).xyz;`}
378
+ vpos = subtractOrigin(vpos);
379
+ vpos = addVerticalOffset(vpos, localOrigin);
380
+ gl_Position = transformPosition(proj, view, vpos);
381
+ forwardTextureCoordinates();`),T.include(o.HQ,t),e.include(f.S,t),T.main.add(u.H`
382
+ discardBySlice(vpos);
383
+ ${(0,u.If)(A,u.H`vec4 texColor = texture(tex, ${R?"colorUV":"vuv0"});
384
+ discardOrAdjustAlpha(texColor);`)}
385
+
386
+ ${b===s.W.ScreenDerivative?u.H`vec3 normal = screenDerivativeNormal(vPositionView);`:u.H`vec3 normal = normalize(vNormalWorld);
387
+ if (gl_FrontFacing == false){
388
+ normal = -normal;
389
+ }`}
390
+ fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case n.V.Highlight:(0,v.NB)(r,t),e.include(a.d,t),e.include(c.U,t),e.include(p.A,t),A&&T.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(u.H`vpos = getVertexInLocalOriginSpace();
391
+ vpos = subtractOrigin(vpos);
392
+ vpos = addVerticalOffset(vpos, localOrigin);
393
+ gl_Position = transformPosition(proj, view, vpos);
394
+ forwardTextureCoordinates();`),T.include(o.HQ,t),e.include(f.S,t),e.include(m.Q,t),T.main.add(u.H`
395
+ discardBySlice(vpos);
396
+ ${(0,u.If)(A,u.H`vec4 texColor = texture(tex, ${R?"colorUV":"vuv0"});
397
+ discardOrAdjustAlpha(texColor);`)}
398
+ calculateOcclusionAndOutputHighlight();`)}}},40710:(e,t,r)=>{r.d(t,{W:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"vec3",i.c.Draw,(i,n,o,a)=>i.setUniform3fv(e,t(n,o,a),r))}}},42293:(e,t,r)=>{r.d(t,{IB:()=>n}),r(44208),r(94656);var i=r(63907);function n(e){switch(e){case i.Ab.ALPHA:case i.Ab.LUMINANCE:case i.Ab.RED:case i.Ab.RED_INTEGER:case i.H0.R8:case i.H0.R8I:case i.H0.R8UI:case i.H0.R8_SNORM:case i.Xo.STENCIL_INDEX8:return 1;case i.Ab.LUMINANCE_ALPHA:case i.Ab.RG:case i.Ab.RG_INTEGER:case i.H0.RGBA4:case i.H0.R16F:case i.H0.R16I:case i.H0.R16UI:case i.H0.RG8:case i.H0.RG8I:case i.H0.RG8UI:case i.H0.RG8_SNORM:case i.H0.RGB565:case i.H0.RGB5_A1:case i.SB.DEPTH_COMPONENT16:return 2;case i.Ab.RGB:case i.Ab.RGB_INTEGER:case i.H0.RGB8:case i.H0.RGB8I:case i.H0.RGB8UI:case i.H0.RGB8_SNORM:case i.H0.SRGB8:case i.SB.DEPTH_COMPONENT24:return 3;case i.Ab.RGBA:case i.Ab.RGBA_INTEGER:case i.H0.RGBA8:case i.H0.R32F:case i.H0.R11F_G11F_B10F:case i.H0.RG16F:case i.H0.R32I:case i.H0.R32UI:case i.H0.RG16I:case i.H0.RG16UI:case i.H0.RGBA8I:case i.H0.RGBA8UI:case i.H0.RGBA8_SNORM:case i.H0.SRGB8_ALPHA8:case i.H0.RGB9_E5:case i.H0.RGB10_A2UI:case i.H0.RGB10_A2:case i.SB.DEPTH_COMPONENT32F:case i.iE.DEPTH24_STENCIL8:return 4;case i.iE.DEPTH32F_STENCIL8:return 5;case i.H0.RGB16F:case i.H0.RGB16I:case i.H0.RGB16UI:return 6;case i.H0.RG32F:case i.H0.RG32I:case i.H0.RG32UI:case i.H0.RGBA16F:case i.H0.RGBA16I:case i.H0.RGBA16UI:return 8;case i.H0.RGB32F:case i.H0.RGB32I:case i.H0.RGB32UI:return 12;case i.H0.RGBA32F:case i.H0.RGBA32I:case i.H0.RGBA32UI:return 16;case i.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.CQ.COMPRESSED_R11_EAC:case i.CQ.COMPRESSED_SIGNED_R11_EAC:case i.CQ.COMPRESSED_RGB8_ETC2:case i.CQ.COMPRESSED_SRGB8_ETC2:case i.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.CQ.COMPRESSED_RG11_EAC:case i.CQ.COMPRESSED_SIGNED_RG11_EAC:case i.CQ.COMPRESSED_RGBA8_ETC2_EAC:case i.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}r(62298)},42398:(e,t,r)=>{r.d(t,{A:()=>f});var i=r(43519),n=r(33079),o=r(71988),a=r(69270),s=r(74333);class l extends s.n{constructor(e,t,r,i){super(e,"vec4",a.c.Pass,(r,n,o)=>r.setUniform4fv(e,t(n,o),i),r)}}class c extends s.n{constructor(e,t,r,i){super(e,"float",a.c.Pass,(r,n,o)=>r.setUniform1fv(e,t(n,o),i),r)}}var d=r(31821),u=r(35644),h=r(46540),m=r(78662);r(11725),m.Gd;const p=8;function f(e,t){const{vertex:r,attributes:a}=e;t.hasVvInstancing&&(t.vvSize||t.vvColor)&&a.add(h.r.INSTANCEFEATUREATTRIBUTE,"vec4"),t.vvSize?(r.uniforms.add(new n.t("vvSizeMinSize",e=>e.vvSize.minSize)),r.uniforms.add(new n.t("vvSizeMaxSize",e=>e.vvSize.maxSize)),r.uniforms.add(new n.t("vvSizeOffset",e=>e.vvSize.offset)),r.uniforms.add(new n.t("vvSizeFactor",e=>e.vvSize.factor)),r.uniforms.add(new n.t("vvSizeFallback",e=>e.vvSize.fallback)),r.uniforms.add(new u.k("vvSymbolRotationMatrix",e=>e.vvSymbolRotationMatrix)),r.uniforms.add(new n.t("vvSymbolAnchor",e=>e.vvSymbolAnchor)),r.code.add(d.H`vec3 vvScale(vec4 _featureAttribute) {
399
+ if (isnan(_featureAttribute.x)) {
400
+ return vvSizeFallback;
401
+ }
402
+ return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);
403
+ }
404
+ vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
405
+ return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
406
+ }`),r.code.add(d.H`
407
+ const float eps = 1.192092896e-07;
408
+ vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
409
+ vec3 scale = max(vvScale(_featureAttribute), eps);
410
+ return vec4(vvSymbolRotationMatrix * _normal / scale, 1.0);
411
+ }
412
+
413
+ ${t.hasVvInstancing?d.H`
414
+ vec4 vvLocalNormal(vec3 _normal) {
415
+ return vvTransformNormal(_normal, instanceFeatureAttribute);
416
+ }
417
+
418
+ vec4 localPosition() {
419
+ return vvTransformPosition(position, instanceFeatureAttribute);
420
+ }`:""}
421
+ `)):r.code.add(d.H`vec4 localPosition() { return vec4(position, 1.0); }
422
+ vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),e.vertex.include(i.WD),t.vvColor?(r.constants.add("vvColorNumber","int",p),r.uniforms.add(new c("vvColorValues",e=>e.vvColor.values,p),new l("vvColorColors",e=>e.vvColor.colors,p),new o.E("vvColorFallback",e=>e.vvColor.fallback,{supportsNaN:!0})),t.hasVvInstancing&&(e.vertex.include(i.ML),e.vertex.include(i.oF)),r.code.add(d.H`
423
+ vec4 interpolateVVColor(float value) {
424
+ if (isnan(value)) {
425
+ return vvColorFallback;
426
+ }
427
+
428
+ if (value <= vvColorValues[0]) {
429
+ return vvColorColors[0];
430
+ }
431
+
432
+ for (int i = 1; i < vvColorNumber; ++i) {
433
+ if (vvColorValues[i] >= value) {
434
+ float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
435
+ return mix(vvColorColors[i-1], vvColorColors[i], f);
436
+ }
437
+ }
438
+ return vvColorColors[vvColorNumber - 1];
439
+ }
440
+
441
+ vec4 vvGetColor(vec4 featureAttribute) {
442
+ return interpolateVVColor(featureAttribute.y);
443
+ }
444
+
445
+ ${t.hasVvInstancing?d.H`
446
+ vec4 vvColor() {
447
+ return vvGetColor(instanceFeatureAttribute);
448
+ }
449
+
450
+ MaskedColor applyVVColor(MaskedColor color) {
451
+ return multiplyMaskedColors(color, createMaskedFromNaNColor(vvColor()));
452
+ }
453
+ `:d.H`
454
+ vec4 vvColor() {
455
+ return vec4(1.0);
456
+ }
457
+
458
+ MaskedColor applyVVColor(MaskedColor color) {
459
+ return color;
460
+ }
461
+ `}
462
+ `)):r.code.add(d.H`vec4 vvColor() {
463
+ return vec4(1.0);
464
+ }
465
+ MaskedColor applyVVColor(MaskedColor color) {
466
+ return color;
467
+ }`)}},42593:(e,t,r)=>{r.d(t,{Q:()=>h});var i=r(31821);function n(e){const{fragment:t}=e;t.code.add(i.H`uint readChannelBits(uint channel, int highlightLevel) {
468
+ int llc = (highlightLevel & 3) << 1;
469
+ return (channel >> llc) & 3u;
470
+ }
471
+ uint readChannel(uvec2 texel, int highlightLevel) {
472
+ int lic = (highlightLevel >> 2) & 1;
473
+ return texel[lic];
474
+ }
475
+ uint readLevelBits(uvec2 texel, int highlightLevel) {
476
+ return readChannelBits(readChannel(texel, highlightLevel), highlightLevel);
477
+ }`)}var o=r(49255),a=r(69270),s=r(74333);class l extends s.n{constructor(e,t){super(e,"ivec2",a.c.Bind,(r,i)=>r.setUniform2iv(e,t(i)))}}var c=r(35818),d=r(12791);class u extends s.n{constructor(e,t){super(e,"usampler2D",a.c.Bind,(r,i)=>r.bindTexture(e,t(i)))}}function h(e,t){const{fragment:r}=e,{output:a,draped:s,hasHighlightMixTexture:h}=t;a===o.V.Highlight?(r.uniforms.add(new c.W("highlightLevel",e=>e.highlightLevel??0),new l("highlightMixOrigin",e=>e.highlightMixOrigin)),e.outputs.add("fragHighlight","uvec2",0),e.include(n),h?r.uniforms.add(new u("highlightMixTexture",e=>e.highlightMixTexture)).code.add(i.H`uvec2 getAccumulatedHighlight() {
478
+ return texelFetch(highlightMixTexture, ivec2(gl_FragCoord.xy) - highlightMixOrigin, 0).rg;
479
+ }
480
+ void outputHighlight(bool occluded) {
481
+ if (highlightLevel == 0) {
482
+ uint bits = occluded ? 3u : 1u;
483
+ fragHighlight = uvec2(bits, 0);
484
+ } else {
485
+ int ll = (highlightLevel & 3) << 1;
486
+ int li = (highlightLevel >> 2) & 3;
487
+ uint bits;
488
+ if (occluded) {
489
+ bits = 3u << ll;
490
+ } else {
491
+ bits = 1u << ll;
492
+ }
493
+ uvec2 combinedHighlight = getAccumulatedHighlight();
494
+ combinedHighlight[li] |= bits;
495
+ fragHighlight = combinedHighlight;
496
+ }
497
+ }`):r.code.add(i.H`void outputHighlight(bool occluded) {
498
+ uint bits = occluded ? 3u : 1u;
499
+ fragHighlight = uvec2(bits, 0);
500
+ }`),s?r.code.add(i.H`bool isHighlightOccluded() {
501
+ return false;
502
+ }`):r.uniforms.add(new d.x("depthTexture",e=>e.mainDepth)).code.add(i.H`bool isHighlightOccluded() {
503
+ float sceneDepth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x;
504
+ return gl_FragCoord.z > sceneDepth + 5e-7;
505
+ }`),r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {
506
+ outputHighlight(isHighlightOccluded());
507
+ }`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},43519:(e,t,r)=>{r.d(t,{ML:()=>a,WD:()=>n,Y1:()=>o,oF:()=>s});var i=r(31821);function n(e){e.code.add(i.H`struct MaskedColor {
508
+ vec4 color;
509
+ bvec4 mask;
510
+ };`)}function o(e){e.include(n),e.code.add(i.H`
511
+ MaskedColor createMaskedFromUInt8NaNColor(vec4 color) {
512
+ return MaskedColor(color * ${i.H.float(1/254)}, equal(color, vec4(255)));
513
+ }
514
+ `)}function a(e){e.include(n),e.code.add(i.H`MaskedColor multiplyMaskedColors(MaskedColor color1, MaskedColor color2) {
515
+ vec4 masked1 = mix(color1.color, vec4(1), color1.mask);
516
+ vec4 masked2 = mix(color2.color, vec4(1), color2.mask);
517
+ return MaskedColor(masked1 * masked2, bvec4(ivec4(color1.mask) & ivec4(color2.mask)));
518
+ }`)}function s(e){e.include(n),e.code.add(i.H`MaskedColor createMaskedFromNaNColor(vec4 color) {
519
+ return MaskedColor(color, isnan(color));
520
+ }`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>s,Um:()=>l,kE:()=>a});var i=r(4576),n=r(34727),o=r(77194);function a(e,t,r,i,a){let s=r.screenLength*e.pixelRatio;null!=a&&(s=(0,o.hs)(s,i,t,a));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.qE)(l*t,r.minWorldLength,r.maxWorldLength)}function s(e,t){let r=!1;for(const n in t){const o=t[n];void 0!==o&&(Array.isArray(o)?Array.isArray(e[n])&&(0,i.aI)(o,e[n])||(e[n]=o.slice(),r=!0):e[n]!==o&&(r=!0,e[n]=o))}return r}const l={multiply:1,ignore:2,replace:3,tint:4}},46140:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(49186);let n=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[n,o]=t.split("."),a=/^\s*\d+\s*$/;if(!n?.match||!a.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!o?.match||!a.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(n,10),l=parseInt(o,10);return new e(s,l,r)}}},46686:(e,t,r)=>{r.d(t,{i$:()=>c,oD:()=>d,xJ:()=>l});var i=r(49255),n=r(33752),o=r(77108),a=r(31821);function s(e){e.varyings.add("linearDepth","float",{invariant:!0})}function l(e){e.vertex.uniforms.add(new o.E("nearFar",e=>e.camera.nearFar))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
521
+ return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
522
+ }`)}function d(e,t){const{vertex:r}=e;switch(t.output){case i.V.Color:case i.V.ColorEmission:if(t.receiveShadows)return s(e),void r.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.V.Shadow:case i.V.ShadowHighlight:case i.V.ShadowExcludeHighlight:case i.V.ViewshedShadow:return e.include(n.em,t),s(e),l(e),c(e),void r.code.add(a.H`void forwardLinearDepth() {
523
+ linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
524
+ }`)}r.code.add(a.H`void forwardLinearDepth() {}`)}},47286:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"vec2",i.c.Pass,(i,n,o)=>i.setUniform2fv(e,t(n,o),r))}}},48833:(e,t,r)=>{r.d(t,{g:()=>G}),r(44208);var i=r(49186),n=r(65529),o=r(97768),a=r(74887),s=r(34275),l=r(24326),c=r(84952),d=r(38969),u=r(99677),h=r(56058),m=r(89192),p=r(2741);let f;var v=r(92993),g=r(63907),_=r(21231),T=r(42293);let x=null,E=null;async function M(){return null==E&&(f??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,p.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),E=f,x=await E),E}function A(e,t,r,i,n){const o=(0,T.IB)(t?g.CQ.COMPRESSED_RGBA8_ETC2_EAC:g.CQ.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function w(e){return e.getNumImages()>=1&&!e.isUASTC()}function b(e){return e.getFaces()>=1&&e.isETC1S()}function R(e,t,r,i,n,o,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[v.n.ETC2_RGBA,g.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[v.n.ETC1_RGB,g.CQ.COMPRESSED_RGB8_ETC2]:c?i?[v.n.BC3_RGBA,g.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[v.n.BC1_RGB,g.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[v.n.RGBA32,g.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?g.Cj.LINEAR_MIPMAP_LINEAR:g.Cj.LINEAR,t.width=n,t.height=o,new _.g(e,t,{type:"compressed",levels:m})}var O=r(53966);const S=()=>O.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function y(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const C=y("DXT1"),I=y("DXT3"),N=y("DXT5");function P(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function D(e,t){const[r,i]=F(e,t);return e.width===r&&e.height===i?e:L(e,r,i)}function F({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const a=Math.min(Math.sqrt(r/o),i/n);return[P(Math.round(e*a),i),P(Math.round(t*a),i)]}function L(e,t,r){if(e instanceof ImageData)return L(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const n=document.createElement("canvas");return n.width=t,n.height=r,n.getContext("2d").drawImage(e,0,0,n.width,n.height),n}var H=r(620),B=r(67171);class G{constructor(e,t){this._data=e,this.id=(0,l.c)(),this.events=new n.A,this._parameters={...z,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,c.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,c.DB)(e.src)||(0,c.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new B.R;return t.wrapMode=this._parameters.wrap??g.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?g.Cj.LINEAR_MIPMAP_LINEAR:g.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture??this._emptyTexture}get loaded(){return null!=this._glTexture}get usedMemory(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return t.encoding===m.JS.KTX2_ENCODING?function(e,t){if(null==x)return e.byteLength;const r=new x.KTX2File(new Uint8Array(e)),i=b(r)?A(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===m.JS.BASIS_ENCODING?function(e,t){if(null==x)return e.byteLength;const r=new x.BasisFile(new Uint8Array(e)),i=w(r)?A(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?U(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._glTexture)return this._glTexture;const t=this._data;return null==t?(this._glTexture=new _.g(e,this._createDescriptor(e),null),this._glTexture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&this._parameters.encoding===m.JS.DDS_ENCODING?this._loadFromDDSData(e,t):(0,s.mw)(t)&&this._parameters.encoding===m.JS.DDS_ENCODING?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&this._parameters.encoding===m.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&this._parameters.encoding===m.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,s.mg)(t)?this._loadFromPixelData(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_update(e,t){return null==this._glTexture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return S().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return S().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case C:n=8,o=g.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case I:n=16,o=g.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case N:n=16,o=g.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return S().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];(3&s||3&l)&&(S().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*n,u=new Uint8Array(e.buffer,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:o,width:c,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?g.Cj.LINEAR_MIPMAP_LINEAR:g.Cj.LINEAR,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new _.g(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._glTexture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==x&&(x=await M());const i=new x.KTX2File(new Uint8Array(r));if(!b(i))return null;i.startTranscoding();const n=R(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(),n}(e,this._createDescriptor(e),t).then(e=>(this._glTexture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==x&&(x=await M());const i=new x.BasisFile(new Uint8Array(r));if(!w(i))return null;i.startTranscoding();const n=R(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(),n}(e,this._createDescriptor(e),t).then(e=>(this._glTexture=e,e)))}_loadFromPixelData(e,t){(0,H.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?g.Ab.LUMINANCE:3===this._parameters.components?g.Ab.RGB:g.Ab.RGBA,r.pixelFormat!==g.Ab.RGB&&r.pixelFormat!==g.Ab.RGBA||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new _.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,h.Sx)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((n,s)=>{const l=()=>{t.removeEventListener("loadeddata",c),t.removeEventListener("error",d),(0,o.xt)(u)},c=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),n(this._loadFromImage(e,t)))},d=e=>{l(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",c),t.addEventListener("error",d);const u=(0,a.u7)(r,()=>d((0,a.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=D(r,e.parameters));const i=U(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.pixelFormat=3===this._parameters.components?g.Ab.RGB:g.Ab.RGBA,n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._glTexture=new _.g(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),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),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._glTexture=(0,o.WD)(this._glTexture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function U(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const z={wrap:{s:g.pF.REPEAT,t:g.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},49255:(e,t,r)=>{var i;function n(e){return e===i.Shadow||e===i.ShadowHighlight||e===i.ShadowExcludeHighlight||e===i.ViewshedShadow}function o(e){return function(e){return function(e){return l(e)||s(e)}(e)||u(e)}(e)||e===i.Normal}function a(e){return function(e){return d(e)||u(e)}(e)||e===i.Normal}function s(e){return e===i.Highlight||e===i.ObjectAndLayerIdColor}function l(e){return e===i.Color}function c(e){return l(e)||h(e)}function d(e){return c(e)||s(e)}function u(e){return e===i.Depth}function h(e){return e===i.ColorEmission}function m(e){switch(e){case i.Depth:case i.Shadow:case i.ShadowHighlight:case i.ShadowExcludeHighlight:case i.ViewshedShadow:return!0}return!1}r.d(t,{LG:()=>h,Mb:()=>d,PJ:()=>n,RN:()=>c,V:()=>i,Vg:()=>m,XY:()=>o,iq:()=>a}),function(e){e[e.Color=0]="Color",e[e.ColorEmission=1]="ColorEmission",e[e.Depth=2]="Depth",e[e.Normal=3]="Normal",e[e.Shadow=4]="Shadow",e[e.ShadowHighlight=5]="ShadowHighlight",e[e.ShadowExcludeHighlight=6]="ShadowExcludeHighlight",e[e.ViewshedShadow=7]="ViewshedShadow",e[e.Highlight=8]="Highlight",e[e.ObjectAndLayerIdColor=9]="ObjectAndLayerIdColor",e[e.COUNT=10]="COUNT"}(i||(i={}))},49718:(e,t,r)=>{r(51850);var i=r(6867);r(29878),i.i},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51406:(e,t,r)=>{r.d(t,{MU:()=>c,O1:()=>d,QM:()=>u,Sx:()=>l,q2:()=>s});var i=r(29242),n=r(53466),o=r(31821),a=r(35644);function s(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new a.k("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??i.zK)).code.add(o.H`void forwardColorUV(){
525
+ colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
526
+ }`)):e.vertex.code.add(o.H`void forwardColorUV(){}`)}function l(e,t){t.hasNormalTextureTransform&&t.textureCoordinateType!==n.I.None?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new a.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK)).code.add(o.H`void forwardNormalUV(){
527
+ normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
528
+ }`)):e.vertex.code.add(o.H`void forwardNormalUV(){}`)}function c(e,t){t.hasEmissionTextureTransform&&t.textureCoordinateType!==n.I.None?(e.varyings.add("emissiveUV","vec2"),e.vertex.uniforms.add(new a.k("emissiveTextureTransformMatrix",e=>e.emissiveTextureTransformMatrix??i.zK)).code.add(o.H`void forwardEmissiveUV(){
529
+ emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
530
+ }`)):e.vertex.code.add(o.H`void forwardEmissiveUV(){}`)}function d(e,t){t.hasOcclusionTextureTransform&&t.textureCoordinateType!==n.I.None?(e.varyings.add("occlusionUV","vec2"),e.vertex.uniforms.add(new a.k("occlusionTextureTransformMatrix",e=>e.occlusionTextureTransformMatrix??i.zK)).code.add(o.H`void forwardOcclusionUV(){
531
+ occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
532
+ }`)):e.vertex.code.add(o.H`void forwardOcclusionUV(){}`)}function u(e,t){t.hasMetallicRoughnessTextureTransform&&t.textureCoordinateType!==n.I.None?(e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.uniforms.add(new a.k("metallicRoughnessTextureTransformMatrix",e=>e.metallicRoughnessTextureTransformMatrix??i.zK)).code.add(o.H`void forwardMetallicRoughnessUV(){
533
+ metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
534
+ }`)):e.vertex.code.add(o.H`void forwardMetallicRoughnessUV(){}`)}},51976:(e,t,r)=>{r.d(t,{K:()=>s,W:()=>l});var i=r(49186),n=r(4576);class o{constructor(e){this._bits=[...e]}equals(e){return(0,n.aI)(this._bits,e.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var a=r(65786);class s extends a.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new o(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map(e=>` ${e}: ${this[e]}`).join("\n");return this._parameterBits=t,r}}function l(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const n=e.count||2,o=Math.ceil(Math.log2(n)),a=t._parameterBits;let s=0;for(;a[s]+o>16;)s++,s>=a.length&&a.push(0);const l=a[s],c=(1<<o)-1<<l;a[s]+=o,e.count?Object.defineProperty(t,r,{get(){return(this._parameterBits[s]&c)>>l},set(t){if(this[r]!==t){if(this._key=null,this._parameterBits[s]=this._parameterBits[s]&~c|+t<<l&c,"number"!=typeof t)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be a number, got ${typeof t}`);if(null==e.count)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must provide a count option`)}}}):Object.defineProperty(t,r,{get(){return!!((this._parameterBits[s]&c)>>l)},set(e){if(this[r]!==e&&(this._key=null,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},52540:(e,t,r)=>{r.d(t,{E:()=>s});var i=r(37585),n=r(48163),o=r(77108),a=r(31821);function s(e){e.uniforms.add(new o.E("zProjectionMap",e=>function(e){const t=e.projectionMatrix;return(0,i.hZ)(l,t[14],t[10])}(e.camera))),e.code.add(a.H`float linearizeDepth(float depth) {
535
+ float depthNdc = depth * 2.0 - 1.0;
536
+ float c1 = zProjectionMap[0];
537
+ float c2 = zProjectionMap[1];
538
+ return -(c1 / (depthNdc + c2 + 1e-7));
539
+ }`),e.code.add(a.H`float depthFromTexture(sampler2D depthTexture, vec2 uv) {
540
+ ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0)));
541
+ float depth = texelFetch(depthTexture, iuv, 0).r;
542
+ return depth;
543
+ }`),e.code.add(a.H`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) {
544
+ return linearizeDepth(depthFromTexture(depthTexture, uv));
545
+ }`)}const l=(0,n.vt)()},52587:(e,t,r)=>{r.d(t,{OH:()=>c,Y6:()=>s,pM:()=>l});var i=r(38954),n=r(51850),o=r(33079),a=r(31821);function s(e){e.vertex.code.add(a.H`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
546
+ return absCosAngle * absCosAngle * absCosAngle;
547
+ }`),e.vertex.code.add(a.H`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) {
548
+ return vec3(
549
+ min(params.x / (distanceToCamera - params.y), 1.0),
550
+ screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
551
+ params.z
552
+ );
553
+ }`),e.vertex.code.add(a.H`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) {
554
+ return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
555
+ }`),e.vertex.code.add(a.H`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) {
556
+ return applyScreenSizePerspectiveScaleFactorFloat(
557
+ size,
558
+ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
559
+ );
560
+ }`),e.vertex.code.add(a.H`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) {
561
+ return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
562
+ }`),e.vertex.code.add(a.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
563
+ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
564
+ }`)}function l(e){e.uniforms.add(new o.t("screenSizePerspective",e=>d(e.screenSizePerspective)))}function c(e){e.uniforms.add(new o.t("screenSizePerspectiveAlignment",e=>d(e.screenSizePerspectiveAlignment||e.screenSizePerspective)))}function d(e){return(0,i.i)(u,e.parameters.divisor,e.parameters.offset,e.minScaleFactor)}const u=(0,n.vt)()},53466:(e,t,r)=>{r.d(t,{I:()=>i,U:()=>l});var i,n,o=r(21818),a=r(31821),s=r(46540);function l(e,t){switch(t.textureCoordinateType){case i.Default:return e.attributes.add(s.r.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(a.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case i.Atlas:return e.attributes.add(s.r.UV0,"vec2"),e.attributes.add(s.r.UVREGION,"vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(a.H`void forwardTextureCoordinates() {
565
+ vuv0 = uv0;
566
+ vuvRegion = uvRegion;
567
+ }`);default:(0,o.Xb)(t.textureCoordinateType);case i.None:return void e.vertex.code.add(a.H`void forwardTextureCoordinates() {}`);case i.COUNT:return}}(n=i||(i={}))[n.None=0]="None",n[n.Default=1]="Default",n[n.Atlas=2]="Atlas",n[n.COUNT=3]="COUNT"},53802:(e,t,r)=>{r.d(t,{n:()=>zt});var i=r(31821),n=r(12791),o=r(90237),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(10107),u=(r(44208),r(53966)),h=(r(87811),r(40608)),m=r(37585),p=r(69540);let f=class extends p.A{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,o._)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"row",void 0),(0,o._)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"column",void 0),(0,o._)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"rows",void 0),(0,o._)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"columns",void 0),f=(0,o._)([(0,h.$)("esri.CameraLayout")],f);const v=f;var g=r(69052),_=r(25482),T=r(79901),x=r(36005),E=r(43937),M=r(56507),A=r(86738);let w=class extends(p.A.ClonableMixin(_.A)){constructor(...e){super(...e),this.position=new A.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new v}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,M.GB)(e.x||0),n.y=(0,M.GB)(e.y||0),n.z=e.hasZ?(0,M.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new A.A;return r.read(e,t),r.x=(0,M.GB)(r.x||0),r.y=(0,M.GB)(r.y||0),r.z=r.hasZ?(0,M.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,o._)([(0,d.MZ)({type:A.A,json:{write:{isRequired:!0}}})],w.prototype,"position",void 0),(0,o._)([(0,E.K)("position")],w.prototype,"writePosition",null),(0,o._)([(0,x.w)("position")],w.prototype,"readPosition",null),(0,o._)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,T.w)(e=>g.ie.normalize((0,M.GB)(e)))],w.prototype,"heading",void 0),(0,o._)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,T.w)(e=>(0,a.qE)((0,M.GB)(e),-180,180))],w.prototype,"tilt",void 0),(0,o._)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,T.w)(e=>(0,a.qE)((0,M.GB)(e,55),1,170))],w.prototype,"fov",void 0),(0,o._)([(0,d.MZ)({type:v,nonNullable:!0,json:{read:!1,write:!1}})],w.prototype,"layout",void 0),w=(0,o._)([(0,h.$)("esri.Camera")],w);var b,R,O,S,y=r(9093),C=r(38954),I=r(51850),N=r(16930),P=(r(48353),r(9762),r(65806)),D=r(27993),F=r(73941),L=(r(19419),r(69622)),H=r(90629),B=r(58083),G=r(48163),U=r(87317),z=r(91829),V=r(82919),W=r(71351),j=r(44280),k=r(24151);r(3694),(S=b||(b={}))[S.Default=0]="Default",S[S.Screenshot=1]="Screenshot",S[S.ObjectAndLayerID=2]="ObjectAndLayerID",function(e){e[e.TOP=0]="TOP",e[e.RIGHT=1]="RIGHT",e[e.BOTTOM=2]="BOTTOM",e[e.LEFT=3]="LEFT"}(R||(R={}));let q=O=class extends L.A{constructor(e){super(e),this._ray=(0,W.vt)(),this._viewport=(0,z.fA)(0,0,1,1),this._padding=(0,z.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,G.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,y.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,y.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,y.vt)(),this._frustumDirty=!0,this._frustum=(0,V.vt)(),this._fullViewport=(0,z.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,I.vt)(),this._up=(0,I.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,C.d)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,B.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,C.i)((0,I.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,C.i)((0,I.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,C.i)((0,I.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,U.d)((0,z.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,U.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,U.d)((0,z.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,U.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[R.LEFT],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[R.BOTTOM],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[R.RIGHT]+this._padding[R.LEFT]}set fullWidth(e){this.width=e-(this._padding[R.RIGHT]+this._padding[R.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[R.TOP]+this._padding[R.BOTTOM]}set fullHeight(e){this.height=e-(this._padding[R.TOP]+this._padding[R.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[R.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[R.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,U.a)(this._padding,e)||(this._viewport[0]+=e[R.LEFT]-this._padding[R.LEFT],this._viewport[1]+=e[R.BOTTOM]-this._padding[R.BOTTOM],this._viewport[2]-=e[R.RIGHT]+e[R.LEFT]-(this._padding[R.RIGHT]+this._padding[R.LEFT]),this._viewport[3]-=e[R.TOP]+e[R.BOTTOM]-(this._padding[R.TOP]+this._padding[R.BOTTOM]),(0,U.c)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,B.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,B.B8)((0,y.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,y.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,C.j)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,B.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,B.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,a=-i/2+this.column*o,s=a+o,l=-r/2+this.row*n,c=l+n,d=(0,B.$h)((0,y.vt)(),a*(1+2*this._padding[R.LEFT]/e),s*(1+2*this._padding[R.RIGHT]/e),l*(1+2*this._padding[R.BOTTOM]/t),c*(1+2*this._padding[R.TOP]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,B.aI)(u,d)?u:d}copyFrom(e){(0,C.c)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,U.c)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,U.c)(this._padding,e.padding),this.notifyChange("_padding"),(0,m.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,B.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,V.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,B.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,U.c)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new O).copyFrom(this)}equals(e){return(0,C.q)(this.eye,e.eye)&&(0,C.q)(this.center,e.center)&&(0,C.q)(this.up,e.up)&&(0,U.a)(this._viewport,e.viewport)&&(0,U.a)(this._padding,e.padding)&&(0,m.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,U.f)(e.screenPadding,this.screenPadding)>=t||(0,U.f)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,C.a)(Z,e.eye,e.center),(0,C.a)(X,this.eye,this.center);const r=(0,C.e)(Z,X),i=(0,C.y)(Z),n=(0,C.y)(X),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,C.x)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,j.gr)(this.viewForward,(0,C.d)(Z,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,H.gs)()){return e[0]=(this.padding[R.LEFT]+this.width/2)/this.pixelRatio,e[1]=(this.padding[R.TOP]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[R.LEFT]+this.width*t,e[1]=this.padding[R.BOTTOM]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==$&&(0,C.c)($,e),$[3]=1,(0,U.t)($,$,this.projectionMatrix);const r=Math.abs($[3]);(0,C.g)($,$,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*$[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*$[1]),t[2]=.5*($[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;$[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],$[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],$[2]=(2*e[2]-1)*e[3],$[3]=e[3],null!=this.inverseProjectionMatrix&&((0,U.t)($,$,this.inverseProjectionMatrix),t[0]=$[0],t[1]=$[1],t[2]=$[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,J),this.renderToScreen(J,t),t}projectToRenderScreen(e,t){if($[0]=e[0],$[1]=e[1],$[2]=e[2],$[3]=1,(0,U.t)($,$,this.viewProjectionMatrix),0===$[3])return null;const r=$;(0,C.g)(r,r,1/Math.abs($[3]));const i=this.fullViewport,n=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,J),t)}unprojectFromRenderScreen(e,t){if((0,B.lw)(Y,this.projectionMatrix,this.viewMatrix),!(0,B.B8)(Y,Y))return null;const r=this.fullViewport;return $[0]=2*(e[0]-r[0])/r[2]-1,$[1]=2*(e[1]-r[1])/r[3]-1,$[2]=2*e[2]-1,$[3]=1,(0,U.t)($,$,Y),0===$[3]?null:(t[0]=$[0]/$[3],t[1]=$[1]/$[3],t[2]=$[2]/$[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,a=Math.max(n-r/2,0),s=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),d=r-l- -Math.min(this.fullWidth-n-r/2,0),u=i-c- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){e===k.RT.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}_computeUpGlobal(){(0,C.d)(Z,this.center,this.eye);const e=(0,C.l)(this.center);e<1?((0,C.i)(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,C.e)(Z,this.center))>.9999*(0,C.l)(Z)*e||((0,C.h)(this._up,Z,this.center),(0,C.h)(this._up,this._up,Z),(0,C.n)(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){(0,C.E)(Z,this.eye,this.center),Math.abs(Z[2])<=.9999&&((0,C.g)(Z,Z,Z[2]),(0,C.i)(this._up,-Z[0],-Z[1],1-Z[2]),(0,C.n)(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,C.q)(e,t)||((0,C.c)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):u.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,V.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,B.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,o._)([(0,d.MZ)()],q.prototype,"_viewport",void 0),(0,o._)([(0,d.MZ)()],q.prototype,"_padding",void 0),(0,o._)([(0,d.MZ)()],q.prototype,"_fov",void 0),(0,o._)([(0,d.MZ)()],q.prototype,"_nearFar",void 0),(0,o._)([(0,d.MZ)()],q.prototype,"_viewDirty",void 0),(0,o._)([(0,d.MZ)()],q.prototype,"_viewMatrix",void 0),(0,o._)([(0,d.MZ)()],q.prototype,"_pixelRatio",void 0),(0,o._)([(0,d.MZ)()],q.prototype,"pixelRatio",null),(0,o._)([(0,d.MZ)()],q.prototype,"row",void 0),(0,o._)([(0,d.MZ)()],q.prototype,"column",void 0),(0,o._)([(0,d.MZ)()],q.prototype,"_rows",void 0),(0,o._)([(0,d.MZ)()],q.prototype,"rows",null),(0,o._)([(0,d.MZ)()],q.prototype,"_columns",void 0),(0,o._)([(0,d.MZ)()],q.prototype,"columns",null),(0,o._)([(0,d.MZ)()],q.prototype,"eye",null),(0,o._)([(0,d.MZ)()],q.prototype,"center",null),(0,o._)([(0,d.MZ)()],q.prototype,"_center",void 0),(0,o._)([(0,d.MZ)()],q.prototype,"up",null),(0,o._)([(0,d.MZ)()],q.prototype,"_up",void 0),(0,o._)([(0,d.MZ)()],q.prototype,"viewMatrix",null),(0,o._)([(0,d.MZ)({readOnly:!0})],q.prototype,"viewForward",null),(0,o._)([(0,d.MZ)({readOnly:!0})],q.prototype,"viewUp",null),(0,o._)([(0,d.MZ)({readOnly:!0})],q.prototype,"viewRight",null),(0,o._)([(0,d.MZ)({readOnly:!0})],q.prototype,"nearFar",null),(0,o._)([(0,d.MZ)()],q.prototype,"near",null),(0,o._)([(0,d.MZ)()],q.prototype,"far",null),(0,o._)([(0,d.MZ)()],q.prototype,"viewport",null),(0,o._)([(0,d.MZ)({readOnly:!0})],q.prototype,"screenViewport",null),(0,o._)([(0,d.MZ)({readOnly:!0})],q.prototype,"screenPadding",null),(0,o._)([(0,d.MZ)()],q.prototype,"x",null),(0,o._)([(0,d.MZ)()],q.prototype,"y",null),(0,o._)([(0,d.MZ)()],q.prototype,"width",null),(0,o._)([(0,d.MZ)()],q.prototype,"height",null),(0,o._)([(0,d.MZ)()],q.prototype,"fullWidth",null),(0,o._)([(0,d.MZ)()],q.prototype,"fullHeight",null),(0,o._)([(0,d.MZ)({readOnly:!0})],q.prototype,"_aspect",null),(0,o._)([(0,d.MZ)()],q.prototype,"padding",null),(0,o._)([(0,d.MZ)({readOnly:!0})],q.prototype,"projectionMatrix",null),(0,o._)([(0,d.MZ)({readOnly:!0})],q.prototype,"inverseProjectionMatrix",null),(0,o._)([(0,d.MZ)()],q.prototype,"fov",null),(0,o._)([(0,d.MZ)()],q.prototype,"fovX",null),(0,o._)([(0,d.MZ)()],q.prototype,"fovY",null),(0,o._)([(0,d.MZ)()],q.prototype,"viewInverseTransposeMatrix",null),(0,o._)([(0,d.MZ)({readOnly:!0})],q.prototype,"_projectionMatrixInternal",null),(0,o._)([(0,d.MZ)()],q.prototype,"relativeElevation",void 0),q=O=(0,o._)([(0,h.$)("esri.views.3d.webgl.RenderCamera")],q);const $=(0,z.vt)(),Y=(0,y.vt)(),Z=(0,I.vt)(),X=(0,I.vt)(),J=(0,H.r_)();class K{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far))}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.zero=new K(0,0)}static{this.infinite=new K}}r(49718),r(62258),r(6867),r(29878),r(16396),(0,I.vt)(),(0,I.vt)(),(0,I.vt)(),new WeakMap;var Q,ee,te,re,ie=r(5443),ne=r(39829),oe=r(95108);function ae(e,t,r,i){const n=function(e,t){const r=t===te.LEFT||t===te.RIGHT?0:1,i=e[t],n=t===te.LEFT||t===te.BOTTOM?Q.MIN:Q.MAX,o=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return n===Q.MIN?ee.OUTSIDE:ee.INSIDE;if(t[r]>i&&a[r]>i)return n===Q.MIN?ee.INSIDE:ee.OUTSIDE;const s=(a[o]-t[o])/(a[r]-t[r]),l=t[o]+s*(i-t[r]);return e[r]=i,e[o]=l,(t[r]<i?1:-1)*n>0?ee.OUTSIDE_IN:ee.INSIDE_OUT}}(r,i);if(e.length=0,t.length){n(le,t[0],t[0])===ee.INSIDE&&se(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(le,t[r],i)){case ee.INSIDE:se(e,i);break;case ee.INSIDE_OUT:se(e,(0,G.o8)(le));break;case ee.OUTSIDE_IN:se(e,(0,G.o8)(le)),se(e,i);case ee.OUTSIDE:}}}}function se(e,t){0!==e.length&&(0,m.aI)(e.at(-1),t)||e.push(t)}(re=Q||(Q={}))[re.MIN=1]="MIN",re[re.MAX=-1]="MAX",function(e){e[e.OUTSIDE=0]="OUTSIDE",e[e.INSIDE=1]="INSIDE",e[e.OUTSIDE_IN=2]="OUTSIDE_IN",e[e.INSIDE_OUT=3]="INSIDE_OUT"}(ee||(ee={})),function(e){e[e.LEFT=0]="LEFT",e[e.BOTTOM=1]="BOTTOM",e[e.RIGHT=2]="RIGHT",e[e.TOP=3]="TOP"}(te||(te={}));const le=(0,G.vt)();class ce{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,V.vt)(),this._points=(0,V.Qy)(),this.lines=new Array(12),this._origin=(0,I.vt)(),this._direction=(0,I.vt)(),this._altitude=null;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,I.vt)(),endpoint:null}}update(e){(0,V.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,C.c)(this._origin,e.eye),(0,C.c)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,C.c)(this._points[t],e[t]);(0,V.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,V.m7)(this.frustum,e)}intersectsRay(e){return(0,V.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,V.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,V.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;he(this.lines[t],e[t],e[r]),he(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),he(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}static{this.planePointIndices=V.c8}static{this.nearFarLineIndices=[[V.J7.NEAR_BOTTOM_LEFT,V.J7.FAR_BOTTOM_LEFT],[V.J7.NEAR_BOTTOM_RIGHT,V.J7.FAR_BOTTOM_RIGHT],[V.J7.NEAR_TOP_RIGHT,V.J7.FAR_TOP_RIGHT],[V.J7.NEAR_TOP_LEFT,V.J7.FAR_TOP_LEFT]]}}var de,ue;function he(e,t,r){e.origin=t,e.endpoint=r,(0,C.E)(e.direction,t,r)}(ue=de||(de={}))[ue.NEAR_FAR_BOTTOM_LEFT=0]="NEAR_FAR_BOTTOM_LEFT",ue[ue.NEAR_FAR_BOTTOM_RIGHT=1]="NEAR_FAR_BOTTOM_RIGHT",ue[ue.NEAR_FAR_TOP_RIGHT=2]="NEAR_FAR_TOP_RIGHT",ue[ue.NEAR_FAR_TOP_LEFT=3]="NEAR_FAR_TOP_LEFT",ue[ue.NEAR_BOTTOM=4]="NEAR_BOTTOM",ue[ue.NEAR_RIGHT=5]="NEAR_RIGHT",ue[ue.NEAR_TOP=6]="NEAR_TOP",ue[ue.NEAR_LEFT=7]="NEAR_LEFT",ue[ue.FAR_BOTTOM=8]="FAR_BOTTOM",ue[ue.FAR_RIGHT=9]="FAR_RIGHT",ue[ue.FAR_TOP=10]="FAR_TOP",ue[ue.FAR_LEFT=11]="FAR_LEFT";var me=r(11964),pe=r(27921);const fe=(0,I.vt)(),ve=(0,I.vt)();function ge(){return{direction:(0,I.vt)(),up:(0,I.vt)()}}function _e(e,t,r,i,n){let o=(0,C.n)(fe,e),s=(0,C.e)(o,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,C.e)(t,i)),s<.99?((0,C.c)(o,t),l&&(0,C.g)(o,o,-1)):o=null);let c=0;if(o){(0,C.g)(ve,i,(0,C.e)(i,o)),(0,C.d)(o,o,ve);const e=(0,C.e)(o,n)/((0,C.l)(o)*(0,C.l)(n));(0,C.h)(ve,o,n),c=((0,C.e)(ve,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,C.e)(i,e)/(0,C.l)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function Te(e,t,r,i){(0,C.d)(xe,r,t),(0,pe.T7)(i,(0,me.LV)(t,xe),e)||e===r||(0,C.c)(e,r)}const xe=(0,I.vt)(),Ee=(0,I.fA)(0,1,0),Me=(0,I.fA)(0,0,1),Ae=(0,y.vt)(),we=(0,I.vt)(),be=(0,I.vt)();function Re(e,t,r,i=ge()){const{direction:n,up:o}=i;return(0,B.N9)(Ae,-(0,a.kU)(t)),(0,B.eL)(Ae,Ae,(0,a.kU)(r)),(0,C.t)(n,Me,Ae),(0,C.g)(n,n,-1),(0,C.t)(o,Ee,Ae),i}function Oe(e,t,r,i,n){const o=t.lines[de.FAR_LEFT].direction,a=(n-r.getAltitude(i))/o[2];(0,C.b)(e,i,o,a)}const Se=(0,I.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return _e(t,r,i,Me,Ee)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=Re(0,r,i),o=(0,I.vt)();return(0,C.g)(o,n.direction,-t),(0,C.f)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:Re,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[V.FB.FAR];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,W.LV)(t.origin,t.direction),n,Se)||Oe(Se,r,i,t.endpoint,n),Te(Se,a,Se,l),s.push((0,G.fA)(Se[0],Se[1]))}return function(e,t,r){const i=e.map(e=>((0,C.i)(Se,e[0],e[1],0),t.fromRenderCoords(Se,Se,r),[Se[0],Se[1]]));return i.length<=2?new ne.A({spatialReference:r}):(i.push(i[0].slice()),(0,oe.$3)(i)||i.reverse(),new ne.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return ae(r,e,t,te.LEFT),ae(i,r,t,te.BOTTOM),ae(r,i,t,te.RIGHT),ae(i,r,t,te.TOP),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,P.g)(t,we,o),(0,P.g)(t,be,o),we[0]-=r/2,be[0]+=r/2,we[1]-=i/2,be[1]+=i/2,(0,D.F)(we,o,we,a),(0,D.F)(be,o,be,a),n?(n.xmin=we[0],n.ymin=we[1],n.xmax=be[0],n.ymax=be[1],n.spatialReference=a):n=new ie.A(we[0],we[1],be[0],be[1],a),n}},Symbol.toStringTag,{value:"Module"}));var ye=r(34304),Ce=r(97937),Ie=r(28735);r(83047);const Ne=(0,I.fA)(parseFloat(Number(5802e-9).toFixed(6)),parseFloat(Number(13558e-9).toFixed(6)),parseFloat(Number(331e-7).toFixed(6))),Pe=(0,I.fA)(3*parseFloat(Number(65e-8).toFixed(6)),3*parseFloat(Number(1881e-9).toFixed(6)),3*parseFloat(Number(85e-9).toFixed(6)));(0,I.fA)(parseFloat(Number(Ne[0]+Pe[0]).toFixed(6)),parseFloat(Number(Ne[1]+Pe[1]).toFixed(6)),parseFloat(Number(Ne[2]+Pe[2]).toFixed(6)));(0,I.vt)(),(0,I.vt)(),(0,Ce.c)(),(0,W.vt)();const De=(0,I.vt)(),Fe=(0,I.vt)();var Le=r(32728);const He=(0,I.fA)(0,0,1),Be=(0,C.n)((0,I.vt)(),(0,I.fA)(1,1,1)),Ge=new g.hr(-180,180),Ue=(0,y.vt)(),ze=(0,I.vt)(),Ve=(0,I.vt)();function We(e,t,r,i=ge()){(0,C.h)(ze,e,He),0===(0,C.e)(ze,ze)&&(0,C.h)(ze,e,Be),(0,B.$0)(Ue,-(0,a.kU)(t),e),(0,B.e$)(Ue,Ue,-(0,a.kU)(r),ze);const{up:n,direction:o}=i;return(0,C.h)(n,ze,e),(0,C.n)(n,n),(0,C.t)(n,n,Ue),(0,C.n)(o,e),(0,C.u)(o,o),(0,C.t)(o,o,Ue),i}function je(e){const t=e[1];e[1]=-e[2],e[2]=t}function ke(e,t){const r=We(t,e.heading,e.tilt);return e.up=r.up,e}function qe(e,t){const r=[],i=[],n=(0,ye.FD)();for(let o=0;o<e.length;o++){const a=e[o],s=o===e.length-1?e[0]:e[o+1],l=(0,me.Cr)(a,s,et),c=(0,pe.vE)(t,l.origin,l.vector,pe.v1.NONE,Ke);switch(c){case pe.Nj.INSIDE:r.push(a);break;case pe.Nj.OUTSIDE:i.push(a);break;case pe.Nj.INTERSECTS_INSIDE_OUT:case pe.Nj.INTERSECTS_OUTSIDE_IN:{const[e,o,s]=c===pe.Nj.INTERSECTS_INSIDE_OUT?[1,r,i]:[-1,i,r],l=(0,pe.Qj)(t),d=(0,C.b)((0,I.vt)(),Ke,l,e*n),u=(0,C.b)((0,I.vt)(),Ke,l,e*-n);o.push(a),o.push(d),s.push(u)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const $e={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},Ye=(0,I.fA)(1,0,0),Ze=(0,I.fA)(0,1,0),Xe=(0,I.vt)(),Je=(0,I.vt)(),Ke=(0,I.vt)(),Qe=(0,Ce.c)(),et=(0,me.vt)(),tt=(0,z.vt)();var rt,it,nt;Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=ze,o=Ve;return(0,C.n)(n,e),(0,C.h)(Ve,n,He),0===(0,C.e)(Ve,Ve)&&(0,C.h)(Ve,n,Be),(0,C.h)(o,Ve,n),_e(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,I.vt)(),up:null,tilt:i,heading:r},o=ze;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),m=Math.cos(c),p=(0,C.l)(o);let f;if(Math.abs(c)<1e-8)f=s+p;else{const e=p/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const v=m*s,g=s*s*(h*h),_=u*u*g,T=f-v,x=T*T,E=_*(_+x-o[1]*o[1]);if(E<0)return(0,C.g)(n.eye,o,f/p),n.tilt=0,ke(n,e);const M=Math.sqrt(E),A=o[1]*T,w=_+x;let b;if(b=u>0?-M+A:M+A,Math.abs(w)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=s):(0,C.g)(n.eye,o,f/p),n.tilt=0,je(n.eye),ke(n,e);n.eye[1]=b/w;const R=d*d*g,O=h*s,S=u*O*n.eye[1],y=n.eye[1]*n.eye[1],N=1-y,P=Math.sqrt(N),D=_*y+R-2*S*P*T+N*x;return Math.abs(D)<1e-8?((0,C.g)(n.eye,o,f/p),n.tilt=0,je(n.eye),ke(n,e)):(n.eye[0]=(N*(f*o[0]-v*o[0])-O*P*(o[0]*n.eye[1]*u+o[2]*d))/D,n.eye[2]=(N*(f*o[2]-v*o[2])-O*P*(o[2]*n.eye[1]*u-o[0]*d))/D,(0,C.g)(n.eye,n.eye,f),je(n.eye),ke(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),n=(0,C.l)(t);return(0,a.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:We,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,C.l)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,a.YN)(r/(n/Math.sin(e)));return(0,a.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new ce(r);i.near=2,n.update(i);const o=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,C.j)(c,t)/(l+o),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=$e,v=function(e){const{renderCoordsHelper:t,state:{camera:r}}=e,{center:i,eye:n}=r,o=Math.abs(t.getAltitude(i)),s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,De),(0,C.d)(Fe,r,t);const i=(0,C.l)(Fe);return 0===i?0:(0,a.XM)((0,C.e)(Fe,De)/i)}(t,i,n));return(0,Ce.b)(Qe,t.referenceEllipsoid.radius+o),(0,Ce.d)(Qe,s,r.distance,r.fovY)}(e),g=(0,a.qE)((u-h)/(m-h),0,1),_=Math.round((0,a.Cc)(p,f,g)),T=i.aboveGround,x=n.planes[V.FB.FAR],E=[],M=(0,pe.O_)(I.uY,Ye,(0,pe.vt)()),A=(0,pe.O_)(I.uY,Ze,(0,pe.vt)());(0,U.s)(tt,0,0,0,0);const w=e=>{};for(let e=0;e<4;e++){const t=e===de.NEAR_FAR_BOTTOM_RIGHT&&!T||e===de.NEAR_FAR_TOP_LEFT&&T?1-v:0,i=e===de.NEAR_FAR_BOTTOM_RIGHT&&T||e===de.NEAR_FAR_TOP_LEFT&&!T?v:1,s=n.lines[e],l=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const d=n/_,u=e===de.NEAR_FAR_BOTTOM_RIGHT?1-(1-d)**2:e===de.NEAR_FAR_TOP_LEFT?d**2:d,h=0===n?0:(0,a.Cc)(t,i,u),m=(0,C.m)(Je,s.origin,l.origin,h),p=(0,Le.nu)(s.direction,l.direction,h,Xe);r.intersectManifoldClosestSilhouette((0,W.LV)(m,p),o,Ke),Te(Ke,c,Ke,x),E.push((0,I.o8)(Ke)),0!==E.length&&w((0,C.x)(E.at(-1),Ke));const f=((0,pe.Tj)(M,Ke)?1:0)|((0,pe.Tj)(A,Ke)?2:0);tt[f]=1}}E.length>2&&(0,C.x)(E[0],E.at(-1));const b=function(e,t,r){const i=2*(0,ye.FD)();return e.map(e=>{const n=[];let o=!1;for(const a of e)t.fromRenderCoords(a,Ke,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,Ke[1]]),n.push([null,Ke[1]]),o=!0):n.push([Ke[0],Ke[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,oe.$3)(n)||n.reverse(),n})}((0,U.b)(tt)>1?function(e,t){const r=[];for(const i of e)r.push(...qe(i,t));return r}(qe(E,M),A):[E],r,s);return new ne.A({rings:b,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,l,c;const d=t.latitude,u=(0,F.tO)(e.spatialReference).radius,h=t.longitude,m=function(e,t,r){const i=t/r,n=(0,a.kU)(e),o=Math.sin(i/2),s=Math.cos(n),l=2*(0,a.YN)(Math.sqrt(o*o/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;o=h-m,s=h+m;const p=(0,a.kU)(d),f=(1+Math.sin(p))/(1-Math.sin(p)),v=(f+1)*Math.tan(i/u/2),_=v*v;function T(e){const t=Math.PI/2;return(e=g.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(v+Math.sqrt(4*f+_))),c=l+i/u,l=T(l),c=T(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=Ge.monotonic(o,s),s-o>180){const e=(s-o-180)/2;o+=e,s-=e}const x=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:N.A.WGS84;return n?(n.xmin=o,n.ymin=l,n.xmax=s,n.ymax=c,n.spatialReference=x):n=new ie.A(o,l,s,c,x),e.spatialReference&&e.spatialReference.isWebMercator&&(0,Ie.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"})),(nt=rt||(rt={})).OPAQUE="opaque-color",nt.TRANSPARENT="transparent-color",nt.COMPOSITE="composite-color",nt.FINAL="final-color",function(e){e.SSAO="ssao",e.LASERLINES="laserline-color",e.ANTIALIASING="aa-color",e.HIGHLIGHTS="highlight-color",e.MAGNIFIER="magnifier-color",e.OCCLUDED="occluded-color",e.VIEWSHED="viewshed-color",e.OPAQUE_TERRAIN="opaque-terrain-color",e.OPAQUE_ENVIRONMENT="opaque-environment-color",e.TRANSPARENT_ENVIRONMENT="transparent-environment-color",e.FOCUSAREA="focusarea",e.FOCUSAREA_COLOR="focusarea-color"}(it||(it={})),(0,I.vt)();var ot=r(49186),at=r(89192);let st=class extends L.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=rt.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new ot.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){e===at.C7.UPDATE&&this.view.stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,o._)([(0,d.MZ)({constructOnly:!0})],st.prototype,"view",void 0),(0,o._)([(0,d.MZ)({constructOnly:!0})],st.prototype,"consumes",void 0),(0,o._)([(0,d.MZ)()],st.prototype,"produces",void 0),(0,o._)([(0,d.MZ)({readOnly:!0})],st.prototype,"techniques",null),st=(0,o._)([(0,h.$)("esri.views.3d.webgl.RenderNode")],st);var lt,ct,dt,ut=r(63907),ht=r(67171),mt=r(12541);(dt=lt||(lt={}))[dt.R8UNORM=0]="R8UNORM",dt[dt.R8UINT=1]="R8UINT",dt[dt.RG8UNORM=2]="RG8UNORM",dt[dt.RG8UINT=3]="RG8UINT",dt[dt.RGBA4UNORM=4]="RGBA4UNORM",dt[dt.RGBA8UNORM=5]="RGBA8UNORM",dt[dt.RGBA8UNORM_MIPMAP=6]="RGBA8UNORM_MIPMAP",dt[dt.R16FLOAT=7]="R16FLOAT",dt[dt.RGBA16FLOAT=8]="RGBA16FLOAT",dt[dt.R32FLOAT=9]="R32FLOAT",dt[dt.COUNT=10]="COUNT",function(e){e[e.DEPTH16=10]="DEPTH16",e[e.DEPTH24_STENCIL8=11]="DEPTH24_STENCIL8"}(ct||(ct={})),lt.R8UNORM,lt.R8UINT,lt.R16FLOAT,lt.R32FLOAT,lt.RG8UNORM,lt.RG8UINT,lt.RGBA8UNORM,lt.RGBA4UNORM,lt.RGBA8UNORM_MIPMAP,lt.RGBA16FLOAT,ct.DEPTH16,ct.DEPTH24_STENCIL8;const pt=new ht.R;pt.pixelFormat=ut.Ab.RED,pt.internalFormat=ut.H0.R8,pt.wrapMode=ut.pF.CLAMP_TO_EDGE;const ft=new ht.R;ft.pixelFormat=ut.Ab.RED_INTEGER,ft.internalFormat=ut.H0.R8UI,ft.wrapMode=ut.pF.CLAMP_TO_EDGE,ft.samplingMode=ut.Cj.NEAREST;const vt=new ht.R;vt.pixelFormat=ut.Ab.RG,vt.internalFormat=ut.H0.RG8,vt.wrapMode=ut.pF.CLAMP_TO_EDGE;const gt=new ht.R;gt.pixelFormat=ut.Ab.RG_INTEGER,gt.internalFormat=ut.H0.RG8UI,gt.wrapMode=ut.pF.CLAMP_TO_EDGE,gt.samplingMode=ut.Cj.NEAREST;const _t=new ht.R;_t.internalFormat=ut.H0.RGBA4,_t.dataType=ut.ld.UNSIGNED_SHORT_4_4_4_4,_t.wrapMode=ut.pF.CLAMP_TO_EDGE;(new ht.R).wrapMode=ut.pF.CLAMP_TO_EDGE;const Tt=new ht.R;Tt.wrapMode=ut.pF.CLAMP_TO_EDGE,Tt.samplingMode=ut.Cj.LINEAR_MIPMAP_LINEAR,Tt.hasMipmap=!0,Tt.maxAnisotropy=8;const xt=new ht.R;xt.pixelFormat=ut.Ab.RED,xt.dataType=ut.ld.HALF_FLOAT,xt.internalFormat=ut.H0.R16F,xt.samplingMode=ut.Cj.NEAREST;const Et=new ht.R;Et.dataType=ut.ld.HALF_FLOAT,Et.internalFormat=ut.H0.RGBA16F,Et.wrapMode=ut.pF.CLAMP_TO_EDGE;const Mt=new ht.R;Mt.pixelFormat=ut.Ab.RED,Mt.dataType=ut.ld.FLOAT,Mt.internalFormat=ut.H0.R32F,Mt.samplingMode=ut.Cj.NEAREST,lt.R8UNORM,lt.R8UINT,lt.RG8UNORM,lt.RG8UINT,lt.RGBA4UNORM,lt.RGBA8UNORM,lt.RGBA8UNORM_MIPMAP,lt.R16FLOAT,lt.RGBA16FLOAT,lt.R32FLOAT,lt.COUNT;const At={[ut.SB.DEPTH_COMPONENT16]:ut.ld.UNSIGNED_SHORT,[ut.SB.DEPTH_COMPONENT24]:ut.ld.UNSIGNED_INT,[ut.SB.DEPTH_COMPONENT32F]:ut.ld.FLOAT,[ut.iE.DEPTH24_STENCIL8]:ut.ld.UNSIGNED_INT_24_8,[ut.iE.DEPTH32F_STENCIL8]:ut.ld.FLOAT_32_UNSIGNED_INT_24_8_REV};function wt(e){const t=new ht.R;return t.pixelFormat=(0,mt.CR)(e)?ut.j7.DEPTH_COMPONENT:ut.j7.DEPTH_STENCIL,t.dataType=At[e],t.samplingMode=ut.Cj.NEAREST,t.wrapMode=ut.pF.CLAMP_TO_EDGE,t.internalFormat=e,t.hasMipmap=!1,t.isImmutable=!0,t}ct.DEPTH24_STENCIL8,wt(ut.iE.DEPTH24_STENCIL8),ct.DEPTH16,wt(ut.SB.DEPTH_COMPONENT16);var bt=r(97220),Rt=r(98958),Ot=r(95774),St=r(90644);class yt extends Rt.w{constructor(e,t){super(e,t,new bt.$(Ot.S,()=>r.e(9384).then(r.bind(r,59384))))}initializePipeline(){return(0,St.Ey)({colorWrite:St.kn})}}var Ct=r(65786);class It extends Ct.Y{constructor(){super(...arguments),this.projScale=1}}class Nt extends It{constructor(){super(...arguments),this.intensity=1}}class Pt extends Ct.Y{}class Dt extends Pt{constructor(){super(...arguments),this.blurSize=(0,G.vt)()}}var Ft=r(15581);class Lt extends Rt.w{constructor(e,t){super(e,t,new bt.$(Ft.S,()=>r.e(191).then(r.bind(r,90191))))}initializePipeline(){return(0,St.Ey)({colorWrite:St.kn})}}var Ht=r(21231);const Bt=2;let Gt=class extends st{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=it.SSAO,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new Nt,this._drawParameters=new Dt}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new ht.R(32);t.wrapMode=ut.pF.CLAMP_TO_EDGE,t.pixelFormat=ut.Ab.RGB,t.wrapMode=ut.pF.REPEAT,t.hasMipmap=!0,this._passParameters.noiseTexture=new Ht.g(this.renderingContext,t,e),this.techniques.precompile(Lt),this.techniques.precompile(yt),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(ut.nI);if(!r||!i)return;const n=this.techniques.get(Lt),o=this.techniques.get(yt);if(!n.compiled||!o.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(at.C7.UPDATE);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,u=d.camera,h=u.relativeElevation,p=(0,a.qE)((5e5-h)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,v=f*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/u.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*Ut/(0,Ft.g)(u)**6*v;const g=u.fullViewport[2],_=u.fullViewport[3],T=this.fboCache.acquire(g,_,"ssao input",lt.RG8UNORM);s.bindFramebuffer(T.fbo),s.setViewport(0,0,g,_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.screen.draw();const x=Math.round(g/Bt),E=Math.round(_/Bt),M=this.fboCache.acquire(x,E,"ssao blur",lt.R8UNORM);s.bindFramebuffer(M.fbo),this._drawParameters.colorTexture=T.getTexture(),(0,m.hZ)(this._drawParameters.blurSize,0,Bt/_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,x,E),s.screen.draw(),T.release();const A=this.fboCache.acquire(x,E,it.SSAO,lt.R8UNORM);return s.bindFramebuffer(A.fbo),s.setViewport(0,0,g,_),s.setClearColor(1,1,1,0),s.clear(ut.NV.COLOR),this._drawParameters.colorTexture=M.getTexture(),(0,m.hZ)(this._drawParameters.blurSize,Bt/g,0),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,x,E),s.screen.draw(),s.setViewport4fv(u.fullViewport),M.release(),f<1&&this.requestRender(at.C7.UPDATE),A}};(0,o._)([(0,d.MZ)()],Gt.prototype,"consumes",void 0),(0,o._)([(0,d.MZ)()],Gt.prototype,"produces",void 0),(0,o._)([(0,d.MZ)({constructOnly:!0})],Gt.prototype,"isEnabled",void 0),Gt=(0,o._)([(0,h.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],Gt);const Ut=.5;function zt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/Bt),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
568
+ vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
569
+ return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
570
+ }
571
+ float evaluateAmbientOcclusion() {
572
+ return 1.0 - evaluateAmbientOcclusionInverse();
573
+ }`)):e.code.add(i.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
574
+ float evaluateAmbientOcclusion() { return 0.0; }`)}},57323:(e,t,r)=>{r.d(t,{R:()=>G,b:()=>B});var i=r(46686),n=r(32680),o=r(49255),a=r(76591),s=r(76597),l=r(24321),c=r(60864),d=r(43519),u=r(96336),h=r(71955),m=r(53466),p=r(92700),f=r(35640),v=r(40261),g=r(53802),_=r(89390),T=r(98619),x=r(22393),E=r(59469),M=r(39168),A=r(96598),w=r(42398),b=r(58614),R=r(27950),O=r(20693),S=r(33079),y=r(71988),C=r(20304),I=r(31821),N=r(63761),P=r(46540),D=r(43616),F=r(60517),L=r(14113),H=r(49788);function B(e){const t=new L.N5,{attributes:r,vertex:B,fragment:G,varyings:U}=t,{output:z,offsetBackfaces:V,pbrMode:W,snowCover:j,spherical:k,hasBloom:q}=e,$=W===E.A9.Normal||W===E.A9.Schematic;if((0,O.NB)(B,e),r.add(P.r.POSITION,"vec3"),U.add("vpos","vec3",{invariant:!0}),t.include(w.A,e),t.include(c.B,e),t.include(f.Ge,e),t.include(A.Z,e),(0,o.RN)(z)&&((0,O.yu)(t.vertex,e),t.include(u.Y,e),t.include(s.d,e),V&&t.include(n.M),U.add("vNormalWorld","vec3"),U.add("localvpos","vec3",{invariant:!0}),t.include(m.U,e),t.include(i.oD,e),t.include(h.K,e),t.include(l.v,e),t.include(p.c,e),B.include(d.WD),B.include(d.oF),B.uniforms.add(new y.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),U.add("vcolorExt","vec4"),B.main.add(I.H`
575
+ forwardNormalizedVertexColor();
576
+
577
+ MaskedColor maskedColorExt =
578
+ applySymbolColor(applyVVColor(applyInstanceColor(createMaskedFromNaNColor(externalColor))));
579
+
580
+ vcolorExt = maskedColorExt.color;
581
+ forwardColorMixMode(maskedColorExt.mask);
582
+
583
+ bool alphaCut = opacityMixMode != ${I.H.int(D.Um.ignore)} && vcolorExt.a < ${I.H.float(H.Q)};
584
+ vpos = getVertexInLocalOriginSpace();
585
+ localvpos = vpos - view[3].xyz;
586
+ vpos = subtractOrigin(vpos);
587
+ vNormalWorld = dpNormal(vvLocalNormal(normalModel()));
588
+ vpos = addVerticalOffset(vpos, localOrigin);
589
+ vec4 basePosition = transformPosition(proj, view, vpos);
590
+
591
+ forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
592
+ forwardLinearDepth();
593
+
594
+ forwardTextureCoordinates();
595
+
596
+ gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
597
+ ${(0,I.If)(V,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
598
+ `)),(0,o.RN)(z)){const{hasColorTexture:r,hasColorTextureTransform:i,receiveShadows:n}=e;t.include(_.kA,e),G.include(g.n,e),t.include(b.S,e),t.include(e.instancedDoublePrecision?M.G:M.Bz,e),G.include(a.HQ,e),t.include(F.z,e),(0,O.yu)(G,e),(0,T.Gc)(G),(0,_.a8)(G),(0,_.eU)(G),G.uniforms.add(B.uniforms.get("localOrigin"),B.uniforms.get("view"),new S.t("ambient",e=>e.ambient),new S.t("diffuse",e=>e.diffuse),new C.m("opacity",e=>e.opacity),new C.m("layerOpacity",e=>e.layerOpacity)),r&&G.uniforms.add(new N.N("tex",e=>e.texture)),t.include(E._Z,e),G.include(x.c,e),G.include(R.N),(0,T.O4)(G),G.main.add(I.H`
599
+ discardBySlice(vpos);
600
+ discardByTerrainDepth();
601
+ vec4 texColor = ${r?`texture(tex, ${i?"colorUV":"vuv0"})`:" vec4(1.0)"};
602
+ ${(0,I.If)(r,`${(0,I.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
603
+ vec3 viewDirection = normalize(vpos - cameraPosition);
604
+ applyPBRFactors();
605
+ float ssao = evaluateAmbientOcclusionInverse();
606
+ ssao *= getBakedOcclusion();
607
+
608
+ float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
609
+ vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
610
+ float shadow = ${n?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":k?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
611
+ vec3 matColor = max(ambient, diffuse);
612
+ ${e.hasVertexColors?I.H`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
613
+ float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, opacityMixMode);`:I.H`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
614
+ float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, opacityMixMode);`}
615
+
616
+ ${(0,I.If)(j,"albedo = mix(albedo, vec3(1), 0.9);")}
617
+ ${I.H`vec3 shadingNormal = normalize(vNormalWorld);
618
+ albedo *= 1.2;
619
+ vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
620
+ float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
621
+ float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0);
622
+ float treeRadialFalloff = vColor.r;
623
+ float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
624
+ additionalLight += backLightFactor * mainLightIntensity;`}
625
+ ${(0,I.If)($,`vec3 normalGround = ${k?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};`)}
626
+ ${$?I.H`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
627
+ ${(0,I.If)(j,I.H`mrr = applySnowToMRR(mrr, 1.0)`)}
628
+ vec4 emission = ${j||q?"vec4(0.0)":"getEmissions(albedo)"};
629
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:I.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
630
+ vec4 finalColor = vec4(shadedColor, opacity_);
631
+ outputColorHighlightOID(finalColor, vpos, albedo ${(0,I.If)(j,", 1.0")});`)}return t.include(v.E,e),t}const G=Object.freeze(Object.defineProperty({__proto__:null,build:B},Symbol.toStringTag,{value:"Module"}))},57917:(e,t,r)=>{r.d(t,{S:()=>o});var i=r(34275),n=r(20498);function o(e){if(e.length<i.y9)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,i.LW)(e)?(0,n.pX)().from(e):(0,i.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}},58029:(e,t,r)=>{r.d(t,{F:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"mat4",i.c.Bind,(i,n)=>i.setUniformMatrix4fv(e,t(n),r))}}},58614:(e,t,r)=>{r.d(t,{S:()=>s}),r(28421);var i=r(20304),n=r(31821),o=r(89192),a=r(49788);function s(e,t){!function(e,t,r){const i=e.fragment,s=t.alphaDiscardMode,l=s===o.sf.Blend;s!==o.sf.Mask&&s!==o.sf.MaskBlend||i.uniforms.add(r),i.code.add(n.H`
632
+ void discardOrAdjustAlpha(inout vec4 color) {
633
+ ${s===o.sf.Opaque?"color.a = 1.0;":`if (color.a < ${l?n.H.float(a.Q):"textureAlphaCutoff"}) {\n discard;\n } ${(0,n.If)(s===o.sf.Mask,"else { color.a = 1.0; }")}`}
634
+ }
635
+ `)}(e,t,new i.m("textureAlphaCutoff",e=>e.textureAlphaCutoff))}},59469:(e,t,r)=>{r.d(t,{A9:()=>i,_Z:()=>m});var i,n,o=r(99208),a=r(40710),s=r(33079),l=r(31821),c=r(15976),d=r(63761),u=(r(74810),r(69270)),h=r(65786);function m(e,t){const r=t.pbrMode,n=e.fragment;if(r!==i.Schematic&&r!==i.Disabled&&r!==i.Normal)return void n.code.add(l.H`void applyPBRFactors() {}`);if(r===i.Disabled)return void n.code.add(l.H`void applyPBRFactors() {}
636
+ float getBakedOcclusion() { return 1.0; }`);if(r===i.Schematic)return void n.code.add(l.H`vec3 mrr = vec3(0.0, 0.6, 0.2);
637
+ float occlusion = 1.0;
638
+ void applyPBRFactors() {}
639
+ float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:h,hasMetallicRoughnessTextureTransform:m,hasOcclusionTexture:p,hasOcclusionTextureTransform:f,bindType:v}=t;(h||p)&&e.include(o.r,t),n.code.add(l.H`vec3 mrr;
640
+ float occlusion;`),h&&n.uniforms.add(v===u.c.Pass?new d.N("texMetallicRoughness",e=>e.textureMetallicRoughness):new c.o("texMetallicRoughness",e=>e.textureMetallicRoughness)),p&&n.uniforms.add(v===u.c.Pass?new d.N("texOcclusion",e=>e.textureOcclusion):new c.o("texOcclusion",e=>e.textureOcclusion)),n.uniforms.add(v===u.c.Pass?new s.t("mrrFactors",e=>e.mrrFactors):new a.W("mrrFactors",e=>e.mrrFactors)),n.code.add(l.H`
641
+ ${(0,l.If)(h,l.H`void applyMetallicRoughness(vec2 uv) {
642
+ vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
643
+ mrr[0] *= metallicRoughness.b;
644
+ mrr[1] *= metallicRoughness.g;
645
+ }`)}
646
+
647
+ ${(0,l.If)(p,"void applyOcclusion(vec2 uv) { occlusion *= textureLookup(texOcclusion, uv).r; }")}
648
+
649
+ float getBakedOcclusion() {
650
+ return ${p?"occlusion":"1.0"};
651
+ }
652
+
653
+ void applyPBRFactors() {
654
+ mrr = mrrFactors;
655
+ occlusion = 1.0;
656
+
657
+ ${(0,l.If)(h,`applyMetallicRoughness(${m?"metallicRoughnessUV":"vuv0"});`)}
658
+ ${(0,l.If)(p,`applyOcclusion(${f?"occlusionUV":"vuv0"});`)}
659
+ }
660
+ `)}(n=i||(i={}))[n.Disabled=0]="Disabled",n[n.Normal=1]="Normal",n[n.Schematic=2]="Schematic",n[n.Water=3]="Water",n[n.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",n[n.Simplified=5]="Simplified",n[n.TerrainWithWater=6]="TerrainWithWater",n[n.COUNT=7]="COUNT",h.Y},59643:(e,t,r)=>{var i;r.d(t,{Y:()=>i}),function(e){e[e.NONE=0]="NONE",e[e.ColorAlpha=1]="ColorAlpha",e[e.FrontFace=2]="FrontFace",e[e.COUNT=3]="COUNT"}(i||(i={}))},59907:(e,t,r)=>{r.d(t,{Hk:()=>m,Pq:()=>h,SA:()=>g,Ut:()=>u,p1:()=>p,tb:()=>f,uO:()=>l,vx:()=>v}),r(38954);var i=r(51850),n=r(58083),o=r(13030),a=r(620),s=r(46540);function l(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e)a[r]=n[o[e]],r+=s;else for(let e=0;e<l;++e){const t=n[o[e]];for(let e=0;e<i;e++)a[r]=t,r+=s}}function c(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function d(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=3*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}}function u(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}}function h(e,t,r){const i=e.typedBuffer,n=e.typedBufferStride;t*=n;for(let e=0;e<r;++e)i[t]=0,i[t+1]=0,i[t+2]=0,i[t+3]=0,t+=n}function m(e,t,r,i,o=1){if(!t)return void d(e,r,i,o);const{data:a,indices:s}=e,l=r.typedBuffer,c=r.typedBufferStride,u=s.length,h=t[0],m=t[1],p=t[2],f=t[4],v=t[5],g=t[6],_=t[8],T=t[9],x=t[10],E=t[12],M=t[13],A=t[14];i*=c;let w=0,b=0,R=0;const O=(0,n.tZ)(t)?e=>{w=a[e]+E,b=a[e+1]+M,R=a[e+2]+A}:e=>{const t=a[e],r=a[e+1],i=a[e+2];w=h*t+f*r+_*i+E,b=m*t+v*r+T*i+M,R=p*t+g*r+x*i+A};if(1===o)for(let e=0;e<u;++e)O(3*s[e]),l[i]=w,l[i+1]=b,l[i+2]=R,i+=c;else for(let e=0;e<u;++e){O(3*s[e]);for(let e=0;e<o;++e)l[i]=w,l[i+1]=b,l[i+2]=R,i+=c}}function p(e,t,r,i,o=1){if(!t)return void d(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,h=s.length,m=l[0],p=l[1],f=l[2],v=l[4],g=l[5],_=l[6],T=l[8],x=l[9],E=l[10],M=!(0,n.ut)(l),A=1e-6,w=1-A;i*=u;let b=0,R=0,O=0;const S=(0,n.tZ)(l)?e=>{b=a[e],R=a[e+1],O=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];b=m*t+v*r+T*i,R=p*t+g*r+x*i,O=f*t+_*r+E*i};if(1===o)if(M)for(let e=0;e<h;++e){S(3*s[e]);const t=b*b+R*R+O*O;if(t<w&&t>A){const e=1/Math.sqrt(t);c[i]=b*e,c[i+1]=R*e,c[i+2]=O*e}else c[i]=b,c[i+1]=R,c[i+2]=O;i+=u}else for(let e=0;e<h;++e)S(3*s[e]),c[i]=b,c[i+1]=R,c[i+2]=O,i+=u;else for(let e=0;e<h;++e){if(S(3*s[e]),M){const e=b*b+R*R+O*O;if(e<w&&e>A){const t=1/Math.sqrt(e);b*=t,R*=t,O*=t}}for(let e=0;e<o;++e)c[i]=b,c[i+1]=R,c[i+2]=O,i+=u}}function f(e,t,r,i,n=1){const{data:o,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t!==o.length||4!==t)if(1!==n)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}}else{s[i]=o[0],s[i+1]=o[1],s[i+2]=o[2],s[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;const d=c*n;for(let r=1;r<d;++r)e[i]=a,i+=t}}function v(e,t,r,i,n=1){const o=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a}function g(e,t,r,i,n,a,l){let c={numItems:0,numVerticesPerItem:0};for(const d of r.fields.keys()){const r=e.get(d),u=r?.indices;if(r&&u)d===s.r.POSITION&&(c={numItems:1,numVerticesPerItem:u.length}),_(d,r,i,n,a,l);else if(d===s.r.OLIDCOLOR&&null!=t){const r=e.get(s.r.POSITION)?.indices;if(r){const e=r.length;v(t,a.getField(d,o.XP),e,l)}}}return c}function _(e,t,r,i,l,h){switch(e){case s.r.POSITION:{(0,a.vA)(3===t.size);const i=l.getField(e,o.xs);(0,a.vA)(!!i,`No buffer view for ${e}`),m(t,r,i,h);break}case s.r.NORMAL:{(0,a.vA)(3===t.size);const r=l.getField(e,o.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),p(t,i,r,h);break}case s.r.NORMALCOMPRESSED:case s.r.PROFILERIGHT:case s.r.PROFILEUP:{(0,a.vA)(2===t.size);const r=l.getField(e,o.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),c(t,r,h);break}case s.r.UV0:{(0,a.vA)(2===t.size);const r=l.getField(e,o.ZD)??l.getField(e,o.gH);(0,a.vA)(!!r,`No buffer view for ${e}`),c(t,r,h);break}case s.r.UVI:{(0,a.vA)(2===t.size);const r=l.getField(e,o.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),c(t,r,h);break}case s.r.COLOR:case s.r.SYMBOLCOLOR:{const r=l.getField(e,o.XP);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(3===t.size||4===t.size),f(t,t.size,r,h);break}case s.r.COLORFEATUREATTRIBUTE:case s.r.OPACITYFEATUREATTRIBUTE:case s.r.SIZEFEATUREATTRIBUTE:{const r=l.getField(e,o.Y$)??l.getField(e,o.Y$);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(1===t.size),function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length,l=i[0];r*=a;for(let e=0;e<s;++e)o[r]=l,r+=a}(t,r,h);break}case s.r.TANGENT:{(0,a.vA)(4===t.size);const i=l.getField(e,o.Eq);(0,a.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void u(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,h=s.length,m=l[0],p=l[1],f=l[2],v=l[4],g=l[5],_=l[6],T=l[8],x=l[9],E=l[10],M=!(0,n.ut)(l),A=1e-6,w=1-A;if(i*=d,1===o)for(let e=0;e<h;++e){const t=4*s[e],r=a[t],n=a[t+1],o=a[t+2],l=a[t+3];let u=m*r+v*n+T*o,h=p*r+g*n+x*o,b=f*r+_*n+E*o;if(M){const e=u*u+h*h+b*b;if(e<w&&e>A){const t=1/Math.sqrt(e);u*=t,h*=t,b*=t}}c[i]=u,c[i+1]=h,c[i+2]=b,c[i+3]=l,i+=d}else for(let e=0;e<h;++e){const t=4*s[e],r=a[t],n=a[t+1],l=a[t+2],u=a[t+3];let h=m*r+v*n+T*l,b=p*r+g*n+x*l,R=f*r+_*n+E*l;if(M){const e=h*h+b*b+R*R;if(e<w&&e>A){const t=1/Math.sqrt(e);h*=t,b*=t,R*=t}}for(let e=0;e<o;++e)c[i]=h,c[i+1]=b,c[i+2]=R,c[i+3]=u,i+=d}}(t,r,i,h);break}case s.r.PROFILEVERTEXANDNORMAL:{(0,a.vA)(4===t.size);const r=l.getField(e,o.jz)??l.getField(e,o.Eq);(0,a.vA)(!!r,`No buffer view for ${e}`),u(t,r,h);break}case s.r.PROFILEAUXDATA:{(0,a.vA)(3===t.size);const r=l.getField(e,o.EC)??l.getField(e,o.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),d(t,r,h);break}}}(0,i.vt)()},60517:(e,t,r)=>{r.d(t,{z:()=>d});var i=r(49255),n=r(22911),o=r(42593),a=r(63365),s=r(31821),l=r(59643),c=r(49788);function d(e,t){e.include(o.Q,t),e.include(n.NL,t),e.fragment.include(a.a);const{output:r,oitPass:d,discardInvisibleFragments:u,snowCover:h}=t,m=r===i.V.ObjectAndLayerIdColor,p=(0,i.LG)(r),f=(0,i.RN)(r)&&d===l.Y.ColorAlpha,v=(0,i.RN)(r)&&d!==l.Y.ColorAlpha;let g=0;(v||p||f)&&e.outputs.add("fragColor","vec4",g++),p&&e.outputs.add("fragEmission","vec4",g++),f&&e.outputs.add("fragAlpha","float",g++),e.fragment.code.add(s.H`
661
+ void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition, vec3 emissiveBaseColor ${(0,s.If)(h,", float snow")}) {
662
+ ${(0,s.If)(m,"finalColor.a = 1.0;")}
663
+
664
+ ${(0,s.If)(u,`if (finalColor.a < ${s.H.float(c.Q)}) { discard; }`)}
665
+
666
+ finalColor = applySlice(finalColor, vWorldPosition);
667
+ ${(0,s.If)(f,s.H`fragColor = premultiplyAlpha(finalColor);
668
+ fragAlpha = finalColor.a;`)}
669
+ ${(0,s.If)(v,"fragColor = finalColor;")}
670
+ ${(0,s.If)(p,`fragEmission = ${(0,s.If)(h,"mix(finalColor.a * getEmissions(emissiveBaseColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveBaseColor);")}`)}
671
+ calculateOcclusionAndOutputHighlight();
672
+ ${(0,s.If)(m,"outputObjectAndLayerIdColor();")}
673
+ }
674
+ `)}},60864:(e,t,r)=>{r.d(t,{B:()=>x});var i=r(77690),n=r(29242),o=r(9093),a=r(38954),s=r(51850),l=r(49255),c=r(26425),d=r(20693),u=r(23205),h=r(31821),m=r(35644),p=r(40095),f=r(46540);function v(e,t){const r=e.length;for(let i=0;i<r;++i)_[0]=e[i],t[i]=_[0];return t}function g(e,t){const r=e.length;for(let i=0;i<r;++i)_[0]=e[i],_[1]=e[i]-_[0],t[i]=_[1];return t}const _=new Float32Array(2);r(65786).Y;const T=(0,n.vt)();function x(e,t){const{hasModelTransformation:r,instancedDoublePrecision:n,instanced:s,output:_,hasVertexTangents:x}=t;r&&(e.vertex.uniforms.add(new p.X("model",e=>e.modelTransformation??o.zK)),e.vertex.uniforms.add(new m.k("normalLocalOriginFromModel",e=>((0,i.Ge)(T,e.modelTransformation??o.zK),T)))),s&&n&&(e.attributes.add(f.r.INSTANCEMODELORIGINHI,"vec3"),e.attributes.add(f.r.INSTANCEMODELORIGINLO,"vec3"),e.attributes.add(f.r.INSTANCEMODEL,"mat3"),e.attributes.add(f.r.INSTANCEMODELNORMAL,"mat3"));const M=e.vertex;n&&(M.include(c.u,t),M.uniforms.add(new u.d("viewOriginHi",e=>v((0,a.i)(E,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),E)),new u.d("viewOriginLo",e=>g((0,a.i)(E,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),E)))),M.code.add(h.H`
675
+ vec3 getVertexInLocalOriginSpace() {
676
+ return ${r?n?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":n?"instanceModel * localPosition().xyz":"localPosition().xyz"};
677
+ }
678
+
679
+ vec3 subtractOrigin(vec3 _pos) {
680
+ ${n?h.H`
681
+ // Issue: (should be resolved now with invariant position) https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280
682
+ vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -instanceModelOriginHi, -instanceModelOriginLo);
683
+ return _pos - originDelta;`:"return vpos;"}
684
+ }
685
+ `),M.code.add(h.H`
686
+ vec3 dpNormal(vec4 _normal) {
687
+ return normalize(${r?n?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":n?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
688
+ }
689
+ `),_===l.V.Normal&&((0,d.S7)(M),M.code.add(h.H`
690
+ vec3 dpNormalView(vec4 _normal) {
691
+ return normalize((viewNormal * ${r?n?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":n?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz);
692
+ }
693
+ `)),x&&M.code.add(h.H`
694
+ vec4 dpTransformVertexTangent(vec4 _tangent) {
695
+ ${r?n?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":n?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
696
+ }`)}const E=(0,s.vt)()},62258:(e,t,r)=>{var i,n;(n=i||(i={}))[n.MIN=0]="MIN",n[n.MINMAX=1]="MINMAX",n[n.ALL=2]="ALL"},62298:(e,t,r)=>{r(63907)},62602:(e,t,r)=>{r.d(t,{W:()=>i,r:()=>s});var i,n,o=r(21818),a=r(31821);function s(e,t){const r=e.fragment;switch(r.code.add(a.H`struct ShadingNormalParameters {
697
+ vec3 normalView;
698
+ vec3 viewDirection;
699
+ } shadingParams;`),t.doubleSidedMode){case i.None:r.code.add(a.H`vec3 shadingNormal(ShadingNormalParameters params) {
700
+ return normalize(params.normalView);
701
+ }`);break;case i.View:r.code.add(a.H`vec3 shadingNormal(ShadingNormalParameters params) {
702
+ return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView);
703
+ }`);break;case i.WindingOrder:r.code.add(a.H`vec3 shadingNormal(ShadingNormalParameters params) {
704
+ return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView);
705
+ }`);break;default:(0,o.Xb)(t.doubleSidedMode);case i.COUNT:}}(n=i||(i={}))[n.None=0]="None",n[n.View=1]="View",n[n.WindingOrder=2]="WindingOrder",n[n.COUNT=3]="COUNT"},63365:(e,t,r)=>{r.d(t,{a:()=>n});var i=r(31821);function n(e){e.code.add(i.H`vec4 premultiplyAlpha(vec4 v) {
706
+ return vec4(v.rgb * v.a, v.a);
707
+ }
708
+ vec3 rgb2hsv(vec3 c) {
709
+ vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
710
+ vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
711
+ vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
712
+ float d = q.x - min(q.w, q.y);
713
+ float e = 1.0e-10;
714
+ return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);
715
+ }
716
+ vec3 hsv2rgb(vec3 c) {
717
+ vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
718
+ vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
719
+ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
720
+ }
721
+ float rgb2v(vec3 c) {
722
+ return max(c.x, max(c.y, c.z));
723
+ }`)}},63761:(e,t,r)=>{r.d(t,{N:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t){super(e,"sampler2D",i.c.Pass,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},65786:(e,t,r)=>{r.d(t,{Y:()=>i});const i=class{};new i},65806:(e,t,r)=>{r.d(t,{g:()=>a});var i=r(51850),n=r(98988),o=r(9762);function a(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r)){s[0]=e.x,s[1]=e.y;const n=e.z;return s[2]=n??i??0,(0,o.projectBuffer)(s,e.spatialReference,0,t,r,0)}const a=(0,n.tryProjectWithZConversion)(e,r);return!!a&&(t[0]=a?.x,t[1]=a?.y,t[2]=a?.z??i??0,!0)}const s=(0,i.vt)()},66104:(e,t,r)=>{var i,n;r.d(t,{k5:()=>i}),r(34727),(n=i||(i={}))[n.Multiply=1]="Multiply",n[n.Ignore=2]="Ignore",n[n.Replace=3]="Replace",n[n.Tint=4]="Tint"},67171:(e,t,r)=>{r.d(t,{R:()=>a,e:()=>s});var i=r(63907),n=r(6625),o=r(42293);class a{constructor(e=0,t=e){this.width=e,this.height=t,this.type=n.d.TextureDescriptor,this.target=i.Ap.TEXTURE_2D,this.pixelFormat=i.Ab.RGBA,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=i.Cj.LINEAR,this.wrapMode=i.pF.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function s(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,o.IB)(e.internalFormat))*(e.target===i.Ap.TEXTURE_CUBE_MAP?6:1))}},68259:(e,t,r)=>{r.d(t,{t:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"vec2",i.c.Draw,(i,n,o,a)=>i.setUniform2fv(e,t(n,o,a),r))}}},69052:(e,t,r)=>{r.d(t,{hr:()=>n,ie:()=>l,uC:()=>s});var i=r(34727);class n{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return o(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+a(this.range,e-t,r)}minimalMonotonic(e,t,r){return o(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function o(e,t,r,i,n=0,o=!1){return(i-=n)<t?i+=a(e,t-i):i>r&&(i-=a(e,i-r)),o&&i===r&&(i=t),i+n}function a(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const s=new n(0,2*Math.PI),l=(new n(-Math.PI,Math.PI),new n(0,360))},69270:(e,t,r)=>{var i;r.d(t,{c:()=>i}),function(e){e[e.Bind=0]="Bind",e[e.Pass=1]="Pass",e[e.Draw=2]="Draw"}(i||(i={}))},71955:(e,t,r)=>{r.d(t,{K:()=>d});var i=r(43519),n=r(31821),o=r(69270),a=r(74333);class s extends a.n{constructor(e,t){super(e,"int",o.c.Pass,(r,i,n)=>r.setUniform1i(e,t(i,n)))}}var l=r(46540),c=r(43616);function d(e,t){e.varyings.add("colorMixMode","int"),e.varyings.add("opacityMixMode","int"),e.vertex.uniforms.add(new s("symbolColorMixMode",e=>c.Um[e.colorMixMode])),t.hasSymbolColors?(e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.attributes.add(l.r.SYMBOLCOLOR,"vec4"),e.vertex.code.add(n.H`
724
+ MaskedColor applySymbolColor(MaskedColor color) {
725
+ return multiplyMaskedColors(color, createMaskedFromUInt8NaNColor(${l.r.SYMBOLCOLOR}));
726
+ }
727
+ `)):e.vertex.code.add(n.H`MaskedColor applySymbolColor(MaskedColor color) {
728
+ return color;
729
+ }`),e.vertex.code.add(n.H`
730
+ void forwardColorMixMode(bvec4 mask) {
731
+ colorMixMode = mask.r ? ${n.H.int(c.Um.ignore)} : symbolColorMixMode;
732
+ opacityMixMode = mask.a ? ${n.H.int(c.Um.ignore)} : symbolColorMixMode;
733
+ }
734
+ `)}},71988:(e,t,r)=>{r.d(t,{E:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"vec4",i.c.Pass,(i,n,o)=>i.setUniform4fv(e,t(n,o),r))}}},72824:(e,t,r)=>{r.d(t,{Mh:()=>u,Zo:()=>h,gy:()=>m});var i=r(21818),n=r(29242),o=r(91829),a=r(96336),s=r(33752),l=r(31821),c=r(98353),d=r(35644);function u(e,t){switch(t.normalType){case a.W.Attribute:case a.W.Compressed:e.include(a.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new c.h("transformNormalGlobalFromModel",e=>e.transformNormalGlobalFromModel),new d.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)),e.vertex.code.add(l.H`void forwardNormal() {
735
+ vNormalWorld = transformNormalGlobalFromModel * normalModel();
736
+ vNormalView = transformNormalViewFromGlobal * vNormalWorld;
737
+ }`);break;case a.W.ScreenDerivative:e.vertex.code.add(l.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case a.W.COUNT:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,n.vt)()}}class m extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,n.vt)(),this.toMapSpace=(0,o.vt)()}}},74333:(e,t,r)=>{r.d(t,{n:()=>n}),r(44208);var i=r(69270);class n{constructor(e,t,r,n,o=null){if(this.name=e,this.type=t,this.arraySize=o,this.bind={[i.c.Bind]:null,[i.c.Pass]:null,[i.c.Draw]:null},n)switch(r){case void 0:break;case i.c.Bind:this.bind[i.c.Bind]=n;break;case i.c.Pass:this.bind[i.c.Pass]=n;break;case i.c.Draw:this.bind[i.c.Draw]=n}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>o,SY:()=>l,mb:()=>a});var i=r(38954),n=r(51850);function o({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.q)(s,n.uY))&&null==l&&(null==o||1===o)&&(null==r||1===r)}const a=(0,n.CN)(1,1,.5),s=(0,n.CN)(0,.6,.2),l=(0,n.CN)(0,1,.2)},75039:(e,t,r)=>{var i;r.d(t,{d:()=>i}),function(e){e[e.Mesh=0]="Mesh",e[e.Point=1]="Point",e[e.Line=2]="Line"}(i||(i={}))},76591:(e,t,r)=>{r.d(t,{HQ:()=>c,rA:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(40710),l=(r(33079),r(31821));function c(e,t){!function(e,t,...r){h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(l.H`void discardBySlice(vec3 pos) { }
738
+ vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}(e,t,new s.W("slicePlaneOrigin",(e,r)=>v(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>g(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>g(t,e,r,r.slicePlane?.basis2)))}function d(e,t){h(e,t,new s.W("slicePlaneOrigin",(e,r)=>v(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>g(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>g(t,e,r,r.slicePlane?.basis2)))}r(65786).Y;const u=l.H`struct SliceFactors {
739
+ float front;
740
+ float side0;
741
+ float side1;
742
+ float side2;
743
+ float side3;
744
+ };
745
+ SliceFactors calculateSliceFactors(vec3 pos) {
746
+ vec3 rel = pos - slicePlaneOrigin;
747
+ vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);
748
+ float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);
749
+ float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);
750
+ float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);
751
+ float basis1Dot = dot(slicePlaneBasis1, rel);
752
+ float basis2Dot = dot(slicePlaneBasis2, rel);
753
+ return SliceFactors(
754
+ dot(slicePlaneNormal, pos) + slicePlaneW,
755
+ -basis1Dot - basis1Len2,
756
+ basis1Dot - basis1Len2,
757
+ -basis2Dot - basis2Len2,
758
+ basis2Dot - basis2Len2
759
+ );
760
+ }
761
+ bool sliceByFactors(SliceFactors factors) {
762
+ return factors.front < 0.0
763
+ && factors.side0 < 0.0
764
+ && factors.side1 < 0.0
765
+ && factors.side2 < 0.0
766
+ && factors.side3 < 0.0;
767
+ }
768
+ bool sliceEnabled() {
769
+ return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
770
+ }
771
+ bool sliceByPlane(vec3 pos) {
772
+ return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
773
+ }
774
+ bool rejectBySlice(vec3 pos) {
775
+ return sliceByPlane(pos);
776
+ }`;function h(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(u)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function m(e,t,r){return e.instancedDoublePrecision?(0,o.i)(_,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function p(e,t){return null!=e?(0,o.d)(T,t.origin,e):t.origin}function f(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,i.Tl)(E,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function v(e,t,r){if(null==r.slicePlane)return a.uY;const i=m(e,t,r),n=p(i,r.slicePlane),s=f(e,i,r);return null!=s?(0,o.t)(T,n,s):n}function g(e,t,r,i){if(null==i||null==r.slicePlane)return a.uY;const n=m(e,t,r),s=p(n,r.slicePlane),l=f(e,n,r);return null!=l?((0,o.f)(x,i,s),(0,o.t)(T,s,l),(0,o.t)(x,x,l),(0,o.d)(x,x,T)):i}const _=(0,a.vt)(),T=(0,a.vt)(),x=(0,a.vt)(),E=(0,n.vt)()},76597:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(46686),n=r(31821);function o(e){(0,i.i$)(e),e.vertex.code.add(n.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
777
+ vec4 eye = view * vec4(pos, 1.0);
778
+ depth = calculateLinearDepth(nearFar,eye.z);
779
+ return proj * eye;
780
+ }`),e.vertex.code.add(n.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
781
+ return proj * (view * vec4(pos, 1.0));
782
+ }`)}},77108:(e,t,r)=>{r.d(t,{E:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"vec2",i.c.Bind,(i,n)=>i.setUniform2fv(e,t(n),r))}}},77194:(e,t,r)=>{r.d(t,{MD:()=>l,cJ:()=>s,hs:()=>c,m0:()=>a});var i=r(34727),n=(r(17352),r(97937));function o(e,t,r){const i=r.parameters;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d}function a(e,t){return(0,i.Cc)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}function s(e,t,r,i){i.scale=function(e,t,r){const i=o(e,t,r);return i.minScaleFactor=0,a(1,i)}(e,t,r),i.factor=0,i.minScaleFactor=r.minScaleFactor}function l(e,t,r=[0,0]){const i=Math.min(Math.max(t.scale,t.minScaleFactor),1);return r[0]=e[0]*i,r[1]=e[1]*i,r}function c(e,t,r,i){return a(e,o(t,r,i))}r(24151),(0,i.kU)(10),(0,i.kU)(12),(0,i.kU)(70),(0,i.kU)(40);const d={scale:0,factor:0,minScaleFactor:0};(0,n.c)()},77695:(e,t,r)=>{r.d(t,{W:()=>f});var i=r(29242),n=r(48163),o=r(53466),a=r(99208),s=r(62602),l=r(47286),c=r(31821),d=r(35644),u=r(15976),h=r(63761),m=r(46540),p=r(69270);function f(e,t){const r=e.fragment,{hasVertexTangents:f,doubleSidedMode:v,hasNormalTexture:g,textureCoordinateType:_,bindType:T,hasNormalTextureTransform:x}=t;f?(e.attributes.add(m.r.TANGENT,"vec4"),e.varyings.add("vTangent","vec4"),v===s.W.WindingOrder?r.code.add(c.H`mat3 computeTangentSpace(vec3 normal) {
783
+ float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
784
+ vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
785
+ vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
786
+ return mat3(tangent, bitangent, normal);
787
+ }`):r.code.add(c.H`mat3 computeTangentSpace(vec3 normal) {
788
+ float tangentHeadedness = vTangent.w;
789
+ vec3 tangent = normalize(vTangent.xyz);
790
+ vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
791
+ return mat3(tangent, bitangent, normal);
792
+ }`)):r.code.add(c.H`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {
793
+ vec3 Q1 = dFdx(pos);
794
+ vec3 Q2 = dFdy(pos);
795
+ vec2 stx = dFdx(st);
796
+ vec2 sty = dFdy(st);
797
+ float det = stx.t * sty.s - sty.t * stx.s;
798
+ vec3 T = stx.t * Q2 - sty.t * Q1;
799
+ T = T - normal * dot(normal, T);
800
+ T *= inversesqrt(max(dot(T,T), 1.e-10));
801
+ vec3 B = sign(det) * cross(normal, T);
802
+ return mat3(T, B, normal);
803
+ }`),g&&_!==o.I.None&&(e.include(a.r,t),r.uniforms.add(T===p.c.Pass?new h.N("normalTexture",e=>e.textureNormal):new u.o("normalTexture",e=>e.textureNormal)),x&&(r.uniforms.add(new l.G("scale",e=>e.scale??n.Un)),r.uniforms.add(new d.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK))),r.code.add(c.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
804
+ vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),x&&r.code.add(c.H`mat3 normalRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0,
805
+ normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
806
+ 0.0, 0.0, 0.0 );
807
+ rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(c.H`return tangentSpace * rawNormal;
808
+ }`))}},78662:(e,t,r)=>{r.d(t,{Gd:()=>u,VC:()=>h}),r(44208);var i,n,o,a=r(34727),s=(r(77690),r(29242),r(58083),r(9093)),l=r(38954),c=r(51850),d=(r(87317),r(91829),r(31756),r(26857),r(16943),r(65786));(o=i||(i={}))[o.Undefined=0]="Undefined",o[o.DefinedSize=1]="DefinedSize",o[o.DefinedScale=2]="DefinedScale",function(e){e[e.Undefined=0]="Undefined",e[e.DefinedAngle=1]="DefinedAngle"}(n||(n={}));class u extends d.Y{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}}function h(e,t,r){if(!t.vvSize)return(0,l.i)(e,1,1,1),e;if(Number.isNaN(r[0]))return(0,l.c)(e,t.vvSize.fallback);for(let i=0;i<3;++i){const n=t.vvSize.offset[i]+r[0]*t.vvSize.factor[i];e[i]=(0,a.qE)(n,t.vvSize.minSize[i],t.vvSize.maxSize[i])}return e}(0,s.vt)(),(0,c.vt)(),(0,s.vt)()},82048:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(31821),n=r(46540);function o(e,t=!0){e.attributes.add(n.r.POSITION,"vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(i.H`
809
+ gl_Position = vec4(position, 0.0, 1.0);
810
+ ${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
811
+ `)}},82919:(e,t,r)=>{r.d(t,{FB:()=>u,J7:()=>h,DV:()=>x,C:()=>_,vt:()=>v,Qy:()=>g,ui:()=>T,ST:()=>A,bU:()=>w,pw:()=>M,m7:()=>E,c8:()=>R});var i=r(4341),n=r(58083),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);function d(e){return e?{ray:(0,c.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,c.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>d());var u,h,m,p=r(27921),f=r(32114);function v(e){return e?[(0,p.vt)(e[0]),(0,p.vt)(e[1]),(0,p.vt)(e[2]),(0,p.vt)(e[3]),(0,p.vt)(e[4]),(0,p.vt)(e[5])]:[(0,p.vt)(),(0,p.vt)(),(0,p.vt)(),(0,p.vt)(),(0,p.vt)(),(0,p.vt)()]}function g(){return[(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)()]}function _(e,t){for(let r=0;r<O;r++)(0,p.C)(e[r],t[r]);return e}function T(e,t,r,i=I){const a=(0,n.lw)(f.Rc.get(),t,e);(0,n.B8)(a,a);for(let e=0;e<S;++e){const t=(0,s.t)(f.Km.get(),y[e],a);(0,o.i)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}x(r,i)}function x(e,t){(0,p.Cr)(t[h.FAR_BOTTOM_LEFT],t[h.NEAR_BOTTOM_LEFT],t[h.NEAR_TOP_LEFT],e[u.LEFT]),(0,p.Cr)(t[h.NEAR_BOTTOM_RIGHT],t[h.FAR_BOTTOM_RIGHT],t[h.FAR_TOP_RIGHT],e[u.RIGHT]),(0,p.Cr)(t[h.FAR_BOTTOM_LEFT],t[h.FAR_BOTTOM_RIGHT],t[h.NEAR_BOTTOM_RIGHT],e[u.BOTTOM]),(0,p.Cr)(t[h.NEAR_TOP_LEFT],t[h.NEAR_TOP_RIGHT],t[h.FAR_TOP_RIGHT],e[u.TOP]),(0,p.Cr)(t[h.NEAR_BOTTOM_LEFT],t[h.NEAR_BOTTOM_RIGHT],t[h.NEAR_TOP_RIGHT],e[u.NEAR]),(0,p.Cr)(t[h.FAR_BOTTOM_RIGHT],t[h.FAR_BOTTOM_LEFT],t[h.FAR_TOP_LEFT],e[u.FAR])}function E(e,t){for(let r=0;r<O;r++){const i=e[r];if(i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]>=t[3])return!1}return!0}function M(e,t){return b(e,function(e,t=d()){return(0,c.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,C.get()))}function A(e,t,r){return b(e,function(e,t,r=d()){const i=(0,o.l)(e.vector);return(0,c.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,C.get()))}function w(e,t){for(let r=0;r<O;r++)if((0,p.mN)(e[r],t)>0)return!1;return!0}function b(e,t){for(let r=0;r<O;r++)if(!(0,p.$Q)(e[r],t))return!1;return!0}(m=u||(u={}))[m.LEFT=0]="LEFT",m[m.RIGHT=1]="RIGHT",m[m.BOTTOM=2]="BOTTOM",m[m.TOP=3]="TOP",m[m.NEAR=4]="NEAR",m[m.FAR=5]="FAR",function(e){e[e.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",e[e.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",e[e.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",e[e.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",e[e.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",e[e.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",e[e.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",e[e.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(h||(h={}));const R={bottom:[h.FAR_BOTTOM_RIGHT,h.NEAR_BOTTOM_RIGHT,h.NEAR_BOTTOM_LEFT,h.FAR_BOTTOM_LEFT],near:[h.NEAR_BOTTOM_LEFT,h.NEAR_BOTTOM_RIGHT,h.NEAR_TOP_RIGHT,h.NEAR_TOP_LEFT],far:[h.FAR_BOTTOM_RIGHT,h.FAR_BOTTOM_LEFT,h.FAR_TOP_LEFT,h.FAR_TOP_RIGHT],right:[h.NEAR_BOTTOM_RIGHT,h.FAR_BOTTOM_RIGHT,h.FAR_TOP_RIGHT,h.NEAR_TOP_RIGHT],left:[h.FAR_BOTTOM_LEFT,h.NEAR_BOTTOM_LEFT,h.NEAR_TOP_LEFT,h.FAR_TOP_LEFT],top:[h.FAR_TOP_LEFT,h.NEAR_TOP_LEFT,h.NEAR_TOP_RIGHT,h.FAR_TOP_RIGHT]},O=6,S=8,y=[(0,l.fA)(-1,-1,-1,1),(0,l.fA)(1,-1,-1,1),(0,l.fA)(1,1,-1,1),(0,l.fA)(-1,1,-1,1),(0,l.fA)(-1,-1,1,1),(0,l.fA)(1,-1,1,1),(0,l.fA)(1,1,1,1),(0,l.fA)(-1,1,1,1)],C=new i.I(d),I=g()},87170:(e,t,r)=>{r.d(t,{V:()=>R});var i=r(24326),n=r(9093),o=r(38954),a=r(97146),s=r(57917),l=r(29920),c=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,o.d)(m,t,e),(0,o.d)(p,r,e),.5*(0,o.l)((0,o.h)(m,m,p))}r(32114),new d.I(u.vt),new d.I(()=>{return e?{p0:(0,c.o8)(e.p0),p1:(0,c.o8)(e.p1),p2:(0,c.o8)(e.p2)}:{p0:(0,c.vt)(),p1:(0,c.vt)(),p2:(0,c.vt)()};var e});const m=(0,c.vt)(),p=(0,c.vt)(),f=(0,c.vt)(),v=(0,c.vt)(),g=(0,c.vt)(),_=(0,c.vt)();var T=r(75039),x=r(89192);class E{constructor(){this.uid=(0,i.c)()}}class M extends E{constructor(e){super(),this.highlightName=e,this.channel=x.Mg.Highlight}}var A=r(620),w=r(46540),b=r(94656);class R{constructor(e,t,r=null,n=T.d.Mesh,o=null,s=-1){this.material=e,this.mapPositions=r,this.type=n,this.objectAndLayerIdColor=o,this.edgeIndicesLength=s,this.highlights=new Set,this._highlightOptionsCounts=new Map,this.id=(0,i.c)(),this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,a.Dg)(r.indices)}),e===w.r.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new R(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,s.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,b.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===T.d.Mesh?this._computeAttachmentOriginTriangles(e):this.type===T.d.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.t)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.i)(t,0,0,0),(0,o.i)(_,0,0,0);let a=0,s=0;for(let e=0;e<n.length-2;e+=3){const l=n[e]*r,c=n[e+1]*r,d=n[e+2]*r;(0,o.i)(f,i[l],i[l+1],i[l+2]),(0,o.i)(v,i[c],i[c+1],i[c+2]),(0,o.i)(g,i[d],i[d+1],i[d+2]);const u=h(f,v,g);u?((0,o.f)(f,f,v),(0,o.f)(f,f,g),(0,o.g)(f,f,1/3*u),(0,o.f)(t,t,f),a+=u):((0,o.f)(_,_,f),(0,o.f)(_,_,v),(0,o.f)(_,_,g),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.g)(t,t,1/a),0):0===s||((0,o.g)(t,_,1/s),0)))}(this.attributes.get(w.r.POSITION),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(w.r.POSITION);return function(e,t,r){if(!e)return!1;(0,o.i)(r,0,0,0),(0,o.i)(_,0,0,0);let i=0,n=0;const{size:a,data:s,indices:l}=e,c=l.length-1,d=c+(t?2:0);for(let e=0;e<d;e+=2){const t=e<c?e+1:0,d=l[e<c?e:c]*a,u=l[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],v[0]=s[u],v[1]=s[u+1],v[2]=s[u+2],(0,o.g)(f,(0,o.f)(f,f,v),.5);const h=(0,o.F)(f,v);h>0?((0,o.f)(r,r,(0,o.g)(f,f,h)),i+=h):0===i&&((0,o.f)(_,_,f),n++)}return 0!==i?((0,o.g)(r,r,1/i),!0):0!==n&&((0,o.g)(r,_,1/n),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.i)(t,0,0,0);let a=-1,s=0;for(let e=0;e<n.length;e++){const o=n[e]*r;a!==o&&(t[0]+=i[o],t[1]+=i[o+1],t[2]+=i[o+2],s++),a=o}return s>1&&(0,o.g)(t,t,1/s),s>0}(this.attributes.get(w.r.POSITION),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(w.r.POSITION);if(!e||0===e.indices.length)return null;const t=this.type===T.d.Mesh?3:1;(0,A.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,a.tM)(e.indices.length/t);return new l.j(r,t,e)}get transformation(){return this._transformation??n.zK}set transformation(e){this._transformation=e&&e!==n.zK?(0,n.o8)(e):null}get highlightNames(){return this._highlightOptionsCounts}get hasHighlights(){return this._highlightOptionsCounts.size>0}foreachHighlightOptions(e){this._highlightOptionsCounts.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new M(e);return this.addHighlight(t)}addHighlight(e){this.highlights.add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts.get(t)??0)+1;return this._highlightOptionsCounts.set(t,r),e}removeHighlight(e){if(this.highlights.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts.get(t)??0;r<=1?this._highlightOptionsCounts.delete(t):this._highlightOptionsCounts.set(t,r-1)}}}},88076:(e,t,r)=>{r.d(t,{$U:()=>ve,fs:()=>_e,ty:()=>Te});var i=r(38954),n=r(51850),o=r(67222),a=r(24151),s=r(1843),l=r(49255),c=r(96336),d=r(22911),u=r(62602),h=r(59469),m=r(16943),p=r(89192),f=r(25634),v=r(11725),g=r(33524),_=r(70328),T=r(75039),x=r(620),E=r(46540);class M{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const A=(0,_.vt)();function w(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(B,n,r),l=(e,t,r)=>{a(e,r,t)},c=new M(!1,t.options.normalRequired);if(e.boundingInfo){(0,x.vA)(e.type===T.d.Mesh);const i=t.tolerance;R(e.boundingInfo,r,s,i,o,c,l)}else{const t=e.attributes.get(E.r.POSITION),n=t.indices;!function(e,t,r,n,o,a,s,l,c,d){const u=t,h=G,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),v=m>=p?m>=f?0:2:p>=f?1:2,g=v,_=u[g]<0?2:1,T=(v+_)%3,x=(v+(3-_))%3,E=u[T]/u[g],M=u[x]/u[g],A=1/u[g],w=y,b=C,R=I,{normalRequired:O}=c;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.i)(h[0],a[n+0],a[n+1],a[n+2]);const c=s*o[r+1];(0,i.i)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*o[r+2];(0,i.i)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.c)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(w,h[0],e),(0,i.a)(b,h[1],e),(0,i.a)(R,h[2],e);const m=w[T]-E*w[g],p=w[x]-M*w[g],f=b[T]-E*b[g],v=b[x]-M*b[g],_=R[T]-E*R[g],S=R[x]-M*R[g],y=_*v-S*f,C=m*S-p*_,I=f*p-v*m;if((y<0||C<0||I<0)&&(y>0||C>0||I>0))continue;const N=y+C+I;if(0===N)continue;const D=y*(A*w[g])+C*(A*b[g])+I*(A*R[g]);if(D*Math.sign(N)<0)continue;const F=D/N;F>=0&&d(F,t,O?P(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,c,l)}}const b=(0,n.vt)();function R(e,t,r,n,o,a,s){if(null==e)return;const l=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,b);if((0,_.Ne)(A,e.bbMin),(0,_.vI)(A,e.bbMax),null!=o&&o.applyToAabb(A),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(A,t,l,n)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>L){const i=e.getChildren();if(void 0!==i){for(const e of i)R(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,l,c,d){const u=e[0],h=e[1],m=e[2],p=t[0],f=t[1],v=t[2],{normalRequired:g}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let c=o[i],_=o[i+1],T=o[i+2];const x=a*n[r+1];let E=o[x],M=o[x+1],A=o[x+2];const w=a*n[r+2];let b=o[w],R=o[w+1],S=o[w+2];null!=l&&([c,_,T]=l.applyToVertex(c,_,T,e),[E,M,A]=l.applyToVertex(E,M,A,e),[b,R,S]=l.applyToVertex(b,R,S,e));const y=E-c,C=M-_,I=A-T,P=b-c,D=R-_,F=S-T,L=f*F-D*v,B=v*P-F*p,G=p*D-P*f,U=y*L+C*B+I*G;if(Math.abs(U)<=H)continue;const z=u-c,V=h-_,W=m-T,j=z*L+V*B+W*G;if(U>0){if(j<0||j>U)continue}else if(j>0||j<U)continue;const k=V*I-C*W,q=W*y-I*z,$=z*C-y*V,Y=p*k+f*q+v*$;if(U>0){if(Y<0||j+Y>U)continue}else if(Y>0||j+Y<U)continue;const Z=(P*k+D*q+F*$)/U;Z>=0&&d(Z,t,g?N(y,C,I,P,D,F,O):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,o,a,s)}}const O=(0,n.vt)();function S(e,t,r,i,n,o,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,p=o*t,f=n[p],v=n[p+1],g=n[p+2],_=o*r,T=o*i,x=n[_]-f,E=n[_+1]-v,M=n[_+2]-g,A=n[T]-f,w=n[T+1]-v,b=n[T+2]-g,R=h*b-w*m,S=m*A-b*u,y=u*w-A*h,C=x*R+E*S+M*y;if(Math.abs(C)<=H)continue;const I=l-f,P=c-v,D=d-g,F=I*R+P*S+D*y;if(C>0){if(F<0||F>C)continue}else if(F>0||F<C)continue;const L=P*M-E*D,B=D*x-M*I,G=I*E-x*P,U=u*L+h*B+m*G;if(C>0){if(U<0||F+U>C)continue}else if(U>0||F+U<C)continue;const z=(A*L+w*B+b*G)/C;z>=0&&s(z,e,a?N(x,E,M,A,w,b,O):null)}}const y=(0,n.vt)(),C=(0,n.vt)(),I=(0,n.vt)();function N(e,t,r,n,o,a,s){return(0,i.i)(D,e,t,r),(0,i.i)(F,n,o,a),(0,i.h)(s,D,F),(0,i.n)(s,s),s}function P(e){return(0,i.a)(D,e[1],e[0]),(0,i.a)(F,e[2],e[0]),(0,i.h)(O,D,F),(0,i.n)(O,O),O}const D=(0,n.vt)(),F=(0,n.vt)(),L=1e3,H=1e-7,B=(0,n.vt)(),G=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var U=r(13464),z=r(16396),V=r(13030),W=r(59907);class j{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get(E.r.POSITION).indices.length}write(e,t,r,i,n,o){return(0,W.SA)(r,i,this.vertexBufferLayout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const l=this.vertexBufferLayout.createView(e).getField(E.r.POSITION,V.xs);if(null==l)return;const c=(0,i.a)(k,a,o),d=l.count/3,u=n.options.normalRequired;S(o,c,0,d,l.typedBuffer,l.typedBufferStride,u,(e,t,r)=>{s(e,r,t)})}}const k=(0,n.vt)();var q=r(43616),$=r(91829),Y=r(72824),Z=r(97220),X=r(98958),J=r(63907);J.MT.LESS,J.MT.ALWAYS;const K={mask:255},Q={function:{func:J.MT.ALWAYS,ref:p.dd.OutlineVisualElementMask,mask:p.dd.OutlineVisualElementMask},operation:{fail:J.eA.KEEP,zFail:J.eA.KEEP,zPass:J.eA.ZERO}},ee={function:{func:J.MT.ALWAYS,ref:p.dd.OutlineVisualElementMask,mask:p.dd.OutlineVisualElementMask},operation:{fail:J.eA.KEEP,zFail:J.eA.KEEP,zPass:J.eA.REPLACE}};J.MT.EQUAL,p.dd.OutlineVisualElementMask,p.dd.OutlineVisualElementMask,J.eA.KEEP,J.eA.KEEP,J.eA.KEEP,J.MT.NOTEQUAL,p.dd.OutlineVisualElementMask,p.dd.OutlineVisualElementMask,J.eA.KEEP,J.eA.KEEP,J.eA.KEEP;var te=r(74810),re=r(28491),ie=r(90644),ne=r(49788);class oe extends Y.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=te.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=p.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=o.YJ.Color,this.emissiveBaseColor=n.uY,this.instancedDoublePrecision=!1,this.normalType=c.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,n.CN)(.2,.2,.2),this.diffuse=(0,n.CN)(.8,.8,.8),this.externalColor=(0,$.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,n.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=p.it.Less,this.textureAlphaMode=p.sf.Blend,this.textureAlphaCutoff=ne.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=v.m$.Occlude,this.isDecoration=!1}}Y.gy;class ae extends X.w{constructor(e,t,i=new Z.$(re.D,()=>r.e(5141).then(r.bind(r,5141)))){super(e,t,i),this.type="DefaultMaterialTechnique"}_makePipeline(e,t){const{oitPass:r,output:i,transparent:n,cullFace:o,customDepthTest:a,hasOccludees:s}=e;return(0,ie.Ey)({blending:(0,l.RN)(i)&&n?(0,g.Yf)(r):null,culling:le(e)?(0,ie.Xt)(o):null,depthTest:{func:(0,g.K_)(r,se(a))},depthWrite:(0,g.z5)(e),drawBuffers:(0,X.L)(i,(0,g.m6)(r,i)),colorWrite:ie.kn,stencilWrite:s?K:null,stencilTest:s?t?ee:Q:null,polygonOffset:(0,g.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function se(e){return e===p.it.Lequal?J.MT.LEQUAL:J.MT.LESS}function le(e){return e.cullFace!==p.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}var ce=r(90237),de=r(53466),ue=r(51976),he=r(35256);class me extends he.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=p.sf.Opaque,this.doubleSidedMode=u.W.None,this.pbrMode=h.A9.Disabled,this.cullFace=p.s2.None,this.normalType=c.W.Attribute,this.customDepthTest=p.it.Less,this.emissionSource=d.ZX.None,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instancedDoublePrecision=!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.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasBloom=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.hasVvInstancing=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasColorTexture||this.hasMetallicRoughnessTexture||this.emissionSource===d.ZX.Texture||this.hasOcclusionTexture||this.hasNormalTexture?de.I.Default:de.I.None}get objectAndLayerIdColorInstanced(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,ce._)([(0,ue.W)({count:p.sf.COUNT})],me.prototype,"alphaDiscardMode",void 0),(0,ce._)([(0,ue.W)({count:u.W.COUNT})],me.prototype,"doubleSidedMode",void 0),(0,ce._)([(0,ue.W)({count:h.A9.COUNT})],me.prototype,"pbrMode",void 0),(0,ce._)([(0,ue.W)({count:p.s2.COUNT})],me.prototype,"cullFace",void 0),(0,ce._)([(0,ue.W)({count:c.W.COUNT})],me.prototype,"normalType",void 0),(0,ce._)([(0,ue.W)({count:p.it.COUNT})],me.prototype,"customDepthTest",void 0),(0,ce._)([(0,ue.W)({count:d.ZX.COUNT})],me.prototype,"emissionSource",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasVertexColors",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasSymbolColors",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasVerticalOffset",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasColorTexture",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasMetallicRoughnessTexture",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasOcclusionTexture",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasNormalTexture",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasScreenSizePerspective",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasVertexTangents",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasOccludees",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"instancedDoublePrecision",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasModelTransformation",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"offsetBackfaces",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"vvSize",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"vvColor",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"receiveShadows",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"receiveAmbientOcclusion",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"textureAlphaPremultiplied",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"instanced",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"instancedColor",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"writeDepth",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"transparent",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"enableOffset",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"terrainDepthTest",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"cullAboveTerrain",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"snowCover",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasBloom",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasColorTextureTransform",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasEmissionTextureTransform",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasNormalTextureTransform",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasOcclusionTextureTransform",void 0),(0,ce._)([(0,ue.W)()],me.prototype,"hasMetallicRoughnessTextureTransform",void 0);var pe=r(57323);class fe extends ae{constructor(e,t){super(e,t,new Z.$(pe.R,()=>r.e(9933).then(r.bind(r,39933)))),this.type="RealisticTreeTechnique"}}class ve extends v.im{constructor(e,t){super(e,_e),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[U.N.OPAQUE_MATERIAL,e=>((0,l.iq)(e)||(0,l.PJ)(e))&&!this.transparent],[U.N.TRANSPARENT_MATERIAL,e=>((0,l.iq)(e)||(0,l.PJ)(e))&&this.transparent&&this.parameters.writeDepth],[U.N.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>((0,l.XY)(e)||(0,l.PJ)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,s.BP)().vec3f(E.r.POSITION);return e.normalType===c.W.Compressed?t.vec2i16(E.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(E.r.NORMAL),e.hasVertexTangents&&t.vec4f(E.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f16(E.r.UV0),e.hasVertexColors&&t.vec4u8(E.r.COLOR),e.hasSymbolColors&&t.vec4u8(E.r.SYMBOLCOLOR),(0,m.E)()&&t.vec4u8(E.r.OLIDCOLOR),t}(this.parameters),this._configuration=new me(t.spherical)}isVisibleForOutput(e){return e!==l.V.Shadow&&e!==l.V.ShadowExcludeHighlight&&e!==l.V.ShadowHighlight||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=ne.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.q)(this.parameters.emissiveBaseColor,n.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(this.parameters.emissiveSource===o.YJ.Emissive&&this._hasEmissiveBase||this.parameters.emissiveSource===o.YJ.Color)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:n,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=!n&&!!r.normalTextureId,i.hasColorTexture=!!r.textureId,i.hasVertexTangents=!n&&r.hasVertexTangents,i.instanced=r.isInstanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.vvSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=n?c.W.Attribute:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??p.it.Less,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?p.s2.None:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!n&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=n?u.W.WindingOrder:a&&"normal"===s?u.W.View:a&&"winding-order"===s?u.W.WindingOrder:u.W.None,i.instancedColor=r.hasInstancedColor,(0,l.RN)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.vvColor=!!r.vvColor,i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?h.A9.Schematic:h.A9.Normal:h.A9.Disabled,i.hasMetallicRoughnessTexture=!n&&!!r.metallicRoughnessTextureId,i.emissionSource=n?d.ZX.None:null!=r.emissiveTextureId&&r.emissiveSource===o.YJ.Emissive?d.ZX.Texture:r.usePBR?r.emissiveSource===o.YJ.Emissive?d.ZX.EmissiveColor:d.ZX.SymbolColor:d.ZX.None,i.hasOcclusionTexture=!n&&!!r.occlusionTextureId,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.camera.relativeElevation<g.xt,i.snowCover=t.snowCover,i.hasBloom=(0,l.LG)(e),i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,n,o,s){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(be,t[12],t[13],t[14]);let s=null;switch(r.viewingMode){case a.RT.Global:s=(0,i.n)(Ae,be);break;case a.RT.Local:s=(0,i.c)(Ae,Me)}let l=0;const c=(0,i.d)(Re,be,e.eye),d=(0,i.l)(c),u=(0,i.g)(c,c,1/d);let h=null;this.parameters.screenSizePerspective&&(h=(0,i.e)(s,u)),l+=(0,q.kE)(e,d,this.parameters.verticalOffset,h??0,this.parameters.screenSizePerspective),(0,i.g)(s,s,l),(0,i.o)(we,s,r.transform.inverseRotation),n=(0,i.d)(xe,n,we),o=(0,i.d)(Ee,o,we)}w(e,r,n,o,(0,z.ou)(r.verticalOffset),s)}createGLMaterial(e){return new ge(e)}createBufferWriter(){return new j(this._vertexBufferLayout)}get transparent(){return Te(this.parameters)}}class ge extends f.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.i)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?fe:ae,e)}}class _e extends oe{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}}function Te(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:a,textureAlphaMode:s,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||n<1||(null!=o||null!=a)&&s!==p.sf.Opaque&&s!==p.sf.Mask&&"replace"!==l}const xe=(0,n.vt)(),Ee=(0,n.vt)(),Me=(0,n.fA)(0,0,1),Ae=(0,n.vt)(),we=(0,n.vt)(),be=(0,n.vt)(),Re=(0,n.vt)()},89192:(e,t,r)=>{var i,n,o,a,s,l,c,d;r.d(t,{Am:()=>a,C7:()=>o,JS:()=>d,Mg:()=>l,dd:()=>s,it:()=>n,s2:()=>i,sf:()=>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.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(o||(o={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee"}(l||(l={})),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"}(c||(c={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(d||(d={}))},89390:(e,t,r)=>{r.d(t,{kA:()=>R,a8:()=>w,eU:()=>b});var i=r(40876),n=(r(44208),r(38954)),o=r(51850),a=r(87317),s=r(91829),l=r(59469),c=r(23205),d=r(14314),u=r(31821);function h(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new c.d("lightingAmbientSH0",({lighting:e})=>(0,n.i)(m,e.sh.r[0],e.sh.g[0],e.sh.b[0]))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
812
+ vec3 ambientLight = 0.282095 * lightingAmbientSH0;
813
+ return ambientLight * (1.0 - ambientOcclusion);
814
+ }`)):1===i?(r.uniforms.add(new d.I("lightingAmbientSH_R",({lighting:e})=>(0,a.s)(p,e.sh.r[0],e.sh.r[1],e.sh.r[2],e.sh.r[3])),new d.I("lightingAmbientSH_G",({lighting:e})=>(0,a.s)(p,e.sh.g[0],e.sh.g[1],e.sh.g[2],e.sh.g[3])),new d.I("lightingAmbientSH_B",({lighting:e})=>(0,a.s)(p,e.sh.b[0],e.sh.b[1],e.sh.b[2],e.sh.b[3]))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
815
+ vec4 sh0 = vec4(
816
+ 0.282095,
817
+ 0.488603 * normal.x,
818
+ 0.488603 * normal.z,
819
+ 0.488603 * normal.y
820
+ );
821
+ vec3 ambientLight = vec3(
822
+ dot(lightingAmbientSH_R, sh0),
823
+ dot(lightingAmbientSH_G, sh0),
824
+ dot(lightingAmbientSH_B, sh0)
825
+ );
826
+ return ambientLight * (1.0 - ambientOcclusion);
827
+ }`)):2===i&&(r.uniforms.add(new c.d("lightingAmbientSH0",({lighting:e})=>(0,n.i)(m,e.sh.r[0],e.sh.g[0],e.sh.b[0])),new d.I("lightingAmbientSH_R1",({lighting:e})=>(0,a.s)(p,e.sh.r[1],e.sh.r[2],e.sh.r[3],e.sh.r[4])),new d.I("lightingAmbientSH_G1",({lighting:e})=>(0,a.s)(p,e.sh.g[1],e.sh.g[2],e.sh.g[3],e.sh.g[4])),new d.I("lightingAmbientSH_B1",({lighting:e})=>(0,a.s)(p,e.sh.b[1],e.sh.b[2],e.sh.b[3],e.sh.b[4])),new d.I("lightingAmbientSH_R2",({lighting:e})=>(0,a.s)(p,e.sh.r[5],e.sh.r[6],e.sh.r[7],e.sh.r[8])),new d.I("lightingAmbientSH_G2",({lighting:e})=>(0,a.s)(p,e.sh.g[5],e.sh.g[6],e.sh.g[7],e.sh.g[8])),new d.I("lightingAmbientSH_B2",({lighting:e})=>(0,a.s)(p,e.sh.b[5],e.sh.b[6],e.sh.b[7],e.sh.b[8]))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
828
+ vec3 ambientLight = 0.282095 * lightingAmbientSH0;
829
+ vec4 sh1 = vec4(
830
+ 0.488603 * normal.x,
831
+ 0.488603 * normal.z,
832
+ 0.488603 * normal.y,
833
+ 1.092548 * normal.x * normal.y
834
+ );
835
+ vec4 sh2 = vec4(
836
+ 1.092548 * normal.y * normal.z,
837
+ 0.315392 * (3.0 * normal.z * normal.z - 1.0),
838
+ 1.092548 * normal.x * normal.z,
839
+ 0.546274 * (normal.x * normal.x - normal.y * normal.y)
840
+ );
841
+ ambientLight += vec3(
842
+ dot(lightingAmbientSH_R1, sh1),
843
+ dot(lightingAmbientSH_G1, sh1),
844
+ dot(lightingAmbientSH_B1, sh1)
845
+ );
846
+ ambientLight += vec3(
847
+ dot(lightingAmbientSH_R2, sh2),
848
+ dot(lightingAmbientSH_G2, sh2),
849
+ dot(lightingAmbientSH_B2, sh2)
850
+ );
851
+ return ambientLight * (1.0 - ambientOcclusion);
852
+ }`),t.pbrMode!==l.A9.Normal&&t.pbrMode!==l.A9.Schematic||r.code.add(u.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
853
+ vec3 calculateAmbientRadiance(float ambientOcclusion)
854
+ {
855
+ vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
856
+ return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
857
+ }`))}const m=(0,o.vt)(),p=(0,s.vt)();var f=r(53802),v=r(98619),g=r(22393),_=r(89786),T=r(32976),x=r(33094);r(34727),(0,o.vt)();const E=.4;function M(e){e.code.add(u.H`float mapChannel(float x, vec2 p) {
858
+ return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
859
+ }`),e.code.add(u.H`vec3 blackLevelSoftCompression(vec3 color, float averageAmbientRadiance) {
860
+ vec2 p = vec2(0.02, 0.0075) * averageAmbientRadiance;
861
+ return vec3(mapChannel(color.x, p), mapChannel(color.y, p), mapChannel(color.z, p));
862
+ }`)}function A(e){e.code.add(u.H`vec3 tonemapACES(vec3 x) {
863
+ return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
864
+ }`)}function w(e){e.constants.add("ambientBoostFactor","float",E)}function b(e){e.uniforms.add(new x.U("lightingGlobalFactor",e=>e.lighting.globalFactor))}function R(e,t){const r=e.fragment,{pbrMode:n,spherical:o,hasColorTexture:a}=t;r.include(f.n,t),n!==l.A9.Disabled&&r.include(g.c,t),e.include(h,t),r.include(_.p),r.include(A,t);const s=!(n===l.A9.Schematic&&!a);switch(s&&r.include(M),r.code.add(u.H`
865
+ const float GAMMA_SRGB = ${u.H.float(i.Tf)};
866
+ const float INV_GAMMA_SRGB = 0.4761904;
867
+ ${(0,u.If)(n!==l.A9.Disabled,"const float GROUND_REFLECTANCE = 0.2;")}
868
+ `),w(r),b(r),(0,v.Gc)(r),r.code.add(u.H`
869
+ float additionalDirectedAmbientLight(vec3 vPosWorld) {
870
+ float vndl = dot(${o?u.H`normalize(vPosWorld)`:u.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
871
+ return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
872
+ }
873
+ `),(0,v.O4)(r),r.code.add(u.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
874
+ float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
875
+ return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
876
+ }`),n){case l.A9.Disabled:case l.A9.WaterOnIntegratedMesh:case l.A9.Water:e.include(v.Vt),r.code.add(u.H`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) {
877
+ vec3 mainLighting = applyShading(normalWorld, shadow);
878
+ vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
879
+ vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
880
+ vec3 totalLight = mainLighting + ambientLighting + additionalLight;
881
+ totalLight = min(totalLight, vec3(PI));
882
+ vec3 outColor = vec3((albedoLinear / PI) * totalLight);
883
+ return pow(outColor, vec3(INV_GAMMA_SRGB));
884
+ }`);break;case l.A9.Normal:case l.A9.Schematic:r.code.add(u.H`const float fillLightIntensity = 0.25;
885
+ const float horizonLightDiffusion = 0.4;
886
+ const float additionalAmbientIrradianceFactor = 0.02;
887
+ vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
888
+ vec3 viewDir, vec3 groundNormal, vec3 mrr, vec4 _emission,
889
+ float additionalAmbientIrradiance) {
890
+ vec3 viewDirection = -viewDir;
891
+ vec3 h = normalize(viewDirection + mainLightDirection);
892
+ PBRShadingInfo inputs;
893
+ inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0);
894
+ inputs.NdotNG = clamp(dot(normal, groundNormal), -1.0, 1.0);
895
+ vec3 reflectedView = normalize(reflect(viewDirection, normal));
896
+ inputs.RdotNG = clamp(dot(reflectedView, groundNormal), -1.0, 1.0);
897
+ inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
898
+ inputs.ssao = ssao;
899
+ inputs.metalness = mrr[0];
900
+ inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(u.H`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
901
+ inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
902
+ inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new T.o("hasFillLights",e=>e.enableFillLights)):r.constants.add("hasFillLights","bool",!1),r.code.add(u.H`vec3 ambientDir = vec3(5.0 * groundNormal[1] - groundNormal[0] * groundNormal[2], - 5.0 * groundNormal[0] - groundNormal[2] * groundNormal[1], groundNormal[1] * groundNormal[1] + groundNormal[0] * groundNormal[0]);
903
+ ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
904
+ inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
905
+ float NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
906
+ vec3 mainLightIrradianceComponent = NdotL * (1.0 - shadow) * mainLightIntensity;
907
+ vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
908
+ vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
909
+ inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
910
+ inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add(new x.U("lightingSpecularStrength",e=>e.lighting.mainLight.specularStrength),new x.U("lightingEnvironmentStrength",e=>e.lighting.mainLight.environmentStrength)).code.add(u.H`vec3 horizonRingDir = inputs.RdotNG * groundNormal - reflectedView;
911
+ vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
912
+ inputs.NdotH_Horizon = dot(normal, horizonRingH);
913
+ float NdotH = clamp(dot(normal, h), 0.0, 1.0);
914
+ vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow);
915
+ vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity;
916
+ vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight;
917
+ float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0));
918
+ inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
919
+ inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
920
+ inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE);`),r.code.add(u.H`
921
+ vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
922
+ vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
923
+ vec3 emissionComponent = _emission.rgb == vec3(0.0) ? _emission.rgb : tonemapACES(pow(_emission.rgb, vec3(GAMMA_SRGB)));
924
+ vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
925
+ ${s?u.H`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:u.H`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`}
926
+ return outColor;
927
+ }
928
+ `);break;case l.A9.Simplified:case l.A9.TerrainWithWater:(0,v.Gc)(r),(0,v.O4)(r),r.code.add(u.H`const float roughnessTerrain = 0.5;
929
+ const float specularityTerrain = 0.5;
930
+ const vec3 fresnelReflectionTerrain = vec3(0.04);
931
+ vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) {
932
+ vec3 viewDirection = -vd;
933
+ vec3 h = normalize(viewDirection + mainLightDirection);
934
+ float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0);
935
+ float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0);
936
+ float NdotH = clamp(dot(n, h), 0.0, 1.0);
937
+ float NdotNG = clamp(dot(n, nup), -1.0, 1.0);
938
+ vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB));
939
+ float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2];
940
+ vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain;
941
+ vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0));
942
+ vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity;
943
+ vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al;
944
+ vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent;
945
+ vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5;
946
+ vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI;
947
+ vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity;
948
+ vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV);
949
+ vec3 specularColor = f0 * dfg.x + f90 * dfg.y;
950
+ vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent;
951
+ vec3 outColorLinear = outDiffColor + specularComponent;
952
+ vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB));
953
+ return outColor;
954
+ }`);default:case l.A9.COUNT:}}(0,o.vt)()},89786:(e,t,r)=>{function i(e){const t=.3183098861837907;e.constants.add("PI","float",3.141592653589793),e.constants.add("LIGHT_NORMALIZATION","float",t),e.constants.add("INV_PI","float",t),e.constants.add("HALF_PI","float",1.570796326794897),e.constants.add("TWO_PI","float",6.28318530717958)}r.d(t,{p:()=>i})},90644:(e,t,r)=>{r.d(t,{Ey:()=>A,RC:()=>s,T8:()=>l,Uy:()=>h,Xt:()=>u,kn:()=>m,p3:()=>a});var i=r(89192),n=r(63907);function o(e,t,r=n.Tb.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]}}}function a(e,t,r,i,o=n.Tb.ADD,a=n.Tb.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:o,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}o(n.dn.ZERO,n.dn.ONE_MINUS_SRC_ALPHA),o(n.dn.ONE,n.dn.ZERO),o(n.dn.ONE,n.dn.ONE);const s=o(n.dn.ONE,n.dn.ONE_MINUS_SRC_ALPHA),l=a(n.dn.SRC_ALPHA,n.dn.ONE,n.dn.ONE_MINUS_SRC_ALPHA,n.dn.ONE_MINUS_SRC_ALPHA),c={face:n.Y7.BACK,mode:n.Ac.CCW},d={face:n.Y7.FRONT,mode:n.Ac.CCW},u=e=>e===i.s2.Back?c:e===i.s2.Front?d:null,h={zNear:0,zFar:1},m={r:!0,g:!0,b:!0,a:!0};function p(e){return R.intern(e)}function f(e){return S.intern(e)}function v(e){return C.intern(e)}function g(e){return N.intern(e)}function _(e){return D.intern(e)}function T(e){return L.intern(e)}function x(e){return B.intern(e)}function E(e){return U.intern(e)}function M(e){return V.intern(e)}function A(e){return j.intern(e)}class w{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)??null}}function b(e){return"["+e.join(",")+"]"}const R=new w(O,e=>({__tag:"Blending",...e}));function O(e){return e?b([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 S=new w(y,e=>({__tag:"Culling",...e}));function y(e){return e?b([e.face,e.mode]):null}const C=new w(I,e=>({__tag:"PolygonOffset",...e}));function I(e){return e?b([e.factor,e.units]):null}const N=new w(P,e=>({__tag:"DepthTest",...e}));function P(e){return e?b([e.func]):null}const D=new w(F,e=>({__tag:"StencilTest",...e}));function F(e){return e?b([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const L=new w(H,e=>({__tag:"DepthWrite",...e}));function H(e){return e?b([e.zNear,e.zFar]):null}const B=new w(G,e=>({__tag:"ColorWrite",...e}));function G(e){return e?b([e.r,e.g,e.b,e.a]):null}const U=new w(z,e=>({__tag:"StencilWrite",...e}));function z(e){return e?b([e.mask]):null}const V=new w(W,e=>({__tag:"DrawBuffers",...e}));function W(e){return e?b(e.buffers):null}const j=new w(function(e){return e?b([O(e.blending),y(e.culling),I(e.polygonOffset),P(e.depthTest),F(e.stencilTest),H(e.depthWrite),G(e.colorWrite),z(e.stencilWrite),W(e.drawBuffers)]):null},e=>({blending:p(e.blending),culling:f(e.culling),polygonOffset:v(e.polygonOffset),depthTest:g(e.depthTest),stencilTest:_(e.stencilTest),depthWrite:T(e.depthWrite),colorWrite:x(e.colorWrite),stencilWrite:E(e.stencilWrite),drawBuffers:M(e.drawBuffers)}))},92700:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(31821),n=r(46540);function o(e,t){t.hasVertexColors?(e.attributes.add(n.r.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`
955
+ void forwardNormalizedVertexColor() { vColor = color * ${i.H.float(1/255)}; }
956
+ `)):e.vertex.code.add(i.H`void forwardVertexColor() {}
957
+ void forwardNormalizedVertexColor() {}`)}},92993:(e,t,r)=>{var i;r.d(t,{n:()=>i}),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"}(i||(i={}))},94656:(e,t,r)=>{r.d(t,{Y2:()=>d,en:()=>c});var i=r(49186),n=r(44208),o=r(53966),a=r(63907);const s=()=>o.A.getLogger("esri.views.webgl.checkWebGLError"),l=!!(0,n.A)("enable-feature:webgl-debug");function c(){return l}function d(e,t=c()){if(t){const t=e.getError();if(t){const e=function(e){switch(e){case a.bh.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case a.bh.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case a.bh.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case a.bh.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 a.bh.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case a.bh.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(t),r=(new Error).stack;s().error(new i.A("webgl-error","WebGL error occurred",{message:e,stack:r}))}}}},95774:(e,t,r)=>{r.d(t,{S:()=>m,b:()=>h});var i=r(82048),n=r(52540),o=r(68259),a=r(20304),s=r(31821),l=r(15976),c=r(63761),d=r(14113);const u=4;function h(){const e=new d.N5,t=e.fragment;e.include(i.c);const r=(u+1)/2,h=1/(2*r*r);return t.include(n.E),t.uniforms.add(new c.N("depthMap",e=>e.depthTexture),new l.o("tex",e=>e.colorTexture),new o.t("blurSize",e=>e.blurSize),new a.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(s.H`
958
+ void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
959
+ float c = texture(tex, uv).r;
960
+ float d = linearDepthFromTexture(depthMap, uv);
961
+
962
+ float ddiff = d - center_d;
963
+
964
+ float w = exp(-r * r * ${s.H.float(h)} - ddiff * ddiff * sharpness);
965
+ wTotal += w;
966
+ bTotal += w * c;
967
+ }
968
+ `),e.outputs.add("fragBlur","float"),t.main.add(s.H`
969
+ float b = 0.0;
970
+ float w_total = 0.0;
971
+
972
+ float center_d = linearDepthFromTexture(depthMap, uv);
973
+
974
+ float sharpness = -0.05 * projScale / center_d;
975
+ for (int r = -${s.H.int(u)}; r <= ${s.H.int(u)}; ++r) {
976
+ float rf = float(r);
977
+ vec2 uvOffset = uv + rf * blurSize;
978
+ blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
979
+ }
980
+ fragBlur = b / w_total;`),e}const m=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}))},96336:(e,t,r)=>{r.d(t,{W:()=>i,Y:()=>l});var i,n,o=r(21818),a=r(31821),s=r(46540);function l(e,t){switch(t.normalType){case i.Compressed:e.attributes.add(s.r.NORMALCOMPRESSED,"vec2"),e.vertex.code.add(a.H`vec3 decompressNormal(vec2 normal) {
981
+ float z = 1.0 - abs(normal.x) - abs(normal.y);
982
+ return vec3(normal + sign(normal) * min(z, 0.0), z);
983
+ }
984
+ vec3 normalModel() {
985
+ return decompressNormal(normalCompressed);
986
+ }`);break;case i.Attribute:e.attributes.add(s.r.NORMAL,"vec3"),e.vertex.code.add(a.H`vec3 normalModel() {
987
+ return normal;
988
+ }`);break;case i.ScreenDerivative:e.fragment.code.add(a.H`vec3 screenDerivativeNormal(vec3 positionView) {
989
+ return normalize(cross(dFdx(positionView), dFdy(positionView)));
990
+ }`);break;default:(0,o.Xb)(t.normalType);case i.COUNT:}}(n=i||(i={}))[n.Attribute=0]="Attribute",n[n.Compressed=1]="Compressed",n[n.ScreenDerivative=2]="ScreenDerivative",n[n.COUNT=3]="COUNT"},96598:(e,t,r)=>{r.d(t,{Z:()=>a});var i=r(52540),n=r(31821),o=r(12791);function a(e,{occlusionPass:t,terrainDepthTest:r,cullAboveTerrain:a}){const{vertex:s,fragment:l,varyings:c}=e;if(!r)return s.code.add("void forwardViewPosDepth(vec3 pos) {}"),void l.code.add(`${t?"bool":"void"} discardByTerrainDepth() { ${(0,n.If)(t,"return false;")}}`);c.add("viewPosDepth","float",{invariant:!0}),s.code.add("void forwardViewPosDepth(vec3 pos) {\n viewPosDepth = pos.z;\n }"),l.include(i.E),l.uniforms.add(new o.x("terrainDepthTexture",e=>e.terrainDepth?.attachment)).code.add(n.H`
991
+ ${t?"bool":"void"} discardByTerrainDepth() {
992
+ float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r;
993
+ float linearDepth = linearizeDepth(depth);
994
+ ${t?"return viewPosDepth < linearDepth && depth < 1.0;":`if(viewPosDepth ${a?">":"<="} linearDepth) discard;`}
995
+ }`)}},97220:(e,t,r)=>{r.d(t,{$:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98353:(e,t,r)=>{r.d(t,{h:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t,r){super(e,"mat3",i.c.Draw,(i,n,o)=>i.setUniformMatrix3fv(e,t(n,o),r))}}},98619:(e,t,r)=>{r.d(t,{Gc:()=>o,O4:()=>a,Vt:()=>s});var i=r(23205),n=r(31821);function o(e){e.uniforms.add(new i.d("mainLightDirection",e=>e.lighting.mainLight.direction))}function a(e){e.uniforms.add(new i.d("mainLightIntensity",e=>e.lighting.mainLight.intensity))}function s(e){o(e.fragment),a(e.fragment),e.fragment.code.add(n.H`vec3 applyShading(vec3 shadingNormal, float shadow) {
996
+ float dotVal = clamp(dot(shadingNormal, mainLightDirection), 0.0, 1.0);
997
+ return mainLightIntensity * ((1.0 - shadow) * dotVal);
998
+ }`)}},98958:(e,t,r)=>{r.d(t,{w:()=>u,L:()=>h});var i=r(53966),n=r(97768),o=r(49255),a=r(39341),s=(r(44208),r(94656));class l{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._glProgram=e.programCache.acquire(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t,r){this._glProgram.setUniform1f(e,t,r)}setUniform2fv(e,t,r){this._glProgram.setUniform2fv(e,t,r)}setUniform3fv(e,t,r){this._glProgram.setUniform3fv(e,t,r)}setUniform4fv(e,t,r){this._glProgram.setUniform4fv(e,t,r)}setUniformMatrix3fv(e,t,r){this._glProgram.setUniformMatrix3fv(e,t,!1,r)}setUniformMatrix4fv(e,t,r){this._glProgram.setUniformMatrix4fv(e,t,!1,r)}setUniform1fv(e,t,r){this._glProgram.setUniform1fv(e,t,r)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(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()}bindTexture(e,t){t?.glName||((0,s.en)()&&console.error(`Texture sampler ${e} has no given Texture in ${(new Error).stack} `),t=this._context.emptyTexture);const r=this._ensureTextureUnit(e,t);this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit)}_ensureTextureUnit(e,t){let r=this._textures.get(e);return null==r?(r={texture:t,unit:this._textures.size},this._textures.set(e,r)):r.texture=t,r}}var c=r(63907),d=r(90644);class u{constructor(e,t,r,o=a.D){this.locations=o,this.primitiveType=c.WR.TRIANGLES,this.key=t.key,this._program=new l(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t),this.reload=async a=>{a&&await r.reload(),this.key.equals(t.key)||i.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn("Configuration was changed after construction, cannot reload shader.",r),(0,n.WD)(this._program),this._program=new l(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t)}}destroy(){this._program=(0,n.WD)(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t){return this._pipeline}initializePipeline(e){return(0,d.Ey)({blending:d.RC,colorWrite:d.kn})}}function h(e,t){return(0,o.Vg)(e)?{buffers:[c.Hr.NONE]}:t??null}},99208:(e,t,r)=>{r.d(t,{r:()=>a});var i=r(53466),n=r(31821);function o(e){e.fragment.code.add(n.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
999
+ vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
1000
+ vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
1001
+ float maxdUV = 0.125;
1002
+ vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
1003
+ vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
1004
+ return textureGrad(tex, uvAtlas, dUVdx, dUVdy);
1005
+ }`)}function a(e,t){const{textureCoordinateType:r}=t;if(r===i.I.None||r===i.I.COUNT)return;e.include(i.U,t);const a=r===i.I.Atlas;a&&e.include(o),e.fragment.code.add(n.H`
1006
+ vec4 textureLookup(sampler2D tex, vec2 uv) {
1007
+ return ${a?"textureAtlasLookup(tex, uv, vuvRegion)":"texture(tex, uv)"};
1008
+ }
1009
+ `)}},99677:(e,t,r)=>{r.d(t,{D:()=>n});var i=r(78888);async function n(e,t){const{data:r}=await(0,i.A)(e,{responseType:"image",...t});return r}}}]);