@arcgis/core 4.31.0-next.20240821 → 4.31.0-next.20240822

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 (45) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{9443b9ec03f25c723c2c.js → 06d328c8aad32c52de97.js} +1 -1
  3. package/assets/esri/core/workers/chunks/203afe6dd0461d4bd774.js +278 -0
  4. package/assets/esri/core/workers/chunks/{cd9f48dcee2a1fc261ed.js → c5214a47690c594903d1.js} +25 -25
  5. package/assets/esri/themes/base/widgets/_Grid.scss +0 -8
  6. package/assets/esri/themes/base/widgets/_Print.scss +13 -15
  7. package/assets/esri/themes/dark/main.css +1 -1
  8. package/assets/esri/themes/light/main.css +1 -1
  9. package/assets/esri/themes/light/view.css +1 -1
  10. package/assets/esri/widgets/Print/t9n/Print.json +1 -1
  11. package/assets/esri/widgets/Print/t9n/Print_en.json +1 -1
  12. package/chunks/ComponentShader.glsl.js +29 -29
  13. package/chunks/DefaultMaterial.glsl.js +1 -1
  14. package/chunks/Path.glsl.js +22 -17
  15. package/exports/csv.js +1 -1
  16. package/interfaces.d.ts +37 -9
  17. package/package.json +1 -1
  18. package/support/revision.js +1 -1
  19. package/views/2d/support/highlightGroupUtils.js +1 -1
  20. package/views/3d/terrain/TerrainRenderer.js +1 -1
  21. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  22. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  23. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +2 -2
  24. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +3 -3
  25. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  26. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  27. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  28. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  29. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  30. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  31. package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +8 -8
  32. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  33. package/widgets/Feature/FeatureMedia.js +1 -1
  34. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  35. package/widgets/FeatureTable/Grid/Column.js +1 -1
  36. package/widgets/FeatureTable.js +1 -1
  37. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  38. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  39. package/widgets/Print/CustomTemplate.js +1 -1
  40. package/widgets/Print/PrintViewModel.js +1 -1
  41. package/widgets/Print/TemplateOptions.js +1 -1
  42. package/widgets/Print/utils.js +5 -0
  43. package/widgets/Print.js +1 -1
  44. package/widgets/support/exportUtils.js +1 -1
  45. package/assets/esri/core/workers/chunks/e5474bcde5b8fa037b56.js +0 -278
