@arcgis/core 4.33.0-next.20250311 → 4.33.0-next.20250312
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{bc988b9d3990380be907.js → 0a98dc3ea67ce97a6e7b.js} +1 -1
- package/assets/esri/core/workers/chunks/{eacab4bd6eb58e545f73.js → 11f9d7cd95891596b716.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b1b93665c93955491c4.js → 3ee2cf2db08164cde43c.js} +44 -44
- package/assets/esri/core/workers/chunks/4d95cc85f4b73e857b1f.js +1 -0
- package/assets/esri/core/workers/chunks/54ace3e4802934f3f9f2.js +1 -0
- package/assets/esri/core/workers/chunks/5820808c7659460969d4.js +1 -0
- package/assets/esri/core/workers/chunks/add0770399a63b7635b5.js +1 -0
- package/assets/esri/core/workers/chunks/b2f8702a9f54fff23ad9.js +1 -0
- package/assets/esri/core/workers/chunks/b8b8425e8b1246cdc86d.js +1 -0
- package/assets/esri/core/workers/chunks/{0137c17f15d79134b4ca.js → d0ad20548eb4786b7750.js} +36 -36
- package/assets/esri/core/workers/chunks/d0fbd4c6bffe0cb98d14.js +1 -0
- package/assets/esri/core/workers/chunks/dd6f18bbab50be139d20.js +1 -0
- package/assets/esri/core/workers/chunks/de6864e120243cf0bee8.js +1 -0
- package/assets/esri/core/workers/chunks/fc7ce48c7b31a4665a9b.js +1 -0
- package/chunks/DefaultMaterial.glsl.js +21 -21
- package/chunks/Pattern.glsl.js +23 -25
- package/chunks/RealisticTree.glsl.js +12 -12
- package/chunks/Terrain.glsl.js +27 -27
- package/core/LRUCache.js +1 -1
- package/core/MemCache.js +1 -1
- package/geometry/support/ShortArray.js +5 -0
- package/interfaces.d.ts +18 -4
- package/layers/video/VideoController.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/LabelInfo.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +63 -77
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +6 -6
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/lib/Normals.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/FocusAreas.js +1 -1
- package/views/animation/easing.js +1 -1
- package/views/support/projectionUtils.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/support/GoTo.js +1 -1
- package/widgets/support/goToUtils.js +1 -1
- package/assets/esri/core/workers/chunks/3bbf7f89bc37c01b453b.js +0 -1
- package/assets/esri/core/workers/chunks/40f2c8022fd583c43f42.js +0 -1
- package/assets/esri/core/workers/chunks/4f2bb248dd258b493663.js +0 -1
- package/assets/esri/core/workers/chunks/5295e685ae839087c568.js +0 -1
- package/assets/esri/core/workers/chunks/54b115ecf446b4095d3e.js +0 -1
- package/assets/esri/core/workers/chunks/5a536de1ecae424bad05.js +0 -1
- package/assets/esri/core/workers/chunks/7ca9230681d05ef89059.js +0 -1
- package/assets/esri/core/workers/chunks/840c02610d845114ace7.js +0 -1
- package/assets/esri/core/workers/chunks/a4228101f709f0bb9a3d.js +0 -1
- package/assets/esri/core/workers/chunks/ffd28a9b1d8db3a731f4.js +0 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +0 -5
|
@@ -40,7 +40,7 @@ outputHighlight(isHighlightOccluded());
|
|
|
40
40
|
uint levelBits = readLevelBits(highlightToAdd, highlightLevel);
|
|
41
41
|
if ((levelBits & 1u) == 0u) { discard; }
|
|
42
42
|
outputHighlight(isHighlightOccluded());
|
|
43
|
-
}`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},10764:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(31821),n=r(46540);function o(e){e.attributes.add(n.r.POSITION,"vec3"),e.vertex.code.add(i.H`vec3 positionModel() { return position; }`)}},11725:(e,t,r)=>{r.d(t,{im:()=>u,m$:()=>i});var i,n,o=r(51850),a=r(69720),s=r(96672),c=r(39341),l=r(43616),d=r(65786);class u extends a.J{constructor(e,t){super(),this.type=s.X.Material,this.supportsEdges=!1,this._renderPriority=0,this.vertexAttributeLocations=c.D,this._pp0=(0,o.fA)(0,0,1),this._pp1=(0,o.fA)(0,0,0),this._parameters=new t,(0,l.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,l.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&!!(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.visible&&this.parameters.renderOccluded===e}get hasEmissions(){return!1}intersectDraped(e,t,r,i,n,o){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,n)}}(n=i||(i={}))[n.None=0]="None",n[n.Occlude=1]="Occlude",n[n.Transparent=2]="Transparent",n[n.OccludeAndTransparent=4]="OccludeAndTransparent",n[n.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",n[n.Opaque=16]="Opaque",d.Y},11787:(e,t,r)=>{r.d(t,{$U:()=>re});var i=r(38954),n=r(51850),o=r(24151),a=r(1843),s=r(49255),c=r(96336),l=r(22911),d=r(62602),u=r(59469),h=r(16943),m=r(89192),f=r(25634),p=r(11725),v=r(33524),g=r(70328),_=r(96672),T=r(620),x=r(46540);class A{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const b=(0,g.vt)();function E(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(F,n,r),c=(e,t,r)=>{a(e,r,t,!1)},l=new A(!1,t.options.normalRequired);if(e.boundingInfo){(0,T.vA)(e.type===_.X.Mesh);const i=t.tolerance;M(e.boundingInfo,r,s,i,o,l,c)}else{const t=e.attributes.get(x.r.POSITION),n=t.indices;!function(e,t,r,n,o,a,s,c,l,d){const u=t,h=B,m=Math.abs(u[0]),f=Math.abs(u[1]),p=Math.abs(u[2]),v=m>=f?m>=p?0:2:f>=p?1:2,g=v,_=u[g]<0?2:1,T=(v+_)%3,x=(v+(3-_))%3,A=u[T]/u[g],b=u[x]/u[g],E=1/u[g],S=w,M=I,C=O,{normalRequired:R}=l;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.i)(h[0],a[n+0],a[n+1],a[n+2]);const l=s*o[r+1];(0,i.i)(h[1],a[l+0],a[l+1],a[l+2]);const u=s*o[r+2];(0,i.i)(h[2],a[u+0],a[u+1],a[u+2]),c&&((0,i.c)(h[0],c.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],c.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],c.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(S,h[0],e),(0,i.a)(M,h[1],e),(0,i.a)(C,h[2],e);const m=S[T]-A*S[g],f=S[x]-b*S[g],p=M[T]-A*M[g],v=M[x]-b*M[g],_=C[T]-A*C[g],w=C[x]-b*C[g],I=_*v-w*p,O=m*w-f*_,y=p*f-v*m;if((I<0||O<0||y<0)&&(I>0||O>0||y>0))continue;const P=I+O+y;if(0===P)continue;const L=I*(E*S[g])+O*(E*M[g])+y*(E*C[g]);if(L*Math.sign(P)<0)continue;const D=L/P;D>=0&&d(D,t,R?N(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,l,c)}}const S=(0,n.vt)();function M(e,t,r,n,o,a,s){if(null==e)return;const c=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,S);if((0,g.Ne)(b,e.bbMin),(0,g.vI)(b,e.bbMax),null!=o&&o.applyToAabb(b),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const c=(e[1]-i-t[1])*r[1],l=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(c,l)),s<0)return!1;if(a=Math.max(a,Math.min(c,l)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(b,t,c,n)){const{primitiveIndices:i,position:c}=e,l=i?i.length:c.indices.length/3;if(l>D){const i=e.getChildren();if(void 0!==i){for(const e of i)M(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,c,l,d){const u=e[0],h=e[1],m=e[2],f=t[0],p=t[1],v=t[2],{normalRequired:g}=l;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let l=o[i],_=o[i+1],T=o[i+2];const x=a*n[r+1];let A=o[x],b=o[x+1],E=o[x+2];const S=a*n[r+2];let M=o[S],R=o[S+1],w=o[S+2];null!=c&&([l,_,T]=c.applyToVertex(l,_,T,e),[A,b,E]=c.applyToVertex(A,b,E,e),[M,R,w]=c.applyToVertex(M,R,w,e));const I=A-l,O=b-_,N=E-T,P=M-l,L=R-_,D=w-T,F=p*D-L*v,B=v*P-D*f,U=f*L-P*p,G=I*F+O*B+N*U;if(Math.abs(G)<=H)continue;const z=u-l,V=h-_,W=m-T,j=z*F+V*B+W*U;if(G>0){if(j<0||j>G)continue}else if(j>0||j<G)continue;const k=V*N-O*W,Y=W*I-N*z,q=z*O-I*V,X=f*k+p*Y+v*q;if(G>0){if(X<0||j+X>G)continue}else if(X>0||j+X<G)continue;const $=(P*k+L*Y+D*q)/G;$>=0&&d($,t,g?y(I,O,N,P,L,D,C):null)}}(t,r,0,l,c.indices,c.data,c.stride,i,o,a,s)}}const C=(0,n.vt)();function R(e,t,r,i,n,o,a,s){const c=e[0],l=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,f=o*t,p=n[f],v=n[f+1],g=n[f+2],_=o*r,T=o*i,x=n[_]-p,A=n[_+1]-v,b=n[_+2]-g,E=n[T]-p,S=n[T+1]-v,M=n[T+2]-g,R=h*M-S*m,w=m*E-M*u,I=u*S-E*h,O=x*R+A*w+b*I;if(Math.abs(O)<=H)continue;const N=c-p,P=l-v,L=d-g,D=N*R+P*w+L*I;if(O>0){if(D<0||D>O)continue}else if(D>0||D<O)continue;const F=P*b-A*L,B=L*x-b*N,U=N*A-x*P,G=u*F+h*B+m*U;if(O>0){if(G<0||D+G>O)continue}else if(G>0||D+G<O)continue;const z=(E*F+S*B+M*U)/O;z>=0&&s(z,e,a?y(x,A,b,E,S,M,C):null)}}const w=(0,n.vt)(),I=(0,n.vt)(),O=(0,n.vt)();function y(e,t,r,n,o,a,s){return(0,i.i)(P,e,t,r),(0,i.i)(L,n,o,a),(0,i.e)(s,P,L),(0,i.n)(s,s),s}function N(e){return(0,i.a)(P,e[1],e[0]),(0,i.a)(L,e[2],e[0]),(0,i.e)(C,P,L),(0,i.n)(C,C),C}const P=(0,n.vt)(),L=(0,n.vt)(),D=1e3,H=1e-7,F=(0,n.vt)(),B=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var U=r(13464),G=r(16396),z=r(13030),V=r(59907);class W{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get(x.r.POSITION).indices.length}write(e,t,r,i,n,o){return(0,V.SA)(r,i,this.vertexBufferLayout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const c=this.vertexBufferLayout.createView(e).getField(x.r.POSITION,z.xs);if(null==c)return;const l=(0,i.a)(j,a,o),d=c.count/3,u=n.options.normalRequired;R(o,l,0,d,c.typedBuffer,c.typedBufferStride,u,((e,t,r)=>{s(e,r,t,!1)}))}}const j=(0,n.vt)();var k=r(43616),Y=r(97225),q=r(90237),X=r(53466),$=r(51976),Z=r(35256);class J extends Z.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=m.sf.Opaque,this.doubleSidedMode=d.W.None,this.pbrMode=u.A9.Disabled,this.cullFace=m.s2.None,this.normalType=c.W.Attribute,this.customDepthTest=m.it.Less,this.emissionSource=l.ZX.None,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.hasVvInstancing=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0}get textureCoordinateType(){return this.hasColorTexture||this.hasMetallicRoughnessTexture||this.emissionSource===l.ZX.Texture||this.hasOcclusionTexture||this.hasNormalTexture?X.I.Default:X.I.None}get objectAndLayerIdColorInstanced(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,q._)([(0,$.W)({count:m.sf.COUNT})],J.prototype,"alphaDiscardMode",void 0),(0,q._)([(0,$.W)({count:d.W.COUNT})],J.prototype,"doubleSidedMode",void 0),(0,q._)([(0,$.W)({count:u.A9.COUNT})],J.prototype,"pbrMode",void 0),(0,q._)([(0,$.W)({count:m.s2.COUNT})],J.prototype,"cullFace",void 0),(0,q._)([(0,$.W)({count:c.W.COUNT})],J.prototype,"normalType",void 0),(0,q._)([(0,$.W)({count:m.it.COUNT})],J.prototype,"customDepthTest",void 0),(0,q._)([(0,$.W)({count:l.ZX.COUNT})],J.prototype,"emissionSource",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasVertexColors",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasSymbolColors",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasVerticalOffset",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasColorTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasMetallicRoughnessTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasOcclusionTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasNormalTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasScreenSizePerspective",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasVertexTangents",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasOccludees",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasModelTransformation",void 0),(0,q._)([(0,$.W)()],J.prototype,"offsetBackfaces",void 0),(0,q._)([(0,$.W)()],J.prototype,"vvSize",void 0),(0,q._)([(0,$.W)()],J.prototype,"vvColor",void 0),(0,q._)([(0,$.W)()],J.prototype,"receiveShadows",void 0),(0,q._)([(0,$.W)()],J.prototype,"receiveAmbientOcclusion",void 0),(0,q._)([(0,$.W)()],J.prototype,"textureAlphaPremultiplied",void 0),(0,q._)([(0,$.W)()],J.prototype,"instanced",void 0),(0,q._)([(0,$.W)()],J.prototype,"instancedColor",void 0),(0,q._)([(0,$.W)()],J.prototype,"writeDepth",void 0),(0,q._)([(0,$.W)()],J.prototype,"transparent",void 0),(0,q._)([(0,$.W)()],J.prototype,"enableOffset",void 0),(0,q._)([(0,$.W)()],J.prototype,"terrainDepthTest",void 0),(0,q._)([(0,$.W)()],J.prototype,"cullAboveTerrain",void 0),(0,q._)([(0,$.W)()],J.prototype,"snowCover",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasColorTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasEmissionTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasNormalTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasOcclusionTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasMetallicRoughnessTextureTransform",void 0);var K=r(97220),Q=r(57323);class ee extends Y.R5{constructor(e,t){super(e,t,new K.$(Q.R,(()=>r.e(9933).then(r.bind(r,39933))))),this.type="RealisticTreeTechnique"}}var te=r(49788);class re extends p.im{constructor(e,t){super(e,ne),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[U.N.OPAQUE_MATERIAL,e=>((0,s.iq)(e)||(0,s.PJ)(e))&&!this.transparent],[U.N.TRANSPARENT_MATERIAL,e=>((0,s.iq)(e)||(0,s.PJ)(e))&&this.transparent&&this.parameters.writeDepth],[U.N.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>((0,s.XY)(e)||(0,s.PJ)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,a.BP)().vec3f(x.r.POSITION);return e.normalType===c.W.Compressed?t.vec2i16(x.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(x.r.NORMAL),e.hasVertexTangents&&t.vec4f(x.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(x.r.UV0),e.hasVertexColors&&t.vec4u8(x.r.COLOR),e.hasSymbolColors&&t.vec4u8(x.r.SYMBOLCOLOR),(0,h.E)()&&t.vec4u8(x.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters),this._configuration=new J(t.spherical)}isVisibleForOutput(e){return e!==s.V.Shadow&&e!==s.V.ShadowExcludeHighlight&&e!==s.V.ShadowHighlight||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t?1:i[3])>=te.Q}get hasEmissions(){return!!this.parameters.emissiveTextureId||!(0,i.p)(this.parameters.emissiveFactor,n.uY)}getConfiguration(e,t){const r=this.parameters,{treeRendering:i,doubleSided:n,doubleSidedType:o}=r;return this._configuration.output=e,this._configuration.hasNormalTexture=!i&&!!r.normalTextureId,this._configuration.hasColorTexture=!!r.textureId,this._configuration.hasVertexTangents=!i&&r.hasVertexTangents,this._configuration.instanced=r.isInstanced,this._configuration.instancedDoublePrecision=r.instancedDoublePrecision,this._configuration.vvSize=!!r.vvSize,this._configuration.hasVerticalOffset=null!=r.verticalOffset,this._configuration.hasScreenSizePerspective=null!=r.screenSizePerspective,this._configuration.hasSlicePlane=r.hasSlicePlane,this._configuration.alphaDiscardMode=r.textureAlphaMode,this._configuration.normalType=i?c.W.Attribute:r.normalType,this._configuration.transparent=this.transparent,this._configuration.writeDepth=r.writeDepth,null!=r.customDepthTest&&(this._configuration.customDepthTest=r.customDepthTest),this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=r.hasSlicePlane?m.s2.None:r.cullFace,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.hasModelTransformation=!i&&null!=r.modelTransformation,this._configuration.hasVertexColors=r.hasVertexColors,this._configuration.hasSymbolColors=r.hasSymbolColors,this._configuration.doubleSidedMode=i?d.W.WindingOrder:n&&"normal"===o?d.W.View:n&&"winding-order"===o?d.W.WindingOrder:d.W.None,this._configuration.instancedColor=r.hasInstancedColor,(0,s.RN)(e)?(this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.receiveShadows=r.receiveShadows,this._configuration.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(this._configuration.terrainDepthTest=!1,this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1),this._configuration.vvColor=!!r.vvColor,this._configuration.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,this._configuration.pbrMode=r.usePBR?r.isSchematic?u.A9.Schematic:u.A9.Normal:u.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!i&&!!r.metallicRoughnessTextureId,this._configuration.emissionSource=i?l.ZX.None:null!=r.emissiveTextureId?l.ZX.Texture:r.usePBR?l.ZX.Value:l.ZX.None,this._configuration.hasOcclusionTexture=!i&&!!r.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),this._configuration.oitPass=t.oitPass,this._configuration.enableOffset=t.camera.relativeElevation<v.xt,this._configuration.snowCover=function(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}(t),this._configuration.hasColorTextureTransform=!!r.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,this._configuration}intersect(e,t,r,n,a,s){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(de,t[12],t[13],t[14]);let s=null;switch(r.viewingMode){case o.RT.Global:s=(0,i.n)(ce,de);break;case o.RT.Local:s=(0,i.c)(ce,se)}let c=0;const l=(0,i.d)(ue,de,e.eye),d=(0,i.l)(l),u=(0,i.h)(l,l,1/d);let h=null;this.parameters.screenSizePerspective&&(h=(0,i.f)(s,u)),c+=(0,k.kE)(e,d,this.parameters.verticalOffset,h??0,this.parameters.screenSizePerspective),(0,i.h)(s,s,c),(0,i.q)(le,s,r.transform.inverseRotation),n=(0,i.d)(oe,n,le),a=(0,i.d)(ae,a,le)}E(e,r,n,a,(0,G.ou)(r.verticalOffset),s)}createGLMaterial(e){return new ie(e)}createBufferWriter(){return new W(this._vertexBufferLayout)}get transparent(){const{parameters:{drivenOpacity:e,opacity:t,externalColor:[r,i,n,o],layerOpacity:a,texture:s,textureId:c,textureAlphaMode:l,colorMixMode:d}}=this;return e||t<1&&"replace"!==d||o<1&&"ignore"!==d||a<1||(null!=s||null!=c)&&l!==m.sf.Opaque&&l!==m.sf.Mask&&"replace"!==d}}class ie extends f.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.i)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?ee:Y.R5,e)}}class ne extends Y.uD{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}}const oe=(0,n.vt)(),ae=(0,n.vt)(),se=(0,n.fA)(0,0,1),ce=(0,n.vt)(),le=(0,n.vt)(),de=(0,n.vt)(),ue=(0,n.vt)()},11955:(e,t,r)=>{r.d(t,{S:()=>s}),r(69270),r(74333).n;var i=r(20304),n=r(31821),o=r(89192),a=r(49788);function s(e,t){!function(e,t,r){const i=e.fragment,s=t.alphaDiscardMode,c=s===o.sf.Blend;s!==o.sf.Mask&&s!==o.sf.MaskBlend||i.uniforms.add(r),i.code.add(n.H`
|
|
43
|
+
}`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},11725:(e,t,r)=>{r.d(t,{im:()=>u,m$:()=>i});var i,n,o=r(51850),a=r(69720),s=r(96672),c=r(39341),l=r(43616),d=r(65786);class u extends a.J{constructor(e,t){super(),this.type=s.X.Material,this.supportsEdges=!1,this._renderPriority=0,this.vertexAttributeLocations=c.D,this._pp0=(0,o.fA)(0,0,1),this._pp1=(0,o.fA)(0,0,0),this._parameters=new t,(0,l.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,l.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&!!(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.visible&&this.parameters.renderOccluded===e}get hasEmissions(){return!1}intersectDraped(e,t,r,i,n,o){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,n)}}(n=i||(i={}))[n.None=0]="None",n[n.Occlude=1]="Occlude",n[n.Transparent=2]="Transparent",n[n.OccludeAndTransparent=4]="OccludeAndTransparent",n[n.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",n[n.Opaque=16]="Opaque",d.Y},11787:(e,t,r)=>{r.d(t,{$U:()=>re});var i=r(38954),n=r(51850),o=r(24151),a=r(1843),s=r(49255),c=r(96336),l=r(22911),d=r(62602),u=r(59469),h=r(16943),m=r(89192),f=r(25634),p=r(11725),v=r(33524),g=r(70328),_=r(96672),T=r(620),x=r(46540);class A{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const b=(0,g.vt)();function E(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(F,n,r),c=(e,t,r)=>{a(e,r,t,!1)},l=new A(!1,t.options.normalRequired);if(e.boundingInfo){(0,T.vA)(e.type===_.X.Mesh);const i=t.tolerance;M(e.boundingInfo,r,s,i,o,l,c)}else{const t=e.attributes.get(x.r.POSITION),n=t.indices;!function(e,t,r,n,o,a,s,c,l,d){const u=t,h=B,m=Math.abs(u[0]),f=Math.abs(u[1]),p=Math.abs(u[2]),v=m>=f?m>=p?0:2:f>=p?1:2,g=v,_=u[g]<0?2:1,T=(v+_)%3,x=(v+(3-_))%3,A=u[T]/u[g],b=u[x]/u[g],E=1/u[g],S=w,M=I,C=O,{normalRequired:R}=l;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.i)(h[0],a[n+0],a[n+1],a[n+2]);const l=s*o[r+1];(0,i.i)(h[1],a[l+0],a[l+1],a[l+2]);const u=s*o[r+2];(0,i.i)(h[2],a[u+0],a[u+1],a[u+2]),c&&((0,i.c)(h[0],c.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],c.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],c.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(S,h[0],e),(0,i.a)(M,h[1],e),(0,i.a)(C,h[2],e);const m=S[T]-A*S[g],f=S[x]-b*S[g],p=M[T]-A*M[g],v=M[x]-b*M[g],_=C[T]-A*C[g],w=C[x]-b*C[g],I=_*v-w*p,O=m*w-f*_,y=p*f-v*m;if((I<0||O<0||y<0)&&(I>0||O>0||y>0))continue;const P=I+O+y;if(0===P)continue;const L=I*(E*S[g])+O*(E*M[g])+y*(E*C[g]);if(L*Math.sign(P)<0)continue;const D=L/P;D>=0&&d(D,t,R?N(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,l,c)}}const S=(0,n.vt)();function M(e,t,r,n,o,a,s){if(null==e)return;const c=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,S);if((0,g.Ne)(b,e.bbMin),(0,g.vI)(b,e.bbMax),null!=o&&o.applyToAabb(b),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const c=(e[1]-i-t[1])*r[1],l=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(c,l)),s<0)return!1;if(a=Math.max(a,Math.min(c,l)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(b,t,c,n)){const{primitiveIndices:i,position:c}=e,l=i?i.length:c.indices.length/3;if(l>D){const i=e.getChildren();if(void 0!==i){for(const e of i)M(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,c,l,d){const u=e[0],h=e[1],m=e[2],f=t[0],p=t[1],v=t[2],{normalRequired:g}=l;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let l=o[i],_=o[i+1],T=o[i+2];const x=a*n[r+1];let A=o[x],b=o[x+1],E=o[x+2];const S=a*n[r+2];let M=o[S],R=o[S+1],w=o[S+2];null!=c&&([l,_,T]=c.applyToVertex(l,_,T,e),[A,b,E]=c.applyToVertex(A,b,E,e),[M,R,w]=c.applyToVertex(M,R,w,e));const I=A-l,O=b-_,N=E-T,P=M-l,L=R-_,D=w-T,F=p*D-L*v,B=v*P-D*f,U=f*L-P*p,G=I*F+O*B+N*U;if(Math.abs(G)<=H)continue;const z=u-l,V=h-_,W=m-T,j=z*F+V*B+W*U;if(G>0){if(j<0||j>G)continue}else if(j>0||j<G)continue;const k=V*N-O*W,Y=W*I-N*z,q=z*O-I*V,X=f*k+p*Y+v*q;if(G>0){if(X<0||j+X>G)continue}else if(X>0||j+X<G)continue;const $=(P*k+L*Y+D*q)/G;$>=0&&d($,t,g?y(I,O,N,P,L,D,C):null)}}(t,r,0,l,c.indices,c.data,c.stride,i,o,a,s)}}const C=(0,n.vt)();function R(e,t,r,i,n,o,a,s){const c=e[0],l=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,f=o*t,p=n[f],v=n[f+1],g=n[f+2],_=o*r,T=o*i,x=n[_]-p,A=n[_+1]-v,b=n[_+2]-g,E=n[T]-p,S=n[T+1]-v,M=n[T+2]-g,R=h*M-S*m,w=m*E-M*u,I=u*S-E*h,O=x*R+A*w+b*I;if(Math.abs(O)<=H)continue;const N=c-p,P=l-v,L=d-g,D=N*R+P*w+L*I;if(O>0){if(D<0||D>O)continue}else if(D>0||D<O)continue;const F=P*b-A*L,B=L*x-b*N,U=N*A-x*P,G=u*F+h*B+m*U;if(O>0){if(G<0||D+G>O)continue}else if(G>0||D+G<O)continue;const z=(E*F+S*B+M*U)/O;z>=0&&s(z,e,a?y(x,A,b,E,S,M,C):null)}}const w=(0,n.vt)(),I=(0,n.vt)(),O=(0,n.vt)();function y(e,t,r,n,o,a,s){return(0,i.i)(P,e,t,r),(0,i.i)(L,n,o,a),(0,i.e)(s,P,L),(0,i.n)(s,s),s}function N(e){return(0,i.a)(P,e[1],e[0]),(0,i.a)(L,e[2],e[0]),(0,i.e)(C,P,L),(0,i.n)(C,C),C}const P=(0,n.vt)(),L=(0,n.vt)(),D=1e3,H=1e-7,F=(0,n.vt)(),B=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var U=r(13464),G=r(16396),z=r(13030),V=r(59907);class W{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get(x.r.POSITION).indices.length}write(e,t,r,i,n,o){return(0,V.SA)(r,i,this.vertexBufferLayout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const c=this.vertexBufferLayout.createView(e).getField(x.r.POSITION,z.xs);if(null==c)return;const l=(0,i.a)(j,a,o),d=c.count/3,u=n.options.normalRequired;R(o,l,0,d,c.typedBuffer,c.typedBufferStride,u,((e,t,r)=>{s(e,r,t,!1)}))}}const j=(0,n.vt)();var k=r(43616),Y=r(97225),q=r(90237),X=r(53466),$=r(51976),Z=r(35256);class J extends Z.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=m.sf.Opaque,this.doubleSidedMode=d.W.None,this.pbrMode=u.A9.Disabled,this.cullFace=m.s2.None,this.normalType=c.W.Attribute,this.customDepthTest=m.it.Less,this.emissionSource=l.ZX.None,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.hasVvInstancing=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0}get textureCoordinateType(){return this.hasColorTexture||this.hasMetallicRoughnessTexture||this.emissionSource===l.ZX.Texture||this.hasOcclusionTexture||this.hasNormalTexture?X.I.Default:X.I.None}get objectAndLayerIdColorInstanced(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,q._)([(0,$.W)({count:m.sf.COUNT})],J.prototype,"alphaDiscardMode",void 0),(0,q._)([(0,$.W)({count:d.W.COUNT})],J.prototype,"doubleSidedMode",void 0),(0,q._)([(0,$.W)({count:u.A9.COUNT})],J.prototype,"pbrMode",void 0),(0,q._)([(0,$.W)({count:m.s2.COUNT})],J.prototype,"cullFace",void 0),(0,q._)([(0,$.W)({count:c.W.COUNT})],J.prototype,"normalType",void 0),(0,q._)([(0,$.W)({count:m.it.COUNT})],J.prototype,"customDepthTest",void 0),(0,q._)([(0,$.W)({count:l.ZX.COUNT})],J.prototype,"emissionSource",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasVertexColors",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasSymbolColors",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasVerticalOffset",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasColorTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasMetallicRoughnessTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasOcclusionTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasNormalTexture",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasScreenSizePerspective",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasVertexTangents",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasOccludees",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasModelTransformation",void 0),(0,q._)([(0,$.W)()],J.prototype,"offsetBackfaces",void 0),(0,q._)([(0,$.W)()],J.prototype,"vvSize",void 0),(0,q._)([(0,$.W)()],J.prototype,"vvColor",void 0),(0,q._)([(0,$.W)()],J.prototype,"receiveShadows",void 0),(0,q._)([(0,$.W)()],J.prototype,"receiveAmbientOcclusion",void 0),(0,q._)([(0,$.W)()],J.prototype,"textureAlphaPremultiplied",void 0),(0,q._)([(0,$.W)()],J.prototype,"instanced",void 0),(0,q._)([(0,$.W)()],J.prototype,"instancedColor",void 0),(0,q._)([(0,$.W)()],J.prototype,"writeDepth",void 0),(0,q._)([(0,$.W)()],J.prototype,"transparent",void 0),(0,q._)([(0,$.W)()],J.prototype,"enableOffset",void 0),(0,q._)([(0,$.W)()],J.prototype,"terrainDepthTest",void 0),(0,q._)([(0,$.W)()],J.prototype,"cullAboveTerrain",void 0),(0,q._)([(0,$.W)()],J.prototype,"snowCover",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasColorTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasEmissionTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasNormalTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasOcclusionTextureTransform",void 0),(0,q._)([(0,$.W)()],J.prototype,"hasMetallicRoughnessTextureTransform",void 0);var K=r(97220),Q=r(57323);class ee extends Y.R5{constructor(e,t){super(e,t,new K.$(Q.R,(()=>r.e(9933).then(r.bind(r,39933))))),this.type="RealisticTreeTechnique"}}var te=r(49788);class re extends p.im{constructor(e,t){super(e,ne),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[U.N.OPAQUE_MATERIAL,e=>((0,s.iq)(e)||(0,s.PJ)(e))&&!this.transparent],[U.N.TRANSPARENT_MATERIAL,e=>((0,s.iq)(e)||(0,s.PJ)(e))&&this.transparent&&this.parameters.writeDepth],[U.N.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>((0,s.XY)(e)||(0,s.PJ)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,a.BP)().vec3f(x.r.POSITION);return e.normalType===c.W.Compressed?t.vec2i16(x.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(x.r.NORMAL),e.hasVertexTangents&&t.vec4f(x.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(x.r.UV0),e.hasVertexColors&&t.vec4u8(x.r.COLOR),e.hasSymbolColors&&t.vec4u8(x.r.SYMBOLCOLOR),(0,h.E)()&&t.vec4u8(x.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters),this._configuration=new J(t.spherical)}isVisibleForOutput(e){return e!==s.V.Shadow&&e!==s.V.ShadowExcludeHighlight&&e!==s.V.ShadowHighlight||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t?1:i[3])>=te.Q}get hasEmissions(){return!!this.parameters.emissiveTextureId||!(0,i.p)(this.parameters.emissiveFactor,n.uY)}getConfiguration(e,t){const r=this.parameters,{treeRendering:i,doubleSided:n,doubleSidedType:o}=r;return this._configuration.output=e,this._configuration.hasNormalTexture=!i&&!!r.normalTextureId,this._configuration.hasColorTexture=!!r.textureId,this._configuration.hasVertexTangents=!i&&r.hasVertexTangents,this._configuration.instanced=r.isInstanced,this._configuration.instancedDoublePrecision=r.instancedDoublePrecision,this._configuration.vvSize=!!r.vvSize,this._configuration.hasVerticalOffset=null!=r.verticalOffset,this._configuration.hasScreenSizePerspective=null!=r.screenSizePerspective,this._configuration.hasSlicePlane=r.hasSlicePlane,this._configuration.alphaDiscardMode=r.textureAlphaMode,this._configuration.normalType=i?c.W.Attribute:r.normalType,this._configuration.transparent=this.transparent,this._configuration.writeDepth=r.writeDepth,null!=r.customDepthTest&&(this._configuration.customDepthTest=r.customDepthTest),this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=r.hasSlicePlane?m.s2.None:r.cullFace,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.hasModelTransformation=!i&&null!=r.modelTransformation,this._configuration.hasVertexColors=r.hasVertexColors,this._configuration.hasSymbolColors=r.hasSymbolColors,this._configuration.doubleSidedMode=i?d.W.WindingOrder:n&&"normal"===o?d.W.View:n&&"winding-order"===o?d.W.WindingOrder:d.W.None,this._configuration.instancedColor=r.hasInstancedColor,(0,s.RN)(e)?(this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.receiveShadows=r.receiveShadows,this._configuration.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(this._configuration.terrainDepthTest=!1,this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1),this._configuration.vvColor=!!r.vvColor,this._configuration.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,this._configuration.pbrMode=r.usePBR?r.isSchematic?u.A9.Schematic:u.A9.Normal:u.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!i&&!!r.metallicRoughnessTextureId,this._configuration.emissionSource=i?l.ZX.None:null!=r.emissiveTextureId?l.ZX.Texture:r.usePBR?l.ZX.Value:l.ZX.None,this._configuration.hasOcclusionTexture=!i&&!!r.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),this._configuration.oitPass=t.oitPass,this._configuration.enableOffset=t.camera.relativeElevation<v.xt,this._configuration.snowCover=function(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}(t),this._configuration.hasColorTextureTransform=!!r.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,this._configuration}intersect(e,t,r,n,a,s){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(de,t[12],t[13],t[14]);let s=null;switch(r.viewingMode){case o.RT.Global:s=(0,i.n)(ce,de);break;case o.RT.Local:s=(0,i.c)(ce,se)}let c=0;const l=(0,i.d)(ue,de,e.eye),d=(0,i.l)(l),u=(0,i.h)(l,l,1/d);let h=null;this.parameters.screenSizePerspective&&(h=(0,i.f)(s,u)),c+=(0,k.kE)(e,d,this.parameters.verticalOffset,h??0,this.parameters.screenSizePerspective),(0,i.h)(s,s,c),(0,i.q)(le,s,r.transform.inverseRotation),n=(0,i.d)(oe,n,le),a=(0,i.d)(ae,a,le)}E(e,r,n,a,(0,G.ou)(r.verticalOffset),s)}createGLMaterial(e){return new ie(e)}createBufferWriter(){return new W(this._vertexBufferLayout)}get transparent(){const{parameters:{drivenOpacity:e,opacity:t,externalColor:[r,i,n,o],layerOpacity:a,texture:s,textureId:c,textureAlphaMode:l,colorMixMode:d}}=this;return e||t<1&&"replace"!==d||o<1&&"ignore"!==d||a<1||(null!=s||null!=c)&&l!==m.sf.Opaque&&l!==m.sf.Mask&&"replace"!==d}}class ie extends f.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.i)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?ee:Y.R5,e)}}class ne extends Y.uD{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}}const oe=(0,n.vt)(),ae=(0,n.vt)(),se=(0,n.fA)(0,0,1),ce=(0,n.vt)(),le=(0,n.vt)(),de=(0,n.vt)(),ue=(0,n.vt)()},11955:(e,t,r)=>{r.d(t,{S:()=>s}),r(69270),r(74333).n;var i=r(20304),n=r(31821),o=r(89192),a=r(49788);function s(e,t){!function(e,t,r){const i=e.fragment,s=t.alphaDiscardMode,c=s===o.sf.Blend;s!==o.sf.Mask&&s!==o.sf.MaskBlend||i.uniforms.add(r),i.code.add(n.H`
|
|
44
44
|
void discardOrAdjustAlpha(inout vec4 color) {
|
|
45
45
|
${s===o.sf.Opaque?"color.a = 1.0;":`if (color.a < ${c?n.H.float(a.Q):"textureAlphaCutoff"}) {\n discard;\n } ${(0,n.If)(s===o.sf.Mask,"else { color.a = 1.0; }")}`}
|
|
46
46
|
}
|
|
@@ -271,10 +271,10 @@ return filterShadow(uv, lvpos, size, shadowMap);
|
|
|
271
271
|
// multiply or tint (or something invalid)
|
|
272
272
|
return allMixed;
|
|
273
273
|
}
|
|
274
|
-
`)}},28449:(e,t,r)=>{function i(e,t,r){for(let i=0;i<r;++i)t[2*i]=e[i],t[2*i+1]=e[i]-t[2*i]}function n(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],t[i]=a[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],a[1]=e[i]-a[0],t[i]=a[1];return t}r.d(t,{Zo:()=>n,jA:()=>o,jS:()=>i});const a=new Float32Array(2)},28491:(e,t,r)=>{r.d(t,{D:()=>
|
|
274
|
+
`)}},28449:(e,t,r)=>{function i(e,t,r){for(let i=0;i<r;++i)t[2*i]=e[i],t[2*i+1]=e[i]-t[2*i]}function n(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],t[i]=a[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],a[1]=e[i]-a[0],t[i]=a[1];return t}r.d(t,{Zo:()=>n,jA:()=>o,jS:()=>i});const a=new Float32Array(2)},28491:(e,t,r)=>{r.d(t,{D:()=>z,b:()=>G});var i=r(91829),n=r(46686),o=r(32680),a=r(49255),s=r(76591),c=r(76597),l=r(82991),d=r(96336),u=r(71955),h=r(53466),m=r(92700),f=r(72824),p=r(35640),v=r(40261),g=r(77695),_=r(54849),T=r(74081),x=r(98619),A=r(62602),b=r(22393),E=r(59469),S=r(25618),M=r(96598),C=r(51406),R=r(42398),w=r(11955),I=r(27950),O=r(20693),y=r(33079),N=r(71988),P=r(20304),L=r(31821),D=r(63761),H=r(46540),F=r(60517),B=r(14113),U=r(49788);function G(e){const t=new B.N5,{attributes:r,vertex:G,fragment:z,varyings:V}=t,{output:W,normalType:j,offsetBackfaces:k,instancedColor:Y,spherical:q,receiveShadows:X,snowCover:$,pbrMode:Z,textureAlphaPremultiplied:J,instancedDoublePrecision:K,hasVertexColors:Q,hasVertexTangents:ee,hasColorTexture:te,hasNormalTexture:re,hasNormalTextureTransform:ie,hasColorTextureTransform:ne}=e;if((0,O.NB)(G,e),r.add(H.r.POSITION,"vec3"),V.add("vpos","vec3",{invariant:!0}),t.include(R.A,e),t.include(l.B,e),t.include(p.G,e),t.include(C.q2,e),!(0,a.RN)(W))return t.include(v.E,e),t;t.include(C.Sx,e),t.include(C.MU,e),t.include(C.O1,e),t.include(C.QM,e),(0,O.yu)(G,e),t.include(d.Y,e),t.include(c.d,e);const oe=j===d.W.Attribute||j===d.W.Compressed;return oe&&k&&t.include(o.M),t.include(g.W,e),t.include(f.Mh,e),Y&&t.attributes.add(H.r.INSTANCECOLOR,"vec4"),V.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(n.oD,e),t.include(u.K,e),t.include(m.c,e),G.uniforms.add(new N.E("externalColor",(e=>"ignore"===e.colorMixMode?i.Un:e.externalColor))),V.add("vcolorExt","vec4"),t.include(M.Z,e),G.main.add(L.H`
|
|
275
275
|
forwardNormalizedVertexColor();
|
|
276
276
|
vcolorExt = externalColor;
|
|
277
|
-
${(0,
|
|
277
|
+
${(0,L.If)(Y,"vcolorExt *= instanceColor * 0.003921568627451;")}
|
|
278
278
|
vcolorExt *= vvColor();
|
|
279
279
|
vcolorExt *= getSymbolColor();
|
|
280
280
|
forwardColorMixMode();
|
|
@@ -282,11 +282,11 @@ return filterShadow(uv, lvpos, size, shadowMap);
|
|
|
282
282
|
vpos = getVertexInLocalOriginSpace();
|
|
283
283
|
vPositionLocal = vpos - view[3].xyz;
|
|
284
284
|
vpos = subtractOrigin(vpos);
|
|
285
|
-
${(0,
|
|
285
|
+
${(0,L.If)(oe,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
|
|
286
286
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
287
|
-
${(0,
|
|
287
|
+
${(0,L.If)(ee,"vTangent = dpTransformVertexTangent(tangent);")}
|
|
288
288
|
gl_Position = transformPosition(proj, view, vpos);
|
|
289
|
-
${(0,
|
|
289
|
+
${(0,L.If)(oe&&k,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
|
|
290
290
|
|
|
291
291
|
forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
|
|
292
292
|
forwardLinearDepth();
|
|
@@ -297,18 +297,18 @@ return filterShadow(uv, lvpos, size, shadowMap);
|
|
|
297
297
|
forwardOcclusionUV();
|
|
298
298
|
forwardMetallicRoughnessUV();
|
|
299
299
|
|
|
300
|
-
if (vcolorExt.a < ${
|
|
300
|
+
if (vcolorExt.a < ${L.H.float(U.Q)}) {
|
|
301
301
|
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
302
302
|
}
|
|
303
|
-
`),t.include(
|
|
303
|
+
`),t.include(T.kA,e),t.include(_.n,e),t.include(w.S,e),t.include(K?S.G:S.Bz,e),t.fragment.include(s.HQ,e),t.include(F.z,e),(0,O.yu)(z,e),z.uniforms.add(G.uniforms.get("localOrigin"),new y.t("ambient",(e=>e.ambient)),new y.t("diffuse",(e=>e.diffuse)),new P.m("opacity",(e=>e.opacity)),new P.m("layerOpacity",(e=>e.layerOpacity))),te&&z.uniforms.add(new D.N("tex",(e=>e.texture))),t.include(E._Z,e),t.include(b.c,e),z.include(I.N),t.include(A.r,e),(0,T.a8)(z),(0,T.eU)(z),(0,x.O4)(z),z.main.add(L.H`
|
|
304
304
|
discardBySlice(vpos);
|
|
305
305
|
discardByTerrainDepth();
|
|
306
|
-
${te?
|
|
306
|
+
${te?L.H`
|
|
307
307
|
vec4 texColor = texture(tex, ${ne?"colorUV":"vuv0"});
|
|
308
|
-
${(0,
|
|
309
|
-
discardOrAdjustAlpha(texColor);`:
|
|
308
|
+
${(0,L.If)(J,"texColor.rgb /= texColor.a;")}
|
|
309
|
+
discardOrAdjustAlpha(texColor);`:L.H`vec4 texColor = vec4(1.0);`}
|
|
310
310
|
shadingParams.viewDirection = normalize(vpos - cameraPosition);
|
|
311
|
-
${j===d.W.ScreenDerivative?
|
|
311
|
+
${j===d.W.ScreenDerivative?L.H`vec3 normal = screenDerivativeNormal(vPositionLocal);`:L.H`shadingParams.normalView = vNormalWorld;
|
|
312
312
|
vec3 normal = shadingNormal(shadingParams);`}
|
|
313
313
|
applyPBRFactors();
|
|
314
314
|
float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
|
|
@@ -316,15 +316,15 @@ return filterShadow(uv, lvpos, size, shadowMap);
|
|
|
316
316
|
vec3 posWorld = vpos + localOrigin;
|
|
317
317
|
|
|
318
318
|
float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
|
|
319
|
-
float shadow = ${X?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,
|
|
319
|
+
float shadow = ${X?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,L.If)(q,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
|
|
320
320
|
|
|
321
321
|
vec3 matColor = max(ambient, diffuse);
|
|
322
|
-
vec3 albedo = mixExternalColor(${(0,
|
|
323
|
-
float opacity_ = layerOpacity * mixExternalOpacity(${(0,
|
|
322
|
+
vec3 albedo = mixExternalColor(${(0,L.If)(Q,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
|
|
323
|
+
float opacity_ = layerOpacity * mixExternalOpacity(${(0,L.If)(Q,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, int(colorMixMode));
|
|
324
324
|
${re?`mat3 tangentSpace = computeTangentSpace(${ee?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${ie?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
|
|
325
325
|
vec3 normalGround = ${q?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
|
|
326
326
|
|
|
327
|
-
${(0,
|
|
327
|
+
${(0,L.If)($,L.H`
|
|
328
328
|
float snow = smoothstep(0.5, 0.55, dot(normal, normalGround));
|
|
329
329
|
albedo = mix(albedo, vec3(1), snow);
|
|
330
330
|
shadingNormal = mix(shadingNormal, normal, snow);
|
|
@@ -332,22 +332,22 @@ return filterShadow(uv, lvpos, size, shadowMap);
|
|
|
332
332
|
|
|
333
333
|
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
|
|
334
334
|
|
|
335
|
-
${Z===
|
|
335
|
+
${Z===E.A9.Normal||Z===E.A9.Schematic?L.H`
|
|
336
336
|
float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
|
|
337
|
-
${(0,
|
|
337
|
+
${(0,L.If)($,L.H`mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);`)}
|
|
338
338
|
vec4 emission = ${$?"mix(getEmissions(), vec4(0.0), snow)":"getEmissions()"};
|
|
339
|
-
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:
|
|
339
|
+
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:L.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
340
340
|
vec4 finalColor = vec4(shadedColor, opacity_);
|
|
341
341
|
outputColorHighlightOID(finalColor, vpos);
|
|
342
|
-
`),t}const V=Object.freeze(Object.defineProperty({__proto__:null,build:z},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(3694),n=r(38954),o=r(51850),a=r(620);class s{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:l}=r;(0,a.vA)(l.length%this._numIndexPerPrimitive==0),(0,a.vA)(l.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*l[this._numIndexPerPrimitive*e[0]];c.clear(),c.push(u);const h=(0,o.fA)(i[u],i[u+1],i[u+2]),m=(0,o.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*l[r+e],c.push(u);let t=i[u];h[0]=Math.min(t,h[0]),m[0]=Math.max(t,m[0]),t=i[u+1],h[1]=Math.min(t,h[1]),m[1]=Math.max(t,m[1]),t=i[u+2],h[2]=Math.min(t,h[2]),m[2]=Math.max(t,m[2])}}this.bbMin=h,this.bbMax=m;const f=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(m[0]-h[0],m[1]-h[1]),m[2]-h[2]);let p=this.radius*this.radius;for(let e=0;e<c.length;++e){u=c.at(e);const t=i[u]-f[0],r=i[u+1]-f[1],n=i[u+2]-f[2],o=t*t+r*r+n*n;if(o<=p)continue;const a=Math.sqrt(o),s=.5*(a-this.radius);this.radius=this.radius+s,p=this.radius*this.radius;const l=s/a;f[0]+=t*l,f[1]+=r*l,f[2]+=n*l}this.center=f,c.clear()}getChildren(){if(this._children||(0,n.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:a,size:c,indices:l}=this.position;for(let n=0;n<t;++n){let t=0;const o=this._numIndexPerPrimitive*this.primitiveIndices[n];let s=c*l[o],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=c*l[o+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[n]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){c.prune()}}const c=new i.A({deallocator:null})},30164:(e,t,r)=>{r.d(t,{g:()=>A});var i,n,o=r(49186),a=(r(44208),r(53966)),s=r(97768),c=r(74887),l=r(44794),d=r(94656),u=r(63907);(n=i||(i={}))[n.Texture=0]="Texture",n[n.RenderBuffer=1]="RenderBuffer";var h=r(67171);function m(e){(null!=e.width&&e.width<0||null!=e.height&&e.height<0||null!=e.depth&&e.depth<0)&&a.A.getLogger("esri/views/webgl/textureUtils").error("Negative dimension parameters are not allowed!")}function f(e){return null!=e&&"type"in e&&"compressed"===e.type}function p(e){return null!=e&&!f(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function v(e){return e===u.Ap.TEXTURE_3D||e===u.Ap.TEXTURE_2D_ARRAY}function g(e,t,r,i=1){let n=Math.max(t,r);return e===u.Ap.TEXTURE_3D&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function _(e){if(null!=e.internalFormat)return e.internalFormat===u.Ab.DEPTH_STENCIL?u.Ab.DEPTH24_STENCIL8:e.internalFormat;switch(e.dataType){case u.ld.FLOAT:switch(e.pixelFormat){case u.Ab.RGBA:return u.H0.RGBA32F;case u.Ab.RGB:return u.H0.RGB32F;default:throw new o.A("Unable to derive format")}case u.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case u.Ab.RGBA:return u.H0.RGBA8;case u.Ab.RGB:return u.H0.RGB8}}return e.internalFormat=e.pixelFormat===u.Ab.DEPTH_STENCIL?u.Ab.DEPTH24_STENCIL8:e.pixelFormat}class T extends h.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case u.H0.R16F:case u.H0.R16I:case u.H0.R16UI:case u.H0.R32F:case u.H0.R32I:case u.H0.R32UI:case u.H0.R8_SNORM:case u.H0.R8:case u.H0.R8I:case u.H0.R8UI:this.pixelFormat=u.Ab.RED}}static validate(e,t){return new T(e,t)}}const x=()=>a.A.getLogger("esri/views/webgl/Texture");let A=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=i.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,this._compressionAbortController=(0,l.v)(null),"context"in e)this._descriptor=e,r=t;else{const r=T.validate(e,t);if(!r)throw new o.A("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===u.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return(0,h.e)(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController.value}dispose(){this.abortCompression(),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.instanceCounter.decrement(u.vt.Texture,this),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 o.A("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===u.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.shouldCompress=e}setData(e){this.abortCompression(),!f(e)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in u.CQ&&(this._descriptor.internalFormat=void 0),this._setData(e),!f(e)&&this._descriptor.shouldCompress&&this._compressOnWorker(e)}updateData(t,r,i,n,a,s,c=0){s||x().error("An attempt to use uninitialized data!"),this._glName||x().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=_(l);const{context:d,pixelFormat:u,dataType:h,target:m,isImmutable:v}=l;if(v&&!this._wasImmutablyAllocated)throw new o.A("Cannot update immutable texture before allocation!");const g=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||i<0||r+n>l.width||i+a>l.height)&&x().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=d;c&&(n&&a||x().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),T.pixelStorei(T.UNPACK_SKIP_ROWS,c)),p(s)?T.texSubImage2D(m,t,r,i,n,a,u,h,s):f(s)?T.compressedTexSubImage2D(m,t,r,i,n,a,l.internalFormat,s.levels[t]):T.texSubImage2D(m,t,r,i,n,a,u,h,s),c&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),d.bindTexture(g,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,i,n,a,s,c,l){l||x().error("An attempt to use uninitialized data!"),this._glName||x().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=_(d);const{context:u,pixelFormat:h,dataType:m,isImmutable:p,target:g}=d;if(p&&!this._wasImmutablyAllocated)throw new o.A("Cannot update immutable texture before allocation!");v(g)||x().warn("Attempting to set 3D texture data on a non-3D texture");const T=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||i<0||n<0||r+a>d.width||i+s>d.height||n+c>d.depth)&&x().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:A}=u;if(f(l))l=l.levels[t],A.compressedTexSubImage3D(g,t,r,i,n,a,s,c,d.internalFormat,l);else{const e=l;A.texSubImage3D(g,t,r,i,n,a,s,c,h,m,e)}u.bindTexture(T,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new o.A("Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,m(t)}t.samplingMode===u.Cj.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=u.Cj.LINEAR_MIPMAP_NEAREST):t.samplingMode===u.Cj.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=u.Cj.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new o.A("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}e.samplingMode===u.Cj.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=u.Cj.LINEAR):e.samplingMode===u.Cj.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=u.Cj.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController.value=(0,s.DC)(this._compressionAbortController.value))}_setData(t,r){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,d.Y2)(n),this._glName||(this._glName=n.createTexture(),i.context.instanceCounter.increment(u.vt.Texture,this)),m(i);const a=i.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,d.Y2)(n);const s=r??i.target,c=v(s);if(p(t))this._setDataFromTexImageSource(t,s);else{const{width:e,height:r,depth:a}=i;if(null==e||null==r)throw new o.A("Width and height must be specified!");if(c&&null==a)throw new o.A("Depth must be specified!");if(i.internalFormat=_(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,i.internalFormat,i.hasMipmap,e,r,a),f(t)){if(!(i.internalFormat in u.CQ))throw new o.A("Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,s)}else this._texImage(s,0,i.internalFormat,e,r,a,t),(0,d.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),(0,d.Y2)(n),i.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=u.Ap.TEXTURE_CUBE_MAP_POSITIVE_X;t<=u.Ap.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=_(i);const n=v(t),{width:o,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=a),n&&i.depth,n&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,a,s),this._texImage(t,0,i.internalFormat,o,a,s,e),(0,d.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,d.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:a}=i,s=e.levels,c=g(r,n,o,a),l=Math.min(c,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,i.context.gl.TEXTURE_MAX_LEVEL,l),this._forEachMipmapLevel(((e,i,n,o)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,n,o,a)}),l)}_texStorage(e,t,r,i,n,a){const{gl:s}=this._descriptor.context;if(!(t in u.H0))throw new o.A("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?g(e,i,n,a):1;if(v(e)){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");s.texStorage3D(e,c,t,i,n,a)}else s.texStorage2D(e,c,t,i,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,n,a,s){const c=this._descriptor.context.gl,l=v(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,i,n,a,u,h,r)}else c.texSubImage2D(e,t,0,0,i,n,u,h,r)}}else{const d=s;if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,i,n,a,0,u,h,d)}else c.texImage2D(e,t,r,i,n,0,u,h,d)}}_compressedTexImage(e,t,r,i,n,a,s){const c=this._descriptor.context.gl,l=v(e);if(this._descriptor.isImmutable){if(null!=s)if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,i,n,a,r,s)}else c.compressedTexSubImage2D(e,t,0,0,i,n,r,s)}else if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,i,n,a,0,s)}else c.compressedTexImage2D(e,t,r,i,n,0,s)}async _compressOnWorker(t){if(!e.compressionWorkerHandle||!e.compressionWorkerHandle.isCompressible(t))return;const r=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_etc"),i=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_s3tc");if(r||i){const n=new AbortController;this._compressionAbortController.value=n;const o={data:await createImageBitmap(t),flipped:this.descriptor.flipped,width:t.width,height:t.height,hasMipmap:this._descriptor.hasMipmap,hasETC:!!r,hasS3TC:!!i};e.compressionWorkerHandle.invoke(o,this._compressionAbortController.value.signal).then((e=>{e&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=e.internalFormat,this._setData(e.compressedTexture)),n===this._compressionAbortController.value&&(this._compressionAbortController.value=null)})).catch((e=>{(0,c.zf)(e)||n!==this._compressionAbortController.value||(this._compressionAbortController.value=null)}))}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:n,hasMipmap:a,target:s}=this._descriptor;const c=s===u.Ap.TEXTURE_3D;if(null==r||null==i||c&&null==n)throw new o.A("Missing texture dimensions for mipmap calculation");for(let o=0;e(o,r,i,n),a&&(1!==r||1!==i||c&&1!==n)&&!(o>=t);++o)r=Math.max(1,r>>1),i=Math.max(1,i>>1),c&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;r===u.Cj.LINEAR_MIPMAP_NEAREST||r===u.Cj.LINEAR_MIPMAP_LINEAR?(r=u.Cj.LINEAR,e.hasMipmap||(i=u.Cj.LINEAR)):r!==u.Cj.NEAREST_MIPMAP_NEAREST&&r!==u.Cj.NEAREST_MIPMAP_LINEAR||(r=u.Cj.NEAREST,e.hasMipmap||(i=u.Cj.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},32680:(e,t,r)=>{r.d(t,{M:()=>n});var i=r(31821);function n(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
|
|
342
|
+
`),t}const z=Object.freeze(Object.defineProperty({__proto__:null,build:G},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(3694),n=r(38954),o=r(51850),a=r(620);class s{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:l}=r;(0,a.vA)(l.length%this._numIndexPerPrimitive==0),(0,a.vA)(l.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*l[this._numIndexPerPrimitive*e[0]];c.clear(),c.push(u);const h=(0,o.fA)(i[u],i[u+1],i[u+2]),m=(0,o.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*l[r+e],c.push(u);let t=i[u];h[0]=Math.min(t,h[0]),m[0]=Math.max(t,m[0]),t=i[u+1],h[1]=Math.min(t,h[1]),m[1]=Math.max(t,m[1]),t=i[u+2],h[2]=Math.min(t,h[2]),m[2]=Math.max(t,m[2])}}this.bbMin=h,this.bbMax=m;const f=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(m[0]-h[0],m[1]-h[1]),m[2]-h[2]);let p=this.radius*this.radius;for(let e=0;e<c.length;++e){u=c.at(e);const t=i[u]-f[0],r=i[u+1]-f[1],n=i[u+2]-f[2],o=t*t+r*r+n*n;if(o<=p)continue;const a=Math.sqrt(o),s=.5*(a-this.radius);this.radius=this.radius+s,p=this.radius*this.radius;const l=s/a;f[0]+=t*l,f[1]+=r*l,f[2]+=n*l}this.center=f,c.clear()}getChildren(){if(this._children||(0,n.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:a,size:c,indices:l}=this.position;for(let n=0;n<t;++n){let t=0;const o=this._numIndexPerPrimitive*this.primitiveIndices[n];let s=c*l[o],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=c*l[o+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[n]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){c.prune()}}const c=new i.A({deallocator:null})},30164:(e,t,r)=>{r.d(t,{g:()=>A});var i,n,o=r(49186),a=(r(44208),r(53966)),s=r(97768),c=r(74887),l=r(44794),d=r(94656),u=r(63907);(n=i||(i={}))[n.Texture=0]="Texture",n[n.RenderBuffer=1]="RenderBuffer";var h=r(67171);function m(e){(null!=e.width&&e.width<0||null!=e.height&&e.height<0||null!=e.depth&&e.depth<0)&&a.A.getLogger("esri/views/webgl/textureUtils").error("Negative dimension parameters are not allowed!")}function f(e){return null!=e&&"type"in e&&"compressed"===e.type}function p(e){return null!=e&&!f(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function v(e){return e===u.Ap.TEXTURE_3D||e===u.Ap.TEXTURE_2D_ARRAY}function g(e,t,r,i=1){let n=Math.max(t,r);return e===u.Ap.TEXTURE_3D&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function _(e){if(null!=e.internalFormat)return e.internalFormat===u.Ab.DEPTH_STENCIL?u.Ab.DEPTH24_STENCIL8:e.internalFormat;switch(e.dataType){case u.ld.FLOAT:switch(e.pixelFormat){case u.Ab.RGBA:return u.H0.RGBA32F;case u.Ab.RGB:return u.H0.RGB32F;default:throw new o.A("Unable to derive format")}case u.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case u.Ab.RGBA:return u.H0.RGBA8;case u.Ab.RGB:return u.H0.RGB8}}return e.internalFormat=e.pixelFormat===u.Ab.DEPTH_STENCIL?u.Ab.DEPTH24_STENCIL8:e.pixelFormat}class T extends h.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case u.H0.R16F:case u.H0.R16I:case u.H0.R16UI:case u.H0.R32F:case u.H0.R32I:case u.H0.R32UI:case u.H0.R8_SNORM:case u.H0.R8:case u.H0.R8I:case u.H0.R8UI:this.pixelFormat=u.Ab.RED}}static validate(e,t){return new T(e,t)}}const x=()=>a.A.getLogger("esri/views/webgl/Texture");let A=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=i.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,this._compressionAbortController=(0,l.v)(null),"context"in e)this._descriptor=e,r=t;else{const r=T.validate(e,t);if(!r)throw new o.A("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===u.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return(0,h.e)(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController.value}dispose(){this.abortCompression(),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.instanceCounter.decrement(u.vt.Texture,this),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 o.A("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===u.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.shouldCompress=e}setData(e){this.abortCompression(),!f(e)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in u.CQ&&(this._descriptor.internalFormat=void 0),this._setData(e),!f(e)&&this._descriptor.shouldCompress&&this._compressOnWorker(e)}updateData(t,r,i,n,a,s,c=0){s||x().error("An attempt to use uninitialized data!"),this._glName||x().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=_(l);const{context:d,pixelFormat:u,dataType:h,target:m,isImmutable:v}=l;if(v&&!this._wasImmutablyAllocated)throw new o.A("Cannot update immutable texture before allocation!");const g=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||i<0||r+n>l.width||i+a>l.height)&&x().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=d;c&&(n&&a||x().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),T.pixelStorei(T.UNPACK_SKIP_ROWS,c)),p(s)?T.texSubImage2D(m,t,r,i,n,a,u,h,s):f(s)?T.compressedTexSubImage2D(m,t,r,i,n,a,l.internalFormat,s.levels[t]):T.texSubImage2D(m,t,r,i,n,a,u,h,s),c&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),d.bindTexture(g,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,i,n,a,s,c,l){l||x().error("An attempt to use uninitialized data!"),this._glName||x().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=_(d);const{context:u,pixelFormat:h,dataType:m,isImmutable:p,target:g}=d;if(p&&!this._wasImmutablyAllocated)throw new o.A("Cannot update immutable texture before allocation!");v(g)||x().warn("Attempting to set 3D texture data on a non-3D texture");const T=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||i<0||n<0||r+a>d.width||i+s>d.height||n+c>d.depth)&&x().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:A}=u;if(f(l))l=l.levels[t],A.compressedTexSubImage3D(g,t,r,i,n,a,s,c,d.internalFormat,l);else{const e=l;A.texSubImage3D(g,t,r,i,n,a,s,c,h,m,e)}u.bindTexture(T,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new o.A("Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,m(t)}t.samplingMode===u.Cj.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=u.Cj.LINEAR_MIPMAP_NEAREST):t.samplingMode===u.Cj.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=u.Cj.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new o.A("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}e.samplingMode===u.Cj.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=u.Cj.LINEAR):e.samplingMode===u.Cj.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=u.Cj.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController.value=(0,s.DC)(this._compressionAbortController.value))}_setData(t,r){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,d.Y2)(n),this._glName||(this._glName=n.createTexture(),i.context.instanceCounter.increment(u.vt.Texture,this)),m(i);const a=i.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,d.Y2)(n);const s=r??i.target,c=v(s);if(p(t))this._setDataFromTexImageSource(t,s);else{const{width:e,height:r,depth:a}=i;if(null==e||null==r)throw new o.A("Width and height must be specified!");if(c&&null==a)throw new o.A("Depth must be specified!");if(i.internalFormat=_(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,i.internalFormat,i.hasMipmap,e,r,a),f(t)){if(!(i.internalFormat in u.CQ))throw new o.A("Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,s)}else this._texImage(s,0,i.internalFormat,e,r,a,t),(0,d.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),(0,d.Y2)(n),i.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=u.Ap.TEXTURE_CUBE_MAP_POSITIVE_X;t<=u.Ap.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=_(i);const n=v(t),{width:o,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=a),n&&i.depth,n&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,a,s),this._texImage(t,0,i.internalFormat,o,a,s,e),(0,d.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,d.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:a}=i,s=e.levels,c=g(r,n,o,a),l=Math.min(c,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,i.context.gl.TEXTURE_MAX_LEVEL,l),this._forEachMipmapLevel(((e,i,n,o)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,n,o,a)}),l)}_texStorage(e,t,r,i,n,a){const{gl:s}=this._descriptor.context;if(!(t in u.H0))throw new o.A("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?g(e,i,n,a):1;if(v(e)){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");s.texStorage3D(e,c,t,i,n,a)}else s.texStorage2D(e,c,t,i,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,n,a,s){const c=this._descriptor.context.gl,l=v(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,i,n,a,u,h,r)}else c.texSubImage2D(e,t,0,0,i,n,u,h,r)}}else{const d=s;if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,i,n,a,0,u,h,d)}else c.texImage2D(e,t,r,i,n,0,u,h,d)}}_compressedTexImage(e,t,r,i,n,a,s){const c=this._descriptor.context.gl,l=v(e);if(this._descriptor.isImmutable){if(null!=s)if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,i,n,a,r,s)}else c.compressedTexSubImage2D(e,t,0,0,i,n,r,s)}else if(l){if(null==a)throw new o.A("Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,i,n,a,0,s)}else c.compressedTexImage2D(e,t,r,i,n,0,s)}async _compressOnWorker(t){if(!e.compressionWorkerHandle||!e.compressionWorkerHandle.isCompressible(t))return;const r=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_etc"),i=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_s3tc");if(r||i){const n=new AbortController;this._compressionAbortController.value=n;const o={data:await createImageBitmap(t),flipped:this.descriptor.flipped,width:t.width,height:t.height,hasMipmap:this._descriptor.hasMipmap,hasETC:!!r,hasS3TC:!!i};e.compressionWorkerHandle.invoke(o,this._compressionAbortController.value.signal).then((e=>{e&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=e.internalFormat,this._setData(e.compressedTexture)),n===this._compressionAbortController.value&&(this._compressionAbortController.value=null)})).catch((e=>{(0,c.zf)(e)||n!==this._compressionAbortController.value||(this._compressionAbortController.value=null)}))}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:n,hasMipmap:a,target:s}=this._descriptor;const c=s===u.Ap.TEXTURE_3D;if(null==r||null==i||c&&null==n)throw new o.A("Missing texture dimensions for mipmap calculation");for(let o=0;e(o,r,i,n),a&&(1!==r||1!==i||c&&1!==n)&&!(o>=t);++o)r=Math.max(1,r>>1),i=Math.max(1,i>>1),c&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;r===u.Cj.LINEAR_MIPMAP_NEAREST||r===u.Cj.LINEAR_MIPMAP_LINEAR?(r=u.Cj.LINEAR,e.hasMipmap||(i=u.Cj.LINEAR)):r!==u.Cj.NEAREST_MIPMAP_NEAREST&&r!==u.Cj.NEAREST_MIPMAP_LINEAR||(r=u.Cj.NEAREST,e.hasMipmap||(i=u.Cj.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},32680:(e,t,r)=>{r.d(t,{M:()=>n});var i=r(31821);function n(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
|
|
343
343
|
vec3 camToVert = posWorld - camPosWorld;
|
|
344
344
|
bool isBackface = dot(camToVert, normalWorld) > 0.0;
|
|
345
345
|
if (isBackface) {
|
|
346
346
|
posClip.z += 0.0000003 * posClip.w;
|
|
347
347
|
}
|
|
348
348
|
return posClip;
|
|
349
|
-
}`)}},32976:(e,t,r)=>{r.d(t,{o:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t){super(e,"bool",i.c.Bind,((r,i)=>r.setUniform1b(e,t(i))))}}},33524:(e,t,r)=>{r.d(t,{K_:()=>f,Yf:()=>l,aB:()=>m,ez:()=>c,m6:()=>p,xt:()=>u,z5:()=>d});var i=r(49255),n=r(59643),o=r(63907),a=r(90644);const s=(0,a.p3)(o.dn.ONE,o.dn.ZERO,o.dn.ONE,o.dn.ONE_MINUS_SRC_ALPHA);function c(e){return e===n.Y.FrontFace?null:s}function l(e){switch(e){case n.Y.NONE:return a.Ky;case n.Y.ColorAlpha:return s;case n.Y.FrontFace:case n.Y.COUNT:return null}}function d(e){if(e.draped)return null;switch(e.oitPass){case n.Y.NONE:case n.Y.FrontFace:return e.writeDepth?a.Uy:null;case n.Y.ColorAlpha:case n.Y.COUNT:return null}}const u=5e5,h={factor:-1,units:-2};function m(e){return e?h:null}function f(e,t=o.MT.LESS){return e===n.Y.NONE||e===n.Y.FrontFace?t:o.MT.LEQUAL}function p(e,t){const r=(0,i.LG)(t);return e===n.Y.ColorAlpha?r?{buffers:[o.Nm.COLOR_ATTACHMENT0,o.Nm.COLOR_ATTACHMENT1,o.Nm.COLOR_ATTACHMENT2]}:{buffers:[o.Nm.COLOR_ATTACHMENT0,o.Nm.COLOR_ATTACHMENT1]}:r?{buffers:[o.Nm.COLOR_ATTACHMENT0,o.Nm.COLOR_ATTACHMENT1]}:null}},33752:(e,t,r)=>{r.d(t,{EM:()=>g,dO:()=>v,em:()=>p});var i=r(29242),n=r(9093),o=r(51850),a=r(
|
|
350
|
-
vec3 rotatedModelPosition = transformWorldFromModelRS *
|
|
349
|
+
}`)}},32976:(e,t,r)=>{r.d(t,{o:()=>o});var i=r(69270),n=r(74333);class o extends n.n{constructor(e,t){super(e,"bool",i.c.Bind,((r,i)=>r.setUniform1b(e,t(i))))}}},33524:(e,t,r)=>{r.d(t,{K_:()=>f,Yf:()=>l,aB:()=>m,ez:()=>c,m6:()=>p,xt:()=>u,z5:()=>d});var i=r(49255),n=r(59643),o=r(63907),a=r(90644);const s=(0,a.p3)(o.dn.ONE,o.dn.ZERO,o.dn.ONE,o.dn.ONE_MINUS_SRC_ALPHA);function c(e){return e===n.Y.FrontFace?null:s}function l(e){switch(e){case n.Y.NONE:return a.Ky;case n.Y.ColorAlpha:return s;case n.Y.FrontFace:case n.Y.COUNT:return null}}function d(e){if(e.draped)return null;switch(e.oitPass){case n.Y.NONE:case n.Y.FrontFace:return e.writeDepth?a.Uy:null;case n.Y.ColorAlpha:case n.Y.COUNT:return null}}const u=5e5,h={factor:-1,units:-2};function m(e){return e?h:null}function f(e,t=o.MT.LESS){return e===n.Y.NONE||e===n.Y.FrontFace?t:o.MT.LEQUAL}function p(e,t){const r=(0,i.LG)(t);return e===n.Y.ColorAlpha?r?{buffers:[o.Nm.COLOR_ATTACHMENT0,o.Nm.COLOR_ATTACHMENT1,o.Nm.COLOR_ATTACHMENT2]}:{buffers:[o.Nm.COLOR_ATTACHMENT0,o.Nm.COLOR_ATTACHMENT1]}:r?{buffers:[o.Nm.COLOR_ATTACHMENT0,o.Nm.COLOR_ATTACHMENT1]}:null}},33752:(e,t,r)=>{r.d(t,{EM:()=>g,dO:()=>v,em:()=>p});var i=r(29242),n=r(9093),o=r(51850),a=r(26425),s=r(40710),c=r(33079),l=r(31821),d=r(98353),u=r(35644),h=r(40095),m=r(46540),f=r(65786);function p(e,t){const{attributes:r,vertex:i,varyings:n,fragment:o}=e;i.include(a.u,t),r.add(m.r.POSITION,"vec3"),n.add("vPositionWorldCameraRelative","vec3"),n.add("vPosition_view","vec3",{invariant:!0}),i.uniforms.add(new c.t("transformWorldFromViewTH",(e=>e.transformWorldFromViewTH)),new c.t("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL)),new u.k("transformViewFromCameraRelativeRS",(e=>e.transformViewFromCameraRelativeRS)),new h.X("transformProjFromView",(e=>e.transformProjFromView)),new d.h("transformWorldFromModelRS",(e=>e.transformWorldFromModelRS)),new s.W("transformWorldFromModelTH",(e=>e.transformWorldFromModelTH)),new s.W("transformWorldFromModelTL",(e=>e.transformWorldFromModelTL))),i.code.add(l.H`vec3 positionWorldCameraRelative() {
|
|
350
|
+
vec3 rotatedModelPosition = transformWorldFromModelRS * position;
|
|
351
351
|
vec3 transform_CameraRelativeFromModel = dpAdd(
|
|
352
352
|
transformWorldFromModelTL,
|
|
353
353
|
transformWorldFromModelTH,
|
|
@@ -355,19 +355,19 @@ transformWorldFromModelTH,
|
|
|
355
355
|
-transformWorldFromViewTH
|
|
356
356
|
);
|
|
357
357
|
return transform_CameraRelativeFromModel + rotatedModelPosition;
|
|
358
|
-
}`),
|
|
358
|
+
}`),i.code.add(l.H`
|
|
359
359
|
void forwardPosition(float fOffset) {
|
|
360
360
|
vPositionWorldCameraRelative = positionWorldCameraRelative();
|
|
361
361
|
if (fOffset != 0.0) {
|
|
362
|
-
vPositionWorldCameraRelative += fOffset * ${t.spherical?
|
|
362
|
+
vPositionWorldCameraRelative += fOffset * ${t.spherical?l.H`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:l.H`vec3(0.0, 0.0, 1.0)`};
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
|
|
366
366
|
gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
|
|
367
367
|
}
|
|
368
|
-
`),
|
|
368
|
+
`),o.uniforms.add(new c.t("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL))),i.code.add(l.H`vec3 positionWorld() {
|
|
369
369
|
return transformWorldFromViewTL + vPositionWorldCameraRelative;
|
|
370
|
-
}`),
|
|
370
|
+
}`),o.code.add(l.H`vec3 positionWorld() {
|
|
371
371
|
return transformWorldFromViewTL + vPositionWorldCameraRelative;
|
|
372
372
|
}`)}class v extends f.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,o.vt)(),this.transformWorldFromViewTL=(0,o.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)(),this.transformProjFromView=(0,n.vt)()}}class g extends f.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,o.vt)(),this.transformWorldFromModelTL=(0,o.vt)()}}},34845:(e,t,r)=>{r.d(t,{Ir:()=>d});var i=r(37585),n=r(48163),o=r(87317),a=r(91829),s=r(77108),c=r(14314),l=r(31821);function d(e){e.fragment.uniforms.add(new c.I("projInfo",(e=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,o.s)(u,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,o.s)(u,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(e.camera)))),e.fragment.uniforms.add(new s.E("zScale",(e=>0===e.camera.projectionMatrix[11]?(0,i.hZ)(h,0,1):(0,i.hZ)(h,1,0)))),e.fragment.code.add(l.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
|
|
373
373
|
return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
|
|
@@ -551,15 +551,15 @@ return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSiz
|
|
|
551
551
|
float evaluateAmbientOcclusion() {
|
|
552
552
|
return 1.0 - evaluateAmbientOcclusionInverse();
|
|
553
553
|
}`)):r.code.add(l.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
|
|
554
|
-
float evaluateAmbientOcclusion() { return 0.0; }`)}},57323:(e,t,r)=>{r.d(t,{R:()=>
|
|
554
|
+
float evaluateAmbientOcclusion() { return 0.0; }`)}},57323:(e,t,r)=>{r.d(t,{R:()=>H,b:()=>D});var i=r(46686),n=r(32680),o=r(49255),a=r(76591),s=r(76597),c=r(82991),l=r(96336),d=r(71955),u=r(53466),h=r(92700),m=r(35640),f=r(40261),p=r(54849),v=r(74081),g=r(98619),_=r(22393),T=r(59469),x=r(25618),A=r(96598),b=r(42398),E=r(11955),S=r(27950),M=r(20693),C=r(33079),R=r(71988),w=r(20304),I=r(31821),O=r(63761),y=r(46540),N=r(60517),P=r(14113),L=r(49788);function D(e){const t=new P.N5,{attributes:r,vertex:D,fragment:H,varyings:F}=t,{output:B,offsetBackfaces:U,instancedColor:G,pbrMode:z,snowCover:V,spherical:W}=e,j=z===T.A9.Normal||z===T.A9.Schematic;if((0,M.NB)(D,e),r.add(y.r.POSITION,"vec3"),F.add("vpos","vec3",{invariant:!0}),t.include(b.A,e),t.include(c.B,e),t.include(m.G,e),t.include(A.Z,e),(0,o.RN)(B)&&((0,M.yu)(t.vertex,e),t.include(l.Y,e),t.include(s.d,e),U&&t.include(n.M),G&&t.attributes.add(y.r.INSTANCECOLOR,"vec4"),F.add("vNormalWorld","vec3"),F.add("localvpos","vec3",{invariant:!0}),t.include(u.U,e),t.include(i.oD,e),t.include(d.K,e),t.include(h.c,e),D.uniforms.add(new R.E("externalColor",(e=>e.externalColor))),F.add("vcolorExt","vec4"),D.main.add(I.H`
|
|
555
555
|
forwardNormalizedVertexColor();
|
|
556
556
|
vcolorExt = externalColor;
|
|
557
|
-
${(0,
|
|
557
|
+
${(0,I.If)(G,"vcolorExt *= instanceColor * 0.003921568627451;")}
|
|
558
558
|
vcolorExt *= vvColor();
|
|
559
559
|
vcolorExt *= getSymbolColor();
|
|
560
560
|
forwardColorMixMode();
|
|
561
561
|
|
|
562
|
-
bool alphaCut = vcolorExt.a < ${
|
|
562
|
+
bool alphaCut = vcolorExt.a < ${I.H.float(L.Q)};
|
|
563
563
|
vpos = getVertexInLocalOriginSpace();
|
|
564
564
|
localvpos = vpos - view[3].xyz;
|
|
565
565
|
vpos = subtractOrigin(vpos);
|
|
@@ -572,12 +572,12 @@ float evaluateAmbientOcclusion() { return 0.0; }`)}},57323:(e,t,r)=>{r.d(t,{R:()
|
|
|
572
572
|
forwardTextureCoordinates();
|
|
573
573
|
|
|
574
574
|
gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
|
|
575
|
-
${(0,
|
|
576
|
-
`)),(0,o.RN)(B)){const{hasColorTexture:
|
|
575
|
+
${(0,I.If)(U,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
|
|
576
|
+
`)),(0,o.RN)(B)){const{hasColorTexture:r,hasColorTextureTransform:i,receiveShadows:n}=e;t.include(v.kA,e),t.include(p.n,e),t.include(E.S,e),t.include(e.instancedDoublePrecision?x.G:x.Bz,e),t.fragment.include(a.HQ,e),t.include(N.z,e),(0,M.yu)(t.fragment,e),(0,g.Gc)(H),(0,v.a8)(H),(0,v.eU)(H),H.uniforms.add(D.uniforms.get("localOrigin"),D.uniforms.get("view"),new C.t("ambient",(e=>e.ambient)),new C.t("diffuse",(e=>e.diffuse)),new w.m("opacity",(e=>e.opacity)),new w.m("layerOpacity",(e=>e.layerOpacity))),r&&H.uniforms.add(new O.N("tex",(e=>e.texture))),t.include(T._Z,e),t.include(_.c,e),H.include(S.N),(0,g.O4)(H),H.main.add(I.H`
|
|
577
577
|
discardBySlice(vpos);
|
|
578
578
|
discardByTerrainDepth();
|
|
579
|
-
vec4 texColor = ${
|
|
580
|
-
${(0,
|
|
579
|
+
vec4 texColor = ${r?`texture(tex, ${i?"colorUV":"vuv0"})`:" vec4(1.0)"};
|
|
580
|
+
${(0,I.If)(r,`${(0,I.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
|
|
581
581
|
vec3 viewDirection = normalize(vpos - cameraPosition);
|
|
582
582
|
applyPBRFactors();
|
|
583
583
|
float ssao = evaluateAmbientOcclusionInverse();
|
|
@@ -585,13 +585,13 @@ float evaluateAmbientOcclusion() { return 0.0; }`)}},57323:(e,t,r)=>{r.d(t,{R:()
|
|
|
585
585
|
|
|
586
586
|
float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
|
|
587
587
|
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
|
|
588
|
-
float shadow = ${
|
|
588
|
+
float shadow = ${n?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":W?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
|
|
589
589
|
vec3 matColor = max(ambient, diffuse);
|
|
590
|
-
${e.hasVertexColors?
|
|
591
|
-
float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:
|
|
590
|
+
${e.hasVertexColors?I.H`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
|
|
591
|
+
float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:I.H`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
|
|
592
592
|
float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
|
|
593
|
-
${(0,
|
|
594
|
-
${
|
|
593
|
+
${(0,I.If)(V,"albedo = mix(albedo, vec3(1), 0.9);")}
|
|
594
|
+
${I.H`vec3 shadingNormal = normalize(vNormalWorld);
|
|
595
595
|
albedo *= 1.2;
|
|
596
596
|
vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
|
|
597
597
|
float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
|
|
@@ -599,13 +599,13 @@ float evaluateAmbientOcclusion() { return 0.0; }`)}},57323:(e,t,r)=>{r.d(t,{R:()
|
|
|
599
599
|
float treeRadialFalloff = vColor.r;
|
|
600
600
|
float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
|
|
601
601
|
additionalLight += backLightFactor * mainLightIntensity;`}
|
|
602
|
-
${(0,
|
|
603
|
-
${j?
|
|
604
|
-
${(0,
|
|
602
|
+
${(0,I.If)(j,`vec3 normalGround = ${W?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};`)}
|
|
603
|
+
${j?I.H`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
|
|
604
|
+
${(0,I.If)(V,I.H`mrr = vec3(0.0, 1.0, 0.04);`)}
|
|
605
605
|
vec4 emission = ${V?"vec4(0.0)":"getEmissions()"};
|
|
606
|
-
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:
|
|
606
|
+
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:I.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
607
607
|
vec4 finalColor = vec4(shadedColor, opacity_);
|
|
608
|
-
outputColorHighlightOID(finalColor, vpos);`)}return t.include(
|
|
608
|
+
outputColorHighlightOID(finalColor, vpos);`)}return t.include(f.E,e),t}const H=Object.freeze(Object.defineProperty({__proto__:null,build:D},Symbol.toStringTag,{value:"Module"}))},57917:(e,t,r)=>{r.d(t,{S:()=>n});var i=r(34275);function n(e){if(e.length<i.y9)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,i.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}},59469:(e,t,r)=>{r.d(t,{A9:()=>i,_Z:()=>m});var i,n,o=r(99208),a=r(40710),s=r(33079),c=r(31821),l=r(15976),d=r(63761),u=(r(74810),r(69270)),h=r(65786);function m(e,t){const r=t.pbrMode,n=e.fragment;if(r!==i.Schematic&&r!==i.Disabled&&r!==i.Normal)return void n.code.add(c.H`void applyPBRFactors() {}`);if(r===i.Disabled)return void n.code.add(c.H`void applyPBRFactors() {}
|
|
609
609
|
float getBakedOcclusion() { return 1.0; }`);if(r===i.Schematic)return void n.code.add(c.H`vec3 mrr = vec3(0.0, 0.6, 0.2);
|
|
610
610
|
float occlusion = 1.0;
|
|
611
611
|
void applyPBRFactors() {}
|
|
@@ -630,7 +630,7 @@ float occlusion;`),h&&n.uniforms.add(v===u.c.Pass?new d.N("texMetallicRoughness"
|
|
|
630
630
|
${(0,c.If)(h,`applyMetallicRoughness(${m?"metallicRoughnessUV":"vuv0"});`)}
|
|
631
631
|
${(0,c.If)(f,`applyOcclusion(${p?"occlusionUV":"vuv0"});`)}
|
|
632
632
|
}
|
|
633
|
-
`)}(n=i||(i={}))[n.Disabled=0]="Disabled",n[n.Normal=1]="Normal",n[n.Schematic=2]="Schematic",n[n.Water=3]="Water",n[n.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",n[n.Simplified=5]="Simplified",n[n.TerrainWithWater=6]="TerrainWithWater",n[n.COUNT=7]="COUNT",h.Y},59643:(e,t,r)=>{var i;r.d(t,{Y:()=>i}),function(e){e[e.NONE=0]="NONE",e[e.ColorAlpha=1]="ColorAlpha",e[e.FrontFace=2]="FrontFace",e[e.COUNT=3]="COUNT"}(i||(i={}))},59907:(e,t,r)=>{r.d(t,{Hk:()=>h,Pq:()=>u,SA:()=>v,Ut:()=>d,p1:()=>m,tH:()=>p,tb:()=>f,uO:()=>s});var i=r(58083),n=r(13030),o=r(620),a=r(46540);function s(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,c=o.length;if(r*=s,1===i)for(let e=0;e<c;++e)a[r]=n[o[e]],r+=s;else for(let e=0;e<c;++e){const t=n[o[e]];for(let e=0;e<i;e++)a[r]=t,r+=s}}function c(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function l(e,t,r,i){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,c=o.length;if(r*=s,
|
|
633
|
+
`)}(n=i||(i={}))[n.Disabled=0]="Disabled",n[n.Normal=1]="Normal",n[n.Schematic=2]="Schematic",n[n.Water=3]="Water",n[n.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",n[n.Simplified=5]="Simplified",n[n.TerrainWithWater=6]="TerrainWithWater",n[n.COUNT=7]="COUNT",h.Y},59643:(e,t,r)=>{var i;r.d(t,{Y:()=>i}),function(e){e[e.NONE=0]="NONE",e[e.ColorAlpha=1]="ColorAlpha",e[e.FrontFace=2]="FrontFace",e[e.COUNT=3]="COUNT"}(i||(i={}))},59907:(e,t,r)=>{r.d(t,{Hk:()=>h,Pq:()=>u,SA:()=>v,Ut:()=>d,p1:()=>m,tH:()=>p,tb:()=>f,uO:()=>s});var i=r(58083),n=r(13030),o=r(620),a=r(46540);function s(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,c=o.length;if(r*=s,1===i)for(let e=0;e<c;++e)a[r]=n[o[e]],r+=s;else for(let e=0;e<c;++e){const t=n[o[e]];for(let e=0;e<i;e++)a[r]=t,r+=s}}function c(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function l(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,c=o.length;if(r*=s,1===i)for(let e=0;e<c;++e){const t=3*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}else for(let e=0;e<c;++e){const t=3*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}}function d(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,c=o.length;if(r*=s,1===i)for(let e=0;e<c;++e){const t=4*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}else for(let e=0;e<c;++e){const t=4*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}}function u(e,t,r){const i=e.typedBuffer,n=e.typedBufferStride;t*=n;for(let e=0;e<r;++e)i[t]=0,i[t+1]=0,i[t+2]=0,i[t+3]=0,t+=n}function h(e,t,r,n,o=1){if(!t)return void l(e,r,n,o);const{data:a,indices:s}=e,c=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=t[0],m=t[1],f=t[2],p=t[4],v=t[5],g=t[6],_=t[8],T=t[9],x=t[10],A=t[12],b=t[13],E=t[14];n*=d;let S=0,M=0,C=0;const R=(0,i.tZ)(t)?e=>{S=a[e]+A,M=a[e+1]+b,C=a[e+2]+E}:e=>{const t=a[e],r=a[e+1],i=a[e+2];S=h*t+p*r+_*i+A,M=m*t+v*r+T*i+b,C=f*t+g*r+x*i+E};if(1===o)for(let e=0;e<u;++e)R(3*s[e]),c[n]=S,c[n+1]=M,c[n+2]=C,n+=d;else for(let e=0;e<u;++e){R(3*s[e]);for(let e=0;e<o;++e)c[n]=S,c[n+1]=M,c[n+2]=C,n+=d}}function m(e,t,r,n,o=1){if(!t)return void l(e,r,n,o);const{data:a,indices:s}=e,c=t,d=r.typedBuffer,u=r.typedBufferStride,h=s.length,m=c[0],f=c[1],p=c[2],v=c[4],g=c[5],_=c[6],T=c[8],x=c[9],A=c[10],b=!(0,i.ut)(c),E=1e-6,S=1-E;n*=u;let M=0,C=0,R=0;const w=(0,i.tZ)(c)?e=>{M=a[e],C=a[e+1],R=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];M=m*t+v*r+T*i,C=f*t+g*r+x*i,R=p*t+_*r+A*i};if(1===o)if(b)for(let e=0;e<h;++e){w(3*s[e]);const t=M*M+C*C+R*R;if(t<S&&t>E){const e=1/Math.sqrt(t);d[n]=M*e,d[n+1]=C*e,d[n+2]=R*e}else d[n]=M,d[n+1]=C,d[n+2]=R;n+=u}else for(let e=0;e<h;++e)w(3*s[e]),d[n]=M,d[n+1]=C,d[n+2]=R,n+=u;else for(let e=0;e<h;++e){if(w(3*s[e]),b){const e=M*M+C*C+R*R;if(e<S&&e>E){const t=1/Math.sqrt(e);M*=t,C*=t,R*=t}}for(let e=0;e<o;++e)d[n]=M,d[n+1]=C,d[n+2]=R,n+=u}}function f(e,t,r,i,n=1){const{data:o,indices:a}=e,s=r.typedBuffer,c=r.typedBufferStride,l=a.length;if(i*=c,t!==o.length||4!==t)if(1!==n)if(4!==t)for(let e=0;e<l;++e){const t=3*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=c}else for(let e=0;e<l;++e){const t=4*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=c}return}for(let e=0;e<l;++e){const t=3*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=c}}else{s[i]=o[0],s[i+1]=o[1],s[i+2]=o[2],s[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=c/4,a=e[i/=4];i+=t;const d=l*n;for(let r=1;r<d;++r)e[i]=a,i+=t}}function p(e,t,r,i,n=1){const o=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a}function v(e,t,r,i,o,s,c){let l={numItems:0,numVerticesPerItem:0};for(const d of r.fields.keys()){const r=e.get(d),u=r?.indices;if(r&&u)d===a.r.POSITION&&(l={numItems:1,numVerticesPerItem:u.length}),g(d,r,i,o,s,c);else if(d===a.r.OBJECTANDLAYERIDCOLOR&&null!=t){const r=e.get(a.r.POSITION)?.indices;if(r){const e=r.length;p(t,s.getField(d,n.XP),e,c)}}}return l}function g(e,t,r,s,l,u){switch(e){case a.r.POSITION:{(0,o.vA)(3===t.size);const i=l.getField(e,n.xs);(0,o.vA)(!!i,`No buffer view for ${e}`),i&&h(t,r,i,u);break}case a.r.NORMAL:{(0,o.vA)(3===t.size);const r=l.getField(e,n.xs);(0,o.vA)(!!r,`No buffer view for ${e}`),r&&m(t,s,r,u);break}case a.r.NORMALCOMPRESSED:case a.r.PROFILERIGHT:case a.r.PROFILEUP:{(0,o.vA)(2===t.size);const r=l.getField(e,n.mJ);(0,o.vA)(!!r,`No buffer view for ${e}`),r&&c(t,r,u);break}case a.r.UV0:{(0,o.vA)(2===t.size);const r=l.getField(e,n.gH);(0,o.vA)(!!r,`No buffer view for ${e}`),r&&c(t,r,u);break}case a.r.COLOR:case a.r.SYMBOLCOLOR:{const r=l.getField(e,n.XP);(0,o.vA)(!!r,`No buffer view for ${e}`),(0,o.vA)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||f(t,t.size,r,u);break}case a.r.COLORFEATUREATTRIBUTE:{const r=l.getField(e,n.Y$);(0,o.vA)(!!r,`No buffer view for ${e}`),(0,o.vA)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length,c=i[0];r*=a;for(let e=0;e<s;++e)o[r]=c,r+=a}(t,r,u);break}case a.r.TANGENT:{(0,o.vA)(4===t.size);const a=l.getField(e,n.Eq);(0,o.vA)(!!a,`No buffer view for ${e}`),a&&function(e,t,r,n,o=1){if(!t)return void d(e,r,n,o);const{data:a,indices:s}=e,c=t,l=r.typedBuffer,u=r.typedBufferStride,h=s.length,m=c[0],f=c[1],p=c[2],v=c[4],g=c[5],_=c[6],T=c[8],x=c[9],A=c[10],b=!(0,i.ut)(c),E=1e-6,S=1-E;if(n*=u,1===o)for(let e=0;e<h;++e){const t=4*s[e],r=a[t],i=a[t+1],o=a[t+2],c=a[t+3];let d=m*r+v*i+T*o,h=f*r+g*i+x*o,M=p*r+_*i+A*o;if(b){const e=d*d+h*h+M*M;if(e<S&&e>E){const t=1/Math.sqrt(e);d*=t,h*=t,M*=t}}l[n]=d,l[n+1]=h,l[n+2]=M,l[n+3]=c,n+=u}else for(let e=0;e<h;++e){const t=4*s[e],r=a[t],i=a[t+1],c=a[t+2],d=a[t+3];let h=m*r+v*i+T*c,M=f*r+g*i+x*c,C=p*r+_*i+A*c;if(b){const e=h*h+M*M+C*C;if(e<S&&e>E){const t=1/Math.sqrt(e);h*=t,M*=t,C*=t}}for(let e=0;e<o;++e)l[n]=h,l[n+1]=M,l[n+2]=C,l[n+3]=d,n+=u}}(t,r,a,u);break}case a.r.PROFILEVERTEXANDNORMAL:case a.r.FEATUREVALUE:{(0,o.vA)(4===t.size);const r=l.getField(e,n.Eq);(0,o.vA)(!!r,`No buffer view for ${e}`),r&&d(t,r,u)}break;case a.r.PROFILEAUXDATA:{(0,o.vA)(2===t.size);const r=l.getField(e,n.gH);(0,o.vA)(!!r,`No buffer view for ${e}`),r&&c(t,r,u)}}}},60517:(e,t,r)=>{r.d(t,{z:()=>d});var i=r(49255),n=r(22911),o=r(2981),a=r(63365),s=r(31821),c=r(59643),l=r(49788);function d(e,t){e.include(o.Q,t),e.include(n.NL,t),e.fragment.include(a.a);const r=t.output===i.V.ObjectAndLayerIdColor,d=(0,i.LG)(t.output),u=(0,i.RN)(t.output)&&t.oitPass===c.Y.ColorAlpha,h=(0,i.RN)(t.output)&&t.oitPass!==c.Y.ColorAlpha,m=t.discardInvisibleFragments;let f=0;(h||d||u)&&e.outputs.add("fragColor","vec4",f++),d&&e.outputs.add("fragEmission","vec4",f++),u&&e.outputs.add("fragAlpha","float",f++),e.fragment.code.add(s.H`
|
|
634
634
|
void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition) {
|
|
635
635
|
${(0,s.If)(r,"finalColor.a = 1.0;")}
|
|
636
636
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8111],{6518:(t,e,i)=>{i.d(e,{F:()=>h});var s=i(44208),n=i(75503),r=i(19419);const o={minX:0,minY:0,maxX:0,maxY:0};class h{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.w(9,(0,s.A)("esri-csp-restrictions")?t=>({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const t=new Array(this._idByBounds.size);let e=0;this._idByBounds.forEach(((i,s)=>{t[e++]=s})),this._indexInvalid=!1,this._index.clear(),this._index.load(t)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((t=>this._idByBounds.has(t)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const t=(0,r.Ie)();for(const e of this._boundsById.values())e&&(t[0]=Math.min(e[0],t[0]),t[1]=Math.min(e[1],t[1]),t[2]=Math.max(e[2],t[2]),t[3]=Math.max(e[3],t[3]));return t}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(t){const e=this._boundsById.get(t);this._boundsById.delete(t),e&&(this._idByBounds.delete(e),this._indexInvalid||this._index.remove(e))}forEachInBounds(t,e){this._loadIndex(),function(t,e,i){(function(t){o.minX=t[0],o.minY=t[1],o.maxX=t[2],o.maxY=t[3]})(e),t.search(o,i)}(this._index,t,(t=>e(this._idByBounds.get(t))))}get(t){return this._boundsById.get(t)}has(t){return this._boundsById.has(t)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(t,e){if(!this._indexInvalid){const e=this._boundsById.get(t);e&&(this._index.remove(e),this._idByBounds.delete(e))}this._boundsById.set(t,e),e&&(this._idByBounds.set(e,t),this._indexInvalid||(this._boundsToLoad.push(e),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},36708:(t,e,i)=>{i.d(e,{C_:()=>u,OH:()=>f,Vh:()=>g,on:()=>c,pc:()=>x,wB:()=>a,z7:()=>l});var s=i(37955),n=i(36563),r=i(97768),o=i(74887),h=i(14012);function a(t,e,i={}){return d(t,e,i,_)}function l(t,e,i={}){return d(t,e,i,m)}function d(t,e,i={},s){let n=null;const o=i.once?(t,i)=>{s(t)&&((0,r.xt)(n),e(t,i))}:(t,i)=>{s(t)&&e(t,i)};if(n=(0,h.Cn)(t,o,i.sync,i.equals),i.initial){const e=t();o(e,e)}return n}function c(t,e,i,o={}){let h=null,l=null,d=null;function c(){h&&l&&(l.remove(),o.onListenerRemove?.(h),h=null,l=null)}function u(t){o.once&&o.once&&(0,r.xt)(d),i(t)}const _=a(t,((t,i)=>{c(),(0,s.wb)(t)&&(h=t,l=(0,s.on)(t,e,u),o.onListenerAdd?.(t))}),{sync:o.sync,initial:!0});return d=(0,n.hA)((()=>{_.remove(),c()})),d}function u(t,e){return function(t,e,i){if((0,o.G4)(i))return Promise.reject((0,o.NK)());const s=t();if(e?.(s))return Promise.resolve(s);let h=null;function a(){h=(0,r.xt)(h)}return new Promise(((s,r)=>{h=(0,n.vE)([(0,o.u7)(i,(()=>{a(),r((0,o.NK)())})),d(t,(t=>{a(),s(t)}),{sync:!1,once:!0},e??_)])}))}(t,m,e)}function _(t){return!0}function m(t){return!!t}i(80559);const f={sync:!0},g={initial:!0},x={sync:!0,initial:!0}},37730:(t,e,i)=>{i.d(e,{T:()=>n});var s=i(43334);const n={getObjectId:t=>t.objectId,getAttributes:t=>t.attributes,getAttribute:(t,e)=>t.attributes[e],cloneWithGeometry:(t,e)=>new s.Om(e,t.attributes,null,t.objectId),getGeometry:t=>t.geometry,getCentroid:(t,e)=>t.ensureCentroid(e)}},58376:(t,e,i)=>{i.d(e,{J:()=>m});var s=i(4718),n=i(74887),r=i(65864),o=i(17136),h=i(21325),a=i(31464),l=i(19730),d=i(8384),c=i(58727),u=i(62798),_=i(62660);async function m(t,e,i){const m=(0,n.Mq)(i),{point:f,distance:g,returnEdge:x,vertexMode:y}=e;if(!x&&"none"===y)return{candidates:[]};let p=(0,s.o8)(e.query);p=await t.schedule((()=>(0,c.T2)(p,t.definitionExpression,t.spatialReference)),m),p=await t.reschedule((()=>(0,u.B4)(p,{availableFields:t.availableFields,fieldsIndex:t.fieldsIndex,geometryType:t.geometryType,spatialReference:t.spatialReference})),m);const b=!(0,h.aI)(f.spatialReference,t.spatialReference);b&&await(0,a.Nk)(f.spatialReference,t.spatialReference);const B="number"==typeof g?g:g.x,M="number"==typeof g?g:g.y,z={xmin:f.x-B,xmax:f.x+B,ymin:f.y-M,ymax:f.y+M,spatialReference:f.spatialReference},v=b?(0,a.Cv)(z,t.spatialReference):z;if(!v)return{candidates:[]};const I=(await(0,o.el)((0,r.rS)(f),null,{signal:m}))[0],S=(await(0,o.el)((0,r.rS)(v),null,{signal:m}))[0];if(null==I||null==S)return{candidates:[]};const w=new d.G(await t.reschedule((()=>t.searchFeatures((0,l.ux)(S.toJSON()))),m),p,t);await t.reschedule((()=>t.executeObjectIdsQuery(w)),m),await t.reschedule((()=>t.executeTimeQuery(w)),m),await t.reschedule((()=>t.executeAttributesQuery(w)),m),await t.reschedule((()=>async function(t,e,i){const{query:s}=e,{spatialRel:n}=s;if(!e?.items?.length||!s.geometry||!n)return;const r=await(0,_.xt)(n,s.geometry,t.geometryType,t.hasZ,t.hasM),o=await t.runSpatialFilter(e.items,(t=>r(t.geometry)),i);e.items=o}(t,w,m)),m);const Y=I.toJSON(),R=b?(0,a.Cv)(Y,t.spatialReference):Y,X=b?Math.max(v.xmax-v.xmin,v.ymax-v.ymin)/2:g;return w.createSnappingResponse({...e,point:R,distance:X},f.spatialReference)}},66344:(t,e,i)=>{var s,n;i.d(e,{q:()=>a}),(n=s||(s={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class r{get size(){return this._size}constructor(t=10485760){this._maxSize=t,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._users=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._users.clear()}register(t){this._users.set(t.id.slice(0,-1),t)}deregister(t){this.clear(t),this._sizeLimits.delete(t),this._users.delete(t.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize=Math.max(t,-1),this._checkSize()}getSize(t,e){const i=this._db.get(t.id+e);return i?.size??0}put(t,e,i,n,r){e=t.id+e;const h=this._db.get(e);if(h&&(this._size-=h.size,t.size-=h.size,this._db.delete(e),h.entry!==i&&this._notifyRemove(e,h.entry,h.size,s.ALL)),n>this._maxSize)return void this._notifyRemove(e,i,n,s.ALL);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${e}`),void this._notifyRemove(e,i,0,s.ALL);const a=1+Math.max(r,-4)- -3;this._db.set(e,new o(i,n,a)),this._size+=n,t.size+=n,this._checkSize()}updateSize(t,e,i,n){e=t.id+e;const r=this._db.get(e);if(r&&r.entry===i){for(this._size-=r.size,t.size-=r.size;n>this._maxSize;){const t=this._notifyRemove(e,i,n,s.SOME);if(!(null!=t&&t>0))return void this._db.delete(e);n=t}r.size=n,this._size+=n,t.size+=n,this._checkSize()}}pop(t,e){e=t.id+e;const i=this._db.get(e);if(i)return this._size-=i.size,t.size-=i.size,this._db.delete(e),++this._hit,i.entry;++this._miss}get(t,e){e=t.id+e;const i=this._db.get(e);if(void 0!==i)return this._db.delete(e),i.lives=i.lifetime,this._db.set(e,i),++this._hit,i.entry;++this._miss}peek(t,e){const i=this._db.get(t.id+e);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){const t={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},e={},i=new Array;this._db.forEach(((t,s)=>{const n=t.lifetime;i[n]=(i[n]||0)+t.size,this._users.forEach((i=>{const{id:n,name:r}=i;if(s.startsWith(n)){const i=e[r]||0;e[r]=i+t.size}}))}));const s={};this._users.forEach((t=>{const i=t.name;if("hitRate"in t&&"number"==typeof t.hitRate&&!isNaN(t.hitRate)&&t.hitRate>0){const n=e[i]||0;e[i]=n,s[i]=Math.round(100*t.hitRate)+"%"}else s[i]="0%"}));const n=Object.keys(e);n.sort(((t,i)=>e[i]-e[t])),n.forEach((i=>t[i]=Math.round(e[i]/2**20)+"MB / "+s[i]));for(let e=i.length-1;e>=0;--e){const s=i[e];s&&(t["Priority "+(e+-3-1)]=Math.round(s/this._size*100)+"%")}return t}resetStats(){this._hit=this._miss=0,this._users.forEach((t=>t.resetHitRate()))}clear(t){const e=t.id;this._db.forEach(((t,i)=>{i.startsWith(e)&&(this._size-=t.size,this._db.delete(i),this._notifyRemove(i,t.entry,t.size,s.ALL))})),t.size=0}clearAll(){this._db.forEach(((t,e)=>this._notifyRemove(e,t.entry,t.size,s.ALL))),this._users.forEach((t=>t.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(t,e,i,s){const n=this._users.get(t.split(h)[0])?.removeFunc,r=n?.(e,s,i);return"number"==typeof r?r:null}_checkSize(){this._sizeLimits.forEach(((t,e)=>this._checkSizeLimits(t,e))),this._checkSizeLimits(this.maxSize)}setMaxSize(t,e){null==e||e<=0?this._sizeLimits.delete(t):this._sizeLimits.set(t,e)}_checkSizeLimits(t,e){const i=e??this;if(i.size<=t)return;const s=e?.id;let n=!0;for(;n;){n=!1;for(const[r,o]of this._db)if(0===o.lifetime&&(!s||r.startsWith(s))){const s=e??this._users.get(r.split(h)[0]);if(this._purgeItem(r,o,s),i.size<=.9*t)return;n||=this._db.has(r)}}for(const[n,r]of this._db)if(!s||n.startsWith(s)){const s=e??this._users.get(n.split(h)[0]);if(this._purgeItem(n,r,s),i.size<=.9*t)return}}_purgeItem(t,e,i){if(this._db.delete(t),e.lives<=1){this._size-=e.size,i&&(i.size-=e.size);const n=this._notifyRemove(t,e.entry,e.size,s.SOME);null!=n&&n>0&&(this._size+=n,i&&(i.size+=n),e.lives=e.lifetime,e.size=n,this._db.set(t,e))}else--e.lives,this._db.set(t,e)}}class o{constructor(t,e,i){this.entry=t,this.size=e,this.lifetime=i,this.lives=i}}const h=":";class a{constructor(t,e){this.removeFunc=e,this._storage=new r,this.id="",this.name="",this.size=0,this._storage.maxSize=t,this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(t,e,i=1){this._storage.put(this,t,e,i,1)}pop(t){return this._storage.pop(this,t)}get(t){return this._storage.get(this,t)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(t){this._storage.maxSize=t}resetHitRate(){}}},69540:(t,e,i)=>{i.d(e,{A:()=>u});var s=i(90237),n=i(69622),r=(i(44208),i(4718)),o=(i(53966),i(97768)),h=i(35666),a=i(88620),l=i(40608);const d=t=>{let e=class extends t{clone(){const t=(0,a.oY)(this);(0,o.Lw)(t,"unable to clone instance of non-accessor class");const e=t.metadata,i=t.store,s={},n=new Map;for(const t in e){const o=e[t],a=i?.originOf(t),l=o.clonable;if(o.readOnly||!1===l||a!==h.Gr.USER&&a!==h.Gr.DEFAULTS&&a!==h.Gr.WEB_MAP&&a!==h.Gr.WEB_SCENE)continue;const d=this[t];let c=null;c="function"==typeof l?l(d):"reference"===l?d:(0,r.TU)(d),null!=d&&null==c||(a===h.Gr.DEFAULTS?n.set(t,c):s[t]=c)}const l=new(0,Object.getPrototypeOf(this).constructor)(s);if(n.size){const t=(0,a.oY)(l)?.store;if(t)for(const[e,i]of n)t.set(e,i,h.Gr.DEFAULTS)}return l}};return e=(0,s._)([(0,l.$)("esri.core.Clonable")],e),e};let c=class extends(d(n.A)){};c=(0,s._)([(0,l.$)("esri.core.Clonable")],c),(c||(c={})).ClonableMixin=d;const u=c},75503:(t,e,i)=>{i.d(e,{E:()=>I,w:()=>h});var s=i(4576),n=i(21818),r=(i(44208),i(3694)),o=i(11006);class h{constructor(t=9,e){this._compareMinX=u,this._compareMinY=_,this._toBBox=t=>t,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&("function"==typeof e?this._toBBox=e:this._initFormat(e)),this.clear()}destroy(){this.clear(),B.prune(),M.prune(),z.prune(),v.prune()}all(t){a(this._data,t)}search(t,e){let i=this._data;const s=this._toBBox;if(p(t,i))for(B.clear();i;){for(let n=0,r=i.children.length;n<r;n++){const r=i.children[n],o=i.leaf?s(r):r;p(t,o)&&(i.leaf?e(r):y(t,o)?a(r,e):B.push(r))}i=B.pop()}}collides(t){let e=this._data;const i=this._toBBox;if(!p(t,e))return!1;for(B.clear();e;){for(let s=0,n=e.children.length;s<n;s++){const n=e.children[s],r=e.leaf?i(n):n;if(p(t,r)){if(e.leaf||y(t,r))return!0;B.push(n)}}e=B.pop()}return!1}load(t){if(!t.length)return this;if(t.length<this._minEntries){for(let e=0,i=t.length;e<i;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this._data.children.length)if(this._data.height===e.height)this._splitRoot(this._data,e);else{if(this._data.height<e.height){const t=this._data;this._data=e,e=t}this._insert(e,this._data.height-e.height-1,!0)}else this._data=e;return this}insert(t){return t&&this._insert(t,this._data.height-1),this}clear(){return this._data=new w([]),this}remove(t){if(!t)return this;let e,i=this._data,r=null,o=0,h=!1;const a=this._toBBox(t);for(z.clear(),v.clear();i||z.length>0;){if(i||(i=z.pop(),r=z.data[z.length-1],o=v.pop()??0,h=!0),i.leaf&&(e=(0,s.qh)(i.children,(0,n.zI)(t),i.children.length,i.indexHint),-1!==e))return i.children.splice(e,1),z.push(i),this._condense(z),this;h||i.leaf||!y(i,a)?r?(o++,i=r.children[o],h=!1):i=null:(z.push(i),v.push(o),o=0,r=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_build(t,e,i,s){const n=i-e+1;let r=this._maxEntries;if(n<=r){const s=new w(t.slice(e,i+1));return l(s,this._toBBox),s}s||(s=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(s-1)));const o=new Y([]);o.height=s;const h=Math.ceil(n/r),a=h*Math.ceil(Math.sqrt(r));b(t,e,i,a,this._compareMinX);for(let n=e;n<=i;n+=a){const e=Math.min(n+a-1,i);b(t,n,e,h,this._compareMinY);for(let i=n;i<=e;i+=h){const n=Math.min(i+h-1,e);o.children.push(this._build(t,i,n,s-1))}}return l(o,this._toBBox),o}_insert(t,e,i){const s=this._toBBox,n=i?t:s(t);z.clear();const r=function(t,e,i,s){for(;s.push(e),!0!==e.leaf&&s.length-1!==i;){let i,s=1/0,n=1/0;for(let r=0,o=e.children.length;r<o;r++){const o=e.children[r],h=m(o),a=g(t,o)-h;a<n?(n=a,s=h<s?h:s,i=o):a===n&&h<s&&(s=h,i=o)}e=i||e.children[0]}return e}(n,this._data,e,z);for(r.children.push(t),c(r,n);e>=0&&z.data[e].children.length>this._maxEntries;)this._split(z,e),e--;!function(t,e,i){for(let s=i;s>=0;s--)c(e.data[s],t)}(n,z,e)}_split(t,e){const i=t.data[e],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);const r=this._chooseSplitIndex(i,n,s);if(!r)return;const o=i.children.splice(r,i.children.length-r),h=i.leaf?new w(o):new Y(o);h.height=i.height,l(i,this._toBBox),l(h,this._toBBox),e?t.data[e-1].children.push(h):this._splitRoot(i,h)}_splitRoot(t,e){this._data=new Y([t,e]),this._data.height=t.height+1,l(this._data,this._toBBox)}_chooseSplitIndex(t,e,i){let s,n,r;s=n=1/0;for(let o=e;o<=i-e;o++){const e=d(t,0,o,this._toBBox),h=d(t,o,i,this._toBBox),a=x(e,h),l=m(e)+m(h);a<s?(s=a,r=o,n=l<n?l:n):a===s&&l<n&&(n=l,r=o)}return r}_chooseSplitAxis(t,e,i){const s=t.leaf?this._compareMinX:u,n=t.leaf?this._compareMinY:_;this._allDistMargin(t,e,i,s)<this._allDistMargin(t,e,i,n)&&t.children.sort(s)}_allDistMargin(t,e,i,s){t.children.sort(s);const n=this._toBBox,r=d(t,0,e,n),o=d(t,i-e,i,n);let h=f(r)+f(o);for(let s=e;s<i-e;s++){const e=t.children[s];c(r,t.leaf?n(e):e),h+=f(r)}for(let s=i-e-1;s>=e;s--){const e=t.children[s];c(o,t.leaf?n(e):e),h+=f(o)}return h}_condense(t){for(let e=t.length-1;e>=0;e--){const i=t.data[e];if(0===i.children.length)if(e>0){const n=t.data[e-1],r=n.children;r.splice((0,s.qh)(r,i,r.length,n.indexHint),1)}else this.clear();else l(i,this._toBBox)}}_initFormat(t){const e=["return a"," - b",";"];this._compareMinX=new Function("a","b",e.join(t[0])),this._compareMinY=new Function("a","b",e.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function a(t,e){let i=t;for(M.clear();i;){if(!0===i.leaf)for(const t of i.children)e((0,n.zI)(t));else M.pushArray(i.children);i=M.pop()??null}}function l(t,e){d(t,0,t.children.length,e,t)}function d(t,e,i,s,n){n||(n=new w([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=e;o<i;o++)r=t.children[o],c(n,t.leaf?s(r):r);return n}function c(t,e){t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY)}function u(t,e){return t.minX-e.minX}function _(t,e){return t.minY-e.minY}function m(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function f(t){return t.maxX-t.minX+(t.maxY-t.minY)}function g(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function x(t,e){const i=Math.max(t.minX,e.minX),s=Math.max(t.minY,e.minY),n=Math.min(t.maxX,e.maxX),r=Math.min(t.maxY,e.maxY);return Math.max(0,n-i)*Math.max(0,r-s)}function y(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function p(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function b(t,e,i,s,n){const r=[e,i];for(;r.length;){const e=r.pop(),i=r.pop();if(e-i<=s)continue;const h=i+Math.ceil((e-i)/s/2)*s;(0,o.q)(t,h,i,e,n),r.push(i,h,h,e)}}const B=new r.A,M=new r.A,z=new r.A,v=new r.A({deallocator:void 0});class I{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class S extends I{constructor(){super(...arguments),this.height=1,this.indexHint=new s.vW}}class w extends S{constructor(t){super(),this.children=t,this.leaf=!0}}class Y extends S{constructor(t){super(),this.children=t,this.leaf=!1}}},83221:(t,e,i)=>{i.d(e,{A:()=>m});var s=i(4576),n=i(49186),r=i(65529),o=i(53966),h=i(70328),a=i(19419),l=i(90708),d=i(6518),c=i(51441),u=i(37730);const _=(0,h.vt)();class m{constructor(t){this.geometryInfo=t,this._boundsStore=new d.F,this._featuresById=new Map,this._usedMemory=0,this.events=new r.A,this.featureAdapter=u.T}get usedMemory(){return this._usedMemory}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let t=0;return this._featuresById.forEach((e=>{null!=e.geometry&&e.geometry.coords&&(t+=e.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:t/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(t){if(null==this.fullBounds)return null;const[e,i,s,n]=this.fullBounds;return{xmin:e,ymin:i,xmax:s,ymax:n,spatialReference:(0,c.ag)(t)}}add(t){this._add(t),this._emitChanged()}addMany(t){for(const e of t)this._add(e);this._emitChanged()}upsertMany(t){const e=t.map((t=>this._upsert(t)));return this._emitChanged(),e.filter(s.Ru)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged(),this._usedMemory=0}removeById(t){const e=this._featuresById.get(t);return e?(this._remove(e),this._emitChanged(),e):null}removeManyById(t){this._boundsStore.invalidateIndex();for(const e of t){const t=this._featuresById.get(e);t&&this._remove(t)}this._emitChanged()}forEachBounds(t,e){for(const i of t){const t=this._boundsStore.get(i.objectId);t&&e((0,h.Jt)(_,t))}}getFeature(t){return this._featuresById.get(t)}has(t){return this._featuresById.has(t)}forEach(t){this._featuresById.forEach((e=>t(e)))}forEachInBounds(t,e){this._boundsStore.forEachInBounds(t,(t=>{e(this._featuresById.get(t))}))}_emitChanged(){this.events.emit("changed",void 0)}_add(t){if(!t)return;const e=t.objectId;if(null==e)return void o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.A("featurestore:invalid-feature","feature id is missing",{feature:t}));const i=this._featuresById.get(e);let s;if(i?(t.displayId=i.displayId,s=this._boundsStore.get(e),this._boundsStore.delete(e),this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0):null!=this.onFeatureAdd&&this.onFeatureAdd(t),!t.geometry?.coords?.length)return this._boundsStore.set(e,null),void this._featuresById.set(e,t);s=(0,l.jQ)(null!=s?s:(0,a.vt)(),t.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=s&&this._boundsStore.set(e,s),this._featuresById.set(e,t),this._usedMemory+=this.estimateFeatureUsedMemory?.(t)??0}_upsert(t){const e=t?.objectId;if(null==e)return o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.A("featurestore:invalid-feature","feature id is missing",{feature:t})),null;const i=this._featuresById.get(e);if(!i)return this._add(t),t;this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0;const{geometry:s,attributes:r}=t;for(const t in r)i.attributes[t]=r[t];return s&&(i.geometry=s,this._boundsStore.set(e,(0,l.jQ)((0,a.vt)(),s,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),this._usedMemory+=this.estimateFeatureUsedMemory?.(i)??0,i}_remove(t){null!=this.onFeatureRemove&&this.onFeatureRemove(t);const e=t.objectId;return this._boundsStore.delete(e),this._featuresById.delete(e),this._usedMemory-=this.estimateFeatureUsedMemory?.(t)??0,t}}}}]);
|