@arcgis/core 5.2.0-next.132 → 5.2.0-next.134

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 (173) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/107f4bcf8e6c91a67010.js +1 -0
  3. package/assets/esri/core/workers/chunks/{081c9ccaa5884c730a91.js → 1688c4dcd36db992a9dc.js} +1 -1
  4. package/assets/esri/core/workers/chunks/3a6b8f9aabde7e138834.js +1 -0
  5. package/assets/esri/core/workers/chunks/{18d5bad86ea3ef3ec747.js → eba9e03c1c9aa55044a3.js} +120 -120
  6. package/assets/esri/core/workers/chunks/f6c8e5abe1d55ab5c7dd.js +1 -0
  7. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-arabic.woff2 +0 -0
  8. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-cyrillic.woff2 +0 -0
  9. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-ext.woff2 +0 -0
  10. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-georgian.woff2 +0 -0
  11. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-greek.woff2 +0 -0
  12. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-hebrew.woff2 +0 -0
  13. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-math.woff2 +0 -0
  14. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-thai.woff2 +0 -0
  15. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-vietnamese.woff2 +0 -0
  16. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02.woff2 +0 -0
  17. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-arabic.woff2 +0 -0
  18. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-cyrillic.woff2 +0 -0
  19. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-ext.woff2 +0 -0
  20. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-georgian.woff2 +0 -0
  21. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-greek.woff2 +0 -0
  22. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-hebrew.woff2 +0 -0
  23. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-math.woff2 +0 -0
  24. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-thai.woff2 +0 -0
  25. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-vietnamese.woff2 +0 -0
  26. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7.woff2 +0 -0
  27. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-arabic.woff2 +0 -0
  28. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-cyrillic.woff2 +0 -0
  29. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-ext.woff2 +0 -0
  30. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-georgian.woff2 +0 -0
  31. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-greek.woff2 +0 -0
  32. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-hebrew.woff2 +0 -0
  33. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-math.woff2 +0 -0
  34. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-thai.woff2 +0 -0
  35. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-vietnamese.woff2 +0 -0
  36. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688.woff2 +0 -0
  37. package/assets/esri/themes/base/fonts/fonts/3ae1e25e-3aa6-4061-a016-a079159f9d65.woff2 +0 -0
  38. package/assets/esri/themes/base/fonts/fonts/41331c3c-3759-4462-8695-33c9a21b6a5b.woff2 +0 -0
  39. package/assets/esri/themes/base/fonts/fonts/94aa531e-7746-4df0-bb6e-349891f2eda5.woff2 +0 -0
  40. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-arabic.woff2 +0 -0
  41. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-cyrillic.woff2 +0 -0
  42. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-ext.woff2 +0 -0
  43. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-georgian.woff2 +0 -0
  44. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-greek.woff2 +0 -0
  45. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-hebrew.woff2 +0 -0
  46. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-math.woff2 +0 -0
  47. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-thai.woff2 +0 -0
  48. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-vietnamese.woff2 +0 -0
  49. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939.woff2 +0 -0
  50. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-cyrillic.woff2 +0 -0
  51. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-ext.woff2 +0 -0
  52. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-greek.woff2 +0 -0
  53. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-hebrew.woff2 +0 -0
  54. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-math.woff2 +0 -0
  55. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-vietnamese.woff2 +0 -0
  56. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d.woff2 +0 -0
  57. package/assets/esri/themes/base/fonts/fonts.scss +0 -0
  58. package/chunks/GaussianSplat.glsl.js +24 -9
  59. package/chunks/LineMarker.glsl.js +23 -23
  60. package/chunks/RibbonLine.glsl.js +136 -99
  61. package/config.js +1 -1
  62. package/core/PooledArray.js +1 -1
  63. package/geometry/operators/affineTransformOperator.d.ts +4 -0
  64. package/geometry/operators/alphaShapeOperator.d.ts +10 -1
  65. package/geometry/operators/areaOperator.d.ts +3 -0
  66. package/geometry/operators/autoCompleteOperator.d.ts +3 -0
  67. package/geometry/operators/boundaryOperator.d.ts +4 -0
  68. package/geometry/operators/bufferOperator.d.ts +6 -0
  69. package/geometry/operators/centroidOperator.d.ts +3 -0
  70. package/geometry/operators/clipOperator.d.ts +4 -0
  71. package/geometry/operators/containsOperator.d.ts +4 -0
  72. package/geometry/operators/convexHullOperator.d.ts +6 -0
  73. package/geometry/operators/crossesOperator.d.ts +4 -0
  74. package/geometry/operators/cutOperator.d.ts +3 -0
  75. package/geometry/operators/densifyOperator.d.ts +5 -0
  76. package/geometry/operators/differenceOperator.d.ts +4 -0
  77. package/geometry/operators/disjointOperator.d.ts +4 -0
  78. package/geometry/operators/distanceOperator.d.ts +4 -0
  79. package/geometry/operators/equalsOperator.d.ts +4 -0
  80. package/geometry/operators/extendOperator.d.ts +4 -0
  81. package/geometry/operators/generalizeOperator.d.ts +5 -0
  82. package/geometry/operators/geodesicBufferOperator.d.ts +8 -0
  83. package/geometry/operators/geodesicProximityOperator.d.ts +9 -0
  84. package/geometry/operators/geodeticAreaOperator.d.ts +6 -0
  85. package/geometry/operators/geodeticDensifyOperator.d.ts +7 -0
  86. package/geometry/operators/geodeticDistanceOperator.d.ts +6 -0
  87. package/geometry/operators/geodeticLengthOperator.d.ts +6 -0
  88. package/geometry/operators/geodeticUtilsOperator.d.ts +7 -0
  89. package/geometry/operators/graphicBufferOperator.d.ts +4 -0
  90. package/geometry/operators/integrateOperator.d.ts +3 -0
  91. package/geometry/operators/intersectionOperator.d.ts +5 -0
  92. package/geometry/operators/intersectsOperator.d.ts +4 -0
  93. package/geometry/operators/isNearOperator.d.ts +4 -0
  94. package/geometry/operators/labelPointOperator.d.ts +4 -0
  95. package/geometry/operators/lengthOperator.d.ts +3 -0
  96. package/geometry/operators/linesToPolygonsOperator.d.ts +3 -0
  97. package/geometry/operators/locateBetweenOperator.d.ts +3 -0
  98. package/geometry/operators/minimumBoundingCircleOperator.d.ts +5 -0
  99. package/geometry/operators/multiPartToSinglePartOperator.d.ts +4 -0
  100. package/geometry/operators/offsetOperator.d.ts +5 -0
  101. package/geometry/operators/overlapsOperator.d.ts +4 -0
  102. package/geometry/operators/polygonOverlayOperator.d.ts +9 -1
  103. package/geometry/operators/polygonSlicerOperator.d.ts +7 -0
  104. package/geometry/operators/projectOperator.d.ts +6 -0
  105. package/geometry/operators/proximityOperator.d.ts +7 -0
  106. package/geometry/operators/relateOperator.d.ts +5 -0
  107. package/geometry/operators/reshapeOperator.d.ts +3 -0
  108. package/geometry/operators/shapePreservingProjectOperator.d.ts +7 -0
  109. package/geometry/operators/simplifyOGCOperator.d.ts +5 -0
  110. package/geometry/operators/simplifyOperator.d.ts +5 -0
  111. package/geometry/operators/support/GeographicTransformation.d.ts +2 -0
  112. package/geometry/operators/support/GeographicTransformationStep.d.ts +2 -0
  113. package/geometry/operators/support/Transformation.d.ts +6 -1
  114. package/geometry/operators/support/geographicTransformationUtils.d.ts +4 -0
  115. package/geometry/operators/symmetricDifferenceOperator.d.ts +4 -0
  116. package/geometry/operators/touchesOperator.d.ts +4 -0
  117. package/geometry/operators/types.d.ts +1 -0
  118. package/geometry/operators/unionOperator.d.ts +4 -0
  119. package/geometry/operators/withinOperator.d.ts +4 -0
  120. package/kernel.js +1 -1
  121. package/layers/GaussianSplatLayer.d.ts +0 -1
  122. package/layers/GeospatialPDFLayer.js +1 -1
  123. package/package.json +2 -2
  124. package/support/revision.js +1 -1
  125. package/symbols/LineSymbol3D.d.ts +0 -7
  126. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  127. package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
  128. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  129. package/views/3d/interactive/placementTools/GroundNavigationPlacementTool3D.js +1 -1
  130. package/views/3d/layers/GeospatialPDFLayerView3D.js +1 -1
  131. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  132. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  133. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  134. package/views/3d/navigation/modes/GroundNavigationMode3D.js +1 -1
  135. package/views/3d/state/Constraints.js +1 -1
  136. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  137. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  138. package/views/3d/state/utils/navigationUtils.js +1 -1
  139. package/views/3d/terrain/SphericalPatch.js +1 -1
  140. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  141. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +23 -12
  142. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +35 -25
  143. package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +2 -2
  144. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
  145. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  146. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  147. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  148. package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
  149. package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
  150. package/views/3d/webgl-engine/lib/PolygonIntersectionResults.js +1 -1
  151. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  152. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  153. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  154. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  155. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  156. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  157. package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
  158. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  159. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +4 -4
  160. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  161. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  162. package/views/3d/webgl-engine/shaders/LineTechniqueConfiguration.js +1 -1
  163. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  164. package/views/support/PromiseQueue.js +1 -1
  165. package/views/support/Scheduler.js +1 -1
  166. package/widgets/BatchAttributeForm/ValueChangeTransaction.js +1 -1
  167. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  168. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  169. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  170. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.d.ts +148 -1
  171. package/assets/esri/core/workers/chunks/540f60e31b19d85e9371.js +0 -1
  172. package/assets/esri/core/workers/chunks/55a560fd872f7463b33d.js +0 -1
  173. package/assets/esri/core/workers/chunks/cf6f671823fa6c2a9a5e.js +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3354,4426],{28491(e,t,r){r.d(t,{b:()=>F});var i=r(32680),o=r(49255),n=r(34711),a=r(71020),s=r(72722),l=r(96336),c=r(53466),u=r(72824),d=r(54154),h=r(9169),m=r(12696),p=r(77695),f=r(72233),v=r(18e3),g=r(98619),x=r(62602),_=r(20598),b=r(22393),y=r(59469),w=r(56529),S=r(51406),M=r(89435),T=r(58614),C=r(20693),I=r(33079),E=r(31821),O=r(63761),P=r(27832),A=r(47630),D=r(14113);function F(e){const t=new D.N5,{attributes:r,vertex:F,fragment:R,varyings:B}=t,{output:N,normalType:z,offsetBackfaces:j,snowCover:H,pbrMode:L,textureAlphaPremultiplied:W,instancedDoublePrecision:V,hasVertexColors:U,hasVertexTangents:G,hasColorTexture:k,hasNormalTexture:$,hasNormalTextureTransform:Z,hasColorTextureTransform:q}=e;if((0,C.NB)(F,e),r.add("position","vec3"),F.inputs.add("position",()=>"position"),B.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(s.B,e),t.include(d.Ge,e),t.include(S.q2,e),!(0,o._o)(N))return t.include(h.E,e),t;t.include(S.Sx,e),t.include(S.MU,e),t.include(S.O1,e),t.include(S.QM,e),(0,C.yu)(F,e),t.include(l.Y,e),t.include(a.d);const Y=0===z||1===z;return Y&&j&&t.include(i.M),t.include(p.J,e),t.include(u.Mh,e),B.add("vPositionLocal","vec3"),t.include(c.U,e),t.include(m.F,e),t.include(V?w.oD:w.rA,e),F.main.add(E.H`
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3354,4426],{28491(e,t,r){r.d(t,{b:()=>R});var i=r(32680),n=r(49255),o=r(34711),a=r(71020),s=r(72722),l=r(96336),c=r(53466),u=r(72824),d=r(54154),h=r(9169),m=r(12696),p=r(77695),f=r(72233),v=r(18e3),g=r(98619),x=r(62602),_=r(20598),b=r(22393),y=r(59469),w=r(56529),S=r(51406),M=r(89435),T=r(58614),C=r(20693),I=r(33079),E=r(31821),O=r(63761),P=r(27832),D=r(47630),A=r(14113);function R(e){const t=new A.N5,{attributes:r,vertex:R,fragment:F,varyings:B}=t,{output:N,normalType:z,offsetBackfaces:j,snowCover:H,pbrMode:L,textureAlphaPremultiplied:W,instancedDoublePrecision:V,hasVertexColors:U,hasVertexTangents:G,hasColorTexture:k,hasNormalTexture:$,hasNormalTextureTransform:Z,hasColorTextureTransform:q}=e;if((0,C.NB)(R,e),r.add("position","vec3"),R.inputs.add("position",()=>"position"),B.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(s.B,e),t.include(d.Ge,e),t.include(S.q2,e),!(0,n._o)(N))return t.include(h.E,e),t;t.include(S.Sx,e),t.include(S.MU,e),t.include(S.O1,e),t.include(S.QM,e),(0,C.yu)(R,e),t.include(l.Y,e),t.include(a.d);const Y=0===z||1===z;return Y&&j&&t.include(i.M),t.include(p.J,e),t.include(u.Mh,e),B.add("vPositionLocal","vec3"),t.include(c.U,e),t.include(m.F,e),t.include(V?w.oD:w.rA,e),R.main.add(E.H`
2
2
  forwardDefaultMaterialExternalColor();
3
3
 
4
4
  vpos = getVertexInLocalOriginSpace();
@@ -21,7 +21,7 @@
21
21
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
22
22
  }
23
23
  forwardLinearDepthToReadShadow();
24
- `),R.include(v.kA,e),R.include(f.n,e),t.include(T.SS,e),R.include(n.zM,e),t.include(A.D,e),(0,C.yu)(R,e),R.uniforms.add(F.uniforms.get("localOrigin"),new I.t("ambient",e=>e.ambient),new I.t("diffuse",e=>e.diffuse)),k&&R.uniforms.add(new O.N("tex",e=>e.texture)),t.include(y._Z,e),R.include(b.c,e),t.include(x.r,e),R.include(P.b,e),R.include(_.n,e),(0,v.a8)(R),(0,v.eU)(R),R.uniforms.add(g.VK).main.add(E.H`
24
+ `),F.include(v.kA,e),F.include(f.n,e),t.include(T.SS,e),F.include(o.zM,e),t.include(D.D,e),(0,C.yu)(F,e),F.uniforms.add(R.uniforms.get("localOrigin"),new I.t("ambient",e=>e.ambient),new I.t("diffuse",e=>e.diffuse)),k&&F.uniforms.add(new O.N("tex",e=>e.texture)),t.include(y._Z,e),F.include(b.c,e),t.include(x.r,e),F.include(P.b,e),F.include(_.n,e),(0,v.a8)(F),(0,v.eU)(F),F.uniforms.add(g.VK).main.add(E.H`
25
25
  discardBySlice(vpos);
26
26
  ${k?E.H`
27
27
  vec4 texColor = texture(tex, ${q?"colorUV":"vuv0"});
@@ -60,7 +60,7 @@
60
60
  vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, upNormal);
61
61
  vec4 finalColor = vec4(shadedColor, opacity_);
62
62
  outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${(0,E.If)(H,", snow")});
63
- `),t}const R=Object.freeze(Object.defineProperty({__proto__:null,build:F},Symbol.toStringTag,{value:"Module"}));r.d(t,["D",0,R])},587(e,t,r){r.d(t,{G:()=>y,c:()=>w});var i=r(82048),o=r(92573),n=r(65261),a=r(98619),s=r(70893),l=r(34845),c=r(45324),u=r(33094),d=r(20304),h=r(31821),m=r(58029),p=r(12791),f=r(63761),v=r(94046),g=(r(72458),r(18519)),x=r(63907),_=r(65786),b=r(14113);class y extends _.Y{constructor(){super(...arguments),this.projScale=1,this.resolutionScale=1,this.accumulatedFrames=0,this.temporalSampleFrame=0,this.rayMarchMinReach=.15,this.rayMarchMaxReach=.5,this.rayMarchWorldReach=25,this.rayMarchMinReachEmissionWeight=1,this.rayMarchMaxReachEmissionWeight=1,this.rayMarchMaxSteps=16,this.colorBleedWeight=.15,this.highQualityIdleColorBlendStart=.3,this.emissionBoostFactor=2.5}}function w(e){const t=new b.N5,r=t.fragment;t.include(i.c),t.include(l.Ir),r.include(o.V),r.include(n.C),r.include(v.R),r.include(g.b),t.include(s.O,e),r.uniforms.add(a.t_,c.Xl,new f.N("normalMap",e=>e.normalTexture),new f.N("depthMap",e=>e.depthTexture),new f.N("lastFrameGlobalIlluminationTexture",(e,t)=>e.globalIllumination??t.globalIllumination?.getTexture()),new f.N("lastFrameGlobalIlluminationWeightTexture",(e,t)=>e.globalIlluminationWeights??t.globalIllumination?.getTexture(36065)),new p.x("lastFrameColorTexture",e=>e.reprojection.lastFrameColor?.getTexture()),new p.x("lastFrameDepthTexture",e=>e.reprojection.lastFrameDepth?.attachment),new m.F("reprojectionProjectionMatrix",e=>e.reprojection.lastFrameCamera.projectionMatrix),new m.F("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new d.m("accumulatedFrames",e=>e.accumulatedFrames),new d.m("temporalSampleFrame",e=>e.temporalSampleFrame),new d.m("resolutionScale",e=>e.resolutionScale)),r.uniforms.add(new d.m("rayMarchMinReach",e=>e.rayMarchMinReach),new d.m("rayMarchMaxReach",e=>e.rayMarchMaxReach),new d.m("rayMarchWorldReach",e=>e.rayMarchWorldReach),new d.m("rayMarchMinReachEmissionWeight",e=>e.rayMarchMinReachEmissionWeight),new d.m("rayMarchMaxReachEmissionWeight",e=>e.rayMarchMaxReachEmissionWeight),new d.m("rayMarchMaxSteps",e=>e.rayMarchMaxSteps),new d.m("colorBleedWeight",e=>e.colorBleedWeight),new d.m("highQualityIdleColorBlendStart",e=>e.highQualityIdleColorBlendStart),new d.m("emissionBoostFactor",e=>e.emissionBoostFactor));const{hasEmission:_,hasColor:y}=e;return _&&(r.uniforms.add(new u.U("inputScale",e=>e.reprojection.lastFrameEmission?.getTexture()?.descriptor.internalFormat===x.H0.RGBA8?16:1),new p.x("lastFrameEmissionTexture",e=>e.reprojection.lastFrameEmission?.getTexture())),r.code.add(h.H`bool hasHitReprojectionMismatch(vec3 hit, vec2 hitReprojectedCoordinate, float colorBlendWeight) {
63
+ `),t}const F=Object.freeze(Object.defineProperty({__proto__:null,build:R},Symbol.toStringTag,{value:"Module"}));r.d(t,["D",0,F])},587(e,t,r){r.d(t,{G:()=>y,c:()=>w});var i=r(82048),n=r(92573),o=r(65261),a=r(98619),s=r(70893),l=r(34845),c=r(45324),u=r(33094),d=r(20304),h=r(31821),m=r(58029),p=r(12791),f=r(63761),v=r(94046),g=(r(72458),r(18519)),x=r(63907),_=r(65786),b=r(14113);class y extends _.Y{constructor(){super(...arguments),this.projScale=1,this.resolutionScale=1,this.accumulatedFrames=0,this.temporalSampleFrame=0,this.rayMarchMinReach=.15,this.rayMarchMaxReach=.5,this.rayMarchWorldReach=25,this.rayMarchMinReachEmissionWeight=1,this.rayMarchMaxReachEmissionWeight=1,this.rayMarchMaxSteps=16,this.colorBleedWeight=.15,this.highQualityIdleColorBlendStart=.3,this.emissionBoostFactor=2.5}}function w(e){const t=new b.N5,r=t.fragment;t.include(i.c),t.include(l.Ir),r.include(n.V),r.include(o.C),r.include(v.R),r.include(g.b),t.include(s.O,e),r.uniforms.add(a.t_,c.Xl,new f.N("normalMap",e=>e.normalTexture),new f.N("depthMap",e=>e.depthTexture),new f.N("lastFrameGlobalIlluminationTexture",(e,t)=>e.globalIllumination??t.globalIllumination?.getTexture()),new f.N("lastFrameGlobalIlluminationWeightTexture",(e,t)=>e.globalIlluminationWeights??t.globalIllumination?.getTexture(36065)),new p.x("lastFrameColorTexture",e=>e.reprojection.lastFrameColor?.getTexture()),new p.x("lastFrameDepthTexture",e=>e.reprojection.lastFrameDepth?.attachment),new m.F("reprojectionProjectionMatrix",e=>e.reprojection.lastFrameCamera.projectionMatrix),new m.F("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new d.m("accumulatedFrames",e=>e.accumulatedFrames),new d.m("temporalSampleFrame",e=>e.temporalSampleFrame),new d.m("resolutionScale",e=>e.resolutionScale)),r.uniforms.add(new d.m("rayMarchMinReach",e=>e.rayMarchMinReach),new d.m("rayMarchMaxReach",e=>e.rayMarchMaxReach),new d.m("rayMarchWorldReach",e=>e.rayMarchWorldReach),new d.m("rayMarchMinReachEmissionWeight",e=>e.rayMarchMinReachEmissionWeight),new d.m("rayMarchMaxReachEmissionWeight",e=>e.rayMarchMaxReachEmissionWeight),new d.m("rayMarchMaxSteps",e=>e.rayMarchMaxSteps),new d.m("colorBleedWeight",e=>e.colorBleedWeight),new d.m("highQualityIdleColorBlendStart",e=>e.highQualityIdleColorBlendStart),new d.m("emissionBoostFactor",e=>e.emissionBoostFactor));const{hasEmission:_,hasColor:y}=e;return _&&(r.uniforms.add(new u.U("inputScale",e=>e.reprojection.lastFrameEmission?.getTexture()?.descriptor.internalFormat===x.H0.RGBA8?16:1),new p.x("lastFrameEmissionTexture",e=>e.reprojection.lastFrameEmission?.getTexture())),r.code.add(h.H`bool hasHitReprojectionMismatch(vec3 hit, vec2 hitReprojectedCoordinate, float colorBlendWeight) {
64
64
  if (colorBlendWeight != 1.0) {
65
65
  return false;
66
66
  }
@@ -304,7 +304,7 @@ return value * 2.0 - 1.0;
304
304
  fragGlobalIllumination.a = mix(lastFrameGlobalIllumination.a + accumulationDither, fragGlobalIllumination.a, occlusionBlendWeight);
305
305
 
306
306
  fragWeight = vec2(occlusionBlendWeight, colorBlendWeight * storedColorBlendWeightScale);
307
- `),t}const S=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationPassParameters:y,build:w,defaultColorBleedWeight:.15,defaultEmissionBoostFactor:2.5,defaultRayMarchMaxReach:.5,defaultRayMarchMaxReachEmissionWeight:1,defaultRayMarchMaxSteps:16,defaultRayMarchMinReach:.15,defaultRayMarchMinReachEmissionWeight:1,defaultRayMarchWorldReach:25},Symbol.toStringTag,{value:"Module"}));r.d(t,["a",0,S])},52516(e,t,r){r.d(t,{G:()=>_,b:()=>b});var i=r(48163),o=r(82048),n=r(52540),a=r(72885),s=r(34845),l=r(32976),c=r(68259),u=r(20304),d=r(31821),h=r(15976),m=r(63761),p=r(94046),f=r(58243),v=r(72458),g=r(65786),x=r(14113);class _ extends g.Y{constructor(){super(...arguments),this.blurSize=(0,i.vt)()}}function b(){const e=new x.N5,t=e.fragment;e.include(o.c),e.include(s.Ir),e.include(a.Q);return t.include(n.E),t.include(f.t,y),t.include(p.R),t.uniforms.add(new l.o("hasEmission",e=>null!=e.reprojection.lastFrameEmission),new m.N("depthMap",e=>e.depthTexture),new m.N("normalMap",e=>e.normalTexture),new h.o("globalIlluminationTexture",e=>e.texture),new h.o("globalIlluminationWeightTexture",e=>e.weightTexture),new c.t("blurSize",e=>e.blurSize),new u.m("resolutionScale",e=>e.resolutionScale),new u.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(d.H`
307
+ `),t}const S=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationPassParameters:y,build:w,defaultColorBleedWeight:.15,defaultEmissionBoostFactor:2.5,defaultRayMarchMaxReach:.5,defaultRayMarchMaxReachEmissionWeight:1,defaultRayMarchMaxSteps:16,defaultRayMarchMinReach:.15,defaultRayMarchMinReachEmissionWeight:1,defaultRayMarchWorldReach:25},Symbol.toStringTag,{value:"Module"}));r.d(t,["a",0,S])},52516(e,t,r){r.d(t,{G:()=>_,b:()=>b});var i=r(48163),n=r(82048),o=r(52540),a=r(72885),s=r(34845),l=r(32976),c=r(68259),u=r(20304),d=r(31821),h=r(15976),m=r(63761),p=r(94046),f=r(58243),v=r(72458),g=r(65786),x=r(14113);class _ extends g.Y{constructor(){super(...arguments),this.blurSize=(0,i.vt)()}}function b(){const e=new x.N5,t=e.fragment;e.include(n.c),e.include(s.Ir),e.include(a.Q);return t.include(o.E),t.include(f.t,y),t.include(p.R),t.uniforms.add(new l.o("hasEmission",e=>null!=e.reprojection.lastFrameEmission),new m.N("depthMap",e=>e.depthTexture),new m.N("normalMap",e=>e.normalTexture),new h.o("globalIlluminationTexture",e=>e.texture),new h.o("globalIlluminationWeightTexture",e=>e.weightTexture),new c.t("blurSize",e=>e.blurSize),new u.m("resolutionScale",e=>e.resolutionScale),new u.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(d.H`
308
308
  void accumulateBlurSample(
309
309
  vec2 sampleUv,
310
310
  float sampleOffset,
@@ -406,7 +406,7 @@ return value * 2.0 - 1.0;
406
406
  blurredEmission += isScaledGlobalIllumination ? ${d.H.float(.85)} * dither : dither;
407
407
 
408
408
  fragColor = vec4(quantizeGlobalIlluminationColor(blurredEmission), occlusion);
409
- `),e}const y=new v.C;y.useFloatBlend=!1;const w=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationBlurDrawParameters:_,build:b},Symbol.toStringTag,{value:"Module"}));r.d(t,["a",0,w])},50704(e,t,r){r.d(t,{G:()=>p,b:()=>f});var i=r(82048),o=r(52540),n=r(72885),a=r(34845),s=r(20304),l=r(31821),c=r(15976),u=r(63761),d=r(94046),h=r(65786),m=r(14113);class p extends h.Y{}function f(){const e=new m.N5,t=e.fragment;return e.include(i.c),e.include(a.Ir),e.include(n.Q),t.include(o.E),t.include(d.R),t.uniforms.add(new u.N("depthMap",e=>e.depthTexture),new u.N("normalMap",e=>e.normalTexture),new c.o("tex",e=>e.colorTexture),new c.o("globalIlluminationWeightTexture",e=>e.weightTexture),new s.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(l.H`
409
+ `),e}const y=new v.C;y.useFloatBlend=!1;const w=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationBlurDrawParameters:_,build:b},Symbol.toStringTag,{value:"Module"}));r.d(t,["a",0,w])},50704(e,t,r){r.d(t,{G:()=>p,b:()=>f});var i=r(82048),n=r(52540),o=r(72885),a=r(34845),s=r(20304),l=r(31821),c=r(15976),u=r(63761),d=r(94046),h=r(65786),m=r(14113);class p extends h.Y{}function f(){const e=new m.N5,t=e.fragment;return e.include(i.c),e.include(a.Ir),e.include(o.Q),t.include(n.E),t.include(d.R),t.uniforms.add(new u.N("depthMap",e=>e.depthTexture),new u.N("normalMap",e=>e.normalTexture),new c.o("tex",e=>e.colorTexture),new c.o("globalIlluminationWeightTexture",e=>e.weightTexture),new s.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(l.H`
410
410
  float computeDepthWeight(float sampleDepth, float centerDepth, float depthSharpness) {
411
411
  float depthDelta = abs(sampleDepth - centerDepth);
412
412
  return exp(-0.08 - depthDelta * depthDelta * depthSharpness);
@@ -486,7 +486,7 @@ return value * 2.0 - 1.0;
486
486
  ) / jointBilateralWeightSum;
487
487
  }
488
488
  `),e.outputs.add("fragColor","vec4",0),e.outputs.add("fragWeight","vec2",1),t.main.add(l.H`sampleJointBilateralUpscale(uv, fragColor, fragWeight);
489
- fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const v=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationUpscaleDrawParameters:p,build:f},Symbol.toStringTag,{value:"Module"}));r.d(t,["a",0,v])},57323(e,t,r){r.d(t,{b:()=>P});var i=r(32680),o=r(49255),n=r(34711),a=r(71020),s=r(72722),l=r(96336),c=r(53466),u=r(54154),d=r(9169),h=r(12696),m=r(72233),p=r(18e3),f=r(98619),v=r(20598),g=r(22393),x=r(59469),_=r(56529),b=r(51406),y=r(89435),w=r(58614),S=r(20693),M=r(33079),T=r(31821),C=r(63761),I=r(27832),E=r(47630),O=r(14113);function P(e){const t=new O.N5,{attributes:r,vertex:P,fragment:A,varyings:D}=t,{output:F,offsetBackfaces:R,pbrMode:B,snowCover:N}=e,z=1===B||2===B;if((0,S.NB)(P,e),r.add("position","vec3"),P.inputs.add("position",()=>"position"),D.add("vpos","vec3",{invariant:!0}),t.include(y.A,e),t.include(s.B,e),t.include(u.Ge,e),t.include(b.q2,e),!(0,o._o)(F))return t.include(d.E,e),t;t.include(b.MU,e),(0,S.yu)(t.vertex,e),t.include(l.Y,e),t.include(a.d),R&&t.include(i.M),D.add("vNormalWorld","vec3"),D.add("localvpos","vec3",{invariant:!0}),t.include(c.U,e),t.include(h.F,e),t.include(e.instancedDoublePrecision?_.oD:_.rA,e),P.main.add(T.H`
489
+ fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const v=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationUpscaleDrawParameters:p,build:f},Symbol.toStringTag,{value:"Module"}));r.d(t,["a",0,v])},57323(e,t,r){r.d(t,{b:()=>P});var i=r(32680),n=r(49255),o=r(34711),a=r(71020),s=r(72722),l=r(96336),c=r(53466),u=r(54154),d=r(9169),h=r(12696),m=r(72233),p=r(18e3),f=r(98619),v=r(20598),g=r(22393),x=r(59469),_=r(56529),b=r(51406),y=r(89435),w=r(58614),S=r(20693),M=r(33079),T=r(31821),C=r(63761),I=r(27832),E=r(47630),O=r(14113);function P(e){const t=new O.N5,{attributes:r,vertex:P,fragment:D,varyings:A}=t,{output:R,offsetBackfaces:F,pbrMode:B,snowCover:N}=e,z=1===B||2===B;if((0,S.NB)(P,e),r.add("position","vec3"),P.inputs.add("position",()=>"position"),A.add("vpos","vec3",{invariant:!0}),t.include(y.A,e),t.include(s.B,e),t.include(u.Ge,e),t.include(b.q2,e),!(0,n._o)(R))return t.include(d.E,e),t;t.include(b.MU,e),(0,S.yu)(t.vertex,e),t.include(l.Y,e),t.include(a.d),F&&t.include(i.M),A.add("vNormalWorld","vec3"),A.add("localvpos","vec3",{invariant:!0}),t.include(c.U,e),t.include(h.F,e),t.include(e.instancedDoublePrecision?_.oD:_.rA,e),P.main.add(T.H`
490
490
  forwardDefaultMaterialExternalColor();
491
491
 
492
492
  vpos = getVertexInLocalOriginSpace();
@@ -503,8 +503,8 @@ fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const v=Obje
503
503
  forwardLinearDepthToReadShadow();
504
504
 
505
505
  gl_Position = shouldCullByOpacity() ? vec4(1e38, 1e38, 1e38, 1.0) :
506
- ${(0,T.If)(R,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
507
- `);const{hasColorTexture:j,hasColorTextureTransform:H}=e;return A.include(p.kA,e),A.include(m.n,e),t.include(w.SS,e),A.include(n.zM,e),t.include(E.D,e),(0,S.yu)(A,e),(0,p.a8)(A),(0,p.eU)(A),A.uniforms.add(f.t_,P.uniforms.get("localOrigin"),P.uniforms.get("view"),new M.t("ambient",e=>e.ambient),new M.t("diffuse",e=>e.diffuse)),j&&A.uniforms.add(new C.N("tex",e=>e.texture)),t.include(x._Z,e),A.include(g.c,e),A.include(I.b,e),A.include(v.n,e),A.uniforms.add(f.VK).main.add(T.H`
506
+ ${(0,T.If)(F,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
507
+ `);const{hasColorTexture:j,hasColorTextureTransform:H}=e;return D.include(p.kA,e),D.include(m.n,e),t.include(w.SS,e),D.include(o.zM,e),t.include(E.D,e),(0,S.yu)(D,e),(0,p.a8)(D),(0,p.eU)(D),D.uniforms.add(f.t_,P.uniforms.get("localOrigin"),P.uniforms.get("view"),new M.t("ambient",e=>e.ambient),new M.t("diffuse",e=>e.diffuse)),j&&D.uniforms.add(new C.N("tex",e=>e.texture)),t.include(x._Z,e),D.include(g.c,e),D.include(I.b,e),D.include(v.n,e),D.uniforms.add(f.VK).main.add(T.H`
508
508
  discardBySlice(vpos);
509
509
  vec4 texColor = ${j?`texture(tex, ${H?"colorUV":"vuv0"})`:" vec4(1.0)"};
510
510
  ${(0,T.If)(j,`${(0,T.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
@@ -543,7 +543,7 @@ fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const v=Obje
543
543
  vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, upNormal);
544
544
  vec4 finalColor = vec4(shadedColor, opacity_);
545
545
  outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${(0,T.If)(N,", 1.0")});
546
- `),t}const A=Object.freeze(Object.defineProperty({__proto__:null,build:P},Symbol.toStringTag,{value:"Module"}));r.d(t,["R",0,A])},15581(e,t,r){r.d(t,{b:()=>v,g:()=>g});var i=r(37585),o=r(48163),n=r(82048),a=r(52540),s=r(65261),l=r(34845),c=r(77108),u=r(47286),d=r(33094),h=r(20304),m=r(31821),p=r(63761),f=r(14113);function v(){const e=new f.N5,t=e.fragment;return e.include(n.c),e.include(l.Ir),t.include(a.E),t.include(s.C),t.uniforms.add(new d.U("radius",e=>g(e.camera))).code.add(m.H`vec3 sphere[16] = vec3[16](
546
+ `),t}const D=Object.freeze(Object.defineProperty({__proto__:null,build:P},Symbol.toStringTag,{value:"Module"}));r.d(t,["R",0,D])},15581(e,t,r){r.d(t,{b:()=>v,g:()=>g});var i=r(37585),n=r(48163),o=r(82048),a=r(52540),s=r(65261),l=r(34845),c=r(77108),u=r(47286),d=r(33094),h=r(20304),m=r(31821),p=r(63761),f=r(14113);function v(){const e=new f.N5,t=e.fragment;return e.include(o.c),e.include(l.Ir),t.include(a.E),t.include(s.C),t.uniforms.add(new d.U("radius",e=>g(e.camera))).code.add(m.H`vec3 sphere[16] = vec3[16](
547
547
  vec3(0.186937, 0.0, 0.0),
548
548
  vec3(0.700542, 0.0, 0.0),
549
549
  vec3(-0.864858, -0.481795, -0.111713),
@@ -625,7 +625,7 @@ return fallOffFunction(vv, vn, 0.1);
625
625
  A = (pow(A, 0.2) + 1.2 * pow(A, 4.0)) * INV_GAMMA;
626
626
 
627
627
  fragOcclusion = A;
628
- `),e}function g(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const x=(0,o.vt)(),_=Object.freeze(Object.defineProperty({__proto__:null,build:v,getRadius:g},Symbol.toStringTag,{value:"Module"}));r.d(t,["S",0,_])},95774(e,t,r){r.d(t,{b:()=>d});var i=r(82048),o=r(52540),n=r(68259),a=r(20304),s=r(31821),l=r(15976),c=r(63761),u=r(14113);function d(){const e=new u.N5,t=e.fragment;return e.include(i.c),t.include(o.E),t.uniforms.add(new c.N("depthMap",e=>e.depthTexture),new l.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`
628
+ `),e}function g(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const x=(0,n.vt)(),_=Object.freeze(Object.defineProperty({__proto__:null,build:v,getRadius:g},Symbol.toStringTag,{value:"Module"}));r.d(t,["S",0,_])},95774(e,t,r){r.d(t,{b:()=>d});var i=r(82048),n=r(52540),o=r(68259),a=r(20304),s=r(31821),l=r(15976),c=r(63761),u=r(14113);function d(){const e=new u.N5,t=e.fragment;return e.include(i.c),t.include(n.E),t.uniforms.add(new c.N("depthMap",e=>e.depthTexture),new l.o("tex",e=>e.colorTexture),new o.t("blurSize",e=>e.blurSize),new a.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(s.H`
629
629
  void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
630
630
  float c = texture(tex, uv).r;
631
631
  float d = linearDepthFromTexture(depthMap, uv);
@@ -648,17 +648,17 @@ return fallOffFunction(vv, vn, 0.1);
648
648
  vec2 uvOffset = uv + rf * blurSize;
649
649
  blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
650
650
  }
651
- fragBlur = b / w_total;`),e}const h=Object.freeze(Object.defineProperty({__proto__:null,build:d},Symbol.toStringTag,{value:"Module"}));r.d(t,["S",0,h])},43609(e,t,r){r.d(t,{a:()=>n,f:()=>a,n:()=>o});var i=r(34275);function o(e,t){n(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r=2,o=r){const n=t.length/2;let a=0,s=0;if(!(0,i.iu)(t)||(0,i.dk)(t)){for(let i=0;i<n;++i)e[a]=t[s],e[a+1]=t[s+1],a+=r,s+=o;return}const l=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<n;++i)e[a]=Math.max(t[s]/l,-1),e[a+1]=Math.max(t[s+1]/l,-1),a+=r,s+=o;else for(let i=0;i<n;++i)e[a]=t[s]/l,e[a+1]=t[s+1]/l,a+=r,s+=o}function a(e,t,r,i){const o=e.typedBuffer,n=e.typedBufferStride,a=i?.count??e.count;let s=(i?.dstIndex??0)*n;for(let e=0;e<a;++e)o[s]=t,o[s+1]=r,s+=n}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:n,normalizeIntegerBufferView:o},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>d,b:()=>s,c:()=>o,d:()=>a,e:()=>h,f:()=>u,l:()=>c,n:()=>m,t:()=>n}),r(44208);var i=r(72727);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){const a=(0,i.k)(e.length,o,3),s=(0,i.k)(t.length,n,3),l=Math.min(a,s),c=r[0],u=r[1],d=r[2],h=r[4],m=r[5],p=r[6],f=r[8],v=r[9],g=r[10],x=r[12],_=r[13],b=r[14];let y=0,w=0;for(let r=0;r<l;r++){const r=t[y],i=t[y+1],a=t[y+2];e[w]=c*r+h*i+f*a+x,e[w+1]=u*r+m*i+v*a+_,e[w+2]=d*r+p*i+g*a+b,y+=n,w+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){const a=(0,i.k)(e.length,o,3),s=(0,i.k)(t.length,n,3),l=Math.min(a,s),c=r[0],u=r[1],d=r[2],h=r[3],m=r[4],p=r[5],f=r[6],v=r[7],g=r[8];let x=0,_=0;for(let r=0;r<l;r++){const r=t[x],i=t[x+1],a=t[x+2];e[_]=c*r+h*i+f*a,e[_+1]=u*r+m*i+v*a,e[_+2]=d*r+p*i+g*a,x+=n,_+=o}}function l(e,t,r,i=3,o=i){const n=Math.min(e.length/i,t.length/o);let a=0,s=0;for(let l=0;l<n;l++)e[s]=r*t[a],e[s+1]=r*t[a+1],e[s+2]=r*t[a+2],a+=o,s+=i;return e}function c(e,t,r,i){u(e.typedBuffer,t.typedBuffer,r,i,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r,i,o=3,n=o){const a=Math.min(e.length/o,t.length/n);let s=0,l=0;const c=1/2.2;for(let u=0;u<a;u++)e[l]=i*(r*t[s])**c,e[l+1]=i*(r*t[s+1])**c,e[l+2]=i*(r*t[s+2])**c,s+=n,l+=o}function d(e,t,r,o=3,n=o){const a=(0,i.k)(e.length,o,3),s=(0,i.k)(t.length,n,3),l=Math.min(a,s);let c=0,u=0;for(let i=0;i<l;i++)e[u]=t[c]+r[0],e[u+1]=t[c+1]+r[1],e[u+2]=t[c+2]+r[2],c+=n,u+=o;return e}function h(e,t){m(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function m(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:u,linearToSRGBView:c,normalize:m,normalizeView:h,scale:l,scaleView:function(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o,translate:d},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>o});var i=r(34727);class o{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return n(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+a(this.range,e-t,r)}minimalMonotonic(e,t,r){return n(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function n(e,t,r,i,o=0,n=!1){return(i-=o)<t?i+=a(e,t-i):i>r&&(i-=a(e,i-r)),n&&i===r&&(i=t),i+o}function a(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const s=new o(0,2*Math.PI),l=(new o(-Math.PI,Math.PI),new o(0,360));r.d(t,["ie",0,l,"uC",0,s])},46140(e,t,r){r.d(t,{A:()=>o});var i=r(49186);class o{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}toString(){return`${this.major}.${this.minor}`}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 o(this.major,this.minor,this._context)}static parse(e,t=""){const[r,n]=e.split("."),a=/^\s*\d+\s*$/;if(!r?.match||!a.test(r))throw new i.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n?.match||!a.test(n))throw new i.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(n,10);return new o(s,l,t)}}},61473(e,t,r){function i(e){return e=e||globalThis.location.hostname,c.some(t=>null!=e?.match(t))}function o(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}r.d(t,{EM:()=>o,b5:()=>i});const n=/^devext\.arcgis\.com$/,a=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,n,a,/^jsapps\.esri\.com$/,s,l]},18370(e,t,r){r.d(t,{z:()=>o});class i{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(async e=>(this.module=e,e))),this._promise}}function o(e){return new i(e)}},88340(e,t,r){function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{fA:()=>o,vt:()=>i});const c=n(),u=a(),d=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"})),r.d(t,["Un",0,u,"uY",0,c])},69397(e,t,r){r.d(t,{Qf:()=>s,Qh:()=>n,lM:()=>o});var i=r(34275);function o(e){if(!e)return 0;let t=c;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r],!1));return t}function n(e){if(!e)return 0;if("number"==typeof e[0])return s(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return l(e,8);let r=u;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=c;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e,t=!0){switch(typeof e){case"object":return t?n(e):c;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(...e){return e.reduce((e,t)=>e+(t?(0,i.iu)(t)?t.byteLength+d:Array.isArray(t)?l(t,16):0:0),0)}function l(e,t){return u+e.length*t}const c=32,u=16,d=145},65806(e,t,r){r.d(t,{g:()=>a});var i=r(51850),o=r(99917),n=r(9762);function a(e,t,r,i){if((0,o.canProjectWithoutEngine)(e.spatialReference,r))return s[0]=e.x,s[1]=e.y,s[2]=e.z??0,(0,n.projectBuffer)(s,e.spatialReference,0,t,r,0);const a=(0,o.tryProject)(e,r,i);return!!a&&(t[0]=a.x,t[1]=a.y,t[2]=a.z??0,!0)}const s=(0,i.vt)()},27993(e,t,r){r.d(t,{F:()=>s});var i=r(99917),o=r(16930),n=r(9762),a=r(65806);function s(e,t,r,o){return!(null==t||null==o||e.length<2)&&((0,i.canProjectWithoutEngine)(t,o)?(0,n.projectBuffer)(e,t,0,r,o,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,a.g)(l,r,o)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:o.A.WGS84,type:"point"}},97146(e,t,r){r.d(t,{Dg:()=>n,lC:()=>s,my:()=>a,tM:()=>d,uW:()=>o});var i=r(34275);function o(e){return n(e,!0)}function n(e,t){if(Array.isArray(e)){if(e.length<1024)return e}else if(e.length<1024)return Array.from(e);let r=!0,o=!0;return e.some((e,t)=>(r=r&&0===e,o=o&&e===t,!r&&!o)),r?function(e){if(1===e)return c;if(e<1024)return new Array(e).fill(0);if(e>m.length){const t=Math.max(2*m.length,e);m=new Uint8Array(t)}return new Uint8Array(m.buffer,0,e)}(e.length):o?d(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(const r of e){if(r>=65536)return(0,i.iu)(e)?e:new Uint32Array(e);r>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function a(e,t=e){return e<=1024?new Array(e):t<=65536?new Uint16Array(e):new Uint32Array(e)}function s(e,t,r){if(0===t.length)return e.slice();if(0===e.length)return t.slice();const i=a(e.length+t.length,r);for(let t=0;t<e.length;++t)i[t]=e[t];for(let r=0;r<t.length;++r)i[e.length+r]=t[r];return i}let l=h(131072);const c=[0],u=(()=>{const e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function d(e){return 1===e?c:e<1024?Array.from(new Uint16Array(u.buffer,0,e)):e<u.length?new Uint16Array(u.buffer,0,e):(e>l.length&&(l=h(Math.max(2*l.length,e))),new Uint32Array(l.buffer,0,e))}function h(e){const t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let m=new Uint8Array(65536)},72727(e,t,r){function i(e,t,r){if(t<=0)return 0;const i=e-r;return i<0?0:Math.floor(i/t)+1}r.d(t,{k:()=>i}),r(53966)},65720(e,t,r){r.d(t,{C:()=>g,vt:()=>f,Qy:()=>v,ui:()=>x,ST:()=>M,bU:()=>C,pw:()=>S,m7:()=>_,ZU:()=>b,GH:()=>w,Pi:()=>y,LJ:()=>T,c8:()=>O});var i=r(4341),o=r(58083),n=r(35522),a=r(51850),s=r(78955),l=r(91829),c=r(70328),u=r(71351);function d(e){return e?{ray:(0,u.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,u.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>d());var h=r(27921);function m(e,t,r,i){let{t0:o,t1:n}=i;const a=(0,h.mN)(e,t),s=(0,h.mN)(e,r);if(a>=0&&s>=0)return!1;if(a<0&&s>=0){const e=-a/(s-a);if(e<o)return!1;e<n&&(n=e)}else if(a>=0&&s<0){const e=a/(a-s);if(e>n)return!1;e>o&&(o=e)}return i.t0=o,i.t1=n,!0}var p=r(32114);function f(e){return e?[(0,h.vt)(e[0]),(0,h.vt)(e[1]),(0,h.vt)(e[2]),(0,h.vt)(e[3]),(0,h.vt)(e[4]),(0,h.vt)(e[5])]:[(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)()]}function v(){return[(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)()]}function g(e,t){for(let r=0;r<P;r++)(0,h.C)(e[r],t[r]);return e}function x(e,t,r,i=R){const a=(0,o.lw)(p.Rc.get(),t,e);(0,o.B8)(a,a);for(let e=0;e<A;++e){const t=(0,s.Z0)(p.Km.get(),D[e],a);(0,n.hZ)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}!function(e,t){(0,h.Cr)(t[4],t[0],t[3],e[0]),(0,h.Cr)(t[1],t[5],t[6],e[1]),(0,h.Cr)(t[4],t[5],t[1],e[2]),(0,h.Cr)(t[3],t[2],t[6],e[3]),(0,h.Cr)(t[0],t[1],t[2],e[4]),(0,h.Cr)(t[5],t[4],t[7],e[5])}(r,i)}function _(e,t){return b(e,t.center,t.radius)}function b(e,t,r){for(let i=0;i<P;i++){const o=e[i];if(o[0]*t[0]+o[1]*t[1]+o[2]*t[2]+o[3]>=r)return!1}return!0}function y(e,t,r){for(const i of E)if((0,h.wE)(e[i],t,r))return!0;return!1}function w(e,t,r){const i=(0,c.gX)(t,B),o=(0,c.VL)(t)/2,a=(0,c.yr)(t)/2,s=(0,c.uJ)(t)/2;return r?function(e,t,r,i,o,a){const s=(0,n.Z0)(N,t,a);for(let t=0;t<P;t++){const n=e[t];if(n[0]*s[0]+n[1]*s[1]+n[2]*s[2]+n[3]-(Math.abs(n[0]*a[0]+n[1]*a[1]+n[2]*a[2])*r+Math.abs(n[0]*a[4]+n[1]*a[5]+n[2]*a[6])*i+Math.abs(n[0]*a[8]+n[1]*a[9]+n[2]*a[10])*o)>0)return!1}return!0}(e,i,o,a,s,r):function(e,t,r,i,o){for(let n=0;n<P;n++){const a=e[n];if(a[0]*t[0]+a[1]*t[1]+a[2]*t[2]+a[3]-(Math.abs(a[0])*r+Math.abs(a[1])*i+Math.abs(a[2])*o)>0)return!1}return!0}(e,i,o,a,s)}function S(e,t){return I(e,function(e,t=d()){return(0,u.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,F.get()))}function M(e,t,r){return I(e,function(e,t,r=d()){const i=(0,n.Bw)(e.vector);return(0,u.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,F.get()))}function T(e,t,r){return function(e,t,r,i){const o={t0:0,t1:1};for(const n of t)if(!m(e[n],r,i,o))return!1;return o.t0<o.t1}(e,E,t,r)}function C(e,t){for(let r=0;r<P;r++)if((0,h.mN)(e[r],t)>0)return!1;return!0}function I(e,t){for(let r=0;r<P;r++)if(!(0,h.$Q)(e[r],t))return!1;return!0}const E=[0,1,2,3,5],O={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},P=6,A=8,D=[(0,l.fA)(-1,-1,-1,1),(0,l.fA)(1,-1,-1,1),(0,l.fA)(1,1,-1,1),(0,l.fA)(-1,1,-1,1),(0,l.fA)(-1,-1,1,1),(0,l.fA)(1,-1,1,1),(0,l.fA)(1,1,1,1),(0,l.fA)(-1,1,1,1)],F=new i.I(d),R=v(),B=(0,a.vt)(),N=(0,a.vt)()},52039(e,t,r){r.d(t,{O7:()=>h,el:()=>c});var i=r(69052),o=(r(49186),r(18370)),n=r(17676),a=(r(5443),r(39829)),s=(r(82799),r(16930)),l=(r(80754),r(21325));async function c(e,t,r){Array.isArray(e)||(e=[e]),null!=t&&"object"==typeof t&&"authMode"in t&&(r=t);let i=null;for(const t of e)i??=t?.spatialReference;if(!i)return e;const o=(0,l.Vp)(i);if(!o)return e;if(1===e.length&&"extent"===e[0]?.type){const t=e[0].clone().normalizeAsSingleGeometry(o);return["xmin"in t?t:new a.A(t)]}const[s,c]=o.valid;let h=!1;for(const t of e){if(!t)continue;if("point"===t.type){h||=t.x>=c,h||=t.x<=s;continue}const{extent:e}=t;if(null==e){h=!0;break}h||=e.xmin>=c,h||=e.xmin<=s,h||=e.xmax>=c,h||=e.xmax<=s}if(!h)return e;const[{foldInto360Range:m},p]=await(0,n.qr)(Promise.all([u.getImportPromise(),d.getImportPromise()]),r),f=p.fromSpatialReference(i);return e.map(e=>{if(null==e||"mesh"===e.type)return e;const t=p.fromGeometry(e),r=p.toGeometry(m(t,f),i);return"extent"===e.type&&1===r?.rings.length?r.extent:r})}const u=(0,o.z)(()=>r.e(4144).then(()=>r(4144)).then(e=>e.load().then(()=>e))),d=(0,o.z)(()=>Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(1550)]).then(()=>r(78125)));function h(e,t,r){const i=(0,l.Vp)(r);if(null==i)return e;const[o,n]=i.valid,a=2*n;let s=0,c=0;t>n?s=Math.ceil(Math.abs(t-n)/a):t<o&&(s=-Math.ceil(Math.abs(t-o)/a)),e>n?c=Math.ceil(Math.abs(e-n)/a):e<o&&(c=-Math.ceil(Math.abs(e-o)/a));let u=e+(s-c)*a;const d=u-t;return d>n?u-=a:d<o&&(u+=a),u}function m(e){const t=(0,l.Vp)(e);if(null==t)return null;const[r,o]=t.valid;return new i.hr(r,o)}const p=m(s.A.WGS84);m(s.A.WebMercator),r.d(t,["Y_",0,p])},48295(e,t,r){r.d(t,{BU:()=>u,Ui:()=>s,cq:()=>c,k3:()=>d,rb:()=>h});var i=r(4341),o=r(35522),n=r(51850),a=r(11964);function s(e,t,r){const i=1e-5,{direction:n,origin:a}=t,{p0:s,p1:l,p2:c}=e,u=l[0]-s[0],d=l[1]-s[1],h=l[2]-s[2],m=c[0]-s[0],p=c[1]-s[1],f=c[2]-s[2],v=n[1]*f-p*n[2],g=n[2]*m-f*n[0],x=n[0]*p-m*n[1],_=u*v+d*g+h*x;if(_>-i&&_<i)return!1;const b=1/_,y=a[0]-s[0],w=a[1]-s[1],S=a[2]-s[2],M=b*(y*v+w*g+S*x);if(M<0||M>1)return!1;const T=w*h-d*S,C=S*u-h*y,I=y*d-u*w,E=b*(n[0]*T+n[1]*C+n[2]*I);return!(E<0||M+E>1||(r&&((0,o.hs)(r,n,b*(m*T+p*C+f*I)),(0,o.WQ)(r,a,r)),0))}function l(e,t,r){const[i,o]=e,[n,a]=t,[s,l]=r;return.5*((n-i)*(l-o)-(a-o)*(s-i))}function c(e,t,r,i,o=0){const n=l(i,e,t),a=l(i,t,r),s=l(i,r,e);return!((n<-o||a<-o||s<-o)&&(n>o||a>o||s>o))}function u(e,t,r){return(0,o.Re)(m,t,e),(0,o.Re)(p,r,e),.5*(0,o.Bw)((0,o.$A)(m,m,p))}function d(e,t,r,i,n){(0,o.jb)(m,i,r),(0,o.jb)(f,n,r),(0,o.jb)(p,t,r);const a=(0,o.Om)(m,p),s=(0,o.Om)(f,p);if(a<=0&&s<=0)return void(0,o.C)(e,r);(0,o.jb)(p,t,i);const l=(0,o.Om)(m,p),c=(0,o.Om)(f,p);if(l>=0&&c<=l)return void(0,o.C)(e,i);const u=a*c-l*s;if(u<=0&&a>=0&&l<=0)return void(0,o.Ln)(e,r,m,a/(a-l));(0,o.jb)(p,t,n);const d=(0,o.Om)(m,p),h=(0,o.Om)(f,p);if(h>=0&&d<=h)return void(0,o.C)(e,n);const v=d*s-a*h;if(v<=0&&s>=0&&h<=0)return void(0,o.Ln)(e,r,f,s/(s-h));const g=l*h-d*c;if(g<=0&&c-l>=0&&d-h>=0)return(0,o.jb)(p,n,i),void(0,o.Ln)(e,i,p,(c-l)/(c-l+(d-h)));const x=1/(g+v+u);(0,o.C)(e,r),(0,o.Ln)(e,e,m,v*x),(0,o.Ln)(e,e,f,u*x)}function h(e,t,r,i){(0,o.jb)(m,r,t),(0,o.jb)(p,i,t),(0,o.$A)(e,m,p);const n=(0,o.Bw)(e);return 0!==n&&((0,o.hs)(e,e,1/n),!0)}r(32114),new i.I(a.vt),new i.I(()=>{return e?{p0:(0,n.o8)(e.p0),p1:(0,n.o8)(e.p1),p2:(0,n.o8)(e.p2)}:{p0:(0,n.vt)(),p1:(0,n.vt)(),p2:(0,n.vt)()};var e});const m=(0,n.vt)(),p=(0,n.vt)(),f=(0,n.vt)()},21015(e,t,r){r.d(t,{R:()=>l});var i=r(56507),o=r(60999),n=r(49186),a=r(17676),s=r(84952);class l{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,s.DB)(e)?((0,a.Te)(t),(0,s.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);const s=await(0,o.Ke)((0,i.A)(t,{responseType:e,...r}));if(s.ok)return s.value.data;throw(0,a.QP)(s.error),new n.A("gltf-loader-request-error",`Request for resource failed: ${s.error}`)}}},84498(e,t,r){r.d(t,{x:()=>a});var i=r(34275),o=r(97146),n=r(63907);function a(e,t){switch(t){case n.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,o.tM)(e):(0,i.mg)(e)?new Uint16Array(e):e}(e);case n.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,i=(0,o.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let o=0;o<r;o+=1)o%2==0?(i[t++]=e[o],i[t++]=e[o+1],i[t++]=e[o+2]):(i[t++]=e[o+1],i[t++]=e[o],i[t++]=e[o+2])}return i}(e);case n.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}const o=e[0];let n=e[1],a=0;for(let t=0;t<r;++t){const r=e[t+2];i[a++]=o,i[a++]=n,i[a++]=r,n=r}return i}(e)}}},51530(e,t,r){r.d(t,{KB:()=>a,Xi:()=>o,pn:()=>s,x3:()=>n});var i=r(44208);class o{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function n(e){return"encoded-mesh-texture"===e?.type}async function a(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function s(e,t){if("image/ktx2"===t)return new o(e);const r=new Blob([e],{type:t});let n=URL.createObjectURL(r);switch(t){case"image/jpeg":n+="#.jpg";break;case"image/png":n+="#.png"}const a=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{o(),e(a)},i=e=>{o(),t(e)},o=()=>{URL.revokeObjectURL(n),a.removeEventListener("load",r),a.removeEventListener("error",i)};a.addEventListener("load",r),a.addEventListener("error",i),a.src=n});try{a.src=n,await a.decode()}catch{}return URL.revokeObjectURL(n),a}},24426(e,t,r){r.d(t,{fetch:()=>br});var i=r(40876),o=r(61473),n=r(34727),a=r(77690),s=r(29242),l=r(58083),c=r(9093),u=r(48163),d=r(35522),h=r(51850),m=r(70328);function p(e,t=!1){return e<=1024?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var f=r(13030),v=r(73354),g=r(50867),x=r(43609),_=r(21015),b=r(84498),y=r(51530),w=r(88340);function S(e){if(null==e)return null;const t=null!=e.offset?e.offset:w.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:w.Un,o=(0,s.fA)(1,0,0,0,1,0,t[0],t[1],1),n=(0,s.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,s.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,s.vt)();return(0,a.lw)(c,n,l),(0,a.lw)(c,o,c),c}class M{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class T{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new M,this.numberOfVertices=0}}var C=r(56507),I=r(60999),E=r(49186),O=r(53966),P=r(69397);class A{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(const t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){const r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(const e of this._outer)yield e}*values(){for(const e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(const[e,t]of this._outer)for(const[r,i]of t)yield[e,r,i]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,i)=>e(t,r,i)))}clone(){const e=new A;return this.forAll((t,r,i)=>e.set(r,i,t)),e}}var D=r(17676),F=r(46140),R=r(97146),B=r(31217),N=r(46610),z=r(34275);function j(e){if(e.length<1024)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,z.LW)(e)?Float16Array.from(e):(0,z.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return(0,z.vZ)(e)?Float32Array.from(e):Uint32Array.from(e);default:return Float64Array.from(e)}}var H=r(15142),L=r(94008),W=r(620);class V{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this._readPosition=r,this._children=void 0,(0,W.vA)(e.length>=1);const i=e.length;$.clear();const o=(0,m.Ie)();for(let n=0;n<i;++n){const i=t*e[n];for(let e=0;e<t;++e){const t=i+e;$.push(t),(0,m.iT)(o,r(U,t))}}this.box=o;const n=new L.iy,a=(0,m.gX)(o,n.center);let s=.5*Math.max((0,m.VL)(o),(0,m.yr)(o),(0,m.uJ)(o)),l=s*s;for(let e=0;e<$.length;++e){const t=r(U,$.at(e)),i=(0,d.Re)(t,t,a),o=(0,d.uE)(i);if(o<=l)continue;const n=Math.sqrt(o),c=.5*(n-s);s+=c,l=s*s,(0,d.Ln)(a,a,i,c/n)}n.radius=s,this.sphere=n,$.clear()}get children(){if(this._children)return this._children;const e=this.box;if((0,m.TF)(e)<=1)return;const{_readPosition:t,_numIndexPerPrimitive:r,primitiveIndices:i}=this,o=(0,m.gX)(e,U),n=i.length,a=new Uint8Array(n),s=[0,0,0,0,0,0,0,0];for(let e=0;e<n;++e){const n=r*i[e],l=t(G,n);for(let e=1;e<r;++e)(0,d.jk)(l,l,t(k,n+e));const c=(l[0]<o[0]?1:0)|(l[1]<o[1]?2:0)|(l[2]<o[2]?4:0);a[e]=c,++s[c]}let l=0;for(let e=0;e<8;++e)s[e]>0&&++l;if(l<2)return;const c=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0];for(let e=0;e<8;++e)s[e]>0&&(c[e]=new Uint32Array(s[e]));s.fill(0);for(let e=0;e<n;++e){const t=a[e];c[t][s[t]++]=i[e]}const u=new Array;for(let e=0;e<8;++e){const i=c[e];void 0!==i&&u.push(new V(i,r,t))}return this._children=u,this._children}static prune(){$.prune()}}const U=(0,h.vt)(),G=(0,h.vt)(),k=(0,h.vt)(),$=new H.A({deallocator:null});var Z=r(24326);class q{constructor(e){this.id=(0,Z.c)(),this.type=0,this._attributes=new Map;for(const[t,r]of e)this._attributes.set(t,{...r,indices:(0,R.Dg)(r.indices)})}get attributes(){return this._attributes}}class Y{constructor(){this.uid=(0,Z.c)()}}class K extends Y{constructor(e){super(),this.highlightName=e,this.channel=0}}var X=r(94656);class J extends q{constructor(e,t,r=null,i=-1,o,n){super(t),this.material=e,this.mapPositions=r,this.edgeIndicesLength=i,this.baseGeometry=o,this.drawIndices=n,this._readPrimitivePosition=null,this._vertexPositionIndicesCache=void 0,this._transformation=void 0,this.localOrigin=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.occludees=void 0,this.visible=!0,this._boundingInfo=null,(0,W.vA)((e?.useIndexing??!1)===(null!=n),"Material index requirement and Geometry must match"),this.edgeIndicesLength<0&&(this.edgeIndicesLength=this.indexCount)}get readPrimitivePosition(){return this._readPrimitivePosition??=function(e,t){const{data:r,indices:i,size:o,stride:n}=e;return(0,W.vA)(2===o||3===o||4===o,"Position attribute must have 2, 3 or 4 components"),2===o?null!=t?(e,o)=>{const a=i[t[o]]*n;return e[0]=r[a],e[1]=r[a+1],e[2]=-2,e}:(e,t)=>{const o=i[t]*n;return e[0]=r[o],e[1]=r[o+1],e[2]=-2,e}:null!=t?(e,o)=>{const a=i[t[o]]*n;return e[0]=r[a],e[1]=r[a+1],e[2]=r[a+2],e}:function(e,t,r){return(i,o)=>{const n=t[o]*r;return i[0]=e[n],i[1]=e[n+1],i[2]=e[n+2],i}}(r,i,n)}(this.positionAttribute,this.drawIndices),this._readPrimitivePosition}_invalidateReadPrimitivePosition(){this._readPrimitivePosition=null}instantiate(e={}){const t=new J(e.material||this.material,[],this.mapPositions,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:j(t.data)},this._attributes.set(e,t),"position"===e&&this._invalidateReadPrimitivePosition()),t}setAttributeData(e,t){const r=this._attributes.get(e);r?(this._attributes.set(e,{...r,exclusive:!0,data:t}),"position"===e&&this._invalidateReadPrimitivePosition()):(0,X.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get primitivePositionIndices(){return void 0!==this._vertexPositionIndicesCache||(this._vertexPositionIndicesCache=this._computePrimitivePositionIndices()),this._vertexPositionIndicesCache}_computePrimitivePositionIndices(){const{drawIndices:e}=this,t=this.positionAttribute;if(null!=e&&null!=t){const r=new Array;for(const i of e)r.push(t.indices[i]);return r}return t?.indices??null}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this.drawIndices??this.positionAttribute?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!this.material.computeAttachmentOrigin(e,this.readPrimitivePosition,this.indexCount)&&(null!=this._transformation&&(0,d.Z0)(e,e,this._transformation),!0)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const e=this.positionAttribute,t=this.indexCount;if(!e||0===t)return null;const r=this.material.primitiveVertexCount;(0,W.vA)(t%r===0,"Indexing error: "+t+" not divisible by "+r);const i=(0,R.tM)(t/r);return new V(i,r,this.readPrimitivePosition)}get transformation(){return this._transformation??c.zK}set transformation(e){this._transformation=e&&e!==c.zK?(0,c.o8)(e):null}get highlights(){return this._highlights||Q}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}forEachHighlightOption(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new K(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const Q=new Set;var ee=r(46859),te=r(49255),re=r(97768);class ie{constructor(e){this._material=e.material,this._techniques=e.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(t))}ensureResources(e){return 2}}var oe=r(65786);class ne extends ie{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,re.Gz)(this._texture),this._textureNormal=(0,re.Gz)(this._textureNormal),this._textureEmissive=(0,re.Gz)(this._textureEmissive),this._textureOcclusion=(0,re.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,re.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new se(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,re.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,D.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,re.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class ae extends oe.Y{constructor(e=null){super(),this.textureEmissive=e}}class se extends ae{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}}var le=r(48295);const ce=(0,h.vt)(),ue=(0,h.vt)(),de=(0,h.vt)(),he=(0,h.vt)();var me=r(19245);class pe{constructor(e,t){this.id=(0,Z.c)(),this.supportsEdges=!1,this.primitiveVertexCount=3,this._renderPriority=0,this._parameters=new t,(0,me.MB)(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,me.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get emissions(){return 0}getConfiguration(e){return this.updateConfiguration(e),this._configuration}updateConfiguration(e){this._configuration.output=e.output,this._configuration.hasEmission=e.hasEmission&&(0,te._o)(e.output),this._configuration.hasHighlightMixTexture=10===e.output&&null!=e.highlightMixTexture,this._configuration.useFloatBlend=e.useFloatBlend.value,this._configuration.emissionDimmingPass=e.transparentWithoutDepthEmissionDimmingPass&&(0,te._o)(e.output)}computeAttachmentOrigin(e,t,r){return function(e,t,r){if(r<=0)return!1;(0,d.hZ)(e,0,0,0),(0,d.hZ)(he,0,0,0);let i=0,o=0;for(let n=0;n<r;++n){const r=3*n;t(ce,r),t(ue,r+1),t(de,r+2);const a=(0,le.BU)(ce,ue,de);a?((0,d.WQ)(ce,ce,ue),(0,d.WQ)(ce,ce,de),(0,d.hs)(ce,ce,1/3*a),(0,d.WQ)(e,e,ce),i+=a):((0,d.WQ)(he,he,ce),(0,d.WQ)(he,he,ue),(0,d.WQ)(he,he,de),o+=3)}return!(0===o&&0===i||(0!==i?((0,d.hs)(e,e,1/i),0):0===o||((0,d.hs)(e,he,1/o),0)))}(e,t,r/3)}}oe.Y;var fe=r(58682),ve=r(90629),ge=r(65720),xe=r(27921),_e=r(19419),be=r(11964);function ye(e,t){return e.isRectangle?(0,_e.Uc)(e.bounds,t):function(e,t){return Se(e[0],e[1],t)}(t,e.points)}function we(e,t,r,i){const o=Math.min(t[0],r[0],i[0]),n=Math.min(t[1],r[1],i[1]),a=Math.max(t[0],r[0],i[0]),s=Math.max(t[1],r[1],i[1]);if(!function(e,t){if(!(0,_e.HY)(e.bounds,t))return!1;if(e.isRectangle)return!0;for(const r of e.points)if((0,_e.Uc)(t,r))return!0;if(function(e,t){const r=e[0],i=e[1],o=e[2],n=e[3];return Se(r,i,t)||Se(o,i,t)||Se(o,n,t)||Se(r,n,t)}(t,e.points))return!0;for(let r=0;r<e.points.length;r++)if(Me(e.points[r],r===e.points.length-1?e.points[0]:e.points[r+1],t))return!0;return!1}(e,(0,_e.fA)(o,n,a,s,Pe)))return!1;if(ye(e,t)||ye(e,r)||ye(e,i))return!0;for(const o of e.points)if((0,le.cq)(t,r,i,o,Ae))return!0;for(let o=0;o<e.points.length;o++){const n=e.points[o],a=e.points[(o+1)%e.points.length];if(Ce(t,r,n,a)||Ce(r,i,n,a)||Ce(i,t,n,a))return!0}return!1}function Se(e,t,r){let i=!1;for(let o=0,n=r.length-1;o<r.length;n=o++){const a=r[o],s=r[n];a[1]>t!=s[1]>t&&e<(s[0]-a[0])*(t-a[1])/(s[1]-a[1])+a[0]&&(i=!i)}return i}function Me(e,t,r){const i=r[0],o=r[1],n=r[2],a=r[3],s=e[0],l=e[1],c=t[0],u=t[1];return!(s<i&&c<i||s>n&&c>n||l<o&&u<o||l>a&&u>a)&&(!(!(0,_e.Rj)(r,s,l)&&!(0,_e.Rj)(r,c,u))||Te(e,t,i,o,n,o)||Te(e,t,n,o,n,a)||Te(e,t,n,a,i,a)||Te(e,t,i,a,i,o))}function Te(e,t,r,i,o,n){const a=Ie(e[0],e[1],t[0],t[1],r,i),s=Ie(e[0],e[1],t[0],t[1],o,n),l=Ie(r,i,o,n,e[0],e[1]),c=Ie(r,i,o,n,t[0],t[1]);return a!==s&&l!==c||0===a&&Ee(e,t,r,i)||0===s&&Ee(e,t,o,n)||0===l&&Oe(r,i,o,n,e[0],e[1])||0===c&&Oe(r,i,o,n,t[0],t[1])}function Ce(e,t,r,i){return Te(e,t,r[0],r[1],i[0],i[1])}function Ie(e,t,r,i,o,n){const a=(i-t)*(o-r)-(r-e)*(n-i);return Math.abs(a)<=Ae?0:Math.sign(a)}function Ee(e,t,r,i){return Oe(e[0],e[1],t[0],t[1],r,i)}function Oe(e,t,r,i,o,n){return o>=Math.min(e,r)-Ae&&o<=Math.max(e,r)+Ae&&n>=Math.min(t,i)-Ae&&n<=Math.max(t,i)+Ae}const Pe=(0,_e.vt)(),Ae=((0,ve.r_)(),(0,ve.r_)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,be.vt)(),1e-9);class De{constructor(e){this.type=e,this.distance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=(0,h.vt)(),this.normal=(0,h.vt)()}reset(){this.distance=Number.POSITIVE_INFINITY,this.hasNormal=!1}update(e,t,r,i){this.distance=e,this.primitiveIndex=t,(0,d.C)(this.point,r),this.hasNormal=null!=i,null!=i&&(0,d.C)(this.normal,i)}updateIfCloserFromValues(e,t,r,i){e<this.distance&&this.update(e,t,r,i)}updateIfCloser(e){const{distance:t,primitiveIndex:r,point:i,normal:o}=e;this.updateIfCloserFromValues(t,r,i,e.hasNormal?o:null)}get valid(){return Number.isFinite(this.distance)}}function Fe(e,t,r,i,o){if(!e.visible)return null;const n=new De(4);let a;a=e.boundingInfo?Be(e.readPrimitivePosition,e.boundingInfo,t,r,i,o):Re(t,r,i,0,e.faceCount,e.readPrimitivePosition,o,null,0);for(const e of a)n.updateIfCloser(e);return n.valid?n:null}function*Re(e,t,r,i,o,n,a,s=null,l=0){if(null==e.camera)return;const{camera:c,screenPolygonPrimitiveProcessor:u}=e;for(let e=i;e<o;++e){const i=(s?.[e]??e)+l,o=null==s?i:e,h=3*i;Ne(Le[0],n,h+0,a,o,t),Ne(Le[1],n,h+1,a,o,t),Ne(Le[2],n,h+2,a,o,t);const m=Ge;let p;$e.reset();const f=We;for(const e of u.processTriangle(Le))if(f.length=0,(0,xe.H)(c.frustum[4],e,()=>f.pushNew(),!1),!(f.length<3)){for(let e=0;e<f.length;e++)c.projectToScreen(f.at(e),Ve[e]);ze(r,Ve,f.length)&&(je(c.eye,f,Ue),null==p&&(p=(0,le.rb)(Ge,Le[0],Le[1],Le[2])),$e.updateIfCloserFromValues((0,d.Io)(c.eye,Ue),i,Ue,p?m:null))}$e.valid&&(yield $e)}}function*Be(e,t,r,i,o,n){let a;if(null!=n?((0,m.C)(He,t.box),n.applyToAabb(He),a=(0,ge.GH)(o.broadPhaseFrustum,He,i)):a=(0,ge.GH)(o.broadPhaseFrustum,t.box,i),!a)return;const{primitiveIndices:s}=t,l=s.length;if(l>1e3){const a=t.children;if(void 0!==a){for(const t of a)yield*Be(e,t,r,i,o,n);return}}yield*Re(r,i,o,0,l,e,n,s,0)}function Ne(e,t,r,i,o,n){const[a,s,l]=t(e,r);null!=i?i.applyToVertex(e,a,s,l,o):(0,d.hZ)(e,a,s,l),n&&(0,d.Z0)(e,e,n)}function ze(e,t,r){for(let i=1;i<r-1;i++)if(we(e,t[0],t[i],t[i+1]))return!0;return!1}function je(e,t,r){let i=Number.POSITIVE_INFINITY;const o=t.at(0);for(let n=1;n<t.length-1;n++){(0,le.k3)(ke,e,o,t.at(n),t.at(n+1));const a=(0,d.hG)(e,ke);a<i&&(i=a,(0,d.C)(r,ke))}}const He=(0,m.vt)(),Le=[(0,h.vt)(),(0,h.vt)(),(0,h.vt)()],We=new H.A({allocator:e=>e??(0,h.vt)()}),Ve=Array.from({length:12},()=>(0,ve.gs)()),Ue=(0,h.vt)(),Ge=(0,h.vt)(),ke=(0,h.vt)(),$e=new De(4);var Ze=r(16396);function qe(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 Ye(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,1===i)for(let e=0;e<l;++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<l;++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 Ke(e,t,r,i,o=1){const{data:n,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t===n.length&&4===t){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=l/4,a=e[i/=4];i+=t;const u=c*o;for(let r=1;r<u;++r)e[i]=a,i+=t;return}if(1!==o)if(4!==t)for(let e=0;e<c;++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+=l}else for(let e=0;e<c;++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+=l}else{if(4===t){for(let e=0;e<c;++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+=l}return}for(let e=0;e<c;++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+=l}}}function Xe(e,t,r,i,o,n){switch(e){case"position":{(0,W.vA)(3===t.size);const i=o.getField(e,f.xs);(0,W.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void Ye(e,r,i,o);const{data:n,indices:a}=e,s=r.typedBuffer,c=r.typedBufferStride,u=a.length,d=t[0],h=t[1],m=t[2],p=t[4],f=t[5],v=t[6],g=t[8],x=t[9],_=t[10],b=t[12],y=t[13],w=t[14];i*=c;let S=0,M=0,T=0;const C=(0,l.tZ)(t)?e=>{S=n[e]+b,M=n[e+1]+y,T=n[e+2]+w}:e=>{const t=n[e],r=n[e+1],i=n[e+2];S=d*t+p*r+g*i+b,M=h*t+f*r+x*i+y,T=m*t+v*r+_*i+w};if(1===o)for(let e=0;e<u;++e)C(3*a[e]),s[i]=S,s[i+1]=M,s[i+2]=T,i+=c;else for(let e=0;e<u;++e){C(3*a[e]);for(let e=0;e<o;++e)s[i]=S,s[i+1]=M,s[i+2]=T,i+=c}}(t,r,i,n);break}case"normal":{(0,W.vA)(3===t.size);const r=o.getField(e,f.xs);(0,W.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void Ye(e,r,i,o);const{data:n,indices:a}=e,s=t,c=r.typedBuffer,u=r.typedBufferStride,d=a.length,h=s[0],m=s[1],p=s[2],f=s[4],v=s[5],g=s[6],x=s[8],_=s[9],b=s[10],y=!(0,l.ut)(s),w=1e-6,S=1-w;i*=u;let M=0,T=0,C=0;const I=(0,l.tZ)(s)?e=>{M=n[e],T=n[e+1],C=n[e+2]}:e=>{const t=n[e],r=n[e+1],i=n[e+2];M=h*t+f*r+x*i,T=m*t+v*r+_*i,C=p*t+g*r+b*i};if(1===o)if(y)for(let e=0;e<d;++e){I(3*a[e]);const t=M*M+T*T+C*C;if(t<S&&t>w){const e=1/Math.sqrt(t);c[i]=M*e,c[i+1]=T*e,c[i+2]=C*e}else c[i]=M,c[i+1]=T,c[i+2]=C;i+=u}else for(let e=0;e<d;++e)I(3*a[e]),c[i]=M,c[i+1]=T,c[i+2]=C,i+=u;else for(let e=0;e<d;++e){if(I(3*a[e]),y){const e=M*M+T*T+C*C;if(e<S&&e>w){const t=1/Math.sqrt(e);M*=t,T*=t,C*=t}}for(let e=0;e<o;++e)c[i]=M,c[i+1]=T,c[i+2]=C,i+=u}}(t,i,r,n);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,W.vA)(2===t.size);const r=o.getField(e,f.mJ);(0,W.vA)(!!r,`No buffer view for ${e}`),qe(t,r,n);break}case"uv0":{(0,W.vA)(2===t.size);const r=o.getField(e,f.ZD)??o.getField(e,f.gH);(0,W.vA)(!!r,`No buffer view for ${e}`),qe(t,r,n);break}case"uvi":{(0,W.vA)(2===t.size);const r=o.getField(e,f.mJ);(0,W.vA)(!!r,`No buffer view for ${e}`),qe(t,r,n);break}case"color":case"symbolColor":{const r=o.getField(e,f.XP);(0,W.vA)(!!r,`No buffer view for ${e}`),(0,W.vA)(3===t.size||4===t.size),Ke(t,t.size,r,n);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=o.getField(e,f.Y$)??o.getField(e,f.Y$);(0,W.vA)(!!r,`No buffer view for ${e}`),(0,W.vA)(1===t.size),function(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length,l=i[0];r*=a;for(let e=0;e<s;++e)n[r]=l,r+=a}(t,r,n);break}case"tangent":{(0,W.vA)(4===t.size);const i=o.getField(e,f.Eq);(0,W.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void function(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,1===i)for(let e=0;e<l;++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<l;++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}}(e,r,i,o);const{data:n,indices:a}=e,s=t,c=r.typedBuffer,u=r.typedBufferStride,d=a.length,h=s[0],m=s[1],p=s[2],f=s[4],v=s[5],g=s[6],x=s[8],_=s[9],b=s[10],y=!(0,l.ut)(s),w=1e-6,S=1-w;if(i*=u,1===o)for(let e=0;e<d;++e){const t=4*a[e],r=n[t],o=n[t+1],s=n[t+2],l=n[t+3];let d=h*r+f*o+x*s,M=m*r+v*o+_*s,T=p*r+g*o+b*s;if(y){const e=d*d+M*M+T*T;if(e<S&&e>w){const t=1/Math.sqrt(e);d*=t,M*=t,T*=t}}c[i]=d,c[i+1]=M,c[i+2]=T,c[i+3]=l,i+=u}else for(let e=0;e<d;++e){const t=4*a[e],r=n[t],s=n[t+1],l=n[t+2],d=n[t+3];let M=h*r+f*s+x*l,T=m*r+v*s+_*l,C=p*r+g*s+b*l;if(y){const e=M*M+T*T+C*C;if(e<S&&e>w){const t=1/Math.sqrt(e);M*=t,T*=t,C*=t}}for(let e=0;e<o;++e)c[i]=M,c[i+1]=T,c[i+2]=C,c[i+3]=d,i+=u}}(t,r,i,n);break}case"olidColor":(0,W.vA)(4===t.size),Ke(t,4,o.getField(e,f.XP),n)}}(0,h.vt)();class Je{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i){null!=i&&function(e,t,r,i,o){const{buffer:n,offset:a}=o;for(const o of t.fields.keys()){const t=e.get(o),s=t?.indices;t&&s&&Xe(o,t,r,i,n,a)}}(r,this.layout,e,t,i)}}const Qe=nt(-1),et=nt(1),tt=Qe,rt=new Array;rt[0]=null,rt[1]=et,rt[2]=Qe,rt[3]=nt(-2),rt[4]=nt(-3);const it=rt.map(e=>function(e,t){return t?{factor:e.factor+t.factor,units:e.units+t.units}:e}(tt,e));function ot({output:e,enableOITOffset:t,polygonOffset:r}){return(0,te._$)(e)&&t?it[r]:rt[r]}function nt(e){return{factor:1*e,units:2*e}}rt[1]=et;var at=r(32198),st=r(51976),lt=r(34711);class ct extends lt.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,at.Cg)([(0,st.W)()],ct.prototype,"hasHighlightMixTexture",void 0),(0,at.Cg)([(0,st.W)()],ct.prototype,"emissionDimmingPass",void 0);class ut extends ct{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,at.Cg)([(0,st.W)({count:5})],ut.prototype,"polygonOffset",void 0),(0,at.Cg)([(0,st.W)()],ut.prototype,"transparent",void 0),(0,at.Cg)([(0,st.W)()],ut.prototype,"enableOITOffset",void 0);const dt=new ut,ht=2e-5,mt=2e-6,pt=(0,h.vt)();var ft=r(91429),vt=r(91829),gt=r(4431),xt=r(1843),_t=r(72824),bt=r(13840),yt=r(42958),wt=r(16943),St=r(90644);const Mt=(0,St.p3)(1,0,1,771);function Tt(e,t=!1,r=!1){if(r)return St.uR;switch(e){case 0:return t?St.RC:St.T8;case 1:return Mt;default:return null}}function Ct(e){if(e.draped)return null;switch(e.output){case 0:case 2:default:return e.writeDepth?St.Uy:null;case 1:return null}}function It(e,t=513){return{func:(0,te._$)(e)?515:t}}(0,vt._Y)();const Et={mask:255},Ot=(0,St.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),Pt=(0,St.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681});(0,St.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),(0,St.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680}),r(4576),r(66289);var At=r(69622),Dt=r(65529),Ft=r(32728);class Rt{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",f.Eq),this.color=e.getField("instanceColor",f.XP),this.olidColor=e.getField("instanceOlidColor",f.XP),this.state=e.getField("state",f.SL),this.lodLevel=e.getField("lodLevel",f.SL)}}let Bt=class extends At.A{constructor(e,t){super(e),this.events=new Dt.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return zt(Nt.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=Vt,this._buffer=this._layout.createBuffer(this._capacity),this._view=new Rt(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,W.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,W.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=jt,i=Ht;t.localTransform.getMat(e,Lt),t.globalTransform.getMat(e,Wt);const o=(0,l.lw)(Wt,Wt,Lt);(0,d.hZ)(r,o[12],o[13],o[14]),t.modelOrigin.setVec(e,r),(0,a.z0)(i,o),t.model.setMat(e,i);const n=(0,Ft.wp)(jt,o);n.sort(),t.modelScaleFactors.set(e,0,n[1]),t.modelScaleFactors.set(e,1,n[2]),(0,a.B8)(i,i),(0,a.mg)(i,i),t.modelNormal.setMat(e,i),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,Ht),r.modelOrigin.getVec(e,jt),t[0]=Ht[0],t[1]=Ht[1],t[2]=Ht[2],t[3]=0,t[4]=Ht[3],t[5]=Ht[4],t[6]=Ht[5],t[7]=0,t[8]=Ht[6],t[9]=Ht[7],t[10]=Ht[8],t[11]=0,t[12]=jt[0],t[13]=jt[1],t[14]=jt[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(jt,this,e),t*=Math.max(jt[0],jt[1],jt[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(jt,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(jt[0],jt[1],jt[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(Vt,Math.floor(1.5*this._capacity)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new Rt(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,at.Cg)([(0,ft.MZ)({constructOnly:!0})],Bt.prototype,"shaderTransformation",void 0),(0,at.Cg)([(0,ft.MZ)()],Bt.prototype,"_size",void 0),(0,at.Cg)([(0,ft.MZ)({readOnly:!0})],Bt.prototype,"size",null),Bt=(0,at.Cg)([(0,ft.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],Bt);const Nt=(0,xt.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function zt(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,wt.E)()&&e.vec4u8("instanceOlidColor"),e}const jt=(0,h.vt)(),Ht=(0,s.vt)(),Lt=(0,c.vt)(),Wt=(0,c.vt)(),Vt=64,Ut=(0,xt.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var Gt=r(74810),kt=r(28491),$t=r(49788);class Zt extends _t.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Gt.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=h.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,h.CN)(.2,.2,.2),this.diffuse=(0,h.CN)(.8,.8,.8),this.externalColor=(0,vt.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,h.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=$t.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}_t.gy;let qt=class extends yt.w{constructor(e,t){let i=(0,gt.U)(Xt(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,gt.U)(function(e){return zt(Ut.clone(),e)}(t)))),super(e,t,i),this.shader=new bt.r(kt.D,()=>r.e(5141).then(()=>r(5141))),this.ignoreUnused=!0}_makePipeline(e,t){const{output:r,transparent:i,cullFace:o,customDepthTest:n,hasOccludees:a}=e;return(0,St.Ey)({blending:i?Tt(r,!1,e.emissionDimmingPass):null,culling:Kt(e)?(0,St.Xt)(o):null,depthTest:It(r,Yt(n)),depthWrite:Ct(e),colorWrite:St.kn,stencilWrite:a?Et:null,stencilTest:a?t?Pt:Ot:null,polygonOffset:ot(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,r){return r?this._occludeePipelineState:super.getPipeline(e,t,r)}};function Yt(e){switch(e){case 1:return 515;case 0:case 4:return 513;case 2:return 516;case 3:return 514}}function Kt(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Xt(e){const t=(0,xt.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,wt.E)()&&t.vec4u8("olidColor"),t}qt=(0,at.Cg)([(0,ft.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],qt);class Jt extends ut{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1,this.renderOccluded=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}}(0,at.Cg)([(0,st.W)({count:4})],Jt.prototype,"alphaDiscardMode",void 0),(0,at.Cg)([(0,st.W)({count:3})],Jt.prototype,"doubleSidedMode",void 0),(0,at.Cg)([(0,st.W)({count:8})],Jt.prototype,"pbrMode",void 0),(0,at.Cg)([(0,st.W)({count:3})],Jt.prototype,"cullFace",void 0),(0,at.Cg)([(0,st.W)({count:3})],Jt.prototype,"normalType",void 0),(0,at.Cg)([(0,st.W)({count:4})],Jt.prototype,"customDepthTest",void 0),(0,at.Cg)([(0,st.W)({count:8})],Jt.prototype,"emissionSource",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasVertexColors",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasSymbolColors",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasVerticalOffset",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasColorTexture",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasMetallicRoughnessTexture",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasOcclusionTexture",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasNormalTexture",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasScreenSizePerspective",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasVertexTangents",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasOccludees",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"instanced",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"instancedDoublePrecision",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasModelTransformation",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"offsetBackfaces",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasVVSize",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasVVColor",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"receiveShadows",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasShadowHighlights",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"receiveAmbientOcclusion",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"receiveGlobalIllumination",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"textureAlphaPremultiplied",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"instancedFeatureAttribute",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"instancedColor",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"writeDepth",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"snowCover",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasColorTextureTransform",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasEmissionTextureTransform",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasNormalTextureTransform",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasOcclusionTextureTransform",void 0),(0,at.Cg)([(0,st.W)()],Jt.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Qt=r(57323);let er=class extends qt{constructor(){super(...arguments),this.shader=new bt.r(Qt.R,()=>r.e(9933).then(()=>r(39933)))}};er=(0,at.Cg)([(0,ft.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],er);class tr extends st.K{constructor(){super(...arguments),this.receiveShadows=!0}}(0,at.Cg)([(0,st.W)()],tr.prototype,"receiveShadows",void 0);class rr extends pe{constructor(e,t){super(e,or),this.materialType="default",this.supportsEdges=!0,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,e=>(0,te.uw)(e)&&!this.transparent],[4,e=>(0,te.uw)(e)&&this.transparent]]),this._layout=Xt(this.parameters),this._configuration=new Jt(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||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])>=$t.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,d.t2)(this.parameters.emissiveBaseColor,h.uY)}get emissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;const{treeRendering:i,doubleSided:o,doubleSidedType:n}=t;r.hasVertexTangents=!i&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=i?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.hasModelTransformation=!i&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=i?2:o&&"normal"===n?1:o&&"winding-order"===n?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,(0,te._o)(e.output)?(r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=function(e,t){return e.receiveShadows&&null!=t.shadowHighlight?.getTexture()}(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&e.globalIlluminationEnabled):r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=r.receiveGlobalIllumination=!1,r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.unlit?7:t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersectRay(e,t,r,i,o,n){const a=this._getMaterialVerticalOffset(t,r);null!=a&&(i=(0,d.Re)(nr,i,a),o=(0,d.Re)(ar,o,a)),n=function(e,t,r,i){dt.output=t.transparent?1:0,dt.polygonOffset=t.polygonOffset,dt.enableOITOffset=t.enableOITOffset;const o=ot(dt);if(!o)return e;const n=mt*o.units,a=(0,d.oW)(pt,i,r);return(t,r,i,s)=>{const l=(i?1-Math.abs((0,d.Om)(a,i)):0)*o.factor*ht+n;return e(t,r+l,i,s)}}(n,this._configuration,i,o),(0,fe.Uy)(e,r,i,o,(0,Ze.ou)(r.verticalOffset),n)}intersectScreenPolygon(e,t,r,i){return function(e,t,r){return null==e?null:(e.distance=function(e,t,r,i,o){const n=ot(r);return n?function({units:e,factor:t},r,i,o){const n=mt*e;return i+((o?1-Math.abs((0,d.Om)(r,o)):0)*t*ht+n)}(n,(0,d.oW)(pt,o,i),e,t):e}(e.distance,e.hasNormal?e.normal:null,t,r,e.point),e)}(Fe(e,r,t,i,this._createScreenPolygonVertexDisplacement(t,r)),this._configuration,r.camera.eye)}createGLMaterial(e){return new ir(e)}createBufferWriter(){return new Je(this._layout)}get transparent(){const{drivenOpacity:e,opacity:t,externalColor:r,layerOpacity:i,texture:o,textureId:n,textureAlphaMode:a,colorMixMode:s}=this.parameters,l=r[3];return e||t<1&&"replace"!==s||l<1&&"ignore"!==s||i<1||(null!=o||null!=n)&&1!==a&&2!==a&&"replace"!==s}_createScreenPolygonVertexDisplacement(e,t){const r=this._getMaterialVerticalOffset(e,t);return null==r?null:{applyToVertex:(e,t,i,o)=>(e[0]=t+r[0],e[1]=i+r[1],e[2]=o+r[2],e),applyToAabb:e=>((0,m.Ne)(e,(0,d.WQ)(hr,(0,m.pg)(e,hr),r)),(0,m.vI)(e,(0,d.WQ)(hr,(0,m.Lu)(e,hr),r)),e)}}_getMaterialVerticalOffset(e,t){if(null==this.parameters.verticalOffset)return null;const r=t.camera;(0,d.hZ)(cr,e[12],e[13],e[14]);let i=null;switch(t.viewingMode){case 1:i=(0,d.S8)(lr,cr);break;case 2:i=(0,d.C)(lr,sr)}const o=(0,d.Re)(ur,cr,r.eye),n=(0,d.Bw)(o),a=(0,d.hs)(o,o,1/n);let s=null;this.parameters.screenSizePerspective&&(s=(0,d.Om)(i,a));const l=(0,me.kE)(r,n,this.parameters.verticalOffset,s??0,this.parameters.screenSizePerspective,null);return(0,d.hs)(i,i,l),(0,d.ei)(dr,i,t.transform.inverseRotation)}}class ir extends ne{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,d.hZ)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?er:qt,e)}}class or extends Zt{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1,this.unlit=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const nr=(0,h.vt)(),ar=(0,h.vt)(),sr=(0,h.fA)(0,0,1),lr=(0,h.vt)(),cr=(0,h.vt)(),ur=(0,h.vt)(),dr=(0,h.vt)(),hr=(0,h.vt)(),mr=()=>O.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class pr{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function fr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(mr().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(mr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(mr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(mr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else mr().warn("Indexed geometries must specify faces"),i=!1;break}default:mr().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(mr().warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(mr().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function vr(e){const t=(0,m.Ie)();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&(0,m.RF)(t,r.box)}),t}function gr(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function xr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const _r=new F.A(1,2,"wosr");async function br(e,t){const s=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:{fileType:e.match(/(.*\.(json|json\.gz))$/)?"wosr":"unknown",url:e,specifiedLodIndex:null}}((0,o.EM)(e));if("wosr"===s.fileType){const e=await(t.cache?t.cache.loadWOSR(s.url,t):async function(e,t){const r=await async function(e,t){const r=await(0,I.Ke)((0,C.A)(e,t));if(r.ok)return r.value.data;(0,D.QP)(r.error),function(e){throw new E.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],n=o.images[0].data;if(!n){mr().warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==gr(l)},u=t?.disableTextures?Promise.resolve(null):(0,B.D)(a,t);r.push(u.then(e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l})))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return new pr(r,i,o+(0,P.Qh)(r))}(s.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new A,a=e.resource,s=F.A.parse(a.version||"1.0","wosr");_r.validate(s);const l=a.model.name,c=a.model.geometries,u=a.materialDefinitions??{},d=e.textures;let m=0;const p=new Map;for(let e=0;e<c.length;e++){const a=c[e];if(!fr(a))continue;const s=xr(a),l=a.params.vertexAttributes,f=[],v=e=>{if("PerAttributeArray"===a.params.topology)return null;const t=a.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l.position,x=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=v(e)??(0,R.tM)(x);f.push([e,new N.n(r,i,t.valuesPerElement,!0)])}const _=s.texture,b=d&&d[_];if(b&&!p.has(_)){const{image:e,parameters:t}=b,r=new ee.h(e,t);i.push(r),p.set(_,r)}const y=p.get(_),w=y?y.id:void 0,S=s.material;let M=n.get(S,_);if(null==M){const e=u[S.slice(S.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=b?gr(b.alphaChannelUsage):void 0,i={ambient:(0,h.ci)(e.diffuse),diffuse:(0,h.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:w,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:b?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(i,t.materialParameters),M=new rr(i,t),n.set(S,_,M)}o.push(M);const T=new J(M,f);m+=f.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(T)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:vr(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}let w;if(t.cache)w=await t.cache.loadGLTF(s.url,t,!!t.usePBR,!!t.useEmissive);else{const{loadGLTF:e}=await r.e(1698).then(()=>r(51698));w=await e(new _.R,s.url,t,t.usePBR,t.useEmissive)}const{engineResources:M,referenceBoundingBox:O}=function(e,t,r){const o=e.model,s=e.meta,_=o.meta?.ESRI_proxyEllipsoid,w=s.isEsriSymbolResource&&null!=_&&"EsriRealisticTreesStyle"===s.ESRI_webstyle;w&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,a=n.count,s=(0,h.vt)(),u=(0,h.vt)(),m=(0,h.vt)(),p=new Float32Array(4*a),v=new Float32Array(3*a),g=(0,l.B8)((0,c.vt)(),o.transform);let x=0,_=0;for(let l=0;l<a;l++){n.getVec(l,u),i.getVec(l,s),(0,d.Z0)(u,u,o.transform),(0,d.Re)(m,u,t.center),(0,d.Qr)(m,m,t.radius);const a=m[2],c=(0,d.Bw)(m),h=Math.min(.45+.55*c*c,1)**2.2;(0,d.Qr)(m,m,t.radius),null!==g&&(0,d.Z0)(m,m,g),(0,d.S8)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.Cc)(m,m,s,a>-1?.2:Math.min(-4*a-3.8,1)),v[x]=m[0],v[x+1]=m[1],v[x+2]=m[2],x+=3,p[_]=h,p[_+1]=h,p[_+2]=h,p[_+3]=1,_+=4}o.attributes.normal=new f.xs(v.buffer),o.attributes.color=new f.Eq(p.buffer)}}}(e,_));const M=!!t.usePBR,C=s.isEsriSymbolResource?{usePBR:M,isSchematic:!1,treeRendering:w,mrrFactors:Gt.SY}:{usePBR:M,isSchematic:!1,treeRendering:!1,mrrFactors:Gt.mb},I={...t.materialParameters,treeRendering:w},E=new Array,O=new Map,P=new Map,A=o.lods.length,D=(0,m.Ie)();return o.lods.forEach((e,s)=>{const l=!0===t.skipHighLods&&(A>1&&0===s||A>3&&1===s)||!1===t.skipHighLods&&null!=r&&s!==r;if(l&&0!==s)return;const c=new T(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const r=l?new rr({},t):function(e,t,r,o,n,a,s,l,c){const d=e.materials.get(t.material);if(null==d)return null;const{normal:m,color:p,texCoord0:f,tangent:v}=t.attributes,g=t.material+(m?"_normal":"")+(p?"_color":"")+(f?"_texCoord0":"")+(v?"_tangent":""),x=null!=t.attributes.texCoord0,_=null!=t.attributes.normal,b=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(d.alphaMode);if(!a.has(g)){if(x){const t=(t,r=!1,i=!1)=>{if(null!=t&&!s.has(t)){const o=e.textures.get(t);if(o){const e=o.data,n=r&&!(0,y.x3)(e)?l.compressionOptions:void 0;s.set(t,new ee.h((0,y.x3)(e)?e.data:e,{...o.parameters,preMultiplyAlpha:!(0,y.x3)(e)&&i,encoding:(0,y.x3)(e)?e.encoding:void 0,compressionOptions:n}))}}},r=1!==b&&!c;t(d.colorTexture,r,1!==b),t(d.normalTexture),t(d.occlusionTexture,!0),t(d.emissiveTexture),t(d.metallicRoughnessTexture,!0)}const r=(0,i.xV)(d.color[0]),m=(0,i.xV)(d.color[1]),p=(0,i.xV)(d.color[2]),f=null!=d.colorTexture&&x?s.get(d.colorTexture):null,v=(0,Gt.Jr)(d),w=null!=d.normalTextureTransform?.scale?d.normalTextureTransform?.scale:u.Un;a.set(g,new rr({...o,customDepthTest:1,textureAlphaMode:b,textureAlphaCutoff:d.alphaCutoff,diffuse:[r,m,p],ambient:[r,m,p],opacity:"OPAQUE"===d.alphaMode?1:d.opacity,doubleSided:d.doubleSided,doubleSidedType:"winding-order",cullFace:d.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:_?0:2,castShadows:!0,receiveShadows:d.receiveShadows,receiveAmbientOcclusion:d.receiveAmbientOcclusion,unlit:d.unlit,textureId:null!=f?f.id:void 0,colorMixMode:d.colorMixMode,normalTextureId:null!=d.normalTexture&&x?s.get(d.normalTexture).id:void 0,textureAlphaPremultiplied:null!=f&&!!f.parameters.preMultiplyAlpha,occlusionTextureId:null!=d.occlusionTexture&&x?s.get(d.occlusionTexture).id:void 0,emissiveTextureId:null!=d.emissiveTexture&&x&&!d.unlit?s.get(d.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=d.metallicRoughnessTexture&&x?s.get(d.metallicRoughnessTexture).id:void 0,emissiveBaseColor:d.unlit?h.uY:[d.emissiveFactor[0],d.emissiveFactor[1],d.emissiveFactor[2]],emissiveStrengthKHR:null!=d.emissiveStrengthKHR?d.emissiveStrengthKHR:1,emissiveStrengthFromSymbol:null!=n.emissiveStrengthFromSymbol?n.emissiveStrengthFromSymbol:void 0,mrrFactors:v?Gt.Bt:[d.metallicFactor,d.roughnessFactor,o.mrrFactors[2]],isSchematic:v,colorTextureTransformMatrix:S(d.colorTextureTransform),normalTextureTransformMatrix:S(d.normalTextureTransform),scale:[w[0],w[1]],occlusionTextureTransformMatrix:S(d.occlusionTextureTransform),emissiveTextureTransformMatrix:S(d.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:S(d.metallicRoughnessTextureTransform),...n},l))}const w=a.get(g);if(r.stageResources.materials.push(w),x){const e=e=>{null!=e&&r.stageResources.textures.push(s.get(e))};e(d.colorTexture),e(d.normalTexture),e(d.occlusionTexture),e(d.emissiveTexture),e(d.metallicRoughnessTexture)}return w}(o,e,c,C,I,O,P,t,w),{geometry:d,vertexCount:_}=function(e,t){const r=e.attributes.position.count,i=(0,b.x)(e.indices||r,e.primitiveType),o=p(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,v.t)(o,s,e.transform,3,l);const c=[["position",new N.n(o,i,3,!0)]];if(null!=e.attributes.normal){const t=p(3*r),{typedBuffer:o,typedBufferStride:s}=e.attributes.normal;(0,a.Ge)(yr,e.transform),(0,v.b)(t,o,yr,3,s),(0,n.or)(yr)&&(0,v.n)(t,t),c.push(["normal",new N.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=p(4*r),{typedBuffer:o,typedBufferStride:s}=e.attributes.tangent;(0,a.z0)(yr,e.transform),(0,g.t)(t,o,yr,4,s),(0,n.or)(yr)&&(0,v.n)(t,t,4),c.push(["tangent",new N.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=p(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,x.a)(t,o,2,n),c.push(["uv0",new N.n(t,i,2,!0)])}const u=e.attributes.color;if(null!=u){const t=new Uint8Array(4*r);4===u.elementCount?u instanceof f.Eq?(0,g.b)(t,u,1,255):(u instanceof f.XP||u instanceof f.Uz)&&(0,g.b)(t,u,1/255,255):(t.fill(255),u instanceof f.xs?(0,v.f)(t,u.typedBuffer,1,255,4,u.typedBufferStride):(e.attributes.color instanceof f.eI||e.attributes.color instanceof f.nS)&&(0,v.f)(t,u.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new N.n(t,i,4,!0)])}return{geometry:new J(t,c),vertexCount:r}}(e,r??new rr({},t)),M=d.boundingInfo;null!=M&&0===s&&(0,m.RF)(D,M.box),null!=r&&(c.stageResources.geometries.push(d),c.numberOfVertices+=_)}),l||E.push(c)}),{engineResources:E,referenceBoundingBox:D}}(w,t,s.specifiedLodIndex);return{lods:M,referenceBoundingBox:O,isEsriSymbolResource:w.meta.isEsriSymbolResource,isWosr:!1}}const yr=(0,s.vt)()},26857(e,t,r){var i=r(32198),o=r(69622),n=r(91429);let a=class extends o.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.UPDATING=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,n.MZ)()],a.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"UPDATING",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),a=(0,i.Cg)([(0,n.$K)("esri.views.3d.support.debugFlags")],a);const s=new a;r.d(t,["b",0,s])},46686(e,t,r){r.d(t,{A7:()=>n,Y0:()=>o});var i=r(29941);class o extends i.v{constructor(e){super(),this.spherical=e,this.draped=!1}}function n(e){(function(e){e.varyings.add("linearDepth","float",{invariant:!0})})(e),e.vertex.code.add("void forwardLinearDepth(float _linearDepth) { linearDepth = _linearDepth; }")}},32680(e,t,r){r.d(t,{M:()=>o});var i=r(31821);function o(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
651
+ fragBlur = b / w_total;`),e}const h=Object.freeze(Object.defineProperty({__proto__:null,build:d},Symbol.toStringTag,{value:"Module"}));r.d(t,["S",0,h])},43609(e,t,r){r.d(t,{a:()=>o,f:()=>a,n:()=>n});var i=r(34275);function n(e,t){o(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r=2,n=r){const o=t.length/2;let a=0,s=0;if(!(0,i.iu)(t)||(0,i.dk)(t)){for(let i=0;i<o;++i)e[a]=t[s],e[a+1]=t[s+1],a+=r,s+=n;return}const l=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<o;++i)e[a]=Math.max(t[s]/l,-1),e[a+1]=Math.max(t[s+1]/l,-1),a+=r,s+=n;else for(let i=0;i<o;++i)e[a]=t[s]/l,e[a+1]=t[s+1]/l,a+=r,s+=n}function a(e,t,r,i){const n=e.typedBuffer,o=e.typedBufferStride,a=i?.count??e.count;let s=(i?.dstIndex??0)*o;for(let e=0;e<a;++e)n[s]=t,n[s+1]=r,s+=o}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:o,normalizeIntegerBufferView:n},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>d,b:()=>s,c:()=>n,d:()=>a,e:()=>h,f:()=>u,l:()=>c,n:()=>m,t:()=>o}),r(44208);var i=r(72727);function n(e,t,r){o(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r,n=3,o=n){const a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s),c=r[0],u=r[1],d=r[2],h=r[4],m=r[5],p=r[6],f=r[8],v=r[9],g=r[10],x=r[12],_=r[13],b=r[14];let y=0,w=0;for(let r=0;r<l;r++){const r=t[y],i=t[y+1],a=t[y+2];e[w]=c*r+h*i+f*a+x,e[w+1]=u*r+m*i+v*a+_,e[w+2]=d*r+p*i+g*a+b,y+=o,w+=n}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,n=3,o=n){const a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s),c=r[0],u=r[1],d=r[2],h=r[3],m=r[4],p=r[5],f=r[6],v=r[7],g=r[8];let x=0,_=0;for(let r=0;r<l;r++){const r=t[x],i=t[x+1],a=t[x+2];e[_]=c*r+h*i+f*a,e[_+1]=u*r+m*i+v*a,e[_+2]=d*r+p*i+g*a,x+=o,_+=n}}function l(e,t,r,i=3,n=i){const o=Math.min(e.length/i,t.length/n);let a=0,s=0;for(let l=0;l<o;l++)e[s]=r*t[a],e[s+1]=r*t[a+1],e[s+2]=r*t[a+2],a+=n,s+=i;return e}function c(e,t,r,i){u(e.typedBuffer,t.typedBuffer,r,i,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r,i,n=3,o=n){const a=Math.min(e.length/n,t.length/o);let s=0,l=0;const c=1/2.2;for(let u=0;u<a;u++)e[l]=i*(r*t[s])**c,e[l+1]=i*(r*t[s+1])**c,e[l+2]=i*(r*t[s+2])**c,s+=o,l+=n}function d(e,t,r,n=3,o=n){const a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s);let c=0,u=0;for(let i=0;i<l;i++)e[u]=t[c]+r[0],e[u+1]=t[c+1]+r[1],e[u+2]=t[c+2]+r[2],c+=o,u+=n;return e}function h(e,t){m(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function m(e,t,r=3,i=r){const n=Math.min(e.length/r,t.length/i);let o=0,a=0;for(let s=0;s<n;s++){const n=t[o],s=t[o+1],l=t[o+2],c=n*n+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*n,e[a+1]=t*s,e[a+2]=t*l}o+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:u,linearToSRGBView:c,normalize:m,normalizeView:h,scale:l,scaleView:function(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)n[c]=a[l]>>r,n[c+1]=a[l+1]>>r,n[c+2]=a[l+2]>>r,l+=s,c+=o},transformMat3:s,transformMat3View:a,transformMat4:o,transformMat4View:n,translate:d},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>n});var i=r(34727);class n{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return o(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+a(this.range,e-t,r)}minimalMonotonic(e,t,r){return o(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function o(e,t,r,i,n=0,o=!1){return(i-=n)<t?i+=a(e,t-i):i>r&&(i-=a(e,i-r)),o&&i===r&&(i=t),i+n}function a(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const s=new n(0,2*Math.PI),l=(new n(-Math.PI,Math.PI),new n(0,360));r.d(t,["ie",0,l,"uC",0,s])},46140(e,t,r){r.d(t,{A:()=>n});var i=r(49186);class n{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){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 n(this.major,this.minor,this._context)}static parse(e,t=""){const[r,o]=e.split("."),a=/^\s*\d+\s*$/;if(!r?.match||!a.test(r))throw new i.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!o?.match||!a.test(o))throw new i.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(o,10);return new n(s,l,t)}}},61473(e,t,r){function i(e){return e=e||globalThis.location.hostname,c.some(t=>null!=e?.match(t))}function n(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(o)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}r.d(t,{EM:()=>n,b5:()=>i});const o=/^devext\.arcgis\.com$/,a=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,o,a,/^jsapps\.esri\.com$/,s,l]},18370(e,t,r){r.d(t,{z:()=>n});class i{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(async e=>(this.module=e,e))),this._promise}}function n(e){return new i(e)}},88340(e,t,r){function i(){return new Float32Array(2)}function n(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function o(){return i()}function a(){return n(1,1)}function s(){return n(1,0)}function l(){return n(0,1)}r.d(t,{fA:()=>n,vt:()=>i});const c=o(),u=a(),d=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:n,ones:a,unitX:s,unitY:l,zeros:o},Symbol.toStringTag,{value:"Module"})),r.d(t,["Un",0,u,"uY",0,c])},69397(e,t,r){r.d(t,{Qf:()=>s,Qh:()=>o,lM:()=>n});var i=r(34275);function n(e){if(!e)return 0;let t=c;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r],!1));return t}function o(e){if(!e)return 0;if("number"==typeof e[0])return s(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return l(e,8);let r=u;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=c;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e,t=!0){switch(typeof e){case"object":return t?o(e):c;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(...e){return e.reduce((e,t)=>e+(t?(0,i.iu)(t)?t.byteLength+d:Array.isArray(t)?l(t,16):0:0),0)}function l(e,t){return u+e.length*t}const c=32,u=16,d=145},65806(e,t,r){r.d(t,{g:()=>a});var i=r(51850),n=r(99917),o=r(9762);function a(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r))return s[0]=e.x,s[1]=e.y,s[2]=e.z??0,(0,o.projectBuffer)(s,e.spatialReference,0,t,r,0);const a=(0,n.tryProject)(e,r,i);return!!a&&(t[0]=a.x,t[1]=a.y,t[2]=a.z??0,!0)}const s=(0,i.vt)()},27993(e,t,r){r.d(t,{F:()=>s});var i=r(99917),n=r(16930),o=r(9762),a=r(65806);function s(e,t,r,n){return!(null==t||null==n||e.length<2)&&((0,i.canProjectWithoutEngine)(t,n)?(0,o.projectBuffer)(e,t,0,r,n,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,a.g)(l,r,n)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:n.A.WGS84,type:"point"}},97146(e,t,r){r.d(t,{Dg:()=>o,lC:()=>s,my:()=>a,tM:()=>d,uW:()=>n});var i=r(34275);function n(e){return o(e,!0)}function o(e,t){if(Array.isArray(e)){if(e.length<1024)return e}else if(e.length<1024)return Array.from(e);let r=!0,n=!0;return e.some((e,t)=>(r=r&&0===e,n=n&&e===t,!r&&!n)),r?function(e){if(1===e)return c;if(e<1024)return new Array(e).fill(0);if(e>m.length){const t=Math.max(2*m.length,e);m=new Uint8Array(t)}return new Uint8Array(m.buffer,0,e)}(e.length):n?d(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(const r of e){if(r>=65536)return(0,i.iu)(e)?e:new Uint32Array(e);r>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function a(e,t=e){return e<=1024?new Array(e):t<=65536?new Uint16Array(e):new Uint32Array(e)}function s(e,t,r){if(0===t.length)return e.slice();if(0===e.length)return t.slice();const i=a(e.length+t.length,r);for(let t=0;t<e.length;++t)i[t]=e[t];for(let r=0;r<t.length;++r)i[e.length+r]=t[r];return i}let l=h(131072);const c=[0],u=(()=>{const e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function d(e){return 1===e?c:e<1024?Array.from(new Uint16Array(u.buffer,0,e)):e<u.length?new Uint16Array(u.buffer,0,e):(e>l.length&&(l=h(Math.max(2*l.length,e))),new Uint32Array(l.buffer,0,e))}function h(e){const t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let m=new Uint8Array(65536)},72727(e,t,r){function i(e,t,r){if(t<=0)return 0;const i=e-r;return i<0?0:Math.floor(i/t)+1}r.d(t,{k:()=>i}),r(53966)},65720(e,t,r){r.d(t,{C:()=>g,vt:()=>f,Qy:()=>v,ui:()=>x,ST:()=>M,bU:()=>C,pw:()=>S,m7:()=>_,ZU:()=>b,GH:()=>w,Pi:()=>y,LJ:()=>T,c8:()=>O});var i=r(4341),n=r(58083),o=r(35522),a=r(51850),s=r(78955),l=r(91829),c=r(70328),u=r(71351);function d(e){return e?{ray:(0,u.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,u.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>d());var h=r(27921);function m(e,t,r,i){let{t0:n,t1:o}=i;const a=(0,h.mN)(e,t),s=(0,h.mN)(e,r);if(a>=0&&s>=0)return!1;if(a<0&&s>=0){const e=-a/(s-a);if(e<n)return!1;e<o&&(o=e)}else if(a>=0&&s<0){const e=a/(a-s);if(e>o)return!1;e>n&&(n=e)}return i.t0=n,i.t1=o,!0}var p=r(32114);function f(e){return e?[(0,h.vt)(e[0]),(0,h.vt)(e[1]),(0,h.vt)(e[2]),(0,h.vt)(e[3]),(0,h.vt)(e[4]),(0,h.vt)(e[5])]:[(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)()]}function v(){return[(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)()]}function g(e,t){for(let r=0;r<P;r++)(0,h.C)(e[r],t[r]);return e}function x(e,t,r,i=F){const a=(0,n.lw)(p.Rc.get(),t,e);(0,n.B8)(a,a);for(let e=0;e<D;++e){const t=(0,s.Z0)(p.Km.get(),A[e],a);(0,o.hZ)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}!function(e,t){(0,h.Cr)(t[4],t[0],t[3],e[0]),(0,h.Cr)(t[1],t[5],t[6],e[1]),(0,h.Cr)(t[4],t[5],t[1],e[2]),(0,h.Cr)(t[3],t[2],t[6],e[3]),(0,h.Cr)(t[0],t[1],t[2],e[4]),(0,h.Cr)(t[5],t[4],t[7],e[5])}(r,i)}function _(e,t){return b(e,t.center,t.radius)}function b(e,t,r){for(let i=0;i<P;i++){const n=e[i];if(n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]>=r)return!1}return!0}function y(e,t,r){for(const i of E)if((0,h.wE)(e[i],t,r))return!0;return!1}function w(e,t,r){const i=(0,c.gX)(t,B),n=(0,c.VL)(t)/2,a=(0,c.yr)(t)/2,s=(0,c.uJ)(t)/2;return r?function(e,t,r,i,n,a){const s=(0,o.Z0)(N,t,a);for(let t=0;t<P;t++){const o=e[t];if(o[0]*s[0]+o[1]*s[1]+o[2]*s[2]+o[3]-(Math.abs(o[0]*a[0]+o[1]*a[1]+o[2]*a[2])*r+Math.abs(o[0]*a[4]+o[1]*a[5]+o[2]*a[6])*i+Math.abs(o[0]*a[8]+o[1]*a[9]+o[2]*a[10])*n)>0)return!1}return!0}(e,i,n,a,s,r):function(e,t,r,i,n){for(let o=0;o<P;o++){const a=e[o];if(a[0]*t[0]+a[1]*t[1]+a[2]*t[2]+a[3]-(Math.abs(a[0])*r+Math.abs(a[1])*i+Math.abs(a[2])*n)>0)return!1}return!0}(e,i,n,a,s)}function S(e,t){return I(e,function(e,t=d()){return(0,u.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,R.get()))}function M(e,t,r){return I(e,function(e,t,r=d()){const i=(0,o.Bw)(e.vector);return(0,u.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,R.get()))}function T(e,t,r){return function(e,t,r,i){const n={t0:0,t1:1};for(const o of t)if(!m(e[o],r,i,n))return!1;return n.t0<n.t1}(e,E,t,r)}function C(e,t){for(let r=0;r<P;r++)if((0,h.mN)(e[r],t)>0)return!1;return!0}function I(e,t){for(let r=0;r<P;r++)if(!(0,h.$Q)(e[r],t))return!1;return!0}const E=[0,1,2,3,5],O={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},P=6,D=8,A=[(0,l.fA)(-1,-1,-1,1),(0,l.fA)(1,-1,-1,1),(0,l.fA)(1,1,-1,1),(0,l.fA)(-1,1,-1,1),(0,l.fA)(-1,-1,1,1),(0,l.fA)(1,-1,1,1),(0,l.fA)(1,1,1,1),(0,l.fA)(-1,1,1,1)],R=new i.I(d),F=v(),B=(0,a.vt)(),N=(0,a.vt)()},52039(e,t,r){r.d(t,{O7:()=>h,el:()=>c});var i=r(69052),n=(r(49186),r(18370)),o=r(17676),a=(r(5443),r(39829)),s=(r(82799),r(16930)),l=(r(80754),r(21325));async function c(e,t,r){Array.isArray(e)||(e=[e]),null!=t&&"object"==typeof t&&"authMode"in t&&(r=t);let i=null;for(const t of e)i??=t?.spatialReference;if(!i)return e;const n=(0,l.Vp)(i);if(!n)return e;if(1===e.length&&"extent"===e[0]?.type){const t=e[0].clone().normalizeAsSingleGeometry(n);return["xmin"in t?t:new a.A(t)]}const[s,c]=n.valid;let h=!1;for(const t of e){if(!t)continue;if("point"===t.type){h||=t.x>=c,h||=t.x<=s;continue}const{extent:e}=t;if(null==e){h=!0;break}h||=e.xmin>=c,h||=e.xmin<=s,h||=e.xmax>=c,h||=e.xmax<=s}if(!h)return e;const[{foldInto360Range:m},p]=await(0,o.qr)(Promise.all([u.getImportPromise(),d.getImportPromise()]),r),f=p.fromSpatialReference(i);return e.map(e=>{if(null==e||"mesh"===e.type)return e;const t=p.fromGeometry(e),r=p.toGeometry(m(t,f),i);return"extent"===e.type&&1===r?.rings.length?r.extent:r})}const u=(0,n.z)(()=>r.e(4144).then(()=>r(4144)).then(e=>e.load().then(()=>e))),d=(0,n.z)(()=>Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(1550)]).then(()=>r(78125)));function h(e,t,r){const i=(0,l.Vp)(r);if(null==i)return e;const[n,o]=i.valid,a=2*o;let s=0,c=0;t>o?s=Math.ceil(Math.abs(t-o)/a):t<n&&(s=-Math.ceil(Math.abs(t-n)/a)),e>o?c=Math.ceil(Math.abs(e-o)/a):e<n&&(c=-Math.ceil(Math.abs(e-n)/a));let u=e+(s-c)*a;const d=u-t;return d>o?u-=a:d<n&&(u+=a),u}function m(e){const t=(0,l.Vp)(e);if(null==t)return null;const[r,n]=t.valid;return new i.hr(r,n)}const p=m(s.A.WGS84);m(s.A.WebMercator),r.d(t,["Y_",0,p])},48295(e,t,r){r.d(t,{BU:()=>u,Ui:()=>s,cq:()=>c,k3:()=>d,rb:()=>h});var i=r(4341),n=r(35522),o=r(51850),a=r(11964);function s(e,t,r){const i=1e-5,{direction:o,origin:a}=t,{p0:s,p1:l,p2:c}=e,u=l[0]-s[0],d=l[1]-s[1],h=l[2]-s[2],m=c[0]-s[0],p=c[1]-s[1],f=c[2]-s[2],v=o[1]*f-p*o[2],g=o[2]*m-f*o[0],x=o[0]*p-m*o[1],_=u*v+d*g+h*x;if(_>-i&&_<i)return!1;const b=1/_,y=a[0]-s[0],w=a[1]-s[1],S=a[2]-s[2],M=b*(y*v+w*g+S*x);if(M<0||M>1)return!1;const T=w*h-d*S,C=S*u-h*y,I=y*d-u*w,E=b*(o[0]*T+o[1]*C+o[2]*I);return!(E<0||M+E>1||(r&&((0,n.hs)(r,o,b*(m*T+p*C+f*I)),(0,n.WQ)(r,a,r)),0))}function l(e,t,r){const[i,n]=e,[o,a]=t,[s,l]=r;return.5*((o-i)*(l-n)-(a-n)*(s-i))}function c(e,t,r,i,n=0){const o=l(i,e,t),a=l(i,t,r),s=l(i,r,e);return!((o<-n||a<-n||s<-n)&&(o>n||a>n||s>n))}function u(e,t,r){return(0,n.Re)(m,t,e),(0,n.Re)(p,r,e),.5*(0,n.Bw)((0,n.$A)(m,m,p))}function d(e,t,r,i,o){(0,n.jb)(m,i,r),(0,n.jb)(f,o,r),(0,n.jb)(p,t,r);const a=(0,n.Om)(m,p),s=(0,n.Om)(f,p);if(a<=0&&s<=0)return void(0,n.C)(e,r);(0,n.jb)(p,t,i);const l=(0,n.Om)(m,p),c=(0,n.Om)(f,p);if(l>=0&&c<=l)return void(0,n.C)(e,i);const u=a*c-l*s;if(u<=0&&a>=0&&l<=0)return void(0,n.Ln)(e,r,m,a/(a-l));(0,n.jb)(p,t,o);const d=(0,n.Om)(m,p),h=(0,n.Om)(f,p);if(h>=0&&d<=h)return void(0,n.C)(e,o);const v=d*s-a*h;if(v<=0&&s>=0&&h<=0)return void(0,n.Ln)(e,r,f,s/(s-h));const g=l*h-d*c;if(g<=0&&c-l>=0&&d-h>=0)return(0,n.jb)(p,o,i),void(0,n.Ln)(e,i,p,(c-l)/(c-l+(d-h)));const x=1/(g+v+u);(0,n.C)(e,r),(0,n.Ln)(e,e,m,v*x),(0,n.Ln)(e,e,f,u*x)}function h(e,t,r,i){(0,n.jb)(m,r,t),(0,n.jb)(p,i,t),(0,n.$A)(e,m,p);const o=(0,n.Bw)(e);return 0!==o&&((0,n.hs)(e,e,1/o),!0)}r(32114),new i.I(a.vt),new i.I(()=>{return e?{p0:(0,o.o8)(e.p0),p1:(0,o.o8)(e.p1),p2:(0,o.o8)(e.p2)}:{p0:(0,o.vt)(),p1:(0,o.vt)(),p2:(0,o.vt)()};var e});const m=(0,o.vt)(),p=(0,o.vt)(),f=(0,o.vt)()},21015(e,t,r){r.d(t,{R:()=>l});var i=r(56507),n=r(60999),o=r(49186),a=r(17676),s=r(84952);class l{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,s.DB)(e)?((0,a.Te)(t),(0,s.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);const s=await(0,n.Ke)((0,i.A)(t,{responseType:e,...r}));if(s.ok)return s.value.data;throw(0,a.QP)(s.error),new o.A("gltf-loader-request-error",`Request for resource failed: ${s.error}`)}}},84498(e,t,r){r.d(t,{x:()=>a});var i=r(34275),n=r(97146),o=r(63907);function a(e,t){switch(t){case o.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,n.tM)(e):(0,i.mg)(e)?new Uint16Array(e):e}(e);case o.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,i=(0,n.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let n=0;n<r;n+=1)n%2==0?(i[t++]=e[n],i[t++]=e[n+1],i[t++]=e[n+2]):(i[t++]=e[n+1],i[t++]=e[n],i[t++]=e[n+2])}return i}(e);case o.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}const n=e[0];let o=e[1],a=0;for(let t=0;t<r;++t){const r=e[t+2];i[a++]=n,i[a++]=o,i[a++]=r,o=r}return i}(e)}}},51530(e,t,r){r.d(t,{KB:()=>a,Xi:()=>n,pn:()=>s,x3:()=>o});var i=r(44208);class n{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function o(e){return"encoded-mesh-texture"===e?.type}async function a(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function s(e,t){if("image/ktx2"===t)return new n(e);const r=new Blob([e],{type:t});let o=URL.createObjectURL(r);switch(t){case"image/jpeg":o+="#.jpg";break;case"image/png":o+="#.png"}const a=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{n(),e(a)},i=e=>{n(),t(e)},n=()=>{URL.revokeObjectURL(o),a.removeEventListener("load",r),a.removeEventListener("error",i)};a.addEventListener("load",r),a.addEventListener("error",i),a.src=o});try{a.src=o,await a.decode()}catch{}return URL.revokeObjectURL(o),a}},24426(e,t,r){r.d(t,{fetch:()=>wr});var i=r(40876),n=r(61473),o=r(34727),a=r(77690),s=r(29242),l=r(58083),c=r(9093),u=r(48163),d=r(35522),h=r(51850),m=r(70328);function p(e,t=!1){return e<=1024?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var f=r(13030),v=r(73354),g=r(50867),x=r(43609),_=r(21015),b=r(84498),y=r(51530),w=r(88340);function S(e){if(null==e)return null;const t=null!=e.offset?e.offset:w.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:w.Un,n=(0,s.fA)(1,0,0,0,1,0,t[0],t[1],1),o=(0,s.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,s.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,s.vt)();return(0,a.lw)(c,o,l),(0,a.lw)(c,n,c),c}class M{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class T{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new M,this.numberOfVertices=0}}var C=r(56507),I=r(60999),E=r(49186),O=r(53966),P=r(69397);class D{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(const t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){const r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(const e of this._outer)yield e}*values(){for(const e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(const[e,t]of this._outer)for(const[r,i]of t)yield[e,r,i]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,i)=>e(t,r,i)))}clone(){const e=new D;return this.forAll((t,r,i)=>e.set(r,i,t)),e}}var A=r(17676),R=r(46140),F=r(97146),B=r(31217),N=r(46610),z=r(34275);function j(e){if(e.length<1024)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,z.LW)(e)?Float16Array.from(e):(0,z.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return(0,z.vZ)(e)?Float32Array.from(e):Uint32Array.from(e);default:return Float64Array.from(e)}}var H=r(15142),L=r(94008),W=r(620);class V{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this._readPosition=r,this._children=void 0,(0,W.vA)(e.length>=1);const i=e.length;$.clear();const n=(0,m.Ie)();for(let o=0;o<i;++o){const i=t*e[o];for(let e=0;e<t;++e){const t=i+e;$.push(t),(0,m.iT)(n,r(U,t))}}this.box=n;const o=new L.iy,a=(0,m.gX)(n,o.center);let s=.5*Math.max((0,m.VL)(n),(0,m.yr)(n),(0,m.uJ)(n)),l=s*s;for(let e=0;e<$.length;++e){const t=r(U,$.at(e)),i=(0,d.Re)(t,t,a),n=(0,d.uE)(i);if(n<=l)continue;const o=Math.sqrt(n),c=.5*(o-s);s+=c,l=s*s,(0,d.Ln)(a,a,i,c/o)}o.radius=s,this.sphere=o,$.clear()}get children(){if(this._children)return this._children;const e=this.box;if((0,m.TF)(e)<=1)return;const{_readPosition:t,_numIndexPerPrimitive:r,primitiveIndices:i}=this,n=(0,m.gX)(e,U),o=i.length,a=new Uint8Array(o),s=[0,0,0,0,0,0,0,0];for(let e=0;e<o;++e){const o=r*i[e],l=t(G,o);for(let e=1;e<r;++e)(0,d.jk)(l,l,t(k,o+e));const c=(l[0]<n[0]?1:0)|(l[1]<n[1]?2:0)|(l[2]<n[2]?4:0);a[e]=c,++s[c]}let l=0;for(let e=0;e<8;++e)s[e]>0&&++l;if(l<2)return;const c=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0];for(let e=0;e<8;++e)s[e]>0&&(c[e]=new Uint32Array(s[e]));s.fill(0);for(let e=0;e<o;++e){const t=a[e];c[t][s[t]++]=i[e]}const u=new Array;for(let e=0;e<8;++e){const i=c[e];void 0!==i&&u.push(new V(i,r,t))}return this._children=u,this._children}static prune(){$.prune()}}const U=(0,h.vt)(),G=(0,h.vt)(),k=(0,h.vt)(),$=new H.A({deallocator:null});var Z=r(24326);class q{constructor(e){this.id=(0,Z.c)(),this.type=0,this._attributes=new Map;for(const[t,r]of e)this._attributes.set(t,{...r,indices:(0,F.Dg)(r.indices)})}get attributes(){return this._attributes}}class Y{constructor(){this.uid=(0,Z.c)()}}class K extends Y{constructor(e){super(),this.highlightName=e,this.channel=0}}var X=r(94656);class J extends q{constructor(e,t,r=null,i=-1,n,o){super(t),this.material=e,this.mapPositions=r,this.edgeIndicesLength=i,this.baseGeometry=n,this.drawIndices=o,this._readPrimitivePosition=null,this._vertexPositionIndicesCache=void 0,this._transformation=void 0,this.localOrigin=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.occludees=void 0,this.visible=!0,this._boundingInfo=null,(0,W.vA)((e?.useIndexing??!1)===(null!=o),"Material index requirement and Geometry must match"),this.edgeIndicesLength<0&&(this.edgeIndicesLength=this.indexCount)}get readPrimitivePosition(){return this._readPrimitivePosition??=function(e,t){const{data:r,indices:i,size:n,stride:o}=e;return(0,W.vA)(2===n||3===n||4===n,"Position attribute must have 2, 3 or 4 components"),2===n?null!=t?(e,n)=>{const a=i[t[n]]*o;return e[0]=r[a],e[1]=r[a+1],e[2]=-2,e}:(e,t)=>{const n=i[t]*o;return e[0]=r[n],e[1]=r[n+1],e[2]=-2,e}:null!=t?(e,n)=>{const a=i[t[n]]*o;return e[0]=r[a],e[1]=r[a+1],e[2]=r[a+2],e}:function(e,t,r){return(i,n)=>{const o=t[n]*r;return i[0]=e[o],i[1]=e[o+1],i[2]=e[o+2],i}}(r,i,o)}(this.positionAttribute,this.drawIndices),this._readPrimitivePosition}_invalidateReadPrimitivePosition(){this._readPrimitivePosition=null}instantiate(e={}){const t=new J(e.material||this.material,[],this.mapPositions,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:j(t.data)},this._attributes.set(e,t),"position"===e&&this._invalidateReadPrimitivePosition()),t}setAttributeData(e,t){const r=this._attributes.get(e);r?(this._attributes.set(e,{...r,exclusive:!0,data:t}),"position"===e&&this._invalidateReadPrimitivePosition()):(0,X.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get primitivePositionIndices(){return void 0!==this._vertexPositionIndicesCache||(this._vertexPositionIndicesCache=this._computePrimitivePositionIndices()),this._vertexPositionIndicesCache}_computePrimitivePositionIndices(){const{drawIndices:e}=this,t=this.positionAttribute;if(null!=e&&null!=t){const r=new Array;for(const i of e)r.push(t.indices[i]);return r}return t?.indices??null}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this.drawIndices??this.positionAttribute?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!this.material.computeAttachmentOrigin(e,this.readPrimitivePosition,this.indexCount)&&(null!=this._transformation&&(0,d.Z0)(e,e,this._transformation),!0)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const e=this.positionAttribute,t=this.indexCount;if(!e||0===t)return null;const r=this.material.primitiveVertexCount;(0,W.vA)(t%r===0,"Indexing error: "+t+" not divisible by "+r);const i=(0,F.tM)(t/r);return new V(i,r,this.readPrimitivePosition)}get transformation(){return this._transformation??c.zK}set transformation(e){this._transformation=e&&e!==c.zK?(0,c.o8)(e):null}get highlights(){return this._highlights||Q}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}forEachHighlightOption(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new K(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const Q=new Set;var ee=r(46859),te=r(49255),re=r(97768);class ie{constructor(e){this._material=e.material,this._techniques=e.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(t))}ensureResources(e){return 2}}var ne=r(65786);class oe extends ie{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,re.Gz)(this._texture),this._textureNormal=(0,re.Gz)(this._textureNormal),this._textureEmissive=(0,re.Gz)(this._textureEmissive),this._textureOcclusion=(0,re.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,re.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new se(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,re.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,A.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,re.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class ae extends ne.Y{constructor(e=null){super(),this.textureEmissive=e}}class se extends ae{constructor(e,t,r,i,n,o,a){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.scale=o,this.normalTextureTransformMatrix=a}}var le=r(48295);const ce=(0,h.vt)(),ue=(0,h.vt)(),de=(0,h.vt)(),he=(0,h.vt)();var me=r(19245);class pe{constructor(e,t){this.id=(0,Z.c)(),this.supportsEdges=!1,this.primitiveVertexCount=3,this._renderPriority=0,this._parameters=new t,(0,me.MB)(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,me.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get emissions(){return 0}getConfiguration(e){return this.updateConfiguration(e),this._configuration}updateConfiguration(e){this._configuration.output=e.output,this._configuration.hasEmission=e.hasEmission&&(0,te._o)(e.output),this._configuration.hasHighlightMixTexture=10===e.output&&null!=e.highlightMixTexture,this._configuration.useFloatBlend=e.useFloatBlend.value,this._configuration.emissionDimmingPass=e.transparentWithoutDepthEmissionDimmingPass&&(0,te._o)(e.output)}computeAttachmentOrigin(e,t,r){return function(e,t,r){if(r<=0)return!1;(0,d.hZ)(e,0,0,0),(0,d.hZ)(he,0,0,0);let i=0,n=0;for(let o=0;o<r;++o){const r=3*o;t(ce,r),t(ue,r+1),t(de,r+2);const a=(0,le.BU)(ce,ue,de);a?((0,d.WQ)(ce,ce,ue),(0,d.WQ)(ce,ce,de),(0,d.hs)(ce,ce,1/3*a),(0,d.WQ)(e,e,ce),i+=a):((0,d.WQ)(he,he,ce),(0,d.WQ)(he,he,ue),(0,d.WQ)(he,he,de),n+=3)}return!(0===n&&0===i||(0!==i?((0,d.hs)(e,e,1/i),0):0===n||((0,d.hs)(e,he,1/n),0)))}(e,t,r/3)}}ne.Y;var fe=r(58682),ve=r(90629),ge=r(65720),xe=r(27921),_e=r(19419),be=r(11964);function ye(e,t){return e.isRectangle?(0,_e.Uc)(e.bounds,t):function(e,t){return Se(e[0],e[1],t)}(t,e.points)}function we(e,t,r,i){const n=Math.min(t[0],r[0],i[0]),o=Math.min(t[1],r[1],i[1]),a=Math.max(t[0],r[0],i[0]),s=Math.max(t[1],r[1],i[1]);if(!function(e,t){if(!(0,_e.HY)(e.bounds,t))return!1;if(e.isRectangle)return!0;for(const r of e.points)if((0,_e.Uc)(t,r))return!0;if(function(e,t){const r=e[0],i=e[1],n=e[2],o=e[3];return Se(r,i,t)||Se(n,i,t)||Se(n,o,t)||Se(r,o,t)}(t,e.points))return!0;for(let r=0;r<e.points.length;r++)if(Me(e.points[r],r===e.points.length-1?e.points[0]:e.points[r+1],t))return!0;return!1}(e,(0,_e.fA)(n,o,a,s,Pe)))return!1;if(ye(e,t)||ye(e,r)||ye(e,i))return!0;for(const n of e.points)if((0,le.cq)(t,r,i,n,De))return!0;for(let n=0;n<e.points.length;n++){const o=e.points[n],a=e.points[(n+1)%e.points.length];if(Ce(t,r,o,a)||Ce(r,i,o,a)||Ce(i,t,o,a))return!0}return!1}function Se(e,t,r){let i=!1;for(let n=0,o=r.length-1;n<r.length;o=n++){const a=r[n],s=r[o];a[1]>t!=s[1]>t&&e<(s[0]-a[0])*(t-a[1])/(s[1]-a[1])+a[0]&&(i=!i)}return i}function Me(e,t,r){const i=r[0],n=r[1],o=r[2],a=r[3],s=e[0],l=e[1],c=t[0],u=t[1];return!(s<i&&c<i||s>o&&c>o||l<n&&u<n||l>a&&u>a)&&(!(!(0,_e.Rj)(r,s,l)&&!(0,_e.Rj)(r,c,u))||Te(e,t,i,n,o,n)||Te(e,t,o,n,o,a)||Te(e,t,o,a,i,a)||Te(e,t,i,a,i,n))}function Te(e,t,r,i,n,o){const a=Ie(e[0],e[1],t[0],t[1],r,i),s=Ie(e[0],e[1],t[0],t[1],n,o),l=Ie(r,i,n,o,e[0],e[1]),c=Ie(r,i,n,o,t[0],t[1]);return a!==s&&l!==c||0===a&&Ee(e,t,r,i)||0===s&&Ee(e,t,n,o)||0===l&&Oe(r,i,n,o,e[0],e[1])||0===c&&Oe(r,i,n,o,t[0],t[1])}function Ce(e,t,r,i){return Te(e,t,r[0],r[1],i[0],i[1])}function Ie(e,t,r,i,n,o){const a=(i-t)*(n-r)-(r-e)*(o-i);return Math.abs(a)<=De?0:Math.sign(a)}function Ee(e,t,r,i){return Oe(e[0],e[1],t[0],t[1],r,i)}function Oe(e,t,r,i,n,o){return n>=Math.min(e,r)-De&&n<=Math.max(e,r)+De&&o>=Math.min(t,i)-De&&o<=Math.max(t,i)+De}const Pe=(0,_e.vt)(),De=((0,ve.r_)(),(0,ve.r_)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,be.vt)(),1e-9);class Ae{constructor(e){this.type=e,this.distance=Number.POSITIVE_INFINITY,this.renderDistance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=(0,h.vt)(),this.normal=(0,h.vt)()}reset(){this.distance=Number.POSITIVE_INFINITY,this.renderDistance=Number.POSITIVE_INFINITY,this.hasNormal=!1}update(e,t,r,i,n=e){this.distance=e,this.renderDistance=n,this.primitiveIndex=t,(0,d.C)(this.point,r),this.hasNormal=null!=i,null!=i&&(0,d.C)(this.normal,i)}updateIfCloserFromValues(e,t,r,i,n=e){n<this.renderDistance&&this.update(e,t,r,i,n)}updateIfCloser(e){const{distance:t,renderDistance:r,primitiveIndex:i,point:n,normal:o}=e;this.updateIfCloserFromValues(t,i,n,e.hasNormal?o:null,r)}get valid(){return Number.isFinite(this.distance)}}function Re(e,t,r,i,n){if(!e.visible)return null;const o=new Ae(4);let a;a=e.boundingInfo?Be(e.readPrimitivePosition,e.boundingInfo,t,r,i,n):Fe(t,r,i,0,e.faceCount,e.readPrimitivePosition,n,null,0);for(const e of a)o.updateIfCloser(e);return o.valid?o:null}function*Fe(e,t,r,i,n,o,a,s=null,l=0){if(null==e.camera)return;const{camera:c,screenPolygonPrimitiveProcessor:u}=e;for(let e=i;e<n;++e){const i=(s?.[e]??e)+l,n=null==s?i:e,h=3*i;Ne(Le[0],o,h+0,a,n,t),Ne(Le[1],o,h+1,a,n,t),Ne(Le[2],o,h+2,a,n,t);const m=Ge;let p;$e.reset();const f=We;for(const e of u.processTriangle(Le))if(f.length=0,(0,xe.H)(c.frustum[4],e,()=>f.pushNew(),!1),!(f.length<3)){for(let e=0;e<f.length;e++)c.projectToScreen(f.at(e),Ve[e]);ze(r,Ve,f.length)&&(je(c.eye,f,Ue),null==p&&(p=(0,le.rb)(Ge,Le[0],Le[1],Le[2])),$e.updateIfCloserFromValues((0,d.Io)(c.eye,Ue),i,Ue,p?m:null))}$e.valid&&(yield $e)}}function*Be(e,t,r,i,n,o){let a;if(null!=o?((0,m.C)(He,t.box),o.applyToAabb(He),a=(0,ge.GH)(n.broadPhaseFrustum,He,i)):a=(0,ge.GH)(n.broadPhaseFrustum,t.box,i),!a)return;const{primitiveIndices:s}=t,l=s.length;if(l>1e3){const a=t.children;if(void 0!==a){for(const t of a)yield*Be(e,t,r,i,n,o);return}}yield*Fe(r,i,n,0,l,e,o,s,0)}function Ne(e,t,r,i,n,o){const[a,s,l]=t(e,r);null!=i?i.applyToVertex(e,a,s,l,n):(0,d.hZ)(e,a,s,l),o&&(0,d.Z0)(e,e,o)}function ze(e,t,r){for(let i=1;i<r-1;i++)if(we(e,t[0],t[i],t[i+1]))return!0;return!1}function je(e,t,r){let i=Number.POSITIVE_INFINITY;const n=t.at(0);for(let o=1;o<t.length-1;o++){(0,le.k3)(ke,e,n,t.at(o),t.at(o+1));const a=(0,d.hG)(e,ke);a<i&&(i=a,(0,d.C)(r,ke))}}const He=(0,m.vt)(),Le=[(0,h.vt)(),(0,h.vt)(),(0,h.vt)()],We=new H.A({allocator:e=>e??(0,h.vt)()}),Ve=Array.from({length:12},()=>(0,ve.gs)()),Ue=(0,h.vt)(),Ge=(0,h.vt)(),ke=(0,h.vt)(),$e=new Ae(4);var Ze=r(16396);function qe(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function Ye(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=3*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}}function Ke(e,t,r,i,n=1){const{data:o,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t===o.length&&4===t){s[i]=o[0],s[i+1]=o[1],s[i+2]=o[2],s[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;const u=c*n;for(let r=1;r<u;++r)e[i]=a,i+=t;return}if(1!==n)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}}}function Xe(e,t,r,i,n,o){switch(e){case"position":{(0,W.vA)(3===t.size);const i=n.getField(e,f.xs);(0,W.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void Ye(e,r,i,n);const{data:o,indices:a}=e,s=r.typedBuffer,c=r.typedBufferStride,u=a.length,d=t[0],h=t[1],m=t[2],p=t[4],f=t[5],v=t[6],g=t[8],x=t[9],_=t[10],b=t[12],y=t[13],w=t[14];i*=c;let S=0,M=0,T=0;const C=(0,l.tZ)(t)?e=>{S=o[e]+b,M=o[e+1]+y,T=o[e+2]+w}:e=>{const t=o[e],r=o[e+1],i=o[e+2];S=d*t+p*r+g*i+b,M=h*t+f*r+x*i+y,T=m*t+v*r+_*i+w};if(1===n)for(let e=0;e<u;++e)C(3*a[e]),s[i]=S,s[i+1]=M,s[i+2]=T,i+=c;else for(let e=0;e<u;++e){C(3*a[e]);for(let e=0;e<n;++e)s[i]=S,s[i+1]=M,s[i+2]=T,i+=c}}(t,r,i,o);break}case"normal":{(0,W.vA)(3===t.size);const r=n.getField(e,f.xs);(0,W.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void Ye(e,r,i,n);const{data:o,indices:a}=e,s=t,c=r.typedBuffer,u=r.typedBufferStride,d=a.length,h=s[0],m=s[1],p=s[2],f=s[4],v=s[5],g=s[6],x=s[8],_=s[9],b=s[10],y=!(0,l.ut)(s),w=1e-6,S=1-w;i*=u;let M=0,T=0,C=0;const I=(0,l.tZ)(s)?e=>{M=o[e],T=o[e+1],C=o[e+2]}:e=>{const t=o[e],r=o[e+1],i=o[e+2];M=h*t+f*r+x*i,T=m*t+v*r+_*i,C=p*t+g*r+b*i};if(1===n)if(y)for(let e=0;e<d;++e){I(3*a[e]);const t=M*M+T*T+C*C;if(t<S&&t>w){const e=1/Math.sqrt(t);c[i]=M*e,c[i+1]=T*e,c[i+2]=C*e}else c[i]=M,c[i+1]=T,c[i+2]=C;i+=u}else for(let e=0;e<d;++e)I(3*a[e]),c[i]=M,c[i+1]=T,c[i+2]=C,i+=u;else for(let e=0;e<d;++e){if(I(3*a[e]),y){const e=M*M+T*T+C*C;if(e<S&&e>w){const t=1/Math.sqrt(e);M*=t,T*=t,C*=t}}for(let e=0;e<n;++e)c[i]=M,c[i+1]=T,c[i+2]=C,i+=u}}(t,i,r,o);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,W.vA)(2===t.size);const r=n.getField(e,f.mJ);(0,W.vA)(!!r,`No buffer view for ${e}`),qe(t,r,o);break}case"uv0":{(0,W.vA)(2===t.size);const r=n.getField(e,f.ZD)??n.getField(e,f.gH);(0,W.vA)(!!r,`No buffer view for ${e}`),qe(t,r,o);break}case"uvi":{(0,W.vA)(2===t.size);const r=n.getField(e,f.mJ);(0,W.vA)(!!r,`No buffer view for ${e}`),qe(t,r,o);break}case"color":case"symbolColor":{const r=n.getField(e,f.XP);(0,W.vA)(!!r,`No buffer view for ${e}`),(0,W.vA)(3===t.size||4===t.size),Ke(t,t.size,r,o);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=n.getField(e,f.Y$)??n.getField(e,f.Y$);(0,W.vA)(!!r,`No buffer view for ${e}`),(0,W.vA)(1===t.size),function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length,l=i[0];r*=a;for(let e=0;e<s;++e)o[r]=l,r+=a}(t,r,o);break}case"tangent":{(0,W.vA)(4===t.size);const i=n.getField(e,f.Eq);(0,W.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void function(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}}(e,r,i,n);const{data:o,indices:a}=e,s=t,c=r.typedBuffer,u=r.typedBufferStride,d=a.length,h=s[0],m=s[1],p=s[2],f=s[4],v=s[5],g=s[6],x=s[8],_=s[9],b=s[10],y=!(0,l.ut)(s),w=1e-6,S=1-w;if(i*=u,1===n)for(let e=0;e<d;++e){const t=4*a[e],r=o[t],n=o[t+1],s=o[t+2],l=o[t+3];let d=h*r+f*n+x*s,M=m*r+v*n+_*s,T=p*r+g*n+b*s;if(y){const e=d*d+M*M+T*T;if(e<S&&e>w){const t=1/Math.sqrt(e);d*=t,M*=t,T*=t}}c[i]=d,c[i+1]=M,c[i+2]=T,c[i+3]=l,i+=u}else for(let e=0;e<d;++e){const t=4*a[e],r=o[t],s=o[t+1],l=o[t+2],d=o[t+3];let M=h*r+f*s+x*l,T=m*r+v*s+_*l,C=p*r+g*s+b*l;if(y){const e=M*M+T*T+C*C;if(e<S&&e>w){const t=1/Math.sqrt(e);M*=t,T*=t,C*=t}}for(let e=0;e<n;++e)c[i]=M,c[i+1]=T,c[i+2]=C,c[i+3]=d,i+=u}}(t,r,i,o);break}case"olidColor":(0,W.vA)(4===t.size),Ke(t,4,n.getField(e,f.XP),o)}}(0,h.vt)();class Je{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i){null!=i&&function(e,t,r,i,n){const{buffer:o,offset:a}=n;for(const n of t.fields.keys()){const t=e.get(n),s=t?.indices;t&&s&&Xe(n,t,r,i,o,a)}}(r,this.layout,e,t,i)}}const Qe=ot(-1),et=ot(1),tt=Qe,rt=new Array;rt[0]=null,rt[1]=et,rt[2]=Qe,rt[3]=ot(-2),rt[4]=ot(-3);const it=rt.map(e=>function(e,t){return t?{factor:e.factor+t.factor,units:e.units+t.units}:e}(tt,e));function nt({output:e,enableOITOffset:t,polygonOffset:r}){return(0,te._$)(e)&&t?it[r]:rt[r]}function ot(e){return{factor:1*e,units:2*e}}rt[1]=et;var at=r(32198),st=r(51976),lt=r(34711);class ct extends lt.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,at.Cg)([(0,st.W)()],ct.prototype,"hasHighlightMixTexture",void 0),(0,at.Cg)([(0,st.W)()],ct.prototype,"emissionDimmingPass",void 0);class ut extends ct{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}function dt(e){return mt.output=e.transparent?1:0,mt.polygonOffset=e.polygonOffset,mt.enableOITOffset=e.enableOITOffset,nt(mt)}function ht({units:e,factor:t},r,i,n){const o=ft*e;return i+((n?1-Math.abs((0,d.Om)(r,n)):0)*t*pt+o)}(0,at.Cg)([(0,st.W)({count:5})],ut.prototype,"polygonOffset",void 0),(0,at.Cg)([(0,st.W)()],ut.prototype,"transparent",void 0),(0,at.Cg)([(0,st.W)()],ut.prototype,"enableOITOffset",void 0);const mt=new ut,pt=2e-5,ft=2e-6,vt=(0,h.vt)();var gt=r(91429),xt=r(91829),_t=r(4431),bt=r(1843),yt=r(72824),wt=r(13840),St=r(42958),Mt=r(16943),Tt=r(90644);const Ct=(0,Tt.p3)(1,0,1,771);function It(e,t=!1,r=!1){if(r)return Tt.uR;switch(e){case 0:return t?Tt.RC:Tt.T8;case 1:return Ct;default:return null}}function Et(e){if(e.draped)return null;switch(e.output){case 0:case 2:default:return e.writeDepth?Tt.Uy:null;case 1:return null}}function Ot(e,t=513){return{func:(0,te._$)(e)?515:t}}(0,xt._Y)();const Pt={mask:255},Dt=(0,Tt.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),At=(0,Tt.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681});(0,Tt.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),(0,Tt.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680}),r(4576),r(66289);var Rt=r(69622),Ft=r(65529),Bt=r(32728);class Nt{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",f.Eq),this.color=e.getField("instanceColor",f.XP),this.olidColor=e.getField("instanceOlidColor",f.XP),this.state=e.getField("state",f.SL),this.lodLevel=e.getField("lodLevel",f.SL)}}let zt=class extends Rt.A{constructor(e,t){super(e),this.events=new Ft.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return Ht(jt.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=Gt,this._buffer=this._layout.createBuffer(this._capacity),this._view=new Nt(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,W.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,W.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=Lt,i=Wt;t.localTransform.getMat(e,Vt),t.globalTransform.getMat(e,Ut);const n=(0,l.lw)(Ut,Ut,Vt);(0,d.hZ)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,a.z0)(i,n),t.model.setMat(e,i);const o=(0,Bt.wp)(Lt,n);o.sort(),t.modelScaleFactors.set(e,0,o[1]),t.modelScaleFactors.set(e,1,o[2]),(0,a.B8)(i,i),(0,a.mg)(i,i),t.modelNormal.setMat(e,i),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,Wt),r.modelOrigin.getVec(e,Lt),t[0]=Wt[0],t[1]=Wt[1],t[2]=Wt[2],t[3]=0,t[4]=Wt[3],t[5]=Wt[4],t[6]=Wt[5],t[7]=0,t[8]=Wt[6],t[9]=Wt[7],t[10]=Wt[8],t[11]=0,t[12]=Lt[0],t[13]=Lt[1],t[14]=Lt[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Lt,this,e),t*=Math.max(Lt[0],Lt[1],Lt[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Lt,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(Lt[0],Lt[1],Lt[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(Gt,Math.floor(1.5*this._capacity)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new Nt(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,at.Cg)([(0,gt.MZ)({constructOnly:!0})],zt.prototype,"shaderTransformation",void 0),(0,at.Cg)([(0,gt.MZ)()],zt.prototype,"_size",void 0),(0,at.Cg)([(0,gt.MZ)({readOnly:!0})],zt.prototype,"size",null),zt=(0,at.Cg)([(0,gt.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],zt);const jt=(0,bt.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function Ht(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,Mt.E)()&&e.vec4u8("instanceOlidColor"),e}const Lt=(0,h.vt)(),Wt=(0,s.vt)(),Vt=(0,c.vt)(),Ut=(0,c.vt)(),Gt=64,kt=(0,bt.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var $t=r(74810),Zt=r(28491),qt=r(49788);class Yt extends yt.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=$t.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=h.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,h.CN)(.2,.2,.2),this.diffuse=(0,h.CN)(.8,.8,.8),this.externalColor=(0,xt.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,h.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=qt.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}yt.gy;let Kt=class extends St.w{constructor(e,t){let i=(0,_t.U)(Qt(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,_t.U)(function(e){return Ht(kt.clone(),e)}(t)))),super(e,t,i),this.shader=new wt.r(Zt.D,()=>r.e(5141).then(()=>r(5141))),this.ignoreUnused=!0}_makePipeline(e,t){const{output:r,transparent:i,cullFace:n,customDepthTest:o,hasOccludees:a}=e;return(0,Tt.Ey)({blending:i?It(r,!1,e.emissionDimmingPass):null,culling:Jt(e)?(0,Tt.Xt)(n):null,depthTest:Ot(r,Xt(o)),depthWrite:Et(e),colorWrite:Tt.kn,stencilWrite:a?Pt:null,stencilTest:a?t?At:Dt:null,polygonOffset:nt(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,r){return r?this._occludeePipelineState:super.getPipeline(e,t,r)}};function Xt(e){switch(e){case 1:return 515;case 0:case 4:return 513;case 2:return 516;case 3:return 514}}function Jt(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Qt(e){const t=(0,bt.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,Mt.E)()&&t.vec4u8("olidColor"),t}Kt=(0,at.Cg)([(0,gt.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],Kt);class er extends ut{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1,this.renderOccluded=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}}(0,at.Cg)([(0,st.W)({count:4})],er.prototype,"alphaDiscardMode",void 0),(0,at.Cg)([(0,st.W)({count:3})],er.prototype,"doubleSidedMode",void 0),(0,at.Cg)([(0,st.W)({count:8})],er.prototype,"pbrMode",void 0),(0,at.Cg)([(0,st.W)({count:3})],er.prototype,"cullFace",void 0),(0,at.Cg)([(0,st.W)({count:3})],er.prototype,"normalType",void 0),(0,at.Cg)([(0,st.W)({count:4})],er.prototype,"customDepthTest",void 0),(0,at.Cg)([(0,st.W)({count:8})],er.prototype,"emissionSource",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasVertexColors",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasSymbolColors",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasVerticalOffset",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasColorTexture",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasMetallicRoughnessTexture",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasOcclusionTexture",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasNormalTexture",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasScreenSizePerspective",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasVertexTangents",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasOccludees",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"instanced",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"instancedDoublePrecision",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasModelTransformation",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"offsetBackfaces",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasVVSize",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasVVColor",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"receiveShadows",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasShadowHighlights",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"receiveAmbientOcclusion",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"receiveGlobalIllumination",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"textureAlphaPremultiplied",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"instancedFeatureAttribute",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"instancedColor",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"writeDepth",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"snowCover",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasColorTextureTransform",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasEmissionTextureTransform",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasNormalTextureTransform",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasOcclusionTextureTransform",void 0),(0,at.Cg)([(0,st.W)()],er.prototype,"hasMetallicRoughnessTextureTransform",void 0);var tr=r(57323);let rr=class extends Kt{constructor(){super(...arguments),this.shader=new wt.r(tr.R,()=>r.e(9933).then(()=>r(39933)))}};rr=(0,at.Cg)([(0,gt.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],rr);class ir extends st.K{constructor(){super(...arguments),this.receiveShadows=!0}}(0,at.Cg)([(0,st.W)()],ir.prototype,"receiveShadows",void 0);class nr extends pe{constructor(e,t){super(e,ar),this.materialType="default",this.supportsEdges=!0,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,e=>(0,te.uw)(e)&&!this.transparent],[4,e=>(0,te.uw)(e)&&this.transparent]]),this._layout=Qt(this.parameters),this._configuration=new er(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||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])>=qt.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,d.t2)(this.parameters.emissiveBaseColor,h.uY)}get emissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;const{treeRendering:i,doubleSided:n,doubleSidedType:o}=t;r.hasVertexTangents=!i&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=i?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.hasModelTransformation=!i&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=i?2:n&&"normal"===o?1:n&&"winding-order"===o?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,(0,te._o)(e.output)?(r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=function(e,t){return e.receiveShadows&&null!=t.shadowHighlight?.getTexture()}(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&e.globalIlluminationEnabled):r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=r.receiveGlobalIllumination=!1,r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.unlit?7:t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersectRay(e,t,r,i,n,o){const a=this._getMaterialVerticalOffset(t,r);null!=a&&(i=(0,d.Re)(sr,i,a),n=(0,d.Re)(lr,n,a)),o=function(e,t,r,i){const n=dt(t);if(!n)return e;const o=(0,d.oW)(vt,i,r);return(t,r,i,a)=>e(t,ht(n,o,r,i),i,a)}(o,this._configuration,i,n),(0,fe.Uy)(e,r,i,n,(0,Ze.ou)(r.verticalOffset),o)}intersectScreenPolygon(e,t,r,i){return function(e,t,r){return null==e?null:(e.renderDistance=function(e,t,r,i,n){const o=dt(r);return o?ht(o,(0,d.oW)(vt,n,i),e,t):e}(e.renderDistance,e.hasNormal?e.normal:null,t,r,e.point),e)}(Re(e,r,t,i,this._createScreenPolygonVertexDisplacement(t,r)),this._configuration,r.camera.eye)}createGLMaterial(e){return new or(e)}createBufferWriter(){return new Je(this._layout)}get transparent(){const{drivenOpacity:e,opacity:t,externalColor:r,layerOpacity:i,texture:n,textureId:o,textureAlphaMode:a,colorMixMode:s}=this.parameters,l=r[3];return e||t<1&&"replace"!==s||l<1&&"ignore"!==s||i<1||(null!=n||null!=o)&&1!==a&&2!==a&&"replace"!==s}_createScreenPolygonVertexDisplacement(e,t){const r=this._getMaterialVerticalOffset(e,t);return null==r?null:{applyToVertex:(e,t,i,n)=>(e[0]=t+r[0],e[1]=i+r[1],e[2]=n+r[2],e),applyToAabb:e=>((0,m.Ne)(e,(0,d.WQ)(pr,(0,m.pg)(e,pr),r)),(0,m.vI)(e,(0,d.WQ)(pr,(0,m.Lu)(e,pr),r)),e)}}_getMaterialVerticalOffset(e,t){if(null==this.parameters.verticalOffset)return null;const r=t.camera;(0,d.hZ)(dr,e[12],e[13],e[14]);let i=null;switch(t.viewingMode){case 1:i=(0,d.S8)(ur,dr);break;case 2:i=(0,d.C)(ur,cr)}const n=(0,d.Re)(hr,dr,r.eye),o=(0,d.Bw)(n),a=(0,d.hs)(n,n,1/o);let s=null;this.parameters.screenSizePerspective&&(s=(0,d.Om)(i,a));const l=(0,me.kE)(r,o,this.parameters.verticalOffset,s??0,this.parameters.screenSizePerspective,null);return(0,d.hs)(i,i,l),(0,d.ei)(mr,i,t.transform.inverseRotation)}}class or extends oe{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,d.hZ)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?rr:Kt,e)}}class ar extends Yt{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1,this.unlit=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const sr=(0,h.vt)(),lr=(0,h.vt)(),cr=(0,h.fA)(0,0,1),ur=(0,h.vt)(),dr=(0,h.vt)(),hr=(0,h.vt)(),mr=(0,h.vt)(),pr=(0,h.vt)(),fr=()=>O.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class vr{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function gr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(fr().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(fr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(fr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(fr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else fr().warn("Indexed geometries must specify faces"),i=!1;break}default:fr().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(fr().warn("Geometry requires material"),i=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(fr().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function xr(e){const t=(0,m.Ie)();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&(0,m.RF)(t,r.box)}),t}function _r(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function br(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const yr=new R.A(1,2,"wosr");async function wr(e,t){const s=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:{fileType:e.match(/(.*\.(json|json\.gz))$/)?"wosr":"unknown",url:e,specifiedLodIndex:null}}((0,n.EM)(e));if("wosr"===s.fileType){const e=await(t.cache?t.cache.loadWOSR(s.url,t):async function(e,t){const r=await async function(e,t){const r=await(0,I.Ke)((0,C.A)(e,t));if(r.ok)return r.value.data;(0,A.QP)(r.error),function(e){throw new E.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const n=e[i],o=n.images[0].data;if(!o){fr().warn("Externally referenced texture data is not yet supported");continue}const a=n.encoding+";base64,"+o,s="/textureDefinitions/"+i,l="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==_r(l)},u=t?.disableTextures?Promise.resolve(null):(0,B.D)(a,t);r.push(u.then(e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l})))}const i=await Promise.all(r),n={};for(const e of i)n[e.refId]=e;return n}(r.textureDefinitions??{},t);let n=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];n+=t?.image?t.image.width*t.image.height*4:0}return new vr(r,i,n+(0,P.Qh)(r))}(s.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){const r=new Array,i=new Array,n=new Array,o=new D,a=e.resource,s=R.A.parse(a.version||"1.0","wosr");yr.validate(s);const l=a.model.name,c=a.model.geometries,u=a.materialDefinitions??{},d=e.textures;let m=0;const p=new Map;for(let e=0;e<c.length;e++){const a=c[e];if(!gr(a))continue;const s=br(a),l=a.params.vertexAttributes,f=[],v=e=>{if("PerAttributeArray"===a.params.topology)return null;const t=a.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l.position,x=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=v(e)??(0,F.tM)(x);f.push([e,new N.n(r,i,t.valuesPerElement,!0)])}const _=s.texture,b=d&&d[_];if(b&&!p.has(_)){const{image:e,parameters:t}=b,r=new ee.h(e,t);i.push(r),p.set(_,r)}const y=p.get(_),w=y?y.id:void 0,S=s.material;let M=o.get(S,_);if(null==M){const e=u[S.slice(S.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=b?_r(b.alphaChannelUsage):void 0,i={ambient:(0,h.ci)(e.diffuse),diffuse:(0,h.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:w,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:b?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(i,t.materialParameters),M=new nr(i,t),o.set(S,_,M)}n.push(M);const T=new J(M,f);m+=f.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(T)}return{engineResources:[{name:l,stageResources:{textures:i,materials:n,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:xr(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}let w;if(t.cache)w=await t.cache.loadGLTF(s.url,t,!!t.usePBR,!!t.useEmissive);else{const{loadGLTF:e}=await r.e(1698).then(()=>r(51698));w=await e(new _.R,s.url,t,t.usePBR,t.useEmissive)}const{engineResources:M,referenceBoundingBox:O}=function(e,t,r){const n=e.model,s=e.meta,_=n.meta?.ESRI_proxyEllipsoid,w=s.isEsriSymbolResource&&null!=_&&"EsriRealisticTreesStyle"===s.ESRI_webstyle;w&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const n of i.parts){const i=n.attributes.normal;if(null==i)return;const o=n.attributes.position,a=o.count,s=(0,h.vt)(),u=(0,h.vt)(),m=(0,h.vt)(),p=new Float32Array(4*a),v=new Float32Array(3*a),g=(0,l.B8)((0,c.vt)(),n.transform);let x=0,_=0;for(let l=0;l<a;l++){o.getVec(l,u),i.getVec(l,s),(0,d.Z0)(u,u,n.transform),(0,d.Re)(m,u,t.center),(0,d.Qr)(m,m,t.radius);const a=m[2],c=(0,d.Bw)(m),h=Math.min(.45+.55*c*c,1)**2.2;(0,d.Qr)(m,m,t.radius),null!==g&&(0,d.Z0)(m,m,g),(0,d.S8)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.Cc)(m,m,s,a>-1?.2:Math.min(-4*a-3.8,1)),v[x]=m[0],v[x+1]=m[1],v[x+2]=m[2],x+=3,p[_]=h,p[_+1]=h,p[_+2]=h,p[_+3]=1,_+=4}n.attributes.normal=new f.xs(v.buffer),n.attributes.color=new f.Eq(p.buffer)}}}(e,_));const M=!!t.usePBR,C=s.isEsriSymbolResource?{usePBR:M,isSchematic:!1,treeRendering:w,mrrFactors:$t.SY}:{usePBR:M,isSchematic:!1,treeRendering:!1,mrrFactors:$t.mb},I={...t.materialParameters,treeRendering:w},E=new Array,O=new Map,P=new Map,D=n.lods.length,A=(0,m.Ie)();return n.lods.forEach((e,s)=>{const l=!0===t.skipHighLods&&(D>1&&0===s||D>3&&1===s)||!1===t.skipHighLods&&null!=r&&s!==r;if(l&&0!==s)return;const c=new T(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const r=l?new nr({},t):function(e,t,r,n,o,a,s,l,c){const d=e.materials.get(t.material);if(null==d)return null;const{normal:m,color:p,texCoord0:f,tangent:v}=t.attributes,g=t.material+(m?"_normal":"")+(p?"_color":"")+(f?"_texCoord0":"")+(v?"_tangent":""),x=null!=t.attributes.texCoord0,_=null!=t.attributes.normal,b=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(d.alphaMode);if(!a.has(g)){if(x){const t=(t,r=!1,i=!1)=>{if(null!=t&&!s.has(t)){const n=e.textures.get(t);if(n){const e=n.data,o=r&&!(0,y.x3)(e)?l.compressionOptions:void 0;s.set(t,new ee.h((0,y.x3)(e)?e.data:e,{...n.parameters,preMultiplyAlpha:!(0,y.x3)(e)&&i,encoding:(0,y.x3)(e)?e.encoding:void 0,compressionOptions:o}))}}},r=1!==b&&!c;t(d.colorTexture,r,1!==b),t(d.normalTexture),t(d.occlusionTexture,!0),t(d.emissiveTexture),t(d.metallicRoughnessTexture,!0)}const r=(0,i.xV)(d.color[0]),m=(0,i.xV)(d.color[1]),p=(0,i.xV)(d.color[2]),f=null!=d.colorTexture&&x?s.get(d.colorTexture):null,v=(0,$t.Jr)(d),w=null!=d.normalTextureTransform?.scale?d.normalTextureTransform?.scale:u.Un;a.set(g,new nr({...n,customDepthTest:1,textureAlphaMode:b,textureAlphaCutoff:d.alphaCutoff,diffuse:[r,m,p],ambient:[r,m,p],opacity:"OPAQUE"===d.alphaMode?1:d.opacity,doubleSided:d.doubleSided,doubleSidedType:"winding-order",cullFace:d.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:_?0:2,castShadows:!0,receiveShadows:d.receiveShadows,receiveAmbientOcclusion:d.receiveAmbientOcclusion,unlit:d.unlit,textureId:null!=f?f.id:void 0,colorMixMode:d.colorMixMode,normalTextureId:null!=d.normalTexture&&x?s.get(d.normalTexture).id:void 0,textureAlphaPremultiplied:null!=f&&!!f.parameters.preMultiplyAlpha,occlusionTextureId:null!=d.occlusionTexture&&x?s.get(d.occlusionTexture).id:void 0,emissiveTextureId:null!=d.emissiveTexture&&x&&!d.unlit?s.get(d.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=d.metallicRoughnessTexture&&x?s.get(d.metallicRoughnessTexture).id:void 0,emissiveBaseColor:d.unlit?h.uY:[d.emissiveFactor[0],d.emissiveFactor[1],d.emissiveFactor[2]],emissiveStrengthKHR:null!=d.emissiveStrengthKHR?d.emissiveStrengthKHR:1,emissiveStrengthFromSymbol:null!=o.emissiveStrengthFromSymbol?o.emissiveStrengthFromSymbol:void 0,mrrFactors:v?$t.Bt:[d.metallicFactor,d.roughnessFactor,n.mrrFactors[2]],isSchematic:v,colorTextureTransformMatrix:S(d.colorTextureTransform),normalTextureTransformMatrix:S(d.normalTextureTransform),scale:[w[0],w[1]],occlusionTextureTransformMatrix:S(d.occlusionTextureTransform),emissiveTextureTransformMatrix:S(d.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:S(d.metallicRoughnessTextureTransform),...o},l))}const w=a.get(g);if(r.stageResources.materials.push(w),x){const e=e=>{null!=e&&r.stageResources.textures.push(s.get(e))};e(d.colorTexture),e(d.normalTexture),e(d.occlusionTexture),e(d.emissiveTexture),e(d.metallicRoughnessTexture)}return w}(n,e,c,C,I,O,P,t,w),{geometry:d,vertexCount:_}=function(e,t){const r=e.attributes.position.count,i=(0,b.x)(e.indices||r,e.primitiveType),n=p(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,v.t)(n,s,e.transform,3,l);const c=[["position",new N.n(n,i,3,!0)]];if(null!=e.attributes.normal){const t=p(3*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.normal;(0,a.Ge)(Sr,e.transform),(0,v.b)(t,n,Sr,3,s),(0,o.or)(Sr)&&(0,v.n)(t,t),c.push(["normal",new N.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=p(4*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.tangent;(0,a.z0)(Sr,e.transform),(0,g.t)(t,n,Sr,4,s),(0,o.or)(Sr)&&(0,v.n)(t,t,4),c.push(["tangent",new N.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=p(2*r),{typedBuffer:n,typedBufferStride:o}=e.attributes.texCoord0;(0,x.a)(t,n,2,o),c.push(["uv0",new N.n(t,i,2,!0)])}const u=e.attributes.color;if(null!=u){const t=new Uint8Array(4*r);4===u.elementCount?u instanceof f.Eq?(0,g.b)(t,u,1,255):(u instanceof f.XP||u instanceof f.Uz)&&(0,g.b)(t,u,1/255,255):(t.fill(255),u instanceof f.xs?(0,v.f)(t,u.typedBuffer,1,255,4,u.typedBufferStride):(e.attributes.color instanceof f.eI||e.attributes.color instanceof f.nS)&&(0,v.f)(t,u.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new N.n(t,i,4,!0)])}return{geometry:new J(t,c),vertexCount:r}}(e,r??new nr({},t)),M=d.boundingInfo;null!=M&&0===s&&(0,m.RF)(A,M.box),null!=r&&(c.stageResources.geometries.push(d),c.numberOfVertices+=_)}),l||E.push(c)}),{engineResources:E,referenceBoundingBox:A}}(w,t,s.specifiedLodIndex);return{lods:M,referenceBoundingBox:O,isEsriSymbolResource:w.meta.isEsriSymbolResource,isWosr:!1}}const Sr=(0,s.vt)()},26857(e,t,r){var i=r(32198),n=r(69622),o=r(91429);let a=class extends n.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.UPDATING=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,o.MZ)()],a.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"UPDATING",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),a=(0,i.Cg)([(0,o.$K)("esri.views.3d.support.debugFlags")],a);const s=new a;r.d(t,["b",0,s])},46686(e,t,r){r.d(t,{A7:()=>o,Y0:()=>n});var i=r(29941);class n extends i.v{constructor(e){super(),this.spherical=e,this.draped=!1}}function o(e){(function(e){e.varyings.add("linearDepth","float",{invariant:!0})})(e),e.vertex.code.add("void forwardLinearDepth(float _linearDepth) { linearDepth = _linearDepth; }")}},32680(e,t,r){r.d(t,{M:()=>n});var i=r(31821);function n(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
652
652
  vec3 camToVert = posWorld - camPosWorld;
653
653
  bool isBackface = dot(camToVert, normalWorld) > 0.0;
654
654
  if (isBackface) {
655
655
  posClip.z += 0.0000003 * posClip.w;
656
656
  }
657
657
  return posClip;
658
- }`)}},82048(e,t,r){r.d(t,{c:()=>o});var i=r(31821);function o(e,t=!0){e.attributes.add("position","vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(i.H`
658
+ }`)}},82048(e,t,r){r.d(t,{c:()=>n});var i=r(31821);function n(e,t=!0){e.attributes.add("position","vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(i.H`
659
659
  gl_Position = vec4(position, 0.0, 1.0);
660
660
  ${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
661
- `)}},49255(e,t,r){function i(e){return function(e){return function(e){return function(e){return a(e)||function(e){return 10===e||11===e}(e)}(e)||function(e){return 3===e}(e)}(e)||function(e){return 4===e}(e)}(e)||function(e){return 5===(t=e)||6===t||7===t||8===e||9===e;var t}(e)}function o(e){return 1===e}function n(e){return 2===e}function a(e){return 0===e||function(e){return o(e)||n(e)}(e)}r.d(t,{Rb:()=>n,_$:()=>o,_o:()=>a,uw:()=>i})},29941(e,t,r){r.d(t,{v:()=>n});var i=r(32198),o=r(51976);class n extends o.K{constructor(){super(...arguments),this.output=0,this.hasEmission=!1,this.useFloatBlend=!0}}(0,i.Cg)([(0,o.W)({count:12})],n.prototype,"output",void 0),(0,i.Cg)([(0,o.W)()],n.prototype,"hasEmission",void 0),(0,i.Cg)([(0,o.W)()],n.prototype,"useFloatBlend",void 0)},34711(e,t,r){r.d(t,{Hz:()=>p,zM:()=>f});var i=r(32198),o=r(58083),n=r(9093),a=r(35522),s=r(51850),l=r(29941);class c extends l.v{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}var u=r(40710),d=(r(33079),r(31821)),h=r(51976),m=r(65786);class p extends c{constructor(){super(...arguments),this.hasSlicePlane=!1,this.hasSliceTranslatedView=!1}}function f(e,t){!function(e,t,...r){e.constants.add("groundSliceOpacity","float",.2),function(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(d.H`struct SliceFactors {
661
+ `)}},49255(e,t,r){function i(e){return function(e){return function(e){return function(e){return a(e)||function(e){return 10===e||11===e}(e)}(e)||function(e){return 3===e}(e)}(e)||function(e){return 4===e}(e)}(e)||function(e){return 5===(t=e)||6===t||7===t||8===e||9===e;var t}(e)}function n(e){return 1===e}function o(e){return 2===e}function a(e){return 0===e||function(e){return n(e)||o(e)}(e)}r.d(t,{Rb:()=>o,_$:()=>n,_o:()=>a,uw:()=>i})},29941(e,t,r){r.d(t,{v:()=>o});var i=r(32198),n=r(51976);class o extends n.K{constructor(){super(...arguments),this.output=0,this.hasEmission=!1,this.useFloatBlend=!0}}(0,i.Cg)([(0,n.W)({count:12})],o.prototype,"output",void 0),(0,i.Cg)([(0,n.W)()],o.prototype,"hasEmission",void 0),(0,i.Cg)([(0,n.W)()],o.prototype,"useFloatBlend",void 0)},34711(e,t,r){r.d(t,{Hz:()=>p,zM:()=>f});var i=r(32198),n=r(58083),o=r(9093),a=r(35522),s=r(51850),l=r(29941);class c extends l.v{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}var u=r(40710),d=(r(33079),r(31821)),h=r(51976),m=r(65786);class p extends c{constructor(){super(...arguments),this.hasSlicePlane=!1,this.hasSliceTranslatedView=!1}}function f(e,t){!function(e,t,...r){e.constants.add("groundSliceOpacity","float",.2),function(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(d.H`struct SliceFactors {
662
662
  float front;
663
663
  float side0;
664
664
  float side1;
@@ -694,7 +694,7 @@ return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
694
694
  bool rejectBySlice(vec3 pos) {
695
695
  return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
696
696
  }`)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (rejectBySlice(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(d.H`void discardBySlice(vec3 pos) { }
697
- vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}(e,t,...function(e){return[new u.W("slicePlaneOrigin",(t,r)=>function(e,t,r){if(null==r.slicePlane)return s.uY;const i=v(e,t,r),o=g(i,r.slicePlane),n=x(e,i,r);return null!=n?(0,a.Z0)(y,o,n):o}(e,t,r)),new u.W("slicePlaneBasis1",(t,r)=>_(e,t,r,r.slicePlane?.basis1)),new u.W("slicePlaneBasis2",(t,r)=>_(e,t,r,r.slicePlane?.basis2))]}(t))}function v(e,t,r){return e.instancedDoublePrecision?(0,a.hZ)(b,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function g(e,t){return null!=e?(0,a.Re)(y,t.origin,e):t.origin}function x(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,o.Tl)(S,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function _(e,t,r,i){if(null==i||null==r.slicePlane)return s.uY;const o=v(e,t,r),n=g(o,r.slicePlane),l=x(e,o,r);return null!=l?((0,a.WQ)(w,i,n),(0,a.Z0)(y,n,l),(0,a.Z0)(w,w,l),(0,a.Re)(w,w,y)):i}(0,i.Cg)([(0,h.W)()],p.prototype,"hasSlicePlane",void 0),m.Y;const b=(0,s.vt)(),y=(0,s.vt)(),w=(0,s.vt)(),S=(0,n.vt)()},71020(e,t,r){r.d(t,{d:()=>o}),r(46686),r(41095),r(45324);var i=r(31821);function o(e){e.vertex.code.add(i.H`float calculateLinearDepth(vec2 nearFar,float z) {
697
+ vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}(e,t,...function(e){return[new u.W("slicePlaneOrigin",(t,r)=>function(e,t,r){if(null==r.slicePlane)return s.uY;const i=v(e,t,r),n=g(i,r.slicePlane),o=x(e,i,r);return null!=o?(0,a.Z0)(y,n,o):n}(e,t,r)),new u.W("slicePlaneBasis1",(t,r)=>_(e,t,r,r.slicePlane?.basis1)),new u.W("slicePlaneBasis2",(t,r)=>_(e,t,r,r.slicePlane?.basis2))]}(t))}function v(e,t,r){return e.instancedDoublePrecision?(0,a.hZ)(b,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function g(e,t){return null!=e?(0,a.Re)(y,t.origin,e):t.origin}function x(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,n.Tl)(S,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function _(e,t,r,i){if(null==i||null==r.slicePlane)return s.uY;const n=v(e,t,r),o=g(n,r.slicePlane),l=x(e,n,r);return null!=l?((0,a.WQ)(w,i,o),(0,a.Z0)(y,o,l),(0,a.Z0)(w,w,l),(0,a.Re)(w,w,y)):i}(0,i.Cg)([(0,h.W)()],p.prototype,"hasSlicePlane",void 0),m.Y;const b=(0,s.vt)(),y=(0,s.vt)(),w=(0,s.vt)(),S=(0,o.vt)()},71020(e,t,r){r.d(t,{d:()=>n}),r(46686),r(41095),r(45324);var i=r(31821);function n(e){e.vertex.code.add(i.H`float calculateLinearDepth(vec2 nearFar,float z) {
698
698
  return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
699
699
  }`),e.vertex.code.add(i.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
700
700
  vec4 eye = view * vec4(pos, 1.0);
@@ -702,36 +702,36 @@ depth = calculateLinearDepth(nearFar,eye.z);
702
702
  return proj * eye;
703
703
  }`),e.vertex.code.add(i.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
704
704
  return proj * (view * vec4(pos, 1.0));
705
- }`)}},72722(e,t,r){r.d(t,{B:()=>b});var i=r(77690),o=r(29242),n=r(9093),a=r(35522),s=r(51850),l=r(45324),c=r(26425),u=r(23205),d=r(31821),h=r(35644),m=r(74333);class p extends m.n{constructor(e,t,r){super(e,"mat4",1,(i,o,n)=>i.setUniformMatrix4fv(e,t(o,n),r))}}var f=r(46606);function v(e,t){const r=e.length;for(let i=0;i<r;++i)x[0]=e[i],t[i]=x[0];return t}function g(e,t){const r=e.length;for(let i=0;i<r;++i)x[0]=e[i],x[1]=e[i]-x[0],t[i]=x[1];return t}const x=new Float32Array(2);f.S;const _=(0,o.vt)();function b(e,t){const{hasModelTransformation:r,instancedDoublePrecision:o,instanced:s,output:m,hasVertexTangents:f}=t;r&&e.vertex.uniforms.add(new p("model",e=>e.modelTransformation??n.zK),new h.k("normalLocalOriginFromModel",e=>((0,i.Ge)(_,e.modelTransformation??n.zK),_))),s&&o&&(e.attributes.add("instanceModelOriginHi","vec3"),e.attributes.add("instanceModelOriginLo","vec3"),e.attributes.add("instanceModel","mat3"),e.attributes.add("instanceModelNormal","mat3"));const x=e.vertex;o&&(x.include(c.u),x.uniforms.add(new u.d("viewOriginHi",e=>v((0,a.hZ)(y,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),y)),new u.d("viewOriginLo",e=>g((0,a.hZ)(y,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),y)))),x.code.add(d.H`
705
+ }`)}},72722(e,t,r){r.d(t,{B:()=>b});var i=r(77690),n=r(29242),o=r(9093),a=r(35522),s=r(51850),l=r(45324),c=r(26425),u=r(23205),d=r(31821),h=r(35644),m=r(74333);class p extends m.n{constructor(e,t,r){super(e,"mat4",1,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}var f=r(46606);function v(e,t){const r=e.length;for(let i=0;i<r;++i)x[0]=e[i],t[i]=x[0];return t}function g(e,t){const r=e.length;for(let i=0;i<r;++i)x[0]=e[i],x[1]=e[i]-x[0],t[i]=x[1];return t}const x=new Float32Array(2);f.S;const _=(0,n.vt)();function b(e,t){const{hasModelTransformation:r,instancedDoublePrecision:n,instanced:s,output:m,hasVertexTangents:f}=t;r&&e.vertex.uniforms.add(new p("model",e=>e.modelTransformation??o.zK),new h.k("normalLocalOriginFromModel",e=>((0,i.Ge)(_,e.modelTransformation??o.zK),_))),s&&n&&(e.attributes.add("instanceModelOriginHi","vec3"),e.attributes.add("instanceModelOriginLo","vec3"),e.attributes.add("instanceModel","mat3"),e.attributes.add("instanceModelNormal","mat3"));const x=e.vertex;n&&(x.include(c.u),x.uniforms.add(new u.d("viewOriginHi",e=>v((0,a.hZ)(y,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),y)),new u.d("viewOriginLo",e=>g((0,a.hZ)(y,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),y)))),x.code.add(d.H`
706
706
  vec3 getVertexInLocalOriginSpace() {
707
- return ${r?o?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":o?"instanceModel * localPosition().xyz":"localPosition().xyz"};
707
+ return ${r?n?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":n?"instanceModel * localPosition().xyz":"localPosition().xyz"};
708
708
  }
709
709
 
710
710
  vec3 subtractOrigin(vec3 _pos) {
711
- ${o?d.H`
711
+ ${n?d.H`
712
712
  // Issue: (should be resolved now with invariant position) https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280
713
713
  vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -instanceModelOriginHi, -instanceModelOriginLo);
714
714
  return _pos - originDelta;`:"return vpos;"}
715
715
  }
716
716
 
717
717
  vec3 dpNormal(vec4 _normal) {
718
- return normalize(${r?o?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":o?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
718
+ return normalize(${r?n?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":n?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
719
719
  }
720
720
  `),4===m&&x.uniforms.add(l.HO).code.add(d.H`
721
721
  vec3 dpNormalView(vec4 _normal) {
722
- return normalize((viewNormal * ${r?o?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":o?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz);
722
+ return normalize((viewNormal * ${r?n?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":n?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz);
723
723
  }
724
724
  `),f&&x.code.add(d.H`
725
725
  vec4 dpTransformVertexTangent(vec4 _tangent) {
726
- ${r?o?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":o?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
727
- }`)}const y=(0,s.vt)()},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 {
726
+ ${r?n?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":n?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
727
+ }`)}const y=(0,s.vt)()},43519(e,t,r){r.d(t,{ML:()=>a,WD:()=>n,Y1:()=>o,oF:()=>s});var i=r(31821);function n(e){e.code.add(i.H`struct MaskedColor {
728
728
  vec4 color;
729
729
  bvec4 mask;
730
- };`)}function n(e){e.include(o),e.code.add(i.H`
730
+ };`)}function o(e){e.include(n),e.code.add(i.H`
731
731
  MaskedColor createMaskedFromUInt8NaNColor(vec4 color) {
732
732
  return MaskedColor(color * ${i.H.float(1/254)}, equal(color, vec4(255)));
733
733
  }
734
- `)}function a(e){e.include(o),e.code.add(i.H`vec4 maskedColorSelectOrOne(MaskedColor color) {
734
+ `)}function a(e){e.include(n),e.code.add(i.H`vec4 maskedColorSelectOrOne(MaskedColor color) {
735
735
  return vec4(
736
736
  color.mask.r ? 1.0 : color.color.r,
737
737
  color.mask.g ? 1.0 : color.color.g,
@@ -743,9 +743,9 @@ MaskedColor multiplyMaskedColors(MaskedColor color1, MaskedColor color2) {
743
743
  vec4 masked1 = maskedColorSelectOrOne(color1);
744
744
  vec4 masked2 = maskedColorSelectOrOne(color2);
745
745
  return MaskedColor(masked1 * masked2, bvec4(ivec4(color1.mask) & ivec4(color2.mask)));
746
- }`)}function s(e){e.include(o),e.code.add(i.H`MaskedColor createMaskedFromNaNColor(vec4 color) {
746
+ }`)}function s(e){e.include(n),e.code.add(i.H`MaskedColor createMaskedFromNaNColor(vec4 color) {
747
747
  return MaskedColor(color, isnan(color));
748
- }`)}},96336(e,t,r){r.d(t,{Y:()=>o});var i=r(31821);function o(e,t){switch(e.fragment.code.add(i.H`vec3 screenDerivativeNormal(vec3 positionView) {
748
+ }`)}},96336(e,t,r){r.d(t,{Y:()=>n});var i=r(31821);function n(e,t){switch(e.fragment.code.add(i.H`vec3 screenDerivativeNormal(vec3 positionView) {
749
749
  return normalize(cross(dFdx(positionView), dFdy(positionView)));
750
750
  }`),t.normalType){case 1:e.attributes.add("normalCompressed","vec2"),e.vertex.code.add(i.H`vec3 decompressNormal(vec2 normal) {
751
751
  float z = 1.0 - abs(normal.x) - abs(normal.y);
@@ -755,24 +755,24 @@ vec3 normalModel() {
755
755
  return decompressNormal(normalCompressed);
756
756
  }`);break;case 0:e.attributes.add("normal","vec3"),e.vertex.code.add(i.H`vec3 normalModel() {
757
757
  return normal;
758
- }`);break;default:t.normalType;case 2:case 3:}}},53466(e,t,r){r.d(t,{U:()=>o});var i=r(31821);function o(e,t){switch(t.textureCoordinateType){case 1:return e.attributes.add("uv0","vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(i.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case 2:return e.attributes.add("uv0","vec2"),e.attributes.add("uvRegion","vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(i.H`void forwardTextureCoordinates() {
758
+ }`);break;default:t.normalType;case 2:case 3:}}},53466(e,t,r){r.d(t,{U:()=>n});var i=r(31821);function n(e,t){switch(t.textureCoordinateType){case 1:return e.attributes.add("uv0","vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(i.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case 2:return e.attributes.add("uv0","vec2"),e.attributes.add("uvRegion","vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(i.H`void forwardTextureCoordinates() {
759
759
  vuv0 = uv0;
760
760
  vuvRegion = uvRegion;
761
- }`);default:t.textureCoordinateType;case 0:return void e.vertex.code.add(i.H`void forwardTextureCoordinates() {}`);case 3:return}}},72824(e,t,r){r.d(t,{Mh:()=>c,Zo:()=>u,gy:()=>d});var i=r(29242),o=r(91829),n=r(96336),a=r(41095),s=r(31821),l=r(35644);function c(e,t){const{vertex:r,varyings:i}=e;switch(t.normalType){case 0:case 1:e.include(n.Y,t),i.add("vNormalWorld","vec3"),i.add("vNormalView","vec3"),r.uniforms.add(new l.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)),r.code.add(s.H`void forwardNormal() {
761
+ }`);default:t.textureCoordinateType;case 0:return void e.vertex.code.add(i.H`void forwardTextureCoordinates() {}`);case 3:return}}},72824(e,t,r){r.d(t,{Mh:()=>c,Zo:()=>u,gy:()=>d});var i=r(29242),n=r(91829),o=r(96336),a=r(41095),s=r(31821),l=r(35644);function c(e,t){const{vertex:r,varyings:i}=e;switch(t.normalType){case 0:case 1:e.include(o.Y,t),i.add("vNormalWorld","vec3"),i.add("vNormalView","vec3"),r.uniforms.add(new l.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)),r.code.add(s.H`void forwardNormal() {
762
762
  vNormalWorld = normalModel();
763
763
  vNormalView = transformNormalViewFromGlobal * vNormalWorld;
764
- }`);break;case 2:e.vertex.code.add(s.H`void forwardNormal() {}`);break;default:t.normalType;case 3:}}class u extends a.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,i.vt)()}}class d extends a.EM{constructor(){super(...arguments),this.toMapSpace=(0,o.vt)()}}},41095(e,t,r){r.d(t,{EM:()=>l,dO:()=>s});var i=r(29242),o=r(51850),n=(r(26425),r(40710),r(33079),r(31821),r(74333));n.n,n.n,r(35644),r(58029),r(63761),r(51976).K;var a=r(65786);class s extends a.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,o.vt)(),this.transformWorldFromViewTL=(0,o.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)()}}class l extends a.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,o.vt)(),this.transformWorldFromModelTL=(0,o.vt)(),this.transformationDrawId=0}}},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) {
764
+ }`);break;case 2:e.vertex.code.add(s.H`void forwardNormal() {}`);break;default:t.normalType;case 3:}}class u extends a.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,i.vt)()}}class d extends a.EM{constructor(){super(...arguments),this.toMapSpace=(0,n.vt)()}}},41095(e,t,r){r.d(t,{EM:()=>l,dO:()=>s});var i=r(29242),n=r(51850),o=(r(26425),r(40710),r(33079),r(31821),r(74333));o.n,o.n,r(35644),r(58029),r(63761),r(51976).K;var a=r(65786);class s extends a.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,n.vt)(),this.transformWorldFromViewTL=(0,n.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)()}}class l extends a.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,n.vt)(),this.transformWorldFromModelTL=(0,n.vt)(),this.transformationDrawId=0}}},99208(e,t,r){r.d(t,{r:()=>a});var i=r(53466),n=r(31821);function o(e){e.fragment.code.add(n.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
765
765
  vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
766
766
  vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
767
767
  float maxdUV = 0.125;
768
768
  vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
769
769
  vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
770
770
  return textureGrad(tex, uvAtlas, dUVdx, dUVdy);
771
- }`)}function a(e,t){const{textureCoordinateType:r}=t;if(0===r||3===r)return;e.include(i.U,t);const a=2===r;a&&e.include(n),e.fragment.code.add(o.H`
771
+ }`)}function a(e,t){const{textureCoordinateType:r}=t;if(0===r||3===r)return;e.include(i.U,t);const a=2===r;a&&e.include(o),e.fragment.code.add(n.H`
772
772
  vec4 textureLookup(sampler2D tex, vec2 uv) {
773
773
  return ${a?"textureAtlasLookup(tex, uv, vuvRegion)":"texture(tex, uv)"};
774
774
  }
775
- `)}},54154(e,t,r){r.d(t,{Ge:()=>m}),r(90629);var i=r(78955),o=r(91829),n=r(35522),a=r(51850),s=r(33079),l=r(31821);function c(e){e.vertex.code.add(l.H`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
775
+ `)}},54154(e,t,r){r.d(t,{Ge:()=>m}),r(90629);var i=r(78955),n=r(91829),o=r(35522),a=r(51850),s=r(33079),l=r(31821);function c(e){e.vertex.code.add(l.H`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
776
776
  return absCosAngle * absCosAngle * absCosAngle;
777
777
  }`),e.vertex.code.add(l.H`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) {
778
778
  return vec3(
@@ -791,7 +791,7 @@ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
791
791
  return size * clamp(mix(factor.x, 1.0, factor.y), factor.z, 1.0);
792
792
  }`),e.vertex.code.add(l.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
793
793
  return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
794
- }`)}const u=(0,a.vt)();var d=r(20693),h=r(71988);function m(e,t){const r=e.vertex;t.hasVerticalOffset?(function(e){e.uniforms.add(new h.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.hZ)(p,n*s,a,r,o)}))}(r),t.hasScreenSizePerspective&&(e.include(c),function(e){e.uniforms.add(new s.t("screenSizePerspectiveAlignment",e=>function(e,t){const r=null!=t&&null!=e?Math.min(e.minPixelSize/t,1):0;return e?(0,n.hZ)(u,e.divisor,e.offset,r):(0,n.hZ)(u,0,0,0)}(e.screenSizePerspectiveAlignment||e.screenSizePerspective,e.screenSizePerspectiveAlignment?null:e.screenSizePerspectiveMinPixelReferenceSize)))}(r),(0,d.yu)(e.vertex,t)),r.code.add(l.H`
794
+ }`)}const u=(0,a.vt)();var d=r(20693),h=r(71988);function m(e,t){const r=e.vertex;t.hasVerticalOffset?(function(e){e.uniforms.add(new h.E("verticalOffset",(e,t)=>{const{minWorldLength:r,maxWorldLength:n,screenLength:o}=e.verticalOffset,a=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),s=t.camera.pixelRatio||1;return(0,i.hZ)(p,o*s,a,r,n)}))}(r),t.hasScreenSizePerspective&&(e.include(c),function(e){e.uniforms.add(new s.t("screenSizePerspectiveAlignment",e=>function(e,t){const r=null!=t&&null!=e?Math.min(e.minPixelSize/t,1):0;return e?(0,o.hZ)(u,e.divisor,e.offset,r):(0,o.hZ)(u,0,0,0)}(e.screenSizePerspectiveAlignment||e.screenSizePerspective,e.screenSizePerspectiveAlignment?null:e.screenSizePerspectiveMinPixelReferenceSize)))}(r),(0,d.yu)(e.vertex,t)),r.code.add(l.H`
795
795
  vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
796
796
  float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
797
797
  ${t.spherical?l.H`vec3 worldNormal = normalize(worldPos + localOrigin);`:l.H`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
@@ -807,7 +807,7 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
807
807
  vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
808
808
  return worldPos + calculateVerticalOffset(worldPos, localOrigin);
809
809
  }
810
- `)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const p=(0,o.vt)()},9169(e,t,r){r.d(t,{E:()=>x});var i=r(34711),o=r(71020),n=r(96336),a=r(31821);function s(e,t){if(11!==t.output)return e.vertex.code.add(a.H`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(a.H`void outputObjectAndLayerIdColor() {}`);const r=t.instanced;e.varyings.add("objectAndLayerIdColorVarying","vec4");const i=r?"instanceOlidColor":"olidColor";e.attributes.add(i,"vec4"),e.vertex.code.add(a.H`
810
+ `)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const p=(0,n.vt)()},9169(e,t,r){r.d(t,{E:()=>x});var i=r(34711),n=r(71020),o=r(96336),a=r(31821);function s(e,t){if(11!==t.output)return e.vertex.code.add(a.H`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(a.H`void outputObjectAndLayerIdColor() {}`);const r=t.instanced;e.varyings.add("objectAndLayerIdColorVarying","vec4");const i=r?"instanceOlidColor":"olidColor";e.attributes.add(i,"vec4"),e.vertex.code.add(a.H`
811
811
  void forwardObjectAndLayerIdColor() {
812
812
  objectAndLayerIdColorVarying = ${i} * 0.003921568627451;
813
813
  }`),e.fragment.code.add(a.H`void outputObjectAndLayerIdColor() {
@@ -817,14 +817,14 @@ const float slope_scale = 2.0;
817
817
  const float bias = 20.0 * .000015259;
818
818
  float m = max(abs(dFdx(_linearDepth)), abs(dFdy(_linearDepth)));
819
819
  gl_FragDepth = _linearDepth + slope_scale * m + bias;
820
- }`)}}var h=r(42593),m=r(89435),p=r(45324),f=r(58614),v=r(20693),g=r(63761);function x(e,t){const{vertex:r,fragment:x,varyings:_}=e,{hasColorTexture:b,alphaDiscardMode:y}=t,w=b&&1!==y,{output:S,normalType:M,hasColorTextureTransform:T}=t;switch(S){case 3:(0,v.NB)(r,t),e.include(o.d),x.include(i.zM,t),e.include(l.U,t),w&&x.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(a.H`vpos = getVertexInLocalOriginSpace();
820
+ }`)}}var h=r(42593),m=r(89435),p=r(45324),f=r(58614),v=r(20693),g=r(63761);function x(e,t){const{vertex:r,fragment:x,varyings:_}=e,{hasColorTexture:b,alphaDiscardMode:y}=t,w=b&&1!==y,{output:S,normalType:M,hasColorTextureTransform:T}=t;switch(S){case 3:(0,v.NB)(r,t),e.include(n.d),x.include(i.zM,t),e.include(l.U,t),w&&x.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(a.H`vpos = getVertexInLocalOriginSpace();
821
821
  vpos = subtractOrigin(vpos);
822
822
  vpos = addVerticalOffset(vpos, localOrigin);
823
823
  gl_Position = transformPosition(proj, view, vpos);
824
824
  forwardTextureCoordinates();`),e.include(f.SS,t),x.main.add(a.H`
825
825
  discardBySlice(vpos);
826
826
  ${(0,a.If)(w,a.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
827
- discardOrAdjustAlpha(texColor);`)}`);break;case 5:case 6:case 7:case 8:case 11:(0,v.NB)(r,t),e.include(o.d),e.include(l.U,t),e.include(m.A,t),e.include(d,t),x.include(i.zM,t),e.include(s,t),_.add("depth","float",{invariant:!0}),w&&x.uniforms.add(new g.N("tex",e=>e.texture)),r.uniforms.add(p.Y$).main.add(a.H`vpos = getVertexInLocalOriginSpace();
827
+ discardOrAdjustAlpha(texColor);`)}`);break;case 5:case 6:case 7:case 8:case 11:(0,v.NB)(r,t),e.include(n.d),e.include(l.U,t),e.include(m.A,t),e.include(d,t),x.include(i.zM,t),e.include(s,t),_.add("depth","float",{invariant:!0}),w&&x.uniforms.add(new g.N("tex",e=>e.texture)),r.uniforms.add(p.Y$).main.add(a.H`vpos = getVertexInLocalOriginSpace();
828
828
  vpos = subtractOrigin(vpos);
829
829
  vpos = addVerticalOffset(vpos, localOrigin);
830
830
  gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
@@ -833,7 +833,7 @@ forwardObjectAndLayerIdColor();`),e.include(f.SS,t),x.main.add(a.H`
833
833
  discardBySlice(vpos);
834
834
  ${(0,a.If)(w,a.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
835
835
  discardOrAdjustAlpha(texColor);`)}
836
- ${11===S?a.H`outputObjectAndLayerIdColor();`:a.H`outputDepth(depth);`}`);break;case 4:{(0,v.NB)(r,t),e.include(o.d),e.include(n.Y,t),e.include(c.Mh,t),e.include(l.U,t),e.include(m.A,t),e.include(u.F,t),w&&x.uniforms.add(new g.N("tex",e=>e.texture)),2===M&&_.add("vPositionView","vec3",{invariant:!0});const s=0===M||1===M;r.main.add(a.H`
836
+ ${11===S?a.H`outputObjectAndLayerIdColor();`:a.H`outputDepth(depth);`}`);break;case 4:{(0,v.NB)(r,t),e.include(n.d),e.include(o.Y,t),e.include(c.Mh,t),e.include(l.U,t),e.include(m.A,t),e.include(u.F,t),w&&x.uniforms.add(new g.N("tex",e=>e.texture)),2===M&&_.add("vPositionView","vec3",{invariant:!0});const s=0===M||1===M;r.main.add(a.H`
837
837
  forwardDefaultMaterialExternalColor();
838
838
 
839
839
  if (shouldCullByOpacity()) {
@@ -856,7 +856,7 @@ forwardObjectAndLayerIdColor();`),e.include(f.SS,t),x.main.add(a.H`
856
856
  if (gl_FrontFacing == false){
857
857
  normal = -normal;
858
858
  }`}
859
- fragColor = vec4(0.5 + 0.5 * normal, opacity);`);break}case 10:(0,v.NB)(r,t),e.include(o.d),e.include(l.U,t),e.include(m.A,t),w&&x.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(a.H`vpos = getVertexInLocalOriginSpace();
859
+ fragColor = vec4(0.5 + 0.5 * normal, opacity);`);break}case 10:(0,v.NB)(r,t),e.include(n.d),e.include(l.U,t),e.include(m.A,t),w&&x.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(a.H`vpos = getVertexInLocalOriginSpace();
860
860
  vpos = subtractOrigin(vpos);
861
861
  vpos = addVerticalOffset(vpos, localOrigin);
862
862
  gl_Position = transformPosition(proj, view, vpos);
@@ -864,35 +864,35 @@ forwardTextureCoordinates();`),x.include(i.zM,t),e.include(f.SS,t),e.include(h.Q
864
864
  discardBySlice(vpos);
865
865
  ${(0,a.If)(w,a.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
866
866
  discardOrAdjustAlpha(texColor);`)}
867
- calculateOcclusionAndOutputHighlight();`)}}},12696(e,t,r){r.d(t,{F:()=>v});var i=r(43519),o=r(31821);function n(e,t){t.instancedColor?(e.attributes.add("instanceColor","vec4"),e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.vertex.code.add(o.H`
867
+ calculateOcclusionAndOutputHighlight();`)}}},12696(e,t,r){r.d(t,{F:()=>v});var i=r(43519),n=r(31821);function o(e,t){t.instancedColor?(e.attributes.add("instanceColor","vec4"),e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.vertex.code.add(n.H`
868
868
  MaskedColor applyInstanceColor(MaskedColor color) {
869
869
  return multiplyMaskedColors( color, createMaskedFromUInt8NaNColor(${"instanceColor"}));
870
870
  }
871
- `)):e.vertex.code.add(o.H`MaskedColor applyInstanceColor(MaskedColor color) {
871
+ `)):e.vertex.code.add(n.H`MaskedColor applyInstanceColor(MaskedColor color) {
872
872
  return color;
873
- }`)}var a=r(74333);class s extends a.n{constructor(e,t){super(e,"int",1,(r,i,o)=>r.setUniform1i(e,t(i,o)))}}var l=r(19245);function c(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("symbolColor","vec4"),e.vertex.code.add(o.H`
873
+ }`)}var a=r(74333);class s extends a.n{constructor(e,t){super(e,"int",1,(r,i,n)=>r.setUniform1i(e,t(i,n)))}}var l=r(19245);function c(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("symbolColor","vec4"),e.vertex.code.add(n.H`
874
874
  MaskedColor applySymbolColor(MaskedColor color) {
875
875
  return multiplyMaskedColors(color, createMaskedFromUInt8NaNColor(${"symbolColor"}));
876
876
  }
877
- `)):e.vertex.code.add(o.H`MaskedColor applySymbolColor(MaskedColor color) {
877
+ `)):e.vertex.code.add(n.H`MaskedColor applySymbolColor(MaskedColor color) {
878
878
  return color;
879
- }`),e.vertex.code.add(o.H`
879
+ }`),e.vertex.code.add(n.H`
880
880
  void forwardColorMixMode(bvec4 mask) {
881
- colorMixMode = mask.r ? ${o.H.int(l.Um.ignore)} : symbolColorMixMode;
882
- opacityMixMode = mask.a ? ${o.H.int(l.Um.ignore)} : symbolColorMixMode;
881
+ colorMixMode = mask.r ? ${n.H.int(l.Um.ignore)} : symbolColorMixMode;
882
+ opacityMixMode = mask.a ? ${n.H.int(l.Um.ignore)} : symbolColorMixMode;
883
883
  }
884
- `)}function u(e,t){t.hasVertexColors?(e.attributes.add("color","vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(o.H`void forwardVertexColor() { vColor = color; }`)):e.vertex.code.add(o.H`void forwardVertexColor() {}`)}var d=r(63365);function h(e){e.include(d.a),e.code.add(o.H`
884
+ `)}function u(e,t){t.hasVertexColors?(e.attributes.add("color","vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(n.H`void forwardVertexColor() { vColor = color; }`)):e.vertex.code.add(n.H`void forwardVertexColor() {}`)}var d=r(63365);function h(e){e.include(d.a),e.code.add(n.H`
885
885
  vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
886
- if (mode == ${o.H.int(3)}) {
886
+ if (mode == ${n.H.int(3)}) {
887
887
  return externalColor;
888
888
  }
889
889
 
890
890
  vec3 internalMixed = internalColor * textureColor;
891
- if (mode == ${o.H.int(2)}) {
891
+ if (mode == ${n.H.int(2)}) {
892
892
  return internalMixed;
893
893
  }
894
894
 
895
- if (mode == ${o.H.int(1)}) {
895
+ if (mode == ${n.H.int(1)}) {
896
896
  return internalMixed * externalColor;
897
897
  }
898
898
 
@@ -904,19 +904,19 @@ return color;
904
904
  }
905
905
 
906
906
  float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
907
- if (mode == ${o.H.int(3)}) {
907
+ if (mode == ${n.H.int(3)}) {
908
908
  return externalOpacity;
909
909
  }
910
910
 
911
911
  float internalMixed = internalOpacity * textureOpacity;
912
- if (mode == ${o.H.int(2)}) {
912
+ if (mode == ${n.H.int(2)}) {
913
913
  return internalMixed;
914
914
  }
915
915
 
916
916
  // multiply or tint (or something invalid)
917
917
  return internalMixed * externalOpacity;
918
918
  }
919
- `)}var m=r(71988),p=r(20304),f=r(26934);function v(e,t){const{vertex:r,fragment:a,varyings:s}=e;e.include(n,t),e.include(c,t),e.include(u,t),r.include(i.WD),r.include(i.oF),r.include(f.Q),r.uniforms.add(new m.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),s.add("vExternalColor","vec4"),r.code.add(o.H`
919
+ `)}var m=r(71988),p=r(20304),f=r(26934);function v(e,t){const{vertex:r,fragment:a,varyings:s}=e;e.include(o,t),e.include(c,t),e.include(u,t),r.include(i.WD),r.include(i.oF),r.include(f.Q),r.uniforms.add(new m.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),s.add("vExternalColor","vec4"),r.code.add(n.H`
920
920
  void forwardDefaultMaterialExternalColor() {
921
921
  forwardVertexColor();
922
922
 
@@ -928,18 +928,18 @@ return color;
928
928
  }
929
929
 
930
930
  bool shouldCullByOpacity() {
931
- return opacityMixMode != ${o.H.int(l.Um.ignore)} && vExternalColor.a < alphaCutoff;
931
+ return opacityMixMode != ${n.H.int(l.Um.ignore)} && vExternalColor.a < alphaCutoff;
932
932
  }
933
- `),a.include(h),a.uniforms.add(new p.m("opacity",e=>e.opacity),new p.m("layerOpacity",e=>e.layerOpacity)),a.code.add(o.H`
933
+ `),a.include(h),a.uniforms.add(new p.m("opacity",e=>e.opacity),new p.m("layerOpacity",e=>e.layerOpacity)),a.code.add(n.H`
934
934
  float getDefaultMaterialOpacity(float textureOpacity) {
935
935
  return layerOpacity * mixExternalOpacity(
936
- ${(0,o.If)(t.hasVertexColors,"vColor.a * ")} opacity,
936
+ ${(0,n.If)(t.hasVertexColors,"vColor.a * ")} opacity,
937
937
  textureOpacity,
938
938
  vExternalColor.a,
939
939
  opacityMixMode
940
940
  );
941
941
  }
942
- `)}},10036(e,t,r){r.d(t,{E:()=>l,W:()=>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=>l(e.camera))),e.code.add(a.H`float linearizeDepth(float depth, vec2 zProjectionConstants) {
942
+ `)}},10036(e,t,r){r.d(t,{E:()=>l,W:()=>s});var i=r(37585),n=r(48163),o=r(77108),a=r(31821);function s(e){e.uniforms.add(new o.E("zProjectionMap",e=>l(e.camera))),e.code.add(a.H`float linearizeDepth(float depth, vec2 zProjectionConstants) {
943
943
  float depthNdc = depth * 2.0 - 1.0;
944
944
  return -(zProjectionConstants[0] / (depthNdc + zProjectionConstants[1] + 1e-7));
945
945
  }
@@ -951,7 +951,7 @@ float c2 = zProjectionMap[1];
951
951
  float depthNdc = (-c1/linearDepth) - c2 - 1e-7;
952
952
  float depthNonlinear01 = (depthNdc + 1.0 ) / 2.0;
953
953
  return depthNonlinear01;
954
- }`)}function l(e){const t=e.projectionMatrix;return(0,i.hZ)(c,t[14],t[10])}const c=(0,o.vt)()},42593(e,t,r){r.d(t,{Q:()=>u});var i=r(31821);function o(e){const{fragment:t}=e;t.code.add(i.H`uint readChannelBits(uint channel, int highlightLevel) {
954
+ }`)}function l(e){const t=e.projectionMatrix;return(0,i.hZ)(c,t[14],t[10])}const c=(0,n.vt)()},42593(e,t,r){r.d(t,{Q:()=>u});var i=r(31821);function n(e){const{fragment:t}=e;t.code.add(i.H`uint readChannelBits(uint channel, int highlightLevel) {
955
955
  int llc = (highlightLevel & 3) << 1;
956
956
  return (channel >> llc) & 3u;
957
957
  }
@@ -961,7 +961,7 @@ return texel[lic];
961
961
  }
962
962
  uint readLevelBits(uvec2 texel, int highlightLevel) {
963
963
  return readChannelBits(readChannel(texel, highlightLevel), highlightLevel);
964
- }`)}var n=r(74333);class a extends n.n{constructor(e,t){super(e,"ivec2",0,(r,i)=>r.setUniform2iv(e,t(i)))}}var s=r(35818),l=r(12791);class c extends n.n{constructor(e,t){super(e,"usampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}function u(e,t){const{fragment:r}=e,{output:n,draped:u,hasHighlightMixTexture:d}=t;10===n?(r.uniforms.add(new s.W("highlightLevel",e=>e.highlightLevel??0),new a("highlightMixOrigin",e=>e.highlightMixOrigin)),e.outputs.add("fragHighlight","uvec2",0),e.include(o),d?r.uniforms.add(new c("highlightMixTexture",e=>e.highlightMixTexture)).code.add(i.H`uvec2 getAccumulatedHighlight() {
964
+ }`)}var o=r(74333);class a extends o.n{constructor(e,t){super(e,"ivec2",0,(r,i)=>r.setUniform2iv(e,t(i)))}}var s=r(35818),l=r(12791);class c extends o.n{constructor(e,t){super(e,"usampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}function u(e,t){const{fragment:r}=e,{output:o,draped:u,hasHighlightMixTexture:d}=t;10===o?(r.uniforms.add(new s.W("highlightLevel",e=>e.highlightLevel??0),new a("highlightMixOrigin",e=>e.highlightMixOrigin)),e.outputs.add("fragHighlight","uvec2",0),e.include(n),d?r.uniforms.add(new c("highlightMixTexture",e=>e.highlightMixTexture)).code.add(i.H`uvec2 getAccumulatedHighlight() {
965
965
  return texelFetch(highlightMixTexture, ivec2(gl_FragCoord.xy) - highlightMixOrigin, 0).rg;
966
966
  }
967
967
  void outputHighlight(bool occluded) {
@@ -991,20 +991,20 @@ float sceneDepth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x;
991
991
  return gl_FragCoord.z > sceneDepth + 5e-7;
992
992
  }`),r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {
993
993
  outputHighlight(isHighlightOccluded());
994
- }`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},52540(e,t,r){r.d(t,{E:()=>n});var i=r(10036),o=r(31821);function n(e){e.include(i.W),e.code.add(o.H`float depthFromTexture(sampler2D depthTexture, vec2 uv) {
994
+ }`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},52540(e,t,r){r.d(t,{E:()=>o});var i=r(10036),n=r(31821);function o(e){e.include(i.W),e.code.add(n.H`float depthFromTexture(sampler2D depthTexture, vec2 uv) {
995
995
  ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0)));
996
996
  return texelFetch(depthTexture, iuv, 0).r;
997
- }`),e.code.add(o.H`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) {
997
+ }`),e.code.add(n.H`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) {
998
998
  return linearizeDepth(depthFromTexture(depthTexture, uv));
999
- }`)}},92573(e,t,r){r.d(t,{V:()=>s});var i=r(10036),o=r(52540),n=r(77108),a=r(31821);function s(e){e.include(o.E),e.uniforms.add(new n.E("zProjectionMapLastFrame",e=>(0,i.E)(e.reprojection.lastFrameCamera))),e.code.add(a.H`float linearDepthFromTextureLastFrame(sampler2D depthTexture, vec2 uv) {
999
+ }`)}},92573(e,t,r){r.d(t,{V:()=>s});var i=r(10036),n=r(52540),o=r(77108),a=r(31821);function s(e){e.include(n.E),e.uniforms.add(new o.E("zProjectionMapLastFrame",e=>(0,i.E)(e.reprojection.lastFrameCamera))),e.code.add(a.H`float linearDepthFromTextureLastFrame(sampler2D depthTexture, vec2 uv) {
1000
1000
  return linearizeDepth(depthFromTexture(depthTexture, uv), zProjectionMapLastFrame);
1001
- }`)}},47187(e,t,r){r.d(t,{zp:()=>x});var i=r(32198),o=r(34727),n=r(49255),a=r(29941),s=r(99208),l=r(65261),c=r(40710),u=r(33079),d=r(28421),h=r(20304),m=r(31821),p=r(15976),f=r(63761),v=r(51976);r(72458);class g extends a.v{constructor(){super(...arguments),this.emissionSource=0}}function x(e,t){const{hasEmission:r,emissionSource:i,hasEmissiveTextureTransform:a,bindType:v}=t;if(!(0,n._o)(t.output)||!r)return;const g=e.fragment;if(g.include(l.C),0===i)return void g.code.add("vec4 getEmissions(vec3 symbolColor) { return vec4(0.0);}");const x=3===i||4===i||5===i;x&&(e.include(s.r,t),g.uniforms.add(1===v?new f.N("texEmission",e=>e.textureEmissive):new p.o("texEmission",e=>e.textureEmissive)));const _=2===i||x;if(_&&g.uniforms.add(1===v?new u.t("emissiveBaseColor",e=>e.emissiveBaseColor):new c.W("emissiveBaseColor",e=>e.emissiveBaseColor)),function({emissionSource:e}){return 0===e||1===e||2===e||3===e}(t)){const e=e=>(0,o.qE)(e??0,0,16);g.uniforms.add(1===v?new h.m("emissiveStrength",t=>e(t.emissiveStrength)):new d.J("emissiveStrength",t=>e(t.emissiveStrength)))}const b=7===i,y=5===i,w=1===i||6===i||b;g.code.add(m.H`vec4 getEmissions(vec3 symbolColor) {
1001
+ }`)}},47187(e,t,r){r.d(t,{zp:()=>x});var i=r(32198),n=r(34727),o=r(49255),a=r(29941),s=r(99208),l=r(65261),c=r(40710),u=r(33079),d=r(28421),h=r(20304),m=r(31821),p=r(15976),f=r(63761),v=r(51976);r(72458);class g extends a.v{constructor(){super(...arguments),this.emissionSource=0}}function x(e,t){const{hasEmission:r,emissionSource:i,hasEmissiveTextureTransform:a,bindType:v}=t;if(!(0,o._o)(t.output)||!r)return;const g=e.fragment;if(g.include(l.C),0===i)return void g.code.add("vec4 getEmissions(vec3 symbolColor) { return vec4(0.0);}");const x=3===i||4===i||5===i;x&&(e.include(s.r,t),g.uniforms.add(1===v?new f.N("texEmission",e=>e.textureEmissive):new p.o("texEmission",e=>e.textureEmissive)));const _=2===i||x;if(_&&g.uniforms.add(1===v?new u.t("emissiveBaseColor",e=>e.emissiveBaseColor):new c.W("emissiveBaseColor",e=>e.emissiveBaseColor)),function({emissionSource:e}){return 0===e||1===e||2===e||3===e}(t)){const e=e=>(0,n.qE)(e??0,0,16);g.uniforms.add(1===v?new h.m("emissiveStrength",t=>e(t.emissiveStrength)):new d.J("emissiveStrength",t=>e(t.emissiveStrength)))}const b=7===i,y=5===i,w=1===i||6===i||b;g.code.add(m.H`vec4 getEmissions(vec3 symbolColor) {
1002
1002
  vec4 emissions =`),_?y?g.code.add("emissiveSource == 0 ? vec4(emissiveBaseColor, 1.0): vec4(linearizeGamma(symbolColor), 1.0)"):g.code.add("vec4(emissiveBaseColor, 1.0)"):w?b?g.code.add("emissiveSource == 0 ? vec4(0.0): vec4(linearizeGamma(symbolColor), 1.0)"):g.code.add("vec4(linearizeGamma(symbolColor), 1.0)"):g.code.add("vec4(0.0)"),g.code.add(";"),x&&(y?g.code.add(m.H`
1003
1003
  if(emissiveSource == 0) {
1004
1004
  vec4 emissiveFromTex = textureLookup(texEmission, ${a?"emissiveUV":"vuv0"});
1005
1005
  emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);
1006
1006
  }
1007
- `):g.code.add(`vec4 emissiveFromTex = textureLookup(texEmission, ${a?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);`),g.code.add("emissions.a = emissions.rgb == vec3(0.0) ? 0.0: emissions.a;")),g.code.add("\n emissions.rgb *= emissiveStrength;\n return emissions;\n }\n ")}(0,i.Cg)([(0,v.W)({count:8})],g.prototype,"emissionSource",void 0),(0,i.Cg)([(0,v.W)()],g.prototype,"hasEmissiveTextureTransform",void 0)},77695(e,t,r){r.d(t,{J:()=>h});var i=r(29242),o=r(48163),n=r(99208),a=r(68259),s=r(47286),l=r(31821),c=r(35644),u=r(15976),d=r(63761);function h(e,t){return function(e,t){const r=e.fragment,{hasVertexTangents:h,doubleSidedMode:m,hasNormalTexture:p,textureCoordinateType:f,bindType:v,hasNormalTextureTransform:g}=t;h?(e.attributes.add("tangent","vec4"),e.varyings.add("vTangent","vec4"),2===m?r.code.add(l.H`mat3 computeTangentSpace(vec3 normal) {
1007
+ `):g.code.add(`vec4 emissiveFromTex = textureLookup(texEmission, ${a?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);`),g.code.add("emissions.a = emissions.rgb == vec3(0.0) ? 0.0: emissions.a;")),g.code.add("\n emissions.rgb *= emissiveStrength;\n return emissions;\n }\n ")}(0,i.Cg)([(0,v.W)({count:8})],g.prototype,"emissionSource",void 0),(0,i.Cg)([(0,v.W)()],g.prototype,"hasEmissiveTextureTransform",void 0)},77695(e,t,r){r.d(t,{J:()=>h});var i=r(29242),n=r(48163),o=r(99208),a=r(68259),s=r(47286),l=r(31821),c=r(35644),u=r(15976),d=r(63761);function h(e,t){return function(e,t){const r=e.fragment,{hasVertexTangents:h,doubleSidedMode:m,hasNormalTexture:p,textureCoordinateType:f,bindType:v,hasNormalTextureTransform:g}=t;h?(e.attributes.add("tangent","vec4"),e.varyings.add("vTangent","vec4"),2===m?r.code.add(l.H`mat3 computeTangentSpace(vec3 normal) {
1008
1008
  float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
1009
1009
  vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
1010
1010
  vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
@@ -1025,19 +1025,19 @@ T = T - normal * dot(normal, T);
1025
1025
  T *= inversesqrt(max(dot(T,T), 1.e-10));
1026
1026
  vec3 B = sign(det) * cross(normal, T);
1027
1027
  return mat3(T, B, normal);
1028
- }`),p&&0!==f&&(e.include(n.r,t),r.uniforms.add(1===v?new d.N("normalTexture",e=>e.textureNormal):new u.o("normalTexture",e=>e.textureNormal)),g&&(r.uniforms.add(1===v?new s.G("scale",e=>e.scale??o.Un):new a.t("scale",e=>e.scale??o.Un)),r.uniforms.add(new c.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK))),r.code.add(l.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
1028
+ }`),p&&0!==f&&(e.include(o.r,t),r.uniforms.add(1===v?new d.N("normalTexture",e=>e.textureNormal):new u.o("normalTexture",e=>e.textureNormal)),g&&(r.uniforms.add(1===v?new s.G("scale",e=>e.scale??n.Un):new a.t("scale",e=>e.scale??n.Un)),r.uniforms.add(new c.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK))),r.code.add(l.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
1029
1029
  vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),g&&r.code.add(l.H`mat3 normalRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0,
1030
1030
  normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
1031
1031
  0.0, 0.0, 0.0 );
1032
1032
  rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(l.H`return tangentSpace * rawNormal;
1033
- }`))}(e,t)}},72233(e,t,r){r.d(t,{n:()=>A});var i=r(31821),o=r(12791),n=r(32198),a=r(34727),s=r(97768),l=r(36708),c=r(78659),u=r(91429),d=r(37585),h=r(89904),m=r(99811),p=r(15581),f=r(13840),v=r(42958),g=r(95774),x=r(90644);let _=class extends v.w{constructor(){super(...arguments),this.shader=new f.r(g.S,()=>r.e(1285).then(()=>r(91285)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};_=(0,n.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],_);var b=r(48163),y=r(65786);class w extends y.Y{constructor(){super(...arguments),this.projScale=1}}class S extends w{constructor(){super(...arguments),this.intensity=1}}class M extends y.Y{}class T extends M{constructor(){super(...arguments),this.blurSize=(0,b.vt)()}}let C=class extends v.w{constructor(){super(...arguments),this.shader=new f.r(p.S,()=>r.e(6122).then(()=>r(86122)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};C=(0,n.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],C),r(63907);var I=r(21231),E=r(67171);let O=class extends m.o{constructor(e){super(e),this._enableTime=(0,c.l5)(0),this._passParameters=new S,this._drawParameters=new T}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 E.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new I.A(this.renderingContext,t,e),this.addHandles((0,l.wB)(()=>this._useSSAO,e=>{this._enableTime=(0,c.l5)(0),e?this._enable():this._disable()},l.pc))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(33306);if(!r||!i)return;const o=this.techniques.getCompiled(C),n=this.techniques.getCompiled(_);if(!o||!n)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,u=this.bindParameters,m=u.camera,f=m.relativeElevation,v=(0,a.qE)((5e5-f)/2e5,0,1),g=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,x=g*v;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/m.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*P/(0,p.g)(m)**6*x;const b=m.fullViewport[2],y=m.fullViewport[3],w=this.fboCache.acquire(b,y,"ssao input",2);s.bindFramebuffer(w.fbo),s.setViewport(0,0,b,y),s.bindTechnique(o,u,this._passParameters,this._drawParameters),s.screen.draw();const S=Math.round(b/2),M=Math.round(y/2),T=this.fboCache.acquire(S,M,"ssao blur",0);s.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=w.getTexture(),(0,d.hZ)(this._drawParameters.blurSize,0,2/y),s.bindTechnique(n,u,this._passParameters,this._drawParameters),s.setViewport(0,0,S,M),s.screen.draw(),w.release();const I=this.fboCache.acquire(S,M,h.OG.AMBIENT_ILLUMINATION,0);return s.bindFramebuffer(I.fbo),s.setViewport(0,0,b,y),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=T.getTexture(),(0,d.hZ)(this._drawParameters.blurSize,2/b,0),s.bindTechnique(n,u,this._passParameters,this._drawParameters),s.setViewport(0,0,S,M),s.screen.draw(),s.setViewport4fv(m.fullViewport),T.release(),g<1&&this.requestRender(2),I}};O=(0,n.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],O);const P=.5;function A(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new o.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",.5),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
1033
+ }`))}(e,t)}},72233(e,t,r){r.d(t,{n:()=>D});var i=r(31821),n=r(12791),o=r(32198),a=r(34727),s=r(97768),l=r(36708),c=r(78659),u=r(91429),d=r(37585),h=r(89904),m=r(99811),p=r(15581),f=r(13840),v=r(42958),g=r(95774),x=r(90644);let _=class extends v.w{constructor(){super(...arguments),this.shader=new f.r(g.S,()=>r.e(1285).then(()=>r(91285)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};_=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],_);var b=r(48163),y=r(65786);class w extends y.Y{constructor(){super(...arguments),this.projScale=1}}class S extends w{constructor(){super(...arguments),this.intensity=1}}class M extends y.Y{}class T extends M{constructor(){super(...arguments),this.blurSize=(0,b.vt)()}}let C=class extends v.w{constructor(){super(...arguments),this.shader=new f.r(p.S,()=>r.e(6122).then(()=>r(86122)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};C=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],C),r(63907);var I=r(21231),E=r(67171);let O=class extends m.o{constructor(e){super(e),this._enableTime=(0,c.l5)(0),this._passParameters=new S,this._drawParameters=new T}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 E.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new I.A(this.renderingContext,t,e),this.addHandles((0,l.wB)(()=>this._useSSAO,e=>{this._enableTime=(0,c.l5)(0),e?this._enable():this._disable()},l.pc))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(33306);if(!r||!i)return;const n=this.techniques.getCompiled(C),o=this.techniques.getCompiled(_);if(!n||!o)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,u=this.bindParameters,m=u.camera,f=m.relativeElevation,v=(0,a.qE)((5e5-f)/2e5,0,1),g=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,x=g*v;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/m.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*P/(0,p.g)(m)**6*x;const b=m.fullViewport[2],y=m.fullViewport[3],w=this.fboCache.acquire(b,y,"ssao input",2);s.bindFramebuffer(w.fbo),s.setViewport(0,0,b,y),s.bindTechnique(n,u,this._passParameters,this._drawParameters),s.screen.draw();const S=Math.round(b/2),M=Math.round(y/2),T=this.fboCache.acquire(S,M,"ssao blur",0);s.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=w.getTexture(),(0,d.hZ)(this._drawParameters.blurSize,0,2/y),s.bindTechnique(o,u,this._passParameters,this._drawParameters),s.setViewport(0,0,S,M),s.screen.draw(),w.release();const I=this.fboCache.acquire(S,M,h.OG.AMBIENT_ILLUMINATION,0);return s.bindFramebuffer(I.fbo),s.setViewport(0,0,b,y),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=T.getTexture(),(0,d.hZ)(this._drawParameters.blurSize,2/b,0),s.bindTechnique(o,u,this._passParameters,this._drawParameters),s.setViewport(0,0,S,M),s.screen.draw(),s.setViewport4fv(m.fullViewport),T.release(),g<1&&this.requestRender(2),I}};O=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],O);const P=.5;function D(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",.5),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
1034
1034
  vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
1035
1035
  return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
1036
1036
  }
1037
1037
  float evaluateAmbientOcclusion() {
1038
1038
  return 1.0 - evaluateAmbientOcclusionInverse();
1039
1039
  }`)):e.code.add(i.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
1040
- float evaluateAmbientOcclusion() { return 0.0; }`)}},18e3(e,t,r){r.d(t,{kA:()=>U,a8:()=>W,eU:()=>V});var i=r(74333);class o extends i.n{constructor(e,t,r,i){super(e,"float",0,(t,o)=>t.setUniform1fv(e,r(o),i),t)}}var n=r(31821);function a(e,t){e.uniforms.add(new o("shR",9,({lighting:e})=>e.sh.r),new o("shG",9,({lighting:e})=>e.sh.g),new o("shB",9,({lighting:e})=>e.sh.b)),e.code.add(n.H`vec3 calculateAmbientIrradiance(vec3 normal) {
1040
+ float evaluateAmbientOcclusion() { return 0.0; }`)}},18e3(e,t,r){r.d(t,{kA:()=>U,a8:()=>W,eU:()=>V});var i=r(74333);class n extends i.n{constructor(e,t,r,i){super(e,"float",0,(t,n)=>t.setUniform1fv(e,r(n),i),t)}}var o=r(31821);function a(e,t){e.uniforms.add(new n("shR",9,({lighting:e})=>e.sh.r),new n("shG",9,({lighting:e})=>e.sh.g),new n("shB",9,({lighting:e})=>e.sh.b)),e.code.add(o.H`vec3 calculateAmbientIrradiance(vec3 normal) {
1041
1041
  vec3 ambientLight = 0.282095 * vec3(shR[0], shG[0], shB[0]);
1042
1042
  vec4 sh1 = vec4(
1043
1043
  0.488603 * normal.x,
@@ -1068,12 +1068,12 @@ dot(lightingAmbientSH_G2, sh2),
1068
1068
  dot(lightingAmbientSH_B2, sh2)
1069
1069
  );
1070
1070
  return ambientLight;
1071
- }`),1!==t.pbrMode&&2!==t.pbrMode||e.code.add(n.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
1071
+ }`),1!==t.pbrMode&&2!==t.pbrMode||e.code.add(o.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
1072
1072
  vec3 calculateAmbientRadiance()
1073
1073
  {
1074
1074
  vec3 ambientLight = 1.2 * (0.282095 * vec3(shR[0], shG[0], shB[0])) - 0.2;
1075
1075
  return ambientLight *= skyTransmittance;
1076
- }`)}var s=r(72233),l=r(65261),c=r(98619),u=r(22393),d=r(89786),h=r(32976),m=r(12791),p=r(32198),f=r(97768),v=r(36708),g=r(76030),x=r(91429),_=r(37585),b=r(91829),y=r(89904),w=r(99811),S=r(587),M=r(52516),T=r(13840),C=r(42958),I=r(90644);let E=class extends C.w{constructor(){super(...arguments),this.shader=new T.r(M.a,()=>r.e(2013).then(()=>r(42013)))}initializePipeline(){return(0,I.Ey)({colorWrite:I.kn})}};E=(0,p.Cg)([(0,x.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationBlurTechnique")],E);let O=class extends C.w{constructor(){super(...arguments),this.shader=new T.r(S.a,()=>r.e(9794).then(()=>r(89794)))}initializePipeline(){return(0,I.Ey)({colorWrite:I.kn})}};O=(0,p.Cg)([(0,x.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationTechnique")],O);var P=r(51976);class A extends P.K{constructor(){super(...arguments),this.hasColor=!0,this.hasEmission=!1,this.rayMarchMaxReach=.5,this.rayMarchMaxSteps=16,this.useProjectedRayLength=!0,this.clampRayToScreen=!1}}(0,p.Cg)([(0,P.W)()],A.prototype,"hasColor",void 0),(0,p.Cg)([(0,P.W)()],A.prototype,"hasEmission",void 0);var D=r(50704);let F=class extends C.w{constructor(){super(...arguments),this.shader=new T.r(D.a,()=>r.e(7891).then(()=>r(37891)))}initializePipeline(){return(0,I.Ey)({colorWrite:I.kn})}};F=(0,p.Cg)([(0,x.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationUpscaleTechnique")],F),r(63907);let R=class extends w.o{constructor(e){super(e),this._passParameters=new S.G,this._drawParameters=new M.G,this._drawParametersUpscale=new D.G,this._configuration=new A,this._lastOutput=null,this._isGlobalIlluminationUpdate=!1,this._lowQualityResolutionScale=.35,this._maxFrames=256}initialize(){this.addHandles((0,v.wB)(()=>this._mode,e=>{0===e?this._disable():this._enable()},v.pc))}destroy(){this._lastOutput=(0,f.Gz)(this._lastOutput)}_disable(){super._disable(),this._resetAccumulation(),this._passParameters.temporalSampleFrame=0}get hasHighQuality(){return 2===this._mode}resetAccumulation(){this._isGlobalIlluminationUpdate||!(this._passParameters.accumulatedFrames>100)&&this._configuration.hasEmission||this._resetAccumulation()}_resetAccumulation(){this._passParameters.accumulatedFrames=0,this._lastOutput=(0,f.Gz)(this._lastOutput)}get isAccumulating(){return this.enabled&&this._passParameters.accumulatedFrames<this._maxFrames}precompile(){this.techniques.getCompiled(F)}render(e){const t=1===this.bindParameters.frameRendererTarget;if(this._passParameters.accumulatedFrames>=this._maxFrames&&!t)return this._lastOutput?.retain(),this._lastOutput;const r=e.find(({name:e})=>"normals"===e),i=r?.getTexture(),o=r?.getTexture(33306);return i&&o?0===this._mode?this._emptyOutput:(this._configuration.hasEmission=!!this.bindParameters.reprojection.lastFrameEmission,t?this._renderScreenshot(i,o):this._renderInteractive(i,o)):this._emptyOutput}_renderScreenshot(e,t){let r=this._emptyOutput;const i=this._passParameters.accumulatedFrames,o=this._passParameters.temporalSampleFrame;this._passParameters.accumulatedFrames=0,this._passParameters.temporalSampleFrame=0;const n=this.techniques.get(O,this._configuration),a=this.techniques.get(E);for(;this._passParameters.accumulatedFrames<this._maxFrames;){this._passParameters.globalIllumination=r.getTexture(),this._passParameters.globalIlluminationWeights=r.getTexture(36065);const i=this._renderAccumulationFrame(e,t,n,a);++this._passParameters.accumulatedFrames,r.release(),r=i}return this._passParameters.globalIllumination=null,this._passParameters.globalIlluminationWeights=null,this._passParameters.accumulatedFrames=i,this._passParameters.temporalSampleFrame=o,r}_renderInteractive(e,t){if(!this._canRender)return this._requestRender(),this._emptyOutput;const r=1===this._mode?this._lowQualityResolutionScale:1,i=this.techniques.getCompiled(O,this._configuration),o=this.techniques.getCompiled(E),n=r<1,a=n?this.techniques.getCompiled(F):null;if(!i||!o||n&&!a)return this._requestRender(),this._emptyOutput;const s=this._renderAccumulationFrame(e,t,i,o,a,r);return++this._passParameters.accumulatedFrames,this._passParameters.accumulatedFrames<this._maxFrames&&this._requestRender(),this._storeOutput(s),s}_renderAccumulationFrame(e,t,r,i,o,n=1){const a=this.bindParameters,s=this.renderingContext,{camera:l}=a;this._passParameters.normalTexture=e,this._passParameters.depthTexture=t,this._passParameters.projScale=1/l.computeScreenPixelSizeAtDist(1),this._passParameters.resolutionScale=n;const{fullWidth:c,fullHeight:u}=l,d=Math.max(1,Math.floor(c*n)),h=Math.max(1,Math.floor(u*n)),m=this.fboCache.acquire(d,h,"global illumination input").acquireColor(36065,2);s.bindFramebuffer(m.fbo),s.setViewport(0,0,d,h),s.bindTechnique(r,a,this._passParameters,this._drawParameters),s.screen.draw();const p=Math.max(1,Math.round(d/1)),f=Math.max(1,Math.round(h/1)),v=this.fboCache.acquire(p,f,"global illumination blur horizontal");s.bindFramebuffer(v.fbo);const g=m.obtainAttachment(36065);this._drawParameters.texture=m.getTexture(),this._drawParameters.weightTexture=g.attachment,(0,_.hZ)(this._drawParameters.blurSize,0,1/h),s.bindTechnique(i,a,this._passParameters,this._drawParameters),s.setViewport(0,0,p,f),s.screen.draw(),m.release();const x=this.fboCache.acquire(p,f,o?"global illumination blur vertical":y.OG.AMBIENT_ILLUMINATION);s.bindFramebuffer(x.fbo),s.setViewport(0,0,p,f),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.texture=v.getTexture(),this._drawParameters.weightTexture=g.attachment,(0,_.hZ)(this._drawParameters.blurSize,1/p,0),s.bindTechnique(i,a,this._passParameters,this._drawParameters),s.setViewport(0,0,p,f),s.screen.draw(),v.release(),x.attachColor(g,36065),g.release();let b=x;return o&&(b=this.fboCache.acquire(c,u,y.OG.AMBIENT_ILLUMINATION).acquireColor(36065,2),s.bindFramebuffer(b.fbo),s.setViewport(0,0,c,u),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParametersUpscale.colorTexture=x.getTexture(),this._drawParametersUpscale.weightTexture=x.getTexture(36065),s.bindTechnique(o,a,this._passParameters,this._drawParametersUpscale),s.screen.draw(),x.release()),s.setViewport4fv(l.fullViewport),this._passParameters.temporalSampleFrame=(this._passParameters.temporalSampleFrame+1)%64,b}_requestRender(){this._isGlobalIlluminationUpdate=!0,this.requestRender(1),this._isGlobalIlluminationUpdate=!1}_storeOutput(e){this._lastOutput!==e&&(this._lastOutput=(0,f.Gz)(this._lastOutput),this._lastOutput=e,this._lastOutput.retain())}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,i=this.fboCache.acquire(t,r,y.OG.AMBIENT_ILLUMINATION).acquireColor(36065,2);return e.bindFramebuffer(i.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,b.v7),e.clearBuffer(1,b.uY),i}get _canRender(){const{reprojection:e,hasEmission:t,globalIllumination:r}=this.bindParameters;return!(!e.lastFrameColor||t&&!e.lastFrameEmission||!e.lastFrameDepth||!r)}get _mode(){return this._useGlobalIllumination?this.view.stage.renderer.isFeatureEnabled(10)?2:1:0}get test(){const e=this;return{get maxFrames(){return e._maxFrames},set maxFrames(t){e._maxFrames=t},get lowQualityResolutionScale(){return e._lowQualityResolutionScale},set lowQualityResolutionScale(t){e._lowQualityResolutionScale=t},passParameters:this._passParameters,configuration:this._configuration,get mode(){return e._mode},async restartAccumulation(){"disabled"!==e.produces&&(e._disable(),await(0,g.gh)(),e._enable())}}}};function B(e,t){t.receiveGlobalIllumination?(e.uniforms.add(new h.o("hasGlobalIlluminationTexture",e=>null!=e.globalIllumination),new m.x("globalIlluminationTexture",e=>e.globalIllumination?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1),e.code.add(n.H`vec3 readGlobalIlluminationOcclusionInverse() {
1076
+ }`)}var s=r(72233),l=r(65261),c=r(98619),u=r(22393),d=r(89786),h=r(32976),m=r(12791),p=r(32198),f=r(97768),v=r(36708),g=r(76030),x=r(91429),_=r(37585),b=r(91829),y=r(89904),w=r(99811),S=r(587),M=r(52516),T=r(13840),C=r(42958),I=r(90644);let E=class extends C.w{constructor(){super(...arguments),this.shader=new T.r(M.a,()=>r.e(2013).then(()=>r(42013)))}initializePipeline(){return(0,I.Ey)({colorWrite:I.kn})}};E=(0,p.Cg)([(0,x.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationBlurTechnique")],E);let O=class extends C.w{constructor(){super(...arguments),this.shader=new T.r(S.a,()=>r.e(9794).then(()=>r(89794)))}initializePipeline(){return(0,I.Ey)({colorWrite:I.kn})}};O=(0,p.Cg)([(0,x.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationTechnique")],O);var P=r(51976);class D extends P.K{constructor(){super(...arguments),this.hasColor=!0,this.hasEmission=!1,this.rayMarchMaxReach=.5,this.rayMarchMaxSteps=16,this.useProjectedRayLength=!0,this.clampRayToScreen=!1}}(0,p.Cg)([(0,P.W)()],D.prototype,"hasColor",void 0),(0,p.Cg)([(0,P.W)()],D.prototype,"hasEmission",void 0);var A=r(50704);let R=class extends C.w{constructor(){super(...arguments),this.shader=new T.r(A.a,()=>r.e(7891).then(()=>r(37891)))}initializePipeline(){return(0,I.Ey)({colorWrite:I.kn})}};R=(0,p.Cg)([(0,x.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationUpscaleTechnique")],R),r(63907);let F=class extends w.o{constructor(e){super(e),this._passParameters=new S.G,this._drawParameters=new M.G,this._drawParametersUpscale=new A.G,this._configuration=new D,this._lastOutput=null,this._isGlobalIlluminationUpdate=!1,this._lowQualityResolutionScale=.35,this._maxFrames=256}initialize(){this.addHandles((0,v.wB)(()=>this._mode,e=>{0===e?this._disable():this._enable()},v.pc))}destroy(){this._lastOutput=(0,f.Gz)(this._lastOutput)}_disable(){super._disable(),this._resetAccumulation(),this._passParameters.temporalSampleFrame=0}get hasHighQuality(){return 2===this._mode}resetAccumulation(){this._isGlobalIlluminationUpdate||!(this._passParameters.accumulatedFrames>100)&&this._configuration.hasEmission||this._resetAccumulation()}_resetAccumulation(){this._passParameters.accumulatedFrames=0,this._lastOutput=(0,f.Gz)(this._lastOutput)}get isAccumulating(){return this.enabled&&this._passParameters.accumulatedFrames<this._maxFrames}precompile(){this.techniques.getCompiled(R)}render(e){const t=1===this.bindParameters.frameRendererTarget;if(this._passParameters.accumulatedFrames>=this._maxFrames&&!t)return this._lastOutput?.retain(),this._lastOutput;const r=e.find(({name:e})=>"normals"===e),i=r?.getTexture(),n=r?.getTexture(33306);return i&&n?0===this._mode?this._emptyOutput:(this._configuration.hasEmission=!!this.bindParameters.reprojection.lastFrameEmission,t?this._renderScreenshot(i,n):this._renderInteractive(i,n)):this._emptyOutput}_renderScreenshot(e,t){let r=this._emptyOutput;const i=this._passParameters.accumulatedFrames,n=this._passParameters.temporalSampleFrame;this._passParameters.accumulatedFrames=0,this._passParameters.temporalSampleFrame=0;const o=this.techniques.get(O,this._configuration),a=this.techniques.get(E);for(;this._passParameters.accumulatedFrames<this._maxFrames;){this._passParameters.globalIllumination=r.getTexture(),this._passParameters.globalIlluminationWeights=r.getTexture(36065);const i=this._renderAccumulationFrame(e,t,o,a);++this._passParameters.accumulatedFrames,r.release(),r=i}return this._passParameters.globalIllumination=null,this._passParameters.globalIlluminationWeights=null,this._passParameters.accumulatedFrames=i,this._passParameters.temporalSampleFrame=n,r}_renderInteractive(e,t){if(!this._canRender)return this._requestRender(),this._emptyOutput;const r=1===this._mode?this._lowQualityResolutionScale:1,i=this.techniques.getCompiled(O,this._configuration),n=this.techniques.getCompiled(E),o=r<1,a=o?this.techniques.getCompiled(R):null;if(!i||!n||o&&!a)return this._requestRender(),this._emptyOutput;const s=this._renderAccumulationFrame(e,t,i,n,a,r);return++this._passParameters.accumulatedFrames,this._passParameters.accumulatedFrames<this._maxFrames&&this._requestRender(),this._storeOutput(s),s}_renderAccumulationFrame(e,t,r,i,n,o=1){const a=this.bindParameters,s=this.renderingContext,{camera:l}=a;this._passParameters.normalTexture=e,this._passParameters.depthTexture=t,this._passParameters.projScale=1/l.computeScreenPixelSizeAtDist(1),this._passParameters.resolutionScale=o;const{fullWidth:c,fullHeight:u}=l,d=Math.max(1,Math.floor(c*o)),h=Math.max(1,Math.floor(u*o)),m=this.fboCache.acquire(d,h,"global illumination input").acquireColor(36065,2);s.bindFramebuffer(m.fbo),s.setViewport(0,0,d,h),s.bindTechnique(r,a,this._passParameters,this._drawParameters),s.screen.draw();const p=Math.max(1,Math.round(d/1)),f=Math.max(1,Math.round(h/1)),v=this.fboCache.acquire(p,f,"global illumination blur horizontal");s.bindFramebuffer(v.fbo);const g=m.obtainAttachment(36065);this._drawParameters.texture=m.getTexture(),this._drawParameters.weightTexture=g.attachment,(0,_.hZ)(this._drawParameters.blurSize,0,1/h),s.bindTechnique(i,a,this._passParameters,this._drawParameters),s.setViewport(0,0,p,f),s.screen.draw(),m.release();const x=this.fboCache.acquire(p,f,n?"global illumination blur vertical":y.OG.AMBIENT_ILLUMINATION);s.bindFramebuffer(x.fbo),s.setViewport(0,0,p,f),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.texture=v.getTexture(),this._drawParameters.weightTexture=g.attachment,(0,_.hZ)(this._drawParameters.blurSize,1/p,0),s.bindTechnique(i,a,this._passParameters,this._drawParameters),s.setViewport(0,0,p,f),s.screen.draw(),v.release(),x.attachColor(g,36065),g.release();let b=x;return n&&(b=this.fboCache.acquire(c,u,y.OG.AMBIENT_ILLUMINATION).acquireColor(36065,2),s.bindFramebuffer(b.fbo),s.setViewport(0,0,c,u),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParametersUpscale.colorTexture=x.getTexture(),this._drawParametersUpscale.weightTexture=x.getTexture(36065),s.bindTechnique(n,a,this._passParameters,this._drawParametersUpscale),s.screen.draw(),x.release()),s.setViewport4fv(l.fullViewport),this._passParameters.temporalSampleFrame=(this._passParameters.temporalSampleFrame+1)%64,b}_requestRender(){this._isGlobalIlluminationUpdate=!0,this.requestRender(1),this._isGlobalIlluminationUpdate=!1}_storeOutput(e){this._lastOutput!==e&&(this._lastOutput=(0,f.Gz)(this._lastOutput),this._lastOutput=e,this._lastOutput.retain())}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,i=this.fboCache.acquire(t,r,y.OG.AMBIENT_ILLUMINATION).acquireColor(36065,2);return e.bindFramebuffer(i.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,b.v7),e.clearBuffer(1,b.uY),i}get _canRender(){const{reprojection:e,hasEmission:t,globalIllumination:r}=this.bindParameters;return!(!e.lastFrameColor||t&&!e.lastFrameEmission||!e.lastFrameDepth||!r)}get _mode(){return this._useGlobalIllumination?this.view.stage.renderer.isFeatureEnabled(10)?2:1:0}get test(){const e=this;return{get maxFrames(){return e._maxFrames},set maxFrames(t){e._maxFrames=t},get lowQualityResolutionScale(){return e._lowQualityResolutionScale},set lowQualityResolutionScale(t){e._lowQualityResolutionScale=t},passParameters:this._passParameters,configuration:this._configuration,get mode(){return e._mode},async restartAccumulation(){"disabled"!==e.produces&&(e._disable(),await(0,g.gh)(),e._enable())}}}};function B(e,t){t.receiveGlobalIllumination?(e.uniforms.add(new h.o("hasGlobalIlluminationTexture",e=>null!=e.globalIllumination),new m.x("globalIlluminationTexture",e=>e.globalIllumination?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1),e.code.add(o.H`vec3 readGlobalIlluminationOcclusionInverse() {
1077
1077
  if (!hasGlobalIlluminationTexture) {
1078
1078
  return vec3(1.0);
1079
1079
  }
@@ -1092,41 +1092,41 @@ return 1.0 - vec4(texelFetch(globalIlluminationTexture, texel, 0).rgb, 0.0);
1092
1092
  }
1093
1093
  vec4 readGlobalIlluminationEmission() {
1094
1094
  return max((1.0 - readGlobalIlluminationEmissionInverse() - 0.01) / 0.99, 0.0);
1095
- }`)):e.code.add(n.H`vec3 readGlobalIlluminationOcclusionInverse() { return vec3(1.0); }
1095
+ }`)):e.code.add(o.H`vec3 readGlobalIlluminationOcclusionInverse() { return vec3(1.0); }
1096
1096
  vec3 readGlobalIlluminationOcclusion() { return vec3(0.0); }
1097
1097
  vec4 readGlobalIlluminationEmissionInverse() { return vec4(1.0); }
1098
- vec4 readGlobalIlluminationEmission() { return vec4(0.0); }`)}R=(0,p.Cg)([(0,x.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],R);var N=r(33094),z=(r(34727),r(35522),r(51850));const j={create:()=>[0,0,0,0,0,0,0,0,0],copy(e,t){e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8]}};function H(e){e.code.add(n.H`float mapChannel(float x, vec2 p) {
1098
+ vec4 readGlobalIlluminationEmission() { return vec4(0.0); }`)}F=(0,p.Cg)([(0,x.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],F);var N=r(33094),z=(r(34727),r(35522),r(51850));const j={create:()=>[0,0,0,0,0,0,0,0,0],copy(e,t){e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8]}};function H(e){e.code.add(o.H`float mapChannel(float x, vec2 p) {
1099
1099
  if((x < p.x) && (p.x == 0.0) || !(x < p.x) && (p.x == 1.0)) {
1100
1100
  return 0.0;
1101
1101
  }
1102
1102
  float result = (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
1103
1103
  return max(result, 0.0);
1104
- }`),e.code.add(n.H`vec3 blackLevelSoftCompression(vec3 color, float averageAmbientRadiance) {
1104
+ }`),e.code.add(o.H`vec3 blackLevelSoftCompression(vec3 color, float averageAmbientRadiance) {
1105
1105
  vec2 p = vec2(0.02, 0.0075) * averageAmbientRadiance;
1106
1106
  return vec3(mapChannel(color.x, p), mapChannel(color.y, p), mapChannel(color.z, p));
1107
- }`)}j.create(),j.create(),(0,z.vt)(),(0,z.vt)();var L=r(18519);function W(e){e.constants.add("ambientBoostFactor","float",.4)}function V(e){e.uniforms.add(new N.U("lightingGlobalFactor",e=>e.lighting.globalFactor))}function U(e,t){const{pbrMode:r,spherical:i,hasColorTexture:o,receiveGlobalIllumination:m}=t;e.include(l.C),e.include(B,t),e.include(s.n,t),0!==r&&e.include(u.c,t),e.include(a,t),e.include(d.p),e.include(L.b,t);const p=!(2===r&&!o);p&&e.include(H),W(e),V(e),e.uniforms.add(c.t_).code.add(n.H`
1107
+ }`)}j.create(),j.create(),(0,z.vt)(),(0,z.vt)();var L=r(18519);function W(e){e.constants.add("ambientBoostFactor","float",.4)}function V(e){e.uniforms.add(new N.U("lightingGlobalFactor",e=>e.lighting.globalFactor))}function U(e,t){const{pbrMode:r,spherical:i,hasColorTexture:n,receiveGlobalIllumination:m}=t;e.include(l.C),e.include(B,t),e.include(s.n,t),0!==r&&e.include(u.c,t),e.include(a,t),e.include(d.p),e.include(L.b,t);const p=!(2===r&&!n);p&&e.include(H),W(e),V(e),e.uniforms.add(c.t_).code.add(o.H`
1108
1108
  float additionalDirectedAmbientLight(float lightAlignment) {
1109
1109
  return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
1110
1110
  }
1111
1111
 
1112
1112
  float additionalDirectedAmbientLight(vec3 vPosWorld) {
1113
- float lightAlignment = dot(${i?n.H`normalize(vPosWorld)`:n.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
1113
+ float lightAlignment = dot(${i?o.H`normalize(vPosWorld)`:o.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
1114
1114
  return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
1115
1115
  }
1116
- `),e.uniforms.add(c.VK).code.add(n.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
1116
+ `),e.uniforms.add(c.VK).code.add(o.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
1117
1117
  float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
1118
1118
  return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
1119
- }`);const f=m?"globalIlluminationOcclusion":"ssao";switch(e.constants.add("mainLightIrradianceScale","float",m?.75:1),e.constants.add("ambientIrradianceScale","float",m?1.5:1),m&&(e.constants.add("globalIlluminationEmissionCompressionWeight","float",.75),e.code.add(n.H`vec3 evaluateGlobalIlluminationOcclusion() {
1119
+ }`);const f=m?"globalIlluminationOcclusion":"ssao";switch(e.constants.add("mainLightIrradianceScale","float",m?.75:1),e.constants.add("ambientIrradianceScale","float",m?1.5:1),m&&(e.constants.add("globalIlluminationEmissionCompressionWeight","float",.75),e.code.add(o.H`vec3 evaluateGlobalIlluminationOcclusion() {
1120
1120
  return min(1.2 * readGlobalIlluminationOcclusion(), 1.0);
1121
1121
  }
1122
1122
  vec3 evaluateGlobalIlluminationEmission(vec3 albedoLinear) {
1123
1123
  vec3 emission = 2.25 * (0.75 * albedoLinear + 0.25) * readGlobalIlluminationEmission().rgb;
1124
1124
  vec3 compressedEmission = emission / (emission + 1.0);
1125
1125
  return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWeight);
1126
- }`)),r){case 0:case 4:case 3:e.include(c.Vt),e.code.add(n.H`
1126
+ }`)),r){case 0:case 4:case 3:e.include(c.Vt),e.code.add(o.H`
1127
1127
  vec3 evaluateSceneLighting(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
1128
1128
  vec3 viewDirection, vec3 upDirection) {
1129
- ${(0,n.If)(m,n.H`vec3 globalIlluminationOcclusion = evaluateGlobalIlluminationOcclusion();`)}
1129
+ ${(0,o.If)(m,o.H`vec3 globalIlluminationOcclusion = evaluateGlobalIlluminationOcclusion();`)}
1130
1130
 
1131
1131
  vec3 mainLighting = mainLightIrradianceScale * applyShading(normal, shadow);
1132
1132
  vec3 ambientLighting = ambientIrradianceScale * calculateAmbientIrradiance(normal) * (1.0 - ${f});
@@ -1135,10 +1135,10 @@ return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWe
1135
1135
  vec3 totalLight = mainLighting + ambientLighting + additionalLight;
1136
1136
  totalLight = min(totalLight, vec3(PI));
1137
1137
  vec3 linearColor = vec3((albedoLinear / PI) * totalLight);
1138
- ${(0,n.If)(m,"linearColor += evaluateGlobalIlluminationEmission(albedoLinear);")}
1138
+ ${(0,o.If)(m,"linearColor += evaluateGlobalIlluminationEmission(albedoLinear);")}
1139
1139
  return delinearizeGamma(linearColor);
1140
1140
  }
1141
- `);break;case 1:case 2:e.constants.add("groundReflectance","float",m?.35:.2),e.code.add(n.H`
1141
+ `);break;case 1:case 2:e.constants.add("groundReflectance","float",m?.35:.2),e.code.add(o.H`
1142
1142
  const float fillLightIntensity = 0.25;
1143
1143
  const float horizonLightDiffusion = 0.4;
1144
1144
 
@@ -1146,8 +1146,8 @@ return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWe
1146
1146
  vec3 viewDirection, vec3 upDirection) {
1147
1147
  PBRShadingInfo inputs;
1148
1148
  calculatePBRInputs(inputs, normal, viewDirection, upDirection, albedo);
1149
- ${(0,n.If)(m,"vec3 globalIlluminationOcclusion = evaluateGlobalIlluminationOcclusion();")}
1150
- `),t.useFillLights?e.uniforms.add(new h.o("hasFillLights",e=>e.enableFillLights)):e.constants.add("hasFillLights","bool",!1),e.code.add(n.H`
1149
+ ${(0,o.If)(m,"vec3 globalIlluminationOcclusion = evaluateGlobalIlluminationOcclusion();")}
1150
+ `),t.useFillLights?e.uniforms.add(new h.o("hasFillLights",e=>e.enableFillLights)):e.constants.add("hasFillLights","bool",!1),e.code.add(o.H`
1151
1151
  vec3 ambientDir = vec3(5.0 * upDirection[1] - upDirection[0] * upDirection[2], - 5.0 * upDirection[0] - upDirection[2] * upDirection[1], upDirection[1] * upDirection[1] + upDirection[0] * upDirection[0]);
1152
1152
  ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
1153
1153
 
@@ -1163,7 +1163,7 @@ return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWe
1163
1163
  inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
1164
1164
  // Assemble the overall irradiance of the ground that illuminates the surface. for this we use the simple model that changes only the sky irradiance by the groundReflectance
1165
1165
  inputs.groundIrradianceToSurface = groundReflectance * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
1166
- `),e.uniforms.add(new N.U("lightingSpecularStrength",e=>e.lighting.mainLight.specularStrength),new N.U("lightingEnvironmentStrength",e=>e.lighting.mainLight.environmentStrength)).code.add(n.H`
1166
+ `),e.uniforms.add(new N.U("lightingSpecularStrength",e=>e.lighting.mainLight.specularStrength),new N.U("lightingEnvironmentStrength",e=>e.lighting.mainLight.environmentStrength)).code.add(o.H`
1167
1167
  vec3 horizonRingDir = inputs.RdotUP * upDirection - inputs.reflectedView;
1168
1168
  vec3 horizonRingH = normalize(horizonRingDir - viewDirection);
1169
1169
  inputs.NdotH_Horizon = dot(normal, horizonRingH);
@@ -1183,19 +1183,19 @@ return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWe
1183
1183
 
1184
1184
  // Calculate average ambient radiance - This is used in the gamut mapping process to determine the black level for compression
1185
1185
  inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + groundReflectance);
1186
- `),e.constants.add("additionalAmbientIrradianceFactor","float",.02),e.code.add(n.H`
1186
+ `),e.constants.add("additionalAmbientIrradianceFactor","float",.02),e.code.add(o.H`
1187
1187
  vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
1188
1188
  float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
1189
1189
  vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
1190
1190
  vec3 linearColor = reflectedColorComponent + additionalMaterialReflectanceComponent;
1191
1191
 
1192
- ${(0,n.If)(m,"linearColor += evaluateGlobalIlluminationEmission(inputs.albedoLinear);")}
1192
+ ${(0,o.If)(m,"linearColor += evaluateGlobalIlluminationEmission(inputs.albedoLinear);")}
1193
1193
 
1194
1194
  ${p?"linearColor = blackLevelSoftCompression(linearColor, inputs.averageAmbientRadiance);":"linearColor = max(vec3(0.0), linearColor - 0.005 * inputs.averageAmbientRadiance);"}
1195
1195
 
1196
1196
  return delinearizeGamma(linearColor);
1197
1197
  }
1198
- `);break;case 5:case 6:e.constants.add("terrainSpecularity","float",m?.35:.5),e.uniforms.add(c.t_,c.VK).code.add(n.H`
1198
+ `);break;case 5:case 6:e.constants.add("terrainSpecularity","float",m?.35:.5),e.uniforms.add(c.t_,c.VK).code.add(o.H`
1199
1199
  const float roughnessTerrain = 0.5;
1200
1200
 
1201
1201
  vec3 evaluateSceneLighting(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
@@ -1203,7 +1203,7 @@ return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWe
1203
1203
  PBRShadingInfo inputs;
1204
1204
  calculateSimplifiedInputs(inputs, normal, viewDirection, upDirection, albedo);
1205
1205
 
1206
- ${(0,n.If)(m,"vec3 globalIlluminationOcclusion = evaluateGlobalIlluminationOcclusion();")}
1206
+ ${(0,o.If)(m,"vec3 globalIlluminationOcclusion = evaluateGlobalIlluminationOcclusion();")}
1207
1207
 
1208
1208
  vec3 mainLightIrradianceComponent = mainLightIrradianceScale * (1.0 - shadow) * inputs.NdotL * mainLightIntensity;
1209
1209
  vec3 ambientLightIrradianceComponent = ambientIrradianceScale * calculateAmbientIrradiance(normal) * (1.0 - ${f}) + additionalLight;
@@ -1219,14 +1219,14 @@ return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWe
1219
1219
 
1220
1220
  vec3 linearColor = diffuseColor + specularComponent;
1221
1221
 
1222
- ${(0,n.If)(m,"linearColor += evaluateGlobalIlluminationEmission(inputs.albedoLinear);")}
1222
+ ${(0,o.If)(m,"linearColor += evaluateGlobalIlluminationEmission(inputs.albedoLinear);")}
1223
1223
 
1224
1224
  return delinearizeGamma(linearColor);
1225
1225
  }
1226
- `);break;case 7:e.code.add(n.H`vec3 evaluateSceneLighting(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
1226
+ `);break;case 7:e.code.add(o.H`vec3 evaluateSceneLighting(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
1227
1227
  vec3 viewDirection, vec3 upDirection) {
1228
1228
  return albedo;
1229
- }`)}}},65261(e,t,r){r.d(t,{C:()=>n});var i=r(40876),o=r(31821);function n(e){e.constants.add("GAMMA","float",2.2).constants.add("INV_GAMMA","float",i.iw).code.add(o.H`vec3 delinearizeGamma(vec3 color) {
1229
+ }`)}}},65261(e,t,r){r.d(t,{C:()=>o});var i=r(40876),n=r(31821);function o(e){e.constants.add("GAMMA","float",2.2).constants.add("INV_GAMMA","float",i.iw).code.add(n.H`vec3 delinearizeGamma(vec3 color) {
1230
1230
  return pow(color, vec3(INV_GAMMA));
1231
1231
  }
1232
1232
  vec4 delinearizeGamma(vec4 color) {
@@ -1234,7 +1234,7 @@ return vec4(delinearizeGamma(color.rgb), color.a);
1234
1234
  }
1235
1235
  vec3 linearizeGamma(vec3 color) {
1236
1236
  return pow(color, vec3(GAMMA));
1237
- }`)}},72885(e,t,r){r.d(t,{Q:()=>o});var i=r(31821);function o(e){e.fragment.code.add(i.H`
1237
+ }`)}},72885(e,t,r){r.d(t,{Q:()=>n});var i=r(31821);function n(e){e.fragment.code.add(i.H`
1238
1238
  float globalIlluminationNormalSimilarityWeight(vec3 sampleNormal, vec3 centerNormal) {
1239
1239
  return clamp(1.0 - ${i.H.float(15.3)} * length(sampleNormal - centerNormal), 0.0, 1.0);
1240
1240
  }
@@ -1251,10 +1251,10 @@ return pow(color, vec3(GAMMA));
1251
1251
  float globalIlluminationDepthSharpness(float projScale, float depth, vec3 encodedNormal) {
1252
1252
  return globalIlluminationDepthSharpness(projScale, depth) * globalIlluminationDepthNormalCorrection(encodedNormal);
1253
1253
  }
1254
- `)}},98619(e,t,r){r.d(t,{Vt:()=>s});var i=r(23205),o=r(31821);const n=new i.d("mainLightDirection",e=>e.lighting.mainLight.direction),a=new i.d("mainLightIntensity",e=>e.lighting.mainLight.intensity);function s(e){e.uniforms.add(n,a),e.code.add(o.H`vec3 applyShading(vec3 shadingNormal, float shadow) {
1254
+ `)}},98619(e,t,r){r.d(t,{Vt:()=>s});var i=r(23205),n=r(31821);const o=new i.d("mainLightDirection",e=>e.lighting.mainLight.direction),a=new i.d("mainLightIntensity",e=>e.lighting.mainLight.intensity);function s(e){e.uniforms.add(o,a),e.code.add(n.H`vec3 applyShading(vec3 shadingNormal, float shadow) {
1255
1255
  float dotVal = clamp(dot(shadingNormal, mainLightDirection), 0.0, 1.0);
1256
1256
  return mainLightIntensity * ((1.0 - shadow) * dotVal);
1257
- }`)}r.d(t,["VK",0,a,"t_",0,n])},20598(e,t,r){r.d(t,{n:()=>o});var i=r(31821);function o(e,{spherical:t}){e.code.add("vec3 normalize4(vec4 vector){ return normalize(vector.xyz / vector.w); }"),e.code.add(t?"vec3 getLocalUp(in vec3 pos, in vec3 origin) { return normalize(pos + origin); }\n vec3 getLocalUp(in vec3 pos) { return normalize(pos); }":"vec3 getLocalUp(in vec3 pos, in vec3 origin) { return vec3(0.0, 0.0, 1.0); }\n vec3 getLocalUp(in vec3 pos) { return vec3(0.0, 0.0, 1.0); }"),t?e.code.add(i.H`mat3 getTBNMatrix(in vec3 n) {
1257
+ }`)}r.d(t,["VK",0,a,"t_",0,o])},20598(e,t,r){r.d(t,{n:()=>n});var i=r(31821);function n(e,{spherical:t}){e.code.add("vec3 normalize4(vec4 vector){ return normalize(vector.xyz / vector.w); }"),e.code.add(t?"vec3 getLocalUp(in vec3 pos, in vec3 origin) { return normalize(pos + origin); }\n vec3 getLocalUp(in vec3 pos) { return normalize(pos); }":"vec3 getLocalUp(in vec3 pos, in vec3 origin) { return vec3(0.0, 0.0, 1.0); }\n vec3 getLocalUp(in vec3 pos) { return vec3(0.0, 0.0, 1.0); }"),t?e.code.add(i.H`mat3 getTBNMatrix(in vec3 n) {
1258
1258
  vec3 t = normalize(cross(vec3(0.0, 0.0, 1.0), n));
1259
1259
  vec3 b = normalize(cross(n, t));
1260
1260
  return mat3(t, b, n);
@@ -1262,11 +1262,11 @@ return mat3(t, b, n);
1262
1262
  vec3 t = vec3(1.0, 0.0, 0.0);
1263
1263
  vec3 b = normalize(cross(n, t));
1264
1264
  return mat3(t, b, n);
1265
- }`)}},62602(e,t,r){r.d(t,{r:()=>o});var i=r(31821);function o(e,t){const r=e.fragment;switch(t.doubleSidedMode){case 0:r.code.add("vec3 shadingNormal(vec3 normalView, vec3 viewDirection) { return normalize(normalView); }");break;case 1:r.code.add(i.H`vec3 shadingNormal(vec3 normalView, vec3 viewDirection) {
1265
+ }`)}},62602(e,t,r){r.d(t,{r:()=>n});var i=r(31821);function n(e,t){const r=e.fragment;switch(t.doubleSidedMode){case 0:r.code.add("vec3 shadingNormal(vec3 normalView, vec3 viewDirection) { return normalize(normalView); }");break;case 1:r.code.add(i.H`vec3 shadingNormal(vec3 normalView, vec3 viewDirection) {
1266
1266
  return dot(normalView, viewDirection) > 0.0 ? normalize(-normalView) : normalize(normalView);
1267
1267
  }`);break;case 2:r.code.add(i.H`vec3 shadingNormal(vec3 normalView, vec3 viewDirection) {
1268
1268
  return gl_FrontFacing ? normalize(normalView) : normalize(-normalView);
1269
- }`);break;default:t.doubleSidedMode;case 3:}}},22393(e,t,r){r.d(t,{c:()=>c});var i=r(31821);function o(e){e.code.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
1269
+ }`);break;default:t.doubleSidedMode;case 3:}}},22393(e,t,r){r.d(t,{c:()=>c});var i=r(31821);function n(e){e.code.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
1270
1270
  return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
1271
1271
  }`),e.code.add(i.H`float integratedRadiance(float cosTheta2, float roughness) {
1272
1272
  return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
@@ -1276,7 +1276,7 @@ float intRadTheta = integratedRadiance(cosTheta2, roughness);
1276
1276
  float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
1277
1277
  float sky = 2.0 - ground;
1278
1278
  return (ground * ambientGround + sky * ambientSky) * 0.5;
1279
- }`)}var n=r(65261),a=r(23292),s=r(48806),l=r(89786);function c(e,t){e.include(n.C),e.include(l.p),e.include(s.f),e.include(a.d),1!==t.pbrMode&&2!==t.pbrMode&&5!==t.pbrMode&&6!==t.pbrMode||(e.code.add(i.H`float normalDistribution(float NdotH, float roughness)
1279
+ }`)}var o=r(65261),a=r(23292),s=r(48806),l=r(89786);function c(e,t){e.include(o.C),e.include(l.p),e.include(s.f),e.include(a.d),1!==t.pbrMode&&2!==t.pbrMode&&5!==t.pbrMode&&6!==t.pbrMode||(e.code.add(i.H`float normalDistribution(float NdotH, float roughness)
1280
1280
  {
1281
1281
  float a = NdotH * roughness;
1282
1282
  float b = roughness / (1.0 - NdotH * NdotH + a * a);
@@ -1288,7 +1288,7 @@ vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
1288
1288
  vec4 r = roughness * c0 + c1;
1289
1289
  float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
1290
1290
  return c2 * a004 + r.zw;
1291
- }`)),1!==t.pbrMode&&2!==t.pbrMode||(e.include(o),e.code.add(i.H`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
1291
+ }`)),1!==t.pbrMode&&2!==t.pbrMode||(e.include(n),e.code.add(i.H`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
1292
1292
  vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotUP);
1293
1293
  vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotUP, inputs.roughness);
1294
1294
  vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;
@@ -1302,10 +1302,10 @@ calculateCommonInputs(inputs, normal, viewDirection, upDirection, albedo);
1302
1302
  float lightness = 0.3 * inputs.albedoLinear[0] + 0.5 * inputs.albedoLinear[1] + 0.2 * inputs.albedoLinear[2];
1303
1303
  inputs.f0 = (0.85 * lightness + 0.15) * fresnelReflectionSimplified;
1304
1304
  inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
1305
- }`)}},59469(e,t,r){r.d(t,{_Z:()=>h});var i=r(99208),o=r(23292),n=r(40710),a=r(33079),s=r(31821),l=r(15976),c=r(63761),u=r(51976),d=(r(74810),r(65786));function h(e,t){const r=t.pbrMode,u=e.fragment;switch(r){case 5:case 3:case 4:case 6:return void u.code.add(s.H`void applyPBRFactors() {}`);case 0:case 7:return void u.code.add(s.H`void applyPBRFactors() {}
1305
+ }`)}},59469(e,t,r){r.d(t,{_Z:()=>h});var i=r(99208),n=r(23292),o=r(40710),a=r(33079),s=r(31821),l=r(15976),c=r(63761),u=r(51976),d=(r(74810),r(65786));function h(e,t){const r=t.pbrMode,u=e.fragment;switch(r){case 5:case 3:case 4:case 6:return void u.code.add(s.H`void applyPBRFactors() {}`);case 0:case 7:return void u.code.add(s.H`void applyPBRFactors() {}
1306
1306
  float getBakedOcclusion() { return 1.0; }`);case 2:return void u.code.add(s.H`float occlusion = 1.0;
1307
1307
  void applyPBRFactors() {}
1308
- float getBakedOcclusion() { return 1.0; }`);case 1:{const{hasMetallicRoughnessTexture:r,hasMetallicRoughnessTextureTransform:d,hasOcclusionTexture:h,hasOcclusionTextureTransform:m,bindType:p}=t;(r||h)&&e.include(i.r,t),u.code.add("float occlusion;"),r&&u.uniforms.add(1===p?new c.N("texMetallicRoughness",e=>e.textureMetallicRoughness):new l.o("texMetallicRoughness",e=>e.textureMetallicRoughness)),h&&u.uniforms.add(1===p?new c.N("texOcclusion",e=>e.textureOcclusion):new l.o("texOcclusion",e=>e.textureOcclusion)),u.uniforms.add(1===p?new a.t("mrrFactors",e=>e.mrrFactors):new n.W("mrrFactors",e=>e.mrrFactors)),u.include(o.d),r&&u.code.add(s.H`void applyMetallicRoughness(vec2 uv) {
1308
+ float getBakedOcclusion() { return 1.0; }`);case 1:{const{hasMetallicRoughnessTexture:r,hasMetallicRoughnessTextureTransform:d,hasOcclusionTexture:h,hasOcclusionTextureTransform:m,bindType:p}=t;(r||h)&&e.include(i.r,t),u.code.add("float occlusion;"),r&&u.uniforms.add(1===p?new c.N("texMetallicRoughness",e=>e.textureMetallicRoughness):new l.o("texMetallicRoughness",e=>e.textureMetallicRoughness)),h&&u.uniforms.add(1===p?new c.N("texOcclusion",e=>e.textureOcclusion):new l.o("texOcclusion",e=>e.textureOcclusion)),u.uniforms.add(1===p?new a.t("mrrFactors",e=>e.mrrFactors):new o.W("mrrFactors",e=>e.mrrFactors)),u.include(n.d),r&&u.code.add(s.H`void applyMetallicRoughness(vec2 uv) {
1309
1309
  vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
1310
1310
  mrr[0] *= metallicRoughness.b;
1311
1311
  mrr[1] *= metallicRoughness.g;
@@ -1320,7 +1320,7 @@ mrr[1] *= metallicRoughness.g;
1320
1320
 
1321
1321
  ${(0,s.If)(r,`applyMetallicRoughness(${d?"metallicRoughnessUV":"vuv0"});`)}
1322
1322
  ${(0,s.If)(h,`applyOcclusion(${m?"occlusionUV":"vuv0"});`)}
1323
- }`)}}}u.K,d.Y},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("ONE_QUATER_PI","float",.78539816339745),e.constants.add("HALF_PI","float",1.570796326794897),e.constants.add("THREE_QUATER_PI","float",2.35619449019234),e.constants.add("TWO_PI","float",6.28318530717958),e.constants.add("PI_SQUARED","float",9.86960440108936)}r.d(t,{p:()=>i})},70893(e,t,r){r.d(t,{O:()=>c});var i=r(52540),o=r(45324),n=r(33094),a=r(31821),s=r(58029),l=r(12791);function c(e,t){const r=e.fragment;r.include(i.E),r.uniforms.add(o.rS,o.Y$,new l.x("depthMap",e=>e.depth?.attachment),new n.U("invResolutionHeight",e=>1/e.camera.height),new s.F("reprojectionMatrix",e=>e.reprojection.matrix)).code.add(a.H`
1323
+ }`)}}}u.K,d.Y},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("ONE_QUATER_PI","float",.78539816339745),e.constants.add("HALF_PI","float",1.570796326794897),e.constants.add("THREE_QUATER_PI","float",2.35619449019234),e.constants.add("TWO_PI","float",6.28318530717958),e.constants.add("PI_SQUARED","float",9.86960440108936)}r.d(t,{p:()=>i})},70893(e,t,r){r.d(t,{O:()=>c});var i=r(52540),n=r(45324),o=r(33094),a=r(31821),s=r(58029),l=r(12791);function c(e,t){const r=e.fragment;r.include(i.E),r.uniforms.add(n.rS,n.Y$,new l.x("depthMap",e=>e.depth?.attachment),new o.U("invResolutionHeight",e=>1/e.camera.height),new s.F("reprojectionMatrix",e=>e.reprojection.matrix)).code.add(a.H`
1324
1324
  vec2 reprojectionCoordinate(vec3 projectionCoordinate) {
1325
1325
  vec4 clipDepthCoordinate = proj * vec4(0.0, 0.0, -projectionCoordinate.z, 1.0);
1326
1326
  vec4 reprojectedCoordinate = reprojectionMatrix * vec4(
@@ -1499,17 +1499,17 @@ mrr[1] *= metallicRoughness.g;
1499
1499
  ${a.H.float(t.rayMarchMaxSteps)}
1500
1500
  );
1501
1501
  }
1502
- `)}},51406(e,t,r){r.d(t,{MU:()=>l,O1:()=>c,QM:()=>u,Sx:()=>s,q2:()=>a});var i=r(29242),o=r(31821),n=r(35644);function a(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new n.k("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??i.zK)).code.add(o.H`void forwardColorUV(){
1502
+ `)}},51406(e,t,r){r.d(t,{MU:()=>l,O1:()=>c,QM:()=>u,Sx:()=>s,q2:()=>a});var i=r(29242),n=r(31821),o=r(35644);function a(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new o.k("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??i.zK)).code.add(n.H`void forwardColorUV(){
1503
1503
  colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
1504
- }`)):e.vertex.code.add(o.H`void forwardColorUV(){}`)}function s(e,t){t.hasNormalTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new n.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK)).code.add(o.H`void forwardNormalUV(){
1504
+ }`)):e.vertex.code.add(n.H`void forwardColorUV(){}`)}function s(e,t){t.hasNormalTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new o.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK)).code.add(n.H`void forwardNormalUV(){
1505
1505
  normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
1506
- }`)):e.vertex.code.add(o.H`void forwardNormalUV(){}`)}function l(e,t){t.hasEmissionTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("emissiveUV","vec2"),e.vertex.uniforms.add(new n.k("emissiveTextureTransformMatrix",e=>e.emissiveTextureTransformMatrix??i.zK)).code.add(o.H`void forwardEmissiveUV(){
1506
+ }`)):e.vertex.code.add(n.H`void forwardNormalUV(){}`)}function l(e,t){t.hasEmissionTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("emissiveUV","vec2"),e.vertex.uniforms.add(new o.k("emissiveTextureTransformMatrix",e=>e.emissiveTextureTransformMatrix??i.zK)).code.add(n.H`void forwardEmissiveUV(){
1507
1507
  emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
1508
- }`)):e.vertex.code.add(o.H`void forwardEmissiveUV(){}`)}function c(e,t){t.hasOcclusionTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("occlusionUV","vec2"),e.vertex.uniforms.add(new n.k("occlusionTextureTransformMatrix",e=>e.occlusionTextureTransformMatrix??i.zK)).code.add(o.H`void forwardOcclusionUV(){
1508
+ }`)):e.vertex.code.add(n.H`void forwardEmissiveUV(){}`)}function c(e,t){t.hasOcclusionTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("occlusionUV","vec2"),e.vertex.uniforms.add(new o.k("occlusionTextureTransformMatrix",e=>e.occlusionTextureTransformMatrix??i.zK)).code.add(n.H`void forwardOcclusionUV(){
1509
1509
  occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
1510
- }`)):e.vertex.code.add(o.H`void forwardOcclusionUV(){}`)}function u(e,t){t.hasMetallicRoughnessTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.uniforms.add(new n.k("metallicRoughnessTextureTransformMatrix",e=>e.metallicRoughnessTextureTransformMatrix??i.zK)).code.add(o.H`void forwardMetallicRoughnessUV(){
1510
+ }`)):e.vertex.code.add(n.H`void forwardOcclusionUV(){}`)}function u(e,t){t.hasMetallicRoughnessTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.uniforms.add(new o.k("metallicRoughnessTextureTransformMatrix",e=>e.metallicRoughnessTextureTransformMatrix??i.zK)).code.add(n.H`void forwardMetallicRoughnessUV(){
1511
1511
  metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
1512
- }`)):e.vertex.code.add(o.H`void forwardMetallicRoughnessUV(){}`)}},89435(e,t,r){r.d(t,{A:()=>h});var i=r(43519),o=r(33079),n=r(71988),a=r(74333);class s extends a.n{constructor(e,t,r,i){super(e,"vec4",1,(t,o,n)=>t.setUniform4fv(e,r(o,n),i),t)}}class l extends a.n{constructor(e,t,r,i){super(e,"float",1,(t,o,n)=>t.setUniform1fv(e,r(o,n),i),t)}}var c=r(31821),u=r(35644),d=r(46606);function h(e,t){const{vertex:r,attributes:a}=e;t.hasVVInstancing&&(t.hasVVSize||t.hasVVColor)&&a.add("instanceFeatureAttribute","vec4"),t.hasVVSize?(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.vvSize.symbolRotationMatrix)),r.uniforms.add(new o.t("vvSymbolAnchor",e=>e.vvSize.symbolAnchor)),r.code.add(c.H`vec3 vvScale(vec4 _featureAttribute) {
1512
+ }`)):e.vertex.code.add(n.H`void forwardMetallicRoughnessUV(){}`)}},89435(e,t,r){r.d(t,{A:()=>h});var i=r(43519),n=r(33079),o=r(71988),a=r(74333);class s extends a.n{constructor(e,t,r,i){super(e,"vec4",1,(t,n,o)=>t.setUniform4fv(e,r(n,o),i),t)}}class l extends a.n{constructor(e,t,r,i){super(e,"float",1,(t,n,o)=>t.setUniform1fv(e,r(n,o),i),t)}}var c=r(31821),u=r(35644),d=r(46606);function h(e,t){const{vertex:r,attributes:a}=e;t.hasVVInstancing&&(t.hasVVSize||t.hasVVColor)&&a.add("instanceFeatureAttribute","vec4"),t.hasVVSize?(r.uniforms.add(new n.t("vvSizeMinSize",e=>e.vvSize.minSize)),r.uniforms.add(new n.t("vvSizeMaxSize",e=>e.vvSize.maxSize)),r.uniforms.add(new n.t("vvSizeOffset",e=>e.vvSize.offset)),r.uniforms.add(new n.t("vvSizeFactor",e=>e.vvSize.factor)),r.uniforms.add(new n.t("vvSizeFallback",e=>e.vvSize.fallback)),r.uniforms.add(new u.k("vvSymbolRotationMatrix",e=>e.vvSize.symbolRotationMatrix)),r.uniforms.add(new n.t("vvSymbolAnchor",e=>e.vvSize.symbolAnchor)),r.code.add(c.H`vec3 vvScale(vec4 _featureAttribute) {
1513
1513
  if (isnan(_featureAttribute.x)) {
1514
1514
  return vvSizeFallback;
1515
1515
  }
@@ -1535,7 +1535,7 @@ return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position +
1535
1535
  `)):r.code.add(c.H`
1536
1536
  vec4 localPosition() { return vec4(${r.inputs.get("position")}, 1.0); }
1537
1537
  vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }
1538
- `),e.vertex.include(i.WD),t.hasVVColor?(r.constants.add("vvColorNumber","int",d.p),r.uniforms.add(new l("vvColorValues",d.p,e=>e.vvColor.values),new s("vvColorColors",d.p,e=>e.vvColor.colors),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(c.H`
1538
+ `),e.vertex.include(i.WD),t.hasVVColor?(r.constants.add("vvColorNumber","int",d.p),r.uniforms.add(new l("vvColorValues",d.p,e=>e.vvColor.values),new s("vvColorColors",d.p,e=>e.vvColor.colors),new o.E("vvColorFallback",e=>e.vvColor.fallback,{supportsNaN:!0})),t.hasVVInstancing&&(e.vertex.include(i.ML),e.vertex.include(i.oF)),r.code.add(c.H`
1539
1539
  vec4 interpolateVVColor(float value) {
1540
1540
  if (isnan(value)) {
1541
1541
  return vvColorFallback;
@@ -1580,7 +1580,7 @@ return vec4(1.0);
1580
1580
  }
1581
1581
  MaskedColor applyVVColor(MaskedColor color) {
1582
1582
  return color;
1583
- }`)}},23292(e,t,r){r.d(t,{d:()=>s});var i=r(65261),o=r(98619),n=r(48806),a=r(31821);function s(e){e.include(n.f),e.include(i.C),e.uniforms.add(o.t_).code.add(a.H`void calculateCommonInputs(out PBRShadingInfo inputs, vec3 normal, vec3 viewDirection, vec3 upDirection, vec3 albedo) {
1583
+ }`)}},23292(e,t,r){r.d(t,{d:()=>s});var i=r(65261),n=r(98619),o=r(48806),a=r(31821);function s(e){e.include(o.f),e.include(i.C),e.uniforms.add(n.t_).code.add(a.H`void calculateCommonInputs(out PBRShadingInfo inputs, vec3 normal, vec3 viewDirection, vec3 upDirection, vec3 albedo) {
1584
1584
  vec3 h = normalize(mainLightDirection - viewDirection);
1585
1585
  inputs.NdotV = clamp(abs(dot(normal, -viewDirection)), 0.001, 1.0);
1586
1586
  inputs.NdotUP = clamp(dot(normal, upDirection), -1.0, 1.0);
@@ -1597,7 +1597,7 @@ inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);
1597
1597
  inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
1598
1598
  inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
1599
1599
  inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);
1600
- }`)}},48806(e,t,r){r.d(t,{f:()=>o});var i=r(31821);function o(e){e.code.add(i.H`struct PBRShadingInfo
1600
+ }`)}},48806(e,t,r){r.d(t,{f:()=>n});var i=r(31821);function n(e){e.code.add(i.H`struct PBRShadingInfo
1601
1601
  {
1602
1602
  float NdotV;
1603
1603
  float NdotL;
@@ -1619,9 +1619,9 @@ vec3 f90;
1619
1619
  vec3 diffuseColor;
1620
1620
  float metalness;
1621
1621
  float roughness;
1622
- };`)}},56529(e,t,r){r.d(t,{rA:()=>w,oD:()=>y});var i=r(32198),o=r(46686),n=r(49255),a=r(31821);function s(e,t){const r=(0,n._o)(t.output)&&t.receiveShadows;r&&(0,o.A7)(e),e.vertex.code.add(a.H`
1622
+ };`)}},56529(e,t,r){r.d(t,{rA:()=>w,oD:()=>y});var i=r(32198),n=r(46686),o=r(49255),a=r(31821);function s(e,t){const r=(0,o._o)(t.output)&&t.receiveShadows;r&&(0,n.A7)(e),e.vertex.code.add(a.H`
1623
1623
  void forwardLinearDepthToReadShadow() { ${(0,a.If)(r,"forwardLinearDepth(gl_Position.w);")} }
1624
- `)}r(51850);var l=r(14314),c=r(35818),u=r(74333);class d extends u.n{constructor(e,t,r,i){super(e,"mat4",2,(r,o,n,a)=>r.setUniformMatrices4fv(e,t(o,n,a),i),r)}}class h extends u.n{constructor(e,t,r,i){super(e,"mat4",1,(r,o,n)=>r.setUniformMatrices4fv(e,t(o,n),i),r)}}function m(e){e.uniforms.add(new h("shadowMapMatrix",({origin:e},t)=>t.shadowMap.getShadowMapMatrices(e),4)),e.include(f)}function p(e){e.uniforms.add(new d("shadowMapMatrix",({origin:e},t)=>t.shadowMap.getShadowMapMatrices(e),4)),e.include(f)}function f(e){e.uniforms.add(new l.I("cascadeDistances",e=>e.shadowMap.cascadeDistances),new c.W("numCascades",e=>e.shadowMap.numCascades)).code.add(a.H`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
1624
+ `)}r(51850);var l=r(14314),c=r(35818),u=r(74333);class d extends u.n{constructor(e,t,r,i){super(e,"mat4",2,(r,n,o,a)=>r.setUniformMatrices4fv(e,t(n,o,a),i),r)}}class h extends u.n{constructor(e,t,r,i){super(e,"mat4",1,(r,n,o)=>r.setUniformMatrices4fv(e,t(n,o),i),r)}}function m(e){e.uniforms.add(new h("shadowMapMatrix",({origin:e},t)=>t.shadowMap.getShadowMapMatrices(e),4)),e.include(f)}function p(e){e.uniforms.add(new d("shadowMapMatrix",({origin:e},t)=>t.shadowMap.getShadowMapMatrices(e),4)),e.include(f)}function f(e){e.uniforms.add(new l.I("cascadeDistances",e=>e.shadowMap.cascadeDistances),new c.W("numCascades",e=>e.shadowMap.numCascades)).code.add(a.H`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
1625
1625
  vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
1626
1626
  vec4 lv = mat * vec4(_vpos, 1.0);
1627
1627
  lv.xy /= lv.w;
@@ -1644,14 +1644,14 @@ return invalidShadowmapUVZ;
1644
1644
  }
1645
1645
  vec2 uvShadow = cascadeCoordinates(i, shadowMapSize, lvpos);
1646
1646
  return vec3(uvShadow, lvpos.z);
1647
- }`)}r(65786).Y;var v=r(33094),g=r(12791);class x extends u.n{constructor(e,t){super(e,"sampler2DShadow",0,(r,i)=>r.bindTexture(e,t(i)))}}var _=r(51976);class b extends o.Y0{constructor(){super(...arguments),this.hasShadowHighlights=!1,this.receiveShadows=!0}}function y(e,t){t.receiveShadows&&e.fragment.include(m),S(e,t)}function w(e,t){t.receiveShadows&&e.fragment.include(p),S(e,t)}function S(e,t){e.include(s,t);const{hasShadowHighlights:r,receiveShadows:i,spherical:o}=t;i&&(function(e,t){t&&e.uniforms.add(new g.x("shadowHighlight",({shadowHighlight:e})=>e?.getTexture())),e.uniforms.add(new x("shadowMap",({shadowMap:e})=>e.getOutput(5)??e.getOutput(7))).code.add(a.H`
1647
+ }`)}r(65786).Y;var v=r(33094),g=r(12791);class x extends u.n{constructor(e,t){super(e,"sampler2DShadow",0,(r,i)=>r.bindTexture(e,t(i)))}}var _=r(51976);class b extends n.Y0{constructor(){super(...arguments),this.hasShadowHighlights=!1,this.receiveShadows=!0}}function y(e,t){t.receiveShadows&&e.fragment.include(m),S(e,t)}function w(e,t){t.receiveShadows&&e.fragment.include(p),S(e,t)}function S(e,t){e.include(s,t);const{hasShadowHighlights:r,receiveShadows:i,spherical:n}=t;i&&(function(e,t,r="gl_FragCoord.xy"){t&&e.uniforms.add(new g.x("shadowHighlight",({shadowHighlight:e})=>e?.getTexture())),e.uniforms.add(new x("shadowMap",({shadowMap:e})=>e.getOutput(5)??e.getOutput(7))).code.add(a.H`
1648
1648
  float readShadowMaps(const in vec3 uvzShadow) {
1649
1649
  if (uvzShadow.z < 0.0) {
1650
1650
  return 0.0;
1651
1651
  }
1652
1652
 
1653
1653
  float shadow1 = texture(shadowMap, uvzShadow);
1654
- ${(0,a.If)(t,"float shadow2 = texelFetch(shadowHighlight, ivec2(gl_FragCoord.xy), 0).r;\n return shadow1 > shadow2 ? shadow1 : shadow2;","return shadow1;")}
1654
+ ${(0,a.If)(t,`float shadow2 = texelFetch(shadowHighlight, ivec2(${r}), 0).r;\n return shadow1 > shadow2 ? shadow1 : shadow2;`,"return shadow1;")}
1655
1655
  }
1656
1656
  `)}(e.fragment,r),e.fragment.code.add(a.H`float readShadowMap(const in vec3 _worldPos, float _linearDepth) {
1657
1657
  vec3 uvzShadow = calculateUVZShadow(_worldPos, _linearDepth, textureSize(shadowMap, 0));
@@ -1659,16 +1659,16 @@ return readShadowMaps(uvzShadow);
1659
1659
  }
1660
1660
  float readShadowMap(const in vec3 _worldPos ) { return readShadowMap(_worldPos, linearDepth); }`)),e.fragment.uniforms.add(new v.U("lightingGlobalFactor",({lighting:e})=>e.globalFactor)).code.add(a.H`
1661
1661
  float getShadow(float additionalAmbientScale, float shadow) {
1662
- float ambient = ${(0,a.If)(o,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
1662
+ float ambient = ${(0,a.If)(n,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
1663
1663
  return max(ambient, shadow);
1664
1664
  }
1665
1665
 
1666
1666
  float readShadow(float additionalAmbientScale, vec3 vpos) {
1667
1667
  return getShadow(additionalAmbientScale, ${(0,a.If)(i,"readShadowMap(vpos)","0.0")});
1668
1668
  }
1669
- `)}(0,i.Cg)([(0,_.W)()],b.prototype,"hasShadowHighlights",void 0),(0,i.Cg)([(0,_.W)()],b.prototype,"receiveShadows",void 0)},34845(e,t,r){r.d(t,{Ir:()=>u});var i=r(37585),o=r(48163),n=r(78955),a=r(91829),s=r(77108),l=r(14314),c=r(31821);function u(e){e.fragment.uniforms.add(new l.I("projInfo",e=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,n.hZ)(d,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,n.hZ)(d,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(e.camera))),e.fragment.uniforms.add(new s.E("zScale",e=>0===e.camera.projectionMatrix[11]?(0,i.hZ)(h,0,1):(0,i.hZ)(h,1,0))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
1669
+ `)}(0,i.Cg)([(0,_.W)()],b.prototype,"hasShadowHighlights",void 0),(0,i.Cg)([(0,_.W)()],b.prototype,"receiveShadows",void 0)},34845(e,t,r){r.d(t,{Ir:()=>u});var i=r(37585),n=r(48163),o=r(78955),a=r(91829),s=r(77108),l=r(14314),c=r(31821);function u(e){e.fragment.uniforms.add(new l.I("projInfo",e=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,o.hZ)(d,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,o.hZ)(d,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(e.camera))),e.fragment.uniforms.add(new s.E("zScale",e=>0===e.camera.projectionMatrix[11]?(0,i.hZ)(h,0,1):(0,i.hZ)(h,1,0))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
1670
1670
  return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
1671
- }`)}const d=(0,a.vt)(),h=(0,o.vt)()},63365(e,t,r){r.d(t,{a:()=>o});var i=r(31821);function o(e){e.code.add(i.H`vec4 premultiplyAlpha(vec4 v) {
1671
+ }`)}const d=(0,a.vt)(),h=(0,n.vt)()},63365(e,t,r){r.d(t,{a:()=>n});var i=r(31821);function n(e){e.code.add(i.H`vec4 premultiplyAlpha(vec4 v) {
1672
1672
  return vec4(v.rgb * v.a, v.a);
1673
1673
  }
1674
1674
  vec3 rgb2hsv(vec3 c) {
@@ -1686,16 +1686,16 @@ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
1686
1686
  }
1687
1687
  float rgb2v(vec3 c) {
1688
1688
  return max(c.x, max(c.y, c.z));
1689
- }`)}},58614(e,t,r){r.d(t,{SS:()=>a});var i=r(29941),o=(r(28421),r(20304)),n=r(26934);function a(e,t){!function(e,t,r){const i=e.fragment;switch(i.code.add("void discardOrAdjustAlpha(inout vec4 color) {"),t.alphaDiscardMode){case 1:i.code.add("color.a = 1.0;");break;case 0:0!==t.output&&(i.include(n.Q),i.code.add("if (color.a < alphaCutoff) discard;"));break;case 3:0!==t.output&&i.uniforms.add(r).code.add("if (color.a < textureAlphaCutoff) discard;");break;case 2:i.uniforms.add(r).code.add("\n if (color.a < textureAlphaCutoff) discard;\n color.a = 1.0;\n ");break;case 4:break;default:t.alphaDiscardMode}i.code.add("}")}(e,t,new o.m("textureAlphaCutoff",e=>e.textureAlphaCutoff))}i.v},26425(e,t,r){r.d(t,{u:()=>n});var i=r(33094),o=r(31821);function n(e){e.uniforms.add(new i.U("dpDummy",()=>1)).code.add(o.H`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
1689
+ }`)}},58614(e,t,r){r.d(t,{SS:()=>a});var i=r(29941),n=(r(28421),r(20304)),o=r(26934);function a(e,t){!function(e,t,r){const i=e.fragment;switch(i.code.add("void discardOrAdjustAlpha(inout vec4 color) {"),t.alphaDiscardMode){case 1:i.code.add("color.a = 1.0;");break;case 0:0!==t.output&&(i.include(o.Q),i.code.add("if (color.a < alphaCutoff) discard;"));break;case 3:0!==t.output&&i.uniforms.add(r).code.add("if (color.a < textureAlphaCutoff) discard;");break;case 2:i.uniforms.add(r).code.add("\n if (color.a < textureAlphaCutoff) discard;\n color.a = 1.0;\n ");break;case 4:break;default:t.alphaDiscardMode}i.code.add("}")}(e,t,new n.m("textureAlphaCutoff",e=>e.textureAlphaCutoff))}i.v},26425(e,t,r){r.d(t,{u:()=>o});var i=r(33094),n=r(31821);function o(e){e.uniforms.add(new i.U("dpDummy",()=>1)).code.add(n.H`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
1690
1690
  vec3 hiD = hiA + hiB;
1691
1691
  vec3 loD = loA + loB;
1692
1692
  return dpDummy * hiD + loD;
1693
- }`)}},20693(e,t,r){r.d(t,{yu:()=>m,NB:()=>p});var i=r(58083),o=r(9093),n=r(35522),a=r(51850),s=r(45324),l=r(23205),c=r(40710),u=(r(33094),r(58029)),d=r(74333);class h extends d.n{constructor(e,t,r){super(e,"mat4",2,(i,o,n)=>i.setUniformMatrix4fv(e,t(o,n),r))}}function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new c.W("cameraPosition",({origin:e},{camera:t})=>(0,n.hZ)(v,t.viewInverseTransposeMatrix[3]-e[0],t.viewInverseTransposeMatrix[7]-e[1],t.viewInverseTransposeMatrix[11]-e[2])))}function p(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(s.rS,new h("view",(e,t)=>(0,i.Tl)(f,t.camera.viewMatrix,e.origin)),new c.W("localOrigin",e=>e.origin));const r=({camera:e})=>(0,n.hZ)(v,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11]);e.uniforms.add(s.rS,new u.F("view",e=>(0,i.Tl)(f,e.camera.viewMatrix,r(e))),new l.d("localOrigin",e=>r(e)))}const f=(0,o.vt)(),v=(0,a.vt)()},45324(e,t,r){var i=r(37585),o=r(48163),n=r(77108),a=r(14314),s=r(33094),l=r(58029);const c=new l.F("view",({camera:e})=>e.viewMatrix),u=(new l.F("inverseViewMatrix",({camera:e})=>e.inverseViewMatrix),new l.F("proj",({camera:e})=>e.projectionMatrix)),d=(new l.F("inverseProjectionMatrix",({camera:e})=>e.inverseProjectionMatrix),new l.F("viewNormal",({camera:e})=>e.viewInverseTransposeMatrix)),h=new n.E("nearFar",({camera:e})=>e.nearFar),m=(new a.I("viewport",({camera:e})=>e.fullViewport),new s.U("pixelRatio",({camera:e})=>e.pixelRatio),new n.E("inverseScreenSize",({camera:e})=>(0,i.hZ)(m,1/e.fullWidth,1/e.fullHeight)),(0,o.vt)());r.d(t,["HO",0,d,"Xl",0,c,"Y$",0,h,"rS",0,u])},32976(e,t,r){r.d(t,{o:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"bool",0,(r,i)=>r.setUniform1b(e,t(i)))}}},77108(e,t,r){r.d(t,{E:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",0,(i,o)=>i.setUniform2fv(e,t(o),r))}}},68259(e,t,r){r.d(t,{t:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,o,n,a)=>i.setUniform2fv(e,t(o,n,a),r))}}},47286(e,t,r){r.d(t,{G:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,o,n)=>i.setUniform2fv(e,t(o,n),r))}}},23205(e,t,r){r.d(t,{d:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec3",0,(i,o)=>i.setUniform3fv(e,t(o),r))}}},40710(e,t,r){r.d(t,{W:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec3",2,(i,o,n,a)=>i.setUniform3fv(e,t(o,n,a),r))}}},33079(e,t,r){r.d(t,{t:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec3",1,(i,o,n)=>i.setUniform3fv(e,t(o,n),r))}}},14314(e,t,r){r.d(t,{I:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,o)=>i.setUniform4fv(e,t(o),r))}}},71988(e,t,r){r.d(t,{E:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec4",1,(i,o,n)=>i.setUniform4fv(e,t(o,n),r))}}},33094(e,t,r){r.d(t,{U:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"float",0,(i,o)=>i.setUniform1f(e,t(o),r))}}},28421(e,t,r){r.d(t,{J:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"float",2,(i,o,n)=>i.setUniform1f(e,t(o,n),r))}}},20304(e,t,r){r.d(t,{m:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"float",1,(i,o,n)=>i.setUniform1f(e,t(o,n),r))}}},35818(e,t,r){r.d(t,{W:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"int",0,(r,i)=>r.setUniform1i(e,t(i)))}}},35644(e,t,r){r.d(t,{k:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"mat3",1,(i,o,n)=>i.setUniformMatrix3fv(e,t(o,n),r))}}},58029(e,t,r){r.d(t,{F:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"mat4",0,(i,o)=>i.setUniformMatrix4fv(e,t(o),r))}}},12791(e,t,r){r.d(t,{x:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},15976(e,t,r){r.d(t,{o:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"sampler2D",2,(i,o,n)=>i.bindTexture(e,t(o,n),r?.(o,n)))}}},63761(e,t,r){r.d(t,{N:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",1,(r,i,o)=>r.bindTexture(e,t(i,o)))}}},31821(e,t,r){r.d(t,{If:()=>o});const i=(e,...t)=>{let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r};function o(e,t,r=""){return e?t:r}i.int=e=>e.toFixed(),i.uint=e=>`${Math.max(0,e).toFixed()}u`,i.hexuint=e=>`0x${Math.round(Math.max(0,e)).toString(16)}u`,i.float=e=>e.toPrecision(8),r.d(t,["H",0,i])},13840(e,t,r){r.d(t,{r:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},42958(e,t,r){r.d(t,{w:()=>f});var i=r(32198),o=r(69622),n=r(53966),a=r(91429),s=r(63907),l=r(85079),c=r(74038);new c._("position",3,s.pe.FLOAT,0,12);const u=[new c._("position",2,s.pe.FLOAT,0,8)];(0,l.Xk)(u),new c._("position",2,s.pe.FLOAT,0,12),new c._("uv0",2,s.pe.HALF_FLOAT,8,12),r(44208);var d=r(26857),h=r(94656);class m{constructor(e,t,r){this._context=e,this.locations=r,this._textures=new Map,this.source=(0,h.en)()?t:null,t.attributeNames.forEach(e=>{r.has(e)||n.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${e} used in shader`)}),this._glProgram=e.programCache.get(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?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)}setUniformMatrices4fv(e,t,r){this._glProgram.setUniformMatrices4fv(e,t,!1,r)}setUniform1fv(e,t,r){this._glProgram.setUniform1fv(e,t,r)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e,t){if(d.b.ENABLE_OPTIMIZATIONS)return;let r=e.locations;if(t){const e=new Map(r);t.forEach((t,i)=>e.set(i,r.size+t)),r=e}r.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${Array.from(r.keys())} vs ${Array.from(this.locations.keys())}`),this.locations.forEach((e,t)=>{r.get(t)!==e&&console.error(`VertexAttributeLocations are incompatible: Program has ${t} at position ${e}, VAO has it at position ${r.get(t)}.`)})}stop(){this._textures.clear()}bindTexture(e,t,r){if(!t?.glName){const r=`Texture sampler ${e} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,h.en)()&&console.error(r),t=this._context.emptyTexture}const i=this._ensureTextureUnit(e,t);this._context.useProgram(this);const o=i.unit;this.setUniform1i(e,o),this._context.bindTexture(t,o,!1,r)}_ensureTextureUnit(e,t){let r=this._textures.get(e);return null==r?(r={texture:t,unit:this._textures.size},this._textures.set(e,r)):r.texture=t,r}}var p=r(90644);let f=class extends o.A{constructor(e,t,r){super({}),this._context=e,this._configuration=t,this.primitiveType=s.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=t.key,this.locations=(0,l.Xk)(r??u),this._pipeline=this.initializePipeline(t),this.reload=async r=>{if(r&&await this.shader.reload(),!this.key.equals(t.key))return void n.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const i=this.shader.get().build(t);i.debugName=this.declaredClass,this._program=new m(e.rctx,i,this.locations),this._pipeline=this.initializePipeline(t)}}initialize(){const e=this.shader.get().build(this._configuration);e.debugName=this.declaredClass,this._program=new m(this._context.rctx,e,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t,r){return this._pipeline}initializePipeline(e){return(0,p.Ey)({blending:p.RC,colorWrite:p.kn})}};f=(0,i.Cg)([(0,a.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],f)},51976(e,t,r){r.d(t,{K:()=>s,W:()=>l});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 l(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const 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 l=a[s],c=(1<<n)-1<<l;a[s]+=n,e.count?Object.defineProperty(t,r,{get(){return(this._parameterBits[s]&c)>>l},set(t){const o=this._parameterBits[s];if((o&c)>>l!==t){if(this._key=null,this._parameterBits[s]=o&~c|+t<<l&c,"number"!=typeof t)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be a number, got ${typeof t}`);if(null==e.count)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must provide a count option`)}}}):Object.defineProperty(t,r,{get(){return!!((this._parameterBits[s]&c)>>l)},set(e){const t=this._parameterBits[s];if(!!((t&c)>>l)!==e&&(this._key=null,this._parameterBits[s]=t&~c|+e<<l,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configurationx",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},99811(e,t,r){r.d(t,{o:()=>F});var i=r(32198),o=r(91429),n=r(89904),a=r(69622),s=r(49186),l=r(36708),c=r(10107),u=r(64108),d=r(44208),h=r(53966),m=(r(17676),r(94656)),p=r(63907);r(93637),r(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,d.A)("esri-tests-disable-gpu-memory-measurements"),(0,m.en)();(0,m.en)();r(90644);var f=r(21231),v=r(97768),g=r(48852),x=r(42293);const _=!!(0,d.A)("esri-tests-disable-gpu-memory-measurements");class b{constructor(e,t){this._context=e,this._descriptor=t,this.type=2,this._context.instanceCounter.increment(p.vt.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:a}=t;a?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o):r.renderbufferStorage(r.RENDERBUFFER,n,i,o),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return _?0:(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,x.MW)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.vt.Renderbuffer,this),this._context=null)}}class y{constructor(e,t,r){if(this._context=e,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,e.instanceCounter.increment(p.vt.FramebufferObject,this),null!=t){const r=function(e,t){return w(t)||S(t)?t:M(t)?new f.A(e,t):function(e){return 3===T(e)||null!=e&&"samples"in e}(t)?new b(e,t):null}(e,t);null!=r&&(this._colorAttachments.set(36064,r),w(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(36064)}if(null!=r)if(function(e){return w(e)||M(e)}(r))this._depthStencilTexture=w(r)?r:new f.A(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=S(r)?r:new b(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}get glName(){return this._glName}get colorTexture(){const e=this._colorAttachments.get(36064);return w(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.height??0}get usedMemory(){return this._colorAttachments.values().reduce((e,t)=>e+t.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(e){this._level!==e&&(this._level=e,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&w(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=36064){if(!e)return;this._validateColorAttachmentPoint(t);const{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=36064){const t=this._colorAttachments.get(e);if(!t)return;const r=w(t);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(r)this._framebufferTexture2D(null,e);else{const t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._glName){const t=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{e.forEach(e=>{w(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=36064,r=0){const i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,r):this._framebufferTexture2D(i.glName,t,e,36160))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041===r||6402===r?34041!==r||i===p.ld.UNSIGNED_INT_24_8?6402!==r||i===p.ld.UNSIGNED_INT||i===p.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,E(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,E(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);const{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._glName){const{_context:t}=this,r=t.boundFramebuffer;t.bindFramebuffer(this);const{gl:i}=t,o=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,o,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){const{_context:t}=this;t.temporaryBindFramebuffer(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;3553!==a.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||o+r>s.width||n+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,f.A.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(3553,0,o,n,e,t,r,i),l.bindTexture(c,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,o,n,a,s){const{gl:l}=this._context,c=g.g.createPixelPack(this._context,35041,a.byteLength);this._context.bindBuffer(c);const u=this._context.boundFramebuffer;this._context.bindFramebuffer(this),l.readPixels(e,t,r,i,o,n,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(u);try{await c.getSubDataAsync(a,void 0,void 0,void 0,s)}finally{c.dispose()}}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};if(C(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._glName&&(C(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),(0,m.en)())){const{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){const{gl:t}=this._context;this._glName?t.bindFramebuffer(e,this._glName):(this._glName&&t.deleteFramebuffer(this._glName),this._glName=t.createFramebuffer(),t.bindFramebuffer(e,this._glName),this._initializeAttachments(e))}_initializeAttachments(e=36160){const{gl:t}=this._context;if(this._colorAttachments.forEach((t,r)=>{if(w(t)){const i=I(t);35866===i?this._framebufferTextureLayer(t.glName,r,e):this._framebufferTexture2D(t.glName,r,i,e)}else if(S(t)){const i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const t=E(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,I(this._depthStencilTexture),e)}(0,m.en)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(e,t=36064,r=3553,i=36160){this._context.gl.framebufferTexture2D(i,t,r,e,this._level)}_framebufferTextureLayer(e,t=36064,r=36160,i=0){this._context.gl.framebufferTextureLayer(r,t,e,this._level,i)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,v.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,E(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,v.WD)(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),C(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){C(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case p.SB.DEPTH_COMPONENT16:case p.SB.DEPTH_COMPONENT24:case p.SB.DEPTH_COMPONENT32F:return 36096;case p.iE.DEPTH24_STENCIL8:case p.iE.DEPTH32F_STENCIL8:return 33306;case 36168:return 36128;default:return 36064}}_validateColorAttachmentPoint(e){if(-1===y._MAX_COLOR_ATTACHMENTS){const{gl:e}=this._context;y._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}const t=e-36064;t+1>y._MAX_COLOR_ATTACHMENTS&&h.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${y._MAX_COLOR_ATTACHMENTS} color attachments`)}}function w(e){return 1===T(e)}function S(e){return 2===T(e)}function M(e){return 0===T(e)}function T(e){return null!=e&&"type"in e?e.type:null}function C(e,t){const r=Math.max(e.width,e.height);if(r>t){h.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function I(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function E(e){return 6402===e?36096:33306}r(67171),r(21818);var O=r(85079);const P=[new(r(74038)._)("position",2,p.pe.UNSIGNED_SHORT,0,4)];(0,O.Xk)(P),r(66289);const A=new Image;A.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",A.width=5,A.height=5,A.decode();let D=class extends a.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=n.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new s.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 this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){var t;e.initializeAndBind(),this.gl.drawBuffers((t=e)?t.colorAttachments.length>0?t.colorAttachments:[0]:[1029])}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}queryDepthRange(e){return null}get input(){return this._frameBuffer}};(0,i.Cg)([(0,c.MZ)({constructOnly:!0})],D.prototype,"view",void 0),(0,i.Cg)([(0,c.MZ)({constructOnly:!0})],D.prototype,"consumes",void 0),(0,i.Cg)([(0,c.MZ)()],D.prototype,"produces",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],D.prototype,"techniques",null),D=(0,i.Cg)([(0,u.$)("esri.views.3d.webgl.RenderNode")],D);let F=class extends D{constructor(){super(...arguments),this.consumes={required:["normals"]},this.produces="disabled"}get enabled(){return!this.destroying&&!this.destroyed&&this.produces===n.OG.AMBIENT_ILLUMINATION}get _belowMaxElevation(){return(this.view.state.camera.relativeElevation??1/0)<5e5}get _useGlobalIllumination(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(11)}get _useSSAO(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(3)}_enable(){this.produces=n.OG.AMBIENT_ILLUMINATION,this.requestRender(1)}_disable(){this.produces="disabled",this.requestRender(1)}};(0,i.Cg)([(0,o.MZ)()],F.prototype,"consumes",void 0),(0,i.Cg)([(0,o.MZ)()],F.prototype,"produces",void 0),F=(0,i.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.effects.AmbientIllumination")],F)},16943(e,t,r){r.d(t,{E:()=>o});var i=r(44208);function o(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},94046(e,t,r){r.d(t,{R:()=>o});var i=r(31821);function o(e){e.code.add(i.H`
1693
+ }`)}},20693(e,t,r){r.d(t,{yu:()=>m,NB:()=>p});var i=r(58083),n=r(9093),o=r(35522),a=r(51850),s=r(45324),l=r(23205),c=r(40710),u=(r(33094),r(58029)),d=r(74333);class h extends d.n{constructor(e,t,r){super(e,"mat4",2,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new c.W("cameraPosition",({origin:e},{camera:t})=>(0,o.hZ)(v,t.viewInverseTransposeMatrix[3]-e[0],t.viewInverseTransposeMatrix[7]-e[1],t.viewInverseTransposeMatrix[11]-e[2])))}function p(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(s.rS,new h("view",(e,t)=>(0,i.Tl)(f,t.camera.viewMatrix,e.origin)),new c.W("localOrigin",e=>e.origin));const r=({camera:e})=>(0,o.hZ)(v,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11]);e.uniforms.add(s.rS,new u.F("view",e=>(0,i.Tl)(f,e.camera.viewMatrix,r(e))),new l.d("localOrigin",e=>r(e)))}const f=(0,n.vt)(),v=(0,a.vt)()},45324(e,t,r){var i=r(37585),n=r(48163),o=r(77108),a=r(14314),s=r(33094),l=r(58029);const c=new l.F("view",({camera:e})=>e.viewMatrix),u=(new l.F("inverseViewMatrix",({camera:e})=>e.inverseViewMatrix),new l.F("proj",({camera:e})=>e.projectionMatrix)),d=(new l.F("inverseProjectionMatrix",({camera:e})=>e.inverseProjectionMatrix),new l.F("viewNormal",({camera:e})=>e.viewInverseTransposeMatrix)),h=new o.E("nearFar",({camera:e})=>e.nearFar),m=(new a.I("viewport",({camera:e})=>e.fullViewport),new s.U("pixelRatio",({camera:e})=>e.pixelRatio),new s.U("perScreenPixelRatio",({camera:e})=>e.perScreenPixelRatio),new s.U("metersPerRenderUnit",e=>e.metersPerRenderUnit),new o.E("inverseScreenSize",({camera:e})=>(0,i.hZ)(m,1/e.fullWidth,1/e.fullHeight)),(0,n.vt)());r.d(t,["HO",0,d,"Xl",0,c,"Y$",0,h,"rS",0,u])},32976(e,t,r){r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"bool",0,(r,i)=>r.setUniform1b(e,t(i)))}}},77108(e,t,r){r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",0,(i,n)=>i.setUniform2fv(e,t(n),r))}}},68259(e,t,r){r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,n,o,a)=>i.setUniform2fv(e,t(n,o,a),r))}}},47286(e,t,r){r.d(t,{G:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,n,o)=>i.setUniform2fv(e,t(n,o),r))}}},23205(e,t,r){r.d(t,{d:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",0,(i,n)=>i.setUniform3fv(e,t(n),r))}}},40710(e,t,r){r.d(t,{W:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",2,(i,n,o,a)=>i.setUniform3fv(e,t(n,o,a),r))}}},33079(e,t,r){r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",1,(i,n,o)=>i.setUniform3fv(e,t(n,o),r))}}},14314(e,t,r){r.d(t,{I:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,n)=>i.setUniform4fv(e,t(n),r))}}},71988(e,t,r){r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",1,(i,n,o)=>i.setUniform4fv(e,t(n,o),r))}}},33094(e,t,r){r.d(t,{U:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",0,(i,n)=>i.setUniform1f(e,t(n),r))}}},28421(e,t,r){r.d(t,{J:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",2,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},20304(e,t,r){r.d(t,{m:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",1,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},35818(e,t,r){r.d(t,{W:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"int",0,(r,i)=>r.setUniform1i(e,t(i)))}}},35644(e,t,r){r.d(t,{k:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat3",1,(i,n,o)=>i.setUniformMatrix3fv(e,t(n,o),r))}}},58029(e,t,r){r.d(t,{F:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat4",0,(i,n)=>i.setUniformMatrix4fv(e,t(n),r))}}},12791(e,t,r){r.d(t,{x:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},15976(e,t,r){r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"sampler2D",2,(i,n,o)=>i.bindTexture(e,t(n,o),r?.(n,o)))}}},63761(e,t,r){r.d(t,{N:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",1,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},31821(e,t,r){r.d(t,{If:()=>n});const i=(e,...t)=>{let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r};function n(e,t,r=""){return e?t:r}i.int=e=>e.toFixed(),i.uint=e=>`${Math.max(0,e).toFixed()}u`,i.hexuint=e=>`0x${Math.round(Math.max(0,e)).toString(16)}u`,i.float=e=>e.toPrecision(8),r.d(t,["H",0,i])},13840(e,t,r){r.d(t,{r:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},42958(e,t,r){r.d(t,{w:()=>f});var i=r(32198),n=r(69622),o=r(53966),a=r(91429),s=r(63907),l=r(85079),c=r(74038);new c._("position",3,s.pe.FLOAT,0,12);const u=[new c._("position",2,s.pe.FLOAT,0,8)];(0,l.Xk)(u),new c._("position",2,s.pe.FLOAT,0,12),new c._("uv0",2,s.pe.HALF_FLOAT,8,12),r(44208);var d=r(26857),h=r(94656);class m{constructor(e,t,r){this._context=e,this.locations=r,this._textures=new Map,this.source=(0,h.en)()?t:null,t.attributeNames.forEach(e=>{r.has(e)||o.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${e} used in shader`)}),this._glProgram=e.programCache.get(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?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)}setUniformMatrices4fv(e,t,r){this._glProgram.setUniformMatrices4fv(e,t,!1,r)}setUniform1fv(e,t,r){this._glProgram.setUniform1fv(e,t,r)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e,t){if(d.b.ENABLE_OPTIMIZATIONS)return;let r=e.locations;if(t){const e=new Map(r);t.forEach((t,i)=>e.set(i,r.size+t)),r=e}r.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${Array.from(r.keys())} vs ${Array.from(this.locations.keys())}`),this.locations.forEach((e,t)=>{r.get(t)!==e&&console.error(`VertexAttributeLocations are incompatible: Program has ${t} at position ${e}, VAO has it at position ${r.get(t)}.`)})}stop(){this._textures.clear()}bindTexture(e,t,r){if(!t?.glName){const r=`Texture sampler ${e} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,h.en)()&&console.error(r),t=this._context.emptyTexture}const i=this._ensureTextureUnit(e,t);this._context.useProgram(this);const n=i.unit;this.setUniform1i(e,n),this._context.bindTexture(t,n,!1,r)}_ensureTextureUnit(e,t){let r=this._textures.get(e);return null==r?(r={texture:t,unit:this._textures.size},this._textures.set(e,r)):r.texture=t,r}}var p=r(90644);let f=class extends n.A{constructor(e,t,r){super({}),this._context=e,this._configuration=t,this.primitiveType=s.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=t.key,this.locations=(0,l.Xk)(r??u),this._pipeline=this.initializePipeline(t),this.reload=async r=>{if(r&&await this.shader.reload(),!this.key.equals(t.key))return void o.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const i=this.shader.get().build(t);i.debugName=this.declaredClass,this._program=new m(e.rctx,i,this.locations),this._pipeline=this.initializePipeline(t)}}initialize(){const e=this.shader.get().build(this._configuration);e.debugName=this.declaredClass,this._program=new m(this._context.rctx,e,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t,r){return this._pipeline}initializePipeline(e){return(0,p.Ey)({blending:p.RC,colorWrite:p.kn})}};f=(0,i.Cg)([(0,a.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],f)},51976(e,t,r){r.d(t,{K:()=>s,W:()=>l});var i=r(49186),n=r(4576);class o{constructor(e){this._bits=[...e]}equals(e){return(0,n.aI)(this._bits,e.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var a=r(65786);class s extends a.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new o(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map(e=>` ${e}: ${this[e]}`).join("\n");return this._parameterBits=t,r}}function l(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const n=e.count||2,o=Math.ceil(Math.log2(n)),a=t._parameterBits;let s=0;for(;a[s]+o>16;)s++,s>=a.length&&a.push(0);const l=a[s],c=(1<<o)-1<<l;a[s]+=o,e.count?Object.defineProperty(t,r,{get(){return(this._parameterBits[s]&c)>>l},set(t){const n=this._parameterBits[s];if((n&c)>>l!==t){if(this._key=null,this._parameterBits[s]=n&~c|+t<<l&c,"number"!=typeof t)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be a number, got ${typeof t}`);if(null==e.count)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must provide a count option`)}}}):Object.defineProperty(t,r,{get(){return!!((this._parameterBits[s]&c)>>l)},set(e){const t=this._parameterBits[s];if(!!((t&c)>>l)!==e&&(this._key=null,this._parameterBits[s]=t&~c|+e<<l,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configurationx",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},99811(e,t,r){r.d(t,{o:()=>R});var i=r(32198),n=r(91429),o=r(89904),a=r(69622),s=r(49186),l=r(36708),c=r(10107),u=r(64108),d=r(44208),h=r(53966),m=(r(17676),r(94656)),p=r(63907);r(93637),r(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,d.A)("esri-tests-disable-gpu-memory-measurements"),(0,m.en)();(0,m.en)();r(90644);var f=r(21231),v=r(97768),g=r(48852),x=r(42293);const _=!!(0,d.A)("esri-tests-disable-gpu-memory-measurements");class b{constructor(e,t){this._context=e,this._descriptor=t,this.type=2,this._context.instanceCounter.increment(p.vt.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:n,internalFormat:o,multisampled:a}=t;a?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,i,n):r.renderbufferStorage(r.RENDERBUFFER,o,i,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return _?0:(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,x.MW)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.vt.Renderbuffer,this),this._context=null)}}class y{constructor(e,t,r){if(this._context=e,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,e.instanceCounter.increment(p.vt.FramebufferObject,this),null!=t){const r=function(e,t){return w(t)||S(t)?t:M(t)?new f.A(e,t):function(e){return 3===T(e)||null!=e&&"samples"in e}(t)?new b(e,t):null}(e,t);null!=r&&(this._colorAttachments.set(36064,r),w(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(36064)}if(null!=r)if(function(e){return w(e)||M(e)}(r))this._depthStencilTexture=w(r)?r:new f.A(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=S(r)?r:new b(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}get glName(){return this._glName}get colorTexture(){const e=this._colorAttachments.get(36064);return w(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.height??0}get usedMemory(){return this._colorAttachments.values().reduce((e,t)=>e+t.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(e){this._level!==e&&(this._level=e,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&w(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=36064){if(!e)return;this._validateColorAttachmentPoint(t);const{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=36064){const t=this._colorAttachments.get(e);if(!t)return;const r=w(t);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(r)this._framebufferTexture2D(null,e);else{const t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._glName){const t=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{e.forEach(e=>{w(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=36064,r=0){const i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,r):this._framebufferTexture2D(i.glName,t,e,36160))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041===r||6402===r?34041!==r||i===p.ld.UNSIGNED_INT_24_8?6402!==r||i===p.ld.UNSIGNED_INT||i===p.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,E(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,E(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);const{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._glName){const{_context:t}=this,r=t.boundFramebuffer;t.bindFramebuffer(this);const{gl:i}=t,n=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,n,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){const{_context:t}=this;t.temporaryBindFramebuffer(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,n,o,a){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;3553!==a.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||n+r>s.width||o+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,f.A.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(3553,0,n,o,e,t,r,i),l.bindTexture(c,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,n,o,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,n,o,a)}async readPixelsAsync(e,t,r,i,n,o,a,s){const{gl:l}=this._context,c=g.g.createPixelPack(this._context,35041,a.byteLength);this._context.bindBuffer(c);const u=this._context.boundFramebuffer;this._context.bindFramebuffer(this),l.readPixels(e,t,r,i,n,o,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(u);try{await c.getSubDataAsync(a,void 0,void 0,void 0,s)}finally{c.dispose()}}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};if(C(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._glName&&(C(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),(0,m.en)())){const{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){const{gl:t}=this._context;this._glName?t.bindFramebuffer(e,this._glName):(this._glName&&t.deleteFramebuffer(this._glName),this._glName=t.createFramebuffer(),t.bindFramebuffer(e,this._glName),this._initializeAttachments(e))}_initializeAttachments(e=36160){const{gl:t}=this._context;if(this._colorAttachments.forEach((t,r)=>{if(w(t)){const i=I(t);35866===i?this._framebufferTextureLayer(t.glName,r,e):this._framebufferTexture2D(t.glName,r,i,e)}else if(S(t)){const i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const t=E(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,I(this._depthStencilTexture),e)}(0,m.en)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(e,t=36064,r=3553,i=36160){this._context.gl.framebufferTexture2D(i,t,r,e,this._level)}_framebufferTextureLayer(e,t=36064,r=36160,i=0){this._context.gl.framebufferTextureLayer(r,t,e,this._level,i)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,v.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,E(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,v.WD)(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),C(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){C(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case p.SB.DEPTH_COMPONENT16:case p.SB.DEPTH_COMPONENT24:case p.SB.DEPTH_COMPONENT32F:return 36096;case p.iE.DEPTH24_STENCIL8:case p.iE.DEPTH32F_STENCIL8:return 33306;case 36168:return 36128;default:return 36064}}_validateColorAttachmentPoint(e){if(-1===y._MAX_COLOR_ATTACHMENTS){const{gl:e}=this._context;y._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}const t=e-36064;t+1>y._MAX_COLOR_ATTACHMENTS&&h.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${y._MAX_COLOR_ATTACHMENTS} color attachments`)}}function w(e){return 1===T(e)}function S(e){return 2===T(e)}function M(e){return 0===T(e)}function T(e){return null!=e&&"type"in e?e.type:null}function C(e,t){const r=Math.max(e.width,e.height);if(r>t){h.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function I(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function E(e){return 6402===e?36096:33306}r(67171),r(21818);var O=r(85079);const P=[new(r(74038)._)("position",2,p.pe.UNSIGNED_SHORT,0,4)];(0,O.Xk)(P),r(66289);const D=new Image;D.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",D.width=5,D.height=5,D.decode();let A=class extends a.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=o.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new s.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 this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){var t;e.initializeAndBind(),this.gl.drawBuffers((t=e)?t.colorAttachments.length>0?t.colorAttachments:[0]:[1029])}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}queryDepthRange(e){return null}get input(){return this._frameBuffer}};(0,i.Cg)([(0,c.MZ)({constructOnly:!0})],A.prototype,"view",void 0),(0,i.Cg)([(0,c.MZ)({constructOnly:!0})],A.prototype,"consumes",void 0),(0,i.Cg)([(0,c.MZ)()],A.prototype,"produces",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"techniques",null),A=(0,i.Cg)([(0,u.$)("esri.views.3d.webgl.RenderNode")],A);let R=class extends A{constructor(){super(...arguments),this.consumes={required:["normals"]},this.produces="disabled"}get enabled(){return!this.destroying&&!this.destroyed&&this.produces===o.OG.AMBIENT_ILLUMINATION}get _belowMaxElevation(){return(this.view.state.camera.relativeElevation??1/0)<5e5}get _useGlobalIllumination(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(11)}get _useSSAO(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(3)}_enable(){this.produces=o.OG.AMBIENT_ILLUMINATION,this.requestRender(1)}_disable(){this.produces="disabled",this.requestRender(1)}};(0,i.Cg)([(0,n.MZ)()],R.prototype,"consumes",void 0),(0,i.Cg)([(0,n.MZ)()],R.prototype,"produces",void 0),R=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl-engine.effects.AmbientIllumination")],R)},16943(e,t,r){r.d(t,{E:()=>n});var i=r(44208);function n(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},94046(e,t,r){r.d(t,{R:()=>n});var i=r(31821);function n(e){e.code.add(i.H`
1694
1694
  vec3 quantizeGlobalIlluminationColor(vec3 color) {
1695
1695
  vec3 clampedColor = clamp(color, vec3(0.0), vec3(1.0));
1696
1696
  return floor(clampedColor * ${i.H.float(255)} + 0.5) * ${i.H.float(1/255)};
1697
1697
  }
1698
- `)}},27832(e,t,r){r.d(t,{b:()=>a});var i=r(23292),o=r(33094),n=r(31821);function a(e,t){t.snowCover&&(e.uniforms.add(new o.U("snowCover",e=>e.snowCover)).code.add(n.H`float getSnow(vec3 normal, vec3 groundNormal) {
1698
+ `)}},27832(e,t,r){r.d(t,{b:()=>a});var i=r(23292),n=r(33094),o=r(31821);function a(e,t){t.snowCover&&(e.uniforms.add(new n.U("snowCover",e=>e.snowCover)).code.add(o.H`float getSnow(vec3 normal, vec3 groundNormal) {
1699
1699
  return smoothstep(0.5, 0.55, dot(normal, groundNormal)) * snowCover;
1700
1700
  }
1701
1701
  float getRealisticTreeSnow(vec3 faceNormal, vec3 shadingNormal, vec3 groundNormal) {
@@ -1703,9 +1703,9 @@ float snow = min(1.0, smoothstep(0.5, 0.55, dot(faceNormal, groundNormal)) +
1703
1703
  smoothstep(0.5, 0.55, dot(-faceNormal, groundNormal)) +
1704
1704
  smoothstep(0.0, 0.1, dot(shadingNormal, groundNormal)));
1705
1705
  return snow * snowCover;
1706
- }`),e.include(i.d),e.code.add(n.H`void applySnowToMRR(float snow) {
1706
+ }`),e.include(i.d),e.code.add(o.H`void applySnowToMRR(float snow) {
1707
1707
  mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);
1708
- }`))}},49718(e,t,r){r(51850),r(6867).w_},6867(e,t,r){r.d(t,{w_:()=>d});var i=r(58083),o=r(9093),n=r(35522),a=r(51850),s=r(78955),l=r(91829),c=r(71351);class u{constructor(){this.intersector=4}get distance(){return this._distance}get renderDistance(){return this._renderDistance}_init(){this._distance=this._renderDistance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4}_setBase(e,t,r,i=null,o=null,n=null){this.intersector=e,this._distance=r,this._renderDistance=i,this.target=t,this.drapedLayerOrder=o,this.renderPriority=n}}class d extends u{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,n.hs)(m,this.ray.direction,this.distance),(0,n.Bw)(m))}withinDistance(e){return!!h(this)&&null!=this.distanceInRenderSpace&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!h(this)&&((0,n.hs)(m,this.ray.direction,this.distance),(0,n.WQ)(e,this.ray.origin,m),!0)}getTransformedNormal(e){return(0,n.C)(p,this.normal),p[3]=0,(0,s.Z0)(p,p,this.transformation),(0,n.C)(e,p),(0,n.S8)(e,e)}constructor(e){super(),this.normal=(0,a.vt)(),this.transformation=(0,o.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){super._init(),e&&(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,u,d){this._setBase(e,t,r,s,u,d),(0,n.C)(this.normal,l??a.Cb),(0,i.C)(this.transformation,c??o.zK)}copy(e){this._setBase(e.intersector,e.target,e.distance,e.renderDistance,e.drapedLayerOrder,e.renderPriority),(0,c.C)(e.ray,this._ray),(0,n.C)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function h(e){return null!=e?.distance&&null!=e?.renderDistance}const m=(0,a.vt)(),p=(0,l.vt)()},16396(e,t,r){r.d(t,{ou:()=>l}),r(77690),r(29242),r(58083),r(9093);var i=r(35522),o=r(51850),n=r(94008),a=r(57005);const s=new class{constructor(e=0){this.offset=e,this._tmpSphere=new n.iy}applyToVertex(e,t,r,o){const n=this.objectTransform.transform,a=(0,i.hZ)(c,t,r,o),s=(0,i.Z0)(a,a,n),l=this.offset/(0,i.Bw)(s);(0,i.Ln)(s,s,s,l);const u=this.objectTransform.inverse;return(0,i.Z0)(e,s,u),e}applyToMinMax(e,t){const r=this.offset/(0,i.Bw)(e);(0,i.Ln)(e,e,e,r);const o=this.offset/(0,i.Bw)(t);(0,i.Ln)(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=e.center,r=(0,i.Bw)(t),o=this.offset/r;return(0,i.Ln)(this._tmpSphere.center,t,t,o),this._tmpSphere.radius=e.radius+e.radius*this.offset/r,this._tmpSphere}};function l(e){return null!=e?(s.offset=e,s):null}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpMbs=new n.iy,this._tmpObb=new a.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.Bw)(e)}applyToVertex(e,t,r,o){const n=(0,i.hZ)(c,t,r,o),a=(0,i.hZ)(u,t,r,o+this.componentLocalOriginLength),s=this._totalOffset/(0,i.Bw)(a);return(0,i.Ln)(e,n,a,s),e}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,l=Math.abs(r),c=Math.abs(i),u=Math.abs(o),d=Math.abs(n),h=Math.abs(a),m=Math.abs(s),p=.5*(1+Math.sign(r*n))*Math.min(l,d),f=.5*(1+Math.sign(i*a))*Math.min(c,h),v=.5*(1+Math.sign(o*s))*Math.min(u,m),g=Math.sqrt(p*p+f*f+v*v),x=Math.sign(l+r),_=Math.sign(c+i),b=Math.sign(u+o),y=Math.sign(d+n),w=Math.sign(h+a),S=Math.sign(m+s),M=this._totalOffset;if(g<M)return e[0]-=(1-x)*M,e[1]-=(1-_)*M,e[2]-=(1-b)*M,e[3]+=y*M,e[4]+=w*M,e[5]+=S*M,e;const T=Math.max(l,d),C=Math.max(c,h),I=Math.max(u,m),E=M/Math.sqrt(T*T+C*C+I*I),O=M/g,P=O-E,A=-P;return e[0]+=r*(x*A+O),e[1]+=i*(_*A+O),e[2]+=o*(b*A+O),e[3]+=n*(y*P+E),e[4]+=a*(w*P+E),e[5]+=s*(S*P+E),e}applyToMbs(e){const t=e.center,r=(0,i.Bw)(t),o=this._totalOffset/r;return(0,i.Ln)(this._tmpMbs.center,t,t,o),this._tmpMbs.radius=e.radius+e.radius*this._totalOffset/r,this._tmpMbs}applyToObb(e){return(0,a.gm)(e,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this._tmpVertex=(0,o.vt)()}applyToVertex(e,t,r,o){const n=(0,i.hZ)(c,t,r,o),a=(0,i.WQ)(u,n,this.localOrigin),s=this.offset/(0,i.Bw)(a);return(0,i.Ln)(e,n,a,s),e}applyToAabb(e){const t=d,r=h,i=m;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(this._tmpVertex,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(this._tmpVertex,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 c=(0,o.vt)(),u=(0,o.vt)(),d=(0,o.vt)(),h=(0,o.vt)(),m=(0,o.vt)()},46606(e,t,r){r.d(t,{S:()=>s,p:()=>l}),r(34727),r(77690),r(29242),r(58083);var i=r(9093),o=(r(35522),r(51850)),n=(r(78955),r(91829),r(31756),r(26857),r(16943),r(65786));class a extends n.Y{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}(0,i.vt)(),(0,o.vt)(),(0,i.vt)();class s extends a{constructor(){super(...arguments),this.renderOccluded=1,this.emissiveStrength=0,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const l=8},19245(e,t,r){r.d(t,{Um:()=>l,MB:()=>s,kE:()=>n});var i=r(4576),o=r(34727);r(44208);function n(e,t,r,i,n,a){let s=r.screenLength*e.pixelRatio;null!=n&&(c.update(i,t,n,a),s=c.apply(s));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.qE)(l*t,r.minWorldLength,r.maxWorldLength)}const a=(0,i.VO)();function s(e,t){let r=!1;for(const i in t){const o=t[i];void 0!==o&&(Array.isArray(o)?Array.isArray(e[i])&&a(o,e[i])||(e[i]=o.slice(),r=!0):e[i]!==o&&(r=!0,e[i]=o))}return r}const l={multiply:1,ignore:2,replace:3,tint:4},c=new class{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(e,t,r,i){r?(this._scale=Math.min(r.divisor/(t-r.offset),1),this._angleFactor=function(e){return Math.abs(e)**3}(e),this._minScale=null!=i?Math.min(r.minPixelSize/i,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(e){const{_scale:t,_angleFactor:r,_minScale:i}=this;return e*(0,o.qE)((0,o.Cc)(t,1,r),i,1)}applyVec2(e,t){e[0]=this.apply(t[0]),e[1]=this.apply(t[1])}}},47630(e,t,r){r.d(t,{D:()=>h});var i=r(49255),o=r(47187),n=r(42593),a=r(63365);function s(e){e.code.add("\n vec3 emissionFilter(in vec3 srcColor, float srcAlpha) {\n vec3 color = min(srcColor + vec3(1.0 - srcAlpha), 1.0);\n float m = max(color.r, max(color.g, color.b));\n return m > 0.0 ? color / m : vec3(1.0);\n }\n ")}var l=r(31821),c=r(26934),u=r(58243),d=r(72458);function h(e,t){e.include(n.Q,t),e.include(o.zp,t);const{fragment:r,outputs:h}=e;r.include(a.a);const{output:m,hasEmission:p,oitPremultipliedAlpha:f,snowCover:v,emissionDimmingPass:g,renderOccluded:x}=t,_=11===m,b=(0,i._$)(m),y=(0,i.Rb)(m),w=(0,i._o)(m)&&!b,S=0!==m||x;let M=0;(w||b)&&h.add("fragColor","vec4",M++),b&&h.add("fragAlpha","float",M++),p&&h.add("fragEmission","vec4",M++),r.include(a.a),r.include(c.Q),r.include(d.O,t),r.include(u.t,t),g&&r.include(s),r.code.add(l.H`
1708
+ }`))}},49718(e,t,r){r(51850),r(6867).w_},6867(e,t,r){r.d(t,{w_:()=>d});var i=r(58083),n=r(9093),o=r(35522),a=r(51850),s=r(78955),l=r(91829),c=r(71351);class u{constructor(){this.intersector=4}get distance(){return this._distance}get renderDistance(){return this._renderDistance}_init(){this._distance=this._renderDistance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4}_setBase(e,t,r,i=null,n=null,o=null){this.intersector=e,this._distance=r,this._renderDistance=i,this.target=t,this.drapedLayerOrder=n,this.renderPriority=o}}class d extends u{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.hs)(m,this.ray.direction,this.distance),(0,o.Bw)(m))}withinDistance(e){return!!h(this)&&null!=this.distanceInRenderSpace&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!h(this)&&((0,o.hs)(m,this.ray.direction,this.distance),(0,o.WQ)(e,this.ray.origin,m),!0)}getTransformedNormal(e){return(0,o.C)(p,this.normal),p[3]=0,(0,s.Z0)(p,p,this.transformation),(0,o.C)(e,p),(0,o.S8)(e,e)}constructor(e){super(),this.normal=(0,a.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){super._init(),e&&(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,u,d){this._setBase(e,t,r,s,u,d),(0,o.C)(this.normal,l??a.Cb),(0,i.C)(this.transformation,c??n.zK)}copy(e){this._setBase(e.intersector,e.target,e.distance,e.renderDistance,e.drapedLayerOrder,e.renderPriority),(0,c.C)(e.ray,this._ray),(0,o.C)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function h(e){return null!=e?.distance&&null!=e?.renderDistance}const m=(0,a.vt)(),p=(0,l.vt)()},16396(e,t,r){r.d(t,{ou:()=>l}),r(77690),r(29242),r(58083),r(9093);var i=r(35522),n=r(51850),o=r(94008),a=r(57005);const s=new class{constructor(e=0){this.offset=e,this._tmpSphere=new o.iy}applyToVertex(e,t,r,n){const o=this.objectTransform.transform,a=(0,i.hZ)(c,t,r,n),s=(0,i.Z0)(a,a,o),l=this.offset/(0,i.Bw)(s);(0,i.Ln)(s,s,s,l);const u=this.objectTransform.inverse;return(0,i.Z0)(e,s,u),e}applyToMinMax(e,t){const r=this.offset/(0,i.Bw)(e);(0,i.Ln)(e,e,e,r);const n=this.offset/(0,i.Bw)(t);(0,i.Ln)(t,t,t,n)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=e.center,r=(0,i.Bw)(t),n=this.offset/r;return(0,i.Ln)(this._tmpSphere.center,t,t,n),this._tmpSphere.radius=e.radius+e.radius*this.offset/r,this._tmpSphere}};function l(e){return null!=e?(s.offset=e,s):null}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpMbs=new o.iy,this._tmpObb=new a.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.Bw)(e)}applyToVertex(e,t,r,n){const o=(0,i.hZ)(c,t,r,n),a=(0,i.hZ)(u,t,r,n+this.componentLocalOriginLength),s=this._totalOffset/(0,i.Bw)(a);return(0,i.Ln)(e,o,a,s),e}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),u=Math.abs(n),d=Math.abs(o),h=Math.abs(a),m=Math.abs(s),p=.5*(1+Math.sign(r*o))*Math.min(l,d),f=.5*(1+Math.sign(i*a))*Math.min(c,h),v=.5*(1+Math.sign(n*s))*Math.min(u,m),g=Math.sqrt(p*p+f*f+v*v),x=Math.sign(l+r),_=Math.sign(c+i),b=Math.sign(u+n),y=Math.sign(d+o),w=Math.sign(h+a),S=Math.sign(m+s),M=this._totalOffset;if(g<M)return e[0]-=(1-x)*M,e[1]-=(1-_)*M,e[2]-=(1-b)*M,e[3]+=y*M,e[4]+=w*M,e[5]+=S*M,e;const T=Math.max(l,d),C=Math.max(c,h),I=Math.max(u,m),E=M/Math.sqrt(T*T+C*C+I*I),O=M/g,P=O-E,D=-P;return e[0]+=r*(x*D+O),e[1]+=i*(_*D+O),e[2]+=n*(b*D+O),e[3]+=o*(y*P+E),e[4]+=a*(w*P+E),e[5]+=s*(S*P+E),e}applyToMbs(e){const t=e.center,r=(0,i.Bw)(t),n=this._totalOffset/r;return(0,i.Ln)(this._tmpMbs.center,t,t,n),this._tmpMbs.radius=e.radius+e.radius*this._totalOffset/r,this._tmpMbs}applyToObb(e){return(0,a.gm)(e,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this._tmpVertex=(0,n.vt)()}applyToVertex(e,t,r,n){const o=(0,i.hZ)(c,t,r,n),a=(0,i.WQ)(u,o,this.localOrigin),s=this.offset/(0,i.Bw)(a);return(0,i.Ln)(e,o,a,s),e}applyToAabb(e){const t=d,r=h,i=m;for(let n=0;n<3;++n)t[n]=e[0+n]+this.localOrigin[n],r[n]=e[3+n]+this.localOrigin[n],i[n]=t[n];const n=this.applyToVertex(this._tmpVertex,t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=n[t],e[t+3]=n[t];const o=t=>{const r=this.applyToVertex(this._tmpVertex,t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let n=0;n<3;++n)i[n]=e&1<<n?r[n]:t[n];o(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0===(a&e)){for(let n=0;n<3;++n)i[n]=a&1<<n?0:e&1<<n?t[n]:r[n];o(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const c=(0,n.vt)(),u=(0,n.vt)(),d=(0,n.vt)(),h=(0,n.vt)(),m=(0,n.vt)()},46606(e,t,r){r.d(t,{S:()=>s,p:()=>l}),r(34727),r(77690),r(29242),r(58083);var i=r(9093),n=(r(35522),r(51850)),o=(r(78955),r(91829),r(31756),r(26857),r(16943),r(65786));class a extends o.Y{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}(0,i.vt)(),(0,n.vt)(),(0,i.vt)();class s extends a{constructor(){super(...arguments),this.renderOccluded=1,this.emissiveStrength=0,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const l=8},19245(e,t,r){r.d(t,{Um:()=>l,MB:()=>s,kE:()=>o});var i=r(4576),n=r(34727);r(44208);function o(e,t,r,i,o,a){let s=r.screenLength*e.pixelRatio;null!=o&&(c.update(i,t,o,a),s=c.apply(s));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.qE)(l*t,r.minWorldLength,r.maxWorldLength)}const a=(0,i.VO)();function s(e,t){let r=!1;for(const i in t){const n=t[i];void 0!==n&&(Array.isArray(n)?Array.isArray(e[i])&&a(n,e[i])||(e[i]=n.slice(),r=!0):e[i]!==n&&(r=!0,e[i]=n))}return r}const l={multiply:1,ignore:2,replace:3,tint:4},c=new class{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(e,t,r,i){r?(this._scale=Math.min(r.divisor/(t-r.offset),1),this._angleFactor=function(e){return Math.abs(e)**3}(e),this._minScale=null!=i?Math.min(r.minPixelSize/i,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(e){const{_scale:t,_angleFactor:r,_minScale:i}=this;return e*(0,n.qE)((0,n.Cc)(t,1,r),i,1)}applyVec2(e,t){e[0]=this.apply(t[0]),e[1]=this.apply(t[1])}}},47630(e,t,r){r.d(t,{D:()=>h});var i=r(49255),n=r(47187),o=r(42593),a=r(63365);function s(e){e.code.add("\n vec3 emissionFilter(in vec3 srcColor, float srcAlpha) {\n vec3 color = min(srcColor + vec3(1.0 - srcAlpha), 1.0);\n float m = max(color.r, max(color.g, color.b));\n return m > 0.0 ? color / m : vec3(1.0);\n }\n ")}var l=r(31821),c=r(26934),u=r(58243),d=r(72458);function h(e,t){e.include(o.Q,t),e.include(n.zp,t);const{fragment:r,outputs:h}=e;r.include(a.a);const{output:m,hasEmission:p,oitPremultipliedAlpha:f,snowCover:v,emissionDimmingPass:g,renderOccluded:x}=t,_=11===m,b=(0,i._$)(m),y=(0,i.Rb)(m),w=(0,i._o)(m)&&!b,S=0!==m||x;let M=0;(w||b)&&h.add("fragColor","vec4",M++),b&&h.add("fragAlpha","float",M++),p&&h.add("fragEmission","vec4",M++),r.include(a.a),r.include(c.Q),r.include(d.O,t),r.include(u.t,t),g&&r.include(s),r.code.add(l.H`
1709
1709
  void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${(0,l.If)(v,", float snow")}) {
1710
1710
  ${(0,l.If)(_,"finalColor.a = 1.0;")}
1711
1711
  ${(0,l.If)(S,"if (finalColor.a < alphaCutoff) discard;")}
@@ -1717,7 +1717,7 @@ mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);
1717
1717
  calculateOcclusionAndOutputHighlight();
1718
1718
  ${(0,l.If)(_,"outputObjectAndLayerIdColor();")}
1719
1719
  }
1720
- `)}},18519(e,t,r){r.d(t,{b:()=>o});var i=r(31821);function o(e){e.code.add(i.H`vec3 tonemapACES(vec3 x) {
1720
+ `)}},18519(e,t,r){r.d(t,{b:()=>n});var i=r(31821);function n(e){e.code.add(i.H`vec3 tonemapACES(vec3 x) {
1721
1721
  return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
1722
1722
  }`),e.code.add(i.H`vec3 tonemapKhronosNeutral(vec3 color) {
1723
1723
  const float startCompression = 0.76;
@@ -1731,4 +1731,4 @@ float newPeak = 1.0 - d * d / (peak + d - startCompression);
1731
1731
  color *= newPeak / peak;
1732
1732
  float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0 );
1733
1733
  return mix(color, vec3(newPeak), g);
1734
- }`)}},26934(e,t,r){r.d(t,{Q:()=>o});var i=r(49788);function o(e){e.constants.add("alphaCutoff","float",i.Q),e.constants.add("opacityCutoff","float",i.v)}},58243(e,t,r){function i(e,t){t.useFloatBlend?e.code.add("float ditherNoise(vec4 color) { return 0.0; }"):e.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}r.d(t,{t:()=>i})},72458(e,t,r){r.d(t,{C:()=>n,O:()=>a});var i=r(32198),o=r(51976);class n extends o.K{constructor(){super(...arguments),this.useFloatBlend=!0}}function a(e,t){t.useFloatBlend?(e.constants.add("floatBlendOutputScale","float",1),e.constants.add("floatBlendInputScale","float",1)):(e.constants.add("floatBlendOutputScale","float",1/16),e.constants.add("floatBlendInputScale","float",16)),e.constants.add("maxEmissiveStrength","float",16)}(0,i.Cg)([(0,o.W)()],n.prototype,"useFloatBlend",void 0)},89904(e,t,r){r.d(t,{OG:()=>$e,gP:()=>Ge});var i=r(32198),o=r(69540),n=r(91429);let a=class extends o.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"row",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"column",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"rows",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"columns",void 0),a=(0,i.Cg)([(0,n.$K)("esri.CameraLayout")],a);const s=a;var l=r(69052),c=r(25482),u=r(34727),d=r(78888),h=r(86738),m=r(43937),p=r(36005);let f=class extends((0,o.OU)(c.o)){constructor(...e){super(...e),this.position=new h.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new s}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const o={position:e};return null!=t&&(o.heading=t),null!=r&&(o.tilt=r),null!=i&&(o.fov=i),o}return e}writePosition(e,t,r,i){const o=e.clone();o.x=(0,d.GB)(e.x||0),o.y=(0,d.GB)(e.y||0),o.z=e.hasZ?(0,d.GB)(e.z||0):e.z,t[r]=o.write({},i)}readPosition(e,t){const r=new h.A;return r.read(e,t),r.x=(0,d.GB)(r.x||0),r.y=(0,d.GB)(r.y||0),r.z=r.hasZ?(0,d.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,i.Cg)([(0,n.MZ)({type:h.A,json:{write:{isRequired:!0}}})],f.prototype,"position",void 0),(0,i.Cg)([(0,m.K)("position")],f.prototype,"writePosition",null),(0,i.Cg)([(0,p.w)("position")],f.prototype,"readPosition",null),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,n.wg)(e=>l.ie.normalize((0,d.GB)(e)))],f.prototype,"heading",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,n.wg)(e=>(0,u.qE)((0,d.GB)(e),-180,180))],f.prototype,"tilt",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,n.wg)(e=>(0,u.qE)((0,d.GB)(e,55),1,170))],f.prototype,"fov",void 0),(0,i.Cg)([(0,n.MZ)({type:s,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"layout",void 0),f=(0,i.Cg)([(0,n.$K)("esri.Camera")],f);var v=r(9093),g=r(35522),x=r(51850),_=r(16930),b=(r(48353),r(9762),r(65806)),y=r(27993),w=r(73941),S=(r(19419),r(58083)),M=r(65720),T=r(71351),C=r(69622),I=r(53966),E=r(90629),O=r(37585),P=r(48163),A=r(78955),D=r(91829),F=r(44280);function R(e,t,r){e.worldUpAtPosition(t,B),(0,g.Re)(N,r,t);const i=(0,g.Bw)(N);return 0===i?0:(0,u.XM)((0,g.Om)(N,B)/i)}const B=(0,x.vt)(),N=(0,x.vt)();var z;let j=z=class extends C.A{constructor(e){super(e),this._ray=(0,T.vt)(),this._viewport=(0,D.fA)(0,0,1,1),this._padding=(0,D.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,P.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,v.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,v.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,v.vt)(),this._frustumDirty=!0,this._frustum=(0,M.vt)(),this._fullViewport=(0,D.vt)(),this._fullViewportDirty=!0,this._pixelRatio=1,this.pixelScale=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,x.vt)(),this._up=(0,x.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin,"eye")}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,g.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,S.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get inverseViewMatrix(){return(0,S.Qw)((0,v.vt)(),this.viewMatrix)||this._get("inverseViewMatrix")||(0,v.vt)()}get viewForward(){return this._ensureViewClean(),(0,g.hZ)((0,x.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,g.hZ)((0,x.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,g.hZ)((0,x.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,A.hs)((0,D.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,A.aI)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,A.hs)((0,D.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,A.aI)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewportDirty&&(this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this._viewport[2]+this._padding[1]+this._padding[3],this._fullViewport[3]=this._viewport[3]+this._padding[0]+this._padding[2],this._fullViewportDirty=!1),this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,A.t2)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,A.C)(this._padding,e),this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,S.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,S.B8)((0,v.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,v.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,g.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,S.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,S.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,o=r/this.rows,n=i/this.columns,a=-i/2+this.column*n,s=a+n,l=-r/2+this.row*o,c=l+o,u=(0,S.$h)((0,v.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),d=this._get("projectionMatrix");return d&&(0,S.t2)(d,u)?d:u}copyFrom(e){(0,g.C)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,A.C)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,A.C)(this._padding,e.padding),this.notifyChange("_padding"),this._fullViewportDirty=!0,(0,O.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,S.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,M.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,S.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this.pixelRatio=e.pixelRatio,this.pixelScale=e.pixelScale,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new z).copyFrom(this)}equals(e){return(0,g.t2)(this.eye,e.eye)&&(0,g.t2)(this.center,e.center)&&(0,g.t2)(this.up,e.up)&&(0,A.t2)(this._viewport,e.viewport)&&(0,A.t2)(this._padding,e.padding)&&(0,O.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}equalsView(e){return(0,g.t2)(this.eye,e.eye)&&(0,g.t2)(this.center,e.center)&&(0,g.t2)(this.up,e.up)&&this._fov===e.fov}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,A.hG)(e.screenPadding,this.screenPadding)>=t||(0,A.hG)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,g.jb)(W,e.eye,e.center),(0,g.jb)(V,this.eye,this.center);const r=(0,g.Om)(W,V),i=(0,g.uE)(W),o=(0,g.uE)(V),n=5e-4;return r*r>=(1-1e-10)*i*o&&(0,g.lo)(e.eye,this.eye)<Math.max(i,o)*n*n}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,F.gr)(this.viewForward,(0,g.Re)(W,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,E.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==H&&(0,g.C)(H,e),H[3]=1,(0,A.Z0)(H,H,this.projectionMatrix);const r=Math.abs(H[3]);(0,g.hs)(H,H,1/r);const i=this.fullViewport;t[0]=(0,u.Cc)(0,i[0]+i[2],.5+.5*H[0]),t[1]=(0,u.Cc)(0,i[1]+i[3],.5+.5*H[1]),t[2]=.5*(H[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;H[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],H[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],H[2]=(2*e[2]-1)*e[3],H[3]=e[3],null!=this.inverseProjectionMatrix&&((0,A.Z0)(H,H,this.inverseProjectionMatrix),t[0]=H[0],t[1]=H[1],t[2]=H[2])}projectToScreen(e,t){return null==this.projectToRenderScreen(e,U)?null:(this.renderToScreen(U,t),t)}projectToRenderScreen(e,t){if(H[0]=e[0],H[1]=e[1],H[2]=e[2],H[3]=1,(0,A.Z0)(H,H,this.viewProjectionMatrix),0===H[3])return null;const r=H;(0,g.hs)(r,r,1/Math.abs(H[3]));const i=this.fullViewport,o=(0,u.Cc)(0,i[0]+i[2],.5+.5*r[0]),n=(0,u.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=o,t.y=n):(t[0]=o,t[1]=n,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,U),t)}unprojectFromRenderScreen(e,t){if((0,S.lw)(L,this.projectionMatrix,this.viewMatrix),!(0,S.B8)(L,L))return null;const r=this.fullViewport;return H[0]=2*(e[0]-r[0])/r[2]-1,H[1]=2*(e[1]-r[1])/r[3]-1,H[2]=2*e[2]-1,H[3]=1,(0,A.Z0)(H,H,L),0===H[3]?null:(t[0]=H[0]/H[3],t[1]=H[1]/H[3],t[2]=H[2]/H[3],t)}constrainWindowSize(e,t,r,i){const o=e*this.pixelRatio,n=t*this.pixelRatio,a=Math.max(o-r/2,0),s=Math.max(this.fullHeight-n-i/2,0),l=-Math.min(o-r/2,0),c=-Math.min(this.fullHeight-n-i/2,0),u=r-l- -Math.min(this.fullWidth-o-r/2,0),d=i-c- -Math.min(n-i/2,0);return[Math.round(a),Math.round(s),Math.round(u),Math.round(d)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:o,fovY:n}=this,a=Math.abs(Math.PI/2-R(t,r,i));return e.frustumCoverage(a,o,n)}_computeUpGlobal(){(0,g.Re)(W,this.center,this.eye);const e=(0,g.Bw)(this.center);e<1?(0,g.t2)(this._up,x.Cb)&&((0,g.C)(this._up,x.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,g.Om)(W,this.center))>.9999*(0,g.Bw)(W)*e||((0,g.$A)(V,W,this.center),(0,g.$A)(V,V,W),(0,g.S8)(V,V),(0,g.t2)(this._up,V)||((0,g.C)(this._up,V),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,g.oW)(W,this.eye,this.center),Math.abs(W[2])<=.9999&&((0,g.hs)(W,W,W[2]),(0,g.hZ)(W,-W[0],-W[1],1-W[2]),(0,g.S8)(W,W),(0,g.t2)(this._up,W)||((0,g.C)(this._up,W),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,g.t2)(e,t)||((0,g.C)(t,e),this._markViewDirty(),this.notifyChange(r)):I.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,M.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,S.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,i.Cg)([(0,n.MZ)()],j.prototype,"_viewport",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"_padding",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"_fov",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"_nearFar",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"_viewDirty",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"_viewMatrix",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"pixelRatio",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"_pixelRatio",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"pixelScale",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"row",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"column",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"_rows",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"rows",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"_columns",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"columns",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"eye",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"center",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"_center",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"up",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"_up",void 0),(0,i.Cg)([(0,n.MZ)()],j.prototype,"viewMatrix",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],j.prototype,"inverseViewMatrix",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],j.prototype,"viewForward",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],j.prototype,"viewUp",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],j.prototype,"viewRight",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],j.prototype,"nearFar",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"near",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"far",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"viewport",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],j.prototype,"screenViewport",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],j.prototype,"screenPadding",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"x",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"y",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"width",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"height",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"fullWidth",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"fullHeight",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],j.prototype,"_aspect",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"padding",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],j.prototype,"projectionMatrix",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],j.prototype,"inverseProjectionMatrix",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"fov",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"fovX",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"fovY",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"viewInverseTransposeMatrix",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],j.prototype,"_projectionMatrixInternal",null),(0,i.Cg)([(0,n.MZ)()],j.prototype,"relativeElevation",void 0),j=z=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl.RenderCamera")],j);const H=(0,D.vt)(),L=(0,v.vt)(),W=(0,x.vt)(),V=(0,x.vt)(),U=(0,E.r_)();r(49718),r(6867),r(16396),(0,v.vt)(),(0,x.vt)(),(0,x.vt)(),(0,x.vt)();var G=r(5443),k=r(39829),$=r(95108);function Z(e,t,r,i){const o=function(e,t){const r=0===t||2===t?0:1,i=e[t],o=0===t||1===t?1:-1,n=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===o?0:1;if(t[r]>i&&a[r]>i)return 1===o?1:0;const s=(a[n]-t[n])/(a[r]-t[r]),l=t[n]+s*(i-t[r]);return e[r]=i,e[n]=l,(t[r]<i?1:-1)*o>0?2:3}}(r,i);if(e.length=0,t.length){1===o(Y,t[0],t[0])&&q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(o(Y,t[r],i)){case 1:q(e,i);break;case 3:q(e,(0,P.o8)(Y));break;case 2:q(e,(0,P.o8)(Y)),q(e,i)}}}}function q(e,t){0!==e.length&&(0,O.aI)(e.at(-1),t)||e.push(t)}const Y=(0,P.vt)();var K=r(11964),X=r(27921);const J=(0,x.vt)(),Q=(0,x.vt)();function ee(){return{direction:(0,x.vt)(),up:(0,x.vt)()}}function te(e,t,r,i,o){let n=(0,g.S8)(J,e),a=(0,g.Om)(n,i);const s=a>0;a=Math.abs(a),a>.99&&(a=Math.abs((0,g.Om)(t,i)),a<.99?((0,g.C)(n,t),s&&(0,g.hs)(n,n,-1)):n=null);let l=0;if(n){(0,g.hs)(Q,i,(0,g.Om)(i,n)),(0,g.Re)(n,n,Q);const e=(0,g.Om)(n,o)/((0,g.Bw)(n)*(0,g.Bw)(o));(0,g.$A)(Q,n,o),l=((0,g.Om)(Q,i)>0?1:-1)*(0,u.KJ)((0,u.XM)(e))}const c=(0,u.KJ)((0,u.XM)(-(0,g.Om)(i,e)/(0,g.Bw)(e)));return r?(r.heading=l,r.tilt=c,r):{heading:l,tilt:c}}function re(e,t,r,i){(0,g.Re)(ie,r,t),(0,X.T7)(i,(0,K.LV)(t,ie),e)||e===r||(0,g.C)(e,r)}const ie=(0,x.vt)(),oe=(0,x.fA)(0,1,0),ne=(0,x.fA)(0,0,1),ae=(0,v.vt)(),se=(0,x.vt)(),le=(0,x.vt)();function ce(e,t,r,i=ee()){const{direction:o,up:n}=i;return(0,S.N9)(ae,-(0,u.kU)(t)),(0,S.eL)(ae,ae,(0,u.kU)(r)),(0,g.Z0)(o,ne,ae),(0,g.hs)(o,o,-1),(0,g.Z0)(n,oe,ae),i}function ue(e,t,r,i,o){const n=t.lines[11].direction,a=(o-r.getAltitude(i))/n[2];(0,g.Ln)(e,i,n,a)}const de=(0,x.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return te(t,r,i,ne,oe)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o=ce(0,r,i),n=(0,x.vt)();return(0,g.hs)(n,o.direction,-t),(0,g.WQ)(n,n,e),{up:o.up,eye:n,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,u.kU)(e)},headingTiltToDirectionUp:ce,lookAtTiltToEyeTilt:function(e){return(0,u.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,o=i.getAltitude(t),n=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,T.LV)(t.origin,t.direction),o,de)||ue(de,r,i,t.endpoint,o),re(de,a,de,l),s.push((0,P.fA)(de[0],de[1]))}return function(e,t,r){const i=e.map(e=>((0,g.hZ)(de,e[0],e[1],0),t.fromRenderCoords(de,de,r),[de[0],de[1]]));return i.length<=2?new k.A({spatialReference:r}):(i.push(i[0].slice()),(0,$.$3)(i)||i.reverse(),new k.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return Z(r,e,t,0),Z(i,r,t,1),Z(r,i,t,2),Z(i,r,t,3),i}(s,i.extent),i,n)},toExtent:function(e,t,r,i,o){const n=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,b.g)(t,se,n),(0,b.g)(t,le,n),se[0]-=r/2,le[0]+=r/2,se[1]-=i/2,le[1]+=i/2,(0,y.F)(se,n,se,a),(0,y.F)(le,n,le,a),o?(o.xmin=se[0],o.ymin=se[1],o.xmax=le[0],o.ymax=le[1],o.spatialReference=a):o=new G.A(se[0],se[1],le[0],le[1],a),o}},Symbol.toStringTag,{value:"Module"}));var he=r(34304),me=r(52039),pe=r(94008),fe=r(28735);class ve{get planes(){return this.frustum}get points(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,M.vt)(),this._points=(0,M.Qy)(),this.lines=new Array(12),this._origin=(0,x.vt)(),this._direction=(0,x.vt)(),this._boundingSphere=new pe.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,x.vt)(),endpoint:null}}update(e){(0,M.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,g.C)(this._origin,e.eye),(0,g.C)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}get altitude(){return this._altitude}intersectsSphere(e){return(0,M.m7)(this.frustum,e)}isConvexHullOutsideViewPyramid(e,t){return(0,M.Pi)(this.frustum,e,t)}intersectsRay(e){return(0,M.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,M.ST)(this.frustum,e,t)}lineSegmentIntersectsViewPyramid(e,t){return(0,M.LJ)(this.frustum,e,t)}intersectsPoint(e){return(0,M.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;ge(this.lines[t],e[t],e[r]),ge(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),ge(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){const{origin:e}=this,t=_e;(0,g.S8)(t,this.direction);const r=xe;(0,g.jb)(r,this.points[4],e);const i=.5*(0,g.Om)(r,r)/(0,g.Om)(t,r),o=this._boundingSphere,n=(0,g.Ln)(be,e,t,i);o.center=n,o.radius=i}static{this.planePointIndices=M.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function ge(e,t,r){e.origin=t,e.endpoint=r,(0,g.oW)(e.direction,t,r)}const xe=(0,x.vt)(),_e=(0,x.vt)(),be=(0,x.vt)();r(86211);const ye=(0,x.fA)(5802e-9,13558e-9,331e-7),we=(0,x.fA)(65e-8*3,5643e-9,255e-9);(0,x.fA)(ye[0]+we[0],ye[1]+we[1],ye[2]+we[2]);class Se{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Se(0,0)}static{this.Infinite=new Se}}(0,x.vt)(),(0,x.vt)(),new pe.iy,(0,T.vt)(),new G.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var Me=r(32728);const Te=(0,x.fA)(0,0,1),Ce=(0,g.S8)((0,x.vt)(),(0,x.fA)(1,1,1)),Ie=(0,v.vt)(),Ee=(0,x.vt)(),Oe=(0,x.vt)();function Pe(e,t,r,i=ee()){(0,g.$A)(Ee,e,Te),0===(0,g.Om)(Ee,Ee)&&(0,g.$A)(Ee,e,Ce),(0,S.$0)(Ie,-(0,u.kU)(t),e),(0,S.e$)(Ie,Ie,-(0,u.kU)(r),Ee);const{up:o,direction:n}=i;return(0,g.$A)(o,Ee,e),(0,g.S8)(o,o),(0,g.Z0)(o,o,Ie),(0,g.S8)(n,e),(0,g.ze)(n,n),(0,g.Z0)(n,n,Ie),i}function Ae(e){const t=e[1];e[1]=-e[2],e[2]=t}function De(e,t){const r=Pe(t,e.heading,e.tilt);return e.up=r.up,e}function Fe(e,t){const{renderCoordsHelper:r,state:i}=e;if(1!==i.viewingMode)return 1;const o=r.getAltitude(t),n=r.referenceEllipsoid.radius,a=1+(0,g.Io)(i.camera.eye,t)/(n+o),s=Math.sqrt(a*a-1),{minCurvature:l,maxCurvature:c,minSamples:d,maxSamples:h}=Be,m=(0,u.qE)((s-l)/(c-l),0,1);return Math.round((0,u.Cc)(d,h,m))}function Re(e,t){const r=[],i=[],o=(0,he.FD)();for(let n=0;n<e.length;n++){const a=e[n],s=n===e.length-1?e[0]:e[n+1],l=(0,K.Cr)(a,s,Ve),c=(0,X.vE)(t,l.origin,l.vector,0,Le);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,n,s]=0===c?[1,r,i]:[-1,i,r],l=(0,X.Qj)(t),u=(0,g.Ln)((0,x.vt)(),Le,l,e*o),d=(0,g.Ln)((0,x.vt)(),Le,l,e*-o);n.push(a),n.push(u),s.push(d)}}}const n=[];return r.length&&n.push(r),i.length&&n.push(i),n}const Be={minCurvature:(0,u.kU)(5),maxCurvature:(0,u.kU)(50),minSamples:1,maxSamples:6},Ne=(0,x.fA)(1,0,0),ze=(0,x.fA)(0,1,0),je=(0,x.vt)(),He=(0,x.vt)(),Le=(0,x.vt)(),We=new pe.iy,Ve=(0,K.vt)(),Ue=(0,D.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const o=Ee,n=Oe;return(0,g.S8)(o,e),(0,g.$A)(Oe,o,Te),0===(0,g.Om)(Oe,Oe)&&(0,g.$A)(Oe,o,Ce),(0,g.$A)(n,Oe,o),te(t,r,i,o,n)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o={eye:(0,x.vt)(),up:null,tilt:i,heading:r},n=Ee;n[0]=e[0],n[1]=e[2],n[2]=-e[1];const a=t,s=(0,u.kU)(r),l=(0,u.kU)(i),c=Math.sin(s),d=Math.cos(s),h=Math.sin(l),m=Math.cos(l),p=(0,g.Bw)(n);let f;if(Math.abs(l)<1e-8)f=a+p;else{const e=p/h,t=(0,u.YN)(a/e),r=Math.PI-l-t;f=e*Math.sin(r)}const v=m*a,_=a*a*(h*h),b=d*d*_,y=f-v,w=y*y,S=b*(b+w-n[1]*n[1]);if(S<0)return(0,g.hs)(o.eye,n,f/p),o.tilt=0,De(o,e);const M=Math.sqrt(S),T=n[1]*y,C=b+w;let I;if(I=d>0?-M+T:M+T,Math.abs(C)<1e-8)return p<1e-8?(o.eye[0]=0,o.eye[1]=0,o.eye[2]=a):(0,g.hs)(o.eye,n,f/p),o.tilt=0,Ae(o.eye),De(o,e);o.eye[1]=I/C;const E=c*c*_,O=h*a,P=d*O*o.eye[1],A=o.eye[1]*o.eye[1],D=1-A,F=Math.sqrt(D),R=b*A+E-2*P*F*y+D*w;return Math.abs(R)<1e-8?((0,g.hs)(o.eye,n,f/p),o.tilt=0,Ae(o.eye),De(o,e)):(o.eye[0]=(D*(f*n[0]-v*n[0])-O*F*(n[0]*o.eye[1]*d+n[2]*c))/R,o.eye[2]=(D*(f*n[2]-v*n[2])-O*F*(n[2]*o.eye[1]*d-n[0]*c))/R,(0,g.hs)(o.eye,o.eye,f),Ae(o.eye),De(o,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,u.kU)(e),o=(0,g.Bw)(t);return(0,u.YN)(r/(o/Math.sin(i)))+i},getCurvatureSamples:Fe,headingTiltToDirectionUp:Pe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,g.Bw)(t),o=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),n=(0,u.YN)(r/(o/Math.sin(e)));return(0,u.KJ)(e-n)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),o=new ve(r);i.near=2,o.update(i);const n=r.getAltitude(t),a=e.spatialReference,s=i.eye,l=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return We.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(We,t)}(e),c=Fe(e,t),d=i.aboveGround,h=o.planes[5],m=[],p=(0,X.O_)(x.uY,Ne,(0,X.vt)()),f=(0,X.O_)(x.uY,ze,(0,X.vt)());(0,A.hZ)(Ue,0,0,0,0);const v=e=>{};for(let e=0;e<4;e++){const t=1===e&&!d||3===e&&d?1-l:0,i=1===e&&d||3===e&&!d?l:1,a=o.lines[e],_=o.lines[3===e?0:e+1];for(let o=0;o<c;o++){const l=o/c,d=0===o?0:(0,u.Cc)(t,i,1===e?1-(1-l)**2:3===e?l**2:l),b=(0,g.Cc)(He,a.origin,_.origin,d),y=(0,Me.nu)(a.direction,_.direction,d,je);r.intersectManifoldClosestSilhouette((0,T.LV)(b,y),n,Le),re(Le,s,Le,h),m.push((0,x.o8)(Le)),0!==m.length&&v((0,g.lo)(m.at(-1),Le));const w=((0,X.BX)(p,Le)?1:0)|((0,X.BX)(f,Le)?2:0);Ue[w]=1}}m.length>2&&(0,g.lo)(m[0],m.at(-1));const _=function(e,t,r){const i=2*(0,he.FD)();return e.map(e=>{const o=[];let n=!1;for(const a of e)t.fromRenderCoords(a,Le,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(o.push([null,Le[1]]),o.push([null,Le[1]]),n=!0):o.push([Le[0],Le[1]]);if(n)for(let e=0;e<o.length;e++){const t=o[e];if(null!=t[0])continue;const r=o[e+1],i=o.at(0===e?-1:e-1);t[0]=i[0],e++;const n=o.at(e===o.length-1?0:e+1);r[0]=n[0]}return o.push(o[0]),(0,$.$3)(o)||o.reverse(),o})}((0,A.m3)(Ue)>1?function(e,t){const r=[];for(const i of e)r.push(...Re(i,t));return r}(Re(m,p),f):[m],r,a);return new k.A({rings:_,spatialReference:a})},toExtent:function(e,t,r,i,o){let n,a,s,c;const d=t.latitude,h=(0,w.tO)(e.spatialReference).radius,m=t.longitude,p=function(e,t,r){const i=t/r,o=(0,u.kU)(e),n=Math.sin(i/2),a=Math.cos(o),s=2*(0,u.YN)(Math.sqrt(n*n/(a*a)));return(0,u.KJ)(s)}(d,r,h)/2;n=m-p,a=m+p;const f=(0,u.kU)(d),v=(1+Math.sin(f))/(1-Math.sin(f)),g=(v+1)*Math.tan(i/h/2),x=g*g;function b(e){const t=Math.PI/2;return(e=l.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(s=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*v+x))),c=s+i/h,s=b(s),c=b(c),c<s){const e=c;c=s,s=e}if(s=Math.max((0,u.KJ)(s),-90),c=Math.min((0,u.KJ)(c),90),a=me.Y_.monotonic(n,a),a-n>180){const e=(a-n-180)/2;n+=e,a-=e}const y=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:_.A.WGS84;return o?(o.xmin=n,o.ymin=s,o.xmax=a,o.ymax=c,o.spatialReference=y):o=new G.A(n,s,a,c,y),e.spatialReference&&e.spatialReference.isWebMercator&&(0,fe.Gh)(o,!1,o),o}},Symbol.toStringTag,{value:"Module"}));const Ge={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},ke=[Ge.FINAL,Ge.COMPOSITE,Ge.OPAQUE,Ge.TRANSPARENT],$e={ANTIALIASING:"antialiasing",CUTFILL:"cutfill",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA:"focusarea",FOCUSAREA_MASK:"focusarea-mask",GAUSSIAN_SPLAT:"gaussian",GAUSSIAN_SPLAT_DEPTH:"gaussian-depth",GROUND_DEPTH:"ground-depth",HIGHLIGHT:"highlight",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_ACCUMULATION:"shadow-accumulation",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values($e)).concat(ke),(0,x.vt)()},48852(e,t,r){r.d(t,{g:()=>m});var i=r(4576),o=r(44208),n=r(53966),a=r(17676),s=r(78659),l=r(34275),c=r(94656),u=r(63907);const d=()=>n.A.getLogger("esri.views.webgl.BufferObject"),h=!!(0,o.A)("esri-tests-disable-gpu-memory-measurements");class m{static createIndex(e,t,r){return new m(e,34963,t,r)}static createUniform(e,t,r){return new m(e,35345,t,r)}static createPixelPack(e,t=35041,r){const i=new m(e,35051,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=35040,r){return new m(e,35052,t,r)}static createTransformFeedback(e,t=35044,r){const i=new m(e,35982,t);return i.setSize(r),i}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,e.instanceCounter.increment(u.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,c.Y2)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case u.pe.UNSIGNED_INT:return this._sizeBytes/4;case u.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case u.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return h?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(u.vt.BufferObject,this),this._context=null):this._glName&&d().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(34963===this.bufferType&&null!=t)switch(this._indexType=t,t){case u.pe.UNSIGNED_SHORT:e*=2;break;case u.pe.UNSIGNED_INT:e*=4;case u.pe.UNSIGNED_BYTE:}this._setBufferData(e)}setData(e){if(!e)return;const t=e.byteLength;34963===this.bufferType&&((0,l.mg)(e)?this._indexType=u.pe.UNSIGNED_BYTE:(0,l.jq)(e)?this._indexType=u.pe.UNSIGNED_SHORT:(0,l.XJ)(e)&&(this._indexType=u.pe.UNSIGNED_INT)),this._setBufferData(t,e)}setIndexType(e){34963===this.bufferType&&(this._indexType=e)}_setBufferData(e,t=null){this._sizeBytes=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,c.Y2)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:n}=this._context;n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r),(0,c.Y2)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,o){if(r<0||o<0)return;const n=function(e){return(0,i.Xj)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(n*((r??0)+(o??0))>e.byteLength)return;t+n*(o??0)>this.usedMemory&&d().warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),a.getBufferSubData(35982,t,e,r,o),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),a.getBufferSubData(36662,t,e,r,o),this._context.unbindBuffer(36662))}async getSubDataAsync(e,t=0,r,i,o){if(await this._context.clientWaitAsync((0,s.l5)(10),o),!this._context||!this._glName)throw(0,a.NK)();this.getSubData(e,t,r,i)}}},65786(e,t,r){const i=class{};new i,r.d(t,["Y",0,i])},14113(e,t,r){r.d(t,{N5:()=>s});var i=r(49186),o=(r(44208),r(53966));const n=()=>o.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new p,this.outputs=new f}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s=o.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?x:g,u=o.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${u.join("\n")}\n${n.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${d.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];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[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];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,o,t)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];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 n().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 c{constructor(){this._entries=new Map}add(e,t){if(this._entries.has(e))throw new i.A("shaderbuilder:duplicate-input",`Duplicate input for ${e}`);this._entries.set(e,t)}get(e){const t=this._entries.get(e);if(null==t)throw new i.A("shaderbuilder:input-resolver-error",`No resolver for input ${e} found.`);return t()}}class u{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0){const e=[];for(const t of this._bodies)"string"==typeof t?e.push(t):e.push(...t());return[`void main() {\n ${e.join("\n")||""} \n}`]}if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){const e=[];for(const t of this._entries)"string"==typeof t?e.push(t):e.push(...t());return e}}class h extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new u(this),this.code=new d(this),this.constants=new v(this),this.inputs=new c}get builder(){return this}}class 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]};`)}get names(){return this._entries.map(([e])=>e)}}class p{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?n().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 ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class f{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}):n().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:f.DEFAULT_NAME,type:f.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class v{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=v._numberToFloatStr(r);break;case"int":i=v._numberToIntStr(r);break;case"uint":i=v._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])}, ${v._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${v._numberToUintStr(r[0])}, ${v._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${v._numberToUintStr(r[0])}, ${v._numberToUintStr(r[1])}, ${v._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${v._numberToUintStr(r[0])}, ${v._numberToUintStr(r[1])}, ${v._numberToUintStr(r[2])}, ${v._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>v._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",x="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},74333(e,t,r){r.d(t,{n:()=>i});class i{constructor(e,t,r,i,o=null){if(this.name=e,this.type=t,this.arraySize=o,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},66289(e,t,r){r.d(t,{R:()=>o});var i=r(48852);class o extends i.g{constructor(e,t,r,i=35044){super(e,34962,i,r),this.layout=t}}},90644(e,t,r){function i(e,t,r=32774,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function o(e,t,r,i,o=32774,n=32774,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:o,opAlpha:n,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}r.d(t,{Ey:()=>b,nk:()=>d,p3:()=>o}),r(4718);const n=i(0,771),a=(i(1,0),i(1,1),i(1,771)),s=(i(773,1),o(770,1,771,771)),l=o(0,0,768,0),c=(o(0,0,768,1),{face:1029,mode:2305}),u={face:1028,mode:2305};function d(e,t,r){return{ref:e,readMask:t,stencilFront:r,stencilBack:r}}function h(e){return S.intern(e)}function m(e){return T.intern(e)}function p(e){return I.intern(e)}function f(e){return O.intern(e)}function v(e){return A.intern(e)}function g(e){return F.intern(e)}function x(e){return B.intern(e)}function _(e){return z.intern(e)}function b(e){return H.intern(e)}class y{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 w(e){return"["+e.join(",")+"]"}const S=new y(M,e=>({__tag:"Blending",...e}));function M(e){return e?w([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 T=new y(C,e=>({__tag:"Culling",...e}));function C(e){return e?w([e.face,e.mode]):null}const I=new y(E,e=>({__tag:"PolygonOffset",...e}));function E(e){return e?w([e.factor,e.units]):null}const O=new y(P,e=>({__tag:"DepthTest",...e}));function P(e){return e?w([e.func]):null}const A=new y(D,e=>({__tag:"StencilTest",...e}));function D(e){return e?w([e.ref,e.readMask,e.stencilFront.compare,e.stencilFront.fail,e.stencilFront.zFail,e.stencilFront.zPass,e.stencilBack.compare,e.stencilBack.fail,e.stencilBack.zFail,e.stencilBack.zPass]):null}const F=new y(R,e=>({__tag:"DepthWrite",...e}));function R(e){return e?w([e.zNear,e.zFar]):null}const B=new y(N,e=>({__tag:"ColorWrite",...e}));function N(e){return e?w([e.r,e.g,e.b,e.a]):null}const z=new y(j,e=>({__tag:"StencilWrite",...e}));function j(e){return e?w([e.mask]):null}const H=new y(function(e){return e?w([M(e.blending),C(e.culling),E(e.polygonOffset),P(e.depthTest),D(e.stencilTest),R(e.depthWrite),N(e.colorWrite),j(e.stencilWrite)]):null},e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:p(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:v(e.stencilTest),depthWrite:g(e.depthWrite),colorWrite:x(e.colorWrite),stencilWrite:_(e.stencilWrite)}));r.d(t,["RC",0,a,"T8",0,s,"Uy",0,{zNear:0,zFar:1},"Xt",0,e=>2===e?c:1===e?u:null,"iD",0,n,"kn",0,{r:!0,g:!0,b:!0,a:!0},"uR",0,l])}}]);
1734
+ }`)}},26934(e,t,r){r.d(t,{Q:()=>n});var i=r(49788);function n(e){e.constants.add("alphaCutoff","float",i.Q),e.constants.add("opacityCutoff","float",i.v)}},58243(e,t,r){function i(e,t){t.useFloatBlend?e.code.add("float ditherNoise(vec4 color) { return 0.0; }"):e.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}r.d(t,{t:()=>i})},72458(e,t,r){r.d(t,{C:()=>o,O:()=>a});var i=r(32198),n=r(51976);class o extends n.K{constructor(){super(...arguments),this.useFloatBlend=!0}}function a(e,t){t.useFloatBlend?(e.constants.add("floatBlendOutputScale","float",1),e.constants.add("floatBlendInputScale","float",1)):(e.constants.add("floatBlendOutputScale","float",1/16),e.constants.add("floatBlendInputScale","float",16)),e.constants.add("maxEmissiveStrength","float",16)}(0,i.Cg)([(0,n.W)()],o.prototype,"useFloatBlend",void 0)},89904(e,t,r){r.d(t,{OG:()=>$e,gP:()=>Ge});var i=r(32198),n=r(69540),o=r(91429);let a=class extends n.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"row",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"column",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"rows",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"columns",void 0),a=(0,i.Cg)([(0,o.$K)("esri.CameraLayout")],a);const s=a;var l=r(69052),c=r(25482),u=r(34727),d=r(78888),h=r(86738),m=r(43937),p=r(36005);let f=class extends((0,n.OU)(c.o)){constructor(...e){super(...e),this.position=new h.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new s}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,d.GB)(e.x||0),n.y=(0,d.GB)(e.y||0),n.z=e.hasZ?(0,d.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new h.A;return r.read(e,t),r.x=(0,d.GB)(r.x||0),r.y=(0,d.GB)(r.y||0),r.z=r.hasZ?(0,d.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,i.Cg)([(0,o.MZ)({type:h.A,json:{write:{isRequired:!0}}})],f.prototype,"position",void 0),(0,i.Cg)([(0,m.K)("position")],f.prototype,"writePosition",null),(0,i.Cg)([(0,p.w)("position")],f.prototype,"readPosition",null),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,o.wg)(e=>l.ie.normalize((0,d.GB)(e)))],f.prototype,"heading",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,o.wg)(e=>(0,u.qE)((0,d.GB)(e),-180,180))],f.prototype,"tilt",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,o.wg)(e=>(0,u.qE)((0,d.GB)(e,55),1,170))],f.prototype,"fov",void 0),(0,i.Cg)([(0,o.MZ)({type:s,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"layout",void 0),f=(0,i.Cg)([(0,o.$K)("esri.Camera")],f);var v=r(9093),g=r(35522),x=r(51850),_=r(16930),b=(r(48353),r(9762),r(65806)),y=r(27993),w=r(73941),S=(r(19419),r(58083)),M=r(65720),T=r(71351),C=r(69622),I=r(53966),E=r(90629),O=r(37585),P=r(48163),D=r(78955),A=r(91829),R=r(44280);function F(e,t,r){e.worldUpAtPosition(t,B),(0,g.Re)(N,r,t);const i=(0,g.Bw)(N);return 0===i?0:(0,u.XM)((0,g.Om)(N,B)/i)}const B=(0,x.vt)(),N=(0,x.vt)();var z;let j=z=class extends C.A{constructor(e){super(e),this._ray=(0,T.vt)(),this._viewport=(0,A.fA)(0,0,1,1),this._padding=(0,A.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,P.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,v.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,v.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,v.vt)(),this._frustumDirty=!0,this._frustum=(0,M.vt)(),this._fullViewport=(0,A.vt)(),this._fullViewportDirty=!0,this._pixelRatio=1,this.pixelScale=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,x.vt)(),this._up=(0,x.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin,"eye")}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,g.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,S.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get inverseViewMatrix(){return(0,S.Qw)((0,v.vt)(),this.viewMatrix)||this._get("inverseViewMatrix")||(0,v.vt)()}get viewForward(){return this._ensureViewClean(),(0,g.hZ)((0,x.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,g.hZ)((0,x.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,g.hZ)((0,x.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,D.hs)((0,A.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,D.aI)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,D.hs)((0,A.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,D.aI)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewportDirty&&(this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this._viewport[2]+this._padding[1]+this._padding[3],this._fullViewport[3]=this._viewport[3]+this._padding[0]+this._padding[2],this._fullViewportDirty=!1),this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,D.t2)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,D.C)(this._padding,e),this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,S.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,S.B8)((0,v.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,v.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,g.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,S.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,S.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,a=-i/2+this.column*o,s=a+o,l=-r/2+this.row*n,c=l+n,u=(0,S.$h)((0,v.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),d=this._get("projectionMatrix");return d&&(0,S.t2)(d,u)?d:u}copyFrom(e){(0,g.C)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,D.C)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,D.C)(this._padding,e.padding),this.notifyChange("_padding"),this._fullViewportDirty=!0,(0,O.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,S.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,M.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,S.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this.pixelRatio=e.pixelRatio,this.pixelScale=e.pixelScale,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new z).copyFrom(this)}equals(e){return(0,g.t2)(this.eye,e.eye)&&(0,g.t2)(this.center,e.center)&&(0,g.t2)(this.up,e.up)&&(0,D.t2)(this._viewport,e.viewport)&&(0,D.t2)(this._padding,e.padding)&&(0,O.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}equalsView(e){return(0,g.t2)(this.eye,e.eye)&&(0,g.t2)(this.center,e.center)&&(0,g.t2)(this.up,e.up)&&this._fov===e.fov}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,D.hG)(e.screenPadding,this.screenPadding)>=t||(0,D.hG)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,g.jb)(W,e.eye,e.center),(0,g.jb)(V,this.eye,this.center);const r=(0,g.Om)(W,V),i=(0,g.uE)(W),n=(0,g.uE)(V),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,g.lo)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,R.gr)(this.viewForward,(0,g.Re)(W,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,E.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==H&&(0,g.C)(H,e),H[3]=1,(0,D.Z0)(H,H,this.projectionMatrix);const r=Math.abs(H[3]);(0,g.hs)(H,H,1/r);const i=this.fullViewport;t[0]=(0,u.Cc)(0,i[0]+i[2],.5+.5*H[0]),t[1]=(0,u.Cc)(0,i[1]+i[3],.5+.5*H[1]),t[2]=.5*(H[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;H[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],H[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],H[2]=(2*e[2]-1)*e[3],H[3]=e[3],null!=this.inverseProjectionMatrix&&((0,D.Z0)(H,H,this.inverseProjectionMatrix),t[0]=H[0],t[1]=H[1],t[2]=H[2])}projectToScreen(e,t){return null==this.projectToRenderScreen(e,U)?null:(this.renderToScreen(U,t),t)}projectToRenderScreen(e,t){if(H[0]=e[0],H[1]=e[1],H[2]=e[2],H[3]=1,(0,D.Z0)(H,H,this.viewProjectionMatrix),0===H[3])return null;const r=H;(0,g.hs)(r,r,1/Math.abs(H[3]));const i=this.fullViewport,n=(0,u.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,u.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,U),t)}unprojectFromRenderScreen(e,t){if((0,S.lw)(L,this.projectionMatrix,this.viewMatrix),!(0,S.B8)(L,L))return null;const r=this.fullViewport;return H[0]=2*(e[0]-r[0])/r[2]-1,H[1]=2*(e[1]-r[1])/r[3]-1,H[2]=2*e[2]-1,H[3]=1,(0,D.Z0)(H,H,L),0===H[3]?null:(t[0]=H[0]/H[3],t[1]=H[1]/H[3],t[2]=H[2]/H[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,a=Math.max(n-r/2,0),s=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),u=r-l- -Math.min(this.fullWidth-n-r/2,0),d=i-c- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(u),Math.round(d)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:n,fovY:o}=this,a=Math.abs(Math.PI/2-F(t,r,i));return e.frustumCoverage(a,n,o)}_computeUpGlobal(){(0,g.Re)(W,this.center,this.eye);const e=(0,g.Bw)(this.center);e<1?(0,g.t2)(this._up,x.Cb)&&((0,g.C)(this._up,x.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,g.Om)(W,this.center))>.9999*(0,g.Bw)(W)*e||((0,g.$A)(V,W,this.center),(0,g.$A)(V,V,W),(0,g.S8)(V,V),(0,g.t2)(this._up,V)||((0,g.C)(this._up,V),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,g.oW)(W,this.eye,this.center),Math.abs(W[2])<=.9999&&((0,g.hs)(W,W,W[2]),(0,g.hZ)(W,-W[0],-W[1],1-W[2]),(0,g.S8)(W,W),(0,g.t2)(this._up,W)||((0,g.C)(this._up,W),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,g.t2)(e,t)||((0,g.C)(t,e),this._markViewDirty(),this.notifyChange(r)):I.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,M.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,S.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,i.Cg)([(0,o.MZ)()],j.prototype,"_viewport",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"_padding",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"_fov",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"_nearFar",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"_viewDirty",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"_viewMatrix",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"pixelRatio",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"_pixelRatio",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"pixelScale",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"row",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"column",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"_rows",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"rows",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"_columns",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"columns",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"eye",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"center",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"_center",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"up",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"_up",void 0),(0,i.Cg)([(0,o.MZ)()],j.prototype,"viewMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],j.prototype,"inverseViewMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],j.prototype,"viewForward",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],j.prototype,"viewUp",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],j.prototype,"viewRight",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],j.prototype,"nearFar",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"near",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"far",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"viewport",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],j.prototype,"screenViewport",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],j.prototype,"screenPadding",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"x",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"y",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"width",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"height",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"fullWidth",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"fullHeight",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],j.prototype,"_aspect",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"padding",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],j.prototype,"projectionMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],j.prototype,"inverseProjectionMatrix",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"fov",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"fovX",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"fovY",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"viewInverseTransposeMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],j.prototype,"_projectionMatrixInternal",null),(0,i.Cg)([(0,o.MZ)()],j.prototype,"relativeElevation",void 0),j=z=(0,i.Cg)([(0,o.$K)("esri.views.3d.webgl.RenderCamera")],j);const H=(0,A.vt)(),L=(0,v.vt)(),W=(0,x.vt)(),V=(0,x.vt)(),U=(0,E.r_)();r(49718),r(6867),r(16396),(0,v.vt)(),(0,x.vt)(),(0,x.vt)(),(0,x.vt)();var G=r(5443),k=r(39829),$=r(95108);function Z(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return 1===n?1:0;const s=(a[o]-t[o])/(a[r]-t[r]),l=t[o]+s*(i-t[r]);return e[r]=i,e[o]=l,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(Y,t[0],t[0])&&q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(Y,t[r],i)){case 1:q(e,i);break;case 3:q(e,(0,P.o8)(Y));break;case 2:q(e,(0,P.o8)(Y)),q(e,i)}}}}function q(e,t){0!==e.length&&(0,O.aI)(e.at(-1),t)||e.push(t)}const Y=(0,P.vt)();var K=r(11964),X=r(27921);const J=(0,x.vt)(),Q=(0,x.vt)();function ee(){return{direction:(0,x.vt)(),up:(0,x.vt)()}}function te(e,t,r,i,n){let o=(0,g.S8)(J,e),a=(0,g.Om)(o,i);const s=a>0;a=Math.abs(a),a>.99&&(a=Math.abs((0,g.Om)(t,i)),a<.99?((0,g.C)(o,t),s&&(0,g.hs)(o,o,-1)):o=null);let l=0;if(o){(0,g.hs)(Q,i,(0,g.Om)(i,o)),(0,g.Re)(o,o,Q);const e=(0,g.Om)(o,n)/((0,g.Bw)(o)*(0,g.Bw)(n));(0,g.$A)(Q,o,n),l=((0,g.Om)(Q,i)>0?1:-1)*(0,u.KJ)((0,u.XM)(e))}const c=(0,u.KJ)((0,u.XM)(-(0,g.Om)(i,e)/(0,g.Bw)(e)));return r?(r.heading=l,r.tilt=c,r):{heading:l,tilt:c}}function re(e,t,r,i){(0,g.Re)(ie,r,t),(0,X.T7)(i,(0,K.LV)(t,ie),e)||e===r||(0,g.C)(e,r)}const ie=(0,x.vt)(),ne=(0,x.fA)(0,1,0),oe=(0,x.fA)(0,0,1),ae=(0,v.vt)(),se=(0,x.vt)(),le=(0,x.vt)();function ce(e,t,r,i=ee()){const{direction:n,up:o}=i;return(0,S.N9)(ae,-(0,u.kU)(t)),(0,S.eL)(ae,ae,(0,u.kU)(r)),(0,g.Z0)(n,oe,ae),(0,g.hs)(n,n,-1),(0,g.Z0)(o,ne,ae),i}function ue(e,t,r,i,n){const o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,g.Ln)(e,i,o,a)}const de=(0,x.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return te(t,r,i,oe,ne)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=ce(0,r,i),o=(0,x.vt)();return(0,g.hs)(o,n.direction,-t),(0,g.WQ)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,u.kU)(e)},headingTiltToDirectionUp:ce,lookAtTiltToEyeTilt:function(e){return(0,u.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,T.LV)(t.origin,t.direction),n,de)||ue(de,r,i,t.endpoint,n),re(de,a,de,l),s.push((0,P.fA)(de[0],de[1]))}return function(e,t,r){const i=e.map(e=>((0,g.hZ)(de,e[0],e[1],0),t.fromRenderCoords(de,de,r),[de[0],de[1]]));return i.length<=2?new k.A({spatialReference:r}):(i.push(i[0].slice()),(0,$.$3)(i)||i.reverse(),new k.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return Z(r,e,t,0),Z(i,r,t,1),Z(r,i,t,2),Z(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,b.g)(t,se,o),(0,b.g)(t,le,o),se[0]-=r/2,le[0]+=r/2,se[1]-=i/2,le[1]+=i/2,(0,y.F)(se,o,se,a),(0,y.F)(le,o,le,a),n?(n.xmin=se[0],n.ymin=se[1],n.xmax=le[0],n.ymax=le[1],n.spatialReference=a):n=new G.A(se[0],se[1],le[0],le[1],a),n}},Symbol.toStringTag,{value:"Module"}));var he=r(34304),me=r(52039),pe=r(94008),fe=r(28735);class ve{get planes(){return this.frustum}get points(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,M.vt)(),this._points=(0,M.Qy)(),this.lines=new Array(12),this._origin=(0,x.vt)(),this._direction=(0,x.vt)(),this._boundingSphere=new pe.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,x.vt)(),endpoint:null}}update(e){(0,M.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,g.C)(this._origin,e.eye),(0,g.C)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}get altitude(){return this._altitude}intersectsSphere(e){return(0,M.m7)(this.frustum,e)}isConvexHullOutsideViewPyramid(e,t){return(0,M.Pi)(this.frustum,e,t)}intersectsRay(e){return(0,M.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,M.ST)(this.frustum,e,t)}lineSegmentIntersectsViewPyramid(e,t){return(0,M.LJ)(this.frustum,e,t)}intersectsPoint(e){return(0,M.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;ge(this.lines[t],e[t],e[r]),ge(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),ge(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){const{origin:e}=this,t=_e;(0,g.S8)(t,this.direction);const r=xe;(0,g.jb)(r,this.points[4],e);const i=.5*(0,g.Om)(r,r)/(0,g.Om)(t,r),n=this._boundingSphere,o=(0,g.Ln)(be,e,t,i);n.center=o,n.radius=i}static{this.planePointIndices=M.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function ge(e,t,r){e.origin=t,e.endpoint=r,(0,g.oW)(e.direction,t,r)}const xe=(0,x.vt)(),_e=(0,x.vt)(),be=(0,x.vt)();r(86211);const ye=(0,x.fA)(5802e-9,13558e-9,331e-7),we=(0,x.fA)(65e-8*3,5643e-9,255e-9);(0,x.fA)(ye[0]+we[0],ye[1]+we[1],ye[2]+we[2]);class Se{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Se(0,0)}static{this.Infinite=new Se}}(0,x.vt)(),(0,x.vt)(),new pe.iy,(0,T.vt)(),new G.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var Me=r(32728);const Te=(0,x.fA)(0,0,1),Ce=(0,g.S8)((0,x.vt)(),(0,x.fA)(1,1,1)),Ie=(0,v.vt)(),Ee=(0,x.vt)(),Oe=(0,x.vt)();function Pe(e,t,r,i=ee()){(0,g.$A)(Ee,e,Te),0===(0,g.Om)(Ee,Ee)&&(0,g.$A)(Ee,e,Ce),(0,S.$0)(Ie,-(0,u.kU)(t),e),(0,S.e$)(Ie,Ie,-(0,u.kU)(r),Ee);const{up:n,direction:o}=i;return(0,g.$A)(n,Ee,e),(0,g.S8)(n,n),(0,g.Z0)(n,n,Ie),(0,g.S8)(o,e),(0,g.ze)(o,o),(0,g.Z0)(o,o,Ie),i}function De(e){const t=e[1];e[1]=-e[2],e[2]=t}function Ae(e,t){const r=Pe(t,e.heading,e.tilt);return e.up=r.up,e}function Re(e,t){const{renderCoordsHelper:r,state:i}=e;if(1!==i.viewingMode)return 1;const n=r.getAltitude(t),o=r.referenceEllipsoid.radius,a=1+(0,g.Io)(i.camera.eye,t)/(o+n),s=Math.sqrt(a*a-1),{minCurvature:l,maxCurvature:c,minSamples:d,maxSamples:h}=Be,m=(0,u.qE)((s-l)/(c-l),0,1);return Math.round((0,u.Cc)(d,h,m))}function Fe(e,t){const r=[],i=[],n=(0,he.FD)();for(let o=0;o<e.length;o++){const a=e[o],s=o===e.length-1?e[0]:e[o+1],l=(0,K.Cr)(a,s,Ve),c=(0,X.vE)(t,l.origin,l.vector,0,Le);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,o,s]=0===c?[1,r,i]:[-1,i,r],l=(0,X.Qj)(t),u=(0,g.Ln)((0,x.vt)(),Le,l,e*n),d=(0,g.Ln)((0,x.vt)(),Le,l,e*-n);o.push(a),o.push(u),s.push(d)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Be={minCurvature:(0,u.kU)(5),maxCurvature:(0,u.kU)(50),minSamples:1,maxSamples:6},Ne=(0,x.fA)(1,0,0),ze=(0,x.fA)(0,1,0),je=(0,x.vt)(),He=(0,x.vt)(),Le=(0,x.vt)(),We=new pe.iy,Ve=(0,K.vt)(),Ue=(0,A.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Ee,o=Oe;return(0,g.S8)(n,e),(0,g.$A)(Oe,n,Te),0===(0,g.Om)(Oe,Oe)&&(0,g.$A)(Oe,n,Ce),(0,g.$A)(o,Oe,n),te(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,x.vt)(),up:null,tilt:i,heading:r},o=Ee;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const a=t,s=(0,u.kU)(r),l=(0,u.kU)(i),c=Math.sin(s),d=Math.cos(s),h=Math.sin(l),m=Math.cos(l),p=(0,g.Bw)(o);let f;if(Math.abs(l)<1e-8)f=a+p;else{const e=p/h,t=(0,u.YN)(a/e),r=Math.PI-l-t;f=e*Math.sin(r)}const v=m*a,_=a*a*(h*h),b=d*d*_,y=f-v,w=y*y,S=b*(b+w-o[1]*o[1]);if(S<0)return(0,g.hs)(n.eye,o,f/p),n.tilt=0,Ae(n,e);const M=Math.sqrt(S),T=o[1]*y,C=b+w;let I;if(I=d>0?-M+T:M+T,Math.abs(C)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=a):(0,g.hs)(n.eye,o,f/p),n.tilt=0,De(n.eye),Ae(n,e);n.eye[1]=I/C;const E=c*c*_,O=h*a,P=d*O*n.eye[1],D=n.eye[1]*n.eye[1],A=1-D,R=Math.sqrt(A),F=b*D+E-2*P*R*y+A*w;return Math.abs(F)<1e-8?((0,g.hs)(n.eye,o,f/p),n.tilt=0,De(n.eye),Ae(n,e)):(n.eye[0]=(A*(f*o[0]-v*o[0])-O*R*(o[0]*n.eye[1]*d+o[2]*c))/F,n.eye[2]=(A*(f*o[2]-v*o[2])-O*R*(o[2]*n.eye[1]*d-o[0]*c))/F,(0,g.hs)(n.eye,n.eye,f),De(n.eye),Ae(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,u.kU)(e),n=(0,g.Bw)(t);return(0,u.YN)(r/(n/Math.sin(i)))+i},getCurvatureSamples:Re,headingTiltToDirectionUp:Pe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,g.Bw)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,u.YN)(r/(n/Math.sin(e)));return(0,u.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new ve(r);i.near=2,n.update(i);const o=r.getAltitude(t),a=e.spatialReference,s=i.eye,l=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return We.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(We,t)}(e),c=Re(e,t),d=i.aboveGround,h=n.planes[5],m=[],p=(0,X.O_)(x.uY,Ne,(0,X.vt)()),f=(0,X.O_)(x.uY,ze,(0,X.vt)());(0,D.hZ)(Ue,0,0,0,0);const v=e=>{};for(let e=0;e<4;e++){const t=1===e&&!d||3===e&&d?1-l:0,i=1===e&&d||3===e&&!d?l:1,a=n.lines[e],_=n.lines[3===e?0:e+1];for(let n=0;n<c;n++){const l=n/c,d=0===n?0:(0,u.Cc)(t,i,1===e?1-(1-l)**2:3===e?l**2:l),b=(0,g.Cc)(He,a.origin,_.origin,d),y=(0,Me.nu)(a.direction,_.direction,d,je);r.intersectManifoldClosestSilhouette((0,T.LV)(b,y),o,Le),re(Le,s,Le,h),m.push((0,x.o8)(Le)),0!==m.length&&v((0,g.lo)(m.at(-1),Le));const w=((0,X.BX)(p,Le)?1:0)|((0,X.BX)(f,Le)?2:0);Ue[w]=1}}m.length>2&&(0,g.lo)(m[0],m.at(-1));const _=function(e,t,r){const i=2*(0,he.FD)();return e.map(e=>{const n=[];let o=!1;for(const a of e)t.fromRenderCoords(a,Le,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,Le[1]]),n.push([null,Le[1]]),o=!0):n.push([Le[0],Le[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,$.$3)(n)||n.reverse(),n})}((0,D.m3)(Ue)>1?function(e,t){const r=[];for(const i of e)r.push(...Fe(i,t));return r}(Fe(m,p),f):[m],r,a);return new k.A({rings:_,spatialReference:a})},toExtent:function(e,t,r,i,n){let o,a,s,c;const d=t.latitude,h=(0,w.tO)(e.spatialReference).radius,m=t.longitude,p=function(e,t,r){const i=t/r,n=(0,u.kU)(e),o=Math.sin(i/2),a=Math.cos(n),s=2*(0,u.YN)(Math.sqrt(o*o/(a*a)));return(0,u.KJ)(s)}(d,r,h)/2;o=m-p,a=m+p;const f=(0,u.kU)(d),v=(1+Math.sin(f))/(1-Math.sin(f)),g=(v+1)*Math.tan(i/h/2),x=g*g;function b(e){const t=Math.PI/2;return(e=l.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(s=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*v+x))),c=s+i/h,s=b(s),c=b(c),c<s){const e=c;c=s,s=e}if(s=Math.max((0,u.KJ)(s),-90),c=Math.min((0,u.KJ)(c),90),a=me.Y_.monotonic(o,a),a-o>180){const e=(a-o-180)/2;o+=e,a-=e}const y=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:_.A.WGS84;return n?(n.xmin=o,n.ymin=s,n.xmax=a,n.ymax=c,n.spatialReference=y):n=new G.A(o,s,a,c,y),e.spatialReference&&e.spatialReference.isWebMercator&&(0,fe.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Ge={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},ke=[Ge.FINAL,Ge.COMPOSITE,Ge.OPAQUE,Ge.TRANSPARENT],$e={ANTIALIASING:"antialiasing",CUTFILL:"cutfill",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA:"focusarea",FOCUSAREA_MASK:"focusarea-mask",GAUSSIAN_SPLAT:"gaussian",GAUSSIAN_SPLAT_DEPTH:"gaussian-depth",GROUND_DEPTH:"ground-depth",HIGHLIGHT:"highlight",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_ACCUMULATION:"shadow-accumulation",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values($e)).concat(ke),(0,x.vt)()},48852(e,t,r){r.d(t,{g:()=>m});var i=r(4576),n=r(44208),o=r(53966),a=r(17676),s=r(78659),l=r(34275),c=r(94656),u=r(63907);const d=()=>o.A.getLogger("esri.views.webgl.BufferObject"),h=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class m{static createIndex(e,t,r){return new m(e,34963,t,r)}static createUniform(e,t,r){return new m(e,35345,t,r)}static createPixelPack(e,t=35041,r){const i=new m(e,35051,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=35040,r){return new m(e,35052,t,r)}static createTransformFeedback(e,t=35044,r){const i=new m(e,35982,t);return i.setSize(r),i}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,e.instanceCounter.increment(u.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,c.Y2)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case u.pe.UNSIGNED_INT:return this._sizeBytes/4;case u.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case u.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return h?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(u.vt.BufferObject,this),this._context=null):this._glName&&d().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(34963===this.bufferType&&null!=t)switch(this._indexType=t,t){case u.pe.UNSIGNED_SHORT:e*=2;break;case u.pe.UNSIGNED_INT:e*=4;case u.pe.UNSIGNED_BYTE:}this._setBufferData(e)}setData(e){if(!e)return;const t=e.byteLength;34963===this.bufferType&&((0,l.mg)(e)?this._indexType=u.pe.UNSIGNED_BYTE:(0,l.jq)(e)?this._indexType=u.pe.UNSIGNED_SHORT:(0,l.XJ)(e)&&(this._indexType=u.pe.UNSIGNED_INT)),this._setBufferData(t,e)}setIndexType(e){34963===this.bufferType&&(this._indexType=e)}_setBufferData(e,t=null){this._sizeBytes=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,c.Y2)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:o}=this._context;o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r),(0,c.Y2)(o),this._isVAOAware&&this._context.bindVAO(n)}getSubData(e,t=0,r,n){if(r<0||n<0)return;const o=function(e){return(0,i.Xj)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(n??0))>e.byteLength)return;t+o*(n??0)>this.usedMemory&&d().warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),a.getBufferSubData(35982,t,e,r,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),a.getBufferSubData(36662,t,e,r,n),this._context.unbindBuffer(36662))}async getSubDataAsync(e,t=0,r,i,n){if(await this._context.clientWaitAsync((0,s.l5)(10),n),!this._context||!this._glName)throw(0,a.NK)();this.getSubData(e,t,r,i)}}},65786(e,t,r){const i=class{};new i,r.d(t,["Y",0,i])},14113(e,t,r){r.d(t,{N5:()=>s});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new p,this.outputs=new f}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s=n.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?x:g,u=n.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${u.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${d.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,n,t)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let a=0;a<i;++a)r[a](e,o,t,n)}}}class 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 o().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 c{constructor(){this._entries=new Map}add(e,t){if(this._entries.has(e))throw new i.A("shaderbuilder:duplicate-input",`Duplicate input for ${e}`);this._entries.set(e,t)}get(e){const t=this._entries.get(e);if(null==t)throw new i.A("shaderbuilder:input-resolver-error",`No resolver for input ${e} found.`);return t()}}class u{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0){const e=[];for(const t of this._bodies)"string"==typeof t?e.push(t):e.push(...t());return[`void main() {\n ${e.join("\n")||""} \n}`]}if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){const e=[];for(const t of this._entries)"string"==typeof t?e.push(t):e.push(...t());return e}}class h extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new u(this),this.code=new d(this),this.constants=new v(this),this.inputs=new c}get builder(){return this}}class 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]};`)}get names(){return this._entries.map(([e])=>e)}}class p{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class f{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}):o().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:f.DEFAULT_NAME,type:f.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class v{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=v._numberToFloatStr(r);break;case"int":i=v._numberToIntStr(r);break;case"uint":i=v._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])}, ${v._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${v._numberToUintStr(r[0])}, ${v._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${v._numberToUintStr(r[0])}, ${v._numberToUintStr(r[1])}, ${v._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${v._numberToUintStr(r[0])}, ${v._numberToUintStr(r[1])}, ${v._numberToUintStr(r[2])}, ${v._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>v._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",x="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},74333(e,t,r){r.d(t,{n:()=>i});class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},66289(e,t,r){r.d(t,{R:()=>n});var i=r(48852);class n extends i.g{constructor(e,t,r,i=35044){super(e,34962,i,r),this.layout=t}}},90644(e,t,r){function i(e,t,r=32774,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,n=32774,o=32774,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}r.d(t,{Ey:()=>b,nk:()=>d,p3:()=>n}),r(4718);const o=i(0,771),a=(i(1,0),i(1,1),i(1,771)),s=(i(773,1),n(770,1,771,771)),l=n(0,0,768,0),c=(n(0,0,768,1),{face:1029,mode:2305}),u={face:1028,mode:2305};function d(e,t,r){return{ref:e,readMask:t,stencilFront:r,stencilBack:r}}function h(e){return S.intern(e)}function m(e){return T.intern(e)}function p(e){return I.intern(e)}function f(e){return O.intern(e)}function v(e){return D.intern(e)}function g(e){return R.intern(e)}function x(e){return B.intern(e)}function _(e){return z.intern(e)}function b(e){return H.intern(e)}class y{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 w(e){return"["+e.join(",")+"]"}const S=new y(M,e=>({__tag:"Blending",...e}));function M(e){return e?w([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 T=new y(C,e=>({__tag:"Culling",...e}));function C(e){return e?w([e.face,e.mode]):null}const I=new y(E,e=>({__tag:"PolygonOffset",...e}));function E(e){return e?w([e.factor,e.units]):null}const O=new y(P,e=>({__tag:"DepthTest",...e}));function P(e){return e?w([e.func]):null}const D=new y(A,e=>({__tag:"StencilTest",...e}));function A(e){return e?w([e.ref,e.readMask,e.stencilFront.compare,e.stencilFront.fail,e.stencilFront.zFail,e.stencilFront.zPass,e.stencilBack.compare,e.stencilBack.fail,e.stencilBack.zFail,e.stencilBack.zPass]):null}const R=new y(F,e=>({__tag:"DepthWrite",...e}));function F(e){return e?w([e.zNear,e.zFar]):null}const B=new y(N,e=>({__tag:"ColorWrite",...e}));function N(e){return e?w([e.r,e.g,e.b,e.a]):null}const z=new y(j,e=>({__tag:"StencilWrite",...e}));function j(e){return e?w([e.mask]):null}const H=new y(function(e){return e?w([M(e.blending),C(e.culling),E(e.polygonOffset),P(e.depthTest),A(e.stencilTest),F(e.depthWrite),N(e.colorWrite),j(e.stencilWrite)]):null},e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:p(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:v(e.stencilTest),depthWrite:g(e.depthWrite),colorWrite:x(e.colorWrite),stencilWrite:_(e.stencilWrite)}));r.d(t,["RC",0,a,"T8",0,s,"Uy",0,{zNear:0,zFar:1},"Xt",0,e=>2===e?c:1===e?u:null,"iD",0,o,"kn",0,{r:!0,g:!0,b:!0,a:!0},"uR",0,l])}}]);