@@ -1,278 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8325],{81139:(e,t,r)=>{r.d(t,{O:()=>i});class i{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}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))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}forAll(e){for(const t of this._outer.values())for(const r of t.values())e(r)}}},11964:(e,t,r)=>{r.d(t,{Cr:()=>l,H6:()=>h,_I:()=>d,kb:()=>u,vt:()=>c});var i=r(34727),n=r(4341),s=r(38954),o=r(51850),a=r(32114);function c(e){return e?{origin:(0,o.o8)(e.origin),vector:(0,o.o8)(e.vector)}:{origin:(0,o.vt)(),vector:(0,o.vt)()}}function l(e,t,r=c()){return(0,s.c)(r.origin,e),(0,s.f)(r.vector,t,e),r}function u(e,t){const r=(0,s.f)(a.rq.get(),t,e.origin),n=(0,s.m)(e.vector,r),o=(0,s.m)(e.vector,e.vector),c=(0,i.qE)(n/o,0,1),l=(0,s.f)(a.rq.get(),(0,s.j)(a.rq.get(),e.vector,c),r);return(0,s.m)(l,l)}function d(e,t,r){return h(e,t,0,1,r)}function h(e,t,r,n,o){const{vector:c,origin:l}=e,u=(0,s.f)(a.rq.get(),t,l),d=(0,s.m)(c,u)/(0,s.q)(c);return(0,s.j)(o,c,(0,i.qE)(d,r,n)),(0,s.g)(o,o,e.origin)}(0,o.vt)(),(0,o.vt)(),new n.I((()=>c()))},99677:(e,t,r)=>{r.d(t,{D:()=>n});var i=r(78888);async function n(e,t){const{data:r}=await(0,i.A)(e,{responseType:"image",...t});return r}},78662:(e,t,r)=>{r.d(t,{Gd:()=>d,VC:()=>h}),r(44208);var i,n,s,o=r(34727),a=(r(77690),r(29242),r(58083),r(9093)),c=r(38954),l=r(51850),u=(r(31756),r(26857),r(2597));(s=i||(i={}))[s.Undefined=0]="Undefined",s[s.DefinedSize=1]="DefinedSize",s[s.DefinedScale=2]="DefinedScale",function(e){e[e.Undefined=0]="Undefined",e[e.DefinedAngle=1]="DefinedAngle"}(n||(n={}));class d extends u.Y{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}}function h(e,t,r){if(!t.vvSize)return(0,c.s)(e,1,1,1),e;for(let i=0;i<3;++i){const n=t.vvSize.offset[i]+r[0]*t.vvSize.factor[i];e[i]=(0,o.qE)(n,t.vvSize.minSize[i],t.vvSize.maxSize[i])}return e}(0,a.vt)(),(0,l.vt)(),(0,a.vt)()},26857:(e,t,r)=>{r.d(t,{b:()=>c});var i=r(90237),n=r(69622),s=r(10107),o=(r(44208),r(53966),r(87811),r(40608));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.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1}};(0,i._)([(0,s.MZ)()],a.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"LABELS_SHOW_BORDER",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"TEXT_SHOW_BORDER",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"SHOW_POI",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i._)([(0,s.MZ)()],a.prototype,"LINE_WIREFRAMES",void 0),a=(0,i._)([(0,o.$)("esri.views.3d.support.debugFlags")],a);const c=new a},76591:(e,t,r)=>{r.d(t,{HQ:()=>l});var i=r(58083),n=r(9093),s=r(38954),o=r(51850),a=r(40710),c=(r(33079),r(2597));function l(e,t){!function(e,t,...r){if(!t.hasSlicePlane){const r=c.H`#define rejectBySlice(_pos_) false
2
- #define discardBySlice(_pos_) {}
3
- #define highlightSlice(_color_, _pos_) (_color_)`;return t.hasSliceInVertexProgram&&e.vertex.code.add(r),void e.fragment.code.add(r)}const i=c.H`struct SliceFactors {
4
- float front;
5
- float side0;
6
- float side1;
7
- float side2;
8
- float side3;
9
- };
10
- SliceFactors calculateSliceFactors(vec3 pos) {
11
- vec3 rel = pos - slicePlaneOrigin;
12
- vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);
13
- float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);
14
- float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);
15
- float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);
16
- float basis1Dot = dot(slicePlaneBasis1, rel);
17
- float basis2Dot = dot(slicePlaneBasis2, rel);
18
- return SliceFactors(
19
- dot(slicePlaneNormal, pos) + slicePlaneW,
20
- -basis1Dot - basis1Len2,
21
- basis1Dot - basis1Len2,
22
- -basis2Dot - basis2Len2,
23
- basis2Dot - basis2Len2
24
- );
25
- }
26
- bool sliceByFactors(SliceFactors factors) {
27
- return factors.front < 0.0
28
- && factors.side0 < 0.0
29
- && factors.side1 < 0.0
30
- && factors.side2 < 0.0
31
- && factors.side3 < 0.0;
32
- }
33
- bool sliceEnabled() {
34
- return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
35
- }
36
- bool sliceByPlane(vec3 pos) {
37
- return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
38
- }
39
- #define rejectBySlice(_pos_) sliceByPlane(_pos_)
40
- #define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`,n=c.H`vec4 applySliceHighlight(vec4 color, vec3 pos) {
41
- SliceFactors factors = calculateSliceFactors(pos);
42
- const float HIGHLIGHT_WIDTH = 1.0;
43
- const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3);
44
- factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front);
45
- factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0);
46
- factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1);
47
- factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2);
48
- factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3);
49
- if (sliceByFactors(factors)) {
50
- return color;
51
- }
52
- float highlightFactor = (1.0 - step(0.5, factors.front))
53
- * (1.0 - step(0.5, factors.side0))
54
- * (1.0 - step(0.5, factors.side1))
55
- * (1.0 - step(0.5, factors.side2))
56
- * (1.0 - step(0.5, factors.side3));
57
- return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a);
58
- }`,s=t.hasSliceHighlight?c.H`
59
- ${n}
60
- #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
61
- `:c.H`#define highlightSlice(_color_, _pos_) (_color_)`;t.hasSliceInVertexProgram&&e.vertex.uniforms.add(...r).code.add(i),e.fragment.uniforms.add(...r).code.add(i),e.fragment.code.add(s)}(e,t,new a.W("slicePlaneOrigin",((e,r)=>function(e,t,r){if(null==r.slicePlane)return o.uY;const i=u(e,t,r),n=d(i,r.slicePlane),a=h(e,i,r);return null!=a?(0,s.h)(f,n,a):n}(t,e,r))),new a.W("slicePlaneBasis1",((e,r)=>m(t,e,r,r.slicePlane?.basis1))),new a.W("slicePlaneBasis2",((e,r)=>m(t,e,r,r.slicePlane?.basis2))))}function u(e,t,r){return e.instancedDoublePrecision?(0,s.s)(_,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function d(e,t){return null!=e?(0,s.f)(f,t.origin,e):t.origin}function h(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,i.Tl)(g,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function m(e,t,r,i){if(null==i||null==r.slicePlane)return o.uY;const n=u(e,t,r),a=d(n,r.slicePlane),c=h(e,n,r);return null!=c?((0,s.g)(p,i,a),(0,s.h)(f,a,c),(0,s.h)(p,p,c),(0,s.f)(p,p,f)):i}c.Y;const _=(0,o.vt)(),f=(0,o.vt)(),p=(0,o.vt)(),g=(0,n.vt)()},82991:(e,t,r)=>{r.d(t,{BK:()=>A,nW:()=>T});var i=r(90237),n=r(77690),s=r(29242),o=r(9093),a=r(38954),c=r(51850),l=r(49255),u=r(26425),d=r(20693),h=r(40710),m=r(2597),_=r(35644),f=r(40095),p=r(99769),g=r(46540),v=r(28449);class T extends p.K{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}(0,i._)([(0,p.W)()],T.prototype,"instancedDoublePrecision",void 0),(0,i._)([(0,p.W)()],T.prototype,"hasModelTransformation",void 0),m.Y;const E=(0,s.vt)();function A(e,t){const r=t.hasModelTransformation,i=t.instancedDoublePrecision;r&&(e.vertex.uniforms.add(new f.X("model",(e=>e.modelTransformation??o.zK))),e.vertex.uniforms.add(new _.k("normalLocalOriginFromModel",(e=>((0,n.Ge)(E,e.modelTransformation??o.zK),E))))),t.instanced&&i&&(e.attributes.add(g.r.INSTANCEMODELORIGINHI,"vec3"),e.attributes.add(g.r.INSTANCEMODELORIGINLO,"vec3"),e.attributes.add(g.r.INSTANCEMODEL,"mat3"),e.attributes.add(g.r.INSTANCEMODELNORMAL,"mat3"));const s=e.vertex;i&&(s.include(u.u,t),s.uniforms.add(new h.W("viewOriginHi",((e,t)=>(0,v.Zo)((0,a.s)(R,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),R))),new h.W("viewOriginLo",((e,t)=>(0,v.jA)((0,a.s)(R,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),R))))),s.code.add(m.H`
62
- vec3 getVertexInLocalOriginSpace() {
63
- return ${r?i?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":i?"instanceModel * localPosition().xyz":"localPosition().xyz"};
64
- }
65
-
66
- vec3 subtractOrigin(vec3 _pos) {
67
- ${i?m.H`
68
- // Negated inputs are intentionally the first two arguments. The other way around the obfuscation in dpAdd() stopped
69
- // working for macOS 14+ and iOS 17+.
70
- // Issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280
71
- vec3 originDelta = dpAdd(-instanceModelOriginHi, -instanceModelOriginLo, viewOriginHi, viewOriginLo);
72
- return _pos - originDelta;`:"return vpos;"}
73
- }
74
- `),s.code.add(m.H`
75
- vec3 dpNormal(vec4 _normal) {
76
- return normalize(${r?i?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":i?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
77
- }
78
- `),t.output===l.V.Normal&&((0,d.S7)(s),s.code.add(m.H`
79
- vec3 dpNormalView(vec4 _normal) {
80
- return normalize((viewNormal * ${r?i?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":i?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz);
81
- }
82
- `)),t.hasVertexTangents&&s.code.add(m.H`
83
- vec4 dpTransformVertexTangent(vec4 _tangent) {
84
- ${r?i?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":i?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
85
- }`)}const R=(0,c.vt)()},36782:(e,t,r)=>{r.d(t,{g:()=>o});var i=r(49255),n=r(2597),s=r(46540);function o(e,t){if(t.output!==i.V.ObjectAndLayerIdColor)return e.vertex.code.add(n.H`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(n.H`void outputObjectAndLayerIdColor() {}`);const r=t.objectAndLayerIdColorInstanced;e.varyings.add("objectAndLayerIdColorVarying","vec4"),e.attributes.add(r?s.r.INSTANCEOBJECTANDLAYERIDCOLOR:s.r.OBJECTANDLAYERIDCOLOR,"vec4"),e.vertex.code.add(n.H`
86
- void forwardObjectAndLayerIdColor() {
87
- objectAndLayerIdColorVarying = ${r?"instanceObjectAndLayerIdColor":"objectAndLayerIdColor"} * 0.003921568627451;
88
- }`),e.fragment.code.add(n.H`void outputObjectAndLayerIdColor() {
89
- fragColor = objectAndLayerIdColorVarying;
90
- }`)}},10764:(e,t,r)=>{r.d(t,{I:()=>s});var i=r(2597),n=r(46540);function s(e){e.attributes.add(n.r.POSITION,"vec3"),e.vertex.code.add(i.H`vec3 positionModel() { return position; }`)}},53466:(e,t,r)=>{r.d(t,{I:()=>i,U:()=>c});var i,n,s=r(21818),o=r(2597),a=r(46540);function c(e,t){switch(t.textureCoordinateType){case i.Default:return e.attributes.add(a.r.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() {
91
- vuv0 = uv0;
92
- }`);case i.Compressed:return e.attributes.add(a.r.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(o.H`vec2 getUV0() {
93
- return uv0 / 16384.0;
94
- }
95
- void forwardTextureCoordinates() {
96
- vuv0 = getUV0();
97
- }`);case i.Atlas:return e.attributes.add(a.r.UV0,"vec2"),e.varyings.add("vuv0","vec2"),e.attributes.add(a.r.UVREGION,"vec4"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() {
98
- vuv0 = uv0;
99
- vuvRegion = uvRegion;
100
- }`);default:(0,s.Xb)(t.textureCoordinateType);case i.None:return void e.vertex.code.add(o.H`void forwardTextureCoordinates() {}`);case i.COUNT:return}}(n=i||(i={}))[n.None=0]="None",n[n.Default=1]="Default",n[n.Atlas=2]="Atlas",n[n.Compressed=3]="Compressed",n[n.COUNT=4]="COUNT"},72824:(e,t,r)=>{r.d(t,{Mh:()=>d,Zo:()=>h,gy:()=>m});var i=r(21818),n=r(29242),s=r(91829),o=r(96336),a=r(33752),c=r(2597),l=r(98353),u=r(35644);function d(e,t){switch(t.normalType){case o.W.Attribute:case o.W.Compressed:e.include(o.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new l.h("transformNormalGlobalFromModel",(e=>e.transformNormalGlobalFromModel)),new u.k("transformNormalViewFromGlobal",(e=>e.transformNormalViewFromGlobal))),e.vertex.code.add(c.H`void forwardNormal() {
101
- vNormalWorld = transformNormalGlobalFromModel * normalModel();
102
- vNormalView = transformNormalViewFromGlobal * vNormalWorld;
103
- }`);break;case o.W.Ground:e.include(a.em,t),e.varyings.add("vNormalWorld","vec3"),e.vertex.code.add(c.H`
104
- void forwardNormal() {
105
- vNormalWorld = ${t.spherical?c.H`normalize(vPositionWorldCameraRelative);`:c.H`vec3(0.0, 0.0, 1.0);`}
106
- }
107
- `);break;case o.W.ScreenDerivative:e.vertex.code.add(c.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case o.W.COUNT:}}class h extends a.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,n.vt)()}}class m extends a.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,n.vt)(),this.toMapSpace=(0,s.vt)()}}},33752:(e,t,r)=>{r.d(t,{EM:()=>p,dO:()=>f,em:()=>_});var i=r(29242),n=r(9093),s=r(51850),o=r(10764),a=r(26425),c=r(40710),l=r(33079),u=r(2597),d=r(98353),h=r(35644),m=r(40095);function _(e,t){e.include(o.I);const r=e.vertex;r.include(a.u,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add(new l.t("transformWorldFromViewTH",(e=>e.transformWorldFromViewTH)),new l.t("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL)),new h.k("transformViewFromCameraRelativeRS",(e=>e.transformViewFromCameraRelativeRS)),new m.X("transformProjFromView",(e=>e.transformProjFromView)),new d.h("transformWorldFromModelRS",(e=>e.transformWorldFromModelRS)),new c.W("transformWorldFromModelTH",(e=>e.transformWorldFromModelTH)),new c.W("transformWorldFromModelTL",(e=>e.transformWorldFromModelTL))),r.code.add(u.H`vec3 positionWorldCameraRelative() {
108
- vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
109
- vec3 transform_CameraRelativeFromModel = dpAdd(
110
- transformWorldFromModelTL,
111
- transformWorldFromModelTH,
112
- -transformWorldFromViewTL,
113
- -transformWorldFromViewTH
114
- );
115
- return transform_CameraRelativeFromModel + rotatedModelPosition;
116
- }`),r.code.add(u.H`
117
- void forwardPosition(float fOffset) {
118
- vPositionWorldCameraRelative = positionWorldCameraRelative();
119
- if (fOffset != 0.0) {
120
- vPositionWorldCameraRelative += fOffset * ${t.spherical?u.H`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:u.H`vec3(0.0, 0.0, 1.0)`};
121
- }
122
-
123
- vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
124
- gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
125
- }
126
- `),e.fragment.uniforms.add(new l.t("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL))),r.code.add(u.H`vec3 positionWorld() {
127
- return transformWorldFromViewTL + vPositionWorldCameraRelative;
128
- }`),e.fragment.code.add(u.H`vec3 positionWorld() {
129
- return transformWorldFromViewTL + vPositionWorldCameraRelative;
130
- }`)}class f extends u.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,s.vt)(),this.transformWorldFromViewTL=(0,s.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)(),this.transformProjFromView=(0,n.vt)()}}class p extends u.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,s.vt)(),this.transformWorldFromModelTL=(0,s.vt)()}}},99208:(e,t,r)=>{r.d(t,{r:()=>o});var i=r(53466),n=r(2597);function s(e){e.fragment.code.add(n.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
131
- vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
132
- vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
133
- float maxdUV = 0.125;
134
- vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
135
- vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
136
- return textureGrad(tex, uvAtlas, dUVdx, dUVdy);
137
- }`)}function o(e,t){const{textureCoordinateType:r}=t;if(r===i.I.None||r===i.I.COUNT)return;e.include(i.U,t);const o=r===i.I.Atlas;o&&e.include(s),e.fragment.code.add(n.H`
138
- vec4 textureLookup(sampler2D tex, vec2 uv) {
139
- return ${o?"textureAtlasLookup(tex, uv, vuvRegion)":"texture(tex, uv)"};
140
- }
141
- `)}},35640:(e,t,r)=>{r.d(t,{G:()=>l,V:()=>d});var i=r(87317),n=r(91829),s=r(52587),o=r(20693),a=r(71988),c=r(2597);function l(e,t){const r=e.vertex;t.hasVerticalOffset?(d(r),t.hasScreenSizePerspective&&(e.include(s.Y6),(0,s.OH)(r),(0,o.yu)(e.vertex,t)),r.code.add(c.H`
142
- vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
143
- float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
144
- ${t.spherical?c.H`vec3 worldNormal = normalize(worldPos + localOrigin);`:c.H`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
145
- ${t.hasScreenSizePerspective?c.H`
146
- float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
147
- float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:c.H`
148
- float verticalOffsetScreenHeight = verticalOffset.x;`}
149
- // Screen sized offset in world space, used for example for line callouts
150
- float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
151
- return worldNormal * worldOffset;
152
- }
153
-
154
- vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
155
- return worldPos + calculateVerticalOffset(worldPos, localOrigin);
156
- }
157
- `)):r.code.add(c.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const u=(0,n.vt)();function d(e){e.uniforms.add(new a.E("verticalOffset",((e,t)=>{const{minWorldLength:r,maxWorldLength:n,screenLength:s}=e.verticalOffset,o=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),a=t.camera.pixelRatio||1;return(0,i.s)(u,s*a,o,r,n)})))}},22911:(e,t,r)=>{r.d(t,{NL:()=>m,ZX:()=>i});var i,n,s=r(49255),o=r(99208),a=r(40710),c=r(33079),l=r(2597),u=r(15976),d=r(63761),h=r(46263);function m(e,t){if(t.output!==s.V.ColorEmission&&t.output!==s.V.Color)return;const{emissionSource:r,hasEmissiveTextureTransform:n,bindType:m}=t,_=r===i.Texture;_&&(e.include(o.r,t),e.fragment.uniforms.add(m===h.c.Pass?new d.N("texEmission",(e=>e.textureEmissive)):new u.o("texEmission",(e=>e.textureEmissive))));const f=r===i.Value||_;f&&e.fragment.uniforms.add(m===h.c.Pass?new c.t("emissionFactor",(e=>e.emissiveFactor)):new a.W("emissionFactor",(e=>e.emissiveFactor))),e.fragment.code.add(l.H`
158
- vec4 getEmissions() {
159
- vec4 emissions = ${f?"vec4(emissionFactor, 1.0)":"vec4(0.0)"};
160
- ${(0,l.If)(_,`emissions *= textureLookup(texEmission, ${n?"emissiveUV":"vuv0"});\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)};
161
- return emissions;
162
- }
163
- `)}r(25634),(n=i||(i={}))[n.None=0]="None",n[n.Value=1]="Value",n[n.Texture=2]="Texture",n[n.COUNT=3]="COUNT"},76662:(e,t,r)=>{r.d(t,{Q:()=>a});var i=r(49255),n=r(93588),s=r(2597),o=r(63761);function a(e,t){t.output===i.V.Highlight?(e.fragment.uniforms.add(new o.N("depthTexture",((e,t)=>t.mainDepth))),e.fragment.uniforms.add(new o.N("highlightTexture",((e,t)=>t.highlightTexture))),e.fragment.uniforms.add(new n.c("highlightLevel",((e,t)=>t.highlightLevel))),e.outputs.add("fragHighlight","vec4",0),e.fragment.code.add(s.H`void outputHighlightNet(bool occluded) {
164
- int ll = highlightLevel & 3;
165
- int newI = 0;
166
- newI |= 1 << (ll*2);
167
- if (occluded) { newI |= 2 << (ll*2); }
168
- vec4 prevHighlight = texelFetch(highlightTexture, ivec2(gl_FragCoord.xy), 0);
169
- int li = (highlightLevel >> 2) & 3;
170
- int prevI = int(prevHighlight[li] * 255.0);
171
- int cI = newI | prevI;
172
- float cf = float(cI) / 255.0;
173
- vec4 combinedHighlight = prevHighlight;
174
- combinedHighlight[li] = cf;
175
- fragHighlight = combinedHighlight;
176
- }
177
- void outputHighlight() {
178
- float sceneDepth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x;
179
- bool occluded = gl_FragCoord.z > sceneDepth + 5e-5;
180
- outputHighlightNet(occluded);
181
- }`)):e.fragment.code.add(s.H`void outputHighlight() {}`)}},52540:(e,t,r)=>{r.d(t,{E:()=>a});var i=r(37585),n=r(48163),s=(r(26835),r(47286)),o=r(2597);function a(e){e.uniforms.add(new s.G("zProjectionMap",((e,t)=>function(e){const t=e.projectionMatrix;return(0,i.hZ)(c,t[14],t[10])}(t.camera)))),e.code.add(o.H`float linearizeDepth(float depth) {
182
- float depthNdc = depth * 2.0 - 1.0;
183
- float c1 = zProjectionMap[0];
184
- float c2 = zProjectionMap[1];
185
- return -(c1 / (depthNdc + c2 + 1e-7));
186
- }`),e.code.add(o.H`float depthFromTexture(sampler2D depthTexture, vec2 uv) {
187
- ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0)));
188
- float depth = texelFetch(depthTexture, iuv, 0).r;
189
- return depth;
190
- }`),e.code.add(o.H`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) {
191
- return linearizeDepth(depthFromTexture(depthTexture, uv));
192
- }`)}const c=(0,n.vt)()},51343:(e,t,r)=>{r.d(t,{Q:()=>o});var i=r(52540),n=r(2597),s=r(63761);function o(e,t){if(!t.multipassEnabled)return void e.fragment.code.add(n.H`#define terrainDepthTest(fragmentDepth) {}`);e.fragment.include(i.E);const r=t.occlusionPass;e.fragment.uniforms.add(new s.N("terrainDepthTexture",((e,t)=>t.multipassTerrain.depth?.attachment))).code.add(n.H`
193
- ${r?"bool":"void"} terrainDepthTest(float fragmentDepth) {
194
- float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r;
195
- float linearDepth = linearizeDepth(depth);
196
- ${r?n.H`return fragmentDepth < linearDepth && depth < 1.0;`:n.H`if(fragmentDepth ${t.cullAboveGround?">":"<="} linearDepth) discard;`}
197
- }`)}},42398:(e,t,r)=>{r.d(t,{A:()=>m});var i=r(33079),n=r(39589),s=r(46263);class o extends n.n{constructor(e,t,r){super(e,"vec4",s.c.Pass,((r,i,n)=>r.setUniform4fv(e,t(i,n))),r)}}class a extends n.n{constructor(e,t,r){super(e,"float",s.c.Pass,((r,i,n)=>r.setUniform1fv(e,t(i,n))),r)}}var c=r(2597),l=r(35644),u=r(46540),d=r(78662);r(14903),d.Gd;const h=8;function m(e,t){const{vertex:r,attributes:n}=e;t.hasVvInstancing&&(t.vvSize||t.vvColor)&&n.add(u.r.INSTANCEFEATUREATTRIBUTE,"vec4"),t.vvSize?(r.uniforms.add(new i.t("vvSizeMinSize",(e=>e.vvSize.minSize))),r.uniforms.add(new i.t("vvSizeMaxSize",(e=>e.vvSize.maxSize))),r.uniforms.add(new i.t("vvSizeOffset",(e=>e.vvSize.offset))),r.uniforms.add(new i.t("vvSizeFactor",(e=>e.vvSize.factor))),r.uniforms.add(new l.k("vvSymbolRotationMatrix",(e=>e.vvSymbolRotationMatrix))),r.uniforms.add(new i.t("vvSymbolAnchor",(e=>e.vvSymbolAnchor))),r.code.add(c.H`vec3 vvScale(vec4 _featureAttribute) {
198
- return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);
199
- }
200
- vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
201
- return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
202
- }`),r.code.add(c.H`
203
- const float eps = 1.192092896e-07;
204
- vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
205
- vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize);
206
- return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0);
207
- }
208
-
209
- ${t.hasVvInstancing?c.H`
210
- vec4 vvLocalNormal(vec3 _normal) {
211
- return vvTransformNormal(_normal, instanceFeatureAttribute);
212
- }
213
-
214
- vec4 localPosition() {
215
- return vvTransformPosition(position, instanceFeatureAttribute);
216
- }`:""}
217
- `)):r.code.add(c.H`vec4 localPosition() { return vec4(position, 1.0); }
218
- vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),t.vvColor?(r.constants.add("vvColorNumber","int",h),r.uniforms.add(new a("vvColorValues",(e=>e.vvColor.values),h),new o("vvColorColors",(e=>e.vvColor.colors),h)),r.code.add(c.H`
219
- vec4 interpolateVVColor(float value) {
220
- if (value <= vvColorValues[0]) {
221
- return vvColorColors[0];
222
- }
223
-
224
- for (int i = 1; i < vvColorNumber; ++i) {
225
- if (vvColorValues[i] >= value) {
226
- float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
227
- return mix(vvColorColors[i-1], vvColorColors[i], f);
228
- }
229
- }
230
- return vvColorColors[vvColorNumber - 1];
231
- }
232
-
233
- vec4 vvGetColor(vec4 featureAttribute) {
234
- return interpolateVVColor(featureAttribute.y);
235
- }
236
-
237
- ${t.hasVvInstancing?c.H`
238
- vec4 vvColor() {
239
- return vvGetColor(instanceFeatureAttribute);
240
- }`:"vec4 vvColor() { return vec4(1.0); }"}
241
- `)):r.code.add(c.H`vec4 vvColor() { return vec4(1.0); }`)}},35093:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},63365:(e,t,r)=>{r.d(t,{a:()=>n});var i=r(2597);function n(e){e.code.add(i.H`vec4 premultiplyAlpha(vec4 v) {
242
- return vec4(v.rgb * v.a, v.a);
243
- }
244
- vec3 rgb2hsv(vec3 c) {
245
- vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
246
- vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
247
- vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
248
- float d = q.x - min(q.w, q.y);
249
- float e = 1.0e-10;
250
- return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);
251
- }
252
- vec3 hsv2rgb(vec3 c) {
253
- vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
254
- vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
255
- return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
256
- }
257
- float rgb2v(vec3 c) {
258
- return max(c.x, max(c.y, c.z));
259
- }`)}},52587:(e,t,r)=>{r.d(t,{OH:()=>l,Y6:()=>a,pM:()=>c});var i=r(38954),n=r(51850),s=r(33079),o=r(2597);function a(e){e.vertex.code.add(o.H`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
260
- return absCosAngle * absCosAngle * absCosAngle;
261
- }`),e.vertex.code.add(o.H`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) {
262
- return vec3(
263
- min(params.x / (distanceToCamera - params.y), 1.0),
264
- screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
265
- params.z
266
- );
267
- }`),e.vertex.code.add(o.H`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) {
268
- return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
269
- }`),e.vertex.code.add(o.H`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) {
270
- return applyScreenSizePerspectiveScaleFactorFloat(
271
- size,
272
- screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
273
- );
274
- }`),e.vertex.code.add(o.H`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) {
275
- return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
276
- }`),e.vertex.code.add(o.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
277
- return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
278
- }`)}function c(e){e.uniforms.add(new s.t("screenSizePerspective",(e=>u(e.screenSizePerspective))))}function l(e){e.uniforms.add(new s.t("screenSizePerspectiveAlignment",(e=>u(e.screenSizePerspectiveAlignment||e.screenSizePerspective))))}function u(e){return(0,i.s)(d,e.parameters.divisor,e.parameters.offset,e.minScaleFactor)}const d=(0,n.vt)()},20693:(e,t,r)=>{r.d(t,{yu:()=>_,Nz:()=>T,NB:()=>f,S7:()=>v});var i=r(58083),n=r(9093),s=r(38954),o=r(51850),a=r(40710),c=r(33079),l=r(20304),u=r(39589),d=r(46263);class h extends u.n{constructor(e,t){super(e,"mat4",d.c.Draw,((r,i,n)=>r.setUniformMatrix4fv(e,t(i,n))))}}var m=r(40095);function _(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",o.uY):e.uniforms.add(new a.W("cameraPosition",((e,t)=>(0,s.s)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new m.X("proj",((e,t)=>t.camera.projectionMatrix)),new h("view",((e,t)=>(0,i.Tl)(p,t.camera.viewMatrix,e.origin))),new a.W("localOrigin",(e=>e.origin)));const r=e=>(0,s.s)(g,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new m.X("proj",((e,t)=>t.camera.projectionMatrix)),new m.X("view",((e,t)=>(0,i.Tl)(p,t.camera.viewMatrix,r(t)))),new c.t("localOrigin",((e,t)=>r(t))))}const p=(0,n.vt)(),g=(0,o.vt)();function v(e){e.uniforms.add(new m.X("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}function T(e){e.uniforms.add(new l.m("pixelRatio",((e,t)=>t.camera.pixelRatio/t.overlayStretch)))}},95250:(e,t,r)=>{r.d(t,{e:()=>s});var i=r(39589),n=r(46263);class s extends i.n{constructor(e,t){super(e,"bool",n.c.Pass,((r,i,n)=>r.setUniform1b(e,t(i,n))))}}},47286:(e,t,r)=>{r.d(t,{G:()=>s});var i=r(39589),n=r(46263);class s extends i.n{constructor(e,t){super(e,"vec2",n.c.Pass,((r,i,n)=>r.setUniform2fv(e,t(i,n))))}}},71988:(e,t,r)=>{r.d(t,{E:()=>s});var i=r(39589),n=r(46263);class s extends i.n{constructor(e,t){super(e,"vec4",n.c.Pass,((r,i,n)=>r.setUniform4fv(e,t(i,n))))}}},93588:(e,t,r)=>{r.d(t,{c:()=>s});var i=r(39589),n=r(46263);class s extends i.n{constructor(e,t){super(e,"int",n.c.Pass,((r,i,n)=>r.setUniform1i(e,t(i,n))))}}},85977:(e,t,r)=>{r.d(t,{N5:()=>c});var i=r(49186),n=(r(44208),r(53966)),s=r(46263),o=r(620);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 c extends a{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new _,this.extensions=new f,this.outputs=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,s=n.uniforms.generateSource(),o=n.code.generateSource(),a=n.main.generateSource(),c="vertex"===e?T:v,l=n.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${t.join("\n")}\n\n${c}\n\n${l.join("\n")}\n\n${s.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${u.join("\n")}\n\n${o.join("\n")}\n\n${a.join("\n")}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[s.c.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[s.c.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let s=0;s<i;++s)r[s](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[s.c.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[s.c.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,n,s)=>{for(let o=0;o<i;++o)r[o](e,s,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(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder").error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class u{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];throw new i.A("Shader does not contain main function body.")}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class h extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new u(this),this.code=new d(this),this.constants=new g(this)}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class _{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,o.vA)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push("vertex"===e?`out ${r} ${i};`:`in ${r} ${i};`))),t}}class f{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?f.ALLOWLIST_VERTEX:f.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}f.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],f.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?(0,o.vA)(i.name===e&&i.type===t,`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}p.DEFAULT_TYPE="vec4",p.DEFAULT_NAME="fragColor";class g{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=g._numberToFloatStr(r);break;case"int":i=g._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])}, ${g._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>g._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",T="precision highp float;\nprecision highp sampler2D;"},63761:(e,t,r)=>{r.d(t,{N:()=>s});var i=r(39589),n=r(46263);class s extends i.n{constructor(e,t){super(e,"sampler2D",n.c.Pass,((r,i,n)=>r.bindTexture(e,t(i,n))))}}},97220:(e,t,r)=>{r.d(t,{$:()=>i});class i{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},84867:(e,t,r)=>{r.d(t,{w:()=>s});var i=r(97768),n=r(63907);class s{constructor(e,t,r){this.release=r,this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}destroy(){this._program=(0,i.WD)(this._program),this._pipeline=null}reload(e){(0,i.WD)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return n.WR.TRIANGLES}getPipeline(e,t=null){return this._pipeline}}},99769:(e,t,r)=>{r.d(t,{K:()=>s,W:()=>o});var i=r(49186),n=r(2597);class s extends n.Y{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?.map((()=>0))??[],this._parameterNames??=[],this._parameterValues=this._parameterValues?.slice()??[]}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function o(e={}){return(t,r)=>{if(t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const n=t._parameterNames.length-1,s=e.count||2,o=Math.ceil(Math.log2(s));t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterValues")||Object.defineProperty(t,"_parameterValues",{value:t._parameterValues?.slice()??[],configurable:!0,writable:!0});const a=t._parameterBits;let c=0;for(;a[c]+o>16;)c++,c>=a.length&&a.push(0);const l=a[c],u=(1<<o)-1<<l;a[c]+=o,Object.defineProperty(t,r,{get(){return this._parameterValues[n]},set(t){if(this._parameterValues[n]!==t)if(this._parameterValues[n]=t,this._keyDirty=!0,this._parameterBits[c]=this._parameterBits[c]&~u|+t<<l&u,"number"==typeof t){if(null==e.count)throw new i.A(`Configuration value for ${r} must provide a count option`)}else if("boolean"!=typeof t)throw new i.A(`Configuration value for ${r} must be boolean or number, got ${typeof t}`)}})}}}},69720:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(24326);class n{constructor(){this.id=(0,i.c)()}}},96672:(e,t,r)=>{var i;r.d(t,{X:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(i||(i={}))},39341:(e,t,r)=>{r.d(t,{D:()=>n});var i=r(46540);const n=new Map([[i.r.POSITION,0],[i.r.NORMAL,1],[i.r.NORMALCOMPRESSED,1],[i.r.UV0,2],[i.r.COLOR,3],[i.r.COLORFEATUREATTRIBUTE,3],[i.r.SIZE,4],[i.r.TANGENT,4],[i.r.CENTEROFFSETANDDISTANCE,5],[i.r.SYMBOLCOLOR,5],[i.r.FEATUREATTRIBUTE,6],[i.r.INSTANCEFEATUREATTRIBUTE,6],[i.r.INSTANCECOLOR,7],[i.r.OBJECTANDLAYERIDCOLOR,7],[i.r.INSTANCEOBJECTANDLAYERIDCOLOR,7],[i.r.ROTATION,8],[i.r.INSTANCEMODEL,8],[i.r.INSTANCEMODELNORMAL,12],[i.r.INSTANCEMODELORIGINHI,11],[i.r.INSTANCEMODELORIGINLO,15]])},25634:(e,t,r)=>{r.d(t,{m8:()=>c,NV:()=>u});var i=r(97768),n=r(74887),s=r(2597),o=r(89192);class a{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){this._techniques.release(this._technique)}get technique(){return this._technique}get _stippleTextures(){return this._techniques.constructionContext.stippleTextures}get _markerTextures(){return this._techniques.constructionContext.markerTextures}ensureTechnique(e,t){return this._technique=this._techniques.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return o.Am.LOADED}}class c extends a{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.Gz)(this._texture),this._textureNormal=(0,i.Gz)(this._textureNormal),this._textureEmissive=(0,i.Gz)(this._textureEmissive),this._textureOcclusion=(0,i.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?o.Am.LOADED:o.Am.LOADING}get textureBindParameters(){return new u(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.Gz)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,n.$X)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.Gz)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class l extends s.Y{constructor(e=null){super(),this.textureEmissive=e}}class u extends l{constructor(e=null,t=null,r=null,i=null,n=null,s,o){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.scale=s,this.normalTextureTransformMatrix=o}}},14903:(e,t,r)=>{r.d(t,{im:()=>h,m$:()=>i});var i,n,s=r(51850),o=r(2597),a=r(89192),c=r(69720),l=r(96672),u=r(39341),d=r(43616);class h extends c.J{constructor(e,t){super(),this.type=l.X.Material,this.supportsEdges=!1,this._renderPriority=0,this._vertexAttributeLocations=u.D,this._pp0=(0,s.fA)(0,0,1),this._pp1=(0,s.fA)(0,0,0),this._parameters=new t,(0,d.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,d.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.bindParameters.decorations===a.ID.ON)&&!!(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())}get vertexAttributeLocations(){return this._vertexAttributeLocations}parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.visible&&this.parameters.renderOccluded===e}get hasEmissions(){return!1}intersectDraped(e,t,r,i,n,s){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,n)}}(n=i||(i={}))[n.None=0]="None",n[n.Occlude=1]="Occlude",n[n.Transparent=2]="Transparent",n[n.OccludeAndTransparent=4]="OccludeAndTransparent",n[n.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",n[n.Opaque=16]="Opaque",o.Y},33524:(e,t,r)=>{r.d(t,{K_:()=>_,Yf:()=>u,aB:()=>m,ez:()=>l,m6:()=>f,xt:()=>d});var i=r(49255),n=r(14327),s=r(63907),o=r(90644);const a=(0,o.p3)(s.dn.SRC_ALPHA,s.dn.ONE,s.dn.ONE_MINUS_SRC_ALPHA,s.dn.ONE_MINUS_SRC_ALPHA),c=(0,o.p3)(s.dn.ONE,s.dn.ZERO,s.dn.ONE,s.dn.ONE_MINUS_SRC_ALPHA);function l(e){return e===n.y.FrontFace?null:c}function u(e){switch(e){case n.y.NONE:return a;case n.y.ColorAlpha:return c;case n.y.FrontFace:case n.y.COUNT:return null}}const d=5e5,h={factor:-1,units:-2};function m(e){return e?h:null}function _(e,t=s.MT.LESS){return e===n.y.NONE||e===n.y.FrontFace?t:s.MT.LEQUAL}function f(e,t){const r=t===i.V.ColorEmission;return e===n.y.ColorAlpha?r?{buffers:[s.Nm.COLOR_ATTACHMENT0,s.Nm.COLOR_ATTACHMENT1,s.Nm.COLOR_ATTACHMENT2]}:{buffers:[s.Nm.COLOR_ATTACHMENT0,s.Nm.COLOR_ATTACHMENT1]}:r?{buffers:[s.Nm.COLOR_ATTACHMENT0,s.Nm.COLOR_ATTACHMENT1]}:null}},34886:(e,t,r)=>{r.d(t,{B:()=>s});var i=r(3694),n=r(94656);class s{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new i.A({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this),this._fragmentUniforms=(0,n.en)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(null==t?.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),this._fragmentUniforms?.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}},13464:(e,t,r)=>{var i;r.d(t,{N:()=>i}),function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.OPAQUE_NO_SSAO_DEPTH=3]="OPAQUE_NO_SSAO_DEPTH",e[e.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_NO_SSAO_DEPTH=5]="TRANSPARENT_NO_SSAO_DEPTH",e[e.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=7]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",e[e.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",e[e.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",e[e.OPAQUE_ENVIRONMENT=12]="OPAQUE_ENVIRONMENT",e[e.TRANSPARENT_ENVIRONMENT=13]="TRANSPARENT_ENVIRONMENT",e[e.HUD_MATERIAL=14]="HUD_MATERIAL",e[e.LABEL_MATERIAL=15]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=16]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",e[e.DRAPED_WATER=19]="DRAPED_WATER",e[e.VOXEL=20]="VOXEL",e[e.MAX_SLOTS=21]="MAX_SLOTS"}(i||(i={}))},76844:(e,t,r)=>{r.d(t,{g:()=>V}),r(44208);var i=r(49186),n=r(65529),s=r(97768),o=r(74887),a=r(34275),c=r(84952),l=r(99677),u=r(56058),d=r(89192),h=r(2741);let m;var _,f;(f=_||(_={}))[f.ETC1_RGB=0]="ETC1_RGB",f[f.ETC2_RGBA=1]="ETC2_RGBA",f[f.BC1_RGB=2]="BC1_RGB",f[f.BC3_RGBA=3]="BC3_RGBA",f[f.BC4_R=4]="BC4_R",f[f.BC5_RG=5]="BC5_RG",f[f.BC7_M6_RGB=6]="BC7_M6_RGB",f[f.BC7_M5_RGBA=7]="BC7_M5_RGBA",f[f.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",f[f.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",f[f.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",f[f.ATC_RGB=11]="ATC_RGB",f[f.ATC_RGBA=12]="ATC_RGBA",f[f.FXT1_RGB=17]="FXT1_RGB",f[f.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",f[f.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",f[f.ETC2_EAC_R11=20]="ETC2_EAC_R11",f[f.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",f[f.RGBA32=13]="RGBA32",f[f.RGB565=14]="RGB565",f[f.BGR565=15]="BGR565",f[f.RGBA4444=16]="RGBA4444";var p=r(63907),g=r(21231),v=r(42293);let T=null,E=null;async function A(){return null==E&&(m??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,h.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),E=m,T=await E),E}function R(e,t,r,i,n){const s=(0,v.IB)(t?p.CQ.COMPRESSED_RGBA8_ETC2_EAC:p.CQ.COMPRESSED_RGB8_ETC2),o=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*s*o)}function S(e){return e.getNumImages()>=1&&!e.isUASTC()}function x(e){return e.getFaces()>=1&&e.isETC1S()}function I(e,t,r,i,n,s,o,a){const{compressedTextureETC:c,compressedTextureS3TC:l}=e.capabilities,[u,d]=c?i?[_.ETC2_RGBA,p.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[_.ETC1_RGB,p.CQ.COMPRESSED_RGB8_ETC2]:l?i?[_.BC3_RGBA,p.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[_.BC1_RGB,p.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[_.RGBA32,p.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(o(e,u))),a(e,u,m[e]);return t.internalFormat=d,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?p.Cj.LINEAR_MIPMAP_LINEAR:p.Cj.LINEAR,t.width=n,t.height=s,new g.g(e,t,{type:"compressed",levels:m})}var N=r(69720),C=r(96672),b=r(53966);const O=()=>b.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function M(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const w=M("DXT1"),D=M("DXT3"),P=M("DXT5");function L(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return O().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return O().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,s;switch(i){case w:n=8,s=p.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case D:n=16,s=p.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case P:n=16,s=p.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return O().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let o=1,a=r[4],c=r[3];(3&a||3&c)&&(O().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const l=a,u=c;let d,h;131072&r[2]&&!1!==t&&(o=Math.max(1,r[7]));let m=r[1]+4;const _=[];for(let t=0;t<o;++t)h=(a+3>>2)*(c+3>>2)*n,d=new Uint8Array(e,m,h),_.push(d),m+=h,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:_},internalFormat:s,width:l,height:u}}function y(e,t,r){if(e instanceof ImageData)return y(H(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}function H(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}var F,U,B=r(620),G=r(67171);class V extends N.J{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=C.X.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new n.A,this._parameters={...z,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,c.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,c.DB)(e.src)||(0,c.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new G.R;return t.wrapMode=this._parameters.wrap??p.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?p.Cj.LINEAR_MIPMAP_LINEAR:p.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,a.mw)(e)||(0,a.mg)(e))return t.encoding===d.JS.KTX2_ENCODING?function(e,t){if(null==T)return e.byteLength;const r=new T.KTX2File(new Uint8Array(e)),i=x(r)?R(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===d.JS.BASIS_ENCODING?function(e,t){if(null==T)return e.byteLength;const r=new T.BasisFile(new Uint8Array(e)),i=S(r)?R(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?W(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new g.g(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,a.mw)(t)||(0,a.mg)(t))&&this._parameters.encoding===d.JS.DDS_ENCODING?this._loadFromDDSData(e,t):((0,a.mw)(t)||(0,a.mg)(t))&&this._parameters.encoding===d.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,a.mw)(t)||(0,a.mg)(t))&&this._parameters.encoding===d.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,a.mg)(t)?this._loadFromPixelData(e,t):(0,a.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<F.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=L(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:s,width:o,height:a}=i;return t.samplingMode=n.levels.length>1?p.Cj.LINEAR_MIPMAP_LINEAR:p.Cj.LINEAR,t.hasMipmap=n.levels.length>1,t.internalFormat=s,t.width=o,t.height=a,new g.g(e,t,n)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==T&&(T=await A());const i=new T.KTX2File(new Uint8Array(r));if(!x(i))return null;i.startTranscoding();const n=I(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==T&&(T=await A());const i=new T.BasisFile(new Uint8Array(r));if(!S(i))return null;i.startTranscoding();const n=I(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,B.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?p.Ab.LUMINANCE:3===this._parameters.components?p.Ab.RGB:p.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new g.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await(0,l.D)(t,{signal:r});return(0,o.Te)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,u.Sx)(t,t.src,!1,r);return(0,o.Te)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=F.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((n,a)=>{const c=()=>{t.removeEventListener("loadeddata",l),t.removeEventListener("error",u),(0,s.xt)(d)},l=()=>{t.readyState>=F.HAVE_CURRENT_DATA&&(c(),n(this._loadFromImage(e,t)))},u=e=>{c(),a(e||new i.A("Failed to load video"))};t.addEventListener("loadeddata",l),t.addEventListener("error",u);const d=(0,o.u7)(r,(()=>u((0,o.NK)())))}))))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:t}=e.parameters;r=this._parameters.downsampleUncompressed?function(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?H(e):e;let i=e.width,n=e.height;do{i=Math.ceil(i/2),n=Math.ceil(n/2),r=i*n}while(r>1048576||null!=t&&(i>t||n>t));return y(e,i,n)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return y(e,Math.round(e.width*i),Math.round(e.height*i))}(r,t)}const i=W(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.pixelFormat=3===this._parameters.components?p.Ab.RGB:p.Ab.RGBA,n.width=i.width,n.height=i.height,this._glTexture=new g.g(e,n,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,s.WD)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function W(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(U=F||(F={}))[U.HAVE_NOTHING=0]="HAVE_NOTHING",U[U.HAVE_METADATA=1]="HAVE_METADATA",U[U.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",U[U.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",U[U.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const z={wrap:{s:p.pF.REPEAT,t:p.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1}},14327:(e,t,r)=>{var i;r.d(t,{y:()=>i}),function(e){e[e.ColorAlpha=0]="ColorAlpha",e[e.FrontFace=1]="FrontFace",e[e.NONE=2]="NONE",e[e.COUNT=3]="COUNT"}(i||(i={}))},89192:(e,t,r)=>{var i,n,s,o,a,c,l,u,d;r.d(t,{Am:()=>o,C7:()=>s,ID:()=>u,JS:()=>d,Mg:()=>c,dd:()=>a,it:()=>n,s2:()=>i,sf:()=>l}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(n||(n={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(s||(s={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(o||(o={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(a||(a={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(c||(c={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(l||(l={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(u||(u={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(d||(d={}))},30669:(e,t,r)=>{r.d(t,{MD:()=>q,m0:()=>j,cJ:()=>$,hs:()=>Y});var i=r(34727),n=(r(44208),r(53966)),s=r(4341),o=r(58083),a=r(9093),c=r(38954),l=r(51850),u=r(19419),d=r(88582),h=r(11964),m=r(240),_=r(71351),f=r(44280),p=r(32114);const g=()=>n.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function v(e=H){return{plane:(0,m.vt)(e.plane),origin:(0,l.o8)(e.origin),basis1:(0,l.o8)(e.basis1),basis2:(0,l.o8)(e.basis2)}}function T(e,t=v()){return E(e.origin,e.basis1,e.basis2,t)}function E(e,t,r,i=v()){return(0,c.c)(i.origin,e),(0,c.c)(i.basis1,t),(0,c.c)(i.basis2,r),A(i),function(e,t){Math.abs((0,c.m)(e.basis1,e.basis2)/((0,c.l)(e.basis1)*(0,c.l)(e.basis2)))>1e-6&&g().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,c.m)(e.basis1,w(e)))>1e-6&&g().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,c.m)(w(e),e.origin)-e.plane[3])>1e-6&&g().warn(t,"Plane offset is not consistent with plane origin")}(i,"fromValues()"),i}function A(e){(0,m.mR)(e.basis2,e.basis1,e.origin,e.plane)}function R(e,t,r){e!==r&&T(e,r);const i=(0,c.j)(p.rq.get(),w(e),t);return(0,c.g)(r.origin,r.origin,i),r.plane[3]-=t,r}function S(e,t=v()){const r=(e[2]-e[0])/2,i=(e[3]-e[1])/2;return(0,c.s)(t.origin,e[0]+r,e[1]+i,0),(0,c.s)(t.basis1,r,0,0),(0,c.s)(t.basis2,0,i,0),(0,m.fA)(0,0,1,0,t.plane),t}function x(e,t,r){return!!(0,m.Ui)(e.plane,t,r)&&D(e,r)}function I(e,t,r){const n=F.get();y(e,t,n,F.get());let s=Number.POSITIVE_INFINITY;for(const o of V){const a=L(e,o,U.get()),l=p.rq.get();if((0,m.T7)(n,a,l)){const e=(0,c.E)(p.rq.get(),t.origin,l),n=Math.abs((0,i.XM)((0,c.m)(t.direction,e)));n<s&&(s=n,(0,c.c)(r,l))}}return s===Number.POSITIVE_INFINITY?N(e,t,r):r}function N(e,t,r){if(x(e,t,r))return r;const i=F.get(),n=F.get();y(e,t,i,n);let s=Number.POSITIVE_INFINITY;for(const o of V){const a=L(e,o,U.get()),l=p.rq.get();if((0,m.gv)(i,a,l)){const e=(0,_.kb)(t,l);if(!(0,m.Tj)(n,l))continue;e<s&&(s=e,(0,c.c)(r,l))}}return O(e,t.origin)<s&&C(e,t.origin,r),r}function C(e,t,r){const i=(0,m._I)(e.plane,t,p.rq.get()),n=(0,h.H6)(P(e,e.basis1),i,-1,1,p.rq.get()),s=(0,h.H6)(P(e,e.basis2),i,-1,1,p.rq.get());return(0,c.f)(r,(0,c.g)(p.rq.get(),n,s),e.origin),r}function b(e,t,r){const{origin:i,basis1:n,basis2:s}=e,o=(0,c.f)(p.rq.get(),t,i),a=(0,f.gr)(n,o),l=(0,f.gr)(s,o),u=(0,f.gr)(w(e),o);return(0,c.s)(r,a,l,u)}function O(e,t){const r=b(e,t,p.rq.get()),{basis1:i,basis2:n}=e,s=(0,c.l)(i),o=(0,c.l)(n),a=Math.max(Math.abs(r[0])-s,0),l=Math.max(Math.abs(r[1])-o,0),u=r[2];return a*a+l*l+u*u}function M(e,t){const r=-e.plane[3];return(0,f.gr)(w(e),t)-r}function w(e){return(0,m.Qj)(e.plane)}function D(e,t){const r=(0,c.f)(p.rq.get(),t,e.origin),i=(0,c.q)(e.basis1),n=(0,c.q)(e.basis2),s=(0,c.m)(e.basis1,r),o=(0,c.m)(e.basis2,r);return-s-i<0&&s-i<0&&-o-n<0&&o-n<0}function P(e,t){const r=U.get();return(0,c.c)(r.origin,e.origin),(0,c.c)(r.vector,t),r}function L(e,t,r){const{basis1:i,basis2:n,origin:s}=e,o=(0,c.j)(p.rq.get(),i,t.origin[0]),a=(0,c.j)(p.rq.get(),n,t.origin[1]);(0,c.g)(r.origin,o,a),(0,c.g)(r.origin,r.origin,s);const l=(0,c.j)(p.rq.get(),i,t.direction[0]),u=(0,c.j)(p.rq.get(),n,t.direction[1]);return(0,c.j)(r.vector,(0,c.g)(l,l,u),2),r}function y(e,t,r,i){const n=w(e);(0,m.mR)(n,t.direction,t.origin,r),(0,m.mR)((0,m.Qj)(r),n,t.origin,i)}const H={plane:(0,m.vt)(),origin:(0,l.fA)(0,0,0),basis1:(0,l.fA)(1,0,0),basis2:(0,l.fA)(0,1,0)},F=new s.I(m.vt),U=new s.I(h.vt),B=(0,l.vt)(),G=new s.I((()=>v())),V=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],W=(0,a.vt)(),z=(0,a.vt)();Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:class{constructor(){this.plane=(0,m.vt)(),this.origin=(0,l.vt)(),this.basis1=(0,l.vt)(),this.basis2=(0,l.vt)()}},altitudeAt:M,axisAt:function(e,t,r,i){return function(e,t,r){switch(t){case d._.X:(0,c.c)(r,e.basis1),(0,c.n)(r,r);break;case d._.Y:(0,c.c)(r,e.basis2),(0,c.n)(r,r);break;case d._.Z:(0,c.c)(r,w(e))}return r}(e,r,i)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:N,closestPointOnSilhouette:I,copy:T,copyWithoutVerify:function(e,t){(0,c.c)(t.origin,e.origin),(0,c.c)(t.basis1,e.basis1),(0,c.c)(t.basis2,e.basis2),(0,m.C)(t.plane,e.plane)},create:v,distance:function(e,t){return Math.sqrt(O(e,t))},distance2:O,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const i of V){const n=L(e,i,U.get()),s=(0,h.kb)(n,t);s>r&&(r=s)}return Math.sqrt(r)},elevate:R,equals:function(e,t){return(0,c.e)(e.basis1,t.basis1)&&(0,c.e)(e.basis2,t.basis2)&&(0,c.e)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,m.Tj)(e.plane,t)&&D(e,t)},fromAABoundingRect:S,fromValues:E,getExtent:function(e,t){const r=e.basis1[0],i=e.basis2[1],[n,s]=e.origin;return(0,u.fA)(n-r,s-i,n+i,s+i,t)},intersectRay:x,intersectRayClosestSilhouette:function(e,t,r){if(x(e,t,r))return r;const i=I(e,t,p.rq.get());return(0,c.g)(r,t.origin,(0,c.j)(p.rq.get(),t.direction,(0,c.p)(t.origin,i)/(0,c.l)(t.direction))),r},normal:w,projectPoint:C,projectPointLocal:b,rotate:function(e,t,r,i){return e!==i&&T(e,i),(0,o.$0)(z,t,r),(0,c.h)(i.basis1,e.basis1,z),(0,c.h)(i.basis2,e.basis2,z),A(i),i},setAltitudeAt:function(e,t,r,i){const n=M(e,t),s=(0,c.j)(B,w(e),r-n);return(0,c.g)(i,t,s),i},setExtent:function(e,t,r){return S(t,r),R(r,M(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&T(e,r),(0,o.B8)(W,t),(0,o.mg)(W,W),(0,c.h)(r.basis1,e.basis1,W),(0,c.h)(r.basis2,e.basis2,W),(0,c.h)((0,m.Qj)(r.plane),(0,m.Qj)(e.plane),W),(0,c.h)(r.origin,e.origin,t),(0,m.mP)(r.plane,r.plane,r.origin),r},up:H,updateUnboundedPlane:A,wrap:function(e,t,r){const i=G.get();return i.origin=e,i.basis1=t,i.basis2=r,i.plane=(0,m.LV)(0,0,0,0),A(i),i}},Symbol.toStringTag,{value:"Module"}));var X=r(76412);function k(e,t,r){const i=r.parameters;return Q.scale=Math.min(i.divisor/(t-i.offset),1),Q.factor=function(e){return Math.abs(e*e*e)}(e),Q}function j(e,t){return(0,i.Cc)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}function $(e,t,r,i){i.scale=function(e,t,r){const i=k(e,t,r);return i.minScaleFactor=0,j(1,i)}(e,t,r),i.factor=0,i.minScaleFactor=r.minScaleFactor}function q(e,t,r=[0,0]){const i=Math.min(Math.max(t.scale,t.minScaleFactor),1);return r[0]=e[0]*i,r[1]=e[1]*i,r}function Y(e,t,r,i){return j(e,k(t,r,i))}r(24151),(0,i.kU)(10),(0,i.kU)(12),(0,i.kU)(70),(0,i.kU)(40);const Q={scale:0,factor:0,minScaleFactor:0};(0,X.c)()},99550:(e,t,r)=>{r.d(t,{E:()=>a});var i=r(90237),n=r(82991),s=r(46263),o=r(99769);class a extends n.nW{}(0,i._)([(0,o.W)({constValue:!0})],a.prototype,"hasSliceHighlight",void 0),(0,i._)([(0,o.W)({constValue:!1})],a.prototype,"hasSliceInVertexProgram",void 0),(0,i._)([(0,o.W)({constValue:s.c.Pass})],a.prototype,"bindType",void 0)},43616:(e,t,r)=>{r.d(t,{MB:()=>a,Um:()=>c,kE:()=>o});var i=r(4576),n=r(34727),s=r(30669);function o(e,t,r,i,o){let a=(r.screenLength||0)*e.pixelRatio;null!=o&&(a=(0,s.hs)(a,i,t,o));const c=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.qE)(c*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function a(e,t){let r=!1;for(const n in t){const s=t[n];void 0!==s&&(Array.isArray(s)?Array.isArray(e[n])&&(0,i.aI)(s,e[n])||(e[n]=s.slice(),r=!0):e[n]!==s&&(r=!0,e[n]=s))}return r}const c={multiply:1,ignore:2,replace:3,tint:4}},59907:(e,t,r)=>{r.d(t,{Hk:()=>h,Pq:()=>d,SA:()=>p,Ut:()=>u,p1:()=>m,tH:()=>f,tb:()=>_,uO:()=>a});var i=r(58083),n=r(13030),s=r(620),o=r(46540);function a(e,t,r,i=1){const{data:n,indices:s}=e,o=t.typedBuffer,a=t.typedBufferStride,c=s.length;if(r*=a,1===i)for(let e=0;e<c;++e)o[r]=n[s[e]],r+=a;else for(let e=0;e<c;++e){const t=n[s[e]];for(let e=0;e<i;e++)o[r]=t,r+=a}}function c(e,t,r){const{data:i,indices:n}=e,s=t.typedBuffer,o=t.typedBufferStride,a=n.length;r*=o;for(let e=0;e<a;++e){const t=2*n[e];s[r]=i[t],s[r+1]=i[t+1],r+=o}}function l(e,t,r,i){const{data:n,indices:s}=e,o=t.typedBuffer,a=t.typedBufferStride,c=s.length;if(r*=a,null==i||1===i)for(let e=0;e<c;++e){const t=3*s[e];o[r]=n[t],o[r+1]=n[t+1],o[r+2]=n[t+2],r+=a}else for(let e=0;e<c;++e){const t=3*s[e];for(let e=0;e<i;++e)o[r]=n[t],o[r+1]=n[t+1],o[r+2]=n[t+2],r+=a}}function u(e,t,r,i=1){const{data:n,indices:s}=e,o=t.typedBuffer,a=t.typedBufferStride,c=s.length;if(r*=a,1===i)for(let e=0;e<c;++e){const t=4*s[e];o[r]=n[t],o[r+1]=n[t+1],o[r+2]=n[t+2],o[r+3]=n[t+3],r+=a}else for(let e=0;e<c;++e){const t=4*s[e];for(let e=0;e<i;++e)o[r]=n[t],o[r+1]=n[t+1],o[r+2]=n[t+2],o[r+3]=n[t+3],r+=a}}function d(e,t,r){const i=e.typedBuffer,n=e.typedBufferStride;t*=n;for(let e=0;e<r;++e)i[t]=0,i[t+1]=0,i[t+2]=0,i[t+3]=0,t+=n}function h(e,t,r,n,s=1){if(!t)return void l(e,r,n,s);const{data:o,indices:a}=e,c=r.typedBuffer,u=r.typedBufferStride,d=a.length,h=t[0],m=t[1],_=t[2],f=t[4],p=t[5],g=t[6],v=t[8],T=t[9],E=t[10],A=t[12],R=t[13],S=t[14];n*=u;let x=0,I=0,N=0;const C=(0,i.tZ)(t)?e=>{x=o[e]+A,I=o[e+1]+R,N=o[e+2]+S}:e=>{const t=o[e],r=o[e+1],i=o[e+2];x=h*t+f*r+v*i+A,I=m*t+p*r+T*i+R,N=_*t+g*r+E*i+S};if(1===s)for(let e=0;e<d;++e)C(3*a[e]),c[n]=x,c[n+1]=I,c[n+2]=N,n+=u;else for(let e=0;e<d;++e){C(3*a[e]);for(let e=0;e<s;++e)c[n]=x,c[n+1]=I,c[n+2]=N,n+=u}}function m(e,t,r,n,s=1){if(!t)return void l(e,r,n,s);const{data:o,indices:a}=e,c=t,u=r.typedBuffer,d=r.typedBufferStride,h=a.length,m=c[0],_=c[1],f=c[2],p=c[4],g=c[5],v=c[6],T=c[8],E=c[9],A=c[10],R=!(0,i.ut)(c),S=1e-6,x=1-S;n*=d;let I=0,N=0,C=0;const b=(0,i.tZ)(c)?e=>{I=o[e],N=o[e+1],C=o[e+2]}:e=>{const t=o[e],r=o[e+1],i=o[e+2];I=m*t+p*r+T*i,N=_*t+g*r+E*i,C=f*t+v*r+A*i};if(1===s)if(R)for(let e=0;e<h;++e){b(3*a[e]);const t=I*I+N*N+C*C;if(t<x&&t>S){const e=1/Math.sqrt(t);u[n]=I*e,u[n+1]=N*e,u[n+2]=C*e}else u[n]=I,u[n+1]=N,u[n+2]=C;n+=d}else for(let e=0;e<h;++e)b(3*a[e]),u[n]=I,u[n+1]=N,u[n+2]=C,n+=d;else for(let e=0;e<h;++e){if(b(3*a[e]),R){const e=I*I+N*N+C*C;if(e<x&&e>S){const t=1/Math.sqrt(e);I*=t,N*=t,C*=t}}for(let e=0;e<s;++e)u[n]=I,u[n+1]=N,u[n+2]=C,n+=d}}function _(e,t,r,i,n=1){const{data:s,indices:o}=e,a=r.typedBuffer,c=r.typedBufferStride,l=o.length;if(i*=c,t!==s.length||4!==t)if(1!==n)if(4!==t)for(let e=0;e<l;++e){const t=3*o[e];for(let e=0;e<n;++e)a[i]=s[t],a[i+1]=s[t+1],a[i+2]=s[t+2],a[i+3]=255,i+=c}else for(let e=0;e<l;++e){const t=4*o[e];for(let e=0;e<n;++e)a[i]=s[t],a[i+1]=s[t+1],a[i+2]=s[t+2],a[i+3]=s[t+3],i+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*o[e];a[i]=s[t],a[i+1]=s[t+1],a[i+2]=s[t+2],a[i+3]=s[t+3],i+=c}return}for(let e=0;e<l;++e){const t=3*o[e];a[i]=s[t],a[i+1]=s[t+1],a[i+2]=s[t+2],a[i+3]=255,i+=c}}else{a[i]=s[0],a[i+1]=s[1],a[i+2]=s[2],a[i+3]=s[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=c/4,o=e[i/=4];i+=t;const u=l*n;for(let r=1;r<u;++r)e[i]=o,i+=t}}function f(e,t,r,i,n=1){const s=t.typedBuffer,o=t.typedBufferStride;if(i*=o,1===n)for(let t=0;t<r;++t)s[i]=e[0],s[i+1]=e[1],s[i+2]=e[2],s[i+3]=e[3],i+=o;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)s[i]=e[0],s[i+1]=e[1],s[i+2]=e[2],s[i+3]=e[3],i+=o}function p(e,t,r,i,s,a,c){for(const l of r.fields.keys()){const r=e.get(l),u=r?.indices;if(r&&u)g(l,r,i,s,a,c);else if(l===o.r.OBJECTANDLAYERIDCOLOR&&null!=t){const r=e.get(o.r.POSITION)?.indices;if(r){const e=r.length;f(t,a.getField(l,n.XP),e,c)}}}}function g(e,t,r,a,l,d){switch(e){case o.r.POSITION:{(0,s.vA)(3===t.size);const i=l.getField(e,n.xs);(0,s.vA)(!!i,`No buffer view for ${e}`),i&&h(t,r,i,d);break}case o.r.NORMAL:{(0,s.vA)(3===t.size);const r=l.getField(e,n.xs);(0,s.vA)(!!r,`No buffer view for ${e}`),r&&m(t,a,r,d);break}case o.r.NORMALCOMPRESSED:{(0,s.vA)(2===t.size);const r=l.getField(e,n.mJ);(0,s.vA)(!!r,`No buffer view for ${e}`),r&&c(t,r,d);break}case o.r.UV0:{(0,s.vA)(2===t.size);const r=l.getField(e,n.gH);(0,s.vA)(!!r,`No buffer view for ${e}`),r&&c(t,r,d);break}case o.r.COLOR:case o.r.SYMBOLCOLOR:{const r=l.getField(e,n.XP);(0,s.vA)(!!r,`No buffer view for ${e}`),(0,s.vA)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||_(t,t.size,r,d);break}case o.r.COLORFEATUREATTRIBUTE:{const r=l.getField(e,n.Y$);(0,s.vA)(!!r,`No buffer view for ${e}`),(0,s.vA)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:i,indices:n}=e,s=t.typedBuffer,o=t.typedBufferStride,a=n.length,c=i[0];r*=o;for(let e=0;e<a;++e)s[r]=c,r+=o}(t,r,d);break}case o.r.TANGENT:{(0,s.vA)(4===t.size);const o=l.getField(e,n.Eq);(0,s.vA)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,n,s=1){if(!t)return void u(e,r,n,s);const{data:o,indices:a}=e,c=t,l=r.typedBuffer,d=r.typedBufferStride,h=a.length,m=c[0],_=c[1],f=c[2],p=c[4],g=c[5],v=c[6],T=c[8],E=c[9],A=c[10],R=!(0,i.ut)(c),S=1e-6,x=1-S;if(n*=d,1===s)for(let e=0;e<h;++e){const t=4*a[e],r=o[t],i=o[t+1],s=o[t+2],c=o[t+3];let u=m*r+p*i+T*s,h=_*r+g*i+E*s,I=f*r+v*i+A*s;if(R){const e=u*u+h*h+I*I;if(e<x&&e>S){const t=1/Math.sqrt(e);u*=t,h*=t,I*=t}}l[n]=u,l[n+1]=h,l[n+2]=I,l[n+3]=c,n+=d}else for(let e=0;e<h;++e){const t=4*a[e],r=o[t],i=o[t+1],c=o[t+2],u=o[t+3];let h=m*r+p*i+T*c,I=_*r+g*i+E*c,N=f*r+v*i+A*c;if(R){const e=h*h+I*I+N*N;if(e<x&&e>S){const t=1/Math.sqrt(e);h*=t,I*=t,N*=t}}for(let e=0;e<s;++e)l[n]=h,l[n+1]=I,l[n+2]=N,l[n+3]=u,n+=d}}(t,r,o,d);break}case o.r.PROFILERIGHT:case o.r.PROFILEUP:case o.r.PROFILEVERTEXANDNORMAL:case o.r.FEATUREVALUE:{(0,s.vA)(4===t.size);const r=l.getField(e,n.Eq);(0,s.vA)(!!r,`No buffer view for ${e}`),r&&u(t,r,d)}}}},36421:(e,t,r)=>{var i;r.d(t,{p:()=>i}),function(e){e[e.Texture=0]="Texture",e[e.RenderBuffer=1]="RenderBuffer"}(i||(i={}))},21231:(e,t,r)=>{r.d(t,{g:()=>l});var i=r(49186),n=(r(44208),r(94656)),s=r(63907),o=r(36421),a=r(67171);class c extends a.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case s.H0.R16F:case s.H0.R16I:case s.H0.R16UI:case s.H0.R32F:case s.H0.R32I:case s.H0.R32UI:case s.H0.R8_SNORM:case s.H0.R8:case s.H0.R8I:case s.H0.R8UI:this.pixelFormat=s.Ab.RED}}static validate(e,t){return new c(e,t)}}let l=class e{constructor(e,t=null,r=null){if(this.type=o.p.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=c.validate(e,t);if(!r)throw new i.A("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===s.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return(0,a.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(s.vt.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===s.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=s.Ap.TEXTURE_CUBE_MAP_POSITIVE_X;t<=s.Ap.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(t,r){if(!this._descriptor.context?.gl)return;const o=this._descriptor.context.gl;(0,n.Y2)(o),this._glName||(this._glName=o.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(s.vt.Texture,this)),void 0===t&&(t=null);const a=this._descriptor,c=r??a.target,l=f(c);null===t&&(a.width=a.width||4,a.height=a.height||4,l&&(a.depth=a.depth??1));const g=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),u(a),this._configurePixelStorage(),(0,n.Y2)(o);const v=this._deriveInternalFormat();if(_(t)){let e="width"in t?t.width:t.codedWidth,r="height"in t?t.height:t.codedHeight;const i=1;t instanceof HTMLVideoElement&&(e=t.videoWidth,r=t.videoHeight),a.width&&a.height,l&&a.depth,a.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(c,v,a.hasMipmap,e,r,i),this._texImage(c,0,v,e,r,i,t),(0,n.Y2)(o),a.hasMipmap&&this.generateMipmap(),a.width||(a.width=e),a.height||(a.height=r),l&&!a.depth&&(a.depth=i)}else{const{width:e,height:r,depth:u}=a;if(null==e||null==r)throw new i.A("Width and height must be specified!");if(l&&null==u)throw new i.A("Depth must be specified!");if(a.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(c,v,a.hasMipmap,e,r,u),m(t)){const n=t.levels,l=p(c,e,r,u),d=Math.min(l-1,n.length-1);o.texParameteri(a.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,d);const h=v;if(!(h in s.CQ))throw new i.A("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const s=n[Math.min(e,n.length-1)];this._compressedTexImage(c,e,h,t,r,i,s)}),d)}else this._texImage(c,0,v,e,r,u,t),(0,n.Y2)(o),a.hasMipmap&&this.generateMipmap()}d(o,this._descriptor),h(o,this._descriptor),function(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}(this._descriptor.context,this._descriptor),(0,n.Y2)(o),this._descriptor.context.bindTexture(g,e.TEXTURE_UNIT_FOR_UPDATES)}updateData(t,r,n,s,o,a,c=0){a||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor,u=this._deriveInternalFormat(),{context:d,pixelFormat:h,dataType:f,target:p,isImmutable:g}=l;if(g&&!this._wasImmutablyAllocated)throw new i.A("Cannot update immutable texture before allocation!");const v=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||n<0||r+s>l.width||n+o>l.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=d;c&&T.pixelStorei(T.UNPACK_SKIP_ROWS,c),_(a)?T.texSubImage2D(p,t,r,n,s,o,h,f,a):m(a)?T.compressedTexSubImage2D(p,t,r,n,s,o,u,a.levels[t]):T.texSubImage2D(p,t,r,n,s,o,h,f,a),c&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),d.bindTexture(v,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,n,s,o,a,c,l){l||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const u=this._descriptor,d=this._deriveInternalFormat(),{context:h,pixelFormat:_,dataType:p,isImmutable:g,target:v}=u;if(g&&!this._wasImmutablyAllocated)throw new i.A("Cannot update immutable texture before allocation!");f(v)||console.warn("Attempting to set 3D texture data on a non-3D texture");const T=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||n<0||s<0||r+o>u.width||n+a>u.height||s+c>u.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:E}=h;if(m(l))l=l.levels[t],E.compressedTexSubImage3D(v,t,r,n,s,o,a,c,d,l);else{const e=l;E.texSubImage3D(v,t,r,n,s,o,a,c,_,p,e)}h.bindTexture(T,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,u(t)}t.samplingMode===s.Cj.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=s.Cj.LINEAR_MIPMAP_NEAREST):t.samplingMode===s.Cj.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=s.Cj.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,u(e)}e.samplingMode===s.Cj.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=s.Cj.LINEAR):e.samplingMode===s.Cj.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=s.Cj.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,u(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,t=e.context.gl;this._samplingModeDirty&&(d(t,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(h(t,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(null!=this._descriptor.internalFormat)return this._descriptor.internalFormat===s.Ab.DEPTH_STENCIL&&(this._descriptor.internalFormat=s.Ab.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case s.ld.FLOAT:switch(this._descriptor.pixelFormat){case s.Ab.RGBA:return this._descriptor.internalFormat=s.H0.RGBA32F;case s.Ab.RGB:return this._descriptor.internalFormat=s.H0.RGB32F;default:throw new i.A("Unable to derive format")}case s.ld.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case s.Ab.RGBA:return this._descriptor.internalFormat=s.H0.RGBA8;case s.Ab.RGB:return this._descriptor.internalFormat=s.H0.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===s.Ab.DEPTH_STENCIL?s.Ab.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,n,o,a){const{gl:c}=this._descriptor.context;if(!(t in s.H0))throw new i.A("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?p(e,n,o,a):1;if(f(e)){if(null==a)throw new i.A("Missing depth dimension for 3D texture upload");c.texStorage3D(e,l,t,n,o,a)}else c.texStorage2D(e,l,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,s,o,a){const c=this._descriptor.context.gl,l=f(e),{isImmutable:u,pixelFormat:d,dataType:h}=this._descriptor;if(u){if(null!=a){const r=a;if(l){if(null==o)throw new i.A("Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,n,s,o,d,h,r)}else c.texSubImage2D(e,t,0,0,n,s,d,h,r)}}else{const u=a;if(l){if(null==o)throw new i.A("Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,n,s,o,0,d,h,u)}else c.texImage2D(e,t,r,n,s,0,d,h,u)}}_compressedTexImage(e,t,r,n,s,o,a){const c=this._descriptor.context.gl,l=f(e);if(this._descriptor.isImmutable){if(null!=a)if(l){if(null==o)throw new i.A("Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,n,s,o,r,a)}else c.compressedTexSubImage2D(e,t,0,0,n,s,r,a)}else if(l){if(null==o)throw new i.A("Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,n,s,o,0,a)}else c.compressedTexImage2D(e,t,r,n,s,0,a)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:a,target:c}=this._descriptor;const l=c===s.Ap.TEXTURE_3D;if(null==r||null==n||l&&null==o)throw new i.A("Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),a&&(1!==r||1!==n||l&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),l&&(o=Math.max(1,o>>1))}};function u(e){(null!=e.width&&e.width<0||null!=e.height&&e.height<0||null!=e.depth&&e.depth<0)&&console.error("Negative dimension parameters are not allowed!")}function d(e,t){let r=t.samplingMode,i=t.samplingMode;r===s.Cj.LINEAR_MIPMAP_NEAREST||r===s.Cj.LINEAR_MIPMAP_LINEAR?(r=s.Cj.LINEAR,t.hasMipmap||(i=s.Cj.LINEAR)):r!==s.Cj.NEAREST_MIPMAP_NEAREST&&r!==s.Cj.NEAREST_MIPMAP_LINEAR||(r=s.Cj.NEAREST,t.hasMipmap||(i=s.Cj.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}function h(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}function m(e){return null!=e&&"type"in e&&"compressed"===e.type}function _(e){return null!=e&&!m(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function f(e){return e===s.Ap.TEXTURE_3D||e===s.Ap.TEXTURE_2D_ARRAY}function p(e,t,r,i=1){let n=Math.max(t,r);return e===s.Ap.TEXTURE_3D&&(n=Math.max(n,i)),Math.round(Math.log(n)/Math.LN2)+1}l.TEXTURE_UNIT_FOR_UPDATES=0},67171:(e,t,r)=>{r.d(t,{R:()=>s,e:()=>o});var i=r(63907),n=r(42293);class s{constructor(e=0,t=e){this.width=e,this.height=t,this.target=i.Ap.TEXTURE_2D,this.pixelFormat=i.Ab.RGBA,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=i.Cj.LINEAR,this.wrapMode=i.pF.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}}function o(e){return e.width<=0||e.height<=0?0:Math.round(e.width*e.height*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.IB)(e.internalFormat)))}},42293:(e,t,r)=>{r.d(t,{IB:()=>n}),r(44208),r(94656);var i=r(63907);function n(e){switch(e){case i.Ab.ALPHA:case i.Ab.LUMINANCE:case i.Ab.RED:case i.Ab.RED_INTEGER:case i.H0.R8:case i.H0.R8I:case i.H0.R8UI:case i.H0.R8_SNORM:case i.yQ.STENCIL_INDEX8:return 1;case i.Ab.LUMINANCE_ALPHA:case i.Ab.RG:case i.Ab.RG_INTEGER:case i.H0.RGBA4:case i.H0.R16F:case i.H0.R16I:case i.H0.R16UI:case i.H0.RG8:case i.H0.RG8I:case i.H0.RG8UI:case i.H0.RG8_SNORM:case i.H0.RGB565:case i.H0.RGB5_A1:case i.yQ.DEPTH_COMPONENT16:return 2;case i.Ab.DEPTH_COMPONENT:case i.Ab.RGB:case i.Ab.RGB_INTEGER:case i.H0.RGB8:case i.H0.RGB8I:case i.H0.RGB8UI:case i.H0.RGB8_SNORM:case i.H0.SRGB8:case i.yQ.DEPTH_COMPONENT24:return 3;case i.Ab.DEPTH_STENCIL:case i.Ab.DEPTH24_STENCIL8:case i.Ab.RGBA:case i.Ab.RGBA_INTEGER:case i.H0.RGBA8:case i.H0.R32F:case i.H0.R11F_G11F_B10F:case i.H0.RG16F:case i.H0.R32I:case i.H0.R32UI:case i.H0.RG16I:case i.H0.RG16UI:case i.H0.RGBA8I:case i.H0.RGBA8UI:case i.H0.RGBA8_SNORM:case i.H0.SRGB8_ALPHA8:case i.H0.RGB9_E5:case i.H0.RGB10_A2UI:case i.H0.RGB10_A2:case i.yQ.DEPTH_STENCIL:case i.yQ.DEPTH_COMPONENT32F:case i.yQ.DEPTH24_STENCIL8:return 4;case i.yQ.DEPTH32F_STENCIL8:return 5;case i.H0.RGB16F:case i.H0.RGB16I:case i.H0.RGB16UI:return 6;case i.H0.RG32F:case i.H0.RG32I:case i.H0.RG32UI:case i.H0.RGBA16F:case i.H0.RGBA16I:case i.H0.RGBA16UI:return 8;case i.H0.RGB32F:case i.H0.RGB32I:case i.H0.RGB32UI:return 12;case i.H0.RGBA32F:case i.H0.RGBA32I:case i.H0.RGBA32UI:return 16;case i.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.CQ.COMPRESSED_R11_EAC:case i.CQ.COMPRESSED_SIGNED_R11_EAC:case i.CQ.COMPRESSED_RGB8_ETC2:case i.CQ.COMPRESSED_SRGB8_ETC2:case i.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.CQ.COMPRESSED_RG11_EAC:case i.CQ.COMPRESSED_SIGNED_RG11_EAC:case i.CQ.COMPRESSED_RGBA8_ETC2_EAC:case i.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}r(62298)},94656:(e,t,r)=>{r.d(t,{Xc:()=>l,Y2:()=>u,en:()=>c});var i=r(49186),n=r(44208),s=r(53966);const o=()=>s.A.getLogger("esri.views.webgl.checkWebGLError"),a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function l(){return a}function u(e){if(c()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),n=(new Error).stack;o().error(new i.A("webgl-error","WebGL error occurred",{message:r,stack:n}))}}}},28449:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)s[0]=e[i],t[i]=s[0];return t}function n(e,t){const r=e.length;for(let i=0;i<r;++i)s[0]=e[i],s[1]=e[i]-s[0],t[i]=s[1];return t}r.d(t,{Zo:()=>i,jA:()=>n});const s=new Float32Array(2)},62298:(e,t,r)=>{r(63907)},90644:(e,t,r)=>{r.d(t,{Ey:()=>A,Xt:()=>l,kn:()=>u,ox:()=>s,p3:()=>o,wE:()=>d});var i=r(89192),n=r(63907);function s(e,t,r=n.Tb.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function o(e,t,r,i,s=n.Tb.ADD,o=n.Tb.ADD,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:s,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}const a={face:n.Y7.BACK,mode:n.Ac.CCW},c={face:n.Y7.FRONT,mode:n.Ac.CCW},l=e=>e===i.s2.Back?a:e===i.s2.Front?c:null,u={zNear:0,zFar:1},d={r:!0,g:!0,b:!0,a:!0};function h(e){return x.intern(e)}function m(e){return N.intern(e)}function _(e){return b.intern(e)}function f(e){return M.intern(e)}function p(e){return D.intern(e)}function g(e){return L.intern(e)}function v(e){return H.intern(e)}function T(e){return U.intern(e)}function E(e){return G.intern(e)}function A(e){return W.intern(e)}class R{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function S(e){return"["+e.join(",")+"]"}const x=new R(I,(e=>({__tag:"Blending",...e})));function I(e){return e?S([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const N=new R(C,(e=>({__tag:"Culling",...e})));function C(e){return e?S([e.face,e.mode]):null}const b=new R(O,(e=>({__tag:"PolygonOffset",...e})));function O(e){return e?S([e.factor,e.units]):null}const M=new R(w,(e=>({__tag:"DepthTest",...e})));function w(e){return e?S([e.func]):null}const D=new R(P,(e=>({__tag:"StencilTest",...e})));function P(e){return e?S([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const L=new R(y,(e=>({__tag:"DepthWrite",...e})));function y(e){return e?S([e.zNear,e.zFar]):null}const H=new R(F,(e=>({__tag:"ColorWrite",...e})));function F(e){return e?S([e.r,e.g,e.b,e.a]):null}const U=new R(B,(e=>({__tag:"StencilWrite",...e})));function B(e){return e?S([e.mask]):null}const G=new R(V,(e=>({__tag:"DrawBuffers",...e})));function V(e){return e?S(e.buffers):null}const W=new R((function(e){return e?S([I(e.blending),C(e.culling),O(e.polygonOffset),w(e.depthTest),P(e.stencilTest),y(e.depthWrite),F(e.colorWrite),B(e.stencilWrite),V(e.drawBuffers)]):null}),(e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:_(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:p(e.stencilTest),depthWrite:g(e.depthWrite),colorWrite:v(e.colorWrite),stencilWrite:T(e.stencilWrite),drawBuffers:E(e.drawBuffers)})))}}]);