@arcgis/core 6.0.0-next.55 → 6.0.0-next.56

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 (205) hide show
  1. package/arcgisGlobal.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/033b9fcd9833db3b6e7d.js +1 -0
  4. package/assets/esri/core/workers/chunks/0978e12dd6a1cbc50b80.js +1 -0
  5. package/assets/esri/core/workers/chunks/{e956845255bce0910944.js → 1507297550c3cd1268e2.js} +1 -1
  6. package/assets/esri/core/workers/chunks/1c0f5c42331fb6fc26cb.js +1 -0
  7. package/assets/esri/core/workers/chunks/2cd2fcf4a37d180d5d5c.js +1 -0
  8. package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +1 -0
  9. package/assets/esri/core/workers/chunks/3982409149571a827390.js +1 -0
  10. package/assets/esri/core/workers/chunks/3d851710f7fcc27c5b60.js +2 -0
  11. package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +1 -0
  12. package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +1 -0
  13. package/assets/esri/core/workers/chunks/{e61082f56c08abe54b3a.js → 5954f02c3901b28d8e73.js} +1 -1
  14. package/assets/esri/core/workers/chunks/5ba6007c3c49a8153256.js +1 -0
  15. package/assets/esri/core/workers/chunks/5bdd95eeb8f34dbf26f2.js +2 -0
  16. package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js → 5e47026c681238038955.js} +2 -2
  17. package/assets/esri/core/workers/chunks/{2baf35b1b19482d603b5.js → 5f7505ada0991cfbdd84.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{976303f47c342b9d1cc0.js → 62ddd3a82864e26f009a.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{542a9c414c99d84d52ab.js → 6a202ef9ba9b89e09153.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{0826feebdca8a31eb630.js → 6ba6fece5c11fe2a6ace.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{5eb69e2895e5aec81051.js → 6fd10891506925560443.js} +1 -1
  22. package/assets/esri/core/workers/chunks/7b6fd287e7043ad50f4e.js +1 -0
  23. package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +1 -0
  24. package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +1 -0
  25. package/assets/esri/core/workers/chunks/{c3c0f24a9e0047232ae1.js → 8679dfc0c53355b6feb0.js} +1 -1
  26. package/assets/esri/core/workers/chunks/8a636dc51372e14c98f5.js +1 -0
  27. package/assets/esri/core/workers/chunks/{14259910f44c08fd5bbd.js → 9117c9b720c9ba6e7a6e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/a22458e5272332d86cb9.js +1 -0
  29. package/assets/esri/core/workers/chunks/{3ea480cebf8ee56228a5.js → a7dfca326883384d2751.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{723d8316f5d4b6ce2942.js → a9539393e2f1812a973a.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{be0b8bb4f09aae6ff5de.js → ab784764ddf9d7f693a1.js} +1 -1
  32. package/assets/esri/core/workers/chunks/b38b6fe08a367e9de4f5.js +1 -0
  33. package/assets/esri/core/workers/chunks/{4e651869e9a196494694.js → b6e628b5d2643af4c19b.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{b37ab6b1cb4cfc85cd9d.js → b7828d7e2c5b75644057.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{ec465abb0344ad719e9d.js → bd8e329ec74d921d311a.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{56e6e70aa40e51827290.js → c3f94024c6c9eed9f273.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{6d17b45022dfd2548098.js → c5ddf8b347c31fe772a3.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{ee9af58ae202b803bba7.js → c7a0c4ca37ebd1d98cf1.js} +1 -1
  39. package/assets/esri/core/workers/chunks/d7763c42754152510e13.js +2 -0
  40. package/assets/esri/core/workers/chunks/{9e508f930086d2ef5f22.js → dfa1b0308e5e82d1ddfe.js} +40 -41
  41. package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +1 -0
  42. package/assets/esri/core/workers/chunks/e74586b074d0fa6abb4b.js +1 -0
  43. package/assets/esri/core/workers/chunks/e7dff025780726d5feae.js +1 -0
  44. package/assets/esri/core/workers/chunks/e96fa029acba59c04e4e.js +2 -0
  45. package/assets/esri/core/workers/chunks/{4401b3f8ebb658abe789.js → efd6ea0966f60ab19520.js} +1 -1
  46. package/assets/esri/core/workers/chunks/fdfbd201be372d3796bf.js +2 -0
  47. package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +1 -0
  48. package/chunks/BlendLayers.glsl.js +1 -1
  49. package/chunks/ColorMaterial.glsl.js +14 -14
  50. package/chunks/Component.glsl.js +37 -37
  51. package/chunks/DefaultMaterial.glsl.js +15 -15
  52. package/chunks/HUDMaterial.glsl.js +3 -3
  53. package/chunks/Path.glsl.js +15 -15
  54. package/chunks/Pattern.glsl.js +20 -20
  55. package/chunks/RasterColorizer.glsl.js +1 -1
  56. package/chunks/ShadowHighlight.glsl.js +1 -1
  57. package/chunks/Terrain.glsl.js +24 -24
  58. package/chunks/Water.glsl.js +29 -20
  59. package/chunks/pdf.js +57 -0
  60. package/config.js +1 -1
  61. package/core/accessorSupport/write.js +1 -1
  62. package/core/scheduling.js +1 -1
  63. package/kernel.js +1 -1
  64. package/layers/VoxelWasmPerSceneView.js +1 -1
  65. package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
  66. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -56
  67. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  68. package/layers/geospatialPDF/parserUtils.js +2 -0
  69. package/layers/support/ControlPoint.js +1 -1
  70. package/layers/support/ControlPointsGeoreference.js +1 -1
  71. package/layers/support/commonProperties.js +1 -1
  72. package/layers/support/geospatialPDFUtils.d.ts +63 -0
  73. package/layers/support/geospatialPDFUtils.js +2 -0
  74. package/package.json +5 -5
  75. package/symbols/CIMSymbol.d.ts +9 -9
  76. package/symbols/PathSymbol3DLayer.d.ts +1 -1
  77. package/symbols/WaterSymbol3DLayer.d.ts +13 -1
  78. package/symbols/WaterSymbol3DLayer.js +1 -1
  79. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  80. package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
  81. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  82. package/views/3d/camera/intersectionUtils.js +1 -1
  83. package/views/3d/environment/EnvironmentView.js +1 -1
  84. package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
  85. package/views/3d/interactive/Manipulator3D.js +1 -1
  86. package/views/3d/interactive/Manipulator3DBase.js +1 -1
  87. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  88. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  89. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  90. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  91. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  92. package/views/3d/layers/DrapedSubView3D.js +1 -1
  93. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  94. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  95. package/views/3d/layers/FlowSubView3D.js +1 -1
  96. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  97. package/views/3d/layers/I3SMeshView3D.js +1 -1
  98. package/views/3d/layers/RouteLayerView3D.js +1 -1
  99. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  100. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  101. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  102. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  103. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  104. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  105. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  106. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  107. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  108. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  109. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  110. package/views/3d/layers/support/Tiles3DBVH.js +1 -1
  111. package/views/3d/layers/support/createTileBVHForLayer.js +1 -1
  112. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  113. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  114. package/views/3d/state/controllers/RotateController.js +1 -1
  115. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  116. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  117. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  118. package/views/3d/state/utils/navigationUtils.js +1 -1
  119. package/views/3d/support/QualityProfile.js +1 -1
  120. package/views/3d/support/QualitySettings.js +1 -1
  121. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  122. package/views/3d/terrain/BlendLayersTechniqueConfiguration.js +1 -1
  123. package/views/3d/terrain/OverlayManager.js +1 -1
  124. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  125. package/views/3d/terrain/RasterColorizerTechniqueConfiguration.js +1 -1
  126. package/views/3d/terrain/TerrainSurface.js +1 -1
  127. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  128. package/views/3d/webgl-engine/core/shaderLibrary/clampShadowPosition.glsl.js +2 -0
  129. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +14 -14
  130. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
  131. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -3
  132. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  133. package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
  134. package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
  135. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  136. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  137. package/views/3d/webgl-engine/lib/Program.js +1 -1
  138. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  139. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  140. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  141. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  142. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  143. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  144. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  145. package/views/3d/webgl-engine/parts/Model.js +1 -1
  146. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  147. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  148. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  149. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  150. package/views/Attribution.js +5 -5
  151. package/views/DOMContainer.d.ts +2 -1
  152. package/views/SceneView.js +1 -1
  153. package/views/draw/DrawGraphicTool.js +1 -1
  154. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  155. package/views/webgl/Program.js +3 -3
  156. package/views/webgl/ShaderBuilder.js +23 -23
  157. package/webscene/Slide.js +1 -1
  158. package/webscene/VirtualLighting.d.ts +2 -4
  159. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +17 -1
  160. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  161. package/widgets/BatchAttributeForm/inputs/support/inputUtils.d.ts +7 -0
  162. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  163. package/widgets/BatchAttributeForm.js +1 -1
  164. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  165. package/widgets/Sketch/SketchViewModel.js +1 -1
  166. package/widgets/Weather/WeatherViewModel.js +1 -1
  167. package/widgets/support/ContingentValuesManager.js +1 -1
  168. package/widgets/support/forms/types.d.ts +23 -1
  169. package/assets/esri/core/workers/chunks/144f18a3dd2c8cf07cf7.js +0 -1
  170. package/assets/esri/core/workers/chunks/23fc1c1ed483ed3b2298.js +0 -1
  171. package/assets/esri/core/workers/chunks/249a687ce1b6d0815242.js +0 -1
  172. package/assets/esri/core/workers/chunks/2634927d26cb1139c6d0.js +0 -1
  173. package/assets/esri/core/workers/chunks/2d1b8154ee40afc9d40b.js +0 -1
  174. package/assets/esri/core/workers/chunks/4a41bf3d1e2e9bb79771.js +0 -2
  175. package/assets/esri/core/workers/chunks/5f324d88785ffcb73ae0.js +0 -1
  176. package/assets/esri/core/workers/chunks/70695e0fb53018d48e7b.js +0 -2
  177. package/assets/esri/core/workers/chunks/723c9ad4c25be2b82476.js +0 -1
  178. package/assets/esri/core/workers/chunks/766a1357be2ed7f4e125.js +0 -1
  179. package/assets/esri/core/workers/chunks/844c593754b2692257f4.js +0 -1
  180. package/assets/esri/core/workers/chunks/846248697c398468d8e6.js +0 -1
  181. package/assets/esri/core/workers/chunks/89e55895683369b5277a.js +0 -1
  182. package/assets/esri/core/workers/chunks/8c94e987754b3919181e.js +0 -1
  183. package/assets/esri/core/workers/chunks/919115788da38049aea7.js +0 -2
  184. package/assets/esri/core/workers/chunks/a116dd204921e7464944.js +0 -1
  185. package/assets/esri/core/workers/chunks/b33e7e74cf8fa3926617.js +0 -1
  186. package/assets/esri/core/workers/chunks/bb2af16e55cb39163827.js +0 -1
  187. package/assets/esri/core/workers/chunks/d5bb9f9b7b341c671525.js +0 -1
  188. package/assets/esri/core/workers/chunks/d96e63d66f7b1f4ea54a.js +0 -2
  189. package/assets/esri/core/workers/chunks/e3bcd2e356f75afc316a.js +0 -1
  190. package/assets/esri/core/workers/chunks/e80526571f1a34de3278.js +0 -1
  191. package/assets/esri/core/workers/chunks/ea71850ba87ae6038000.js +0 -1
  192. package/assets/esri/core/workers/chunks/f537a5e808dc546813c7.js +0 -1
  193. package/assets/esri/core/workers/chunks/fe811d651d201f698b8f.js +0 -2
  194. package/chunks/NativeLine.glsl.js +0 -8
  195. package/layers/geospatialPDF/geospatialPDFParserUtils.js +0 -2
  196. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +0 -2
  197. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +0 -2
  198. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +0 -2
  199. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +0 -2
  200. /package/assets/esri/core/workers/chunks/{919115788da38049aea7.js.LICENSE.txt → 3d851710f7fcc27c5b60.js.LICENSE.txt} +0 -0
  201. /package/assets/esri/core/workers/chunks/{fe811d651d201f698b8f.js.LICENSE.txt → 5bdd95eeb8f34dbf26f2.js.LICENSE.txt} +0 -0
  202. /package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js.LICENSE.txt → 5e47026c681238038955.js.LICENSE.txt} +0 -0
  203. /package/assets/esri/core/workers/chunks/{4a41bf3d1e2e9bb79771.js.LICENSE.txt → d7763c42754152510e13.js.LICENSE.txt} +0 -0
  204. /package/assets/esri/core/workers/chunks/{d96e63d66f7b1f4ea54a.js.LICENSE.txt → e96fa029acba59c04e4e.js.LICENSE.txt} +0 -0
  205. /package/assets/esri/core/workers/chunks/{70695e0fb53018d48e7b.js.LICENSE.txt → fdfbd201be372d3796bf.js.LICENSE.txt} +0 -0
@@ -1,14 +1,14 @@
1
- "use strict";(Array.isArray(self.webpackChunkRemoteClient)?self.webpackChunkRemoteClient:self.webpackChunkRemoteClient=[]).push([[8040],{28491(e,t,r){r.d(t,{D:()=>F,b:()=>R});var i=r(14113),n=r(72722),o=r(96336),a=r(53466),s=r(72824),l=r(54154),c=r(9169),u=r(12696),d=r(32680),h=r(49255),f=r(77695),m=r(68785),p=r(28390),v=r(96777),g=r(62602),x=r(20598),_=r(22393),b=r(59469),y=r(56529),w=r(51406),M=r(89435),T=r(34711),S=r(71020),C=r(58614),A=r(20693),E=r(33079),I=r(31821),O=r(63761),P=r(24111),D=r(84368);function R(e){let t=new i.N5,{attributes:r,vertex:R,fragment:F,varyings:N}=t,{output:B,normalType:z,offsetBackfaces:L,snowCover:H,pbrMode:V,textureAlphaPremultiplied:U,instancedDoublePrecision:j,hasVertexColors:G,hasVertexTangents:k,hasColorTexture:W,hasNormalTexture:Z,hasNormalTextureTransform:$,hasColorTextureTransform:q}=e;if((0,A.N)(R,e),r.add("position","vec3"),R.inputs.add("position",()=>"position"),N.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(n.B,e),t.include(l.Ge,e),t.include(w.q2,e),!(0,h._o)(B))return t.include(c.E,e),t;t.include(w.Sx,e),t.include(w.MU,e),t.include(w.O1,e),t.include(w.QM,e),(0,A.y)(R,e),t.include(o.Y,e),t.include(S.d);let Y=0===z||1===z;return Y&&L&&t.include(d.M),t.include(f.J,e),t.include(s.Mh,e),N.add("vPositionLocal","vec3"),t.include(a.U,e),t.include(u.F,e),t.include(j?y.oD:y.rA,e),R.main.add(I.H`
1
+ "use strict";(Array.isArray(self.webpackChunkRemoteClient)?self.webpackChunkRemoteClient:self.webpackChunkRemoteClient=[]).push([[7143],{28491(e,t,r){r.d(t,{D:()=>R,b:()=>D});var i=r(14113),n=r(72722),o=r(96336),a=r(53466),s=r(54154),l=r(98440),c=r(12696),u=r(32680),d=r(49255),h=r(77695),f=r(68785),m=r(28390),p=r(96777),v=r(62602),g=r(20598),x=r(22393),_=r(59469),b=r(56529),y=r(51406),w=r(89435),M=r(34711),T=r(71020),S=r(58614),C=r(20693),A=r(33079),E=r(31821),I=r(63761),O=r(24111),P=r(84368);function D(e){let t=new i.N5,{attributes:r,vertex:D,fragment:R,varyings:F}=t,{output:B,normalType:N,offsetBackfaces:z,snowCover:L,pbrMode:H,textureAlphaPremultiplied:V,instancedDoublePrecision:U,hasVertexColors:j,hasVertexTangents:G,hasColorTexture:k,hasNormalTexture:W,hasNormalTextureTransform:$,hasColorTextureTransform:Z}=e;if((0,C.NB)(D,e),r.add("position","vec3"),D.inputs.add("position",()=>"position"),F.add("vpos","vec3",{invariant:!0}),t.include(w.A,e),t.include(n.B,e),t.include(s.Ge,e),t.include(y.q2,e),!(0,d._o)(B))return t.include(l.E,e),t;t.include(y.Sx,e),t.include(y.MU,e),t.include(y.O1,e),t.include(y.QM,e),(0,C.yu)(D,e),t.include(o.Y,e),t.include(T.d);let q=0===N||1===N;return q&&(F.add("vNormalWorld","vec3"),z&&t.include(u.M)),t.include(h.J,e),F.add("vPositionLocal","vec3"),t.include(a.U,e),t.include(c.F,e),t.include(U?b.oD:b.rA,e),D.main.add(E.H`
2
2
  forwardDefaultMaterialExternalColor();
3
3
 
4
4
  vpos = getVertexInLocalOriginSpace();
5
5
  vPositionLocal = vpos - view[3].xyz;
6
6
  vpos = subtractOrigin(vpos);
7
- ${(0,I.If)(Y,"vNormalWorld = dpNormal(vvLocalNormal(normal));")}
7
+ ${(0,E.If)(q,"vNormalWorld = dpNormal(vvLocalNormal(normal));")}
8
8
  vpos = addVerticalOffset(vpos, localOrigin);
9
- ${(0,I.If)(k,"vTangent = dpTransformVertexTangent(tangent);")}
9
+ ${(0,E.If)(G,"vTangent = dpTransformVertexTangent(tangent);")}
10
10
  gl_Position = transformPosition(proj, view, vpos);
11
- ${(0,I.If)(Y&&L,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
11
+ ${(0,E.If)(q&&z,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
12
12
 
13
13
  forwardTextureCoordinates();
14
14
  forwardColorUV();
@@ -21,16 +21,16 @@
21
21
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
22
22
  }
23
23
  forwardLinearDepthToReadShadow();
24
- `),F.include(p.k,e),F.include(m.n,e),t.include(C.SS,e),F.include(T.zM,e),t.include(D.D,e),(0,A.y)(F,e),F.uniforms.add(R.uniforms.get("localOrigin"),new E.t("ambient",e=>e.ambient),new E.t("diffuse",e=>e.diffuse)),W&&F.uniforms.add(new O.N("tex",e=>e.texture)),t.include(b._Z,e),F.include(_.c,e),t.include(g.r,e),F.include(P.Y,e),F.include(x.n,e),(0,p.a)(F),F.uniforms.add(v.VW,v.VK).main.add(I.H`
24
+ `),R.include(m.k,e),R.include(f.n,e),t.include(S.SS,e),R.include(M.zM,e),t.include(P.D,e),(0,C.yu)(R,e),R.uniforms.add(D.uniforms.get("localOrigin"),new A.t("ambient",e=>e.ambient),new A.t("diffuse",e=>e.diffuse)),k&&R.uniforms.add(new I.N("tex",e=>e.texture)),t.include(_._Z,e),R.include(x.c,e),t.include(v.r,e),R.include(O.Y,e),R.include(g.n,e),(0,m.a)(R),R.uniforms.add(p.VW,p.VK).main.add(E.H`
25
25
  discardBySlice(vpos);
26
- ${W?I.H`
27
- vec4 texColor = texture(tex, ${q?"colorUV":"vuv0"});
28
- ${(0,I.If)(U,"texColor.rgb /= texColor.a;")}
26
+ ${k?E.H`
27
+ vec4 texColor = texture(tex, ${Z?"colorUV":"vuv0"});
28
+ ${(0,E.If)(V,"texColor.rgb /= texColor.a;")}
29
29
  discardOrAdjustAlpha(texColor);`:"vec4 texColor = vec4(1.0);"}
30
30
  vec3 viewDirection = normalize(vpos - cameraPosition);
31
31
  vec3 posWorld = vpos + localOrigin;
32
32
  vec3 upNormal = getLocalUp(posWorld);
33
- ${2===z?"vec3 normal = screenDerivativeNormal(vPositionLocal);":"vec3 normal = shadingNormal(vNormalWorld, viewDirection);"}
33
+ ${2===N?"vec3 normal = screenDerivativeNormal(vPositionLocal);":"vec3 normal = shadingNormal(vNormalWorld, viewDirection);"}
34
34
  applyPBRFactors();
35
35
  float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
36
36
 
@@ -39,25 +39,25 @@
39
39
 
40
40
  vec3 matColor = max(ambient, diffuse);
41
41
  vec3 albedo = mixExternalColor(
42
- ${(0,I.If)(G,"vColor.rgb *")} matColor,
42
+ ${(0,E.If)(j,"vColor.rgb *")} matColor,
43
43
  texColor.rgb,
44
44
  vExternalColor.rgb,
45
45
  int(colorMixMode)
46
46
  );
47
47
  float opacity_ = getDefaultMaterialOpacity(texColor.a);
48
48
 
49
- ${Z?`mat3 tangentSpace = computeTangentSpace(${k?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${$?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
49
+ ${W?`mat3 tangentSpace = computeTangentSpace(${G?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${$?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
50
50
 
51
51
  float snow = applySnow(normal, upNormal, albedo, ssao);
52
- ${(0,I.If)(H,"shadingNormal = mix(shadingNormal, normal, snow);")}
52
+ ${(0,E.If)(L,"shadingNormal = mix(shadingNormal, normal, snow);")}
53
53
 
54
54
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
55
- ${(0,I.If)((1===V||2===V)&&H,"applySnowToMRR(snow);")}
55
+ ${(0,E.If)((1===H||2===H)&&L,"applySnowToMRR(snow);")}
56
56
 
57
57
  vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, upNormal);
58
58
  vec4 finalColor = vec4(shadedColor, opacity_);
59
59
  outputColorHighlightOLID(applySlice(finalColor, vpos), albedo, snow);
60
- `),t}const F=Object.freeze(Object.defineProperty({__proto__:null,build:R},Symbol.toStringTag,{value:"Module"}))},57323(e,t,r){r.d(t,{R:()=>P,b:()=>O});var i=r(14113),n=r(72722),o=r(96336),a=r(53466),s=r(54154),l=r(9169),c=r(12696),u=r(32680),d=r(49255),h=r(68785),f=r(28390),m=r(96777),p=r(20598),v=r(22393),g=r(59469),x=r(56529),_=r(51406),b=r(89435),y=r(34711),w=r(71020),M=r(58614),T=r(20693),S=r(33079),C=r(31821),A=r(63761),E=r(24111),I=r(84368);function O(e){let t=new i.N5,{attributes:r,vertex:O,fragment:P,varyings:D}=t,{output:R,offsetBackfaces:F,pbrMode:N,snowCover:B}=e,z=1===N||2===N;if((0,T.N)(O,e),r.add("position","vec3"),O.inputs.add("position",()=>"position"),D.add("vpos","vec3",{invariant:!0}),t.include(b.A,e),t.include(n.B,e),t.include(s.Ge,e),t.include(_.q2,e),!(0,d._o)(R))return t.include(l.E,e),t;t.include(_.MU,e),(0,T.y)(t.vertex,e),t.include(o.Y,e),t.include(w.d),F&&t.include(u.M),D.add("vNormalWorld","vec3"),D.add("localvpos","vec3",{invariant:!0}),t.include(a.U,e),t.include(c.F,e),t.include(e.instancedDoublePrecision?x.oD:x.rA,e),O.main.add(C.H`
60
+ `),t}const R=Object.freeze(Object.defineProperty({__proto__:null,build:D},Symbol.toStringTag,{value:"Module"}))},57323(e,t,r){r.d(t,{R:()=>P,b:()=>O});var i=r(14113),n=r(72722),o=r(96336),a=r(53466),s=r(54154),l=r(98440),c=r(12696),u=r(32680),d=r(49255),h=r(68785),f=r(28390),m=r(96777),p=r(20598),v=r(22393),g=r(59469),x=r(56529),_=r(51406),b=r(89435),y=r(34711),w=r(71020),M=r(58614),T=r(20693),S=r(33079),C=r(31821),A=r(63761),E=r(24111),I=r(84368);function O(e){let t=new i.N5,{attributes:r,vertex:O,fragment:P,varyings:D}=t,{output:R,offsetBackfaces:F,pbrMode:B,snowCover:N}=e,z=1===B||2===B;if((0,T.NB)(O,e),r.add("position","vec3"),O.inputs.add("position",()=>"position"),D.add("vpos","vec3",{invariant:!0}),t.include(b.A,e),t.include(n.B,e),t.include(s.Ge,e),t.include(_.q2,e),!(0,d._o)(R))return t.include(l.E,e),t;t.include(_.MU,e),(0,T.yu)(t.vertex,e),t.include(o.Y,e),t.include(w.d),F&&t.include(u.M),D.add("vNormalWorld","vec3"),D.add("localvpos","vec3",{invariant:!0}),t.include(a.U,e),t.include(c.F,e),t.include(e.instancedDoublePrecision?x.oD:x.rA,e),O.main.add(C.H`
61
61
  forwardDefaultMaterialExternalColor();
62
62
 
63
63
  vpos = getVertexInLocalOriginSpace();
@@ -75,7 +75,7 @@
75
75
 
76
76
  gl_Position = shouldCullByOpacity() ? vec4(1e38, 1e38, 1e38, 1.0) :
77
77
  ${(0,C.If)(F,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
78
- `);let{hasColorTexture:L,hasColorTextureTransform:H}=e;return P.include(f.k,e),P.include(h.n,e),t.include(M.SS,e),P.include(y.zM,e),t.include(I.D,e),(0,T.y)(P,e),(0,f.a)(P),P.uniforms.add(m.t_,m.VW,O.uniforms.get("localOrigin"),O.uniforms.get("view"),new S.t("ambient",e=>e.ambient),new S.t("diffuse",e=>e.diffuse)),L&&P.uniforms.add(new A.N("tex",e=>e.texture)),t.include(g._Z,e),P.include(v.c,e),P.include(E.Y,e),P.include(p.n,e),P.uniforms.add(m.VK).main.add(C.H`
78
+ `);let{hasColorTexture:L,hasColorTextureTransform:H}=e;return P.include(f.k,e),P.include(h.n,e),t.include(M.SS,e),P.include(y.zM,e),t.include(I.D,e),(0,T.yu)(P,e),(0,f.a)(P),P.uniforms.add(m.t_,m.VW,O.uniforms.get("localOrigin"),O.uniforms.get("view"),new S.t("ambient",e=>e.ambient),new S.t("diffuse",e=>e.diffuse)),L&&P.uniforms.add(new A.N("tex",e=>e.texture)),t.include(g._Z,e),P.include(v.c,e),P.include(E.Y,e),P.include(p.n,e),P.uniforms.add(m.VK).main.add(C.H`
79
79
  discardBySlice(vpos);
80
80
  vec4 texColor = ${L?`texture(tex, ${H?"colorUV":"vuv0"})`:" vec4(1.0)"};
81
81
  ${(0,C.If)(L,`${(0,C.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
@@ -99,7 +99,7 @@
99
99
  vec3 viewDirection = normalize(vpos - cameraPosition);
100
100
  vec3 upNormal = getLocalUp(vpos, localOrigin);
101
101
 
102
- ${(0,C.If)(B,"vec3 faceNormal = screenDerivativeNormal(vpos);\n float snow = applyRealisticTreeSnow(faceNormal, shadingNormal, upNormal, albedo, ssao);\n ")}
102
+ ${(0,C.If)(N,"vec3 faceNormal = screenDerivativeNormal(vpos);\n float snow = applyRealisticTreeSnow(faceNormal, shadingNormal, upNormal, albedo, ssao);\n ")}
103
103
 
104
104
  ${C.H`albedo *= 1.2;
105
105
  vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
@@ -109,11 +109,11 @@
109
109
  float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
110
110
  additionalLight += backLightFactor * mainLightIntensity;`}
111
111
 
112
- ${(0,C.If)(z&&B,"applySnowToMRR(snow);")}
112
+ ${(0,C.If)(z&&N,"applySnowToMRR(snow);")}
113
113
 
114
114
  vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, upNormal);
115
115
  vec4 finalColor = vec4(shadedColor, opacity_);
116
- outputColorHighlightOLID(applySlice(finalColor, vpos), albedo, ${(0,C.If)(B,"1.0","0.0")});
116
+ outputColorHighlightOLID(applySlice(finalColor, vpos), albedo, ${(0,C.If)(N,"1.0","0.0")});
117
117
  `),t}const P=Object.freeze(Object.defineProperty({__proto__:null,build:O},Symbol.toStringTag,{value:"Module"}))},15581(e,t,r){r.d(t,{S:()=>_,b:()=>v,g:()=>g});var i=r(37585),n=r(48163),o=r(14113),a=r(83068),s=r(82048),l=r(65261),c=r(34845),u=r(77108),d=r(47286),h=r(33094),f=r(20304),m=r(31821),p=r(63761);function v(){let e=new o.N5,t=e.fragment;return e.include(s.c),e.include(c.Ir),t.include(a.E),t.include(l.C),t.uniforms.add(new h.U("radius",e=>g(e.camera))).code.add(m.H`vec3 sphere[16] = vec3[16](
118
118
  vec3(0.186937, 0.0, 0.0),
119
119
  vec3(0.700542, 0.0, 0.0),
@@ -218,7 +218,7 @@ return fallOffFunction(vv, vn, 0.1);
218
218
  vec2 uvOffset = uv + rf * blurSize;
219
219
  blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
220
220
  }
221
- fragBlur = b / w_total;`),e}const h=Object.freeze(Object.defineProperty({__proto__:null,build:d},Symbol.toStringTag,{value:"Module"}))},43609(e,t,r){r.d(t,{a:()=>o,f:()=>a,n:()=>n});var i=r(34275);function n(e,t){o(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r=2,n=r){let o=t.length/2,a=0,s=0;if(!(0,i.iu)(t)||(0,i.dk)(t)){for(let i=0;i<o;++i)e[a]=t[s],e[a+1]=t[s+1],a+=r,s+=n;return}let l=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<o;++i)e[a]=Math.max(t[s]/l,-1),e[a+1]=Math.max(t[s+1]/l,-1),a+=r,s+=n;else for(let i=0;i<o;++i)e[a]=t[s]/l,e[a+1]=t[s+1]/l,a+=r,s+=n}function a(e,t,r,i){let n=e.typedBuffer,o=e.typedBufferStride,a=i?.count??e.count,s=(i?.dstIndex??0)*o;for(let e=0;e<a;++e)n[s]=t,n[s+1]=r,s+=o}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:o,normalizeIntegerBufferView:n},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>d,b:()=>s,c:()=>n,d:()=>a,e:()=>h,f:()=>u,l:()=>c,n:()=>f,t:()=>o}),r(44208);var i=r(72727);function n(e,t,r){o(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r,n=3,o=n){let a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s),c=r[0],u=r[1],d=r[2],h=r[4],f=r[5],m=r[6],p=r[8],v=r[9],g=r[10],x=r[12],_=r[13],b=r[14],y=0,w=0;for(let r=0;r<l;r++){let r=t[y],i=t[y+1],a=t[y+2];e[w]=c*r+h*i+p*a+x,e[w+1]=u*r+f*i+v*a+_,e[w+2]=d*r+m*i+g*a+b,y+=o,w+=n}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,n=3,o=n){let a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s),c=r[0],u=r[1],d=r[2],h=r[3],f=r[4],m=r[5],p=r[6],v=r[7],g=r[8],x=0,_=0;for(let r=0;r<l;r++){let r=t[x],i=t[x+1],a=t[x+2];e[_]=c*r+h*i+p*a,e[_+1]=u*r+f*i+v*a,e[_+2]=d*r+m*i+g*a,x+=o,_+=n}}function l(e,t,r,i=3,n=i){let o=Math.min(e.length/i,t.length/n),a=0,s=0;for(let l=0;l<o;l++)e[s]=r*t[a],e[s+1]=r*t[a+1],e[s+2]=r*t[a+2],a+=n,s+=i;return e}function c(e,t,r,i){u(e.typedBuffer,t.typedBuffer,r,i,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r,i,n=3,o=n){let a=Math.min(e.length/n,t.length/o),s=0,l=0,c=1/2.2;for(let u=0;u<a;u++)e[l]=i*(r*t[s])**c,e[l+1]=i*(r*t[s+1])**c,e[l+2]=i*(r*t[s+2])**c,s+=o,l+=n}function d(e,t,r,n=3,o=n){let a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s),c=0,u=0;for(let i=0;i<l;i++)e[u]=t[c]+r[0],e[u+1]=t[c+1]+r[1],e[u+2]=t[c+2]+r[2],c+=o,u+=n;return e}function h(e,t){f(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function f(e,t,r=3,i=r){let n=Math.min(e.length/r,t.length/i),o=0,a=0;for(let s=0;s<n;s++){let n=t[o],s=t[o+1],l=t[o+2],c=n*n+s*s+l*l;if(c>0){let t=1/Math.sqrt(c);e[a]=t*n,e[a+1]=t*s,e[a+2]=t*l}o+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:u,linearToSRGBView:c,normalize:f,normalizeView:h,scale:l,scaleView:function(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){let i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride,l=0,c=0;for(let e=0;e<i;e++)n[c]=a[l]>>r,n[c+1]=a[l+1]>>r,n[c+2]=a[l+2]>>r,l+=s,c+=o},transformMat3:s,transformMat3View:a,transformMat4:o,transformMat4View:n,translate:d},Symbol.toStringTag,{value:"Module"}))},50867(e,t,r){r.d(t,{a:()=>n,b:()=>c,l:()=>l,n:()=>a,t:()=>o}),r(44208);var i=r(72727);function n(e,t,r){o(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r,n=4,o=n){let a=(0,i.k)(e.length,n,4),s=(0,i.k)(t.length,o,4),l=Math.min(a,s),c=r[0],u=r[1],d=r[2],h=r[3],f=r[4],m=r[5],p=r[6],v=r[7],g=r[8],x=0,_=0;for(let r=0;r<l;r++){let r=t[x],i=t[x+1],a=t[x+2],s=t[x+3];e[_]=c*r+h*i+p*a,e[_+1]=u*r+f*i+v*a,e[_+2]=d*r+m*i+g*a,e[_+3]=s,x+=o,_+=n}}function a(e,t){let r=Math.min(e.count,t.count),i=e.typedBuffer,n=e.typedBufferStride,o=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){let t=e*n,r=e*a,s=o[r],l=o[r+1],c=o[r+2],u=s*s+l*l+c*c;if(u>0){let e=1/Math.sqrt(u);i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function s(e,t,r,i=4){let n=Math.min(e.length/i,t.count),o=t.typedBuffer,a=t.typedBufferStride,s=0,l=0;for(let t=0;t<n;t++)e[l]=r*o[s],e[l+1]=r*o[s+1],e[l+2]=r*o[s+2],e[l+3]=r*o[s+3],s+=a,l+=i}function l(e,t,r,i){c(e.typedBuffer,t,r,i,e.typedBufferStride)}function c(e,t,r,i,n=4){let o=Math.min(e.length/n,t.count),a=t.typedBuffer,s=t.typedBufferStride,l=0,c=0,u=1/2.2;for(let t=0;t<o;t++)e[c]=i*(r*a[l])**u,e[c+1]=i*(r*a[l+1])**u,e[c+2]=i*(r*a[l+2])**u,e[c+3]=i*r*a[l+3],l+=s,c+=n}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:l,normalize:a,scale:s,scaleView:function(e,t,r){s(e.typedBuffer,t,r,e.typedBufferStride)},transformMat3:o,transformMat3View:n,transformMat4:function(e,t,r,n=4,o=n){let a=(0,i.k)(e.length,n,4),s=(0,i.k)(t.length,o,4),l=Math.min(a,s),c=r[0],u=r[1],d=r[2],h=r[3],f=r[4],m=r[5],p=r[6],v=r[7],g=r[8],x=r[9],_=r[10],b=r[11],y=r[12],w=r[13],M=r[14],T=r[15],S=0,C=0;for(let r=0;r<l;r++){let r=t[S],i=t[S+1],a=t[S+2],s=t[S+3];e[C]=c*r+f*i+g*a+y*s,e[C+1]=u*r+m*i+x*a+w*s,e[C+2]=d*r+p*i+_*a+M*s,e[C+3]=h*r+v*i+b*a+T*s,S+=o,C+=n}},transformMat4View:function(e,t,r){let n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride,l=(0,i.k)(n.length,o,4),c=(0,i.k)(a.length,s,4),u=Math.min(l,c),d=r[0],h=r[1],f=r[2],m=r[3],p=r[4],v=r[5],g=r[6],x=r[7],_=r[8],b=r[9],y=r[10],w=r[11],M=r[12],T=r[13],S=r[14],C=r[15];for(let e=0;e<u;e++){let t=e*o,r=e*s,i=a[r],l=a[r+1],c=a[r+2],u=a[r+3];n[t]=d*i+p*l+_*c+M*u,n[t+1]=h*i+v*l+b*c+T*u,n[t+2]=f*i+g*l+y*c+S*u,n[t+3]=m*i+x*l+w*c+C*u}}},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>n});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);let 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));r.d(t,["ie",0,l,"uC",0,s])},46140(e,t,r){r.d(t,{A:()=>n});var i=r(49186);class n{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)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){let 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 n(this.major,this.minor,this._context)}static parse(e,t=""){let[r,o]=e.split(".",2),a=/^\s*\d+\s*$/;if(!r?.match||!a.test(r)){let r=t&&t+":";throw new i.A(r+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e})}if(!o?.match||!a.test(o)){let r=t&&t+":";throw new i.A(r+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e})}return new n(parseInt(r,10),parseInt(o,10),t)}}},61473(e,t,r){function i(e){return e||=globalThis.location.hostname,c.some(t=>null!=e?.match(t))}function n(e,t){return e?(t||=globalThis.location.hostname,t?null!=t.match(o)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e):null}r.d(t,{EM:()=>n,b5:()=>i});const o=/^devext\.arcgis\.com$/,a=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,o,a,/^jsapps\.esri\.com$/,s,l]},18370(e,t,r){r.d(t,{z:()=>n});class i{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return this._promise??=this._import().then(async e=>(this.module=e,e)),this._promise}}function n(e){return new i(e)}},88340(e,t,r){function i(){return new Float32Array(2)}function n(e,t){let r=new Float32Array(2);return r[0]=e,r[1]=t,r}function o(){return i()}function a(){return n(1,1)}function s(){return n(1,0)}function l(){return n(0,1)}r.d(t,{Un:()=>u,fA:()=>n,uY:()=>c,vt:()=>i});const c=o(),u=a(),d=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){let t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:n,ones:a,unitX:s,unitY:l,zeros:o},Symbol.toStringTag,{value:"Module"}))},69397(e,t,r){r.d(t,{JY:()=>f,Qf:()=>l,Qh:()=>a,lM:()=>o,ro:()=>c,rq:()=>u});var i=r(44208),n=r(34275);function o(e){if(!e)return 0;let t=d;for(let r in e)e.hasOwnProperty(r)&&(t+=s(e[r],!1));return t}function a(e){if(!e)return 0;if("number"==typeof e[0])return l(e);if(Array.isArray(e))return function(e){let t=e.length;if(0===t||"number"==typeof e[0])return u(e,8);let r=h;for(let i=0;i<t;i++)r+=s(e[i]);return r}(e);let t=d;for(let r in e)e.hasOwnProperty(r)&&(t+=s(e[r]));return t}function s(e,t=!0){switch(typeof e){case"object":return t?a(e):d;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function l(...e){return e.reduce((e,t)=>e+c(t),0)}function c(e,t=16){return e?(0,n.iu)(e)?e.byteLength+m:Array.isArray(e)?u(e,t):0:0}function u(e,t){return h+e.length*t}const d=32,h=16,f=(0,i.A)("ios")||!(0,i.A)("chrome")&&!(0,i.A)("opr")?8:4,m=145},65806(e,t,r){r.d(t,{g:()=>a});var i=r(51850),n=r(99917),o=r(9762);function a(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r))return s[0]=e.x,s[1]=e.y,s[2]=e.z??0,(0,o.projectBuffer)(s,e.spatialReference,0,t,r,0);let a=(0,n.tryProject)(e,r,i);return!!a&&(t[0]=a.x,t[1]=a.y,t[2]=a.z??0,!0)}const s=(0,i.vt)()},27993(e,t,r){r.d(t,{F:()=>s});var i=r(99917),n=r(16930),o=r(9762),a=r(65806);function s(e,t,r,n){return!(null==t||null==n||e.length<2)&&((0,i.canProjectWithoutEngine)(t,n)?(0,o.projectBuffer)(e,t,0,r,n,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,a.g)(l,r,n)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:n.A.WGS84,type:"point"}},97146(e,t,r){r.d(t,{Dg:()=>o,lc:()=>d,my:()=>a,tM:()=>h,uW:()=>n});var i=r(34275);function n(e){return o(e,!0)}function o(e,t){if(Array.isArray(e)){if(e.length<1024)return e}else if(e.length<1024)return Array.from(e);let r=!0,n=!0;return e.some((e,t)=>(r&&=0===e,n&&=e===t,!r&&!n)),r?function(e){if(1===e)return c;if(e<1024)return Array(e).fill(0);if(e>l.length){let t=Math.max(2*l.length,e);l=new Uint8Array(t)}return new Uint8Array(l.buffer,0,e)}(e.length):n?h(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(let r of e){if(r>=65536)return(0,i.iu)(e)?e:new Uint32Array(e);r>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function a(e,t=e){return e<=1024?Array(e):t<=65536?new Uint16Array(e):new Uint32Array(e)}let s=f(131072),l=new Uint8Array(65536);const c=[0],u=(()=>{let e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function d(e){if(e===c)return!0;if(!(0,i.iu)(e))return!1;let{buffer:t}=e;return t===u.buffer||t===s.buffer||t===l.buffer}function h(e){return 1===e?c:e<1024?function(e){let t=Array(e).fill(0);for(let r=0;r<e;r++)t[r]=r;return t}(e):e<u.length?new Uint16Array(u.buffer,0,e):(e>s.length&&(s=f(Math.max(2*s.length,e))),new Uint32Array(s.buffer,0,e))}function f(e){let t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}},72727(e,t,r){function i(e,t,r){if(t<=0)return 0;let i=e-r;return i<0?0:Math.floor(i/t)+1}r.d(t,{k:()=>i}),r(53966)},65720(e,t,r){r.d(t,{C:()=>g,vt:()=>p,Qy:()=>v,ui:()=>x,ST:()=>T,bU:()=>C,pw:()=>M,m7:()=>_,ZU:()=>b,GH:()=>w,Pi:()=>y,LJ:()=>S,c8:()=>I});var i=r(58083),n=r(35522),o=r(51850),a=r(78955),s=r(91829),l=r(4341),c=r(70328),u=r(71351);function d(e){return e?{ray:(0,u.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,u.vt)(),c0:0,c1:Number.MAX_VALUE}}new l.I(()=>d());var h=r(27921);function f(e,t,r,i){let{t0:n,t1:o}=i,a=(0,h.mN)(e,t),s=(0,h.mN)(e,r);if(a>=0&&s>=0)return!1;if(a<0&&s>=0){let e=-a/(s-a);if(e<n)return!1;e<o&&(o=e)}else if(a>=0&&s<0){let e=a/(a-s);if(e>o)return!1;e>n&&(n=e)}return i.t0=n,i.t1=o,!0}var m=r(32114);function p(e){return e?[(0,h.vt)(e[0]),(0,h.vt)(e[1]),(0,h.vt)(e[2]),(0,h.vt)(e[3]),(0,h.vt)(e[4]),(0,h.vt)(e[5])]:[(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)()]}function v(){return[(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)()]}function g(e,t){for(let r=0;r<O;r++)(0,h.C)(e[r],t[r]);return e}function x(e,t,r,o=F){let s=(0,i.lw)(m.Rc.get(),t,e);(0,i.B8)(s,s);for(let e=0;e<P;++e){let t=(0,a.Z0)(m.Km.get(),D[e],s);(0,n.hZ)(o[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}var l,c;l=r,c=o,(0,h.Cr)(c[4],c[0],c[3],l[0]),(0,h.Cr)(c[1],c[5],c[6],l[1]),(0,h.Cr)(c[4],c[5],c[1],l[2]),(0,h.Cr)(c[3],c[2],c[6],l[3]),(0,h.Cr)(c[0],c[1],c[2],l[4]),(0,h.Cr)(c[5],c[4],c[7],l[5])}function _(e,t){return b(e,t.center,t.radius)}function b(e,t,r){for(let i=0;i<O;i++){let n=e[i];if(n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]>=r)return!1}return!0}function y(e,t,r){for(let i of E)if((0,h.wE)(e[i],t,r))return!0;return!1}function w(e,t,r){let i=(0,c.gX)(t,N),o=(0,c.VL)(t)/2,a=(0,c.yr)(t)/2,s=(0,c.uJ)(t)/2;return r?function(e,t,r,i,o,a){let s=(0,n.Z0)(B,t,a);for(let t=0;t<O;t++){let n=e[t];if(n[0]*s[0]+n[1]*s[1]+n[2]*s[2]+n[3]-(Math.abs(n[0]*a[0]+n[1]*a[1]+n[2]*a[2])*r+Math.abs(n[0]*a[4]+n[1]*a[5]+n[2]*a[6])*i+Math.abs(n[0]*a[8]+n[1]*a[9]+n[2]*a[10])*o)>0)return!1}return!0}(e,i,o,a,s,r):function(e,t,r,i,n){for(let o=0;o<O;o++){let a=e[o];if(a[0]*t[0]+a[1]*t[1]+a[2]*t[2]+a[3]-(Math.abs(a[0])*r+Math.abs(a[1])*i+Math.abs(a[2])*n)>0)return!1}return!0}(e,i,o,a,s)}function M(e,t){return A(e,function(e,t=d()){return(0,u.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,R.get()))}function T(e,t,r){return A(e,function(e,t,r=d()){let i=(0,n.Bw)(e.vector);return(0,u.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,R.get()))}function S(e,t,r){return function(e,t,r,i){let n={t0:0,t1:1};for(let o of t)if(!f(e[o],r,i,n))return!1;return n.t0<n.t1}(e,E,t,r)}function C(e,t){for(let r=0;r<O;r++)if((0,h.mN)(e[r],t)>0)return!1;return!0}function A(e,t){for(let r=0;r<O;r++)if(!(0,h.$Q)(e[r],t))return!1;return!0}const E=[0,1,2,3,5],I={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},O=6,P=8,D=[(0,s.fA)(-1,-1,-1,1),(0,s.fA)(1,-1,-1,1),(0,s.fA)(1,1,-1,1),(0,s.fA)(-1,1,-1,1),(0,s.fA)(-1,-1,1,1),(0,s.fA)(1,-1,1,1),(0,s.fA)(1,1,1,1),(0,s.fA)(-1,1,1,1)],R=new l.I(d),F=v(),N=(0,o.vt)(),B=(0,o.vt)()},11964(e,t,r){r.d(t,{Cr:()=>u,LV:()=>c,_I:()=>d,vt:()=>l});var i=r(35522),n=r(51850),o=r(34727),a=r(4341),s=r(32114);function l(e){return e?{origin:(0,n.o8)(e.origin),vector:(0,n.o8)(e.vector)}:{origin:(0,n.vt)(),vector:(0,n.vt)()}}function c(e,t){let r=h.get();return r.origin=e,r.vector=t,r}function u(e,t,r=l()){return(0,i.C)(r.origin,e),(0,i.Re)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,n,a){let{vector:l,origin:c}=e,u=(0,i.Re)(s.rq.get(),t,c),d=(0,i.Om)(l,u)/(0,i.m3)(l);return(0,i.hs)(a,l,(0,o.qE)(d,0,1)),(0,i.WQ)(a,a,e.origin)}(e,t,0,0,r)}(0,n.vt)(),(0,n.vt)();const h=new a.I(()=>l())},52039(e,t,r){r.d(t,{O7:()=>h,Y_:()=>m,el:()=>c});var i=r(69052),n=(r(49186),r(18370)),o=r(17676),a=(r(5443),r(39829)),s=(r(82799),r(16930)),l=(r(80754),r(21325));async function c(e,t,r){Array.isArray(e)||(e=[e]),"object"==typeof t&&t&&"authMode"in t&&(r=t);let i=null;for(let t of e)i??=t?.spatialReference;if(!i)return e;let n=(0,l.Vp)(i);if(!n)return e;if(1===e.length&&"extent"===e[0]?.type){let t=e[0].clone().normalizeAsSingleGeometry(n);return["xmin"in t?t:new a.A(t)]}let[s,c]=n.valid,h=!1;for(let t of e){if(!t)continue;if("point"===t.type){h||=t.x>=c,h||=t.x<=s;continue}let{extent:e}=t;if(null==e){h=!0;break}h||=e.xmin>=c,h||=e.xmin<=s,h||=e.xmax>=c,h||=e.xmax<=s}if(!h)return e;let[{foldInto360Range:f},m]=await(0,o.qr)(Promise.all([u.getImportPromise(),d.getImportPromise()]),r),p=m.fromSpatialReference(i);return e.map(e=>{if(null==e||"mesh"===e.type)return e;let t=m.fromGeometry(e),r=m.toGeometry(f(t,p),i);return"extent"===e.type&&1===r?.rings.length?r.extent:r})}const u=(0,n.z)(()=>r.e(4144).then(()=>r(4144)).then(e=>e.load().then(()=>e))),d=(0,n.z)(()=>Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(1550)]).then(()=>r(78125)));function h(e,t,r){let i=(0,l.Vp)(r);if(null==i)return e;let[n,o]=i.valid,a=2*o,s=0,c=0;t>o?s=Math.ceil(Math.abs(t-o)/a):t<n&&(s=-Math.ceil(Math.abs(t-n)/a)),e>o?c=Math.ceil(Math.abs(e-o)/a):e<n&&(c=-Math.ceil(Math.abs(e-n)/a));let u=e+(s-c)*a,d=u-t;return d>o?u-=a:d<n&&(u+=a),u}function f(e){let t=(0,l.Vp)(e);if(null==t)return null;let[r,n]=t.valid;return new i.hr(r,n)}const m=f(s.A.WGS84);f(s.A.WebMercator)},48295(e,t,r){r.d(t,{BU:()=>u,Ui:()=>s,cq:()=>c,k3:()=>d,rb:()=>h});var i=r(35522),n=r(51850),o=r(4341),a=r(11964);function s(e,t,r){let{direction:n,origin:o}=t,{p0:a,p1:s,p2:l}=e,c=s[0]-a[0],u=s[1]-a[1],d=s[2]-a[2],h=l[0]-a[0],f=l[1]-a[1],m=l[2]-a[2],p=n[1]*m-f*n[2],v=n[2]*h-m*n[0],g=n[0]*f-h*n[1],x=c*p+u*v+d*g;if(x>-1e-5&&x<1e-5)return!1;let _=1/x,b=o[0]-a[0],y=o[1]-a[1],w=o[2]-a[2],M=_*(b*p+y*v+w*g);if(M<0||M>1)return!1;let T=y*d-u*w,S=w*c-d*b,C=b*u-c*y,A=_*(n[0]*T+n[1]*S+n[2]*C);if(A<0||M+A>1)return!1;if(r){let e=_*(h*T+f*S+m*C);(0,i.hs)(r,n,e),(0,i.WQ)(r,o,r)}return!0}function l(e,t,r){let[i,n]=e,[o,a]=t,[s,l]=r;return.5*((o-i)*(l-n)-(a-n)*(s-i))}function c(e,t,r,i,n=0){let o=l(i,e,t),a=l(i,t,r),s=l(i,r,e);return!((o<-n||a<-n||s<-n)&&(o>n||a>n||s>n))}function u(e,t,r){return(0,i.Re)(f,t,e),(0,i.Re)(m,r,e),.5*(0,i.Bw)((0,i.$A)(f,f,m))}function d(e,t,r,n,o){(0,i.jb)(f,n,r),(0,i.jb)(p,o,r),(0,i.jb)(m,t,r);let a=(0,i.Om)(f,m),s=(0,i.Om)(p,m);if(a<=0&&s<=0)return void(0,i.C)(e,r);(0,i.jb)(m,t,n);let l=(0,i.Om)(f,m),c=(0,i.Om)(p,m);if(l>=0&&c<=l)return void(0,i.C)(e,n);let u=a*c-l*s;if(u<=0&&a>=0&&l<=0)return void(0,i.Ln)(e,r,f,a/(a-l));(0,i.jb)(m,t,o);let d=(0,i.Om)(f,m),h=(0,i.Om)(p,m);if(h>=0&&d<=h)return void(0,i.C)(e,o);let v=d*s-a*h;if(v<=0&&s>=0&&h<=0)return void(0,i.Ln)(e,r,p,s/(s-h));let g=l*h-d*c;if(g<=0&&c-l>=0&&d-h>=0)return(0,i.jb)(m,o,n),void(0,i.Ln)(e,n,m,(c-l)/(c-l+(d-h)));let x=1/(g+v+u);(0,i.C)(e,r),(0,i.Ln)(e,e,f,v*x),(0,i.Ln)(e,e,p,u*x)}function h(e,t,r,n){(0,i.jb)(f,r,t),(0,i.jb)(m,n,t),(0,i.$A)(e,f,m);let o=(0,i.Bw)(e);return 0!==o&&((0,i.hs)(e,e,1/o),!0)}r(32114),new o.I(a.vt),new o.I(()=>{return e?{p0:(0,n.o8)(e.p0),p1:(0,n.o8)(e.p1),p2:(0,n.o8)(e.p2)}:{p0:(0,n.vt)(),p1:(0,n.vt)(),p2:(0,n.vt)()};var e});const f=(0,n.vt)(),m=(0,n.vt)(),p=(0,n.vt)()},21015(e,t,r){r.d(t,{R:()=>l});var i=r(60999),n=r(49186),o=r(17676),a=r(84952),s=r(78888);class l{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,a.DB)(e)?((0,o.Te)(t),(0,a.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);let a=await(0,i.Ke)((0,s.A)(t,{responseType:e,...r}));if(a.ok)return a.value.data;throw(0,o.QP)(a.error),new n.A("gltf-loader-request-error",`Request for resource failed: ${a.error}`)}}},84498(e,t,r){r.d(t,{x:()=>a});var i=r(34275),n=r(97146),o=r(63907);function a(e,t){switch(t){case o.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,n.tM)(e):(0,i.mg)(e)?new Uint16Array(e):e}(e);case o.WR.TRIANGLE_STRIP:return function(e){let t="number"==typeof e?e:e.length;if(t<3)return[];let r=t-2,i=(0,n.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let n=0;n<r;n+=1)n%2==0?(i[t++]=e[n],i[t++]=e[n+1],i[t++]=e[n+2]):(i[t++]=e[n+1],i[t++]=e[n],i[t++]=e[n+2])}return i}(e);case o.WR.TRIANGLE_FAN:return function(e){let t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array;let r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}let n=e[0],o=e[1],a=0;for(let t=0;t<r;++t){let r=e[t+2];i[a++]=n,i[a++]=o,i[a++]=r,o=r}return i}(e)}}},51530(e,t,r){r.d(t,{KB:()=>a,Xi:()=>n,pn:()=>s,x3:()=>o});var i=r(44208);class n{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function o(e){return"encoded-mesh-texture"===e?.type}async function a(e){let t=await new Blob([e]).text();return JSON.parse(t)}async function s(e,t){if("image/ktx2"===t)return new n(e);let r=new Blob([e],{type:t}),o=URL.createObjectURL(r);switch(t){case"image/jpeg":o+="#.jpg";break;case"image/png":o+="#.png"}let a=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{let r=()=>{n(),e(a)},i=e=>{n(),t(e)},n=()=>{URL.revokeObjectURL(o),a.removeEventListener("load",r),a.removeEventListener("error",i)};a.addEventListener("load",r),a.addEventListener("error",i),a.src=o});try{a.src=o,await a.decode()}catch{}return URL.revokeObjectURL(o),a}},8040(e,t,r){r.d(t,{fetch:()=>Ir});var i=r(40876),n=r(61473),o=r(77690),a=r(29242),s=r(58083),l=r(9093),c=r(48163),u=r(35522),d=r(51850),h=r(34727),f=r(70328),m=r(13030),p=r(73354),v=r(50867),g=r(43609);function x(e,t=!1){return e<=1024?t?Array(e).fill(0):Array(e):new Float32Array(e)}var _=r(21015),b=r(84498),y=r(51530),w=r(88340);function M(e){if(null==e)return null;let t=null==e.offset?w.uY:e.offset,r=null==e.rotation?0:e.rotation,i=null==e.scale?w.Un:e.scale,n=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,a.vt)();return(0,o.lw)(c,s,l),(0,o.lw)(c,n,c),c}var T=r(46610),S=r(69397),C=r(97146),A=r(94656),E=r(34275);function I(e){if(e.length<1024)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,E.LW)(e)?Float16Array.from(e):(0,E.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return(0,E.vZ)(e)?Float32Array.from(e):Uint32Array.from(e);default:return Float64Array.from(e)}}var O=r(15142),P=r(28540),D=r(620);class R{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this._readPosition=r,this._notifyMemoryChange=i,this._children=void 0,(0,D.vA)(e.length>=1);let n=e.length;z.clear();let o=(0,f.Ie)();for(let i=0;i<n;++i){let n=t*e[i];for(let e=0;e<t;++e){let t=n+e;z.push(t),(0,f.iT)(o,r(F,t))}}this.box=o;let a=new P.i,s=(0,f.gX)(o,a.center),l=.5*Math.max((0,f.VL)(o),(0,f.yr)(o),(0,f.uJ)(o)),c=l*l;for(let e=0;e<z.length;++e){let t=r(F,z.at(e)),i=(0,u.Re)(t,t,s),n=(0,u.uE)(i);if(n<=c)continue;let o=Math.sqrt(n),a=.5*(o-l);l+=a,c=l*l;let d=a/o;(0,u.Ln)(s,s,i,d)}a.radius=l,this.sphere=a,z.clear()}get usedMemory(){let e=88+(0,S.rq)(this.box,8)+32+16+(0,S.rq)(this.sphere.center,8)+function(e){return(0,E.iu)(e)?145+((0,C.lc)(e)?0:e.byteLength):(0,C.lc)(e)?0:(0,S.rq)(e,S.JY)}(this.primitiveIndices),t=this._children;if(t){e+=(0,S.rq)(t,8);for(let r of t)e+=r.usedMemory}return e}get children(){if(this._children)return this._children;let e=this.box;if((0,f.TF)(e)<=1)return;let{_readPosition:t,_numIndexPerPrimitive:r,primitiveIndices:i}=this,n=(0,f.gX)(e,F),o=i.length,a=new Uint8Array(o),s=[0,0,0,0,0,0,0,0];for(let e=0;e<o;++e){let o=r*i[e],l=t(N,o);for(let e=1;e<r;++e)(0,u.jk)(l,l,t(B,o+e));let c=+(l[0]<n[0])|(l[1]<n[1]?2:0)|(l[2]<n[2]?4:0);a[e]=c,++s[c]}let l=0;for(let e=0;e<8;++e)s[e]>0&&++l;if(l<2)return;let c=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0];for(let e=0;e<8;++e)s[e]>0&&(c[e]=new Uint32Array(s[e]));s.fill(0);for(let e=0;e<o;++e){let t=a[e];c[t][s[t]++]=i[e]}let d=[];for(let e=0;e<8;++e){let i=c[e];void 0!==i&&d.push(new R(i,r,t,this._notifyMemoryChange))}return this._children=d,this._notifyMemoryChange?.((0,S.rq)(d,8)+d.reduce((e,t)=>e+t.usedMemory,0)),d}static prune(){z.prune()}}const F=(0,d.vt)(),N=(0,d.vt)(),B=(0,d.vt)(),z=new O.A({deallocator:null});var L=r(24326);class H{constructor(e){this.id=(0,L.c)(),this.type=0,this._attributes=new Map;for(let[t,r]of e)this._attributes.set(t,{...r,indices:(0,C.Dg)(r.indices)})}get attributes(){return this._attributes}}class V{constructor(){this.uid=(0,L.c)()}}class U extends V{constructor(e){super(),this.highlightName=e,this.channel=0}}class j extends H{get usedMemoryExcludingBuffers(){return this._usedMemory+this._primitivePositionIndicesMemory+(this._boundingInfo?.usedMemory??0)}get _primitivePositionIndicesMemory(){let e=this._vertexPositionIndicesCache;return e&&e!==this.positionAttribute?.indices?(0,S.ro)(e,S.JY):0}computeBufferMemory(e){let t=e.arrayMemory(this.mapPositions)+e.arrayMemory(this.drawIndices,S.JY,!0);for(let r of this.attributes.values())t+=e.arrayMemory(r.data)+e.arrayMemory(r.indices,S.JY,!0);return t}constructor(e,t,r=null,i=-1,n,o){super(t),this.material=e,this.mapPositions=r,this.edgeIndicesLength=i,this.baseGeometry=n,this.drawIndices=o,this._usedMemory=0,this._readPrimitivePosition=null,this._vertexPositionIndicesCache=void 0,this._transformation=void 0,this.localOrigin=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.occludees=void 0,this.visible=!0,this._boundingInfo=null,(0,D.vA)((e?.useIndexing??!1)===(null!=o),"Material index requirement and Geometry must match"),this.edgeIndicesLength<0&&(this.edgeIndicesLength=this.indexCount)}get readPrimitivePosition(){return this._readPrimitivePosition??=function(e,t){let{data:r,indices:i,size:n,stride:o}=e;return(0,D.vA)(2===n||3===n||4===n,"Position attribute must have 2, 3 or 4 components"),2===n?null==t?(e,t)=>{let n=i[t]*o;return e[0]=r[n],e[1]=r[n+1],e[2]=-2,e}:(e,n)=>{let a=i[t[n]]*o;return e[0]=r[a],e[1]=r[a+1],e[2]=-2,e}:null==t?function(e,t,r){return(i,n)=>{let o=t[n]*r;return i[0]=e[o],i[1]=e[o+1],i[2]=e[o+2],i}}(r,i,o):(e,n)=>{let a=i[t[n]]*o;return e[0]=r[a],e[1]=r[a+1],e[2]=r[a+2],e}}(this.positionAttribute,this.drawIndices),this._readPrimitivePosition}_invalidateReadPrimitivePosition(){this._readPrimitivePosition=null}instantiate(e={}){let t=new j(e.material||this.material,[],this.mapPositions,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);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}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:I(t.data)},this._attributes.set(e,t),"position"===e&&this._invalidateReadPrimitivePosition()),t}setAttributeData(e,t){let r=this._attributes.get(e);r?(this._attributes.set(e,{...r,exclusive:!0,data:t}),"position"===e&&this._invalidateReadPrimitivePosition()):(0,A.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get primitivePositionIndices(){if(void 0!==this._vertexPositionIndicesCache)return this._vertexPositionIndicesCache;this._vertexPositionIndicesCache=this._computePrimitivePositionIndices();let e=this._primitivePositionIndicesMemory;return e&&this.notifyMemoryChange?.(e),this._vertexPositionIndicesCache}_computePrimitivePositionIndices(){let{drawIndices:e}=this,t=this.positionAttribute;if(null!=e&&null!=t){let r=Array(e.length).fill(0);for(let i=0;i<e.length;i++)r[i]=t.indices[e[i]];return r}return t?.indices??null}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){return(this.drawIndices??this.positionAttribute?.indices)?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo||(this._boundingInfo=this._calculateBoundingInfo(),this._boundingInfo&&this.notifyMemoryChange?.(this._boundingInfo.usedMemory)),this._boundingInfo}computeAttachmentOrigin(e){return!!this.material.computeAttachmentOrigin(e,this.readPrimitivePosition,this.indexCount)&&(null!=this._transformation&&(0,u.Z0)(e,e,this._transformation),!0)}invalidateBoundingInfo(){let e=this._primitivePositionIndicesMemory+(this._boundingInfo?.usedMemory??0);this._boundingInfo=null,this._vertexPositionIndicesCache=void 0,e&&this.notifyMemoryChange?.(-e)}_calculateBoundingInfo(){let e=this.positionAttribute,t=this.indexCount;if(!e||0===t)return null;let r=this.material.primitiveVertexCount;(0,D.vA)(t%r===0,"Indexing error: "+t+" not divisible by "+r);let i=(0,C.tM)(t/r);return new R(i,r,this.readPrimitivePosition,e=>this.notifyMemoryChange?.(e))}get transformation(){return this._transformation??l.zK}set transformation(e){this._transformation=e&&e!==l.zK?(0,l.o8)(e):null}get highlights(){return this._highlights||G}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}forEachHighlightOption(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){let t=new U(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);let{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){let{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const G=new Set;var k=r(76200),W=r(49788),Z=r(49255),$=r(97768),q=r(17676),Y=r(65786);class X{constructor(e){this._material=e.material,this._techniques=e.techniques}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(t))}ensureResources(e){return 2}}class K extends X{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,$.Gz)(this._texture),this._textureNormal=(0,$.Gz)(this._textureNormal),this._textureEmissive=(0,$.Gz)(this._textureEmissive),this._textureOcclusion=(0,$.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,$.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new Q(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){(null==this._texture||e!==this._texture.id)&&(this._texture=(0,$.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);let r=this._textures.acquire(e);(0,q.$X)(r)?(++this._numLoading,r.then(e=>{this._disposed?((0,$.Gz)(e),t(null)):t(e)}).finally(()=>--this._numLoading)):t(r)}}class J extends Y.Y{constructor(e=null){super(),this.textureEmissive=e}}class Q extends J{constructor(e,t,r,i,n,o,a){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.normalScale=o,this.normalTextureTransformMatrix=a}}var ee=r(19245),te=r(48295);const re=(0,d.vt)(),ie=(0,d.vt)(),ne=(0,d.vt)(),oe=(0,d.vt)();class ae{constructor(e,t){this.id=(0,L.c)(),this.supportsEdges=!1,this.primitiveVertexCount=3,this._renderPriority=0,this._parameters=new t,(0,ee.MB)(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,ee.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:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get emissions(){return 0}getConfiguration(e){return this.updateConfiguration(e),this._configuration}updateConfiguration(e){this._configuration.output=e.output,this._configuration.hasEmission=e.hasEmission&&(0,Z._o)(e.output),this._configuration.hasHighlightMixTexture=10===e.output&&null!=e.highlightMixTexture,this._configuration.useFloatBlend=e.useFloatBlend.value,this._configuration.emissionDimmingPass=e.transparentWithoutDepthEmissionDimmingPass&&(0,Z._o)(e.output)}computeAttachmentOrigin(e,t,r){return function(e,t,r){if(r<=0)return!1;(0,u.hZ)(e,0,0,0),(0,u.hZ)(oe,0,0,0);let i=0,n=0;for(let o=0;o<r;++o){let r=3*o;t(re,r),t(ie,r+1),t(ne,r+2);let a=(0,te.BU)(re,ie,ne);a?((0,u.WQ)(re,re,ie),(0,u.WQ)(re,re,ne),(0,u.hs)(re,re,1/3*a),(0,u.WQ)(e,e,re),i+=a):((0,u.WQ)(oe,oe,re),(0,u.WQ)(oe,oe,ie),(0,u.WQ)(oe,oe,ne),n+=3)}return!(0===n&&0===i||(0===i?0===n||((0,u.hs)(e,oe,1/n),0):((0,u.hs)(e,e,1/i),0)))}(e,t,r/3)}getPrimitivePositionCount(e,t){return(t??e).indexCount}}Y.Y;var se=r(58682),le=r(90629),ce=r(65720),ue=r(27921),de=r(19419),he=r(11964);function fe(e,t){return e.isRectangle?(0,de.Uc)(e.bounds,t):function(e,t){return pe(e[0],e[1],t)}(t,e.points)}function me(e,t,r,i){let n=Math.min(t[0],r[0],i[0]),o=Math.min(t[1],r[1],i[1]),a=Math.max(t[0],r[0],i[0]),s=Math.max(t[1],r[1],i[1]);if(!function(e,t){if(!(0,de.HY)(e.bounds,t))return!1;if(e.isRectangle)return!0;for(let r of e.points)if((0,de.Uc)(t,r))return!0;if(function(e,t){let r=e[0],i=e[1],n=e[2],o=e[3];return pe(r,i,t)||pe(n,i,t)||pe(n,o,t)||pe(r,o,t)}(t,e.points))return!0;for(let r=0;r<e.points.length;r++)if(ve(e.points[r],r===e.points.length-1?e.points[0]:e.points[r+1],t))return!0;return!1}(e,(0,de.fA)(n,o,a,s,we)))return!1;if(fe(e,t)||fe(e,r)||fe(e,i))return!0;for(let n of e.points)if((0,te.cq)(t,r,i,n,Me))return!0;for(let n=0;n<e.points.length;n++){let o=e.points[n],a=e.points[(n+1)%e.points.length];if(xe(t,r,o,a)||xe(r,i,o,a)||xe(i,t,o,a))return!0}return!1}function pe(e,t,r){let i=!1;for(let n=0,o=r.length-1;n<r.length;o=n++){let a=r[n],s=r[o];a[1]>t!=s[1]>t&&e<(s[0]-a[0])*(t-a[1])/(s[1]-a[1])+a[0]&&(i=!i)}return i}function ve(e,t,r){let i=r[0],n=r[1],o=r[2],a=r[3],s=e[0],l=e[1],c=t[0],u=t[1];return!(s<i&&c<i||s>o&&c>o||l<n&&u<n||l>a&&u>a)&&(!(!(0,de.Rj)(r,s,l)&&!(0,de.Rj)(r,c,u))||ge(e,t,i,n,o,n)||ge(e,t,o,n,o,a)||ge(e,t,o,a,i,a)||ge(e,t,i,a,i,n))}function ge(e,t,r,i,n,o){let a=_e(e[0],e[1],t[0],t[1],r,i),s=_e(e[0],e[1],t[0],t[1],n,o),l=_e(r,i,n,o,e[0],e[1]),c=_e(r,i,n,o,t[0],t[1]);return a!==s&&l!==c||0===a&&be(e,t,r,i)||0===s&&be(e,t,n,o)||0===l&&ye(r,i,n,o,e[0],e[1])||0===c&&ye(r,i,n,o,t[0],t[1])}function xe(e,t,r,i){return ge(e,t,r[0],r[1],i[0],i[1])}function _e(e,t,r,i,n,o){let a=(i-t)*(n-r)-(r-e)*(o-i);return Math.abs(a)<=Me?0:Math.sign(a)}function be(e,t,r,i){return ye(e[0],e[1],t[0],t[1],r,i)}function ye(e,t,r,i,n,o){return n>=Math.min(e,r)-Me&&n<=Math.max(e,r)+Me&&o>=Math.min(t,i)-Me&&o<=Math.max(t,i)+Me}const we=(0,de.vt)(),Me=((0,le.r_)(),(0,le.r_)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,he.vt)(),1e-9);class Te{constructor(e){this.type=e,this.distance=1/0,this.renderDistance=1/0,this.primitiveIndex=0,this.hasNormal=!1,this.point=(0,d.vt)(),this.normal=(0,d.vt)()}reset(){this.distance=1/0,this.renderDistance=1/0,this.hasNormal=!1}update(e,t,r,i,n=e){this.distance=e,this.renderDistance=n,this.primitiveIndex=t,(0,u.C)(this.point,r),this.hasNormal=null!=i,null!=i&&(0,u.C)(this.normal,i)}updateIfCloserFromValues(e,t,r,i,n=e){n<this.renderDistance&&this.update(e,t,r,i,n)}updateIfCloser(e){let{distance:t,renderDistance:r,primitiveIndex:i,point:n,normal:o}=e;this.updateIfCloserFromValues(t,i,n,e.hasNormal?o:null,r)}get valid(){return Number.isFinite(this.distance)}}function Se(e,t,r,i,n){if(!e.visible)return null;let o,a=new Te(4);o=e.boundingInfo?Ae(e.readPrimitivePosition,e.boundingInfo,t,r,i,n):Ce(t,r,i,0,e.faceCount,e.readPrimitivePosition,n,null,0);for(let e of o)a.updateIfCloser(e);return a.valid?a:null}function*Ce(e,t,r,i,n,o,a,s=null,l=0){if(null==e.camera)return;let{camera:c,screenPolygonPrimitiveProcessor:d}=e;for(let e=i;e<n;++e){let i=(s?.[e]??e)+l,n=null==s?i:e,h=3*i;Ee(De[0],o,h+0,a,n,t),Ee(De[1],o,h+1,a,n,t),Ee(De[2],o,h+2,a,n,t);let f,m=Le;Ve.reset();let p=Re;for(let e of d.processTriangle(De))Ie(r,e,c,p)&&(Oe(c.eye,p,ze),f??=(0,te.rb)(Le,De[0],De[1],De[2]),Ve.updateIfCloserFromValues((0,u.Io)(c.eye,ze),i,ze,f?m:null));Ve.valid&&(yield Ve)}}function*Ae(e,t,r,i,n,o){let a;if(null==o?a=(0,ce.GH)(n.broadPhaseFrustum,t.box,i):((0,f.C)(Pe,t.box),o.applyToAabb(Pe),a=(0,ce.GH)(n.broadPhaseFrustum,Pe,i)),!a)return;let{primitiveIndices:s}=t,l=s.length;if(l>1e3){let a=t.children;if(void 0!==a){for(let t of a)yield*Ae(e,t,r,i,n,o);return}}yield*Ce(r,i,n,0,l,e,o,s,0)}function Ee(e,t,r,i,n,o){let[a,s,l]=t(e,r);null==i?(0,u.hZ)(e,a,s,l):i.applyToVertex(e,a,s,l,n),o&&(0,u.Z0)(e,e,o)}function Ie(e,t,r,i){if(i.length=0,(0,ue.H)(r.frustum[4],t,()=>i.pushNew()),i.length<3)return!1;let n=Fe,o=Ne,a=Be;r.projectToScreen(i.data[0],n),r.projectToScreen(i.data[1],o);for(let t=2;t<i.length;t++){if(r.projectToScreen(i.data[t],a),me(e,n,o,a))return!0;let s=o;o=a,a=s}return!1}function Oe(e,t,r){let i=1/0,n=t.at(0);for(let o=1;o<t.length-1;o++){(0,te.k3)(He,e,n,t.at(o),t.at(o+1));let a=(0,u.hG)(e,He);a<i&&(i=a,(0,u.C)(r,He))}}const Pe=(0,f.vt)(),De=[(0,d.vt)(),(0,d.vt)(),(0,d.vt)()],Re=new O.A({allocator:e=>e??(0,d.vt)()}),Fe=(0,le.gs)(),Ne=(0,le.gs)(),Be=(0,le.gs)(),ze=(0,d.vt)(),Le=(0,d.vt)(),He=(0,d.vt)(),Ve=new Te(4);var Ue=r(16396),je=r(32198),Ge=r(91429),ke=r(91829),We=r(90644),Ze=r(4431),$e=r(1843),qe=r(72824),Ye=r(13840),Xe=r(42958),Ke=r(16943);r(4576),r(66289);var Je=r(56372),Qe=r(65529),et=r(32728);class tt{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",m.Eq),this.color=e.getField("instanceColor",m.XP),this.olidColor=e.getField("instanceOlidColor",m.XP),this.state=e.getField("state",m.SL),this.lodLevel=e.getField("lodLevel",m.SL)}}let rt=class extends Je.A{constructor(e,t){super(e),this.events=new Qe.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return nt(it.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=ct,this._buffer=this._layout.createBuffer(this._capacity),this._view=new tt(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();let e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){let t=this._view.state;(0,D.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){let t=this._view.state;(0,D.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){let t=this._view,r=ot,i=at;t.localTransform.getMat(e,st),t.globalTransform.getMat(e,lt);let n=(0,s.lw)(lt,lt,st);(0,u.hZ)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,o.z0)(i,n),t.model.setMat(e,i);let a=(0,et.wp)(ot,n);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,o.B8)(i,i),(0,o.mg)(i,i),t.modelNormal.setMat(e,i),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){let r=this._view;r.model.getMat(e,at),r.modelOrigin.getVec(e,ot),t[0]=at[0],t[1]=at[1],t[2]=at[2],t[3]=0,t[4]=at[3],t[5]=at[4],t[6]=at[5],t[7]=0,t[8]=at[6],t[9]=at[7],t[10]=at[8],t[11]=0,t[12]=ot[0],t[13]=ot[1],t[14]=ot[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ot,this,e),t*=Math.max(ot[0],ot[1],ot[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ot,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(ot[0],ot[1],ot[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){let{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){let t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){let t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){let r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){let r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(ct,Math.floor(1.5*this._capacity)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new tt(this._buffer)}_findSlot(){let e=this._view.state,t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,je.Cg)([(0,Ge.MZ)({constructOnly:!0})],rt.prototype,"shaderTransformation",void 0),(0,je.Cg)([(0,Ge.MZ)()],rt.prototype,"_size",void 0),(0,je.Cg)([(0,Ge.MZ)({readOnly:!0})],rt.prototype,"size",null),rt=(0,je.Cg)([(0,Ge.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],rt);const it=(0,$e.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function nt(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,Ke.E)()&&e.vec4u8("instanceOlidColor"),e}const ot=(0,d.vt)(),at=(0,a.vt)(),st=(0,l.vt)(),lt=(0,l.vt)(),ct=64,ut=(0,$e.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal"),dt=(0,We.p3)(1,0,1,771);function ht(e,t=!1,r=!1){if(r)return We.uR;switch(e){case 0:return t?We.RC:We.T8;case 1:return dt;default:return null}}function ft(e){if(e.draped)return null;switch(e.output){case 0:case 2:default:return e.writeDepth?We.Uy:null;case 1:return null}}function mt(e,t=513){return{func:(0,Z._$)(e)?515:t}}(0,ke._Y)();const pt={mask:255},vt=(0,We.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),gt=(0,We.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681});(0,We.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),(0,We.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680});var xt=r(74810);const _t=St(-1),bt=St(1),yt=_t,wt=[];wt[0]=null,wt[1]=bt,wt[2]=_t,wt[3]=St(-2),wt[4]=St(-3);const Mt=wt.map(e=>function(e,t){return t?{factor:e.factor+t.factor,units:e.units+t.units}:e}(yt,e));function Tt({output:e,enableOITOffset:t,polygonOffset:r}){return(0,Z._$)(e)&&t?Mt[r]:wt[r]}function St(e){return{factor:+e,units:2*e}}wt[1]=bt;var Ct=r(28491);class At extends qe.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=xt.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=d.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.shadingEnabled=!0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.pretransformedNormals=!1,this.ambient=(0,d.CN)(.2,.2,.2),this.diffuse=(0,d.CN)(.8,.8,.8),this.externalColor=(0,ke.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=W.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}qe.gy;let Et=class extends Xe.w{constructor(e,t){let i=(0,Ze.U)(Dt(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,Ze.U)(function(e){return nt(ut.clone(),e)}(t)))),super(e,t,i),this.shader=new Ye.r(Ct.D,()=>r.e(5141).then(()=>r(5141))),this.ignoreUnused=!0}_makePipeline(e,t){let{output:r,transparent:i,cullFace:n,customDepthTest:o,hasOccludees:a}=e;return(0,We.Ey)({blending:i?ht(r,!1,e.emissionDimmingPass):null,culling:Ot(e)?(0,We.Xt)(n):null,depthTest:mt(r,It(o)),depthWrite:ft(e),colorWrite:We.kn,stencilWrite:a?pt:null,stencilTest:a?t?gt:vt:null,polygonOffset:Tt(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,r){return r?this._occludeePipelineState:super.getPipeline(e,t,r)}};function It(e){switch(e){case 1:return 515;case 0:case 4:return 513;case 2:return 516;case 3:return 514}}function Ot(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Pt(e){return e.hasNormalTexture&&e.hasVertexTangents}function Dt(e){let t=(0,$e.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),Pt(e)&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,Ke.E)()&&t.vec4u8("olidColor"),t}Et=(0,je.Cg)([(0,Ge.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],Et);var Rt=r(51976),Ft=r(34711);class Nt extends Ft.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,je.Cg)([(0,Rt.W)()],Nt.prototype,"hasHighlightMixTexture",void 0),(0,je.Cg)([(0,Rt.W)()],Nt.prototype,"emissionDimmingPass",void 0);class Bt extends Nt{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,je.Cg)([(0,Rt.W)({count:5})],Bt.prototype,"polygonOffset",void 0),(0,je.Cg)([(0,Rt.W)()],Bt.prototype,"transparent",void 0),(0,je.Cg)([(0,Rt.W)()],Bt.prototype,"enableOITOffset",void 0);class zt extends Bt{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,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.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1,this.renderOccluded=!1}get textureCoordinateType(){return+!!this.hasTextures}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}}(0,je.Cg)([(0,Rt.W)({count:4})],zt.prototype,"alphaDiscardMode",void 0),(0,je.Cg)([(0,Rt.W)({count:3})],zt.prototype,"doubleSidedMode",void 0),(0,je.Cg)([(0,Rt.W)({count:8})],zt.prototype,"pbrMode",void 0),(0,je.Cg)([(0,Rt.W)({count:3})],zt.prototype,"cullFace",void 0),(0,je.Cg)([(0,Rt.W)({count:3})],zt.prototype,"normalType",void 0),(0,je.Cg)([(0,Rt.W)({count:4})],zt.prototype,"customDepthTest",void 0),(0,je.Cg)([(0,Rt.W)({count:8})],zt.prototype,"emissionSource",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasVertexColors",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasSymbolColors",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasVerticalOffset",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasColorTexture",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasMetallicRoughnessTexture",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasOcclusionTexture",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasNormalTexture",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasScreenSizePerspective",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasVertexTangents",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasOccludees",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"instanced",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"instancedDoublePrecision",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasModelTransformation",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"offsetBackfaces",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasVVSize",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasVVColor",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"receiveShadows",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasShadowHighlights",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"receiveAmbientOcclusion",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"receiveGlobalIllumination",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"textureAlphaPremultiplied",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"instancedFeatureAttribute",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"instancedColor",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"writeDepth",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"snowCover",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasColorTextureTransform",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasEmissionTextureTransform",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasNormalTextureTransform",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasOcclusionTextureTransform",void 0),(0,je.Cg)([(0,Rt.W)()],zt.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Lt=r(57323);let Ht=class extends Et{constructor(){super(...arguments),this.shader=new Ye.r(Lt.R,()=>r.e(9933).then(()=>r(39933)))}};Ht=(0,je.Cg)([(0,Ge.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],Ht);var Vt=r(56529);class Ut extends Rt.K{constructor(){super(...arguments),this.receiveShadows=!0}}(0,je.Cg)([(0,Rt.W)()],Ut.prototype,"receiveShadows",void 0);class jt extends Vt.D5{constructor(){super(...arguments),this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1}}(0,je.Cg)([(0,Rt.W)()],jt.prototype,"receiveAmbientOcclusion",void 0),(0,je.Cg)([(0,Rt.W)()],jt.prototype,"receiveGlobalIllumination",void 0);var Gt=r(10614);function kt(e,t,r){let{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){let t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function Wt(e,t,r,i=1){let{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){let 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){let 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 Zt(e,t,r,i,n=1){let{data:o,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t===o.length&&4===t){s[i]=o[0],s[i+1]=o[1],s[i+2]=o[2],s[i+3]=o[3];let e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;let u=c*n;for(let r=1;r<u;++r)e[i]=a,i+=t}else if(1===n){if(4===t){for(let e=0;e<c;++e){let 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){let 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 if(4===t)for(let e=0;e<c;++e){let 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 for(let e=0;e<c;++e){let 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}}const $t=(0,d.vt)();function qt(e,t,r,i,n,o,a=!1){switch(e){case"position":{(0,D.vA)(3===t.size);let i=n.getField(e,m.xs);(0,D.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void Wt(e,r,i,n);let{data:o,indices:a}=e,l=r.typedBuffer,c=r.typedBufferStride,u=a.length,d=t[0],h=t[1],f=t[2],m=t[4],p=t[5],v=t[6],g=t[8],x=t[9],_=t[10],b=t[12],y=t[13],w=t[14];i*=c;let M=0,T=0,S=0,C=(0,s.tZ)(t)?e=>{M=o[e]+b,T=o[e+1]+y,S=o[e+2]+w}:e=>{let t=o[e],r=o[e+1],i=o[e+2];M=d*t+m*r+g*i+b,T=h*t+p*r+x*i+y,S=f*t+v*r+_*i+w};if(1===n)for(let e=0;e<u;++e)C(3*a[e]),l[i]=M,l[i+1]=T,l[i+2]=S,i+=c;else for(let e=0;e<u;++e){C(3*a[e]);for(let e=0;e<n;++e)l[i]=M,l[i+1]=T,l[i+2]=S,i+=c}}(t,r,i,o);break}case"normal":{(0,D.vA)(3===t.size);let r=n.getField(e,m.xs);(0,D.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void Wt(e,r,i,n);let{data:o,indices:a}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=a.length,h=l[0],f=l[1],m=l[2],p=l[4],v=l[5],g=l[6],x=l[8],_=l[9],b=l[10],y=!(0,s.ut)(l),w=1e-6,M=.999999;i*=u;let T=0,S=0,C=0,A=(0,s.tZ)(l)?e=>{T=o[e],S=o[e+1],C=o[e+2]}:e=>{let t=o[e],r=o[e+1],i=o[e+2];T=h*t+p*r+x*i,S=f*t+v*r+_*i,C=m*t+g*r+b*i};if(1===n)if(y)for(let e=0;e<d;++e){A(3*a[e]);let t=T*T+S*S+C*C;if(t<M&&t>w){let e=1/Math.sqrt(t);c[i]=T*e,c[i+1]=S*e,c[i+2]=C*e}else c[i]=T,c[i+1]=S,c[i+2]=C;i+=u}else for(let e=0;e<d;++e)A(3*a[e]),c[i]=T,c[i+1]=S,c[i+2]=C,i+=u;else for(let e=0;e<d;++e){if(A(3*a[e]),y){let e=T*T+S*S+C*C;if(e<M&&e>w){let t=1/Math.sqrt(e);T*=t,S*=t,C*=t}}for(let e=0;e<n;++e)c[i]=T,c[i+1]=S,c[i+2]=C,i+=u}}(t,i,r,o);break}case"normalCompressed":if(!a){(0,D.vA)(2===t.size);let r=n.getField(e,m.mJ);(0,D.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i){if(!t||(0,s.tZ)(t))return void kt(e,r,i);let{data:n,indices:o}=e,a=t,l=r.typedBuffer,c=r.typedBufferStride,u=o.length;i*=c;for(let e=0;e<u;++e){(0,Gt.Tz)($t,n,o[e]);let[t,r,s]=$t;(0,Gt.aT)(l,e,a[0]*t+a[4]*r+a[8]*s,a[1]*t+a[5]*r+a[9]*s,a[2]*t+a[6]*r+a[10]*s,c,i)}}(t,i,r,o);break}case"profileRight":case"profileUp":{(0,D.vA)(2===t.size);let r=n.getField(e,m.mJ);(0,D.vA)(!!r,`No buffer view for ${e}`),kt(t,r,o);break}case"uv0":{(0,D.vA)(2===t.size);let r=n.getField(e,m.ZD)??n.getField(e,m.gH);(0,D.vA)(!!r,`No buffer view for ${e}`),kt(t,r,o);break}case"uvi":{(0,D.vA)(2===t.size);let r=n.getField(e,m.mJ);(0,D.vA)(!!r,`No buffer view for ${e}`),kt(t,r,o);break}case"color":case"symbolColor":{let r=n.getField(e,m.XP);(0,D.vA)(!!r,`No buffer view for ${e}`),(0,D.vA)(3===t.size||4===t.size),Zt(t,t.size,r,o);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{let r=n.getField(e,m.Y$)??n.getField(e,m.Y$);(0,D.vA)(!!r,`No buffer view for ${e}`),(0,D.vA)(1===t.size),function(e,t,r){let{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,o);break}case"tangent":{(0,D.vA)(4===t.size);let i=n.getField(e,m.Eq);(0,D.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void function(e,t,r,i=1){let{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){let 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){let 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}}(e,r,i,n);let{data:o,indices:a}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=a.length,h=l[0],f=l[1],m=l[2],p=l[4],v=l[5],g=l[6],x=l[8],_=l[9],b=l[10],y=!(0,s.ut)(l),w=1e-6,M=.999999;if(i*=u,1===n)for(let e=0;e<d;++e){let t=4*a[e],r=o[t],n=o[t+1],s=o[t+2],l=o[t+3],d=h*r+p*n+x*s,T=f*r+v*n+_*s,S=m*r+g*n+b*s;if(y){let e=d*d+T*T+S*S;if(e<M&&e>w){let t=1/Math.sqrt(e);d*=t,T*=t,S*=t}}c[i]=d,c[i+1]=T,c[i+2]=S,c[i+3]=l,i+=u}else for(let e=0;e<d;++e){let t=4*a[e],r=o[t],s=o[t+1],l=o[t+2],d=o[t+3],T=h*r+p*s+x*l,S=f*r+v*s+_*l,C=m*r+g*s+b*l;if(y){let e=T*T+S*S+C*C;if(e<M&&e>w){let t=1/Math.sqrt(e);T*=t,S*=t,C*=t}}for(let e=0;e<n;++e)c[i]=T,c[i+1]=S,c[i+2]=C,c[i+3]=d,i+=u}}(t,r,i,o);break}case"olidColor":(0,D.vA)(4===t.size),Zt(t,4,n.getField(e,m.XP),o)}}class Yt{constructor(e,t=!1){this.layout=e,this._preTransformedNormals=t}elementCount(e){return e.get("position").indices.length}write(e,t,r,i){i&&function(e,t,r,i,n,o=!1){let{buffer:a,offset:s}=n;for(let n of t.fields.keys()){let t=e.get(n),l=t?.indices;t&&l&&qt(n,t,r,i,a,s,o)}}(r,this.layout,e,t,i,this._preTransformedNormals)}}function Xt(e,t){return Jt.output=+!!e.transparent,Jt.polygonOffset=e.polygonOffset,Jt.enableOITOffset=function(e,t){return(0,Z._$)(e)&&t.relativeElevation<5e5}(Jt.output,t),Tt(Jt)}function Kt({units:e,factor:t},r,i,n){let o=er*e;return i+((n?1-Math.abs((0,u.Om)(r,n)):0)*t*Qt+o)}const Jt=new Bt,Qt=2e-5,er=2e-6,tr=(0,d.vt)();class rr extends ae{constructor(e,t){super(e,nr),this.materialType="default",this.supportsEdges=!0,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,e=>(0,Z.uw)(e)&&!this.transparent],[4,e=>(0,Z.uw)(e)&&this.transparent]]),this._configuration=new zt(t)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){let{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=W.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,u.t2)(this.parameters.emissiveBaseColor,d.uY)}get emissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);let{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;let{treeRendering:i,doubleSided:n,doubleSidedType:o}=t;r.hasVertexTangents=Pt(t),r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=i?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.hasModelTransformation=!i&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=i?2:n&&"normal"===o?1:n&&"winding-order"===o?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,function(e,t,r,i=!0){i&&(0,Z._o)(t.output)&&r.shadingEnabled?(e.receiveShadows=r.receiveShadows&&t.shadowMap.enabled,e.hasShadowHighlights=function(e,t){return e.receiveShadows&&null!=t.shadowHighlight?.getTexture()}(e,t),e.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao,e.receiveGlobalIllumination=r.receiveAmbientOcclusion&&t.globalIlluminationEnabled):e.receiveShadows=e.hasShadowHighlights=e.receiveAmbientOcclusion=e.receiveGlobalIllumination=!1}(r,e,t),r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.unlit?7:t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersectRay(e,t,r,i,n,o){let a=this._getMaterialVerticalOffset(t,r);null!=a&&(i=(0,u.Re)(or,i,a),n=(0,u.Re)(ar,n,a)),o=function(e,t,r,i,n){let o=Xt(t,r);if(!o)return e;let a=(0,u.oW)(tr,n,i);return(t,r,i,n)=>e(t,Kt(o,a,r,i),i,n)}(o,this._configuration,r.camera,i,n),(0,se.Uy)(e,r,i,n,(0,Ue.ou)(r.verticalOffset),o)}intersectScreenPolygon(e,t,r,i){return function(e,t,r){return null==e?null:(e.renderDistance=function(e,t,r,i,n){let o=Xt(r,i);return o?Kt(o,(0,u.oW)(tr,n,i.eye),e,t):e}(e.renderDistance,e.hasNormal?e.normal:null,t,r,e.point),e)}(Se(e,r,t,i,this._createScreenPolygonVertexDisplacement(t,r)),this._configuration,r.camera)}createGLMaterial(e){return new ir(e)}createBufferWriter(){return new Yt(Dt(this.parameters),this.parameters.pretransformedNormals)}get transparent(){let{drivenOpacity:e,opacity:t,externalColor:r,layerOpacity:i,texture:n,textureId:o,textureAlphaMode:a,colorMixMode:s}=this.parameters,l=r[3];return e||t<1&&"replace"!==s||l<1&&"ignore"!==s||i<1||(null!=n||null!=o)&&1!==a&&2!==a&&"replace"!==s}_createScreenPolygonVertexDisplacement(e,t){let r=this._getMaterialVerticalOffset(e,t);return null==r?null:{applyToVertex:(e,t,i,n)=>(e[0]=t+r[0],e[1]=i+r[1],e[2]=n+r[2],e),applyToAabb:e=>((0,f.Ne)(e,(0,u.WQ)(hr,(0,f.pg)(e,hr),r)),(0,f.vI)(e,(0,u.WQ)(hr,(0,f.Lu)(e,hr),r)),e)}}_getMaterialVerticalOffset(e,t){if(null==this.parameters.verticalOffset)return null;let r=t.camera;(0,u.hZ)(cr,e[12],e[13],e[14]);let i=t.isGlobal?(0,u.S8)(lr,cr):(0,u.C)(lr,sr),n=(0,u.Re)(ur,cr,r.eye),o=(0,u.Bw)(n),a=(0,u.hs)(n,n,1/o),s=null;this.parameters.screenSizePerspective&&(s=(0,u.Om)(i,a));let l=(0,ee.kE)(r,o,this.parameters.verticalOffset,s??0,this.parameters.screenSizePerspective,null);return(0,u.hs)(i,i,l),(0,u.ei)(dr,i,t.transform.inverseRotation)}}class ir extends K{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});let t=this._material.parameters;this.updateTexture(t.textureId);let r=e.camera.viewInverseTransposeMatrix;return(0,u.hZ)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Ht:Et,e)}}class nr extends At{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1,this.unlit=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const or=(0,d.vt)(),ar=(0,d.vt)(),sr=(0,d.fA)(0,0,1),lr=(0,d.vt)(),cr=(0,d.vt)(),ur=(0,d.vt)(),dr=(0,d.vt)(),hr=(0,d.vt)();class fr{constructor(){this.geometries=[],this.materials=[],this.textures=[]}}class mr{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new fr,this.numberOfVertices=0}}var pr=r(60999),vr=r(49186),gr=r(53966);class xr{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(let t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){let i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){let r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){let r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(let e of this._outer)yield e}*values(){for(let e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(let[e,t]of this._outer)for(let[r,i]of t)yield[e,r,i]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,i)=>e(t,r,i)))}clone(){let e=new xr;return this.forAll((t,r,i)=>e.set(r,i,t)),e}}var _r=r(46140),br=r(78888),yr=r(31217);const wr=()=>gr.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class Mr{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function Tr(e){let t=e.params,r=t.topology,i=!0;switch(t.vertexAttributes||(wr().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{let e=t.faces;if(e){if(t.vertexAttributes)for(let r in t.vertexAttributes){let t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(wr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(wr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(wr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else wr().warn("Indexed geometries must specify faces"),i=!1;break}default:wr().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(wr().warn("Geometry requires material"),i=!1);let n=e.params.vertexAttributes;for(let e in n)n[e].values||(wr().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Sr(e){let t=(0,f.Ie)();return e.forEach(e=>{let r=e.boundingInfo;null!=r&&(0,f.RF)(t,r.box)}),t}function Cr(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function Ar(e){let t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Er=new _r.A(1,2,"wosr");async function Ir(e,t){let o,a=function(e){let t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null==t[4]?null:Number(t[4])}:{fileType:e.match(/(.*\.(json|json\.gz))$/)?"wosr":"unknown",url:e,specifiedLodIndex:null}}((0,n.EM)(e));if("wosr"===a.fileType){let e=await(t.cache?t.cache.loadWOSR(a.url,t):async function(e,t){let r=await async function(e,t){let r=await(0,pr.Ke)((0,br.A)(e,t));if(r.ok)return r.value.data;(0,q.QP)(r.error),function(e){throw new vr.A("request:wosr",`Request for object resource failed: ${e}`)}(r.error)}(e,t),i=await async function(e,t){let r=[];for(let i in e){let n=e[i],o=n.images[0].data;if(!o){wr().warn("Externally referenced texture data is not yet supported");continue}let a=n.encoding+";base64,"+o,s="/textureDefinitions/"+i,l="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==Cr(l)},u=t?.disableTextures?Promise.resolve(null):(0,yr.D)(a,t);r.push(u.then(e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l})))}let i=await Promise.all(r),n={};for(let e of i)n[e.refId]=e;return n}(r.textureDefinitions??{},t),n=0;for(let e in i)if(i.hasOwnProperty(e)){let t=i[e];n+=t?.image?t.image.width*t.image.height*4:0}return new Mr(r,i,n+(0,S.Qh)(r))}(a.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){let r=[],i=[],n=[],o=new xr,a=e.resource,s=_r.A.parse(a.version||"1.0","wosr");Er.validate(s);let l=a.model.name,c=a.model.geometries,u=a.materialDefinitions??{},h=e.textures,f=0,m=new Map;for(let e=0;e<c.length;e++){let a=c[e];if(!Tr(a))continue;let s=Ar(a),l=a.params.vertexAttributes,p=[],v=e=>{if("PerAttributeArray"===a.params.topology)return null;let t=a.params.faces;for(let r in t)if(r===e)return t[r].values;return null},g=l.position,x=g.values.length/g.valuesPerElement;for(let e in l){let t=l[e],r=t.values,i=v(e)??(0,C.tM)(x);p.push([e,new T.n(r,i,t.valuesPerElement,!0)])}let _=s.texture,b=h&&h[_];if(b&&!m.has(_)){let{image:e,parameters:t}=b,r=new k.h(e,t);i.push(r),m.set(_,r)}let y=m.get(_),w=y?y.id:void 0,M=s.material,S=o.get(M,_);if(null==S){let e=u[M.slice(M.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);let r=b?Cr(b.alphaChannelUsage):void 0,i={ambient:(0,d.ci)(e.diffuse),diffuse:(0,d.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:w,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:b?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(i,t.materialParameters),S=new rr(i,t.spherical),o.set(M,_,S)}n.push(S);let A=new j(S,p);f+=p.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(A)}return{engineResources:[{name:l,stageResources:{textures:i,materials:n,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:f,lodThreshold:null}],referenceBoundingBox:Sr(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}if(t.cache)o=await t.cache.loadGLTF(a.url,t,!!t.usePBR,!!t.useEmissive);else{let{loadGLTF:e}=await r.e(1698).then(()=>r(51698));o=await e(new _.R,a.url,t,t.usePBR,t.useEmissive)}let{engineResources:h,referenceBoundingBox:p}=function(e,t,r){let n=e.model,o=e.meta,a=n.meta?.ESRI_proxyEllipsoid,h=o.isEsriSymbolResource&&null!=a&&"EsriRealisticTreesStyle"===o.ESRI_webstyle;h&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){let i=e.model.lods[r];for(let n of i.parts){let i=n.attributes.normal;if(null==i)return;let o=n.attributes.position,a=o.count,c=(0,d.vt)(),h=(0,d.vt)(),f=(0,d.vt)(),p=new Float32Array(4*a),v=new Float32Array(3*a),g=(0,s.B8)((0,l.vt)(),n.transform),x=0,_=0;for(let s=0;s<a;s++){o.getVec(s,h),i.getVec(s,c),(0,u.Z0)(h,h,n.transform),(0,u.Re)(f,h,t.center),(0,u.Qr)(f,f,t.radius);let a=f[2],l=(0,u.Bw)(f),d=Math.min(.45+.55*l*l,1)**2.2;(0,u.Qr)(f,f,t.radius),null!==g&&(0,u.Z0)(f,f,g),(0,u.S8)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(a>-1?(0,u.Cc)(f,f,c,.2):(0,u.Cc)(f,f,c,Math.min(-4*a-3.8,1))),v[x]=f[0],v[x+1]=f[1],v[x+2]=f[2],x+=3,p[_]=d,p[_+1]=d,p[_+2]=d,p[_+3]=1,_+=4}n.attributes.normal=new m.xs(v.buffer),n.attributes.color=new m.Eq(p.buffer)}}}(e,a));let p=!!t.usePBR,v=o.isEsriSymbolResource?{usePBR:p,isSchematic:!1,treeRendering:h,mrrFactors:xt.SY}:{usePBR:p,isSchematic:!1,treeRendering:!1,mrrFactors:xt.mb},g={...t.materialParameters,treeRendering:h},x=[],_=new Map,b=new Map,w=n.lods.length,T=(0,f.Ie)();return n.lods.forEach((e,o)=>{let a=!0===t.skipHighLods&&(w>1&&0===o||w>3&&1===o)||!1===t.skipHighLods&&null!=r&&o!==r;if(a&&0!==o)return;let s=new mr(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{let r=a?new rr({},t.spherical):function(e,t,r,n,o,a,s,l,u){let h=e.materials.get(t.material);if(null==h)return null;let{normal:f,color:m,texCoord0:p,tangent:v}=t.attributes,g=t.material+(f?"_normal":"")+(m?"_color":"")+(p?"_texCoord0":"")+(v?"_tangent":""),x=null!=t.attributes.texCoord0,_=null!=t.attributes.normal,b=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(h.alphaMode);if(!a.has(g)){if(x){let t=(t,r=!1,i=!1)=>{if(null!=t&&!s.has(t)){let n=e.textures.get(t);if(n){let e=n.data,o=r&&!(0,y.x3)(e)?l.compressionOptions:void 0;s.set(t,new k.h((0,y.x3)(e)?e.data:e,{...n.parameters,preMultiplyAlpha:!(0,y.x3)(e)&&i,encoding:(0,y.x3)(e)?e.encoding:void 0,compressionOptions:o}))}}},r=1!==b&&!u;t(h.colorTexture,r,1!==b),t(h.normalTexture),t(h.occlusionTexture,!0),t(h.emissiveTexture),t(h.metallicRoughnessTexture,!0)}let r=(0,i.xV)(h.color[0]),f=(0,i.xV)(h.color[1]),m=(0,i.xV)(h.color[2]),p=null!=h.colorTexture&&x?s.get(h.colorTexture):null,v=(0,xt.Jr)(h),w=null==h.normalTextureTransform?.scale?c.Un:h.normalTextureTransform?.scale;a.set(g,new rr({...n,customDepthTest:1,textureAlphaMode:b,textureAlphaCutoff:h.alphaCutoff,diffuse:[r,f,m],ambient:[r,f,m],opacity:"OPAQUE"===h.alphaMode?1:h.opacity,doubleSided:h.doubleSided,doubleSidedType:"winding-order",cullFace:h.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:_?0:2,castShadows:!0,receiveShadows:h.receiveShadows,receiveAmbientOcclusion:h.receiveAmbientOcclusion,unlit:h.unlit,textureId:p?.id,colorMixMode:h.colorMixMode,normalTextureId:null!=h.normalTexture&&x?s.get(h.normalTexture).id:void 0,textureAlphaPremultiplied:null!=p&&!!p.parameters.preMultiplyAlpha,occlusionTextureId:null!=h.occlusionTexture&&x?s.get(h.occlusionTexture).id:void 0,emissiveTextureId:null!=h.emissiveTexture&&x&&!h.unlit?s.get(h.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=h.metallicRoughnessTexture&&x?s.get(h.metallicRoughnessTexture).id:void 0,emissiveBaseColor:h.unlit?d.uY:[h.emissiveFactor[0],h.emissiveFactor[1],h.emissiveFactor[2]],emissiveStrengthKHR:null==h.emissiveStrengthKHR?1:h.emissiveStrengthKHR,emissiveStrengthFromSymbol:null==o.emissiveStrengthFromSymbol?void 0:o.emissiveStrengthFromSymbol,mrrFactors:v?xt.Bt:[h.metallicFactor,h.roughnessFactor,n.mrrFactors[2]],isSchematic:v,colorTextureTransformMatrix:M(h.colorTextureTransform),normalTextureTransformMatrix:M(h.normalTextureTransform),normalScale:[w[0],w[1]],occlusionTextureTransformMatrix:M(h.occlusionTextureTransform),emissiveTextureTransformMatrix:M(h.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:M(h.metallicRoughnessTextureTransform),...o},l.spherical))}let w=a.get(g);if(r.stageResources.materials.push(w),x){let e=e=>{null!=e&&r.stageResources.textures.push(s.get(e))};e(h.colorTexture),e(h.normalTexture),e(h.occlusionTexture),e(h.emissiveTexture),e(h.metallicRoughnessTexture)}return w}(n,e,s,v,g,_,b,t,h),{geometry:l,vertexCount:u}=Or(e,r??new rr({},t.spherical)),m=l.boundingInfo;null!=m&&0===o&&(0,f.RF)(T,m.box),null!=r&&(s.stageResources.geometries.push(l),s.numberOfVertices+=u)}),a||x.push(s)}),{engineResources:x,referenceBoundingBox:T}}(o,t,a.specifiedLodIndex);return{lods:h,referenceBoundingBox:p,isEsriSymbolResource:o.meta.isEsriSymbolResource,isWosr:!1}}function Or(e,t){let r=e.attributes.position.count,i=(0,b.x)(e.indices||r,e.primitiveType),n=x(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,p.t)(n,a,e.transform,3,s);let l=[["position",new T.n(n,i,3,!0)]];if(null!=e.attributes.normal){let t=x(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,o.Ge)(Pr,e.transform),(0,p.b)(t,n,Pr,3,a),(0,h.or)(Pr)&&(0,p.n)(t,t),l.push(["normal",new T.n(t,i,3,!0)])}if(null!=e.attributes.tangent){let t=x(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,o.z0)(Pr,e.transform),(0,v.t)(t,n,Pr,4,a),(0,h.or)(Pr)&&(0,p.n)(t,t,4),l.push(["tangent",new T.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){let t=x(2*r),{typedBuffer:n,typedBufferStride:o}=e.attributes.texCoord0;(0,g.a)(t,n,2,o),l.push(["uv0",new T.n(t,i,2,!0)])}let c=e.attributes.color;if(null!=c){let t=new Uint8Array(4*r);4===c.elementCount?c instanceof m.Eq?(0,v.b)(t,c,1,255):(c instanceof m.XP||c instanceof m.Uz)&&(0,v.b)(t,c,1/255,255):(t.fill(255),c instanceof m.xs?(0,p.f)(t,c.typedBuffer,1,255,4,c.typedBufferStride):(e.attributes.color instanceof m.eI||e.attributes.color instanceof m.nS)&&(0,p.f)(t,c.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),l.push(["color",new T.n(t,i,4,!0)])}return{geometry:new j(t,l),vertexCount:r}}const Pr=(0,a.vt)()},26857(e,t,r){var i=r(32198),n=r(56372),o=r(91429);let a=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.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,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.UPDATING=!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,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,o.MZ)()],a.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"UPDATING",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),a=(0,i.Cg)([(0,o.$K)("esri.views.3d.support.debugFlags")],a);const s=new a;r.d(t,["b",0,s])},46686(e,t,r){r.d(t,{A7:()=>o,Y0:()=>n});var i=r(29941);class n extends i.v{constructor(e){super(),this.spherical=e,this.draped=!1}}function o(e){(function(e){e.varyings.add("linearDepth","float",{invariant:!0})})(e),e.vertex.code.add("void forwardLinearDepth(float _linearDepth) { linearDepth = _linearDepth; }")}},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) {
221
+ fragBlur = b / w_total;`),e}const h=Object.freeze(Object.defineProperty({__proto__:null,build:d},Symbol.toStringTag,{value:"Module"}))},43609(e,t,r){r.d(t,{a:()=>o,f:()=>a,n:()=>n});var i=r(34275);function n(e,t){o(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r=2,n=r){let o=t.length/2,a=0,s=0;if(!(0,i.iu)(t)||(0,i.dk)(t)){for(let i=0;i<o;++i)e[a]=t[s],e[a+1]=t[s+1],a+=r,s+=n;return}let l=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<o;++i)e[a]=Math.max(t[s]/l,-1),e[a+1]=Math.max(t[s+1]/l,-1),a+=r,s+=n;else for(let i=0;i<o;++i)e[a]=t[s]/l,e[a+1]=t[s+1]/l,a+=r,s+=n}function a(e,t,r,i){let n=e.typedBuffer,o=e.typedBufferStride,a=i?.count??e.count,s=(i?.dstIndex??0)*o;for(let e=0;e<a;++e)n[s]=t,n[s+1]=r,s+=o}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:o,normalizeIntegerBufferView:n},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>d,b:()=>s,c:()=>n,d:()=>a,e:()=>h,f:()=>u,l:()=>c,n:()=>f,t:()=>o}),r(44208);var i=r(72727);function n(e,t,r){o(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r,n=3,o=n){let a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s),c=r[0],u=r[1],d=r[2],h=r[4],f=r[5],m=r[6],p=r[8],v=r[9],g=r[10],x=r[12],_=r[13],b=r[14],y=0,w=0;for(let r=0;r<l;r++){let r=t[y],i=t[y+1],a=t[y+2];e[w]=c*r+h*i+p*a+x,e[w+1]=u*r+f*i+v*a+_,e[w+2]=d*r+m*i+g*a+b,y+=o,w+=n}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,n=3,o=n){let a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s),c=r[0],u=r[1],d=r[2],h=r[3],f=r[4],m=r[5],p=r[6],v=r[7],g=r[8],x=0,_=0;for(let r=0;r<l;r++){let r=t[x],i=t[x+1],a=t[x+2];e[_]=c*r+h*i+p*a,e[_+1]=u*r+f*i+v*a,e[_+2]=d*r+m*i+g*a,x+=o,_+=n}}function l(e,t,r,i=3,n=i){let o=Math.min(e.length/i,t.length/n),a=0,s=0;for(let l=0;l<o;l++)e[s]=r*t[a],e[s+1]=r*t[a+1],e[s+2]=r*t[a+2],a+=n,s+=i;return e}function c(e,t,r,i){u(e.typedBuffer,t.typedBuffer,r,i,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r,i,n=3,o=n){let a=Math.min(e.length/n,t.length/o),s=0,l=0,c=1/2.2;for(let u=0;u<a;u++)e[l]=i*(r*t[s])**c,e[l+1]=i*(r*t[s+1])**c,e[l+2]=i*(r*t[s+2])**c,s+=o,l+=n}function d(e,t,r,n=3,o=n){let a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s),c=0,u=0;for(let i=0;i<l;i++)e[u]=t[c]+r[0],e[u+1]=t[c+1]+r[1],e[u+2]=t[c+2]+r[2],c+=o,u+=n;return e}function h(e,t){f(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function f(e,t,r=3,i=r){let n=Math.min(e.length/r,t.length/i),o=0,a=0;for(let s=0;s<n;s++){let n=t[o],s=t[o+1],l=t[o+2],c=n*n+s*s+l*l;if(c>0){let t=1/Math.sqrt(c);e[a]=t*n,e[a+1]=t*s,e[a+2]=t*l}o+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:u,linearToSRGBView:c,normalize:f,normalizeView:h,scale:l,scaleView:function(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){let i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride,l=0,c=0;for(let e=0;e<i;e++)n[c]=a[l]>>r,n[c+1]=a[l+1]>>r,n[c+2]=a[l+2]>>r,l+=s,c+=o},transformMat3:s,transformMat3View:a,transformMat4:o,transformMat4View:n,translate:d},Symbol.toStringTag,{value:"Module"}))},50867(e,t,r){r.d(t,{a:()=>n,b:()=>c,l:()=>l,n:()=>a,t:()=>o}),r(44208);var i=r(72727);function n(e,t,r){o(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r,n=4,o=n){let a=(0,i.k)(e.length,n,4),s=(0,i.k)(t.length,o,4),l=Math.min(a,s),c=r[0],u=r[1],d=r[2],h=r[3],f=r[4],m=r[5],p=r[6],v=r[7],g=r[8],x=0,_=0;for(let r=0;r<l;r++){let r=t[x],i=t[x+1],a=t[x+2],s=t[x+3];e[_]=c*r+h*i+p*a,e[_+1]=u*r+f*i+v*a,e[_+2]=d*r+m*i+g*a,e[_+3]=s,x+=o,_+=n}}function a(e,t){let r=Math.min(e.count,t.count),i=e.typedBuffer,n=e.typedBufferStride,o=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){let t=e*n,r=e*a,s=o[r],l=o[r+1],c=o[r+2],u=s*s+l*l+c*c;if(u>0){let e=1/Math.sqrt(u);i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function s(e,t,r,i=4){let n=Math.min(e.length/i,t.count),o=t.typedBuffer,a=t.typedBufferStride,s=0,l=0;for(let t=0;t<n;t++)e[l]=r*o[s],e[l+1]=r*o[s+1],e[l+2]=r*o[s+2],e[l+3]=r*o[s+3],s+=a,l+=i}function l(e,t,r,i){c(e.typedBuffer,t,r,i,e.typedBufferStride)}function c(e,t,r,i,n=4){let o=Math.min(e.length/n,t.count),a=t.typedBuffer,s=t.typedBufferStride,l=0,c=0,u=1/2.2;for(let t=0;t<o;t++)e[c]=i*(r*a[l])**u,e[c+1]=i*(r*a[l+1])**u,e[c+2]=i*(r*a[l+2])**u,e[c+3]=i*r*a[l+3],l+=s,c+=n}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:l,normalize:a,scale:s,scaleView:function(e,t,r){s(e.typedBuffer,t,r,e.typedBufferStride)},transformMat3:o,transformMat3View:n,transformMat4:function(e,t,r,n=4,o=n){let a=(0,i.k)(e.length,n,4),s=(0,i.k)(t.length,o,4),l=Math.min(a,s),c=r[0],u=r[1],d=r[2],h=r[3],f=r[4],m=r[5],p=r[6],v=r[7],g=r[8],x=r[9],_=r[10],b=r[11],y=r[12],w=r[13],M=r[14],T=r[15],S=0,C=0;for(let r=0;r<l;r++){let r=t[S],i=t[S+1],a=t[S+2],s=t[S+3];e[C]=c*r+f*i+g*a+y*s,e[C+1]=u*r+m*i+x*a+w*s,e[C+2]=d*r+p*i+_*a+M*s,e[C+3]=h*r+v*i+b*a+T*s,S+=o,C+=n}},transformMat4View:function(e,t,r){let n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride,l=(0,i.k)(n.length,o,4),c=(0,i.k)(a.length,s,4),u=Math.min(l,c),d=r[0],h=r[1],f=r[2],m=r[3],p=r[4],v=r[5],g=r[6],x=r[7],_=r[8],b=r[9],y=r[10],w=r[11],M=r[12],T=r[13],S=r[14],C=r[15];for(let e=0;e<u;e++){let t=e*o,r=e*s,i=a[r],l=a[r+1],c=a[r+2],u=a[r+3];n[t]=d*i+p*l+_*c+M*u,n[t+1]=h*i+v*l+b*c+T*u,n[t+2]=f*i+g*l+y*c+S*u,n[t+3]=m*i+x*l+w*c+C*u}}},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>n});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);let 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));r.d(t,["ie",0,l,"uC",0,s])},46140(e,t,r){r.d(t,{A:()=>n});var i=r(49186);class n{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)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){let 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 n(this.major,this.minor,this._context)}static parse(e,t=""){let[r,o]=e.split(".",2),a=/^\s*\d+\s*$/;if(!r?.match||!a.test(r)){let r=t&&t+":";throw new i.A(r+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e})}if(!o?.match||!a.test(o)){let r=t&&t+":";throw new i.A(r+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e})}return new n(parseInt(r,10),parseInt(o,10),t)}}},61473(e,t,r){function i(e){return e||=globalThis.location.hostname,c.some(t=>null!=e?.match(t))}function n(e,t){return e?(t||=globalThis.location.hostname,t?null!=t.match(o)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e):null}r.d(t,{EM:()=>n,b5:()=>i});const o=/^devext\.arcgis\.com$/,a=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,o,a,/^jsapps\.esri\.com$/,s,l]},18370(e,t,r){r.d(t,{z:()=>n});class i{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return this._promise??=this._import().then(async e=>(this.module=e,e)),this._promise}}function n(e){return new i(e)}},88340(e,t,r){function i(){return new Float32Array(2)}function n(e,t){let r=new Float32Array(2);return r[0]=e,r[1]=t,r}function o(){return i()}function a(){return n(1,1)}function s(){return n(1,0)}function l(){return n(0,1)}r.d(t,{Un:()=>u,fA:()=>n,uY:()=>c,vt:()=>i});const c=o(),u=a(),d=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){let t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:n,ones:a,unitX:s,unitY:l,zeros:o},Symbol.toStringTag,{value:"Module"}))},69397(e,t,r){r.d(t,{JY:()=>f,Qf:()=>l,Qh:()=>a,lM:()=>o,ro:()=>c,rq:()=>u});var i=r(44208),n=r(34275);function o(e){if(!e)return 0;let t=d;for(let r in e)e.hasOwnProperty(r)&&(t+=s(e[r],!1));return t}function a(e){if(!e)return 0;if("number"==typeof e[0])return l(e);if(Array.isArray(e))return function(e){let t=e.length;if(0===t||"number"==typeof e[0])return u(e,8);let r=h;for(let i=0;i<t;i++)r+=s(e[i]);return r}(e);let t=d;for(let r in e)e.hasOwnProperty(r)&&(t+=s(e[r]));return t}function s(e,t=!0){switch(typeof e){case"object":return t?a(e):d;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function l(...e){return e.reduce((e,t)=>e+c(t),0)}function c(e,t=16){return e?(0,n.iu)(e)?e.byteLength+m:Array.isArray(e)?u(e,t):0:0}function u(e,t){return h+e.length*t}const d=32,h=16,f=(0,i.A)("ios")||!(0,i.A)("chrome")&&!(0,i.A)("opr")?8:4,m=145},65806(e,t,r){r.d(t,{g:()=>a});var i=r(51850),n=r(99917),o=r(9762);function a(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r))return s[0]=e.x,s[1]=e.y,s[2]=e.z??0,(0,o.projectBuffer)(s,e.spatialReference,0,t,r,0);let a=(0,n.tryProject)(e,r,i);return!!a&&(t[0]=a.x,t[1]=a.y,t[2]=a.z??0,!0)}const s=(0,i.vt)()},27993(e,t,r){r.d(t,{F:()=>s});var i=r(99917),n=r(16930),o=r(9762),a=r(65806);function s(e,t,r,n){return!(null==t||null==n||e.length<2)&&((0,i.canProjectWithoutEngine)(t,n)?(0,o.projectBuffer)(e,t,0,r,n,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,a.g)(l,r,n)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:n.A.WGS84,type:"point"}},97146(e,t,r){r.d(t,{Dg:()=>o,lc:()=>d,my:()=>a,tM:()=>h,uW:()=>n});var i=r(34275);function n(e){return o(e,!0)}function o(e,t){if(Array.isArray(e)){if(e.length<1024)return e}else if(e.length<1024)return Array.from(e);let r=!0,n=!0;return e.some((e,t)=>(r&&=0===e,n&&=e===t,!r&&!n)),r?function(e){if(1===e)return c;if(e<1024)return Array(e).fill(0);if(e>l.length){let t=Math.max(2*l.length,e);l=new Uint8Array(t)}return new Uint8Array(l.buffer,0,e)}(e.length):n?h(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(let r of e){if(r>=65536)return(0,i.iu)(e)?e:new Uint32Array(e);r>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function a(e,t=e){return e<=1024?Array(e):t<=65536?new Uint16Array(e):new Uint32Array(e)}let s=f(131072),l=new Uint8Array(65536);const c=[0],u=(()=>{let e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function d(e){if(e===c)return!0;if(!(0,i.iu)(e))return!1;let{buffer:t}=e;return t===u.buffer||t===s.buffer||t===l.buffer}function h(e){return 1===e?c:e<1024?function(e){let t=Array(e).fill(0);for(let r=0;r<e;r++)t[r]=r;return t}(e):e<u.length?new Uint16Array(u.buffer,0,e):(e>s.length&&(s=f(Math.max(2*s.length,e))),new Uint32Array(s.buffer,0,e))}function f(e){let t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}},72727(e,t,r){function i(e,t,r){if(t<=0)return 0;let i=e-r;return i<0?0:Math.floor(i/t)+1}r.d(t,{k:()=>i}),r(53966)},65720(e,t,r){r.d(t,{C:()=>g,vt:()=>p,Qy:()=>v,ui:()=>x,ST:()=>T,bU:()=>C,pw:()=>M,m7:()=>_,ZU:()=>b,GH:()=>w,Pi:()=>y,LJ:()=>S,c8:()=>I});var i=r(58083),n=r(35522),o=r(51850),a=r(78955),s=r(91829),l=r(4341),c=r(70328),u=r(71351);function d(e){return e?{ray:(0,u.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,u.vt)(),c0:0,c1:Number.MAX_VALUE}}new l.I(()=>d());var h=r(27921);function f(e,t,r,i){let{t0:n,t1:o}=i,a=(0,h.mN)(e,t),s=(0,h.mN)(e,r);if(a>=0&&s>=0)return!1;if(a<0&&s>=0){let e=-a/(s-a);if(e<n)return!1;e<o&&(o=e)}else if(a>=0&&s<0){let e=a/(a-s);if(e>o)return!1;e>n&&(n=e)}return i.t0=n,i.t1=o,!0}var m=r(32114);function p(e){return e?[(0,h.vt)(e[0]),(0,h.vt)(e[1]),(0,h.vt)(e[2]),(0,h.vt)(e[3]),(0,h.vt)(e[4]),(0,h.vt)(e[5])]:[(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)()]}function v(){return[(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)(),(0,o.vt)()]}function g(e,t){for(let r=0;r<O;r++)(0,h.C)(e[r],t[r]);return e}function x(e,t,r,o=F){let s=(0,i.lw)(m.Rc.get(),t,e);(0,i.B8)(s,s);for(let e=0;e<P;++e){let t=(0,a.Z0)(m.Km.get(),D[e],s);(0,n.hZ)(o[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}var l,c;l=r,c=o,(0,h.Cr)(c[4],c[0],c[3],l[0]),(0,h.Cr)(c[1],c[5],c[6],l[1]),(0,h.Cr)(c[4],c[5],c[1],l[2]),(0,h.Cr)(c[3],c[2],c[6],l[3]),(0,h.Cr)(c[0],c[1],c[2],l[4]),(0,h.Cr)(c[5],c[4],c[7],l[5])}function _(e,t){return b(e,t.center,t.radius)}function b(e,t,r){for(let i=0;i<O;i++){let n=e[i];if(n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]>=r)return!1}return!0}function y(e,t,r){for(let i of E)if((0,h.wE)(e[i],t,r))return!0;return!1}function w(e,t,r){let i=(0,c.gX)(t,B),o=(0,c.VL)(t)/2,a=(0,c.yr)(t)/2,s=(0,c.uJ)(t)/2;return r?function(e,t,r,i,o,a){let s=(0,n.Z0)(N,t,a);for(let t=0;t<O;t++){let n=e[t];if(n[0]*s[0]+n[1]*s[1]+n[2]*s[2]+n[3]-(Math.abs(n[0]*a[0]+n[1]*a[1]+n[2]*a[2])*r+Math.abs(n[0]*a[4]+n[1]*a[5]+n[2]*a[6])*i+Math.abs(n[0]*a[8]+n[1]*a[9]+n[2]*a[10])*o)>0)return!1}return!0}(e,i,o,a,s,r):function(e,t,r,i,n){for(let o=0;o<O;o++){let a=e[o];if(a[0]*t[0]+a[1]*t[1]+a[2]*t[2]+a[3]-(Math.abs(a[0])*r+Math.abs(a[1])*i+Math.abs(a[2])*n)>0)return!1}return!0}(e,i,o,a,s)}function M(e,t){return A(e,function(e,t=d()){return(0,u.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,R.get()))}function T(e,t,r){return A(e,function(e,t,r=d()){let i=(0,n.Bw)(e.vector);return(0,u.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,R.get()))}function S(e,t,r){return function(e,t,r,i){let n={t0:0,t1:1};for(let o of t)if(!f(e[o],r,i,n))return!1;return n.t0<n.t1}(e,E,t,r)}function C(e,t){for(let r=0;r<O;r++)if((0,h.mN)(e[r],t)>0)return!1;return!0}function A(e,t){for(let r=0;r<O;r++)if(!(0,h.$Q)(e[r],t))return!1;return!0}const E=[0,1,2,3,5],I={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},O=6,P=8,D=[(0,s.fA)(-1,-1,-1,1),(0,s.fA)(1,-1,-1,1),(0,s.fA)(1,1,-1,1),(0,s.fA)(-1,1,-1,1),(0,s.fA)(-1,-1,1,1),(0,s.fA)(1,-1,1,1),(0,s.fA)(1,1,1,1),(0,s.fA)(-1,1,1,1)],R=new l.I(d),F=v(),B=(0,o.vt)(),N=(0,o.vt)()},11964(e,t,r){r.d(t,{Cr:()=>u,LV:()=>c,_I:()=>d,vt:()=>l});var i=r(35522),n=r(51850),o=r(34727),a=r(4341),s=r(32114);function l(e){return e?{origin:(0,n.o8)(e.origin),vector:(0,n.o8)(e.vector)}:{origin:(0,n.vt)(),vector:(0,n.vt)()}}function c(e,t){let r=h.get();return r.origin=e,r.vector=t,r}function u(e,t,r=l()){return(0,i.C)(r.origin,e),(0,i.Re)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,n,a){let{vector:l,origin:c}=e,u=(0,i.Re)(s.rq.get(),t,c),d=(0,i.Om)(l,u)/(0,i.m3)(l);return(0,i.hs)(a,l,(0,o.qE)(d,0,1)),(0,i.WQ)(a,a,e.origin)}(e,t,0,0,r)}(0,n.vt)(),(0,n.vt)();const h=new a.I(()=>l())},52039(e,t,r){r.d(t,{O7:()=>h,Y_:()=>m,el:()=>c});var i=r(69052),n=(r(49186),r(18370)),o=r(17676),a=(r(5443),r(39829)),s=(r(82799),r(16930)),l=(r(80754),r(21325));async function c(e,t,r){Array.isArray(e)||(e=[e]),"object"==typeof t&&t&&"authMode"in t&&(r=t);let i=null;for(let t of e)i??=t?.spatialReference;if(!i)return e;let n=(0,l.Vp)(i);if(!n)return e;if(1===e.length&&"extent"===e[0]?.type){let t=e[0].clone().normalizeAsSingleGeometry(n);return["xmin"in t?t:new a.A(t)]}let[s,c]=n.valid,h=!1;for(let t of e){if(!t)continue;if("point"===t.type){h||=t.x>=c,h||=t.x<=s;continue}let{extent:e}=t;if(null==e){h=!0;break}h||=e.xmin>=c,h||=e.xmin<=s,h||=e.xmax>=c,h||=e.xmax<=s}if(!h)return e;let[{foldInto360Range:f},m]=await(0,o.qr)(Promise.all([u.getImportPromise(),d.getImportPromise()]),r),p=m.fromSpatialReference(i);return e.map(e=>{if(null==e||"mesh"===e.type)return e;let t=m.fromGeometry(e),r=m.toGeometry(f(t,p),i);return"extent"===e.type&&1===r?.rings.length?r.extent:r})}const u=(0,n.z)(()=>r.e(4144).then(()=>r(4144)).then(e=>e.load().then(()=>e))),d=(0,n.z)(()=>Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(1550)]).then(()=>r(78125)));function h(e,t,r){let i=(0,l.Vp)(r);if(null==i)return e;let[n,o]=i.valid,a=2*o,s=0,c=0;t>o?s=Math.ceil(Math.abs(t-o)/a):t<n&&(s=-Math.ceil(Math.abs(t-n)/a)),e>o?c=Math.ceil(Math.abs(e-o)/a):e<n&&(c=-Math.ceil(Math.abs(e-n)/a));let u=e+(s-c)*a,d=u-t;return d>o?u-=a:d<n&&(u+=a),u}function f(e){let t=(0,l.Vp)(e);if(null==t)return null;let[r,n]=t.valid;return new i.hr(r,n)}const m=f(s.A.WGS84);f(s.A.WebMercator)},48295(e,t,r){r.d(t,{BU:()=>u,Ui:()=>s,cq:()=>c,k3:()=>d,rb:()=>h});var i=r(35522),n=r(51850),o=r(4341),a=r(11964);function s(e,t,r){let{direction:n,origin:o}=t,{p0:a,p1:s,p2:l}=e,c=s[0]-a[0],u=s[1]-a[1],d=s[2]-a[2],h=l[0]-a[0],f=l[1]-a[1],m=l[2]-a[2],p=n[1]*m-f*n[2],v=n[2]*h-m*n[0],g=n[0]*f-h*n[1],x=c*p+u*v+d*g;if(x>-1e-5&&x<1e-5)return!1;let _=1/x,b=o[0]-a[0],y=o[1]-a[1],w=o[2]-a[2],M=_*(b*p+y*v+w*g);if(M<0||M>1)return!1;let T=y*d-u*w,S=w*c-d*b,C=b*u-c*y,A=_*(n[0]*T+n[1]*S+n[2]*C);if(A<0||M+A>1)return!1;if(r){let e=_*(h*T+f*S+m*C);(0,i.hs)(r,n,e),(0,i.WQ)(r,o,r)}return!0}function l(e,t,r){let[i,n]=e,[o,a]=t,[s,l]=r;return.5*((o-i)*(l-n)-(a-n)*(s-i))}function c(e,t,r,i,n=0){let o=l(i,e,t),a=l(i,t,r),s=l(i,r,e);return!((o<-n||a<-n||s<-n)&&(o>n||a>n||s>n))}function u(e,t,r){return(0,i.Re)(f,t,e),(0,i.Re)(m,r,e),.5*(0,i.Bw)((0,i.$A)(f,f,m))}function d(e,t,r,n,o){(0,i.jb)(f,n,r),(0,i.jb)(p,o,r),(0,i.jb)(m,t,r);let a=(0,i.Om)(f,m),s=(0,i.Om)(p,m);if(a<=0&&s<=0)return void(0,i.C)(e,r);(0,i.jb)(m,t,n);let l=(0,i.Om)(f,m),c=(0,i.Om)(p,m);if(l>=0&&c<=l)return void(0,i.C)(e,n);let u=a*c-l*s;if(u<=0&&a>=0&&l<=0)return void(0,i.Ln)(e,r,f,a/(a-l));(0,i.jb)(m,t,o);let d=(0,i.Om)(f,m),h=(0,i.Om)(p,m);if(h>=0&&d<=h)return void(0,i.C)(e,o);let v=d*s-a*h;if(v<=0&&s>=0&&h<=0)return void(0,i.Ln)(e,r,p,s/(s-h));let g=l*h-d*c;if(g<=0&&c-l>=0&&d-h>=0)return(0,i.jb)(m,o,n),void(0,i.Ln)(e,n,m,(c-l)/(c-l+(d-h)));let x=1/(g+v+u);(0,i.C)(e,r),(0,i.Ln)(e,e,f,v*x),(0,i.Ln)(e,e,p,u*x)}function h(e,t,r,n){(0,i.jb)(f,r,t),(0,i.jb)(m,n,t),(0,i.$A)(e,f,m);let o=(0,i.Bw)(e);return 0!==o&&((0,i.hs)(e,e,1/o),!0)}r(32114),new o.I(a.vt),new o.I(()=>{return e?{p0:(0,n.o8)(e.p0),p1:(0,n.o8)(e.p1),p2:(0,n.o8)(e.p2)}:{p0:(0,n.vt)(),p1:(0,n.vt)(),p2:(0,n.vt)()};var e});const f=(0,n.vt)(),m=(0,n.vt)(),p=(0,n.vt)()},21015(e,t,r){r.d(t,{R:()=>l});var i=r(60999),n=r(49186),o=r(17676),a=r(84952),s=r(78888);class l{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,a.DB)(e)?((0,o.Te)(t),(0,a.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);let a=await(0,i.Ke)((0,s.A)(t,{responseType:e,...r}));if(a.ok)return a.value.data;throw(0,o.QP)(a.error),new n.A("gltf-loader-request-error",`Request for resource failed: ${a.error}`)}}},84498(e,t,r){r.d(t,{x:()=>a});var i=r(34275),n=r(97146),o=r(63907);function a(e,t){switch(t){case o.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,n.tM)(e):(0,i.mg)(e)?new Uint16Array(e):e}(e);case o.WR.TRIANGLE_STRIP:return function(e){let t="number"==typeof e?e:e.length;if(t<3)return[];let r=t-2,i=(0,n.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let n=0;n<r;n+=1)n%2==0?(i[t++]=e[n],i[t++]=e[n+1],i[t++]=e[n+2]):(i[t++]=e[n+1],i[t++]=e[n],i[t++]=e[n+2])}return i}(e);case o.WR.TRIANGLE_FAN:return function(e){let t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array;let r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}let n=e[0],o=e[1],a=0;for(let t=0;t<r;++t){let r=e[t+2];i[a++]=n,i[a++]=o,i[a++]=r,o=r}return i}(e)}}},51530(e,t,r){r.d(t,{KB:()=>a,Xi:()=>n,pn:()=>s,x3:()=>o});var i=r(44208);class n{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function o(e){return"encoded-mesh-texture"===e?.type}async function a(e){let t=await new Blob([e]).text();return JSON.parse(t)}async function s(e,t){if("image/ktx2"===t)return new n(e);let r=new Blob([e],{type:t}),o=URL.createObjectURL(r);switch(t){case"image/jpeg":o+="#.jpg";break;case"image/png":o+="#.png"}let a=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{let r=()=>{n(),e(a)},i=e=>{n(),t(e)},n=()=>{URL.revokeObjectURL(o),a.removeEventListener("load",r),a.removeEventListener("error",i)};a.addEventListener("load",r),a.addEventListener("error",i),a.src=o});try{a.src=o,await a.decode()}catch{}return URL.revokeObjectURL(o),a}},47143(e,t,r){r.d(t,{fetch:()=>Or});var i=r(40876),n=r(61473),o=r(77690),a=r(29242),s=r(58083),l=r(9093),c=r(48163),u=r(35522),d=r(51850),h=r(34727),f=r(70328),m=r(13030),p=r(73354),v=r(50867),g=r(43609);function x(e,t=!1){return e<=1024?t?Array(e).fill(0):Array(e):new Float32Array(e)}var _=r(21015),b=r(84498),y=r(51530),w=r(88340);function M(e){if(null==e)return null;let t=null==e.offset?w.uY:e.offset,r=null==e.rotation?0:e.rotation,i=null==e.scale?w.Un:e.scale,n=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,a.vt)();return(0,o.lw)(c,s,l),(0,o.lw)(c,n,c),c}var T=r(46610),S=r(69397),C=r(97146),A=r(94656),E=r(34275);function I(e){if(e.length<1024)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,E.LW)(e)?Float16Array.from(e):(0,E.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return(0,E.vZ)(e)?Float32Array.from(e):Uint32Array.from(e);default:return Float64Array.from(e)}}var O=r(15142),P=r(28540),D=r(620);class R{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this._readPosition=r,this._notifyMemoryChange=i,this._children=void 0,(0,D.vA)(e.length>=1);let n=e.length;z.clear();let o=(0,f.Ie)();for(let i=0;i<n;++i){let n=t*e[i];for(let e=0;e<t;++e){let t=n+e;z.push(t),(0,f.iT)(o,r(F,t))}}this.box=o;let a=new P.i,s=(0,f.gX)(o,a.center),l=.5*Math.max((0,f.VL)(o),(0,f.yr)(o),(0,f.uJ)(o)),c=l*l;for(let e=0;e<z.length;++e){let t=r(F,z.at(e)),i=(0,u.Re)(t,t,s),n=(0,u.uE)(i);if(n<=c)continue;let o=Math.sqrt(n),a=.5*(o-l);l+=a,c=l*l;let d=a/o;(0,u.Ln)(s,s,i,d)}a.radius=l,this.sphere=a,z.clear()}get usedMemory(){let e=88+(0,S.rq)(this.box,8)+32+16+(0,S.rq)(this.sphere.center,8)+function(e){return(0,E.iu)(e)?145+((0,C.lc)(e)?0:e.byteLength):(0,C.lc)(e)?0:(0,S.rq)(e,S.JY)}(this.primitiveIndices),t=this._children;if(t){e+=(0,S.rq)(t,8);for(let r of t)e+=r.usedMemory}return e}get children(){if(this._children)return this._children;let e=this.box;if((0,f.TF)(e)<=1)return;let{_readPosition:t,_numIndexPerPrimitive:r,primitiveIndices:i}=this,n=(0,f.gX)(e,F),o=i.length,a=new Uint8Array(o),s=[0,0,0,0,0,0,0,0];for(let e=0;e<o;++e){let o=r*i[e],l=t(B,o);for(let e=1;e<r;++e)(0,u.jk)(l,l,t(N,o+e));let c=+(l[0]<n[0])|(l[1]<n[1]?2:0)|(l[2]<n[2]?4:0);a[e]=c,++s[c]}let l=0;for(let e=0;e<8;++e)s[e]>0&&++l;if(l<2)return;let c=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0];for(let e=0;e<8;++e)s[e]>0&&(c[e]=new Uint32Array(s[e]));s.fill(0);for(let e=0;e<o;++e){let t=a[e];c[t][s[t]++]=i[e]}let d=[];for(let e=0;e<8;++e){let i=c[e];void 0!==i&&d.push(new R(i,r,t,this._notifyMemoryChange))}return this._children=d,this._notifyMemoryChange?.((0,S.rq)(d,8)+d.reduce((e,t)=>e+t.usedMemory,0)),d}static prune(){z.prune()}}const F=(0,d.vt)(),B=(0,d.vt)(),N=(0,d.vt)(),z=new O.A({deallocator:null});var L=r(24326);class H{constructor(e){this.id=(0,L.c)(),this.type=0,this._attributes=new Map;for(let[t,r]of e)this._attributes.set(t,{...r,indices:(0,C.Dg)(r.indices)})}get attributes(){return this._attributes}}class V{constructor(){this.uid=(0,L.c)()}}class U extends V{constructor(e){super(),this.highlightName=e,this.channel=0}}class j extends H{get usedMemoryExcludingBuffers(){return this._usedMemory+this._primitivePositionIndicesMemory+(this._boundingInfo?.usedMemory??0)}get _primitivePositionIndicesMemory(){let e=this._vertexPositionIndicesCache;return e&&e!==this.positionAttribute?.indices?(0,S.ro)(e,S.JY):0}computeBufferMemory(e){let t=e.arrayMemory(this.mapPositions)+e.arrayMemory(this.drawIndices,S.JY,!0);for(let r of this.attributes.values())t+=e.arrayMemory(r.data)+e.arrayMemory(r.indices,S.JY,!0);return t}constructor(e,t,r=null,i=-1,n,o){super(t),this.material=e,this.mapPositions=r,this.edgeIndicesLength=i,this.baseGeometry=n,this.drawIndices=o,this._usedMemory=0,this._readPrimitivePosition=null,this._vertexPositionIndicesCache=void 0,this._transformation=void 0,this.localOrigin=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.occludees=void 0,this.visible=!0,this._boundingInfo=null,(0,D.vA)((e?.useIndexing??!1)===(null!=o),"Material index requirement and Geometry must match"),this.edgeIndicesLength<0&&(this.edgeIndicesLength=this.indexCount)}get readPrimitivePosition(){return this._readPrimitivePosition??=function(e,t){let{data:r,indices:i,size:n,stride:o}=e;return(0,D.vA)(2===n||3===n||4===n,"Position attribute must have 2, 3 or 4 components"),2===n?null==t?(e,t)=>{let n=i[t]*o;return e[0]=r[n],e[1]=r[n+1],e[2]=-2,e}:(e,n)=>{let a=i[t[n]]*o;return e[0]=r[a],e[1]=r[a+1],e[2]=-2,e}:null==t?function(e,t,r){return(i,n)=>{let o=t[n]*r;return i[0]=e[o],i[1]=e[o+1],i[2]=e[o+2],i}}(r,i,o):(e,n)=>{let a=i[t[n]]*o;return e[0]=r[a],e[1]=r[a+1],e[2]=r[a+2],e}}(this.positionAttribute,this.drawIndices),this._readPrimitivePosition}_invalidateReadPrimitivePosition(){this._readPrimitivePosition=null}instantiate(e={}){let t=new j(e.material||this.material,[],this.mapPositions,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);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}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:I(t.data)},this._attributes.set(e,t),"position"===e&&this._invalidateReadPrimitivePosition()),t}setAttributeData(e,t){let r=this._attributes.get(e);r?(this._attributes.set(e,{...r,exclusive:!0,data:t}),"position"===e&&this._invalidateReadPrimitivePosition()):(0,A.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get primitivePositionIndices(){if(void 0!==this._vertexPositionIndicesCache)return this._vertexPositionIndicesCache;this._vertexPositionIndicesCache=this._computePrimitivePositionIndices();let e=this._primitivePositionIndicesMemory;return e&&this.notifyMemoryChange?.(e),this._vertexPositionIndicesCache}_computePrimitivePositionIndices(){let{drawIndices:e}=this,t=this.positionAttribute;if(null!=e&&null!=t){let r=Array(e.length).fill(0);for(let i=0;i<e.length;i++)r[i]=t.indices[e[i]];return r}return t?.indices??null}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){return(this.drawIndices??this.positionAttribute?.indices)?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo||(this._boundingInfo=this._calculateBoundingInfo(),this._boundingInfo&&this.notifyMemoryChange?.(this._boundingInfo.usedMemory)),this._boundingInfo}computeAttachmentOrigin(e){return!!this.material.computeAttachmentOrigin(e,this.readPrimitivePosition,this.indexCount)&&(null!=this._transformation&&(0,u.Z0)(e,e,this._transformation),!0)}invalidateBoundingInfo(){let e=this._primitivePositionIndicesMemory+(this._boundingInfo?.usedMemory??0);this._boundingInfo=null,this._vertexPositionIndicesCache=void 0,e&&this.notifyMemoryChange?.(-e)}_calculateBoundingInfo(){let e=this.positionAttribute,t=this.indexCount;if(!e||0===t)return null;let r=this.material.primitiveVertexCount;(0,D.vA)(t%r===0,"Indexing error: "+t+" not divisible by "+r);let i=(0,C.tM)(t/r);return new R(i,r,this.readPrimitivePosition,e=>this.notifyMemoryChange?.(e))}get transformation(){return this._transformation??l.zK}set transformation(e){this._transformation=e&&e!==l.zK?(0,l.o8)(e):null}get highlights(){return this._highlights||G}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}forEachHighlightOption(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){let t=new U(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);let{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){let{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const G=new Set;var k=r(76200),W=r(49788),$=r(49255),Z=r(97768),q=r(17676),Y=r(65786);class X{constructor(e){this._material=e.material,this._techniques=e.techniques}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(t))}ensureResources(e){return 2}}class K extends X{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,Z.Gz)(this._texture),this._textureNormal=(0,Z.Gz)(this._textureNormal),this._textureEmissive=(0,Z.Gz)(this._textureEmissive),this._textureOcclusion=(0,Z.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,Z.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new Q(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){(null==this._texture||e!==this._texture.id)&&(this._texture=(0,Z.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);let r=this._textures.acquire(e);(0,q.$X)(r)?(++this._numLoading,r.then(e=>{this._disposed?((0,Z.Gz)(e),t(null)):t(e)}).finally(()=>--this._numLoading)):t(r)}}class J extends Y.Y{constructor(e=null){super(),this.textureEmissive=e}}class Q extends J{constructor(e,t,r,i,n,o,a){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.normalScale=o,this.normalTextureTransformMatrix=a}}var ee=r(19245),te=r(48295);const re=(0,d.vt)(),ie=(0,d.vt)(),ne=(0,d.vt)(),oe=(0,d.vt)();class ae{constructor(e,t){this.id=(0,L.c)(),this.supportsEdges=!1,this.primitiveVertexCount=3,this._renderPriority=0,this._parameters=new t,(0,ee.MB)(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,ee.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:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get emissions(){return 0}getConfiguration(e){return this.updateConfiguration(e),this._configuration}updateConfiguration(e){this._configuration.output=e.output,this._configuration.hasEmission=e.hasEmission&&(0,$._o)(e.output),this._configuration.hasHighlightMixTexture=10===e.output&&null!=e.highlightMixTexture,this._configuration.useFloatBlend=e.useFloatBlend.value,this._configuration.emissionDimmingPass=e.transparentWithoutDepthEmissionDimmingPass&&(0,$._o)(e.output)}computeAttachmentOrigin(e,t,r){return function(e,t,r){if(r<=0)return!1;(0,u.hZ)(e,0,0,0),(0,u.hZ)(oe,0,0,0);let i=0,n=0;for(let o=0;o<r;++o){let r=3*o;t(re,r),t(ie,r+1),t(ne,r+2);let a=(0,te.BU)(re,ie,ne);a?((0,u.WQ)(re,re,ie),(0,u.WQ)(re,re,ne),(0,u.hs)(re,re,1/3*a),(0,u.WQ)(e,e,re),i+=a):((0,u.WQ)(oe,oe,re),(0,u.WQ)(oe,oe,ie),(0,u.WQ)(oe,oe,ne),n+=3)}return!(0===n&&0===i||(0===i?0===n||((0,u.hs)(e,oe,1/n),0):((0,u.hs)(e,e,1/i),0)))}(e,t,r/3)}getPrimitivePositionCount(e,t){return(t??e).indexCount}}Y.Y;var se=r(58682),le=r(90629),ce=r(65720),ue=r(27921),de=r(19419),he=r(11964);function fe(e,t){return e.isRectangle?(0,de.Uc)(e.bounds,t):function(e,t){return pe(e[0],e[1],t)}(t,e.points)}function me(e,t,r,i){let n=Math.min(t[0],r[0],i[0]),o=Math.min(t[1],r[1],i[1]),a=Math.max(t[0],r[0],i[0]),s=Math.max(t[1],r[1],i[1]);if(!function(e,t){if(!(0,de.HY)(e.bounds,t))return!1;if(e.isRectangle)return!0;for(let r of e.points)if((0,de.Uc)(t,r))return!0;if(function(e,t){let r=e[0],i=e[1],n=e[2],o=e[3];return pe(r,i,t)||pe(n,i,t)||pe(n,o,t)||pe(r,o,t)}(t,e.points))return!0;for(let r=0;r<e.points.length;r++)if(ve(e.points[r],r===e.points.length-1?e.points[0]:e.points[r+1],t))return!0;return!1}(e,(0,de.fA)(n,o,a,s,we)))return!1;if(fe(e,t)||fe(e,r)||fe(e,i))return!0;for(let n of e.points)if((0,te.cq)(t,r,i,n,Me))return!0;for(let n=0;n<e.points.length;n++){let o=e.points[n],a=e.points[(n+1)%e.points.length];if(xe(t,r,o,a)||xe(r,i,o,a)||xe(i,t,o,a))return!0}return!1}function pe(e,t,r){let i=!1;for(let n=0,o=r.length-1;n<r.length;o=n++){let a=r[n],s=r[o];a[1]>t!=s[1]>t&&e<(s[0]-a[0])*(t-a[1])/(s[1]-a[1])+a[0]&&(i=!i)}return i}function ve(e,t,r){let i=r[0],n=r[1],o=r[2],a=r[3],s=e[0],l=e[1],c=t[0],u=t[1];return!(s<i&&c<i||s>o&&c>o||l<n&&u<n||l>a&&u>a)&&(!(!(0,de.Rj)(r,s,l)&&!(0,de.Rj)(r,c,u))||ge(e,t,i,n,o,n)||ge(e,t,o,n,o,a)||ge(e,t,o,a,i,a)||ge(e,t,i,a,i,n))}function ge(e,t,r,i,n,o){let a=_e(e[0],e[1],t[0],t[1],r,i),s=_e(e[0],e[1],t[0],t[1],n,o),l=_e(r,i,n,o,e[0],e[1]),c=_e(r,i,n,o,t[0],t[1]);return a!==s&&l!==c||0===a&&be(e,t,r,i)||0===s&&be(e,t,n,o)||0===l&&ye(r,i,n,o,e[0],e[1])||0===c&&ye(r,i,n,o,t[0],t[1])}function xe(e,t,r,i){return ge(e,t,r[0],r[1],i[0],i[1])}function _e(e,t,r,i,n,o){let a=(i-t)*(n-r)-(r-e)*(o-i);return Math.abs(a)<=Me?0:Math.sign(a)}function be(e,t,r,i){return ye(e[0],e[1],t[0],t[1],r,i)}function ye(e,t,r,i,n,o){return n>=Math.min(e,r)-Me&&n<=Math.max(e,r)+Me&&o>=Math.min(t,i)-Me&&o<=Math.max(t,i)+Me}const we=(0,de.vt)(),Me=((0,le.r_)(),(0,le.r_)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,he.vt)(),1e-9);class Te{constructor(e){this.type=e,this.distance=1/0,this.renderDistance=1/0,this.primitiveIndex=0,this.hasNormal=!1,this.point=(0,d.vt)(),this.normal=(0,d.vt)()}reset(){this.distance=1/0,this.renderDistance=1/0,this.hasNormal=!1}update(e,t,r,i,n=e){this.distance=e,this.renderDistance=n,this.primitiveIndex=t,(0,u.C)(this.point,r),this.hasNormal=null!=i,null!=i&&(0,u.C)(this.normal,i)}updateIfCloserFromValues(e,t,r,i,n=e){n<this.renderDistance&&this.update(e,t,r,i,n)}updateIfCloser(e){let{distance:t,renderDistance:r,primitiveIndex:i,point:n,normal:o}=e;this.updateIfCloserFromValues(t,i,n,e.hasNormal?o:null,r)}get valid(){return Number.isFinite(this.distance)}}function Se(e,t,r,i,n){if(!e.visible)return null;let o,a=new Te(4);o=e.boundingInfo?Ae(e.readPrimitivePosition,e.boundingInfo,t,r,i,n):Ce(t,r,i,0,e.faceCount,e.readPrimitivePosition,n,null,0);for(let e of o)a.updateIfCloser(e);return a.valid?a:null}function*Ce(e,t,r,i,n,o,a,s=null,l=0){if(null==e.camera)return;let{camera:c,screenPolygonPrimitiveProcessor:d}=e;for(let e=i;e<n;++e){let i=(s?.[e]??e)+l,n=null==s?i:e,h=3*i;Ee(De[0],o,h+0,a,n,t),Ee(De[1],o,h+1,a,n,t),Ee(De[2],o,h+2,a,n,t);let f,m=Le;Ve.reset();let p=Re;for(let e of d.processTriangle(De))Ie(r,e,c,p)&&(Oe(c.eye,p,ze),f??=(0,te.rb)(Le,De[0],De[1],De[2]),Ve.updateIfCloserFromValues((0,u.Io)(c.eye,ze),i,ze,f?m:null));Ve.valid&&(yield Ve)}}function*Ae(e,t,r,i,n,o){let a;if(null==o?a=(0,ce.GH)(n.broadPhaseFrustum,t.box,i):((0,f.C)(Pe,t.box),o.applyToAabb(Pe),a=(0,ce.GH)(n.broadPhaseFrustum,Pe,i)),!a)return;let{primitiveIndices:s}=t,l=s.length;if(l>1e3){let a=t.children;if(void 0!==a){for(let t of a)yield*Ae(e,t,r,i,n,o);return}}yield*Ce(r,i,n,0,l,e,o,s,0)}function Ee(e,t,r,i,n,o){let[a,s,l]=t(e,r);null==i?(0,u.hZ)(e,a,s,l):i.applyToVertex(e,a,s,l,n),o&&(0,u.Z0)(e,e,o)}function Ie(e,t,r,i){if(i.length=0,(0,ue.H)(r.frustum[4],t,()=>i.pushNew()),i.length<3)return!1;let n=Fe,o=Be,a=Ne;r.projectToScreen(i.data[0],n),r.projectToScreen(i.data[1],o);for(let t=2;t<i.length;t++){if(r.projectToScreen(i.data[t],a),me(e,n,o,a))return!0;let s=o;o=a,a=s}return!1}function Oe(e,t,r){let i=1/0,n=t.at(0);for(let o=1;o<t.length-1;o++){(0,te.k3)(He,e,n,t.at(o),t.at(o+1));let a=(0,u.hG)(e,He);a<i&&(i=a,(0,u.C)(r,He))}}const Pe=(0,f.vt)(),De=[(0,d.vt)(),(0,d.vt)(),(0,d.vt)()],Re=new O.A({allocator:e=>e??(0,d.vt)()}),Fe=(0,le.gs)(),Be=(0,le.gs)(),Ne=(0,le.gs)(),ze=(0,d.vt)(),Le=(0,d.vt)(),He=(0,d.vt)(),Ve=new Te(4);var Ue=r(16396),je=r(32198),Ge=r(91429),ke=r(91829),We=r(90644),$e=r(4431),Ze=r(1843),qe=(r(31821),r(35644),r(96336),r(87757));class Ye extends qe.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,a.vt)()}}qe.EM;var Xe=r(13840),Ke=r(42958),Je=r(16943);r(4576),r(66289);var Qe=r(56372),et=r(65529),tt=r(32728);class rt{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",m.Eq),this.color=e.getField("instanceColor",m.XP),this.olidColor=e.getField("instanceOlidColor",m.XP),this.state=e.getField("state",m.SL),this.lodLevel=e.getField("lodLevel",m.SL)}}let it=class extends Qe.A{constructor(e,t){super(e),this.events=new et.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return ot(nt.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=ut,this._buffer=this._layout.createBuffer(this._capacity),this._view=new rt(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();let e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){let t=this._view.state;(0,D.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){let t=this._view.state;(0,D.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){let t=this._view,r=at,i=st;t.localTransform.getMat(e,lt),t.globalTransform.getMat(e,ct);let n=(0,s.lw)(ct,ct,lt);(0,u.hZ)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,o.z0)(i,n),t.model.setMat(e,i);let a=(0,tt.wp)(at,n);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,o.B8)(i,i),(0,o.mg)(i,i),t.modelNormal.setMat(e,i),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){let r=this._view;r.model.getMat(e,st),r.modelOrigin.getVec(e,at),t[0]=st[0],t[1]=st[1],t[2]=st[2],t[3]=0,t[4]=st[3],t[5]=st[4],t[6]=st[5],t[7]=0,t[8]=st[6],t[9]=st[7],t[10]=st[8],t[11]=0,t[12]=at[0],t[13]=at[1],t[14]=at[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(at,this,e),t*=Math.max(at[0],at[1],at[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(at,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(at[0],at[1],at[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){let{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){let t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){let t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){let r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){let r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(ut,Math.floor(1.5*this._capacity)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new rt(this._buffer)}_findSlot(){let e=this._view.state,t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,je.Cg)([(0,Ge.MZ)({constructOnly:!0})],it.prototype,"shaderTransformation",void 0),(0,je.Cg)([(0,Ge.MZ)()],it.prototype,"_size",void 0),(0,je.Cg)([(0,Ge.MZ)({readOnly:!0})],it.prototype,"size",null),it=(0,je.Cg)([(0,Ge.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],it);const nt=(0,Ze.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function ot(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,Je.E)()&&e.vec4u8("instanceOlidColor"),e}const at=(0,d.vt)(),st=(0,a.vt)(),lt=(0,l.vt)(),ct=(0,l.vt)(),ut=64,dt=(0,Ze.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal"),ht=(0,We.p3)(1,0,1,771);function ft(e,t=!1,r=!1){if(r)return We.uR;switch(e){case 0:return t?We.RC:We.T8;case 1:return ht;default:return null}}function mt(e){if(e.draped)return null;switch(e.output){case 0:case 2:default:return e.writeDepth?We.Uy:null;case 1:return null}}function pt(e,t=513){return{func:(0,$._$)(e)?515:t}}(0,ke._Y)();const vt={mask:255},gt=(0,We.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),xt=(0,We.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681});(0,We.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),(0,We.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680});var _t=r(74810);const bt=Ct(-1),yt=Ct(1),wt=bt,Mt=[];Mt[0]=null,Mt[1]=yt,Mt[2]=bt,Mt[3]=Ct(-2),Mt[4]=Ct(-3);const Tt=Mt.map(e=>function(e,t){return t?{factor:e.factor+t.factor,units:e.units+t.units}:e}(wt,e));function St({output:e,enableOITOffset:t,polygonOffset:r}){return(0,$._$)(e)&&t?Tt[r]:Mt[r]}function Ct(e){return{factor:+e,units:2*e}}Mt[1]=yt;var At=r(28491);class Et extends Ye{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=_t.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=d.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.shadingEnabled=!0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.pretransformedNormals=!1,this.ambient=(0,d.CN)(.2,.2,.2),this.diffuse=(0,d.CN)(.8,.8,.8),this.externalColor=(0,ke.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=W.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}let It=class extends Ke.w{constructor(e,t){let i=(0,$e.U)(Rt(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,$e.U)(function(e){return ot(dt.clone(),e)}(t)))),super(e,t,i),this.shader=new Xe.r(At.D,()=>r.e(5141).then(()=>r(5141))),this.ignoreUnused=!0}_makePipeline(e,t){let{output:r,transparent:i,cullFace:n,customDepthTest:o,hasOccludees:a}=e;return(0,We.Ey)({blending:i?ft(r,!1,e.emissionDimmingPass):null,culling:Pt(e)?(0,We.Xt)(n):null,depthTest:pt(r,Ot(o)),depthWrite:mt(e),colorWrite:We.kn,stencilWrite:a?vt:null,stencilTest:a?t?xt:gt:null,polygonOffset:St(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,r){return r?this._occludeePipelineState:super.getPipeline(e,t,r)}};function Ot(e){switch(e){case 1:return 515;case 0:case 4:return 513;case 2:return 516;case 3:return 514}}function Pt(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Dt(e){return e.hasNormalTexture&&e.hasVertexTangents}function Rt(e){let t=(0,Ze.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),Dt(e)&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,Je.E)()&&t.vec4u8("olidColor"),t}It=(0,je.Cg)([(0,Ge.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],It);var Ft=r(51976),Bt=r(34711);class Nt extends Bt.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,je.Cg)([(0,Ft.W)()],Nt.prototype,"hasHighlightMixTexture",void 0),(0,je.Cg)([(0,Ft.W)()],Nt.prototype,"emissionDimmingPass",void 0);class zt extends Nt{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,je.Cg)([(0,Ft.W)({count:5})],zt.prototype,"polygonOffset",void 0),(0,je.Cg)([(0,Ft.W)()],zt.prototype,"transparent",void 0),(0,je.Cg)([(0,Ft.W)()],zt.prototype,"enableOITOffset",void 0);class Lt extends zt{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,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.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1,this.renderOccluded=!1}get textureCoordinateType(){return+!!this.hasTextures}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}}(0,je.Cg)([(0,Ft.W)({count:4})],Lt.prototype,"alphaDiscardMode",void 0),(0,je.Cg)([(0,Ft.W)({count:3})],Lt.prototype,"doubleSidedMode",void 0),(0,je.Cg)([(0,Ft.W)({count:8})],Lt.prototype,"pbrMode",void 0),(0,je.Cg)([(0,Ft.W)({count:3})],Lt.prototype,"cullFace",void 0),(0,je.Cg)([(0,Ft.W)({count:3})],Lt.prototype,"normalType",void 0),(0,je.Cg)([(0,Ft.W)({count:4})],Lt.prototype,"customDepthTest",void 0),(0,je.Cg)([(0,Ft.W)({count:8})],Lt.prototype,"emissionSource",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasVertexColors",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasSymbolColors",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasVerticalOffset",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasColorTexture",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasMetallicRoughnessTexture",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasOcclusionTexture",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasNormalTexture",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasScreenSizePerspective",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasVertexTangents",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasOccludees",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"instanced",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"instancedDoublePrecision",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasModelTransformation",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"offsetBackfaces",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasVVSize",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasVVColor",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"receiveShadows",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasShadowHighlights",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"receiveAmbientOcclusion",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"receiveGlobalIllumination",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"textureAlphaPremultiplied",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"instancedFeatureAttribute",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"instancedColor",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"writeDepth",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"snowCover",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasColorTextureTransform",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasEmissionTextureTransform",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasNormalTextureTransform",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasOcclusionTextureTransform",void 0),(0,je.Cg)([(0,Ft.W)()],Lt.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Ht=r(57323);let Vt=class extends It{constructor(){super(...arguments),this.shader=new Xe.r(Ht.R,()=>r.e(9933).then(()=>r(39933)))}};Vt=(0,je.Cg)([(0,Ge.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],Vt);var Ut=r(56529);class jt extends Ft.K{constructor(){super(...arguments),this.receiveShadows=!0}}(0,je.Cg)([(0,Ft.W)()],jt.prototype,"receiveShadows",void 0);class Gt extends Ut.D5{constructor(){super(...arguments),this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1}}(0,je.Cg)([(0,Ft.W)()],Gt.prototype,"receiveAmbientOcclusion",void 0),(0,je.Cg)([(0,Ft.W)()],Gt.prototype,"receiveGlobalIllumination",void 0);var kt=r(10614);function Wt(e,t,r){let{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){let t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function $t(e,t,r,i=1){let{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){let 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){let 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 Zt(e,t,r,i,n=1){let{data:o,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t===o.length&&4===t){s[i]=o[0],s[i+1]=o[1],s[i+2]=o[2],s[i+3]=o[3];let e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;let u=c*n;for(let r=1;r<u;++r)e[i]=a,i+=t}else if(1===n){if(4===t){for(let e=0;e<c;++e){let 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){let 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 if(4===t)for(let e=0;e<c;++e){let 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 for(let e=0;e<c;++e){let 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}}const qt=(0,d.vt)();function Yt(e,t,r,i,n,o,a=!1){switch(e){case"position":{(0,D.vA)(3===t.size);let i=n.getField(e,m.xs);(0,D.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void $t(e,r,i,n);let{data:o,indices:a}=e,l=r.typedBuffer,c=r.typedBufferStride,u=a.length,d=t[0],h=t[1],f=t[2],m=t[4],p=t[5],v=t[6],g=t[8],x=t[9],_=t[10],b=t[12],y=t[13],w=t[14];i*=c;let M=0,T=0,S=0,C=(0,s.tZ)(t)?e=>{M=o[e]+b,T=o[e+1]+y,S=o[e+2]+w}:e=>{let t=o[e],r=o[e+1],i=o[e+2];M=d*t+m*r+g*i+b,T=h*t+p*r+x*i+y,S=f*t+v*r+_*i+w};if(1===n)for(let e=0;e<u;++e)C(3*a[e]),l[i]=M,l[i+1]=T,l[i+2]=S,i+=c;else for(let e=0;e<u;++e){C(3*a[e]);for(let e=0;e<n;++e)l[i]=M,l[i+1]=T,l[i+2]=S,i+=c}}(t,r,i,o);break}case"normal":{(0,D.vA)(3===t.size);let r=n.getField(e,m.xs);(0,D.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void $t(e,r,i,n);let{data:o,indices:a}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=a.length,h=l[0],f=l[1],m=l[2],p=l[4],v=l[5],g=l[6],x=l[8],_=l[9],b=l[10],y=!(0,s.ut)(l),w=1e-6,M=.999999;i*=u;let T=0,S=0,C=0,A=(0,s.tZ)(l)?e=>{T=o[e],S=o[e+1],C=o[e+2]}:e=>{let t=o[e],r=o[e+1],i=o[e+2];T=h*t+p*r+x*i,S=f*t+v*r+_*i,C=m*t+g*r+b*i};if(1===n)if(y)for(let e=0;e<d;++e){A(3*a[e]);let t=T*T+S*S+C*C;if(t<M&&t>w){let e=1/Math.sqrt(t);c[i]=T*e,c[i+1]=S*e,c[i+2]=C*e}else c[i]=T,c[i+1]=S,c[i+2]=C;i+=u}else for(let e=0;e<d;++e)A(3*a[e]),c[i]=T,c[i+1]=S,c[i+2]=C,i+=u;else for(let e=0;e<d;++e){if(A(3*a[e]),y){let e=T*T+S*S+C*C;if(e<M&&e>w){let t=1/Math.sqrt(e);T*=t,S*=t,C*=t}}for(let e=0;e<n;++e)c[i]=T,c[i+1]=S,c[i+2]=C,i+=u}}(t,i,r,o);break}case"normalCompressed":if(!a){(0,D.vA)(2===t.size);let r=n.getField(e,m.mJ);(0,D.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i){if(!t||(0,s.tZ)(t))return void Wt(e,r,i);let{data:n,indices:o}=e,a=t,l=r.typedBuffer,c=r.typedBufferStride,u=o.length;i*=c;for(let e=0;e<u;++e){(0,kt.Tz)(qt,n,o[e]);let[t,r,s]=qt;(0,kt.aT)(l,e,a[0]*t+a[4]*r+a[8]*s,a[1]*t+a[5]*r+a[9]*s,a[2]*t+a[6]*r+a[10]*s,c,i)}}(t,i,r,o);break}case"profileRight":case"profileUp":{(0,D.vA)(2===t.size);let r=n.getField(e,m.mJ);(0,D.vA)(!!r,`No buffer view for ${e}`),Wt(t,r,o);break}case"uv0":{(0,D.vA)(2===t.size);let r=n.getField(e,m.ZD)??n.getField(e,m.gH);(0,D.vA)(!!r,`No buffer view for ${e}`),Wt(t,r,o);break}case"uvi":{(0,D.vA)(2===t.size);let r=n.getField(e,m.mJ);(0,D.vA)(!!r,`No buffer view for ${e}`),Wt(t,r,o);break}case"color":case"symbolColor":{let r=n.getField(e,m.XP);(0,D.vA)(!!r,`No buffer view for ${e}`),(0,D.vA)(3===t.size||4===t.size),Zt(t,t.size,r,o);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{let r=n.getField(e,m.Y$)??n.getField(e,m.Y$);(0,D.vA)(!!r,`No buffer view for ${e}`),(0,D.vA)(1===t.size),function(e,t,r){let{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,o);break}case"tangent":{(0,D.vA)(4===t.size);let i=n.getField(e,m.Eq);(0,D.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void function(e,t,r,i=1){let{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){let 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){let 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}}(e,r,i,n);let{data:o,indices:a}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=a.length,h=l[0],f=l[1],m=l[2],p=l[4],v=l[5],g=l[6],x=l[8],_=l[9],b=l[10],y=!(0,s.ut)(l),w=1e-6,M=.999999;if(i*=u,1===n)for(let e=0;e<d;++e){let t=4*a[e],r=o[t],n=o[t+1],s=o[t+2],l=o[t+3],d=h*r+p*n+x*s,T=f*r+v*n+_*s,S=m*r+g*n+b*s;if(y){let e=d*d+T*T+S*S;if(e<M&&e>w){let t=1/Math.sqrt(e);d*=t,T*=t,S*=t}}c[i]=d,c[i+1]=T,c[i+2]=S,c[i+3]=l,i+=u}else for(let e=0;e<d;++e){let t=4*a[e],r=o[t],s=o[t+1],l=o[t+2],d=o[t+3],T=h*r+p*s+x*l,S=f*r+v*s+_*l,C=m*r+g*s+b*l;if(y){let e=T*T+S*S+C*C;if(e<M&&e>w){let t=1/Math.sqrt(e);T*=t,S*=t,C*=t}}for(let e=0;e<n;++e)c[i]=T,c[i+1]=S,c[i+2]=C,c[i+3]=d,i+=u}}(t,r,i,o);break}case"olidColor":(0,D.vA)(4===t.size),Zt(t,4,n.getField(e,m.XP),o)}}class Xt{constructor(e,t=!1){this.layout=e,this._preTransformedNormals=t}elementCount(e){return e.get("position").indices.length}write(e,t,r,i){i&&function(e,t,r,i,n,o=!1){let{buffer:a,offset:s}=n;for(let n of t.fields.keys()){let t=e.get(n),l=t?.indices;t&&l&&Yt(n,t,r,i,a,s,o)}}(r,this.layout,e,t,i,this._preTransformedNormals)}}function Kt(e,t){return Qt.output=+!!e.transparent,Qt.polygonOffset=e.polygonOffset,Qt.enableOITOffset=function(e,t){return(0,$._$)(e)&&t.relativeElevation<5e5}(Qt.output,t),St(Qt)}function Jt({units:e,factor:t},r,i,n){let o=tr*e;return i+((n?1-Math.abs((0,u.Om)(r,n)):0)*t*er+o)}const Qt=new zt,er=2e-5,tr=2e-6,rr=(0,d.vt)();class ir extends ae{constructor(e,t){super(e,or),this.materialType="default",this.supportsEdges=!0,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,e=>(0,$.uw)(e)&&!this.transparent],[4,e=>(0,$.uw)(e)&&this.transparent]]),this._configuration=new Lt(t)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){let{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=W.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,u.t2)(this.parameters.emissiveBaseColor,d.uY)}get emissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);let{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;let{treeRendering:i,doubleSided:n,doubleSidedType:o}=t;r.hasVertexTangents=Dt(t),r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=i?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.hasModelTransformation=!i&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=i?2:n&&"normal"===o?1:n&&"winding-order"===o?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,function(e,t,r,i=!0){i&&(0,$._o)(t.output)&&r.shadingEnabled?(e.receiveShadows=r.receiveShadows&&t.shadowMap.enabled,e.hasShadowHighlights=function(e,t){return e.receiveShadows&&null!=t.shadowHighlight?.getTexture()}(e,t),e.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao,e.receiveGlobalIllumination=r.receiveAmbientOcclusion&&t.globalIlluminationEnabled):e.receiveShadows=e.hasShadowHighlights=e.receiveAmbientOcclusion=e.receiveGlobalIllumination=!1}(r,e,t),r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.unlit?7:t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersectRay(e,t,r,i,n,o){let a=this._getMaterialVerticalOffset(t,r);null!=a&&(i=(0,u.Re)(ar,i,a),n=(0,u.Re)(sr,n,a)),o=function(e,t,r,i,n){let o=Kt(t,r);if(!o)return e;let a=(0,u.oW)(rr,n,i);return(t,r,i,n)=>e(t,Jt(o,a,r,i),i,n)}(o,this._configuration,r.camera,i,n),(0,se.Uy)(e,r,i,n,(0,Ue.ou)(r.verticalOffset),o)}intersectScreenPolygon(e,t,r,i){return function(e,t,r){return null==e?null:(e.renderDistance=function(e,t,r,i,n){let o=Kt(r,i);return o?Jt(o,(0,u.oW)(rr,n,i.eye),e,t):e}(e.renderDistance,e.hasNormal?e.normal:null,t,r,e.point),e)}(Se(e,r,t,i,this._createScreenPolygonVertexDisplacement(t,r)),this._configuration,r.camera)}createGLMaterial(e){return new nr(e)}createBufferWriter(){return new Xt(Rt(this.parameters),this.parameters.pretransformedNormals)}get transparent(){let{drivenOpacity:e,opacity:t,externalColor:r,layerOpacity:i,texture:n,textureId:o,textureAlphaMode:a,colorMixMode:s}=this.parameters,l=r[3];return e||t<1&&"replace"!==s||l<1&&"ignore"!==s||i<1||(null!=n||null!=o)&&1!==a&&2!==a&&"replace"!==s}_createScreenPolygonVertexDisplacement(e,t){let r=this._getMaterialVerticalOffset(e,t);return null==r?null:{applyToVertex:(e,t,i,n)=>(e[0]=t+r[0],e[1]=i+r[1],e[2]=n+r[2],e),applyToAabb:e=>((0,f.Ne)(e,(0,u.WQ)(fr,(0,f.pg)(e,fr),r)),(0,f.vI)(e,(0,u.WQ)(fr,(0,f.Lu)(e,fr),r)),e)}}_getMaterialVerticalOffset(e,t){if(null==this.parameters.verticalOffset)return null;let r=t.camera;(0,u.hZ)(ur,e[12],e[13],e[14]);let i=t.isGlobal?(0,u.S8)(cr,ur):(0,u.C)(cr,lr),n=(0,u.Re)(dr,ur,r.eye),o=(0,u.Bw)(n),a=(0,u.hs)(n,n,1/o),s=null;this.parameters.screenSizePerspective&&(s=(0,u.Om)(i,a));let l=(0,ee.kE)(r,o,this.parameters.verticalOffset,s??0,this.parameters.screenSizePerspective,null);return(0,u.hs)(i,i,l),(0,u.ei)(hr,i,t.transform.inverseRotation)}}class nr extends K{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});let t=this._material.parameters;this.updateTexture(t.textureId);let r=e.camera.viewInverseTransposeMatrix;return(0,u.hZ)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Vt:It,e)}}class or extends Et{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1,this.unlit=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const ar=(0,d.vt)(),sr=(0,d.vt)(),lr=(0,d.fA)(0,0,1),cr=(0,d.vt)(),ur=(0,d.vt)(),dr=(0,d.vt)(),hr=(0,d.vt)(),fr=(0,d.vt)();class mr{constructor(){this.geometries=[],this.materials=[],this.textures=[]}}class pr{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new mr,this.numberOfVertices=0}}var vr=r(60999),gr=r(49186),xr=r(53966);class _r{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(let t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){let i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){let r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){let r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(let e of this._outer)yield e}*values(){for(let e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(let[e,t]of this._outer)for(let[r,i]of t)yield[e,r,i]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,i)=>e(t,r,i)))}clone(){let e=new _r;return this.forAll((t,r,i)=>e.set(r,i,t)),e}}var br=r(46140),yr=r(78888),wr=r(31217);const Mr=()=>xr.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class Tr{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function Sr(e){let t=e.params,r=t.topology,i=!0;switch(t.vertexAttributes||(Mr().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{let e=t.faces;if(e){if(t.vertexAttributes)for(let r in t.vertexAttributes){let t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Mr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Mr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Mr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Mr().warn("Indexed geometries must specify faces"),i=!1;break}default:Mr().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Mr().warn("Geometry requires material"),i=!1);let n=e.params.vertexAttributes;for(let e in n)n[e].values||(Mr().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Cr(e){let t=(0,f.Ie)();return e.forEach(e=>{let r=e.boundingInfo;null!=r&&(0,f.RF)(t,r.box)}),t}function Ar(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function Er(e){let t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Ir=new br.A(1,2,"wosr");async function Or(e,t){let o,a=function(e){let t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null==t[4]?null:Number(t[4])}:{fileType:e.match(/(.*\.(json|json\.gz))$/)?"wosr":"unknown",url:e,specifiedLodIndex:null}}((0,n.EM)(e));if("wosr"===a.fileType){let e=await(t.cache?t.cache.loadWOSR(a.url,t):async function(e,t){let r=await async function(e,t){let r=await(0,vr.Ke)((0,yr.A)(e,t));if(r.ok)return r.value.data;(0,q.QP)(r.error),function(e){throw new gr.A("request:wosr",`Request for object resource failed: ${e}`)}(r.error)}(e,t),i=await async function(e,t){let r=[];for(let i in e){let n=e[i],o=n.images[0].data;if(!o){Mr().warn("Externally referenced texture data is not yet supported");continue}let a=n.encoding+";base64,"+o,s="/textureDefinitions/"+i,l="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==Ar(l)},u=t?.disableTextures?Promise.resolve(null):(0,wr.D)(a,t);r.push(u.then(e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l})))}let i=await Promise.all(r),n={};for(let e of i)n[e.refId]=e;return n}(r.textureDefinitions??{},t),n=0;for(let e in i)if(i.hasOwnProperty(e)){let t=i[e];n+=t?.image?t.image.width*t.image.height*4:0}return new Tr(r,i,n+(0,S.Qh)(r))}(a.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){let r=[],i=[],n=[],o=new _r,a=e.resource,s=br.A.parse(a.version||"1.0","wosr");Ir.validate(s);let l=a.model.name,c=a.model.geometries,u=a.materialDefinitions??{},h=e.textures,f=0,m=new Map;for(let e=0;e<c.length;e++){let a=c[e];if(!Sr(a))continue;let s=Er(a),l=a.params.vertexAttributes,p=[],v=e=>{if("PerAttributeArray"===a.params.topology)return null;let t=a.params.faces;for(let r in t)if(r===e)return t[r].values;return null},g=l.position,x=g.values.length/g.valuesPerElement;for(let e in l){let t=l[e],r=t.values,i=v(e)??(0,C.tM)(x);p.push([e,new T.n(r,i,t.valuesPerElement,!0)])}let _=s.texture,b=h&&h[_];if(b&&!m.has(_)){let{image:e,parameters:t}=b,r=new k.h(e,t);i.push(r),m.set(_,r)}let y=m.get(_),w=y?y.id:void 0,M=s.material,S=o.get(M,_);if(null==S){let e=u[M.slice(M.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);let r=b?Ar(b.alphaChannelUsage):void 0,i={ambient:(0,d.ci)(e.diffuse),diffuse:(0,d.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:w,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:b?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(i,t.materialParameters),S=new ir(i,t.spherical),o.set(M,_,S)}n.push(S);let A=new j(S,p);f+=p.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(A)}return{engineResources:[{name:l,stageResources:{textures:i,materials:n,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:f,lodThreshold:null}],referenceBoundingBox:Cr(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}if(t.cache)o=await t.cache.loadGLTF(a.url,t,!!t.usePBR,!!t.useEmissive);else{let{loadGLTF:e}=await r.e(1698).then(()=>r(51698));o=await e(new _.R,a.url,t,t.usePBR,t.useEmissive)}let{engineResources:h,referenceBoundingBox:p}=function(e,t,r){let n=e.model,o=e.meta,a=n.meta?.ESRI_proxyEllipsoid,h=o.isEsriSymbolResource&&null!=a&&"EsriRealisticTreesStyle"===o.ESRI_webstyle;h&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){let i=e.model.lods[r];for(let n of i.parts){let i=n.attributes.normal;if(null==i)return;let o=n.attributes.position,a=o.count,c=(0,d.vt)(),h=(0,d.vt)(),f=(0,d.vt)(),p=new Float32Array(4*a),v=new Float32Array(3*a),g=(0,s.B8)((0,l.vt)(),n.transform),x=0,_=0;for(let s=0;s<a;s++){o.getVec(s,h),i.getVec(s,c),(0,u.Z0)(h,h,n.transform),(0,u.Re)(f,h,t.center),(0,u.Qr)(f,f,t.radius);let a=f[2],l=(0,u.Bw)(f),d=Math.min(.45+.55*l*l,1)**2.2;(0,u.Qr)(f,f,t.radius),null!==g&&(0,u.Z0)(f,f,g),(0,u.S8)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(a>-1?(0,u.Cc)(f,f,c,.2):(0,u.Cc)(f,f,c,Math.min(-4*a-3.8,1))),v[x]=f[0],v[x+1]=f[1],v[x+2]=f[2],x+=3,p[_]=d,p[_+1]=d,p[_+2]=d,p[_+3]=1,_+=4}n.attributes.normal=new m.xs(v.buffer),n.attributes.color=new m.Eq(p.buffer)}}}(e,a));let p=!!t.usePBR,v=o.isEsriSymbolResource?{usePBR:p,isSchematic:!1,treeRendering:h,mrrFactors:_t.SY}:{usePBR:p,isSchematic:!1,treeRendering:!1,mrrFactors:_t.mb},g={...t.materialParameters,treeRendering:h},x=[],_=new Map,b=new Map,w=n.lods.length,T=(0,f.Ie)();return n.lods.forEach((e,o)=>{let a=!0===t.skipHighLods&&(w>1&&0===o||w>3&&1===o)||!1===t.skipHighLods&&null!=r&&o!==r;if(a&&0!==o)return;let s=new pr(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{let r=a?new ir({},t.spherical):function(e,t,r,n,o,a,s,l,u){let h=e.materials.get(t.material);if(null==h)return null;let{normal:f,color:m,texCoord0:p,tangent:v}=t.attributes,g=t.material+(f?"_normal":"")+(m?"_color":"")+(p?"_texCoord0":"")+(v?"_tangent":""),x=null!=t.attributes.texCoord0,_=null!=t.attributes.normal,b=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(h.alphaMode);if(!a.has(g)){if(x){let t=(t,r=!1,i=!1)=>{if(null!=t&&!s.has(t)){let n=e.textures.get(t);if(n){let e=n.data,o=r&&!(0,y.x3)(e)?l.compressionOptions:void 0;s.set(t,new k.h((0,y.x3)(e)?e.data:e,{...n.parameters,preMultiplyAlpha:!(0,y.x3)(e)&&i,encoding:(0,y.x3)(e)?e.encoding:void 0,compressionOptions:o}))}}},r=1!==b&&!u;t(h.colorTexture,r,1!==b),t(h.normalTexture),t(h.occlusionTexture,!0),t(h.emissiveTexture),t(h.metallicRoughnessTexture,!0)}let r=(0,i.xV)(h.color[0]),f=(0,i.xV)(h.color[1]),m=(0,i.xV)(h.color[2]),p=null!=h.colorTexture&&x?s.get(h.colorTexture):null,v=(0,_t.Jr)(h),w=null==h.normalTextureTransform?.scale?c.Un:h.normalTextureTransform?.scale;a.set(g,new ir({...n,customDepthTest:1,textureAlphaMode:b,textureAlphaCutoff:h.alphaCutoff,diffuse:[r,f,m],ambient:[r,f,m],opacity:"OPAQUE"===h.alphaMode?1:h.opacity,doubleSided:h.doubleSided,doubleSidedType:"winding-order",cullFace:h.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:_?0:2,castShadows:!0,receiveShadows:h.receiveShadows,receiveAmbientOcclusion:h.receiveAmbientOcclusion,unlit:h.unlit,textureId:p?.id,colorMixMode:h.colorMixMode,normalTextureId:null!=h.normalTexture&&x?s.get(h.normalTexture).id:void 0,textureAlphaPremultiplied:null!=p&&!!p.parameters.preMultiplyAlpha,occlusionTextureId:null!=h.occlusionTexture&&x?s.get(h.occlusionTexture).id:void 0,emissiveTextureId:null!=h.emissiveTexture&&x&&!h.unlit?s.get(h.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=h.metallicRoughnessTexture&&x?s.get(h.metallicRoughnessTexture).id:void 0,emissiveBaseColor:h.unlit?d.uY:[h.emissiveFactor[0],h.emissiveFactor[1],h.emissiveFactor[2]],emissiveStrengthKHR:null==h.emissiveStrengthKHR?1:h.emissiveStrengthKHR,emissiveStrengthFromSymbol:null==o.emissiveStrengthFromSymbol?void 0:o.emissiveStrengthFromSymbol,mrrFactors:v?_t.Bt:[h.metallicFactor,h.roughnessFactor,n.mrrFactors[2]],isSchematic:v,colorTextureTransformMatrix:M(h.colorTextureTransform),normalTextureTransformMatrix:M(h.normalTextureTransform),normalScale:[w[0],w[1]],occlusionTextureTransformMatrix:M(h.occlusionTextureTransform),emissiveTextureTransformMatrix:M(h.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:M(h.metallicRoughnessTextureTransform),...o},l.spherical))}let w=a.get(g);if(r.stageResources.materials.push(w),x){let e=e=>{null!=e&&r.stageResources.textures.push(s.get(e))};e(h.colorTexture),e(h.normalTexture),e(h.occlusionTexture),e(h.emissiveTexture),e(h.metallicRoughnessTexture)}return w}(n,e,s,v,g,_,b,t,h),{geometry:l,vertexCount:u}=Pr(e,r??new ir({},t.spherical)),m=l.boundingInfo;null!=m&&0===o&&(0,f.RF)(T,m.box),null!=r&&(s.stageResources.geometries.push(l),s.numberOfVertices+=u)}),a||x.push(s)}),{engineResources:x,referenceBoundingBox:T}}(o,t,a.specifiedLodIndex);return{lods:h,referenceBoundingBox:p,isEsriSymbolResource:o.meta.isEsriSymbolResource,isWosr:!1}}function Pr(e,t){let r=e.attributes.position.count,i=(0,b.x)(e.indices||r,e.primitiveType),n=x(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,p.t)(n,a,e.transform,3,s);let l=[["position",new T.n(n,i,3,!0)]];if(null!=e.attributes.normal){let t=x(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,o.Ge)(Dr,e.transform),(0,p.b)(t,n,Dr,3,a),(0,h.or)(Dr)&&(0,p.n)(t,t),l.push(["normal",new T.n(t,i,3,!0)])}if(null!=e.attributes.tangent){let t=x(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,o.z0)(Dr,e.transform),(0,v.t)(t,n,Dr,4,a),(0,h.or)(Dr)&&(0,p.n)(t,t,4),l.push(["tangent",new T.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){let t=x(2*r),{typedBuffer:n,typedBufferStride:o}=e.attributes.texCoord0;(0,g.a)(t,n,2,o),l.push(["uv0",new T.n(t,i,2,!0)])}let c=e.attributes.color;if(null!=c){let t=new Uint8Array(4*r);4===c.elementCount?c instanceof m.Eq?(0,v.b)(t,c,1,255):(c instanceof m.XP||c instanceof m.Uz)&&(0,v.b)(t,c,1/255,255):(t.fill(255),c instanceof m.xs?(0,p.f)(t,c.typedBuffer,1,255,4,c.typedBufferStride):(e.attributes.color instanceof m.eI||e.attributes.color instanceof m.nS)&&(0,p.f)(t,c.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),l.push(["color",new T.n(t,i,4,!0)])}return{geometry:new j(t,l),vertexCount:r}}const Dr=(0,a.vt)()},26857(e,t,r){var i=r(32198),n=r(56372),o=r(91429);let a=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.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,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.UPDATING=!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,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,o.MZ)()],a.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"UPDATING",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),a=(0,i.Cg)([(0,o.$K)("esri.views.3d.support.debugFlags")],a);const s=new a;r.d(t,["b",0,s])},46686(e,t,r){r.d(t,{A7:()=>o,Y0:()=>n});var i=r(29941);class n extends i.v{constructor(e){super(),this.spherical=e,this.draped=!1}}function o(e){(function(e){e.varyings.add("linearDepth","float",{invariant:!0})})(e),e.vertex.code.add("void forwardLinearDepth(float _linearDepth) { linearDepth = _linearDepth; }")}},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) {
222
222
  vec3 camToVert = posWorld - camPosWorld;
223
223
  bool isBackface = dot(camToVert, normalWorld) > 0.0;
224
224
  if (isBackface) {
@@ -228,7 +228,7 @@ return posClip;
228
228
  }`)}},82048(e,t,r){r.d(t,{c:()=>n});var i=r(31821);function n(e,t=!0){e.attributes.add("position","vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(i.H`
229
229
  gl_Position = vec4(position, 0.0, 1.0);
230
230
  ${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
231
- `)}},49255(e,t,r){function i(e){return function(e){return function(e){return function(e){return a(e)||function(e){return 10===e||11===e}(e)}(e)||function(e){return 3===e}(e)}(e)||function(e){return 4===e}(e)}(e)||function(e){return 5===(t=e)||6===t||7===t||8===e||9===e;var t}(e)}function n(e){return 1===e}function o(e){return 2===e}function a(e){return 0===e||function(e){return n(e)||o(e)}(e)}r.d(t,{Rb:()=>o,_$:()=>n,_o:()=>a,uw:()=>i})},29941(e,t,r){r.d(t,{v:()=>o});var i=r(32198),n=r(51976);class o extends n.K{constructor(){super(...arguments),this.output=0,this.hasEmission=!1,this.useFloatBlend=!0}}(0,i.Cg)([(0,n.W)({count:12})],o.prototype,"output",void 0),(0,i.Cg)([(0,n.W)()],o.prototype,"hasEmission",void 0),(0,i.Cg)([(0,n.W)()],o.prototype,"useFloatBlend",void 0)},34711(e,t,r){r.d(t,{Hz:()=>m,zM:()=>p});var i=r(32198),n=r(58083),o=r(9093),a=r(35522),s=r(51850),l=r(65786),c=r(40710),u=(r(33079),r(31821)),d=r(51976),h=r(29941);class f extends h.v{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}class m extends f{constructor(){super(...arguments),this.hasSlicePlane=!1,this.hasSliceTranslatedView=!1}}function p(e,t){!function(e,t,...r){e.constants.add("groundSliceOpacity","float",.2),function(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(u.H`struct SliceFactors {
231
+ `)}},49255(e,t,r){function i(e){return 5===e||6===e||7===e}function n(e){return i(e)||8===e||9===e}function o(e){return function(e){return function(e){return function(e){return l(e)||function(e){return 10===e||11===e}(e)}(e)||function(e){return 3===e}(e)}(e)||function(e){return 4===e}(e)}(e)||n(e)}function a(e){return 1===e}function s(e){return 2===e}function l(e){return 0===e||function(e){return a(e)||s(e)}(e)}r.d(t,{$n:()=>i,Rb:()=>s,_$:()=>a,_o:()=>l,uw:()=>o})},29941(e,t,r){r.d(t,{v:()=>o});var i=r(32198),n=r(51976);class o extends n.K{constructor(){super(...arguments),this.output=0,this.hasEmission=!1,this.useFloatBlend=!0}}(0,i.Cg)([(0,n.W)({count:12})],o.prototype,"output",void 0),(0,i.Cg)([(0,n.W)()],o.prototype,"hasEmission",void 0),(0,i.Cg)([(0,n.W)()],o.prototype,"useFloatBlend",void 0)},34711(e,t,r){r.d(t,{Hz:()=>m,zM:()=>p});var i=r(32198),n=r(58083),o=r(9093),a=r(35522),s=r(51850),l=r(65786),c=r(40710),u=(r(33079),r(31821)),d=r(51976),h=r(29941);class f extends h.v{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}class m extends f{constructor(){super(...arguments),this.hasSlicePlane=!1,this.hasSliceTranslatedView=!1}}function p(e,t){!function(e,t,...r){e.constants.add("groundSliceOpacity","float",.2),function(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(u.H`struct SliceFactors {
232
232
  float front;
233
233
  float side0;
234
234
  float side1;
@@ -323,8 +323,7 @@ return vec3(normal + sign(normal) * min(z, 0.0), z);
323
323
  }`),e.vertex.main.add("vec3 normal = decompressNormal(normalCompressed);");break;case 0:e.attributes.add("normal","vec3");break;default:t.normalType;case 2:case 3:}}},53466(e,t,r){r.d(t,{U:()=>n});var i=r(31821);function n(e,t){switch(t.textureCoordinateType){case 1:return e.attributes.add("uv0","vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(i.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case 2:return e.attributes.add("uv0","vec2"),e.attributes.add("uvRegion","vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(i.H`void forwardTextureCoordinates() {
324
324
  vuv0 = uv0;
325
325
  vuvRegion = uvRegion;
326
- }`);default:t.textureCoordinateType;case 0:return void e.vertex.code.add(i.H`void forwardTextureCoordinates() {}`);case 3:return}}},72824(e,t,r){r.d(t,{Mh:()=>c,Zo:()=>u,gy:()=>d});var i=r(29242),n=r(91829),o=r(31821),a=r(35644),s=r(96336),l=r(87757);function c(e,t){let{vertex:r,varyings:i}=e;switch(t.normalType){case 0:case 1:e.include(s.Y,t),i.add("vNormalWorld","vec3"),i.add("vNormalView","vec3"),r.uniforms.add(new a.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)).main.add(o.H`vNormalWorld = normal;
327
- vNormalView = transformNormalViewFromGlobal * vNormalWorld;`);break;default:t.normalType;case 2:case 3:}}class u extends l.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,i.vt)()}}class d extends l.EM{constructor(){super(...arguments),this.toMapSpace=(0,n.vt)()}}},87757(e,t,r){r.d(t,{EM:()=>s,dO:()=>a});var i=r(29242),n=r(51850),o=r(65786);r(51976).K,r(40710),r(33079),r(31821),r(74333).n,r(98353),r(35644),r(63761),r(45324),r(26425);class a extends o.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,n.vt)(),this.transformWorldFromViewTL=(0,n.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)()}}class s extends o.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,n.vt)(),this.transformWorldFromModelTL=(0,n.vt)(),this.transformationDrawId=0}}},99208(e,t,r){r.d(t,{r:()=>a});var i=r(31821);function n(e){e.fragment.code.add(i.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
326
+ }`);default:t.textureCoordinateType;case 0:return void e.vertex.code.add(i.H`void forwardTextureCoordinates() {}`);case 3:return}}},87757(e,t,r){r.d(t,{EM:()=>s,dO:()=>a});var i=r(29242),n=r(51850),o=r(65786);r(51976).K,r(40710),r(33079),r(31821),r(74333).n,r(98353),r(35644),r(63761),r(45324),r(26425);class a extends o.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,n.vt)(),this.transformWorldFromViewTL=(0,n.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)()}}class s extends o.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,n.vt)(),this.transformWorldFromModelTL=(0,n.vt)(),this.transformationDrawId=0}}},99208(e,t,r){r.d(t,{r:()=>a});var i=r(31821);function n(e){e.fragment.code.add(i.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
328
327
  vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
329
328
  vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
330
329
  float maxdUV = 0.125;
@@ -354,7 +353,7 @@ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
354
353
  return size * clamp(mix(factor.x, 1.0, factor.y), factor.z, 1.0);
355
354
  }`),e.vertex.code.add(a.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
356
355
  return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
357
- }`)}const h=(0,c.vt)();var f=r(20693);function m(e,t){let r=e.vertex;t.hasVerticalOffset?(r.include(s.j,t),function(e){e.uniforms.add(new o.E("verticalOffset",(e,t)=>{let{minWorldLength:r,maxWorldLength:n,screenLength:o}=e.verticalOffset,a=t.camera.screenPixelSizePerDistance;return(0,i.hZ)(p,o,a,r,n)}))}(r),t.hasScreenSizePerspective&&(e.include(d),function(e){e.uniforms.add(new u.t("screenSizePerspectiveAlignment",e=>function(e,t){let r=null!=t&&null!=e?Math.min(e.minPixelSize/t,1):0;return e?(0,l.hZ)(h,e.divisor,e.offset,r):(0,l.hZ)(h,0,0,0)}(e.screenSizePerspectiveAlignment||e.screenSizePerspective,e.screenSizePerspectiveAlignment?null:e.screenSizePerspectiveMinPixelReferenceSize)))}(r),(0,f.y)(e.vertex,t)),r.code.add(a.H`
356
+ }`)}const h=(0,c.vt)();var f=r(20693);function m(e,t){let r=e.vertex;t.hasVerticalOffset?(r.include(s.j,t),function(e){e.uniforms.add(new o.E("verticalOffset",(e,t)=>{let{minWorldLength:r,maxWorldLength:n,screenLength:o}=e.verticalOffset,a=t.camera.screenPixelSizePerDistance;return(0,i.hZ)(p,o,a,r,n)}))}(r),t.hasScreenSizePerspective&&(e.include(d),function(e){e.uniforms.add(new u.t("screenSizePerspectiveAlignment",e=>function(e,t){let r=null!=t&&null!=e?Math.min(e.minPixelSize/t,1):0;return e?(0,l.hZ)(h,e.divisor,e.offset,r):(0,l.hZ)(h,0,0,0)}(e.screenSizePerspectiveAlignment||e.screenSizePerspective,e.screenSizePerspectiveAlignment?null:e.screenSizePerspectiveMinPixelReferenceSize)))}(r),(0,f.yu)(e.vertex,t)),r.code.add(a.H`
358
357
  vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
359
358
  float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
360
359
  vec3 worldNormal = getLocalUp(worldPos, localOrigin);
@@ -370,33 +369,33 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
370
369
  vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
371
370
  return worldPos + calculateVerticalOffset(worldPos, localOrigin);
372
371
  }
373
- `)):r.code.add(a.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const p=(0,n.vt)()},72657(e,t,r){var i=r(12791);new i.x("depthMap",e=>e.depth?.attachment);const n=new i.x("mainDepth",e=>e.mainDepth),o=(new i.x("waterNormals",e=>e.overlay?.getTexture(3)),new i.x("shadowHighlight",e=>e.shadowHighlight?.getTexture()));r.d(t,["Xb",0,n,"ri",0,o])},9169(e,t,r){r.d(t,{E:()=>g});var i=r(31821),n=r(63761),o=r(96336);function a(e,t){if(11!==t.output)return e.vertex.code.add(i.H`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(i.H`void outputObjectAndLayerIdColor() {}`);let r=t.instanced;e.varyings.add("objectAndLayerIdColorVarying","vec4");let n=r?"instanceOlidColor":"olidColor";e.attributes.add(n,"vec4"),e.vertex.code.add(i.H`
372
+ `)):r.code.add(a.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const p=(0,n.vt)()},72657(e,t,r){var i=r(12791);new i.x("depthMap",e=>e.depth?.attachment);const n=new i.x("mainDepth",e=>e.mainDepth),o=(new i.x("waterNormals",e=>e.overlay?.getTexture(3)),new i.x("shadowHighlight",e=>e.shadowHighlight?.getTexture()));r.d(t,["Xb",0,n,"ri",0,o])},98440(e,t,r){r.d(t,{E:()=>_});var i=r(31821),n=r(63761),o=r(96336);function a(e,t){if(11!==t.output)return e.vertex.code.add(i.H`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(i.H`void outputObjectAndLayerIdColor() {}`);let r=t.instanced;e.varyings.add("objectAndLayerIdColorVarying","vec4");let n=r?"instanceOlidColor":"olidColor";e.attributes.add(n,"vec4"),e.vertex.code.add(i.H`
374
373
  void forwardObjectAndLayerIdColor() {
375
374
  objectAndLayerIdColorVarying = ${n} * 0.003921568627451;
376
375
  }`),e.fragment.code.add(i.H`void outputObjectAndLayerIdColor() {
377
376
  fragColor = objectAndLayerIdColorVarying;
378
- }`)}var s=r(53466);function l(e,t){switch(t.output){case 5:case 6:case 7:case 8:e.fragment.code.add(i.H`void outputDepth(float _linearDepth){
377
+ }`)}var s=r(53466),l=r(49255);function c(e,t){(0,l.$n)(t.output)&&e.vertex.main.add("gl_Position.z = 0.0;")}function u(e,t){switch(t.output){case 5:case 6:case 7:case 8:e.fragment.code.add(i.H`void outputDepth(float _linearDepth){
379
378
  const float slope_scale = 2.0;
380
379
  const float bias = 20.0 * .000015259;
381
380
  float m = max(abs(dFdx(_linearDepth)), abs(dFdy(_linearDepth)));
382
381
  gl_FragDepth = _linearDepth + slope_scale * m + bias;
383
- }`)}}var c=r(42593),u=r(89435),d=r(34711),h=r(71020),f=r(45324),m=r(58614),p=r(20693),v=r(12696);function g(e,t){let{vertex:r,fragment:g,varyings:x}=e,{hasColorTexture:_,alphaDiscardMode:b}=t,y=_&&1!==b,{output:w,normalType:M,hasColorTextureTransform:T}=t;switch(w){case 3:(0,p.N)(r,t),e.include(h.d),g.include(d.zM,t),e.include(s.U,t),y&&g.uniforms.add(new n.N("tex",e=>e.texture)),r.main.add(i.H`vpos = getVertexInLocalOriginSpace();
382
+ }`)}}var d=r(42593),h=r(89435),f=r(34711),m=r(71020),p=r(45324),v=r(58614),g=r(20693),x=r(12696);function _(e,t){let{vertex:r,fragment:l,varyings:_}=e,{hasColorTexture:b,alphaDiscardMode:y}=t,w=b&&1!==y,{output:M,normalType:T,hasColorTextureTransform:S}=t;switch(M){case 3:(0,g.NB)(r,t),e.include(m.d),l.include(f.zM,t),e.include(s.U,t),w&&l.uniforms.add(new n.N("tex",e=>e.texture)),r.main.add(i.H`vpos = getVertexInLocalOriginSpace();
384
383
  vpos = subtractOrigin(vpos);
385
384
  vpos = addVerticalOffset(vpos, localOrigin);
386
385
  gl_Position = transformPosition(proj, view, vpos);
387
- forwardTextureCoordinates();`),e.include(m.SS,t),g.main.add(i.H`
386
+ forwardTextureCoordinates();`),e.include(v.SS,t),l.main.add(i.H`
388
387
  discardBySlice(vpos);
389
- ${(0,i.If)(y,i.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
390
- discardOrAdjustAlpha(texColor);`)}`);break;case 5:case 6:case 7:case 8:case 11:(0,p.N)(r,t),e.include(h.d),e.include(s.U,t),e.include(u.A,t),e.include(l,t),g.include(d.zM,t),e.include(a,t),x.add("depth","float",{invariant:!0}),y&&g.uniforms.add(new n.N("tex",e=>e.texture)),r.uniforms.add(f.Y$).main.add(i.H`vpos = getVertexInLocalOriginSpace();
388
+ ${(0,i.If)(w,i.H`vec4 texColor = texture(tex, ${S?"colorUV":"vuv0"});
389
+ discardOrAdjustAlpha(texColor);`)}`);break;case 5:case 6:case 7:case 8:case 11:(0,g.NB)(r,t),e.include(m.d),e.include(s.U,t),e.include(h.A,t),e.include(u,t),l.include(f.zM,t),e.include(a,t),_.add("depth","float",{invariant:!0}),w&&l.uniforms.add(new n.N("tex",e=>e.texture)),r.uniforms.add(p.Y$).main.add(i.H`vpos = getVertexInLocalOriginSpace();
391
390
  vpos = subtractOrigin(vpos);
392
391
  vpos = addVerticalOffset(vpos, localOrigin);
393
392
  gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
394
393
  forwardTextureCoordinates();
395
- forwardObjectAndLayerIdColor();`),e.include(m.SS,t),g.main.add(i.H`
394
+ forwardObjectAndLayerIdColor();`),e.include(c,t),e.include(v.SS,t),l.main.add(i.H`
396
395
  discardBySlice(vpos);
397
- ${(0,i.If)(y,i.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
396
+ ${(0,i.If)(w,i.H`vec4 texColor = texture(tex, ${S?"colorUV":"vuv0"});
398
397
  discardOrAdjustAlpha(texColor);`)}
399
- ${11===w?i.H`outputObjectAndLayerIdColor();`:i.H`outputDepth(depth);`}`);break;case 4:{(0,p.N)(r,t),e.include(h.d),e.include(o.Y,t),e.include(s.U,t),e.include(u.A,t),e.include(v.F,t),y&&g.uniforms.add(new n.N("tex",e=>e.texture)),2===M&&x.add("vPositionView","vec3",{invariant:!0});let a=0===M||1===M;a&&x.add("vNormalWorld","vec3"),r.main.add(i.H`
398
+ ${11===M?i.H`outputObjectAndLayerIdColor();`:i.H`outputDepth(depth);`}`);break;case 4:{(0,g.NB)(r,t),e.include(m.d),e.include(o.Y,t),e.include(s.U,t),e.include(h.A,t),e.include(x.F,t),w&&l.uniforms.add(new n.N("tex",e=>e.texture)),2===T&&_.add("vPositionView","vec3",{invariant:!0});let a=0===T||1===T;a&&_.add("vNormalWorld","vec3"),r.main.add(i.H`
400
399
  forwardDefaultMaterialExternalColor();
401
400
 
402
401
  if (shouldCullByOpacity()) {
@@ -409,23 +408,23 @@ forwardObjectAndLayerIdColor();`),e.include(m.SS,t),g.main.add(i.H`
409
408
  vpos = subtractOrigin(vpos);
410
409
  vpos = addVerticalOffset(vpos, localOrigin);
411
410
  gl_Position = transformPosition(proj, view, vpos);
412
- forwardTextureCoordinates();`),g.include(d.zM,t),e.include(m.SS,t),g.main.add(i.H`
411
+ forwardTextureCoordinates();`),l.include(f.zM,t),e.include(v.SS,t),l.main.add(i.H`
413
412
  discardBySlice(vpos);
414
- ${(0,i.If)(y,i.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
413
+ ${(0,i.If)(w,i.H`vec4 texColor = texture(tex, ${S?"colorUV":"vuv0"});
415
414
  discardOrAdjustAlpha(texColor);`,i.H`vec4 texColor = vec4(1.0);`)}
416
415
  float opacity = getDefaultMaterialOpacity(texColor.a);
417
416
 
418
- ${2===M?i.H`vec3 normal = screenDerivativeNormal(vPositionView);`:i.H`vec3 normal = normalize(vNormalWorld);
417
+ ${2===T?i.H`vec3 normal = screenDerivativeNormal(vPositionView);`:i.H`vec3 normal = normalize(vNormalWorld);
419
418
  if (gl_FrontFacing == false){
420
419
  normal = -normal;
421
420
  }`}
422
- fragColor = vec4(0.5 + 0.5 * normal, opacity);`);break}case 10:(0,p.N)(r,t),e.include(h.d),e.include(s.U,t),e.include(u.A,t),y&&g.uniforms.add(new n.N("tex",e=>e.texture)),r.main.add(i.H`vpos = getVertexInLocalOriginSpace();
421
+ fragColor = vec4(0.5 + 0.5 * normal, opacity);`);break}case 10:(0,g.NB)(r,t),e.include(m.d),e.include(s.U,t),e.include(h.A,t),w&&l.uniforms.add(new n.N("tex",e=>e.texture)),r.main.add(i.H`vpos = getVertexInLocalOriginSpace();
423
422
  vpos = subtractOrigin(vpos);
424
423
  vpos = addVerticalOffset(vpos, localOrigin);
425
424
  gl_Position = transformPosition(proj, view, vpos);
426
- forwardTextureCoordinates();`),g.include(d.zM,t),e.include(m.SS,t),e.include(c.Q,t),g.main.add(i.H`
425
+ forwardTextureCoordinates();`),l.include(f.zM,t),e.include(v.SS,t),e.include(d.Q,t),l.main.add(i.H`
427
426
  discardBySlice(vpos);
428
- ${(0,i.If)(y,i.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
427
+ ${(0,i.If)(w,i.H`vec4 texColor = texture(tex, ${S?"colorUV":"vuv0"});
429
428
  discardOrAdjustAlpha(texColor);`)}
430
429
  calculateOcclusionAndOutputHighlight();`)}}},12696(e,t,r){r.d(t,{F:()=>v});var i=r(19245),n=r(26934),o=r(71988),a=r(20304),s=r(31821),l=r(43519);function c(e,t){t.instancedColor?(e.attributes.add("instanceColor","vec4"),e.vertex.include(l.WD),e.vertex.include(l.Y1),e.vertex.include(l.ML),e.vertex.code.add(s.H`
431
430
  MaskedColor applyInstanceColor(MaskedColor color) {
@@ -591,7 +590,7 @@ vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),x&&r.code.a
591
590
  normalTextureTransformMatrix[1][0]/normalScale[0], normalTextureTransformMatrix[1][1]/normalScale[1], 0.0,
592
591
  0.0, 0.0, 0.0 );
593
592
  rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(s.H`return tangentSpace * rawNormal;
594
- }`))}(e,t)}},68785(e,t,r){r.d(t,{n:()=>zt});var i=r(32198),n=r(91429),o=r(37585),a=r(34727),s=r(97768),l=r(36708),c=r(78659),u=r(63907),d=r(21231),h=r(67171),f=r(69540);let m=class extends f.Pw{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,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"row",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"column",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"rows",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"columns",void 0),m=(0,i.Cg)([(0,n.$K)("esri.CameraLayout")],m);const p=m;var v=r(56507),g=r(69052),x=r(25482),_=r(86738),b=r(43937),y=r(36005);let w=class extends((0,f.OU)(x.o)){constructor(e){super(e),this.position=new _.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new p}writePosition(e,t,r,i){let n=e.clone();n.x=(0,v.GB)(e.x||0),n.y=(0,v.GB)(e.y||0),n.z=e.hasZ?(0,v.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){let r=new _.A;return r.read(e,t),r.x=(0,v.GB)(r.x||0),r.y=(0,v.GB)(r.y||0),r.z=r.hasZ?(0,v.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,i.Cg)([(0,n.MZ)({type:_.A,json:{write:{isRequired:!0}}})],w.prototype,"position",void 0),(0,i.Cg)([(0,b.K)("position")],w.prototype,"writePosition",null),(0,i.Cg)([(0,y.w)("position")],w.prototype,"readPosition",null),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,n.wg)(e=>g.ie.normalize((0,v.GB)(e)))],w.prototype,"heading",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,n.wg)(e=>(0,a.qE)((0,v.GB)(e),-180,180))],w.prototype,"tilt",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,n.wg)(e=>(0,a.qE)((0,v.GB)(e,55),1,170))],w.prototype,"fov",void 0),(0,i.Cg)([(0,n.MZ)({type:p,nonNullable:!0,json:{read:!1,write:!1}})],w.prototype,"layout",void 0),w=(0,i.Cg)([(0,n.$K)("esri.Camera")],w);var M=r(9093),T=r(35522),S=r(51850),C=(r(48353),r(9762),r(65806)),A=r(27993),E=r(16930),I=r(73941),O=(r(19419),r(58083)),P=r(65720),D=r(71351),R=r(56372),F=r(48163),N=r(78955),B=r(91829),z=r(53966),L=r(90629),H=r(44280);function V(e,t,r){e.worldUpAtPosition(t,U),(0,T.Re)(j,r,t);let i=(0,T.Bw)(j);return 0===i?0:(0,a.XM)((0,T.Om)(j,U)/i)}const U=(0,S.vt)(),j=(0,S.vt)();var G;let k=G=class extends R.A{constructor(e){super(e),this._ray=(0,D.vt)(),this._viewport=(0,B.fA)(0,0,1,1),this._padding=(0,B.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,F.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,M.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,M.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,M.vt)(),this._frustumDirty=!0,this._frustum=(0,P.vt)(),this._fullViewport=(0,B.vt)(),this._fullViewportDirty=!0,this._pixelRatio=1,this.pixelScale=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,S.vt)(),this._up=(0,S.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,"eye")}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,T.Re)(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,O.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get inverseViewMatrix(){return(0,O.Qw)((0,M.vt)(),this.viewMatrix)||this._get("inverseViewMatrix")||(0,M.vt)()}get viewForward(){return this._ensureViewClean(),(0,T.hZ)((0,S.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,T.hZ)((0,S.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,T.hZ)((0,S.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;let e=(0,N.hs)((0,B.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,N.aI)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;let e=(0,N.hs)((0,B.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,N.aI)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._fullViewportDirty=!0,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._fullViewportDirty=!0,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._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewportDirty&&=(this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this._viewport[2]+this._padding[1]+this._padding[3],this._fullViewport[3]=this._viewport[3]+this._padding[0]+this._padding[2],!1),this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,N.t2)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,N.C)(this._padding,e),this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&=((0,O.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,O.B8)((0,M.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,M.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,T.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,O.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,O.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){let{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get renderPixelSizePerDistance(){return Math.tan(this.fovX/2)/(this.width/2)}get screenPixelSizePerDistance(){return this.renderPixelSizePerDistance*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){let 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,u=(0,O.$h)((0,M.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),d=this._get("projectionMatrix");return d&&(0,O.t2)(d,u)?d:u}copyFrom(e){(0,T.C)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,N.C)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,N.C)(this._padding,e.padding),this.notifyChange("_padding"),this._fullViewportDirty=!0,(0,o.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;let t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,O.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||=((0,P.C)(this._frustum,e.frustum),!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,O.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this.pixelRatio=e.pixelRatio,this.pixelScale=e.pixelScale,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new G).copyFrom(this)}equals(e){return(0,T.t2)(this.eye,e.eye)&&(0,T.t2)(this.center,e.center)&&(0,T.t2)(this.up,e.up)&&(0,N.t2)(this._viewport,e.viewport)&&(0,N.t2)(this._padding,e.padding)&&(0,o.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}equalsView(e){return(0,T.t2)(this.eye,e.eye)&&(0,T.t2)(this.center,e.center)&&(0,T.t2)(this.up,e.up)&&this._fov===e.fov}almostEquals(e){let t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,N.hG)(e.screenPadding,this.screenPadding)>=t||(0,N.hG)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,T.jb)($,e.eye,e.center),(0,T.jb)(q,this.eye,this.center);let r=(0,T.Om)($,q),i=(0,T.uE)($),n=(0,T.uE)(q),o=5e-4;return r*r>=.9999999999*i*n&&(0,T.lo)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDistance(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDistance(e){return e*this.renderPixelSizePerDistance}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDistance(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,H.gr)(this.viewForward,(0,T.Re)($,e,this.eye)))}computeScreenPixelSizeAtDistance(e){return e*this.screenPixelSizePerDistance}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,L.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){let 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!==W&&(0,T.C)(W,e),W[3]=1,(0,N.Z0)(W,W,this.projectionMatrix);let r=Math.abs(W[3]);(0,T.hs)(W,W,1/r);let i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*W[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*W[1]),t[2]=.5*(W[2]+1),t[3]=r}unapplyProjection(e,t){let r=this.fullViewport;W[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],W[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],W[2]=(2*e[2]-1)*e[3],W[3]=e[3],null!=this.inverseProjectionMatrix&&((0,N.Z0)(W,W,this.inverseProjectionMatrix),t[0]=W[0],t[1]=W[1],t[2]=W[2])}projectToScreen(e,t){return null==this.projectToRenderScreen(e,Y)?null:(this.renderToScreen(Y,t),t)}projectToRenderScreen(e,t){if(W[0]=e[0],W[1]=e[1],W[2]=e[2],W[3]=1,(0,N.Z0)(W,W,this.viewProjectionMatrix),0===W[3])return null;let r=W;(0,T.hs)(r,r,1/Math.abs(W[3]));let 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,Y),t)}unprojectFromRenderScreen(e,t){if((0,O.lw)(Z,this.projectionMatrix,this.viewMatrix),!(0,O.B8)(Z,Z))return null;let r=this.fullViewport;return W[0]=2*(e[0]-r[0])/r[2]-1,W[1]=2*(e[1]-r[1])/r[3]-1,W[2]=2*e[2]-1,W[3]=1,(0,N.Z0)(W,W,Z),0===W[3]?null:(t[0]=W[0]/W[3],t[1]=W[1]/W[3],t[2]=W[2]/W[3],t)}constrainWindowSize(e,t,r,i){let 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),u=r-l- -Math.min(this.fullWidth-n-r/2,0),d=i-c- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(u),Math.round(d)]}computeUp(e){e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){let r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){let r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){let{center:r,eye:i,distance:n,fovY:o}=this,a=Math.abs(Math.PI/2-V(t,r,i));return e.frustumCoverage(a,n,o)}_computeUpGlobal(){(0,T.Re)($,this.center,this.eye);let e=(0,T.Bw)(this.center);e<1?(0,T.t2)(this._up,S.Cb)&&((0,T.C)(this._up,S.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,T.Om)($,this.center))>.9999*(0,T.Bw)($)*e||((0,T.$A)(q,$,this.center),(0,T.$A)(q,q,$),(0,T.S8)(q,q),(0,T.t2)(this._up,q)||((0,T.C)(this._up,q),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,T.oW)($,this.eye,this.center),Math.abs($[2])<=.9999&&((0,T.hs)($,$,$[2]),(0,T.hZ)($,-$[0],-$[1],1-$[2]),(0,T.S8)($,$),(0,T.t2)(this._up,$)||((0,T.C)(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,T.t2)(e,t)||((0,T.C)(t,e),this._markViewDirty(),this.notifyChange(r)):z.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,P.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),!1)}_ensureViewClean(){this._viewDirty&&((0,O.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,i.Cg)([(0,n.MZ)()],k.prototype,"_viewport",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_padding",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_fov",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_nearFar",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_viewDirty",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_viewMatrix",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"pixelRatio",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_pixelRatio",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"pixelScale",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"row",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"column",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_rows",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"rows",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_columns",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"columns",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"eye",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"center",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_center",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"up",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_up",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"viewMatrix",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"inverseViewMatrix",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"viewForward",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"viewUp",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"viewRight",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"nearFar",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"near",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"far",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"viewport",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"screenViewport",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"screenPadding",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"x",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"y",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"width",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"height",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"fullWidth",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"fullHeight",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"_aspect",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"padding",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"projectionMatrix",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"inverseProjectionMatrix",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"fov",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"fovX",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"fovY",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"viewInverseTransposeMatrix",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"_projectionMatrixInternal",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"relativeElevation",void 0),k=G=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl.RenderCamera")],k);const W=(0,B.vt)(),Z=(0,M.vt)(),$=(0,S.vt)(),q=(0,S.vt)(),Y=(0,L.r_)();r(49718),r(6867),r(16396),(0,M.vt)(),(0,S.vt)(),(0,S.vt)(),(0,S.vt)();var X=r(5443),K=r(39829),J=r(95108);function Q(e,t,r,i){let n=function(e,t){let r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=+(0===r);return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return+(1===n);let 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?2:3}}(r,i);if(e.length=0,t.length){1===n(te,t[0],t[0])&&ee(e,t[0]);for(let r=0;r<t.length;r++){let i=t[r===t.length-1?0:r+1];switch(n(te,t[r],i)){case 1:ee(e,i);break;case 3:ee(e,(0,F.o8)(te));break;case 2:ee(e,(0,F.o8)(te)),ee(e,i)}}}}function ee(e,t){0!==e.length&&(0,o.aI)(e.at(-1),t)||e.push(t)}const te=(0,F.vt)();var re=r(11964),ie=r(27921);const ne=(0,S.vt)(),oe=(0,S.vt)();function ae(){return{direction:(0,S.vt)(),up:(0,S.vt)()}}function se(e,t,r,i,n){let o=(0,T.S8)(ne,e),s=(0,T.Om)(o,i),l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,T.Om)(t,i)),s<.99?((0,T.C)(o,t),l&&(0,T.hs)(o,o,-1)):o=null);let c=0;if(o){(0,T.hs)(oe,i,(0,T.Om)(i,o)),(0,T.Re)(o,o,oe);let e=(0,T.Om)(o,n)/((0,T.Bw)(o)*(0,T.Bw)(n));(0,T.$A)(oe,o,n),c=((0,T.Om)(oe,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}let u=(0,a.KJ)((0,a.XM)(-(0,T.Om)(i,e)/(0,T.Bw)(e)));return r?(r.heading=c,r.tilt=u,r):{heading:c,tilt:u}}function le(e,t,r,i){(0,T.Re)(ce,r,t),!(0,ie.T7)(i,(0,re.LV)(t,ce),e)&&e!==r&&(0,T.C)(e,r)}const ce=(0,S.vt)(),ue=(0,S.fA)(0,1,0),de=(0,S.fA)(0,0,1),he=(0,M.vt)(),fe=(0,S.vt)(),me=(0,S.vt)();function pe(e,t,r,i=ae()){let{direction:n,up:o}=i;return(0,O.N9)(he,-(0,a.kU)(t)),(0,O.eL)(he,he,(0,a.kU)(r)),(0,T.Z0)(n,de,he),(0,T.hs)(n,n,-1),(0,T.Z0)(o,ue,he),i}function ve(e,t,r,i,n){let o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,T.Ln)(e,i,o,a)}const ge=(0,S.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return se(t,r,i,de,ue)},eyeForCenterWithHeadingTilt:function(e,t,r,i){let n=pe(0,r,i),o=(0,S.vt)();return(0,T.hs)(o,n.direction,-t),(0,T.WQ)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:pe,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){let r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){let t=r.lines[e];i.intersectInfiniteManifold((0,D.LV)(t.origin,t.direction),n,ge)||ve(ge,r,i,t.endpoint,n),le(ge,a,ge,l),s.push((0,F.fA)(ge[0],ge[1]))}return function(e,t,r){let i=e.map(e=>((0,T.hZ)(ge,e[0],e[1],0),t.fromRenderCoords(ge,ge,r),[ge[0],ge[1]]));return i.length<=2?new K.A({spatialReference:r}):(i.push(i[0].slice()),(0,J.$3)(i)||i.reverse(),new K.A({rings:[i],spatialReference:r}))}(function(e,t){let r=[],i=[];return Q(r,e,t,0),Q(i,r,t,1),Q(r,i,t,2),Q(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){let o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,C.g)(t,fe,o),(0,C.g)(t,me,o),fe[0]-=r/2,me[0]+=r/2,fe[1]-=i/2,me[1]+=i/2,(0,A.F)(fe,o,fe,a),(0,A.F)(me,o,me,a),n?(n.xmin=fe[0],n.ymin=fe[1],n.xmax=me[0],n.ymax=me[1],n.spatialReference=a):n=new X.A({xmin:fe[0],ymin:fe[1],xmax:me[0],ymax:me[1],spatialReference:a}),n}},Symbol.toStringTag,{value:"Module"}));var xe=r(34304),_e=r(52039),be=r(28540),ye=r(28735);class we{get planes(){return this.frustum}get points(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,P.vt)(),this._points=(0,P.Qy)(),this.lines=Array(12),this._origin=(0,S.vt)(),this._direction=(0,S.vt)(),this._boundingSphere=new be.i,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,S.vt)(),endpoint:null}}update(e){(0,P.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,T.C)(this._origin,e.eye),(0,T.C)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}get altitude(){return this._altitude}intersectsSphere(e){return(0,P.m7)(this.frustum,e)}isConvexHullOutsideViewPyramid(e,t){return(0,P.Pi)(this.frustum,e,t)}intersectsRay(e){return(0,P.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,P.ST)(this.frustum,e,t)}lineSegmentIntersectsViewPyramid(e,t){return(0,P.LJ)(this.frustum,e,t)}intersectsPoint(e){return(0,P.bU)(this.frustum,e)}_updateLines(){let e=this._points;for(let t=0;t<4;t++){let r=t+4;Me(this.lines[t],e[t],e[r]),Me(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),Me(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){let{origin:e}=this,t=Se;(0,T.S8)(t,this.direction);let r=Te;(0,T.jb)(r,this.points[4],e);let i=.5*(0,T.Om)(r,r)/(0,T.Om)(t,r),n=this._boundingSphere;n.center=(0,T.Ln)(Ce,e,t,i),n.radius=i}static{this.planePointIndices=P.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function Me(e,t,r){e.origin=t,e.endpoint=r,(0,T.oW)(e.direction,t,r)}const Te=(0,S.vt)(),Se=(0,S.vt)(),Ce=(0,S.vt)();r(86211);const Ae=(0,S.fA)(5802e-9,13558e-9,331e-7),Ee=(0,S.fA)(195e-8,5643e-9,255e-9);(0,S.fA)(Ae[0]+Ee[0],Ae[1]+Ee[1],Ae[2]+Ee[2]);class Ie{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Ie(0,0)}static{this.Infinite=new Ie}}(0,S.vt)(),(0,S.vt)(),new be.i,(0,D.vt)(),new X.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var Oe=r(32728);const Pe=(0,S.fA)(0,0,1),De=(0,T.S8)((0,S.vt)(),(0,S.fA)(1,1,1)),Re=(0,M.vt)(),Fe=(0,S.vt)(),Ne=(0,S.vt)();function Be(e,t,r,i=ae()){(0,T.$A)(Fe,e,Pe),0===(0,T.Om)(Fe,Fe)&&(0,T.$A)(Fe,e,De),(0,O.$0)(Re,-(0,a.kU)(t),e),(0,O.e$)(Re,Re,-(0,a.kU)(r),Fe);let{up:n,direction:o}=i;return(0,T.$A)(n,Fe,e),(0,T.S8)(n,n),(0,T.Z0)(n,n,Re),(0,T.S8)(o,e),(0,T.ze)(o,o),(0,T.Z0)(o,o,Re),i}function ze(e){let t=e[1];e[1]=-e[2],e[2]=t}function Le(e,t){return e.up=Be(t,e.heading,e.tilt).up,e}function He(e,t){let{renderCoordsHelper:r,state:i}=e;if(i.isLocal)return 1;let n=r.getAltitude(t),o=r.referenceEllipsoid.radius,s=1+(0,T.Io)(i.camera.eye,t)/(o+n),l=Math.sqrt(s*s-1),{minCurvature:c,maxCurvature:u,minSamples:d,maxSamples:h}=Ue,f=(0,a.qE)((l-c)/(u-c),0,1);return Math.round((0,a.Cc)(d,h,f))}function Ve(e,t){let r=[],i=[],n=(0,xe.FD)();for(let o=0;o<e.length;o++){let a=e[o],s=o===e.length-1?e[0]:e[o+1],l=(0,re.Cr)(a,s,qe),c=(0,ie.vE)(t,l.origin,l.vector,0,Ze);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{let[e,o,s]=0===c?[1,r,i]:[-1,i,r],l=(0,ie.Qj)(t),u=(0,T.Ln)((0,S.vt)(),Ze,l,e*n),d=(0,T.Ln)((0,S.vt)(),Ze,l,e*-n);o.push(a),o.push(u),s.push(d)}}}let o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Ue={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},je=(0,S.fA)(1,0,0),Ge=(0,S.fA)(0,1,0),ke=(0,S.vt)(),We=(0,S.vt)(),Ze=(0,S.vt)(),$e=new be.i,qe=(0,re.vt)(),Ye=(0,B.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){let n=Fe,o=Ne;return(0,T.S8)(n,e),(0,T.$A)(Ne,n,Pe),0===(0,T.Om)(Ne,Ne)&&(0,T.$A)(Ne,n,De),(0,T.$A)(o,Ne,n),se(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){let n={eye:(0,S.vt)(),up:null,tilt:i,heading:r},o=Fe;o[0]=e[0],o[1]=e[2],o[2]=-e[1];let s,l=t,c=(0,a.kU)(r),u=(0,a.kU)(i),d=Math.sin(c),h=Math.cos(c),f=Math.sin(u),m=Math.cos(u),p=(0,T.Bw)(o);if(Math.abs(u)<1e-8)s=l+p;else{let e=p/f,t=(0,a.YN)(l/e),r=Math.PI-u-t;s=e*Math.sin(r)}let v=m*l,g=l*l*(f*f),x=h*h*g,_=s-v,b=_*_,y=x*(x+b-o[1]*o[1]);if(y<0)return(0,T.hs)(n.eye,o,s/p),n.tilt=0,Le(n,e);let w,M=Math.sqrt(y),C=o[1]*_,A=x+b;if(w=h>0?-M+C:M+C,Math.abs(A)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=l):(0,T.hs)(n.eye,o,s/p),n.tilt=0,ze(n.eye),Le(n,e);n.eye[1]=w/A;let E=d*d*g,I=f*l,O=h*I*n.eye[1],P=n.eye[1]*n.eye[1],D=1-P,R=Math.sqrt(D),F=x*P+E-2*O*R*_+D*b;return Math.abs(F)<1e-8?((0,T.hs)(n.eye,o,s/p),n.tilt=0,ze(n.eye),Le(n,e)):(n.eye[0]=(D*(s*o[0]-v*o[0])-I*R*(o[0]*n.eye[1]*h+o[2]*d))/F,n.eye[2]=(D*(s*o[2]-v*o[2])-I*R*(o[2]*n.eye[1]*h-o[0]*d))/F,(0,T.hs)(n.eye,n.eye,s),ze(n.eye),Le(n,e))},eyeTiltToLookAtTilt:function(e,t,r){let i=(0,a.kU)(e),n=(0,T.Bw)(t);return(0,a.YN)(r/(n/Math.sin(i)))+i},getCurvatureSamples:He,headingTiltToDirectionUp:Be,lookAtTiltToEyeTilt:function(e,t,r){let i=(0,T.Bw)(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){let{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new we(r);i.near=2,n.update(i);let o=r.getAltitude(t),s=e.spatialReference,l=i.eye,c=function(e){let{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return $e.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage($e,t)}(e),u=He(e,t),d=i.aboveGround,h=n.planes[5],f=[],m=(0,ie.O_)(S.uY,je,(0,ie.vt)()),p=(0,ie.O_)(S.uY,Ge,(0,ie.vt)());(0,N.hZ)(Ye,0,0,0,0);for(let e=0;e<4;e++){let t=1===e&&!d||3===e&&d?1-c:0,i=1===e&&d||3===e&&!d?c:1,s=n.lines[e],v=n.lines[3===e?0:e+1];for(let n=0;n<u;n++){let c=n/u,d=1===e?1-(1-c)**2:3===e?c**2:c,g=0===n?0:(0,a.Cc)(t,i,d),x=(0,T.Cc)(We,s.origin,v.origin,g),_=(0,Oe.nu)(s.direction,v.direction,g,ke);r.intersectManifoldClosestSilhouette((0,D.LV)(x,_),o,Ze),le(Ze,l,Ze,h),f.push((0,S.o8)(Ze)),0!==f.length&&(0,T.lo)(f.at(-1),Ze);let b=+!!(0,ie.BX)(m,Ze)|((0,ie.BX)(p,Ze)?2:0);Ye[b]=1}}f.length>2&&(0,T.lo)(f[0],f.at(-1));let v=function(e,t,r){let i=2*(0,xe.FD)();return e.map(e=>{let n=[],o=!1;for(let a of e)t.fromRenderCoords(a,Ze,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,Ze[1]]),n.push([null,Ze[1]]),o=!0):n.push([Ze[0],Ze[1]]);if(o)for(let e=0;e<n.length;e++){let t=n[e];if(null!=t[0])continue;let r=n[e+1];t[0]=n.at(0===e?-1:e-1)[0],e++,r[0]=n.at(e===n.length-1?0:e+1)[0]}return n.push(n[0]),(0,J.$3)(n)||n.reverse(),n})}((0,N.m3)(Ye)>1?function(e,t){let r=[];for(let i of e)r.push(...Ve(i,t));return r}(Ve(f,m),p):[f],r,s);return new K.A({rings:v,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,l,c,u=t.latitude,d=(0,I.tO)(e.spatialReference).radius,h=t.longitude,f=function(e,t,r){let 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)}(u,r,d)/2;o=h-f,s=h+f;let m=(0,a.kU)(u),p=(1+Math.sin(m))/(1-Math.sin(m)),v=(p+1)*Math.tan(i/d/2),x=v*v;function _(e){let 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*p+x))),c=l+i/d,l=_(l),c=_(c),c<l){let e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=_e.Y_.monotonic(o,s),s-o>180){let e=(s-o-180)/2;o+=e,s-=e}let b=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:E.A.WGS84;return n?(n.xmin=o,n.ymin=l,n.xmax=s,n.ymax=c,n.spatialReference=b):n=new X.A({xmin:o,ymin:l,xmax:s,ymax:c,spatialReference:b}),e.spatialReference&&e.spatialReference.isWebMercator&&(0,ye.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Xe="composite-color",Ke=["final-color",Xe,"opaque-color","transparent-color"],Je={ANTIALIASING:"antialiasing",CUTFILL:"cutfill",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA:"focusarea",FOCUSAREA_MASK:"focusarea-mask",GAUSSIAN_SPLAT:"gaussian",GAUSSIAN_SPLAT_DEPTH:"gaussian-depth",GROUND_DEPTH:"ground-depth",HIGHLIGHT:"highlight",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_ACCUMULATION:"shadow-accumulation",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values(Je)).concat(Ke),(0,S.vt)();var Qe=r(10107),et=r(64108),tt=r(49186),rt=r(44208),it=(r(17676),r(94656));r(93637),r(4576),"layout.centroid.smooth.case.mat2x2.mat2x3.mat2x4.mat3x2.mat3x3.mat3x4.mat4x2.mat4x3.mat4x4.uint.uvec2.uvec3.uvec4.samplerCubeShadow.sampler2DArray.sampler2DArrayShadow.isampler2D.isampler3D.isamplerCube.isampler2DArray.usampler2D.usampler3D.usamplerCube.usampler2DArray.coherent.restrict.readonly.writeonly.resource.atomic_uint.noperspective.patch.sample.subroutine.common.partition.active.filter.image1D.image2D.image3D.imageCube.iimage1D.iimage2D.iimage3D.iimageCube.uimage1D.uimage2D.uimage3D.uimageCube.image1DArray.image2DArray.iimage1DArray.iimage2DArray.uimage1DArray.uimage2DArray.image1DShadow.image2DShadow.image1DArrayShadow.image2DArrayShadow.imageBuffer.iimageBuffer.uimageBuffer.sampler1DArray.sampler1DArrayShadow.isampler1D.isampler1DArray.usampler1D.usampler1DArray.isampler2DRect.usampler2DRect.samplerBuffer.isamplerBuffer.usamplerBuffer.sampler2DMS.isampler2DMS.usampler2DMS.sampler2DMSArray.isampler2DMSArray.usampler2DMSArray.trunc.round.roundEven.isnan.isinf.floatBitsToInt.floatBitsToUint.intBitsToFloat.uintBitsToFloat.packSnorm2x16.unpackSnorm2x16.packUnorm2x16.unpackUnorm2x16.packHalf2x16.unpackHalf2x16.outerProduct.transpose.determinant.inverse.texture.textureSize.textureProj.textureLod.textureOffset.texelFetch.texelFetchOffset.textureProjOffset.textureLodOffset.textureProjLod.textureProjLodOffset.textureGrad.textureGradOffset.textureProjGrad.textureProjGradOffset".split("."),"precision.highp.mediump.lowp.attribute.const.uniform.varying.break.continue.do.for.while.if.else.in.out.inout.float.int.void.bool.true.false.discard.return.mat2.mat3.mat4.vec2.vec3.vec4.ivec2.ivec3.ivec4.uvec2.uvec3.uvec4.bvec2.bvec3.bvec4.sampler1D.sampler2D.sampler3D.usampler1D.usampler2D.usampler3D.samplerCube.sampler1DShadow.sampler2DShadow.struct.asm.class.union.enum.typedef.template.this.packed.goto.switch.default.inline.noinline.volatile.public.static.extern.external.interface.long.short.double.half.fixed.unsigned.input.output.hvec2.hvec3.hvec4.dvec2.dvec3.dvec4.fvec2.fvec3.fvec4.sampler2DRect.sampler3DRect.sampler2DRectShadow.sizeof.cast.namespace.using".split("."),"<<= >>= ++ -- << >> <= >= == != && || += -= *= /= %= &= ^^ ^= |= ( ) [ ] . ! ~ * / % + - < > & ^ | ? : = , ; { }".split(" "),"abs.acos.all.any.asin.atan.ceil.clamp.cos.cross.dFdx.dFdy.degrees.distance.dot.equal.exp.exp2.faceforward.floor.fract.gl_BackColor.gl_BackLightModelProduct.gl_BackLightProduct.gl_BackMaterial.gl_BackSecondaryColor.gl_ClipPlane.gl_ClipVertex.gl_Color.gl_DepthRange.gl_DepthRangeParameters.gl_EyePlaneQ.gl_EyePlaneR.gl_EyePlaneS.gl_EyePlaneT.gl_Fog.gl_FogCoord.gl_FogFragCoord.gl_FogParameters.gl_FragColor.gl_FragCoord.gl_FragData.gl_FragDepth.gl_FragDepthEXT.gl_FrontColor.gl_FrontFacing.gl_FrontLightModelProduct.gl_FrontLightProduct.gl_FrontMaterial.gl_FrontSecondaryColor.gl_LightModel.gl_LightModelParameters.gl_LightModelProducts.gl_LightProducts.gl_LightSource.gl_LightSourceParameters.gl_MaterialParameters.gl_MaxClipPlanes.gl_MaxCombinedTextureImageUnits.gl_MaxDrawBuffers.gl_MaxFragmentUniformComponents.gl_MaxLights.gl_MaxTextureCoords.gl_MaxTextureImageUnits.gl_MaxTextureUnits.gl_MaxVaryingFloats.gl_MaxVertexAttribs.gl_MaxVertexTextureImageUnits.gl_MaxVertexUniformComponents.gl_ModelViewMatrix.gl_ModelViewMatrixInverse.gl_ModelViewMatrixInverseTranspose.gl_ModelViewMatrixTranspose.gl_ModelViewProjectionMatrix.gl_ModelViewProjectionMatrixInverse.gl_ModelViewProjectionMatrixInverseTranspose.gl_ModelViewProjectionMatrixTranspose.gl_MultiTexCoord0.gl_MultiTexCoord1.gl_MultiTexCoord2.gl_MultiTexCoord3.gl_MultiTexCoord4.gl_MultiTexCoord5.gl_MultiTexCoord6.gl_MultiTexCoord7.gl_Normal.gl_NormalMatrix.gl_NormalScale.gl_ObjectPlaneQ.gl_ObjectPlaneR.gl_ObjectPlaneS.gl_ObjectPlaneT.gl_Point.gl_PointCoord.gl_PointParameters.gl_PointSize.gl_Position.gl_ProjectionMatrix.gl_ProjectionMatrixInverse.gl_ProjectionMatrixInverseTranspose.gl_ProjectionMatrixTranspose.gl_SecondaryColor.gl_TexCoord.gl_TextureEnvColor.gl_TextureMatrix.gl_TextureMatrixInverse.gl_TextureMatrixInverseTranspose.gl_TextureMatrixTranspose.gl_Vertex.greaterThan.greaterThanEqual.inversesqrt.length.lessThan.lessThanEqual.log.log2.matrixCompMult.max.min.mix.mod.normalize.not.notEqual.pow.radians.reflect.refract.sign.sin.smoothstep.sqrt.step.tan.texture2D.texture2DLod.texture2DProj.texture2DProjLod.textureCube.textureCubeLod.texture2DLodEXT.texture2DProjLodEXT.textureCubeLodEXT.texture2DGradEXT.texture2DProjGradEXT.textureCubeGradEXT.textureSize.texelFetch".split("."),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,rt.A)("esri-tests-disable-gpu-memory-measurements"),(0,it.en)();(0,it.en)();var nt=r(90644),ot=r(48852),at=r(42293);const st=!!(0,rt.A)("esri-tests-disable-gpu-memory-measurements");class lt{constructor(e,t){this._context=e,this._descriptor=t,this.type=2,this._context.instanceCounter.increment(u.vt.Renderbuffer,this);let r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);let{width:i,height:n,internalFormat:o,multisampled:a}=t;a?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,i,n):r.renderbufferStorage(r.RENDERBUFFER,o,i,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){let e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return st?0:(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,at.MW)(e.internalFormat);var e}resize(e,t){let r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;let i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&=(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(u.vt.Renderbuffer,this),null)}}class ct{constructor(e,t,r){if(this._context=e,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,e.instanceCounter.increment(u.vt.FramebufferObject,this),null!=t){let r=function(e,t){return ut(t)||dt(t)?t:ht(t)?new d.g(e,t):function(e){return 3===ft(e)||null!=e&&"samples"in e}(t)?new lt(e,t):null}(e,t);null!=r&&(this._colorAttachments.set(36064,r),ut(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(36064)}if(null!=r)if(function(e){return ut(e)||ht(e)}(r))this._depthStencilTexture=ut(r)?r:new d.g(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{let t=dt(r)?r:new lt(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}get glName(){return this._glName}get colorTexture(){let e=this._colorAttachments.get(36064);return ut(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return(this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer)?.descriptor?.width??0}get height(){return(this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer)?.descriptor?.height??0}get usedMemory(){return this._colorAttachments.values().reduce((e,t)=>e+t.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(e){this._level!==e&&(this._level=e,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){let t=this._colorAttachments.get(e);return t&&ut(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=36064){if(!e)return;this._validateColorAttachmentPoint(t);let{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=36064){let t=this._colorAttachments.get(e);if(!t)return;let r=ut(t);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(r)this._framebufferTexture2D(null,e);else{let t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._glName){let t=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{e.forEach(e=>{ut(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=36064,r=0){let i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,r):this._framebufferTexture2D(i.glName,t,e,36160))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;let{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041!==r&&6402!==r?console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"):34041===r&&i!==u.ld.UNSIGNED_INT_24_8?console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):6402===r&&i!==u.ld.UNSIGNED_INT&&i!==u.ld.UNSIGNED_SHORT?console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,vt(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e)}detachDepthStencilTexture(){let e=this._depthStencilTexture;return e&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,vt(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;let t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);let{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){let e=this._depthStencilBuffer;if(e&&this._glName){let{_context:t}=this,r=t.boundFramebuffer;t.bindFramebuffer(this);let{gl:i}=t,n=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,n,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){let{_context:t}=this;t.temporaryBindFramebuffer(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,n,o,a){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");let s=a.descriptor;3553!==a.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||n+r>s.width||o+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");let l=this._context,c=l.bindTexture(a,d.g.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(d.g.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(3553,0,n,o,e,t,r,i),l.bindTexture(c,d.g.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,n,o,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,n,o,a)}async readPixelsAsync(e,t,r,i,n,o,a,s){let{gl:l}=this._context,c=ot.g.createPixelPack(this._context,35041,a.byteLength);try{this._context.bindBuffer(c);let u=this._context.boundFramebuffer;try{this._context.bindFramebuffer(this),l.readPixels(e,t,r,i,n,o,0)}finally{this._context.unbindBuffer(35051),this._context.bindFramebuffer(u)}await c.getSubDataAsync(a,void 0,void 0,void 0,s)}finally{c.dispose()}}resize(e,t){if(this.width===e&&this.height===t)return;let r={width:e,height:t};if(mt(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._glName&&(mt(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),(0,it.en)())){let{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){let{gl:t}=this._context;this._glName?t.bindFramebuffer(e,this._glName):(this._glName&&t.deleteFramebuffer(this._glName),this._glName=t.createFramebuffer(),t.bindFramebuffer(e,this._glName),this._initializeAttachments(e))}_initializeAttachments(e=36160){let{gl:t}=this._context;if(this._colorAttachments.forEach((t,r)=>{if(ut(t)){let i=pt(t);35866===i?this._framebufferTextureLayer(t.glName,r,e):this._framebufferTexture2D(t.glName,r,i,e)}else if(dt(t)){let i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){let r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){let t=vt(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,pt(this._depthStencilTexture),e)}(0,it.en)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(e,t=36064,r=3553,i=36160){this._context.gl.framebufferTexture2D(i,t,r,e,this._level)}_framebufferTextureLayer(e,t=36064,r=36160,i=0){this._context.gl.framebufferTextureLayer(r,t,e,this._level,i)}_disposeDepthStencilAttachments(){let e=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);let t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,s.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&=(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,vt(this._depthStencilTexture.descriptor.pixelFormat))),(0,s.WD)(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),mt(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){mt(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width!==e.width||this.height!==e.height)&&console.error("Attachment size must match framebuffer size!")}_getGLAttachmentPoint(e){switch(e.internalFormat){case u.SB.DEPTH_COMPONENT16:case u.SB.DEPTH_COMPONENT24:case u.SB.DEPTH_COMPONENT32F:return 36096;case u.iE.DEPTH24_STENCIL8:case u.iE.DEPTH32F_STENCIL8:return 33306;case 36168:return 36128;default:return 36064}}_validateColorAttachmentPoint(e){if(-1===ct._MAX_COLOR_ATTACHMENTS){let{gl:e}=this._context;ct._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}let t=e-36064;t+1>ct._MAX_COLOR_ATTACHMENTS&&z.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${ct._MAX_COLOR_ATTACHMENTS} color attachments`)}}function ut(e){return 1===ft(e)}function dt(e){return 2===ft(e)}function ht(e){return 0===ft(e)}function ft(e){return null!=e&&"type"in e?e.type:null}function mt(e,t){let r=Math.max(e.width,e.height);if(r>t){z.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);let i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function pt(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function vt(e){return 6402===e?36096:33306}r(21818),r(69397);var gt=r(85079);const xt=[new(r(74038)._)("position",2,u.pe.UNSIGNED_SHORT,0,4)];(0,gt.Xk)(xt),r(66289);const _t=new Image;_t.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",_t.width=5,_t.height=5,_t.decode();let bt=class extends R.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=Xe,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 tt.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(){let e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){e.initializeAndBind(),this.gl.drawBuffers(function(e){return e?e.colorAttachments.length>0?e.colorAttachments:[0]:[1029]}(e))}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0: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}}get requireGeometryDepth(){return!1}queryDepthRange(e){return null}get input(){return this._frameBuffer}};(0,i.Cg)([(0,Qe.MZ)({constructOnly:!0})],bt.prototype,"view",void 0),(0,i.Cg)([(0,Qe.MZ)({constructOnly:!0})],bt.prototype,"consumes",void 0),(0,i.Cg)([(0,Qe.MZ)()],bt.prototype,"produces",void 0),(0,i.Cg)([(0,Qe.MZ)({readOnly:!0})],bt.prototype,"techniques",null),bt=(0,i.Cg)([(0,et.$K)("esri.views.3d.webgl.RenderNode")],bt);let yt=class extends bt{constructor(){super(...arguments),this.consumes={required:["normals"]},this.produces="disabled"}get enabled(){return!this.destroying&&!this.destroyed&&this.produces===Je.AMBIENT_ILLUMINATION}get _belowMaxElevation(){return(this.view.state.camera.relativeElevation??1/0)<5e5}get _useGlobalIllumination(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(11)}get _useSSAO(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(3)}_enable(){this.produces=Je.AMBIENT_ILLUMINATION,this.requestRender(1)}_disable(){this.produces="disabled",this.requestRender(1)}};(0,i.Cg)([(0,n.MZ)()],yt.prototype,"consumes",void 0),(0,i.Cg)([(0,n.MZ)()],yt.prototype,"produces",void 0),yt=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl-engine.effects.AmbientIllumination")],yt);var wt=r(15581),Mt=r(13840),Tt=r(42958),St=r(95774);let Ct=class extends Tt.w{constructor(){super(...arguments),this.shader=new Mt.r(St.S,()=>r.e(1285).then(()=>r(91285)))}initializePipeline(){return(0,nt.Ey)({colorWrite:nt.kn})}};Ct=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],Ct);var At=r(65786);class Et extends At.Y{constructor(){super(...arguments),this.projScale=1}}class It extends Et{constructor(){super(...arguments),this.intensity=1}}class Ot extends At.Y{}class Pt extends Ot{constructor(){super(...arguments),this.blurSize=(0,F.vt)()}}let Dt=class extends Tt.w{constructor(){super(...arguments),this.shader=new Mt.r(wt.S,()=>r.e(6122).then(()=>r(86122)))}initializePipeline(){return(0,nt.Ey)({colorWrite:nt.kn})}};Dt=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],Dt);let Rt=class extends yt{constructor(e){super(e),this._enableTime=(0,c.l5)(0),this._passParameters=new It,this._drawParameters=new Pt}initialize(){let 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 h.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new d.g(this.renderingContext,t,e),this.addHandles((0,l.wB)(()=>this._useSSAO,e=>{this._enableTime=(0,c.l5)(0),e?this._enable():this._disable()},l.pc))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){let t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(33306);if(!r||!i)return;let n=this.techniques.getCompiled(Dt),s=this.techniques.getCompiled(Ct);if(!n||!s)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));let l=this.renderingContext,u=this.view.qualitySettings.fadeDuration,d=this.bindParameters,h=d.camera,f=h.relativeElevation,m=(0,a.qE)((5e5-f)/2e5,0,1),p=u>0?Math.min(u,performance.now()-this._enableTime)/u:1,v=p*m;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/h.computeScreenPixelSizeAtDistance(1),this._passParameters.intensity=4*Ft/(0,wt.g)(h)**6*v;let g=h.fullViewport[2],x=h.fullViewport[3],_=this.fboCache.acquire(g,x,"ssao input",2);l.bindFramebuffer(_.fbo),l.setViewport(0,0,g,x),l.bindTechnique(n,d,this._passParameters,this._drawParameters),l.screen.draw();let b=Math.round(g/2),y=Math.round(x/2),w=this.fboCache.acquire(b,y,"ssao blur",0);l.bindFramebuffer(w.fbo),this._drawParameters.colorTexture=_.getTexture(),(0,o.hZ)(this._drawParameters.blurSize,0,2/x),l.bindTechnique(s,d,this._passParameters,this._drawParameters),l.setViewport(0,0,b,y),l.screen.draw(),_.release();let M=this.fboCache.acquire(b,y,Je.AMBIENT_ILLUMINATION,0);return l.bindFramebuffer(M.fbo),l.setViewport(0,0,g,x),l.setClearColor(1,1,1,0),l.clear(16384),this._drawParameters.colorTexture=w.getTexture(),(0,o.hZ)(this._drawParameters.blurSize,2/g,0),l.bindTechnique(s,d,this._passParameters,this._drawParameters),l.setViewport(0,0,b,y),l.screen.draw(),l.setViewport4fv(h.fullViewport),w.release(),p<1&&this.requestRender(2),M}};Rt=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],Rt);const Ft=.5;var Nt=r(31821),Bt=r(12791);function zt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new Bt.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",.5),e.code.add(Nt.H`float evaluateAmbientOcclusionInverse() {
593
+ }`))}(e,t)}},68785(e,t,r){r.d(t,{n:()=>Lt});var i=r(32198),n=r(91429),o=r(37585),a=r(34727),s=r(97768),l=r(36708),c=r(78659),u=r(63907),d=r(21231),h=r(67171),f=r(69540);let m=class extends f.Pw{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,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"row",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"column",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"rows",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"columns",void 0),m=(0,i.Cg)([(0,n.$K)("esri.CameraLayout")],m);const p=m;var v=r(56507),g=r(69052),x=r(25482),_=r(86738),b=r(43937),y=r(36005);let w=class extends((0,f.OU)(x.o)){constructor(e){super(e),this.position=new _.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new p}writePosition(e,t,r,i){let n=e.clone();n.x=(0,v.GB)(e.x||0),n.y=(0,v.GB)(e.y||0),n.z=e.hasZ?(0,v.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){let r=new _.A;return r.read(e,t),r.x=(0,v.GB)(r.x||0),r.y=(0,v.GB)(r.y||0),r.z=r.hasZ?(0,v.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,i.Cg)([(0,n.MZ)({type:_.A,json:{write:{isRequired:!0}}})],w.prototype,"position",void 0),(0,i.Cg)([(0,b.K)("position")],w.prototype,"writePosition",null),(0,i.Cg)([(0,y.w)("position")],w.prototype,"readPosition",null),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,n.wg)(e=>g.ie.normalize((0,v.GB)(e)))],w.prototype,"heading",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,n.wg)(e=>(0,a.qE)((0,v.GB)(e),-180,180))],w.prototype,"tilt",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,n.wg)(e=>(0,a.qE)((0,v.GB)(e,55),1,170))],w.prototype,"fov",void 0),(0,i.Cg)([(0,n.MZ)({type:p,nonNullable:!0,json:{read:!1,write:!1}})],w.prototype,"layout",void 0),w=(0,i.Cg)([(0,n.$K)("esri.Camera")],w);var M=r(9093),T=r(35522),S=r(51850),C=(r(48353),r(9762),r(65806)),A=r(27993),E=r(16930),I=r(73941),O=(r(19419),r(58083)),P=r(65720),D=r(71351),R=r(56372),F=r(48163),B=r(78955),N=r(91829),z=r(53966),L=r(90629),H=r(44280);function V(e,t,r){e.worldUpAtPosition(t,U),(0,T.Re)(j,r,t);let i=(0,T.Bw)(j);return 0===i?0:(0,a.XM)((0,T.Om)(j,U)/i)}const U=(0,S.vt)(),j=(0,S.vt)();var G;let k=G=class extends R.A{constructor(e){super(e),this._ray=(0,D.vt)(),this._viewport=(0,N.fA)(0,0,1,1),this._padding=(0,N.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,F.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,M.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,M.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,M.vt)(),this._frustumDirty=!0,this._frustum=(0,P.vt)(),this._fullViewport=(0,N.vt)(),this._fullViewportDirty=!0,this._pixelRatio=1,this.pixelScale=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,S.vt)(),this._up=(0,S.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,"eye")}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,T.Re)(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,O.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get inverseViewMatrix(){return(0,O.Qw)((0,M.vt)(),this.viewMatrix)||this._get("inverseViewMatrix")||(0,M.vt)()}get viewForward(){return this._ensureViewClean(),(0,T.hZ)((0,S.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,T.hZ)((0,S.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,T.hZ)((0,S.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;let e=(0,B.hs)((0,N.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,B.aI)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;let e=(0,B.hs)((0,N.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,B.aI)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._fullViewportDirty=!0,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._fullViewportDirty=!0,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._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewportDirty&&=(this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this._viewport[2]+this._padding[1]+this._padding[3],this._fullViewport[3]=this._viewport[3]+this._padding[0]+this._padding[2],!1),this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,B.t2)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,B.C)(this._padding,e),this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&=((0,O.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,O.B8)((0,M.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,M.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,T.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,O.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,O.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){let{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get renderPixelSizePerDistance(){return Math.tan(this.fovX/2)/(this.width/2)}get screenPixelSizePerDistance(){return this.renderPixelSizePerDistance*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){let 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,u=(0,O.$h)((0,M.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),d=this._get("projectionMatrix");return d&&(0,O.t2)(d,u)?d:u}copyFrom(e){(0,T.C)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,B.C)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,B.C)(this._padding,e.padding),this.notifyChange("_padding"),this._fullViewportDirty=!0,(0,o.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;let t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,O.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||=((0,P.C)(this._frustum,e.frustum),!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,O.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this.pixelRatio=e.pixelRatio,this.pixelScale=e.pixelScale,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new G).copyFrom(this)}equals(e){return(0,T.t2)(this.eye,e.eye)&&(0,T.t2)(this.center,e.center)&&(0,T.t2)(this.up,e.up)&&(0,B.t2)(this._viewport,e.viewport)&&(0,B.t2)(this._padding,e.padding)&&(0,o.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}equalsView(e){return(0,T.t2)(this.eye,e.eye)&&(0,T.t2)(this.center,e.center)&&(0,T.t2)(this.up,e.up)&&this._fov===e.fov}almostEquals(e){let t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,B.hG)(e.screenPadding,this.screenPadding)>=t||(0,B.hG)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,T.jb)(Z,e.eye,e.center),(0,T.jb)(q,this.eye,this.center);let r=(0,T.Om)(Z,q),i=(0,T.uE)(Z),n=(0,T.uE)(q),o=5e-4;return r*r>=.9999999999*i*n&&(0,T.lo)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDistance(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDistance(e){return e*this.renderPixelSizePerDistance}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDistance(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,H.gr)(this.viewForward,(0,T.Re)(Z,e,this.eye)))}computeScreenPixelSizeAtDistance(e){return e*this.screenPixelSizePerDistance}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,L.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){let 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!==W&&(0,T.C)(W,e),W[3]=1,(0,B.Z0)(W,W,this.projectionMatrix);let r=Math.abs(W[3]);(0,T.hs)(W,W,1/r);let i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*W[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*W[1]),t[2]=.5*(W[2]+1),t[3]=r}unapplyProjection(e,t){let r=this.fullViewport;W[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],W[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],W[2]=(2*e[2]-1)*e[3],W[3]=e[3],null!=this.inverseProjectionMatrix&&((0,B.Z0)(W,W,this.inverseProjectionMatrix),t[0]=W[0],t[1]=W[1],t[2]=W[2])}projectToScreen(e,t){return null==this.projectToRenderScreen(e,Y)?null:(this.renderToScreen(Y,t),t)}projectToRenderScreen(e,t){if(W[0]=e[0],W[1]=e[1],W[2]=e[2],W[3]=1,(0,B.Z0)(W,W,this.viewProjectionMatrix),0===W[3])return null;let r=W;(0,T.hs)(r,r,1/Math.abs(W[3]));let 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,Y),t)}unprojectFromRenderScreen(e,t){if((0,O.lw)($,this.projectionMatrix,this.viewMatrix),!(0,O.B8)($,$))return null;let r=this.fullViewport;return W[0]=2*(e[0]-r[0])/r[2]-1,W[1]=2*(e[1]-r[1])/r[3]-1,W[2]=2*e[2]-1,W[3]=1,(0,B.Z0)(W,W,$),0===W[3]?null:(t[0]=W[0]/W[3],t[1]=W[1]/W[3],t[2]=W[2]/W[3],t)}constrainWindowSize(e,t,r,i){let 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),u=r-l- -Math.min(this.fullWidth-n-r/2,0),d=i-c- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(u),Math.round(d)]}computeUp(e){e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){let r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){let r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){let{center:r,eye:i,distance:n,fovY:o}=this,a=Math.abs(Math.PI/2-V(t,r,i));return e.frustumCoverage(a,n,o)}_computeUpGlobal(){(0,T.Re)(Z,this.center,this.eye);let e=(0,T.Bw)(this.center);e<1?(0,T.t2)(this._up,S.Cb)&&((0,T.C)(this._up,S.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,T.Om)(Z,this.center))>.9999*(0,T.Bw)(Z)*e||((0,T.$A)(q,Z,this.center),(0,T.$A)(q,q,Z),(0,T.S8)(q,q),(0,T.t2)(this._up,q)||((0,T.C)(this._up,q),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,T.oW)(Z,this.eye,this.center),Math.abs(Z[2])<=.9999&&((0,T.hs)(Z,Z,Z[2]),(0,T.hZ)(Z,-Z[0],-Z[1],1-Z[2]),(0,T.S8)(Z,Z),(0,T.t2)(this._up,Z)||((0,T.C)(this._up,Z),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,T.t2)(e,t)||((0,T.C)(t,e),this._markViewDirty(),this.notifyChange(r)):z.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,P.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),!1)}_ensureViewClean(){this._viewDirty&&((0,O.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,i.Cg)([(0,n.MZ)()],k.prototype,"_viewport",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_padding",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_fov",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_nearFar",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_viewDirty",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_viewMatrix",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"pixelRatio",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_pixelRatio",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"pixelScale",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"row",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"column",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_rows",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"rows",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_columns",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"columns",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"eye",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"center",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_center",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"up",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"_up",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"viewMatrix",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"inverseViewMatrix",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"viewForward",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"viewUp",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"viewRight",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"nearFar",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"near",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"far",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"viewport",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"screenViewport",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"screenPadding",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"x",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"y",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"width",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"height",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"fullWidth",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"fullHeight",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"_aspect",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"padding",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"projectionMatrix",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"inverseProjectionMatrix",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"fov",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"fovX",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"fovY",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"viewInverseTransposeMatrix",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],k.prototype,"_projectionMatrixInternal",null),(0,i.Cg)([(0,n.MZ)()],k.prototype,"relativeElevation",void 0),k=G=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl.RenderCamera")],k);const W=(0,N.vt)(),$=(0,M.vt)(),Z=(0,S.vt)(),q=(0,S.vt)(),Y=(0,L.r_)();r(49718),r(6867),r(16396),(0,M.vt)(),(0,S.vt)(),(0,S.vt)(),(0,S.vt)();var X=r(5443),K=r(39829),J=r(95108);function Q(e,t,r,i){let n=function(e,t){let r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=+(0===r);return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return+(1===n);let 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?2:3}}(r,i);if(e.length=0,t.length){1===n(te,t[0],t[0])&&ee(e,t[0]);for(let r=0;r<t.length;r++){let i=t[r===t.length-1?0:r+1];switch(n(te,t[r],i)){case 1:ee(e,i);break;case 3:ee(e,(0,F.o8)(te));break;case 2:ee(e,(0,F.o8)(te)),ee(e,i)}}}}function ee(e,t){0!==e.length&&(0,o.aI)(e.at(-1),t)||e.push(t)}const te=(0,F.vt)();var re=r(11964),ie=r(27921);const ne=(0,S.vt)(),oe=(0,S.vt)();function ae(){return{direction:(0,S.vt)(),up:(0,S.vt)()}}function se(e,t,r,i,n){let o=(0,T.S8)(ne,e),s=(0,T.Om)(o,i),l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,T.Om)(t,i)),s<.99?((0,T.C)(o,t),l&&(0,T.hs)(o,o,-1)):o=null);let c=0;if(o){(0,T.hs)(oe,i,(0,T.Om)(i,o)),(0,T.Re)(o,o,oe);let e=(0,T.Om)(o,n)/((0,T.Bw)(o)*(0,T.Bw)(n));(0,T.$A)(oe,o,n),c=((0,T.Om)(oe,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}let u=(0,a.KJ)((0,a.XM)(-(0,T.Om)(i,e)/(0,T.Bw)(e)));return r?(r.heading=c,r.tilt=u,r):{heading:c,tilt:u}}function le(e,t,r,i){(0,T.Re)(ce,r,t),!(0,ie.T7)(i,(0,re.LV)(t,ce),e)&&e!==r&&(0,T.C)(e,r)}const ce=(0,S.vt)(),ue=(0,S.fA)(0,1,0),de=(0,S.fA)(0,0,1),he=(0,M.vt)(),fe=(0,S.vt)(),me=(0,S.vt)();function pe(e,t,r,i=ae()){let{direction:n,up:o}=i;return(0,O.N9)(he,-(0,a.kU)(t)),(0,O.eL)(he,he,(0,a.kU)(r)),(0,T.Z0)(n,de,he),(0,T.hs)(n,n,-1),(0,T.Z0)(o,ue,he),i}function ve(e,t,r,i,n){let o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,T.Ln)(e,i,o,a)}const ge=(0,S.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return se(t,r,i,de,ue)},eyeForCenterWithHeadingTilt:function(e,t,r,i){let n=pe(0,r,i),o=(0,S.vt)();return(0,T.hs)(o,n.direction,-t),(0,T.WQ)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:pe,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){let r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){let t=r.lines[e];i.intersectInfiniteManifold((0,D.LV)(t.origin,t.direction),n,ge)||ve(ge,r,i,t.endpoint,n),le(ge,a,ge,l),s.push((0,F.fA)(ge[0],ge[1]))}return function(e,t,r){let i=e.map(e=>((0,T.hZ)(ge,e[0],e[1],0),t.fromRenderCoords(ge,ge,r),[ge[0],ge[1]]));return i.length<=2?new K.A({spatialReference:r}):(i.push(i[0].slice()),(0,J.$3)(i)||i.reverse(),new K.A({rings:[i],spatialReference:r}))}(function(e,t){let r=[],i=[];return Q(r,e,t,0),Q(i,r,t,1),Q(r,i,t,2),Q(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){let o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,C.g)(t,fe,o),(0,C.g)(t,me,o),fe[0]-=r/2,me[0]+=r/2,fe[1]-=i/2,me[1]+=i/2,(0,A.F)(fe,o,fe,a),(0,A.F)(me,o,me,a),n?(n.xmin=fe[0],n.ymin=fe[1],n.xmax=me[0],n.ymax=me[1],n.spatialReference=a):n=new X.A({xmin:fe[0],ymin:fe[1],xmax:me[0],ymax:me[1],spatialReference:a}),n}},Symbol.toStringTag,{value:"Module"}));var xe=r(34304),_e=r(52039),be=r(28540),ye=r(28735);class we{get planes(){return this.frustum}get points(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,P.vt)(),this._points=(0,P.Qy)(),this.lines=Array(12),this._origin=(0,S.vt)(),this._direction=(0,S.vt)(),this._boundingSphere=new be.i,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,S.vt)(),endpoint:null}}update(e){(0,P.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,T.C)(this._origin,e.eye),(0,T.C)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}get altitude(){return this._altitude}intersectsSphere(e){return(0,P.m7)(this.frustum,e)}isConvexHullOutsideViewPyramid(e,t){return(0,P.Pi)(this.frustum,e,t)}intersectsRay(e){return(0,P.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,P.ST)(this.frustum,e,t)}lineSegmentIntersectsViewPyramid(e,t){return(0,P.LJ)(this.frustum,e,t)}intersectsPoint(e){return(0,P.bU)(this.frustum,e)}_updateLines(){let e=this._points;for(let t=0;t<4;t++){let r=t+4;Me(this.lines[t],e[t],e[r]),Me(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),Me(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){let{origin:e}=this,t=Se;(0,T.S8)(t,this.direction);let r=Te;(0,T.jb)(r,this.points[4],e);let i=.5*(0,T.Om)(r,r)/(0,T.Om)(t,r),n=this._boundingSphere;n.center=(0,T.Ln)(Ce,e,t,i),n.radius=i}static{this.planePointIndices=P.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function Me(e,t,r){e.origin=t,e.endpoint=r,(0,T.oW)(e.direction,t,r)}const Te=(0,S.vt)(),Se=(0,S.vt)(),Ce=(0,S.vt)();r(86211);const Ae=(0,S.fA)(5802e-9,13558e-9,331e-7),Ee=(0,S.fA)(195e-8,5643e-9,255e-9);(0,S.fA)(Ae[0]+Ee[0],Ae[1]+Ee[1],Ae[2]+Ee[2]);class Ie{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Ie(0,0)}static{this.Infinite=new Ie}}(0,S.vt)(),(0,S.vt)(),new be.i,(0,D.vt)(),new X.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var Oe=r(32728);const Pe=(0,S.fA)(0,0,1),De=(0,T.S8)((0,S.vt)(),(0,S.fA)(1,1,1)),Re=(0,M.vt)(),Fe=(0,S.vt)(),Be=(0,S.vt)();function Ne(e,t,r,i=ae()){(0,T.$A)(Fe,e,Pe),0===(0,T.Om)(Fe,Fe)&&(0,T.$A)(Fe,e,De),(0,O.$0)(Re,-(0,a.kU)(t),e),(0,O.e$)(Re,Re,-(0,a.kU)(r),Fe);let{up:n,direction:o}=i;return(0,T.$A)(n,Fe,e),(0,T.S8)(n,n),(0,T.Z0)(n,n,Re),(0,T.S8)(o,e),(0,T.ze)(o,o),(0,T.Z0)(o,o,Re),i}function ze(e){let t=e[1];e[1]=-e[2],e[2]=t}function Le(e,t){return e.up=Ne(t,e.heading,e.tilt).up,e}function He(e,t){let{renderCoordsHelper:r,state:i}=e;if(i.isLocal)return 1;let n=r.getAltitude(t),o=r.referenceEllipsoid.radius,s=1+(0,T.Io)(i.camera.eye,t)/(o+n),l=Math.sqrt(s*s-1),{minCurvature:c,maxCurvature:u,minSamples:d,maxSamples:h}=Ue,f=(0,a.qE)((l-c)/(u-c),0,1);return Math.round((0,a.Cc)(d,h,f))}function Ve(e,t){let r=[],i=[],n=(0,xe.FD)();for(let o=0;o<e.length;o++){let a=e[o],s=o===e.length-1?e[0]:e[o+1],l=(0,re.Cr)(a,s,qe),c=(0,ie.vE)(t,l.origin,l.vector,0,$e);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{let[e,o,s]=0===c?[1,r,i]:[-1,i,r],l=(0,ie.Qj)(t),u=(0,T.Ln)((0,S.vt)(),$e,l,e*n),d=(0,T.Ln)((0,S.vt)(),$e,l,e*-n);o.push(a),o.push(u),s.push(d)}}}let o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Ue={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},je=(0,S.fA)(1,0,0),Ge=(0,S.fA)(0,1,0),ke=(0,S.vt)(),We=(0,S.vt)(),$e=(0,S.vt)(),Ze=new be.i,qe=(0,re.vt)(),Ye=(0,N.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){let n=Fe,o=Be;return(0,T.S8)(n,e),(0,T.$A)(Be,n,Pe),0===(0,T.Om)(Be,Be)&&(0,T.$A)(Be,n,De),(0,T.$A)(o,Be,n),se(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){let n={eye:(0,S.vt)(),up:null,tilt:i,heading:r},o=Fe;o[0]=e[0],o[1]=e[2],o[2]=-e[1];let s,l=t,c=(0,a.kU)(r),u=(0,a.kU)(i),d=Math.sin(c),h=Math.cos(c),f=Math.sin(u),m=Math.cos(u),p=(0,T.Bw)(o);if(Math.abs(u)<1e-8)s=l+p;else{let e=p/f,t=(0,a.YN)(l/e),r=Math.PI-u-t;s=e*Math.sin(r)}let v=m*l,g=l*l*(f*f),x=h*h*g,_=s-v,b=_*_,y=x*(x+b-o[1]*o[1]);if(y<0)return(0,T.hs)(n.eye,o,s/p),n.tilt=0,Le(n,e);let w,M=Math.sqrt(y),C=o[1]*_,A=x+b;if(w=h>0?-M+C:M+C,Math.abs(A)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=l):(0,T.hs)(n.eye,o,s/p),n.tilt=0,ze(n.eye),Le(n,e);n.eye[1]=w/A;let E=d*d*g,I=f*l,O=h*I*n.eye[1],P=n.eye[1]*n.eye[1],D=1-P,R=Math.sqrt(D),F=x*P+E-2*O*R*_+D*b;return Math.abs(F)<1e-8?((0,T.hs)(n.eye,o,s/p),n.tilt=0,ze(n.eye),Le(n,e)):(n.eye[0]=(D*(s*o[0]-v*o[0])-I*R*(o[0]*n.eye[1]*h+o[2]*d))/F,n.eye[2]=(D*(s*o[2]-v*o[2])-I*R*(o[2]*n.eye[1]*h-o[0]*d))/F,(0,T.hs)(n.eye,n.eye,s),ze(n.eye),Le(n,e))},eyeTiltToLookAtTilt:function(e,t,r){let i=(0,a.kU)(e),n=(0,T.Bw)(t);return(0,a.YN)(r/(n/Math.sin(i)))+i},getCurvatureSamples:He,headingTiltToDirectionUp:Ne,lookAtTiltToEyeTilt:function(e,t,r){let i=(0,T.Bw)(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){let{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new we(r);i.near=2,n.update(i);let o=r.getAltitude(t),s=e.spatialReference,l=i.eye,c=function(e){let{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return Ze.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(Ze,t)}(e),u=He(e,t),d=i.aboveGround,h=n.planes[5],f=[],m=(0,ie.O_)(S.uY,je,(0,ie.vt)()),p=(0,ie.O_)(S.uY,Ge,(0,ie.vt)());(0,B.hZ)(Ye,0,0,0,0);for(let e=0;e<4;e++){let t=1===e&&!d||3===e&&d?1-c:0,i=1===e&&d||3===e&&!d?c:1,s=n.lines[e],v=n.lines[3===e?0:e+1];for(let n=0;n<u;n++){let c=n/u,d=1===e?1-(1-c)**2:3===e?c**2:c,g=0===n?0:(0,a.Cc)(t,i,d),x=(0,T.Cc)(We,s.origin,v.origin,g),_=(0,Oe.nu)(s.direction,v.direction,g,ke);r.intersectManifoldClosestSilhouette((0,D.LV)(x,_),o,$e),le($e,l,$e,h),f.push((0,S.o8)($e)),0!==f.length&&(0,T.lo)(f.at(-1),$e);let b=+!!(0,ie.BX)(m,$e)|((0,ie.BX)(p,$e)?2:0);Ye[b]=1}}f.length>2&&(0,T.lo)(f[0],f.at(-1));let v=function(e,t,r){let i=2*(0,xe.FD)();return e.map(e=>{let n=[],o=!1;for(let a of e)t.fromRenderCoords(a,$e,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,$e[1]]),n.push([null,$e[1]]),o=!0):n.push([$e[0],$e[1]]);if(o)for(let e=0;e<n.length;e++){let t=n[e];if(null!=t[0])continue;let r=n[e+1];t[0]=n.at(0===e?-1:e-1)[0],e++,r[0]=n.at(e===n.length-1?0:e+1)[0]}return n.push(n[0]),(0,J.$3)(n)||n.reverse(),n})}((0,B.m3)(Ye)>1?function(e,t){let r=[];for(let i of e)r.push(...Ve(i,t));return r}(Ve(f,m),p):[f],r,s);return new K.A({rings:v,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,l,c,u=t.latitude,d=(0,I.tO)(e.spatialReference).radius,h=t.longitude,f=function(e,t,r){let 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)}(u,r,d)/2;o=h-f,s=h+f;let m=(0,a.kU)(u),p=(1+Math.sin(m))/(1-Math.sin(m)),v=(p+1)*Math.tan(i/d/2),x=v*v;function _(e){let 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*p+x))),c=l+i/d,l=_(l),c=_(c),c<l){let e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=_e.Y_.monotonic(o,s),s-o>180){let e=(s-o-180)/2;o+=e,s-=e}let b=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:E.A.WGS84;return n?(n.xmin=o,n.ymin=l,n.xmax=s,n.ymax=c,n.spatialReference=b):n=new X.A({xmin:o,ymin:l,xmax:s,ymax:c,spatialReference:b}),e.spatialReference&&e.spatialReference.isWebMercator&&(0,ye.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Xe="composite-color",Ke=["final-color",Xe,"opaque-color","transparent-color"],Je={ANTIALIASING:"antialiasing",CUTFILL:"cutfill",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA:"focusarea",FOCUSAREA_MASK:"focusarea-mask",GAUSSIAN_SPLAT:"gaussian",GAUSSIAN_SPLAT_DEPTH:"gaussian-depth",GROUND_DEPTH:"ground-depth",HIGHLIGHT:"highlight",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_ACCUMULATION:"shadow-accumulation",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values(Je)).concat(Ke),(0,S.vt)();var Qe=r(10107),et=r(64108),tt=r(49186),rt=r(44208),it=(r(17676),r(94656));r(93637),r(4576),"layout.centroid.smooth.case.mat2x2.mat2x3.mat2x4.mat3x2.mat3x3.mat3x4.mat4x2.mat4x3.mat4x4.uint.uvec2.uvec3.uvec4.samplerCubeShadow.sampler2DArray.sampler2DArrayShadow.isampler2D.isampler3D.isamplerCube.isampler2DArray.usampler2D.usampler3D.usamplerCube.usampler2DArray.coherent.restrict.readonly.writeonly.resource.atomic_uint.noperspective.patch.sample.subroutine.common.partition.active.filter.image1D.image2D.image3D.imageCube.iimage1D.iimage2D.iimage3D.iimageCube.uimage1D.uimage2D.uimage3D.uimageCube.image1DArray.image2DArray.iimage1DArray.iimage2DArray.uimage1DArray.uimage2DArray.image1DShadow.image2DShadow.image1DArrayShadow.image2DArrayShadow.imageBuffer.iimageBuffer.uimageBuffer.sampler1DArray.sampler1DArrayShadow.isampler1D.isampler1DArray.usampler1D.usampler1DArray.isampler2DRect.usampler2DRect.samplerBuffer.isamplerBuffer.usamplerBuffer.sampler2DMS.isampler2DMS.usampler2DMS.sampler2DMSArray.isampler2DMSArray.usampler2DMSArray.trunc.round.roundEven.isnan.isinf.floatBitsToInt.floatBitsToUint.intBitsToFloat.uintBitsToFloat.packSnorm2x16.unpackSnorm2x16.packUnorm2x16.unpackUnorm2x16.packHalf2x16.unpackHalf2x16.outerProduct.transpose.determinant.inverse.texture.textureSize.textureProj.textureLod.textureOffset.texelFetch.texelFetchOffset.textureProjOffset.textureLodOffset.textureProjLod.textureProjLodOffset.textureGrad.textureGradOffset.textureProjGrad.textureProjGradOffset".split("."),"precision.highp.mediump.lowp.attribute.const.uniform.varying.break.continue.do.for.while.if.else.in.out.inout.float.int.void.bool.true.false.discard.return.mat2.mat3.mat4.vec2.vec3.vec4.ivec2.ivec3.ivec4.uvec2.uvec3.uvec4.bvec2.bvec3.bvec4.sampler1D.sampler2D.sampler3D.usampler1D.usampler2D.usampler3D.samplerCube.sampler1DShadow.sampler2DShadow.struct.asm.class.union.enum.typedef.template.this.packed.goto.switch.default.inline.noinline.volatile.public.static.extern.external.interface.long.short.double.half.fixed.unsigned.input.output.hvec2.hvec3.hvec4.dvec2.dvec3.dvec4.fvec2.fvec3.fvec4.sampler2DRect.sampler3DRect.sampler2DRectShadow.sizeof.cast.namespace.using".split("."),"<<= >>= ++ -- << >> <= >= == != && || += -= *= /= %= &= ^^ ^= |= ( ) [ ] . ! ~ * / % + - < > & ^ | ? : = , ; { }".split(" "),"abs.acos.all.any.asin.atan.ceil.clamp.cos.cross.dFdx.dFdy.degrees.distance.dot.equal.exp.exp2.faceforward.floor.fract.gl_BackColor.gl_BackLightModelProduct.gl_BackLightProduct.gl_BackMaterial.gl_BackSecondaryColor.gl_ClipPlane.gl_ClipVertex.gl_Color.gl_DepthRange.gl_DepthRangeParameters.gl_EyePlaneQ.gl_EyePlaneR.gl_EyePlaneS.gl_EyePlaneT.gl_Fog.gl_FogCoord.gl_FogFragCoord.gl_FogParameters.gl_FragColor.gl_FragCoord.gl_FragData.gl_FragDepth.gl_FragDepthEXT.gl_FrontColor.gl_FrontFacing.gl_FrontLightModelProduct.gl_FrontLightProduct.gl_FrontMaterial.gl_FrontSecondaryColor.gl_LightModel.gl_LightModelParameters.gl_LightModelProducts.gl_LightProducts.gl_LightSource.gl_LightSourceParameters.gl_MaterialParameters.gl_MaxClipPlanes.gl_MaxCombinedTextureImageUnits.gl_MaxDrawBuffers.gl_MaxFragmentUniformComponents.gl_MaxLights.gl_MaxTextureCoords.gl_MaxTextureImageUnits.gl_MaxTextureUnits.gl_MaxVaryingFloats.gl_MaxVertexAttribs.gl_MaxVertexTextureImageUnits.gl_MaxVertexUniformComponents.gl_ModelViewMatrix.gl_ModelViewMatrixInverse.gl_ModelViewMatrixInverseTranspose.gl_ModelViewMatrixTranspose.gl_ModelViewProjectionMatrix.gl_ModelViewProjectionMatrixInverse.gl_ModelViewProjectionMatrixInverseTranspose.gl_ModelViewProjectionMatrixTranspose.gl_MultiTexCoord0.gl_MultiTexCoord1.gl_MultiTexCoord2.gl_MultiTexCoord3.gl_MultiTexCoord4.gl_MultiTexCoord5.gl_MultiTexCoord6.gl_MultiTexCoord7.gl_Normal.gl_NormalMatrix.gl_NormalScale.gl_ObjectPlaneQ.gl_ObjectPlaneR.gl_ObjectPlaneS.gl_ObjectPlaneT.gl_Point.gl_PointCoord.gl_PointParameters.gl_PointSize.gl_Position.gl_ProjectionMatrix.gl_ProjectionMatrixInverse.gl_ProjectionMatrixInverseTranspose.gl_ProjectionMatrixTranspose.gl_SecondaryColor.gl_TexCoord.gl_TextureEnvColor.gl_TextureMatrix.gl_TextureMatrixInverse.gl_TextureMatrixInverseTranspose.gl_TextureMatrixTranspose.gl_Vertex.greaterThan.greaterThanEqual.inversesqrt.length.lessThan.lessThanEqual.log.log2.matrixCompMult.max.min.mix.mod.normalize.not.notEqual.pow.radians.reflect.refract.sign.sin.smoothstep.sqrt.step.tan.texture2D.texture2DLod.texture2DProj.texture2DProjLod.textureCube.textureCubeLod.texture2DLodEXT.texture2DProjLodEXT.textureCubeLodEXT.texture2DGradEXT.texture2DProjGradEXT.textureCubeGradEXT.textureSize.texelFetch".split("."),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map;const nt=()=>z.A.getLogger("esri.views.webgl.Program");(0,rt.A)("esri-tests-disable-gpu-memory-measurements"),(0,it.en)();(0,it.en)();var ot=r(90644),at=r(48852),st=r(42293);const lt=!!(0,rt.A)("esri-tests-disable-gpu-memory-measurements");class ct{constructor(e,t){this._context=e,this._descriptor=t,this.type=2,this._context.instanceCounter.increment(u.vt.Renderbuffer,this);let r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);let{width:i,height:n,internalFormat:o,multisampled:a}=t;a?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,i,n):r.renderbufferStorage(r.RENDERBUFFER,o,i,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){let e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return lt?0:(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,st.MW)(e.internalFormat);var e}resize(e,t){let r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;let i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&=(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(u.vt.Renderbuffer,this),null)}}class ut{constructor(e,t,r){if(this._context=e,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,e.instanceCounter.increment(u.vt.FramebufferObject,this),null!=t){let r=function(e,t){return dt(t)||ht(t)?t:ft(t)?new d.g(e,t):function(e){return 3===mt(e)||null!=e&&"samples"in e}(t)?new ct(e,t):null}(e,t);null!=r&&(this._colorAttachments.set(36064,r),dt(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(36064)}if(null!=r)if(function(e){return dt(e)||ft(e)}(r))this._depthStencilTexture=dt(r)?r:new d.g(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{let t=ht(r)?r:new ct(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}get glName(){return this._glName}get colorTexture(){let e=this._colorAttachments.get(36064);return dt(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return(this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer)?.descriptor?.width??0}get height(){return(this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer)?.descriptor?.height??0}get usedMemory(){return this._colorAttachments.values().reduce((e,t)=>e+t.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(e){this._level!==e&&(this._level=e,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){let t=this._colorAttachments.get(e);return t&&dt(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=36064){if(!e)return;this._validateColorAttachmentPoint(t);let{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=36064){let t=this._colorAttachments.get(e);if(!t)return;let r=dt(t);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(r)this._framebufferTexture2D(null,e);else{let t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._glName){let t=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{e.forEach(e=>{dt(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=36064,r=0){let i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,r):this._framebufferTexture2D(i.glName,t,e,36160))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;let{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041!==r&&6402!==r?console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"):34041===r&&i!==u.ld.UNSIGNED_INT_24_8?console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):6402===r&&i!==u.ld.UNSIGNED_INT&&i!==u.ld.UNSIGNED_SHORT?console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,gt(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e)}detachDepthStencilTexture(){let e=this._depthStencilTexture;return e&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,gt(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;let t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);let{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){let e=this._depthStencilBuffer;if(e&&this._glName){let{_context:t}=this,r=t.boundFramebuffer;t.bindFramebuffer(this);let{gl:i}=t,n=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,n,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){let{_context:t}=this;t.temporaryBindFramebuffer(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,n,o,a){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");let s=a.descriptor;3553!==a.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||n+r>s.width||o+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");let l=this._context,c=l.bindTexture(a,d.g.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(d.g.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(3553,0,n,o,e,t,r,i),l.bindTexture(c,d.g.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,n,o,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,n,o,a)}async readPixelsAsync(e,t,r,i,n,o,a,s){let{gl:l}=this._context,c=at.g.createPixelPack(this._context,35041,a.byteLength);try{this._context.bindBuffer(c);let u=this._context.boundFramebuffer;try{this._context.bindFramebuffer(this),l.readPixels(e,t,r,i,n,o,0)}finally{this._context.unbindBuffer(35051),this._context.bindFramebuffer(u)}await c.getSubDataAsync(a,void 0,void 0,void 0,s)}finally{c.dispose()}}resize(e,t){if(this.width===e&&this.height===t)return;let r={width:e,height:t};if(pt(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._glName&&(pt(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),(0,it.en)())){let{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){let{gl:t}=this._context;this._glName?t.bindFramebuffer(e,this._glName):(this._glName&&t.deleteFramebuffer(this._glName),this._glName=t.createFramebuffer(),t.bindFramebuffer(e,this._glName),this._initializeAttachments(e))}_initializeAttachments(e=36160){let{gl:t}=this._context;if(this._colorAttachments.forEach((t,r)=>{if(dt(t)){let i=vt(t);35866===i?this._framebufferTextureLayer(t.glName,r,e):this._framebufferTexture2D(t.glName,r,i,e)}else if(ht(t)){let i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){let r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){let t=gt(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,vt(this._depthStencilTexture),e)}(0,it.en)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(e,t=36064,r=3553,i=36160){this._context.gl.framebufferTexture2D(i,t,r,e,this._level)}_framebufferTextureLayer(e,t=36064,r=36160,i=0){this._context.gl.framebufferTextureLayer(r,t,e,this._level,i)}_disposeDepthStencilAttachments(){let e=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);let t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,s.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&=(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,gt(this._depthStencilTexture.descriptor.pixelFormat))),(0,s.WD)(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),pt(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){pt(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width!==e.width||this.height!==e.height)&&console.error("Attachment size must match framebuffer size!")}_getGLAttachmentPoint(e){switch(e.internalFormat){case u.SB.DEPTH_COMPONENT16:case u.SB.DEPTH_COMPONENT24:case u.SB.DEPTH_COMPONENT32F:return 36096;case u.iE.DEPTH24_STENCIL8:case u.iE.DEPTH32F_STENCIL8:return 33306;case 36168:return 36128;default:return 36064}}_validateColorAttachmentPoint(e){if(-1===ut._MAX_COLOR_ATTACHMENTS){let{gl:e}=this._context;ut._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}let t=e-36064;t+1>ut._MAX_COLOR_ATTACHMENTS&&z.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${ut._MAX_COLOR_ATTACHMENTS} color attachments`)}}function dt(e){return 1===mt(e)}function ht(e){return 2===mt(e)}function ft(e){return 0===mt(e)}function mt(e){return null!=e&&"type"in e?e.type:null}function pt(e,t){let r=Math.max(e.width,e.height);if(r>t){z.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);let i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function vt(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function gt(e){return 6402===e?36096:33306}r(21818),r(69397);var xt=r(85079);const _t=[new(r(74038)._)("position",2,u.pe.UNSIGNED_SHORT,0,4)];(0,xt.Xk)(_t),r(66289);const bt=new Image;bt.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",bt.width=5,bt.height=5,bt.decode();let yt=class extends R.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=Xe,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 tt.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(){let e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){e.initializeAndBind(),this.gl.drawBuffers(function(e){return e?e.colorAttachments.length>0?e.colorAttachments:[0]:[1029]}(e))}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0: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}}get requireGeometryDepth(){return!1}queryDepthRange(e){return null}get input(){return this._frameBuffer}};(0,i.Cg)([(0,Qe.MZ)({constructOnly:!0})],yt.prototype,"view",void 0),(0,i.Cg)([(0,Qe.MZ)({constructOnly:!0})],yt.prototype,"consumes",void 0),(0,i.Cg)([(0,Qe.MZ)()],yt.prototype,"produces",void 0),(0,i.Cg)([(0,Qe.MZ)({readOnly:!0})],yt.prototype,"techniques",null),yt=(0,i.Cg)([(0,et.$K)("esri.views.3d.webgl.RenderNode")],yt);let wt=class extends yt{constructor(){super(...arguments),this.consumes={required:["normals"]},this.produces="disabled"}get enabled(){return!this.destroying&&!this.destroyed&&this.produces===Je.AMBIENT_ILLUMINATION}get _belowMaxElevation(){return(this.view.state.camera.relativeElevation??1/0)<5e5}get _useGlobalIllumination(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(11)}get _useSSAO(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(3)}_enable(){this.produces=Je.AMBIENT_ILLUMINATION,this.requestRender(1)}_disable(){this.produces="disabled",this.requestRender(1)}};(0,i.Cg)([(0,n.MZ)()],wt.prototype,"consumes",void 0),(0,i.Cg)([(0,n.MZ)()],wt.prototype,"produces",void 0),wt=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl-engine.effects.AmbientIllumination")],wt);var Mt=r(15581),Tt=r(13840),St=r(42958),Ct=r(95774);let At=class extends St.w{constructor(){super(...arguments),this.shader=new Tt.r(Ct.S,()=>r.e(1285).then(()=>r(91285)))}initializePipeline(){return(0,ot.Ey)({colorWrite:ot.kn})}};At=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],At);var Et=r(65786);class It extends Et.Y{constructor(){super(...arguments),this.projScale=1}}class Ot extends It{constructor(){super(...arguments),this.intensity=1}}class Pt extends Et.Y{}class Dt extends Pt{constructor(){super(...arguments),this.blurSize=(0,F.vt)()}}let Rt=class extends St.w{constructor(){super(...arguments),this.shader=new Tt.r(Mt.S,()=>r.e(6122).then(()=>r(86122)))}initializePipeline(){return(0,ot.Ey)({colorWrite:ot.kn})}};Rt=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],Rt);let Ft=class extends wt{constructor(e){super(e),this._enableTime=(0,c.l5)(0),this._passParameters=new Ot,this._drawParameters=new Dt}initialize(){let 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 h.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new d.g(this.renderingContext,t,e),this.addHandles((0,l.wB)(()=>this._useSSAO,e=>{this._enableTime=(0,c.l5)(0),e?this._enable():this._disable()},l.pc))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){let t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(33306);if(!r||!i)return;let n=this.techniques.getCompiled(Rt),s=this.techniques.getCompiled(At);if(!n||!s)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));let l=this.renderingContext,u=this.view.qualitySettings.fadeDuration,d=this.bindParameters,h=d.camera,f=h.relativeElevation,m=(0,a.qE)((5e5-f)/2e5,0,1),p=u>0?Math.min(u,performance.now()-this._enableTime)/u:1,v=p*m;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/h.computeScreenPixelSizeAtDistance(1),this._passParameters.intensity=4*Bt/(0,Mt.g)(h)**6*v;let g=h.fullViewport[2],x=h.fullViewport[3],_=this.fboCache.acquire(g,x,"ssao input",2);l.bindFramebuffer(_.fbo),l.setViewport(0,0,g,x),l.bindTechnique(n,d,this._passParameters,this._drawParameters),l.screen.draw();let b=Math.round(g/2),y=Math.round(x/2),w=this.fboCache.acquire(b,y,"ssao blur",0);l.bindFramebuffer(w.fbo),this._drawParameters.colorTexture=_.getTexture(),(0,o.hZ)(this._drawParameters.blurSize,0,2/x),l.bindTechnique(s,d,this._passParameters,this._drawParameters),l.setViewport(0,0,b,y),l.screen.draw(),_.release();let M=this.fboCache.acquire(b,y,Je.AMBIENT_ILLUMINATION,0);return l.bindFramebuffer(M.fbo),l.setViewport(0,0,g,x),l.setClearColor(1,1,1,0),l.clear(16384),this._drawParameters.colorTexture=w.getTexture(),(0,o.hZ)(this._drawParameters.blurSize,2/g,0),l.bindTechnique(s,d,this._passParameters,this._drawParameters),l.setViewport(0,0,b,y),l.screen.draw(),l.setViewport4fv(h.fullViewport),w.release(),p<1&&this.requestRender(2),M}};Ft=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],Ft);const Bt=.5;var Nt=r(31821),zt=r(12791);function Lt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new zt.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",.5),e.code.add(Nt.H`float evaluateAmbientOcclusionInverse() {
595
594
  vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
596
595
  return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
597
596
  }
@@ -1082,7 +1081,7 @@ return max(c.x, max(c.y, c.z));
1082
1081
  vec3 hiD = hiA + hiB;
1083
1082
  vec3 loD = loA + loB;
1084
1083
  return dpDummy * hiD + loD;
1085
- }`)}},20693(e,t,r){r.d(t,{y:()=>f,N:()=>m});var i=r(58083),n=r(9093),o=r(35522),a=r(51850),s=r(23205),l=r(40710),c=r(58029),u=r(74333);class d extends u.n{constructor(e,t,r){super(e,"mat4",2,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}var h=r(45324);function f(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new l.W("cameraPosition",({origin:e},{camera:t})=>(0,o.hZ)(g,t.viewInverseTransposeMatrix[3]-e[0],t.viewInverseTransposeMatrix[7]-e[1],t.viewInverseTransposeMatrix[11]-e[2])))}function m(e,t){t.instancedDoublePrecision?e.uniforms.add(h.rS,new c.F("view",e=>(0,i.Tl)(v,e.camera.viewMatrix,p(e))),new s.d("localOrigin",e=>p(e))):e.uniforms.add(h.rS,new d("view",(e,t)=>(0,i.Tl)(v,t.camera.viewMatrix,e.origin)),new l.W("localOrigin",e=>e.origin))}function p({camera:e}){return(0,o.hZ)(g,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11])}const v=(0,n.vt)(),g=(0,a.vt)()},45324(e,t,r){var i=r(37585),n=r(48163),o=r(35522),a=r(51850),s=r(77108),l=r(23205),c=r(14314),u=r(33094),d=r(58029);new d.F("view",({camera:e})=>e.viewMatrix),new d.F("inverseViewMatrix",({camera:e})=>e.inverseViewMatrix);const h=new d.F("proj",({camera:e})=>e.projectionMatrix),f=(new d.F("inverseProjectionMatrix",({camera:e})=>e.inverseProjectionMatrix),new l.d("cameraPosition",({camera:e})=>e.eye),new d.F("viewNormal",({camera:e})=>e.viewInverseTransposeMatrix)),m=(new l.d("localUpView",({camera:e})=>{let t=e.viewInverseTransposeMatrix;return(0,o.S8)(v,(0,o.hZ)(v,t[8],t[9],t[10]))}),new s.E("nearFar",({camera:e})=>e.nearFar)),p=(new c.I("viewport",({camera:e})=>e.fullViewport),new u.U("pixelRatio",e=>e.camera.pixelRatio/e.overlayStretch),new u.U("screenPixelSizePerDistance",({camera:e})=>e.screenPixelSizePerDistance),new u.U("worldToScreenPerDistanceRatio",({viewCamera:e})=>1/e.screenPixelSizePerDistance),new u.U("renderPixelSizePerDistance",({camera:e})=>e.renderPixelSizePerDistance),new u.U("metersPerRenderUnit",e=>e.metersPerRenderUnit),new s.E("inverseScreenSize",({camera:e})=>(0,i.hZ)(p,1/e.fullWidth,1/e.fullHeight)),new s.E("pixelToNDC",({camera:e})=>(0,i.hZ)(p,2/e.fullViewport[2],2/e.fullViewport[3])),(0,n.vt)()),v=(0,a.vt)();r.d(t,["HO",0,f,"Y$",0,m,"rS",0,h])},77108(e,t,r){r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",0,(i,n)=>i.setUniform2fv(e,t(n),r))}}},68259(e,t,r){r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,n,o,a)=>i.setUniform2fv(e,t(n,o,a),r))}}},47286(e,t,r){r.d(t,{G:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,n,o)=>i.setUniform2fv(e,t(n,o),r))}}},23205(e,t,r){r.d(t,{d:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",0,(i,n)=>i.setUniform3fv(e,t(n),r))}}},40710(e,t,r){r.d(t,{W:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",2,(i,n,o,a)=>i.setUniform3fv(e,t(n,o,a),r))}}},33079(e,t,r){r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",1,(i,n,o)=>i.setUniform3fv(e,t(n,o),r))}}},14314(e,t,r){r.d(t,{I:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,n)=>i.setUniform4fv(e,t(n),r))}}},71988(e,t,r){r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",1,(i,n,o)=>i.setUniform4fv(e,t(n,o),r))}}},33094(e,t,r){r.d(t,{U:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",0,(i,n)=>i.setUniform1f(e,t(n),r))}}},28421(e,t,r){r.d(t,{J:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",2,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},20304(e,t,r){r.d(t,{m:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",1,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},35818(e,t,r){r.d(t,{W:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"int",0,(r,i)=>r.setUniform1i(e,t(i)))}}},98353(e,t,r){r.d(t,{h:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat3",2,(i,n,o)=>i.setUniformMatrix3fv(e,t(n,o),r))}}},35644(e,t,r){r.d(t,{k:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat3",1,(i,n,o)=>i.setUniformMatrix3fv(e,t(n,o),r))}}},58029(e,t,r){r.d(t,{F:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat4",0,(i,n)=>i.setUniformMatrix4fv(e,t(n),r))}}},12791(e,t,r){r.d(t,{x:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},15976(e,t,r){r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"sampler2D",2,(i,n,o)=>i.bindTexture(e,t(n,o),r?.(n,o)))}}},63761(e,t,r){r.d(t,{N:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",1,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},31821(e,t,r){r.d(t,{H:()=>i,If:()=>n});const 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}i.int=e=>e.toFixed(),i.uint=e=>`${Math.max(0,e).toFixed()}u`,i.hexuint=e=>`0x${Math.round(Math.max(0,e)).toString(16)}u`,i.float=e=>e.toPrecision(8)},13840(e,t,r){r.d(t,{r:()=>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}}},42958(e,t,r){r.d(t,{w:()=>p});var i=r(32198),n=r(56372),o=r(91429),a=r(53966),s=r(63907),l=r(90644),c=r(85079),u=r(74038);new u._("position",3,s.pe.FLOAT,0,12);const d=[new u._("position",2,s.pe.FLOAT,0,8)];(0,c.Xk)(d),new u._("position",2,s.pe.FLOAT,0,12),new u._("uv0",2,s.pe.HALF_FLOAT,8,12),r(44208);var h=r(94656),f=r(26857);class m{constructor(e,t,r){this._context=e,this.locations=r,this._textures=new Map,this.source=(0,h.en)()?t:null,t.attributeNames.forEach(e=>{r.has(e)||a.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${e} used in shader`)}),this._glProgram=e.programCache.get(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}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)}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)}setUniformMatrices4fv(e,t,r){this._glProgram.setUniformMatrices4fv(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,t){if(f.b.ENABLE_OPTIMIZATIONS)return;let r=e.locations;if(t){let e=new Map(r);t.forEach((t,i)=>e.set(i,r.size+t)),r=e}this.locations.forEach((e,t)=>{r.get(t)!==e&&console.error(`VertexAttributeLocations are incompatible: Program has ${t} at position ${e}, VAO has it at position ${r.get(t)}.`)})}stop(){this._textures.clear()}bindTexture(e,t,r){if(!t?.glName){let r=`Texture sampler ${e} in ${this._context.debugBoundTechnique} has no given Texture in ${Error().stack}`;(0,h.en)()&&console.error(r),t=this._context.emptyTexture}let i=this._ensureTextureUnit(e,t);this._context.useProgram(this);let n=i.unit;this.setUniform1i(e,n),this._context.bindTexture(t,n,!1,r)}_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}}let p=class extends n.A{constructor(e,t,r){super(),this._context=e,this._configuration=t,this.primitiveType=s.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=t.key,this.locations=(0,c.Xk)(r??d),this._pipeline=this.initializePipeline(t),this.reload=async r=>{if(r&&await this.shader.reload(),!this.key.equals(t.key))return void a.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);let i=this.shader.get().build(t);i.debugName=this.declaredClass,this._program=new m(e.rctx,i,this.locations),this._pipeline=this.initializePipeline(t)}}initialize(){let e=this.shader.get().build(this._configuration);e.debugName=this.declaredClass,this._program=new m(this._context.rctx,e,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t,r){return this._pipeline}initializePipeline(e){return(0,l.Ey)({blending:l.RC,colorWrite:l.kn})}};p=(0,i.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],p)},51976(e,t,r){r.d(t,{K:()=>s,W:()=>l});var i=r(49186),n=r(65786),o=r(4576);class a{constructor(e){this._bits=[...e]}equals(e){return(0,o.aI)(this._bits,e.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}class s extends n.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new a(this._parameterBits),this._key}decode(e=this.key){let t=this._parameterBits;this._parameterBits=[...e.bits];let 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);let n=e.count||2,o=Math.ceil(Math.log2(n)),a=t._parameterBits,s=0;for(;a[s]+o>16;)s++,s>=a.length&&a.push(0);let 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){let n=this._parameterBits[s];if((n&c)>>l!==t){if(this._key=null,this._parameterBits[s]=n&~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){let t=this._parameterBits[s];if(!!((t&c)>>l)!==e&&(this._key=null,this._parameterBits[s]=t&~c|+e<<l,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configurationx",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},16943(e,t,r){r.d(t,{E:()=>n});var i=r(44208);function n(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},24111(e,t,r){r.d(t,{Y:()=>s});var i=r(65261),n=r(23292),o=r(33094),a=r(31821);function s(e,t){t.snowCover?(e.include(i.C),e.uniforms.add(new o.U("snowCover",e=>e.snowCover)).code.add(a.H`float applySnow(vec3 normal, vec3 groundNormal, inout vec3 albedo, inout float ssao) {
1084
+ }`)}},20693(e,t,r){r.d(t,{yu:()=>f,NB:()=>m});var i=r(58083),n=r(9093),o=r(35522),a=r(51850),s=r(23205),l=r(40710),c=r(58029),u=r(74333);class d extends u.n{constructor(e,t,r){super(e,"mat4",2,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}var h=r(45324);function f(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new l.W("cameraPosition",({origin:e},{camera:t})=>(0,o.hZ)(g,t.viewInverseTransposeMatrix[3]-e[0],t.viewInverseTransposeMatrix[7]-e[1],t.viewInverseTransposeMatrix[11]-e[2])))}function m(e,t){(function(e,t){e.uniforms.add(h.rS,t.instancedDoublePrecision?new c.F("view",e=>(0,i.Tl)(v,e.camera.viewMatrix,p(e))):new d("view",(e,t)=>(0,i.Tl)(v,t.camera.viewMatrix,e.origin)))})(e,t),e.uniforms.add(t.instancedDoublePrecision?new s.d("localOrigin",e=>p(e)):new l.W("localOrigin",e=>e.origin))}function p({camera:e}){return(0,o.hZ)(g,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11])}const v=(0,n.vt)(),g=(0,a.vt)()},45324(e,t,r){var i=r(37585),n=r(48163),o=r(35522),a=r(51850),s=r(77108),l=r(23205),c=r(14314),u=r(33094),d=r(58029);new d.F("view",({camera:e})=>e.viewMatrix),new d.F("inverseViewMatrix",({camera:e})=>e.inverseViewMatrix);const h=new d.F("proj",({camera:e})=>e.projectionMatrix),f=(new d.F("inverseProjectionMatrix",({camera:e})=>e.inverseProjectionMatrix),new l.d("cameraPosition",({camera:e})=>e.eye),new d.F("viewNormal",({camera:e})=>e.viewInverseTransposeMatrix)),m=(new l.d("localUpView",({camera:e})=>{let t=e.viewInverseTransposeMatrix;return(0,o.S8)(v,(0,o.hZ)(v,t[8],t[9],t[10]))}),new s.E("nearFar",({camera:e})=>e.nearFar)),p=(new c.I("viewport",({camera:e})=>e.fullViewport),new u.U("pixelRatio",e=>e.camera.pixelRatio/e.overlayStretch),new u.U("screenPixelSizePerDistance",({camera:e})=>e.screenPixelSizePerDistance),new u.U("worldToScreenPerDistanceRatio",({viewCamera:e})=>1/e.screenPixelSizePerDistance),new u.U("renderPixelSizePerDistance",({camera:e})=>e.renderPixelSizePerDistance),new u.U("metersPerRenderUnit",e=>e.metersPerRenderUnit),new s.E("inverseScreenSize",({camera:e})=>(0,i.hZ)(p,1/e.fullWidth,1/e.fullHeight)),new s.E("pixelToNDC",({camera:e})=>(0,i.hZ)(p,2/e.fullViewport[2],2/e.fullViewport[3])),(0,n.vt)()),v=(0,a.vt)();r.d(t,["HO",0,f,"Y$",0,m,"rS",0,h])},77108(e,t,r){r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",0,(i,n)=>i.setUniform2fv(e,t(n),r))}}},68259(e,t,r){r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,n,o,a)=>i.setUniform2fv(e,t(n,o,a),r))}}},47286(e,t,r){r.d(t,{G:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,n,o)=>i.setUniform2fv(e,t(n,o),r))}}},23205(e,t,r){r.d(t,{d:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",0,(i,n)=>i.setUniform3fv(e,t(n),r))}}},40710(e,t,r){r.d(t,{W:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",2,(i,n,o,a)=>i.setUniform3fv(e,t(n,o,a),r))}}},33079(e,t,r){r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",1,(i,n,o)=>i.setUniform3fv(e,t(n,o),r))}}},14314(e,t,r){r.d(t,{I:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,n)=>i.setUniform4fv(e,t(n),r))}}},71988(e,t,r){r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",1,(i,n,o)=>i.setUniform4fv(e,t(n,o),r))}}},33094(e,t,r){r.d(t,{U:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",0,(i,n)=>i.setUniform1f(e,t(n),r))}}},28421(e,t,r){r.d(t,{J:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",2,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},20304(e,t,r){r.d(t,{m:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",1,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},35818(e,t,r){r.d(t,{W:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"int",0,(r,i)=>r.setUniform1i(e,t(i)))}}},98353(e,t,r){r.d(t,{h:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat3",2,(i,n,o)=>i.setUniformMatrix3fv(e,t(n,o),r))}}},35644(e,t,r){r.d(t,{k:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat3",1,(i,n,o)=>i.setUniformMatrix3fv(e,t(n,o),r))}}},58029(e,t,r){r.d(t,{F:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat4",0,(i,n)=>i.setUniformMatrix4fv(e,t(n),r))}}},12791(e,t,r){r.d(t,{x:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},15976(e,t,r){r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"sampler2D",2,(i,n,o)=>i.bindTexture(e,t(n,o),r?.(n,o)))}}},63761(e,t,r){r.d(t,{N:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",1,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},31821(e,t,r){r.d(t,{H:()=>i,If:()=>n});const 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}i.int=e=>e.toFixed(),i.uint=e=>`${Math.max(0,e).toFixed()}u`,i.hexuint=e=>`0x${Math.round(Math.max(0,e)).toString(16)}u`,i.float=e=>e.toPrecision(8)},13840(e,t,r){r.d(t,{r:()=>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}}},42958(e,t,r){r.d(t,{w:()=>p});var i=r(32198),n=r(56372),o=r(91429),a=r(53966),s=r(63907),l=r(90644),c=r(85079),u=r(74038);new u._("position",3,s.pe.FLOAT,0,12);const d=[new u._("position",2,s.pe.FLOAT,0,8)];(0,c.Xk)(d),new u._("position",2,s.pe.FLOAT,0,12),new u._("uv0",2,s.pe.HALF_FLOAT,8,12),r(44208);var h=r(94656),f=r(26857);class m{constructor(e,t,r){this._context=e,this.locations=r,this._textures=new Map,this.source=(0,h.en)()?t:null,t.attributeNames.forEach(e=>{r.has(e)||a.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${e} used in shader`)}),this._glProgram=e.programCache.get(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}hasUniform(e){return this._glProgram.hasUniform(e)}setUniform1b(e,t){this._glProgram.setUniform1i(e,+!!t)}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)}setUniformMatrices4fv(e,t,r){this._glProgram.setUniformMatrices4fv(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,t){if(f.b.ENABLE_OPTIMIZATIONS)return;let r=e.locations;if(t){let e=new Map(r);t.forEach((t,i)=>e.set(i,r.size+t)),r=e}this.locations.forEach((e,t)=>{r.get(t)!==e&&console.error(`VertexAttributeLocations are incompatible: Program has ${t} at position ${e}, VAO has it at position ${r.get(t)}.`)})}stop(){this._textures.clear()}bindTexture(e,t,r){if(!t?.glName){let r=`Texture sampler ${e} in ${this._context.debugBoundTechnique} has no given Texture in ${Error().stack}`;(0,h.en)()&&console.error(r),t=this._context.emptyTexture}let i=this._ensureTextureUnit(e,t);this._context.useProgram(this);let n=i.unit;this.setUniform1i(e,n),this._context.bindTexture(t,n,!1,r)}_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}}let p=class extends n.A{constructor(e,t,r){super(),this._context=e,this._configuration=t,this.primitiveType=s.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=t.key,this.locations=(0,c.Xk)(r??d),this._pipeline=this.initializePipeline(t),this.reload=async r=>{if(r&&await this.shader.reload(),!this.key.equals(t.key))return void a.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);let i=this.shader.get().build(t);i.debugName=this.declaredClass,this._program=new m(e.rctx,i,this.locations),this._pipeline=this.initializePipeline(t)}}initialize(){let e=this.shader.get().build(this._configuration);e.debugName=this.declaredClass,this._program=new m(this._context.rctx,e,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t,r){return this._pipeline}initializePipeline(e){return(0,l.Ey)({blending:l.RC,colorWrite:l.kn})}};p=(0,i.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],p)},51976(e,t,r){r.d(t,{K:()=>s,W:()=>l});var i=r(49186),n=r(65786),o=r(4576);class a{constructor(e){this._bits=[...e]}equals(e){return(0,o.aI)(this._bits,e.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}class s extends n.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new a(this._parameterBits),this._key}decode(e=this.key){let t=this._parameterBits;this._parameterBits=[...e.bits];let 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);let n=e.count||2,o=Math.ceil(Math.log2(n)),a=t._parameterBits,s=0;for(;a[s]+o>16;)s++,s>=a.length&&a.push(0);let 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){let n=this._parameterBits[s];if((n&c)>>l!==t){if(this._key=null,this._parameterBits[s]=n&~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){let t=this._parameterBits[s];if(!!((t&c)>>l)!==e&&(this._key=null,this._parameterBits[s]=t&~c|+e<<l,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configurationx",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},16943(e,t,r){r.d(t,{E:()=>n});var i=r(44208);function n(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},24111(e,t,r){r.d(t,{Y:()=>s});var i=r(65261),n=r(23292),o=r(33094),a=r(31821);function s(e,t){t.snowCover?(e.include(i.C),e.uniforms.add(new o.U("snowCover",e=>e.snowCover)).code.add(a.H`float applySnow(vec3 normal, vec3 groundNormal, inout vec3 albedo, inout float ssao) {
1086
1085
  float snow = smoothstep(0.5, 0.55, dot(normal, groundNormal)) * snowCover;
1087
1086
  albedo = delinearizeGamma(mix(linearizeGamma(albedo), vec3(1), snow));
1088
1087
  ssao = mix(ssao, 0.5 + 0.5 * ssao, snow);
@@ -1118,4 +1117,4 @@ return 0.0;
1118
1117
  calculateOcclusionAndOutputHighlight();
1119
1118
  ${(0,l.If)(x,"outputObjectAndLayerIdColor();")}
1120
1119
  }
1121
- `)}},26934(e,t,r){r.d(t,{Q:()=>n});var i=r(49788);function n(e){e.constants.add("alphaCutoff","float",i.Q),e.constants.add("opacityCutoff","float",i.v)}},72458(e,t,r){r.d(t,{Or:()=>a});var i=r(32198),n=r(51976);class o extends n.K{constructor(){super(...arguments),this.useFloatBlend=!0}}function a(e,t){t.useFloatBlend?(e.constants.add("floatBlendOutputScale","float",1),e.constants.add("floatBlendInputScale","float",1)):(e.constants.add("floatBlendOutputScale","float",1/16),e.constants.add("floatBlendInputScale","float",16)),e.constants.add("maxEmissiveStrength","float",16)}(0,i.Cg)([(0,n.W)()],o.prototype,"useFloatBlend",void 0)},48852(e,t,r){r.d(t,{g:()=>f});var i=r(4576),n=r(44208),o=r(53966),a=r(17676),s=r(78659),l=r(34275),c=r(94656),u=r(63907);const d=()=>o.A.getLogger("esri.views.webgl.BufferObject"),h=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class f{static createIndex(e,t,r){return new f(e,34963,t,r)}static createUniform(e,t,r){return new f(e,35345,t,r)}static createPixelPack(e,t=35041,r){let i=new f(e,35051,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=35040,r){return new f(e,35052,t,r)}static createTransformFeedback(e,t=35044,r){let i=new f(e,35982,t);return i.setSize(r),i}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,e.instanceCounter.increment(u.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,c.Y2)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case u.pe.UNSIGNED_INT:return this._sizeBytes/4;case u.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case u.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return h?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&=(this._context.gl.deleteBuffer(this._glName),null),this._context.instanceCounter.decrement(u.vt.BufferObject,this),this._context=null):this._glName&&d().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(34963===this.bufferType&&null!=t)switch(this._indexType=t,t){case u.pe.UNSIGNED_SHORT:e*=2;break;case u.pe.UNSIGNED_INT:e*=4;case u.pe.UNSIGNED_BYTE:}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;34963===this.bufferType&&((0,l.mg)(e)?this._indexType=u.pe.UNSIGNED_BYTE:(0,l.jq)(e)?this._indexType=u.pe.UNSIGNED_SHORT:(0,l.XJ)(e)&&(this._indexType=u.pe.UNSIGNED_INT)),this._setBufferData(t,e)}setIndexType(e){34963===this.bufferType&&(this._indexType=e)}_setBufferData(e,t=null){this._sizeBytes=e;let r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);let i=this._context.gl;null==t?i.bufferData(this.bufferType,e,this.usage):i.bufferData(this.bufferType,t,this.usage),(0,c.Y2)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;let n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);let{gl:o}=this._context;o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r),(0,c.Y2)(o),this._isVAOAware&&this._context.bindVAO(n)}getSubData(e,t=0,r,n){if(r<0||n<0)return;let o=function(e){return(0,i.Xj)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(n??0))>e.byteLength)return;t+o*(n??0)>this.usedMemory&&d().warn("Potential problem getting subdata: requested data exceeds buffer size!");let a=this._context.gl,s=35982===this.bufferType?35982:36662;this._context.bindBuffer(this,s);try{a.getBufferSubData(s,t,e,r,n)}finally{this._context.unbindBuffer(s)}}async getSubDataAsync(e,t=0,r,i,n){if(await this._context.clientWaitAsync((0,s.l5)(10),n),!this._context||!this._glName)throw(0,a.NK)();this.getSubData(e,t,r,i)}}},65786(e,t,r){const i=class{};new i,r.d(t,["Y",0,i])},14113(e,t,r){r.d(t,{N5:()=>s});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{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 s extends a{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new f,this.varyings=new m,this.outputs=new p}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){let r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s=n.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?x:g,u=n.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${u.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${d.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{let r=e.bind[0];r&&t.set(e.name,r)});let r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{let r=e.bind[1];r&&t.set(e.name,r)});let r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,n,t)}}generateBindDraw(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{let r=e.bind[2];r&&t.set(e.name,r)});let 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 l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(let t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null==e)o().error(`Trying to add null Uniform from ${Error().stack}.`);else{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)}}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null==t?`uniform ${r} ${e};`:`uniform ${r} ${e}[${t}];`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(){this._entries=new Map}add(e,t){if(this._entries.has(e))throw new i.A("shaderbuilder:duplicate-input",`Duplicate input for ${e}`);this._entries.set(e,t)}get(e){let t=this._entries.get(e);if(null==t)throw new i.A("shaderbuilder:input-resolver-error",`No resolver for input ${e} found.`);return t()}}class u{constructor(e){this._stage=e,this._bodies=[]}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0){let e=[];for(let t of this._bodies)"string"==typeof t?e.push(t):e.push(...t());return[`void main() {\n ${e.join("\n")||""} \n}`]}if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=[]}add(e){return this._entries.push(e),this._stage}generateSource(){let e=[];for(let t of this._entries)"string"==typeof t?e.push(t):e.push(...t());return e}}class h extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new u(this),this.code=new d(this),this.constants=new v(this),this.inputs=new c}get builder(){return this}}class f{constructor(){this._entries=[]}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,flat:r?.flat??!1,invariant:r?.invariant??!1})}generateSource(e){let t=[];return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+(r.flat?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){let i=this._entries.get(r);i?.name===e&&i?.type===t?o().warn(`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}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:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});let t=[];return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class v{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=v._numberToFloatStr(r);break;case"int":i=v._numberToIntStr(r);break;case"uint":i=v._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])}, ${v._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${v._numberToUintStr(r[0])}, ${v._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${v._numberToUintStr(r[0])}, ${v._numberToUintStr(r[1])}, ${v._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${v._numberToUintStr(r[0])}, ${v._numberToUintStr(r[1])}, ${v._numberToUintStr(r[2])}, ${v._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>v._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp 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",x="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},74333(e,t,r){r.d(t,{n:()=>i});class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},66289(e,t,r){r.d(t,{R:()=>n});var i=r(48852);class n extends i.g{constructor(e,t,r,i=35044){super(e,34962,i,r),this.layout=t}}},90644(e,t,r){function i(e,t,r=32774,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 n(e,t,r,i,n=32774,o=32774,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}r.d(t,{Ey:()=>M,RC:()=>a,T8:()=>s,Uy:()=>f,Xt:()=>d,iD:()=>o,kn:()=>m,nk:()=>h,p3:()=>n}),r(4718);const o=i(0,771),a=(i(1,0),i(1,1),i(1,771)),s=(i(773,1),n(770,1,771,771)),l=n(0,0,768,0),c={face:1029,mode:2305},u={face:1028,mode:2305},d=e=>2===e?c:1===e?u:null;function h(e,t,r){return{ref:e,readMask:t,stencilFront:r,stencilBack:r}}const f={zNear:0,zFar:1},m={r:!0,g:!0,b:!0,a:!0};function p(e){return C.intern(e)}function v(e){return E.intern(e)}function g(e){return O.intern(e)}function x(e){return D.intern(e)}function _(e){return F.intern(e)}function b(e){return B.intern(e)}function y(e){return L.intern(e)}function w(e){return V.intern(e)}function M(e){return j.intern(e)}class T{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;let t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function S(e){return"["+e.join(",")+"]"}const C=new T(A,e=>({__tag:"Blending",...e}));function A(e){return e?S([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 E=new T(I,e=>({__tag:"Culling",...e}));function I(e){return e?S([e.face,e.mode]):null}const O=new T(P,e=>({__tag:"PolygonOffset",...e}));function P(e){return e?S([e.factor,e.units]):null}const D=new T(R,e=>({__tag:"DepthTest",...e}));function R(e){return e?S([e.func]):null}const F=new T(N,e=>({__tag:"StencilTest",...e}));function N(e){return e?S([e.ref,e.readMask,e.stencilFront.compare,e.stencilFront.fail,e.stencilFront.zFail,e.stencilFront.zPass,e.stencilBack.compare,e.stencilBack.fail,e.stencilBack.zFail,e.stencilBack.zPass]):null}const B=new T(z,e=>({__tag:"DepthWrite",...e}));function z(e){return e?S([e.zNear,e.zFar]):null}const L=new T(H,e=>({__tag:"ColorWrite",...e}));function H(e){return e?S([e.r,e.g,e.b,e.a]):null}const V=new T(U,e=>({__tag:"StencilWrite",...e}));function U(e){return e?S([e.mask]):null}const j=new T(function(e){return e?S([A(e.blending),I(e.culling),P(e.polygonOffset),R(e.depthTest),N(e.stencilTest),z(e.depthWrite),H(e.colorWrite),U(e.stencilWrite)]):null},e=>({blending:p(e.blending),culling:v(e.culling),polygonOffset:g(e.polygonOffset),depthTest:x(e.depthTest),stencilTest:_(e.stencilTest),depthWrite:b(e.depthWrite),colorWrite:y(e.colorWrite),stencilWrite:w(e.stencilWrite)}));r.d(t,["uR",0,l])}}]);
1120
+ `)}},26934(e,t,r){r.d(t,{Q:()=>n});var i=r(49788);function n(e){e.constants.add("alphaCutoff","float",i.Q),e.constants.add("opacityCutoff","float",i.v)}},72458(e,t,r){r.d(t,{Or:()=>a});var i=r(32198),n=r(51976);class o extends n.K{constructor(){super(...arguments),this.useFloatBlend=!0}}function a(e,t){t.useFloatBlend?(e.constants.add("floatBlendOutputScale","float",1),e.constants.add("floatBlendInputScale","float",1)):(e.constants.add("floatBlendOutputScale","float",1/16),e.constants.add("floatBlendInputScale","float",16)),e.constants.add("maxEmissiveStrength","float",16)}(0,i.Cg)([(0,n.W)()],o.prototype,"useFloatBlend",void 0)},48852(e,t,r){r.d(t,{g:()=>f});var i=r(4576),n=r(44208),o=r(53966),a=r(17676),s=r(78659),l=r(34275),c=r(94656),u=r(63907);const d=()=>o.A.getLogger("esri.views.webgl.BufferObject"),h=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class f{static createIndex(e,t,r){return new f(e,34963,t,r)}static createUniform(e,t,r){return new f(e,35345,t,r)}static createPixelPack(e,t=35041,r){let i=new f(e,35051,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=35040,r){return new f(e,35052,t,r)}static createTransformFeedback(e,t=35044,r){let i=new f(e,35982,t);return i.setSize(r),i}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,e.instanceCounter.increment(u.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,c.Y2)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case u.pe.UNSIGNED_INT:return this._sizeBytes/4;case u.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case u.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return h?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&=(this._context.gl.deleteBuffer(this._glName),null),this._context.instanceCounter.decrement(u.vt.BufferObject,this),this._context=null):this._glName&&d().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(34963===this.bufferType&&null!=t)switch(this._indexType=t,t){case u.pe.UNSIGNED_SHORT:e*=2;break;case u.pe.UNSIGNED_INT:e*=4;case u.pe.UNSIGNED_BYTE:}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;34963===this.bufferType&&((0,l.mg)(e)?this._indexType=u.pe.UNSIGNED_BYTE:(0,l.jq)(e)?this._indexType=u.pe.UNSIGNED_SHORT:(0,l.XJ)(e)&&(this._indexType=u.pe.UNSIGNED_INT)),this._setBufferData(t,e)}setIndexType(e){34963===this.bufferType&&(this._indexType=e)}_setBufferData(e,t=null){this._sizeBytes=e;let r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);let i=this._context.gl;null==t?i.bufferData(this.bufferType,e,this.usage):i.bufferData(this.bufferType,t,this.usage),(0,c.Y2)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;let n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);let{gl:o}=this._context;o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r),(0,c.Y2)(o),this._isVAOAware&&this._context.bindVAO(n)}getSubData(e,t=0,r,n){if(r<0||n<0)return;let o=function(e){return(0,i.Xj)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(n??0))>e.byteLength)return;t+o*(n??0)>this.usedMemory&&d().warn("Potential problem getting subdata: requested data exceeds buffer size!");let a=this._context.gl,s=35982===this.bufferType?35982:36662;this._context.bindBuffer(this,s);try{a.getBufferSubData(s,t,e,r,n)}finally{this._context.unbindBuffer(s)}}async getSubDataAsync(e,t=0,r,i,n){if(await this._context.clientWaitAsync((0,s.l5)(10),n),!this._context||!this._glName)throw(0,a.NK)();this.getSubData(e,t,r,i)}}},65786(e,t,r){const i=class{};new i,r.d(t,["Y",0,i])},14113(e,t,r){r.d(t,{N5:()=>l});var i=r(4576),n=r(49186),o=(r(44208),r(53966));const a=()=>o.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 f,this.fragment=new f,this.attributes=new m,this.varyings=new p,this.outputs=new v}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){let r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s=n.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?_:x,u=n.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${u.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${d.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{let r=e.bind[0];r&&t.set(e.name,r)});let r=Array.from(t.keys()),n=Array.from(t.values()),o=n.length;return t=>{r&&=((0,i.$i)(n,(t,i)=>e.hasUniform(r[i])),o=n.length,null);for(let r=0;r<o;++r)n[r](e,t)}}generateBindPass(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{let r=e.bind[1];r&&t.set(e.name,r)});let r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,n,t)}}generateBindDraw(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{let r=e.bind[2];r&&t.set(e.name,r)});let 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(let t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null==e)a().error(`Trying to add null Uniform from ${Error().stack}.`);else{if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new n.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null==t?`uniform ${r} ${e};`:`uniform ${r} ${e}[${t}];`)}get entries(){return Array.from(this._entries.values())}}class u{constructor(){this._entries=new Map}add(e,t){if(this._entries.has(e))throw new n.A("shaderbuilder:duplicate-input",`Duplicate input for ${e}`);this._entries.set(e,t)}get(e){let t=this._entries.get(e);if(null==t)throw new n.A("shaderbuilder:input-resolver-error",`No resolver for input ${e} found.`);return t()}}class d{constructor(e){this._stage=e,this._bodies=[]}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0){let e=[];for(let t of this._bodies)"string"==typeof t?e.push(t):e.push(...t());return[`void main() {\n ${e.join("\n")||""} \n}`]}if(e)throw new n.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class h{constructor(e){this._stage=e,this._entries=[]}add(e){return this._entries.push(e),this._stage}generateSource(){let e=[];for(let t of this._entries)"string"==typeof t?e.push(t):e.push(...t());return e}}class f extends s{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new d(this),this.code=new h(this),this.constants=new g(this),this.inputs=new u}get builder(){return this}}class m{constructor(){this._entries=[]}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}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,flat:r?.flat??!1,invariant:r?.invariant??!1})}generateSource(e){let t=[];return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+(r.flat?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class v{constructor(){this._entries=new Map}add(e,t,r=0){let i=this._entries.get(r);i?.name===e&&i?.type===t?a().warn(`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}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});let t=[];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"uint":i=g._numberToUintStr(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._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${g._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])}, ${g._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${g._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])}, ${g._numberToUintStr(r[2])}, ${g._numberToUintStr(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 _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const x="#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",_="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},74333(e,t,r){r.d(t,{n:()=>i});class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},66289(e,t,r){r.d(t,{R:()=>n});var i=r(48852);class n extends i.g{constructor(e,t,r,i=35044){super(e,34962,i,r),this.layout=t}}},90644(e,t,r){function i(e,t,r=32774,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 n(e,t,r,i,n=32774,o=32774,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}r.d(t,{Ey:()=>M,RC:()=>a,T8:()=>s,Uy:()=>f,Xt:()=>d,iD:()=>o,kn:()=>m,nk:()=>h,p3:()=>n}),r(4718);const o=i(0,771),a=(i(1,0),i(1,1),i(1,771)),s=(i(773,1),n(770,1,771,771)),l=n(0,0,768,0),c={face:1029,mode:2305},u={face:1028,mode:2305},d=e=>2===e?c:1===e?u:null;function h(e,t,r){return{ref:e,readMask:t,stencilFront:r,stencilBack:r}}const f={zNear:0,zFar:1},m={r:!0,g:!0,b:!0,a:!0};function p(e){return C.intern(e)}function v(e){return E.intern(e)}function g(e){return O.intern(e)}function x(e){return D.intern(e)}function _(e){return F.intern(e)}function b(e){return N.intern(e)}function y(e){return L.intern(e)}function w(e){return V.intern(e)}function M(e){return j.intern(e)}class T{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;let t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function S(e){return"["+e.join(",")+"]"}const C=new T(A,e=>({__tag:"Blending",...e}));function A(e){return e?S([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 E=new T(I,e=>({__tag:"Culling",...e}));function I(e){return e?S([e.face,e.mode]):null}const O=new T(P,e=>({__tag:"PolygonOffset",...e}));function P(e){return e?S([e.factor,e.units]):null}const D=new T(R,e=>({__tag:"DepthTest",...e}));function R(e){return e?S([e.func]):null}const F=new T(B,e=>({__tag:"StencilTest",...e}));function B(e){return e?S([e.ref,e.readMask,e.stencilFront.compare,e.stencilFront.fail,e.stencilFront.zFail,e.stencilFront.zPass,e.stencilBack.compare,e.stencilBack.fail,e.stencilBack.zFail,e.stencilBack.zPass]):null}const N=new T(z,e=>({__tag:"DepthWrite",...e}));function z(e){return e?S([e.zNear,e.zFar]):null}const L=new T(H,e=>({__tag:"ColorWrite",...e}));function H(e){return e?S([e.r,e.g,e.b,e.a]):null}const V=new T(U,e=>({__tag:"StencilWrite",...e}));function U(e){return e?S([e.mask]):null}const j=new T(function(e){return e?S([A(e.blending),I(e.culling),P(e.polygonOffset),R(e.depthTest),B(e.stencilTest),z(e.depthWrite),H(e.colorWrite),U(e.stencilWrite)]):null},e=>({blending:p(e.blending),culling:v(e.culling),polygonOffset:g(e.polygonOffset),depthTest:x(e.depthTest),stencilTest:_(e.stencilTest),depthWrite:b(e.depthWrite),colorWrite:y(e.colorWrite),stencilWrite:w(e.stencilWrite)}));r.d(t,["uR",0,l])}}]);