@arcgis/core 4.34.0-next.15 → 4.34.0-next.16

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 (180) hide show
  1. package/applications/Components/sanitizerUtils.d.ts +3 -0
  2. package/applications/Components/sanitizerUtils.js +5 -0
  3. package/applications/MapViewer/layerUtils.d.ts +3 -0
  4. package/applications/MapViewer/layerUtils.js +5 -0
  5. package/applications/SceneViewer/layerUtils.d.ts +2 -2
  6. package/arcade.js +1 -1
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/{a08ce98672ab94d19613.js → 04e558a970c6a77f243e.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0d99579d8cdeddc0fc9c.js +1 -0
  10. package/assets/esri/core/workers/chunks/1443520c9fb23381f8d5.js +1 -0
  11. package/assets/esri/core/workers/chunks/1a7570bd2b79194ff94b.js +42 -0
  12. package/assets/esri/core/workers/chunks/{0ed4ec00ef16aa58a33d.js → 254c4f7e277ae9915dce.js} +1 -1
  13. package/assets/esri/core/workers/chunks/2990145d7ac3af0d68be.js +1 -0
  14. package/assets/esri/core/workers/chunks/2d51d0a24cdc89bafa1c.js +1 -0
  15. package/assets/esri/core/workers/chunks/2d89e354eeadadca4f7f.js +1 -0
  16. package/assets/esri/core/workers/chunks/3f8cc157b65a9d570921.js +1 -0
  17. package/assets/esri/core/workers/chunks/{2254989ca3ff3960f2fe.js → 400a4c9fa62964f8fa1d.js} +1 -1
  18. package/assets/esri/core/workers/chunks/445ddf57d2f503a0b98b.js +1 -0
  19. package/assets/esri/core/workers/chunks/513dc2467e9b8b8c6df4.js +1 -0
  20. package/assets/esri/core/workers/chunks/52239e958a82ebcd2e7a.js +1 -0
  21. package/assets/esri/core/workers/chunks/{e980a81c4d1e05f07141.js → 53e43798d08ad2075c1f.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{8b93cd4132934b0d7d39.js → 54814a269d44855f0673.js} +1 -1
  23. package/assets/esri/core/workers/chunks/55ce214a10fb6fc2e901.js +1 -0
  24. package/assets/esri/core/workers/chunks/66c8816e91e3f9e214d4.js +346 -0
  25. package/assets/esri/core/workers/chunks/7c56740cac444419e5b4.js +1 -0
  26. package/assets/esri/core/workers/chunks/{7f14d6cb754c7e94748c.js → 827919fe23e06e40a330.js} +139 -115
  27. package/assets/esri/core/workers/chunks/87986f31061c426e761b.js +1 -0
  28. package/assets/esri/core/workers/chunks/{7ae88c141a5d85e5bb88.js → 87a743df7d8556d5e253.js} +1 -1
  29. package/assets/esri/core/workers/chunks/8855f1a6224ffbd0bb66.js +1 -0
  30. package/assets/esri/core/workers/chunks/885e8e90dfe5dbd5053d.js +1 -0
  31. package/assets/esri/core/workers/chunks/93e66d9c49eaeb503bff.js +1 -0
  32. package/assets/esri/core/workers/chunks/9959a91c8de6fef499c2.js +1 -0
  33. package/assets/esri/core/workers/chunks/c1a72e1dbd1ba7b41965.js +1 -0
  34. package/assets/esri/core/workers/chunks/c4065934637b820cad5b.js +1 -0
  35. package/assets/esri/core/workers/chunks/cc1328cacc4ac07eb548.js +1 -0
  36. package/assets/esri/core/workers/chunks/{05f2133f05f86266d8c7.js → d2139307f62ea8bf999a.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{3f58da371633967a61ca.js → ddb66fe6fcd0764daa7a.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{70e5848aa372475fc8fa.js → eac7af86166c09c6a9be.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{7317346ed8d7c5bb859d.js → f537a02dc2fc9e6435a2.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{7e1906d35a764f7f10b0.js → fe1129f03476825a7344.js} +1 -1
  41. package/chunks/DefaultMaterial.glsl.js +30 -28
  42. package/chunks/RealisticTree.glsl.js +25 -22
  43. package/chunks/aiServices.js +1 -1
  44. package/config.js +1 -1
  45. package/core/LRUCache.js +1 -1
  46. package/core/MemCache.js +1 -1
  47. package/core/urlUtils.js +1 -1
  48. package/core/workers/RemoteClient.js +1 -1
  49. package/core/workers/WorkerHandle.js +1 -1
  50. package/interfaces.d.ts +51 -19
  51. package/kernel.js +1 -1
  52. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  53. package/layers/mixins/FeatureLayerBase.js +1 -1
  54. package/layers/support/arcgisLayers.js +1 -1
  55. package/layers/support/fetchService.js +1 -1
  56. package/layers/support/layerUtils.js +1 -1
  57. package/package.json +1 -1
  58. package/portal/support/layersLoader.js +1 -1
  59. package/portal/support/loadUtils.js +1 -1
  60. package/portal/support/portalLayers.js +1 -1
  61. package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
  62. package/rest/support/TranslateParameters.js +1 -1
  63. package/support/revision.js +1 -1
  64. package/symbols/WaterSymbol3DLayer.js +1 -1
  65. package/symbols/support/symbolUtils.js +1 -1
  66. package/symbols/support/utils.js +1 -1
  67. package/views/3d/layers/I3SMeshView3D.js +1 -1
  68. package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
  69. package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
  70. package/views/3d/layers/RouteLayerView3D.js +1 -1
  71. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  72. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  73. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  74. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  75. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  76. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  77. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  78. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  79. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  80. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  81. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  82. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  83. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  84. package/views/3d/layers/i3s/I3SLodHandling.js +1 -1
  85. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  86. package/views/3d/layers/support/makeScheduleFunction.js +1 -1
  87. package/views/3d/layers/support/symbolColorUtils.js +1 -1
  88. package/views/3d/state/controllers/FovController.js +1 -1
  89. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  90. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  91. package/views/3d/state/controllers/RotateController.js +1 -1
  92. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  93. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  94. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  95. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  96. package/views/3d/state/utils/navigationUtils.js +1 -1
  97. package/views/3d/support/StreamDataLoader.js +1 -1
  98. package/views/3d/terrain/OverlayRenderer.js +1 -1
  99. package/views/3d/terrain/TerrainRenderer.js +1 -1
  100. package/views/3d/terrain/TerrainSurface.js +1 -1
  101. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  102. package/views/3d/webgl-engine/collections/Component/RenderSubmitSystem.js +1 -1
  103. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  104. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstanceColor.glsl.js +11 -0
  105. package/views/3d/webgl-engine/core/shaderLibrary/attributes/MaskedColor.glsl.js +18 -0
  106. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +40 -26
  107. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +35 -24
  108. package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +12 -8
  109. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +3 -1
  110. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +26 -8
  111. package/views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js +1 -1
  112. package/views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js +1 -1
  113. package/views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js +1 -1
  114. package/views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js +1 -1
  115. package/views/3d/webgl-engine/core/shaderModules/Float3DrawUniform.js +1 -1
  116. package/views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js +1 -1
  117. package/views/3d/webgl-engine/core/shaderModules/Float4BindUniform.js +1 -1
  118. package/views/3d/webgl-engine/core/shaderModules/Float4DrawUniform.js +1 -1
  119. package/views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js +1 -1
  120. package/views/3d/webgl-engine/core/shaderModules/Float4sPassUniform.js +1 -1
  121. package/views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js +1 -1
  122. package/views/3d/webgl-engine/core/shaderModules/FloatDrawUniform.js +1 -1
  123. package/views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js +1 -1
  124. package/views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js +1 -1
  125. package/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform.js +1 -1
  126. package/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform.js +1 -1
  127. package/views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js +1 -1
  128. package/views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js +1 -1
  129. package/views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js +1 -1
  130. package/views/3d/webgl-engine/core/shaderModules/Matrix4sDrawUniform.js +1 -1
  131. package/views/3d/webgl-engine/core/shaderModules/Matrix4sPassUniform.js +1 -1
  132. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  133. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  134. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  135. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  136. package/views/3d/webgl-engine/lib/Program.js +1 -1
  137. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  138. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  139. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  140. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  141. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  142. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  143. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  144. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  145. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  146. package/views/webgl/Program.js +1 -1
  147. package/views/webgl/ShaderBuilder.js +1 -1
  148. package/webscene/Slide.js +1 -1
  149. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  150. package/widgets/BatchAttributeForm.js +1 -1
  151. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  152. package/widgets/FeatureTemplates.js +1 -1
  153. package/widgets/Search/SearchViewModel.js +1 -1
  154. package/widgets/Search/support/layerSearchUtils.js +1 -1
  155. package/widgets/support/ItemList.js +1 -1
  156. package/widgets/support/SelectionList/FeatureItem.js +1 -1
  157. package/widgets/support/SelectionList.js +1 -1
  158. package/widgets/support/dateUtils.js +1 -1
  159. package/widgets/support/symbolPreviewUtils.js +1 -1
  160. package/assets/esri/core/workers/chunks/0dbb350ce651bc236ec8.js +0 -1
  161. package/assets/esri/core/workers/chunks/0ff6f15d46d7ddf6fe4d.js +0 -1
  162. package/assets/esri/core/workers/chunks/1f559f1e7f0bc0f4bf20.js +0 -346
  163. package/assets/esri/core/workers/chunks/462cc6966d060be59c7c.js +0 -1
  164. package/assets/esri/core/workers/chunks/4a805e7a57d25c4b595f.js +0 -66
  165. package/assets/esri/core/workers/chunks/58f92100b1b2343111c6.js +0 -1
  166. package/assets/esri/core/workers/chunks/5dcc8fa321f0a7c49f36.js +0 -1
  167. package/assets/esri/core/workers/chunks/5e539ce4751bcfa57145.js +0 -1
  168. package/assets/esri/core/workers/chunks/6194636638b0439fccd8.js +0 -1
  169. package/assets/esri/core/workers/chunks/622c0552ca3cd674d46c.js +0 -1
  170. package/assets/esri/core/workers/chunks/64f5f27e7c5649d79cbc.js +0 -1
  171. package/assets/esri/core/workers/chunks/658e82c9b722852e02d0.js +0 -1
  172. package/assets/esri/core/workers/chunks/679d7baea233faf3fdbc.js +0 -1
  173. package/assets/esri/core/workers/chunks/7aef81778155be373d3e.js +0 -1
  174. package/assets/esri/core/workers/chunks/97b69fec3e87f11210ba.js +0 -1
  175. package/assets/esri/core/workers/chunks/a250a5c6e055e33bd25c.js +0 -1
  176. package/assets/esri/core/workers/chunks/b4273381dc069f4e1fa2.js +0 -1
  177. package/assets/esri/core/workers/chunks/b72137c63b7f2a525d9e.js +0 -1
  178. package/assets/esri/core/workers/chunks/c2264451d12f1fbaad22.js +0 -1
  179. package/assets/esri/core/workers/chunks/c6c86cbe65a58c3093ae.js +0 -1
  180. package/assets/esri/core/workers/chunks/fe3703ec198cbfebec30.js +0 -1
@@ -5,7 +5,7 @@ return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
5
5
  }
6
6
  vec4 snowCoverForEmissions(vec4 emission, float snow) {
7
7
  return mix(emission, vec4(0.0), snow);
8
- }`))}},11725:(e,t,r)=>{r.d(t,{im:()=>u,m$:()=>i});var i,o,n=r(24326),a=r(49255),s=r(39341),c=r(35256),l=r(43616),d=r(65786);class u{constructor(e,t){this.id=(0,n.c)(),this.supportsEdges=!1,this.vertexAttributeLocations=s.D,this._renderPriority=0,this._parameters=new t,(0,l.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,l.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:i.None}get hasEmissions(){return!1}getConfiguration(e,t,r=new c.E){return r.output=e,r.hasHighlightMixTexture=e===a.V.Highlight&&null!=t.highlightMixTexture,r}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque",d.Y},11964:(e,t,r)=>{r.d(t,{Cr:()=>l,H6:()=>h,_I:()=>u,kb:()=>d,vt:()=>c});var i=r(34727),o=r(4341),n=r(38954),a=r(51850),s=r(32114);function c(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function l(e,t,r=c()){return(0,n.c)(r.origin,e),(0,n.d)(r.vector,t,e),r}function d(e,t){const r=(0,n.d)(s.rq.get(),t,e.origin),o=(0,n.e)(e.vector,r),a=(0,n.e)(e.vector,e.vector),c=(0,i.qE)(o/a,0,1),l=(0,n.d)(s.rq.get(),(0,n.g)(s.rq.get(),e.vector,c),r);return(0,n.e)(l,l)}function u(e,t,r){return h(e,t,0,1,r)}function h(e,t,r,o,a){const{vector:c,origin:l}=e,d=(0,n.d)(s.rq.get(),t,l),u=(0,n.e)(c,d)/(0,n.k)(c);return(0,n.g)(a,c,(0,i.qE)(u,r,o)),(0,n.f)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)(),new o.I((()=>c()))},12541:(e,t,r)=>{r.d(t,{CR:()=>l,Eo:()=>g,FV:()=>f,Kv:()=>m,QE:()=>s,QJ:()=>d,Qp:()=>h,mq:()=>v,re:()=>p,tl:()=>u,tr:()=>c});var i=r(49186),o=r(53966),n=r(63907);const a=()=>o.A.getLogger("esri/views/webgl/textureUtils");function s(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&a().error("Negative dimension parameters are not allowed!");const{internalFormat:o}=e;if(o&&(l(o)||d(o))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:o}=e;o&&a().error("Depth textures cannot have mipmaps"),t?i!==n.Cj.LINEAR&&i!==n.Cj.NEAREST&&a().error("Depth textures cannot sample mipmaps"):(i!==n.Cj.NEAREST&&a().error("Depth textures without filtering must use NEAREST filtering"),r&&a().error("Depth textures without filtering cannot use compare function"))}}function c(e){return e in n.H0}function l(e){return e in n.SB}function d(e){return e in n.iE}function u(e){return null!=e&&e in n.CQ}function h(e){return null!=e&&"type"in e&&"compressed"===e.type}function m(e){return null!=e&&!h(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function p(e){return e===n.Ap.TEXTURE_3D||e===n.Ap.TEXTURE_2D_ARRAY}function f(e,t,r,i=1){let o=Math.max(t,r);return e===n.Ap.TEXTURE_3D&&(o=Math.max(o,i)),Math.floor(Math.log2(o))+1}function v(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case n.ld.FLOAT:switch(e.pixelFormat){case n.Ab.RGBA:return n.H0.RGBA32F;case n.Ab.RGB:return n.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case n.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case n.Ab.RGBA:return n.H0.RGBA8;case n.Ab.RGB:return n.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=t===n.j7.DEPTH_STENCIL?n.iE.DEPTH24_STENCIL8:t===n.j7.DEPTH_COMPONENT?n.SB.DEPTH_COMPONENT24:t,e.internalFormat}function g(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}},12791:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Bind,((r,i)=>r.bindTexture(e,t(i))))}}},13464:(e,t,r)=>{var i;r.d(t,{N:()=>i}),function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.OPAQUE_MATERIAL_WITHOUT_NORMALS=3]="OPAQUE_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_MATERIAL_WITHOUT_NORMALS=5]="TRANSPARENT_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_MATERIAL_WITHOUT_DEPTH=7]="TRANSPARENT_MATERIAL_WITHOUT_DEPTH",e[e.OCCLUDED_GROUND=8]="OCCLUDED_GROUND",e[e.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",e[e.HUD_MATERIAL=12]="HUD_MATERIAL",e[e.LABEL_MATERIAL=13]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=14]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=15]="LINE_CALLOUTS_HUD_DEPTH",e[e.OVERLAY=16]="OVERLAY",e[e.DRAPED_MATERIAL=17]="DRAPED_MATERIAL",e[e.DRAPED_WATER=18]="DRAPED_WATER",e[e.VOXEL=19]="VOXEL",e[e.MAX_SLOTS=20]="MAX_SLOTS"}(i||(i={}))},14113:(e,t,r)=>{r.d(t,{N5:()=>c});var i=r(49186),o=(r(44208),r(53966)),n=r(69270);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 c extends s{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new p,this.extensions=new f,this.outputs=new v}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!1){const r=this.extensions.generateSource(e),i=this.attributes.generateSource(e),o=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,a=n.uniforms.generateSource(),s=n.code.generateSource(),c=n.main.generateSource(t),l="vertex"===e?T:_,d=n.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${r.join("\n")}\n${l}\n${d.join("\n")}\n${a.join("\n")}\n${i.join("\n")}\n${o.join("\n")}\n${u.join("\n")}\n${s.join("\n")}\n${c.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Bind];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Bind];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return t=>{for(let o=0;o<i;++o)r[o](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,n,t,o)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else a().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class h extends s{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new d(this),this.code=new u(this),this.constants=new g(this)}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class p{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?a().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`))),t}}class f{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?f.ALLOWLIST_VERTEX:f.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}static{this.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"]}static{this.ALLOWLIST_VERTEX=[]}}class v{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):a().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:v.DEFAULT_NAME,type:v.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}class g{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=g._numberToFloatStr(r);break;case"int":i=g._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])}, ${g._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>g._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",T="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec4",i.c.Bind,((r,i)=>r.setUniform4fv(e,t(i))))}}},15581:(e,t,r)=>{r.d(t,{S:()=>T,b:()=>v,g:()=>g});var i=r(37585),o=r(48163),n=r(82048),a=r(52540),s=r(34845),c=r(77108),l=r(47286),d=r(33094),u=r(20304),h=r(31821),m=r(63761),p=r(14113);const f=16;function v(){const e=new p.N5,t=e.fragment;return e.include(n.c),e.include(s.Ir),t.include(a.E),t.uniforms.add(new d.U("radius",(e=>g(e.camera)))).code.add(h.H`vec3 sphere[16] = vec3[16](
8
+ }`))}},11725:(e,t,r)=>{r.d(t,{im:()=>u,m$:()=>i});var i,o,n=r(24326),a=r(49255),s=r(39341),c=r(35256),l=r(43616),d=r(65786);class u{constructor(e,t){this.id=(0,n.c)(),this.supportsEdges=!1,this.vertexAttributeLocations=s.D,this._renderPriority=0,this._parameters=new t,(0,l.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,l.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:i.None}get hasEmissions(){return!1}getConfiguration(e,t,r=new c.E){return r.output=e,r.hasHighlightMixTexture=e===a.V.Highlight&&null!=t.highlightMixTexture,r}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque",d.Y},11964:(e,t,r)=>{r.d(t,{Cr:()=>l,H6:()=>h,_I:()=>u,kb:()=>d,vt:()=>c});var i=r(34727),o=r(4341),n=r(38954),a=r(51850),s=r(32114);function c(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function l(e,t,r=c()){return(0,n.c)(r.origin,e),(0,n.d)(r.vector,t,e),r}function d(e,t){const r=(0,n.d)(s.rq.get(),t,e.origin),o=(0,n.e)(e.vector,r),a=(0,n.e)(e.vector,e.vector),c=(0,i.qE)(o/a,0,1),l=(0,n.d)(s.rq.get(),(0,n.g)(s.rq.get(),e.vector,c),r);return(0,n.e)(l,l)}function u(e,t,r){return h(e,t,0,1,r)}function h(e,t,r,o,a){const{vector:c,origin:l}=e,d=(0,n.d)(s.rq.get(),t,l),u=(0,n.e)(c,d)/(0,n.k)(c);return(0,n.g)(a,c,(0,i.qE)(u,r,o)),(0,n.f)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)(),new o.I((()=>c()))},12541:(e,t,r)=>{r.d(t,{CR:()=>l,Eo:()=>g,FV:()=>f,Kv:()=>m,QE:()=>s,QJ:()=>d,Qp:()=>h,mq:()=>v,re:()=>p,tl:()=>u,tr:()=>c});var i=r(49186),o=r(53966),n=r(63907);const a=()=>o.A.getLogger("esri/views/webgl/textureUtils");function s(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&a().error("Negative dimension parameters are not allowed!");const{internalFormat:o}=e;if(o&&(l(o)||d(o))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:o}=e;o&&a().error("Depth textures cannot have mipmaps"),t?i!==n.Cj.LINEAR&&i!==n.Cj.NEAREST&&a().error("Depth textures cannot sample mipmaps"):(i!==n.Cj.NEAREST&&a().error("Depth textures without filtering must use NEAREST filtering"),r&&a().error("Depth textures without filtering cannot use compare function"))}}function c(e){return e in n.H0}function l(e){return e in n.SB}function d(e){return e in n.iE}function u(e){return null!=e&&e in n.CQ}function h(e){return null!=e&&"type"in e&&"compressed"===e.type}function m(e){return null!=e&&!h(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function p(e){return e===n.Ap.TEXTURE_3D||e===n.Ap.TEXTURE_2D_ARRAY}function f(e,t,r,i=1){let o=Math.max(t,r);return e===n.Ap.TEXTURE_3D&&(o=Math.max(o,i)),Math.floor(Math.log2(o))+1}function v(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case n.ld.FLOAT:switch(e.pixelFormat){case n.Ab.RGBA:return n.H0.RGBA32F;case n.Ab.RGB:return n.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case n.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case n.Ab.RGBA:return n.H0.RGBA8;case n.Ab.RGB:return n.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=t===n.j7.DEPTH_STENCIL?n.iE.DEPTH24_STENCIL8:t===n.j7.DEPTH_COMPONENT?n.SB.DEPTH_COMPONENT24:t,e.internalFormat}function g(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}},12791:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Bind,((r,i)=>r.bindTexture(e,t(i))))}}},13464:(e,t,r)=>{var i;r.d(t,{N:()=>i}),function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.OPAQUE_MATERIAL_WITHOUT_NORMALS=3]="OPAQUE_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_MATERIAL_WITHOUT_NORMALS=5]="TRANSPARENT_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_MATERIAL_WITHOUT_DEPTH=7]="TRANSPARENT_MATERIAL_WITHOUT_DEPTH",e[e.OCCLUDED_GROUND=8]="OCCLUDED_GROUND",e[e.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",e[e.HUD_MATERIAL=12]="HUD_MATERIAL",e[e.LABEL_MATERIAL=13]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=14]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=15]="LINE_CALLOUTS_HUD_DEPTH",e[e.OVERLAY=16]="OVERLAY",e[e.DRAPED_MATERIAL=17]="DRAPED_MATERIAL",e[e.DRAPED_WATER=18]="DRAPED_WATER",e[e.VOXEL=19]="VOXEL",e[e.MAX_SLOTS=20]="MAX_SLOTS"}(i||(i={}))},14113:(e,t,r)=>{r.d(t,{N5:()=>c});var i=r(49186),o=(r(44208),r(53966)),n=r(69270);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 c extends s{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new p,this.extensions=new f,this.outputs=new v}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!1){const r=this.extensions.generateSource(e),i=this.attributes.generateSource(e),o=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,a=n.uniforms.generateSource(),s=n.code.generateSource(),c=n.main.generateSource(t),l="vertex"===e?T:_,d=n.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${r.join("\n")}\n${l}\n${d.join("\n")}\n${a.join("\n")}\n${i.join("\n")}\n${o.join("\n")}\n${u.join("\n")}\n${s.join("\n")}\n${c.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Bind];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Bind];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return t=>{for(let o=0;o<i;++o)r[o](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,n,t,o)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else a().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class h extends s{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new d(this),this.code=new u(this),this.constants=new g(this)}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class p{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?a().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1,flat:r?.flat??!1})}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+(r.flat||"int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`))),t}}class f{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?f.ALLOWLIST_VERTEX:f.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}static{this.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"]}static{this.ALLOWLIST_VERTEX=[]}}class v{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):a().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:v.DEFAULT_NAME,type:v.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}class g{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=g._numberToFloatStr(r);break;case"int":i=g._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])}, ${g._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>g._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",T="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"vec4",i.c.Bind,((i,o)=>i.setUniform4fv(e,t(o),r)))}}},15581:(e,t,r)=>{r.d(t,{S:()=>T,b:()=>v,g:()=>g});var i=r(37585),o=r(48163),n=r(82048),a=r(52540),s=r(34845),c=r(77108),l=r(47286),d=r(33094),u=r(20304),h=r(31821),m=r(63761),p=r(14113);const f=16;function v(){const e=new p.N5,t=e.fragment;return e.include(n.c),e.include(s.Ir),t.include(a.E),t.uniforms.add(new d.U("radius",(e=>g(e.camera)))).code.add(h.H`vec3 sphere[16] = vec3[16](
9
9
  vec3(0.186937, 0.0, 0.0),
10
10
  vec3(0.700542, 0.0, 0.0),
11
11
  vec3(-0.864858, -0.481795, -0.111713),
@@ -87,7 +87,7 @@ return fallOffFunction(vv, vn, 0.1);
87
87
  A = (pow(A, 0.2) + 1.2 * A * A * A * A) / 2.2;
88
88
 
89
89
  fragOcclusion = A;
90
- `),e}function g(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const _=(0,o.vt)(),T=Object.freeze(Object.defineProperty({__proto__:null,build:v,getRadius:g},Symbol.toStringTag,{value:"Module"}))},15976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},16943:(e,t,r)=>{r.d(t,{E:()=>o});var i=r(44208);function o(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},17352:(e,t,r)=>{r.d(t,{b:()=>j,f:()=>x}),r(44208);var i=r(53966),o=r(34727),n=r(4341),a=r(58083),s=r(9093),c=r(38954),l=r(51850),d=r(19419),u=r(88582),h=r(11964),m=r(240),p=r(71351),f=r(44280),v=r(32114);const g=()=>i.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function _(e=H){return{plane:(0,m.vt)(e.plane),origin:(0,l.o8)(e.origin),basis1:(0,l.o8)(e.basis1),basis2:(0,l.o8)(e.basis2)}}function T(e,t=_()){return x(e.origin,e.basis1,e.basis2,t)}function x(e,t,r,i=_()){return(0,c.c)(i.origin,e),(0,c.c)(i.basis1,t),(0,c.c)(i.basis2,r),E(i),function(e,t){Math.abs((0,c.e)(e.basis1,e.basis2)/((0,c.l)(e.basis1)*(0,c.l)(e.basis2)))>1e-6&&g().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,c.e)(e.basis1,N(e)))>1e-6&&g().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,c.e)(N(e),e.origin)-e.plane[3])>1e-6&&g().warn(t,"Plane offset is not consistent with plane origin")}(i,"fromValues()"),i}function E(e){(0,m.mR)(e.basis2,e.basis1,e.origin,e.plane)}function b(e,t,r){e!==r&&T(e,r);const i=(0,c.g)(v.rq.get(),N(e),t);return(0,c.f)(r.origin,r.origin,i),r.plane[3]-=t,r}function A(e,t=_()){const r=(e[2]-e[0])/2,i=(e[3]-e[1])/2;return(0,c.i)(t.origin,e[0]+r,e[1]+i,0),(0,c.i)(t.basis1,r,0,0),(0,c.i)(t.basis2,0,i,0),(0,m.fA)(0,0,1,0,t.plane),t}function S(e,t,r){return!!(0,m.Ui)(e.plane,t,r)&&y(e,r)}function M(e,t,r){const i=F.get();L(e,t,i,F.get());let n=Number.POSITIVE_INFINITY;for(const a of z){const s=D(e,a,B.get()),l=v.rq.get();if((0,m.T7)(i,s,l)){const e=(0,c.E)(v.rq.get(),t.origin,l),i=Math.abs((0,o.XM)((0,c.e)(t.direction,e)));i<n&&(n=i,(0,c.c)(r,l))}}return n===Number.POSITIVE_INFINITY?w(e,t,r):r}function w(e,t,r){if(S(e,t,r))return r;const i=F.get(),o=F.get();L(e,t,i,o);let n=Number.POSITIVE_INFINITY;for(const a of z){const s=D(e,a,B.get()),l=v.rq.get();if((0,m.gv)(i,s,l)){const e=(0,p.kb)(t,l);if(!(0,m.Tj)(o,l))continue;e<n&&(n=e,(0,c.c)(r,l))}}return O(e,t.origin)<n&&C(e,t.origin,r),r}function C(e,t,r){const i=(0,m._I)(e.plane,t,v.rq.get()),o=(0,h.H6)(P(e,e.basis1),i,-1,1,v.rq.get()),n=(0,h.H6)(P(e,e.basis2),i,-1,1,v.rq.get());return(0,c.d)(r,(0,c.f)(v.rq.get(),o,n),e.origin),r}function R(e,t,r){const{origin:i,basis1:o,basis2:n}=e,a=(0,c.d)(v.rq.get(),t,i),s=(0,f.gr)(o,a),l=(0,f.gr)(n,a),d=(0,f.gr)(N(e),a);return(0,c.i)(r,s,l,d)}function O(e,t){const r=R(e,t,v.rq.get()),{basis1:i,basis2:o}=e,n=(0,c.l)(i),a=(0,c.l)(o),s=Math.max(Math.abs(r[0])-n,0),l=Math.max(Math.abs(r[1])-a,0),d=r[2];return s*s+l*l+d*d}function I(e,t){const r=-e.plane[3];return(0,f.gr)(N(e),t)-r}function N(e){return(0,m.Qj)(e.plane)}function y(e,t){const r=(0,c.d)(v.rq.get(),t,e.origin),i=(0,c.k)(e.basis1),o=(0,c.k)(e.basis2),n=(0,c.e)(e.basis1,r),a=(0,c.e)(e.basis2,r);return-n-i<0&&n-i<0&&-a-o<0&&a-o<0}function P(e,t){const r=B.get();return(0,c.c)(r.origin,e.origin),(0,c.c)(r.vector,t),r}function D(e,t,r){const{basis1:i,basis2:o,origin:n}=e,a=(0,c.g)(v.rq.get(),i,t.origin[0]),s=(0,c.g)(v.rq.get(),o,t.origin[1]);(0,c.f)(r.origin,a,s),(0,c.f)(r.origin,r.origin,n);const l=(0,c.g)(v.rq.get(),i,t.direction[0]),d=(0,c.g)(v.rq.get(),o,t.direction[1]);return(0,c.g)(r.vector,(0,c.f)(l,l,d),2),r}function L(e,t,r,i){const o=N(e);(0,m.mR)(o,t.direction,t.origin,r),(0,m.mR)((0,m.Qj)(r),o,t.origin,i)}const H={plane:(0,m.vt)(),origin:(0,l.fA)(0,0,0),basis1:(0,l.fA)(1,0,0),basis2:(0,l.fA)(0,1,0)},F=new n.I(m.vt),B=new n.I(h.vt),U=(0,l.vt)(),G=new n.I((()=>_())),z=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],V=(0,s.vt)(),W=(0,s.vt)(),j=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:class{constructor(){this.plane=(0,m.vt)(),this.origin=(0,l.vt)(),this.basis1=(0,l.vt)(),this.basis2=(0,l.vt)()}},altitudeAt:I,axisAt:function(e,t,r,i){return function(e,t,r){switch(t){case u._.X:(0,c.c)(r,e.basis1),(0,c.n)(r,r);break;case u._.Y:(0,c.c)(r,e.basis2),(0,c.n)(r,r);break;case u._.Z:(0,c.c)(r,N(e))}return r}(e,r,i)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:w,closestPointOnSilhouette:M,copy:T,copyWithoutVerify:function(e,t){(0,c.c)(t.origin,e.origin),(0,c.c)(t.basis1,e.basis1),(0,c.c)(t.basis2,e.basis2),(0,m.C)(t.plane,e.plane)},create:_,distance:function(e,t){return Math.sqrt(O(e,t))},distance2:O,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const i of z){const o=D(e,i,B.get()),n=(0,h.kb)(o,t);n>r&&(r=n)}return Math.sqrt(r)},elevate:b,equals:function(e,t){return(0,c.q)(e.basis1,t.basis1)&&(0,c.q)(e.basis2,t.basis2)&&(0,c.q)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,m.Tj)(e.plane,t)&&y(e,t)},fromAABoundingRect:A,fromValues:x,getExtent:function(e,t){const r=e.basis1[0],i=e.basis2[1],[o,n]=e.origin;return(0,d.fA)(o-r,n-i,o+r,n+i,t)},intersectRay:S,intersectRayClosestSilhouette:function(e,t,r){if(S(e,t,r))return r;const i=M(e,t,v.rq.get());return(0,c.f)(r,t.origin,(0,c.g)(v.rq.get(),t.direction,(0,c.j)(t.origin,i)/(0,c.l)(t.direction))),r},normal:N,projectPoint:C,projectPointLocal:R,rotate:function(e,t,r,i){return e!==i&&T(e,i),(0,a.$0)(W,t,r),(0,c.t)(i.basis1,e.basis1,W),(0,c.t)(i.basis2,e.basis2,W),E(i),i},setAltitudeAt:function(e,t,r,i){const o=I(e,t),n=(0,c.g)(U,N(e),r-o);return(0,c.f)(i,t,n),i},setExtent:function(e,t,r){return A(t,r),b(r,I(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&T(e,r),(0,a.B8)(V,t),(0,a.mg)(V,V),(0,c.t)(r.basis1,e.basis1,V),(0,c.t)(r.basis2,e.basis2,V),(0,c.t)((0,m.Qj)(r.plane),(0,m.Qj)(e.plane),V),(0,c.t)(r.origin,e.origin,t),(0,m.mP)(r.plane,r.plane,r.origin),r},up:H,updateUnboundedPlane:E,wrap:function(e,t,r){const i=G.get();return i.origin=e,i.basis1=t,i.basis2=r,i.plane=(0,m.LV)(0,0,0,0),E(i),i}},Symbol.toStringTag,{value:"Module"}))},20304:(e,t,r)=>{r.d(t,{m:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"float",i.c.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},20693:(e,t,r)=>{r.d(t,{yu:()=>p,Nz:()=>T,NB:()=>f,S7:()=>_});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(23205),c=r(40710),l=r(33094),d=r(58029),u=r(69270),h=r(74333);class m extends h.n{constructor(e,t){super(e,"mat4",u.c.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}function p(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new c.W("cameraPosition",((e,t)=>(0,n.i)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new d.F("proj",(e=>e.camera.projectionMatrix)),new m("view",((e,t)=>(0,i.Tl)(v,t.camera.viewMatrix,e.origin))),new c.W("localOrigin",(e=>e.origin)));const r=({camera:e})=>(0,n.i)(g,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11]);e.uniforms.add(new d.F("proj",(e=>e.camera.projectionMatrix)),new d.F("view",(e=>(0,i.Tl)(v,e.camera.viewMatrix,r(e)))),new s.d("localOrigin",(e=>r(e))))}const v=(0,o.vt)(),g=(0,a.vt)();function _(e){e.uniforms.add(new d.F("viewNormal",(e=>e.camera.viewInverseTransposeMatrix)))}function T(e){e.uniforms.add(new l.U("pixelRatio",(e=>e.camera.pixelRatio/e.overlayStretch)))}},21231:(e,t,r)=>{r.d(t,{g:()=>p});var i=r(49186),o=(r(44208),r(53966)),n=r(97768),a=r(74887),s=r(94656),c=r(63907),l=r(6625),d=r(67171),u=r(12541);class h extends d.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case c.H0.R16F:case c.H0.R32F:case c.H0.R8_SNORM:case c.H0.R8:this.pixelFormat=c.Ab.RED;break;case c.H0.R8I:case c.H0.R8UI:case c.H0.R16I:case c.H0.R16UI:case c.H0.R32I:case c.H0.R32UI:this.pixelFormat=c.Ab.RED_INTEGER}}static validate(e,t){return new h(e,t)}}const m=()=>o.A.getLogger("esri/views/webgl/Texture");let p=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=l.d.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=h.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}this._descriptor.target===c.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return(0,d.e)(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this._descriptor.context.gl&&this.hasWebGLTextureObject&&(this._descriptor.context.instanceCounter.decrement(c.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===c.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!(0,u.Qp)(e)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in c.CQ&&(this._descriptor.internalFormat=void 0),this._setData(e),!(0,u.Qp)(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(t,r,o,n,a,s,c=0){s||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=(0,u.mq)(l);const{context:d,pixelFormat:h,dataType:p,target:f,isImmutable:v}=l;if(v&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const g=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||o<0||r+n>l.width||o+a>l.height)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:_}=d;c&&(n&&a||m().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),_.pixelStorei(_.UNPACK_SKIP_ROWS,c)),(0,u.Kv)(s)?_.texSubImage2D(f,t,r,o,n,a,h,p,s):(0,u.Qp)(s)?_.compressedTexSubImage2D(f,t,r,o,n,a,l.internalFormat,s.levels[t]):_.texSubImage2D(f,t,r,o,n,a,h,p,s),c&&_.pixelStorei(_.UNPACK_SKIP_ROWS,0),d.bindTexture(g,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,o,n,a,s,c,l){l||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=(0,u.mq)(d);const{context:h,pixelFormat:p,dataType:f,isImmutable:v,target:g}=d;if(v&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,u.re)(g)||m().warn("Attempting to set 3D texture data on a non-3D texture");const _=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||o<0||n<0||r+a>d.width||o+s>d.height||n+c>d.depth)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=h;if((0,u.Qp)(l))l=l.levels[t],T.compressedTexSubImage3D(g,t,r,o,n,a,s,c,d.internalFormat,l);else{const e=l;T.texSubImage3D(g,t,r,o,n,a,s,c,p,f,e)}h.bindTexture(_,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,(0,u.QE)(t)}t.samplingMode===c.Cj.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=c.Cj.LINEAR_MIPMAP_NEAREST):t.samplingMode===c.Cj.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=c.Cj.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,(0,u.QE)(e)}e.samplingMode===c.Cj.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=c.Cj.LINEAR):e.samplingMode===c.Cj.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=c.Cj.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,(0,u.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?c.Cj.LINEAR:c.Cj.NEAREST),(0,u.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,n.DC)(this._compressionAbortController)}_setData(t,r){const o=this._descriptor,n=o.context?.gl;if(!n)return;(0,s.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),o.context.instanceCounter.increment(c.vt.Texture,this)),(0,u.QE)(o);const a=o.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);o.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,s.Y2)(n);const l=r??o.target,d=(0,u.re)(l);if((0,u.Kv)(t))this._setDataFromTexImageSource(t,l);else{const{width:e,height:r,depth:a}=o;if(null==e||null==r)throw new i.A("texture:missing-size","Width and height must be specified!");if(d&&null==a)throw new i.A("texture:missing-depth","Depth must be specified!");if(o.internalFormat=(0,u.mq)(o),o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,o.internalFormat,o.hasMipmap,e,r,a),(0,u.Qp)(t)){if(!(0,u.tl)(o.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,o.internalFormat,l)}else this._texImage(l,0,o.internalFormat,e,r,a,t),(0,s.Y2)(n),o.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,s.Y2)(n),o.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=c.Ap.TEXTURE_CUBE_MAP_POSITIVE_X;t<=c.Ap.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=(0,u.mq)(i);const o=(0,u.re)(t),{width:n,height:a,depth:c}=(0,u.Eo)(e);i.width&&i.height,i.width||(i.width=n),i.height||(i.height=a),o&&i.depth,o&&(i.depth=c),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,n,a,c),this._texImage(t,0,i.internalFormat,n,a,c,e),(0,s.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,s.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:o,height:n,depth:a}=i,s=e.levels,l=(0,u.FV)(r,o,n,a),d=Math.min(l,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,c.H3.MAX_LEVEL,d),this._forEachMipmapLevel(((e,i,o,n)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,o,n,a)}),d)}_texStorage(e,t,r,o,n,a){const{gl:s}=this._descriptor.context;if(!(0,u.tr)(t)&&!(0,u.CR)(t)&&!(0,u.QJ)(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?(0,u.FV)(e,o,n,a):1;if((0,u.re)(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,c,t,o,n,a)}else s.texStorage2D(e,c,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,a,s){const c=this._descriptor.context.gl,l=(0,u.re)(e),{isImmutable:d,pixelFormat:h,dataType:m}=this._descriptor;if(d){if(null!=s){const r=s;if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,o,n,a,h,m,r)}else c.texSubImage2D(e,t,0,0,o,n,h,m,r)}}else{const d=s;if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,o,n,a,0,h,m,d)}else c.texImage2D(e,t,r,o,n,0,h,m,d)}}_compressedTexImage(e,t,r,o,n,a,s){const c=this._descriptor.context.gl,l=(0,u.re)(e);if(this._descriptor.isImmutable){if(null!=s)if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,o,n,a,r,s)}else c.compressedTexSubImage2D(e,t,0,0,o,n,r,s)}else if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,o,n,a,0,s)}else c.compressedTexImage2D(e,t,r,o,n,0,s)}async _compressOnWorker(t){const{width:r,height:i,context:o,flipped:n,preMultiplyAlpha:s,hasMipmap:l}=this._descriptor,d=this._descriptor.compress?.compressionTracker,u=this._descriptor.compress?.compressionCallback,{compressedTextureETC:h,compressedTextureS3TC:p}=o.capabilities;if(!e.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!h&&!p)return;this.abortCompression();const f=new AbortController;this._compressionAbortController=f,d?.increment();try{let o;t instanceof Uint8Array?o=t.buffer:(o=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"}),(0,a.Te)(f));const d={data:o,width:r,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:this._descriptor.pixelFormat===c.Ab.RGBA?4:3,preMultiplyAlpha:s,hasMipmap:l,hasETC:!!h,hasS3TC:!!p},m=await e.compressionWorkerHandle.invoke(d,f.signal,"low");if((0,a.Te)(f),m.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=m.internalFormat,this._setData(m.compressedTexture),u?.(e-this.usedMemory)}}catch(e){(0,a.zf)(e)||m().error("Texture compression failed!")}finally{d?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null)}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:s}=this._descriptor;const l=s===c.Ap.TEXTURE_3D;if(null==r||null==o||l&&null==n)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||l&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),l&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;r===c.Cj.LINEAR_MIPMAP_NEAREST||r===c.Cj.LINEAR_MIPMAP_LINEAR?(r=c.Cj.LINEAR,e.hasMipmap||(i=c.Cj.LINEAR)):r!==c.Cj.NEAREST_MIPMAP_NEAREST&&r!==c.Cj.NEAREST_MIPMAP_LINEAR||(r=c.Cj.NEAREST,e.hasMipmap||(i=c.Cj.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,s.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},22393:(e,t,r)=>{r.d(t,{c:()=>s});var i=r(31821);function o(e){e.code.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
90
+ `),e}function g(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const _=(0,o.vt)(),T=Object.freeze(Object.defineProperty({__proto__:null,build:v,getRadius:g},Symbol.toStringTag,{value:"Module"}))},15976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},16943:(e,t,r)=>{r.d(t,{E:()=>o});var i=r(44208);function o(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},17352:(e,t,r)=>{r.d(t,{b:()=>j,f:()=>x}),r(44208);var i=r(53966),o=r(34727),n=r(4341),a=r(58083),s=r(9093),c=r(38954),l=r(51850),d=r(19419),u=r(88582),h=r(11964),m=r(240),p=r(71351),f=r(44280),v=r(32114);const g=()=>i.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function _(e=H){return{plane:(0,m.vt)(e.plane),origin:(0,l.o8)(e.origin),basis1:(0,l.o8)(e.basis1),basis2:(0,l.o8)(e.basis2)}}function T(e,t=_()){return x(e.origin,e.basis1,e.basis2,t)}function x(e,t,r,i=_()){return(0,c.c)(i.origin,e),(0,c.c)(i.basis1,t),(0,c.c)(i.basis2,r),E(i),function(e,t){Math.abs((0,c.e)(e.basis1,e.basis2)/((0,c.l)(e.basis1)*(0,c.l)(e.basis2)))>1e-6&&g().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,c.e)(e.basis1,N(e)))>1e-6&&g().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,c.e)(N(e),e.origin)-e.plane[3])>1e-6&&g().warn(t,"Plane offset is not consistent with plane origin")}(i,"fromValues()"),i}function E(e){(0,m.mR)(e.basis2,e.basis1,e.origin,e.plane)}function b(e,t,r){e!==r&&T(e,r);const i=(0,c.g)(v.rq.get(),N(e),t);return(0,c.f)(r.origin,r.origin,i),r.plane[3]-=t,r}function A(e,t=_()){const r=(e[2]-e[0])/2,i=(e[3]-e[1])/2;return(0,c.i)(t.origin,e[0]+r,e[1]+i,0),(0,c.i)(t.basis1,r,0,0),(0,c.i)(t.basis2,0,i,0),(0,m.fA)(0,0,1,0,t.plane),t}function M(e,t,r){return!!(0,m.Ui)(e.plane,t,r)&&y(e,r)}function S(e,t,r){const i=F.get();L(e,t,i,F.get());let n=Number.POSITIVE_INFINITY;for(const a of z){const s=D(e,a,B.get()),l=v.rq.get();if((0,m.T7)(i,s,l)){const e=(0,c.E)(v.rq.get(),t.origin,l),i=Math.abs((0,o.XM)((0,c.e)(t.direction,e)));i<n&&(n=i,(0,c.c)(r,l))}}return n===Number.POSITIVE_INFINITY?C(e,t,r):r}function C(e,t,r){if(M(e,t,r))return r;const i=F.get(),o=F.get();L(e,t,i,o);let n=Number.POSITIVE_INFINITY;for(const a of z){const s=D(e,a,B.get()),l=v.rq.get();if((0,m.gv)(i,s,l)){const e=(0,p.kb)(t,l);if(!(0,m.Tj)(o,l))continue;e<n&&(n=e,(0,c.c)(r,l))}}return O(e,t.origin)<n&&w(e,t.origin,r),r}function w(e,t,r){const i=(0,m._I)(e.plane,t,v.rq.get()),o=(0,h.H6)(P(e,e.basis1),i,-1,1,v.rq.get()),n=(0,h.H6)(P(e,e.basis2),i,-1,1,v.rq.get());return(0,c.d)(r,(0,c.f)(v.rq.get(),o,n),e.origin),r}function R(e,t,r){const{origin:i,basis1:o,basis2:n}=e,a=(0,c.d)(v.rq.get(),t,i),s=(0,f.gr)(o,a),l=(0,f.gr)(n,a),d=(0,f.gr)(N(e),a);return(0,c.i)(r,s,l,d)}function O(e,t){const r=R(e,t,v.rq.get()),{basis1:i,basis2:o}=e,n=(0,c.l)(i),a=(0,c.l)(o),s=Math.max(Math.abs(r[0])-n,0),l=Math.max(Math.abs(r[1])-a,0),d=r[2];return s*s+l*l+d*d}function I(e,t){const r=-e.plane[3];return(0,f.gr)(N(e),t)-r}function N(e){return(0,m.Qj)(e.plane)}function y(e,t){const r=(0,c.d)(v.rq.get(),t,e.origin),i=(0,c.k)(e.basis1),o=(0,c.k)(e.basis2),n=(0,c.e)(e.basis1,r),a=(0,c.e)(e.basis2,r);return-n-i<0&&n-i<0&&-a-o<0&&a-o<0}function P(e,t){const r=B.get();return(0,c.c)(r.origin,e.origin),(0,c.c)(r.vector,t),r}function D(e,t,r){const{basis1:i,basis2:o,origin:n}=e,a=(0,c.g)(v.rq.get(),i,t.origin[0]),s=(0,c.g)(v.rq.get(),o,t.origin[1]);(0,c.f)(r.origin,a,s),(0,c.f)(r.origin,r.origin,n);const l=(0,c.g)(v.rq.get(),i,t.direction[0]),d=(0,c.g)(v.rq.get(),o,t.direction[1]);return(0,c.g)(r.vector,(0,c.f)(l,l,d),2),r}function L(e,t,r,i){const o=N(e);(0,m.mR)(o,t.direction,t.origin,r),(0,m.mR)((0,m.Qj)(r),o,t.origin,i)}const H={plane:(0,m.vt)(),origin:(0,l.fA)(0,0,0),basis1:(0,l.fA)(1,0,0),basis2:(0,l.fA)(0,1,0)},F=new n.I(m.vt),B=new n.I(h.vt),U=(0,l.vt)(),G=new n.I((()=>_())),z=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],V=(0,s.vt)(),W=(0,s.vt)(),j=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:class{constructor(){this.plane=(0,m.vt)(),this.origin=(0,l.vt)(),this.basis1=(0,l.vt)(),this.basis2=(0,l.vt)()}},altitudeAt:I,axisAt:function(e,t,r,i){return function(e,t,r){switch(t){case u._.X:(0,c.c)(r,e.basis1),(0,c.n)(r,r);break;case u._.Y:(0,c.c)(r,e.basis2),(0,c.n)(r,r);break;case u._.Z:(0,c.c)(r,N(e))}return r}(e,r,i)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:C,closestPointOnSilhouette:S,copy:T,copyWithoutVerify:function(e,t){(0,c.c)(t.origin,e.origin),(0,c.c)(t.basis1,e.basis1),(0,c.c)(t.basis2,e.basis2),(0,m.C)(t.plane,e.plane)},create:_,distance:function(e,t){return Math.sqrt(O(e,t))},distance2:O,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const i of z){const o=D(e,i,B.get()),n=(0,h.kb)(o,t);n>r&&(r=n)}return Math.sqrt(r)},elevate:b,equals:function(e,t){return(0,c.q)(e.basis1,t.basis1)&&(0,c.q)(e.basis2,t.basis2)&&(0,c.q)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,m.Tj)(e.plane,t)&&y(e,t)},fromAABoundingRect:A,fromValues:x,getExtent:function(e,t){const r=e.basis1[0],i=e.basis2[1],[o,n]=e.origin;return(0,d.fA)(o-r,n-i,o+r,n+i,t)},intersectRay:M,intersectRayClosestSilhouette:function(e,t,r){if(M(e,t,r))return r;const i=S(e,t,v.rq.get());return(0,c.f)(r,t.origin,(0,c.g)(v.rq.get(),t.direction,(0,c.j)(t.origin,i)/(0,c.l)(t.direction))),r},normal:N,projectPoint:w,projectPointLocal:R,rotate:function(e,t,r,i){return e!==i&&T(e,i),(0,a.$0)(W,t,r),(0,c.t)(i.basis1,e.basis1,W),(0,c.t)(i.basis2,e.basis2,W),E(i),i},setAltitudeAt:function(e,t,r,i){const o=I(e,t),n=(0,c.g)(U,N(e),r-o);return(0,c.f)(i,t,n),i},setExtent:function(e,t,r){return A(t,r),b(r,I(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&T(e,r),(0,a.B8)(V,t),(0,a.mg)(V,V),(0,c.t)(r.basis1,e.basis1,V),(0,c.t)(r.basis2,e.basis2,V),(0,c.t)((0,m.Qj)(r.plane),(0,m.Qj)(e.plane),V),(0,c.t)(r.origin,e.origin,t),(0,m.mP)(r.plane,r.plane,r.origin),r},up:H,updateUnboundedPlane:E,wrap:function(e,t,r){const i=G.get();return i.origin=e,i.basis1=t,i.basis2=r,i.plane=(0,m.LV)(0,0,0,0),E(i),i}},Symbol.toStringTag,{value:"Module"}))},20304:(e,t,r)=>{r.d(t,{m:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"float",i.c.Pass,((i,o,n)=>i.setUniform1f(e,t(o,n),r)))}}},20693:(e,t,r)=>{r.d(t,{yu:()=>p,Nz:()=>T,NB:()=>f,S7:()=>_});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(23205),c=r(40710),l=r(33094),d=r(58029),u=r(69270),h=r(74333);class m extends h.n{constructor(e,t,r){super(e,"mat4",u.c.Draw,((i,o,n)=>i.setUniformMatrix4fv(e,t(o,n),r)))}}function p(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new c.W("cameraPosition",((e,t)=>(0,n.i)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new d.F("proj",(e=>e.camera.projectionMatrix)),new m("view",((e,t)=>(0,i.Tl)(v,t.camera.viewMatrix,e.origin))),new c.W("localOrigin",(e=>e.origin)));const r=({camera:e})=>(0,n.i)(g,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11]);e.uniforms.add(new d.F("proj",(e=>e.camera.projectionMatrix)),new d.F("view",(e=>(0,i.Tl)(v,e.camera.viewMatrix,r(e)))),new s.d("localOrigin",(e=>r(e))))}const v=(0,o.vt)(),g=(0,a.vt)();function _(e){e.uniforms.add(new d.F("viewNormal",(e=>e.camera.viewInverseTransposeMatrix)))}function T(e){e.uniforms.add(new l.U("pixelRatio",(e=>e.camera.pixelRatio/e.overlayStretch)))}},21231:(e,t,r)=>{r.d(t,{g:()=>p});var i=r(49186),o=(r(44208),r(53966)),n=r(97768),a=r(74887),s=r(94656),c=r(63907),l=r(6625),d=r(67171),u=r(12541);class h extends d.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case c.H0.R16F:case c.H0.R32F:case c.H0.R8_SNORM:case c.H0.R8:this.pixelFormat=c.Ab.RED;break;case c.H0.R8I:case c.H0.R8UI:case c.H0.R16I:case c.H0.R16UI:case c.H0.R32I:case c.H0.R32UI:this.pixelFormat=c.Ab.RED_INTEGER}}static validate(e,t){return new h(e,t)}}const m=()=>o.A.getLogger("esri/views/webgl/Texture");let p=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=l.d.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=h.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}this._descriptor.target===c.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return(0,d.e)(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this._descriptor.context.gl&&this.hasWebGLTextureObject&&(this._descriptor.context.instanceCounter.decrement(c.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===c.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!(0,u.Qp)(e)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in c.CQ&&(this._descriptor.internalFormat=void 0),this._setData(e),!(0,u.Qp)(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(t,r,o,n,a,s,c=0){s||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=(0,u.mq)(l);const{context:d,pixelFormat:h,dataType:p,target:f,isImmutable:v}=l;if(v&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const g=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||o<0||r+n>l.width||o+a>l.height)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:_}=d;c&&(n&&a||m().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),_.pixelStorei(_.UNPACK_SKIP_ROWS,c)),(0,u.Kv)(s)?_.texSubImage2D(f,t,r,o,n,a,h,p,s):(0,u.Qp)(s)?_.compressedTexSubImage2D(f,t,r,o,n,a,l.internalFormat,s.levels[t]):_.texSubImage2D(f,t,r,o,n,a,h,p,s),c&&_.pixelStorei(_.UNPACK_SKIP_ROWS,0),d.bindTexture(g,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,o,n,a,s,c,l){l||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=(0,u.mq)(d);const{context:h,pixelFormat:p,dataType:f,isImmutable:v,target:g}=d;if(v&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,u.re)(g)||m().warn("Attempting to set 3D texture data on a non-3D texture");const _=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||o<0||n<0||r+a>d.width||o+s>d.height||n+c>d.depth)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=h;if((0,u.Qp)(l))l=l.levels[t],T.compressedTexSubImage3D(g,t,r,o,n,a,s,c,d.internalFormat,l);else{const e=l;T.texSubImage3D(g,t,r,o,n,a,s,c,p,f,e)}h.bindTexture(_,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,(0,u.QE)(t)}t.samplingMode===c.Cj.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=c.Cj.LINEAR_MIPMAP_NEAREST):t.samplingMode===c.Cj.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=c.Cj.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,(0,u.QE)(e)}e.samplingMode===c.Cj.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=c.Cj.LINEAR):e.samplingMode===c.Cj.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=c.Cj.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,(0,u.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?c.Cj.LINEAR:c.Cj.NEAREST),(0,u.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,n.DC)(this._compressionAbortController)}_setData(t,r){const o=this._descriptor,n=o.context?.gl;if(!n)return;(0,s.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),o.context.instanceCounter.increment(c.vt.Texture,this)),(0,u.QE)(o);const a=o.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);o.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,s.Y2)(n);const l=r??o.target,d=(0,u.re)(l);if((0,u.Kv)(t))this._setDataFromTexImageSource(t,l);else{const{width:e,height:r,depth:a}=o;if(null==e||null==r)throw new i.A("texture:missing-size","Width and height must be specified!");if(d&&null==a)throw new i.A("texture:missing-depth","Depth must be specified!");if(o.internalFormat=(0,u.mq)(o),o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,o.internalFormat,o.hasMipmap,e,r,a),(0,u.Qp)(t)){if(!(0,u.tl)(o.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,o.internalFormat,l)}else this._texImage(l,0,o.internalFormat,e,r,a,t),(0,s.Y2)(n),o.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,s.Y2)(n),o.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=c.Ap.TEXTURE_CUBE_MAP_POSITIVE_X;t<=c.Ap.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=(0,u.mq)(i);const o=(0,u.re)(t),{width:n,height:a,depth:c}=(0,u.Eo)(e);i.width&&i.height,i.width||(i.width=n),i.height||(i.height=a),o&&i.depth,o&&(i.depth=c),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,n,a,c),this._texImage(t,0,i.internalFormat,n,a,c,e),(0,s.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,s.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:o,height:n,depth:a}=i,s=e.levels,l=(0,u.FV)(r,o,n,a),d=Math.min(l,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,c.H3.MAX_LEVEL,d),this._forEachMipmapLevel(((e,i,o,n)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,o,n,a)}),d)}_texStorage(e,t,r,o,n,a){const{gl:s}=this._descriptor.context;if(!(0,u.tr)(t)&&!(0,u.CR)(t)&&!(0,u.QJ)(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?(0,u.FV)(e,o,n,a):1;if((0,u.re)(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,c,t,o,n,a)}else s.texStorage2D(e,c,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,a,s){const c=this._descriptor.context.gl,l=(0,u.re)(e),{isImmutable:d,pixelFormat:h,dataType:m}=this._descriptor;if(d){if(null!=s){const r=s;if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,o,n,a,h,m,r)}else c.texSubImage2D(e,t,0,0,o,n,h,m,r)}}else{const d=s;if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,o,n,a,0,h,m,d)}else c.texImage2D(e,t,r,o,n,0,h,m,d)}}_compressedTexImage(e,t,r,o,n,a,s){const c=this._descriptor.context.gl,l=(0,u.re)(e);if(this._descriptor.isImmutable){if(null!=s)if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,o,n,a,r,s)}else c.compressedTexSubImage2D(e,t,0,0,o,n,r,s)}else if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,o,n,a,0,s)}else c.compressedTexImage2D(e,t,r,o,n,0,s)}async _compressOnWorker(t){const{width:r,height:i,context:o,flipped:n,preMultiplyAlpha:s,hasMipmap:l}=this._descriptor,d=this._descriptor.compress?.compressionTracker,u=this._descriptor.compress?.compressionCallback,{compressedTextureETC:h,compressedTextureS3TC:p}=o.capabilities;if(!e.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!h&&!p)return;this.abortCompression();const f=new AbortController;this._compressionAbortController=f,d?.increment();try{let o;t instanceof Uint8Array?o=t.buffer:(o=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"}),(0,a.Te)(f));const d={data:o,width:r,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:this._descriptor.pixelFormat===c.Ab.RGBA?4:3,preMultiplyAlpha:s,hasMipmap:l,hasETC:!!h,hasS3TC:!!p},m=await e.compressionWorkerHandle.invoke(d,f.signal,"low");if((0,a.Te)(f),m.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=m.internalFormat,this._setData(m.compressedTexture),u?.(e-this.usedMemory)}}catch(e){(0,a.zf)(e)||m().error("Texture compression failed!")}finally{d?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null)}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:s}=this._descriptor;const l=s===c.Ap.TEXTURE_3D;if(null==r||null==o||l&&null==n)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||l&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),l&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;r===c.Cj.LINEAR_MIPMAP_NEAREST||r===c.Cj.LINEAR_MIPMAP_LINEAR?(r=c.Cj.LINEAR,e.hasMipmap||(i=c.Cj.LINEAR)):r!==c.Cj.NEAREST_MIPMAP_NEAREST&&r!==c.Cj.NEAREST_MIPMAP_LINEAR||(r=c.Cj.NEAREST,e.hasMipmap||(i=c.Cj.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,s.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},22393:(e,t,r)=>{r.d(t,{c:()=>s});var i=r(31821);function o(e){e.code.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
91
91
  return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
92
92
  }`),e.code.add(i.H`float integratedRadiance(float cosTheta2, float roughness) {
93
93
  return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
@@ -144,7 +144,13 @@ return (diffuseComponent + specularComponent);
144
144
  ${(0,u.If)(_,"emissions.rgb *= emissiveStrength;")}
145
145
  return emissions;
146
146
  }
147
- `)}(o=i||(i={}))[o.None=0]="None",o[o.SymbolColor=1]="SymbolColor",o[o.EmissiveColor=2]="EmissiveColor",o[o.Texture=3]="Texture",o[o.COUNT=4]="COUNT"},23205:(e,t,r)=>{r.d(t,{d:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec3",i.c.Bind,((r,i)=>r.setUniform3fv(e,t(i))))}}},25634:(e,t,r)=>{r.d(t,{m8:()=>c,NV:()=>d});var i=r(97768),o=r(74887),n=r(89192);class a{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context.stippleTextures}get _markerTextures(){return this._techniques.context.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return n.Am.LOADED}}var s=r(65786);class c extends a{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){super.dispose(),this._texture=(0,i.Gz)(this._texture),this._textureNormal=(0,i.Gz)(this._textureNormal),this._textureEmissive=(0,i.Gz)(this._textureEmissive),this._textureOcclusion=(0,i.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?n.Am.LOADED:n.Am.LOADING}get textureBindParameters(){return new d(this._texture?.glTexture??null,this._textureNormal?.glTexture??null,this._textureEmissive?.glTexture??null,this._textureOcclusion?.glTexture??null,this._textureMetallicRoughness?.glTexture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.Gz)(this._texture),this._acquire(e,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,o.$X)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.Gz)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class l extends s.Y{constructor(e=null){super(),this.textureEmissive=e}}class d extends l{constructor(e,t,r,i,o,n,a){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=o,this.scale=n,this.normalTextureTransformMatrix=a}}},26425:(e,t,r)=>{r.d(t,{u:()=>n});var i=r(33094),o=r(31821);function n({code:e,uniforms:t},r){t.add(new i.U("dpDummy",(()=>1))),e.add(o.H`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
147
+ `)}(o=i||(i={}))[o.None=0]="None",o[o.SymbolColor=1]="SymbolColor",o[o.EmissiveColor=2]="EmissiveColor",o[o.Texture=3]="Texture",o[o.COUNT=4]="COUNT"},23205:(e,t,r)=>{r.d(t,{d:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"vec3",i.c.Bind,((i,o)=>i.setUniform3fv(e,t(o),r)))}}},24321:(e,t,r)=>{r.d(t,{v:()=>a});var i=r(43519),o=r(31821),n=r(46540);function a(e,t){t.instancedColor?(e.attributes.add(n.r.INSTANCECOLOR,"vec4"),e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.vertex.code.add(o.H`
148
+ MaskedColor applyInstanceColor(MaskedColor color) {
149
+ return multiplyMaskedColors( color, createMaskedFromUInt8NaNColor(${n.r.INSTANCECOLOR}));
150
+ }
151
+ `)):e.vertex.code.add(o.H`MaskedColor applyInstanceColor(MaskedColor color) {
152
+ return color;
153
+ }`)}},25634:(e,t,r)=>{r.d(t,{m8:()=>c,NV:()=>d});var i=r(97768),o=r(74887),n=r(89192);class a{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context.stippleTextures}get _markerTextures(){return this._techniques.context.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return n.Am.LOADED}}var s=r(65786);class c extends a{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){super.dispose(),this._texture=(0,i.Gz)(this._texture),this._textureNormal=(0,i.Gz)(this._textureNormal),this._textureEmissive=(0,i.Gz)(this._textureEmissive),this._textureOcclusion=(0,i.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?n.Am.LOADED:n.Am.LOADING}get textureBindParameters(){return new d(this._texture?.glTexture??null,this._textureNormal?.glTexture??null,this._textureEmissive?.glTexture??null,this._textureOcclusion?.glTexture??null,this._textureMetallicRoughness?.glTexture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.Gz)(this._texture),this._acquire(e,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,o.$X)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.Gz)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class l extends s.Y{constructor(e=null){super(),this.textureEmissive=e}}class d extends l{constructor(e,t,r,i,o,n,a){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=o,this.scale=n,this.normalTextureTransformMatrix=a}}},26425:(e,t,r)=>{r.d(t,{u:()=>n});var i=r(33094),o=r(31821);function n({code:e,uniforms:t},r){t.add(new i.U("dpDummy",(()=>1))),e.add(o.H`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
148
154
  vec3 hiD = hiA + hiB;
149
155
  vec3 loD = loA + loB;
150
156
  return dpDummy * hiD + loD;
@@ -188,22 +194,23 @@ return dpDummy * hiD + loD;
188
194
  // multiply or tint (or something invalid)
189
195
  return allMixed;
190
196
  }
191
- `)}},28421:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"float",i.c.Draw,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},28491:(e,t,r)=>{r.d(t,{D:()=>V,b:()=>z});var i=r(91829),o=r(46686),n=r(32680),a=r(49255),s=r(76591),c=r(76597),l=r(60864),d=r(96336),u=r(71955),h=r(53466),m=r(92700),p=r(72824),f=r(35640),v=r(40261),g=r(77695),_=r(42837),T=r(89390),x=r(98619),E=r(62602),b=r(22393),A=r(59469),S=r(39168),M=r(96598),w=r(51406),C=r(42398),R=r(58614),O=r(27950),I=r(20693),N=r(33079),y=r(71988),P=r(20304),D=r(31821),L=r(63761),H=r(10906),F=r(46540),B=r(60517),U=r(14113),G=r(49788);function z(e){const t=new U.N5,{attributes:r,vertex:z,fragment:V,varyings:W}=t,{output:j,normalType:k,offsetBackfaces:$,instancedColor:q,spherical:Y,receiveShadows:X,snowCover:Z,pbrMode:J,textureAlphaPremultiplied:K,instancedDoublePrecision:Q,hasVertexColors:ee,hasVertexTangents:te,hasColorTexture:re,hasNormalTexture:ie,hasNormalTextureTransform:oe,hasColorTextureTransform:ne,hasBloom:ae}=e;if((0,I.NB)(z,e),r.add(F.r.POSITION,"vec3"),W.add("vpos","vec3",{invariant:!0}),t.include(C.A,e),t.include(l.B,e),t.include(f.Ge,e),t.include(w.q2,e),!(0,a.RN)(j))return t.include(v.E,e),t;t.include(w.Sx,e),t.include(w.MU,e),t.include(w.O1,e),t.include(w.QM,e),(0,I.yu)(z,e),t.include(d.Y,e),t.include(c.d,e);const se=k===d.W.Attribute||k===d.W.Compressed;return se&&$&&t.include(n.M),t.include(g.W,e),t.include(p.Mh,e),q&&t.attributes.add(F.r.INSTANCECOLOR,"vec4"),W.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(o.oD,e),t.include(u.K,e),t.include(m.c,e),z.uniforms.add(new y.E("externalColor",(e=>"ignore"===e.colorMixMode?i.Un:e.externalColor))),W.add("vcolorExt","vec4"),t.include(M.Z,e),z.main.add(D.H`
197
+ `)}},28421:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"float",i.c.Draw,((i,o,n)=>i.setUniform1f(e,t(o,n),r)))}}},28491:(e,t,r)=>{r.d(t,{D:()=>j,b:()=>W});var i=r(46686),o=r(32680),n=r(49255),a=r(76591),s=r(76597),c=r(24321),l=r(60864),d=r(43519),u=r(96336),h=r(71955),m=r(53466),p=r(92700),f=r(72824),v=r(35640),g=r(40261),_=r(77695),T=r(42837),x=r(89390),E=r(98619),b=r(62602),A=r(22393),M=r(59469),S=r(39168),C=r(96598),w=r(51406),R=r(42398),O=r(58614),I=r(27950),N=r(20693),y=r(33079),P=r(71988),D=r(20304),L=r(31821),H=r(63761),F=r(10906),B=r(46540),U=r(43616),G=r(60517),z=r(14113),V=r(49788);function W(e){const t=new z.N5,{attributes:r,vertex:W,fragment:j,varyings:k}=t,{output:$,normalType:q,offsetBackfaces:Y,spherical:X,receiveShadows:Z,snowCover:J,pbrMode:K,textureAlphaPremultiplied:Q,instancedDoublePrecision:ee,hasVertexColors:te,hasVertexTangents:re,hasColorTexture:ie,hasNormalTexture:oe,hasNormalTextureTransform:ne,hasColorTextureTransform:ae,hasBloom:se}=e;if((0,N.NB)(W,e),r.add(B.r.POSITION,"vec3"),k.add("vpos","vec3",{invariant:!0}),t.include(R.A,e),t.include(l.B,e),t.include(v.Ge,e),t.include(w.q2,e),!(0,n.RN)($))return t.include(g.E,e),t;t.include(w.Sx,e),t.include(w.MU,e),t.include(w.O1,e),t.include(w.QM,e),(0,N.yu)(W,e),t.include(u.Y,e),t.include(s.d,e);const ce=q===u.W.Attribute||q===u.W.Compressed;return ce&&Y&&t.include(o.M),t.include(_.W,e),t.include(f.Mh,e),t.include(c.v,e),k.add("vPositionLocal","vec3"),t.include(m.U,e),t.include(i.oD,e),t.include(h.K,e),t.include(p.c,e),W.uniforms.add(new P.E("externalColor",(e=>e.externalColor),{supportsNaN:!0})),k.add("vcolorExt","vec4"),t.include(C.Z,e),W.include(d.WD),W.include(d.oF),W.main.add(L.H`
192
198
  forwardNormalizedVertexColor();
193
- vcolorExt = externalColor;
194
- ${(0,D.If)(q,"vcolorExt *= instanceColor * 0.003921568627451;")}
195
- vcolorExt *= vvColor();
196
- vcolorExt *= getSymbolColor();
197
- forwardColorMixMode();
199
+
200
+ MaskedColor maskedColorExt =
201
+ applySymbolColor(applyVVColor(applyInstanceColor(createMaskedFromNaNColor(externalColor))));
202
+
203
+ vcolorExt = maskedColorExt.color;
204
+ forwardColorMixMode(maskedColorExt.mask);
198
205
 
199
206
  vpos = getVertexInLocalOriginSpace();
200
207
  vPositionLocal = vpos - view[3].xyz;
201
208
  vpos = subtractOrigin(vpos);
202
- ${(0,D.If)(se,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
209
+ ${(0,L.If)(ce,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
203
210
  vpos = addVerticalOffset(vpos, localOrigin);
204
- ${(0,D.If)(te,"vTangent = dpTransformVertexTangent(tangent);")}
211
+ ${(0,L.If)(re,"vTangent = dpTransformVertexTangent(tangent);")}
205
212
  gl_Position = transformPosition(proj, view, vpos);
206
- ${(0,D.If)(se&&$,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
213
+ ${(0,L.If)(ce&&Y,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
207
214
 
208
215
  forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
209
216
  forwardLinearDepth();
@@ -214,18 +221,18 @@ return dpDummy * hiD + loD;
214
221
  forwardOcclusionUV();
215
222
  forwardMetallicRoughnessUV();
216
223
 
217
- if (vcolorExt.a < ${D.H.float(G.Q)}) {
224
+ if (opacityMixMode != ${L.H.int(U.Um.ignore)} && vcolorExt.a < ${L.H.float(V.Q)}) {
218
225
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
219
226
  }
220
- `),t.include(T.kA,e),V.include(_.n,e),t.include(R.S,e),t.include(Q?S.G:S.Bz,e),V.include(s.HQ,e),t.include(B.z,e),(0,I.yu)(V,e),V.uniforms.add(z.uniforms.get("localOrigin"),new N.t("ambient",(e=>e.ambient)),new N.t("diffuse",(e=>e.diffuse)),new P.m("opacity",(e=>e.opacity)),new P.m("layerOpacity",(e=>e.layerOpacity))),re&&V.uniforms.add(new L.N("tex",(e=>e.texture))),t.include(A._Z,e),V.include(b.c,e),V.include(O.N),t.include(E.r,e),V.include(H.b,e),(0,T.a8)(V),(0,T.eU)(V),(0,x.O4)(V),V.main.add(D.H`
227
+ `),t.include(x.kA,e),j.include(T.n,e),t.include(O.S,e),t.include(ee?S.G:S.Bz,e),j.include(a.HQ,e),t.include(G.z,e),(0,N.yu)(j,e),j.uniforms.add(W.uniforms.get("localOrigin"),new y.t("ambient",(e=>e.ambient)),new y.t("diffuse",(e=>e.diffuse)),new D.m("opacity",(e=>e.opacity)),new D.m("layerOpacity",(e=>e.layerOpacity))),ie&&j.uniforms.add(new H.N("tex",(e=>e.texture))),t.include(M._Z,e),j.include(A.c,e),j.include(I.N),t.include(b.r,e),j.include(F.b,e),(0,x.a8)(j),(0,x.eU)(j),(0,E.O4)(j),j.main.add(L.H`
221
228
  discardBySlice(vpos);
222
229
  discardByTerrainDepth();
223
- ${re?D.H`
224
- vec4 texColor = texture(tex, ${ne?"colorUV":"vuv0"});
225
- ${(0,D.If)(K,"texColor.rgb /= texColor.a;")}
226
- discardOrAdjustAlpha(texColor);`:D.H`vec4 texColor = vec4(1.0);`}
230
+ ${ie?L.H`
231
+ vec4 texColor = texture(tex, ${ae?"colorUV":"vuv0"});
232
+ ${(0,L.If)(Q,"texColor.rgb /= texColor.a;")}
233
+ discardOrAdjustAlpha(texColor);`:L.H`vec4 texColor = vec4(1.0);`}
227
234
  shadingParams.viewDirection = normalize(vpos - cameraPosition);
228
- ${k===d.W.ScreenDerivative?D.H`vec3 normal = screenDerivativeNormal(vPositionLocal);`:D.H`shadingParams.normalView = vNormalWorld;
235
+ ${q===u.W.ScreenDerivative?L.H`vec3 normal = screenDerivativeNormal(vPositionLocal);`:L.H`shadingParams.normalView = vNormalWorld;
229
236
  vec3 normal = shadingNormal(shadingParams);`}
230
237
  applyPBRFactors();
231
238
  float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
@@ -233,15 +240,16 @@ return dpDummy * hiD + loD;
233
240
  vec3 posWorld = vpos + localOrigin;
234
241
 
235
242
  float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
236
- float shadow = ${X?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,D.If)(Y,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
243
+ float shadow = ${Z?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,L.If)(X,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
237
244
 
238
245
  vec3 matColor = max(ambient, diffuse);
239
- vec3 albedo = mixExternalColor(${(0,D.If)(ee,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
240
- float opacity_ = layerOpacity * mixExternalOpacity(${(0,D.If)(ee,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, int(colorMixMode));
241
- ${ie?`mat3 tangentSpace = computeTangentSpace(${te?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${oe?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
242
- vec3 normalGround = ${Y?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
246
+ vec3 albedo = mixExternalColor(${(0,L.If)(te,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
247
+ float opacity_ = layerOpacity * mixExternalOpacity(${(0,L.If)(te,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, opacityMixMode);
248
+
249
+ ${oe?`mat3 tangentSpace = computeTangentSpace(${re?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${ne?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
250
+ vec3 normalGround = ${X?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
243
251
 
244
- ${(0,D.If)(Z,D.H`
252
+ ${(0,L.If)(J,L.H`
245
253
  float snow = getSnow(normal, normalGround);
246
254
  albedo = mix(albedo, vec3(1), snow);
247
255
  shadingNormal = mix(shadingNormal, normal, snow);
@@ -249,21 +257,21 @@ return dpDummy * hiD + loD;
249
257
 
250
258
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
251
259
 
252
- ${J===A.A9.Normal||J===A.A9.Schematic?D.H`
260
+ ${K===M.A9.Normal||K===M.A9.Schematic?L.H`
253
261
  float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
254
- vec4 emission = ${ae?"vec4(0.0)":"getEmissions(albedo)"};
255
- ${(0,D.If)(Z,"mrr = applySnowToMRR(mrr, snow);\n emission = snowCoverForEmissions(emission, snow);")}
256
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:D.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
262
+ vec4 emission = ${se?"vec4(0.0)":"getEmissions(albedo)"};
263
+ ${(0,L.If)(J,"mrr = applySnowToMRR(mrr, snow);\n emission = snowCoverForEmissions(emission, snow);")}
264
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:L.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
257
265
  vec4 finalColor = vec4(shadedColor, opacity_);
258
- outputColorHighlightOID(finalColor, vpos, albedo ${(0,D.If)(Z,", snow")});
259
- `),t}const V=Object.freeze(Object.defineProperty({__proto__:null,build:z},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(3694),o=r(38954),n=r(51850),a=r(620);class s{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:l}=r;(0,a.vA)(l.length%this._numIndexPerPrimitive===0),(0,a.vA)(l.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*l[this._numIndexPerPrimitive*e[0]];c.clear(),c.push(u);const h=(0,n.fA)(i[u],i[u+1],i[u+2]),m=(0,n.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*l[r+e],c.push(u);let t=i[u];h[0]=Math.min(t,h[0]),m[0]=Math.max(t,m[0]),t=i[u+1],h[1]=Math.min(t,h[1]),m[1]=Math.max(t,m[1]),t=i[u+2],h[2]=Math.min(t,h[2]),m[2]=Math.max(t,m[2])}}this.bbMin=h,this.bbMax=m;const p=(0,o.m)((0,n.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(m[0]-h[0],m[1]-h[1]),m[2]-h[2]);let f=this.radius*this.radius;for(let e=0;e<c.length;++e){u=c.at(e);const t=i[u]-p[0],r=i[u+1]-p[1],o=i[u+2]-p[2],n=t*t+r*r+o*o;if(n<=f)continue;const a=Math.sqrt(n),s=.5*(a-this.radius);this.radius=this.radius+s,f=this.radius*this.radius;const l=s/a;p[0]+=t*l,p[1]+=r*l,p[2]+=o*l}this.center=p,c.clear()}getChildren(){if(this._children||(0,o.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,o.m)((0,n.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:a,size:c,indices:l}=this.position;for(let o=0;o<t;++o){let t=0;const n=this._numIndexPerPrimitive*this.primitiveIndices[o];let s=c*l[n],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=c*l[n+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[o]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){c.prune()}}const c=new i.A({deallocator:null})},31821:(e,t,r)=>{function i(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}function o(e,t,r=""){return e?t:r}r.d(t,{H:()=>i,If:()=>o}),function(e){e.int=function(e){return Math.round(e).toString()},e.float=function(e){return e.toPrecision(8)}}(i||(i={}))},32680:(e,t,r)=>{r.d(t,{M:()=>o});var i=r(31821);function o(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
266
+ outputColorHighlightOID(finalColor, vpos, albedo ${(0,L.If)(J,", snow")});
267
+ `),t}const j=Object.freeze(Object.defineProperty({__proto__:null,build:W},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(3694),o=r(38954),n=r(51850),a=r(620);class s{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:l}=r;(0,a.vA)(l.length%this._numIndexPerPrimitive===0),(0,a.vA)(l.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*l[this._numIndexPerPrimitive*e[0]];c.clear(),c.push(u);const h=(0,n.fA)(i[u],i[u+1],i[u+2]),m=(0,n.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*l[r+e],c.push(u);let t=i[u];h[0]=Math.min(t,h[0]),m[0]=Math.max(t,m[0]),t=i[u+1],h[1]=Math.min(t,h[1]),m[1]=Math.max(t,m[1]),t=i[u+2],h[2]=Math.min(t,h[2]),m[2]=Math.max(t,m[2])}}this.bbMin=h,this.bbMax=m;const p=(0,o.m)((0,n.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(m[0]-h[0],m[1]-h[1]),m[2]-h[2]);let f=this.radius*this.radius;for(let e=0;e<c.length;++e){u=c.at(e);const t=i[u]-p[0],r=i[u+1]-p[1],o=i[u+2]-p[2],n=t*t+r*r+o*o;if(n<=f)continue;const a=Math.sqrt(n),s=.5*(a-this.radius);this.radius=this.radius+s,f=this.radius*this.radius;const l=s/a;p[0]+=t*l,p[1]+=r*l,p[2]+=o*l}this.center=p,c.clear()}getChildren(){if(this._children||(0,o.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,o.m)((0,n.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:a,size:c,indices:l}=this.position;for(let o=0;o<t;++o){let t=0;const n=this._numIndexPerPrimitive*this.primitiveIndices[o];let s=c*l[n],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=c*l[n+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[o]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){c.prune()}}const c=new i.A({deallocator:null})},31821:(e,t,r)=>{function i(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}function o(e,t,r=""){return e?t:r}r.d(t,{H:()=>i,If:()=>o}),function(e){e.int=function(e){return Math.round(e).toString()},e.float=function(e){return e.toPrecision(8)}}(i||(i={}))},32680:(e,t,r)=>{r.d(t,{M:()=>o});var i=r(31821);function o(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
260
268
  vec3 camToVert = posWorld - camPosWorld;
261
269
  bool isBackface = dot(camToVert, normalWorld) > 0.0;
262
270
  if (isBackface) {
263
271
  posClip.z += 0.0000003 * posClip.w;
264
272
  }
265
273
  return posClip;
266
- }`)}},32976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"bool",i.c.Bind,((r,i)=>r.setUniform1b(e,t(i))))}}},33079:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec3",i.c.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},33094:(e,t,r)=>{r.d(t,{U:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"float",i.c.Bind,((r,i)=>r.setUniform1f(e,t(i))))}}},33524:(e,t,r)=>{r.d(t,{K_:()=>p,Yf:()=>l,ez:()=>c,m6:()=>f,mE:()=>m,xt:()=>u,z5:()=>d});var i=r(49255),o=r(59643),n=r(63907),a=r(90644);const s=(0,a.p3)(n.dn.ONE,n.dn.ZERO,n.dn.ONE,n.dn.ONE_MINUS_SRC_ALPHA);function c(e){return e===o.Y.FrontFace?null:s}function l(e){switch(e){case o.Y.NONE:return a.T8;case o.Y.ColorAlpha:return s;case o.Y.FrontFace:case o.Y.COUNT:return null}}function d(e){if(e.draped)return null;switch(e.oitPass){case o.Y.NONE:case o.Y.FrontFace:return e.writeDepth?a.Uy:null;case o.Y.ColorAlpha:case o.Y.COUNT:return null}}const u=5e5,h={factor:-1,units:-2};function m({oitPass:e,enableOffset:t}){return t&&e===o.Y.ColorAlpha?h:null}function p(e,t=n.MT.LESS){return e===o.Y.NONE||e===o.Y.FrontFace?t:n.MT.LEQUAL}function f(e,t){const r=(0,i.LG)(t);return e===o.Y.ColorAlpha?r?{buffers:[n.r6,n.yI,n.Fq]}:{buffers:[n.r6,n.yI]}:r?{buffers:[n.r6,n.yI]}:null}},33752:(e,t,r)=>{r.d(t,{EM:()=>g,dO:()=>v,em:()=>f});var i=r(29242),o=r(9093),n=r(51850),a=r(26425),s=r(40710),c=r(33079),l=r(31821),d=r(98353),u=r(35644),h=r(40095),m=r(46540),p=r(65786);function f(e,t){const{attributes:r,vertex:i,varyings:o,fragment:n}=e;i.include(a.u,t),r.add(m.r.POSITION,"vec3"),o.add("vPositionWorldCameraRelative","vec3"),o.add("vPosition_view","vec3",{invariant:!0}),i.uniforms.add(new c.t("transformWorldFromViewTH",(e=>e.transformWorldFromViewTH)),new c.t("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL)),new u.k("transformViewFromCameraRelativeRS",(e=>e.transformViewFromCameraRelativeRS)),new h.X("transformProjFromView",(e=>e.transformProjFromView)),new d.h("transformWorldFromModelRS",(e=>e.transformWorldFromModelRS)),new s.W("transformWorldFromModelTH",(e=>e.transformWorldFromModelTH)),new s.W("transformWorldFromModelTL",(e=>e.transformWorldFromModelTL))),i.code.add(l.H`vec3 positionWorldCameraRelative() {
274
+ }`)}},32976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"bool",i.c.Bind,((r,i)=>r.setUniform1b(e,t(i))))}}},33079:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"vec3",i.c.Pass,((i,o,n)=>i.setUniform3fv(e,t(o,n),r)))}}},33094:(e,t,r)=>{r.d(t,{U:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"float",i.c.Bind,((i,o)=>i.setUniform1f(e,t(o),r)))}}},33524:(e,t,r)=>{r.d(t,{K_:()=>p,Yf:()=>l,ez:()=>c,m6:()=>f,mE:()=>m,xt:()=>u,z5:()=>d});var i=r(49255),o=r(59643),n=r(63907),a=r(90644);const s=(0,a.p3)(n.dn.ONE,n.dn.ZERO,n.dn.ONE,n.dn.ONE_MINUS_SRC_ALPHA);function c(e){return e===o.Y.FrontFace?null:s}function l(e){switch(e){case o.Y.NONE:return a.T8;case o.Y.ColorAlpha:return s;case o.Y.FrontFace:case o.Y.COUNT:return null}}function d(e){if(e.draped)return null;switch(e.oitPass){case o.Y.NONE:case o.Y.FrontFace:return e.writeDepth?a.Uy:null;case o.Y.ColorAlpha:case o.Y.COUNT:return null}}const u=5e5,h={factor:-1,units:-2};function m({oitPass:e,enableOffset:t}){return t&&e===o.Y.ColorAlpha?h:null}function p(e,t=n.MT.LESS){return e===o.Y.NONE||e===o.Y.FrontFace?t:n.MT.LEQUAL}function f(e,t){const r=(0,i.LG)(t);return e===o.Y.ColorAlpha?r?{buffers:[n.r6,n.yI,n.Fq]}:{buffers:[n.r6,n.yI]}:r?{buffers:[n.r6,n.yI]}:null}},33752:(e,t,r)=>{r.d(t,{EM:()=>g,dO:()=>v,em:()=>f});var i=r(29242),o=r(9093),n=r(51850),a=r(26425),s=r(40710),c=r(33079),l=r(31821),d=r(98353),u=r(35644),h=r(40095),m=r(46540),p=r(65786);function f(e,t){const{attributes:r,vertex:i,varyings:o,fragment:n}=e;i.include(a.u,t),r.add(m.r.POSITION,"vec3"),o.add("vPositionWorldCameraRelative","vec3"),o.add("vPosition_view","vec3",{invariant:!0}),i.uniforms.add(new c.t("transformWorldFromViewTH",(e=>e.transformWorldFromViewTH)),new c.t("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL)),new u.k("transformViewFromCameraRelativeRS",(e=>e.transformViewFromCameraRelativeRS)),new h.X("transformProjFromView",(e=>e.transformProjFromView)),new d.h("transformWorldFromModelRS",(e=>e.transformWorldFromModelRS)),new s.W("transformWorldFromModelTH",(e=>e.transformWorldFromModelTH)),new s.W("transformWorldFromModelTL",(e=>e.transformWorldFromModelTL))),i.code.add(l.H`vec3 positionWorldCameraRelative() {
267
275
  vec3 rotatedModelPosition = transformWorldFromModelRS * position;
268
276
  vec3 transform_CameraRelativeFromModel = dpAdd(
269
277
  transformWorldFromModelTL,
@@ -304,12 +312,12 @@ return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale
304
312
  vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
305
313
  return worldPos + calculateVerticalOffset(worldPos, localOrigin);
306
314
  }
307
- `)):r.code.add(c.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const d=(0,o.vt)();function u(e){e.uniforms.add(new s.E("verticalOffset",((e,t)=>{const{minWorldLength:r,maxWorldLength:o,screenLength:n}=e.verticalOffset,a=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),s=t.camera.pixelRatio||1;return(0,i.s)(d,n*s,a,r,o)})))}},35644:(e,t,r)=>{r.d(t,{k:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"mat3",i.c.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},35818:(e,t,r)=>{r.d(t,{W:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"int",i.c.Bind,((r,i)=>r.setUniform1i(e,t(i))))}}},36782:(e,t,r)=>{r.d(t,{g:()=>a});var i=r(49255),o=r(31821),n=r(46540);function a(e,t){if(t.output!==i.V.ObjectAndLayerIdColor)return e.vertex.code.add(o.H`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(o.H`void outputObjectAndLayerIdColor() {}`);const r=t.objectAndLayerIdColorInstanced;e.varyings.add("objectAndLayerIdColorVarying","vec4"),e.attributes.add(r?n.r.INSTANCEOBJECTANDLAYERIDCOLOR:n.r.OLIDCOLOR,"vec4"),e.vertex.code.add(o.H`
315
+ `)):r.code.add(c.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const d=(0,o.vt)();function u(e){e.uniforms.add(new s.E("verticalOffset",((e,t)=>{const{minWorldLength:r,maxWorldLength:o,screenLength:n}=e.verticalOffset,a=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),s=t.camera.pixelRatio||1;return(0,i.s)(d,n*s,a,r,o)})))}},35644:(e,t,r)=>{r.d(t,{k:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"mat3",i.c.Pass,((i,o,n)=>i.setUniformMatrix3fv(e,t(o,n),r)))}}},35818:(e,t,r)=>{r.d(t,{W:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"int",i.c.Bind,((r,i)=>r.setUniform1i(e,t(i))))}}},36782:(e,t,r)=>{r.d(t,{g:()=>a});var i=r(49255),o=r(31821),n=r(46540);function a(e,t){if(t.output!==i.V.ObjectAndLayerIdColor)return e.vertex.code.add(o.H`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(o.H`void outputObjectAndLayerIdColor() {}`);const r=t.objectAndLayerIdColorInstanced;e.varyings.add("objectAndLayerIdColorVarying","vec4"),e.attributes.add(r?n.r.INSTANCEOBJECTANDLAYERIDCOLOR:n.r.OLIDCOLOR,"vec4"),e.vertex.code.add(o.H`
308
316
  void forwardObjectAndLayerIdColor() {
309
317
  objectAndLayerIdColorVarying = ${r?"instanceObjectAndLayerIdColor":"objectAndLayerIdColor"} * 0.003921568627451;
310
318
  }`),e.fragment.code.add(o.H`void outputObjectAndLayerIdColor() {
311
319
  fragColor = objectAndLayerIdColorVarying;
312
- }`)}},38969:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(37955);function o(e,t){return new Promise(((r,o)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",o)))}))}},39168:(e,t,r)=>{r.d(t,{Bz:()=>g,G:()=>v}),r(51850);var i=r(14314),o=r(31821),n=r(35818),a=r(69270),s=r(74333);class c extends s.n{constructor(e,t,r){super(e,"mat4",a.c.Draw,((r,i,o,n)=>r.setUniformMatrix4fv(e,t(i,o,n))),r)}}class l extends s.n{constructor(e,t,r){super(e,"mat4",a.c.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))),r)}}var d=r(65786);function u(e){e.fragment.uniforms.add(new l("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),m(e)}function h(e){e.fragment.uniforms.add(new c("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),m(e)}function m(e){const{fragment:t}=e;t.uniforms.add(new i.I("cascadeDistances",(e=>e.shadowMap.cascadeDistances)),new n.W("numCascades",(e=>e.shadowMap.numCascades))),t.code.add(o.H`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
320
+ }`)}},38969:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(37955);function o(e,t){return new Promise(((r,o)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",o)))}))}},39168:(e,t,r)=>{r.d(t,{Bz:()=>g,G:()=>v}),r(51850);var i=r(14314),o=r(31821),n=r(35818),a=r(69270),s=r(74333);class c extends s.n{constructor(e,t,r,i){super(e,"mat4",a.c.Draw,((r,o,n,a)=>r.setUniformMatrix4fv(e,t(o,n,a),i)),r)}}class l extends s.n{constructor(e,t,r,i){super(e,"mat4",a.c.Pass,((r,o,n)=>r.setUniformMatrix4fv(e,t(o,n),i)),r)}}var d=r(65786);function u(e){e.fragment.uniforms.add(new l("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),m(e)}function h(e){e.fragment.uniforms.add(new c("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),m(e)}function m(e){const{fragment:t}=e;t.uniforms.add(new i.I("cascadeDistances",(e=>e.shadowMap.cascadeDistances)),new n.W("numCascades",(e=>e.shadowMap.numCascades))),t.code.add(o.H`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
313
321
  vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
314
322
  vec4 lv = mat * vec4(_vpos, 1.0);
315
323
  lv.xy /= lv.w;
@@ -339,7 +347,7 @@ if (uvzShadow.z < 0.0) {
339
347
  return 0.0;
340
348
  }
341
349
  return readShadowMapUVZ(uvzShadow, shadowMap);
342
- }`)}d.Y},39341:(e,t,r)=>{r.d(t,{D:()=>o});var i=r(46540);const o=new Map([[i.r.POSITION,0],[i.r.NORMAL,1],[i.r.NORMALCOMPRESSED,1],[i.r.UV0,2],[i.r.UVI,2],[i.r.COLOR,3],[i.r.COLORFEATUREATTRIBUTE,3],[i.r.SIZE,4],[i.r.TANGENT,4],[i.r.CENTEROFFSETANDDISTANCE,5],[i.r.SYMBOLCOLOR,5],[i.r.FEATUREATTRIBUTE,6],[i.r.INSTANCEFEATUREATTRIBUTE,6],[i.r.OLIDCOLOR,6],[i.r.INSTANCEOBJECTANDLAYERIDCOLOR,6],[i.r.INSTANCECOLOR,7],[i.r.ROTATION,8],[i.r.INSTANCEMODEL,8],[i.r.INSTANCEMODELNORMAL,12],[i.r.INSTANCEMODELORIGINHI,11],[i.r.INSTANCEMODELORIGINLO,15]])},40095:(e,t,r)=>{r.d(t,{X:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"mat4",i.c.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},40261:(e,t,r)=>{r.d(t,{E:()=>T});var i=r(46686),o=r(49255),n=r(76591),a=r(76597),s=r(96336),c=r(36782),l=r(53466),d=r(72824),u=r(31821);function h(e,t){switch(t.output){case o.V.Shadow:case o.V.ShadowHighlight:case o.V.ShadowExcludeHighlight:case o.V.ViewshedShadow:e.fragment.code.add(u.H`float _calculateFragDepth(const in float depth) {
350
+ }`)}d.Y},39341:(e,t,r)=>{r.d(t,{D:()=>o});var i=r(46540);const o=new Map([[i.r.POSITION,0],[i.r.NORMAL,1],[i.r.NORMALCOMPRESSED,1],[i.r.UV0,2],[i.r.UVI,2],[i.r.COLOR,3],[i.r.COLORFEATUREATTRIBUTE,3],[i.r.SIZE,4],[i.r.TANGENT,4],[i.r.CENTEROFFSETANDDISTANCE,5],[i.r.SYMBOLCOLOR,5],[i.r.FEATUREATTRIBUTE,6],[i.r.INSTANCEFEATUREATTRIBUTE,6],[i.r.OLIDCOLOR,6],[i.r.INSTANCEOBJECTANDLAYERIDCOLOR,6],[i.r.INSTANCECOLOR,7],[i.r.ROTATION,8],[i.r.INSTANCEMODEL,8],[i.r.INSTANCEMODELNORMAL,12],[i.r.INSTANCEMODELORIGINHI,11],[i.r.INSTANCEMODELORIGINLO,15]])},40095:(e,t,r)=>{r.d(t,{X:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"mat4",i.c.Pass,((i,o,n)=>i.setUniformMatrix4fv(e,t(o,n),r)))}}},40261:(e,t,r)=>{r.d(t,{E:()=>T});var i=r(46686),o=r(49255),n=r(76591),a=r(76597),s=r(96336),c=r(36782),l=r(53466),d=r(72824),u=r(31821);function h(e,t){switch(t.output){case o.V.Shadow:case o.V.ShadowHighlight:case o.V.ShadowExcludeHighlight:case o.V.ViewshedShadow:e.fragment.code.add(u.H`float _calculateFragDepth(const in float depth) {
343
351
  const float SLOPE_SCALE = 2.0;
344
352
  const float BIAS = 20.0 * .000015259;
345
353
  float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
@@ -348,13 +356,13 @@ return depth + SLOPE_SCALE * m + BIAS;
348
356
  void outputDepth(float _linearDepth){
349
357
  float fragDepth = _calculateFragDepth(_linearDepth);
350
358
  gl_FragDepth = fragDepth;
351
- }`)}}var m=r(42593),p=r(42398),f=r(58614),v=r(20693),g=r(63761),_=r(89192);function T(e,t){const{vertex:r,fragment:T,varyings:x}=e,{hasColorTexture:E,alphaDiscardMode:b}=t,A=E&&b!==_.sf.Opaque,{output:S,normalType:M,hasColorTextureTransform:w}=t;switch(S){case o.V.Depth:(0,v.NB)(r,t),e.include(a.d,t),T.include(n.HQ,t),e.include(l.U,t),A&&T.uniforms.add(new g.N("tex",(e=>e.texture))),r.main.add(u.H`vpos = getVertexInLocalOriginSpace();
359
+ }`)}}var m=r(42593),p=r(42398),f=r(58614),v=r(20693),g=r(63761),_=r(89192);function T(e,t){const{vertex:r,fragment:T,varyings:x}=e,{hasColorTexture:E,alphaDiscardMode:b}=t,A=E&&b!==_.sf.Opaque,{output:M,normalType:S,hasColorTextureTransform:C}=t;switch(M){case o.V.Depth:(0,v.NB)(r,t),e.include(a.d,t),T.include(n.HQ,t),e.include(l.U,t),A&&T.uniforms.add(new g.N("tex",(e=>e.texture))),r.main.add(u.H`vpos = getVertexInLocalOriginSpace();
352
360
  vpos = subtractOrigin(vpos);
353
361
  vpos = addVerticalOffset(vpos, localOrigin);
354
362
  gl_Position = transformPosition(proj, view, vpos);
355
363
  forwardTextureCoordinates();`),e.include(f.S,t),T.main.add(u.H`
356
364
  discardBySlice(vpos);
357
- ${(0,u.If)(A,u.H`vec4 texColor = texture(tex, ${w?"colorUV":"vuv0"});
365
+ ${(0,u.If)(A,u.H`vec4 texColor = texture(tex, ${C?"colorUV":"vuv0"});
358
366
  discardOrAdjustAlpha(texColor);`)}`);break;case o.V.Shadow:case o.V.ShadowHighlight:case o.V.ShadowExcludeHighlight:case o.V.ViewshedShadow:case o.V.ObjectAndLayerIdColor:(0,v.NB)(r,t),e.include(a.d,t),e.include(l.U,t),e.include(p.A,t),e.include(h,t),T.include(n.HQ,t),e.include(c.g,t),(0,i.xJ)(e),x.add("depth","float",{invariant:!0}),A&&T.uniforms.add(new g.N("tex",(e=>e.texture))),r.main.add(u.H`vpos = getVertexInLocalOriginSpace();
359
367
  vpos = subtractOrigin(vpos);
360
368
  vpos = addVerticalOffset(vpos, localOrigin);
@@ -362,9 +370,9 @@ gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
362
370
  forwardTextureCoordinates();
363
371
  forwardObjectAndLayerIdColor();`),e.include(f.S,t),T.main.add(u.H`
364
372
  discardBySlice(vpos);
365
- ${(0,u.If)(A,u.H`vec4 texColor = texture(tex, ${w?"colorUV":"vuv0"});
373
+ ${(0,u.If)(A,u.H`vec4 texColor = texture(tex, ${C?"colorUV":"vuv0"});
366
374
  discardOrAdjustAlpha(texColor);`)}
367
- ${S===o.V.ObjectAndLayerIdColor?u.H`outputObjectAndLayerIdColor();`:u.H`outputDepth(depth);`}`);break;case o.V.Normal:{(0,v.NB)(r,t),e.include(a.d,t),e.include(s.Y,t),e.include(d.Mh,t),e.include(l.U,t),e.include(p.A,t),A&&T.uniforms.add(new g.N("tex",(e=>e.texture))),M===s.W.ScreenDerivative&&x.add("vPositionView","vec3",{invariant:!0});const i=M===s.W.Attribute||M===s.W.Compressed;r.main.add(u.H`
375
+ ${M===o.V.ObjectAndLayerIdColor?u.H`outputObjectAndLayerIdColor();`:u.H`outputDepth(depth);`}`);break;case o.V.Normal:{(0,v.NB)(r,t),e.include(a.d,t),e.include(s.Y,t),e.include(d.Mh,t),e.include(l.U,t),e.include(p.A,t),A&&T.uniforms.add(new g.N("tex",(e=>e.texture))),S===s.W.ScreenDerivative&&x.add("vPositionView","vec3",{invariant:!0});const i=S===s.W.Attribute||S===s.W.Compressed;r.main.add(u.H`
368
376
  vpos = getVertexInLocalOriginSpace();
369
377
  ${i?u.H`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:u.H`vPositionView = (view * vec4(vpos, 1.0)).xyz;`}
370
378
  vpos = subtractOrigin(vpos);
@@ -372,10 +380,10 @@ forwardObjectAndLayerIdColor();`),e.include(f.S,t),T.main.add(u.H`
372
380
  gl_Position = transformPosition(proj, view, vpos);
373
381
  forwardTextureCoordinates();`),T.include(n.HQ,t),e.include(f.S,t),T.main.add(u.H`
374
382
  discardBySlice(vpos);
375
- ${(0,u.If)(A,u.H`vec4 texColor = texture(tex, ${w?"colorUV":"vuv0"});
383
+ ${(0,u.If)(A,u.H`vec4 texColor = texture(tex, ${C?"colorUV":"vuv0"});
376
384
  discardOrAdjustAlpha(texColor);`)}
377
385
 
378
- ${M===s.W.ScreenDerivative?u.H`vec3 normal = screenDerivativeNormal(vPositionView);`:u.H`vec3 normal = normalize(vNormalWorld);
386
+ ${S===s.W.ScreenDerivative?u.H`vec3 normal = screenDerivativeNormal(vPositionView);`:u.H`vec3 normal = normalize(vNormalWorld);
379
387
  if (gl_FrontFacing == false){
380
388
  normal = -normal;
381
389
  }`}
@@ -385,9 +393,9 @@ vpos = addVerticalOffset(vpos, localOrigin);
385
393
  gl_Position = transformPosition(proj, view, vpos);
386
394
  forwardTextureCoordinates();`),T.include(n.HQ,t),e.include(f.S,t),e.include(m.Q,t),T.main.add(u.H`
387
395
  discardBySlice(vpos);
388
- ${(0,u.If)(A,u.H`vec4 texColor = texture(tex, ${w?"colorUV":"vuv0"});
396
+ ${(0,u.If)(A,u.H`vec4 texColor = texture(tex, ${C?"colorUV":"vuv0"});
389
397
  discardOrAdjustAlpha(texColor);`)}
390
- calculateOcclusionAndOutputHighlight();`)}}},40710:(e,t,r)=>{r.d(t,{W:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec3",i.c.Draw,((r,i,o,n)=>r.setUniform3fv(e,t(i,o,n))))}}},42293:(e,t,r)=>{r.d(t,{IB:()=>o}),r(44208),r(94656);var i=r(63907);function o(e){switch(e){case i.Ab.ALPHA:case i.Ab.LUMINANCE:case i.Ab.RED:case i.Ab.RED_INTEGER:case i.H0.R8:case i.H0.R8I:case i.H0.R8UI:case i.H0.R8_SNORM:case i.Xo.STENCIL_INDEX8:return 1;case i.Ab.LUMINANCE_ALPHA:case i.Ab.RG:case i.Ab.RG_INTEGER:case i.H0.RGBA4:case i.H0.R16F:case i.H0.R16I:case i.H0.R16UI:case i.H0.RG8:case i.H0.RG8I:case i.H0.RG8UI:case i.H0.RG8_SNORM:case i.H0.RGB565:case i.H0.RGB5_A1:case i.SB.DEPTH_COMPONENT16:return 2;case i.Ab.RGB:case i.Ab.RGB_INTEGER:case i.H0.RGB8:case i.H0.RGB8I:case i.H0.RGB8UI:case i.H0.RGB8_SNORM:case i.H0.SRGB8:case i.SB.DEPTH_COMPONENT24:return 3;case i.Ab.RGBA:case i.Ab.RGBA_INTEGER:case i.H0.RGBA8:case i.H0.R32F:case i.H0.R11F_G11F_B10F:case i.H0.RG16F:case i.H0.R32I:case i.H0.R32UI:case i.H0.RG16I:case i.H0.RG16UI:case i.H0.RGBA8I:case i.H0.RGBA8UI:case i.H0.RGBA8_SNORM:case i.H0.SRGB8_ALPHA8:case i.H0.RGB9_E5:case i.H0.RGB10_A2UI:case i.H0.RGB10_A2:case i.SB.DEPTH_COMPONENT32F:case i.iE.DEPTH24_STENCIL8:return 4;case i.iE.DEPTH32F_STENCIL8:return 5;case i.H0.RGB16F:case i.H0.RGB16I:case i.H0.RGB16UI:return 6;case i.H0.RG32F:case i.H0.RG32I:case i.H0.RG32UI:case i.H0.RGBA16F:case i.H0.RGBA16I:case i.H0.RGBA16UI:return 8;case i.H0.RGB32F:case i.H0.RGB32I:case i.H0.RGB32UI:return 12;case i.H0.RGBA32F:case i.H0.RGBA32I:case i.H0.RGBA32UI:return 16;case i.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.CQ.COMPRESSED_R11_EAC:case i.CQ.COMPRESSED_SIGNED_R11_EAC:case i.CQ.COMPRESSED_RGB8_ETC2:case i.CQ.COMPRESSED_SRGB8_ETC2:case i.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.CQ.COMPRESSED_RG11_EAC:case i.CQ.COMPRESSED_SIGNED_RG11_EAC:case i.CQ.COMPRESSED_RGBA8_ETC2_EAC:case i.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}r(62298)},42398:(e,t,r)=>{r.d(t,{A:()=>p});var i=r(33079),o=r(71988),n=r(69270),a=r(74333);class s extends a.n{constructor(e,t,r){super(e,"vec4",n.c.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))),r)}}class c extends a.n{constructor(e,t,r){super(e,"float",n.c.Pass,((r,i,o)=>r.setUniform1fv(e,t(i,o))),r)}}var l=r(31821),d=r(35644),u=r(46540),h=r(78662);r(11725),h.Gd;const m=8;function p(e,t){const{vertex:r,attributes:n}=e;t.hasVvInstancing&&(t.vvSize||t.vvColor)&&n.add(u.r.INSTANCEFEATUREATTRIBUTE,"vec4"),t.vvSize?(r.uniforms.add(new i.t("vvSizeMinSize",(e=>e.vvSize.minSize))),r.uniforms.add(new i.t("vvSizeMaxSize",(e=>e.vvSize.maxSize))),r.uniforms.add(new i.t("vvSizeOffset",(e=>e.vvSize.offset))),r.uniforms.add(new i.t("vvSizeFactor",(e=>e.vvSize.factor))),r.uniforms.add(new i.t("vvSizeFallback",(e=>e.vvSize.fallback))),r.uniforms.add(new d.k("vvSymbolRotationMatrix",(e=>e.vvSymbolRotationMatrix))),r.uniforms.add(new i.t("vvSymbolAnchor",(e=>e.vvSymbolAnchor))),r.code.add(l.H`vec3 vvScale(vec4 _featureAttribute) {
398
+ calculateOcclusionAndOutputHighlight();`)}}},40710:(e,t,r)=>{r.d(t,{W:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"vec3",i.c.Draw,((i,o,n,a)=>i.setUniform3fv(e,t(o,n,a),r)))}}},42293:(e,t,r)=>{r.d(t,{IB:()=>o}),r(44208),r(94656);var i=r(63907);function o(e){switch(e){case i.Ab.ALPHA:case i.Ab.LUMINANCE:case i.Ab.RED:case i.Ab.RED_INTEGER:case i.H0.R8:case i.H0.R8I:case i.H0.R8UI:case i.H0.R8_SNORM:case i.Xo.STENCIL_INDEX8:return 1;case i.Ab.LUMINANCE_ALPHA:case i.Ab.RG:case i.Ab.RG_INTEGER:case i.H0.RGBA4:case i.H0.R16F:case i.H0.R16I:case i.H0.R16UI:case i.H0.RG8:case i.H0.RG8I:case i.H0.RG8UI:case i.H0.RG8_SNORM:case i.H0.RGB565:case i.H0.RGB5_A1:case i.SB.DEPTH_COMPONENT16:return 2;case i.Ab.RGB:case i.Ab.RGB_INTEGER:case i.H0.RGB8:case i.H0.RGB8I:case i.H0.RGB8UI:case i.H0.RGB8_SNORM:case i.H0.SRGB8:case i.SB.DEPTH_COMPONENT24:return 3;case i.Ab.RGBA:case i.Ab.RGBA_INTEGER:case i.H0.RGBA8:case i.H0.R32F:case i.H0.R11F_G11F_B10F:case i.H0.RG16F:case i.H0.R32I:case i.H0.R32UI:case i.H0.RG16I:case i.H0.RG16UI:case i.H0.RGBA8I:case i.H0.RGBA8UI:case i.H0.RGBA8_SNORM:case i.H0.SRGB8_ALPHA8:case i.H0.RGB9_E5:case i.H0.RGB10_A2UI:case i.H0.RGB10_A2:case i.SB.DEPTH_COMPONENT32F:case i.iE.DEPTH24_STENCIL8:return 4;case i.iE.DEPTH32F_STENCIL8:return 5;case i.H0.RGB16F:case i.H0.RGB16I:case i.H0.RGB16UI:return 6;case i.H0.RG32F:case i.H0.RG32I:case i.H0.RG32UI:case i.H0.RGBA16F:case i.H0.RGBA16I:case i.H0.RGBA16UI:return 8;case i.H0.RGB32F:case i.H0.RGB32I:case i.H0.RGB32UI:return 12;case i.H0.RGBA32F:case i.H0.RGBA32I:case i.H0.RGBA32UI:return 16;case i.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.CQ.COMPRESSED_R11_EAC:case i.CQ.COMPRESSED_SIGNED_R11_EAC:case i.CQ.COMPRESSED_RGB8_ETC2:case i.CQ.COMPRESSED_SRGB8_ETC2:case i.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.CQ.COMPRESSED_RG11_EAC:case i.CQ.COMPRESSED_SIGNED_RG11_EAC:case i.CQ.COMPRESSED_RGBA8_ETC2_EAC:case i.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}r(62298)},42398:(e,t,r)=>{r.d(t,{A:()=>f});var i=r(43519),o=r(33079),n=r(71988),a=r(69270),s=r(74333);class c extends s.n{constructor(e,t,r,i){super(e,"vec4",a.c.Pass,((r,o,n)=>r.setUniform4fv(e,t(o,n),i)),r)}}class l extends s.n{constructor(e,t,r,i){super(e,"float",a.c.Pass,((r,o,n)=>r.setUniform1fv(e,t(o,n),i)),r)}}var d=r(31821),u=r(35644),h=r(46540),m=r(78662);r(11725),m.Gd;const p=8;function f(e,t){const{vertex:r,attributes:a}=e;t.hasVvInstancing&&(t.vvSize||t.vvColor)&&a.add(h.r.INSTANCEFEATUREATTRIBUTE,"vec4"),t.vvSize?(r.uniforms.add(new o.t("vvSizeMinSize",(e=>e.vvSize.minSize))),r.uniforms.add(new o.t("vvSizeMaxSize",(e=>e.vvSize.maxSize))),r.uniforms.add(new o.t("vvSizeOffset",(e=>e.vvSize.offset))),r.uniforms.add(new o.t("vvSizeFactor",(e=>e.vvSize.factor))),r.uniforms.add(new o.t("vvSizeFallback",(e=>e.vvSize.fallback))),r.uniforms.add(new u.k("vvSymbolRotationMatrix",(e=>e.vvSymbolRotationMatrix))),r.uniforms.add(new o.t("vvSymbolAnchor",(e=>e.vvSymbolAnchor))),r.code.add(d.H`vec3 vvScale(vec4 _featureAttribute) {
391
399
  if (isnan(_featureAttribute.x)) {
392
400
  return vvSizeFallback;
393
401
  }
@@ -395,14 +403,14 @@ return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, v
395
403
  }
396
404
  vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
397
405
  return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
398
- }`),r.code.add(l.H`
406
+ }`),r.code.add(d.H`
399
407
  const float eps = 1.192092896e-07;
400
408
  vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
401
409
  vec3 scale = max(vvScale(_featureAttribute), eps);
402
410
  return vec4(vvSymbolRotationMatrix * _normal / scale, 1.0);
403
411
  }
404
412
 
405
- ${t.hasVvInstancing?l.H`
413
+ ${t.hasVvInstancing?d.H`
406
414
  vec4 vvLocalNormal(vec3 _normal) {
407
415
  return vvTransformNormal(_normal, instanceFeatureAttribute);
408
416
  }
@@ -410,8 +418,8 @@ return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position +
410
418
  vec4 localPosition() {
411
419
  return vvTransformPosition(position, instanceFeatureAttribute);
412
420
  }`:""}
413
- `)):r.code.add(l.H`vec4 localPosition() { return vec4(position, 1.0); }
414
- vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),t.vvColor?(r.constants.add("vvColorNumber","int",m),r.uniforms.add(new c("vvColorValues",(e=>e.vvColor.values),m),new s("vvColorColors",(e=>e.vvColor.colors),m),new o.E("vvColorFallback",(e=>e.vvColor.fallback))),r.code.add(l.H`
421
+ `)):r.code.add(d.H`vec4 localPosition() { return vec4(position, 1.0); }
422
+ vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),e.vertex.include(i.WD),t.vvColor?(r.constants.add("vvColorNumber","int",p),r.uniforms.add(new l("vvColorValues",(e=>e.vvColor.values),p),new c("vvColorColors",(e=>e.vvColor.colors),p),new n.E("vvColorFallback",(e=>e.vvColor.fallback),{supportsNaN:!0})),t.hasVvInstancing&&(e.vertex.include(i.ML),e.vertex.include(i.oF)),r.code.add(d.H`
415
423
  vec4 interpolateVVColor(float value) {
416
424
  if (isnan(value)) {
417
425
  return vvColorFallback;
@@ -434,35 +442,29 @@ vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),t.vvColor?(r.c
434
442
  return interpolateVVColor(featureAttribute.y);
435
443
  }
436
444
 
437
- ${t.hasVvInstancing?l.H`
445
+ ${t.hasVvInstancing?d.H`
438
446
  vec4 vvColor() {
439
447
  return vvGetColor(instanceFeatureAttribute);
440
- }`:"vec4 vvColor() { return vec4(1.0); }"}
441
- `)):r.code.add(l.H`vec4 vvColor() { return vec4(1.0); }`)}},42583:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(66104),o=r(31821);function n(e){e.vertex.code.add(o.H`
442
- vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {
443
- float symbolAlpha = 0.0;
444
-
445
- const float maxTint = 85.0;
446
- const float maxReplace = 170.0;
447
- const float scaleAlpha = 3.0;
448
-
449
- if (symbolColor.a > maxReplace) {
450
- colorMixMode = ${o.H.int(i.k5.Multiply)};
451
- symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace);
452
- } else if (symbolColor.a > maxTint) {
453
- colorMixMode = ${o.H.int(i.k5.Replace)};
454
- symbolAlpha = scaleAlpha * (symbolColor.a - maxTint);
455
- } else if (symbolColor.a > 0.0) {
456
- colorMixMode = ${o.H.int(i.k5.Tint)};
457
- symbolAlpha = scaleAlpha * symbolColor.a;
458
- } else {
459
- colorMixMode = ${o.H.int(i.k5.Multiply)};
460
- symbolAlpha = 0.0;
461
- }
448
+ }
462
449
 
463
- return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha);
464
- }
465
- `)}},42593:(e,t,r)=>{r.d(t,{Q:()=>h});var i=r(31821);function o(e){const{fragment:t}=e;t.code.add(i.H`uint readChannelBits(uint channel, int highlightLevel) {
450
+ MaskedColor applyVVColor(MaskedColor color) {
451
+ return multiplyMaskedColors(color, createMaskedFromNaNColor(vvColor()));
452
+ }
453
+ `:d.H`
454
+ vec4 vvColor() {
455
+ return vec4(1.0);
456
+ }
457
+
458
+ MaskedColor applyVVColor(MaskedColor color) {
459
+ return color;
460
+ }
461
+ `}
462
+ `)):r.code.add(d.H`vec4 vvColor() {
463
+ return vec4(1.0);
464
+ }
465
+ MaskedColor applyVVColor(MaskedColor color) {
466
+ return color;
467
+ }`)}},42593:(e,t,r)=>{r.d(t,{Q:()=>h});var i=r(31821);function o(e){const{fragment:t}=e;t.code.add(i.H`uint readChannelBits(uint channel, int highlightLevel) {
466
468
  int llc = (highlightLevel & 3) << 1;
467
469
  return (channel >> llc) & 3u;
468
470
  }
@@ -502,18 +504,31 @@ float sceneDepth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x;
502
504
  return gl_FragCoord.z > sceneDepth + 5e-7;
503
505
  }`),r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {
504
506
  outputHighlight(isHighlightOccluded());
505
- }`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},42837:(e,t,r)=>{r.d(t,{n:()=>ee});var i,o,n,a=r(31821),s=r(12791),c=r(90237),l=r(34727),d=r(97768),u=r(36708),h=r(78659),m=r(10107),p=(r(44208),r(53966),r(87811),r(40608)),f=r(37585);r(9093),r(48353),r(9762),(n=i||(i={})).OPAQUE="opaque-color",n.TRANSPARENT="transparent-color",n.COMPOSITE="composite-color",n.FINAL="final-color",function(e){e.SSAO="ssao",e.LASERLINES="laserline-color",e.ANTIALIASING="aa-color",e.HIGHLIGHTS="highlight-color",e.MAGNIFIER="magnifier-color",e.OCCLUDED="occluded-color",e.VIEWSHED="viewshed-color",e.OPAQUE_TERRAIN="opaque-terrain-color",e.OPAQUE_ENVIRONMENT="opaque-environment-color",e.TRANSPARENT_ENVIRONMENT="transparent-environment-color",e.FOCUSAREA="focusarea",e.FOCUSAREA_COLOR="focusarea-color"}(o||(o={}));var v=r(69622),g=r(49186),_=r(89192);let T=class extends v.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=i.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,u.wB)((()=>this.view.ready),(e=>{e&&this.view.stage?.renderer.addRenderNode(this)}),u.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new g.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){e===_.C7.UPDATE&&this.view.stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find((({name:e})=>e===this.produces));try{return this.render(e)}finally{this._frameBuffer=null}}};(0,c._)([(0,m.MZ)({constructOnly:!0})],T.prototype,"view",void 0),(0,c._)([(0,m.MZ)({constructOnly:!0})],T.prototype,"consumes",void 0),(0,c._)([(0,m.MZ)()],T.prototype,"produces",void 0),(0,c._)([(0,m.MZ)({readOnly:!0})],T.prototype,"techniques",null),T=(0,c._)([(0,p.$)("esri.views.3d.webgl.RenderNode")],T);var x,E,b,A=r(63907),S=r(67171),M=r(12541);(b=x||(x={}))[b.R8UNORM=0]="R8UNORM",b[b.R8UINT=1]="R8UINT",b[b.RG8UNORM=2]="RG8UNORM",b[b.RG8UINT=3]="RG8UINT",b[b.RGBA4UNORM=4]="RGBA4UNORM",b[b.RGBA8UNORM=5]="RGBA8UNORM",b[b.RGBA8UNORM_MIPMAP=6]="RGBA8UNORM_MIPMAP",b[b.R16FLOAT=7]="R16FLOAT",b[b.RGBA16FLOAT=8]="RGBA16FLOAT",b[b.R32FLOAT=9]="R32FLOAT",b[b.COUNT=10]="COUNT",function(e){e[e.DEPTH16=10]="DEPTH16",e[e.DEPTH24_STENCIL8=11]="DEPTH24_STENCIL8"}(E||(E={})),x.R8UNORM,x.R8UINT,x.R16FLOAT,x.R32FLOAT,x.RG8UNORM,x.RG8UINT,x.RGBA8UNORM,x.RGBA4UNORM,x.RGBA8UNORM_MIPMAP,x.RGBA16FLOAT,E.DEPTH16,E.DEPTH24_STENCIL8;const w=new S.R;w.pixelFormat=A.Ab.RED,w.internalFormat=A.H0.R8,w.wrapMode=A.pF.CLAMP_TO_EDGE;const C=new S.R;C.pixelFormat=A.Ab.RED_INTEGER,C.internalFormat=A.H0.R8UI,C.wrapMode=A.pF.CLAMP_TO_EDGE,C.samplingMode=A.Cj.NEAREST;const R=new S.R;R.pixelFormat=A.Ab.RG,R.internalFormat=A.H0.RG8,R.wrapMode=A.pF.CLAMP_TO_EDGE;const O=new S.R;O.pixelFormat=A.Ab.RG_INTEGER,O.internalFormat=A.H0.RG8UI,O.wrapMode=A.pF.CLAMP_TO_EDGE,O.samplingMode=A.Cj.NEAREST;const I=new S.R;I.internalFormat=A.H0.RGBA4,I.dataType=A.ld.UNSIGNED_SHORT_4_4_4_4,I.wrapMode=A.pF.CLAMP_TO_EDGE;(new S.R).wrapMode=A.pF.CLAMP_TO_EDGE;const N=new S.R;N.wrapMode=A.pF.CLAMP_TO_EDGE,N.samplingMode=A.Cj.LINEAR_MIPMAP_LINEAR,N.hasMipmap=!0,N.maxAnisotropy=8;const y=new S.R;y.pixelFormat=A.Ab.RED,y.dataType=A.ld.HALF_FLOAT,y.internalFormat=A.H0.R16F,y.samplingMode=A.Cj.NEAREST;const P=new S.R;P.dataType=A.ld.HALF_FLOAT,P.internalFormat=A.H0.RGBA16F,P.wrapMode=A.pF.CLAMP_TO_EDGE;const D=new S.R;D.pixelFormat=A.Ab.RED,D.dataType=A.ld.FLOAT,D.internalFormat=A.H0.R32F,D.samplingMode=A.Cj.NEAREST,x.R8UNORM,x.R8UINT,x.RG8UNORM,x.RG8UINT,x.RGBA4UNORM,x.RGBA8UNORM,x.RGBA8UNORM_MIPMAP,x.R16FLOAT,x.RGBA16FLOAT,x.R32FLOAT,x.COUNT;const L={[A.SB.DEPTH_COMPONENT16]:A.ld.UNSIGNED_SHORT,[A.SB.DEPTH_COMPONENT24]:A.ld.UNSIGNED_INT,[A.SB.DEPTH_COMPONENT32F]:A.ld.FLOAT,[A.iE.DEPTH24_STENCIL8]:A.ld.UNSIGNED_INT_24_8,[A.iE.DEPTH32F_STENCIL8]:A.ld.FLOAT_32_UNSIGNED_INT_24_8_REV};function H(e){const t=new S.R;return t.pixelFormat=(0,M.CR)(e)?A.j7.DEPTH_COMPONENT:A.j7.DEPTH_STENCIL,t.dataType=L[e],t.samplingMode=A.Cj.NEAREST,t.wrapMode=A.pF.CLAMP_TO_EDGE,t.internalFormat=e,t.hasMipmap=!1,t.isImmutable=!0,t}E.DEPTH24_STENCIL8,H(A.iE.DEPTH24_STENCIL8),E.DEPTH16,H(A.SB.DEPTH_COMPONENT16);var F=r(97220),B=r(98958),U=r(95774),G=r(90644);class z extends B.w{constructor(e,t){super(e,t,new F.$(U.S,(()=>r.e(9384).then(r.bind(r,59384)))))}initializePipeline(){return(0,G.Ey)({colorWrite:G.kn})}}var V=r(48163),W=r(65786);class j extends W.Y{constructor(){super(...arguments),this.projScale=1}}class k extends j{constructor(){super(...arguments),this.intensity=1}}class $ extends W.Y{}class q extends ${constructor(){super(...arguments),this.blurSize=(0,V.vt)()}}var Y=r(15581);class X extends B.w{constructor(e,t){super(e,t,new F.$(Y.S,(()=>r.e(191).then(r.bind(r,90191)))))}initializePipeline(){return(0,G.Ey)({colorWrite:G.kn})}}var Z=r(21231);const J=2;let K=class extends T{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=o.SSAO,this.isEnabled=()=>!1,this._enableTime=(0,h.l5)(0),this._passParameters=new k,this._drawParameters=new q}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),(e=>e.charCodeAt(0))),t=new S.R(32);t.wrapMode=A.pF.CLAMP_TO_EDGE,t.pixelFormat=A.Ab.RGB,t.wrapMode=A.pF.REPEAT,t.hasMipmap=!0,this._passParameters.noiseTexture=new Z.g(this.renderingContext,t,e),this.techniques.precompile(X),this.techniques.precompile(z),this.addHandles((0,u.wB)((()=>this.isEnabled()),(()=>this._enableTime=(0,h.l5)(0))))}destroy(){this._passParameters.noiseTexture=(0,d.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find((({name:e})=>"normals"===e)),r=t?.getTexture(),i=t?.getTexture(A.nI);if(!r||!i)return;const n=this.techniques.get(X),a=this.techniques.get(z);if(!n.compiled||!a.compiled)return this._enableTime=(0,h.l5)(performance.now()),void this.requestRender(_.C7.UPDATE);0===this._enableTime&&(this._enableTime=(0,h.l5)(performance.now()));const s=this.renderingContext,c=this.view.qualitySettings.fadeDuration,d=this.bindParameters,u=d.camera,m=u.relativeElevation,p=(0,l.qE)((5e5-m)/2e5,0,1),v=c>0?Math.min(c,performance.now()-this._enableTime)/c:1,g=v*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/u.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*Q/(0,Y.g)(u)**6*g;const T=u.fullViewport[2],E=u.fullViewport[3],b=this.fboCache.acquire(T,E,"ssao input",x.RG8UNORM);s.bindFramebuffer(b.fbo),s.setViewport(0,0,T,E),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.screen.draw();const S=Math.round(T/J),M=Math.round(E/J),w=this.fboCache.acquire(S,M,"ssao blur",x.R8UNORM);s.bindFramebuffer(w.fbo),this._drawParameters.colorTexture=b.getTexture(),(0,f.hZ)(this._drawParameters.blurSize,0,J/E),s.bindTechnique(a,d,this._passParameters,this._drawParameters),s.setViewport(0,0,S,M),s.screen.draw(),b.release();const C=this.fboCache.acquire(S,M,o.SSAO,x.R8UNORM);return s.bindFramebuffer(C.fbo),s.setViewport(0,0,T,E),s.setClearColor(1,1,1,0),s.clear(A.NV.COLOR),this._drawParameters.colorTexture=w.getTexture(),(0,f.hZ)(this._drawParameters.blurSize,J/T,0),s.bindTechnique(a,d,this._passParameters,this._drawParameters),s.setViewport(0,0,S,M),s.screen.draw(),s.setViewport4fv(u.fullViewport),w.release(),v<1&&this.requestRender(_.C7.UPDATE),C}};(0,c._)([(0,m.MZ)()],K.prototype,"consumes",void 0),(0,c._)([(0,m.MZ)()],K.prototype,"produces",void 0),(0,c._)([(0,m.MZ)({constructOnly:!0})],K.prototype,"isEnabled",void 0),K=(0,c._)([(0,p.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],K);const Q=.5;function ee(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new s.x("ssaoTex",(e=>e.ssao?.getTexture()))),e.constants.add("blurSizePixelsInverse","float",1/J),e.code.add(a.H`float evaluateAmbientOcclusionInverse() {
507
+ }`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},42837:(e,t,r)=>{r.d(t,{n:()=>ee});var i,o,n,a=r(31821),s=r(12791),c=r(90237),l=r(34727),d=r(97768),u=r(36708),h=r(78659),m=r(10107),p=(r(44208),r(53966),r(87811),r(40608)),f=r(37585);r(9093),r(48353),r(9762),(n=i||(i={})).OPAQUE="opaque-color",n.TRANSPARENT="transparent-color",n.COMPOSITE="composite-color",n.FINAL="final-color",function(e){e.SSAO="ssao",e.LASERLINES="laserline-color",e.ANTIALIASING="aa-color",e.HIGHLIGHTS="highlight-color",e.MAGNIFIER="magnifier-color",e.OCCLUDED="occluded-color",e.VIEWSHED="viewshed-color",e.OPAQUE_TERRAIN="opaque-terrain-color",e.OPAQUE_ENVIRONMENT="opaque-environment-color",e.TRANSPARENT_ENVIRONMENT="transparent-environment-color",e.FOCUSAREA="focusarea",e.FOCUSAREA_COLOR="focusarea-color"}(o||(o={}));var v=r(69622),g=r(49186),_=r(89192);let T=class extends v.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=i.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,u.wB)((()=>this.view.ready),(e=>{e&&this.view.stage?.renderer.addRenderNode(this)}),u.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new g.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){e===_.C7.UPDATE&&this.view.stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find((({name:e})=>e===this.produces));try{return this.render(e)}finally{this._frameBuffer=null}}};(0,c._)([(0,m.MZ)({constructOnly:!0})],T.prototype,"view",void 0),(0,c._)([(0,m.MZ)({constructOnly:!0})],T.prototype,"consumes",void 0),(0,c._)([(0,m.MZ)()],T.prototype,"produces",void 0),(0,c._)([(0,m.MZ)({readOnly:!0})],T.prototype,"techniques",null),T=(0,c._)([(0,p.$)("esri.views.3d.webgl.RenderNode")],T);var x,E,b,A=r(63907),M=r(67171),S=r(12541);(b=x||(x={}))[b.R8UNORM=0]="R8UNORM",b[b.R8UINT=1]="R8UINT",b[b.RG8UNORM=2]="RG8UNORM",b[b.RG8UINT=3]="RG8UINT",b[b.RGBA4UNORM=4]="RGBA4UNORM",b[b.RGBA8UNORM=5]="RGBA8UNORM",b[b.RGBA8UNORM_MIPMAP=6]="RGBA8UNORM_MIPMAP",b[b.R16FLOAT=7]="R16FLOAT",b[b.RGBA16FLOAT=8]="RGBA16FLOAT",b[b.R32FLOAT=9]="R32FLOAT",b[b.COUNT=10]="COUNT",function(e){e[e.DEPTH16=10]="DEPTH16",e[e.DEPTH24_STENCIL8=11]="DEPTH24_STENCIL8"}(E||(E={})),x.R8UNORM,x.R8UINT,x.R16FLOAT,x.R32FLOAT,x.RG8UNORM,x.RG8UINT,x.RGBA8UNORM,x.RGBA4UNORM,x.RGBA8UNORM_MIPMAP,x.RGBA16FLOAT,E.DEPTH16,E.DEPTH24_STENCIL8;const C=new M.R;C.pixelFormat=A.Ab.RED,C.internalFormat=A.H0.R8,C.wrapMode=A.pF.CLAMP_TO_EDGE;const w=new M.R;w.pixelFormat=A.Ab.RED_INTEGER,w.internalFormat=A.H0.R8UI,w.wrapMode=A.pF.CLAMP_TO_EDGE,w.samplingMode=A.Cj.NEAREST;const R=new M.R;R.pixelFormat=A.Ab.RG,R.internalFormat=A.H0.RG8,R.wrapMode=A.pF.CLAMP_TO_EDGE;const O=new M.R;O.pixelFormat=A.Ab.RG_INTEGER,O.internalFormat=A.H0.RG8UI,O.wrapMode=A.pF.CLAMP_TO_EDGE,O.samplingMode=A.Cj.NEAREST;const I=new M.R;I.internalFormat=A.H0.RGBA4,I.dataType=A.ld.UNSIGNED_SHORT_4_4_4_4,I.wrapMode=A.pF.CLAMP_TO_EDGE;(new M.R).wrapMode=A.pF.CLAMP_TO_EDGE;const N=new M.R;N.wrapMode=A.pF.CLAMP_TO_EDGE,N.samplingMode=A.Cj.LINEAR_MIPMAP_LINEAR,N.hasMipmap=!0,N.maxAnisotropy=8;const y=new M.R;y.pixelFormat=A.Ab.RED,y.dataType=A.ld.HALF_FLOAT,y.internalFormat=A.H0.R16F,y.samplingMode=A.Cj.NEAREST;const P=new M.R;P.dataType=A.ld.HALF_FLOAT,P.internalFormat=A.H0.RGBA16F,P.wrapMode=A.pF.CLAMP_TO_EDGE;const D=new M.R;D.pixelFormat=A.Ab.RED,D.dataType=A.ld.FLOAT,D.internalFormat=A.H0.R32F,D.samplingMode=A.Cj.NEAREST,x.R8UNORM,x.R8UINT,x.RG8UNORM,x.RG8UINT,x.RGBA4UNORM,x.RGBA8UNORM,x.RGBA8UNORM_MIPMAP,x.R16FLOAT,x.RGBA16FLOAT,x.R32FLOAT,x.COUNT;const L={[A.SB.DEPTH_COMPONENT16]:A.ld.UNSIGNED_SHORT,[A.SB.DEPTH_COMPONENT24]:A.ld.UNSIGNED_INT,[A.SB.DEPTH_COMPONENT32F]:A.ld.FLOAT,[A.iE.DEPTH24_STENCIL8]:A.ld.UNSIGNED_INT_24_8,[A.iE.DEPTH32F_STENCIL8]:A.ld.FLOAT_32_UNSIGNED_INT_24_8_REV};function H(e){const t=new M.R;return t.pixelFormat=(0,S.CR)(e)?A.j7.DEPTH_COMPONENT:A.j7.DEPTH_STENCIL,t.dataType=L[e],t.samplingMode=A.Cj.NEAREST,t.wrapMode=A.pF.CLAMP_TO_EDGE,t.internalFormat=e,t.hasMipmap=!1,t.isImmutable=!0,t}E.DEPTH24_STENCIL8,H(A.iE.DEPTH24_STENCIL8),E.DEPTH16,H(A.SB.DEPTH_COMPONENT16);var F=r(97220),B=r(98958),U=r(95774),G=r(90644);class z extends B.w{constructor(e,t){super(e,t,new F.$(U.S,(()=>r.e(9384).then(r.bind(r,59384)))))}initializePipeline(){return(0,G.Ey)({colorWrite:G.kn})}}var V=r(48163),W=r(65786);class j extends W.Y{constructor(){super(...arguments),this.projScale=1}}class k extends j{constructor(){super(...arguments),this.intensity=1}}class $ extends W.Y{}class q extends ${constructor(){super(...arguments),this.blurSize=(0,V.vt)()}}var Y=r(15581);class X extends B.w{constructor(e,t){super(e,t,new F.$(Y.S,(()=>r.e(191).then(r.bind(r,90191)))))}initializePipeline(){return(0,G.Ey)({colorWrite:G.kn})}}var Z=r(21231);const J=2;let K=class extends T{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=o.SSAO,this.isEnabled=()=>!1,this._enableTime=(0,h.l5)(0),this._passParameters=new k,this._drawParameters=new q}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),(e=>e.charCodeAt(0))),t=new M.R(32);t.wrapMode=A.pF.CLAMP_TO_EDGE,t.pixelFormat=A.Ab.RGB,t.wrapMode=A.pF.REPEAT,t.hasMipmap=!0,this._passParameters.noiseTexture=new Z.g(this.renderingContext,t,e),this.techniques.precompile(X),this.techniques.precompile(z),this.addHandles((0,u.wB)((()=>this.isEnabled()),(()=>this._enableTime=(0,h.l5)(0))))}destroy(){this._passParameters.noiseTexture=(0,d.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find((({name:e})=>"normals"===e)),r=t?.getTexture(),i=t?.getTexture(A.nI);if(!r||!i)return;const n=this.techniques.get(X),a=this.techniques.get(z);if(!n.compiled||!a.compiled)return this._enableTime=(0,h.l5)(performance.now()),void this.requestRender(_.C7.UPDATE);0===this._enableTime&&(this._enableTime=(0,h.l5)(performance.now()));const s=this.renderingContext,c=this.view.qualitySettings.fadeDuration,d=this.bindParameters,u=d.camera,m=u.relativeElevation,p=(0,l.qE)((5e5-m)/2e5,0,1),v=c>0?Math.min(c,performance.now()-this._enableTime)/c:1,g=v*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/u.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*Q/(0,Y.g)(u)**6*g;const T=u.fullViewport[2],E=u.fullViewport[3],b=this.fboCache.acquire(T,E,"ssao input",x.RG8UNORM);s.bindFramebuffer(b.fbo),s.setViewport(0,0,T,E),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.screen.draw();const M=Math.round(T/J),S=Math.round(E/J),C=this.fboCache.acquire(M,S,"ssao blur",x.R8UNORM);s.bindFramebuffer(C.fbo),this._drawParameters.colorTexture=b.getTexture(),(0,f.hZ)(this._drawParameters.blurSize,0,J/E),s.bindTechnique(a,d,this._passParameters,this._drawParameters),s.setViewport(0,0,M,S),s.screen.draw(),b.release();const w=this.fboCache.acquire(M,S,o.SSAO,x.R8UNORM);return s.bindFramebuffer(w.fbo),s.setViewport(0,0,T,E),s.setClearColor(1,1,1,0),s.clear(A.NV.COLOR),this._drawParameters.colorTexture=C.getTexture(),(0,f.hZ)(this._drawParameters.blurSize,J/T,0),s.bindTechnique(a,d,this._passParameters,this._drawParameters),s.setViewport(0,0,M,S),s.screen.draw(),s.setViewport4fv(u.fullViewport),C.release(),v<1&&this.requestRender(_.C7.UPDATE),w}};(0,c._)([(0,m.MZ)()],K.prototype,"consumes",void 0),(0,c._)([(0,m.MZ)()],K.prototype,"produces",void 0),(0,c._)([(0,m.MZ)({constructOnly:!0})],K.prototype,"isEnabled",void 0),K=(0,c._)([(0,p.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],K);const Q=.5;function ee(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new s.x("ssaoTex",(e=>e.ssao?.getTexture()))),e.constants.add("blurSizePixelsInverse","float",1/J),e.code.add(a.H`float evaluateAmbientOcclusionInverse() {
506
508
  vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
507
509
  return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
508
510
  }
509
511
  float evaluateAmbientOcclusion() {
510
512
  return 1.0 - evaluateAmbientOcclusionInverse();
511
513
  }`)):e.code.add(a.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
512
- float evaluateAmbientOcclusion() { return 0.0; }`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>s,Um:()=>c,kE:()=>a});var i=r(4576),o=r(34727),n=r(77194);function a(e,t,r,i,a){let s=r.screenLength*e.pixelRatio;null!=a&&(s=(0,n.hs)(s,i,t,a));const c=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.qE)(c*t,r.minWorldLength,r.maxWorldLength)}function s(e,t){let r=!1;for(const o in t){const n=t[o];void 0!==n&&(Array.isArray(n)?Array.isArray(e[o])&&(0,i.aI)(n,e[o])||(e[o]=n.slice(),r=!0):e[o]!==n&&(r=!0,e[o]=n))}return r}const c={multiply:1,ignore:2,replace:3,tint:4}},46140:(e,t,r)=>{r.d(t,{R:()=>o});var i=r(49186);let o=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[o,n]=t.split("."),a=/^\s*\d+\s*$/;if(!o?.match||!a.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!n?.match||!a.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(o,10),c=parseInt(n,10);return new e(s,c,r)}}},46686:(e,t,r)=>{r.d(t,{i$:()=>l,oD:()=>d,xJ:()=>c});var i=r(49255),o=r(33752),n=r(77108),a=r(31821);function s(e){e.varyings.add("linearDepth","float",{invariant:!0})}function c(e){e.vertex.uniforms.add(new n.E("nearFar",(e=>e.camera.nearFar)))}function l(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
514
+ float evaluateAmbientOcclusion() { return 0.0; }`)}},43519:(e,t,r)=>{r.d(t,{ML:()=>a,WD:()=>o,Y1:()=>n,oF:()=>s});var i=r(31821);function o(e){e.code.add(i.H`struct MaskedColor {
515
+ vec4 color;
516
+ bvec4 mask;
517
+ };`)}function n(e){e.include(o),e.code.add(i.H`
518
+ MaskedColor createMaskedFromUInt8NaNColor(vec4 color) {
519
+ return MaskedColor(color * ${i.H.float(1/254)}, equal(color, vec4(255)));
520
+ }
521
+ `)}function a(e){e.include(o),e.code.add(i.H`MaskedColor multiplyMaskedColors(MaskedColor color1, MaskedColor color2) {
522
+ vec4 masked1 = mix(color1.color, vec4(1), color1.mask);
523
+ vec4 masked2 = mix(color2.color, vec4(1), color2.mask);
524
+ return MaskedColor(masked1 * masked2, bvec4(ivec4(color1.mask) & ivec4(color2.mask)));
525
+ }`)}function s(e){e.include(o),e.code.add(i.H`MaskedColor createMaskedFromNaNColor(vec4 color) {
526
+ return MaskedColor(color, isnan(color));
527
+ }`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>s,Um:()=>c,kE:()=>a});var i=r(4576),o=r(34727),n=r(77194);function a(e,t,r,i,a){let s=r.screenLength*e.pixelRatio;null!=a&&(s=(0,n.hs)(s,i,t,a));const c=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.qE)(c*t,r.minWorldLength,r.maxWorldLength)}function s(e,t){let r=!1;for(const o in t){const n=t[o];void 0!==n&&(Array.isArray(n)?Array.isArray(e[o])&&(0,i.aI)(n,e[o])||(e[o]=n.slice(),r=!0):e[o]!==n&&(r=!0,e[o]=n))}return r}const c={multiply:1,ignore:2,replace:3,tint:4}},46140:(e,t,r)=>{r.d(t,{R:()=>o});var i=r(49186);let o=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[o,n]=t.split("."),a=/^\s*\d+\s*$/;if(!o?.match||!a.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!n?.match||!a.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(o,10),c=parseInt(n,10);return new e(s,c,r)}}},46686:(e,t,r)=>{r.d(t,{i$:()=>l,oD:()=>d,xJ:()=>c});var i=r(49255),o=r(33752),n=r(77108),a=r(31821);function s(e){e.varyings.add("linearDepth","float",{invariant:!0})}function c(e){e.vertex.uniforms.add(new n.E("nearFar",(e=>e.camera.nearFar)))}function l(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
513
528
  return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
514
529
  }`)}function d(e,t){const{vertex:r}=e;switch(t.output){case i.V.Color:case i.V.ColorEmission:if(t.receiveShadows)return s(e),void r.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.V.Shadow:case i.V.ShadowHighlight:case i.V.ShadowExcludeHighlight:case i.V.ViewshedShadow:return e.include(o.em,t),s(e),c(e),l(e),void r.code.add(a.H`void forwardLinearDepth() {
515
530
  linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
516
- }`)}r.code.add(a.H`void forwardLinearDepth() {}`)}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec2",i.c.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},48833:(e,t,r)=>{r.d(t,{g:()=>U}),r(44208);var i=r(49186),o=r(65529),n=r(97768),a=r(74887),s=r(34275),c=r(24326),l=r(84952),d=r(38969),u=r(99677),h=r(56058),m=r(89192),p=r(2741);let f;var v=r(92993),g=r(63907),_=r(21231),T=r(42293);let x=null,E=null;async function b(){return null==E&&(f??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,p.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),E=f,x=await E),E}function A(e,t,r,i,o){const n=(0,T.IB)(t?g.CQ.COMPRESSED_RGBA8_ETC2_EAC:g.CQ.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function S(e){return e.getNumImages()>=1&&!e.isUASTC()}function M(e){return e.getFaces()>=1&&e.isETC1S()}function w(e,t,r,i,o,n,a,s){const{compressedTextureETC:c,compressedTextureS3TC:l}=e.capabilities,[d,u]=c?i?[v.n.ETC2_RGBA,g.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[v.n.ETC1_RGB,g.CQ.COMPRESSED_RGB8_ETC2]:l?i?[v.n.BC3_RGBA,g.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[v.n.BC1_RGB,g.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[v.n.RGBA32,g.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?g.Cj.LINEAR_MIPMAP_LINEAR:g.Cj.LINEAR,t.width=o,t.height=n,new _.g(e,t,{type:"compressed",levels:m})}var C=r(53966);const R=()=>C.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function O(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const I=O("DXT1"),N=O("DXT3"),y=O("DXT5");function P(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function D(e,t){const[r,i]=L(e,t);return e.width===r&&e.height===i?e:H(e,r,i)}function L({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const o=Math.max(e,t),n=e*t;if(o<=i&&n<=r)return[e,t];const a=Math.min(Math.sqrt(r/n),i/o);return[P(Math.round(e*a),i),P(Math.round(t*a),i)]}function H(e,t,r){if(e instanceof ImageData)return H(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(e,0,0,o.width,o.height),o}var F=r(620),B=r(67171);class U{constructor(e,t){this._data=e,this.id=(0,c.c)(),this.events=new o.A,this._parameters={...z,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,l.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,(e=>t.push(e))).then((()=>{e.play()})).finally((()=>t.forEach((e=>e.remove()))))}}_startPreloadImageElement(e){(0,l.DB)(e.src)||(0,l.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new B.R;return t.wrapMode=this._parameters.wrap??g.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?g.Cj.LINEAR_MIPMAP_LINEAR:g.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture??this._emptyTexture}get loaded(){return null!=this._glTexture}get usedMemory(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return t.encoding===m.JS.KTX2_ENCODING?function(e,t){if(null==x)return e.byteLength;const r=new x.KTX2File(new Uint8Array(e)),i=M(r)?A(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===m.JS.BASIS_ENCODING?function(e,t){if(null==x)return e.byteLength;const r=new x.BasisFile(new Uint8Array(e)),i=S(r)?A(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?G(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._glTexture)return this._glTexture;const t=this._data;return null==t?(this._glTexture=new _.g(e,this._createDescriptor(e),null),this._glTexture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&this._parameters.encoding===m.JS.DDS_ENCODING?this._loadFromDDSData(e,t):(0,s.mw)(t)&&this._parameters.encoding===m.JS.DDS_ENCODING?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&this._parameters.encoding===m.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&this._parameters.encoding===m.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,s.mg)(t)?this._loadFromPixelData(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_update(e,t){return null==this._glTexture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return R().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return R().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case I:o=8,n=g.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case N:o=16,n=g.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case y:o=16,n=g.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return R().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],c=r[3];(3&s||3&c)&&(R().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,c=c+3&-4);const l=s,d=c;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<a;++t)h=(s+3>>2)*(c+3>>2)*o,u=new Uint8Array(e.buffer,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:p},internalFormat:n,width:l,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?g.Cj.LINEAR_MIPMAP_LINEAR:g.Cj.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new _.g(e,t,o)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==x&&(x=await b());const i=new x.KTX2File(new Uint8Array(r));if(!M(i))return null;i.startTranscoding();const o=w(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==x&&(x=await b());const i=new x.BasisFile(new Uint8Array(r));if(!S(i))return null;i.startTranscoding();const o=w(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,F.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?g.Ab.LUMINANCE:3===this._parameters.components?g.Ab.RGB:g.Ab.RGBA,r.pixelFormat!==g.Ab.RGB&&r.pixelFormat!==g.Ab.RGBA||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new _.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,h.Sx)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((o,s)=>{const c=()=>{t.removeEventListener("loadeddata",l),t.removeEventListener("error",d),(0,n.xt)(u)},l=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),o(this._loadFromImage(e,t)))},d=e=>{c(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",l),t.addEventListener("error",d);const u=(0,a.u7)(r,(()=>d((0,a.NK)())))}))))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=D(r,e.parameters));const i=G(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this._parameters.components?g.Ab.RGB:g.Ab.RGBA,o.width=i.width,o.height=i.height,o.compress=this._parameters.compressionOptions,this._glTexture=new _.g(e,o,r),this._emptyTexture=null,this.events.emit("loaded"),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._glTexture=(0,n.WD)(this._glTexture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function G(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const z={wrap:{s:g.pF.REPEAT,t:g.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},49255:(e,t,r)=>{var i;function o(e){return e===i.Shadow||e===i.ShadowHighlight||e===i.ShadowExcludeHighlight||e===i.ViewshedShadow}function n(e){return function(e){return function(e){return c(e)||s(e)}(e)||u(e)}(e)||e===i.Normal}function a(e){return function(e){return d(e)||u(e)}(e)||e===i.Normal}function s(e){return e===i.Highlight||e===i.ObjectAndLayerIdColor}function c(e){return e===i.Color}function l(e){return c(e)||h(e)}function d(e){return l(e)||s(e)}function u(e){return e===i.Depth}function h(e){return e===i.ColorEmission}function m(e){switch(e){case i.Depth:case i.Shadow:case i.ShadowHighlight:case i.ShadowExcludeHighlight:case i.ViewshedShadow:return!0}return!1}r.d(t,{LG:()=>h,Mb:()=>d,PJ:()=>o,RN:()=>l,V:()=>i,Vg:()=>m,XY:()=>n,iq:()=>a}),function(e){e[e.Color=0]="Color",e[e.ColorEmission=1]="ColorEmission",e[e.Depth=2]="Depth",e[e.Normal=3]="Normal",e[e.Shadow=4]="Shadow",e[e.ShadowHighlight=5]="ShadowHighlight",e[e.ShadowExcludeHighlight=6]="ShadowExcludeHighlight",e[e.ViewshedShadow=7]="ViewshedShadow",e[e.Highlight=8]="Highlight",e[e.ObjectAndLayerIdColor=9]="ObjectAndLayerIdColor",e[e.COUNT=10]="COUNT"}(i||(i={}))},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51406:(e,t,r)=>{r.d(t,{MU:()=>l,O1:()=>d,QM:()=>u,Sx:()=>c,q2:()=>s});var i=r(29242),o=r(53466),n=r(31821),a=r(35644);function s(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new a.k("colorTextureTransformMatrix",(e=>e.colorTextureTransformMatrix??i.zK))).code.add(n.H`void forwardColorUV(){
531
+ }`)}r.code.add(a.H`void forwardLinearDepth() {}`)}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"vec2",i.c.Pass,((i,o,n)=>i.setUniform2fv(e,t(o,n),r)))}}},48833:(e,t,r)=>{r.d(t,{g:()=>U}),r(44208);var i=r(49186),o=r(65529),n=r(97768),a=r(74887),s=r(34275),c=r(24326),l=r(84952),d=r(38969),u=r(99677),h=r(56058),m=r(89192),p=r(2741);let f;var v=r(92993),g=r(63907),_=r(21231),T=r(42293);let x=null,E=null;async function b(){return null==E&&(f??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,p.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),E=f,x=await E),E}function A(e,t,r,i,o){const n=(0,T.IB)(t?g.CQ.COMPRESSED_RGBA8_ETC2_EAC:g.CQ.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function M(e){return e.getNumImages()>=1&&!e.isUASTC()}function S(e){return e.getFaces()>=1&&e.isETC1S()}function C(e,t,r,i,o,n,a,s){const{compressedTextureETC:c,compressedTextureS3TC:l}=e.capabilities,[d,u]=c?i?[v.n.ETC2_RGBA,g.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[v.n.ETC1_RGB,g.CQ.COMPRESSED_RGB8_ETC2]:l?i?[v.n.BC3_RGBA,g.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[v.n.BC1_RGB,g.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[v.n.RGBA32,g.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?g.Cj.LINEAR_MIPMAP_LINEAR:g.Cj.LINEAR,t.width=o,t.height=n,new _.g(e,t,{type:"compressed",levels:m})}var w=r(53966);const R=()=>w.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function O(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const I=O("DXT1"),N=O("DXT3"),y=O("DXT5");function P(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function D(e,t){const[r,i]=L(e,t);return e.width===r&&e.height===i?e:H(e,r,i)}function L({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const o=Math.max(e,t),n=e*t;if(o<=i&&n<=r)return[e,t];const a=Math.min(Math.sqrt(r/n),i/o);return[P(Math.round(e*a),i),P(Math.round(t*a),i)]}function H(e,t,r){if(e instanceof ImageData)return H(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(e,0,0,o.width,o.height),o}var F=r(620),B=r(67171);class U{constructor(e,t){this._data=e,this.id=(0,c.c)(),this.events=new o.A,this._parameters={...z,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,l.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,(e=>t.push(e))).then((()=>{e.play()})).finally((()=>t.forEach((e=>e.remove()))))}}_startPreloadImageElement(e){(0,l.DB)(e.src)||(0,l.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new B.R;return t.wrapMode=this._parameters.wrap??g.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?g.Cj.LINEAR_MIPMAP_LINEAR:g.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture??this._emptyTexture}get loaded(){return null!=this._glTexture}get usedMemory(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return t.encoding===m.JS.KTX2_ENCODING?function(e,t){if(null==x)return e.byteLength;const r=new x.KTX2File(new Uint8Array(e)),i=S(r)?A(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===m.JS.BASIS_ENCODING?function(e,t){if(null==x)return e.byteLength;const r=new x.BasisFile(new Uint8Array(e)),i=M(r)?A(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?G(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._glTexture)return this._glTexture;const t=this._data;return null==t?(this._glTexture=new _.g(e,this._createDescriptor(e),null),this._glTexture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&this._parameters.encoding===m.JS.DDS_ENCODING?this._loadFromDDSData(e,t):(0,s.mw)(t)&&this._parameters.encoding===m.JS.DDS_ENCODING?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&this._parameters.encoding===m.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&this._parameters.encoding===m.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,s.mg)(t)?this._loadFromPixelData(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_update(e,t){return null==this._glTexture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return R().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return R().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case I:o=8,n=g.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case N:o=16,n=g.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case y:o=16,n=g.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return R().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],c=r[3];(3&s||3&c)&&(R().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,c=c+3&-4);const l=s,d=c;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<a;++t)h=(s+3>>2)*(c+3>>2)*o,u=new Uint8Array(e.buffer,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:p},internalFormat:n,width:l,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?g.Cj.LINEAR_MIPMAP_LINEAR:g.Cj.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new _.g(e,t,o)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==x&&(x=await b());const i=new x.KTX2File(new Uint8Array(r));if(!S(i))return null;i.startTranscoding();const o=C(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==x&&(x=await b());const i=new x.BasisFile(new Uint8Array(r));if(!M(i))return null;i.startTranscoding();const o=C(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,F.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?g.Ab.LUMINANCE:3===this._parameters.components?g.Ab.RGB:g.Ab.RGBA,r.pixelFormat!==g.Ab.RGB&&r.pixelFormat!==g.Ab.RGBA||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new _.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,h.Sx)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((o,s)=>{const c=()=>{t.removeEventListener("loadeddata",l),t.removeEventListener("error",d),(0,n.xt)(u)},l=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),o(this._loadFromImage(e,t)))},d=e=>{c(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",l),t.addEventListener("error",d);const u=(0,a.u7)(r,(()=>d((0,a.NK)())))}))))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=D(r,e.parameters));const i=G(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this._parameters.components?g.Ab.RGB:g.Ab.RGBA,o.width=i.width,o.height=i.height,o.compress=this._parameters.compressionOptions,this._glTexture=new _.g(e,o,r),this._emptyTexture=null,this.events.emit("loaded"),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._glTexture=(0,n.WD)(this._glTexture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function G(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const z={wrap:{s:g.pF.REPEAT,t:g.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},49255:(e,t,r)=>{var i;function o(e){return e===i.Shadow||e===i.ShadowHighlight||e===i.ShadowExcludeHighlight||e===i.ViewshedShadow}function n(e){return function(e){return function(e){return c(e)||s(e)}(e)||u(e)}(e)||e===i.Normal}function a(e){return function(e){return d(e)||u(e)}(e)||e===i.Normal}function s(e){return e===i.Highlight||e===i.ObjectAndLayerIdColor}function c(e){return e===i.Color}function l(e){return c(e)||h(e)}function d(e){return l(e)||s(e)}function u(e){return e===i.Depth}function h(e){return e===i.ColorEmission}function m(e){switch(e){case i.Depth:case i.Shadow:case i.ShadowHighlight:case i.ShadowExcludeHighlight:case i.ViewshedShadow:return!0}return!1}r.d(t,{LG:()=>h,Mb:()=>d,PJ:()=>o,RN:()=>l,V:()=>i,Vg:()=>m,XY:()=>n,iq:()=>a}),function(e){e[e.Color=0]="Color",e[e.ColorEmission=1]="ColorEmission",e[e.Depth=2]="Depth",e[e.Normal=3]="Normal",e[e.Shadow=4]="Shadow",e[e.ShadowHighlight=5]="ShadowHighlight",e[e.ShadowExcludeHighlight=6]="ShadowExcludeHighlight",e[e.ViewshedShadow=7]="ViewshedShadow",e[e.Highlight=8]="Highlight",e[e.ObjectAndLayerIdColor=9]="ObjectAndLayerIdColor",e[e.COUNT=10]="COUNT"}(i||(i={}))},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51406:(e,t,r)=>{r.d(t,{MU:()=>l,O1:()=>d,QM:()=>u,Sx:()=>c,q2:()=>s});var i=r(29242),o=r(53466),n=r(31821),a=r(35644);function s(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new a.k("colorTextureTransformMatrix",(e=>e.colorTextureTransformMatrix??i.zK))).code.add(n.H`void forwardColorUV(){
517
532
  colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
518
533
  }`)):e.vertex.code.add(n.H`void forwardColorUV(){}`)}function c(e,t){t.hasNormalTextureTransform&&t.textureCoordinateType!==o.I.None?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new a.k("normalTextureTransformMatrix",(e=>e.normalTextureTransformMatrix??i.zK))).code.add(n.H`void forwardNormalUV(){
519
534
  normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
@@ -523,7 +538,7 @@ emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
523
538
  occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
524
539
  }`)):e.vertex.code.add(n.H`void forwardOcclusionUV(){}`)}function u(e,t){t.hasMetallicRoughnessTextureTransform&&t.textureCoordinateType!==o.I.None?(e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.uniforms.add(new a.k("metallicRoughnessTextureTransformMatrix",(e=>e.metallicRoughnessTextureTransformMatrix??i.zK))).code.add(n.H`void forwardMetallicRoughnessUV(){
525
540
  metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
526
- }`)):e.vertex.code.add(n.H`void forwardMetallicRoughnessUV(){}`)}},51768:(e,t,r)=>{r.d(t,{$U:()=>Ae,fs:()=>Me,ty:()=>we});var i=r(38954),o=r(51850),n=r(67222),a=r(24151),s=r(1843),c=r(49255),l=r(96336),d=r(22911),u=r(62602),h=r(59469),m=r(16943),p=r(89192),f=r(25634),v=r(11725),g=r(33524),_=r(70328),T=r(75039),x=r(620),E=r(46540);class b{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const A=(0,_.vt)();function S(e,t,r,o,n,a){if(!e.visible)return;const s=(0,i.a)(B,o,r),c=(e,t,r)=>{a(e,r,t)},l=new b(!1,t.options.normalRequired);if(e.boundingInfo){(0,x.vA)(e.type===T.d.Mesh);const i=t.tolerance;w(e.boundingInfo,r,s,i,n,l,c)}else{const t=e.attributes.get(E.r.POSITION),o=t.indices;!function(e,t,r,o,n,a,s,c,l,d){const u=t,h=U,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),v=m>=p?m>=f?0:2:p>=f?1:2,g=v,_=u[g]<0?2:1,T=(v+_)%3,x=(v+(3-_))%3,E=u[T]/u[g],b=u[x]/u[g],A=1/u[g],S=O,M=I,w=N,{normalRequired:C}=l;for(let t=r;t<o;++t){const r=3*t,o=s*n[r];(0,i.i)(h[0],a[o+0],a[o+1],a[o+2]);const l=s*n[r+1];(0,i.i)(h[1],a[l+0],a[l+1],a[l+2]);const u=s*n[r+2];(0,i.i)(h[2],a[u+0],a[u+1],a[u+2]),c&&((0,i.c)(h[0],c.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],c.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],c.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(S,h[0],e),(0,i.a)(M,h[1],e),(0,i.a)(w,h[2],e);const m=S[T]-E*S[g],p=S[x]-b*S[g],f=M[T]-E*M[g],v=M[x]-b*M[g],_=w[T]-E*w[g],R=w[x]-b*w[g],O=_*v-R*f,I=m*R-p*_,N=f*p-v*m;if((O<0||I<0||N<0)&&(O>0||I>0||N>0))continue;const y=O+I+N;if(0===y)continue;const D=O*(A*S[g])+I*(A*M[g])+N*(A*w[g]);if(D*Math.sign(y)<0)continue;const L=D/y;L>=0&&d(L,t,C?P(h):null)}}(r,s,0,o.length/3,o,t.data,t.stride,n,l,c)}}const M=(0,o.vt)();function w(e,t,r,o,n,a,s){if(null==e)return;const c=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,M);if((0,_.Ne)(A,e.bbMin),(0,_.vI)(A,e.bbMax),null!=n&&n.applyToAabb(A),function(e,t,r,i){return function(e,t,r,i){const o=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let a=Math.min(o,n),s=Math.max(o,n);const c=(e[1]-i-t[1])*r[1],l=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(c,l)),s<0)return!1;if(a=Math.max(a,Math.min(c,l)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(A,t,c,o)){const{primitiveIndices:i,position:c}=e,l=i?i.length:c.indices.length/3;if(l>H){const i=e.getChildren();if(void 0!==i){for(const e of i)w(e,t,r,o,n,a,s);return}}!function(e,t,r,i,o,n,a,s,c,l,d){const u=e[0],h=e[1],m=e[2],p=t[0],f=t[1],v=t[2],{normalRequired:g}=l;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*o[r];let l=n[i],_=n[i+1],T=n[i+2];const x=a*o[r+1];let E=n[x],b=n[x+1],A=n[x+2];const S=a*o[r+2];let M=n[S],w=n[S+1],R=n[S+2];null!=c&&([l,_,T]=c.applyToVertex(l,_,T,e),[E,b,A]=c.applyToVertex(E,b,A,e),[M,w,R]=c.applyToVertex(M,w,R,e));const O=E-l,I=b-_,N=A-T,P=M-l,D=w-_,L=R-T,H=f*L-D*v,B=v*P-L*p,U=p*D-P*f,G=O*H+I*B+N*U;if(Math.abs(G)<=F)continue;const z=u-l,V=h-_,W=m-T,j=z*H+V*B+W*U;if(G>0){if(j<0||j>G)continue}else if(j>0||j<G)continue;const k=V*N-I*W,$=W*O-N*z,q=z*I-O*V,Y=p*k+f*$+v*q;if(G>0){if(Y<0||j+Y>G)continue}else if(Y>0||j+Y<G)continue;const X=(P*k+D*$+L*q)/G;X>=0&&d(X,t,g?y(O,I,N,P,D,L,C):null)}}(t,r,0,l,c.indices,c.data,c.stride,i,n,a,s)}}const C=(0,o.vt)();function R(e,t,r,i,o,n,a,s){const c=e[0],l=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,p=n*t,f=o[p],v=o[p+1],g=o[p+2],_=n*r,T=n*i,x=o[_]-f,E=o[_+1]-v,b=o[_+2]-g,A=o[T]-f,S=o[T+1]-v,M=o[T+2]-g,w=h*M-S*m,R=m*A-M*u,O=u*S-A*h,I=x*w+E*R+b*O;if(Math.abs(I)<=F)continue;const N=c-f,P=l-v,D=d-g,L=N*w+P*R+D*O;if(I>0){if(L<0||L>I)continue}else if(L>0||L<I)continue;const H=P*b-E*D,B=D*x-b*N,U=N*E-x*P,G=u*H+h*B+m*U;if(I>0){if(G<0||L+G>I)continue}else if(G>0||L+G<I)continue;const z=(A*H+S*B+M*U)/I;z>=0&&s(z,e,a?y(x,E,b,A,S,M,C):null)}}const O=(0,o.vt)(),I=(0,o.vt)(),N=(0,o.vt)();function y(e,t,r,o,n,a,s){return(0,i.i)(D,e,t,r),(0,i.i)(L,o,n,a),(0,i.h)(s,D,L),(0,i.n)(s,s),s}function P(e){return(0,i.a)(D,e[1],e[0]),(0,i.a)(L,e[2],e[0]),(0,i.h)(C,D,L),(0,i.n)(C,C),C}const D=(0,o.vt)(),L=(0,o.vt)(),H=1e3,F=1e-7,B=(0,o.vt)(),U=[(0,o.vt)(),(0,o.vt)(),(0,o.vt)()];var G=r(13464),z=(r(77690),r(29242),r(58083),r(9093),r(97937)),V=r(57005);const W=new class{constructor(e=0){this.offset=e,this.sphere=(0,z.c)(),this.tmpVertex=(0,o.vt)()}applyToVertex(e,t,r){const o=this.objectTransform.transform,n=(0,i.i)(j,e,t,r),a=(0,i.t)(n,n,o),s=this.offset/(0,i.l)(a);(0,i.b)(a,a,a,s);const c=this.objectTransform.inverse;return(0,i.t)(this.tmpVertex,a,c),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,i.l)(e);(0,i.b)(e,e,e,r);const o=this.offset/(0,i.l)(t);(0,i.b)(t,t,t,o)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,i.l)((0,z.a)(e)),r=this.offset/t;return(0,i.b)((0,z.a)(this.sphere),(0,z.a)(e),(0,z.a)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,o.vt)(),this._tmpMbs=(0,z.c)(),this._tmpObb=new V.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,i.l)(e)}applyToVertex(e,t,r){const o=(0,i.i)(j,e,t,r),n=(0,i.i)(k,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,i.l)(n);return(0,i.b)(this._tmpVertex,o,n,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,n=e[3],a=e[4],s=e[5]+t,c=Math.abs(r),l=Math.abs(i),d=Math.abs(o),u=Math.abs(n),h=Math.abs(a),m=Math.abs(s),p=.5*(1+Math.sign(r*n))*Math.min(c,u),f=.5*(1+Math.sign(i*a))*Math.min(l,h),v=.5*(1+Math.sign(o*s))*Math.min(d,m),g=Math.max(c,u),_=Math.max(l,h),T=Math.max(d,m),x=Math.sqrt(p*p+f*f+v*v),E=Math.sign(c+r),b=Math.sign(l+i),A=Math.sign(d+o),S=Math.sign(u+n),M=Math.sign(h+a),w=Math.sign(m+s),C=this._totalOffset;if(x<C)return e[0]-=(1-E)*C,e[1]-=(1-b)*C,e[2]-=(1-A)*C,e[3]+=S*C,e[4]+=M*C,e[5]+=w*C,e;const R=C/Math.sqrt(g*g+_*_+T*T),O=C/x,I=O-R,N=-I;return e[0]+=r*(E*N+O),e[1]+=i*(b*N+O),e[2]+=o*(A*N+O),e[3]+=n*(S*I+R),e[4]+=a*(M*I+R),e[5]+=s*(w*I+R),e}applyToMbs(e){const t=(0,i.l)((0,z.a)(e)),r=this._totalOffset/t;return(0,i.b)((0,z.a)(this._tmpMbs),(0,z.a)(e),(0,z.a)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,V.gm)(e,this._totalOffset,this._totalOffset,a.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,o.vt)()}applyToVertex(e,t,r){const o=(0,i.i)(j,e,t,r),n=(0,i.f)(k,o,this.localOrigin),a=this.offset/(0,i.l)(n);return(0,i.b)(this.tmpVertex,o,n,a),this.tmpVertex}applyToAabb(e){const t=$,r=q,i=Y;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const n=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let o=0;o<3;++o)i[o]=e&1<<o?r[o]:t[o];n(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0===(a&e)){for(let o=0;o<3;++o)i[o]=a&1<<o?0:e&1<<o?t[o]:r[o];n(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const j=(0,o.vt)(),k=(0,o.vt)(),$=(0,o.vt)(),q=(0,o.vt)(),Y=(0,o.vt)();var X=r(13030),Z=r(59907);class J{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get(E.r.POSITION).indices.length}write(e,t,r,i,o,n){return(0,Z.SA)(r,i,this.vertexBufferLayout,e,t,o,n)}intersect(e,t,r,o,n,a,s){const c=this.vertexBufferLayout.createView(e).getField(E.r.POSITION,X.xs);if(null==c)return;const l=(0,i.a)(K,a,n),d=c.count/3,u=o.options.normalRequired;R(n,l,0,d,c.typedBuffer,c.typedBufferStride,u,((e,t,r)=>{s(e,r,t)}))}}const K=(0,o.vt)();var Q=r(43616),ee=r(91829),te=r(72824),re=r(97220),ie=r(98958),oe=r(63907);oe.MT.LESS,oe.MT.ALWAYS;const ne={mask:255},ae={function:{func:oe.MT.ALWAYS,ref:p.dd.OutlineVisualElementMask,mask:p.dd.OutlineVisualElementMask},operation:{fail:oe.eA.KEEP,zFail:oe.eA.KEEP,zPass:oe.eA.ZERO}},se={function:{func:oe.MT.ALWAYS,ref:p.dd.OutlineVisualElementMask,mask:p.dd.OutlineVisualElementMask},operation:{fail:oe.eA.KEEP,zFail:oe.eA.KEEP,zPass:oe.eA.REPLACE}};oe.MT.EQUAL,p.dd.OutlineVisualElementMask,p.dd.OutlineVisualElementMask,oe.eA.KEEP,oe.eA.KEEP,oe.eA.KEEP,oe.MT.NOTEQUAL,p.dd.OutlineVisualElementMask,p.dd.OutlineVisualElementMask,oe.eA.KEEP,oe.eA.KEEP,oe.eA.KEEP;var ce=r(74810),le=r(28491),de=r(90644),ue=r(49788);class he extends te.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=ce.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=p.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveStrength=0,this.emissiveSource=n.YJ.Color,this.emissiveBaseColor=o.uY,this.instancedDoublePrecision=!1,this.normalType=l.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,o.CN)(.2,.2,.2),this.diffuse=(0,o.CN)(.8,.8,.8),this.externalColor=(0,ee.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,o.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=p.it.Less,this.textureAlphaMode=p.sf.Blend,this.textureAlphaCutoff=ue.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=v.m$.Occlude,this.isDecoration=!1}}te.gy;class me extends ie.w{constructor(e,t,i=new re.$(le.D,(()=>r.e(5141).then(r.bind(r,5141))))){super(e,t,i),this.type="DefaultMaterialTechnique"}_makePipeline(e,t){const{oitPass:r,output:i,transparent:o,cullFace:n,customDepthTest:a,hasOccludees:s}=e;return(0,de.Ey)({blending:(0,c.RN)(i)&&o?(0,g.Yf)(r):null,culling:fe(e)?(0,de.Xt)(n):null,depthTest:{func:(0,g.K_)(r,pe(a))},depthWrite:(0,g.z5)(e),drawBuffers:(0,ie.L)(i,(0,g.m6)(r,i)),colorWrite:de.kn,stencilWrite:s?ne:null,stencilTest:s?t?se:ae:null,polygonOffset:(0,g.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function pe(e){return e===p.it.Lequal?oe.MT.LEQUAL:oe.MT.LESS}function fe(e){return e.cullFace!==p.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}var ve=r(90237),ge=r(53466),_e=r(51976),Te=r(35256);class xe extends Te.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=p.sf.Opaque,this.doubleSidedMode=u.W.None,this.pbrMode=h.A9.Disabled,this.cullFace=p.s2.None,this.normalType=l.W.Attribute,this.customDepthTest=p.it.Less,this.emissionSource=d.ZX.None,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasBloom=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.hasVvInstancing=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasColorTexture||this.hasMetallicRoughnessTexture||this.emissionSource===d.ZX.Texture||this.hasOcclusionTexture||this.hasNormalTexture?ge.I.Default:ge.I.None}get objectAndLayerIdColorInstanced(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,ve._)([(0,_e.W)({count:p.sf.COUNT})],xe.prototype,"alphaDiscardMode",void 0),(0,ve._)([(0,_e.W)({count:u.W.COUNT})],xe.prototype,"doubleSidedMode",void 0),(0,ve._)([(0,_e.W)({count:h.A9.COUNT})],xe.prototype,"pbrMode",void 0),(0,ve._)([(0,_e.W)({count:p.s2.COUNT})],xe.prototype,"cullFace",void 0),(0,ve._)([(0,_e.W)({count:l.W.COUNT})],xe.prototype,"normalType",void 0),(0,ve._)([(0,_e.W)({count:p.it.COUNT})],xe.prototype,"customDepthTest",void 0),(0,ve._)([(0,_e.W)({count:d.ZX.COUNT})],xe.prototype,"emissionSource",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasVertexColors",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasSymbolColors",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasVerticalOffset",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasColorTexture",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasMetallicRoughnessTexture",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasOcclusionTexture",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasNormalTexture",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasScreenSizePerspective",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasVertexTangents",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasOccludees",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"instancedDoublePrecision",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasModelTransformation",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"offsetBackfaces",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"vvSize",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"vvColor",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"receiveShadows",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"receiveAmbientOcclusion",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"textureAlphaPremultiplied",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"instanced",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"instancedColor",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"writeDepth",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"transparent",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"enableOffset",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"terrainDepthTest",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"cullAboveTerrain",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"snowCover",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasBloom",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasColorTextureTransform",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasEmissionTextureTransform",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasNormalTextureTransform",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasOcclusionTextureTransform",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Ee=r(57323);class be extends me{constructor(e,t){super(e,t,new re.$(Ee.R,(()=>r.e(9933).then(r.bind(r,39933))))),this.type="RealisticTreeTechnique"}}class Ae extends v.im{constructor(e,t){super(e,Me),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[G.N.OPAQUE_MATERIAL,e=>((0,c.iq)(e)||(0,c.PJ)(e))&&!this.transparent],[G.N.TRANSPARENT_MATERIAL,e=>((0,c.iq)(e)||(0,c.PJ)(e))&&this.transparent&&this.parameters.writeDepth],[G.N.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>((0,c.XY)(e)||(0,c.PJ)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,s.BP)().vec3f(E.r.POSITION);return e.normalType===l.W.Compressed?t.vec2i16(E.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(E.r.NORMAL),e.hasVertexTangents&&t.vec4f(E.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f16(E.r.UV0),e.hasVertexColors&&t.vec4u8(E.r.COLOR),e.hasSymbolColors&&t.vec4u8(E.r.SYMBOLCOLOR),(0,m.E)()&&t.vec4u8(E.r.OLIDCOLOR),t}(this.parameters),this._configuration=new xe(t.spherical)}isVisibleForOutput(e){return e!==c.V.Shadow&&e!==c.V.ShadowExcludeHighlight&&e!==c.V.ShadowHighlight||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t?1:i[3])>=ue.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.q)(this.parameters.emissiveBaseColor,o.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(this.parameters.emissiveSource===n.YJ.Emissive&&this._hasEmissiveBase||this.parameters.emissiveSource===n.YJ.Color)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:o,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=!o&&!!r.normalTextureId,i.hasColorTexture=!!r.textureId,i.hasVertexTangents=!o&&r.hasVertexTangents,i.instanced=r.isInstanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.vvSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=o?l.W.Attribute:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??p.it.Less,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?p.s2.None:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!o&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=o?u.W.WindingOrder:a&&"normal"===s?u.W.View:a&&"winding-order"===s?u.W.WindingOrder:u.W.None,i.instancedColor=r.hasInstancedColor,(0,c.RN)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.vvColor=!!r.vvColor,i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?h.A9.Schematic:h.A9.Normal:h.A9.Disabled,i.hasMetallicRoughnessTexture=!o&&!!r.metallicRoughnessTextureId,i.emissionSource=o?d.ZX.None:null!=r.emissiveTextureId&&r.emissiveSource===n.YJ.Emissive?d.ZX.Texture:r.usePBR?r.emissiveSource===n.YJ.Emissive?d.ZX.EmissiveColor:d.ZX.SymbolColor:d.ZX.None,i.hasOcclusionTexture=!o&&!!r.occlusionTextureId,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.camera.relativeElevation<g.xt,i.snowCover=t.snowCover,i.hasBloom=(0,c.LG)(e),i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,o,n,s){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(ye,t[12],t[13],t[14]);let s=null;switch(r.viewingMode){case a.RT.Global:s=(0,i.n)(Ie,ye);break;case a.RT.Local:s=(0,i.c)(Ie,Oe)}let c=0;const l=(0,i.d)(Pe,ye,e.eye),d=(0,i.l)(l),u=(0,i.g)(l,l,1/d);let h=null;this.parameters.screenSizePerspective&&(h=(0,i.e)(s,u)),c+=(0,Q.kE)(e,d,this.parameters.verticalOffset,h??0,this.parameters.screenSizePerspective),(0,i.g)(s,s,c),(0,i.o)(Ne,s,r.transform.inverseRotation),o=(0,i.d)(Ce,o,Ne),n=(0,i.d)(Re,n,Ne)}var c;S(e,r,o,n,null!=(c=r.verticalOffset)?(W.offset=c,W):null,s)}createGLMaterial(e){return new Se(e)}createBufferWriter(){return new J(this._vertexBufferLayout)}get transparent(){return we(this.parameters)}}class Se extends f.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.i)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?be:me,e)}}class Me extends he{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}}function we(e){const{drivenOpacity:t,opacity:r,externalColor:[i,o,n,a],layerOpacity:s,texture:c,textureId:l,textureAlphaMode:d,colorMixMode:u}=e;return t||r<1&&"replace"!==u||a<1&&"ignore"!==u||s<1||(null!=c||null!=l)&&d!==p.sf.Opaque&&d!==p.sf.Mask&&"replace"!==u}const Ce=(0,o.vt)(),Re=(0,o.vt)(),Oe=(0,o.fA)(0,0,1),Ie=(0,o.vt)(),Ne=(0,o.vt)(),ye=(0,o.vt)(),Pe=(0,o.vt)()},51976:(e,t,r)=>{r.d(t,{K:()=>s,W:()=>c});var i=r(49186),o=r(4576);class n{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}}var a=r(65786);class s extends a.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map((()=>0))??[],this._parameterNames??=[]}get key(){return this._key??=new n(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map((e=>` ${e}: ${this[e]}`)).join("\n");return this._parameterBits=t,r}}function c(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const o=e.count||2,n=Math.ceil(Math.log2(o)),a=t._parameterBits;let s=0;for(;a[s]+n>16;)s++,s>=a.length&&a.push(0);const c=a[s],l=(1<<n)-1<<c;a[s]+=n,e.count?Object.defineProperty(t,r,{get(){return(this._parameterBits[s]&l)>>c},set(t){if(this[r]!==t){if(this._key=null,this._parameterBits[s]=this._parameterBits[s]&~l|+t<<c&l,"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]&l)>>c)},set(e){if(this[r]!==e&&(this._key=null,this._parameterBits[s]=this._parameterBits[s]&~l|+e<<c&l,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},52540:(e,t,r)=>{r.d(t,{E:()=>s});var i=r(37585),o=r(48163),n=r(77108),a=r(31821);function s(e){e.uniforms.add(new n.E("zProjectionMap",(e=>function(e){const t=e.projectionMatrix;return(0,i.hZ)(c,t[14],t[10])}(e.camera)))),e.code.add(a.H`float linearizeDepth(float depth) {
541
+ }`)):e.vertex.code.add(n.H`void forwardMetallicRoughnessUV(){}`)}},51768:(e,t,r)=>{r.d(t,{$U:()=>Ae,fs:()=>Se,ty:()=>Ce});var i=r(38954),o=r(51850),n=r(67222),a=r(24151),s=r(1843),c=r(49255),l=r(96336),d=r(22911),u=r(62602),h=r(59469),m=r(16943),p=r(89192),f=r(25634),v=r(11725),g=r(33524),_=r(70328),T=r(75039),x=r(620),E=r(46540);class b{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const A=(0,_.vt)();function M(e,t,r,o,n,a){if(!e.visible)return;const s=(0,i.a)(B,o,r),c=(e,t,r)=>{a(e,r,t)},l=new b(!1,t.options.normalRequired);if(e.boundingInfo){(0,x.vA)(e.type===T.d.Mesh);const i=t.tolerance;C(e.boundingInfo,r,s,i,n,l,c)}else{const t=e.attributes.get(E.r.POSITION),o=t.indices;!function(e,t,r,o,n,a,s,c,l,d){const u=t,h=U,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),v=m>=p?m>=f?0:2:p>=f?1:2,g=v,_=u[g]<0?2:1,T=(v+_)%3,x=(v+(3-_))%3,E=u[T]/u[g],b=u[x]/u[g],A=1/u[g],M=O,S=I,C=N,{normalRequired:w}=l;for(let t=r;t<o;++t){const r=3*t,o=s*n[r];(0,i.i)(h[0],a[o+0],a[o+1],a[o+2]);const l=s*n[r+1];(0,i.i)(h[1],a[l+0],a[l+1],a[l+2]);const u=s*n[r+2];(0,i.i)(h[2],a[u+0],a[u+1],a[u+2]),c&&((0,i.c)(h[0],c.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],c.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],c.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(M,h[0],e),(0,i.a)(S,h[1],e),(0,i.a)(C,h[2],e);const m=M[T]-E*M[g],p=M[x]-b*M[g],f=S[T]-E*S[g],v=S[x]-b*S[g],_=C[T]-E*C[g],R=C[x]-b*C[g],O=_*v-R*f,I=m*R-p*_,N=f*p-v*m;if((O<0||I<0||N<0)&&(O>0||I>0||N>0))continue;const y=O+I+N;if(0===y)continue;const D=O*(A*M[g])+I*(A*S[g])+N*(A*C[g]);if(D*Math.sign(y)<0)continue;const L=D/y;L>=0&&d(L,t,w?P(h):null)}}(r,s,0,o.length/3,o,t.data,t.stride,n,l,c)}}const S=(0,o.vt)();function C(e,t,r,o,n,a,s){if(null==e)return;const c=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,S);if((0,_.Ne)(A,e.bbMin),(0,_.vI)(A,e.bbMax),null!=n&&n.applyToAabb(A),function(e,t,r,i){return function(e,t,r,i){const o=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let a=Math.min(o,n),s=Math.max(o,n);const c=(e[1]-i-t[1])*r[1],l=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(c,l)),s<0)return!1;if(a=Math.max(a,Math.min(c,l)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(A,t,c,o)){const{primitiveIndices:i,position:c}=e,l=i?i.length:c.indices.length/3;if(l>H){const i=e.getChildren();if(void 0!==i){for(const e of i)C(e,t,r,o,n,a,s);return}}!function(e,t,r,i,o,n,a,s,c,l,d){const u=e[0],h=e[1],m=e[2],p=t[0],f=t[1],v=t[2],{normalRequired:g}=l;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*o[r];let l=n[i],_=n[i+1],T=n[i+2];const x=a*o[r+1];let E=n[x],b=n[x+1],A=n[x+2];const M=a*o[r+2];let S=n[M],C=n[M+1],R=n[M+2];null!=c&&([l,_,T]=c.applyToVertex(l,_,T,e),[E,b,A]=c.applyToVertex(E,b,A,e),[S,C,R]=c.applyToVertex(S,C,R,e));const O=E-l,I=b-_,N=A-T,P=S-l,D=C-_,L=R-T,H=f*L-D*v,B=v*P-L*p,U=p*D-P*f,G=O*H+I*B+N*U;if(Math.abs(G)<=F)continue;const z=u-l,V=h-_,W=m-T,j=z*H+V*B+W*U;if(G>0){if(j<0||j>G)continue}else if(j>0||j<G)continue;const k=V*N-I*W,$=W*O-N*z,q=z*I-O*V,Y=p*k+f*$+v*q;if(G>0){if(Y<0||j+Y>G)continue}else if(Y>0||j+Y<G)continue;const X=(P*k+D*$+L*q)/G;X>=0&&d(X,t,g?y(O,I,N,P,D,L,w):null)}}(t,r,0,l,c.indices,c.data,c.stride,i,n,a,s)}}const w=(0,o.vt)();function R(e,t,r,i,o,n,a,s){const c=e[0],l=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,p=n*t,f=o[p],v=o[p+1],g=o[p+2],_=n*r,T=n*i,x=o[_]-f,E=o[_+1]-v,b=o[_+2]-g,A=o[T]-f,M=o[T+1]-v,S=o[T+2]-g,C=h*S-M*m,R=m*A-S*u,O=u*M-A*h,I=x*C+E*R+b*O;if(Math.abs(I)<=F)continue;const N=c-f,P=l-v,D=d-g,L=N*C+P*R+D*O;if(I>0){if(L<0||L>I)continue}else if(L>0||L<I)continue;const H=P*b-E*D,B=D*x-b*N,U=N*E-x*P,G=u*H+h*B+m*U;if(I>0){if(G<0||L+G>I)continue}else if(G>0||L+G<I)continue;const z=(A*H+M*B+S*U)/I;z>=0&&s(z,e,a?y(x,E,b,A,M,S,w):null)}}const O=(0,o.vt)(),I=(0,o.vt)(),N=(0,o.vt)();function y(e,t,r,o,n,a,s){return(0,i.i)(D,e,t,r),(0,i.i)(L,o,n,a),(0,i.h)(s,D,L),(0,i.n)(s,s),s}function P(e){return(0,i.a)(D,e[1],e[0]),(0,i.a)(L,e[2],e[0]),(0,i.h)(w,D,L),(0,i.n)(w,w),w}const D=(0,o.vt)(),L=(0,o.vt)(),H=1e3,F=1e-7,B=(0,o.vt)(),U=[(0,o.vt)(),(0,o.vt)(),(0,o.vt)()];var G=r(13464),z=(r(77690),r(29242),r(58083),r(9093),r(97937)),V=r(57005);const W=new class{constructor(e=0){this.offset=e,this.sphere=(0,z.c)(),this.tmpVertex=(0,o.vt)()}applyToVertex(e,t,r){const o=this.objectTransform.transform,n=(0,i.i)(j,e,t,r),a=(0,i.t)(n,n,o),s=this.offset/(0,i.l)(a);(0,i.b)(a,a,a,s);const c=this.objectTransform.inverse;return(0,i.t)(this.tmpVertex,a,c),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,i.l)(e);(0,i.b)(e,e,e,r);const o=this.offset/(0,i.l)(t);(0,i.b)(t,t,t,o)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,i.l)((0,z.a)(e)),r=this.offset/t;return(0,i.b)((0,z.a)(this.sphere),(0,z.a)(e),(0,z.a)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,o.vt)(),this._tmpMbs=(0,z.c)(),this._tmpObb=new V.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,i.l)(e)}applyToVertex(e,t,r){const o=(0,i.i)(j,e,t,r),n=(0,i.i)(k,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,i.l)(n);return(0,i.b)(this._tmpVertex,o,n,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,n=e[3],a=e[4],s=e[5]+t,c=Math.abs(r),l=Math.abs(i),d=Math.abs(o),u=Math.abs(n),h=Math.abs(a),m=Math.abs(s),p=.5*(1+Math.sign(r*n))*Math.min(c,u),f=.5*(1+Math.sign(i*a))*Math.min(l,h),v=.5*(1+Math.sign(o*s))*Math.min(d,m),g=Math.max(c,u),_=Math.max(l,h),T=Math.max(d,m),x=Math.sqrt(p*p+f*f+v*v),E=Math.sign(c+r),b=Math.sign(l+i),A=Math.sign(d+o),M=Math.sign(u+n),S=Math.sign(h+a),C=Math.sign(m+s),w=this._totalOffset;if(x<w)return e[0]-=(1-E)*w,e[1]-=(1-b)*w,e[2]-=(1-A)*w,e[3]+=M*w,e[4]+=S*w,e[5]+=C*w,e;const R=w/Math.sqrt(g*g+_*_+T*T),O=w/x,I=O-R,N=-I;return e[0]+=r*(E*N+O),e[1]+=i*(b*N+O),e[2]+=o*(A*N+O),e[3]+=n*(M*I+R),e[4]+=a*(S*I+R),e[5]+=s*(C*I+R),e}applyToMbs(e){const t=(0,i.l)((0,z.a)(e)),r=this._totalOffset/t;return(0,i.b)((0,z.a)(this._tmpMbs),(0,z.a)(e),(0,z.a)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,V.gm)(e,this._totalOffset,this._totalOffset,a.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,o.vt)()}applyToVertex(e,t,r){const o=(0,i.i)(j,e,t,r),n=(0,i.f)(k,o,this.localOrigin),a=this.offset/(0,i.l)(n);return(0,i.b)(this.tmpVertex,o,n,a),this.tmpVertex}applyToAabb(e){const t=$,r=q,i=Y;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const n=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let o=0;o<3;++o)i[o]=e&1<<o?r[o]:t[o];n(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0===(a&e)){for(let o=0;o<3;++o)i[o]=a&1<<o?0:e&1<<o?t[o]:r[o];n(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const j=(0,o.vt)(),k=(0,o.vt)(),$=(0,o.vt)(),q=(0,o.vt)(),Y=(0,o.vt)();var X=r(13030),Z=r(59907);class J{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get(E.r.POSITION).indices.length}write(e,t,r,i,o,n){return(0,Z.SA)(r,i,this.vertexBufferLayout,e,t,o,n)}intersect(e,t,r,o,n,a,s){const c=this.vertexBufferLayout.createView(e).getField(E.r.POSITION,X.xs);if(null==c)return;const l=(0,i.a)(K,a,n),d=c.count/3,u=o.options.normalRequired;R(n,l,0,d,c.typedBuffer,c.typedBufferStride,u,((e,t,r)=>{s(e,r,t)}))}}const K=(0,o.vt)();var Q=r(43616),ee=r(91829),te=r(72824),re=r(97220),ie=r(98958),oe=r(63907);oe.MT.LESS,oe.MT.ALWAYS;const ne={mask:255},ae={function:{func:oe.MT.ALWAYS,ref:p.dd.OutlineVisualElementMask,mask:p.dd.OutlineVisualElementMask},operation:{fail:oe.eA.KEEP,zFail:oe.eA.KEEP,zPass:oe.eA.ZERO}},se={function:{func:oe.MT.ALWAYS,ref:p.dd.OutlineVisualElementMask,mask:p.dd.OutlineVisualElementMask},operation:{fail:oe.eA.KEEP,zFail:oe.eA.KEEP,zPass:oe.eA.REPLACE}};oe.MT.EQUAL,p.dd.OutlineVisualElementMask,p.dd.OutlineVisualElementMask,oe.eA.KEEP,oe.eA.KEEP,oe.eA.KEEP,oe.MT.NOTEQUAL,p.dd.OutlineVisualElementMask,p.dd.OutlineVisualElementMask,oe.eA.KEEP,oe.eA.KEEP,oe.eA.KEEP;var ce=r(74810),le=r(28491),de=r(90644),ue=r(49788);class he extends te.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=ce.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=p.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=n.YJ.Color,this.emissiveBaseColor=o.uY,this.instancedDoublePrecision=!1,this.normalType=l.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,o.CN)(.2,.2,.2),this.diffuse=(0,o.CN)(.8,.8,.8),this.externalColor=(0,ee.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,o.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=p.it.Less,this.textureAlphaMode=p.sf.Blend,this.textureAlphaCutoff=ue.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=v.m$.Occlude,this.isDecoration=!1}}te.gy;class me extends ie.w{constructor(e,t,i=new re.$(le.D,(()=>r.e(5141).then(r.bind(r,5141))))){super(e,t,i),this.type="DefaultMaterialTechnique"}_makePipeline(e,t){const{oitPass:r,output:i,transparent:o,cullFace:n,customDepthTest:a,hasOccludees:s}=e;return(0,de.Ey)({blending:(0,c.RN)(i)&&o?(0,g.Yf)(r):null,culling:fe(e)?(0,de.Xt)(n):null,depthTest:{func:(0,g.K_)(r,pe(a))},depthWrite:(0,g.z5)(e),drawBuffers:(0,ie.L)(i,(0,g.m6)(r,i)),colorWrite:de.kn,stencilWrite:s?ne:null,stencilTest:s?t?se:ae:null,polygonOffset:(0,g.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function pe(e){return e===p.it.Lequal?oe.MT.LEQUAL:oe.MT.LESS}function fe(e){return e.cullFace!==p.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}var ve=r(90237),ge=r(53466),_e=r(51976),Te=r(35256);class xe extends Te.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=p.sf.Opaque,this.doubleSidedMode=u.W.None,this.pbrMode=h.A9.Disabled,this.cullFace=p.s2.None,this.normalType=l.W.Attribute,this.customDepthTest=p.it.Less,this.emissionSource=d.ZX.None,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasBloom=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.hasVvInstancing=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasColorTexture||this.hasMetallicRoughnessTexture||this.emissionSource===d.ZX.Texture||this.hasOcclusionTexture||this.hasNormalTexture?ge.I.Default:ge.I.None}get objectAndLayerIdColorInstanced(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,ve._)([(0,_e.W)({count:p.sf.COUNT})],xe.prototype,"alphaDiscardMode",void 0),(0,ve._)([(0,_e.W)({count:u.W.COUNT})],xe.prototype,"doubleSidedMode",void 0),(0,ve._)([(0,_e.W)({count:h.A9.COUNT})],xe.prototype,"pbrMode",void 0),(0,ve._)([(0,_e.W)({count:p.s2.COUNT})],xe.prototype,"cullFace",void 0),(0,ve._)([(0,_e.W)({count:l.W.COUNT})],xe.prototype,"normalType",void 0),(0,ve._)([(0,_e.W)({count:p.it.COUNT})],xe.prototype,"customDepthTest",void 0),(0,ve._)([(0,_e.W)({count:d.ZX.COUNT})],xe.prototype,"emissionSource",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasVertexColors",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasSymbolColors",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasVerticalOffset",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasColorTexture",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasMetallicRoughnessTexture",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasOcclusionTexture",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasNormalTexture",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasScreenSizePerspective",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasVertexTangents",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasOccludees",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"instancedDoublePrecision",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasModelTransformation",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"offsetBackfaces",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"vvSize",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"vvColor",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"receiveShadows",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"receiveAmbientOcclusion",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"textureAlphaPremultiplied",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"instanced",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"instancedColor",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"writeDepth",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"transparent",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"enableOffset",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"terrainDepthTest",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"cullAboveTerrain",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"snowCover",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasBloom",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasColorTextureTransform",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasEmissionTextureTransform",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasNormalTextureTransform",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasOcclusionTextureTransform",void 0),(0,ve._)([(0,_e.W)()],xe.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Ee=r(57323);class be extends me{constructor(e,t){super(e,t,new re.$(Ee.R,(()=>r.e(9933).then(r.bind(r,39933))))),this.type="RealisticTreeTechnique"}}class Ae extends v.im{constructor(e,t){super(e,Se),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[G.N.OPAQUE_MATERIAL,e=>((0,c.iq)(e)||(0,c.PJ)(e))&&!this.transparent],[G.N.TRANSPARENT_MATERIAL,e=>((0,c.iq)(e)||(0,c.PJ)(e))&&this.transparent&&this.parameters.writeDepth],[G.N.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>((0,c.XY)(e)||(0,c.PJ)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,s.BP)().vec3f(E.r.POSITION);return e.normalType===l.W.Compressed?t.vec2i16(E.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(E.r.NORMAL),e.hasVertexTangents&&t.vec4f(E.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f16(E.r.UV0),e.hasVertexColors&&t.vec4u8(E.r.COLOR),e.hasSymbolColors&&t.vec4u8(E.r.SYMBOLCOLOR),(0,m.E)()&&t.vec4u8(E.r.OLIDCOLOR),t}(this.parameters),this._configuration=new xe(t.spherical)}isVisibleForOutput(e){return e!==c.V.Shadow&&e!==c.V.ShadowExcludeHighlight&&e!==c.V.ShadowHighlight||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=ue.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.q)(this.parameters.emissiveBaseColor,o.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(this.parameters.emissiveSource===n.YJ.Emissive&&this._hasEmissiveBase||this.parameters.emissiveSource===n.YJ.Color)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:o,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=!o&&!!r.normalTextureId,i.hasColorTexture=!!r.textureId,i.hasVertexTangents=!o&&r.hasVertexTangents,i.instanced=r.isInstanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.vvSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=o?l.W.Attribute:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??p.it.Less,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?p.s2.None:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!o&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=o?u.W.WindingOrder:a&&"normal"===s?u.W.View:a&&"winding-order"===s?u.W.WindingOrder:u.W.None,i.instancedColor=r.hasInstancedColor,(0,c.RN)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.vvColor=!!r.vvColor,i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?h.A9.Schematic:h.A9.Normal:h.A9.Disabled,i.hasMetallicRoughnessTexture=!o&&!!r.metallicRoughnessTextureId,i.emissionSource=o?d.ZX.None:null!=r.emissiveTextureId&&r.emissiveSource===n.YJ.Emissive?d.ZX.Texture:r.usePBR?r.emissiveSource===n.YJ.Emissive?d.ZX.EmissiveColor:d.ZX.SymbolColor:d.ZX.None,i.hasOcclusionTexture=!o&&!!r.occlusionTextureId,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.camera.relativeElevation<g.xt,i.snowCover=t.snowCover,i.hasBloom=(0,c.LG)(e),i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,o,n,s){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(ye,t[12],t[13],t[14]);let s=null;switch(r.viewingMode){case a.RT.Global:s=(0,i.n)(Ie,ye);break;case a.RT.Local:s=(0,i.c)(Ie,Oe)}let c=0;const l=(0,i.d)(Pe,ye,e.eye),d=(0,i.l)(l),u=(0,i.g)(l,l,1/d);let h=null;this.parameters.screenSizePerspective&&(h=(0,i.e)(s,u)),c+=(0,Q.kE)(e,d,this.parameters.verticalOffset,h??0,this.parameters.screenSizePerspective),(0,i.g)(s,s,c),(0,i.o)(Ne,s,r.transform.inverseRotation),o=(0,i.d)(we,o,Ne),n=(0,i.d)(Re,n,Ne)}var c;M(e,r,o,n,null!=(c=r.verticalOffset)?(W.offset=c,W):null,s)}createGLMaterial(e){return new Me(e)}createBufferWriter(){return new J(this._vertexBufferLayout)}get transparent(){return Ce(this.parameters)}}class Me extends f.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.i)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?be:me,e)}}class Se extends he{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}}function Ce(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:o,texture:n,textureId:a,textureAlphaMode:s,colorMixMode:c}=e,l=i[3];return t||r<1&&"replace"!==c||l<1&&"ignore"!==c||o<1||(null!=n||null!=a)&&s!==p.sf.Opaque&&s!==p.sf.Mask&&"replace"!==c}const we=(0,o.vt)(),Re=(0,o.vt)(),Oe=(0,o.fA)(0,0,1),Ie=(0,o.vt)(),Ne=(0,o.vt)(),ye=(0,o.vt)(),Pe=(0,o.vt)()},51976:(e,t,r)=>{r.d(t,{K:()=>s,W:()=>c});var i=r(49186),o=r(4576);class n{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}}var a=r(65786);class s extends a.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map((()=>0))??[],this._parameterNames??=[]}get key(){return this._key??=new n(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map((e=>` ${e}: ${this[e]}`)).join("\n");return this._parameterBits=t,r}}function c(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const o=e.count||2,n=Math.ceil(Math.log2(o)),a=t._parameterBits;let s=0;for(;a[s]+n>16;)s++,s>=a.length&&a.push(0);const c=a[s],l=(1<<n)-1<<c;a[s]+=n,e.count?Object.defineProperty(t,r,{get(){return(this._parameterBits[s]&l)>>c},set(t){if(this[r]!==t){if(this._key=null,this._parameterBits[s]=this._parameterBits[s]&~l|+t<<c&l,"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]&l)>>c)},set(e){if(this[r]!==e&&(this._key=null,this._parameterBits[s]=this._parameterBits[s]&~l|+e<<c&l,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},52540:(e,t,r)=>{r.d(t,{E:()=>s});var i=r(37585),o=r(48163),n=r(77108),a=r(31821);function s(e){e.uniforms.add(new n.E("zProjectionMap",(e=>function(e){const t=e.projectionMatrix;return(0,i.hZ)(c,t[14],t[10])}(e.camera)))),e.code.add(a.H`float linearizeDepth(float depth) {
527
542
  float depthNdc = depth * 2.0 - 1.0;
528
543
  float c1 = zProjectionMap[0];
529
544
  float c2 = zProjectionMap[1];
@@ -556,15 +571,16 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
556
571
  }`)}function c(e){e.uniforms.add(new n.t("screenSizePerspective",(e=>d(e.screenSizePerspective))))}function l(e){e.uniforms.add(new n.t("screenSizePerspectiveAlignment",(e=>d(e.screenSizePerspectiveAlignment||e.screenSizePerspective))))}function d(e){return(0,i.i)(u,e.parameters.divisor,e.parameters.offset,e.minScaleFactor)}const u=(0,o.vt)()},53466:(e,t,r)=>{r.d(t,{I:()=>i,U:()=>c});var i,o,n=r(21818),a=r(31821),s=r(46540);function c(e,t){switch(t.textureCoordinateType){case i.Default:return e.attributes.add(s.r.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(a.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case i.Atlas:return e.attributes.add(s.r.UV0,"vec2"),e.attributes.add(s.r.UVREGION,"vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(a.H`void forwardTextureCoordinates() {
557
572
  vuv0 = uv0;
558
573
  vuvRegion = uvRegion;
559
- }`);default:(0,n.Xb)(t.textureCoordinateType);case i.None:return void e.vertex.code.add(a.H`void forwardTextureCoordinates() {}`);case i.COUNT:return}}(o=i||(i={}))[o.None=0]="None",o[o.Default=1]="Default",o[o.Atlas=2]="Atlas",o[o.COUNT=3]="COUNT"},57323:(e,t,r)=>{r.d(t,{R:()=>H,b:()=>L});var i=r(46686),o=r(32680),n=r(49255),a=r(76591),s=r(76597),c=r(60864),l=r(96336),d=r(71955),u=r(53466),h=r(92700),m=r(35640),p=r(40261),f=r(42837),v=r(89390),g=r(98619),_=r(22393),T=r(59469),x=r(39168),E=r(96598),b=r(42398),A=r(58614),S=r(27950),M=r(20693),w=r(33079),C=r(71988),R=r(20304),O=r(31821),I=r(63761),N=r(46540),y=r(60517),P=r(14113),D=r(49788);function L(e){const t=new P.N5,{attributes:r,vertex:L,fragment:H,varyings:F}=t,{output:B,offsetBackfaces:U,instancedColor:G,pbrMode:z,snowCover:V,spherical:W,hasBloom:j}=e,k=z===T.A9.Normal||z===T.A9.Schematic;if((0,M.NB)(L,e),r.add(N.r.POSITION,"vec3"),F.add("vpos","vec3",{invariant:!0}),t.include(b.A,e),t.include(c.B,e),t.include(m.Ge,e),t.include(E.Z,e),(0,n.RN)(B)&&((0,M.yu)(t.vertex,e),t.include(l.Y,e),t.include(s.d,e),U&&t.include(o.M),G&&t.attributes.add(N.r.INSTANCECOLOR,"vec4"),F.add("vNormalWorld","vec3"),F.add("localvpos","vec3",{invariant:!0}),t.include(u.U,e),t.include(i.oD,e),t.include(d.K,e),t.include(h.c,e),L.uniforms.add(new C.E("externalColor",(e=>e.externalColor))),F.add("vcolorExt","vec4"),L.main.add(O.H`
574
+ }`);default:(0,n.Xb)(t.textureCoordinateType);case i.None:return void e.vertex.code.add(a.H`void forwardTextureCoordinates() {}`);case i.COUNT:return}}(o=i||(i={}))[o.None=0]="None",o[o.Default=1]="Default",o[o.Atlas=2]="Atlas",o[o.COUNT=3]="COUNT"},57323:(e,t,r)=>{r.d(t,{R:()=>U,b:()=>B});var i=r(46686),o=r(32680),n=r(49255),a=r(76591),s=r(76597),c=r(24321),l=r(60864),d=r(43519),u=r(96336),h=r(71955),m=r(53466),p=r(92700),f=r(35640),v=r(40261),g=r(42837),_=r(89390),T=r(98619),x=r(22393),E=r(59469),b=r(39168),A=r(96598),M=r(42398),S=r(58614),C=r(27950),w=r(20693),R=r(33079),O=r(71988),I=r(20304),N=r(31821),y=r(63761),P=r(46540),D=r(43616),L=r(60517),H=r(14113),F=r(49788);function B(e){const t=new H.N5,{attributes:r,vertex:B,fragment:U,varyings:G}=t,{output:z,offsetBackfaces:V,pbrMode:W,snowCover:j,spherical:k,hasBloom:$}=e,q=W===E.A9.Normal||W===E.A9.Schematic;if((0,w.NB)(B,e),r.add(P.r.POSITION,"vec3"),G.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(l.B,e),t.include(f.Ge,e),t.include(A.Z,e),(0,n.RN)(z)&&((0,w.yu)(t.vertex,e),t.include(u.Y,e),t.include(s.d,e),V&&t.include(o.M),G.add("vNormalWorld","vec3"),G.add("localvpos","vec3",{invariant:!0}),t.include(m.U,e),t.include(i.oD,e),t.include(h.K,e),t.include(c.v,e),t.include(p.c,e),B.include(d.WD),B.include(d.oF),B.uniforms.add(new O.E("externalColor",(e=>e.externalColor),{supportsNaN:!0})),G.add("vcolorExt","vec4"),B.main.add(N.H`
560
575
  forwardNormalizedVertexColor();
561
- vcolorExt = externalColor;
562
- ${(0,O.If)(G,"vcolorExt *= instanceColor * 0.003921568627451;")}
563
- vcolorExt *= vvColor();
564
- vcolorExt *= getSymbolColor();
565
- forwardColorMixMode();
566
576
 
567
- bool alphaCut = vcolorExt.a < ${O.H.float(D.Q)};
577
+ MaskedColor maskedColorExt =
578
+ applySymbolColor(applyVVColor(applyInstanceColor(createMaskedFromNaNColor(externalColor))));
579
+
580
+ vcolorExt = maskedColorExt.color;
581
+ forwardColorMixMode(maskedColorExt.mask);
582
+
583
+ bool alphaCut = opacityMixMode != ${N.H.int(D.Um.ignore)} && vcolorExt.a < ${N.H.float(F.Q)};
568
584
  vpos = getVertexInLocalOriginSpace();
569
585
  localvpos = vpos - view[3].xyz;
570
586
  vpos = subtractOrigin(vpos);
@@ -574,15 +590,16 @@ vuvRegion = uvRegion;
574
590
 
575
591
  forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
576
592
  forwardLinearDepth();
593
+
577
594
  forwardTextureCoordinates();
578
595
 
579
596
  gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
580
- ${(0,O.If)(U,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
581
- `)),(0,n.RN)(B)){const{hasColorTexture:r,hasColorTextureTransform:i,receiveShadows:o}=e;t.include(v.kA,e),H.include(f.n,e),t.include(A.S,e),t.include(e.instancedDoublePrecision?x.G:x.Bz,e),H.include(a.HQ,e),t.include(y.z,e),(0,M.yu)(H,e),(0,g.Gc)(H),(0,v.a8)(H),(0,v.eU)(H),H.uniforms.add(L.uniforms.get("localOrigin"),L.uniforms.get("view"),new w.t("ambient",(e=>e.ambient)),new w.t("diffuse",(e=>e.diffuse)),new R.m("opacity",(e=>e.opacity)),new R.m("layerOpacity",(e=>e.layerOpacity))),r&&H.uniforms.add(new I.N("tex",(e=>e.texture))),t.include(T._Z,e),H.include(_.c,e),H.include(S.N),(0,g.O4)(H),H.main.add(O.H`
597
+ ${(0,N.If)(V,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
598
+ `)),(0,n.RN)(z)){const{hasColorTexture:r,hasColorTextureTransform:i,receiveShadows:o}=e;t.include(_.kA,e),U.include(g.n,e),t.include(S.S,e),t.include(e.instancedDoublePrecision?b.G:b.Bz,e),U.include(a.HQ,e),t.include(L.z,e),(0,w.yu)(U,e),(0,T.Gc)(U),(0,_.a8)(U),(0,_.eU)(U),U.uniforms.add(B.uniforms.get("localOrigin"),B.uniforms.get("view"),new R.t("ambient",(e=>e.ambient)),new R.t("diffuse",(e=>e.diffuse)),new I.m("opacity",(e=>e.opacity)),new I.m("layerOpacity",(e=>e.layerOpacity))),r&&U.uniforms.add(new y.N("tex",(e=>e.texture))),t.include(E._Z,e),U.include(x.c,e),U.include(C.N),(0,T.O4)(U),U.main.add(N.H`
582
599
  discardBySlice(vpos);
583
600
  discardByTerrainDepth();
584
601
  vec4 texColor = ${r?`texture(tex, ${i?"colorUV":"vuv0"})`:" vec4(1.0)"};
585
- ${(0,O.If)(r,`${(0,O.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
602
+ ${(0,N.If)(r,`${(0,N.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
586
603
  vec3 viewDirection = normalize(vpos - cameraPosition);
587
604
  applyPBRFactors();
588
605
  float ssao = evaluateAmbientOcclusionInverse();
@@ -590,13 +607,14 @@ vuvRegion = uvRegion;
590
607
 
591
608
  float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
592
609
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
593
- float shadow = ${o?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":W?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
610
+ float shadow = ${o?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":k?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
594
611
  vec3 matColor = max(ambient, diffuse);
595
- ${e.hasVertexColors?O.H`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
596
- float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:O.H`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
597
- float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
598
- ${(0,O.If)(V,"albedo = mix(albedo, vec3(1), 0.9);")}
599
- ${O.H`vec3 shadingNormal = normalize(vNormalWorld);
612
+ ${e.hasVertexColors?N.H`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
613
+ float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, opacityMixMode);`:N.H`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
614
+ float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, opacityMixMode);`}
615
+
616
+ ${(0,N.If)(j,"albedo = mix(albedo, vec3(1), 0.9);")}
617
+ ${N.H`vec3 shadingNormal = normalize(vNormalWorld);
600
618
  albedo *= 1.2;
601
619
  vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
602
620
  float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
@@ -604,13 +622,13 @@ vuvRegion = uvRegion;
604
622
  float treeRadialFalloff = vColor.r;
605
623
  float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
606
624
  additionalLight += backLightFactor * mainLightIntensity;`}
607
- ${(0,O.If)(k,`vec3 normalGround = ${W?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};`)}
608
- ${k?O.H`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
609
- ${(0,O.If)(V,O.H`mrr = applySnowToMRR(mrr, 1.0)`)}
610
- vec4 emission = ${V||j?"vec4(0.0)":"getEmissions(albedo)"};
611
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:O.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
625
+ ${(0,N.If)(q,`vec3 normalGround = ${k?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};`)}
626
+ ${q?N.H`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
627
+ ${(0,N.If)(j,N.H`mrr = applySnowToMRR(mrr, 1.0)`)}
628
+ vec4 emission = ${j||$?"vec4(0.0)":"getEmissions(albedo)"};
629
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:N.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
612
630
  vec4 finalColor = vec4(shadedColor, opacity_);
613
- outputColorHighlightOID(finalColor, vpos, albedo ${(0,O.If)(V,", 1.0")});`)}return t.include(p.E,e),t}const H=Object.freeze(Object.defineProperty({__proto__:null,build:L},Symbol.toStringTag,{value:"Module"}))},57917:(e,t,r)=>{r.d(t,{S:()=>n});var i=r(34275),o=r(20498);function n(e){if(e.length<i.y9)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,i.LW)(e)?(0,o.pX)().from(e):(0,i.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}},58029:(e,t,r)=>{r.d(t,{F:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"mat4",i.c.Bind,((r,i)=>r.setUniformMatrix4fv(e,t(i))))}}},58614:(e,t,r)=>{r.d(t,{S:()=>s}),r(28421);var i=r(20304),o=r(31821),n=r(89192),a=r(49788);function s(e,t){!function(e,t,r){const i=e.fragment,s=t.alphaDiscardMode,c=s===n.sf.Blend;s!==n.sf.Mask&&s!==n.sf.MaskBlend||i.uniforms.add(r),i.code.add(o.H`
631
+ outputColorHighlightOID(finalColor, vpos, albedo ${(0,N.If)(j,", 1.0")});`)}return t.include(v.E,e),t}const U=Object.freeze(Object.defineProperty({__proto__:null,build:B},Symbol.toStringTag,{value:"Module"}))},57917:(e,t,r)=>{r.d(t,{S:()=>n});var i=r(34275),o=r(20498);function n(e){if(e.length<i.y9)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,i.LW)(e)?(0,o.pX)().from(e):(0,i.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}},58029:(e,t,r)=>{r.d(t,{F:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"mat4",i.c.Bind,((i,o)=>i.setUniformMatrix4fv(e,t(o),r)))}}},58614:(e,t,r)=>{r.d(t,{S:()=>s}),r(28421);var i=r(20304),o=r(31821),n=r(89192),a=r(49788);function s(e,t){!function(e,t,r){const i=e.fragment,s=t.alphaDiscardMode,c=s===n.sf.Blend;s!==n.sf.Mask&&s!==n.sf.MaskBlend||i.uniforms.add(r),i.code.add(o.H`
614
632
  void discardOrAdjustAlpha(inout vec4 color) {
615
633
  ${s===n.sf.Opaque?"color.a = 1.0;":`if (color.a < ${c?o.H.float(a.Q):"textureAlphaCutoff"}) {\n discard;\n } ${(0,o.If)(s===n.sf.Mask,"else { color.a = 1.0; }")}`}
616
634
  }
@@ -639,7 +657,7 @@ float occlusion;`),h&&o.uniforms.add(v===u.c.Pass?new d.N("texMetallicRoughness"
639
657
  ${(0,c.If)(h,`applyMetallicRoughness(${m?"metallicRoughnessUV":"vuv0"});`)}
640
658
  ${(0,c.If)(p,`applyOcclusion(${f?"occlusionUV":"vuv0"});`)}
641
659
  }
642
- `)}(o=i||(i={}))[o.Disabled=0]="Disabled",o[o.Normal=1]="Normal",o[o.Schematic=2]="Schematic",o[o.Water=3]="Water",o[o.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",o[o.Simplified=5]="Simplified",o[o.TerrainWithWater=6]="TerrainWithWater",o[o.COUNT=7]="COUNT",h.Y},59643:(e,t,r)=>{var i;r.d(t,{Y:()=>i}),function(e){e[e.NONE=0]="NONE",e[e.ColorAlpha=1]="ColorAlpha",e[e.FrontFace=2]="FrontFace",e[e.COUNT=3]="COUNT"}(i||(i={}))},59907:(e,t,r)=>{r.d(t,{Hk:()=>m,Pq:()=>h,SA:()=>_,Ut:()=>u,p1:()=>p,tb:()=>f,uO:()=>c,vx:()=>g}),r(38954);var i=r(51850),o=r(58083),n=r(13030),a=r(620),s=r(46540);function c(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,c=n.length;if(r*=s,1===i)for(let e=0;e<c;++e)a[r]=o[n[e]],r+=s;else for(let e=0;e<c;++e){const t=o[n[e]];for(let e=0;e<i;e++)a[r]=t,r+=s}}function l(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length;r*=a;for(let e=0;e<s;++e){const t=2*o[e];n[r]=i[t],n[r+1]=i[t+1],r+=a}}function d(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,c=n.length;if(r*=s,1===i)for(let e=0;e<c;++e){const t=3*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}else for(let e=0;e<c;++e){const t=3*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}}function u(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,c=n.length;if(r*=s,1===i)for(let e=0;e<c;++e){const t=4*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}else for(let e=0;e<c;++e){const t=4*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}}function h(e,t,r){const i=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let e=0;e<r;++e)i[t]=0,i[t+1]=0,i[t+2]=0,i[t+3]=0,t+=o}function m(e,t,r,i,n=1){if(!t)return void d(e,r,i,n);const{data:a,indices:s}=e,c=r.typedBuffer,l=r.typedBufferStride,u=s.length,h=t[0],m=t[1],p=t[2],f=t[4],v=t[5],g=t[6],_=t[8],T=t[9],x=t[10],E=t[12],b=t[13],A=t[14];i*=l;let S=0,M=0,w=0;const C=(0,o.tZ)(t)?e=>{S=a[e]+E,M=a[e+1]+b,w=a[e+2]+A}:e=>{const t=a[e],r=a[e+1],i=a[e+2];S=h*t+f*r+_*i+E,M=m*t+v*r+T*i+b,w=p*t+g*r+x*i+A};if(1===n)for(let e=0;e<u;++e)C(3*s[e]),c[i]=S,c[i+1]=M,c[i+2]=w,i+=l;else for(let e=0;e<u;++e){C(3*s[e]);for(let e=0;e<n;++e)c[i]=S,c[i+1]=M,c[i+2]=w,i+=l}}function p(e,t,r,i,n=1){if(!t)return void d(e,r,i,n);const{data:a,indices:s}=e,c=t,l=r.typedBuffer,u=r.typedBufferStride,h=s.length,m=c[0],p=c[1],f=c[2],v=c[4],g=c[5],_=c[6],T=c[8],x=c[9],E=c[10],b=!(0,o.ut)(c),A=1e-6,S=1-A;i*=u;let M=0,w=0,C=0;const R=(0,o.tZ)(c)?e=>{M=a[e],w=a[e+1],C=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];M=m*t+v*r+T*i,w=p*t+g*r+x*i,C=f*t+_*r+E*i};if(1===n)if(b)for(let e=0;e<h;++e){R(3*s[e]);const t=M*M+w*w+C*C;if(t<S&&t>A){const e=1/Math.sqrt(t);l[i]=M*e,l[i+1]=w*e,l[i+2]=C*e}else l[i]=M,l[i+1]=w,l[i+2]=C;i+=u}else for(let e=0;e<h;++e)R(3*s[e]),l[i]=M,l[i+1]=w,l[i+2]=C,i+=u;else for(let e=0;e<h;++e){if(R(3*s[e]),b){const e=M*M+w*w+C*C;if(e<S&&e>A){const t=1/Math.sqrt(e);M*=t,w*=t,C*=t}}for(let e=0;e<n;++e)l[i]=M,l[i+1]=w,l[i+2]=C,i+=u}}function f(e,t,r,i,o=1){const{data:n,indices:a}=e,s=r.typedBuffer,c=r.typedBufferStride,l=a.length;if(i*=c,t!==n.length||4!==t)if(1!==o)if(4!==t)for(let e=0;e<l;++e){const t=3*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=c}else for(let e=0;e<l;++e){const t=4*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=c}return}for(let e=0;e<l;++e){const t=3*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=c}}else{s[i]=n[0],s[i+1]=n[1],s[i+2]=n[2],s[i+3]=n[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=c/4,a=e[i/=4];i+=t;const d=l*o;for(let r=1;r<d;++r)e[i]=a,i+=t}}function v(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length,c=i[0];r*=a;for(let e=0;e<s;++e)n[r]=c,r+=a}function g(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}function _(e,t,r,i,o,a,c){let l={numItems:0,numVerticesPerItem:0};for(const d of r.fields.keys()){const r=e.get(d),u=r?.indices;if(r&&u)d===s.r.POSITION&&(l={numItems:1,numVerticesPerItem:u.length}),T(d,r,i,o,a,c);else if(d===s.r.OLIDCOLOR&&null!=t){const r=e.get(s.r.POSITION)?.indices;if(r){const e=r.length;g(t,a.getField(d,n.XP),e,c)}}}return l}function T(e,t,r,i,c,h){switch(e){case s.r.POSITION:{(0,a.vA)(3===t.size);const i=c.getField(e,n.xs);(0,a.vA)(!!i,`No buffer view for ${e}`),m(t,r,i,h);break}case s.r.NORMAL:{(0,a.vA)(3===t.size);const r=c.getField(e,n.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),p(t,i,r,h);break}case s.r.NORMALCOMPRESSED:case s.r.PROFILERIGHT:case s.r.PROFILEUP:{(0,a.vA)(2===t.size);const r=c.getField(e,n.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,h);break}case s.r.UV0:{(0,a.vA)(2===t.size);const r=c.getField(e,n.ZD)??c.getField(e,n.gH);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,h);break}case s.r.UVI:{(0,a.vA)(2===t.size);const r=c.getField(e,n.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,h);break}case s.r.COLOR:case s.r.SYMBOLCOLOR:{const r=c.getField(e,n.XP);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(3===t.size||4===t.size),f(t,t.size,r,h);break}case s.r.SIZEFEATUREATTRIBUTE:{const r=c.getField(e,n.Y$);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(1===t.size),v(t,r,h);break}case s.r.COLORFEATUREATTRIBUTE:case s.r.OPACITYFEATUREATTRIBUTE:{const r=c.getField(e,n.XW)??c.getField(e,n.Y$);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(1===t.size),v(t,r,h);break}case s.r.TANGENT:{(0,a.vA)(4===t.size);const i=c.getField(e,n.Eq);(0,a.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void u(e,r,i,n);const{data:a,indices:s}=e,c=t,l=r.typedBuffer,d=r.typedBufferStride,h=s.length,m=c[0],p=c[1],f=c[2],v=c[4],g=c[5],_=c[6],T=c[8],x=c[9],E=c[10],b=!(0,o.ut)(c),A=1e-6,S=1-A;if(i*=d,1===n)for(let e=0;e<h;++e){const t=4*s[e],r=a[t],o=a[t+1],n=a[t+2],c=a[t+3];let u=m*r+v*o+T*n,h=p*r+g*o+x*n,M=f*r+_*o+E*n;if(b){const e=u*u+h*h+M*M;if(e<S&&e>A){const t=1/Math.sqrt(e);u*=t,h*=t,M*=t}}l[i]=u,l[i+1]=h,l[i+2]=M,l[i+3]=c,i+=d}else for(let e=0;e<h;++e){const t=4*s[e],r=a[t],o=a[t+1],c=a[t+2],u=a[t+3];let h=m*r+v*o+T*c,M=p*r+g*o+x*c,w=f*r+_*o+E*c;if(b){const e=h*h+M*M+w*w;if(e<S&&e>A){const t=1/Math.sqrt(e);h*=t,M*=t,w*=t}}for(let e=0;e<n;++e)l[i]=h,l[i+1]=M,l[i+2]=w,l[i+3]=u,i+=d}}(t,r,i,h);break}case s.r.PROFILEVERTEXANDNORMAL:{(0,a.vA)(4===t.size);const r=c.getField(e,n.jz)??c.getField(e,n.Eq);(0,a.vA)(!!r,`No buffer view for ${e}`),u(t,r,h);break}case s.r.PROFILEAUXDATA:{(0,a.vA)(3===t.size);const r=c.getField(e,n.EC)??c.getField(e,n.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),d(t,r,h);break}}}(0,i.vt)()},60517:(e,t,r)=>{r.d(t,{z:()=>d});var i=r(49255),o=r(22911),n=r(42593),a=r(63365),s=r(31821),c=r(59643),l=r(49788);function d(e,t){e.include(n.Q,t),e.include(o.NL,t),e.fragment.include(a.a);const{output:r,oitPass:d,discardInvisibleFragments:u,snowCover:h}=t,m=r===i.V.ObjectAndLayerIdColor,p=(0,i.LG)(r),f=(0,i.RN)(r)&&d===c.Y.ColorAlpha,v=(0,i.RN)(r)&&d!==c.Y.ColorAlpha;let g=0;(v||p||f)&&e.outputs.add("fragColor","vec4",g++),p&&e.outputs.add("fragEmission","vec4",g++),f&&e.outputs.add("fragAlpha","float",g++),e.fragment.code.add(s.H`
660
+ `)}(o=i||(i={}))[o.Disabled=0]="Disabled",o[o.Normal=1]="Normal",o[o.Schematic=2]="Schematic",o[o.Water=3]="Water",o[o.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",o[o.Simplified=5]="Simplified",o[o.TerrainWithWater=6]="TerrainWithWater",o[o.COUNT=7]="COUNT",h.Y},59643:(e,t,r)=>{var i;r.d(t,{Y:()=>i}),function(e){e[e.NONE=0]="NONE",e[e.ColorAlpha=1]="ColorAlpha",e[e.FrontFace=2]="FrontFace",e[e.COUNT=3]="COUNT"}(i||(i={}))},59907:(e,t,r)=>{r.d(t,{Hk:()=>m,Pq:()=>h,SA:()=>_,Ut:()=>u,p1:()=>p,tb:()=>f,uO:()=>c,vx:()=>g}),r(38954);var i=r(51850),o=r(58083),n=r(13030),a=r(620),s=r(46540);function c(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,c=n.length;if(r*=s,1===i)for(let e=0;e<c;++e)a[r]=o[n[e]],r+=s;else for(let e=0;e<c;++e){const t=o[n[e]];for(let e=0;e<i;e++)a[r]=t,r+=s}}function l(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length;r*=a;for(let e=0;e<s;++e){const t=2*o[e];n[r]=i[t],n[r+1]=i[t+1],r+=a}}function d(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,c=n.length;if(r*=s,1===i)for(let e=0;e<c;++e){const t=3*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}else for(let e=0;e<c;++e){const t=3*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}}function u(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,c=n.length;if(r*=s,1===i)for(let e=0;e<c;++e){const t=4*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}else for(let e=0;e<c;++e){const t=4*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}}function h(e,t,r){const i=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let e=0;e<r;++e)i[t]=0,i[t+1]=0,i[t+2]=0,i[t+3]=0,t+=o}function m(e,t,r,i,n=1){if(!t)return void d(e,r,i,n);const{data:a,indices:s}=e,c=r.typedBuffer,l=r.typedBufferStride,u=s.length,h=t[0],m=t[1],p=t[2],f=t[4],v=t[5],g=t[6],_=t[8],T=t[9],x=t[10],E=t[12],b=t[13],A=t[14];i*=l;let M=0,S=0,C=0;const w=(0,o.tZ)(t)?e=>{M=a[e]+E,S=a[e+1]+b,C=a[e+2]+A}:e=>{const t=a[e],r=a[e+1],i=a[e+2];M=h*t+f*r+_*i+E,S=m*t+v*r+T*i+b,C=p*t+g*r+x*i+A};if(1===n)for(let e=0;e<u;++e)w(3*s[e]),c[i]=M,c[i+1]=S,c[i+2]=C,i+=l;else for(let e=0;e<u;++e){w(3*s[e]);for(let e=0;e<n;++e)c[i]=M,c[i+1]=S,c[i+2]=C,i+=l}}function p(e,t,r,i,n=1){if(!t)return void d(e,r,i,n);const{data:a,indices:s}=e,c=t,l=r.typedBuffer,u=r.typedBufferStride,h=s.length,m=c[0],p=c[1],f=c[2],v=c[4],g=c[5],_=c[6],T=c[8],x=c[9],E=c[10],b=!(0,o.ut)(c),A=1e-6,M=1-A;i*=u;let S=0,C=0,w=0;const R=(0,o.tZ)(c)?e=>{S=a[e],C=a[e+1],w=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];S=m*t+v*r+T*i,C=p*t+g*r+x*i,w=f*t+_*r+E*i};if(1===n)if(b)for(let e=0;e<h;++e){R(3*s[e]);const t=S*S+C*C+w*w;if(t<M&&t>A){const e=1/Math.sqrt(t);l[i]=S*e,l[i+1]=C*e,l[i+2]=w*e}else l[i]=S,l[i+1]=C,l[i+2]=w;i+=u}else for(let e=0;e<h;++e)R(3*s[e]),l[i]=S,l[i+1]=C,l[i+2]=w,i+=u;else for(let e=0;e<h;++e){if(R(3*s[e]),b){const e=S*S+C*C+w*w;if(e<M&&e>A){const t=1/Math.sqrt(e);S*=t,C*=t,w*=t}}for(let e=0;e<n;++e)l[i]=S,l[i+1]=C,l[i+2]=w,i+=u}}function f(e,t,r,i,o=1){const{data:n,indices:a}=e,s=r.typedBuffer,c=r.typedBufferStride,l=a.length;if(i*=c,t!==n.length||4!==t)if(1!==o)if(4!==t)for(let e=0;e<l;++e){const t=3*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=c}else for(let e=0;e<l;++e){const t=4*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=c}return}for(let e=0;e<l;++e){const t=3*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=c}}else{s[i]=n[0],s[i+1]=n[1],s[i+2]=n[2],s[i+3]=n[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=c/4,a=e[i/=4];i+=t;const d=l*o;for(let r=1;r<d;++r)e[i]=a,i+=t}}function v(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length,c=i[0];r*=a;for(let e=0;e<s;++e)n[r]=c,r+=a}function g(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}function _(e,t,r,i,o,a,c){let l={numItems:0,numVerticesPerItem:0};for(const d of r.fields.keys()){const r=e.get(d),u=r?.indices;if(r&&u)d===s.r.POSITION&&(l={numItems:1,numVerticesPerItem:u.length}),T(d,r,i,o,a,c);else if(d===s.r.OLIDCOLOR&&null!=t){const r=e.get(s.r.POSITION)?.indices;if(r){const e=r.length;g(t,a.getField(d,n.XP),e,c)}}}return l}function T(e,t,r,i,c,h){switch(e){case s.r.POSITION:{(0,a.vA)(3===t.size);const i=c.getField(e,n.xs);(0,a.vA)(!!i,`No buffer view for ${e}`),m(t,r,i,h);break}case s.r.NORMAL:{(0,a.vA)(3===t.size);const r=c.getField(e,n.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),p(t,i,r,h);break}case s.r.NORMALCOMPRESSED:case s.r.PROFILERIGHT:case s.r.PROFILEUP:{(0,a.vA)(2===t.size);const r=c.getField(e,n.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,h);break}case s.r.UV0:{(0,a.vA)(2===t.size);const r=c.getField(e,n.ZD)??c.getField(e,n.gH);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,h);break}case s.r.UVI:{(0,a.vA)(2===t.size);const r=c.getField(e,n.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,h);break}case s.r.COLOR:case s.r.SYMBOLCOLOR:{const r=c.getField(e,n.XP);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(3===t.size||4===t.size),f(t,t.size,r,h);break}case s.r.SIZEFEATUREATTRIBUTE:{const r=c.getField(e,n.Y$);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(1===t.size),v(t,r,h);break}case s.r.COLORFEATUREATTRIBUTE:case s.r.OPACITYFEATUREATTRIBUTE:{const r=c.getField(e,n.XW)??c.getField(e,n.Y$);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(1===t.size),v(t,r,h);break}case s.r.TANGENT:{(0,a.vA)(4===t.size);const i=c.getField(e,n.Eq);(0,a.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void u(e,r,i,n);const{data:a,indices:s}=e,c=t,l=r.typedBuffer,d=r.typedBufferStride,h=s.length,m=c[0],p=c[1],f=c[2],v=c[4],g=c[5],_=c[6],T=c[8],x=c[9],E=c[10],b=!(0,o.ut)(c),A=1e-6,M=1-A;if(i*=d,1===n)for(let e=0;e<h;++e){const t=4*s[e],r=a[t],o=a[t+1],n=a[t+2],c=a[t+3];let u=m*r+v*o+T*n,h=p*r+g*o+x*n,S=f*r+_*o+E*n;if(b){const e=u*u+h*h+S*S;if(e<M&&e>A){const t=1/Math.sqrt(e);u*=t,h*=t,S*=t}}l[i]=u,l[i+1]=h,l[i+2]=S,l[i+3]=c,i+=d}else for(let e=0;e<h;++e){const t=4*s[e],r=a[t],o=a[t+1],c=a[t+2],u=a[t+3];let h=m*r+v*o+T*c,S=p*r+g*o+x*c,C=f*r+_*o+E*c;if(b){const e=h*h+S*S+C*C;if(e<M&&e>A){const t=1/Math.sqrt(e);h*=t,S*=t,C*=t}}for(let e=0;e<n;++e)l[i]=h,l[i+1]=S,l[i+2]=C,l[i+3]=u,i+=d}}(t,r,i,h);break}case s.r.PROFILEVERTEXANDNORMAL:{(0,a.vA)(4===t.size);const r=c.getField(e,n.jz)??c.getField(e,n.Eq);(0,a.vA)(!!r,`No buffer view for ${e}`),u(t,r,h);break}case s.r.PROFILEAUXDATA:{(0,a.vA)(3===t.size);const r=c.getField(e,n.EC)??c.getField(e,n.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),d(t,r,h);break}}}(0,i.vt)()},60517:(e,t,r)=>{r.d(t,{z:()=>d});var i=r(49255),o=r(22911),n=r(42593),a=r(63365),s=r(31821),c=r(59643),l=r(49788);function d(e,t){e.include(n.Q,t),e.include(o.NL,t),e.fragment.include(a.a);const{output:r,oitPass:d,discardInvisibleFragments:u,snowCover:h}=t,m=r===i.V.ObjectAndLayerIdColor,p=(0,i.LG)(r),f=(0,i.RN)(r)&&d===c.Y.ColorAlpha,v=(0,i.RN)(r)&&d!==c.Y.ColorAlpha;let g=0;(v||p||f)&&e.outputs.add("fragColor","vec4",g++),p&&e.outputs.add("fragEmission","vec4",g++),f&&e.outputs.add("fragAlpha","float",g++),e.fragment.code.add(s.H`
643
661
  void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition, vec3 emissiveBaseColor ${(0,s.If)(h,", float snow")}) {
644
662
  ${(0,s.If)(m,"finalColor.a = 1.0;")}
645
663
 
@@ -702,14 +720,18 @@ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
702
720
  }
703
721
  float rgb2v(vec3 c) {
704
722
  return max(c.x, max(c.y, c.z));
705
- }`)}},63761:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},65786:(e,t,r)=>{r.d(t,{Y:()=>i});const i=class{};new i},66104:(e,t,r)=>{var i,o;r.d(t,{k5:()=>i}),r(34727),(o=i||(i={}))[o.Multiply=1]="Multiply",o[o.Ignore=2]="Ignore",o[o.Replace=3]="Replace",o[o.Tint=4]="Tint"},67171:(e,t,r)=>{r.d(t,{R:()=>a,e:()=>s});var i=r(63907),o=r(6625),n=r(42293);class a{constructor(e=0,t=e){this.width=e,this.height=t,this.type=o.d.TextureDescriptor,this.target=i.Ap.TEXTURE_2D,this.pixelFormat=i.Ab.RGBA,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=i.Cj.LINEAR,this.wrapMode=i.pF.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function s(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.IB)(e.internalFormat))*(e.target===i.Ap.TEXTURE_CUBE_MAP?6:1))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec2",i.c.Draw,((r,i,o,n)=>r.setUniform2fv(e,t(i,o,n))))}}},69270:(e,t,r)=>{var i;r.d(t,{c:()=>i}),function(e){e[e.Bind=0]="Bind",e[e.Pass=1]="Pass",e[e.Draw=2]="Draw"}(i||(i={}))},71955:(e,t,r)=>{r.d(t,{K:()=>d});var i=r(42583),o=r(31821),n=r(69270),a=r(74333);class s extends a.n{constructor(e,t){super(e,"int",n.c.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}var c=r(46540),l=r(43616);function d(e,t){t.hasSymbolColors?(e.include(i.A),e.attributes.add(c.r.SYMBOLCOLOR,"vec4"),e.varyings.add("colorMixMode","mediump float"),e.vertex.code.add(o.H`int symbolColorMixMode;
706
- vec4 getSymbolColor() {
707
- return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451;
708
- }
709
- void forwardColorMixMode() {
710
- colorMixMode = float(symbolColorMixMode) + 0.5;
711
- }`)):(e.fragment.uniforms.add(new s("colorMixMode",(e=>l.Um[e.colorMixMode]))),e.vertex.code.add(o.H`vec4 getSymbolColor() { return vec4(1.0); }
712
- void forwardColorMixMode() {}`))}},71988:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec4",i.c.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},72824:(e,t,r)=>{r.d(t,{Mh:()=>u,Zo:()=>h,gy:()=>m});var i=r(21818),o=r(29242),n=r(91829),a=r(96336),s=r(33752),c=r(31821),l=r(98353),d=r(35644);function u(e,t){switch(t.normalType){case a.W.Attribute:case a.W.Compressed:e.include(a.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new l.h("transformNormalGlobalFromModel",(e=>e.transformNormalGlobalFromModel)),new d.k("transformNormalViewFromGlobal",(e=>e.transformNormalViewFromGlobal))),e.vertex.code.add(c.H`void forwardNormal() {
723
+ }`)}},63761:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},65786:(e,t,r)=>{r.d(t,{Y:()=>i});const i=class{};new i},66104:(e,t,r)=>{var i,o;r.d(t,{k5:()=>i}),r(34727),(o=i||(i={}))[o.Multiply=1]="Multiply",o[o.Ignore=2]="Ignore",o[o.Replace=3]="Replace",o[o.Tint=4]="Tint"},67171:(e,t,r)=>{r.d(t,{R:()=>a,e:()=>s});var i=r(63907),o=r(6625),n=r(42293);class a{constructor(e=0,t=e){this.width=e,this.height=t,this.type=o.d.TextureDescriptor,this.target=i.Ap.TEXTURE_2D,this.pixelFormat=i.Ab.RGBA,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=i.Cj.LINEAR,this.wrapMode=i.pF.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function s(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.IB)(e.internalFormat))*(e.target===i.Ap.TEXTURE_CUBE_MAP?6:1))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"vec2",i.c.Draw,((i,o,n,a)=>i.setUniform2fv(e,t(o,n,a),r)))}}},69270:(e,t,r)=>{var i;r.d(t,{c:()=>i}),function(e){e[e.Bind=0]="Bind",e[e.Pass=1]="Pass",e[e.Draw=2]="Draw"}(i||(i={}))},71955:(e,t,r)=>{r.d(t,{K:()=>d});var i=r(43519),o=r(31821),n=r(69270),a=r(74333);class s extends a.n{constructor(e,t){super(e,"int",n.c.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}var c=r(46540),l=r(43616);function d(e,t){e.varyings.add("colorMixMode","int"),e.varyings.add("opacityMixMode","int"),e.vertex.uniforms.add(new s("symbolColorMixMode",(e=>l.Um[e.colorMixMode]))),t.hasSymbolColors?(e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.attributes.add(c.r.SYMBOLCOLOR,"vec4"),e.vertex.code.add(o.H`
724
+ MaskedColor applySymbolColor(MaskedColor color) {
725
+ return multiplyMaskedColors(color, createMaskedFromUInt8NaNColor(${c.r.SYMBOLCOLOR}));
726
+ }
727
+ `)):e.vertex.code.add(o.H`MaskedColor applySymbolColor(MaskedColor color) {
728
+ return color;
729
+ }`),e.vertex.code.add(o.H`
730
+ void forwardColorMixMode(bvec4 mask) {
731
+ colorMixMode = mask.r ? ${o.H.int(l.Um.ignore)} : symbolColorMixMode;
732
+ opacityMixMode = mask.a ? ${o.H.int(l.Um.ignore)} : symbolColorMixMode;
733
+ }
734
+ `)}},71988:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"vec4",i.c.Pass,((i,o,n)=>i.setUniform4fv(e,t(o,n),r)))}}},72824:(e,t,r)=>{r.d(t,{Mh:()=>u,Zo:()=>h,gy:()=>m});var i=r(21818),o=r(29242),n=r(91829),a=r(96336),s=r(33752),c=r(31821),l=r(98353),d=r(35644);function u(e,t){switch(t.normalType){case a.W.Attribute:case a.W.Compressed:e.include(a.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new l.h("transformNormalGlobalFromModel",(e=>e.transformNormalGlobalFromModel)),new d.k("transformNormalViewFromGlobal",(e=>e.transformNormalViewFromGlobal))),e.vertex.code.add(c.H`void forwardNormal() {
713
735
  vNormalWorld = transformNormalGlobalFromModel * normalModel();
714
736
  vNormalView = transformNormalViewFromGlobal * vNormalWorld;
715
737
  }`);break;case a.W.ScreenDerivative:e.vertex.code.add(c.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case a.W.COUNT:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.vt)()}}class m extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,o.vt)(),this.toMapSpace=(0,n.vt)()}}},74333:(e,t,r)=>{r.d(t,{n:()=>o}),r(44208);var i=r(69270);class o{constructor(e,t,r,o,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={[i.c.Bind]:null,[i.c.Pass]:null,[i.c.Draw]:null},o)switch(r){case void 0:break;case i.c.Bind:this.bind[i.c.Bind]=o;break;case i.c.Pass:this.bind[i.c.Pass]=o;break;case i.c.Draw:this.bind[i.c.Draw]=o}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>n,SY:()=>c,mb:()=>a});var i=r(38954),o=r(51850);function n({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:n,emissiveTexture:a,emissiveFactor:s,occlusionTexture:c}){return null==e&&null==t&&null==a&&(null==s||(0,i.q)(s,o.uY))&&null==c&&(null==n||1===n)&&(null==r||1===r)}const a=(0,o.CN)(1,1,.5),s=(0,o.CN)(0,.6,.2),c=(0,o.CN)(0,1,.2)},75039:(e,t,r)=>{var i;r.d(t,{d:()=>i}),function(e){e[e.Mesh=0]="Mesh",e[e.Point=1]="Point",e[e.Line=2]="Line"}(i||(i={}))},76591:(e,t,r)=>{r.d(t,{HQ:()=>l,rA:()=>d});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(40710),c=(r(33079),r(31821));function l(e,t){!function(e,t,...r){h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(c.H`void discardBySlice(vec3 pos) { }
@@ -757,7 +779,7 @@ depth = calculateLinearDepth(nearFar,eye.z);
757
779
  return proj * eye;
758
780
  }`),e.vertex.code.add(o.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
759
781
  return proj * (view * vec4(pos, 1.0));
760
- }`)}},77108:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec2",i.c.Bind,((r,i)=>r.setUniform2fv(e,t(i))))}}},77194:(e,t,r)=>{r.d(t,{MD:()=>c,cJ:()=>s,hs:()=>l,m0:()=>a});var i=r(34727),o=(r(17352),r(97937));function n(e,t,r){const i=r.parameters;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d}function a(e,t){return(0,i.Cc)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}function s(e,t,r,i){i.scale=function(e,t,r){const i=n(e,t,r);return i.minScaleFactor=0,a(1,i)}(e,t,r),i.factor=0,i.minScaleFactor=r.minScaleFactor}function c(e,t,r=[0,0]){const i=Math.min(Math.max(t.scale,t.minScaleFactor),1);return r[0]=e[0]*i,r[1]=e[1]*i,r}function l(e,t,r,i){return a(e,n(t,r,i))}r(24151),(0,i.kU)(10),(0,i.kU)(12),(0,i.kU)(70),(0,i.kU)(40);const d={scale:0,factor:0,minScaleFactor:0};(0,o.c)()},77695:(e,t,r)=>{r.d(t,{W:()=>f});var i=r(29242),o=r(48163),n=r(53466),a=r(99208),s=r(62602),c=r(47286),l=r(31821),d=r(35644),u=r(15976),h=r(63761),m=r(46540),p=r(69270);function f(e,t){const r=e.fragment,{hasVertexTangents:f,doubleSidedMode:v,hasNormalTexture:g,textureCoordinateType:_,bindType:T,hasNormalTextureTransform:x}=t;f?(e.attributes.add(m.r.TANGENT,"vec4"),e.varyings.add("vTangent","vec4"),v===s.W.WindingOrder?r.code.add(l.H`mat3 computeTangentSpace(vec3 normal) {
782
+ }`)}},77108:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"vec2",i.c.Bind,((i,o)=>i.setUniform2fv(e,t(o),r)))}}},77194:(e,t,r)=>{r.d(t,{MD:()=>c,cJ:()=>s,hs:()=>l,m0:()=>a});var i=r(34727),o=(r(17352),r(97937));function n(e,t,r){const i=r.parameters;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d}function a(e,t){return(0,i.Cc)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}function s(e,t,r,i){i.scale=function(e,t,r){const i=n(e,t,r);return i.minScaleFactor=0,a(1,i)}(e,t,r),i.factor=0,i.minScaleFactor=r.minScaleFactor}function c(e,t,r=[0,0]){const i=Math.min(Math.max(t.scale,t.minScaleFactor),1);return r[0]=e[0]*i,r[1]=e[1]*i,r}function l(e,t,r,i){return a(e,n(t,r,i))}r(24151),(0,i.kU)(10),(0,i.kU)(12),(0,i.kU)(70),(0,i.kU)(40);const d={scale:0,factor:0,minScaleFactor:0};(0,o.c)()},77695:(e,t,r)=>{r.d(t,{W:()=>f});var i=r(29242),o=r(48163),n=r(53466),a=r(99208),s=r(62602),c=r(47286),l=r(31821),d=r(35644),u=r(15976),h=r(63761),m=r(46540),p=r(69270);function f(e,t){const r=e.fragment,{hasVertexTangents:f,doubleSidedMode:v,hasNormalTexture:g,textureCoordinateType:_,bindType:T,hasNormalTextureTransform:x}=t;f?(e.attributes.add(m.r.TANGENT,"vec4"),e.varyings.add("vTangent","vec4"),v===s.W.WindingOrder?r.code.add(l.H`mat3 computeTangentSpace(vec3 normal) {
761
783
  float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
762
784
  vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
763
785
  vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
@@ -786,7 +808,7 @@ rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.co
786
808
  }`))}},78662:(e,t,r)=>{r.d(t,{Gd:()=>u,VC:()=>h}),r(44208);var i,o,n,a=r(34727),s=(r(77690),r(29242),r(58083),r(9093)),c=r(38954),l=r(51850),d=(r(87317),r(91829),r(31756),r(26857),r(16943),r(65786));(n=i||(i={}))[n.Undefined=0]="Undefined",n[n.DefinedSize=1]="DefinedSize",n[n.DefinedScale=2]="DefinedScale",function(e){e[e.Undefined=0]="Undefined",e[e.DefinedAngle=1]="DefinedAngle"}(o||(o={}));class u extends d.Y{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}}function h(e,t,r){if(!t.vvSize)return(0,c.i)(e,1,1,1),e;if(Number.isNaN(r[0]))return(0,c.c)(e,t.vvSize.fallback);for(let i=0;i<3;++i){const o=t.vvSize.offset[i]+r[0]*t.vvSize.factor[i];e[i]=(0,a.qE)(o,t.vvSize.minSize[i],t.vvSize.maxSize[i])}return e}(0,s.vt)(),(0,l.vt)(),(0,s.vt)()},82048:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821),o=r(46540);function n(e,t=!0){e.attributes.add(o.r.POSITION,"vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(i.H`
787
809
  gl_Position = vec4(position, 0.0, 1.0);
788
810
  ${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
789
- `)}},87170:(e,t,r)=>{r.d(t,{V:()=>w});var i=r(24326),o=r(9093),n=r(38954),a=r(97146),s=r(57917),c=r(29920),l=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,n.d)(m,t,e),(0,n.d)(p,r,e),.5*(0,n.l)((0,n.h)(m,m,p))}r(32114),new d.I(u.vt),new d.I((()=>{return e?{p0:(0,l.o8)(e.p0),p1:(0,l.o8)(e.p1),p2:(0,l.o8)(e.p2)}:{p0:(0,l.vt)(),p1:(0,l.vt)(),p2:(0,l.vt)()};var e}));const m=(0,l.vt)(),p=(0,l.vt)(),f=(0,l.vt)(),v=(0,l.vt)(),g=(0,l.vt)(),_=(0,l.vt)();var T=r(75039),x=r(89192);class E{constructor(){this.uid=(0,i.c)()}}class b extends E{constructor(e){super(),this.highlightName=e,this.channel=x.Mg.Highlight}}var A=r(620),S=r(46540),M=r(94656);class w{constructor(e,t,r=null,o=T.d.Mesh,n=null,s=-1){this.material=e,this.mapPositions=r,this.type=o,this.objectAndLayerIdColor=n,this.edgeIndicesLength=s,this.highlights=new Set,this._highlightOptionsCounts=new Map,this.id=(0,i.c)(),this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,a.Dg)(r.indices)}),e===S.r.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new w(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)})),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,s.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,M.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===T.d.Mesh?this._computeAttachmentOriginTriangles(e):this.type===T.d.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,n.t)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:o}=e;(0,n.i)(t,0,0,0),(0,n.i)(_,0,0,0);let a=0,s=0;for(let e=0;e<o.length-2;e+=3){const c=o[e]*r,l=o[e+1]*r,d=o[e+2]*r;(0,n.i)(f,i[c],i[c+1],i[c+2]),(0,n.i)(v,i[l],i[l+1],i[l+2]),(0,n.i)(g,i[d],i[d+1],i[d+2]);const u=h(f,v,g);u?((0,n.f)(f,f,v),(0,n.f)(f,f,g),(0,n.g)(f,f,1/3*u),(0,n.f)(t,t,f),a+=u):((0,n.f)(_,_,f),(0,n.f)(_,_,v),(0,n.f)(_,_,g),s+=3)}return!(0===s&&0===a||(0!==a?((0,n.g)(t,t,1/a),0):0===s||((0,n.g)(t,_,1/s),0)))}(this.attributes.get(S.r.POSITION),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(S.r.POSITION);return function(e,t,r){if(!e)return!1;(0,n.i)(r,0,0,0),(0,n.i)(_,0,0,0);let i=0,o=0;const{size:a,data:s,indices:c}=e,l=c.length-1,d=l+(t?2:0);for(let e=0;e<d;e+=2){const t=e<l?e+1:0,d=c[e<l?e:l]*a,u=c[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],v[0]=s[u],v[1]=s[u+1],v[2]=s[u+2],(0,n.g)(f,(0,n.f)(f,f,v),.5);const h=(0,n.F)(f,v);h>0?((0,n.f)(r,r,(0,n.g)(f,f,h)),i+=h):0===i&&((0,n.f)(_,_,f),o++)}return 0!==i?((0,n.g)(r,r,1/i),!0):0!==o&&((0,n.g)(r,_,1/o),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:o}=e;(0,n.i)(t,0,0,0);let a=-1,s=0;for(let e=0;e<o.length;e++){const n=o[e]*r;a!==n&&(t[0]+=i[n],t[1]+=i[n+1],t[2]+=i[n+2],s++),a=n}return s>1&&(0,n.g)(t,t,1/s),s>0}(this.attributes.get(S.r.POSITION),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(S.r.POSITION);if(!e||0===e.indices.length)return null;const t=this.type===T.d.Mesh?3:1;(0,A.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,a.tM)(e.indices.length/t);return new c.j(r,t,e)}get transformation(){return this._transformation??o.zK}set transformation(e){this._transformation=e&&e!==o.zK?(0,o.o8)(e):null}get highlightNames(){return this._highlightOptionsCounts}get hasHighlights(){return this._highlightOptionsCounts.size>0}foreachHighlightOptions(e){this._highlightOptionsCounts.forEach(((t,r)=>e(r)))}allocateIdAndHighlight(e){const t=new b(e);return this.addHighlight(t)}addHighlight(e){this.highlights.add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts.get(t)??0)+1;return this._highlightOptionsCounts.set(t,r),e}removeHighlight(e){if(this.highlights.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts.get(t)??0;r<=1?this._highlightOptionsCounts.delete(t):this._highlightOptionsCounts.set(t,r-1)}}}},89192:(e,t,r)=>{var i,o,n,a,s,c,l,d;r.d(t,{Am:()=>a,C7:()=>n,JS:()=>d,Mg:()=>c,dd:()=>s,it:()=>o,s2:()=>i,sf:()=>l}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(o||(o={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(n||(n={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee"}(c||(c={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(l||(l={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(d||(d={}))},89390:(e,t,r)=>{r.d(t,{kA:()=>w,a8:()=>S,eU:()=>M});var i=r(40876),o=(r(44208),r(38954)),n=r(51850),a=r(87317),s=r(91829),c=r(59469),l=r(23205),d=r(14314),u=r(31821);function h(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new l.d("lightingAmbientSH0",(({lighting:e})=>(0,o.i)(m,e.sh.r[0],e.sh.g[0],e.sh.b[0])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
811
+ `)}},87170:(e,t,r)=>{r.d(t,{V:()=>C});var i=r(24326),o=r(9093),n=r(38954),a=r(97146),s=r(57917),c=r(29920),l=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,n.d)(m,t,e),(0,n.d)(p,r,e),.5*(0,n.l)((0,n.h)(m,m,p))}r(32114),new d.I(u.vt),new d.I((()=>{return e?{p0:(0,l.o8)(e.p0),p1:(0,l.o8)(e.p1),p2:(0,l.o8)(e.p2)}:{p0:(0,l.vt)(),p1:(0,l.vt)(),p2:(0,l.vt)()};var e}));const m=(0,l.vt)(),p=(0,l.vt)(),f=(0,l.vt)(),v=(0,l.vt)(),g=(0,l.vt)(),_=(0,l.vt)();var T=r(75039),x=r(89192);class E{constructor(){this.uid=(0,i.c)()}}class b extends E{constructor(e){super(),this.highlightName=e,this.channel=x.Mg.Highlight}}var A=r(620),M=r(46540),S=r(94656);class C{constructor(e,t,r=null,o=T.d.Mesh,n=null,s=-1){this.material=e,this.mapPositions=r,this.type=o,this.objectAndLayerIdColor=n,this.edgeIndicesLength=s,this.highlights=new Set,this._highlightOptionsCounts=new Map,this.id=(0,i.c)(),this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,a.Dg)(r.indices)}),e===M.r.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new C(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)})),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,s.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,S.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===T.d.Mesh?this._computeAttachmentOriginTriangles(e):this.type===T.d.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,n.t)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:o}=e;(0,n.i)(t,0,0,0),(0,n.i)(_,0,0,0);let a=0,s=0;for(let e=0;e<o.length-2;e+=3){const c=o[e]*r,l=o[e+1]*r,d=o[e+2]*r;(0,n.i)(f,i[c],i[c+1],i[c+2]),(0,n.i)(v,i[l],i[l+1],i[l+2]),(0,n.i)(g,i[d],i[d+1],i[d+2]);const u=h(f,v,g);u?((0,n.f)(f,f,v),(0,n.f)(f,f,g),(0,n.g)(f,f,1/3*u),(0,n.f)(t,t,f),a+=u):((0,n.f)(_,_,f),(0,n.f)(_,_,v),(0,n.f)(_,_,g),s+=3)}return!(0===s&&0===a||(0!==a?((0,n.g)(t,t,1/a),0):0===s||((0,n.g)(t,_,1/s),0)))}(this.attributes.get(M.r.POSITION),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(M.r.POSITION);return function(e,t,r){if(!e)return!1;(0,n.i)(r,0,0,0),(0,n.i)(_,0,0,0);let i=0,o=0;const{size:a,data:s,indices:c}=e,l=c.length-1,d=l+(t?2:0);for(let e=0;e<d;e+=2){const t=e<l?e+1:0,d=c[e<l?e:l]*a,u=c[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],v[0]=s[u],v[1]=s[u+1],v[2]=s[u+2],(0,n.g)(f,(0,n.f)(f,f,v),.5);const h=(0,n.F)(f,v);h>0?((0,n.f)(r,r,(0,n.g)(f,f,h)),i+=h):0===i&&((0,n.f)(_,_,f),o++)}return 0!==i?((0,n.g)(r,r,1/i),!0):0!==o&&((0,n.g)(r,_,1/o),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:o}=e;(0,n.i)(t,0,0,0);let a=-1,s=0;for(let e=0;e<o.length;e++){const n=o[e]*r;a!==n&&(t[0]+=i[n],t[1]+=i[n+1],t[2]+=i[n+2],s++),a=n}return s>1&&(0,n.g)(t,t,1/s),s>0}(this.attributes.get(M.r.POSITION),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(M.r.POSITION);if(!e||0===e.indices.length)return null;const t=this.type===T.d.Mesh?3:1;(0,A.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,a.tM)(e.indices.length/t);return new c.j(r,t,e)}get transformation(){return this._transformation??o.zK}set transformation(e){this._transformation=e&&e!==o.zK?(0,o.o8)(e):null}get highlightNames(){return this._highlightOptionsCounts}get hasHighlights(){return this._highlightOptionsCounts.size>0}foreachHighlightOptions(e){this._highlightOptionsCounts.forEach(((t,r)=>e(r)))}allocateIdAndHighlight(e){const t=new b(e);return this.addHighlight(t)}addHighlight(e){this.highlights.add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts.get(t)??0)+1;return this._highlightOptionsCounts.set(t,r),e}removeHighlight(e){if(this.highlights.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts.get(t)??0;r<=1?this._highlightOptionsCounts.delete(t):this._highlightOptionsCounts.set(t,r-1)}}}},89192:(e,t,r)=>{var i,o,n,a,s,c,l,d;r.d(t,{Am:()=>a,C7:()=>n,JS:()=>d,Mg:()=>c,dd:()=>s,it:()=>o,s2:()=>i,sf:()=>l}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(o||(o={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(n||(n={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee"}(c||(c={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(l||(l={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(d||(d={}))},89390:(e,t,r)=>{r.d(t,{kA:()=>C,a8:()=>M,eU:()=>S});var i=r(40876),o=(r(44208),r(38954)),n=r(51850),a=r(87317),s=r(91829),c=r(59469),l=r(23205),d=r(14314),u=r(31821);function h(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new l.d("lightingAmbientSH0",(({lighting:e})=>(0,o.i)(m,e.sh.r[0],e.sh.g[0],e.sh.b[0])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
790
812
  vec3 ambientLight = 0.282095 * lightingAmbientSH0;
791
813
  return ambientLight * (1.0 - ambientOcclusion);
792
814
  }`)):1===i?(r.uniforms.add(new d.I("lightingAmbientSH_R",(({lighting:e})=>(0,a.s)(p,e.sh.r[0],e.sh.r[1],e.sh.r[2],e.sh.r[3]))),new d.I("lightingAmbientSH_G",(({lighting:e})=>(0,a.s)(p,e.sh.g[0],e.sh.g[1],e.sh.g[2],e.sh.g[3]))),new d.I("lightingAmbientSH_B",(({lighting:e})=>(0,a.s)(p,e.sh.b[0],e.sh.b[1],e.sh.b[2],e.sh.b[3])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
@@ -839,11 +861,11 @@ vec2 p = vec2(0.02, 0.0075) * averageAmbientRadiance;
839
861
  return vec3(mapChannel(color.x, p), mapChannel(color.y, p), mapChannel(color.z, p));
840
862
  }`)}function A(e){e.code.add(u.H`vec3 tonemapACES(vec3 x) {
841
863
  return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
842
- }`)}function S(e){e.constants.add("ambientBoostFactor","float",E)}function M(e){e.uniforms.add(new x.U("lightingGlobalFactor",(e=>e.lighting.globalFactor)))}function w(e,t){const r=e.fragment,{pbrMode:o,spherical:n,hasColorTexture:a}=t;r.include(f.n,t),o!==c.A9.Disabled&&r.include(g.c,t),e.include(h,t),r.include(_.p),r.include(A,t);const s=!(o===c.A9.Schematic&&!a);switch(s&&r.include(b),r.code.add(u.H`
864
+ }`)}function M(e){e.constants.add("ambientBoostFactor","float",E)}function S(e){e.uniforms.add(new x.U("lightingGlobalFactor",(e=>e.lighting.globalFactor)))}function C(e,t){const r=e.fragment,{pbrMode:o,spherical:n,hasColorTexture:a}=t;r.include(f.n,t),o!==c.A9.Disabled&&r.include(g.c,t),e.include(h,t),r.include(_.p),r.include(A,t);const s=!(o===c.A9.Schematic&&!a);switch(s&&r.include(b),r.code.add(u.H`
843
865
  const float GAMMA_SRGB = ${u.H.float(i.Tf)};
844
866
  const float INV_GAMMA_SRGB = 0.4761904;
845
867
  ${(0,u.If)(o!==c.A9.Disabled,"const float GROUND_REFLECTANCE = 0.2;")}
846
- `),S(r),M(r),(0,v.Gc)(r),r.code.add(u.H`
868
+ `),M(r),S(r),(0,v.Gc)(r),r.code.add(u.H`
847
869
  float additionalDirectedAmbientLight(vec3 vPosWorld) {
848
870
  float vndl = dot(${n?u.H`normalize(vPosWorld)`:u.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
849
871
  return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
@@ -929,7 +951,9 @@ vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceC
929
951
  vec3 outColorLinear = outDiffColor + specularComponent;
930
952
  vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB));
931
953
  return outColor;
932
- }`);default:case c.A9.COUNT:}}(0,n.vt)()},89786:(e,t,r)=>{function i(e){const t=.3183098861837907;e.constants.add("PI","float",3.141592653589793),e.constants.add("LIGHT_NORMALIZATION","float",t),e.constants.add("INV_PI","float",t),e.constants.add("HALF_PI","float",1.570796326794897),e.constants.add("TWO_PI","float",6.28318530717958)}r.d(t,{p:()=>i})},90644:(e,t,r)=>{r.d(t,{Ey:()=>A,RC:()=>s,T8:()=>c,Uy:()=>h,Xt:()=>u,kn:()=>m,p3:()=>a});var i=r(89192),o=r(63907);function n(e,t,r=o.Tb.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function a(e,t,r,i,n=o.Tb.ADD,a=o.Tb.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}n(o.dn.ZERO,o.dn.ONE_MINUS_SRC_ALPHA),n(o.dn.ONE,o.dn.ZERO),n(o.dn.ONE,o.dn.ONE);const s=n(o.dn.ONE,o.dn.ONE_MINUS_SRC_ALPHA),c=a(o.dn.SRC_ALPHA,o.dn.ONE,o.dn.ONE_MINUS_SRC_ALPHA,o.dn.ONE_MINUS_SRC_ALPHA),l={face:o.Y7.BACK,mode:o.Ac.CCW},d={face:o.Y7.FRONT,mode:o.Ac.CCW},u=e=>e===i.s2.Back?l:e===i.s2.Front?d:null,h={zNear:0,zFar:1},m={r:!0,g:!0,b:!0,a:!0};function p(e){return w.intern(e)}function f(e){return R.intern(e)}function v(e){return I.intern(e)}function g(e){return y.intern(e)}function _(e){return D.intern(e)}function T(e){return H.intern(e)}function x(e){return B.intern(e)}function E(e){return G.intern(e)}function b(e){return V.intern(e)}function A(e){return j.intern(e)}class S{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function M(e){return"["+e.join(",")+"]"}const w=new S(C,(e=>({__tag:"Blending",...e})));function C(e){return e?M([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 R=new S(O,(e=>({__tag:"Culling",...e})));function O(e){return e?M([e.face,e.mode]):null}const I=new S(N,(e=>({__tag:"PolygonOffset",...e})));function N(e){return e?M([e.factor,e.units]):null}const y=new S(P,(e=>({__tag:"DepthTest",...e})));function P(e){return e?M([e.func]):null}const D=new S(L,(e=>({__tag:"StencilTest",...e})));function L(e){return e?M([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const H=new S(F,(e=>({__tag:"DepthWrite",...e})));function F(e){return e?M([e.zNear,e.zFar]):null}const B=new S(U,(e=>({__tag:"ColorWrite",...e})));function U(e){return e?M([e.r,e.g,e.b,e.a]):null}const G=new S(z,(e=>({__tag:"StencilWrite",...e})));function z(e){return e?M([e.mask]):null}const V=new S(W,(e=>({__tag:"DrawBuffers",...e})));function W(e){return e?M(e.buffers):null}const j=new S((function(e){return e?M([C(e.blending),O(e.culling),N(e.polygonOffset),P(e.depthTest),L(e.stencilTest),F(e.depthWrite),U(e.colorWrite),z(e.stencilWrite),W(e.drawBuffers)]):null}),(e=>({blending:p(e.blending),culling:f(e.culling),polygonOffset:v(e.polygonOffset),depthTest:g(e.depthTest),stencilTest:_(e.stencilTest),depthWrite:T(e.depthWrite),colorWrite:x(e.colorWrite),stencilWrite:E(e.stencilWrite),drawBuffers:b(e.drawBuffers)})))},92700:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821),o=r(46540);function n(e,t){t.hasVertexColors?(e.attributes.add(o.r.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(i.H`void forwardVertexColor() {}
954
+ }`);default:case c.A9.COUNT:}}(0,n.vt)()},89786:(e,t,r)=>{function i(e){const t=.3183098861837907;e.constants.add("PI","float",3.141592653589793),e.constants.add("LIGHT_NORMALIZATION","float",t),e.constants.add("INV_PI","float",t),e.constants.add("HALF_PI","float",1.570796326794897),e.constants.add("TWO_PI","float",6.28318530717958)}r.d(t,{p:()=>i})},90644:(e,t,r)=>{r.d(t,{Ey:()=>A,RC:()=>s,T8:()=>c,Uy:()=>h,Xt:()=>u,kn:()=>m,p3:()=>a});var i=r(89192),o=r(63907);function n(e,t,r=o.Tb.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function a(e,t,r,i,n=o.Tb.ADD,a=o.Tb.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}n(o.dn.ZERO,o.dn.ONE_MINUS_SRC_ALPHA),n(o.dn.ONE,o.dn.ZERO),n(o.dn.ONE,o.dn.ONE);const s=n(o.dn.ONE,o.dn.ONE_MINUS_SRC_ALPHA),c=a(o.dn.SRC_ALPHA,o.dn.ONE,o.dn.ONE_MINUS_SRC_ALPHA,o.dn.ONE_MINUS_SRC_ALPHA),l={face:o.Y7.BACK,mode:o.Ac.CCW},d={face:o.Y7.FRONT,mode:o.Ac.CCW},u=e=>e===i.s2.Back?l:e===i.s2.Front?d:null,h={zNear:0,zFar:1},m={r:!0,g:!0,b:!0,a:!0};function p(e){return C.intern(e)}function f(e){return R.intern(e)}function v(e){return I.intern(e)}function g(e){return y.intern(e)}function _(e){return D.intern(e)}function T(e){return H.intern(e)}function x(e){return B.intern(e)}function E(e){return G.intern(e)}function b(e){return V.intern(e)}function A(e){return j.intern(e)}class M{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function S(e){return"["+e.join(",")+"]"}const C=new M(w,(e=>({__tag:"Blending",...e})));function w(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 R=new M(O,(e=>({__tag:"Culling",...e})));function O(e){return e?S([e.face,e.mode]):null}const I=new M(N,(e=>({__tag:"PolygonOffset",...e})));function N(e){return e?S([e.factor,e.units]):null}const y=new M(P,(e=>({__tag:"DepthTest",...e})));function P(e){return e?S([e.func]):null}const D=new M(L,(e=>({__tag:"StencilTest",...e})));function L(e){return e?S([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const H=new M(F,(e=>({__tag:"DepthWrite",...e})));function F(e){return e?S([e.zNear,e.zFar]):null}const B=new M(U,(e=>({__tag:"ColorWrite",...e})));function U(e){return e?S([e.r,e.g,e.b,e.a]):null}const G=new M(z,(e=>({__tag:"StencilWrite",...e})));function z(e){return e?S([e.mask]):null}const V=new M(W,(e=>({__tag:"DrawBuffers",...e})));function W(e){return e?S(e.buffers):null}const j=new M((function(e){return e?S([w(e.blending),O(e.culling),N(e.polygonOffset),P(e.depthTest),L(e.stencilTest),F(e.depthWrite),U(e.colorWrite),z(e.stencilWrite),W(e.drawBuffers)]):null}),(e=>({blending:p(e.blending),culling:f(e.culling),polygonOffset:v(e.polygonOffset),depthTest:g(e.depthTest),stencilTest:_(e.stencilTest),depthWrite:T(e.depthWrite),colorWrite:x(e.colorWrite),stencilWrite:E(e.stencilWrite),drawBuffers:b(e.drawBuffers)})))},92700:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821),o=r(46540);function n(e,t){t.hasVertexColors?(e.attributes.add(o.r.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`
955
+ void forwardNormalizedVertexColor() { vColor = color * ${i.H.float(1/255)}; }
956
+ `)):e.vertex.code.add(i.H`void forwardVertexColor() {}
933
957
  void forwardNormalizedVertexColor() {}`)}},92993:(e,t,r)=>{var i;r.d(t,{n:()=>i}),function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"}(i||(i={}))},94656:(e,t,r)=>{r.d(t,{Y2:()=>d,en:()=>l});var i=r(49186),o=r(44208),n=r(53966),a=r(63907);const s=()=>n.A.getLogger("esri.views.webgl.checkWebGLError"),c=!!(0,o.A)("enable-feature:webgl-debug");function l(){return c}function d(e,t=l()){if(t){const t=e.getError();if(t){const e=function(e){switch(e){case a.bh.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case a.bh.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case a.bh.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case a.bh.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case a.bh.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case a.bh.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(t),r=(new Error).stack;s().error(new i.A("webgl-error","WebGL error occurred",{message:e,stack:r}))}}}},95774:(e,t,r)=>{r.d(t,{S:()=>m,b:()=>h});var i=r(82048),o=r(52540),n=r(68259),a=r(20304),s=r(31821),c=r(15976),l=r(63761),d=r(14113);const u=4;function h(){const e=new d.N5,t=e.fragment;e.include(i.c);const r=(u+1)/2,h=1/(2*r*r);return t.include(o.E),t.uniforms.add(new l.N("depthMap",(e=>e.depthTexture)),new c.o("tex",(e=>e.colorTexture)),new n.t("blurSize",(e=>e.blurSize)),new a.m("projScale",((e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale}))),t.code.add(s.H`
934
958
  void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
935
959
  float c = texture(tex, uv).r;
@@ -968,10 +992,10 @@ return normalize(cross(dFdx(positionView), dFdy(positionView)));
968
992
  float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r;
969
993
  float linearDepth = linearizeDepth(depth);
970
994
  ${t?"return viewPosDepth < linearDepth && depth < 1.0;":`if(viewPosDepth ${a?">":"<="} linearDepth) discard;`}
971
- }`)}},97220:(e,t,r)=>{r.d(t,{$:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98353:(e,t,r)=>{r.d(t,{h:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"mat3",i.c.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},98619:(e,t,r)=>{r.d(t,{Gc:()=>n,O4:()=>a,Vt:()=>s});var i=r(23205),o=r(31821);function n(e){e.uniforms.add(new i.d("mainLightDirection",(e=>e.lighting.mainLight.direction)))}function a(e){e.uniforms.add(new i.d("mainLightIntensity",(e=>e.lighting.mainLight.intensity)))}function s(e){n(e.fragment),a(e.fragment),e.fragment.code.add(o.H`vec3 applyShading(vec3 shadingNormal, float shadow) {
995
+ }`)}},97220:(e,t,r)=>{r.d(t,{$:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98353:(e,t,r)=>{r.d(t,{h:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"mat3",i.c.Draw,((i,o,n)=>i.setUniformMatrix3fv(e,t(o,n),r)))}}},98619:(e,t,r)=>{r.d(t,{Gc:()=>n,O4:()=>a,Vt:()=>s});var i=r(23205),o=r(31821);function n(e){e.uniforms.add(new i.d("mainLightDirection",(e=>e.lighting.mainLight.direction)))}function a(e){e.uniforms.add(new i.d("mainLightIntensity",(e=>e.lighting.mainLight.intensity)))}function s(e){n(e.fragment),a(e.fragment),e.fragment.code.add(o.H`vec3 applyShading(vec3 shadingNormal, float shadow) {
972
996
  float dotVal = clamp(dot(shadingNormal, mainLightDirection), 0.0, 1.0);
973
997
  return mainLightIntensity * ((1.0 - shadow) * dotVal);
974
- }`)}},98958:(e,t,r)=>{r.d(t,{w:()=>u,L:()=>h});var i=r(53966),o=r(97768),n=r(49255),a=r(39341),s=(r(44208),r(94656));class c{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._glProgram=e.programCache.acquire(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear()}bindTexture(e,t){t?.glName||((0,s.en)()&&console.error(`Texture sampler ${e} has no given Texture in ${(new Error).stack} `),t=this._context.emptyTexture);const r=this._ensureTextureUnit(e,t);this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit)}_ensureTextureUnit(e,t){let r=this._textures.get(e);return null==r?(r={texture:t,unit:this._textures.size},this._textures.set(e,r)):r.texture=t,r}}var l=r(63907),d=r(90644);class u{constructor(e,t,r,n=a.D){this.locations=n,this.primitiveType=l.WR.TRIANGLES,this.key=t.key,this._program=new c(e.rctx,r.get().build(t),n),this._pipeline=this.initializePipeline(t),this.reload=async a=>{a&&await r.reload(),this.key.equals(t.key)||i.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn("Configuration was changed after construction, cannot reload shader.",r),(0,o.WD)(this._program),this._program=new c(e.rctx,r.get().build(t),n),this._pipeline=this.initializePipeline(t)}}destroy(){this._program=(0,o.WD)(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t){return this._pipeline}initializePipeline(e){return(0,d.Ey)({blending:d.RC,colorWrite:d.kn})}}function h(e,t){return(0,n.Vg)(e)?{buffers:[l.Hr.NONE]}:t??null}},99208:(e,t,r)=>{r.d(t,{r:()=>a});var i=r(53466),o=r(31821);function n(e){e.fragment.code.add(o.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
998
+ }`)}},98958:(e,t,r)=>{r.d(t,{w:()=>u,L:()=>h});var i=r(53966),o=r(97768),n=r(49255),a=r(39341),s=(r(44208),r(94656));class c{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._glProgram=e.programCache.acquire(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t,r){this._glProgram.setUniform1f(e,t,r)}setUniform2fv(e,t,r){this._glProgram.setUniform2fv(e,t,r)}setUniform3fv(e,t,r){this._glProgram.setUniform3fv(e,t,r)}setUniform4fv(e,t,r){this._glProgram.setUniform4fv(e,t,r)}setUniformMatrix3fv(e,t,r){this._glProgram.setUniformMatrix3fv(e,t,!1,r)}setUniformMatrix4fv(e,t,r){this._glProgram.setUniformMatrix4fv(e,t,!1,r)}setUniform1fv(e,t,r){this._glProgram.setUniform1fv(e,t,r)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear()}bindTexture(e,t){t?.glName||((0,s.en)()&&console.error(`Texture sampler ${e} has no given Texture in ${(new Error).stack} `),t=this._context.emptyTexture);const r=this._ensureTextureUnit(e,t);this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit)}_ensureTextureUnit(e,t){let r=this._textures.get(e);return null==r?(r={texture:t,unit:this._textures.size},this._textures.set(e,r)):r.texture=t,r}}var l=r(63907),d=r(90644);class u{constructor(e,t,r,n=a.D){this.locations=n,this.primitiveType=l.WR.TRIANGLES,this.key=t.key,this._program=new c(e.rctx,r.get().build(t),n),this._pipeline=this.initializePipeline(t),this.reload=async a=>{a&&await r.reload(),this.key.equals(t.key)||i.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn("Configuration was changed after construction, cannot reload shader.",r),(0,o.WD)(this._program),this._program=new c(e.rctx,r.get().build(t),n),this._pipeline=this.initializePipeline(t)}}destroy(){this._program=(0,o.WD)(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t){return this._pipeline}initializePipeline(e){return(0,d.Ey)({blending:d.RC,colorWrite:d.kn})}}function h(e,t){return(0,n.Vg)(e)?{buffers:[l.Hr.NONE]}:t??null}},99208:(e,t,r)=>{r.d(t,{r:()=>a});var i=r(53466),o=r(31821);function n(e){e.fragment.code.add(o.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
975
999
  vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
976
1000
  vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
977
1001
  float maxdUV = 0.125;