@arcgis/core 4.30.0-next.20240321 → 4.30.0-next.20240323
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.
- package/arcade/Dictionary.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/support/shared.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcade/parser.js +1 -1
- package/arcade/validation/arcadeValidator.js +1 -1
- package/arcade/validation/languageKeywords.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{4e4ad7ac43a72a2f88a1.js → 0005267c754235ae6784.js} +1 -1
- package/assets/esri/core/workers/chunks/07fd6804c7eaa8d2ac3f.js +1 -0
- package/assets/esri/core/workers/chunks/{ff4151d794ec73064fac.js → 10b4fbdc0f8be85737f0.js} +1 -1
- package/assets/esri/core/workers/chunks/{8fc69ac4cce6d4dd5513.js → 18a9b472007d4f2b7bbb.js} +1 -1
- package/assets/esri/core/workers/chunks/{f484d2a3deb3c60d7038.js → 1ad1cdde4db5ab793623.js} +1 -1
- package/assets/esri/core/workers/chunks/36dfc55dc536b1831918.js +1 -0
- package/assets/esri/core/workers/chunks/{cee492b97e841a6d4678.js → 5b41ec1bd24314f6f153.js} +1 -1
- package/assets/esri/core/workers/chunks/{d518a0adc3d88700235c.js → 65680926c761bf53fd14.js} +1 -1
- package/assets/esri/core/workers/chunks/{9c78ccff1c7f8ae90b06.js → 671892e733d8976e48bb.js} +1 -1
- package/assets/esri/core/workers/chunks/{4be6d5660ec1c8ac7606.js → 70188e0aa47da1aa1a7f.js} +1 -1
- package/assets/esri/core/workers/chunks/7c212395100080cf122e.js +1 -0
- package/assets/esri/core/workers/chunks/8c07e1000522c3251ac0.js +1 -0
- package/assets/esri/core/workers/chunks/9d240e70a24520b2a810.js +1 -0
- package/assets/esri/core/workers/chunks/{ee1345b212cde1ff4755.js → a7ac2c5e701f44a67aa3.js} +1 -1
- package/assets/esri/core/workers/chunks/{5a747af5273646ab848c.js → c38c6cae22627fbf6f3b.js} +1 -1
- package/assets/esri/core/workers/chunks/c4d2ff515fc70b07cb5f.js +1 -0
- package/assets/esri/core/workers/chunks/{96fd6fd8cbb3a2ee088e.js → caa03837b9c173ea493f.js} +1 -1
- package/assets/esri/core/workers/chunks/{dd5a078b7919f749ba3e.js → d90ee005599c44bfb6ad.js} +1 -1
- package/assets/esri/core/workers/chunks/dc3a6ab23a13ec5deed7.js +1 -0
- package/assets/esri/core/workers/chunks/{eb3e82ed1653ecf348da.js → e1a2f7282d889e251809.js} +1 -1
- package/assets/esri/core/workers/chunks/{52274afa07468bc555aa.js → ec52127b5ada8410acf3.js} +13 -13
- package/assets/esri/core/workers/chunks/f8693321bbd8a93666c7.js +1 -0
- package/assets/esri/core/workers/chunks/{fe7dfb8546d0fc40843c.js → fec0d24e8841ba1994f0.js} +1 -1
- package/chunks/LineSeries.js +1 -1
- package/chunks/Theme.js +1 -1
- package/chunks/index.js +5 -0
- package/chunks/languageUtils.js +1 -1
- package/core/number.js +1 -1
- package/core/workers/loaderConfig.js +1 -1
- package/interfaces.d.ts +3 -3
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/package.json +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/undoredo/support/DataEditingContext.js +5 -0
- package/views/2d/constraints/ZoomConstraint.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/utils.js +5 -0
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/TableList.js +1 -1
- package/arcade/lib/arcade-parser.js +0 -5
- package/arcade/lib/assert.js +0 -5
- package/arcade/lib/character.js +0 -5
- package/arcade/lib/comment-handler.js +0 -5
- package/arcade/lib/error-handler.js +0 -5
- package/arcade/lib/parser.js +0 -5
- package/arcade/lib/scanner.js +0 -5
- package/arcade/lib/tokenizer.js +0 -5
- package/arcade/lib/types.js +0 -5
- package/assets/esri/core/workers/chunks/12b95408753cea053a40.js +0 -1
- package/assets/esri/core/workers/chunks/16397420fb6067b47b25.js +0 -1
- package/assets/esri/core/workers/chunks/1fdbeb110fae52b96bb3.js +0 -1
- package/assets/esri/core/workers/chunks/689a122c77b39e5c73eb.js +0 -1
- package/assets/esri/core/workers/chunks/7b07f3bc68a54974cd03.js +0 -1
- package/assets/esri/core/workers/chunks/ad95daa3f4ad7030bf24.js +0 -1
- package/assets/esri/core/workers/chunks/c2573c1cb7c714435acc.js +0 -1
- package/assets/esri/core/workers/chunks/df38774f63984be0a478.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4832],{28491:(e,t,r)=>{r.d(t,{D:()=>z,b:()=>U});var i=r(46686),o=r(32680),a=r(49255),n=r(76591),s=r(76597),l=r(82991),c=r(96336),d=r(10764),u=r(39014),h=r(53466),m=r(92700),p=r(72824),f=r(54154),v=r(30815),g=r(77695),_=r(84200),x=r(8881),T=r(98619),E=r(51343),A=r(62602),b=r(22393),S=r(59469),
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4832],{28491:(e,t,r)=>{r.d(t,{D:()=>z,b:()=>U});var i=r(46686),o=r(32680),a=r(49255),n=r(76591),s=r(76597),l=r(82991),c=r(96336),d=r(10764),u=r(39014),h=r(53466),m=r(92700),p=r(72824),f=r(54154),v=r(30815),g=r(77695),_=r(84200),x=r(8881),T=r(98619),E=r(51343),A=r(62602),b=r(22393),S=r(59469),R=r(25618),y=r(51406),M=r(986),w=r(35093),C=r(52919),I=r(37077),O=r(20693),N=r(33079),H=r(71988),P=r(20304),L=r(2597),D=r(85977),F=r(63761),B=r(14327),G=r(46540);function U(e){const t=new D.N5,{vertex:r,fragment:U,varyings:z}=t;if((0,O.NB)(r,e),t.include(d.I),z.add("vpos","vec3"),t.include(M.A,e),t.include(l.BK,e),t.include(f.G,e),t.include(y.q2,e),e.output===a.V.Color||e.output===a.V.Alpha){t.include(y.Sx,e),t.include(y.MU,e),t.include(y.O1,e),t.include(y.QM,e),(0,O.yu)(r,e),t.include(c.Y,e),t.include(s.d,e);const a=e.normalType===c.W.Attribute||e.normalType===c.W.Compressed;a&&e.offsetBackfaces&&t.include(o.M),t.include(g.W,e),t.include(p.Mh,e),e.instancedColor&&t.attributes.add(G.r.INSTANCECOLOR,"vec4"),z.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(i.oD,e),t.include(u.K,e),t.include(m.c,e),r.uniforms.add(new H.E("externalColor",(e=>e.externalColor))),z.add("vcolorExt","vec4"),e.multipassEnabled&&z.add("depth","float"),r.code.add(L.H`
|
|
2
2
|
void main(void) {
|
|
3
3
|
forwardNormalizedVertexColor();
|
|
4
4
|
vcolorExt = externalColor;
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
${e.hasVertexColors?L.H`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:L.H`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
|
|
41
41
|
fragColor = vec4(opacity_);
|
|
42
42
|
}
|
|
43
|
-
`);break;case a.V.Color:t.include(n.HQ,e),t.include(x.kA,e),t.include(_.n,e),t.include(C.S,e),t.include(e.instancedDoublePrecision?
|
|
43
|
+
`);break;case a.V.Color:t.include(n.HQ,e),t.include(x.kA,e),t.include(_.n,e),t.include(C.S,e),t.include(e.instancedDoublePrecision?R.G:R.Bz,e),t.include(E.Q,e),(0,O.yu)(U,e),U.uniforms.add(r.uniforms.get("localOrigin"),new N.t("ambient",(e=>e.ambient)),new N.t("diffuse",(e=>e.diffuse)),new P.m("opacity",(e=>e.opacity)),new P.m("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&U.uniforms.add(new F.N("tex",(e=>e.texture))),t.include(S._Z,e),t.include(b.c,e),U.include(I.N),t.include(A.r,e),(0,x.a8)(U),(0,x.eU)(U),(0,T.O4)(U),U.code.add(L.H`
|
|
44
44
|
void main() {
|
|
45
45
|
discardBySlice(vpos);
|
|
46
46
|
${e.multipassEnabled?"terrainDepthTest(depth);":""}
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
|
|
91
91
|
${e.transparencyPassType===B.y.Color?L.H`fragColor = premultiplyAlpha(fragColor);`:""}
|
|
92
92
|
}
|
|
93
|
-
`)}return t.include(v.E,e),t}const z=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},57323:(e,t,r)=>{r.d(t,{R:()=>F,b:()=>D});var i=r(46686),o=r(32680),a=r(49255),n=r(76591),s=r(76597),l=r(82991),c=r(96336),d=r(10764),u=r(39014),h=r(53466),m=r(92700),p=r(54154),f=r(30815),v=r(84200),g=r(8881),_=r(98619),x=r(51343),T=r(22393),E=r(59469),A=r(25618),b=r(986),S=r(35093),
|
|
93
|
+
`)}return t.include(v.E,e),t}const z=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},57323:(e,t,r)=>{r.d(t,{R:()=>F,b:()=>D});var i=r(46686),o=r(32680),a=r(49255),n=r(76591),s=r(76597),l=r(82991),c=r(96336),d=r(10764),u=r(39014),h=r(53466),m=r(92700),p=r(54154),f=r(30815),v=r(84200),g=r(8881),_=r(98619),x=r(51343),T=r(22393),E=r(59469),A=r(25618),b=r(986),S=r(35093),R=r(52919),y=r(37077),M=r(20693),w=r(33079),C=r(71988),I=r(20304),O=r(2597),N=r(85977),H=r(63761),P=r(14327),L=r(46540);function D(e){const t=new N.N5,{vertex:r,fragment:D,varyings:F}=t;return(0,M.NB)(r,e),t.include(d.I),F.add("vpos","vec3"),t.include(b.A,e),t.include(l.BK,e),t.include(p.G,e),e.output!==a.V.Color&&e.output!==a.V.Alpha||((0,M.yu)(t.vertex,e),t.include(c.Y,e),t.include(s.d,e),e.offsetBackfaces&&t.include(o.M),e.instancedColor&&t.attributes.add(L.r.INSTANCECOLOR,"vec4"),F.add("vNormalWorld","vec3"),F.add("localvpos","vec3"),e.multipassEnabled&&F.add("depth","float"),t.include(h.U,e),t.include(i.oD,e),t.include(u.K,e),t.include(m.c,e),r.uniforms.add(new C.E("externalColor",(e=>e.externalColor))),F.add("vcolorExt","vec4"),r.code.add(O.H`
|
|
94
94
|
void main(void) {
|
|
95
95
|
forwardNormalizedVertexColor();
|
|
96
96
|
vcolorExt = externalColor;
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
forwardLinearDepth();
|
|
115
115
|
forwardTextureCoordinates();
|
|
116
116
|
}
|
|
117
|
-
`)),e.output===a.V.Alpha&&(t.include(n.HQ,e),t.include(
|
|
117
|
+
`)),e.output===a.V.Alpha&&(t.include(n.HQ,e),t.include(R.S,e),t.include(x.Q,e),D.uniforms.add(new I.m("opacity",(e=>e.opacity)),new I.m("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&D.uniforms.add(new H.N("tex",(e=>e.texture))),D.include(y.N),D.code.add(O.H`
|
|
118
118
|
void main() {
|
|
119
119
|
discardBySlice(vpos);
|
|
120
120
|
${e.multipassEnabled?O.H`terrainDepthTest(depth);`:""}
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
|
|
127
127
|
fragColor = vec4(opacity_);
|
|
128
128
|
}
|
|
129
|
-
`)),e.output===a.V.Color&&(t.include(n.HQ,e),t.include(g.kA,e),t.include(v.n,e),t.include(
|
|
129
|
+
`)),e.output===a.V.Color&&(t.include(n.HQ,e),t.include(g.kA,e),t.include(v.n,e),t.include(R.S,e),t.include(e.instancedDoublePrecision?A.G:A.Bz,e),t.include(x.Q,e),(0,M.yu)(t.fragment,e),(0,_.Gc)(D),(0,g.a8)(D),(0,g.eU)(D),D.uniforms.add(r.uniforms.get("localOrigin"),r.uniforms.get("view"),new w.t("ambient",(e=>e.ambient)),new w.t("diffuse",(e=>e.diffuse)),new I.m("opacity",(e=>e.opacity)),new I.m("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&D.uniforms.add(new H.N("tex",(e=>e.texture))),t.include(E._Z,e),t.include(T.c,e),D.include(y.N),(0,_.O4)(D),D.code.add(O.H`
|
|
130
130
|
void main() {
|
|
131
131
|
discardBySlice(vpos);
|
|
132
132
|
${e.multipassEnabled?O.H`terrainDepthTest(depth);`:""}
|
|
@@ -279,7 +279,7 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
279
279
|
|
|
280
280
|
fragBlur = b / w_total;
|
|
281
281
|
}
|
|
282
|
-
`),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}))},46140:(e,t,r)=>{r.d(t,{R:()=>o});var i=r(49186);let o=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[o,a]=t.split("."),n=/^\s*\d+\s*$/;if(!o?.match||!n.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!a?.match||!n.test(a))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(o,10),l=parseInt(a,10);return new e(s,l,r)}}},61473:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(n)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{EM:()=>o,b5:()=>i});const a=/^devext.arcgis.com$/,n=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,a,n,/^jsapps.esri.com$/,s,l]},88340:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function a(){return i()}function n(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{Un:()=>d,fA:()=>o,uY:()=>c,vt:()=>i});const c=a(),d=n(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:u,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:n,unitX:s,unitY:l,zeros:a},Symbol.toStringTag,{value:"Module"}))},11868:(e,t,r)=>{r.d(t,{oe:()=>o});var i=r(34275);function o(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}},4832:(e,t,r)=>{r.d(t,{fetch:()=>sr});var i=r(61473),o=r(77690),a=r(29242),n=r(58083),s=r(9093),l=r(48163),c=r(38954),d=r(51850),u=r(70328),h=r(11868),m=r(13030),p=r(73354),f=r(50867),v=r(43609),g=r(51737),_=r(78358),x=r(21015),T=r(4399),E=r(84498),A=r(51530),b=r(88340);function S(e){if(null==e)return null;const t=null!=e.offset?e.offset:b.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:b.Un,n=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,a.vt)();return(0,o.lw)(c,s,l),(0,o.lw)(c,n,c),c}class y{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class M{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new y,this.numberOfVertices=0}}var R=r(78888),w=r(60999),C=r(86805),I=r(49186),O=r(53966);class N{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)))}}var H=r(74887),P=r(46140),L=r(97146);async function D(e,t){const{data:r}=await(0,R.A)(e,{responseType:"image",...t});return r}var F=r(46610),B=r(89192),G=r(38168),U=r(44208),z=r(65529),V=r(97768),W=r(34275),j=r(84952),k=r(56058),q=r(2741);let $;var X,Y;(Y=X||(X={}))[Y.ETC1_RGB=0]="ETC1_RGB",Y[Y.ETC2_RGBA=1]="ETC2_RGBA",Y[Y.BC1_RGB=2]="BC1_RGB",Y[Y.BC3_RGBA=3]="BC3_RGBA",Y[Y.BC4_R=4]="BC4_R",Y[Y.BC5_RG=5]="BC5_RG",Y[Y.BC7_M6_RGB=6]="BC7_M6_RGB",Y[Y.BC7_M5_RGBA=7]="BC7_M5_RGBA",Y[Y.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",Y[Y.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",Y[Y.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",Y[Y.ATC_RGB=11]="ATC_RGB",Y[Y.ATC_RGBA=12]="ATC_RGBA",Y[Y.FXT1_RGB=17]="FXT1_RGB",Y[Y.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",Y[Y.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",Y[Y.ETC2_EAC_R11=20]="ETC2_EAC_R11",Y[Y.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",Y[Y.RGBA32=13]="RGBA32",Y[Y.RGB565=14]="RGB565",Y[Y.BGR565=15]="BGR565",Y[Y.RGBA4444=16]="RGBA4444";var Z=r(63907),J=r(21231),K=r(42293);let Q=null,ee=null;async function te(){return null==ee&&(ee=function(){if(null==$){const e=e=>(0,q.s)(`esri/libs/basisu/${e}`);$=r.e(9321).then(r.bind(r,49321)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return $}(),Q=await ee),ee}function re(e,t,r,i,o){const a=(0,K.IB)(t?Z.CQ.COMPRESSED_RGBA8_ETC2_EAC:Z.CQ.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function ie(e){return e.getNumImages()>=1&&!e.isUASTC()}function oe(e){return e.getFaces()>=1&&e.isETC1S()}function ae(e,t,r,i,o,a,n,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[X.ETC2_RGBA,Z.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[X.ETC1_RGB,Z.CQ.COMPRESSED_RGB8_ETC2]:c?i?[X.BC3_RGBA,Z.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[X.BC1_RGB,Z.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[X.RGBA32,Z.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(n(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?Z.Cj.LINEAR_MIPMAP_LINEAR:Z.Cj.LINEAR,t.width=o,t.height=a,new J.g(e,t,{type:"compressed",levels:m})}var ne=r(69720),se=r(96672);const le=()=>O.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function ce(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const de=ce("DXT1"),ue=ce("DXT3"),he=ce("DXT5");function me(e,t,r){if(e instanceof ImageData)return me(pe(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 pe(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 fe,ve,ge=r(620),_e=r(67171);class xe extends ne.J{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=se.X.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new z.A,this._parameters={...Ee,...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,j.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,j.DB)(e.src)||(0,j.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new _e.R;return t.wrapMode=this._parameters.wrap??Z.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?Z.Cj.LINEAR_MIPMAP_LINEAR:Z.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,W.mw)(e)||(0,W.mg)(e))return t.encoding===B.JS.KTX2_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.KTX2File(new Uint8Array(e)),i=oe(r)?re(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===B.JS.BASIS_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.BasisFile(new Uint8Array(e)),i=ie(r)?re(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?Te(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 J.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,W.mw)(t)||(0,W.mg)(t))&&this._parameters.encoding===B.JS.DDS_ENCODING?this._loadFromDDSData(e,t):((0,W.mw)(t)||(0,W.mg)(t))&&this._parameters.encoding===B.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,W.mw)(t)||(0,W.mg)(t))&&this._parameters.encoding===B.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,W.mg)(t)?this._loadFromPixelData(e,t):(0,W.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<fe.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return le().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return le().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,a;switch(i){case de:o=8,a=Z.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ue:o=16,a=Z.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case he:o=16,a=Z.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return le().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let n=1,s=r[4],l=r[3];(3&s||3&l)&&(le().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(n=Math.max(1,r[7]));let m=r[1]+4;const p=[];for(let t=0;t<n;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:a,width:c,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:a,width:n,height:s}=i;return t.samplingMode=o.levels.length>1?Z.Cj.LINEAR_MIPMAP_LINEAR:Z.Cj.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=a,t.width=n,t.height=s,new J.g(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.KTX2File(new Uint8Array(r));if(!oe(i))return null;i.startTranscoding();const o=ae(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.BasisFile(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=ae(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,ge.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?Z.Ab.LUMINANCE:3===this._parameters.components?Z.Ab.RGB:Z.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new J.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await D(t,{signal:r});return(0,H.Te)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,k.Sx)(t,t.src,!1,r);return(0,H.Te)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=fe.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",s),(0,V.xt)(l)},n=()=>{t.readyState>=fe.HAVE_CURRENT_DATA&&(a(),i(this._loadFromImage(e,t)))},s=e=>{a(),o(e||new I.A("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",s);const l=(0,H.u7)(r,(()=>s((0,H.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?pe(e):e;let i=e.width,o=e.height;do{i=Math.ceil(i/2),o=Math.ceil(o/2),r=i*o}while(r>1048576||null!=t&&(i>t||o>t));return me(e,i,o)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return me(e,Math.round(e.width*i),Math.round(e.height*i))}(r,t)}const i=Te(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this._parameters.components?Z.Ab.RGB:Z.Ab.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new J.g(e,o,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,V.WD)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function Te(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(ve=fe||(fe={}))[ve.HAVE_NOTHING=0]="HAVE_NOTHING",ve[ve.HAVE_METADATA=1]="HAVE_METADATA",ve[ve.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",ve[ve.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",ve[ve.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const Ee={wrap:{s:Z.pF.REPEAT,t:Z.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Ae=r(46540),be=r(24151),Se=r(1843),ye=r(49255),Me=r(96336),Re=r(62602),we=r(59469),Ce=r(25634),Ie=r(14903),Oe=r(14327),Ne=r(90644);const He=(0,Ne.p3)(Z.dn.SRC_ALPHA,Z.dn.ONE,Z.dn.ONE_MINUS_SRC_ALPHA,Z.dn.ONE_MINUS_SRC_ALPHA),Pe=(0,Ne.ox)(Z.dn.ONE,Z.dn.ONE),Le=(0,Ne.ox)(Z.dn.ZERO,Z.dn.ONE_MINUS_SRC_ALPHA);function De(e){return e===Oe.y.FrontFace?null:e===Oe.y.Alpha?Le:Pe}const Fe={factor:-1,units:-2};function Be(e,t=Z.MT.LESS){return e===Oe.y.NONE||e===Oe.y.FrontFace?t:Z.MT.LEQUAL}const Ge=(0,u.vt)();function Ue(e,t,r,i,o,a){if(!e.visible)return;const n=(0,c.z)(Ye,i,r);if(e.boundingInfo){(0,ge.vA)(e.type===se.X.Mesh);const i=t.tolerance;Ve(e.boundingInfo,r,n,i,o,a)}else{const t=e.attributes.get(Ae.r.POSITION),i=t.indices;!function(e,t,r,i,o,a,n,s,l){const d=t,u=Ze,h=Math.abs(d[0]),m=Math.abs(d[1]),p=Math.abs(d[2]),f=h>=m?h>=p?0:2:m>=p?1:2,v=f,g=d[v]<0?2:1,_=(f+g)%3,x=(f+(3-g))%3,T=d[_]/d[v],E=d[x]/d[v],A=1/d[v],b=Je,S=Ke,y=Qe;for(let t=r;t<i;++t){const r=3*t,i=n*o[r];(0,c.s)(u[0],a[i+0],a[i+1],a[i+2]);const d=n*o[r+1];(0,c.s)(u[1],a[d+0],a[d+1],a[d+2]);const h=n*o[r+2];(0,c.s)(u[2],a[h+0],a[h+1],a[h+2]),s&&((0,c.c)(u[0],s.applyToVertex(u[0][0],u[0][1],u[0][2],t)),(0,c.c)(u[1],s.applyToVertex(u[1][0],u[1][1],u[1][2],t)),(0,c.c)(u[2],s.applyToVertex(u[2][0],u[2][1],u[2][2],t))),(0,c.z)(b,u[0],e),(0,c.z)(S,u[1],e),(0,c.z)(y,u[2],e);const m=b[_]-T*b[v],p=b[x]-E*b[v],f=S[_]-T*S[v],g=S[x]-E*S[v],M=y[_]-T*y[v],R=y[x]-E*y[v],w=M*g-R*f,C=m*R-p*M,I=f*p-g*m;if((w<0||C<0||I<0)&&(w>0||C>0||I>0))continue;const O=w+C+I;if(0===O)continue;const N=w*(A*b[v])+C*(A*S[v])+I*(A*y[v]);if(N*Math.sign(O)<0)continue;const H=N/O;H>=0&&l(H,((0,c.z)(je,u[1],u[0]),(0,c.z)(ke,u[2],u[0]),(0,c.b)(We,je,ke),(0,c.n)(We,We),We),t,!1)}}(r,n,0,i.length/3,i,t.data,t.stride,o,a)}}const ze=(0,d.vt)();function Ve(e,t,r,i,o,a){if(null==e)return;const n=function(e,t){return(0,c.s)(t,1/e[0],1/e[1],1/e[2])}(r,ze);if((0,u.Ne)(Ge,e.bbMin),(0,u.vI)(Ge,e.bbMax),null!=o&&o.applyToAabb(Ge),function(e,t,r,i){return function(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let s=Math.min(a,n),l=Math.max(a,n);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(Ge,t,n,i)){const{primitiveIndices:n,position:s}=e,l=n?n.length:s.indices.length/3;if(l>$e){const n=e.getChildren();if(void 0!==n){for(const e of n)Ve(e,t,r,i,o,a);return}}!function(e,t,r,i,o,a,n,s,l,c){const d=e[0],u=e[1],h=e[2],m=t[0],p=t[1],f=t[2];for(let e=0;e<i;++e){const t=s[e],r=3*t,i=n*o[r];let v=a[i],g=a[i+1],_=a[i+2];const x=n*o[r+1];let T=a[x],E=a[x+1],A=a[x+2];const b=n*o[r+2];let S=a[b],y=a[b+1],M=a[b+2];null!=l&&([v,g,_]=l.applyToVertex(v,g,_,e),[T,E,A]=l.applyToVertex(T,E,A,e),[S,y,M]=l.applyToVertex(S,y,M,e));const R=T-v,w=E-g,C=A-_,I=S-v,O=y-g,N=M-_,H=p*N-O*f,P=f*I-N*m,L=m*O-I*p,D=R*H+w*P+C*L;if(Math.abs(D)<=Xe)continue;const F=d-v,B=u-g,G=h-_,U=F*H+B*P+G*L;if(D>0){if(U<0||U>D)continue}else if(U>0||U<D)continue;const z=B*C-w*G,V=G*R-C*F,W=F*w-R*B,j=m*z+p*V+f*W;if(D>0){if(j<0||U+j>D)continue}else if(j>0||U+j<D)continue;const k=(I*z+O*V+N*W)/D;k>=0&&c(k,qe(R,w,C,I,O,N,We),t,!1)}}(t,r,0,l,s.indices,s.data,s.stride,n,o,a)}}const We=(0,d.vt)(),je=(0,d.vt)(),ke=(0,d.vt)();function qe(e,t,r,i,o,a,n){return(0,c.s)(je,e,t,r),(0,c.s)(ke,i,o,a),(0,c.b)(n,je,ke),(0,c.n)(n,n),n}const $e=1e3,Xe=1e-7;const Ye=(0,d.vt)(),Ze=[(0,d.vt)(),(0,d.vt)(),(0,d.vt)()],Je=(0,d.vt)(),Ke=(0,d.vt)(),Qe=(0,d.vt)();var et=r(13464),tt=r(76412),rt=r(57005);const it=new class{constructor(e=0){this.offset=e,this.sphere=(0,tt.c)(),this.tmpVertex=(0,d.vt)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,o=(0,c.s)(ot,e,t,r),a=(0,c.e)(o,o,i),n=this.offset/(0,c.l)(a);(0,c.r)(a,a,a,n);const s=this.objectTransform.inverse;return(0,c.e)(this.tmpVertex,a,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,c.l)(e);(0,c.r)(e,e,e,r);const i=this.offset/(0,c.l)(t);(0,c.r)(t,t,t,i)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,c.l)((0,tt.g)(e)),r=this.offset/t;return(0,c.r)((0,tt.g)(this.sphere),(0,tt.g)(e),(0,tt.g)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,d.vt)(),this._tmpMbs=(0,tt.c)(),this._tmpObb=new rt.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,c.l)(e)}applyToVertex(e,t,r){const i=(0,c.s)(ot,e,t,r),o=(0,c.s)(at,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,c.l)(o);return(0,c.r)(this._tmpVertex,i,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,a=e[3],n=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),d=Math.abs(o),u=Math.abs(a),h=Math.abs(n),m=Math.abs(s),p=.5*(1+Math.sign(r*a))*Math.min(l,u),f=.5*(1+Math.sign(i*n))*Math.min(c,h),v=.5*(1+Math.sign(o*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,m),T=Math.sqrt(p*p+f*f+v*v),E=Math.sign(l+r),A=Math.sign(c+i),b=Math.sign(d+o),S=Math.sign(u+a),y=Math.sign(h+n),M=Math.sign(m+s),R=this._totalOffset;if(T<R)return e[0]-=(1-E)*R,e[1]-=(1-A)*R,e[2]-=(1-b)*R,e[3]+=S*R,e[4]+=y*R,e[5]+=M*R,e;const w=R/Math.sqrt(g*g+_*_+x*x),C=R/T,I=C-w,O=-I;return e[0]+=r*(E*O+C),e[1]+=i*(A*O+C),e[2]+=o*(b*O+C),e[3]+=a*(S*I+w),e[4]+=n*(y*I+w),e[5]+=s*(M*I+w),e}applyToMbs(e){const t=(0,c.l)((0,tt.g)(e)),r=this._totalOffset/t;return(0,c.r)((0,tt.g)(this._tmpMbs),(0,tt.g)(e),(0,tt.g)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,rt.gm)(e,this._totalOffset,this._totalOffset,be.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,d.vt)()}applyToVertex(e,t,r){const i=(0,c.s)(ot,e,t,r),o=(0,c.g)(at,i,this.localOrigin),a=this.offset/(0,c.l)(o);return(0,c.r)(this.tmpVertex,i,o,a),this.tmpVertex}applyToAabb(e){const t=nt,r=st,i=lt;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const a=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let o=0;o<3;++o)i[o]=e&1<<o?r[o]:t[o];a(i)}let n=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(n|=1<<e);if(0!==n&&7!==n)for(let e=0;e<8;++e)if(!(n&e)){for(let o=0;o<3;++o)i[o]=n&1<<o?0:e&1<<o?t[o]:r[o];a(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const ot=(0,d.vt)(),at=(0,d.vt)(),nt=(0,d.vt)(),st=(0,d.vt)(),lt=(0,d.vt)();function ct(e,t,r){const{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length;r*=n;for(let e=0;e<s;++e){const t=2*o[e];a[r]=i[t],a[r+1]=i[t+1],r+=n}}function dt(e,t,r,i){const{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,null==i||1===i)for(let e=0;e<l;++e){const t=3*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}}function ut(e,t,r,i=1){const{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}}function ht(e,t,r,i,o=1){const a=t.typedBuffer,n=t.typedBufferStride;if(i*=n,1===o)for(let t=0;t<r;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n}function mt(e,t,r,i,o,a){switch(e){case Ae.r.POSITION:{(0,ge.vA)(3===t.size);const i=o.getField(e,m.xs);(0,ge.vA)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o=1){if(!t)return void dt(e,r,i,o);const{data:a,indices:s}=e,l=r.typedBuffer,c=r.typedBufferStride,d=s.length,u=t[0],h=t[1],m=t[2],p=t[4],f=t[5],v=t[6],g=t[8],_=t[9],x=t[10],T=t[12],E=t[13],A=t[14];i*=c;let b=0,S=0,y=0;const M=(0,n.tZ)(t)?e=>{b=a[e]+T,S=a[e+1]+E,y=a[e+2]+A}:e=>{const t=a[e],r=a[e+1],i=a[e+2];b=u*t+p*r+g*i+T,S=h*t+f*r+_*i+E,y=m*t+v*r+x*i+A};if(1===o)for(let e=0;e<d;++e)M(3*s[e]),l[i]=b,l[i+1]=S,l[i+2]=y,i+=c;else for(let e=0;e<d;++e){M(3*s[e]);for(let e=0;e<o;++e)l[i]=b,l[i+1]=S,l[i+2]=y,i+=c}}(t,r,i,a);break}case Ae.r.NORMAL:{(0,ge.vA)(3===t.size);const r=o.getField(e,m.xs);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void dt(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=l[0],m=l[1],p=l[2],f=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],E=!(0,n.ut)(l),A=1e-6,b=1-A;i*=d;let S=0,y=0,M=0;const R=(0,n.tZ)(l)?e=>{S=a[e],y=a[e+1],M=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];S=h*t+f*r+_*i,y=m*t+v*r+x*i,M=p*t+g*r+T*i};if(1===o)if(E)for(let e=0;e<u;++e){R(3*s[e]);const t=S*S+y*y+M*M;if(t<b&&t>A){const e=1/Math.sqrt(t);c[i]=S*e,c[i+1]=y*e,c[i+2]=M*e}else c[i]=S,c[i+1]=y,c[i+2]=M;i+=d}else for(let e=0;e<u;++e)R(3*s[e]),c[i]=S,c[i+1]=y,c[i+2]=M,i+=d;else for(let e=0;e<u;++e){if(R(3*s[e]),E){const e=S*S+y*y+M*M;if(e<b&&e>A){const t=1/Math.sqrt(e);S*=t,y*=t,M*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=y,c[i+2]=M,i+=d}}(t,i,r,a);break}case Ae.r.NORMALCOMPRESSED:{(0,ge.vA)(2===t.size);const r=o.getField(e,m.mJ);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&ct(t,r,a);break}case Ae.r.UV0:{(0,ge.vA)(2===t.size);const r=o.getField(e,m.gH);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&ct(t,r,a);break}case Ae.r.COLOR:case Ae.r.SYMBOLCOLOR:{const r=o.getField(e,m.XP);(0,ge.vA)(!!r,`No buffer view for ${e}`),(0,ge.vA)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,i,o=1){const{data:a,indices:n}=e,s=r.typedBuffer,l=r.typedBufferStride,c=n.length;if(i*=l,t!==a.length||4!==t)if(1!==o)if(4!==t)for(let e=0;e<c;++e){const t=3*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}}else{s[i]=a[0],s[i+1]=a[1],s[i+2]=a[2],s[i+3]=a[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,n=e[i/=4];i+=t;const d=c*o;for(let r=1;r<d;++r)e[i]=n,i+=t}}(t,t.size,r,a);break}case Ae.r.COLORFEATUREATTRIBUTE:{const r=o.getField(e,m.Y$);(0,ge.vA)(!!r,`No buffer view for ${e}`),(0,ge.vA)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length,l=i[0];r*=n;for(let e=0;e<s;++e)a[r]=l,r+=n}(t,r,a);break}case Ae.r.TANGENT:{(0,ge.vA)(4===t.size);const r=o.getField(e,m.Eq);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void ut(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=l[0],m=l[1],p=l[2],f=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],E=!(0,n.ut)(l),A=1e-6,b=1-A;if(i*=d,1===o)for(let e=0;e<u;++e){const t=4*s[e],r=a[t],o=a[t+1],n=a[t+2],l=a[t+3];let u=h*r+f*o+_*n,S=m*r+v*o+x*n,y=p*r+g*o+T*n;if(E){const e=u*u+S*S+y*y;if(e<b&&e>A){const t=1/Math.sqrt(e);u*=t,S*=t,y*=t}}c[i]=u,c[i+1]=S,c[i+2]=y,c[i+3]=l,i+=d}else for(let e=0;e<u;++e){const t=4*s[e],r=a[t],n=a[t+1],l=a[t+2],u=a[t+3];let S=h*r+f*n+_*l,y=m*r+v*n+x*l,M=p*r+g*n+T*l;if(E){const e=S*S+y*y+M*M;if(e<b&&e>A){const t=1/Math.sqrt(e);S*=t,y*=t,M*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=y,c[i+2]=M,c[i+3]=u,i+=d}}(t,i,r,a);break}case Ae.r.PROFILERIGHT:case Ae.r.PROFILEUP:case Ae.r.PROFILEVERTEXANDNORMAL:case Ae.r.FEATUREVALUE:{(0,ge.vA)(4===t.size);const r=o.getField(e,m.Eq);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&ut(t,r,a)}}}class pt{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(Ae.r.POSITION).indices.length}write(e,t,r,i,o){!function(e,t,r,i,o,a){for(const n of t.fields.keys()){const t=e.attributes.get(n),s=t?.indices;if(t&&s)mt(n,t,r,i,o,a);else if(n===Ae.r.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(Ae.r.POSITION)?.indices;if(t){const r=t.length,i=o.getField(n,m.XP);ht(e.objectAndLayerIdColor,i,r,a)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var ft=r(19245),vt=r(91829),gt=r(53466),_t=r(72824),xt=r(35093),Tt=r(97220),Et=r(84867),At=r(39341),bt=r(34886);Z.MT.LESS,Z.MT.ALWAYS;const St={mask:255},yt={function:{func:Z.MT.ALWAYS,ref:B.dd.OutlineVisualElementMask,mask:B.dd.OutlineVisualElementMask},operation:{fail:Z.eA.KEEP,zFail:Z.eA.KEEP,zPass:Z.eA.ZERO}},Mt={function:{func:Z.MT.ALWAYS,ref:B.dd.OutlineVisualElementMask,mask:B.dd.OutlineVisualElementMask},operation:{fail:Z.eA.KEEP,zFail:Z.eA.KEEP,zPass:Z.eA.REPLACE}};Z.MT.EQUAL,B.dd.OutlineVisualElementMask,B.dd.OutlineVisualElementMask,Z.eA.KEEP,Z.eA.KEEP,Z.eA.KEEP,Z.MT.NOTEQUAL,B.dd.OutlineVisualElementMask,B.dd.OutlineVisualElementMask,Z.eA.KEEP,Z.eA.KEEP,Z.eA.KEEP;const Rt=[1,1,.5],wt=[0,.6,.2],Ct=[0,1,.2];var It=r(28491);class Ot extends _t.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,d.ci)(Rt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=B.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,d.fA)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Me.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,d.fA)(.2,.2,.2),this.diffuse=(0,d.fA)(.8,.8,.8),this.externalColor=(0,vt.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.vt)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=B.it.Less,this.textureAlphaMode=B.sf.Blend,this.textureAlphaCutoff=xt.H,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ie.m$.Occlude,this.isDecoration=!1}}_t.gy;class Nt extends Et.w{initializeConfiguration(e,t){t.spherical=e.viewingMode===be.RT.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?gt.q.Default:gt.q.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Nt.shader)}_initializeProgram(e,t){return new bt.B(e.rctx,t.get().build(this.configuration),At.D)}_makePipeline(e,t){const r=this.configuration,i=e===Oe.y.NONE,o=e===Oe.y.FrontFace;return(0,Ne.Ey)({blending:r.output!==ye.V.Color&&r.output!==ye.V.Alpha||!r.transparent?null:i?He:De(e),culling:Pt(r)?(0,Ne.Xt)(r.cullFace):null,depthTest:{func:Be(e,Ht(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Ne.kn:null,colorWrite:Ne.wE,stencilWrite:r.hasOccludees?St:null,stencilTest:r.hasOccludees?t?Mt:yt:null,polygonOffset:i||o?null:(a=r.enableOffset,a?Fe:null)});var a}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Ht(e){return e===B.it.Lequal?Z.MT.LEQUAL:Z.MT.LESS}function Pt(e){return e.cullFace!==B.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Nt.shader=new Tt.$(It.D,(()=>r.e(5141).then(r.bind(r,5141))));var Lt=r(90237),Dt=r(99769),Ft=r(82991),Bt=r(46263);class Gt extends Ft.nW{}(0,Lt._)([(0,Dt.W)({constValue:!0})],Gt.prototype,"hasSliceHighlight",void 0),(0,Lt._)([(0,Dt.W)({constValue:!1})],Gt.prototype,"hasSliceInVertexProgram",void 0),(0,Lt._)([(0,Dt.W)({constValue:Bt.c.Pass})],Gt.prototype,"pbrTextureBindType",void 0);class Ut extends Gt{constructor(){super(...arguments),this.output=ye.V.Color,this.alphaDiscardMode=B.sf.Opaque,this.doubleSidedMode=Re.W.None,this.pbrMode=we.A9.Disabled,this.cullFace=B.s2.None,this.transparencyPassType=Oe.y.NONE,this.normalType=Me.W.Attribute,this.textureCoordinateType=gt.q.None,this.customDepthTest=B.it.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,Lt._)([(0,Dt.W)({count:ye.V.COUNT})],Ut.prototype,"output",void 0),(0,Lt._)([(0,Dt.W)({count:B.sf.COUNT})],Ut.prototype,"alphaDiscardMode",void 0),(0,Lt._)([(0,Dt.W)({count:Re.W.COUNT})],Ut.prototype,"doubleSidedMode",void 0),(0,Lt._)([(0,Dt.W)({count:we.A9.COUNT})],Ut.prototype,"pbrMode",void 0),(0,Lt._)([(0,Dt.W)({count:B.s2.COUNT})],Ut.prototype,"cullFace",void 0),(0,Lt._)([(0,Dt.W)({count:Oe.y.COUNT})],Ut.prototype,"transparencyPassType",void 0),(0,Lt._)([(0,Dt.W)({count:Me.W.COUNT})],Ut.prototype,"normalType",void 0),(0,Lt._)([(0,Dt.W)({count:gt.q.COUNT})],Ut.prototype,"textureCoordinateType",void 0),(0,Lt._)([(0,Dt.W)({count:B.it.COUNT})],Ut.prototype,"customDepthTest",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"spherical",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasVertexColors",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasSymbolColors",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasVerticalOffset",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasSlicePlane",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasSliceHighlight",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasColorTexture",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasMetallicRoughnessTexture",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasEmissionTexture",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasOcclusionTexture",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasNormalTexture",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasScreenSizePerspective",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasVertexTangents",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasOccludees",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"multipassEnabled",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasModelTransformation",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"offsetBackfaces",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"vvSize",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"vvColor",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"receiveShadows",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"receiveAmbientOcclusion",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"textureAlphaPremultiplied",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"instanced",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"instancedColor",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"instancedDoublePrecision",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"writeDepth",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"transparent",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"enableOffset",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"cullAboveGround",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"snowCover",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasColorTextureTransform",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasEmissionTextureTransform",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasNormalTextureTransform",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasOcclusionTextureTransform",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Lt._)([(0,Dt.W)({constValue:!1})],Ut.prototype,"occlusionPass",void 0),(0,Lt._)([(0,Dt.W)({constValue:!0})],Ut.prototype,"hasVvInstancing",void 0),(0,Lt._)([(0,Dt.W)({constValue:!1})],Ut.prototype,"useCustomDTRExponentForWater",void 0),(0,Lt._)([(0,Dt.W)({constValue:!1})],Ut.prototype,"supportsTextureAtlas",void 0),(0,Lt._)([(0,Dt.W)({constValue:!0})],Ut.prototype,"useFillLights",void 0);var zt=r(57323);class Vt extends Nt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Me.W.Attribute,t.doubleSidedMode=Re.W.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,Vt.shader)}}Vt.shader=new Tt.$(zt.R,(()=>r.e(9933).then(r.bind(r,39933))));class Wt extends Ie.im{constructor(e){super(e,kt),this.supportsEdges=!0,this.produces=new Map([[et.N.OPAQUE_MATERIAL,e=>((0,ye.XY)(e)||(0,ye.PJ)(e))&&!this.parameters.transparent],[et.N.TRANSPARENT_MATERIAL,e=>((0,ye.XY)(e)||(0,ye.PJ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[et.N.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>((0,ye.XY)(e)||(0,ye.PJ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._configuration=new Ut,this._vertexBufferLayout=function(e){const t=(0,Se.BP)().vec3f(Ae.r.POSITION);return e.normalType===Me.W.Compressed?t.vec2i16(Ae.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(Ae.r.NORMAL),e.hasVertexTangents&&t.vec4f(Ae.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(Ae.r.UV0),e.hasVertexColors&&t.vec4u8(Ae.r.COLOR),e.hasSymbolColors&&t.vec4u8(Ae.r.SYMBOLCOLOR),(0,U.A)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(Ae.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==ye.V.Shadow&&e!==ye.V.ShadowExcludeHighlight&&e!==ye.V.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,a="replace"===e.colorMixMode,n=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?a||n:r?a?s:n:l?a||n:a?s:n}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?B.s2.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==ye.V.Color&&e!==ye.V.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Re.W.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Re.W.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Re.W.WindingOrder:Re.W.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=this.parameters.receiveAmbientOcclusion&&null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?we.A9.Schematic:we.A9.Normal:we.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,c.s)(Jt,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case be.RT.Global:a=(0,c.n)(Yt,Jt);break;case be.RT.Local:a=(0,c.c)(Yt,Xt)}let n=0;const s=(0,c.f)(Kt,Jt,e.eye),l=(0,c.l)(s),d=(0,c.h)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,c.k)(a,d)),n+=(0,ft.kE)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,c.h)(a,a,n),(0,c.t)(Zt,a,r.transform.inverseRotation),i=(0,c.f)(qt,i,Zt),o=(0,c.f)($t,o,Zt)}var n;Ue(e,r,i,o,null!=(n=r.verticalOffset)?(it.offset=n,it):null,a)}createGLMaterial(e){return new jt(e)}createBufferWriter(){return new pt(this._vertexBufferLayout)}}class jt extends Ce.m{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==ye.V.Color&&this._output!==ye.V.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,c.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?Vt:Nt,e)}}const kt=new class extends Ot{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},qt=(0,d.vt)(),$t=(0,d.vt)(),Xt=(0,d.fA)(0,0,1),Yt=(0,d.vt)(),Zt=(0,d.vt)(),Jt=(0,d.vt)(),Kt=(0,d.vt)(),Qt=()=>O.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function er(e){throw new I.A("",`Request for object resource failed: ${e}`)}function tr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Qt().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Qt().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Qt().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Qt().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Qt().warn("Indexed geometries must specify faces"),i=!1;break}default:Qt().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Qt().warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Qt().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function rr(e){const t=(0,u.Ie)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.iT)(t,r.bbMin),(0,u.iT)(t,r.bbMax))})),t}function ir(e){switch(e){case"mask":return B.sf.Mask;case"maskAndTransparency":return B.sf.MaskBlend;case"none":return B.sf.Opaque;default:return B.sf.Blend}}function or(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const ar=new P.R(1,2,"wosr");var nr=r(61765);async function sr(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.EM)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,w.Ke)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,H.QP)(i.error),er(i.error.details.url)}(e,r,t);const i=await(0,w.Ke)((0,R.A)(e,t));if(!0===i.ok)return i.value.data;(0,H.QP)(i.error),er(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],a=o.images[0].data;if(!a){Qt().warn("Externally referenced texture data is not yet supported");continue}const n=o.encoding+";base64,"+a,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:Z.pF.REPEAT,t:Z.pF.REPEAT},preMultiplyAlpha:ir(l)!==B.sf.Opaque},d=null!=t&&t.disableTextures?Promise.resolve(null):D(n,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,C.iL)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,a=new N,n=e.resource,s=P.R.parse(n.version||"1.0","wosr");ar.validate(s);const l=n.model.name,c=n.model.geometries,u=n.materialDefinitions??{},h=e.textures;let m=0;const p=new Map;for(let e=0;e<c.length;e++){const n=c[e];if(!tr(n))continue;const s=or(n),l=n.params.vertexAttributes,f=[],v=e=>{if("PerAttributeArray"===n.params.topology)return null;const t=n.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l[Ae.r.POSITION],_=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=v(e)??(0,L.tM)(_);f.push([e,new F.n(r,i,t.valuesPerElement,!0)])}const x=s.texture,T=h&&h[x];if(T&&!p.has(x)){const{image:e,parameters:t}=T,r=new xe(e,t);i.push(r),p.set(x,r)}const E=p.get(x),A=E?E.id:void 0,b=s.material;let S=a.get(b,x);if(null==S){const e=u[b.substring(b.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=T&&T.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=T?ir(T.alphaChannelUsage):void 0,n={ambient:(0,d.ci)(e.diffuse),diffuse:(0,d.ci)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:A,initTextureTransparent:!0,doubleSided:!0,cullFace:B.s2.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:T?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(n,t.materialParameters),S=new Wt(n),a.set(b,x,S)}o.push(S);const y=new G.V(S,f);m+=f.find((e=>e[0]===Ae.r.POSITION))?.[1]?.indices.length??0,r.push(y)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:n.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:rr(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const a=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,T.y)(new x.R(t.streamDataRequester),r.url,t,t.usePBR)),b=a.model.meta?.ESRI_proxyEllipsoid,y=a.meta.isEsriSymbolResource&&null!=b&&"EsriRealisticTreesStyle"===a.meta.ESRI_webstyle;y&&!a.customMeta.esriTreeRendering&&(a.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const a=o.attributes.position,l=a.count,u=(0,d.vt)(),h=(0,d.vt)(),p=(0,d.vt)(),f=new Uint8Array(4*l),v=new Float64Array(3*l),g=(0,n.B8)((0,s.vt)(),o.transform);let _=0,x=0;for(let n=0;n<l;n++){a.getVec(n,h),i.getVec(n,u),(0,c.e)(h,h,o.transform),(0,c.f)(p,h,t.center),(0,c.D)(p,p,t.radius);const s=p[2],l=(0,c.l)(p),d=Math.min(.45+.55*l*l,1);(0,c.D)(p,p,t.radius),null!==g&&(0,c.e)(p,p,g),(0,c.n)(p,p),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.m)(p,p,u,s>-1?.2:Math.min(-4*s-3.8,1)),v[_]=p[0],v[_+1]=p[1],v[_+2]=p[2],_+=3,f[x]=255*d,f[x+1]=255*d,f[x+2]=255*d,f[x+3]=255,x+=4}o.attributes.normal=new m.xs(v),o.attributes.color=new m.XP(f)}}}(a,b));const I=!!t.usePBR,O=a.meta.isEsriSymbolResource?{usePBR:I,isSchematic:!1,treeRendering:y,mrrFactors:[...Ct]}:{usePBR:I,isSchematic:!1,treeRendering:!1,mrrFactors:[...Rt]},U={...t.materialParameters,treeRendering:y},{engineResources:z,referenceBoundingBox:V}=function(e,t,r,i){const a=e.model,n=new Array,s=new Map,x=new Map,T=a.lods.length,b=(0,u.Ie)();return a.lods.forEach(((e,y)=>{const R=!0===i.skipHighLods&&(T>1&&0===y||T>3&&1===y)||!1===i.skipHighLods&&null!=i.singleLodIndex&&y!==i.singleLodIndex;if(R&&0!==y)return;const w=new M(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=R?new Wt({}):function(e,t,r,i,o,a,n){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),u=e.materials.get(t.material),h=null!=t.attributes.texCoord0,m=null!=t.attributes.normal;if(null==u)return null;const p=function(e){switch(e){case"BLEND":return B.sf.Blend;case"MASK":return B.sf.Mask;case"OPAQUE":case null:case void 0:return B.sf.Opaque}}(u.alphaMode);if(!a.has(s)){if(h){const t=(t,r=!1)=>{if(null!=t&&!n.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;n.set(t,new xe((0,A.x3)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,A.x3)(e)&&r,encoding:(0,A.x3)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(u.textureColor,p!==B.sf.Opaque),t(u.textureNormal),t(u.textureOcclusion),t(u.textureEmissive),t(u.textureMetallicRoughness)}const r=u.color[0]**(1/nr.T),f=u.color[1]**(1/nr.T),v=u.color[2]**(1/nr.T),g=u.emissiveFactor[0]**(1/nr.T),_=u.emissiveFactor[1]**(1/nr.T),x=u.emissiveFactor[2]**(1/nr.T),T=null!=u.textureColor&&h?n.get(u.textureColor):null,E=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:a,occlusionTexture:n}){return null==e&&null==t&&null==o&&(null==a||(0,c.j)(a,d.uY))&&null==n&&(null==i||1===i)&&(null==r||1===r)}({normalTexture:u.textureNormal,metallicRoughnessTexture:u.textureMetallicRoughness,metallicFactor:u.metallicFactor,roughnessFactor:u.roughnessFactor,emissiveTexture:u.textureEmissive,emissiveFactor:u.emissiveFactor,occlusionTexture:u.textureOcclusion}),b=null!=u.normalTextureTransform?.scale?u.normalTextureTransform?.scale:l.Un;a.set(s,new Wt({...i,transparent:p===B.sf.Blend,customDepthTest:B.it.Lequal,textureAlphaMode:p,textureAlphaCutoff:u.alphaCutoff,diffuse:[r,f,v],ambient:[r,f,v],opacity:u.opacity,doubleSided:u.doubleSided,doubleSidedType:"winding-order",cullFace:u.doubleSided?B.s2.None:B.s2.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:m?Me.W.Attribute:Me.W.ScreenDerivative,castShadows:!0,receiveShadows:u.receiveShadows,receiveAmbientOcclusion:u.receiveAmbientOcclustion,textureId:null!=T?T.id:void 0,colorMixMode:u.colorMixMode,normalTextureId:null!=u.textureNormal&&h?n.get(u.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=u.textureOcclusion&&h?n.get(u.textureOcclusion).id:void 0,emissiveTextureId:null!=u.textureEmissive&&h?n.get(u.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=u.textureMetallicRoughness&&h?n.get(u.textureMetallicRoughness).id:void 0,emissiveFactor:[g,_,x],mrrFactors:E?[...wt]:[u.metallicFactor,u.roughnessFactor,i.mrrFactors[2]],isSchematic:E,colorTextureTransformMatrix:S(u.colorTextureTransform),normalTextureTransformMatrix:S(u.normalTextureTransform),scale:[b[0],b[1]],occlusionTextureTransformMatrix:S(u.occlusionTextureTransform),emissiveTextureTransformMatrix:S(u.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:S(u.metallicRoughnessTextureTransform),...o}))}const f=a.get(s);if(r.stageResources.materials.push(f),h){const e=e=>{null!=e&&r.stageResources.textures.push(n.get(e))};e(u.textureColor),e(u.textureNormal),e(u.textureOcclusion),e(u.textureEmissive),e(u.textureMetallicRoughness)}return f}(a,e,w,t,r,s,x),{geometry:n,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,E.x)(e.indices||r,e.primitiveType),a=(0,h.oe)(3*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.position;(0,p.a)(a,n,e.transform,3,s);const l=[[Ae.r.POSITION,new F.n(a,i,3,!0)]];if(null!=e.attributes.normal){const t=(0,h.oe)(3*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.normal;(0,o.Ge)(lr,e.transform),(0,p.b)(t,a,lr,3,n),l.push([Ae.r.NORMAL,new F.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=(0,h.oe)(4*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.tangent;(0,o.Ge)(lr,e.transform),(0,f.t)(t,a,lr,4,n),l.push([Ae.r.TANGENT,new F.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,h.oe)(2*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.texCoord0;(0,v.n)(t,o,2,a),l.push([Ae.r.UV0,new F.n(t,i,2,!0)])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.Eq?(0,f.s)(t,e.attributes.color,255):e.attributes.color instanceof m.XP?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.Uz&&(0,f.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.xs?(0,p.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.eI?(0,g.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.nS&&(0,p.s)(t,e.attributes.color,1/256,4)),l.push([Ae.r.COLOR,new F.n(t,i,4,!0)])}return{geometry:new G.V(t,l),vertexCount:r}}(e,null!=i?i:new Wt({})),M=n.boundingInfo;null!=M&&0===y&&((0,u.iT)(b,M.bbMin),(0,u.iT)(b,M.bbMax)),null!=i&&(w.stageResources.geometries.push(n),w.numberOfVertices+=T)})),R||n.push(w)})),{engineResources:n,referenceBoundingBox:b}}(a,O,U,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:z,referenceBoundingBox:V,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1}}const lr=(0,a.vt)()},1843:(e,t,r)=>{r.d(t,{BP:()=>l,l5:()=>c});var i=r(13030),o=r(90239),a=r(620);class n{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new n(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const o=this.stride;if(o%4==0){const a=new Uint32Array(e.buffer,t*o,i*o/4);new Uint32Array(this.buffer,r*o,i*o/4).set(a)}else{const a=new Uint8Array(e.buffer,t*o,i*o);new Uint8Array(this.buffer,r*o,i*o).set(a)}return this}get usedMemory(){return this.byteLength}dispose(){}}class s{constructor(e=null){this._stride=0,this._lastAligned=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach((e=>this._fields.set(e[0],{...e[1],constructor:h(e[1].constructor)}))))}freeze(){return this}vec2f(e,t){return this._appendField(e,i.gH,t),this}vec2f64(e,t){return this._appendField(e,i.si,t),this}vec3f(e,t){return this._appendField(e,i.xs,t),this}vec3f64(e,t){return this._appendField(e,i.Xm,t),this}vec4f(e,t){return this._appendField(e,i.Eq,t),this}vec4f64(e,t){return this._appendField(e,i.Aj,t),this}mat3f(e,t){return this._appendField(e,i.jZ,t),this}mat3f64(e,t){return this._appendField(e,i.j0,t),this}mat4f(e,t){return this._appendField(e,i.Sx,t),this}mat4f64(e,t){return this._appendField(e,i.E$,t),this}vec4u8(e,t){return this._appendField(e,i.XP,t),this}f32(e,t){return this._appendField(e,i.Y$,t),this}f64(e,t){return this._appendField(e,i.qB,t),this}u8(e,t){return this._appendField(e,i.SL,t),this}u16(e,t){return this._appendField(e,i.h,t),this}i8(e,t){return this._appendField(e,i.bf,t),this}vec2i8(e,t){return this._appendField(e,i.D6,t),this}vec2i16(e,t){return this._appendField(e,i.mJ,t),this}vec2u8(e,t){return this._appendField(e,i.LC,t),this}vec4u16(e,t){return this._appendField(e,i.Uz,t),this}u32(e,t){return this._appendField(e,i.P,t),this}_appendField(e,t,r){if(this._fields.has(e))return void(0,a.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._stride+=i,this._fields.set(e,{size:i,constructor:t,offset:n,optional:r})}createBuffer(e){return new n(this,e)}createView(e){return new n(this,e)}clone(){const e=new s;return e._stride=this._stride,e._fields=new Map,this._fields.forEach(((t,r)=>e._fields.set(r,t))),e.BufferType=this.BufferType,e}get stride(){if(this._lastAligned!==this._fields.size){let e=1;this._fields.forEach((t=>e=Math.max(e,(0,o.GJ)(t.constructor.ElementType)))),this._stride=Math.floor((this._stride+e-1)/e)*e,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function l(){return new s}class c{constructor(e){this.fields=new Array,e.fields.forEach(((e,t)=>{const r={...e,constructor:u(e.constructor)};this.fields.push([t,r])})),this.stride=e.stride}}const d=[i.Y$,i.gH,i.xs,i.Eq,i.jZ,i.Sx,i.qB,i.si,i.Xm,i.Aj,i.j0,i.E$,i.SL,i.LC,i.eI,i.XP,i.h,i.Yi,i.nS,i.Uz,i.P,i.An,i.H$,i.ml,i.bf,i.D6,i.m8,i.TX,i.Qt,i.mJ,i.Vp,i.E7,i.My,i.UL,i.zD,i.Y4];function u(e){return`${e.ElementType}_${e.ElementCount}`}function h(e){return m.get(e)}const m=new Map;d.forEach((e=>m.set(u(e),e)))},46686:(e,t,r)=>{r.d(t,{i$:()=>c,oD:()=>d,xJ:()=>l});var i=r(49255),o=r(33752),a=r(47286),n=r(2597);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new a.G("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
282
|
+
`),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}))},46140:(e,t,r)=>{r.d(t,{R:()=>o});var i=r(49186);let o=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[o,a]=t.split("."),n=/^\s*\d+\s*$/;if(!o?.match||!n.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!a?.match||!n.test(a))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(o,10),l=parseInt(a,10);return new e(s,l,r)}}},61473:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(n)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{EM:()=>o,b5:()=>i});const a=/^devext.arcgis.com$/,n=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,a,n,/^jsapps.esri.com$/,s,l]},88340:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function a(){return i()}function n(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{Un:()=>d,fA:()=>o,uY:()=>c,vt:()=>i});const c=a(),d=n(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:u,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:n,unitX:s,unitY:l,zeros:a},Symbol.toStringTag,{value:"Module"}))},11868:(e,t,r)=>{r.d(t,{oe:()=>o});var i=r(34275);function o(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}},4832:(e,t,r)=>{r.d(t,{fetch:()=>cr});var i=r(61473),o=r(77690),a=r(29242),n=r(58083),s=r(9093),l=r(48163),c=r(38954),d=r(51850),u=r(70328),h=r(11868),m=r(13030),p=r(73354),f=r(50867),v=r(43609),g=r(51737),_=r(78358),x=r(21015),T=r(4399),E=r(84498),A=r(51530),b=r(88340);function S(e){if(null==e)return null;const t=null!=e.offset?e.offset:b.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:b.Un,n=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,a.vt)();return(0,o.lw)(c,s,l),(0,o.lw)(c,n,c),c}class R{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class y{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new R,this.numberOfVertices=0}}var M=r(78888),w=r(60999),C=r(86805),I=r(49186),O=r(53966);class N{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)))}}var H=r(74887),P=r(46140),L=r(97146);async function D(e,t){const{data:r}=await(0,M.A)(e,{responseType:"image",...t});return r}var F=r(46610),B=r(89192),G=r(38168),U=r(44208),z=r(65529),V=r(97768),W=r(34275),j=r(84952),k=r(56058),q=r(2741);let $;var X,Y;(Y=X||(X={}))[Y.ETC1_RGB=0]="ETC1_RGB",Y[Y.ETC2_RGBA=1]="ETC2_RGBA",Y[Y.BC1_RGB=2]="BC1_RGB",Y[Y.BC3_RGBA=3]="BC3_RGBA",Y[Y.BC4_R=4]="BC4_R",Y[Y.BC5_RG=5]="BC5_RG",Y[Y.BC7_M6_RGB=6]="BC7_M6_RGB",Y[Y.BC7_M5_RGBA=7]="BC7_M5_RGBA",Y[Y.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",Y[Y.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",Y[Y.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",Y[Y.ATC_RGB=11]="ATC_RGB",Y[Y.ATC_RGBA=12]="ATC_RGBA",Y[Y.FXT1_RGB=17]="FXT1_RGB",Y[Y.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",Y[Y.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",Y[Y.ETC2_EAC_R11=20]="ETC2_EAC_R11",Y[Y.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",Y[Y.RGBA32=13]="RGBA32",Y[Y.RGB565=14]="RGB565",Y[Y.BGR565=15]="BGR565",Y[Y.RGBA4444=16]="RGBA4444";var Z=r(63907),J=r(21231),K=r(42293);let Q=null,ee=null;async function te(){return null==ee&&(ee=function(){if(null==$){const e=e=>(0,q.s)(`esri/libs/basisu/${e}`);$=r.e(9321).then(r.bind(r,49321)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return $}(),Q=await ee),ee}function re(e,t,r,i,o){const a=(0,K.IB)(t?Z.CQ.COMPRESSED_RGBA8_ETC2_EAC:Z.CQ.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function ie(e){return e.getNumImages()>=1&&!e.isUASTC()}function oe(e){return e.getFaces()>=1&&e.isETC1S()}function ae(e,t,r,i,o,a,n,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[X.ETC2_RGBA,Z.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[X.ETC1_RGB,Z.CQ.COMPRESSED_RGB8_ETC2]:c?i?[X.BC3_RGBA,Z.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[X.BC1_RGB,Z.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[X.RGBA32,Z.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(n(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?Z.Cj.LINEAR_MIPMAP_LINEAR:Z.Cj.LINEAR,t.width=o,t.height=a,new J.g(e,t,{type:"compressed",levels:m})}var ne=r(69720),se=r(96672);const le=()=>O.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function ce(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const de=ce("DXT1"),ue=ce("DXT3"),he=ce("DXT5");function me(e,t,r){if(e instanceof ImageData)return me(pe(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 pe(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 fe,ve,ge=r(620),_e=r(67171);class xe extends ne.J{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=se.X.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new z.A,this._parameters={...Ee,...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,j.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,j.DB)(e.src)||(0,j.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new _e.R;return t.wrapMode=this._parameters.wrap??Z.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?Z.Cj.LINEAR_MIPMAP_LINEAR:Z.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,W.mw)(e)||(0,W.mg)(e))return t.encoding===B.JS.KTX2_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.KTX2File(new Uint8Array(e)),i=oe(r)?re(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===B.JS.BASIS_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.BasisFile(new Uint8Array(e)),i=ie(r)?re(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?Te(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 J.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,W.mw)(t)||(0,W.mg)(t))&&this._parameters.encoding===B.JS.DDS_ENCODING?this._loadFromDDSData(e,t):((0,W.mw)(t)||(0,W.mg)(t))&&this._parameters.encoding===B.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,W.mw)(t)||(0,W.mg)(t))&&this._parameters.encoding===B.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,W.mg)(t)?this._loadFromPixelData(e,t):(0,W.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<fe.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return le().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return le().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,a;switch(i){case de:o=8,a=Z.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ue:o=16,a=Z.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case he:o=16,a=Z.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return le().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let n=1,s=r[4],l=r[3];(3&s||3&l)&&(le().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(n=Math.max(1,r[7]));let m=r[1]+4;const p=[];for(let t=0;t<n;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:a,width:c,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:a,width:n,height:s}=i;return t.samplingMode=o.levels.length>1?Z.Cj.LINEAR_MIPMAP_LINEAR:Z.Cj.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=a,t.width=n,t.height=s,new J.g(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.KTX2File(new Uint8Array(r));if(!oe(i))return null;i.startTranscoding();const o=ae(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.BasisFile(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=ae(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,ge.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?Z.Ab.LUMINANCE:3===this._parameters.components?Z.Ab.RGB:Z.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new J.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await D(t,{signal:r});return(0,H.Te)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,k.Sx)(t,t.src,!1,r);return(0,H.Te)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=fe.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",s),(0,V.xt)(l)},n=()=>{t.readyState>=fe.HAVE_CURRENT_DATA&&(a(),i(this._loadFromImage(e,t)))},s=e=>{a(),o(e||new I.A("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",s);const l=(0,H.u7)(r,(()=>s((0,H.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?pe(e):e;let i=e.width,o=e.height;do{i=Math.ceil(i/2),o=Math.ceil(o/2),r=i*o}while(r>1048576||null!=t&&(i>t||o>t));return me(e,i,o)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return me(e,Math.round(e.width*i),Math.round(e.height*i))}(r,t)}const i=Te(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this._parameters.components?Z.Ab.RGB:Z.Ab.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new J.g(e,o,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,V.WD)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function Te(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(ve=fe||(fe={}))[ve.HAVE_NOTHING=0]="HAVE_NOTHING",ve[ve.HAVE_METADATA=1]="HAVE_METADATA",ve[ve.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",ve[ve.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",ve[ve.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const Ee={wrap:{s:Z.pF.REPEAT,t:Z.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Ae=r(46540),be=r(24151),Se=r(1843),Re=r(49255),ye=r(96336),Me=r(62602),we=r(59469),Ce=r(25634),Ie=r(14903),Oe=r(14327),Ne=r(90644);const He=(0,Ne.p3)(Z.dn.SRC_ALPHA,Z.dn.ONE,Z.dn.ONE_MINUS_SRC_ALPHA,Z.dn.ONE_MINUS_SRC_ALPHA),Pe=(0,Ne.ox)(Z.dn.ONE,Z.dn.ONE),Le=(0,Ne.ox)(Z.dn.ZERO,Z.dn.ONE_MINUS_SRC_ALPHA);function De(e){return e===Oe.y.FrontFace?null:e===Oe.y.Alpha?Le:Pe}const Fe={factor:-1,units:-2};function Be(e,t=Z.MT.LESS){return e===Oe.y.NONE||e===Oe.y.FrontFace?t:Z.MT.LEQUAL}class Ge{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const Ue=(0,u.vt)();function ze(e,t,r,i,o,a){if(!e.visible)return;const n=(0,c.z)(et,i,r),s=(e,t,r)=>{a(e,r,t,!1)},l=new Ge(!1,t.options.normalRequired);if(e.boundingInfo){(0,ge.vA)(e.type===se.X.Mesh);const i=t.tolerance;We(e.boundingInfo,r,n,i,o,l,s)}else{const t=e.attributes.get(Ae.r.POSITION),i=t.indices;!function(e,t,r,i,o,a,n,s,l,d){const u=t,h=tt,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),v=m>=p?m>=f?0:2:p>=f?1:2,g=v,_=u[g]<0?2:1,x=(v+_)%3,T=(v+(3-_))%3,E=u[x]/u[g],A=u[T]/u[g],b=1/u[g],S=ke,R=qe,y=$e,{normalRequired:M}=l;for(let t=r;t<i;++t){const r=3*t,i=n*o[r];(0,c.s)(h[0],a[i+0],a[i+1],a[i+2]);const l=n*o[r+1];(0,c.s)(h[1],a[l+0],a[l+1],a[l+2]);const u=n*o[r+2];(0,c.s)(h[2],a[u+0],a[u+1],a[u+2]),s&&((0,c.c)(h[0],s.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,c.c)(h[1],s.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,c.c)(h[2],s.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,c.z)(S,h[0],e),(0,c.z)(R,h[1],e),(0,c.z)(y,h[2],e);const m=S[x]-E*S[g],p=S[T]-A*S[g],f=R[x]-E*R[g],v=R[T]-A*R[g],_=y[x]-E*y[g],w=y[T]-A*y[g],C=_*v-w*f,I=m*w-p*_,O=f*p-v*m;if((C<0||I<0||O<0)&&(C>0||I>0||O>0))continue;const N=C+I+O;if(0===N)continue;const H=C*(b*S[g])+I*(b*R[g])+O*(b*y[g]);if(H*Math.sign(N)<0)continue;const P=H/N;P>=0&&d(P,t,M?Ye(h):null)}}(r,n,0,i.length/3,i,t.data,t.stride,o,l,s)}}const Ve=(0,d.vt)();function We(e,t,r,i,o,a,n){if(null==e)return;const s=function(e,t){return(0,c.s)(t,1/e[0],1/e[1],1/e[2])}(r,Ve);if((0,u.Ne)(Ue,e.bbMin),(0,u.vI)(Ue,e.bbMax),null!=o&&o.applyToAabb(Ue),function(e,t,r,i){return function(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let s=Math.min(a,n),l=Math.max(a,n);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(Ue,t,s,i)){const{primitiveIndices:s,position:l}=e,c=s?s.length:l.indices.length/3;if(c>Ke){const s=e.getChildren();if(void 0!==s){for(const e of s)We(e,t,r,i,o,a,n);return}}!function(e,t,r,i,o,a,n,s,l,c,d){const u=e[0],h=e[1],m=e[2],p=t[0],f=t[1],v=t[2],{normalRequired:g}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=n*o[r];let c=a[i],_=a[i+1],x=a[i+2];const T=n*o[r+1];let E=a[T],A=a[T+1],b=a[T+2];const S=n*o[r+2];let R=a[S],y=a[S+1],M=a[S+2];null!=l&&([c,_,x]=l.applyToVertex(c,_,x,e),[E,A,b]=l.applyToVertex(E,A,b,e),[R,y,M]=l.applyToVertex(R,y,M,e));const w=E-c,C=A-_,I=b-x,O=R-c,N=y-_,H=M-x,P=f*H-N*v,L=v*O-H*p,D=p*N-O*f,F=w*P+C*L+I*D;if(Math.abs(F)<=Qe)continue;const B=u-c,G=h-_,U=m-x,z=B*P+G*L+U*D;if(F>0){if(z<0||z>F)continue}else if(z>0||z<F)continue;const V=G*I-C*U,W=U*w-I*B,j=B*C-w*G,k=p*V+f*W+v*j;if(F>0){if(k<0||z+k>F)continue}else if(k>0||z+k<F)continue;const q=(O*V+N*W+H*j)/F;q>=0&&d(q,t,g?Xe(w,C,I,O,N,H,je):null)}}(t,r,0,c,l.indices,l.data,l.stride,s,o,a,n)}}const je=(0,d.vt)();const ke=(0,d.vt)(),qe=(0,d.vt)(),$e=(0,d.vt)();function Xe(e,t,r,i,o,a,n){return(0,c.s)(Ze,e,t,r),(0,c.s)(Je,i,o,a),(0,c.b)(n,Ze,Je),(0,c.n)(n,n),n}function Ye(e){return(0,c.z)(Ze,e[1],e[0]),(0,c.z)(Je,e[2],e[0]),(0,c.b)(je,Ze,Je),(0,c.n)(je,je),je}const Ze=(0,d.vt)(),Je=(0,d.vt)(),Ke=1e3,Qe=1e-7,et=(0,d.vt)(),tt=[(0,d.vt)(),(0,d.vt)(),(0,d.vt)()];var rt=r(13464),it=r(76412),ot=r(57005);const at=new class{constructor(e=0){this.offset=e,this.sphere=(0,it.c)(),this.tmpVertex=(0,d.vt)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,o=(0,c.s)(nt,e,t,r),a=(0,c.e)(o,o,i),n=this.offset/(0,c.l)(a);(0,c.r)(a,a,a,n);const s=this.objectTransform.inverse;return(0,c.e)(this.tmpVertex,a,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,c.l)(e);(0,c.r)(e,e,e,r);const i=this.offset/(0,c.l)(t);(0,c.r)(t,t,t,i)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,c.l)((0,it.g)(e)),r=this.offset/t;return(0,c.r)((0,it.g)(this.sphere),(0,it.g)(e),(0,it.g)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,d.vt)(),this._tmpMbs=(0,it.c)(),this._tmpObb=new ot.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,c.l)(e)}applyToVertex(e,t,r){const i=(0,c.s)(nt,e,t,r),o=(0,c.s)(st,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,c.l)(o);return(0,c.r)(this._tmpVertex,i,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,a=e[3],n=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),d=Math.abs(o),u=Math.abs(a),h=Math.abs(n),m=Math.abs(s),p=.5*(1+Math.sign(r*a))*Math.min(l,u),f=.5*(1+Math.sign(i*n))*Math.min(c,h),v=.5*(1+Math.sign(o*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,m),T=Math.sqrt(p*p+f*f+v*v),E=Math.sign(l+r),A=Math.sign(c+i),b=Math.sign(d+o),S=Math.sign(u+a),R=Math.sign(h+n),y=Math.sign(m+s),M=this._totalOffset;if(T<M)return e[0]-=(1-E)*M,e[1]-=(1-A)*M,e[2]-=(1-b)*M,e[3]+=S*M,e[4]+=R*M,e[5]+=y*M,e;const w=M/Math.sqrt(g*g+_*_+x*x),C=M/T,I=C-w,O=-I;return e[0]+=r*(E*O+C),e[1]+=i*(A*O+C),e[2]+=o*(b*O+C),e[3]+=a*(S*I+w),e[4]+=n*(R*I+w),e[5]+=s*(y*I+w),e}applyToMbs(e){const t=(0,c.l)((0,it.g)(e)),r=this._totalOffset/t;return(0,c.r)((0,it.g)(this._tmpMbs),(0,it.g)(e),(0,it.g)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,ot.gm)(e,this._totalOffset,this._totalOffset,be.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,d.vt)()}applyToVertex(e,t,r){const i=(0,c.s)(nt,e,t,r),o=(0,c.g)(st,i,this.localOrigin),a=this.offset/(0,c.l)(o);return(0,c.r)(this.tmpVertex,i,o,a),this.tmpVertex}applyToAabb(e){const t=lt,r=ct,i=dt;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const a=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let o=0;o<3;++o)i[o]=e&1<<o?r[o]:t[o];a(i)}let n=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(n|=1<<e);if(0!==n&&7!==n)for(let e=0;e<8;++e)if(!(n&e)){for(let o=0;o<3;++o)i[o]=n&1<<o?0:e&1<<o?t[o]:r[o];a(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const nt=(0,d.vt)(),st=(0,d.vt)(),lt=(0,d.vt)(),ct=(0,d.vt)(),dt=(0,d.vt)();function ut(e,t,r){const{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length;r*=n;for(let e=0;e<s;++e){const t=2*o[e];a[r]=i[t],a[r+1]=i[t+1],r+=n}}function ht(e,t,r,i){const{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,null==i||1===i)for(let e=0;e<l;++e){const t=3*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}}function mt(e,t,r,i=1){const{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}}function pt(e,t,r,i,o=1){const a=t.typedBuffer,n=t.typedBufferStride;if(i*=n,1===o)for(let t=0;t<r;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n}function ft(e,t,r,i,o,a){switch(e){case Ae.r.POSITION:{(0,ge.vA)(3===t.size);const i=o.getField(e,m.xs);(0,ge.vA)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o=1){if(!t)return void ht(e,r,i,o);const{data:a,indices:s}=e,l=r.typedBuffer,c=r.typedBufferStride,d=s.length,u=t[0],h=t[1],m=t[2],p=t[4],f=t[5],v=t[6],g=t[8],_=t[9],x=t[10],T=t[12],E=t[13],A=t[14];i*=c;let b=0,S=0,R=0;const y=(0,n.tZ)(t)?e=>{b=a[e]+T,S=a[e+1]+E,R=a[e+2]+A}:e=>{const t=a[e],r=a[e+1],i=a[e+2];b=u*t+p*r+g*i+T,S=h*t+f*r+_*i+E,R=m*t+v*r+x*i+A};if(1===o)for(let e=0;e<d;++e)y(3*s[e]),l[i]=b,l[i+1]=S,l[i+2]=R,i+=c;else for(let e=0;e<d;++e){y(3*s[e]);for(let e=0;e<o;++e)l[i]=b,l[i+1]=S,l[i+2]=R,i+=c}}(t,r,i,a);break}case Ae.r.NORMAL:{(0,ge.vA)(3===t.size);const r=o.getField(e,m.xs);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void ht(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=l[0],m=l[1],p=l[2],f=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],E=!(0,n.ut)(l),A=1e-6,b=1-A;i*=d;let S=0,R=0,y=0;const M=(0,n.tZ)(l)?e=>{S=a[e],R=a[e+1],y=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];S=h*t+f*r+_*i,R=m*t+v*r+x*i,y=p*t+g*r+T*i};if(1===o)if(E)for(let e=0;e<u;++e){M(3*s[e]);const t=S*S+R*R+y*y;if(t<b&&t>A){const e=1/Math.sqrt(t);c[i]=S*e,c[i+1]=R*e,c[i+2]=y*e}else c[i]=S,c[i+1]=R,c[i+2]=y;i+=d}else for(let e=0;e<u;++e)M(3*s[e]),c[i]=S,c[i+1]=R,c[i+2]=y,i+=d;else for(let e=0;e<u;++e){if(M(3*s[e]),E){const e=S*S+R*R+y*y;if(e<b&&e>A){const t=1/Math.sqrt(e);S*=t,R*=t,y*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=R,c[i+2]=y,i+=d}}(t,i,r,a);break}case Ae.r.NORMALCOMPRESSED:{(0,ge.vA)(2===t.size);const r=o.getField(e,m.mJ);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&ut(t,r,a);break}case Ae.r.UV0:{(0,ge.vA)(2===t.size);const r=o.getField(e,m.gH);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&ut(t,r,a);break}case Ae.r.COLOR:case Ae.r.SYMBOLCOLOR:{const r=o.getField(e,m.XP);(0,ge.vA)(!!r,`No buffer view for ${e}`),(0,ge.vA)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,i,o=1){const{data:a,indices:n}=e,s=r.typedBuffer,l=r.typedBufferStride,c=n.length;if(i*=l,t!==a.length||4!==t)if(1!==o)if(4!==t)for(let e=0;e<c;++e){const t=3*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}}else{s[i]=a[0],s[i+1]=a[1],s[i+2]=a[2],s[i+3]=a[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,n=e[i/=4];i+=t;const d=c*o;for(let r=1;r<d;++r)e[i]=n,i+=t}}(t,t.size,r,a);break}case Ae.r.COLORFEATUREATTRIBUTE:{const r=o.getField(e,m.Y$);(0,ge.vA)(!!r,`No buffer view for ${e}`),(0,ge.vA)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length,l=i[0];r*=n;for(let e=0;e<s;++e)a[r]=l,r+=n}(t,r,a);break}case Ae.r.TANGENT:{(0,ge.vA)(4===t.size);const r=o.getField(e,m.Eq);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void mt(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=l[0],m=l[1],p=l[2],f=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],E=!(0,n.ut)(l),A=1e-6,b=1-A;if(i*=d,1===o)for(let e=0;e<u;++e){const t=4*s[e],r=a[t],o=a[t+1],n=a[t+2],l=a[t+3];let u=h*r+f*o+_*n,S=m*r+v*o+x*n,R=p*r+g*o+T*n;if(E){const e=u*u+S*S+R*R;if(e<b&&e>A){const t=1/Math.sqrt(e);u*=t,S*=t,R*=t}}c[i]=u,c[i+1]=S,c[i+2]=R,c[i+3]=l,i+=d}else for(let e=0;e<u;++e){const t=4*s[e],r=a[t],n=a[t+1],l=a[t+2],u=a[t+3];let S=h*r+f*n+_*l,R=m*r+v*n+x*l,y=p*r+g*n+T*l;if(E){const e=S*S+R*R+y*y;if(e<b&&e>A){const t=1/Math.sqrt(e);S*=t,R*=t,y*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=R,c[i+2]=y,c[i+3]=u,i+=d}}(t,i,r,a);break}case Ae.r.PROFILERIGHT:case Ae.r.PROFILEUP:case Ae.r.PROFILEVERTEXANDNORMAL:case Ae.r.FEATUREVALUE:{(0,ge.vA)(4===t.size);const r=o.getField(e,m.Eq);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&mt(t,r,a)}}}class vt{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(Ae.r.POSITION).indices.length}write(e,t,r,i,o){!function(e,t,r,i,o,a){for(const n of t.fields.keys()){const t=e.attributes.get(n),s=t?.indices;if(t&&s)ft(n,t,r,i,o,a);else if(n===Ae.r.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(Ae.r.POSITION)?.indices;if(t){const r=t.length,i=o.getField(n,m.XP);pt(e.objectAndLayerIdColor,i,r,a)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var gt=r(19245),_t=r(91829),xt=r(53466),Tt=r(72824),Et=r(35093),At=r(97220),bt=r(84867),St=r(39341),Rt=r(34886);Z.MT.LESS,Z.MT.ALWAYS;const yt={mask:255},Mt={function:{func:Z.MT.ALWAYS,ref:B.dd.OutlineVisualElementMask,mask:B.dd.OutlineVisualElementMask},operation:{fail:Z.eA.KEEP,zFail:Z.eA.KEEP,zPass:Z.eA.ZERO}},wt={function:{func:Z.MT.ALWAYS,ref:B.dd.OutlineVisualElementMask,mask:B.dd.OutlineVisualElementMask},operation:{fail:Z.eA.KEEP,zFail:Z.eA.KEEP,zPass:Z.eA.REPLACE}};Z.MT.EQUAL,B.dd.OutlineVisualElementMask,B.dd.OutlineVisualElementMask,Z.eA.KEEP,Z.eA.KEEP,Z.eA.KEEP,Z.MT.NOTEQUAL,B.dd.OutlineVisualElementMask,B.dd.OutlineVisualElementMask,Z.eA.KEEP,Z.eA.KEEP,Z.eA.KEEP;const Ct=[1,1,.5],It=[0,.6,.2],Ot=[0,1,.2];var Nt=r(28491);class Ht extends Tt.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,d.ci)(Ct),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=B.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,d.fA)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=ye.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,d.fA)(.2,.2,.2),this.diffuse=(0,d.fA)(.8,.8,.8),this.externalColor=(0,_t.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.vt)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=B.it.Less,this.textureAlphaMode=B.sf.Blend,this.textureAlphaCutoff=Et.H,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ie.m$.Occlude,this.isDecoration=!1}}Tt.gy;class Pt extends bt.w{initializeConfiguration(e,t){t.spherical=e.viewingMode===be.RT.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?xt.q.Default:xt.q.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Pt.shader)}_initializeProgram(e,t){return new Rt.B(e.rctx,t.get().build(this.configuration),St.D)}_makePipeline(e,t){const r=this.configuration,i=e===Oe.y.NONE,o=e===Oe.y.FrontFace;return(0,Ne.Ey)({blending:r.output!==Re.V.Color&&r.output!==Re.V.Alpha||!r.transparent?null:i?He:De(e),culling:Dt(r)?(0,Ne.Xt)(r.cullFace):null,depthTest:{func:Be(e,Lt(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Ne.kn:null,colorWrite:Ne.wE,stencilWrite:r.hasOccludees?yt:null,stencilTest:r.hasOccludees?t?wt:Mt:null,polygonOffset:i||o?null:(a=r.enableOffset,a?Fe:null)});var a}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Lt(e){return e===B.it.Lequal?Z.MT.LEQUAL:Z.MT.LESS}function Dt(e){return e.cullFace!==B.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Pt.shader=new At.$(Nt.D,(()=>r.e(5141).then(r.bind(r,5141))));var Ft=r(90237),Bt=r(99769),Gt=r(82991),Ut=r(46263);class zt extends Gt.nW{}(0,Ft._)([(0,Bt.W)({constValue:!0})],zt.prototype,"hasSliceHighlight",void 0),(0,Ft._)([(0,Bt.W)({constValue:!1})],zt.prototype,"hasSliceInVertexProgram",void 0),(0,Ft._)([(0,Bt.W)({constValue:Ut.c.Pass})],zt.prototype,"pbrTextureBindType",void 0);class Vt extends zt{constructor(){super(...arguments),this.output=Re.V.Color,this.alphaDiscardMode=B.sf.Opaque,this.doubleSidedMode=Me.W.None,this.pbrMode=we.A9.Disabled,this.cullFace=B.s2.None,this.transparencyPassType=Oe.y.NONE,this.normalType=ye.W.Attribute,this.textureCoordinateType=xt.q.None,this.customDepthTest=B.it.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,Ft._)([(0,Bt.W)({count:Re.V.COUNT})],Vt.prototype,"output",void 0),(0,Ft._)([(0,Bt.W)({count:B.sf.COUNT})],Vt.prototype,"alphaDiscardMode",void 0),(0,Ft._)([(0,Bt.W)({count:Me.W.COUNT})],Vt.prototype,"doubleSidedMode",void 0),(0,Ft._)([(0,Bt.W)({count:we.A9.COUNT})],Vt.prototype,"pbrMode",void 0),(0,Ft._)([(0,Bt.W)({count:B.s2.COUNT})],Vt.prototype,"cullFace",void 0),(0,Ft._)([(0,Bt.W)({count:Oe.y.COUNT})],Vt.prototype,"transparencyPassType",void 0),(0,Ft._)([(0,Bt.W)({count:ye.W.COUNT})],Vt.prototype,"normalType",void 0),(0,Ft._)([(0,Bt.W)({count:xt.q.COUNT})],Vt.prototype,"textureCoordinateType",void 0),(0,Ft._)([(0,Bt.W)({count:B.it.COUNT})],Vt.prototype,"customDepthTest",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"spherical",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasVertexColors",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasSymbolColors",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasVerticalOffset",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasSlicePlane",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasSliceHighlight",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasColorTexture",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasMetallicRoughnessTexture",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasEmissionTexture",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasOcclusionTexture",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasNormalTexture",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasScreenSizePerspective",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasVertexTangents",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasOccludees",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"multipassEnabled",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasModelTransformation",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"offsetBackfaces",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"vvSize",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"vvColor",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"receiveShadows",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"receiveAmbientOcclusion",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"textureAlphaPremultiplied",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"instanced",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"instancedColor",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"instancedDoublePrecision",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"writeDepth",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"transparent",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"enableOffset",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"cullAboveGround",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"snowCover",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasColorTextureTransform",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasEmissionTextureTransform",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasNormalTextureTransform",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasOcclusionTextureTransform",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Ft._)([(0,Bt.W)({constValue:!1})],Vt.prototype,"occlusionPass",void 0),(0,Ft._)([(0,Bt.W)({constValue:!0})],Vt.prototype,"hasVvInstancing",void 0),(0,Ft._)([(0,Bt.W)({constValue:!1})],Vt.prototype,"useCustomDTRExponentForWater",void 0),(0,Ft._)([(0,Bt.W)({constValue:!1})],Vt.prototype,"supportsTextureAtlas",void 0),(0,Ft._)([(0,Bt.W)({constValue:!0})],Vt.prototype,"useFillLights",void 0);var Wt=r(57323);class jt extends Pt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=ye.W.Attribute,t.doubleSidedMode=Me.W.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,jt.shader)}}jt.shader=new At.$(Wt.R,(()=>r.e(9933).then(r.bind(r,39933))));class kt extends Ie.im{constructor(e){super(e,$t),this.supportsEdges=!0,this.produces=new Map([[rt.N.OPAQUE_MATERIAL,e=>((0,Re.XY)(e)||(0,Re.PJ)(e))&&!this.parameters.transparent],[rt.N.TRANSPARENT_MATERIAL,e=>((0,Re.XY)(e)||(0,Re.PJ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[rt.N.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>((0,Re.XY)(e)||(0,Re.PJ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._configuration=new Vt,this._vertexBufferLayout=function(e){const t=(0,Se.BP)().vec3f(Ae.r.POSITION);return e.normalType===ye.W.Compressed?t.vec2i16(Ae.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(Ae.r.NORMAL),e.hasVertexTangents&&t.vec4f(Ae.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(Ae.r.UV0),e.hasVertexColors&&t.vec4u8(Ae.r.COLOR),e.hasSymbolColors&&t.vec4u8(Ae.r.SYMBOLCOLOR),(0,U.A)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(Ae.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Re.V.Shadow&&e!==Re.V.ShadowExcludeHighlight&&e!==Re.V.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,a="replace"===e.colorMixMode,n=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?a||n:r?a?s:n:l?a||n:a?s:n}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?B.s2.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==Re.V.Color&&e!==Re.V.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Me.W.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Me.W.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Me.W.WindingOrder:Me.W.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=this.parameters.receiveAmbientOcclusion&&null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?we.A9.Schematic:we.A9.Normal:we.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,c.s)(Qt,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case be.RT.Global:a=(0,c.n)(Jt,Qt);break;case be.RT.Local:a=(0,c.c)(Jt,Zt)}let n=0;const s=(0,c.f)(er,Qt,e.eye),l=(0,c.l)(s),d=(0,c.h)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,c.k)(a,d)),n+=(0,gt.kE)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,c.h)(a,a,n),(0,c.t)(Kt,a,r.transform.inverseRotation),i=(0,c.f)(Xt,i,Kt),o=(0,c.f)(Yt,o,Kt)}var n;ze(e,r,i,o,null!=(n=r.verticalOffset)?(at.offset=n,at):null,a)}createGLMaterial(e){return new qt(e)}createBufferWriter(){return new vt(this._vertexBufferLayout)}}class qt extends Ce.m{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==Re.V.Color&&this._output!==Re.V.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,c.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?jt:Pt,e)}}const $t=new class extends Ht{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},Xt=(0,d.vt)(),Yt=(0,d.vt)(),Zt=(0,d.fA)(0,0,1),Jt=(0,d.vt)(),Kt=(0,d.vt)(),Qt=(0,d.vt)(),er=(0,d.vt)(),tr=()=>O.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function rr(e){throw new I.A("",`Request for object resource failed: ${e}`)}function ir(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(tr().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(tr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(tr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(tr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else tr().warn("Indexed geometries must specify faces"),i=!1;break}default:tr().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(tr().warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(tr().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function or(e){const t=(0,u.Ie)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.iT)(t,r.bbMin),(0,u.iT)(t,r.bbMax))})),t}function ar(e){switch(e){case"mask":return B.sf.Mask;case"maskAndTransparency":return B.sf.MaskBlend;case"none":return B.sf.Opaque;default:return B.sf.Blend}}function nr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const sr=new P.R(1,2,"wosr");var lr=r(61765);async function cr(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.EM)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,w.Ke)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,H.QP)(i.error),rr(i.error.details.url)}(e,r,t);const i=await(0,w.Ke)((0,M.A)(e,t));if(!0===i.ok)return i.value.data;(0,H.QP)(i.error),rr(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],a=o.images[0].data;if(!a){tr().warn("Externally referenced texture data is not yet supported");continue}const n=o.encoding+";base64,"+a,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:Z.pF.REPEAT,t:Z.pF.REPEAT},preMultiplyAlpha:ar(l)!==B.sf.Opaque},d=null!=t&&t.disableTextures?Promise.resolve(null):D(n,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,C.iL)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,a=new N,n=e.resource,s=P.R.parse(n.version||"1.0","wosr");sr.validate(s);const l=n.model.name,c=n.model.geometries,u=n.materialDefinitions??{},h=e.textures;let m=0;const p=new Map;for(let e=0;e<c.length;e++){const n=c[e];if(!ir(n))continue;const s=nr(n),l=n.params.vertexAttributes,f=[],v=e=>{if("PerAttributeArray"===n.params.topology)return null;const t=n.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l[Ae.r.POSITION],_=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=v(e)??(0,L.tM)(_);f.push([e,new F.n(r,i,t.valuesPerElement,!0)])}const x=s.texture,T=h&&h[x];if(T&&!p.has(x)){const{image:e,parameters:t}=T,r=new xe(e,t);i.push(r),p.set(x,r)}const E=p.get(x),A=E?E.id:void 0,b=s.material;let S=a.get(b,x);if(null==S){const e=u[b.substring(b.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=T&&T.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=T?ar(T.alphaChannelUsage):void 0,n={ambient:(0,d.ci)(e.diffuse),diffuse:(0,d.ci)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:A,initTextureTransparent:!0,doubleSided:!0,cullFace:B.s2.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:T?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(n,t.materialParameters),S=new kt(n),a.set(b,x,S)}o.push(S);const R=new G.V(S,f);m+=f.find((e=>e[0]===Ae.r.POSITION))?.[1]?.indices.length??0,r.push(R)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:n.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:or(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const a=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,T.y)(new x.R(t.streamDataRequester),r.url,t,t.usePBR)),b=a.model.meta?.ESRI_proxyEllipsoid,R=a.meta.isEsriSymbolResource&&null!=b&&"EsriRealisticTreesStyle"===a.meta.ESRI_webstyle;R&&!a.customMeta.esriTreeRendering&&(a.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const a=o.attributes.position,l=a.count,u=(0,d.vt)(),h=(0,d.vt)(),p=(0,d.vt)(),f=new Uint8Array(4*l),v=new Float64Array(3*l),g=(0,n.B8)((0,s.vt)(),o.transform);let _=0,x=0;for(let n=0;n<l;n++){a.getVec(n,h),i.getVec(n,u),(0,c.e)(h,h,o.transform),(0,c.f)(p,h,t.center),(0,c.D)(p,p,t.radius);const s=p[2],l=(0,c.l)(p),d=Math.min(.45+.55*l*l,1);(0,c.D)(p,p,t.radius),null!==g&&(0,c.e)(p,p,g),(0,c.n)(p,p),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.m)(p,p,u,s>-1?.2:Math.min(-4*s-3.8,1)),v[_]=p[0],v[_+1]=p[1],v[_+2]=p[2],_+=3,f[x]=255*d,f[x+1]=255*d,f[x+2]=255*d,f[x+3]=255,x+=4}o.attributes.normal=new m.xs(v),o.attributes.color=new m.XP(f)}}}(a,b));const I=!!t.usePBR,O=a.meta.isEsriSymbolResource?{usePBR:I,isSchematic:!1,treeRendering:R,mrrFactors:[...Ot]}:{usePBR:I,isSchematic:!1,treeRendering:!1,mrrFactors:[...Ct]},U={...t.materialParameters,treeRendering:R},{engineResources:z,referenceBoundingBox:V}=function(e,t,r,i){const a=e.model,n=new Array,s=new Map,x=new Map,T=a.lods.length,b=(0,u.Ie)();return a.lods.forEach(((e,R)=>{const M=!0===i.skipHighLods&&(T>1&&0===R||T>3&&1===R)||!1===i.skipHighLods&&null!=i.singleLodIndex&&R!==i.singleLodIndex;if(M&&0!==R)return;const w=new y(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=M?new kt({}):function(e,t,r,i,o,a,n){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),u=e.materials.get(t.material),h=null!=t.attributes.texCoord0,m=null!=t.attributes.normal;if(null==u)return null;const p=function(e){switch(e){case"BLEND":return B.sf.Blend;case"MASK":return B.sf.Mask;case"OPAQUE":case null:case void 0:return B.sf.Opaque}}(u.alphaMode);if(!a.has(s)){if(h){const t=(t,r=!1)=>{if(null!=t&&!n.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;n.set(t,new xe((0,A.x3)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,A.x3)(e)&&r,encoding:(0,A.x3)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(u.textureColor,p!==B.sf.Opaque),t(u.textureNormal),t(u.textureOcclusion),t(u.textureEmissive),t(u.textureMetallicRoughness)}const r=u.color[0]**(1/lr.T),f=u.color[1]**(1/lr.T),v=u.color[2]**(1/lr.T),g=u.emissiveFactor[0]**(1/lr.T),_=u.emissiveFactor[1]**(1/lr.T),x=u.emissiveFactor[2]**(1/lr.T),T=null!=u.textureColor&&h?n.get(u.textureColor):null,E=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:a,occlusionTexture:n}){return null==e&&null==t&&null==o&&(null==a||(0,c.j)(a,d.uY))&&null==n&&(null==i||1===i)&&(null==r||1===r)}({normalTexture:u.textureNormal,metallicRoughnessTexture:u.textureMetallicRoughness,metallicFactor:u.metallicFactor,roughnessFactor:u.roughnessFactor,emissiveTexture:u.textureEmissive,emissiveFactor:u.emissiveFactor,occlusionTexture:u.textureOcclusion}),b=null!=u.normalTextureTransform?.scale?u.normalTextureTransform?.scale:l.Un;a.set(s,new kt({...i,transparent:p===B.sf.Blend,customDepthTest:B.it.Lequal,textureAlphaMode:p,textureAlphaCutoff:u.alphaCutoff,diffuse:[r,f,v],ambient:[r,f,v],opacity:u.opacity,doubleSided:u.doubleSided,doubleSidedType:"winding-order",cullFace:u.doubleSided?B.s2.None:B.s2.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:m?ye.W.Attribute:ye.W.ScreenDerivative,castShadows:!0,receiveShadows:u.receiveShadows,receiveAmbientOcclusion:u.receiveAmbientOcclustion,textureId:null!=T?T.id:void 0,colorMixMode:u.colorMixMode,normalTextureId:null!=u.textureNormal&&h?n.get(u.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=u.textureOcclusion&&h?n.get(u.textureOcclusion).id:void 0,emissiveTextureId:null!=u.textureEmissive&&h?n.get(u.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=u.textureMetallicRoughness&&h?n.get(u.textureMetallicRoughness).id:void 0,emissiveFactor:[g,_,x],mrrFactors:E?[...It]:[u.metallicFactor,u.roughnessFactor,i.mrrFactors[2]],isSchematic:E,colorTextureTransformMatrix:S(u.colorTextureTransform),normalTextureTransformMatrix:S(u.normalTextureTransform),scale:[b[0],b[1]],occlusionTextureTransformMatrix:S(u.occlusionTextureTransform),emissiveTextureTransformMatrix:S(u.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:S(u.metallicRoughnessTextureTransform),...o}))}const f=a.get(s);if(r.stageResources.materials.push(f),h){const e=e=>{null!=e&&r.stageResources.textures.push(n.get(e))};e(u.textureColor),e(u.textureNormal),e(u.textureOcclusion),e(u.textureEmissive),e(u.textureMetallicRoughness)}return f}(a,e,w,t,r,s,x),{geometry:n,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,E.x)(e.indices||r,e.primitiveType),a=(0,h.oe)(3*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.position;(0,p.a)(a,n,e.transform,3,s);const l=[[Ae.r.POSITION,new F.n(a,i,3,!0)]];if(null!=e.attributes.normal){const t=(0,h.oe)(3*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.normal;(0,o.Ge)(dr,e.transform),(0,p.b)(t,a,dr,3,n),l.push([Ae.r.NORMAL,new F.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=(0,h.oe)(4*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.tangent;(0,o.Ge)(dr,e.transform),(0,f.t)(t,a,dr,4,n),l.push([Ae.r.TANGENT,new F.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,h.oe)(2*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.texCoord0;(0,v.n)(t,o,2,a),l.push([Ae.r.UV0,new F.n(t,i,2,!0)])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.Eq?(0,f.s)(t,e.attributes.color,255):e.attributes.color instanceof m.XP?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.Uz&&(0,f.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.xs?(0,p.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.eI?(0,g.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.nS&&(0,p.s)(t,e.attributes.color,1/256,4)),l.push([Ae.r.COLOR,new F.n(t,i,4,!0)])}return{geometry:new G.V(t,l),vertexCount:r}}(e,null!=i?i:new kt({})),y=n.boundingInfo;null!=y&&0===R&&((0,u.iT)(b,y.bbMin),(0,u.iT)(b,y.bbMax)),null!=i&&(w.stageResources.geometries.push(n),w.numberOfVertices+=T)})),M||n.push(w)})),{engineResources:n,referenceBoundingBox:b}}(a,O,U,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:z,referenceBoundingBox:V,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1}}const dr=(0,a.vt)()},1843:(e,t,r)=>{r.d(t,{BP:()=>l,l5:()=>c});var i=r(13030),o=r(90239),a=r(620);class n{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new n(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const o=this.stride;if(o%4==0){const a=new Uint32Array(e.buffer,t*o,i*o/4);new Uint32Array(this.buffer,r*o,i*o/4).set(a)}else{const a=new Uint8Array(e.buffer,t*o,i*o);new Uint8Array(this.buffer,r*o,i*o).set(a)}return this}get usedMemory(){return this.byteLength}dispose(){}}class s{constructor(e=null){this._stride=0,this._lastAligned=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach((e=>this._fields.set(e[0],{...e[1],constructor:h(e[1].constructor)}))))}freeze(){return this}vec2f(e,t){return this._appendField(e,i.gH,t),this}vec2f64(e,t){return this._appendField(e,i.si,t),this}vec3f(e,t){return this._appendField(e,i.xs,t),this}vec3f64(e,t){return this._appendField(e,i.Xm,t),this}vec4f(e,t){return this._appendField(e,i.Eq,t),this}vec4f64(e,t){return this._appendField(e,i.Aj,t),this}mat3f(e,t){return this._appendField(e,i.jZ,t),this}mat3f64(e,t){return this._appendField(e,i.j0,t),this}mat4f(e,t){return this._appendField(e,i.Sx,t),this}mat4f64(e,t){return this._appendField(e,i.E$,t),this}vec4u8(e,t){return this._appendField(e,i.XP,t),this}f32(e,t){return this._appendField(e,i.Y$,t),this}f64(e,t){return this._appendField(e,i.qB,t),this}u8(e,t){return this._appendField(e,i.SL,t),this}u16(e,t){return this._appendField(e,i.h,t),this}i8(e,t){return this._appendField(e,i.bf,t),this}vec2i8(e,t){return this._appendField(e,i.D6,t),this}vec2i16(e,t){return this._appendField(e,i.mJ,t),this}vec2u8(e,t){return this._appendField(e,i.LC,t),this}vec4u16(e,t){return this._appendField(e,i.Uz,t),this}u32(e,t){return this._appendField(e,i.P,t),this}_appendField(e,t,r){if(this._fields.has(e))return void(0,a.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._stride+=i,this._fields.set(e,{size:i,constructor:t,offset:n,optional:r})}createBuffer(e){return new n(this,e)}createView(e){return new n(this,e)}clone(){const e=new s;return e._stride=this._stride,e._fields=new Map,this._fields.forEach(((t,r)=>e._fields.set(r,t))),e.BufferType=this.BufferType,e}get stride(){if(this._lastAligned!==this._fields.size){let e=1;this._fields.forEach((t=>e=Math.max(e,(0,o.GJ)(t.constructor.ElementType)))),this._stride=Math.floor((this._stride+e-1)/e)*e,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function l(){return new s}class c{constructor(e){this.fields=new Array,e.fields.forEach(((e,t)=>{const r={...e,constructor:u(e.constructor)};this.fields.push([t,r])})),this.stride=e.stride}}const d=[i.Y$,i.gH,i.xs,i.Eq,i.jZ,i.Sx,i.qB,i.si,i.Xm,i.Aj,i.j0,i.E$,i.SL,i.LC,i.eI,i.XP,i.h,i.Yi,i.nS,i.Uz,i.P,i.An,i.H$,i.ml,i.bf,i.D6,i.m8,i.TX,i.Qt,i.mJ,i.Vp,i.E7,i.My,i.UL,i.zD,i.Y4];function u(e){return`${e.ElementType}_${e.ElementCount}`}function h(e){return m.get(e)}const m=new Map;d.forEach((e=>m.set(u(e),e)))},46686:(e,t,r)=>{r.d(t,{i$:()=>c,oD:()=>d,xJ:()=>l});var i=r(49255),o=r(33752),a=r(47286),n=r(2597);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new a.G("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
283
283
|
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
284
284
|
}`)}function d(e,t){const{vertex:r}=e;switch(t.output){case i.V.Color:if(t.receiveShadows)return s(e),void r.code.add(n.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.V.LinearDepth:case i.V.Shadow:case i.V.ShadowHighlight:case i.V.ShadowExcludeHighlight:return e.include(o.em,t),s(e),l(e),c(e),void r.code.add(n.H`void forwardLinearDepth() {
|
|
285
285
|
linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
|
|
@@ -479,7 +479,7 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
|
|
|
479
479
|
vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
|
|
480
480
|
return worldPos + calculateVerticalOffset(worldPos, localOrigin);
|
|
481
481
|
}
|
|
482
|
-
`)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const p=(0,o.vt)()},30815:(e,t,r)=>{r.d(t,{E:()=>
|
|
482
|
+
`)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const p=(0,o.vt)()},30815:(e,t,r)=>{r.d(t,{E:()=>R});var i=r(46686),o=r(49255),a=r(76591),n=r(76597),s=r(96336),l=r(2597),c=r(46540);function d(e,t){const r=t.output===o.V.ObjectAndLayerIdColor,i=t.objectAndLayerIdColorInstanced;r&&(e.varyings.add("objectAndLayerIdColorVarying","vec4"),i?e.attributes.add(c.r.INSTANCEOBJECTANDLAYERIDCOLOR,"vec4"):e.attributes.add(c.r.OBJECTANDLAYERIDCOLOR,"vec4")),e.vertex.code.add(l.H`
|
|
483
483
|
void forwardObjectAndLayerIdColor() {
|
|
484
484
|
${r?i?l.H`objectAndLayerIdColorVarying = instanceObjectAndLayerIdColor * 0.003921568627451;`:l.H`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;`:l.H``} }`),e.fragment.code.add(l.H`
|
|
485
485
|
void outputObjectAndLayerIdColor() {
|
|
@@ -500,7 +500,7 @@ fragColor = occludedHighlightFlag;
|
|
|
500
500
|
} else {
|
|
501
501
|
fragColor = unoccludedHighlightFlag;
|
|
502
502
|
}
|
|
503
|
-
}`)}var E=r(986),A=r(52919),b=r(20693),S=r(89192);function
|
|
503
|
+
}`)}var E=r(986),A=r(52919),b=r(20693),S=r(89192);function R(e,t){const{vertex:r,fragment:c}=e,m=t.hasColorTexture&&t.alphaDiscardMode!==S.sf.Opaque;switch(t.output){case o.V.LinearDepth:case o.V.Shadow:case o.V.ShadowHighlight:case o.V.ShadowExcludeHighlight:case o.V.ObjectAndLayerIdColor:(0,b.NB)(r,t),e.include(n.d,t),e.include(u.U,t),e.include(E.A,t),e.include(f,t),e.include(a.HQ,t),e.include(d,t),(0,i.xJ)(e),e.varyings.add("depth","float"),m&&c.uniforms.add(new g.N("tex",(e=>e.texture))),r.code.add(l.H`void main(void) {
|
|
504
504
|
vpos = getVertexInLocalOriginSpace();
|
|
505
505
|
vpos = subtractOrigin(vpos);
|
|
506
506
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
@@ -602,14 +602,14 @@ vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),t.hasNormal
|
|
|
602
602
|
normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
|
|
603
603
|
0.0, 0.0, 0.0 );
|
|
604
604
|
rawNormal.xy = (normalTextureRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(c.H`return tangentSpace * rawNormal;
|
|
605
|
-
}`))}},84200:(e,t,r)=>{r.d(t,{n:()=>k});var i,o,a=r(2597),n=r(63761),s=r(90237),l=r(34727),c=r(97768),d=r(36708),u=r(78659),h=r(10107),m=(r(44208),r(53966),r(87811),r(40608)),p=r(37585);!function(e){e[e.RED=0]="RED",e[e.RG=1]="RG",e[e.RGBA4=2]="RGBA4",e[e.RGBA=3]="RGBA",e[e.RGBA_MIPMAP=4]="RGBA_MIPMAP",e[e.R16F=5]="R16F",e[e.RGBA16F=6]="RGBA16F"}(i||(i={})),function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH16_BUFFER=1]="DEPTH16_BUFFER"}(o||(o={}));const f=5e5;var v=r(69622),g=r(49255);const _={required:[]},x=(g.V.LinearDepth,g.V.CompositeColor,g.V.Highlight,{required:[g.V.Depth,g.V.Normal]});class T extends v.A{consumes(){return _}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}get materialReference(){return null}modify(e){}get numGeometries(){return 0}get hasOccludees(){return!1}queryRenderOccludedState(e){return!1}}class E extends T{}var A=r(97220),b=r(84867),S=r(39341),
|
|
605
|
+
}`))}},84200:(e,t,r)=>{r.d(t,{n:()=>k});var i,o,a=r(2597),n=r(63761),s=r(90237),l=r(34727),c=r(97768),d=r(36708),u=r(78659),h=r(10107),m=(r(44208),r(53966),r(87811),r(40608)),p=r(37585);!function(e){e[e.RED=0]="RED",e[e.RG=1]="RG",e[e.RGBA4=2]="RGBA4",e[e.RGBA=3]="RGBA",e[e.RGBA_MIPMAP=4]="RGBA_MIPMAP",e[e.R16F=5]="R16F",e[e.RGBA16F=6]="RGBA16F"}(i||(i={})),function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH16_BUFFER=1]="DEPTH16_BUFFER"}(o||(o={}));const f=5e5;var v=r(69622),g=r(49255);const _={required:[]},x=(g.V.LinearDepth,g.V.CompositeColor,g.V.Highlight,{required:[g.V.Depth,g.V.Normal]});class T extends v.A{consumes(){return _}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}get materialReference(){return null}modify(e){}get numGeometries(){return 0}get hasOccludees(){return!1}queryRenderOccludedState(e){return!1}}class E extends T{}var A=r(97220),b=r(84867),S=r(39341),R=r(34886),y=r(95774),M=r(90644);class w extends b.w{initializeProgram(e){return new R.B(e.rctx,w.shader.get().build(),S.D)}initializePipeline(){return(0,M.Ey)({colorWrite:M.wE})}}w.shader=new A.$(y.S,(()=>r.e(9384).then(r.bind(r,59384))));var C=r(48163);class I extends a.Y{constructor(){super(...arguments),this.projScale=1}}class O extends I{constructor(){super(...arguments),this.intensity=1}}class N extends a.Y{}class H extends N{constructor(){super(...arguments),this.blurSize=(0,C.vt)()}}var P,L,D=r(15581);class F extends b.w{initializeProgram(e){return new R.B(e.rctx,F.shader.get().build(),S.D)}initializePipeline(){return(0,M.Ey)({colorWrite:M.wE})}}F.shader=new A.$(D.S,(()=>r.e(191).then(r.bind(r,90191)))),r(98494),(L=P||(P={}))[L.Antialiasing=0]="Antialiasing",L[L.HighQualityTransparency=1]="HighQualityTransparency",L[L.HighResolutionVoxel=2]="HighResolutionVoxel",L[L.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",L[L.SSAO=4]="SSAO",L[L.WaterReflection=5]="WaterReflection",L[L.HighResolutionShadows=6]="HighResolutionShadows",L[L.PhysicalPixelRendering=7]="PhysicalPixelRendering";var B=r(13464),G=r(63907),U=r(21231),z=r(67171);const V=2;let W=class extends E{constructor(e){super(e),this._context=null,this._passParameters=new O,this._drawParameters=new H,this.produces=new Map([[B.N.SSAO,()=>this._produces()]])}_getCameraElevation(){return this._context?.renderContext.bindParameters.camera.relativeElevation??1/0}_produces(){return null!=this._enableTime&&null!=this._context&&this._getCameraElevation()<f}consumes(){return this._produces()?x:_}initializeRenderContext(e){this._context=e,this.addHandles([(0,d.wB)((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(P.SSAO)),(e=>e?this._enable():this._disable()),d.pc)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=(0,c.WD)(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),(e=>e.charCodeAt(0))),t=new z.R;t.wrapMode=G.pF.CLAMP_TO_EDGE,t.pixelFormat=G.Ab.RGB,t.wrapMode=G.pF.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new U.g(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(F)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(w)),this._enableTime=(0,u.l5)(0),this._context?.requestRender()}renderNode(e,t,r){const o=e.bindParameters,a=r?.get("normals"),n=a?.getTexture(),s=a?.getTexture(G.nI);if(null==this._enableTime||null==this._context||!n||!s)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const c=e.rctx,d=o.camera,u=this.view.qualitySettings.fadeDuration,h=d.relativeElevation,m=(0,l.qE)((f-h)/2e5,0,1),v=u>0?Math.min(u,e.time-this._enableTime)/u:1,g=v*m;this._passParameters.normalTexture=n,this._passParameters.depthTexture=s,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*j/(0,D.g)(d)**6*g;const _=d.fullViewport[2],x=d.fullViewport[3],T=Math.round(_/V),E=Math.round(x/V),A=this._context.fbos,b=A.acquire(_,x,"ssao input",i.RG);c.unbindTexture(b.fbo.colorTexture),c.bindFramebuffer(b.fbo),c.setViewport(0,0,_,x),c.bindTechnique(this._ssaoTechnique,o,this._passParameters,this._drawParameters),c.screen.draw();const S=A.acquire(T,E,"ssao blur",i.RED);c.unbindTexture(S.fbo.colorTexture),c.bindFramebuffer(S.fbo),this._drawParameters.colorTexture=b.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,0,V/x),c.bindTechnique(this._blurTechnique,o,this._passParameters,this._drawParameters),c.setViewport(0,0,T,E),c.screen.draw(),b.release();const R=A.acquire(T,E,"ssao",i.RED);return c.unbindTexture(R.fbo.colorTexture),c.bindFramebuffer(R.fbo),c.setViewport(0,0,_,x),c.setClearColor(1,1,1,0),c.clear(G.hn.COLOR_BUFFER_BIT),this._drawParameters.colorTexture=S.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,V/_,0),c.bindTechnique(this._blurTechnique,o,this._passParameters,this._drawParameters),c.setViewport(0,0,T,E),c.screen.draw(),c.setViewport4fv(d.fullViewport),S.release(),v<1&&this._context.requestRender(),R}};(0,s._)([(0,h.MZ)({constructOnly:!0})],W.prototype,"view",void 0),(0,s._)([(0,h.MZ)()],W.prototype,"_context",void 0),W=(0,s._)([(0,m.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],W);const j=.5;function k(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new n.N("ssaoTex",((e,t)=>t.ssao?.getTexture()))),r.constants.add("blurSizePixelsInverse","float",1/V),r.code.add(a.H`float evaluateAmbientOcclusionInverse() {
|
|
606
606
|
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
|
|
607
607
|
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
|
|
608
608
|
}
|
|
609
609
|
float evaluateAmbientOcclusion() {
|
|
610
610
|
return 1.0 - evaluateAmbientOcclusionInverse();
|
|
611
611
|
}`)):r.code.add(a.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
|
|
612
|
-
float evaluateAmbientOcclusion() { return 0.0; }`)}},8881:(e,t,r)=>{r.d(t,{kA:()=>
|
|
612
|
+
float evaluateAmbientOcclusion() { return 0.0; }`)}},8881:(e,t,r)=>{r.d(t,{kA:()=>y,a8:()=>S,eU:()=>R});var i=r(21818),o=r(38954),a=r(51850),n=r(87317),s=r(91829),l=r(59469),c=r(33079),d=r(71988),u=r(2597);function h(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new c.t("lightingAmbientSH0",((e,t)=>(0,o.s)(m,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
613
613
|
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
614
614
|
return ambientLight * (1.0 - ambientOcclusion);
|
|
615
615
|
}`)):1===i?(r.uniforms.add(new d.E("lightingAmbientSH_R",((e,t)=>(0,n.s)(p,t.lighting.sh.r[0],t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3]))),new d.E("lightingAmbientSH_G",((e,t)=>(0,n.s)(p,t.lighting.sh.g[0],t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3]))),new d.E("lightingAmbientSH_B",((e,t)=>(0,n.s)(p,t.lighting.sh.b[0],t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
@@ -655,11 +655,11 @@ vec3 calculateAmbientRadiance(float ambientOcclusion)
|
|
|
655
655
|
{
|
|
656
656
|
vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
|
|
657
657
|
return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
|
|
658
|
-
}`))}const m=(0,a.vt)(),p=(0,s.vt)();var f=r(84200),v=r(98619),g=r(22393),_=r(89786),x=r(39589),T=r(46263);class E extends x.n{constructor(e,t){super(e,"bool",T.c.Pass,((r,i,o)=>r.setUniform1b(e,t(i,o))))}}var A=r(20304);r(34727),(0,a.vt)();const b=.4;function S(e){e.constants.add("ambientBoostFactor","float",b)}function
|
|
658
|
+
}`))}const m=(0,a.vt)(),p=(0,s.vt)();var f=r(84200),v=r(98619),g=r(22393),_=r(89786),x=r(39589),T=r(46263);class E extends x.n{constructor(e,t){super(e,"bool",T.c.Pass,((r,i,o)=>r.setUniform1b(e,t(i,o))))}}var A=r(20304);r(34727),(0,a.vt)();const b=.4;function S(e){e.constants.add("ambientBoostFactor","float",b)}function R(e){e.uniforms.add(new A.m("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)))}function y(e,t){const r=e.fragment;switch(e.include(f.n,t),t.pbrMode!==l.A9.Disabled&&e.include(g.c,t),e.include(h,t),e.include(_.p),r.code.add(u.H`
|
|
659
659
|
const float GAMMA_SRGB = 2.1;
|
|
660
660
|
const float INV_GAMMA_SRGB = 0.4761904;
|
|
661
661
|
${t.pbrMode===l.A9.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
|
|
662
|
-
`),S(r),
|
|
662
|
+
`),S(r),R(r),(0,v.Gc)(r),r.code.add(u.H`
|
|
663
663
|
float additionalDirectedAmbientLight(vec3 vPosWorld) {
|
|
664
664
|
float vndl = dot(${t.spherical?u.H`normalize(vPosWorld)`:u.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
|
|
665
665
|
return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
|
|
@@ -1040,4 +1040,4 @@ const vec4 RGBA4_2_FLOAT_FACTORS = vec4(
|
|
|
1040
1040
|
);
|
|
1041
1041
|
float rgba4ToFloat(vec4 rgba) {
|
|
1042
1042
|
return dot(rgba, RGBA4_2_FLOAT_FACTORS);
|
|
1043
|
-
}`)}},20693:(e,t,r)=>{r.d(t,{yu:()=>m,NB:()=>p,S7:()=>g});var i=r(58083),o=r(9093),a=r(38954),n=r(51850),s=r(40710),l=r(33079),c=(r(20304),r(39589)),d=r(46263);class u extends c.n{constructor(e,t){super(e,"mat4",d.c.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(40095);function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",n.uY):e.uniforms.add(new s.W("cameraPosition",((e,t)=>(0,a.s)(v,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function p(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new h.X("proj",((e,t)=>t.camera.projectionMatrix)),new u("view",((e,t)=>(0,i.Tl)(f,t.camera.viewMatrix,e.origin))),new s.W("localOrigin",(e=>e.origin)));const r=e=>(0,a.s)(v,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new h.X("proj",((e,t)=>t.camera.projectionMatrix)),new h.X("view",((e,t)=>(0,i.Tl)(f,t.camera.viewMatrix,r(t)))),new l.t("localOrigin",((e,t)=>r(t))))}const f=(0,o.vt)(),v=(0,n.vt)();function g(e){e.uniforms.add(new h.X("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},68259:(e,t,r)=>{r.d(t,{t:()=>a});var i=r(39589),o=r(46263);class a extends i.n{constructor(e,t){super(e,"vec2",o.c.Draw,((r,i,o,a)=>r.setUniform2fv(e,t(i,o,a))))}}},47286:(e,t,r)=>{r.d(t,{G:()=>a});var i=r(39589),o=r(46263);class a extends i.n{constructor(e,t){super(e,"vec2",o.c.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},71988:(e,t,r)=>{r.d(t,{E:()=>a});var i=r(39589),o=r(46263);class a extends i.n{constructor(e,t){super(e,"vec4",o.c.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},93588:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(39589),o=r(46263);class a extends i.n{constructor(e,t){super(e,"int",o.c.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},85977:(e,t,r)=>{r.d(t,{N5:()=>c});var i=r(49186),o=r(53966),a=r(46263),n=r(620);const s=()=>o.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class l{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){s().error("Shader module included multiple times with different configuration.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class c extends l{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new p,this.extensions=new f,this.constants=new g,this.outputs=new v}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),o="vertex"===e?this.vertex:this.fragment,a=o.uniforms.generateSource(),n=o.code.generateSource(),s="vertex"===e?x:_,l=this.constants.generateSource().concat(o.constants.generateSource()),c=this.outputs.generateSource(e);return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${a.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${c.join("\n")}\n\n${n.join("\n")}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[a.c.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[a.c.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let a=0;a<i;++a)r[a](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[a.c.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[a.c.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o,a)=>{for(let n=0;n<i;++n)r[n](e,t,o,a)}}}class d{constructor(){this._entries=new Map}add(...e){for(const t of e)this._add(t)}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 s().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(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class h extends l{constructor(){super(...arguments),this.uniforms=new d,this.code=new u,this.constants=new g}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class p{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,n.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 v{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?(0,n.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:v.DEFAULT_NAME,type:v.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}v.DEFAULT_TYPE="vec4",v.DEFAULT_NAME="fragColor";class g{constructor(){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}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",x="precision highp float;\nprecision highp sampler2D;"},63761:(e,t,r)=>{r.d(t,{N:()=>a});var i=r(39589),o=r(46263);class a extends i.n{constructor(e,t){super(e,"sampler2D",o.c.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},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:()=>a});var i=r(97768),o=r(63907);class a{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}destroy(){this._program=(0,i.WD)(this._program),this._pipeline=this._configuration=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 o.WR.TRIANGLES}getPipeline(e,t,r){return this._pipeline}initializeConfiguration(e,t){}}},99769:(e,t,r)=>{r.d(t,{K:()=>o,W:()=>a});var i=r(2597);class o extends i.Y{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}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 a(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,a=Math.ceil(Math.log2(o)),n=t._parameterBits??[0];let s=0;for(;n[s]+a>16;)s++,s>=n.length&&n.push(0);t._parameterBits=n;const l=n[s],c=(1<<a)-1<<l;n[s]+=a,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw new Error("Configuration value for "+r+" must be boolean or number, got "+typeof e)}})}}}},39341:(e,t,r)=>{r.d(t,{D:()=>o});var i=r(46540);const o=new Map([[i.r.POSITION,0],[i.r.NORMAL,1],[i.r.NORMALCOMPRESSED,1],[i.r.UV0,2],[i.r.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.INSTANCEMODEL,8],[i.r.INSTANCEMODELNORMAL,12],[i.r.INSTANCEMODELORIGINHI,11],[i.r.INSTANCEMODELORIGINLO,15]])},25634:(e,t,r)=>{r.d(t,{m:()=>l});var i=r(97768),o=r(74887),a=r(2597),n=r(89192);class s{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}get _markerTextureRepository(){return this._techniqueRepository.constructionContext.markerTextureRepository}ensureTechnique(e,t){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return n.Am.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRepository,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?n.Am.LOADED:n.Am.LOADING}get textureBindParameters(){return new c(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._textureRepository.acquire(e);if((0,o.$X)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.Gz)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends a.Y{constructor(e=null,t=null,r=null,i=null,o=null,a,n){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o,this.scale=a,this.normalTextureTransformMatrix=n}}},14903:(e,t,r)=>{r.d(t,{im:()=>h,m$:()=>i});var i,o,a=r(51850),n=r(2597),s=r(89192),l=r(69720),c=r(96672),d=r(39341),u=r(19245);class h extends l.J{constructor(e,t){super(),this.type=c.X.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._vertexAttributeLocations=d.D,this._pp0=(0,a.fA)(0,0,1),this._pp1=(0,a.fA)(0,0,0),this._parameters=(0,u.qu)(e,t),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,u.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bindParameters.decorations===s.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}isVisible(){return this._visible}parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.isVisible()&&this.parameters.renderOccluded===e}intersectDraped(e,t,r,i,o,a){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,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque",n.Y},34886:(e,t,r)=>{r.d(t,{B:()=>a});var i=r(3694),o=r(94656);class a{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,o.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.setUniform3iv(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.ANTIALIASING=12]="ANTIALIASING",e[e.COMPOSITE=13]="COMPOSITE",e[e.BLIT=14]="BLIT",e[e.SSAO=15]="SSAO",e[e.HIGHLIGHT=16]="HIGHLIGHT",e[e.SHADOW_HIGHLIGHT=17]="SHADOW_HIGHLIGHT",e[e.ENVIRONMENT_OPAQUE=18]="ENVIRONMENT_OPAQUE",e[e.ENVIRONMENT_TRANSPARENT=19]="ENVIRONMENT_TRANSPARENT",e[e.LASERLINES=20]="LASERLINES",e[e.LASERLINES_CONTRAST_CONTROL=21]="LASERLINES_CONTRAST_CONTROL",e[e.HUD_MATERIAL=22]="HUD_MATERIAL",e[e.LABEL_MATERIAL=23]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=24]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=25]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=26]="DRAPED_MATERIAL",e[e.DRAPED_WATER=27]="DRAPED_WATER",e[e.VOXEL=28]="VOXEL",e[e.MAX_SLOTS=29]="MAX_SLOTS"}(i||(i={}))},14327:(e,t,r)=>{var i;r.d(t,{y:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},19245:(e,t,r)=>{r.d(t,{Um:()=>u,qu:()=>l,MB:()=>c,kE:()=>s});var i=r(4576),o=r(34727);function a(e,t,r,i){return function(e,t){return(0,o.Cc)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}(e,function(e,t,r){const i=r.parameters;return n.scale=Math.min(i.divisor/(t-i.offset),1),n.factor=function(e){return Math.abs(e*e*e)}(e),n}(t,r,i))}r(24151),(0,o.kU)(10),(0,o.kU)(12),(0,o.kU)(70),(0,o.kU)(40);const n={scale:0,factor:0,minScaleFactor:0};function s(e,t,r,i,n){let s=(r.screenLength||0)*e.pixelRatio;null!=n&&(s=a(s,i,t,n));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.qE)(l*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function l(e,t){const r=t?l(t):{};for(const t in e){let i=e[t];i?.forEach&&(i=d(i)),null==i&&t in r||(r[t]=i)}return r}function c(e,t){let r=!1;for(const o in t){const a=t[o];void 0!==a&&(Array.isArray(a)?null===e[o]?(e[o]=a.slice(),r=!0):(0,i.yo)(e[o],a)&&(r=!0):e[o]!==a&&(r=!0,e[o]=a))}return r}function d(e){const t=[];return e.forEach((e=>t.push(e))),t}const u={multiply:1,ignore:2,replace:3,tint:4}},98494:(e,t,r)=>{var i;r.d(t,{M:()=>i}),function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(i||(i={}))},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:()=>c});var i=r(49186),o=(r(44208),r(94656)),a=r(63907),n=r(36421),s=r(67171);class l extends s.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case a.H0.R16F:case a.H0.R16I:case a.H0.R16UI:case a.H0.R32F:case a.H0.R32I:case a.H0.R32UI:case a.H0.R8_SNORM:case a.H0.R8:case a.H0.R8I:case a.H0.R8UI:this.pixelFormat=a.Ab.RED}}static validate(e,t){return new l(e,t)}}let c=class e{constructor(e,t=null,r=null){if(this.type=n.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=l.validate(e,t);if(!r)throw new i.A("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===a.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return(0,s.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(a.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===a.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=a.Ap.TEXTURE_CUBE_MAP_POSITIVE_X;t<=a.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 n=this._descriptor.context.gl;(0,o.Y2)(n),this._glName||(this._glName=n.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(a.vt.Texture,this)),void 0===t&&(t=null);const s=this._descriptor,l=r??s.target,c=f(l);null===t&&(s.width=s.width||4,s.height=s.height||4,c&&(s.depth=s.depth??1));const g=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),d(s),this._configurePixelStorage(),(0,o.Y2)(n);const _=this._deriveInternalFormat();if(p(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),s.width&&s.height,c&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,_,s.hasMipmap,e,r,i),this._texImage(l,0,_,e,r,i,t),(0,o.Y2)(n),s.hasMipmap&&this.generateMipmap(),s.width||(s.width=e),s.height||(s.height=r),c&&!s.depth&&(s.depth=i)}else{const{width:e,height:r,depth:d}=s;if(null==e||null==r)throw new i.A("Width and height must be specified!");if(c&&null==d)throw new i.A("Depth must be specified!");if(s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,_,s.hasMipmap,e,r,d),m(t)){const o=t.levels,c=v(l,e,r,d),u=Math.min(c-1,o.length-1);n.texParameteri(s.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,u);const h=_;if(!(h in a.CQ))throw new i.A("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const a=o[Math.min(e,o.length-1)];this._compressedTexImage(l,e,h,t,r,i,a)}),u)}else this._texImage(l,0,_,e,r,d,t),(0,o.Y2)(n),s.hasMipmap&&this.generateMipmap()}u(n,this._descriptor),h(n,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,o.Y2)(n),this._descriptor.context.bindTexture(g,e.TEXTURE_UNIT_FOR_UPDATES)}updateData(t,r,o,a,n,s,l=0){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const c=this._descriptor,d=this._deriveInternalFormat(),{context:u,pixelFormat:h,dataType:f,target:v,isImmutable:g}=c;if(g&&!this._wasImmutablyAllocated)throw new i.A("Cannot update immutable texture before allocation!");const _=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||o<0||a>c.width||n>c.height||r+a>c.width||o+n>c.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=u;l&&x.pixelStorei(x.UNPACK_SKIP_ROWS,l),p(s)?x.texSubImage2D(v,t,r,o,a,n,h,f,s):m(s)?x.compressedTexSubImage2D(v,t,r,o,a,n,d,s.levels[t]):x.texSubImage2D(v,t,r,o,a,n,h,f,s),l&&x.pixelStorei(x.UNPACK_SKIP_ROWS,0),u.bindTexture(_,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,o,a,n,s,l,c){c||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const d=this._descriptor,u=this._deriveInternalFormat(),{context:h,pixelFormat:p,dataType:v,isImmutable:g,target:_}=d;if(g&&!this._wasImmutablyAllocated)throw new i.A("Cannot update immutable texture before allocation!");f(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const x=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||o<0||a<0||n>d.width||s>d.height||l>d.depth||r+n>d.width||o+s>d.height||a+l>d.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=h;if(m(c))c=c.levels[t],T.compressedTexSubImage3D(_,t,r,o,a,n,s,l,u,c);else{const e=c;T.texSubImage3D(_,t,r,o,a,n,s,l,p,v,e)}h.bindTexture(x,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,d(t)}t.samplingMode===a.Cj.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=a.Cj.LINEAR_MIPMAP_NEAREST):t.samplingMode===a.Cj.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=a.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)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,d(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,t=e.context.gl;this._samplingModeDirty&&(u(t,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(h(t,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(null!=this._descriptor.internalFormat)return this._descriptor.internalFormat===a.Ab.DEPTH_STENCIL&&(this._descriptor.internalFormat=a.Ab.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case a.ld.FLOAT:switch(this._descriptor.pixelFormat){case a.Ab.RGBA:return this._descriptor.internalFormat=a.H0.RGBA32F;case a.Ab.RGB:return this._descriptor.internalFormat=a.H0.RGB32F;default:throw new i.A("Unable to derive format")}case a.ld.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case a.Ab.RGBA:return this._descriptor.internalFormat=a.H0.RGBA8;case a.Ab.RGB:return this._descriptor.internalFormat=a.H0.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===a.Ab.DEPTH_STENCIL?a.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,o,n,s){const{gl:l}=this._descriptor.context;if(!(t in a.H0))throw new i.A("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?v(e,o,n,s):1;if(f(e)){if(null==s)throw new i.A("Missing depth dimension for 3D texture upload");l.texStorage3D(e,c,t,o,n,s)}else l.texStorage2D(e,c,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,a,n,s){const l=this._descriptor.context.gl,c=f(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==n)throw new i.A("Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,o,a,n,u,h,r)}else l.texSubImage2D(e,t,0,0,o,a,u,h,r)}}else{const d=s;if(c){if(null==n)throw new i.A("Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,o,a,n,0,u,h,d)}else l.texImage2D(e,t,r,o,a,0,u,h,d)}}_compressedTexImage(e,t,r,o,a,n,s){const l=this._descriptor.context.gl,c=f(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==n)throw new i.A("Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,o,a,n,r,s)}else l.compressedTexSubImage2D(e,t,0,0,o,a,r,s)}else if(c){if(null==n)throw new i.A("Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,o,a,n,0,s)}else l.compressedTexImage2D(e,t,r,o,a,0,s)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:s,target:l}=this._descriptor;const c=l===a.Ap.TEXTURE_3D;if(null==r||null==o||c&&null==n)throw new i.A("Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),s&&(1!==r||1!==o||c&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),c&&(n=Math.max(1,n>>1))}};function d(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 u(e,t){let r=t.samplingMode,i=t.samplingMode;r===a.Cj.LINEAR_MIPMAP_NEAREST||r===a.Cj.LINEAR_MIPMAP_LINEAR?(r=a.Cj.LINEAR,t.hasMipmap||(i=a.Cj.LINEAR)):r!==a.Cj.NEAREST_MIPMAP_NEAREST&&r!==a.Cj.NEAREST_MIPMAP_LINEAR||(r=a.Cj.NEAREST,t.hasMipmap||(i=a.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 p(e){return null!=e&&!m(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function f(e){return e===a.Ap.TEXTURE_3D||e===a.Ap.TEXTURE_2D_ARRAY}function v(e,t,r,i=1){let o=Math.max(t,r);return e===a.Ap.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}c.TEXTURE_UNIT_FOR_UPDATES=0},67171:(e,t,r)=>{r.d(t,{R:()=>a,e:()=>n});var i=r(63907),o=r(42293);class a{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 n(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,o.IB)(e.internalFormat)))}},42293:(e,t,r)=>{r.d(t,{IB:()=>o}),r(44208),r(94656);var i=r(63907);function o(e){switch(e){case i.Ab.ALPHA:case i.Ab.LUMINANCE:case i.Ab.RED:case i.Ab.RED_INTEGER:case i.H0.R8:case i.H0.R8I:case i.H0.R8UI:case i.H0.R8_SNORM:case i.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:()=>c,Y2:()=>d,en:()=>l});var i=r(49186),o=r(44208),a=r(53966);const n=()=>a.A.getLogger("esri.views.webgl.checkWebGLError"),s=!!(0,o.A)("enable-feature:webgl-debug");function l(){return s}function c(){return s}function d(e){if(l()){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),o=(new Error).stack;n().error(new i.A("webgl-error","WebGL error occurred",{message:r,stack:o}))}}}},62298:(e,t,r)=>{r(63907)},90644:(e,t,r)=>{r.d(t,{Ey:()=>E,Xt:()=>c,kn:()=>d,ox:()=>a,p3:()=>n,wE:()=>u});var i=r(89192),o=r(63907);function a(e,t,r=o.Tb.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,a=o.Tb.ADD,n=o.Tb.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:a,opAlpha:n,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const s={face:o.Y7.BACK,mode:o.Ac.CCW},l={face:o.Y7.FRONT,mode:o.Ac.CCW},c=e=>e===i.s2.Back?s:e===i.s2.Front?l:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function h(e){return S.intern(e)}function m(e){return M.intern(e)}function p(e){return w.intern(e)}function f(e){return I.intern(e)}function v(e){return N.intern(e)}function g(e){return P.intern(e)}function _(e){return D.intern(e)}function x(e){return B.intern(e)}function T(e){return U.intern(e)}function E(e){return V.intern(e)}class A{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function b(e){return"["+e.join(",")+"]"}const S=new A(y,(e=>({__tag:"Blending",...e})));function y(e){return e?b([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const M=new A(R,(e=>({__tag:"Culling",...e})));function R(e){return e?b([e.face,e.mode]):null}const w=new A(C,(e=>({__tag:"PolygonOffset",...e})));function C(e){return e?b([e.factor,e.units]):null}const I=new A(O,(e=>({__tag:"DepthTest",...e})));function O(e){return e?b([e.func]):null}const N=new A(H,(e=>({__tag:"StencilTest",...e})));function H(e){return e?b([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const P=new A(L,(e=>({__tag:"DepthWrite",...e})));function L(e){return e?b([e.zNear,e.zFar]):null}const D=new A(F,(e=>({__tag:"ColorWrite",...e})));function F(e){return e?b([e.r,e.g,e.b,e.a]):null}const B=new A(G,(e=>({__tag:"StencilWrite",...e})));function G(e){return e?b([e.mask]):null}const U=new A(z,(e=>({__tag:"DrawBuffers",...e})));function z(e){return e?b(e.buffers):null}const V=new A((function(e){return e?b([y(e.blending),R(e.culling),C(e.polygonOffset),O(e.depthTest),H(e.stencilTest),L(e.depthWrite),F(e.colorWrite),G(e.stencilWrite),z(e.drawBuffers)]):null}),(e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:p(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:v(e.stencilTest),depthWrite:g(e.depthWrite),colorWrite:_(e.colorWrite),stencilWrite:x(e.stencilWrite),drawBuffers:T(e.drawBuffers)})))}}]);
|
|
1043
|
+
}`)}},20693:(e,t,r)=>{r.d(t,{yu:()=>m,NB:()=>p,S7:()=>g});var i=r(58083),o=r(9093),a=r(38954),n=r(51850),s=r(40710),l=r(33079),c=(r(20304),r(39589)),d=r(46263);class u extends c.n{constructor(e,t){super(e,"mat4",d.c.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(40095);function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",n.uY):e.uniforms.add(new s.W("cameraPosition",((e,t)=>(0,a.s)(v,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function p(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new h.X("proj",((e,t)=>t.camera.projectionMatrix)),new u("view",((e,t)=>(0,i.Tl)(f,t.camera.viewMatrix,e.origin))),new s.W("localOrigin",(e=>e.origin)));const r=e=>(0,a.s)(v,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new h.X("proj",((e,t)=>t.camera.projectionMatrix)),new h.X("view",((e,t)=>(0,i.Tl)(f,t.camera.viewMatrix,r(t)))),new l.t("localOrigin",((e,t)=>r(t))))}const f=(0,o.vt)(),v=(0,n.vt)();function g(e){e.uniforms.add(new h.X("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},68259:(e,t,r)=>{r.d(t,{t:()=>a});var i=r(39589),o=r(46263);class a extends i.n{constructor(e,t){super(e,"vec2",o.c.Draw,((r,i,o,a)=>r.setUniform2fv(e,t(i,o,a))))}}},47286:(e,t,r)=>{r.d(t,{G:()=>a});var i=r(39589),o=r(46263);class a extends i.n{constructor(e,t){super(e,"vec2",o.c.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},71988:(e,t,r)=>{r.d(t,{E:()=>a});var i=r(39589),o=r(46263);class a extends i.n{constructor(e,t){super(e,"vec4",o.c.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},93588:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(39589),o=r(46263);class a extends i.n{constructor(e,t){super(e,"int",o.c.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},85977:(e,t,r)=>{r.d(t,{N5:()=>c});var i=r(49186),o=r(53966),a=r(46263),n=r(620);const s=()=>o.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class l{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){s().error("Shader module included multiple times with different configuration.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class c extends l{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new p,this.extensions=new f,this.constants=new g,this.outputs=new v}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),o="vertex"===e?this.vertex:this.fragment,a=o.uniforms.generateSource(),n=o.code.generateSource(),s="vertex"===e?x:_,l=this.constants.generateSource().concat(o.constants.generateSource()),c=this.outputs.generateSource(e);return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${a.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${c.join("\n")}\n\n${n.join("\n")}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[a.c.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[a.c.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let a=0;a<i;++a)r[a](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[a.c.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[a.c.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o,a)=>{for(let n=0;n<i;++n)r[n](e,t,o,a)}}}class d{constructor(){this._entries=new Map}add(...e){for(const t of e)this._add(t)}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 s().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(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class h extends l{constructor(){super(...arguments),this.uniforms=new d,this.code=new u,this.constants=new g}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class p{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,n.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 v{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?(0,n.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:v.DEFAULT_NAME,type:v.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}v.DEFAULT_TYPE="vec4",v.DEFAULT_NAME="fragColor";class g{constructor(){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}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",x="precision highp float;\nprecision highp sampler2D;"},63761:(e,t,r)=>{r.d(t,{N:()=>a});var i=r(39589),o=r(46263);class a extends i.n{constructor(e,t){super(e,"sampler2D",o.c.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},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:()=>a});var i=r(97768),o=r(63907);class a{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}destroy(){this._program=(0,i.WD)(this._program),this._pipeline=this._configuration=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 o.WR.TRIANGLES}getPipeline(e,t,r){return this._pipeline}initializeConfiguration(e,t){}}},99769:(e,t,r)=>{r.d(t,{K:()=>o,W:()=>a});var i=r(2597);class o extends i.Y{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}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 a(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,a=Math.ceil(Math.log2(o)),n=t._parameterBits??[0];let s=0;for(;n[s]+a>16;)s++,s>=n.length&&n.push(0);t._parameterBits=n;const l=n[s],c=(1<<a)-1<<l;n[s]+=a,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw new Error("Configuration value for "+r+" must be boolean or number, got "+typeof e)}})}}}},39341:(e,t,r)=>{r.d(t,{D:()=>o});var i=r(46540);const o=new Map([[i.r.POSITION,0],[i.r.NORMAL,1],[i.r.NORMALCOMPRESSED,1],[i.r.UV0,2],[i.r.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.INSTANCEMODEL,8],[i.r.INSTANCEMODELNORMAL,12],[i.r.INSTANCEMODELORIGINHI,11],[i.r.INSTANCEMODELORIGINLO,15]])},25634:(e,t,r)=>{r.d(t,{m:()=>l});var i=r(97768),o=r(74887),a=r(2597),n=r(89192);class s{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}get _markerTextureRepository(){return this._techniqueRepository.constructionContext.markerTextureRepository}ensureTechnique(e,t){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return n.Am.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRepository,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?n.Am.LOADED:n.Am.LOADING}get textureBindParameters(){return new c(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._textureRepository.acquire(e);if((0,o.$X)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.Gz)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends a.Y{constructor(e=null,t=null,r=null,i=null,o=null,a,n){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o,this.scale=a,this.normalTextureTransformMatrix=n}}},14903:(e,t,r)=>{r.d(t,{im:()=>h,m$:()=>i});var i,o,a=r(51850),n=r(2597),s=r(89192),l=r(69720),c=r(96672),d=r(39341),u=r(19245);class h extends l.J{constructor(e,t){super(),this.type=c.X.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._vertexAttributeLocations=d.D,this._pp0=(0,a.fA)(0,0,1),this._pp1=(0,a.fA)(0,0,0),this._parameters=(0,u.qu)(e,t),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,u.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bindParameters.decorations===s.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}isVisible(){return this._visible}parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.isVisible()&&this.parameters.renderOccluded===e}intersectDraped(e,t,r,i,o,a){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,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque",n.Y},34886:(e,t,r)=>{r.d(t,{B:()=>a});var i=r(3694),o=r(94656);class a{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,o.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.setUniform3iv(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.ANTIALIASING=12]="ANTIALIASING",e[e.COMPOSITE=13]="COMPOSITE",e[e.BLIT=14]="BLIT",e[e.SSAO=15]="SSAO",e[e.HIGHLIGHT=16]="HIGHLIGHT",e[e.SHADOW_HIGHLIGHT=17]="SHADOW_HIGHLIGHT",e[e.ENVIRONMENT_OPAQUE=18]="ENVIRONMENT_OPAQUE",e[e.ENVIRONMENT_TRANSPARENT=19]="ENVIRONMENT_TRANSPARENT",e[e.LASERLINES=20]="LASERLINES",e[e.LASERLINES_CONTRAST_CONTROL=21]="LASERLINES_CONTRAST_CONTROL",e[e.HUD_MATERIAL=22]="HUD_MATERIAL",e[e.LABEL_MATERIAL=23]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=24]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=25]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=26]="DRAPED_MATERIAL",e[e.DRAPED_WATER=27]="DRAPED_WATER",e[e.VOXEL=28]="VOXEL",e[e.MAX_SLOTS=29]="MAX_SLOTS"}(i||(i={}))},14327:(e,t,r)=>{var i;r.d(t,{y:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},19245:(e,t,r)=>{r.d(t,{Um:()=>u,qu:()=>l,MB:()=>c,kE:()=>s});var i=r(4576),o=r(34727);function a(e,t,r,i){return function(e,t){return(0,o.Cc)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}(e,function(e,t,r){const i=r.parameters;return n.scale=Math.min(i.divisor/(t-i.offset),1),n.factor=function(e){return Math.abs(e*e*e)}(e),n}(t,r,i))}r(24151),(0,o.kU)(10),(0,o.kU)(12),(0,o.kU)(70),(0,o.kU)(40);const n={scale:0,factor:0,minScaleFactor:0};function s(e,t,r,i,n){let s=(r.screenLength||0)*e.pixelRatio;null!=n&&(s=a(s,i,t,n));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.qE)(l*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function l(e,t){const r=t?l(t):{};for(const t in e){let i=e[t];i?.forEach&&(i=d(i)),null==i&&t in r||(r[t]=i)}return r}function c(e,t){let r=!1;for(const o in t){const a=t[o];void 0!==a&&(Array.isArray(a)?null===e[o]?(e[o]=a.slice(),r=!0):(0,i.yo)(e[o],a)&&(r=!0):e[o]!==a&&(r=!0,e[o]=a))}return r}function d(e){const t=[];return e.forEach((e=>t.push(e))),t}const u={multiply:1,ignore:2,replace:3,tint:4}},98494:(e,t,r)=>{var i;r.d(t,{M:()=>i}),function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(i||(i={}))},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:()=>c});var i=r(49186),o=(r(44208),r(94656)),a=r(63907),n=r(36421),s=r(67171);class l extends s.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case a.H0.R16F:case a.H0.R16I:case a.H0.R16UI:case a.H0.R32F:case a.H0.R32I:case a.H0.R32UI:case a.H0.R8_SNORM:case a.H0.R8:case a.H0.R8I:case a.H0.R8UI:this.pixelFormat=a.Ab.RED}}static validate(e,t){return new l(e,t)}}let c=class e{constructor(e,t=null,r=null){if(this.type=n.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=l.validate(e,t);if(!r)throw new i.A("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===a.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return(0,s.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(a.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===a.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=a.Ap.TEXTURE_CUBE_MAP_POSITIVE_X;t<=a.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 n=this._descriptor.context.gl;(0,o.Y2)(n),this._glName||(this._glName=n.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(a.vt.Texture,this)),void 0===t&&(t=null);const s=this._descriptor,l=r??s.target,c=f(l);null===t&&(s.width=s.width||4,s.height=s.height||4,c&&(s.depth=s.depth??1));const g=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),d(s),this._configurePixelStorage(),(0,o.Y2)(n);const _=this._deriveInternalFormat();if(p(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),s.width&&s.height,c&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,_,s.hasMipmap,e,r,i),this._texImage(l,0,_,e,r,i,t),(0,o.Y2)(n),s.hasMipmap&&this.generateMipmap(),s.width||(s.width=e),s.height||(s.height=r),c&&!s.depth&&(s.depth=i)}else{const{width:e,height:r,depth:d}=s;if(null==e||null==r)throw new i.A("Width and height must be specified!");if(c&&null==d)throw new i.A("Depth must be specified!");if(s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,_,s.hasMipmap,e,r,d),m(t)){const o=t.levels,c=v(l,e,r,d),u=Math.min(c-1,o.length-1);n.texParameteri(s.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,u);const h=_;if(!(h in a.CQ))throw new i.A("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const a=o[Math.min(e,o.length-1)];this._compressedTexImage(l,e,h,t,r,i,a)}),u)}else this._texImage(l,0,_,e,r,d,t),(0,o.Y2)(n),s.hasMipmap&&this.generateMipmap()}u(n,this._descriptor),h(n,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,o.Y2)(n),this._descriptor.context.bindTexture(g,e.TEXTURE_UNIT_FOR_UPDATES)}updateData(t,r,o,a,n,s,l=0){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const c=this._descriptor,d=this._deriveInternalFormat(),{context:u,pixelFormat:h,dataType:f,target:v,isImmutable:g}=c;if(g&&!this._wasImmutablyAllocated)throw new i.A("Cannot update immutable texture before allocation!");const _=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||o<0||a>c.width||n>c.height||r+a>c.width||o+n>c.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=u;l&&x.pixelStorei(x.UNPACK_SKIP_ROWS,l),p(s)?x.texSubImage2D(v,t,r,o,a,n,h,f,s):m(s)?x.compressedTexSubImage2D(v,t,r,o,a,n,d,s.levels[t]):x.texSubImage2D(v,t,r,o,a,n,h,f,s),l&&x.pixelStorei(x.UNPACK_SKIP_ROWS,0),u.bindTexture(_,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,o,a,n,s,l,c){c||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const d=this._descriptor,u=this._deriveInternalFormat(),{context:h,pixelFormat:p,dataType:v,isImmutable:g,target:_}=d;if(g&&!this._wasImmutablyAllocated)throw new i.A("Cannot update immutable texture before allocation!");f(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const x=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||o<0||a<0||n>d.width||s>d.height||l>d.depth||r+n>d.width||o+s>d.height||a+l>d.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=h;if(m(c))c=c.levels[t],T.compressedTexSubImage3D(_,t,r,o,a,n,s,l,u,c);else{const e=c;T.texSubImage3D(_,t,r,o,a,n,s,l,p,v,e)}h.bindTexture(x,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,d(t)}t.samplingMode===a.Cj.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=a.Cj.LINEAR_MIPMAP_NEAREST):t.samplingMode===a.Cj.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=a.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)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,d(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,t=e.context.gl;this._samplingModeDirty&&(u(t,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(h(t,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(null!=this._descriptor.internalFormat)return this._descriptor.internalFormat===a.Ab.DEPTH_STENCIL&&(this._descriptor.internalFormat=a.Ab.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case a.ld.FLOAT:switch(this._descriptor.pixelFormat){case a.Ab.RGBA:return this._descriptor.internalFormat=a.H0.RGBA32F;case a.Ab.RGB:return this._descriptor.internalFormat=a.H0.RGB32F;default:throw new i.A("Unable to derive format")}case a.ld.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case a.Ab.RGBA:return this._descriptor.internalFormat=a.H0.RGBA8;case a.Ab.RGB:return this._descriptor.internalFormat=a.H0.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===a.Ab.DEPTH_STENCIL?a.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,o,n,s){const{gl:l}=this._descriptor.context;if(!(t in a.H0))throw new i.A("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?v(e,o,n,s):1;if(f(e)){if(null==s)throw new i.A("Missing depth dimension for 3D texture upload");l.texStorage3D(e,c,t,o,n,s)}else l.texStorage2D(e,c,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,a,n,s){const l=this._descriptor.context.gl,c=f(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==n)throw new i.A("Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,o,a,n,u,h,r)}else l.texSubImage2D(e,t,0,0,o,a,u,h,r)}}else{const d=s;if(c){if(null==n)throw new i.A("Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,o,a,n,0,u,h,d)}else l.texImage2D(e,t,r,o,a,0,u,h,d)}}_compressedTexImage(e,t,r,o,a,n,s){const l=this._descriptor.context.gl,c=f(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==n)throw new i.A("Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,o,a,n,r,s)}else l.compressedTexSubImage2D(e,t,0,0,o,a,r,s)}else if(c){if(null==n)throw new i.A("Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,o,a,n,0,s)}else l.compressedTexImage2D(e,t,r,o,a,0,s)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:s,target:l}=this._descriptor;const c=l===a.Ap.TEXTURE_3D;if(null==r||null==o||c&&null==n)throw new i.A("Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),s&&(1!==r||1!==o||c&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),c&&(n=Math.max(1,n>>1))}};function d(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 u(e,t){let r=t.samplingMode,i=t.samplingMode;r===a.Cj.LINEAR_MIPMAP_NEAREST||r===a.Cj.LINEAR_MIPMAP_LINEAR?(r=a.Cj.LINEAR,t.hasMipmap||(i=a.Cj.LINEAR)):r!==a.Cj.NEAREST_MIPMAP_NEAREST&&r!==a.Cj.NEAREST_MIPMAP_LINEAR||(r=a.Cj.NEAREST,t.hasMipmap||(i=a.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 p(e){return null!=e&&!m(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function f(e){return e===a.Ap.TEXTURE_3D||e===a.Ap.TEXTURE_2D_ARRAY}function v(e,t,r,i=1){let o=Math.max(t,r);return e===a.Ap.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}c.TEXTURE_UNIT_FOR_UPDATES=0},67171:(e,t,r)=>{r.d(t,{R:()=>a,e:()=>n});var i=r(63907),o=r(42293);class a{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 n(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,o.IB)(e.internalFormat)))}},42293:(e,t,r)=>{r.d(t,{IB:()=>o}),r(44208),r(94656);var i=r(63907);function o(e){switch(e){case i.Ab.ALPHA:case i.Ab.LUMINANCE:case i.Ab.RED:case i.Ab.RED_INTEGER:case i.H0.R8:case i.H0.R8I:case i.H0.R8UI:case i.H0.R8_SNORM:case i.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:()=>c,Y2:()=>d,en:()=>l});var i=r(49186),o=r(44208),a=r(53966);const n=()=>a.A.getLogger("esri.views.webgl.checkWebGLError"),s=!!(0,o.A)("enable-feature:webgl-debug");function l(){return s}function c(){return s}function d(e){if(l()){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),o=(new Error).stack;n().error(new i.A("webgl-error","WebGL error occurred",{message:r,stack:o}))}}}},62298:(e,t,r)=>{r(63907)},90644:(e,t,r)=>{r.d(t,{Ey:()=>E,Xt:()=>c,kn:()=>d,ox:()=>a,p3:()=>n,wE:()=>u});var i=r(89192),o=r(63907);function a(e,t,r=o.Tb.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,a=o.Tb.ADD,n=o.Tb.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:a,opAlpha:n,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const s={face:o.Y7.BACK,mode:o.Ac.CCW},l={face:o.Y7.FRONT,mode:o.Ac.CCW},c=e=>e===i.s2.Back?s:e===i.s2.Front?l:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function h(e){return S.intern(e)}function m(e){return y.intern(e)}function p(e){return w.intern(e)}function f(e){return I.intern(e)}function v(e){return N.intern(e)}function g(e){return P.intern(e)}function _(e){return D.intern(e)}function x(e){return B.intern(e)}function T(e){return U.intern(e)}function E(e){return V.intern(e)}class A{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function b(e){return"["+e.join(",")+"]"}const S=new A(R,(e=>({__tag:"Blending",...e})));function R(e){return e?b([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const y=new A(M,(e=>({__tag:"Culling",...e})));function M(e){return e?b([e.face,e.mode]):null}const w=new A(C,(e=>({__tag:"PolygonOffset",...e})));function C(e){return e?b([e.factor,e.units]):null}const I=new A(O,(e=>({__tag:"DepthTest",...e})));function O(e){return e?b([e.func]):null}const N=new A(H,(e=>({__tag:"StencilTest",...e})));function H(e){return e?b([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const P=new A(L,(e=>({__tag:"DepthWrite",...e})));function L(e){return e?b([e.zNear,e.zFar]):null}const D=new A(F,(e=>({__tag:"ColorWrite",...e})));function F(e){return e?b([e.r,e.g,e.b,e.a]):null}const B=new A(G,(e=>({__tag:"StencilWrite",...e})));function G(e){return e?b([e.mask]):null}const U=new A(z,(e=>({__tag:"DrawBuffers",...e})));function z(e){return e?b(e.buffers):null}const V=new A((function(e){return e?b([R(e.blending),M(e.culling),C(e.polygonOffset),O(e.depthTest),H(e.stencilTest),L(e.depthWrite),F(e.colorWrite),G(e.stencilWrite),z(e.drawBuffers)]):null}),(e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:p(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:v(e.stencilTest),depthWrite:g(e.depthWrite),colorWrite:_(e.colorWrite),stencilWrite:x(e.stencilWrite),drawBuffers:T(e.drawBuffers)})))}}]);
|