Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

11843 lines
3.7 MiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
require({cache:{"esri/core/accessorSupport/overrideDefaultsFrom":function(){define(["exports","../Accessor","./PropertyOrigin","./utils"],function(a,b,q,l){function p(k,h){var f=l.getProperties(k),c=l.getProperties(h);f=f.store;h=c.store;c=c.metadata;for(const d in c){var e=c[d],g=f.originOf(d);const t=h.originOf(d);e.readOnly||t===q.OriginId.DEFAULTS||(g!==q.OriginId.DEFAULTS?(e=f.get(d),g=h.get(d),e&&g&&g instanceof b&&e instanceof b&&e instanceof g.constructor&&p(e,g)):k.set(d,h.get(d)))}}a.overrideDefaultsFrom=
p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/projectBoundingRect":function(){define(["exports","../../core/libs/gl-matrix-2/factories/vec3f64","./projectBuffer","../support/aaBoundingRect","../support/spatialReferenceUtils"],function(a,b,q,l,p){const k=b.create();a.projectBoundingRect=function(h,f,c,e){if(null==h)return!1;if(p.equals(f,e))return l.copy(c,h),!0;k[0]=h[0];k[1]=h[1];k[2]=0;if(!q.projectBuffer(k,f,0,k,e,0,1))return!1;c[0]=k[0];c[1]=k[1];
k[0]=h[2];k[1]=h[3];k[2]=0;if(!q.projectBuffer(k,f,0,k,e,0,1))return!1;c[2]=k[0];c[3]=k[1];return!0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/projectPointToVector":function(){define(["exports","../../core/libs/gl-matrix-2/factories/vec3f64","../projection","./projectBuffer"],function(a,b,q,l){function p(h,f,c,e){if(q.canProjectWithoutEngine(h.spatialReference,c))return k[0]=h.x,k[1]=h.y,k[2]=h.z??e??0,l.projectBuffer(k,h.spatialReference,0,f,c,0,1);
h=q.tryProjectWithZConversion(h,c);if(!h)return!1;f[0]=h?.x;f[1]=h?.y;f[2]=h?.z??e??0;return!0}const k=b.create();a.projectPointToVector=p;a.projectPointToVectorAsync=async function(h,f,c,e,g){await q.initializeProjection(h.spatialReference,c,null,g);return p(h,f,c,e)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/boundedPlane":function(){define("exports ../core/has ../core/Logger ../core/mathUtils ../core/ObjectStack ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../geometry/support/Axis ../geometry/support/lineSegment ../geometry/support/plane ../geometry/support/ray ../geometry/support/vector ../geometry/support/vectorStacks".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(X=U){return{plane:d.create(X.plane),origin:c.clone(X.origin),basis1:c.clone(X.basis1),basis2:c.clone(X.basis2)}}function r(X,ja,la){const na=da.get();na.origin=X;na.basis1=ja;na.basis2=la;na.plane=d.wrap(0,0,0,0);y(na);return na}function n(X,ja=m()){return x(X.origin,X.basis1,X.basis2,ja)}function u(X,ja){f.copy(ja.origin,X.origin);f.copy(ja.basis1,X.basis1);f.copy(ja.basis2,X.basis2);d.copy(ja.plane,X.plane)}function x(X,ja,la,na=m()){f.copy(na.origin,
X);f.copy(na.basis1,ja);f.copy(na.basis2,la);y(na);1E-6<Math.abs(f.dot(na.basis1,na.basis2)/(f.length(na.basis1)*f.length(na.basis2)))&&ha().warn("fromValues()","Provided basis vectors are not perpendicular");1E-6<Math.abs(f.dot(na.basis1,W(na)))&&ha().warn("fromValues()","Basis vectors and plane normal are not perpendicular");1E-6<Math.abs(-f.dot(W(na),na.origin)-na.plane[3])&&ha().warn("fromValues()","Plane offset is not consistent with plane origin");return na}function y(X){d.fromVectorsAndPoint(X.basis2,
X.basis1,X.origin,X.plane)}function z(X,ja,la){X!==la&&n(X,la);X=f.scale(v.sv3d.get(),W(X),ja);f.add(la.origin,la.origin,X);la.plane[3]-=ja;return la}function A(X,ja,la){B(ja,la);z(la,M(X,X.origin),la);return la}function B(X,ja=m()){const la=(X[2]-X[0])/2,na=(X[3]-X[1])/2;f.set(ja.origin,X[0]+la,X[1]+na,0);f.set(ja.basis1,la,0,0);f.set(ja.basis2,0,na,0);d.fromValues(0,0,1,0,ja.plane);return ja}function C(X,ja,la){return d.intersectRay(X.plane,ja,la)?S(X,la):!1}function D(X,ja,la){if(C(X,ja,la))return la;
X=F(X,ja,v.sv3d.get());f.add(la,ja.origin,f.scale(v.sv3d.get(),ja.direction,f.distance(ja.origin,X)/f.length(ja.direction)));return la}function F(X,ja,la){const na=Z.get();var va=Z.get();Y(X,ja,na,va);va=Number.POSITIVE_INFINITY;for(const ya of ia){var za=T(X,ya,ca.get());const Da=v.sv3d.get();d.intersectLineSegment(na,za,Da)&&(za=f.direction(v.sv3d.get(),ja.origin,Da),za=Math.abs(l.acosClamped(f.dot(ja.direction,za))),za<va&&(va=za,f.copy(la,Da)))}return va===Number.POSITIVE_INFINITY?H(X,ja,la):
la}function H(X,ja,la){if(C(X,ja,la))return la;const na=Z.get(),va=Z.get();Y(X,ja,na,va);let za=Number.POSITIVE_INFINITY;for(const Da of ia){var ya=T(X,Da,ca.get());const ra=v.sv3d.get();d.intersectLineSegmentClamp(na,ya,ra)&&(ya=t.distance2(ja,ra),d.isPointInside(va,ra)&&ya<za&&(za=ya,f.copy(la,ra)))}G(X,ja.origin)<za&&N(X,ja.origin,la);return la}function N(X,ja,la){var na=d.projectPoint(X.plane,ja,v.sv3d.get());ja=g.projectPointClamp(V(X,X.basis1),na,-1,1,v.sv3d.get());na=g.projectPointClamp(V(X,
X.basis2),na,-1,1,v.sv3d.get());f.subtract(la,f.add(v.sv3d.get(),ja,na),X.origin);return la}function E(X,ja,la){const {origin:na,basis1:va,basis2:za}=X,ya=f.subtract(v.sv3d.get(),ja,na);ja=w.projectPointSignedLength(va,ya);const Da=w.projectPointSignedLength(za,ya);X=w.projectPointSignedLength(W(X),ya);return f.set(la,ja,Da,X)}function G(X,ja){ja=E(X,ja,v.sv3d.get());const {basis1:la,basis2:na}=X;X=f.length(la);var va=f.length(na);X=Math.max(Math.abs(ja[0])-X,0);va=Math.max(Math.abs(ja[1])-va,0);
ja=ja[2];return X*X+va*va+ja*ja}function I(X,ja){return Math.sqrt(G(X,ja))}function O(X,ja){let la=Number.NEGATIVE_INFINITY;for(const va of ia){var na=T(X,va,ca.get());na=g.distance2(na,ja);na>la&&(la=na)}return Math.sqrt(la)}function L(X,ja){return d.isPointInside(X.plane,ja)&&S(X,ja)}function P(X,ja,la,na){switch(la){case e.Axis.X:f.copy(na,X.basis1);f.normalize(na,na);break;case e.Axis.Y:f.copy(na,X.basis2);f.normalize(na,na);break;case e.Axis.Z:f.copy(na,W(X))}return na}function M(X,ja){const la=
-X.plane[3];return w.projectPointSignedLength(W(X),ja)-la}function K(X,ja,la,na){const va=M(X,ja);X=f.scale(ea,W(X),la-va);f.add(na,ja,X);return na}function J(X,ja){return f.exactEquals(X.basis1,ja.basis1)&&f.exactEquals(X.basis2,ja.basis2)&&f.exactEquals(X.origin,ja.origin)}function R(X,ja,la){X!==la&&n(X,la);k.invert(ka,ja);k.transpose(ka,ka);f.transformMat4(la.basis1,X.basis1,ka);f.transformMat4(la.basis2,X.basis2,ka);f.transformMat4(d.getNormal(la.plane),d.getNormal(X.plane),ka);f.transformMat4(la.origin,
X.origin,ja);d.setOffsetFromPoint(la.plane,la.plane,la.origin);return la}function Q(X,ja,la,na){X!==na&&n(X,na);k.fromRotation(fa,ja,la);f.transformMat4(na.basis1,X.basis1,fa);f.transformMat4(na.basis2,X.basis2,fa);y(na);return na}function W(X){return d.getNormal(X.plane)}function S(X,ja){const la=f.subtract(v.sv3d.get(),ja,X.origin);ja=f.squaredLength(X.basis1);const na=f.squaredLength(X.basis2),va=f.dot(X.basis1,la);X=f.dot(X.basis2,la);return 0>-va-ja&&0>va-ja&&0>-X-na&&0>X-na}function V(X,ja){const la=
ca.get();f.copy(la.origin,X.origin);f.copy(la.vector,ja);return la}function T(X,ja,la){const {basis1:na,basis2:va,origin:za}=X;X=f.scale(v.sv3d.get(),na,ja.origin[0]);const ya=f.scale(v.sv3d.get(),va,ja.origin[1]);f.add(la.origin,X,ya);f.add(la.origin,la.origin,za);X=f.scale(v.sv3d.get(),na,ja.direction[0]);ja=f.scale(v.sv3d.get(),va,ja.direction[1]);f.scale(la.vector,f.add(X,X,ja),2);return la}function Y(X,ja,la,na){X=W(X);d.fromVectorsAndPoint(X,ja.direction,ja.origin,la);d.fromVectorsAndPoint(d.getNormal(la),
X,ja.origin,na)}const ha=()=>q.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");class ba{constructor(){this.plane=d.create();this.origin=c.create();this.basis1=c.create();this.basis2=c.create()}}b=ba;const U={plane:d.create(),origin:c.fromValues(0,0,0),basis1:c.fromValues(1,0,0),basis2:c.fromValues(0,1,0)},Z=new p.ObjectStack(d.create),ca=new p.ObjectStack(g.create),ea=c.create(),da=new p.ObjectStack(()=>m()),ia=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,
1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],ka=h.create(),fa=h.create();p=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:b,altitudeAt:M,axisAt:P,closestPoint:H,closestPointOnSilhouette:F,copy:n,copyWithoutVerify:u,create:m,distance:I,distance2:G,distanceToSilhouette:O,elevate:z,equals:J,extrusionContainsPoint:L,fromAABoundingRect:B,fromValues:x,intersectRay:C,intersectRayClosestSilhouette:D,normal:W,projectPoint:N,projectPointLocal:E,rotate:Q,setAltitudeAt:K,setExtent:A,
transform:R,up:U,updateUnboundedPlane:y,wrap:r},Symbol.toStringTag,{value:"Module"}));a.BoundedPlaneClass=b;a.altitudeAt=M;a.axisAt=P;a.boundedPlane=p;a.closestPoint=H;a.closestPointOnSilhouette=F;a.copy=n;a.copyWithoutVerify=u;a.create=m;a.distance=I;a.distance2=G;a.distanceToSilhouette=O;a.elevate=z;a.equals=J;a.extrusionContainsPoint=L;a.fromAABoundingRect=B;a.fromValues=x;a.intersectRay=C;a.intersectRayClosestSilhouette=D;a.normal=W;a.projectPoint=N;a.projectPointLocal=E;a.rotate=Q;a.setAltitudeAt=
K;a.setExtent=A;a.transform=R;a.up=U;a.updateUnboundedPlane=y;a.wrap=r})},"esri/core/ObjectStack":function(){define(["exports","./nextTick"],function(a,b){class q{constructor(l){this._allocator=l;this._items=[];this._itemsPtr=0;this._grow()}get(){0===this._itemsPtr&&b.nextTick(()=>this._reset());this._itemsPtr===this._items.length&&this._grow();return this._items[this._itemsPtr++]}_reset(){this._items.length=Math.min(Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3072),this._items.length);this._itemsPtr=
0}_grow(){for(let l=0;l<Math.max(8,Math.min(this._items.length,1024));l++)this._items.push(this._allocator())}}a.ObjectStack=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/lineSegment":function(){define("exports ../../core/mathUtils ../../core/ObjectStack ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ./vectorStacks".split(" "),function(a,b,q,l,p,k){function h(w){return w?{origin:p.clone(w.origin),vector:p.clone(w.vector)}:{origin:p.create(),
vector:p.create()}}function f(w,v){const m=t.get();m.origin=w;m.vector=v;return m}function c(w,v,m=h()){l.copy(m.origin,w);l.copy(m.vector,v);return m}function e(w,v,m,r,n){const {vector:u,origin:x}=w;v=l.subtract(k.sv3d.get(),v,x);v=l.dot(u,v)/l.squaredLength(u);l.scale(n,u,b.clamp(v,m,r));return l.add(n,n,w.origin)}function g(w,v,m,r){const n=w.origin;var u=l.add(k.sv3d.get(),n,w.vector);w=v.origin;var x=l.add(k.sv3d.get(),w,v.vector),y=k.sv3d.get();v=k.sv3d.get();y[0]=n[0]-w[0];y[1]=n[1]-w[1];
y[2]=n[2]-w[2];v[0]=x[0]-w[0];v[1]=x[1]-w[1];v[2]=x[2]-w[2];if(1E-6>Math.abs(v[0])&&1E-6>Math.abs(v[1])&&1E-6>Math.abs(v[2]))return!1;x=k.sv3d.get();x[0]=u[0]-n[0];x[1]=u[1]-n[1];x[2]=u[2]-n[2];if(1E-6>Math.abs(x[0])&&1E-6>Math.abs(x[1])&&1E-6>Math.abs(x[2]))return!1;u=y[0]*v[0]+y[1]*v[1]+y[2]*v[2];var z=v[0]*x[0]+v[1]*x[1]+v[2]*x[2];const A=v[0]*v[0]+v[1]*v[1]+v[2]*v[2],B=(x[0]*x[0]+x[1]*x[1]+x[2]*x[2])*A-z*z;if(1E-6>Math.abs(B))return!1;y=(u*z-(y[0]*x[0]+y[1]*x[1]+y[2]*x[2])*A)/B;u=(u+z*y)/A;m&&
(y=b.clamp(y,0,1),u=b.clamp(u,0,1));m=k.sv3d.get();z=k.sv3d.get();m[0]=n[0]+y*x[0];m[1]=n[1]+y*x[1];m[2]=n[2]+y*x[2];z[0]=w[0]+u*v[0];z[1]=w[1]+u*v[1];z[2]=w[2]+u*v[2];r.tA=y;r.tB=u;r.pA=m;r.pB=z;r.distance2=l.squaredDistance(m,z);return!0}const d={tA:0,tB:0,pA:p.create(),pB:p.create(),distance2:0},t=new q.ObjectStack(()=>h());a.closestLineSegmentPoint=function(w,v,m){return g(w,v,!0,d)?(l.copy(m,d.pA),!0):!1};a.closestRayDistance2=function(w,v){if(g(w,f(v.origin,v.direction),!1,d)){const {tA:m,pB:r,
distance2:n}=d;if(0<=m&&1>=m)return n;if(0>m)return l.squaredDistance(w.origin,r);if(1<m)return l.squaredDistance(l.add(k.sv3d.get(),w.origin,w.vector),r)}return null};a.copy=function(w,v=h()){return c(w.origin,w.vector,v)};a.create=h;a.distance2=function(w,v){v=l.subtract(k.sv3d.get(),v,w.origin);var m=l.dot(w.vector,v);const r=l.dot(w.vector,w.vector);m=b.clamp(m/r,0,1);w=l.subtract(k.sv3d.get(),l.scale(k.sv3d.get(),w.vector,m),v);return l.dot(w,w)};a.fromPoints=function(w,v,m=h()){l.copy(m.origin,
w);l.subtract(m.vector,v,w);return m};a.fromValues=c;a.pointAt=function(w,v,m){return l.add(m,w.origin,l.scale(m,w.vector,v))};a.projectPoint=function(w,v,m){return e(w,v,0,1,m)};a.projectPointClamp=e;a.wrap=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/vectorStacks":function(){define(["exports","../../core/VectorStack"],function(a,b){const q=b.VectorStack.createVec2f64(),l=b.VectorStack.createVec3f64(),p=b.VectorStack.createVec4f64(),k=b.VectorStack.createMat3f64(),
h=b.VectorStack.createMat4f64();b=b.VectorStack.createQuatf64();a.sm3d=k;a.sm4d=h;a.sq4d=b;a.sv2d=q;a.sv3d=l;a.sv4d=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/VectorStack":function(){define("exports ./has ./nextTick ./libs/gl-matrix-2/factories/mat3f64 ./libs/gl-matrix-2/factories/mat4f64 ./libs/gl-matrix-2/factories/quatf64 ./libs/gl-matrix-2/factories/vec2f64 ./libs/gl-matrix-2/factories/vec3f64 ./libs/gl-matrix-2/factories/vec4f64".split(" "),function(a,b,q,l,
p,k,h,f,c){class e{constructor(g){this._create=g;this._items=[];this._itemsPtr=0}get(){0===this._itemsPtr&&q.nextTick(()=>this._reset());this._itemsPtr>=this._items.length&&this._items.push(this._create());return this._items[this._itemsPtr++]}_reset(){const g=2*this._itemsPtr;this._items.length>g&&(this._items.length=g);this._itemsPtr=0}static createVec2f64(){return new e(h.create)}static createVec3f64(){return new e(f.create)}static createVec4f64(){return new e(c.create)}static createMat3f64(){return new e(l.create)}static createMat4f64(){return new e(p.create)}static createQuatf64(){return new e(k.create)}get test(){}}
a.VectorStack=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/factories/vec2f64":function(){define(["exports"],function(a){function b(){return[0,0]}function q(m){return[m[0],m[1]]}function l(m,r){return[m,r]}function p(m,r=[0,0]){const n=Math.min(2,m.length);for(let u=0;u<n;++u)r[u]=m[u];return r}function k(m,r){return new Float64Array(m,r,2)}function h(){return[0,0]}function f(){return[1,1]}function c(){return[1,0]}function e(){return[0,1]}const g=[0,
0],d=[1,1],t=[1,0],w=[0,1],v=Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:t,UNIT_Y:w,ZEROS:g,clone:q,create:b,createView:k,fromArray:p,fromValues:l,ones:f,unitX:c,unitY:e,zeros:h},Symbol.toStringTag,{value:"Module"}));a.ONES=d;a.UNIT_X=t;a.UNIT_Y=w;a.ZEROS=g;a.clone=q;a.create=b;a.createView=k;a.fromArray=p;a.fromValues=l;a.ones=f;a.unitX=c;a.unitY=e;a.vec2f64=v;a.zeros=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/plane":function(){define("exports ../../core/mathUtils ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ../../chunks/vec42 ./vector ./vectorStacks ../../views/3d/support/mathUtils".split(" "),
function(a,b,q,l,p,k,h,f){function c(H=B){return[H[0],H[1],H[2],H[3]]}function e(H,N){return g(N[0],N[1],N[2],N[3],H)}function g(H,N,E,G,I=c()){I[0]=H;I[1]=N;I[2]=E;I[3]=G;return I}function d(H,N,E){var G=N[0]*N[0]+N[1]*N[1]+N[2]*N[2];G=1E-5<Math.abs(G-1)&&1E-12<G?1/Math.sqrt(G):1;E[0]=N[0]*G;E[1]=N[1]*G;E[2]=N[2]*G;E[3]=-(E[0]*H[0]+E[1]*H[1]+E[2]*H[2]);return E}function t(H,N,E,G=c()){var I=E[0]-N[0],O=E[1]-N[1],L=E[2]-N[2];E=H[0]-N[0];const P=H[1]-N[1],M=H[2]-N[2];N=O*M-L*P;L=L*E-I*M;I=I*P-O*E;
O=N*N+L*L+I*I;O=1E-5<Math.abs(O-1)&&1E-12<O?1/Math.sqrt(O):1;G[0]=N*O;G[1]=L*O;G[2]=I*O;G[3]=-(G[0]*H[0]+G[1]*H[1]+G[2]*H[2]);return G}function w(H,N,E,G=0,I=Math.floor(1/3*E),O=Math.floor(2/3*E)){if(3>E)return!1;N(u,G);let L=I,P=!1;for(;L<E-1&&!P;)N(x,L),L++,P=!q.exactEquals(u,x);if(!P)return!1;L=Math.max(L,O);for(P=!1;L<E&&!P;)N(y,L),L++,q.subtract(z,u,x),q.normalize(z,z),q.subtract(A,x,y),q.normalize(A,A),P=!q.exactEquals(u,y)&&!q.exactEquals(x,y)&&.99619469809>Math.abs(q.dot(z,A));if(!P)return 0===
G&&1===I&&2===O?!1:w(H,N,E,0,1,2);t(u,x,y,H);return!0}function v(H,N,E){H=q.scale(h.sv3d.get(),H,q.dot(H,N));q.subtract(E,N,H);return E}function m(H,N){return q.dot(H,N)+H[3]}function r(H,N,E,G,I){const O=q.dot(H,E);if(0===O)return!1;H=-(q.dot(H,N)+H[3])/O;G&C.CLAMP&&(H=b.clamp(H,0,1));if(!(G&C.INFINITE_MIN)&&0>H||!(G&C.INFINITE_MAX)&&1<H)return!1;q.add(I,N,q.scale(I,E,H));return!0}const n=p.exactEquals;p=p.equals;const u=l.create(),x=l.create(),y=l.create(),z=l.create(),A=l.create(),B=[0,0,1,0];
var C;(function(H){H[H.NONE=0]="NONE";H[H.CLAMP=1]="CLAMP";H[H.INFINITE_MIN=4]="INFINITE_MIN";H[H.INFINITE_MAX=8]="INFINITE_MAX"})(C||={});const D=C.INFINITE_MIN|C.INFINITE_MAX,F=C.INFINITE_MAX;a.clip=function(H,N){const E=q.dot(H,N.ray.direction);H=-m(H,N.ray.origin);if(0>H&&0<=E)return!1;if(-1E-6<E&&1E-6>E)return 0<H;if((0>H||0>E)&&!(0>H&&0>E))return!0;H/=E;0<E?H<N.c1&&(N.c1=H):H>N.c0&&(N.c0=H);return N.c0<=N.c1};a.clipInfinite=function(H,N){const E=q.dot(H,N.ray.direction);H=-m(H,N.ray.origin);
if(-1E-6<E&&1E-6>E)return 0<H;H/=E;0<E?H<N.c1&&(N.c1=H):H>N.c0&&(N.c0=H);return N.c0<=N.c1};a.copy=e;a.create=c;a.distance=function(H,N){return Math.abs(m(H,N))};a.equals=p;a.exactEquals=n;a.fromArray=function(H,N,E=!0){const G=N.length/3;return w(H,(I,O)=>q.set(I,N[3*O],N[3*O+1],N[3*O+2]),E?G-1:G)};a.fromManyPoints=w;a.fromNormalAndOffset=function(H,N,E){q.copy(E,H);E[3]=N;return E};a.fromPoints=t;a.fromPositionAndNormal=d;a.fromValues=g;a.fromVectorsAndPoint=function(H,N,E,G){q.cross(y,N,H);return d(E,
y,G)};a.getNormal=function(H){return H};a.intersectLine=function(H,N,E,G){E=q.subtract(h.sv3d.get(),E,N);return r(H,N,E,D,G)};a.intersectLineSegment=function(H,N,E){return r(H,N.origin,N.vector,C.NONE,E)};a.intersectLineSegmentClamp=function(H,N,E){return r(H,N.origin,N.vector,C.CLAMP,E)};a.intersectRay=function(H,N,E){return null!=N?r(H,N.origin,N.direction,F,E):!1};a.isPointInside=function(H,N){return 0<=m(H,N)};a.negate=function(H,N){N[0]=-H[0];N[1]=-H[1];N[2]=-H[2];N[3]=-H[3];return N};a.projectPoint=
function(H,N,E){const G=q.scale(h.sv3d.get(),H,-H[3]);N=q.subtract(h.sv3d.get(),N,G);H=v(H,N,h.sv3d.get());q.add(E,H,G);return E};a.projectPointLocal=function(H,N,E,G){var I=h.sv3d.get(),O=h.sv3d.get();f.tangentFrame(H,I,O);N=q.subtract(h.sv3d.get(),E,N);I=k.projectPointSignedLength(I,N);O=k.projectPointSignedLength(O,N);H=k.projectPointSignedLength(H,N);return q.set(G,I,O,H)};a.projectVector=v;a.setOffsetFromPoint=function(H,N,E){N!==H&&e(H,N);H[3]=-q.dot(H,E);return H};a.signedDistance=m;a.up=B;
a.wrap=function(H=B[0],N=B[1],E=B[2],G=B[3]){return g(H,N,E,G,h.sv4d.get())};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/vector":function(){define(["exports","../../core/mathUtils","../../chunks/vec32","../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b,q,l){const p=l.create(),k=l.create();a.angle=function(h,f){h=q.dot(h,f)/(q.length(h)*q.length(f));return-b.acosClamped(h)};a.angleAroundAxis=function(h,f,c){q.normalize(p,h);q.normalize(k,f);h=q.dot(p,
k);h=b.acosClamped(h);f=q.cross(p,p,k);return 0>q.dot(f,c)?2*Math.PI-h:h};a.projectPoint=function(h,f,c){f=q.dot(h,f)/q.dot(h,h);return q.scale(c,h,f)};a.projectPointSignedLength=function(h,f){return q.dot(h,f)/q.length(h)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/mathUtils":function(){define(["exports","../../../core/mathUtils","../../../chunks/vec32","../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b,q,l){const p=l.create(),k=l.create(),
h=l.create(),f=l.create(),c=l.create();a.angle=function(e,g,d){e=q.normalize(f,e);g=q.normalize(c,g);const t=b.acosClamped(q.dot(e,g));return d&&(e=q.cross(h,e,g),0>q.dot(e,d))?-t:t};a.bilerp=function(e,g,d,t,w,v){e+=(g-e)*w;return e+(d+(t-d)*w-e)*v};a.cosCapped=function(e,g){return e>g?Math.cos(g):Math.cos(e)};a.fovx2fovy=function(e,g,d){return 2*Math.atan(d*Math.tan(.5*e)/g)};a.fovy2fovx=function(e,g,d){return 2*Math.atan(g*Math.tan(.5*e)/d)};a.makeOrthonormal=function(e,g,d){d=d||e;const t=q.dot(e,
g);q.set(d,e[0]-t*g[0],e[1]-t*g[1],e[2]-t*g[2]);q.normalize(d,d)};a.makePiecewiseLinearFunction=function(e){const g=e.length;return d=>{if(d<=e[0][0])return e[0][1];if(d>=e[g-1][0])return e[g-1][1];let t=1;for(;d>e[t][0];)t++;const w=e[t][0];d=(w-d)/(w-e[t-1][0]);return d*e[t-1][1]+(1-d)*e[t][1]}};a.maxScale=function(e){return Math.sqrt(Math.max(e[0]*e[0]+e[4]*e[4]+e[8]*e[8],e[1]*e[1]+e[5]*e[5]+e[9]*e[9],e[2]*e[2]+e[6]*e[6]+e[10]*e[10]))};a.midpoint3d=function(e,g){q.set(g,0,0,0);if(0<e.length){for(let d=
0;d<e.length;++d)q.add(g,g,e[d]);q.scale(g,g,1/e.length)}};a.planeFromPoints=function(e,g,d,t){q.subtract(p,g,e);q.subtract(k,d,e);q.cross(t,p,k);q.normalize(t,t);t[3]=-q.dot(e,t)};a.scaleFromMatrix=function(e,g){q.set(e,Math.sqrt(g[0]*g[0]+g[4]*g[4]+g[8]*g[8]),Math.sqrt(g[1]*g[1]+g[5]*g[5]+g[9]*g[9]),Math.sqrt(g[2]*g[2]+g[6]*g[6]+g[10]*g[10]));return e};a.slerp=function(e,g,d,t=l.create()){const w=q.length(e);var v=q.length(g),m=q.dot(e,g)/(w*v);if(.9999999999999999>m){m=Math.acos(m);const r=((1-
d)*w+d*v)/Math.sin(m);v=r/v*Math.sin(d*m);q.scale(f,e,r/w*Math.sin((1-d)*m));q.scale(c,g,v);return q.add(t,f,c)}return q.lerp(t,e,g,d)};a.slerpTangent=function(e,g,d,t=l.create(),w=l.create()){const v=q.length(e),m=q.length(g);var r=q.dot(e,g)/(v*m);if(.9999999999999999>r){r=Math.acos(r);const n=Math.sin(r),u=Math.sin(d*r),x=Math.sin((1-d)*r),y=(1-d)*v+d*m,z=y/n,A=z/m*u;q.scale(f,e,z/v*x);q.scale(c,g,A);q.add(t,f,c);q.scale(f,e,1/v*(-Math.cos((1-d)*r)*r*y+x*(-v+m)));q.scale(c,g,1/m*(Math.cos(d*r)*
r*y+u*(-v+m)));q.add(w,f,c);q.scale(w,w,1/n);return w}q.lerp(t,e,g,d);q.subtract(w,g,e);q.normalize(w,w);return w};a.tangentFrame=function(e,g,d){Math.abs(e[0])>Math.abs(e[1])?q.set(g,0,1,0):q.set(g,1,0,0);q.cross(d,e,g);q.cross(g,d,e);q.normalize(d,d);q.normalize(g,g)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/ray":function(){define("exports ../../core/arrayUtils ../../core/ObjectStack ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ./vectorStacks".split(" "),
function(a,b,q,l,p,k){function h(d){return d?f(p.clone(d.origin),p.clone(d.direction)):f(p.create(),p.create())}function f(d,t){return{origin:d,direction:t}}function c(d,t,w=h()){l.copy(w.origin,d);l.copy(w.direction,t);return w}const e=new q.ObjectStack(()=>h()),g=p.create();a.closestPoint=function(d,t,w){t=l.dot(d.direction,l.subtract(w,t,d.origin));l.add(w,d.origin,l.scale(w,d.direction,t));return w};a.closestPoints=function(d,t,w,v){const m=d.direction,r=t.direction;var n=l.sub(g,t.origin,d.origin);
const u=l.dot(m,r),x=l.dot(r,n);n=l.dot(m,n);const y=l.dot(m,m),z=l.dot(r,r),A=(u*n-x*y)/(y*z-u*u);l.add(w,d.origin,l.scale(g,m,(u*x+n*z)/(y*z-u*u)));l.add(v,t.origin,l.scale(g,r,A));return[w,v]};a.copy=function(d,t=h()){return c(d.origin,d.direction,t)};a.create=h;a.distance2=function(d,t){d=l.cross(k.sv3d.get(),l.normalize(k.sv3d.get(),d.direction),l.subtract(k.sv3d.get(),t,d.origin));return l.dot(d,d)};a.equals=function(d,t){return b.equals(d.origin,t.origin)&&b.equals(d.direction,t.direction)};
a.fromPoints=function(d,t,w=h()){l.copy(w.origin,d);l.subtract(w.direction,t,d);return w};a.fromValues=c;a.wrap=function(d,t){const w=e.get();w.origin=d;w.direction=t;return w};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/coordinateSystem":function(){define("exports ../../core/libs/gl-matrix-2/math/mat4 ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ../ellipsoidUtils ../SpatialReference ../spatialReferenceEllipsoidUtils ./Axis ../../chunks/boundedPlane ../../chunks/sphere".split(" "),
function(a,b,q,l,p,k,h,f,c,e){function g(r){return{operations:r,value:r.create()}}function d(r,n,u=g(r)){u.operations=r;r.copy(n,u.value);return u}function t(r,n,u,x){return r.operations.setAltitudeAt(r.value,n,u,x)}const w=2**50,v=l.create(),m=l.create();a.altitudeAt=function(r,n){return r.operations.altitudeAt(r.value,n)};a.axisAt=function(r,n,u,x){return r.operations.axisAt(r.value,n,u,x)};a.closestPoint=function(r,n,u){return r.operations.closestPoint(r.value,n,u)};a.closestPointOnSilhouette=
function(r,n,u){return r.operations.closestPointOnSilhouette(r.value,n,u)};a.coordinateSystemFromOneAxisAndNormalVector=function(r,n,u,x,y){q.copy(u,r);q.copy(m,n);q.normalize(m,m);q.cross(x,m,u);q.cross(y,x,u)};a.create=function(r){const {value:n,operations:u}=r;return{operations:u,value:u.create(n)}};a.createFromOperations=g;a.createGlobal=function(r){return d(e.sphere,e.fromValues(0,0,0,p.getReferenceEllipsoid(r).radius))};a.createLocal=function(){return d(c.boundedPlane,c.fromValues([0,0,0],[w,
0,0],[0,w,0]))};a.distanceToSilhouette=function(r,n){return r.operations.distanceToSilhouette(r.value,n)};a.elevate=function(r,n,u){return r.operations.elevate(r.value,n,u.value)};a.fromValues=d;a.intersectRay=function(r,n,u){return r.operations.intersectRay(r.value,n,u)};a.intersectRayClosestSilhouette=function(r,n,u){return r.operations.intersectRayClosestSilhouette(r.value,n,u)};a.normalAt=function(r,n,u){return r.operations.axisAt(r.value,n,f.Axis.Z,u)};a.renderSRFromViewSR=function(r,n){return r?
h.getSphericalPCPF(n):n.isGeographic?k.PlateCarree:n};a.setAltitudeAt=t;a.setAltitudeOfTransformation=function(r,n,u,x){n!==x&&b.copy(x,n);q.set(v,x[12],x[13],x[14]);t(r,v,u,v);x[12]=v[0];x[13]=v[1];x[14]=v[2];return x};a.setExtent=function(r,n,u){r.operations.setExtent(r.value,n,u.value);return u};a.vectorCoordinates=function(r,n,u,x,y){y[0]=q.dot(r,n);y[1]=q.dot(r,u);y[2]=q.dot(r,x);return y};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/spatialReferenceEllipsoidUtils":function(){define(["exports",
"./ellipsoidUtils","./SpatialReference","./support/spatialReferenceUtils"],function(a,b,q,l){const p=new q(b.SphericalECEFSpatialReferenceLike),k=new q(b.SphericalPCPFMarsLike),h=new q(b.SphericalPCPFMoonLike);b=new q(b.WGS84ECEFSpatialReferenceLike);const f=new Map,c=k.wkt.toUpperCase(),e=h.wkt.toUpperCase();a.SphericalECEFSpatialReference=p;a.SphericalPCPFMars=k;a.SphericalPCPFMoon=h;a.WGS84ECEFSpatialReference=b;a.getSphericalPCPF=function(g){var d=f.get(g);if(d)return d;d=p;if(g)if(g===k)d=k;
else if(g===h)d=h;else{var t=g.wkid;const w=g.latestWkid;if(null!=t||null!=w)if(l.isWKIDFromMars(t)||l.isWKIDFromMars(w))d=k;else{if(l.isWKIDFromMoon(t)||l.isWKIDFromMoon(w))d=h}else if(t=g.wkt2??g.wkt)t=t.toUpperCase(),t===c?d=k:t===e&&(d=h)}f.set(g,d);return d};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/sphere":function(){define("exports ../core/has ../core/Logger ../core/mathUtils ../core/libs/gl-matrix-2/math/mat4 ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ./vec42 ../core/libs/gl-matrix-2/factories/vec4f64 ../core/libs/gl-matrix-2/math/common ../geometry/support/Axis ../geometry/support/ray ../geometry/support/vector ../geometry/support/vectorStacks".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(){return c.create()}function m(U,Z){return f.copy(Z,U)}function r(U,Z){return c.fromValues(U[0],U[1],U[2],Z)}function n(U){return U}function u(U){U[0]=U[1]=U[2]=U[3]=0}function x(U,Z){U[0]=U[1]=U[2]=0;U[3]=Z;return U}function y(U){return U[3]}function z(U){return U}function A(U,Z,ca,ea){return c.fromValues(U,Z,ca,ea)}function B(U,Z,ca){U!==ca&&(ca[0]=U[0],ca[1]=U[1],ca[2]=U[2]);ca[3]=U[3]+Z;return ca}function C(U,Z,ca){U!==ca&&m(U,ca);return ca}function D(U,
Z,ca){if(null==Z||!H(U,Z,S))return!1;let {t0:ea,t1:da}=S;if(0>ea||da<ea&&0<da)ea=da;if(0>ea)return!1;if(ca){const {origin:ia,direction:ka}=Z;ca[0]=ia[0]+ka[0]*ea;ca[1]=ia[1]+ka[1]*ea;ca[2]=ia[2]+ka[2]*ea}return!0}function F(U,Z,ca){Z=d.fromPoints(Z,ca);if(!H(U,Z,S))return[];const {origin:ea,direction:da}=Z,{t0:ia,t1:ka}=S;Z=fa=>{const X=h.create();k.scaleAndAdd(X,ea,da,fa);return O(U,X,X)};return Math.abs(ia-ka)<e.getEpsilon()?[Z(ia)]:[Z(ia),Z(ka)]}function H(U,Z,ca){const {origin:ea,direction:da}=
Z,ia=V;ia[0]=ea[0]-U[0];ia[1]=ea[1]-U[1];ia[2]=ea[2]-U[2];Z=da[0]*da[0]+da[1]*da[1]+da[2]*da[2];if(0===Z)return!1;const ka=2*(da[0]*ia[0]+da[1]*ia[1]+da[2]*ia[2]);U=ka*ka-4*Z*(ia[0]*ia[0]+ia[1]*ia[1]+ia[2]*ia[2]-U[3]*U[3]);if(0>U)return!1;U=Math.sqrt(U);ca.t0=(-ka-U)/(2*Z);ca.t1=(-ka+U)/(2*Z);return!0}function N(U,Z){return D(U,Z,null)}function E(U,Z,ca){if(D(U,Z,ca))return ca;U=G(U,Z,w.sv3d.get());k.add(ca,Z.origin,k.scale(w.sv3d.get(),Z.direction,k.distance(Z.origin,U)/k.length(Z.direction)));return ca}
function G(U,Z,ca){const ea=w.sv3d.get(),da=w.sm4d.get();k.cross(ea,Z.origin,Z.direction);const ia=U[3];k.cross(ca,ea,Z.origin);k.scale(ca,ca,1/k.length(ca)*ia);U=P(U,Z.origin);Z=t.angle(Z.origin,ca);p.fromRotation(da,Z+U,ea);k.transformMat4(ca,ca,da);return ca}function I(U,Z,ca){if(D(U,Z,ca))return ca;d.closestPoint(Z,U,ca);return O(U,ca,ca)}function O(U,Z,ca){Z=k.subtract(w.sv3d.get(),Z,U);Z=k.scale(w.sv3d.get(),Z,U[3]/k.length(Z));return k.add(ca,Z,U)}function L(U,Z){Z=k.subtract(w.sv3d.get(),
Z,U);Z=k.squaredLength(Z);return Math.sqrt(Math.abs(Z-U[3]*U[3]))}function P(U,Z){Z=k.subtract(w.sv3d.get(),Z,U);Z=k.length(Z);U=U[3];return l.acosClamped(U/(U+Math.abs(U-Z)))}function M(U,Z,ca,ea){U=k.subtract(T,Z,U);switch(ca){case g.Axis.X:return ca=l.cartesianToSpherical(U,T)[2],k.set(ea,-Math.sin(ca),Math.cos(ca),0);case g.Axis.Y:return U=l.cartesianToSpherical(U,T),ca=U[1],U=U[2],Z=Math.sin(ca),k.set(ea,-Z*Math.cos(U),-Z*Math.sin(U),Math.cos(ca));case g.Axis.Z:return k.normalize(ea,U)}}function K(U,
Z){Z=k.subtract(Y,Z,U);return k.length(Z)-U[3]}function J(U,Z,ca,ea){const da=K(U,Z);U=M(U,Z,g.Axis.Z,Y);ca=k.scale(Y,U,ca-da);return k.add(ea,Z,ca)}function R(U,Z){Z=k.squaredDistance(U,Z);U=U[3];return Z<=U*U}function Q(U,Z,ca=c.create()){const ea=k.distance(U,Z),da=U[3],ia=Z[3];if(ea+ia<da)return f.copy(ca,U),ca;if(ea+da<ia)return f.copy(ca,Z),ca;k.lerp(ca,U,Z,(ea+ia-da)/(2*ea));ca[3]=(ea+da+ia)/2;return ca}b=v();const W=q=f.equals,S={t0:0,t1:0},V=h.create(),T=h.create(),Y=h.create(),ha=v(),ba=
Object.freeze(Object.defineProperty({__proto__:null,NullSphere:b,altitudeAt:K,angleToSilhouette:P,axisAt:M,clear:u,closestPoint:I,closestPointOnSilhouette:G,containsPoint:R,copy:m,create:v,distanceToSilhouette:L,elevate:B,equals:W,exactEquals:q,fromCenterAndRadius:r,fromRadius:x,fromValues:A,getCenter:z,getRadius:y,intersectLine:F,intersectRay:D,intersectRayClosestSilhouette:E,intersectsRay:N,projectPoint:O,setAltitudeAt:J,setExtent:C,tmpSphere:ha,union:Q,wrap:n},Symbol.toStringTag,{value:"Module"}));
a.NullSphere=b;a.altitudeAt=K;a.angleToSilhouette=P;a.axisAt=M;a.clear=u;a.closestPoint=I;a.closestPointOnSilhouette=G;a.containsPoint=R;a.copy=m;a.create=v;a.distanceToSilhouette=L;a.elevate=B;a.equals=W;a.exactEquals=q;a.fromCenterAndRadius=r;a.fromRadius=x;a.fromValues=A;a.getCenter=z;a.getRadius=y;a.intersectLine=F;a.intersectRay=D;a.intersectRayClosestSilhouette=E;a.intersectsRay=N;a.projectPoint=O;a.setAltitudeAt=J;a.setExtent=C;a.sphere=ba;a.tmpSphere=ha;a.union=Q;a.wrap=n})},"esri/geometry/support/scaleUtils":function(){define(["exports",
"../../core/mathUtils","../../core/unitUtils"],function(a,b,q){function l(p,k){k=q.getMetersPerUnitForSR(k);return p/(k*q.inchesPerMeter*96)}a.getExtentForScale=function(p,k){const h=p.extent;p=p.width-(p.padding?p.padding.left+p.padding.right:0);k=l(k,h.spatialReference);return h.clone().expand(k*p/h.width)};a.getResolutionForScale=l;a.getResolutionInMetersForScale=function(p){return p/(96*q.inchesPerMeter)};a.getScale=function(p,k){k=k||p.extent;p=p.width;const h=q.getMetersPerUnitForSR(k?.spatialReference);
return k&&p?k.width/p*h*q.inchesPerMeter*96:0};a.getScaleForResolution=function(p,k){k=q.getMetersPerUnitForSR(k);return p*k*q.inchesPerMeter*96};a.isInScaleRange=function(p,k,h){if(k=0===k||b.floatEqualAbsolute(p,k)||p<k)k=0===h||b.floatEqualAbsolute(p,h)||p>h;return k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/BreakpointsOwner":function(){define("exports ../chunks/tslib.es6 ../core/ArrayPool ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f,c){function e(t,w){return w?g[t].valueToClassName[w].split(" "):[]}const g={widthBreakpoint:{getValue(t){const w=t.viewSize[0];t=t.breakpoints;const v=this.values;return w<=t.xsmall?v.xsmall:w<=t.small?v.small:w<=t.medium?v.medium:w<=t.large?v.large:v.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",
small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",
xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(t){const w=t.viewSize[1];t=t.breakpoints;const v=this.values;return w<=t.xsmall?v.xsmall:w<=t.small?v.small:w<=t.medium?v.medium:w<=t.large?v.large:v.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",
small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",
xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(t){t=t.viewSize;const w=this.values;return t[1]>=t[0]?w.portrait:w.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},d={xsmall:544,small:768,medium:992,large:1200};a.BreakpointsOwner=
t=>{t=class extends t{constructor(...w){super(...w);this.heightBreakpoint=this.widthBreakpoint=this.orientation=null;this.breakpoints=d}initialize(){this.addHandles(l.watch(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),l.initial))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(w){var v=this._get("breakpoints");w!==v&&(v=w,v&&v.xsmall<v.small&&v.small<v.medium&&v.medium<v.large||(w=JSON.stringify(d,null,2),console.warn("provided breakpoints are not valid, using defaults:"+
w),w=d),this._set("breakpoints",{...w}))}_updateClassNames(){if(this.container){var w=q.acquire(),v=q.acquire(),m=!1,r;for(r in g){const n=this[r],u=g[r].getValue({viewSize:this.size,breakpoints:this.breakpoints});n!==u&&(m=!0,this[r]=u,e(r,n).forEach(x=>v.push(x)),e(r,u).forEach(x=>w.push(x)))}m&&(this._applyClassNameChanges(w,v),q.release(w),q.release(v))}}_applyClassNameChanges(w,v){const m=this.container;m&&(v.forEach(r=>m.classList.remove(r)),w.forEach(r=>m.classList.add(r)))}_removeActiveClassNames(){const w=
this.container;if(w)for(var v in g)e(v,this[v]).forEach(m=>w.classList.remove(m))}};b.__decorate([p.property()],t.prototype,"breakpoints",null);b.__decorate([p.property()],t.prototype,"orientation",void 0);b.__decorate([p.property()],t.prototype,"widthBreakpoint",void 0);b.__decorate([p.property()],t.prototype,"heightBreakpoint",void 0);return t=b.__decorate([c.subclass("esri.views.BreakpointsOwner")],t)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/DOMContainer":function(){define("exports ../chunks/tslib.es6 ../core/domUtils ../core/events ../core/Logger ../core/maybe ../core/reactiveUtils ../core/scheduling ../core/accessorSupport/decorators/property ../core/has ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./overlay/ViewOverlay".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){function w(m){m&&(q.empty(m),m.parentNode&&m.parentNode.removeChild(m))}const v=[0,0];a.DOMContainer=m=>{m=class extends m{constructor(...r){super(...r);this._freqInfo={freq:16,time:750};this._overlayRenderTaskHandle=null;this.height=0;this.position=this.overlay=this.messagesCommon=null;this.resizing=!1;this.surface=this.root=null;this.suspended=!0;this.userContent=this.ui=null;this.width=0;this.widthBreakpoint=null;this.addHandles([h.watch(()=>this.cursor,n=>{const {surface:u}=
this;u&&u.setAttribute("data-cursor",n)}),h.watch(()=>this.navigating,n=>{const {surface:u}=this;u&&u.setAttribute("data-navigating",n.toString())})])}initialize(){this.addHandles([h.watch(()=>this.ui,(r,n)=>this._handleUIChange(r,n),h.initial),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui=k.destroyMaybe(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(r){var n=
this._get("container");const u=q.byId(r);u||"string"!==typeof r||p.getLogger(this).error("#container",`element with id '${r}' not found`);if(n!==u)if(this._stopMeasuring(),n&&(n.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(w(this.root),this._set("root",null)),this.userContent&&(q.reparent(this.userContent,n),w(this.userContent),this._set("userContent",
null))),u){u.classList.add("esri-view");r=document.createElement("div");r.className="esri-view-user-storage";q.reparent(u,r);u.appendChild(r);this._set("userContent",r);r=document.createElement("div");r.className="esri-view-root";u.insertBefore(r,u.firstChild);this._set("root",r);n=document.createElement("div");n.className="esri-view-surface";n.setAttribute("role","application");n.tabIndex=0;r.appendChild(n);this._set("surface",n);var x=new t;r.appendChild(x.surface);this._set("overlay",x);this.addHandles(h.watch(()=>
x.needsRender,y=>{this._overlayRenderTaskHandle=y&&!this._overlayRenderTaskHandle?f.addFrameTask({render:()=>this.overlay?.render()}):k.removeMaybe(this._overlayRenderTaskHandle)}));this.forceDOMReadyCycle();this._set("container",u);this._startMeasuring()}else this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),this._set("container",null)}get focused(){const r=document.activeElement===this.surface;return document.hasFocus()&&r}get size(){return[this.width,
this.height]}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(r,n,u){const x=this.position;r-=x?x[0]:0;n-=x?x[1]:0;u?(u[0]=r,u[1]=n):u=[r,n];return u}containerToPage(r,n,u){const x=this.position;r+=x?x[0]:0;n+=x?x[1]:0;u?(u[0]=r,u[1]=n):u=[r,n];return u}_handleUIChange(r,n){this.removeHandles("ui");n&&n!==r&&n.destroy();r&&(r.view=this,this.addHandles(h.watch(()=>this.root,u=>{if(u){const x=document.createElement("div");u.appendChild(x);u=x}else u=null;r.container=u},h.initial),
"ui"));this._set("ui",r)}_stopMeasuring(){this.removeHandles("measuring");this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const r=this._freqInfo;r.freq=16;r.time=750;this.addHandles([l.on(window,"resize",()=>{r.freq=16;r.time=750}),f.addFrameTask({prepare:n=>{const u=this._measure(),x=this._freqInfo;x.time+=n.deltaTime;u&&(x.freq=16,this._get("resizing")||this._set("resizing",!0));x.time<x.freq||(x.time=0,this._position()||u?x.freq=16:x.freq=Math.min(750,2*x.freq),!u&&512<=x.freq&&
this._get("resizing")&&this._set("resizing",!1))}})],"measuring");this._measure();this._position()}_measure(){var r=this.container;const n=r?r.clientWidth:0;r=r?r.clientHeight:0;if(0===n||0===r)return this.suspended||this._set("suspended",!0),!1;const u=this.width,x=this.height;if(n===u&&r===x)return this.suspended&&this._set("suspended",!1),!1;this._set("width",n);this._set("height",r);this.suspended&&this._set("suspended",!1);this.emit("resize",{oldWidth:u,oldHeight:x,width:n,height:r});return!0}_position(){var r=
this.container;const n=this.position;var u;if(u=r)u=(r.ownerDocument||window.document).defaultView,r=r.getBoundingClientRect(),v[0]=r.left+(u?.pageXOffset??0),v[1]=r.top+(u?.pageYOffset??0),u=v;r=u;return r?n&&r[0]===n[0]&&r[1]===n[1]?!1:(this._set("position",[r[0],r[1]]),!0):!1}forceDOMReadyCycle(){}};b.__decorate([c.property()],m.prototype,"container",null);b.__decorate([c.property({readOnly:!0})],m.prototype,"focused",null);b.__decorate([c.property({readOnly:!0})],m.prototype,"height",void 0);
b.__decorate([c.property()],m.prototype,"messagesCommon",void 0);b.__decorate([c.property({type:t})],m.prototype,"overlay",void 0);b.__decorate([c.property({readOnly:!0})],m.prototype,"position",void 0);b.__decorate([c.property({readOnly:!0})],m.prototype,"resizing",void 0);b.__decorate([c.property({readOnly:!0})],m.prototype,"root",void 0);b.__decorate([c.property({value:null,readOnly:!0})],m.prototype,"size",null);b.__decorate([c.property({readOnly:!0})],m.prototype,"surface",void 0);b.__decorate([c.property({readOnly:!0})],
m.prototype,"suspended",void 0);b.__decorate([c.property()],m.prototype,"ui",void 0);b.__decorate([c.property({readOnly:!0})],m.prototype,"userContent",void 0);b.__decorate([c.property({readOnly:!0})],m.prototype,"width",void 0);b.__decorate([c.property()],m.prototype,"widthBreakpoint",void 0);return m=b.__decorate([d.subclass("esri.views.DOMContainer")],m)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/overlay/ViewOverlay":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/Collection ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../core/support/UpdatingHandles ../../libs/maquette/projection ../../libs/maquette/projector".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){b=class extends b{constructor(){super(...arguments);this.items=new q;this._watchUpdatingTracking=new c.UpdatingHandles;this._callbacks=new Map;this._projector=g.createProjector();this._hiddenProjector=g.createProjector()}get needsRender(){return 0<this.items.length}get updating(){return this._watchUpdatingTracking?.updating??!1}initialize(){const d=document.createElement("div");d.className="esri-overlay-surface";this._set("surface",d);this._hiddenSurface=document.createElement("div");
this._hiddenSurface.setAttribute("style","visibility: hidden;");d.appendChild(this._hiddenSurface);this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,t=>{for(const w of t.added){const v=()=>w.render();this._callbacks.set(w,v);this._projector.append(this.surface,v)}for(const w of t.removed)t=this._projector.detach(this._callbacks.get(w)),this.surface.removeChild(t.domNode),this._callbacks.delete(w)})}addItem(d){this.items.add(d)}removeItem(d){this.items.remove(d)}destroy(){this.items.removeAll();
this._callbacks.forEach(d=>this._projector.detach(d));this._projector=this._callbacks=null;this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(d){const t=this._hiddenSurface,w=this._hiddenProjector;let v;const m=()=>v=d.render();w.append(t,m);w.renderNow();const r={left:0,top:0,right:0,bottom:0};if(v?.domNode){const n=v.domNode.getBoundingClientRect();r.left=n.left;r.top=n.top;r.right=n.right;r.bottom=n.bottom}for(w.detach(m);t.firstChild;)t.removeChild(t.firstChild);
return r}overlaps(d,t){d=this.computeBoundingRect(d);t=this.computeBoundingRect(t);return Math.max(d.left,t.left)<=Math.min(d.right,t.right)&&Math.max(d.top,t.top)<=Math.min(d.bottom,t.bottom)}get hasVisibleItems(){return this.items.some(d=>d.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(d,t){const w=!!t?.disableDecorations;if(this.items.some(m=>m.visible&&!(w&&m.isDecoration))){var v=d.getContext("2d");v.save();v.font=this._fontString();this.items.forEach(m=>
{w&&m.isDecoration||(v.save(),m.renderCanvas(v),v.restore())});v.restore()}}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};a.__decorate([l.property({readOnly:!0})],b.prototype,"surface",void 0);a.__decorate([l.property({readOnly:!0})],b.prototype,"items",void 0);a.__decorate([l.property({readOnly:!0})],b.prototype,"needsRender",null);a.__decorate([l.property({readOnly:!0})],b.prototype,"_watchUpdatingTracking",void 0);a.__decorate([l.property({readOnly:!0})],b.prototype,
"updating",null);return b=a.__decorate([f.subclass("esri.views.overlay.ViewOverlay")],b)})},"esri/views/GroundView":function(){define("../chunks/tslib.es6 ../core/Accessor ../core/Collection ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./3d/support/cameraUtils ./support/GroundViewElevationSampler".split(" "),function(a,b,q,l,p,k,h,f,c,e,g){b=class extends b{constructor(d){super(d);this.view=
null;this.layerViews=new q}initialize(){this.addHandles(l.when(()=>this.view?.map?.ground,d=>d.load()));this.addHandles(this.layerViews.on("after-changes",()=>this._layerViewsAfterChangesHandler()))}destroy(){this._set("view",null);for(const d of this.layerViews)d.destroy();this.layerViews.length=0}get elevationSampler(){return this.view&&"2d"!==this.view.type&&this.view.ready&&this.view.basemapTerrain&&this.view.basemapTerrain.ready?new g({view:this.view}):null}get extent(){const d=this.view;return d&&
"2d"!==d.type&&d.ready?e.toExtent(d,d.state.camera,d.pointsOfInterest.centerOnSurfaceFrequent.renderLocation):null}get updating(){return this.suspended?!1:this.layerViews.some(d=>d.updating)}get suspended(){return!this.view||this.view.suspended}_layerViewsAfterChangesHandler(){this.removeHandles("updating");this.addHandles(this.layerViews.map(d=>l.watch(()=>d.updating,()=>this._updateUpdating(),l.sync)).toArray(),"updating");this._updateUpdating()}_updateUpdating(){this.notifyChange("updating")}};
a.__decorate([p.property({readOnly:!0})],b.prototype,"elevationSampler",null);a.__decorate([p.property({readOnly:!0})],b.prototype,"extent",null);a.__decorate([p.property({type:Boolean,readOnly:!0})],b.prototype,"updating",null);a.__decorate([p.property({constructOnly:!0})],b.prototype,"view",void 0);a.__decorate([p.property({type:q,readOnly:!0})],b.prototype,"layerViews",void 0);a.__decorate([p.property({readOnly:!0})],b.prototype,"suspended",null);return b=a.__decorate([c.subclass("esri.views.GroundView")],
b)})},"esri/views/3d/support/cameraUtils":function(){define("exports ../../../Camera ../../../core/Cyclical ../../../core/Logger ../../../core/mathUtils ../../../core/promiseUtils ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ../../../geometry/Point ../../../geometry/projection ../../../geometry/SpatialReference ../../../geometry/projection/projectPointToVector ../../../geometry/projection/projectVectorToPoint ../../../geometry/projection/projectVectorToVector ../../../geometry/support/planetGCSUtils ../../ViewingMode ../camera/intersectionUtils ../../../chunks/cameraUtilsPlanar ../../../chunks/cameraUtilsSpherical ./earthUtils ./ElevationProvider ../../support/spatialReferenceSupport".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){function B(da){return da.spatialReference??d.WGS84}function C(da){return"global"===da.viewingMode?x.cameraUtilsSpherical:u.cameraUtilsPlanar}function D(da,ia,ka){const fa=da.state.camera,X=fa.width/2/fa.pixelRatio;da.renderCoordsHelper.viewingMode===r.ViewingMode.Global&&null!=ka&&(ia*=Math.cos(p.deg2rad(ka)));ia/=da.renderCoordsHelper.unitInMeters;return X/(96*39.37/ia)/Math.tan(fa.fovX/2)}function F(da,ia,ka){const fa=da.state.camera;ia=96*
39.37/(fa.width/2/fa.pixelRatio/(ia*Math.tan(fa.fovX/2)));da.renderCoordsHelper.viewingMode===r.ViewingMode.Global&&null!=ka&&(ia/=Math.cos(p.deg2rad(ka)));return ia*da.renderCoordsHelper.unitInMeters}async function H(da,ia,ka,fa,X,ja){ia=await P(da,fa.heading,fa.tilt,ia,ka,X,ja);k.throwIfAborted(ja);return T(da,ia,fa.fov,ja)}function N(da,ia,ka,fa,X){return C(da).directionToHeadingTilt(ia,ka,fa,X)}function E(da,ia){return!!(da.basemapTerrain&&da.renderCoordsHelper.fromRenderCoords(ia,U,da.spatialReference)&&
da.elevationProvider&&(z.getElevationAtPoint(da.elevationProvider,U)??0)>U[2]-1)}async function G(da,ia,ka){if(E(da,ia))return!0;const {elevationProvider:fa,spatialReference:X,renderCoordsHelper:ja}=da;if(null==fa||!ja.fromRenderCoords(ia,U,X))return!1;const [la,na,va]=U;da=await fa.queryElevation(la,na,va,X,"ground",ka)??0;k.throwIfAborted(ka);return da>va-1}async function I(da,ia,ka){const fa=f.create();if(null==ia)return h.copy(fa,da.state.camera.center);if(ia instanceof e){const {renderSpatialReference:X,
basemapTerrain:ja,elevationProvider:la}=da,na=ia.spatialReference;await t.projectPointToVectorAsync(ia,fa,X,0,{signal:ka});k.throwIfAborted(ka);null==ia.z&&null!=ja&&null!=la&&(ia=await la.queryElevation(ia.x,ia.y,ia.z??0,na,"ground",ka),k.throwIfAborted(ka),null!=ia&&da.renderCoordsHelper.setAltitude(fa,ia));return fa}return h.copy(fa,ia)}function O(da,ia){const ka=f.create();if(null==ia)return h.copy(ka,da.state.camera.center);if(ia instanceof e){if(!t.projectPointToVector(ia,ka,da.renderSpatialReference))return null;
const {basemapTerrain:fa,elevationProvider:X}=da;null==ia.z&&null!=fa&&null!=X&&(ia=z.getElevationAtPoint(X,ia),null!=ia&&da.renderCoordsHelper.setAltitude(ka,ia));return ka}return h.copy(ka,ia)}function L(da,ia,ka,fa,X,ja){const la=fa instanceof e?fa:null;fa=O(da,fa);return M(da,ia,ka,la,fa,X,ja)}async function P(da,ia,ka,fa,X,ja,la){const na=fa instanceof e?fa:null;fa=await I(da,fa,la);k.throwIfAborted(la);return K(da,ia,ka,na,fa,X,ja,la)}function M(da,ia,ka,fa,X,ja,la){if(null==X||!fa&&(fa=new e({spatialReference:B(da)}),
!w.projectVectorToPoint(X,da.renderSpatialReference,fa)))return null;const na=J(da,ia,ka,X,ja,la);if(R(da,ka,la)&&E(da,na.eye)){const {tilt:va,mode:za}=Q(da,ka,X,ja);return M(da,ia,va,fa,X,ja,za)}return{...na,center:f.clone(X)}}async function K(da,ia,ka,fa,X,ja,la,na){fa||(fa=new e({spatialReference:B(da)}),await w.projectVectorToPointAsync(X,da.renderSpatialReference,fa,{signal:na})||(fa=null));k.throwIfAborted(na);const va=J(da,ia,ka,X,ja,la);if(R(da,ka,la)&&await G(da,va.eye,na)){k.throwIfAborted(na);
const {tilt:za,mode:ya}=Q(da,ka,X,ja);return K(da,ia,za,fa,X,ja,ya,na)}return{...va,center:f.clone(X)}}function J(da,ia,ka,fa,X,ja){X=Math.max(X,da.state.constraints.minimumPoiDistance);var la=ka;ka=X;let na=0;if(ja=ja===a.OrientationMode.ADJUST)ja=da.pointsOfInterest.centerOnSurfaceFrequent.distance,ja=8<Math.log(ka/ja)/Math.LN2?!0:5<h.distance(fa,da.pointsOfInterest.centerOnSurfaceFrequent.renderLocation)/(Math.tan(.5*da.state.camera.fov)*ja);ja?(ia=0,la=C(da).eyeTiltToLookAtTilt(la,fa,ka),da.state.constraints.tilt?
(ja=da.state.constraints.tilt(ka),ja.max=Math.min(ja.max,.5*Math.PI),na=Math.min(la,ja.min*(1-.7)+.7*ja.max)):na=la):na=C(da).eyeTiltToLookAtTilt(la,fa,ka);la=na=da.state.constraints.clampTilt(ka,na);ka=la=C(da).lookAtTiltToEyeTilt(la,fa,ka);da=C(da).eyeForCenterWithHeadingTilt;return da(fa,X,ia,ka)}function R(da,ia,ka){const fa=da.map.ground.navigationConstraint;return ka===a.OrientationMode.ADJUST&&"global"===da.viewingMode&&0<ia&&(null==fa||"stay-above"===fa.type)}function Q(da,ia,ka,fa){{let ja=
C(da).eyeTiltToLookAtTilt(ia,ka,fa);if(da.state.constraints.tilt){var X=da.state.constraints.tilt(fa);ja=Math.min(ja,.5*Math.PI);X=X.min*(1-.7)+.7*ja}else X=ja}da=C(da).lookAtTiltToEyeTilt(X,ka,fa);return{tilt:da,mode:1>ia-da?a.OrientationMode.LOCKED:a.OrientationMode.ADJUST}}function W(da,ia){const {state:ka,spatialReference:fa}=da;da=ia.spatialReference;return ka.isGlobal&&A.isSpatialReferenceSupported(da,r.ViewingMode.Global)||ka.isLocal&&fa.equals(da)}function S(da,ia){let ka;if(da.state.isGlobal){const ja=
new e(ia.xmin,ia.ymin,ia.spatialReference),la=new e(ia.xmax,ia.ymax,ia.spatialReference),na=ia.spatialReference.isGeographic?ca:Z;var fa=new e({x:na.center(ja.x,la.x),y:(la.y+ja.y)/2,z:null!=ia.zmax&&null!=ia.zmin?(ia.zmax+ia.zmin)/2:void 0,spatialReference:ia.spatialReference});const va=c.getReferenceEllipsoid(ia.spatialReference);var X=y.getGreatCircleSpanAt(fa,ja,la);ka=X.lon;X=X.lat;na.diff(ja.x,la.x)>na.range/2&&(ka+=va.halfCircumference);ka=Math.min(ka,va.halfCircumference);X=Math.min(X,va.halfCircumference)}else fa=
da.renderSpatialReference??ia.spatialReference,fa.equals(ia.spatialReference)||(ia=g.project(ia,fa)),ka=ia.xmax-ia.xmin,X=ia.ymax-ia.ymin,fa=new e({x:ia.xmin+.5*ka,y:ia.ymin+.5*X,z:null!=ia.zmax&&null!=ia.zmin?(ia.zmax+ia.zmin)/2:void 0,spatialReference:fa});da=da.state.camera;return{center:fa,distance:Math.max(1/Math.tan(da.fovX/2)*ka*.5,1/Math.tan(da.fovY/2)*X*.5,1/Math.tan(da.fov/2)*(null!=ia.zmax&&null!=ia.zmin?ia.zmax-ia.zmin:0)*.5)/1}}function V(da,ia,ka,fa){if(null==ia)return null;const X=
da.renderSpatialReference;da=new e({spatialReference:B(da)});if(!w.projectVectorToPoint(ia.eye,X,da))return null;fa??=new b;fa.position=da;fa.heading=ia.heading;fa.tilt=ia.tilt;fa.fov=ka;return fa}async function T(da,ia,ka,fa){const X=da.renderSpatialReference;da=new e({spatialReference:B(da)});await w.projectVectorToPointAsync(ia.eye,X,da,{signal:fa});k.throwIfAborted(fa);return new b(da,ia.heading,ia.tilt,ka)}const Y=()=>l.getLogger("esri.views.3d.support.cameraUtils"),ha=f.create(),ba={heading:0,
tilt:0},U=f.create(),Z=new q.Cyclical(-2.0037508342788905E7,2.0037508342788905E7),ca=new q.Cyclical(-180,180);a.OrientationMode=void 0;(function(da){da[da.LOCKED=0]="LOCKED";da[da.ADJUST=1]="ADJUST"})(a.OrientationMode||(a.OrientationMode={}));const ea=f.create();a.computeScale=function(da,ia){const {renderSpatialReference:ka}=da,fa=m.getCGSForPlanet(ka);let X=null;try{v.projectVectorToVector(ia.center,ka,ha,fa)&&(X=ha[1])}catch{}return F(da,ia.distance,X)};a.directionToHeadingTilt=N;a.distanceToScale=
F;a.externalToInternal=function(da,ia){if(null==ia)return null;var ka=da.renderSpatialReference;const fa=C(da).headingTiltToDirectionUp,X=f.create();if(!t.projectPointToVector(ia.position,X,ka))return null;ka=fa(X,ia.heading,ia.tilt);h.scale(ka.direction,ka.direction,da.state.camera.distance);h.add(ka.direction,ka.direction,X);da=n.cameraOnContentAlongViewDirection(da,X,ka.direction,ka.up);da.fov=p.deg2rad(ia.fov);da.row=ia.layout.row;da.rows=ia.layout.rows;da.column=ia.layout.column;da.columns=ia.layout.columns;
return da};a.fromCenterDistanceAsync=H;a.fromCenterDistanceSync=function(da,ia,ka,fa,X,ja){ia=L(da,fa.heading,fa.tilt,ia,ka,X);return V(da,ia,fa.fov,ja)};a.fromCenterScale=async function(da,ia,ka,fa,X,ja){ka=D(da,ka,ia.latitude);return H(da,ia,ka,fa,X,ja)};a.fromExtentAsync=async function(da,ia,ka,fa,X,ja){ia=W(da,ia)?ia:await g.projectWithZConversion(ia,da.spatialReference,{signal:ja});k.throwIfAborted(ja);const {center:la,distance:na}=S(da,ia);ka=await P(da,ka,fa,la,na,X,ja);k.throwIfAborted(ja);
return T(da,ka,da.camera.fov,ja)};a.fromExtentSync=function(da,ia,ka,fa,X,ja){let la;try{la=W(da,ia)?ia:g.project(ia,da.spatialReference)}catch(za){return null}const {center:na,distance:va}=S(da,la);ia=L(da,ka,fa,na,va,X);return null==ia?null:V(da,ia,da.camera.fov,ja)};a.getObserverForPointAtDistanceAsync=P;a.getObserverForPointAtDistanceSync=L;a.getViewSR=B;a.headingTiltToDirectionUp=function(da,ia,ka,fa,X){return C(da).headingTiltToDirectionUp(ia,ka,fa,X)};a.internalToExternal=function(da,ia,ka){const fa=
da.renderSpatialReference,X=N(da,ia.eye,ia.viewForward,ia.up,ba);da=B(da);v.projectVectorToVector(ia.eye,fa,ea,da)||(da=d.WGS84,v.projectVectorToVector(ia.eye,fa,ea,da));null==ka?ka=new b(new e(ea,da),X.heading,X.tilt,p.rad2deg(ia.fov)):(ka.position.x=ea[0],ka.position.y=ea[1],ka.position.z=ea[2],ka.position.spatialReference=da,ka.heading=X.heading,ka.tilt=X.tilt,ka.fov=p.rad2deg(ia.fov));ka.layout.row=ia.row;ka.layout.rows=ia.rows;ka.layout.column=ia.column;ka.layout.columns=ia.columns;return ka};
a.scaleToDistance=D;a.scaleToZoom=function(da,ia){if(da=da.basemapTerrain?.tilingScheme)return da.levelAtScale(ia);Y().error("#scaleToZoom()","Cannot compute zoom from scale without a tiling scheme")};a.toExtent=function(da,ia,ka){var fa=da.renderSpatialReference;const X=new e({spatialReference:B(da)});if(!w.projectVectorToPoint(ka,fa,X))return null;const ja=Math.tan(ia.fovX/2);fa=Math.tan(ia.fovY/2);ia=h.dist(ia.eye,ka);ka=2*ia*ja;fa*=2*ia;return"global"===da.viewingMode?x.toExtent(da,X,ka,fa):u.toExtent(da,
X,ka,fa)};a.zoomToScale=function(da,ia){if(da=da.basemapTerrain?.tilingScheme)return da.scaleAtLevel(ia);Y().error("#zoomToScale()","Cannot compute scale from zoom without a tiling scheme")};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/projectVectorToPoint":function(){define(["exports","../../core/libs/gl-matrix-2/factories/vec3f64","../projection","./projectVectorToVector"],function(a,b,q,l){function p(h,f,c){if(!l.projectVectorToVector(h,f,k,c.spatialReference))return!1;
c.x=k[0];c.y=k[1];c.z=k[2];return!0}const k=b.create();a.projectVectorToPoint=p;a.projectVectorToPointAsync=async function(h,f,c,e){await q.initializeProjection(f,c.spatialReference,null,e);return p(h,f,c)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/projectVectorToVector":function(){define(["exports","../projection","../SpatialReference","./projectPointToVector","../../layers/graphics/dehydratedPoint"],function(a,b,q,l,p){function k(f,c,e,g,d){if(null==
c||null==g||2>f.length)return!1;h.x=f[0];h.y=f[1];h.z=f[2];h.spatialReference=c;return l.projectPointToVector(h,e,g,d)}const h=p.makeDehydratedPoint(0,0,0,q.WGS84);a.projectVectorToVector=k;a.projectVectorToVectorAsync=async function(f,c,e,g,d,t){await b.initializeProjection(c,g,null,t);return k(f,c,e,g,d)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/dehydratedPoint":function(){define(["exports"],function(a){a.makeDehydratedPoint=function(b,q,l,p){return{x:b,
y:q,z:l,hasZ:null!=l,hasM:!1,spatialReference:p,type:"point"}};a.setDehydratedPoint=function(b,q,l,p,k){b.x=q;b.y=l;b.z=p;b.hasZ=null!=p;b.spatialReference=k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/planetGCSUtils":function(){define(["exports","../SpatialReference","../spatialReferenceEllipsoidUtils","./spatialReferenceUtils","./SupportedGCSWkids"],function(a,b,q,l,p){a.getCGSForPlanet=function(k){return l.equals(k,q.SphericalPCPFMars)||l.isMars(k)?{wkid:p.SupportedGCSWkids.GCSMARS2000}:
l.equals(k,q.SphericalPCPFMoon)||l.isMoon(k)?{wkid:p.SupportedGCSWkids.GCSMOON2000}:b.WGS84};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/intersectionUtils":function(){define("exports ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ../../../geometry/support/aaBoundingRect ../webgl-engine/lib/Intersector".split(" "),function(a,b,q,l,p,k){function h(w,v){return w.elevationProvider?w.elevationProvider.getElevation(v[0],
v[1],v[2],w.renderCoordsHelper.spatialReference,"ground")??0:0}function f(w,v,m){if(!w.state.isGlobal||!w.stateManager.constraintsManager)return!1;const r=h(w,v);({far:w}=w.stateManager.constraintsManager.nearFarHeuristic.compute(v,m,w.renderDataExtent,r,t));w*=w;return b.squaredDistance(v,m)>w}const c={},e=q.create(),g=q.create(),d=q.create(),t={near:0,far:0};a.cameraOnContentAlongViewDirection=function(w,v,m,r){const n=w.state.camera.clone();v&&m&&r&&(n.eye=v,n.center=m,n.up=r);v=n.ray;m=c[w.viewingMode];
m||(m=k.newIntersector(w.state.viewingMode),m.options.backfacesTerrain=!w.state.isGlobal,m.options.invisibleTerrain=!0,c[w.viewingMode]=m);({isGlobal:r}=w.state);w.sceneIntersectionHelper.intersectRay(v,m,g)&&!f(w,v.origin,g)?v=!0:!w.renderCoordsHelper.intersectManifold(v,0,g)||f(w,v.origin,g)?r?(m=l.getReferenceEllipsoid(w.spatialReference).radius,m=b.dot(v.origin,v.origin)-m*m,b.scale(g,v.direction,(0<m?Math.sqrt(m)/3:1)/b.length(v.direction)),b.add(g,g,v.origin),v=!0):v=!1:v=!0;v||b.copy(g,n.center);
m=w.state.constraints;r=m.minimumPoiDistance;b.squaredDistance(n.eye,g)<r&&(v=m.collision.enabled,b.copy(d,n.viewForward),b.scale(d,d,r),v?n.eye=b.subtract(e,g,d):b.add(g,n.eye,d),w=w.renderCoordsHelper,r=w.getAltitude(n.eye),m=m.collision.elevationMargin,v&&r<m&&(b.subtract(d,g,n.eye),n.eye=w.setAltitude(e,m,n.eye),b.add(g,n.eye,d)));n.center=g;return n};a.eyeWithinExtent=function(w,v,m,r){return null!=w.renderCoordsHelper.fromRenderCoords(v.eye,e,r)&&p.containsPoint(m,e)};a.surfaceElevationBelowRenderLocation=
h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Intersector":function(){define("exports ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/support/ray ../../../ViewingMode ./IntersectorInterfaces ./IntersectorTarget ./intersectorUtils ./verticalOffsetUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w{constructor(x){this.options=new e.IntersectorOptions;this._results=new v;this.transform=new t.IntersectorTransform;this.tolerance=1E-5;this.verticalOffset=null;this._ray=f.create();this._rayEnd=p.create();this._rayBeginTransformed=p.create();this._rayEndTransformed=p.create();this.viewingMode=null==x?c.ViewingMode.Global:x}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(x,
y,z){this.resetWithRay(f.fromPoints(x,y,this._ray),z)}resetWithRay(x,y){this.camera=y;x!==this._ray&&f.copy(x,this._ray);0!==this.options.verticalOffset?this.viewingMode===c.ViewingMode.Local?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset:this.verticalOffset=null;l.add(this._rayEnd,this._ray.origin,this._ray.direction);this._results.init(this._ray)}intersect(x=null,y,z,A,B){this.point=y;this.filterPredicate=A;this.tolerance=null==z?1E-5:z;y=t.getVerticalOffsetObject3D(this.verticalOffset);
if(x&&0<x.length){const C=B?D=>{B(D)&&this.intersectObject(D)}:D=>{this.intersectObject(D)};for(const D of x)x=D.getSpatialQueryAccelerator?.(),null!=x?(null!=y?x.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,C,y):x.forEachAlongRay(this._ray.origin,this._ray.direction,C),this.options.selectionMode&&this.options.hud&&x.forEachDegenerateObject(C)):D.objects.forAll(F=>C(F))}this.sortResults()}intersectObject(x){const y=x.geometries;if(y){var z=x.effectiveTransformation,A=t.getVerticalOffsetObject3D(this.verticalOffset);
for(const B of y){if(!B.visible)continue;const {material:C,id:D}=B;this.transform.setAndInvalidateLazyTransforms(z,B.transformation);l.transformMat4(this._rayBeginTransformed,this.rayBegin,this.transform.inverse);l.transformMat4(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const F=this.transform.transform;null!=A&&(A.objectTransform=this.transform);C.intersect(B,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,(H,N,E,G,I,O)=>{if(0<=H&&(null==this.filterPredicate||
this.filterPredicate(this._ray.origin,this._rayEnd,H))){var L=G?this._results.hud:this._results,P=G?M=>{const K=new g.HudTarget(x,D,E,O);M.set(e.IntersectorType.HUD,K,H,N,q.IDENTITY,I)}:M=>M.set(e.IntersectorType.OBJECT,{object:x,geometryId:D,triangleNr:E},H,N,F,I);(null==L.min.drapedLayerOrder||I>=L.min.drapedLayerOrder)&&(null==L.min.dist||H<L.min.dist)&&P(L.min);this.options.store!==e.StoreResults.MIN&&(null==L.max.drapedLayerOrder||I<L.max.drapedLayerOrder)&&(null==L.max.dist||H>L.max.dist)&&
P(L.max);this.options.store===e.StoreResults.ALL&&(G?(G=new r(this._ray),P(G),this._results.hud.all.push(G)):(G=new m(this._ray),P(G),this._results.all.push(G)))}})}}}sortResults(x=this._results.all){x.sort((y,z)=>y.dist!==z.dist?(y.dist??0)-(z.dist??0):y.drapedLayerOrder!==z.drapedLayerOrder?(z.drapedLayerOrder??-Number.MAX_VALUE)-(y.drapedLayerOrder??-Number.MAX_VALUE):(z.drapedLayerGraphicOrder??-Number.MAX_VALUE)-(y.drapedLayerGraphicOrder??-Number.MAX_VALUE))}}class v{constructor(){this.min=
new m(f.create());this.max=new m(f.create());this.hud={min:new r(f.create()),max:new r(f.create()),all:[]};this.ground=new m(f.create());this.all=[]}init(x){this.min.init(x);this.max.init(x);this.ground.init(x);this.all.length=0;this.hud.min.init(x);this.hud.max.init(x);this.hud.all.length=0}}class m{get ray(){return this._ray}get distanceInRenderSpace(){return null!=this.dist?(l.scale(n,this.ray.direction,this.dist),l.length(n)):null}getIntersectionPoint(x){if(!d.isValidIntersectorResult(this))return!1;
l.scale(n,this.ray.direction,this.dist);l.add(x,this.ray.origin,n);return!0}getTransformedNormal(x){l.copy(u,this.normal);u[3]=0;k.transformMat4(u,u,this.transformation);l.copy(x,u);return l.normalize(x,x)}constructor(x){this.intersector=e.IntersectorType.OBJECT;this.normal=p.create();this.transformation=q.create();this._ray=f.create();this.init(x)}init(x){this.drapedLayerGraphicOrder=this.drapedLayerOrder=this.target=this.dist=null;this.intersector=e.IntersectorType.OBJECT;f.copy(x,this._ray)}set(x,
y,z,A,B,C,D){this.intersector=x;this.dist=z;l.copy(this.normal,A??p.UNIT_Z);b.copy(this.transformation,B??q.IDENTITY);this.target=y;this.drapedLayerOrder=C;this.drapedLayerGraphicOrder=D}copy(x){f.copy(x.ray,this._ray);this.intersector=x.intersector;this.dist=x.dist;this.target=x.target;this.drapedLayerOrder=x.drapedLayerOrder;this.drapedLayerGraphicOrder=x.drapedLayerGraphicOrder;l.copy(this.normal,x.normal);b.copy(this.transformation,x.transformation)}}class r extends m{constructor(){super(...arguments);
this.intersector=e.IntersectorType.HUD}}const n=p.create(),u=h.create();a.defaultTolerance=1E-5;a.newIntersector=function(x){return new w(x)};a.newIntersectorResult=function(x){return new m(x)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/IntersectorInterfaces":function(){define(["exports"],function(a){a.IntersectorType=void 0;(function(q){q[q.OBJECT=0]="OBJECT";q[q.HUD=1]="HUD";q[q.TERRAIN=2]="TERRAIN";q[q.OVERLAY=3]="OVERLAY";q[q.I3S=4]="I3S";q[q.PCL=
5]="PCL";q[q.LOD=6]="LOD";q[q.VOXEL=7]="VOXEL";q[q.TILES3D=8]="TILES3D"})(a.IntersectorType||(a.IntersectorType={}));class b{constructor(){this.verticalOffset=0;this.selectionMode=!1;this.selectOpaqueTerrainOnly=this.hud=!0;this.invisibleTerrain=!1;this.backfacesTerrain=!0;this.isFiltered=!1;this.filteredLayerUids=[];this.store=a.StoreResults.ALL;this.normalRequired=!0}}a.StoreResults=void 0;(function(q){q[q.MIN=0]="MIN";q[q.MINMAX=1]="MINMAX";q[q.ALL=2]="ALL"})(a.StoreResults||(a.StoreResults={}));
a.IntersectorOptions=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/IntersectorTarget":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b){class q{constructor(f,c,e){this.object=f;this.geometryId=c;this.triangleNr=e}}class l extends q{constructor(f,c,e,g){super(f,c,e);this.center=null!=g?b.clone(g):null}}class p extends l{}class k{constructor(f){this.layerUid=f}}class h extends k{constructor(f,c){super(f);
this.graphicUid=c}}a.Graphic3DTarget=h;a.HudTarget=l;a.LayerTarget=k;a.ObjectTarget=q;a.ValidHudTarget=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/intersectorUtils":function(){define(["exports","../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64","../../../../chunks/boundedPlane","./IntersectorInterfaces"],function(a,b,q,l,p){function k(f){return null!=f?.dist}const h=q.create();a.isHudIntersectorResult=function(f){return k(f)&&
f.intersector===p.IntersectorType.HUD&&!!f.target&&"center"in f.target&&null!=f.target.center};a.isObjectIntersectorResult=function(f){return k(f)&&f.intersector===p.IntersectorType.OBJECT&&!!f.target};a.isValidIntersectorResult=k;a.sliceFilterPredicate=function(f){return(c,e,g)=>{b.lerp(h,c,e,g);return!l.extrusionContainsPoint(f,h)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/verticalOffsetUtils":function(){define("exports ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/sphere ../../../ViewingMode ../../support/orientedBoundingBox".split(" "),
function(a,b,q,l,p,k,h,f,c,e){class g{constructor(){this._transform=p.create();this._transformInverse=new d({value:this._transform},l.invert,p.create);this._transformInverseTranspose=new d(this._transformInverse,l.transpose,p.create);this._transformTranspose=new d({value:this._transform},l.transpose,p.create);this._transformInverseRotation=new d({value:this._transform},b.normalFromMat4Legacy,q.create)}_invalidateLazyTransforms(){this._transformInverse.invalidate();this._transformInverseTranspose.invalidate();
this._transformTranspose.invalidate();this._transformInverseRotation.invalidate()}get transform(){return this._transform}get inverse(){return this._transformInverse.value}get inverseTranspose(){return this._transformInverseTranspose.value}get inverseRotation(){return this._transformInverseRotation.value}get transpose(){return this._transformTranspose.value}setTransformMatrix(B){l.copy(this._transform,B)}multiplyTransform(B){l.multiply(this._transform,this._transform,B)}set(B){l.copy(this._transform,
B);this._invalidateLazyTransforms()}setAndInvalidateLazyTransforms(B,C){this.setTransformMatrix(B);this.multiplyTransform(C);this._invalidateLazyTransforms()}}class d{constructor(B,C,D){this._original=B;this._update=C;this._dirty=!0;this._transform=D()}invalidate(){this._dirty=!0}get value(){this._dirty&&(this._update(this._transform,this._original.value),this._dirty=!1);return this._transform}}class t{constructor(B=0){this.offset=B;this.tmpVertex=h.create()}applyToVertex(B,C,D){B=k.set(u,B,C,D);
C=k.add(x,B,this.localOrigin);D=this.offset/k.length(C);k.scaleAndAdd(this.tmpVertex,B,C,D);return this.tmpVertex}applyToAabb(B){var C=y;const D=z,F=A;for(var H=0;3>H;++H)C[H]=B[0+H]+this.localOrigin[H],D[H]=B[3+H]+this.localOrigin[H],F[H]=C[H];H=this.applyToVertex(C[0],C[1],C[2]);for(var N=0;3>N;++N)B[N]=H[N],B[N+3]=H[N];H=G=>{G=this.applyToVertex(G[0],G[1],G[2]);for(let I=0;3>I;++I)B[I]=Math.min(B[I],G[I]),B[I+3]=Math.max(B[I+3],G[I])};for(N=1;8>N;++N){for(var E=0;3>E;++E)F[E]=0===(N&1<<E)?C[E]:
D[E];H(F)}N=0;for(E=0;3>E;++E)0>C[E]*D[E]&&(N|=1<<E);if(0!==N&&7!==N)for(E=0;8>E;++E)if(0===(N&E)){for(let G=0;3>G;++G)F[G]=0!==(N&1<<G)?0:0!==(E&1<<G)?C[G]:D[G];H(F)}for(C=0;3>C;++C)B[C]-=this.localOrigin[C],B[C+3]-=this.localOrigin[C];return B}}class w{constructor(B=0){this._offset=this._totalOffset=this.componentLocalOriginLength=0;this._tmpVertex=h.create();this._tmpMbs=f.create();this._tmpObb=new e.Obb;this._resetOffset(B)}_resetOffset(B){this._totalOffset=this._offset=B}set offset(B){this._resetOffset(B)}get offset(){return this._offset}set componentOffset(B){this._totalOffset=
this._offset+B}set localOrigin(B){this.componentLocalOriginLength=k.length(B)}applyToVertex(B,C,D){const F=k.set(u,B,C,D);B=k.set(x,B,C,D+this.componentLocalOriginLength);C=this._totalOffset/k.length(B);k.scaleAndAdd(this._tmpVertex,F,B,C);return this._tmpVertex}applyToAabb(B){var C=this.componentLocalOriginLength;const D=B[0],F=B[1],H=B[2]+C,N=B[3],E=B[4];C=B[5]+C;var G=Math.abs(D),I=Math.abs(F),O=Math.abs(H),L=Math.abs(N),P=Math.abs(E),M=Math.abs(C),K=.5*(1+Math.sign(D*N))*Math.min(G,L),J=.5*(1+
Math.sign(F*E))*Math.min(I,P);const R=.5*(1+Math.sign(H*C))*Math.min(O,M);var Q=Math.max(G,L),W=Math.max(I,P),S=Math.max(O,M);K=Math.sqrt(K*K+J*J+R*R);G=Math.sign(G+D);I=Math.sign(I+F);O=Math.sign(O+H);L=Math.sign(L+N);P=Math.sign(P+E);M=Math.sign(M+C);J=this._totalOffset;if(K<J)return B[0]-=(1-G)*J,B[1]-=(1-I)*J,B[2]-=(1-O)*J,B[3]+=L*J,B[4]+=P*J,B[5]+=M*J,B;Q=J/Math.sqrt(Q*Q+W*W+S*S);W=J/K;S=W-Q;K=-S;B[0]+=D*(G*K+W);B[1]+=F*(I*K+W);B[2]+=H*(O*K+W);B[3]+=N*(L*S+Q);B[4]+=E*(P*S+Q);B[5]+=C*(M*S+Q);
return B}applyToMbs(B){const C=k.length(f.getCenter(B)),D=this._totalOffset/C;k.scaleAndAdd(f.getCenter(this._tmpMbs),f.getCenter(B),f.getCenter(B),D);this._tmpMbs[3]=B[3]+B[3]*this._totalOffset/C;return this._tmpMbs}applyToObb(B){e.computeOffsetObb(B,this._totalOffset,this._totalOffset,c.ViewingMode.Global,this._tmpObb);return this._tmpObb}}class v{constructor(B=0){this.offset=B;this.sphere=f.create();this.tmpVertex=h.create()}applyToVertex(B,C,D){var F=this.objectTransform.transform;B=k.set(u,B,
C,D);F=k.transformMat4(B,B,F);B=this.offset/k.length(F);k.scaleAndAdd(F,F,F,B);k.transformMat4(this.tmpVertex,F,this.objectTransform.inverse);return this.tmpVertex}applyToMinMax(B,C){const D=this.offset/k.length(B);k.scaleAndAdd(B,B,B,D);B=this.offset/k.length(C);k.scaleAndAdd(C,C,C,B)}applyToAabb(B){var C=this.offset/Math.sqrt(B[0]*B[0]+B[1]*B[1]+B[2]*B[2]);B[0]+=B[0]*C;B[1]+=B[1]*C;B[2]+=B[2]*C;C=this.offset/Math.sqrt(B[3]*B[3]+B[4]*B[4]+B[5]*B[5]);B[3]+=B[3]*C;B[4]+=B[4]*C;B[5]+=B[5]*C;return B}applyToBoundingSphere(B){const C=
k.length(f.getCenter(B)),D=this.offset/C;k.scaleAndAdd(f.getCenter(this.sphere),f.getCenter(B),f.getCenter(B),D);this.sphere[3]=B[3]+B[3]*this.offset/C;return this.sphere}}const m=new v,r=new w,n=new t,u=h.create(),x=h.create(),y=h.create(),z=h.create(),A=h.create();a.I3SVerticalOffsetGlobalViewingMode=w;a.IntersectorTransform=g;a.Object3DVerticalOffsetGlobalViewingMode=v;a.TerrainVerticalOffsetGlobalViewingMode=t;a.getVerticalOffsetI3S=function(B){return null!=B?(r.offset=B,r):null};a.getVerticalOffsetObject3D=
function(B){return null!=B?(m.offset=B,m):null};a.getVerticalOffsetTerrain=function(B){return null!=B?(n.offset=B,n):null};a.terrainId="terrain";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/math/mat3":function(){define(["exports","./common"],function(a,b){function q(L,P){L[0]=P[0];L[1]=P[1];L[2]=P[2];L[3]=P[4];L[4]=P[5];L[5]=P[6];L[6]=P[8];L[7]=P[9];L[8]=P[10];return L}function l(L,P){L[0]=P[0];L[1]=P[1];L[2]=P[2];L[3]=P[3];L[4]=P[4];L[5]=P[5];L[6]=P[6];
L[7]=P[7];L[8]=P[8];return L}function p(L,P,M,K,J,R,Q,W,S,V){L[0]=P;L[1]=M;L[2]=K;L[3]=J;L[4]=R;L[5]=Q;L[6]=W;L[7]=S;L[8]=V;return L}function k(L){L[0]=1;L[1]=0;L[2]=0;L[3]=0;L[4]=1;L[5]=0;L[6]=0;L[7]=0;L[8]=1;return L}function h(L,P){if(L===P){const M=P[1],K=P[2],J=P[5];L[1]=P[3];L[2]=P[6];L[3]=M;L[5]=P[7];L[6]=K;L[7]=J}else L[0]=P[0],L[1]=P[3],L[2]=P[6],L[3]=P[1],L[4]=P[4],L[5]=P[7],L[6]=P[2],L[7]=P[5],L[8]=P[8];return L}function f(L,P){const M=P[0],K=P[1],J=P[2],R=P[3],Q=P[4],W=P[5],S=P[6],V=P[7];
P=P[8];const T=P*Q-W*V,Y=-P*R+W*S,ha=V*R-Q*S;let ba=M*T+K*Y+J*ha;if(!ba)return null;ba=1/ba;L[0]=T*ba;L[1]=(-P*K+J*V)*ba;L[2]=(W*K-J*Q)*ba;L[3]=Y*ba;L[4]=(P*M-J*S)*ba;L[5]=(-W*M+J*R)*ba;L[6]=ha*ba;L[7]=(-V*M+K*S)*ba;L[8]=(Q*M-K*R)*ba;return L}function c(L,P){const M=P[0],K=P[1],J=P[2],R=P[3],Q=P[4],W=P[5],S=P[6],V=P[7];P=P[8];L[0]=Q*P-W*V;L[1]=J*V-K*P;L[2]=K*W-J*Q;L[3]=W*S-R*P;L[4]=M*P-J*S;L[5]=J*R-M*W;L[6]=R*V-Q*S;L[7]=K*S-M*V;L[8]=M*Q-K*R;return L}function e(L){const P=L[3],M=L[4],K=L[5],J=L[6],
R=L[7],Q=L[8];return L[0]*(Q*M-K*R)+L[1]*(-Q*P+K*J)+L[2]*(R*P-M*J)}function g(L,P,M){const K=P[0],J=P[1],R=P[2],Q=P[3],W=P[4],S=P[5],V=P[6],T=P[7];P=P[8];const Y=M[0],ha=M[1],ba=M[2],U=M[3],Z=M[4],ca=M[5],ea=M[6],da=M[7];M=M[8];L[0]=Y*K+ha*Q+ba*V;L[1]=Y*J+ha*W+ba*T;L[2]=Y*R+ha*S+ba*P;L[3]=U*K+Z*Q+ca*V;L[4]=U*J+Z*W+ca*T;L[5]=U*R+Z*S+ca*P;L[6]=ea*K+da*Q+M*V;L[7]=ea*J+da*W+M*T;L[8]=ea*R+da*S+M*P;return L}function d(L,P,M){const K=P[0],J=P[1],R=P[2],Q=P[3],W=P[4],S=P[5],V=P[6],T=P[7];P=P[8];const Y=M[0];
M=M[1];L[0]=K;L[1]=J;L[2]=R;L[3]=Q;L[4]=W;L[5]=S;L[6]=Y*K+M*Q+V;L[7]=Y*J+M*W+T;L[8]=Y*R+M*S+P;return L}function t(L,P,M){const K=P[0],J=P[1],R=P[2],Q=P[3],W=P[4],S=P[5],V=P[6],T=P[7];P=P[8];const Y=Math.sin(M);M=Math.cos(M);L[0]=M*K+Y*Q;L[1]=M*J+Y*W;L[2]=M*R+Y*S;L[3]=M*Q-Y*K;L[4]=M*W-Y*J;L[5]=M*S-Y*R;L[6]=V;L[7]=T;L[8]=P;return L}function w(L,P,M){const K=M[0],J=M[1];M=M[2];L[0]=K*P[0];L[1]=K*P[1];L[2]=K*P[2];L[3]=J*P[3];L[4]=J*P[4];L[5]=J*P[5];L[6]=M*P[6];L[7]=M*P[7];L[8]=M*P[8];return L}function v(L,
P,M){const K=M[0];M=M[1];L[0]=K*P[0];L[1]=K*P[1];L[2]=K*P[2];L[3]=M*P[3];L[4]=M*P[4];L[5]=M*P[5];return L}function m(L,P){L[0]=1;L[1]=0;L[2]=0;L[3]=0;L[4]=1;L[5]=0;L[6]=P[0];L[7]=P[1];L[8]=1;return L}function r(L,P){const M=Math.sin(P);P=Math.cos(P);L[0]=P;L[1]=M;L[2]=0;L[3]=-M;L[4]=P;L[5]=0;L[6]=0;L[7]=0;L[8]=1;return L}function n(L,P){L[0]=P[0];L[1]=0;L[2]=0;L[3]=0;L[4]=P[1];L[5]=0;L[6]=0;L[7]=0;L[8]=1;return L}function u(L,P){L[0]=P[0];L[1]=P[1];L[2]=0;L[3]=P[2];L[4]=P[3];L[5]=0;L[6]=P[4];L[7]=
P[5];L[8]=1;return L}function x(L,P){var M=P[0],K=P[1],J=P[2];P=P[3];var R=M+M,Q=K+K;const W=J+J;M*=R;const S=K*R;K*=Q;const V=J*R,T=J*Q;J*=W;R*=P;Q*=P;P*=W;L[0]=1-K-J;L[3]=S-P;L[6]=V+Q;L[1]=S+P;L[4]=1-M-J;L[7]=T-R;L[2]=V-Q;L[5]=T+R;L[8]=1-M-K;return L}function y(L,P){const M=P[0],K=P[1],J=P[2],R=P[4],Q=P[5],W=P[6],S=P[8],V=P[9];P=P[10];const T=P*Q-W*V,Y=-P*R+W*S,ha=V*R-Q*S;var ba=M*T+K*Y+J*ha;if(!ba)return null;ba=1/ba;L[0]=T*ba;L[1]=(-P*K+J*V)*ba;L[2]=(W*K-J*Q)*ba;L[3]=Y*ba;L[4]=(P*M-J*S)*ba;L[5]=
(-W*M+J*R)*ba;L[6]=ha*ba;L[7]=(-V*M+K*S)*ba;L[8]=(Q*M-K*R)*ba;return L}function z(L,P){const M=P[0],K=P[1],J=P[2],R=P[3],Q=P[4],W=P[5],S=P[6],V=P[7];var T=P[8],Y=P[9],ha=P[10],ba=P[11];const U=P[12],Z=P[13],ca=P[14];P=P[15];const ea=M*W-K*Q,da=M*S-J*Q,ia=M*V-R*Q,ka=K*S-J*W,fa=K*V-R*W,X=J*V-R*S,ja=T*Z-Y*U,la=T*ca-ha*U;T=T*P-ba*U;const na=Y*ca-ha*Z;Y=Y*P-ba*Z;ha=ha*P-ba*ca;ba=ea*ha-da*Y+ia*na+ka*T-fa*la+X*ja;if(!ba)return null;ba=1/ba;L[0]=(W*ha-S*Y+V*na)*ba;L[1]=(S*T-Q*ha-V*la)*ba;L[2]=(Q*Y-W*T+V*
ja)*ba;L[3]=(J*Y-K*ha-R*na)*ba;L[4]=(M*ha-J*T+R*la)*ba;L[5]=(K*T-M*Y-R*ja)*ba;L[6]=(Z*X-ca*fa+P*ka)*ba;L[7]=(ca*ia-U*X-P*da)*ba;L[8]=(U*fa-Z*ia+P*ea)*ba;return L}function A(L,P,M){L[0]=2/P;L[1]=0;L[2]=0;L[3]=0;L[4]=-2/M;L[5]=0;L[6]=-1;L[7]=1;L[8]=1;return L}function B(L){return"mat3("+L[0]+", "+L[1]+", "+L[2]+", "+L[3]+", "+L[4]+", "+L[5]+", "+L[6]+", "+L[7]+", "+L[8]+")"}function C(L){return Math.sqrt(L[0]**2+L[1]**2+L[2]**2+L[3]**2+L[4]**2+L[5]**2+L[6]**2+L[7]**2+L[8]**2)}function D(L,P,M){L[0]=
P[0]+M[0];L[1]=P[1]+M[1];L[2]=P[2]+M[2];L[3]=P[3]+M[3];L[4]=P[4]+M[4];L[5]=P[5]+M[5];L[6]=P[6]+M[6];L[7]=P[7]+M[7];L[8]=P[8]+M[8];return L}function F(L,P,M){L[0]=P[0]-M[0];L[1]=P[1]-M[1];L[2]=P[2]-M[2];L[3]=P[3]-M[3];L[4]=P[4]-M[4];L[5]=P[5]-M[5];L[6]=P[6]-M[6];L[7]=P[7]-M[7];L[8]=P[8]-M[8];return L}function H(L,P,M){L[0]=P[0]*M;L[1]=P[1]*M;L[2]=P[2]*M;L[3]=P[3]*M;L[4]=P[4]*M;L[5]=P[5]*M;L[6]=P[6]*M;L[7]=P[7]*M;L[8]=P[8]*M;return L}function N(L,P,M,K){L[0]=P[0]+M[0]*K;L[1]=P[1]+M[1]*K;L[2]=P[2]+M[2]*
K;L[3]=P[3]+M[3]*K;L[4]=P[4]+M[4]*K;L[5]=P[5]+M[5]*K;L[6]=P[6]+M[6]*K;L[7]=P[7]+M[7]*K;L[8]=P[8]+M[8]*K;return L}function E(L,P){return L[0]===P[0]&&L[1]===P[1]&&L[2]===P[2]&&L[3]===P[3]&&L[4]===P[4]&&L[5]===P[5]&&L[6]===P[6]&&L[7]===P[7]&&L[8]===P[8]}function G(L,P){const M=L[0],K=L[1],J=L[2],R=L[3],Q=L[4],W=L[5],S=L[6],V=L[7];L=L[8];const T=P[0],Y=P[1],ha=P[2],ba=P[3],U=P[4],Z=P[5],ca=P[6],ea=P[7];P=P[8];const da=b.getEpsilon();return Math.abs(M-T)<=da*Math.max(1,Math.abs(M),Math.abs(T))&&Math.abs(K-
Y)<=da*Math.max(1,Math.abs(K),Math.abs(Y))&&Math.abs(J-ha)<=da*Math.max(1,Math.abs(J),Math.abs(ha))&&Math.abs(R-ba)<=da*Math.max(1,Math.abs(R),Math.abs(ba))&&Math.abs(Q-U)<=da*Math.max(1,Math.abs(Q),Math.abs(U))&&Math.abs(W-Z)<=da*Math.max(1,Math.abs(W),Math.abs(Z))&&Math.abs(S-ca)<=da*Math.max(1,Math.abs(S),Math.abs(ca))&&Math.abs(V-ea)<=da*Math.max(1,Math.abs(V),Math.abs(ea))&&Math.abs(L-P)<=da*Math.max(1,Math.abs(L),Math.abs(P))}function I(L){const P=b.getEpsilon(),M=L[0],K=L[1],J=L[2],R=L[3],
Q=L[4],W=L[5],S=L[6],V=L[7];L=L[8];return Math.abs(1-(M*M+R*R+S*S))<=P&&Math.abs(1-(K*K+Q*Q+V*V))<=P&&Math.abs(1-(J*J+W*W+L*L))<=P}const O=Object.freeze(Object.defineProperty({__proto__:null,add:D,adjoint:c,copy:l,determinant:e,equals:G,exactEquals:E,frob:C,fromMat2d:u,fromMat4:q,fromQuat:x,fromRotation:r,fromScaling:n,fromTranslation:m,identity:k,invert:f,isOrthoNormal:I,mul:g,multiply:g,multiplyScalar:H,multiplyScalarAndAdd:N,normalFromMat4:z,normalFromMat4Legacy:y,projection:A,rotate:t,scale:w,
scaleByVec2:v,set:p,str:B,sub:F,subtract:F,translate:d,transpose:h},Symbol.toStringTag,{value:"Module"}));a.add=D;a.adjoint=c;a.copy=l;a.determinant=e;a.equals=G;a.exactEquals=E;a.frob=C;a.fromMat2d=u;a.fromMat4=q;a.fromQuat=x;a.fromRotation=r;a.fromScaling=n;a.fromTranslation=m;a.identity=k;a.invert=f;a.isOrthoNormal=I;a.mat3=O;a.mul=g;a.multiply=g;a.multiplyScalar=H;a.multiplyScalarAndAdd=N;a.normalFromMat4=z;a.normalFromMat4Legacy=y;a.projection=A;a.rotate=t;a.scale=w;a.scaleByVec2=v;a.set=p;a.str=
B;a.sub=F;a.subtract=F;a.translate=d;a.transpose=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/orientedBoundingBox":function(){define("exports ../../../core/libs/gl-matrix-2/math/mat3 ../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/math/quat ../../../core/libs/gl-matrix-2/factories/quatf64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../chunks/vec42 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../geometry/ellipsoidUtils ../../../geometry/spatialReferenceEllipsoidUtils ../../../geometry/projection/computeTranslationToOriginAndRotation ../../../geometry/projection/projectBuffer ../../../geometry/projection/projectors ../../../geometry/support/plane ../../../geometry/support/spatialReferenceUtils ../../../geometry/support/vectorStacks ../../ViewingMode ./dito ../webgl-engine/lib/Attribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){function z(U,Z=new D){x.computeOBB(U,Z);return Z}function A(U,Z,ca,ea,da){var ia=Z.getQuaternion(H);ia=b.fromQuat(W,ia);Z=Z.getHalfSize(Q);for(let fa=0;8>fa;++fa){for(var ka=0;3>ka;++ka)K[ka]=Z[ka]*(0!==(fa&1<<ka)?-1:1);for(ka=0;3>ka;++ka){let X=ca[ka];for(let ja=0;3>ja;++ja)X+=K[ja]*ia[3*ja+ka];P[3*fa+ka]=X}}w.projectBuffer(P,U,0,P,ea,0,8);z(M,da)}function B(U,Z,ca,ea,da=d.getSphericalPCPF(ca),ia=v.getProjector(ca,da)){U.getCorners(V);U.getCenter(K);
K[2]+=ea;t.computeTranslationToOriginAndRotation(ca,K,S,da);Z.setCenter(S[12],S[13],S[14]);ca=2*Math.sqrt(1+S[0]+S[5]+S[10]);F[0]=(S[6]-S[9])/ca;F[1]=(S[8]-S[2])/ca;F[2]=(S[1]-S[4])/ca;F[3]=.25*ca;U=U.getQuaternion(H);Z.quaternion=p.multiply(F,F,U);p.conjugate(F,F);h.set(Y,0,0,0);U=Z.getCenter(R);for(const ka of V)ka[2]+=ea,ia(ka,0,ka,0),h.sub(T,ka,U),h.transformQuat(T,T,F),h.abs(T,T),h.max(Y,Y,T);Z.halfSize=Y}function C(U,Z,ca,ea,da=d.getSphericalPCPF(ca)){const ia=g.getReferenceEllipsoid(ca),ka=
1+Math.max(0,ea)/(ia.radius+U.centerZ);U.getCenter(K);K[2]+=ea;w.projectBuffer(K,ca,0,K,da,0,1);Z.center=K;ca=U.getQuaternion(H);Z.quaternion=ca;p.conjugate(F,ca);h.set(T,0,0,1);h.transformQuat(T,T,F);U=U.getHalfSize(Q);h.set(T,U[0]*Math.abs(T[0]),U[1]*Math.abs(T[1]),U[2]*Math.abs(T[2]));h.scale(T,T,ia.inverseFlattening);h.add(T,U,T);Z.halfSize=h.scale(T,T,ka)}class D{constructor(U=f.ZEROS,Z=ba,ca=k.IDENTITY){this._data=[U[0],U[1],U[2],Z[0],Z[1],Z[2],ca[0],ca[1],ca[2],ca[3]]}clone(){const U=new D;
U._data=this._data.slice();return U}invalidate(){this._data[3]=-1}get isValid(){return 0<=this._data[3]}static fromData(U){const Z=new D;Z._data=U.slice();return Z}static fromJSON(U){return new D(U.center,U.halfSize,U.quaternion)}copy(U){this._data=U.data.slice()}get center(){return h.set(n.sv3d.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(U){U[0]=this._data[0];U[1]=this._data[1];
U[2]=this._data[2];return U}set center(U){this._data[0]=U[0];this._data[1]=U[1];this._data[2]=U[2]}setCenter(U,Z,ca){this._data[0]=U;this._data[1]=Z;this._data[2]=ca}get halfSize(){return h.set(n.sv3d.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(U){U[0]=this._data[3];U[1]=this._data[4];U[2]=this._data[5];return U}set halfSize(U){this._data[3]=U[0];this._data[4]=U[1];this._data[5]=
U[2]}get quaternion(){return p.set(n.sq4d.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(U){U[0]=this._data[6];U[1]=this._data[7];U[2]=this._data[8];U[3]=this._data[9];return U}set quaternion(U){this._data[6]=U[0];this._data[7]=U[1];this._data[8]=U[2];this._data[9]=U[3]}get data(){return this._data}getCorners(U){const Z=F,ca=this._data;Z[0]=ca[6];Z[1]=ca[7];Z[2]=ca[8];Z[3]=ca[9];for(let ea=0;8>ea;++ea){const da=U[ea];da[0]=(ea&1?-1:1)*ca[3];da[1]=(ea&2?-1:1)*ca[4];da[2]=
(ea&4?-1:1)*ca[5];h.transformQuat(da,da,Z);da[0]+=ca[0];da[1]+=ca[1];da[2]+=ca[2]}}doesIntersectFrustumConservativeApproximation(U){return 0>=this.intersectPlane(U[0])&&0>=this.intersectPlane(U[1])&&0>=this.intersectPlane(U[2])&&0>=this.intersectPlane(U[3])&&0>=this.intersectPlane(U[4])&&0>=this.intersectPlane(U[5])}get radius(){const U=this._data[3],Z=this._data[4],ca=this._data[5];return Math.sqrt(U*U+Z*Z+ca*ca)}intersectSphere(U){E[0]=this._data[0]-U[0];E[1]=this._data[1]-U[1];E[2]=this._data[2]-
U[2];const Z=this.getQuaternion(H);p.conjugate(F,Z);h.transformQuat(E,E,F);h.abs(E,E);G[0]=Math.min(E[0],this._data[3]);G[1]=Math.min(E[1],this._data[4]);G[2]=Math.min(E[2],this._data[5]);return h.sqrDist(G,E)<U[3]*U[3]}intersectSphereWithMBS(U,Z=this.radius){const ca=this._data;E[0]=ca[0]-U[0];E[1]=ca[1]-U[1];E[2]=ca[2]-U[2];U=U[3];const ea=h.sqrLen(E);Z=U+Z;if(ea>Z*Z)return!1;F[0]=-ca[6];F[1]=-ca[7];F[2]=-ca[8];F[3]=ca[9];h.transformQuat(E,E,F);h.abs(E,E);G[0]=Math.min(E[0],ca[3]);G[1]=Math.min(E[1],
ca[4]);G[2]=Math.min(E[2],ca[5]);return h.sqrDist(G,E)<U*U}intersectPlane(U){const Z=U[0]*this._data[0]+U[1]*this._data[1]+U[2]*this._data[2]+U[3];U=this.projectedRadius(m.getNormal(U));return Z>U?1:Z<-U?-1:0}intersectRay(U,Z,ca=0){var ea=this._data,da=F;da[0]=-ea[6];da[1]=-ea[7];da[2]=-ea[8];da[3]=ea[9];E[0]=U[0]-ea[0];E[1]=U[1]-ea[1];E[2]=U[2]-ea[2];U=h.transformQuat(E,E,F);Z=h.transformQuat(G,Z,F);ea=-Infinity;da=Infinity;const ia=this.getHalfSize(Q);for(let fa=0;3>fa;fa++){var ka=U[fa];const X=
Z[fa],ja=ia[fa]+ca;if(1E-6<Math.abs(X)){const la=(ja-ka)/X;ka=(-ja-ka)/X;ea=Math.max(ea,Math.min(la,ka));da=Math.min(da,Math.max(la,ka))}else if(ka>ja||ka<-ja)return!1}return ea<=da}projectedArea(U,Z,ca,ea){var da=this.getQuaternion(H);p.conjugate(F,da);E[0]=U[0]-this._data[0];E[1]=U[1]-this._data[1];E[2]=U[2]-this._data[2];h.transformQuat(E,E,F);var ia=this.getHalfSize(Q),ka=E[0]<-ia[0]?-1:E[0]>ia[0]?1:0,fa=E[1]<-ia[1]?-1:E[1]>ia[1]?1:0;const X=E[2]<-ia[2]?-1:E[2]>ia[2]?1:0;U=Math.abs(ka)+Math.abs(fa)+
Math.abs(X);if(0===U)return Infinity;U=1===U?4:6;ka=6*(ka+3*fa+9*X+13);b.fromQuat(W,da);b.scale(W,W,ia);da=this.getCenter(J);for(ia=0;ia<U;ia++)fa=L[ka+ia],h.set(E,((fa&1)<<1)-1,(fa&2)-1,((fa&4)>>1)-1),h.transformMat3(E,E,W),h.add(I,da,E),I[3]=1,c.transformMat4(I,I,Z),fa=1/Math.max(1E-6,I[3]),O[2*ia]=I[0]*fa,O[2*ia+1]=I[1]*fa;Z=2*U-2;U=O[0]*(O[3]-O[Z+1])+O[Z]*(O[1]-O[Z-1]);for(da=2;da<Z;da+=2)U+=O[da]*(O[da+3]-O[da-1]);return Math.abs(U)*ca*ea*.125}projectedRadius(U){const Z=this.getQuaternion(H);
p.conjugate(F,Z);h.transformQuat(E,U,F);return Math.abs(E[0]*this._data[3])+Math.abs(E[1]*this._data[4])+Math.abs(E[2]*this._data[5])}minimumDistancePlane(U){const Z=U[0]*this._data[0]+U[1]*this._data[1]+U[2]*this._data[2]+U[3];U=this.projectedRadius(m.getNormal(U));return Z-U}maximumDistancePlane(U){const Z=U[0]*this._data[0]+U[1]*this._data[1]+U[2]*this._data[2]+U[3];U=this.projectedRadius(m.getNormal(U));return Z+U}toAaBoundingBox(U){var Z=this.getQuaternion(H),ca=b.fromQuat(W,Z);Z=this._data[3]*
Math.abs(ca[0])+this._data[4]*Math.abs(ca[3])+this._data[5]*Math.abs(ca[6]);const ea=this._data[3]*Math.abs(ca[1])+this._data[4]*Math.abs(ca[4])+this._data[5]*Math.abs(ca[7]);ca=this._data[3]*Math.abs(ca[2])+this._data[4]*Math.abs(ca[5])+this._data[5]*Math.abs(ca[8]);U[0]=this._data[0]-Z;U[1]=this._data[1]-ea;U[2]=this._data[2]-ca;U[3]=this._data[0]+Z;U[4]=this._data[1]+ea;U[5]=this._data[2]+ca}transform(U,Z,ca,ea=0,da=d.getSphericalPCPF(ca),ia=d.getSphericalPCPF(Z),ka=v.getProjector(Z,ia)){ca===
da?Z.isGeographic?C(this,U,Z,ea,ia):B(this,U,Z,ea,ia,ka):Z.isWGS84&&(ca.isWebMercator||r.isPlateCarree(ca))?(this.getCenter(J),J[2]+=ea,ea=d.getSphericalPCPF(ca),w.projectBuffer(J,Z,0,J,ea,0,1),A(ea,this,J,ca,U)):Z.isWebMercator&&r.isPlateCarree(ca)?(this.getCenter(J),J[2]+=ea,A(Z,this,J,ca,U)):(da=this.getCenter(J),da[2]+=ea,w.projectBuffer(da,Z,0,da,ca,0,1),U.center=da,this!==U&&(U.quaternion=this.getQuaternion(H),U.halfSize=this.getHalfSize(Q)))}}const F=k.create(),H=k.create(),N=k.create(),E=
f.create(),G=f.create(),I=e.create(),O=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2],L=(()=>{const U=new Int8Array(162);let Z=0;const ca=ea=>{for(let da=0;da<ea.length;da++)U[Z+da]=ea[da];Z+=6};ca([6,2,3,1,5,4]);ca([0,2,3,1,5,4]);ca([0,2,3,7,5,4]);ca([0,1,3,2,6,4]);ca([0,1,3,2,0,0]);ca([0,1,5,7,3,2]);ca([0,1,3,7,6,4]);ca([0,1,3,7,6,2]);ca([0,1,5,7,6,2]);ca([0,1,5,4,6,2]);ca([0,1,5,4,0,0]);ca([0,1,3,7,5,4]);ca([0,2,6,4,0,0]);ca([0,0,0,0,0,0]);ca([1,3,7,5,0,0]);ca([2,3,7,6,4,0]);ca([2,3,7,6,0,0]);ca([2,3,
1,5,7,6]);ca([0,1,5,7,6,2]);ca([0,1,5,7,6,4]);ca([0,1,3,7,6,4]);ca([4,5,7,6,2,0]);ca([4,5,7,6,0,0]);ca([4,5,1,3,7,6]);ca([0,2,3,7,5,4]);ca([6,2,3,7,5,4]);ca([6,2,3,1,5,4]);return U})(),P=Array(24),M=new y.Vertices(P,3),K=f.create(),J=f.create(),R=f.create(),Q=f.create(),W=q.create(),S=l.create(),V=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],T=f.create(),Y=f.create(),ha=f.create(),ba=f.fromValues(-1,-1,-1);a.Obb=D;a.compute=z;a.computeOffsetObb=function(U,Z,ca,ea,da){var ia=U.getQuaternion(H);
da.quaternion=ia;p.conjugate(F,ia);var ka=U.getCenter(J);ia=U.getHalfSize(Q);if(ea===u.ViewingMode.Global){h.transformQuat(T,ka,F);h.abs(Y,T);h.min(ha,Y,ia);h.sub(ha,Y,ha);ea=h.length(ha);h.add(ha,Y,ia);const fa=h.length(ha);ea<ca?(da.center=ka,h.set(T,ca,ca,ca),da.halfSize=h.add(T,ia,T)):(Z=0<fa?1+Z/fa:1,ka=0<ea?1+ca/ea:1,ca=(ka+Z)/2,Z=(ka-Z)/2,h.scale(ha,Y,Z),da.halfSize=h.scaleAndAdd(ha,ha,ia,ca),h.scale(ha,Y,ca),h.scaleAndAdd(ha,ha,ia,Z),h.sign(T,T),h.multiply(T,ha,T),U=U.getQuaternion(N),da.center=
h.transformQuat(T,T,U))}else da.center=h.scaleAndAdd(T,ka,f.UNIT_Z,(ca+Z)/2),U=h.transformQuat(T,f.UNIT_Z,F),h.abs(U,U),da.halfSize=h.scaleAndAdd(Y,ia,U,(ca-Z)/2);return da};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/computeTranslationToOriginAndRotation":function(){define("exports ../../core/mathUtils ../../core/libs/gl-matrix-2/math/mat4 ../../core/libs/gl-matrix-2/factories/vec3f64 ./localRotationUtils ./projectors ../support/spatialReferenceUtils".split(" "),
function(a,b,q,l,p,k,h){function f(d){return d===k.ProjectionID.SPHERICAL_ECEF||d===k.ProjectionID.SPHERICAL_MARS_PCPF||d===k.ProjectionID.SPHERICAL_MOON_PCPF}const c=b.deg2rad(1),e=l.create(),g=l.create();a.computeTranslationToOriginAndRotation=function(d,t,w,v){if(null==d||null==v)return!1;var m=k.classifySpatialReference(d,k.sourceClassificationCache),r=k.classifySpatialReference(v,k.destClassificationCache);if(m===r&&!f(r)&&(m!==k.ProjectionID.UNKNOWN||h.equals(d,v)))return q.fromTranslation(w,
t),!0;if(f(r)){m=k.projectionTable[m][k.ProjectionID.LON_LAT];r=k.projectionTable[k.ProjectionID.LON_LAT][r];if(null==m||null==r)return!1;m(t,0,e,0);r(e,0,g,0);p.computeENUToSphericalPCPFLocalRotation(c*e[0],c*e[1],w);w[12]=g[0];w[13]=g[1];w[14]=g[2];return!0}if(!(r!==k.ProjectionID.WEB_MERCATOR&&r!==k.ProjectionID.PLATE_CARREE&&r!==k.ProjectionID.WGS84&&r!==k.ProjectionID.CGCS2000||m!==k.ProjectionID.WGS84&&m!==k.ProjectionID.SPHERICAL_ECEF&&m!==k.ProjectionID.WEB_MERCATOR&&m!==k.ProjectionID.CGCS2000)){d=
k.projectionTable[m][k.ProjectionID.LON_LAT];r=k.projectionTable[k.ProjectionID.LON_LAT][r];if(null==d||null==r)return!1;d(t,0,e,0);r(e,0,g,0);m===k.ProjectionID.SPHERICAL_ECEF?p.computeSphericalPCPFToENULocalRotation(c*e[0],c*e[1],w):q.identity(w);w[12]=g[0];w[13]=g[1];w[14]=g[2];return!0}return!1};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/localRotationUtils":function(){define(["exports","../../core/libs/gl-matrix-2/math/mat4"],function(a,b){function q(l,
p,k){const h=Math.sin(l);l=Math.cos(l);const f=Math.sin(p);p=Math.cos(p);k[0]=-h;k[4]=-f*l;k[8]=p*l;k[12]=0;k[1]=l;k[5]=-f*h;k[9]=p*h;k[13]=0;k[2]=0;k[6]=p;k[10]=f;k[14]=0;k[3]=0;k[7]=0;k[11]=0;k[15]=1;return k}a.computeENUToSphericalPCPFLocalRotation=q;a.computeSphericalPCPFToENULocalRotation=function(l,p,k){q(l,p,k);b.transpose(k,k);return k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/dito":function(){define("exports ../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../core/libs/gl-matrix-2/factories/quatf64 ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../webgl-engine/lib/Attribute".split(" "),
function(a,b,q,l,p,k,h){function f(da,ia,ka,fa,X,ja){if(!(1E-6>ia[0]*ia[0]+ia[1]*ia[1]+ia[2]*ia[2]))for(r(I,ka,ia),r(O,fa,ia),r(L,X,ia),c(da,ia,G),M[1]=G[0],P[1]=G[1],K[1]=P[1]-M[1],ka=[ka,fa,X],fa=[I,O,L],X=0;3>X;++X){c(da,ka[X],G);M[0]=G[0];P[0]=G[1];c(da,fa[X],G);M[2]=G[0];P[2]=G[1];K[0]=P[0]-M[0];K[2]=P[2]-M[2];const la=d(K);la<ja.quality&&(m(ja.b0,ka[X]),m(ja.b1,ia),m(ja.b2,fa[X]),ja.quality=la)}}function c(da,ia,ka){const {data:fa,size:X}=da;ka[0]=Number.POSITIVE_INFINITY;ka[1]=Number.NEGATIVE_INFINITY;
for(da=0;da<fa.length;da+=X){const ja=fa[da]*ia[0]+fa[da+1]*ia[1]+fa[da+2]*ia[2];ka[0]=Math.min(ka[0],ja);ka[1]=Math.max(ka[1],ja)}}function e(da,ia,ka,fa,X,ja){c(da,ia,G);X[0]=G[0];ja[0]=G[1];c(da,ka,G);X[1]=G[0];ja[1]=G[1];c(da,fa,G);X[2]=G[0];ja[2]=G[1]}function g(da,ia,ka,fa,X,ja,la){U[0]=da[0];U[1]=da[1];U[2]=da[2];U[3]=ia[0];U[4]=ia[1];U[5]=ia[2];U[6]=ka[0];U[7]=ka[1];U[8]=ka[2];var na=Z,va=U,za=va[0]+va[4]+va[8];if(0<za)za=Math.sqrt(za+1),na[3]=.5*za,za=.5/za,na[0]=(va[5]-va[7])*za,na[1]=(va[6]-
va[2])*za,na[2]=(va[1]-va[3])*za;else{za=0;va[4]>va[0]&&(za=1);va[8]>va[3*za+za]&&(za=2);const ya=(za+1)%3,Da=(za+2)%3;let ra=Math.sqrt(va[3*za+za]-va[3*ya+ya]-va[3*Da+Da]+1);na[za]=.5*ra;ra=.5/ra;na[3]=(va[3*ya+Da]-va[3*Da+ya])*ra;na[ya]=(va[3*ya+za]+va[3*za+ya])*ra;na[Da]=(va[3*Da+za]+va[3*za+Da])*ra}la.quaternion=na;t(Y,fa,X);v(Y,Y,.5);v(ha,da,Y[0]);v(ba,ia,Y[1]);t(ha,ha,ba);v(ba,ka,Y[2]);la.center=p.add(ha,ha,ba);la.halfSize=p.scale(Y,ja,.5)}function d(da){return da[0]*da[1]+da[0]*da[2]+da[1]*
da[2]}function t(da,ia,ka){da[0]=ia[0]+ka[0];da[1]=ia[1]+ka[1];da[2]=ia[2]+ka[2]}function w(da,ia,ka){da[0]=ia[0]-ka[0];da[1]=ia[1]-ka[1];da[2]=ia[2]-ka[2]}function v(da,ia,ka){da[0]=ia[0]*ka;da[1]=ia[1]*ka;da[2]=ia[2]*ka}function m(da,ia,ka=0){da[0]=ia[ka];da[1]=ia[ka+1];da[2]=ia[ka+2]}function r(da,ia,ka){const fa=ia[0],X=ia[1];ia=ia[2];const ja=ka[0],la=ka[1];ka=ka[2];da[0]=X*ka-ia*la;da[1]=ia*ja-fa*ka;da[2]=fa*la-X*ja}function n(da,ia){var ka=ia[0]*ia[0]+ia[1]*ia[1]+ia[2]*ia[2];0<ka&&(ka=1/Math.sqrt(ka),
da[0]=ia[0]*ka,da[1]=ia[1]*ka,da[2]=ia[2]*ka)}function u(da,ia){const ka=ia[0]-da[0],fa=ia[1]-da[1];da=ia[2]-da[2];return ka*ka+fa*fa+da*da}const x=k.create(),y=k.create(),z=k.create(),A=k.create(),B=k.create(),C=k.create(),D=k.create(),F=k.create(),H=k.create(),N=k.create(),E=[0,0,0],G=l.create(),I=k.create(),O=k.create(),L=k.create(),P=k.create(),M=k.create(),K=k.create(),J=k.create(),R=k.create(),Q=k.create(),W=k.create(),S=k.create(),V=k.create(),T=k.create(),Y=k.create(),ha=k.create(),ba=k.create(),
U=b.fromValues(1,0,0,0,1,0,0,0,1),Z=q.create();class ca{constructor(da){this.minVert=Array(7);this.maxVert=Array(7);this.buffer=new ArrayBuffer(448);var ia=0;this.minProj=new Float64Array(this.buffer,ia,7);ia+=56;this.maxProj=new Float64Array(this.buffer,ia,7);ia+=56;for(var ka=0;7>ka;++ka)this.minVert[ka]=new Float64Array(this.buffer,ia,3),ia+=24;for(ka=0;7>ka;++ka)this.maxVert[ka]=new Float64Array(this.buffer,ia,3),ia+=24;for(ia=0;7>ia;++ia)this.minProj[ia]=Number.POSITIVE_INFINITY,this.maxProj[ia]=
Number.NEGATIVE_INFINITY;ia=Array(7);ka=Array(7);const {data:fa,size:X}=da;for(da=0;da<fa.length;da+=X){var ja=fa[da];ja<this.minProj[0]&&(this.minProj[0]=ja,ia[0]=da);ja>this.maxProj[0]&&(this.maxProj[0]=ja,ka[0]=da);ja=fa[da+1];ja<this.minProj[1]&&(this.minProj[1]=ja,ia[1]=da);ja>this.maxProj[1]&&(this.maxProj[1]=ja,ka[1]=da);ja=fa[da+2];ja<this.minProj[2]&&(this.minProj[2]=ja,ia[2]=da);ja>this.maxProj[2]&&(this.maxProj[2]=ja,ka[2]=da);ja=fa[da]+fa[da+1]+fa[da+2];ja<this.minProj[3]&&(this.minProj[3]=
ja,ia[3]=da);ja>this.maxProj[3]&&(this.maxProj[3]=ja,ka[3]=da);ja=fa[da]+fa[da+1]-fa[da+2];ja<this.minProj[4]&&(this.minProj[4]=ja,ia[4]=da);ja>this.maxProj[4]&&(this.maxProj[4]=ja,ka[4]=da);ja=fa[da]-fa[da+1]+fa[da+2];ja<this.minProj[5]&&(this.minProj[5]=ja,ia[5]=da);ja>this.maxProj[5]&&(this.maxProj[5]=ja,ka[5]=da);ja=fa[da]-fa[da+1]-fa[da+2];ja<this.minProj[6]&&(this.minProj[6]=ja,ia[6]=da);ja>this.maxProj[6]&&(this.maxProj[6]=ja,ka[6]=da)}for(da=0;7>da;++da)ja=ia[da],m(this.minVert[da],fa,ja),
ja=ka[da],m(this.maxVert[da],fa,ja)}}class ea{constructor(){this.b0=k.fromValues(1,0,0);this.b1=k.fromValues(0,1,0);this.b2=k.fromValues(0,0,1);this.quality=0}}a.computeOBB=function(da,ia){const {data:ka,size:fa}=da;var X=ka.length/fa;if(!(0>=X)){var ja=new ca(da);t(x,ja.minProj,ja.maxProj);v(x,x,.5);w(y,ja.maxProj,ja.minProj);var la=d(y),na=new ea;na.quality=la;14>X&&(da=new h.Vertices(new Float64Array(ja.buffer,112,42),3));var va=k.create(),za=k.create(),ya=k.create();X=k.create();var Da=k.create(),
ra=k.create(),xa=k.create();var Ma=da;var Ga=u(ja.maxVert[0],ja.minVert[0]),Pa=0;for(var Qa=1;7>Qa;++Qa){const Na=u(ja.maxVert[Qa],ja.minVert[Qa]);Na>Ga&&(Ga=Na,Pa=Qa)}m(va,ja.minVert[Pa]);m(za,ja.maxVert[Pa]);if(1E-6>u(va,za))Ma=1;else{w(X,va,za);n(X,X);const {data:Na,size:Ua}=Ma;ja=Number.NEGATIVE_INFINITY;Ga=0;for(Pa=0;Pa<Na.length;Pa+=Ua)E[0]=Na[Pa]-va[0],E[1]=Na[Pa+1]-va[1],E[2]=Na[Pa+2]-va[2],Qa=X[0]*E[0]+X[1]*E[1]+X[2]*E[2],Qa=E[0]*E[0]+E[1]*E[1]+E[2]*E[2]-Qa*Qa/(X[0]*X[0]+X[1]*X[1]+X[2]*X[2]),
Qa>ja&&(ja=Qa,Ga=Pa);m(ya,Na,Ga);1E-6>ja?Ma=2:(w(Da,za,ya),n(Da,Da),w(ra,ya,va),n(ra,ra),r(xa,Da,X),n(xa,xa),f(Ma,xa,X,Da,ra,na),Ma=0)}switch(Ma){case 1:ia.center=x;ia.halfSize=p.scale(y,y,.5);ia.quaternion=q.IDENTITY;return;case 2:la=da;m(R,X);Math.abs(X[0])>Math.abs(X[1])&&Math.abs(X[0])>Math.abs(X[2])?R[0]=0:Math.abs(X[1])>Math.abs(X[2])?R[1]=0:R[2]=0;1E-6>R[0]*R[0]+R[1]*R[1]+R[2]*R[2]&&(R[0]=R[1]=R[2]=1);r(Q,X,R);n(Q,Q);r(W,X,Q);n(W,W);e(la,X,Q,W,S,V);w(T,V,S);g(X,Q,W,S,V,T,ia);return}Ma=da;ja=
G;const {data:Ea,size:ua}=Ma;m(A,Ea);m(z,A);ja[0]=J[0]*xa[0]+J[1]*xa[1]+J[2]*xa[2];ja[1]=ja[0];for(Ga=ua;Ga<Ea.length;Ga+=ua)Pa=Ea[Ga]*xa[0]+Ea[Ga+1]*xa[1]+Ea[Ga+2]*xa[2],Pa<ja[0]&&(ja[0]=Pa,m(A,Ea,Ga)),Pa>ja[1]&&(ja[1]=Pa,m(z,Ea,Ga));xa=va[0]*xa[0]+va[1]*xa[1]+va[2]*xa[2];G[1]-1E-6<=xa&&(z[0]=void 0);G[0]+1E-6>=xa&&(A[0]=void 0);void 0!==z[0]&&(w(B,z,va),n(B,B),w(C,z,za),n(C,C),w(D,z,ya),n(D,D),r(F,C,X),n(F,F),r(H,D,Da),n(H,H),r(N,B,ra),n(N,N),f(Ma,F,X,C,B,na),f(Ma,H,Da,D,C,na),f(Ma,N,ra,B,D,na));
void 0!==A[0]&&(w(B,A,va),n(B,B),w(C,A,za),n(C,C),w(D,A,ya),n(D,D),r(F,C,X),n(F,F),r(H,D,Da),n(H,H),r(N,B,ra),n(N,N),f(Ma,F,X,C,B,na),f(Ma,H,Da,D,C,na),f(Ma,N,ra,B,D,na));e(da,na.b0,na.b1,na.b2,S,V);da=k.create();w(da,V,S);na.quality=d(da);na.quality<la?g(na.b0,na.b1,na.b2,S,V,da,ia):(ia.center=x,ia.halfSize=p.scale(y,y,.5),ia.quaternion=q.IDENTITY)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Attribute":function(){define(["exports"],function(a){class b{constructor(l,
p,k=p){this.data=l;this.size=p;this.stride=k}}class q extends b{constructor(l,p,k,h=!1,f=k){super(l,k,f);this.indices=p;this.exclusive=h}}a.Attribute=q;a.Vertices=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/cameraUtilsPlanar":function(){define("exports ../core/mathUtils ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../geometry/Extent ../geometry/projection/projectPointToVector ../geometry/projection/projectVectorToVector ../views/3d/support/cameraUtilsInternal".split(" "),
function(a,b,q,l,p,k,h,f,c,e){function g(z,A,B,C=e.createDirectionUp()){const {direction:D,up:F}=C;q.fromZRotation(u,-b.deg2rad(A));q.rotateX(u,u,b.deg2rad(B));p.transformMat4(D,n,u);p.scale(D,D,-1);p.transformMat4(F,r,u);return C}function d(z,A,B,C){return e.directionToHeadingTilt(A,B,C,n,r)}function t(z,A,B,C){const D=g(z,B,C),F=k.create();p.scale(F,D.direction,-A);p.add(F,F,z);return{up:D.up,eye:F,heading:B,tilt:C}}function w(z){return b.rad2deg(z)}function v(z){return b.deg2rad(z)}function m(z,
A,B,C,D){const F=z.renderSpatialReference;z=z.map&&z.spatialReference||A.spatialReference;f.projectPointToVector(A,x,F);f.projectPointToVector(A,y,F);x[0]-=B/2;y[0]+=B/2;x[1]-=C/2;y[1]+=C/2;c.projectVectorToVector(x,F,x,z);c.projectVectorToVector(y,F,y,z);D?(D.xmin=x[0],D.ymin=x[1],D.xmax=y[0],D.ymax=y[1],D.spatialReference=z):D=new h(x[0],x[1],y[0],y[1],z);return D}const r=k.fromValues(0,1,0),n=k.fromValues(0,0,1),u=l.create(),x=k.create(),y=k.create();l=Object.freeze(Object.defineProperty({__proto__:null,
directionToHeadingTilt:d,eyeForCenterWithHeadingTilt:t,eyeTiltToLookAtTilt:v,headingTiltToDirectionUp:g,lookAtTiltToEyeTilt:w,toExtent:m},Symbol.toStringTag,{value:"Module"}));a.cameraUtilsPlanar=l;a.directionToHeadingTilt=d;a.eyeForCenterWithHeadingTilt=t;a.eyeTiltToLookAtTilt=v;a.headingTiltToDirectionUp=g;a.lookAtTiltToEyeTilt=w;a.toExtent=m})},"esri/views/3d/support/cameraUtilsInternal":function(){define(["exports","../../../core/mathUtils","../../../chunks/vec32","../../../core/libs/gl-matrix-2/factories/vec3f64"],
function(a,b,q,l){const p=l.create(),k=l.create();a.createDirectionUp=function(){return{direction:l.create(),up:l.create()}};a.directionToHeadingTilt=function(h,f,c,e,g){let d=q.normalize(p,h),t=q.dot(d,e);const w=0<t;t=Math.abs(t);.99<t&&(t=Math.abs(q.dot(f,e)),.99>t?(q.copy(d,f),w&&q.scale(d,d,-1)):d=null);f=0;d&&(q.scale(k,e,q.dot(e,d)),q.subtract(d,d,k),f=q.dot(d,g)/(q.length(d)*q.length(g)),q.cross(k,d,g),f=(0<q.dot(k,e)?1:-1)*b.rad2deg(b.acosClamped(f)));h=b.rad2deg(b.acosClamped(-q.dot(e,h)/
q.length(h)));if(!c)return{heading:f,tilt:h};c.heading=f;c.tilt=h;return c};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/cameraUtilsSpherical":function(){define("exports ../core/Cyclical ../core/mathUtils ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../geometry/ellipsoidUtils ../geometry/Extent ../geometry/SpatialReference ../geometry/support/webMercatorUtils ../views/3d/support/cameraUtilsInternal ../views/3d/support/earthUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){function w(H,N,E,G=d.createDirectionUp()){k.cross(D,H,z);0===k.dot(D,D)&&k.cross(D,H,A);l.fromRotation(C,-q.deg2rad(N),H);l.rotate(C,C,-q.deg2rad(E),D);const {up:I,direction:O}=G;k.cross(I,D,H);k.normalize(I,I);k.transformMat4(I,I,C);k.normalize(O,H);k.negate(O,O);k.transformMat4(O,O,C);return G}function v(H,N,E,G){const I=D,O=F;k.normalize(I,H);k.cross(F,I,z);0===k.dot(F,F)&&k.cross(F,I,A);k.cross(O,F,I);return d.directionToHeadingTilt(N,E,G,I,O)}function m(H,
N,E,G){const I={eye:h.create(),up:null,tilt:G,heading:E},O=D;O[0]=H[0];O[1]=H[2];O[2]=-H[1];E=q.deg2rad(E);var L=q.deg2rad(G);G=Math.sin(E);E=Math.cos(E);var P=Math.sin(L),M=Math.cos(L);const K=k.length(O);if(1E-8>Math.abs(L))L=N+K;else{var J=K/P,R=q.asinClamped(N/J);L=J*Math.sin(Math.PI-L-R)}M*=N;J=N*N*P*P;R=E*E*J;const Q=L-M,W=Q*Q;var S=R*(R+W-O[1]*O[1]);if(0>S)return k.scale(I.eye,O,L/K),I.tilt=0,n(I,H);var V=Math.sqrt(S);const T=O[1]*Q;S=R+W;V=0<E?-V+T:V+T;if(1E-8>Math.abs(S))return 1E-8>K?(I.eye[0]=
0,I.eye[1]=0,I.eye[2]=N):k.scale(I.eye,O,L/K),I.tilt=0,r(I.eye),n(I,H);I.eye[1]=V/S;N*=P;V=I.eye[1]*I.eye[1];P=1-V;S=Math.sqrt(P);J=R*V+G*G*J-2*E*N*I.eye[1]*S*Q+P*W;if(1E-8>Math.abs(J))return k.scale(I.eye,O,L/K),I.tilt=0,r(I.eye),n(I,H);I.eye[0]=(P*(L*O[0]-M*O[0])-N*S*(O[0]*I.eye[1]*E+O[2]*G))/J;I.eye[2]=(P*(L*O[2]-M*O[2])-N*S*(O[2]*I.eye[1]*E-O[0]*G))/J;k.scale(I.eye,I.eye,L);r(I.eye);return n(I,H)}function r(H){const N=H[1];H[1]=-H[2];H[2]=N}function n(H,N){N=w(N,H.heading,H.tilt);H.up=N.up;return H}
function u(H,N,E){N=k.length(N);E=q.asinClamped(E/(Math.sqrt(E*E+N*N-2*E*N*Math.cos(Math.PI-H))/Math.sin(H)));return q.rad2deg(H-E)}function x(H,N,E){H=q.deg2rad(H);N=k.length(N);return q.asinClamped(E/(N/Math.sin(H)))+H}function y(H,N,E,G,I){function O(K){const J=Math.PI/2;K=b.cyclical2PI.normalize(K,-J);K>J&&(K=Math.PI-K);return K}var L=N.latitude;var P=f.getReferenceEllipsoid(H.spatialReference).radius;N=N.longitude;var M=t.getLonDeltaForDistance(L,E,P)/2;E=N-M;N+=M;L=q.deg2rad(L);L=(1+Math.sin(L))/
(1-Math.sin(L));M=(L+1)*Math.tan(G/P/2);L=1.5*Math.PI-2*Math.atan(.5*(M+Math.sqrt(4*L+M*M)));G=L+G/P;L=O(L);G=O(G);G<L&&(P=G,G=L,L=P);L=Math.max(q.rad2deg(L),-90);G=Math.min(q.rad2deg(G),90);N=B.monotonic(E,N);180<N-E&&(P=(N-E-180)/2,E+=P,N-=P);P=H.spatialReference&&H.spatialReference.isGeographic?H.spatialReference:e.WGS84;I?(I.xmin=E,I.ymin=L,I.xmax=N,I.ymax=G,I.spatialReference=P):I=new c(E,L,N,G,P);H.spatialReference&&H.spatialReference.isWebMercator&&g.geographicToWebMercator(I,!1,I);return I}
const z=h.fromValues(0,0,1),A=k.normalize(h.create(),h.fromValues(1,1,1)),B=new b.Cyclical(-180,180),C=p.create(),D=h.create(),F=h.create();p=Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:v,eyeForCenterWithHeadingTilt:m,eyeTiltToLookAtTilt:x,headingTiltToDirectionUp:w,lookAtTiltToEyeTilt:u,toExtent:y},Symbol.toStringTag,{value:"Module"}));a.cameraUtilsSpherical=p;a.directionToHeadingTilt=v;a.eyeForCenterWithHeadingTilt=m;a.eyeTiltToLookAtTilt=x;a.headingTiltToDirectionUp=
w;a.lookAtTiltToEyeTilt=u;a.toExtent=y})},"esri/views/3d/support/earthUtils":function(){define(["exports","../../../core/mathUtils","../../../geometry/ellipsoidUtils","../../../geometry/Point"],function(a,b,q,l){function p(f,c,e){if(null==c.longitude||null==c.latitude||null==e.longitude||null==e.latitude)throw Error("Invalid points: no lon/lat");return k(f,c.longitude,c.latitude,e.longitude,e.latitude)}function k(f,c,e,g,d){e=b.deg2rad(e);d=b.deg2rad(d);c=b.deg2rad(c);const t=b.deg2rad(g);g=Math.sin((e-
d)/2);c=Math.sin((c-t)/2);e=2*b.asinClamped(Math.sqrt(g*g+Math.cos(e)*Math.cos(d)*c*c));return Math.round(e*f*1E4)/1E4}function h(f,c){f/=15;c||(f=Math.round(f));return f}a.getGreatCircleDistance=k;a.getGreatCircleDistanceFromPoints=p;a.getGreatCircleSpanAt=function(f,c,e){const g=c.spatialReference,d=q.getReferenceEllipsoid(g),t=new l(c.x,f.y,g),w=new l(e.x,f.y,g);c=new l(f.x,c.y,g);f=new l(f.x,e.y,g);return{lon:p(d.radius,t,w),lat:p(d.radius,c,f)}};a.getLonDeltaForDistance=function(f,c,e){c/=e;
f=b.deg2rad(f);c=Math.sin(c/2);f=Math.cos(f);f=2*b.asinClamped(Math.sqrt(c*c/(f*f)));return b.rad2deg(f)};a.longitudeToTimezone=h;a.positionToTimezoneInfo=function(f,c){f=f?.[0];if(null==f)return null;c||={hours:0,minutes:0,seconds:0};c.hours=h(f,!0);f=c.hours%1;c.hours-=f;c.minutes=60*f;f=c.minutes%1;c.minutes-=f;c.seconds=Math.round(60*f);return c};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/ElevationProvider":function(){define(["exports","../../../layers/graphics/dehydratedFeatureUtils"],
function(a,b){function q(p){return"array"in p}class l{constructor(p,k=null,h=0){this.array=p;this.spatialReference=k;this.offset=h}}a.SamplePosition=l;a.getElevationAtPoint=function(p,k,h="ground"){if(b.isDehydratedPoint(k))return p.getElevation(k.x,k.y,k.z||0,k.spatialReference,h);if(q(k)){let f=k.offset;return p.getElevation(k.array[f++],k.array[f++],k.array[f]||0,k.spatialReference??p.spatialReference,h)}return p.getElevation(k[0],k[1],k[2]||0,p.spatialReference,h)};a.isSamplePosition=q;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/dehydratedFeatureUtils":function(){define(["exports"],function(a){a.isDehydratedPoint=function(b){return"point"===b.type};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/spatialReferenceSupport":function(){define(["exports","../../geometry/support/SupportedGCSWkids","../ViewingMode"],function(a,b,q){a.isSpatialReferenceSupported=function(l,p){return null==l?!1:null==p?!0:p===q.ViewingMode.Local?l.isGeographic?
l.isWGS84||l.wkid===b.SupportedGCSWkids.CGCS2000:!0:l.isWebMercator||l.isWGS84||l.wkid===b.SupportedGCSWkids.CGCS2000||l.wkid===b.SupportedGCSWkids.GCSMARS2000||l.wkid===b.SupportedGCSWkids.GCSMARS2000_SPHERE||l.wkid===b.SupportedGCSWkids.GCSMOON2000};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/GroundViewElevationSampler":function(){define("../../chunks/tslib.es6 ../../core/Evented ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/has ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../geometry/SpatialReference ../../geometry/support/aaBoundingRect ../../geometry/support/contains ../../layers/support/ElevationSampler ../3d/terrain/TerrainConst".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){b=class extends b.EventedAccessor{constructor(t){super(t);this.demResolution={min:-1,max:-1};this.noDataValue=d.elevationNoDataValue}initialize(){this.view.basemapTerrain.on("elevation-change",()=>this.emit("changed",{}))}get extent(){const t=this.view.basemapTerrain;if(null==t?.extent||null==t.spatialReference)return null;const w=c.toExtent(t.extent,t.spatialReference);w.zmin=t.visibleElevationBounds.min;w.zmax=t.visibleElevationBounds.max;return w}get spatialReference(){return this.view.basemapTerrain?.spatialReference??
f.WGS84}elevationAt(t,w){if(null==this.extent||!e.extentContainsXYZ(this.extent,t,w)){const v=null!=this.extent?`${this.extent.xmin}, ${this.extent.ymin}, ${this.extent.xmax}, ${this.extent.ymax}`:null;q.getLogger(this).warn("#elevationAt()",`Point used to sample elevation (${t}, ${w}) is outside of the sampler extent (${v})`);return this.noDataValue}return this.view.elevationProvider?.getElevation(t,w,0,this.spatialReference,"ground")??this.noDataValue}queryElevation(t){return g.updateGeometryElevation(t.clone(),
this)}};a.__decorate([l.property({readOnly:!0})],b.prototype,"demResolution",void 0);a.__decorate([l.property({readOnly:!0})],b.prototype,"extent",null);a.__decorate([l.property({readOnly:!0})],b.prototype,"noDataValue",void 0);a.__decorate([l.property()],b.prototype,"spatialReference",null);a.__decorate([l.property({constructOnly:!0})],b.prototype,"view",void 0);return b=a.__decorate([h.subclass("esri.views.support.GroundViewElevationSampler")],b)})},"esri/layers/support/ElevationSampler":function(){define("exports ../../geometry ../../core/has ../../core/handleUtils ../../core/Logger ../../core/unitUtils ../../geometry/support/aaBoundingRect ../../geometry/support/webMercatorUtils ../../geometry/Point".split(" "),
function(a,b,q,l,p,k,h,f,c){function e(r,n){const u=g(r,n.spatialReference);if(!u)return null;switch(r.type){case "point":r.z=n.elevationAt(u.x,u.y);break;case "polyline":m.spatialReference=u.spatialReference;var x=r.hasM&&!r.hasZ;for(var y=0;y<r.paths.length;y++){var z=r.paths[y],A=u.paths[y];for(let B=0;B<z.length;B++){const C=z[B],D=A[B];m.x=D[0];m.y=D[1];x&&(C[3]=C[2]);C[2]=n.elevationAt(m.x,m.y)}}r.hasZ=!0;break;case "multipoint":m.spatialReference=u.spatialReference;x=r.hasM&&!r.hasZ;for(y=
0;y<r.points.length;y++)z=r.points[y],A=u.points[y],m.x=A[0],m.y=A[1],x&&(z[3]=z[2]),z[2]=n.elevationAt(m.x,m.y);r.hasZ=!0}return r}function g(r,n){if(null==r)return null;const u=r.spatialReference;if(u.equals(n))return r;(r=f.project(r,n))||d().error(`Cannot project geometry spatial reference (wkid:${u.wkid}) to elevation sampler spatial reference (wkid:${n.wkid})`);return r}const d=()=>p.getLogger("esri.layers.support.ElevationSampler");class t{queryElevation(r){return e(r.clone(),this)}on(){return l.makeHandle()}projectIfRequired(r,
n){return g(r,n)}}class w extends t{get spatialReference(){return this.extent.spatialReference}constructor(r,n,u){super();this.tile=r;this.noDataValue=u;u=r.tile.extent;this.extent=h.toExtent(u,n.spatialReference);this.extent.zmin=r.zmin;this.extent.zmax=r.zmax;this._aaExtent=u;u=k.getMetersPerUnitForSR(n.spatialReference);r=n.lodAt(r.tile.level).resolution*u;this.demResolution={min:r,max:r}}contains(r){r=this.projectIfRequired(r,this.spatialReference);return null==r?!1:this.containsAt(r.x,r.y)}containsAt(r,
n){return h.containsXY(this._aaExtent,r,n)}elevationAt(r,n){if(!this.containsAt(r,n)){var u=this.extent;u=`${u.xmin}, ${u.ymin}, ${u.xmax}, ${u.ymax}`;d().warn("#elevationAt()",`Point used to sample elevation (${r}, ${n}) is outside of the sampler extent (${u})`);return this.noDataValue}return this.tile.sample(r,n)??this.noDataValue}}class v extends t{get spatialReference(){return this.extent.spatialReference}constructor(r,n,u){super();let x;"number"===typeof n?(this.noDataValue=n,x=null):(x=n,this.noDataValue=
u);this.samplers=x?r.map(y=>new w(y,x,this.noDataValue)):r;if(r=this.samplers[0]){this.extent=r.extent.clone();const {min:y,max:z}=r.demResolution;this.demResolution={min:y,max:z};for(r=1;r<this.samplers.length;r++)n=this.samplers[r],this.extent.union(n.extent),this.demResolution.min=Math.min(this.demResolution.min,n.demResolution.min),this.demResolution.max=Math.max(this.demResolution.max,n.demResolution.max)}else this.extent=h.toExtent(h.create(),x.spatialReference),this.demResolution={min:0,max:0}}elevationAt(r,
n){let u,x=!1;for(const y of this.samplers)if(y.containsAt(r,n)&&(x=!0,u=y.elevationAt(r,n),u!==y.noDataValue))return u;if(null!=u)return u;x||d().warn("#elevationAt()",`Point used to sample elevation (${r}, ${n}) is outside of the sampler`);return this.noDataValue}}const m=new c;a.ElevationSamplerBase=t;a.MultiTileElevationSampler=v;a.TileElevationSampler=w;a.updateGeometryElevation=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TerrainConst":function(){define(["exports",
"../../../core/mathUtils","../../../geometry/support/aaBoundingRect","./TilingScheme"],function(a,b,q,l){b=b.clampFloat32(b.numberMaxFloat32/10);const p=q.create();l.TilingScheme.WebMercatorAuxiliarySphere.getExtent(0,0,0,p);q=q.create([-180,-90,180,90]);a.elevationNoDataValue=b;a.geographicWorldExtent=q;a.maxMemoryLodBias=2.5;a.maxPatchTesselation=512;a.maxRootTiles=64;a.maxTileNeighborLevelDelta=4;a.progressiveLoadingModulo=2;a.tooManyRootTilesAfterChangeError="Cannot extend surface to encompass all layers because it would result in too many root tiles.";
a.tooManyRootTilesForLayerError="Surface extent is too large for tile resolution at level 0.";a.webMercatorWorldExtent=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TilingScheme":function(){define("exports ../../../geometry ../../../core/Error ../../../core/has ../../../core/mathUtils ../../../core/unitUtils ../../../geometry/Extent ../../../geometry/SpatialReference ../../../geometry/support/aaBoundingRect ../../../geometry/support/spatialReferenceUtils ../../../geometry/support/webMercatorUtils ../../../layers/support/LOD ../../../layers/support/TileInfo ../../../geometry/Point".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(){return new q("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")}class m{constructor(n){var u=m.checkUnsupported(n);if(null!=u)throw u;this.spatialReference=n.spatialReference;this._isWebMercator=this.spatialReference.isWebMercator;this._isGCS=e.isGeographic(this.spatialReference);this.origin=[n.origin.x,n.origin.y];this.pixelSize=n.size[0];this.dpi=n.dpi;var x=n.lods.reduce((A,B)=>{B.level<A.minLod.level&&(A.minLod=B);
A.max=Math.max(A.max,B.level);return A},{minLod:n.lods[0],max:-Infinity}),y=x.minLod;const z=2**y.level;u=y.resolution*z;y=y.scale*z;this.levels=Array(x.max+1);for(x=0;x<this.levels.length;x++)this.levels[x]={resolution:u,scale:y,tileSize:[u*n.size[0],u*n.size[1]]},u/=2,y/=2}clone(){return new m(this.toTileInfo())}toTileInfo(){return new t({dpi:this.dpi,origin:new w({x:this.origin[0],y:this.origin[1],spatialReference:this.spatialReference}),size:[this.pixelSize,this.pixelSize],spatialReference:this.spatialReference,
lods:this.levels.map((n,u)=>new d({level:u,scale:n.scale,resolution:n.resolution}))})}getExtent(n,u,x,y){var z=this.levels[n];n=z.tileSize[0];z=z.tileSize[1];y[0]=this.origin[0]+x*n;y[2]=this.origin[0]+(x+1)*n;y[3]=this.origin[1]-u*z;y[1]=this.origin[1]-(u+1)*z}convertExtentToRadians(n,u){this._isWebMercator?(u[0]=g.x2lon(n[0]),u[1]=g.y2lat(n[1]),u[2]=g.x2lon(n[2]),u[3]=g.y2lat(n[3])):this._isGCS&&(u[0]=p.deg2rad(n[0]),u[1]=p.deg2rad(n[1]),u[2]=p.deg2rad(n[2]),u[3]=p.deg2rad(n[3]))}getExtentGeometry(n,
u,x,y=new h){this.getExtent(n,u,x,r);y.spatialReference=this.spatialReference;y.xmin=r[0];y.ymin=r[1];y.xmax=r[2];y.ymax=r[3];y.zmin=void 0;y.zmax=void 0;return y}ensureMaxLod(n){if(null==n)return!1;for(var u=!1;this.levels.length<=n;){const {resolution:x,scale:y}=this.levels[this.levels.length-1];u=x/2*this.pixelSize;this.levels.push({resolution:x/2,scale:y/2,tileSize:[u,u]});u=!0}return u}capMaxLod(n){this.levels.length>n+1&&(this.levels.length=n+1)}getMaxLod(){return this.levels.length-1}scaleAtLevel(n){return this.levels[0].scale/
2**n}levelAtScale(n){const u=this.levels[0].scale;return n>=u?0:Math.log(u/n)*Math.LOG2E}resolutionAtLevel(n){return this.levels[0].resolution/2**n}compatibleWith(n,u=Infinity){if(m.checkUnsupported(n))return!1;n=new m(n);if(!n.spatialReference.equals(this.spatialReference)||n.pixelSize!==this.pixelSize)return!1;u=Math.min(this.levels.length-1,n.levels.length-1,u);const x=this.levels[u].resolution;let y=.5*x;if(!p.floatEqualAbsolute(n.origin[0],this.origin[0],y)||!p.floatEqualAbsolute(n.origin[1],
this.origin[1],y))return!1;y=.5*x/2**u/this.pixelSize*12;return p.floatEqualAbsolute(x,n.levels[u].resolution,y)}rootTilesInExtent(n,u=null,x=Infinity){const y=[],z=this.levels[0].tileSize;if(null==n||0===z[0]||0===z[1])return y;m.computeRowColExtent(n,z,this.origin,r);n=r[1];let A=r[3],B=r[0],C=r[2];var D=C-B;const F=A-n;D*F>x&&(x=Math.floor(Math.sqrt(x)),F>x&&(n=n+Math.floor(.5*F)-Math.floor(.5*x),A=n+x),D>x&&(B=B+Math.floor(.5*D)-Math.floor(.5*x),C=B+x));for(x=n;x<A;x++)for(D=B;D<C;D++)y.push([0,
x,D]);null!=u&&(u[0]=this.origin[0]+B*z[0],u[1]=this.origin[1]-A*z[1],u[2]=this.origin[0]+C*z[0],u[3]=this.origin[1]-n*z[1]);return y}static computeRowColExtent(n,u,x,y){const z=.001*(n[2]-n[0]+(n[3]-n[1]));y[0]=Math.max(0,Math.floor((n[0]+z-x[0])/u[0]));y[2]=Math.max(0,Math.ceil((n[2]-z-x[0])/u[0]));y[1]=Math.max(0,Math.floor((x[1]-n[3]+z)/u[1]));y[3]=Math.max(0,Math.ceil((x[1]-n[1]-z)/u[1]))}static isPowerOfTwo(n){n=n.lods;const u=n[0].resolution*2**n[0].level;return!n.some(x=>!p.floatEqualRelative(x.resolution,
u/2**x.level))}static hasGapInLevels(n){n=n.lods.map(u=>u.level);n.sort((u,x)=>u-x);for(let u=1;u<n.length;u++)if(n[u]!==n[0]+u)return!0;return!1}static tileSizeSupported(n){const u=n.size[1];return u===n.size[0]&&0===(u&u-1)&&128<=u&&512>=u}static hasOriginPerLODs(n){const u=n.origin;return n.lods.some(x=>null!=x.origin&&(x.origin[0]!==u.x||x.origin[1]!==u.y))}static getMissingTileInfoError(){return new q("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")}static checkUnsupported(n){return null==
n?v():1>n.lods.length?new q("tilingscheme:generic","Tiling scheme must have at least one level"):m.isPowerOfTwo(n)?m.hasGapInLevels(n)?new q("tilingscheme:gaps","Tiling scheme levels must not have gaps between min and max level"):m.tileSizeSupported(n)?m.hasOriginPerLODs(n)?new q("tilingscheme:multiple-origin","Tiling scheme levels must not have their own origin"):null:new q("tilingscheme:tile-size","Tiles must be square and size must be one of [128, 256, 512]"):new q("tilingscheme:power-of-two",
"Tiling scheme must be power of two")}static fromExtent(n,u){const x=n[2]-n[0],y=n[3]-n[1];var z=k.getMetersPerUnitForSR(u);const A=1.2*Math.max(x,y),B=A/256;z=96/.0254*z*B;n=new m(new t({size:[256,256],origin:new w({x:n[0]-.5*(A-x),y:n[3]+.5*(A-y)}),lods:[new d({level:0,resolution:B,scale:z})],spatialReference:u}));n.ensureMaxLod(20);return n}static makeWebMercatorAuxiliarySphere(n){const u=new m(m.WebMercatorAuxiliarySphereTileInfo);u.ensureMaxLod(n);return u}static makeGCSWithTileSize(n,u=256,
x=16){const y=256/u;n=new m(new t({size:[u,u],origin:new w({x:-180,y:90,spatialReference:n}),spatialReference:n,lods:[new d({level:0,resolution:.703125*y,scale:2.95497598570834E8*y})]}));n.ensureMaxLod(x);return n}get test(){}}m.WebMercatorAuxiliarySphereTileInfo=new t({size:[256,256],origin:new w({x:-2.0037508342787E7,y:2.0037508342787E7,spatialReference:f.WebMercator}),spatialReference:f.WebMercator,lods:[new d({level:0,resolution:156543.03392800014,scale:5.91657527591555E8})]});m.WebMercatorAuxiliarySphere=
m.makeWebMercatorAuxiliarySphere(19);const r=c.create();a.TilingScheme=m;a.getMissingTileInfoError=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/LOD":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h){var f;b=f=class extends b.JSONSupport{constructor(c){super(c);
this.cols=null;this.level=0;this.origin=this.levelValue=null;this.resolution=0;this.rows=null;this.scale=0}clone(){return new f({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};a.__decorate([q.property({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],b.prototype,"cols",void 0);a.__decorate([q.property({type:l.Integer,json:{write:!0}})],b.prototype,"level",void 0);a.__decorate([q.property({type:String,
json:{write:!0}})],b.prototype,"levelValue",void 0);a.__decorate([q.property({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],b.prototype,"origin",void 0);a.__decorate([q.property({type:Number,json:{write:!0}})],b.prototype,"resolution",void 0);a.__decorate([q.property({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],b.prototype,"rows",void 0);a.__decorate([q.property({type:Number,json:{write:!0}})],b.prototype,
"scale",void 0);return b=f=a.__decorate([h.subclass("esri.layers.support.LOD")],b)})},"esri/layers/support/TileInfo":function(){define("../../chunks/tslib.es6 ../../core/jsonMap ../../core/JSONSupport ../../core/unitUtils ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ../../geometry/Point ../../geometry/SpatialReference ../../geometry/support/aaBoundingRect ../../geometry/support/spatialReferenceUtils ../../geometry/support/webMercatorUtils ./LOD ./TileKey".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){var u;b=new b.JSONMap({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});q=u=class extends q.JSONSupport{static create(x={}){const {resolutionFactor:y=1,scales:z,size:A=256,spatialReference:B=t.WebMercator,numLODs:C=24}=x;if(!v.isValid(B)){x=[];if(z)for(var D=0;D<z.length;D++){var F=
z[D];x.push(new r({level:D,scale:F,resolution:F}))}else for(D=5E-4,F=C-1;0<=F;F--)x.unshift(new r({level:F,scale:D,resolution:D})),D*=2;return new u({dpi:96,lods:x,origin:new d(0,0,B),size:[A,A],spatialReference:B})}D=v.getInfo(B);x=x.origin?new d({x:x.origin.x,y:x.origin.y,spatialReference:B}):D?new d({x:D.origin[0],y:D.origin[1],spatialReference:B}):new d({x:0,y:0,spatialReference:B});D=1/(39.37*l.getMetersPerUnitForSR(B)*96);F=[];if(z)for(var H=0;H<z.length;H++){var N=z[H];F.push(new r({level:H,
scale:N,resolution:N*D}))}else{var E=v.isGeographic(B)?512/A*5.916575275917094E8:256/A*5.91657527591555E8;H=Math.ceil(C/y);F.push(new r({level:0,scale:E,resolution:E*D}));for(N=1;N<H;N++)E/=2**y,F.push(new r({level:N,scale:E,resolution:E*D}))}return new u({dpi:96,lods:F,origin:x,size:[A,A],spatialReference:B})}constructor(x){super(x);this.dpi=96;this.spatialReference=this.size=this.origin=this.format=null}get isWrappable(){const {spatialReference:x,origin:y}=this;if(x&&y){const z=v.getInfo(x);return x.isWrappable&&
!!z&&Math.abs(z.origin[0]-y.x)<=z.dx}return!1}readOrigin(x,y){return d.fromJSON({spatialReference:y.spatialReference,...x})}set lods(x){const y=[],z=this._levelToLOD={};x&&x.forEach(A=>{y.push(A.scale);z[A.level]=A});this._set("scales",y);this._set("lods",x);this._initializeUpsampleLevels()}readSize(x,y){return[y.cols,y.rows]}writeSize(x,y){y.cols=x[0];y.rows=x[1]}zoomToScale(x){const y=this.scales;if(0>=x)return y[0];if(x>=y.length-1)return y[y.length-1];const z=Math.floor(x);return y[z]/(y[z]/y[z+
1])**(x-z)}scaleToZoom(x){const y=this.scales,z=y.length-1;let A=0;for(;A<z;A++){const B=y[A],C=y[A+1];if(B<=x)break;if(C===x)return A+1;if(B>x&&C<x)return A+Math.log(B/x)/Math.log(B/C)}return A}tileAt(x,y,z,A){var B=this.lodAt(x);if(!B)return null;let C;if("number"===typeof y)C=y,y=z;else{if(v.equals(y.spatialReference,this.spatialReference))C=y.x,y=y.y;else{A=m.project(y,this.spatialReference);if(null==A)return null;C=A.x;y=A.y}A=z}z=B.resolution*this.size[0];B=B.resolution*this.size[1];A||=new n.TileKey(null,
0,0,0,w.create());A.level=x;A.row=Math.floor((this.origin.y-y)/B+.001);A.col=Math.floor((C-this.origin.x)/z+.001);this.updateTileInfo(A);return A}updateTileInfo(x,y=u.ExtrapolateOptions.NONE){var z=this.lodAt(x.level);z||y!==u.ExtrapolateOptions.POWER_OF_TWO||(y=this.lods[this.lods.length-1],y.level<x.level&&(z=y));if(z){var A=x.level-z.level;y=z.resolution*this.size[0]/2**A;z=z.resolution*this.size[1]/2**A;x.id=`${x.level}/${x.row}/${x.col}`;x.extent||(x.extent=w.create());x.extent[0]=this.origin.x+
x.col*y;x.extent[1]=this.origin.y-(x.row+1)*z;x.extent[2]=x.extent[0]+y;x.extent[3]=x.extent[1]+z}}upsampleTile(x){const y=this._upsampleLevels[x.level];if(!y||-1===y.parentLevel)return!1;x.level=y.parentLevel;x.row=Math.floor(x.row/y.factor+.001);x.col=Math.floor(x.col/y.factor+.001);this.updateTileInfo(x);return!0}getTileBounds(x,y){var z=this.lodAt(y.level);if(null==z)return null;var {resolution:A}=z;z=A*this.size[0];A*=this.size[1];x[0]=this.origin.x+y.col*z;x[1]=this.origin.y-(y.row+1)*A;x[2]=
x[0]+z;x[3]=x[1]+A;return x}lodAt(x){return this._levelToLOD?.[x]??null}clone(){return u.fromJSON(this.write({}))}getCompatibleForVTL(x){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===x)return null;const y=(512===this.size[0]&&256===x?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===x&&0===y)return this;const z=[],A=this.lods.length-y;for(let B=0;B<A;B++){const C=B+y,{scale:D,resolution:F}=0<=C?this.lods[C]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};
z.push(new r({level:B,scale:D,resolution:F}))}return new u({size:[x,x],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:z})}_initializeUpsampleLevels(){const x=this.lods;this._upsampleLevels=[];let y=null;for(let z=0;z<x.length;z++){const A=x[z];this._upsampleLevels[A.level]={parentLevel:y?y.level:-1,factor:y?y.resolution/A.resolution:0};y=A}}};a.__decorate([p.property({type:Number,json:{write:!0}})],q.prototype,
"compressionQuality",void 0);a.__decorate([p.property({type:Number,json:{write:!0}})],q.prototype,"dpi",void 0);a.__decorate([p.property({type:String,json:{read:b.read,write:b.write,origins:{"web-scene":{read:!1,write:!1}}}})],q.prototype,"format",void 0);a.__decorate([p.property({readOnly:!0})],q.prototype,"isWrappable",null);a.__decorate([p.property({type:d,json:{write:!0}})],q.prototype,"origin",void 0);a.__decorate([c.reader("origin")],q.prototype,"readOrigin",null);a.__decorate([p.property({type:[r],
value:null,json:{write:!0}})],q.prototype,"lods",null);a.__decorate([p.property({readOnly:!0})],q.prototype,"scales",void 0);a.__decorate([p.property({cast:x=>Array.isArray(x)?x:"number"===typeof x?[x,x]:[256,256]})],q.prototype,"size",void 0);a.__decorate([c.reader("size",["rows","cols"])],q.prototype,"readSize",null);a.__decorate([g.writer("size",{cols:{type:k.Integer},rows:{type:k.Integer}})],q.prototype,"writeSize",null);a.__decorate([p.property({type:t,json:{write:!0}})],q.prototype,"spatialReference",
void 0);q=u=a.__decorate([e.subclass("esri.layers.support.TileInfo")],q);(function(x){x=x.ExtrapolateOptions||(x.ExtrapolateOptions={});x[x.NONE=0]="NONE";x[x.POWER_OF_TWO=1]="POWER_OF_TWO"})(q||={});return q})},"esri/layers/support/TileKey":function(){define(["exports"],function(a){class b{constructor(q,l,p,k,h){this.id=q;this.level=l;this.row=p;this.col=k;this.extent=h}}a.TileKey=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/PopupView":function(){define("require exports ../chunks/tslib.es6 ../core/asyncUtils ../core/deprecate ../core/Error ../core/has ../core/Logger ../core/promiseUtils ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./input/InputManager".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(u){return null!=u&&"open"in u&&"declaredClass"in u}function m(u){return null!=u&&"declaredClass"in u&&"dockOptions"in u}const r=u=>Object.freeze(Object.defineProperty({__proto__:null,default:u},Symbol.toStringTag,{value:"Module"}));class n{constructor(u){this.layerView=u;this._resolver=c.createResolver();this.graphics=[]}get promise(){return this._resolver.promise}resolve(u){const {layerView:x,graphics:y,_resolver:z}=this;if(!x)return z.resolve(y),
z.promise;let A;x.fetchPopupFeaturesFromGraphics(y,u).catch(B=>{A=B;return null}).then(B=>{B?z.resolve(B):z.reject(A)});return z.promise}}b.PopupView=u=>{u=class extends u{constructor(){super(...arguments);this._popupSetupTask=null;this.popup={};this.popupEnabled=!0}initialize(){this.addHandles([e.watch(()=>[this.ui,this.popup],([x,y],z)=>{if(z){const [A,B]=z;A&&v(B)&&(B.view=null,m(B)&&A.remove(B,"popup"))}x&&v(y)&&(y.view=this,m(y)&&x.add(y,{key:"popup",position:"manual",internal:!0}))},e.initial),
this.on("click",x=>{this.popup&&this.popupEnabled&&("mouse"!==x.pointerType||0===x.button)&&(v(this.popup)?this.popup.viewModel.handleViewClick(x):x.async(async()=>{await this.setupPopup();v(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(x)}))},w.ViewEventPriorities.WIDGET)]);e.whenOnce(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{new Promise((x,y)=>a(["../widgets/Popup"],z=>x(r(z)),y))})}destroy(){this.destroyed||this.closePopup()}async openPopup(x){if(v(this.popup))return this.popup.open(x);
try{await this.setupPopup(),this.popup?this.popup.open(x):f.getLogger(this).error(new k("view:null-popup","Popup is null and can't be opened"))}catch{}}closePopup(){this._popupSetupTask?.abort();v(this.popup)&&this.popup.close()}async fetchPopupFeatures(x,y){await this.when();return this._popupHitsToFeatures(await this._getPopupHits(x,y),y)}async setupPopup(){this._popupSetupTask?.abort();if(this.popup&&!v(this.popup))return this._popupSetupTask=l.createTask(async x=>{const {default:y}=await new Promise((z,
A)=>a(["../widgets/Popup"],B=>z(r(B)),A));c.throwIfAborted(x);this.popup&&!v(this.popup)&&(x=this.popup,delete x.open,delete x.close,this.popup=new y(x))}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:x,hits:y},z){const A=[],B=[];let C=!1;const D=c.wrapAbortWithTimeout(z,h("popup-view-fetch-timeout")??5E3);z=F=>{const H=B.at(-1);H&&H.layerView===F&&!C?F=H:(F=new n(F),B.push(F),A.push(F.promise));return F};for(const F of y)"graphic"in F?(z(F.layerView).graphics.push(F.graphic),
C=!1):(A.push(F.layerView.fetchPopupFeaturesAtLocation(F.mapPoint,D)),C=!0);B.map(F=>F.resolve(D));y=c.allSettledValues(A).then(F=>F.filter(H=>!!H).flat());return{pendingFeatures:A,allGraphicsPromise:y,location:x}}async _getPopupHits(x,y){const {hits:z,location:A}=await this.popupHitTest(x);c.throwIfAborted(y);x=[];for(const B of z)if("graphic"in B){if(this._isValidPopupGraphic(B.graphic,y)){const C=this._isValidPopupGraphicsLayerView(B.layerView)?B.layerView:void 0;x.push({graphic:B.graphic,layerView:C})}}else this._isValidPopupLocationLayerView(B.layerView)&&
x.push({mapPoint:B.mapPoint,layerView:B.layerView});return{hits:x,location:A}}_isValidPopupGraphic(x,y){return x&&!!x.getEffectivePopupTemplate(y?.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(x){return!x||(!("layer"in x)||!x.suspended)&&"fetchPopupFeaturesFromGraphics"in x}_isValidPopupLocationLayerView(x){return(!("layer"in x)||!x.suspended)&&"fetchPopupFeaturesAtLocation"in x}};q.__decorate([g.property({cast(x){if(!x||v(x))return x;"object"===typeof x&&(x.open=y=>{p.deprecated(f.getLogger(this),
"view.popup is no longer created by default. view.popup.open() will stop working when the popup isn't created",{replacement:"Use view.openPopup() instead.",version:"4.27"});return this.openPopup(y)},x.close=()=>{p.deprecated(f.getLogger(this),"view.popup is no longer created by default. view.popup.close() will stop working when the popup isn't created",{replacement:"Use view.closePopup() instead.",version:"4.27"});return this.closePopup()});return x}})],u.prototype,"popup",void 0);q.__decorate([g.property()],
u.prototype,"popupEnabled",void 0);return u=q.__decorate([t.subclass("esri.views.PopupView")],u)};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layerViewModuleImportUtils":function(){define(["require","exports","../../core/Error"],function(a,b,q){const l=f=>Object.freeze(Object.defineProperty({__proto__:null,default:f},Symbol.toStringTag,{value:"Module"})),p=()=>new Promise((f,c)=>a(["./layers/TileLayerView3D"],e=>f(l(e)),c)),k=()=>new Promise((f,c)=>a(["./layers/ElevationLayerView3D"],
e=>f(l(e)),c)),h={"base-dynamic":()=>new Promise((f,c)=>a(["./layers/BaseDynamicLayerView3D"],e=>f(l(e)),c)),"base-elevation":k,"base-tile":p,"bing-maps":p,"building-scene":()=>new Promise((f,c)=>a(["./layers/BuildingSceneLayerView3D"],e=>f(l(e)),c)),catalog:()=>new Promise((f,c)=>a(["./layers/CatalogLayerView3D"],e=>f(l(e)),c)),"catalog-dynamic-group":()=>new Promise((f,c)=>a(["./layers/CatalogDynamicGroupLayerView3D"],e=>f(l(e)),c)),"catalog-footprint":()=>new Promise((f,c)=>a(["./layers/CatalogFootprintLayerView3D"],
e=>f(l(e)),c)),csv:()=>new Promise((f,c)=>a(["./layers/CSVLayerView3D"],e=>f(l(e)),c)),dimension:()=>new Promise((f,c)=>a(["./layers/DimensionLayerView3D"],e=>f(l(e)),c)),elevation:k,feature:()=>new Promise((f,c)=>a(["./layers/FeatureLayerView3D"],e=>f(l(e)),c)),geojson:()=>new Promise((f,c)=>a(["./layers/GeoJSONLayerView3D"],e=>f(l(e)),c)),graphics:()=>new Promise((f,c)=>a(["./layers/GraphicsLayerView3D"],e=>f(l(e)),c)),group:()=>new Promise((f,c)=>a(["../layers/GroupLayerView"],e=>f(l(e)),c)),imagery:()=>
new Promise((f,c)=>a(["./layers/ImageryLayerView3D"],e=>f(l(e)),c)),"integrated-mesh":()=>new Promise((f,c)=>a(["./layers/IntegratedMeshLayerView3D"],e=>f(l(e)),c)),"integrated-mesh-3dtiles":()=>new Promise((f,c)=>a(["./layers/IntegratedMesh3DTilesLayerView3D"],e=>f(l(e)),c)),"line-of-sight":()=>new Promise((f,c)=>a(["./layers/LineOfSightLayerView3D"],e=>f(l(e)),c)),"map-image":()=>new Promise((f,c)=>a(["./layers/MapImageLayerView3D"],e=>f(l(e)),c)),media:()=>new Promise((f,c)=>a(["./layers/MediaLayerView3D"],
e=>f(l(e)),c)),"ogc-feature":()=>new Promise((f,c)=>a(["./layers/OGCFeatureLayerView3D"],e=>f(l(e)),c)),"open-street-map":p,"oriented-imagery":()=>new Promise((f,c)=>a(["./layers/FeatureLayerView3D"],e=>f(l(e)),c)),"point-cloud":()=>new Promise((f,c)=>a(["./layers/PointCloudLayerView3D"],e=>f(l(e)),c)),voxel:()=>new Promise((f,c)=>a(["./layers/VoxelLayerView3D"],e=>f(l(e)),c)),route:()=>new Promise((f,c)=>a(["./layers/RouteLayerView3D"],e=>f(l(e)),c)),scene:f=>null==f.profile||"mesh-pyramids"===f.profile?
new Promise((c,e)=>a(["./layers/SceneLayerView3D"],g=>c(l(g)),e)):new Promise((c,e)=>a(["./layers/SceneLayerGraphicsView3D"],g=>c(l(g)),e)),stream:()=>new Promise((f,c)=>a(["./layers/StreamLayerView3D"],e=>f(l(e)),c)),tile:p,"imagery-tile":()=>new Promise((f,c)=>a(["./layers/ImageryTileLayerView3D"],e=>f(l(e)),c)),"vector-tile":()=>new Promise((f,c)=>a(["./layers/VectorTileLayerView3D"],e=>f(l(e)),c)),wcs:()=>new Promise((f,c)=>a(["./layers/ImageryTileLayerView3D"],e=>f(l(e)),c)),"web-tile":p,wfs:()=>
new Promise((f,c)=>a(["./layers/WFSLayerView3D"],e=>f(l(e)),c)),wms:()=>new Promise((f,c)=>a(["./layers/WMSLayerView3D"],e=>f(l(e)),c)),wmts:()=>new Promise((f,c)=>a(["./layers/WMTSLayerView3D"],e=>f(l(e)),c)),"geo-rss":null,kml:null,"knowledge-graph":null,"link-chart":null,"knowledge-graph-sublayer":null,"map-notes":null,"subtype-group":null,unknown:null,unsupported:null,video:null};b.layerView3DImporter={hasLayerViewModule:f=>null!=h[f.type],importLayerView:f=>{var c=h[f.type];if(null==c)throw f=
f.declaredClass?f.declaredClass.slice(f.declaredClass.lastIndexOf(".")+1):"Unknown",c=f.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),new q(`${c}:view-not-supported`,`${f} is not supported in 3D`);return c(f)}};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/analysis/AnalysisViewManager3D":function(){define("require ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/asyncUtils ../../../core/Collection ../../../core/Error ../../../core/handleUtils ../../../core/has ../../../core/Logger ../../../core/maybe ../../../core/promiseUtils ../../../core/scheduling ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(){const u=g.createResolver();u.promise.catch(()=>{});return u}const m=u=>Object.freeze(Object.defineProperty({__proto__:null,default:u},Symbol.toStringTag,{value:"Module"}));var r;(function(u){u[u.PENDING=0]="PENDING";u[u.CREATED=1]="CREATED"})(r||={});var n;(function(u){u[u.ADDED=0]="ADDED";u[u.REMOVED=1]="REMOVED"})(n||={});q=class extends q{constructor(u){super(u);this._allAnalysisViews=new p;this._creatingViewCount=0;this._items=new Map;this._scheduledUpdateHandle=
null;this._attachedToViewResolver=v();this._analysisModules={"area-measurement":{module:null},dimension:{module:null},"direct-line-measurement":{module:null},"line-of-sight":{module:null},slice:{module:null},viewshed:{module:null}}}destroy(){this._disconnectOwners();this._attachedToViewResolver.reject(g.createAbortError("AnalysisViewManager was destroyed"))}attach(){this._connectOwners();this._attachedToViewResolver.resolve()}detach(){this._disconnectOwners();this._attachedToViewResolver.reject(g.createAbortError());
this._attachedToViewResolver=v()}get updating(){return!this.view.ready||0!==this._creatingViewCount||this._allAnalysisViews.some(u=>u.updating)}get testInfo(){}async whenAnalysisView(u){await this._attachedToViewResolver.promise;const x=this._items.get(u);if(null==x||x.state.list===n.REMOVED)throw new k("AnalysisViewManager:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:u});return x.createAnalysisViewTask.promise}_connectOwners(){this.addHandles(this._connectAnalysesCollection(this.view.analyses),
"analyses-owner-handles")}_disconnectOwners(){this.removeHandles("analyses-owner-handles");this._update();this._creatingViewCount=0}_connectAnalysesCollection(u){for(const z of u)this._addAnalysis(z);const x=u.on("after-add",z=>this._addAnalysis(z.item)),y=u.on("after-remove",z=>this._removeAnalysis(z.item));return h.makeHandle(()=>{x.remove();y.remove();for(const z of u)this._removeAnalysis(z)})}_addAnalysis(u){const x=this._items.get(u);if(null==x){const y={state:{view:r.PENDING,list:n.ADDED},analysis:u,
view:null,createAnalysisViewTask:null};this._items.set(u,y);y.createAnalysisViewTask=l.createTask(z=>this._createAnalysisViewPromise(y,z))}else x.state.list=n.ADDED}_removeAnalysis(u){u=this._items.get(u);null==u?c.getLogger(this).error("Trying to remove analysis which was not added"):(u.state.list=n.REMOVED,this._scheduleUpdate())}_scheduleUpdate(){null==this._scheduledUpdateHandle&&(this._scheduledUpdateHandle=d.schedule(()=>this._update()))}_update(){this._scheduledUpdateHandle=e.removeMaybe(this._scheduledUpdateHandle);
this._items.forEach(u=>{if(u.state.list===n.REMOVED)switch(this._items.delete(u.analysis),u.state.view){case r.PENDING:u.createAnalysisViewTask=e.abortMaybe(u.createAnalysisViewTask);break;case r.CREATED:null!=u.view&&(this._allAnalysisViews.remove(u.view),u.view=e.destroyMaybe(u.view),u.createAnalysisViewTask=null)}})}async _createAnalysisViewPromise(u,x){var y=u.analysis;const z=y.type,A=this._analysisModules[z];this._creatingViewCount+=1;if(null==A.module)try{A.module=await this._loadAnalysisModule(z)}catch(B){throw--this._creatingViewCount,
B;}if(g.isAborted(x))throw--this._creatingViewCount,g.createAbortError("AnalysisView creation aborted");y=new A.module.default({analysis:y,view:this.view});try{await y.when()}catch(B){throw--this._creatingViewCount,B;}if(g.isAborted(x))throw--this._creatingViewCount,y.destroy(),g.createAbortError("AnalysisView creation aborted");u.view=y;u.state.view=r.CREATED;this._allAnalysisViews.add(y);--this._creatingViewCount;return y}_loadAnalysisModule(u){switch(u){case "area-measurement":return new Promise((x,
y)=>a(["./AreaMeasurementAnalysisView3D"],z=>x(m(z)),y));case "dimension":return new Promise((x,y)=>a(["./DimensionAnalysisView3D"],z=>x(m(z)),y));case "direct-line-measurement":return new Promise((x,y)=>a(["./DirectLineMeasurementAnalysisView3D"],z=>x(m(z)),y));case "line-of-sight":return new Promise((x,y)=>a(["./LineOfSightAnalysisView3D"],z=>x(m(z)),y));case "slice":return new Promise((x,y)=>a(["./SliceAnalysisView3D"],z=>x(m(z)),y));case "viewshed":return new Promise((x,y)=>a(["./ViewshedAnalysisView3D"],
z=>x(m(z)),y))}}};b.__decorate([t.property()],q.prototype,"updating",null);b.__decorate([t.property({constructOnly:!0})],q.prototype,"view",void 0);b.__decorate([t.property()],q.prototype,"_allAnalysisViews",void 0);b.__decorate([t.property()],q.prototype,"_creatingViewCount",void 0);return q=b.__decorate([w.subclass("esri.views.3d.analysis.AnalysisViewManager3D")],q)})},"esri/views/3d/constraints/Constraints":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Clonable ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./AltitudeConstraint ./ClipDistanceConstraint ./TiltConstraint".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){a.Constraints=class extends q.Clonable{constructor(){super(...arguments);this.tilt=new g.TiltConstraint;this.altitude=new c.AltitudeConstraint;this.clipDistance=new e.ClipDistanceConstraint}};b.__decorate([l.property({type:g.TiltConstraint})],a.Constraints.prototype,"tilt",void 0);b.__decorate([l.property({type:c.AltitudeConstraint})],a.Constraints.prototype,"altitude",void 0);b.__decorate([l.property({type:e.ClipDistanceConstraint})],a.Constraints.prototype,"clipDistance",
void 0);a.Constraints=b.__decorate([f.subclass("esri.views.3d.constraints.Constraints")],a.Constraints);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/constraints/AltitudeConstraint":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Clonable ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../state/Constraints".split(" "),function(a,b,q,
l,p,k,h,f,c){a.AltitudeConstraint=class extends q.Clonable{constructor(){super(...arguments);this.min=c.earthAltitudeConstraint.min;this.max=c.earthAltitudeConstraint.max}};b.__decorate([l.property({type:Number})],a.AltitudeConstraint.prototype,"min",void 0);b.__decorate([l.property({type:Number})],a.AltitudeConstraint.prototype,"max",void 0);a.AltitudeConstraint=b.__decorate([f.subclass("esri.views.3d.constraints.AltitudeConstraint")],a.AltitudeConstraint);Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/state/Constraints":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Logger ../../../core/mathUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/support/Ellipsoid ../../ViewingMode ../support/mathUtils".split(" "),function(a,b,q,l,p,k,h,f,c,e,g,d){a.Constraints=class extends q{constructor(m){super(m);this.collision=
new v;this.distance=Infinity;this.minimumPoiDistance=4;this.tilt=null}get altitude(){return this.mode===g.ViewingMode.Local?null:this._get("altitude")||null}set altitude(m){this.mode===g.ViewingMode.Local?l.getLogger(this).warn("Altitude constraint is ignored in local scenes"):this._set("altitude",m)}clampAltitude(m){return this.altitude?p.clamp(m,this.altitude.min,this.altitude.max):m}clampTilt(m,r){if(!this.tilt)return r;m=this.tilt(m);return p.clamp(r,m.min,m.max)}clampDistance(m){return Math.min(m,
this.distance)}createDefaultTilt(){return this.mode===g.ViewingMode.Local?this._createDefaultTiltLocal():this._createDefaultTiltGlobal()}createConstantMaxTilt(m){return(r,n=w)=>{n.min=t.min;n.max=m;return n}}_createDefaultTiltLocal(){const m=this.collision.enabled?d.makePiecewiseLinearFunction([[4E3,t.max],[1E4,p.deg2rad(88)],[6E6,p.deg2rad(88)]]):()=>t.max;return(r,n=w)=>{n.min=t.min;n.max=m(r);return n}}_createDefaultTiltGlobal(){const m=this.collision.enabled?d.makePiecewiseLinearFunction([[4E3,
t.max],[5E4,p.deg2rad(88)],[6E6,p.deg2rad(88)],[2E7,t.min]]):d.makePiecewiseLinearFunction([[3E5,t.max],[3E6,p.deg2rad(88)],[6E6,p.deg2rad(88)],[2E7,t.min]]);return(r,n=w)=>{n.min=t.min;n.max=m(r);return n}}};b.__decorate([k.property()],a.Constraints.prototype,"altitude",null);b.__decorate([k.property({readOnly:!0})],a.Constraints.prototype,"collision",void 0);b.__decorate([k.property()],a.Constraints.prototype,"distance",void 0);b.__decorate([k.property({readOnly:!0})],a.Constraints.prototype,"minimumPoiDistance",
void 0);b.__decorate([k.property()],a.Constraints.prototype,"tilt",void 0);b.__decorate([k.property({constructOnly:!0})],a.Constraints.prototype,"mode",void 0);a.Constraints=b.__decorate([c.subclass("esri.views.3d.state.Constraints")],a.Constraints);h={min:-2E5,max:4*e.earth.radius};const t={min:p.deg2rad(.5),max:p.deg2rad(179.5)},w={min:0,max:0};let v=class extends q{constructor(){super(...arguments);this.enabled=!0;this.elevationMargin=5}};b.__decorate([k.property({type:Boolean})],v.prototype,"enabled",
void 0);b.__decorate([k.property({type:Number})],v.prototype,"elevationMargin",void 0);v=b.__decorate([c.subclass("esri.views.3d.state.Constraints.CollisionConstraint")],v);a.TiltRange=t;a.earthAltitudeConstraint=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/constraints/ClipDistanceConstraint":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Clonable ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/cast ../../../core/RandomLCG ../../../core/has ../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){a.ClipDistanceConstraint=class extends q.Clonable{constructor(){super(...arguments);this.mode="auto"}get near(){return this._get("near")}set near(c){this._set("near",c);c>=this._get("far")&&(this.far=c+1E-9);this.mode="manual"}castNear(c){return Math.max(1E-8,c)}get far(){return this._get("far")}set far(c){this._set("far",c);c<=this._get("near")&&(this.near=c-1E-9);this.mode="manual"}castFar(c){return Math.max(1E-8,c)}autoUpdate(c,e){"auto"===this.mode&&(this._get("near")!==
c&&this._set("near",c),this._get("far")!==e&&this._set("far",e))}};b.__decorate([l.property({type:Number,value:1E-8})],a.ClipDistanceConstraint.prototype,"near",null);b.__decorate([p.cast("near")],a.ClipDistanceConstraint.prototype,"castNear",null);b.__decorate([l.property({type:Number,value:1E-8})],a.ClipDistanceConstraint.prototype,"far",null);b.__decorate([p.cast("far")],a.ClipDistanceConstraint.prototype,"castFar",null);b.__decorate([l.property({type:["auto","manual"]})],a.ClipDistanceConstraint.prototype,
"mode",void 0);a.ClipDistanceConstraint=b.__decorate([f.subclass("esri.views.3d.constraints.ClipDistanceConstraint")],a.ClipDistanceConstraint);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/constraints/TiltConstraint":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Clonable ../../../core/mathUtils ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/cast ../../../core/RandomLCG ../../../core/has ../../../core/accessorSupport/decorators/subclass ../state/Constraints".split(" "),
function(a,b,q,l,p,k,h,f,c,e){var g=l.rad2deg(e.TiltRange.min),d=l.rad2deg(e.TiltRange.max);a.TiltConstraint=class extends q.Clonable{constructor(t){super(t);this.mode="auto"}get max(){return this._get("max")}set max(t){this._set("max",t);this.mode="manual"}castMax(t){return l.clamp(t,g,d)}autoUpdate(t){"auto"===this.mode&&this._get("max")!==t&&this._set("max",t)}};b.__decorate([p.property({type:["auto","manual"]})],a.TiltConstraint.prototype,"mode",void 0);b.__decorate([p.property({type:Number,value:d})],
a.TiltConstraint.prototype,"max",null);b.__decorate([k.cast("max")],a.TiltConstraint.prototype,"castMax",null);a.TiltConstraint=b.__decorate([c.subclass("esri.views.3d.constraints.TiltConstraint")],a.TiltConstraint);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/SceneViewEnvironment":function(){define("../../../chunks/tslib.es6 ../../../core/compilerUtils ../../../core/handleUtils ../../../core/lang ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/cast ../../../core/accessorSupport/decorators/subclass ../../../core/accessorSupport/ensureType ./lightingUtils ./SceneViewAtmosphere ./SunLighting ./VirtualLighting ../../../webscene/Environment ../../../webscene/SunLighting ../../../webscene/VirtualLighting".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){var m;t=m=class extends t{constructor(r){super(r);this.atmosphere=new e.SceneViewAtmosphere;this.lighting=this.castLighting();this.cachedCameraTrackingEnabled=null}destroy(){this.atmosphere.destroy()}static fromWebsceneEnvironment(r){r=r.cloneConstructProperties();return new m({...r,lighting:r.lighting?"virtual"===r.lighting.type?d.fromWebsceneLighting(r.lighting):g.fromWebsceneLighting(r.lighting):void 0})}castLighting(r){return this._convertLightingWithDestroy(r)}applyLighting(r){this.lighting=
this._convertLightingWithDestroy(r)}_convertLightingWithDestroy(r){const n=this._convertLighting(r);n!==r&&this.addHandles(q.destroyHandle(n));return n}_convertLighting(r){return r?r instanceof g||r instanceof d?r:r instanceof w?this.lighting&&"virtual"!==this.lighting.type?this.lighting.cloneWithWebsceneLighting(r):new g({...r.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):r instanceof v?this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(r):
new d({...r.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):f.ensureOneOfType(c.lightingTypes,r):new g}clone(){return new m({lighting:this.lighting.clone(),atmosphere:this.atmosphere.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:l.clone(this.background)})}cloneWithWebsceneEnvironment(r){return new m({atmosphere:this.atmosphere.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,
starsEnabled:this.starsEnabled,background:l.clone(this.background),...r.cloneConstructProperties(),lighting:this._getLighting(r)})}_getLighting(r){switch(r.lighting.type){case "sun":return this.lighting&&"sun"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(r.lighting):g.fromWebsceneLighting(r.lighting);case "virtual":return this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(r.lighting):d.fromWebsceneLighting(r.lighting);default:return b.neverReached(r.lighting),
g.fromWebsceneLighting(r.lighting)}}};a.__decorate([p.property({type:e.SceneViewAtmosphere,json:{read:!1},nonNullable:!0})],t.prototype,"atmosphere",void 0);a.__decorate([p.property({nonNullable:!0})],t.prototype,"lighting",void 0);a.__decorate([k.cast("lighting")],t.prototype,"castLighting",null);return t=m=a.__decorate([h.subclass("esri.views.3d.environment.SceneViewEnvironment")],t)})},"esri/views/3d/environment/lightingUtils":function(){define(["exports","./SunLighting","./VirtualLighting"],function(a,
b,q){a.lightingTypes={key:"type",defaultKeyValue:"sun",base:null,typeMap:{sun:b,virtual:q}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/SunLighting":function(){define("../../../chunks/tslib.es6 ../../../core/Evented ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../webscene/SunLighting".split(" "),function(a,b,q,l,p,k,h,f){var c;b=
c=class extends b.EventedMixin(f){constructor(g){super(g);this.cameraTrackingEnabled=!0;this.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0};g=(new Date).getFullYear();g=new Date("March 15, "+g+" 12:00:00 UTC");this._set("defaultDate",g);this._set("date",g)}get defaultDate(){return new Date(this._get("defaultDate").getTime())}static fromWebsceneLighting(g){return new c(g.cloneConstructProperties())}set defaultDate(g){const d=this._get("date")===this._get("defaultDate");g=new Date(g.getTime());
this._set("defaultDate",g);d&&this._set("date",g)}set date(g){null!=g&&(this.positionTimezoneInfo.autoUpdated=!1,this._set("date",new Date(g.getTime())))}autoUpdate(g,d){const t=c.calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=d.hours;this.positionTimezoneInfo.minutes=d.minutes;this.positionTimezoneInfo.seconds=d.seconds;d=null;null!=g&&(this.positionTimezoneInfo.autoUpdated=!0,isNaN(g.getTime())?(d=this.defaultDate.getTime(),this._set("date",this.defaultDate)):
(d=this.date&&this.date.getTime(),this._set("date",new Date(g.getTime()))));const w=c.calculateTimezoneOffset(this.positionTimezoneInfo);t!==w&&(e.target=this,e.timezoneOffset=w,this.emit("timezone-will-change",e),e.target=null);if(null!=g)return isNaN(g.getTime())||d!==g.getTime()}clone(){const g=this._get("date")===this._get("defaultDate"),d=new c({...this.cloneConstructProperties(),defaultDate:this.defaultDate,cameraTrackingEnabled:this.cameraTrackingEnabled});g&&d._set("date",d._get("defaultDate"));
d.positionTimezoneInfo.autoUpdated=this.positionTimezoneInfo.autoUpdated;d.positionTimezoneInfo.hours=this.positionTimezoneInfo.hours;d.positionTimezoneInfo.minutes=this.positionTimezoneInfo.minutes;d.positionTimezoneInfo.seconds=this.positionTimezoneInfo.seconds;return d}cloneWithWebsceneLighting(g){const d=this.clone();null!=g.date&&(d.date=g.date);d.directShadowsEnabled=g.directShadowsEnabled;d.displayUTCOffset=g.displayUTCOffset;return d}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled}}};
a.__decorate([q.property({type:Boolean})],b.prototype,"cameraTrackingEnabled",void 0);a.__decorate([q.property({type:Date})],b.prototype,"defaultDate",null);a.__decorate([q.property({type:Date})],b.prototype,"date",null);b=c=a.__decorate([h.subclass("esri.views.3d.environment.SunLighting")],b);(function(g){g.calculateTimezoneOffset=function({hours:d,minutes:t,seconds:w}){return Math.round(d+t/60+w/3600)}})(b||={});const e={target:null,timezoneOffset:0};return b})},"esri/webscene/SunLighting":function(){define("../chunks/tslib.es6 ../core/JSONSupport ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/reader ../core/accessorSupport/decorators/subclass ../core/accessorSupport/decorators/writer".split(" "),
function(a,b,q,l,p,k,h,f,c){var e;b=e=class extends b.JSONSupport{constructor(g){super(g);this.type="sun";this.date=null;this.directShadowsEnabled=!1;this.displayUTCOffset=null}readDate(g,d){return null!=d.datetime&&new Date(d.datetime)||null}writeDate(g,d,t){d[t]=g.getTime()}readDirectShadowsEnabled(g,d){return!!d.directShadows}writedirectShadowsEnabled(g,d,t){g&&(d[t]=g)}writeDisplayUTCOffset(g,d){null!=g&&(d.displayUTCOffset=g)}clone(){return new e(this.cloneConstructProperties())}cloneConstructProperties(){const g=
{directShadowsEnabled:this.directShadowsEnabled,displayUTCOffset:null!=this.displayUTCOffset?this.displayUTCOffset:null};null!=this.date&&(g.date=new Date(this.date.getTime()));return g}};a.__decorate([q.property({readOnly:!0,type:["sun"],json:{write:!0}})],b.prototype,"type",void 0);a.__decorate([q.property({type:Date,json:{type:Number,write:{target:"datetime"}}})],b.prototype,"date",void 0);a.__decorate([h.reader("date",["datetime"])],b.prototype,"readDate",null);a.__decorate([c.writer("date")],
b.prototype,"writeDate",null);a.__decorate([q.property({type:Boolean,json:{default:!1,write:{target:"directShadows"}}})],b.prototype,"directShadowsEnabled",void 0);a.__decorate([h.reader("directShadowsEnabled",["directShadows"])],b.prototype,"readDirectShadowsEnabled",null);a.__decorate([c.writer("directShadowsEnabled")],b.prototype,"writedirectShadowsEnabled",null);a.__decorate([q.property({type:Number,json:{write:!0}})],b.prototype,"displayUTCOffset",void 0);a.__decorate([c.writer("displayUTCOffset")],
b.prototype,"writeDisplayUTCOffset",null);return b=e=a.__decorate([f.subclass("esri.webscene.SunLighting")],b)})},"esri/views/3d/environment/VirtualLighting":function(){define("../../../chunks/tslib.es6 ../../../core/Evented ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../webscene/VirtualLighting".split(" "),function(a,b,q,l,p,k,h,f){var c;b=c=class extends b.EventedMixin(f){constructor(e){super(e);
this.cameraTrackingEnabled=!0}clone(){return new c({...this.cloneConstructProperties(),cameraTrackingEnabled:this.cameraTrackingEnabled})}static fromWebsceneLighting(e){return new c(e.cloneConstructProperties())}cloneWithWebsceneLighting(e){const g=this.clone();g.directShadowsEnabled=e.directShadowsEnabled;return g}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled}}};a.__decorate([q.property({type:Boolean})],b.prototype,"cameraTrackingEnabled",void 0);
return b=c=a.__decorate([h.subclass("esri.views.3d.environment.VirtualLighting")],b)})},"esri/webscene/VirtualLighting":function(){define("../chunks/tslib.es6 ../core/JSONSupport ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h){var f;b=f=class extends b.JSONSupport{constructor(c){super(c);this.type="virtual";this.directShadowsEnabled=!1}clone(){return new f(this.cloneConstructProperties())}cloneConstructProperties(){return{directShadowsEnabled:this.directShadowsEnabled}}};
a.__decorate([q.property({readOnly:!0,type:["virtual"],json:{write:!0}})],b.prototype,"type",void 0);a.__decorate([q.property({type:Boolean,json:{default:!1,name:"directShadows",write:!0}})],b.prototype,"directShadowsEnabled",void 0);return b=f=a.__decorate([h.subclass("esri.webscene.VirtualLighting")],b)})},"esri/views/3d/environment/SceneViewAtmosphere":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){var c;a.SceneViewAtmosphere=c=class extends q{set quality(e){["low","high"].includes(e)&&this._set("quality",e)}clone(){return new c({quality:this.quality})}};b.__decorate([l.property({type:["low","high"],value:"low"})],a.SceneViewAtmosphere.prototype,"quality",null);a.SceneViewAtmosphere=c=b.__decorate([f.subclass("esri.views.3d.environment.SceneViewAtmosphere")],a.SceneViewAtmosphere);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webscene/Environment":function(){define("../chunks/tslib.es6 ../core/JSONSupport ../core/lang ../core/Logger ../core/accessorSupport/decorators/property ../core/has ../core/accessorSupport/decorators/subclass ../views/3d/environment/SunnyWeather ../views/3d/environment/weather ./lightingTypes ./SunLighting ./VirtualLighting ./background/utils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){var w;k=(v,m,r)=>({enabled:!r?.isPresentation});b=w=class extends b.JSONSupport{constructor(v){super(v);this.lighting=new g;this.background=null;this.starsEnabled=this.atmosphereEnabled=!0}set weather(v){c.validateWeatherType(v?.type,l.getLogger(this))&&this._set("weather",v)}clone(){return new w(this.cloneConstructProperties())}cloneConstructProperties(){return{lighting:this.lighting&&"virtual"===this.lighting.type?d.prototype.clone.call(this.lighting):g.prototype.clone.call(this.lighting),
background:q.clone(this.background),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,weather:this.weather.clone()}}};a.__decorate([p.property({types:e.lightingTypes,nonNullable:!0,json:{write:!0}})],b.prototype,"lighting",void 0);a.__decorate([p.property(t.backgroundProperty)],b.prototype,"background",void 0);a.__decorate([p.property({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:k}}})],b.prototype,"atmosphereEnabled",void 0);a.__decorate([p.property({type:Boolean,
nonNullable:!0,json:{write:{overridePolicy:k}}})],b.prototype,"starsEnabled",void 0);a.__decorate([p.property({types:c.weatherTypes,nonNullable:!0,json:{write:!0},value:new f})],b.prototype,"weather",null);return b=w=a.__decorate([h.subclass("esri.webscene.Environment")],b)})},"esri/views/3d/environment/SunnyWeather":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){var c;b=c=class extends b.JSONSupport{constructor(e){super(e);this.type="sunny";this.cloudCover=.5}clone(){return new c({cloudCover:this.cloudCover})}};a.__decorate([h.enumeration({sunny:"sunny"})],b.prototype,"type",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],b.prototype,"cloudCover",void 0);return b=c=a.__decorate([f.subclass("esri.views.3d.environment.SunnyWeather")],b)})},"esri/views/3d/environment/weather":function(){define("exports ./CloudyWeather ./FoggyWeather ./RainyWeather ./SnowyWeather ./SunnyWeather".split(" "),
function(a,b,q,l,p,k){b={key:"type",base:k,typeMap:{sunny:k,cloudy:b,rainy:l,snowy:p,foggy:q}};const h=Object.keys(b.typeMap);a.cloudsHeight=1E5;a.validateWeatherType=function(f,c){return h.includes(f)?!0:(c.error(`"${f}" is not a valid weather type`),!1)};a.weatherHeightLimit=1E4;a.weatherTypes=b;a.weatherTypesArray=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudyWeather":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){var c;b=c=class extends b.JSONSupport{constructor(e){super(e);this.type="cloudy";this.cloudCover=.5}clone(){return new c({cloudCover:this.cloudCover})}};a.__decorate([h.enumeration({cloudy:"cloudy"})],b.prototype,"type",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],b.prototype,"cloudCover",void 0);return b=c=a.__decorate([f.subclass("esri.views.3d.environment.CloudyWeather")],b)})},"esri/views/3d/environment/FoggyWeather":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){var c;b=c=class extends b.JSONSupport{constructor(e){super(e);this.type="foggy";this.fogStrength=.5}clone(){return new c({fogStrength:this.fogStrength})}};a.__decorate([h.enumeration({foggy:"foggy"})],b.prototype,"type",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],b.prototype,"fogStrength",void 0);return b=c=a.__decorate([f.subclass("esri.views.3d.environment.FoggyWeather")],b)})},"esri/views/3d/environment/RainyWeather":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){var c;b=c=class extends b.JSONSupport{constructor(e){super(e);this.type="rainy";this.precipitation=this.cloudCover=.5}clone(){return new c({cloudCover:this.cloudCover,precipitation:this.precipitation})}};a.__decorate([h.enumeration({rainy:"rainy"})],b.prototype,"type",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],b.prototype,"cloudCover",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,range:{min:0,max:1},
json:{write:!0}})],b.prototype,"precipitation",void 0);return b=c=a.__decorate([f.subclass("esri.views.3d.environment.RainyWeather")],b)})},"esri/views/3d/environment/SnowyWeather":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,
h,f){var c;b=c=class extends b.JSONSupport{constructor(e){super(e);this.type="snowy";this.precipitation=this.cloudCover=.5;this.snowCover="disabled"}clone(){return new c({cloudCover:this.cloudCover,precipitation:this.precipitation,snowCover:this.snowCover})}};a.__decorate([h.enumeration({snowy:"snowy"})],b.prototype,"type",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],b.prototype,"cloudCover",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,
range:{min:0,max:1},json:{write:!0}})],b.prototype,"precipitation",void 0);a.__decorate([q.property({type:["enabled","disabled"],nonNullable:!0,json:{write:!0}})],b.prototype,"snowCover",void 0);return b=c=a.__decorate([f.subclass("esri.views.3d.environment.SnowyWeather")],b)})},"esri/webscene/lightingTypes":function(){define(["exports","./SunLighting","./VirtualLighting"],function(a,b,q){a.lightingTypes={key:"type",defaultKeyValue:"sun",base:null,typeMap:{sun:b,virtual:q}};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/webscene/background/utils":function(){define(["exports","./Background","./ColorBackground"],function(a,b,q){b={base:b,key:"type",typeMap:{color:q}};b={types:b,json:{read:function(l){return(p,k,h)=>{if(!p)return p;for(const f in l.typeMap)if(p.type===f)return k=new l.typeMap[f],k.read(p,h),k}}(b),write:{overridePolicy:(l,p,k)=>({enabled:!k?.isPresentation})}}};a.backgroundProperty=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webscene/background/Background":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h){b=class extends b.JSONSupport{constructor(f){super(f)}clone(){throw Error("Subclasses of Background should implement their own clone method.");}};a.__decorate([q.property({readOnly:!0,json:{read:!1}})],b.prototype,"type",void 0);return b=a.__decorate([h.subclass("esri.webscene.background.Background")],b)})},"esri/webscene/background/ColorBackground":function(){define("../../chunks/tslib.es6 ../../Color ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/enumeration ../../core/accessorSupport/decorators/subclass ../../symbols/support/materialUtils ./Background".split(" "),
function(a,b,q,l,p,k,h,f,c,e){var g;l={...c.colorAndTransparencyProperty,nonNullable:!0};e=g=class extends e{constructor(d){super(d);this.type="color";this.color=new b([0,0,0,1])}clone(){return new g(this.cloneProperties())}cloneProperties(){return{color:this.color.clone()}}};a.__decorate([h.enumeration({color:"color"},{readOnly:!0})],e.prototype,"type",void 0);a.__decorate([q.property(l)],e.prototype,"color",void 0);return e=g=a.__decorate([f.subclass("esri.webscene.background.ColorBackground")],
e)})},"esri/views/3d/environment/SceneViewEnvironmentManager":function(){define("exports ../../../chunks/tslib.es6 ../../../geometry ../../../core/Evented ../../../core/has ../../../core/maybe ../../../core/promiseUtils ../../../core/quantityUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/projection ../../../geometry/projection/projectPointToVector ../../../geometry/support/spatialReferenceUtils ../../ViewingMode ./EnvironmentRenderer ../support/earthUtils ../support/sunUtils ../webgl-engine/lib/Update ../webgl-engine/lighting/Lightsources ../../support/euclideanLengthMeasurementUtils ../../../geometry/SpatialReference".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D){a.SceneViewEnvironmentManager=class extends l.EventedAccessor{constructor(){super();this._referencePointUpdateDelay=200;this._referencePointUpdateInterval=3E3;this._referencePointUpdateDistThreshold=1E6;this._referencePosMapCoordsRequested=this._referencePosUpdateQuery=null;this._viewHandlesKey="viewHandles";this._referencePosResetPreserveAbsoluteTime=this._trackingEnabled=this._preserveAbsoluteDateTime=!1;this._referencePosMapCoords=this._referencePosUpdateTimer=
null;this._mainLight=new B.MainLight;this._ambientLight=new B.AmbientLight;this._moonLight=new B.FillLight;this._disableWeather=this.disableQueries=!1;this._referencePositionGeographic=this._renderer=null;this._resetReferencePosition()}destroy(){this.disconnectView()}get _view(){return this._renderer?.view}get updating(){return!((this.disableQueries||!this._referencePosUpdateQuery&&!this._referencePosMapCoordsRequested)&&!this._renderer?.updating)}get weatherEnabled(){return this._view?.environment.atmosphereEnabled&&
!this._disableWeather&&this._view?.state?.viewingMode===u.ViewingMode.Global&&n.isEarth(this._view.spatialReference)}get weatherVisible(){return this.weatherEnabled&&this._renderer?.weatherVisible}get referencePositionGeographic(){return this._referencePositionGeographic}connectView(O){if(!this._renderer){this._renderer=new x.EnvironmentRenderer({view:O});var L=()=>this._updateRenderParameters(),P=()=>this._cameraHandler();this.addHandles([c.watch(()=>O.environment.lighting,M=>this._updateLightingHandler(M),
c.sync),c.watch(()=>"virtual"!==O.environment.lighting.type?O.environment.lighting.date:null,M=>this._lightingDateHandler(M),c.sync),c.watch(()=>O.stationary,()=>this._interactingStationaryHandler()),c.watch(()=>O.environment.lighting.directShadowsEnabled,L,c.sync),c.watch(()=>O.qualitySettings.ambientOcclusion,L,c.sync),c.watch(()=>O.qualitySettings.reflections,L,c.sync),c.watch(()=>O.spatialReference,()=>this._resetReferencePosition(!0),c.sync),c.watch(()=>O.environment.weather.type,()=>this._updateLighting(null,
A.Update.Faded),c.sync),c.watch(()=>this.weatherEnabled,()=>this._updateLighting(null,A.Update.Faded),c.sync),c.watch(()=>O.viewingMode,()=>this._resetReferencePosition(!0),c.syncAndInitial),c.watch(()=>"virtual"!==O.environment.lighting.type?O.environment.lighting.cameraTrackingEnabled:!1,M=>this._updateCameraTracking(M),c.syncAndInitial),c.watch(()=>O.state.camera,P,c.syncAndInitial),c.watch(()=>this.disableQueries,P)],this._viewHandlesKey);this._updateRenderParameters();this._updateLighting();
this._cameraHandler();this.notifyChange("updating")}}disconnectView(){this.removeHandles(this._viewHandlesKey);this._resetReferencePosition();this._renderer=k.destroyMaybe(this._renderer)}_updateLightingHandler(O){this._updateCameraTracking("virtual"!==O.type?O.cameraTrackingEnabled:!1);this._lightingDateHandler("virtual"!==O.type?O.date:null);this._updateRenderParameters()}_updateCameraTracking(O){(this._trackingEnabled=O)?this._cameraHandler():(O=this._view.environment.lighting,"virtual"!==O?.type&&
(O.positionTimezoneInfo.autoUpdated=!1))}_lightingDateHandler(O){const L=this._view.environment.lighting;if("virtual"===L?.type)this._updateLighting();else if(O){if(!L.positionTimezoneInfo.autoUpdated){this._preserveAbsoluteDateTime=!0;if(!m.canProjectWithoutEngine(this._view.spatialReference,D.WGS84)){var P=this._view.camera.position;if(!this._referencePosMapCoords||!this._referencePosMapCoords.equals(P)){this._requestReferencePositionUpdate(P);return}}this._preupdateTracking(O);null!=this._referencePositionGeographic&&
(P=y.positionToTimezoneInfo(this._referencePositionGeographic,E),null!=P&&(L.autoUpdate(null,P),this._trackingEnabled&&(L.positionTimezoneInfo.autoUpdated=!0)))}this._updateLighting(O)}}_preupdateTracking(O){!this._trackingEnabled&&"virtual"!==this._view.environment.lighting.type&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(O)}_cameraHandler(O=null){var L=this._view;L.ready&&(L=L.stateManager.camera)&&(this._cameraHandlerClientSide(L,O)||this._cameraHandlerServerSide(L))}_cameraHandlerClientSide(O,
L){const P=n.isEarth(this._view.spatialReference);if(P&&!m.canProjectWithoutEngine(this._view.spatialReference,D.WGS84))return"virtual"===this._view.environment.lighting.type&&this._updateLighting(),!1;O=O.position;this._referencePositionGeographic??(this._referencePositionGeographic=v.create());P?r.projectPointToVector(O,this._referencePositionGeographic,D.WGS84):w.set(this._referencePositionGeographic,O.longitude??0,O.latitude??0,O.z??0);this.notifyChange("referencePositionGeographic");this._autoUpdateTimezone(this._referencePositionGeographic,
L)||this._updateLighting(L);return!0}_cameraHandlerServerSide(O){O=O.position;(!this._referencePosMapCoords||this._referencePosMapCoordsRequested||this._exceedsReferencePosDistThreshold(O))&&this._requestReferencePositionUpdate(O,!0);this._view.mapCoordsHelper&&this._referencePositionGeographic&&(this._referencePositionGeographic[2]=(O.z??0)*this._view.mapCoordsHelper.unitInMeters,this._referencePosChanged())}_interactingStationaryHandler(){this._view.stationary&&this._executePendingReferencePositionUpdate()}_updateLighting(O,
L=A.Update.Immediate){var P=this._view;O=O||("virtual"===P.environment.lighting.type?null:P.environment.lighting.date);var M=this._referencePositionGeographic;const K=M?F:H;var J=this.weatherVisible?P.environment.weather.type:"disabled";null!=M?z.computeColorAndIntensity(O,M,P.state.viewingMode,J,P.state.camera,K):"virtual"===P.environment.lighting.type&&z.computeVirtualLightDirection(P.state.camera,P.state.viewingMode,K.direct.directionToLightSource);O=this._mainLight;P=K.direct;w.scale(O.intensity,
P.color,P.intensity*Math.PI);w.copy(O.direction,P.directionToLightSource);O.specularStrength=K.specularStrength;O.environmentStrength=K.environmentStrength;M=this._ambientLight;w.scale(M.intensity,K.ambient.color,K.ambient.intensity);J=this._moonLight;w.lerp(J.intensity,G,I,K.globalFactor);w.scale(J.intensity,J.intensity,(1-.5*K.globalFactor)*(1-.4*K.noonFactor*(1-K.globalFactor)));w.copy(J.direction,P.directionToLightSource);this._renderer.updateLightSources([O,M,J],K.noonFactor,K.globalFactor,L);
this._updateRenderParameters()}_autoUpdateTimezone(O,L=null){if("virtual"===this._view.environment.lighting.type||!this._view.environment.lighting.cameraTrackingEnabled||null==O)return!1;const P=N;P.setTime((L||this._view.environment.lighting.date).getTime());O=y.positionToTimezoneInfo(O,E);if(null==O)return!1;var M=this._view.environment.lighting.positionTimezoneInfo;if(!M.autoUpdated)M=O;else if(M.hours===O.hours&&M.minutes===O.minutes&&M.seconds===O.seconds)return!1;const K=P.getUTCHours()-(O.hours-
M.hours),J=P.getUTCMinutes()-(O.minutes-M.minutes);M=P.getUTCSeconds()-(O.seconds-M.seconds);P.setUTCHours(K);P.setUTCMinutes(J);P.setUTCSeconds(M);return L?!1:this._view.environment.lighting.autoUpdate(P,O)}_updateRenderParameters(){const O=this._view._stage;if(O){var L=null==this._referencePositionGeographic||z.computeShadowsEnabled(this._referencePositionGeographic[2],this._view.state.viewingMode);O.renderer.setParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&L,environment:this._view.environment,
weatherVisible:this._view.environmentManager.weatherVisible,qualitySettings:this._view.qualitySettings})}}_resetReferencePosition(O=!1){this._cancelReferencePosUpdates();this._referencePositionGeographic=this._referencePosResetPreserveAbsoluteTime=this._referencePosMapCoordsRequested=this._referencePosMapCoords=null;this.notifyChange("updating");O&&this._cameraHandler()}_requestReferencePositionUpdate(O,L=!1){if(!this.disableQueries&&(this._referencePosMapCoordsRequested?this._referencePosMapCoordsRequested.copy(O):
this._referencePosMapCoordsRequested=O.clone(),this._referencePosResetPreserveAbsoluteTime=!!L,!this._referencePosUpdateQuery&&!this._referencePosUpdateTimer&&this._view.stationary)){const P=this._referencePosUpdateQuery=h.after(this._referencePointUpdateDelay).then(()=>{if(this._referencePosUpdateQuery===P)return this._doReferencePositionUpdateQuery(()=>this._referencePosUpdateQuery!==P)}).catch(K=>{"mapcoordshelper:missing-geometry-service"===K.name&&(this.disableQueries=!0)}).then(()=>{this._referencePosUpdateQuery===
P&&(this._referencePosUpdateQuery=null,this._referencePosUpdateTimer||this._executePendingReferencePositionUpdate(),this.notifyChange("updating"))}),M=this._referencePosUpdateTimer=h.after(this._referencePointUpdateInterval).then(()=>{this._referencePosUpdateTimer===M&&(this._referencePosUpdateTimer=null,this._referencePosUpdateQuery||this._executePendingReferencePositionUpdate())});this.notifyChange("updating")}}async _doReferencePositionUpdateQuery(O){this._referencePosResetPreserveAbsoluteTime&&
(this._preserveAbsoluteDateTime=!1);this._referencePosMapCoords?this._referencePosMapCoords.copy(this._referencePosMapCoordsRequested):this._referencePosMapCoords=this._referencePosMapCoordsRequested.clone();this._referencePosMapCoordsRequested=this._referencePosResetPreserveAbsoluteTime=null;const L=await this._view.mapCoordsHelper.toGeographic(this._referencePosMapCoords);O()||isNaN(L[0])||isNaN(L[1])||(O=(this._referencePosMapCoords.z??0)*this._view.mapCoordsHelper.unitInMeters,this._referencePositionGeographic?
w.set(this._referencePositionGeographic,L[0],L[1],O):this._referencePositionGeographic=v.fromValues(L[0],L[1],O),this._referencePosChanged())}_executePendingReferencePositionUpdate(){const O=this._referencePosMapCoordsRequested;O&&this._requestReferencePositionUpdate(O,this._referencePosResetPreserveAbsoluteTime)}_referencePosChanged(){this._preserveAbsoluteDateTime?this._updateLighting():this._autoUpdateTimezone(this._referencePositionGeographic)||this._updateLighting();this.notifyChange("referencePositionGeographic")}_exceedsReferencePosDistThreshold(O){const L=
this._referencePosMapCoords;if(null==L)return!0;O=C.euclideanDirectDistanceBetweenPoints(L,O);return null==O?!0:f.toUnit(O,"meters").value>this._referencePointUpdateDistThreshold}_cancelReferencePosUpdates(){const O=!!this._referencePosUpdateQuery;this._referencePosUpdateTimer=this._referencePosUpdateQuery=null;return O}get test(){}};b.__decorate([e.property({type:Boolean,readOnly:!0})],a.SceneViewEnvironmentManager.prototype,"updating",null);b.__decorate([e.property()],a.SceneViewEnvironmentManager.prototype,
"disableQueries",void 0);b.__decorate([e.property()],a.SceneViewEnvironmentManager.prototype,"_disableWeather",void 0);b.__decorate([e.property()],a.SceneViewEnvironmentManager.prototype,"weatherEnabled",null);b.__decorate([e.property()],a.SceneViewEnvironmentManager.prototype,"weatherVisible",null);b.__decorate([e.property()],a.SceneViewEnvironmentManager.prototype,"referencePositionGeographic",null);b.__decorate([e.property()],a.SceneViewEnvironmentManager.prototype,"_renderer",void 0);b.__decorate([e.property()],
a.SceneViewEnvironmentManager.prototype,"_referencePositionGeographic",void 0);a.SceneViewEnvironmentManager=b.__decorate([t.subclass("esri.views.3d.environment.SceneViewEnvironmentManager")],a.SceneViewEnvironmentManager);const F=new z.ColorAndIntensity,H=new z.ColorAndIntensity,N=new Date,E={hours:0,minutes:0,seconds:0},G=v.fromValues(.22,.22,.33),I=v.fromValues(.22,.22,.22);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/quantityUtils":function(){define(["exports","./unitUtils"],
function(a,b){function q(w,v){return{type:b.unitType(v),value:w,unit:v}}function l(w,v){return{type:b.unitType(v),value:w,unit:v}}function p(w,v){return{type:b.unitType(v),value:w,unit:v}}function k(w,v,m="arithmetic"){return{type:b.unitType(v),value:w,unit:v,rotationType:m}}function h(w,v){const m=f(w,v);return"angle"===w.type?k(m,v,w.rotationType):q(m,v)}function f(w,v){return b.convertUnit(w.value,w.unit,v)}const c=l(0,"meters"),e=p(0,"square-meters"),g=k(0,"radians"),d=k(0,"degrees"),t=k(0,"degrees",
"geographic");a.convertRotationType=function(w,v,m){if(v===m)return w;switch(m){case "arithmetic":case "geographic":return-w+90}};a.createAngle=k;a.createArea=p;a.createLength=l;a.createQuantity=q;a.createScalar=function(w){return{value:w}};a.isBaseUnit=function(w){return b.isBaseUnit(w.unit)};a.max=function(w,v){return null==w?v:null==v?w:w.value>b.convertUnit(v.value,v.unit,w.unit)?w:v};a.min=function(w,v){return null==w?v:null==v?w:w.value<b.convertUnit(v.value,v.unit,w.unit)?w:v};a.scale=function(w,
v){return null==w?null:{...w,value:w.value*v}};a.toBaseUnit=function(w){return h(w,b.baseUnitForUnit(w.unit))};a.toUnit=h;a.valueInUnit=f;a.zeroDegrees=d;a.zeroDegreesGeographic=t;a.zeroMeters=c;a.zeroRadians=g;a.zeroSquareMeters=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/EnvironmentRenderer":function(){define("exports ../../../chunks/tslib.es6 ../../../core/has ../../../core/mathUtils ../../../core/maybe ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ../../../geometry/support/spatialReferenceUtils ../../ViewingMode ./AtmosphereType ./ChapmanAtmosphere ./CloudsComposition ./CloudsData ./CloudsGenerator ./CloudsParameters ./CloudsPresets ./Fog ./LocalAtmosphere ./MarsAtmosphere ./Precipitation ./Stars ./weather ../webgl-engine/effects/RenderPlugin ../webgl-engine/lib/RenderSlot ../webgl-engine/lib/Update".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G){a.EnvironmentRenderer=class extends N.SyncRenderPlugin{constructor(P){super(P);this.produces=new Map([[E.RenderSlot.OPAQUE_ENVIRONMENT,()=>!(null===this._atmosphere&&null===this._stars)],[E.RenderSlot.TRANSPARENT_ENVIRONMENT,()=>null!==this._atmosphere]]);this._atmosphere=this._context=null;this._oldWeatherParameters=new I;this._newWeatherParameters=new I;this._fadedWeatherParameters=new I;this._weatherParameters=this._newWeatherParameters}initialize(){this.view._stage.addRenderPlugin(this)}destroy(){this.removeHandles();
this.uninitializeRenderContext();null!=this.view?._stage&&this.view._stage.removeRenderPlugin(this);this._set("view",null)}get atmosphere(){return this._atmosphere}get _atmosphereType(){return null!=this.atmosphere?this.atmosphere.type:m.AtmosphereType.None}consumes(){return this._atmosphereType===m.AtmosphereType.Realistic?N.ConsumesDepth:N.ConsumesNone}updateAnimation(P){return null!=this._precipitation?this._precipitation.update(P):!1}get updating(){return null!=this._stars&&this._stars.updating||
null!=this._clouds&&this._clouds.running}get weatherVisible(){return g.length(this.view.state.camera.eye)-t.getReferenceEllipsoid(this.view.spatialReference).radius<=H.weatherHeightLimit}get usedMemory(){return this._clouds?.usedMemory??0}get _stars(){const P=this.view,M=P.environment?.starsEnabled??!1,K=this._get("_stars");return M&&null!=this._context?null!=K?K:new F.Stars({view:P,requestRender:()=>this._setNeedsRender()}):(p.destroyMaybe(K),null)}get _precipitation(){const P=this._get("_precipitation");
if(!this._precipitationEnabled||null==this._context)return p.destroyMaybe(P),null;const M=this.view,K=this._context;if(null!=P&&P.context===K)return P;p.destroyMaybe(P);return new D.Precipitation({context:K,view:M})}get _clouds(){const P=this._get("_clouds");if(!this.weatherEnabled||null==this._context)return p.destroyMaybe(P),null;if(null!=P)return P;const M=this.view,K=this._context;p.destroyMaybe(P);return new x.CloudsGenerator({context:K,view:M,requestRender:()=>this._setNeedsRender()})}get _cloudsComposition(){const P=
this._get("_cloudsComposition");if(!this.weatherEnabled||null==this._context)return p.destroyMaybe(P),null;const M=this.view.state.viewingMode,K=this._context.renderContext.rctx,J=t.getReferenceEllipsoid(this.view.spatialReference).radius;if(null!=P&&P.viewingMode===M&&P.planetRadius===J)return P;p.destroyMaybe(P);return new n.CloudsComposition({rctx:K,viewingMode:M,planetRadius:J,requestRender:()=>this._setNeedsRender()})}get _fog(){const P=this._get("_fog");return this.weatherEnabled&&null!=this._context?
null!=P?P:new A.Fog({context:this._context,view:this.view,rctx:this._context.renderContext.rctx,viewingMode:this.view.state.viewingMode}):(p.destroyMaybe(P),null)}get weatherEnabled(){return!!this.view?.environmentManager?.weatherEnabled}get _precipitationEnabled(){return this.weatherEnabled&&("rainy"===this.view.environment.weather.type||"snowy"===this.view.environment.weather.type)}initializeRenderContext(P=null){this._context=P;P=()=>this._setNeedsRender();this.addHandles([k.watch(()=>({viewingMode:this.view.state.viewingMode,
enabled:this.view.environment.atmosphereEnabled}),M=>this._updateAtmosphere(M),k.syncAndInitial),k.watch(()=>this._stars,P),k.watch(()=>this._precipitation,P),k.watch(()=>this._clouds,()=>this._updateWeather(),k.initial),k.watch(()=>this._fog,()=>this._updateFogHaze(),k.initial),k.watch(()=>this.view.state.mode,()=>this._setNeedsRender(),k.sync),k.watch(()=>this._weatherUpdateParameters,()=>{this._updateWeather();this._updateFogHaze()},k.syncAndInitial)])}uninitializeRenderContext(){this._context=
null;this._atmosphere=p.destroyMaybe(this._atmosphere);this._set("_stars",p.destroyMaybe(this._stars));this._set("_precipitation",p.destroyMaybe(this._precipitation));this._set("_clouds",p.destroyMaybe(this._clouds));this._set("_cloudsComposition",p.destroyMaybe(this._cloudsComposition));this._set("_fog",p.destroyMaybe(this._fog))}prepareRender(P){P.bindParameters.cloudsFade.data=u.isReadyCloudsData(this._clouds)?this._clouds:null;"local"!==this.view.viewingMode&&null!=P.bindParameters.cloudsFade.data?.cubeMap&&
(this._updateWeatherFading(P.bindParameters,P.time),P.bindParameters.cloudsFade.renderingStage===u.CloudsRenderingStages.FINISHED&&null!=this._clouds&&0===this._clouds.coverage&&!1===this._clouds.running&&(this._clouds.destroyFrameBufferCube(),P.bindParameters.cloudsFade.data=null))}renderNode(P){switch(P.bindParameters.slot){case E.RenderSlot.OPAQUE_ENVIRONMENT:this._stars?.render(P);null!=this.atmosphere&&(this.atmosphere.render(P,this.view?._stage?.renderer?.fullResolutionAtmosphere),this._cloudsComposition&&
null!=P.bindParameters.cloudsFade.data&&(this.weatherVisible&&null!=this._clouds&&this._clouds.updateWeatherTile(),this._cloudsComposition.render(P)),P.bindParameters.cloudsFade.isFading&&this._context&&null!=P.bindParameters.cloudsFade.data?.cubeMap&&this._context.requestRender());break;case E.RenderSlot.TRANSPARENT_ENVIRONMENT:if(null!=this.atmosphere&&(this.atmosphere.renderHaze(P,this._weatherParameters.hazeAmount,this.view?._stage?.renderer?.fullResolutionAtmosphere),0<this._weatherParameters.fog.amount&&
null!=this._fog&&this._fog.render(P,this._weatherParameters.fog),this._precipitation)){const M=this.view.environment.weather;"rainy"!==M.type&&"snowy"!==M.type||this._precipitation.render(P,M.precipitation,M.type)}}}updateLightSources(P,M,K,J){if(null!=this._context){const R=this._context.renderContext;R.bindParameters.oldLighting.copyFrom(R.bindParameters.lighting);R.bindParameters.newLighting.noonFactor=M;R.bindParameters.newLighting.globalFactor=K;R.bindParameters.newLighting.set(P);J===G.Update.Faded||
R.bindParameters.weatherFading?R.bindParameters.fadeLighting(0):R.bindParameters.fadeLighting(1);this._context.requestRender()}}get _weatherUpdateParameters(){const P=this.weatherEnabled?this.view.environment.weather:null;return null==P?null:"rainy"===P.type||"snowy"===P.type?{type:P.type,weatherAdjustment:P.cloudCover,effect:P.precipitation}:{type:P.type,weatherAdjustment:"foggy"===P.type?P.fogStrength:P.cloudCover}}_updateWeatherFading(P,M){P.cloudsFade.updateFading(P.camera,this.view.state.mode,
M,this.view.qualitySettings.fadeDuration);P.cloudsFade.updateParallax(P.camera);P.weatherFading&&(P.cloudsFade.fadeMode===y.FadeMode.CROSS_FADE||P.cloudsFade.fadeMode===y.FadeMode.FADE_IN?P.fadeLighting(P.cloudsFade.fadeFactor):P.fadeLighting(0),this._updateFogAtmoshpere(P))}_updateFogAtmoshpere(P){P.cloudsFade.fadeMode===y.FadeMode.CROSS_FADE||P.cloudsFade.fadeMode===y.FadeMode.FADE_IN?this._fadeWeather(P.cloudsFade.fadeFactor):this._fadeWeather(0)}_fadeWeather(P){const {_newWeatherParameters:M,
_oldWeatherParameters:K}=this;1<=P?this._weatherParameters=M:(this._fadedWeatherParameters.lerp(K,M,P),this._weatherParameters=this._fadedWeatherParameters)}_updateWeather(){const P=this._weatherUpdateParameters;null!=P&&null!=this._clouds&&(this._clouds.applyPreset(z.cloudPresets[P.type],P.weatherAdjustment),this._setNeedsRender())}_setNeedsRender(){null!=this._context&&this._context.requestRender()}_updateFogHaze(){const P=this._weatherUpdateParameters;if(null!=this._fog&&null!=P&&null!=this._context){var M=
this._context.renderContext.bindParameters;this._oldWeatherParameters.copyFrom(this._weatherParameters);switch(P.type){case "foggy":this._newWeatherParameters.fog.strength=l.lerp(3E-5,.005,P.weatherAdjustment**3);g.copy(this._newWeatherParameters.fog.color,L);this._newWeatherParameters.fog.amount=1;this._newWeatherParameters.hazeAmount=1;this._setNeedsRender();break;case "rainy":this._newWeatherParameters.fog.strength=l.lerp(4E-6,2E-4,(P.effect??0)**3);g.copy(this._newWeatherParameters.fog.color,
O);this._newWeatherParameters.fog.amount=1;this._newWeatherParameters.hazeAmount=0;this._setNeedsRender();break;case "snowy":this._newWeatherParameters.fog.strength=l.lerp(4E-6,2E-4,(P.effect??0)**3);g.copy(this._newWeatherParameters.fog.color,L);this._newWeatherParameters.fog.amount=1;this._newWeatherParameters.hazeAmount=1;this._setNeedsRender();break;default:this._newWeatherParameters.fog.strength=0,this._newWeatherParameters.fog.amount=0,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender()}M.weatherFading?
this._fadeWeather(0):this._fadeWeather(1)}}_updateAtmosphere(P){P=this._selectAtmosphereType(P);if(P===m.AtmosphereType.None||!this._context)this._atmosphere=p.destroyMaybe(this._atmosphere);else if(!this._atmosphere||this._atmosphere.type!==P)if(this._atmosphere=p.destroyMaybe(this._atmosphere),P=this._getAtmosphereClass(P))this._atmosphere=new P(this.view,this._context);this._setNeedsRender()}_getAtmosphereClass(P){switch(P){case m.AtmosphereType.Realistic:return r.ChapmanAtmosphere;case m.AtmosphereType.Local:return B.LocalAtmosphere;
case m.AtmosphereType.Mars:return C;default:case m.AtmosphereType.None:return null}}_selectAtmosphereType(P){const {enabled:M,viewingMode:K}=P;return!M||w.isMoon(this.view.spatialReference)?m.AtmosphereType.None:K===v.ViewingMode.Local?m.AtmosphereType.Local:null!=this._context&&w.isEarth(this.view.spatialReference)?m.AtmosphereType.Realistic:w.isMars(this.view.spatialReference)?m.AtmosphereType.Mars:m.AtmosphereType.None}get test(){}};b.__decorate([h.property({constructOnly:!0})],a.EnvironmentRenderer.prototype,
"view",void 0);b.__decorate([h.property({readOnly:!0})],a.EnvironmentRenderer.prototype,"atmosphere",null);b.__decorate([h.property({readOnly:!0})],a.EnvironmentRenderer.prototype,"_atmosphereType",null);b.__decorate([h.property({type:Boolean,readOnly:!0})],a.EnvironmentRenderer.prototype,"updating",null);b.__decorate([h.property({readOnly:!0})],a.EnvironmentRenderer.prototype,"weatherVisible",null);b.__decorate([h.property()],a.EnvironmentRenderer.prototype,"_context",void 0);b.__decorate([h.property()],
a.EnvironmentRenderer.prototype,"_atmosphere",void 0);b.__decorate([h.property({readOnly:!0})],a.EnvironmentRenderer.prototype,"_stars",null);b.__decorate([h.property({readOnly:!0})],a.EnvironmentRenderer.prototype,"_precipitation",null);b.__decorate([h.property({readOnly:!0})],a.EnvironmentRenderer.prototype,"_clouds",null);b.__decorate([h.property({readOnly:!0})],a.EnvironmentRenderer.prototype,"_cloudsComposition",null);b.__decorate([h.property({readOnly:!0})],a.EnvironmentRenderer.prototype,"_fog",
null);b.__decorate([h.property({readOnly:!0})],a.EnvironmentRenderer.prototype,"weatherEnabled",null);b.__decorate([h.property({readOnly:!0})],a.EnvironmentRenderer.prototype,"_precipitationEnabled",null);b.__decorate([h.property({readOnly:!0})],a.EnvironmentRenderer.prototype,"_weatherUpdateParameters",null);a.EnvironmentRenderer=b.__decorate([e.subclass("esri.views.3d.environment.EnvironmentRenderer")],a.EnvironmentRenderer);class I{constructor(){this.fog=new A.FogParameters;this.hazeAmount=1}copyFrom(P){this.fog.amount=
P.fog.amount;this.hazeAmount=P.hazeAmount;this.fog.strength=P.fog.strength;g.copy(this.fog.color,P.fog.color)}lerp(P,M,K){this.fog.amount=l.lerp(P.fog.amount,M.fog.amount,K);this.hazeAmount=l.lerp(P.hazeAmount,M.hazeAmount,K);this.fog.strength=l.lerp(P.fog.strength,M.fog.strength,K);g.lerp(this.fog.color,P.fog.color,M.fog.color,K)}}const O=d.fromValues(.5,.5,.5),L=d.fromValues(1.5,1.5,1.5);a.WeatherParameters=I;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/AtmosphereType":function(){define(["exports"],
function(a){a.AtmosphereType=void 0;var b=a.AtmosphereType||(a.AtmosphereType={});b[b.Realistic=0]="Realistic";b[b.Local=1]="Local";b[b.Mars=2]="Mars";b[b.None=3]="None";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/ChapmanAtmosphere":function(){define("exports ../../../core/colorUtils ../../../core/Handles ../../../core/mathUtils ../../../core/reactiveUtils ../../../core/libs/gl-matrix-2/math/vec2 ../../../chunks/vec32 ../../../chunks/vec42 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../geometry/support/Ellipsoid ./AtmosphereType ./atmosphereUtils ./ChapmanAtmosphereTechnique ./ChapmanAtmosphereTechniqueConfiguration ../webgl/formats ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/glUtil3D ../webgl-engine/lib/textureUtils ../../../chunks/AtmosphereCompositing.glsl ../webgl-engine/shaders/AtmosphereCompositingTechnique ../../webgl/enums ../../../webscene/background/ColorBackground".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){class A{constructor(B,C){this._view=B;this._context=C;this.type=g.AtmosphereType.Realistic;this._handles=new q;this._compositingPassParameters=new u.AtmosphereCompositingPassParameters;this._passParameters=new t.ChapmanAtmospherePassParameters;this._rootTileElevationMin=NaN;this._lowerBoundEarthRadius=e.earth.radius;this._fadeHaze=0;this._updateRadius(e.earth.radius);B=this._context.renderContext.rctx;this._updateRootTileElevationBounds();this._handles.add([p.watch(()=>
this._view?.basemapTerrain?.rootTileElevationBounds,()=>this._view?.basemapTerrain?this._updateRootTileElevationBounds():null),p.watch(()=>this._view?.basemapTerrain?.visibleElevationBounds,()=>this._view?.basemapTerrain?this._updateVisibleElevationBounds():null),p.watch(()=>this._view?.environment.background,D=>{D=D instanceof z?b.unitRGBAFromColor(D.color):c.ZEROS;h.set(this._passParameters.backgroundColor,D[0]*D[3],D[1]*D[3],D[2]*D[3])},p.syncAndInitial)]);C=new w.ChapmanAtmosphereTechniqueConfiguration;
C.haze=!1;this._atmosphereTechnique=this._context.techniques.acquire(t.ChapmanAtmosphereTechnique,C);this._compositingTechnique=this._context.techniques.acquire(x.AtmosphereCompositingTechnique,C);C.haze=!0;this._atmosphereHazeTechnique=this._context.techniques.acquire(t.ChapmanAtmosphereTechnique,C);this._compositingHazeTechnique=this._context.techniques.acquire(x.AtmosphereCompositingTechnique,C);C.reduced=!0;C.haze=!1;this._atmosphereReducedTechnique=this._context.techniques.acquire(t.ChapmanAtmosphereTechnique,
C);C.haze=!0;this._atmosphereHazeReducedTechnique=this._context.techniques.acquire(t.ChapmanAtmosphereTechnique,C);this._vao=r.createQuadVAO(B,m.Pos2Tex)}destroy(){this._handles.destroy();this._compositingTechnique.release();this._compositingHazeTechnique.release();this._atmosphereTechnique.release();this._atmosphereHazeTechnique.release();this._atmosphereReducedTechnique.release();this._atmosphereHazeReducedTechnique.release();this._vao.dispose()}render(B,C){this._render(B,C?this._atmosphereTechnique:
this._atmosphereReducedTechnique,C,!1)}renderHaze(B,C,D){this._fadeHaze=C;this._render(B,D?this._atmosphereHazeTechnique:this._atmosphereHazeReducedTechnique,D,!0)}_render(B,C,D,F){const H=B.bindParameters.mainDepth;if(H){this._update(B.bindParameters.camera);this._passParameters.depthTexture=H;var N=B.rctx.bindTechnique(C,B.bindParameters,this._passParameters);C=B.offscreenRenderingHelper;if(D)C.renderDepthDetached(()=>this._renderCommon(N,B));else{D=B.rctx.getViewport();var E=h.length(B.bindParameters.camera.eye)-
e.earth.radius;if(E<d.atmosphereHeight){E=Math.min(1,Math.max(0,E/d.atmosphereHeight));var G=F?l.lerp(.4,.5,E):l.lerp(.2,.3,E)}else E=Math.min(1,Math.max(0,(E-d.atmosphereHeight)/(15*d.atmosphereHeight))),G=F?l.lerp(.5,1,E):l.lerp(.3,.6,E);E=n.applyTextureResizeModulo(Math.round(G*B.bindParameters.camera.fullViewport[2]));G=n.applyTextureResizeModulo(Math.round(G*B.bindParameters.camera.fullViewport[3]));B.rctx.setViewport(0,0,E,G);E=C.renderToCachedFBO(null,F?"chapman haze":"chapman",()=>this._renderCommon(N,
B),[0,0,0,1],v.ColorFormat.RGBA,null,E,G);B.rctx.setViewport(D.x,D.y,D.width,D.height);this._compositingPassParameters.color=E.getTexture();this._compositingPassParameters.depth=H;B.rctx.bindTechnique(F?this._compositingHazeTechnique:this._compositingTechnique,B.bindParameters,this._compositingPassParameters);C.renderDepthDetached(()=>B.rctx.screen.draw());E.release()}}}_renderCommon(B,C){null!=this._vao&&(C.rctx.bindVAO(this._vao),B.assertCompatibleVertexAttributeLocations(this._vao),C.rctx.drawArrays(y.PrimitiveType.TRIANGLE_STRIP,
0,4))}_updateRootTileElevationBounds(){const B=this._view.basemapTerrain.rootTileElevationBounds.min;B!==this._rootTileElevationMin&&(this._rootTileElevationMin=B,this._lowerBoundEarthRadius=e.earth.radius,this._updateVisibleElevationBounds())}_updateVisibleElevationBounds(){const B=(e.earth.radius+this._view.basemapTerrain.visibleElevationBounds.min)*Math.cos(Math.PI/16/16);B<this._lowerBoundEarthRadius&&this._updateRadius(B)}_updateRadius(B){this._lowerBoundEarthRadius=B;k.set(this._passParameters.radii,
B,B+d.atmosphereHeight);this._passParameters.innerFadeDistance=2*Math.sqrt((2*B-d.innerAtmosphereDepth)*d.innerAtmosphereDepth)}_update(B){if(B){B=h.squaredLength(B.eye);var C=Math.sqrt(B),D=B-this._passParameters.radii[1]*this._passParameters.radii[1],F=l.clamp((C-this._passParameters.radii[0])/d.atmosphereHeight,0,1);f.set(this._passParameters.heightParameters,C,B,D,F);this._passParameters.altitudeFade=d.computeInnerAltitudeFade(C-this._lowerBoundEarthRadius);this._passParameters.hazeStrength=l.lerp(l.lerp(.6,
1,l.smoothstep(9500,10500,C-e.earth.radius)),1,this._fadeHaze)}}}a.ChapmanAtmosphere=A;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/math/vec2":function(){define(["exports","./common"],function(a,b){function q(J,R){J[0]=R[0];J[1]=R[1];return J}function l(J,R,Q){J[0]=R;J[1]=Q;return J}function p(J,R,Q){J[0]=R[0]+Q[0];J[1]=R[1]+Q[1];return J}function k(J,R,Q){J[0]=R[0]-Q[0];J[1]=R[1]-Q[1];return J}function h(J,R,Q){J[0]=R[0]*Q[0];J[1]=R[1]*Q[1];return J}
function f(J,R,Q){J[0]=R[0]/Q[0];J[1]=R[1]/Q[1];return J}function c(J,R){J[0]=Math.ceil(R[0]);J[1]=Math.ceil(R[1]);return J}function e(J,R){J[0]=Math.floor(R[0]);J[1]=Math.floor(R[1]);return J}function g(J,R,Q){J[0]=Math.min(R[0],Q[0]);J[1]=Math.min(R[1],Q[1]);return J}function d(J,R,Q){J[0]=Math.max(R[0],Q[0]);J[1]=Math.max(R[1],Q[1]);return J}function t(J,R){J[0]=Math.round(R[0]);J[1]=Math.round(R[1]);return J}function w(J,R,Q){J[0]=R[0]*Q;J[1]=R[1]*Q;return J}function v(J,R,Q,W){J[0]=R[0]+Q[0]*
W;J[1]=R[1]+Q[1]*W;return J}function m(J,R){const Q=R[0]-J[0];J=R[1]-J[1];return Math.sqrt(Q*Q+J*J)}function r(J,R){const Q=R[0]-J[0];J=R[1]-J[1];return Q*Q+J*J}function n(J){const R=J[0];J=J[1];return Math.sqrt(R*R+J*J)}function u(J){const R=J[0];J=J[1];return R*R+J*J}function x(J,R){J[0]=-R[0];J[1]=-R[1];return J}function y(J,R){J[0]=1/R[0];J[1]=1/R[1];return J}function z(J,R){var Q=R[0];const W=R[1];Q=Q*Q+W*W;0<Q&&(Q=1/Math.sqrt(Q),J[0]=R[0]*Q,J[1]=R[1]*Q);return J}function A(J,R){return J[0]*
R[0]+J[1]*R[1]}function B(J,R,Q){R=R[0]*Q[1]-R[1]*Q[0];J[0]=J[1]=0;J[2]=R;return J}function C(J,R,Q,W){const S=R[0];R=R[1];J[0]=S+W*(Q[0]-S);J[1]=R+W*(Q[1]-R);return J}function D(J,R){R=R||1;const Q=2*b.RANDOM()*Math.PI;J[0]=Math.cos(Q)*R;J[1]=Math.sin(Q)*R;return J}function F(J,R,Q){const W=R[0];R=R[1];J[0]=Q[0]*W+Q[2]*R;J[1]=Q[1]*W+Q[3]*R;return J}function H(J,R,Q){const W=R[0];R=R[1];J[0]=Q[0]*W+Q[2]*R+Q[4];J[1]=Q[1]*W+Q[3]*R+Q[5];return J}function N(J,R,Q){const W=R[0];R=R[1];J[0]=Q[0]*W+Q[3]*
R+Q[6];J[1]=Q[1]*W+Q[4]*R+Q[7];return J}function E(J,R,Q){const W=R[0];R=R[1];J[0]=Q[0]*W+Q[4]*R+Q[12];J[1]=Q[1]*W+Q[5]*R+Q[13];return J}function G(J,R,Q,W){const S=R[0]-Q[0];R=R[1]-Q[1];const V=Math.sin(W);W=Math.cos(W);J[0]=S*W-R*V+Q[0];J[1]=S*V+R*W+Q[1];return J}function I(J,R){var Q=J[0];J=J[1];const W=R[0];R=R[1];let S=Q*Q+J*J;0<S&&(S=1/Math.sqrt(S));let V=W*W+R*R;0<V&&(V=1/Math.sqrt(V));Q=(Q*W+J*R)*S*V;return 1<Q?0:-1>Q?Math.PI:Math.acos(Q)}function O(J){return"vec2("+J[0]+", "+J[1]+")"}function L(J,
R){return J[0]===R[0]&&J[1]===R[1]}function P(J,R){const Q=J[0];J=J[1];const W=R[0];R=R[1];const S=b.getEpsilon();return Math.abs(Q-W)<=S*Math.max(1,Math.abs(Q),Math.abs(W))&&Math.abs(J-R)<=S*Math.max(1,Math.abs(J),Math.abs(R))}function M(J,R,Q,W,S){let V=R[0]-Q[0];Q=R[1]-Q[1];S=(W[0]*V+W[1]*Q)*(S-1);V=W[0]*S;Q=W[1]*S;J[0]=R[0]+V;J[1]=R[1]+Q;return J}const K=Object.freeze(Object.defineProperty({__proto__:null,add:p,angle:I,ceil:c,copy:q,cross:B,dist:m,distance:m,div:f,divide:f,dot:A,equals:P,exactEquals:L,
floor:e,inverse:y,len:n,length:n,lerp:C,max:d,min:g,mul:h,multiply:h,negate:x,normalize:z,projectAndScale:M,random:D,rotate:G,round:t,scale:w,scaleAndAdd:v,set:l,sqrDist:r,sqrLen:u,squaredDistance:r,squaredLength:u,str:O,sub:k,subtract:k,transformMat2:F,transformMat2d:H,transformMat3:N,transformMat4:E},Symbol.toStringTag,{value:"Module"}));a.add=p;a.angle=I;a.ceil=c;a.copy=q;a.cross=B;a.dist=m;a.distance=m;a.div=f;a.divide=f;a.dot=A;a.equals=P;a.exactEquals=L;a.floor=e;a.inverse=y;a.len=n;a.length=
n;a.lerp=C;a.max=d;a.min=g;a.mul=h;a.multiply=h;a.negate=x;a.normalize=z;a.projectAndScale=M;a.random=D;a.rotate=G;a.round=t;a.scale=w;a.scaleAndAdd=v;a.set=l;a.sqrDist=r;a.sqrLen=u;a.squaredDistance=r;a.squaredLength=u;a.str=O;a.sub=k;a.subtract=k;a.transformMat2=F;a.transformMat2d=H;a.transformMat3=N;a.transformMat4=E;a.vec2=K;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/atmosphereUtils":function(){define(["exports","../../../core/mathUtils"],function(a,
b){a.atmosphereHeight=1E5;a.computeInnerAltitudeFade=function(q){return b.clamp((q-1E5)/9E5,0,1)};a.innerAtmosphereDepth=1E4;a.rayLeighScaleHeight=.085;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/ChapmanAtmosphereTechnique":function(){define("require exports ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../chunks/ChapmanAtmosphere.glsl ../webgl-engine/core/shaderModules/interfaces ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w extends h.NoParameters{constructor(){super(...arguments);this.heightParameters=p.create();this.radii=q.create();this.altitudeFade=this.innerFadeDistance=0;this.hazeStrength=1;this.renderScale=q.create();this.backgroundColor=l.create()}}class v extends c.ShaderTechnique{initializeProgram(m){return new g.Program(m.rctx,v.shader.get().build(this.configuration),e.Default3D)}initializePipeline(){return this.configuration.reduced?t.makePipelineState({blending:t.simpleBlendingParams(d.BlendFactor.ONE,
d.BlendFactor.ZERO),depthTest:{func:d.CompareFunction.ALWAYS},colorWrite:t.defaultColorWriteParams}):this.configuration.haze?t.makePipelineState({blending:t.separateBlendingParams(d.BlendFactor.ONE,d.BlendFactor.ZERO,d.BlendFactor.ONE_MINUS_SRC_COLOR,d.BlendFactor.ONE),colorWrite:t.defaultColorWriteParams}):t.makePipelineState({blending:t.simpleBlendingParams(d.BlendFactor.SRC_ALPHA,d.BlendFactor.ONE_MINUS_SRC_ALPHA),depthTest:{func:d.CompareFunction.LEQUAL},colorWrite:t.defaultColorWriteParams})}}
v.shader=new f.ReloadableShaderModule(k.ChapmanAtmosphere,()=>new Promise((m,r)=>a(["./ChapmanAtmosphere.glsl"],m,r)));b.ChapmanAtmospherePassParameters=w;b.ChapmanAtmosphereTechnique=v;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/ChapmanAtmosphere.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../core/libs/gl-matrix-2/factories/vec3f64 ../views/3d/environment/atmosphereUtils ../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){function u(B){const C=new m.ShaderBuilder;C.attributes.add(n.VertexAttribute.POSITION,"vec2");C.include(k.TextureCoordinateAttribute,{textureCoordinateType:k.TextureCoordinateAttributeType.Default});C.varyings.add("worldRay","vec3");C.varyings.add("eyeDir","vec3");const {vertex:D,fragment:F}=C;D.uniforms.add(new v.Matrix4PassUniform("inverseProjectionMatrix",(H,N)=>N.camera.inverseProjectionMatrix),new v.Matrix4PassUniform("inverseViewMatrix",(H,N)=>b.invertOrIdentity(A,
N.camera.viewMatrix)));D.code.add(w.glsl`void main(void) {
vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1, 1)).xyz;
eyeDir = posViewNear;
worldRay = (inverseViewMatrix * vec4(posViewNear, 0)).xyz;
forwardTextureCoordinates();
gl_Position = vec4(position, 1, 1);
}`);F.uniforms.add(new g.Float3PassUniform("backgroundColor",H=>H.backgroundColor),new e.Float2PassUniform("radii",H=>H.radii),new g.Float3PassUniform("cameraPosition",(H,N)=>N.camera.eye),new d.Float4PassUniform("heightParameters",H=>H.heightParameters),new t.FloatPassUniform("innerFadeDistance",H=>H.innerFadeDistance),new t.FloatPassUniform("altitudeFade",H=>H.altitudeFade),new r.Texture2DPassUniform("depthTexture",H=>H.depthTexture),new t.FloatPassUniform("hazeStrength",H=>H.hazeStrength));F.constants.add("betaRayleigh",
"vec3",x);F.constants.add("betaCombined","vec3",z);F.constants.add("betaMie","float",3.996E-6);F.constants.add("scaleHeight","float",p.rayLeighScaleHeight*p.atmosphereHeight);c.addMainLightDirection(F);C.include(f.Gamma);B.haze&&F.include(h.ReadDepth);F.code.add(w.glsl`vec2 sphereIntersect(vec3 start, vec3 dir, float radius, bool planet) {
float a = dot(dir, dir);
float b = 2.0 * dot(dir, start);
float c = planet ? heightParameters[1] - radius * radius : heightParameters[2];
float d = (b * b) - 4.0 * a * c;
if (d < 0.0) {
return vec2(1e5, -1e5);
}
return vec2((-b - sqrt(d)) / (2.0 * a), (-b + sqrt(d)) / (2.0 * a));
}`);F.code.add(w.glsl`float chapmanApproximation(float X, float h, float cosZenith) {
float c = sqrt(X + h);
float cExpH = c * exp(-h);
if (cosZenith >= 0.0) {
return cExpH / (c * cosZenith + 1.0);
} else {
float x0 = sqrt(1.0 - cosZenith * cosZenith) * (X + h);
float c0 = sqrt(x0);
return 2.0 * c0 * exp(X - x0) - cExpH / (1.0 - c * cosZenith);
}
}`);F.code.add(w.glsl`float getOpticalDepth(vec3 position, vec3 dir, float h) {
return scaleHeight * chapmanApproximation(radii[0] / scaleHeight, h, dot(normalize(position), dir));
}`);F.code.add(w.glsl`
const int STEPS = 6;
vec3 getAtmosphereColour(vec3 cameraPos, vec3 rayDir, vec3 lightDir, float terrainDepth) {
float reducedPlanetRadius = radii[0] - 20000.0;
vec2 rayPlanetIntersect = sphereIntersect(cameraPos, rayDir, reducedPlanetRadius, true);
vec2 rayAtmosphereIntersect = sphereIntersect(cameraPos, rayDir, radii[1], false);
bool hitsAtmosphere = (rayAtmosphereIntersect.x <= rayAtmosphereIntersect.y) && rayAtmosphereIntersect.x > 0.0;
bool insideAtmosphere = heightParameters[0] < radii[1];
if (!(hitsAtmosphere || insideAtmosphere)) {
return vec3(0);
}
bool hitsPlanet = (rayPlanetIntersect.x <= rayPlanetIntersect.y) && rayPlanetIntersect.x > 0.0;
float start = insideAtmosphere ? 0.0 : rayAtmosphereIntersect.x;
if (heightParameters[0] < reducedPlanetRadius) {
// Long light rays from the night side of the planet lead to numerical instability
// Do not render the atmosphere in such cases
if (dot(rayDir, normalize(cameraPos)) < -0.025) {
return vec3(0);
}
start = rayPlanetIntersect.y;
}
float end = hitsPlanet ? rayPlanetIntersect.x : rayAtmosphereIntersect.y;
float maxEnd = end;
${B.haze?w.glsl`if (terrainDepth != -1.0) { end = terrainDepth; }`:""}
vec3 samplePoint = cameraPos + rayDir * end;
float multiplier = hitsPlanet ? -1.0 : 1.0;
vec3 scattering = vec3(0);
float scaleFract = (length(samplePoint) - radii[0]) / scaleHeight;
float lastOpticalDepth = getOpticalDepth(samplePoint, rayDir, scaleFract);
float stepSize = (end - start) / float(STEPS);
for (int i = 0; i < STEPS; i++) {
samplePoint -= stepSize * rayDir;
scaleFract = (length(samplePoint) - radii[0]) / scaleHeight;
float opticalDepth = multiplier * getOpticalDepth(samplePoint, rayDir * multiplier, scaleFract);
if (i > 0) {
scattering *= ${B.haze?"":w.glsl`mix(2.5, 1.0, clamp((length(cameraPos) - radii[0]) / 50e3, 0.0, 1.0)) * `} exp(-(mix(betaCombined, betaRayleigh, 0.5) + betaMie) * max(0.0, (opticalDepth - lastOpticalDepth)));
}
if (dot(normalize(samplePoint), lightDir) > -0.3) {
float scale = exp(-scaleFract);
float lightDepth = getOpticalDepth(samplePoint, lightDir, scaleFract);
scattering += scale * exp(-(betaCombined + betaMie) * lightDepth);
${B.haze?"":w.glsl`scattering += scale * exp(-(0.25 * betaCombined ) * lightDepth);`}
}
lastOpticalDepth = opticalDepth;
}
float mu = dot(rayDir, lightDir);
float mumu = 1.0 + mu * mu;
float phaseRayleigh = 0.0596831 * mumu;
${B.haze?w.glsl`return 3.0 * scattering * stepSize * phaseRayleigh * betaRayleigh;`:w.glsl`
const float g = 0.8;
const float gg = g * g;
float phaseMie = end == maxEnd ? 0.1193662 * ((1.0 - gg) * mumu) / (pow(1.0 + gg - 2.0 * mu * g, 1.5) * (2.0 + gg)) : 0.0;
phaseMie = clamp(phaseMie, 0.0, 128.0);
return 3.0 * scattering * stepSize * (phaseRayleigh * betaRayleigh + 0.025 * phaseMie * betaMie);`}
}
${B.haze?"":w.glsl`
vec4 applyUndergroundAtmosphere(vec3 rayDir, vec3 lightDirection, vec4 fragColor) {
vec2 rayPlanetIntersect = sphereIntersect(cameraPosition, rayDir, radii[0], true);
if (!((rayPlanetIntersect.x <= rayPlanetIntersect.y) && rayPlanetIntersect.y > 0.0)) {
return fragColor;
}
float lightAngle = dot(lightDirection, normalize(cameraPosition + rayDir * max(0.0, rayPlanetIntersect.x)));
vec4 surfaceColor = vec4(vec3(max(0.0, (smoothstep(-1.0, 0.8, 2.0 * lightAngle)))), 1.0 - altitudeFade);
float relDist = (rayPlanetIntersect.y - max(0.0, rayPlanetIntersect.x)) / innerFadeDistance;
if (relDist > 1.0) {
return surfaceColor;
}
return mix(fragColor, surfaceColor, smoothstep(0.0, 1.0, relDist * relDist));
}
float getGlow(float dist, float radius, float intensity) {
return pow(radius / max(dist, 1e-6), intensity);
}
vec3 getSun(vec3 cameraPos, vec3 rayDir, vec3 lightDir){
// Get the amount of atmosphere between camera and the Sun along the view ray
float scaleFract = (length(cameraPos) - radii[0]) / scaleHeight;
float sunOpticalDepth = getOpticalDepth(cameraPos, rayDir, max(scaleFract, 0.0));
// Find the amount of light that remains after travelling through the atmosphere from the Sun along the view ray
// This will make the colour of the Sun reddish on the horizon and white from space
vec3 sunTransmittance = exp(-(mix(betaCombined, betaRayleigh, 0.5)) * max(0.0, sunOpticalDepth));
// Alignment of light direction and view ray
float mu = clamp(dot(rayDir, lightDir), 0.0, 1.0);
// Draw the Sun as a bright disc
float sunDisc = 256.0 * smoothstep(0.0, 128.0, clamp(getGlow(1.0 - mu, 3e-5, 3.0), 0.0, 128.0));
return normalize(sunTransmittance) * sunDisc;
}`}
${B.haze&&B.reduced?w.glsl`
float getDepth(vec2 uv){
return linearDepthFromTexture(depthTexture, uv);
}
float textureBilinear(vec2 uv) {
// Information about the high-resolution depth texture
vec2 depthTextureSize = vec2(textureSize(depthTexture, 0));
vec2 texelSize = 1.0 / depthTextureSize;
// The uv inside the upper right pixel - of the tile of 4 pixels -
// that the atmosphere uv maps to in the depth texture
vec2 depthUV = (uv * depthTextureSize) - vec2(0.5);
// Relative distance of the uv coordinates inside the depth texture pixel
vec2 f = fract(depthUV);
// Snap to the centre of the depth texture pixel
vec2 snapUV = (floor(depthUV) + vec2(0.5)) / depthTextureSize;
// Read the depth texture pixel and its three neighbours
float d0 = getDepth(snapUV);
float d1 = getDepth(snapUV + vec2(texelSize.x, 0.0));
float d2 = getDepth(snapUV + vec2(0.0, texelSize.y));
float d3 = getDepth(snapUV + texelSize);
// Return the bilinearly interpolated value of the neighbouring pixels based
// on the sample position in the depth texture pixel
return mix(mix(d0, d1, f.x), mix(d2, d3, f.x), f.y);
}
`:""}
vec3 tonemapACES(vec3 x) {
return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
}
void main() {
vec3 rayDir = normalize(worldRay);
float terrainDepth = -1.0;
${B.haze?w.glsl`
float depthSample = texture(depthTexture, vuv0).r;
if (depthSample != 1.0) {
vec3 cameraSpaceRay = normalize(eyeDir);
cameraSpaceRay /= cameraSpaceRay.z;
${B.reduced?w.glsl`cameraSpaceRay *= -textureBilinear(vuv0);`:w.glsl`cameraSpaceRay *= -linearDepthFromTexture(depthTexture, vuv0);`}
terrainDepth = max(0.0, length(cameraSpaceRay));
}else{
discard;
}
`:w.glsl`${B.reduced?"":w.glsl`
float depthSample = texture(depthTexture, vuv0).r;
if (depthSample != 1.0) {
fragColor = vec4(0);
return;
}`}`}
${B.haze?w.glsl`
vec3 col = vec3(0);
float fadeOut = smoothstep(-10000.0, -15000.0, heightParameters[0] - radii[0]);
if(depthSample != 1.0){
col = (1.0 - fadeOut) * hazeStrength * getAtmosphereColour(cameraPosition, rayDir, mainLightDirection, terrainDepth);
}
// Alpha is ignored for haze blending
float alpha = 1.0;
`:w.glsl`
vec3 col = linearizeGamma(backgroundColor);
col += getAtmosphereColour(cameraPosition, rayDir, mainLightDirection, terrainDepth);
col += getSun(cameraPosition, rayDir, mainLightDirection);
float alpha = smoothstep(0.0, mix(0.15, 0.01, heightParameters[3]), length(col));`}
col = tonemapACES(col);
fragColor = delinearizeGamma(vec4(col, alpha));
${B.haze?"":w.glsl`fragColor = applyUndergroundAtmosphere(rayDir, mainLightDirection, fragColor);`}
}
`);return C}const x=l.fromValues(parseFloat(Number(5.802E-6).toFixed(6)),parseFloat(Number(1.3558E-5).toFixed(6)),parseFloat(Number(3.31E-5).toFixed(6))),y=l.fromValues(3*parseFloat(Number(6.5E-7).toFixed(6)),3*parseFloat(Number(1.881E-6).toFixed(6)),3*parseFloat(Number(8.5E-8).toFixed(6))),z=l.fromValues(parseFloat(Number(x[0]+y[0]).toFixed(6)),parseFloat(Number(x[1]+y[1]).toFixed(6)),parseFloat(Number(x[2]+y[2]).toFixed(6))),A=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,betaRayleigh:x,
build:u},Symbol.toStringTag,{value:"Module"}));a.ChapmanAtmosphere=q;a.betaRayleigh=x;a.build=u})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl":function(){define(["exports","../../../../../../core/compilerUtils","../../shaderModules/interfaces","../../../lib/VertexAttribute"],function(a,b,q,l){a.TextureCoordinateAttributeType=void 0;(function(p){p[p.None=0]="None";p[p.Default=1]="Default";p[p.Atlas=2]="Atlas";p[p.Compressed=3]="Compressed";p[p.COUNT=4]=
"COUNT"})(a.TextureCoordinateAttributeType||(a.TextureCoordinateAttributeType={}));a.TextureCoordinateAttribute=function(p,k){switch(k.textureCoordinateType){case a.TextureCoordinateAttributeType.Default:p.attributes.add(l.VertexAttribute.UV0,"vec2");p.varyings.add("vuv0","vec2");p.vertex.code.add(q.glsl`void forwardTextureCoordinates() {
vuv0 = uv0;
}`);break;case a.TextureCoordinateAttributeType.Compressed:p.attributes.add(l.VertexAttribute.UV0,"vec2");p.varyings.add("vuv0","vec2");p.vertex.code.add(q.glsl`vec2 getUV0() {
return uv0 / 16384.0;
}
void forwardTextureCoordinates() {
vuv0 = getUV0();
}`);break;case a.TextureCoordinateAttributeType.Atlas:p.attributes.add(l.VertexAttribute.UV0,"vec2");p.varyings.add("vuv0","vec2");p.attributes.add(l.VertexAttribute.UVREGION,"vec4");p.varyings.add("vuvRegion","vec4");p.vertex.code.add(q.glsl`void forwardTextureCoordinates() {
vuv0 = uv0;
vuvRegion = uvRegion;
}`);break;default:b.neverReached(k.textureCoordinateType);case a.TextureCoordinateAttributeType.None:p.vertex.code.add(q.glsl`void forwardTextureCoordinates() {}`);case a.TextureCoordinateAttributeType.COUNT:}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/interfaces":function(){define(["exports"],function(a){function b(p,...k){let h="";for(let f=0;f<k.length;f++)h+=p[f]+k[f];return h+=p[p.length-1]}class q{}const l=q;(function(p){p.int=
function(k){return Math.round(k).toString()};p.float=function(k){return k.toPrecision(8)}})(b||={});a.NoParameters=l;a.glsl=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/VertexAttribute":function(){define(["exports"],function(a){a.VertexAttribute=void 0;(function(b){b.POSITION="position";b.NORMAL="normal";b.NORMALCOMPRESSED="normalCompressed";b.UV0="uv0";b.COLOR="color";b.SYMBOLCOLOR="symbolColor";b.SIZE="size";b.TANGENT="tangent";b.OFFSET="offset";
b.PERSPECTIVEDIVIDE="perspectiveDivide";b.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance";b.LENGTH="length";b.PREVPOSITION="prevPosition";b.NEXTPOSITION="nextPosition";b.SUBDIVISIONFACTOR="subdivisionFactor";b.COLORFEATUREATTRIBUTE="colorFeatureAttribute";b.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute";b.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute";b.DISTANCETOSTART="distanceToStart";b.UVMAPSPACE="uvMapSpace";b.BOUNDINGRECT="boundingRect";b.UVREGION="uvRegion";b.PROFILERIGHT="profileRight";b.PROFILEUP=
"profileUp";b.PROFILEVERTEXANDNORMAL="profileVertexAndNormal";b.FEATUREVALUE="featureValue";b.INSTANCEMODELORIGINHI="instanceModelOriginHi";b.INSTANCEMODELORIGINLO="instanceModelOriginLo";b.INSTANCEMODEL="instanceModel";b.INSTANCEMODELNORMAL="instanceModelNormal";b.INSTANCECOLOR="instanceColor";b.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute";b.LOCALTRANSFORM="localTransform";b.GLOBALTRANSFORM="globalTransform";b.BOUNDINGSPHERE="boundingSphere";b.MODELORIGIN="modelOrigin";b.MODELSCALEFACTORS=
"modelScaleFactors";b.FEATUREATTRIBUTE="featureAttribute";b.STATE="state";b.LODLEVEL="lodLevel";b.POSITION0="position0";b.POSITION1="position1";b.NORMAL2COMPRESSED="normal2Compressed";b.COMPONENTINDEX="componentIndex";b.VARIANTOFFSET="variantOffset";b.VARIANTSTROKE="variantStroke";b.VARIANTEXTENSION="variantExtension";b.SIDENESS="sideness";b.START="start";b.END="end";b.UP="up";b.EXTRUDE="extrude";b.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor";b.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"})(a.VertexAttribute||
(a.VertexAttribute={}));a.affectsGeometry=function(b){return b===a.VertexAttribute.POSITION};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/math/vec2 ../../../../../../core/libs/gl-matrix-2/factories/vec2f64 ../util/RgbaFloatEncoding.glsl ../../shaderModules/Float2PassUniform ../../shaderModules/interfaces".split(" "),function(a,b,q,l,p,k){const h=
q.create();a.ReadDepth=function(f){f.uniforms.add(new p.Float2PassUniform("zProjectionMap",(c,e)=>{c=e.camera.projectionMatrix;return b.set(h,c[14],c[10])}));f.code.add(k.glsl`float linearizeDepth(float depth) {
float depthNdc = depth * 2.0 - 1.0;
float c1 = zProjectionMap[0];
float c2 = zProjectionMap[1];
return -(c1 / (depthNdc + c2 + 1e-7));
}`);f.code.add(k.glsl`float depthFromTexture(sampler2D depthTexture, vec2 uv) {
ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0)));
float depth = texelFetch(depthTexture, iuv, 0).r;
return depth;
}`);f.code.add(k.glsl`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) {
return linearizeDepth(depthFromTexture(depthTexture, uv));
}`)};a.ReadLinearDepth=function(f){f.include(l.RgbaFloatEncoding);f.code.add(k.glsl`float linearDepthFromFloat(float depth, vec2 nearFar) {
return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);
}
float linearDepthFromRGBA(vec4 depth, vec2 nearFar) {
return linearDepthFromFloat(rgba2float(depth), nearFar);
}
float linearDepthFromTexture(sampler2D depthTexture, vec2 uv, vec2 nearFar) {
ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0)));
return linearDepthFromRGBA(texelFetch(depthTexture, iuv, 0), nearFar);
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.RgbaFloatEncoding=function(q){q.code.add(b.glsl`const float MAX_RGBA_FLOAT =
255.0 / 256.0 +
255.0 / 256.0 / 256.0 +
255.0 / 256.0 / 256.0 / 256.0 +
255.0 / 256.0 / 256.0 / 256.0 / 256.0;
const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0);
vec4 float2rgba(const float value) {
float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT);
vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0);
const float toU8AsFloat = 1.0 / 255.0;
return fixedPointU8 * toU8AsFloat;
}
const vec4 RGBA_2_FLOAT_FACTORS = vec4(
255.0 / (256.0),
255.0 / (256.0 * 256.0),
255.0 / (256.0 * 256.0 * 256.0),
255.0 / (256.0 * 256.0 * 256.0 * 256.0)
);
float rgba2float(vec4 rgba) {
return dot(rgba, RGBA_2_FLOAT_FACTORS);
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Float2PassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"vec2",q.BindType.Pass,(h,f,c)=>h.setUniform2fv(p,k(f,c)))}}a.Float2PassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Uniform":function(){define(["exports",
"../shaderTechnique/BindType"],function(a,b){class q{constructor(l,p,k,h,f=null){this.name=l;this.type=p;this.arraySize=f;this.bind={[b.BindType.Pass]:null,[b.BindType.Draw]:null};if(h)switch(k){case b.BindType.Pass:this.bind[b.BindType.Pass]=h;break;case b.BindType.Draw:this.bind[b.BindType.Draw]=h}}equals(l){return this.type===l.type&&this.name===l.name&&this.arraySize===l.arraySize}}a.Uniform=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderTechnique/BindType":function(){define(["exports"],
function(a){a.BindType=void 0;var b=a.BindType||(a.BindType={});b[b.Pass=0]="Pass";b[b.Draw=1]="Draw";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.Gamma=function(q){q.fragment.code.add(b.glsl`const float GAMMA = 2.2;
const float INV_GAMMA = 0.4545454545;
vec4 delinearizeGamma(vec4 color) {
return vec4(pow(color.rgb, vec3(INV_GAMMA)), color.w);
}
vec3 linearizeGamma(vec3 color) {
return pow(color, vec3(GAMMA));
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl":function(){define(["exports","../../shaderModules/Float3PassUniform","../../shaderModules/interfaces"],function(a,b,q){function l(k){k.uniforms.add(new b.Float3PassUniform("mainLightDirection",(h,f)=>f.lighting.mainLight.direction))}function p(k){k.uniforms.add(new b.Float3PassUniform("mainLightIntensity",(h,f)=>f.lighting.mainLight.intensity))}a.MainLighting=
function(k){l(k.fragment);p(k.fragment);k.fragment.code.add(q.glsl`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) {
float dotVal = clamp(dot(normal_global, mainLightDirection), 0.0, 1.0);
return mainLightIntensity * ((1.0 - shadowing) * dotVal);
}`)};a.addMainLightDirection=l;a.addMainLightIntensity=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Float3PassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"vec3",q.BindType.Pass,(h,f,c)=>h.setUniform3fv(p,k(f,c)))}}a.Float3PassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Float4PassUniform":function(){define(["exports",
"./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"vec4",q.BindType.Pass,(h,f,c)=>h.setUniform4fv(p,k(f,c)))}}a.Float4PassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/FloatPassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"float",q.BindType.Pass,(h,f,c)=>h.setUniform1f(p,
k(f,c)))}}a.FloatPassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"mat4",q.BindType.Pass,(h,f,c)=>h.setUniformMatrix4fv(p,k(f,c)))}}a.Matrix4PassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/ShaderBuilder":function(){define("exports ../../../../../core/Error ../../../../../core/has ../../../../../core/Logger ../shaderTechnique/BindType ../../lib/Util".split(" "),
function(a,b,q,l,p,k){class h{constructor(){this._includedModules=new Map}include(r,n){this._includedModules.has(r)?this._includedModules.get(r):(this._includedModules.set(r,n),r(this.builder,n))}}class f extends h{constructor(){super(...arguments);this.vertex=new g;this.fragment=new g;this.attributes=new d;this.varyings=new t;this.extensions=new w;this.constants=new m;this.outputs=new v}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(r){const n=this.extensions.generateSource(r),
u=this.attributes.generateSource(r),x=this.varyings.generateSource(r);var y="vertex"===r?this.vertex:this.fragment;const z=y.uniforms.generateSource(),A=y.code.generateSource(),B="vertex"===r?"precision highp float;\nprecision highp sampler2D;":"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif";y=this.constants.generateSource().concat(y.constants.generateSource());r=this.outputs.generateSource(r);
return`#version 300 es\n${n.join("\n")}\n\n${B}\n\n${y.join("\n")}\n\n${z.join("\n")}\n\n${u.join("\n")}\n\n${x.join("\n")}\n\n${r.join("\n")}\n\n${A.join("\n")}`}generateBindPass(r){const n=new Map;this.vertex.uniforms.entries.forEach(y=>{const z=y.bind[p.BindType.Pass];z&&n.set(y.name,z)});this.fragment.uniforms.entries.forEach(y=>{const z=y.bind[p.BindType.Pass];z&&n.set(y.name,z)});const u=Array.from(n.values()),x=u.length;return(y,z)=>{for(let A=0;A<x;++A)u[A](r,y,z)}}generateBindDraw(r){const n=
new Map;this.vertex.uniforms.entries.forEach(y=>{const z=y.bind[p.BindType.Draw];z&&n.set(y.name,z)});this.fragment.uniforms.entries.forEach(y=>{const z=y.bind[p.BindType.Draw];z&&n.set(y.name,z)});const u=Array.from(n.values()),x=u.length;return(y,z,A)=>{for(let B=0;B<x;++B)u[B](r,y,z,A)}}}class c{constructor(r){this._stage=r;this._entries=new Map}add(...r){for(const n of r)this._add(n);return this._stage}get(r){return this._entries.get(r)}_add(r){if(null==r)l.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder").error(`Trying to add null Uniform from ${Error().stack}.`);
else{if(this._entries.has(r.name)&&!this._entries.get(r.name).equals(r))throw new b(`Duplicate uniform name ${r.name} for different uniform type`);this._entries.set(r.name,r)}}generateSource(){return Array.from(this._entries.values()).map(r=>null!=r.arraySize?`uniform ${r.type} ${r.name}[${r.arraySize}];`:`uniform ${r.type} ${r.name};`)}get entries(){return Array.from(this._entries.values())}}class e{constructor(r){this._stage=r;this._entries=[]}add(r){this._entries.push(r);return this._stage}generateSource(){return this._entries}}
class g extends h{constructor(){super(...arguments);this.uniforms=new c(this);this.code=new e(this);this.constants=new m}get builder(){return this}}class d{constructor(){this._entries=[]}add(r,n){this._entries.push([r,n])}generateSource(r){return"fragment"===r?[]:this._entries.map(n=>`in ${n[1]} ${n[0]};`)}}class t{constructor(){this._entries=new Map}add(r,n){this._entries.has(r)&&k.assert(this._entries.get(r)===n);this._entries.set(r,n)}generateSource(r){const n=[];this._entries.forEach((u,x)=>n.push("vertex"===
r?`out ${u} ${x};`:`in ${u} ${x};`));return n}}class w{constructor(){this._entries=new Set}add(r){this._entries.add(r)}generateSource(r){const n="vertex"===r?w.ALLOWLIST_VERTEX:w.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(u=>n.includes(u)).map(u=>`#extension ${u} : enable`)}}w.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"];w.ALLOWLIST_VERTEX=[];class v{constructor(){this._entries=new Map}add(r,n,u=0){const x=this._entries.get(u);x?k.assert(x.name===
r&&x.type===n,`Fragment shader output location ${u} occupied`):this._entries.set(u,{name:r,type:n})}generateSource(r){if("vertex"===r)return[];0===this._entries.size&&this._entries.set(0,{name:v.DEFAULT_NAME,type:v.DEFAULT_TYPE});const n=[];this._entries.forEach((u,x)=>n.push(`layout(location = ${x}) out ${u.type} ${u.name};`));return n}}v.DEFAULT_TYPE="vec4";v.DEFAULT_NAME="fragColor";class m{constructor(){this._entries=new Set}add(r,n,u){let x="ERROR_CONSTRUCTOR_STRING";switch(n){case "float":x=
m._numberToFloatStr(u);break;case "int":x=m._numberToIntStr(u);break;case "bool":x=u.toString();break;case "vec2":x=`vec2(${m._numberToFloatStr(u[0])}, ${m._numberToFloatStr(u[1])})`;break;case "vec3":x=`vec3(${m._numberToFloatStr(u[0])}, ${m._numberToFloatStr(u[1])}, ${m._numberToFloatStr(u[2])})`;break;case "vec4":x=`vec4(${m._numberToFloatStr(u[0])}, ${m._numberToFloatStr(u[1])}, ${m._numberToFloatStr(u[2])}, ${m._numberToFloatStr(u[3])})`;
break;case "ivec2":x=`ivec2(${m._numberToIntStr(u[0])}, ${m._numberToIntStr(u[1])})`;break;case "ivec3":x=`ivec3(${m._numberToIntStr(u[0])}, ${m._numberToIntStr(u[1])}, ${m._numberToIntStr(u[2])})`;break;case "ivec4":x=`ivec4(${m._numberToIntStr(u[0])}, ${m._numberToIntStr(u[1])}, ${m._numberToIntStr(u[2])}, ${m._numberToIntStr(u[3])})`;
break;case "mat2":case "mat3":case "mat4":x=`${n}(${Array.prototype.map.call(u,y=>m._numberToFloatStr(y)).join(", ")})`}this._entries.add(`const ${n} ${r} = ${x};`);return this}static _numberToIntStr(r){return r.toFixed(0)}static _numberToFloatStr(r){return Number.isInteger(r)?r.toFixed(1):r.toString()}generateSource(){return Array.from(this._entries)}}a.Code=e;a.Includes=h;a.ShaderBuilder=f;a.Stage=g;a.Uniforms=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Util":function(){define(["exports",
"../../../../core/libs/gl-matrix-2/factories/vec2f64","../../../../chunks/vec42","../../../../core/libs/gl-matrix-2/factories/vec4f64"],function(a,b,q,l){function p(f,c){if(!f)throw c=c||"Assertion",new h(`${c} at ${Error(c).stack}`);}const k=l.create();class h{constructor(f){this.message=f}toString(){return`AssertException: ${this.message}`}}a.assert=p;a.isTranslationMatrix=function(f){return 1===f[0]&&0===f[1]&&0===f[2]&&0===f[3]&&0===f[4]&&1===f[5]&&0===f[6]&&0===f[7]&&0===f[8]&&0===f[9]&&1===
f[10]&&0===f[11]&&1===f[15]};a.logWithBase=function(f,c){return Math.log(f)/Math.log(c)};a.project=function(f,c,e,g,d){k[0]=f[0];k[1]=f[1];k[2]=f[2];k[3]=1;q.transformMat4(k,k,c);2<d.length&&(d[2]=-k[2]);q.transformMat4(k,k,e);p(0!==k[3]);d[0]=k[0]/k[3];d[1]=k[1]/k[3];d[2]=k[2]/k[3];d[0]=(.5*d[0]+.5)*g[2]+g[0];d[1]=(.5*d[1]+.5)*g[3]+g[1]};a.rayBoxTest=function(f,c,e,g){let d,t=(e[0]-f[0])/c[0],w=(g[0]-f[0])/c[0];t>w&&(d=t,t=w,w=d);let v=(e[1]-f[1])/c[1],m=(g[1]-f[1])/c[1];v>m&&(d=v,v=m,m=d);if(t>
m||v>w)return!1;v>t&&(t=v);m<w&&(w=m);e=(e[2]-f[2])/c[2];f=(g[2]-f[2])/c[2];e>f&&(d=e,e=f,f=d);if(t>f||e>w)return!1;f<w&&(w=f);return 0>w?!1:!0};a.rayRay2D=function(f,c,e,g,d,t=b.create()){const w=(g[d]-e[d])*(c[0]-f[0])-(g[0]-e[0])*(c[d]-f[d]);if(0===w)return!1;e=((g[0]-e[0])*(f[d]-e[d])-(g[d]-e[d])*(f[0]-e[0]))/w;t[0]=f[0]+e*(c[0]-f[0]);t[1]=f[d]+e*(c[d]-f[d]);return!0};a.setMatrixTranslation3=function(f,c,e,g){f[12]=c;f[13]=e;f[14]=g};a.verify=function(f,c){f||console.warn("Verify failed: "+(c||
"")+"\n"+Error("verify").stack)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"sampler2D",q.BindType.Pass,(h,f,c)=>h.bindTexture(p,k(f,c)))}}a.Texture2DPassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderTechnique/ReloadableShaderModule":function(){define(["exports"],
function(a){class b{constructor(q,l){this._module=q;this._loadModule=l}get(){return this._module}async reload(){return this._module=await this._loadModule()}}a.ReloadableShaderModule=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique":function(){define(["exports","../../../../../core/maybe","../../../../webgl/enums"],function(a,b,q){class l{constructor(p,k,h){this.release=h;this.initializeConfiguration(p,k);this._configuration=
k.snapshot();this._program=this.initializeProgram(p);this._pipeline=this.initializePipeline(p)}destroy(){this._program=b.disposeMaybe(this._program);this._pipeline=this._configuration=null}reload(p){b.disposeMaybe(this._program);this._program=this.initializeProgram(p);this._pipeline=this.initializePipeline(p)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}ensureAttributeLocations(p){this.program.assertCompatibleVertexAttributeLocations(p)}get primitiveType(){return q.PrimitiveType.TRIANGLES}getPipeline(p,
k,h){return this._pipeline}initializeConfiguration(p,k){}}a.ShaderTechnique=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/enums":function(){define(["exports"],function(a){a.ClearBufferBit=void 0;(function(b){b[b.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT";b[b.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT";b[b.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT"})(a.ClearBufferBit||(a.ClearBufferBit={}));a.PrimitiveType=void 0;(function(b){b[b.POINTS=0]="POINTS";b[b.LINES=1]=
"LINES";b[b.LINE_LOOP=2]="LINE_LOOP";b[b.LINE_STRIP=3]="LINE_STRIP";b[b.TRIANGLES=4]="TRIANGLES";b[b.TRIANGLE_STRIP=5]="TRIANGLE_STRIP";b[b.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(a.PrimitiveType||(a.PrimitiveType={}));a.BlendFactor=void 0;(function(b){b[b.ZERO=0]="ZERO";b[b.ONE=1]="ONE";b[b.SRC_COLOR=768]="SRC_COLOR";b[b.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR";b[b.SRC_ALPHA=770]="SRC_ALPHA";b[b.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA";b[b.DST_ALPHA=772]="DST_ALPHA";b[b.ONE_MINUS_DST_ALPHA=
773]="ONE_MINUS_DST_ALPHA";b[b.DST_COLOR=774]="DST_COLOR";b[b.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR";b[b.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE";b[b.CONSTANT_COLOR=32769]="CONSTANT_COLOR";b[b.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR";b[b.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA";b[b.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"})(a.BlendFactor||(a.BlendFactor={}));a.BlendOperation=void 0;(function(b){b[b.ADD=32774]="ADD";b[b.MIN=32775]="MIN";b[b.MAX=32776]=
"MAX";b[b.SUBTRACT=32778]="SUBTRACT";b[b.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"})(a.BlendOperation||(a.BlendOperation={}));a.BufferType=void 0;(function(b){b[b.ARRAY_BUFFER=34962]="ARRAY_BUFFER";b[b.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER";b[b.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER";b[b.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER";b[b.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER";b[b.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER";b[b.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER";b[b.TRANSFORM_FEEDBACK_BUFFER=
35982]="TRANSFORM_FEEDBACK_BUFFER"})(a.BufferType||(a.BufferType={}));a.Face=void 0;(function(b){b[b.FRONT=1028]="FRONT";b[b.BACK=1029]="BACK";b[b.FRONT_AND_BACK=1032]="FRONT_AND_BACK"})(a.Face||(a.Face={}));a.CullMode=void 0;(function(b){b[b.CW=2304]="CW";b[b.CCW=2305]="CCW"})(a.CullMode||(a.CullMode={}));a.DataType=void 0;(function(b){b[b.BYTE=5120]="BYTE";b[b.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE";b[b.SHORT=5122]="SHORT";b[b.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT";b[b.INT=5124]="INT";b[b.UNSIGNED_INT=
5125]="UNSIGNED_INT";b[b.FLOAT=5126]="FLOAT";b[b.HALF_FLOAT=5131]="HALF_FLOAT"})(a.DataType||(a.DataType={}));a.CompareFunction=void 0;(function(b){b[b.NEVER=512]="NEVER";b[b.LESS=513]="LESS";b[b.EQUAL=514]="EQUAL";b[b.LEQUAL=515]="LEQUAL";b[b.GREATER=516]="GREATER";b[b.NOTEQUAL=517]="NOTEQUAL";b[b.GEQUAL=518]="GEQUAL";b[b.ALWAYS=519]="ALWAYS"})(a.CompareFunction||(a.CompareFunction={}));a.StencilOperation=void 0;(function(b){b[b.ZERO=0]="ZERO";b[b.KEEP=7680]="KEEP";b[b.REPLACE=7681]="REPLACE";b[b.INCR=
7682]="INCR";b[b.DECR=7683]="DECR";b[b.INVERT=5386]="INVERT";b[b.INCR_WRAP=34055]="INCR_WRAP";b[b.DECR_WRAP=34056]="DECR_WRAP"})(a.StencilOperation||(a.StencilOperation={}));a.TextureSamplingMode=void 0;(function(b){b[b.NEAREST=9728]="NEAREST";b[b.LINEAR=9729]="LINEAR";b[b.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST";b[b.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST";b[b.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR";b[b.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"})(a.TextureSamplingMode||
(a.TextureSamplingMode={}));a.TextureWrapMode=void 0;(function(b){b[b.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE";b[b.REPEAT=10497]="REPEAT";b[b.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(a.TextureWrapMode||(a.TextureWrapMode={}));a.TextureType=void 0;(function(b){b[b.TEXTURE_2D=3553]="TEXTURE_2D";b[b.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP";b[b.TEXTURE_3D=32879]="TEXTURE_3D";b[b.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X";b[b.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X";
b[b.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y";b[b.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y";b[b.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z";b[b.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z";b[b.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"})(a.TextureType||(a.TextureType={}));a.PixelFormat=void 0;(function(b){b[b.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT";b[b.DEPTH_STENCIL=34041]="DEPTH_STENCIL";b[b.DEPTH24_STENCIL8=35056]=
"DEPTH24_STENCIL8";b[b.ALPHA=6406]="ALPHA";b[b.RGB=6407]="RGB";b[b.RGBA=6408]="RGBA";b[b.LUMINANCE=6409]="LUMINANCE";b[b.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA";b[b.RED=6403]="RED";b[b.RG=33319]="RG";b[b.RED_INTEGER=36244]="RED_INTEGER";b[b.RG_INTEGER=33320]="RG_INTEGER";b[b.RGB_INTEGER=36248]="RGB_INTEGER";b[b.RGBA_INTEGER=36249]="RGBA_INTEGER"})(a.PixelFormat||(a.PixelFormat={}));a.SizedPixelFormat=void 0;(function(b){b[b.RGBA4=32854]="RGBA4";b[b.R16F=33325]="R16F";b[b.RG16F=33327]="RG16F";b[b.RGB32F=
34837]="RGB32F";b[b.RGBA16F=34842]="RGBA16F";b[b.R32F=33326]="R32F";b[b.RG32F=33328]="RG32F";b[b.RGBA32F=34836]="RGBA32F";b[b.R11F_G11F_B10F=35898]="R11F_G11F_B10F";b[b.RGB8=32849]="RGB8";b[b.RGBA8=32856]="RGBA8";b[b.RGB5_A1=32855]="RGB5_A1";b[b.R8=33321]="R8";b[b.RG8=33323]="RG8";b[b.R8I=33329]="R8I";b[b.R8UI=33330]="R8UI";b[b.R16I=33331]="R16I";b[b.R16UI=33332]="R16UI";b[b.R32I=33333]="R32I";b[b.R32UI=33334]="R32UI";b[b.RG8I=33335]="RG8I";b[b.RG8UI=33336]="RG8UI";b[b.RG16I=33337]="RG16I";b[b.RG16UI=
33338]="RG16UI";b[b.RG32I=33339]="RG32I";b[b.RG32UI=33340]="RG32UI";b[b.RGB16F=34843]="RGB16F";b[b.RGB9_E5=35901]="RGB9_E5";b[b.SRGB8=35905]="SRGB8";b[b.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8";b[b.RGB565=36194]="RGB565";b[b.RGBA32UI=36208]="RGBA32UI";b[b.RGB32UI=36209]="RGB32UI";b[b.RGBA16UI=36214]="RGBA16UI";b[b.RGB16UI=36215]="RGB16UI";b[b.RGBA8UI=36220]="RGBA8UI";b[b.RGB8UI=36221]="RGB8UI";b[b.RGBA32I=36226]="RGBA32I";b[b.RGB32I=36227]="RGB32I";b[b.RGBA16I=36232]="RGBA16I";b[b.RGB16I=36233]="RGB16I";
b[b.RGBA8I=36238]="RGBA8I";b[b.RGB8I=36239]="RGB8I";b[b.R8_SNORM=36756]="R8_SNORM";b[b.RG8_SNORM=36757]="RG8_SNORM";b[b.RGB8_SNORM=36758]="RGB8_SNORM";b[b.RGBA8_SNORM=36759]="RGBA8_SNORM";b[b.RGB10_A2=32857]="RGB10_A2";b[b.RGB10_A2UI=36975]="RGB10_A2UI"})(a.SizedPixelFormat||(a.SizedPixelFormat={}));a.PixelType=void 0;(function(b){b[b.FLOAT=5126]="FLOAT";b[b.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE";b[b.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8";b[b.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4";
b[b.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1";b[b.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5";b[b.BYTE=5120]="BYTE";b[b.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT";b[b.SHORT=5122]="SHORT";b[b.UNSIGNED_INT=5125]="UNSIGNED_INT";b[b.INT=5124]="INT";b[b.HALF_FLOAT=5131]="HALF_FLOAT";b[b.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV";b[b.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV";b[b.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV";b[b.FLOAT_32_UNSIGNED_INT_24_8_REV=
36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"})(a.PixelType||(a.PixelType={}));a.RenderbufferFormat=void 0;(function(b){b[b.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16";b[b.STENCIL_INDEX8=36168]="STENCIL_INDEX8";b[b.DEPTH_STENCIL=34041]="DEPTH_STENCIL";b[b.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24";b[b.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F";b[b.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8";b[b.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"})(a.RenderbufferFormat||(a.RenderbufferFormat={}));a.Usage=
void 0;(function(b){b[b.STATIC_DRAW=35044]="STATIC_DRAW";b[b.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW";b[b.STREAM_DRAW=35040]="STREAM_DRAW";b[b.STATIC_READ=35045]="STATIC_READ";b[b.DYNAMIC_READ=35049]="DYNAMIC_READ";b[b.STREAM_READ=35041]="STREAM_READ";b[b.STATIC_COPY=35046]="STATIC_COPY";b[b.DYNAMIC_COPY=35050]="DYNAMIC_COPY";b[b.STREAM_COPY=35042]="STREAM_COPY"})(a.Usage||(a.Usage={}));a.ShaderType=void 0;(function(b){b[b.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER";b[b.VERTEX_SHADER=35633]="VERTEX_SHADER"})(a.ShaderType||
(a.ShaderType={}));a.FramebufferTarget=void 0;(function(b){b[b.FRAMEBUFFER=36160]="FRAMEBUFFER";b[b.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER";b[b.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"})(a.FramebufferTarget||(a.FramebufferTarget={}));a.ResourceType=void 0;(function(b){b[b.Texture=0]="Texture";b[b.BufferObject=1]="BufferObject";b[b.VertexArrayObject=2]="VertexArrayObject";b[b.Shader=3]="Shader";b[b.Program=4]="Program";b[b.FramebufferObject=5]="FramebufferObject";b[b.Renderbuffer=6]="Renderbuffer";
b[b.TransformFeedback=7]="TransformFeedback";b[b.Sync=8]="Sync";b[b.UNCOUNTED=9]="UNCOUNTED";b[b.LinesOfCode=9]="LinesOfCode";b[b.Uniform=10]="Uniform";b[b.COUNT=11]="COUNT"})(a.ResourceType||(a.ResourceType={}));a.ColorAttachment=void 0;(function(b){b[b.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0";b[b.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1";b[b.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2";b[b.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3";b[b.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4";b[b.COLOR_ATTACHMENT5=
36069]="COLOR_ATTACHMENT5";b[b.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6";b[b.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7";b[b.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8";b[b.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9";b[b.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10";b[b.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11";b[b.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12";b[b.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13";b[b.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14";b[b.COLOR_ATTACHMENT15=
36079]="COLOR_ATTACHMENT15"})(a.ColorAttachment||(a.ColorAttachment={}));a.SpecialDrawBuffers=void 0;(function(b){b[b.NONE=0]="NONE";b[b.BACK=1029]="BACK"})(a.SpecialDrawBuffers||(a.SpecialDrawBuffers={}));a.CompressedTextureFormat=void 0;(function(b){b[b.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT";b[b.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT";b[b.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT";b[b.COMPRESSED_RGBA_S3TC_DXT5_EXT=
33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT";b[b.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC";b[b.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC";b[b.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC";b[b.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC";b[b.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2";b[b.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2";b[b.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2";b[b.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=
37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2";b[b.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC";b[b.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"})(a.CompressedTextureFormat||(a.CompressedTextureFormat={}));a.UniformType=void 0;(function(b){b[b.FLOAT=5126]="FLOAT";b[b.FLOAT_VEC2=35664]="FLOAT_VEC2";b[b.FLOAT_VEC3=35665]="FLOAT_VEC3";b[b.FLOAT_VEC4=35666]="FLOAT_VEC4";b[b.INT=5124]="INT";b[b.INT_VEC2=35667]="INT_VEC2";b[b.INT_VEC3=35668]="INT_VEC3";
b[b.INT_VEC4=35669]="INT_VEC4";b[b.BOOL=35670]="BOOL";b[b.BOOL_VEC2=35671]="BOOL_VEC2";b[b.BOOL_VEC3=35672]="BOOL_VEC3";b[b.BOOL_VEC4=35673]="BOOL_VEC4";b[b.FLOAT_MAT2=35674]="FLOAT_MAT2";b[b.FLOAT_MAT3=35675]="FLOAT_MAT3";b[b.FLOAT_MAT4=35676]="FLOAT_MAT4";b[b.SAMPLER_2D=35678]="SAMPLER_2D";b[b.SAMPLER_CUBE=35680]="SAMPLER_CUBE";b[b.UNSIGNED_INT=5125]="UNSIGNED_INT";b[b.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2";b[b.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3";b[b.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4";
b[b.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3";b[b.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4";b[b.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2";b[b.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4";b[b.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2";b[b.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3";b[b.SAMPLER_3D=35679]="SAMPLER_3D";b[b.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW";b[b.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY";b[b.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW";b[b.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW";b[b.INT_SAMPLER_2D=36298]=
"INT_SAMPLER_2D";b[b.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D";b[b.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE";b[b.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY";b[b.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D";b[b.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D";b[b.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE";b[b.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"})(a.UniformType||(a.UniformType={}));a.SyncParameter=void 0;(function(b){b[b.OBJECT_TYPE=
37138]="OBJECT_TYPE";b[b.SYNC_CONDITION=37139]="SYNC_CONDITION";b[b.SYNC_STATUS=37140]="SYNC_STATUS";b[b.SYNC_FLAGS=37141]="SYNC_FLAGS"})(a.SyncParameter||(a.SyncParameter={}));a.SyncStatus=void 0;(function(b){b[b.UNSIGNALED=37144]="UNSIGNALED";b[b.SIGNALED=37145]="SIGNALED"})(a.SyncStatus||(a.SyncStatus={}));a.ClientWaitSyncStatus=void 0;(function(b){b[b.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED";b[b.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED";b[b.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED";b[b.WAIT_FAILED=
37149]="WAIT_FAILED"})(a.ClientWaitSyncStatus||(a.ClientWaitSyncStatus={}));a.SyncCondition=void 0;(function(b){b[b.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"})(a.SyncCondition||(a.SyncCondition={}));a.SyncFlag=void 0;(function(b){b[b.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"})(a.SyncFlag||(a.SyncFlag={}));a.DepthStencilAttachment=33306;a.baseTextureUnit=33984;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations":function(){define(["exports",
"./VertexAttribute"],function(a,b){b=new Map([[b.VertexAttribute.POSITION,0],[b.VertexAttribute.NORMAL,1],[b.VertexAttribute.NORMALCOMPRESSED,1],[b.VertexAttribute.UV0,2],[b.VertexAttribute.COLOR,3],[b.VertexAttribute.COLORFEATUREATTRIBUTE,3],[b.VertexAttribute.SIZE,4],[b.VertexAttribute.TANGENT,4],[b.VertexAttribute.CENTEROFFSETANDDISTANCE,5],[b.VertexAttribute.SYMBOLCOLOR,5],[b.VertexAttribute.FEATUREATTRIBUTE,6],[b.VertexAttribute.INSTANCEFEATUREATTRIBUTE,6],[b.VertexAttribute.INSTANCECOLOR,7],
[b.VertexAttribute.OBJECTANDLAYERIDCOLOR,7],[b.VertexAttribute.INSTANCEOBJECTANDLAYERIDCOLOR,7],[b.VertexAttribute.INSTANCEMODEL,8],[b.VertexAttribute.INSTANCEMODELNORMAL,12],[b.VertexAttribute.INSTANCEMODELORIGINHI,11],[b.VertexAttribute.INSTANCEMODELORIGINLO,15]]);a.Default3D=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Program":function(){define(["exports","../../../../core/PooledArray","../../../webgl/checkWebGLError"],function(a,b,q){class l{constructor(p,
k,h){this._context=p;this._locations=h;this._textures=new Map;this._freeTextureUnits=new b({deallocator:null});this._glProgram=p.programCache.acquire(k.generate("vertex"),k.generate("fragment"),h);this._glProgram.stop=()=>{throw Error("Wrapped _glProgram used directly");};this.bindPass=k.generateBindPass(this);this.bindDraw=k.generateBindDraw(this);this._fragmentUniforms=q.webglDebugEnabled()?k.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(p,
k){this._glProgram.setUniform1i(p,k?1:0)}setUniform1i(p,k){this._glProgram.setUniform1i(p,k)}setUniform1f(p,k){this._glProgram.setUniform1f(p,k)}setUniform2fv(p,k){this._glProgram.setUniform2fv(p,k)}setUniform3fv(p,k){this._glProgram.setUniform3fv(p,k)}setUniform4fv(p,k){this._glProgram.setUniform4fv(p,k)}setUniformMatrix3fv(p,k){this._glProgram.setUniformMatrix3fv(p,k)}setUniformMatrix4fv(p,k){this._glProgram.setUniformMatrix4fv(p,k)}setUniform1fv(p,k){this._glProgram.setUniform1fv(p,k)}setUniform1iv(p,
k){this._glProgram.setUniform1iv(p,k)}setUniform2iv(p,k){this._glProgram.setUniform3iv(p,k)}setUniform3iv(p,k){this._glProgram.setUniform3iv(p,k)}setUniform4iv(p,k){this._glProgram.setUniform4iv(p,k)}assertCompatibleVertexAttributeLocations(p){p.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear();this._freeTextureUnits.clear()}bindTexture(p,k){if(null==k?.glName){if(k=this._textures.get(p))this._context.bindTexture(null,k.unit),this._freeTextureUnit(k),
this._textures.delete(p);return null}let h=this._textures.get(p);null==h?(h=this._allocTextureUnit(k),this._textures.set(p,h)):h.texture=k;this._context.useProgram(this);this.setUniform1i(p,h.unit);this._context.bindTexture(k,h.unit);return h.unit}rebindTextures(){this._context.useProgram(this);this._textures.forEach((p,k)=>{this._context.bindTexture(p.texture,p.unit);this.setUniform1i(k,p.unit)});this._fragmentUniforms?.forEach(p=>{"sampler2D"!==p.type&&"samplerCube"!==p.type||this._textures.has(p.name)||
console.error(`Texture sampler ${p.name} has no bound texture`)})}_allocTextureUnit(p){return{texture:p,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(p){this._freeTextureUnits.push(p.unit)}}a.Program=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/checkWebGLError":function(){define(["exports","../../core/Error","../../core/has","../../core/Logger"],function(a,b,q,l){function p(h,f){switch(f){case h.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";
case h.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case h.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case h.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case h.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case h.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";
default:return"Unknown error"}}const k=!!q("enable-feature:webgl-debug");a.checkWebGLError=function(h){if(k){var f=h.getError();f&&(h=p(h,f),f=Error().stack,l.getLogger("esri.views.webgl.checkWebGLError").error(new b("webgl-error","WebGL error occurred",{message:h,stack:f})))}};a.hasFeatureFlagWebGLDebug=k;a.webglDebugEnabled=function(){return k};a.webglValidateShadersEnabled=function(){return k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/renderState":function(){define(["exports",
"../3d/webgl-engine/lib/basicInterfaces","./enums"],function(a,b,q){function l(K){return D.intern(K)}function p(K){return F.intern(K)}function k(K){return H.intern(K)}function h(K){return N.intern(K)}function f(K){return E.intern(K)}function c(K){return G.intern(K)}function e(K){return I.intern(K)}function g(K){return O.intern(K)}function d(K){return L.intern(K)}function t(K){return"["+K.join(",")+"]"}function w(K){return K?t([K.srcRgb,K.srcAlpha,K.dstRgb,K.dstAlpha,K.opRgb,K.opAlpha,K.color.r,K.color.g,
K.color.b,K.color.a]):null}function v(K){return K?t([K.face,K.mode]):null}function m(K){return K?t([K.factor,K.units]):null}function r(K){return K?t([K.func]):null}function n(K){return K?t([K.function.func,K.function.ref,K.function.mask,K.operation.fail,K.operation.zFail,K.operation.zPass]):null}function u(K){return K?t([K.zNear,K.zFar]):null}function x(K){return K?t([K.r,K.g,K.b,K.a]):null}function y(K){return K?t([K.mask]):null}function z(K){return K?t(K.buffers):null}const A={face:q.Face.BACK,
mode:q.CullMode.CCW},B={face:q.Face.FRONT,mode:q.CullMode.CCW};class C{constructor(K,J){this._makeKey=K;this._makeRef=J;this._interns=new Map}intern(K){if(!K)return null;const J=this._makeKey(K),R=this._interns;R.has(J)||R.set(J,this._makeRef(K));return R.get(J)??null}}const D=new C(w,K=>({__tag:"Blending",...K})),F=new C(v,K=>({__tag:"Culling",...K})),H=new C(m,K=>({__tag:"PolygonOffset",...K})),N=new C(r,K=>({__tag:"DepthTest",...K})),E=new C(n,K=>({__tag:"StencilTest",...K})),G=new C(u,K=>({__tag:"DepthWrite",
...K})),I=new C(x,K=>({__tag:"ColorWrite",...K})),O=new C(y,K=>({__tag:"StencilWrite",...K})),L=new C(z,K=>({__tag:"DrawBuffers",...K})),P=new C(function(K){return K?t([w(K.blending),v(K.culling),m(K.polygonOffset),r(K.depthTest),n(K.stencilTest),u(K.depthWrite),x(K.colorWrite),y(K.stencilWrite),z(K.drawBuffers)]):null},K=>({blending:l(K.blending),culling:p(K.culling),polygonOffset:k(K.polygonOffset),depthTest:h(K.depthTest),stencilTest:f(K.stencilTest),depthWrite:c(K.depthWrite),colorWrite:e(K.colorWrite),
stencilWrite:g(K.stencilWrite),drawBuffers:d(K.drawBuffers)}));class M{constructor(K){this._drawBuffersInvalid=this._stencilWriteInvalid=this._colorWriteInvalid=this._depthWriteInvalid=this._stencilTestInvalid=this._depthTestInvalid=this._polygonOffsetInvalid=this._cullingInvalid=this._blendingInvalid=this._pipelineInvalid=!0;this._stateSetters=K}setPipeline(K){if(this._pipelineInvalid||K!==this._pipeline)this._setBlending(K.blending),this._setCulling(K.culling),this._setPolygonOffset(K.polygonOffset),
this._setDepthTest(K.depthTest),this._setStencilTest(K.stencilTest),this._setDepthWrite(K.depthWrite),this._setColorWrite(K.colorWrite),this._setStencilWrite(K.stencilWrite),this._setDrawBuffers(K.drawBuffers),this._pipeline=K;this._pipelineInvalid=!1}invalidateBlending(){this._pipelineInvalid=this._blendingInvalid=!0}invalidateCulling(){this._pipelineInvalid=this._cullingInvalid=!0}invalidatePolygonOffset(){this._pipelineInvalid=this._polygonOffsetInvalid=!0}invalidateDepthTest(){this._pipelineInvalid=
this._depthTestInvalid=!0}invalidateStencilTest(){this._pipelineInvalid=this._stencilTestInvalid=!0}invalidateDepthWrite(){this._pipelineInvalid=this._depthWriteInvalid=!0}invalidateColorWrite(){this._pipelineInvalid=this._colorWriteInvalid=!0}invalidateStencilWrite(){this._pipelineInvalid=this._stencilTestInvalid=!0}invalidateDrawBuffers(){this._pipelineInvalid=this._drawBuffersInvalid=!0}_setBlending(K){this._blending=this._setSubState(K,this._blending,this._blendingInvalid,this._stateSetters.setBlending);
this._blendingInvalid=!1}_setCulling(K){this._culling=this._setSubState(K,this._culling,this._cullingInvalid,this._stateSetters.setCulling);this._cullingInvalid=!1}_setPolygonOffset(K){this._polygonOffset=this._setSubState(K,this._polygonOffset,this._polygonOffsetInvalid,this._stateSetters.setPolygonOffset);this._polygonOffsetInvalid=!1}_setDepthTest(K){this._depthTest=this._setSubState(K,this._depthTest,this._depthTestInvalid,this._stateSetters.setDepthTest);this._depthTestInvalid=!1}_setStencilTest(K){this._stencilTest=
this._setSubState(K,this._stencilTest,this._stencilTestInvalid,this._stateSetters.setStencilTest);this._stencilTestInvalid=!1}_setDepthWrite(K){this._depthWrite=this._setSubState(K,this._depthWrite,this._depthWriteInvalid,this._stateSetters.setDepthWrite);this._depthWriteInvalid=!1}_setColorWrite(K){this._colorWrite=this._setSubState(K,this._colorWrite,this._colorWriteInvalid,this._stateSetters.setColorWrite);this._colorWriteInvalid=!1}_setStencilWrite(K){this._stencilWrite=this._setSubState(K,this._stencilWrite,
this._stencilWriteInvalid,this._stateSetters.setStencilWrite);this._stencilTestInvalid=!1}_setDrawBuffers(K){this._drawBuffers=this._setSubState(K,this._drawBuffers,this._drawBuffersInvalid,this._stateSetters.setDrawBuffers);this._drawBuffersInvalid=!1}_setSubState(K,J,R,Q){if(R||K!==J)Q(K),this._pipelineInvalid=!0;return K}}a.StateTracker=M;a.backFaceCullingParams=A;a.cullingParams=K=>K===b.CullFaceOptions.Back?A:K===b.CullFaceOptions.Front?B:null;a.defaultColorWriteParams={r:!0,g:!0,b:!0,a:!0};
a.defaultDepthWriteParams={zNear:0,zFar:1};a.frontFaceCullingParams=B;a.makeBlending=l;a.makeColorWrite=e;a.makeCulling=p;a.makeDepthTest=h;a.makeDepthWrite=c;a.makeDrawBuffers=d;a.makePipelineState=function(K){return P.intern(K)};a.makePolygonOffset=k;a.makeStencilTest=f;a.makeStencilWrite=g;a.separateBlendingParams=function(K,J,R,Q,W=q.BlendOperation.ADD,S=q.BlendOperation.ADD,V=[0,0,0,0]){return{srcRgb:K,srcAlpha:J,dstRgb:R,dstAlpha:Q,opRgb:W,opAlpha:S,color:{r:V[0],g:V[1],b:V[2],a:V[3]}}};a.simpleBlendingParams=
function(K,J,R=q.BlendOperation.ADD,Q=[0,0,0,0]){return{srcRgb:K,srcAlpha:K,dstRgb:J,dstAlpha:J,opRgb:R,opAlpha:R,color:{r:Q[0],g:Q[1],b:Q[2],a:Q[3]}}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/basicInterfaces":function(){define(["exports"],function(a){a.CullFaceOptions=void 0;(function(b){b[b.None=0]="None";b[b.Front=1]="Front";b[b.Back=2]="Back";b[b.COUNT=3]="COUNT"})(a.CullFaceOptions||(a.CullFaceOptions={}));a.DepthTestFunction=void 0;(function(b){b[b.Less=
0]="Less";b[b.Lequal=1]="Lequal";b[b.COUNT=2]="COUNT"})(a.DepthTestFunction||(a.DepthTestFunction={}));a.RenderRequestType=void 0;(function(b){b[b.BACKGROUND=0]="BACKGROUND";b[b.UPDATE=1]="UPDATE"})(a.RenderRequestType||(a.RenderRequestType={}));a.ResourceState=void 0;(function(b){b[b.NOT_LOADED=0]="NOT_LOADED";b[b.LOADING=1]="LOADING";b[b.LOADED=2]="LOADED"})(a.ResourceState||(a.ResourceState={}));a.StencilBits=void 0;(function(b){b[b.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded";b[b.OutlineVisualElementMask=
2]="OutlineVisualElementMask"})(a.StencilBits||(a.StencilBits={}));a.Object3DState=void 0;(function(b){b[b.Highlight=0]="Highlight";b[b.MaskOccludee=1]="MaskOccludee";b[b.COUNT=2]="COUNT"})(a.Object3DState||(a.Object3DState={}));a.AlphaDiscardMode=void 0;(function(b){b[b.Blend=0]="Blend";b[b.Opaque=1]="Opaque";b[b.Mask=2]="Mask";b[b.MaskBlend=3]="MaskBlend";b[b.COUNT=4]="COUNT"})(a.AlphaDiscardMode||(a.AlphaDiscardMode={}));a.Decorations=void 0;(function(b){b[b.OFF=0]="OFF";b[b.ON=1]="ON"})(a.Decorations||
(a.Decorations={}));a.TextureEncodingMimeType=void 0;(function(b){b.DDS_ENCODING="image/vnd-ms.dds";b.KTX2_ENCODING="image/ktx2";b.BASIS_ENCODING="image/x.basis"})(a.TextureEncodingMimeType||(a.TextureEncodingMimeType={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/ChapmanAtmosphereTechniqueConfiguration":function(){define(["exports","../../../chunks/tslib.es6","../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q){class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);
this.haze=!1}}b.__decorate([q.parameter()],l.prototype,"haze",void 0);class p extends l{constructor(){super(...arguments);this.reduced=!1}}b.__decorate([q.parameter()],p.prototype,"reduced",void 0);a.AtmosphereCompositingTechniqueConfiguration=l;a.ChapmanAtmosphereTechniqueConfiguration=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration":function(){define(["exports","../shaderModules/interfaces"],function(a,
b){class q extends b.NoParameters{constructor(){super();this._key="";this._keyDirty=!1;this._parameterBits=this._parameterBits?this._parameterBits.map(()=>0):[];this._parameterNames||(this._parameterNames=[])}get key(){this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits));return this._key}snapshot(){const l=this._parameterNames,p={key:this.key};for(const k of l)p[k]=this[k];return p}}a.ShaderTechniqueConfiguration=q;a.parameter=function(l={}){return(p,
k)=>{p._parameterNames=p._parameterNames??[];p._parameterNames.push(k);if(null!=l.constValue)Object.defineProperty(p,k,{get(){return l.constValue}});else{const h=p._parameterNames.length-1,f=Math.ceil(Math.log2(l.count||2)),c=p._parameterBits??[0];let e=0;for(;16<c[e]+f;)e++,e>=c.length&&c.push(0);p._parameterBits=c;const g=c[e],d=(1<<f)-1<<g;c[e]+=f;Object.defineProperty(p,k,{get(){return this[h]},set(t){if(this[h]!==t&&(this[h]=t,this._keyDirty=!0,this._parameterBits[e]=this._parameterBits[e]&~d|
+t<<g&d,"number"!==typeof t&&"boolean"!==typeof t))throw Error("Configuration value for "+k+" must be boolean or number, got "+typeof t);}})}}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/formats":function(){define(["exports"],function(a){a.ColorFormat=void 0;(function(b){b[b.RED=0]="RED";b[b.RG=1]="RG";b[b.RGBA4=2]="RGBA4";b[b.RGBA=3]="RGBA";b[b.RGBA_MIPMAP=4]="RGBA_MIPMAP";b[b.R16F=5]="R16F";b[b.RGBA16F=6]="RGBA16F"})(a.ColorFormat||(a.ColorFormat={}));a.DepthFormat=
void 0;(function(b){b[b.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE";b[b.DEPTH16_BUFFER=1]="DEPTH16_BUFFER"})(a.DepthFormat||(a.DepthFormat={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts":function(){define(["exports","./VertexAttribute","../../../webgl/enums","../../../webgl/VertexElementDescriptor"],function(a,b,q,l){const p=[new l.VertexElementDescriptor(b.VertexAttribute.POSITION,3,q.DataType.FLOAT,0,12)],k=[new l.VertexElementDescriptor(b.VertexAttribute.POSITION,
2,q.DataType.FLOAT,0,8)];b=[new l.VertexElementDescriptor(b.VertexAttribute.POSITION,2,q.DataType.FLOAT,0,16),new l.VertexElementDescriptor(b.VertexAttribute.UV0,2,q.DataType.FLOAT,8,16)];a.Pos2=k;a.Pos2Tex=b;a.Pos3=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/VertexElementDescriptor":function(){define(["exports"],function(a){class b{constructor(q,l,p,k,h,f=!1,c=0){this.name=q;this.count=l;this.type=p;this.offset=k;this.stride=h;this.normalized=f;this.divisor=
c}}a.VertexElementDescriptor=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/glUtil3D":function(){define("exports ./DefaultVertexAttributeLocations ./DefaultVertexBufferLayouts ./VertexArrayObject ../../../webgl/BufferObject ../../../webgl/enums ../../../webgl/Texture ../../../webgl/TextureDescriptor".split(" "),function(a,b,q,l,p,k,h,f){a.createEmptyTexture=function(c){const e=new f.TextureDescriptor(4);e.samplingMode=k.TextureSamplingMode.NEAREST;
return new h.Texture(c,e)};a.createQuadVAO=function(c,e=q.Pos2,g=b.Default3D,d=-1,t=1){let w=null;switch(e){case q.Pos2Tex:w=new Float32Array([d,d,0,0,t,d,1,0,d,t,0,1,t,t,1,1]);break;default:w=new Float32Array([d,d,t,d,d,t,t,t])}return new l.VertexArrayObject(c,g,{geometry:e},{geometry:p.BufferObject.createVertex(c,k.Usage.STATIC_DRAW,w)})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/VertexArrayObject":function(){define(["exports","../../../webgl/VertexArrayObject"],
function(a,b){class q extends b.VertexArrayObject{}a.VertexArrayObject=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/VertexArrayObject":function(){define("exports ../../core/Logger ../../core/maybe ../../core/typedArrayUtil ./enums ./Util".split(" "),function(a,b,q,l,p,k){const h=()=>b.getLogger("esri.views.webgl.VertexArrayObject");a.VertexArrayObject=class{constructor(f,c,e,g,d=null){this._context=f;this._locations=c;this._layout=e;this._buffers=g;this._indexBuffer=
d;this._glName=null;this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Object.keys(this._buffers).reduce((f,c)=>f+this._buffers[c].usedMemory,null!=this._indexBuffer?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?
1:0))*l.typedArrayStaticSize}dispose(){if(this._context){this._context.getBoundVAO()===this&&this._context.bindVAO(null);for(const f in this._buffers)this._buffers[f]?.dispose(),delete this._buffers[f];this._indexBuffer=q.disposeMaybe(this._indexBuffer);this.disposeVAOOnly()}else(this._glName||0<Object.getOwnPropertyNames(this._buffers).length)&&h().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(p.ResourceType.VertexArrayObject,
this));this._context=null}initialize(){if(!this._initialized){var {gl:f}=this._context,c=f.createVertexArray();f.bindVertexArray(c);this._bindLayout();f.bindVertexArray(null);this._glName=c;this._context.instanceCounter.increment(p.ResourceType.VertexArrayObject,this);this._initialized=!0}}bind(){this.initialize();this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const {_buffers:f,_layout:c,_indexBuffer:e}=this;f||h().error("Vertex buffer dictionary is empty!");const g=this._context.gl;
for(const d in f){const t=f[d];t||h().error("Vertex buffer is uninitialized!");const w=c[d];w||h().error("Vertex element descriptor is empty!");k.bindVertexBufferLayout(this._context,this._locations,t,w)}null!=e&&g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,e.glName)}unbind(){this.initialize();this._context.gl.bindVertexArray(null)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Util":function(){define(["exports","../../core/has","./checkWebGLError","./enums","./getDataTypeBytes"],
function(a,b,q,l,p){function k(f){f=f.gl;switch(f.getError()){case f.NO_ERROR:return null;case f.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case f.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case f.INVALID_OPERATION:return"The specified command is not allowed for the current state";case f.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case f.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";
case f.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function h(f){return f[0].stride}a.bindVertexBufferLayout=function(f,c,e,g,d=0){const t=f.gl;f.bindBuffer(e);for(const v of g)if(g=c.get(v.name),void 0===g)console.warn(`There is no location for vertex attribute '${v.name}' defined.`);else{e=d*v.stride;if(4>=v.count)t.vertexAttribPointer(g,v.count,v.type,v.normalized,v.stride,v.offset+e),t.enableVertexAttribArray(g),0<v.divisor&&f.gl.vertexAttribDivisor(g,v.divisor);else if(9===
v.count)for(var w=0;3>w;w++)t.vertexAttribPointer(g+w,3,v.type,v.normalized,v.stride,v.offset+12*w+e),t.enableVertexAttribArray(g+w),0<v.divisor&&f.gl.vertexAttribDivisor(g+w,v.divisor);else if(16===v.count)for(w=0;4>w;w++)t.vertexAttribPointer(g+w,4,v.type,v.normalized,v.stride,v.offset+16*w+e),t.enableVertexAttribArray(g+w),0<v.divisor&&f.gl?.vertexAttribDivisor(g+w,v.divisor);else console.error("Unsupported vertex attribute element count: "+v.count);if(q.webglDebugEnabled()){g=k(f);w=p.getDataTypeBytes(v.type);
const m=v.offset;w=Math.round(w/m)!==w/m?`. Offset not a multiple of stride. DataType requires ${w} bytes, but descriptor has an offset of ${m}`:"";g&&console.error(`Unable to bind vertex attribute "${v.name}" with baseInstanceOffset ${e}${w}:`,g,v)}}};a.getBytesPerElementFormat=function(f){switch(f){case l.PixelFormat.ALPHA:case l.PixelFormat.LUMINANCE:case l.PixelFormat.RED:case l.PixelFormat.RED_INTEGER:case l.SizedPixelFormat.R8:case l.SizedPixelFormat.R8I:case l.SizedPixelFormat.R8UI:case l.SizedPixelFormat.R8_SNORM:case l.RenderbufferFormat.STENCIL_INDEX8:return 1;
case l.PixelFormat.LUMINANCE_ALPHA:case l.PixelFormat.RG:case l.PixelFormat.RG_INTEGER:case l.SizedPixelFormat.RGBA4:case l.SizedPixelFormat.R16F:case l.SizedPixelFormat.R16I:case l.SizedPixelFormat.R16UI:case l.SizedPixelFormat.RG8:case l.SizedPixelFormat.RG8I:case l.SizedPixelFormat.RG8UI:case l.SizedPixelFormat.RG8_SNORM:case l.SizedPixelFormat.RGB565:case l.SizedPixelFormat.RGB5_A1:case l.RenderbufferFormat.DEPTH_COMPONENT16:return 2;case l.PixelFormat.DEPTH_COMPONENT:case l.PixelFormat.RGB:case l.PixelFormat.RGB_INTEGER:case l.SizedPixelFormat.RGB8:case l.SizedPixelFormat.RGB8I:case l.SizedPixelFormat.RGB8UI:case l.SizedPixelFormat.RGB8_SNORM:case l.SizedPixelFormat.SRGB8:case l.RenderbufferFormat.DEPTH_COMPONENT24:return 3;
case l.PixelFormat.DEPTH_STENCIL:case l.PixelFormat.DEPTH24_STENCIL8:case l.PixelFormat.RGBA:case l.PixelFormat.RGBA_INTEGER:case l.SizedPixelFormat.RGBA8:case l.SizedPixelFormat.R32F:case l.SizedPixelFormat.R11F_G11F_B10F:case l.SizedPixelFormat.RG16F:case l.SizedPixelFormat.R32I:case l.SizedPixelFormat.R32UI:case l.SizedPixelFormat.RG16I:case l.SizedPixelFormat.RG16UI:case l.SizedPixelFormat.RGBA8I:case l.SizedPixelFormat.RGBA8UI:case l.SizedPixelFormat.RGBA8_SNORM:case l.SizedPixelFormat.SRGB8_ALPHA8:case l.SizedPixelFormat.RGB9_E5:case l.SizedPixelFormat.RGB10_A2UI:case l.SizedPixelFormat.RGB10_A2:case l.RenderbufferFormat.DEPTH_STENCIL:case l.RenderbufferFormat.DEPTH_COMPONENT32F:case l.RenderbufferFormat.DEPTH24_STENCIL8:return 4;
case l.RenderbufferFormat.DEPTH32F_STENCIL8:return 5;case l.SizedPixelFormat.RGB16F:case l.SizedPixelFormat.RGB16I:case l.SizedPixelFormat.RGB16UI:return 6;case l.SizedPixelFormat.RG32F:case l.SizedPixelFormat.RG32I:case l.SizedPixelFormat.RG32UI:case l.SizedPixelFormat.RGBA16F:case l.SizedPixelFormat.RGBA16I:case l.SizedPixelFormat.RGBA16UI:return 8;case l.SizedPixelFormat.RGB32F:case l.SizedPixelFormat.RGB32I:case l.SizedPixelFormat.RGB32UI:return 12;case l.SizedPixelFormat.RGBA32F:case l.SizedPixelFormat.RGBA32I:case l.SizedPixelFormat.RGBA32UI:return 16;
case l.CompressedTextureFormat.COMPRESSED_RGB_S3TC_DXT1_EXT:case l.CompressedTextureFormat.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case l.CompressedTextureFormat.COMPRESSED_RGBA_S3TC_DXT3_EXT:case l.CompressedTextureFormat.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case l.CompressedTextureFormat.COMPRESSED_R11_EAC:case l.CompressedTextureFormat.COMPRESSED_SIGNED_R11_EAC:case l.CompressedTextureFormat.COMPRESSED_RGB8_ETC2:case l.CompressedTextureFormat.COMPRESSED_SRGB8_ETC2:case l.CompressedTextureFormat.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case l.CompressedTextureFormat.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;
case l.CompressedTextureFormat.COMPRESSED_RG11_EAC:case l.CompressedTextureFormat.COMPRESSED_SIGNED_RG11_EAC:case l.CompressedTextureFormat.COMPRESSED_RGBA8_ETC2_EAC:case l.CompressedTextureFormat.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0};a.getErrorString=k;a.getStride=h;a.unbindVertexBufferLayout=function(f,c,e,g){const d=f.gl;f.bindBuffer(e);for(const t of g)if(e=c.get(t.name),4>=t.count)d.disableVertexAttribArray(e),t.divisor&&0<t.divisor&&f.gl?.vertexAttribDivisor(e,0);else if(9===t.count)for(g=
0;3>g;g++)d.disableVertexAttribArray(e+g),t.divisor&&0<t.divisor&&f.gl?.vertexAttribDivisor(e+g,0);else if(16===t.count)for(g=0;4>g;g++)d.disableVertexAttribArray(e+g),t.divisor&&0<t.divisor&&f.gl?.vertexAttribDivisor(e+g,0);else console.error("Unsupported vertex attribute element count: "+t.count);f.unbindBuffer(l.BufferType.ARRAY_BUFFER)};a.vertexCount=function(f,c){return f.vertexBuffers[c].usedMemory/h(f.layout[c])};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/getDataTypeBytes":function(){define(["exports",
"./enums"],function(a,b){a.getDataTypeBytes=function(q){switch(q){case b.DataType.BYTE:case b.DataType.UNSIGNED_BYTE:return 1;case b.DataType.SHORT:case b.DataType.UNSIGNED_SHORT:case b.DataType.HALF_FLOAT:return 2;case b.DataType.FLOAT:case b.DataType.INT:case b.DataType.UNSIGNED_INT:return 4}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/BufferObject":function(){define("exports ../../core/arrayUtils ../../core/has ../../core/Logger ../../core/typedArrayUtil ./checkWebGLError ./enums".split(" "),
function(a,b,q,l,p,k,h){class f{static createIndex(c,e,g){return new f(c,h.BufferType.ELEMENT_ARRAY_BUFFER,e,g)}static createVertex(c,e,g){return new f(c,h.BufferType.ARRAY_BUFFER,e,g)}static createUniform(c,e,g){return new f(c,h.BufferType.UNIFORM_BUFFER,e,g)}static createPixelPack(c,e=h.Usage.STREAM_READ,g){c=new f(c,h.BufferType.PIXEL_PACK_BUFFER,e);g&&c.setSize(g);return c}static createPixelUnpack(c,e=h.Usage.STREAM_DRAW,g){return new f(c,h.BufferType.PIXEL_UNPACK_BUFFER,e,g)}static createTransformFeedback(c,
e=h.Usage.STATIC_DRAW,g){c=new f(c,h.BufferType.TRANSFORM_FEEDBACK_BUFFER,e);c.setSize(g);return c}constructor(c,e,g,d){this._context=c;this.bufferType=e;this.usage=g;this._glName=null;this._size=-1;this._indexType=void 0;c.instanceCounter.increment(h.ResourceType.BufferObject,this);this._glName=this._context.gl.createBuffer();k.checkWebGLError(this._context.gl);d&&this.setData(d)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get usedMemory(){return this.bufferType===
h.BufferType.ELEMENT_ARRAY_BUFFER?this._indexType===h.DataType.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===h.BufferType.ELEMENT_ARRAY_BUFFER||this.bufferType===h.BufferType.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(h.ResourceType.BufferObject,this),this._context=null):this._glName&&l.getLogger("esri.views.webgl.BufferObject").warn("Leaked WebGL buffer object")}setSize(c,
e=null){if(this.bufferType===h.BufferType.ELEMENT_ARRAY_BUFFER&&null!=e)switch(this._indexType=e,e){case h.DataType.UNSIGNED_SHORT:c*=2;break;case h.DataType.UNSIGNED_INT:c*=4}this._setBufferData(c)}setData(c){if(c){var e=c.byteLength;this.bufferType===h.BufferType.ELEMENT_ARRAY_BUFFER&&(p.isUint16Array(c)&&(e/=2,this._indexType=h.DataType.UNSIGNED_SHORT),p.isUint32Array(c)&&(e/=4,this._indexType=h.DataType.UNSIGNED_INT));this._setBufferData(e,c)}}_setBufferData(c,e=null){this._size=c;const g=this._context.getBoundVAO();
this._isVAOAware&&this._context.bindVAO(null);this._context.bindBuffer(this);const d=this._context.gl;null!=e?d.bufferData(this.bufferType,e,this.usage):d.bufferData(this.bufferType,c,this.usage);k.checkWebGLError(d);this._isVAOAware&&this._context.bindVAO(g)}setSubData(c,e,g,d){if(c){var t=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null);this._context.bindBuffer(this);var {gl:w}=this._context;w.bufferSubData(this.bufferType,e*c.BYTES_PER_ELEMENT,c,g,d-g);k.checkWebGLError(w);
this._isVAOAware&&this._context.bindVAO(t)}}getSubData(c,e=0,g,d){if(!(0>g||0>d)){var t=b.isArrayLike(c)?c.BYTES_PER_ELEMENT:1;t*((g??0)+(d??0))>c.byteLength||(e+t*(d??0)>this.usedMemory&&l.getLogger("esri.views.webgl.BufferObject").warn("Potential problem getting subdata: requested data exceeds buffer size!"),t=this._context.gl,this.bufferType===h.BufferType.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,h.BufferType.TRANSFORM_FEEDBACK_BUFFER),t.getBufferSubData(h.BufferType.TRANSFORM_FEEDBACK_BUFFER,
e,c,g,d),this._context.unbindBuffer(h.BufferType.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,h.BufferType.COPY_READ_BUFFER),t.getBufferSubData(h.BufferType.COPY_READ_BUFFER,e,c,g,d),this._context.unbindBuffer(h.BufferType.COPY_READ_BUFFER)))}}async getSubDataAsync(c,e=0,g,d){await this._context.clientWaitAsync();this.getSubData(c,e,g,d)}}a.BufferObject=f;a.tracer=null;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Texture":function(){define("exports ../../core/Error ../../core/has ./checkWebGLError ./enums ./GLObjectType ./TextureDescriptor ./ValidatedTextureDescriptor".split(" "),
function(a,b,q,l,p,k,h,f){function c(r){(null!=r.width&&0>r.width||null!=r.height&&0>r.height||null!=r.depth&&0>r.depth)&&console.error("Negative dimension parameters are not allowed!")}function e(r,n){let u=n.samplingMode,x=n.samplingMode;if(u===p.TextureSamplingMode.LINEAR_MIPMAP_NEAREST||u===p.TextureSamplingMode.LINEAR_MIPMAP_LINEAR)u=p.TextureSamplingMode.LINEAR,n.hasMipmap||(x=p.TextureSamplingMode.LINEAR);else if(u===p.TextureSamplingMode.NEAREST_MIPMAP_NEAREST||u===p.TextureSamplingMode.NEAREST_MIPMAP_LINEAR)u=
p.TextureSamplingMode.NEAREST,n.hasMipmap||(x=p.TextureSamplingMode.NEAREST);r.texParameteri(n.target,r.TEXTURE_MAG_FILTER,u);r.texParameteri(n.target,r.TEXTURE_MIN_FILTER,x)}function g(r,n){"number"===typeof n.wrapMode?(r.texParameteri(n.target,r.TEXTURE_WRAP_S,n.wrapMode),r.texParameteri(n.target,r.TEXTURE_WRAP_T,n.wrapMode)):(r.texParameteri(n.target,r.TEXTURE_WRAP_S,n.wrapMode.s),r.texParameteri(n.target,r.TEXTURE_WRAP_T,n.wrapMode.t))}function d(r,n){const u=r.capabilities.textureFilterAnisotropic;
u&&r.gl.texParameterf(n.target,u.TEXTURE_MAX_ANISOTROPY,n.maxAnisotropy??1)}function t(r){return null!=r&&"type"in r&&"compressed"===r.type}function w(r){return null!=r&&!t(r)&&!(null!=r&&"byteLength"in r)}function v(r){return r===p.TextureType.TEXTURE_3D||r===p.TextureType.TEXTURE_2D_ARRAY}function m(r,n,u,x=1){n=Math.max(n,u);r===p.TextureType.TEXTURE_3D&&(n=Math.max(n,x));return Math.round(Math.log(n)/Math.LN2)+1}q=class r{constructor(n,u=null,x=null){this.type=k.GLObjectType.Texture;this._glName=
null;this._wasImmutablyAllocated=this._wrapModeDirty=this._samplingModeDirty=!1;if("context"in n)this._descriptor=n,x=u;else{n=f.ValidatedTextureDescriptor.validate(n,u);if(!n)throw new b("Texture descriptor invalid");this._descriptor=n}this._descriptor.target===p.TextureType.TEXTURE_CUBE_MAP?this._setDataCubeMap(x):this.setData(x)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return h.estimateMemory(this._descriptor)}get isDirty(){return this._samplingModeDirty||
this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(p.ResourceType.Texture,this);this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(n,u){const x=this._descriptor;if(x.width!==n||x.height!==u){if(this._wasImmutablyAllocated)throw new b("Immutable textures can't be resized!");x.width=n;x.height=u;this._descriptor.target===
p.TextureType.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(n=null){for(let u=p.TextureType.TEXTURE_CUBE_MAP_POSITIVE_X;u<=p.TextureType.TEXTURE_CUBE_MAP_NEGATIVE_Z;u++)this._setData(n,u)}setData(n){this._setData(n)}_setData(n,u){if(this._descriptor.context?.gl){var x=this._descriptor.context.gl;l.checkWebGLError(x);this._glName||(this._glName=x.createTexture())&&this._descriptor.context.instanceCounter.increment(p.ResourceType.Texture,this);void 0===n&&(n=null);
var y=this._descriptor,z=u??y.target,A=v(z);null===n&&(y.width=y.width||4,y.height=y.height||4,A&&(y.depth=y.depth??1));u=this._descriptor.context.bindTexture(this,r.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(r.TEXTURE_UNIT_FOR_UPDATES);c(y);this._configurePixelStorage();l.checkWebGLError(x);var B=this._deriveInternalFormat();if(w(n)){let C="width"in n?n.width:n.codedWidth,D="height"in n?n.height:n.codedHeight;n instanceof HTMLVideoElement&&(C=n.videoWidth,D=n.videoHeight);
y.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(z,B,y.hasMipmap,C,D,1);this._texImage(z,0,B,C,D,1,n);l.checkWebGLError(x);y.hasMipmap&&this.generateMipmap();y.width||(y.width=C);y.height||(y.height=D);A&&!y.depth&&(y.depth=1)}else{const {width:C,height:D,depth:F}=y;if(null==C||null==D)throw new b("Width and height must be specified!");if(A&&null==F)throw new b("Depth must be specified!");y.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(z,B,y.hasMipmap,C,D,F);if(t(n)){const H=
n.levels;n=m(z,C,D,F);n=Math.min(n-1,H.length-1);x.texParameteri(y.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,n);if(!(B in p.CompressedTextureFormat))throw new b("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((N,E,G,I)=>{this._compressedTexImage(z,N,B,E,G,I,H[Math.min(N,H.length-1)])},n)}else this._texImage(z,0,B,C,D,F,n),l.checkWebGLError(x),y.hasMipmap&&this.generateMipmap()}e(x,this._descriptor);g(x,this._descriptor);d(this._descriptor.context,
this._descriptor);l.checkWebGLError(x);this._descriptor.context.bindTexture(u,r.TEXTURE_UNIT_FOR_UPDATES)}}updateData(n,u,x,y,z,A,B=0){A||console.error("An attempt to use uninitialized data!");this._glName||console.error("An attempt to update uninitialized texture!");var C=this._descriptor;const D=this._deriveInternalFormat(),{context:F,pixelFormat:H,dataType:N,target:E,isImmutable:G}=C;if(G&&!this._wasImmutablyAllocated)throw new b("Cannot update immutable texture before allocation!");const I=F.bindTexture(this,
r.TEXTURE_UNIT_FOR_UPDATES,!0);(0>u||0>x||u+y>C.width||x+z>C.height)&&console.error("An attempt to update out of bounds of the texture!");this._configurePixelStorage();({gl:C}=F);B&&C.pixelStorei(C.UNPACK_SKIP_ROWS,B);w(A)?C.texSubImage2D(E,n,u,x,y,z,H,N,A):t(A)?C.compressedTexSubImage2D(E,n,u,x,y,z,D,A.levels[n]):C.texSubImage2D(E,n,u,x,y,z,H,N,A);B&&C.pixelStorei(C.UNPACK_SKIP_ROWS,0);F.bindTexture(I,r.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(n,u,x,y,z,A,B,C){C||console.error("An attempt to use uninitialized data!");
this._glName||console.error("An attempt to update uninitialized texture!");var D=this._descriptor;const F=this._deriveInternalFormat(),{context:H,pixelFormat:N,dataType:E,isImmutable:G,target:I}=D;if(G&&!this._wasImmutablyAllocated)throw new b("Cannot update immutable texture before allocation!");v(I)||console.warn("Attempting to set 3D texture data on a non-3D texture");const O=H.bindTexture(this,r.TEXTURE_UNIT_FOR_UPDATES);H.setActiveTexture(r.TEXTURE_UNIT_FOR_UPDATES);(0>u||0>x||0>y||u+z>D.width||
x+A>D.height||y+B>D.depth)&&console.error("An attempt to update out of bounds of the texture!");this._configurePixelStorage();({gl:D}=H);t(C)?(C=C.levels[n],D.compressedTexSubImage3D(I,n,u,x,y,z,A,B,F,C)):D.texSubImage3D(I,n,u,x,y,z,A,B,N,E,C);H.bindTexture(O,r.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const n=this._descriptor;if(!n.hasMipmap){if(this._wasImmutablyAllocated)throw new b("Cannot add mipmaps to immutable texture after allocation");this._samplingModeDirty=n.hasMipmap=!0;c(n)}n.samplingMode===
p.TextureSamplingMode.LINEAR?(this._samplingModeDirty=!0,n.samplingMode=p.TextureSamplingMode.LINEAR_MIPMAP_NEAREST):n.samplingMode===p.TextureSamplingMode.NEAREST&&(this._samplingModeDirty=!0,n.samplingMode=p.TextureSamplingMode.NEAREST_MIPMAP_NEAREST);const u=this._descriptor.context.bindTexture(this,r.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(r.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.gl.generateMipmap(n.target);this._descriptor.context.bindTexture(u,r.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const n=
this._descriptor;if(n.hasMipmap){if(this._wasImmutablyAllocated)throw new b("Cannot delete mipmaps to immutable texture after allocation");n.hasMipmap=!1;this._samplingModeDirty=!0;c(n)}n.samplingMode===p.TextureSamplingMode.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,n.samplingMode=p.TextureSamplingMode.LINEAR):n.samplingMode===p.TextureSamplingMode.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,n.samplingMode=p.TextureSamplingMode.NEAREST)}setSamplingMode(n){n!==this._descriptor.samplingMode&&
(this._descriptor.samplingMode=n,this._samplingModeDirty=!0)}setWrapMode(n){n!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=n,c(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const n=this._descriptor,u=n.context.gl;this._samplingModeDirty&&(e(u,n),this._samplingModeDirty=!1);this._wrapModeDirty&&(g(u,n),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(null!=this._descriptor.internalFormat)return this._descriptor.internalFormat===p.PixelFormat.DEPTH_STENCIL&&(this._descriptor.internalFormat=
p.PixelFormat.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case p.PixelType.FLOAT:switch(this._descriptor.pixelFormat){case p.PixelFormat.RGBA:return this._descriptor.internalFormat=p.SizedPixelFormat.RGBA32F;case p.PixelFormat.RGB:return this._descriptor.internalFormat=p.SizedPixelFormat.RGB32F;default:throw new b("Unable to derive format");}case p.PixelType.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case p.PixelFormat.RGBA:return this._descriptor.internalFormat=
p.SizedPixelFormat.RGBA8;case p.PixelFormat.RGB:return this._descriptor.internalFormat=p.SizedPixelFormat.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===p.PixelFormat.DEPTH_STENCIL?p.PixelFormat.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const n=this._descriptor.context.gl,{unpackAlignment:u,flipped:x,preMultiplyAlpha:y}=this._descriptor;n.pixelStorei(n.UNPACK_ALIGNMENT,u);n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,x?1:0);n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
y?1:0)}_texStorage(n,u,x,y,z,A){const {gl:B}=this._descriptor.context;if(!(u in p.SizedPixelFormat))throw new b("Immutable textures must have a sized internal format");if(this._descriptor.isImmutable){x=x?m(n,y,z,A):1;if(v(n)){if(null==A)throw new b("Missing depth dimension for 3D texture upload");B.texStorage3D(n,x,u,y,z,A)}else B.texStorage2D(n,x,u,y,z);this._wasImmutablyAllocated=!0}}_texImage(n,u,x,y,z,A,B){const C=this._descriptor.context.gl,D=v(n),{isImmutable:F,pixelFormat:H,dataType:N}=this._descriptor;
if(F){if(null!=B)if(D){if(null==A)throw new b("Missing depth dimension for 3D texture upload");C.texSubImage3D(n,u,0,0,0,y,z,A,H,N,B)}else C.texSubImage2D(n,u,0,0,y,z,H,N,B)}else if(D){if(null==A)throw new b("Missing depth dimension for 3D texture upload");C.texImage3D(n,u,x,y,z,A,0,H,N,B)}else C.texImage2D(n,u,x,y,z,0,H,N,B)}_compressedTexImage(n,u,x,y,z,A,B){const C=this._descriptor.context.gl,D=v(n);if(this._descriptor.isImmutable){if(null!=B)if(D){if(null==A)throw new b("Missing depth dimension for 3D texture upload");
C.compressedTexSubImage3D(n,u,0,0,0,y,z,A,x,B)}else C.compressedTexSubImage2D(n,u,0,0,y,z,x,B)}else if(D){if(null==A)throw new b("Missing depth dimension for 3D texture upload");C.compressedTexImage3D(n,u,x,y,z,A,0,B)}else C.compressedTexImage2D(n,u,x,y,z,0,B)}_forEachMipmapLevel(n,u=Infinity){let {width:x,height:y,depth:z,hasMipmap:A,target:B}=this._descriptor;const C=B===p.TextureType.TEXTURE_3D;if(null==x||null==y||C&&null==z)throw new b("Missing texture dimensions for mipmap calculation");for(let D=
0;;++D){n(D,x,y,z);if(!A||1===x&&1===y&&(!C||1===z)||D>=u)break;x=Math.max(1,x>>1);y=Math.max(1,y>>1);C&&(z=Math.max(1,z>>1))}}};q.TEXTURE_UNIT_FOR_UPDATES=0;a.Texture=q;a.tracer=null;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/GLObjectType":function(){define(["exports"],function(a){a.GLObjectType=void 0;var b=a.GLObjectType||(a.GLObjectType={});b[b.Texture=0]="Texture";b[b.RenderBuffer=1]="RenderBuffer";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/webgl/TextureDescriptor":function(){define(["exports","./enums","./Util"],function(a,b,q){class l{constructor(p=0,k=p){this.width=p;this.height=k;this.target=b.TextureType.TEXTURE_2D;this.pixelFormat=b.PixelFormat.RGBA;this.dataType=b.PixelType.UNSIGNED_BYTE;this.samplingMode=b.TextureSamplingMode.LINEAR;this.wrapMode=b.TextureWrapMode.REPEAT;this.maxAnisotropy=1;this.isOpaque=this.hasMipmap=this.flipped=!1;this.unpackAlignment=4;this.preMultiplyAlpha=!1;this.depth=1;this.isImmutable=
!1}}a.TextureDescriptor=l;a.estimateMemory=function(p){return 0>=p.width||0>=p.height?0:Math.round(p.width*p.height*(p.hasMipmap?4/3:1)*(null==p.internalFormat?4:q.getBytesPerElementFormat(p.internalFormat)))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/ValidatedTextureDescriptor":function(){define(["exports","./enums","./TextureDescriptor"],function(a,b,q){class l extends q.TextureDescriptor{constructor(p,k){super();this.context=p;Object.assign(this,k);switch(this.internalFormat){case b.SizedPixelFormat.R16F:case b.SizedPixelFormat.R16I:case b.SizedPixelFormat.R16UI:case b.SizedPixelFormat.R32F:case b.SizedPixelFormat.R32I:case b.SizedPixelFormat.R32UI:case b.SizedPixelFormat.R8_SNORM:case b.SizedPixelFormat.R8:case b.SizedPixelFormat.R8I:case b.SizedPixelFormat.R8UI:this.pixelFormat=
b.PixelFormat.RED}}static validate(p,k){return new l(p,k)}}a.ValidatedTextureDescriptor=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/textureUtils":function(){define(["exports","../../../../core/Error"],function(a,b){function q(p,k,h){if(p instanceof ImageData)return q(l(p),k,h);const f=document.createElement("canvas");f.width=k;f.height=h;f.getContext("2d").drawImage(p,0,0,f.width,f.height);return f}function l(p){const k=document.createElement("canvas");
k.width=p.width;k.height=p.height;const h=k.getContext("2d");if(null==h)throw new b("Failed to create 2d context from HTMLCanvasElement");h.putImageData(p,0,0);return k}a.applyTextureResizeFloorModulo=function(p){return 16*Math.floor(p/16)};a.applyTextureResizeModulo=function(p){return 16*Math.ceil(p/16)};a.downsampleImage=function(p,k){let h=p.width*p.height;if(4096>h)return p instanceof ImageData?l(p):p;let f=p.width,c=p.height;do f=Math.ceil(f/2),c=Math.ceil(c/2),h=f*c;while(1048576<h||null!=k&&
(f>k||c>k));return q(p,f,c)};a.ensureImageMaxSize=function(p,k){const h=Math.max(p.width,p.height);if(h<=k)return p;k/=h;return q(p,Math.round(p.width*k),Math.round(p.height*k))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/AtmosphereCompositing.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl","../views/3d/webgl-engine/core/shaderModules/interfaces","../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform"],
function(a,b,q,l,p){function k(c){const e=new l.ShaderBuilder;e.include(b.ScreenSpacePass);e.fragment.uniforms.add(new p.Texture2DPassUniform("colorTexture",g=>g.color),new p.Texture2DPassUniform("depthTexture",g=>g.depth));e.fragment.code.add(q.glsl`
void main() {
float depthSample = texture(depthTexture, uv).r;
if (depthSample ${c.haze?q.glsl`== 1.0`:q.glsl`!= 1.0`} ) {
fragColor = vec4(0);
return;
}
fragColor = texture(colorTexture, uv);
}
`);return e}class h extends q.NoParameters{}const f=Object.freeze(Object.defineProperty({__proto__:null,AtmosphereCompositingPassParameters:h,build:k},Symbol.toStringTag,{value:"Module"}));a.AtmosphereCompositing=f;a.AtmosphereCompositingPassParameters=h;a.build=k})},"esri/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl":function(){define(["exports","../shaderModules/interfaces","../../lib/VertexAttribute"],function(a,b,q){a.ScreenSpacePass=function(l,p=!0){l.attributes.add(q.VertexAttribute.POSITION,
"vec2");p&&l.varyings.add("uv","vec2");l.vertex.code.add(b.glsl`
void main(void) {
gl_Position = vec4(position, 0.0, 1.0);
${p?b.glsl`uv = position * 0.5 + vec2(0.5);`:""}
}
`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../../../../chunks/AtmosphereCompositing.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c){class e extends l.ShaderTechnique{initializeProgram(g){return new k.Program(g.rctx,
e.shader.get().build(this.configuration),p.Default3D)}initializePipeline(){return this.configuration.haze?c.makePipelineState({blending:c.separateBlendingParams(f.BlendFactor.ONE,f.BlendFactor.ZERO,f.BlendFactor.ONE_MINUS_SRC_COLOR,f.BlendFactor.ONE),depthTest:{func:f.CompareFunction.ALWAYS},colorWrite:c.defaultColorWriteParams}):c.makePipelineState({blending:c.simpleBlendingParams(f.BlendFactor.SRC_ALPHA,f.BlendFactor.ONE_MINUS_SRC_ALPHA),depthTest:{func:f.CompareFunction.ALWAYS},colorWrite:c.defaultColorWriteParams})}}
e.shader=new q.ReloadableShaderModule(h.AtmosphereCompositing,()=>new Promise((g,d)=>a(["./AtmosphereCompositing.glsl"],g,d)));b.AtmosphereCompositingTechnique=e;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsComposition":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/maybe ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./CloudsCompositionTechnique ../webgl-engine/core/shaderModules/interfaces ../webgl-engine/lib/glUtil3D ../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.CloudsComposition=class extends q{constructor(v){super(v);this._technique=new e.CloudsCompositionTechnique(v);this._vao=d.createQuadVAO(v.rctx)}destroy(){this._technique=l.releaseMaybe(this._technique);this._vao=l.disposeMaybe(this._vao)}render(v){if(this._technique.compiled){var m=v.bindParameters.cloudsFade;null!=this._vao&&null!=m.data&&(m=v.rctx.bindTechnique(this._technique,v.bindParameters,w),v.rctx.bindVAO(this._vao),m.assertCompatibleVertexAttributeLocations(this._vao),
v.rctx.drawArrays(t.PrimitiveType.TRIANGLE_STRIP,0,4))}else this.requestRender()}};b.__decorate([p.property({constructOnly:!0})],a.CloudsComposition.prototype,"rctx",void 0);b.__decorate([p.property({constructOnly:!0})],a.CloudsComposition.prototype,"viewingMode",void 0);b.__decorate([p.property({constructOnly:!0})],a.CloudsComposition.prototype,"planetRadius",void 0);b.__decorate([p.property({constructOnly:!0})],a.CloudsComposition.prototype,"requestRender",void 0);a.CloudsComposition=b.__decorate([c.subclass("esri.views.3d.environment.CloudsComposition")],
a.CloudsComposition);const w=new g.NoParameters;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsCompositionTechnique":function(){define("require exports ../../../chunks/CloudsComposition.glsl ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e){class g extends p.ShaderTechnique{constructor(d){super(d,new k.ShaderTechniqueConfiguration,()=>this.destroy())}initializeProgram(d){return new f.Program(d.rctx,g.shader.get().build(),h.Default3D)}initializePipeline(){return e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.ONE,c.BlendFactor.ZERO,c.BlendFactor.SRC_ALPHA,c.BlendFactor.ONE),depthTest:{func:c.CompareFunction.LEQUAL},colorWrite:e.defaultColorWriteParams})}}g.shader=new l.ReloadableShaderModule(q.CloudsCompositionShader,
()=>new Promise((d,t)=>a(["./CloudsComposition.glsl"],d,t)));b.CloudsCompositionTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/CloudsComposition.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(){const u=new v.ShaderBuilder,{attributes:x,varyings:y,vertex:z,fragment:A}=u;x.add(m.VertexAttribute.POSITION,"vec2");y.add("worldRay","vec3");z.uniforms.add(new w.Matrix4PassUniform("inverseProjectionMatrix",(B,C)=>C.camera.inverseProjectionMatrix),new w.Matrix4PassUniform("inverseViewMatrix",(B,C)=>b.invertOrIdentity(n,C.camera.viewMatrix)));z.code.add(t.glsl`void main(void) {
vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1.0, 1.0)).xyz;
worldRay = (inverseViewMatrix * vec4(posViewNear, 0.0)).xyz;
gl_Position = vec4(position, 1.0, 1.0);
}`);A.include(e.ColorConversion);A.include(g.RgbaFloatEncoding);u.include(l.EvaluateAmbientLighting,{pbrMode:h.PBRMode.Disabled,lightingSphericalHarmonicsOrder:2});u.include(f.PiUtils);u.include(p.Gamma);u.include(k.MainLighting);u.include(c.CloudsParallaxShading);A.uniforms.add(new d.Float3PassUniform("cameraPosition",(B,C)=>C.camera.eye));A.code.add(t.glsl`void main() {
vec4 cloudsColor = renderClouds(normalize(worldRay), cameraPosition);
fragColor = vec4((1.0 - totalFadeInOut) * cloudsColor.rgb, cloudsColor.a);
}`);return u}const n=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:r},Symbol.toStringTag,{value:"Module"}));a.CloudsCompositionShader=q;a.build=r})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl":function(){define("exports ../../../../../../chunks/vec32 ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../../chunks/vec42 ../../../../../../core/libs/gl-matrix-2/factories/vec4f64 ./PhysicallyBasedRenderingParameters.glsl ../../shaderModules/Float3PassUniform ../../shaderModules/Float4PassUniform ../../shaderModules/interfaces".split(" "),
function(a,b,q,l,p,k,h,f,c){const e=q.create(),g=p.create();a.EvaluateAmbientLighting=function(d,t){d=d.fragment;const w=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===w?(d.uniforms.add(new h.Float3PassUniform("lightingAmbientSH0",(v,m)=>b.set(e,m.lighting.sh.r[0],m.lighting.sh.g[0],m.lighting.sh.b[0]))),d.code.add(c.glsl`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
return ambientLight * (1.0 - ambientOcclusion);
}`)):1===w?(d.uniforms.add(new f.Float4PassUniform("lightingAmbientSH_R",(v,m)=>l.set(g,m.lighting.sh.r[0],m.lighting.sh.r[1],m.lighting.sh.r[2],m.lighting.sh.r[3])),new f.Float4PassUniform("lightingAmbientSH_G",(v,m)=>l.set(g,m.lighting.sh.g[0],m.lighting.sh.g[1],m.lighting.sh.g[2],m.lighting.sh.g[3])),new f.Float4PassUniform("lightingAmbientSH_B",(v,m)=>l.set(g,m.lighting.sh.b[0],m.lighting.sh.b[1],m.lighting.sh.b[2],m.lighting.sh.b[3]))),d.code.add(c.glsl`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
vec4 sh0 = vec4(
0.282095,
0.488603 * normal.x,
0.488603 * normal.z,
0.488603 * normal.y
);
vec3 ambientLight = vec3(
dot(lightingAmbientSH_R, sh0),
dot(lightingAmbientSH_G, sh0),
dot(lightingAmbientSH_B, sh0)
);
return ambientLight * (1.0 - ambientOcclusion);
}`)):2===w&&(d.uniforms.add(new h.Float3PassUniform("lightingAmbientSH0",(v,m)=>b.set(e,m.lighting.sh.r[0],m.lighting.sh.g[0],m.lighting.sh.b[0])),new f.Float4PassUniform("lightingAmbientSH_R1",(v,m)=>l.set(g,m.lighting.sh.r[1],m.lighting.sh.r[2],m.lighting.sh.r[3],m.lighting.sh.r[4])),new f.Float4PassUniform("lightingAmbientSH_G1",(v,m)=>l.set(g,m.lighting.sh.g[1],m.lighting.sh.g[2],m.lighting.sh.g[3],m.lighting.sh.g[4])),new f.Float4PassUniform("lightingAmbientSH_B1",(v,m)=>l.set(g,m.lighting.sh.b[1],
m.lighting.sh.b[2],m.lighting.sh.b[3],m.lighting.sh.b[4])),new f.Float4PassUniform("lightingAmbientSH_R2",(v,m)=>l.set(g,m.lighting.sh.r[5],m.lighting.sh.r[6],m.lighting.sh.r[7],m.lighting.sh.r[8])),new f.Float4PassUniform("lightingAmbientSH_G2",(v,m)=>l.set(g,m.lighting.sh.g[5],m.lighting.sh.g[6],m.lighting.sh.g[7],m.lighting.sh.g[8])),new f.Float4PassUniform("lightingAmbientSH_B2",(v,m)=>l.set(g,m.lighting.sh.b[5],m.lighting.sh.b[6],m.lighting.sh.b[7],m.lighting.sh.b[8]))),d.code.add(c.glsl`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
vec4 sh1 = vec4(
0.488603 * normal.x,
0.488603 * normal.z,
0.488603 * normal.y,
1.092548 * normal.x * normal.y
);
vec4 sh2 = vec4(
1.092548 * normal.y * normal.z,
0.315392 * (3.0 * normal.z * normal.z - 1.0),
1.092548 * normal.x * normal.z,
0.546274 * (normal.x * normal.x - normal.y * normal.y)
);
ambientLight += vec3(
dot(lightingAmbientSH_R1, sh1),
dot(lightingAmbientSH_G1, sh1),
dot(lightingAmbientSH_B1, sh1)
);
ambientLight += vec3(
dot(lightingAmbientSH_R2, sh2),
dot(lightingAmbientSH_G2, sh2),
dot(lightingAmbientSH_B2, sh2)
);
return ambientLight * (1.0 - ambientOcclusion);
}`),t.pbrMode!==k.PBRMode.Normal&&t.pbrMode!==k.PBRMode.Schematic||d.code.add(c.glsl`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
vec3 calculateAmbientRadiance(float ambientOcclusion)
{
vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
}`))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl":function(){define("exports ../attributes/VertexTextureCoordinates.glsl ../../shaderModules/Float3DrawUniform ../../shaderModules/Float3PassUniform ../../shaderModules/interfaces ../../shaderModules/Texture2DDrawUniform ../../shaderModules/Texture2DPassUniform ../../shaderTechnique/BindType ../../../lib/GLTextureMaterial".split(" "),function(a,
b,q,l,p,k,h,f,c){a.PBRMode=void 0;(function(g){g[g.Disabled=0]="Disabled";g[g.Normal=1]="Normal";g[g.Schematic=2]="Schematic";g[g.Water=3]="Water";g[g.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh";g[g.Simplified=5]="Simplified";g[g.TerrainWithWater=6]="TerrainWithWater";g[g.COUNT=7]="COUNT"})(a.PBRMode||(a.PBRMode={}));class e extends c.GLTextureMaterialBindParameters{}a.PBRBindParameters=e;a.PhysicallyBasedRenderingParameters=function(g,d){const t=g.fragment,w=d.hasMetallicRoughnessTexture||d.hasEmissionTexture||
d.hasOcclusionTexture;d.pbrMode===a.PBRMode.Normal&&w&&g.include(b.VertexTextureCoordinates,d);d.pbrMode===a.PBRMode.Schematic?t.code.add(p.glsl`vec3 mrr = vec3(0.0, 0.6, 0.2);
vec3 emission = vec3(0.0);
float occlusion = 1.0;
void applyPBRFactors() {}
float getBakedOcclusion() { return 1.0; }`):d.pbrMode===a.PBRMode.Disabled?t.code.add(p.glsl`float getBakedOcclusion() { return 1.0; }`):d.pbrMode===a.PBRMode.Normal&&(t.code.add(p.glsl`vec3 mrr;
vec3 emission;
float occlusion;`),g=d.pbrTextureBindType,d.hasMetallicRoughnessTexture&&(t.uniforms.add(g===f.BindType.Pass?new h.Texture2DPassUniform("texMetallicRoughness",v=>v.textureMetallicRoughness):new k.Texture2DDrawUniform("texMetallicRoughness",v=>v.textureMetallicRoughness)),t.code.add(p.glsl`void applyMetallnessAndRoughness(vec2 uv) {
vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
mrr[0] *= metallicRoughness.b;
mrr[1] *= metallicRoughness.g;
}`)),d.hasEmissionTexture&&(t.uniforms.add(g===f.BindType.Pass?new h.Texture2DPassUniform("texEmission",v=>v.textureEmissive):new k.Texture2DDrawUniform("texEmission",v=>v.textureEmissive)),t.code.add(p.glsl`void applyEmission(vec2 uv) {
emission *= textureLookup(texEmission, uv).rgb;
}`)),d.hasOcclusionTexture?(t.uniforms.add(g===f.BindType.Pass?new h.Texture2DPassUniform("texOcclusion",v=>v.textureOcclusion):new k.Texture2DDrawUniform("texOcclusion",v=>v.textureOcclusion)),t.code.add(p.glsl`void applyOcclusion(vec2 uv) {
occlusion *= textureLookup(texOcclusion, uv).r;
}
float getBakedOcclusion() {
return occlusion;
}`)):t.code.add(p.glsl`float getBakedOcclusion() { return 1.0; }`),g===f.BindType.Pass?t.uniforms.add(new l.Float3PassUniform("emissionFactor",v=>v.emissiveFactor),new l.Float3PassUniform("mrrFactors",v=>v.mrrFactors)):t.uniforms.add(new q.Float3DrawUniform("emissionFactor",v=>v.emissiveFactor),new q.Float3DrawUniform("mrrFactors",v=>v.mrrFactors)),t.code.add(p.glsl`
void applyPBRFactors() {
mrr = mrrFactors;
emission = emissionFactor;
occlusion = 1.0;
${d.hasMetallicRoughnessTexture?p.glsl`applyMetallnessAndRoughness(${d.hasMetallicRoughnessTextureTransform?p.glsl`metallicRoughnessUV`:"vuv0"});`:""}
${d.hasEmissionTexture?p.glsl`applyEmission(${d.hasEmissiveTextureTransform?p.glsl`emissiveUV`:"vuv0"});`:""}
${d.hasOcclusionTexture?p.glsl`applyOcclusion(${d.hasOcclusionTextureTransform?p.glsl`occlusionUV`:"vuv0"});`:""}
}
`))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl":function(){define(["exports","../../../../../../core/compilerUtils","./TextureCoordinateAttribute.glsl","../util/TextureAtlasLookup.glsl","../../shaderModules/interfaces"],function(a,b,q,l,p){a.VertexTextureCoordinates=function(k,h){k.include(q.TextureCoordinateAttribute,h);switch(h.textureCoordinateType){case q.TextureCoordinateAttributeType.Default:case q.TextureCoordinateAttributeType.Compressed:k.fragment.code.add(p.glsl`vec4 textureLookup(sampler2D tex, vec2 uv) {
return texture(tex, uv);
}`);break;case q.TextureCoordinateAttributeType.Atlas:k.include(l.TextureAtlasLookup);k.fragment.code.add(p.glsl`vec4 textureLookup(sampler2D tex, vec2 uv) {
return textureAtlasLookup(tex, uv, vuvRegion);
}`);break;default:b.neverReached(h.textureCoordinateType);case q.TextureCoordinateAttributeType.None:case q.TextureCoordinateAttributeType.COUNT:}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/TextureAtlasLookup.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.TextureAtlasLookup=function(q){q.fragment.code.add(b.glsl`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
float maxdUV = 0.125;
vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
return textureGrad(tex, uvAtlas, dUVdx, dUVdy);
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Float3DrawUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"vec3",q.BindType.Draw,(h,f,c,e)=>h.setUniform3fv(p,k(f,c,e)))}}a.Float3DrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform":function(){define(["exports",
"./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"sampler2D",q.BindType.Draw,(h,f,c)=>h.bindTexture(p,k(f,c)))}}a.Texture2DDrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/GLTextureMaterial":function(){define("exports ../../../../core/maybe ../../../../core/promiseUtils ../core/shaderModules/interfaces ./basicInterfaces ./GLMaterial".split(" "),function(a,b,q,l,p,k){class h extends k{constructor(c){super(c);
this._numLoading=0;this._disposed=!1;this._textures=c.textures;this._textureId=c.textureId;this._acquire(c.textureId,e=>this._texture=e);this._acquire(c.normalTextureId,e=>this._textureNormal=e);this._acquire(c.emissiveTextureId,e=>this._textureEmissive=e);this._acquire(c.occlusionTextureId,e=>this._textureOcclusion=e);this._acquire(c.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){this._texture=b.releaseMaybe(this._texture);this._textureNormal=b.releaseMaybe(this._textureNormal);
this._textureEmissive=b.releaseMaybe(this._textureEmissive);this._textureOcclusion=b.releaseMaybe(this._textureOcclusion);this._textureMetallicRoughness=b.releaseMaybe(this._textureMetallicRoughness);this._disposed=!0}ensureResources(c){return 0===this._numLoading?p.ResourceState.LOADED:p.ResourceState.LOADING}get textureBindParameters(){return new f(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:
null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(c){if(null==this._texture||c!==this._texture.id)this._texture=b.releaseMaybe(this._texture),this._textureId=c,this._acquire(this._textureId,e=>this._texture=e)}_acquire(c,e){null==c?e(null):(c=this._textures.acquire(c),q.isPromiseLike(c)?(++this._numLoading,c.then(g=>{this._disposed?(b.releaseMaybe(g),e(null)):e(g)}).finally(()=>
--this._numLoading)):e(c))}}class f extends l.NoParameters{constructor(c=null,e=null,g=null,d=null,t=null,w,v){super();this.texture=c;this.textureNormal=e;this.textureEmissive=g;this.textureOcclusion=d;this.textureMetallicRoughness=t;this.scale=w;this.normalTextureTransformMatrix=v}}a.GLTextureMaterial=h;a.GLTextureMaterialBindParameters=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/GLMaterial":function(){define(["./basicInterfaces"],function(a){class b{constructor(q){this._material=
q.material;this._techniques=q.techniques;this._output=q.output}dispose(){this._techniques.release(this._technique)}get technique(){return this._technique}get _stippleTextures(){return this._techniques.constructionContext.stippleTextures}get _markerTextures(){return this._techniques.constructionContext.markerTextures}ensureTechnique(q,l){return this._technique=this._techniques.releaseAndAcquire(q,this._material.getConfiguration(this._output,l),this._technique)}ensureResources(q){return a.ResourceState.LOADED}}
return b})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.PiUtils=function(q){q.vertex.code.add(b.glsl`const float PI = 3.141592653589793;`);q.fragment.code.add(b.glsl`const float PI = 3.141592653589793;
const float LIGHT_NORMALIZATION = 1.0 / PI;
const float INV_PI = 0.3183098861837907;
const float HALF_PI = 1.570796326794897;`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl":function(){define("exports ../../../../../../core/mathUtils ../../../../../../geometry/support/Ellipsoid ../../../../environment/CloudsData ../../../../environment/CloudsParameters ../../../../environment/weather ../shading/MainLighting.glsl ../../shaderModules/BooleanPassUniform ../../shaderModules/Float3PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix4PassUniform ../../shaderModules/TextureCubePassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.CloudsParallaxShading=function(w){w=w.fragment;w.uniforms.add(new d.Matrix4PassUniform("rotationMatrixClouds",(v,m)=>m.cloudsFade.parallax.transform),new d.Matrix4PassUniform("rotationMatrixCloudsCrossFade",(v,m)=>m.cloudsFade.parallaxNew.transform),new c.Float3PassUniform("anchorPosition",(v,m)=>m.cloudsFade.parallax.anchorPointClouds),new c.Float3PassUniform("anchorPositionCrossFade",(v,m)=>m.cloudsFade.parallaxNew.anchorPointClouds),new e.FloatPassUniform("cloudsHeight",
()=>k.cloudsHeight),new e.FloatPassUniform("radiusCurvatureCorrectionFactor",(v,m)=>m.cloudsFade.parallax.radiusCurvatureCorrectionFactor),new e.FloatPassUniform("totalFadeInOut",(v,m)=>1-m.cloudsFade.opacity),new e.FloatPassUniform("crossFadeAnchorFactor",(v,m)=>b.clamp(m.cloudsFade.fadeFactor,0,1)),new t.TextureCubePassUniform("cubeMap",(v,m)=>m.cloudsFade.data?.cubeMap?.colorTexture??null),new f.BooleanPassUniform("crossFade",(v,m)=>m.cloudsFade.fadeMode===p.FadeMode.CROSS_FADE),new f.BooleanPassUniform("readChannelsRG",
(v,m)=>m.cloudsFade.readChannels===l.CloudsTextureChannels.RG),new f.BooleanPassUniform("fadeTextureChannels",(v,m)=>m.cloudsFade.renderingStage===l.CloudsRenderingStages.FADING));w.constants.add("planetRadius","float",q.earth.radius);w.code.add(g.glsl`vec3 intersectWithCloudLayer(vec3 dir, vec3 cameraPosition, vec3 spherePos)
{
float radiusClouds = planetRadius + cloudsHeight;
float B = 2.0 * dot(cameraPosition, dir);
float C = dot(cameraPosition, cameraPosition) - radiusClouds * radiusClouds;
float det = B * B - 4.0 * C;
float pointIntDist = max(0.0, 0.5 *(-B + sqrt(det)));
vec3 intersectionPont = cameraPosition + dir * pointIntDist;
intersectionPont = intersectionPont - spherePos;
return intersectionPont;
}`);w.code.add(g.glsl`vec3 correctForPlanetCurvature(vec3 dir)
{
dir.z = dir.z*(1.-radiusCurvatureCorrectionFactor) + radiusCurvatureCorrectionFactor;
return dir;
}`);w.code.add(g.glsl`vec3 rotateDirectionToAnchorPoint(mat4 rotMat, vec3 inVec)
{
return (rotMat * vec4(inVec, 0.0)).xyz;
}`);h.addMainLightDirection(w);h.addMainLightIntensity(w);w.code.add(g.glsl`const float SUNSET_TRANSITION_FACTOR = 0.3;
const vec3 RIM_COLOR = vec3(0.28, 0.175, 0.035);
const float RIM_SCATTERING_FACTOR = 140.0;
const float BACKLIGHT_FACTOR = 0.2;
const float BACKLIGHT_SCATTERING_FACTOR = 10.0;
const float BACKLIGHT_TRANSITION_FACTOR = 0.3;
vec3 calculateCloudColor(vec3 cameraPosition, vec3 worldSpaceRay, vec4 clouds)
{
float upDotLight = dot(normalize(cameraPosition), normalize(mainLightDirection));
float dirDotLight = max(dot(normalize(-worldSpaceRay), normalize(mainLightDirection)), 0.0);
float sunsetTransition = clamp(pow(max(upDotLight, 0.0), SUNSET_TRANSITION_FACTOR), 0.0, 1.0);
vec3 ambientLight = calculateAmbientIrradiance(normalize(cameraPosition), 0.0);
vec3 mainLight = evaluateMainLighting(normalize(cameraPosition), 0.0);
vec3 combinedLight = clamp((mainLightIntensity + ambientLight )/PI, vec3(0.0), vec3(1.0));
vec3 baseCloudColor = pow(combinedLight * pow(clouds.xyz, vec3(GAMMA)), vec3(INV_GAMMA));
float scatteringMod = max(clouds.a < 0.5 ? clouds.a / 0.5 : - clouds.a / 0.5 + 2.0, 0.0);
float rimLightIntensity = 0.5 + 0.5 *pow(max(upDotLight, 0.0), 0.35);
vec3 directSunScattering = RIM_COLOR * rimLightIntensity * (pow(dirDotLight, RIM_SCATTERING_FACTOR)) * scatteringMod;
float additionalLight = BACKLIGHT_FACTOR * pow(dirDotLight, BACKLIGHT_SCATTERING_FACTOR) * (1. - pow(sunsetTransition, BACKLIGHT_TRANSITION_FACTOR)) ;
return vec3(baseCloudColor * (1. + additionalLight) + directSunScattering);
}`);w.code.add(g.glsl`vec4 getCloudData(vec3 rayDir, bool readOtherChannel)
{
vec4 cloudData = texture(cubeMap, rayDir);
float mu = dot(rayDir, vec3(0, 0, 1));
bool readChannels = readChannelsRG ^^ readOtherChannel;
if (readChannels) {
cloudData = vec4(vec3(cloudData.r), cloudData.g);
} else {
cloudData = vec4(vec3(cloudData.b), cloudData.a);
}
if (length(cloudData) == 0.0) {
return vec4(cloudData.rgb, 1.0);
}
return cloudData;
}`);w.code.add(g.glsl`vec4 renderCloudsNoFade(vec3 worldRay, vec3 cameraPosition)
{
vec3 intersectionPoint = intersectWithCloudLayer(normalize(worldRay), cameraPosition, anchorPosition);
vec3 worldRayRotated = rotateDirectionToAnchorPoint(rotationMatrixClouds, normalize(intersectionPoint));
vec3 worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated);
vec4 cloudData = getCloudData(worldRayRotatedCorrected, false);
float totalTransmittance = clamp(cloudData.a * (1.0 - totalFadeInOut) + totalFadeInOut, 0.0 , 1.0);
if (length(cloudData.rgb) == 0.0) {
totalTransmittance = 1.0;
}
return vec4(calculateCloudColor(cameraPosition, normalize(-worldRay), cloudData), totalTransmittance);
}`);w.code.add(g.glsl`vec4 renderCloudsCrossFade(vec3 worldRay, vec3 cameraPosition)
{
vec3 intersectionPoint = intersectWithCloudLayer(normalize(worldRay), cameraPosition, anchorPosition);
vec3 worldRayRotated = rotateDirectionToAnchorPoint(rotationMatrixClouds, normalize(intersectionPoint));
vec3 worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated);
vec4 cloudData = getCloudData(worldRayRotatedCorrected, false);
vec4 cloudColor = vec4(calculateCloudColor(cameraPosition, normalize(-worldRay), cloudData), cloudData.a);
intersectionPoint = intersectWithCloudLayer(normalize(worldRay), cameraPosition, anchorPositionCrossFade);
worldRayRotated = rotateDirectionToAnchorPoint(rotationMatrixCloudsCrossFade, normalize(intersectionPoint));
worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated);
cloudData = getCloudData(worldRayRotatedCorrected, fadeTextureChannels);
vec4 cloudColorCrossFade = vec4(calculateCloudColor(cameraPosition, normalize(-worldRay), cloudData), cloudData.a);
cloudColor = mix(cloudColor, cloudColorCrossFade, crossFadeAnchorFactor);
float totalTransmittance = clamp(cloudColor.a * (1.0 - totalFadeInOut) + totalFadeInOut, 0.0 , 1.0);
if (length(cloudColor.rgb) == 0.0) {
totalTransmittance = 1.0;
}
return vec4(cloudColor.rgb, totalTransmittance);
}`);w.code.add(g.glsl`vec4 renderClouds(vec3 worldRay, vec3 cameraPosition)
{
return crossFade ? renderCloudsCrossFade(worldRay, cameraPosition) : renderCloudsNoFade(worldRay, cameraPosition);
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsData":function(){define(["exports"],function(a){a.CloudsRenderingStages=void 0;(function(b){b[b.RENDERING=0]="RENDERING";b[b.FADING=1]="FADING";b[b.FINISHED=2]="FINISHED"})(a.CloudsRenderingStages||(a.CloudsRenderingStages={}));a.CloudsTextureChannels=void 0;(function(b){b[b.RG=0]="RG";b[b.BA=1]="BA"})(a.CloudsTextureChannels||(a.CloudsTextureChannels={}));a.ensureClouds=function(b){return null!=
b&&!b.running};a.isReadyCloudsData=function(b){return null!=b?.cubeMap};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsParameters":function(){define("exports ../../../core/mathUtils ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/support/axisAngleDegrees ../../../geometry/support/Ellipsoid ./CloudsData ./weather ../../support/RenderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){class d{constructor(){this.readChannels=c.CloudsTextureChannels.RG;this.renderingStage=c.CloudsRenderingStages.FINISHED;this.startTimeHeightFade=this.startTime=0;this.cameraPositionLastFrame=k.create();this.parallax=new t;this.parallaxNew=new t;this.pointOnGround=k.create();this.fadeMode=a.FadeMode.HIDE;this.opacity=this.fadeFactor=0}updateParallax(r){var n=this.parallax;r=p.length(r.eye);n.radiusCurvatureCorrectionFactor=.84*Math.sqrt(Math.max(r*r-f.earth.radius*f.earth.radius,
0))/r;h.fromPoints(w,n.anchorPointClouds,v);q.rotate(n.transform,l.IDENTITY,v[3],h.axis(v));this.fadeMode===a.FadeMode.CROSS_FADE&&(n=this.parallaxNew,h.fromPoints(w,n.anchorPointClouds,v),q.rotate(n.transform,l.IDENTITY,v[3],h.axis(v)))}updateFading(r,n,u,x){this.isFading&&this._advanceFading(u,x);this._evaluateFading(r,n,u)}_evaluateFading(r,n,u){const x=r.relativeElevation;r=this._calculateDistanceToAnchorPoint(r);(x>1.7*e.weatherHeightLimit||x<-e.weatherHeightLimit||2E5<r)&&0<this.opacity?this._setFade(a.FadeMode.HIDE,
u):this.isFading||((x>e.weatherHeightLimit||x<-.35*e.weatherHeightLimit||64E3<r)&&0<this.opacity?this._setFade(a.FadeMode.FADE_OUT,u):x<=e.weatherHeightLimit&&x>=-.35*e.weatherHeightLimit&&n===g.RenderState.IDLE&&c.ensureClouds(this.data)&&(0===this.opacity?this._setFade(a.FadeMode.FADE_IN,u):(34E3<r||this.renderingStage===c.CloudsRenderingStages.FADING)&&this._setFade(a.FadeMode.CROSS_FADE,u)))}_advanceFading(r,n){this._switchReadChannels();this._updateAnchorPoint();this._advanceFadingFactorAndOpacity(r,
n)}_advanceFadingFactorAndOpacity(r,n){1>this.fadeFactor?(this.fadeFactor=n?b.clamp((r-this.startTime)/(1.25*n),0,1):1,this.fadeMode===a.FadeMode.FADE_OUT&&(this.opacity=1-this.fadeFactor),this.fadeMode===a.FadeMode.FADE_IN&&(this.opacity=this.fadeFactor),this.fadeMode===a.FadeMode.CROSS_FADE&&(this.opacity=1)):(this.fadeFactor=0,this.fadeMode===a.FadeMode.FADE_OUT&&(this.opacity=0),this.fadeMode===a.FadeMode.FADE_IN&&(this.opacity=1),this.fadeMode===a.FadeMode.CROSS_FADE&&(this.opacity=1),this.fadeMode=
a.FadeMode.NONE)}_switchReadChannels(){const r=this.fadeMode===a.FadeMode.CROSS_FADE&&1===this.fadeFactor,n=this.fadeMode===a.FadeMode.FADE_IN&&0===this.fadeFactor;this.renderingStage===c.CloudsRenderingStages.FADING&&(r||n)&&(this.readChannels=1-this.readChannels,this.renderingStage=c.CloudsRenderingStages.FINISHED)}_calculateDistanceToAnchorPoint(r){p.normalize(this.pointOnGround,r.eye);p.scale(this.pointOnGround,this.pointOnGround,f.earth.radius);return p.length(p.subtract(m,this.parallax.anchorPointClouds,
this.pointOnGround))}_updateAnchorPoint(){this.fadeMode===a.FadeMode.CROSS_FADE&&(0===this.fadeFactor&&p.copy(this.parallaxNew.anchorPointClouds,this.pointOnGround),1===this.fadeFactor&&p.copy(this.parallax.anchorPointClouds,this.parallaxNew.anchorPointClouds));this.fadeMode===a.FadeMode.FADE_IN&&0===this.fadeFactor&&p.copy(this.parallax.anchorPointClouds,this.pointOnGround)}_setFade(r,n){switch(r){case a.FadeMode.HIDE:this.opacity=0;break;case a.FadeMode.FADE_OUT:this.opacity=1;break;case a.FadeMode.FADE_IN:this.opacity=
0;break;case a.FadeMode.CROSS_FADE:this.opacity=1}this.fadeMode=r;this.fadeFactor=0;this.startTime=n}get isFading(){return this.fadeMode===a.FadeMode.FADE_OUT||this.fadeMode===a.FadeMode.FADE_IN||this.fadeMode===a.FadeMode.CROSS_FADE}}a.FadeMode=void 0;(function(r){r[r.NONE=0]="NONE";r[r.HIDE=1]="HIDE";r[r.FADE_OUT=2]="FADE_OUT";r[r.FADE_IN=3]="FADE_IN";r[r.CROSS_FADE=4]="CROSS_FADE"})(a.FadeMode||(a.FadeMode={}));class t{constructor(){this.anchorPointClouds=k.create();this.radiusCurvatureCorrectionFactor=
0;this.transform=l.create()}}const w=k.fromValues(0,0,1),v=h.create(),m=k.create();a.CloudsParameters=d;a.crossFadeDistanceThreshold=34E3;a.fadeOutDistanceThreshold=64E3;a.hideDistanceThreshold=2E5;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/RenderState":function(){define(["exports"],function(a){a.RenderState=void 0;var b=a.RenderState||(a.RenderState={});b[b.ANIMATING=0]="ANIMATING";b[b.INTERACTING=1]="INTERACTING";b[b.IDLE=2]="IDLE";Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/BooleanPassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"bool",q.BindType.Pass,(h,f,c)=>h.setUniform1b(p,k(f,c)))}}a.BooleanPassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/TextureCubePassUniform":function(){define(["exports","./Uniform",
"../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"samplerCube",q.BindType.Pass,(h,f,c)=>h.bindTexture(p,k(f,c)))}}a.TextureCubePassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.ColorConversion=function(q){q.code.add(b.glsl`vec4 premultiplyAlpha(vec4 v) {
return vec4(v.rgb * v.a, v.a);
}
vec3 rgb2hsv(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);
}
vec3 hsv2rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
float rgb2v(vec3 c) {
return max(c.x, max(c.y, c.z));
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsGenerator":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/mathUtils ../../../core/maybe ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/mat3 ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/math/vec2 ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../core/libs/gl-matrix-2/factories/vec3f32 ../../../geometry/ellipsoidUtils ../../../chunks/Clouds.glsl ./CloudsData ./CloudsParameters ./CloudsPresets ./CloudsTechnique ./CloudsTechniqueConfiguration ./NoiseTextureAtlas ../webgl-engine/lib/BindParameters ../webgl-engine/lib/glUtil3D ../../support/Scheduler ../../support/Yield ../../webgl/enums ../../webgl/FramebufferObject ../../webgl/TextureDescriptor".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I){a.CloudsGenerator=class extends q{constructor(M){super(M);this._techniques=[];this._techniqueConfiguration=new B.CloudsTechniqueConfiguration;this._bindParameters=new D.BindParameters(null,null);this._passParameters=new u.CloudsPassParameters;this._weatherTile=m.create();this._weatherTileCount=128;this._tileIndex=this._faceIndex=0;this.coverage=l.lerp(z.cloudPresets.default.coverage[0],z.cloudPresets.default.coverage[1],.5);
this.density=l.lerp(z.cloudPresets.default.density[0],z.cloudPresets.default.density[1],.5);this.absorption=l.lerp(z.cloudPresets.default.absorption[0],z.cloudPresets.default.absorption[1],.5);this.cloudSize=l.lerp(z.cloudPresets.default.cloudSize[0],z.cloudPresets.default.cloudSize[1],.5);this.detailSize=l.lerp(z.cloudPresets.default.detailSize[0],z.cloudPresets.default.detailSize[1],.5);this.smoothness=l.lerp(z.cloudPresets.default.smoothness[0],z.cloudPresets.default.smoothness[1],.5);this.cloudHeight=
l.lerp(z.cloudPresets.default.cloudHeight[0],z.cloudPresets.default.cloudHeight[1],.5);this.raymarchingSteps=z.cloudPresets.default.raymarchingSteps;this._viewMatrix=w.create();this.running=this._dirty=!1;this._vao=F.createQuadVAO(M.context.renderContext.rctx)}_getTechnique(M){const K=1-this.context.renderContext.bindParameters.cloudsFade.readChannels,J=K===x.CloudsTextureChannels.RG?2*M:2*M+1,R=this._techniques[J];if(R)return R;this._techniqueConfiguration.writeTextureChannels=K;this._techniqueConfiguration.steps=
M;this._techniques[J]=new A.CloudsTechnique({rctx:this.context.renderContext.rctx,viewingMode:this.view.state.viewingMode},this._techniqueConfiguration);return this._techniques[J]}updateWeatherTile(){var M=this.view.camera.position.latitude,K=this.view.camera.position.longitude;null!=M&&null!=K&&(v.set(this._weatherTile,(M+90)/180,(K+180)/360),M=Math.floor(this._weatherTileCount*Math.abs(2*this._weatherTile[0]-1)),this._weatherTile[0]=Math.floor(2*this._weatherTileCount*this._weatherTile[0]),this._weatherTile[1]=
Math.floor(4*(this._weatherTileCount-M)*this._weatherTile[1]),K=M=0,null!=this.view.environment&&"virtual"!==this.view.environment.lighting.type&&null!=this.view.environment.lighting.date&&(K=new Date(this.view.environment.lighting.date),K.setUTCHours(this.view.environment.lighting.date.getUTCHours()+(this.view.environment.lighting.displayUTCOffset??0)),M=31*K.getUTCMonth()+K.getUTCDate(),K=K.getUTCFullYear()),this._weatherTile[0]=(this._weatherTile[0]+M)%(2*this._weatherTileCount),this._weatherTile[1]=
(this._weatherTile[1]+K%100)%(4*this._weatherTileCount),v.equals(this._passParameters.weatherTile,this._weatherTile)||this.setDirty())}initialize(){const M=n.getReferenceEllipsoid(this.view.spatialReference);this._passParameters.cloudRadius=.5*M.radius;this.setDirty();this.updateWeatherTile();this.addHandles([this.view.resourceController.scheduler.registerTask(H.TaskPriority.CLOUDS_GENERATOR,this),k.watch(()=>[this.coverage,this.density,this.absorption,this.cloudSize,this.detailSize,this.smoothness,
this.cloudHeight,this.raymarchingSteps],()=>this.setDirty(),k.initial)])}destroy(){this._techniques.forEach(M=>p.releaseMaybe(M));this._frameBufferCube=p.disposeMaybe(this._frameBufferCube);this._techniques.length=0;this._vao.dispose();this._passParameters.noiseTexture=p.destroyMaybe(this._passParameters.noiseTexture)}get _tilesPerFace(){switch(this._techniqueConfiguration.steps){case B.RayMarchingSteps.SIXTEEN:return 1;case B.RayMarchingSteps.HUNDRED:return 4;case B.RayMarchingSteps.COUNT:case B.RayMarchingSteps.TWOHUNDRED:return 8}}get usedMemory(){return(this._frameBufferCube?.usedMemory??
0)+(this._passParameters.noiseTexture?.textureAtlas?.usedMemory??0)}_ensureNoiseTexture(){let M;(M=this._passParameters).noiseTexture??(M.noiseTexture=new C.NoiseTextureAtlas({context:this.context}));this._passParameters.noiseTexture.updateWeatherMap(this._passParameters.weatherTile);return null!=this._passParameters.noiseTexture.textureAtlas}_ensureFrameBufferCube(M){null==this._frameBufferCube&&(M=new I.TextureDescriptor(M),M.target=E.TextureType.TEXTURE_CUBE_MAP,M.wrapMode=E.TextureWrapMode.CLAMP_TO_EDGE,
this._frameBufferCube=new G.FramebufferObject(this.context.renderContext.rctx,M));return this._frameBufferCube}get cubeMap(){return this._frameBufferCube}destroyFrameBufferCube(){this._frameBufferCube=p.disposeMaybe(this._frameBufferCube)}applyPreset(M,K){const J=M.median,R=Q=>{const W=l.lerp(Q[0],Q[1],J);return.5>K?l.lerp(Q[0],W,2*K):l.lerp(W,Q[1],2*(K-.5))};this.coverage=R(M.coverage);this.density=R(M.density);this.absorption=R(M.absorption);this.cloudSize=R(M.cloudSize);this.detailSize=R(M.detailSize);
this.smoothness=R(M.smoothness);this.cloudHeight=R(M.cloudHeight);this.raymarchingSteps=M.raymarchingSteps}setDirty(){this._dirty=this.running=!0}runTask(M){0===this._faceIndex&&0===this._tileIndex&&(this._passParameters.raymarchingSteps=this.raymarchingSteps,this.updateWeatherTile(),v.copy(this._passParameters.weatherTile,this._weatherTile));var K=this._getTechnique(this._passParameters.raymarchingSteps);if(!K.compiled||this.context.renderContext.bindParameters.cloudsFade.fadeMode===y.FadeMode.CROSS_FADE||
!this._ensureNoiseTexture())return N.Yield;0===this._faceIndex&&0===this._tileIndex&&(this.context.renderContext.bindParameters.cloudsFade.renderingStage=x.CloudsRenderingStages.RENDERING,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage,
this._dirty=!1);t.targetTo(this._viewMatrix,P,O[this._faceIndex],L[this._faceIndex]);d.fromMat4(this._passParameters.viewMatrix,this._viewMatrix);const J=this.context.renderContext.rctx;var R=J.bindTechnique(K,this._bindParameters,this._passParameters);J.bindVAO(this._vao);R.assertCompatibleVertexAttributeLocations(this._vao);R=J.getViewport();K=K.configuration.cubeMapSize;const Q=K/this._tilesPerFace;J.setViewport(0,this._tileIndex*Q,K,Q);K=this._ensureFrameBufferCube(K);J.bindFramebuffer(K);K.setColorTextureTarget(E.TextureType.TEXTURE_CUBE_MAP_POSITIVE_X+
this._faceIndex);J.gl.drawArrays(J.gl.TRIANGLE_STRIP,0,4);J.gl.flush();J.setViewport(R.x,R.y,R.width,R.height);this.requestRender();++this._tileIndex;4===this._faceIndex&&this._tileIndex===this._tilesPerFace?(this.running=this._dirty,this._tileIndex=this._faceIndex=0,this.running||(this.context.renderContext.bindParameters.cloudsFade.renderingStage=x.CloudsRenderingStages.FADING)):this._tileIndex===this._tilesPerFace&&(++this._faceIndex,this._tileIndex=0);M.madeProgress();return N.Yield}};b.__decorate([h.property({constructOnly:!0})],
a.CloudsGenerator.prototype,"context",void 0);b.__decorate([h.property({constructOnly:!0})],a.CloudsGenerator.prototype,"view",void 0);b.__decorate([h.property({constructOnly:!0})],a.CloudsGenerator.prototype,"requestRender",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"coverage",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"density",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"absorption",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,
"cloudSize",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"detailSize",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"smoothness",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"cloudHeight",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"raymarchingSteps",void 0);b.__decorate([h.property()],a.CloudsGenerator.prototype,"running",void 0);a.CloudsGenerator=b.__decorate([g.subclass("esri.views.3d.environment.CloudsGenerator")],a.CloudsGenerator);
const O=[r.fromValues(1,0,0),r.fromValues(-1,0,0),r.fromValues(0,1,0),r.fromValues(0,-1,0),r.fromValues(0,0,1)],L=[r.fromValues(0,1,0),r.fromValues(0,1,0),r.fromValues(0,0,-1),r.fromValues(0,0,1),r.fromValues(0,1,0)],P=r.zeros();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/factories/vec3f32":function(){define(["exports"],function(a){function b(){return new Float32Array(3)}function q(r){const n=new Float32Array(3);n[0]=r[0];n[1]=r[1];n[2]=r[2];return n}
function l(r,n,u){const x=new Float32Array(3);x[0]=r;x[1]=n;x[2]=u;return x}function p(r,n){return new Float32Array(r,n,3)}function k(){return b()}function h(){return l(1,1,1)}function f(){return l(1,0,0)}function c(){return l(0,1,0)}function e(){return l(0,0,1)}const g=b(),d=h(),t=f(),w=c(),v=e(),m=Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:t,UNIT_Y:w,UNIT_Z:v,ZEROS:g,clone:q,create:b,createView:p,fromValues:l,ones:h,unitX:f,unitY:c,unitZ:e,zeros:k},Symbol.toStringTag,{value:"Module"}));
a.ONES=d;a.UNIT_X=t;a.UNIT_Y=w;a.UNIT_Z=v;a.ZEROS=g;a.clone=q;a.create=b;a.createView=p;a.fromValues=l;a.ones=h;a.unitX=f;a.unitY=c;a.unitZ=e;a.vec3f32=m;a.zeros=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Clouds.glsl":function(){define("exports ../core/mathUtils ../core/libs/gl-matrix-2/factories/mat3f64 ../core/libs/gl-matrix-2/math/vec2 ../core/libs/gl-matrix-2/factories/vec2f64 ../views/3d/environment/CloudsPresets ../views/3d/environment/CloudsTechniqueConfiguration ../views/3d/environment/NoiseTextureAtlasDimensions ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(x){const y=new w.ShaderBuilder;y.include(c.ScreenSpacePass,!1);const z=y.fragment;z.uniforms.add(new g.FloatPassUniform("cloudRadius",A=>A.cloudRadius),new g.FloatPassUniform("power",A=>b.lerp(35,120,A.absorption)),new g.FloatPassUniform("sigmaE",A=>1+A.absorption),new g.FloatPassUniform("density",A=>b.lerp(0,.3,A.density)),new g.FloatPassUniform("cloudSize",A=>b.lerp(0,.02,Math.max(.01,1-A.cloudSize))),new g.FloatPassUniform("detailSize",A=>b.lerp(0,
.2,Math.max(.01,1-A.detailSize))),new g.FloatPassUniform("smoothness",A=>b.lerp(0,.5,1-A.smoothness)),new g.FloatPassUniform("cloudHeight",A=>b.lerp(0,1500,A.cloudHeight)),new g.FloatPassUniform("coverage",A=>A.coverage),new t.Matrix3PassUniform("view",A=>A.viewMatrix),new v.Texture2DPassUniform("cloudShapeTexture",A=>null!=A.noiseTexture?A.noiseTexture.textureAtlas:null),new e.Float2PassUniform("cloudVariables",A=>l.set(n,A.coverage,A.absorption)));z.constants.add("halfCubeMapSize","float",.5*x.cubeMapSize);
z.code.add(d.glsl`
const int STEPS = ${x.steps===h.RayMarchingSteps.SIXTEEN?d.glsl`16`:x.steps===h.RayMarchingSteps.HUNDRED?d.glsl`100`:d.glsl`200`};
const int STEPS_LIGHT = 6;
const float stepL = 300.0 / float(STEPS_LIGHT);
const float cloudStart = 1500.0;
vec3 rayDirection(vec2 fragCoord) {
vec2 xy = fragCoord - halfCubeMapSize;
return normalize(vec3(-xy, -halfCubeMapSize));
}
float remap(float x, float low1, float high1, float low2, float high2) {
return low2 + (x - low1) * (high2 - low2) / (high1 - low1);
}
float saturate(float x) {
return clamp(x, 0.0, 1.0);
}`);z.code.add(d.glsl`
float getCloudShape(vec3 pos, float pOffset) {
const float textureWidth = ${d.glsl.float(f.atlasSize)};
const float dataWidth = ${d.glsl.float(f.atlasSize)};
const float tileRows = ${d.glsl.float(f.tileRows)};
const vec3 atlasDimensions = vec3(${d.glsl.float(f.tileSize)}, ${d.glsl.float(f.tileSize)}, tileRows * tileRows);
//Change from Y being height to Z being height
vec3 p = float(${d.glsl.float(f.textureScale)}) * pos.xzy;
//Pixel coordinates of point in the 3D data
vec3 coord = vec3(mod(p - pOffset * atlasDimensions, atlasDimensions));
float f = fract(coord.z);
float level = floor(coord.z);
float tileY = floor(level / tileRows);
float tileX = level - tileY * tileRows;
//The data coordinates are offset by the x and y tile, the two boundary cells between each tile pair and the initial boundary cell on the first row/column
vec2 offset = atlasDimensions.x * vec2(tileX, tileY) + 2.0 * vec2(tileX, tileY) + 1.0;
vec2 pixel = coord.xy + offset;
vec2 data = texture(cloudShapeTexture, mod(pixel, dataWidth) / textureWidth).xy;
return 1.0 - mix(data.x, data.y, f);
}
float getCloudMap(vec2 p){
// Shift the texture center to origin to avoid seam artifacts
vec2 uv = (${d.glsl.float(f.weatherMapScale)} * p) / ${d.glsl.float(f.atlasSize)} + 0.5;
return texture(cloudShapeTexture, uv).a;
}
`);z.code.add(d.glsl`float clouds(vec3 p) {
float cloud = saturate(0.5 * mix(0.0, 1.0, min(2.0 * coverage, 1.0)));
if (cloud <= 0.0) {
return 0.0;
}
float cloudMap = getCloudMap(cloudSize * p.xy);
cloud = mix(cloud, min(2.0 * (coverage), 1.0) * cloudMap, min(2.0 * (1.0 - coverage), 1.0));
if (cloud <= 0.0) {
return 0.0;
}
float shape = getCloudShape(8.0 * cloudSize * p, 0.0);
cloud = saturate(remap(cloud, smoothness * shape, 1.0, 0.0, 1.0));
if (cloud <= 0.0) {
return 0.0;
}
float heightFraction = saturate((length(p) - cloudRadius - cloudStart) / cloudHeight);
cloud *= saturate(remap(heightFraction, 0.0, 0.25, 0.0, 1.0)) * smoothstep(1.0, 0.25, heightFraction);
if (cloud <= 0.0) {
return 0.0;
}
return density * saturate(remap(cloud, 0.35 * smoothness * getCloudShape(detailSize * p, 0.0), 1.0, 0.0, 1.0));
}`);z.code.add(d.glsl`vec2 sphereIntersections(vec3 start, vec3 dir, float radius) {
float a = dot(dir, dir);
float b = 2.0 * dot(dir, start);
float c = dot(start, start) - (radius * radius);
float d = (b * b) - 4.0 * a * c;
if (d < 0.0) {
return vec2(1e5, -1e5);
}
return vec2((-b - sqrt(d)) / (2.0 * a), (-b + sqrt(d)) / (2.0 * a));
}
float HenyeyGreenstein(float g, float costh) {
return (1.0 / (4.0 * 3.1415)) * ((1.0 - g * g) / pow(1.0 + g * g - 2.0 * g * costh, 1.5));
}`);z.code.add("\n float multipleOctaves(float extinction, float mu, float stepL) {\n float attenuation \x3d 1.0;\n float contribution \x3d 1.0;\n float phaseAttenuation \x3d 1.0;\n float luminance \x3d 0.0;\n\n for (int i \x3d 0; i \x3c 4; i++) {\n float phase \x3d mix(HenyeyGreenstein(0.0, mu), HenyeyGreenstein(0.3 * phaseAttenuation, mu), 0.7);\n luminance +\x3d contribution * phase * exp(-stepL * extinction * sigmaE * attenuation);\n attenuation *\x3d 0.2;\n contribution *\x3d 0.6;\n phaseAttenuation *\x3d 0.5;\n }\n\n return luminance;\n }");
z.code.add(d.glsl`float lightRay(vec3 org, vec3 p, float phaseFunction, float mu, vec3 sunDirection) {
float lightRayDensity = clouds(p);
lightRayDensity += clouds(p + sunDirection * 1.0 * stepL);
lightRayDensity += clouds(p + sunDirection * 2.0 * stepL);
lightRayDensity += clouds(p + sunDirection * 3.0 * stepL);
lightRayDensity += clouds(p + sunDirection * 4.0 * stepL);
lightRayDensity += clouds(p + sunDirection * 5.0 * stepL);
float beersLaw = multipleOctaves(lightRayDensity, mu, stepL);
return mix(beersLaw * 2.0 * (1.0 - (exp(-stepL * lightRayDensity * 2.0 * sigmaE ))), beersLaw, 0.5 + 0.5 * mu);
}`);z.code.add(d.glsl`float mainRay(vec3 org, vec3 dir, vec3 sunDirection, float distToStart, float totalDistance, out float totalTransmittance) {
if (dir.z < 0.0) {
return 0.0;
}
totalTransmittance = 1.0;
float stepS = totalDistance / float(STEPS);
float cameraHeight = length(org);
float mu = 0.5 + 0.5 * dot(sunDirection, dir);
float phaseFunction = mix(HenyeyGreenstein(-0.3, mu), HenyeyGreenstein(0.3, mu), 0.7);
vec3 p = org + distToStart * dir;
float dist = distToStart;
float shading = 0.0;
for (int i = 0; i < STEPS; i++) {
float sampleDensity = clouds(p);
float sampleSigmaE = sampleDensity * sigmaE;
if (sampleDensity > 0.0 ) {
float ambient = mix((1.2), (1.6), saturate((length(p) - cloudRadius - cloudStart) / cloudHeight));
float luminance = sampleDensity * (ambient + power * phaseFunction * lightRay(org, p, phaseFunction, mu, sunDirection));
float transmittance = exp(-sampleSigmaE * stepS);
shading += totalTransmittance * (luminance - luminance * transmittance) / sampleSigmaE;
totalTransmittance *= transmittance;
if (totalTransmittance <= 0.001) {
totalTransmittance = 0.0;
break;
}
}
dist += stepS;
p = org + dir * dist;
}
return shading;
}`);z.code.add(d.glsl`void main() {
if (coverage == 0.0) {
fragColor = vec4(0.0, 1.0, 0.0, 1.0);
return;
}
vec3 rayDir = rayDirection(gl_FragCoord.xy);
rayDir = normalize(view * rayDir);
vec3 viewPos = vec3(0, 0, cloudRadius + 1.0);
bool hitsPlanet = rayDir.z < 0.0;
float hazeFactor = smoothstep(-0.01, mix(0.0, 0.075, cloudVariables.x), abs(dot(rayDir, vec3(0, 0, 1))));
float totalTransmittance = 1.0;
float shading = 0.0;
if (hitsPlanet) {
shading = clamp(1.0 - cloudVariables.y, 0.6, 1.0) * (1.0 - hazeFactor);
totalTransmittance = hazeFactor;
fragColor = vec4(shading, totalTransmittance, shading, totalTransmittance);
return;
}
vec2 rayStartIntersect = sphereIntersections(viewPos, rayDir, cloudRadius + cloudStart);
vec2 rayEndIntersect = sphereIntersections(viewPos, rayDir, cloudRadius + cloudStart + cloudHeight);
float distToStart = rayStartIntersect.y;
float totalDistance = rayEndIntersect.y - distToStart;
vec3 sunDirection = normalize(vec3(0, 0, 1));
shading = 0.5 * mainRay(viewPos, rayDir, sunDirection, distToStart, totalDistance, totalTransmittance);
shading = mix(clamp(1.0 - cloudVariables.y, 0.6, 1.0), shading, hazeFactor);
totalTransmittance = mix(0.0, totalTransmittance, hazeFactor);
fragColor = vec4(shading, totalTransmittance, shading, totalTransmittance);
}`);return y}class r extends d.NoParameters{constructor(){super(...arguments);this.coverage=this.cloudHeight=this.smoothness=this.density=this.absorption=this.detailSize=this.cloudSize=this.cloudRadius=0;this.raymarchingSteps=k.cloudPresets.default.raymarchingSteps;this.weatherTile=p.create();this.viewMatrix=q.create()}}const n=p.create(),u=Object.freeze(Object.defineProperty({__proto__:null,CloudsPassParameters:r,build:m},Symbol.toStringTag,{value:"Module"}));a.Clouds=u;a.CloudsPassParameters=r;
a.build=m})},"esri/views/3d/environment/CloudsPresets":function(){define(["exports","./CloudsTechniqueConfiguration"],function(a,b){class q{constructor(p,k,h,f,c,e,g,d,t=.5){this.coverage=p;this.density=k;this.absorption=h;this.cloudSize=f;this.detailSize=c;this.smoothness=e;this.cloudHeight=g;this.raymarchingSteps=d;this.median=t}}const l=new q([0,.6],[.03,.03],[0,0],[.9,.9],[.8,.8],[.7,.7],[.05,.05],b.RayMarchingSteps.SIXTEEN);b={sunny:l,cloudy:new q([.3,.65],[.2,.4],[0,0],[.85,.85],[.75,.75],[.3,
.4],[1,1],b.RayMarchingSteps.TWOHUNDRED,.6),rainy:new q([.6,.8],[.5,.8],[.1,.5],[.9,.9],[.75,.75],[.5,.5],[1,1],b.RayMarchingSteps.TWOHUNDRED,.4),snowy:new q([.25,.75],[.3,.3],[0,0],[.95,.95],[.7,.7],[.69,.75],[.3,1],b.RayMarchingSteps.HUNDRED,.65),foggy:new q([.8,.8],[.5,.5],[0,0],[.95,.95],[.9,.9],[.55,.55],[.3,.3],b.RayMarchingSteps.SIXTEEN),default:l};a.CloudPresets=q;a.cloudPresets=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsTechniqueConfiguration":function(){define(["exports",
"../../../chunks/tslib.es6","../../../core/has","./CloudsData","../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q,l,p){a.RayMarchingSteps=void 0;(function(h){h[h.SIXTEEN=0]="SIXTEEN";h[h.HUNDRED=1]="HUNDRED";h[h.TWOHUNDRED=2]="TWOHUNDRED";h[h.COUNT=3]="COUNT"})(a.RayMarchingSteps||(a.RayMarchingSteps={}));class k extends p.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.steps=a.RayMarchingSteps.SIXTEEN;this.writeTextureChannels=l.CloudsTextureChannels.RG}}
b.__decorate([p.parameter({count:a.RayMarchingSteps.COUNT})],k.prototype,"steps",void 0);b.__decorate([p.parameter({constValue:q("esri-mobile")?1024:2048})],k.prototype,"cubeMapSize",void 0);b.__decorate([p.parameter()],k.prototype,"writeTextureChannels",void 0);a.CloudsTechniqueConfiguration=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/NoiseTextureAtlasDimensions":function(){define(["exports","../../../core/has"],function(a,b){b=b("esri-mobile")?64:
128;const q=Math.ceil(Math.sqrt(b)),l=(b+2)*q;a.atlasSize=l;a.textureScale=b/128;a.tileRows=q;a.tileSize=b;a.weatherMapScale=l/1560;a.weatherMapSize=1E5;a.weatherTileSize=128;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"mat3",q.BindType.Pass,(h,f,c)=>h.setUniformMatrix3fv(p,
k(f,c)))}}a.Matrix3PassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/CloudsTechnique":function(){define("require exports ../../../chunks/Clouds.glsl ./CloudsData ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g extends k.ShaderTechnique{constructor(d,
t){super(d,t,()=>this.destroy())}initializeProgram(d){return new f.Program(d.rctx,g.shader.get().build(this.configuration),h.Default3D)}initializePipeline(){return e.makePipelineState({blending:e.simpleBlendingParams(c.BlendFactor.CONSTANT_COLOR,c.BlendFactor.ONE_MINUS_CONSTANT_COLOR,c.BlendOperation.ADD,this.configuration.writeTextureChannels===l.CloudsTextureChannels.RG?[1,1,0,0]:[0,0,1,1]),depthTest:{func:c.CompareFunction.LEQUAL},colorWrite:e.defaultColorWriteParams})}}g.shader=new p.ReloadableShaderModule(q.Clouds,
()=>new Promise((d,t)=>a(["./Clouds.glsl"],d,t)));b.CloudsTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/NoiseTextureAtlas":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/maybe ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/vec2 ../../../chunks/NoiseTextureAtlas.glsl ./NoiseTextureAtlasConfiguration ./NoiseTextureAtlasDimensions ./NoiseTextureAtlasTechnique ../webgl-engine/lib/glUtil3D ../../webgl/FramebufferObject ../../webgl/TextureDescriptor".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){a.NoiseTextureAtlas=class extends q{constructor(n){super(n);this._needsRender=!0;this._passParameters=new g.NoiseTextureAtlasPassParameters;this._fbo=new m.FramebufferObject(n.context.renderContext.rctx,new r.TextureDescriptor(t.atlasSize));this._vao=v.createQuadVAO(n.context.renderContext.rctx)}get _techniques(){return this.context.techniques}get textureAtlas(){null!=this._texture?null!=this._weatherMapTechnique&&this._weatherMapTechnique.compiled&&this._needsRender&&
(this._texture=this._render(d.NoiseTextureRenderMode.WeatherMap)):null!=this._fullTechnique&&this._fullTechnique.compiled&&(this._texture=this._render(d.NoiseTextureRenderMode.Full));return this._texture}_setDirty(){this._needsRender=!0}updateWeatherMap(n){if(this._passParameters.weatherTile[0]!==n[0]||this._passParameters.weatherTile[1]!==n[1])e.copy(this._passParameters.weatherTile,n),this._setDirty()}destroy(){this._fullTechniqueCached=l.releaseMaybe(this._fullTechniqueCached);this._weatherMapTechniqueCached=
l.releaseMaybe(this._weatherMapTechniqueCached);this._fbo=l.disposeMaybe(this._fbo);this._vao=l.disposeMaybe(this._vao)}get _fullTechnique(){if(null==this._fullTechniqueCached){const n=new d.NoiseTextureAtlasTechniqueConfiguration;n.mode=d.NoiseTextureRenderMode.Full;this._fullTechniqueCached=this._techniques.acquire(w.NoiseTextureAtlasTechnique,n)}return this._fullTechniqueCached}get _weatherMapTechnique(){if(null==this._weatherMapTechniqueCached){const n=new d.NoiseTextureAtlasTechniqueConfiguration;
n.mode=d.NoiseTextureRenderMode.WeatherMap;this._weatherMapTechniqueCached=this._techniques.acquire(w.NoiseTextureAtlasTechnique,n)}return this._weatherMapTechniqueCached}_render(n){if(null==this._vao||null==this._fbo)return null;var u=n===d.NoiseTextureRenderMode.Full?this._fullTechnique:this._weatherMapTechnique;n=this.context.renderContext.rctx;const x=n.getViewport();n.setViewport(0,0,t.atlasSize,t.atlasSize);n.bindFramebuffer(this._fbo);u=n.bindTechnique(u,null,this._passParameters);n.bindVAO(this._vao);
u.assertCompatibleVertexAttributeLocations(this._vao);n.gl.drawArrays(n.gl.TRIANGLE_STRIP,0,4);n.setViewport(x.x,x.y,x.width,x.height);this._needsRender=!1;return this._fbo.colorTexture}};b.__decorate([p.property({constructOnly:!0})],a.NoiseTextureAtlas.prototype,"context",void 0);b.__decorate([p.property({readOnly:!0})],a.NoiseTextureAtlas.prototype,"_techniques",null);a.NoiseTextureAtlas=b.__decorate([c.subclass("esri.views.3d.environment.NoiseTextureAtlas")],a.NoiseTextureAtlas);Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/chunks/NoiseTextureAtlas.glsl":function(){define("exports ../core/libs/gl-matrix-2/factories/vec2f64 ../views/3d/environment/NoiseTextureAtlasConfiguration ../views/3d/environment/NoiseTextureAtlasDimensions ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder".split(" "),
function(a,b,q,l,p,k,h,f){function c(d){const t=new f.ShaderBuilder;t.include(p.ScreenSpacePass,!1);t.fragment.code.add(h.glsl`float remap(float x, float low1, float high1, float low2, float high2) {
return low2 + (x - low1) * (high2 - low2) / (high1 - low1);
}`);d.mode===q.NoiseTextureRenderMode.Full&&t.fragment.code.add(h.glsl`
float saturate(float x) {
return clamp(x, 0.0, 1.0);
}
// Safer modulo for positive and negative values
vec3 modulo(vec3 m, float n){
return mod(mod(m, n) + n, n);
}
vec3 hash(vec3 p3, float frequency){
p3 = modulo(p3, frequency);
p3 = fract(p3 * vec3(0.1031, 0.1030, 0.0973));
p3 += dot(p3, p3.yxz + 33.33);
return -1.0 + 2.0 * fract((p3.xxy + p3.yxx) * p3.zyx);
}
// 5th order polynomial interpolation
vec3 fade(vec3 t){
return (t * t * t) * (t * (t * 6.0 - 15.0) + 10.0);
}
float gradientNoise(vec3 p, float frequency){
// Cell point is in
vec3 i = floor(p);
// Position in the cell in [0, 1]
vec3 f = fract(p);
// Interpolation value for gradient mixing
vec3 u = fade(f);
// Trilinear interpolation of gradients at cube vertices around point
return mix( mix( mix( dot( hash( i + vec3(0.0,0.0,0.0), frequency), f - vec3(0.0,0.0,0.0) ),
dot( hash( i + vec3(1.0,0.0,0.0), frequency), f - vec3(1.0,0.0,0.0) ), u.x),
mix( dot( hash( i + vec3(0.0,1.0,0.0), frequency), f - vec3(0.0,1.0,0.0) ),
dot( hash( i + vec3(1.0,1.0,0.0), frequency), f - vec3(1.0,1.0,0.0) ), u.x), u.y),
mix( mix( dot( hash( i + vec3(0.0,0.0,1.0), frequency), f - vec3(0.0,0.0,1.0) ),
dot( hash( i + vec3(1.0,0.0,1.0), frequency), f - vec3(1.0,0.0,1.0) ), u.x),
mix( dot( hash( i + vec3(0.0,1.0,1.0), frequency), f - vec3(0.0,1.0,1.0) ),
dot( hash( i + vec3(1.0,1.0,1.0), frequency), f - vec3(1.0,1.0,1.0) ), u.x), u.y), u.z );
}
float getPerlinNoise(vec3 pos, float frequency) {
float octaveFrequencyFactor = 2.0;
float sum = 0.0;
float weightSum = 0.0;
float weight = 1.0;
for (int oct = 0; oct < 3; oct++) {
vec3 p = pos * frequency;
float val = 0.5 + 0.5 * gradientNoise(p, frequency);
sum += val * weight;
weightSum += weight;
weight *= 0.5;
frequency *= octaveFrequencyFactor;
}
float noise = (sum / weightSum);
noise = saturate(noise);
return noise;
}
float worley(vec3 pos, float numCells) {
vec3 p = pos * numCells;
float d = 1.0e10;
for (int x = -1; x <= 1; x++) {
for (int y = -1; y <= 1; y++) {
for (int z = -1; z <= 1; z++) {
vec3 tp = floor(p) + vec3(x, y, z);
tp = p - tp - (hash(tp, numCells) * 0.5 + 0.5);
d = min(d, dot(tp, tp));
}
}
}
return 1.0 - clamp(d, 0.0, 1.0);
}
vec3 get3Dfrom2D(vec2 uv) {
vec2 tile = floor(uv);
float z = floor(${h.glsl.float(l.tileRows)} * tile.y + tile.x);
return vec3(fract(uv), z);
}
float getTextureForPointPerlinWorley(vec3 p) {
float perlinNoise = getPerlinNoise(p, ${h.glsl.float(8)});
float worley0 = worley(p, ${h.glsl.float(2)} * 2.0);
float worley1 = worley(p, ${h.glsl.float(2)} * 8.0);
float worley2 = worley(p, ${h.glsl.float(2)} * 14.0);
float worleyFBM = worley0 * 0.625 + worley1 * 0.25 + worley2 * 0.125;
return remap(perlinNoise, 0.0, 1.0, worleyFBM, 1.0);
}
float getTextureForPointWorley(vec3 p) {
float worley0 = worley(p, ${h.glsl.float(2)});
float worley1 = worley(p, ${h.glsl.float(2)} * 2.0);
float worley2 = worley(p, ${h.glsl.float(2)} * 4.0);
float worley3 = worley(p, ${h.glsl.float(2)} * 8.0);
float FBM0 = worley0 * 0.625 + worley1 * 0.25 + worley2 * 0.125;
float FBM1 = worley1 * 0.625 + worley2 * 0.25 + worley3 * 0.125;
float FBM2 = worley2 * 0.75 + worley3 * 0.25;
return FBM0 * 0.625 + FBM1 * 0.25 + FBM2 * 0.125;
}
`);t.fragment.uniforms.add(new k.Float2PassUniform("weatherTile",w=>w.weatherTile));t.fragment.code.add(h.glsl`
vec2 modulo(vec2 m, float n){
return mod(mod(m, n) + n, n);
}
vec2 hash(vec2 p){
// Get position of p in weather tile
p = modulo(p, ${h.glsl.float(l.weatherTileSize)});
// Get global coordinates of p
p += weatherTile * ${h.glsl.float(l.weatherTileSize)};
// Limit position to avoid numerical instability
p = modulo(p, ${h.glsl.float(l.weatherMapSize)});
vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));
p3 += dot(p3, p3.yzx + 33.33);
return 2.0 * fract((p3.xx + p3.yz) * p3.zy) - 1.0;
}
vec2 fade(vec2 t){
return (t * t * t) * (t * (t * 6.0 - 15.0) + 10.0);
}
float gradientNoise(vec2 p){
vec2 i = floor( p );
vec2 f = fract( p );
vec2 u = fade(f);
// Bilinear interpolation of gradients at cell vertices around point
return mix(
mix(dot( hash( i + vec2(0.0,0.0) ), f - vec2(0.0,0.0) ),
dot( hash( i + vec2(1.0,0.0) ), f - vec2(1.0,0.0) ), u.x),
mix(dot( hash( i + vec2(0.0,1.0) ), f - vec2(0.0,1.0) ),
dot( hash( i + vec2(1.0,1.0) ), f - vec2(1.0,1.0) ), u.x),
u.y);
}
float worley(vec2 p){
float d = 1.0e10;
for (int x = -1; x <= 1; x++){
for (int y = -1; y <= 1; y++){
vec2 tp = floor(p) + vec2(x, y);
tp = p - tp - (0.5 + 0.5 * hash(tp));
d = min(d, dot(tp, tp));
}
}
return 1.0 - clamp(d, 0.0, 1.0);
}
`);t.fragment.code.add(h.glsl`void main() {`);d.mode===q.NoiseTextureRenderMode.Full&&t.fragment.code.add(h.glsl`
float padWidth = 1.0;
float paddedSize = ${h.glsl.float(l.tileSize)} + 2.0 * padWidth;
float tileCount = ${h.glsl.float(l.tileRows)} * ${h.glsl.float(l.tileRows)};
vec2 tile = floor((gl_FragCoord.xy - 0.5) / paddedSize);
bool padCell = false;
if (mod(gl_FragCoord.x, paddedSize) == 0.5 || mod(gl_FragCoord.x, paddedSize) == paddedSize - 0.5) {
padCell = true;
}
if (mod(gl_FragCoord.y, paddedSize) == 0.5 || mod(gl_FragCoord.y, paddedSize) == paddedSize - 0.5) {
padCell = true;
}
bool startPadX = false;
bool startPadY = false;
bool endPadX = false;
bool endPadY = false;
if (gl_FragCoord.x == tile.x * paddedSize + 0.5) {
startPadX = true;
}
if (gl_FragCoord.y == tile.y * paddedSize + 0.5) {
startPadY = true;
}
if (gl_FragCoord.x == (tile.x + 1.0) * paddedSize - 0.5) {
endPadX = true;
}
if (gl_FragCoord.y == (tile.y + 1.0) * paddedSize - 0.5) {
endPadY = true;
}
vec2 padding = vec2(2.0 * padWidth) * tile;
vec2 uv;
if (padCell) {
vec2 pixel = gl_FragCoord.xy - padWidth - padding;
if (startPadX) {
pixel.x += ${h.glsl.float(l.tileSize)};
}
if (startPadY) {
pixel.y += ${h.glsl.float(l.tileSize)};
}
if (endPadX) {
pixel.x -= ${h.glsl.float(l.tileSize)};
}
if (endPadY) {
pixel.y -= ${h.glsl.float(l.tileSize)};
}
uv = vec2(pixel.xy / ${h.glsl.float(l.tileSize)});
} else {
vec2 pixel = gl_FragCoord.xy - padWidth - padding;
uv = vec2(pixel.xy / ${h.glsl.float(l.tileSize)});
}
vec3 p_ = get3Dfrom2D(uv);
vec3 p = p_;
p.z /= (${h.glsl.float(l.tileRows)} * ${h.glsl.float(l.tileRows)});
float worleyPerlinNoise = getTextureForPointPerlinWorley(p);
float worleyNoise = getTextureForPointWorley(p);
fragColor.r = saturate(remap(worleyPerlinNoise, worleyNoise, 1.0, 0.0, 1.0));
p_ = mod(p_ + 1.0, ${h.glsl.float(l.tileRows)} * ${h.glsl.float(l.tileRows)});
p = p_;
p.z /= (${h.glsl.float(l.tileRows)} * ${h.glsl.float(l.tileRows)});
worleyPerlinNoise = getTextureForPointPerlinWorley(p);
worleyNoise = getTextureForPointWorley(p);
fragColor.g = saturate(remap(worleyPerlinNoise, worleyNoise, 1.0, 0.0, 1.0));
`);t.fragment.code.add(h.glsl`
vec2 mapUV = ${h.glsl.float(l.weatherTileSize)} * (gl_FragCoord.xy / ${h.glsl.float(l.atlasSize)});
float map = abs(gradientNoise(mapUV));
map = remap(map, 0.25 * (1.0 - worley(8.0 * mapUV)), 1.0, 0.0, 1.0);
${d.mode===q.NoiseTextureRenderMode.Full?h.glsl`fragColor.ba = vec2(0.0, map);`:h.glsl`fragColor = vec4(map);`};
}
`);return t}class e extends h.NoParameters{constructor(){super(...arguments);this.weatherTile=b.fromValues(0,0)}}const g=Object.freeze(Object.defineProperty({__proto__:null,NoiseTextureAtlasPassParameters:e,build:c},Symbol.toStringTag,{value:"Module"}));a.NoiseTextureAtlas=g;a.NoiseTextureAtlasPassParameters=e;a.build=c})},"esri/views/3d/environment/NoiseTextureAtlasConfiguration":function(){define(["exports","../../../chunks/tslib.es6","../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration"],
function(a,b,q){a.NoiseTextureRenderMode=void 0;(function(p){p[p.Full=0]="Full";p[p.WeatherMap=1]="WeatherMap";p[p.COUNT=2]="COUNT"})(a.NoiseTextureRenderMode||(a.NoiseTextureRenderMode={}));class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.mode=a.NoiseTextureRenderMode.Full}}b.__decorate([q.parameter({count:a.NoiseTextureRenderMode.COUNT})],l.prototype,"mode",void 0);a.NoiseTextureAtlasTechniqueConfiguration=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/environment/NoiseTextureAtlasTechnique":function(){define("require exports ../../../chunks/NoiseTextureAtlas.glsl ./NoiseTextureAtlasConfiguration ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g extends k.ShaderTechnique{initializeProgram(d){return new f.Program(d.rctx,
g.shader.get().build(this.configuration),h.Default3D)}initializePipeline(){return e.makePipelineState({blending:this.configuration.mode===l.NoiseTextureRenderMode.Full?e.simpleBlendingParams(c.BlendFactor.ONE,c.BlendFactor.ZERO):e.separateBlendingParams(c.BlendFactor.ZERO,c.BlendFactor.ONE,c.BlendFactor.ONE,c.BlendFactor.ZERO),depthTest:{func:c.CompareFunction.ALWAYS},colorWrite:e.defaultColorWriteParams})}}g.shader=new p.ReloadableShaderModule(q.NoiseTextureAtlas,()=>new Promise((d,t)=>a(["./NoiseTextureAtlas.glsl"],
d,t)));b.NoiseTextureAtlasTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/FramebufferObject":function(){define("exports ../../core/has ../../core/Logger ../../core/maybe ./BufferObject ./checkWebGLError ./enums ./GLObjectType ./Renderbuffer ./Texture".split(" "),function(a,b,q,l,p,k,h,f,c,e){function g(v){return null!=v&&"type"in v&&v.type===f.GLObjectType.Texture}function d(v,m){const r=Math.max(v.width,v.height);return r>m?(q.getLogger("esri.views.webgl.FramebufferObject").warn(`Resizing FBO attachment size ${v.width}x${v.height} to device limit ${m}`),
m/=r,v.width=Math.round(v.width*m),v.height=Math.round(v.height*m),!1):!0}function t(v){return v.descriptor.target===h.TextureType.TEXTURE_CUBE_MAP?h.TextureType.TEXTURE_CUBE_MAP_POSITIVE_X:h.TextureType.TEXTURE_2D}class w{constructor(v,m,r=null){this._context=v;this._glName=null;this._colorAttachments=new Map;this._depthStencilTexture=this._depthStencilBuffer=null;this._initialized=!1;v.instanceCounter.increment(h.ResourceType.FramebufferObject,this);v=g(m)?m:new e.Texture(this._context,m);this._colorAttachments.set(h.ColorAttachment.COLOR_ATTACHMENT0,
v);this._validateTextureDescriptor(v.descriptor);this._validateColorAttachmentPoint(h.ColorAttachment.COLOR_ATTACHMENT0);null!=r&&(g(r)||null!=r&&"pixelFormat"in r?(this._depthStencilTexture=g(r)?r:new e.Texture(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor)):(this._depthStencilBuffer=r=null!=r&&"type"in r&&r.type===f.GLObjectType.RenderBuffer?r:new c.Renderbuffer(this._context,r),this._validateRenderBufferDescriptor(r.descriptor)))}dispose(){if(0!==this._colorAttachments.size||
this._glName){var v=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((m,r)=>this.detachColorTexture(r)?.dispose());this.detachDepthStencilBuffer()?.dispose();this.detachDepthStencilTexture()?.dispose();this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null);this._context.bindFramebuffer(v);this._context.instanceCounter.decrement(h.ResourceType.FramebufferObject,this)}}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(h.ColorAttachment.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||
this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._colorAttachments.get(h.ColorAttachment.COLOR_ATTACHMENT0)?.descriptor?.width??0}get height(){return this._colorAttachments.get(h.ColorAttachment.COLOR_ATTACHMENT0)?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((v,[,m])=>v+m.usedMemory,this.depthStencil?.usedMemory??0)}getColorTexture(v){return(v=this._colorAttachments.get(v))&&g(v)?v:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(v,
m=h.ColorAttachment.COLOR_ATTACHMENT0){v&&(this._validateColorAttachmentPoint(m),this._validateTextureDescriptor(v.descriptor),this.detachColorTexture(m)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(v.glName,m)),this._colorAttachments.set(m,v))}detachColorTexture(v=h.ColorAttachment.COLOR_ATTACHMENT0){const m=this._colorAttachments.get(v);if(m){if(this._initialized){const r=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);
this._framebufferTexture2D(null,v);this._context.bindFramebuffer(r)}this._colorAttachments.delete(v);return m}}setColorTextureTarget(v,m=h.ColorAttachment.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(m);r&&this._framebufferTexture2D(r.glName,m,v)}attachDepthStencil(v){if(v)switch(v.type){case f.GLObjectType.Texture:return this._attachDepthStencilTexture(v);case f.GLObjectType.RenderBuffer:return this._attachDepthStencilBuffer(v)}}_attachDepthStencilTexture(v){if(null!=v){var m=v.descriptor;
m.pixelFormat!==h.PixelFormat.DEPTH_STENCIL&&m.pixelFormat!==h.PixelFormat.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!");m.dataType!==h.PixelType.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!");this._validateTextureDescriptor(m);this._disposeDepthStencilAttachments();this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(v.glName,h.DepthStencilAttachment));this._depthStencilTexture?.dispose();
this._depthStencilTexture=v}}detachDepthStencilTexture(){const v=this._depthStencilTexture;if(v&&this._initialized){const m=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);this._framebufferTexture2D(null,h.DepthStencilAttachment);this._context.bindFramebuffer(m)}this._depthStencilTexture=null;return v}_attachDepthStencilBuffer(v){if(null!=v){var m=v.descriptor;this._validateRenderBufferDescriptor(m);this._disposeDepthStencilAttachments();if(this._initialized){this._context.bindFramebuffer(this);
const r=this._context.gl;m=this._getGLAttachmentPoint(m);r.framebufferRenderbuffer(h.FramebufferTarget.FRAMEBUFFER,m,r.RENDERBUFFER,v.glName)}this._depthStencilBuffer=v}}detachDepthStencilBuffer(){const v=this._depthStencilBuffer;if(v&&this._initialized){const m=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(v.descriptor);r.framebufferRenderbuffer(h.FramebufferTarget.FRAMEBUFFER,n,r.RENDERBUFFER,null);this._context.bindFramebuffer(m)}this._depthStencilBuffer=
null;return v}copyToTexture(v,m,r,n,u,x,y){(0>v||0>m||0>u||0>x)&&console.error("Offsets cannot be negative!");(0>=r||0>=n)&&console.error("Copy width and height must be greater than zero!");var z=y.descriptor;y.descriptor.target!==h.TextureType.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!");(null==z?.width||null==z?.height||v+r>this.width||m+n>this.height||u+r>z.width||x+n>z.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");
z=this._context;y=z.bindTexture(y,e.Texture.TEXTURE_UNIT_FOR_UPDATES);z.setActiveTexture(e.Texture.TEXTURE_UNIT_FOR_UPDATES);z.bindFramebuffer(this);z.gl.copyTexSubImage2D(h.TextureType.TEXTURE_2D,0,u,x,v,m,r,n);z.bindTexture(y,e.Texture.TEXTURE_UNIT_FOR_UPDATES)}readPixels(v,m,r,n,u,x,y){(0>=r||0>=n)&&console.error("Copy width and height must be greater than zero!");y||console.error("Target memory is not initialized!");this._context.bindFramebuffer(this);this._context.gl.readPixels(v,m,r,n,u,x,y)}async readPixelsAsync(v,
m,r,n,u,x,y){const {gl:z}=this._context,A=p.BufferObject.createPixelPack(this._context,h.Usage.STREAM_READ,y.byteLength);this._context.bindBuffer(A);this._context.bindFramebuffer(this);z.readPixels(v,m,r,n,u,x,0);this._context.unbindBuffer(h.BufferType.PIXEL_PACK_BUFFER);await A.getSubDataAsync(y);A.dispose()}resize(v,m){if(this.width!==v||this.height!==m){var r={width:v,height:m};d(r,this._context.parameters.maxTextureSize);this._colorAttachments.forEach(n=>n.resize(r.width,r.height));this._depthStencilTexture?.resize(r.width,
r.height);this._initialized&&(d(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}}initializeAndBind(v=h.FramebufferTarget.FRAMEBUFFER){const m=this._context.gl;if(this._initialized)m.bindFramebuffer(v,this.glName);else{this._glName&&m.deleteFramebuffer(this._glName);var r=m.createFramebuffer();m.bindFramebuffer(v,r);this._colorAttachments.forEach((n,
u)=>this._framebufferTexture2D(n.glName,u,t(n),v));if(this._depthStencilBuffer){const n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);m.framebufferRenderbuffer(v,n,m.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,m.DEPTH_STENCIL_ATTACHMENT,t(this._depthStencilTexture),v);k.webglDebugEnabled()&&m.checkFramebufferStatus(v)!==m.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!");
this._glName=r;this._initialized=!0}}_framebufferTexture2D(v,m=h.ColorAttachment.COLOR_ATTACHMENT0,r=h.TextureType.TEXTURE_2D,n=h.FramebufferTarget.FRAMEBUFFER,u=0){this._context.gl.framebufferTexture2D(n,m,r,v,u)}_disposeDepthStencilAttachments(){const v=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const m=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);v.framebufferRenderbuffer(h.FramebufferTarget.FRAMEBUFFER,m,v.RENDERBUFFER,
null)}this._depthStencilBuffer=l.disposeMaybe(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,v.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=l.disposeMaybe(this._depthStencilTexture))}_validateTextureDescriptor(v){v.target!==h.TextureType.TEXTURE_2D&&v.target!==h.TextureType.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!");d(v,this._context.parameters.maxTextureSize);
this._validateBufferDimensions(v)}_validateRenderBufferDescriptor(v){d(v,this._context.parameters.maxRenderbufferSize);this._validateBufferDimensions(v)}_validateBufferDimensions(v){0>=v.width&&(v.width=this.width);0>=v.height&&(v.height=this.height);0<this.width&&0<this.height&&(this.width!==v.width||this.height!==v.height)&&console.error("Attachment size must match framebuffer size!")}_getGLAttachmentPoint(v){switch(v.internalFormat){case h.RenderbufferFormat.DEPTH_COMPONENT16:case h.RenderbufferFormat.DEPTH_COMPONENT24:case h.RenderbufferFormat.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;
case h.RenderbufferFormat.DEPTH24_STENCIL8:case h.RenderbufferFormat.DEPTH32F_STENCIL8:case h.RenderbufferFormat.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case h.RenderbufferFormat.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(v){if(-1===w._MAX_COLOR_ATTACHMENTS){const {gl:m}=this._context;w._MAX_COLOR_ATTACHMENTS=m.getParameter(m.MAX_COLOR_ATTACHMENTS)}v-=h.ColorAttachment.COLOR_ATTACHMENT0;v+1>w._MAX_COLOR_ATTACHMENTS&&q.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",
`illegal attachment point for color attachment: ${v+1}. Implementation supports up to ${w._MAX_COLOR_ATTACHMENTS} color attachments`)}}w._MAX_COLOR_ATTACHMENTS=-1;a.FramebufferObject=w;a.ensureAttachmentMaxSize=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Renderbuffer":function(){define(["exports","./enums","./GLObjectType","./RenderbufferDescriptor"],function(a,b,q,l){class p{constructor(k,h){this._context=k;this._descriptor=h;this.type=q.GLObjectType.RenderBuffer;
this._context.instanceCounter.increment(b.ResourceType.Renderbuffer,this);k=this._context.gl;this.glName=k.createRenderbuffer();this._context.bindRenderbuffer(this);const {width:f,height:c,internalFormat:e,multisampled:g}=h;g?k.renderbufferStorageMultisample(k.RENDERBUFFER,this.samples,e,f,c):k.renderbufferStorage(k.RENDERBUFFER,e,f,c);this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const k=this._descriptor.samples,h=this._context.parameters.maxSamples;
return k?Math.min(k,h):h}get usedMemory(){return l.estimateMemory(this._descriptor)}resize(k,h){const f=this._descriptor;if(f.width!==k||f.height!==h)f.width=k,f.height=h,k=this._context.gl,this._context.bindRenderbuffer(this),f.multisampled?k.renderbufferStorageMultisample(k.RENDERBUFFER,this.samples,f.internalFormat,f.width,f.height):k.renderbufferStorage(k.RENDERBUFFER,f.internalFormat,f.width,f.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),
this._context.instanceCounter.decrement(b.ResourceType.Renderbuffer,this),this._context=null)}}a.Renderbuffer=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/RenderbufferDescriptor":function(){define(["exports","./Util"],function(a,b){class q{constructor(l,p,k=p){this.internalFormat=l;this.width=p;this.height=k;this.multisampled=!1;this.samples=1}}a.RenderbufferDescriptor=q;a.estimateMemory=function(l){return 0>=l.width||0>=l.height||null==l.internalFormat?0:l.width*
l.height*b.getBytesPerElementFormat(l.internalFormat)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/BindParameters":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../environment/CloudsParameters ../../webgl/RenderCamera ../core/shaderLibrary/hud/HUDRenderStyle ../core/shaderLibrary/shading/MultipassGeometryTest.glsl ../core/shaderLibrary/shading/MultipassTerrainTest.glsl ./basicInterfaces ./RenderSlot ./TransparencyPassType ../lighting/SceneLighting".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){class t{constructor(v,m){this.shadowMap=v;this.slicePlane=m;this.slot=e.RenderSlot.OPAQUE_MATERIAL;this.hasOccludees=!1;this.enableFillLights=!0;this.transparencyPassType=g.TransparencyPassType.NONE;this.alignPixelEnabled=!1;this.decorations=c.Decorations.ON;this.overlayStretch=1;this.viewshedEnabled=!1;this._camera=new p;this._inverseViewport=q.create();this.oldLighting=new d.SceneLighting;this.newLighting=new d.SceneLighting;this._fadedLighting=new d.SceneLighting;
this._lighting=this.newLighting;this.ssr=new w;this.multipassEnabled=!1;this.multipassTerrain=new f.MultipassTerrainUniforms;this.multipassGeometry=new h.MultipassGeometryUniforms;this.hudRenderStyle=k.HUDRenderStyle.Occluded;this.cloudsFade=new l.CloudsParameters;this.shadowHighlightsVisible=!1}get camera(){return this._camera}set camera(v){this._camera=v;this._inverseViewport[0]=1/v.fullViewport[2];this._inverseViewport[1]=1/v.fullViewport[3]}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}get weatherFading(){return this._lighting===
this._fadedLighting}fadeLighting(v){const {oldLighting:m,newLighting:r}=this;1<=v?this._lighting=r:(this._fadedLighting.lerpLighting(m,r,v),this._lighting=this._fadedLighting)}}class w{constructor(){this.fadeFactor=1;this.reprojectionMatrix=b.create()}}a.BindParameters=t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/RenderCamera":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Logger ../../../core/mathUtils ../../../core/screenUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/math/vec2 ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../chunks/vec42 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../geometry/support/frustum ../../../geometry/support/ray ../../../geometry/support/vector ../../ViewingMode ../webgl-engine/lib/fov ../webgl-engine/lib/rendererUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){var B;b=B=class extends b{constructor(E){super(E);this._ray=u.create();this._viewport=r.fromValues(0,0,1,1);this._padding=r.fromValues(0,0,0,0);this._fov=55/180*Math.PI;this._nearFar=t.fromValues(1,1E3);this._viewDirty=!0;this._viewMatrix=g.create();this._viewProjectionDirty=!0;this._viewProjectionMatrix=g.create();this._viewInverseTransposeMatrixDirty=!0;this._viewInverseTransposeMatrix=g.create();this._frustumDirty=!0;this._frustum=n.create();
this._fullViewport=r.create();this._pixelRatio=1;this.column=this.row=0;this._columns=this._rows=1;this._center=v.create();this._up=v.create();this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(E){this._pixelRatio=0<E?E:1}get rows(){return this._rows}set rows(E){this._rows=Math.max(1,E)}get columns(){return this._columns}set columns(E){this._columns=Math.max(1,E)}get eye(){return this._ray.origin}set eye(E){this._compareAndSetView(E,this._ray.origin)}get center(){return this._center}set center(E){this._compareAndSetView(E,
this._center,"_center")}get ray(){w.subtract(this._ray.direction,this.center,this.eye);return this._ray}get up(){return this._up}set up(E){this._compareAndSetView(E,this._up,"_up")}get viewMatrix(){this._ensureViewClean();return this._viewMatrix}set viewMatrix(E){e.copy(this._viewMatrix,E);this.notifyChange("_viewMatrix");this._viewDirty=!1;this._frustumDirty=this._viewProjectionDirty=this._viewInverseTransposeMatrixDirty=!0}get viewForward(){this._ensureViewClean();return w.set(v.create(),-this._viewMatrix[2],
-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){this._ensureViewClean();return w.set(v.create(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){this._ensureViewClean();return w.set(v.create(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(E){this._nearFar[0]!==E&&(this._nearFar[0]=E,this._frustumDirty=this._viewProjectionDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(E){this._nearFar[1]!==
E&&(this._nearFar[1]=E,this._frustumDirty=this._viewProjectionDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(E){this.x=E[0];this.y=E[1];this.width=E[2];this.height=E[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const E=m.scale(r.create(),this._viewport,1/this.pixelRatio),G=this._get("screenViewport");return G&&m.equals(E,G)?G:E}get screenPadding(){if(1===this.pixelRatio)return this._padding;const E=m.scale(r.create(),this._padding,
1/this.pixelRatio),G=this._get("screenPadding");return G&&m.equals(E,G)?G:E}get x(){return this._viewport[0]}set x(E){E+=this._padding[A.PaddingSide.LEFT];this._viewport[0]!==E&&(this._viewport[0]=E,this._frustumDirty=this._viewProjectionDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(E){E+=this._padding[A.PaddingSide.BOTTOM];this._viewport[1]!==E&&(this._viewport[1]=E,this._frustumDirty=this._viewProjectionDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(E){this._viewport[2]!==
E&&(this._viewport[2]=E,this._frustumDirty=this._viewProjectionDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(E){this._viewport[3]!==E&&(this._viewport[3]=E,this._frustumDirty=this._viewProjectionDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[A.PaddingSide.RIGHT]+this._padding[A.PaddingSide.LEFT]}set fullWidth(E){this.width=E-(this._padding[A.PaddingSide.RIGHT]+this._padding[A.PaddingSide.LEFT])}get fullHeight(){return this._viewport[3]+
this._padding[A.PaddingSide.TOP]+this._padding[A.PaddingSide.BOTTOM]}set fullHeight(E){this.height=E-(this._padding[A.PaddingSide.TOP]+this._padding[A.PaddingSide.BOTTOM])}get fullViewport(){this._fullViewport[0]=this._viewport[0]-this._padding[A.PaddingSide.LEFT];this._fullViewport[1]=this._viewport[1]-this._padding[A.PaddingSide.BOTTOM];this._fullViewport[2]=this.fullWidth;this._fullViewport[3]=this.fullHeight;return this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(E){m.exactEquals(this._padding,
E)||(this._viewport[0]+=E[A.PaddingSide.LEFT]-this._padding[A.PaddingSide.LEFT],this._viewport[1]+=E[A.PaddingSide.BOTTOM]-this._padding[A.PaddingSide.BOTTOM],this._viewport[2]-=E[A.PaddingSide.RIGHT]+E[A.PaddingSide.LEFT]-(this._padding[A.PaddingSide.RIGHT]+this._padding[A.PaddingSide.LEFT]),this._viewport[3]-=E[A.PaddingSide.TOP]+E[A.PaddingSide.BOTTOM]-(this._padding[A.PaddingSide.TOP]+this._padding[A.PaddingSide.BOTTOM]),m.copy(this._padding,E),this._frustumDirty=this._viewProjectionDirty=!0,
this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){this._viewProjectionDirty&&(e.multiply(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1);return this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return e.invert(g.create(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||g.create()}get fov(){return this._fov}set fov(E){this._fov=E;this._frustumDirty=
this._viewProjectionDirty=!0}get fovX(){return z.fovd2fovx(this._fov,this.width,this.height)}set fovX(E){this._fov=z.fovx2fovd(E,this.width,this.height);this._frustumDirty=this._viewProjectionDirty=!0}get fovY(){return z.fovd2fovy(this._fov,this.width,this.height)}set fovY(E){this._fov=z.fovy2fovd(E,this.width,this.height);this._frustumDirty=this._viewProjectionDirty=!0}get distance(){return w.distance(this.center,this.eye)}get frustum(){this._recomputeFrustum();return this._frustum}get viewInverseTransposeMatrix(){if(this._viewInverseTransposeMatrixDirty||
this._viewDirty)e.invert(this._viewInverseTransposeMatrix,this.viewMatrix),e.transpose(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1;return this._viewInverseTransposeMatrix}depthNDCToWorld(E){return 2*this.near*this.far/(this.far+this.near-(2*E-1)*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=
this.relativeElevation&&0<=this.relativeElevation}get _projectionMatrixInternal(){var E=this.width,G=this.height,I=this.near*Math.tan(this.fovY/2)*2,O=I*this._aspect,L=I/this.rows,P=O/this.columns;O=-O/2+this.column*P;P=O+P;I=-I/2+this.row*L;L=I+L;E=e.frustum(g.create(),O*(1+2*this._padding[A.PaddingSide.LEFT]/E),P*(1+2*this._padding[A.PaddingSide.RIGHT]/E),I*(1+2*this._padding[A.PaddingSide.BOTTOM]/G),L*(1+2*this._padding[A.PaddingSide.TOP]/G),this.near,this.far);return(G=this._get("projectionMatrix"))&&
e.equals(G,E)?G:E}copyFrom(E){w.copy(this._ray.origin,E.eye);this.center=E.center;this.up=E.up;m.copy(this._viewport,E.viewport);this.notifyChange("_viewport");m.copy(this._padding,E.padding);this.notifyChange("_padding");d.copy(this._nearFar,E.nearFar);this.notifyChange("_nearFar");this._fov=E.fov;this.row=E.row;this.column=E.column;this.rows=E.rows;this.columns=E.columns;this.relativeElevation=E.relativeElevation;this._viewDirty=E._viewDirty;this._viewDirty||(e.copy(this._viewMatrix,E.viewMatrix),
this.notifyChange("_viewMatrix"));this._viewProjectionDirty=!0;this._frustumDirty=E._frustumDirty;this._frustumDirty||(n.copy(this._frustum,E.frustum),this._frustumDirty=!1);E._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(e.copy(this._viewInverseTransposeMatrix,E.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1);m.copy(this._fullViewport,E.fullViewport);this.pixelRatio=E.pixelRatio;return this}copyViewFrom(E){this.eye=E.eye;this.center=E.center;this.up=
E.up}clone(){return(new B).copyFrom(this)}equals(E){return w.exactEquals(this.eye,E.eye)&&w.exactEquals(this.center,E.center)&&w.exactEquals(this.up,E.up)&&m.exactEquals(this._viewport,E.viewport)&&m.exactEquals(this._padding,E.padding)&&d.exactEquals(this.nearFar,E.nearFar)&&this._fov===E.fov&&this.pixelRatio===E.pixelRatio&&this.relativeElevation===E.relativeElevation&&this.row===E.row&&this.column===E.column&&this.rows===E.rows&&this.columns===E.columns}almostEquals(E){var G=Math.max(1,1/this.pixelRatio,
1/E.pixelRatio);if(.001<=Math.abs(E.fov-this._fov)||m.squaredDistance(E.screenPadding,this.screenPadding)>=G||m.squaredDistance(this.screenViewport,E.screenViewport)>=G||this.row!==E.row||this.column!==E.column||this.rows!==E.rows||this.columns!==E.columns)return!1;w.sub(F,E.eye,E.center);w.sub(H,this.eye,this.center);G=w.dot(F,H);const I=w.sqrLen(F),O=w.sqrLen(H);return G*G>=(1-1E-10)*I*O&&w.sqrDist(E.eye,this.eye)<2.5E-7*Math.max(I,O)}computeRenderPixelSizeAt(E){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(E))}computeRenderPixelSizeAtDist(E){return E*
this.perRenderPixelRatio}computeScreenPixelSizeAt(E){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(E))}_viewDirectionDistance(E){return Math.abs(x.projectPointSignedLength(this.viewForward,w.subtract(F,E,this.eye)))}computeScreenPixelSizeAtDist(E){return E*this.perScreenPixelRatio}computeDistanceFromRadius(E,G){return E/Math.tan(Math.min(this.fovX,this.fovY)/(2*(G||1)))}getScreenCenter(E=p.createScreenPointArray()){E[0]=(this.padding[A.PaddingSide.LEFT]+this.width/2)/this.pixelRatio;
E[1]=(this.padding[A.PaddingSide.TOP]+this.height/2)/this.pixelRatio;return E}getRenderCenter(E,G=.5,I=.5){E[0]=this.padding[A.PaddingSide.LEFT]+this.width*G;E[1]=this.padding[A.PaddingSide.BOTTOM]+this.height*I;E[2]=.5;return E}setGLViewport(E){const G=this.viewport,I=this.padding;E.setViewport(G[0]-I[3],G[1]-I[2],G[2]+I[1]+I[3],G[3]+I[0]+I[2])}applyProjection(E,G){E!==C&&w.copy(C,E);C[3]=1;m.transformMat4(C,C,this.projectionMatrix);E=Math.abs(C[3]);w.scale(C,C,1/E);const I=this.fullViewport;G[0]=
l.lerp(0,I[0]+I[2],.5+.5*C[0]);G[1]=l.lerp(0,I[1]+I[3],.5+.5*C[1]);G[2]=.5*(C[2]+1);G[3]=E}unapplyProjection(E,G){const I=this.fullViewport;C[0]=(E[0]/(I[0]+I[2])*2-1)*E[3];C[1]=(E[1]/(I[1]+I[3])*2-1)*E[3];C[2]=(2*E[2]-1)*E[3];C[3]=E[3];null!=this.inverseProjectionMatrix&&(m.transformMat4(C,C,this.inverseProjectionMatrix),G[0]=C[0],G[1]=C[1],G[2]=C[2])}projectToScreen(E,G){this.projectToRenderScreen(E,N);this.renderToScreen(N,G);return G}projectToRenderScreen(E,G){C[0]=E[0];C[1]=E[1];C[2]=E[2];C[3]=
1;m.transformMat4(C,C,this.viewProjectionMatrix);if(0===C[3])return null;E=C;w.scale(E,E,1/Math.abs(C[3]));var I=this.fullViewport;const O=l.lerp(0,I[0]+I[2],.5+.5*E[0]);I=l.lerp(0,I[1]+I[3],.5+.5*E[1]);"x"in G?(G.x=O,G.y=I):(G[0]=O,G[1]=I,2<G.length&&(G[2]=.5*(E[2]+1)));return G}unprojectFromScreen(E,G){return this.unprojectFromRenderScreen(this.screenToRender(E,N),G)}unprojectFromRenderScreen(E,G){e.multiply(D,this.projectionMatrix,this.viewMatrix);if(!e.invert(D,D))return null;const I=this.fullViewport;
C[0]=2*(E[0]-I[0])/I[2]-1;C[1]=2*(E[1]-I[1])/I[3]-1;C[2]=2*E[2]-1;C[3]=1;m.transformMat4(C,C,D);if(0===C[3])return null;G[0]=C[0]/C[3];G[1]=C[1]/C[3];G[2]=C[2]/C[3];return G}constrainWindowSize(E,G,I,O){E*=this.pixelRatio;G*=this.pixelRatio;return[Math.round(Math.max(E-I/2,0)),Math.round(Math.max(this.fullHeight-G-O/2,0)),Math.round(I- -Math.min(E-I/2,0)- -Math.min(this.fullWidth-E-I/2,0)),Math.round(O- -Math.min(this.fullHeight-G-O/2,0)- -Math.min(G-O/2,0))]}computeUp(E){E===y.ViewingMode.Global?
this._computeUpGlobal():this._computeUpLocal()}screenToRender(E,G){const I=this.fullHeight-E[1]*this.pixelRatio;G[0]=E[0]*this.pixelRatio;G[1]=I;return G}renderToScreen(E,G){const I=(this.fullHeight-E[1])/this.pixelRatio;G[0]=E[0]/this.pixelRatio;G[1]=I}_computeUpGlobal(){w.subtract(F,this.center,this.eye);const E=w.length(this.center);1>E?(w.set(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(w.dot(F,this.center))>.9999*w.length(F)*E||(w.cross(this._up,F,this.center),w.cross(this._up,
this._up,F),w.normalize(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){w.direction(F,this.eye,this.center);.9999>=Math.abs(F[2])&&(w.scale(F,F,F[2]),w.set(this._up,-F[0],-F[1],1-F[2]),w.normalize(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(E,G,I=""){"number"===typeof E[0]&&isFinite(E[0])&&"number"===typeof E[1]&&isFinite(E[1])&&"number"===typeof E[2]&&isFinite(E[2])?w.exactEquals(E,G)||(w.copy(G,E),this._markViewDirty(),
I.length&&this.notifyChange(I)):q.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewProjectionDirty=this._frustumDirty=this._viewDirty=!0}_recomputeFrustum(){this._frustumDirty&&(n.fromMatrix(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(e.lookAt(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=
!1,this._viewInverseTransposeMatrixDirty=!0)}};a.__decorate([k.property()],b.prototype,"_viewport",void 0);a.__decorate([k.property()],b.prototype,"_padding",void 0);a.__decorate([k.property()],b.prototype,"_fov",void 0);a.__decorate([k.property()],b.prototype,"_nearFar",void 0);a.__decorate([k.property()],b.prototype,"_viewDirty",void 0);a.__decorate([k.property()],b.prototype,"_viewMatrix",void 0);a.__decorate([k.property()],b.prototype,"_pixelRatio",void 0);a.__decorate([k.property()],b.prototype,
"pixelRatio",null);a.__decorate([k.property()],b.prototype,"row",void 0);a.__decorate([k.property()],b.prototype,"column",void 0);a.__decorate([k.property()],b.prototype,"_rows",void 0);a.__decorate([k.property()],b.prototype,"rows",null);a.__decorate([k.property()],b.prototype,"_columns",void 0);a.__decorate([k.property()],b.prototype,"columns",null);a.__decorate([k.property()],b.prototype,"eye",null);a.__decorate([k.property()],b.prototype,"center",null);a.__decorate([k.property()],b.prototype,
"_center",void 0);a.__decorate([k.property()],b.prototype,"up",null);a.__decorate([k.property()],b.prototype,"_up",void 0);a.__decorate([k.property()],b.prototype,"viewMatrix",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"viewForward",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"viewUp",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"viewRight",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"nearFar",null);a.__decorate([k.property()],b.prototype,
"near",null);a.__decorate([k.property()],b.prototype,"far",null);a.__decorate([k.property()],b.prototype,"viewport",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"screenViewport",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"screenPadding",null);a.__decorate([k.property()],b.prototype,"x",null);a.__decorate([k.property()],b.prototype,"y",null);a.__decorate([k.property()],b.prototype,"width",null);a.__decorate([k.property()],b.prototype,"height",null);a.__decorate([k.property()],
b.prototype,"fullWidth",null);a.__decorate([k.property()],b.prototype,"fullHeight",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"_aspect",null);a.__decorate([k.property()],b.prototype,"padding",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"projectionMatrix",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"inverseProjectionMatrix",null);a.__decorate([k.property()],b.prototype,"fov",null);a.__decorate([k.property()],b.prototype,"fovX",null);a.__decorate([k.property()],
b.prototype,"fovY",null);a.__decorate([k.property()],b.prototype,"viewInverseTransposeMatrix",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"_projectionMatrixInternal",null);a.__decorate([k.property()],b.prototype,"relativeElevation",void 0);a=b=B=a.__decorate([c.subclass("esri.views.3d.webgl.RenderCamera")],b);const C=r.create(),D=g.create(),F=v.create(),H=v.create(),N=p.createRenderScreenPointArray3();return a})},"esri/geometry/support/frustum":function(){define("exports ../../core/ObjectStack ../../core/libs/gl-matrix-2/math/mat4 ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ../../chunks/vec42 ../../core/libs/gl-matrix-2/factories/vec4f64 ./clipRay ./plane ./vectorStacks".split(" "),
function(a,b,q,l,p,k,h,f,c,e){function g(){return[p.create(),p.create(),p.create(),p.create(),p.create(),p.create(),p.create(),p.create()]}function d(n,u){c.fromPoints(u[a.PointIndex.FAR_BOTTOM_LEFT],u[a.PointIndex.NEAR_BOTTOM_LEFT],u[a.PointIndex.NEAR_TOP_LEFT],n[a.PlaneIndex.LEFT]);c.fromPoints(u[a.PointIndex.NEAR_BOTTOM_RIGHT],u[a.PointIndex.FAR_BOTTOM_RIGHT],u[a.PointIndex.FAR_TOP_RIGHT],n[a.PlaneIndex.RIGHT]);c.fromPoints(u[a.PointIndex.FAR_BOTTOM_LEFT],u[a.PointIndex.FAR_BOTTOM_RIGHT],u[a.PointIndex.NEAR_BOTTOM_RIGHT],
n[a.PlaneIndex.BOTTOM]);c.fromPoints(u[a.PointIndex.NEAR_TOP_LEFT],u[a.PointIndex.NEAR_TOP_RIGHT],u[a.PointIndex.FAR_TOP_RIGHT],n[a.PlaneIndex.TOP]);c.fromPoints(u[a.PointIndex.NEAR_BOTTOM_LEFT],u[a.PointIndex.NEAR_BOTTOM_RIGHT],u[a.PointIndex.NEAR_TOP_RIGHT],n[a.PlaneIndex.NEAR]);c.fromPoints(u[a.PointIndex.FAR_BOTTOM_RIGHT],u[a.PointIndex.FAR_BOTTOM_LEFT],u[a.PointIndex.FAR_TOP_LEFT],n[a.PlaneIndex.FAR])}function t(n,u){for(let x=0;6>x;x++)if(!c.clip(n[x],u))return!1;return!0}a.PlaneIndex=void 0;
(function(n){n[n.LEFT=0]="LEFT";n[n.RIGHT=1]="RIGHT";n[n.BOTTOM=2]="BOTTOM";n[n.TOP=3]="TOP";n[n.NEAR=4]="NEAR";n[n.FAR=5]="FAR"})(a.PlaneIndex||(a.PlaneIndex={}));a.PointIndex=void 0;(function(n){n[n.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT";n[n.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT";n[n.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT";n[n.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT";n[n.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT";n[n.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT";n[n.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT";n[n.FAR_TOP_LEFT=7]=
"FAR_TOP_LEFT"})(a.PointIndex||(a.PointIndex={}));const w={bottom:[a.PointIndex.FAR_BOTTOM_RIGHT,a.PointIndex.NEAR_BOTTOM_RIGHT,a.PointIndex.NEAR_BOTTOM_LEFT,a.PointIndex.FAR_BOTTOM_LEFT],near:[a.PointIndex.NEAR_BOTTOM_LEFT,a.PointIndex.NEAR_BOTTOM_RIGHT,a.PointIndex.NEAR_TOP_RIGHT,a.PointIndex.NEAR_TOP_LEFT],far:[a.PointIndex.FAR_BOTTOM_RIGHT,a.PointIndex.FAR_BOTTOM_LEFT,a.PointIndex.FAR_TOP_LEFT,a.PointIndex.FAR_TOP_RIGHT],right:[a.PointIndex.NEAR_BOTTOM_RIGHT,a.PointIndex.FAR_BOTTOM_RIGHT,a.PointIndex.FAR_TOP_RIGHT,
a.PointIndex.NEAR_TOP_RIGHT],left:[a.PointIndex.FAR_BOTTOM_LEFT,a.PointIndex.NEAR_BOTTOM_LEFT,a.PointIndex.NEAR_TOP_LEFT,a.PointIndex.FAR_TOP_LEFT],top:[a.PointIndex.FAR_TOP_LEFT,a.PointIndex.NEAR_TOP_LEFT,a.PointIndex.NEAR_TOP_RIGHT,a.PointIndex.FAR_TOP_RIGHT]},v=[h.fromValues(-1,-1,-1,1),h.fromValues(1,-1,-1,1),h.fromValues(1,1,-1,1),h.fromValues(-1,1,-1,1),h.fromValues(-1,-1,1,1),h.fromValues(1,-1,1,1),h.fromValues(1,1,1,1),h.fromValues(-1,1,1,1)],m=new b.ObjectStack(f.create),r=g();a.computePlanes=
d;a.copy=function(n,u){for(let x=0;6>x;x++)c.copy(n[x],u[x]);return n};a.create=function(n){return n?[c.create(n[0]),c.create(n[1]),c.create(n[2]),c.create(n[3]),c.create(n[4]),c.create(n[5])]:[c.create(),c.create(),c.create(),c.create(),c.create(),c.create()]};a.createPoints=g;a.fromMatrix=function(n,u,x,y=r){n=q.multiply(e.sm4d.get(),u,n);q.invert(n,n);for(u=0;8>u;++u){const z=k.transformMat4(e.sv4d.get(),v[u],n);l.set(y[u],z[0]/z[3],z[1]/z[3],z[2]/z[3])}d(x,y)};a.intersectClipRay=function(n,u){for(let x=
0;6>x;x++)if(!c.clipInfinite(n[x],u))return!1;return!0};a.intersectsLineSegment=function(n,u,x){return t(n,f.fromLineSegmentAndDirection(u,x,m.get()))};a.intersectsPoint=function(n,u){for(let x=0;6>x;x++)if(0<c.signedDistance(n[x],u))return!1;return!0};a.intersectsRay=function(n,u){return t(n,f.fromRay(u,m.get()))};a.intersectsSphere=function(n,u){for(let x=0;6>x;x++){const y=n[x];if(y[0]*u[0]+y[1]*u[1]+y[2]*u[2]+y[3]>=u[3])return!1}return!0};a.numPlanes=6;a.numPoints=8;a.planePointIndices=w;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/clipRay":function(){define(["exports","../../core/ObjectStack","../../chunks/vec32","./ray"],function(a,b,q,l){function p(c){return c?{ray:l.create(c.ray),c0:c.c0,c1:c.c1}:{ray:l.create(),c0:0,c1:Number.MAX_VALUE}}function k(c,e,g,d=p()){l.copy(c,d.ray);d.c0=e;d.c1=g;return d}function h(c,e,g){return q.add(g,c.ray.origin,q.scale(g,c.ray.direction,e))}const f=new b.ObjectStack(()=>p());a.copy=function(c,e=p()){return k(c.ray,c.c0,c.c1,
e)};a.create=p;a.fromLineSegmentAndDirection=function(c,e,g=p()){const d=q.length(c.vector);l.fromValues(c.origin,e,g.ray);g.c0=0;g.c1=d;return g};a.fromRay=function(c,e=p()){l.copy(c,e.ray);e.c0=0;e.c1=Number.MAX_VALUE;return e};a.fromValues=k;a.getAt=h;a.getEnd=function(c,e){return h(c,c.c1,e)};a.getStart=function(c,e){return h(c,c.c0,e)};a.wrap=function(c,e,g){const d=f.get();d.ray=c;d.c0=e;d.c1=g;return d};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/fov":function(){define(["exports"],
function(a){a.fovd2fovx=function(b,q,l){return 2*Math.atan(q*Math.tan(.5*b)/Math.sqrt(q*q+l*l))};a.fovd2fovy=function(b,q,l){return 2*Math.atan(l*Math.tan(.5*b)/Math.sqrt(q*q+l*l))};a.fovx2fovd=function(b,q,l){return 2*Math.atan(Math.sqrt(q*q+l*l)*Math.tan(.5*b)/q)};a.fovy2fovd=function(b,q,l){return 2*Math.atan(Math.sqrt(q*q+l*l)*Math.tan(.5*b)/l)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/rendererUtils":function(){define(["exports","./ChangeSet"],
function(a,b){a.RendererTarget=void 0;(function(q){q[q.Default=0]="Default";q[q.Screenshot=1]="Screenshot";q[q.ObjectAndLayerID=2]="ObjectAndLayerID"})(a.RendererTarget||(a.RendererTarget={}));a.PaddingSide=void 0;(function(q){q[q.TOP=0]="TOP";q[q.RIGHT=1]="RIGHT";q[q.BOTTOM=2]="BOTTOM";q[q.LEFT=3]="LEFT"})(a.PaddingSide||(a.PaddingSide={}));a.splitRenderGeometryChangeSetByMaterial=function(q){const l=new Map,p=k=>{let h=l.get(k);h||(h=new b.MaterialChangeSet,l.set(k,h));return h};q.removes.forAll(k=>
{1<=k.geometry.indexCount&&p(k.material).removes.push(k)});q.adds.forAll(k=>{1<=k.geometry.indexCount&&p(k.material).adds.push(k)});q.updates.forAll(k=>{1<=k.renderGeometry.geometry.indexCount&&p(k.renderGeometry.material).updates.push(k)});return l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ChangeSet":function(){define(["exports","../../../../core/PooledArray"],function(a,b){class q{constructor(){this.adds=new b;this.removes=new b;this.updates=
new b({allocator:k=>k||new l,deallocator:k=>{k.renderGeometry=null;return k}})}clear(){this.adds.clear();this.removes.clear();this.updates.clear()}prune(){this.adds.prune();this.removes.prune();this.updates.prune()}get empty(){return 0===this.adds.length&&0===this.removes.length&&0===this.updates.length}}class l{}class p{constructor(){this.adds=[];this.removes=[];this.updates=[]}}a.ChangeSet=q;a.MaterialChangeSet=p;a.RenderGeometryUpdate=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/core/shaderLibrary/hud/HUDRenderStyle":function(){define(["exports"],function(a){a.HUDRenderStyle=void 0;var b=a.HUDRenderStyle||(a.HUDRenderStyle={});b[b.Occluded=0]="Occluded";b[b.NotOccluded=1]="NotOccluded";b[b.Both=2]="Both";b[b.COUNT=3]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl":function(){define(["exports","../output/ReadDepth.glsl","../../shaderModules/interfaces",
"../../shaderModules/Texture2DPassUniform"],function(a,b,q,l){class p{}a.MultipassGeometryUniforms=p;a.multipassGeometryTest=function(k){k.include(b.ReadDepth);k.uniforms.add(new l.Texture2DPassUniform("geometryDepthTexture",(h,f)=>f.multipassGeometry.depth?.attachment));k.code.add(q.glsl`bool geometryDepthTest(vec2 pos, float elementDepth) {
float geometryDepth = linearDepthFromTexture(geometryDepthTexture, pos);
return (elementDepth < (geometryDepth - 1.0));
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl":function(){define(["exports","../output/ReadDepth.glsl","../../shaderModules/interfaces","../../shaderModules/Texture2DPassUniform"],function(a,b,q,l){class p{constructor(){this.cullAboveGround=!1}}a.MultipassTerrainUniforms=p;a.multipassTerrainTest=function(k,h){if(h.multipassEnabled){k.fragment.include(b.ReadDepth);k.fragment.uniforms.add(new l.Texture2DPassUniform("terrainDepthTexture",
(c,e)=>e.multipassTerrain.depth?.attachment));var f=h.occlusionPass;k.fragment.code.add(q.glsl`
${f?"bool":"void"} terrainDepthTest(float fragmentDepth) {
float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r;
float linearDepth = linearizeDepth(depth);
${f?q.glsl`return fragmentDepth < linearDepth && depth < 1.0;`:q.glsl`
if(fragmentDepth ${h.cullAboveGround?"\x3e":"\x3c\x3d"} linearDepth){
discard;
}`}
}`)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/RenderSlot":function(){define(["exports"],function(a){a.RenderSlot=void 0;var b=a.RenderSlot||(a.RenderSlot={});b[b.INTEGRATED_MESH=0]="INTEGRATED_MESH";b[b.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN";b[b.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL";b[b.OPAQUE_NO_SSAO_DEPTH=3]="OPAQUE_NO_SSAO_DEPTH";b[b.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL";b[b.TRANSPARENT_NO_SSAO_DEPTH=5]="TRANSPARENT_NO_SSAO_DEPTH";
b[b.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN";b[b.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=7]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL";b[b.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN";b[b.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL";b[b.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL";b[b.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS";b[b.OPAQUE_ENVIRONMENT=12]="OPAQUE_ENVIRONMENT";b[b.TRANSPARENT_ENVIRONMENT=13]="TRANSPARENT_ENVIRONMENT";b[b.LASERLINES=14]="LASERLINES";b[b.LASERLINES_CONTRAST_CONTROL=
15]="LASERLINES_CONTRAST_CONTROL";b[b.HUD_MATERIAL=16]="HUD_MATERIAL";b[b.LABEL_MATERIAL=17]="LABEL_MATERIAL";b[b.LINE_CALLOUTS=18]="LINE_CALLOUTS";b[b.LINE_CALLOUTS_HUD_DEPTH=19]="LINE_CALLOUTS_HUD_DEPTH";b[b.DRAPED_MATERIAL=20]="DRAPED_MATERIAL";b[b.DRAPED_WATER=21]="DRAPED_WATER";b[b.VIEWSHED=22]="VIEWSHED";b[b.VOXEL=23]="VOXEL";b[b.MAX_SLOTS=24]="MAX_SLOTS";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TransparencyPassType":function(){define(["exports"],
function(a){a.TransparencyPassType=void 0;var b=a.TransparencyPassType||(a.TransparencyPassType={});b[b.ColorAlpha=0]="ColorAlpha";b[b.FrontFace=1]="FrontFace";b[b.NONE=2]="NONE";b[b.COUNT=3]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lighting/SceneLighting":function(){define("exports ../../../../core/mathUtils ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ./Lightsources ./SphericalHarmonics".split(" "),function(a,
b,q,l,p,k){class h{constructor(){this.color=l.create();this.intensity=1}}class f{constructor(){this.direction=l.create();this.ambient=new h;this.diffuse=new h}}class c{constructor(){this._shOrder=2;this._legacy=new f;this.noonFactor=this.globalFactor=.5;this._sphericalHarmonics=new p.SphericalHarmonicsAmbientLight;this._mainLight=new p.MainLight(l.create(),l.fromValues(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(g){k.combineLights(g,
this._shOrder,this._mainLight,this._sphericalHarmonics);q.copy(this._legacy.direction,this._mainLight.direction);g=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*g;this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*g;this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*g;q.scale(this._legacy.diffuse.color,this._mainLight.intensity,g);q.copy(e,this._legacy.diffuse.color);q.scale(e,e,.4*this.globalFactor);q.add(this._legacy.ambient.color,
this._legacy.ambient.color,e)}copyFrom(g){this._sphericalHarmonics.r=Array.from(g.sh.r);this._sphericalHarmonics.g=Array.from(g.sh.g);this._sphericalHarmonics.b=Array.from(g.sh.b);q.copy(this._mainLight.direction,g.mainLight.direction);q.copy(this._mainLight.intensity,g.mainLight.intensity);this._mainLight.castShadows=g.mainLight.castShadows;this._mainLight.specularStrength=g.mainLight.specularStrength;this._mainLight.environmentStrength=g.mainLight.environmentStrength;this.globalFactor=g.globalFactor;
this.noonFactor=g.noonFactor}lerpLighting(g,d,t){q.lerp(this._mainLight.intensity,g.mainLight.intensity,d.mainLight.intensity,t);this._mainLight.environmentStrength=b.lerp(g.mainLight.environmentStrength,d.mainLight.environmentStrength,t);this._mainLight.specularStrength=b.lerp(g.mainLight.specularStrength,d.mainLight.specularStrength,t);q.copy(this._mainLight.direction,d.mainLight.direction);this._mainLight.castShadows=d.mainLight.castShadows;this.globalFactor=b.lerp(g.globalFactor,d.globalFactor,
t);this.noonFactor=b.lerp(g.noonFactor,d.noonFactor,t);if(g.sh.r.length===d.sh.r.length)for(let w=0;w<d.sh.r.length;w++)this._sphericalHarmonics.r[w]=b.lerp(g.sh.r[w],d.sh.r[w],t),this._sphericalHarmonics.g[w]=b.lerp(g.sh.g[w],d.sh.g[w],t),this._sphericalHarmonics.b[w]=b.lerp(g.sh.b[w],d.sh.b[w],t);else for(g=0;g<d.sh.r.length;g++)this._sphericalHarmonics.r[g]=d.sh.r[g],this._sphericalHarmonics.g[g]=d.sh.g[g],this._sphericalHarmonics.b[g]=d.sh.b[g]}}const e=l.create();a.SceneLighting=c;a.SunLight=
f;a.ambientBoost=.4;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lighting/Lightsources":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b){class q{constructor(h=b.create()){this.intensity=h}}class l{constructor(h=b.create(),f=b.fromValues(.57735,.57735,.57735)){this.intensity=h;this.direction=f}}class p{constructor(h=b.create(),f=b.fromValues(.57735,.57735,.57735),c=!0,e=1,g=1){this.intensity=h;this.direction=
f;this.castShadows=c;this.specularStrength=e;this.environmentStrength=g}}class k{constructor(){this.r=[0];this.g=[0];this.b=[0]}}a.AmbientLight=q;a.FillLight=l;a.MainLight=p;a.SphericalHarmonicsAmbientLight=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lighting/SphericalHarmonics":function(){define("exports ../../../../core/mathUtils ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../lib/LongVectorMath ./Lightsources".split(" "),
function(a,b,q,l,p,k){function h(x){return(x+1)*(x+1)}function f(x){return b.clamp(Math.floor(Math.sqrt(x)-1),0,2)}function c(x,y,z){const A=x[0],B=x[1];x=x[2];z=z||[];z.length=h(y);0<=y&&(z[0]=.28209479177);1<=y&&(z[1]=.4886025119*A,z[2]=.4886025119*x,z[3]=.4886025119*B);2<=y&&(z[4]=1.09254843059*A*B,z[5]=1.09254843059*B*x,z[6]=.31539156525*(3*x*x-1),z[7]=1.09254843059*A*x,z[8]=.54627421529*(A*A-B*B));return z}function e(x,y){x=h(x);y=y||{r:[],g:[],b:[]};y.r.length=y.g.length=y.b.length=x;for(let z=
0;z<x;z++)y.r[z]=y.g[z]=y.b[z]=0;return y}function g(x,y){const z=f(y.r.length);for(const A of x)q.negate(n,A.direction),c(n,z,m),p.elementwiseProduct(m,u),p.scalarProduct(m,A.intensity[0],r),p.add(y.r,r),p.scalarProduct(m,A.intensity[1],r),p.add(y.g,r),p.scalarProduct(m,A.intensity[2],r),p.add(y.b,r);return y}function d(x,y){c(n,0,m);for(const z of x)y.r[0]+=m[0]*u[0]*z.intensity[0]*4*Math.PI,y.g[0]+=m[0]*u[0]*z.intensity[1]*4*Math.PI,y.b[0]+=m[0]*u[0]*z.intensity[2]*4*Math.PI;return y}const t=[],
w=[],v=[],m=[0],r=[0],n=l.create(),u=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];a.combineLights=function(x,y,z,A){e(y,A);q.set(z.intensity,0,0,0);y=!1;t.length=0;w.length=0;v.length=0;for(const B of x)B instanceof k.MainLight&&!y?(q.copy(z.direction,B.direction),q.copy(z.intensity,B.intensity),z.specularStrength=B.specularStrength,z.environmentStrength=B.environmentStrength,z.castShadows=B.castShadows,y=!0):B instanceof k.MainLight||B instanceof k.FillLight?t.push(B):
B instanceof k.AmbientLight?w.push(B):B instanceof k.SphericalHarmonicsAmbientLight&&v.push(B);g(t,A);d(w,A);for(const B of v)p.add(A.r,B.r),p.add(A.g,B.g),p.add(A.b,B.b)};a.computeCoefficients=c;a.initSHCoefficients=e;a.numberOfCoefficients=h;a.orderFromNumberOfCoefficients=f;a.projectAmbientLights=d;a.projectFillLights=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/LongVectorMath":function(){define(["exports"],function(a){a.add=function(b,q,l){l=
l||b;l.length=b.length;for(let p=0;p<b.length;p++)l[p]=b[p]+q[p];return l};a.dotProduct=function(b,q){let l=0;for(let p=0;p<b.length;p++)l+=b[p]*q[p];return l};a.elementwiseProduct=function(b,q,l){l=l||b;l.length=b.length;for(let p=0;p<b.length;p++)l[p]=b[p]*q[p];return l};a.scalarProduct=function(b,q,l){l=l||b;l.length=b.length;for(let p=0;p<b.length;p++)l[p]=b[p]*q;return l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/Scheduler":function(){define("exports ../../core/Handles ../../core/has ../../core/Logger ../../core/maybe ../../core/PerformanceSampler ../../core/PooledArray ../../core/promiseUtils ../../core/reactiveUtils ../../core/signal ../../core/time ../../layers/support/PromiseQueue ./debugFlags ./RenderState ./Yield".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(F){return r.has(F)?r.get(F):"number"===typeof F?F:1}a.TaskPriority=void 0;(function(F){F.RESOURCE_CONTROLLER_IMMEDIATE="immediate";F.RESOURCE_CONTROLLER="schedule";F.SLIDE="slide";F.STREAM_DATA_LOADER="stream loader";F.ELEVATION_QUERY="elevation query";F.TERRAIN_SURFACE="terrain";F.SURFACE_GEOMETRY_UPDATES="surface geometry updates";F.LOD_RENDERER="LoD renderer";F.GRAPHICS_CORE="Graphics3D";F.I3S_CONTROLLER="I3S";F.POINT_CLOUD_LAYER="point cloud";
F.FEATURE_TILE_FETCHER="feature fetcher";F.OVERLAY="overlay";F.STAGE="stage";F.GRAPHICS_DECONFLICTOR="graphics deconflictor";F.FILTER_VISIBILITY="Graphics3D filter visibility";F.SCALE_VISIBILITY="Graphics3D scale visibility";F.FRUSTUM_VISIBILITY="Graphics3D frustum visibility";F.POINT_OF_INTEREST_FREQUENT="POI frequent";F.POINT_OF_INTEREST_INFREQUENT="POI infrequent";F.LABELER="labeler";F.FEATURE_QUERY_ENGINE="feature query";F.FEATURE_TILE_TREE="feature tile tree";F.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree";
F.ELEVATION_ALIGNMENT="elevation alignment";F.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene";F.TEXT_TEXTURE_ATLAS="text texture atlas";F.TEXTURE_UNLOAD="texture unload";F.LINE_OF_SIGHT_TOOL="line of sight tool";F.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool";F.ELEVATION_PROFILE="elevation profile";F.SNAPPING="snapping";F.SHADOW_ACCUMULATOR="shadow accumulator";F.CLOUDS_GENERATOR="clouds generator";F[F.NONE=0]="NONE";F[F.TEST_PRIO=1]="TEST_PRIO"})(a.TaskPriority||(a.TaskPriority=
{}));const r=new Map([[a.TaskPriority.RESOURCE_CONTROLLER_IMMEDIATE,0],[a.TaskPriority.RESOURCE_CONTROLLER,4],[a.TaskPriority.SLIDE,0],[a.TaskPriority.STREAM_DATA_LOADER,0],[a.TaskPriority.ELEVATION_QUERY,0],[a.TaskPriority.TERRAIN_SURFACE,1],[a.TaskPriority.SURFACE_GEOMETRY_UPDATES,1],[a.TaskPriority.LOD_RENDERER,2],[a.TaskPriority.GRAPHICS_CORE,2],[a.TaskPriority.I3S_CONTROLLER,2],[a.TaskPriority.POINT_CLOUD_LAYER,2],[a.TaskPriority.FEATURE_TILE_FETCHER,2],[a.TaskPriority.OVERLAY,4],[a.TaskPriority.STAGE,
4],[a.TaskPriority.GRAPHICS_DECONFLICTOR,4],[a.TaskPriority.FILTER_VISIBILITY,4],[a.TaskPriority.SCALE_VISIBILITY,4],[a.TaskPriority.FRUSTUM_VISIBILITY,4],[a.TaskPriority.CLOUDS_GENERATOR,4],[a.TaskPriority.POINT_OF_INTEREST_FREQUENT,6],[a.TaskPriority.POINT_OF_INTEREST_INFREQUENT,30],[a.TaskPriority.LABELER,8],[a.TaskPriority.FEATURE_QUERY_ENGINE,8],[a.TaskPriority.FEATURE_TILE_TREE,16],[a.TaskPriority.FEATURE_TILE_TREE_ACTIVE,0],[a.TaskPriority.ELEVATION_ALIGNMENT,12],[a.TaskPriority.ELEVATION_ALIGNMENT_SCENE,
14],[a.TaskPriority.TEXT_TEXTURE_ATLAS,12],[a.TaskPriority.TEXTURE_UNLOAD,12],[a.TaskPriority.LINE_OF_SIGHT_TOOL,16],[a.TaskPriority.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[a.TaskPriority.SNAPPING,0],[a.TaskPriority.SHADOW_ACCUMULATOR,30]]),n=g.Milliseconds(6.5),u=g.Milliseconds(1),x=g.Milliseconds(30),y=g.Milliseconds(1E3/30),z=g.Milliseconds(100);var A;(function(F){class H{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(G=>G.needsUpdate)}constructor(){this._updating=
e.signal(!0);this._microTaskQueued=!1;this._frameNumber=0;this.performanceInfo={total:new k("total"),tasks:new Map};this._frameTaskTimes=new Map;this._budget=new E;this._state=w.RenderState.INTERACTING;this._tasks=new h;this._runQueue=new h;this._load=0;this._idleStateCallbacks=new h;this._debug=this._forceTask=this._idleUpdatesStartFired=!1;this._debugHandle=c.watch(()=>t.SCHEDULER_LOG_SLOW_TASKS,G=>this._debug=G,c.initial);for(const G of Object.keys(a.TaskPriority))this.performanceInfo.tasks.set(a.TaskPriority[G],
new k(a.TaskPriority[G]))}destroy(){this._tasks.toArray().forEach(G=>G.remove());this._tasks.clear();p.removeMaybe(this._debugHandle);this._microTaskQueued=!1;this._updatingChanged()}taskRunningChanged(G){this._updatingChanged();G&&0<this._budget.remaining&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,0<this._budget.remaining&&this._schedule()&&this.frame())}))}registerTask(G,I){I=new N(this,G,I);this._tasks.push(I);this._updatingChanged();
this.performanceInfo.tasks.has(G)||this.performanceInfo.tasks.set(G,new k(G));return I}registerIdleStateCallbacks(G,I){const O={idleBegin:G,idleEnd:I};this._idleStateCallbacks.push(O);this.state===w.RenderState.IDLE&&this._idleUpdatesStartFired&&O.idleBegin();const L=this;return{remove:()=>this._removeIdleStateCallbacks(O),set idleBegin(P){L._idleUpdatesStartFired&&(O.idleEnd(),L._state===w.RenderState.IDLE&&P());O.idleBegin=P},set idleEnd(P){O.idleEnd=P}}}get load(){return this._load}set state(G){this._state!==
G&&(this._state=G,this.state!==w.RenderState.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(I=>I.idleEnd())))}get state(){return this._state}updateBudget(G){++this._frameNumber;let I=n,O=G.frameDuration,L=u;switch(this.state){case w.RenderState.IDLE:I=g.Milliseconds(0);O=g.Milliseconds(Math.max(z,G.frameDuration));L=x;break;case w.RenderState.INTERACTING:O=g.Milliseconds(Math.max(y,G.frameDuration))}O=g.Milliseconds(O-G.elapsedFrameTime-I);if(this.state!==
w.RenderState.IDLE&&O<u&&!this._forceTask)return this._forceTask=!0,!1;O=g.Milliseconds(Math.max(O,L));this._budget.reset(O,this.state);this._updateLoad();return this._schedule()}frame(){this._microTaskQueued=this._forceTask=!1;switch(this.state){case w.RenderState.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll(G=>G.idleBegin()));this._runIdle();break;case w.RenderState.INTERACTING:this._runInteracting();break;default:this._runAnimating()}}stopFrame(){this._budget.reset(g.Milliseconds(0),
this._state);this._budget.madeProgress()}_removeIdleStateCallbacks(G){this._idleUpdatesStartFired&&G.idleEnd();this._idleStateCallbacks.removeUnordered(G)}removeTask(G){this._tasks.removeUnordered(G);this._runQueue.removeUnordered(G);this._updatingChanged()}_updateTask(G){this._tasks.forAll(I=>{I.name===G&&I.setPriority(G)})}_getState(G){if(this._runQueue.some(O=>O.name===G))return a.TaskState.SCHEDULED;let I=a.TaskState.IDLE;this._tasks.forAll(O=>{O.name===G&&O.needsUpdate&&(1>=O.schedulePriority?
I=a.TaskState.READY:I!==a.TaskState.READY&&(I=a.TaskState.WAITING))});return I}_getRuntime(G){let I=0;this._tasks.forAll(O=>{O.name===G&&(I+=O.runtime)});return I}_resetRuntimes(){this._tasks.forAll(G=>G.runtime=0)}_getRunning(){const G=new Map;this._tasks.forAll(O=>{O.needsUpdate&&G.set(O.name,(G.get(O.name)||0)+1)});if(0===G.size)return null;let I="";G.forEach((O,L)=>{I=1<O?I+` ${O}x ${L}`:I+` ${L}`});return I}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const G=
this._tasks.reduce((I,O)=>O.needsUpdate?++I:I,0);this._load=.9*this._load+G*(1-.9)}_schedule(){this._runQueue.filterInPlace(G=>{if(G.needsUpdate)return!0;G.schedulePriority=G.basePriority;return!1});for(this._tasks.forAll(G=>{0===G.basePriority&&G.needsUpdate&&!this._runQueue.includes(G)&&G.blockFrame!==this._frameNumber&&this._runQueue.unshift(G)});0===this._runQueue.length;){let G=!1;this._tasks.forAll(I=>{if(I.needsUpdate&&0!==I.schedulePriority&&0!==I.basePriority&&I.blockFrame!==this._frameNumber)switch(G=
!0,I.schedulePriority){case 1:I.schedulePriority=0;this._runQueue.push(I);break;default:--I.schedulePriority}});if(!G)return this._updatingChanged(),!1}this._updatingChanged();return!0}_run(){const G=this._budget.now();this._startFrameTaskTimes();do for(;0<this._runQueue.length;){var I=this._budget.now();const O=this._runQueue.pop();this._budget.resetProgress();try{O.task.runTask(this._budget)===v.Yield&&(O.blockFrame=this._frameNumber)}catch(L){l.getLogger("esri.views.support.Scheduler").error(`Exception in task "${O.name}"`,
L),O.blockFrame=this._frameNumber}!this._budget.hasProgressed&&O.blockFrame!==this._frameNumber&&O.needsUpdate&&(O.blockFrame=this._frameNumber);O.schedulePriority=O.basePriority;I=this._budget.now()-I;O.runtime+=I;this._frameTaskTimes.set(O.priority,this._frameTaskTimes.get(O.priority)+I);if(0>=this._budget.remaining){this._updatingChanged();this._recordFrameTaskTimes(this._budget.now()-G);return}}while(this._schedule());this._updatingChanged();this._recordFrameTaskTimes(this._budget.now()-G)}_startFrameTaskTimes(){for(const G of Object.keys(a.TaskPriority))this._frameTaskTimes.set(a.TaskPriority[G],
0)}_recordFrameTaskTimes(G){this._frameTaskTimes.forEach((I,O)=>this.performanceInfo.tasks.get(O).record(I));this.performanceInfo.total.record(G)}get test(){}}F.Scheduler=H;class N{get task(){return this._task.value}get updating(){return this._queue.running}constructor(G,I,O){this._scheduler=G;this.name=I;this.runtime=this.blockFrame=0;this._queue=new d.PromiseQueue;this._handles=new b;this.schedulePriority=this._basePriority=m(I);this._task=e.signal(null!=O?O:this._queue);this._handles.add(c.when(()=>
this.task.running,L=>G.taskRunningChanged(L)))}remove(){this.processQueue(B);this._scheduler.removeTask(this);this.schedule=D.schedule;this.reschedule=D.reschedule;this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(G){if(this.name!==G){this.name=G;G=m(G);if(0===this._basePriority||0!==this.schedulePriority)this.schedulePriority=G;this._basePriority=G}}get priority(){return this.name}set priority(G){this.setPriority(G)}get needsUpdate(){return this.updating||this.task.running}schedule(G,
I,O){return this._queue.push(G,I,O)}reschedule(G,I,O){return this._queue.unshift(G,I,O)}processQueue(G){return this._queue.runTask(G)}}class E{constructor(){this._begin="undefined"!==typeof performance?performance.now():0;this._budget=0;this._state=w.RenderState.IDLE;this._progressed=this._done=!1;this._enabled=!0}run(G){if(this.done)return!1;!0===G()&&this.madeProgress();return!0}get done(){return this._done}get budget(){return this._budget}madeProgress(){this._progressed=!0;return this._done=this.elapsed>=
this._budget&&this._enabled}get state(){return this._state}get enabled(){return this._enabled}set enabled(G){this._enabled=G}reset(G,I){this._begin=this.now();this._budget=G;this._state=I;this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._done=this._progressed=!1}get hasProgressed(){return this._progressed}}F.Budget=E})(A||={});a.TaskState=void 0;(function(F){F.SCHEDULED=
"s";F.READY="r";F.WAITING="w";F.IDLE="i"})(a.TaskState||(a.TaskState={}));const B=(()=>{const F=new A.Budget;F.enabled=!1;return F})();class C{remove(){}processQueue(){}schedule(F,H,N){try{if(f.isAborted(H)){const E=f.createAbortError();return N?Promise.resolve(N(E)):Promise.reject(E)}return f.when(F(B))}catch(E){return Promise.reject(E)}}reschedule(F,H,N){return this.schedule(F,H,N)}}const D=new C;a.ImmediateTask=D;a.getTaskPriority=m;a.newScheduler=function(){return new A.Scheduler};a.noBudget=
B;a.taskPriorities=r;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/PromiseQueue":function(){define(["exports","../../core/promiseUtils","../../core/signal","../../views/support/Yield"],function(a,b,q,l){class p{constructor(){this._tasks=[];this._runningTasks=q.signal(0)}get length(){return this._tasks.length}get running(){return 0<this._runningTasks.value}destroy(){this.cancelAll()}runTask(h){if(0===this.length)return l.Yield;for(;!h.done&&this._process(h);)h.madeProgress()}push(h,
f,c){++this._runningTasks.value;return(new Promise((e,g)=>this._tasks.push(new k(e,g,h,f,c)))).finally(()=>--this._runningTasks.value)}unshift(h,f,c){++this._runningTasks.value;return(new Promise((e,g)=>this._tasks.unshift(new k(e,g,h,f,c)))).finally(()=>--this._runningTasks.value)}_process(h){if(0===this._tasks.length)return!1;const f=this._tasks.shift();try{const c=b.isAborted(f.signal);if(c&&!f.abortCallback)f.reject(b.createAbortError());else{const e=c?f.abortCallback?.(b.createAbortError()):
f.callback(h);b.isPromiseLike(e)?e.then(f.resolve,f.reject):f.resolve(e)}}catch(c){f.reject(c)}return!0}cancelAll(){const h=b.createAbortError();for(const f of this._tasks)if(f.abortCallback){const c=f.abortCallback(h);f.resolve(c)}else f.reject(h);this._tasks.length=0}}class k{constructor(h,f,c,e,g){this.resolve=h;this.reject=f;this.callback=c;this.signal=e;this.abortCallback=g}}a.PromiseQueue=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/Yield":function(){define(["exports"],
function(a){const b=Symbol("Yield");a.Yield=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/debugFlags":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h){b=class extends b{constructor(){super(...arguments);this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=this.SCHEDULER_LOG_SLOW_TASKS=
!1}};a.__decorate([q.property()],b.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0);a.__decorate([q.property()],b.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0);b=a.__decorate([h.subclass("esri.views.support.debugFlags")],b);return new b})},"esri/views/3d/environment/Fog":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/mathUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ./atmosphereUtils ../../../chunks/Fog.glsl ./FogTechnique ./weather ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/glUtil3D ../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){a.Fog=class extends q{constructor(A){super(A);this._passParameters=new w.FogPassParameters;this._vao=n.createQuadVAO(A.context.renderContext.rctx,r.Pos2Tex);this._technique=new v.FogTechnique(A);A=d.getReferenceEllipsoid(A.view.spatialReference);this._planetRadius=A.radius;this._atmosphereRadius=A.radius+t.atmosphereHeight}destroy(){this._technique.release();this._vao.dispose()}set strength(A){this._passParameters.fogStrength=A}get strength(){return this._passParameters.fogStrength}render(A,
B){this._update(A,B);if(!(0>=this._passParameters.fogAmount)){var C=this._technique;if(C.compiled){var D=A.offscreenRenderingHelper;D.renderDepthDetached(()=>{this._passParameters.depthTexture=D.depthTexture;const F=A.rctx.bindTechnique(C,A.bindParameters,this._passParameters);this._renderFog(F,A)})}else this.context.requestRender()}}_renderFog(A,B){B=B.rctx;B.bindVAO(this._vao);A.assertCompatibleVertexAttributeLocations(this._vao);B.drawArrays(u.PrimitiveType.TRIANGLE_STRIP,0,4)}_update(A,B){var C=
A.bindParameters.camera;e.normalize(y,C.eye);A=Math.max(0,e.dot(y,A.bindParameters.lighting.mainLight.direction));const D=B.color;e.scale(z,D,.1);e.lerp(this._passParameters.fogColor,z,D,A);C=e.length(C.eye);this._passParameters.atmosphereC=C*C-this._atmosphereRadius*this._atmosphereRadius;this._passParameters.fogAmount=(1-l.smoothstep(.95*m.weatherHeightLimit,1*m.weatherHeightLimit,Math.abs(C-this._planetRadius)))*B.amount;this._passParameters.fogStrength=B.strength}};b.__decorate([p.property({constructOnly:!0})],
a.Fog.prototype,"context",void 0);b.__decorate([p.property({constructOnly:!0})],a.Fog.prototype,"view",void 0);b.__decorate([p.property({constructOnly:!0})],a.Fog.prototype,"rctx",void 0);b.__decorate([p.property({constructOnly:!0})],a.Fog.prototype,"viewingMode",void 0);a.Fog=b.__decorate([c.subclass("esri.views.3d.environment.Fog")],a.Fog);class x{constructor(){this.color=g.create();this.amount=this.strength=0}}const y=g.create(),z=g.create();a.FogParameters=x;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/chunks/Fog.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../core/libs/gl-matrix-2/factories/vec3f64 ../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(){const u=new t.ShaderBuilder;u.attributes.add(v.VertexAttribute.POSITION,"vec2");u.include(p.TextureCoordinateAttribute,{textureCoordinateType:p.TextureCoordinateAttributeType.Default});u.varyings.add("worldRay","vec3");u.varyings.add("eyeDir","vec3");const {vertex:x,fragment:y}=u;x.uniforms.add(new d.Matrix4PassUniform("inverseProjectionMatrix",(z,A)=>A.camera.inverseProjectionMatrix),new d.Matrix4PassUniform("inverseViewMatrix",(z,A)=>b.invertOrIdentity(n,
A.camera.viewMatrix)));x.code.add(g.glsl`void main(void) {
vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1, 1)).xyz;
eyeDir = posViewNear;
worldRay = (inverseViewMatrix * vec4(posViewNear, 0)).xyz;
forwardTextureCoordinates();
gl_Position = vec4(position, 1, 1);
}`);y.uniforms.add(new e.FloatPassUniform("atmosphereC",z=>z.atmosphereC),new c.Float3PassUniform("cameraPosition",(z,A)=>A.camera.eye),new f.Float2PassUniform("nearFar",(z,A)=>A.camera.nearFar),new w.Texture2DPassUniform("depthTexture",z=>z.depthTexture),new e.FloatPassUniform("fogStrength",z=>z.fogStrength),new e.FloatPassUniform("fogAmount",z=>z.fogAmount),new c.Float3PassUniform("fogColor",z=>z.fogColor));u.include(h.Gamma);y.include(k.ReadLinearDepth);y.code.add(g.glsl`vec2 sphereIntersect(vec3 start, vec3 dir) {
float a = dot(dir, dir);
float b = 2.0 * dot(dir, start);
float d = (b * b) - 4.0 * a * atmosphereC;
if (d < 0.0) {
return vec2(1e5, -1e5);
}
return vec2((-b - sqrt(d)) / (2.0 * a), (-b + sqrt(d)) / (2.0 * a));
}`);y.code.add(g.glsl`vec4 applyFog(float dist, vec3 rayDir){
if(dist == -1.0){
vec2 rayAtmosphereIntersect = sphereIntersect(cameraPosition, rayDir);
dist = 0.055 * rayAtmosphereIntersect.y;
}
float fogAmount = fogAmount * (1.0 - exp(-dist * fogStrength));
return vec4(fogAmount * fogColor, fogAmount);
}`);y.code.add(g.glsl`vec3 tonemapACES(vec3 x) {
return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
}
void main() {
vec3 rayDir = normalize(worldRay);
float terrainDepth = -1.0;
float depthSample = texture(depthTexture, vuv0).r;
float zNorm = 2.0 * depthSample - 1.0;
float linDepth = 2.0 * nearFar[0] * nearFar[1] / (nearFar[1] + nearFar[0] - zNorm * (nearFar[1] - nearFar[0]));
if(depthSample < 1.0 && depthSample > 0.0){
vec3 cameraSpaceRay = normalize(eyeDir);
cameraSpaceRay /= cameraSpaceRay.z;
cameraSpaceRay *= linDepth;
terrainDepth = max(0.0, length(cameraSpaceRay));
}
vec4 fog = applyFog(terrainDepth, rayDir);
fragColor = delinearizeGamma(vec4(tonemapACES(fog.rgb), fog.a));
}`);return u}class r extends g.NoParameters{constructor(){super(...arguments);this.fogColor=l.create();this.fogStrength=4E-6;this.atmosphereC=1;this.fogAmount=0}}const n=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,FogPassParameters:r,build:m},Symbol.toStringTag,{value:"Module"}));a.Fog=q;a.FogPassParameters=r;a.build=m})},"esri/views/3d/environment/FogTechnique":function(){define("require exports ../../../chunks/Fog.glsl ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e){class g extends p.ShaderTechnique{constructor(d){super(d,new k.ShaderTechniqueConfiguration,()=>this.destroy())}initializeProgram(d){return new f.Program(d.rctx,g.shader.get().build(),h.Default3D)}initializePipeline(){return e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.SRC_ALPHA,c.BlendFactor.ZERO,c.BlendFactor.ONE_MINUS_SRC_ALPHA,c.BlendFactor.ONE),colorWrite:e.defaultColorWriteParams})}}g.shader=new l.ReloadableShaderModule(q.Fog,()=>new Promise((d,
t)=>a(["./Fog.glsl"],d,t)));b.FogTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/LocalAtmosphere":function(){define("exports ../../../core/maybe ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ./AtmosphereType ../../../chunks/SimpleAtmosphere.glsl ./SimpleAtmosphereTechnique ./SimpleAtmosphereTechniqueConfiguration ./resources/SimpleAtmosphereTexture ../support/buffer/glUtil ../support/buffer/InterleavedLayout ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/GeometryUtil ../webgl-engine/lib/VertexArrayObject ../webgl-engine/lib/VertexAttribute ../../webgl/BufferObject ../../webgl/enums ../../webgl/Texture ../../webgl/TextureDescriptor ../../webgl/Util".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){class y{constructor(B,C){this.type=p.AtmosphereType.Local;this._configuration=new f.SimpleAtmosphereTechniqueConfiguration;this._passParameters=new k.SimpleAtmospherePassParameters;this._configuration.geometry=f.SimpleAtmosphereGeometry.Cylinder;this._technique=C.techniques.acquire(h.SimpleAtmosphereTechnique,this._configuration);B=C.renderContext.rctx;C=t.createPolySphereData(1,2,!1);const {data:D,indices:F}=C[0][1];C=A.createBuffer(F.length);const H=
C.position;for(let N=0;N<F.length;++N){const E=3*F[0===N%3?N+2:2===N%3?N-2:N];H.set(N,0,D[E]);H.set(N,1,D[E+1]);H.set(N,2,D[E+2])}this._vao=new w.VertexArrayObject(B,d.Default3D,{geometry:e.glLayout(A)},{geometry:m.BufferObject.createVertex(B,r.Usage.STATIC_DRAW,C.buffer)});this._vaoCount=x.vertexCount(this._vao,"geometry");C=new u.TextureDescriptor;C.wrapMode=r.TextureWrapMode.CLAMP_TO_EDGE;C.flipped=!0;C.width=1;C.height=512;this._passParameters.texture=new n.Texture(B,C,c.earthAtmosphereTextureSimple)}destroy(){this._passParameters.texture=
b.disposeMaybe(this._passParameters.texture);this._vao.dispose();this._technique.release()}render(B){const C=B.rctx,D=C.bindTechnique(this._technique,B.bindParameters,this._passParameters);var F=z;q.copy(F,B.bindParameters.camera.viewMatrix);F[12]=0;F[13]=0;F[14]=0;F[15]=1;D.setUniformMatrix4fv("view",z);C.bindVAO(this._vao);D.assertCompatibleVertexAttributeLocations(this._vao);C.drawArrays(r.PrimitiveType.TRIANGLES,0,this._vaoCount)}renderHaze(){return!1}}const z=l.create(),A=g.newLayout().vec3f(v.VertexAttribute.POSITION);
a.LocalAtmosphere=y;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/SimpleAtmosphere.glsl":function(){define("exports ../core/libs/gl-matrix-2/factories/vec2f64 ../core/libs/gl-matrix-2/factories/vec3f64 ../views/3d/environment/SimpleAtmosphereTechniqueConfiguration ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(u){const x=new d.ShaderBuilder,{vertex:y,fragment:z}=x;k.addMainLightDirection(y);u.geometry===l.SimpleAtmosphereGeometry.Underground?(x.attributes.add(w.VertexAttribute.POSITION,"vec2"),x.varyings.add("color","vec4"),y.uniforms.add(new f.Float3PassUniform("cameraPosition",(A,B)=>B.camera.eye),new c.FloatPassUniform("undergroundFadeAlpha",A=>A.undergroundFadeAlpha)),y.code.add(e.glsl`void main(void) {
float ndotl = dot(normalize(cameraPosition), mainLightDirection);
float lighting = max(0.0, smoothstep(-1.0, 0.8, 2.0 * ndotl));
color = vec4(vec3(lighting), undergroundFadeAlpha);
gl_Position = vec4(position.xy, 1.0, 1.0);
}`),z.code.add(e.glsl`void main() {
fragColor = color;
}`)):(x.include(p.Transform,u),x.attributes.add(w.VertexAttribute.POSITION,"vec3"),x.varyings.add("vtc","vec2"),x.varyings.add("falloff","float"),u=u.geometry===l.SimpleAtmosphereGeometry.Cylinder,y.uniforms.add(new g.Matrix4PassUniform("proj",(A,B)=>B.camera.projectionMatrix),new g.Matrix4PassUniform("view",(A,B)=>B.camera.viewMatrix)),u||(x.varyings.add("innerFactor","float"),y.uniforms.add(new f.Float3PassUniform("silCircleCenter",A=>A.silhouette.center)),y.uniforms.add(new f.Float3PassUniform("silCircleV1",
A=>A.silhouette.v1)),y.uniforms.add(new f.Float3PassUniform("silCircleV2",A=>A.silhouette.v2)),y.uniforms.add(new h.Float2PassUniform("texV",A=>A.texV)),y.uniforms.add(new c.FloatPassUniform("innerScale",A=>A.innerScale))),y.code.add(e.glsl`
void main(void) {
${u?e.glsl`
vec3 pos = position;
float ndotl = mainLightDirection.z;
vtc = vec2(0.0, position.z + 0.05);`:e.glsl`
innerFactor = clamp(-position.z, 0.0, 1.0);
float scale = position.y * (1.0 + innerFactor * innerScale);
float phi = position.x * ${e.glsl.float(.04908738515625)} + 1.0;
vec3 pos = (silCircleCenter + sin(phi) * silCircleV1 + cos(phi) * silCircleV2) * scale;
float ndotl = dot(normalize(position.y > 0.0 ? pos: silCircleCenter), mainLightDirection);
vtc.x = position.x * ${e.glsl.float(.0078125)};
vtc.y = texV.x * (1.0 - position.z) + texV.y * position.z;
`}
falloff = max(0.0, smoothstep(-1.0, 0.8, 2.0 * ndotl));
gl_Position = transformPosition(proj, view, pos);
gl_Position.z = gl_Position.w; // project atmosphere onto the far plane
}
`),z.uniforms.add(new t.Texture2DPassUniform("tex",A=>A.texture)),u||z.uniforms.add(new c.FloatPassUniform("altitudeFade",A=>A.altitudeFade)),z.code.add(e.glsl`
void main() {
vec4 atmosphereColor = texture(tex, vtc) * falloff;
${u?e.glsl`fragColor = atmosphereColor;`:e.glsl`
vec4 innerColor = vec4(atmosphereColor.rgb, 1.0 - altitudeFade);
fragColor = mix(atmosphereColor, innerColor, smoothstep(0.0, 1.0, innerFactor));
`}
}`));return x}class m extends e.NoParameters{constructor(){super(...arguments);this.texV=b.create();this.undergroundFadeAlpha=this.innerScale=this.altitudeFade=0;this.silhouette=new r}}class r{constructor(){this.center=q.create();this.v1=q.create();this.v2=q.create()}}const n=Object.freeze(Object.defineProperty({__proto__:null,SilhouetteCircle:r,SimpleAtmospherePassParameters:m,build:v},Symbol.toStringTag,{value:"Module"}));a.SilhouetteCircle=r;a.SimpleAtmosphere=n;a.SimpleAtmospherePassParameters=
m;a.build=v})},"esri/views/3d/environment/SimpleAtmosphereTechniqueConfiguration":function(){define(["exports","../../../chunks/tslib.es6","../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration","../webgl-engine/materials/DefaultTechniqueConfiguration"],function(a,b,q,l){a.SimpleAtmosphereGeometry=void 0;(function(k){k[k.Cone=0]="Cone";k[k.Cylinder=1]="Cylinder";k[k.Underground=2]="Underground";k[k.COUNT=3]="COUNT"})(a.SimpleAtmosphereGeometry||(a.SimpleAtmosphereGeometry={}));class p extends l.DefaultTechniqueConfiguration{constructor(){super(...arguments);
this.geometry=a.SimpleAtmosphereGeometry.Cone}}b.__decorate([q.parameter({count:a.SimpleAtmosphereGeometry.COUNT})],p.prototype,"geometry",void 0);a.SimpleAtmosphereTechniqueConfiguration=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl","../core/shaderTechnique/BindType","../core/shaderTechnique/ShaderTechniqueConfiguration"],
function(a,b,q,l,p){class k extends q.InstancedDoubleConfiguration{}b.__decorate([p.parameter({constValue:!0})],k.prototype,"hasSliceHighlight",void 0);b.__decorate([p.parameter({constValue:!1})],k.prototype,"hasSliceInVertexProgram",void 0);b.__decorate([p.parameter({constValue:l.BindType.Pass})],k.prototype,"pbrTextureBindType",void 0);a.DefaultTechniqueConfiguration=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl":function(){define("exports ../../../../../../chunks/tslib.es6 ../../../../../../core/libs/gl-matrix-2/math/mat3 ../../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../../chunks/vec32 ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../ShaderOutput ../util/DoublePrecision.glsl ../util/View.glsl ../../shaderModules/Float3DrawUniform ../../shaderModules/interfaces ../../shaderModules/Matrix3PassUniform ../../shaderModules/Matrix4PassUniform ../../shaderTechnique/ShaderTechniqueConfiguration ../../../lib/VertexAttribute ../../../../../webgl/doublePrecisionUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){class n extends v.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.hasModelTransformation=this.instancedDoublePrecision=!1}}b.__decorate([v.parameter()],n.prototype,"instancedDoublePrecision",void 0);b.__decorate([v.parameter()],n.prototype,"hasModelTransformation",void 0);class u extends d.NoParameters{constructor(){super(...arguments);this.modelTransformation=null}}const x=l.create(),y=h.create();a.InstancedDoubleConfiguration=n;a.InstancedDoublePassParameters=
u;a.InstancedDoublePrecision=function(z,A){const B=A.hasModelTransformation,C=A.instancedDoublePrecision;B&&(z.vertex.uniforms.add(new w.Matrix4PassUniform("model",D=>D.modelTransformation??p.IDENTITY)),z.vertex.uniforms.add(new t.Matrix3PassUniform("normalLocalOriginFromModel",D=>{q.normalFromMat4(x,D.modelTransformation??p.IDENTITY);return x})));A.instanced&&C&&(z.attributes.add(m.VertexAttribute.INSTANCEMODELORIGINHI,"vec3"),z.attributes.add(m.VertexAttribute.INSTANCEMODELORIGINLO,"vec3"),z.attributes.add(m.VertexAttribute.INSTANCEMODEL,
"mat3"),z.attributes.add(m.VertexAttribute.INSTANCEMODELNORMAL,"mat3"));z=z.vertex;C&&(z.include(c.DoublePrecision,A),z.uniforms.add(new g.Float3DrawUniform("viewOriginHi",(D,F)=>r.encodeDoubleHi(k.set(y,F.camera.viewInverseTransposeMatrix[3],F.camera.viewInverseTransposeMatrix[7],F.camera.viewInverseTransposeMatrix[11]),y)),new g.Float3DrawUniform("viewOriginLo",(D,F)=>r.encodeDoubleLo(k.set(y,F.camera.viewInverseTransposeMatrix[3],F.camera.viewInverseTransposeMatrix[7],F.camera.viewInverseTransposeMatrix[11]),
y))));z.code.add(d.glsl`
vec3 getVertexInLocalOriginSpace() {
return ${B?C?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":C?"instanceModel * localPosition().xyz":"localPosition().xyz"};
}
vec3 subtractOrigin(vec3 _pos) {
${C?d.glsl`
// Negated inputs are intentionally the first two arguments. The other way around the obfuscation in dpAdd() stopped
// working for macOS 14+ and iOS 17+.
// Issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280
vec3 originDelta = dpAdd(-instanceModelOriginHi, -instanceModelOriginLo, viewOriginHi, viewOriginLo);
return _pos - originDelta;`:"return vpos;"}
}
`);z.code.add(d.glsl`
vec3 dpNormal(vec4 _normal) {
return normalize(${B?C?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":C?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
}
`);A.output===f.ShaderOutput.Normal&&(e.addViewNormal(z),z.code.add(d.glsl`
vec3 dpNormalView(vec4 _normal) {
return normalize((viewNormal * ${B?C?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":C?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz);
}
`));A.hasVertexTangents&&z.code.add(d.glsl`
vec4 dpTransformVertexTangent(vec4 _tangent) {
${B?C?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":C?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput":function(){define(["exports"],function(a){function b(c){return c===a.ShaderOutput.Shadow||c===a.ShaderOutput.ShadowHighlight||c===a.ShaderOutput.ShadowExcludeHighlight||c===a.ShaderOutput.ViewshedShadow}function q(c){return c===a.ShaderOutput.Highlight||c===a.ShaderOutput.ObjectAndLayerIdColor}function l(c){return c===a.ShaderOutput.Color}function p(c){return l(c)||
c===a.ShaderOutput.Highlight}function k(c){return l(c)||q(c)}function h(c){return k(c)||f(c)}function f(c){return c===a.ShaderOutput.Depth}a.ShaderOutput=void 0;(function(c){c[c.Color=0]="Color";c[c.Depth=1]="Depth";c[c.Normal=2]="Normal";c[c.Shadow=3]="Shadow";c[c.ShadowHighlight=4]="ShadowHighlight";c[c.ShadowExcludeHighlight=5]="ShadowExcludeHighlight";c[c.ViewshedShadow=6]="ViewshedShadow";c[c.Highlight=7]="Highlight";c[c.ObjectAndLayerIdColor=8]="ObjectAndLayerIdColor";c[c.COUNT=9]="COUNT"})(a.ShaderOutput||
(a.ShaderOutput={}));a.is2DGeometryOutput=function(c){return c===a.ShaderOutput.Color||q(c)};a.is3DGeometryOutput=function(c){return h(c)||c===a.ShaderOutput.Normal};a.isColor=l;a.isColorHighlightOIDOrDepth=h;a.isColorHighlightOrDepth=function(c){return p(c)||f(c)};a.isColorHighlightOrOID=k;a.isColorOrHighlight=p;a.isColorOrOID=function(c){return l(c)||c===a.ShaderOutput.ObjectAndLayerIdColor};a.isDepth=f;a.isDepthLikeOutput=function(c){return b(c)||c===a.ShaderOutput.Depth||c===a.ShaderOutput.Normal||
c===a.ShaderOutput.ObjectAndLayerIdColor};a.isOIDorHighlight=q;a.isShadowRelatedOutput=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/DoublePrecision.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.DoublePrecision=function({code:q},l){l.doublePrecisionRequiresObfuscation?q.add(b.glsl`vec3 dpPlusFrc(vec3 a, vec3 b) {
return mix(a, a + b, vec3(notEqual(b, vec3(0))));
}
vec3 dpMinusFrc(vec3 a, vec3 b) {
return mix(vec3(0), a - b, vec3(notEqual(a, b)));
}
vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
vec3 t1 = dpPlusFrc(hiA, hiB);
vec3 e = dpMinusFrc(t1, hiA);
vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB;
return t1 + t2;
}`):q.add(b.glsl`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
vec3 t1 = hiA + hiB;
vec3 e = t1 - hiA;
vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB;
return t1 + t2;
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/math/mat4 ../../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../../chunks/vec32 ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../shaderModules/Float3DrawUniform ../../shaderModules/Float3PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/Matrix4DrawUniform ../../shaderModules/Matrix4PassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e){const g=q.create(),d=p.create();a.addCameraPosition=function(t,w){w.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",p.ZEROS):t.uniforms.add(new k.Float3DrawUniform("cameraPosition",(v,m)=>l.set(d,m.camera.viewInverseTransposeMatrix[3]-v.origin[0],m.camera.viewInverseTransposeMatrix[7]-v.origin[1],m.camera.viewInverseTransposeMatrix[11]-v.origin[2])))};a.addPixelRatio=function(t){t.uniforms.add(new f.FloatPassUniform("pixelRatio",(w,v)=>v.camera.pixelRatio/
v.overlayStretch))};a.addProjViewLocalOrigin=function(t,w){w.instancedDoublePrecision?t.uniforms.add(new e.Matrix4PassUniform("proj",(v,m)=>m.camera.projectionMatrix),new e.Matrix4PassUniform("view",(v,m)=>b.translate(g,m.camera.viewMatrix,l.set(d,m.camera.viewInverseTransposeMatrix[3],m.camera.viewInverseTransposeMatrix[7],m.camera.viewInverseTransposeMatrix[11]))),new h.Float3PassUniform("localOrigin",(v,m)=>l.set(d,m.camera.viewInverseTransposeMatrix[3],m.camera.viewInverseTransposeMatrix[7],m.camera.viewInverseTransposeMatrix[11]))):
t.uniforms.add(new e.Matrix4PassUniform("proj",(v,m)=>m.camera.projectionMatrix),new c.Matrix4DrawUniform("view",(v,m)=>b.translate(g,m.camera.viewMatrix,v.origin)),new k.Float3DrawUniform("localOrigin",v=>v.origin))};a.addViewNormal=function(t){t.uniforms.add(new e.Matrix4PassUniform("viewNormal",(w,v)=>v.camera.viewInverseTransposeMatrix))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform":function(){define(["exports",
"./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"mat4",q.BindType.Draw,(h,f,c)=>h.setUniformMatrix4fv(p,k(f,c)))}}a.Matrix4DrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/doublePrecisionUtils":function(){define(["exports"],function(a){const b=new Float32Array(2);a.decodeDoubleArray=function(q,l,p){for(let k=0;k<p;++k)l[k]=q[2*k]+q[2*k+1]};a.encodeDoubleArray=function(q,l,p){for(let k=0;k<
p;++k)l[2*k]=q[k],l[2*k+1]=q[k]-l[2*k]};a.encodeDoubleHi=function(q,l){const p=q.length;for(let k=0;k<p;++k)b[0]=q[k],l[k]=b[0];return l};a.encodeDoubleLo=function(q,l){const p=q.length;for(let k=0;k<p;++k)b[0]=q[k],b[1]=q[k]-b[0],l[k]=b[1];return l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl":function(){define(["exports","./ForwardLinearDepth.glsl","../shaderModules/interfaces"],function(a,b,q){a.Transform=function(l){b.addCalculateLinearDepth(l);
l.vertex.code.add(q.glsl`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
vec4 eye = view * vec4(pos, 1.0);
depth = calculateLinearDepth(nearFar,eye.z);
return proj * eye;
}`);l.vertex.code.add(q.glsl`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
return proj * (view * vec4(pos, 1.0));
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl":function(){define(["exports","./ShaderOutput","./attributes/VertexPosition.glsl","../shaderModules/Float2PassUniform","../shaderModules/interfaces"],function(a,b,q,l,p){function k(c){c.varyings.add("linearDepth","float")}function h(c){c.vertex.uniforms.add(new l.Float2PassUniform("nearFar",(e,g)=>g.camera.nearFar))}function f(c){c.vertex.code.add(p.glsl`float calculateLinearDepth(vec2 nearFar,float z) {
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
}`)}a.ForwardLinearDepth=function(c,e){const {vertex:g}=c;switch(e.output){case b.ShaderOutput.Color:if(e.receiveShadows){k(c);g.code.add(p.glsl`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);return}break;case b.ShaderOutput.Shadow:case b.ShaderOutput.ShadowHighlight:case b.ShaderOutput.ShadowExcludeHighlight:case b.ShaderOutput.ViewshedShadow:c.include(q.VertexPosition,e);k(c);h(c);f(c);g.code.add(p.glsl`void forwardLinearDepth() {
linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
}`);return}g.code.add(p.glsl`void forwardLinearDepth() {}`)};a.addCalculateLinearDepth=f;a.addLinearDepth=k;a.addNearFar=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ./PositionAttribute.glsl ../util/DoublePrecision.glsl ../../shaderModules/Float3DrawUniform ../../shaderModules/Float3PassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix3DrawUniform ../../shaderModules/Matrix3PassUniform ../../shaderModules/Matrix4PassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){class t extends c.NoParameters{constructor(){super(...arguments);this.transformWorldFromViewTH=l.create();this.transformWorldFromViewTL=l.create();this.transformViewFromCameraRelativeRS=b.create();this.transformProjFromView=q.create()}}class w extends c.NoParameters{constructor(){super(...arguments);this.transformWorldFromModelRS=b.create();this.transformWorldFromModelTH=l.create();this.transformWorldFromModelTL=l.create()}}a.VertexPosition=function(v,m){v.include(p.PositionAttribute);
const r=v.vertex;r.include(k.DoublePrecision,m);v.varyings.add("vPositionWorldCameraRelative","vec3");v.varyings.add("vPosition_view","vec3");r.uniforms.add(new f.Float3PassUniform("transformWorldFromViewTH",n=>n.transformWorldFromViewTH),new f.Float3PassUniform("transformWorldFromViewTL",n=>n.transformWorldFromViewTL),new g.Matrix3PassUniform("transformViewFromCameraRelativeRS",n=>n.transformViewFromCameraRelativeRS),new d.Matrix4PassUniform("transformProjFromView",n=>n.transformProjFromView),new e.Matrix3DrawUniform("transformWorldFromModelRS",
n=>n.transformWorldFromModelRS),new h.Float3DrawUniform("transformWorldFromModelTH",n=>n.transformWorldFromModelTH),new h.Float3DrawUniform("transformWorldFromModelTL",n=>n.transformWorldFromModelTL));r.code.add(c.glsl`vec3 positionWorldCameraRelative() {
vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
vec3 transform_CameraRelativeFromModel = dpAdd(
transformWorldFromModelTL,
transformWorldFromModelTH,
-transformWorldFromViewTL,
-transformWorldFromViewTH
);
return transform_CameraRelativeFromModel + rotatedModelPosition;
}`);r.code.add(c.glsl`
void forwardPosition(float fOffset) {
vPositionWorldCameraRelative = positionWorldCameraRelative();
if (fOffset != 0.0) {
vPositionWorldCameraRelative += fOffset * ${m.spherical?c.glsl`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:c.glsl`vec3(0.0, 0.0, 1.0)`};
}
vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
}
`);v.fragment.uniforms.add(new f.Float3PassUniform("transformWorldFromViewTL",n=>n.transformWorldFromViewTL));r.code.add(c.glsl`vec3 positionWorld() {
return transformWorldFromViewTL + vPositionWorldCameraRelative;
}`);v.fragment.code.add(c.glsl`vec3 positionWorld() {
return transformWorldFromViewTL + vPositionWorldCameraRelative;
}`)};a.VertexPositionDrawParameters=w;a.VertexPositionPassParameters=t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl":function(){define(["exports","../../shaderModules/interfaces","../../../lib/VertexAttribute"],function(a,b,q){a.PositionAttribute=function(l){l.attributes.add(q.VertexAttribute.POSITION,"vec3");l.vertex.code.add(b.glsl`vec3 positionModel() { return position; }`)};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"mat3",q.BindType.Draw,(h,f,c)=>h.setUniformMatrix3fv(p,k(f,c)))}}a.Matrix3DrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/SimpleAtmosphereTechnique":function(){define("require exports ../../../chunks/SimpleAtmosphere.glsl ./SimpleAtmosphereTechniqueConfiguration ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e){class g extends k.ShaderTechnique{initializeProgram(d){return new f.Program(d.rctx,g.shader.get().build(this.configuration),h.Default3D)}initializePipeline(){return this.configuration.geometry===l.SimpleAtmosphereGeometry.Cylinder?e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.SRC_ALPHA,c.BlendFactor.ONE,c.BlendFactor.ONE_MINUS_SRC_ALPHA,c.BlendFactor.ONE_MINUS_SRC_ALPHA),culling:e.backFaceCullingParams,depthTest:{func:c.CompareFunction.LEQUAL},
colorWrite:e.defaultColorWriteParams}):e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.SRC_ALPHA,c.BlendFactor.ONE,c.BlendFactor.ONE_MINUS_SRC_ALPHA,c.BlendFactor.ONE_MINUS_SRC_ALPHA),depthTest:{func:c.CompareFunction.LEQUAL},colorWrite:e.defaultColorWriteParams})}}g.shader=new p.ReloadableShaderModule(q.SimpleAtmosphere,()=>new Promise((d,t)=>a(["./SimpleAtmosphere.glsl"],d,t)));b.SimpleAtmosphereTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/resources/SimpleAtmosphereTexture":function(){define(["exports"],
function(a){const b=new Uint8ClampedArray([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,11,0,0,0,
11,0,0,0,11,0,0,0,11,0,0,0,11,0,0,0,12,0,0,0,12,0,0,0,12,0,0,0,12,0,0,0,13,0,0,0,13,0,0,0,13,0,0,0,13,0,0,0,14,0,0,0,14,0,0,0,14,0,0,0,14,0,0,0,15,0,0,0,15,0,0,0,15,0,0,0,15,0,0,0,15,16,0,0,16,16,0,0,16,16,0,0,16,16,0,0,16,15,0,0,17,15,0,0,17,15,0,0,17,15,0,0,17,14,0,0,18,14,0,0,18,14,0,0,18,13,0,0,19,13,0,0,19,13,0,0,19,13,0,0,19,13,0,0,20,13,0,0,20,13,0,0,20,13,0,0,20,12,0,0,21,12,0,0,21,12,0,0,21,12,0,0,21,12,0,0,22,12,0,0,22,12,0,0,22,12,0,0,22,11,0,0,23,11,0,0,23,11,0,0,23,11,0,0,24,11,0,0,24,
11,0,0,24,11,0,0,24,10,0,0,25,10,0,0,25,10,0,0,25,10,0,0,26,10,0,0,26,10,0,0,26,10,0,0,26,9,0,0,27,9,0,0,27,9,0,0,27,18,0,0,28,18,0,0,28,18,0,0,28,18,0,0,28,18,0,0,29,18,0,0,29,18,0,0,29,17,0,0,30,17,0,0,30,17,0,0,30,17,0,0,30,16,0,0,31,16,0,0,31,16,0,0,31,16,0,0,32,16,0,0,32,16,0,0,32,15,0,0,33,15,0,0,33,15,0,0,33,15,0,0,34,15,8,0,34,15,8,0,34,15,8,0,34,15,7,0,35,15,7,0,35,15,7,0,35,21,7,0,36,21,7,0,36,21,7,0,36,21,7,0,37,21,7,0,37,21,7,0,37,20,7,0,38,20,7,0,38,20,7,0,38,20,7,0,39,20,7,0,39,20,7,
0,39,20,7,0,39,19,6,0,40,19,6,0,40,19,6,0,40,19,6,0,41,19,6,0,41,19,6,0,41,18,6,0,42,18,6,0,42,18,6,0,42,24,6,0,43,24,6,0,43,24,6,0,43,23,6,0,44,23,6,0,44,23,6,0,44,23,6,0,45,23,6,0,45,23,6,0,45,22,6,0,46,22,6,0,46,22,6,0,46,22,5,0,47,22,5,0,47,22,5,0,47,21,5,0,48,21,5,0,48,21,5,0,48,21,5,0,49,21,5,0,49,26,5,0,49,25,5,0,50,25,5,0,50,25,5,0,50,25,5,0,51,25,5,0,51,25,5,0,51,25,5,0,52,25,5,0,52,25,5,0,52,24,5,0,53,24,5,0,53,24,5,0,53,24,9,0,54,28,9,0,54,28,9,0,54,28,9,0,55,28,9,0,55,27,9,0,56,27,9,0,
56,27,9,0,56,27,9,4,57,27,9,4,57,27,9,4,57,26,9,4,58,26,9,4,58,26,9,4,58,26,9,4,59,26,9,4,59,26,9,4,59,26,8,4,60,30,8,4,60,30,8,4,60,29,8,4,61,29,8,4,61,29,8,4,62,29,8,4,62,29,8,4,62,28,8,4,63,28,8,4,63,28,8,4,63,28,12,4,64,28,12,4,64,28,12,4,64,27,12,4,65,27,12,8,65,27,12,8,65,31,12,8,66,31,12,8,66,30,11,8,67,30,11,8,67,30,11,8,67,30,11,8,68,30,11,8,68,30,11,8,68,30,15,7,69,30,15,7,69,30,15,7,69,33,15,11,70,33,15,11,70,32,14,11,71,32,14,11,71,32,14,11,71,32,18,14,72,32,18,14,72,32,18,14,72,31,17,
14,73,35,17,14,73,34,17,17,74,34,21,17,74,34,21,17,74,34,20,17,75,34,20,20,75,34,20,20,75,34,23,20,76,34,23,20,76,36,23,23,77,36,23,23,77,36,23,23,77,36,23,23,78,36,26,26,78,36,26,26,78,36,26,26,79,36,26,29,79,38,26,29,80,38,29,29,80,38,29,29,80,38,28,31,81,38,28,31,81,38,31,31,81,37,31,34,82,37,31,34,82,37,31,37,83,40,34,37,83,40,34,37,83,39,33,39,84,39,33,39,84,39,36,42,84,39,36,42,85,39,36,42,85,39,36,42,85,39,39,44,86,39,39,44,86,41,38,47,87,41,41,47,87,41,41,50,87,41,41,49,88,41,41,52,88,40,
43,52,89,43,43,52,89,43,43,54,89,42,45,54,90,42,45,57,90,42,45,57,90,42,45,59,91,42,48,59,91,44,47,61,92,44,47,61,92,44,50,61,92,44,49,63,93,44,49,63,93,44,52,66,93,43,52,65,94,46,54,68,94,46,54,70,95,46,54,70,95,46,54,70,95,45,56,72,96,45,56,72,96,45,58,74,97,47,58,76,97,47,58,76,97,47,60,78,98,47,60,78,98,47,60,81,98,49,62,80,99,49,62,82,99,48,61,84,100,48,64,84,100,48,64,84,100,50,63,86,101,50,66,86,101,50,66,88,101,50,65,90,102,52,67,89,103,51,69,91,104,51,68,92,105,52,69,93,107,52,71,94,108,
54,70,96,109,53,71,96,111,52,73,98,112,54,72,98,114,53,73,100,115,54,72,100,117,54,73,102,118,55,74,104,120,55,76,105,121,56,77,106,123,56,76,107,124,57,79,107,126,58,78,110,128,57,79,111,129,56,80,113,131,58,79,112,132,57,82,114,134,58,81,116,136,60,82,117,137,59,83,117,139,60,83,119,141,59,84,120,142,60,85,122,144,59,86,122,146,60,86,126,148,62,87,127,149,61,88,127,151,62,88,128,153,63,89,130,155,62,90,131,156,63,90,132,158,64,91,134,160,65,91,135,162,64,92,136,163,63,93,138,165,66,95,139,167,65,
95,140,169,66,95,142,171,67,96,142,172,66,97,144,174,67,99,145,176,67,97,148,178,67,99,147,180,68,100,149,181,68,100,150,183,69,101,152,185,70,102,153,187,71,103,155,188,70,103,156,190,70,104,157,192,71,105,158,194,71,106,160,195,72,106,161,197,72,108,161,199,73,108,163,200,73,109,164,202,74,109,165,204,74,110,167,206,75,111,168,207,74,112,170,209,75,112,170,210,76,113,171,212,76,114,173,214,77,115,174,215,78,115,175,217,78,116,175,218,78,117,177,220,78,118,178,221,79,118,180,223,80,120,180,224,81,
120,181,226,81,120,182,227,82,121,184,229,82,122,185,230,84,123,186,232,83,123,187,233,84,124,189,234,84,125,188,235,85,126,189,237,86,126,190,238,86,127,191,239,87,127,192,240,87,129,193,242,88,129,194,243,89,130,195,244,90,131,196,245,90,132,197,246,91,132,197,247,92,133,198,248,92,134,199,249,93,135,200,250,94,136,201,251,95,137,202,252,96,138,203,253,97,140,204,254,98,141,205,254,99,142,206,255,101,143,207,255,102,144,208,255,103,146,209,255,104,147,209,255,106,148,210,255,107,149,211,255,108,
151,212,255,110,152,213,255,111,153,213,255,112,154,214,255,114,156,215,255,115,157,215,255,117,158,216,255,118,160,217,255,120,161,217,255,121,162,218,255,123,164,218,255,124,165,219,255,125,166,219,255,127,167,220,255,129,169,220,255,130,170,221,255,132,171,221,255,133,173,222,255,134,174,222,255,136,175,223,255,139,178,224,255,142,180,224,255,144,182,225,255,147,185,226,255,150,187,226,255,153,189,227,255,155,191,228,255,158,194,228,255,160,196,229,255,163,198,229,255,165,200,230,255,168,202,231,
255,170,203,231,255,172,205,232,255,174,207,232,255,176,209,233,255,178,210,234,255,180,212,234,255,182,214,235,255,184,215,236,255,186,217,237,255,188,219,238,255,190,220,238,255,192,221,239,255,193,222,240,255,194,224,240,255,196,225,241,255,197,226,241,255,198,226,242,255,199,227,242,255,200,228,242,255,201,228,243,255,202,229,243,255,203,230,243,255,204,230,244,255,205,231,244,255,207,232,244,255,208,233,245,255,209,233,245,255,211,234,246,255,213,235,246,255,217,238,247,255,222,240,248,255,226,
242,249,255,231,245,250,255,236,247,251,255,241,249,252,255,245,251,253,255,249,252,254,255,255,255,255,255]);a.earthAtmosphereTextureSimple=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/buffer/glUtil":function(){define(["exports","../../../webgl/enums","../../../webgl/VertexElementDescriptor"],function(a,b,q){const l={u8:b.DataType.UNSIGNED_BYTE,u16:b.DataType.UNSIGNED_SHORT,u32:b.DataType.UNSIGNED_INT,i8:b.DataType.BYTE,i16:b.DataType.SHORT,i32:b.DataType.INT,
f32:b.DataType.FLOAT};a.glLayout=function(p,k=0){const h=p.stride;return Array.from(p.fields.keys()).map(f=>{const c=p.fields.get(f),e=c.constructor.ElementCount;var g=l[c.constructor.ElementType];if(!g)throw Error("BufferType not supported in WebGL");return new q.VertexElementDescriptor(f,e,g,c.offset,h,c.optional?.glNormalized??!1,k)})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/buffer/InterleavedLayout":function(){define(["exports","../../../../geometry/support/buffer/BufferView",
"../../../../geometry/support/buffer/types","../../webgl-engine/lib/Util"],function(a,b,q,l){class p{constructor(e,g){this.layout=e;this.buffer="number"===typeof g?new ArrayBuffer(g*e.stride):g;for(const d of e.fields.keys())g=e.fields.get(d),this[d]=new g.constructor(this.buffer,g.offset,this.stride)}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,g){return(e=this[e])&&e.elementCount===g.ElementCount&&
e.elementType===g.ElementType?e:null}slice(e,g){return new p(this.layout,this.buffer.slice(e*this.stride,g*this.stride))}copyFrom(e,g=0,d=0,t=e.count){const w=this.stride;0===w%4?(e=new Uint32Array(e.buffer,g*w,t*w/4),(new Uint32Array(this.buffer,d*w,t*w/4)).set(e)):(e=new Uint8Array(e.buffer,g*w,t*w),(new Uint8Array(this.buffer,d*w,t*w)).set(e));return this}get usedMemory(){return this.byteLength}dispose(){}}class k{constructor(e=null){this._lastAligned=this._stride=0;this._fields=new Map;e&&(this._stride=
e.stride,e.fields.forEach(g=>this._fields.set(g[0],{...g[1],constructor:c.get(g[1].constructor)})))}freeze(){return this}vec2f(e,g){this._appendField(e,b.BufferViewVec2f,g);return this}vec2f64(e,g){this._appendField(e,b.BufferViewVec2f64,g);return this}vec3f(e,g){this._appendField(e,b.BufferViewVec3f,g);return this}vec3f64(e,g){this._appendField(e,b.BufferViewVec3f64,g);return this}vec4f(e,g){this._appendField(e,b.BufferViewVec4f,g);return this}vec4f64(e,g){this._appendField(e,b.BufferViewVec4f64,
g);return this}mat3f(e,g){this._appendField(e,b.BufferViewMat3f,g);return this}mat3f64(e,g){this._appendField(e,b.BufferViewMat3f64,g);return this}mat4f(e,g){this._appendField(e,b.BufferViewMat4f,g);return this}mat4f64(e,g){this._appendField(e,b.BufferViewMat4f64,g);return this}vec4u8(e,g){this._appendField(e,b.BufferViewVec4u8,g);return this}f32(e,g){this._appendField(e,b.BufferViewFloat,g);return this}f64(e,g){this._appendField(e,b.BufferViewFloat64,g);return this}u8(e,g){this._appendField(e,b.BufferViewUint8,
g);return this}u16(e,g){this._appendField(e,b.BufferViewUint16,g);return this}i8(e,g){this._appendField(e,b.BufferViewInt8,g);return this}vec2i8(e,g){this._appendField(e,b.BufferViewVec2i8,g);return this}vec2i16(e,g){this._appendField(e,b.BufferViewVec2i16,g);return this}vec2u8(e,g){this._appendField(e,b.BufferViewVec2u8,g);return this}vec4u16(e,g){this._appendField(e,b.BufferViewVec4u16,g);return this}u32(e,g){this._appendField(e,b.BufferViewUint32,g);return this}_appendField(e,g,d){if(this._fields.has(e))l.assert(!1,
`${e} already added to vertex buffer layout`);else{var t=g.ElementCount*q.elementTypeSize(g.ElementType),w=this._stride;this._stride+=t;this._fields.set(e,{size:t,constructor:g,offset:w,optional:d})}}createBuffer(e){return new p(this,e)}createView(e){return new p(this,e)}clone(){const e=new k;e._stride=this._stride;e._fields=new Map;this._fields.forEach((g,d)=>e._fields.set(d,g));e.BufferType=this.BufferType;return e}get stride(){if(this._lastAligned!==this._fields.size){let e=1;this._fields.forEach(g=>
e=Math.max(e,q.elementTypeSize(g.constructor.ElementType)));this._stride=Math.floor((this._stride+e-1)/e)*e;this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}class h{constructor(e){this.fields=[];e.fields.forEach((g,d)=>{var t=g.constructor;this.fields.push([d,{...g,constructor:`${t.ElementType}_${t.ElementCount}`}])});this.stride=e.stride}}const f=[b.BufferViewFloat,b.BufferViewVec2f,b.BufferViewVec3f,b.BufferViewVec4f,b.BufferViewMat3f,b.BufferViewMat4f,b.BufferViewFloat64,
b.BufferViewVec2f64,b.BufferViewVec3f64,b.BufferViewVec4f64,b.BufferViewMat3f64,b.BufferViewMat4f64,b.BufferViewUint8,b.BufferViewVec2u8,b.BufferViewVec3u8,b.BufferViewVec4u8,b.BufferViewUint16,b.BufferViewVec2u16,b.BufferViewVec3u16,b.BufferViewVec4u16,b.BufferViewUint32,b.BufferViewVec2u32,b.BufferViewVec3u32,b.BufferViewVec4u32,b.BufferViewInt8,b.BufferViewVec2i8,b.BufferViewVec3i8,b.BufferViewVec4i8,b.BufferViewInt16,b.BufferViewVec2i16,b.BufferViewVec3i16,b.BufferViewVec4i16,b.BufferViewInt32,
b.BufferViewVec2i32,b.BufferViewVec3i32,b.BufferViewVec4i32],c=new Map;f.forEach(e=>c.set(`${e.ElementType}_${e.ElementCount}`,e));a.InterleavedBuffer=p;a.InterleavedLayout=k;a.PackedLayout=h;a.newLayout=function(){return new k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/BufferView":function(){define("exports ./internals/Mat3 ./internals/Mat4 ./internals/Scalar ./internals/Vec2 ./internals/Vec3 ./internals/Vec4".split(" "),function(a,b,q,l,p,k,h){class f extends l.BufferViewScalarImpl{constructor(T,
Y=0,ha,ba){super(Float32Array,T,Y,ha,ba);this.elementType="f32"}static fromTypedArray(T,Y){return new f(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}f.ElementType="f32";class c extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Float32Array,T,Y,ha,ba);this.elementType="f32"}slice(T,Y){return this.sliceBuffer(c,T,Y)}static fromTypedArray(T,Y){return new c(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}c.ElementType="f32";class e extends k.BufferViewVec3Impl{constructor(T,Y=0,ha,
ba){super(Float32Array,T,Y,ha,ba);this.elementType="f32"}slice(T,Y){return this.sliceBuffer(e,T,Y)}static fromTypedArray(T,Y){return new e(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}e.ElementType="f32";class g extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Float32Array,T,Y,ha,ba);this.elementType="f32"}slice(T,Y){return this.sliceBuffer(g,T,Y)}static fromTypedArray(T,Y){return new g(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}g.ElementType="f32";class d extends b.BufferViewMat3Impl{constructor(T,
Y=0,ha,ba){super(Float32Array,T,Y,ha,ba);this.elementType="f32"}slice(T,Y){return this.sliceBuffer(d,T,Y)}static fromTypedArray(T,Y){return new d(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}d.ElementType="f32";class t extends b.BufferViewMat3Impl{constructor(T,Y=0,ha,ba){super(Float64Array,T,Y,ha,ba);this.elementType="f64"}slice(T,Y){return this.sliceBuffer(t,T,Y)}static fromTypedArray(T,Y){return new t(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}t.ElementType="f64";class w extends q.BufferViewMat4Impl{constructor(T,
Y=0,ha,ba){super(Float32Array,T,Y,ha,ba);this.elementType="f32"}slice(T,Y){return this.sliceBuffer(w,T,Y)}static fromTypedArray(T,Y){return new w(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}w.ElementType="f32";class v extends q.BufferViewMat4Impl{constructor(T,Y=0,ha,ba){super(Float64Array,T,Y,ha,ba);this.elementType="f64"}slice(T,Y){return this.sliceBuffer(v,T,Y)}static fromTypedArray(T,Y){return new v(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}v.ElementType="f64";class m extends l.BufferViewScalarImpl{constructor(T,
Y=0,ha,ba){super(Float64Array,T,Y,ha,ba);this.elementType="f64"}slice(T,Y){return this.sliceBuffer(m,T,Y)}static fromTypedArray(T,Y){return new m(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}m.ElementType="f64";class r extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Float64Array,T,Y,ha,ba);this.elementType="f64"}slice(T,Y){return this.sliceBuffer(r,T,Y)}static fromTypedArray(T,Y){return new r(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}r.ElementType="f64";class n extends k.BufferViewVec3Impl{constructor(T,
Y=0,ha,ba){super(Float64Array,T,Y,ha,ba);this.elementType="f64"}slice(T,Y){return this.sliceBuffer(n,T,Y)}static fromTypedArray(T,Y){return new n(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}n.ElementType="f64";class u extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Float64Array,T,Y,ha,ba);this.elementType="f64"}slice(T,Y){return this.sliceBuffer(u,T,Y)}static fromTypedArray(T,Y){return new u(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}u.ElementType="f64";class x extends l.BufferViewScalarImpl{constructor(T,
Y=0,ha,ba){super(Uint8Array,T,Y,ha,ba);this.elementType="u8"}slice(T,Y){return this.sliceBuffer(x,T,Y)}static fromTypedArray(T,Y){return new x(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}x.ElementType="u8";class y extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Uint8Array,T,Y,ha,ba);this.elementType="u8"}slice(T,Y){return this.sliceBuffer(y,T,Y)}static fromTypedArray(T,Y){return new y(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}y.ElementType="u8";class z extends k.BufferViewVec3Impl{constructor(T,
Y=0,ha,ba){super(Uint8Array,T,Y,ha,ba);this.elementType="u8"}slice(T,Y){return this.sliceBuffer(z,T,Y)}static fromTypedArray(T,Y){return new z(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}z.ElementType="u8";class A extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Uint8Array,T,Y,ha,ba);this.elementType="u8"}slice(T,Y){return this.sliceBuffer(A,T,Y)}static fromTypedArray(T,Y){return new A(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}A.ElementType="u8";class B extends l.BufferViewScalarImpl{constructor(T,
Y=0,ha,ba){super(Uint16Array,T,Y,ha,ba);this.elementType="u16"}slice(T,Y){return this.sliceBuffer(B,T,Y)}static fromTypedArray(T,Y){return new B(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}B.ElementType="u16";class C extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Uint16Array,T,Y,ha,ba);this.elementType="u16"}slice(T,Y){return this.sliceBuffer(C,T,Y)}static fromTypedArray(T,Y){return new C(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}C.ElementType="u16";class D extends k.BufferViewVec3Impl{constructor(T,
Y=0,ha,ba){super(Uint16Array,T,Y,ha,ba);this.elementType="u16"}slice(T,Y){return this.sliceBuffer(D,T,Y)}static fromTypedArray(T,Y){return new D(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}D.ElementType="u16";class F extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Uint16Array,T,Y,ha,ba);this.elementType="u16"}slice(T,Y){return this.sliceBuffer(F,T,Y)}static fromTypedArray(T,Y){return new F(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}F.ElementType="u16";class H extends l.BufferViewScalarImpl{constructor(T,
Y=0,ha,ba){super(Uint32Array,T,Y,ha,ba);this.elementType="u32"}slice(T,Y){return this.sliceBuffer(H,T,Y)}static fromTypedArray(T,Y){return new H(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}H.ElementType="u32";class N extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Uint32Array,T,Y,ha,ba);this.elementType="u32"}slice(T,Y){return this.sliceBuffer(N,T,Y)}static fromTypedArray(T,Y){return new N(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}N.ElementType="u32";class E extends k.BufferViewVec3Impl{constructor(T,
Y=0,ha,ba){super(Uint32Array,T,Y,ha,ba);this.elementType="u32"}slice(T,Y){return this.sliceBuffer(E,T,Y)}static fromTypedArray(T,Y){return new E(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}E.ElementType="u32";class G extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Uint32Array,T,Y,ha,ba);this.elementType="u32"}slice(T,Y){return this.sliceBuffer(G,T,Y)}static fromTypedArray(T,Y){return new G(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}G.ElementType="u32";class I extends l.BufferViewScalarImpl{constructor(T,
Y=0,ha,ba){super(Int8Array,T,Y,ha,ba);this.elementType="i8"}slice(T,Y){return this.sliceBuffer(I,T,Y)}static fromTypedArray(T,Y){return new I(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}I.ElementType="i8";class O extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Int8Array,T,Y,ha,ba);this.elementType="i8"}slice(T,Y){return this.sliceBuffer(O,T,Y)}static fromTypedArray(T,Y){return new O(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}O.ElementType="i8";class L extends k.BufferViewVec3Impl{constructor(T,
Y=0,ha,ba){super(Int8Array,T,Y,ha,ba);this.elementType="i8"}slice(T,Y){return this.sliceBuffer(L,T,Y)}static fromTypedArray(T,Y){return new L(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}L.ElementType="i8";class P extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Int8Array,T,Y,ha,ba);this.elementType="i8"}slice(T,Y){return this.sliceBuffer(P,T,Y)}static fromTypedArray(T,Y){return new P(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}P.ElementType="i8";class M extends l.BufferViewScalarImpl{constructor(T,
Y=0,ha,ba){super(Int16Array,T,Y,ha,ba);this.elementType="i16"}slice(T,Y){return this.sliceBuffer(M,T,Y)}static fromTypedArray(T,Y){return new M(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}M.ElementType="i16";class K extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Int16Array,T,Y,ha,ba);this.elementType="i16"}slice(T,Y){return this.sliceBuffer(K,T,Y)}static fromTypedArray(T,Y){return new K(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}K.ElementType="i16";class J extends k.BufferViewVec3Impl{constructor(T,
Y=0,ha,ba){super(Int16Array,T,Y,ha,ba);this.elementType="i16"}slice(T,Y){return this.sliceBuffer(J,T,Y)}static fromTypedArray(T,Y){return new J(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}J.ElementType="i16";class R extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Int16Array,T,Y,ha,ba);this.elementType="i16"}slice(T,Y){return this.sliceBuffer(R,T,Y)}static fromTypedArray(T,Y){return new R(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}R.ElementType="i16";class Q extends l.BufferViewScalarImpl{constructor(T,
Y=0,ha,ba){super(Int32Array,T,Y,ha,ba);this.elementType="i32"}slice(T,Y){return this.sliceBuffer(Q,T,Y)}static fromTypedArray(T,Y){return new Q(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}Q.ElementType="i32";class W extends p.BufferViewVec2Impl{constructor(T,Y=0,ha,ba){super(Int32Array,T,Y,ha,ba);this.elementType="i32"}slice(T,Y){return this.sliceBuffer(W,T,Y)}static fromTypedArray(T,Y){return new W(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}W.ElementType="i32";class S extends k.BufferViewVec3Impl{constructor(T,
Y=0,ha,ba){super(Int32Array,T,Y,ha,ba);this.elementType="i32"}slice(T,Y){return this.sliceBuffer(S,T,Y)}static fromTypedArray(T,Y){return new S(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}S.ElementType="i32";class V extends h.BufferViewVec4Impl{constructor(T,Y=0,ha,ba){super(Int32Array,T,Y,ha,ba);this.elementType="i32"}slice(T,Y){return this.sliceBuffer(V,T,Y)}static fromTypedArray(T,Y){return new V(T.buffer,T.byteOffset,Y,T.byteOffset+T.byteLength)}}V.ElementType="i32";a.BufferViewFloat=
f;a.BufferViewFloat64=m;a.BufferViewInt16=M;a.BufferViewInt32=Q;a.BufferViewInt8=I;a.BufferViewMat3f=d;a.BufferViewMat3f64=t;a.BufferViewMat4f=w;a.BufferViewMat4f64=v;a.BufferViewUint16=B;a.BufferViewUint32=H;a.BufferViewUint8=x;a.BufferViewVec2f=c;a.BufferViewVec2f64=r;a.BufferViewVec2i16=K;a.BufferViewVec2i32=W;a.BufferViewVec2i8=O;a.BufferViewVec2u16=C;a.BufferViewVec2u32=N;a.BufferViewVec2u8=y;a.BufferViewVec3f=e;a.BufferViewVec3f64=n;a.BufferViewVec3i16=J;a.BufferViewVec3i32=S;a.BufferViewVec3i8=
L;a.BufferViewVec3u16=D;a.BufferViewVec3u32=E;a.BufferViewVec3u8=z;a.BufferViewVec4f=g;a.BufferViewVec4f64=u;a.BufferViewVec4i16=R;a.BufferViewVec4i32=V;a.BufferViewVec4i8=P;a.BufferViewVec4u16=F;a.BufferViewVec4u32=G;a.BufferViewVec4u8=A;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/internals/Mat3":function(){define(["exports"],function(a){class b{constructor(q,l,p=0,k,h){this.TypedArrayConstructor=q;this.elementCount=9;q=this.TypedArrayConstructor;
void 0===k&&(k=9*q.BYTES_PER_ELEMENT);const f=0===l.byteLength?0:p;this.typedBuffer=null==h?new q(l,f):new q(l,f,(h-p)/q.BYTES_PER_ELEMENT);this.typedBufferStride=k/q.BYTES_PER_ELEMENT;this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride);this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(q,l,p=this.count-l){l=this.typedBuffer.byteOffset+l*this.stride;return new q(this.buffer,l,this.stride,l+p*this.stride)}getMat(q,l){q*=this.typedBufferStride;
for(let p=0;9>p;p++)l[p]=this.typedBuffer[q++];return l}setMat(q,l){q*=this.typedBufferStride;for(let p=0;9>p;p++)this.typedBuffer[q++]=l[p]}get(q,l){return this.typedBuffer[q*this.typedBufferStride+l]}set(q,l,p){this.typedBuffer[q*this.typedBufferStride+l]=p}copyFrom(q,l,p){const k=this.typedBuffer,h=l.typedBuffer;q*=this.typedBufferStride;l=p*l.typedBufferStride;for(p=0;9>p;++p)k[q++]=h[l++]}get buffer(){return this.typedBuffer.buffer}}b.ElementCount=9;a.BufferViewMat3Impl=b;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/internals/Mat4":function(){define(["exports"],function(a){class b{constructor(q,l,p=0,k,h){this.TypedArrayConstructor=q;this.elementCount=16;q=this.TypedArrayConstructor;void 0===k&&(k=16*q.BYTES_PER_ELEMENT);const f=0===l.byteLength?0:p;this.typedBuffer=null==h?new q(l,f):new q(l,f,(h-p)/q.BYTES_PER_ELEMENT);this.typedBufferStride=k/q.BYTES_PER_ELEMENT;this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride);this.stride=
this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(q,l,p=this.count-l){l=this.typedBuffer.byteOffset+l*this.stride;return new q(this.buffer,l,this.stride,l+p*this.stride)}getMat(q,l){q*=this.typedBufferStride;for(let p=0;16>p;p++)l[p]=this.typedBuffer[q++];return l}setMat(q,l){q*=this.typedBufferStride;for(let p=0;16>p;p++)this.typedBuffer[q++]=l[p]}get(q,l){return this.typedBuffer[q*this.typedBufferStride+l]}set(q,l,p){this.typedBuffer[q*this.typedBufferStride+l]=p}copyFrom(q,
l,p){const k=this.typedBuffer,h=l.typedBuffer;q*=this.typedBufferStride;l=p*l.typedBufferStride;for(p=0;16>p;++p)k[q++]=h[l++]}get buffer(){return this.typedBuffer.buffer}}b.ElementCount=16;a.BufferViewMat4Impl=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/internals/Scalar":function(){define(["exports"],function(a){class b{constructor(q,l,p=0,k,h){this.TypedArrayConstructor=q;this.elementCount=1;q=this.TypedArrayConstructor;void 0===k&&(k=q.BYTES_PER_ELEMENT);
const f=0===l.byteLength?0:p;this.typedBuffer=null==h?new q(l,f):new q(l,f,(h-p)/q.BYTES_PER_ELEMENT);this.stride=k;this.typedBufferStride=k/q.BYTES_PER_ELEMENT;this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(q,l,p=this.count-l){l=this.typedBuffer.byteOffset+l*this.stride;return new q(this.buffer,l,this.stride,l+p*this.stride)}get(q){return this.typedBuffer[q*this.typedBufferStride]}set(q,l){this.typedBuffer[q*this.typedBufferStride]=l}get buffer(){return this.typedBuffer.buffer}}
b.ElementCount=1;a.BufferViewScalarImpl=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/internals/Vec2":function(){define(["exports","../../../../core/libs/gl-matrix-2/math/vec2"],function(a,b){class q{constructor(l,p,k=0,h,f){this.TypedArrayConstructor=l;this.elementCount=2;l=this.TypedArrayConstructor;void 0===h&&(h=2*l.BYTES_PER_ELEMENT);const c=0===p.byteLength?0:k;this.typedBuffer=null==f?new l(p,c):new l(p,c,(f-k)/l.BYTES_PER_ELEMENT);this.typedBufferStride=
h/l.BYTES_PER_ELEMENT;this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride);this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(l,p,k=this.count-p){p=this.typedBuffer.byteOffset+p*this.stride;return new l(this.buffer,p,this.stride,p+k*this.stride)}getVec(l,p){l*=this.typedBufferStride;return b.set(p,this.typedBuffer[l],this.typedBuffer[l+1])}setVec(l,p){l*=this.typedBufferStride;this.typedBuffer[l++]=p[0];this.typedBuffer[l]=p[1]}get(l,p){return this.typedBuffer[l*
this.typedBufferStride+p]}set(l,p,k){this.typedBuffer[l*this.typedBufferStride+p]=k}setValues(l,p,k){l*=this.typedBufferStride;this.typedBuffer[l++]=p;this.typedBuffer[l]=k}copyFrom(l,p,k){const h=this.typedBuffer,f=p.typedBuffer;l*=this.typedBufferStride;p=k*p.typedBufferStride;h[l++]=f[p++];h[l]=f[p]}get buffer(){return this.typedBuffer.buffer}}q.ElementCount=2;a.BufferViewVec2Impl=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/internals/Vec3":function(){define(["exports",
"../../../../chunks/vec32"],function(a,b){class q{constructor(l,p,k=0,h,f){this.TypedArrayConstructor=l;this.elementCount=3;l=this.TypedArrayConstructor;void 0===h&&(h=3*l.BYTES_PER_ELEMENT);const c=0===p.byteLength?0:k;this.typedBuffer=null==f?new l(p,c):new l(p,c,(f-k)/l.BYTES_PER_ELEMENT);this.typedBufferStride=h/l.BYTES_PER_ELEMENT;this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride);this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(l,
p,k=this.count-p){p=this.typedBuffer.byteOffset+p*this.stride;return new l(this.buffer,p,this.stride,p+k*this.stride)}getVec(l,p){l*=this.typedBufferStride;return b.set(p,this.typedBuffer[l],this.typedBuffer[l+1],this.typedBuffer[l+2])}setVec(l,p){l*=this.typedBufferStride;this.typedBuffer[l++]=p[0];this.typedBuffer[l++]=p[1];this.typedBuffer[l]=p[2]}get(l,p){return this.typedBuffer[l*this.typedBufferStride+p]}set(l,p,k){this.typedBuffer[l*this.typedBufferStride+p]=k}setValues(l,p,k,h){l*=this.typedBufferStride;
this.typedBuffer[l++]=p;this.typedBuffer[l++]=k;this.typedBuffer[l]=h}copyFrom(l,p,k){const h=this.typedBuffer,f=p.typedBuffer;l*=this.typedBufferStride;p=k*p.typedBufferStride;h[l++]=f[p++];h[l++]=f[p++];h[l]=f[p]}get buffer(){return this.typedBuffer.buffer}}q.ElementCount=3;a.BufferViewVec3Impl=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/internals/Vec4":function(){define(["exports","../../../../chunks/vec42"],function(a,b){class q{constructor(l,
p,k=0,h,f){this.TypedArrayConstructor=l;this.start=k;this.elementCount=4;l=this.TypedArrayConstructor;void 0===h&&(h=4*l.BYTES_PER_ELEMENT);const c=0===p.byteLength?0:k;this.typedBuffer=null==f?new l(p,c):new l(p,c,(f-k)/l.BYTES_PER_ELEMENT);this.typedBufferStride=h/l.BYTES_PER_ELEMENT;this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride);this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(l,p,k=this.count-p){p=this.typedBuffer.byteOffset+p*this.stride;
return new l(this.buffer,p,this.stride,p+k*this.stride)}getVec(l,p){l*=this.typedBufferStride;return b.set(p,this.typedBuffer[l++],this.typedBuffer[l++],this.typedBuffer[l++],this.typedBuffer[l])}setVec(l,p){l*=this.typedBufferStride;this.typedBuffer[l++]=p[0];this.typedBuffer[l++]=p[1];this.typedBuffer[l++]=p[2];this.typedBuffer[l]=p[3]}get(l,p){return this.typedBuffer[l*this.typedBufferStride+p]}set(l,p,k){this.typedBuffer[l*this.typedBufferStride+p]=k}setValues(l,p,k,h,f){l*=this.typedBufferStride;
this.typedBuffer[l++]=p;this.typedBuffer[l++]=k;this.typedBuffer[l++]=h;this.typedBuffer[l]=f}copyFrom(l,p,k){const h=this.typedBuffer,f=p.typedBuffer;l*=this.typedBufferStride;p=k*p.typedBufferStride;h[l++]=f[p++];h[l++]=f[p++];h[l++]=f[p++];h[l]=f[p]}get buffer(){return this.typedBuffer.buffer}}q.ElementCount=4;a.BufferViewVec4Impl=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/buffer/types":function(){define(["exports"],function(a){a.elementTypeSize=function(b){switch(b){case "u8":return 1;
case "u16":return 2;case "u32":return 4;case "i8":return 1;case "i16":return 2;case "i32":return 4;case "f32":return 4;case "f64":return 8}};a.isInteger=function(b){switch(b){case "u8":case "u16":case "u32":case "i8":case "i16":case "i32":return!0;case "f32":case "f64":return!1}};a.isSigned=function(b){switch(b){case "u8":case "u16":case "u32":return!1;case "i8":case "i16":case "i32":case "f32":case "f64":return!0}};a.maximumValue=function(b){switch(b){case "u8":return 255;case "u16":return 65535;
case "u32":return 4294967295;case "i8":return 127;case "i16":return 32767;case "i32":return 2147483647;case "f32":return 3.402823E38;case "f64":return 1.79769E308}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/GeometryUtil":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/DoubleArray ../../../../geometry/support/FloatArray ../../../../geometry/support/Indices ../../../../geometry/support/plane ../../../../geometry/support/ray ./Attribute ./BufferVectorMath ./ContentObjectType ./Geometry ./Util ./VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(ha,ba,U){function Z(ia,ka){ia>ka&&([ia,ka]=[ka,ia]);const fa=ia.toString()+"."+ka.toString();if(da[fa])return da[fa];let X=ca.length;ca.length+=3;y.add(ca,3*ia,ca,3*ka,ca,X);y.scale(ca,X,ha/y.length(ca,X));X/=3;return da[fa]=X}let ca;U?(ca=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],U=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1]):(U=ha*(1+Math.sqrt(5))/2,ca=[-ha,U,0,ha,U,0,-ha,-U,0,ha,-U,0,0,-ha,U,0,ha,U,0,-ha,-U,0,ha,-U,U,0,-ha,U,0,ha,-U,0,-ha,
-U,0,ha],U=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]);for(var ea=0;ea<ca.length;ea+=3)y.scale(ca,ea,ha/y.length(ca,ea));let da={};for(ea=0;ea<ba;ea++){const ia=U.length,ka=Array(4*ia);for(let fa=0;fa<ia;fa+=3){const X=U[fa],ja=U[fa+1],la=U[fa+2],na=Z(X,ja),va=Z(ja,la),za=Z(la,X),ya=4*fa;ka[ya]=X;ka[ya+1]=na;ka[ya+2]=za;ka[ya+3]=ja;ka[ya+4]=va;ka[ya+5]=na;ka[ya+6]=la;ka[ya+7]=za;ka[ya+8]=va;ka[ya+9]=na;ka[ya+
10]=va;ka[ya+11]=za}U=ka;da={}}ba=h.floatArrayFrom(ca);for(ea=0;ea<ba.length;ea+=3)y.normalize(ba,ea);return[[m.VertexAttribute.POSITION,new g.Attribute(h.floatArrayFrom(ca),U,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute(ba,U,3,!0)]]}function n(ha,ba,U,Z,ca,ea,da=l.fromValues(0,0,0)){var ia=ba.length;const ka=h.newFloatArray(U.length*ia*3+(6*Z.length||0)),fa=h.newFloatArray(U.length*ia*3+(Z?6:0)),X=[],ja=[];let la=0;var na=0;const va=p.create(),za=p.create(),ya=p.create(),Da=p.create(),ra=p.create(),
xa=p.create(),Ma=p.create(),Ga=p.create(),Pa=p.create(),Qa=p.create(),Ea=p.create(),ua=p.create(),Na=p.create(),Ua=c.create();q.set(Pa,0,1,0);q.subtract(za,U[1],U[0]);q.normalize(za,za);ea?(q.add(Ga,U[0],da),q.normalize(ya,Ga)):q.set(ya,0,0,1);x(za,ya,Pa,Pa,ra,ya,.99619469809);q.copy(Da,ya);q.copy(ua,ra);for(var wa=0;wa<Z.length;wa++)q.scale(xa,ra,Z[wa][0]),q.scale(Ga,ya,Z[wa][2]),q.add(xa,xa,Ga),q.add(xa,xa,U[0]),ka[la++]=xa[0],ka[la++]=xa[1],ka[la++]=xa[2];fa[na++]=-za[0];fa[na++]=-za[1];fa[na++]=
-za[2];for(wa=0;wa<ca.length;wa++)X.push(0<ca[wa][0]?ca[wa][0]:-ca[wa][0]-1+Z.length),X.push(0<ca[wa][1]?ca[wa][1]:-ca[wa][1]-1+Z.length),X.push(0<ca[wa][2]?ca[wa][2]:-ca[wa][2]-1+Z.length),ja.push(0),ja.push(0),ja.push(0);wa=Z.length;const sa=Z.length-1;for(let Ka=0;Ka<U.length;Ka++){let Aa=!1;0<Ka&&(q.copy(va,za),Ka<U.length-1?(q.subtract(za,U[Ka+1],U[Ka]),q.normalize(za,za)):Aa=!0,q.add(Qa,va,za),q.normalize(Qa,Qa),q.add(Ea,U[Ka-1],Da),c.fromPositionAndNormal(U[Ka],Qa,Ua),c.intersectRay(Ua,e.wrap(Ea,
va),Ga)?(q.subtract(Ga,Ga,U[Ka]),q.normalize(ya,Ga),q.cross(ra,Qa,ya),q.normalize(ra,ra)):x(Qa,Da,ua,Pa,ra,ya,.99619469809),q.copy(Da,ya),q.copy(ua,ra));ea&&(q.add(Ga,U[Ka],da),q.normalize(Na,Ga));for(let Sa=0;Sa<ia;Sa++)if(q.scale(xa,ra,ba[Sa][0]),q.scale(Ga,ya,ba[Sa][1]),q.add(xa,xa,Ga),q.normalize(Ma,xa),fa[na++]=Ma[0],fa[na++]=Ma[1],fa[na++]=Ma[2],q.add(xa,xa,U[Ka]),ka[la++]=xa[0],ka[la++]=xa[1],ka[la++]=xa[2],!Aa){var Ha=(Sa+1)%ia;X.push(wa+Sa);X.push(wa+ia+Sa);X.push(wa+Ha);X.push(wa+Ha);X.push(wa+
ia+Sa);X.push(wa+ia+Ha);for(Ha=0;6>Ha;Ha++)ja.push(X[X.length-6+Ha]-sa)}wa+=ia}ba=U[U.length-1];for(U=0;U<Z.length;U++)q.scale(xa,ra,Z[U][0]),q.scale(Ga,ya,Z[U][1]),q.add(xa,xa,Ga),q.add(xa,xa,ba),ka[la++]=xa[0],ka[la++]=xa[1],ka[la++]=xa[2];Z=na/3;fa[na++]=za[0];fa[na++]=za[1];fa[na++]=za[2];ia=wa-ia;for(na=0;na<ca.length;na++)X.push(0<=ca[na][0]?wa+ca[na][0]:-ca[na][0]-1+ia),X.push(0<=ca[na][2]?wa+ca[na][2]:-ca[na][2]-1+ia),X.push(0<=ca[na][1]?wa+ca[na][1]:-ca[na][1]-1+ia),ja.push(Z),ja.push(Z),
ja.push(Z);ca=[[m.VertexAttribute.POSITION,new g.Attribute(ka,X,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute(fa,ja,3,!0)]];return new w.Geometry(ha,ca)}function u(ha,ba,U,Z,ca){if(Math.abs(q.dot(ba,ha))>ca)return!1;q.cross(U,ha,ba);q.normalize(U,U);q.cross(Z,U,ha);q.normalize(Z,Z);return!0}function x(ha,ba,U,Z,ca,ea,da){return u(ha,ba,ca,ea,da)||u(ha,U,ca,ea,da)||u(ha,Z,ca,ea,da)}const y=d.Vec3Compact,z=[[-.5,-.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,
.5,-.5]],A=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],B=[0,0,1,0,1,1,0,1],C=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],D=Array(36);for(d=0;6>d;d++)for(var F=0;6>F;F++)D[6*d+F]=d;const H=Array(36);for(d=0;6>d;d++)H[6*d]=0,H[6*d+1]=1,H[6*d+2]=2,H[6*d+3]=2,H[6*d+4]=3,H[6*d+5]=0;const N=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],E=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],G=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],I=[0,0,0,1,
1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];d=l.fromValues(-.5,0,-.5);F=l.fromValues(.5,0,-.5);const O=l.fromValues(0,0,.5),L=l.fromValues(0,.5,0),P=l.create(),M=l.create(),K=l.create(),J=l.create(),R=l.create();q.subtract(P,d,L);q.subtract(M,d,F);q.cross(K,P,M);q.normalize(K,K);q.subtract(P,F,L);q.subtract(M,F,O);q.cross(J,P,M);q.normalize(J,J);q.subtract(P,O,L);q.subtract(M,O,d);q.cross(R,P,M);q.normalize(R,R);const Q=[d,F,O,L],W=[0,-1,0,K[0],K[1],K[2],J[0],J[1],J[2],R[0],R[1],R[2]],S=[0,1,2,3,1,0,
3,2,1,3,0,2],V=[0,0,0,1,1,1,2,2,2,3,3,3],T=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]],Y=p.create();a.cgToGIS=function(ha,ba=ha){var U=ha.attributes;ha=U.get(m.VertexAttribute.POSITION).data;if(U=U.get(m.VertexAttribute.NORMAL).data){var Z=ba.getMutableAttribute(m.VertexAttribute.NORMAL).data;for(let ca=0;ca<U.length;ca+=3){const ea=U[ca+1];Z[ca+1]=-U[ca+2];Z[ca+2]=ea}}if(ha)for(ba=ba.getMutableAttribute(m.VertexAttribute.POSITION).data,U=0;U<ha.length;U+=3)Z=ha[U+1],ba[U+1]=-ha[U+2],ba[U+2]=Z};a.createBoxGeometry=
function(ha,ba){Array.isArray(ba)||(ba=[ba,ba,ba]);const U=Array(24);for(let Z=0;8>Z;Z++)U[3*Z]=z[Z][0]*ba[0],U[3*Z+1]=z[Z][1]*ba[1],U[3*Z+2]=z[Z][2]*ba[2];return new w.Geometry(ha,[[m.VertexAttribute.POSITION,new g.Attribute(U,C,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute(A,D,3)],[m.VertexAttribute.UV0,new g.Attribute(B,H,2)]])};a.createConeGeometry=function(ha,ba,U,Z,ca,ea=!0,da=!0){let ia=0;var ka=l.fromValues(0,ia,0),fa=l.fromValues(0,ia+ba,0),X=l.fromValues(0,-1,0),ja=l.fromValues(0,1,0);
ca&&(ia=ba,fa=l.fromValues(0,0,0),ka=l.fromValues(0,ia,0),X=l.fromValues(0,1,0),ja=l.fromValues(0,-1,0));ka=[fa,ka];X=[X,ja];ja=Z+2;fa=Math.sqrt(ba*ba+U*U);if(ca)for(ca=Z-1;0<=ca;ca--){var la=2*Math.PI/Z*ca,na=l.fromValues(Math.cos(la)*U,ia,Math.sin(la)*U);ka.push(na);la=l.fromValues(ba*Math.cos(la)/fa,-U/fa,ba*Math.sin(la)/fa);X.push(la)}else for(ca=0;ca<Z;ca++)la=2*Math.PI/Z*ca,na=l.fromValues(Math.cos(la)*U,ia,Math.sin(la)*U),ka.push(na),la=l.fromValues(ba*Math.cos(la)/fa,U/fa,ba*Math.sin(la)/
fa),X.push(la);ba=[];U=[];if(ea){for(ea=3;ea<ka.length;ea++)ba.push(1),ba.push(ea-1),ba.push(ea),U.push(0),U.push(0),U.push(0);ba.push(ka.length-1);ba.push(2);ba.push(1);U.push(0);U.push(0);U.push(0)}if(da){for(da=3;da<ka.length;da++)ba.push(da),ba.push(da-1),ba.push(0),U.push(da),U.push(da-1),U.push(1);ba.push(0);ba.push(2);ba.push(ka.length-1);U.push(1);U.push(2);U.push(X.length-1)}da=h.newFloatArray(3*ja);for(ea=0;ea<ja;ea++)da[3*ea]=ka[ea][0],da[3*ea+1]=ka[ea][1],da[3*ea+2]=ka[ea][2];ka=h.newFloatArray(3*
ja);for(ea=0;ea<ja;ea++)ka[3*ea]=X[ea][0],ka[3*ea+1]=X[ea][1],ka[3*ea+2]=X[ea][2];ka=[[m.VertexAttribute.POSITION,new g.Attribute(da,ba,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute(ka,U,3,!0)]];return new w.Geometry(ha,ka)};a.createCylinderGeometry=function(ha,ba,U,Z,ca,ea,da){ca=ca?l.clone(ca):l.fromValues(1,0,0);ea=ea?l.clone(ea):l.fromValues(0,0,0);da??=!0;var ia=l.create();q.normalize(ia,ca);var ka=l.create();q.scale(ka,ia,Math.abs(ba));var fa=l.create();q.scale(fa,ka,-.5);q.add(fa,fa,ea);
const X=l.fromValues(0,1,0);.2>Math.abs(1-q.dot(ia,X))&&q.set(X,0,0,1);const ja=l.create();q.cross(ja,ia,X);q.normalize(ja,ja);q.cross(X,ja,ia);ba=2*Z+(da?2:0);ea=Z+(da?2:0);ca=h.newFloatArray(3*ba);const la=h.newFloatArray(3*ea),na=h.newFloatArray(2*ba),va=Array(3*Z*(da?4:2)),za=Array(3*Z*(da?4:2));da&&(ca[3*(ba-2)]=fa[0],ca[3*(ba-2)+1]=fa[1],ca[3*(ba-2)+2]=fa[2],na[2*(ba-2)]=0,na[2*(ba-2)+1]=0,ca[3*(ba-1)]=ca[3*(ba-2)]+ka[0],ca[3*(ba-1)+1]=ca[3*(ba-2)+1]+ka[1],ca[3*(ba-1)+2]=ca[3*(ba-2)+2]+ka[2],
na[2*(ba-1)]=1,na[2*(ba-1)+1]=1,la[3*(ea-2)]=-ia[0],la[3*(ea-2)+1]=-ia[1],la[3*(ea-2)+2]=-ia[2],la[3*(ea-1)]=ia[0],la[3*(ea-1)+1]=ia[1],la[3*(ea-1)+2]=ia[2]);ia=0;const ya=l.create(),Da=l.create();for(let Ga=0;Ga<Z;Ga++){var ra=2*Math.PI/Z*Ga;q.scale(ya,X,Math.sin(ra));q.scale(Da,ja,Math.cos(ra));q.add(ya,ya,Da);la[3*Ga]=ya[0];la[3*Ga+1]=ya[1];la[3*Ga+2]=ya[2];q.scale(ya,ya,U);q.add(ya,ya,fa);ca[3*Ga]=ya[0];ca[3*Ga+1]=ya[1];ca[3*Ga+2]=ya[2];na[2*Ga]=Ga/Z;na[2*Ga+1]=0;ca[3*(Ga+Z)]=ca[3*Ga]+ka[0];ca[3*
(Ga+Z)+1]=ca[3*Ga+1]+ka[1];ca[3*(Ga+Z)+2]=ca[3*Ga+2]+ka[2];na[2*(Ga+Z)]=Ga/Z;na[2*Ga+1]=1;ra=(Ga+1)%Z;var xa=ia++,Ma=Ga;va[xa]=Ga;za[xa]=Ma;xa=ia++;Ma=Ga;va[xa]=Ga+Z;za[xa]=Ma;xa=ia++;Ma=ra;va[xa]=ra;za[xa]=Ma;xa=ia++;Ma=ra;va[xa]=ra;za[xa]=Ma;xa=ia++;Ma=Ga;va[xa]=Ga+Z;za[xa]=Ma;xa=ia++;Ma=ra;va[xa]=ra+Z;za[xa]=Ma}if(da){for(U=0;U<Z;U++)da=(U+1)%Z,ka=ia++,fa=ea-2,va[ka]=ba-2,za[ka]=fa,ka=ia++,fa=ea-2,va[ka]=U,za[ka]=fa,ka=ia++,fa=ea-2,va[ka]=da,za[ka]=fa;for(U=0;U<Z;U++)da=(U+1)%Z,ka=ia++,fa=ea-1,
va[ka]=U+Z,za[ka]=fa,ka=ia++,fa=ea-1,va[ka]=ba-1,za[ka]=fa,ka=ia++,fa=ea-1,va[ka]=da+Z,za[ka]=fa}Z=[[m.VertexAttribute.POSITION,new g.Attribute(ca,va,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute(la,za,3,!0)],[m.VertexAttribute.UV0,new g.Attribute(na,va,2,!0)]];return new w.Geometry(ha,Z)};a.createDiamondGeometry=function(ha,ba){Array.isArray(ba)||(ba=[ba,ba,ba]);const U=Array(18);for(let Z=0;6>Z;Z++)U[3*Z]=N[Z][0]*ba[0],U[3*Z+1]=N[Z][1]*ba[1],U[3*Z+2]=N[Z][2]*ba[2];return new w.Geometry(ha,[[m.VertexAttribute.POSITION,
new g.Attribute(U,G,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute(E,I,3)]])};a.createExtrudedTriangle=function(ha,ba,U,Z,ca,ea=0){const da=Array(18);ba=[[-U,ea,ca/2],[Z,ea,ca/2],[0,ba+ea,ca/2],[-U,ea,-ca/2],[Z,ea,-ca/2],[0,ba+ea,-ca/2]];for(U=0;6>U;U++)da[3*U]=ba[U][0],da[3*U+1]=ba[U][1],da[3*U+2]=ba[U][2];return new w.Geometry(ha,[[m.VertexAttribute.POSITION,new g.Attribute(da,[0,1,2,3,0,2,2,5,3,1,4,5,5,2,1,1,0,3,3,4,1,4,3,5],3,!0)]])};a.createPathExtrusionGeometry=n;a.createPointGeometry=function(ha,
ba,U,Z,ca,ea,da,ia,ka=null){U=U?p.clone(U):p.create();ba=ba?p.clone(ba):p.fromValues(0,0,1);da??=b.create();Z=Z?[255*Z[0],255*Z[1],255*Z[2],3<Z.length?255*Z[3]:255]:[255,255,255,255];const fa=null!=ca&&2===ca.length?ca:[1,1];ca=f.getZeroIndexArray(1);da=[[m.VertexAttribute.POSITION,new g.Attribute(U,ca,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute(ba,ca,3,!0)],[m.VertexAttribute.UV0,new g.Attribute(da,ca,da.length)],[m.VertexAttribute.COLOR,new g.Attribute(Z,ca,4,!0)],[m.VertexAttribute.SIZE,new g.Attribute(fa,
ca,2)]];null!=ea&&(ea=[ea[0],ea[1],ea[2],ea[3]],da.push([m.VertexAttribute.CENTEROFFSETANDDISTANCE,new g.Attribute(ea,ca,4)]));ia&&da.push([m.VertexAttribute.FEATUREATTRIBUTE,new g.Attribute([ia[0],ia[1],ia[2],ia[3]],ca,4)]);return new w.Geometry(ha,da,null,t.ContentObjectType.Point,ka)};a.createPolySphereData=r;a.createPolySphereGeometry=function(ha,ba,U,Z){ba=r(ba,U,Z);return new w.Geometry(ha,ba)};a.createPolylineGeometry=function(ha,ba,U,Z){v.assert(1<ba.length,"createPolylineGeometry(): polyline needs at least 2 points");
v.assert(3===ba[0].length,"createPolylineGeometry(): malformed vertex");v.assert(null==U||U.length===ba.length,"createPolylineGeometry: need same number of points and normals");v.assert(null==U||3===U[0].length,"createPolylineGeometry(): malformed normal");var ca=k.newDoubleArray(3*ba.length);const ea=Array(2*(ba.length-1));var da=0,ia=0;for(var ka=0;ka<ba.length;ka++){for(var fa=0;3>fa;fa++)ca[da++]=ba[ka][fa];0<ka&&(ea[ia++]=ka-1,ea[ia++]=ka)}ca=[[m.VertexAttribute.POSITION,new g.Attribute(ca,ea,
3,!0)]];if(U){da=h.newFloatArray(3*U.length);ia=0;for(ka=0;ka<ba.length;ka++)for(fa=0;3>fa;fa++)da[ia++]=U[ka][fa];ca.push([m.VertexAttribute.NORMAL,new g.Attribute(da,ea,3,!0)])}Z&&ca.push([m.VertexAttribute.COLOR,new g.Attribute(Z,f.getContinuousIndexArray(Z.length/4),4)]);return new w.Geometry(ha,ca,null,t.ContentObjectType.Line)};a.createSphereGeometry=function(ha,ba,U,Z,ca={uv:!0}){var ea=-Math.PI,da=2*Math.PI,ia=-Math.PI/2,ka=Math.PI;U=Math.max(3,Math.floor(U));Z=Math.max(2,Math.floor(Z));var fa=
(U+1)*(Z+1);const X=h.newFloatArray(3*fa),ja=h.newFloatArray(3*fa);fa=h.newFloatArray(2*fa);const la=[];var na=0;for(var va=0;va<=Z;va++){const ya=[],Da=va/Z,ra=ia+Da*ka,xa=Math.cos(ra);for(let Ma=0;Ma<=U;Ma++){const Ga=Ma/U;var za=ea+Ga*da;const Pa=Math.cos(za)*xa,Qa=Math.sin(ra);za=-Math.sin(za)*xa;X[3*na]=Pa*ba;X[3*na+1]=Qa*ba;X[3*na+2]=za*ba;ja[3*na]=Pa;ja[3*na+1]=Qa;ja[3*na+2]=za;fa[2*na]=Ga;fa[2*na+1]=Da;ya.push(na);++na}la.push(ya)}ba=[];for(ea=0;ea<Z;ea++)for(da=0;da<U;da++)ia=la[ea][da],
ka=la[ea][da+1],na=la[ea+1][da+1],va=la[ea+1][da],0===ea?(ba.push(ia),ba.push(na),ba.push(va)):ea===Z-1?(ba.push(ia),ba.push(ka),ba.push(na)):(ba.push(ia),ba.push(ka),ba.push(na),ba.push(na),ba.push(va),ba.push(ia));U=[[m.VertexAttribute.POSITION,new g.Attribute(X,ba,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute(ja,ba,3,!0)]];ca.uv&&U.push([m.VertexAttribute.UV0,new g.Attribute(fa,ba,2,!0)]);ca.offset&&(U[0][0]=m.VertexAttribute.OFFSET,U.push([m.VertexAttribute.POSITION,new g.Attribute(Float64Array.from(ca.offset),
f.getZeroIndexArray(ba.length),3,!0)]));return new w.Geometry(ha,U)};a.createSquareGeometry=function(ha,ba=T){var U=Array(12);for(var Z=0;4>Z;Z++)for(let ca=0;3>ca;ca++)U[3*Z+ca]=ba[Z][ca];ba=[0,1,2,2,3,0];Z=[0,0,0,0,0,0];U=[[m.VertexAttribute.POSITION,new g.Attribute(U,ba,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute([0,0,1],Z,3,!0)],[m.VertexAttribute.UV0,new g.Attribute([0,0,1,0,1,1,0,1],ba,2,!0)],[m.VertexAttribute.COLOR,new g.Attribute([255,255,255,255],Z,4,!0)]];return new w.Geometry(ha,
U)};a.createTetrahedronGeometry=function(ha,ba){Array.isArray(ba)||(ba=[ba,ba,ba]);const U=Array(12);for(let Z=0;4>Z;Z++)U[3*Z]=Q[Z][0]*ba[0],U[3*Z+1]=Q[Z][1]*ba[1],U[3*Z+2]=Q[Z][2]*ba[2];return new w.Geometry(ha,[[m.VertexAttribute.POSITION,new g.Attribute(U,S,3,!0)],[m.VertexAttribute.NORMAL,new g.Attribute(W,V,3)]])};a.createTubeGeometry=function(ha,ba,U,Z,ca,ea){Z=Z||10;ca=null!=ca?ca:!0;v.assert(1<ba.length);const da=[],ia=[];for(let ka=0;ka<Z;ka++){da.push([0,-ka-1,-((ka+1)%Z)-1]);const fa=
ka/Z*2*Math.PI;ia.push([Math.cos(fa)*U,Math.sin(fa)*U])}return n(ha,ia,ba,[[0,0,0]],da,ca,ea)};a.makeOrthoBasisDirUpFallback=x;a.transformInPlace=function(ha,ba){ha=ha.getMutableAttribute(m.VertexAttribute.POSITION).data;for(let U=0;U<ha.length;U+=3)q.set(Y,ha[U],ha[U+1],ha[U+2]),q.transformMat4(Y,Y,ba),ha[U]=Y[0],ha[U+1]=Y[1],ha[U+2]=Y[2]};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/DoubleArray":function(){define(["exports","../../core/typedArrayUtil"],
function(a,b){a.copyInto=function(q,l){for(let p=0;p<l.length;++p)q[p]=l[p];return q};a.doubleArrayFrom=function(q){return(b.isArray(q)?q.length:q.byteLength/8)<=b.nativeArrayMaxSize?Array.from(q):new Float64Array(q)};a.doubleSubArray=function(q,l,p){return Array.isArray(q)?q.slice(l,l+p):q.subarray(l,l+p)};a.newDoubleArray=function(q,l=!1){return q<=b.nativeArrayMaxSize?l?Array(q).fill(0):Array(q):new Float64Array(q)};a.toFloat64Array=function(q){return Array.isArray(q)?new Float64Array(q):q};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/FloatArray":function(){define(["exports","../../core/typedArrayUtil"],function(a,b){a.compactFloatArray=function(q){return b.isArray(q)?q.length<b.nativeArrayMaxSize?q:new Float32Array(q):q.length<b.nativeArrayMaxSize?Array.from(q):q};a.floatArrayFrom=function(q){return(b.isArray(q)?q.length:q.byteLength/8)<=b.nativeArrayMaxSize?Array.from(q):new Float32Array(q)};a.floatSubArray=function(q,l,p){return Array.isArray(q)?q.slice(l,l+p):q.subarray(l,
l+p)};a.newFloatArray=function(q,l=!1){return q<=b.nativeArrayMaxSize?l?Array(q).fill(0):Array(q):new Float32Array(q)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/Indices":function(){define(["exports","../../core/typedArrayUtil"],function(a,b){function q(e){let g=!0;for(const d of e){if(65536<=d)return b.isArray(e)?new Uint32Array(e):e;256<=d&&(g=!1)}return g?new Uint8Array(e):new Uint16Array(e)}function l(e){if(1===e)return h;if(e<b.nativeArrayMaxSize)return Array.from(new Uint16Array(f.buffer,
0,e));if(e<f.length)return new Uint16Array(f.buffer,0,e);if(e>k.length){k=new Uint32Array(Math.max(2*k.length,e));for(let g=0;g<k.length;g++)k[g]=g}return new Uint32Array(k.buffer,0,e)}function p(e){if(1===e)return h;if(e<b.nativeArrayMaxSize)return Array(e).fill(0);e>c.length&&(c=new Uint8Array(Math.max(2*c.length,e)));return new Uint8Array(c.buffer,0,e)}let k=(()=>{const e=new Uint32Array(131072);for(let g=0;g<e.length;++g)e[g]=g;return e})();const h=[0],f=(()=>{const e=new Uint16Array(65536);for(let g=
0;g<e.length;++g)e[g]=g;return e})();let c=new Uint8Array(65536);a.compactIndices=function(e){if(b.isArray(e)){if(e.length<b.nativeArrayMaxSize)return e}else if(e.length<b.nativeArrayMaxSize)return Array.from(e);let g=!0,d=!0;e.some((t,w)=>{g=g&&0===t;d=d&&t===w;return!g&&!d});return g?p(e.length):d?l(e.length):b.isArray(e)||e.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?q(e):e};a.getContinuousIndexArray=l;a.getZeroIndexArray=p;a.newIndexArray=function(e){return e<=b.nativeArrayMaxSize?Array(e):
65536>=e?new Uint16Array(e):new Uint32Array(e)};a.newIntArray=function(e){return e<=b.nativeArrayMaxSize?Array(e):new Uint32Array(e)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/BufferVectorMath":function(){define(["exports"],function(a){a.Vec3Compact=void 0;(function(b){b.length=function(q,l){const p=q[l],k=q[l+1];q=q[l+2];return Math.sqrt(p*p+k*k+q*q)};b.normalize=function(q,l){var p=q[l];const k=q[l+1],h=q[l+2];p=1/Math.sqrt(p*p+k*k+h*h);q[l]*=
p;q[l+1]*=p;q[l+2]*=p};b.scale=function(q,l,p){q[l]*=p;q[l+1]*=p;q[l+2]*=p};b.add=function(q,l,p,k,h,f=l){h=h||q;h[f]=q[l]+p[k];h[f+1]=q[l+1]+p[k+1];h[f+2]=q[l+2]+p[k+2]};b.subtract=function(q,l,p,k,h,f=l){h=h||q;h[f]=q[l]-p[k];h[f+1]=q[l+1]-p[k+1];h[f+2]=q[l+2]-p[k+2]}})(a.Vec3Compact||(a.Vec3Compact={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ContentObjectType":function(){define(["exports"],function(a){a.ContentObjectType=void 0;var b=a.ContentObjectType||
(a.ContentObjectType={});b[b.Layer=0]="Layer";b[b.Object=1]="Object";b[b.Mesh=2]="Mesh";b[b.Line=3]="Line";b[b.Point=4]="Point";b[b.Material=5]="Material";b[b.Texture=6]="Texture";b[b.COUNT=7]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Geometry":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../geometry/support/Indices ./AttributeArray ./basicInterfaces ./BoundingInfo ./ContentObject ./ContentObjectType ./geometryDataUtils ./Object3DStateID ./Util ./VertexAttribute ../materials/renderers/utils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){class v extends f.ContentObject{constructor(m,r,n=null,u=c.ContentObjectType.Mesh,x=null,y=-1){super();this.material=m;this.mapPositions=n;this.type=u;this.objectAndLayerIdColor=x;this.edgeIndicesLength=y;this.visible=!0;this._attributes=new Map;this._boundingInfo=null;for(const [z,A]of r)this._attributes.set(z,{...A,indices:l.compactIndices(A.indices)}),z===t.VertexAttribute.POSITION&&(this.edgeIndicesLength=0>this.edgeIndicesLength?this._attributes.get(z).indices.length:
this.edgeIndicesLength)}instantiate(m={}){const r=new v(m.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);this._attributes.forEach((n,u)=>{n.exclusive=!1;r._attributes.set(u,n)});r._boundingInfo=this._boundingInfo;r.transformation=m.transformation||this.transformation;return r}get attributes(){return this._attributes}getMutableAttribute(m){let r=this._attributes.get(m);r&&!r.exclusive&&(r={...r,exclusive:!0,data:p.cloneAttributeData(r.data)},
this._attributes.set(m,r));return r}setAttributeData(m,r){const n=this._attributes.get(m);n&&this._attributes.set(m,{...n,exclusive:!0,data:r})}get indexCount(){return this._attributes.values().next().value.indices?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo());return this._boundingInfo}computeAttachmentOrigin(m){return(this.type===c.ContentObjectType.Mesh?this._computeAttachmentOriginTriangles(m):
this.type===c.ContentObjectType.Line?this._computeAttachmentOriginLines(m):this._computeAttachmentOriginPoints(m))?(null!=this._transformation&&q.transformMat4(m,m,this._transformation),!0):!1}_computeAttachmentOriginTriangles(m){const r=this.attributes.get(t.VertexAttribute.POSITION);return e.computeAttachmentOriginTriangles(r,m)}_computeAttachmentOriginLines(m){const r=this.attributes.get(t.VertexAttribute.POSITION);var n=e.computeAttachmentOriginLines;var u=this.material.parameters;u="isClosed"in
u&&u.isClosed?2<r.indices.length:!1;return n.call(e,r,u,m)}_computeAttachmentOriginPoints(m){const r=this.attributes.get(t.VertexAttribute.POSITION);return e.computeAttachmentOriginPoints(r,m)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const m=this.attributes.get(t.VertexAttribute.POSITION);if(!m||0===m.indices.length)return null;const r=this.type===c.ContentObjectType.Mesh?3:1;d.assert(0===m.indices.length%r,"Indexing error: "+m.indices.length+" not divisible by "+
r);const n=l.getContinuousIndexArray(m.indices.length/r);return new h.BoundingInfo(n,r,m)}get transformation(){return this._transformation??b.IDENTITY}set transformation(m){this._transformation=m&&m!==b.IDENTITY?b.clone(m):null}addHighlight(){const m=new g.Object3DStateID(k.Object3DState.Highlight);this.highlights=w.addObject3DStateID(this.highlights,m);return m}removeHighlight(m){this.highlights=w.removeObject3DStateID(this.highlights,m)}}a.Geometry=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/lib/AttributeArray":function(){define(["exports","../../../../core/typedArrayUtil"],function(a,b){a.cloneAttributeData=function(q){if(q.length<b.nativeArrayMaxSize)return Array.from(q);if(b.isArray(q))return Float64Array.from(q);if(!("BYTES_PER_ELEMENT"in q))return Array.from(q);switch(q.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(q);case 2:return b.isUint16Array(q)?Uint16Array.from(q):Int16Array.from(q);case 4:return Float32Array.from(q);default:case 8:return Float64Array.from(q)}};
Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/BoundingInfo":function(){define(["exports","../../../../core/PooledArray","../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64","./Util"],function(a,b,q,l,p){class k{constructor(f,c,e){this.primitiveIndices=f;this._numIndexPerPrimitive=c;this.position=e;this._children=void 0;p.assert(1<=f.length);p.assert(3===e.size||4===e.size);const {data:g,size:d,indices:t}=e;p.assert(0===
t.length%this._numIndexPerPrimitive);p.assert(t.length>=f.length*this._numIndexPerPrimitive);var w=f.length;c=d*t[this._numIndexPerPrimitive*f[0]];h.clear();h.push(c);e=l.fromValues(g[c],g[c+1],g[c+2]);var v=l.clone(e);for(var m=0;m<w;++m){var r=this._numIndexPerPrimitive*f[m];for(var n=0;n<this._numIndexPerPrimitive;++n){c=d*t[r+n];h.push(c);let u=g[c];e[0]=Math.min(u,e[0]);v[0]=Math.max(u,v[0]);u=g[c+1];e[1]=Math.min(u,e[1]);v[1]=Math.max(u,v[1]);u=g[c+2];e[2]=Math.min(u,e[2]);v[2]=Math.max(u,v[2])}}this.bbMin=
e;this.bbMax=v;f=q.lerp(l.create(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(v[0]-e[0],v[1]-e[1]),v[2]-e[2]);e=this.radius*this.radius;for(v=0;v<h.length;++v)c=h.at(v),w=g[c]-f[0],m=g[c+1]-f[1],c=g[c+2]-f[2],r=w*w+m*m+c*c,r<=e||(r=Math.sqrt(r),n=.5*(r-this.radius),this.radius+=n,e=this.radius*this.radius,r=n/r,f[0]+=w*r,f[1]+=m*r,f[2]+=c*r);this.center=f;h.clear()}getChildren(){if(this._children||1>=q.squaredDistance(this.bbMin,this.bbMax))return this._children;var f=q.lerp(l.create(),
this.bbMin,this.bbMax,.5),c=this.primitiveIndices.length;const e=new Uint8Array(c),g=Array(8);for(var d=0;8>d;++d)g[d]=0;const {data:t,size:w,indices:v}=this.position;for(d=0;d<c;++d){var m=0;const n=this._numIndexPerPrimitive*this.primitiveIndices[d];var r=w*v[n];let u=t[r],x=t[r+1],y=t[r+2];for(let z=1;z<this._numIndexPerPrimitive;++z){r=w*v[n+z];const A=t[r],B=t[r+1];r=t[r+2];A<u&&(u=A);B<x&&(x=B);r<y&&(y=r)}u<f[0]&&(m|=1);x<f[1]&&(m|=2);y<f[2]&&(m|=4);e[d]=m;++g[m]}f=0;for(d=0;8>d;++d)0<g[d]&&
++f;if(!(2>f)){f=Array(8);for(d=0;8>d;++d)f[d]=0<g[d]?new Uint32Array(g[d]):void 0;for(d=0;8>d;++d)g[d]=0;for(d=0;d<c;++d)m=e[d],f[m][g[m]++]=this.primitiveIndices[d];this._children=[];for(c=0;8>c;++c)void 0!==f[c]&&this._children.push(new k(f[c],this._numIndexPerPrimitive,this.position));return this._children}}static prune(){h.prune()}}const h=new b({deallocator:null});a.BoundingInfo=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ContentObject":function(){define(["exports",
"../../../../core/uid"],function(a,b){class q{constructor(){this.id=b.generateUID()}}a.ContentObject=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/geometryDataUtils":function(){define(["exports","../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64","../../../../geometry/support/triangle"],function(a,b,q,l){const p=q.create(),k=q.create(),h=q.create(),f=q.create();a.computeAttachmentOriginLines=function(c,e,g){if(!c)return!1;
b.set(g,0,0,0);b.set(f,0,0,0);let d=0,t=0;const {size:w,data:v,indices:m}=c;c=m.length-1;e=c+(e?2:0);for(let n=0;n<e;n+=2){var r=m[n<c?n:c]*w;const u=m[n<c?n+1:0]*w;p[0]=v[r];p[1]=v[r+1];p[2]=v[r+2];k[0]=v[u];k[1]=v[u+1];k[2]=v[u+2];b.scale(p,b.add(p,p,k),.5);r=b.dist(p,k);0<r?(b.add(g,g,b.scale(p,p,r)),d+=r):0===d&&(b.add(f,f,p),t++)}return 0!==d?(b.scale(g,g,1/d),!0):0!==t?(b.scale(g,f,1/t),!0):!1};a.computeAttachmentOriginPoints=function(c,e){if(!c)return!1;const {size:g,data:d,indices:t}=c;b.set(e,
0,0,0);c=-1;let w=0;for(let v=0;v<t.length;v++){const m=t[v]*g;c!==m&&(e[0]+=d[m],e[1]+=d[m+1],e[2]+=d[m+2],w++);c=m}1<w&&b.scale(e,e,1/w);return 0<w};a.computeAttachmentOriginTriangles=function(c,e){if(!c)return!1;const {size:g,data:d,indices:t}=c;b.set(e,0,0,0);b.set(f,0,0,0);let w=c=0;for(let m=0;m<t.length-2;m+=3){var v=t[m]*g;const r=t[m+1]*g,n=t[m+2]*g;b.set(p,d[v],d[v+1],d[v+2]);b.set(k,d[r],d[r+1],d[r+2]);b.set(h,d[n],d[n+1],d[n+2]);(v=l.areaPoints3d(p,k,h))?(b.add(p,p,k),b.add(p,p,h),b.scale(p,
p,1/3*v),b.add(e,e,p),c+=v):(b.add(f,f,p),b.add(f,f,k),b.add(f,f,h),w+=3)}return 0===w&&0===c?!1:0!==c?(b.scale(e,e,1/c),!0):0!==w?(b.scale(e,f,1/w),!0):!1};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/triangle":function(){define("exports ../../core/ObjectStack ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ./lineSegment ./vectorStacks".split(" "),function(a,b,q,l,p,k){function h(t){return t?{p0:l.clone(t.p0),p1:l.clone(t.p1),p2:l.clone(t.p2)}:
{p0:l.create(),p1:l.create(),p2:l.create()}}function f(t,w,v,m=h()){q.copy(m.p0,t);q.copy(m.p1,w);q.copy(m.p2,v);return m}const c=new b.ObjectStack(p.create),e=new b.ObjectStack(()=>h()),g=l.create(),d=l.create();a.areaPoints2d=function(t,w,v){return.5*Math.abs((w[0]-t[0])*(v[1]-t[1])-(w[1]-t[1])*(v[0]-t[0]))};a.areaPoints3d=function(t,w,v){q.subtract(g,w,t);q.subtract(d,v,t);return.5*q.length(q.cross(g,g,d))};a.copy=function(t,w=h()){return f(t.p0,t.p1,t.p2,w)};a.create=h;a.distance2=function(t,
w){var v=t.p0,m=t.p1;t=t.p2;const r=q.subtract(k.sv3d.get(),m,v),n=q.subtract(k.sv3d.get(),t,m),u=q.subtract(k.sv3d.get(),v,t),x=q.subtract(k.sv3d.get(),w,v);var y=q.subtract(k.sv3d.get(),w,m),z=q.subtract(k.sv3d.get(),w,t);const A=q.cross(r,r,u),B=q.dot(q.cross(k.sv3d.get(),r,A),x);y=q.dot(q.cross(k.sv3d.get(),n,A),y);z=q.dot(q.cross(k.sv3d.get(),u,A),z);if(0<B&&0<y&&0<z)return w=q.dot(A,x),w*w/q.dot(A,A);v=p.distance2(p.fromValues(v,r,c.get()),w);m=p.distance2(p.fromValues(m,n,c.get()),w);w=p.distance2(p.fromValues(t,
u,c.get()),w);return Math.min(v,m,w)};a.fromValues=f;a.intersectRay=function(t,w,v){const {direction:m,origin:r}=w,{p0:n,p1:u,p2:x}=t;var y=u[0]-n[0],z=u[1]-n[1],A=u[2]-n[2];t=x[0]-n[0];w=x[1]-n[1];const B=x[2]-n[2];var C=m[1]*B-w*m[2],D=m[2]*t-B*m[0];const F=m[0]*w-t*m[1];var H=y*C+z*D+A*F;if(-1E-5<H&&1E-5>H)return!1;H=1/H;const N=r[0]-n[0],E=r[1]-n[1],G=r[2]-n[2];C=H*(N*C+E*D+G*F);if(0>C||1<C)return!1;D=E*A-z*G;A=G*y-A*N;y=N*z-y*E;z=H*(m[0]*D+m[1]*A+m[2]*y);if(0>z||1<C+z)return!1;v&&(q.scale(v,
m,H*(t*D+w*A+B*y)),q.add(v,r,v));return!0};a.wrap=function(t,w,v){const m=e.get();m.p0=t;m.p1=w;m.p2=v;return m};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Object3DStateID":function(){define(["exports","../../../../core/uid"],function(a,b){class q{constructor(l){this.channel=l;this.id=b.generateUID()}}a.Object3DStateID=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/renderers/utils":function(){define(["exports",
"../../../../../core/libs/gl-matrix-2/factories/vec3f64","../../../../webgl/doublePrecisionUtils"],function(a,b,q){const l=b.create(),p=new Float32Array(6);a.addObject3DStateID=function(k,h){null==k&&(k=[]);k.push(h);return k};a.encodeDoubleVec3=function(k,h,f,c,e){l[0]=k.get(h,0);l[1]=k.get(h,1);l[2]=k.get(h,2);q.encodeDoubleArray(l,p,3);f.set(e,0,p[0]);c.set(e,0,p[1]);f.set(e,1,p[2]);c.set(e,1,p[3]);f.set(e,2,p[4]);c.set(e,2,p[5])};a.removeObject3DStateID=function(k,h){if(null==k)return null;k=
k.filter(f=>f!==h);return 0===k.length?null:k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/MarsAtmosphere":function(){define("../../../core/mathUtils ../../../core/maybe ../../../core/reactiveUtils ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/math/vec2 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ../../../geometry/support/FloatArray ./AtmosphereType ./atmosphereUtils ../../../chunks/SimpleAtmosphere.glsl ./SimpleAtmosphereTechnique ./SimpleAtmosphereTechniqueConfiguration ./resources/MarsAtmosphereTexture ../support/mathUtils ../support/buffer/glUtil ../support/buffer/InterleavedLayout ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/glUtil3D ../webgl-engine/lib/Util ../webgl-engine/lib/VertexArrayObject ../webgl-engine/lib/VertexAttribute ../../webgl/BufferObject ../../webgl/enums ../../webgl/Texture ../../webgl/TextureDescriptor ../../webgl/Util".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N){function E(J,R,Q,W,S){const V=h.length(J),T=W*Math.sqrt(V*V-W*W)/V,Y=S.v1,ha=S.v2;h.scale(S.center,J,Math.sqrt(W*W-T*T)/V);h.cross(Y,J,R);1>h.squaredLength(Y)&&h.cross(Y,J,Q);h.scale(Y,Y,T/h.length(Y));h.cross(ha,Y,J);h.scale(ha,ha,T/h.length(ha));return T}const G=-d.innerAtmosphereDepth,I=r.makePiecewiseLinearFunction([[50,.1015625],[500,.21875],[5E3,.51171875],[5E4,.4140625]]);class O{constructor(J,R){this.view=J;this.type=g.AtmosphereType.Mars;
this._passParameters=new t.SimpleAtmospherePassParameters;this._vaoCount=0;this._texV1=1;J=c.getReferenceEllipsoid(J.spatialReference);this._planetRadius=J.radius;this._outerRimWidth=J.outerAtmosphereRimWidth;this._innerRimFactor=(this._planetRadius+G)/this._planetRadius;this._middleRimFactor=(this._planetRadius+0)/this._planetRadius;this._outerRimFactor=(this._planetRadius+this._outerRimWidth)/this._planetRadius;this._texV0=0/this._outerRimWidth;this._texVScale=this._texV1-this._texV0;this._techniques=
R.techniques;J=R.renderContext.rctx;this._cameraChangeHandle=q.watch(()=>this.view.state?.camera,()=>R.requestRender(),q.syncAndInitial);this._vao=this._createRibbon(J);this._vaoCount=N.vertexCount(this._vao,"geometry");this._fadeVao=y.createQuadVAO(J);this._fadeVaoCount=N.vertexCount(this._fadeVao,"geometry");const Q=new H.TextureDescriptor;Q.wrapMode=D.TextureWrapMode.CLAMP_TO_EDGE;Q.flipped=!0;Q.width=1;Q.height=512;this._passParameters.texture=new F.Texture(J,Q,m.marsAtmosphereTextureSimple);
J=new v.SimpleAtmosphereTechniqueConfiguration;J.geometry=v.SimpleAtmosphereGeometry.Cone;this._coneTechnique=this._techniques.acquire(w.SimpleAtmosphereTechnique,J);J.geometry=v.SimpleAtmosphereGeometry.Underground;this._undergroundTechnique=this._techniques.acquire(w.SimpleAtmosphereTechnique,J)}destroy(){this._coneTechnique.release();this._undergroundTechnique.release();this._cameraChangeHandle.remove();this._passParameters.texture=b.disposeMaybe(this._passParameters.texture);this._fadeVao.dispose();
this._vao.dispose()}render(J){this._update(J.bindParameters.camera);const R=J.rctx;1>this._passParameters.undergroundFadeAlpha&&(R.bindTechnique(this._coneTechnique,J.bindParameters,this._passParameters),R.bindVAO(this._vao),R.drawArrays(D.PrimitiveType.TRIANGLES,0,this._vaoCount));0<this._passParameters.undergroundFadeAlpha&&(R.bindTechnique(this._undergroundTechnique,J.bindParameters,this._passParameters),R.bindVAO(this._fadeVao),R.drawArrays(D.PrimitiveType.TRIANGLE_STRIP,0,this._fadeVaoCount))}renderHaze(){}_update(J){var R=
f.create();const Q=this._planetRadius;var W=h.length(J.eye);const S=W-Q;this._passParameters.undergroundFadeAlpha=0>S?Math.min(-S/5E3,1):0;var V=Q+G,T=Q+Math.max(50,S);this._passParameters.innerScale=T*T/(Math.sqrt(T*T-Q*Q)*Math.sqrt(T*T-V*V)+Q*V)-1;this._passParameters.altitudeFade=d.computeInnerAltitudeFade(S);h.scale(R,J.eye,(Q+50)/W);E(R,J.center,J.up,Q,this._passParameters.silhouette);R=this._computeScreenRimWidth(J,R,J.up,this._passParameters.silhouette);W=I(S);V=this._texV0+.001953125*this._texVScale;
T=this._texV0+R*W*this._texVScale;50<S&&(E(J.eye,J.center,J.up,Q,this._passParameters.silhouette),J=this._computeScreenRimWidth(J,J.eye,J.up,this._passParameters.silhouette),J=a.clamp((J-1.5)/(R-1.5),0,1),V=this._texV0+.001953125*J*this._texVScale,T=this._texV0+a.lerp(this._texV1,R*W,J)*this._texVScale);k.set(this._passParameters.texV,V,T)}_createRibbon(J){const R=e.newFloatArray(1155),Q=new Uint32Array(1920);R[0]=0;R[1]=0;R[2]=-1;for(var W=0;128>W;W++){var S=9*W+3;R[S]=W;R[S+1]=this._innerRimFactor;
R[S+2]=-1;R[S+3]=W;R[S+4]=this._middleRimFactor;R[S+5]=0;R[S+6]=W;R[S+7]=this._outerRimFactor;R[S+8]=1;S=3*W+1;var V=127===W?1:S+3,T=15*W;Q[T]=S;Q[T+1]=S+1;Q[T+2]=V+1;Q[T+3]=V+1;Q[T+4]=V;Q[T+5]=S;Q[T+6]=S+1;Q[T+7]=S+2;Q[T+8]=V+2;Q[T+9]=V+2;Q[T+10]=V+1;Q[T+11]=S+1;Q[T+12]=S;Q[T+13]=V;Q[T+14]=0}W=K.createBuffer(Q.length);S=W.position;for(V=0;V<Q.length;++V)T=3*Q[V],S.set(V,0,R[T]),S.set(V,1,R[T+1]),S.set(V,2,R[T+2]);return new A.VertexArrayObject(J,x.Default3D,{geometry:n.glLayout(K)},{geometry:C.BufferObject.createVertex(J,
D.Usage.STATIC_DRAW,W.buffer)})}_computeScreenRimWidth(J,R,Q,W){h.add(P,W.center,W.v2);h.scale(M,P,this._outerRimFactor);l.lookAt(L,R,P,Q);z.project(P,L,J.projectionMatrix,J.viewport,P);z.project(M,L,J.projectionMatrix,J.viewport,M);return h.distance(P,M)/J.height}}const L=p.create(),P=f.create(),M=f.create(),K=u.newLayout().vec3f(B.VertexAttribute.POSITION);return O})},"esri/views/3d/environment/resources/MarsAtmosphereTexture":function(){define(["exports"],function(a){const b=new Uint8ClampedArray([0,
0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,6,0,0,0,6,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,10,0,0,0,10,0,0,0,11,0,0,0,11,0,0,0,11,0,0,0,12,0,0,0,12,0,0,0,12,0,0,0,13,0,0,0,13,0,0,0,14,0,0,0,14,0,0,0,14,0,0,0,14,0,0,0,14,0,0,0,15,0,0,0,15,0,0,0,16,0,0,0,16,0,0,0,16,0,0,0,17,0,0,0,17,0,0,0,18,0,0,0,18,0,0,0,19,0,0,0,19,0,0,0,19,0,0,
0,20,0,0,0,20,0,0,0,21,0,0,0,21,0,0,0,22,0,0,0,22,11,0,0,23,11,0,0,23,11,0,0,23,11,0,0,23,11,0,0,24,11,0,0,24,11,0,0,24,10,0,0,25,10,0,0,25,10,0,0,26,10,0,0,26,9,0,0,27,9,0,0,27,9,0,0,28,9,0,0,28,9,0,0,29,9,0,0,29,8,0,0,30,8,0,0,30,8,0,0,31,8,0,0,31,8,0,0,32,8,0,0,32,8,0,0,32,8,0,0,32,8,0,0,33,8,0,0,33,8,0,0,34,7,0,0,35,7,0,0,35,7,0,0,36,7,0,0,36,7,7,0,37,7,7,0,37,7,7,0,38,7,7,0,38,13,7,0,39,13,7,0,39,13,6,0,40,13,6,0,40,12,6,0,41,12,6,0,41,12,6,0,41,12,6,0,42,12,6,0,42,12,6,0,43,12,6,0,43,12,6,0,
44,12,6,0,44,11,6,0,45,11,6,6,45,11,6,6,46,11,5,5,47,11,5,5,47,11,5,5,48,11,5,5,48,10,5,5,49,10,5,5,49,10,5,5,50,15,5,5,51,15,5,5,51,15,5,5,51,15,5,5,51,15,5,5,52,15,5,5,52,14,5,5,53,14,5,5,54,14,5,5,54,14,5,5,55,14,5,5,55,14,5,5,56,13,4,4,57,13,4,4,57,13,4,4,58,13,4,4,58,13,4,4,59,13,4,4,59,17,4,4,60,17,4,4,60,17,4,4,60,17,4,4,61,17,4,4,61,16,4,4,62,16,4,4,63,16,4,4,63,16,8,4,64,16,8,4,64,16,8,4,65,15,8,4,66,15,8,4,66,15,8,4,67,19,8,4,68,19,8,4,68,18,7,4,69,18,7,4,69,18,7,4,69,18,7,4,70,18,7,4,70,
18,7,4,71,18,7,4,71,18,7,4,72,17,7,3,73,17,7,3,73,21,7,3,74,21,7,3,74,20,7,3,75,20,7,3,76,20,7,3,76,20,7,3,77,20,7,3,77,20,7,3,78,20,7,3,78,20,7,7,78,19,6,6,79,19,10,6,80,19,10,6,80,22,9,6,81,22,9,6,81,22,9,6,82,22,9,6,83,22,9,6,83,21,9,6,84,21,9,6,84,21,9,6,85,21,9,6,86,21,9,6,86,23,9,6,87,23,9,6,87,23,9,6,87,23,9,6,88,23,9,6,88,23,9,6,89,23,8,6,90,23,8,6,90,22,8,6,91,22,8,6,91,25,8,6,92,25,8,5,93,25,8,5,93,24,8,5,94,24,8,5,94,24,11,5,95,24,11,5,96,24,11,5,96,26,11,5,97,26,11,5,97,26,11,5,97,26,
10,5,98,26,10,5,98,26,10,5,99,25,10,5,100,25,10,5,100,25,10,5,101,25,10,5,101,25,10,5,102,27,10,5,103,27,10,5,103,27,10,5,104,27,10,5,104,27,12,5,105,26,12,5,106,26,12,5,106,29,12,5,106,29,12,5,106,29,12,7,107,28,12,7,108,28,12,7,108,28,12,7,109,28,12,7,109,30,12,7,110,30,11,7,111,30,11,7,111,30,11,7,112,30,11,7,112,29,11,7,113,29,11,7,114,29,11,7,114,31,11,7,115,31,11,7,115,31,11,7,115,31,11,7,116,31,11,7,116,33,13,7,117,33,13,9,117,32,13,9,118,32,13,9,118,32,13,9,119,34,15,8,120,34,15,8,120,34,
15,8,121,36,15,8,121,36,15,8,122,36,15,8,122,35,15,8,123,37,14,8,124,37,14,8,124,37,14,8,124,37,14,8,124,39,14,8,125,39,16,8,125,38,16,8,126,38,16,8,127,38,16,8,127,40,16,10,128,40,16,10,128,40,16,10,129,42,18,10,129,41,18,10,130,41,18,10,130,43,18,10,131,43,18,10,131,42,17,10,132,42,17,12,132,42,17,12,133,44,17,12,133,44,17,12,133,46,17,11,134,46,17,11,134,45,19,11,135,45,19,11,135,47,19,11,136,47,19,11,136,47,19,11,137,47,19,11,137,48,20,11,138,48,20,11,138,50,20,13,139,50,20,13,139,49,20,13,140,
49,22,13,140,51,22,13,141,51,22,13,141,50,22,13,142,52,22,13,142,52,21,12,143,53,21,12,143,53,21,12,143,53,21,12,143,53,21,14,144,53,23,14,144,55,23,14,145,55,23,14,145,56,23,14,146,56,23,14,146,57,24,14,147,57,24,14,147,59,24,16,148,59,24,16,148,58,24,15,149,58,26,15,149,58,26,15,149,60,26,15,150,60,26,15,150,61,25,15,151,61,25,15,151,62,25,17,152,62,25,17,152,64,25,17,152,64,27,17,152,63,27,17,153,63,27,17,153,65,27,17,153,66,28,17,154,66,28,17,154,67,28,16,155,67,28,16,155,67,30,16,155,69,29,18,
156,69,29,18,156,68,29,18,157,70,29,18,157,70,29,18,157,71,31,18,158,71,31,18,158,72,30,19,159,72,30,19,159,74,30,19,159,73,30,19,160,73,32,19,160,74,32,19,161,74,32,21,161,76,32,21,161,78,33,21,161,78,33,21,161,79,35,20,162,78,34,20,163,79,34,22,164,81,36,22,164,82,36,22,165,81,35,22,166,82,37,21,167,84,37,21,167,85,36,21,168,86,38,23,169,88,38,23,169,88,38,23,170,88,39,23,170,89,39,24,171,91,40,24,171,92,40,24,172,93,40,24,173,94,41,25,173,95,41,25,174,96,42,25,175,98,42,25,175,99,43,26,176,99,
43,26,177,101,45,26,177,102,44,26,178,103,46,27,179,104,46,27,179,105,46,27,179,106,45,28,180,108,47,28,180,108,46,28,181,109,48,28,182,111,48,29,182,111,49,29,183,114,49,29,184,114,50,30,184,114,50,30,185,116,51,30,185,117,51,30,186,119,52,31,187,119,53,31,187,121,53,31,188,122,54,33,188,123,54,32,189,124,55,32,189,125,55,32,189,126,56,34,190,128,56,34,190,128,57,33,191,130,57,33,191,131,58,35,192,131,58,35,192,133,59,34,193,134,60,35,194,135,60,35,194,136,61,37,195,139,61,37,195,139,62,36,196,141,
62,36,196,141,63,38,197,142,63,38,197,143,64,39,198,144,64,39,198,146,66,39,198,146,67,39,198,147,67,38,199,147,68,40,199,149,68,40,200,150,69,40,200,152,70,41,201,154,71,41,201,154,71,42,202,155,72,42,202,156,73,41,203,157,73,43,203,158,74,42,204,160,75,44,204,161,76,44,204,162,77,44,205,164,77,45,205,165,78,45,206,166,79,45,206,168,80,46,207,169,81,46,207,170,83,47,207,171,83,47,207,172,83,47,207,174,85,48,208,175,85,48,208,177,85,48,209,178,87,49,209,180,87,49,210,181,87,49,210,182,89,50,210,182,
89,50,211,185,91,50,211,186,91,51,212,186,93,51,212,189,94,52,212,190,95,51,213,192,96,51,213,193,96,53,213,194,97,52,214,195,98,54,214,197,98,55,215,198,100,55,215,199,101,55,215,200,102,55,216,202,103,55,216,203,104,55,216,204,105,57,216,205,106,57,216,207,107,58,216,208,108,58,217,209,109,59,217,210,110,60,217,211,111,60,218,212,112,61,218,213,113,61,218,214,114,62,219,217,115,63,219,217,116,64,219,218,118,64,220,219,119,65,220,220,121,66,220,222,121,67,221,222,122,67,221,222,123,68,221,223,124,
69,222,224,125,70,222,225,127,71,222,226,128,72,223,228,129,73,223,228,130,74,223,229,132,75,223,230,135,79,224,231,138,81,224,233,141,84,224,233,144,87,225,235,147,91,225,236,150,94,225,237,154,97,225,238,158,102,225,239,161,107,225,239,165,110,225,240,168,114,226,241,172,118,226,241,176,122,226,241,181,126,226,242,183,130,227,243,186,135,227,243,190,139,227,244,194,143,227,244,197,147,228,244,200,150,228,245,204,154,228,245,207,157,228,245,210,161,229,246,212,164,229,246,215,167,229,246,217,169,
229,246,220,172,230,247,221,174,230]);a.marsAtmosphereTextureSimple=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/Precipitation":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/mathUtils ../../../core/maybe ../../../core/time ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/ellipsoidUtils ./PrecipitationTechnique ./PrecipitationTechniqueConfiguration ../support/buffer/glUtil ../support/buffer/InterleavedLayout ../webgl-engine/lib/AnimationTimer ../webgl-engine/lib/VertexArrayObject ../webgl-engine/lib/VertexAttribute ../../webgl/BufferObject ../../webgl/enums ../../webgl/Util".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){a.Precipitation=class extends q{constructor(C){super(C);this._numParticles=25E4;this._rainSpeed=.1;this._snowSpeed=.01;this._passParameters=new t.PrecipitationPassParameters;this._animation=new r.AnimationTimer;this._passParameters.time=0;this._passParameters.radius=d.getReferenceEllipsoid(C.view.spatialReference).radius;this._techniques=C.context.techniques}destroy(){this._numParticles=0;this._snowTechniqueCached=p.releaseMaybe(this._snowTechniqueCached);
this._rainTechniqueCached=p.releaseMaybe(this._rainTechniqueCached);this._vao=p.disposeMaybe(this._vao);this._instanceIdBuffer=p.disposeMaybe(this._instanceIdBuffer)}get _rainTechnique(){if(null==this._rainTechniqueCached){const C=new w.PrecipitationTechniqueConfiguration;C.type=w.PrecipitationType.Rain;this._rainTechniqueCached=this._techniques.acquire(t.PrecipitationTechnique,C)}return this._rainTechniqueCached}get _snowTechnique(){if(null==this._snowTechniqueCached){const C=new w.PrecipitationTechniqueConfiguration;
C.type=w.PrecipitationType.Snow;this._snowTechniqueCached=this._techniques.acquire(t.PrecipitationTechnique,C)}return this._snowTechniqueCached}update(C){return this._animation.advance(C)}render(C,D,F){const H="rainy"===F?this._rainTechnique:this._snowTechnique;if(H.compiled){var N=C.rctx;this._ensureResources(N);null!=H&&null!=this._vao&&null!=this._instanceIdBuffer&&(null!=C.bindParameters.cloudsFade.data&&(this._passParameters.opacity=C.bindParameters.cloudsFade.opacity),0>=this._passParameters.opacity||
(D=.5>D?l.lerp(0,.35,2*D):l.lerp(.35,1,2*(D-.5)),this._passParameters.time=("rainy"===F?this._rainSpeed:this._snowSpeed)*k.secondsFromMilliseconds(this._animation.time)%1E5,C=N.bindTechnique(H,C.bindParameters,this._passParameters),N.bindVAO(this._vao),C.assertCompatibleVertexAttributeLocations(this._vao),z.bindVertexBufferLayout(N,t.attributeLocations,this._instanceIdBuffer,B,0),N.drawArraysInstanced(y.PrimitiveType.TRIANGLES,0,3,this._numParticles*D),z.unbindVertexBufferLayout(N,t.attributeLocations,
this._instanceIdBuffer,B)))}else this.context.requestRender()}_ensureResources(C){if(null==this._vao){const D=new Float32Array([-1,0,1,1,0,-1,1,0,1]);this._vao=new n.VertexArrayObject(C,t.attributeLocations,{geometry:v.glLayout(A)},{geometry:x.BufferObject.createVertex(C,y.Usage.STATIC_DRAW,D)})}null==this._instanceIdBuffer&&(this._instanceIdBuffer=this._createInstanceIndices(C))}_createInstanceIndices(C){const D=[];for(let F=0;F<this._numParticles;F++)D.push(F);return x.BufferObject.createVertex(C,
y.Usage.STATIC_DRAW,new Float32Array(D))}};b.__decorate([h.property({constructOnly:!0})],a.Precipitation.prototype,"context",void 0);b.__decorate([h.property({constructOnly:!0})],a.Precipitation.prototype,"view",void 0);a.Precipitation=b.__decorate([g.subclass("esri.views.3d.environment.Precipitation")],a.Precipitation);const A=m.newLayout().vec3f(u.VertexAttribute.POSITION),B=v.glLayout(m.newLayout().f32(u.VertexAttribute.INSTANCEFEATUREATTRIBUTE),1);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/environment/PrecipitationTechnique":function(){define("require exports ../../../chunks/Precipitation.glsl ../webgl-engine/core/shaderModules/interfaces ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/lib/Program ../webgl-engine/lib/VertexAttribute ../../webgl/enums ../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g extends l.NoParameters{constructor(){super(...arguments);this.time=
0;this.radius=1;this.width=500;this.opacity=1}}class d extends k.ShaderTechnique{initializeProgram(w){return new h.Program(w.rctx,d.shader.get().build(this.configuration),t)}initializePipeline(){return e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.ONE,c.BlendFactor.ONE,c.BlendFactor.ONE_MINUS_SRC_ALPHA,c.BlendFactor.ONE_MINUS_SRC_ALPHA),depthTest:{func:c.CompareFunction.LEQUAL},colorWrite:e.defaultColorWriteParams})}}d.shader=new p.ReloadableShaderModule(q.Precipitation,()=>
new Promise((w,v)=>a(["./Precipitation.glsl"],w,v)));const t=new Map([[f.VertexAttribute.POSITION,0],[f.VertexAttribute.INSTANCEFEATUREATTRIBUTE,1]]);b.PrecipitationPassParameters=g;b.PrecipitationTechnique=d;b.attributeLocations=t;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Precipitation.glsl":function(){define("exports ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../views/3d/environment/PrecipitationTechniqueConfiguration ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e){function g(m){const r=new c.ShaderBuilder;r.attributes.add(e.VertexAttribute.POSITION,"vec3");r.attributes.add(e.VertexAttribute.INSTANCEFEATUREATTRIBUTE,"float");r.vertex.uniforms.add(new p.Float3PassUniform("cameraPosition",(n,u)=>u.camera.eye));r.vertex.uniforms.add(new p.Float3PassUniform("offset",(n,u)=>{u=u.camera.eye;var x=.5*n.width;const y=1/n.width;x=b.floor(d,b.set(d,(u[0]+x)*y,(u[1]+x)*y,(u[2]+x)*y));return b.sub(x,u,b.scale(x,x,n.width))}));r.vertex.uniforms.add(new k.FloatPassUniform("width",
n=>n.width));r.vertex.uniforms.add(new f.Matrix4PassUniform("proj",(n,u)=>u.camera.projectionMatrix));r.vertex.uniforms.add(new f.Matrix4PassUniform("view",(n,u)=>u.camera.viewMatrix));r.vertex.uniforms.add(new k.FloatPassUniform("time",n=>n.time));r.varyings.add("vUv","vec2");r.vertex.code.add(h.glsl`
vec3 hash31(float p){
vec3 p3 = fract(vec3(p) * vec3(0.1031, 0.1030, 0.0973));
p3 += dot(p3, p3.yzx + 33.33);
return fract((p3.xxy + p3.yzz) * p3.zyx);
}
float hash11(float p){
p = fract(p * 0.1031);
p *= p + 33.33;
p *= p + p;
return fract(p);
}
//https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/
vec3 rotateVectorByQuaternion(vec3 v, vec4 q){
return 2.0 * cross(q.xyz, v * q.w + cross(q.xyz, v)) + v;
}
void main(void) {
vUv = position.xz;
vec3 rand = hash31(instanceFeatureAttribute);
// Set random position for all particles
// The hash function space is not high resolution so offset particles by an additional random value
// This creates grids of 1000 particles which are shifted by random hundreths of the tile width
// overlaying multiple identical but offset grids
vec3 randomPosition = 2.0 * (rand + (0.01 + 0.01 * rand) * floor(0.001 * instanceFeatureAttribute)) - 1.0;
// Random orientation of rain drops
float angle = 3.1415 * hash11(instanceFeatureAttribute);
vec3 up = vec3(0, 0, 1);
// Gravity and wind direction
vec3 direction = normalize(cameraPosition);
vec3 tangent = normalize(cross(direction, up));
// Gravity
vec3 animatedPos = randomPosition + direction * -time;
// Rain particles fall straight down and are randomly oriented
// Snow particles have random sinusoid trajectories and are rotated to face the camera
${m.type===l.PrecipitationType.Rain?h.glsl`
// Random rotation for particle
vec3 rotationAxis = up;
vec4 quat = vec4(rotationAxis * sin(angle), cos(angle));
vec3 transformedPos = rotateVectorByQuaternion(vec3(0.2, 0.2, 4.0) * (position - vec3(0.5, 0.0, 0.5)), quat);
// Rotate particle to planetary position
rotationAxis = tangent;
angle = 0.5 * -acos(dot(direction, up));
quat = vec4(rotationAxis * sin(angle), cos(angle));
transformedPos = rotateVectorByQuaternion(transformedPos, quat);
vec4 pos = mat4(mat3(view)) * vec4(transformedPos + (mod(width * animatedPos - offset, width) - 0.5 * width), 1.0);
gl_Position = proj * pos;
`:h.glsl`
vec3 rotationAxis = direction;
vec4 quat = vec4(rotationAxis * sin(angle), cos(angle));
tangent = rotateVectorByQuaternion(tangent, quat);
// Random sinusoid from friction
animatedPos += tangent * 0.25 * sin(dot(animatedPos, direction));
vec4 pos = mat4(mat3(view)) * vec4((mod(width * animatedPos - offset, width) - 0.5 * width), 1.0);
gl_Position = proj * (0.5 * vec4(position.xzy, 0.0) + pos);
`}
}
`);r.fragment.uniforms.add(new k.FloatPassUniform("opacity",n=>n.opacity),new p.Float3PassUniform("particleColor",(n,u)=>{n=m.type===l.PrecipitationType.Rain?v:w;const x=b.scale(d,n,.7);b.normalize(t,u.camera.eye);u=Math.max(0,b.dot(t,u.lighting.mainLight.direction));return b.lerp(x,x,n,u)}));r.fragment.code.add(h.glsl`
void main() {
// Cut off corners of the triangle
if(vUv.x < 0.0 || vUv.y < 0.0){
discard;
}
float d = length(vUv - vec2(0.5));
${m.type===l.PrecipitationType.Rain?h.glsl`d = 0.35 * smoothstep(0.5, 0.0, d);`:h.glsl`d = smoothstep(0.5, 0.1, d);`}
fragColor = opacity * vec4(particleColor * d, d);
}
`);return r}const d=q.create(),t=q.create(),w=q.fromValues(1,1,1),v=q.fromValues(.85,.85,.85);q=Object.freeze(Object.defineProperty({__proto__:null,build:g},Symbol.toStringTag,{value:"Module"}));a.Precipitation=q;a.build=g})},"esri/views/3d/environment/PrecipitationTechniqueConfiguration":function(){define(["exports","../../../chunks/tslib.es6","../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q){a.PrecipitationType=void 0;(function(p){p[p.Rain=0]="Rain";p[p.Snow=
1]="Snow";p[p.COUNT=2]="COUNT"})(a.PrecipitationType||(a.PrecipitationType={}));class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.type=a.PrecipitationType.Rain}}b.__decorate([q.parameter({count:a.PrecipitationType.COUNT})],l.prototype,"type",void 0);a.PrecipitationTechniqueConfiguration=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/AnimationTimer":function(){define(["exports","../../../../core/time"],function(a,
b){class q{constructor(){this.enabled=!0;this._time=b.Milliseconds(0)}get time(){return this._time}advance({deltaTime:p,fixedTime:k}){if(null!=k){if(this._time===k)return!1;this._time=k;return!0}this._time=b.Milliseconds(this._time+p);return 0!==p}}class l{constructor(p,k){this.deltaTime=p;this.fixedTime=k}}a.AnimationTimer=q;a.Parameters=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/Stars":function(){define("exports ../../../chunks/tslib.es6 ../../../assets ../../../core/Accessor ../../../core/asyncUtils ../../../core/Error ../../../core/Logger ../../../core/maybe ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/support/UpdatingHandles ./StarsTechnique ../support/buffer/glUtil ../support/buffer/InterleavedLayout ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/VertexArrayObject ../webgl-engine/lib/VertexAttribute ../../webgl/BufferObject ../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C){function D(I,O,L,P){const M=E.createBuffer(P),K=M.position,J=M.color,R=M.size;for(let S=0;S<P;S++){var Q=O[2*S],W=O[2*S+1];K.set(S,0,-Math.cos(Q)*Math.sin(W));K.set(S,1,-Math.sin(Q)*Math.sin(W));K.set(S,2,-Math.cos(W));Q=L[S];Q=192<=Q?[2.9,Q-192]:160<=Q?[2.5,Q-160]:128<=Q?[2,Q-128]:96<=Q?[1.5,Q-96]:64<=Q?[1,Q-64]:32<=Q?[.7,Q-32]:[.4,Q];W=F[Q[1]];W=[parseInt(W.substring(0,2),16),parseInt(W.substring(2,4),16),parseInt(W.substring(4,6),16)];
J.set(S,0,255*W[0]);J.set(S,1,255*W[1]);J.set(S,2,255*W[2]);J.set(S,3,255);R.set(S,Q[0])}return new z.VertexArrayObject(I,y.Default3D,{geometry:u.glLayout(E)},{geometry:B.BufferObject.createVertex(I,C.Usage.STATIC_DRAW,M.buffer)})}a.Stars=class extends l{get updating(){return this._updatingTracking.updating||this.loading}get loading(){return null!=this._loadDataTask&&!this._loadDataTask.finished}constructor(I){super(I);this._loadDataTask=null;this._numPoints=0;this._passParameters=new n.StarPassParameters;
this._updatingTracking=new r.UpdatingHandles}initialize(){this._loadDataTask=this._createLoadDataTask()}destroy(){this._loadDataTask=f.abortMaybe(this._loadDataTask);this._updatingTracking.destroy();this._numPoints=0;this._technique=f.releaseMaybe(this._technique);this._vao=f.disposeMaybe(this._vao);G=null}render(I){const {rctx:O}=I;this._ensureResources(O);null!=this._technique&&null!=this._vao&&(this._technique.compiled?(I=O.bindTechnique(this._technique,I.bindParameters,this._passParameters),O.bindVAO(this._vao),
I.assertCompatibleVertexAttributeLocations(this._vao),O.drawArrays(C.PrimitiveType.POINTS,0,this._numPoints)):this.requestRender())}_ensureResources(I){if(null==this._technique&&null!=G){this._technique=new n.StarsTechnique({rctx:I,viewingMode:this.view.state.viewingMode});this._numPoints=G.byteLength/9;var O=new Float32Array(G,0,2*this._numPoints),L=new Uint8Array(G,8*this._numPoints,this._numPoints);this._vao=D(I,O,L,this._numPoints);this._updatingTracking.add(()=>"virtual"!==this.view.environment.lighting.type?
this.view.environment.lighting.date:null,P=>this._update(P),e.initial)}}_update(I){if(I){var O=I.getHours()/12,L=I.getMinutes()/60*(2/24),P=I.getSeconds()/60*(2/1440);O=(O+L+P-.9972222)%2;L=new Date(I.getFullYear(),0,1,11,58,56);P=new Date(I.getFullYear()+1,0,1,11,58,55);I=(+I-+L)/(+P-+L)*2;L=v.copy(this._passParameters.modelMatrix,N);v.rotateZ(L,L,-I*Math.PI);v.multiply(L,H,L);v.rotateZ(L,L,-O*Math.PI);this.requestRender()}}_createLoadDataTask(){if(null!=G)return null;const I=p.createTask(async O=>
{({data:O}=await q.fetchAsset("esri/views/3d/environment/resources/stars.wsv",{responseType:"array-buffer",signal:O}));if(!O)throw new k("stars:no-data-received","Failed to create stars because star catalogue is missing");const L=O.byteLength/9;if(0!==L%1||5E4<L||5E3>L)throw new k("stars:invalid-data","Failed to create stars because star catalogue data is invalid");G=O});I.promise.catch(O=>{c.isAbortError(O)||h.getLogger(this).error(O)}).then(()=>{this.destroyed||(this.requestRender(),this.notifyChange("updating"))});
return I}};b.__decorate([g.property({constructOnly:!0})],a.Stars.prototype,"view",void 0);b.__decorate([g.property({constructOnly:!0})],a.Stars.prototype,"requestRender",void 0);b.__decorate([g.property({readOnly:!0})],a.Stars.prototype,"updating",null);b.__decorate([g.property()],a.Stars.prototype,"_loadDataTask",void 0);b.__decorate([g.property()],a.Stars.prototype,"_updatingTracking",void 0);a.Stars=b.__decorate([w.subclass("esri.views.3d.environment.Stars")],a.Stars);const F="9bb2ff;9eb5ff;aabfff;bbccff;ccd8ff ;dae2ff;e4e9ff;eeefff;f8f6ff;fff9fb;fff5ef;fff1e5;ffeddb;ffe9d2;ffe6ca;ffe3c3;ffe0bb;ffddb4;ffdaad;ffd6a5;ffd29c;ffcc8f;ffc178;ffa94b;ff7b00".split(";"),
H=m.fromValues(1,0,0,0,0,.9174771405229186,.39778850739794974,0,0,-.39778850739794974,.9174771405229186,0,0,0,0,1),N=m.fromValues(1,0,0,0,0,.9174771405229186,-.39778850739794974,0,0,.39778850739794974,.9174771405229186,0,0,0,0,1),E=x.newLayout().vec3f(A.VertexAttribute.POSITION).vec4u8(A.VertexAttribute.COLOR).f32(A.VertexAttribute.SIZE);let G=null;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/environment/StarsTechnique":function(){define("require exports ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../chunks/Stars.glsl ../webgl-engine/core/shaderModules/interfaces ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){class t extends p.NoParameters{constructor(){super(...arguments);this.modelMatrix=q.create()}}class w extends h.ShaderTechnique{constructor(v){super(v,new f.ShaderTechniqueConfiguration,()=>this.destroy())}initializeProgram(v){return new e.Program(v.rctx,w.shader.get().build(),c.Default3D)}initializePipeline(){return d.makePipelineState({blending:d.separateBlendingParams(g.BlendFactor.SRC_ALPHA,g.BlendFactor.ONE,g.BlendFactor.ONE_MINUS_SRC_ALPHA,g.BlendFactor.ONE_MINUS_SRC_ALPHA),
depthTest:{func:g.CompareFunction.LEQUAL},colorWrite:d.defaultColorWriteParams})}}w.shader=new k.ReloadableShaderModule(l.Stars,()=>new Promise((v,m)=>a(["./Stars.glsl"],v,m)));b.StarPassParameters=t;b.StarsTechnique=w;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Stars.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c){function e(){const d=new f.ShaderBuilder;d.attributes.add(c.VertexAttribute.POSITION,"vec3");d.attributes.add(c.VertexAttribute.COLOR,"vec4");d.attributes.add(c.VertexAttribute.SIZE,"float");d.varyings.add("vcolor","vec4");d.varyings.add("vsize","float");d.vertex.uniforms.add(new h.Matrix4PassUniform("transform",(t,w)=>{b.copy(g,w.camera.projectionMatrix);g[10]=2.4E-7-1;g[11]=-1;g[14]=(2.4E-7-2)*w.camera.near;b.multiply(g,g,w.camera.viewMatrix);return b.multiply(g,g,t.modelMatrix)}),
new l.Float4PassUniform("viewport",(t,w)=>w.camera.fullViewport),new p.FloatPassUniform("pixelRatio",(t,w)=>w.camera.pixelRatio));d.vertex.code.add(k.glsl`void main(void) {
gl_Position = transform * vec4(position, 0);
vcolor = color / 1.2;
vsize = size * 5.0 * pixelRatio;
gl_PointSize = vsize;
}`);d.fragment.code.add(k.glsl`void main() {
float cap = 0.7;
float scale = 1.0 / cap;
float helper = clamp(length(abs(gl_PointCoord - vec2(0.5))), 0.0, cap);
float alpha = clamp((cap - helper) * scale, 0.0, 1.0);
float intensity = alpha * alpha * alpha;
if (vsize < 3.0) {
intensity *= 0.5;
}
fragColor = vec4(vcolor.xyz, intensity);
}`);return d}const g=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:e},Symbol.toStringTag,{value:"Module"}));a.Stars=q;a.build=e})},"esri/views/3d/webgl-engine/effects/RenderPlugin":function(){define(["exports","../../../../core/Accessor","../core/shaderLibrary/ShaderOutput"],function(a,b,q){const l={required:[]};q={required:[q.ShaderOutput.Depth]};class p extends b{consumes(){return l}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}get materialReference(){return null}modify(g){}get numGeometries(){return 0}get hasOccludees(){return!1}queryRenderOccludedState(g){return!1}}
class k extends p{}class h extends p{constructor(){super(...arguments);this.drapedPriority=0}}class f extends p{}class c extends p{}class e extends p{}a.ASyncPreparesRenderPlugin=e;a.AsyncRenderPlugin=c;a.ConsumesDepth=q;a.ConsumesNone=l;a.SyncPrepareRenderPlugin=h;a.SyncPreparesRenderPlugin=f;a.SyncRenderPlugin=k;a.isPrepareRenderPlugin=function(g){return"prepareTechnique"in g};a.isPreparesRenderPlugin=function(g){return"prepareTechniques"in g};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/lib/Update":function(){define(["exports"],function(a){a.Update=void 0;var b=a.Update||(a.Update={});b[b.Immediate=0]="Immediate";b[b.Faded=1]="Faded";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/sunUtils":function(){define("exports ../../../core/mathUtils ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/math/vec2 ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../ViewingMode ../../../chunks/SunCalc ./mathUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){function d(R,Q,W){Q===c.ViewingMode.Global?h.normalize(M,R.eye):h.set(M,0,0,1);h.scale(K,R.viewForward,-1);Q=g.angle(K,M);const S=Math.max(Q-.5,0);q.fromRotation(P,-Math.max(.25,Q-.25-.85*S/(S+1)),R.viewRight);h.transformMat4(W,K,P);h.add(W,W,h.scale(J,R.viewRight,.2));h.normalize(W,W)}function t(R,Q,W,S){const V=y,T=q.identity(x);if(W===c.ViewingMode.Global)e.SunCalc.getPosition(R,0,0,V),h.set(S,0,0,-1),q.rotateX(T,T,-V.azimuth),q.rotateY(T,T,-V.altitude);else{var Y=
m.planarDirection;W=Y.globalAngles;Y=(Math.abs(Q[2])-Y.localAltitude)/(Y.globalAltitude-Y.localAltitude);Y=b.clamp(Y,0,1);1>Y?(e.SunCalc.getPosition(R,Q[1],Q[0],V),V.azimuth=(1-Y)*V.azimuth+Y*W.azimuth,V.altitude=(1-Y)*V.altitude+Y*W.altitude):(V.azimuth=W.azimuth,V.altitude=W.altitude);h.set(S,0,-1,0);q.rotateZ(T,T,-V.azimuth);q.rotateX(T,T,-V.altitude)}h.transformMat4(S,S,T)}function w(R){switch(R){case "disabled":case "sunny":return new r(1,1);case "cloudy":return new r(1,1);case "rainy":return new r(.4,
1.2);case "snowy":return new r(.5,1.3);case "foggy":return new r(.2,1.6)}}function v(R,Q){const W=(R[0]+R[1]+R[2])/3;R[0]+=(W-R[0])*Q;R[1]+=(W-R[1])*Q;R[2]+=(W-R[2])*Q}const m={local:{altitude:1500,ambientAtNight:.1,ambientAtNoon:.45,ambientAtTwilight:.2,directAtNoon:.65,directAtTwilight:.7},global:{altitude:8E5,ambient:.015,direct:.75},planarDirection:{localAltitude:1E4,globalAltitude:1E6,globalAngles:{azimuth:1.3*Math.PI,altitude:.6*Math.PI}}};class r{constructor(R,Q){this.direct=R;this.ambient=
Q}}const n=f.fromValues(.5773502691896258,-.5773502691896258,.5773502691896258);class u{constructor(){this.ambient={color:f.fromValues(1,1,1),intensity:.55};this.direct={color:f.fromValues(1,1,1),intensity:.55,directionToLightSource:f.clone(n)};this.noonFactor=.5;this.globalFactor=0;this.environmentStrength=this.specularStrength=1}}const x=l.create(),y={azimuth:0,altitude:0},z=f.fromValues(.01,.01,.01),A=f.fromValues(1,.6,.5),B=f.fromValues(1,.98,.98),C=f.fromValues(1,1,1),D=f.fromValues(.8,.8,1),
F=f.fromValues(.8,.8,1),H=f.fromValues(.98,.98,1),N=f.fromValues(1,1,1),E=k.fromValues(.01,m.local.ambientAtNight),G=k.fromValues(m.local.directAtTwilight,m.local.ambientAtTwilight),I=k.fromValues(.9*m.local.directAtNoon,m.local.ambientAtNoon),O=k.fromValues(m.local.directAtNoon,m.local.ambientAtNoon),L=new Date(0),P=l.create(),M=f.create(),K=f.create(),J=f.create();a.ColorAndIntensity=u;a.computeColorAndIntensity=function(R,Q,W,S,V,T){h.set(T.ambient.color,1,1,1);T.ambient.intensity=m.global.ambient;
h.set(T.direct.color,1,1,1);T.direct.intensity=m.global.direct;var Y=b.clamp((Math.abs(Q[2])-m.local.altitude)/(m.global.altitude-m.local.altitude),0,1);T.globalFactor=Y;var ha;null!=R&&(ha=e.SunCalc.getTimes(R,Q[1],Q[0]));if(1>Y){if(null!=R){var ba=ha;var U=R.valueOf();if(ba.polarException===e.SunCalc.PolarException.MIDNIGHT_SUN){var Z=U-36E5*(R.getHours()+48)-6E4*R.getMinutes();ba=Z+432E6}else ba.polarException===e.SunCalc.PolarException.POLAR_NIGHT?(Z=U-2,ba=U-1):(Z=ba.sunrise.valueOf(),ba=ba.sunset.valueOf());
var ca=ba-Z;var ea=Z+ca/2,da=ca/4;const ia=ea-da;da=ea+da;ca*=.06;const ka=Z-ca/2,fa=Z+ca/2,X=ba-ca/2,ja=ba+ca/2;Z=k.create();ca=f.create();ba=f.create();U<ka||U>ja?(p.copy(Z,E),h.copy(ca,z),h.copy(ba,D)):U<fa?(U=(U-ka)/(fa-ka),p.lerp(Z,E,G,U),h.lerp(ca,z,A,U),h.lerp(ba,D,F,U)):U<ia?(U=(U-fa)/(ia-fa),p.lerp(Z,G,I,U),h.lerp(ca,A,B,U),h.lerp(ba,F,H,U)):U<ea?(U=(U-ia)/(ea-ia),p.lerp(Z,I,O,U),h.lerp(ca,B,C,U),h.lerp(ba,H,N,U)):U<da?(U=(U-ea)/(da-ea),p.lerp(Z,O,I,U),h.lerp(ca,C,B,U),h.lerp(ba,N,H,U)):
U<X?(U=(U-da)/(X-da),p.lerp(Z,I,G,U),h.lerp(ca,B,A,U),h.lerp(ba,H,F,U)):U<ja&&(U=(U-X)/(ja-X),p.lerp(Z,G,E,U),h.lerp(ca,A,z,U),h.lerp(ba,F,D,U));U=0;switch(S){case "rainy":case "foggy":U=.8;break;case "snowy":U=.5}0<U&&(v(ca,U),v(ba,U));ea=w(S);U=Z[0]*ea.direct;Z=Z[1]*ea.ambient}else ba=w(S),U=m.local.directAtNoon*ba.direct,ca=f.fromValues(1,1,1),Z=m.local.ambientAtNoon*ba.ambient,ba=f.fromValues(1,1,1);h.lerp(T.ambient.color,ba,T.ambient.color,Y);T.ambient.intensity=b.lerp(Z,T.ambient.intensity,
Y);h.lerp(T.direct.color,ca,T.direct.color,Y);T.direct.intensity=b.lerp(U,T.direct.intensity,Y);T.specularStrength="rainy"===S||"snowy"===S||"foggy"===S?0:1;T.environmentStrength="rainy"===S?.7:"snowy"===S||"foggy"===S?.75:1}null!=R?(S=R.valueOf(),ha.polarException===e.SunCalc.PolarException.MIDNIGHT_SUN?(Y=S-36E5*(R.getHours()+48)-6E4*R.getMinutes(),ha=Y+432E6):ha.polarException===e.SunCalc.PolarException.POLAR_NIGHT?(Y=S-2,ha=S-1):(Y=ha.sunrise.valueOf(),ha=ha.sunset.valueOf()),S=1-b.clamp(Math.abs(S-
(Y+(ha-Y)/2))/432E5,0,1)):S=1;T.noonFactor=S;null!=R?t(R,Q,W,T.direct.directionToLightSource):d(V,W,T.direct.directionToLightSource)};a.computeDirectionsOverTime=function(R,Q,W,S,V){R=R.getTime();Q=Q.getTime()-R;Q=Math.floor(Q/W)+1;const T=Array(Q);for(let Y=0;Y<Q;++Y)L.setTime(R+W*Y),T[Y]=f.create(),t(L,S,V,T[Y]);return T};a.computeShadowsEnabled=function(R,Q){return Q===c.ViewingMode.Global?!0:Math.abs(R)<m.planarDirection.localAltitude};a.computeVirtualLightDirection=d;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/chunks/SunCalc":function(){define(["exports","./_commonjsHelpers"],function(a,b){var q={exports:{}};(function(l){(function(p){p=p();void 0!==p&&(l.exports=p)})(function(){function p(D){return new Date(864E5*(D+.5-2440588))}function k(D,F){return u(v(D)*m(A)-r(F)*v(A),m(D))}function h(D,F){return n(v(F)*m(A)+m(F)*v(A)*v(D))}function f(D,F,H){return u(v(D),m(D)*v(F)-r(H)*m(F))}function c(D,F,H){return n(v(F)*v(H)+m(F)*m(H)*m(D))}function e(D){return y*(1.9148*
v(D)+.02*v(2*D)+3E-4*v(3*D))}function g(D,F){D=y*(357.5291+.98560028*D);var H=e(D);D=D+H+102.9372*y+w;F||={dec:0,ra:0};F.dec=h(D,0);F.ra=k(D,0);return F}function d(D,F,H){return 2451545+D+.0053*v(F)-.0069*v(2*H)}function t(D){var F=y*(134.963+13.064993*D),H=y*(93.272+13.22935*D);D=y*(218.316+13.176396*D)+6.289*y*v(F);H=5.128*y*v(H);F=385001-20905*m(F);return{ra:k(D,H),dec:h(D,H),dist:F}}var w=Math.PI,v=Math.sin,m=Math.cos,r=Math.tan,n=Math.asin,u=Math.atan2,x=Math.acos,y=w/180,z={dec:0,ra:0},A=23.4397*
y,B={PolarException:{NORMAL:0,MIDNIGHT_SUN:1,POLAR_NIGHT:2},getPosition:function(D,F,H,N){H=y*-H;F*=y;var E=D.valueOf()/864E5-.5+2440588-2451545;D=g(E,z);H=y*(280.16+360.9856235*E)-H-D.ra;N||={azimuth:0,altitude:0};N.azimuth=f(H,F,D.dec);N.altitude=c(H,F,D.dec);return N}},C=[[-.83,"sunrise","sunset"]];B.addTime=function(D,F,H){C.push([D,F,H])};B.getTimes=function(D,F,H){function N(Q){var W=G,S=P;Q=x((v(Q)-v(W)*v(S))/(m(W)*m(S)));return d(9E-4+(Q+E)/(2*w)+I,O,L)}var E=y*-H,G=y*F,I=Math.round(D.valueOf()/
864E5-.5+2440588-2451545-9E-4-E/(2*w));D=9E-4+(0+E)/(2*w)+I;var O=y*(357.5291+.98560028*D);F=e(O);var L=O+F+102.9372*y+w,P=h(L,0);D=d(D,O,L);F={solarNoon:p(D),nadir:p(D-.5),polarException:B.PolarException.NORMAL};var M;H=0;for(M=C.length;H<M;H+=1){var K=C[H];var J=N(K[0]*y);var R=D-(J-D);F[K[1]]=p(R);F[K[2]]=p(J)}F.polarException=function(Q){Q=(v(Q)-v(G)*v(P))/(m(G)*m(P));return-1>Q?B.PolarException.MIDNIGHT_SUN:1<Q?B.PolarException.POLAR_NIGHT:B.PolarException.NORMAL}(C[0][0]*y);return F};B.getMoonPosition=
function(D,F,H){H=y*-H;F*=y;var N=D.valueOf()/864E5-.5+2440588-2451545;D=t(N);H=y*(280.16+360.9856235*N)-H-D.ra;N=c(H,F,D.dec);N+=.017*y/r(N+10.26*y/(N+5.1*y));return{azimuth:f(H,F,D.dec),altitude:N,distance:D.dist}};B.getMoonFraction=function(D){var F=D.valueOf()/864E5-.5+2440588-2451545;D=g(F);F=t(F);D=x(v(D.dec)*v(F.dec)+m(D.dec)*m(F.dec)*m(D.ra-F.ra));D=u(149598E3*v(D),F.dist-149598E3*m(D));return(1+m(D))/2};return B})})(q);b=b.getDefaultExportFromCjs(q.exports);a.SunCalc=b})},"esri/views/support/euclideanLengthMeasurementUtils":function(){define("exports ../../core/quantityUtils ../../core/unitUtils ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ../../geometry/projection/projectVectorToVector ../../geometry/support/spatialReferenceUtils ./measurementUtils".split(" "),
function(a,b,q,l,p,k,h,f){function c(z,A){const {hasZ:B,spatialReference:C}=z;var D=f.computeEuclideanMeasurementSR(C);let F=0;D=q.lengthUnitFromSpatialReference(D);if(null==D)return null;A=A===m.Direct?d:t;for(const N of z.paths)if(!(2>N.length)){z=N.length-1;for(let E=0;E<z;++E){var H=N[E];r[0]=H[0];r[1]=H[1];r[2]=B?H[2]:0;H=N[E+1];n[0]=H[0];n[1]=H[1];n[2]=B?H[2]:0;H=A(r,n,C);if(null==H)return null;F+=H.value}}return b.createLength(F,D)}function e(z,A){A=q.verticalLengthUnitFromSpatialReference(A);
return null!=A?b.createLength(z??0,A):null}function g(z,A,B){z=v(z,A,B);return null!=z?{direct:b.createLength(z.direct,z.unit),horizontal:b.createLength(z.horizontal,z.unit),vertical:b.createLength(z.vertical,z.unit)}:null}function d(z,A,B){z=v(z,A,B,m.Direct);return null!=z?b.createLength(z.direct,z.unit):null}function t(z,A,B){z=v(z,A,B,m.Horizontal);return null!=z?b.createLength(z.horizontal,z.unit):null}function w(z,A,B){z=v(z,A,B,m.Vertical);return null!=z?b.createLength(z.verticalSigned,z.unit):
null}function v(z,A,B,C){const D=f.computeEuclideanMeasurementSR(B),F=q.lengthUnitFromSpatialReference(D);if(null==F)return null;const H=A[2]-z[2];if(C===m.Vertical)return{verticalSigned:H,unit:F};if(!k.projectVectorToVector(z,B,u,D)||!k.projectVectorToVector(A,B,x,D))return null;if(C===m.Direct)return{direct:l.distance(x,u),unit:F};l.set(y,z[0],z[1],A[2]);if(!k.projectVectorToVector(y,B,y,D))return null;z=l.distance(y,x);return C===m.Horizontal?{horizontal:z,unit:F}:{direct:l.distance(x,u),horizontal:z,
vertical:Math.abs(H),unit:F}}var m;(function(z){z[z.Direct=0]="Direct";z[z.Horizontal=1]="Horizontal";z[z.Vertical=2]="Vertical"})(m||={});const r=p.create(),n=p.create(),u=p.create(),x=p.create(),y=p.create();a.elevationFromPoint=function(z){return null!=z?e(z.hasZ?z.z:0,z.spatialReference):null};a.elevationFromZ=e;a.euclideanDirectDistance=d;a.euclideanDirectDistanceBetweenPoints=function(z,A){const {spatialReference:B}=z;if(!h.equals(B,A.spatialReference))return null;r[0]=z.x;r[1]=z.y;r[2]=z.hasZ?
z.z:0;n[0]=A.x;n[1]=A.y;n[2]=A.hasZ?A.z:0;return d(r,n,B)};a.euclideanDistance=g;a.euclideanDistanceBetweenPoints=function(z,A){const {spatialReference:B}=z;if(!h.equals(B,A.spatialReference))return null;r[0]=z.x;r[1]=z.y;r[2]=z.hasZ?z.z:0;n[0]=A.x;n[1]=A.y;n[2]=A.hasZ?A.z:0;return g(r,n,B)};a.euclideanHorizontalDistance=t;a.euclideanHorizontalDistanceBetweenPoints=function(z,A){const {spatialReference:B}=z;if(!h.equals(B,A.spatialReference))return null;r[0]=z.x;r[1]=z.y;r[2]=z.hasZ?z.z:0;n[0]=A.x;
n[1]=A.y;n[2]=A.hasZ?A.z:0;return t(r,n,B)};a.euclideanHorizontalLength=function(z){return c(z,m.Horizontal)};a.euclideanLength=function(z){return c(z,m.Direct)};a.verticalDistance=function(z,A,B){z=v(z,A,B,m.Vertical);return null!=z?b.createLength(Math.abs(z.verticalSigned),z.unit):null};a.verticalSignedDistance=w;a.verticalSignedDistanceBetweenPoints=function(z,A){const {spatialReference:B}=z;if(!h.equals(B,A.spatialReference))return null;r[0]=z.x;r[1]=z.y;r[2]=z.hasZ?z.z:0;n[0]=A.x;n[1]=A.y;n[2]=
A.hasZ?A.z:0;return w(r,n,B)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/measurementUtils":function(){define(["exports","../../geometry/ellipsoidUtils","../../geometry/spatialReferenceEllipsoidUtils","../../geometry/support/spatialReferenceUtils"],function(a,b,q,l){a.computeEuclideanMeasurementSR=function(p){return l.isEarth(p)?l.isWGS84(p)||l.isWebMercator(p)||l.isCGCS2000(p)||b.isSphericalECEF(p)?q.WGS84ECEFSpatialReference:p:q.getSphericalPCPF(p)};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/SceneInputManager":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/has ../../../core/maybe ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./handlers/DoubleClickZoom ./handlers/DragRotate ./handlers/DragZoom ./handlers/GamepadNavigation ./handlers/KeyboardNavigation ./handlers/MouseWheelZoom ./handlers/PinchAndPanNavigation ./handlers/PointerDownCancelAnimation ./handlers/SingleKeyResetHeading ./handlers/SingleKeyResetTilt ./handlers/TwoFingerTilt ../../input/BrowserEventSource ../../input/InputManager ../../input/handlers/PreventContextMenu ../../input/recognizers/Drag ../../input/recognizers/ImmediateDoubleClick ../../input/recognizers/PointerClickHoldAndDrag ../../input/recognizers/SingleAndDoubleClick ../../input/recognizers/VerticalTwoFingerDrag ../state/controllers/RotateController".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N){b=class extends b{destroy(){this.disconnect()}get primaryDragAction(){return this._get("primaryDragAction")}set primaryDragAction(G){"pan"!==G&&"rotate"!==G||G===this._get("primaryDragAction")||(this._set("primaryDragAction",G),this._updateMode())}get mode(){return this._get("mode")}set mode(G){"default"!==G&&"pro"!==G||G===this._get("mode")||(this._set("mode",G),this._updateMode())}get updating(){return!!this._inputManager?.updating}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??
!1}disconnect(){this.view.viewEvents.disconnect();this._inputManager=l.destroyMaybe(this._inputManager)}connect(){const G=this.view;this._source=new y.BrowserEventSource(this.view.surface,G.input);var I=[new C.ImmediateDoubleClick,new D.PointerClickHoldAndDrag,new F.SingleAndDoubleClick,new B.Drag(this.view.navigation),new H.VerticalTwoFingerDrag];this._inputManager=I=new z.InputManager({eventSource:this._source,recognizers:I});I.installHandlers("prevent-context-menu",[new A.PreventContextMenu],z.ViewEventPriorities.INTERNAL);
this._modeDragPan=new m.PinchAndPanNavigation(G,"primary");this._modeDragRotate=new g.DragRotate(G,"secondary",N.PivotPoint.CENTER);this._modeDragZoom=new d.DragZoom(G,"tertiary");I.installHandlers("navigation",[new r.PointerDownCancelAnimation(G),new e.DoubleClickZoom(G),new t.GamepadNavigation(G),new w.KeyboardNavigation(G,{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:"u",down:"j",headingLeft:"a",headingRight:"d",tiltUp:"w",tiltDown:"s",zoomIn:"+",zoomOut:"-"}),
new v.MouseWheelZoom(G),new u.SingleKeyResetTilt(G,"p"),new n.SingleKeyResetHeading(G,"n"),new g.DragRotate(G,"primary",N.PivotPoint.EYE,["b"]),new g.DragRotate(G,"secondary",N.PivotPoint.CENTER,["b"]),new m.PinchAndPanNavigation(G,"tertiary",["b"]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,new x.TwoFingerTilt(G)],z.ViewEventPriorities.INTERNAL);this.view.viewEvents.connect(I);this._updateMode();this.addHandles(p.watch(()=>this.view.navigation?.browserTouchPanEnabled,O=>{this._source.browserTouchPanningEnabled=
!O},p.initial))}isModifierKeyDown(G){return this._inputManager?.isModifierKeyDown(G)??!1}_updateMode(){var G=this.primaryDragAction;if(G=E.get(this.mode)?.get(G))this._modeDragPan&&(this._modeDragPan.pointerAction=G.pan),this._modeDragRotate&&(this._modeDragRotate.pointerAction=G.rotate),this._modeDragZoom&&(this._modeDragZoom.pointerAction=G.zoom)}get test(){}};a.__decorate([k.property()],b.prototype,"view",void 0);a.__decorate([k.property({value:"pan"})],b.prototype,"primaryDragAction",null);a.__decorate([k.property({value:"default"})],
b.prototype,"mode",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"updating",null);a.__decorate([k.property()],b.prototype,"latestPointerType",null);a.__decorate([k.property()],b.prototype,"latestPointerLocation",null);a.__decorate([k.property()],b.prototype,"multiTouchActive",null);a.__decorate([k.property()],b.prototype,"_inputManager",void 0);b=a.__decorate([c.subclass("esri.views.3d.input.SceneInputManager")],b);const E=new Map;a=new Map;k=new Map;a.set("pan",{pan:"primary",rotate:"secondary",
zoom:"tertiary"});a.set("rotate",{pan:"secondary",rotate:"primary",zoom:"tertiary"});k.set("pan",{pan:"primary",rotate:"tertiary",zoom:"secondary"});k.set("rotate",{pan:"tertiary",rotate:"primary",zoom:"secondary"});E.set("default",a);E.set("pro",k);return b})},"esri/views/3d/input/handlers/DoubleClickZoom":function(){define("exports ../../../../core/screenUtils ../../state/controllers/ZoomStepControllerGlobal ../../state/controllers/ZoomStepControllerLocal ../../../input/InputHandler ../../../input/handlers/support".split(" "),
function(a,b,q,l,p,k){class h extends p.InputHandler{constructor(f,c){super(!0);this._view=f;this.registerIncoming("double-click",c,e=>this._handleDoubleClick(e))}_handleDoubleClick(f){const c=f.data;if(k.eventMatchesPointerAction(c,"primary")){const e=this._view.state.isGlobal?new q.ZoomStepControllerGlobal({view:this._view,mode:"animation"}):new l.ZoomStepControllerLocal({view:this._view,mode:"animation"});this._view.state.switchCameraController(e);e.zoomStep(Math.log(.5)/Math.log(.6),b.createScreenPointArray(c.x,
c.y));f.stopPropagation()}}}a.DoubleClickZoom=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/ZoomStepControllerGlobal":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/time ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/sphere ../../camera/constraintUtils ../../camera/constraintUtils/ConstraintOptions ../../camera/constraintUtils/ConstraintTypes ../../camera/constraintUtils/InteractionType ../../camera/constraintUtils/surfaceCollision ./PointToPointAnimationController ../utils/navigationUtils ../../support/geometryUtils/ray ../../support/geometryUtils/sphere ../../webgl/RenderCamera ../../webgl-engine/lib/Intersector ../../../animation/easing".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){a.ZoomStepControllerGlobal=class extends n.PointToPointAnimationController{constructor(){super(...arguments);this._zoomLocation=g.create();this._tmpCamera=new z;this._tmpViewDir=g.create();this._tmpRayDir={origin:g.create(),direction:g.create()};this._targetOnSphere=g.create();this._tmpCenter=g.create();this._beginCamera=new z;this._constraintOptions=new w.ConstraintOptions(v.ConstraintTypes.ALL_EXCEPT_COLLISION,m.InteractionType.ZOOM,null,
this._beginCamera);this._sphere=d.create()}initialize(){this._intersector=A.newIntersector(this.view.state.viewingMode)}zoomStep(F,H){if(this.active){var N=this.view.state;this.animation.finished?this._beginCamera.copyFrom(N.camera):this.animation.cameraAt(1,this._beginCamera);var E=!1,G=!1;this.intersectionHelper.intersectScreen(H,this._zoomLocation,0===this.view.map.ground.opacity?u.contentIntersectorOptions:{})&&(E=0<F,G=!0);this._tmpCamera.copyFrom(N.camera);E?this.intersectionHelper.intersectRay(this._tmpCamera.ray,
this._intersector,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this.intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:e.copy(this._zoomLocation,this._tmpCamera.center);this._updateCamera(this._tmpCamera,F,this._zoomLocation,H,G);this.begin(this._tmpCamera)}}animationSettings(){return{duration:l.Milliseconds(600),easing:B.outExpo}}_updateCamera(F,H,N,E,G){var I=u.navigationMode(F,E,this.view.renderCoordsHelper,
this.view.viewingMode),O=Math.abs(this.view.camera.position.z);e.normalize(D,F.eye);e.scale(D,D,-1);x.fromScreenAtEye(F,E,this._tmpRayDir);e.normalize(this._tmpRayDir.direction,this._tmpRayDir.direction);const L=q.clamp(Math.min(u.zoomDistanceModifier,1/Math.abs(e.dot(D,this._tmpRayDir.direction)))*O,u.zoomMinDistanceModifier,u.zoomMaxDistanceModifier);if(I===u.NavigationMode.Horizontal){H=.6**H;this._sphere[3]=e.length(N);e.subtract(this._tmpViewDir,F.center,F.eye);G=Math.min(e.length(this._tmpViewDir),
L);I=G*H;1>=H&&4>I&&(I=4,H=I/G);if(1E-6>Math.abs(G-I))return;G=e.length(F.center);this._sphere[3]!==G&&(F.center=e.scale(C,F.center,(this._sphere[3]+H*(G-this._sphere[3]))/G));e.scale(this._tmpViewDir,this._tmpViewDir,-H);F.eye=e.add(C,F.center,this._tmpViewDir);t.applyAll(this.view,F,this._constraintOptions);1E-12<e.squaredDistance(N,F.center)&&y.intersectScreen(this._sphere,F,E,this._targetOnSphere)&&u.panToPosition(this._sphere,F,N,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,
!0)}else{I=.6**Math.abs(H);O=0<H?1:-1;e.subtract(this._tmpViewDir,N,F.eye);const P=e.length(this._tmpViewDir);E=this.view._stage.renderView.getMinimalDepthForArea(null,E[0],E[1],this.view.state.camera,60);E=null!=E?E:L;E=G&&0<H?Math.min(E,P):E;e.scale(this._tmpRayDir.direction,this._tmpRayDir.direction,E);e.add(N,this._tmpRayDir.origin,this._tmpRayDir.direction);N=E*I;G=Math.max(4,1.01*F.nearFar[0]);0<H&&N<G&&(N=G,I=N/E);if(1E-6>Math.abs(E-N))return;e.scale(this._tmpRayDir.direction,this._tmpRayDir.direction,
O*(1-I));F.eye=e.add(C,F.eye,this._tmpRayDir.direction);F.center=e.add(C,F.center,this._tmpRayDir.direction)}r.applySurfaceCollisionConstraint(this.view,F)}};a.ZoomStepControllerGlobal=b.__decorate([c.subclass("esri.views.3d.state.controllers.ZoomStepControllerGlobal")],a.ZoomStepControllerGlobal);const C=g.create(),D=g.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils":function(){define("exports ./constraintUtils/altitude ./constraintUtils/common ./constraintUtils/ConstraintOptions ./constraintUtils/ConstraintTypes ./constraintUtils/distance ./constraintUtils/InteractionType ./constraintUtils/surfaceCollision ./constraintUtils/tilt ../../animation/easing".split(" "),
function(a,b,q,l,p,k,h,f,c,e){const g=[{type:p.ConstraintTypes.TILT,error:function(t,w,v){return c.getTiltConstraintError(t,w,v)*w.distance},apply:c.applyTiltConstraint},{type:p.ConstraintTypes.ALTITUDE,error:b.getAltitudeConstraintError,apply:b.applyAltitudeConstraint},{type:p.ConstraintTypes.DISTANCE,error:k.getDistanceConstraintError,apply:k.applyDistanceConstraint}],d=new l.ConstraintOptions;a.applyAll=function(t,w,v=d,m=w){m!==w&&m.copyFrom(w);m.computeUp(t.state.viewingMode);w=!1;for(let n=
0;5>n;n++){let u=0;for(var r of g)if(q.hasConstraintType(v.selection,r.type)){const x=Math.abs(r.error(t,m,v));r.apply(t,m,v)&&(w=!0,u+=x)}if(0===u)break}r=q.hasConstraintType(v.selection,p.ConstraintTypes.COLLISION);a:switch(v.interactionType){case h.InteractionType.PAN:v=f.Mode.EYE_AND_CENTER;break a;case h.InteractionType.ASCEND:v=t.state.isGlobal?f.Mode.EYE_AND_CENTER_SCALE:f.Mode.EYE_AND_CENTER;break a;default:v=f.Mode.EYE}r&&f.applySurfaceCollisionConstraint(t,m,v)&&(w=!0);w&&m.computeUp(t.state.viewingMode);
return w};a.pixelDistanceToInteractionFactor=function(t){return e.inOutCubic(Math.min(1,t/150))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/altitude":function(){define("exports ../../../../core/mathUtils ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/ray ./common ./ConstraintTypes ./InteractionType ../../support/intersectionUtils".split(" "),function(a,b,q,l,p,k,h,f,c){function e(m,
r,n=k.defaultConstraintOptions){var u=m.state.constraints.altitude;u=m.state.isGlobal&&u?n.interactionType===f.InteractionType.TUMBLE&&k.hasConstraintType(n.selection,h.ConstraintTypes.TILT)?!1:!0:!1;if(!u||!m.state.constraints.altitude)return 0;var x=m.state.constraints.altitude;u=g;u.min=x.min;u.max=x.max;x=n.interactionType;if(x!==f.InteractionType.NONE){var {min:y,max:z}=u,{interactionStartCamera:A,interactionFactor:B}=n;if(A){n=x===f.InteractionType.TUMBLE||x===f.InteractionType.ZOOM;x=e(m,A);
var C=0===x?0:m.renderCoordsHelper.getAltitude(A.eye);u.min=y;u.max=z;k.adjustRangeForInteraction(x,C,n,B,.05*C,u)}}m=m.renderCoordsHelper.getAltitude(r.eye);m=b.clamp(m,u.min,u.max)-m;return 1E-6>=Math.abs(m)?0:m}const g={min:0,max:0},d=l.create(),t=l.create(),w=l.create(),v=l.create();a.applyAltitudeConstraint=function(m,r,n=k.defaultConstraintOptions){var u=e(m,r,n);if(0===u)return!1;const x=m.renderCoordsHelper,y=x.getAltitude(r.eye)+u;var z=k.interactionDirectionTowardsConstraintMinimization;
n=n.interactionDirection;u=Math.sign(u);m.renderCoordsHelper.worldUpAtPosition(r.eye,t);q.scale(t,t,u);z=z.call(k,r,n,t,d);m=q.copy(w,r.viewForward);z=x.intersectInfiniteManifold(p.wrap(r.eye,z),y,v);r.eye=null!=z?z:x.setAltitude(v,y,r.eye);r.center=c.closestPointOnRay(v,r.eye,m,r.center);return!0};a.getAltitudeConstraintError=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/common":function(){define(["exports","../../../../chunks/vec32","./ConstraintOptions",
"./ConstraintTypes"],function(a,b,q,l){q=new q.ConstraintOptions(l.ConstraintTypes.NONE);a.adjustRangeForInteraction=function(p,k,h,f,c,e){0!==p&&(h?(e.min=Math.min(e.min,k),e.max=Math.max(e.max,k)):null!=f?(e.min-=Math.max(0,(k-e.min)*(1-f)),e.max+=Math.max(0,(k-e.max)*(1-f))):c&&(e.min-=Math.max(0,k-e.min-c),e.max+=Math.max(0,k-e.max-c)))};a.defaultConstraintOptions=q;a.hasConstraintType=function(p,k){return 0!==(p&k)};a.interactionDirectionTowardsConstraintMinimization=function(p,k,h,f){k=k||p.viewForward;
b.copy(f,k);b.scale(f,f,Math.sign(b.dot(k,h)));return f};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/ConstraintOptions":function(){define(["exports","./ConstraintTypes","./InteractionType","./TiltMode"],function(a,b,q,l){class p{constructor(k=b.ConstraintTypes.ALL,h=q.InteractionType.NONE,f=0,c=null,e=null,g=l.TiltMode.TUMBLE){this.selection=k;this.interactionType=h;this.interactionFactor=f;this.interactionStartCamera=c;this.interactionDirection=
e;this.tiltMode=g}}a.ConstraintOptions=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/ConstraintTypes":function(){define(["exports"],function(a){a.ConstraintTypes=void 0;var b=a.ConstraintTypes||(a.ConstraintTypes={});b[b.NONE=0]="NONE";b[b.TILT=1]="TILT";b[b.ALTITUDE=2]="ALTITUDE";b[b.DISTANCE=4]="DISTANCE";b[b.COLLISION=8]="COLLISION";b[b.ALL=15]="ALL";b[b.ALL_EXCEPT_COLLISION=7]="ALL_EXCEPT_COLLISION";Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/camera/constraintUtils/InteractionType":function(){define(["exports"],function(a){a.InteractionType=void 0;var b=a.InteractionType||(a.InteractionType={});b[b.NONE=0]="NONE";b[b.ZOOM=1]="ZOOM";b[b.TUMBLE=2]="TUMBLE";b[b.LOOK_AROUND=3]="LOOK_AROUND";b[b.PAN=4]="PAN";b[b.ASCEND=5]="ASCEND";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/TiltMode":function(){define(["exports"],function(a){a.TiltMode=void 0;var b=
a.TiltMode||(a.TiltMode={});b[b.TUMBLE=0]="TUMBLE";b[b.LOOK_AROUND=1]="LOOK_AROUND";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/intersectionUtils":function(){define(["exports","../../../core/libs/gl-matrix-2/factories/vec2f64","../../../chunks/vec32","../../../core/libs/gl-matrix-2/factories/vec3f64","../../../geometry/support/plane"],function(a,b,q,l,p){function k(c,e,g,d){const t=f;c?(g&&d&&(t.len=q.distance(e,g)),q.copy(t.dir,c)):d?(t.len=q.distance(e,
g),q.subtract(t.dir,g,e),q.scale(t.dir,t.dir,1/t.len)):(q.subtract(t.dir,g,e),q.normalize(t.dir,t.dir));return t}function h(c,e,g,d){d.clip[0]=0;d.clip[1]=g?d.len:Number.MAX_VALUE;for(g=0;g<c.length;g++){{var t=c[g],w=e;var v=d;const m=q.dot(p.getNormal(t),v.dir);t=-p.signedDistance(t,w);0>t&&0<=m?v=!1:-1E-6<m&&1E-6>m?v=0<t:!(0>t||0>m)||0>t&&0>m?(t/=m,0<m?t<v.clip[1]&&(v.clip[1]=t):t>v.clip[0]&&(v.clip[0]=t),v=v.clip[0]<=v.clip[1]):v=!0}if(!v)return!1}return!0}const f={dir:l.create(),len:0,clip:b.create()};
a.closestPointOnRay=function(c,e,g,d){d=q.dot(g,q.subtract(c,d,e));return q.add(c,e,q.scale(c,g,d))};a.frustumLineSegment=function(c,e,g,d){d=k(d,e,g,!0);return h(c,e,g,d)};a.frustumPoint=function(c,e){for(let g=0;6>g;g++)if(0<p.signedDistance(c[g],e))return!1;return!0};a.frustumRay=function(c,e,g,d){g=k(d,e,g,!1);return h(c,e,null,g)};a.frustumSphere=function(c,e,g){const d=e[0],t=e[1];e=e[2];return c[0][0]*d+c[0][1]*t+c[0][2]*e+c[0][3]>g||c[1][0]*d+c[1][1]*t+c[1][2]*e+c[1][3]>g||c[2][0]*d+c[2][1]*
t+c[2][2]*e+c[2][3]>g||c[3][0]*d+c[3][1]*t+c[3][2]*e+c[3][3]>g||c[4][0]*d+c[4][1]*t+c[4][2]*e+c[4][3]>g||c[5][0]*d+c[5][1]*t+c[5][2]*e+c[5][3]>g?!1:!0};a.planeSphere=function(c,e,g){return c[0]*e[0]+c[1]*e[1]+c[2]*e[2]+c[3]<g};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/distance":function(){define("exports ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/ray ../../../../chunks/sphere ./common ./InteractionType".split(" "),
function(a,b,q,l,p,k,h){function f(m,r,n=k.defaultConstraintOptions){if(!m.state.isLocal)return 0;var u=m.state.constraints.distance;if(!m.pointsOfInterest.surfaceOrigin.renderLocation||Infinity===u)return 0;e.min=0;e.max=u;u=e;var x=n.interactionType;if(x!==h.InteractionType.NONE){var {min:y,max:z}=u,{interactionStartCamera:A,interactionFactor:B}=n;if(A){n=x===h.InteractionType.ZOOM||x===h.InteractionType.PAN;x=f(m,A);var C=0===x?0:c(m,A);u.min=y;u.max=z;k.adjustRangeForInteraction(x,C,n,B,.05*C,
u)}}m=c(m,r);m=e.max-m;return-1E-6<=m?0:m}function c(m,r){m=m.pointsOfInterest.surfaceOrigin;return m.renderLocation?b.distance(r.eye,m.renderLocation):0}const e={min:0,max:0},g=q.create(),d=q.create(),t=q.create(),w=q.create(),v=q.create();a.applyDistanceConstraint=function(m,r,n=k.defaultConstraintOptions){var u=f(m,r,n);if(0===u)return!1;var x=m.pointsOfInterest.surfaceOrigin;if(!x.renderLocation)return!1;u=c(m,r)+u;const y=b.copy(g,r.eye);n=k.interactionDirectionTowardsConstraintMinimization(r,
n.interactionDirection,b.direction(w,r.eye,x.renderLocation),t);if(!p.intersectRay(p.fromCenterAndRadius(x.renderLocation,u),l.wrap(r.eye,n),v))return!1;r.eye=v;x=b.subtract(d,r.eye,y);r.center=b.add(v,r.center,x);x=m.renderCoordsHelper.getAltitude(r.center);m=m.renderCoordsHelper.intersectInfiniteManifold(r.ray,x,v);null!=m&&(r.center=m);return!0};a.getDistanceConstraintError=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/surfaceCollision":function(){define(["exports",
"../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64","../intersectionUtils"],function(a,b,q,l){a.Mode=void 0;(function(h){h[h.EYE=0]="EYE";h[h.EYE_AND_CENTER=1]="EYE_AND_CENTER";h[h.EYE_AND_CENTER_SCALE=2]="EYE_AND_CENTER_SCALE"})(a.Mode||(a.Mode={}));const p=q.create(),k=q.create();a.applySurfaceCollisionConstraint=function(h,f,c=a.Mode.EYE){var e=h.state.constraints;if(!e.collision.enabled)return!1;var g=l.surfaceElevationBelowRenderLocation(h,f.eye);const d=h.renderCoordsHelper.getAltitude(f.eye);
e=g+e.collision.elevationMargin;if(d>=e)return!1;g=b.length(f.eye);b.subtract(p,f.center,f.eye);f.eye=h.renderCoordsHelper.setAltitude(k,e,f.eye);c===a.Mode.EYE_AND_CENTER?f.center=b.add(p,f.eye,p):c===a.Mode.EYE_AND_CENTER_SCALE&&(f.center=b.scale(p,f.center,(g-d+e)/g));return!0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/camera/constraintUtils/tilt":function(){define("exports ../../../../core/compilerUtils ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/ellipsoidUtils ../../../../chunks/sphere ./common ./ConstraintTypes ./InteractionType ./TiltMode ../../state/utils/viewUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(D,F,H,N=!0){C.eyeCenterDistance=0;C.requiresTwoSteps=!1;const E=m(D,F,H,e.defaultConstraintOptions,C);if(0===E)return!1;l.fromRotation(x,-E,F.viewRight);switch(H.tiltMode){case t.TiltMode.LOOK_AROUND:k.transformMat4(u,F.viewForward,x);k.scale(u,u,C.eyeCenterDistance);F.center=k.add(y,F.eye,u);break;case t.TiltMode.TUMBLE:k.subtract(u,F.center,F.eye);k.transformMat4(u,u,x);F.eye=k.subtract(y,F.center,u);break;default:b.neverReached(H.tiltMode)}F.up=
k.transformMat4(y,F.up,x);return C.requiresTwoSteps&&N?v(D,F,H,!1):!0}function m(D,F,H,N=e.defaultConstraintOptions,E){if(!D.state.constraints.tilt)return 0;var G=D.state.constraints.tilt(F.distance,A);if(H.interactionType!==d.InteractionType.NONE){var {interactionStartCamera:I,interactionFactor:O}=H;if(I){var {min:L,max:P}=G,M=m(D,I,e.defaultConstraintOptions,H),K=0===M?0:w.viewAngle(D.renderCoordsHelper,I.center,I.eye);G.min=L;G.max=P;H.interactionType===d.InteractionType.TUMBLE?(e.hasConstraintType(H.selection,
g.ConstraintTypes.ALTITUDE)&&n(D,I,G),e.adjustRangeForInteraction(M,K,!0,O,z,G)):e.adjustRangeForInteraction(M,K,!1,O,z,G)}}N.interactionType===d.InteractionType.TUMBLE&&e.hasConstraintType(N.selection,g.ConstraintTypes.ALTITUDE)&&n(D,N.interactionStartCamera,G);if(H.tiltMode===t.TiltMode.LOOK_AROUND||N.tiltMode===t.TiltMode.LOOK_AROUND){a:{E&&(E.requiresTwoSteps=!1);switch(D.viewingMode){case "global":H=B;M=D.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude;N=M+f.getReferenceEllipsoid(D.spatialReference).radius;
M=D.renderCoordsHelper.intersectManifold(F.ray,M,y);H.eyeCenterDistance=F.distance;H.centerIsOnSurface=!1;null!=M?(H.eyeCenterDistance=k.distance(F.eye,M),H.tiltAtCenter=w.viewAngle(D.renderCoordsHelper,M,F.eye),H.centerIsOnSurface=!0):D.state.isLocal?H.tiltAtCenter=w.viewAngle(D.renderCoordsHelper,F.center,F.eye):(c.closestPointOnSilhouette(c.fromRadius(c.tmpSphere,N),F.ray,y),H.eyeCenterDistance=k.distance(F.eye,y),H.tiltAtCenter=q.acosClamped(-k.dot(F.viewForward,k.normalize(y,y))));H.radius=N;
H.eyeRadius=k.length(F.eye);H.constraints=D.state.constraints;F=q.clamp(H.tiltAtCenter,G.min,G.max);if(1E-9<Math.abs(H.tiltAtCenter-F)){if(H.centerIsOnSurface){{const {constraints:J,eyeCenterDistance:R,tiltAtCenter:Q}=H;F=Q;D=J.clampTilt(R,Q);G=r(H,D);if(J.clampTilt(G,Q)!==D)for(G=0;10>G&&1E-9<Math.abs(D-F);)N=(F+D)/2,M=r(H,N),M=J.clampTilt(M,N),1E-9<Math.abs(M-N)?F=N:D=N,G++;F=D}G=F;D=q.asinClamped(H.radius/H.eyeRadius*Math.sin(H.tiltAtCenter));G=q.asinClamped(H.radius/H.eyeRadius*Math.sin(G));D=
H.eyeRadius>H.radius?D-G:G-D}else F=H.constraints.clampTilt(H.eyeCenterDistance,H.tiltAtCenter),E&&F<Math.PI/2&&(E.requiresTwoSteps=!0,F=Math.PI/2-1E-5),D=H.tiltAtCenter-Math.PI/2-(F-Math.PI/2);E&&(E.eyeCenterDistance=r(H,F));E=D}else E=0;break a;case "local":N=w.viewAngle(D.renderCoordsHelper,F.center,F.eye);H=q.clamp(N,G.min,G.max);G=N-H;1E-9<Math.abs(G)?(E&&(N=D.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,D=D.renderCoordsHelper.getAltitude(F.eye)-N,H=Math.cos(H),E.eyeCenterDistance=
1E-4<Math.abs(H)?D/H:F.distance),E=G):E=0;break a}E=void 0}return E}E=w.viewAngle(D.renderCoordsHelper,F.center,F.eye);H=q.clamp(E,G.min,G.max);E-=H;E=1E-9<Math.abs(E)?E:0;return E}function r(D,F){if(!D.centerIsOnSurface)return D.eyeCenterDistance;F=Math.PI-q.clamp(F,0,Math.PI);const H=q.asinClamped(D.radius/D.eyeRadius*Math.sin(F)),N=Math.sin(Math.PI-F-H)/Math.sin(F);return D.eyeRadius<D.radius&&1<N?Math.sin(Math.PI-F-(Math.PI-H))/Math.sin(F)*D.eyeRadius:N*D.eyeRadius}function n(D,F,H){var N=D.state.constraints;
if(!D.state.isLocal&&N.altitude&&F){var E=k.squaredLength(F.center),G=Math.sqrt(E);F=F.distance;var I=f.getReferenceEllipsoid(D.spatialReference).radius;D=N.altitude.min+I;N=N.altitude.max+I;D=(D*D-F*F-E)/(-2*G*F);H.min=Math.max(H.min,Math.min(Math.PI-q.acosClamped((N*N-F*F-E)/(-2*G*F)),H.max));H.max=Math.min(H.max,Math.PI-q.acosClamped(D))}}const u=h.create(),x=p.create(),y=h.create(),z=q.deg2rad(5),A={min:0,max:0},B={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,eyeCenterDistance:0,
tiltAtCenter:0},C={eyeCenterDistance:0,requiresTwoSteps:!1};a.applyTiltConstraint=v;a.getTiltConstraintError=m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/utils/viewUtils":function(){define(["exports","../../../../core/mathUtils","../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b,q,l){const p=l.create(),k=l.create();a.viewAngle=function(h,f,c){h.worldUpAtPosition(f,p);q.subtract(k,c,f);h=q.length(k);return 0===h?
0:b.acosClamped(q.dot(k,p)/h)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/easing":function(){define(["exports"],function(a){function b(J){const R=2*(J-Math.sqrt((J-1)*J)),Q=R/2/J;return W=>W<Q?J*W*W:R*W-R+1}function q(J,R){return(Q,W)=>Q<R?R*J(Q/R,W):1-J((1-Q)/(1-R),W)*(1-R)}const l=J=>J,p=J=>J*J,k=J=>1-p(1-J),h=J=>.5>J?p(2*J)/2:(1-p(1-2*(J-.5))+1)/2,f=J=>J*J*J,c=J=>1-f(1-J),e=J=>.5>J?f(2*J)/2:(1-f(1-2*(J-.5))+1)/2,g=J=>J*J*J*J,d=J=>1-g(1-J),t=J=>.5>J?g(2*
J)/2:(1-g(1-2*(J-.5))+1)/2,w=J=>J*J*J*J*J,v=J=>1-w(1-J),m=J=>.5>J?w(2*J)/2:(1-w(1-2*(J-.5))+1)/2,r=J=>-Math.cos(J*Math.PI/2)+1,n=J=>1-r(1-J),u=J=>.5>J?r(2*J)/2:(1-r(1-2*(J-.5))+1)/2,x=J=>2**(10*(J-1)),y=J=>1-2**(10*(1-J-1)),z=J=>.5>J?2**(10*(2*J-1))/2:(1-2**(10*(1-2*(J-.5)-1))+1)/2,A=J=>-(Math.sqrt(1-J*J)-1),B=J=>1-A(1-J),C=J=>.5>J?A(2*J)/2:(1-A(1-2*(J-.5))+1)/2,D=q(b(1),1),F=q(b(1),0),H=q(b(1),.5),N=q(b(2),1),E=q(b(2),0),G=q(b(2),.5),I=q(b(3),1),O=q(b(3),0),L=q(b(3),.5),P=q(b(4),1),M=q(b(4),0),K=
q(b(4),.5);a.EasingFunctions={linear:l,"in-quad":p,"out-quad":k,"in-out-quad":h,"in-coast-quad":D,"out-coast-quad":F,"in-out-coast-quad":H,"in-cubic":f,"out-cubic":c,"in-out-cubic":e,"in-coast-cubic":N,"out-coast-cubic":E,"in-out-coast-cubic":G,"in-quart":g,"out-quart":d,"in-out-quart":t,"in-coast-quart":I,"out-coast-quart":O,"in-out-coast-quart":L,"in-quint":w,"out-quint":v,"in-out-quint":m,"in-coast-quint":P,"out-coast-quint":M,"in-out-coast-quint":K,"in-sine":r,"out-sine":n,"in-out-sine":u,"in-expo":x,
"out-expo":y,"in-out-expo":z,"in-circ":A,"out-circ":B,"in-out-circ":C};a.inCirc=A;a.inCoastCubic=N;a.inCoastQuad=D;a.inCoastQuart=I;a.inCoastQuint=P;a.inCubic=f;a.inExpo=x;a.inOutCirc=C;a.inOutCoastCubic=G;a.inOutCoastQuad=H;a.inOutCoastQuart=L;a.inOutCoastQuint=K;a.inOutCubic=e;a.inOutExpo=z;a.inOutQuad=h;a.inOutQuart=t;a.inOutQuint=m;a.inOutSine=u;a.inQuad=p;a.inQuart=g;a.inQuint=w;a.inSine=r;a.linear=l;a.outCirc=B;a.outCoastCubic=E;a.outCoastQuad=F;a.outCoastQuart=O;a.outCoastQuint=M;a.outCubic=
c;a.outExpo=y;a.outQuad=k;a.outQuart=d;a.outQuint=v;a.outSine=n;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/PointToPointAnimationController":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../ViewAnimation ../../animation/pointToPoint/Animation ./AnimationController ../../webgl/RenderCamera ../../webgl-engine/lib/Intersector ../../../animation/easing".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){a.PointToPointAnimationController=class extends g.AnimationController{get intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(r){super(r);this.mode="interaction";this._hasTarget=!1}initialize(){this.animation=new e.Animation(this.view.state.viewingMode);this.viewAnimation="interaction"===this.mode?null:new c}get isInteractive(){return"interaction"===this.mode}begin(r,n){this._hasTarget=!0;n=this.animationSettings(n);v.copyFrom(this.view.state.camera);
const u=t.newIntersector(this.view.state.viewingMode);this.intersectionHelper.intersectRay(v.ray,u,m)&&(v.center=m);this.animation.update(v,r,n);this.animation.finished&&this.finish()}finish(){this.animation.currentTime=this.animation.time;super.finish()}get steppingFinished(){return this._hasTarget&&this.animation.finished}stepController(r,n){this._hasTarget&&this.animation.step(r,n)}onControllerEnd(r){this._hasTarget&&(this.animation.cameraAt(this.animation.currentTime/this.animation.time,r),this.animation.currentTime=
this.animation.time);super.onControllerEnd(r)}animationSettings(r={}){return{apex:{maximumDistance:this.view.state.constraints.clampAltitude(Infinity)/6,ascensionFactor:void 0,descensionFactor:void 0},...r,easing:"string"===typeof r.easing?w.EasingFunctions[r.easing]:r.easing}}};b.__decorate([q.property({constructOnly:!0})],a.PointToPointAnimationController.prototype,"mode",void 0);b.__decorate([q.property({readOnly:!0})],a.PointToPointAnimationController.prototype,"isInteractive",null);a.PointToPointAnimationController=
b.__decorate([h.subclass("esri.views.3d.state.controllers.PointToPointAnimationController")],a.PointToPointAnimationController);const v=new d,m=f.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/animation/pointToPoint/Animation":function(){define("exports ../../../../core/time ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ./Camera ../../webgl/RenderCamera ../../../animation/pointToPoint/Animation".split(" "),function(a,b,q,l,p,
k,h){class f{get finished(){return this.currentTime>=this._animation.time}get time(){return this._animation.time}constructor(e){this.currentTime=b.Milliseconds(0);this._animation=new h.Animation(()=>new p.Camera(e));this._current=new p.Camera(e)}update(e,g,d){const {source:t,target:w}=this._animation.definition,v=q.subtract(c,g.center,e.center),m=q.length(v);1E-5<=m?(v[0]/=m,v[1]/=m,v[2]/=m):(v[0]=0,v[1]=1,v[0]=0);q.copy(t.direction,v);q.copy(w.direction,v);t.copyFromRenderCamera(e);w.copyFromRenderCamera(g);
this._current.copyFrom(t);this._animation.update(t,w,d);this.currentTime=b.Milliseconds(0);e.almostEquals(g)&&(this.currentTime=this._animation.time)}cameraAt(e,g){this._animation.cameraAt(e,this._current);g=g||new k;this._current.copyToRenderCamera(g);return g}step(e,g){this.finished||(this.currentTime=b.Milliseconds(this.currentTime+b.millisecondsFromSeconds(e)),this.currentTime>=this.time&&(this.currentTime=this.time));return this.cameraAt(this.currentTime/this.time,g)}}const c=l.create();a.Animation=
f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/animation/pointToPoint/Camera":function(){define("exports ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../ViewingMode ../../support/mathUtils".split(" "),function(a,b,q,l,p,k,h,f){class c{get pitch(){return this._pitch}get yaw(){return this._yaw}get distance(){return this._distance}get fov(){return this._fov}get size(){return this._size}constructor(x){this.viewingMode=
x;this.center=k.create();this._distance=this._yaw=this._pitch=0;this.direction=k.clone(r);this._fov=55;this._size=1}pixelsPerPanAtZoom(x){return this._size/2/(this._zoomToPanScale*x)}zoomAtPixelsPerPan(x){return this._size/2/(this._zoomToPanScale*x)}pixelsPerRotateAtZoom(){return this._size/2/Math.max(Math.cos(Math.abs(this._pitch)),.5)}compareTo(x,y){if(this.viewingMode===h.ViewingMode.Global){var z=p.length(this.center);const A=p.length(x.center);z=(z+A)/2;y.pan=f.angle(this.center,x.center)*z}else y.pan=
p.distance(this.center,x.center);z=Math.abs(x._yaw-this._yaw);z>=Math.PI&&(z=2*Math.PI-z);y.rotate=Math.max(z,Math.abs(x._pitch-this._pitch));y.fov=x.fov-this.fov;y.sourceZoom=this._distance;y.targetZoom=x._distance}interpolate(x,y,z){this.viewingMode===h.ViewingMode.Global?f.slerp(x.center,y.center,z.pan,this.center):p.lerp(this.center,x.center,y.center,z.pan);this._distance=isFinite(y.distance)?b.lerp(x.distance,y.distance+z.zoomOffset,z.zoom):x.distance;this._pitch=b.lerp(x.pitch,y.pitch,z.rotate);
let A=x._yaw;const B=y._yaw;Math.abs(B-A)>=Math.PI&&(A+=2*(A<B?1:-1)*Math.PI);this._yaw=b.lerp(A,B,z.rotate);this._fov=b.lerp(x.fov,y.fov,z.fov)}copyFrom(x){p.copy(this.center,x.center);this._pitch=x.pitch;this._yaw=x.yaw;this._distance=x.distance;p.copy(this.direction,x.direction);this._size=x.size;this._fov=x.fov;this._zoomToPanScale=Math.atan(.5*this._fov);this.viewingMode=x.viewingMode}copyFromRenderCamera(x){var y=this._lookAtOrientation(x.center,u);p.copy(this.center,x.center);p.subtract(t,
x.center,x.eye);p.transformMat3(t,t,y);p.transformMat3(w,x.up,y);this._distance=p.length(t);0!==this._distance&&(t[0]/=this._distance,t[1]/=this._distance,t[2]/=this._distance);this._pitch=this._eyeUpToPitch(t);y=t;const z=v;.5>Math.abs(w[2])?(p.copy(z,w),0<y[2]&&p.scale(z,z,-1)):p.copy(z,y);p.cross(g,z,m);p.normalize(g,g);this._yaw=f.angle(n,g,m);this._size=Math.sqrt(x.width*x.width+x.height*x.height);this._fov=x.fov;this._zoomToPanScale=Math.atan(.5*this._fov)}copyToRenderCamera(x){const y=this._lookAtOrientation(this.center,
u);q.transpose(y,y);this._axisAngleVec3(n,this._pitch-Math.PI/2,r,t);this._axisAngleVec3(m,this._yaw,t,t);this._axisAngleVec3(n,this._pitch-Math.PI/2,m,w);this._axisAngleVec3(m,this._yaw,w,w);p.scale(t,t,this._distance);p.transformMat3(t,t,y);p.transformMat3(w,w,y);x.center=this.center;x.eye=p.subtract(t,this.center,t);x.up=w;x.fov=this._fov}_axisAngleVec3(x,y,z,A){const B=Math.cos(y);y=Math.sin(y);p.scale(e,z,B);p.cross(g,x,z);p.scale(g,g,y);p.scale(d,x,(1-B)*p.dot(x,z));return p.add(A,p.add(A,e,
g),d)}_lookAtOrientation(x,y=l.create()){this._upAtLookAt(x,d);p.cross(e,this.direction,d);p.normalize(e,e);0===e[0]&&0===e[1]&&0===e[2]&&p.copy(e,n);p.cross(g,d,e);p.normalize(g,g);y[0]=e[0];y[1]=g[0];y[2]=d[0];y[3]=e[1];y[4]=g[1];y[5]=d[1];y[6]=e[2];y[7]=g[2];y[8]=d[2];return y}_upAtLookAt(x,y){return this.viewingMode===h.ViewingMode.Local?p.copy(y,m):p.normalize(y,x)}_eyeUpToPitch(x){return Math.PI-f.angle(m,x)}}const e=k.create(),g=k.create(),d=k.create(),t=k.create(),w=k.create(),v=k.create(),
m=k.UNIT_Z,r=k.UNIT_Y,n=k.UNIT_X,u=l.create();a.Camera=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/Animation":function(){define("exports ../../../core/time ../easing ./Definition ./InterpolateComponents ./Settings ./apex/Path".split(" "),function(a,b,q,l,p,k,h){const f=new p.InterpolateComponents;a.Animation=class{get time(){return this._time}get isLinear(){return 1===this.path.segments.length}constructor(c){this._time=b.Milliseconds(0);this._easing=
q.inOutCoastQuad;this.definition=new l.Definition(c);this.path=new h.Path}update(c,e,g){this.definition.update(c,e,g);this.path.update(this.definition,g);this._time=this._applyTimeSettings(b.millisecondsFromSeconds(isFinite(this.path.time)?this.path.time:b.Seconds(0)),g);this._easing=g.easing??(1E3<=this._time?q.inOutCoastQuad:q.outExpo)}cameraAt(c,e){c=Math.min(Math.max(0,c),1);c=this._normalizedEasing(c);c=this.path.interpolateComponentsAt(c,f);e.interpolate(this.definition.source,this.definition.target,
c)}_normalizedEasing(c){const e=this._easing(0,this._time),g=this._easing(1,this._time);return(this._easing(c,this._time)-e)/(g-e)}_applyTimeSettings(c,e){const g=null!=e.speedFactor?e.speedFactor:1,d=e.minDuration??k.defaultSettings.minDuration/g,t=e.maxDuration??k.defaultSettings.maxDuration/g;return c=null!=e.duration?e.duration:b.Milliseconds(Math.min(Math.max(c/g,d),t))}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/Definition":function(){define(["exports",
"../../../core/libs/gl-matrix-2/math/common","./Camera","./Settings"],function(a,b,q,l){class p{constructor(k){this._createCamera=k;this.compared=new q.CompareResult;this.segmentStart=0;this.segmentEnd=1;this.settings={desiredScreenFlow:l.defaultSettings.desiredScreenFlow};this.source=k();this.target=k()}clone(){const k=new p(this._createCamera);k.copyFrom(this);return k}copyFrom(k){this.update(k.source,k.target,k.settings)}update(k,h,f){this.source!==k&&this.source.copyFrom(k);this.target!==h&&this.target.copyFrom(h);
this.source.compareTo(this.target,this.compared);this.settings.desiredScreenFlow=null!=f.desiredScreenFlow?f.desiredScreenFlow:l.defaultSettings.desiredScreenFlow;this.desiredPixelFlow=this.settings.desiredScreenFlow*this.target.size;this.halfWindowSize=this.target.size/2}halfWindowPanAtZoom(k){k=this.target.pixelsPerPanAtZoom(k);return this.halfWindowSize/k}get hasZoom(){return 1E-5<Math.abs(this.compared.sourceZoom-this.compared.targetZoom)}get hasPan(){return this.compared.pan>b.getEpsilon()}get hasFov(){return Math.abs(this.compared.fov)>
b.getEpsilon()}get hasRotate(){return this.compared.rotate>b.getEpsilon()}}a.Definition=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/Camera":function(){define(["exports"],function(a){class b{constructor(){this.targetZoom=this.sourceZoom=this.fov=this.rotate=this.pan=0}}a.CompareResult=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/Settings":function(){define(["exports","../../../core/time"],
function(a,b){const q={desiredScreenFlow:2,minDuration:b.Milliseconds(500),maxDuration:b.Milliseconds(8E3)};b={...q,maxDuration:b.Milliseconds(4E3)};a.defaultSettings=q;a.defaultSettings2D=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/InterpolateComponents":function(){define(["exports"],function(a){class b{constructor(){this.zoomOffset=this.fov=this.zoom=this.rotate=this.pan=0}}a.InterpolateComponents=b;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/animation/pointToPoint/apex/Path":function(){define(["exports","../../easing","../Path","../Segment","./planning"],function(a,b,q,l,p){class k extends q.Path{constructor(h,f){super();this._preallocSegments=[new l.Segment,new l.Segment,new l.Segment];this._descensionSegment=this._ascensionSegment=null;this.update(h,f)}update(h,f){h&&(this.definition?this.definition.copyFrom(h):this.definition=h.clone(),h=f?.apex?p.optimalDistance(h,f.apex):null,this.segments.length=
0,this._descensionSegment=this._ascensionSegment=null,h?this._updateWithApex(h,f?.apex):this._updateWithoutApex())}segmentInterpolateComponentsAt(h,f,c){h.interpolateComponentsAt(f,c);h===this._ascensionSegment?c.zoom=b.outQuad(c.zoom):h===this._descensionSegment&&(c.zoom=b.inQuad(c.zoom))}_updateWithApex(h,f){const [c,e,g]=this._preallocSegments,d=f?.ascensionFactor??.5;f=Math.min(1-d,null!=f?.ascensionFactor&&null!=f.descensionFactor?f.descensionFactor:.5);const t=1-d-f;c.definition?c.definition.copyFrom(this.definition):
c.definition=this.definition.clone();c.definition.compared.targetZoom=h;c.definition.compared.pan=this.definition.compared.pan*d;c.definition.compared.rotate=this.definition.compared.rotate*d;c.definition.segmentEnd=d;c.update();this._ascensionSegment=c;this.segments.push(c);0<t&&(e.definition?e.definition.copyFrom(this.definition):e.definition=this.definition.clone(),e.definition.copyFrom(this.definition),e.definition.compared.sourceZoom=h,e.definition.compared.targetZoom=h,e.definition.compared.pan=
this.definition.compared.pan*t,e.definition.compared.rotate=this.definition.compared.rotate*t,e.definition.segmentStart=c.definition.segmentEnd,e.definition.segmentEnd=c.definition.segmentEnd+t,e.update(),this.segments.push(e));g.definition?g.definition.copyFrom(this.definition):g.definition=this.definition.clone();g.definition.compared.sourceZoom=h;g.definition.compared.pan=this.definition.compared.pan*f;g.definition.compared.rotate=this.definition.compared.rotate*f;g.definition.segmentStart=d+t;
g.update();this._descensionSegment=g;this.segments.push(g)}_updateWithoutApex(){const [h]=this._preallocSegments;h.update(this.definition);this.segments.push(h)}}a.Path=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/Path":function(){define(["exports","../../../core/time"],function(a,b){a.Path=class{constructor(){this.segments=[]}get time(){return this.segments.reduce((q,l)=>b.Seconds(q+l.time),b.Seconds(0))}interpolateComponentsAt(q,l){q=Math.min(Math.max(q,
0),1);q*=this.time;var p=0,k=0;const h=this.definition,f=this.segments.reduce((c,e)=>c||e.definition.hasZoom,!1);for(let c=0;c<this.segments.length;c++){const e=this.segments[c],g=e.definition;if(q<=e.time||c===this.segments.length-1){this.segmentInterpolateComponentsAt(e,0===e.time?0:q/e.time,l);h.hasPan&&!isNaN(l.pan)&&isFinite(h.compared.pan)?l.pan=(p+g.compared.pan*l.pan)/h.compared.pan:l.pan=1;h.hasRotate&&!isNaN(l.rotate)&&isFinite(h.compared.rotate)?l.rotate=(k+g.compared.rotate*l.rotate)/
h.compared.rotate:l.rotate=1;if(f&&!isNaN(l.zoom)&&isFinite(g.compared.targetZoom)){const {sourceZoom:d,targetZoom:t}=g.compared;q=l.zoom*(t-d)+d;p=this.segments[0].definition.compared.sourceZoom;k=Math.abs(t-p)>Math.abs(d-p)?t:d;l.zoomOffset=k-this.segments[this.segments.length-1].definition.compared.targetZoom;l.zoom=(q-p)/(k-p)}else l.zoom=1;return l}q-=e.time;p+=g.compared.pan;k+=g.compared.rotate}}segmentInterpolateComponentsAt(q,l,p){q.interpolateComponentsAt(l,p)}};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/Segment":function(){define(["exports","../../../core/mathUtils","../../../core/time"],function(a,b,q){class l{get time(){return this._time}constructor(k){k&&this.update(k)}update(k){k&&(this.definition?this.definition.copyFrom(k):this.definition=k.clone());this._updatePrecomputedVariables();this._updatePixelFlow()}_updatePrecomputedVariables(){var k=this.definition;const h=k.compared,f=h.sourceZoom,c=h.targetZoom;this._zoomSign=
f>c?1:-1;this._panPixelsAtSource=h.pan*k.source.pixelsPerPanAtZoom(f);k=(k.source.pixelsPerRotateAtZoom(f)+k.target.pixelsPerRotateAtZoom(c))/2;this._rotatePixels=h.rotate*k}_updatePixelFlow(){var k=this.definition.compared.sourceZoom,h=this.definition.compared.targetZoom;const {hasZoom:f,hasPan:c,hasRotate:e}=this.definition;var g=0,d=0;f&&(c&&(g=(h/k-1)/(-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2*this._panPixelsAtSource)),e&&(d=Math.log(k/h)/Math.LN2*this._zoomSign*this.definition.halfWindowSize/
this._rotatePixels));this._rotatePixelFlow=this._panPixelFlow=this._zoomPixelFlow=0;k=this.definition.desiredPixelFlow;f&&c&&e?(h=g+d+g*d,this._zoomPixelFlow=g*d/h*k,this._panPixelFlow=d/h*k,this._rotatePixelFlow=g/h*k):f&&c?(d=1+g,this._zoomPixelFlow=g/d*k,this._panPixelFlow=1/d*k):f&&e?(g=1+d,this._zoomPixelFlow=d/g*k,this._rotatePixelFlow=1/g*k):c&&e?(g=this._panPixelsAtSource/this._rotatePixels,d=1+g,this._panPixelFlow=g/d*k,this._rotatePixelFlow=1/d*k):c?this._panPixelFlow=k:f?this._zoomPixelFlow=
k:e&&(this._rotatePixelFlow=k);this._time=this.rotateTime??this.zoomTime??this.panTime??this.fovTime??q.Seconds(0)}get rotateTime(){return this.definition.hasRotate?q.Seconds(this._rotatePixels/this._rotatePixelFlow):null}get zoomTime(){return this.definition.hasZoom?q.Seconds(Math.log(this.definition.compared.sourceZoom/this.definition.compared.targetZoom)/Math.LN2*this._zoomSign*this.definition.halfWindowSize/this._zoomPixelFlow):null}get fovTime(){return this.definition.hasFov?q.Seconds(Math.abs(this.definition.compared.fov)/
p):null}get panTime(){if(this.definition.hasPan){if(this.definition.hasZoom){const k=-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2;return q.Seconds(Math.log(this._zoomPixelFlow/this._panPixelFlow*this._panPixelsAtSource*k+1)/(k*this._zoomPixelFlow))}return q.Seconds(this._panPixelsAtSource/this._panPixelFlow)}}_interpolateComponentsZoom(k){if(0===k||1===k)return k;if(this.definition.hasZoom){const h=this.definition.compared.sourceZoom,f=this.definition.compared.targetZoom;return(h*(h/
f)**-k-h)/(f-h)}return k}_interpolateComponentsFov(k){if(0===k)return this.definition.segmentStart;if(1===k)return this.definition.segmentEnd;if(this.definition.hasFov){const {segmentStart:h,segmentEnd:f}=this.definition;return h+k*(f-h)}return this.definition.segmentStart}_interpolateComponentsPan(k){if(0===k||1===k)return k;if(this.definition.hasPan&&this.definition.hasZoom){const h=-1/(this._zoomSign*this.definition.halfWindowSize)*this._zoomPixelFlow;return 1/this._panPixelsAtSource*this._panPixelFlow*
(2**(h*k*this._time)-1)/(h*Math.LN2)}return k}_interpolateComponentsRotate(k){return k}interpolateComponentsAt(k,h){k=Math.min(Math.max(k,0),1);h.zoom=this._interpolateComponentsZoom(k);h.pan=this._interpolateComponentsPan(k);h.rotate=this._interpolateComponentsRotate(k);h.zoomOffset=0;h.fov=this._interpolateComponentsFov(k)}}const p=b.deg2rad(90);a.Segment=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/apex/planning":function(){define(["exports",
"./functions"],function(a,b){function q(l,p){const k=Math.max(l.compared.sourceZoom,l.compared.targetZoom);l=l.source.zoomAtPixelsPerPan(l.desiredPixelFlow/l.compared.pan)/2;return l<k?null!=p.maximumDistance?k+(p.maximumDistance-k)/2:1.5*k:p.maximumDistance?Math.min(p.maximumDistance,l):l}a.optimalDistance=function(l,p){let k=q(l,p);const h={ascensionFactor:null!=p.ascensionFactor?p.ascensionFactor:.5,descensionFactor:null!=p.descensionFactor?p.descensionFactor:.5};var f=0===h.ascensionFactor,c=
0===h.descensionFactor;const e=f?b.tAscensionZoomOnly:b.tAscensionZoomPan,g=f?b.dtAscensionZoomOnly:b.dtAscensionZoomPan,d=f?b.ddtAscensionZoomOnly:b.ddtAscensionZoomPan,t=c?b.tDescensionZoomOnly:b.tDescensionZoomPan,w=c?b.dtDescensionZoomOnly:b.dtDescensionZoomPan,v=c?b.ddtDescensionZoomOnly:b.ddtDescensionZoomPan;f=A=>e(l,A,h)+b.tPanion(l,A,h)+t(l,A,h);c=A=>g(l,A,h)+b.dtPanion(l,A,h)+w(l,A,h);const m=A=>d(l,A,h)+b.ddtPanion(l,A,h)+v(l,A,h);let r=f(k);const n=b.tBaseLine(l);let u;const x=p.maximumIterations||
20,y=null!=p.maximumDistance?p.maximumDistance:Infinity;for(u=0;u<x;u++){var z=p.desiredSlope??1E-6;let A=c(k);Math.abs(A)>z&&(A+=z);z=A/m(k);if(isNaN(z)||k>=y&&0>z){if(!isFinite(y))return null;k=y;r=f(k);break}k-=z;if(k<l.compared.sourceZoom||k<l.compared.targetZoom)return null;z=f(k);if(.005>=Math.abs(z-r)/r)break;r=z}return r>.7*n||k<l.compared.sourceZoom||k<l.compared.targetZoom?null:k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/animation/pointToPoint/apex/functions":function(){define(["exports"],
function(a){a.ddtAscensionZoomOnly=function(b,q){return-b.halfWindowSize/(q*q*b.desiredPixelFlow*Math.LN2)};a.ddtAscensionZoomPan=function(b,q,l){const p=q-b.compared.sourceZoom,k=1/p,h=1/q,f=Math.log(b.compared.sourceZoom*h);l=(l.ascensionFactor*Math.LN2*b.compared.pan+b.halfWindowPanAtZoom(p))/b.halfWindowPanAtZoom(1);return b.halfWindowSize*k*(-2*k*h*l+2*k*f+2*h-2*f*l/(p*p)-l/(q*q))/(b.desiredPixelFlow*Math.LN2)};a.ddtDescensionZoomOnly=function(b,q){return-b.halfWindowSize/(q*q*b.desiredPixelFlow*
Math.LN2)};a.ddtDescensionZoomPan=function(b,q,l){const p=q-b.compared.targetZoom,k=1/p,h=1/q,f=Math.log(q/b.compared.targetZoom);l=(b.halfWindowPanAtZoom(q)+l.descensionFactor*Math.LN2*b.compared.pan-b.halfWindowPanAtZoom(b.compared.targetZoom))/b.halfWindowPanAtZoom(1);return b.halfWindowSize*k*(-2*k*h*l-2*k*f+2*h+2*f*l/(p*p)-l/(q*q))/(b.desiredPixelFlow*Math.LN2)};a.ddtPanion=function(b,q,l){return-2*b.compared.pan*b.halfWindowSize*(l.ascensionFactor+l.descensionFactor-1)/(b.desiredPixelFlow*b.halfWindowPanAtZoom(q*
q*q))};a.dtAscensionZoomOnly=function(b,q){return b.halfWindowSize/(q*b.desiredPixelFlow*Math.LN2)};a.dtAscensionZoomPan=function(b,q,l){const p=1/q,k=Math.log(b.compared.sourceZoom*p),h=1/b.desiredPixelFlow,f=1/Math.LN2;q-=b.compared.sourceZoom;const c=1/q;l=(l.ascensionFactor*Math.LN2*b.compared.pan+b.halfWindowPanAtZoom(q))/b.halfWindowPanAtZoom(1);return b.halfWindowSize*p*h*f*c*l-b.halfWindowSize*k*h*f*c+b.halfWindowSize*k*h*f*l/(q*q)};a.dtDescensionZoomOnly=function(b,q){return b.halfWindowSize/
(q*b.desiredPixelFlow*Math.LN2)};a.dtDescensionZoomPan=function(b,q,l){const p=Math.log(q/b.compared.targetZoom),k=1/b.desiredPixelFlow,h=1/Math.LN2,f=-q+b.compared.targetZoom,c=1/f;l=(-b.halfWindowPanAtZoom(q)-l.descensionFactor*Math.LN2*b.compared.pan+b.halfWindowPanAtZoom(b.compared.targetZoom))/b.halfWindowPanAtZoom(1);return-b.halfWindowSize*p*k*h*c+b.halfWindowSize*p*k*h*l/(f*f)+b.halfWindowSize*k*h*c*l/q};a.dtPanion=function(b,q,l){return b.compared.pan*b.halfWindowSize*(l.ascensionFactor+
l.descensionFactor-1)/(b.desiredPixelFlow*b.halfWindowPanAtZoom(q*q))};a.tAscensionZoomOnly=function(b,q){return-b.halfWindowSize*Math.log(b.compared.sourceZoom/q)/(b.desiredPixelFlow*Math.LN2)};a.tAscensionZoomPan=function(b,q,l){const p=b.halfWindowPanAtZoom(q-b.compared.sourceZoom);return-b.halfWindowSize*(l.ascensionFactor*Math.LN2*b.compared.pan+p)*Math.log(b.compared.sourceZoom/q)/(b.desiredPixelFlow*Math.LN2*p)};a.tBaseLine=function(b){var q=b.compared.sourceZoom-b.compared.targetZoom;if(0===
q)return b.compared.pan*b.halfWindowSize/(b.desiredPixelFlow*b.halfWindowPanAtZoom(b.compared.sourceZoom));const l=Math.LN2*b.compared.pan;q=b.halfWindowPanAtZoom(q);const p=b.halfWindowSize*Math.log(b.compared.sourceZoom/b.compared.targetZoom)/(b.desiredPixelFlow*Math.LN2*q);return b.compared.sourceZoom<=b.compared.targetZoom?p*(l-q):p*(l+q)};a.tDescensionZoomOnly=function(b,q){return b.halfWindowSize*Math.log(q/b.compared.targetZoom)/(b.desiredPixelFlow*Math.LN2)};a.tDescensionZoomPan=function(b,
q,l){return b.halfWindowSize*(-b.halfWindowPanAtZoom(q)-l.descensionFactor*Math.LN2*b.compared.pan+b.halfWindowPanAtZoom(b.compared.targetZoom))*Math.log(q/b.compared.targetZoom)/(b.desiredPixelFlow*Math.LN2*b.halfWindowPanAtZoom(-q+b.compared.targetZoom))};a.tPanion=function(b,q,l){return-b.compared.pan*b.halfWindowSize*(l.ascensionFactor+l.descensionFactor-1)/(b.desiredPixelFlow*b.halfWindowPanAtZoom(q))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/AnimationController":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../../ViewAnimation ./CameraController".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){a.AnimationController=class extends g.CameraController{constructor(){super(...arguments);this._asyncResult=null}get canStop(){return!0}set asyncResult(d){this._asyncResult&&(this._asyncResult.reject(l.createAbortError()),this._asyncResult=null);this.state===g.State.Finished||this.state===g.State.Stopped?(q.assertIsSome(d),this.state===g.State.Finished?d.resolve():d.reject(l.createAbortError())):this._asyncResult=d}get asyncResult(){return this._asyncResult}onControllerStart(){this.state=
g.State.Running;null!=this.viewAnimation&&this.viewAnimation.when(()=>this.updateStateFromViewAnimation(),()=>this.updateStateFromViewAnimation())}updateStateFromViewAnimation(){null==this.viewAnimation||this.state!==g.State.Ready&&this.state!==g.State.Running||(this.viewAnimation.state===e.State.FINISHED?this.finish():this.viewAnimation.state===e.State.STOPPED&&(this.state=g.State.Stopped))}onControllerEnd(){null==this.viewAnimation||this.viewAnimation.done||(this.state===g.State.Finished?this.viewAnimation.finish():
this.state===g.State.Stopped&&this.viewAnimation.stop());this._asyncResult&&(this.state===g.State.Finished?this._asyncResult.resolve():this._asyncResult.reject(l.createAbortError()))}finish(){this.finishController()}};a.AnimationController=b.__decorate([c.subclass("esri.views.3d.state.controllers.AnimationController")],a.AnimationController);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/CameraController":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){a.State=void 0;(function(c){c[c.Ready=0]="Ready";c[c.Rejected=1]="Rejected";c[c.Running=2]="Running";c[c.Stopped=3]="Stopped";c[c.Finished=4]="Finished"})(a.State||(a.State={}));a.CameraController=class extends q{constructor(c){super(c);this.state=a.State.Ready}get active(){return this.state===a.State.Running}get isInteractive(){return!1}get canStop(){return!1}stopController(){return this.canStop?(this.state=a.State.Stopped,!0):!1}finishController(){this.state=a.State.Finished}get steppingFinished(){return!1}};
b.__decorate([l.property({constructOnly:!0})],a.CameraController.prototype,"view",void 0);b.__decorate([l.property({readOnly:!0})],a.CameraController.prototype,"active",null);b.__decorate([l.property()],a.CameraController.prototype,"state",void 0);b.__decorate([l.property({readOnly:!0})],a.CameraController.prototype,"isInteractive",null);a.CameraController=b.__decorate([f.subclass("esri.views.3d.state.controllers.CameraController")],a.CameraController);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/state/utils/navigationUtils":function(){define("exports ../../../../core/Cyclical ../../../../core/mathUtils ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/axisAngle ../../../../geometry/support/coordinateSystem ../../../../geometry/support/plane ../../../../chunks/sphere ../../../../geometry/support/vectorStacks ../../support/geometryUtils/ray ../../support/geometryUtils/sphere ../../webgl/RenderCamera ../../webgl-engine/lib/verticalOffsetUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){function x(ya,Da,ra){ra=p.fromRotation(v.sm4d.get(),ra[3],g.axis(ra));null==ra||p.exactEquals(ra,k.IDENTITY)||(c.subtract(fa,ya.eye,Da),c.transformMat4(fa,fa,ra),ya.eye=c.add(fa,fa,Da),c.subtract(fa,ya.center,Da),c.transformMat4(fa,fa,ra),ya.center=c.add(fa,fa,Da),ya.up=c.transformMat4(fa,ya.up,ra))}function y(ya,Da,ra,xa){return Math.sin(ya/c.length(Da))*(ra+xa.radius)}function z(ya,Da,ra,xa){ra=m.fromScreenAtEye(Da,ra,va);if(null==ra)return!1;w.closestPointOnSilhouette(ya,
ra,K);return w.intersectRay(ya,ra,xa)?c.squaredDistance(K,ra.origin)<c.squaredDistance(xa,ra.origin)?(c.copy(xa,K),!1):!0:(c.subtract(J,Da.eye,Da.center),c.normalize(J,J),t.fromNormalAndOffset(J,-c.dot(c.normalize(J,J),K),R),t.intersectRay(R,ra,xa),!1)}function A(ya,Da,ra,xa,Ma,Ga){var Pa=0;c.cross(la,ya,Da);c.subtract(X,ya,Da);c.length(ya)<=Ma||!xa.aboveGround?(c.cross(ra,X,xa.eye),Pa=c.dot(ya,Da)/(c.length(ya)*c.length(Da)),.9999>Pa?Pa=q.acosClamped(Pa):(ya=c.length(c.cross(e.create(),ya,Da))/(c.length(ya)*
c.length(Da)),Pa=q.asinClamped(ya)),Ga=Math.cos(q.clamp(b.cyclicalPI.normalize(q.deg2rad(Ga)),0,P)),Pa=-Pa-Math.max(0,c.length(Da)-Ma)/(Ga*Ma)):(c.subtract(Q,xa.eye,xa.center),c.cross(ra,X,Q),Pa=-c.length(X)/Ma);c.normalize(ra,ra);c.scale(ra,ra,c.length(la));return Pa}function B(ya,Da,ra,xa){xa=Math.cos(q.clamp(b.cyclicalPI.normalize(q.deg2rad(xa)),0,P));Da=Da>ra?-(Da-ra)/(xa*ra):Da<-ra?Math.PI-(Da+ra)/(xa*ra):q.acosClamped(Da/ra);return((ya>ra?-(ya-ra)/(xa*ra):ya<-ra?Math.PI-(ya+ra)/(xa*ra):q.acosClamped(ya/
ra))-Da)*ra}function C(ya,Da,ra,xa,Ma,Ga,Pa,Qa,Ea,ua){Qa=B(ya[2],Da[2],Ga[3],Qa);Da=Ea?B(ya[0],Da[0],Ga[3],180):Da[0]-ya[0];ya=Math.sin(Pa)*Da-Math.cos(Pa)*Qa;Pa=Math.cos(Pa)*Da+Math.sin(Pa)*Qa;c.normalize(fa,Ma);Ma=Ea?ya/Math.sqrt(Math.abs(Ga[3]**2-c.dot(ra,fa)**2)):ya/Ga[3];ra=Pa/Math.sqrt(Math.abs(Ga[3]**2-c.dot(ra,xa)**2));h.set(ua,Ma,ra)}function D(ya,Da,ra,xa,Ma,Ga,Pa,Qa,Ea,ua){c.cross(la,ya,Da);d.coordinateSystemFromOneAxisAndNormalVector(Ga.up,Ga.eye,T,Y,ha);d.coordinateSystemFromOneAxisAndNormalVector([0,
0,1],Ga.eye,W,S,V);c.copy(ra,S);c.copy(xa,W);c.normalize(ra,ra);c.scale(ra,ra,c.length(la));d.vectorCoordinates(ya,c.normalize(Y,Y),c.normalize(ha,ha),c.normalize(T,T),ba);d.vectorCoordinates(Da,Y,ha,T,U);C(ba,U,ya,W,S,Pa,Qa,Ea,ua,Ma)}function F(ya,Da,ra,xa,Ma,Ga,Pa){p.fromRotation(ea,Ma,xa);p.fromRotation(da,Pa,Ga);p.multiply(ia,ea,da);c.subtract(Da,ya,ra);c.transformMat4(Da,Da,ia);c.add(Da,Da,ra)}function H(ya,Da,ra,xa,Ma,Ga){p.fromRotation(ea,xa,ra);p.fromRotation(da,Ga,Ma);p.multiply(ia,ea,da);
c.subtract(fa,ya.eye,Da);c.transformMat4(fa,fa,ia);ya.eye=c.add(fa,fa,Da);c.subtract(fa,ya.center,Da);c.transformMat4(fa,fa,ia);ya.center=c.add(fa,fa,Da);c.subtract(fa,ya.up,Da);c.transformMat4(fa,fa,ia);ya.up=c.add(fa,fa,Da)}function N(ya,Da,ra,xa,Ma,Ga){return(Math.abs(xa)>Math.PI-L.Angle||Math.abs(xa)<L.Angle)&&(Math.abs(ya[2])<ra*L.Pole||Math.abs(Da)>ra)&&Ga.aboveGround&&Ma<L.Tilt}function E(ya,Da,ra,xa,Ma,Ga){Ga?(g.fromPoints(ra,xa,ca),x(Da,w.getCenter(ya),ca)):(ra=A(ra,xa,na,Da,ya[3],Ma),x(Da,
w.getCenter(ya),g.wrapAxisAngle(na,ra)))}function G(ya,Da,ra,xa,Ma,Ga,Pa){const Qa=Pa?20:1;c.copy(ka,xa);ja.copyFrom(Da);let Ea;for(let ua=0;ua<Qa&&1E-12<c.squaredDistance(ra,ka);ua++)if(xa=c.squaredDistance(ra,ka),D(ra,ka,S,W,Z,ja,ya,Ma,Ga,Pa),H(ja,w.getCenter(ya),W,Z[1],S,Z[0]),F(ka,ka,w.getCenter(ya),W,Z[1],S,Z[0]),Ea=c.squaredDistance(ra,ka),Ea<xa||0===ua)Da.copyFrom(ja);else break}a.SpherePickPointFallback=void 0;(function(ya){ya[ya.Ellipsoid=0]="Ellipsoid";ya[ya.Silhouette=1]="Silhouette"})(a.SpherePickPointFallback||
(a.SpherePickPointFallback={}));u={exclude:new Set([u.terrainId])};const I=l.createScreenPointArray();a.NavigationMode=void 0;(function(ya){ya[ya.Vertical=0]="Vertical";ya[ya.Horizontal=1]="Horizontal"})(a.NavigationMode||(a.NavigationMode={}));const O={Elevation:3E4,Angle:q.deg2rad(16)},L={Pole:.95,Angle:q.deg2rad(18),Tilt:45},P=q.deg2rad(80),M=e.create(),K=e.create(),J=e.create(),R=t.create(),Q=e.create(),W=e.create(),S=e.create(),V=e.create(),T=e.create(),Y=e.create(),ha=e.create(),ba=e.create(),
U=e.create(),Z=f.create(),ca=g.create(),ea=k.create(),da=k.create(),ia=k.create(),ka=e.create(),fa=e.create(),X=e.create(),ja=new n,la=e.create(),na=e.create(),va={origin:e.create(),direction:e.create()},za={origin:e.create(),direction:e.create()};a.PreservingHeadingThreshold=L;a.TiltThresholdPanningSpeed=P;a.VerticalPanTresholds=O;a.applyPanPlanar=function(ya,Da,ra){c.subtract(M,ra,Da);ya.eye=c.subtract(fa,ya.eye,M);ya.center=c.subtract(fa,ya.center,M)};a.applyPanSphericalDirectRotation=E;a.applyPanSphericalPreserveHeading=
G;a.applyRotation=x;a.applyRotationWithTwoAxes=H;a.applyZoomOnSphere=function(ya,Da,ra){Da.getScreenCenter(I);r.intersectScreen(ya,Da,I,fa)&&(Da.center=fa);ya=Da.distance;ra*=ya;1E-6>Math.abs(ya-ra)||(ra=c.scale(v.sv3d.get(),Da.viewForward,ra),Da.eye=c.subtract(fa,Da.center,ra))};a.applyZoomToPoint=function(ya,Da,ra,xa){const Ma=v.sv3d.get();ra=1-ra;c.subtract(Ma,Da,ya.eye);const Ga=c.length(Ma);let Pa=Ga*(1-ra);0<=ra&&Pa<xa&&(Pa=xa,ra=-(Pa-Ga)/Ga);1E-6>Math.abs(Ga-Pa)||(c.scale(Ma,Ma,ra),ya.eye=
c.add(fa,ya.eye,Ma),ya.center=c.lerp(fa,ya.center,Da,ra))};a.centroid=function(ya,Da){c.set(Da,0,0,0);for(const ra of ya)c.add(Da,Da,ra);c.scale(Da,Da,1/ya.length)};a.contentIntersectorOptions=u;a.distanceClampValues=[1,3E8];a.intersectPlaneFromScreenPoint=function(ya,Da,ra,xa){return t.intersectRay(ya,m.fromScreen(Da,ra,va),xa)};a.intersectPlaneFromScreenPointAtEye=function(ya,Da,ra,xa){return t.intersectRay(ya,m.fromScreenAtEye(Da,ra,va),xa)};a.lengthFromPoints=B;a.minHeightLimit=50;a.navigationMode=
function(ya,Da,ra,xa){const Ma=ya.relativeElevation;if(Ma>O.Elevation&&"global"===xa)return a.NavigationMode.Horizontal;m.fromScreenAtEye(ya,Da,za);Da=Math.sign(Ma);ya=ra.worldUpAtPosition(ya.eye,fa);return-Da*c.dot(ya,za.direction)<Math.sin(O.Angle)*c.length(za.direction)?a.NavigationMode.Vertical:a.NavigationMode.Horizontal};a.normalizeCoordinate=function(ya,Da,ra){ra[0]=Da[0]/(ya.fullWidth/ya.pixelRatio);ra[1]=Da[1]/(ya.fullHeight/ya.pixelRatio);return ra};a.normalizeRotationDelta=function(ya){for(;ya>
Math.PI;)ya-=2*Math.PI;for(;ya<-Math.PI;)ya+=2*Math.PI;return ya};a.offSurfaceTiltToEyeTiltGlobal=function(ya,Da,ra,xa){return y(Math.PI/2,Da,ra,xa)+(ya-Math.PI/2)};a.onSurfaceTiltToEyeTiltGlobal=y;a.panDistanceModifier=5;a.panMotionToRotationMatrix=function(ya,Da,ra,xa,Ma,Ga,Pa,Qa,Ea){if(N(ya.center,c.dot(ya.up,ya.center),c.length(ya.center),-b.cyclicalPI.normalize(q.deg2rad(Ga)),Pa,Da))switch(ya=-b.cyclicalPI.normalize(q.deg2rad(Ma)),{eye:Ma}=Da,d.coordinateSystemFromOneAxisAndNormalVector([0,0,
1],Ma,W,S,V),Ma=ra.translation[0]*xa.pan,Ga="zoom"===Ea.mode?0:ra.translation[1]*xa.pan,Da=Math.max(Math.sqrt(Math.abs(1-c.dot(Da.center,W)**2/c.length(Da.center)**2)),.5),Pa=-Math.cos(ya)*Ga+Math.sin(ya)*Ma,p.rotate(Qa.pan.matrix,Qa.pan.matrix,(Math.sin(ya)*Ga+Math.cos(ya)*Ma)/Da,W),Qa.pan.enabled=!0,Ea.mode){case "pan":p.rotate(Qa.pan.matrix,Qa.pan.matrix,Pa,S);Qa.pan.enabled=!0;break;case "zoom":Qa.zoom=-ra.translation[1]*xa.zoom}else{const {eye:ua,viewRight:Na}=Da;Da=c.cross(v.sv3d.get(),Na,ua);
ya=ra.translation[0]*xa.pan;0!==ya&&(p.rotate(Qa.pan.matrix,Qa.pan.matrix,-ya,Da),Qa.pan.enabled=!0);switch(Ea.mode){case "pan":ra=ra.translation[1]*xa.pan;0!==ra&&(p.rotate(Qa.pan.matrix,Qa.pan.matrix,ra,Na),Qa.pan.enabled=!0);break;case "zoom":Qa.zoom=-ra.translation[1]*xa.zoom}}};a.panToPosition=function(ya,Da,ra,xa,Ma,Ga,Pa){N(ra,c.dot(Da.up,ra),ya[3],-b.cyclicalPI.normalize(q.deg2rad(Ma)),Ga,Da)?G(ya,Da,ra,xa,-b.cyclicalPI.normalize(q.deg2rad(Ma)),Ga,Pa):E(ya,Da,ra,xa,Ga,Pa)};a.pickPointAndInitSphere=
function(ya,Da,ra,xa,Ma,Ga){const Pa=e.create(),Qa=w.create();let Ea=!0,ua=!0;ya.intersectScreen(ra,Pa,Ga)?Qa[3]=c.length(Pa):(ua=!1,Qa[3]=Da.aboveGround&&Ma!==a.SpherePickPointFallback.Ellipsoid?Math.max(c.length(Da.center),.9*xa.radius):c.length(Da.eye)-Da.relativeElevation,Ma===a.SpherePickPointFallback.Silhouette?z(Qa,Da,ra,Pa):Ea=r.intersectScreen(Qa,Da,ra,Pa));return{sphere:Qa,scenePickPoint:Ea?Pa:null,hasGeometryIntersection:ua}};a.pivotDistanceModifier=30;a.preserveHeadingThreshold=N;a.rotatePivotDistanceModifier=
5;a.rotatePivotMinDistanceModifier=10;a.rotatePointAroundTwoAxes=F;a.rotateScreenPixelArea=90;a.rotationAngleAndAxisDirectRotation=A;a.rotationAnglesAndAxesHeadingPreserving=D;a.rotationAnglesHeadingPreserving=C;a.screenPixelArea=80;a.sphereOrPlanePointFromScreenPoint=z;a.zoomDistanceModifier=8;a.zoomMaxDistanceModifier=1508E5;a.zoomMinDistanceModifier=200;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/axisAngle":function(){define("exports ../../core/libs/gl-matrix-2/math/quat ../../core/libs/gl-matrix-2/factories/quatf64 ../../chunks/vec32 ./vector ./vectorStacks".split(" "),
function(a,b,q,l,p,k){function h(t=e){return[t[0],t[1],t[2],t[3]]}function f(t,w,v,m,r=h()){r[0]=t;r[1]=w;r[2]=v;r[3]=m;return r}function c(t,w){t[3]=w;return t}const e=[0,0,1,0],g=q.create(),d=q.create();a.angle=function(t){return t[3]};a.axis=function(t){return t};a.compose=function(t,w,v){b.setAxisAngle(g,t,t[3]);b.setAxisAngle(d,w,w[3]);b.multiply(g,d,g);return c(v,b.getAxisAngle(v,g))};a.copy=function(t,w=h()){return f(t[0],t[1],t[2],t[3],w)};a.create=h;a.fromAxisAndAngle=function(t,w){const v=
h();l.copy(v,t);v[3]=w;return v};a.fromPoints=function(t,w,v){l.cross(v,t,w);l.normalize(v,v);v[3]=p.angle(t,w);return v};a.fromValues=f;a.setAngle=c;a.up=e;a.wrap=function(t,w,v,m){return f(t,w,v,m,k.sv4d.get())};a.wrapAxisAngle=function(t,w){return f(t[0],t[1],t[2],w,k.sv4d.get())};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/geometryUtils/ray":function(){define("exports ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../chunks/vec32 ../../../../geometry/support/ray ../../../../geometry/support/vectorStacks".split(" "),
function(a,b,q,l,p,k){function h(e,g,d){return f(e,e.screenToRender(g,b.castRenderScreenPointArray3(k.sv3d.get())),d)}function f(e,g,d){const t=b.castRenderScreenPointArray3(q.copy(k.sv3d.get(),g));t[2]=0;if(!e.unprojectFromRenderScreen(t,d.origin))return null;g=b.castRenderScreenPointArray3(q.copy(k.sv3d.get(),g));g[2]=1;e=e.unprojectFromRenderScreen(g,k.sv3d.get());if(null==e)return null;l.subtract(d.direction,e,d.origin);return d}function c(e,g,d){l.copy(d.origin,e.eye);g=l.set(k.sv3d.get(),g[0],
g[1],1);e=e.unprojectFromRenderScreen(g,k.sv3d.get());if(null==e)return null;l.subtract(d.direction,e,d.origin);return d}a.fromRender=f;a.fromRenderAtEye=c;a.fromScreen=h;a.fromScreenAtEye=function(e,g,d){return c(e,e.screenToRender(g,b.castRenderScreenPointArray3(k.sv3d.get())),d)};a.fromScreenNormalized=function(e,g,d=p.create()){h(e,b.screenPointObjectToArray(g),d);l.normalize(d.direction,d.direction);return d};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/geometryUtils/sphere":function(){define(["exports",
"../../../../geometry/support/ray","../../../../chunks/sphere","./ray"],function(a,b,q,l){const p=b.create();a.intersectScreen=function(k,h,f,c){h=l.fromScreenAtEye(h,f,p);return q.intersectRay(k,h,c)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/ZoomStepControllerLocal":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/time ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../camera/constraintUtils ../../camera/constraintUtils/ConstraintOptions ../../camera/constraintUtils/ConstraintTypes ../../camera/constraintUtils/InteractionType ../../layers/VoxelWasm ./PointToPointAnimationController ../utils/navigationUtils ../../webgl/RenderCamera ../../webgl-engine/lib/Intersector ../../../animation/easing".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){a.ZoomStepControllerLocal=class extends r.PointToPointAnimationController{constructor(){super(...arguments);this._zoomLocation=g.create();this._tmpCamera=new u;this._tmpRayDir=g.create();this._tmpCenter=g.create();this._beginCamera=new u;this._constraintOptions=new t.ConstraintOptions(w.ConstraintTypes.ALL,v.InteractionType.ZOOM,null,this._beginCamera)}zoomStep(C,D){if(this.active){var F=this.view.state;this.animation.finished?this._beginCamera.copyFrom(F.camera):
this.animation.cameraAt(1,this._beginCamera);this._tmpCamera.copyFrom(F.camera);var H=x.newIntersector(this.view.state.viewingMode);F=!1;0<C?(F=this.intersectionHelper.intersectScreenFreePointFallback(D,this._zoomLocation,0===this.view.map.ground.opacity?n.contentIntersectorOptions:{}),this.intersectionHelper.intersectRay(this._tmpCamera.ray,H,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter)):this.intersectionHelper.intersectRay(this._tmpCamera.ray,H,this._zoomLocation)?this._tmpCamera.center=
this._zoomLocation:e.copy(this._zoomLocation,this._tmpCamera.center);C=.6**C;D=this.view._stage.renderView.getMinimalDepthForArea(m.getVoxelWasm(this.view),D[0],D[1],this.view.state.camera,60);e.subtract(B,this._tmpCamera.eye,this._zoomLocation);e.normalize(B,B);H=q.clamp(Math.min(n.zoomDistanceModifier,1/Math.abs(e.dot(A,B)))*Math.abs(this.view.camera.position.z),n.zoomMinDistanceModifier,n.zoomMaxDistanceModifier);if(D=null!=D?D:H)if(H=g.create(),e.subtract(H,this._zoomLocation,this._tmpCamera.eye),
D<e.length(H)||!F)e.normalize(H,H),e.add(this._zoomLocation,this._tmpCamera.eye,e.scale(H,H,D));this._updateCamera(this._tmpCamera,C,this._zoomLocation);this.begin(this._tmpCamera)}}animationSettings(){return{duration:l.Milliseconds(600),easing:y.outExpo}}_updateCamera(C,D,F){e.subtract(this._tmpRayDir,F,C.eye);const H=e.length(this._tmpRayDir);let N=H*D;const E=Math.max(4,1.01*C.nearFar[0]);0!==N&&(1>=D&&N<E&&(N=E,D=N/H),1E-6>Math.abs(H-N)||(e.scale(this._tmpRayDir,this._tmpRayDir,D),C.eye=e.subtract(z,
F,this._tmpRayDir),C.center=e.lerp(z,C.center,F,1-D),d.applyAll(this.view,C,this._constraintOptions)))}};a.ZoomStepControllerLocal=b.__decorate([c.subclass("esri.views.3d.state.controllers.ZoomStepControllerLocal")],a.ZoomStepControllerLocal);const z=g.create(),A=g.fromValues(0,0,1),B=g.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/VoxelWasm":function(){define(["require","exports"],function(a,b){let q,l=null;const p=new Map;b.addLayerViewToWasm=async function(k){null==
l&&(null==q&&(q=new Promise((c,e)=>a(["../../../layers/VoxelWasmPerSceneView"],g=>c(Object.freeze(Object.defineProperty({__proto__:null,default:g},Symbol.toStringTag,{value:"Module"}))),e))),l=await q);const h=k.view;let f=p.get(h);f||(f=new l.default({view:h}),p.set(h,f));return f.addVoxelLayer(k)};b.getVoxelWasm=function(k){return p.get(k)};b.removeLayerViewFromWasm=function(k){const h=k.view,f=p.get(h);f&&1>f.removeVoxelLayer(k)&&(p.delete(h),0===p.size&&(l=q=null))};Object.defineProperty(b,Symbol.toStringTag,
{value:"Module"})})},"esri/views/input/handlers/support":function(){define(["exports"],function(a){a.eventMatchesMousePointerAction=function(b,q){if("touch"===b.pointerType)return!1;switch(q){case "primary":return 0===b.button;case "secondary":return 2===b.button;case "tertiary":return 1===b.button}};a.eventMatchesPointerAction=function(b,q){switch(q){case "primary":return"touch"===b.pointerType||0===b.button;case "secondary":return"touch"!==b.pointerType&&2===b.button;case "tertiary":return"touch"!==
b.pointerType&&1===b.button}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/DragRotate":function(){define(["exports","../../../../core/screenUtils","../../state/controllers/RotateController","../../../input/InputHandler","../../../input/handlers/support"],function(a,b,q,l,p){class k extends l.InputHandler{constructor(h,f,c,e){super(!0);this._view=h;this.pointerAction=f;this._pivot=c;this.registerIncoming("drag",e,g=>this._handleDrag(g))}_handleDrag(h){const f=
h.data;if(!(1<f.pointers.size)&&p.eventMatchesMousePointerAction(h.data,this.pointerAction)){var c=b.createScreenPointArray(f.center.x,f.center.y);switch(f.action){case "start":this._cameraController&&(this._cameraController.end(),this._cameraController=null);this._cameraController=new q.RotateController({view:this._view,pivot:this._pivot});this._view.state.switchCameraController(this._cameraController);this._cameraController.begin(c);break;case "update":this._cameraController&&this._cameraController.update(c);
break;case "end":this._cameraController&&(this._cameraController.end(),this._cameraController=null)}h.stopPropagation()}}}Object.defineProperty(a,"PivotPoint",{enumerable:!0,get:()=>q.PivotPoint});a.DragRotate=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/RotateController":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/screenUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../camera/constraintUtils ../../camera/constraintUtils/ConstraintOptions ../../camera/constraintUtils/ConstraintTypes ../../camera/constraintUtils/InteractionType ../../camera/constraintUtils/TiltMode ../../layers/VoxelWasm ../Constraints ./InteractiveController ../utils/navigationUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){a.PivotPoint=void 0;(function(F){F[F.CENTER=0]="CENTER";F[F.EYE=1]="EYE"})(a.PivotPoint||(a.PivotPoint={}));a.RotateController=class extends A.InteractiveController{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(F){super(F);this.pivot=a.PivotPoint.CENTER;this._rotScale=0;this._lastPoint=t.create();this._tmpWorldUp=v.create();this._tmpViewDir=v.create();this._tmpRotCurPoint=t.create();this._tmpTransf=g.create();
this._tmpAxis=v.create();this._tmpPivotPoint=v.create();this._pivotPos=v.create();this._constraintOptions=new r.ConstraintOptions(n.ConstraintTypes.ALL,u.InteractionType.TUMBLE,0,this.startCamera)}initialize(){this._rotScale=this.pivot===a.PivotPoint.CENTER?3:1.5}begin(F){if(this.active){switch(this.pivot){case a.PivotPoint.EYE:w.copy(this._pivotPos,this.startCamera.eye);this._constraintOptions.interactionType=u.InteractionType.LOOK_AROUND;this._constraintOptions.tiltMode=x.TiltMode.LOOK_AROUND;this._constraintOptions.selection=
n.ConstraintTypes.NONE;break;case a.PivotPoint.CENTER:const H=this._intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this._pivotPos,0===this.view.map.ground.opacity?B.contentIntersectorOptions:{});H||w.copy(this._pivotPos,this.startCamera.center);this._constrainPivotPoint(F,H);this.startCamera.center=this._pivotPos;this._constraintOptions.interactionType=u.InteractionType.TUMBLE;this._constraintOptions.tiltMode=x.TiltMode.TUMBLE;this._constraintOptions.selection=n.ConstraintTypes.ALL&
~n.ConstraintTypes.DISTANCE}B.normalizeCoordinate(this.startCamera,F,this._lastPoint)}}_constrainPivotPoint(F,H){const N=this.startCamera,E=v.create();w.subtract(E,this._pivotPos,N.eye);const G=w.length(E);var I=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(N.eye,D);I=Math.max(Math.min(B.rotatePivotDistanceModifier,1/Math.abs(w.dot(D,N.viewForward)))*I,B.rotatePivotMinDistanceModifier);H&&(I=Math.min(G,I));var O=l.createScreenPointArray(N.width/N.pixelRatio*
.5,N.height/N.pixelRatio*.5);O=B.navigationMode(this.startCamera,O,this.view.renderCoordsHelper,this.view.viewingMode);let L=this.view._stage.renderView.getMinimalDepthForArea(y.getVoxelWasm(this.view),N.fullWidth/N.pixelRatio*.5,N.fullHeight/N.pixelRatio*.5,N,2.5*B.rotateScreenPixelArea,B.rotateScreenPixelArea);F=this.view._stage.renderView.getMinimalDepthForArea(y.getVoxelWasm(this.view),F[0],F[1],N,B.rotateScreenPixelArea);if(null!=L||null!=F)L=L??F??0,F=null==F||O===B.NavigationMode.Horizontal?
L:F,I=L>F?F:L,I=H?Math.min(I,G):I;w.normalize(E,E);w.copy(this._pivotPos,w.add(this._tmpPivotPoint,N.eye,w.scale(this._tmpPivotPoint,E,I)))}update(F){if(this.active){switch(this.pivot){case a.PivotPoint.EYE:this.currentCamera.center=this._applyRotation(this.currentCamera,F,this.currentCamera.center,this._pivotPos);break;case a.PivotPoint.CENTER:this.currentCamera.center=this._pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,F,this.currentCamera.eye,this._pivotPos)}m.applyAll(this.view,
this.currentCamera,this._constraintOptions);this.commitCamera()}}end(){this.active&&this.finishController()}_applyRotation(F,H,N,E){this.view.renderCoordsHelper.worldUpAtPosition(E,this._tmpWorldUp);B.normalizeCoordinate(F,H,this._tmpRotCurPoint);H=(this._lastPoint[1]-this._tmpRotCurPoint[1])*this._rotScale;let G=(this._tmpRotCurPoint[0]-this._lastPoint[0])*this._rotScale;w.subtract(this._tmpViewDir,N,E);N=w.length(this._tmpViewDir);N=q.acosClamped(w.dot(this._tmpViewDir,this._tmpWorldUp)/N);if(this.pivot===
a.PivotPoint.EYE){const I=.5*Math.PI-N,O=.495*Math.PI;H=I-Math.max(-O,Math.min(O,I+-.5*H))}H=q.clamp(H+N,z.TiltRange.min,z.TiltRange.max)-N;w.cross(this._tmpAxis,F.up,this._tmpViewDir);this.pivot===a.PivotPoint.CENTER&&(G=-G);e.fromRotation(this._tmpTransf,G,this._tmpWorldUp);e.rotate(this._tmpTransf,this._tmpTransf,H,this._tmpAxis);w.transformMat4(this._tmpViewDir,this._tmpViewDir,this._tmpTransf);F.up=w.transformMat4(C,F.up,this._tmpTransf);w.add(C,E,this._tmpViewDir);d.copy(this._lastPoint,this._tmpRotCurPoint);
return C}};b.__decorate([p.property()],a.RotateController.prototype,"pivot",void 0);a.RotateController=b.__decorate([c.subclass("esri.views.3d.state.controllers.RotateController")],a.RotateController);const C=v.create(),D=v.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/InteractiveController":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../ViewStateManager ./CameraController ../../webgl/RenderCamera".split(" "),
function(a,b,q,l,p,k,h,f,c,e){a.InteractiveController=class extends c.CameraController{constructor(){super(...arguments);this.startCamera=new e;this.currentCamera=new e;this._lastInteraction=0}get isInteractive(){return performance.now()-this._lastInteraction<f.interactingTimeout}stepController(g,d){d.copyViewFrom(this.currentCamera);this.currentCamera.copyFrom(d)}onControllerStart(g){this.state=c.State.Running;this.startCamera.copyFrom(g);this.currentCamera.copyFrom(g)}onControllerEnd(g){g.copyViewFrom(this.currentCamera)}commitCamera(){this._lastInteraction=
performance.now();setTimeout(()=>this.notifyChange("isInteractive"),f.interactingTimeout);this.view.state.updateCamera(g=>this.stepController(0,g));this.steppingFinished&&this.finishController()}};b.__decorate([q.property({readOnly:!0})],a.InteractiveController.prototype,"isInteractive",null);b.__decorate([q.property()],a.InteractiveController.prototype,"_lastInteraction",void 0);a.InteractiveController=b.__decorate([h.subclass("esri.views.3d.state.controllers.InteractiveController")],a.InteractiveController);
Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/ViewStateManager":function(){define("exports ../../../chunks/tslib.es6 ../../../Camera ../../../Viewpoint ../../../core/Accessor ../../../core/Logger ../../../core/maybe ../../../core/reactiveUtils ../../../core/scheduling ../../../core/screenUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../chunks/vec42 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../geometry/Extent ../../../geometry/Point ../../../geometry/projection ../../ViewingMode ../camera/constraintUtils ../camera/intersectionUtils ./ConstraintsManager ./Frustum ./GoToOperation ./controllers/SurfaceCollisionCorrectionController ../support/cameraUtils ../support/PropertiesPool ../support/viewpointUtils ../webgl/RenderCamera ../webgl-engine/lib/rendererUtils ../webgl-engine/lib/RenderFeature ../../support/RenderState ../../webgl/FramebufferObject".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M){a.ViewStateManager=class extends p{constructor(T){super(T);this.ready=!1;this._windowDevicePixelRatio=1;this._devicePixelRatioOverride=null;this._idleTimeout=300;this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:Y=>this._devicePixelRatioOverride=Y,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},get updatingIgnoreRenderState(){return null!=
this.renderState},get idleTimeoutEnabled(){return 0<this.viewStateManager._idleTimeout},set idleTimeoutEnabled(Y){this.viewStateManager._idleTimeout=Y?300:0}};this._propertiesPool=new E.PropertiesPool({frustum:D.Frustum},this);this._cameraSetByUser=!1;this._gotoOperation=null;this._cameraChangeTime=0;this._tmpCanvasSize=new K}initialize(){this._cameraChangeTime=performance.now();this.addHandles([f.on(()=>this.view.state.events,"before-camera-change",T=>T&&this._updateElevation(T)),f.watch(()=>this.view.state?.camera,
(T,Y)=>this._cameraChangedHandler(T,Y),f.sync)]);f.when(()=>this.view.state?.camera,T=>this._updateElevation(T),{once:!0,sync:!0});this.addHandles([c.addFrameTask({prepare:()=>this._prepareFrame()}),f.watch(()=>this.view.state.cameraController,()=>{this._cameraSetByUser=!0;this.removeHandles("pending-initial-view")}),f.on(()=>this.view.state.events,"camera-projection-changed",()=>this.notifyChange("scale"))])}destroy(){this.exit();this._propertiesPool=h.destroyMaybe(this._propertiesPool)}get camera(){const T=
this._get("camera");if(!this.ready)return T;const Y=N.internalToExternal(this.view,this.view.state.camera,W);return Y&&T&&Y.equals(T)?T:Y.clone()}set camera(T){this._updatePropertyBeforeReady("camera",T)||(this.view.elevationProvider?.enableCache(!0),this.setStateCamera(N.externalToInternal(this.view,T),{applyConstraints:!1})||k.getLogger(this).error("#camera\x3d","Invalid camera",T),this.view.elevationProvider?.enableCache(!1))}get contentCamera(){const T=this._get("contentCamera");if(!this.ready)return T;
const Y=N.internalToExternal(this.view,this.view.state.contentCamera,W);return Y&&T&&Y.equals(T)?T:Y.clone()}set contentCamera(T){this._updatePropertyBeforeReady("contentCamera",T)||(T=N.externalToInternal(this.view,T),null==T?this.view.state.contentCamera=null:(this._updateElevation(T),this.view.state.contentCamera=T))}installContentCameraReset(T){this.removeHandles("content-camera-reset");this.test.contentCameraResetState.clear();if(!this.view.state.fixedContentCamera)return!1;const Y=this.zoom,
ha=this.view.state.camera.distance**2,ba=m.fromArray(this.view.state.camera.center),U=T.sticky?this.contentCamera.clone():null;this.addHandles([f.watch(()=>this.contentCamera,()=>{T.sticky||(this.removeHandles("content-camera-reset"),this.test.contentCameraResetState.clear())}),f.watch(()=>this.zoom,Z=>{void 0!==Z&&void 0!==Y&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(Z-Y)/2),2<Math.abs(Z-Y)?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=U))}),f.watch(()=>
this.view.state.camera,Z=>{Z=v.squaredDistance(ba,Z.center);this.test.contentCameraResetState.set("camera.center",Z/ha);Z>ha?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=U)})],"content-camera-reset");return!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(T){this._updatePropertyBeforeReady("center",T)||(T?this.isCompatible(T)?this.setStateCamera(this._centerToCamera(T),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():
k.getLogger(this).error("#center\x3d","Invalid center",T):k.getLogger(this).error("#center\x3d","Center has an incompatible spatial reference (center: "+(T.spatialReference?T.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",T):k.getLogger(this).error("#center\x3d","Center may not be null or undefined"))}get extent(){if(!this.ready)return this._get("extent");var T=this.view;T=N.toExtent(T,T.state.camera,T.pointsOfInterest.centerOnContent.renderLocation);return null!=T?
T:this._get("extent")}set extent(T){this._updatePropertyBeforeReady("extent",T)||(T?this.isCompatible(T)?this.setStateCamera(this._extentToCamera(T),{applyConstraints:!0})||k.getLogger(this).error("#extent\x3d","Invalid extent",T):k.getLogger(this).error("#extent\x3d","Extent has an incompatible spatial reference (extent: "+(T.spatialReference?T.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",T):k.getLogger(this).error("#extent\x3d","Extent may not be null or undefined"))}get frustum(){const T=
this._propertiesPool.get("frustum");T.renderCoordsHelper=this.view.renderCoordsHelper;T.update(this.view.state.camera);return T}get constraintsManager(){return this._constraintsManager}get _initialViewpoint(){const T=this.view.map;return T&&"initialViewProperties"in T?T.initialViewProperties?.viewpoint:void 0}get hasInitialView(){return!!this._initialViewpoint}get scale(){if(this.ready){const T=this.view.pointsOfInterest.centerOnContent;return N.distanceToScale(this.view,T.distance,T.location.latitude)}return this._get("scale")}set scale(T){this._updatePropertyBeforeReady("scale",
T)||this.setStateCamera(this._scaleToCamera(T),{applyConstraints:!0})||k.getLogger(this).error("#scale\x3d","Invalid scale",T)}get terrainScale(){if(!this.ready)return this._get("scale");var T=this.view;const Y=T.basemapTerrain.tilingScheme;var ha=T.pointsOfInterest.cameraOnSurface.scale;if(!Y||!ha)return this._get("scale");const ba=T.state.contentCamera;T=N.directionToHeadingTilt(T,ba.eye,ba.viewForward,ba.up).tilt;90<T&&(T=180-T);T=2*(T/90)**2;ha=Y.levelAtScale(ha)-T;return 0>ha?this._get("scale"):
Y.scaleAtLevel(ha)}get padding(){if(!this.ready)return this._get("padding");var T=this.view.state.camera,Y=T.padding;const ha=T.pixelRatio;T=this._get("padding");const ba=Math.round(Y[O.PaddingSide.TOP]/ha),U=Math.round(Y[O.PaddingSide.RIGHT]/ha),Z=Math.round(Y[O.PaddingSide.BOTTOM]/ha);Y=Math.round(Y[O.PaddingSide.LEFT]/ha);return null!=T&&T.top===ba&&T.right===U&&T.bottom===Z&&T.left===Y?T:{top:ba,right:U,bottom:Z,left:Y}}set padding(T){this._updatePropertyBeforeReady("padding",T)||(this._paddingToArray(T,
this.view.state.camera.pixelRatio,V),this.view.state.updateCamera(Y=>Y.padding=V))}_paddingToArray(T,Y,ha){T?r.set(ha,T.top||0,T.right||0,T.bottom||0,T.left||0):r.set(ha,0,0,0,0);for(T=0;4>T;T++)ha[T]=Math.round(ha[T]*Y)}get screenCenter(){const T=this.padding;return e.createScreenPoint((this.view.width-(T.left+T.right))/2+T.left,(this.view.height-(T.top+T.bottom))/2+T.top)}get viewpoint(){return this.ready?G.fromCamera(this.view,this.camera):this._get("viewpoint")}set viewpoint(T){if(!this._updatePropertyBeforeReady("viewpoint",
T))if(T)if(this.isCompatible(T))this.setStateCamera(this._viewpointToCamera(T),{applyConstraints:!T.camera})||k.getLogger(this).error("#viewpoint\x3d","Invalid viewpoint",T);else{var Y=null!=T.camera?T.camera.position:T.targetGeometry;Y=null!=Y&&Y.spatialReference;k.getLogger(this).error("#viewpoint\x3d","Viewpoint has an incompatible spatial reference (viewpoint: "+(Y?Y.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",T)}else k.getLogger(this).error("#viewpoint\x3d","Viewpoint may not be null or undefined")}get zoom(){return this.ready?
N.scaleToZoom(this.view,this.scale):this._get("zoom")}set zoom(T){this._updatePropertyBeforeReady("zoom",T)||void 0===T||this.setStateCamera(this._zoomToCamera(T),{applyConstraints:!0})||k.getLogger(this).error("#zoom\x3d","Invalid zoom",T)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*
this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;var T=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio);T=(this._usePhysicalPixelRendering?this._windowDevicePixelRatio:T)*this.view.resolutionScale;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*T);this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*T);const Y=this.view._stage.renderView.renderingContext?.parameters.maxTextureSize;
Y&&M.ensureAttachmentMaxSize(this._tmpCanvasSize,Y);this._tmpCanvasSize.pixelRatio=0<this._tmpCanvasSize.width?this._tmpCanvasSize.width/this.view.surface.clientWidth*.5+this._tmpCanvasSize.height/this.view.surface.clientHeight*.5:T;this.view.state&&(this.view.state.contentPixelRatio=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio));return this._tmpCanvasSize}get _rasterPixelRatio(){return null!=this._devicePixelRatioOverride?this._devicePixelRatioOverride:this._usePhysicalPixelRenderingAny?
this._windowDevicePixelRatio:Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)}get _usePhysicalPixelRendering(){return this.view?._stage?.renderer.isFeatureEnabled(L.RenderFeature.PhysicalPixelRendering)??!1}get _usePhysicalPixelRenderingAny(){const T=this.view?._stage?.renderer;return T&&(T.isFeatureEnabled(L.RenderFeature.PhysicalPixelRendering,P.RenderState.IDLE)||T.isFeatureEnabled(L.RenderFeature.PhysicalPixelRendering,P.RenderState.INTERACTING)||T.isFeatureEnabled(L.RenderFeature.PhysicalPixelRendering,
P.RenderState.ANIMATING))}preinit(T){return this._isOverridden("center")&&!y.isLoadedOrLoadFor(this.center.spatialReference,T)||this._isOverridden("camera")&&!y.isLoadedOrLoadFor(this.camera.position.spatialReference,T)||this._isOverridden("extent")&&!y.isLoadedOrLoadFor(this.extent.spatialReference,T)||this._isOverridden("viewpoint")&&(!y.isLoadedOrLoadFor(this.viewpoint.targetGeometry?.spatialReference,T)||!y.isLoadedOrLoadFor(this.viewpoint.camera?.position?.spatialReference,T))?!1:!0}init(){this._constraintsManager=
new C.ConstraintsManager({view:this.view});this._prepareFrame();var T=this._getInitialProperties();this._cameraSetByUser=!1;this._set("ready",!0);for(const Y of T)this.set(Y.name,Y.value);this._cameraSetByUser||((T=this._initialViewpoint||this.view.initialExtent)&&this.isCompatible(T)?this._setInitialView(T):this.view.state.viewingMode===z.ViewingMode.Local&&this.addHandles(f.when(()=>this.view.basemapTerrain.ready,()=>{this.removeHandles("pending-initial-view");this._setInitialView(this.view.dataExtent)},
{once:!0,initial:!0}),"pending-initial-view"))}exit(){this._cancelGoToOperation();this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles("pending-initial-view"),this._constraintsManager=h.destroyMaybe(this._constraintsManager))}async goTo(T,Y){Y={animate:!0,...Y};null!=this._gotoOperation&&this._gotoOperation.abort(Y.animate);this._gotoOperation=new F.GoToOperation(T,Y,this.view);this.view.resourceController.scheduler.stopFrame();
return this._gotoOperation.promise}debugSetCameraOnContent(){this.setStateCamera(B.cameraOnContentAlongViewDirection(this.view),{applyConstraints:!1})}step(T){const Y=this.view.state,ha=Y?.cameraController;ha&&(Y.updateCamera(ba=>ha.stepController(T,ba)),ha.steppingFinished&&ha.finishController())}_cancelGoToOperation(){null!=this._gotoOperation&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const T=new Set,Y=[];for(const {propertyName:ha,overrides:ba}of R){const U=
T.has(ha),Z=this._isOverridden(ha);!U&&Z&&Y.push({name:ha,value:this._get(ha)});this._clearOverride(ha);(U||Z)&&ba.forEach(ca=>T.add(ca))}return Y}_setInitialView(T){if(null!=T&&!this._cameraSetByUser)if(T instanceof q)this.setStateCamera(N.externalToInternal(this.view,T),{applyConstraints:!1});else if(T instanceof l)if(T.targetGeometry instanceof u){var Y=N.fromExtentSync(this.view,T.targetGeometry,0,.5,N.OrientationMode.LOCKED);null!=Y&&this.setStateCamera(N.externalToInternal(this.view,Y),{applyConstraints:!0})}else Y=
{applyConstraints:!T.camera},T=this._viewpointToCamera(T),this.setStateCamera(T,Y);else Y=N.fromExtentSync(this.view,T,0,.5,N.OrientationMode.LOCKED),null!=Y&&this.setStateCamera(N.externalToInternal(this.view,Y),{applyConstraints:!0})}_updatePropertyBeforeReady(T,Y){if(this.ready)return!1;this._override(T,Y);Y&&J.has(T)&&this._override("hasInitialView",!0);return!0}isCompatible(T){return null==T?!1:T instanceof l?T.camera?this.isCompatible(T.camera):this.isCompatible(T.targetGeometry):T instanceof
q?this.isCompatible(T.position):T.spatialReference&&!y.requiresLoad(T.spatialReference,this.view.spatialReference)}_getPreservingHeadingTilt(T=Q){this._cameraSetByUser?(T.heading=this.camera.heading,T.tilt=this.camera.tilt):(T.heading=0,T.tilt=.5);return T}_centerPointAtDistanceToCamera(T,Y,ha=S){const {heading:ba,tilt:U}=this._getPreservingHeadingTilt();T=N.getObserverForPointAtDistanceSync(this.view,ba,U,T,Y,N.OrientationMode.ADJUST);if(null==T)return null;ha.copyFrom(this.view.state.camera);ha.eye=
T.eye;ha.center=T.center;ha.up=T.up;return ha}_centerToCamera(T){const Y=this.view.pointsOfInterest.centerOnContent;Y.runTask();return this._centerPointAtDistanceToCamera(T,Y.distance)}_extentToCamera(T){const {heading:Y,tilt:ha}=this._getPreservingHeadingTilt();return(T=N.fromExtentSync(this.view,T,Y,ha,N.OrientationMode.ADJUST,W))?N.externalToInternal(this.view,T):null}_scaleToCamera(T){if(null==T)return null;const Y=this.view.pointsOfInterest.centerOnContent;Y.runTask();const ha=Y.renderLocation;
T=N.scaleToDistance(this.view,T,Y.location.latitude);return this._centerPointAtDistanceToCamera(ha,T)}_zoomToCamera(T){return this._scaleToCamera(N.zoomToScale(this.view,T))}_viewpointToCamera(T){return N.externalToInternal(this.view,G.toCameraSync(this.view,T))}setStateCamera(T,Y){if(null==T||!this.view.state.stopActiveCameraController())return!1;this._cameraSetByUser=!0;Y.doNotCancelGoToOperation||this._cancelGoToOperation();this.view.state.updateCamera(ha=>{Y.positionAndOrientationOnly?(ha.eye=
T.eye,ha.center=T.center,ha.up=T.up,ha.fov=T.fov):ha.copyFrom(T);Y.applyConstraints&&A.applyAll(this.view,ha)});Y.applyConstraints||(this.view.state.cameraController=new H.SurfaceCollisionCorrectionController({view:this.view,desiredCamera:T}));return!0}_prepareFrame(){const {surface:T,canvas:Y}=this.view;if(T&&Y){this._windowDevicePixelRatio=window.devicePixelRatio;var ha=this._computeCanvasSize();if(0!==ha.width&&0!==ha.height){if(Y.width!==ha.width||Y.height!==ha.height)Y.width=ha.width,Y.height=
ha.height;if(this.view.state){const ba=this.view.state.camera;if(ba.fullWidth!==ha.width||ba.fullHeight!==ha.height||ba.pixelRatio!==ha.pixelRatio)S.copyFrom(ba),S.pixelRatio!==ha.pixelRatio&&(this._paddingToArray(this.padding,ha.pixelRatio,V),S.padding=V),S.fullWidth=ha.width,S.fullHeight=ha.height,S.pixelRatio=ha.pixelRatio,this.view.state.camera=S;this._updateViewState()}}}}_updateElevation(T){var Y=this.view.basemapTerrain?.spatialReference;const ha=this.view.renderCoordsHelper?.getAltitude(T.eye)??
0;Y=Y?B.surfaceElevationBelowRenderLocation(this.view,T.eye):0;T.relativeElevation=ha-Y}_updateViewState(){null!=this.test.renderState?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=P.RenderState.ANIMATING:this.view.interacting?this.view.state.mode=P.RenderState.INTERACTING:(this.view.state.mode===P.RenderState.ANIMATING&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTime<this._idleTimeout?this.view.state.mode=P.RenderState.INTERACTING:this.view.state.mode=
P.RenderState.IDLE);this.view.state.rasterPixelRatio=this._rasterPixelRatio}_cameraChangedHandler(T,Y){T&&Y&&T.almostEquals(Y)||(this._cameraChangeTime=performance.now(),this._updateViewState())}};b.__decorate([g.property({type:q,dependsOn:["view.state.camera","ready"]})],a.ViewStateManager.prototype,"camera",null);b.__decorate([g.property({type:q,dependsOn:["view.state.contentCamera","ready"]})],a.ViewStateManager.prototype,"contentCamera",null);b.__decorate([g.property({type:x})],a.ViewStateManager.prototype,
"center",null);b.__decorate([g.property({type:u})],a.ViewStateManager.prototype,"extent",null);b.__decorate([g.property({readOnly:!0})],a.ViewStateManager.prototype,"frustum",null);b.__decorate([g.property()],a.ViewStateManager.prototype,"_constraintsManager",void 0);b.__decorate([g.property({readOnly:!0})],a.ViewStateManager.prototype,"constraintsManager",null);b.__decorate([g.property()],a.ViewStateManager.prototype,"_initialViewpoint",null);b.__decorate([g.property({readOnly:!0})],a.ViewStateManager.prototype,
"hasInitialView",null);b.__decorate([g.property({readOnly:!0,type:Boolean})],a.ViewStateManager.prototype,"ready",void 0);b.__decorate([g.property({type:Number})],a.ViewStateManager.prototype,"scale",null);b.__decorate([g.property({type:Number})],a.ViewStateManager.prototype,"terrainScale",null);b.__decorate([g.property()],a.ViewStateManager.prototype,"padding",null);b.__decorate([g.property({readOnly:!0})],a.ViewStateManager.prototype,"screenCenter",null);b.__decorate([g.property({constructOnly:!0})],
a.ViewStateManager.prototype,"view",void 0);b.__decorate([g.property({type:l})],a.ViewStateManager.prototype,"viewpoint",null);b.__decorate([g.property({type:Number})],a.ViewStateManager.prototype,"zoom",null);b.__decorate([g.property({readOnly:!0})],a.ViewStateManager.prototype,"_rasterPixelRatio",null);b.__decorate([g.property({readOnly:!0})],a.ViewStateManager.prototype,"_usePhysicalPixelRendering",null);b.__decorate([g.property({readOnly:!0})],a.ViewStateManager.prototype,"_usePhysicalPixelRenderingAny",
null);b.__decorate([g.property()],a.ViewStateManager.prototype,"_windowDevicePixelRatio",void 0);b.__decorate([g.property()],a.ViewStateManager.prototype,"_devicePixelRatioOverride",void 0);a.ViewStateManager=b.__decorate([w.subclass("esri.views.3d.state.ViewStateManager")],a.ViewStateManager);class K{constructor(){this.height=this.width=0;this.pixelRatio=1}}const J=new Set("camera viewpoint extent scale center zoom".split(" ")),R=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",
overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],Q={heading:0,tilt:0},W=new q,S=new I,V=n.create();a.interactingTimeout=100;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/ConstraintsManager":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/mathUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../ViewingMode ../camera/constraintUtils ../camera/intersectionUtils ../camera/constraintUtils/ConstraintOptions ../camera/constraintUtils/ConstraintTypes ../camera/constraintUtils/InteractionType ./NearFarHeuristic ./SurfaceCollisionConstraint".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){a.ConstraintsManager=class extends q{constructor(u){super(u);this.nearFarHeuristic=r.createNearFarHeuristic(u.view.state.viewingMode,u.view.basemapTerrain,u.view.renderCoordsHelper.spatialReference)}initialize(){this.addHandles([p.watch(()=>[this.view.constraints?.clipDistance?.near,this.view.constraints?.clipDistance?.far],()=>this._clipDistanceNearFarChanged()),p.watch(()=>this.view.constraints?.clipDistance?.mode,()=>this._updateNearFar()),this.view.state.events.on("before-camera-change",
u=>this._updateCameraNearFar(u)),p.watch(()=>this.view.renderDataExtent,()=>this._updateNearFar(),p.sync),p.watch(()=>[this.view.constraints?.altitude?.min,this.view.constraints?.altitude?.max],()=>this._updateAltitude(),p.sync),p.watch(()=>this.view.constraints?.tilt?.max,()=>this._updateTiltMax(),p.sync),p.watch(()=>this.view.constraints?.tilt?.mode,()=>this._updateTilt(),p.sync),p.watch(()=>this.view.state?.camera,()=>this._updateTiltAutoMax(),p.sync),p.watch(()=>[this.view.map?.ground?.navigationConstraint?.type,
this.view.state?.constraints?.collision?.enabled],()=>this._updateCollision(),p.sync)]);this.view.state.isLocal&&this.addHandles(p.watch(()=>this.view.renderDataExtent,u=>this._updateLocalSurfaceDistance(u),p.initial));this._updateNearFar();this.view.state.viewingMode!==g.ViewingMode.Local&&this._updateAltitude();this._updateTilt();this._updateCollision();this._set("surfaceCollisionConstraint",new n.SurfaceCollisionConstraint({view:this.view}))}destroy(){this.surfaceCollisionConstraint&&(this.surfaceCollisionConstraint.destroy(),
this._set("surfaceCollisionConstraint",null))}_clipDistanceNearFarChanged(){const u=this.view.constraints?.clipDistance;u&&"auto"!==u.mode&&this.view.state.updateCamera(x=>{u&&(x.near=u.near,x.far=u.far)})}_updateNearFar(){this.view.state.updateCamera(u=>this._updateCameraNearFar(u))}_updateCameraNearFar(u){const x=this.view.constraints&&this.view.constraints.clipDistance;"manual"===(x?x.mode:"auto")?x&&(u.near=x.near,u.far=x.far):this._updateCameraNearFarAuto(u,x)}_updateCameraNearFarAuto(u,x){this.nearFarHeuristic.compute(u.eye,
u.center,this.view.renderDataExtent,t.surfaceElevationBelowRenderLocation(this.view,u.eye),u);x&&x.autoUpdate(u.near,u.far)}_updateCollision(){var u=this.view.map?.ground?.navigationConstraint?.type;u=u?"stay-above"===u:!0;const x=this.view.state.constraints.collision;u!==x.enabled&&((x.enabled=u)&&this._reapplyConstraints(v.ConstraintTypes.COLLISION),(u=this.view.constraints&&this.view.constraints.tilt)&&"auto"!==u.mode||this._updateTiltAuto())}_updateAltitude(){const u=this.view.constraints&&this.view.constraints.altitude;
this.view.state.constraints.altitude=u&&this.view.state.viewingMode!==g.ViewingMode.Local?{min:u.min,max:u.max}:null;this._reapplyConstraints()}_updateTiltMax(){const u=this.view.constraints&&this.view.constraints.tilt;u&&"auto"!==u.mode&&(this._updateTiltManual(u),this._reapplyConstraints())}_updateTilt(){const u=this.view.constraints&&this.view.constraints.tilt;"manual"===(u?u.mode:"auto")?this._updateTiltManual(u):this._updateTiltAuto();this._reapplyConstraints()}_updateTiltManual(u){const x=this.view.state.constraints;
x.tilt=x.createConstantMaxTilt(l.deg2rad(u.max))}_updateTiltAuto(){const u=this.view.state.constraints;u.tilt=u.createDefaultTilt();this._updateTiltAutoMax()}_updateTiltAutoMax(){const u=this.view.constraints&&this.view.constraints.tilt;if(u&&"auto"===u.mode){var x=this.view.state.constraints;x.tilt&&(x=x.tilt(this.view.state.camera.distance).max,u.autoUpdate(l.rad2deg(x)))}}_updateLocalSurfaceDistance(u){if(null!=u){var x=Math.max(u.width,u.height);0>=x||(null!=u.zmax&&null!=u.zmin&&(x=Math.max(x,
u.zmax-u.zmin)),u=this.view.state,x=3*x/Math.atan(u.camera.fov/2),x!==u.constraints.distance&&(u.constraints.distance=x))}}_reapplyConstraints(u=v.ConstraintTypes.ALL){this.view.state.updateCamera(x=>d.applyAll(this.view,x,new w.ConstraintOptions(u,m.InteractionType.NONE,null)))}};b.__decorate([k.property({constructOnly:!0})],a.ConstraintsManager.prototype,"view",void 0);b.__decorate([k.property({readOnly:!0})],a.ConstraintsManager.prototype,"surfaceCollisionConstraint",void 0);a.ConstraintsManager=
b.__decorate([e.subclass("esri.views.3d.state.ConstraintsManager")],a.ConstraintsManager);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/NearFarHeuristic":function(){define("exports ../../../core/mathUtils ../../../core/unitUtils ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ../../../geometry/Extent ../../ViewingMode ../environment/atmosphereUtils".split(" "),function(a,b,q,l,p,k,h,f,c){function e(v,m,
r,n){r=2/r;v/m>r?(n.far=v,n.near=n.far/m):(n.near=r,n.far=n.near*m);return n}class g{constructor(v,m){this._elevationProvider=v;this._referenceEllipsoid=k.getReferenceEllipsoid(m);this._unitInMeters=q.getMetersPerUnitForSR(m,this._referenceEllipsoid.metersPerDegree)}compute(v,m,r,n,u){u||={near:0,far:0};var x=v[2]*this._unitInMeters,y=x;n=x-n;var z=this._elevationProvider?.visibleElevationBounds;z&&(x=0<=n?y-this._unitInMeters*z.min:this._unitInMeters*z.max-y);r=null!=r?r:new h({xmin:0,ymin:0,zmin:0,
xmax:0,ymax:0,zmax:0});y=Math.max(r.xmax-r.xmin,r.ymax-r.ymin,4*Math.max(r.xmax-r.xmin,r.ymax-r.ymin));l.subtract(w,m,v);t[0]=0<w[0]?r.xmax:r.xmin;t[1]=0<w[1]?r.ymax:r.ymin;t[2]=0<w[2]?y/2:-y/2;l.subtract(t,t,v);l.normalize(w,w);v=1.1*l.dot(t,w)*this._unitInMeters;m=Math.sqrt(x*(x+2*this._referenceEllipsoid.radius));r=Math.max(r.xmax-r.xmin,r.ymax-r.ymin);z=1E-4*r*this._unitInMeters;x=b.clamp((x-z)/(.001*r*this._unitInMeters-z),0,1);x=Math.min(b.lerp(m,v,x**3),m)*Math.max(Math.log(Math.abs(n)),1);
return e(Math.min(x,Math.max(34064E4,y))/this._unitInMeters,2E4,this._unitInMeters,u)}}class d{constructor(v){this._referenceEllipsoid=k.getReferenceEllipsoid(v)}compute(v,m,r,n,u){u||={near:0,far:0};v=l.length(v);m=v-this._referenceEllipsoid.radius;m=Math.max(Math.abs(m-n),Math.abs(m));n=1.2*b.lerp(Math.sqrt(m*(m+2*(this._referenceEllipsoid.radius+Math.min(0,n)))),v+this._referenceEllipsoid.radius,c.computeInnerAltitudeFade(m));v=b.clamp(2E4-(Math.log(m)-7.983)/9.011*19900,100,2E4);return e(n,v,
1,u)}}const t=p.create(),w=p.create();a.createNearFarHeuristic=function(v,m,r){return v===f.ViewingMode.Global?new d(r):new g(m,r)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/SurfaceCollisionConstraint":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../camera/intersectionUtils ../camera/constraintUtils/surfaceCollision".split(" "),
function(a,b,q,l,p,k,h,f,c,e){a.SurfaceCollisionConstraint=class extends q{constructor(g){super(g)}initialize(){this.addHandles(this.view.basemapTerrain.on("elevation-change",g=>this._handleElevationChangeEvent(g)))}_handleElevationChangeEvent(g){if(!this.view.state.cameraController){var d=this.view.state.camera;null!=g.spatialReference&&c.eyeWithinExtent(this.view,d,g.extent,g.spatialReference)&&this._applyToCurrentCamera()}}_applyToCurrentCamera(){this.view.state.updateCamera(g=>e.applySurfaceCollisionConstraint(this.view,
g,e.Mode.EYE_AND_CENTER))}};b.__decorate([l.property({constructOnly:!0})],a.SurfaceCollisionConstraint.prototype,"view",void 0);a.SurfaceCollisionConstraint=b.__decorate([f.subclass("esri.views.3d.state.SurfaceCollisionConstraint")],a.SurfaceCollisionConstraint);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/Frustum":function(){define(["exports","../../../chunks/vec32","../../../core/libs/gl-matrix-2/factories/vec3f64","../../../geometry/support/frustum"],function(a,
b,q,l){function p(h,f,c){h.origin=f;h.endpoint=c;b.direction(h.direction,f,c)}class k{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(h){this.renderCoordsHelper=h;this.frustum=l.create();this._points=l.createPoints();this.lines=Array(12);this._origin=q.create();this._direction=q.create();this._altitude=null;for(h=0;12>h;h++)this.lines[h]={origin:null,direction:q.create(),
endpoint:null}}update(h){l.fromMatrix(h.viewMatrix,h.projectionMatrix,this.frustum,this._points);b.copy(this._origin,h.eye);b.copy(this._direction,h.viewForward);this._altitude=this.renderCoordsHelper.getAltitude(this._origin);this._updateLines()}updatePoints(h){for(let f=0;f<this._points.length;f++)b.copy(this._points[f],h[f]);l.computePlanes(this.frustum,this._points);this._updateLines()}get altitude(){return this._altitude}intersectsSphere(h){return l.intersectsSphere(this.frustum,h)}intersectsRay(h){return l.intersectsRay(this.frustum,
h)}intersectsLineSegment(h,f){return l.intersectsLineSegment(this.frustum,h,f)}intersectsPoint(h){return l.intersectsPoint(this.frustum,h)}_updateLines(){const h=this._points;for(let f=0;4>f;f++){const c=f+4;p(this.lines[f],h[f],h[c]);p(this.lines[f+4],h[f],3===f?h[0]:h[f+1]);p(this.lines[f+8],h[c],3===f?h[4]:h[c+1])}}}k.planePointIndices=l.planePointIndices;k.nearFarLineIndices=[[l.PointIndex.NEAR_BOTTOM_LEFT,l.PointIndex.FAR_BOTTOM_LEFT],[l.PointIndex.NEAR_BOTTOM_RIGHT,l.PointIndex.FAR_BOTTOM_RIGHT],
[l.PointIndex.NEAR_TOP_RIGHT,l.PointIndex.FAR_TOP_RIGHT],[l.PointIndex.NEAR_TOP_LEFT,l.PointIndex.FAR_TOP_LEFT]];a.Frustum=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/GoToOperation":function(){define("exports ../../../Camera ../../../Viewpoint ../../../core/Error ../../../core/promiseUtils ../../../core/reactiveUtils ../camera/constraintUtils ../camera/constraintUtils/surfaceCollision ./controllers/CameraController ./controllers/PointToPointAnimationController ./controllers/SurfaceCollisionCorrectionController ../support/cameraUtils ../support/viewpointUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w{constructor(v,m,r){this._target=v;this._options=m;this.view=r;this.state="pending";this._animationController=null;this.promise=new Promise((n,u)=>{this._resolveCallback=n;this._rejectCallback=u;n=new AbortController;if(null!=this._options.signal)p.onAbort(this._options.signal,()=>{this.abort()});this._abortController=n;this._waitForReady()})}_resolve(v){if("finished"!==this.state)return this.state="finished",this._resolveCallback(v)}_reject(v){if("finished"!==
this.state)return this.state="finished",this._rejectCallback(v)}abort(v=!1){this._abortController.abort();switch(this.state){case "wait-for-animation-finish":!v&&null!=this._animationController&&this.view.state.cameraController===this._animationController&&this._animationController.active&&this._animationController.stopController()}this._reject(p.createAbortError())}async _waitForReady(){this.state="wait-for-ready";if(!this.view.ready)try{await k.whenOnce(()=>this.view.ready,this._abortController.signal)}catch(v){return this._reject(v)}this._createViewPoint()}async _createViewPoint(){if("finished"!==
this.state){this.state="wait-for-viewpoint";this._animationController=this._options.animate?this._getAnimationController():null;try{const m=await t.create(this.view,this._target,this._abortController.signal);if("finished"!==this.state){var v=m?this._getCameraFromViewpoint(m):null;null!=v&&(this._options.animate?null!=this._animationController&&this._startAnimation(v,this._animationController):(this.view.stateManager.setStateCamera(v.camera,{applyConstraints:!v.isFullySpecified,positionAndOrientationOnly:!0,
doNotCancelGoToOperation:!0}),this._resolve()))}}catch(m){this._reject(m)}}}_getCameraFromViewpoint(v){const m=!!(this._target instanceof q&&this._target.camera||this._target instanceof b);var r=v.camera;if(null==r)return null;if(!this.view.stateManager.isCompatible(r))return v=(v=r.position)&&v.spatialReference,this._reject(new l("GotoAnimation:incompatible-spatialreference",`Resulting camera has an incompatible spatial reference (camera: ${v?v.wkid:"none"}, view: ${this.view.spatialReference?.wkid})`,
{camera:r})),null;r=d.externalToInternal(this.view,r);return null==r?(this._reject(new l("GotoAnimation:invalid-camera","Resulting camera is invalid")),null):{viewpoint:v,camera:r,isFullySpecified:m}}_startAnimation(v,m){this.state="wait-for-animation-finish";const r=m.viewAnimation;if(null==r)this._reject(new l("GotoAnimation:missing-animation","Unreachable code in view.stateManager"));else{r.update(v.viewpoint,"running");if(!m.active||null==m.viewAnimation||m.viewAnimation.target!==v.viewpoint||
this.view.state.cameraController!==m)return this.abort();if(v.isFullySpecified){var n=new g.SurfaceCollisionCorrectionController({view:this.view,desiredCamera:v.camera});f.applySurfaceCollisionConstraint(this.view,v.camera,f.Mode.EYE_AND_CENTER)}else h.applyAll(this.view,v.camera);m.begin(v.camera,this._options);var u=x=>{if(null!=this.view.state)switch(m.state){case c.State.Finished:switch(this.state){case "pending":case "wait-for-ready":case "wait-for-viewpoint":case "wait-for-animation-finish":this._resolve()}break;
case c.State.Ready:case c.State.Rejected:case c.State.Running:case c.State.Stopped:switch(this.state){case "pending":case "wait-for-ready":case "wait-for-viewpoint":case "wait-for-animation-finish":this._reject(x)}}};r.when(()=>{const x=this.view.state.cameraController;n&&(x&&x.active?x instanceof e.PointToPointAnimationController&&null!=x.viewAnimation&&x.viewAnimation.target===v.viewpoint&&(this.view.state.cameraController=n):null!=m.viewAnimation&&m.viewAnimation.target===v.viewpoint&&m.state===
c.State.Finished&&(this.view.state.cameraController=n))},x=>u(x));m.asyncResult={resolve:()=>u(),reject:x=>u(x)}}}_getAnimationController(){let v=null;var m=null;m=this.view.state.cameraController;m instanceof e.PointToPointAnimationController&&(m.updateStateFromViewAnimation(),m.active&&(v=m,m=v.viewAnimation));return null!=v||(v=new e.PointToPointAnimationController({view:this.view,mode:"animation"}),m=v.viewAnimation,this.view.state.switchCameraController(v))?v:(null!=m&&m.stop(),this._reject(new l("GotoAnimation:goto-cannot-interrupt",
"Cannot start an animation while interacting")),null)}}a.GoToOperation=w;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/SurfaceCollisionCorrectionController":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../camera/intersectionUtils ../../camera/constraintUtils/surfaceCollision ./CameraController".split(" "),
function(a,b,q,l,p,k,h,f,c,e){a.SurfaceCollisionCorrectionController=class extends e.CameraController{set desiredCamera(g){this._set("desiredCamera",g.clone())}constructor(g){super(g)}get canStop(){return!0}get constraintEnabled(){return this.view.state.constraints.collision.enabled}onControllerStart(){this.state=e.State.Running;this.addHandles(this.view.basemapTerrain.on("elevation-change",g=>this._handleElevationChangeEvent(g)));this._applyCorrection()}onControllerEnd(){this.removeAllHandles()}stepController(){}_handleElevationChangeEvent(g){(null==
g.spatialReference||f.eyeWithinExtent(this.view,this.desiredCamera,g.extent,g.spatialReference))&&this._applyCorrection()}_applyCorrection(){this.view.state.updateCamera(g=>{g.copyViewFrom(this.desiredCamera);c.applySurfaceCollisionConstraint(this.view,g,c.Mode.EYE_AND_CENTER)||this.constraintEnabled||(this.state=e.State.Stopped)})}};b.__decorate([q.property({constructOnly:!0})],a.SurfaceCollisionCorrectionController.prototype,"desiredCamera",null);a.SurfaceCollisionCorrectionController=b.__decorate([h.subclass("esri.views.3d.state.controllers.SurfaceCollisionCorrectionController")],
a.SurfaceCollisionCorrectionController);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/viewpointUtils":function(){define("exports ../../../Camera ../../../geometry ../../../Graphic ../../../Viewpoint ../../../core/asyncUtils ../../../core/has ../../../core/Cyclical ../../../core/Error ../../../core/promiseUtils ../../../core/libs/gl-matrix-2/math/mat3 ../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/projection ../../../geometry/projection/computeTranslationToOriginAndRotation ../../../geometry/projection/projectPointToVector ../../../geometry/projection/projectVectorToPoint ../../../geometry/projection/projectVectorToVector ../../../geometry/support/aaBoundingBox ../../../geometry/support/aaBoundingRect ../../../geometry/support/frustum ../../../geometry/support/scaleUtils ../camera/intersectionUtils ./cameraUtils ./ElevationProvider ../../../geometry/Point ../../../geometry/Extent ../../../geometry/SpatialReference ../../../geometry/Geometry ../../../geometry/Multipoint".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I){async function O(ra,xa,Ma,Ga){var Pa=xa.camera;if(null!=Pa)return L(Pa,D.getViewSR(ra),Ga);({targetGeometry:Pa}=xa);if(null==Pa)throw Error("Viewpoint has no targetGeometry!");const {camera:Qa,mode:Ea}=P(ra,xa.rotation,Ma);if("point"===Pa.type)return M(ra,xa,Pa,Qa,Ea,Ga);xa=Pa.extent;if(null==xa)throw Error("Target geometry has no extent!");return D.fromExtentAsync(ra,xa,Qa.heading,Qa.tilt,Ea,Ga)}async function L(ra,xa,Ma){xa=
await m.projectWithZConversion(ra.position,xa,{signal:Ma});e.throwIfAborted(Ma);ra=ra.clone();ra.position=xa.clone();return ra}function P(ra,xa,Ma){ra=D.internalToExternal(ra,ra.state.camera);let Ga=D.OrientationMode.ADJUST;null!=xa&&(ra.heading=360-f.cyclicalDegrees.normalize(xa),Ga=D.OrientationMode.LOCKED);null!=Ma&&(ra.tilt=Ma);return{camera:ra,mode:Ga}}async function M(ra,xa,Ma,Ga,Pa,Qa){const Ea=ra.spatialReference;Ma=await m.projectWithZConversion(Ma.clone(),Ea,{signal:Qa});e.throwIfAborted(Qa);
xa=null!=xa.scale?D.scaleToDistance(ra,xa.scale,Ma.latitude):ra.state.camera.distance;return D.fromCenterDistanceAsync(ra,Ma,xa,Ga,Pa,Qa)}function K(ra,xa){return null==xa.scale&&null!=xa.zoom?D.zoomToScale(ra,xa.zoom):xa.scale}function J(ra,xa){let Ma=!1;null!=xa.heading?(ra.heading=xa.heading,Ma=!0):null!=xa.rotation&&(ra.heading=360-f.cyclicalDegrees.normalize(xa.rotation),Ma=!0);null!=xa.tilt&&(ra.tilt=xa.tilt,Ma=!0);null!=xa.fov&&(ra.fov=xa.fov);return Ma}function R(ra,xa,Ma,Ga){var Pa=ra.spatialReference||
E.WGS84;xa??=D.externalToInternal(ra,Ma);if(null==xa)return Ga;Pa=new H({spatialReference:Pa});if(!u.projectVectorToPoint(xa.center,ra.renderSpatialReference,Pa))return Ga;Ga.targetGeometry=Pa;({latitude:Pa}=Pa);Ga.scale=null!=Pa?D.distanceToScale(ra,xa.distance,Pa):D.computeScale(ra,xa);Ga.rotation=f.cyclicalDegrees.normalize(360-Ma.heading);Ga.camera=Ma;return Ga}async function Q(ra,xa,Ma,Ga){const Pa=()=>new c("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!xa)throw Pa();
"mesh"===xa.type&&(xa=xa.extent);const Qa=ra.basemapTerrain.spatialReference;if(!xa.hasZ&&ra.basemapTerrain){let ua;switch(xa.type){case "point":ua=xa;break;case "multipoint":case "polyline":ua=xa.extent?.center;break;case "extent":ua=xa.center;break;case "polygon":ua=xa.centroid}null!=ua&&Qa&&ra.elevationProvider?(ua=await m.projectWithZConversion(ua,Qa,{signal:Ga}),ia[2]=F.getElevationAtPoint(ra.elevationProvider,ua)??0):ia[2]=0}const Ea=[];(0,Da[xa.type])(xa,xa.hasZ?ua=>{Ea.push([ua[0],ua[1],ua[2]])}:
ua=>{Ea.push([ua[0],ua[1]])},ia);if(0===Ea.length)throw Pa();ra=ra.spatialReference;Ga=await m.projectWithZConversion(new I({spatialReference:xa.spatialReference,hasZ:xa.hasZ,hasM:!1,points:Ea}),ra,{signal:Ga});xa.hasZ&&(Ma.hasZ=!0);if(xa.hasZ)for(const [ua,Na,Ua]of Ga.points)ia[0]=ua,ia[1]=Na,ia[2]=Ua,y.expandWithVec3(Ma.boundingBox,ia);else for(const [ua,Na]of Ga.points)ia[0]=ua,ia[1]=Na,y.expandWithVec3(Ma.boundingBox,ia)}async function W(ra,xa,Ma,Ga,Pa){const Qa=await k.result(ra.whenViewForGraphic(xa));
if(!1!==Qa.ok&&null!=Qa.value&&"whenGraphicBounds"in Qa.value)if(Ma=await k.result(Qa.value.whenGraphicBounds(xa,{minDemResolution:Ma})),!1!==Ma.ok&&Ma.value){var {screenSpaceObjects:Ea,boundingBox:ua}=Ma.value;y.expandWithAABB(Ga.boundingBox,ua);Ea&&Ea.forEach(Na=>{Ga.screenSpaceObjects.push(Na)});isFinite(ua[2])&&(Ga.hasZ=!0)}else await Q(ra,xa.geometry,Ga,Pa);else await Q(ra,xa.geometry,Ga,Pa)}async function S(ra,xa,Ma,Ga,Pa){if(Array.isArray(xa)&&2===xa.length){const Qa=xa[0],Ea=xa[1];if("number"===
typeof Qa&&"number"===typeof Ea){ya.x=Qa;ya.y=Ea;ya.z=void 0;ya.spatialReference=ra.spatialReference?.isGeographic?ra.spatialReference:E.WGS84;await Q(ra,ya,Ga,Pa);return}}xa&&"map"in xa&&"function"===typeof xa.map?await Promise.allSettled(xa.map(Qa=>S(ra,Qa,Ma,Ga,Pa))):xa instanceof G?await Q(ra,xa,Ga,Pa):xa instanceof l&&await W(ra,xa,Ma,Ga,Pa)}async function V(ra,xa,Ma,Ga,Pa){if(xa.camera)return T(ra,xa.camera,Ga,Pa);Pa.scale=xa.scale;Pa.rotation=xa.rotation;Pa.targetGeometry=null!=xa.targetGeometry?
xa.targetGeometry.clone():null;Pa.camera=null;null!=Ma.heading?Pa.rotation=f.cyclicalDegrees.normalize(360-Ma.heading):null!=Ma.rotation&&(Pa.rotation=Ma.rotation);xa=K(ra,Ma);null!=xa&&(Pa.scale=xa);Pa.camera=await O(ra,Pa,Ma.tilt,Ga);return Pa}async function T(ra,xa,Ma,Ga){Ma=await m.projectWithZConversion(xa.position,ra.spatialReference,{signal:Ma});xa=xa.clone();xa.position=Ma;return R(ra,null,xa,Ga)}async function Y(ra,xa,Ma,Ga,Pa,Qa,Ea){const ua=ra.renderSpatialReference;await n.projectPointToVectorAsync(xa,
va,ua,0,{signal:Ea});await n.projectPointToVectorAsync(Ma,na,ua,0,{signal:Ea});Qa.targetGeometry=new H(xa);Pa.position=new H(Ma);w.subtract(la,va,na);D.directionToHeadingTilt(ra,na,la,Ga.up,Pa);Qa.scale=D.distanceToScale(ra,w.distance(na,va),Qa.targetGeometry.latitude);Qa.rotation=f.cyclicalDegrees.normalize(360-Pa.heading);Qa.camera=Pa;return Qa}async function ha(ra,xa,Ma,Ga,Pa,Qa){Qa.targetGeometry=Ma.clone();const Ea=C.cameraOnContentAlongViewDirection(ra);if(xa.position)return Y(ra,Qa.targetGeometry,
xa.position,Ea,Ga,Qa,Pa);if(xa.zoomFactor){var ua=Ea.distance/xa.zoomFactor;const Na=w.scale(ia,Ea.viewForward,-ua);Ea.eye=w.add(ia,Ea.center,Na);Qa.scale=D.distanceToScale(ra,ua,Ma.latitude)}D.internalToExternal(ra,Ea,Ga);ua=J(Ga,xa)?D.OrientationMode.LOCKED:D.OrientationMode.ADJUST;xa.zoomFactor||(xa=K(ra,xa),null==xa?(await n.projectPointToVectorAsync(Ma,ia,ra.renderSpatialReference,0,{signal:Pa}),A.intersectsPoint(Ea.frustum,ia)?Qa.scale=D.distanceToScale(ra,w.distance(Ea.eye,ia),Ma.latitude):
Qa.scale=D.computeScale(ra,Ea)):Qa.scale=xa,Qa.camera=await D.fromCenterScale(ra,Qa.targetGeometry,Qa.scale,Ga,ua,Pa));return Qa}async function ba(ra,xa,Ma,Ga,Pa){var Qa=C.cameraOnContentAlongViewDirection(ra);w.copy(la,Qa.viewForward);D.directionToHeadingTilt(ra,Qa.eye,la,Qa.up,za);Qa=ra.spatialReference;const {position:Ea}=xa;Ea?(Pa=await m.projectWithZConversion(Ea,Qa,{signal:Pa}),Ma.position=Pa):Ma.position=new H;Ma.heading=null!=xa.heading?xa.heading:za.heading;Ma.tilt=null!=xa.tilt?xa.tilt:
za.tilt;return R(ra,null,Ma,Ga)}async function U(ra,xa,Ma,Ga,Pa){if(null!=xa.heading||null!=xa.rotation||null!=xa.scale||null!=xa.tilt||null!=xa.zoom||null!=xa.zoomFactor){const Qa=C.cameraOnContentAlongViewDirection(ra),{spatialReference:Ea,renderSpatialReference:ua}=ra,Na=new H({spatialReference:Ea});return u.projectVectorToPoint(Qa.center,ua,Na)?ha(ra,xa,Na,Ma,Ga,Pa):Pa}Pa.scale=ra.scale;Pa.camera=ra.camera.clone();J(Pa.camera,xa);return Pa}async function Z(ra,xa,Ma,Ga,Pa,Qa){Qa.targetGeometry=
Ma.clone();const Ea=C.cameraOnContentAlongViewDirection(ra);D.internalToExternal(ra,Ea,Ga);xa=J(Ga,xa)?D.OrientationMode.LOCKED:D.OrientationMode.ADJUST;Qa.camera=await D.fromExtentAsync(ra,Ma,Ga.heading,Ga.tilt,xa,Pa);return Qa}async function ca(ra,xa,Ma,Ga,Pa,Qa,Ea,ua){ua.targetGeometry=Ma.clone();const Na=C.cameraOnContentAlongViewDirection(ra);var Ua=0;null!=Ma.z?Ua=Ma.z:ra.basemapTerrain&&ra.elevationProvider&&(Ua=F.getElevationAtPoint(ra.elevationProvider,Ma));w.set(ia,Ma.x,Ma.y,Ua);r.computeTranslationToOriginAndRotation(ra.spatialReference,
ia,ka,ra.renderSpatialReference);g.fromMat4(fa,ka);g.transpose(fa,fa);y.empty(X);Ma=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(var wa=0;wa<Ma.length;wa++){const sa=Ma[wa];let Ha=Ga[sa[2]];isFinite(Ha)||(Ha=Ua);w.set(ia,Ga[sa[0]],Ga[sa[1]],Ha);x.projectVectorToVector(ia,ra.spatialReference,ia,ra.renderSpatialReference);y.expandWithVec3(X,w.transformMat3(ia,ia,fa))}Ga=y.width(X);Ua=y.height(X);Ma=y.depth(X);wa=1/Math.tan(Na.fovY/2);Pa=Math.max(.5*Math.sqrt(Ga*Ga+Ma*Ma)*Math.max(wa,
1/Math.tan(Na.fovX/2))+.5*Ua,.5*Ua*wa+.5*Math.max(Ga,Ma))/Pa;D.internalToExternal(ra,Na,Qa);xa=J(Qa,xa)?D.OrientationMode.LOCKED:D.OrientationMode.ADJUST;ua.scale=D.distanceToScale(ra,Pa,ua.targetGeometry.latitude);ua.camera=await D.fromCenterScale(ra,ua.targetGeometry,ua.scale,Qa,xa,Ea);return ua}function ea(ra){null!=ra?.camera&&(ra.rotation=f.cyclicalDegrees.normalize(360-ra.camera.heading));return ra}class da{constructor(){this.hasZ=!1;this.boundingBox=y.empty();this.screenSpaceObjects=[]}}const ia=
v.create(),ka=t.create(),fa=d.create(),X=y.create(),ja=z.create(),la=v.create(),na=v.create(),va=v.create(),za={heading:0,tilt:0},ya=new H,Da={point(ra,xa,Ma){Ma[0]=ra.x;Ma[1]=ra.y;null!=ra.z&&(Ma[2]=ra.z);xa(Ma)},polygon(ra,xa,Ma){const Ga=ra.hasZ;for(let Pa=0;Pa<ra.rings.length;Pa++){const Qa=ra.rings[Pa];for(let Ea=0;Ea<Qa.length;Ea++)Ma[0]=Qa[Ea][0],Ma[1]=Qa[Ea][1],Ga&&(Ma[2]=Qa[Ea][2]),xa(Ma)}},polyline(ra,xa,Ma){const Ga=ra.hasZ;for(let Pa=0;Pa<ra.paths.length;Pa++){const Qa=ra.paths[Pa];for(let Ea=
0;Ea<Qa.length;Ea++)Ma[0]=Qa[Ea][0],Ma[1]=Qa[Ea][1],Ga&&(Ma[2]=Qa[Ea][2]),xa(Ma)}},multipoint(ra,xa,Ma){const Ga=ra.points;ra=ra.hasZ;for(let Pa=0;Pa<Ga.length;Pa++)Ma[0]=Ga[Pa][0],Ma[1]=Ga[Pa][1],ra&&(Ma[2]=Ga[Pa][2]),xa(Ma)},extent(ra,xa,Ma){null!=ra.zmin&&null!=ra.zmax?(xa(w.set(Ma,ra.xmin,ra.ymin,ra.zmin)),xa(w.set(Ma,ra.xmax,ra.ymin,ra.zmin)),xa(w.set(Ma,ra.xmin,ra.ymax,ra.zmin)),xa(w.set(Ma,ra.xmax,ra.ymax,ra.zmin)),xa(w.set(Ma,ra.xmin,ra.ymin,ra.zmax)),xa(w.set(Ma,ra.xmax,ra.ymin,ra.zmax)),
xa(w.set(Ma,ra.xmin,ra.ymax,ra.zmax)),xa(w.set(Ma,ra.xmax,ra.ymax,ra.zmax))):(xa(w.set(Ma,ra.xmin,ra.ymin,Ma[2])),xa(w.set(Ma,ra.xmax,ra.ymin,Ma[2])),xa(w.set(Ma,ra.xmin,ra.ymax,Ma[2])),xa(w.set(Ma,ra.xmax,ra.ymax,Ma[2])))}};a.create=async function(ra,xa,Ma){if(xa&&ra.spatialReference){var Ga={target:void 0};"declaredClass"in xa||Array.isArray(xa)?Ga.target=xa:(Object.assign(Ga,xa),!Ga.target&&"center"in xa&&xa.center&&(Ga.target=xa.center));xa=Ga}else xa=null;if(!xa)throw new c("viewpointutils-create:no-target",
"Missing target for creating viewpoint");Ga=new b({fov:ra.camera.fov});const Pa=new p({camera:Ga});if(xa.target instanceof p)return ra=await V(ra,xa.target,xa,Ma,Pa),ea(ra);if(xa.target instanceof b)return ea(await T(ra,xa.target,Ma,Pa));var Qa=null!=xa.scale||null!=xa.zoom;if(xa.target instanceof N){var Ea=xa.target.xmin===xa.target.xmax||xa.target.ymin===xa.target.ymax;return Qa||Ea?ea(await ha(ra,xa,xa.target.center,Ga,Ma,Pa)):ea(await Z(ra,xa,xa.target,Ga,Ma,Pa))}Ea=new da;var ua=Qa?(ua=K(ra,
xa))?B.getResolutionInMetersForScale(ua):void 0:void 0;await S(ra,xa.target,ua,Ea,Ma);if(isFinite(Ea.boundingBox[0])){y.center(Ea.boundingBox,ia);ya.x=ia[0];ya.y=ia[1];ya.z=ia[2];ya.spatialReference=ra.spatialReference;isFinite(ya.z)&&Ea.hasZ?ua=y.isPoint(Ea.boundingBox):(ya.z=void 0,ua=z.isPoint(y.toRect(Ea.boundingBox,ja)));if(Qa||ua)return ea(await ha(ra,xa,ya,Ga,Ma,Pa));Qa=Ea.screenSpaceObjects;if(Qa.length){ua=Number.NEGATIVE_INFINITY;for(let Na=0;Na<Qa.length;Na++){const Ua=Qa[Na].screenSpaceBoundingRect;
ua=Math.max(ua,Math.abs(Ua[0]),Math.abs(Ua[1]),Math.abs(Ua[2]),Math.abs(Ua[3]))}Qa=.66-ua/Math.min(ra.width,ra.height)*2}else Qa=.66;return ea(await ca(ra,xa,ya,Ea.boundingBox,Qa,Ga,Ma,Pa))}return xa.position?ea(await ba(ra,xa,Ga,Pa,Ma)):ea(await U(ra,xa,Ga,Ma,Pa))};a.fromCamera=function(ra,xa,Ma=null){null==Ma&&(Ma=new p);return R(ra,null,xa.clone(),Ma)};a.toCameraAsync=O;a.toCameraSync=function(ra,xa,Ma){var Ga=xa.camera;if(null!=Ga){a:{ra=D.getViewSR(ra);var Pa=Ga.position;try{var Qa=m.tryProjectWithZConversion(Pa,
ra)}catch(Na){ra=null;break a}Qa?(ra=Ga.clone(),ra.position=Qa.clone()):ra=null}return ra}({targetGeometry:Qa}=xa);if(null==Qa)return null;const {camera:Ea,mode:ua}=P(ra,xa.rotation,Ma);if("point"===Qa.type){a:{Ga=ra.spatialReference;try{Pa=m.tryProjectWithZConversion(Qa.clone(),Ga)}catch(Na){ra=null;break a}Pa?(Qa=null!=xa.scale?D.scaleToDistance(ra,xa.scale,Pa.latitude):ra.state.camera.distance,ra=D.fromCenterDistanceSync(ra,Pa,Qa,Ea,ua)):ra=null}return ra}Qa=Qa.extent;return null==Qa?null:D.fromExtentSync(ra,
Qa,Ea.heading,Ea.tilt,ua)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/RenderFeature":function(){define(["exports","../../../../core/has","../../../../core/NestedMap","../../../support/RenderState"],function(a,b,q,l){a.RenderFeature=void 0;(function(p){p[p.Antialiasing=0]="Antialiasing";p[p.HighQualityTransparency=1]="HighQualityTransparency";p[p.HighResolutionVoxel=2]="HighResolutionVoxel";p[p.HighResolutionAtmosphere=3]="HighResolutionAtmosphere";
p[p.SSAO=4]="SSAO";p[p.WaterReflection=5]="WaterReflection";p[p.HighResolutionShadows=6]="HighResolutionShadows";p[p.HighResolutionViewshed=7]="HighResolutionViewshed";p[p.PhysicalPixelRendering=8]="PhysicalPixelRendering"})(a.RenderFeature||(a.RenderFeature={}));a.setupFeatureDefaults=function(p=!b("disable-feature:high-quality-idle"),k=null){const h=new q.NestedMap;p?(h.set(l.RenderState.IDLE,a.RenderFeature.Antialiasing,"low"!==k),h.set(l.RenderState.IDLE,a.RenderFeature.HighResolutionAtmosphere,
"low"!==k),h.set(l.RenderState.IDLE,a.RenderFeature.HighQualityTransparency,!0),h.set(l.RenderState.IDLE,a.RenderFeature.SSAO,!0),h.set(l.RenderState.IDLE,a.RenderFeature.WaterReflection,!0),h.set(l.RenderState.IDLE,a.RenderFeature.PhysicalPixelRendering,!0)):(h.set(l.RenderState.ANIMATING,a.RenderFeature.HighResolutionShadows,!0),h.set(l.RenderState.ANIMATING,a.RenderFeature.HighResolutionViewshed,!0),h.set(l.RenderState.INTERACTING,a.RenderFeature.HighResolutionShadows,!0),h.set(l.RenderState.INTERACTING,
a.RenderFeature.HighResolutionViewshed,!0));h.set(l.RenderState.IDLE,a.RenderFeature.HighResolutionShadows,!0);h.set(l.RenderState.IDLE,a.RenderFeature.HighResolutionViewshed,!0);h.set(l.RenderState.IDLE,a.RenderFeature.HighResolutionVoxel,!0);return h};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/NestedMap":function(){define(["exports"],function(a){class b{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(q,l){return this._outer.get(q)?.get(l)}set(q,
l,p){const k=this._outer.get(q);k?k.set(l,p):this._outer.set(q,new Map([[l,p]]))}delete(q,l){const p=this._outer.get(q);p&&(p.delete(l),0===p.size&&this._outer.delete(q))}forEach(q){this._outer.forEach((l,p)=>q(l,p))}}a.NestedMap=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/DragZoom":function(){define("exports ../../../../core/screenUtils ../../state/controllers/ZoomControllerGlobal ../../state/controllers/ZoomControllerLocal ../../../input/InputHandler ../../../input/handlers/support".split(" "),
function(a,b,q,l,p,k){class h extends p.InputHandler{constructor(f,c,e){super(!0);this._view=f;this.pointerAction=c;this.registerIncoming("drag",e,g=>this._handleDrag(g))}_handleDrag(f){const c=f.data;if(!(1<c.pointers.size)&&k.eventMatchesMousePointerAction(f.data,this.pointerAction)){var e=b.createScreenPointArray(c.center.x,c.center.y);switch(c.action){case "start":this._cameraController&&(this._cameraController.end(),this._cameraController=null);this._cameraController=this._view.state.isGlobal?
new q.ZoomControllerGlobal({view:this._view}):new l.ZoomControllerLocal({view:this._view});this._view.state.switchCameraController(this._cameraController);this._cameraController.begin(e);break;case "update":this._cameraController&&this._cameraController.update(e);break;case "end":this._cameraController&&(this._cameraController.end(),this._cameraController=null)}f.stopPropagation()}}}a.DragZoom=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/ZoomControllerGlobal":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/screenUtils ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/support/axisAngle ../../../../chunks/sphere ../../camera/constraintUtils ../../camera/constraintUtils/ConstraintOptions ../../camera/constraintUtils/ConstraintTypes ../../camera/constraintUtils/InteractionType ../../camera/constraintUtils/surfaceCollision ./InteractiveController ../utils/navigationUtils ../../support/geometryUtils/ray".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){a.ZoomControllerGlobal=class extends z.InteractiveController{constructor(){super(...arguments);this._pickPoint=t.create();this._tmpP0=g.create();this._panAxisAngle=v.create();this._tmpRayDir=t.create();this._tmpRayDirPick=t.create();this._targetOnSphere=t.create();this._navMode=A.NavigationMode.Horizontal;this._tmpRay={origin:t.create(),direction:t.create()};this.dragBeginPoint=l.createScreenPointArray();this._normalizedAnchorPoint=g.create();
this._constraintOptions=new n.ConstraintOptions(u.ConstraintTypes.ALL_EXCEPT_COLLISION,x.InteractionType.ZOOM,0,this.startCamera);this._sphere=m.create();this._hasPickPoint=!1}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(F){if(this.active){e.copy(this.dragBeginPoint,F);A.normalizeCoordinate(this.startCamera,F,this._normalizedAnchorPoint);var H=w.getReferenceEllipsoid(this.view.spatialReference);H=A.pickPointAndInitSphere(this._intersectionHelper,this.startCamera,F,H,A.SpherePickPointFallback.Ellipsoid,
0===this.view.map.ground.opacity?A.contentIntersectorOptions:{});this._navMode=A.navigationMode(this.startCamera,F,this.view.renderCoordsHelper,this.view.viewingMode);if(this._navMode===A.NavigationMode.Horizontal)this._hasPickPoint=!!H.scenePickPoint,this._pickPoint=H.scenePickPoint??this._pickPoint,this._sphere=H.sphere;else{B.fromScreenAtEye(this.startCamera,F,this._tmpRay);d.normalize(this._tmpRay.direction,this._tmpRay.direction);let N;null!=H.scenePickPoint&&(d.subtract(this._tmpRayDirPick,
this.startCamera.eye,H.scenePickPoint),N=d.length(this._tmpRayDirPick));H=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,D);H=q.clamp(Math.min(A.pivotDistanceModifier,1/Math.abs(d.dot(D,this._tmpRay.direction)))*H,A.distanceClampValues[0],A.distanceClampValues[1]);F=this.view._stage.renderView.getMinimalDepthForArea(null,F[0],F[1],this.view.state.camera,A.screenPixelArea);H=null!=F?F:H;H=null!=N?Math.min(H,N):H;this._hasPickPoint=!0;d.scale(this._tmpRay.direction,
this._tmpRay.direction,H);d.add(this._pickPoint,this._tmpRay.origin,this._tmpRay.direction)}}}update(F){if(this.active){this.currentCamera.eye=this.startCamera.eye;this.currentCamera.center=this.startCamera.center;this.currentCamera.up=this.startCamera.up;if(this._navMode===A.NavigationMode.Horizontal){d.subtract(this._tmpRayDir,this.currentCamera.center,this.currentCamera.eye);var H=d.length(this._tmpRayDir);A.normalizeCoordinate(this.currentCamera,F,this._tmpP0);var N=12*(this._normalizedAnchorPoint[1]-
this._tmpP0[1]),E=H*2**N;const G=this.view.state.constraints.minimumPoiDistance;0>N&&E<G&&(E=G);if(1E-6>Math.abs(H-E))return;this._hasPickPoint&&E<H&&(N=1-(1-E/H)*(1-this._sphere[3]/d.length(this.currentCamera.center)),this.currentCamera.center=d.scale(C,this.currentCamera.center,N));d.scale(this._tmpRayDir,this._tmpRayDir,-E/H);this.currentCamera.eye=d.add(C,this.currentCamera.center,this._tmpRayDir);this._constraintOptions.interactionFactor=r.pixelDistanceToInteractionFactor(e.distance(this.dragBeginPoint,
F));r.applyAll(this.view,this.currentCamera,this._constraintOptions);this._hasPickPoint&&(A.sphereOrPlanePointFromScreenPoint(this._sphere,this.currentCamera,this.dragBeginPoint,this._targetOnSphere),v.fromPoints(this._pickPoint,this._targetOnSphere,this._panAxisAngle),A.applyRotation(this.currentCamera,m.getCenter(this._sphere),this._panAxisAngle))}else{H=d.length(this._tmpRay.direction);A.normalizeCoordinate(this.currentCamera,F,this._tmpP0);F=12*(this._normalizedAnchorPoint[1]-this._tmpP0[1]);
E=H*2**F;N=this.view.state.constraints.minimumPoiDistance;0>F&&E<N&&(E=N);if(1E-6>Math.abs(H-E))return;d.scale(this._tmpRayDir,this._tmpRay.direction,1-E/H);this.currentCamera.eye=d.add(C,this.currentCamera.eye,this._tmpRayDir);this.currentCamera.center=d.add(C,this.currentCamera.center,this._tmpRayDir)}y.applySurfaceCollisionConstraint(this.view,this.currentCamera);this.commitCamera()}}end(){this.active&&this.finishController()}};a.ZoomControllerGlobal=b.__decorate([c.subclass("esri.views.3d.state.controllers.ZoomControllerGlobal")],
a.ZoomControllerGlobal);const C=t.create(),D=t.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/ZoomControllerLocal":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/screenUtils ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/plane ../../camera/constraintUtils ../../camera/constraintUtils/ConstraintOptions ../../camera/constraintUtils/ConstraintTypes ../../camera/constraintUtils/InteractionType ../../layers/VoxelWasm ./InteractiveController ../utils/navigationUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){a.ZoomControllerLocal=class extends x.InteractiveController{constructor(){super(...arguments);this._tmpP=t.create();this._tmpDir=t.create();this._tmpN=t.create();this._tmpP0=g.create();this._tmpPoi=t.create();this._tmpRayDir=t.create();this.dragBeginPoint=l.createScreenPointArray();this._normalizedAnchorPoint=g.create();this._constraintOptions=new m.ConstraintOptions(r.ConstraintTypes.ALL,n.InteractionType.ZOOM,0,this.startCamera,t.create());this._plane=
w.create()}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(B){if(this.active){e.copy(this.dragBeginPoint,B);y.normalizeCoordinate(this.startCamera,B,this._normalizedAnchorPoint);var C=this._intersectionHelper.intersectScreenFreePointFallback(B,this._tmpP,0===this.view.map.ground.opacity?y.contentIntersectorOptions:{});d.subtract(this._tmpDir,this._tmpP,this.startCamera.eye);var D=d.length(this._tmpDir);d.normalize(this._tmpDir,this._tmpDir);var F=Math.abs(this.view.camera.position.z);
F=q.clamp(Math.min(y.pivotDistanceModifier,1/Math.abs(d.dot(A,this._tmpDir)))*F,y.distanceClampValues[0],y.distanceClampValues[1]);B=this.view._stage.renderView.getMinimalDepthForArea(u.getVoxelWasm(this.view),B[0],B[1],this.view.state.camera,y.screenPixelArea);F=null!=B?B:F;F=C?Math.min(F,D):F;d.scale(this._tmpDir,this._tmpDir,F);d.add(this._tmpP,this.startCamera.eye,this._tmpDir);d.subtract(this._tmpN,this.startCamera.eye,this.startCamera.center);d.normalize(this._tmpN,this._tmpN);0>this._tmpN[1]&&
d.negate(this._tmpN,this._tmpN);w.fromPositionAndNormal(this._tmpP,this._tmpN,this._plane)}}update(B){if(this.active){y.intersectPlaneFromScreenPoint(this._plane,this.currentCamera,this.dragBeginPoint,this._tmpPoi)||d.copy(this._tmpPoi,this.currentCamera.center);y.normalizeCoordinate(this.currentCamera,B,this._tmpP0);var C=4*(this._tmpP0[1]-this._normalizedAnchorPoint[1]);e.copy(this._normalizedAnchorPoint,this._tmpP0);d.subtract(this._tmpRayDir,this._tmpPoi,this.currentCamera.eye);var D=d.length(this._tmpRayDir),
F=D*(1-C);this._constraintOptions.interactionDirection&&(d.copy(this._constraintOptions.interactionDirection,this._tmpRayDir),d.scale(this._constraintOptions.interactionDirection,this._constraintOptions.interactionDirection,Math.sign(C)/D));var H=this.view.state.constraints.minimumPoiDistance;0<=C&&F<H&&(F=H,C=-(F-D)/D);1E-6>Math.abs(D-F)||(d.scale(this._tmpRayDir,this._tmpRayDir,C),this.currentCamera.eye=d.add(z,this.currentCamera.eye,this._tmpRayDir),d.lerp(z,this.currentCamera.center,this._tmpPoi,
C),z[2]=this._tmpPoi[2]>this.startCamera.center[2]?Math.max(this.startCamera.center[2],z[2]):Math.min(this.startCamera.center[2],z[2]),this.currentCamera.center=z,this._constraintOptions.interactionFactor=v.pixelDistanceToInteractionFactor(e.distance(this.dragBeginPoint,B)),v.applyAll(this.view,this.currentCamera,this._constraintOptions),this.commitCamera())}}end(){this.active&&this.finishController()}};a.ZoomControllerLocal=b.__decorate([c.subclass("esri.views.3d.state.controllers.ZoomControllerLocal")],
a.ZoomControllerLocal);const z=t.create(),A=t.fromValues(0,0,1);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/GamepadNavigation":function(){define(["exports","../../../../core/Handles","../../../../core/reactiveUtils","../../state/controllers/GamepadKeyboardController","../../../input/InputHandler"],function(a,b,q,l,p){class k extends p.InputHandler{constructor(h){super(!0);this._view=h;this._watchHandles=new b;this._handle=this.registerIncoming("gamepad",
f=>this._handleEventGamepad(f));this._handle.pause()}onInstall(h){super.onInstall(h);this._watchHandles.add([q.watch(()=>this._view.navigation.gamepad.enabled,f=>{f?this._handle.resume():(this._handle.pause(),this._cameraControllerGamepad&&(this._cameraControllerGamepad.finishController(),this._cameraControllerGamepad=null))},q.initial),q.watch(()=>this._view.navigation.gamepad.device,f=>{this._cameraControllerGamepad&&f&&this._cameraControllerGamepad.gamepadDevice!==f&&(this._cameraControllerGamepad.finishController(),
this._cameraControllerGamepad=null)})])}onUninstall(){this._watchHandles.removeAll();super.onUninstall()}_handleEventGamepad(h){var f=this._view.navigation.gamepad.device;if(!f||h.data.device===f)if((f=this._cameraControllerGamepad?.active)||l.GamepadKeyboardController.activatesFor(this._view,h.data))f||(f=new l.GamepadKeyboardController({view:this._view,gamepadDevice:h.data.device}),this._view.state.switchCameraController(f)&&(this._cameraControllerGamepad=f)),this._cameraControllerGamepad&&this._cameraControllerGamepad.active&&
this._cameraControllerGamepad.gamepadDevice===h.data.device&&this._cameraControllerGamepad.handleEventGamepad(h.data)}}a.GamepadNavigation=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/GamepadKeyboardController":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/compilerUtils ../../../../core/mathUtils ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/support/ray ../../../../chunks/sphere ../../../../geometry/support/vector ../../../../geometry/support/vectorStacks ../../camera/constraintUtils ../../camera/constraintUtils/ConstraintOptions ../../camera/constraintUtils/ConstraintTypes ../../camera/constraintUtils/InteractionType ../../camera/constraintUtils/TiltMode ../Constraints ./InteractiveController ../utils/navigationUtils ../utils/viewUtils ../../support/cameraUtils ../../support/cameraUtilsInternal ../../webgl/RenderCamera ../../../navigation/gamepadAndKeyboardUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E){a.GamepadKeyboardController=class extends B.InteractiveController{constructor(R){super(R);this._filteredSurfaceElevation=0;this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0};this._keysButtonState=[0,0,0,0,0,0,0,0,0,0,0,0];this._tmpCamera=new N;this._headingStart=0;this._constraintOptions=new u.ConstraintOptions(x.ConstraintTypes.ALL,y.InteractionType.NONE,0,new N,null,z.TiltMode.LOOK_AROUND)}handleEventGamepad(R){const Q=
E.extractTransformation(R,this.view.navigation.gamepad,this._transformation);("end"===R.action||E.isZeroTransformation(Q))&&this.finishController()}activateDirection(R){this._keysButtonState[R]=1;E.extractTransformationKeyboard(this._keysButtonState,this._transformation)}deactivateDirection(R){this._keysButtonState[R]=0;R=E.extractTransformationKeyboard(this._keysButtonState,this._transformation);E.isZeroTransformation(R)&&this.finishController()}onControllerStart(R){this._filteredSurfaceElevation=
this.view.pointsOfInterest.cameraOnSurface.location.z;this._headingStart=this.view.camera.heading;super.onControllerStart(R)}_updateFilteredSurfaceElevation(R){this._filteredSurfaceElevation+=(this.view.pointsOfInterest.cameraOnSurface.location.z-this._filteredSurfaceElevation)*R}stepController(R,Q){this._updateStartHeading();this._updateFilteredSurfaceElevation(R);this.currentCamera.copyViewFrom(Q);this._updateCameraCenter();this._constraintOptions.interactionStartCamera?.copyFrom(this.currentCamera);
this._calculateControlTransformation(R,this.currentCamera,P);this._applyDisabledMovementTypes(P);this._applyPan(P.pan);this._applyRotate(P.rotate);this._applyZoom(P.zoom);this._applyAscend(P.ascend);this._constraintOptions.interactionType=y.InteractionType.NONE;this._constraintOptions.selection=x.ConstraintTypes.COLLISION;n.applyAll(this.view,this.currentCamera,this._constraintOptions);super.stepController(R,Q)}_updateStartHeading(){0!==this._transformation.heading&&(this._headingStart=this.view.camera.heading)}_applyRotate(R){if(R.enabled){var Q=
this.currentCamera;g.subtract(M,Q.center,Q.eye);g.transformMat4(M,M,R.matrix);Q.center=g.add(M,M,Q.eye);Q.up=g.transformMat4(M,Q.up,R.matrix);this._constraintOptions.interactionType=y.InteractionType.LOOK_AROUND;this._constraintOptions.selection=x.ConstraintTypes.ALL_EXCEPT_COLLISION;n.applyAll(this.view,Q,this._constraintOptions)}}_applyPan(R,Q=this.currentCamera){R.enabled&&(Q.eye=g.transformMat4(M,Q.eye,R.matrix),Q.center=g.transformMat4(M,Q.center,R.matrix),this.view.state.isGlobal&&(Q.up=g.transformMat4(M,
Q.up,R.matrix)),this._constraintOptions.interactionType=y.InteractionType.PAN,this._constraintOptions.selection=x.ConstraintTypes.ALL,n.applyAll(this.view,Q,this._constraintOptions))}_applyZoom(R){if(R){var Q=this.currentCamera.viewForward;this.currentCamera.eye=g.add(M,this.currentCamera.eye,g.scale(r.sv3d.get(),Q,R));g.copy(K,Q);g.negate(K,K);this._constraintOptions.interactionDirection=K;this._constraintOptions.interactionType=y.InteractionType.ZOOM;this._constraintOptions.selection=x.ConstraintTypes.ALL_EXCEPT_COLLISION;
n.applyAll(this.view,this.currentCamera,this._constraintOptions);this._constraintOptions.interactionDirection=null}}_applyAscend(R){if(R){var Q=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,r.sv3d.get());this._constraintOptions.interactionDirection=g.copy(K,Q);this.view.state.isGlobal?(Q=g.length(this.currentCamera.eye),R=(Q+R)/Q,this.currentCamera.eye=g.scale(M,this.currentCamera.eye,R),this.currentCamera.center=g.scale(M,this.currentCamera.center,R)):(R=g.scale(r.sv3d.get(),
Q,R),this.currentCamera.eye=g.add(M,this.currentCamera.eye,R),this.currentCamera.center=g.add(M,this.currentCamera.center,R));this._updateCameraCenter();this._constraintOptions.interactionType=y.InteractionType.ASCEND;this._constraintOptions.selection=x.ConstraintTypes.COLLISION;n.applyAll(this.view,this.currentCamera,this._constraintOptions)&&this._updateCameraCenter();this._constraintOptions.selection=x.ConstraintTypes.ALL_EXCEPT_COLLISION;n.applyAll(this.view,this.currentCamera,this._constraintOptions);
this._constraintOptions.interactionDirection=null}}_calculateControlTransformation(R,Q,W){W.zoom=0;W.ascend=0;W.pan.enabled=!1;c.identity(W.pan.matrix);W.rotate.enabled=!1;c.identity(W.rotate.matrix);R=this._computeVelocities(R);this.view.state.isLocal?this._calculateControlTransformationLocal(R,Q,W):this._calculateControlTransformationGlobal(R,Q,W)}_updateCameraCenter(){this.currentCamera.center=this.view.renderCoordsHelper.intersectManifoldClosestSilhouette(this.currentCamera.ray,this.view.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,
M)}_calculateControlTransformationLocal(R,Q,W){const {viewRight:S,viewForward:V}=Q,T=this._transformation;var Y=this.view.navigation.gamepad,ha=g.set(r.sv3d.get(),V[0],V[1],0);g.normalize(ha,ha);var ba=T.translation[0]*R.pan;0!==ba&&(ba=g.scale(r.sv3d.get(),S,ba),c.translate(W.pan.matrix,W.pan.matrix,ba),W.pan.enabled=!0);switch(Y.mode){case "pan":Y=-T.translation[1]*R.pan;0!==Y&&(ha=g.scale(r.sv3d.get(),ha,Y),c.translate(W.pan.matrix,W.pan.matrix,ha),W.pan.enabled=!0);W.zoom=T.zoom*R.zoom;break;
case "zoom":W.zoom=(-T.translation[1]+T.zoom)*R.zoom;break;default:q.neverReached(Y.mode)}W.ascend=T.translation[2]*R.ascend;ha=-T.heading*R.rotate;0!==ha&&(c.rotate(W.rotate.matrix,W.rotate.matrix,ha,this.view.renderCoordsHelper.worldUpAtPosition(Q.eye,r.sv3d.get())),W.rotate.enabled=!0);R=T.tilt*R.rotate;Q=D.viewAngle(this.view.renderCoordsHelper,Q.center,Q.eye);if(Q=l.clamp(Q+R,A.TiltRange.min,A.TiltRange.max)-Q)c.rotate(W.rotate.matrix,W.rotate.matrix,Q,S),W.rotate.enabled=!0}_calculateControlTransformationGlobal(R,
Q,W){const {eye:S,viewRight:V}=Q,T=this._transformation;var Y=this.view.navigation.gamepad,ha=g.cross(r.sv3d.get(),V,S);g.normalize(ha,ha);g.negate(ha,ha);C.panMotionToRotationMatrix(this.startCamera,Q,T,R,this.view.camera.heading,this._headingStart,this.view.camera.tilt,W,Y);this._tmpCamera.copyFrom(this.currentCamera);this._applyPan(P.pan,this._tmpCamera);Y=this.view.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude;W.ascend=T.translation[2]*R.ascend;ha=-T.heading*R.rotate;0!==ha&&
(c.rotate(W.rotate.matrix,W.rotate.matrix,ha,this._tmpCamera.eye),W.rotate.enabled=!0);Q=this._clampTiltDeltaGlobalToValidRange(T.tilt*R.rotate,Q.ray,Y);0!==Q&&(c.rotate(W.rotate.matrix,W.rotate.matrix,Q,this._tmpCamera.viewRight),W.rotate.enabled=!0);W.zoom+=T.zoom*R.zoom}_clampTiltDeltaGlobalToValidRange(R,Q,W){const S=t.getReferenceEllipsoid(this.view.spatialReference),V=C.onSurfaceTiltToEyeTiltGlobal(A.TiltRange.min,Q.origin,W,S);var T=0;let Y=0;T=r.sv3d.get();this.view.renderCoordsHelper.intersectManifold(Q,
W,T)?(T=D.viewAngle(this.view.renderCoordsHelper,T,Q.origin),T=C.onSurfaceTiltToEyeTiltGlobal(T,Q.origin,W,S),Y=C.onSurfaceTiltToEyeTiltGlobal(A.TiltRange.max,Q.origin,W,S)):(v.closestPointOnSilhouette(v.fromRadius(v.tmpSphere,W+S.radius),Q,T),T=Math.PI+m.angle(Q.direction,T),T=C.offSurfaceTiltToEyeTiltGlobal(T,Q.origin,W,S),Y=C.offSurfaceTiltToEyeTiltGlobal(A.TiltRange.max,Q.origin,W,S));return l.clamp(T+R,V,Y)-T}_getPointAbsoluteSurfaceElevation(R,Q,W){const {renderCoordsHelper:S}=this.view,V=S.getAltitude(R);
Q+=Math.abs(V-Q);S.setAltitude(W,Q,R);return Q}_clampedDistanceToSurface(R,Q){const {renderCoordsHelper:W}=this.view,{camera:S}=this.view.state;var {direction:V}=F.headingTiltToDirectionUp(this.view,Q,0,80,J);V=W.intersectManifoldClosestSilhouette(w.wrap(Q,V),R,r.sv3d.get());V=g.distance(Q,V);R=W.intersectManifoldClosestSilhouette(w.wrap(Q,g.direction(r.sv3d.get(),Q,S.center)),R,r.sv3d.get());Q=g.distance(Q,R);return Math.min(V,Q)}_computeHeadingRotateRadius(R){const {renderCoordsHelper:Q,state:W}=
this.view,{camera:S,isGlobal:V}=W;var T=Q.intersectManifoldClosestSilhouette(S.ray,this._filteredSurfaceElevation,r.sv3d.get());if(V){const Y=g.subtract(r.sv3d.get(),R,T);T=g.length(Y);g.scale(Y,Y,1/T);R=g.normalize(r.sv3d.get(),R);R=l.acosClamped(g.dot(R,Y));return T*Math.sin(Math.min(I,R))}R=g.copy(r.sv3d.get(),R);Q.setAltitude(R,this._filteredSurfaceElevation);return g.distance(T,R)}_minimumAscendVelocity(){return this.view.state.constraints.collision.enabled?0:5}_computeVelocities(R){var Q=this._filteredSurfaceElevation,
W=Q+t.getReferenceEllipsoid(this.view.spatialReference).radius;const {camera:S,isGlobal:V}=this.view.state;var T=r.sv3d.get();const Y=this._getPointAbsoluteSurfaceElevation(S.eye,Q,T);var ha=this._clampedDistanceToSurface(Q,T);const ba=S.width/2,U=.75*S.width,Z=.75*S.width;var ca=ha*Math.tan(.5*S.fovX)/ba;W=ca/W;T=ca/this._computeHeadingRotateRadius(T);ca=(V?W:ca)*U*R;Q=Y-Q;Q=Math.max(this._minimumAscendVelocity()*R,2**(U*R/ba)*Q-Q);ha=2**(U*R/ba)*ha-ha;R*=l.clamp(T*Z,O,L);return{pan:ca,ascend:Q,
zoom:ha,rotate:R}}_applyDisabledMovementTypes(R){null==this.disableMovements||void 0!==this.disableMovements.mode&&this.view.state.viewingMode!==this.disableMovements.mode||(R.zoom=this.disableMovements.zoom?0:R.zoom,R.ascend=this.disableMovements.ascend?0:R.ascend,R.pan.enabled=!this.disableMovements.pan,this.disableMovements.pan&&c.identity(R.pan.matrix),R.rotate.enabled=!this.disableMovements.rotate,this.disableMovements.rotate&&c.identity(R.rotate.matrix))}static activatesFor(R,Q){R=E.extractTransformation(Q,
R.navigation.gamepad,G);return!("end"===Q.action||E.isZeroTransformation(R))}};b.__decorate([p.property({constructOnly:!0})],a.GamepadKeyboardController.prototype,"gamepadDevice",void 0);b.__decorate([p.property({constructOnly:!0})],a.GamepadKeyboardController.prototype,"disableMovements",void 0);a.GamepadKeyboardController=b.__decorate([f.subclass("esri.views.3d.state.controllers.GamepadKeyboardController")],a.GamepadKeyboardController);const G={translation:[0,0,0],heading:0,tilt:0,zoom:0},I=l.deg2rad(80),
O=l.deg2rad(30),L=l.deg2rad(80),P={zoom:0,ascend:0,pan:{enabled:!1,matrix:e.create()},rotate:{enabled:!1,matrix:e.create()}},M=d.create(),K=d.create(),J=H.createDirectionUp();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/navigation/gamepadAndKeyboardUtils":function(){define(["exports","../../chunks/vec32"],function(a,b){function q(l){let p=l*l;0>l&&(p*=-1);return p}a.extractTransformation=function(l,p,k){const h=l.state;l=l.device;p="forward-down"===p.tiltDirection?1:
-1;"standard"===l.deviceType?(k.translation[0]=q(h.axes[0]),k.translation[1]=q(h.axes[1]),k.translation[2]=q(h.buttons[7])-q(h.buttons[6]),k.heading=q(h.axes[2]),k.tilt=q(h.axes[3])):"spacemouse"===l.deviceType&&(k.translation[0]=1.2*q(h.axes[0]),k.translation[1]=1.2*q(h.axes[1]),k.translation[2]=2*-q(h.axes[2]),k.heading=1.2*q(h.axes[5]),k.tilt=1.2*q(h.axes[3]));k.tilt*=p;b.scale(k.translation,k.translation,1);return k};a.extractTransformationKeyboard=function(l,p){p.translation[0]=l[1]-l[0];p.translation[1]=
l[3]-l[2];p.translation[2]=l[4]-l[5];p.heading=l[7]-l[6];p.tilt=l[8]-l[9];p.zoom=l[10]-l[11];return p};a.isZeroTransformation=function(l){return 0===l.translation[0]&&0===l.translation[1]&&0===l.translation[2]&&0===l.heading&&0===l.tilt&&0===l.zoom};a.resetTransformation=function(l){l.translation[0]=0;l.translation[1]=0;l.translation[2]=0;l.heading=0;l.tilt=0;return l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/KeyboardNavigation":function(){define(["exports",
"../../../ViewingMode","../../state/controllers/GamepadKeyboardController","../../../input/InputHandler","../../../input/VisibilityChange"],function(a,b,q,l,p){var k;(function(f){f[f.LEFT=0]="LEFT";f[f.RIGHT=1]="RIGHT";f[f.FORWARD=2]="FORWARD";f[f.BACKWARD=3]="BACKWARD";f[f.UP=4]="UP";f[f.DOWN=5]="DOWN";f[f.HEADINGLEFT=6]="HEADINGLEFT";f[f.HEADINGRIGHT=7]="HEADINGRIGHT";f[f.TILTUP=8]="TILTUP";f[f.TILTDOWN=9]="TILTDOWN";f[f.ZOOMIN=10]="ZOOMIN";f[f.ZOOMOUT=11]="ZOOMOUT"})(k||={});class h extends l.InputHandler{constructor(f,
c){super(!0);this._view=f;this._disableMovements={pan:!0,zoom:!1,ascend:!0,rotate:!1,mode:b.ViewingMode.Local};this._keyToNumber={[c.left]:k.LEFT,[c.right]:k.RIGHT,[c.forward]:k.FORWARD,[c.backward]:k.BACKWARD,[c.up]:k.UP,[c.down]:k.DOWN,[c.headingLeft]:k.HEADINGLEFT,[c.headingRight]:k.HEADINGRIGHT,[c.tiltUp]:k.TILTUP,[c.tiltDown]:k.TILTDOWN,[c.zoomIn]:k.ZOOMIN,[c.zoomOut]:k.ZOOMOUT};this.registerIncoming("key-down",null,e=>this._handleKeyDown(e));this.registerIncoming("key-up",null,e=>this._handleKeyUp(e));
this.registerIncoming("blur",null,()=>this._handleStop());this._visibilityHandle=p.onVisibilityChange(e=>e?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove();this._handleStop()}_handleKeyDown(f){if(!f.data.native.ctrlKey&&!f.data.native.metaKey){var c=this._keyToNumber[f.data.key];null!=c&&(this._cameraControllerKeyboard&&this._cameraControllerKeyboard.active||(this._cameraControllerKeyboard=new q.GamepadKeyboardController({view:this._view,disableMovements:this._disableMovements}),
this._view.state.switchCameraController(this._cameraControllerKeyboard)),this._cameraControllerKeyboard.active&&(this._cameraControllerKeyboard.activateDirection(c),f.stopPropagation()))}}_handleStop(){this._cameraControllerKeyboard?.active&&(this._cameraControllerKeyboard.finishController(),this._cameraControllerKeyboard=null)}_handleKeyUp(f){if(!f.data.native.ctrlKey&&!f.data.native.metaKey){var c=this._keyToNumber[f.data.key];null!=c&&this._cameraControllerKeyboard?.active&&(this._cameraControllerKeyboard.deactivateDirection(c),
f.stopPropagation())}}}a.KeyboardNavigation=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/VisibilityChange":function(){define(["exports","../../core/handleUtils"],function(a,b){a.onVisibilityChange=function(q){const l=()=>q("visible"===document.visibilityState);document.addEventListener("visibilitychange",l);return b.makeHandle(()=>document.removeEventListener("visibilitychange",l))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/MouseWheelZoom":function(){define(["exports",
"../../../../core/screenUtils","../../state/controllers/ZoomStepControllerGlobal","../../state/controllers/ZoomStepControllerLocal","../../../input/InputHandler"],function(a,b,q,l,p){class k extends p.InputHandler{constructor(h,f){super(!0);this._view=h;this.registerIncoming("mouse-wheel",f,c=>this._handleMouseWheel(c))}_handleMouseWheel(h){if(this._view.navigation.mouseWheelZoomEnabled){var f=h.data;this._cameraController&&this._cameraController.active||(this._cameraController=this._view.state.isGlobal?
new q.ZoomStepControllerGlobal({view:this._view,mode:"interaction"}):new l.ZoomStepControllerLocal({view:this._view,mode:"interaction"}),this._view.state.switchCameraController(this._cameraController));this._cameraController.zoomStep(-1/60*f.deltaY,b.createScreenPointArray(f.x,f.y));h.preventDefault();h.stopPropagation()}}}a.MouseWheelZoom=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/PinchAndPanNavigation":function(){define(["exports","../../state/controllers/PinchAndPanControllerGlobal",
"../../state/controllers/PinchAndPanControllerLocal","../../../input/InputHandler","../../../input/handlers/support"],function(a,b,q,l,p){class k extends l.InputHandler{constructor(h,f,c){super(!0);this._view=h;this.pointerAction=f;this._lastTimestamp=this._lastEndTimestamp=0;this.registerIncoming("drag",c,e=>this._handleDrag(e))}_handleDrag(h){if("mouse"!==h.data.pointerType||p.eventMatchesMousePointerAction(h.data,this.pointerAction)){var f=h.timestamp-this._lastEndTimestamp;f=this._momentum&&this._momentum.active&&
40>f;switch(h.data.action){case "start":case "update":if(f)break;this._controller&&this._controller.active?2<h.data.timestamp-this._lastTimestamp&&(this._controller.update(h.data),this._lastTimestamp=h.timestamp):this._startController(h);break;case "end":case "removed":this._endController(h,!0);break;case "added":this._endController(h,!1),this._startController(h)}h.stopPropagation()}}_endController(h,f){this._controller?.active&&(this._lastEndTimestamp=h.timestamp,h=this._controller.end(h.data),f&&
h&&(this._momentum=h,this._view.state.switchCameraController(this._momentum)));this._controller=null}_startController(h){this._controller=this._createController();this._view.state.switchCameraController(this._controller);this._controller.begin(h.data);this._lastTimestamp=h.timestamp}_createController(){return this._view.state.isGlobal?new b.PinchAndPanControllerGlobal({view:this._view}):new q.PinchAndPanControllerLocal({view:this._view})}}a.PinchAndPanNavigation=k;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/state/controllers/PinchAndPanControllerGlobal":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Cyclical ../../../../core/mathUtils ../../../../core/screenUtils ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/support/axisAngle ../../../../geometry/support/plane ../../../../chunks/sphere ../../camera/constraintUtils ../../camera/constraintUtils/ConstraintOptions ../../camera/constraintUtils/ConstraintTypes ../../camera/constraintUtils/InteractionType ../../input/util ./InteractiveController ./momentum/PanPlanarMomentumController ./momentum/PanSphericalMomentumController ./momentum/RotationMomentumController ./momentum/ZoomPlanarMomentumController ./momentum/ZoomSphericalMomentumController ../utils/navigationUtils ../../webgl/RenderCamera ../../../navigation/PanPlanarMomentumEstimator ../../../navigation/PanSphericalMomentumEstimator ../../../navigation/RotationMomentumEstimator ../../../navigation/ZoomMomentumEstimator".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L){a.PinchAndPanControllerGlobal=class extends A.InteractiveController{constructor(){super(...arguments);this._smoothRotation=new z.ExponentialFalloff(.05);this._rotationAxis=t.create();this._beginHeading=this._beginAngle=0;this._panningPlane=m.create();this._beginRadius=0;this._smoothScaling=new z.ExponentialFalloff(.05);this._zoomCenterScreen=p.createScreenPointArray();this._zoomMomentumEstimator=new L.ZoomMomentumEstimator;
this._rotationMomentumEstimator=new O.RotationMomentumEstimator;this._panSphericalMomentumEstimator=new I.PanSphericalMomentumEstimator;this._panPlanarMomentumEstimator=new G.PanPlanarMomentumEstimator;this._adjustedSphere=r.create();this._tmp3d=t.create();this._tmpScreenPointArray=p.createScreenPointArray();this._beginScreenPoint=p.createScreenPointArray();this._beginScenePoint=t.create();this._screenPickPoint=p.createScreenPointArray();this._scenePickPoint=t.create();this._navMode=N.NavigationMode.Horizontal;
this._sphere=r.create();this._pointerCount=0;this._tmpInteractionDirection=t.create();this._beginCamera=new E;this._constraintOptions=new u.ConstraintOptions(x.ConstraintTypes.ALL,y.InteractionType.NONE,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(P){if(this.active){this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled;
this._beginHeading=-q.cyclicalPI.normalize(l.deg2rad(this.view.camera.heading));this._beginRadius=P.radius;this._pointerCount=P.pointers.size;this._beginAngle=P.angle;this._smoothRotation.reset();p.screenPointObjectToArray(P.center,this._screenPickPoint);g.copy(this._beginScreenPoint,this._screenPickPoint);var M=w.getReferenceEllipsoid(this.view.spatialReference);M=N.pickPointAndInitSphere(this._intersectionHelper,this.startCamera,this._screenPickPoint,M,N.SpherePickPointFallback.Silhouette,0===this.view.map.ground.opacity?
N.contentIntersectorOptions:{});null!=M.scenePickPoint&&(this._scenePickPoint=M.scenePickPoint,this._sphere=M.sphere,d.copy(this._beginScenePoint,this._scenePickPoint),this._navMode=N.navigationMode(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),this._navMode===N.NavigationMode.Vertical&&this._preparePlanarPanMode(P,M.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}}update(P){if(this.active){this.currentCamera.copyFrom(this.startCamera);
var M=1<P.pointers.size;this._navMode===N.NavigationMode.Horizontal?(M&&this._zoomSpherical(P),this._panningSpherical(P),M&&this._rotateSpherical(P)):(M&&this._zoomPlanar(P),this._panningPlanar(P),M&&this._rotatePlanar(P));this.commitCamera()}}end(P){P.pointers.size===this._pointerCount&&this.update(P);this.finishController();if(P=this._zoomMomentumEstimator.evaluateMomentum())return this._navMode===N.NavigationMode.Horizontal?new H.ZoomSphericalMomentumController({view:this.view,momentum:P,screenCenter:this._zoomCenterScreen,
sceneCenter:this._beginScenePoint,radius:this._sphere[3]}):new F.ZoomPlanarMomentumController({view:this.view,momentum:P,zoomCenter:this._beginScenePoint});if(P=this._rotationMomentumEstimator.evaluateMomentum())return new D.RotationMomentumController({view:this.view,momentum:P,center:r.getCenter(this._sphere),axis:this._rotationAxis});if(this._navMode===N.NavigationMode.Horizontal){if(P=this._panSphericalMomentumEstimator.evaluateMomentum())return new C.PanSphericalMomentumController({view:this.view,
momentum:P})}else if(P=this._panPlanarMomentumEstimator.evaluateMomentum())return new B.PanPlanarMomentumController({view:this.view,momentum:P});return null}_preparePlanarPanMode(P,M){var K=d.negate(this._tmp3d,this.startCamera.viewForward);m.fromPositionAndNormal(this._scenePickPoint,K,this._panningPlane);var J=p.createScreenPointArray(this._screenPickPoint[0],0);K=t.create();var R=d.length(this.startCamera.eye);this._adjustedSphere[3]=R<this._sphere[3]?R-100:this._sphere[3];N.sphereOrPlanePointFromScreenPoint(this._adjustedSphere,
this.startCamera,J,K);J=p.createRenderScreenPointArray3();this.startCamera.projectToRenderScreen(K,J);K=t.create();J=t.create();R=t.create();d.subtract(K,this._scenePickPoint,this.currentCamera.eye);const Q=d.length(K);d.normalize(K,K);var W=N.panDistanceModifier*Math.max(Math.abs(this.view.camera.position.z),N.minHeightLimit);const S=this.view._stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,N.screenPixelArea);W=null!=S?S:W;W=
M?Math.min(W,Q):W;d.copy(R,d.add(J,this.currentCamera.eye,d.scale(J,K,W)));this._panningPlane[3]=-d.dot(m.getNormal(this._panningPlane),R);this.startCamera.center=d.add(J,this.startCamera.eye,d.scale(J,this.startCamera.viewForward,W));P=p.screenPointObjectToArray(P.center,this._tmpScreenPointArray);N.intersectPlaneFromScreenPointAtEye(this._panningPlane,this.startCamera,P,this._beginScenePoint)}_zoomSpherical(P){const M=this._beginRadius/P.radius;this._smoothScaling.gain=.001875*Math.min(Math.max(P.radius,
40),120);this._smoothScaling.update(M);N.applyZoomOnSphere(this._sphere,this.currentCamera,this._smoothScaling.value);p.screenPointObjectToArray(P.center,this._zoomCenterScreen);this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*P.timestamp);this._constraintOptions.interactionType=y.InteractionType.ZOOM;this._constraintOptions.interactionFactor=n.pixelDistanceToInteractionFactor(P.radius-this._beginRadius);n.applyAll(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(P){const M=
p.screenPointObjectToArray(P.center,this._tmpScreenPointArray);N.sphereOrPlanePointFromScreenPoint(this._sphere,this.currentCamera,M,this._tmp3d);N.preserveHeadingThreshold(this._beginScenePoint,d.dot(this.currentCamera.up,this._beginScenePoint),this._sphere[3],this._beginHeading,this.view.camera.tilt,this.startCamera)?(N.applyPanSphericalPreserveHeading(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(M,
this._tmp3d,.001*P.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(N.applyPanSphericalDirectRotation(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(M,this._tmp3d,.001*P.timestamp,this.startCamera,this._sphere[3],this.view.camera.tilt));this._constraintOptions.interactionType=y.InteractionType.PAN;this._constraintOptions.interactionFactor=n.pixelDistanceToInteractionFactor(g.distance(this._screenPickPoint,
M));n.applyAll(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(P){d.normalize(this._rotationAxis,this._scenePickPoint);this.currentCamera.aboveGround||d.negate(this._rotationAxis,this._rotationAxis);var M=this._smoothRotation.value,K=N.normalizeRotationDelta(P.angle-M);M+=K;this._smoothRotation.gain=.00125*Math.min(Math.max(P.radius,40),120);this._smoothRotation.update(M);K=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(K,.001*P.timestamp);N.applyRotation(this.currentCamera,
r.getCenter(this._sphere),v.wrapAxisAngle(this._rotationAxis,K));this._constraintOptions.interactionType=y.InteractionType.TUMBLE;this._constraintOptions.interactionFactor=n.pixelDistanceToInteractionFactor(P.radius*M);n.applyAll(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(P){const M=p.screenPointObjectToArray(P.center,this._tmpScreenPointArray);N.intersectPlaneFromScreenPointAtEye(this._panningPlane,this.currentCamera,M,this._tmp3d)&&(N.applyPanPlanar(this.currentCamera,
this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(M,this._tmp3d,.001*P.timestamp),this._constraintOptions.interactionType=y.InteractionType.PAN,this._constraintOptions.interactionFactor=n.pixelDistanceToInteractionFactor(g.distance(this._beginScreenPoint,M)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),n.applyAll(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=
null)}_zoomPlanar(P){const M=this._beginRadius/P.radius;this._smoothScaling.gain=.001875*Math.min(Math.max(P.radius,40),120);this._smoothScaling.update(M);this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*P.timestamp);N.applyZoomToPoint(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance);this._constraintOptions.interactionType=y.InteractionType.ZOOM;this._constraintOptions.interactionFactor=n.pixelDistanceToInteractionFactor(P.radius-
this._beginRadius);n.applyAll(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(P){d.copy(this._rotationAxis,this._beginScenePoint);this.currentCamera.aboveGround||d.negate(this._rotationAxis,this._rotationAxis);var M=this._smoothRotation.value;let K=P.angle-M;K=N.normalizeRotationDelta(K);this._smoothRotation.gain=.00125*Math.min(Math.max(P.radius,40),120);this._smoothRotation.update(M+K);M=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(M,.001*P.timestamp);
N.applyRotation(this.currentCamera,r.getCenter(this._sphere),v.wrapAxisAngle(this._rotationAxis,M));this._constraintOptions.interactionType=y.InteractionType.TUMBLE;this._constraintOptions.interactionFactor=n.pixelDistanceToInteractionFactor(P.radius*M);n.applyAll(this.view,this.currentCamera,this._constraintOptions)}};a.PinchAndPanControllerGlobal=b.__decorate([e.subclass("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],a.PinchAndPanControllerGlobal);Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/input/util":function(){define(["exports"],function(a){class b{constructor(q){this._gain=q}reset(q){this._value=q}set gain(q){this._gain=q}get value(){return void 0===this._value?0:this._value}update(q){this._value=void 0===this._value?q:this._gain*q+(1-this._gain)*this._value}}a.ExponentialFalloff=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/momentum/PanPlanarMomentumController":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../camera/constraintUtils/InteractionType ./MomentumController".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){a.PanPlanarMomentumController=class extends g.MomentumController{constructor(t){super(t);this.interactionType=e.InteractionType.PAN;this._tmpPan=c.create()}momentumStep(t,w){t=this.momentum.value(t);f.scale(this._tmpPan,this.momentum.direction,t);w.eye=f.subtract(d,w.eye,this._tmpPan);w.center=f.subtract(d,w.center,this._tmpPan);this.constraintOptions.interactionDirection=this._tmpPan}};b.__decorate([q.property({constructOnly:!0})],a.PanPlanarMomentumController.prototype,
"momentum",void 0);a.PanPlanarMomentumController=b.__decorate([h.subclass("esri.views.3d.state.controllers.momentum.PanPlanarMomentumController")],a.PanPlanarMomentumController);const d=c.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/momentum/MomentumController":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/Logger ../../../../../core/has ../../../../../core/RandomLCG ../../../../../core/Error ../../../../../core/accessorSupport/decorators/subclass ../../../../ViewAnimation ../../../camera/constraintUtils ../../../camera/constraintUtils/ConstraintOptions ../../../camera/constraintUtils/ConstraintTypes ../../../camera/constraintUtils/InteractionType ../AnimationController ../../../webgl/RenderCamera".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){a.MomentumController=class extends t.AnimationController{constructor(){super(...arguments);this._beginCamera=new w;this._elapsedTimeSec=0;this.constraintOptions=new e.ConstraintOptions(g.ConstraintTypes.ALL,d.InteractionType.PAN,0,this._beginCamera)}initialize(){this.constraintOptions.interactionType=this.interactionType;this.viewAnimation=new f}get steppingFinished(){return this.momentum.isFinished(this._elapsedTimeSec)}onControllerStart(v){this._beginCamera.copyFrom(v);
super.onControllerStart(v)}stepController(v,m){m.copyViewFrom(this._beginCamera);this._elapsedTimeSec+=v;this.momentumStep(this._elapsedTimeSec,m);c.applyAll(this.view,m,this.constraintOptions)}};a.MomentumController=b.__decorate([h.subclass("esri.views.3d.state.controllers.momentum.MomentumController")],a.MomentumController);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/momentum/PanSphericalMomentumController":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../camera/constraintUtils/InteractionType ./MomentumController ../../utils/navigationUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){const t=c.create(),w=c.create();a.PanSphericalMomentumController=class extends g.MomentumController{constructor(v){super(v);this.interactionType=e.InteractionType.PAN}momentumStep(v,m){const r=this.momentum.value1(v);v=this.momentum.value2(v);f.copy(w,m.eye);f.normalize(w,w);f.cross(this.momentum.axis2,w,this.momentum.axis1);d.applyRotationWithTwoAxes(m,t,this.momentum.axis1,r,this.momentum.axis2,v)}};b.__decorate([q.property({constructOnly:!0})],a.PanSphericalMomentumController.prototype,
"momentum",void 0);a.PanSphericalMomentumController=b.__decorate([h.subclass("esri.views.3d.state.controllers.momentum.PanSphericalMomentumController")],a.PanSphericalMomentumController);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/momentum/RotationMomentumController":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../geometry/support/axisAngle ../../../camera/constraintUtils/InteractionType ./MomentumController ../../utils/navigationUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){a.RotationMomentumController=class extends g.MomentumController{set center(t){this._set("center",f.clone(t))}set axis(t){this._set("axis",f.clone(t))}constructor(t){super(t);this.interactionType=e.InteractionType.TUMBLE}momentumStep(t,w){t=this.momentum.value(t);d.applyRotation(w,this.center,c.wrapAxisAngle(this.axis,t))}};b.__decorate([q.property({constructOnly:!0})],a.RotationMomentumController.prototype,"momentum",void 0);b.__decorate([q.property({constructOnly:!0})],
a.RotationMomentumController.prototype,"center",null);b.__decorate([q.property({constructOnly:!0})],a.RotationMomentumController.prototype,"axis",null);a.RotationMomentumController=b.__decorate([h.subclass("esri.views.3d.state.controllers.momentum.RotationMomentumController")],a.RotationMomentumController);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/momentum/ZoomPlanarMomentumController":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../camera/constraintUtils/InteractionType ./MomentumController ../../utils/navigationUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){a.ZoomPlanarMomentumController=class extends g.MomentumController{set zoomCenter(t){this._set("zoomCenter",c.clone(t))}constructor(t){super(t);this.interactionType=e.InteractionType.ZOOM;this.constraintOptions.interactionDirection=c.create()}momentumStep(t,w){const {interactionDirection:v}=this.constraintOptions;v&&(f.copy(v,w.eye),t=this.momentum.valueDelta(0,t),d.applyZoomToPoint(w,this.zoomCenter,t,this.view.state.constraints.minimumPoiDistance),f.direction(v,
w.eye,v))}};b.__decorate([q.property({constructOnly:!0})],a.ZoomPlanarMomentumController.prototype,"momentum",void 0);b.__decorate([q.property({constructOnly:!0})],a.ZoomPlanarMomentumController.prototype,"zoomCenter",null);a.ZoomPlanarMomentumController=b.__decorate([h.subclass("esri.views.3d.state.controllers.momentum.ZoomPlanarMomentumController")],a.ZoomPlanarMomentumController);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/controllers/momentum/ZoomSphericalMomentumController":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/screenUtils ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../geometry/support/axisAngle ../../../../../chunks/sphere ../../../camera/constraintUtils ../../../camera/constraintUtils/InteractionType ./MomentumController ../../utils/navigationUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){a.ZoomSphericalMomentumController=class extends w.MomentumController{set screenCenter(m){this._set("screenCenter",q.createScreenPointArray(m[0],m[1]))}set sceneCenter(m){this._set("sceneCenter",c.clone(m))}constructor(m){super(m);this.interactionType=t.InteractionType.ZOOM;this.radius=0;this._tmpSceneCenter=c.create();this._tmpZoomAxisAngle=e.create();this._sphere=g.create()}initialize(){this._sphere[3]=this.radius}momentumStep(m,r){m=this.momentum.valueDelta(0,
m);v.applyZoomOnSphere(this._sphere,r,m);this.constraintOptions.interactionType=t.InteractionType.ZOOM;d.applyAll(this.view,r,this.constraintOptions);v.sphereOrPlanePointFromScreenPoint(this._sphere,r,this.screenCenter,this._tmpSceneCenter);e.fromPoints(this.sceneCenter,this._tmpSceneCenter,this._tmpZoomAxisAngle);v.applyRotation(r,g.getCenter(this._sphere),this._tmpZoomAxisAngle);this.constraintOptions.interactionType=t.InteractionType.PAN}};b.__decorate([l.property({constructOnly:!0})],a.ZoomSphericalMomentumController.prototype,
"momentum",void 0);b.__decorate([l.property({constructOnly:!0})],a.ZoomSphericalMomentumController.prototype,"screenCenter",null);b.__decorate([l.property({constructOnly:!0})],a.ZoomSphericalMomentumController.prototype,"sceneCenter",null);b.__decorate([l.property({constructOnly:!0})],a.ZoomSphericalMomentumController.prototype,"radius",void 0);a.ZoomSphericalMomentumController=b.__decorate([f.subclass("esri.views.3d.state.controllers.momentum.ZoomSphericalMomentumController")],a.ZoomSphericalMomentumController);
Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/navigation/PanPlanarMomentumEstimator":function(){define(["exports","../../chunks/vec32","../../core/libs/gl-matrix-2/factories/vec3f64","./FilteredFiniteDifference","./Momentum"],function(a,b,q,l,p){class k extends p.Momentum{constructor(f,c,e,g,d){super(f,c,e);this._sceneVelocity=g;this.direction=d}value(f){return super.valueFromInitialVelocity(this._sceneVelocity,f)}}class h{constructor(f=300,c=12,e=.84){this._minimumInitialVelocity=
f;this._stopVelocity=c;this._friction=e;this.enabled=!0;this._time=new l.FilteredFiniteDifference(.6);this._screen=[new l.FilteredFiniteDifference(.4),new l.FilteredFiniteDifference(.4)];this._scene=[new l.FilteredFiniteDifference(.6),new l.FilteredFiniteDifference(.6),new l.FilteredFiniteDifference(.6)];this._tmpDirection=q.create()}add(f,c,e){!this.enabled||this._time.hasLastValue()&&.015>this._time.computeDelta(e)||(this._screen[0].update(f[0]),this._screen[1].update(f[1]),this._scene[0].update(c[0]),
this._scene[1].update(c[1]),this._scene[2].update(c[2]),this._time.update(e))}reset(){this._screen[0].reset();this._screen[1].reset();this._scene[0].reset();this._scene[1].reset();this._scene[2].reset();this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;var f=this._screen[0].filteredDelta,c=this._screen[1].filteredDelta;f=null==f||null==c?0:Math.sqrt(f*f+c*c);c=this._time.filteredDelta;f=null==c||null==f?0:f/c;return Math.abs(f)<
this._minimumInitialVelocity?null:this.createMomentum(f,this._stopVelocity,this._friction)}createMomentum(f,c,e){b.set(this._tmpDirection,this._scene[0].filteredDelta??0,this._scene[1].filteredDelta??0,this._scene[2].filteredDelta??0);const g=b.length(this._tmpDirection);0<g&&b.scale(this._tmpDirection,this._tmpDirection,1/g);const d=this._time.filteredDelta;return new k(f,c,e,null==d?0:g/d,this._tmpDirection)}}a.PanPlanarMomentum=k;a.PanPlanarMomentumEstimator=h;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/navigation/FilteredFiniteDifference":function(){define(["exports"],function(a){class b{constructor(q){this._gain=q;this.filteredDelta=this.lastValue=void 0}update(q){if(this.hasLastValue()){const l=this.computeDelta(q);this._updateDelta(l)}this.lastValue=q}reset(){this.filteredDelta=this.lastValue=void 0}hasLastValue(){return void 0!==this.lastValue}hasFilteredDelta(){return void 0!==this.filteredDelta}computeDelta(q){return void 0===this.lastValue?NaN:q-this.lastValue}_updateDelta(q){this.filteredDelta=
void 0!==this.filteredDelta?(1-this._gain)*this.filteredDelta+this._gain*q:q}}a.FilteredFiniteDifference=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/navigation/Momentum":function(){define(["exports"],function(a){class b{constructor(q,l,p){this._initialVelocity=q;this._stopVelocity=l;this._friction=p;this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this._friction))}get duration(){return this._duration}isFinished(q){return q>
this.duration}get friction(){return this._friction}value(q){return this.valueFromInitialVelocity(this._initialVelocity,q)}valueDelta(q,l){const p=this.value(q);return this.value(q+l)-p}valueFromInitialVelocity(q,l){l=Math.min(l,this.duration);const p=1-this.friction;return q*(p**l-1)/Math.log(p)}}a.Momentum=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/navigation/PanSphericalMomentumEstimator":function(){define("exports ../../core/libs/gl-matrix-2/factories/vec2f64 ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ../3d/state/utils/navigationUtils ./FilteredFiniteDifference ./FilteredValue ./Momentum".split(" "),
function(a,b,q,l,p,k,h,f){class c extends f.Momentum{constructor(g,d,t,w,v,m=0,r){super(g,d,t);this._angularVelocity1=w;this.axis1=v;this.angularVelocity2=m;this.axis2=r}value1(g){return super.valueFromInitialVelocity(this._angularVelocity1,g)}value2(g){return super.valueFromInitialVelocity(this.angularVelocity2,g)}}class e{constructor(g=300,d=12,t=.84){this._minimumInitialVelocity=g;this._stopVelocity=d;this._friction=t;this.enabled=!0;this._tmpAxis1=l.create();this._tmpAxis2=l.create();this._tmpAngles=
b.create();this._time=new k.FilteredFiniteDifference(.3);this._screen=[new k.FilteredFiniteDifference(.4),new k.FilteredFiniteDifference(.4)];this._angle1=new h.FilteredValue(.6);this._angle2=new h.FilteredValue(.6);this._axis1=l.create();this._axis2=l.create();this._lastScene=l.create()}addMomentumDirectRotation(g,d,t,w,v,m){if(this.enabled){if(this._time.hasLastValue()){if(.01>this._time.computeDelta(t))return;w=p.rotationAngleAndAxisDirectRotation(this._lastScene,d,this._tmpAxis2,w,v,m);this._angle2.update(0);
1E-5>q.squaredLength(this._tmpAxis2)?w=0:q.normalize(this._axis1,this._tmpAxis2);this._angle1.update(w);q.copy(this._lastScene,d)}this._screen[0].update(g[0]);this._screen[1].update(g[1]);this._time.update(t)}}addMomentumPreserveHeading(g,d,t,w,v,m,r){if(this.enabled){if(this._time.hasLastValue()){if(.01>this._time.computeDelta(t))return;p.rotationAnglesAndAxesHeadingPreserving(this._lastScene,d,this._tmpAxis2,this._tmpAxis1,this._tmpAngles,w,v,m,r,!1);1E-5>q.squaredLength(this._tmpAxis2)?(this._angle1.update(0),
this._angle2.update(0)):(this._angle1.update(this._tmpAngles[1]),this._angle2.update(this._tmpAngles[0]),q.normalize(this._axis1,this._tmpAxis1),q.normalize(this._axis2,this._tmpAxis2));q.copy(this._lastScene,d)}this._screen[0].update(g[0]);this._screen[1].update(g[1]);this._time.update(t)}}reset(){this._screen[0].reset();this._screen[1].reset();this._angle1.reset();this._angle2.reset();this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta())return null;var g=this._screen[0].filteredDelta,
d=this._screen[1].filteredDelta;g=null==g||null==d?null:Math.sqrt(g*g+d*d);d=this._time.filteredDelta;g=null==g||null==d?0:g/d;return Math.abs(g)<this._minimumInitialVelocity?null:this.createMomentum(g,this._stopVelocity,this._friction)}createMomentum(g,d,t){const w=this._time.filteredDelta,v=this._angle1.filteredValue,m=this._angle2.filteredValue;return new c(g,d,t,null==w||null==v?0:v/w,this._axis1,null==w||null==m?0:m/w,this._axis2)}}a.PanSphericalMomentum=c;a.PanSphericalMomentumEstimator=e;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/navigation/FilteredValue":function(){define(["exports"],function(a){class b{constructor(q){this._gain=q}update(q){this.filteredValue=void 0!==this.filteredValue?(1-this._gain)*this.filteredValue+this._gain*q:q}reset(){this.filteredValue=void 0}get hasFilteredValue(){return void 0!==this.filteredValue}}a.FilteredValue=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/navigation/RotationMomentumEstimator":function(){define(["exports",
"./MomentumEstimator"],function(a,b){class q extends b.MomentumEstimator{constructor(l=3,p=.01,k=.95,h=12){super(l,p,k,h)}add(l,p){const k=this.value.lastValue;if(null!=k){for(l-=k;l>Math.PI;)l-=2*Math.PI;for(;l<-Math.PI;)l+=2*Math.PI;l=k+l}super.add(l,p)}}a.RotationMomentumEstimator=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/navigation/MomentumEstimator":function(){define(["exports","../../core/mathUtils","./FilteredFiniteDifference","./Momentum"],function(a,b,
q,l){class p{constructor(k=2.5,h=.01,f=.95,c=12){this._minimumInitialVelocity=k;this._stopVelocity=h;this._friction=f;this._maxVelocity=c;this.enabled=!0;this.value=new q.FilteredFiniteDifference(.8);this.time=new q.FilteredFiniteDifference(.3)}add(k,h){if(this.enabled&&null!=h){if(this.time.hasLastValue()){if(.01>this.time.computeDelta(h))return;if(this.value.hasFilteredDelta()){const f=this.value.computeDelta(k);0>this.value.filteredDelta*f&&this.value.reset()}}this.time.update(h);this.value.update(k)}}reset(){this.value.reset();
this.time.reset()}evaluateMomentum(){if(!this.enabled||!this.value.hasFilteredDelta()||!this.time.hasFilteredDelta())return null;let k=this.value.filteredDelta/this.time.filteredDelta;k=b.clamp(k,-this._maxVelocity,this._maxVelocity);return Math.abs(k)<this._minimumInitialVelocity?null:this.createMomentum(k,this._stopVelocity,this._friction)}createMomentum(k,h,f){return new l.Momentum(k,h,f)}}a.MomentumEstimator=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/navigation/ZoomMomentumEstimator":function(){define(["exports",
"./Momentum","./MomentumEstimator"],function(a,b,q){class l extends b.Momentum{constructor(k,h,f){super(k,h,f)}value(k){k=super.value(k);return Math.exp(k)}valueDelta(k,h){const f=super.value(k);k=super.value(k+h);return Math.exp(k-f)}}class p extends q.MomentumEstimator{constructor(k=2.5,h=.01,f=.95,c=12){super(k,h,f,c)}add(k,h){super.add(Math.log(k),h)}createMomentum(k,h,f){return new l(k,h,f)}}a.ZoomMomentum=l;a.ZoomMomentumEstimator=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/state/controllers/PinchAndPanControllerLocal":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/screenUtils ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/axisAngle ../../../../geometry/support/plane ../../camera/constraintUtils ../../camera/constraintUtils/ConstraintOptions ../../camera/constraintUtils/ConstraintTypes ../../camera/constraintUtils/InteractionType ../../input/util ../../layers/VoxelWasm ./InteractiveController ./momentum/PanPlanarMomentumController ./momentum/RotationMomentumController ./momentum/ZoomPlanarMomentumController ../utils/navigationUtils ../../webgl/RenderCamera ../../../navigation/PanPlanarMomentumEstimator ../../../navigation/RotationMomentumEstimator ../../../navigation/ZoomMomentumEstimator".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H){const N=g.fromValues(0,0,1);a.PinchAndPanControllerLocal=class extends x.InteractiveController{constructor(){super(...arguments);this._rotationValueSmooth=new n.ExponentialFalloff(.05);this._scalingValueSmooth=new n.ExponentialFalloff(.05);this._planeHorizontal=t.create();this._planeVertical=t.create();this._rotationMomentumEstimator=new F.RotationMomentumEstimator;this._panMomentumEstimator=new D.PanPlanarMomentumEstimator(300,12,
.9);this._zoomMomentumEstimator=new H.ZoomMomentumEstimator;this._beginRadius=0;this._beginCenter=g.create();this._beginAngle=0;this._tmpPoints=[];this._navMode=B.NavigationMode.Horizontal;this._beginCenterScreen=q.createScreenPointArray();this._tmpCentroid3d=g.create();this._tmpCentroid2d=q.createScreenPointArray();this._tmp2d=q.createScreenPointArray();this._pointerCount=0;this._beginCamera=new C;this._constraintOptions=new v.ConstraintOptions(m.ConstraintTypes.ALL,r.InteractionType.NONE,0,this._beginCamera)}begin(E){if(this.active){var G=
this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=G;this._rotationMomentumEstimator.enabled=G;this._panMomentumEstimator.enabled=G;this._beginRadius=E.radius;this._pointerCount=E.pointers.size;this._beginAngle=E.angle;this._rotationValueSmooth.reset();this._scalingValueSmooth.reset();q.screenPointObjectToArray(E.center,this._beginCenterScreen);t.fromNormalAndOffset(N,0,this._planeHorizontal);var I=g.create();G=this._intersectionHelper.intersectScreenFreePointFallback(this._beginCenterScreen,
I,0===this.view.map.ground.opacity?B.contentIntersectorOptions:{});var O=g.create();e.negate(O,this.startCamera.viewForward);var L=g.create();e.copy(L,N);var P=e.dot(O,L);this._navMode=B.navigationMode(this.startCamera,this._beginCenterScreen,this.view.renderCoordsHelper,this.view.viewingMode);var M=Math.min(B.panDistanceModifier,1/Math.abs(e.dot(L,this.startCamera.viewForward)))*Math.max(Math.abs(this.view.camera.position.z),B.minHeightLimit);t.setOffsetFromPoint(this._planeHorizontal,this._planeHorizontal,
I);this.startCamera.aboveGround||t.negate(this._planeHorizontal,this._planeHorizontal);var K=g.create(),J=g.create(),R=g.create();e.subtract(K,I,this.currentCamera.eye);var Q=e.length(K);e.normalize(K,K);this._navMode===B.NavigationMode.Vertical?(e.scale(L,L,P),e.subtract(t.getNormal(this._planeVertical),O,L),e.normalize(t.getNormal(this._planeVertical),t.getNormal(this._planeVertical)),t.setOffsetFromPoint(this._planeVertical,this._planeVertical,I),I=this.view._stage.renderView.getMinimalDepthForArea(u.getVoxelWasm(this.view),
this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,B.screenPixelArea),M=null!=I?I:M,M=G?Math.min(M,Q):M,e.copy(R,e.add(J,this.currentCamera.eye,e.scale(J,K,M))),this._planeVertical[3]=-e.dot(t.getNormal(this._planeVertical),R),this._computePlanePoints(E.pointers,this._planeVertical,this.startCamera,this._tmpPoints)):(e.copy(R,e.add(J,this.currentCamera.eye,e.scale(J,K,G?Q:M))),this._planeHorizontal[3]=-e.dot(t.getNormal(this._planeHorizontal),R),this._computePlanePoints(E.pointers,
this._planeHorizontal,this.startCamera,this._tmpPoints));B.centroid(this._tmpPoints,this._beginCenter);this._beginCamera.copyFrom(this.startCamera)}}update(E){if(this.active){this.currentCamera.copyFrom(this.startCamera);var G=1<E.pointers.size,I=this._navMode===B.NavigationMode.Horizontal?this._planeHorizontal:this._planeVertical,O=this._beginCenter;if(G){const L=this._beginRadius/E.radius;this._scalingValueSmooth.gain=.001875*Math.min(Math.max(E.radius,40),120);this._scalingValueSmooth.update(L);
B.applyZoomToPoint(this.currentCamera,O,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance);this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,.001*E.timestamp);this._constraintOptions.interactionType=r.InteractionType.ZOOM;this._constraintOptions.interactionFactor=w.pixelDistanceToInteractionFactor(Math.abs(E.radius-this._beginRadius));w.applyAll(this.view,this.currentCamera,this._constraintOptions)}this._computePlanePoints(E.pointers,I,this.currentCamera,this._tmpPoints);
B.centroid(this._tmpPoints,this._tmpCentroid3d);q.screenPointObjectToArray(E.center,this._tmpCentroid2d);B.applyPanPlanar(this.currentCamera,O,this._tmpCentroid3d);this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,.001*E.timestamp);this._constraintOptions.interactionType=r.InteractionType.PAN;this._constraintOptions.interactionFactor=w.pixelDistanceToInteractionFactor(c.distance(this._beginCenterScreen,this._tmpCentroid2d));w.applyAll(this.view,this.currentCamera,this._constraintOptions);
G&&(G=this._rotationValueSmooth.value,I=B.normalizeRotationDelta(E.angle-G),this._rotationValueSmooth.gain=.00125*Math.min(Math.max(E.radius,40),120),this._rotationValueSmooth.update(G+I),G=this._rotationValueSmooth.value-this._beginAngle,this._rotationMomentumEstimator.add(G,.001*E.timestamp),I=t.getNormal(this._planeHorizontal),B.applyRotation(this.currentCamera,O,d.wrapAxisAngle(I,G)),this._constraintOptions.interactionType=r.InteractionType.TUMBLE,this._constraintOptions.interactionFactor=w.pixelDistanceToInteractionFactor(Math.abs(E.radius*
G)),w.applyAll(this.view,this.currentCamera,this._constraintOptions));this.commitCamera()}}end(E){E.pointers.size===this._pointerCount&&this.update(E);this.finishController();return(E=this._zoomMomentumEstimator.evaluateMomentum())?new A.ZoomPlanarMomentumController({view:this.view,momentum:E,zoomCenter:this._beginCenter}):(E=this._rotationMomentumEstimator.evaluateMomentum())?new z.RotationMomentumController({view:this.view,momentum:E,center:this._beginCenter,axis:t.getNormal(this._planeHorizontal)}):
(E=this._panMomentumEstimator.evaluateMomentum())?new y.PanPlanarMomentumController({view:this.view,momentum:E}):null}_computePlanePoints(E,G,I,O){O.length=E.size;const L=this._tmp2d;let P=0;E.forEach(M=>{L[0]=M.x;L[1]=M.y;void 0===O[P]&&(O[P]=g.create());B.intersectPlaneFromScreenPointAtEye(G,I,L,O[P]);P+=1});return O}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};a.PinchAndPanControllerLocal=b.__decorate([f.subclass("esri.views.3d.state.controllers.PinchAndPanControllerLocal")],
a.PinchAndPanControllerLocal);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/PointerDownCancelAnimation":function(){define(["exports","../../../input/InputHandler"],function(a,b){class q extends b.InputHandler{constructor(l,p){super(!0);this.view=l;this.registerIncoming("pointer-down",p,()=>this.view.state.stopActiveCameraController())}}a.PointerDownCancelAnimation=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/SingleKeyResetHeading":function(){define(["exports",
"./SingleKey"],function(a,b){class q extends b.SingleKey{constructor(l,p,k){super(p,k);this.view=l}activate(){this.view.goTo({heading:0}).catch(()=>{})}}a.SingleKeyResetHeading=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/SingleKey":function(){define(["exports","../../../input/InputHandler"],function(a,b){class q extends b.InputHandler{constructor(l,p){super(!0);this.key=l;this.registerIncoming("key-down",p,k=>this._handleKeyDown(k))}_handleKeyDown(l){l.data.key===
this.key&&(this.activate(),l.stopPropagation())}}a.SingleKey=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/SingleKeyResetTilt":function(){define(["exports","./SingleKey"],function(a,b){class q extends b.SingleKey{constructor(l,p,k){super(p,k);this.view=l}activate(){this.view.goTo({tilt:0}).catch(()=>{})}}a.SingleKeyResetTilt=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/input/handlers/TwoFingerTilt":function(){define(["exports",
"../../../../core/screenUtils","../../state/controllers/RotateController","../../../input/InputHandler"],function(a,b,q,l){class p extends l.InputHandler{constructor(k,h=!1){super(!0);this._view=k;this._invert=h;this.registerIncoming("vertical-two-finger-drag",f=>this._handleTwoFinger(f))}_handleTwoFinger(k){const h=b.createScreenPointArray(0,k.data.delta*(this._invert?-1:1));switch(k.data.action){case "begin":this._cameraController?.end();this._cameraController=new q.RotateController({view:this._view,
pivot:q.PivotPoint.CENTER});this._view.state.switchCameraController(this._cameraController);this._cameraController.begin(h);break;case "update":this._cameraController?.update(h);break;case "end":this._cameraController?.end(),this._cameraController=null}}}a.TwoFingerTilt=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/BrowserEventSource":function(){define(["exports","../../core/has","../../core/maybe","./gamepad/GamepadSource","../support/screenUtils"],function(a,
b,q,l,p){const k=b("edge"),h=b("chrome"),f=b("ff"),c=b("safari");class e{constructor(d,t){this._input=t;this._active={};this._callback=()=>{};this._activePointerCaptures=new Set;this._keyDownState=new Set;this._eventId=1;this._browserTouchPanningEnabled=!1;this._element=d;d.getAttribute("tabindex")||d.setAttribute("tabindex","0");this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,
"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost};this._updateTouchAction();this._element.addEventListener("keydown",this._preventAltKeyDefault);this._gamepadSource=new l.GamepadSource(d,this._input);this._gamepadSource.onEvent=w=>this._callback("gamepad",w)}destroy(){this._callback=()=>{};this.activeEvents=null;this._activePointerCaptures.forEach(d=>
{this._releasePointerCaptureSafe(d)});this._gamepadSource=q.destroyMaybe(this._gamepadSource);this._activePointerCaptures=null;this._removeTouchAction();this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(d){this._browserTouchPanningEnabled=d;this._updateTouchAction();this._updateTouchEventHandling()}set onEventReceived(d){this._callback=d}set activeEvents(d){for(const t in this._active)d&&
d.has(t)||(this._element.removeEventListener(g[t],this._active[t]),delete this._active[t]);d&&d.forEach(t=>{if(!this._active[t]&&g[t]){const w=(this._eventHandlers[t]||this._handleDefault).bind(this,t);this._element.addEventListener(g[t],w);this._active[t]=w}});this._gamepadSource.hasEventListeners=d?.has("gamepad")??!1}setPointerCapture(d,t){t?this._setPointerCatpureSafe(d.pointerId):(this._releasePointerCaptureSafe(d.pointerId),this._activePointerCaptures.delete(d.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?
"esri-view-surface--touch-none":"esri-view-surface--touch-pan");this._element.classList.add(this._browserTouchPanningEnabled?"esri-view-surface--touch-pan":"esri-view-surface--touch-none")}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove("esri-view-surface--touch-none");this._element.classList.remove("esri-view-surface--touch-pan");
this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(d){try{this._element.setPointerCapture(d),this._activePointerCaptures.add(d)}catch{}}_releasePointerCaptureSafe(d){try{this._element.hasPointerCapture&&!this._element.hasPointerCapture(d)||this._element.releasePointerCapture(d)}catch(t){}}_updateNormalizedPointerLikeEvent(d,t){d=p.createScreenPointFromNativeEvent(this._element,d);e.test.disableSubpixelCoordinates&&(d.x=Math.round(d.x),d.y=Math.round(d.y));
t.x=d.x;t.y=d.y;return t}_handleKey(d,t){const {key:w}=t;w&&"key-up"===d&&this._keyDownState.delete(w);t={native:t,key:w,repeat:!!w&&this._keyDownState.has(w)};w&&"key-down"===d&&this._keyDownState.add(t.key);this._callback(d,t)}_handlePointer(d,t){t=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});this._callback(d,t)}_handlePointerPreventDefault(d,t){const w=this._updateNormalizedPointerLikeEvent(t,{native:t,
x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});t.preventDefault();this._callback(d,w)}_handleMouseWheel(d,t){let w=t.deltaY;switch(t.deltaMode){case 0:k&&(w=w/document.documentElement.clientHeight*600);break;case 1:w*=30;break;case 2:w*=900}k?w*=.7:h||c?w*=.6:f&&(w*=1.375);const v=Math.abs(w);100<v&&(w=w/v*200/(1+Math.exp(-.02*(v-100))));t=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,deltaY:w});this._callback(d,t)}_handlePointerCaptureLost(d,
t){this._activePointerCaptures.delete(t.pointerId);this._handleDefault(d,t)}_handleDefault(d,t){const w={native:t};t.preventDefault();this._callback(d,w)}_preventAltKeyDefault(d){"Alt"===d.key&&d.preventDefault()}_preventMultiTouchPanning(d){1<d.touches.length&&d.preventDefault()}}e.test={disableSubpixelCoordinates:!1};const g={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture",
"pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};a.BrowserEventSource=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/gamepad/GamepadSource":function(){define(["exports","../../../core/scheduling","./GamepadInputDevice","./GamepadState"],function(a,b,q,l){function p(h){const f=window.navigator.getGamepads();for(let e=
0;e<f.length;e++){const g=f[e];var c;a:if((c=g)&&c.connected){for(let d=0;d<c.axes.length;d++)if(isNaN(c.axes[d])){c=!1;break a}c=!0}else c=!1;c&&h(g)}}class k{constructor(h,f){this._element=h;this._input=f;this._hasEventListeners=!1;this._onConnectGamepad=c=>{this._connectGamepad(c.gamepad)};this._onDisconnectGamepad=c=>{c=c.gamepad;const e=c.index,g=this._inputDevices[e];g&&(this._emitGamepadEvent(c,l.extractState(g),!1),this._inputDevices.splice(e,1),this._latestUpdate.splice(e,1),this._input.gamepad.devices.remove(g),
this.ensurePollingState())};this._frameTask=null;this._latestUpdate=[];this._inputDevices=[];this._callback=null;h=window.isSecureContext;if(this.supported="getGamepads"in window.navigator&&h)p(c=>this._connectGamepad(c)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState()}destroy(){this.hasEventListeners=!1;this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),
window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(h){this._hasEventListeners!==h&&(this._hasEventListeners=h,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&0<this._inputDevices.length&&this._hasEventListeners}set onEvent(h){this._callback=h}_connectGamepad(h){const f=new q(h);"unknown"!==f.deviceType&&(this._inputDevices[h.index]=f,this._input.gamepad.devices.add(f));this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?
this._startPolling():this._stopPolling()}_startPolling(){null==this._frameTask&&(this._frameTask=b.addFrameTask({update:()=>this._readGamepadState()}))}_stopPolling(){null!=this._frameTask&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=[])}_readGamepadState(){const h=document.hasFocus(),f=this._element.contains(document.activeElement),c="document"===this._input.gamepad.enabledFocusMode&&!h||"view"===this._input.gamepad.enabledFocusMode&&!f;p(e=>{var g=this._inputDevices[e.index];
if(g){var d=this._latestUpdate[e.index];g=l.extractState(g);var t=c||l.stateIdle(g);d&&(d.timestamp===e.timestamp||!d.active&&t||l.stateEqual(d.state,g))||this._emitGamepadEvent(e,g,!t)}})}_emitGamepadEvent(h,f,c){var e=this._latestUpdate[h.index];if((e=e&&e.active)||c)this._latestUpdate[h.index]={timestamp:h.timestamp,state:f,active:c},this._callback&&this._callback({device:this._inputDevices[h.index],state:f,action:!e&&c?"start":e&&c?"update":"end"})}}a.GamepadSource=k;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/input/gamepad/GamepadState":function(){define(["exports"],function(a){a.extractState=function(b){const q=b.native;return q?{buttons:q.buttons.map(l=>l.pressed?l.value||1:0),axes:q.axes.map(l=>{{var p=b.axisThreshold;const k=Math.abs(l);l=k<p?0:Math.sign(l)*(k-p)/(1-p)}return l})}:{buttons:[],axes:[]}};a.stateEqual=function(b,q){if(b.axes.length!==q.axes.length||b.buttons.length!==q.buttons.length)return!1;for(var l=0;l<b.axes.length;l++)if(b.axes[l]!==q.axes[l])return!1;
for(l=0;l<b.buttons.length;l++)if(b.buttons[l]!==q.buttons[l])return!1;return!0};a.stateIdle=function(b){for(var q=0;q<b.axes.length;q++)if(0!==b.axes[q])return!1;for(q=0;q<b.buttons.length;q++)if(0!==b.buttons[q])return!1;return!0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/handlers/PreventContextMenu":function(){define(["exports","../InputHandler"],function(a,b){class q extends b.InputHandler{constructor(){super(!0);this.registerIncoming("context-menu",l=>
{l.data.native.preventDefault()})}}a.PreventContextMenu=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/recognizers/Drag":function(){define(["exports","../../../core/screenUtils","../../../core/time","../InputHandler","./support"],function(a,b,q,l,p){function k(g){const d=[];g.forEach(t=>{d.push(b.createScreenPoint(t.event.x,t.event.y))});return p.fitCircleLSQ(d)}function h(g){const d=k(g);let t=0;g.forEach(w=>{var v=c(w,d);for(v-=w.lastAngle;v>Math.PI;)v-=2*Math.PI;
for(;v<-Math.PI;)v+=2*Math.PI;v=w.lastAngle+v;w.lastAngle=v;t+=v-w.initialAngle});t/=g.size||1;return{angle:t,radius:d.radius,center:d.center}}function f(g){const d=new Map;g.forEach((t,w)=>d.set(w,t.event));return d}function c(g,d){g=g.event;return Math.atan2(g.y-d.center.y,g.x-d.center.x)}class e extends l.InputHandler{constructor(g){super(!1);this._navigationTouch=g;this._startStateModifiers=new Set;this._activePointerMap=new Map;this._isCurrentDragSuppressed=this._isDragging=!1;this._drag=this.registerOutgoing("drag");
this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this));this.registerIncoming("pointer-up",this._handlePointerUpAndPointerLost.bind(this));this.registerIncoming("pointer-capture-lost",this._handlePointerUpAndPointerLost.bind(this));this.registerIncoming("pointer-cancel",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(g,d,t,w){return{action:g,pointerType:this._pointerType,button:this._mouseButton,buttons:d.buttons,timestamp:w,pointers:f(this._activePointerMap),pointer:d,
angle:t.angle,radius:t.radius,center:t.center}}_addPointer(g){var d=g.native.pointerId;const t=h(this._activePointerMap).angle;g={event:g,initialAngle:0,lastAngle:0};this._activePointerMap.set(d,g);d=c(g,k(this._activePointerMap));g.initialAngle=d;g.lastAngle=d;this._updatePointerAngles(t)}_updatePointer(g){if(!g||null!=g.x||null!=g.y){var d=this._activePointerMap.get(g.native.pointerId);d?d.event=g:this._addPointer(g)}}_removePointer(g){const d=h(this._activePointerMap).angle;this._activePointerMap.delete(g);
this._updatePointerAngles(d)}_updatePointerAngles(g){const d=h(this._activePointerMap);this._activePointerMap.forEach(t=>{t.initialAngle=c(t,d)-g;t.lastAngle=c(t,d)-g})}_emitEvent(g,d,t){const w=h(this._activePointerMap);this._drag.emit(this._createPayload(g,d,w,t),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(g){const d=g.data.native.pointerId,t=q.Milliseconds(g.timestamp);this._activePointerMap.get(d)&&(1===this._activePointerMap.size?(this._updatePointer(g.data),!this._isCurrentDragSuppressed&&
this._emitEvent("end",g.data,t),this._isCurrentDragSuppressed=this._isDragging=!1,this._removePointer(d)):(this._removePointer(d),this._emitEvent("removed",g.data,q.Milliseconds(g.timestamp))))}_handlePointerDrag(g){const d=g.data,t=d.currentEvent,w=q.Milliseconds(g.timestamp);switch(d.action){case "start":case "update":this._isDragging?this._activePointerMap.has(t.native.pointerId)?(this._updatePointer(t),!this._isCurrentDragSuppressed&&this._emitEvent("update",t,w)):(this._addPointer(t),this._emitEvent("added",
t,w),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(t),this._pointerType=g.data.startEvent.pointerType,this._mouseButton=g.data.startEvent.button,this._startStateModifiers=g.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",t,w))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&"touch"===this._pointerType&&1===this._activePointerMap.size}}a.Button=
void 0;(function(g){g[g.Left=0]="Left";g[g.Middle=1]="Middle";g[g.Right=2]="Right";g[g.Back=3]="Back";g[g.Forward=4]="Forward";g[g.Undefined=-1]="Undefined"})(a.Button||(a.Button={}));a.Drag=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/recognizers/support":function(){define(["exports","../../../core/screenUtils"],function(a,b){a.DefaultParameters={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250,
maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};a.euclideanDistance=function(q,l){const p=l.x-q.x;q=l.y-q.y;return Math.sqrt(p*p+q*q)};a.fitCircleLSQ=function(q,l){l?(l.radius=0,l.center.x=0,l.center.y=0):l={radius:0,center:b.createScreenPoint()};if(0===q.length)return l;if(1===q.length)return l.center.x=q[0].x,l.center.y=q[0].y,l;if(2===q.length){const [m,r]=q,[n,u]=[r.x-m.x,r.y-m.y];l.radius=Math.sqrt(n*n+u*u)/2;l.center.x=(m.x+r.x)/2;l.center.y=(m.y+r.y)/
2;return l}let p=0,k=0;for(l=0;l<q.length;l++)p+=q[l].x,k+=q[l].y;p/=q.length;k/=q.length;var h=q.map(m=>m.x-p),f=q.map(m=>m.y-k);let c=l=0;var e=0,g=0,d=0,t=0,w=0;for(var v=0;v<h.length;v++){const m=h[v],r=f[v],n=m*m,u=r*r;l+=n;c+=u;e+=m*r;g+=n*m;d+=u*r;t+=m*u;w+=r*n}h=l;f=e;v=c;g=.5*(g+t);d=.5*(d+w);w=h*v-e*f;t=(g*v-d*f)/w;d=(h*d-e*g)/w;w=b.createScreenPoint(t+p,d+k);return{radius:Math.sqrt(t*t+d*d+(l+c)/q.length),center:w}};a.getPointerId=function(q){({native:q}=q);const {pointerId:l,button:p,
pointerType:k}=q;return"mouse"===k?`${l}:${p}`:`${k}`};a.manhattanDistance=function(q,l){return Math.abs(l.x-q.x)+Math.abs(l.y-q.y)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/recognizers/ImmediateDoubleClick":function(){define(["exports","../../../core/clock","../InputHandler","./support"],function(a,b,q,l){class p extends q.InputHandler{constructor(k=l.DefaultParameters.maximumDoubleClickDelay,h=l.DefaultParameters.maximumDoubleClickDistance,f=l.DefaultParameters.maximumDoubleTouchDelay,
c=l.DefaultParameters.maximumDoubleTouchDistance,e=b.clock){super(!1);this._maximumDoubleClickDelay=k;this._maximumDoubleClickDistance=h;this._maximumDoubleTouchDelay=f;this._maximumDoubleTouchDistance=c;this._clock=e;this._pointerState=new Map;this._immediateDoubleClick=this.registerOutgoing("immediate-double-click");this.registerIncoming("pointer-down",this._handlePointerDown.bind(this));this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach(k=>
{k.immediateDoubleClick&&k.immediateDoubleClick.timeoutHandle.remove()});super.onUninstall()}_handlePointerDown(k){k=k.data;const h=l.getPointerId(k);this._pointerState.has(h)||(this._pointerState.set(h,{downButton:k.native.button,x:k.x,y:k.y,immediateDoubleClick:null}),this.startCapturingPointer(k.native))}_handlePointerUp(k){const h=k.data;var f=l.getPointerId(h);if((f=this._pointerState.get(f))&&f.downButton===h.native.button){const c=f.immediateDoubleClick,e="touch"===k.data.native.pointerType?
this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;c?(c.timeoutHandle.remove(),l.manhattanDistance(c,k.data)>e?this._startImmediateDoubleClick(k,f):(this._immediateDoubleClick.emit(k.data,void 0,c.modifiers),this._removeState(h))):l.manhattanDistance(f,k.data)>e?this._removeState(h):this._startImmediateDoubleClick(k,f)}}_startImmediateDoubleClick(k,h){h.immediateDoubleClick={x:k.data.x,y:k.data.y,modifiers:k.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(k.data),
"touch"===k.data.native.pointerType?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay)}}_removeState(k){const h=l.getPointerId(k);this._pointerState.delete(h);this.stopCapturingPointer(k.native);this.refreshHasPendingInputs()}}a.ImmediateDoubleClick=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/recognizers/PointerClickHoldAndDrag":function(){define(["exports","../../../core/clock","../../../core/maybe","../InputHandler","./support"],function(a,b,q,l,
p){function k(f,c,e){return{action:f,startEvent:c.startEvent,previousEvent:c.previousEvent,currentEvent:e}}class h extends l.InputHandler{constructor(f=p.DefaultParameters.maximumClickDelay,c=p.DefaultParameters.movementUntilMouseDrag,e=p.DefaultParameters.movementUntilPenDrag,g=p.DefaultParameters.movementUntilTouchDrag,d=p.DefaultParameters.holdDelay,t=b.clock){super(!1);this._maximumClickDelay=f;this._movementUntilMouseDrag=c;this._movementUntilPenDrag=e;this._movementUntilTouchDrag=g;this._holdDelay=
d;this._clock=t;this._pointerState=new Map;this._pointerDrag=this.registerOutgoing("pointer-drag");this._immediateClick=this.registerOutgoing("immediate-click");this._pointerHold=this.registerOutgoing("hold");this.registerIncoming("pointer-down",this._handlePointerDown.bind(this));this.registerIncoming("pointer-up",w=>{this._handlePointerLoss(w,"pointer-up")});this.registerIncoming("pointer-capture-lost",w=>{this._handlePointerLoss(w,"pointer-capture-lost")});this.registerIncoming("pointer-cancel",
w=>{this._handlePointerLoss(w,"pointer-cancel")});this._moveHandle=this.registerIncoming("pointer-move",this._handlePointerMove.bind(this));this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(f=>{f.holdTimeout=q.removeMaybe(f.holdTimeout)});super.onUninstall()}_handlePointerDown(f){const c=f.data,e=c.native.pointerId;var g=null;0===this._pointerState.size&&(g=this._clock.setTimeout(()=>{const d=this._pointerState.get(e);d&&(d.isDragging||(this._pointerHold.emit(d.previousEvent,void 0,
f.modifiers),d.holdEmitted=!0),d.holdTimeout=null)},this._holdDelay));g={startEvent:c,previousEvent:c,startTimestamp:f.timestamp,isDragging:!1,downButton:c.native.button,holdTimeout:g,modifiers:new Set};this._pointerState.set(e,g);this.startCapturingPointer(c.native);this._moveHandle.resume();1<this._pointerState.size&&this._startDragging(f)}_handlePointerMove(f){const c=f.data,e=this._pointerState.get(c.native.pointerId);if(e){if(e.isDragging)this._pointerDrag.emit(k("update",e,c),void 0,e.modifiers);
else{const g=p.euclideanDistance(c,e.startEvent),d=this._getDragThreshold(c.native.pointerType);g>d&&this._startDragging(f)}e.previousEvent=c}}_getDragThreshold(f){switch(f){case "touch":return this._movementUntilTouchDrag;case "pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(f){const c=f.data,e=c.native.pointerId;this._pointerState.forEach(g=>{null!=g.holdTimeout&&(g.holdTimeout.remove(),g.holdTimeout=null);g.isDragging||(g.modifiers=f.modifiers,
g.isDragging=!0,e===g.startEvent.native.pointerId?this._pointerDrag.emit(k("start",g,c)):this._pointerDrag.emit(k("start",g,g.previousEvent),f.timestamp))})}_handlePointerLoss(f,c){const e=f.data,g=e.native.pointerId,d=this._pointerState.get(g);d&&(null!=d.holdTimeout&&(d.holdTimeout.remove(),d.holdTimeout=null),d.isDragging?this._pointerDrag.emit(k("end",d,"pointer-up"===c?e:d.previousEvent),void 0,d.modifiers):"pointer-up"===c&&d.downButton===e.native.button&&f.timestamp-d.startTimestamp<=this._maximumClickDelay&&
!d.holdEmitted&&this._immediateClick.emit(e),this._pointerState.delete(g),this.stopCapturingPointer(e.native),0===this._pointerState.size&&this._moveHandle.pause())}}a.PointerClickHoldAndDrag=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/recognizers/SingleAndDoubleClick":function(){define("exports ../../../core/clock ../../../core/MapUtils ../../../core/maybe ../InputHandler ./support".split(" "),function(a,b,q,l,p,k){class h extends p.InputHandler{constructor(f=
k.DefaultParameters.maximumDoubleClickDelay,c=k.DefaultParameters.maximumDoubleClickDistance,e=k.DefaultParameters.maximumDoubleTouchDelay,g=k.DefaultParameters.maximumDoubleTouchDistance,d=b.clock){super(!1);this._maximumDoubleClickDelay=f;this._maximumDoubleClickDistance=c;this._maximumDoubleTouchDelay=e;this._maximumDoubleTouchDistance=g;this._clock=d;this._pointerState=new Map;this._click=this.registerOutgoing("click");this._doubleClick=this.registerOutgoing("double-click");this.registerIncoming("immediate-click",
this._handleImmediateClick.bind(this));this.registerIncoming("pointer-down",this._handlePointerDown.bind(this))}onUninstall(){this._pointerState.forEach(f=>f.doubleClickTimer=l.removeMaybe(f.doubleClickTimer))}get hasPendingInputs(){return q.someMap(this._pointerState,f=>null!=f.doubleClickTimer)}_clearDoubleClickTimer(f,c){const e=this._pointerState.get(f);e&&(e.doubleClickTimer=l.removeMaybe(e.doubleClickTimer),c&&this._click.emit(e.event.data,void 0,e.event.modifiers),this._pointerState.delete(f),
this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(f){const c=this._pointerState.get(f);1===c.pointerDownCount&&this._click.emit(c.event.data,void 0,c.event.modifiers);c.doubleClickTimer=null;this._pointerState.delete(f);this.refreshHasPendingInputs()}_handleImmediateClick(f){const c=f.data;var {pointerType:e}=c.native;const {pointerId:g,pointerType:d,button:t}=c.native;var w="mouse"===d?`${g}:${t}`:`${d}`;if(this._pointerState.has(w)){var v=this._pointerState.get(w),{data:m,modifiers:r}=
v.event;e="touch"===e?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;k.manhattanDistance(m,c)>e?(this._clearDoubleClickTimer(w,!0),this._startClick(f)):(this._clearDoubleClickTimer(w,!1),2===v.pointerDownCount&&this._doubleClick.emit(m,void 0,r))}else this._startClick(f)}_handlePointerDown(f){f=k.getPointerId(f.data);if(f=this._pointerState.get(f))f.pointerDownCount+=1}_startClick(f){var {data:c}=f;const {native:{pointerType:e}}=c,g=k.getPointerId(c);c=this._clock.setTimeout(()=>
this._doubleClickTimeoutExceeded(g),"touch"===e?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay);this._pointerState.set(g,{event:f,doubleClickTimer:c,pointerDownCount:1});this.refreshHasPendingInputs()}}a.SingleAndDoubleClick=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/recognizers/VerticalTwoFingerDrag":function(){define(["exports","../DragEventSeparator","../InputHandler"],function(a,b,q){class l extends q.InputHandler{constructor(p=20,k=40){super(!1);
this._threshold=p;this._maxDelta=k;this._state="ready";this._emittedArtificalEnd2=!1;this._vertical=this.registerOutgoing("vertical-two-finger-drag");this._artificalDrag=this.registerOutgoing("drag");this._dragEventSeparator=new b.DragEventSeparator({start:(h,f)=>this._observeStart(h,f),update:(h,f,c)=>this._observeUpdate(h,f,c),end:(h,f)=>this._observeEnd(f)});this.registerIncoming("drag",h=>this._dragEventSeparator.handle(h))}get failed(){return"failed"===this._state}_observeStart(p,k){1===p&&this._emittedArtificalEnd2&&
(this._emittedArtificalEnd2=!1,this._artificalDrag.emit({action:"start",button:k.data.button,buttons:k.data.buttons,pointerType:k.data.pointerType,timestamp:k.data.timestamp,pointers:k.data.pointers,pointer:k.data.pointer,angle:k.data.angle,radius:k.data.radius,center:k.data.center}),k.stopPropagation());this._state=2===p?"ready":"failed"}_observeUpdate(p,k,h){"failed"!==this._state&&2===p&&("active"===this._state?(this._vertical.emit({delta:k.data.center.y-this._thresholdReachedCenter.y,action:"update"}),
k.stopPropagation()):this._checkMovementWithinLimits(k.data,h.data)?this._checkVerticalThresholdReached(k.data,h.data)&&(this._state="active",this._emittedArtificalEnd2=!0,this._thresholdReachedCenter=k.data.center,this._artificalDrag.emit({action:"end",button:k.data.button,buttons:k.data.buttons,pointerType:k.data.pointerType,timestamp:k.data.timestamp,pointers:k.data.pointers,pointer:k.data.pointer,angle:k.data.angle,radius:k.data.radius,center:k.data.center}),this._vertical.emit({delta:k.data.center.y-
this._thresholdReachedCenter.y,action:"begin"}),k.stopPropagation()):this._state="failed")}_observeEnd(p){"active"===this._state&&(this._vertical.emit({delta:p.data.center.y-this._thresholdReachedCenter.y,action:"end"}),this._state="ready",p.stopPropagation())}_checkMovementWithinLimits(p,k){let h=-Infinity,f=Infinity,c=-Infinity,e=Infinity;for(const {x:v,y:m}of k.pointers.values())h=Math.max(h,v),f=Math.min(f,v),c=Math.max(c,m),e=Math.min(e,m);let g=-Infinity,d=Infinity,t=-Infinity,w=Infinity;for(const {x:v,
y:m}of p.pointers.values())g=Math.max(g,v),d=Math.min(d,v),t=Math.max(t,m),w=Math.min(w,m);return Math.abs(p.center.x-k.center.x)<this._threshold&&Math.abs(g-d-(h-f))<=this._maxDelta&&Math.abs(t-w-(c-e))<=this._maxDelta}_checkVerticalThresholdReached(p,k){let h=Math.abs(p.center.y-k.center.y);p.pointers.forEach((f,c)=>{c=k.pointers.get(c);h=Math.min(h,Math.abs(f.y-c.y))});return h>=this._threshold}}a.VerticalTwoFingerDrag=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/input/DragEventSeparator":function(){define(["exports"],
function(a){class b{constructor(q){this._callbacks=q;this._currentCount=0;this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(q){const l=q.data,p=l.pointers.size;switch(l.action){case "start":this._currentCount=p;this._emitStart(q);break;case "added":this._emitEnd(this._previousEvent);this._currentCount=p;this._emitStart(q);break;case "update":this._emitUpdate(q);break;case "removed":this._startEvent&&this._emitEnd(this._previousEvent);this._currentCount=p;this._emitStart(q);break;
case "end":this._emitEnd(q),this._currentCount=0}this._previousEvent=q}_emitStart(q){this._startEvent=q;this._callbacks.condition?.(this._currentCount,q)&&this._callbacks.start(this._currentCount,q,this._startEvent)}_emitUpdate(q){this._callbacks.condition?.(this._currentCount,q)&&this._callbacks.update(this._currentCount,q,this._startEvent)}_emitEnd(q){this._callbacks.condition?.(this._currentCount,q)&&this._callbacks.end(this._currentCount,q,this._startEvent);this._startEvent=null}}a.DragEventSeparator=
b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/GraphicsDeconflictor":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/MapUtils ../../../../core/maybe ../../../../core/reactiveUtils ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/boundedPlane ./Deconflictor ./enums ./LabelDeconflictor ../../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(n){n=n.layer;return!(!n?.featureReduction||"selection"!==n.featureReduction.type)}function r(n){(n=n.graphics3DGraphics)&&n.forEach(u=>u.setVisibilityFlag(t.VisibilityGroup.GRAPHIC,t.VisibilityFlag.DECONFLICTION,!0))}a.GraphicsDeconflictor=class extends d.Deconflictor{constructor(){super(...arguments);this._contexts=new Map;this.visibilityGroup=t.VisibilityGroup.GRAPHIC;this._marginFactor=-.1;this.test={overrideMarginFactor:n=>{this._marginFactor=
n;this.setDirty()}}}get labels(){return this._labels}get viewState(){return this._viewState}initialize(){this.addHandles([p.watch(()=>this.view?.state?.camera,()=>{this._updateViewState();this.setDirty()}),p.watch(()=>this.view?.map?.ground?.opacity,(n,u)=>{1!==n&&1!==u||this.setDirty()}),p.watch(()=>this.view?.slicePlane,()=>{this._updateSlicePlane();this._slicePlaneChanged()},p.initial)]);this._frameTask=this.view.resourceController.scheduler.registerTask(v.TaskPriority.GRAPHICS_DECONFLICTOR,this);
this._labels=new w.LabelDeconflictor({view:this.view,parent:this})}destroy(){this._labels=l.destroyMaybe(this._labels);this._frameTask=l.removeMaybe(this._frameTask)}get marginFactor(){return this._marginFactor}setDirty(){0<this._contexts.size&&(super.setDirty(),this._labels.setDirty())}runTask(n){super.runTask(n);this.running||this._labels.setDirty()}_updateViewState(){this.view?.state&&(this._viewState.camera.copyFrom(this.view.state.camera),this._updateSlicePlane())}_updateSlicePlane(){const n=
this.view?this.view.slicePlane:null;null!=n&&g.transform(n,this._viewState.camera.viewMatrix,this._viewState.slicePlane);this._viewState.slicePlaneEnabled=null!=n}_slicePlaneChanged(){q.someMap(this._contexts,(n,u)=>u.symbolCreationContext.slicePlaneEnabled)&&this.setDirty()}addGraphicsOwner(n){const u=this._getGraphicsContext(n);return{addGraphic:x=>this._addGraphic(n,u,x),removeGraphic:x=>this._removeGraphic(u,x),labelingInfoChange:()=>this._labels.enabledChanged(n,u),featureReductionChange:()=>
this.enabledChanged(n,u),slicePlaneEnabledChange:()=>this._slicePlaneEnabledChanged(n,u),clear:()=>u.forEach(x=>this._removeGraphic(u,x.graphics3DGraphic)),remove:()=>this._removeGraphicsOwner(n),setDirty:()=>this.setDirty()}}_removeGraphicsOwner(n){const u=this._contexts.get(n);u&&(u.forEach(x=>this._removeGraphic(u,x.graphics3DGraphic)),this._contexts.delete(n),this.setDirty())}_addGraphic(n,u,x){const y=x.graphic.uid,z=new d.DeconflictorGraphic(x,n.symbolCreationContext.slicePlaneEnabled);u.set(y,
z);m(n)&&this.addToActiveGraphics(z);n.labelsEnabled&&this._labels.addToActiveGraphics(z);n=!this._graphicSupportsDeconfliction(x)||!m(n);x.setVisibilityFlag(t.VisibilityGroup.GRAPHIC,t.VisibilityFlag.DECONFLICTION,n)}_removeGraphic(n,u){u=u.graphic.uid;const x=n.get(u);x&&(this.removeFromActiveGraphics(x),this._labels.removeFromActiveGraphics(x),n.delete(u),this.setDirty())}enabledChanged(n,u){const x=m(n);x||r(n);this.modifyGraphics(u,x)}_slicePlaneEnabledChanged(n,u){const x=n.symbolCreationContext.slicePlaneEnabled;
u.forEach(y=>y.slicePlaneEnabled=x);this.setDirty()}getGraphicsLayers(n){return n.layers}_graphicSupportsDeconfliction(n){if(n.isDraped)return!1;n=n.layers;if(!n?.length)return!1;for(const u of n)if(this.layerSupportsDeconfliction(u))return!0;return!1}_getGraphicsContext(n){var u=this._contexts.get(n);if(u)return u;u=new Map;this._contexts.set(n,u);this.setDirty();return u}};a.GraphicsDeconflictor=b.__decorate([e.subclass("esri.views.3d.layers.graphics.GraphicsDeconflictor")],a.GraphicsDeconflictor);
Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Deconflictor":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/mathUtils ../../../../core/PooledArray ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/support/aaBoundingRect ../../../../chunks/boundedPlane ../../../../geometry/support/ray ../../../../chunks/sphere ./deconflictorDebug ./enums ../../webgl/RenderCamera ../../webgl-engine/lib/screenSizePerspectiveUtils ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/HUDMaterial ../../webgl-engine/materials/ScaleInfo".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N){function*E(Z){if(Map.prototype.entries){Z=Z.entries();for(let ca=Z.next();!ca.done;ca=Z.next())yield ca.value[1]}else yield*Z.values()}function*G(Z,ca,ea){ca.clear();Z.forEach((ia,ka)=>{const fa=ca.pushNew();fa.id=ka;fa.visible=ia.graphics3DGraphic.getVisibilityFlag(ea,B.VisibilityFlag.DECONFLICTION);ka=ia.info?.[ea];fa.prio=ia.graphics3DGraphic.deconflictionPriority;fa.distance=ka?ka.distance:Number.MAX_VALUE});yield;const da=ca.iterableSort((ia,
ka)=>ia.prio!==ka.prio?ka.prio-ia.prio:ia.distance!==ka.distance?ia.distance-ka.distance:ia.visible!==ka.visible?ia.visible?-1:1:ia.id-ka.id);for(let ia=da.next();!ia.done;ia=da.next())yield;ca.forAll(ia=>{const ka=Z.get(ia.id);ka&&(Z.delete(ia.id),Z.set(ia.id,ka))});ca.clear()}const I=v.create(),O=r.create(),L=r.create(),P=v.create(),M=d.create(),K=z.create(),J=y.create(),R=v.create(),Q=u.create();class W{constructor(){this.aabr=u.create();this.distance=0;this.visible=this.culled=!1}}class S{constructor(Z,
ca){this.graphics3DGraphic=Z;this.slicePlaneEnabled=ca;this.info={}}}a.State=void 0;(function(Z){Z[Z.Idle=0]="Idle";Z[Z.Process=1]="Process";Z[Z.Sort=2]="Sort";Z[Z.Deconflict=3]="Deconflict";Z[Z.NumStates=4]="NumStates"})(a.State||(a.State={}));class V{constructor(){this.camera=new C;this.slicePlane=x.create();this.slicePlaneEnabled=!1}copyFrom(Z){this.camera.copyFrom(Z.camera);x.copy(Z.slicePlane,this.slicePlane);this.slicePlaneEnabled=Z.slicePlaneEnabled}}a.Deconflictor=class extends q{get dirty(){return this._dirty}get state(){return this._state}constructor(Z){super(Z);
this._dirty=!1;this._viewState=new V;this._state=a.State.Idle;this._active=new Map;this._visible=new Map;this._iterators=new Y;this._accBinsNumX=15;this._accBinsNumY=20;this._accBinsSizeY=this._accBinsSizeX=0;this._accBins=null;this.accNumTests=0}destroy(){this._active.clear();this._visible.clear();this._iterators=null}setDirty(){!this._dirty&&0<this._active.size&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._state!==a.State.Idle||this._dirty}get updatingProgress(){if(!this.updating)return 1;
const Z=this._state/a.State.NumStates;return this._dirty?.5*Z:Z}get running(){return this.view.ready&&null!=this.view.state&&this.updating}runTask(Z){switch(this._state){case a.State.Idle:this._startUpdate(),Z.madeProgress();case a.State.Process:if(this._state=a.State.Process,!this._processActiveGraphics(Z))break;case a.State.Sort:if(this._state=a.State.Sort,!this._sortVisibleGraphics(Z))break;case a.State.Deconflict:if(this._state=a.State.Deconflict,!this._deconflictVisibleGraphics(Z))break;default:A.drawAccelerationStruct(this,
this._visible),this._state=a.State.Idle,this.notifyChange("updating")}}modifyGraphics(Z,ca){ca?Z.forEach(ea=>this.addToActiveGraphics(ea)):Z.forEach(ea=>this.removeFromActiveGraphics(ea));this.setDirty()}layerSupportsDeconfliction(Z){if(null==Z||"object3d"!==Z.type)return!1;Z=Z.stageObject;return 1===(Z?.geometries.length??0)&&Z?.geometries[0]?.material instanceof H.HUDMaterial?!0:!1}_startUpdate(){A.prepare(this.view);this._dirty=!1;this._viewState.copyFrom(this.viewState);const {fullWidth:Z,fullHeight:ca}=
this._viewState.camera;this._initBins(Z,ca);this._resetIterators()}addToActiveGraphics(Z){Z.info[this.visibilityGroup]=new W;this._active.set(Z.graphics3DGraphic.graphic.uid,Z);this.setDirty()}removeFromActiveGraphics(Z){this._visible.delete(Z.graphics3DGraphic.graphic.uid);const ca=Z.graphics3DGraphic;ca.destroyed||ca.setVisibilityFlag(this.visibilityGroup,B.VisibilityFlag.DECONFLICTION,!0);delete Z.info[this.visibilityGroup];this._active.delete(Z.graphics3DGraphic.graphic.uid);this.setDirty()}_processActiveGraphics(Z){const ca=
this._ensureActiveGraphicsIterator(),ea=g.invertOrIdentity(M,this._viewState.camera.projectionMatrix),da="global"===this.view.viewingMode&&1===this.view.map.ground.opacity&&0<this._viewState.camera.relativeElevation?K:null;let ia=0;null!=da&&(w.transformMat4(z.getCenter(da),v.ZEROS,this._viewState.camera.viewMatrix),da[3]=n.getReferenceEllipsoid(this.view.spatialReference).radius,ia=z.distanceToSilhouette(da,v.ZEROS));for(;!Z.done;){Z.madeProgress();var ka=ca.next();if(!0===ka.done)return this._resetActiveGraphicsIterator(),
!0;ka=ka.value;const fa=ka?.info[this.visibilityGroup];fa&&(this._collectGraphics3DGraphics(ka,ea,da,ia),fa.culled?this._visible.delete(ka.graphics3DGraphic.graphic.uid):this._visible.set(ka.graphics3DGraphic.graphic.uid,ka))}return!1}_sortVisibleGraphics(Z){const ca=this._ensureSortGraphicsIterator();for(;!Z.done;){const ea=ca.next();Z.madeProgress();if(!0===ea.done)return this._resetSortGraphicsIterator(),!0}return!1}_deconflictVisibleGraphics(Z){const ca=this._ensureVisibleGraphicsIterator(),ea=
this.visibilityGroup===B.VisibilityGroup.LABEL;for(;!Z.done;){Z.madeProgress();var da=ca.next();if(!0===da.done)return this._resetVisibleGraphicsIterator(),!0;da=da.value;const ka=da.info[this.visibilityGroup];if(!ka||ka.culled)this._setGraphicVisibility(da,!1);else{var ia=da.graphics3DGraphic;ia=!ea||ia.isVisible();ka.visible=ia&&!this._isConflicted(da);ka.visible&&this._addToBins(da);this._setGraphicVisibility(da,ka.visible);A.drawPoly(ka,ka.visible)}}return!1}_resetIterators(){this._iterators.active=
null;this._iterators.visible=null;this._iterators.sort=null}_ensureActiveGraphicsIterator(){this._iterators.active||(this._iterators.active=E(this._active));return this._iterators.active}_resetActiveGraphicsIterator(){this._iterators.active=null}_ensureVisibleGraphicsIterator(){this._iterators.visible||(this._iterators.visible=E(this._visible));return this._iterators.visible}_resetVisibleGraphicsIterator(){this._iterators.visible=null}_ensureSortGraphicsIterator(){this._iterators.sort||(this._iterators.sort=
G(this._visible,this._iterators.sortArray,this.visibilityGroup));return this._iterators.sort}_resetSortGraphicsIterator(){this._iterators.sort=null}_collectGraphics3DGraphics(Z,ca,ea,da){var ia=Z.graphics3DGraphic;if(!ia.destroyed){var ka=Z.info[this.visibilityGroup];if(ia.isVisible(B.VisibilityGroup.GRAPHIC,B.VisibilityFlag.DECONFLICTION)){var fa=this.getGraphicsLayers(ia);u.empty(ka.aabr);ia=null;for(const na of fa)if(this.layerSupportsDeconfliction(na)){fa=na.stageObject.geometries[0].material;
if(null==ia){ia=U;this._getProjectionInfo(na,ca,ia);var X;if(!(X=ia.isOutsideScreen||this._isCulledBySlice(Z,I))&&(X=null!=ea)){X=ia;var ja=ea,la=da;w.copy(J.direction,X.positionView);w.set(J.origin,0,0,0);X=z.intersectRay(ja,J,R)?X.distanceWithoutPolygonOffset>la:!1}if(X){ka.culled=!0;return}}this._expandBoundingRect(ka,na,fa,ia)}null==ia?ka.culled=!0:(ka.distance=ia.distance,ka.culled=!1)}else ka.culled=!0}}_getProjectionInfo(Z,ca,ea){const da=this._viewState.camera;Z=Z.stageObject;var ia=Z.geometries[0];
const ka=ia.material;var fa=z.getCenter(Z.boundingVolumeWorldSpace.bounds);w.transformMat4(I,fa,da.viewMatrix);fa=ia.attributes;ia=fa.get(F.VertexAttribute.NORMAL).data;fa=fa.get(F.VertexAttribute.CENTEROFFSETANDDISTANCE).data;ka.applyShaderOffsetsView(I,ia,Z.transformation,fa,da,ea.scaleInfo,I);m.set(O,I[0],I[1],I[2],1);m.transformMat4(L,O,da.projectionMatrix);w.scale(ea.positionNDC,L,1/L[3]);ka.applyShaderOffsetsNDC(ea.positionNDC,fa,da,ea.positionNDC,P);ea.distanceWithoutPolygonOffset=da.depthNDCToWorld(P[2]);
ea.distance=P[2]===ea.positionNDC[2]?ea.distanceWithoutPolygonOffset:da.depthNDCToWorld(ea.positionNDC[2]);m.set(L,ea.positionNDC[0],ea.positionNDC[1],ea.positionNDC[2],1);m.transformMat4(O,L,ca);m.scale(O,O,1/O[3]);w.set(ea.positionView,I[0],I[1],I[2])}_isCulledBySlice(Z,ca){return Z.slicePlaneEnabled&&this._viewState.slicePlaneEnabled&&x.extrusionContainsPoint(this._viewState.slicePlane,ca)}_expandBoundingRect(Z,ca,ea,{positionNDC:da,scaleInfo:ia}){const ka=this._viewState.camera;ca=ca.getScreenSize(ha);
D.applyPrecomputedScaleFactor(ca,ia.factor,ca);ca[0]*=ka.pixelRatio;ca[1]*=ka.pixelRatio;ea=u.offset(ea.calculateRelativeScreenBounds(ca,ia.factorAlignment.scale,Q),l.lerp(0,ka.fullWidth,.5+.5*da[0]),l.lerp(0,ka.fullHeight,.5+.5*da[1]));da=this.marginFactor;0!==da&&(da*=Math.min(u.width(ea),u.height(ea)),ea[0]-=da,ea[1]-=da,ea[2]+=da,ea[3]+=da);u.expand(Z.aabr,ea,Z.aabr)}_isConflicted(Z){const ca=Z.graphics3DGraphic.graphic.uid;Z=Z.info[this.visibilityGroup];let ea=!0;for(let da=Math.floor(Z.aabr[0]/
this._accBinsSizeX);da<=Math.floor(Z.aabr[2]/this._accBinsSizeX);da++)if(!(0>da||da>=this._accBinsNumX))for(let ia=Math.floor(Z.aabr[1]/this._accBinsSizeY);ia<=Math.floor(Z.aabr[3]/this._accBinsSizeY);ia++){if(0>ia||ia>=this._accBinsNumY)continue;ea=!1;const ka=this._accBins[da][ia];for(let fa=0;fa<ka.length;fa++){const X=ka.data[fa],ja=X.info[this.visibilityGroup];if(ja&&ja.visible&&X.graphics3DGraphic.graphic.uid!==ca&&(this.accNumTests++,u.intersects(ja.aabr,Z.aabr)))return!0}}return ea}_initBins(Z,
ca){if(null==this._accBins){this._accBins=[];for(var ea=0;ea<this._accBinsNumX;ea++){this._accBins.push([]);var da=this._accBins[this._accBins.length-1];for(let ia=0;ia<this._accBinsNumY;ia++)da.push(new p)}}else for(ea=0;ea<this._accBinsNumX;ea++)for(da=0;da<this._accBinsNumY;da++)this._accBins[ea][da].clear();this._accBinsSizeX=Z/this._accBinsNumX;this._accBinsSizeY=ca/this._accBinsNumY;this.accNumTests=0}_addToBins(Z){var ca=Z.info[this.visibilityGroup],ea=Math.floor(ca.aabr[0]/this._accBinsSizeX);
const da=Math.floor(ca.aabr[2]/this._accBinsSizeX),ia=Math.floor(ca.aabr[1]/this._accBinsSizeY);for(ca=Math.floor(ca.aabr[3]/this._accBinsSizeY);ea<=da;ea++)if(!(0>ea||ea>=this._accBinsNumX))for(let ka=ia;ka<=ca;ka++)0>ka||ka>=this._accBinsNumY||this._accBins[ea][ka].push(Z)}_setGraphicVisibility(Z,ca){Z=Z.graphics3DGraphic;Z.destroyed||(Z.setVisibilityFlag(this.visibilityGroup,B.VisibilityFlag.DECONFLICTION,ca),this.visibilityGroup===B.VisibilityGroup.LABEL&&this.view.labeler.setLabelGraphicVisibility(Z,
ca))}};b.__decorate([k.property({constructOnly:!0})],a.Deconflictor.prototype,"view",void 0);b.__decorate([k.property({type:Boolean,readOnly:!0})],a.Deconflictor.prototype,"updating",null);a.Deconflictor=b.__decorate([e.subclass("esri.views.3d.layers.graphics.Deconflictor")],a.Deconflictor);class T{constructor(){this.id=0;this.visible=!1;this.distance=this.prio=0}}class Y{constructor(Z=null,ca=null,ea=null){this.active=Z;this.visible=ca;this.sort=ea;this.sortArray=new p({allocator:da=>da||new T})}}
const ha=t.create();class ba{constructor(){this.positionView=v.create();this.positionNDC=v.create();this.distanceWithoutPolygonOffset=this.distance=0;this.scaleInfo=new N.ScaleInfo}get isOutsideScreen(){const Z=this.positionNDC;return-1>Z[0]||-1>Z[1]||-1>Z[2]||1<=Z[0]||1<=Z[1]}}const U=new ba;a.DeconflictorGraphic=S;a.DeconflictorViewState=V;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/deconflictorDebug":function(){define(["exports","../../support/debugFlags"],
function(a,b){function q(g,d,t,w,v){f&&(f(),f=null);const m=c.height,r=e;r.beginPath();r.lineWidth=1;r.strokeStyle=v;r.moveTo(g,m-t);r.lineTo(d,m-t);r.stroke();r.lineTo(d,m-w);r.stroke();r.lineTo(d,m-t);r.stroke();r.lineTo(g,m-t);r.stroke();r.lineTo(g,m-t);r.stroke();r.closePath()}let l=!1,p=!1,k=!1,h=!1,f=null,c,e;a.drawAccelerationStruct=function(g,d){if(p&&e){f&&(f(),f=null);var t=e,w=0;for(let v=0;v<g.accBinsNumX;v++)for(let m=0;m<g.accBinsNumY;m++){const r=g.accBins[v][g.accBinsNumY-1-m];w+=
r.length;const n=v*g.accBinsSizeX,u=(v+1)*g.accBinsSizeX,x=m*g.accBinsSizeY,y=(m+1)*g.accBinsSizeY;t.fillText(r.length.toFixed(),n+5,x+15);q(n,u,x,y,"blue")}t.fillText("total totalShownLabels: "+w,70,40);t.fillText("total visible labels: "+d.size,70,50);t.fillText("total numTests: "+g.accNumTests,70,30)}};a.drawPoly=function(g,d){l&&(d&&k||!d&&h)&&q(g.aabr[0],g.aabr[2],g.aabr[1],g.aabr[3],d?"green":"red")};a.prepare=function(g){k=b.debugFlags.DECONFLICTOR_SHOW_VISIBLE;h=b.debugFlags.DECONFLICTOR_SHOW_INVISIBLE;
l=k||h;p=b.debugFlags.DECONFLICTOR_SHOW_GRID;f=null;l||p?f=()=>{null==c&&(c=document.createElement("canvas"),c.setAttribute("id","debugCanvas2d"),g.surface.parentElement.style.position="relative",g.surface.parentElement.appendChild(c));var {state:d}=g;const {camera:t,pixelRatio:w}=d,{width:v,height:m}=t;d=m*w;c.setAttribute("width",`${v*w}px`);c.setAttribute("height",`${d}px`);c.setAttribute("style",`position:absolute;left:0px;top:0px;display:block;pointer-events:none;width:${v}px;height:${m}px`);
e=c.getContext("2d");e.clearRect(0,0,v,m);e.font="12px Arial"}:c&&(c.parentElement.removeChild(c),c=null)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/debugFlags":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h,f){q=class extends q{constructor(){super(...arguments);
this.LINE_WIREFRAMES=this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=this.I3S_SHOW_MODIFICATIONS=this.I3S_TREE_SHOW_TILES=this.TERRAIN_TILE_TREE_SHOW_TILES=this.FEATURE_TILE_TREE_SHOW_TILES=this.FEATURE_TILE_FETCH_SHOW_TILES=this.DRAW_MESH_GEOMETRY_NORMALS=this.TESTS_DISABLE_FAST_UPDATES=this.TESTS_DISABLE_OPTIMIZATIONS=this.SHOW_POI=this.OVERLAY_SHOW_CENTER=this.OVERLAY_DRAW_DEBUG_TEXTURE=this.TEXT_SHOW_BORDER=this.TEXT_SHOW_BASELINE=
this.LABELS_SHOW_BORDER=this.DECONFLICTOR_SHOW_GRID=this.DECONFLICTOR_SHOW_INVISIBLE=this.DECONFLICTOR_SHOW_VISIBLE=this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1}};b.__decorate([l.property()],q.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0);b.__decorate([l.property()],q.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0);b.__decorate([l.property()],q.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0);b.__decorate([l.property()],q.prototype,"DECONFLICTOR_SHOW_GRID",void 0);b.__decorate([l.property()],
q.prototype,"LABELS_SHOW_BORDER",void 0);b.__decorate([l.property()],q.prototype,"TEXT_SHOW_BASELINE",void 0);b.__decorate([l.property()],q.prototype,"TEXT_SHOW_BORDER",void 0);b.__decorate([l.property()],q.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0);b.__decorate([l.property()],q.prototype,"OVERLAY_SHOW_CENTER",void 0);b.__decorate([l.property()],q.prototype,"SHOW_POI",void 0);b.__decorate([l.property()],q.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0);b.__decorate([l.property()],q.prototype,
"TESTS_DISABLE_FAST_UPDATES",void 0);b.__decorate([l.property()],q.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0);b.__decorate([l.property()],q.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0);b.__decorate([l.property()],q.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0);b.__decorate([l.property()],q.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0);b.__decorate([l.property()],q.prototype,"I3S_TREE_SHOW_TILES",void 0);b.__decorate([l.property()],q.prototype,"I3S_SHOW_MODIFICATIONS",void 0);b.__decorate([l.property()],
q.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0);b.__decorate([l.property()],q.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0);b.__decorate([l.property()],q.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0);b.__decorate([l.property()],q.prototype,"LINE_WIREFRAMES",void 0);q=b.__decorate([f.subclass("esri.views.3d.support.debugFlags")],q);b=new q;a.debugFlags=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/enums":function(){define(["exports"],
function(a){a.VisibilityFlag=void 0;(function(b){b[b.USER=1]="USER";b[b.SCALE_RANGE=2]="SCALE_RANGE";b[b.FILTER=4]="FILTER";b[b.DECONFLICTION=8]="DECONFLICTION";b[b.ALL_GRAPHIC=15]="ALL_GRAPHIC";b[b.ALL_LABEL=255]="ALL_LABEL"})(a.VisibilityFlag||(a.VisibilityFlag={}));a.VisibilityGroup=void 0;(function(b){b[b.GRAPHIC=1]="GRAPHIC";b[b.LABEL=16]="LABEL"})(a.VisibilityGroup||(a.VisibilityGroup={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/screenSizePerspectiveUtils":function(){define(["exports",
"../../../../core/mathUtils","../../../ViewingMode"],function(a,b,q){function l(e,g,d){d=d.parameters;f.scale=Math.min(d.divisor/(g-d.offset),1);f.factor=Math.abs(e*e*e);return f}function p(e,g){return b.lerp(e*Math.max(g.scale,g.minScaleFactor),e,g.factor)}class k{get minScaleFactor(){return null!=this._fontHeight?Math.min(this._description.minPixelSize/this._fontHeight,1):0}constructor(e,g,d,t={camera:{distance:0,fovY:0},divisor:0,offset:0},w){this._viewingMode=e;this._description=g;this._ellipsoidRadius=
d;this.parameters=t;this._fontHeight=w;this._viewingMode===q.ViewingMode.Local?(this._coverageCompensation=this._surfaceCoverageCompensationLocal,this._calculateCurvatureDependentParameters=this._calculateCurvatureDependentParametersLocal):(this._coverageCompensation=this._surfaceCoverageCompensationGlobal,this._calculateCurvatureDependentParameters=this._calculateCurvatureDependentParametersGlobal)}update(e){if(this.parameters&&this.parameters.camera.fovY===e.fovY&&this.parameters.camera.distance===
e.distance)return!1;this._calculateParameters(e,this._ellipsoidRadius,this.parameters);return!0}overrideFontHeight(e){return e!==this._fontHeight?new k(this._viewingMode,this._description,this._ellipsoidRadius,this.parameters,e):this}_calculateParameters(e,g,d){const {scaleStart:t,scaleFallOffRange:w}=this._description,{fovY:v,distance:m}=e;var r=this._calculateCurvatureDependentParameters(e,g);g=this._coverageCompensation(e,g,r);const {tiltAngle:n,scaleFallOffFactor:u}=r,x=Math.sin(n)*m,y=.5*Math.PI-
n-v*(.5-t*g);r=x/Math.cos(y);g=(r-x/Math.cos(y+v*w*g)*u)/(1-u);d.camera.fovY=e.fovY;d.camera.distance=e.distance;d.offset=g;d.divisor=r-g;return d}_calculateCurvatureDependentParametersLocal(e,g,d=c){d.tiltAngle=this._description.curvatureDependent.min.tiltAngle;d.scaleFallOffFactor=this._description.curvatureDependent.min.scaleFallOffFactor;return d}_calculateCurvatureDependentParametersGlobal(e,g,d=c){const t=this._description.curvatureDependent;e=1+e.distance/g;e=Math.sqrt(e*e-1);const [w,v]=[t.min.curvature,
t.max.curvature];e=b.clamp((e-w)/(v-w),0,1);const [m,r]=[t.min,t.max];d.tiltAngle=b.lerp(m.tiltAngle,r.tiltAngle,e);d.scaleFallOffFactor=b.lerp(m.scaleFallOffFactor,r.scaleFallOffFactor,e);return d}_surfaceCoverageCompensationLocal(e,g,d){return(e.fovY-d.tiltAngle)/e.fovY}_surfaceCoverageCompensationGlobal(e,g,d){const t=g*g;d=d.tiltAngle+.5*Math.PI;const {fovY:w,distance:v}=e;e=v*v+t-2*Math.cos(d)*v*g;const m=Math.sqrt(e);return(Math.acos(Math.sqrt(e-t)/m)-Math.asin(g/(m/Math.sin(d)))+.5*w)/w}}const h=
{curvatureDependent:{min:{curvature:b.deg2rad(10),tiltAngle:b.deg2rad(12),scaleFallOffFactor:.5},max:{curvature:b.deg2rad(70),tiltAngle:b.deg2rad(40),scaleFallOffFactor:.8}},scaleStart:.3,scaleFallOffRange:.65,minPixelSize:0},f={scale:0,factor:0,minScaleFactor:0},c={tiltAngle:0,scaleFallOffFactor:0};a.applyPrecomputedScaleFactor=function(e,g,d=[0,0]){g=Math.min(Math.max(g.scale,g.minScaleFactor),1);d[0]=e[0]*g;d[1]=e[1]*g;return d};a.applyScaleFactor=p;a.getLabelSettings=function(e,g){const {curvatureDependent:d,
scaleStart:t,scaleFallOffRange:w}=h;return new k(e,{curvatureDependent:{min:{curvature:d.min.curvature,tiltAngle:d.min.tiltAngle,scaleFallOffFactor:.7},max:{curvature:d.max.curvature,tiltAngle:d.max.tiltAngle,scaleFallOffFactor:.95}},scaleStart:t,scaleFallOffRange:w,minPixelSize:14},g)};a.getSettings=function(e,g){return new k(e,h,g)};a.precomputeScaleFactor=function(e,g,d,t){e=l(e,g,d);e.minScaleFactor=0;e=p(1,e);t.scale=e;t.factor=0;t.minScaleFactor=d.minScaleFactor};a.scale=function(e,g,d,t){return p(e,
l(g,d,t))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/HUDMaterial":function(){define("exports ../../../../core/has ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../core/libs/gl-matrix-2/types/mat4 ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/buffer/BufferView ../../layers/support/FastSymbolUpdates ../../support/debugFlags ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/hud/HUD.glsl ../lib/GLTextureMaterial ../lib/Material ../lib/RenderSlot ../lib/screenSizePerspectiveUtils ../lib/Util ../lib/VertexAttribute ./ScaleInfo ./internal/bufferWriterUtils ./internal/MaterialUtil ../../../../chunks/HUDMaterial.glsl ../shaders/HUDMaterialTechnique ../shaders/HUDMaterialTechniqueConfiguration".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G){function I(fa,X,ja,la){d.isMat4(X)&&(X=l.fromMat4(V,X));c.transformMat3(la.normal,fa,X);c.transformMat4(la.normal,la.normal,ja.viewInverseTransposeMatrix);la.cosAngle=c.dot(Q,ca);return la}function O(fa,X,ja,la,na,va,za,ya){X=X-na-(0<ya[0]?la[0]*ya[0]:0);let Da=X+la[0]+2*na;ja=ja-na-(0<ya[1]?la[1]*ya[1]:0);na=ja+la[1]+2*na;ya=za.distanceFieldBoundingBox;za.textureIsSignedDistanceField&&null!=ya&&(X+=la[0]*ya[0],ja+=la[1]*ya[1],
Da-=la[0]*(1-ya[2]),na-=la[1]*(1-ya[3]),X-=va,Da+=va,ja-=va,na+=va);return fa[0]>X&&fa[0]<Da&&fa[1]>ja&&fa[1]<na}class L extends y.Material{constructor(fa){super(fa,new ea);this._configuration=new G.HUDMaterialTechniqueConfiguration;this.produces=new Map([[z.RenderSlot.HUD_MATERIAL,X=>n.isColorHighlightOrOID(X)&&!this.parameters.drawInSecondSlot],[z.RenderSlot.LABEL_MATERIAL,X=>n.isColorHighlightOrOID(X)&&this.parameters.drawInSecondSlot],[z.RenderSlot.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],
[z.RenderSlot.DRAPED_MATERIAL,X=>n.isColorHighlightOrOID(X)]])}getConfiguration(fa,X){this._configuration.output=fa;this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset;this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective;this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits;this._configuration.hasPolygonOffset=this.parameters.polygonOffset;this._configuration.draped=
this.parameters.draped;this._configuration.occlusionTestEnabled=this.parameters.occlusionTest;this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled;this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField;this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter;this._configuration.vvSize=!!this.parameters.vvSize;this._configuration.vvColor=!!this.parameters.vvColor;this._configuration.occlusionPass=
X.slot===z.RenderSlot.OCCLUSION_PIXELS&&this.parameters.occlusionTest;fa===n.ShaderOutput.Color&&(this._configuration.debugDrawLabelBorder=!!m.debugFlags.LABELS_SHOW_BORDER);this._configuration.depthEnabled=this.parameters.depthEnabled;this._configuration.transparencyPassType=X.transparencyPassType;this._configuration.multipassEnabled=X.multipassEnabled;this._configuration.cullAboveGround=X.multipassTerrain.cullAboveGround;return this._configuration}intersect(fa,X,ja,la,na,va){if(ja.options.selectionMode&&
ja.options.hud&&fa.visible&&ja.point){la=this.parameters;na=ja.point;var za=ja.camera,{scaleX:ya,scaleY:Da}=this._getScreenScale(fa);ya*=za.pixelRatio;Da*=za.pixelRatio;l.fromMat4(S,X);if(fa.attributes.has(C.VertexAttribute.FEATUREATTRIBUTE)){var ra=S,xa=ra[0],Ma=ra[1],Ga=ra[2],Pa=ra[3],Qa=ra[4],Ea=ra[5],ua=ra[6],Na=ra[7];const Ua=ra[8],wa=1/Math.sqrt(xa*xa+Ma*Ma+Ga*Ga),sa=1/Math.sqrt(Pa*Pa+Qa*Qa+Ea*Ea),Ha=1/Math.sqrt(ua*ua+Na*Na+Ua*Ua);ra[0]=xa*wa;ra[1]=Ma*wa;ra[2]=Ga*wa;ra[3]=Pa*sa;ra[4]=Qa*sa;
ra[5]=Ea*sa;ra[6]=ua*Ha;ra[7]=Na*Ha;ra[8]=Ua*Ha}ra=fa.attributes.get(C.VertexAttribute.POSITION);xa=fa.attributes.get(C.VertexAttribute.SIZE);Ma=fa.attributes.get(C.VertexAttribute.NORMAL);fa=fa.attributes.get(C.VertexAttribute.CENTEROFFSETANDDISTANCE);B.assert(3<=ra.size);Ga=N.calculateAnchorPosForRendering(la);Pa="screen"===this.parameters.centerOffsetUnits;for(Qa=0;Qa<ra.data.length/ra.size;Qa++)Ea=Qa*ra.size,c.set(K,ra.data[Ea],ra.data[Ea+1],ra.data[Ea+2]),c.transformMat4(K,K,X),Ea=Qa*xa.size,
Z[0]=xa.data[Ea]*ya,Z[1]=xa.data[Ea+1]*Da,c.transformMat4(K,K,za.viewMatrix),Ea=Qa*fa.size,c.set(Y,fa.data[Ea],fa.data[Ea+1],fa.data[Ea+2]),Pa||(K[0]+=Y[0],K[1]+=Y[1],0!==Y[2]&&(Ea=Y[2],c.normalize(Y,K),c.subtract(K,K,c.scale(Y,Y,Ea)))),Ea=Qa*Ma.size,c.set(J,Ma.data[Ea],Ma.data[Ea+1],Ma.data[Ea+2]),I(J,S,za,U),this._applyVerticalOffsetTransformationView(K,U,za,M),za.applyProjection(K,R),-1<R[0]&&(Pa&&(Y[0]||Y[1])&&(R[0]+=Y[0]*za.pixelRatio,0!==Y[1]&&(R[1]+=A.applyScaleFactor(Y[1],M.factorAlignment)*
za.pixelRatio),za.unapplyProjection(R,K)),R[0]+=this.parameters.screenOffset[0]*za.pixelRatio,R[1]+=this.parameters.screenOffset[1]*za.pixelRatio,R[0]=Math.floor(R[0]),R[1]=Math.floor(R[1]),A.applyPrecomputedScaleFactor(Z,M.factor,Z),Ea=1*za.pixelRatio,ua=0,la.textureIsSignedDistanceField&&(ua=la.outlineSize*za.pixelRatio/2),O(na,R[0],R[1],Z,Ea,ua,la,Ga)&&(ua=ja.ray,c.transformMat4(W,K,k.invert(T,za.viewMatrix)),R[0]=na[0],R[1]=na[1],za.unprojectFromRenderScreen(R,K)&&(Ea=e.create(),c.copy(Ea,ua.direction),
Na=1/c.length(Ea),c.scale(Ea,Ea,Na),ua=c.distance(ua.origin,K)*Na,va(ua,Ea,-1,!0,1,W))))}}intersectDraped(fa,X,ja,la,na,va){X=fa.attributes.get(C.VertexAttribute.POSITION);ja=fa.attributes.get(C.VertexAttribute.SIZE);const za=this.parameters,ya=N.calculateAnchorPosForRendering(za);let {scaleX:Da,scaleY:ra}=this._getScreenScale(fa);Da*=fa.screenToWorldRatio;ra*=fa.screenToWorldRatio;const xa=2*fa.screenToWorldRatio;for(let Pa=0;Pa<X.data.length/X.size;Pa++){var Ma=Pa*X.size;const Qa=X.data[Ma];Ma=
X.data[Ma+1];var Ga=Pa*ja.size;Z[0]=ja.data[Ga]*Da;Z[1]=ja.data[Ga+1]*ra;Ga=0;za.textureIsSignedDistanceField&&(Ga=za.outlineSize*fa.screenToWorldRatio/2);O(la,Qa,Ma,Z,xa,Ga,za,ya)&&na(va.dist,va.normal,-1,!1)}}createBufferWriter(){return new ka(this)}_updateScaleInfo(fa,X,ja){const la=this.parameters;null!=la.screenSizePerspective?A.precomputeScaleFactor(ja,X,la.screenSizePerspective,fa.factor):(fa.factor.scale=1,fa.factor.factor=0,fa.factor.minScaleFactor=0);null!=la.screenSizePerspectiveAlignment?
A.precomputeScaleFactor(ja,X,la.screenSizePerspectiveAlignment,fa.factorAlignment):(fa.factorAlignment.factor=fa.factor.factor,fa.factorAlignment.scale=fa.factor.scale,fa.factorAlignment.minScaleFactor=fa.factor.minScaleFactor)}applyShaderOffsetsView(fa,X,ja,la,na,va,za){X=I(X,ja,na,U);this._applyVerticalGroundOffsetView(fa,X,na,za);this._applyVerticalOffsetTransformationView(za,X,na,va);this._applyPolygonOffsetView(za,X,la[3],na,za);this._applyCenterOffsetView(za,la,za);return za}applyShaderOffsetsNDC(fa,
X,ja,la,na){this._applyCenterOffsetNDC(fa,X,ja,la);null!=na&&c.copy(na,la);this._applyPolygonOffsetNDC(la,X,ja,la);return la}_applyPolygonOffsetView(fa,X,ja,la,na){var va=la.aboveGround?1:-1;ja=Math.sign(ja);0===ja&&(ja=va);va*=ja;if(0>=this.parameters.shaderPolygonOffset)return c.copy(na,fa);X=q.clamp(Math.abs(X.cosAngle),.01,1);la=1-Math.sqrt(1-X*X)/X/la.viewport[2];0<va?c.scale(na,fa,la):c.scale(na,fa,1/la);return na}_applyVerticalGroundOffsetView(fa,X,ja,la){const na=c.length(fa),va=ja.aboveGround?
1:-1;ja=ja.computeRenderPixelSizeAtDist(na)*u.HUDVerticalPixelOffset;X=c.scale(K,X.normal,va*ja);c.add(la,fa,X);return la}_applyVerticalOffsetTransformationView(fa,X,ja,la){const na=this.parameters;if(!na.verticalOffset?.screenLength){if(na.screenSizePerspective||na.screenSizePerspectiveAlignment){var va=c.length(fa);this._updateScaleInfo(la,va,X.cosAngle)}else la.factor.scale=1,la.factorAlignment.scale=1;return fa}va=c.length(fa);ja=H.verticalOffsetAtDistance(ja,va,na.verticalOffset,X.cosAngle,na.screenSizePerspectiveAlignment??
na.screenSizePerspective);this._updateScaleInfo(la,va,X.cosAngle);c.scale(X.normal,X.normal,ja);return c.add(fa,fa,X.normal)}_applyCenterOffsetView(fa,X,ja){const la="screen"!==this.parameters.centerOffsetUnits;ja!==fa&&c.copy(ja,fa);la&&(ja[0]+=X[0],ja[1]+=X[1],X[2]&&(c.normalize(J,ja),c.add(ja,ja,c.scale(J,J,X[2]))));return ja}_applyCenterOffsetNDC(fa,X,ja,la){const na="screen"!==this.parameters.centerOffsetUnits;la!==fa&&c.copy(la,fa);na||(la[0]+=X[0]/ja.fullWidth*2,la[1]+=X[1]/ja.fullHeight*2);
return la}_applyPolygonOffsetNDC(fa,X,ja,la){const na=this.parameters.shaderPolygonOffset;fa!==la&&c.copy(la,fa);na&&(fa=ja.aboveGround?1:-1,la[2]-=(fa*Math.sign(X[3])||fa)*na);return la}createGLMaterial(fa){return new P(fa)}calculateRelativeScreenBounds(fa,X,ja=t.create()){var la=this.parameters;ja[0]=la.anchorPosition[0]*-fa[0]+la.screenOffset[0]*X;ja[1]=la.anchorPosition[1]*-fa[1]+la.screenOffset[1]*X;ja[2]=ja[0]+fa[0];ja[3]=ja[1]+fa[1];return ja}_getScreenScale(fa){fa=fa.attributes.get(C.VertexAttribute.FEATUREATTRIBUTE);
if(null==fa)return{scaleX:1,scaleY:1};fa=g.fromArray(fa.data,ba);const [X,ja]=v.evaluateModelTransformScale(ha,this.parameters,fa);return{scaleX:X,scaleY:ja}}}class P extends x.GLTextureMaterial{constructor(fa){super({...fa,...fa.material.parameters})}selectProgram(fa){return this.ensureTechnique(E.HUDMaterialTechnique,fa)}beginSlot(fa){this.updateTexture(this._material.parameters.textureId);this._material.setParameters(this.textureBindParameters);return this.selectProgram(fa)}}const M=new D.ScaleInfo,
K=e.create(),J=e.create(),R=g.create(),Q=e.create(),W=e.create(),S=p.create(),V=p.create(),T=h.create(),Y=e.create(),ha=e.create(),ba=g.create(),U={normal:Q,cosAngle:0},Z=[0,0],ca=e.fromValues(0,0,1);class ea extends x.GLTextureMaterialBindParameters{constructor(){super(...arguments);this.renderOccluded=y.RenderOccludedFlag.Occlude;this.isDecoration=!1;this.color=g.fromValues(1,1,1,1);this.texCoordScale=[1,1];this.polygonOffset=!1;this.anchorPosition=f.fromValues(.5,.5);this.screenOffset=[0,0];this.shaderPolygonOffset=
1E-5;this.sampleSignedDistanceFieldTexelCenter=this.textureIsSignedDistanceField=!1;this.outlineColor=g.fromValues(1,1,1,1);this.outlineSize=0;this.vvSizeEnabled=!1;this.vvSymbolRotationMatrix=this.vvSymbolAnchor=this.vvOpacity=this.vvColor=this.vvSize=null;this.hasSlicePlane=!1;this.occlusionTest=this.pixelSnappingEnabled=!0;this.centerOffsetUnits="world";this.drawInSecondSlot=!1;this.depthEnabled=!0;this.draped=!1}}const da=r.newLayout().vec3f(C.VertexAttribute.POSITION).vec3f(C.VertexAttribute.NORMAL).vec2f(C.VertexAttribute.UV0).vec4u8(C.VertexAttribute.COLOR).vec2f(C.VertexAttribute.SIZE).vec4f(C.VertexAttribute.CENTEROFFSETANDDISTANCE).vec4f(C.VertexAttribute.FEATUREATTRIBUTE),
ia=da.clone().vec4u8(C.VertexAttribute.OBJECTANDLAYERIDCOLOR);class ka{constructor(fa){this._material=fa;this.vertexBufferLayout=b("enable-feature:objectAndLayerId-rendering")?ia:da}elementCount(fa){return 6*fa.attributes.get(C.VertexAttribute.POSITION).indices.length}write(fa,X,ja,la,na){F.writePosition(ja.attributes.get(C.VertexAttribute.POSITION),fa,la.position,na,6);F.writeNormal(ja.attributes.get(C.VertexAttribute.NORMAL),X,la.normal,na,6);fa=ja.attributes.get(C.VertexAttribute.UV0).data;var va;
if(null==fa||4>fa.length){fa=this._material.parameters;var za=va=0;var ya=fa.texCoordScale[0];var Da=fa.texCoordScale[1]}else va=fa[0],za=fa[1],ya=fa[2],Da=fa[3];ya=Math.min(1.99999,ya+1);Da=Math.min(1.99999,Da+1);fa=ja.attributes.get(C.VertexAttribute.POSITION).indices.length;X=na;var ra=la.uv0;for(let Ga=0;Ga<fa;++Ga)ra.set(X,0,va),ra.set(X,1,za),X++,ra.set(X,0,ya),ra.set(X,1,za),X++,ra.set(X,0,ya),ra.set(X,1,Da),X++,ra.set(X,0,ya),ra.set(X,1,Da),X++,ra.set(X,0,va),ra.set(X,1,Da),X++,ra.set(X,0,
va),ra.set(X,1,za),X++;F.writeColor(ja.attributes.get(C.VertexAttribute.COLOR),4,la.color,na,6);const {data:xa,indices:Ma}=ja.attributes.get(C.VertexAttribute.SIZE);fa=Ma.length;va=la.size;X=na;for(za=0;za<fa;++za)for(ya=xa[2*Ma[za]],Da=xa[2*Ma[za]+1],ra=0;6>ra;++ra)va.set(X,0,ya),va.set(X,1,Da),X++;ja.attributes.get(C.VertexAttribute.CENTEROFFSETANDDISTANCE)?F.writeBufferVec4(ja.attributes.get(C.VertexAttribute.CENTEROFFSETANDDISTANCE),la.centerOffsetAndDistance,na,6):F.writeBufferVec4Zeros(la.centerOffsetAndDistance,
na,6*fa);ja.attributes.get(C.VertexAttribute.FEATUREATTRIBUTE)?F.writeBufferVec4(ja.attributes.get(C.VertexAttribute.FEATUREATTRIBUTE),la.featureAttribute,na,6):F.writeBufferVec4Zeros(la.featureAttribute,na,6*fa);null!=ja.objectAndLayerIdColor&&(fa=ja.attributes.get(C.VertexAttribute.POSITION)?.indices)&&(fa=fa.length,la=la.getField(C.VertexAttribute.OBJECTANDLAYERIDCOLOR,w.BufferViewVec4u8),F.writeObjectAndLayerIdColor(ja.objectAndLayerIdColor,la,fa,na,6))}}a.HUDMaterial=L;a.Parameters=ea;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/types/mat4":function(){define(["exports"],function(a){function b(l){return l instanceof Float32Array&&16<=l.length}function q(l){return Array.isArray(l)&&16<=l.length}a.isMat4=function(l){return b(l)||q(l)};a.isMat4f32=b;a.isMat4f64=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FastSymbolUpdates":function(){define("exports ../../../../core/has ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../renderers/support/lengthUtils ../../support/debugFlags ../../webgl-engine/core/shaderModules/interfaces".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){function t(S){return null!==S&&void 0!==S}function w(S){return"number"===typeof S}function v(S){return"string"===typeof S}function m(S,V){S&&S.push(V)}function r(S,V,T,Y=h.create()){S=S||0;V=V||0;T=T||0;0!==S&&k.rotateZ(Y,Y,-S/180*Math.PI);0!==V&&k.rotateX(Y,Y,V/180*Math.PI);0!==T&&k.rotateY(Y,Y,T/180*Math.PI);return Y}function n(S,V,T,Y,ha){const ba=S.minSize,U=S.maxSize;if(S.useSymbolValue)return S=Y.symbolSize[T],V.minSize[T]=S,V.maxSize[T]=S,V.offset[T]=V.minSize[T],
V.factor[T]=0,V.type[T]=a.FastSizeType.DefinedSize,!0;if(t(S.field)){if(t(S.stops)){if(2===S.stops.length&&w(S.stops[0].size)&&w(S.stops[1].size))return u(S.stops[0].size,S.stops[1].size,S.stops[0].value,S.stops[1].value,V,T),V.type[T]=a.FastSizeType.DefinedSize,!0;m(ha,"Could not convert size info: stops only supported with 2 elements");return!1}if(w(ba)&&w(U)&&t(S.minDataValue)&&t(S.maxDataValue))return u(ba,U,S.minDataValue,S.maxDataValue,V,T),V.type[T]=a.FastSizeType.DefinedSize,!0;if("unknown"===
S.valueUnit)return m(ha,"Could not convert size info: proportional size not supported"),!1;if(null!=e.meterIn[S.valueUnit])return V.minSize[T]=-Infinity,V.maxSize[T]=Infinity,V.offset[T]=0,V.factor[T]=1/e.meterIn[S.valueUnit],V.type[T]=a.FastSizeType.DefinedSize,!0;m(ha,"Could not convert size info: scale-dependent size not supported");return!1}if(!t(S.field)){if(S.stops?.[0]&&w(S.stops[0].size))return V.minSize[T]=S.stops[0].size,V.maxSize[T]=S.stops[0].size,V.offset[T]=V.minSize[T],V.factor[T]=
0,V.type[T]=a.FastSizeType.DefinedSize,!0;if(w(ba))return V.minSize[T]=ba,V.maxSize[T]=ba,V.offset[T]=ba,V.factor[T]=0,V.type[T]=a.FastSizeType.DefinedSize,!0}m(ha,"Could not convert size info: unsupported variant of sizeInfo");return!1}function u(S,V,T,Y,ha,ba){Y=0<Math.abs(Y-T)?(V-S)/(Y-T):0;ha.minSize[ba]=0<Y?S:V;ha.maxSize[ba]=0<Y?V:S;ha.offset[ba]=S-T*Y;ha.factor[ba]=Y}function x(S,V,T,Y){if(S.normalizationField||S.valueRepresentation)return m(Y,"Could not convert size info: unsupported property"),
null;var ha=S.field;if(null!=ha&&!v(ha))return m(Y,"Could not convert size info: field is not a string"),null;if(!V.size)V.size=new G(S.field);else if(S.field)if(!V.size.field)V.size.field=S.field;else if(S.field!==V.size.field)return m(Y,"Could not convert size info: multiple fields in use"),null;switch(S.axis){case "width":return(ha=n(S,V.size,0,T,Y))?V:null;case "height":return(ha=n(S,V.size,2,T,Y))?V:null;case "depth":return(ha=n(S,V.size,1,T,Y))?V:null;case "width-and-depth":return(ha=n(S,V.size,
0,T,Y))&&n(S,V.size,1,T,Y),ha?V:null;case null:case void 0:case "all":return(ha=(ha=(ha=n(S,V.size,0,T,Y))&&n(S,V.size,1,T,Y))&&n(S,V.size,2,T,Y))?V:null;default:return m(Y,`Could not convert size info: unknown axis "${S.axis}""`),null}}function y(S,V,T){for(let Y=0;3>Y;++Y){let ha=V.unitInMeters;S.type[Y]===a.FastSizeType.DefinedSize&&(ha*=V.modelSize[Y],S.type[Y]=a.FastSizeType.DefinedScale);S.minSize[Y]/=ha;S.maxSize[Y]/=ha;S.offset[Y]/=ha;S.factor[Y]/=ha}if(S.type[0]!==a.FastSizeType.Undefined)V=
0;else if(S.type[1]!==a.FastSizeType.Undefined)V=1;else if(S.type[2]!==a.FastSizeType.Undefined)V=2;else return m(T,"No size axis contains a valid size or scale"),!1;for(T=0;3>T;++T)S.type[T]===a.FastSizeType.Undefined&&(S.minSize[T]=S.minSize[V],S.maxSize[T]=S.maxSize[V],S.offset[T]=S.offset[V],S.factor[T]=S.factor[V],S.type[T]=S.type[V]);return!0}function z(S,V,T){S[4*V]=T.r/255;S[4*V+1]=T.g/255;S[4*V+2]=T.b/255;S[4*V+3]=T.a}function A(S,V,T){if(S.normalizationField)return m(T,"Could not convert color info: unsupported property"),
null;if(v(S.field))if(S.stops){if(8<S.stops.length)return m(T,"Could not convert color info: too many color stops"),null;V.color=new I(S.field);S=S.stops;for(T=0;8>T;++T){const Y=S[Math.min(T,S.length-1)];V.color.values[T]=Y.value;z(V.color.colors,T,Y.color)}}else return m(T,"Could not convert color info: missing stops or colors"),null;else if(S.stops&&0<=S.stops.length)for(S=S.stops&&0<=S.stops.length&&S.stops[0].color,V.color={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},T=0;8>T;T++)V.color.values[T]=Infinity,z(V.color.colors,T,S);else return m(T,"Could not convert color info: no field and no colors/stops"),null;return V}function B(S,V,T){if(S.normalizationField)return m(T,"Could not convert opacity info: unsupported property"),null;if(v(S.field))if(S.stops){if(8<S.stops.length)return m(T,"Could not convert opacity info: too many opacity stops"),null;V.opacity=new O(S.field);S=S.stops;for(T=0;8>T;++T){const Y=S[Math.min(T,
S.length-1)];V.opacity.values[T]=Y.value;V.opacity.opacityValues[T]=Y.opacity}}else return m(T,"Could not convert opacity info: missing stops or opacities"),null;else if(S.stops&&0<=S.stops.length)for(S=S.stops&&0<=S.stops.length?S.stops[0].opacity:0,V.opacity={field:null,values:[0,0,0,0,0,0,0,0],opacityValues:[0,0,0,0,0,0,0,0]},T=0;8>T;T++)V.opacity.values[T]=Infinity,V.opacity.opacityValues[T]=S;else return m(T,"Could not convert opacity info: no field and no opacities/stops"),null;return V}function C(S,
V,T){S=2===T&&"arithmetic"===S.rotationType;V.offset[T]=S?90:0;V.factor[T]=S?-1:1;V.type[T]=1}function D(S,V,T){if(!v(S.field))return m(T,"Could not convert rotation info: field is not a string"),null;if(!V.rotation)V.rotation={field:S.field,offset:[0,0,0],factor:[1,1,1],type:[0,0,0]};else if(S.field)if(!V.rotation.field)V.rotation.field=S.field;else if(S.field!==V.rotation.field)return m(T,"Could not convert rotation info: multiple fields in use"),null;switch(S.axis){case "tilt":return C(S,V.rotation,
0),V;case "roll":return C(S,V.rotation,1),V;case null:case void 0:case "heading":return C(S,V.rotation,2),V;default:return m(T,`Could not convert rotation info: unknown axis "${S.axis}""`),null}}function F(S,V,T){if(!S)return null;const Y=S.reduce((ha,ba)=>{if(!ha)return ha;if(ba.valueExpression)return m(T,"Could not convert visual variables: arcade expressions not supported"),null;switch(ba.type){case "size":return V.supports.size?x(ba,ha,V,T):ha;case "color":return V.supports.color?A(ba,ha,T):ha;
case "opacity":return V.supports.opacity?B(ba,ha,T):null;case "rotation":return V.supports.rotation?D(ba,ha,T):ha;default:return null}},new P);return 0<S.length&&Y&&!Y.size&&!Y.color&&!Y.opacity&&!Y.rotation||Y?.size&&!y(Y.size,V,T)?null:Y}function H(S,V,T){if(!!S!==!!V||S&&S.field!==V?.field)return!1;if(S&&"rotation"===T)for(T=0;3>T;T++)if(S.type[T]!==V.type[T]||S.offset[T]!==V.offset[T]||S.factor[T]!==V.factor[T])return!1;return!0}function N(S,V){S=new J(S);S.vvSize&&(S.vvSymbolAnchor=V.anchor,
k.identity(W),r(V.rotation[2],V.rotation[0],V.rotation[1],W),S.vvSymbolRotationMatrix=S.vvSymbolRotationMatrix||p.create(),l.fromMat4(S.vvSymbolRotationMatrix,W));return S}a.FastSizeType=void 0;(function(S){S[S.Undefined=0]="Undefined";S[S.DefinedSize=1]="DefinedSize";S[S.DefinedScale=2]="DefinedScale"})(a.FastSizeType||(a.FastSizeType={}));a.FastRotationType=void 0;(function(S){S[S.Undefined=0]="Undefined";S[S.DefinedAngle=1]="DefinedAngle"})(a.FastRotationType||(a.FastRotationType={}));class E{constructor(S){this.field=
S}}class G extends E{constructor(S){super(S);this.minSize=[0,0,0];this.maxSize=[0,0,0];this.offset=[0,0,0];this.factor=[0,0,0];this.type=[a.FastSizeType.Undefined,a.FastSizeType.Undefined,a.FastSizeType.Undefined]}}class I extends E{constructor(S){super(S);this.colors=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.values=[0,0,0,0,0,0,0,0]}}class O extends E{constructor(S){super(S);this.values=[0,0,0,0,0,0,0,0];this.opacityValues=[0,0,0,0,0,0,0,0]}}class L extends E{constructor(S){super(S);
this.offset=[0,0,0];this.factor=[1,1,1];this.type=[0,0,0]}}class P{}class M{constructor(S,V=[1,1,1],T=[1,1,1],Y=1,ha=[0,0,0],ba=[1,1,1],U=[0,0,0]){this.supports=S;this.modelSize=V;this.symbolSize=T;this.unitInMeters=Y;this.anchor=ha;this.scale=ba;this.rotation=U}}class K{constructor(S,V,T){this.visualVariables=S;this.materialParameters=V;this.requiresShaderTransformation=T}}class J extends d.NoParameters{constructor(S){super();this.vvSize=S?.size??null;this.vvColor=S?.color??null;this.vvOpacity=S?.opacity??
null}}const R=h.create(),Q=c.create(),W=h.create();a.ConvertOptions=M;a.FastColorInfo=I;a.FastOpacityInfo=O;a.FastRotationInfo=L;a.FastSizeInfo=G;a.FastSymbolUpdatesState=K;a.FastVisualVariables=P;a.VisualVariablesParameters=J;a.convertVisualVariables=F;a.evaluateModelTransform=function(S,V,T){if(!S.vvSize)return T;k.copy(R,T);T=S.vvSymbolRotationMatrix;k.set(W,T[0],T[1],T[2],0,T[3],T[4],T[5],0,T[6],T[7],T[8],0,0,0,0,1);k.multiply(R,R,W);for(T=0;3>T;++T)Q[T]=q.clamp(S.vvSize.offset[T]+V[0]*S.vvSize.factor[T],
S.vvSize.minSize[T],S.vvSize.maxSize[T]);k.scale(R,R,Q);k.translate(R,R,S.vvSymbolAnchor);return R};a.evaluateModelTransformScale=function(S,V,T){if(!V.vvSize)return f.set(S,1,1,1),S;for(let Y=0;3>Y;++Y)S[Y]=q.clamp(V.vvSize.offset[Y]+T[0]*V.vvSize.factor[Y],V.vvSize.minSize[Y],V.vvSize.maxSize[Y]);return S};a.getAttributeValue=function(S,V){S=null==S?0:V.attributes[S];return"number"===typeof S&&isFinite(S)?S:0};a.getMaterialParameters=N;a.initFastSymbolUpdatesState=function(S,V){return!S||g.debugFlags.TESTS_DISABLE_FAST_UPDATES?
null:(S=F(S.visualVariables,V))?new K(S,N(S,V),!!S.size):null};a.updateFastSymbolUpdatesState=function(S,V,T){if(!V||!S)return!1;const Y=S.visualVariables;V=F(V.visualVariables,T);if(!(V&&H(Y.size,V.size,"size")&&H(Y.color,V.color,"color")&&H(Y.rotation,V.rotation,"rotation")&&H(Y.opacity,V.opacity,"opacity")))return!1;S.visualVariables=V;S.materialParameters=N(V,T);S.requiresShaderTransformation=!!V.size;return!0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl":function(){define("exports ../attributes/VerticalOffset.glsl ../util/ScreenSizePerspective.glsl ../util/View.glsl ../../shaderModules/Float4PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../../lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f){a.HUD=function(c,e){c.include(q.ScreenSizePerspective);c.attributes.add(f.VertexAttribute.POSITION,"vec3");c.attributes.add(f.VertexAttribute.NORMAL,"vec3");c.attributes.add(f.VertexAttribute.CENTEROFFSETANDDISTANCE,"vec4");c=c.vertex;l.addProjViewLocalOrigin(c,e);l.addCameraPosition(c,e);c.uniforms.add(new p.Float4PassUniform("viewport",(g,d)=>d.camera.fullViewport),new k.FloatPassUniform("polygonOffset",g=>g.shaderPolygonOffset),new k.FloatPassUniform("cameraGroundRelative",
(g,d)=>d.camera.aboveGround?1:-1));e.hasVerticalOffset&&b.addVerticalOffset(c);c.constants.add("smallOffsetAngle","float",.984807753012208);c.code.add(h.glsl`struct ProjectHUDAux {
vec3 posModel;
vec3 posView;
vec3 vnormal;
float distanceToCamera;
float absCosAngle;
};`);c.code.add(h.glsl`
float applyHUDViewDependentPolygonOffset(float pointGroundDistance, float absCosAngle, inout vec3 posView) {
float pointGroundSign = ${e.multipassEnabled?h.glsl.float(0):h.glsl`sign(pointGroundDistance)`};
if (pointGroundSign == 0.0) {
pointGroundSign = cameraGroundRelative;
}
// cameraGroundRelative is -1 if camera is below ground, 1 if above ground
// groundRelative is 1 if both camera and symbol are on the same side of the ground, -1 otherwise
float groundRelative = cameraGroundRelative * pointGroundSign;
// view angle dependent part of polygon offset emulation: we take the absolute value because the sign that is
// dropped is instead introduced using the ground-relative position of the symbol and the camera
if (polygonOffset > .0) {
float cosAlpha = clamp(absCosAngle, 0.01, 1.0);
float tanAlpha = sqrt(1.0 - cosAlpha * cosAlpha) / cosAlpha;
float factor = (1.0 - tanAlpha / viewport[2]);
// same side of the terrain
if (groundRelative > 0.0) {
posView *= factor;
}
// opposite sides of the terrain
else {
posView /= factor;
}
}
return groundRelative;
}
`);e.draped&&!e.hasVerticalOffset||l.addViewNormal(c);e.draped||(c.uniforms.add(new k.FloatPassUniform("perDistancePixelRatio",(g,d)=>Math.tan(d.camera.fovY/2)/(d.camera.fullViewport[2]/2))),c.code.add(h.glsl`
void applyHUDVerticalGroundOffset(vec3 normalModel, inout vec3 posModel, inout vec3 posView) {
float distanceToCamera = length(posView);
// Compute offset in world units for a half pixel shift
float pixelOffset = distanceToCamera * perDistancePixelRatio * ${h.glsl.float(.5)};
// Apply offset along normal in the direction away from the ground surface
vec3 modelOffset = normalModel * cameraGroundRelative * pixelOffset;
// Apply the same offset also on the view space position
vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz;
posModel += modelOffset;
posView += viewOffset;
}
`));e.screenCenterOffsetUnitsEnabled&&l.addPixelRatio(c);e.hasScreenSizePerspective&&q.addScreenSizePerspectiveAlignment(c);c.code.add(h.glsl`
vec4 projectPositionHUD(out ProjectHUDAux aux) {
vec3 centerOffset = centerOffsetAndDistance.xyz;
float pointGroundDistance = centerOffsetAndDistance.w;
aux.posModel = position;
aux.posView = (view * vec4(aux.posModel, 1.0)).xyz;
aux.vnormal = normal;
${e.draped?"":"applyHUDVerticalGroundOffset(aux.vnormal, aux.posModel, aux.posView);"}
// Screen sized offset in world space, used for example for line callouts
// Note: keep this implementation in sync with the CPU implementation, see
// - MaterialUtil.verticalOffsetAtDistance
// - HUDMaterial.applyVerticalOffsetTransformation
aux.distanceToCamera = length(aux.posView);
vec3 viewDirObjSpace = normalize(cameraPosition - aux.posModel);
float cosAngle = dot(aux.vnormal, viewDirObjSpace);
aux.absCosAngle = abs(cosAngle);
${e.hasScreenSizePerspective?e.hasVerticalOffset||e.screenCenterOffsetUnitsEnabled?"vec3 perspectiveFactor \x3d screenSizePerspectiveScaleFactor(aux.absCosAngle, aux.distanceToCamera, screenSizePerspectiveAlignment);":"":""}
${e.hasVerticalOffset?e.hasScreenSizePerspective?"float verticalOffsetScreenHeight \x3d applyScreenSizePerspectiveScaleFactorFloat(verticalOffset.x, perspectiveFactor);":"float verticalOffsetScreenHeight \x3d verticalOffset.x;":""}
${e.hasVerticalOffset?h.glsl`
float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * aux.distanceToCamera, verticalOffset.z, verticalOffset.w);
vec3 modelOffset = aux.vnormal * worldOffset;
aux.posModel += modelOffset;
vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz;
aux.posView += viewOffset;
// Since we elevate the object, we need to take that into account
// in the distance to ground
pointGroundDistance += worldOffset;`:""}
float groundRelative = applyHUDViewDependentPolygonOffset(pointGroundDistance, aux.absCosAngle, aux.posView);
${e.screenCenterOffsetUnitsEnabled?"":h.glsl`
// Apply x/y in view space, but z in screen space (i.e. along posView direction)
aux.posView += vec3(centerOffset.x, centerOffset.y, 0.0);
// Same material all have same z != 0.0 condition so should not lead to
// branch fragmentation and will save a normalization if it's not needed
if (centerOffset.z != 0.0) {
aux.posView -= normalize(aux.posView) * centerOffset.z;
}
`}
vec4 posProj = proj * vec4(aux.posView, 1.0);
${e.screenCenterOffsetUnitsEnabled?e.hasScreenSizePerspective?"float centerOffsetY \x3d applyScreenSizePerspectiveScaleFactorFloat(centerOffset.y, perspectiveFactor);":"float centerOffsetY \x3d centerOffset.y;":""}
${e.screenCenterOffsetUnitsEnabled?"posProj.xy +\x3d vec2(centerOffset.x, centerOffsetY) * pixelRatio * 2.0 / viewport.zw * posProj.w;":""}
// constant part of polygon offset emulation
posProj.z -= groundRelative * polygonOffset * posProj.w;
return posProj;
}
`)};a.HUDVerticalPixelOffset=.5;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl":function(){define("exports ../../../../../../chunks/vec42 ../../../../../../core/libs/gl-matrix-2/factories/vec4f64 ../util/ScreenSizePerspective.glsl ../util/View.glsl ../../shaderModules/Float4PassUniform ../../shaderModules/interfaces".split(" "),function(a,b,q,l,p,k,h){function f(e){e.uniforms.add(new k.Float4PassUniform("verticalOffset",
(g,d)=>{const {minWorldLength:t,maxWorldLength:w,screenLength:v}=g.verticalOffset;return b.set(c,v*(d.camera.pixelRatio||1),Math.tan(.5*d.camera.fovY)/(.5*d.camera.fullViewport[3]),t,w)}))}const c=q.create();a.VerticalOffset=function(e,g){const d=e.vertex;g.hasVerticalOffset?(f(d),g.hasScreenSizePerspective&&(e.include(l.ScreenSizePerspective),l.addScreenSizePerspectiveAlignment(d),p.addCameraPosition(e.vertex,g)),d.code.add(h.glsl`
vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
${g.spherical?h.glsl`vec3 worldNormal = normalize(worldPos + localOrigin);`:h.glsl`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
${g.hasScreenSizePerspective?h.glsl`
float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:h.glsl`
float verticalOffsetScreenHeight = verticalOffset.x;`}
// Screen sized offset in world space, used for example for line callouts
float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
return worldNormal * worldOffset;
}
vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
return worldPos + calculateVerticalOffset(worldPos, localOrigin);
}
`)):d.code.add(h.glsl`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)};a.addVerticalOffset=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl":function(){define(["exports","../../../../../../chunks/vec32","../../../../../../core/libs/gl-matrix-2/factories/vec3f64","../../shaderModules/Float3PassUniform","../../shaderModules/interfaces"],function(a,b,q,l,p){function k(f){return b.set(h,
f.parameters.divisor,f.parameters.offset,f.minScaleFactor)}const h=q.create();a.ScreenSizePerspective=function(f){f.vertex.code.add(p.glsl`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
return absCosAngle * absCosAngle * absCosAngle;
}`);f.vertex.code.add(p.glsl`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) {
return vec3(
min(params.x / (distanceToCamera - params.y), 1.0),
screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
params.z
);
}`);f.vertex.code.add(p.glsl`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) {
return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
}`);f.vertex.code.add(p.glsl`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) {
return applyScreenSizePerspectiveScaleFactorFloat(
size,
screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
);
}`);f.vertex.code.add(p.glsl`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) {
return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
}`);f.vertex.code.add(p.glsl`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
}`)};a.addScreenSizePerspective=function(f){f.uniforms.add(new l.Float3PassUniform("screenSizePerspective",c=>k(c.screenSizePerspective)))};a.addScreenSizePerspectiveAlignment=function(f){f.uniforms.add(new l.Float3PassUniform("screenSizePerspectiveAlignment",c=>k(c.screenSizePerspectiveAlignment||c.screenSizePerspective)))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Material":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../core/shaderModules/interfaces ./AnimationTimer ./basicInterfaces ./ContentObject ./ContentObjectType ./DefaultVertexAttributeLocations ../materials/internal/MaterialUtil".split(" "),
function(a,b,q,l,p,k,h,f,c){class e extends k.ContentObject{constructor(t,w){super();this.type=h.ContentObjectType.Material;this.supportsEdges=!1;this._visible=!0;this._renderPriority=0;this._vertexAttributeLocations=f.Default3D;this._pp0=b.fromValues(0,0,1);this._pp1=b.fromValues(0,0,0);this._parameters=c.copyParameters(t,w);this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(t){return!1}setParameters(t,w=!0){c.updateParameters(this._parameters,t)&&(this.validateParameters(this._parameters),
w&&this.parametersChanged())}validateParameters(t){}get visible(){return this._visible}set visible(t){t!==this._visible&&(this._visible=t,this.parametersChanged())}shouldRender(t){return this.isVisible()&&this.isVisibleForOutput(t.output)&&(!this.parameters.isDecoration||t.bindParameters.decorations===p.Decorations.ON)&&0!==(this.parameters.renderOccluded&t.renderOccludedMask)}isVisibleForOutput(t){return!0}get renderPriority(){return this._renderPriority}set renderPriority(t){t!==this._renderPriority&&
(this._renderPriority=t,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(t){return this.isVisible()&&this.parameters.renderOccluded===t}intersectDraped(t,w,v,m,r,n){this._pp0[0]=this._pp1[0]=m[0];this._pp0[1]=this._pp1[1]=m[1];return this.intersect(t,w,v,this._pp0,this._pp1,r)}}class g extends l.Parameters{constructor(t,w,v){super(w,v);
this.camera=t}}a.RenderOccludedFlag=void 0;(function(t){t[t.None=0]="None";t[t.Occlude=1]="Occlude";t[t.Transparent=2]="Transparent";t[t.OccludeAndTransparent=4]="OccludeAndTransparent";t[t.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil";t[t.Opaque=16]="Opaque"})(a.RenderOccludedFlag||(a.RenderOccludedFlag={}));class d extends q.NoParameters{constructor(){super(...arguments);this.renderOccluded=a.RenderOccludedFlag.Occlude;this.isDecoration=!1}}a.Material=e;a.MaterialParameters=d;a.UpdateParameters=
g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/internal/MaterialUtil":function(){define(["exports","../../../../../core/arrayUtils","../../../../../core/mathUtils","../../lib/screenSizePerspectiveUtils"],function(a,b,q,l){function p(h,f){f=f?p(f):{};for(const c in h){let e=h[c];e?.forEach&&(e=k(e));null==e&&c in f||(f[c]=e)}return f}function k(h){const f=[];h.forEach(c=>f.push(c));return f}a.colorMixModes={multiply:1,ignore:2,replace:3,tint:4};
a.copyParameters=p;a.updateParameters=function(h,f){let c=!1;for(const e in f){const g=f[e];void 0!==g&&(Array.isArray(g)?null===h[e]?(h[e]=g.slice(),c=!0):b.update(h[e],g)&&(c=!0):h[e]!==g&&(c=!0,h[e]=g))}return c};a.verticalOffsetAtDistance=function(h,f,c,e,g){let d=(c.screenLength||0)*h.pixelRatio;null!=g&&(d=l.scale(d,e,f,g));return q.clamp(d*Math.tan(.5*h.fovY)/(.5*h.fullHeight)*f,c.minWorldLength||0,null!=c.maxWorldLength?c.maxWorldLength:Infinity)};Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/webgl-engine/materials/ScaleInfo":function(){define(["exports"],function(a){class b{constructor(){this.factor=new q;this.factorAlignment=new q}}class q{constructor(){this.minScaleFactor=this.factor=this.scale=0}}a.ScaleFactor=q;a.ScaleInfo=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/internal/bufferWriterUtils":function(){define(["exports","../../../../../core/libs/gl-matrix-2/math/mat4","../../../../../geometry/support/buffer/BufferView",
"../../lib/Util","../../lib/VertexAttribute"],function(a,b,q,l,p){function k(m,r,n){const {data:u,indices:x}=m;m=r.typedBuffer;r=r.typedBufferStride;const y=x.length;n*=r;for(let z=0;z<y;++z){const A=2*x[z];m[n]=u[A];m[n+1]=u[A+1];n+=r}}function h(m,r,n,u){const {data:x,indices:y}=m;m=r.typedBuffer;r=r.typedBufferStride;const z=y.length;n*=r;if(null==u||1===u)for(u=0;u<z;++u){var A=3*y[u];m[n]=x[A];m[n+1]=x[A+1];m[n+2]=x[A+2];n+=r}else for(A=0;A<z;++A){const B=3*y[A];for(let C=0;C<u;++C)m[n]=x[B],
m[n+1]=x[B+1],m[n+2]=x[B+2],n+=r}}function f(m,r,n,u=1){const {data:x,indices:y}=m;m=r.typedBuffer;r=r.typedBufferStride;const z=y.length;n*=r;if(1===u)for(u=0;u<z;++u){var A=4*y[u];m[n]=x[A];m[n+1]=x[A+1];m[n+2]=x[A+2];m[n+3]=x[A+3];n+=r}else for(A=0;A<z;++A){const B=4*y[A];for(let C=0;C<u;++C)m[n]=x[B],m[n+1]=x[B+1],m[n+2]=x[B+2],m[n+3]=x[B+3],n+=r}}function c(m,r,n,u,x=1){if(r){var {data:y,indices:z}=m;m=n.typedBuffer;n=n.typedBufferStride;var A=z.length,B=r[0],C=r[1],D=r[2],F=r[4],H=r[5],N=r[6],
E=r[8],G=r[9],I=r[10],O=r[12],L=r[13],P=r[14];u*=n;var M=0,K=0,J=0;r=b.hasIdentityRotation(r)?R=>{M=y[R]+O;K=y[R+1]+L;J=y[R+2]+P}:R=>{const Q=y[R],W=y[R+1];R=y[R+2];M=B*Q+F*W+E*R+O;K=C*Q+H*W+G*R+L;J=D*Q+N*W+I*R+P};if(1===x)for(x=0;x<A;++x)r(3*z[x]),m[u]=M,m[u+1]=K,m[u+2]=J,u+=n;else for(let R=0;R<A;++R){r(3*z[R]);for(let Q=0;Q<x;++Q)m[u]=M,m[u+1]=K,m[u+2]=J,u+=n}}else h(m,n,u,x)}function e(m,r,n,u,x=1){if(r){var {data:y,indices:z}=m;m=n.typedBuffer;n=n.typedBufferStride;var A=z.length,B=r[0],C=r[1],
D=r[2],F=r[4],H=r[5],N=r[6],E=r[8],G=r[9],I=r[10],O=!b.isOrthoNormal(r);u*=n;var L=0,P=0,M=0;r=b.hasIdentityRotation(r)?J=>{L=y[J];P=y[J+1];M=y[J+2]}:J=>{const R=y[J],Q=y[J+1];J=y[J+2];L=B*R+F*Q+E*J;P=C*R+H*Q+G*J;M=D*R+N*Q+I*J};if(1===x)if(O)for(x=0;x<A;++x)r(3*z[x]),O=L*L+P*P+M*M,.999999>O&&1E-6<O?(O=1/Math.sqrt(O),m[u]=L*O,m[u+1]=P*O,m[u+2]=M*O):(m[u]=L,m[u+1]=P,m[u+2]=M),u+=n;else for(x=0;x<A;++x)r(3*z[x]),m[u]=L,m[u+1]=P,m[u+2]=M,u+=n;else for(let J=0;J<A;++J){r(3*z[J]);if(O){var K=L*L+P*P+M*
M;.999999>K&&1E-6<K&&(K=1/Math.sqrt(K),L*=K,P*=K,M*=K)}for(K=0;K<x;++K)m[u]=L,m[u+1]=P,m[u+2]=M,u+=n}}else h(m,n,u,x)}function g(m,r,n,u,x=1){if(r){var {data:y,indices:z}=m;m=n.typedBuffer;n=n.typedBufferStride;var A=z.length,B=r[0],C=r[1],D=r[2],F=r[4],H=r[5],N=r[6],E=r[8],G=r[9],I=r[10];r=!b.isOrthoNormal(r);u*=n;if(1===x)for(x=0;x<A;++x){var O=4*z[x],L=y[O],P=y[O+1],M=y[O+2];O=y[O+3];var K=B*L+F*P+E*M,J=C*L+H*P+G*M;L=D*L+N*P+I*M;r&&(P=K*K+J*J+L*L,.999999>P&&1E-6<P&&(P=1/Math.sqrt(P),K*=P,J*=P,
L*=P));m[u]=K;m[u+1]=J;m[u+2]=L;m[u+3]=O;u+=n}else for(O=0;O<A;++O){K=4*z[O];P=y[K];M=y[K+1];const R=y[K+2];K=y[K+3];J=B*P+F*M+E*R;L=C*P+H*M+G*R;P=D*P+N*M+I*R;r&&(M=J*J+L*L+P*P,.999999>M&&1E-6<M&&(M=1/Math.sqrt(M),J*=M,L*=M,P*=M));for(M=0;M<x;++M)m[u]=J,m[u+1]=L,m[u+2]=P,m[u+3]=K,u+=n}}else f(m,n,u,x)}function d(m,r,n,u,x=1){const {data:y,indices:z}=m;var A=n.typedBuffer,B=n.typedBufferStride;m=z.length;u*=B;if(r===y.length&&4===r)for(A[u]=y[0],A[u+1]=y[1],A[u+2]=y[2],A[u+3]=y[3],A=new Uint32Array(n.typedBuffer.buffer,
n.start),B/=4,u/=4,r=A[u],u+=B,m*=x,x=1;x<m;++x)A[u]=r,u+=B;else if(1===x)if(4===r)for(x=0;x<m;++x)r=4*z[x],A[u]=y[r],A[u+1]=y[r+1],A[u+2]=y[r+2],A[u+3]=y[r+3],u+=B;else for(x=0;x<m;++x)r=3*z[x],A[u]=y[r],A[u+1]=y[r+1],A[u+2]=y[r+2],A[u+3]=255,u+=B;else if(4===r)for(r=0;r<m;++r){n=4*z[r];for(var C=0;C<x;++C)A[u]=y[n],A[u+1]=y[n+1],A[u+2]=y[n+2],A[u+3]=y[n+3],u+=B}else for(r=0;r<m;++r)for(n=3*z[r],C=0;C<x;++C)A[u]=y[n],A[u+1]=y[n+1],A[u+2]=y[n+2],A[u+3]=255,u+=B}function t(m,r,n){const {data:u,indices:x}=
m;m=r.typedBuffer;r=r.typedBufferStride;const y=x.length,z=u[0];n*=r;for(let A=0;A<y;++A)m[n]=z,n+=r}function w(m,r,n,u,x=1){const y=r.typedBuffer;r=r.typedBufferStride;u*=r;if(1===x)for(x=0;x<n;++x)y[u]=m[0],y[u+1]=m[1],y[u+2]=m[2],y[u+3]=m[3],u+=r;else for(let z=0;z<n;++z)for(let A=0;A<x;++A)y[u]=m[0],y[u+1]=m[1],y[u+2]=m[2],y[u+3]=m[3],u+=r}function v(m,r,n,u,x,y){switch(m){case p.VertexAttribute.POSITION:l.assert(3===r.size);u=x.getField(m,q.BufferViewVec3f);l.assert(!!u,`No buffer view for ${m}`);
u&&c(r,n,u,y);break;case p.VertexAttribute.NORMAL:l.assert(3===r.size);n=x.getField(m,q.BufferViewVec3f);l.assert(!!n,`No buffer view for ${m}`);n&&e(r,u,n,y);break;case p.VertexAttribute.NORMALCOMPRESSED:l.assert(2===r.size);n=x.getField(m,q.BufferViewVec2i16);l.assert(!!n,`No buffer view for ${m}`);n&&k(r,n,y);break;case p.VertexAttribute.UV0:l.assert(2===r.size);n=x.getField(m,q.BufferViewVec2f);l.assert(!!n,`No buffer view for ${m}`);n&&k(r,n,y);break;case p.VertexAttribute.COLOR:case p.VertexAttribute.SYMBOLCOLOR:n=
x.getField(m,q.BufferViewVec4u8);l.assert(!!n,`No buffer view for ${m}`);l.assert(3===r.size||4===r.size);!n||3!==r.size&&4!==r.size||d(r,r.size,n,y);break;case p.VertexAttribute.COLORFEATUREATTRIBUTE:n=x.getField(m,q.BufferViewFloat);l.assert(!!n,`No buffer view for ${m}`);l.assert(1===r.size);n&&1===r.size&&t(r,n,y);break;case p.VertexAttribute.TANGENT:l.assert(4===r.size);u=x.getField(m,q.BufferViewVec4f);l.assert(!!u,`No buffer view for ${m}`);u&&g(r,n,u,y);break;case p.VertexAttribute.PROFILERIGHT:case p.VertexAttribute.PROFILEUP:case p.VertexAttribute.PROFILEVERTEXANDNORMAL:case p.VertexAttribute.FEATUREVALUE:l.assert(4===
r.size),n=x.getField(m,q.BufferViewVec4f),l.assert(!!n,`No buffer view for ${m}`),n&&f(r,n,y)}}a.writeBufferFloat=function(m,r,n,u=1){const {data:x,indices:y}=m;m=r.typedBuffer;r=r.typedBufferStride;const z=y.length;n*=r;if(1===u)for(u=0;u<z;++u)m[n]=x[y[u]],n+=r;else for(let A=0;A<z;++A){const B=x[y[A]];for(let C=0;C<u;C++)m[n]=B,n+=r}};a.writeBufferMat3f=function(m,r,n){const {data:u,indices:x}=m;m=r.typedBuffer;r=r.typedBufferStride;const y=x.length;n*=r;for(let z=0;z<y;++z){const A=9*x[z];for(let B=
0;9>B;++B)m[n+B]=u[A+B];n+=r}};a.writeBufferMat4f=function(m,r,n){const {data:u,indices:x}=m;m=r.typedBuffer;r=r.typedBufferStride;const y=x.length;n*=r;for(let z=0;z<y;++z){const A=16*x[z];for(let B=0;16>B;++B)m[n+B]=u[A+B];n+=r}};a.writeBufferVec2=k;a.writeBufferVec3=h;a.writeBufferVec4=f;a.writeBufferVec4Zeros=function(m,r,n){const u=m.typedBuffer;m=m.typedBufferStride;r*=m;for(let x=0;x<n;++x)u[r]=0,u[r+1]=0,u[r+2]=0,u[r+3]=0,r+=m};a.writeColor=d;a.writeColorFeatureAttribute=t;a.writeDefaultAttribute=
v;a.writeDefaultAttributes=function(m,r,n,u,x,y){for(const A of r.fields.keys()){r=m.attributes.get(A);var z=r?.indices;r&&z?v(A,r,n,u,x,y):A===p.VertexAttribute.OBJECTANDLAYERIDCOLOR&&null!=m.objectAndLayerIdColor&&(r=m.attributes.get(p.VertexAttribute.POSITION)?.indices)&&(r=r.length,z=x.getField(A,q.BufferViewVec4u8),w(m.objectAndLayerIdColor,z,r,y))}};a.writeNormal=e;a.writeObjectAndLayerIdColor=w;a.writePosition=c;a.writeTangent=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/chunks/HUDMaterial.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/vec2 ../core/libs/gl-matrix-2/factories/vec2f64 ../core/libs/gl-matrix-2/factories/vec4f64 ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl ../views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl ../views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl ../views/3d/webgl-engine/core/shaderLibrary/hud/HUDVisibility.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D){function F(E){const G=new A.ShaderBuilder;var I=E.signedDistanceFieldEnabled;G.include(c.HUD,E);G.include(k.SliceDraw,E);if(E.occlusionPass)return G.include(e.HUDOcclusionPass,E),G;const {vertex:O,fragment:L}=G;G.include(r.ScreenSizePerspective);L.include(m.RgbaFloatEncoding);L.include(v.ColorConversion);G.include(t.VisualVariables,E);G.include(h.ObjectAndLayerIdColor,E);G.include(g.HUDVisibility);G.varyings.add("vcolor","vec4");G.varyings.add("vtc",
"vec2");G.varyings.add("vsize","vec2");G.varyings.add("voccluded","float");O.uniforms.add(new x.Float4PassUniform("viewport",(K,J)=>J.camera.fullViewport),new u.Float2PassUniform("screenOffset",(K,J)=>b.set(N,2*K.screenOffset[0]*J.camera.pixelRatio,2*K.screenOffset[1]*J.camera.pixelRatio)),new u.Float2PassUniform("anchorPosition",K=>H(K)),new x.Float4PassUniform("materialColor",K=>K.color));n.addPixelRatio(O);I&&(O.uniforms.add(new x.Float4PassUniform("outlineColor",K=>K.outlineColor)),L.uniforms.add(new x.Float4PassUniform("outlineColor",
K=>0<K.outlineColor[3]&&0<K.outlineSize?K.outlineColor:l.ZEROS),new y.FloatPassUniform("outlineSize",K=>0<K.outlineColor[3]&&0<K.outlineSize?K.outlineSize:0)));E.pixelSnappingEnabled&&O.include(f.AlignPixel);E.hasScreenSizePerspective&&(r.addScreenSizePerspective(O),r.addScreenSizePerspectiveAlignment(O));E.debugDrawLabelBorder&&G.varyings.add("debugBorderCoords","vec4");G.attributes.add(D.VertexAttribute.UV0,"vec2");G.attributes.add(D.VertexAttribute.COLOR,"vec4");G.attributes.add(D.VertexAttribute.SIZE,
"vec2");G.attributes.add(D.VertexAttribute.FEATUREATTRIBUTE,"vec4");O.code.add(z.glsl`
void main(void) {
ProjectHUDAux projectAux;
vec4 posProj = projectPositionHUD(projectAux);
forwardObjectAndLayerIdColor();
if (rejectBySlice(projectAux.posModel)) {
// Project outside of clip plane
gl_Position = vec4(1e038, 1e038, 1e038, 1.0);
return;
}
vec2 inputSize;
${E.hasScreenSizePerspective?z.glsl`
inputSize = screenSizePerspectiveScaleVec2(size, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspective);
vec2 screenOffsetScaled = screenSizePerspectiveScaleVec2(screenOffset, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);
`:z.glsl`
inputSize = size;
vec2 screenOffsetScaled = screenOffset;`}
${E.vvSize?"inputSize *\x3d vvScale(featureAttribute).xx;":""}
vec2 combinedSize = inputSize * pixelRatio;
vec4 quadOffset = vec4(0.0);
bool visible = testHUDVisibility(posProj);
voccluded = visible ? 0.0 : 1.0;
`);var P=z.glsl`vec2 uv01 = floor(uv0);
vec2 uv = uv0 - uv01;
quadOffset.xy = ((uv01 - anchorPosition) * 2.0 * combinedSize + screenOffsetScaled) / viewport.zw * posProj.w;`;const M=E.pixelSnappingEnabled?I?z.glsl`posProj = alignToPixelOrigin(posProj, viewport.zw) + quadOffset;`:z.glsl`posProj += quadOffset;
if (inputSize.x == size.x) {
posProj = alignToPixelOrigin(posProj, viewport.zw);
}`:z.glsl`posProj += quadOffset;`;O.code.add(z.glsl`
${E.occlusionTestEnabled?"if (visible) {":""}
${P}
${E.vvColor?"vcolor \x3d interpolateVVColor(featureAttribute.y) * materialColor;":"vcolor \x3d color / 255.0 * materialColor;"}
${E.output===p.ShaderOutput.ObjectAndLayerIdColor?z.glsl`vcolor.a = 1.0;`:""}
bool alphaDiscard = vcolor.a < ${z.glsl.float(w.symbolAlphaCutoff)};
${I?`alphaDiscard = alphaDiscard && outlineColor.a < ${z.glsl.float(w.symbolAlphaCutoff)};`:""}
if (alphaDiscard) {
// "early discard" if both symbol color (= fill) and outline color (if applicable) are transparent
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
return;
} else {
${M}
gl_Position = posProj;
}
vtc = uv;
${E.debugDrawLabelBorder?"debugBorderCoords \x3d vec4(uv01, 1.5 / combinedSize);":""}
vsize = inputSize;
${E.occlusionTestEnabled?z.glsl`} else { vtc = vec2(0.0);
${E.debugDrawLabelBorder?"debugBorderCoords \x3d vec4(0.5, 0.5, 1.5 / combinedSize);}":"}"}`:""}
}
`);L.uniforms.add(new B.Texture2DPassUniform("tex",K=>K.texture));P=E.debugDrawLabelBorder?z.glsl`(isBorder > 0.0 ? 0.0 : ${z.glsl.float(w.defaultMaskAlphaCutoff)})`:z.glsl.float(w.defaultMaskAlphaCutoff);I=z.glsl`
${E.debugDrawLabelBorder?z.glsl`
float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`:""}
${E.sampleSignedDistanceFieldTexelCenter?z.glsl`
// Attempt to sample texel centers to avoid that thin cross outlines
// disappear with large symbol sizes.
// see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/7058#issuecomment-603041
float txSize = float(textureSize(tex, 0).x);
float texelSize = 1.0 / txSize;
// Calculate how much we have to add/subtract to/from each texel to reach the size of an onscreen pixel
vec2 scaleFactor = (vsize - txSize) * texelSize;
vec2 samplePos = vtc + (vec2(1.0, -1.0) * texelSize) * scaleFactor;
`:z.glsl`
vec2 samplePos = vtc;
`}
${I?z.glsl`
vec4 fillPixelColor = vcolor;
// Get distance and map it into [-0.5, 0.5]
float d = rgba2float(texture(tex, samplePos)) - 0.5;
// Distance in output units (i.e. pixels)
float dist = d * vsize.x;
// Create smooth transition from the icon into its outline
float fillAlphaFactor = clamp(0.5 - dist, 0.0, 1.0);
fillPixelColor.a *= fillAlphaFactor;
if (outlineSize > 0.25) {
vec4 outlinePixelColor = outlineColor;
float clampedOutlineSize = min(outlineSize, 0.5*vsize.x);
// Create smooth transition around outline
float outlineAlphaFactor = clamp(0.5 - (abs(dist) - 0.5*clampedOutlineSize), 0.0, 1.0);
outlinePixelColor.a *= outlineAlphaFactor;
if (
outlineAlphaFactor + fillAlphaFactor < ${P} ||
fillPixelColor.a + outlinePixelColor.a < ${z.glsl.float(w.symbolAlphaCutoff)}
) {
discard;
}
// perform un-premultiplied over operator (see https://en.wikipedia.org/wiki/Alpha_compositing#Description)
float compositeAlpha = outlinePixelColor.a + fillPixelColor.a * (1.0 - outlinePixelColor.a);
vec3 compositeColor = vec3(outlinePixelColor) * outlinePixelColor.a +
vec3(fillPixelColor) * fillPixelColor.a * (1.0 - outlinePixelColor.a);
fragColor = vec4(compositeColor, compositeAlpha);
} else {
if (fillAlphaFactor < ${P}) {
discard;
}
fragColor = premultiplyAlpha(fillPixelColor);
}
// visualize SDF:
// fragColor = vec4(clamp(-dist/vsize.x*2.0, 0.0, 1.0), clamp(dist/vsize.x*2.0, 0.0, 1.0), 0.0, 1.0);
`:z.glsl`
vec4 texColor = texture(tex, vtc, -0.5);
if (texColor.a < ${P}) {
discard;
}
fragColor = texColor * premultiplyAlpha(vcolor);
`}
// Draw debug border with transparency, so that original texels along border are still partially visible
${E.debugDrawLabelBorder?z.glsl`fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`:""}
`;switch(E.output){case p.ShaderOutput.Color:E.transparencyPassType===C.TransparencyPassType.ColorAlpha&&(G.outputs.add("fragColor","vec4",0),G.outputs.add("fragAlpha","float",1));L.code.add(z.glsl`
void main() {
${I}
${E.transparencyPassType===C.TransparencyPassType.FrontFace?"fragColor.rgb /\x3d fragColor.a;":""}
${E.transparencyPassType===C.TransparencyPassType.ColorAlpha?"fragAlpha \x3d fragColor.a;":""}
}`);break;case p.ShaderOutput.ObjectAndLayerIdColor:L.code.add(z.glsl`
void main() {
${I}
outputObjectAndLayerIdColor();
}`);break;case p.ShaderOutput.Highlight:L.constants.add("occludedHighlightFlag","vec4",d.occludedHighlightFlag),L.constants.add("unoccludedHighlightFlag","vec4",d.unoccludedHighlightFlag),L.code.add(z.glsl`
void main() {
${I}
if (voccluded == 1.0) {
fragColor = occludedHighlightFlag;
} else {
fragColor = unoccludedHighlightFlag;
}
}`)}return G}function H(E,G=N){if(E.textureIsSignedDistanceField){var I=E.anchorPosition;E=E.distanceFieldBoundingBox;null!=E?b.set(G,I[0]*(E[2]-E[0])+E[0],I[1]*(E[3]-E[1])+E[1]):b.set(G,0,0)}else b.copy(G,E.anchorPosition);return G}const N=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:F,calculateAnchorPosForRendering:H},Symbol.toStringTag,{value:"Module"}));a.HUDMaterial=q;a.build=F;a.calculateAnchorPosForRendering=H})},"esri/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl":function(){define("exports ../../../../../core/libs/gl-matrix-2/math/mat4 ../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../shaderModules/Float3DrawUniform ../shaderModules/Float3PassUniform ../shaderModules/interfaces".split(" "),
function(a,b,q,l,p,k,h,f){function c(x,y,...z){if(y.hasSlicePlane){y.hasSliceInVertexProgram&&x.vertex.uniforms.add(...z);x.fragment.uniforms.add(...z);z=f.glsl`struct SliceFactors {
float front;
float side0;
float side1;
float side2;
float side3;
};
SliceFactors calculateSliceFactors(vec3 pos) {
vec3 rel = pos - slicePlaneOrigin;
vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);
float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);
float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);
float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);
float basis1Dot = dot(slicePlaneBasis1, rel);
float basis2Dot = dot(slicePlaneBasis2, rel);
return SliceFactors(
dot(slicePlaneNormal, pos) + slicePlaneW,
-basis1Dot - basis1Len2,
basis1Dot - basis1Len2,
-basis2Dot - basis2Len2,
basis2Dot - basis2Len2
);
}
bool sliceByFactors(SliceFactors factors) {
return factors.front < 0.0
&& factors.side0 < 0.0
&& factors.side1 < 0.0
&& factors.side2 < 0.0
&& factors.side3 < 0.0;
}
bool sliceEnabled() {
return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
}
bool sliceByPlane(vec3 pos) {
return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
}
#define rejectBySlice(_pos_) sliceByPlane(_pos_)
#define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`;var A=f.glsl`vec4 applySliceHighlight(vec4 color, vec3 pos) {
SliceFactors factors = calculateSliceFactors(pos);
const float HIGHLIGHT_WIDTH = 1.0;
const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3);
factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front);
factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0);
factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1);
factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2);
factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3);
if (sliceByFactors(factors)) {
return color;
}
float highlightFactor = (1.0 - step(0.5, factors.front))
* (1.0 - step(0.5, factors.side0))
* (1.0 - step(0.5, factors.side1))
* (1.0 - step(0.5, factors.side2))
* (1.0 - step(0.5, factors.side3));
return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a);
}`;A=y.hasSliceHighlight?f.glsl`
${A}
#define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
`:f.glsl`#define highlightSlice(_color_, _pos_) (_color_)`;y.hasSliceInVertexProgram&&x.vertex.code.add(z);x.fragment.code.add(z);x.fragment.code.add(A)}else z=f.glsl`#define rejectBySlice(_pos_) false
#define discardBySlice(_pos_) {}
#define highlightSlice(_color_, _pos_) (_color_)`,y.hasSliceInVertexProgram&&x.vertex.code.add(z),x.fragment.code.add(z)}function e(x,y,z){return x.instancedDoublePrecision?l.set(m,z.camera.viewInverseTransposeMatrix[3],z.camera.viewInverseTransposeMatrix[7],z.camera.viewInverseTransposeMatrix[11]):y.slicePlaneLocalOrigin}function g(x,y){return null!=x?l.subtract(r,y.origin,x):y.origin}function d(x,y,z){return x.hasSliceTranslatedView?null!=y?b.translate(u,z.camera.viewMatrix,y):z.camera.viewMatrix:
null}function t(x,y,z){if(null==z.slicePlane)return p.ZEROS;const A=e(x,y,z);y=g(A,z.slicePlane);x=d(x,A,z);return null!=x?l.transformMat4(r,y,x):y}function w(x,y,z,A){if(null==A||null==z.slicePlane)return p.ZEROS;const B=e(x,y,z);y=g(B,z.slicePlane);x=d(x,B,z);return null!=x?(l.add(n,A,y),l.transformMat4(r,y,x),l.transformMat4(n,n,x),l.subtract(n,n,r)):A}class v extends f.NoParameters{constructor(x){super();this.slicePlaneLocalOrigin=x}}const m=p.create(),r=p.create(),n=p.create(),u=q.create();a.SliceDraw=
function(x,y){c(x,y,new k.Float3DrawUniform("slicePlaneOrigin",(z,A)=>t(y,z,A)),new k.Float3DrawUniform("slicePlaneBasis1",(z,A)=>w(y,z,A,A.slicePlane?.basis1)),new k.Float3DrawUniform("slicePlaneBasis2",(z,A)=>w(y,z,A,A.slicePlane?.basis2)))};a.SlicePass=function(x,y){c(x,y,new h.Float3PassUniform("slicePlaneOrigin",(z,A)=>t(y,z,A)),new h.Float3PassUniform("slicePlaneBasis1",(z,A)=>w(y,z,A,A.slicePlane?.basis1)),new h.Float3PassUniform("slicePlaneBasis2",(z,A)=>w(y,z,A,A.slicePlane?.basis2)))};a.SlicePlaneParameters=
v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl":function(){define(["exports","../ShaderOutput","../../shaderModules/interfaces","../../../lib/VertexAttribute"],function(a,b,q,l){a.ObjectAndLayerIdColor=function(p,k){const h=k.output===b.ShaderOutput.ObjectAndLayerIdColor;k=k.objectAndLayerIdColorInstanced;h&&(p.varyings.add("objectAndLayerIdColorVarying","vec4"),k?p.attributes.add(l.VertexAttribute.INSTANCEOBJECTANDLAYERIDCOLOR,
"vec4"):p.attributes.add(l.VertexAttribute.OBJECTANDLAYERIDCOLOR,"vec4"));p.vertex.code.add(q.glsl`
void forwardObjectAndLayerIdColor() {
${h?k?q.glsl`objectAndLayerIdColorVarying = instanceObjectAndLayerIdColor * 0.003921568627451;`:q.glsl`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;`:q.glsl``} }`);p.fragment.code.add(q.glsl`
void outputObjectAndLayerIdColor() {
${h?q.glsl`fragColor = objectAndLayerIdColorVarying;`:q.glsl``} }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl":function(){define(["exports","../../shaderModules/BooleanPassUniform","../../shaderModules/interfaces"],function(a,b,q){a.AlignPixel=function(l){l.uniforms.add(new b.BooleanPassUniform("alignPixelEnabled",(p,k)=>k.alignPixelEnabled));l.code.add(q.glsl`vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) {
if (!alignPixelEnabled)
return clipCoord;
vec2 xy = vec2(0.500123) + 0.5 * clipCoord.xy / clipCoord.w;
vec2 pixelSz = vec2(1.0) / widthHeight;
vec2 ij = (floor(xy * widthHeight) + vec2(0.5)) * pixelSz;
vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w;
return vec4(result, clipCoord.zw);
}`);l.code.add(q.glsl`vec4 alignToPixelOrigin(vec4 clipCoord, vec2 widthHeight) {
if (!alignPixelEnabled)
return clipCoord;
vec2 xy = vec2(0.5) + 0.5 * clipCoord.xy / clipCoord.w;
vec2 pixelSz = vec2(1.0) / widthHeight;
vec2 ij = floor((xy + 0.5 * pixelSz) * widthHeight) * pixelSz;
vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w;
return vec4(result, clipCoord.zw);
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl":function(){define(["exports","./AlignPixel.glsl","../shading/MultipassTerrainTest.glsl","../../shaderModules/interfaces"],function(a,b,q,l){a.HUDOcclusionPass=function(p,k){const {vertex:h,fragment:f}=p;h.include(b.AlignPixel);k.multipassEnabled&&p.varyings.add("depth","float");h.code.add(l.glsl`
void main(void) {
vec4 posProjCenter;
if (dot(position, position) > 0.0) {
// Render single point to center of the pixel to avoid subpixel filtering to affect the marker color
ProjectHUDAux projectAux;
vec4 posProj = projectPositionHUD(projectAux);
posProjCenter = alignToPixelCenter(posProj, viewport.zw);
${k.multipassEnabled?"depth \x3d projectAux.posView.z;":""}
vec3 vpos = projectAux.posModel;
if (rejectBySlice(vpos)) {
// Project out of clip space
posProjCenter = vec4(1e038, 1e038, 1e038, 1.0);
}
} else {
// Project out of clip space
posProjCenter = vec4(1e038, 1e038, 1e038, 1.0);
}
gl_Position = posProjCenter;
gl_PointSize = 1.0;
}
`);p.include(q.multipassTerrainTest,k);f.code.add(l.glsl`
void main() {
fragColor = vec4(1);
${k.multipassEnabled?l.glsl`
if(terrainDepthTest(depth)) {
fragColor.g = 0.5;
}`:""}
}
`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/hud/HUDVisibility.glsl":function(){define("exports ./AlignPixel.glsl ./HUDRenderStyle ../../shaderModules/Float4PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../shaderModules/Texture2DPassUniform".split(" "),function(a,b,q,l,p,k,h){a.HUDVisibility=function(f){f.vertex.uniforms.add(new p.FloatPassUniform("renderTransparentlyOccludedHUD",(c,e)=>e.hudRenderStyle===
q.HUDRenderStyle.Occluded?1:e.hudRenderStyle===q.HUDRenderStyle.NotOccluded?0:.75),new l.Float4PassUniform("viewport",(c,e)=>e.camera.fullViewport),new h.Texture2DPassUniform("hudVisibilityTexture",(c,e)=>e.hudVisibility?.getTexture()));f.vertex.include(b.AlignPixel);f.vertex.code.add(k.glsl`bool testHUDVisibility(vec4 posProj) {
vec4 posProjCenter = alignToPixelCenter(posProj, viewport.zw);
vec4 occlusionPixel = texture(hudVisibilityTexture, .5 + .5 * posProjCenter.xy / posProjCenter.w);
if (renderTransparentlyOccludedHUD > 0.5) {
return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g * renderTransparentlyOccludedHUD < 1.0;
}
return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g == 1.0;
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl":function(){define(["exports","../../../../../../core/libs/gl-matrix-2/factories/vec4f64","../../shaderModules/interfaces","../../shaderModules/Texture2DPassUniform"],function(a,b,q,l){const p=b.fromValues(1,1,0,1),k=b.fromValues(1,0,1,1);a.OutputHighlight=function(h){h.fragment.uniforms.add(new l.Texture2DPassUniform("depthTexture",(f,c)=>c.mainDepth));h.fragment.constants.add("occludedHighlightFlag",
"vec4",p).add("unoccludedHighlightFlag","vec4",k);h.fragment.code.add(q.glsl`void outputHighlight() {
float sceneDepth = float(texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x);
if (gl_FragCoord.z > sceneDepth + 5e-7) {
fragColor = occludedHighlightFlag;
} else {
fragColor = unoccludedHighlightFlag;
}
}`)};a.occludedHighlightFlag=p;a.unoccludedHighlightFlag=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl":function(){define("exports ../../shaderModules/Float3PassUniform ../../shaderModules/Float4sPassUniform ../../shaderModules/FloatsPassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix3PassUniform ../../../lib/VertexAttribute ../../../materials/VisualVariablePassParameters".split(" "),
function(a,b,q,l,p,k,h,f){a.VisualVariables=function(c,e){const {vertex:g,attributes:d}=c;e.hasVvInstancing&&(e.vvSize||e.vvColor)&&d.add(h.VertexAttribute.INSTANCEFEATUREATTRIBUTE,"vec4");e.vvSize?(g.uniforms.add(new b.Float3PassUniform("vvSizeMinSize",t=>t.vvSize.minSize)),g.uniforms.add(new b.Float3PassUniform("vvSizeMaxSize",t=>t.vvSize.maxSize)),g.uniforms.add(new b.Float3PassUniform("vvSizeOffset",t=>t.vvSize.offset)),g.uniforms.add(new b.Float3PassUniform("vvSizeFactor",t=>t.vvSize.factor)),
g.uniforms.add(new k.Matrix3PassUniform("vvSymbolRotationMatrix",t=>t.vvSymbolRotationMatrix)),g.uniforms.add(new b.Float3PassUniform("vvSymbolAnchor",t=>t.vvSymbolAnchor)),g.code.add(p.glsl`vec3 vvScale(vec4 _featureAttribute) {
return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);
}
vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
}`),g.code.add(p.glsl`
const float eps = 1.192092896e-07;
vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize);
return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0);
}
${e.hasVvInstancing?p.glsl`
vec4 vvLocalNormal(vec3 _normal) {
return vvTransformNormal(_normal, instanceFeatureAttribute);
}
vec4 localPosition() {
return vvTransformPosition(position, instanceFeatureAttribute);
}`:""}
`)):g.code.add(p.glsl`vec4 localPosition() { return vec4(position, 1.0); }
vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`);e.vvColor?(g.constants.add("vvColorNumber","int",f.vvColorNumber),g.uniforms.add(new l.FloatsPassUniform("vvColorValues",t=>t.vvColor.values,f.vvColorNumber),new q.Float4sPassUniform("vvColorColors",t=>t.vvColor.colors,f.vvColorNumber)),g.code.add(p.glsl`
vec4 interpolateVVColor(float value) {
if (value <= vvColorValues[0]) {
return vvColorColors[0];
}
for (int i = 1; i < vvColorNumber; ++i) {
if (vvColorValues[i] >= value) {
float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
return mix(vvColorColors[i-1], vvColorColors[i], f);
}
}
return vvColorColors[vvColorNumber - 1];
}
vec4 vvGetColor(vec4 featureAttribute) {
return interpolateVVColor(featureAttribute.y);
}
${e.hasVvInstancing?p.glsl`
vec4 vvColor() {
return vvGetColor(instanceFeatureAttribute);
}`:"vec4 vvColor() { return vec4(1.0); }"}
`)):g.code.add(p.glsl`vec4 vvColor() { return vec4(1.0); }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Float4sPassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k,h){super(p,"vec4",q.BindType.Pass,(f,c,e)=>f.setUniform4fv(p,k(c,e)),h)}}a.Float4sPassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/FloatsPassUniform":function(){define(["exports",
"./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k,h){super(p,"float",q.BindType.Pass,(f,c,e)=>f.setUniform1fv(p,k(c,e)),h)}}a.FloatsPassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/VisualVariablePassParameters":function(){define(["exports","../../layers/support/FastSymbolUpdates","../lib/Material"],function(a,b,q){class l extends b.VisualVariablesParameters{constructor(){super(...arguments);
this.renderOccluded=q.RenderOccludedFlag.Occlude;this.isDecoration=!1}}a.VisualVariablePassParameters=l;a.vvColorNumber=8;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff":function(){define(["exports"],function(a){a.defaultMaskAlphaCutoff=.1;a.symbolAlphaCutoff=.001;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/HUDMaterialTechnique":function(){define("require exports ../../../ViewingMode ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/OrderIndependentTransparency ../lib/Program ../lib/TransparencyPassType ../../../../chunks/HUDMaterial.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w extends k.ShaderTechnique{initializeConfiguration(r,n){n.spherical=r.viewingMode===q.ViewingMode.Global}initializeProgram(r){return new c.Program(r.rctx,w.shader.get().build(this.configuration),h.Default3D)}initializePipeline(){const r=this.configuration.transparencyPassType,n=this.configuration,u=r===e.TransparencyPassType.NONE;var x=r===e.TransparencyPassType.FrontFace;const y=this.configuration.hasPolygonOffset?v:null;x=n.draped?null:(u||x)&&n.output!==
l.ShaderOutput.Highlight?n.depthEnabled||n.occlusionPass?t.defaultDepthWriteParams:null:null;return t.makePipelineState({blending:n.output===l.ShaderOutput.Color||n.output===l.ShaderOutput.Highlight?u?m:f.oitBlending(r):null,depthTest:n.draped?null:{func:d.CompareFunction.LEQUAL},depthWrite:x,drawBuffers:f.oitDrawBuffers(r),colorWrite:t.defaultColorWriteParams,polygonOffset:y})}get primitiveType(){return this.configuration.occlusionPass?d.PrimitiveType.POINTS:d.PrimitiveType.TRIANGLES}}w.shader=new p.ReloadableShaderModule(g.HUDMaterial,
()=>new Promise((r,n)=>a(["./HUDMaterial.glsl"],r,n)));const v={factor:0,units:-4},m=t.simpleBlendingParams(d.BlendFactor.ONE,d.BlendFactor.ONE_MINUS_SRC_ALPHA);b.HUDMaterialTechnique=w;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/OrderIndependentTransparency":function(){define(["exports","./TransparencyPassType","../../../webgl/enums","../../../webgl/renderState"],function(a,b,q,l){const p=l.separateBlendingParams(q.BlendFactor.SRC_ALPHA,q.BlendFactor.ONE,
q.BlendFactor.ONE_MINUS_SRC_ALPHA,q.BlendFactor.ONE_MINUS_SRC_ALPHA),k=l.separateBlendingParams(q.BlendFactor.ONE,q.BlendFactor.ZERO,q.BlendFactor.ONE,q.BlendFactor.ONE_MINUS_SRC_ALPHA),h={factor:-1,units:-2};a.OITPolygonOffset=h;a.OITPolygonOffsetLimit=5E5;a.blendingColorAlpha=k;a.blendingDefault=p;a.getOITPolygonOffset=function(f){return f?h:null};a.oitBlending=function(f){return f===b.TransparencyPassType.FrontFace?null:k};a.oitDepthTest=function(f,c=q.CompareFunction.LESS){return f===b.TransparencyPassType.NONE||
f===b.TransparencyPassType.FrontFace?c:q.CompareFunction.LEQUAL};a.oitDepthWrite=function(f){return f===b.TransparencyPassType.FrontFace?l.defaultDepthWriteParams:null};a.oitDrawBuffers=function(f){return f===b.TransparencyPassType.ColorAlpha?{buffers:[q.ColorAttachment.COLOR_ATTACHMENT0,q.ColorAttachment.COLOR_ATTACHMENT1]}:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration":function(){define("exports ../../../../chunks/tslib.es6 ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/TransparencyPassType ../materials/DefaultTechniqueConfiguration".split(" "),
function(a,b,q,l,p,k){class h extends k.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=q.ShaderOutput.Color;this.transparencyPassType=p.TransparencyPassType.NONE;this.spherical=this.screenCenterOffsetUnitsEnabled=!1;this.occlusionTestEnabled=!0;this.hasPolygonOffset=this.hasSlicePlane=this.debugDrawLabelBorder=this.hasScreenSizePerspective=this.hasVerticalOffset=this.vvColor=this.vvSize=this.sampleSignedDistanceFieldTexelCenter=this.signedDistanceFieldEnabled=!1;this.pixelSnappingEnabled=
this.depthEnabled=!0;this.objectAndLayerIdColorInstanced=this.occlusionPass=this.cullAboveGround=this.multipassEnabled=this.draped=!1}}b.__decorate([l.parameter({count:q.ShaderOutput.COUNT})],h.prototype,"output",void 0);b.__decorate([l.parameter({count:p.TransparencyPassType.COUNT})],h.prototype,"transparencyPassType",void 0);b.__decorate([l.parameter()],h.prototype,"screenCenterOffsetUnitsEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"spherical",void 0);b.__decorate([l.parameter()],
h.prototype,"occlusionTestEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"signedDistanceFieldEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"sampleSignedDistanceFieldTexelCenter",void 0);b.__decorate([l.parameter()],h.prototype,"vvSize",void 0);b.__decorate([l.parameter()],h.prototype,"vvColor",void 0);b.__decorate([l.parameter()],h.prototype,"hasVerticalOffset",void 0);b.__decorate([l.parameter()],h.prototype,"hasScreenSizePerspective",void 0);b.__decorate([l.parameter()],h.prototype,
"debugDrawLabelBorder",void 0);b.__decorate([l.parameter()],h.prototype,"hasSlicePlane",void 0);b.__decorate([l.parameter()],h.prototype,"hasPolygonOffset",void 0);b.__decorate([l.parameter()],h.prototype,"depthEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"pixelSnappingEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"draped",void 0);b.__decorate([l.parameter()],h.prototype,"multipassEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"cullAboveGround",void 0);b.__decorate([l.parameter()],
h.prototype,"occlusionPass",void 0);b.__decorate([l.parameter()],h.prototype,"objectAndLayerIdColorInstanced",void 0);b.__decorate([l.parameter({constValue:!0})],h.prototype,"hasSliceInVertexProgram",void 0);b.__decorate([l.parameter({constValue:!1})],h.prototype,"hasVvInstancing",void 0);a.HUDMaterialTechniqueConfiguration=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/LabelDeconflictor":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ./Deconflictor ./enums ../../../support/RenderState ../../../support/Yield".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){a.LabelDeconflictor=class extends f.Deconflictor{constructor(d){super(d);this.visibilityGroup=c.VisibilityGroup.LABEL;this.marginFactor=.05;this._lastDeconfliction=0}get viewState(){return this.parent.viewState}runTask(d){if(this.parent.running)return g.Yield;const t=performance.now();if(d.state!==e.RenderState.IDLE&&2E3>t-this._lastDeconfliction)return g.Yield;super.runTask(d);this.state===f.State.Idle&&(this._lastDeconfliction=t)}enabledChanged(d,t){this.modifyGraphics(t,
d.labelsEnabled)}getGraphicsLayers(d){return d.labelLayers}};b.__decorate([q.property({constructOnly:!0})],a.LabelDeconflictor.prototype,"parent",void 0);a.LabelDeconflictor=b.__decorate([h.subclass("esri.views.3d.layers.graphics.LabelDeconflictor")],a.LabelDeconflictor);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Labeler":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/asyncUtils ../../../../core/has ../../../../core/Logger ../../../../core/MapUtils ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../layers/graphics/hydratedFeatures ../../../../layers/support/labelFormatUtils ../../../../symbols/callouts/calloutUtils ./enums ./Graphics3DCalloutSymbolLayerFactory ./Graphics3DLineCalloutSymbolLayer ./graphicSymbolUtils ./LabelParameters ./labelPlacement ./placementUtils ../../webgl-engine/lib/MaterialCollection ../../webgl-engine/lib/TextRenderer ../../webgl-engine/lib/TextRenderParameters ../../webgl-engine/lib/TextTextureAtlas ../../webgl-engine/lib/WebGLLayer ../../../support/Scheduler ../../../support/Yield".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G){function I(J){return!J||0===J.length}function O(J){return!0===J.labelsVisible&&!!J.labelingInfo?.some(R=>!!R.symbol)}class L{constructor(J,R){this.labelingContext=J;this.graphics3DGraphic=R;this.textInitialized=this.addedToTextureAtlas=this.visible=this.hasGraphics3DResources=!1;this.textRenderers=[];this.textLabelPlacements=[]}}class P{constructor(J,R,Q,W,S){this.labelClass=J;this.graphics3DSymbol=R;this.graphics3DCalloutSymbolLayer=
Q;this.textRenderParameters=W;this.labelFunction=S;this.calloutSymbolLayerIndex=0}}class M{constructor(J,R,Q,W,S,V,T,Y){this.layer=R;this.graphics3DCore=Q;this.scaleVisibility=W;this.emptySymbolLabelSupported=S;this.elevationInfoOverride=V;this.disablePlacement=T;this.active=Y;this.labelClassAbortController=new AbortController;this.labelClassContexts=[];this.graphics=new Map;this.labelsToInitialize=new Map;this.stageLayer=new N.WebGLLayer(J,{pickable:!0,disableOctree:!0},R.uid)}destroy(){this.stageLayer.destroy()}}
a.Labeler=class extends q{constructor(J){super(J);this._dirty=!1;this._labels=new Map;this._labelingContexts=[]}setup(){this.dispose();this.addHandles([e.watch(()=>this.view.state?.camera,()=>this.setDirty()),e.watch(()=>this.view.state?.rasterPixelRatio,()=>this._resetAllLabels()),this.view.resourceController.scheduler.registerTask(E.TaskPriority.LABELER,this)]);this._textTextureAtlas=new H.TextTextureAtlas({view:this.view});this._hudMaterialCollection=new C.MaterialCollection(this.view._stage);
this._calloutMaterialCollection=new C.MaterialCollection(this.view._stage)}dispose(){this.removeAllHandles();this._textTextureAtlas=f.disposeMaybe(this._textTextureAtlas);this._hudMaterialCollection=f.disposeMaybe(this._hudMaterialCollection);this._calloutMaterialCollection=f.disposeMaybe(this._calloutMaterialCollection);this._labelingContexts.length=0;this._labels.clear()}destroy(){this.dispose();K.graphic=null;K.renderingInfo=null;K.layer=null}_activateLabelingContext(J){J.graphics.forEach((R,Q)=>
{const W=new L(J,R);this._labels.set(Q,W);J.labelsToInitialize.set(Q,W);R.setVisibilityFlag(n.VisibilityGroup.LABEL,n.VisibilityFlag.USER,!0)});J.active=!0}_deactivateLabelingContext(J){J.graphics.forEach((R,Q)=>{R.setVisibilityFlag(n.VisibilityGroup.LABEL,n.VisibilityFlag.USER,!1);this.setLabelGraphicVisibility(R,!1);R.clearLabelGraphics();this._labels.delete(Q)});J.active=!1}_addLabelTextureToAtlas(J){for(const R of J.graphics3DGraphic.labelLayers){if(!R._labelClass)continue;const Q=J.textRenderers[R._labelIndex];
Q&&(this._textTextureAtlas.addTextTexture(Q,R.stageObject),J.addedToTextureAtlas=!0)}}_removeLabelTextureFromAtlas(J){for(const R of J.graphics3DGraphic.labelLayers){if(!R._labelClass)continue;const Q=J.textRenderers[R._labelIndex];null!=Q&&(this._textTextureAtlas.removeTextTexture(Q,R.stageObject),J.addedToTextureAtlas=!1)}}get running(){return this.view.ready&&(this._dirty||this.deconflictor.running)}runTask(J){this._updateLabels(J);!this._dirty&&this.deconflictor.running&&this.deconflictor.runTask(J);
return G.Yield}_updateLabels(J){if(this._dirty){this._dirty=!1;for(const R of this._labelingContexts)R.active&&(R.labelClassPromise&&R.labelClassAbortController?this._dirty=!0:I(R.labelClassContexts)?null===R.labelClassContexts?this._deactivateLabelingContext(R):(this._createLabelClassContext(R),this._dirty=!0):h.someMap(R.labelsToInitialize,(Q,W)=>{this._ensureGraphics3DResources(Q)&&(this._labels.set(W,Q),this.deconflictor.setDirty(),J.madeProgress());if(Q.visible&&Q.textInitialized||!Q.visible&&
Q.hasGraphics3DResources)R.labelsToInitialize.delete(W),J.madeProgress();return J.done})&&(this._dirty=!0));this._dirty||this.notifyChange("updating")}}async _createLabelClassContextAsync(J){const R=J.labelClassAbortController?.signal;J.layer.when&&await J.layer.when();c.throwIfAborted(R);J.scaleVisibility?.updateScaleRangeActive();const Q=J.graphics3DCore,W=Q.layer.labelingInfo?.filter(S=>!!S.symbol);W&&0!==W.length&&(await l.forEach(W,async(S,V)=>{var T=S.symbol;const Y=y.getGraphics3DSymbol(Q.getOrCreateGraphics3DSymbol(T));
if(null==Y)k.getLogger(this).error("Failed to create Graphics3DSymbol for label");else{await Y.load();c.throwIfAborted(R);var ha=null;r.hasCalloutSupport(T)&&T.hasVisibleCallout()&&(ha=u.make(T,Q.symbolCreationContext),await ha.load(),c.throwIfAborted(R));T=await l.result(m.createLabelFunction(S,J.layer.fieldsIndex,this.view.spatialReference));c.throwIfAborted(R);if(!0===T.ok){const ba=await this._createTextRenderParameters(Y.symbol);c.throwIfAborted(R);J.labelClassContexts[V]=new P(S,Y,ha,ba,T.value)}else k.getLogger(this).error(`Label expression failed to evaluate: ${T.error}`)}}),
c.throwIfAborted(R))}async _createLabelClassContext(J){null==J.labelClassPromise&&(J.labelClassPromise=this._createLabelClassContextAsync(J).catch(R=>{if(c.isAbortError(R))throw R;J.labelClassContexts.length=0}).then(()=>{J.labelClassAbortController=null;this.notifyChange("updating")}).catch(()=>{}),this.notifyChange("updating"));return J.labelClassPromise}async _createTextRenderParameters(J){J=J.symbolLayers.at(0);return"text"!==J?.type?null:F.TextRenderParameters.fromSymbol(J,this.view.state.rasterPixelRatio)}_destroyLabelClassContext(J){for(var R of J.labelClassContexts)--R.graphics3DSymbol.referenced;
R=J.labelClassAbortController;J.labelClassAbortController=new AbortController;f.abortMaybe(R);J.labelClassContexts.length=0;J.labelClassPromise=null;this.notifyChange("updating")}_createTextSymbolGraphic(J,R,Q,W,S,V){J=new z.LabelParameters(Q,B.horizontalPlacementFromAnchor(Q.anchor),B.verticalPlacementFromAnchor(Q.anchor),J.text,w.fromValues(J.displayWidth,J.displayHeight));K.graphic=R;K.renderingInfo=null;K.layer=W;return S.createLabel(K,J,this._hudMaterialCollection,this._textTextureAtlas,()=>
{const T=A.getLabelPlacement(V);return T?T.elevationOffset:null})}_createLineCalloutGraphic(J,R,Q,W,S){K.graphic=J;K.layer=S;K.renderingInfo=new x.LineCalloutSymbolLayerRenderingInfo(null,R,W.translation,W.centerOffset,W.screenOffset[0],W.centerOffsetUnits,W.elevationOffset,this._calloutMaterialCollection);return Q.createGraphics3DGraphic(K)}_ensureGraphics3DResources(J){if(J.hasGraphics3DResources)return!1;const R=J.graphics3DGraphic;if(R.destroyed)return!1;this._ensureTextTextureResources(J);const Q=
J.labelingContext,W=Q.labelClassContexts;if(I(W)||!Q.emptySymbolLabelSupported&&0===R.layers.length)return!1;var S=!1,V=R.graphic;const T=Q.layer;var Y=O(Q.layer);for(let ba=0;ba<W.length;ba++){const U=J.textRenderers[ba],Z=J.textLabelPlacements[ba];if(null==U||null==Z)continue;const ca=W[ba];var ha=ca.graphics3DSymbol;const ea=ha.symbol&&"label-3d"===ha.symbol.type?ha.symbol:null;if(ha=ha.symbolLayers[0]){ha.setElevationInfoOverride(Q.elevationInfoOverride);S=new A.LabelInfo(R,ea,ca.labelClass);
S=this._createTextSymbolGraphic(U,V,Z,T,ha,S);if(null==S)return!1;S._labelClass=ca.labelClass;S._labelIndex=ba;R.addLabelGraphic(S,Q.stageLayer);R.deconflictionPriority=ca.textRenderParameters?.definition.size??0;R.setVisibilityFlag(n.VisibilityGroup.LABEL,n.VisibilityFlag.USER,Y);R.setVisibilityFlag(n.VisibilityGroup.LABEL,n.VisibilityFlag.SCALE_RANGE,!0);R.setVisibilityFlag(n.VisibilityGroup.LABEL,n.VisibilityFlag.DECONFLICTION,!1);S=!0;(Y=ca.graphics3DCalloutSymbolLayer)&&Z.hasLabelVerticalOffset&&
(Y.setElevationInfoOverride(Q.elevationInfoOverride),V=this._createLineCalloutGraphic(V,ea,Y,Z,T),null!=V&&(ca.calloutSymbolLayerIndex=R.labelLayers.length,R.addLabelGraphic(V,Q.stageLayer)));break}}S&&Q.scaleVisibility?.updateGraphicLabelScaleVisibility(R);return J.hasGraphics3DResources=!0}_destroyGraphics3DResources(J){const R=J.labelingContext.labelClassContexts;for(const Q of J.graphics3DGraphic.labelLayers)if(null!=Q._labelClass)R[Q._labelIndex].graphics3DSymbol.symbolLayers[0]?.onRemoveGraphic(Q);
J.graphics3DGraphic.deconflictionPriority=0;J.graphics3DGraphic.clearLabelGraphics();J.hasGraphics3DResources=!1}_ensureTextTextureResources(J){if(!J.textInitialized){var R=J.labelingContext,Q=R.labelClassContexts;if(!I(Q)){var W=J.graphics3DGraphic.graphic;for(let T=0;T<Q.length;T++){const Y=Q[T];J.textRenderers[T]=null;J.textLabelPlacements[T]=null;if(null==Y?.textRenderParameters)continue;var S=Y.labelFunction;let ha;if("arcade"===S.type)try{const ba=S.needsHydrationToEvaluate()?v.hydrateGraphic(W,
R.layer):W;ha=S.evaluate(ba)}catch(ba){ha=null}else ha=S.evaluate(W);if(null!=ha&&""!==ha&&!/^\s+$/.test(ha)&&(S=Y.graphics3DSymbol,S.symbolLayers[0]&&(S=A.getLabelPlacement({graphics3DGraphic:J.graphics3DGraphic,labelSymbol:"label-3d"===S.symbol?.type?S.symbol:null,labelClass:Y.labelClass,disablePlacement:R.disablePlacement}),null!=S))){var V=B.horizontalPlacementFromAnchor(S.anchor);V=B.textRenderAlignmentFromHorizontalPlacement(V);J.textRenderers[T]=new D.TextRenderer(ha,V,Y.textRenderParameters,
H.TextTextureAtlas.maxSize);J.textLabelPlacements[T]=S}}J.textInitialized=!0}}}_destroyTextTextureResources(J){J.textInitialized=!1;J.textRenderers.length=0;J.textLabelPlacements.length=0}_addGraphic(J,R){const Q=R.graphic.uid;J.graphics.set(Q,R);J.active&&(R=new L(J,R),this._labels.set(Q,R),J.labelsToInitialize.set(Q,R));this.setDirty();this.deconflictor.setDirty()}_updateGraphicGeometry(J,R){const Q=this._labels.get(R.graphic.uid);if(!Q)return!0;for(const W of Q.graphics3DGraphic.labelLayers)if(null!=
W._labelClass&&!J.labelClassContexts[W._labelIndex].graphics3DSymbol.symbolLayers[0].updateGeometry(W,R.graphic.geometry))return!1;this.setDirty();this.deconflictor.setDirty();return!0}_removeGraphic(J,R){R=R.graphic.uid;const Q=this._labels.get(R);J.graphics.delete(R);Q&&(this._destroyGraphic(Q,R),J.labelsToInitialize.delete(R),this.setDirty(),this.deconflictor.setDirty())}_destroyGraphic(J,R){this._labels.delete(R);J.addedToTextureAtlas&&this._removeLabelTextureFromAtlas(J);this._destroyTextTextureResources(J);
J.hasGraphics3DResources&&this._destroyGraphics3DResources(J)}async _labelingInfoChange(J,R){if(R)for(const Q of R){if(R=J.graphics.get(Q))this._removeGraphic(J,R),this._addGraphic(J,R)}else return this._visibilityInfoChange(J),this._resetLabels(J),this._createLabelClassContext(J)}_globalPropertyChanged(J,R){for(const Q of R.labelClassContexts){const W=new Map;R.graphics.forEach(S=>W.set(S.graphic.uid,S));Q.graphics3DSymbol.symbolLayers[0].globalPropertyChanged(J,W,S=>S.labelLayers[0]);Q.graphics3DCalloutSymbolLayer&&
Q.graphics3DCalloutSymbolLayer.globalPropertyChanged(J,W,S=>S.labelLayers[Q.calloutSymbolLayerIndex])}}_visibilityInfoChange(J){const R=O(J.layer);R&&!J.active&&this._activateLabelingContext(J);!R&&J.active&&this._deactivateLabelingContext(J);this.setDirty()}_resetAllLabels(){for(const J of this._labelingContexts)this._resetLabels(J)}_resetLabels(J){J.graphics.forEach((R,Q)=>{if(R=this._labels.get(Q))this._destroyGraphic(R,Q),R.visible=!1,J.labelsToInitialize.set(Q,R)});this._destroyLabelClassContext(J);
this.setDirty();this.deconflictor.setDirty()}_findLabelingContext(J){for(const R of this._labelingContexts)if(R.graphics3DCore===J)return R;return null}addGraphicsOwner(J,R,Q){const W=Q?.emptySymbolLabelSupported||!1,S=Q?.elevationInfoOverride||null;Q=Q?.disablePlacement||null;if(!this._findLabelingContext(J)){var V=J.layer,T=new M(this.view._stage,V,J,R,W,S,Q,O(V));this._labelingContexts.push(T);this.setDirty();return{addGraphic:Y=>this._addGraphic(T,Y),removeGraphic:Y=>this._removeGraphic(T,Y),
updateGraphicGeometry:Y=>this._updateGraphicGeometry(T,Y),layerLabelsEnabled:()=>O(T.layer),labelingInfoChange:Y=>this._labelingInfoChange(T,Y),elevationInfoChange:()=>this._globalPropertyChanged("elevationInfo",T),slicePlaneEnabledChange:()=>this._globalPropertyChanged("slicePlaneEnabled",T),visibilityInfoChange:()=>this._visibilityInfoChange(T),reset:()=>this._resetLabels(T),remove:()=>this._removeGraphicsOwner(J),setDirty:()=>this.setDirty()}}}_removeGraphicsOwner(J){const R=this._findLabelingContext(J);
R&&(J=this._labelingContexts.indexOf(R),this._labelingContexts.splice(J,1),R.graphics.forEach(Q=>this._removeGraphic(R,Q)),R.destroy(),this.setDirty())}setLabelGraphicVisibility(J,R){J=J.graphic.uid;const Q=this._labels.get(J);Q&&Q.visible!==R&&(R&&!Q.addedToTextureAtlas?(this._addLabelTextureToAtlas(Q),Q.textInitialized||Q.labelingContext.labelsToInitialize.set(J,Q)):!R&&Q.addedToTextureAtlas&&this._removeLabelTextureFromAtlas(Q),Q.visible=R,this.setDirty())}setDirty(){!this._dirty&&0<this._labelingContexts.length&&
(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._dirty||this._textTextureAtlas?.updating||this.deconflictor.updating||this._labelingContexts.some(J=>!!J.labelClassPromise&&!!J.labelClassAbortController)}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;const J=0<this._labelingContexts.length?this._labelingContexts.reduce((R,Q)=>R+(Q.labelClassPromise&&Q.labelClassAbortController?0:1),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating?
0:.1)+.1*J+.5*this.deconflictor.updatingProgress}get test(){}};b.__decorate([g.property({constructOnly:!0})],a.Labeler.prototype,"view",void 0);b.__decorate([g.property({constructOnly:!0})],a.Labeler.prototype,"deconflictor",void 0);b.__decorate([g.property()],a.Labeler.prototype,"_textTextureAtlas",void 0);b.__decorate([g.property({type:Boolean,readOnly:!0})],a.Labeler.prototype,"updating",null);a.Labeler=b.__decorate([t.subclass("esri.views.3d.layers.graphics.Labeler")],a.Labeler);const K=new x.LineCalloutCreationContext(null,
null,null);a.areLabelsVisible=O;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/hydratedFeatures":function(){define("exports ../../geometry ../../Graphic ../../core/has ../../core/lang ../../core/typedArrayUtil ../../geometry/support/jsonUtils ./dehydratedPoint ../../geometry/SpatialReference".split(" "),function(a,b,q,l,p,k,h,f,c){function e(u){return"declaredClass"in u}function g(u){return"declaredClass"in u}function d(u){return"declaredClass"in u}function t(u){return null==
u?null:e(u)?u:h.fromJSON(w(u))}function w(u){const {wkid:x,wkt:y,wkt2:z,latestWkid:A}=u.spatialReference,B={wkid:x,wkt:y,wkt2:z,latestWkid:A};switch(u.type){case "point":const {x:C,y:D,z:F,m:H}=u;return{x:C,y:D,z:F,m:H,spatialReference:B};case "polygon":const {rings:N,hasZ:E,hasM:G}=u;return{rings:v(N),hasZ:E,hasM:G,spatialReference:B};case "polyline":const {paths:I,hasZ:O,hasM:L}=u;return{paths:v(I),hasZ:O,hasM:L,spatialReference:B};case "extent":const {xmin:P,xmax:M,ymin:K,ymax:J,zmin:R,zmax:Q,
mmin:W,mmax:S,hasZ:V,hasM:T}=u;return{xmin:P,xmax:M,ymin:K,ymax:J,zmin:R,zmax:Q,mmin:W,mmax:S,hasZ:V,hasM:T,spatialReference:B};case "multipoint":const {points:Y,hasZ:ha,hasM:ba}=u;return{points:n(Y)?m(Y):Y,hasZ:ha,hasM:ba,spatialReference:B}}}function v(u){return r(u)?u.map(x=>m(x)):u}function m(u){return u.map(x=>Array.from(x))}function r(u){for(const x of u)if(0!==x.length)return n(x);return!1}function n(u){return 0<u.length&&(k.isFloat32Array(u[0])||k.isFloat64Array(u[0]))}a.clonePoint=function(u,
x){if(!u)return null;if(g(u)){if(null==x)return u.clone();if(g(x))return x.copy(u)}null!=x?(x.x=u.x,x.y=u.y,x.spatialReference=u.spatialReference,u.hasZ?(x.z=u.z,x.hasZ=u.hasZ):(x.z=void 0,x.hasZ=!1),u.hasM?(x.m=u.m,x.hasM=!0):(x.m=void 0,x.hasM=!1)):(x=f.makeDehydratedPoint(u.x,u.y,u.z,u.spatialReference),u.hasM&&(x.m=u.m,x.hasM=!0));return x};a.hydrateGeometry=t;a.hydrateGraphic=function(u,x){return u?d(u)?u:new q({layer:x,sourceLayer:x,visible:u.visible,symbol:p.clone(u.symbol),attributes:p.clone(u.attributes),
geometry:t(u.geometry)}):null};a.hydratedSpatialReference=function(u){const {wkid:x,wkt:y,wkt2:z,latestWkid:A}=u;return c.fromJSON({wkid:x,wkt:y,wkt2:z,latestWkid:A})};a.isHydratedGeometry=e;a.isHydratedGraphic=d;a.isHydratedPoint=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/labelFormatUtils":function(){define("exports ../../core/Error ../../core/Logger ../../core/sql ../../intl/date ../../intl/number ./domainUtils ./fieldUtils ./labelUtils ../../support/arcadeOnDemand".split(" "),
function(a,b,q,l,p,k,h,f,c,e){function g(v,m){if(null==v)return"";const r=m.domain;if(r)if("codedValue"===r.type||"coded-value"===r.type)for(var n of r.codedValues){if(n.code===v)return n.name}else if("range"===r.type){const {max:u,min:x}=h.getDomainRange(m);n=+v;if(null!=x&&null!=u&&x<=n&&n<=u)return r.name}f.isDateField(m)?v=p.formatDate(v,p.convertDateFormatToIntlOptions("short-date")):f.isNumericField(m)&&(v=k.formatNumber(+v));return v||""}const d=()=>q.getLogger("esri.layers.support.labelFormatUtils"),
t={type:"simple",evaluate(){return null}},w={getAttribute(v,m){return v.field(m)}};a.createLabelFunction=async function(v,m,r){if(!v||!v.symbol||!m)return t;const n=v.where,u=c.getLabelExpression(v);if("arcade"===u.type){const x=await e.createLabelExpression(u.expression,r,m);if(null==x)return t;v={type:"arcade",evaluate(y,z){try{const A="attributes"in y?x.repurposeFeature(y):y;A.contextTimeZone=z??null;const B=x.evaluate({$view:{timeZone:z},$feature:A},x.services);if(null!=B)return B.toString()}catch(A){d().error(new b("arcade-expression-error",
"Encountered an error when evaluating label expression for feature",{error:A,feature:y,expression:u}))}return null},needsHydrationToEvaluate(){return null==c.getSingleFieldArcadeExpression(u.expression)}}}else v={type:"simple",evaluate(x){return u.expression.replaceAll(/{[^}]*}/g,y=>{var z=y.slice(1,-1);z=m.get(z);if(!z)return y;y=null;"attributes"in x?x&&x.attributes&&(y=x.attributes[z.name]):y=x.field(z.name);return null==y?"":g(y,z)})}};if(n){let x;try{x=await l.parseWhereClause(n,m)}catch(z){return d().error(new b("bad-where-clause",
"Encountered an error when evaluating where clause, ignoring",{where:n,error:z})),t}const y=v.evaluate;v.evaluate=(z,A)=>{const B="attributes"in z?void 0:w;try{if(x.testFeature(z,B))return y(z,A)}catch(C){d().error(new b("bad-where-clause","Encountered an error when evaluating where clause for feature",{where:n,feature:z,error:C}))}return null}}return v};a.formatField=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DCalloutSymbolLayerFactory":function(){define(["exports",
"../../../../core/Logger","../../../../symbols/callouts/calloutUtils","./Graphics3DLineCalloutSymbolLayer"],function(a,b,q,l){const p=()=>b.getLogger("esri.views.3d.layers.graphics.Graphics3DCalloutSymbolLayerFactory"),k={line:l.Graphics3DLineCalloutSymbolLayer};a.make=function(h,f){if(!q.hasCalloutSupport(h))return p().error("Graphics3DCalloutSymbolLayerFactory#make",`symbol of type '${h.type}' does not support callouts`),null;if(!h.callout)return null;const c=k[h.callout.type];return c?new c(h,
f):(p().error("Graphics3DCalloutSymbolLayerFactory#make",`unknown or unsupported callout type ${h.callout.type}`),null)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer":function(){define("exports ../../../../Color ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../symbols/callouts/calloutUtils ./ElevationAligners ./elevationAlignmentUtils ./ElevationContext ./Graphics3DGraphicCreationContext ./Graphics3DObject3DGraphicLayer ./Graphics3DObjectMetadata ./Graphics3DSymbolLayer ./graphicUtils ./pointUtils ./SymbolComplexity ../../webgl-engine/lib/Attribute ../../webgl-engine/lib/ContentObjectType ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/LineCalloutMaterial".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){class z extends t.Graphics3DSymbolLayer{constructor(H,N){super(H,null,N,C);this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1};this.ensureDrapedStatus(!1)}async doLoad(){this._materials[0]=new y.LineCalloutMaterial(this._materialParameters);this._context.stage.add(this._materials[0])}destroy(){super.destroy();this._context.stage.remove(this._materials[0]);this._materials.length=0}_perInstanceMaterialParameters(H){const N=
this._materialParameters;N.horizontalScreenOffset=H.horizontalScreenOffset??0;N.centerOffsetUnits=H.centerOffsetUnits||"world";return N}get _materialParameters(){const H=new y.Parameters;var N=this.symbol,E=N.callout;H.color=null!=E.color?b.toUnitRGBA(E.color):[0,0,0,0];H.color[3]*=this._getLayerOpacity();H.size=q.pt2px(E.size||0);if(N.verticalOffset){const {screenLength:G,minWorldLength:I,maxWorldLength:O}=N.verticalOffset;H.verticalOffset={screenLength:q.pt2px(G),minWorldLength:I||0,maxWorldLength:null!=
O?O:Infinity}}H.borderColor=null!=E.border?.color?b.toUnitRGBA(E.border.color):null;E="object"===N.symbolLayers.at(0).type;N="label-3d"===N.type;H.occlusionTest=!E;H.shaderPolygonOffset=E?0:void 0;H.depthHUDAlignStart=N;H.hasSlicePlane=this._context.slicePlaneEnabled;H.screenSizePerspective=this._context.screenSizePerspectiveEnabled?this._context.sharedResources.screenSizePerspectiveSettings:null;return H}_defaultElevationInfoNoZ(){return B}createGraphics3DGraphic(H){const N=H.renderingInfo;H=H.graphic;
const E=this.setGraphicElevationContext(H,new c.ElevationContext,N.elevationOffset||0);var G=N.symbol;const I="on-the-ground"===this._elevationContext.mode&&("cim"===G.type||!G.symbolLayers.some(O=>"object"===O.type||"text"===O.type));if("label-3d"!==G.type&&I||"point-3d"===G.type&&G.symbolLayers.every(O=>"text"===O.type&&!k.textSymbolLayerSupportsVerticalOffset(O)))return null;G=w.computeCentroid(H.geometry);return null==G?null:this._createAs3DShape(G,E,N,H.uid)}layerOpacityChanged(){this._materials[0]?.setParameters(this._materialParameters)}layerElevationInfoChanged(H,
N,E){E=f.elevationModeChangeUpdateType(z.elevationModeChangeTypes,E,this._elevationContext.mode);if(E!==f.SymbolUpdateType.UPDATE)return E;H.forEach(G=>{const I=N(G);null!=I&&this.updateGraphicElevationContext(G.graphic,I)});return E}slicePlaneEnabledChanged(){this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){return!0}setGraphicElevationContext(H,N,E=0){super.setGraphicElevationContext(H,N);N.addOffsetRenderUnits(E);return N}updateGraphicElevationContext(H,
N){this.setGraphicElevationContext(H,N.elevationContext,null!=N.metadata?N.metadata.elevationOffset:0);N.needsElevationUpdates=f.needsElevationUpdates2D(N.elevationContext.mode)}computeComplexity(){return new m.SymbolComplexity({verticesPerFeature:6})}_getOrCreateMaterial(H){const N=this._perInstanceMaterialParameters(H),E=y.LineCalloutMaterial.uniqueMaterialIdentifier(N);if(E===this._materials[0]?.uniqueMaterialIdentifier)return{material:this._materials[0],isUnique:!1};if(null!=H.materialCollection){let G=
H.materialCollection.get(E);null==G&&(G=new y.LineCalloutMaterial(N),H.materialCollection.add(E,G));return{material:G,isUnique:!1}}return{material:new y.LineCalloutMaterial(N),isUnique:!0}}_createAs3DShape(H,N,E,G){var I=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:G,layerUid:this._context.layer.uid}),O=this._getOrCreateMaterial(E),L=u.Geometry,P=O.material;const {translation:M,centerOffset:K}=E;var J=M?new r.Attribute([M[0],M[1],M[2]],A,3,!0):new r.Attribute([0,0,0],A,3,!0);
const R=K?new r.Attribute([K[0],K[1],K[2],K[3]],A,4,!0):new r.Attribute([0,0,0,1],A,4,!0);J=[[x.VertexAttribute.POSITION,J],[x.VertexAttribute.NORMAL,new r.Attribute([0,0,1],A,3,!0)],[x.VertexAttribute.CENTEROFFSETANDDISTANCE,R]];I=new L(P,J,null,n.ContentObjectType.Point,I);G=v.createStageObject(this._context,H,I,N,G);if(null==G)return null;O=new g.Graphics3DObject3DGraphicLayer(this,G.object,[I],O.isUnique?[O.material]:null,null,h.perObjectElevationAligner,N);O.metadata=new d.Graphics3DObjectMetadata(E.elevationOffset);
O.alignedSampledElevation=G.sampledElevation;O.needsElevationUpdates=f.needsElevationUpdates2D(N.mode);v.extendPointGraphicElevationContext(O,H,this._context.elevationProvider);return O}}z.elevationModeChangeTypes={definedChanged:f.SymbolUpdateType.UPDATE,staysOnTheGround:f.SymbolUpdateType.UPDATE,onTheGroundChanged:f.SymbolUpdateType.RECREATE};const A=[0],B={mode:"relative-to-ground",offset:0},C={ignoreDrivers:!0,renderPriority:0,renderPriorityStep:1};class D{constructor(H,N,E=l.create(),G=p.create(),
I=0,O="world",L=0,P=null){this.renderer=H;this.symbol=N;this.translation=E;this.centerOffset=G;this.horizontalScreenOffset=I;this.centerOffsetUnits=O;this.elevationOffset=L;this.materialCollection=P}}class F extends e.Graphics3DGraphicCreationContext{}a.Graphics3DLineCalloutSymbolLayer=z;a.LineCalloutCreationContext=F;a.LineCalloutSymbolLayerRenderingInfo=D;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/ElevationAligners":function(){define("exports ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/computeTranslationToOriginAndRotation ../../../../geometry/projection/projectBuffer ./elevationAlignmentUtils ../../support/debugFlags ../../support/ElevationProvider ../../webgl-engine/lib/GeometryWithMapPositions ../../webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){function t(y,z,A,B,C){let D=!1;var F=y.transformation;z=z.requiresSampledElevationInfo;m[0]=F[12];m[1]=F[13];m[2]=F[14];y.invalidateBoundingInfo();var H=y.getMutableAttribute(d.VertexAttribute.POSITION);F=H.data;H=H.size;const N=F.length/H;y=new e.SamplePosition(y.mapPositions,A);let E=0,G=0;for(let I=0;I<N;I++){r[0]=F[E];r[1]=F[E+1];r[2]=F[E+2];B(y,x);z&&(G+=x.sampledElevation);if(c.debugFlags.TESTS_DISABLE_OPTIMIZATIONS)F[E]=y.array[y.offset],F[E+1]=y.array[y.offset+
1],F[E+2]=x.z,h.projectBuffer(F,A,E,F,C.spatialReference,E,1),F[E]-=m[0],F[E+1]-=m[1],F[E+2]-=m[2],D=!0;else{v[0]=F[E]+m[0];v[1]=F[E+1]+m[1];v[2]=F[E+2]+m[2];C.setAltitude(v,x.z);F[E]=v[0]-m[0];F[E+1]=v[1]-m[1];F[E+2]=v[2]-m[2];const O=.01/C.unitInMeters;if(Math.abs(r[0]-F[E])>=O||Math.abs(r[1]-F[E+1])>=O||Math.abs(r[2]-F[E+2])>=O)D=!0}E+=H;y.offset+=3}return{update:D,averageGeometrySampledElevation:G/N}}const w=q.create(),v=p.create(),m=p.create(),r=p.create(),n=q.create(),u=p.create(),x=new f.SampleElevationInfo;
a.perLodInstanceElevationAligner=function(y,z,A,B,C){var D=y.graphics3DSymbolLayer.lodRenderer;if(null==D)return 0;A=z.centerPointInElevationSR;B(A,x);z="absolute-height"!==z.mode?x.sampledElevation:0;B=D.instanceData;y=y.instanceIndex;B.getGlobalTransform(y,n);D=l.set(u,n[12],n[13],n[14]);c.debugFlags.TESTS_DISABLE_OPTIMIZATIONS?(v[0]=A.x,v[1]=A.y,v[2]=x.z,k.computeTranslationToOriginAndRotation(A.spatialReference,v,n,C.spatialReference)&&B.setGlobalTransform(y,n)):C.setAltitudeOfTransformation(x.z,
n);C=.01/C.unitInMeters;(c.debugFlags.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(n[12]-D[0])>=C||Math.abs(n[13]-D[1])>=C||Math.abs(n[14]-D[2])>=C)&&B.setGlobalTransform(y,n);return z};a.perObjectElevationAligner=function(y,z,A,B,C,D){y=y.stageObject;const F=z.centerPointInElevationSR;A=0;y.usesVerticalDistanceToGround?(B(F,x),f.updateVertexPointGroundDistance(y,x.verticalDistanceToGround),A=x.sampledElevation):(B(F,x),"absolute-height"!==z.mode&&(A=x.sampledElevation));z=b.copy(w,D??y.transformation);
B=l.set(u,z[12],z[13],z[14]);c.debugFlags.TESTS_DISABLE_OPTIMIZATIONS?(v[0]=F.x,v[1]=F.y,v[2]=x.z,k.computeTranslationToOriginAndRotation(F.spatialReference,v,z,C.spatialReference)&&(D?b.copy(D,z):y.transformation=z)):C.setAltitudeOfTransformation(x.z,z);C=.01/C.unitInMeters;if(Math.abs(z[12]-B[0])>=C||Math.abs(z[13]-B[1])>=C||Math.abs(z[14]-B[2])>=C)D?b.copy(D,z):y.transformation=z;return A};a.perVertexElevationAligner=function(y,z,A,B,C){y=y.stageObject;const D=y.geometries;let F=0;for(const H of D){if(!g.isGeometryWithMapPositions(H))continue;
const {update:N,averageGeometrySampledElevation:E}=t(H,z,A,B,C);F+=E;N&&y.geometryVertexAttributeUpdated(H,d.VertexAttribute.POSITION)}return F/D.length};a.sharedGeometryElevationAligner=function(y,z,A,B,C){y=y.stageObject;const D=y.geometries;if(0===D.length)return 0;let F=0,H=null,N=0,E=!1;for(const G of D){if(!g.isGeometryWithMapPositions(G))continue;const I=G.attributes.get(d.VertexAttribute.POSITION);if(I!==H){const {update:O,averageGeometrySampledElevation:L}=t(G,z,A,B,C);N=L;H=I;E=O}E&&y.geometryVertexAttributeUpdated(G,
d.VertexAttribute.POSITION);F+=N}return F/D.length};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/elevationAlignmentUtils":function(){define("exports ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/computeTranslationToOriginAndRotation ../../../../geometry/projection/projectBuffer ../../../../layers/graphics/dehydratedFeatureUtils ../../support/ElevationProvider ../../webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c){function e(r,n,u,x,y){const z=(h.isDehydratedPoint(r)?r.z:f.isSamplePosition(r)?r.array[r.offset+2]:r[2])||0;switch(u.mode){case "on-the-ground":u=f.getElevationAtPoint(n,r,"ground")??0;y.verticalDistanceToGround=0;y.sampledElevation=u;y.z=u;break;case "relative-to-ground":r=f.getElevationAtPoint(n,r,"ground")??0;u=u.geometryZWithOffset(z,x);y.verticalDistanceToGround=u;y.sampledElevation=r;y.z=u+r;break;case "relative-to-scene":r=f.getElevationAtPoint(n,r,"scene")??0;
u=u.geometryZWithOffset(z,x);y.verticalDistanceToGround=u;y.sampledElevation=r;y.z=u+r;break;case "absolute-height":u=u.geometryZWithOffset(z,x);x=f.getElevationAtPoint(n,r,"ground")??0;y.verticalDistanceToGround=u-x;y.sampledElevation=x;y.z=u;break;default:y.z=0}}function g(r,n){for(let u=0;u<r.geometries.length;++u){const x=r.geometries[u].getMutableAttribute(c.VertexAttribute.CENTEROFFSETANDDISTANCE);x&&x.data[3]!==n&&(x.data[3]=n,r.geometryVertexAttributeUpdated(r.geometries[u],c.VertexAttribute.CENTEROFFSETANDDISTANCE))}}
class d{constructor(){this.z=this.sampledElevation=this.verticalDistanceToGround=0}}a.SymbolUpdateType=void 0;(function(r){r[r.NONE=0]="NONE";r[r.UPDATE=1]="UPDATE";r[r.RECREATE=2]="RECREATE"})(a.SymbolUpdateType||(a.SymbolUpdateType={}));const t={"absolute-height":{applyElevationAlignmentBuffer:function(r,n,u,x,y,z,A,B){z=B.calculateOffsetRenderUnits(A);B=B.featureExpressionInfoContext;n*=3;x*=3;for(A=0;A<y;++A){const C=r[n+1],D=r[n+2];u[x]=r[n];u[x+1]=C;u[x+2]=null==B?D+z:z;n+=3;x+=3}return 0},
requiresAlignment:function(r){const n=r.featureExpressionInfoContext;return 0!==r.meterUnitOffset||null!=n}},"on-the-ground":{applyElevationAlignmentBuffer:function(r,n,u,x,y,z){let A=0;const B=z.spatialReference;n*=3;x*=3;for(let C=0;C<y;++C){const D=r[n],F=r[n+1],H=z.getElevation(D,F,r[n+2],B,"ground")??0;A+=H;u[x]=D;u[x+1]=F;u[x+2]=H;n+=3;x+=3}return A/y},requiresAlignment:()=>!0},"relative-to-ground":{applyElevationAlignmentBuffer:function(r,n,u,x,y,z,A,B){let C=0;A=B.calculateOffsetRenderUnits(A);
B=B.featureExpressionInfoContext;const D=z.spatialReference;n*=3;x*=3;for(let F=0;F<y;++F){const H=r[n],N=r[n+1],E=r[n+2],G=z.getElevation(H,N,E,D,"ground")??0;C+=G;u[x]=H;u[x+1]=N;u[x+2]=null==B?E+G+A:G+A;n+=3;x+=3}return C/y},requiresAlignment:()=>!0},"relative-to-scene":{applyElevationAlignmentBuffer:function(r,n,u,x,y,z,A,B){let C=0;A=B.calculateOffsetRenderUnits(A);B=B.featureExpressionInfoContext;const D=z.spatialReference;n*=3;x*=3;for(let F=0;F<y;++F){const H=r[n],N=r[n+1],E=r[n+2],G=z.getElevation(H,
N,E,D,"scene")??0;C+=G;u[x]=H;u[x+1]=N;u[x+2]=null==B?E+G+A:G+A;n+=3;x+=3}return C/y},requiresAlignment:()=>!0}},w=q.create(),v=new d,m=l.create();a.SampleElevationInfo=d;a.applyElevationAlignmentForHUD=function(r,n,u,x,y){e(n,u,y,x,v);g(r,v.verticalDistanceToGround);u=v.sampledElevation;y=b.copy(w,r.transformation);m[0]=n.x;m[1]=n.y;m[2]=v.z;p.computeTranslationToOriginAndRotation(n.spatialReference,m,y,x.spatialReference)?r.transformation=y:console.warn("Could not locate symbol object properly, it might be misplaced");
return u};a.applyPerVertexElevationAlignment=function(r,n,u,x,y,z,A,B,C,D,F){const H=t[F.mode];let N=0;if(k.projectBuffer(r,n,u,x,C.spatialReference,y,B)&&(H.requiresAlignment(F)?(N=H.applyElevationAlignmentBuffer(x,y,z,A,B,C,D,F),r=z,y=A):r=x,k.projectBuffer(r,C.spatialReference,y,z,D.spatialReference,A,B)))return N};a.elevationModeChangeUpdateType=function(r,n,u){return"on-the-ground"===n&&"on-the-ground"===u?r.staysOnTheGround:n===u||"on-the-ground"!==n&&"on-the-ground"!==u?null==n||null==u?r.definedChanged:
a.SymbolUpdateType.UPDATE:r.onTheGroundChanged};a.evaluateElevationAlignmentAtPoint=function(r,n,u,x){e(r,n,u,x,v);return v.z};a.evaluateElevationInfoAtPoint=e;a.needsElevationUpdates2D=function(r){return"relative-to-ground"===r||"relative-to-scene"===r};a.needsElevationUpdates3D=function(r){return"absolute-height"!==r};a.updateVertexPointGroundDistance=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/GeometryWithMapPositions":function(){define(["exports",
"./Geometry"],function(a,b){class q extends b.Geometry{}a.GeometryWithMapPositions=q;a.isGeometryWithMapPositions=function(l){return null!=l.mapPositions};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/ElevationContext":function(){define(["exports","../../../../symbols/support/unitConversionUtils","./featureExpressionInfoUtils"],function(a,b,q){class l{constructor(){this._renderUnitOffset=this._meterUnitOffset=0;this._unit="meters";this._metersPerElevationInfoUnit=
1;this.mode=this.centerPointInElevationSR=this._featureExpressionInfoContext=null}get featureExpressionInfoContext(){return this._featureExpressionInfoContext}get meterUnitOffset(){return this._meterUnitOffset}get unit(){return this._unit}set unit(p){this._unit=p;this._metersPerElevationInfoUnit=b.getMetersPerUnit(p)}get requiresSampledElevationInfo(){return"absolute-height"!==this.mode}reset(){this.mode=null;this._renderUnitOffset=this._meterUnitOffset=0;this._featureExpressionInfoContext=null;this.unit=
"meters"}set offsetMeters(p){this._meterUnitOffset=p;this._renderUnitOffset=0}set offsetElevationInfoUnits(p){this._meterUnitOffset=p*this._metersPerElevationInfoUnit;this._renderUnitOffset=0}addOffsetRenderUnits(p){this._renderUnitOffset+=p}geometryZWithOffset(p,k){k=this.calculateOffsetRenderUnits(k);return null!=this.featureExpressionInfoContext?k:p+k}calculateOffsetRenderUnits(p){let k=this._meterUnitOffset;const h=this.featureExpressionInfoContext;null!=h&&(k+=q.execute(h)*this._metersPerElevationInfoUnit);
return k/p.unitInMeters+this._renderUnitOffset}setFromElevationInfo(p){this.mode=p.mode;this.unit=b.supportsUnit(p.unit)?p.unit:"meters";this.offsetElevationInfoUnits=p.offset??0}updateFeatureExpressionInfoContext(p,k,h){if(null==p)this._featureExpressionInfoContext=null;else{var f=p?.arcade;f&&null!=k&&null!=h?(this._featureExpressionInfoContext=q.clone(p),q.setContextFeature(this._featureExpressionInfoContext,q.createFeature(f.modules,k,h))):this._featureExpressionInfoContext=p}}static fromElevationInfo(p){const k=
new l;null!=p&&k.setFromElevationInfo(p);return k}}a.ElevationContext=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/featureExpressionInfoUtils":function(){define(["exports","../../../../core/Logger","../../../../core/promiseUtils","../../../../layers/graphics/hydratedFeatures","../../../../support/arcadeOnDemand"],function(a,b,q,l,p){a.clone=function(k){return{cachedResult:k.cachedResult,arcade:k.arcade?{func:k.arcade.func,context:k.arcade.modules.arcadeUtils.createExecContext(null,
{sr:k.arcade.context.spatialReference}),modules:k.arcade.modules}:null}};a.createContext=async function(k,h,f,c){k=k?.expression;if("string"!==typeof k)return null;var e="0"===k?0:null;if(null!=e)return{cachedResult:e};e=await p.loadArcade();q.throwIfAborted(f);f=e.arcadeUtils;k=f.createSyntaxTree(k);return f.dependsOnView(k)?(null!=c&&c.error("Expressions containing '$view' are not supported on ElevationInfo"),{cachedResult:0}):{arcade:{func:f.createFunction(k),context:f.createExecContext(null,{sr:h}),
modules:e}}};a.createContextWithoutExpressionSupport=function(k){k=k?.expression;return"string"===typeof k&&(k="0"===k?0:null,null!=k)?{cachedResult:k}:null};a.createFeature=function(k,h,f){return k.arcadeUtils.createFeature(h.attributes,h.geometry,f)};a.execute=function(k){if(null!=k){if(null!=k.cachedResult)return k.cachedResult;var h=k.arcade;h=h?.modules.arcadeUtils.executeFunction(h.func,h.context);"number"!==typeof h&&(h=k.cachedResult=0);return h}return 0};a.extractExpressionInfo=function(k,
h=!1){k=k?.featureExpressionInfo;h||"0"===k?.expression||(k=null);return k??null};a.setContextFeature=function(k,h){null!=k&&null==k.cachedResult&&(h&&k.arcade?(h._geometry&&(h._geometry=l.hydrateGeometry(h._geometry)),k.arcade.modules.arcadeUtils.updateExecContext(k.arcade.context,h)):b.getLogger("esri.views.3d.layers.graphics.featureExpressionInfoUtils").errorOncePerTick("Arcade support required but not provided"))};a.zeroContext={cachedResult:0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/layers/graphics/Graphics3DGraphicCreationContext":function(){define(["exports"],function(a){class b{constructor(q,l,p){this.graphic=q;this.renderingInfo=l;this.layer=p}}a.Graphics3DGraphicCreationContext=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer":function(){define("exports ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ../../../../chunks/sphere ./elevationAlignmentUtils ./featureExpressionInfoUtils ./graphicUtils ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/edgeRendering/interfaces".split(" "),
function(a,b,q,l,p,k,h,f,c,e){function g(n){return n.isVisible()?n.parameters.transparent?e.Transparency.TRANSPARENT:e.Transparency.OPAQUE:e.Transparency.INVISIBLE}class d{constructor(n,u,x){this.baseMaterial=n;this.edgeMaterials=u;this.properties=x}}class t{get isElevationSource(){return!!this.stageObject.lastValidElevationBB}constructor(n,u,x,y,z,A,B,C=null){this.graphics3DSymbolLayer=n;this.stageObject=u;this._uniqueGeometries=x;this._uniqueMaterials=y;this._sharedResource=z;this.elevationAligner=
A;this.elevationContext=B;this._edgeState=C;this.type="object3d";this._stageLayer=null;this._addedToStage=this._visible=!1;this.alignedSampledElevation=0;this.useObjectOriginAsAttachmentOrigin=this.needsElevationUpdates=!1}initialize(n){this._stageLayer=n;n=n.stage;n.addMany(this._uniqueMaterials);n.addMany(this._uniqueGeometries);n.add(this.stageObject)}destroy(){if(this._stageLayer){var n=this._stageLayer.stage;n.removeMany(this._uniqueMaterials);n.removeMany(this._uniqueGeometries);n.remove(this.stageObject);
this._addedToStage&&(this._stageLayer.remove(this.stageObject),this._addedToStage=!1);n.renderer.edgeView?.removeObject(this.stageObject);this.stageObject.dispose();this._sharedResource?.release();this._visible=!1;this._stageLayer=null}}layerOpacityChanged(n,u){const {stageObject:x,_edgeState:y,_stageLayer:z}=this;if(null!=y){var A=g(y.baseMaterial),B=!1;for(const C of y.edgeMaterials)C.objectTransparency!==A&&(C.objectTransparency=A,B=!0);B&&this.resetEdgeObject(u);z.stage.renderer.withEdgeView(C=>
{C.updateAllComponentOpacities(x,[n])})}}slicePlaneEnabledChanged(n,u){const {stageObject:x,_edgeState:y,_stageLayer:z}=this;null!=y&&z.stage.renderer.withEdgeView(A=>{A.updateAllComponentMaterials(x,y.edgeMaterials,{hasSlicePlane:n},!u);y.properties.hasSlicePlane=n})}setVisibility(n){const {_edgeState:u,stageObject:x,_stageLayer:y}=this;null!=y&&this.visible!==n&&(this._visible=n,(x.visible=n)&&!this._addedToStage&&(y.add(x),this._addedToStage=!0),null!=u&&y.stage.renderer.withEdgeView(z=>{z.hasObject(x)?
z.updateObjectVisibility(x,n):n&&this._addOrUpdateEdgeObject(u,z,!1)}))}get visible(){return this._visible}alignWithElevation(n,u,x,y){null!=this.elevationAligner&&(null!=x&&h.setContextFeature(this.elevationContext.featureExpressionInfoContext,x),this.alignedSampledElevation=this.elevationAligner(this,this.elevationContext,n.spatialReference,(z,A)=>k.evaluateElevationInfoAtPoint(z,n,this.elevationContext,u,A),u),this.resetEdgeObject(y))}alignWithAbsoluteElevation(n,u,x){this.alignedSampledElevation=
this.elevationAligner(this,this.elevationContext,null,(y,z)=>{z.sampledElevation=n;z.verticalDistanceToGround=0;z.z=n},u);this.resetEdgeObject(x)}getCenterObjectSpace(n=q.create()){return b.copy(n,p.getCenter(this.stageObject.boundingVolumeObjectSpace.bounds))}getBoundingBoxObjectSpace(n=l.create()){const u=this.stageObject.boundingVolumeObjectSpace;l.setMin(n,u.min);l.setMax(n,u.max);return n}computeAttachmentOrigin(n){const u=this.stageObject.effectiveTransformation;if(this.useObjectOriginAsAttachmentOrigin)n.render.origin[0]+=
u[12],n.render.origin[1]+=u[13],n.render.origin[2]+=u[14],n.render.num++;else for(const x of this.stageObject.geometries)x.computeAttachmentOrigin(m)&&(b.transformMat4(m,m,u),b.add(n.render.origin,n.render.origin,m),n.render.num++)}async getProjectedBoundingBox(n,u,x,y,z){z=this.getBoundingBoxObjectSpace(z);var A=r,B=l.isPoint(z)?1:A.length;for(var C=0;C<B;C++){const D=A[C];v[0]=z[D[0]];v[1]=z[D[1]];v[2]=z[D[2]];b.transformMat4(v,v,this.stageObject.transformation);w[3*C]=v[0];w[3*C+1]=v[1];w[3*C+
2]=v[2]}if(!n(w,0,B))return null;l.empty(z);n=null;this.calculateRelativeScreenBounds&&(n=this.calculateRelativeScreenBounds());for(A=0;A<3*B;A+=3){for(C=0;3>C;C++)z[C]=Math.min(z[C],w[A+C]),z[C+3]=Math.max(z[C+3],w[A+C]);n&&x.push({location:w.slice(A,A+3),screenSpaceBoundingRect:n})}if(u?.service&&"absolute-height"!==this.elevationContext.mode){l.center(z,m);x="relative-to-scene"===this.elevationContext.mode?"scene":"ground";B=0;if(u.useViewElevation)B=u.service.getElevation(m[0],m[1],x)??0;else try{const D=
f.demResolutionForBoundingBox(z,u.service.spatialReference,u);B=await u.service.queryElevation(m[0],m[1],y,D,x)??0}catch(D){}l.offset(z,0,0,-this.alignedSampledElevation+B)}return z}addObjectState(n,u){n===c.Object3DState.Highlight&&u.addObject(this.stageObject,this.stageObject.highlight());n===c.Object3DState.MaskOccludee&&u.addObject(this.stageObject,this.stageObject.maskOccludee())}removeObjectState(n){n.removeObject(this.stageObject)}resetEdgeObject(n){const {_edgeState:u,stageObject:x,_stageLayer:y,
_visible:z}=this;null!=u&&y.stage.renderer.withEdgeView(A=>{z?this._addOrUpdateEdgeObject(u,A,n):A.removeObject(x)})}_addOrUpdateEdgeObject(n,u,x){const y=g(n.baseMaterial);for(const z of n.edgeMaterials)z.objectTransparency=y;u.addOrUpdateObject3D(this.stageObject,n.edgeMaterials,n.properties,!x).then(()=>this._stageLayer?.sync())}}const w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=q.create(),m=q.create(),r=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];a.Graphics3DObject3DGraphicLayer=
t;a.Object3DEdgeState=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/graphicUtils":function(){define("exports ../../../../core/unitUtils ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/projection ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/centroid ../../../../geometry/support/coordsUtils ../../../../layers/graphics/dehydratedPoint ../../../../layers/graphics/hydratedFeatures".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(n){var u=n.paths[0];if(!u||0===u.length)return null;u=d.getPointOnPath(u,d.getPathLength(u)/2);return t.makeDehydratedPoint(u[0],u[1],u[2],n.spatialReference)}function m(n,u,x){x=x?n:w.clonePoint(n);return u&&n?f.projectPoint(n,x,u)?x:null:x}function r(n){const u=x=>null==x||0<=x;return Array.isArray(n)?n.every(u):null==n||0<=n}a.computeCentroid=function(n,u){if("point"===n.type)return m(n,u,!1);if(w.isHydratedGeometry(n))switch(n.type){case "extent":return m(n.center,
u,!1);case "polygon":return m(n.centroid,u,!1);case "polyline":return m(v(n),u,!0);case "mesh":return m(n.origin,u,!1)}else switch(n.type){case "extent":return n=t.makeDehydratedPoint(.5*(n.xmax+n.xmin),.5*(n.ymax+n.ymin),null!=n.zmin&&null!=n.zmax&&isFinite(n.zmin)&&isFinite(n.zmax)?.5*(n.zmax+n.zmin):void 0,n.spatialReference),m(n,u,!0);case "polygon":var x=n.rings[0];x&&0!==x.length?(x=g.ringsCentroid(n.rings,!!n.hasZ),n=t.makeDehydratedPoint(x[0],x[1],x[2],n.spatialReference)):n=null;return m(n,
u,!0);case "polyline":return m(v(n),u,!0)}};a.computeObjectRotation=function(n,u,x,y=l.create()){n&&q.rotateZ(y,y,-n/180*Math.PI);u&&q.rotateX(y,y,u/180*Math.PI);x&&q.rotateY(y,y,x/180*Math.PI);return y};a.computeObjectScale=function(n=p.ONES,u,x,y=1){const z=Array(3);if(null==u||null==x)z[0]=1,z[1]=1,z[2]=1;else{let B=0;for(let C=2;0<=C;C--){const D=n[C];let F;const H=null!=D,N=0===C&&!A&&!H,E=x[C];"symbol-value"===D||N?F=0!==E?u[C]/E:1:H&&"proportional"!==D&&isFinite(D)&&(F=0!==E?D/E:1);if(null!=
F){var A=z[C]=F;B=Math.max(B,Math.abs(F))}}for(n=2;0<=n;n--)null==z[n]?z[n]=A:0===z[n]&&(z[n]=.001*B)}for(A=2;0<=A;A--)z[A]/=y;return p.fromArray(z)};a.demResolutionForBoundingBox=function(n,u,x){if(null!=x.minDemResolution)return x.minDemResolution;const y=b.getMetersPerUnitForSR(u),z=c.width(n)*y,A=c.depth(n)*y;n=c.height(n)*(u.isGeographic?1:y);return 0===z&&0===A&&0===n?x.minDemResolutionForPoints:.01*Math.max(z,A,n)};a.enlargeExtent=function(n,u,x,y=0){if(n){u||=e.create();let z=.5*n.width*(x-
1);x=.5*n.height*(x-1);n.width<1E-7*n.height?z+=x/20:n.height<1E-7*n.width&&(x+=z/20);k.set(u,n.xmin-z-y,n.ymin-x-y,n.xmax+z+y,n.ymax+x+y);return u}return null};a.isValidSize=r;a.mixinColorAndOpacity=function(n,u,x=null){const y=h.clone(h.ONES);null!=n&&(y[0]=n[0],y[1]=n[1],y[2]=n[2]);null!=u?y[3]=u:null!=n&&3<n.length&&(y[3]=n[3]);x&&(y[0]*=x,y[1]*=x,y[2]*=x,y[3]*=x);return y};a.overrideColor=function(n,u,x,y,z,A=[0,0,0,0]){for(let B=0;3>B;++B)A[B]=null!=n?.[B]?n[B]:null!=x?.[B]?x[B]:z[B];A[3]=null!=
u?u:null!=y?y:z[3];return A};a.validateSymbolLayerSize=function(n){return r(null!=n.isPrimitive?[n.width,n.depth,n.height]:n)?null:"Symbol sizes may not be negative values"};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/edgeRendering/interfaces":function(){define(["exports"],function(a){a.Transparency=void 0;var b=a.Transparency||(a.Transparency={});b[b.INVISIBLE=0]="INVISIBLE";b[b.TRANSPARENT=1]="TRANSPARENT";b[b.OPAQUE=2]="OPAQUE";Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DObjectMetadata":function(){define(["exports"],function(a){class b{constructor(q,l=null){this.labelText=l;this.elevationOffset=q??0}}a.Graphics3DObjectMetadata=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DSymbolLayer":function(){define("exports ../../../../Color ../../../../core/has ../../../../core/Logger ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/support/coordsUtils ./defaultSymbolComplexity ./elevationAlignmentUtils ./ElevationContext ./featureExpressionInfoUtils ./graphicUtils ./interfaces ./Loadable ../support/FastSymbolUpdates".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(z){const A={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1};z&&"visualVariables"in z&&z.visualVariables&&z.visualVariables.forEach(B=>{switch(B.type){case "color":A.color=!0;if(B.stops)for(let C=0;C<B.stops.length;C++){const D=B.stops[C].color;D&&(A.opacity=!0,1>D.a&&(A.opacityAlwaysOpaque=!1))}break;case "opacity":A.opacity=!0;A.opacityAlwaysOpaque=!1;break;case "size":A.size=!0}});return A}const r=()=>l.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayer");
class n extends w.Loadable{constructor(z,A,B,C){super(B.schedule);this.symbol=z;this.symbolLayer=A;this._context=B;this.ignoreDrivers=!1;this._drivenProperties={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1};this._materials=[];this.usedMemory=0;this.logger=r();this._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0};this.skipHighSymbolLodsChanged=!0;this._renderPriority=C.renderPriority;this._renderPriorityStep=C.renderPriorityStep;this._elevationContext=new e.ElevationContext;
this.complexity=this.computeComplexity();this.ignoreDrivers=C.ignoreDrivers;this.ignoreDrivers||(this._drivenProperties=m(this._context.renderer));this._updateElevationContext()}getCachedSize(){return null}get extentPadding(){return 0}get materials(){return this._materials}_drivenPropertiesChanged(z){if(this.ignoreDrivers)return!1;const A=this._drivenProperties;z=m(z);return z.color!==A.color||z.opacity!==A.opacity||z.opacityAlwaysOpaque!==A.opacityAlwaysOpaque||z.size!==A.size}get needsDrivenTransparentPass(){return this._drivenProperties.opacity&&
!this._drivenProperties.opacityAlwaysOpaque}_logGeometryCreationWarnings(z,A,B,C){const D="polygons"in z?z.polygons:null,F=`${C} geometry failed to be created`;z.projectionSuccess?!this._logGeometryValidationWarnings(A,B,C)&&D&&0===D.length&&"rings"===B&&0<A.length&&2<A[0].length&&r().warnOncePerTick(`${F} (filled rings should use clockwise winding - try reversing the order of vertices)`):r().warnOncePerTick(`${F} (failed to project geometry to view spatial reference)`)}_logGeometryValidationWarnings(z,
A,B){B=`${B} geometry failed to be created`;return!z.length||1===z.length&&!z[0].length?(r().warnOncePerTick(`${B} (no ${A} were defined)`),!0):Array.isArray(z)&&Array.isArray(z[0])?!1:(r().warnOncePerTick(`${B} (${A} should be defined as a 2D array)`),!0)}_validateGeometry(z,A=null,B=null){if(null!=A&&!A.includes(z.type))return this.logger.warn("unsupported geometry type for "+B+` symbol: ${z.type}`),!1;switch(z.type){case "point":if(!isFinite(z.x)||!isFinite(z.y))return r().warn("point coordinate is not a valid number, graphic skipped"),
!1;break;case "polygon":h.closeRings(z)&&r().warnOncePerTick("Fixed a non-closed polygon ring.")}return!0}_defaultElevationInfoNoZ(){return u}_defaultElevationInfoZ(){return x}_updateElevationContext(){null!=this._elevationInfoOverride?(this._elevationContext.setFromElevationInfo(this._elevationInfoOverride),this._elevationContext.updateFeatureExpressionInfoContext(null)):this._context.layer.elevationInfo?(this._elevationContext.setFromElevationInfo(this._context.layer.elevationInfo),this._elevationContext.updateFeatureExpressionInfoContext(this._context.featureExpressionInfoContext)):
this._elevationContext.reset()}getDefaultElevationInfo(z){return z.hasZ?this._defaultElevationInfoZ():this._defaultElevationInfoNoZ()}getGeometryElevationMode(z,A=this.getDefaultElevationInfo(z)){return this._elevationContext.mode||A.mode}setElevationInfoOverride(z){this._elevationInfoOverride=z;this._updateElevationContext()}setGraphicElevationContext(z,A=new e.ElevationContext){var B=z.geometry;const C=this.getDefaultElevationInfo(B);A.unit=null!=this._elevationContext.unit?this._elevationContext.unit:
C.unit;A.mode=this.getGeometryElevationMode(B,C);A.offsetMeters=this._elevationContext.meterUnitOffset??C.offset??0;if(B=!this._elevationOptions.supportsOnTheGround&&"on-the-ground"===A.mode)A.mode="relative-to-ground",A.offsetMeters=0;A.updateFeatureExpressionInfoContext(B?g.zeroContext:this._elevationContext.featureExpressionInfoContext,z,this._context.layer);return A}prepareSymbolLayerPatch(z){}updateGeometry(z,A){return!1}updateTransform(z,A,B,C){return!1}onRemoveGraphic(z){}_getLayerOpacity(){if(this._context.graphicsCoreOwner&&
"fullOpacity"in this._context.graphicsCoreOwner)return this._context.graphicsCoreOwner.fullOpacity??0;const z=this._context.layer.opacity;return null==z?1:z}_getCombinedOpacity(z,A=y){let B=1;this.draped||(B*=this._getLayerOpacity());if(this._drivenProperties.opacity)return B;null!=z?B*=z.a:A.hasIntrinsicColor||(B=0);return B}_getCombinedOpacityAndColor(z,A=y){A=this._getCombinedOpacity(z,A);if(this._drivenProperties.color)return d.mixinColorAndOpacity(null,A);z=null!=z?b.toUnitRGB(z):p.ONES;return d.mixinColorAndOpacity(z,
A)}_getVertexOpacityAndColor(z,A=null){z=d.mixinColorAndOpacity(this._drivenProperties.color?z.color:null,this._drivenProperties.opacity?z.opacity:null);A&&(z[0]*=A,z[1]*=A,z[2]*=A,z[3]*=A);return z}isFastUpdatesEnabled(){return null!=this._fastUpdates}computeComplexity(){return f.defaultSymbolLayerComplexity(this.symbol,this.symbolLayer)}globalPropertyChanged(z,A,B){switch(z){case "opacity":return this.layerOpacityChanged(A,B),!0;case "elevationInfo":return z=this._elevationContext.mode,this._updateElevationContext(),
this.layerElevationInfoChanged(A,B,z)===c.SymbolUpdateType.RECREATE?!1:!0;case "slicePlaneEnabled":return this.slicePlaneEnabledChanged(A,B);case "physicalBasedRenderingEnabled":return this.physicalBasedRenderingChanged();case "pixelRatio":return this.pixelRatioChanged;case "skipHighSymbolLods":return this.skipHighSymbolLodsChanged;default:return!1}}get pixelRatioChanged(){return!0}updateGraphics3DGraphicElevationInfo(z,A,B){let C=c.SymbolUpdateType.UPDATE;z.forEach(D=>{const F=A(D);null!=F?(this.setGraphicElevationContext(D.graphic,
F.elevationContext),F.needsElevationUpdates=B(F.elevationContext.mode)):C=c.SymbolUpdateType.RECREATE});return C}applyRendererDiff(z,A){return t.ApplyRendererDiffResult.RecreateSymbol}getFastUpdateAttrValues(z){if(!this._fastUpdates)return null;const A=this._fastUpdates.visualVariables,B=A.size?v.getAttributeValue(A.size.field,z):0,C=A.color?v.getAttributeValue(A.color.field,z):0;z=A.opacity?v.getAttributeValue(A.opacity.field,z):0;return k.fromValues(B,C,z,0)}get draped(){return this._draped}ensureDrapedStatus(z){if(null==
this._draped)return this._draped=z,!0;z!==this.draped&&r().warnOnce("A symbol can only produce either draped or non-draped visualizations. Use two separate symbol instances for draped and non-draped graphics if necessary.");return!1}test(){return{drivenProperties:this._drivenProperties,getVisVarFields:()=>({size:this._fastUpdates?.visualVariables.size?.field??null,color:this._fastUpdates?.visualVariables.color?.field??null,opacity:this._fastUpdates?.visualVariables.opacity?.field??null,rotation:this._fastUpdates?.visualVariables.rotation?.field??
null})}}}const u={mode:"on-the-ground",offset:0,unit:"meters"},x={mode:"absolute-height",offset:0,unit:"meters"},y={hasIntrinsicColor:!1};a.Graphics3DSymbolLayer=n;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/defaultSymbolComplexity":function(){define("exports ../../../../core/compilerUtils ../../../../symbols/support/ObjectSymbol3DLayerResource ./Graphics3DPathSymbolLayerConstants ./primitiveObjectSymbolUtils ./SymbolComplexity ../support/edgeUtils ../../webgl-engine/materials/DefaultMaterial".split(" "),
function(a,b,q,l,p,k,h,f){function c(m){let r=0,n=0,u=0,x=!1,y=0;const z=new k.SymbolComplexityMemory;for(const A of m)null!=A&&(r+=A.verticesPerFeature,n+=A.verticesPerCoordinate,u+=A.drawCallsPerFeature,z.bytesPerFeature+=A.memory.bytesPerFeature,z.bytesPerFeatureLabel+=A.memory.bytesPerFeatureLabel,z.resourceBytes+=A.memory.resourceBytes,z.draped.bytesPerFeature+=A.memory.bytesPerFeature,z.draped.bytesPerFeatureLabel+=A.memory.bytesPerFeatureLabel,x=x||A.estimated,++y);return x?new k.EstimatedAggregateSymbolComplexity(y,
{verticesPerFeature:r,verticesPerCoordinate:n,drawCallsPerFeature:u,memory:z}):new k.AggregateSymbolComplexity(y,{verticesPerFeature:r,verticesPerCoordinate:n,drawCallsPerFeature:u,memory:z})}function e(m,r){const n=g(m,r);var u=h.hasEdges(r)?2:0;switch(r.type){case "extrude":return new k.SymbolComplexity({verticesPerFeature:-12,verticesPerCoordinate:12,drawCallsPerFeature:u,memory:n});case "fill":if("mesh-3d"===m.type)return new k.SymbolComplexity({drawCallsPerFeature:u,memory:n});if(null!=r.outline&&
0<r.outline.size)return new k.SymbolComplexity({verticesPerFeature:-12,verticesPerCoordinate:9,memory:n});case "water":return new k.SymbolComplexity({verticesPerFeature:-6,verticesPerCoordinate:3,memory:n});case "line":return new k.SymbolComplexity({verticesPerFeature:-6,verticesPerCoordinate:6,memory:n});case "object":if(r.resource?.href)return new k.EstimatedSymbolComplexity({verticesPerFeature:100,memory:n});r=r.resource?.primitive??q.defaultPrimitive;(m=w[r])?r=m:(m=p.primitiveLodResources(r,
new f.DefaultMaterial({})),m=d(m.levels),w[r]=new k.SymbolComplexity({verticesPerFeature:m}),r=w[r]);return{...r,memory:n};case "path":var x=m=0;switch(r.profile){case "circle":m=l.pathNumCircleProfileSubdivisions;break;case "quad":m=4;break;default:b.neverReached(r.profile);return}switch(r.join){case "round":x=l.pathNumRoundJoinSubdivisions;break;case "miter":case "bevel":x=1;break;default:return}u=2*m;x=m*x*2;let y=-2*x-u;switch(r.cap){case "none":break;case "butt":case "square":y+=2*(m-1);break;
case "round":y+=2*(m*(l.pathNumRoundCapExtrusionSubdivisions-1)*2+m);break;default:return}return new k.SymbolComplexity({verticesPerFeature:y,verticesPerCoordinate:x+u,memory:n});case "text":case "icon":return new k.SymbolComplexity({verticesPerFeature:6,memory:n})}}function g(m,r){m="point-3d"===m.type;switch(r.type){case "extrude":return r.edges&&0<r.edges.size?v.EXTRUDE_EDGES:v.EXTRUDE;case "fill":return null!=r.outline&&0<r.outline.size?v.FILL_OUTLINE:v.FILL;case "water":return v.FILL;case "line":return"round"===
r.join?v.LINE_ROUND:v.LINE_MITER;case "path":switch(r.join){case "round":switch(r.profile){case "circle":return v.PATH_ROUND_CIRCLE;case "quad":return v.PATH_ROUND_QUAD;default:b.neverReached(r.profile);return}case "miter":case "bevel":switch(r.profile){case "circle":return v.PATH_MITER_CIRCLE;case "quad":return v.PATH_MITER_QUAD;default:b.neverReached(r.profile);return}default:return}case "object":return m?v.OBJECT_POINT:v.OBJECT_POLYGON;case "icon":case "text":return m?v.ICON_POINT:v.ICON_POLYGON}}
function d(m){return m.reduce((r,n,u)=>r+1/10**u*n.numVertices,0)/m.reduce((r,n,u)=>r+1/10**u,0)}const t=new k.EstimatedSymbolComplexity({}),w={},v={ICON_POINT:{bytesPerFeature:2379.8272296852992,bytesPerFeatureLabel:852.246235,resourceBytes:0,draped:{bytesPerFeature:1868.2382921559424,bytesPerFeatureLabel:839.205415}},ICON_POLYGON:{bytesPerFeature:2957.8429876524656,bytesPerFeatureLabel:862.5307816666666,resourceBytes:0,draped:{bytesPerFeature:2579.7767085451133,bytesPerFeatureLabel:856.9298550000001}},
OBJECT_POINT:{bytesPerFeature:603.543820573039,bytesPerFeatureLabel:717.4551849999999,resourceBytes:0,draped:{bytesPerFeature:603.543820573039,bytesPerFeatureLabel:717.4551849999999}},OBJECT_POLYGON:{bytesPerFeature:1111.1693389308373,bytesPerFeatureLabel:707.4535949999998,resourceBytes:0,draped:{bytesPerFeature:1111.1693389308373,bytesPerFeatureLabel:707.4535949999998}},LINE_MITER:{bytesPerFeature:3081.208408220661,bytesPerFeatureLabel:858.6749016666668,resourceBytes:0,draped:{bytesPerFeature:2682.57863388475,
bytesPerFeatureLabel:844.6118016666666}},LINE_ROUND:{bytesPerFeature:3209.3236242927915,bytesPerFeatureLabel:858.1810416666667,resourceBytes:0,draped:{bytesPerFeature:2687.6256038096126,bytesPerFeatureLabel:849.578535}},PATH_MITER_CIRCLE:{bytesPerFeature:38708.74276663992,bytesPerFeatureLabel:858.70415,resourceBytes:0,draped:{bytesPerFeature:38708.74276663992,bytesPerFeatureLabel:858.70415}},PATH_ROUND_CIRCLE:{bytesPerFeature:42098.00590216518,bytesPerFeatureLabel:868.3632500000001,resourceBytes:0,
draped:{bytesPerFeature:42098.00590216518,bytesPerFeatureLabel:868.3632500000001}},PATH_MITER_QUAD:{bytesPerFeature:25037.823002405767,bytesPerFeatureLabel:835.93355,resourceBytes:0,draped:{bytesPerFeature:25037.823002405767,bytesPerFeatureLabel:835.93355}},PATH_ROUND_QUAD:{bytesPerFeature:40320.254760224525,bytesPerFeatureLabel:851.66955,resourceBytes:0,draped:{bytesPerFeature:40320.254760224525,bytesPerFeatureLabel:851.66955}},FILL:{bytesPerFeature:3147.43349219103,bytesPerFeatureLabel:850.7598550000001,
resourceBytes:0,draped:{bytesPerFeature:2673.7898488975106,bytesPerFeatureLabel:846.6459950000002}},FILL_OUTLINE:{bytesPerFeature:4565.099993465867,bytesPerFeatureLabel:855.334515,resourceBytes:0,draped:{bytesPerFeature:3904.46969705314,bytesPerFeatureLabel:844.7081016666667}},EXTRUDE:{bytesPerFeature:7551.2282834569505,bytesPerFeatureLabel:849.5513283333333,resourceBytes:0,draped:{bytesPerFeature:7551.2282834569505,bytesPerFeatureLabel:849.5513283333333}},EXTRUDE_EDGES:{bytesPerFeature:2959.8379634500698,
bytesPerFeatureLabel:602.0969283333335,resourceBytes:0,draped:{bytesPerFeature:2959.8379634500698,bytesPerFeatureLabel:602.0969283333335}}};a.averageSymbolComplexities=function(m){m=c(m);0<m.numComplexities&&(m.verticesPerFeature/=m.numComplexities,m.verticesPerCoordinate/=m.numComplexities,m.drawCallsPerFeature/=m.numComplexities,m.memory.bytesPerFeature/=m.numComplexities,m.memory.bytesPerFeatureLabel/=m.numComplexities,m.memory.resourceBytes/=m.numComplexities,m.memory.draped.bytesPerFeature/=
m.numComplexities,m.memory.draped.bytesPerFeatureLabel/=m.numComplexities);return m};a.defaultSymbolComplexity=function(m){if("web-style"===m.type)return t;const r=m.symbolLayers.toArray().map(n=>e(m,n));return c(r)};a.defaultSymbolLayerComplexity=e;a.defaultSymbolLayerMemoryComplexity=g;a.emptySymbolComplexity=t;a.estimateNumVerticesForLods=d;a.memoryEstimators=v;a.totalSymbolComplexities=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DPathSymbolLayerConstants":function(){define(["exports"],
function(a){a.pathNumCircleProfileSubdivisions=10;a.pathNumRoundCapExtrusionSubdivisions=3;a.pathNumRoundJoinSubdivisions=3;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/primitiveObjectSymbolUtils":function(){define(["exports","../../../../core/has","../../webgl-engine/lib/GeometryUtil","../../webgl-engine/lib/lodRendering/LodResources"],function(a,b,q,l){const p=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,
minScreenSpaceRadius:65}];a.isValidPrimitive=function(k){switch(k){case "sphere":case "cube":case "diamond":case "cylinder":case "cone":case "inverted-cone":case "tetrahedron":return!0}return!1};a.primitiveLodResources=function(k,h){const f=(c,e,g=!1)=>new l.LodResources(c.map(d=>{const t=e(d.tesselation);g&&q.cgToGIS(t);return new l.LodLevelResources([new l.LodComponentResources(t)],d.minScreenSpaceRadius)}));switch(k){case "sphere":return f([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1,
minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],c=>q.createPolySphereGeometry(h,.5,c,!0));case "cube":return f([{tesselation:0,minScreenSpaceRadius:0}],()=>q.createBoxGeometry(h,1));case "cone":return f(p,c=>q.createConeGeometry(h,1,.5,c,!1),!0);case "inverted-cone":return f(p,c=>q.createConeGeometry(h,1,.5,c,!0),!0);case "cylinder":return f(p,c=>q.createCylinderGeometry(h,1,.5,c,[0,0,1],[0,0,.5]));case "tetrahedron":return f([{tesselation:0,
minScreenSpaceRadius:0}],()=>q.createTetrahedronGeometry(h,1),!0);case "diamond":return f([{tesselation:0,minScreenSpaceRadius:0}],()=>q.createDiamondGeometry(h,1),!0)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/lodRendering/LodResources":function(){define(["exports","../../../../../core/arrayUtils","../VertexAttribute"],function(a,b,q){class l{constructor(h,f=null){this.geometry=h;this.textures=f}}class p{constructor(h,f,c){this.components=h;
this.minScreenSpaceRadius=f;this.pivotOffset=c;this.numVertices=this.geometries.reduce((e,g)=>e+g.attributes.get(q.VertexAttribute.POSITION).indices.length,0)}get geometries(){return b.unique(this.components.map(h=>h.geometry))}}class k{constructor(h){this.levels=h;this.levels.sort((f,c)=>f.minScreenSpaceRadius===c.minScreenSpaceRadius?f.numVertices-c.numVertices:f.minScreenSpaceRadius-c.minScreenSpaceRadius)}}a.LodComponentResources=l;a.LodLevelResources=p;a.LodResources=k;a.geometriesFromLodResources=
function(h){const f=[];h.levels.forEach(c=>c.components.forEach(e=>f.push(e.geometry)));return b.unique(f)};a.materialsFromLodResources=function(h){const f=[];h.levels.forEach(c=>c.components.forEach(e=>f.push(e.geometry.material)));return b.unique(f)};a.texturesFromLodResources=function(h){const f=[];h.levels.forEach(c=>c.components.forEach(e=>{null!=e.textures&&f.push(...e.textures)}));return b.unique(f)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/SymbolComplexity":function(){define(["exports"],
function(a){class b{constructor(h){this.estimated=!1;this.verticesPerFeature=h.verticesPerFeature??0;this.verticesPerCoordinate=h.verticesPerCoordinate??0;this.drawCallsPerFeature=h.drawCallsPerFeature??0;this.memory=h.memory??new k}}class q extends b{constructor(h){super(h);this.estimated=!0}}class l extends b{constructor(h,f){super(f);this.numComplexities=h}}class p extends q{constructor(h,f){super(f);this.numComplexities=h}}class k{constructor(){this.resourceBytes=this.bytesPerFeatureLabel=this.bytesPerFeature=
0;this.draped={bytesPerFeature:0,bytesPerFeatureLabel:0}}}a.AggregateSymbolComplexity=l;a.EstimatedAggregateSymbolComplexity=p;a.EstimatedSymbolComplexity=q;a.SymbolComplexity=b;a.SymbolComplexityMemory=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/edgeUtils":function(){define("exports ../../../../Color ../../../../core/has ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/factories/vec4f64 ./layerUtils ../../webgl-engine/lib/edgeRendering/interfaces ../../webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl".split(" "),
function(a,b,q,l,p,k,h,f){function c(t,w){if(null==t)return null;const v=null!=t.color?p.fromArray(b.toUnitRGBA(t.color)):p.fromValues(0,0,0,0),m=l.pt2px(t.size),r=l.pt2px(t.extensionLength);switch(t.type){case "solid":return e({color:v,size:m,extensionLength:r,...w});case "sketch":return{...d,color:v,size:m,extensionLength:r,...w,type:f.EdgeType.Sketch}}}function e(t){return{...g,...t,type:f.EdgeType.Solid}}const g={color:p.fromValues(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:h.Transparency.OPAQUE,
hasSlicePlane:!1},d={color:p.fromValues(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:h.Transparency.OPAQUE,hasSlicePlane:!1};a.createMaterial=function(t,w){return c(t&&t.enabled&&t.edges||null,w)};a.createMaterialFromEdges=c;a.createSolidEdgeMaterial=e;a.hasEdges=function(t){return t&&t.enabled&&(k.isExtrudeSymbol3DLayer(t)||k.isFillSymbol3DLayer(t))&&null!=t.edges};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/layerUtils":function(){define(["exports"],
function(a){a.isExtrudeSymbol3DLayer=function(b){return"extrude"===b.type};a.isFillSymbol3DLayer=function(b){return"fill"===b.type};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl":function(){define("exports ../../../collections/Component/Material/shader/ComponentData.glsl ../../../core/shaderLibrary/attributes/NormalAttribute.glsl ../../../core/shaderLibrary/util/DoublePrecision.glsl ../../../core/shaderLibrary/util/RgbaFloatEncoding.glsl ../../../core/shaderModules/Float3DrawUniform ../../../core/shaderModules/Float3PassUniform ../../../core/shaderModules/FloatPassUniform ../../../core/shaderModules/interfaces ../../../core/shaderModules/Matrix3DrawUniform ../../../core/shaderModules/Matrix3PassUniform ../../../core/shaderModules/Matrix4PassUniform ../../../core/shaderModules/Texture2DDrawUniform ../../../lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){a.EdgeType=void 0;(function(v){v[v.Solid=0]="Solid";v[v.Sketch=1]="Sketch";v[v.Mixed=2]="Mixed";v[v.COUNT=3]="COUNT"})(a.EdgeType||(a.EdgeType={}));a.EdgeSilhouette=void 0;(function(v){v[v.REGULAR=0]="REGULAR";v[v.SILHOUETTE=1]="SILHOUETTE"})(a.EdgeSilhouette||(a.EdgeSilhouette={}));a.EdgeUtil=function(v,m){const r=v.vertex;r.include(p.RgbaFloatEncoding);v.include(q.NormalAttribute,m);r.uniforms.add(new f.FloatPassUniform("distanceFalloffFactor",n=>n.distanceFalloffFactor));
r.code.add(c.glsl`float distanceBasedPerspectiveFactor(float distance) {
return clamp(sqrt(distanceFalloffFactor / distance), 0.0, 1.0);
}`);r.uniforms.add(new t.Texture2DDrawUniform("componentDataTex",n=>n.componentDataTexture));v.attributes.add(w.VertexAttribute.COMPONENTINDEX,"float");r.constants.add("componentColorFieldOffset","float",0);r.constants.add("componentOtherFieldOffset","float",1);r.constants.add("componentVerticalOffsetFieldOffset","float",2);r.constants.add("componentFieldCount","float",3);r.constants.add("lineWidthFractionFactor","float",8);r.constants.add("extensionLengthOffset","float",128);r.constants.add("verticalOffsetScale",
"float",2*b.maxElevationOffset);r.code.add(c.glsl`
vec2 _componentTextureCoords(float componentIndex, float fieldOffset) {
float fieldIndex = componentFieldCount * componentIndex + fieldOffset;
float texSize = float(textureSize(componentDataTex, 0).x);
float colIndex = mod(fieldIndex, texSize);
float rowIndex = floor(fieldIndex / texSize);
return vec2(colIndex, rowIndex) + 0.5;
}
struct ComponentData {
vec4 color;
vec3 normal;
vec3 normal2;
float lineWidth;
float extensionLength;
float type;
float verticalOffset;
};
ComponentData readComponentData() {
vec2 colorIndex = _componentTextureCoords(componentIndex, componentColorFieldOffset);
vec2 otherIndex = _componentTextureCoords(componentIndex, componentOtherFieldOffset);
vec2 verticalOffsetIndex = _componentTextureCoords(componentIndex, componentVerticalOffsetFieldOffset);
vec3 normal = normalModel();
vec3 normal2 = ${m.silhouette?c.glsl`decompressNormal(normal2Compressed)`:c.glsl`normal`};
vec4 colorValue = texelFetch(componentDataTex, ivec2(colorIndex), 0);
vec4 otherValue = texelFetch(componentDataTex, ivec2(otherIndex), 0);
float verticalOffset = (rgba2float(texelFetch(componentDataTex, ivec2(verticalOffsetIndex), 0)) - 0.5) * verticalOffsetScale;
return ComponentData(
vec4(colorValue.rgb, colorValue.a * otherValue.w), // otherValue.w stores separate opacity
normal, normal2,
otherValue.x * (255.0 / lineWidthFractionFactor),
otherValue.y * 255.0 - extensionLengthOffset,
-(otherValue.z * 255.0) + 0.5, // SOLID (=0/255) needs to be > 0.0, SKETCHY (=1/255) needs to be <= 0;
verticalOffset
);
}
`);m.legacy?r.code.add(c.glsl`vec3 _modelToWorldNormal(vec3 normal) {
return (model * vec4(normal, 0.0)).xyz;
}
vec3 _modelToViewNormal(vec3 normal) {
return (localView * model * vec4(normal, 0.0)).xyz;
}`):(r.uniforms.add(new e.Matrix3DrawUniform("transformNormalGlobalFromModel",n=>n.transformNormalGlobalFromModel)),r.code.add(c.glsl`vec3 _modelToWorldNormal(vec3 normal) {
return transformNormalGlobalFromModel * normal;
}`));m.silhouette?(v.attributes.add(w.VertexAttribute.NORMAL2COMPRESSED,"vec2"),r.code.add(c.glsl`vec3 worldNormal(ComponentData data) {
return _modelToWorldNormal(normalize(data.normal + data.normal2));
}`)):r.code.add(c.glsl`vec3 worldNormal(ComponentData data) {
return _modelToWorldNormal(data.normal);
}`);m.legacy?r.code.add(c.glsl`void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) {
worldPos = (model * vec4(modelPos, 1.0)).xyz;
viewPos = (localView * vec4(worldPos, 1.0)).xyz;
}`):(r.include(l.DoublePrecision,m),r.uniforms.add(new g.Matrix3PassUniform("transformViewFromCameraRelativeRS",n=>n.transformViewFromCameraRelativeRS),new e.Matrix3DrawUniform("transformWorldFromModelRS",n=>n.transformWorldFromModelRS),new k.Float3DrawUniform("transformWorldFromModelTL",n=>n.transformWorldFromModelTL),new k.Float3DrawUniform("transformWorldFromModelTH",n=>n.transformWorldFromModelTH),new h.Float3PassUniform("transformWorldFromViewTL",n=>n.transformWorldFromViewTL),new h.Float3PassUniform("transformWorldFromViewTH",
n=>n.transformWorldFromViewTH)),r.code.add(c.glsl`
void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) {
vec3 rotatedModelPosition = transformWorldFromModelRS * modelPos;
vec3 transformCameraRelativeFromModel = dpAdd(
transformWorldFromModelTL,
transformWorldFromModelTH,
-transformWorldFromViewTL,
-transformWorldFromViewTH
);
worldPos = transformCameraRelativeFromModel + rotatedModelPosition;
if (verticalOffset != 0.0) {
vec3 vUp = ${m.spherical?c.glsl`normalize(transformWorldFromModelTL + rotatedModelPosition);`:c.glsl`vec3(0.0, 0.0, 1.0);`}
worldPos += verticalOffset * vUp;
}
viewPos = transformViewFromCameraRelativeRS * worldPos;
}
`));r.uniforms.add(new d.Matrix4PassUniform("transformProjFromView",(n,u)=>u.camera.projectionMatrix));r.code.add(c.glsl`vec4 projFromViewPosition(vec3 position) {
return transformProjFromView * vec4(position, 1.0);
}`);r.code.add(c.glsl`float calculateExtensionLength(float extensionLength, float lineLength) {
return extensionLength / (log2(max(1.0, 256.0 / lineLength)) * 0.2 + 1.0);
}`)};a.usesSketchLogic=function(v){return v===a.EdgeType.Sketch||v===a.EdgeType.Mixed};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl":function(){define("exports ../../../../../../../core/compilerUtils ../../../../../../../core/floatRGBA ../../../../../../../core/has ./DecodeSymbolColor.glsl ../../../../core/shaderLibrary/ShaderOutput ../../../../core/shaderLibrary/util/RgbaFloatEncoding.glsl ../../../../core/shaderModules/Float4DrawUniform ../../../../core/shaderModules/IntegerDrawUniform ../../../../core/shaderModules/interfaces ../../../../core/shaderModules/Texture2DDrawUniform ../../../../lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){function t(m,r){const {vertex:n,fragment:u}=m;n.include(h.RgbaFloatEncoding);n.uniforms.add(new g.Texture2DDrawUniform("componentColorTex",x=>x.componentParameters.texture.texture));m.attributes.add(d.VertexAttribute.COMPONENTINDEX,"float");m.varyings.add("vExternalColorMixMode","mediump float");m.varyings.add("vExternalColor","vec4");(r=r.output===k.ShaderOutput.ObjectAndLayerIdColor)&&m.varyings.add("vObjectAndLayerIdColor","vec4");m.include(p.DecodeSymbolColor);
n.constants.add("elevationScale","float",2*v);n.constants.add("stride","float",l("enable-feature:objectAndLayerId-rendering")?3:2);n.code.add(e.glsl`vec2 getComponentTextureCoordinates(float componentIndex, float typeOffset) {
float index = componentIndex * stride + typeOffset;
float texSize = float(textureSize(componentColorTex, 0).x);
float coordX = mod(index, texSize);
float coordY = floor(index / texSize);
return vec2(coordX, coordY) + 0.5;
}`);n.code.add(e.glsl`
vec4 _readComponentColor() {
vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 0.0);
return texelFetch(componentColorTex, ivec2(textureCoordinates), 0);
}
float readElevationOffset() {
vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 1.0);
vec4 encodedElevation = texelFetch(componentColorTex, ivec2(textureCoordinates), 0);
return (rgba2float(encodedElevation) - 0.5) * elevationScale;
}
${r?e.glsl`
void forwardObjectAndLayerIdColor() {
vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 2.0);
vObjectAndLayerIdColor = texelFetch(componentColorTex, ivec2(textureCoordinates), 0);
}`:e.glsl`void forwardObjectAndLayerIdColor() {}`}
vec4 forwardExternalColor(out bool castShadows) {
vec4 componentColor = _readComponentColor() * 255.0;
float shadowFlag = mod(componentColor.b * 255.0, 2.0);
componentColor.b -= shadowFlag;
castShadows = shadowFlag >= 1.0;
int decodedColorMixMode;
vExternalColor = decodeSymbolColor(componentColor, decodedColorMixMode) * 0.003921568627451; // = 1/255;
vExternalColorMixMode = float(decodedColorMixMode) + 0.5; // add 0.5 to avoid interpolation artifacts
return vExternalColor;
}
`);u.code.add(e.glsl`
void readExternalColor(out vec4 externalColor, out int externalColorMixMode) {
externalColor = vExternalColor;
externalColorMixMode = int(vExternalColorMixMode);
}
void outputObjectAndLayerIdColor() {
${r?e.glsl`fragColor = vObjectAndLayerIdColor;`:""}
}
`)}function w(m,r){const {vertex:n,fragment:u}=m;n.uniforms.add(new f.Float4DrawUniform("externalColor",x=>x.componentParameters.externalColor));u.uniforms.add(new c.IntegerDrawUniform("externalColorMixMode",x=>x.componentParameters.externalColorMixMode));m.varyings.add("vExternalColor","vec4");n.code.add(e.glsl`float readElevationOffset() {
return 0.0;
}
void forwardObjectAndLayerIdColor() {}
vec4 forwardExternalColor(out bool castShadows) {
vExternalColor = externalColor;
castShadows = true;
return externalColor;
}`);u.code.add(e.glsl`
void readExternalColor(out vec4 color, out int colorMixMode) {
color = vExternalColor;
colorMixMode = externalColorMixMode;
}
void outputObjectAndLayerIdColor() {
${r.output===k.ShaderOutput.ObjectAndLayerIdColor?e.glsl`fragColor = vec4(0,0,0,0);`:""}
}
`)}a.ComponentDataType=void 0;(function(m){m[m.Uniform=0]="Uniform";m[m.Varying=1]="Varying";m[m.COUNT=2]="COUNT"})(a.ComponentDataType||(a.ComponentDataType={}));const v=2**32/1E4;a.ComponentData=function(m,r){switch(r.componentData){case a.ComponentDataType.Varying:return t(m,r);case a.ComponentDataType.Uniform:return w(m,r);case a.ComponentDataType.COUNT:break;default:b.neverReached(r.componentData)}};a.encodeElevationOffset=function(m,r){q.packFloatRGBA(m/v*.5+.5,r)};a.maxElevationOffset=v;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/core/floatRGBA":function(){define(["exports","./mathUtils"],function(a,b){function q(h,f=0){let c=0;for(let e=0;4>e;e++)c+=h[f+e]*p[e];return c}const l=[1,256,65536,16777216],p=[1/256,1/65536,1/16777216,1/4294967296],k=q(new Uint8ClampedArray([255,255,255,255]));a.packFloatRGBA=function(h,f,c=0){h=b.clamp(h,0,k);for(let d=0;4>d;d++){var e=Math,g=h*l[d];f[c+d]=e.floor.call(e,256*(g-Math.floor(g)))}};a.unpackFloatRGBA=q;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/Material/shader/DecodeSymbolColor.glsl":function(){define(["exports","../../../../../layers/support/symbolColorUtils","../../../../core/shaderModules/interfaces"],function(a,b,q){a.DecodeSymbolColor=function(l){l.vertex.code.add(q.glsl`
vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {
float symbolAlpha = 0.0;
const float maxTint = 85.0;
const float maxReplace = 170.0;
const float scaleAlpha = 3.0;
if (symbolColor.a > maxReplace) {
colorMixMode = ${q.glsl.int(b.ColorMixModeEnum.Multiply)};
symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace);
} else if (symbolColor.a > maxTint) {
colorMixMode = ${q.glsl.int(b.ColorMixModeEnum.Replace)};
symbolAlpha = scaleAlpha * (symbolColor.a - maxTint);
} else if (symbolColor.a > 0.0) {
colorMixMode = ${q.glsl.int(b.ColorMixModeEnum.Tint)};
symbolAlpha = scaleAlpha * symbolColor.a;
} else {
colorMixMode = ${q.glsl.int(b.ColorMixModeEnum.Multiply)};
symbolAlpha = 0.0;
}
return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha);
}
`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/symbolColorUtils":function(){define(["exports","../../../../core/mathUtils"],function(a,b){a.ColorMixModeEnum=void 0;(function(q){q[q.Multiply=1]="Multiply";q[q.Ignore=2]="Ignore";q[q.Replace=3]="Replace";q[q.Tint=4]="Tint"})(a.ColorMixModeEnum||(a.ColorMixModeEnum={}));a.encodeSymbolColor=function(q,l,p){if(null==q||l===a.ColorMixModeEnum.Ignore)p[0]=255,p[1]=255,p[2]=255,p[3]=255;else{var k=b.clamp(Math.round(85*
q[3]),0,85);l=0===k||l===a.ColorMixModeEnum.Tint?0:l===a.ColorMixModeEnum.Replace?85:170;p[0]=b.clamp(Math.round(255*q[0]),0,255);p[1]=b.clamp(Math.round(255*q[1]),0,255);p[2]=b.clamp(Math.round(255*q[2]),0,255);p[3]=k+l}};a.parseColorMixMode=function(q){switch(q){case "multiply":return a.ColorMixModeEnum.Multiply;case "ignore":return a.ColorMixModeEnum.Ignore;case "replace":return a.ColorMixModeEnum.Replace;case "tint":return a.ColorMixModeEnum.Tint;default:return a.ColorMixModeEnum.Multiply}};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Float4DrawUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"vec4",q.BindType.Draw,(h,f,c)=>h.setUniform4fv(p,k(f,c)))}}a.Float4DrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/IntegerDrawUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],
function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"int",q.BindType.Draw,(h,f,c)=>h.setUniform1i(p,k(f,c)))}}a.IntegerDrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl":function(){define(["exports","../../../../../../core/compilerUtils","../../shaderModules/interfaces","../../../lib/VertexAttribute"],function(a,b,q,l){a.NormalType=void 0;(function(p){p[p.Attribute=0]="Attribute";
p[p.Compressed=1]="Compressed";p[p.Ground=2]="Ground";p[p.ScreenDerivative=3]="ScreenDerivative";p[p.COUNT=4]="COUNT"})(a.NormalType||(a.NormalType={}));a.NormalAttribute=function(p,k){switch(k.normalType){case a.NormalType.Compressed:p.attributes.add(l.VertexAttribute.NORMALCOMPRESSED,"vec2");p.vertex.code.add(q.glsl`vec3 decompressNormal(vec2 normal) {
float z = 1.0 - abs(normal.x) - abs(normal.y);
return vec3(normal + sign(normal) * min(z, 0.0), z);
}
vec3 normalModel() {
return decompressNormal(normalCompressed);
}`);break;case a.NormalType.Attribute:p.attributes.add(l.VertexAttribute.NORMAL,"vec3");p.vertex.code.add(q.glsl`vec3 normalModel() {
return normal;
}`);break;case a.NormalType.ScreenDerivative:p.fragment.code.add(q.glsl`vec3 screenDerivativeNormal(vec3 positionView) {
return normalize(cross(dFdx(positionView), dFdy(positionView)));
}`);break;default:b.neverReached(k.normalType);case a.NormalType.COUNT:case a.NormalType.Ground:}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/DefaultMaterial":function(){define("exports ../../../../core/has ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../ViewingMode ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/attributes/NormalAttribute.glsl ../core/shaderLibrary/shading/Normals.glsl ../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../lib/basicInterfaces ../lib/GLTextureMaterial ../lib/Material ../lib/OrderIndependentTransparency ../lib/RayIntersections ../lib/RenderSlot ../lib/VertexAttribute ../lib/verticalOffsetUtils ./DefaultBufferWriter ./internal/MaterialUtil ../shaders/DefaultMaterialTechnique ../shaders/DefaultMaterialTechniqueConfiguration ../shaders/RealisticTreeTechnique".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){function B(M){const K=k.newLayout().vec3f(r.VertexAttribute.POSITION);M.normalType===f.NormalType.Compressed?K.vec2i16(r.VertexAttribute.NORMALCOMPRESSED,{glNormalized:!0}):K.vec3f(r.VertexAttribute.NORMAL);M.hasVertexTangents&&K.vec4f(r.VertexAttribute.TANGENT);(M.textureId||M.normalTextureId||M.metallicRoughnessTextureId||M.emissiveTextureId||M.occlusionTextureId)&&K.vec2f(r.VertexAttribute.UV0);M.hasVertexColors&&K.vec4u8(r.VertexAttribute.COLOR);
M.hasSymbolColors&&K.vec4u8(r.VertexAttribute.SYMBOLCOLOR);b("enable-feature:objectAndLayerId-rendering")&&K.vec4u8(r.VertexAttribute.OBJECTANDLAYERIDCOLOR);return K}class C extends t.Material{constructor(M){super(M,H);this.supportsEdges=!0;this.produces=new Map([[m.RenderSlot.OPAQUE_MATERIAL,K=>(h.is3DGeometryOutput(K)||h.isShadowRelatedOutput(K))&&!this.parameters.transparent],[m.RenderSlot.TRANSPARENT_MATERIAL,K=>(h.is3DGeometryOutput(K)||h.isShadowRelatedOutput(K))&&this.parameters.transparent&&
this.parameters.writeDepth],[m.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,K=>(h.is3DGeometryOutput(K)||h.isShadowRelatedOutput(K))&&this.parameters.transparent&&!this.parameters.writeDepth]]);this._configuration=new z.DefaultMaterialTechniqueConfiguration;this._vertexBufferLayout=B(this.parameters)}isVisibleForOutput(M){return M===h.ShaderOutput.Shadow||M===h.ShaderOutput.ShadowExcludeHighlight||M===h.ShaderOutput.ShadowHighlight?this.parameters.castShadows:!0}isVisible(){var M=this.parameters;
if(!super.isVisible()||0===M.layerOpacity)return!1;const {hasInstancedColor:K,hasVertexColors:J,hasSymbolColors:R,vvColor:Q}=M,W="replace"===M.colorMixMode,S=0<M.opacity;M=M.externalColor&&0<M.externalColor[3];const V=K||Q||R;return J&&V?W||S:J?W?M:S:V?W||S:W?M:S}getConfiguration(M,K){this._configuration.output=M;this._configuration.hasNormalTexture=!!this.parameters.normalTextureId;this._configuration.hasColorTexture=!!this.parameters.textureId;this._configuration.hasVertexTangents=this.parameters.hasVertexTangents;
this._configuration.instanced=this.parameters.isInstanced;this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision;this._configuration.vvSize=!!this.parameters.vvSize;this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset;this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective;this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight;this._configuration.alphaDiscardMode=
this.parameters.textureAlphaMode;this._configuration.normalType=this.parameters.normalType;this._configuration.transparent=this.parameters.transparent;this._configuration.writeDepth=this.parameters.writeDepth;null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest);this._configuration.hasOccludees=this.parameters.hasOccludees;this._configuration.cullFace=this.parameters.hasSlicePlane?g.CullFaceOptions.None:this.parameters.cullFace;this._configuration.multipassEnabled=
K.multipassEnabled;this._configuration.cullAboveGround=K.multipassTerrain.cullAboveGround;this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation;M===h.ShaderOutput.Color&&(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this._configuration.doubleSidedMode=this.parameters.treeRendering?c.NormalsDoubleSidedMode.WindingOrder:this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?
c.NormalsDoubleSidedMode.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?c.NormalsDoubleSidedMode.WindingOrder:c.NormalsDoubleSidedMode.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=this.parameters.receiveAmbientOcclusion&&null!=K.ssao,this._configuration.vvColor=!!this.parameters.vvColor,
this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?e.PBRMode.Schematic:e.PBRMode.Normal:e.PBRMode.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=
!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=K.transparencyPassType,this._configuration.enableOffset=K.camera.relativeElevation<w.OITPolygonOffsetLimit,this._configuration.snowCover=this.hasSnowCover(K),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=
!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix);return this._configuration}hasSnowCover(M){return null!=M.weather&&M.weatherVisible&&"snowy"===M.weather.type&&"enabled"===M.weather.snowCover}intersect(M,K,J,R,Q,W){if(null!=this.parameters.verticalOffset){const V=J.camera;q.set(L,K[12],
K[13],K[14]);K=null;switch(J.viewingMode){case p.ViewingMode.Global:K=q.normalize(I,L);break;case p.ViewingMode.Local:K=q.copy(I,G)}let T=0;var S=q.subtract(P,L,V.eye);const Y=q.length(S);S=q.scale(S,S,1/Y);let ha=null;this.parameters.screenSizePerspective&&(ha=q.dot(K,S));T+=x.verticalOffsetAtDistance(V,Y,this.parameters.verticalOffset,ha??0,this.parameters.screenSizePerspective);q.scale(K,K,T);q.transformMat3(O,K,J.transform.inverseRotation);R=q.subtract(N,R,O);Q=q.subtract(E,Q,O)}v.intersectTriangleGeometry(M,
J,R,Q,n.getVerticalOffsetObject3D(J.verticalOffset),W)}createGLMaterial(M){return new D(M)}createBufferWriter(){return new u.DefaultBufferWriter(this._vertexBufferLayout)}}class D extends d.GLTextureMaterial{constructor(M){super({...M,...M.material.parameters})}_updateShadowState(M){M.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:M.shadowMap.enabled})}_updateOccludeeState(M){M.hasOccludees!==this._material.parameters.hasOccludees&&
this._material.setParameters({hasOccludees:M.hasOccludees})}beginSlot(M){this._output===h.ShaderOutput.Color&&(this._updateShadowState(M),this._updateOccludeeState(M));const K=this._material.parameters;this.updateTexture(K.textureId);const J=M.camera.viewInverseTransposeMatrix;q.set(K.origin,J[3],J[7],J[11]);this._material.setParameters(this.textureBindParameters);return this.ensureTechnique(K.treeRendering?A.RealisticTreeTechnique:y.DefaultMaterialTechnique,M)}}class F extends y.DefaultMaterialPassParameters{constructor(){super(...arguments);
this.hasVertexTangents=this.treeRendering=this.initTextureTransparent=!1}}const H=new F,N=l.create(),E=l.create(),G=l.fromValues(0,0,1),I=l.create(),O=l.create(),L=l.create(),P=l.create();a.DefaultGLMaterial=D;a.DefaultMaterial=C;a.DefaultMaterialParameters=F;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl":function(){define(["exports","../../../../../../core/compilerUtils","../../shaderModules/interfaces"],function(a,
b,q){a.NormalsDoubleSidedMode=void 0;(function(l){l[l.None=0]="None";l[l.View=1]="View";l[l.WindingOrder=2]="WindingOrder";l[l.COUNT=3]="COUNT"})(a.NormalsDoubleSidedMode||(a.NormalsDoubleSidedMode={}));a.Normals=function(l,p){l=l.fragment;l.code.add(q.glsl`struct ShadingNormalParameters {
vec3 normalView;
vec3 viewDirection;
} shadingParams;`);switch(p.doubleSidedMode){case a.NormalsDoubleSidedMode.None:l.code.add(q.glsl`vec3 shadingNormal(ShadingNormalParameters params) {
return normalize(params.normalView);
}`);break;case a.NormalsDoubleSidedMode.View:l.code.add(q.glsl`vec3 shadingNormal(ShadingNormalParameters params) {
return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView);
}`);break;case a.NormalsDoubleSidedMode.WindingOrder:l.code.add(q.glsl`vec3 shadingNormal(ShadingNormalParameters params) {
return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView);
}`);break;default:b.neverReached(p.doubleSidedMode);case a.NormalsDoubleSidedMode.COUNT:}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/RayIntersections":function(){define("exports ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ./ContentObjectType ./Util ./VertexAttribute".split(" "),function(a,b,q,l,p,k,h){function f(C,D,F,H,N,E,G){if(null!=C){var I=g(F,m);l.setMin(v,C.bbMin);
l.setMax(v,C.bbMax);null!=N&&N.applyToAabb(v);if(d(v,D,I,H)){const {primitiveIndices:ha,position:ba}=C;I=ha?ha.length:ba.indices.length/3;if(1E3<I&&(C=C.getChildren(),void 0!==C)){for(var O of C)f(O,D,F,H,N,E,G);return}H=I;O=ba.indices;C=ba.data;I=ba.stride;var L=ha;const U=D[0],Z=D[1];D=D[2];const ca=F[0],ea=F[1];F=F[2];({normalRequired:E}=E);for(let da=0;da<H;++da){const ia=L[da];var P=3*ia,M=I*O[P],K=C[M],J=C[M+1],R=C[M+2],Q=I*O[P+1];M=C[Q];var W=C[Q+1];Q=C[Q+2];var S=I*O[P+2];P=C[S];var V=C[S+
1];S=C[S+2];null!=N&&([K,J,R]=N.applyToVertex(K,J,R,da),[M,W,Q]=N.applyToVertex(M,W,Q,da),[P,V,S]=N.applyToVertex(P,V,S,da));M-=K;W-=J;Q-=R;P-=K;V-=J;S-=R;var T=ea*S-V*F,Y=F*P-S*ca;const ka=ca*V-P*ea,fa=M*T+W*Y+Q*ka;if(!(1E-7>=Math.abs(fa))){K=U-K;J=Z-J;R=D-R;T=K*T+J*Y+R*ka;if(0<fa){if(0>T||T>fa)continue}else if(0<T||T<fa)continue;Y=J*Q-W*R;R=R*M-Q*K;J=K*W-M*J;K=ca*Y+ea*R+F*J;if(0<fa){if(0>K||T+K>fa)continue}else if(0<K||T+K<fa)continue;J=(P*Y+V*R+S*J)/fa;0<=J&&(M=E?e(M,W,Q,P,V,S,r):null,G(J,ia,M))}}}}}
function c(C,D,F,H,N,E,G,I,O,L){const P=B;var M=Math.abs(D[0]),K=Math.abs(D[1]),J=Math.abs(D[2]);M=M>=K?M>=J?0:2:K>=J?1:2;J=0>D[M]?2:1;K=(M+J)%3;J=(M+(3-J))%3;const R=D[K]/D[M],Q=D[J]/D[M];D=1/D[M];const W=n,S=u,V=x;for({normalRequired:O}=O;F<H;++F){var T=3*F,Y=G*N[T];b.set(P[0],E[Y+0],E[Y+1],E[Y+2]);Y=G*N[T+1];b.set(P[1],E[Y+0],E[Y+1],E[Y+2]);T=G*N[T+2];b.set(P[2],E[T+0],E[T+1],E[T+2]);I&&(b.copy(P[0],I.applyToVertex(P[0][0],P[0][1],P[0][2],F)),b.copy(P[1],I.applyToVertex(P[1][0],P[1][1],P[1][2],
F)),b.copy(P[2],I.applyToVertex(P[2][0],P[2][1],P[2][2],F)));b.sub(W,P[0],C);b.sub(S,P[1],C);b.sub(V,P[2],C);Y=W[K]-R*W[M];var ha=W[J]-Q*W[M];const U=S[K]-R*S[M],Z=S[J]-Q*S[M];var ba=V[K]-R*V[M];const ca=V[J]-Q*V[M];T=ba*Z-ca*U;ba=Y*ca-ha*ba;ha=U*ha-Z*Y;(0>T||0>ba||0>ha)&&(0<T||0<ba||0<ha)||(Y=T+ba+ha,0!==Y&&(T=T*D*W[M]+ba*D*S[M]+ha*D*V[M],0>T*Math.sign(Y)||(T/=Y,0<=T&&(O?(Y=P,b.sub(y,Y[1],Y[0]),b.sub(z,Y[2],Y[0]),b.cross(r,y,z),b.normalize(r,r),Y=r):Y=null,L(T,F,Y)))))}}function e(C,D,F,H,N,E,G){b.set(y,
C,D,F);b.set(z,H,N,E);b.cross(G,y,z);b.normalize(G,G);return G}function g(C,D){return b.set(D,1/C[0],1/C[1],1/C[2])}function d(C,D,F,H){return t(C,D,F,H,Infinity)}function t(C,D,F,H,N){var E=(C[0]-H-D[0])*F[0],G=(C[3]+H-D[0])*F[0];let I=Math.min(E,G);E=Math.max(E,G);G=(C[1]-H-D[1])*F[1];const O=(C[4]+H-D[1])*F[1];E=Math.min(E,Math.max(G,O));if(0>E)return!1;I=Math.max(I,Math.min(G,O));if(I>E)return!1;G=(C[2]-H-D[2])*F[2];C=(C[5]+H-D[2])*F[2];E=Math.min(E,Math.max(G,C));if(0>E)return!1;I=Math.max(I,
Math.min(G,C));return I>E?!1:I<N}class w{constructor(C=!1,D=!0){this.isVerticalRay=C;this.normalRequired=D}}const v=l.create(),m=q.create(),r=q.create(),n=q.create(),u=q.create(),x=q.create(),y=q.create(),z=q.create(),A=q.create(),B=[q.create(),q.create(),q.create()];a.MeshIntersectionOptions=w;a.computeInvDir=function(C,D,F){return b.set(F,1/(D[0]-C[0]),1/(D[1]-C[1]),1/(D[2]-C[2]))};a.computeInvDirFromDirection=g;a.computeNormalFromBarycentric=e;a.intersectAabbInvDir=d;a.intersectAabbInvDirBefore=
t;a.intersectRayTriangles=function(C,D,F,H,N,E,G,I,O,L=null,P=0){const M=C[0],K=C[1];C=C[2];const J=D[0],R=D[1];for(D=D[2];F<H;++F){const ca=P+(L?L[F]:F);var Q=3*ca,W=G*N[Q],S=E[W],V=E[W+1],T=E[W+2],Y=G*N[Q+1],ha=G*N[Q+2];Q=E[Y]-S;W=E[Y+1]-V;Y=E[Y+2]-T;const ea=E[ha]-S,da=E[ha+1]-V;ha=E[ha+2]-T;var ba=R*ha-da*D,U=D*ea-ha*J;const ia=J*da-ea*R;var Z=Q*ba+W*U+Y*ia;if(!(1E-7>=Math.abs(Z))){S=M-S;V=K-V;T=C-T;ba=S*ba+V*U+T*ia;if(0<Z){if(0>ba||ba>Z)continue}else if(0<ba||ba<Z)continue;U=V*Y-W*T;T=T*Q-Y*
S;V=S*W-Q*V;S=J*U+R*T+D*V;if(0<Z){if(0>S||ba+S>Z)continue}else if(0<S||ba+S<Z)continue;Z=(ea*U+da*T+ha*V)/Z;0<=Z&&(Q=I?e(Q,W,Y,ea,da,ha,r):null,O(Z,ca,Q))}}};a.intersectRayTrianglesWithDisplacementWatertight=c;a.intersectRayTrianglesWithVerticalOffsetENUGlobal=function(C,D,F,H,N,E,G,I,O,L,P,M=null,K=0){const J=C[0],R=C[1];C=C[2];const Q=D[0],W=D[1];for(D=D[2];F<H;++F){const fa=K+(M?M[F]:F);var S=3*fa,V=G*N[S],T=E[V],Y=E[V+1],ha=E[V+2],ba=G*N[S+1];V=E[ba];var U=E[ba+1];ba=E[ba+2];var Z=G*N[S+2];S=
E[Z];var ca=E[Z+1];Z=E[Z+2];var ea=ha-O,da=I/Math.sqrt(T*T+Y*Y+ea*ea);T+=T*da;Y+=Y*da;ha+=ea*da;var ia=ba-O,ka=I/Math.sqrt(V*V+U*U+ia*ia);ea=Z-O;da=I/Math.sqrt(S*S+ca*ca+ea*ea);V=V+V*ka-T;U=U+U*ka-Y;ba=ba+ia*ka-ha;S=S+S*da-T;ca=ca+ca*da-Y;Z=Z+ea*da-ha;da=W*Z-ca*D;ia=D*S-Z*Q;ka=Q*ca-S*W;ea=V*da+U*ia+ba*ka;if(!(1E-7>=Math.abs(ea))){T=J-T;Y=R-Y;ha=C-ha;da=T*da+Y*ia+ha*ka;if(0<ea){if(0>da||da>ea)continue}else if(0<da||da<ea)continue;ia=Y*ba-U*ha;ha=ha*V-ba*T;T=T*U-V*Y;Y=Q*ia+W*ha+D*T;if(0<ea){if(0>Y||
da+Y>ea)continue}else if(0<Y||da+Y<ea)continue;T=(S*ia+ca*ha+Z*T)/ea;0<=T&&(V=L?e(V,U,ba,S,ca,Z,r):null,P(T,fa,V))}}};a.intersectTriangleGeometry=function(C,D,F,H,N,E){if(C.visible){H=b.sub(A,H,F);var G=(O,L,P)=>{E(O,P,L,!1)},I=new w(!1,D.options.normalRequired);C.boundingInfo?(k.assert(C.type===p.ContentObjectType.Mesh),f(C.boundingInfo,F,H,D.tolerance,N,I,G)):(C=C.attributes.get(h.VertexAttribute.POSITION),D=C.indices,c(F,H,0,D.length/3,D,C.data,C.stride,N,I,G))}};a.intersectTriangles=function(C,
D,F,H,N,E,G,I,O){const {data:L,stride:P}=E;D=b.sub(A,D,C);c(C,D,F,H,N,L,P,G,I,O)};a.triangleRayParallelTolerance=1E-7;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/DefaultBufferWriter":function(){define(["exports","../lib/VertexAttribute","./internal/bufferWriterUtils"],function(a,b,q){class l{constructor(p){this.vertexBufferLayout=p}elementCount(p){return p.attributes.get(b.VertexAttribute.POSITION).indices.length}write(p,k,h,f,c){q.writeDefaultAttributes(h,
this.vertexBufferLayout,p,k,f,c)}}a.DefaultBufferWriter=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/DefaultMaterialTechnique":function(){define("require exports ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../ViewingMode ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/attributes/NormalAttribute.glsl ../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../core/shaderLibrary/attributes/VertexNormal.glsl ../core/shaderLibrary/util/AlphaCutoff ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/basicInterfaces ../lib/DefaultVertexAttributeLocations ../lib/Material ../lib/OrderIndependentTransparency ../lib/Program ../lib/StencilUtils ../lib/TransparencyPassType ../materials/pbrUtils ../../../../chunks/DefaultMaterial.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){class B extends c.VertexNormalPassParameters{constructor(){super(...arguments);this.usePBR=this.isSchematic=!1;this.mrrFactors=q.fromArray(x.defaultAdvancedMRRFactors);this.doubleSided=this.hasSymbolColors=this.hasVertexColors=!1;this.doubleSidedType="normal";this.cullFace=t.CullFaceOptions.Back;this.hasInstancedColor=this.isInstanced=!1;this.emissiveFactor=q.fromValues(0,0,0);this.instancedDoublePrecision=!1;this.normalType=h.NormalType.Attribute;
this.castShadows=this.receiveAmbientOcclusion=this.receiveShadows=!0;this.shadowMappingEnabled=!1;this.ambient=q.fromValues(.2,.2,.2);this.diffuse=q.fromValues(.8,.8,.8);this.externalColor=l.fromValues(1,1,1,1);this.colorMixMode="multiply";this.layerOpacity=this.opacity=1;this.origin=q.create();this.hasSlicePlane=!1;this.hasSliceHighlight=!0;this.offsetTransparentBackfaces=!1;this.modelTransformation=this.vvSymbolRotationMatrix=this.vvSymbolAnchor=this.vvOpacity=this.vvColor=this.vvSize=null;this.transparent=
!1;this.writeDepth=!0;this.customDepthTest=t.DepthTestFunction.Less;this.textureAlphaMode=t.AlphaDiscardMode.Blend;this.textureAlphaCutoff=e.defaultMaskAlphaCutoff;this.hasOccludees=this.textureAlphaPremultiplied=!1;this.renderOccluded=v.RenderOccludedFlag.Occlude;this.isDecoration=!1}}class C extends c.VertexNormalDrawParameters{constructor(){super(...arguments);this.slicePlaneLocalOrigin=this.origin=q.create()}}class D extends d.ShaderTechnique{initializeConfiguration(F,H){H.spherical=F.viewingMode===
p.ViewingMode.Global;H.doublePrecisionRequiresObfuscation=F.rctx.driverTest.doublePrecisionRequiresObfuscation.result;H.textureCoordinateType=H.hasColorTexture||H.hasMetallicRoughnessTexture||H.hasEmissionTexture||H.hasOcclusionTexture||H.hasNormalTexture?f.TextureCoordinateAttributeType.Default:f.TextureCoordinateAttributeType.None;H.objectAndLayerIdColorInstanced=H.instanced}initializeProgram(F){return this._initializeProgram(F,D.shader)}_initializeProgram(F,H){return new r.Program(F.rctx,H.get().build(this.configuration),
w.Default3D)}_makePipeline(F,H){const N=this.configuration,E=F===u.TransparencyPassType.NONE,G=F===u.TransparencyPassType.FrontFace;var I=A.makePipelineState,O=N.output===k.ShaderOutput.Color&&N.transparent?E?m.blendingDefault:m.oitBlending(F):null;var L=N.cullFace!==t.CullFaceOptions.None?!0:N.hasSlicePlane?!1:!N.transparent&&!N.doubleSidedMode;return I.call(A,{blending:O,culling:L?A.cullingParams(N.cullFace):null,depthTest:{func:m.oitDepthTest(F,N.customDepthTest===t.DepthTestFunction.Lequal?z.CompareFunction.LEQUAL:
z.CompareFunction.LESS)},depthWrite:E||G?N.writeDepth?A.defaultDepthWriteParams:null:null,drawBuffers:N.output===k.ShaderOutput.Depth?{buffers:[z.SpecialDrawBuffers.NONE]}:m.oitDrawBuffers(F),colorWrite:A.defaultColorWriteParams,stencilWrite:N.hasOccludees?n.stencilWriteMaskOn:null,stencilTest:N.hasOccludees?H?n.stencilToolMaskBaseParams:n.stencilBaseAllZerosParams:null,polygonOffset:E||G?null:m.getOITPolygonOffset(N.enableOffset)})}initializePipeline(){this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,
!0);return this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(F){return F?this._occludeePipelineState:super.getPipeline()}}D.shader=new g.ReloadableShaderModule(y.DefaultMaterial,()=>new Promise((F,H)=>a(["./DefaultMaterial.glsl"],F,H)));b.DefaultMaterialDrawParameters=C;b.DefaultMaterialPassParameters=B;b.DefaultMaterialTechnique=D;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl":function(){define("exports ../../../../../../core/compilerUtils ../../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../../core/libs/gl-matrix-2/factories/vec4f64 ./NormalAttribute.glsl ./VertexPosition.glsl ../../shaderModules/interfaces ../../shaderModules/Matrix3DrawUniform ../../shaderModules/Matrix3PassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c){class e extends k.VertexPositionPassParameters{constructor(){super(...arguments);this.transformNormalViewFromGlobal=q.create()}}class g extends k.VertexPositionDrawParameters{constructor(){super(...arguments);this.transformNormalGlobalFromModel=q.create();this.toMapSpace=l.create()}}a.VertexNormal=function(d,t){switch(t.normalType){case p.NormalType.Attribute:case p.NormalType.Compressed:d.include(p.NormalAttribute,t);d.varyings.add("vNormalWorld","vec3");d.varyings.add("vNormalView",
"vec3");d.vertex.uniforms.add(new f.Matrix3DrawUniform("transformNormalGlobalFromModel",w=>w.transformNormalGlobalFromModel),new c.Matrix3PassUniform("transformNormalViewFromGlobal",w=>w.transformNormalViewFromGlobal));d.vertex.code.add(h.glsl`void forwardNormal() {
vNormalWorld = transformNormalGlobalFromModel * normalModel();
vNormalView = transformNormalViewFromGlobal * vNormalWorld;
}`);break;case p.NormalType.Ground:d.include(k.VertexPosition,t);d.varyings.add("vNormalWorld","vec3");d.vertex.code.add(h.glsl`
void forwardNormal() {
vNormalWorld = ${t.spherical?h.glsl`normalize(vPositionWorldCameraRelative);`:h.glsl`vec3(0.0, 0.0, 1.0);`}
}
`);break;case p.NormalType.ScreenDerivative:d.vertex.code.add(h.glsl`void forwardNormal() {}`);break;default:b.neverReached(t.normalType);case p.NormalType.COUNT:}};a.VertexNormalDrawParameters=g;a.VertexNormalPassParameters=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/StencilUtils":function(){define(["exports","./basicInterfaces","../../../webgl/enums"],function(a,b,q){const l={func:q.CompareFunction.LESS},p={function:{func:q.CompareFunction.ALWAYS,
ref:b.StencilBits.OutlineVisualElementMask,mask:b.StencilBits.OutlineVisualElementMask},operation:{fail:q.StencilOperation.KEEP,zFail:q.StencilOperation.KEEP,zPass:q.StencilOperation.ZERO}},k={function:{func:q.CompareFunction.ALWAYS,ref:b.StencilBits.OutlineVisualElementMask,mask:b.StencilBits.OutlineVisualElementMask},operation:{fail:q.StencilOperation.KEEP,zFail:q.StencilOperation.KEEP,zPass:q.StencilOperation.REPLACE}},h={function:{func:q.CompareFunction.EQUAL,ref:b.StencilBits.OutlineVisualElementMask,
mask:b.StencilBits.OutlineVisualElementMask},operation:{fail:q.StencilOperation.KEEP,zFail:q.StencilOperation.KEEP,zPass:q.StencilOperation.KEEP}};b={function:{func:q.CompareFunction.NOTEQUAL,ref:b.StencilBits.OutlineVisualElementMask,mask:b.StencilBits.OutlineVisualElementMask},operation:{fail:q.StencilOperation.KEEP,zFail:q.StencilOperation.KEEP,zPass:q.StencilOperation.KEEP}};a.depthCompareAlways={func:q.CompareFunction.ALWAYS};a.depthCompareLess=l;a.renderWhenBitIsNotSet=f=>({function:{func:q.CompareFunction.NOTEQUAL,
ref:f,mask:f},operation:{fail:q.StencilOperation.KEEP,zFail:q.StencilOperation.KEEP,zPass:q.StencilOperation.KEEP}});a.replaceBitWhenDepthTestPasses=f=>({function:{func:q.CompareFunction.ALWAYS,ref:f,mask:f},operation:{fail:q.StencilOperation.KEEP,zFail:q.StencilOperation.KEEP,zPass:q.StencilOperation.REPLACE}});a.stencilBaseAllZerosParams=p;a.stencilToolMaskBaseParams=k;a.stencilToolMaskOccluderParams=h;a.stencilToolTransparentOccluderParams=b;a.stencilWriteMaskOff={mask:0};a.stencilWriteMaskOn=
{mask:255};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/pbrUtils":function(){define(["exports","../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b,q){a.defaultAdvancedMRRFactors=[1,1,.5];a.defaultEsriSymbologyMRRFactors=[0,1,.2];a.defaultSchematicMRRFactors=[0,.6,.2];a.useSchematicPBR=function({normalTexture:l,metallicRoughnessTexture:p,metallicFactor:k,roughnessFactor:h,emissiveTexture:f,emissiveFactor:c,
occlusionTexture:e}){return null==l&&null==p&&null==f&&(null==c||b.exactEquals(c,q.ZEROS))&&null==e&&(null==h||1===h)&&(null==k||1===k)};a.useSchematicPBRI3S=function({normalTexture:l,metallicRoughnessTexture:p,metallicFactor:k,roughnessFactor:h,emissiveTexture:f,emissiveFactor:c,occlusionTexture:e}){return null==l&&null==p&&null==f&&(null==c||b.exactEquals(c,q.ZEROS))&&null==e&&(null==h||1===h)&&(null==k||1===k||0===k)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/DefaultMaterial.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl ../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J){function R(W){const S=new P.ShaderBuilder,{vertex:V,fragment:T,varyings:Y}=S;E.addProjViewLocalOrigin(V,W);S.include(c.PositionAttribute);Y.add("vpos","vec3");S.include(D.VisualVariables,W);S.include(h.InstancedDoublePrecision,W);S.include(w.VerticalOffset,W);S.include(C.colorTextureUV,W);if(W.output===l.ShaderOutput.Color){S.include(C.normalTextureUV,W);S.include(C.emissiveTextureUV,W);S.include(C.occlusionTextureUV,
W);S.include(C.metallicRoughnessTextureUV,W);E.addCameraPosition(V,W);S.include(f.NormalAttribute,W);S.include(k.Transform,W);const ha=W.normalType===f.NormalType.Attribute||W.normalType===f.NormalType.Compressed;ha&&W.offsetBackfaces&&S.include(q.Offset);S.include(m.ComputeNormalTexture,W);S.include(t.VertexNormal,W);W.instancedColor&&S.attributes.add(J.VertexAttribute.INSTANCECOLOR,"vec4");Y.add("vPositionLocal","vec3");S.include(g.TextureCoordinateAttribute,W);S.include(b.ForwardLinearDepth,W);
S.include(e.SymbolColor,W);S.include(d.VertexColor,W);V.uniforms.add(new I.Float4PassUniform("externalColor",ba=>ba.externalColor));Y.add("vcolorExt","vec4");W.multipassEnabled&&Y.add("depth","float");V.code.add(L.glsl`
void main(void) {
forwardNormalizedVertexColor();
vcolorExt = externalColor;
${W.instancedColor?"vcolorExt *\x3d instanceColor * 0.003921568627451;":""}
vcolorExt *= vvColor();
vcolorExt *= getSymbolColor();
forwardColorMixMode();
if (vcolorExt.a < ${L.glsl.float(F.symbolAlphaCutoff)}) {
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
} else {
vpos = getVertexInLocalOriginSpace();
vPositionLocal = vpos - view[3].xyz;
vpos = subtractOrigin(vpos);
${ha?L.glsl`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));`:""}
vpos = addVerticalOffset(vpos, localOrigin);
${W.hasVertexTangents?"vTangent \x3d dpTransformVertexTangent(tangent);":""}
gl_Position = transformPosition(proj, view, vpos);
${ha&&W.offsetBackfaces?"gl_Position \x3d offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
}
${W.multipassEnabled?"depth \x3d (view * vec4(vpos, 1.0)).z;":""}
forwardLinearDepth();
forwardTextureCoordinates();
forwardColorUV();
forwardNormalUV();
forwardEmissiveUV();
forwardOcclusionUV();
forwardMetallicRoughnessUV();
}
`);S.include(p.SliceDraw,W);S.include(n.EvaluateSceneLighting,W);S.include(r.EvaluateAmbientOcclusion,W);S.include(H.DiscardOrAdjustAlphaPass,W);S.include(W.instancedDoublePrecision?B.ReadShadowMapPass:B.ReadShadowMapDraw,W);S.include(x.multipassTerrainTest,W);E.addCameraPosition(T,W);T.uniforms.add(V.uniforms.get("localOrigin"),new G.Float3PassUniform("ambient",ba=>ba.ambient),new G.Float3PassUniform("diffuse",ba=>ba.diffuse),new O.FloatPassUniform("opacity",ba=>ba.opacity),new O.FloatPassUniform("layerOpacity",
ba=>ba.layerOpacity));W.hasColorTexture&&T.uniforms.add(new M.Texture2DPassUniform("tex",ba=>ba.texture));S.include(A.PhysicallyBasedRenderingParameters,W);S.include(z.PhysicallyBasedRendering,W);T.include(N.MixExternalColor);S.include(y.Normals,W);n.addAmbientBoostFactor(T);n.addLightingGlobalFactor(T);u.addMainLightIntensity(T);W.transparencyPassType===K.TransparencyPassType.ColorAlpha&&(S.outputs.add("fragColor","vec4",0),S.outputs.add("fragAlpha","float",1));T.code.add(L.glsl`
void main() {
discardBySlice(vpos);
${W.multipassEnabled?"terrainDepthTest(depth);":""}
${W.hasColorTexture?L.glsl`
vec4 texColor = texture(tex, ${W.hasColorTextureTransform?L.glsl`colorUV`:L.glsl`vuv0`});
${W.textureAlphaPremultiplied?"texColor.rgb /\x3d texColor.a;":""}
discardOrAdjustAlpha(texColor);`:L.glsl`vec4 texColor = vec4(1.0);`}
shadingParams.viewDirection = normalize(vpos - cameraPosition);
${W.normalType===f.NormalType.ScreenDerivative?L.glsl`
vec3 normal = screenDerivativeNormal(vPositionLocal);`:L.glsl`
shadingParams.normalView = vNormalWorld;
vec3 normal = shadingNormal(shadingParams);`}
${W.pbrMode===A.PBRMode.Normal?"applyPBRFactors();":""}
float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
vec3 posWorld = vpos + localOrigin;
float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
float shadow = ${W.receiveShadows?"readShadowMap(vpos, linearDepth)":W.spherical?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
vec3 matColor = max(ambient, diffuse);
${W.hasVertexColors?L.glsl`
vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:L.glsl`
vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
${W.hasNormalTexture?L.glsl`
mat3 tangentSpace = ${W.hasVertexTangents?"computeTangentSpace(normal);":"computeTangentSpace(normal, vpos, vuv0);"}
vec3 shadingNormal = computeTextureNormal(tangentSpace, ${W.hasNormalTextureTransform?L.glsl`normalUV`:"vuv0"});`:L.glsl`vec3 shadingNormal = normal;`}
vec3 normalGround = ${W.spherical?L.glsl`normalize(posWorld);`:L.glsl`vec3(0.0, 0.0, 1.0);`}
${W.snowCover?L.glsl`
float snow = smoothstep(0.5, 0.55, dot(normal, normalGround));
albedo = mix(albedo, vec3(1), snow);
shadingNormal = mix(shadingNormal, normal, snow);
ssao = mix(ssao, 1.0, snow);`:""}
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
${W.pbrMode===A.PBRMode.Normal||W.pbrMode===A.PBRMode.Schematic?L.glsl`
float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
${W.snowCover?L.glsl`
mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);
emission = mix(emission, vec3(0.0), snow);`:""}
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:L.glsl`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
${W.transparencyPassType===K.TransparencyPassType.ColorAlpha?L.glsl`
fragColor = premultiplyAlpha(fragColor);
fragAlpha = fragColor.a;`:""}
}
`)}S.include(v.DefaultMaterialAuxiliaryPasses,W);return S}const Q=Object.freeze(Object.defineProperty({__proto__:null,build:R},Symbol.toStringTag,{value:"Module"}));a.DefaultMaterial=Q;a.build=R})},"esri/views/3d/webgl-engine/core/shaderLibrary/Offset.glsl":function(){define(["exports","../shaderModules/interfaces"],function(a,b){a.Offset=function(q){q.vertex.code.add(b.glsl`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
vec3 camToVert = posWorld - camPosWorld;
bool isBackface = dot(camToVert, normalWorld) > 0.0;
if (isBackface) {
posClip.z += 0.0000003 * posClip.w;
}
return posClip;
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl":function(){define("exports ../../../collections/Component/Material/shader/DecodeSymbolColor.glsl ../../shaderModules/IntegerPassUniform ../../shaderModules/interfaces ../../../lib/VertexAttribute ../../../materials/internal/MaterialUtil".split(" "),function(a,b,q,l,p,k){a.SymbolColor=function(h,f){f.hasSymbolColors?(h.include(b.DecodeSymbolColor),h.attributes.add(p.VertexAttribute.SYMBOLCOLOR,
"vec4"),h.varyings.add("colorMixMode","mediump float"),h.vertex.code.add(l.glsl`int symbolColorMixMode;
vec4 getSymbolColor() {
return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451;
}
void forwardColorMixMode() {
colorMixMode = float(symbolColorMixMode) + 0.5;
}`)):(h.fragment.uniforms.add(new q.IntegerPassUniform("colorMixMode",c=>k.colorMixModes[c.colorMixMode])),h.vertex.code.add(l.glsl`vec4 getSymbolColor() { return vec4(1.0); }
void forwardColorMixMode() {}`))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/IntegerPassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"int",q.BindType.Pass,(h,f,c)=>h.setUniform1i(p,k(f,c)))}}a.IntegerPassUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl":function(){define(["exports",
"../../shaderModules/interfaces","../../../lib/VertexAttribute"],function(a,b,q){a.VertexColor=function(l,p){p.hasVertexColors?(l.attributes.add(q.VertexAttribute.COLOR,"vec4"),l.varyings.add("vColor","vec4"),l.vertex.code.add(b.glsl`void forwardVertexColor() { vColor = color; }`),l.vertex.code.add(b.glsl`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):l.vertex.code.add(b.glsl`void forwardVertexColor() {}
void forwardNormalizedVertexColor() {}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl":function(){define("exports ../ForwardLinearDepth.glsl ../ShaderOutput ../Slice.glsl ../Transform.glsl ../attributes/NormalAttribute.glsl ../attributes/ObjectAndLayerIdColor.glsl ../attributes/TextureCoordinateAttribute.glsl ../attributes/VertexNormal.glsl ../output/OutputDepth.glsl ../output/OutputHighlight.glsl ../shading/VisualVariables.glsl ../util/AlphaDiscard.glsl ../util/View.glsl ../../shaderModules/interfaces ../../shaderModules/Texture2DPassUniform ../../../lib/basicInterfaces".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){a.DefaultMaterialAuxiliaryPasses=function(n,u){const {vertex:x,fragment:y}=n,z=u.hasColorTexture&&u.alphaDiscardMode!==r.AlphaDiscardMode.Opaque;switch(u.output){case q.ShaderOutput.Depth:w.addProjViewLocalOrigin(x,u);n.include(p.Transform,u);n.include(l.SliceDraw,u);n.include(f.TextureCoordinateAttribute,u);z&&y.uniforms.add(new m.Texture2DPassUniform("tex",A=>A.texture));x.code.add(v.glsl`void main(void) {
vpos = getVertexInLocalOriginSpace();
vpos = subtractOrigin(vpos);
vpos = addVerticalOffset(vpos, localOrigin);
gl_Position = transformPosition(proj, view, vpos);
forwardTextureCoordinates();
}`);n.include(t.DiscardOrAdjustAlphaPass,u);y.code.add(v.glsl`
void main(void) {
discardBySlice(vpos);
${z?v.glsl`
vec4 texColor = texture(tex, ${u.hasColorTextureTransform?v.glsl`colorUV`:v.glsl`vuv0`});
discardOrAdjustAlpha(texColor);`:""}
}
`);break;case q.ShaderOutput.Shadow:case q.ShaderOutput.ShadowHighlight:case q.ShaderOutput.ShadowExcludeHighlight:case q.ShaderOutput.ViewshedShadow:case q.ShaderOutput.ObjectAndLayerIdColor:w.addProjViewLocalOrigin(x,u);n.include(p.Transform,u);n.include(f.TextureCoordinateAttribute,u);n.include(d.VisualVariables,u);n.include(e.OutputDepth,u);n.include(l.SliceDraw,u);n.include(h.ObjectAndLayerIdColor,u);b.addNearFar(n);n.varyings.add("depth","float");z&&y.uniforms.add(new m.Texture2DPassUniform("tex",
A=>A.texture));x.code.add(v.glsl`void main(void) {
vpos = getVertexInLocalOriginSpace();
vpos = subtractOrigin(vpos);
vpos = addVerticalOffset(vpos, localOrigin);
gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
forwardTextureCoordinates();
forwardObjectAndLayerIdColor();
}`);n.include(t.DiscardOrAdjustAlphaPass,u);y.code.add(v.glsl`
void main(void) {
discardBySlice(vpos);
${z?v.glsl`
vec4 texColor = texture(tex, ${u.hasColorTextureTransform?v.glsl`colorUV`:v.glsl`vuv0`});
discardOrAdjustAlpha(texColor);`:""}
${u.output===q.ShaderOutput.ObjectAndLayerIdColor?v.glsl`outputObjectAndLayerIdColor();`:v.glsl`outputDepth(depth);`}
}
`);break;case q.ShaderOutput.Normal:w.addProjViewLocalOrigin(x,u);n.include(p.Transform,u);n.include(k.NormalAttribute,u);n.include(c.VertexNormal,u);n.include(f.TextureCoordinateAttribute,u);n.include(d.VisualVariables,u);z&&y.uniforms.add(new m.Texture2DPassUniform("tex",A=>A.texture));u.normalType===k.NormalType.ScreenDerivative&&n.varyings.add("vPositionView","vec3");x.code.add(v.glsl`
void main(void) {
vpos = getVertexInLocalOriginSpace();
${u.normalType===k.NormalType.Attribute||u.normalType===k.NormalType.Compressed?v.glsl`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:v.glsl`
// Get vertex position in camera space for screen-space derivative normals
vPositionView = (view * vec4(vpos, 1.0)).xyz;
`}
vpos = subtractOrigin(vpos);
vpos = addVerticalOffset(vpos, localOrigin);
gl_Position = transformPosition(proj, view, vpos);
forwardTextureCoordinates();
}
`);n.include(l.SliceDraw,u);n.include(t.DiscardOrAdjustAlphaPass,u);y.code.add(v.glsl`
void main() {
discardBySlice(vpos);
${z?v.glsl`
vec4 texColor = texture(tex, ${u.hasColorTextureTransform?v.glsl`colorUV`:v.glsl`vuv0`});
discardOrAdjustAlpha(texColor);`:""}
${u.normalType===k.NormalType.ScreenDerivative?v.glsl`vec3 normal = screenDerivativeNormal(vPositionView);`:v.glsl`
vec3 normal = normalize(vNormalWorld);
if (gl_FrontFacing == false){
normal = -normal;
}`}
fragColor = vec4(0.5 + 0.5 * normal, 1.0);
}
`);break;case q.ShaderOutput.Highlight:w.addProjViewLocalOrigin(x,u),n.include(p.Transform,u),n.include(f.TextureCoordinateAttribute,u),n.include(d.VisualVariables,u),z&&y.uniforms.add(new m.Texture2DPassUniform("tex",A=>A.texture)),x.code.add(v.glsl`void main(void) {
vpos = getVertexInLocalOriginSpace();
vpos = subtractOrigin(vpos);
vpos = addVerticalOffset(vpos, localOrigin);
gl_Position = transformPosition(proj, view, vpos);
forwardTextureCoordinates();
}`),n.include(l.SliceDraw,u),n.include(t.DiscardOrAdjustAlphaPass,u),n.include(g.OutputHighlight,u),y.code.add(v.glsl`
void main() {
discardBySlice(vpos);
${z?v.glsl`
vec4 texColor = texture(tex, ${u.hasColorTextureTransform?v.glsl`colorUV`:v.glsl`vuv0`});
discardOrAdjustAlpha(texColor);`:""}
outputHighlight();
}
`)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl":function(){define(["exports","../ShaderOutput","../util/RgbaFloat16Encoding.glsl","../../shaderModules/interfaces"],function(a,b,q,l){a.OutputDepth=function(p,k){switch(k.output){case b.ShaderOutput.Shadow:case b.ShaderOutput.ShadowHighlight:case b.ShaderOutput.ShadowExcludeHighlight:case b.ShaderOutput.ViewshedShadow:p.fragment.include(q.Rgba4FloatEncoding),
p.fragment.code.add(l.glsl`float _calculateFragDepth(const in float depth) {
const float SLOPE_SCALE = 2.0;
const float BIAS = 20.0 * .000015259;
float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
return depth + SLOPE_SCALE * m + BIAS;
}
void outputDepth(float _linearDepth) {
fragColor = floatToRgba4(_calculateFragDepth(_linearDepth));
}`)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloat16Encoding.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.Rgba4FloatEncoding=function(q){q.code.add(b.glsl`const float MAX_RGBA4_FLOAT =
15.0 / 16.0 +
15.0 / 16.0 / 16.0 +
15.0 / 16.0 / 16.0 / 16.0 +
15.0 / 16.0 / 16.0 / 16.0 / 16.0;
const vec4 FIXED_POINT_FACTORS_RGBA4 = vec4(1.0, 16.0, 16.0 * 16.0, 16.0 * 16.0 * 16.0);
vec4 floatToRgba4(const float value) {
float valueInValidDomain = clamp(value, 0.0, MAX_RGBA4_FLOAT);
vec4 fixedPointU4 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS_RGBA4) * 16.0);
const float toU4AsFloat = 1.0 / 15.0;
return fixedPointU4 * toU4AsFloat;
}
const vec4 RGBA4_2_FLOAT_FACTORS = vec4(
15.0 / (16.0),
15.0 / (16.0 * 16.0),
15.0 / (16.0 * 16.0 * 16.0),
15.0 / (16.0 * 16.0 * 16.0 * 16.0)
);
float rgba4ToFloat(vec4 rgba) {
return dot(rgba, RGBA4_2_FLOAT_FACTORS);
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl":function(){define("exports ./DiscardOrAdjustAlphaBlend.glsl ../../shaderModules/FloatDrawUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../../lib/basicInterfaces".split(" "),function(a,b,q,l,p,k){function h(f,c,e){const g=f.fragment;c.alphaDiscardMode!==k.AlphaDiscardMode.Mask&&c.alphaDiscardMode!==k.AlphaDiscardMode.MaskBlend||
g.uniforms.add(e);switch(c.alphaDiscardMode){case k.AlphaDiscardMode.Blend:return f.include(b.DiscardOrAdjustAlphaBlend);case k.AlphaDiscardMode.Opaque:g.code.add(p.glsl`void discardOrAdjustAlpha(inout vec4 color) {
color.a = 1.0;
}`);break;case k.AlphaDiscardMode.Mask:g.code.add(p.glsl`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case k.AlphaDiscardMode.MaskBlend:f.fragment.code.add(p.glsl`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}a.DiscardOrAdjustAlphaDraw=function(f,c){h(f,c,new q.FloatDrawUniform("textureAlphaCutoff",e=>e.textureAlphaCutoff))};a.DiscardOrAdjustAlphaPass=function(f,c){h(f,c,new l.FloatPassUniform("textureAlphaCutoff",
e=>e.textureAlphaCutoff))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlphaBlend.glsl":function(){define(["exports","./AlphaCutoff","../../shaderModules/interfaces"],function(a,b,q){a.DiscardOrAdjustAlphaBlend=function(l){l.fragment.code.add(q.glsl`
#define discardOrAdjustAlpha(color) { if (color.a < ${q.glsl.float(b.symbolAlphaCutoff)}) { discard; } }
`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/FloatDrawUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"float",q.BindType.Draw,(h,f,c)=>h.setUniform1f(p,k(f,c)))}}a.FloatDrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../../core/libs/gl-matrix-2/factories/vec2f64 ../attributes/TextureCoordinateAttribute.glsl ../attributes/VertexTextureCoordinates.glsl ./Normals.glsl ../../shaderModules/Float2PassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix3PassUniform ../../shaderModules/Texture2DDrawUniform ../../shaderModules/Texture2DPassUniform ../../shaderTechnique/BindType ../../../lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.ComputeNormalTexture=function(w,v){const m=w.fragment;v.hasVertexTangents?(w.attributes.add(t.VertexAttribute.TANGENT,"vec4"),w.varyings.add("vTangent","vec4"),v.doubleSidedMode===k.NormalsDoubleSidedMode.WindingOrder?m.code.add(f.glsl`mat3 computeTangentSpace(vec3 normal) {
float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
return mat3(tangent, bitangent, normal);
}`):m.code.add(f.glsl`mat3 computeTangentSpace(vec3 normal) {
float tangentHeadedness = vTangent.w;
vec3 tangent = normalize(vTangent.xyz);
vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
return mat3(tangent, bitangent, normal);
}`)):m.code.add(f.glsl`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {
vec3 Q1 = dFdx(pos);
vec3 Q2 = dFdy(pos);
vec2 stx = dFdx(st);
vec2 sty = dFdy(st);
float det = stx.t * sty.s - sty.t * stx.s;
vec3 T = stx.t * Q2 - sty.t * Q1;
T = T - normal * dot(normal, T);
T *= inversesqrt(max(dot(T,T), 1.e-10));
vec3 B = sign(det) * cross(normal, T);
return mat3(T, B, normal);
}`);v.textureCoordinateType!==l.TextureCoordinateAttributeType.None&&(w.include(p.VertexTextureCoordinates,v),m.uniforms.add(v.pbrTextureBindType===d.BindType.Pass?new g.Texture2DPassUniform("normalTexture",r=>r.textureNormal):new e.Texture2DDrawUniform("normalTexture",r=>r.textureNormal)),v.hasNormalTextureTransform&&(m.uniforms.add(new h.Float2PassUniform("scale",r=>r.scale??q.ONES)),m.uniforms.add(new c.Matrix3PassUniform("normalTextureTransformMatrix",r=>r.normalTextureTransformMatrix??b.IDENTITY))),
m.code.add(f.glsl`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),v.hasNormalTextureTransform&&m.code.add(f.glsl`mat3 normalTextureRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0,
normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
0.0, 0.0, 0.0 );
rawNormal.xy = (normalTextureRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),m.code.add(f.glsl`return tangentSpace * rawNormal;
}`))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl":function(){define(["exports","../../shaderModules/interfaces","../../shaderModules/Texture2DPassUniform","../../../effects/ssao/SSAO"],function(a,b,q,l){a.EvaluateAmbientOcclusion=function(p,k){p=p.fragment;k.receiveAmbientOcclusion?(p.uniforms.add(new q.Texture2DPassUniform("ssaoTex",(h,f)=>f.ssao?.getTexture())),p.constants.add("blurSizePixelsInverse",
"float",1/l.blurSizePixels),p.code.add(b.glsl`float evaluateAmbientOcclusionInverse() {
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
}
float evaluateAmbientOcclusion() {
return 1.0 - evaluateAmbientOcclusionInverse();
}`)):p.code.add(b.glsl`float evaluateAmbientOcclusionInverse() { return 1.0; }
float evaluateAmbientOcclusion() { return 0.0; }`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/ssao/SSAO":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/mathUtils ../../../../../core/maybe ../../../../../core/reactiveUtils ../../../../../core/time ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../core/libs/gl-matrix-2/math/vec2 ../../../webgl/formats ../../../webgl/RenderNode ../../core/shaderLibrary/shading/ScreenSpaceConstants ./SSAOBlurTechnique ./SSAONoiseData ./SSAOParameters ./SSAOTechnique ../../lib/basicInterfaces ../../../../../chunks/SSAO.glsl ../../../../webgl/enums ../../../../webgl/Texture ../../../../webgl/TextureDescriptor".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){a.SSAO=class extends w{constructor(C){super(C);this.consumes={required:["normals"]};this.produces="ssao";this.isEnabled=()=>!1;this._enableTime=k.Milliseconds(0);this._passParameters=new n.SSAOPassParameters;this._drawParameters=new n.BlurDrawParameters}initialize(){const C=Uint8Array.from(atob(r.noiseData),F=>F.charCodeAt(0)),D=new B.TextureDescriptor;D.wrapMode=z.TextureWrapMode.CLAMP_TO_EDGE;D.pixelFormat=z.PixelFormat.RGB;D.wrapMode=z.TextureWrapMode.REPEAT;
D.hasMipmap=!0;D.width=32;D.height=32;this._passParameters.noiseTexture=new A.Texture(this.renderingContext,D,C);this._ssaoTechnique=this.techniques.acquire(u.SSAOTechnique);this._blurTechnique=this.techniques.acquire(m.SSAOBlurTechnique);this.addHandles(p.watch(()=>this.isEnabled(),()=>this._enableTime=k.Milliseconds(0)))}destroy(){this._passParameters.noiseTexture=l.disposeMaybe(this._passParameters.noiseTexture);this._blurTechnique.release();this._ssaoTechnique.release()}render(C){const D=this.bindParameters;
C=C.find(({name:K})=>"normals"===K);var F=C?.getTexture(),H=C?.getTexture(z.DepthStencilAttachment),N=this.fboCache;C=D.camera;const E=C.fullViewport[2],G=C.fullViewport[3],I=Math.round(E/2),O=Math.round(G/2);if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=k.Milliseconds(performance.now()),this.requestRender(),N.acquire(I,O,"ssao",t.ColorFormat.RED);0===this._enableTime&&(this._enableTime=k.Milliseconds(performance.now()));const L=this.renderingContext;var P=
this.view.qualitySettings.fadeDuration,M=q.clamp((v.distanceFadeEnd-C.relativeElevation)/(v.distanceFadeEnd-v.distanceFadeStart),0,1);P=0<P?Math.min(P,performance.now()-this._enableTime)/P:1;M*=P;this._passParameters.normalTexture=F;this._passParameters.depthTexture=H;this._passParameters.projScale=1/C.computeScreenPixelSizeAtDist(1);this._passParameters.intensity=2/y.getRadius(C)**6*M;H=N.acquire(E,G,"ssao input",t.ColorFormat.RG);L.unbindTexture(H.fbo.colorTexture);L.bindFramebuffer(H.fbo);L.setViewport(0,
0,E,G);L.bindTechnique(this._ssaoTechnique,D,this._passParameters,this._drawParameters);L.screen.draw();F=N.acquire(I,O,"ssao blur",t.ColorFormat.RED);L.unbindTexture(F.fbo.colorTexture);L.bindFramebuffer(F.fbo);this._drawParameters.colorTexture=H.getTexture();d.set(this._drawParameters.blurSize,0,2/G);L.bindTechnique(this._blurTechnique,D,this._passParameters,this._drawParameters);L.setViewport(0,0,I,O);L.screen.draw();H.release();N=N.acquire(I,O,"ssao",t.ColorFormat.RED);L.unbindTexture(N.fbo.colorTexture);
L.bindFramebuffer(N.fbo);L.setViewport(0,0,E,G);L.setClearColor(1,1,1,0);L.clear(z.ClearBufferBit.COLOR_BUFFER_BIT);this._drawParameters.colorTexture=F.getTexture();d.set(this._drawParameters.blurSize,2/E,0);L.bindTechnique(this._blurTechnique,D,this._passParameters,this._drawParameters);L.setViewport(0,0,I,O);L.screen.draw();L.setViewport4fv(C.fullViewport);F.release();1>P&&this.requestRender(x.RenderRequestType.UPDATE);return N}};b.__decorate([h.property()],a.SSAO.prototype,"consumes",void 0);b.__decorate([h.property()],
a.SSAO.prototype,"produces",void 0);b.__decorate([h.property({constructOnly:!0})],a.SSAO.prototype,"techniques",void 0);b.__decorate([h.property({constructOnly:!0})],a.SSAO.prototype,"isEnabled",void 0);a.SSAO=b.__decorate([g.subclass("esri.views.3d.webgl-engine.effects.ssao.SSAO")],a.SSAO);a.blurSizePixels=2;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/RenderNode":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Error ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/subclass ../webgl-engine/lib/basicInterfaces".split(" "),
function(a,b,q,l,p,k,h){b=class extends b{constructor(f){super(f);this.view=null;this.consumes={required:[]};this.produces="composite-color";this._context=null;this._dirty=!0}initialize(){this.addHandles([l.watch(()=>this.view.ready,f=>{f&&this.view._stage?.renderer.addRenderNode(this)},l.initial)])}destroy(){this.view._stage?.renderer?.removeRenderNode(this)}render(){throw new q("RenderNode:render-function-not-implemented","render() is not implemented.");}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view._stage.renderView.renderingContext.gl}acquireOutputFramebuffer(){var f=
this._frameBuffer?.getTexture()?.descriptor;f=this.view._stage.renderer.fboCache.acquire(f?.width??640,f?.height??480,this.produces);f.fbo?.initializeAndBind();return f}bindRenderTarget(){this._frameBuffer?.fbo?.initializeAndBind();return this._frameBuffer}requestRender(f){f===h.RenderRequestType.UPDATE&&this.view._stage?.renderView.requestRender(f);this._dirty=!0}resetWebGLState(){this.renderingContext.resetState();this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view._stage.renderer.fboCache}get bindParameters(){return this._context.bindParameters}get renderingContext(){return this.view._stage.renderView.renderingContext}updateAnimation(){return this._dirty?
(this._dirty=!1,!0):!1}doRender(f,c){this._context=c;this._frameBuffer=f.find(({name:e})=>e===this.produces);try{return this.render(f)}finally{this._frameBuffer=null}}};a.__decorate([p.property({constructOnly:!0})],b.prototype,"view",void 0);a.__decorate([p.property({constructOnly:!0})],b.prototype,"consumes",void 0);a.__decorate([p.property()],b.prototype,"produces",void 0);return b=a.__decorate([k.subclass("esri.views.3d.webgl.RenderNode")],b)})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceConstants":function(){define(["exports"],
function(a){a.distanceFadeEnd=5E5;a.distanceFadeStart=3E5;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/SSAOBlur.glsl ../../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx,
c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.SSAOBlur,()=>new Promise((e,g)=>a(["../../shaders/SSAOBlur.glsl"],e,g)));b.SSAOBlurTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/SSAOBlur.glsl":function(){define("exports ./vec32 ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e){function g(){const t=new f.ShaderBuilder,w=t.fragment;t.include(q.ScreenSpacePass);w.include(l.ReadDepth);w.uniforms.add(new e.Texture2DPassUniform("depthMap",v=>v.depthTexture),new c.Texture2DDrawUniform("tex",v=>v.colorTexture),new p.Float2DrawUniform("blurSize",v=>v.blurSize),new k.FloatPassUniform("projScale",(v,m)=>{m=b.distance(m.camera.eye,m.camera.center);return 5E4<m?Math.max(0,v.projScale-(m-5E4)):v.projScale}));w.code.add(h.glsl`
void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
float c = texture(tex, uv).r;
float d = linearDepthFromTexture(depthMap, uv);
float ddiff = d - center_d;
float w = exp(-r * r * ${h.glsl.float(.08)} - ddiff * ddiff * sharpness);
wTotal += w;
bTotal += w * c;
}
`);t.outputs.add("fragBlur","float");w.code.add(h.glsl`
void main(void) {
float b = 0.0;
float w_total = 0.0;
float center_d = linearDepthFromTexture(depthMap, uv);
float sharpness = -0.05 * projScale / center_d;
for (int r = -${h.glsl.int(4)}; r <= ${h.glsl.int(4)}; ++r) {
float rf = float(r);
vec2 uvOffset = uv + rf * blurSize;
blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
}
fragBlur = b / w_total;
}
`);return t}const d=Object.freeze(Object.defineProperty({__proto__:null,build:g},Symbol.toStringTag,{value:"Module"}));a.SSAOBlur=d;a.build=g})},"esri/views/3d/webgl-engine/core/shaderModules/Float2DrawUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k){super(p,"vec2",q.BindType.Draw,(h,f,c,e)=>h.setUniform2fv(p,k(f,c,e)))}}a.Float2DrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/effects/ssao/SSAONoiseData":function(){define(["exports"],function(a){a.noiseData="eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM";
Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/ssao/SSAOParameters":function(){define(["exports","../../../../../core/libs/gl-matrix-2/factories/vec2f64","../../core/shaderModules/interfaces"],function(a,b,q){class l extends q.NoParameters{constructor(){super(...arguments);this.projScale=1}}class p extends l{constructor(){super(...arguments);this.intensity=1}}class k extends q.NoParameters{}class h extends k{constructor(){super(...arguments);this.blurSize=
b.create()}}a.BlurDrawParameters=h;a.BlurPassParameters=l;a.SSAODrawParameters=k;a.SSAOPassParameters=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/ssao/SSAOTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/SSAO.glsl ../../../../webgl/renderState".split(" "),function(a,b,q,
l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx,c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.SSAO,()=>new Promise((e,g)=>a(["../../shaders/SSAO.glsl"],e,g)));b.SSAOTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/SSAO.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/vec2 ../core/libs/gl-matrix-2/factories/vec2f64 ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){function d(){const v=new e.ShaderBuilder,m=v.fragment;v.include(l.ScreenSpacePass);v.include(k.CameraSpace);m.include(p.ReadDepth);m.uniforms.add(new f.FloatPassUniform("radius",(r,n)=>t(n.camera))).code.add(c.glsl`vec3 sphere[16] = vec3[16](
vec3(0.186937, 0.0, 0.0),
vec3(0.700542, 0.0, 0.0),
vec3(-0.864858, -0.481795, -0.111713),
vec3(-0.624773, 0.102853, -0.730153),
vec3(-0.387172, 0.260319, 0.007229),
vec3(-0.222367, -0.642631, -0.707697),
vec3(-0.01336, -0.014956, 0.169662),
vec3(0.122575, 0.1544, -0.456944),
vec3(-0.177141, 0.85997, -0.42346),
vec3(-0.131631, 0.814545, 0.524355),
vec3(-0.779469, 0.007991, 0.624833),
vec3(0.308092, 0.209288,0.35969),
vec3(0.359331, -0.184533, -0.377458),
vec3(0.192633, -0.482999, -0.065284),
vec3(0.233538, 0.293706, -0.055139),
vec3(0.417709, -0.386701, 0.442449)
);
float fallOffFunction(float vv, float vn, float bias) {
float f = max(radius * radius - vv, 0.0);
return f * f * f * max(vn - bias, 0.0);
}`);m.code.add(c.glsl`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) {
vec3 v = Q - C;
float vv = dot(v, v);
float vn = dot(normalize(v), n_C);
return fallOffFunction(vv, vn, 0.1);
}`);m.uniforms.add(new g.Texture2DPassUniform("normalMap",r=>r.normalTexture),new g.Texture2DPassUniform("depthMap",r=>r.depthTexture),new f.FloatPassUniform("projScale",r=>r.projScale),new g.Texture2DPassUniform("rnm",r=>r.noiseTexture),new h.Float2PassUniform("rnmScale",(r,n)=>b.set(w,n.camera.fullWidth/r.noiseTexture.descriptor.width,n.camera.fullHeight/r.noiseTexture.descriptor.height)),new f.FloatPassUniform("intensity",r=>r.intensity),new h.Float2PassUniform("screenSize",(r,n)=>b.set(w,n.camera.fullWidth,
n.camera.fullHeight)));v.outputs.add("fragOcclusion","float");m.code.add(c.glsl`
void main(void) {
float depth = depthFromTexture(depthMap, uv);
// Early out if depth is out of range, such as in the sky
if (depth >= 1.0 || depth <= 0.0) {
fragOcclusion = 1.0;
return;
}
// get the normal of current fragment
vec4 norm4 = texture(normalMap, uv);
if(norm4.a != 1.0) {
fragOcclusion = 1.0;
return;
}
vec3 norm = vec3(-1.0) + 2.0 * norm4.xyz;
float currentPixelDepth = linearizeDepth(depth);
vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth);
float sum = 0.0;
vec3 tapPixelPos;
vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0);
// note: the factor 2.0 should not be necessary, but makes ssao much nicer.
// bug or deviation from CE somewhere else?
float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y);
for(int i = 0; i < ${c.glsl.int(16)}; ++i) {
vec2 unitOffset = reflect(sphere[i], fres).xy;
vec2 offset = vec2(-unitOffset * radius * ps);
// don't use current or very nearby samples
if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){
continue;
}
vec2 tc = vec2(gl_FragCoord.xy + offset);
if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue;
vec2 tcTap = tc / screenSize;
float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap);
tapPixelPos = reconstructPosition(tc, occluderFragmentDepth);
sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos);
}
// output the result
float A = max(1.0 - sum * intensity / float(${c.glsl.int(16)}), 0.0);
// Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2
A = (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2;
fragOcclusion = A;
}
`);return v}function t(v){return Math.max(10,20*v.computeScreenPixelSizeAtDist(Math.abs(4*v.relativeElevation)))}const w=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:d,getRadius:t},Symbol.toStringTag,{value:"Module"}));a.SSAO=q;a.build=d;a.getRadius=t})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/math/vec2 ../../../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../../../chunks/vec42 ../../../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../shaderModules/Float2PassUniform ../../shaderModules/Float4PassUniform ../../shaderModules/interfaces".split(" "),
function(a,b,q,l,p,k,h,f){function c(t){const w=t.projectionMatrix;return 0===w[11]?l.set(g,2/(t.fullWidth*w[0]),2/(t.fullHeight*w[5]),(1+w[12])/w[0],(1+w[13])/w[5]):l.set(g,-2/(t.fullWidth*w[0]),-2/(t.fullHeight*w[5]),(1-w[8])/w[0],(1-w[9])/w[5])}function e(t){return 0===t.projectionMatrix[11]?b.set(d,0,1):b.set(d,1,0)}const g=p.create(),d=q.create();a.CameraSpace=function(t){t.fragment.uniforms.add(new h.Float4PassUniform("projInfo",(w,v)=>c(v.camera)));t.fragment.uniforms.add(new k.Float2PassUniform("zScale",
(w,v)=>e(v.camera)));t.fragment.code.add(f.glsl`vec3 reconstructPosition(vec2 fragCoord, float depth) {
return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
}`)};a.getProjectionInfo=c;a.getZScale=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl":function(){define("exports ../../../../../../core/compilerUtils ./EvaluateAmbientLighting.glsl ./EvaluateAmbientOcclusion.glsl ./MainLighting.glsl ./PhysicallyBasedRendering.glsl ./PhysicallyBasedRenderingParameters.glsl ./PiUtils.glsl ../../shaderModules/BooleanPassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../../lighting/SceneLighting".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){function t(v){v.constants.add("ambientBoostFactor","float",d.ambientBoost)}function w(v){v.uniforms.add(new e.FloatPassUniform("lightingGlobalFactor",(m,r)=>r.lighting.globalFactor))}a.EvaluateSceneLighting=function(v,m){const r=v.fragment;v.include(l.EvaluateAmbientOcclusion,m);m.pbrMode!==h.PBRMode.Disabled&&v.include(k.PhysicallyBasedRendering,m);v.include(q.EvaluateAmbientLighting,m);v.include(f.PiUtils);r.code.add(g.glsl`
const float GAMMA_SRGB = 2.1;
const float INV_GAMMA_SRGB = 0.4761904;
${m.pbrMode===h.PBRMode.Disabled?"":"const vec3 GROUND_REFLECTANCE \x3d vec3(0.2);"}
`);t(r);w(r);p.addMainLightDirection(r);r.code.add(g.glsl`
float additionalDirectedAmbientLight(vec3 vPosWorld) {
float vndl = dot(${m.spherical?g.glsl`normalize(vPosWorld)`:g.glsl`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
}
`);p.addMainLightIntensity(r);r.code.add(g.glsl`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
}`);switch(m.pbrMode){case h.PBRMode.Disabled:case h.PBRMode.WaterOnIntegratedMesh:case h.PBRMode.Water:v.include(p.MainLighting);r.code.add(g.glsl`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight)
{
vec3 mainLighting = evaluateMainLighting(normalWorld, shadow);
vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
vec3 totalLight = mainLighting + ambientLighting + additionalLight;
totalLight = min(totalLight, vec3(PI));
vec3 outColor = vec3((albedoLinear / PI) * totalLight);
return pow(outColor, vec3(INV_GAMMA_SRGB));
}`);break;case h.PBRMode.Normal:case h.PBRMode.Schematic:r.code.add(g.glsl`const float fillLightIntensity = 0.25;
const float horizonLightDiffusion = 0.4;
const float additionalAmbientIrradianceFactor = 0.02;
vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance)
{
vec3 viewDirection = -viewDir;
vec3 h = normalize(viewDirection + mainLightDirection);
PBRShadingInfo inputs;
inputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0);
inputs.NdotH = clamp(dot(normal, h), 0.0, 1.0);
inputs.VdotH = clamp(dot(viewDirection, h), 0.0, 1.0);
inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0);
vec3 reflectedView = normalize(reflect(viewDirection, normal));
inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0);
inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
inputs.ssao = ssao;
inputs.metalness = mrr[0];
inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`);r.code.add(g.glsl`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`);m.useFillLights?r.uniforms.add(new c.BooleanPassUniform("hasFillLights",(n,u)=>u.enableFillLights)):r.constants.add("hasFillLights","bool",!1);r.code.add(g.glsl`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]);
ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * mainLightIntensity;
vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`);r.uniforms.add(new e.FloatPassUniform("lightingSpecularStrength",(n,u)=>u.lighting.mainLight.specularStrength),new e.FloatPassUniform("lightingEnvironmentStrength",(n,u)=>u.lighting.mainLight.environmentStrength));r.code.add(g.glsl`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView;
vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
inputs.NdotH_Horizon = dot(normal, horizonRingH);
vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow);
vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity;
vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight;
float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0));
inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`);r.code.add(g.glsl`
vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
vec3 emissionComponent = _emission == vec3(0.0) ? _emission : pow(_emission, vec3(GAMMA_SRGB));
vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
${m.pbrMode!==h.PBRMode.Schematic||m.hasColorTexture?g.glsl`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`:g.glsl`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`}
return outColor;
}
`);break;case h.PBRMode.Simplified:case h.PBRMode.TerrainWithWater:v.include(p.MainLighting);r.code.add(g.glsl`const float roughnessTerrain = 0.5;
const float specularityTerrain = 0.5;
const vec3 fresnelReflectionTerrain = vec3(0.04);
vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) {
vec3 viewDirection = -vd;
vec3 h = normalize(viewDirection + mainLightDirection);
float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0);
float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0);
float NdotH = clamp(dot(n, h), 0.0, 1.0);
float NdotNG = clamp(dot(n, nup), -1.0, 1.0);
vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB));
float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2];
vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain;
vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0));
vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity;
vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al;
vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent;
vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5;
vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI;
vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity;
vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV);
vec3 specularColor = f0 * dfg.x + f90 * dfg.y;
vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent;
vec3 outColorLinear = outDiffColor + specularComponent;
vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB));
return outColor;
}`);break;default:b.neverReached(m.pbrMode);case h.PBRMode.COUNT:}};a.addAmbientBoostFactor=t;a.addLightingGlobalFactor=w;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl":function(){define(["exports","./AnalyticalSkyModel.glsl","./PhysicallyBasedRenderingParameters.glsl","./PiUtils.glsl","../../shaderModules/interfaces"],function(a,b,q,l,p){a.PhysicallyBasedRendering=function(k,h){const f=k.fragment.code;
k.include(l.PiUtils);if(h.pbrMode===q.PBRMode.Normal||h.pbrMode===q.PBRMode.Schematic||h.pbrMode===q.PBRMode.Simplified||h.pbrMode===q.PBRMode.TerrainWithWater)f.add(p.glsl`float normalDistribution(float NdotH, float roughness)
{
float a = NdotH * roughness;
float b = roughness / (1.0 - NdotH * NdotH + a * a);
return b * b * INV_PI;
}`),f.add(p.glsl`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040);
const vec2 c2 = vec2(-1.04, 1.04);
vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
vec4 r = roughness * c0 + c1;
float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
return c2 * a004 + r.zw;
}`);if(h.pbrMode===q.PBRMode.Normal||h.pbrMode===q.PBRMode.Schematic)k.include(b.AnalyticalSkyModel),f.add(p.glsl`struct PBRShadingInfo
{
float NdotL;
float NdotV;
float NdotH;
float VdotH;
float LdotH;
float NdotNG;
float RdotNG;
float NdotAmbDir;
float NdotH_Horizon;
vec3 skyRadianceToSurface;
vec3 groundRadianceToSurface;
vec3 skyIrradianceToSurface;
vec3 groundIrradianceToSurface;
float averageAmbientRadiance;
float ssao;
vec3 albedoLinear;
vec3 f0;
vec3 f90;
vec3 diffuseColor;
float metalness;
float roughness;
};`),f.add(p.glsl`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG);
vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness);
vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;
vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);
vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
vec3 specularComponent = specularColor * indirectSpecular;
return (diffuseComponent + specularComponent);
}`),f.add(p.glsl`float gamutMapChanel(float x, vec2 p){
return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
}`),f.add(p.glsl`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){
vec3 outColor;
vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance));
outColor.x = gamutMapChanel(inColor.x, p) ;
outColor.y = gamutMapChanel(inColor.y, p) ;
outColor.z = gamutMapChanel(inColor.z, p) ;
return outColor;
}`)};a.PhysicallyBasedRenderingWater=function(k,h){const f=k.fragment.code;k.include(l.PiUtils);f.add(p.glsl`
struct PBRShadingWater
{
float NdotL; // cos angle between normal and light direction
float NdotV; // cos angle between normal and view direction
float NdotH; // cos angle between normal and half vector
float VdotH; // cos angle between view direction and half vector
float LdotH; // cos angle between light direction and half vector
float VdotN; // cos angle between view direction and normal vector
};
float dtrExponent = ${h.useCustomDTRExponentForWater?"2.2":"2.0"};
`);f.add(p.glsl`vec3 fresnelReflection(float angle, vec3 f0, float f90) {
return f0 + (f90 - f0) * pow(1.0 - angle, 5.0);
}`);f.add(p.glsl`float normalDistributionWater(float NdotH, float roughness)
{
float r2 = roughness * roughness;
float NdotH2 = NdotH * NdotH;
float denom = pow((NdotH2 * (r2 - 1.0) + 1.0), dtrExponent) * PI;
return r2 / denom;
}`);f.add(p.glsl`float geometricOcclusionKelemen(float LoH)
{
return 0.25 / (LoH * LoH);
}`);f.add(p.glsl`vec3 brdfSpecularWater(in PBRShadingWater props, float roughness, vec3 F0, float F0Max)
{
vec3 F = fresnelReflection(props.VdotH, F0, F0Max);
float dSun = normalDistributionWater(props.NdotH, roughness);
float V = geometricOcclusionKelemen(props.LdotH);
float diffusionSunHaze = mix(roughness + 0.045, roughness + 0.385, 1.0 - props.VdotH);
float strengthSunHaze = 1.2;
float dSunHaze = normalDistributionWater(props.NdotH, diffusionSunHaze)*strengthSunHaze;
return ((dSun + dSunHaze) * V) * F;
}
vec3 tonemapACES(const vec3 x) {
return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/AnalyticalSkyModel.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.AnalyticalSkyModel=function(q){q=q.fragment.code;q.add(b.glsl`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)
{
return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
}`);q.add(b.glsl`float integratedRadiance(float cosTheta2, float roughness)
{
return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
}`);q.add(b.glsl`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness)
{
float cosTheta2 = 1.0 - RdotNG * RdotNG;
float intRadTheta = integratedRadiance(cosTheta2, roughness);
float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
float sky = 2.0 - ground;
return (ground * ambientGround + sky * ambientSky) * 0.5;
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../util/RgbaFloat16Encoding.glsl ../../shaderModules/Float4PassUniform ../../shaderModules/IntegerPassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix4sDrawUniform ../../shaderModules/Matrix4sPassUniform ../../shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e){function g(m){m=m.fragment;m.include(l.Rgba4FloatEncoding);m.uniforms.add(new e.Texture2DPassUniform("shadowMap",(r,n)=>n.shadowMap.depthTexture),new k.IntegerPassUniform("numCascades",(r,n)=>n.shadowMap.numCascades),new p.Float4PassUniform("cascadeDistances",(r,n)=>n.shadowMap.cascadeDistances));m.code.add(h.glsl`int chooseCascade(float depth, out mat4 mat) {
vec4 distance = cascadeDistances;
int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
return i;
}
vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
vec4 lv = mat * vec4(_vpos, 1.0);
lv.xy /= lv.w;
return 0.5 * lv.xyz + vec3(0.5);
}
vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) {
float xScale = float(textureSize.y) / float(textureSize.x);
return vec2((float(i) + lvpos.x) * xScale, lvpos.y);
}
float readShadowMapDepth(ivec2 uv, sampler2D _depthTex) {
return rgba4ToFloat(texelFetch(_depthTex, uv, 0));
}
float posIsInShadow(ivec2 uv, vec3 lvpos, sampler2D _depthTex) {
return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0;
}
float filterShadow(vec2 uv, vec3 lvpos, ivec2 texSize, sampler2D _depthTex) {
vec2 st = fract(uv * vec2(texSize) + vec2(0.5));
ivec2 base = ivec2(uv * vec2(texSize) - vec2(0.5));
float s00 = posIsInShadow(ivec2(base.x, base.y), lvpos, _depthTex);
float s10 = posIsInShadow(ivec2(base.x + 1, base.y), lvpos, _depthTex);
float s11 = posIsInShadow(ivec2(base.x + 1, base.y + 1), lvpos, _depthTex);
float s01 = posIsInShadow(ivec2(base.x, base.y + 1), lvpos, _depthTex);
return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);
}
float readShadowMap(const in vec3 _vpos, float _linearDepth) {
mat4 mat;
int i = chooseCascade(_linearDepth, mat);
if (i >= numCascades) { return 0.0; }
vec3 lvpos = lightSpacePosition(_vpos, mat);
if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }
ivec2 size = textureSize(shadowMap, 0);
vec2 uv = cascadeCoordinates(i, size, lvpos);
return filterShadow(uv, lvpos, size, shadowMap);
}`)}class d extends h.NoParameters{constructor(){super(...arguments);this.origin=q.create()}}class t extends d{}class w extends h.NoParameters{constructor(){super(...arguments);this.modelTransformation=b.IDENTITY}}class v extends w{constructor(){super(...arguments);this.origin=q.create()}}a.ReadShadowMapDraw=function(m,r){r.receiveShadows&&(m.fragment.uniforms.add(new f.Matrix4sDrawUniform("shadowMapMatrix",(n,u)=>u.shadowMap.getShadowMapMatrices(n.origin),4)),g(m))};a.ReadShadowMapDrawParameters=
t;a.ReadShadowMapParameters=w;a.ReadShadowMapPass=function(m,r){r.receiveShadows&&(m.fragment.uniforms.add(new c.Matrix4sPassUniform("shadowMapMatrix",(n,u)=>u.shadowMap.getShadowMapMatrices(n.origin),4)),g(m))};a.ReadShadowMapPassParameters=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Matrix4sDrawUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,
k,h){super(p,"mat4",q.BindType.Draw,(f,c,e,g)=>f.setUniformMatrix4fv(p,k(c,e,g)),h)}}a.Matrix4sDrawUniform=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/Matrix4sPassUniform":function(){define(["exports","./Uniform","../shaderTechnique/BindType"],function(a,b,q){class l extends b.Uniform{constructor(p,k,h){super(p,"mat4",q.BindType.Pass,(f,c,e)=>f.setUniformMatrix4fv(p,k(c,e)),h)}}a.Matrix4sPassUniform=l;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl":function(){define(["exports","../../../../../../core/libs/gl-matrix-2/factories/mat3f64","../attributes/TextureCoordinateAttribute.glsl","../../shaderModules/interfaces","../../shaderModules/Matrix3PassUniform"],function(a,b,q,l,p){a.colorTextureUV=function(k,h){h.hasColorTextureTransform?(k.vertex.uniforms.add(new p.Matrix3PassUniform("colorTextureTransformMatrix",f=>f.colorTextureTransformMatrix??
b.IDENTITY)),k.varyings.add("colorUV","vec2"),k.vertex.code.add(l.glsl`void forwardColorUV(){
colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
}`)):k.vertex.code.add(l.glsl`void forwardColorUV(){}`)};a.emissiveTextureUV=function(k,h){h.hasEmissionTextureTransform&&h.textureCoordinateType!==q.TextureCoordinateAttributeType.None?(k.vertex.uniforms.add(new p.Matrix3PassUniform("emissiveTextureTransformMatrix",f=>f.emissiveTextureTransformMatrix??b.IDENTITY)),k.varyings.add("emissiveUV","vec2"),k.vertex.code.add(l.glsl`void forwardEmissiveUV(){
emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
}`)):k.vertex.code.add(l.glsl`void forwardEmissiveUV(){}`)};a.metallicRoughnessTextureUV=function(k,h){h.hasMetallicRoughnessTextureTransform&&h.textureCoordinateType!==q.TextureCoordinateAttributeType.None?(k.vertex.uniforms.add(new p.Matrix3PassUniform("metallicRoughnessTextureTransformMatrix",f=>f.metallicRoughnessTextureTransformMatrix??b.IDENTITY)),k.varyings.add("metallicRoughnessUV","vec2"),k.vertex.code.add(l.glsl`void forwardMetallicRoughnessUV(){
metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
}`)):k.vertex.code.add(l.glsl`void forwardMetallicRoughnessUV(){}`)};a.normalTextureUV=function(k,h){h.hasNormalTextureTransform&&h.textureCoordinateType!==q.TextureCoordinateAttributeType.None?(k.vertex.uniforms.add(new p.Matrix3PassUniform("normalTextureTransformMatrix",f=>f.normalTextureTransformMatrix??b.IDENTITY)),k.varyings.add("normalUV","vec2"),k.vertex.code.add(l.glsl`void forwardNormalUV(){
normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
}`)):k.vertex.code.add(l.glsl`void forwardNormalUV(){}`)};a.occlusionTextureUV=function(k,h){h.hasOcclusionTextureTransform&&h.textureCoordinateType!==q.TextureCoordinateAttributeType.None?(k.vertex.uniforms.add(new p.Matrix3PassUniform("occlusionTextureTransformMatrix",f=>f.occlusionTextureTransformMatrix??b.IDENTITY)),k.varyings.add("occlusionUV","vec2"),k.vertex.code.add(l.glsl`void forwardOcclusionUV(){
occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
}`)):k.vertex.code.add(l.glsl`void forwardOcclusionUV(){}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl":function(){define(["exports","../../../../layers/support/symbolColorUtils","./ColorConversion.glsl","../../shaderModules/interfaces"],function(a,b,q,l){a.MixExternalColor=function(p){p.include(q.ColorConversion);p.code.add(l.glsl`
vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
// workaround for artifacts in OSX using Intel Iris Pro
// see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
vec3 internalMixed = internalColor * textureColor;
vec3 allMixed = internalMixed * externalColor;
if (mode == ${l.glsl.int(b.ColorMixModeEnum.Multiply)}) {
return allMixed;
}
if (mode == ${l.glsl.int(b.ColorMixModeEnum.Ignore)}) {
return internalMixed;
}
if (mode == ${l.glsl.int(b.ColorMixModeEnum.Replace)}) {
return externalColor;
}
// tint (or something invalid)
float vIn = rgb2v(internalMixed);
vec3 hsvTint = rgb2hsv(externalColor);
vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);
return hsv2rgb(hsvOut);
}
float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
// workaround for artifacts in OSX using Intel Iris Pro
// see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
float internalMixed = internalOpacity * textureOpacity;
float allMixed = internalMixed * externalOpacity;
if (mode == ${l.glsl.int(b.ColorMixModeEnum.Ignore)}) {
return internalMixed;
}
if (mode == ${l.glsl.int(b.ColorMixModeEnum.Replace)}) {
return externalOpacity;
}
// multiply or tint (or something invalid)
return allMixed;
}
`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration":function(){define("exports ../../../../chunks/tslib.es6 ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/attributes/NormalAttribute.glsl ../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../core/shaderLibrary/shading/Normals.glsl ../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/basicInterfaces ../lib/TransparencyPassType ../materials/DefaultTechniqueConfiguration".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){class d extends g.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=q.ShaderOutput.Color;this.alphaDiscardMode=c.AlphaDiscardMode.Opaque;this.doubleSidedMode=k.NormalsDoubleSidedMode.None;this.pbrMode=h.PBRMode.Disabled;this.cullFace=c.CullFaceOptions.None;this.transparencyPassType=e.TransparencyPassType.NONE;this.normalType=l.NormalType.Attribute;this.textureCoordinateType=p.TextureCoordinateAttributeType.None;this.customDepthTest=c.DepthTestFunction.Less;
this.hasSlicePlane=this.hasVerticalOffset=this.hasSymbolColors=this.hasVertexColors=this.spherical=!1;this.hasSliceHighlight=!0;this.doublePrecisionRequiresObfuscation=this.instancedDoublePrecision=this.objectAndLayerIdColorInstanced=this.instancedColor=this.instanced=this.textureAlphaPremultiplied=this.receiveAmbientOcclusion=this.receiveShadows=this.vvColor=this.vvSize=this.offsetBackfaces=this.hasModelTransformation=this.multipassEnabled=this.hasOccludees=this.hasVertexTangents=this.hasScreenSizePerspective=
this.hasNormalTexture=this.hasOcclusionTexture=this.hasEmissionTexture=this.hasMetallicRoughnessTexture=this.hasColorTexture=!1;this.writeDepth=!0;this.transparent=!1;this.enableOffset=!0;this.hasMetallicRoughnessTextureTransform=this.hasOcclusionTextureTransform=this.hasNormalTextureTransform=this.hasEmissionTextureTransform=this.hasColorTextureTransform=this.snowCover=this.cullAboveGround=!1}}b.__decorate([f.parameter({count:q.ShaderOutput.COUNT})],d.prototype,"output",void 0);b.__decorate([f.parameter({count:c.AlphaDiscardMode.COUNT})],
d.prototype,"alphaDiscardMode",void 0);b.__decorate([f.parameter({count:k.NormalsDoubleSidedMode.COUNT})],d.prototype,"doubleSidedMode",void 0);b.__decorate([f.parameter({count:h.PBRMode.COUNT})],d.prototype,"pbrMode",void 0);b.__decorate([f.parameter({count:c.CullFaceOptions.COUNT})],d.prototype,"cullFace",void 0);b.__decorate([f.parameter({count:e.TransparencyPassType.COUNT})],d.prototype,"transparencyPassType",void 0);b.__decorate([f.parameter({count:l.NormalType.COUNT})],d.prototype,"normalType",
void 0);b.__decorate([f.parameter({count:p.TextureCoordinateAttributeType.COUNT})],d.prototype,"textureCoordinateType",void 0);b.__decorate([f.parameter({count:c.DepthTestFunction.COUNT})],d.prototype,"customDepthTest",void 0);b.__decorate([f.parameter()],d.prototype,"spherical",void 0);b.__decorate([f.parameter()],d.prototype,"hasVertexColors",void 0);b.__decorate([f.parameter()],d.prototype,"hasSymbolColors",void 0);b.__decorate([f.parameter()],d.prototype,"hasVerticalOffset",void 0);b.__decorate([f.parameter()],
d.prototype,"hasSlicePlane",void 0);b.__decorate([f.parameter()],d.prototype,"hasSliceHighlight",void 0);b.__decorate([f.parameter()],d.prototype,"hasColorTexture",void 0);b.__decorate([f.parameter()],d.prototype,"hasMetallicRoughnessTexture",void 0);b.__decorate([f.parameter()],d.prototype,"hasEmissionTexture",void 0);b.__decorate([f.parameter()],d.prototype,"hasOcclusionTexture",void 0);b.__decorate([f.parameter()],d.prototype,"hasNormalTexture",void 0);b.__decorate([f.parameter()],d.prototype,
"hasScreenSizePerspective",void 0);b.__decorate([f.parameter()],d.prototype,"hasVertexTangents",void 0);b.__decorate([f.parameter()],d.prototype,"hasOccludees",void 0);b.__decorate([f.parameter()],d.prototype,"multipassEnabled",void 0);b.__decorate([f.parameter()],d.prototype,"hasModelTransformation",void 0);b.__decorate([f.parameter()],d.prototype,"offsetBackfaces",void 0);b.__decorate([f.parameter()],d.prototype,"vvSize",void 0);b.__decorate([f.parameter()],d.prototype,"vvColor",void 0);b.__decorate([f.parameter()],
d.prototype,"receiveShadows",void 0);b.__decorate([f.parameter()],d.prototype,"receiveAmbientOcclusion",void 0);b.__decorate([f.parameter()],d.prototype,"textureAlphaPremultiplied",void 0);b.__decorate([f.parameter()],d.prototype,"instanced",void 0);b.__decorate([f.parameter()],d.prototype,"instancedColor",void 0);b.__decorate([f.parameter()],d.prototype,"objectAndLayerIdColorInstanced",void 0);b.__decorate([f.parameter()],d.prototype,"instancedDoublePrecision",void 0);b.__decorate([f.parameter()],
d.prototype,"doublePrecisionRequiresObfuscation",void 0);b.__decorate([f.parameter()],d.prototype,"writeDepth",void 0);b.__decorate([f.parameter()],d.prototype,"transparent",void 0);b.__decorate([f.parameter()],d.prototype,"enableOffset",void 0);b.__decorate([f.parameter()],d.prototype,"cullAboveGround",void 0);b.__decorate([f.parameter()],d.prototype,"snowCover",void 0);b.__decorate([f.parameter()],d.prototype,"hasColorTextureTransform",void 0);b.__decorate([f.parameter()],d.prototype,"hasEmissionTextureTransform",
void 0);b.__decorate([f.parameter()],d.prototype,"hasNormalTextureTransform",void 0);b.__decorate([f.parameter()],d.prototype,"hasOcclusionTextureTransform",void 0);b.__decorate([f.parameter()],d.prototype,"hasMetallicRoughnessTextureTransform",void 0);b.__decorate([f.parameter({constValue:!1})],d.prototype,"occlusionPass",void 0);b.__decorate([f.parameter({constValue:!0})],d.prototype,"hasVvInstancing",void 0);b.__decorate([f.parameter({constValue:!1})],d.prototype,"useCustomDTRExponentForWater",
void 0);b.__decorate([f.parameter({constValue:!1})],d.prototype,"supportsTextureAtlas",void 0);b.__decorate([f.parameter({constValue:!0})],d.prototype,"useFillLights",void 0);a.DefaultMaterialTechniqueConfiguration=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/RealisticTreeTechnique":function(){define("require exports ../core/shaderLibrary/attributes/NormalAttribute.glsl ../core/shaderLibrary/shading/Normals.glsl ../core/shaderTechnique/ReloadableShaderModule ./DefaultMaterialTechnique ../../../../chunks/RealisticTree.glsl".split(" "),
function(a,b,q,l,p,k,h){class f extends k.DefaultMaterialTechnique{initializeConfiguration(c,e){super.initializeConfiguration(c,e);e.hasMetallicRoughnessTexture=!1;e.hasEmissionTexture=!1;e.hasOcclusionTexture=!1;e.hasNormalTexture=!1;e.hasModelTransformation=!1;e.normalType=q.NormalType.Attribute;e.doubleSidedMode=l.NormalsDoubleSidedMode.WindingOrder;e.hasVertexTangents=!1}initializeProgram(c){return this._initializeProgram(c,f.shader)}}f.shader=new p.ReloadableShaderModule(h.RealisticTree,()=>
new Promise((c,e)=>a(["./RealisticTree.glsl"],c,e)));b.RealisticTreeTechnique=f;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/RealisticTree.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl ../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L){function P(K){const J=new G.ShaderBuilder,{vertex:R,fragment:Q,varyings:W}=J;D.addProjViewLocalOrigin(R,K);J.include(c.PositionAttribute);W.add("vpos","vec3");J.include(z.VisualVariables,K);J.include(h.InstancedDoublePrecision,K);J.include(t.VerticalOffset,K);K.output===l.ShaderOutput.Color&&(D.addCameraPosition(J.vertex,K),J.include(f.NormalAttribute,K),J.include(k.Transform,K),K.offsetBackfaces&&J.include(q.Offset),K.instancedColor&&
J.attributes.add(L.VertexAttribute.INSTANCECOLOR,"vec4"),W.add("vNormalWorld","vec3"),W.add("localvpos","vec3"),K.multipassEnabled&&W.add("depth","float"),J.include(g.TextureCoordinateAttribute,K),J.include(b.ForwardLinearDepth,K),J.include(e.SymbolColor,K),J.include(d.VertexColor,K),R.uniforms.add(new H.Float4PassUniform("externalColor",S=>S.externalColor)),W.add("vcolorExt","vec4"),R.code.add(E.glsl`
void main(void) {
forwardNormalizedVertexColor();
vcolorExt = externalColor;
${K.instancedColor?"vcolorExt *\x3d instanceColor * 0.003921568627451;":""}
vcolorExt *= vvColor();
vcolorExt *= getSymbolColor();
forwardColorMixMode();
if (vcolorExt.a < ${E.glsl.float(A.symbolAlphaCutoff)}) {
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
} else {
vpos = getVertexInLocalOriginSpace();
localvpos = vpos - view[3].xyz;
vpos = subtractOrigin(vpos);
vNormalWorld = dpNormal(vvLocalNormal(normalModel()));
vpos = addVerticalOffset(vpos, localOrigin);
gl_Position = transformPosition(proj, view, vpos);
${K.offsetBackfaces?"gl_Position \x3d offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
}
${K.multipassEnabled?E.glsl`depth = (view * vec4(vpos, 1.0)).z;`:""}
forwardLinearDepth();
forwardTextureCoordinates();
}
`));K.output===l.ShaderOutput.Color&&(J.include(p.SliceDraw,K),J.include(m.EvaluateSceneLighting,K),J.include(v.EvaluateAmbientOcclusion,K),J.include(B.DiscardOrAdjustAlphaPass,K),J.include(K.instancedDoublePrecision?y.ReadShadowMapPass:y.ReadShadowMapDraw,K),J.include(n.multipassTerrainTest,K),D.addCameraPosition(J.fragment,K),r.addMainLightDirection(Q),m.addAmbientBoostFactor(Q),m.addLightingGlobalFactor(Q),Q.uniforms.add(R.uniforms.get("localOrigin"),R.uniforms.get("view"),new F.Float3PassUniform("ambient",
S=>S.ambient),new F.Float3PassUniform("diffuse",S=>S.diffuse),new N.FloatPassUniform("opacity",S=>S.opacity),new N.FloatPassUniform("layerOpacity",S=>S.layerOpacity)),K.hasColorTexture&&Q.uniforms.add(new I.Texture2DPassUniform("tex",S=>S.texture)),J.include(x.PhysicallyBasedRenderingParameters,K),J.include(u.PhysicallyBasedRendering,K),Q.include(C.MixExternalColor),K.transparencyPassType===O.TransparencyPassType.ColorAlpha&&(J.outputs.add("fragColor","vec4",0),J.outputs.add("fragAlpha","float",1)),
r.addMainLightIntensity(Q),Q.code.add(E.glsl`
void main() {
discardBySlice(vpos);
${K.multipassEnabled?E.glsl`terrainDepthTest(depth);`:""}
${K.hasColorTexture?E.glsl`
vec4 texColor = texture(tex, ${K.hasColorTextureTransform?E.glsl`colorUV`:E.glsl`vuv0`});
${K.textureAlphaPremultiplied?"texColor.rgb /\x3d texColor.a;":""}
discardOrAdjustAlpha(texColor);`:E.glsl`vec4 texColor = vec4(1.0);`}
vec3 viewDirection = normalize(vpos - cameraPosition);
${K.pbrMode===x.PBRMode.Normal?"applyPBRFactors();":""}
float ssao = evaluateAmbientOcclusionInverse();
ssao *= getBakedOcclusion();
float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
${K.receiveShadows?"float shadow \x3d readShadowMap(vpos, linearDepth);":K.spherical?"float shadow \x3d lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow \x3d 0.0;"}
vec3 matColor = max(ambient, diffuse);
${K.hasVertexColors?E.glsl`
vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:E.glsl`
vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
${K.snowCover?E.glsl`albedo = mix(albedo, vec3(1), 0.9);`:E.glsl``}
${E.glsl`
vec3 shadingNormal = normalize(vNormalWorld);
albedo *= 1.2;
vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0);
float treeRadialFalloff = vColor.r;
float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
additionalLight += backLightFactor * mainLightIntensity;`}
${K.pbrMode===x.PBRMode.Normal||K.pbrMode===x.PBRMode.Schematic?K.spherical?E.glsl`vec3 normalGround = normalize(vpos + localOrigin);`:E.glsl`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:E.glsl``}
${K.pbrMode===x.PBRMode.Normal||K.pbrMode===x.PBRMode.Schematic?E.glsl`
float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
${K.snowCover?E.glsl`
mrr = vec3(0.0, 1.0, 0.04);
emission = vec3(0.0);`:""}
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:E.glsl`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
${K.transparencyPassType===O.TransparencyPassType.ColorAlpha?E.glsl`
fragColor = premultiplyAlpha(fragColor);
fragAlpha = fragColor.a;`:""}
}
`));J.include(w.DefaultMaterialAuxiliaryPasses,K);return J}const M=Object.freeze(Object.defineProperty({__proto__:null,build:P},Symbol.toStringTag,{value:"Module"}));a.RealisticTree=M;a.build=P})},"esri/views/3d/layers/graphics/interfaces":function(){define(["exports"],function(a){a.ApplyRendererDiffResult=void 0;var b=a.ApplyRendererDiffResult||(a.ApplyRendererDiffResult={});b[b.RecreateSymbol=0]="RecreateSymbol";b[b.RecreateGraphics=1]="RecreateGraphics";b[b.FastUpdate=2]="FastUpdate";Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Loadable":function(){define(["exports","../../../../core/maybe","../../../../core/promiseUtils"],function(a,b,q){class l{constructor(p){this.schedule=p;this._abortController=null;this._loadStatus=a.LoadStatus.LOADING;this.logger=this._loader=this._loadError=null}destroy(){this.abortLoad()}get loadStatus(){return this._loadStatus}load(p,k){if(this._loadStatus===a.LoadStatus.LOADED)return p&&p(),this._loader??Promise.resolve();if(this._loadStatus===
a.LoadStatus.FAILED)return k&&k(this._loadError),this._loader??Promise.resolve();null==this._loader&&(this._abortController=new AbortController,this._loader=this.doLoad(this._abortController.signal).then(()=>{this._abortController=null;this._loadStatus=a.LoadStatus.LOADED},h=>{this._loadError=h;this._abortController=null;this._loadStatus=a.LoadStatus.FAILED;!q.isAbortError(h)&&this.logger&&h.message&&this.logger.warn(h.message);throw h;}));this._loader.then(p,k).catch(()=>{});return this._loader}abortLoad(){null!=
this._abortController?this._abortController=b.abortMaybe(this._abortController):this._loadStatus===a.LoadStatus.LOADING&&(this._loadStatus=a.LoadStatus.FAILED);this._loader=null}}a.LoadStatus=void 0;(function(p){p[p.LOADING=0]="LOADING";p[p.LOADED=1]="LOADED";p[p.FAILED=2]="FAILED"})(a.LoadStatus||(a.LoadStatus={}));a.Loadable=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/pointUtils":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/projectPointToVector ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/coordsUtils ../../../../layers/graphics/dehydratedPoint ./elevationAlignmentUtils ./graphicUtils ../../webgl-engine/lib/Object3D".split(" "),
function(a,b,q,l,p,k,h,f,c){function e(t,w){const v=t.clippingExtent;if(!v)return!1;q.projectPointToVector(w,d,t.elevationProvider.spatialReference);return!l.containsPoint(v,d)}function g(t,w){q.projectPointToVector(w,d,t.renderCoordsHelper.spatialReference);return t.localOriginFactory.getOrigin(d)}const d=b.create();a.createStageObject=function(t,w,v,m,r){if(e(t,w))return null;v.localOrigin=g(t,w);v=new c.Object3D({geometries:[v],castShadow:!1,layerUid:t.layer.uid,graphicUid:r,usesVerticalDistanceToGround:!0});
t=h.applyElevationAlignmentForHUD(v,w,t.elevationProvider,t.renderCoordsHelper,m);return{object:v,sampledElevation:t}};a.extendPointGraphicElevationContext=function(t,w,v){t=t.elevationContext;v=v.spatialReference;q.projectPointToVector(w,d,v);t.centerPointInElevationSR=k.makeDehydratedPoint(d[0],d[1],w.hasZ?d[2]:0,null!=v?v:null)};a.getLocalOriginForPoint=g;a.placePointOnGeometry=function(t){switch(t.type){case "point":return t;case "polygon":case "extent":return f.computeCentroid(t);case "polyline":var w=
t.paths[0];if(!w||0===w.length)break;w=p.getPointOnPath(w,p.getPathLength(w)/2);return k.makeDehydratedPoint(w[0],w[1],w[2],t.spatialReference);case "mesh":return t.origin}return null};a.updateStageObjectGeometry=function(t,w,v,m){return e(w,v)?null:h.applyElevationAlignmentForHUD(t,v,w.elevationProvider,w.renderCoordsHelper,m)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Object3D":function(){define("exports ../../../../core/has ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/sphere ../../support/mathUtils ./basicInterfaces ./ContentObject ./ContentObjectType ./Object3DStateID ./Util ./VertexAttribute ../materials/renderers/utils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){class m extends e.ContentObject{get geometries(){return this._geometries}get transformation(){return this._transformation??l.IDENTITY}set transformation(B){this._transformation=q.copy(this._transformation??l.create(),B);this._invalidateBoundingVolume();this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(B){this._shaderTransformation=B?q.copy(this._shaderTransformation??l.create(),B):
null;this._invalidateBoundingVolume();this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}constructor(B={}){super();this.type=g.ContentObjectType.Object;this._parentLayer=this._shaderTransformation=null;this._visible=!0;this.castShadow=B.castShadow??!0;this.usesVerticalDistanceToGround=B.usesVerticalDistanceToGround??!1;this.graphicUid=B.graphicUid;this.layerUid=B.layerUid;B.isElevationSource&&(this.lastValidElevationBB=
new r);this._geometries=B.geometries?Array.from(B.geometries):[]}dispose(){this._geometries.length=0}get parentLayer(){return this._parentLayer}set parentLayer(B){t.assert(null==this._parentLayer||null==B,"Object3D can only be added to a single Layer");this._parentLayer=B}addGeometry(B){B.visible=this._visible;this._geometries.push(B);this._emit("geometryAdded",{object:this,geometry:B});this._invalidateBoundingVolume()}removeGeometry(B){if(B=this._geometries.splice(B,1)[0])this._emit("geometryRemoved",
{object:this,geometry:B}),this._invalidateBoundingVolume()}removeAllGeometries(){for(;0<this._geometries.length;)this.removeGeometry(0)}geometryVertexAttributeUpdated(B,C,D=!1){this._emit("attributesChanged",{object:this,geometry:B,attribute:C,sync:D});w.affectsGeometry(C)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(B){if(this._visible!==B){this._visible=B;for(const C of this._geometries)C.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const B=
new d.Object3DStateID(c.Object3DState.MaskOccludee);for(const C of this._geometries)C.occludees=v.addObject3DStateID(C.occludees,B);this._emit("occlusionChanged",this);return B}removeOcclude(B){for(const C of this._geometries)C.occludees=v.removeObject3DStateID(C.occludees,B);this._emit("occlusionChanged",this)}highlight(){const B=new d.Object3DStateID(c.Object3DState.Highlight);for(const C of this._geometries)C.highlights=v.addObject3DStateID(C.highlights,B);this._emit("highlightChanged",this);return B}removeHighlight(B){for(const C of this._geometries)C.highlights=
v.removeObject3DStateID(C.highlights,B);this._emit("highlightChanged",this)}getCombinedStaticTransformation(B,C){return q.multiply(C,this.transformation,B.transformation)}getCombinedShaderTransformation(B,C=l.create()){return q.multiply(C,this.effectiveTransformation,B.transformation)}get boundingVolumeWorldSpace(){this._bvWorldSpace||(this._bvWorldSpace=this._bvWorldSpace||new n,this._validateBoundingVolume(this._bvWorldSpace,A.WorldSpace));return this._bvWorldSpace}get boundingVolumeObjectSpace(){this._bvObjectSpace||
(this._bvObjectSpace=this._bvObjectSpace||new n,this._validateBoundingVolume(this._bvObjectSpace,A.ObjectSpace));return this._bvObjectSpace}_validateBoundingVolume(B,C){C=C===A.ObjectSpace;for(var D of this._geometries){var F=D.boundingInfo;if(F){var H=B,N=C?D.transformation:this.getCombinedShaderTransformation(D),E=F.bbMin;F=F.bbMax;if(q.hasIdentityRotation(N))for(N=p.set(u,N[12],N[13],N[14]),p.add(x,E,N),p.add(y,F,N),E=0;3>E;++E)H.min[E]=Math.min(H.min[E],x[E]),H.max[E]=Math.max(H.max[E],y[E]);
else if(p.transformMat4(x,E,N),p.exactEquals(E,F))for(E=0;3>E;++E)H.min[E]=Math.min(H.min[E],x[E]),H.max[E]=Math.max(H.max[E],x[E]);else{p.transformMat4(y,F,N);for(var G=0;3>G;++G)H.min[G]=Math.min(H.min[G],x[G],y[G]),H.max[G]=Math.max(H.max[G],x[G],y[G]);for(G=0;3>G;++G){p.copy(x,E);p.copy(y,F);x[G]=F[G];y[G]=E[G];p.transformMat4(x,x,N);p.transformMat4(y,y,N);for(let I=0;3>I;++I)H.min[I]=Math.min(H.min[I],x[I],y[I]),H.max[I]=Math.max(H.max[I],x[I],y[I])}}}}p.lerp(h.getCenter(B.bounds),B.min,B.max,
.5);for(const I of this._geometries)D=I.boundingInfo,null!=D&&(E=C?I.transformation:this.getCombinedShaderTransformation(I),H=f.maxScale(E),p.transformMat4(z,D.center,E),E=p.distance(z,h.getCenter(B.bounds)),B.bounds[3]=Math.max(B.bounds[3],E+D.radius*H))}_invalidateBoundingVolume(){const B=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0;this._parentLayer&&B&&this._parentLayer.notifyObjectBBChanged(this,B)}_emit(B,C){this._parentLayer&&this._parentLayer.events.emit(B,C)}get test(){}}
class r{constructor(){this.min=k.fromValues(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);this.max=k.fromValues(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]<this.min[0]&&this.max[1]<this.min[1]&&this.max[2]<this.min[2]}}class n extends r{constructor(){super(...arguments);this.bounds=h.create()}}const u=k.create(),x=k.create(),y=k.create(),z=k.create();var A;(function(B){B[B.WorldSpace=0]="WorldSpace";B[B.ObjectSpace=1]="ObjectSpace"})(A||={});a.Object3D=
m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/LineCalloutMaterial":function(){define("exports ../../../../core/string ../../../../core/libs/gl-matrix-2/factories/vec2f32 ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../lib/GLMaterial ../lib/Material ../lib/RenderSlot ../lib/VertexAttribute ./internal/bufferWriterUtils ../shaders/LineCalloutTechnique ../shaders/LineCalloutTechniqueConfiguration".split(" "),function(a,
b,q,l,p,k,h,f,c,e,g,d){class t extends h.Material{get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}constructor(u){super(u,new v);this.produces=new Map([[f.RenderSlot.LINE_CALLOUTS,x=>x===p.ShaderOutput.Color],[f.RenderSlot.LINE_CALLOUTS_HUD_DEPTH,x=>x===p.ShaderOutput.Color]]);this._configuration=new d.LineCalloutTechniqueConfiguration;this._uniqueMaterialIdentifier=t.uniqueMaterialIdentifier(this.parameters)}passParameters(){return this.parameters}getConfiguration(u,x){u=x?.slot!==
f.RenderSlot.LINE_CALLOUTS;this._configuration.occlusionTestEnabled=this.parameters.occlusionTest;this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset;this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective;this._configuration.depthHudEnabled=u;this._configuration.depthHudAlignStartEnabled=!!this.parameters.depthHUDAlignStart;this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits;this._configuration.hasSlicePlane=
this.parameters.hasSlicePlane;this._configuration.multipassEnabled=x.multipassEnabled;return this._configuration}intersect(){}createGLMaterial(u){return new w(u)}createBufferWriter(){return new n}validateParameters(u){u=t.uniqueMaterialIdentifier(u);u!==this._uniqueMaterialIdentifier&&(this._uniqueMaterialIdentifier=u)}static uniqueMaterialIdentifier({renderOccluded:u,isDecoration:x,horizontalScreenOffset:y,color:z,size:A,occlusionTest:B,shaderPolygonOffset:C,depthHUDAlignStart:D,centerOffsetUnits:F,
hasSlicePlane:H,screenSizePerspective:N,verticalOffset:E,borderColor:G}){return b.safeToString`${u}:${x}:${y}:[${z}]:${A}:${B}:${C}:${D}:${F}:${H}:${null!=N}:{${E.screenLength}:${E.minWorldLength}:${E.maxWorldLength}}:[${G}]`}}class w extends k{beginSlot(u){return this.ensureTechnique(g.LineCalloutTechnique,u)}}class v extends h.MaterialParameters{constructor(){super(...arguments);this.horizontalScreenOffset=0;this.color=[0,0,0,1];this.size=1;this.occlusionTest=!1;this.shaderPolygonOffset=1E-5;this.depthHUDAlignStart=
!1;this.centerOffsetUnits="world";this.hasSlicePlane=!1}}const m=l.newLayout().vec3f(c.VertexAttribute.POSITION).vec3f(c.VertexAttribute.NORMAL).vec2f(c.VertexAttribute.UV0).vec4f(c.VertexAttribute.CENTEROFFSETANDDISTANCE),r=[q.fromValues(0,0),q.fromValues(1,0),q.fromValues(0,1),q.fromValues(1,0),q.fromValues(1,1),q.fromValues(0,1)];class n{constructor(){this.vertexBufferLayout=m}elementCount(u){return 6*u.attributes.get(c.VertexAttribute.POSITION).indices.length}write(u,x,y,z,A){e.writePosition(y.attributes.get(c.VertexAttribute.POSITION),
u,z.position,A,6);e.writeNormal(y.attributes.get(c.VertexAttribute.NORMAL),x,z.normal,A,6);e.writeBufferVec4(y.attributes.get(c.VertexAttribute.CENTEROFFSETANDDISTANCE),z.centerOffsetAndDistance,A,6);for(u=0;u<r.length;++u)z.uv0.setVec(A+u,r[u])}}a.LineCalloutMaterial=t;a.Parameters=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/factories/vec2f32":function(){define(["exports"],function(a){function b(){return new Float32Array(2)}function q(v){const m=
new Float32Array(2);m[0]=v[0];m[1]=v[1];return m}function l(v,m){const r=new Float32Array(2);r[0]=v;r[1]=m;return r}function p(v,m){return new Float32Array(v,m,2)}function k(){return b()}function h(){return l(1,1)}function f(){return l(1,0)}function c(){return l(0,1)}const e=b(),g=h(),d=f(),t=c(),w=Object.freeze(Object.defineProperty({__proto__:null,ONES:g,UNIT_X:d,UNIT_Y:t,ZEROS:e,clone:q,create:b,createView:p,fromValues:l,ones:h,unitX:f,unitY:c,zeros:k},Symbol.toStringTag,{value:"Module"}));a.ONES=
g;a.UNIT_X=d;a.UNIT_Y=t;a.ZEROS=e;a.clone=q;a.create=b;a.createView=p;a.fromValues=l;a.ones=h;a.unitX=f;a.unitY=c;a.vec2f32=w;a.zeros=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/LineCalloutTechnique":function(){define("require exports ../../../ViewingMode ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../../../../chunks/LineCallout.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e){class g extends p.ShaderTechnique{initializeConfiguration(d,t){t.spherical=d.viewingMode===q.ViewingMode.Global}initializeProgram(d){return new h.Program(d.rctx,g.shader.get().build(this.configuration),k.Default3D)}setPipelineState(d){d=d?c.CompareFunction.ALWAYS:c.CompareFunction.LESS;return this.configuration.depthHudEnabled?e.makePipelineState({depthTest:{func:d},depthWrite:e.defaultDepthWriteParams}):e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.ONE,
c.BlendFactor.SRC_ALPHA,c.BlendFactor.ONE_MINUS_SRC_ALPHA,c.BlendFactor.ONE_MINUS_SRC_ALPHA),depthTest:{func:d},colorWrite:e.defaultColorWriteParams})}initializePipeline(){return this.setPipelineState(this.configuration.multipassEnabled)}}g.shader=new l.ReloadableShaderModule(f.LineCallout,()=>new Promise((d,t)=>a(["./LineCallout.glsl"],d,t)));b.LineCalloutTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/LineCallout.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/vec2 ../core/libs/gl-matrix-2/factories/vec2f64 ../core/libs/gl-matrix-2/factories/vec4f64 ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl ../views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl ../views/3d/webgl-engine/core/shaderLibrary/hud/HUDVisibility.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(x){const y=new v.ShaderBuilder,{vertex:z,fragment:A}=y;z.include(k.AlignPixel);y.include(h.HUD,x);y.include(p.SliceDraw,x);y.attributes.add(m.VertexAttribute.UV0,"vec2");z.uniforms.add(new d.Float4PassUniform("viewport",(B,C)=>C.camera.fullViewport),new t.FloatPassUniform("lineSize",(B,C)=>0<B.size?Math.max(1,B.size)*C.camera.pixelRatio:0),new g.Float2PassUniform("pixelToNDC",(B,C)=>b.set(u,2/C.camera.fullViewport[2],2/C.camera.fullViewport[3])),
new t.FloatPassUniform("borderSize",(B,C)=>null!=B.borderColor?C.camera.pixelRatio:0),new g.Float2PassUniform("screenOffset",(B,C)=>b.set(u,B.horizontalScreenOffset*C.camera.pixelRatio,0)));y.varyings.add("coverageSampling","vec4");y.varyings.add("lineSizes","vec2");x.multipassEnabled&&y.varyings.add("depth","float");x.occlusionTestEnabled&&y.include(f.HUDVisibility);x.hasScreenSizePerspective&&e.addScreenSizePerspectiveAlignment(z);z.code.add(w.glsl`
void main(void) {
ProjectHUDAux projectAux;
vec4 endPoint = projectPositionHUD(projectAux);
vec3 vpos = projectAux.posModel;
if (rejectBySlice(vpos)) {
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
return;
}
${x.occlusionTestEnabled?w.glsl`
if (!testHUDVisibility(endPoint)) {
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
return;
}`:""}
${x.hasScreenSizePerspective?w.glsl`
vec3 perspectiveFactor = screenSizePerspectiveScaleFactor(projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);
vec2 screenOffsetScaled = applyScreenSizePerspectiveScaleFactorVec2(screenOffset, perspectiveFactor);
`:w.glsl`vec2 screenOffsetScaled = screenOffset;`}
// Add view dependent polygon offset to get exact same original starting point. This is mostly used to get the
// correct depth value
vec3 posView = (view * vec4(position, 1.0)).xyz;
${x.multipassEnabled?"depth \x3d posView.z;":""}
applyHUDViewDependentPolygonOffset(centerOffsetAndDistance.w, projectAux.absCosAngle, posView);
vec4 startPoint = proj * vec4(posView, 1.0);
// Apply screen offset to both start and end point
vec2 screenOffsetNorm = screenOffsetScaled * 2.0 / viewport.zw;
startPoint.xy += screenOffsetNorm * startPoint.w;
endPoint.xy += screenOffsetNorm * endPoint.w;
// Align start and end to pixel origin
vec4 startAligned = alignToPixelOrigin(startPoint, viewport.zw);
vec4 endAligned = alignToPixelOrigin(endPoint, viewport.zw);
${x.depthHudEnabled?x.depthHudAlignStartEnabled?w.glsl`endAligned = vec4(endAligned.xy / endAligned.w * startAligned.w, startAligned.zw);`:w.glsl`startAligned = vec4(startAligned.xy / startAligned.w * endAligned.w, endAligned.zw);`:""}
vec4 projectedPosition = mix(startAligned, endAligned, uv0.y);
// The direction of the line in screen space
vec2 screenSpaceDirection = normalize(endAligned.xy / endAligned.w - startAligned.xy / startAligned.w);
vec2 perpendicularScreenSpaceDirection = vec2(screenSpaceDirection.y, -screenSpaceDirection.x);
${x.hasScreenSizePerspective?w.glsl`
float lineSizeScaled = applyScreenSizePerspectiveScaleFactorFloat(lineSize, perspectiveFactor);
float borderSizeScaled = applyScreenSizePerspectiveScaleFactorFloat(borderSize, perspectiveFactor);
`:w.glsl`
float lineSizeScaled = lineSize;
float borderSizeScaled = borderSize;
`}
float halfPixelSize = lineSizeScaled * 0.5;
// Compute full ndc offset, adding 1px padding for doing anti-aliasing and the border size
float padding = 1.0 + borderSizeScaled;
vec2 ndcOffset = (-halfPixelSize - padding + uv0.x * (lineSizeScaled + padding + padding)) * pixelToNDC;
// Offset x/y from the center of the line in screen space
projectedPosition.xy += perpendicularScreenSpaceDirection * ndcOffset * projectedPosition.w;
// Compute a coverage varying which we can use in the fragment shader to determine
// how much a pixel is actually covered by the line (i.e. to anti alias the line).
// This works by computing two coordinates that can be linearly interpolated and then
// subtracted to find out how far away from the line edge we are.
float edgeDirection = (uv0.x * 2.0 - 1.0);
float halfBorderSize = 0.5 * borderSizeScaled;
float halfPixelSizeAndBorder = halfPixelSize + halfBorderSize;
float outerEdgeCoverageSampler = edgeDirection * (halfPixelSizeAndBorder + halfBorderSize + 1.0);
float isOneSided = float(lineSizeScaled < 2.0 && borderSize < 2.0);
coverageSampling = vec4(
// Edge coordinate
outerEdgeCoverageSampler,
// Border edge coordinate
outerEdgeCoverageSampler - halfPixelSizeAndBorder * isOneSided,
// Line offset
halfPixelSize - 0.5,
// Border offset
halfBorderSize - 0.5 + halfPixelSizeAndBorder * (1.0 - isOneSided)
);
lineSizes = vec2(lineSizeScaled, borderSizeScaled);
gl_Position = projectedPosition;
}
`);A.uniforms.add(new d.Float4PassUniform("uColor",B=>n(B.color)),new d.Float4PassUniform("borderColor",B=>n(B.borderColor)));x.multipassEnabled&&(A.include(c.multipassGeometryTest,x),A.uniforms.add(new g.Float2PassUniform("inverseViewport",(B,C)=>C.inverseViewport)));A.code.add(w.glsl`
void main() {
${x.multipassEnabled?"if( geometryDepthTest(gl_FragCoord.xy * inverseViewport, depth) ){ discard; }":""}
// Mix between line and border coverage offsets depending on whether we need
// a border (based on the sidedness).
vec2 coverage = min(1.0 - clamp(abs(coverageSampling.xy) - coverageSampling.zw, 0.0, 1.0), lineSizes);
// Mix between border and line color based on the line coverage (conceptually the line blends on top of the
// border background).
//
// Anti-alias by blending final result using the full (including optional border) coverage and the color alpha
float borderAlpha = uColor.a * borderColor.a * coverage.y;
float colorAlpha = uColor.a * coverage.x;
float finalAlpha = mix(borderAlpha, 1.0, colorAlpha);
${x.depthHudEnabled?w.glsl`
if (finalAlpha < 0.01) {
discard;
}
`:w.glsl`
vec3 finalRgb = mix(borderColor.rgb * borderAlpha, uColor.rgb, colorAlpha);
fragColor = vec4(finalRgb, finalAlpha);
`}
}
`);return y}function n(x){return null!=x?x:l.ZEROS}const u=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:r},Symbol.toStringTag,{value:"Module"}));a.LineCallout=q;a.build=r})},"esri/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderTechnique/ShaderTechniqueConfiguration","../materials/DefaultTechniqueConfiguration"],function(a,b,q,l){class p extends l.DefaultTechniqueConfiguration{constructor(){super(...arguments);
this.spherical=this.screenCenterOffsetUnitsEnabled=!1;this.occlusionTestEnabled=!0;this.multipassEnabled=this.hasSlicePlane=this.depthHudAlignStartEnabled=this.depthHudEnabled=this.hasScreenSizePerspective=this.hasVerticalOffset=!1}}b.__decorate([q.parameter()],p.prototype,"screenCenterOffsetUnitsEnabled",void 0);b.__decorate([q.parameter()],p.prototype,"spherical",void 0);b.__decorate([q.parameter()],p.prototype,"occlusionTestEnabled",void 0);b.__decorate([q.parameter()],p.prototype,"hasVerticalOffset",
void 0);b.__decorate([q.parameter()],p.prototype,"hasScreenSizePerspective",void 0);b.__decorate([q.parameter()],p.prototype,"depthHudEnabled",void 0);b.__decorate([q.parameter()],p.prototype,"depthHudAlignStartEnabled",void 0);b.__decorate([q.parameter()],p.prototype,"hasSlicePlane",void 0);b.__decorate([q.parameter()],p.prototype,"multipassEnabled",void 0);b.__decorate([q.parameter({constValue:!0})],p.prototype,"hasSliceInVertexProgram",void 0);b.__decorate([q.parameter({constValue:!1})],p.prototype,
"draped",void 0);a.LineCalloutTechniqueConfiguration=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/graphicSymbolUtils":function(){define(["exports","./Graphics3DSymbol","./Graphics3DWebStyleSymbol"],function(a,b,q){a.getGraphics3DSymbol=function(l){return l instanceof q.Graphics3DWebStyleSymbol?l.graphics3DSymbol:l instanceof b.Graphics3DSymbol?l:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DSymbol":function(){define("exports ../../../../core/arrayUtils ../../../../core/asyncUtils ../../../../core/has ../../../../core/promiseUtils ./defaultSymbolComplexity ./Graphics3DGraphic ./Graphics3DObject3DGraphicLayer ./Graphics3DSymbolCreationContext ./Graphics3DSymbolLayerFactory ./interfaces ./Loadable".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){class t extends d.Loadable{set symbol(v){this._symbol=v;v.symbolLayers.forEach((m,r)=>{r=this.symbolLayers[r];null!=r&&(r.symbol=v,r.symbolLayer=m)})}get symbol(){return this._symbol}constructor(v,m,r){super(m.schedule);this._symbol=v;this._context=m;this._backgroundLayers=r;this._destroyed=!1;this.symbolLayers=[];this._extentPadding=this.referenced=0}async doLoad(v){let m=this._symbol.symbolLayers;this._extentPadding=0;this._backgroundLayers&&(m=this._backgroundLayers.concat(m));
const r=m.length;for(;this.symbolLayers.length<m.length;)this.symbolLayers.push(null);this.symbolLayers.length=m.length;const n=[];for(let x=0;x<r;x++){var u=m.at(x);if(!1===u.enabled)continue;w.renderPriority=1-(1+x)/r;w.renderPriorityStep=1/r;w.ignoreDrivers=u.ignoreDrivers;const y=e.make(this.symbol,u,this._context,w);(u=p.onAbortOrThrow(v,()=>{this.symbolLayers[x]=null;y.destroy()}))&&n.push(u);this.symbolLayers[x]=y}await q.forEach(this.symbolLayers,async(x,y)=>{if(null!=x)try{await x.load(),
this._extentPadding+=Math.max(this._extentPadding,x.extentPadding)}catch{this.symbolLayers[y]=null}});n.forEach(x=>x.remove());p.throwIfAborted(v);if(this.symbolLayers.length&&!this.symbolLayers.some(x=>!!x))throw Error();}getSymbolLayerSize(v){v=this.symbolLayers[v];return null!=v?v.getCachedSize():null}get extentPadding(){return this._extentPadding}get symbologySnappingSupported(){return this.symbolLayers.some(v=>v?.queryForSnapping)}createGraphics3DGraphic(v,m){const r=v.graphic,n=this.symbolLayers.map(u=>
u?.createGraphics3DGraphic(v)??null);return new h.Graphics3DGraphic(r,m||this,n,v.layer,this._context.arcade||this._context.featureExpressionInfoContext?.arcade?.modules||null)}get complexity(){return k.totalSymbolComplexities(this.symbolLayers.map(v=>null!=v?v.complexity:null))}globalPropertyChanged(v,m){const r=this.symbolLayers.length;for(let n=0;n<r;n++){const u=this.symbolLayers[n],x=y=>{y=y.layers[n];return y instanceof f.Graphics3DObject3DGraphicLayer?y:null};if(null!=u&&!u.globalPropertyChanged(v,
m,x))return!1}return!0}applyRendererDiff(v,m){return this.loadStatus!==d.LoadStatus.LOADED?g.ApplyRendererDiffResult.RecreateSymbol:this.symbolLayers.reduce((r,n)=>r!==g.ApplyRendererDiffResult.RecreateSymbol&&null!=n?Math.min(r,n.applyRendererDiff(v,m)):r,g.ApplyRendererDiffResult.FastUpdate)}prepareSymbolPatch(v){if(this.loadStatus!==d.LoadStatus.FAILED&&"partial"===v.diff.type){var m=v.diff.diff;if(m.symbolLayers&&"partial"===m.symbolLayers.type){var r=m.symbolLayers.diff;this.symbolLayers.forEach((n,
u)=>{if(null!=n){var x=r[u];if(x){const y={diff:x,graphics3DGraphicPatches:[],symbolLayerStatePatches:[]};n.prepareSymbolLayerPatch(y);v.symbolStatePatches.push(...y.symbolLayerStatePatches);y.graphics3DGraphicPatches.length&&v.graphics3DGraphicPatches.push((z,A)=>{const B=z.layers[u];null!=B&&y.graphics3DGraphicPatches.forEach(C=>C(B,A))})}}})}}}updateGeometry(v,m){return this._updateGeometryOrTransform(v,(r,n)=>r.updateGeometry(n,m))}updateTransform(v,m,r,n){return this._updateGeometryOrTransform(v,
(u,x)=>u.updateTransform(x,m,r,n))}_updateGeometryOrTransform(v,m){for(let r=0;r<this.symbolLayers.length;r++){const n=this.symbolLayers[r];if(null==n)continue;const u=v.layers[r];if(!u||!m(n,u))return!1}return!0}onRemoveGraphic(v){for(let m=0;m<this.symbolLayers.length;m++){const r=this.symbolLayers[m];if(null==r)continue;const n=v.layers[m];if(null!=n)r.onRemoveGraphic(n)}}getFastUpdateStatus(){let v=0,m=0,r=0;this.symbolLayers.forEach(n=>{null!=n&&(n.loadStatus===d.LoadStatus.LOADING?v++:n.isFastUpdatesEnabled()?
r++:m++)});return{loading:v,slow:m,fast:r}}async queryForSnapping(v,m,r,n){var u=this.symbolLayers.filter(b.isSome).filter(x=>null!=x.queryForSnapping).map(x=>x.queryForSnapping(v,m,r,n));u=await Promise.all(u);p.throwIfAborted(n);return u.flat()}destroy(){if(!this.destroyed){super.destroy();for(const v of this.symbolLayers)null!=v&&v.destroy();this.symbolLayers.length=0;this._destroyed=!0}}get destroyed(){return this._destroyed}}const w=new c.Graphics3DSymbolLayerCreationContext;a.Graphics3DSymbol=
t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DGraphic":function(){define("exports ../../../../core/arrayUtils ../../../../core/asyncUtils ../../../../core/byteSizeEstimations ../../../../core/has ../../../../core/ObjectPool ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/Polygon ../../../../geometry/projection/projectBoundingRect ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/spatialReferenceUtils ../../../../layers/graphics/dehydratedFeatures ../../../../layers/graphics/featureConversionUtils ./enums ./featureExpressionInfoUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){const x=new k(Array,A=>t.set(A,t.zero),null,10,5),y=w.create();class z{get labelLayers(){return this._labelLayers||b.emptyArray}get extent(){return this._extent}get isElevationSource(){return this.layers.some(A=>A?.isElevationSource)}constructor(A,B,C,D,F){this.graphic=A;this.graphics3DSymbol=B;this.layers=C;this._visibleFlags=n.VisibilityFlag.ALL_LABEL;this.deconflictionPriority=0;++B.referenced;this._featureExpressionFeature=F?u.createFeature(F,A,
D):null}initialize(A){this._layer=A;this._forEachSymbolLayerGraphic(B=>{B.initialize(A);B.setVisibility(this.isVisible())})}destroy(){this._forEachSymbolLayerGraphic(A=>A.destroy());this._calloutLayer=null;--this.graphics3DSymbol.referenced;this.graphics3DSymbol=null}get destroyed(){return null==this.layers}clearLabelGraphics(){this._forEachLabelGraphic(A=>A.destroy());this._labelLayers=null}addLabelGraphic(A,B){this._labelLayers||(this._labelLayers=[]);this._labelLayers.push(A);A.initialize(B);A.setVisibility(this.isVisible(n.VisibilityGroup.LABEL))}setCalloutGraphic(A){this._calloutLayer=
A;this._layer&&(A.initialize(this._layer),A.setVisibility(this.isVisible()))}get calloutLayer(){return this._calloutLayer}get isDraped(){let A=!1;this._forEachSymbolLayerGraphic(B=>{"draped"===B.type&&(A=!0)});return A}isVisible(A=n.VisibilityGroup.GRAPHIC,B){B=B?this._visibleFlags|B|n.VisibilityGroup.LABEL*B:this._visibleFlags;return A===n.VisibilityGroup.GRAPHIC?(B&n.VisibilityFlag.ALL_GRAPHIC)===n.VisibilityFlag.ALL_GRAPHIC:(B&n.VisibilityFlag.ALL_LABEL)===n.VisibilityFlag.ALL_LABEL}setVisibilityFlag(A,
B,C){const D=this.isVisible(A);this._visibleFlags=C?this._visibleFlags|A*B:this._visibleFlags&~(A*B);const F=this.isVisible(A);if(D===F)return!1;if(A===n.VisibilityGroup.LABEL)this._forEachLabelGraphic(H=>H.setVisibility(F));else{this._forEachSymbolLayerGraphic(N=>N.setVisibility(F));const H=this.isVisible(n.VisibilityGroup.LABEL);this._forEachLabelGraphic(N=>N.setVisibility(H))}return!0}getVisibilityFlag(A,B){return 0!==(this._visibleFlags&A*B)}computeExtent(A){if(!this._extent){var B=this.graphic.geometry;
if(null==B)return!1;this._extent=w.create();m.computeAABR(B,this._extent);B=B.spatialReference;if(!v.equals(B,A)&&!d.projectBoundingRect(this._extent,B,this._extent,A))return this._extent=null,!1}return!0}getAsOptimizedGeometry(A,B){this._optimizedGeometry||(this._optimizedGeometry=this._convertGraphicToOptimizedGeometry(this.graphic,A,B));return this._optimizedGeometry}_convertGraphicToOptimizedGeometry(A,B,C){A=A.geometry;if("mesh"===A.type||"extent"===A.type)A=g.fromExtent("mesh"===A.type?A.extent:
A);return r.convertFromGeometry(A,B,C)}get usedMemory(){let A=l.estimateAttributesObjectSize(this.graphic.attributes);this._forEachSymbolLayerGraphic(B=>A+=B.graphics3DSymbolLayer.usedMemory);return A}computeAttachmentOrigin(){const A={render:{origin:e.create(),num:0},draped:{origin:f.create(),num:0}};for(const B of this.layers)null!=B&&B.computeAttachmentOrigin(A);1<A.render.num&&c.scale(A.render.origin,A.render.origin,1/A.render.num);1<A.draped.num&&h.scale(A.draped.origin,A.draped.origin,1/A.draped.num);
return A}async getProjectedBoundingBox(A,B,C,D,F){F||={boundingBox:null,requiresDrapedElevation:!1,screenSpaceObjects:[]};F.boundingBox?t.empty(F.boundingBox):F.boundingBox=t.empty();F.requiresDrapedElevation=!1;await q.forEach(this.layers,async H=>{if(null!=H){var N="draped"===H.type?B:A,E=x.acquire();H=await H.getProjectedBoundingBox(N,C,F.screenSpaceObjects,D,E);isFinite(H[2])&&isFinite(H[5])||(F.requiresDrapedElevation=!0);H&&t.expandWithAABB(F.boundingBox,E);x.release(E)}});return t.allFinite(F.boundingBox)||
w.allFinite(t.toRect(F.boundingBox,y))?F:null}needsElevationUpdates(){for(const A of this.layers)if(null!=A&&("object3d"===A.type||"lod-instance"===A.type)&&A.needsElevationUpdates)return!0;return this._labelLayers?.some(A=>A?.needsElevationUpdates??!1)??!1}alignWithElevation(A,B,C){this._forEachRenderedGraphic(D=>{"object3d"!==D.type&&"lod-instance"!==D.type||D.alignWithElevation(A,B,this._featureExpressionFeature,C)})}alignWithAbsoluteElevation(A,B,C){this._forEachRenderedGraphic(D=>{"object3d"===
D.type&&D.alignWithAbsoluteElevation(A,B,C)})}addObjectStateSet(A,B){this._forEachSymbolLayerGraphic(C=>C.addObjectState(A,B))}removeObjectState(A){this._forEachSymbolLayerGraphic(B=>B.removeObjectState(A))}_forEachGraphicList(A,B){A?.forEach(C=>C&&B(C))}_forEachSymbolLayerGraphic(A){this._forEachGraphicList(this.layers,A);this._calloutLayer&&A(this._calloutLayer)}_forEachLabelGraphic(A){this._forEachGraphicList(this._labelLayers,A)}_forEachRenderedGraphic(A){this._forEachSymbolLayerGraphic(A);this._forEachLabelGraphic(A)}get test(){}}
a.Graphics3DGraphic=z;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/dehydratedFeatures":function(){define("exports ../../core/byteSizeEstimations ../../core/has ../../core/typedArrayUtil ../../core/uid ../../geometry/SpatialReference ../../geometry/support/aaBoundingBox ../../geometry/support/aaBoundingRect ../../geometry/support/quantizationUtils ../../geometry/support/typeUtils ../support/Field ./dehydratedFeatureComparison".split(" "),function(a,b,q,l,p,
k,h,f,c,e,g,d){function t(x,y,z,A){return{uid:p.generateUID(),objectId:A&&x.attributes?x.attributes[A]:null,attributes:x.attributes,geometry:w(x.geometry,y,z),visible:!0}}function w(x,y,z){if(null==x)return null;switch(y){case "point":return{x:x.x,y:x.y,z:x.z,m:x.m,hasZ:null!=x.z,hasM:null!=x.m,type:"point",spatialReference:z};case "polyline":return{paths:x.paths,hasZ:!!x.hasZ,hasM:!!x.hasM,type:"polyline",spatialReference:z};case "polygon":return{rings:x.rings,hasZ:!!x.hasZ,hasM:!!x.hasM,type:"polygon",
spatialReference:z};case "multipoint":return{points:x.points,hasZ:!!x.hasZ,hasM:!!x.hasM,type:"multipoint",spatialReference:z}}}function v(x){if(null==x)return 0;let y=32;switch(x.type){case "point":y+=42;break;case "polyline":case "polygon":var z=0;const A=2+(x.hasZ?1:0)+(x.hasM?1:0);x="polyline"===x.type?x.paths:x.rings;for(const B of x)z+=B.length;y+=8*z*A+64;y+=128*z;y=y+34+32*(x.length+1);break;case "multipoint":z=x.points.length;y+=8*z*(2+(x.hasZ?1:0)+(x.hasM?1:0))+64;y+=128*z;y=y+34+32;break;
case "extent":y+=98;x.hasM&&(y+=32);x.hasZ&&(y+=32);break;case "mesh":y+=l.estimateSize(x.vertexAttributes.position,x.vertexAttributes.normal,x.vertexAttributes.uv,x.vertexAttributes.tangent)}return y}function m(x,y){return null!=x.objectId?x.objectId:x.attributes&&y?x.attributes[y]:null}function r(x,y,z,A){if(y?.size&&null!=z&&x)for(const B in x){if(!y.has(B))continue;const C=x[B];"string"===typeof C&&C.length>z&&(A(B),x[B]="")}}class n{constructor(x,y,z){this.uid=x;this.geometry=y;this.attributes=
z;this.visible=!0;this.centroid=this.objectId=null}}class u{constructor(){this.exceededTransferLimit=!1;this.features=[];this.fields=[];this.hasZ=this.hasM=!1;this.transform=this.spatialReference=this.geohashFieldName=this.geometryProperties=this.globalIdFieldName=this.objectIdFieldName=this.geometryType=null}}a.equals=d.equals;a.DehydratedFeatureClass=n;a.DehydratedFeatureSetClass=u;a.computeAABB=function(x,y){h.empty(y);"mesh"===x.type&&(x=x.extent);switch(x.type){case "point":y[0]=y[3]=x.x;y[1]=
y[4]=x.y;x.hasZ&&(y[2]=y[5]=x.z);break;case "polyline":for(var z=0;z<x.paths.length;z++)h.expandWithNestedArray(y,x.paths[z],!!x.hasZ);break;case "polygon":for(z=0;z<x.rings.length;z++)h.expandWithNestedArray(y,x.rings[z],!!x.hasZ);break;case "multipoint":h.expandWithNestedArray(y,x.points,!!x.hasZ);break;case "extent":y[0]=x.xmin,y[1]=x.ymin,y[3]=x.xmax,y[4]=x.ymax,null!=x.zmin&&(y[2]=x.zmin),null!=x.zmax&&(y[5]=x.zmax)}};a.computeAABR=function(x,y){f.empty(y);"mesh"===x.type&&(x=x.extent);switch(x.type){case "point":y[0]=
y[2]=x.x;y[1]=y[3]=x.y;break;case "polyline":for(var z=0;z<x.paths.length;z++)f.expandWithNestedArray(y,x.paths[z]);break;case "polygon":for(z=0;z<x.rings.length;z++)f.expandWithNestedArray(y,x.rings[z]);break;case "multipoint":f.expandWithNestedArray(y,x.points);break;case "extent":y[0]=x.xmin,y[1]=x.ymin,y[2]=x.xmax,y[3]=x.ymax}};a.estimateGeometryObjectSize=v;a.estimateSize=function(x){let y;y=32+b.estimateAttributesObjectSize(x.attributes);return y=y+3+(8+v(x.geometry))};a.fromFeatureSetJSON=
function(x,y){const z=e.featureGeometryTypeKebabDictionary.fromJSON(x.geometryType),A=k.fromJSON(x.spatialReference),B=x.transform,C=x.objectIdFieldName,D=y?.maxStringAttributeLength,F=y?.maxStringAttributeFields;let H;y=x.features.map(N=>{const E=t(N,z,A,x.objectIdFieldName);N=E.geometry;r(E.attributes,F,D,G=>{H??=[];const I=m(E,C);null!=I&&H.push({objectId:I,attribute:G})});if(null!=N&&B)switch(N.type){case "point":E.geometry=c.unquantizePoint(B,N,N);break;case "multipoint":E.geometry=c.unquantizeMultipoint(B,
N,N);break;case "polygon":E.geometry=c.unquantizePolygon(B,N,N);break;case "polyline":E.geometry=c.unquantizePolyline(B,N,N);break;case "extent":E.geometry=N;break;case "mesh":E.geometry=N}return E});return{geometryType:z,features:y,spatialReference:A,fields:x.fields?.map(N=>g.fromJSON(N))??[],objectIdFieldName:x.objectIdFieldName,globalIdFieldName:x.globalIdFieldName,geohashFieldName:x.geohashFieldName,geometryProperties:x.geometryProperties,hasZ:x.hasZ,hasM:x.hasM,exceededTransferLimit:x.exceededTransferLimit,
transform:null,missingAttributes:H}};a.fromJSONGeometry=w;a.getObjectId=m;a.hasGeometry=function(x){return null!=x.geometry};a.hasVertices=function(x){if(null==x)return!1;switch(x.type){case "extent":case "point":return!0;case "polyline":for(const y of x.paths)if(0<y.length)return!0;return!1;case "polygon":for(const y of x.rings)if(0<y.length)return!0;return!1;case "multipoint":return 0<x.points.length;case "mesh":return!x.loaded||0<x.vertexAttributes.position.length}};a.numVertices=function(x){if(null==
x)return 0;switch(x.type){case "point":return 1;case "polyline":var y=0;for(var z of x.paths)y+=z.length;return y;case "polygon":z=0;for(y of x.rings)z+=y.length;return z;case "multipoint":return x.points.length;case "extent":return 2;case "mesh":return(x=x.vertexAttributes&&x.vertexAttributes.position)?x.length/3:0}};a.removeLargeStringAttributes=r;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/dehydratedFeatureComparison":function(){define(["exports","../../core/has",
"../../core/mathUtils","../../geometry/support/spatialReferenceUtils"],function(a,b,q,l){function p(e,g){if(e===g)return!0;if(null==e||null==g||e.length!==g.length)return!1;for(let d=0;d<e.length;d++){const t=e[d],w=g[d];if(t.length!==w.length)return!1;for(let v=0;v<t.length;v++)if(t[v]!==w[v])return!1}return!0}function k(e,g){if(e===g)return!0;if(null==e||null==g||e.length!==g.length)return!1;for(let d=0;d<e.length;d++)if(!p(e[d],g[d]))return!1;return!0}function h(e,g){return e===g||null!=e&&null!=
g&&l.equals(e.spatialReference,g.spatialReference)&&e.x===g.x&&e.y===g.y&&e.z===g.z&&e.m===g.m}function f(e,g){if(e===g)return!0;if(null==e||null==g||e.type!==g.type)return!1;switch(e.type){case "point":return h(e,g);case "extent":return e=e.hasZ!==g.hasZ||e.hasM!==g.hasM?!1:l.equals(e.spatialReference,g.spatialReference)?e.xmin===g.xmin&&e.ymin===g.ymin&&e.zmin===g.zmin&&e.xmax===g.xmax&&e.ymax===g.ymax&&e.zmax===g.zmax:!1,e;case "polyline":return e=e.hasZ!==g.hasZ||e.hasM!==g.hasM?!1:l.equals(e.spatialReference,
g.spatialReference)?k(e.paths,g.paths):!1,e;case "polygon":return e=e.hasZ!==g.hasZ||e.hasM!==g.hasM?!1:l.equals(e.spatialReference,g.spatialReference)?k(e.rings,g.rings):!1,e;case "multipoint":return e=e.hasZ!==g.hasZ||e.hasM!==g.hasM?!1:l.equals(e.spatialReference,g.spatialReference)?p(e.points,g.points):!1,e;case "mesh":return!1}}function c(e,g){if(e===g)return!0;if(!e||!g)return!1;const d=Object.keys(e),t=Object.keys(g);if(d.length!==t.length)return!1;for(const w of d)if(e[w]!==g[w])return!1;
return!0}a.equals=function(e,g){return e===g?!0:null!=e&&null!=g&&e.objectId===g.objectId&&f(e.geometry,g.geometry)&&c(e.attributes,g.attributes)?!0:!1};a.pointEquals=h;a.pointNear=function(e,g,d){return e===g||null!=e&&null!=g&&l.equals(e.spatialReference,g.spatialReference)&&q.floatEqualAbsolute(e.x,g.x,d)&&q.floatEqualAbsolute(e.y,g.y,d)&&q.floatEqualAbsolute(e.z??0,g.z??0,d)&&q.floatEqualAbsolute(e.m??0,g.m??0,d)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DSymbolCreationContext":function(){define(["exports"],
function(a){class b{constructor(l,p){this.scheduler=l;this.schedule=p;this.featureExpressionInfoContext=this.localOriginFactory=this.graphicsCoreOwner=this.drapeSourceRenderer=this.layer=this.overlaySR=this.renderCoordsHelper=this.clippingExtent=this.stage=this.renderer=this.elevationProvider=this.streamDataRequester=this.sharedResources=null;this.screenSizePerspectiveEnabled=!0;this.isAsync=this.skipHighSymbolLods=this.physicalBasedRenderingEnabled=this.slicePlaneEnabled=!1}}class q{constructor(){this.renderPriority=
0;this.renderPriorityStep=1;this.ignoreDrivers=!1}}a.Graphics3DSymbolCreationContext=b;a.Graphics3DSymbolLayerCreationContext=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DSymbolLayerFactory":function(){define("exports ../../../../core/Logger ./Graphics3DExtrudeSymbolLayer ./Graphics3DIconSymbolLayer ./Graphics3DLineSymbolLayer ./Graphics3DMeshFillSymbolLayer ./Graphics3DObjectSymbolLayer ./Graphics3DPathSymbolLayer ./Graphics3DPolygonFillSymbolLayer ./Graphics3DTextSymbolLayer ./Graphics3DWaterSymbolLayer".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){const d={icon:l.Graphics3DIconSymbolLayer,object:h.Graphics3DObjectSymbolLayer,line:p.Graphics3DLineSymbolLayer,path:f.Graphics3DPathSymbolLayer,fill:c.Graphics3DPolygonFillSymbolLayer,extrude:q.Graphics3DExtrudeSymbolLayer,text:e.Graphics3DTextSymbolLayer,water:g.Graphics3DWaterSymbolLayer},t={"mesh-3d":{fill:k.Graphics3DMeshFillSymbolLayer}};a.make=function(w,v,m,r){const n=t[w.type]?.[v.type]||d[v.type];return n?new n(w,v,m,r):(b.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayerFactory").error("GraphicsLayerFactory#make",
`unknown symbol type ${v.type}`),null)};a.setSymbolClass=function(w,v){d[w]=v};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer":function(){define("exports ../../../../core/has ../../../../core/Error ../../../../core/lang ../../../../core/unitUtils ../../../../chunks/earcut ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/computeTranslationToOriginAndRotation ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/DoubleArray ../../../../geometry/support/Indices ../../../../chunks/vec3 ../../../../layers/graphics/data/SnappingCandidate ../../../../renderers/support/renderingInfoUtils ../../../ViewingMode ./elevationAlignmentUtils ./Graphics3DObject3DGraphicLayer ./Graphics3DSymbolLayer ./graphicUtils ./interfaces ./polygonUtils ../support/edgeUtils ../../support/debugFlags ../../support/ElevationProvider ../../support/renderInfoUtils/polygon ../../webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl ../../webgl-engine/lib/Attribute ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/ContentObjectType ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryWithMapPositions ../../webgl-engine/lib/Normals ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/DefaultMaterial".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q){function W(Ga,Pa,Qa,Ea,ua,Na){const Ua=m.getZeroIndexArray(Pa.length);Pa=[[R.VertexAttribute.POSITION,new I.Attribute(Ea.positions,Pa,3,!0)],[R.VertexAttribute.NORMALCOMPRESSED,new I.Attribute(Ea.normals,Pa,2,!0)],[R.VertexAttribute.COLOR,new I.Attribute(ua,Ua,4,!0)]];return new P.Geometry(Ga,Pa,Ea.elevation,L.ContentObjectType.Mesh,Na,Qa)}function S(Ga,Pa,Qa,Ea,ua,Na,Ua,wa,sa,Ha,Ka,Aa,Sa){var Ya=Ea.index,qa=
Ea.count,aa=Qa.length/3,Ja=2*Ea.count;g.copy(X,Aa);Aa=0<Ka?1:-1;Ya*=3;let Ta=0,Ra=3*Ta,$a=qa,bb=3*$a;for(let pa=0;pa<qa;++pa){const Ba=Ga[Ya],Ia=Ga[Ya+1],Wa=Ga[Ya+2];Sa&&(X[0]=Ba,X[1]=Ia,X[2]=Wa,g.normalize(X,X));ua[Ra+0]=Ba;ua[Ra+1]=Ia;ua[Ra+2]=Wa;const gb=Pa[Ya+0],ib=Pa[Ya+1],La=Pa[Ya+2];Na[Ra+0]=gb;Na[Ra+1]=ib;Na[Ra+2]=La;Ua[Ra+0]=-Aa*X[0];Ua[Ra+1]=-Aa*X[1];Ua[Ra+2]=-Aa*X[2];wa[Ta]=0;ua[bb+0]=Ba+Ka*X[0];ua[bb+1]=Ia+Ka*X[1];ua[bb+2]=Wa+Ka*X[2];Na[bb+0]=gb;Na[bb+1]=ib;Na[bb+2]=La;wa[$a]=Ka;Ra+=3;
bb+=3;Ya+=3;Ta+=1;$a+=1}Pa=Ga=0;Ja*=3;Sa=0>Ka?na:la;Aa=0>Ka?la:na;for(Ya=0;Ya<aa;++Ya)Ha[Pa]=Qa[Ga+Sa[0]],Ha[Pa+1]=Qa[Ga+Sa[1]],Ha[Pa+2]=Qa[Ga+Sa[2]],sa[Ja]=Qa[Ga+Aa[0]]+qa,sa[Ja+1]=Qa[Ga+Aa[1]]+qa,sa[Ja+2]=Qa[Ga+Aa[2]]+qa,Pa+=3,Ja+=3,Ga+=3;Qa=0;Ha=2*Ea.count;qa=0;aa=Ea.pathLengths[0];T(ua,Na,wa,Ua,Qa,aa,Ea.count,Ha,sa,qa,Ka);Ha+=4*aa;qa+=2*aa;Qa+=aa;for(aa=1;aa<Ea.pathLengths.length;++aa)Ja=Ea.pathLengths[aa],T(ua,Na,wa,Ua,Qa,Ja,Ea.count,Ha,sa,qa,Ka),Ha+=4*Ja,qa+=2*Ja,Qa+=Ja}function V(Ga,Pa,Qa,
Ea,ua,Na,Ua){Ea[Na]=Ea[Ua];Ua*=3;Na*=3;Ga[Na]=Ga[Ua];Ga[Na+1]=Ga[Ua+1];Ga[Na+2]=Ga[Ua+2];Pa[Na]=Pa[Ua];Pa[Na+1]=Pa[Ua+1];Pa[Na+2]=Pa[Ua+2];Qa[Na]=ua[0];Qa[Na+1]=ua[1];Qa[Na+2]=ua[2]}function T(Ga,Pa,Qa,Ea,ua,Na,Ua,wa,sa,Ha,Ka){let Aa=ua,Sa=ua+1,Ya=ua+Ua,qa=ua+Ua+1,aa=wa,Ja=wa+1,Ta=wa+2*Na;wa=wa+2*Na+1;0>Ka&&(Aa=ua+Ua+1,qa=ua);Ha*=3;for(let Ia=0;Ia<Na;++Ia){Ia===Na-1&&(Sa=ua,0<Ka?qa=ua+Ua:Aa=ua+Ua);var Ra=Ga,$a=Aa,bb=Sa,pa=Ya,Ba=U;$a*=3;bb*=3;pa*=3;g.set(Z,Ra[$a++],Ra[$a++],Ra[$a++]);g.set(ca,Ra[bb++],
Ra[bb++],Ra[bb++]);g.set(ea,Ra[pa++],Ra[pa++],Ra[pa++]);g.subtract(da,ca,Z);g.subtract(ia,ea,Z);g.cross(Ba,ia,da);g.normalize(Ba,Ba);V(Ga,Pa,Ea,Qa,U,aa,Aa);V(Ga,Pa,Ea,Qa,U,Ja,Sa);V(Ga,Pa,Ea,Qa,U,Ta,Ya);V(Ga,Pa,Ea,Qa,U,wa,qa);sa[Ha]=aa;sa[Ha+1]=Ta;sa[Ha+2]=wa;sa[Ha+3]=aa;sa[Ha+4]=wa;sa[Ha+5]=Ja;Ha+=6;Aa++;Sa++;Ya++;qa++;aa+=2;Ja+=2;Ta+=2;wa+=2}}function Y(Ga,Pa,Qa){var Ea=Ga.getMutableAttribute(R.VertexAttribute.POSITION);const ua=Ga.getMutableAttribute(R.VertexAttribute.NORMALCOMPRESSED).data,{topVertexStart:Na,
topVertexCount:Ua,topFaceStart:wa,topFaceCount:sa}=Pa;Ea=Ea.data;var Ha=Ga.attributes.get(R.VertexAttribute.POSITION).indices,Ka=wa+sa;Ga=Na+Ua;Pa=v.newDoubleArray(3*Ua);for(var Aa=0;Aa<Ua;++Aa){var Sa=3*Aa;Pa[Sa+0]=0;Pa[Sa+1]=0;Pa[Sa+2]=0}Aa=va;Sa=za;const Ya=ya,qa=Da,aa=X;for(let $a=wa;$a<Ka;++$a){var Ja=3*$a;for(var Ta=0;3>Ta;++Ta){var Ra=Ha[Ja+Ta];qa[Ta]=Ra;Ra*=3;g.set(fa,Ea[Ra+0],Ea[Ra+1],Ea[Ra+2]);g.transformMat4(Aa[Ta],fa,Qa)}g.sub(Sa,Aa[1],Aa[0]);g.sub(Ya,Aa[2],Aa[0]);g.cross(aa,Sa,Ya);g.normalize(aa,
aa);for(Ja=0;3>Ja;++Ja)Ta=3*(qa[Ja]-Na),Pa[Ta+0]+=aa[0],Pa[Ta+1]+=aa[1],Pa[Ta+2]+=aa[2]}for(Qa=Na;Qa<Ga;++Qa)Ka=3*(Qa-Na),Ea=Pa[Ka+0],Ha=Pa[Ka+1],Ka=Pa[Ka+2],Aa=Math.sqrt(Ea*Ea+Ha*Ha+Ka*Ka),K.compressNormal(ua,Qa,Ea/Aa,Ha/Aa,Ka/Aa)}const ha=["polygon","extent"];class ba extends A.Graphics3DSymbolLayer{constructor(Ga,Pa,Qa,Ea){super(Ga,Pa,Qa,Ea);this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){var Ga=B.validateSymbolLayerSize(this._getSymbolSize());if(Ga)throw new q("graphics3dextrudesymbollayer:invalid-size",
Ga);}var Pa=this._getCombinedOpacityAndColor(this.symbolLayer?.material?.color);Ga=d.fromArray(Pa);Pa=Pa[3];const Qa=1>Pa||this.needsDrivenTransparentPass;Ga={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,diffuse:Ga,ambient:Ga,opacity:Pa,transparent:Qa,cullFace:Qa?O.CullFaceOptions.None:O.CullFaceOptions.Back,hasVertexColors:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0,normalType:G.NormalType.Compressed};
this._materials[ra.Main]=new Q.DefaultMaterial(Ga);this._materials[ra.Bottom]=new Q.DefaultMaterial({...Ga,cullFace:O.CullFaceOptions.Back});this._context.stage.addMany(this._materials)}destroy(){super.destroy();this._context.stage.removeMany(this._materials);this._materials.length=0}createGraphics3DGraphic(Ga){const Pa=Ga.graphic;if(!this._validateGeometry(Pa.geometry,ha,this.symbolLayer.type))return null;const Qa=this._getVertexOpacityAndColor(Ga.renderingInfo,255),Ea=this.setGraphicElevationContext(Pa);
return this._createAs3DShape(Pa,Ga.renderingInfo,Qa,Ea,Pa.uid)}layerOpacityChanged(Ga,Pa){const Qa=this._getCombinedOpacity(this.symbolLayer?.material?.color),Ea=1>Qa||this.needsDrivenTransparentPass;this._materials[ra.Main]?.setParameters({opacity:Qa,transparent:Ea});this._materials[ra.Bottom]?.setParameters({opacity:Qa,transparent:Ea});const ua=this._getLayerOpacity();Ga.forEach(Na=>{Na=Pa(Na);null!=Na&&Na.layerOpacityChanged(ua,this._context.isAsync)})}layerElevationInfoChanged(Ga,Pa){return this.updateGraphics3DGraphicElevationInfo(Ga,
Pa,y.needsElevationUpdates3D)}slicePlaneEnabledChanged(Ga,Pa){this._materials[ra.Main]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});this._materials[ra.Bottom]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});Ga.forEach(Qa=>{Qa=Pa(Qa);null!=Qa&&Qa.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)});return!0}physicalBasedRenderingChanged(){const Ga={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};this._materials[ra.Main]?.setParameters(Ga);
this._materials[ra.Bottom]?.setParameters(Ga);return!0}_getExtrusionSize(Ga){Ga=Ga.size&&this._drivenProperties.size?u.getDriverAxisSizeValue(Ga.size,2)??0:this._getSymbolSize();return Ga/=this._context.renderCoordsHelper.unitInMeters}applyRendererDiff(Ga,Pa){return this._drivenPropertiesChanged(Pa)?C.ApplyRendererDiffResult.RecreateSymbol:C.ApplyRendererDiffResult.RecreateGraphics}async queryForSnapping(Ga,Pa,Qa,Ea){Pa=this._getExtrusionSize(Qa)*this._context.renderCoordsHelper.unitInMeters/p.getMetersPerVerticalUnitForSR(Pa);
const {objectId:ua,target:Na}=Ga;Qa=l.clone(Na);Qa.z=(Qa.z??0)+Pa;switch(Ga.type){case "edge":const {start:Ua,end:wa}=Ga;Ga=l.clone(Ua);Ea=l.clone(wa);Ga.z=(Ga.z??0)+Pa;Ea.z=(Ea.z??0)+Pa;return[n.makeEdgeCandidate(ua,Qa,Infinity,Ga,Ea)];case "vertex":return[n.makeVertexCandidate(ua,Qa,Infinity),n.makeEdgeCandidate(ua,Na,Infinity,Na,Qa)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(Ga,Pa,Qa,Ea,ua){var Na=D.geometryAsPolygon(Ga.geometry);if(null==Na)return null;
if(0===Na.rings.length||!Na.rings.some(Ba=>0<Ba.length))return this._logGeometryValidationWarnings(Na.rings,"rings","ExtrudeSymbol3DLayer"),null;Ga=E.geometryToRenderInfo(Na,this._context.elevationProvider,this._context.renderCoordsHelper,Ea);this._logGeometryCreationWarnings(Ga,Na.rings,"rings","ExtrudeSymbol3DLayer");var Ua=B.computeCentroid(Na);if(null==Ua)return null;var wa=[];const sa=[],Ha=w.create(),Ka=e.create(),Aa=d.create(),Sa=this._context.renderCoordsHelper.viewingMode===x.ViewingMode.Global;
Sa||this._context.renderCoordsHelper.worldUpAtPosition(null,Aa);t.computeTranslationToOriginAndRotation(Na.spatialReference,[Ua.x,Ua.y,0],Ka,this._context.renderCoordsHelper.spatialReference);Na=e.create();c.invert(Na,Ka);Ua=f.create();h.normalFromMat4(Ua,Na);const {polygons:Ya,mapPositions:qa,position:aa}=Ga,Ja=new Map;Ua=this._materials[ra.Main];for(const Ba of Ya){var Ta=Ba.count;if(this._context.clippingExtent&&(w.empty(Ha),w.expandWithBuffer(Ha,Ba.mapPositions),!w.intersectsClippingArea(Ha,this._context.clippingExtent)))continue;
var Ra=k.earcut(Ba.mapPositions,Ba.holeIndices,3);if(0===Ra.length)continue;const Ia=Ra.length;var $a=6*Ta,bb=m.newIndexArray($a+Ia);const Wa=m.newIndexArray(Ia);var pa=v.newDoubleArray(3*$a);const gb=v.newDoubleArray(3*$a),ib=v.newDoubleArray(3*$a);$a=v.newDoubleArray($a);const La=this._getExtrusionSize(Pa);S(aa,qa,Ra,Ba,pa,ib,gb,$a,bb,Wa,La,Aa,Sa);r.transformMat4(pa,pa,Na);Ra=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:ua,layerUid:this._context.layer.uid});pa=new xa(pa,ib,
K.compressNormals(gb),$a);bb=W(Ua,bb,bb.length-Wa.length,pa,Qa,Ra);Ta=new Ma(Ta,Ta,2*Ba.count,Ia/3);Y(bb,Ta,Ka);Ja.set(bb,Ta);wa.push(bb,W(this._materials[ra.Bottom],Wa,0,pa,Qa,Ra));sa.push(pa.heights)}if(0===wa.length)return null;Pa=new J.Object3D({geometries:wa,layerUid:this._context.layer.uid,graphicUid:ua,isElevationSource:!0});Pa.transformation=Ka;Qa=F.createMaterial(this.symbolLayer,{opacity:this._getLayerOpacity()});wa=new z.Graphics3DObject3DGraphicLayer(this,Pa,wa,null,null,(Ba,Ia,Wa,gb,
ib)=>{Ba=Ba.stageObject;const La=Ba.geometries,Xa=La.length;Ia="absolute-height"!==Ia.mode;let eb=0;const db=Ba.transformation,jb=c.invertOrIdentity(e.create(),db);for(let qb=0;qb<Xa;qb+=2){const ub=La[qb];if(!M.isGeometryWithMapPositions(ub))continue;var nb=ub.getMutableAttribute(R.VertexAttribute.POSITION).data;const xb=sa[qb/2],pb=new N.SamplePosition(ub.mapPositions),Bb=nb.length/3;let Kb=!1,bc=0,Ib=0;for(let $b=0;$b<Bb;$b++){ka[0]=nb[Ib];ka[1]=nb[Ib+1];ka[2]=nb[Ib+2];gb(pb,ja);Ia&&(bc+=ja.sampledElevation);
H.debugFlags.TESTS_DISABLE_OPTIMIZATIONS?(g.set(fa,pb.array[pb.offset],pb.array[pb.offset+1],ja.z+xb[Ib/3]),null!=Wa&&ib.toRenderCoords(fa,Wa,fa)):(g.set(fa,nb[Ib],nb[Ib+1],nb[Ib+2]),g.transformMat4(fa,fa,db),ib.setAltitude(fa,ja.z+xb[Ib/3]));g.transformMat4(fa,fa,jb);nb[Ib]=fa[0];nb[Ib+1]=fa[1];nb[Ib+2]=fa[2];const kc=.01/ib.unitInMeters;if(Math.abs(ka[0]-nb[Ib])>=kc||Math.abs(ka[1]-nb[Ib+1])>=kc||Math.abs(ka[2]-nb[Ib+2])>=kc)Kb=!0;pb.offset+=3;Ib+=3}Kb&&((nb=Ja.get(ub))&&Y(ub,nb,db),Ba.geometryVertexAttributeUpdated(La[qb],
R.VertexAttribute.NORMALCOMPRESSED),ub.invalidateBoundingInfo(),Ba.geometryVertexAttributeUpdated(La[qb],R.VertexAttribute.POSITION),La[qb+1].invalidateBoundingInfo(),Ba.geometryVertexAttributeUpdated(La[qb+1],R.VertexAttribute.POSITION));eb+=bc/Bb}return eb/Xa},Ea,null!=Qa?{baseMaterial:this._materials[ra.Main],edgeMaterials:[Qa],properties:{mergeGeometries:!0,hasSlicePlane:this._context.slicePlaneEnabled}}:null);wa.alignedSampledElevation=Ga.sampledElevation;wa.needsElevationUpdates=y.needsElevationUpdates3D(Ea.mode);
return wa}}const U=d.create(),Z=d.create(),ca=d.create(),ea=d.create(),da=d.create(),ia=d.create(),ka=d.create(),fa=d.create(),X=d.create(),ja=new y.SampleElevationInfo,la=[0,2,1],na=[0,1,2],va=[d.create(),d.create(),d.create()],za=d.create(),ya=d.create(),Da=[0,0,0];var ra;(function(Ga){Ga[Ga.Main=0]="Main";Ga[Ga.Bottom=1]="Bottom"})(ra||={});class xa{constructor(Ga,Pa,Qa,Ea){this.positions=Ga;this.elevation=Pa;this.normals=Qa;this.heights=Ea}}class Ma{constructor(Ga,Pa,Qa,Ea){this.topVertexStart=
Ga;this.topVertexCount=Pa;this.topFaceStart=Qa;this.topFaceCount=Ea}}a.Graphics3DExtrudeSymbolLayer=ba;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/earcut":function(){define(["exports","./_commonjsHelpers"],function(a,b){var q={exports:{}};(function(l){(function(p){p=p();void 0!==p&&(l.exports=p)})(function(){function p(D,F,H){H=H||2;var N=F&&F.length,E=N?F[0]*H:D.length,G=k(D,0,E,H,!0),I=[];if(!G||G.next===G.prev)return I;var O;if(N){var L=G;var P=H;G=[];var M;N=0;
for(M=F.length;N<M;N++){var K=F[N]*P;var J=N<M-1?F[N+1]*P:D.length;K=k(D,K,J,P,!1);K===K.next&&(K.steiner=!0);J=G;var R=J.push,Q=K,W=K;do{if(Q.x<W.x||Q.x===W.x&&Q.y<W.y)W=Q;Q=Q.next}while(Q!==K);R.call(J,W)}G.sort(e);for(N=0;N<G.length;N++)P=G[N],F=L,(L=d(P,F))?(M=y(L,P),P=h(L,L.next),M=g(M),h(M,M.next),P=g(P),L=g(F===L?P:F)):L=F,L=h(L,L.next);G=L}if(D.length>80*H){var S=O=D[0];var V=N=D[1];for(P=H;P<E;P+=H)F=D[P],L=D[P+1],F<S&&(S=F),L<V&&(V=L),F>O&&(O=F),L>N&&(N=L);O=Math.max(O-S,N-V);O=0!==O?1/
O:0}f(G,I,H,S,V,O);return I}function k(D,F,H,N,E){if(E===0<C(D,F,H,N))for(E=F;E<H;E+=N)var G=z(E,D[E],D[E+1],G);else for(E=H-N;E>=F;E-=N)G=z(E,D[E],D[E+1],G);G&&m(G,G.next)&&(D=G.next,A(G),G=D);return G}function h(D,F){if(!D)return D;F||=D;do{var H=!1;if(D.steiner||!m(D,D.next)&&0!==v(D.prev,D,D.next))D=D.next;else{F=D.prev;A(D);D=F;if(D===D.next)break;H=!0}}while(H||D!==F);return F}function f(D,F,H,N,E,G,I){if(D){if(!I&&G){var O=D,L=O;do null===L.z&&(L.z=t(L.x,L.y,N,E,G)),L.prevZ=L.prev,L=L.nextZ=
L.next;while(L!==O);L.prevZ.nextZ=null;L.prevZ=null;O=L;var P,M,K,J,R=1;do{L=O;var Q=O=null;for(M=0;L;){M++;var W=L;for(P=K=0;P<R&&(K++,W=W.nextZ,W);P++);for(J=R;0<K||0<J&&W;)0!==K&&(0===J||!W||L.z<=W.z)?(P=L,L=L.nextZ,K--):(P=W,W=W.nextZ,J--),Q?Q.nextZ=P:O=P,P.prevZ=Q,Q=P;L=W}Q.nextZ=null;R*=2}while(1<M)}for(O=D;D.prev!==D.next;){L=D.prev;W=D.next;if(G)Q=c(D,N,E,G);else a:if(Q=D,M=Q.prev,K=Q,R=Q.next,0<=v(M,K,R))Q=!1;else{for(P=Q.next.next;P!==Q.prev;){if(w(M.x,M.y,K.x,K.y,R.x,R.y,P.x,P.y)&&0<=v(P.prev,
P,P.next)){Q=!1;break a}P=P.next}Q=!0}if(Q)F.push(L.i/H),F.push(D.i/H),F.push(W.i/H),A(D),O=D=W.next;else if(D=W,D===O){if(!I)f(h(D),F,H,N,E,G,1);else if(1===I){D=h(D);I=F;O=H;L=D;do W=L.prev,Q=L.next.next,!m(W,Q)&&r(W,L,L.next,Q)&&x(W,Q)&&x(Q,W)&&(I.push(W.i/O),I.push(L.i/O),I.push(Q.i/O),A(L),A(L.next),L=D=Q),L=L.next;while(L!==D);D=h(L);f(D,F,H,N,E,G,2)}else if(2===I)a:{I=D;do{for(O=I.next.next;O!==I.prev;){if(L=I.i!==O.i){Q=Q=Q=Q=void 0;L=I;W=O;if(Q=L.next.i!==W.i&&L.prev.i!==W.i){b:{Q=L;do{if(Q.i!==
L.i&&Q.next.i!==L.i&&Q.i!==W.i&&Q.next.i!==W.i&&r(Q,Q.next,L,W)){Q=!0;break b}Q=Q.next}while(Q!==L);Q=!1}Q=!Q}if(Q){if(Q=x(L,W)&&x(W,L)){Q=L;M=!1;K=(L.x+W.x)/2;R=(L.y+W.y)/2;do Q.y>R!==Q.next.y>R&&Q.next.y!==Q.y&&K<(Q.next.x-Q.x)*(R-Q.y)/(Q.next.y-Q.y)+Q.x&&(M=!M),Q=Q.next;while(Q!==L);Q=M}Q=Q&&(v(L.prev,L,W.prev)||v(L,W.prev,W))||m(L,W)&&0<v(L.prev,L,L.next)&&0<v(W.prev,W,W.next)}L=Q}if(L){D=y(I,O);I=h(I,I.next);D=h(D,D.next);f(I,F,H,N,E,G);f(D,F,H,N,E,G);break a}O=O.next}I=I.next}while(I!==D)}break}}}}
function c(D,F,H,N){var E=D.prev,G=D.next;if(0<=v(E,D,G))return!1;var I=E.x>D.x?E.x>G.x?E.x:G.x:D.x>G.x?D.x:G.x,O=E.y>D.y?E.y>G.y?E.y:G.y:D.y>G.y?D.y:G.y,L=t(E.x<D.x?E.x<G.x?E.x:G.x:D.x<G.x?D.x:G.x,E.y<D.y?E.y<G.y?E.y:G.y:D.y<G.y?D.y:G.y,F,H,N);F=t(I,O,F,H,N);H=D.prevZ;for(N=D.nextZ;H&&H.z>=L&&N&&N.z<=F;){if(H!==D.prev&&H!==D.next&&w(E.x,E.y,D.x,D.y,G.x,G.y,H.x,H.y)&&0<=v(H.prev,H,H.next))return!1;H=H.prevZ;if(N!==D.prev&&N!==D.next&&w(E.x,E.y,D.x,D.y,G.x,G.y,N.x,N.y)&&0<=v(N.prev,N,N.next))return!1;
N=N.nextZ}for(;H&&H.z>=L;){if(H!==D.prev&&H!==D.next&&w(E.x,E.y,D.x,D.y,G.x,G.y,H.x,H.y)&&0<=v(H.prev,H,H.next))return!1;H=H.prevZ}for(;N&&N.z<=F;){if(N!==D.prev&&N!==D.next&&w(E.x,E.y,D.x,D.y,G.x,G.y,N.x,N.y)&&0<=v(N.prev,N,N.next))return!1;N=N.nextZ}return!0}function e(D,F){return D.x-F.x}function g(D){if(D.next.prev===D)return D;let F=D;do{const H=F.next;if(H.prev===F||H===F||H===D)break;F=H}while(1);return F}function d(D,F){var H=F,N=D.x,E=D.y,G=-Infinity;do{if(E<=H.y&&E>=H.next.y&&H.next.y!==
H.y){var I=H.x+(E-H.y)*(H.next.x-H.x)/(H.next.y-H.y);if(I<=N&&I>G){G=I;if(I===N){if(E===H.y)return H;if(E===H.next.y)return H.next}var O=H.x<H.next.x?H:H.next}}H=H.next}while(H!==F);if(!O)return null;if(N===G)return O;F=O;I=O.x;var L=O.y,P=Infinity;H=O;do{if(N>=H.x&&H.x>=I&&N!==H.x&&w(E<L?N:G,E,I,L,E<L?G:N,E,H.x,H.y)){var M=Math.abs(E-H.y)/(N-H.x);var K;if((K=x(H,D))&&!(K=M<P)&&(K=M===P)&&!(K=H.x>O.x)&&(K=H.x===O.x)){K=O;var J=H;K=0>v(K.prev,K,J.prev)&&0>v(J.next,K,K.next)}K&&(O=H,P=M)}H=H.next}while(H!==
F);return O}function t(D,F,H,N,E){D=32767*(D-H)*E;F=32767*(F-N)*E;D=(D|D<<8)&16711935;D=(D|D<<4)&252645135;D=(D|D<<2)&858993459;F=(F|F<<8)&16711935;F=(F|F<<4)&252645135;F=(F|F<<2)&858993459;return(D|D<<1)&1431655765|((F|F<<1)&1431655765)<<1}function w(D,F,H,N,E,G,I,O){return 0<=(E-I)*(F-O)-(D-I)*(G-O)&&0<=(D-I)*(N-O)-(H-I)*(F-O)&&0<=(H-I)*(G-O)-(E-I)*(N-O)}function v(D,F,H){return(F.y-D.y)*(H.x-F.x)-(F.x-D.x)*(H.y-F.y)}function m(D,F){return D.x===F.x&&D.y===F.y}function r(D,F,H,N){var E=u(v(D,F,
H)),G=u(v(D,F,N)),I=u(v(H,N,D)),O=u(v(H,N,F));return E!==G&&I!==O||0===E&&n(D,H,F)||0===G&&n(D,N,F)||0===I&&n(H,D,N)||0===O&&n(H,F,N)?!0:!1}function n(D,F,H){return F.x<=Math.max(D.x,H.x)&&F.x>=Math.min(D.x,H.x)&&F.y<=Math.max(D.y,H.y)&&F.y>=Math.min(D.y,H.y)}function u(D){return 0<D?1:0>D?-1:0}function x(D,F){return 0>v(D.prev,D,D.next)?0<=v(D,F,D.next)&&0<=v(D,D.prev,F):0>v(D,F,D.prev)||0>v(D,D.next,F)}function y(D,F){var H=new B(D.i,D.x,D.y),N=new B(F.i,F.x,F.y),E=D.next,G=F.prev;D.next=F;F.prev=
D;H.next=E;E.prev=H;N.next=H;H.prev=N;G.next=N;N.prev=G;return N}function z(D,F,H,N){D=new B(D,F,H);N?(D.next=N.next,D.prev=N,N.next.prev=D,N.next=D):(D.prev=D,D.next=D);return D}function A(D){D.next.prev=D.prev;D.prev.next=D.next;D.prevZ&&(D.prevZ.nextZ=D.nextZ);D.nextZ&&(D.nextZ.prevZ=D.prevZ)}function B(D,F,H){this.i=D;this.x=F;this.y=H;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function C(D,F,H,N){for(var E=0,G=H-N;F<H;F+=N)E+=(D[G]-D[F])*(D[F+1]+D[G+1]),G=F;return E}
p.deviation=function(D,F,H,N){var E=F&&F.length,G=Math.abs(C(D,0,E?F[0]*H:D.length,H));if(E){E=0;for(var I=F.length;E<I;E++)G-=Math.abs(C(D,F[E]*H,E<I-1?F[E+1]*H:D.length,H))}for(E=F=0;E<N.length;E+=3){I=N[E]*H;var O=N[E+1]*H,L=N[E+2]*H;F+=Math.abs((D[I]-D[L])*(D[O+1]-D[I+1])-(D[I]-D[O])*(D[L+1]-D[I+1]))}return 0===G&&0===F?0:Math.abs((F-G)/G)};p.flatten=function(D){for(var F=D[0][0].length,H={vertices:[],holes:[],dimensions:F},N=0,E=0;E<D.length;E++){for(var G=0;G<D[E].length;G++)for(var I=0;I<F;I++)H.vertices.push(D[E][G][I]);
0<E&&(N+=D[E-1].length,H.holes.push(N))}return H};return p})})(q);b=b.getDefaultExportFromCjs(q.exports);a.earcut=b})},"esri/chunks/vec3":function(){define(["exports","../core/has","../core/Logger"],function(a,b,q){function l(w,v,m){p(w.typedBuffer,v.typedBuffer,m,w.typedBufferStride,v.typedBufferStride)}function p(w,v,m,r=3,n=r){if(w.length/r!==Math.ceil(v.length/n))return w;const u=w.length/r,x=m[0],y=m[1],z=m[2],A=m[4],B=m[5],C=m[6],D=m[8],F=m[9],H=m[10],N=m[12],E=m[13];m=m[14];let G=0,I=0;for(let O=
0;O<u;O++){const L=v[G],P=v[G+1],M=v[G+2];w[I]=x*L+A*P+D*M+N;w[I+1]=y*L+B*P+F*M+E;w[I+2]=z*L+C*P+H*M+m;G+=n;I+=r}return w}function k(w,v,m){h(w.typedBuffer,v.typedBuffer,m,w.typedBufferStride,v.typedBufferStride)}function h(w,v,m,r=3,n=r){if(w.length/r===Math.ceil(v.length/n)){var u=w.length/r,x=m[0],y=m[1],z=m[2],A=m[3],B=m[4],C=m[5],D=m[6],F=m[7];m=m[8];var H=0,N=0;for(let E=0;E<u;E++){const G=v[H],I=v[H+1],O=v[H+2];w[N]=x*G+A*I+D*O;w[N+1]=y*G+B*I+F*O;w[N+2]=z*G+C*I+m*O;H+=n;N+=r}}}function f(w,
v,m){c(w.typedBuffer,v.typedBuffer,m,w.typedBufferStride,v.typedBufferStride)}function c(w,v,m,r=3,n=r){const u=Math.min(w.length/r,v.length/n);let x=0,y=0;for(let z=0;z<u;z++)w[y]=m*v[x],w[y+1]=m*v[x+1],w[y+2]=m*v[x+2],x+=n,y+=r;return w}function e(w,v,m,r=3,n=r){const u=w.length/r;if(u!==Math.ceil(v.length/n))return w;let x=0,y=0;for(let z=0;z<u;z++)w[y]=v[x]+m[0],w[y+1]=v[x+1]+m[1],w[y+2]=v[x+2]+m[2],x+=n,y+=r;return w}function g(w,v){d(w.typedBuffer,v.typedBuffer,w.typedBufferStride,v.typedBufferStride)}
function d(w,v,m=3,r=m){const n=Math.min(w.length/m,v.length/r);let u=0,x=0;for(let z=0;z<n;z++){const A=v[u],B=v[u+1],C=v[u+2];var y=A*A+B*B+C*C;0<y&&(y=1/Math.sqrt(y),w[x]=y*A,w[x+1]=y*B,w[x+2]=y*C);u+=r;x+=m}}function t(w,v,m){const r=Math.min(w.count,v.count),n=w.typedBuffer;w=w.typedBufferStride;const u=v.typedBuffer;v=v.typedBufferStride;let x=0,y=0;for(let z=0;z<r;z++)n[y]=u[x]>>m,n[y+1]=u[x+1]>>m,n[y+2]=u[x+2]>>m,x+=v,y+=w}b=Object.freeze(Object.defineProperty({__proto__:null,normalize:d,
normalizeView:g,scale:c,scaleView:f,shiftRight:t,transformMat3:h,transformMat3View:k,transformMat4:p,transformMat4View:l,translate:e},Symbol.toStringTag,{value:"Module"}));a.normalize=d;a.normalizeView=g;a.scale=c;a.scaleView=f;a.shiftRight=t;a.transformMat3=h;a.transformMat3View=k;a.transformMat4=p;a.transformMat4View=l;a.translate=e;a.vec3=b})},"esri/layers/graphics/data/SnappingCandidate":function(){define(["exports"],function(a){a.makeEdgeCandidate=function(b,q,l,p,k,h=!1){return{objectId:b,target:q,
distance:l,type:"edge",start:p,end:k,draped:h}};a.makeVertexCandidate=function(b,q,l){return{objectId:b,target:q,distance:l,type:"vertex"}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/renderers/support/renderingInfoUtils":function(){define(["exports","../../Color","../visualVariables/support/visualVariableUtils"],function(a,b,q){function l(k,h){if(!k||k.symbol)return null;h=h?.renderer;return k&&null!=h&&h.getObservationRenderer?h.getObservationRenderer(k):h}async function p(k,
h){if(null!=k.symbol)return k.symbol;const f=l(k,h);return null!=f?f.getSymbolAsync(k,h):null}a.getDriverAxisSizeValue=function(k,h=0){k=k[h];return"number"===typeof k&&isFinite(k)?k:null};a.getDriverAxisSizeValueAny=function(k){for(let h=0;3>h;h++){const f=k[h];if("number"===typeof f)return isFinite(f)?f:0}return 0};a.getRenderer=l;a.getRenderingInfo=function(k,h){const f=l(k,h);if(null!=k.symbol)var c=k.symbol;else c=l(k,h),c=null!=c&&"dot-density"!==c.type?c.getSymbol(k,h):null;if(null==c)return null;
c={renderer:f,symbol:c};if(!(null!=f&&"visualVariables"in f&&f.visualVariables))return c;h=q.getVisualVariableValues(f,k,h)??[];k=["proportional","proportional","proportional"];for(const {variable:e,value:g}of h)switch(e.type){case "color":c.color=g.toRgba();break;case "size":if("outline"===e.target)c.outlineSize=g;else switch(h=e.useSymbolValue?"symbol-value":g,e.axis){case "width":k[0]=h;break;case "depth":k[1]=h;break;case "height":k[2]=h;break;case "width-and-depth":k[0]=k[1]=h;break;default:k[0]=
k[1]=k[2]=h}break;case "opacity":c.opacity=g;break;case "rotation":switch(e.axis){case "tilt":c.tilt=g;break;case "roll":c.roll=g;break;default:c.heading=g}}if("proportional"!==k[0]||"proportional"!==k[1]||"proportional"!==k[2])c.size=k;return c};a.getRenderingInfoAsync=async function(k,h){var f=l(k,h),c=await p(k,h);if(!c)return null;c={renderer:f,symbol:c};if(!(f&&"visualVariables"in f&&f.visualVariables))return c;h=q.getVisualVariableValues(f,k,h)??[];k=["proportional","proportional","proportional"];
for(const {variable:e,value:g}of h)"color"===e.type?c.color=b.toUnitRGBA(g):"size"===e.type?"outline"===e.target?c.outlineSize=g:(h=e.axis,f=e.useSymbolValue?"symbol-value":g,"width"===h?k[0]=f:"depth"===h?k[1]=f:"height"===h?k[2]=f:k[0]="width-and-depth"===h?k[1]=f:k[1]=k[2]=f):"opacity"===e.type?c.opacity=g:"rotation"===e.type&&"tilt"===e.axis?c.tilt=g:"rotation"===e.type&&"roll"===e.axis?c.roll=g:"rotation"===e.type&&(c.heading=g);if(isFinite(k[0])||isFinite(k[1])||isFinite(k[2]))c.size=k;return c};
a.getSymbolAsync=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/polygonUtils":function(){define("exports ../../../../geometry ../../../../chunks/earcut ../../../../geometry/support/Axis ../../../../geometry/support/Indices ../../../../geometry/support/polygonUtils ../../webgl-engine/lib/Attribute ../../webgl-engine/lib/ContentObjectType ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/VertexAttribute ../../../../geometry/Extent ../../../../geometry/Polygon".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){class t{constructor(w,v,m){this.renderData=w;this.layerUid=v;this.graphicUid=m;this.outGeometries=[]}}a.PolygonCreationDataBase=t;a.createColorGeometry=function(w){const v=[[e.VertexAttribute.POSITION,new h.Attribute(w.attributeData.position,w.indices,3,!0)]],m=p.getZeroIndexArray(w.indices.length);null!=w.attributeData.colorFeature?v.push([e.VertexAttribute.COLORFEATUREATTRIBUTE,new h.Attribute([w.attributeData.colorFeature],m,1,!0)]):w.attributeData.color&&v.push([e.VertexAttribute.COLOR,
new h.Attribute(w.attributeData.color,m,4,!0)]);w.attributeData.uvMapSpace&&v.push([e.VertexAttribute.UVMAPSPACE,new h.Attribute(w.attributeData.uvMapSpace,w.indices,4,!0)]);w.attributeData.boundingRect&&v.push([e.VertexAttribute.BOUNDINGRECT,new h.Attribute(w.attributeData.boundingRect,w.indices,9,!0)]);return new c.Geometry(w.material,v,w.mapPositions,f.ContentObjectType.Mesh,w.attributeData.objectAndLayerIdColor)};a.createIndices3D=function(w,v,m){m=k.leastSignificantAxis(w,(0<v.length?v[0]:w.length/
3)-1,m);if(m!==l.Axis.Z){w=w.slice();for(let r=0;r<w.length;r+=3)w[r+m]=w[r+2]}return q.earcut(w,v,3)};a.createWaterGeometry=function(w,v=null){const m=[[e.VertexAttribute.POSITION,new h.Attribute(w.attributeData.position,w.indices,3,!0)],[e.VertexAttribute.UV0,new h.Attribute(w.attributeData.uv0,w.indices,2,!0)]];return new c.Geometry(w.material,m,w.mapPositions,f.ContentObjectType.Mesh,v)};a.geometryAsPolygon=function(w){switch(w.type){case "extent":if(w instanceof g)return d.fromExtent(w);break;
case "polygon":return w}return null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/polygonUtils":function(){define("exports ../../core/mathUtils ../../core/unitUtils ../../chunks/vec32 ./Axis ./plane".split(" "),function(a,b,q,l,p,k){function h(c,e,g,d){const t=Array.isArray(e[0])?(v,m)=>e[v][m]:(v,m)=>e[3*v+m],w=d?q.getMetersPerUnitForSR(d)/q.getMetersPerVerticalUnitForSR(d):1;return k.fromManyPoints(c,(v,m)=>l.set(v,t(m,0)*w,t(m,1)*w,t(m,2)),g)}const f=k.create();
a.fitPlane=h;a.leastSignificantAxis=function(c,e,g){c=h(f,c,e,g)?k.getNormal(f):[0,0,1];return Math.abs(c[2])>Math.cos(b.deg2rad(80))?p.Axis.Z:Math.abs(c[1])>Math.abs(c[0])?p.Axis.Y:p.Axis.X};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/renderInfoUtils/polygon":function(){define("exports ../../../../geometry/projection/projectBuffer ../../../../geometry/support/DoubleArray ../../../../geometry/support/triangulationUtils ../../layers/graphics/elevationAlignmentUtils ../../terrain/OverlayRenderer".split(" "),
function(a,b,q,l,p,k){function h(w,v,m=null){return w.filter(({count:r})=>1<r).map(({index:r,count:n})=>{const u=3*r,x=3*n;return null!=m?new e(r,n,q.doubleSubArray(v,u,x),q.doubleSubArray(m,u,x)):new c(r,n,q.doubleSubArray(v,u,x))})}function f(w,v,m=null){const r=[];for(const {index:n,count:u,holeIndices:x,pathLengths:y}of w){if(1>=u)continue;w=3*n;const z=3*u,A=x.map(B=>B-n);w=null!=m?new g(n,u,q.doubleSubArray(v,3*n,3*u),q.doubleSubArray(m,w,z),A,y):new d(n,u,q.doubleSubArray(v,3*n,3*u),A,y);r.push(w)}return r}
class c{constructor(w,v,m){this.index=w;this.count=v;this.position=m}}class e extends c{constructor(w,v,m,r){super(w,v,m);this.mapPositions=r}}class g extends e{constructor(w,v,m,r,n,u){super(w,v,m,r);this.holeIndices=n;this.pathLengths=u}}class d extends c{constructor(w,v,m,r,n){super(w,v,m);this.holeIndices=r;this.pathLengths=n}}class t{constructor(w,v,m,r,n,u){this.position=w;this.mapPositions=v;this.polygons=m;this.outlines=r;this.projectionSuccess=n;this.sampledElevation=u}}a.PolygonRenderInfo=
t;a.PolygonVertexData=g;a.PolygonVertexDataDraped=d;a.geometryToRenderInfo=function(w,v,m,r){const n=l.ringsToTriangulationInfo(w.rings,!!w.hasZ&&"on-the-ground"!==r.mode,l.CounterClockwiseMode.CCW_IS_HOLE,w.spatialReference),u=q.newDoubleArray(n.position.length);w=p.applyPerVertexElevationAlignment(n.position,w.spatialReference,0,u,0,n.position,0,n.position.length/3,v,m,r);v=null!=w;return new t(n.position,u,f(n.polygons,n.position,u),h(n.outlines,n.position,u),v,w)};a.geometryToRenderInfoDraped=
function(w,v){const m=l.ringsToTriangulationInfo(w.rings,!1,l.CounterClockwiseMode.CCW_IS_HOLE);w=b.projectBuffer(m.position,w.spatialReference,0,m.position,v,0,m.position.length/3);for(v=2;v<m.position.length;v+=3)m.position[v]=k.drapedZ;return{position:m.position,polygons:f(m.polygons,m.position),outlines:h(m.outlines,m.position),projectionSuccess:w}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/triangulationUtils":function(){define("exports ../../chunks/earcut ./Axis ./coordsUtils ./DoubleArray ./Indices ./polygonUtils ./meshUtils/deduplicate".split(" "),
function(a,b,q,l,p,k,h,f){function c(t,w,v){if(1===t.length)return t[0];w=p.newDoubleArray(w);v=Array(v);let m=0,r=0,n=0;for(const u of t){for(t=0;t<u.position.length;t++)w[m++]=u.position[t];for(const x of u.faces)v[r++]=x+n;n=m/3}return{position:w,faces:k.compactIndices(v)}}function e(t,w,v,m){const r=t.length,n=Array(r),u=Array(r),x=Array(r);var y=0;for(var z=0;z<r;++z)y+=t[z].length;let A=z=0,B=0;y=p.newDoubleArray(3*y);let C=0;for(let N=r-1;0<=N;N--){var D=t[N],F=v===a.CounterClockwiseMode.CCW_IS_HOLE?
d(D,w,m):!1;if(F&&1!==r)n[z++]=D;else{var H=D.length;for(let E=0;E<z;++E)H+=n[E].length;H={index:C,pathLengths:Array(z+1),count:H,holeIndices:Array(z)};H.pathLengths[0]=D.length;0<D.length&&(x[B++]={index:C,count:D.length});C=F?g(D,D.length-1,-1,y,C,D.length,w):g(D,0,1,y,C,D.length,w);for(D=0;D<z;++D)F=n[D],H.holeIndices[D]=C,H.pathLengths[D+1]=F.length,0<F.length&&(x[B++]={index:C,count:F.length}),C=g(F,0,1,y,C,F.length,w);z=0;0<H.count&&(u[A++]=H)}}for(t=0;t<z;++t)v=n[t],0<v.length&&(x[B++]={index:C,
count:v.length}),C=g(v,0,1,y,C,v.length,w);u.length=A;x.length=B;return{position:y,polygons:u,outlines:x}}function g(t,w,v,m,r,n,u){r*=3;for(let x=0;x<n;++x){const y=t[w];m[r++]=y[0];m[r++]=y[1];m[r++]=u?y[2]:0;w+=v}return r/3}function d(t,w,v){if(!w)return!l.isClockwise(t);switch(h.leastSignificantAxis(t,t.length-1,v)){case q.Axis.X:return!l.isClockwise(t,q.Axis.Y,q.Axis.Z);case q.Axis.Y:return!l.isClockwise(t,q.Axis.X,q.Axis.Z);case q.Axis.Z:return!l.isClockwise(t,q.Axis.X,q.Axis.Y)}}a.CounterClockwiseMode=
void 0;(function(t){t[t.NONE=0]="NONE";t[t.CCW_IS_HOLE=1]="CCW_IS_HOLE"})(a.CounterClockwiseMode||(a.CounterClockwiseMode={}));a.isCounterClockwise=d;a.ringsToTriangulationInfo=e;a.triangulate=function(t){t=e(t.rings,t.hasZ,a.CounterClockwiseMode.CCW_IS_HOLE,t.spatialReference);const w=[];let v=0,m=0;for(var r of t.polygons){const u=r.index,x=p.doubleSubArray(t.position,3*u,3*r.count);var n=r.holeIndices.map(y=>y-u);n=k.compactIndices(b.earcut(x,n,3));w.push({position:x,faces:n});v+=x.length;m+=n.length}r=
c(w,v,m);t=Array.isArray(r.position)?f.deduplicate(r.position,3,{originalIndices:r.faces}):f.deduplicate(r.position.buffer,6,{originalIndices:r.faces});r.position=p.doubleArrayFrom(new Float64Array(t.buffer));r.faces=t.indices;return r};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/deduplicate":function(){define(["exports","../../../core/mathUtils","../Indices"],function(a,b,q){let l=null;a.deduplicate=function(p,k,h){var f=Array.isArray(p),c=f?p.length/
k:p.byteLength/(4*k),e=f?p:new Uint32Array(p,0,c*k),g=h?.minReduction??0;const d=(p=h?.originalIndices||null)?p.length:0;var t=h?.componentOffsets||null;h=0;if(t)for(var w=0;w<t.length-1;w++){var v=t[w+1]-t[w];v>h&&(h=v)}else h=c;var m=Math.floor(1.1*h)+1;if(null==l||l.length<2*m)l=new Uint32Array(b.nextHighestPowerOfTwo(2*m));for(h=0;h<2*m;h++)l[h]=0;h=0;const r=(v=!!t&&!!p)?d:c;w=q.newIndexArray(c);var n=new Uint32Array(d),u=0!==g?Math.ceil(7.84*1.96/(g*g)*g*(1-g)):r,x=1,y=t?t[1]:r;for(let D=0;D<
r;D++){if(D===u){var z=1-h/D;if(z+1.96*Math.sqrt(z*(1-z)/D)<g)return null;u*=2}if(D===y){for(y=0;y<2*m;y++)l[y]=0;if(p)for(y=t[x-1];y<t[x];y++)n[y]=w[p[y]];y=t[++x]}z=v?p[D]:D;const F=z*k;var A=0;for(var B=0;B<k;B++)A=e[F+B]+A|0,A=A+(A<<11)+(A>>>2)|0;A>>>=0;B=A%m;let H=h;for(;0!==l[2*B+1];){if(l[2*B]===A){const N=l[2*B+1]-1;var C=N*k;a:{for(let E=0;E<k;E++)if(e[F+E]!==e[C+E]){C=!1;break a}C=!0}if(C){H=w[N];break}}B++;B>=m&&(B-=m)}H===h&&(l[2*B]=A,l[2*B+1]=z+1,h++);w[z]=H}if(0!==g&&1-h/c<g)return null;
if(v){for(c=t[x-1];c<n.length;c++)n[c]=w[p[c]];w=q.compactIndices(n)}f=f?Array(h):new Uint32Array(h*k);h=0;for(u=0;u<r;u++)if(w[u]===h){c=e;g=(v?p[u]:u)*k;t=f;m=h*k;n=k;for(x=0;x<n;x++)t[m+x]=c[g+x];h++}if(p&&!v){k=new Uint32Array(d);for(e=0;e<k.length;e++)k[e]=w[p[e]];w=q.compactIndices(k)}return{buffer:Array.isArray(f)?f:f.buffer,indices:w,uniqueCount:h}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/OverlayRenderer":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Evented ../../../core/has ../../../core/MapUtils ../../../core/maybe ../../../core/PooledArray ../../../core/reactiveUtils ../../../core/SetUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/mat4 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../ViewingMode ../layers/interfaces ../support/debugFlags ./interfaces ./Overlay ./OverlayContent ./OverlayRenderTargets ../webgl/RenderCamera ../webgl-engine/core/shaderLibrary/ShaderOutput ../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl ../../../chunks/TextureOnly.glsl ../webgl-engine/core/shaderTechnique/ShaderTechniqueRepository ../webgl-engine/effects/RenderPlugin ../webgl-engine/lib/GLMaterialRepository ../webgl-engine/lib/GridLocalOriginFactory ../webgl-engine/lib/Material ../webgl-engine/lib/RenderContext ../webgl-engine/lib/RenderSlot ../webgl-engine/lib/ShadowMap ../webgl-engine/lib/SortedRenderGeometryRenderer ../webgl-engine/lib/TextureTechnique ../webgl-engine/lib/TextureTechniqueConfiguration ../webgl-engine/lib/TransparencyPassType ../webgl-engine/lib/UpdatePolicy ../webgl-engine/lighting/Lightsources ../../../chunks/OverlayCompositing.glsl ../webgl-engine/shaders/OverlayCompositingTechnique ../../support/Scheduler ../../webgl/enums ../../webgl/Texture ../../webgl/TextureDescriptor".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba){a.OverlayRenderer=class extends N.SyncRenderPlugin{constructor(ea){super(ea);this._renderTargets=this._overlays=null;this._overlayParameters=new S.OverlayCompositingPassParameters;this._hasWater=this.hasHighlights=!1;this._renderers=new Map;this._sortedDrapeSourceRenderersDirty=!1;this._sortedRenderers=new h;this._passParameters=new F.TextureOnlyPassParameters;this._materials=null;this._screenToWorldRatio=
1;this._localOriginFactory=null;this.unloadedMemory=0;this.ignoresMemoryFactor=!1;this._camera=new B;this.worldToPCSRatio=1;this.events=new q;this.longitudeCyclical=null;this.produces=new Map([[L.RenderSlot.DRAPED_MATERIAL,da=>da!==C.ShaderOutput.Highlight||this.hasHighlights],[L.RenderSlot.DRAPED_WATER,()=>this._hasWater]]);this._hasDrapedRasterSource=this._hasDrapedFeatureSource=this._hasTargetWithoutRasterImage=!1}initialize(){const ea=this.view._stage.renderer.fboCache,da=this.view._stage.renderView,
{waterTextures:ia,stippleTextures:ka,markerTextures:fa}=da;this._techniques=new H.ShaderTechniqueRepository({rctx:this._rctx,viewingMode:r.ViewingMode.Local,stippleTextures:ka,markerTextures:fa,waterTextures:ia});this._renderContext=new O.OverlayRenderContext(this._rctx,new P.ShadowMap(ea,this.view.state.viewingMode),null);this.addHandles([f.watch(()=>ia.updating,()=>this.events.emit("content-changed"),f.syncAndInitial),f.watch(()=>this.spatialReference,X=>this._localOriginFactory=new G.GridLocalOriginFactory(X),
f.syncAndInitial),f.on(()=>this.view.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0)]);this._materials=new E.GLMaterialRepository(da.textures,this._techniques,()=>{this.notifyChange("rendersOccludedDraped");this.events.emit("content-changed");this.notifyChange("updating");this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._bindParameters.slot=L.RenderSlot.DRAPED_MATERIAL;this._bindParameters.mainDepth=null;this._camera.near=1;this._camera.far=1E4;
this._camera.relativeElevation=null;this._bindParameters.camera=this._camera;this._bindParameters.transparencyPassType=R.TransparencyPassType.NONE;this._bindParameters.newLighting.noonFactor=0;this._bindParameters.newLighting.globalFactor=0;this._bindParameters.newLighting.set([new W.AmbientLight(m.fromValues(1,1,1))]);this.addHandles(this.view.resourceController.scheduler.registerTask(T.TaskPriority.STAGE,this))}destroy(){this._renderers.forEach(ea=>ea.destroy());this._renderers.clear();this._debugTextureTechnique=
k.releaseMaybe(this._debugTextureTechnique);this._passParameters.texture=k.disposeMaybe(this._passParameters.texture);this._techniques=k.destroyMaybe(this._techniques);this.disposeOverlays()}get _bindParameters(){return this._renderContext.bindParameters}get _rctx(){return this.view._stage.renderView.renderingContext}get rctx(){return this._rctx}get materials(){return this._materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}initializeRenderContext(ea){this.pluginContext=
ea}uninitializeRenderContext(){}renderNode(){}get updating(){return this._sortedDrapeSourceRenderersDirty||p.someMap(this._renderers,ea=>ea.updating)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(ea){for(const da of this._renderers.values()){const ia=da.getMaterialRenderer(ea);if(ia)return ia}return null}get layers(){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();return this._sortedRenderers.map(ea=>ea.drapeSource.layer).filter(ea=>
!!ea)}createGeometryDrapeSourceRenderer(ea){return this.createDrapeSourceRenderer(ea,M.SortedRenderGeometryRenderer)}createDrapeSourceRenderer(ea,da,ia){const ka=this._renderers.get(ea);null!=ka&&ka.destroy();da=new da({...ia,rendererContext:this,drapeSource:ea});this._renderers.set(ea,da);this._sortedDrapeSourceRenderersDirty=!0;"fullOpacity"in ea&&this.addHandles(f.watch(()=>ea.fullOpacity,()=>this.events.emit("content-changed")),ea);return da}removeDrapeSourceRenderer(ea){if(null!=ea){var da=this._renderers.get(ea);
null!=da&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(ea),this.removeHandles(ea),da.destroy())}}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(){this._renderTargets?.dispose()}get overlays(){return this._overlays??[]}ensureDrapeTargets(ea){this._hasTargetWithoutRasterImage=this._overlays?c.someSet(ea,da=>da.drapeTargetType===n.DrapeTargetType.WithoutRasterImage):!1}ensureDrapeSources(ea){this._overlays?(this._hasDrapedFeatureSource=c.someSet(ea,
da=>da.drapeSourceType===n.DrapeSourceType.Features),this._hasDrapedRasterSource=c.someSet(ea,da=>da.drapeSourceType===n.DrapeSourceType.RasterImage)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(ea,da,ia=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new A.OverlayRenderTargets(this.view._stage.renderer.fboCache),
this._overlays=[new y.Overlay,new y.Overlay]);this.ensureDrapeTargets(ea);this.ensureDrapeSources(da);this._bindParameters.overlayStretch=ia}disposeOverlays(){this._overlays=null;this._renderTargets=k.disposeMaybe(this._renderTargets);this.events.emit("textures-disposed")}getTexture(ea){if(null!=ea)return ea===z.OverlayContent.ColorNoRasterImage&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource?this._renderTargets?.getTexture(z.OverlayContent.Color):this._renderTargets?.getTexture(ea)}get running(){return this.updating}runTask(ea){this._processDrapeSources(ea,
()=>!0)}_processDrapeSources(ea,da){let ia=!1;for(const [ka,fa]of this._renderers){if(ea.done)break;(ka.destroyed||da(ka))&&fa.commitChanges()&&(ia=!0,ea.madeProgress())}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,ia=!0,this._updateSortedDrapeSourceRenderers());ia&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this.events.emit("content-changed"),this.hasHighlights=p.someMap(this._renderers,
ka=>ka.hasHighlights),this.notifyChange("rendersOccludedDraped"),this._updateHasWater())}processSyncDrapeSources(){this._processDrapeSources(T.noBudget,ea=>ea.updatePolicy===Q.UpdatePolicy.SYNC)}get isEmpty(){return u.debugFlags.OVERLAY_DRAW_DEBUG_TEXTURE?!1:!p.someMap(this._renderers,ea=>!ea.isEmpty)}get hasWater(){return this._hasWater}get rendersOccludedDraped(){const ea=this._renderContext.renderOccludedMask;this._renderContext.renderOccludedMask=ca;const da=this._sortedRenderers.some(({renderer:ia})=>
ia.shouldRender(this._renderContext));this._renderContext.renderOccludedMask=ea;return da}renders(ea){return u.debugFlags.OVERLAY_DRAW_DEBUG_TEXTURE&&ea!==z.OverlayContent.Occluded||this._sortedRenderers.some(({renderer:da})=>da.shouldRender(this._renderContext))}get mode(){return this.isEmpty?D.OverlayMode.Disabled:this._renderTargets?.getTexture(z.OverlayContent.WaterNormal)?D.OverlayMode.EnabledWithWater:this._renderTargets?.getTexture(z.OverlayContent.Color)?D.OverlayMode.Enabled:D.OverlayMode.Disabled}updateAnimation(ea){let da=
!1;this._renderers.forEach(ia=>da=ia.updateAnimation(ea)||da);return da}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}drawOverlays(ea){if(this._overlays&&this._renderTargets){for(var da of this._overlays)this.longitudeCyclical?da.setupGeometryViewsCyclical(this.longitudeCyclical):da.setupGeometryViewsDirect();for(const ia of this._renderTargets.targets){if(ia.content===z.OverlayContent.ColorNoRasterImage&&!this._needsColorWithoutRasterImage)continue;da=this._drawTarget(x.OverlayIndex.INNER,
ia,ea);const ka=this._drawTarget(x.OverlayIndex.OUTER,ia,ea);(da||ka)&&ia.fbo.generateMipMap()}}}_drawTarget(ea,da,ia){const ka=this._overlays[ea],fa=ka.canvasGeometries;if(0===fa.numViews)return!1;const {alignPixelEnabled:X,contentPixelRatio:ja}=ia;this._screenToWorldRatio=ja*ka.mapUnitsPerPixel/this._bindParameters.overlayStretch;const la=da.output;if(this.isEmpty||la===C.ShaderOutput.Highlight&&!this.hasHighlights||la===C.ShaderOutput.Normal&&!this.hasWater||!ka.hasSomeSizedView())return!1;const na=
this._rctx;this._camera.pixelRatio=ka.pixelRatio*ja;this._renderContext.output=la;this._bindParameters.alignPixelEnabled=X;this._bindParameters.screenToWorldRatio=this._screenToWorldRatio;this._bindParameters.screenToPCSRatio=this._screenToWorldRatio*this.worldToPCSRatio;this._bindParameters.slot=la===C.ShaderOutput.Normal?L.RenderSlot.DRAPED_WATER:L.RenderSlot.DRAPED_MATERIAL;da.content===z.OverlayContent.Occluded&&(this._renderContext.renderOccludedMask=ca);if(!this.renders(da.content))return this._renderContext.renderOccludedMask=
O.defaultRenderOccludedMask,!1;ia=ka.resolution;this._rctx.setViewport(ea===x.OverlayIndex.INNER?0:ia,0,ia,ia);const va=2*ka.resolution,za=ka.resolution,ya=da.fbo;ya.bind(na,va,za);ea===x.OverlayIndex.INNER&&(na.setClearColor(0,0,0,0),na.clear(Y.ClearBufferBit.COLOR_BUFFER_BIT));if(u.debugFlags.OVERLAY_DRAW_DEBUG_TEXTURE&&da.content!==z.OverlayContent.Occluded)for(ia=0;ia<fa.numViews;ia++)this._setViewParameters(fa.extents[ia],ka),this._ensureDebugPatternResources(ka.resolution,Z[ea]),this._rctx.bindTechnique(this._debugTextureTechnique,
this._renderContext.bindParameters,this._passParameters),this._rctx.screen.draw();this._sortedRenderers.forAll(({drapeSource:Da,renderer:ra})=>{if(da.content!==z.OverlayContent.ColorNoRasterImage||Da.drapeSourceType!==n.DrapeSourceType.RasterImage){var {fullOpacity:xa}=Da;Da=null!=xa&&1>xa&&la===C.ShaderOutput.Color?this.bindTemporaryFramebuffer(va,za):null;for(let Ma=0;Ma<fa.numViews;Ma++)this._setViewParameters(fa.extents[Ma],ka),ra.render(this._renderContext);Da&&(ya.bind(na,va,za),this._overlayParameters.texture=
Da.getTexture(),this._overlayParameters.opacity=xa,this._overlayParameters.overlayIndex=ea,ra=this.pluginContext.techniques.acquire(V.OverlayCompositingTechnique),this._rctx.bindTechnique(ra,this._renderContext.bindParameters,this._overlayParameters),this._rctx.screen.draw(),ra.release(),Da.release())}});na.bindFramebuffer(null);this._renderContext.renderOccludedMask=O.defaultRenderOccludedMask;return!0}bindTemporaryFramebuffer(ea,da){const ia=this.view._stage.renderer.fboCache;ea=ia.acquire(ea,da,
"overlay tmp");ia.rctx.unbindTexture(ea.fbo?.colorTexture);ia.rctx.bindFramebuffer(ea.fbo);ia.rctx.clear(Y.ClearBufferBit.COLOR_BUFFER_BIT);return ea}async reloadShaders(){await this._techniques.reloadAll()}notifyContentChanged(){this.events.emit("content-changed")}intersect(ea,da,ia,ka){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let fa=0;for(const {renderer:X}of this._sortedRenderers)fa=X.intersect?.(ea,da,ia,ka,fa)??fa}_updateSortedDrapeSourceRenderers(){this._sortedRenderers.clear();
if(0!==this._renderers.size){var ea=this.view.map.allLayers,da=ea.length;this._renderers.forEach((ia,ka)=>{const fa=ea.indexOf(ka.layer),X=0<=fa;this._sortedRenderers.push(new U(ka,ia,da*(ka.renderGroup??(X?n.DrapedRenderGroup.MapLayer:n.DrapedRenderGroup.ViewLayer))+(X?fa:0)))});this._sortedRenderers.sort((ia,ka)=>ia.index-ka.index)}}_setViewParameters(ea,da){const ia=this._camera;ia.viewport=[0,0,da.resolution,da.resolution];w.ortho(ia.projectionMatrix,0,ea[2]-ea[0],0,ea[3]-ea[1],ia.near,ia.far);
w.fromTranslation(ia.viewMatrix,[-ea[0],-ea[1],0])}_updateHasWater(){const ea=p.someMap(this._renderers,da=>da.hasWater);ea!==this._hasWater&&(this._hasWater=ea,this.events.emit("has-water",ea))}_ensureDebugPatternResources(ea,da){v.set(this._passParameters.color,da[0],da[1],da[2]);if(!this._passParameters.texture){da=new Uint8Array(ea*ea*4);var ia=0;for(let ka=0;ka<ea;ka++)for(let fa=0;fa<ea;fa++){const X=Math.floor(fa/10),ja=Math.floor(ka/10);2>X||2>ja||10*X>ea-20||10*ja>ea-20?(da[ia++]=255,da[ia++]=
255,da[ia++]=255,da[ia++]=255):(da[ia++]=255,da[ia++]=255,da[ia++]=255,X&1&&ja&1?da[ia++]=fa&1^ka&1?0:255:da[ia++]=X&1^ja&1?0:128)}ea=new ba.TextureDescriptor(ea);ea.samplingMode=Y.TextureSamplingMode.NEAREST;this._passParameters.texture=new ha.Texture(this._rctx,ea,da);ea=new J.TextureTechniqueConfiguration;ea.hasAlpha=!0;this._debugTextureTechnique=this._techniques.acquire(K.TextureTechnique,ea)}}get test(){}};b.__decorate([e.property()],a.OverlayRenderer.prototype,"hasHighlights",void 0);b.__decorate([e.property()],
a.OverlayRenderer.prototype,"_sortedDrapeSourceRenderersDirty",void 0);b.__decorate([e.property()],a.OverlayRenderer.prototype,"_techniques",void 0);b.__decorate([e.property({constructOnly:!0})],a.OverlayRenderer.prototype,"view",void 0);b.__decorate([e.property()],a.OverlayRenderer.prototype,"worldToPCSRatio",void 0);b.__decorate([e.property()],a.OverlayRenderer.prototype,"spatialReference",void 0);b.__decorate([e.property({type:Boolean,readOnly:!0})],a.OverlayRenderer.prototype,"updating",null);
b.__decorate([e.property()],a.OverlayRenderer.prototype,"isEmpty",null);b.__decorate([e.property({readOnly:!0})],a.OverlayRenderer.prototype,"rendersOccludedDraped",null);a.OverlayRenderer=b.__decorate([t.subclass("esri.views.3d.terrain.OverlayRenderer")],a.OverlayRenderer);class U{constructor(ea,da,ia){this.drapeSource=ea;this.renderer=da;this.index=ia}}const Z=[[1,.5,.5],[.5,.5,1]],ca=I.RenderOccludedFlag.OccludeAndTransparent;a.drapedZ=-2;a.overlayRenderOccludedFlag=ca;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/interfaces":function(){define(["exports"],function(a){a.DrapeSourceType=void 0;(function(b){b[b.RasterImage=0]="RasterImage";b[b.Features=1]="Features"})(a.DrapeSourceType||(a.DrapeSourceType={}));a.DrapedRenderGroup=void 0;(function(b){b[b.MapLayer=0]="MapLayer";b[b.ViewLayer=1]="ViewLayer";b[b.Outline=2]="Outline";b[b.SnappingHint=3]="SnappingHint"})(a.DrapedRenderGroup||(a.DrapedRenderGroup={}));a.DrapeTargetType=void 0;(function(b){b[b.WithRasterImage=
0]="WithRasterImage";b[b.WithoutRasterImage=1]="WithoutRasterImage"})(a.DrapeTargetType||(a.DrapeTargetType={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/interfaces":function(){define(["exports"],function(a){a.OverlayIndex=void 0;(function(b){b[b.INNER=0]="INNER";b[b.OUTER=1]="OUTER"})(a.OverlayIndex||(a.OverlayIndex={}));a.PatchType=void 0;(function(b){b[b.REGULAR=0]="REGULAR";b[b.HAS_NORTH_POLE=1]="HAS_NORTH_POLE";b[b.HAS_SOUTH_POLE=2]="HAS_SOUTH_POLE";
b[b.HAS_BOTH_POLES=3]="HAS_BOTH_POLES"})(a.PatchType||(a.PatchType={}));a.LODSnapping=void 0;(function(b){b[b.OFF=0]="OFF";b[b.ON=1]="ON"})(a.LODSnapping||(a.LODSnapping={}));a.TextureUpdate=void 0;(function(b){b[b.FADING=0]="FADING";b[b.IMMEDIATE=1]="IMMEDIATE";b[b.UNFADED=2]="UNFADED"})(a.TextureUpdate||(a.TextureUpdate={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/Overlay":function(){define(["exports","../../../geometry/support/aaBoundingRect","../webgl-engine/lib/LocalOriginFactory"],
function(a,b,q){class l{constructor(){this._extent=b.create();this.resolution=0;this.renderLocalOrigin=q.fromValues(0,0,0,"O");this.mapUnitsPerPixel=this.pixelRatio=1;this.canvasGeometries=new p}get extent(){return this._extent}setupGeometryViewsCyclical(k){this.setupGeometryViewsDirect();var h=.001*k.range;if(this._extent[0]-h<=k.min){const f=this.canvasGeometries.extents[this.canvasGeometries.numViews++];b.offset(this._extent,k.range,0,f)}this._extent[2]+h>=k.max&&(h=this.canvasGeometries.extents[this.canvasGeometries.numViews++],
b.offset(this._extent,-k.range,0,h))}setupGeometryViewsDirect(){this.canvasGeometries.numViews=1;b.copy(this.canvasGeometries.extents[0],this._extent)}hasSomeSizedView(){for(let k=0;k<this.canvasGeometries.numViews;k++){const h=this.canvasGeometries.extents[k];if(h[0]!==h[2]&&h[1]!==h[3])return!0}return!1}}class p{constructor(){this.extents=[b.create(),b.create(),b.create()];this.numViews=0}}a.Overlay=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/LocalOriginFactory":function(){define(["exports",
"../../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b){class q{constructor(l,p){this.vec3=l;this.id=p}}a.LocalOrigin=q;a.fromValues=function(l,p,k,h){return new q(b.fromValues(l,p,k),h)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/OverlayContent":function(){define(["exports"],function(a){a.OverlayContent=void 0;var b=a.OverlayContent||(a.OverlayContent={});b[b.Color=0]="Color";b[b.ColorNoRasterImage=1]="ColorNoRasterImage";b[b.Highlight=2]=
"Highlight";b[b.WaterNormal=3]="WaterNormal";b[b.Occluded=4]="Occluded";b[b.ObjectAndLayerIdColor=5]="ObjectAndLayerIdColor";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/OverlayRenderTargets":function(){define("exports ../../../core/has ./OverlayContent ./OverlayFramebufferObject ../webgl/formats ../webgl-engine/core/shaderLibrary/ShaderOutput".split(" "),function(a,b,q,l,p,k){class h{constructor(c,e,g,d,t=p.ColorFormat.RGBA_MIPMAP){this.output=g;this.content=
d;this.fbo=new l.OverlayFramebufferObject(c,t,e)}get valid(){return this.fbo.valid}}class f{constructor(c){this.targets=[new h(c,"overlay color",k.ShaderOutput.Color,q.OverlayContent.Color),new h(c,"overlay IM color",k.ShaderOutput.Color,q.OverlayContent.ColorNoRasterImage),new h(c,"overlay highlight",k.ShaderOutput.Highlight,q.OverlayContent.Highlight,p.ColorFormat.RGBA4),new h(c,"overlay water",k.ShaderOutput.Normal,q.OverlayContent.WaterNormal),new h(c,"overlay occluded",k.ShaderOutput.Color,q.OverlayContent.Occluded)];
b("enable-feature:objectAndLayerId-rendering")&&this.targets.push(new h(c,"overlay oid",k.ShaderOutput.ObjectAndLayerIdColor,q.OverlayContent.ObjectAndLayerIdColor))}getTexture(c){return this.targets[c]?.fbo.texture}dispose(){for(const c of this.targets)c.fbo.dispose()}computeValidity(){return this.targets.reduce((c,e,g)=>e.valid?c|=1<<g:c,0)}}a.OverlayRenderTargets=f;a.RenderTargetDescriptor=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/OverlayFramebufferObject":function(){define(["exports",
"../../../core/maybe"],function(a,b){class q{constructor(l,p,k){this._fbos=l;this._format=p;this._name=k}get valid(){return null!=this._handle?.getTexture()}dispose(){this._handle=b.releaseMaybe(this._handle)}get texture(){return this._handle?.getTexture()}bind(l,p,k){this._handle&&this._handle.fbo?.width===p&&this._handle.fbo?.height===k||(this._handle?.release(),this._handle=this._fbos.acquire(p,k,this._name,this._format));l.unbindTexture(this._handle?.fbo?.colorTexture);l.bindFramebuffer(this._handle?.fbo)}generateMipMap(){this._handle?.getTexture()?.descriptor?.hasMipmap&&
this._handle?.getTexture()?.generateMipmap()}}a.OverlayFramebufferObject=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../../../geometry/support/aaBoundingRect ../../../../terrain/interfaces ../../../../terrain/OverlayContent ../../renderPasses/AllRenderPasses ../ShaderOutput ../shading/MainLighting.glsl ../shading/PhysicallyBasedRenderingParameters.glsl ../shading/Water.glsl ../../shaderModules/Float4DrawUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../shaderModules/Texture2DPassUniform ../../shaderModules/Uniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(x,y){y.pbrMode!==c.PBRMode.Water&&y.pbrMode!==c.PBRMode.WaterOnIntegratedMesh&&y.pbrMode!==c.PBRMode.TerrainWithWater||x.include(e.Water,y);const {vertex:z,fragment:A}=x;x.varyings.add("vtcOverlay","vec4");z.code.add(t.glsl`void setOverlayVTC(in vec2 uv) {
vtcOverlay = vec4(uv, uv) * overlayTexScale + overlayTexOffset;
}`);A.code.add(t.glsl`bool isValid(vec2 uv, vec2 dxdy) {
return (uv.x >= 0.0 + dxdy.x) && (uv.x <= 1.0 - dxdy.x) && (uv.y >= 0.0 + dxdy.y) && (uv.y <= 1.0 - dxdy.y);
}
vec4 getOverlayColor(sampler2D ov0Tex, vec4 texCoords) {
vec4 color0 = texture(ov0Tex, vec2(texCoords.x * 0.5, texCoords.y));
vec4 color1 = texture(ov0Tex, vec2(texCoords.z * 0.5 + 0.5, texCoords.w));
bool isValid0 = isValid(texCoords.xy, fwidth(texCoords.xy));
bool isValid1 = isValid(texCoords.zw, vec2(0.0, 0.0));
return mix(color1 * float(isValid1), color0, float(isValid0));
}`);A.code.add(t.glsl`vec4 getCombinedOverlayColor() {
return overlayOpacity * getOverlayColor(ovColorTex, vtcOverlay);
}`);A.code.add(t.glsl`vec4 getOverlayColorTexel(vec4 texCoords) {
vec2 texDim = vec2(textureSize(ovColorTex, 0));
vec4 color0 = texelFetch(ovColorTex, ivec2(vec2(texCoords.x * 0.5, texCoords.y) * texDim), 0);
vec4 color1 = texelFetch(ovColorTex, ivec2(vec2(texCoords.z * 0.5 + 0.5, texCoords.w) * texDim), 0);
bool isValid0 = isValid(texCoords.xy, fwidth(texCoords.xy));
bool isValid1 = isValid(texCoords.zw, vec2(0.0, 0.0));
return mix(color1 * float(isValid1), color0, float(isValid0));
}`);if(y.pbrMode===c.PBRMode.Water||y.pbrMode===c.PBRMode.WaterOnIntegratedMesh||y.pbrMode===c.PBRMode.TerrainWithWater)f.addMainLightDirection(A),f.addMainLightIntensity(A),A.code.add(t.glsl`vec4 getOverlayWaterColor(vec4 maskInput, vec4 colorInput, vec3 vposEyeDir,
float shadow, vec3 localUp, mat3 tbn, vec3 position, vec3 positionWorld) {
vec3 n = normalize(tbn * (2.0 * maskInput.rgb - vec3(1.0)));
vec3 v = vposEyeDir;
vec3 final = getSeaColor(n, v, mainLightDirection, colorInput.rgb, mainLightIntensity, localUp, 1.0 - shadow, maskInput.w, position, positionWorld);
return vec4(final, colorInput.w);
}`)}function r(x,y){return x.identifier===k.RenderPassIdentifier.Material&&x.output===h.ShaderOutput.Color?y.overlay?.getTexture(p.OverlayContent.ColorNoRasterImage):x.identifier===k.RenderPassIdentifier.Material&&x.output===h.ShaderOutput.ObjectAndLayerIdColor?y.overlay?.getTexture(p.OverlayContent.ObjectAndLayerIdColor):x.identifier===k.RenderPassIdentifier.Highlight?y.overlay?.getTexture(p.OverlayContent.Highlight):null}a.OverlayMode=void 0;(function(x){x[x.Disabled=0]="Disabled";x[x.Enabled=1]=
"Enabled";x[x.EnabledWithWater=2]="EnabledWithWater";x[x.COUNT=3]="COUNT"})(a.OverlayMode||(a.OverlayMode={}));class n extends v.Uniform{constructor(x){super(x,"vec4")}}const u=b.create();a.OverlayIM=function(x,y){const {vertex:z,fragment:A}=x;z.uniforms.add(new g.Float4DrawUniform("overlayTexOffset",(B,C)=>{const D=C.overlay?.overlays[l.OverlayIndex.INNER]?.extent;q.hasArea(D)&&(u[0]=B.toMapSpace[0]/q.width(D)-D[0]/q.width(D),u[1]=B.toMapSpace[1]/q.height(D)-D[1]/q.height(D));C=C.overlay?.overlays[l.OverlayIndex.OUTER]?.extent;
q.hasArea(C)&&(u[2]=B.toMapSpace[0]/q.width(C)-C[0]/q.width(C),u[3]=B.toMapSpace[1]/q.height(C)-C[1]/q.height(C));return u}),new g.Float4DrawUniform("overlayTexScale",(B,C)=>{const D=C.overlay?.overlays[l.OverlayIndex.INNER]?.extent;q.hasArea(D)&&(u[0]=B.toMapSpace[2]/q.width(D),u[1]=B.toMapSpace[3]/q.height(D));C=C.overlay?.overlays[l.OverlayIndex.OUTER]?.extent;q.hasArea(C)&&(u[2]=B.toMapSpace[2]/q.width(C),u[3]=B.toMapSpace[3]/q.height(C));return u}));A.constants.add("overlayOpacity","float",1);
A.uniforms.add(new w.Texture2DPassUniform("ovColorTex",(B,C)=>r(B,C)));m(x,y)};a.OverlayTerrain=function(x,y){const {vertex:z,fragment:A}=x;z.uniforms.add(new n("overlayTexOffset"),new n("overlayTexScale"));A.uniforms.add(new d.FloatPassUniform("overlayOpacity",B=>B.overlayOpacity),new w.Texture2DPassUniform("ovColorTex",(B,C)=>C.overlay?.getTexture(B.overlayContent)));m(x,y)};a.getIMColorTexture=r;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/renderPasses/AllRenderPasses":function(){define(["exports",
"../../../../../core/libs/gl-matrix-2/factories/vec3f64","../shaderLibrary/ShaderOutput","../shaderLibrary/attributes/VertexNormal.glsl"],function(a,b,q,l){class p extends l.VertexNormalPassParameters{constructor(){super(...arguments);this.origin=this.slicePlaneLocalOrigin=b.create();this.modelTransformation=null}}class k extends l.VertexNormalDrawParameters{}a.RenderPassIdentifier=void 0;(function(g){g[g.Material=0]="Material";g[g.ShadowMap=1]="ShadowMap";g[g.Highlight=2]="Highlight";g[g.ViewshedShadowMap=
3]="ViewshedShadowMap"})(a.RenderPassIdentifier||(a.RenderPassIdentifier={}));class h extends p{constructor(){super(...arguments);this.identifier=a.RenderPassIdentifier.Material;this.output=q.ShaderOutput.Color;this.transparent=!1}}class f extends p{constructor(){super(...arguments);this.identifier=a.RenderPassIdentifier.ShadowMap}}class c extends p{constructor(){super(...arguments);this.identifier=a.RenderPassIdentifier.Highlight}}class e extends p{constructor(){super(...arguments);this.identifier=
a.RenderPassIdentifier.ViewshedShadowMap}}a.DrawParameters=k;a.HighlightPassParameters=c;a.MaterialPassParameters=h;a.PassParameters=p;a.ShadowMapPassParameters=f;a.ViewshedShadowMapPassParameters=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl":function(){define("exports ./FoamRendering.glsl ./Gamma.glsl ./PhysicallyBasedRendering.glsl ./ScreenSpaceConstants ./ScreenSpaceReflections.glsl ../util/CloudsParallaxShading.glsl ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix4PassUniform ../../shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){a.Water=function(d,t){d.include(l.PhysicallyBasedRenderingWater,t);d.include(q.Gamma);d.include(b.FoamColor);t.hasCloudsReflections&&d.include(h.CloudsParallaxShading,t);t.hasScreenSpaceReflections&&d.include(k.ScreenSpaceReflections,t);d=d.fragment;d.constants.add("fresnelSky","vec3",[.02,1,15]).add("fresnelMaterial","vec2",[.02,.1]).add("roughness","float",.015).add("foamIntensityExternal","float",1.7).add("ssrIntensity","float",.65).add("ssrHeightFadeStart","float",
p.distanceFadeStart).add("ssrHeightFadeEnd","float",p.distanceFadeEnd).add("waterDiffusion","float",.92).add("waterSeaColorMod","float",.8).add("correctionViewingPowerFactor","float",.4).add("skyZenitColor","vec3",[.52,.68,.9]).add("skyColor","vec3",[.67,.79,.9]).add("cloudFresnelModifier","vec2",[1.2,.01]);d.code.add(c.glsl`PBRShadingWater shadingInfo;
vec3 getSkyGradientColor(in float cosTheta, in vec3 horizon, in vec3 zenit) {
float exponent = pow((1.0 - cosTheta), fresnelSky[2]);
return mix(zenit, horizon, exponent);
}`);d.uniforms.add(new f.FloatPassUniform("lightingSpecularStrength",(w,v)=>v.lighting.mainLight.specularStrength),new f.FloatPassUniform("lightingEnvironmentStrength",(w,v)=>v.lighting.mainLight.environmentStrength));d.code.add(c.glsl`vec3 getSeaColor(in vec3 n, in vec3 v, in vec3 l, vec3 color, in vec3 lightIntensity, in vec3 localUp, in float shadow, float foamIntensity, vec3 viewPosition, vec3 position) {
float reflectionHit = 0.0;
float reflectionHitDiffused = 0.0;
vec3 seaWaterColor = linearizeGamma(color);
vec3 h = normalize(l + v);
shadingInfo.NdotL = clamp(dot(n, l), 0.0, 1.0);
shadingInfo.NdotV = clamp(dot(n, v), 0.001, 1.0);
shadingInfo.VdotN = clamp(dot(v, n), 0.001, 1.0);
shadingInfo.NdotH = clamp(dot(n, h), 0.0, 1.0);
shadingInfo.VdotH = clamp(dot(v, h), 0.0, 1.0);
shadingInfo.LdotH = clamp(dot(l, h), 0.0, 1.0);
float upDotV = max(dot(localUp,v), 0.0);
vec3 skyHorizon = linearizeGamma(skyColor);
vec3 skyZenit = linearizeGamma(skyZenitColor);
vec3 skyColor = getSkyGradientColor(upDotV, skyHorizon, skyZenit );
float upDotL = max(dot(localUp,l),0.0);
float daytimeMod = 0.1 + upDotL * 0.9;
skyColor *= daytimeMod;
float shadowModifier = clamp(shadow, 0.8, 1.0);
vec3 fresnelModifier = fresnelReflection(shadingInfo.VdotN, vec3(fresnelSky[0]), fresnelSky[1]);
vec3 reflSky = lightingEnvironmentStrength * fresnelModifier * skyColor * shadowModifier;
vec3 reflSea = seaWaterColor * mix(skyColor, upDotL * lightIntensity * LIGHT_NORMALIZATION, 2.0 / 3.0) * shadowModifier;
vec3 specular = vec3(0.0);
if(upDotV > 0.0 && upDotL > 0.0) {
vec3 specularSun = brdfSpecularWater(shadingInfo, roughness, vec3(fresnelMaterial[0]), fresnelMaterial[1]);
vec3 incidentLight = lightIntensity * LIGHT_NORMALIZATION * shadow;
specular = lightingSpecularStrength * shadingInfo.NdotL * incidentLight * specularSun;
}
vec3 foam = vec3(0.0);
if(upDotV > 0.0) {
foam = foamIntensity2FoamColor(foamIntensityExternal, foamIntensity, skyZenitColor, daytimeMod);
}
float correctionViewingFactor = pow(max(dot(v, localUp), 0.0), correctionViewingPowerFactor);
vec3 normalCorrectedClouds = mix(localUp, n, correctionViewingFactor);
vec3 reflectedWorld = normalize(reflect(-v, normalCorrectedClouds));`);t.hasCloudsReflections&&d.code.add(c.glsl`vec4 cloudsColor = renderClouds(reflectedWorld, position);
cloudsColor.a = 1.0 - cloudsColor.a;
cloudsColor = pow(cloudsColor, vec4(GAMMA));
cloudsColor *= clamp(fresnelModifier.y * cloudFresnelModifier[0] - cloudFresnelModifier[1], 0.0, 1.0) * clamp((1.0 - totalFadeInOut), 0.0, 1.0);`);t.hasScreenSpaceReflections?(d.uniforms.add(new e.Matrix4PassUniform("view",(w,v)=>v.camera.viewMatrix),new g.Texture2DPassUniform("lastFrameColorTexture",(w,v)=>v.ssr.lastFrameColor?.getTexture()),new f.FloatPassUniform("fadeFactorSSR",(w,v)=>v.ssr.fadeFactor)),d.code.add(c.glsl`vec3 viewDir = normalize(viewPosition);
vec4 viewNormalVectorCoordinate = view *vec4(n, 0.0);
vec3 viewNormal = normalize(viewNormalVectorCoordinate.xyz);
vec4 viewUp = view * vec4(localUp, 0.0);
vec3 viewNormalCorrectedSSR = mix(viewUp.xyz, viewNormal, correctionViewingFactor);
vec3 reflected = normalize(reflect(viewDir, viewNormalCorrectedSSR));
vec3 hitCoordinate = screenSpaceIntersection(reflected, viewPosition, viewDir, viewUp.xyz);
vec3 reflectedColor = vec3(0.0);
if (hitCoordinate.z > 0.0)
{
vec2 reprojectedCoordinate = reprojectionCoordinate(hitCoordinate);
vec2 dCoords = smoothstep(0.3, 0.6, abs(vec2(0.5, 0.5) - hitCoordinate.xy));
float heightMod = smoothstep(ssrHeightFadeEnd, ssrHeightFadeStart, -viewPosition.z);
reflectionHit = clamp(1.0 - (1.3 * dCoords.y), 0.0, 1.0) * heightMod * fadeFactorSSR;
reflectionHitDiffused = waterDiffusion * reflectionHit;
reflectedColor = linearizeGamma(texture(lastFrameColorTexture, reprojectedCoordinate).xyz) *
reflectionHitDiffused * fresnelModifier.y * ssrIntensity;
}
float seaColorMod = mix(waterSeaColorMod, waterSeaColorMod * 0.5, reflectionHitDiffused);
vec3 waterRenderedColor = tonemapACES((1.0 - reflectionHitDiffused) * reflSky + reflectedColor +
reflSea * seaColorMod + specular + foam);`)):d.code.add(c.glsl`vec3 waterRenderedColor = tonemapACES(reflSky + reflSea * waterSeaColorMod + specular + foam);`);t.hasCloudsReflections?t.hasScreenSpaceReflections?d.code.add(c.glsl`return waterRenderedColor * (1.0 - (1.0 - reflectionHit) * cloudsColor.a) + (1.0 - reflectionHit) * cloudsColor.xyz;
}`):d.code.add(c.glsl`return waterRenderedColor * (1.0 - cloudsColor.a) + cloudsColor.xyz;
}`):d.code.add(c.glsl`return waterRenderedColor;
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/FoamRendering.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.FoamColor=function(q){q.fragment.code.add(b.glsl`vec3 foamIntensity2FoamColor(float foamIntensityExternal, float foamPixelIntensity, vec3 skyZenitColor, float dayMod){
return foamIntensityExternal * (0.075 * skyZenitColor * pow(foamPixelIntensity, 4.) + 50.* pow(foamPixelIntensity, 23.0)) * dayMod;
}`)};a.FoamIntensity=function(q){q.fragment.code.add(b.glsl`float normals2FoamIntensity(vec3 n, float waveStrength){
float normalizationFactor = max(0.015, waveStrength);
return max((n.x + n.y)*0.3303545/normalizationFactor + 0.3303545, 0.0);
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl":function(){define("exports ../output/ReadDepth.glsl ../../shaderModules/Float2PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../shaderModules/Matrix4PassUniform ../../shaderModules/Texture2DPassUniform".split(" "),function(a,b,q,l,p,k,h){a.ScreenSpaceReflections=function(f,c){f=f.fragment;f.include(b.ReadDepth);
f.uniforms.add(new q.Float2PassUniform("nearFar",(e,g)=>g.camera.nearFar));f.uniforms.add(new h.Texture2DPassUniform("depthMap",(e,g)=>g.depth?.attachment));f.uniforms.add(new k.Matrix4PassUniform("proj",(e,g)=>g.camera.projectionMatrix));f.uniforms.add(new l.FloatPassUniform("invResolutionHeight",(e,g)=>1/g.camera.height));f.uniforms.add(new k.Matrix4PassUniform("reprojectionMatrix",(e,g)=>g.ssr.reprojectionMatrix));f.code.add(p.glsl`
vec2 reprojectionCoordinate(vec3 projectionCoordinate)
{
vec4 zw = proj * vec4(0.0, 0.0, -projectionCoordinate.z, 1.0);
vec4 reprojectedCoord = reprojectionMatrix * vec4(zw.w * (projectionCoordinate.xy * 2.0 - 1.0), zw.z, zw.w);
reprojectedCoord.xy /= reprojectedCoord.w;
return reprojectedCoord.xy * 0.5 + 0.5;
}
const int maxSteps = ${c.highStepCount?"150":"75"};
vec4 applyProjectionMat(mat4 projectionMat, vec3 x)
{
vec4 projectedCoord = projectionMat * vec4(x, 1.0);
projectedCoord.xy /= projectedCoord.w;
projectedCoord.xy = projectedCoord.xy*0.5 + 0.5;
return projectedCoord;
}
vec3 screenSpaceIntersection(vec3 dir, vec3 startPosition, vec3 viewDir, vec3 normal)
{
vec3 viewPos = startPosition;
vec3 viewPosEnd = startPosition;
// Project the start position to the screen
vec4 projectedCoordStart = applyProjectionMat(proj, viewPos);
vec3 Q0 = viewPos / projectedCoordStart.w; // homogeneous camera space
float k0 = 1.0/ projectedCoordStart.w;
// advance the position in the direction of the reflection
viewPos += dir;
vec4 projectedCoordVanishingPoint = applyProjectionMat(proj, dir);
// Project the advanced position to the screen
vec4 projectedCoordEnd = applyProjectionMat(proj, viewPos);
vec3 Q1 = viewPos / projectedCoordEnd.w; // homogeneous camera space
float k1 = 1.0/ projectedCoordEnd.w;
// calculate the reflection direction in the screen space
vec2 projectedCoordDir = (projectedCoordEnd.xy - projectedCoordStart.xy);
vec2 projectedCoordDistVanishingPoint = (projectedCoordVanishingPoint.xy - projectedCoordStart.xy);
float yMod = min(abs(projectedCoordDistVanishingPoint.y), 1.0);
float projectedCoordDirLength = length(projectedCoordDir);
float maxSt = float(maxSteps);
// normalize the projection direction depending on maximum steps
// this determines how blocky the reflection looks
vec2 dP = yMod * (projectedCoordDir)/(maxSt * projectedCoordDirLength);
// Normalize the homogeneous camera space coordinates
vec3 dQ = yMod * (Q1 - Q0)/(maxSt * projectedCoordDirLength);
float dk = yMod * (k1 - k0)/(maxSt * projectedCoordDirLength);
// initialize the variables for ray marching
vec2 P = projectedCoordStart.xy;
vec3 Q = Q0;
float k = k0;
float rayStartZ = -startPosition.z; // estimated ray start depth value
float rayEndZ = -startPosition.z; // estimated ray end depth value
float prevEstimateZ = -startPosition.z;
float rayDiffZ = 0.0;
float dDepth;
float depth;
float rayDiffZOld = 0.0;
// early outs
if (dot(normal, dir) < 0.0 || dot(-viewDir, normal) < 0.0)
return vec3(P, 0.0);
for(int i = 0; i < maxSteps-1; i++)
{
depth = -linearDepthFromTexture(depthMap, P); // get linear depth from the depth buffer
// estimate depth of the marching ray
rayStartZ = prevEstimateZ;
dDepth = -rayStartZ - depth;
rayEndZ = (dQ.z * 0.5 + Q.z)/ ((dk * 0.5 + k));
rayDiffZ = rayEndZ- rayStartZ;
prevEstimateZ = rayEndZ;
if(-rayEndZ > nearFar[1] || -rayEndZ < nearFar[0] || P.y < 0.0 || P.y > 1.0 )
{
return vec3(P, 0.);
}
// If we detect a hit - return the intersection point, two conditions:
// - dDepth > 0.0 - sampled point depth is in front of estimated depth
// - if difference between dDepth and rayDiffZOld is not too large
// - if difference between dDepth and 0.025/abs(k) is not too large
// - if the sampled depth is not behind far plane or in front of near plane
if((dDepth) < 0.025/abs(k) + abs(rayDiffZ) && dDepth > 0.0 && depth > nearFar[0] && depth < nearFar[1] && abs(P.y - projectedCoordStart.y) > invResolutionHeight)
{
return vec3(P, depth);
}
// continue with ray marching
P = clamp(P + dP, vec2(0.0), vec2(0.999));
Q.z += dQ.z;
k += dk;
rayDiffZOld = rayDiffZ;
}
return vec3(P, 0.0);
}
`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/TextureOnly.glsl":function(){define("exports ../core/libs/gl-matrix-2/factories/vec3f64 ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),function(a,b,
q,l,p,k,h){function f(){const g=new k.ShaderBuilder;g.include(q.ScreenSpacePass);g.fragment.uniforms.add(new h.Texture2DPassUniform("tex",d=>d.texture),new l.Float3PassUniform("uColor",d=>d.color));g.fragment.code.add(p.glsl`void main() {
vec4 texColor = texture(tex, uv);
fragColor = texColor * vec4(uColor, 1.0);
}`);return g}class c extends p.NoParameters{constructor(){super(...arguments);this.color=b.fromValues(1,1,1)}}const e=Object.freeze(Object.defineProperty({__proto__:null,TextureOnlyPassParameters:c,build:f},Symbol.toStringTag,{value:"Module"}));a.TextureOnly=e;a.TextureOnlyPassParameters=c;a.build=f})},"esri/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository":function(){define(["exports","../../../../../core/NestedMap","./ShaderTechniqueConfiguration"],function(a,b,q){class l{constructor(h){this._context=
h;this._perConstructorInstances=new b.NestedMap;this._frameCounter=0;this._keepAliveFrameCount=-1}get viewingMode(){return this._context.viewingMode}get constructionContext(){return this._context}destroy(){this._perConstructorInstances.forEach(h=>h.forEach(f=>f.technique.destroy()));this._perConstructorInstances.clear()}acquire(h,f=k){const c=f.key;let e=this._perConstructorInstances.get(h,c);if(null==e){const g=new h(this._context,f,()=>this.release(g));e=new p(g);this._perConstructorInstances.set(h,
c,e)}++e.refCount;return e.technique}releaseAndAcquire(h,f,c){if(null!=c){if(f.key===c.key)return c;this.release(c)}return this.acquire(h,f)}release(h){null==h||this._perConstructorInstances.empty||(h=this._perConstructorInstances.get(h.constructor,h.key),null!=h&&(--h.refCount,0===h.refCount&&(h.refZeroFrame=this._frameCounter)))}frameUpdate(){this._frameCounter++;-1!==this._keepAliveFrameCount&&this._perConstructorInstances.forEach((h,f)=>{h.forEach((c,e)=>{0===c.refCount&&c.refZeroFrame+this._keepAliveFrameCount<
this._frameCounter&&(c.technique.destroy(),this._perConstructorInstances.delete(f,e))})})}async reloadAll(){const h=[];this._perConstructorInstances.forEach((f,c)=>{h.push((async(e,g)=>{if(g=g.shader)await g.reload(),e.forEach(d=>d.technique.reload(this._context))})(f,c))});await Promise.all(h)}}class p{constructor(h){this.technique=h;this.refZeroFrame=this.refCount=0}}const k=new q.ShaderTechniqueConfiguration;a.ShaderTechniqueRepository=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/lib/GLMaterialRepository":function(){define(["exports","../../../../core/Logger","../../../../core/maybe","../../../../core/NestedMap","./Util"],function(a,b,q,l,p){class k{constructor(f,c,e,g){this._textures=f;this._techniques=c;this.materialChanged=e;this.requestRender=g;this._id2glMaterialRef=new l.NestedMap}dispose(){this._textures.destroy()}acquire(f,c,e){this._ownMaterial(f);if(!f.produces.get(c)?.(e))return null;c=this._id2glMaterialRef.get(e,f.id);null==c&&(c=f.createGLMaterial({material:f,
techniques:this._techniques,textures:this._textures,output:e}),c=new h(c),this._id2glMaterialRef.set(e,f.id,c));c.ref();return c.glMaterial}release(f,c){const e=this._id2glMaterialRef.get(c,f.id);null!=e&&(e.unref(),e.referenced||(q.disposeMaybe(e.glMaterial),this._id2glMaterialRef.delete(c,f.id)))}_ownMaterial(f){f.repository&&f.repository!==this&&b.getLogger("esri.views.3d.webgl-engine.lib.GLMaterialRepository").error("Material is already owned by a different material repository");f.repository=
this}}class h{constructor(f){this.glMaterial=f;this._refCnt=0}ref(){++this._refCnt}unref(){--this._refCnt;p.assert(0<=this._refCnt)}get referenced(){return 0<this._refCnt}}a.GLMaterialRepository=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/GridLocalOriginFactory":function(){define("exports ../../../../core/has ../../../../core/uid ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/projection/projectBuffer ./Attribute ./ContentObjectType ./Geometry ./LocalOriginFactory ./Object3D ./testUtils ./VertexAttribute ./WebGLLayer ../materials/RibbonLineMaterial".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){class r{constructor(u){this._originSR=u;this._rootOriginId="root/"+q.generateUID();this._origins=new Map;this._objects=new Map;this._gridSize=5E5}getOrigin(u){var x=this._origins.get(this._rootOriginId);if(null==x){x=t.gridLocalOriginFactory.rootOrigin;if(null!=x)return this._origins.set(this._rootOriginId,g.fromValues(x[0],x[1],x[2],this._rootOriginId)),this.getOrigin(u);u=g.fromValues(u[0]+Math.random()-.5,u[1]+Math.random()-.5,u[2]+Math.random()-.5,this._rootOriginId);
this._origins.set(this._rootOriginId,u);return u}var y=this._gridSize;const z=Math.round(u[0]/y),A=Math.round(u[1]/y),B=Math.round(u[2]/y),C=`${z}/${A}/${B}`;let D=this._origins.get(C);const F=.5*y;l.subtract(n,u,x.vec3);n[0]=Math.abs(n[0]);n[1]=Math.abs(n[1]);n[2]=Math.abs(n[2]);if(n[0]<F&&n[1]<F&&n[2]<F)return D&&(y=Math.max(...n),l.subtract(n,u,D.vec3),n[0]=Math.abs(n[0]),n[1]=Math.abs(n[1]),n[2]=Math.abs(n[2]),Math.max(...n)<y)?D:x;D||(D=g.fromValues(z*y,A*y,B*y,C),this._origins.set(C,D));return D}_drawOriginBox(u,
x=k.fromValues(1,1,0,1)){const y=window.view,z=y._stage;var A=x.toString();if(!this._objects.has(A)){this._material=new m.RibbonLineMaterial({width:2,color:x});z.add(this._material);x=new v.WebGLLayer(z,{pickable:!1});var B=new d.Object3D({castShadow:!1});z.add(B);x.add(B);this._objects.set(A,B)}A=this._objects.get(A);x=[0,1,5,4,0,2,1,7,6,2,0,1,3,7,5,4,6,2,0];B=x.length;const C=Array(3*B),D=[],F=.5*this._gridSize;for(let H=0;H<B;H++)C[3*H]=u[0]+(x[H]&1?F:-F),C[3*H+1]=u[1]+(x[H]&2?F:-F),C[3*H+2]=u[2]+
(x[H]&4?F:-F),0<H&&D.push(H-1,H);h.projectBuffer(C,this._originSR,0,C,y.renderSpatialReference,0,B);u=new e.Geometry(this._material,[[w.VertexAttribute.POSITION,new f.Attribute(C,D,3,!0)]],null,c.ContentObjectType.Line);z.add(u);A.addGeometry(u)}get test(){}}const n=p.create();a.GridLocalOriginFactory=r;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/testUtils":function(){define(["exports"],function(a){a.gridLocalOriginFactory={rootOrigin:null};a.textTextureAtlas=
{stableRendering:!1};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/WebGLLayer":function(){define("exports ../../../../core/Evented ../../../../core/Handles ../../../../core/maybe ../../../../core/PooledArray ./ContentObject ./ContentObjectType ./DirtyEvents ./Octree ./UpdatePolicy".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g extends k.ContentObject{get objects(){return this._objects}constructor(d,t,w=""){super();this.stage=d;this.apiLayerUid=
w;this.type=h.ContentObjectType.Layer;this.events=new b;this.pickable=this.visible=!0;this.sliceable=!1;this._objects=new p;this._objectsAdded=new p;this._handles=new q;this.apiLayerUid=w;this.visible=t?.visible??!0;this.pickable=t?.pickable??!0;this.updatePolicy=t?.updatePolicy??e.UpdatePolicy.ASYNC;this._disableOctree=t?.disableOctree??!1;d.add(this);for(const v of f.DirtyEventNames)this._handles.add(this.events.on(v,m=>d.handleEvent(v,m)))}destroy(){this._handles.size&&(this._handles.destroy(),
this.stage.remove(this),this.invalidateSpatialQueryAccelerator())}add(d){this._objects.push(d);d.parentLayer=this;this.events.emit("layerObjectAdded",{layer:this,object:d});null!=this._octree&&this._objectsAdded.push(d)}remove(d){this._objects.removeUnordered(d)&&(d.parentLayer=null,this.events.emit("layerObjectRemoved",{layer:this,object:d}),null!=this._octree&&(this._objectsAdded.removeUnordered(d)||this._octree.remove([d])))}addMany(d){this._objects.pushArray(d);for(const t of d)t.parentLayer=
this;this.events.emit("layerObjectsAdded",{layer:this,objects:d});null!=this._octree&&this._objectsAdded.pushArray(d)}removeMany(d){const t=[];this._objects.removeUnorderedMany(d,d.length,t);if(0!==t.length){for(const w of t)w.parentLayer=null;this.events.emit("layerObjectsRemoved",{layer:this,objects:t});if(null!=this._octree){for(d=0;d<t.length;)this._objectsAdded.removeUnordered(t[d])?(t[d]=t[t.length-1],--t.length):++d;this._octree.remove(t)}}}sync(){this.updatePolicy!==e.UpdatePolicy.SYNC&&this.stage.syncLayer(this.id)}notifyObjectBBChanged(d,
t){null==this._octree||this._objectsAdded.includes(d)||this._octree.update(d,t)}getSpatialQueryAccelerator(){null==this._octree&&50<this._objects.length&&!this._disableOctree?(this._octree=new c(d=>d.boundingVolumeWorldSpace.bounds),this._octree.add(this._objects.data,this._objects.length)):null!=this._octree&&0<this._objectsAdded.length&&(this._octree.add(this._objectsAdded.data,this._objectsAdded.length),this._objectsAdded.clear());return this._octree}invalidateSpatialQueryAccelerator(){this._octree=
l.destroyMaybe(this._octree);this._objectsAdded.clear()}}a.WebGLLayer=g;a.isWebGLLayer=function(d){return null!=d&&d.type===h.ContentObjectType.Layer};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/DirtyEvents":function(){define(["exports"],function(a){a.DirtyEventNames="layerObjectAdded layerObjectRemoved layerObjectsAdded layerObjectsRemoved transformationChanged shaderTransformationChanged visibilityChanged occlusionChanged highlightChanged geometryAdded geometryRemoved attributesChanged".split(" ");
Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Octree":function(){define("../../../../core/ObjectPool ../../../../core/PooledArray ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/frustum ../../../../geometry/support/ray ../../../../chunks/sphere ./Util".split(" "),function(a,b,q,l,p,k,h,f){function c(Q,W){Q=A.acquire().init(Q);const S=[Q];for(;0!==S.length;){Q=S.pop();if(W(Q)&&!Q.isLeaf())for(let V=
0;V<Q.node.children.length;V++)Q.node.children[V]&&S.push(A.acquire().init(Q).advance(V));A.release(Q)}}function e(Q,W,S,V=z.DepthOrder.FRONT_TO_BACK){Q=A.acquire().init(Q);const T=[Q];for(n(S,V,R);0!==T.length;){Q=T.pop();if(W(Q)&&!Q.isLeaf())for(S=7;0<=S;--S)V=R[S],Q.node.children[V]&&T.push(A.acquire().init(Q).advance(V));A.release(Q)}}function g(Q,W,S){I.clear();W=S.advanceTo(W,(V,T)=>{I.push(V.node);I.push(T)})?S.node.terminals:S.node.residents;W.removeUnordered(Q);if(0===W.length)for(Q=I.length-
2;0<=Q&&d(I.data[Q],I.data[Q+1]);Q-=2);}function d(Q,W){0<=W&&(Q.children[W]=null);return v(Q)?(null===Q.residents&&(Q.residents=new b({shrink:!0})),!0):!1}function t(Q,W){m(h.getCenter(W.bounds),2*-W.halfSize,E);m(h.getCenter(W.bounds),2*W.halfSize,G);return f.rayBoxTest(Q.origin,Q.direction,E,G)}function w(Q,W,S){m(h.getCenter(W.bounds),2*-W.halfSize,E);m(h.getCenter(W.bounds),2*W.halfSize,G);S.applyToMinMax(E,G);return f.rayBoxTest(Q.origin,Q.direction,E,G)}function v(Q){if(0!==Q.terminals.length)return!1;
if(null!==Q.residents)return 0===Q.residents.length;for(let W=0;W<Q.children.length;W++)if(Q.children[W])return!1;return!0}function m(Q,W,S){S[0]=Q[0]+W;S[1]=Q[1]+W;S[2]=Q[2]+W}function r(Q,W,S,V){if(1===W)Q=S(Q[0]),h.copy(Q,V);else{E[0]=Infinity;E[1]=Infinity;E[2]=Infinity;G[0]=-Infinity;G[1]=-Infinity;G[2]=-Infinity;for(let ba=0;ba<W;ba++){var T=S(Q[ba]);if(y(T[3])){var Y=E,ha=T;Y[0]=Math.min(Y[0],ha[0]-ha[3]);Y[1]=Math.min(Y[1],ha[1]-ha[3]);Y[2]=Math.min(Y[2],ha[2]-ha[3]);Y=G;Y[0]=Math.max(Y[0],
T[0]+T[3]);Y[1]=Math.max(Y[1],T[1]+T[3]);Y[2]=Math.max(Y[2],T[2]+T[3])}}q.lerp(h.getCenter(V),E,G,.5);V[3]=Math.max(G[0]-E[0],G[1]-E[1],G[2]-E[2])/2}}function n(Q,W,S){if(!J.length)for(var V=0;8>V;++V)J.push({index:0,distance:0});for(V=0;8>V;++V){const T=B[V];J.data[V].index=V;J.data[V].distance=x(Q,W,T)}J.sort((T,Y)=>T.distance-Y.distance);for(Q=0;8>Q;++Q)S[Q]=J.data[Q].index}function u(Q,W){let S=Infinity,V;for(let T=0;8>T;++T){const Y=x(Q,W,C[T]);Y<S&&(S=Y,V=C[T])}return V}function x(Q,W,S){return W*
(Q[0]*S[0]+Q[1]*S[1]+Q[2]*S[2])}function y(Q){return!isNaN(Q)&&-Infinity!==Q&&Infinity!==Q&&0<Q}class z{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(Q,W){this.objectToBoundingSphere=Q;this._maximumObjectsPerNode=10;this._maximumDepth=20;this._degenerateObjects=new Set;
this._root=new A;this._objectCount=0;W&&(void 0!==W.maximumObjectsPerNode&&(this._maximumObjectsPerNode=W.maximumObjectsPerNode),void 0!==W.maximumDepth&&(this._maximumDepth=W.maximumDepth))}destroy(){this._degenerateObjects.clear();A.clearPool();F[0]=null;I.prune();J.prune()}add(Q,W=Q.length){this._objectCount+=W;this._grow(Q,W);const S=A.acquire();for(let V=0;V<W;V++){const T=Q[V];this._isDegenerate(T)?this._degenerateObjects.add(T):(S.init(this._root),this._add(T,S))}A.release(S)}remove(Q,W=null){this._objectCount-=
Q.length;const S=A.acquire();for(const V of Q)Q=W??h.copy(this.objectToBoundingSphere(V),O),y(Q[3])?(S.init(this._root),g(V,Q,S)):this._degenerateObjects.delete(V);A.release(S);this._shrink()}update(Q,W){if(y(W[3])||!this._isDegenerate(Q))F[0]=Q,Q=F,this.remove(Q,W),this.add(Q)}forEachAlongRay(Q,W,S){const V=k.wrap(Q,W);c(this._root,T=>{if(!t(V,T))return!1;T=T.node;T.terminals.forAll(Y=>{this._intersectsObject(V,Y)&&S(Y)});null!==T.residents&&T.residents.forAll(Y=>{this._intersectsObject(V,Y)&&S(Y)});
return!0})}forEachAlongRayWithVerticalOffset(Q,W,S,V){const T=k.wrap(Q,W);c(this._root,Y=>{if(!w(T,Y,V))return!1;Y=Y.node;Y.terminals.forAll(ha=>{this._intersectsObjectWithOffset(T,ha,V)&&S(ha)});null!==Y.residents&&Y.residents.forAll(ha=>{this._intersectsObjectWithOffset(T,ha,V)&&S(ha)});return!0})}forEach(Q){c(this._root,W=>{W=W.node;W.terminals.forAll(Q);null!==W.residents&&W.residents.forAll(Q);return!0});this._degenerateObjects.forEach(Q)}forEachDegenerateObject(Q){this._degenerateObjects.forEach(Q)}findClosest(Q,
W,S,V=()=>!0,T=Infinity){let Y=Infinity,ha=Infinity,ba=null;const U=u(Q,W),Z=ca=>{--T;if(V(ca)){var ea=this.objectToBoundingSphere(ca);if(p.intersectsSphere(S,ea)){var da=x(Q,W,h.getCenter(ea)),ia=da-ea[3];ea=da+ea[3];ia<Y&&(Y=ia,ha=ea,ba=ca)}}};e(this._root,ca=>{if(0>=T||!p.intersectsSphere(S,ca.bounds))return!1;q.scale(N,U,ca.halfSize);q.add(N,N,h.getCenter(ca.bounds));if(x(Q,W,N)>ha)return!1;ca=ca.node;ca.terminals.forAll(ea=>Z(ea));null!==ca.residents&&ca.residents.forAll(ea=>Z(ea));return!0},
Q,W);return ba}forEachInDepthRange(Q,W,S,V,T,Y,ha){let ba=-Infinity,U=Infinity;const Z={setRange:ka=>{S===z.DepthOrder.FRONT_TO_BACK?(ba=Math.max(ba,ka.near),U=Math.min(U,ka.far)):(ba=Math.max(ba,-ka.far),U=Math.min(U,-ka.near))}};Z.setRange(V);const ca=x(W,S,Q),ea=u(W,S),da=u(W,-S),ia=ka=>{if(ha(ka)){var fa=this.objectToBoundingSphere(ka),X=h.getCenter(fa);X=x(W,S,X)-ca;var ja=X+fa[3];X-fa[3]>U||ja<ba||!p.intersectsSphere(Y,fa)||T(ka,Z)}};e(this._root,ka=>{if(!p.intersectsSphere(Y,ka.bounds))return!1;
q.scale(N,ea,ka.halfSize);q.add(N,N,h.getCenter(ka.bounds));if(x(W,S,N)-ca>U)return!1;q.scale(N,da,ka.halfSize);q.add(N,N,h.getCenter(ka.bounds));if(x(W,S,N)-ca<ba)return!1;ka=ka.node;ka.terminals.forAll(fa=>ia(fa));null!==ka.residents&&ka.residents.forAll(fa=>ia(fa));return!0},W,S)}forEachNode(Q){c(this._root,W=>Q(W.node,W.bounds,W.halfSize,W.depth))}forEachNeighbor(Q,W){const S=h.getRadius(W),V=h.getCenter(W),T=ba=>{const U=this.objectToBoundingSphere(ba);var Z=h.getRadius(U);Z=S+Z;return 0>=q.squaredDistance(h.getCenter(U),
V)-Z*Z?Q(ba):!0};let Y=!0;const ha=ba=>{Y&&=T(ba)};c(this._root,ba=>{var U=h.getRadius(ba.bounds);U=S+U;if(0<q.squaredDistance(h.getCenter(ba.bounds),V)-U*U)return!1;ba=ba.node;ba.terminals.forAll(ha);Y&&null!==ba.residents&&ba.residents.forAll(ha);return Y});Y&&this.forEachDegenerateObject(ha)}_intersectsObject(Q,W){W=this.objectToBoundingSphere(W);return 0<W[3]?h.intersectsRay(W,Q):!0}_intersectsObjectWithOffset(Q,W,S){W=this.objectToBoundingSphere(W);return 0<W[3]?h.intersectsRay(S.applyToBoundingSphere(W),
Q):!0}_add(Q,W){W.advanceTo(this.objectToBoundingSphere(Q))?W.node.terminals.push(Q):(W.node.residents.push(Q),W.node.residents.length>this._maximumObjectsPerNode&&W.depth<this._maximumDepth&&this._split(W))}_split(Q){const W=Q.node.residents;Q.node.residents=null;for(let S=0;S<W.length;S++){const V=A.acquire().init(Q);this._add(W.at(S),V);A.release(V)}}_grow(Q,W){0!==W&&(r(Q,W,S=>this.objectToBoundingSphere(S),L),y(L[3])&&!this._fitsInsideTree(L)&&(v(this._root.node)?(h.copy(L,this._root.bounds),
this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize()):(Q=this._rootBoundsForRootAsSubNode(L),this._placingRootViolatesMaxDepth(Q)?this._rebuildTree(L,Q):this._growRootAsSubNode(Q),A.release(Q))))}_rebuildTree(Q,W){q.copy(h.getCenter(P),h.getCenter(W.bounds));P[3]=W.halfSize;r([Q,P],2,S=>S,M);Q=A.acquire().init(this._root);this._root.initFrom(null,M,M[3]);this._root.increaseHalfSize(1.25);c(Q,S=>{this.add(S.node.terminals.data,S.node.terminals.length);null!==S.node.residents&&
this.add(S.node.residents.data,S.node.residents.length);return!0});A.release(Q)}_placingRootViolatesMaxDepth(Q){const W=Math.log(Q.halfSize/this._root.halfSize)*Math.LOG2E;let S=0;c(this._root,V=>{S=Math.max(S,V.depth);return S+W<=this._maximumDepth});return S+W>this._maximumDepth}_rootBoundsForRootAsSubNode(Q){var W=Q[3],S=-Infinity;const V=this._root.bounds,T=this._root.halfSize;for(var Y=0;3>Y;Y++){var ha=Math.max(0,Math.ceil((V[Y]-T-(Q[Y]-W))/(2*T)));const ba=Math.max(0,Math.ceil((Q[Y]+W-(V[Y]+
T))/(2*T)))+1;S=Math.max(S,2**Math.ceil(Math.log(ha+ba)*Math.LOG2E));K[Y].min=ha;K[Y].max=ba}for(Q=0;3>Q;Q++)W=K[Q].min,Y=K[Q].max,ha=(S-(W+Y))/2,W+=Math.ceil(ha),Y+=Math.floor(ha),H[Q]=V[Q]-T-W*T*2+(Y+W)*T;S*=T;H[3]=S*D;return A.acquire().initFrom(null,H,S,0)}_growRootAsSubNode(Q){const W=this._root.node;q.copy(h.getCenter(L),h.getCenter(this._root.bounds));L[3]=this._root.halfSize;this._root.init(Q);Q.advanceTo(L,null,!0);Q.node.children=W.children;Q.node.residents=W.residents;Q.node.terminals=
W.terminals}_shrink(){for(;;){const Q=this._findShrinkIndex();if(-1===Q)break;this._root.advance(Q);this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let Q=null;const W=this._root.node.children;let S=0,V=0;for(;V<W.length&&null==Q;)S=V++,Q=W[S];for(;V<W.length;)if(W[V++])return-1;return S}_isDegenerate(Q){Q=this.objectToBoundingSphere(Q)[3];return!y(Q)}_fitsInsideTree(Q){const W=this._root.bounds,S=this._root.halfSize;return Q[3]<=S&&Q[0]>=
W[0]-S&&Q[0]<=W[0]+S&&Q[1]>=W[1]-S&&Q[1]<=W[1]+S&&Q[2]>=W[2]-S&&Q[2]<=W[2]+S}toJSON(){const {maximumDepth:Q,maximumObjectsPerNode:W,_objectCount:S}=this,V=this._nodeToJSON(this._root.node);return{maximumDepth:Q,maximumObjectsPerNode:W,objectCount:S,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:V}}}_nodeToJSON(Q){const W=Q.children.map(V=>V?this._nodeToJSON(V):null),S=Q.residents?.map(V=>this.objectToBoundingSphere(V));Q=Q.terminals?.map(V=>this.objectToBoundingSphere(V));
return{children:W,residents:S,terminals:Q}}static fromJSON(Q){const W=new z(S=>S,{maximumDepth:Q.maximumDepth,maximumObjectsPerNode:Q.maximumObjectsPerNode});W._objectCount=Q.objectCount;W._root.initFrom(Q.root.node,Q.root.bounds,Q.root.halfSize,Q.root.depth);return W}}class A{constructor(){this.bounds=h.create();this.halfSize=0;this.initFrom(null,null,0,0)}init(Q){return this.initFrom(Q.node,Q.bounds,Q.halfSize,Q.depth)}initFrom(Q,W,S,V=this.depth){this.node=null!=Q?Q:A.createEmptyNode();W&&h.copy(W,
this.bounds);this.halfSize=S;this.depth=V;return this}increaseHalfSize(Q){this.halfSize*=Q;this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*D}advance(Q){let W=this.node.children[Q];W||(W=A.createEmptyNode(),this.node.children[Q]=W);this.node=W;this.halfSize/=2;this.depth++;Q=B[Q];this.bounds[0]+=Q[0]*this.halfSize;this.bounds[1]+=Q[1]*this.halfSize;this.bounds[2]+=Q[2]*this.halfSize;this.updateBoundsRadiusFromHalfSize();return this}advanceTo(Q,W,
S=!1){for(;;){if(this.isTerminalFor(Q))return W&&W(this,-1),!0;if(this.isLeaf()){if(!S)return W&&W(this,-1),!1;this.node.residents=null}const V=this._childIndex(Q);W&&W(this,V);this.advance(V)}}isLeaf(){return null!=this.node.residents}isTerminalFor(Q){return Q[3]>this.halfSize/2}_childIndex(Q){const W=this.bounds;return(W[0]<Q[0]?1:0)+(W[1]<Q[1]?2:0)+(W[2]<Q[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new b({shrink:!0}),residents:new b({shrink:!0})}}static acquire(){return A._pool.acquire()}static release(Q){A._pool.release(Q)}static clearPool(){A._pool.prune()}}
A._pool=new a(A);(function(Q){Q=Q.DepthOrder||(Q.DepthOrder={});Q[Q.FRONT_TO_BACK=1]="FRONT_TO_BACK";Q[Q.BACK_TO_FRONT=-1]="BACK_TO_FRONT"})(z||={});const B=[l.fromValues(-1,-1,-1),l.fromValues(1,-1,-1),l.fromValues(-1,1,-1),l.fromValues(1,1,-1),l.fromValues(-1,-1,1),l.fromValues(1,-1,1),l.fromValues(-1,1,1),l.fromValues(1,1,1)],C=[l.fromValues(-1,-1,-1),l.fromValues(-1,-1,1),l.fromValues(-1,1,-1),l.fromValues(-1,1,1),l.fromValues(1,-1,-1),l.fromValues(1,-1,1),l.fromValues(1,1,-1),l.fromValues(1,
1,1)],D=Math.sqrt(3),F=[null],H=h.create(),N=l.create(),E=l.create(),G=l.create(),I=new b,O=h.create(),L=h.create(),P=h.create(),M=h.create(),K=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],J=new b,R=[0,0,0,0,0,0,0,0];return z})},"esri/views/3d/webgl-engine/lib/UpdatePolicy":function(){define(["exports"],function(a){a.UpdatePolicy=void 0;var b=a.UpdatePolicy||(a.UpdatePolicy={});b[b.ASYNC=0]="ASYNC";b[b.SYNC=1]="SYNC";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/RibbonLineMaterial":function(){define("exports ../../../../core/has ../../../../core/Logger ../../../../core/mathUtils ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/support/frustum ../../../../geometry/support/lineSegment ../../../../geometry/support/plane ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../lib/GLMaterial ../lib/Material ../lib/RenderSlot ../lib/Util ../lib/VertexAttribute ./VisualVariablePassParameters ../shaders/LineMarkerTechniqueConfiguration ../../../../chunks/RibbonLine.glsl ../shaders/RibbonLineTechnique ../shaders/RibbonLineTechniqueConfiguration".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){function C(ea,da,ia,ka,fa){for(let X=0;X<fa;X++)ia[ka++]=ea[da++];return ka}var D;(function(ea){ea[ea.LEFT_JOIN_START=-2]="LEFT_JOIN_START";ea[ea.LEFT_JOIN_END=-1]="LEFT_JOIN_END";ea[ea.LEFT_CAP_START=-4]="LEFT_CAP_START";ea[ea.LEFT_CAP_END=-5]="LEFT_CAP_END";ea[ea.RIGHT_JOIN_START=2]="RIGHT_JOIN_START";ea[ea.RIGHT_JOIN_END=1]="RIGHT_JOIN_END";ea[ea.RIGHT_CAP_START=4]="RIGHT_CAP_START";ea[ea.RIGHT_CAP_END=5]="RIGHT_CAP_END"})(D||={});class F extends m.Material{constructor(ea){super(ea,
new N);this._configuration=new B.RibbonLineTechniqueConfiguration;this.produces=new Map([[r.RenderSlot.OPAQUE_MATERIAL,da=>da===w.ShaderOutput.Highlight||da===w.ShaderOutput.ObjectAndLayerIdColor||da===w.ShaderOutput.Color&&this.parameters.renderOccluded===m.RenderOccludedFlag.OccludeAndTransparentStencil],[r.RenderSlot.OPAQUE_NO_SSAO_DEPTH,da=>w.isDepth(da)],[r.RenderSlot.OCCLUDER_MATERIAL,da=>w.isColorHighlightOIDOrDepth(da)&&this.parameters.renderOccluded===m.RenderOccludedFlag.OccludeAndTransparentStencil],
[r.RenderSlot.TRANSPARENT_OCCLUDER_MATERIAL,da=>w.isColorHighlightOIDOrDepth(da)&&this.parameters.renderOccluded===m.RenderOccludedFlag.OccludeAndTransparentStencil],[r.RenderSlot.TRANSPARENT_MATERIAL,da=>da===w.ShaderOutput.Color&&this.parameters.writeDepth&&this.parameters.renderOccluded!==m.RenderOccludedFlag.OccludeAndTransparentStencil],[r.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,da=>da===w.ShaderOutput.Color&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==m.RenderOccludedFlag.OccludeAndTransparentStencil],
[r.RenderSlot.DRAPED_MATERIAL,da=>w.is2DGeometryOutput(da)]]);this._vertexAttributeLocations=A.vertexAttributeLocations}getConfiguration(ea,da){this._configuration.output=ea;this._configuration.draped=da.slot===r.RenderSlot.DRAPED_MATERIAL;ea=null!=this.parameters.stipplePattern&&ea!==w.ShaderOutput.Highlight;this._configuration.stippleEnabled=ea;this._configuration.stippleOffColorEnabled=ea&&null!=this.parameters.stippleOffColor;this._configuration.stipplePreferContinuous=ea&&this.parameters.stipplePreferContinuous;
this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.hasOccludees=this.parameters.hasOccludees;this._configuration.roundJoins="round"===this.parameters.join;this._configuration.capType=this.parameters.cap;ea=this._configuration;if(null!=this.parameters.markerParameters){var ia=this.parameters.markerParameters;ia=ia.anchor===y.LineMarkerAnchor.Tip&&ia.hideOnShortSegments&&"begin-end"===ia.placement&&ia.worldSpace}else ia=!1;ea.applyMarkerOffset=ia;this._configuration.hasPolygonOffset=
this.parameters.hasPolygonOffset;this._configuration.writeDepth=this.parameters.writeDepth;this._configuration.vvSize=!!this.parameters.vvSize;this._configuration.vvColor=!!this.parameters.vvColor;this._configuration.vvOpacity=!!this.parameters.vvOpacity;this._configuration.innerColorEnabled=0<this.parameters.innerWidth&&null!=this.parameters.innerColor;this._configuration.falloffEnabled=0<this.parameters.falloff;this._configuration.occluder=this.parameters.renderOccluded===m.RenderOccludedFlag.OccludeAndTransparentStencil;
this._configuration.transparencyPassType=da.transparencyPassType;this._configuration.multipassEnabled=da.multipassEnabled;this._configuration.cullAboveGround=da.multipassTerrain.cullAboveGround;this._configuration.wireframe=this.parameters.wireframe;return this._configuration}intersectDraped(ea,da,ia,ka,fa,X){if(ia.options.selectionMode){da=ea.attributes.get(u.VertexAttribute.POSITION).data;ia=ea.attributes.get(u.VertexAttribute.SIZE);var ja=this.parameters.width;this.parameters.vvSize?(ia=ea.attributes.get(u.VertexAttribute.SIZEFEATUREATTRIBUTE).data[0],
ja*=l.clamp(this.parameters.vvSize.offset[0]+ia*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])):ia&&(ja*=ia.data[0]);ia=ka[0];ka=ka[1];ea=(ja/2+4)*ea.screenToWorldRatio;ja=Number.MAX_VALUE;var la=0;for(let Da=0;Da<da.length-5;Da+=3){var na=da[Da],va=da[Da+1],za=ia-na,ya=ka-va;na=da[Da+3]-na;va=da[Da+4]-va;const ra=l.clamp((na*za+va*ya)/(na*na+va*va),0,1);za=na*ra-za;ya=va*ra-ya;ya=za*za+ya*ya;ya<ja&&(ja=ya,la=Da/3)}ja<ea*ea&&fa(X.dist,X.normal,
la,!1)}}intersect(ea,da,ia,ka,fa,X){if(ia.options.selectionMode&&ea.visible)if(n.isTranslationMatrix(da)){var ja=ea.attributes;ka=ja.get(u.VertexAttribute.POSITION).data;ea=this.parameters.width;this.parameters.vvSize?(fa=ja.get(u.VertexAttribute.SIZEFEATUREATTRIBUTE).data[0],ea*=l.clamp(this.parameters.vvSize.offset[0]+fa*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])):ja.has(u.VertexAttribute.SIZE)&&(ea*=ja.get(u.VertexAttribute.SIZE).data[0]);
var la=ia.camera,na=P;k.copy(na,ia.point);fa=ea*la.pixelRatio/2+4*la.pixelRatio;h.set(Y[0],na[0]-fa,na[1]+fa,0);h.set(Y[1],na[0]+fa,na[1]+fa,0);h.set(Y[2],na[0]+fa,na[1]-fa,0);h.set(Y[3],na[0]-fa,na[1]-fa,0);for(ea=0;4>ea;ea++)if(!la.unprojectFromRenderScreen(Y[ea],ha[ea]))return;d.fromPoints(la.eye,ha[0],ha[1],ba);d.fromPoints(la.eye,ha[1],ha[2],U);d.fromPoints(la.eye,ha[2],ha[3],Z);d.fromPoints(la.eye,ha[3],ha[0],ca);var va=Number.MAX_VALUE;ea=0;ja=this.parameters.isClosed&&2<ja.get(u.VertexAttribute.POSITION).indices.length?
ka.length-2:ka.length-5;for(let ya=0;ya<ja;ya+=3){G[0]=ka[ya]+da[12];G[1]=ka[ya+1]+da[13];G[2]=ka[ya+2]+da[14];var za=(ya+3)%ka.length;I[0]=ka[za]+da[12];I[1]=ka[za+1]+da[13];I[2]=ka[za+2]+da[14];if(!(0>d.signedDistance(ba,G)&&0>d.signedDistance(ba,I)||0>d.signedDistance(U,G)&&0>d.signedDistance(U,I)||0>d.signedDistance(Z,G)&&0>d.signedDistance(Z,I)||0>d.signedDistance(ca,G)&&0>d.signedDistance(ca,I))){la.projectToRenderScreen(G,M);la.projectToRenderScreen(I,K);if(0>M[2]&&0<K[2])h.subtract(O,G,I),
za=la.frustum,za=-d.signedDistance(za[e.PlaneIndex.NEAR],G)/h.dot(O,d.getNormal(za[e.PlaneIndex.NEAR])),h.scale(O,O,za),h.add(G,G,O),la.projectToRenderScreen(G,M);else if(0<M[2]&&0>K[2])h.subtract(O,I,G),za=la.frustum,za=-d.signedDistance(za[e.PlaneIndex.NEAR],I)/h.dot(O,d.getNormal(za[e.PlaneIndex.NEAR])),h.scale(O,O,za),h.add(I,I,O),la.projectToRenderScreen(I,K);else if(0>M[2]&&0>K[2])continue;M[2]=0;K[2]=0;za=g.distance2(g.fromPoints(M,K,Q),na);za<va&&(va=za,h.copy(J,G),h.copy(R,I),ea=ya/3)}}da=
ia.rayBegin;ia=ia.rayEnd;va<fa*fa&&(ka=Number.MAX_VALUE,g.closestLineSegmentPoint(g.fromPoints(J,R,Q),g.fromPoints(da,ia,W),L)&&(h.subtract(L,L,da),ka=h.length(L),h.scale(L,L,1/ka),ka/=h.distance(da,ia)),X(ka,L,ea,!1))}else q.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix")}get _layout(){const ea=t.newLayout().vec3f(u.VertexAttribute.POSITION).vec3f(u.VertexAttribute.PREVPOSITION).vec3f(u.VertexAttribute.NEXTPOSITION).f32(u.VertexAttribute.SUBDIVISIONFACTOR).vec2f(u.VertexAttribute.UV0);
this.parameters.vvSize?ea.f32(u.VertexAttribute.SIZEFEATUREATTRIBUTE):ea.f32(u.VertexAttribute.SIZE);this.parameters.vvColor?ea.f32(u.VertexAttribute.COLORFEATUREATTRIBUTE):ea.vec4f(u.VertexAttribute.COLOR);this.parameters.vvOpacity&&ea.f32(u.VertexAttribute.OPACITYFEATUREATTRIBUTE);b("enable-feature:objectAndLayerId-rendering")&&ea.vec4u8(u.VertexAttribute.OBJECTANDLAYERIDCOLOR);return ea}createBufferWriter(){return new E(this._layout,this.parameters)}createGLMaterial(ea){return new H(ea)}validateParameters(ea){"miter"!==
ea.join&&(ea.miterLimit=0);null!=ea.markerParameters&&(ea.markerScale=ea.markerParameters.width/ea.width)}}class H extends v{constructor(){super(...arguments);this._stipplePattern=null}dispose(){super.dispose();this._stippleTextures.release(this._stipplePattern);this._stipplePattern=null}_updateOccludeeState(ea){ea.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:ea.hasOccludees})}beginSlot(ea){this._output===w.ShaderOutput.Color&&this._updateOccludeeState(ea);
const da=this._material.parameters.stipplePattern;this._stipplePattern!==da&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(da,this._stipplePattern)}),this._stipplePattern=da);return this.ensureTechnique(A.RibbonLineTechnique,ea)}}class N extends x.VisualVariablePassParameters{constructor(){super(...arguments);this.width=0;this.color=c.ONES;this.join="miter";this.cap=B.CapType.BUTT;this.miterLimit=5;this.writeDepth=!0;this.hasPolygonOffset=!1;this.stippleTexture=null;this.stipplePreferContinuous=
!0;this.markerParameters=null;this.markerScale=1;this.isClosed=this.vvFastUpdate=this.hasSlicePlane=!1;this.innerWidth=this.falloff=0;this.wireframe=this.hasOccludees=!1}}class E{constructor(ea,da){this.vertexBufferLayout=ea;this._parameters=da;this.numJoinSubdivisions=0;ea=da.stipplePattern?1:0;switch(this._parameters.join){case "miter":case "bevel":this.numJoinSubdivisions=ea;break;case "round":this.numJoinSubdivisions=z.ribbonlineNumRoundJoinSubdivisions+ea}}_isClosed(ea){return this._parameters.isClosed?
2<ea.attributes.get(u.VertexAttribute.POSITION).indices.length:!1}allocate(ea){return this.vertexBufferLayout.createBuffer(ea)}elementCount(ea){var da=ea.attributes.get(u.VertexAttribute.POSITION).indices.length/2+1;ea=this._isClosed(ea);da=(ea?2:4)+((ea?da:da-1)-(ea?0:1))*(2*this.numJoinSubdivisions+4);da+=2;this._parameters.wireframe&&(da=2+4*(da-2));return da}write(ea,da,ia,ka,fa){da=S;const X=V,ja=T,la=ia.attributes.get(u.VertexAttribute.POSITION);var na=la.indices;const va=la.data.length/3,za=
ia.attributes.get(u.VertexAttribute.DISTANCETOSTART)?.data;na&&na.length!==2*(va-1)&&console.warn("RibbonLineMaterial does not support indices");const ya=ia.attributes.get(u.VertexAttribute.SIZEFEATUREATTRIBUTE)?.data[0]??ia.attributes.get(u.VertexAttribute.SIZE)?.data[0]??1;let Da=[1,1,1,1],ra=0;const xa=this.vertexBufferLayout.fields.has(u.VertexAttribute.COLORFEATUREATTRIBUTE);xa?ra=ia.attributes.get(u.VertexAttribute.COLORFEATUREATTRIBUTE).data[0]:ia.attributes.has(u.VertexAttribute.COLOR)&&(Da=
ia.attributes.get(u.VertexAttribute.COLOR).data);const Ma=b("enable-feature:objectAndLayerId-rendering")?ia.objectAndLayerIdColor:null,Ga=this.vertexBufferLayout.fields.has(u.VertexAttribute.OPACITYFEATUREATTRIBUTE),Pa=Ga?ia.attributes.get(u.VertexAttribute.OPACITYFEATUREATTRIBUTE).data[0]:0,Qa=new Float32Array(ka.buffer),Ea=b("enable-feature:objectAndLayerId-rendering")?new Uint8Array(ka.buffer):null;na=this.vertexBufferLayout.stride/4;let ua=fa*na;fa=ua;let Na=0;const Ua=za?(Sa,Ya,qa)=>Na=za[qa]:
(Sa,Ya,qa)=>Na+=h.distance(Sa,Ya),wa=b("enable-feature:objectAndLayerId-rendering"),sa=(Sa,Ya,qa,aa,Ja,Ta,Ra)=>{Qa[ua++]=Ya[0];Qa[ua++]=Ya[1];Qa[ua++]=Ya[2];Qa[ua++]=Sa[0];Qa[ua++]=Sa[1];Qa[ua++]=Sa[2];Qa[ua++]=qa[0];Qa[ua++]=qa[1];Qa[ua++]=qa[2];Qa[ua++]=aa;Qa[ua++]=Ra;Qa[ua++]=Ja;Qa[ua++]=ya;xa?Qa[ua++]=ra:(Sa=Math.min(4*Ta,Da.length-4),Qa[ua++]=Da[Sa],Qa[ua++]=Da[Sa+1],Qa[ua++]=Da[Sa+2],Qa[ua++]=Da[Sa+3]);Ga&&(Qa[ua++]=Pa);wa&&(null!=Ma&&(Ea[4*ua]=Ma[0],Ea[4*ua+1]=Ma[1],Ea[4*ua+2]=Ma[2],Ea[4*ua+
3]=Ma[3]),ua++)};ua+=na;h.set(X,la.data[0],la.data[1],la.data[2]);ea&&h.transformMat4(X,X,ea);if(ia=this._isClosed(ia)){var Ha=la.data.length-3;h.set(da,la.data[Ha],la.data[Ha+1],la.data[Ha+2]);ea&&h.transformMat4(da,da,ea)}else h.set(ja,la.data[3],la.data[4],la.data[5]),ea&&h.transformMat4(ja,ja,ea),sa(X,X,ja,1,D.LEFT_CAP_START,0,0),sa(X,X,ja,1,D.RIGHT_CAP_START,0,0),h.copy(da,X),h.copy(X,ja);Ha=ia?0:1;const Ka=ia?va:va-1;for(let Sa=Ha;Sa<Ka;Sa++){var Aa=(Sa+1)%va*3;h.set(ja,la.data[Aa],la.data[Aa+
1],la.data[Aa+2]);ea&&h.transformMat4(ja,ja,ea);Ua(da,X,Sa);sa(da,X,ja,0,D.LEFT_JOIN_END,Sa,Na);sa(da,X,ja,0,D.RIGHT_JOIN_END,Sa,Na);Aa=this.numJoinSubdivisions;for(let Ya=0;Ya<Aa;++Ya){const qa=(Ya+1)/(Aa+1);sa(da,X,ja,qa,D.LEFT_JOIN_END,Sa,Na);sa(da,X,ja,qa,D.RIGHT_JOIN_END,Sa,Na)}sa(da,X,ja,1,D.LEFT_JOIN_START,Sa,Na);sa(da,X,ja,1,D.RIGHT_JOIN_START,Sa,Na);h.copy(da,X);h.copy(X,ja)}ia?(h.set(ja,la.data[3],la.data[4],la.data[5]),ea&&h.transformMat4(ja,ja,ea),Na=Ua(da,X,Ka),sa(da,X,ja,0,D.LEFT_JOIN_END,
Ha,Na),sa(da,X,ja,0,D.RIGHT_JOIN_END,Ha,Na)):(Na=Ua(da,X,Ka),sa(da,X,X,0,D.LEFT_CAP_END,Ka,Na),sa(da,X,X,0,D.RIGHT_CAP_END,Ka,Na));C(Qa,fa+na,Qa,fa,na);ua=C(Qa,ua-na,Qa,ua,na);this._parameters.wireframe&&this._addWireframeVertices(ka,fa,ua,na)}_addWireframeVertices(ea,da,ia,ka){const fa=new Float32Array(ea.buffer,ia*Float32Array.BYTES_PER_ELEMENT);ea=new Float32Array(ea.buffer,da*Float32Array.BYTES_PER_ELEMENT,ia-da);da=0;for(ia=0;ia<ea.length-1;ia+=2*ka)da=C(ea,ia,fa,da,ka),da=C(ea,ia+2*ka,fa,da,
ka),da=C(ea,ia+1*ka,fa,da,ka),da=C(ea,ia+2*ka,fa,da,ka),da=C(ea,ia+1*ka,fa,da,ka),da=C(ea,ia+3*ka,fa,da,ka)}}const G=f.create(),I=f.create(),O=f.create(),L=f.create(),P=f.create(),M=p.createRenderScreenPointArray3(),K=p.createRenderScreenPointArray3(),J=f.create(),R=f.create(),Q=g.create(),W=g.create(),S=f.create(),V=f.create(),T=f.create(),Y=[p.createRenderScreenPointArray3(),p.createRenderScreenPointArray3(),p.createRenderScreenPointArray3(),p.createRenderScreenPointArray3()],ha=[f.create(),f.create(),
f.create(),f.create()],ba=d.create(),U=d.create(),Z=d.create(),ca=d.create();a.Parameters=N;a.RibbonLineMaterial=F;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration":function(){define("exports ../../../../chunks/tslib.es6 ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/TransparencyPassType ../materials/DefaultTechniqueConfiguration".split(" "),function(a,b,q,l,p,k){a.LineMarkerSpace=
void 0;(function(f){f[f.Draped=0]="Draped";f[f.Screen=1]="Screen";f[f.World=2]="World";f[f.COUNT=3]="COUNT"})(a.LineMarkerSpace||(a.LineMarkerSpace={}));a.LineMarkerAnchor=void 0;(function(f){f[f.Center=0]="Center";f[f.Tip=1]="Tip";f[f.COUNT=2]="COUNT"})(a.LineMarkerAnchor||(a.LineMarkerAnchor={}));class h extends k.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=q.ShaderOutput.Color;this.transparencyPassType=p.TransparencyPassType.NONE;this.writeDepth=this.hasSlicePlane=
this.occluder=!1;this.space=a.LineMarkerSpace.Screen;this.hasCap=this.hideOnShortSegments=!1;this.anchor=a.LineMarkerAnchor.Center;this.cullAboveGround=this.multipassEnabled=this.hasOccludees=this.vvOpacity=this.vvColor=this.vvSize=this.hasTip=!1}get draped(){return this.space===a.LineMarkerSpace.Draped}}b.__decorate([l.parameter({count:q.ShaderOutput.COUNT})],h.prototype,"output",void 0);b.__decorate([l.parameter({count:p.TransparencyPassType.COUNT})],h.prototype,"transparencyPassType",void 0);b.__decorate([l.parameter()],
h.prototype,"occluder",void 0);b.__decorate([l.parameter()],h.prototype,"hasSlicePlane",void 0);b.__decorate([l.parameter()],h.prototype,"writeDepth",void 0);b.__decorate([l.parameter({count:a.LineMarkerSpace.COUNT})],h.prototype,"space",void 0);b.__decorate([l.parameter()],h.prototype,"hideOnShortSegments",void 0);b.__decorate([l.parameter()],h.prototype,"hasCap",void 0);b.__decorate([l.parameter({count:a.LineMarkerAnchor.COUNT})],h.prototype,"anchor",void 0);b.__decorate([l.parameter()],h.prototype,
"hasTip",void 0);b.__decorate([l.parameter()],h.prototype,"vvSize",void 0);b.__decorate([l.parameter()],h.prototype,"vvColor",void 0);b.__decorate([l.parameter()],h.prototype,"vvOpacity",void 0);b.__decorate([l.parameter()],h.prototype,"hasOccludees",void 0);b.__decorate([l.parameter()],h.prototype,"multipassEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"cullAboveGround",void 0);b.__decorate([l.parameter({constValue:!1})],h.prototype,"occlusionPass",void 0);b.__decorate([l.parameter({constValue:!0})],
h.prototype,"hasVvInstancing",void 0);b.__decorate([l.parameter({constValue:!0})],h.prototype,"hasSliceTranslatedView",void 0);a.LineMarkerTechniqueConfiguration=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/RibbonLine.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute ../views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration ../views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){function A(C){const D=new n.ShaderBuilder,{attributes:F,varyings:H,constants:N,vertex:E,fragment:G}=D;D.include(c.PiUtils);D.include(p.RibbonVertexPosition,C);D.include(k.LineStipple,C);const I=C.applyMarkerOffset&&!C.draped;I&&(E.uniforms.add(new v.FloatPassUniform("markerScale",J=>J.markerScale)),D.include(h.MarkerSizing,{space:y.LineMarkerSpace.World,draped:!1}));D.include(l.ObjectAndLayerIdColor,C);d.addProjViewLocalOrigin(E,C);E.uniforms.add(new r.Matrix4PassUniform("inverseProjectionMatrix",
(J,R)=>R.camera.inverseProjectionMatrix),new t.Float2PassUniform("nearFar",(J,R)=>R.camera.nearFar),new v.FloatPassUniform("miterLimit",J=>"miter"!==J.join?0:J.miterLimit),new w.Float4PassUniform("viewport",(J,R)=>R.camera.fullViewport));E.constants.add("LARGE_HALF_FLOAT","float",65500);F.add(x.VertexAttribute.POSITION,"vec3");F.add(x.VertexAttribute.PREVPOSITION,"vec3");F.add(x.VertexAttribute.NEXTPOSITION,"vec3");F.add(x.VertexAttribute.SUBDIVISIONFACTOR,"float");F.add(x.VertexAttribute.UV0,"vec2");
H.add("vColor","vec4");H.add("vpos","vec3");H.add("vLineDistance","float");H.add("vLineWidth","float");const O=C.multipassEnabled&&C.output===b.ShaderOutput.Color;O&&H.add("depth","float");const L=C.stippleEnabled;L&&H.add("vLineSizeInv","float");N.add("aaWidth","float",C.stippleEnabled?0:1);const P=C.capType===z.CapType.ROUND,M=C.stippleEnabled&&P,K=C.falloffEnabled||M;K&&H.add("vLineDistanceNorm","float");P&&(H.add("vSegmentSDF","float"),H.add("vReverseSegmentSDF","float"));E.code.add(m.glsl`#define PERPENDICULAR(v) vec2(v.y, -v.x);
float interp(float ncp, vec4 a, vec4 b) {
return (-ncp - a.z) / (b.z - a.z);
}
vec2 rotate(vec2 v, float a) {
float s = sin(a);
float c = cos(a);
mat2 m = mat2(c, -s, s, c);
return m * v;
}`);E.code.add(m.glsl`vec4 projectAndScale(vec4 pos) {
vec4 posNdc = proj * pos;
posNdc.xy *= viewport.zw / posNdc.w;
return posNdc;
}`);E.code.add(m.glsl`
void clipAndTransform(inout vec4 pos, inout vec4 prev, inout vec4 next, in bool isStartVertex) {
float vnp = nearFar[0] * 0.99;
if(pos.z > -nearFar[0]) {
//current pos behind ncp --> we need to clip
if (!isStartVertex) {
if(prev.z < -nearFar[0]) {
//previous in front of ncp
pos = mix(prev, pos, interp(vnp, prev, pos));
next = pos;
} else {
pos = vec4(0.0, 0.0, 0.0, 1.0);
}
} else {
if(next.z < -nearFar[0]) {
//next in front of ncp
pos = mix(pos, next, interp(vnp, pos, next));
prev = pos;
} else {
pos = vec4(0.0, 0.0, 0.0, 1.0);
}
}
} else {
//current position visible
if (prev.z > -nearFar[0]) {
//previous behind ncp
prev = mix(pos, prev, interp(vnp, pos, prev));
}
if (next.z > -nearFar[0]) {
//next behind ncp
next = mix(next, pos, interp(vnp, next, pos));
}
}
${O?"depth \x3d pos.z;":""}
pos = projectAndScale(pos);
next = projectAndScale(next);
prev = projectAndScale(prev);
}
`);d.addPixelRatio(E);E.code.add(m.glsl`
void main(void) {
// unpack values from uv0.y
bool isStartVertex = abs(abs(uv0.y)-3.0) == 1.0;
float coverage = 1.0;
// Check for special value of uv0.y which is used by the Renderer when graphics
// are removed before the VBO is recompacted. If this is the case, then we just
// project outside of clip space.
if (uv0.y == 0.0) {
// Project out of clip space
gl_Position = vec4(1e038, 1e038, 1e038, 1.0);
}
else {
bool isJoin = abs(uv0.y) < 3.0;
float lineSize = getSize();
if (lineSize < 1.0) {
coverage = lineSize; // convert sub-pixel coverage to alpha
lineSize = 1.0;
}
lineSize += aaWidth;
float lineWidth = lineSize * pixelRatio;
vLineWidth = lineWidth;
${L?m.glsl`vLineSizeInv = 1.0 / lineSize;`:""}
vec4 pos = view * vec4(position, 1.0);
vec4 prev = view * vec4(prevPosition, 1.0);
vec4 next = view * vec4(nextPosition, 1.0);
`);I&&E.code.add(m.glsl`vec4 other = isStartVertex ? next : prev;
bool markersHidden = areWorldMarkersHidden(pos, other);
if(!isJoin && !markersHidden) {
pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos) * 0.5;
}`);E.code.add(m.glsl`clipAndTransform(pos, prev, next, isStartVertex);
vec2 left = (pos.xy - prev.xy);
vec2 right = (next.xy - pos.xy);
float leftLen = length(left);
float rightLen = length(right);`);(C.stippleEnabled||P)&&E.code.add(m.glsl`
float isEndVertex = float(!isStartVertex);
vec2 segmentOrigin = mix(pos.xy, prev.xy, isEndVertex);
vec2 segment = mix(right, left, isEndVertex);
${P?m.glsl`vec2 segmentEnd = mix(next.xy, pos.xy, isEndVertex);`:""}
`);E.code.add(m.glsl`left = (leftLen > 0.001) ? left/leftLen : vec2(0.0, 0.0);
right = (rightLen > 0.001) ? right/rightLen : vec2(0.0, 0.0);
vec2 capDisplacementDir = vec2(0, 0);
vec2 joinDisplacementDir = vec2(0, 0);
float displacementLen = lineWidth;
if (isJoin) {
bool isOutside = (left.x * right.y - left.y * right.x) * uv0.y > 0.0;
joinDisplacementDir = normalize(left + right);
joinDisplacementDir = PERPENDICULAR(joinDisplacementDir);
if (leftLen > 0.001 && rightLen > 0.001) {
float nDotSeg = dot(joinDisplacementDir, left);
displacementLen /= length(nDotSeg * left - joinDisplacementDir);
if (!isOutside) {
displacementLen = min(displacementLen, min(leftLen, rightLen)/abs(nDotSeg));
}
}
if (isOutside && (displacementLen > miterLimit * lineWidth)) {`);C.roundJoins?E.code.add(m.glsl`
vec2 startDir = leftLen < 0.001 ? right : left;
startDir = PERPENDICULAR(startDir);
vec2 endDir = rightLen < 0.001 ? left : right;
endDir = PERPENDICULAR(endDir);
float factor = ${C.stippleEnabled?m.glsl`min(1.0, subdivisionFactor * ${m.glsl.float(1.5)})`:m.glsl`subdivisionFactor`};
float rotationAngle = acos(clamp(dot(startDir, endDir), -1.0, 1.0));
joinDisplacementDir = rotate(startDir, -sign(uv0.y) * factor * rotationAngle);
`):E.code.add(m.glsl`if (leftLen < 0.001) {
joinDisplacementDir = right;
}
else if (rightLen < 0.001) {
joinDisplacementDir = left;
}
else {
joinDisplacementDir = (isStartVertex || subdivisionFactor > 0.0) ? right : left;
}
joinDisplacementDir = PERPENDICULAR(joinDisplacementDir);`);E.code.add(m.glsl`
displacementLen = lineWidth;
}
} else {
// CAP handling ---------------------------------------------------
joinDisplacementDir = isStartVertex ? right : left;
joinDisplacementDir = PERPENDICULAR(joinDisplacementDir);
${C.capType!==z.CapType.BUTT?m.glsl`capDisplacementDir = isStartVertex ? -right : left;`:""}
}
`);E.code.add(m.glsl`
// Displacement (in pixels) caused by join/or cap
vec2 dpos = joinDisplacementDir * sign(uv0.y) * displacementLen + capDisplacementDir * displacementLen;
float lineDistNorm = sign(uv0.y) * pos.w;
vLineDistance = lineWidth * lineDistNorm;
${K?m.glsl`vLineDistanceNorm = lineDistNorm;`:""}
pos.xy += dpos;
`);P&&E.code.add(m.glsl`vec2 segmentDir = normalize(segment);
vSegmentSDF = (isJoin && isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentOrigin, segmentDir) * pos.w) ;
vReverseSegmentSDF = (isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd, -segmentDir) * pos.w);`);C.stippleEnabled&&(C.draped?E.uniforms.add(new v.FloatPassUniform("worldToScreenRatio",(J,R)=>1/R.screenToPCSRatio)):E.code.add(m.glsl`vec3 segmentCenter = mix((nextPosition + position) * 0.5, (position + prevPosition) * 0.5, isEndVertex);
float worldToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),E.code.add(m.glsl`float segmentLengthScreenDouble = length(segment);
float segmentLengthScreen = segmentLengthScreenDouble * 0.5;
float discreteWorldToScreenRatio = discretizeWorldToScreenRatio(worldToScreenRatio);
float segmentLengthRender = length(mix(nextPosition - position, position - prevPosition, isEndVertex));
vStipplePatternStretch = worldToScreenRatio / discreteWorldToScreenRatio;`),C.draped?E.code.add(m.glsl`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteWorldToScreenRatio / worldToScreenRatio;
float startPseudoScreen = uv0.x * discreteWorldToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):E.code.add(m.glsl`float startPseudoScreen = mix(uv0.x, uv0.x - segmentLengthRender, isEndVertex) * discreteWorldToScreenRatio;
float segmentLengthPseudoScreen = segmentLengthRender * discreteWorldToScreenRatio;`),E.uniforms.add(new v.FloatPassUniform("stipplePatternPixelSize",J=>k.computePixelSize(J))),E.code.add(m.glsl`float patternLength = lineSize * stipplePatternPixelSize;
vStippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, segmentLengthScreen, patternLength);
vStippleDistance = mix(vStippleDistanceLimits.x, vStippleDistanceLimits.y, isEndVertex);
if (segmentLengthScreenDouble >= 0.001) {
vec2 stippleDisplacement = pos.xy - segmentOrigin;
float stippleDisplacementFactor = dot(segment, stippleDisplacement) / (segmentLengthScreenDouble * segmentLengthScreenDouble);
vStippleDistance += (stippleDisplacementFactor - isEndVertex) * (vStippleDistanceLimits.y - vStippleDistanceLimits.x);
}
vStippleDistanceLimits *= pos.w;
vStippleDistance *= pos.w;
vStippleDistanceLimits = isJoin ?
vStippleDistanceLimits :
isStartVertex ?
vec2(-1e34, vStippleDistanceLimits.y) :
vec2(vStippleDistanceLimits.x, 1e34);`));E.code.add(m.glsl`
// Convert back into NDC
pos.xy = (pos.xy / viewport.zw) * pos.w;
vColor = getColor();
vColor.a *= coverage;
${C.wireframe&&!C.draped?"pos.z -\x3d 0.001 * pos.w;":""}
// transform final position to camera space for slicing
vpos = (inverseProjectionMatrix * pos).xyz;
gl_Position = pos;
forwardObjectAndLayerIdColor();
}
}
`);O&&D.include(f.multipassTerrainTest,C);D.include(q.SliceDraw,C);G.include(g.ColorConversion);G.code.add(m.glsl`
void main() {
discardBySlice(vpos);
${O?"terrainDepthTest(depth);":""}
`);C.wireframe?G.code.add(m.glsl`vec4 finalColor = vec4(1.0, 0.0, 1.0, 1.0);`):(P&&G.code.add(m.glsl`
float sdf = min(vSegmentSDF, vReverseSegmentSDF);
vec2 fragmentPosition = vec2(
min(sdf, 0.0),
vLineDistance
) * gl_FragCoord.w;
float fragmentRadius = length(fragmentPosition);
float fragmentCapSDF = (fragmentRadius - vLineWidth) * 0.5; // Divide by 2 to transform from double pixel scale
float capCoverage = clamp(0.5 - fragmentCapSDF, 0.0, 1.0);
if (capCoverage < ${m.glsl.float(e.symbolAlphaCutoff)}) {
discard;
}
`),M?G.code.add(m.glsl`
vec2 stipplePosition = vec2(
min(getStippleSDF() * 2.0 - 1.0, 0.0),
vLineDistanceNorm * gl_FragCoord.w
);
float stippleRadius = length(stipplePosition * vLineWidth);
float stippleCapSDF = (stippleRadius - vLineWidth) * 0.5; // Divide by 2 to transform from double pixel scale
float stippleCoverage = clamp(0.5 - stippleCapSDF, 0.0, 1.0);
float stippleAlpha = step(${m.glsl.float(e.symbolAlphaCutoff)}, stippleCoverage);
`):G.code.add(m.glsl`float stippleAlpha = getStippleAlpha();`),C.output!==b.ShaderOutput.ObjectAndLayerIdColor&&G.code.add(m.glsl`discardByStippleAlpha(stippleAlpha, stippleAlphaColorDiscard);`),G.uniforms.add(new w.Float4PassUniform("intrinsicColor",J=>J.color)),G.code.add(m.glsl`vec4 color = intrinsicColor * vColor;`),C.innerColorEnabled&&(G.uniforms.add(new w.Float4PassUniform("innerColor",J=>J.innerColor??J.color),new v.FloatPassUniform("innerWidth",(J,R)=>J.innerWidth*R.camera.pixelRatio)),
G.code.add(m.glsl`float distToInner = abs(vLineDistance * gl_FragCoord.w) - innerWidth;
float innerAA = clamp(0.5 - distToInner, 0.0, 1.0);
float innerAlpha = innerColor.a + color.a * (1.0 - innerColor.a);
color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`)),G.code.add(m.glsl`vec4 finalColor = blendStipple(color, stippleAlpha);`),C.falloffEnabled&&(G.uniforms.add(new v.FloatPassUniform("falloff",J=>J.falloff)),G.code.add(m.glsl`finalColor.a *= pow(max(0.0, 1.0 - abs(vLineDistanceNorm * gl_FragCoord.w)), falloff);`)),C.stippleEnabled||G.code.add(m.glsl`float featherStartDistance = max(vLineWidth - 2.0, 0.0);
float value = abs(vLineDistance) * gl_FragCoord.w;
float feather = (value - featherStartDistance) / (vLineWidth - featherStartDistance);
finalColor.a *= 1.0 - clamp(feather, 0.0, 1.0);`));C.transparencyPassType===u.TransparencyPassType.ColorAlpha&&(D.outputs.add("fragColor","vec4",0),D.outputs.add("fragAlpha","float",1));G.code.add(m.glsl`
${C.output===b.ShaderOutput.ObjectAndLayerIdColor?m.glsl`finalColor.a = 1.0;`:""}
if (finalColor.a < ${m.glsl.float(e.symbolAlphaCutoff)}) {
discard;
}
${C.output===b.ShaderOutput.Color?m.glsl`fragColor = highlightSlice(finalColor, vpos);`:""}
${C.output===b.ShaderOutput.Color&&C.transparencyPassType===u.TransparencyPassType.ColorAlpha?m.glsl`
fragColor = premultiplyAlpha(fragColor);
fragAlpha = fragColor.a;`:""}
${C.output===b.ShaderOutput.Highlight?m.glsl`fragColor = vec4(1.0);`:""}
${C.output===b.ShaderOutput.ObjectAndLayerIdColor?m.glsl`outputObjectAndLayerIdColor();`:""}
}
`);return D}const B=Object.freeze(Object.defineProperty({__proto__:null,build:A,ribbonlineNumRoundJoinSubdivisions:1},Symbol.toStringTag,{value:"Module"}));a.RibbonLine=B;a.build=A;a.ribbonlineNumRoundJoinSubdivisions=1})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl":function(){define("exports ../shading/VisualVariables.glsl ../../shaderModules/Float3PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/FloatsPassUniform ../../shaderModules/interfaces ../../../lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h){a.RibbonVertexPosition=function(f,c){const e=f.vertex;e.uniforms.add(new l.FloatPassUniform("intrinsicWidth",g=>g.width));c.vvSize?(f.attributes.add(h.VertexAttribute.SIZEFEATUREATTRIBUTE,"float"),e.uniforms.add(new q.Float3PassUniform("vvSizeMinSize",g=>g.vvSize.minSize),new q.Float3PassUniform("vvSizeMaxSize",g=>g.vvSize.maxSize),new q.Float3PassUniform("vvSizeOffset",g=>g.vvSize.offset),new q.Float3PassUniform("vvSizeFactor",g=>g.vvSize.factor)),e.code.add(k.glsl`float getSize() {
return intrinsicWidth * clamp(vvSizeOffset + sizeFeatureAttribute * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).x;
}`)):(f.attributes.add(h.VertexAttribute.SIZE,"float"),e.code.add(k.glsl`float getSize(){
return intrinsicWidth * size;
}`));c.vvOpacity?(f.attributes.add(h.VertexAttribute.OPACITYFEATUREATTRIBUTE,"float"),e.constants.add("vvOpacityNumber","int",8),e.uniforms.add(new p.FloatsPassUniform("vvOpacityValues",g=>g.vvOpacity.values,8),new p.FloatsPassUniform("vvOpacityOpacities",g=>g.vvOpacity.opacityValues,8)),e.code.add(k.glsl`float interpolateOpacity( float value ){
if (value <= vvOpacityValues[0]) {
return vvOpacityOpacities[0];
}
for (int i = 1; i < vvOpacityNumber; ++i) {
if (vvOpacityValues[i] >= value) {
float f = (value - vvOpacityValues[i-1]) / (vvOpacityValues[i] - vvOpacityValues[i-1]);
return mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f);
}
}
return vvOpacityOpacities[vvOpacityNumber - 1];
}
vec4 applyOpacity( vec4 color ){
return vec4(color.xyz, interpolateOpacity(opacityFeatureAttribute));
}`)):e.code.add(k.glsl`vec4 applyOpacity( vec4 color ){
return color;
}`);c.vvColor?(f.include(b.VisualVariables,c),f.attributes.add(h.VertexAttribute.COLORFEATUREATTRIBUTE,"float"),e.code.add(k.glsl`vec4 getColor(){
return applyOpacity(interpolateVVColor(colorFeatureAttribute));
}`)):(f.attributes.add(h.VertexAttribute.COLOR,"vec4"),e.code.add(k.glsl`vec4 getColor(){
return applyOpacity(color);
}`))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl":function(){define("exports ../util/RgbaFloatEncoding.glsl ../util/View.glsl ../../shaderModules/Float4PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../shaderModules/Texture2DPassUniform ../../../materials/stippleTextureRepository ../../../shaders/ensureColor4".split(" "),function(a,b,q,l,p,k,h,f,c){function e(t,w){const v=
!(w.draped&&w.stipplePreferContinuous),{vertex:m,fragment:r}=t;r.include(b.RgbaFloatEncoding);w.draped||(q.addCameraPosition(m,w),m.uniforms.add(new p.FloatPassUniform("worldToScreenPerDistanceRatio",(n,u)=>1/u.camera.perScreenPixelRatio)),m.code.add(k.glsl`float computeWorldToScreenRatio(vec3 segmentCenter) {
float segmentDistanceToCamera = length(segmentCenter - cameraPosition);
return worldToScreenPerDistanceRatio / segmentDistanceToCamera;
}`));t.varyings.add("vStippleDistance","float");t.varyings.add("vStippleDistanceLimits","vec2");t.varyings.add("vStipplePatternStretch","float");m.code.add(k.glsl`
float discretizeWorldToScreenRatio(float worldToScreenRatio) {
float step = ${d};
float discreteWorldToScreenRatio = log(worldToScreenRatio);
discreteWorldToScreenRatio = ceil(discreteWorldToScreenRatio / step) * step;
discreteWorldToScreenRatio = exp(discreteWorldToScreenRatio);
return discreteWorldToScreenRatio;
}
`);m.code.add(k.glsl`vec2 computeStippleDistanceLimits(float startPseudoScreen, float segmentLengthPseudoScreen, float segmentLengthScreen, float patternLength) {`);m.code.add(k.glsl`
if (segmentLengthPseudoScreen >= ${v?"patternLength":"1e4"}) {
`);q.addPixelRatio(m);m.code.add(k.glsl`float repetitions = segmentLengthScreen / (patternLength * pixelRatio);
float flooredRepetitions = max(1.0, floor(repetitions + 0.5));
float segmentLengthScreenRounded = flooredRepetitions * patternLength;
float stretch = repetitions / flooredRepetitions;
vStipplePatternStretch = max(0.75, stretch);
return vec2(0.0, segmentLengthScreenRounded);
}
return vec2(startPseudoScreen, startPseudoScreen + segmentLengthPseudoScreen);
}`);r.uniforms.add(new h.Texture2DPassUniform("stipplePatternTexture",n=>n.stippleTexture),new p.FloatPassUniform("stipplePatternSDFNormalizer",n=>(n=n.stipplePattern)?(Math.floor(.5*(f.computeLongestPattern(n)-1))+.5)/n.pixelRatio:1),new p.FloatPassUniform("stipplePatternPixelSizeInv",n=>1/g(n)));r.code.add(k.glsl`float getStippleSDF(out bool isClamped) {
float stippleDistanceClamped = clamp(vStippleDistance, vStippleDistanceLimits.x, vStippleDistanceLimits.y);
vec2 aaCorrectedLimits = vStippleDistanceLimits + vec2(1.0, -1.0) / gl_FragCoord.w;
isClamped = vStippleDistance < aaCorrectedLimits.x || vStippleDistance > aaCorrectedLimits.y;
float u = stippleDistanceClamped * gl_FragCoord.w * stipplePatternPixelSizeInv * vLineSizeInv;
u = fract(u);
float encodedSDF = rgba2float(texture(stipplePatternTexture, vec2(u, 0.5)));
float sdf = (encodedSDF * 2.0 - 1.0) * stipplePatternSDFNormalizer;
return (sdf - 0.5) * vStipplePatternStretch + 0.5;
}
float getStippleSDF() {
bool ignored;
return getStippleSDF(ignored);
}
float getStippleAlpha() {
bool isClamped;
float stippleSDF = getStippleSDF(isClamped);
float antiAliasedResult = clamp(stippleSDF * vLineWidth + 0.5, 0.0, 1.0);
return isClamped ? floor(antiAliasedResult + 0.5) : antiAliasedResult;
}`);w.stippleOffColorEnabled?(r.uniforms.add(new l.Float4PassUniform("stippleOffColor",n=>c.ensureColor4(n.stippleOffColor))),r.code.add(k.glsl`#define discardByStippleAlpha(stippleAlpha, threshold) {}
#define blendStipple(color, stippleAlpha) mix(color, stippleOffColor, stippleAlpha)`)):r.code.add(k.glsl`#define discardByStippleAlpha(stippleAlpha, threshold) if (stippleAlpha < threshold) { discard; }
#define blendStipple(color, stippleAlpha) vec4(color.rgb, color.a * stippleAlpha)`)}function g(t){const w=t.stipplePattern;return w?f.computeTextureSize(t.stipplePattern)/w.pixelRatio:1}const d=k.glsl.float(.4);a.LineStipple=function(t,w){t.constants.add("stippleAlphaColorDiscard","float",.001);t.constants.add("stippleAlphaHighlightDiscard","float",.5);w.stippleEnabled?e(t,w):t.fragment.code.add(k.glsl`float getStippleAlpha() { return 1.0; }
#define discardByStippleAlpha(_stippleAlpha_, _threshold_) {}
#define blendStipple(color, _stippleAlpha_) color`)};a.computePixelSize=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/stippleTextureRepository":function(){define("exports ../../../../core/floatRGBA ./ProceduralTextureRepository ../../../webgl/enums ../../../webgl/Texture ../../../webgl/TextureDescriptor".split(" "),function(a,b,q,l,p,k){function h(e){return e.pattern.map(g=>Math.round(g*e.pixelRatio))}function f(e){if(null==e)return 1;e=h(e);
return Math.floor(e.reduce((g,d)=>g+d))}function c(e){return h(e).reduce((g,d)=>Math.max(g,d))}a.computeLongestPattern=c;a.computeTextureSize=f;a.createStippleTextureRepository=function(e,g){return new q.ProceduralTextureRepository(d=>{var t=h(d),w=1/d.pixelRatio,v=f(d);d=c(d);const m=(Math.floor(.5*(d-1))+.5)*w;d=[];let r=1;for(var n of t){for(let y=0;y<n;y++)d.push(r*(Math.min(y,n-1-y)+.5)*w/m*.5+.5);r=-r}t=Math.round(t[0]/2);t=[...d.slice(t),...d.slice(0,t)];w=new Uint8Array(4*v);n=0;for(const y of t)b.packFloatRGBA(y,
w,n),n+=4;const {encodedData:u,textureSize:x}={encodedData:w,textureSize:v};v=new k.TextureDescriptor;v.internalFormat=l.PixelFormat.RGBA;v.width=x;v.height=1;v.wrapMode=l.TextureWrapMode.REPEAT;return new p.Texture(e,v,u)},d=>`${d.pattern.join(",")}-r${d.pixelRatio}`,g)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/ProceduralTextureRepository":function(){define(["exports","../../../../core/uid"],function(a,b){class q{constructor(p,k,h){this._createTexture=
p;this._parametersKey=k;this._repository=new Map;this._orphanCache=h.newCache(`procedural-texture-repository:${b.generateUID()}`,f=>f.dispose())}destroy(){for(const [,{texture:p}]of this._repository)p.dispose();this._repository.clear();this._orphanCache.destroy()}swap(p,k=null){p=this._acquire(p);this.release(k);return p}release(p){if(null!=p){p=this._parametersKey(p);var k=this._repository.get(p);k&&(k.refCount--,0===k.refCount&&(this._repository.delete(p),{texture:k}=k,this._orphanCache.put(p,k,
k.usedMemory)))}}_acquire(p){if(null==p)return null;const k=this._parametersKey(p);var h=this._repository.get(k);if(h)return h.refCount++,h.texture;p=this._orphanCache.pop(k)??this._createTexture(p);h=new l(p);this._repository.set(k,h);return p}}class l{constructor(p){this.texture=p;this.refCount=1}}a.ProceduralTextureRepository=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ensureColor4":function(){define(["exports","../../../../chunks/vec42",
"../../../../core/libs/gl-matrix-2/factories/vec4f64"],function(a,b,q){const l=q.create();a.ensureColor4=function(p){return null==p?q.ZEROS:4===p.length?p:b.set(l,p[0],p[1],p[2],1)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl":function(){define("exports ../../../../support/engineContent/marker ../util/View.glsl ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../../shaders/LineMarkerTechniqueConfiguration".split(" "),
function(a,b,q,l,p,k){a.MarkerSizing=function(h,f){const {vertex:c,constants:e}=h;e.add("markerSizePerLineWidth","float",b.markerSizePerLineWidth);q.addPixelRatio(c);null==c.uniforms.get("markerScale")&&c.constants.add("markerScale","float",1);c.code.add(p.glsl`float getLineWidth() {
return max(getSize(), 1.0) * pixelRatio;
}
float getScreenMarkerSize() {
return markerSizePerLineWidth * markerScale * getLineWidth();
}`);f.space===k.LineMarkerSpace.World&&(c.constants.add("maxSegmentLengthFraction","float",.45),c.uniforms.add(new l.FloatPassUniform("perRenderPixelRatio",(g,d)=>d.camera.perRenderPixelRatio)),c.code.add(p.glsl`bool areWorldMarkersHidden(vec4 pos, vec4 other) {
vec3 midPoint = mix(pos.xyz, other.xyz, 0.5);
float distanceToCamera = length(midPoint);
float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
float worldMarkerSize = getScreenMarkerSize() * screenToWorldRatio;
float segmentLen = length(pos.xyz - other.xyz);
return worldMarkerSize > maxSegmentLengthFraction * segmentLen;
}
float getWorldMarkerSize(vec4 pos) {
float distanceToCamera = length(pos.xyz);
float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
return getScreenMarkerSize() * screenToWorldRatio;
}`))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/engineContent/marker":function(){define(["exports","./sdfPrimitives","../../../webgl/enums","../../../webgl/Texture","../../../webgl/TextureDescriptor"],function(a,b,q,l,p){a.createMarkerTexture=function(k,h){k=b.createPrimitive(k,64,32,6.4);const f=new p.TextureDescriptor;f.internalFormat=q.PixelFormat.RGBA;f.width=64;f.height=64;f.wrapMode=q.TextureWrapMode.CLAMP_TO_EDGE;return new l.Texture(h,f,k)};a.markerSizePerLineWidth=
10;a.markerSymbolSize=32;a.markerTextureSize=64;a.markerThickness=6.4;a.markerTipThicknessFactor=.25;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/engineContent/sdfPrimitives":function(){define(["exports","../../../../core/has","../../../../core/floatRGBA","../../webgl-engine/lib/Texture","../../../webgl/enums"],function(a,b,q,l,p){function k(u,x=128,y=.5*x,z=0){switch(u){case "circle":return h(x,y);case "square":return f(x,y);case "cross":return e(x,y,z);
case "x":return g(x,y,z);case "kite":return c(x,y);case "triangle":return d(x,y);case "arrow":return t(x,y);default:return h(x,y)}}function h(u,x){const y=u/2-.5;return n(u,m(y,y,x/2))}function f(u,x){return w(u,x,!1)}function c(u,x){return w(u,x,!0)}function e(u,x,y=0){return v(u,x,!1,y)}function g(u,x,y=0){return v(u,x,!0,y)}function d(u,x){return n(u,r(u/2,x,x/2))}function t(u,x){const y=x/2,z=u/2,A=.8*x,B=m(z,(u-x)/2-A,Math.sqrt(A*A+y*y)),C=r(z,x,y);return n(u,(D,F)=>Math.max(C(D,F),-B(D,F)))}
function w(u,x,y){y&&(x/=Math.SQRT2);return n(u,(z,A)=>{z=z-.5*u+.25;A=-A+.5*u-.75;if(y){const B=(z+A)/Math.SQRT2;A=(A-z)/Math.SQRT2;z=B}return Math.max(Math.abs(z),Math.abs(A))-.5*x})}function v(u,x,y,z=0){x-=z;y&&(x*=Math.SQRT2);const A=.5*x;return n(u,(B,C)=>{B-=.5*u;C=-C+.5*u-1;if(y){const D=(B+C)/Math.SQRT2;C=(C-B)/Math.SQRT2;B=D}B=Math.abs(B);C=Math.abs(C);B=B>C?B>A?Math.sqrt((B-A)*(B-A)+C*C):C:C>A?Math.sqrt(B*B+(C-A)*(C-A)):B;return B-=z/2})}function m(u,x,y){return(z,A)=>{z-=u;A-=x;return Math.sqrt(z*
z+A*A)-y}}function r(u,x,y){const z=Math.sqrt(x*x+y*y);return(A,B)=>{B=B-u+x/2+.75;return Math.max((x*(Math.abs(A-u)-y)+y*B)/z,-B)}}function n(u,x){const y=new Uint8Array(4*u*u);for(let z=0;z<u;z++)for(let A=0;A<u;A++){const B=A+u*z;let C=x(A,z);C=C/u+.5;q.packFloatRGBA(C,y,4*B)}return y}a.createArrow=t;a.createCircle=h;a.createCross=e;a.createKite=c;a.createPrimitive=k;a.createSquare=f;a.createTexture=function(u,x=128,y=.5*x,z=0){u=k(u,x,y,z);return new l.Texture(u,{mipmap:!1,wrap:{s:p.TextureWrapMode.CLAMP_TO_EDGE,
t:p.TextureWrapMode.CLAMP_TO_EDGE},width:x,height:x,components:4,noUnpackFlip:!0,reloadable:!0})};a.createTriangle=d;a.createX=g;a.defaultSymbolSizeRatio=.5;a.defaultTexSize=128;a.requiresHalfTexelOffset=function(u){return"cross"===u||"x"===u};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Texture":function(){define("exports ../../../../core/has ../../../../core/Error ../../../../core/Evented ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/typedArrayUtil ../../../../core/urlUtils ../../../../support/requestImageUtils ../../../../support/requestUtils ./basicInterfaces ./BasisUtil ./ContentObject ./ContentObjectType ./DDSUtil ./textureUtils ./Util ../../../webgl/enums ../../../webgl/Texture ../../../webgl/TextureDescriptor".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){function y(C){return C instanceof HTMLVideoElement?{width:C.videoWidth,height:C.videoHeight}:C}class z extends t.ContentObject{get parameters(){return this._parameters}constructor(C,D){super();this._data=C;this.type=w.ContentObjectType.Texture;this._loadingController=this._loadingPromise=this._glTexture=null;this.events=new l;this._parameters={...B,...D};this._startPreload(C)}dispose(){this.unload();this._data=this.frameUpdate=void 0}_startPreload(C){null!=
C&&(C instanceof HTMLVideoElement?(this.frameUpdate=D=>this._frameUpdate(C,D),this._startPreloadVideoElement(C)):C instanceof HTMLImageElement&&this._startPreloadImageElement(C))}_startPreloadVideoElement(C){if(!(f.isBlobProtocol(C.src)||"auto"===C.preload&&C.crossOrigin)){C.preload="auto";C.crossOrigin="anonymous";const D=!C.paused;C.src=C.src;if(D&&C.autoplay){const F=()=>{C.removeEventListener("canplay",F);C.play()};C.addEventListener("canplay",F)}}}_startPreloadImageElement(C){f.isDataProtocol(C.src)||
f.isBlobProtocol(C.src)||C.crossOrigin||(C.crossOrigin="anonymous",C.src=C.src)}_createDescriptor(C){const D=new x.TextureDescriptor;D.wrapMode=this._parameters.wrap??n.TextureWrapMode.REPEAT;D.flipped=!this._parameters.noUnpackFlip;D.samplingMode=this._parameters.mipmap?n.TextureSamplingMode.LINEAR_MIPMAP_LINEAR:n.TextureSamplingMode.LINEAR;D.hasMipmap=!!this._parameters.mipmap;D.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha;D.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?
C.parameters.maxMaxAnisotropy:1);return D}get glTexture(){return this._glTexture}get memoryEstimate(){var C;if(!(C=this._glTexture?.usedMemory)){C=this._data;var D=this._parameters;if(null==C)C=0;else if(h.isArrayBuffer(C)||h.isUint8Array(C))C=D.encoding===g.TextureEncodingMimeType.KTX2_ENCODING?d.estimateMemoryKTX2(C,!!D.mipmap):D.encoding===g.TextureEncodingMimeType.BASIS_ENCODING?d.estimateMemoryBasis(C,!!D.mipmap):C.byteLength;else{var {width:F,height:H}=C instanceof Image||C instanceof ImageData||
C instanceof HTMLCanvasElement||C instanceof HTMLVideoElement?y(C):D;C=(D.mipmap?4/3:1)*F*H*(D.components||4)||0}}return C}load(C){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const D=this._data;if(null==D)return this._glTexture=new u.Texture(C,this._createDescriptor(C),null);this._parameters.reloadable||(this._data=void 0);return"string"===typeof D?this._loadFromURL(C,D):D instanceof Image?this._loadFromImageElement(C,D):D instanceof HTMLVideoElement?
this._loadFromVideoElement(C,D):D instanceof ImageData||D instanceof HTMLCanvasElement?this._loadFromImage(C,D):(h.isArrayBuffer(D)||h.isUint8Array(D))&&this._parameters.encoding===g.TextureEncodingMimeType.DDS_ENCODING?this._loadFromDDSData(C,D):(h.isArrayBuffer(D)||h.isUint8Array(D))&&this._parameters.encoding===g.TextureEncodingMimeType.KTX2_ENCODING?this._loadFromKTX2(C,D):(h.isArrayBuffer(D)||h.isUint8Array(D))&&this._parameters.encoding===g.TextureEncodingMimeType.BASIS_ENCODING?this._loadFromBasis(C,
D):h.isUint8Array(D)?this._loadFromPixelData(C,D):h.isArrayBuffer(D)?this._loadFromPixelData(C,new Uint8Array(D)):null}_frameUpdate(C,D){if(null==this._glTexture||C.readyState<A.HAVE_CURRENT_DATA||D===C.currentTime)return D;this._glTexture.setData(C);this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap();this._parameters.updateCallback&&this._parameters.updateCallback();return C.currentTime}_loadFromDDSData(C,D){return this._glTexture=v.createDDSTexture(C,this._createDescriptor(C),
D)}_loadFromKTX2(C,D){return this._loadAsync(()=>d.createTextureKTX2(C,this._createDescriptor(C),D).then(F=>this._glTexture=F))}_loadFromBasis(C,D){return this._loadAsync(()=>d.createTextureBasis(C,this._createDescriptor(C),D).then(F=>this._glTexture=F))}_loadFromPixelData(C,D){r.assert(0<this._parameters.width&&0<this._parameters.height);const F=this._createDescriptor(C);F.pixelFormat=1===this._parameters.components?n.PixelFormat.LUMINANCE:3===this._parameters.components?n.PixelFormat.RGB:n.PixelFormat.RGBA;
F.width=this._parameters.width??0;F.height=this._parameters.height??0;return this._glTexture=new u.Texture(C,F,D)}_loadFromURL(C,D){return this._loadAsync(async F=>{const H=await c.requestImage(D,{signal:F});k.throwIfAborted(F);return this._loadFromImage(C,H)})}_loadFromImageElement(C,D){return D.complete?this._loadFromImage(C,D):this._loadAsync(async F=>{const H=await e.loadImageAsync(D,D.src,!1,F);k.throwIfAborted(F);return this._loadFromImage(C,H)})}_loadFromVideoElement(C,D){return D.readyState>=
A.HAVE_CURRENT_DATA?this._loadFromImage(C,D):this._loadFromVideoElementAsync(C,D)}_loadFromVideoElementAsync(C,D){return this._loadAsync(F=>new Promise((H,N)=>{const E=()=>{D.removeEventListener("loadeddata",G);D.removeEventListener("error",I);p.removeMaybe(O)},G=()=>{D.readyState>=A.HAVE_CURRENT_DATA&&(E(),H(this._loadFromImage(C,D)))},I=L=>{E();N(L||new q("Failed to load video"))};D.addEventListener("loadeddata",G);D.addEventListener("error",I);const O=k.onAbort(F,()=>I(k.createAbortError()))}))}_loadFromImage(C,
D){if(!(D instanceof HTMLVideoElement)){var {maxTextureSize:F}=C.parameters;D=this._parameters.downsampleUncompressed?m.downsampleImage(D,F):m.ensureImageMaxSize(D,F)}F=y(D);this._parameters.width=F.width;this._parameters.height=F.height;const H=this._createDescriptor(C);H.pixelFormat=3===this._parameters.components?n.PixelFormat.RGB:n.PixelFormat.RGBA;H.width=F.width;H.height=F.height;return this._glTexture=new u.Texture(C,H,D)}_loadAsync(C){const D=new AbortController;this._loadingController=D;
const F=C(D.signal);this._loadingPromise=F;C=()=>{this._loadingController===D&&(this._loadingController=null);this._loadingPromise===F&&(this._loadingPromise=null)};F.then(C,C);return F}unload(){this._glTexture=p.disposeMaybe(this._glTexture);if(null!=this._loadingController){const C=this._loadingController;this._loadingPromise=this._loadingController=null;C.abort()}this.events.emit("unloaded")}}var A;(function(C){C[C.HAVE_NOTHING=0]="HAVE_NOTHING";C[C.HAVE_METADATA=1]="HAVE_METADATA";C[C.HAVE_CURRENT_DATA=
2]="HAVE_CURRENT_DATA";C[C.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA";C[C.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"})(A||={});const B={wrap:{s:n.TextureWrapMode.REPEAT,t:n.TextureWrapMode.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};a.Texture=z;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/support/requestImageUtils":function(){define(["exports","../request"],function(a,b){a.requestImage=async function(q,l){({data:q}=await b(q,{responseType:"image",
...l}));return q};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/BasisUtil":function(){define("exports ../../../../libs/basisu/BasisU ../../../../libs/basisu/TextureFormat ../../../webgl/enums ../../../webgl/Texture ../../../webgl/Util".split(" "),function(a,b,q,l,p,k){async function h(){null==t&&(t=b.getBasisTranscoder(),d=await t);return t}function f(w,v,m,r,n){v=k.getBytesPerElementFormat(v?l.CompressedTextureFormat.COMPRESSED_RGBA8_ETC2_EAC:l.CompressedTextureFormat.COMPRESSED_RGB8_ETC2);
return Math.ceil(m*r*v*(n&&1<w?(4**w-1)/(3*4**(w-1)):1))}function c(w){return 1<=w.getNumImages()&&!w.isUASTC()}function e(w){return 1<=w.getFaces()&&w.isETC1S()}function g(w,v,m,r,n,u,x,y){const {compressedTextureETC:z,compressedTextureS3TC:A}=w.capabilities,[B,C]=z?r?[q.TextureFormat.ETC2_RGBA,l.CompressedTextureFormat.COMPRESSED_RGBA8_ETC2_EAC]:[q.TextureFormat.ETC1_RGB,l.CompressedTextureFormat.COMPRESSED_RGB8_ETC2]:A?r?[q.TextureFormat.BC3_RGBA,l.CompressedTextureFormat.COMPRESSED_RGBA_S3TC_DXT5_EXT]:
[q.TextureFormat.BC1_RGB,l.CompressedTextureFormat.COMPRESSED_RGB_S3TC_DXT1_EXT]:[q.TextureFormat.RGBA32,l.PixelFormat.RGBA];m=v.hasMipmap?m:Math.min(1,m);r=[];for(let D=0;D<m;D++)r.push(new Uint8Array(x(D,B))),y(D,B,r[D]);v.internalFormat=C;v.hasMipmap=1<r.length;v.samplingMode=v.hasMipmap?l.TextureSamplingMode.LINEAR_MIPMAP_LINEAR:l.TextureSamplingMode.LINEAR;v.width=n;v.height=u;return new p.Texture(w,v,{type:"compressed",levels:r})}let d=null,t=null;a.createTextureBasis=async function(w,v,m){null==
d&&(d=await h());const r=new d.BasisFile(new Uint8Array(m));if(!c(r))return null;r.startTranscoding();w=g(w,v,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(n,u)=>r.getImageTranscodedSizeInBytes(0,n,u),(n,u,x)=>r.transcodeImage(x,0,n,u,0,0));r.close();r.delete();return w};a.createTextureKTX2=async function(w,v,m){null==d&&(d=await h());const r=new d.KTX2File(new Uint8Array(m));if(!e(r))return null;r.startTranscoding();w=g(w,v,r.getLevels(),r.getHasAlpha(),r.getWidth(),
r.getHeight(),(n,u)=>r.getImageTranscodedSizeInBytes(n,0,0,u),(n,u,x)=>r.transcodeImage(x,n,0,0,u,0,-1,-1));r.close();r.delete();return w};a.estimateMemoryBasis=function(w,v){if(null==d)return w.byteLength;w=new d.BasisFile(new Uint8Array(w));v=c(w)?f(w.getNumLevels(0),w.getHasAlpha(),w.getImageWidth(0,0),w.getImageHeight(0,0),v):0;w.close();w.delete();return v};a.estimateMemoryKTX2=function(w,v){if(null==d)return w.byteLength;w=new d.KTX2File(new Uint8Array(w));v=e(w)?f(w.getLevels(),w.getHasAlpha(),
w.getWidth(),w.getHeight(),v):0;w.close();w.delete();return v};a.loadBasis=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/libs/basisu/BasisU":function(){define(["require","exports","../../assets"],function(a,b,q){let l;b.getBasisTranscoder=function(){l??=(async()=>{const p=await (await new Promise((k,h)=>a(["../../chunks/basis_transcoder"],k,h))).default({locateFile:k=>q.getAssetUrl(`esri/libs/basisu/${k}`)});p.initializeBasis();return p})();return l};Object.defineProperty(b,
Symbol.toStringTag,{value:"Module"})})},"esri/libs/basisu/TextureFormat":function(){define(["exports"],function(a){a.TextureFormat=void 0;var b=a.TextureFormat||(a.TextureFormat={});b[b.ETC1_RGB=0]="ETC1_RGB";b[b.ETC2_RGBA=1]="ETC2_RGBA";b[b.BC1_RGB=2]="BC1_RGB";b[b.BC3_RGBA=3]="BC3_RGBA";b[b.BC4_R=4]="BC4_R";b[b.BC5_RG=5]="BC5_RG";b[b.BC7_M6_RGB=6]="BC7_M6_RGB";b[b.BC7_M5_RGBA=7]="BC7_M5_RGBA";b[b.PVRTC1_4_RGB=8]="PVRTC1_4_RGB";b[b.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA";b[b.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA";
b[b.ATC_RGB=11]="ATC_RGB";b[b.ATC_RGBA=12]="ATC_RGBA";b[b.FXT1_RGB=17]="FXT1_RGB";b[b.PVRTC2_4_RGB=18]="PVRTC2_4_RGB";b[b.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA";b[b.ETC2_EAC_R11=20]="ETC2_EAC_R11";b[b.ETC2_EAC_RG11=21]="ETC2_EAC_RG11";b[b.RGBA32=13]="RGBA32";b[b.RGB565=14]="RGB565";b[b.BGR565=15]="BGR565";b[b.RGBA4444=16]="RGBA4444";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/DDSUtil":function(){define(["exports","../../../../core/Logger","../../../webgl/enums",
"../../../webgl/Texture"],function(a,b,q,l){function p(g){return g.charCodeAt(0)+(g.charCodeAt(1)<<8)+(g.charCodeAt(2)<<16)+(g.charCodeAt(3)<<24)}function k(g,d){var t=new Int32Array(g,0,31);if(542327876!==t[0])return h().error("Invalid magic number in DDS header"),null;if(!(t[20]&4))return h().error("Unsupported format, must contain a FourCC code"),null;var w=t[21];let v;switch(w){case f:w=8;v=q.CompressedTextureFormat.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case c:w=16;v=q.CompressedTextureFormat.COMPRESSED_RGBA_S3TC_DXT3_EXT;
break;case e:w=16;v=q.CompressedTextureFormat.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return h().error("Unsupported FourCC code:",String.fromCharCode(w&255,w>>8&255,w>>16&255,w>>24&255)),null}let m=1,r=t[4],n=t[3];if(0!==(r&3)||0!==(n&3))h().warn("Rounding up compressed texture size to nearest multiple of 4."),r=r+3&-4,n=n+3&-4;const u=r,x=n;t[2]&131072&&!1!==d&&(m=Math.max(1,t[7]));let y=t[1]+4;const z=[];for(let A=0;A<m;++A)t=(r+3>>2)*(n+3>>2)*w,d=new Uint8Array(g,y,t),z.push(d),y+=t,r=Math.max(1,
r>>1),n=Math.max(1,n>>1);return{textureData:{type:"compressed",levels:z},internalFormat:v,width:u,height:x}}const h=()=>b.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),f=p("DXT1"),c=p("DXT3"),e=p("DXT5");a.createDDSTexture=function(g,d,t){t=k(t,d.hasMipmap??!1);if(null==t)throw Error("DDS texture data is null");const {textureData:w,internalFormat:v,width:m,height:r}=t;d.samplingMode=1<w.levels.length?q.TextureSamplingMode.LINEAR_MIPMAP_LINEAR:q.TextureSamplingMode.LINEAR;d.hasMipmap=1<w.levels.length;
d.internalFormat=v;d.width=m;d.height=r;return new l.Texture(g,d,w)};a.createDDSTextureData=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration":function(){define("exports ../../../../chunks/tslib.es6 ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/TransparencyPassType ../materials/DefaultTechniqueConfiguration".split(" "),function(a,b,q,l,p,k){a.CapType=void 0;(function(f){f[f.BUTT=
0]="BUTT";f[f.SQUARE=1]="SQUARE";f[f.ROUND=2]="ROUND";f[f.COUNT=3]="COUNT"})(a.CapType||(a.CapType={}));class h extends k.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=q.ShaderOutput.Color;this.capType=a.CapType.BUTT;this.transparencyPassType=p.TransparencyPassType.NONE;this.stippleOffColorEnabled=this.stippleEnabled=this.draped=this.writeDepth=this.hasPolygonOffset=this.hasSlicePlane=this.occluder=!1;this.stipplePreferContinuous=!0;this.objectAndLayerIdColorInstanced=
this.wireframe=this.cullAboveGround=this.multipassEnabled=this.hasOccludees=this.innerColorEnabled=this.falloffEnabled=this.vvOpacity=this.vvColor=this.vvSize=this.applyMarkerOffset=this.roundJoins=!1}}b.__decorate([l.parameter({count:q.ShaderOutput.COUNT})],h.prototype,"output",void 0);b.__decorate([l.parameter({count:a.CapType.COUNT})],h.prototype,"capType",void 0);b.__decorate([l.parameter({count:p.TransparencyPassType.COUNT})],h.prototype,"transparencyPassType",void 0);b.__decorate([l.parameter()],
h.prototype,"occluder",void 0);b.__decorate([l.parameter()],h.prototype,"hasSlicePlane",void 0);b.__decorate([l.parameter()],h.prototype,"hasPolygonOffset",void 0);b.__decorate([l.parameter()],h.prototype,"writeDepth",void 0);b.__decorate([l.parameter()],h.prototype,"draped",void 0);b.__decorate([l.parameter()],h.prototype,"stippleEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"stippleOffColorEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"stipplePreferContinuous",void 0);b.__decorate([l.parameter()],
h.prototype,"roundJoins",void 0);b.__decorate([l.parameter()],h.prototype,"applyMarkerOffset",void 0);b.__decorate([l.parameter()],h.prototype,"vvSize",void 0);b.__decorate([l.parameter()],h.prototype,"vvColor",void 0);b.__decorate([l.parameter()],h.prototype,"vvOpacity",void 0);b.__decorate([l.parameter()],h.prototype,"falloffEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"innerColorEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"hasOccludees",void 0);b.__decorate([l.parameter()],
h.prototype,"multipassEnabled",void 0);b.__decorate([l.parameter()],h.prototype,"cullAboveGround",void 0);b.__decorate([l.parameter()],h.prototype,"wireframe",void 0);b.__decorate([l.parameter()],h.prototype,"objectAndLayerIdColorInstanced",void 0);b.__decorate([l.parameter({constValue:!1})],h.prototype,"occlusionPass",void 0);b.__decorate([l.parameter({constValue:!0})],h.prototype,"hasVvInstancing",void 0);b.__decorate([l.parameter({constValue:!0})],h.prototype,"hasSliceTranslatedView",void 0);a.RibbonLineTechniqueConfiguration=
h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/RibbonLineTechnique":function(){define("require exports ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/OrderIndependentTransparency ../lib/Program ../lib/StencilUtils ../lib/TransparencyPassType ../lib/VertexAttribute ../../../../chunks/RibbonLine.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),function(a,
b,q,l,p,k,h,f,c,e,g,d,t){const w=new Map([[e.VertexAttribute.POSITION,0],[e.VertexAttribute.PREVPOSITION,1],[e.VertexAttribute.NEXTPOSITION,2],[e.VertexAttribute.SUBDIVISIONFACTOR,3],[e.VertexAttribute.UV0,4],[e.VertexAttribute.COLOR,5],[e.VertexAttribute.COLORFEATUREATTRIBUTE,5],[e.VertexAttribute.SIZE,6],[e.VertexAttribute.SIZEFEATUREATTRIBUTE,6],[e.VertexAttribute.OPACITYFEATUREATTRIBUTE,7],[e.VertexAttribute.OBJECTANDLAYERIDCOLOR,8]]);class v extends p.ShaderTechnique{initializeProgram(r){return new h.Program(r.rctx,
v.shader.get().build(this.configuration),w)}_makePipelineState(r,n){const u=this.configuration,x=r===c.TransparencyPassType.NONE,y=r===c.TransparencyPassType.FrontFace,z=q.isDepthLikeOutput(u.output);return t.makePipelineState({blending:u.output===q.ShaderOutput.Color?x?k.blendingDefault:k.oitBlending(r):null,depthTest:{func:k.oitDepthTest(r)},depthWrite:x?u.writeDepth||z?t.defaultDepthWriteParams:null:k.oitDepthWrite(r),drawBuffers:u.output===q.ShaderOutput.Depth?{buffers:[d.SpecialDrawBuffers.NONE]}:
k.oitDrawBuffers(r),colorWrite:t.defaultColorWriteParams,stencilWrite:u.hasOccludees?f.stencilWriteMaskOn:null,stencilTest:u.hasOccludees?n?f.stencilToolMaskBaseParams:f.stencilBaseAllZerosParams:null,polygonOffset:x||y?u.hasPolygonOffset?m:null:k.OITPolygonOffset})}initializePipeline(){const r=this.configuration;if(r.occluder){const n=r.hasPolygonOffset?m:null;this._occluderPipelineTransparent=t.makePipelineState({blending:k.blendingDefault,polygonOffset:n,depthTest:f.depthCompareAlways,depthWrite:null,
colorWrite:t.defaultColorWriteParams,stencilWrite:null,stencilTest:f.stencilToolTransparentOccluderParams,drawBuffers:r.output===q.ShaderOutput.Depth?{buffers:[d.SpecialDrawBuffers.NONE]}:null});this._occluderPipelineOpaque=t.makePipelineState({blending:k.blendingDefault,polygonOffset:n,depthTest:f.depthCompareAlways,depthWrite:null,colorWrite:t.defaultColorWriteParams,stencilWrite:f.stencilWriteMaskOff,stencilTest:f.stencilToolMaskOccluderParams,drawBuffers:r.output===q.ShaderOutput.Depth?{buffers:[d.SpecialDrawBuffers.NONE]}:
null});this._occluderPipelineMaskWrite=t.makePipelineState({blending:null,polygonOffset:n,depthTest:f.depthCompareLess,depthWrite:null,colorWrite:null,stencilWrite:f.stencilWriteMaskOn,stencilTest:f.stencilToolMaskBaseParams,drawBuffers:r.output===q.ShaderOutput.Depth?{buffers:[d.SpecialDrawBuffers.NONE]}:null})}this._occludeePipelineState=this._makePipelineState(this.configuration.transparencyPassType,!0);return this._makePipelineState(this.configuration.transparencyPassType,!1)}get primitiveType(){return this.configuration.wireframe?
d.PrimitiveType.LINES:d.PrimitiveType.TRIANGLE_STRIP}getPipeline(r,n,u){return r?this._occludeePipelineState:this.configuration.occluder?u?this._occluderPipelineTransparent:n?this._occluderPipelineOpaque:this._occluderPipelineMaskWrite:super.getPipeline()}}v.shader=new l.ReloadableShaderModule(g.RibbonLine,()=>new Promise((r,n)=>a(["./RibbonLine.glsl"],r,n)));const m={factor:0,units:-4};b.RibbonLineTechnique=v;b.vertexAttributeLocations=w;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/lib/RenderContext":function(){define("exports ../../../../core/time ../../webgl/RenderCamera ../core/shaderLibrary/ShaderOutput ./BindParameters ./Material".split(" "),function(a,b,q,l,p,k){class h{constructor(e,g,d=null){this.rctx=e;this.sliceHelper=d;this.lastFrameCamera=new q;this.output=l.ShaderOutput.Color;this.renderOccludedMask=c;this.bindParameters=new p.BindParameters(g,null!=d?d.plane:null);this.bindParameters.alignPixelEnabled=!0}}class f extends h{constructor(e,
g,d,t){super(e,d,t);this.offscreenRenderingHelper=g;this.sliceHelper=t;this.time=b.Milliseconds(0)}}const c=k.RenderOccludedFlag.Occlude|k.RenderOccludedFlag.OccludeAndTransparent|k.RenderOccludedFlag.OccludeAndTransparentStencil;a.OverlayRenderContext=h;a.RenderContext=f;a.defaultRenderOccludedMask=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ShadowMap":function(){define("exports ../../../../core/has ../../../../core/mathUtils ../../../../core/maybe ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../ViewingMode ../../webgl/formats ./CascadeCamera ./textureUtils ./Util ../../../webgl/enums ../../../webgl/Texture".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){function y(ca,ea){f.set(ba,ca[ea],ca[ea+3]);return ba}a.SnapshotSlot=void 0;(function(ca){ca[ca.Highlight=0]="Highlight";ca[ca.ExcludeHighlight=1]="ExcludeHighlight"})(a.SnapshotSlot||(a.SnapshotSlot={}));class z{constructor(){this.camera=new m.CascadeCamera;this.lightMat=h.create()}}class A{constructor(){this.maxNumCascadesLowQuality=this.maxNumCascadesHighQuality=4;this.textureSizeModHighQuality=1.3;this.textureSizeModLowQuality=.9;this.splitSchemeLambda=
0}}class B{constructor(ca,ea){this._fbos=ca;this._viewingMode=ea;this._enabled=!1;this._snapshots=[];this._textureHeight=0;this._numCascades=1;this.settings=new A;this._projectionView=h.create();this._projectionViewInverse=h.create();this._modelViewLight=h.create();this._cascadeDistances=[0,0,0,0,0];this._usedCascadeDistances=t.create();this._cascades=[new z,new z,new z,new z];this._lastOrigin=null;this._maxTextureWidth=Math.min(b("esri-mobile")?4096:16384,ca.rctx.parameters.maxTextureSize)}dispose(){this.enabled=
!1;this.disposeOffscreenBuffers()}get depthTexture(){return this._handle?.getTexture()}get _textureWidth(){return this._textureHeight*this._numCascades}get numCascades(){return this._numCascades}get cascadeDistances(){return d.set(this._usedCascadeDistances,this._cascadeDistances[0],1<this._numCascades?this._cascadeDistances[1]:Infinity,2<this._numCascades?this._cascadeDistances[2]:Infinity,3<this._numCascades?this._cascadeDistances[3]:Infinity)}disposeOffscreenBuffers(){this._handle=l.releaseMaybe(this._handle);
this._discardSnapshots()}set maxCascades(ca){this.settings.maxNumCascadesHighQuality=q.clamp(Math.floor(ca),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(ca){(this._enabled=ca)||this.disposeOffscreenBuffers()}get enabled(){return this._enabled}get ready(){return this._enabled&&null!=this.depthTexture}get cascades(){for(let ca=0;ca<this._numCascades;++ca)L[ca]=this._cascades[ca];L.length=this._numCascades;return L}start(ca,ea,da,ia,ka){n.assert(this.enabled);let {near:fa,
far:X}=da;2>fa&&(fa=2);2>X&&(X=2);fa>=X&&(fa=2,X=4);const {near:ja,far:la}={near:fa,far:X};this._computeCascadeDistances(ja,la,ia);this._textureHeight=this._computeTextureHeight(ca,ka,ia);this._setupMatrices(ca,ea);const {viewMatrix:na,projectionMatrix:va}=ca;for(ca=0;ca<this._numCascades;++ca)this._constructCascade(ca,va,na,ea);this._lastOrigin=null;this.clear()}finish(){n.assert(this.enabled);this._handle?.detachDepth()}getShadowMapMatrices(ca){if(!this._lastOrigin||!e.exactEquals(ca,this._lastOrigin)){this._lastOrigin=
this._lastOrigin||g.create();e.copy(this._lastOrigin,ca);for(let ea=0;ea<this._numCascades;++ea){k.translate(P,this._cascades[ea].lightMat,ca);for(let da=0;16>da;++da)M[16*ea+da]=P[da]}}return M}moveSnapshot(ca){n.assert(this.enabled);this._handle?.detachDepth();this._snapshots[ca]?.release();this._snapshots[ca]=this._handle;this._handle=null;this.clear()}copySnapshot(ca){var ea=this._handle?.getTexture()?.descriptor;if(this.enabled&&ea){this._snapshots[ca]?.release();var {width:da,height:ia}=ea;
this._snapshots[ca]=this._fbos.acquire(da,ia,ca===a.SnapshotSlot.Highlight?"shadow highlight snapshot":"shadow no highlight snapshot",v.ColorFormat.RGBA4);ea=this._fbos.rctx;this._bindFbo();ca=ea.bindTexture(this._snapshots[ca]?.getTexture(),x.Texture.TEXTURE_UNIT_FOR_UPDATES);ea.gl.copyTexSubImage2D(u.TextureType.TEXTURE_2D,0,0,0,0,0,da,ia);ea.bindTexture(ca,x.Texture.TEXTURE_UNIT_FOR_UPDATES)}}getSnapshot(ca){return this.enabled?this._snapshots[ca]?.getTexture():null}clear(){const ca=this._fbos.rctx;
this._ensureFbo();this._bindFbo();ca.setClearColor(1,1,1,1);ca.clear(u.ClearBufferBit.COLOR_BUFFER_BIT|u.ClearBufferBit.DEPTH_BUFFER_BIT)}_computeTextureHeight(ca,ea,da){ca=r.applyTextureResizeModulo(Math.floor(Math.min(window.devicePixelRatio,ea)/ca.pixelRatio*Math.max(ca.fullWidth,ca.fullHeight)*(da?this.settings.textureSizeModHighQuality:this.settings.textureSizeModLowQuality)));return r.applyTextureResizeFloorModulo(Math.min(this._maxTextureWidth,this._numCascades*ca)/this._numCascades)}_ensureFbo(){if(this._handle?.fbo?.width!==
this._textureWidth||this._handle?.fbo.height!==this._textureHeight)this._handle?.release(),this._handle=this._fbos.acquire(this._textureWidth,this._textureHeight,"shadow map",v.ColorFormat.RGBA4);this._handle?.acquireDepth(v.DepthFormat.DEPTH16_BUFFER)}_discardSnapshot(ca){this._snapshots[ca]=l.releaseMaybe(this._snapshots[ca])}_discardSnapshots(){for(let ca=0;ca<this._snapshots.length;++ca)this._discardSnapshot(ca);this._snapshots.length=0}_bindFbo(){const ca=this._fbos.rctx;ca.unbindTexture(this.depthTexture);
ca.bindFramebuffer(this._handle?.fbo)}_constructCascade(ca,ea,da,ia){const ka=this._cascades[ca];var fa=-this._cascadeDistances[ca],X=-this._cascadeDistances[ca+1];fa=(ea[10]*fa+ea[14])/Math.abs(ea[11]*fa+ea[15]);ea=(ea[10]*X+ea[14])/Math.abs(ea[11]*X+ea[15]);n.assert(fa<ea);for(X=0;8>X;++X){d.set(D,0===X%4||3===X%4?-1:1,0===X%4||1===X%4?-1:1,4>X?fa:ea,1);var ja=F[X];d.transformMat4(ja,D,this._projectionViewInverse);ja[0]/=ja[3];ja[1]/=ja[3];ja[2]/=ja[3]}e.negate(O,F[0]);ka.camera.viewMatrix=k.translate(C,
this._modelViewLight,O);for(fa=0;8>fa;++fa)e.transformMat4(F[fa],F[fa],ka.camera.viewMatrix);fa=F[0][2];ea=F[0][2];for(X=1;8>X;++X)fa=Math.min(fa,F[X][2]),ea=Math.max(ea,F[X][2]);fa-=200;ea+=200;ka.camera.near=-ea;ka.camera.far=-fa;X=ka.camera;ja=1/F[0][3];var la=1/F[4][3];n.assert(ja<la);ja+=Math.sqrt(ja*la);var na=Math.sin(q.acosClamped(da[2]*ia[0]+da[6]*ia[1]+da[10]*ia[2]));da=F;var va=ja/na;ia=H;var za=N,ya=E;la=G;ja=I;f.set(K,0,0);for(var Da=0;4>Da;++Da)f.add(K,K,da[Da]);f.scale(K,K,.25);f.set(J,
0,0);for(Da=4;8>Da;++Da)f.add(J,J,da[Da]);f.scale(J,J,.25);f.lerp(R[0],da[4],da[5],.5);f.lerp(R[1],da[5],da[6],.5);f.lerp(R[2],da[6],da[7],.5);f.lerp(R[3],da[7],da[4],.5);Da=0;var ra=f.squaredDistance(R[0],K);for(var xa=1;4>xa;++xa){var Ma=f.squaredDistance(R[xa],K);Ma<ra&&(ra=Ma,Da=xa)}f.subtract(Q,R[Da],da[Da+4]);Da=Q[0];Q[0]=-Q[1];Q[1]=Da;f.subtract(W,J,K);0>f.dot(W,Q)&&f.negate(Q,Q);f.lerp(Q,Q,W,na);f.normalize(Q,Q);na=Da=f.dot(f.subtract(S,da[0],K),Q);for(ra=1;8>ra;++ra)xa=f.dot(f.subtract(S,
da[ra],K),Q),xa<na?na=xa:xa>Da&&(Da=xa);f.copy(ia,K);f.scale(S,Q,na-va);f.add(ia,ia,S);xa=-1;Ma=1;va=ra=0;for(let Ga=0;8>Ga;++Ga){f.subtract(V,da[Ga],ia);f.normalize(V,V);const Pa=Q[0]*V[1]-Q[1]*V[0];0<Pa?Pa>xa&&(xa=Pa,ra=Ga):Pa<Ma&&(Ma=Pa,va=Ga)}n.verify(0<xa,"leftArea");n.verify(0>Ma,"rightArea");f.scale(T,Q,na);f.add(T,T,K);f.scale(Y,Q,Da);f.add(Y,Y,K);ha[0]=-Q[1];ha[1]=Q[0];za=n.rayRay2D(ia,da[va],Y,f.add(S,Y,ha),1,za);ya=n.rayRay2D(ia,da[ra],Y,S,1,ya);la=n.rayRay2D(ia,da[ra],T,f.add(S,T,ha),
1,la);da=n.rayRay2D(ia,da[va],T,S,1,ja);n.verify(za,"rayRay");n.verify(ya,"rayRay");n.verify(la,"rayRay");n.verify(da,"rayRay");ya=H;da=N;ia=G;la=I;ja=X.projectionMatrix;f.subtract(U,ia,la);f.scale(U,U,.5);Z[0]=U[0];Z[1]=U[1];Z[2]=0;Z[3]=U[1];Z[4]=-U[0];Z[5]=0;Z[6]=U[0]*U[0]+U[1]*U[1];Z[7]=U[0]*U[1]-U[1]*U[0];Z[8]=1;Z[6]=-f.dot(y(Z,0),ya);Z[7]=-f.dot(y(Z,1),ya);ya=f.dot(y(Z,0),ia)+Z[6];za=f.dot(y(Z,1),ia)+Z[7];va=f.dot(y(Z,0),la)+Z[6];la=f.dot(y(Z,1),la)+Z[7];ya=-(ya+va)/(za+la);Z[0]+=Z[1]*ya;Z[3]+=
Z[4]*ya;Z[6]+=Z[7]*ya;ya=1/(f.dot(y(Z,0),ia)+Z[6]);za=1/(f.dot(y(Z,1),ia)+Z[7]);Z[0]*=ya;Z[3]*=ya;Z[6]*=ya;Z[1]*=za;Z[4]*=za;Z[7]*=za;Z[2]=Z[1];Z[5]=Z[4];Z[8]=Z[7];Z[7]+=1;ya=f.dot(y(Z,1),da)+Z[7];za=f.dot(y(Z,2),da)+Z[8];va=f.dot(y(Z,1),ia)+Z[7];la=f.dot(y(Z,2),ia)+Z[8];ya=-.5*(ya/za+va/la);Z[1]+=Z[2]*ya;Z[4]+=Z[5]*ya;Z[7]+=Z[8]*ya;ya=f.dot(y(Z,1),da)+Z[7];za=f.dot(y(Z,2),da)+Z[8];va=-za/ya;Z[1]*=va;Z[4]*=va;Z[7]*=va;ja[0]=Z[0];ja[1]=Z[1];ja[2]=0;ja[3]=Z[2];ja[4]=Z[3];ja[5]=Z[4];ja[6]=0;ja[7]=Z[5];
ja[8]=0;ja[9]=0;ja[10]=1;ja[11]=0;ja[12]=Z[6];ja[13]=Z[7];ja[14]=0;ja[15]=Z[8];X.projectionMatrix[10]=2/(fa-ea);X.projectionMatrix[14]=-(fa+ea)/(fa-ea);k.multiply(ka.lightMat,ka.camera.projectionMatrix,ka.camera.viewMatrix);fa=this._textureHeight;ka.camera.viewport=[ca*fa,0,fa,fa]}_setupMatrices(ca,ea){k.multiply(this._projectionView,ca.projectionMatrix,ca.viewMatrix);k.invert(this._projectionViewInverse,this._projectionView);ca=this._viewingMode===w.ViewingMode.Global?ca.eye:e.set(O,0,0,1);k.lookAt(this._modelViewLight,
[0,0,0],[-ea[0],-ea[1],-ea[2]],ca)}_computeCascadeDistances(ca,ea,da){da=da?this.settings.maxNumCascadesHighQuality:this.settings.maxNumCascadesLowQuality;this._numCascades=Math.min(1+Math.floor(n.logWithBase(ea/ca,4)),da);da=(ea-ca)/this._numCascades;ea=(ea/ca)**(1/this._numCascades);let ia=ca;for(let ka=0;ka<this._numCascades+1;++ka)this._cascadeDistances[ka]=q.lerp(ia,ca,this.settings.splitSchemeLambda),ia*=ea,ca+=da}get test(){}}const C=h.create(),D=t.create(),F=[];for(let ca=0;8>ca;++ca)F.push(t.create());
const H=c.create(),N=c.create(),E=c.create(),G=c.create(),I=c.create(),O=g.create(),L=[],P=h.create(),M=h.IDENTITY.concat(h.IDENTITY,h.IDENTITY,h.IDENTITY,h.IDENTITY),K=c.create(),J=c.create(),R=[c.create(),c.create(),c.create(),c.create()],Q=c.create(),W=c.create(),S=c.create(),V=c.create(),T=c.create(),Y=c.create(),ha=c.create(),ba=c.create(),U=c.create(),Z=p.create();a.ShadowMap=B;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/CascadeCamera":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../webgl/RenderCamera".split(" "),
function(a,b,q,l,p,k,h,f,c){a.CascadeCamera=class extends c{constructor(){super(...arguments);this._projectionMatrix=f.create()}get projectionMatrix(){return this._projectionMatrix}};b.__decorate([q.property()],a.CascadeCamera.prototype,"_projectionMatrix",void 0);b.__decorate([q.property({readOnly:!0})],a.CascadeCamera.prototype,"projectionMatrix",null);a.CascadeCamera=b.__decorate([h.subclass("esri.views.3d.webgl-engine.lib.CascadeCamera")],a.CascadeCamera);Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/MapUtils ../../../../core/PooledArray ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/sphere ../../terrain/Intersector ../core/shaderLibrary/ShaderOutput ./ChangeSet ./Intersector ./IntersectorInterfaces ./Material ./ModelDirtyTypes ./rendererUtils ./RenderSlot ../materials/renderers/MergedRenderer".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){function A(D,F,H,N,E,G,I){const O=new t.OverlayTarget(G,I,F);F=L=>{L.set(r.IntersectorType.OVERLAY,O,D.dist,D.normal,D.transformation,H,N)};(null==E.results.min.drapedLayerOrder||H>=E.results.min.drapedLayerOrder)&&(null==E.results.min.dist||E.results.ground.dist<=E.results.min.dist)&&F(E.results.min);E.options.store!==r.StoreResults.MIN&&(null==E.results.max.drapedLayerOrder||H<E.results.max.drapedLayerOrder)&&(null==E.results.max.dist||E.results.ground.dist>
E.results.max.dist)&&F(E.results.max);E.options.store===r.StoreResults.ALL&&(G=m.newIntersectorResult(E.ray),F(G),E.results.all.push(G))}a.SortedRenderGeometryRenderer=class extends q{constructor(D){super(D);this._pending=new B;this._changes=new v.ChangeSet;this._materialRenderers=new Map;this._sortedMaterialRenderers=new k;this._geometries=new Map;this._hasWater=this._hasHighlights=!1}destroy(){this._changes.prune();this._materialRenderers.forEach(D=>D.destroy());this._materialRenderers.clear();
this._sortedMaterialRenderers.clear();this._geometries.clear();this._pending.clear()}get updating(){return!this._pending.empty||0<this._changes.updates.length}get rctx(){return this.rendererContext.rctx}get _materials(){return this.rendererContext.materials}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}get hasWater(){return this._hasWater}get rendersOccludedDraped(){return p.someMap(this._materialRenderers,D=>0!==D.numGeometries&&
!D.queryRenderOccludedState(n.RenderOccludedFlag.Occlude))}get isEmpty(){return!this.updating&&0===this._materialRenderers.size&&0===this._geometries.size}getMaterialRenderer(D){return this._materialRenderers.get(D)}commitChanges(){if(!this.updating)return!1;this._processAddsRemoves();let D=!1;x.splitRenderGeometryChangeSetByMaterial(this._changes).forEach((F,H)=>{var N=this.getMaterialRenderer(H);!N&&0<F.adds.length&&(N=new z.MergedRenderer({material:H}),N.initializeRenderContext(this.rendererContext.pluginContext,
this._materials),this._materialRenderers.set(H,N),D=!0);N&&(N.modify(F),0===N.numGeometries&&(this._materialRenderers.delete(H),N.destroy(),D=!0))});this._changes.clear();D&&this._updateSortedMaterialRenderers();this._hasHighlights=p.someMap(this._materialRenderers,F=>(F=F.produces.get(y.RenderSlot.DRAPED_MATERIAL))?F(w.ShaderOutput.Highlight):!1);this._hasWater=p.someMap(this._materialRenderers,F=>(F=F.produces.get(y.RenderSlot.DRAPED_WATER))?F(w.ShaderOutput.Normal):!1);this.notifyChange("updating");
return!0}addGeometries(D,F){if(0!==D.length){var H=this._validateRenderGeometries(D);for(var N of H)this._geometries.set(N.id,N);N=this._pending.empty;for(const E of H)this._pending.adds.add(E);N&&this.notifyChange("updating");F===u.DirtyOperation.UPDATE&&this._notifyGraphicGeometryChanged(D)}}removeGeometries(D,F){const H=this._pending.empty,N=this._pending.adds;for(const E of D)N.has(E)?(this._pending.removed.add(E),N.delete(E)):this._pending.removed.has(E)||this._pending.removes.add(E),this._geometries.delete(E.id);
H&&!this._pending.empty&&this.notifyChange("updating");F===u.DirtyOperation.UPDATE&&this._notifyGraphicGeometryChanged(D)}modifyGeometries(D,F){const H=0===this._changes.updates.length;for(const N of D){const E=this._changes.updates.pushNew();E.renderGeometry=this._validateRenderGeometry(N);E.updateType=F}H&&0<this._changes.updates.length&&this.notifyChange("updating");switch(F){case u.DirtyState.TRANSFORMATION:case u.DirtyState.GEOMETRY:return this._notifyGraphicGeometryChanged(D);case u.DirtyState.VISIBILITY:return this._notifyGraphicVisibilityChanged(D)}}updateAnimation(D){let F=
!1;this._sortedMaterialRenderers.forAll(H=>F=!!H.updateAnimation&&H.updateAnimation(D)||F);return F}shouldRender(D){return this._sortedMaterialRenderers.some(F=>F.prepareTechnique(D))}render(D){this._sortedMaterialRenderers.forAll(F=>{const H=F.prepareTechnique(D);null!=H&&F.renderNode(D,H)})}intersect(D,F,H,N,E){this._geometries.forEach(G=>{if(!N||N(G)){this._intersectRenderGeometry(G,H,F,0,D,E);var I=this.rendererContext.longitudeCyclical;I&&(G.boundingSphere[0]-G.boundingSphere[3]<I.min&&this._intersectRenderGeometry(G,
H,F,I.range,D,E),G.boundingSphere[0]+G.boundingSphere[3]>I.max&&this._intersectRenderGeometry(G,H,F,-I.range,D,E));E++}});return E}_updateSortedMaterialRenderers(){this._sortedMaterialRenderers.clear();let D=0;for(const F of this._materialRenderers.values())F.drapedPriority=D++,this._sortedMaterialRenderers.push(F);this._sortedMaterialRenderers.sort((F,H)=>H.materialReference?.renderPriority===F.materialReference?.renderPriority?F.drapedPriority-H.drapedPriority:(H.materialReference?.renderPriority||
0)-(F.materialReference?.renderPriority||0))}_processAddsRemoves(){this._changes.adds.clear();this._changes.removes.clear();this._changes.adds.pushArray(Array.from(this._pending.adds));this._changes.removes.pushArray(Array.from(this._pending.removes));for(let D=0;D<this._changes.updates.length;)this._pending.has(this._changes.updates.data[D].renderGeometry)?this._changes.updates.removeUnorderedIndex(D):D++;this._pending.clear()}_intersectRenderGeometry(D,F,H,N,E,G){if(D.visible){var I=0;N+=D.transformation[12];
I=D.transformation[13];C[0]=H[0]-N;C[1]=H[1]-I;D.screenToWorldRatio=this.rendererContext.screenToWorldRatio;D.material.intersectDraped(D,null,E,C,(O,L,P)=>{A(F,P,G,D.material.renderPriority,E,D.layerUid,D.graphicUid)},F)}}_notifyGraphicGeometryChanged(D){if(null!=this.drapeSource.notifyGraphicGeometryChanged)for(const H of D)if(D=H.graphicUid,null!=D&&D!==F){this.drapeSource.notifyGraphicGeometryChanged(D);var F=D}}_notifyGraphicVisibilityChanged(D){if(null!=this.drapeSource.notifyGraphicVisibilityChanged)for(const H of D)if(D=
H.graphicUid,null!=D&&D!==F){this.drapeSource.notifyGraphicVisibilityChanged(D);var F=D}}_validateRenderGeometries(D){for(const F of D)this._validateRenderGeometry(F);return D}_validateRenderGeometry(D){null==D.localOrigin&&(D.localOrigin=this._localOriginFactory.getOrigin(d.getCenter(D.boundingSphere)));return D}get test(){}};b.__decorate([h.property()],a.SortedRenderGeometryRenderer.prototype,"drapeSource",void 0);b.__decorate([h.property()],a.SortedRenderGeometryRenderer.prototype,"updating",null);
b.__decorate([h.property()],a.SortedRenderGeometryRenderer.prototype,"rctx",null);b.__decorate([h.property({constructOnly:!0})],a.SortedRenderGeometryRenderer.prototype,"rendererContext",void 0);b.__decorate([h.property()],a.SortedRenderGeometryRenderer.prototype,"_materials",null);b.__decorate([h.property()],a.SortedRenderGeometryRenderer.prototype,"_localOriginFactory",null);b.__decorate([h.property({readOnly:!0})],a.SortedRenderGeometryRenderer.prototype,"isEmpty",null);b.__decorate([h.property()],
a.SortedRenderGeometryRenderer.prototype,"_materialRenderers",void 0);b.__decorate([h.property()],a.SortedRenderGeometryRenderer.prototype,"_geometries",void 0);a.SortedRenderGeometryRenderer=b.__decorate([e.subclass("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],a.SortedRenderGeometryRenderer);class B{constructor(){this.adds=new Set;this.removes=new Set;this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(D){return this.adds.has(D)||
this.removes.has(D)||this.removed.has(D)}clear(){this.adds.clear();this.removes.clear();this.removed.clear()}}const C=g.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/Intersector":function(){define(["exports","../webgl-engine/lib/IntersectorInterfaces","../webgl-engine/lib/IntersectorTarget","../webgl-engine/lib/intersectorUtils"],function(a,b,q,l){class p extends q.Graphic3DTarget{constructor(k,h,f){super(k,h);this.triangleNr=f}}a.OverlayTarget=p;
a.isOverlayIntersectorResult=function(k){return l.isValidIntersectorResult(k)&&k.intersector===b.IntersectorType.OVERLAY&&!!k.target};a.isTerrainIntersectorResult=function(k){return l.isValidIntersectorResult(k)&&k.intersector===b.IntersectorType.TERRAIN&&!!k.target};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ModelDirtyTypes":function(){define(["exports"],function(a){a.DirtyOperation=void 0;(function(b){b[b.ADD=0]="ADD";b[b.UPDATE=1]="UPDATE";b[b.REMOVE=
2]="REMOVE"})(a.DirtyOperation||(a.DirtyOperation={}));a.DirtyState=void 0;(function(b){b[b.NONE=0]="NONE";b[b.VISIBILITY=1]="VISIBILITY";b[b.GEOMETRY=2]="GEOMETRY";b[b.TRANSFORMATION=4]="TRANSFORMATION";b[b.HIGHLIGHT=8]="HIGHLIGHT";b[b.OCCLUDEE=16]="OCCLUDEE"})(a.DirtyState||(a.DirtyState={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/renderers/MergedRenderer":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/arrayUtils ../../../../../core/has ../../../../../core/MapUtils ../../../../../core/mathUtils ../../../../../core/maybe ../../../../../core/NestedMap ../../../../../core/PooledArray ../../../../../core/accessorSupport/decorators/property ../../../../../core/Logger ../../../../../core/accessorSupport/decorators/subclass ../../../../../core/libs/gl-matrix-2/math/mat4 ../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../support/buffer/glUtil ../../core/shaderLibrary/ShaderOutput ../../effects/RenderPlugin ../../lib/GLMaterials ../../lib/ModelDirtyTypes ../../lib/RenderSlot ../../lib/Util ../DrawParameters ./BufferRange ./Instance ./PerBufferData ./PerOriginData ./VaoCache".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F){function H(K,J){let R;if(!K.some(W=>{if(W.numElements<J)return!1;R=W;return!0}))return null;const Q=R.from;R.from+=J;R.from>=R.to&&K.removeUnordered(R);return Q}function N(K){M.length<K&&(M=new Float32Array(K));return M}function E(K){K*=4;return 1024>=K?1024:262144>K?k.nextHighestPowerOfTwo(K):Math.max(Math.min(262144*Math.ceil(1.5*K/262144),16777216),K)}a.MergedRenderer=class extends r.SyncPrepareRenderPlugin{constructor(K){super(K);
this._bufferWriter=this._glMaterials=this._vaoCache=null;this._dataByOrigin=new Map;this._hasOccludees=this._hasHighlights=!1;this._produces=new Map;this.drapedPriority=0}destroy(){this._glMaterials=h.disposeMaybe(this._glMaterials);this._dataByOrigin.forEach(K=>K.dispose());this._dataByOrigin.clear();this._vaoCache=h.disposeMaybe(this._vaoCache)}initialize(){this.material.produces.forEach((K,J)=>{this._produces.set(J,R=>0!==this._dataByOrigin.size&&(R!==m.ShaderOutput.Highlight&&R!==m.ShaderOutput.ShadowHighlight||
this._hasHighlights)?K(R):!1)})}get produces(){return this._produces}initializeRenderContext(K,J){const {rctx:R}=K.renderContext;this._glMaterials=new n.GLMaterials(this.material,J??K.materials);this._bufferWriter=this.material.createBufferWriter();this._vaoCache=new F.VaoCache(R,this.material.vertexAttributeLocations,v.glLayout(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get hasOccludees(){return this._hasOccludees}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(K){return this.material.queryRenderOccludedState(K)}get materialReference(){return this.material}get numGeometries(){let K=
0;this._dataByOrigin.forEach(J=>K+=J.buffers.reduce((R,Q)=>R+=Q.instances.size,0));return K}get usedMemory(){let K=0;this._dataByOrigin.forEach(J=>K+=J.buffers.reduce((R,Q)=>R+Q.vao.usedMemory,0));return K}forEachGeometry(K){this._dataByOrigin.forEach(J=>J.buffers.forEach(R=>R.instances.forEach(Q=>K(Q.geometry))))}modify(K){this._updateGeometries(K.updates);this._addAndRemoveGeometries(K.adds,K.removes);this._updateDrawCommands()}_updateGeometries(K){const J=this._bufferWriter;if(null!==J){var R=
J.vertexBufferLayout.stride/4;for(const W of K){K=W.renderGeometry;const S=this._dataByOrigin.get(K.localOrigin.id)?.findBuffer(K.id);if(null==S)break;const V=S.instances.get(K.id);if(W.updateType&(u.DirtyState.GEOMETRY|u.DirtyState.TRANSFORMATION)){var Q=J.elementCount(V.geometry.geometry)*R;Q=N(Q);const T=J.vertexBufferLayout.createView(Q.buffer);this._writeGeometry(K,T,0);S.vao.vertexBuffers.geometry.setSubData(Q,V.from*R,0,V.numElements*R)}W.updateType&(u.DirtyState.HIGHLIGHT|u.DirtyState.OCCLUDEE|
u.DirtyState.VISIBILITY)&&(S.drawCommandsDirty=!0)}}}_computeDeltas(K,J){const R=new f.NestedMap;for(var Q of K){K=Q.localOrigin;if(null==K)continue;let W=R.get(K.id,null);null==W&&(W=new G(K.vec3),R.set(K.id,null,W));W.changes.push(Q)}for(const W of J)J=W.localOrigin,null!=J&&(Q=this._dataByOrigin.get(J.id)?.findBuffer(W.id),null!=Q&&(K=R.get(J.id,Q),null==K&&(K=new G(J.vec3),R.set(J.id,Q,K)),K.changes.push(W)));return R}_addAndRemoveGeometries(K,J){if(null!==this._bufferWriter&&null!==this._vaoCache){var {_bufferWriter:R,
_dataByOrigin:Q}=this,W=R.vertexBufferLayout.stride/4,S=this._computeDeltas(K,J);S.forEach((V,T)=>{const Y=V.get(null),ha=null!=Y?Y.changes:[];S.delete(T,null);let ba=Q.get(T);V.forEach((U,Z)=>{S.delete(T,Z);if(null==Z)y.assert(!1,"No VAO for removed geometries");else if(Z.instances.size===U.changes.length)this._vaoCache.deleteVao(Z.vao),q.removeUnordered(ba.buffers,Z),0===ba.buffers.length&&0===ha.length&&Q.delete(T);else{var ca=Z.numElements,ea=Z.vao.byteSize/4,da=ha.reduce((ka,fa)=>ka+R.elementCount(fa.geometry),
0),ia=U.changes.reduce((ka,fa)=>ka+R.elementCount(fa.geometry),0);ca=Math.min((ca+da-ia)*W,4194304);da=ca>ea;65536<ca&&ca<ea/2?(U.changes.forEach(({id:ka})=>Z.deleteInstance(ka)),Z.instances.forEach(({geometry:ka})=>ha.push(ka)),this._vaoCache.deleteVao(Z.vao),q.removeUnordered(ba.buffers,Z)):da?this._applyAndRebuild(Z,ha,U):this._applyRemoves(Z,U)}});if(0<ha.length)for(null==ba&&(ba=new D.PerOriginData(Y.origin),Q.set(T,ba)),ba.buffers.forEach(U=>this._applyAdds(U,ha));0<ha.length;)ba.buffers.push(this._applyAndRebuild(new C.PerBufferData,
ha,null))})}}_updateDrawCommands(){this._hasOccludees=this._hasHighlights=!1;this._dataByOrigin.forEach(K=>{K.buffers.forEach(J=>{J.drawCommandsDirty&&(J.hasHiddenInstances=!1,J.hasHighlights=!1,J.hasOccludees=!1,p.someMap(J.instances,R=>{J.updateDrawState(R);return J.hasHiddenInstances&&J.hasHighlights&&J.hasOccludees}),J.updateDrawCommands(this._bufferWriter.vertexBufferLayout.stride));this._hasHighlights=this._hasHighlights||J.hasHighlights;this._hasOccludees=this._hasOccludees||J.hasOccludees})})}_applyAndRebuild(K,
J,R){if(null!=R)for(var Q of R.changes)K.deleteInstance(Q.id);const W=this._bufferWriter;R=W.vertexBufferLayout.stride;Q=R/4;var S=Math.floor(4194304/Q);let V=K.numElements;for(;0<J.length;){const ba=J.pop();var T=W.elementCount(ba.geometry);if(V+T>S&&0<V){J.push(ba);break}V+=T;T=new B.Instance(ba,0,0);y.assert(null==K.instances.get(ba.id));K.addInstance(ba.id,T)}J=V*Q;S=N(J);const Y=W.vertexBufferLayout.createView(S.buffer);let ha=0;K.hasHiddenInstances=!1;K.hasHighlights=!1;K.hasOccludees=!1;K.instances.forEach((ba,
U)=>{this._writeGeometry(ba.geometry,Y,ha);const Z=ha;ha+=W.elementCount(ba.geometry.geometry);K.updateInstance(U,Z,ha);K.updateDrawState(ba)});this._vaoCache.deleteVao(K.vao);K.vao=this._vaoCache.newVao(E(J));K.vao.vertexBuffers.geometry.setSubData(S,0,0,ha*Q);K.holes.clear();J=K.holes.pushNew();J.from=ha;J.to=Math.floor(K.vao.byteSize/R);K.updateDrawCommands(R);return K}_applyRemoves(K,J){if(0!==J.changes.length&&null!==this._bufferWriter){for(var R of J.changes){var Q=R.id;if(J=K.instances.get(Q)){K.deleteInstance(Q);
if(Q=P.back()){if(Q.to===J.from){Q.to=J.to;continue}if(Q.from===J.to){Q.from=J.from;continue}}Q=P.pushNew();Q.from=J.from;Q.to=J.to}}A.mergeAdjacentRanges(P);var W=this._bufferWriter.vertexBufferLayout.stride/4;R=P.reduce((T,Y)=>Math.max(T,Y.numElements),0)*W;var S=N(R);S.fill(0,0,R);var V=K.vao.vertexBuffers.geometry;P.forAll(T=>V.setSubData(S,T.from*W,0,T.numElements*W));K.holes.pushArray(P.data,P.length);P.forAll((T,Y)=>P.data[Y]=null);P.clear();K.drawCommandsDirty=!0}}_applyAdds(K,J){if(0!==J.length&&
null!==this._bufferWriter)if(C.hasVao(K)){var R=this._bufferWriter,Q=R.vertexBufferLayout.stride/4,W=K.numElements,S=J.reduce((ea,da)=>ea+R.elementCount(da.geometry),0);W=Math.min((W+S)*Q,4194304);S=4*W;if(K.vao.byteSize<E(4128768)&&S>K.vao.byteSize)this._applyAndRebuild(K,J,null);else{A.mergeAdjacentRanges(K.holes);var V=[];for(var T of J)S=R.elementCount(T.geometry),S=H(K.holes,S),V.push(S);var Y=K.vao.vertexBuffers.geometry,ha=0,ba=0,U=0,Z=N(W),ca=R.vertexBufferLayout.createView(Z.buffer);J.forEach((ea,
da)=>{da=V[da];if(null!=da){if(U!==da){var ia=U-ba;0<ia&&Y.setSubData(Z,ba*Q,0,ia*Q);ba=da;ha=0}ia=R.elementCount(ea.geometry);this._writeGeometry(ea,ca,ha);ha+=ia;U=da+ia;da=new B.Instance(ea,da,da+ia);y.assert(null==K.instances.get(ea.id));K.addInstance(ea.id,da);K.drawCommandsDirty=!0}});T=U-ba;0<T&&Y.setSubData(Z,ba*Q,0,T*Q);q.filterInPlace(J,(ea,da)=>null==V[da])}}else this._applyAndRebuild(K,J,null)}_writeGeometry(K,J,R){if(null!==this._bufferWriter){var Q=K.localOrigin.vec3;y.setMatrixTranslation3(I,
-Q[0],-Q[1],-Q[2]);Q=t.multiply(O,I,K.transformation);t.invert(L,Q);t.transpose(L,L);this._bufferWriter.write(Q,L,K.geometry,J,R)}}updateAnimation(K){return this.material.update(K)}prepareTechnique(K){if(!this.material.shouldRender(K))return null;const {output:J,bindParameters:R}=K;if(!this.material.produces.get(R.slot)?.(J))return null;const Q=J===m.ShaderOutput.Highlight||J===m.ShaderOutput.ShadowHighlight;if(Q&&!this._hasHighlights)return null;const W=J===m.ShaderOutput.ShadowExcludeHighlight,
S=!(Q||W);for(const T of this._dataByOrigin.values())for(const Y of T.buffers){if(Q&&!Y.hasHighlights)continue;var V=(Q?Y.drawCommandsHighlight:W&&Y.needsMultipleCommands()?Y.drawCommandsShadowHighlightRest:Y.drawCommandsDefault)||null;const ha=S&&Y.drawCommandsOccludees||null;if(V?.length||ha?.length)if(V=this._glMaterials.load(K.rctx,R.slot,J),V=null!=V?V.beginSlot(R):null,null!=V)return V}return null}renderNode(K,J){const {output:R,bindParameters:Q}=K,W=R===m.ShaderOutput.Highlight||R===m.ShaderOutput.ShadowHighlight,
S=R===m.ShaderOutput.ShadowExcludeHighlight,V=!(W||S),T=Q.slot===x.RenderSlot.OCCLUDER_MATERIAL,Y=Q.slot===x.RenderSlot.TRANSPARENT_OCCLUDER_MATERIAL,ha=K.rctx;ha.runAppleAmdDriverHelper();ha.bindTechnique(J,Q,this.material.parameters);for(const ba of this._dataByOrigin.values())for(const U of ba.buffers){if(W&&!U.hasHighlights)continue;K=(W?U.drawCommandsHighlight:S&&U.needsMultipleCommands()?U.drawCommandsShadowHighlightRest:U.drawCommandsDefault)||null;const Z=V&&U.drawCommandsOccludees||null;
if(K?.length||Z?.length)J.program.bindDraw(new z.DrawParameters(ba.origin),Q,this.material.parameters),J.ensureAttributeLocations(U.vao),ha.bindVAO(U.vao),K?.length&&(ha.setPipelineState(J.getPipeline(!1,T,Y)),K.forAll(ca=>ha.drawArrays(J.primitiveType,ca.first,ca.count))),Z?.length&&(ha.setPipelineState(J.getPipeline(!0,T,Y)),Z.forAll(ca=>ha.drawArrays(J.primitiveType,ca.first,ca.count)))}}get test(){}};b.__decorate([e.property({constructOnly:!0})],a.MergedRenderer.prototype,"material",void 0);a.MergedRenderer=
b.__decorate([d.subclass("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],a.MergedRenderer);class G{constructor(K){this.origin=K;this.changes=[]}}const I=w.create(),O=w.create(),L=w.create(),P=new c({allocator:K=>K||new A.BufferRange,deallocator:null});let M=new Float32Array(65536);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/GLMaterials":function(){define(["exports","./basicInterfaces"],function(a,b){class q{constructor(l,p){this._material=
l;this._repository=p;this._map=new Map}dispose(){this._map.forEach((l,p)=>{null!=l&&this._repository.release(this._material,p)})}load(l,p,k){if(!this._material.produces.get(p)?.(k))return null;this._map.has(k)||this._map.set(k,this._repository.acquire(this._material,p,k));p=this._map.get(k);if(null!=p){if(p.ensureResources(l)===b.ResourceState.LOADED)return p;this._repository.requestRender()}return null}}a.GLMaterials=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/DrawParameters":function(){define(["exports",
"../../../../core/libs/gl-matrix-2/factories/vec3f64","../core/shaderLibrary/attributes/VertexNormal.glsl"],function(a,b,q){class l extends q.VertexNormalDrawParameters{constructor(p=b.create()){super();this.slicePlaneLocalOrigin=this.origin=p}}a.DrawParameters=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/renderers/BufferRange":function(){define(["exports"],function(a){class b{constructor(q=0,l=0){this.from=q;this.to=l}get numElements(){return this.to-
this.from}}a.BufferRange=b;a.mergeAdjacentRanges=function(q){const l=new Map;q.forAll(k=>l.set(k.from,k));for(var p=!0;p;){p=!1;for(let k=0;k<q.length;++k){p=q.data[k];const h=l.get(p.to);if(!h)return;p.to=h.to;l.delete(h.from);q.removeUnordered(h);p=!0}}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/renderers/Instance":function(){define(["exports","./BufferRange"],function(a,b){class q extends b.BufferRange{constructor(l,p,k){super(p,k);this.geometry=
l}get isVisible(){return this.geometry.visible}get hasHighlights(){return null!=this.geometry.highlights&&this.isVisible}get hasOccludees(){return null!=this.geometry.occludees}}a.Instance=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/renderers/PerBufferData":function(){define(["exports","../../../../../core/PooledArray","./BufferRange","./DrawCommand"],function(a,b,q,l){function p(){return new b({allocator:c=>c||new l.DrawCommand,deallocator:c=>
c})}function k(c,e){const g=c.back();null==g?(c=c.pushNew(),c.first=e.from,c.count=e.numElements):g.first+g.count>=e.from?g.count=e.from-g.first+e.numElements:(c=c.pushNew(),c.first=e.from,c.count=e.numElements)}class h{constructor(){this._numElements=0;this._instances=new Map;this.holes=new b({allocator:c=>c||new q.BufferRange,deallocator:null});this.hasOccludees=this.hasHighlights=this.hasHiddenInstances=!1;this.drawCommandsDirty=!0;this.drawCommandsDefault=p();this.drawCommandsHighlight=p();this.drawCommandsOccludees=
p();this.drawCommandsShadowHighlightRest=p()}get numElements(){return this._numElements}get instances(){return this._instances}addInstance(c,e){this.deleteInstance(c);this._instances.set(c,e);this._numElements+=e.numElements}deleteInstance(c){const e=this._instances.get(c);e&&(this._numElements-=e.numElements,this._instances.delete(c))}updateInstance(c,e,g){if(c=this._instances.get(c))this._numElements-=c.numElements,c.from=e,c.to=g,this._numElements+=c.numElements}updateDrawState(c){c.isVisible?
(c.hasHighlights&&(this.hasHighlights=!0),c.hasOccludees&&(this.hasOccludees=!0)):this.hasHiddenInstances=!0}updateDrawCommands(c){this.drawCommandsDefault.clear();this.drawCommandsHighlight.clear();this.drawCommandsOccludees.clear();this.drawCommandsShadowHighlightRest.clear();this.drawCommandsDirty=!1;if(0!==this._instances.size)if(this.needsMultipleCommands()){c=Array.from(this._instances.values()).sort((g,d)=>g.from===d.from?g.to-d.to:g.from-d.from);for(var e of c)e.isVisible&&(k(e.hasOccludees?
this.drawCommandsOccludees:this.drawCommandsDefault,e),k(e.hasHighlights?this.drawCommandsHighlight:this.drawCommandsShadowHighlightRest,e))}else{const g=this.drawCommandsDefault.pushNew();e=this.holes.front();null!=this.vao&&1===this.holes.length&&e.to===Math.floor(this.vao.byteSize/c)?(g.first=0,g.count=e.from):(g.first=Infinity,g.count=0,this._instances.forEach(d=>{g.first=Math.min(g.first,d.from);g.count=Math.max(g.count,d.to)}),g.count-=g.first)}}needsMultipleCommands(){return this.hasOccludees||
this.hasHighlights||this.hasHiddenInstances}}class f extends h{}a.PerBufferData=h;a.PerVaoData=f;a.hasVao=function(c){return null!=c.vao};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/renderers/DrawCommand":function(){define(["exports"],function(a){class b{constructor(){this.count=this.first=0}}a.DrawCommand=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/renderers/PerOriginData":function(){define(["exports"],
function(a){class b{constructor(q){this.origin=q;this.buffers=[]}dispose(){this.buffers.forEach(q=>q.vao.dispose());this.buffers.length=0}findBuffer(q){return this.buffers.find(l=>l.instances.has(q))}}a.PerOriginData=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/renderers/VaoCache":function(){define(["exports","../../../../../core/MemCachePool","../../lib/VertexArrayObject","../../../../webgl/BufferObject","../../../../webgl/enums"],function(a,
b,q,l,p){class k{constructor(h,f,c){this._rctx=h;this._locations=f;this._layout=c;this._cache=new b.MemCachePool(h.newCache,"VAOCache")}dispose(){this._cache.destroy()}newVao(h){let f=this._cache.pop(h.toString());if(f)return f;f=new q.VertexArrayObject(this._rctx,this._locations,{geometry:this._layout},{geometry:l.BufferObject.createVertex(this._rctx,p.Usage.STATIC_DRAW)});f.vertexBuffers.geometry.setSize(h);return f}deleteVao(h){null!=h&&this._cache.put(h.byteSize.toString(),h)}}a.VaoCache=k;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/core/MemCachePool":function(){define(["exports","./MemCache"],function(a,b){class q{constructor(l,p){this._cache=l(p,(k,h,f)=>{switch(h){case b.RemoveMode.ALL:return k.forEach(c=>c.dispose()),0;case b.RemoveMode.SOME:if(k=k.shift())f-=Math.round(k.usedMemory),k.dispose();return f}})}hitrate(){return this._cache.hitRate}destroy(){this._cache.destroy()}clear(){this._cache.clear()}getSize(l){return this._cache.getSize(l)}pop(l){const p=this._cache.peek(l);
if(p){var k=p.pop();if(0<p.length){if(k){const h=this._cache.getSize(l)-Math.round(k.usedMemory);this._cache.updateSize(l,p,h)}}else this._cache.pop(l);return k}}put(l,p,k=b.NoPriority){const h=this._cache.peek(l);h?(h.push(p),p=this._cache.getSize(l)+Math.round(p.usedMemory),this._cache.updateSize(l,h,p)):this._cache.put(l,[p],p.usedMemory,k)}}a.MemCachePool=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextureTechnique":function(){define("require exports ../../../../chunks/TextureOnly.glsl ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ./DefaultVertexAttributeLocations ./Program ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c){class e extends p.ShaderTechnique{initializeProgram(g){return new h.Program(g.rctx,e.shader.get().build(),k.Default3D)}initializePipeline(){return this.configuration.hasAlpha?c.makePipelineState({blending:c.separateBlendingParams(f.BlendFactor.SRC_ALPHA,f.BlendFactor.ONE,f.BlendFactor.ONE_MINUS_SRC_ALPHA,f.BlendFactor.ONE_MINUS_SRC_ALPHA),colorWrite:c.defaultColorWriteParams}):c.makePipelineState({colorWrite:c.defaultColorWriteParams})}}e.shader=new l.ReloadableShaderModule(q.TextureOnly,
()=>new Promise((g,d)=>a(["../core/shaderLibrary/util/TextureOnly.glsl"],g,d)));b.TextureTechnique=e;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextureTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q){class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.hasAlpha=!1}}b.__decorate([q.parameter()],l.prototype,"hasAlpha",
void 0);a.TextureTechniqueConfiguration=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/OverlayCompositing.glsl":function(){define("exports ../views/3d/terrain/interfaces ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f){function c(){const d=new h.ShaderBuilder;d.include(q.ScreenSpacePass);d.fragment.uniforms.add(new f.Texture2DPassUniform("tex",t=>t.texture));d.fragment.uniforms.add(new p.IntegerPassUniform("overlayIdx",t=>t.overlayIndex));d.fragment.uniforms.add(new l.FloatPassUniform("opacity",t=>t.opacity));d.fragment.code.add(k.glsl`void main() {
vec2 overlayUV = overlayIdx == 0 ? vec2(uv.x * 0.5, uv.y) : vec2(uv.x * 0.5 + 0.5, uv.y);
fragColor = texture(tex, overlayUV) * opacity;
}`);return d}class e extends k.NoParameters{constructor(){super(...arguments);this.overlayIndex=b.OverlayIndex.INNER;this.opacity=1}}const g=Object.freeze(Object.defineProperty({__proto__:null,OverlayCompositingPassParameters:e,build:c},Symbol.toStringTag,{value:"Module"}));a.OverlayCompositing=g;a.OverlayCompositingPassParameters=e;a.build=c})},"esri/views/3d/webgl-engine/shaders/OverlayCompositingTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../../../../chunks/OverlayCompositing.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c){class e extends l.ShaderTechnique{initializeProgram(g){return new k.Program(g.rctx,e.shader.get().build(),p.Default3D)}initializePipeline(){return c.makePipelineState({blending:c.simpleBlendingParams(f.BlendFactor.ONE,f.BlendFactor.ONE_MINUS_SRC_ALPHA),colorWrite:c.defaultColorWriteParams})}}e.shader=new q.ReloadableShaderModule(h.OverlayCompositing,()=>new Promise((g,d)=>a(["./OverlayCompositing.glsl"],g,d)));b.OverlayCompositingTechnique=e;Object.defineProperty(b,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Normals":function(){define(["exports","../../../../core/mathUtils","../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64","../../../../geometry/support/FloatArray"],function(a,b,q,l,p){function k(e,g,d,t,w,v=2){var m=1/(Math.abs(d)+Math.abs(t)+Math.abs(w));d*=m;t*=m;m=0>=w?(0<=t?1:-1)*(1-Math.abs(d)):t;g*=v;e[g]=f(0>=w?(0<=d?1:-1)*(1-Math.abs(t)):d);e[g+1]=f(m)}function h(e,g,d,t=2){t*=d;d=c(g[t]);g=c(g[t+1]);t=1-Math.abs(d)-
Math.abs(g);e[2]=t;0>t?(e[0]=(0<=d?1:-1)*(1-Math.abs(g)),e[1]=(0<=g?1:-1)*(1-Math.abs(d))):(e[0]=d,e[1]=g);q.normalize(e,e)}function f(e){return b.clamp(Math.round(32767*e),-32767,32767)}function c(e){return b.clamp(e/32767,-1,1)}a.compressAndTransformNormals=function(e,g){const d=e.length/3,t=new Int16Array(2*d);let w=0;const v=l.create();for(let m=0;m<d;++m)v[0]=e[w++],v[1]=e[w++],v[2]=e[w++],q.transformMat3(v,v,g),k(t,m,v[0],v[1],v[2]);return t};a.compressNormal=k;a.compressNormals=function(e){const g=
e.length/3,d=new Int16Array(2*g);let t=0;for(let w=0;w<g;++w)k(d,w,e[t++],e[t++],e[t++]);return d};a.decodeInt16=c;a.decompressNormal=h;a.decompressNormals=function(e,g=2){const d=e.length/g,t=p.newFloatArray(3*d),w=l.create();let v=0;for(let m=0;m<d;++m)h(w,e,m,g),t[v++]=w[0],t[v++]=w[1],t[v++]=w[2];return t};a.encodeInt16=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DIconSymbolLayer":function(){define("require exports ../../../../Color ../../../../core/asyncUtils ../../../../core/Error ../../../../core/has ../../../../core/lang ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/screenUtils ../../../../core/string ../../../../core/urlUtils ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/projection/projectPointToVector ../../../../geometry/support/aaBoundingBox ../../../../support/arcadeOnDemand ../../../../symbols/cim/CIMSymbolHelper ../../../../symbols/cim/OverrideHelper ../../../../symbols/cim/utils ../../../../symbols/support/cimSymbolUtils ../../../../symbols/support/IconSymbol3DLayerResource ../../../../symbols/support/Symbol3DAnchorPosition2D ../../../../symbols/support/utils ../../../2d/arcade/callExpressionWithFeature ./constants ./ElevationAligners ./elevationAlignmentUtils ./Graphics3DDrapedGraphicLayer ./Graphics3DObject3DGraphicLayer ./Graphics3DSymbolLayer ./graphicUtils ./interfaces ./placementUtils ./pointUtils ../support/FastSymbolUpdates ../../support/engineContent/sdfPrimitives ../../terrain/OverlayRenderer ../../webgl-engine/lib/GeometryUtil ../../webgl-engine/lib/RenderGeometry ../../webgl-engine/lib/Texture ../../webgl-engine/materials/HUDMaterial".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V){function T(X){return null==X?!1:"cross"===X||"x"===X}function Y(X){X=d.dataComponents(X);return"application/json"===X?.mediaType?X.data:void 0}function ha(X,ja){return"relative"===X?t.fromValues((ja.x||0)+.5,-(ja.y||0)+.5):X in P.namedAnchorToHUDMaterialAnchorPos?P.namedAnchorToHUDMaterialAnchorPos[X]:P.namedAnchorToHUDMaterialAnchorPos.center}function ba({parameters:X},ja){X=(X.width??1)/(X.height??1);
return 1<X?[ja,Math.round(ja/X)]:[Math.round(ja*X),ja]}const U=w.fromValues(0,0,1),Z=J.defaultTexSize,ca=J.defaultSymbolSizeRatio,ea=[ca/2,ca/2,1-ca/2,1-ca/2];class da extends I.Graphics3DSymbolLayer{getCachedSize(){return{size:this._getIconSize()}}constructor(X,ja,la,na){super(X,ja,la,na);this._cimSymbolMaterials=new Map;this._cimSymbolTextures=new Map;this._size=this._cimMaterialParametersInfo=null;this._symbolTextureRatio=1;this._outlineSize=0;this._patchTask=null;this._elevationOptions={supportsOffsetAdjustment:!0,
supportsOnTheGround:!0}}async doLoad(X){this._validateOrThrow();const ja=this._prepareMaterialParameters();var la=this._getPrimitive();if(null!=la)this._prepareResourcesPrimitive(ja,la);else{la=C.getIconHref(this.symbolLayer);const na=Y(la);null!=na?await this._prepareResourcesCIM(ja,JSON.parse(na),X):await this._prepareResourcesHref(ja,la,X)}}_validateOrThrow(){if(!this._drivenProperties.size){var X=O.validateSymbolLayerSize(this._getIconSize());if(X)throw new p("graphics3diconsymbollayer:invalid-size",
X);}}_getIconSize(){var X=this.symbolLayer;X=Math.round(null!=X.size?e.pt2px(X.size):16);return this._drivenProperties.size?Math.max(X,64):X}_generateTextureCIM(X){var ja=this._cimData;ja&&ja.symbol||this.logger.error("Can't create texture, CIM data is undefined");if(ja.primitiveOverrides){ja=h.clone(ja);var la=ja.primitiveOverrides;x.OverrideHelper.evaluateOverrides(la,X,this._arcadeInfo.geometryType,null,null);x.OverrideHelper.applyOverrides(ja.symbol,la)}la=g.numericHash(JSON.stringify(ja));var na=
this._cimSymbolTextures.get(la);if(na)return na;na=this._context.sharedResources.cimSymbolRasterizer;const va=this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null;va&&x.OverrideHelper.applyDictionaryTextOverrides(ja.symbol,X,va,null);X=null!=this._cimScaleFactorOrFunction?y.evaluateValueOrFunction(this._cimScaleFactorOrFunction,X):1;1!==X&&ja.symbol&&z.scaleCIMSymbol(ja.symbol,X,!0);X=u.CIMSymbolHelper.getEnvelope(ja,null,na.resourceManager);X?.width&&
X.height?(ja=na.rasterize({type:"cim",data:ja},X.width,X.height,X.x+X.width/2,X.y+X.height/2,1,"esriGeometryPoint"),X=new B.Symbol3DAnchorPosition2D({x:-X.x/X.width-.5,y:(X.height+X.y)/X.height-.5}),this._cimMaterialParametersInfo.anchorPosition=ha("relative",X),na=new S.Texture(ja,{width:ja?.width??1,height:ja?.height??1,reloadable:!0})):na=new S.Texture(new ImageData(1,1),{width:1,height:1,reloadable:!0});this._cimSymbolTextures.set(la,na);this._context.stage.add(na);return na}_prepareMaterialParameters(){const X=
{anchorPosition:ha(this.symbolLayer.anchor,this.symbolLayer.anchorPosition)},ja=this.symbol;if(ja&&"point-3d"===ja.type&&ja.hasVisibleVerticalOffset()){const {screenLength:la,minWorldLength:na,maxWorldLength:va}=ja.verticalOffset;X.verticalOffset={screenLength:e.pt2px(la),minWorldLength:na||0,maxWorldLength:null!=va?va:Infinity}}this._context.screenSizePerspectiveEnabled&&(X.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings);X.occlusionTest=!k("enable-feature:non-occluded-hud");
X.hasSlicePlane=this._context.slicePlaneEnabled;return X}_prepareResourcesPrimitive(X,ja){var la=this._getOutlineSize();if(T(ja)&&0===la)throw Error("Nothing to render");this._outlineSize=la;X.color=this._getFillColor();X.outlineColor=this._getOutlineColor();X.outlineSize=this._outlineSize;null!=this._context.sharedResources.textures&&(this._textureHandle=la=this._context.sharedResources.textures.fromData(`${ja}-icon`,()=>J.createTexture(ja)),X.textureId=la.texture.id);X.textureIsSignedDistanceField=
!0;X.sampleSignedDistanceFieldTexelCenter=J.requiresHalfTexelOffset(ja);X.distanceFieldBoundingBox=ea;la=this._getIconSize();this._size=[la,la];this._symbolTextureRatio=1/ca;this._createMaterialAndAddToStage(X,this._context.stage)}async _prepareResourcesHref(X,ja,la){this._outlineSize=this._getOutlineSize();X.color=this._getFillColor();X.outlineColor=this._getOutlineColor();X.outlineSize=this._outlineSize;X.textureIsSignedDistanceField=!1;const na=this._getIconSize(),va=na*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;
if(null!=this._context.sharedResources.textures){la=await l.result(this._context.sharedResources.textures.fromUrl(ja,va,{signal:la}));if(!1===la.ok)throw c.throwIfAbortError(la.error),new p("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${ja})`);this._textureHandle=la.value;ja=la.value.texture;this._size=ba(ja,na);X.textureId=ja.id}this._createMaterialAndAddToStage(X,this._context.stage)}async _prepareResourcesCIM(X,ja,la){this._cimData=ja;if(!this._context.sharedResources.cimSymbolRasterizer){var na=
(await new Promise((ya,Da)=>a(["../../../../symbols/cim/CIMSymbolRasterizer"],ya,Da))).CIMSymbolRasterizer;c.throwIfAborted(la);this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new na(this._context.renderCoordsHelper.spatialReference))}var va=this._context.sharedResources.cimSymbolRasterizer;na=[];const za=ja?.symbol;u.CIMSymbolHelper.fetchResources(za,va.resourceManager,na,la);u.CIMSymbolHelper.fetchFonts(za,va.resourceManager,na);va=this._context.layer.fields?
this._context.layer.fields.map(ya=>ya.toJSON()):[];this._arcadeInfo={spatialReference:this._context.renderCoordsHelper.spatialReference,fields:va,geometryType:"esriGeometryPoint"};ja?.primitiveOverrides&&na.push(x.OverrideHelper.createRenderExpressions(ja.primitiveOverrides,this._arcadeInfo));0<na.length&&(await Promise.all(na),c.throwIfAborted(la));if(this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression&&(ja=this._context.renderer,ja.scaleExpression)){const ya=
await n.createRendererExpression(ja.scaleExpression,this._context.layer.spatialReference,va);this._cimScaleFactorOrFunction=(Da,ra,xa)=>{Da=D(ya,Da,{$view:xa},"esriGeometryPoint",ra);return null!==Da?Da:1}}c.throwIfAborted(la);this._cimMaterialParametersInfo=X;this._cimMaterialParametersInfo.color=this._getFillColor();this._cimMaterialParametersInfo.outlineColor=[0,0,0,0];this._cimMaterialParametersInfo.outlineSize=0;this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource?.href?
null:this.symbolLayer.resource?.primitive??A.defaultPrimitive}_getOutlineSize(){var X=0;X=this.symbolLayer;if(null!=X.outline?.size)return Math.max(e.pt2px(X.outline.size),0);X=this._getPrimitive();X=T(X)?1.5:0;return Math.max(X,0)}_getOutlineColor(){const X=this._getLayerOpacity(),ja=this.symbolLayer?.outline?.color;if(null!=ja){const la=q.toUnitRGB(ja);return[la[0],la[1],la[2],ja.a*X]}return[0,0,0,0]}_getFillColor(){if(T(this._getPrimitive()))return F.transparentUnit;const X=null==this._getPrimitive();
return this._getCombinedOpacityAndColor(this.symbolLayer?.material?.color,{hasIntrinsicColor:X})}_createMaterialAndAddToStage(X,ja){if(this._cimData){this._fastUpdates=null;let la=X.textureId?this._cimSymbolMaterials.get(X.textureId):null;la||(la=new V.HUDMaterial(X),this._cimSymbolMaterials.set(X.textureId??0,la),ja.add(la));return la}(this._fastUpdates=K.initFastSymbolUpdatesState(this._context.renderer,this._fastVisualVariableConvertOptions()))&&(X={...X,...this._fastUpdates.materialParameters});
this._materials[0]=new V.HUDMaterial(X);ja.add(this._materials[0]);return this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial(X=>{X.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})}),this.layerOpacityChanged())}destroy(){super.destroy();this._patchTask=f.abortMaybe(this._patchTask);this._forEachMaterial(X=>this._context.stage.remove(X));this._materials.length=0;this._cimSymbolMaterials.clear();
this._cimSymbolTextures.forEach(X=>this._context.stage.remove(X));this._cimSymbolTextures.clear();this._textureHandle=f.releaseMaybe(this._textureHandle)}_getScaleFactor(X,ja){if(this._drivenProperties.size&&X.size){for(let la=0;3>la;la++){const na=X.size[la];na&&"symbol-value"!==na&&"proportional"!==na&&(X.size[la]=e.pt2px(na))}if("symbol-value"===X.size[0])return 1;if(isFinite(+X.size[0]))return+X.size[0]/ja;if(isFinite(+X.size[2]))return+X.size[2]/ja}return 1}createGraphics3DGraphic(X){const ja=
X.graphic;if(!this._validateGeometry(ja.geometry))return null;var la=[0,0];let na;if(this._cimData){if(!this._cimData.symbol)return null;var va=this._generateTextureCIM(ja);na=this._createMaterialAndAddToStage({textureId:va.id,...this._cimMaterialParametersInfo},this._context.stage);var za=window.devicePixelRatio||1;la=[va.parameters.width/za,va.parameters.height/za]}else la=this._size,na=this._materials[0];va=M.placePointOnGeometry(ja.geometry);if(null==va)return this.logger.warn(`unsupported geometry type for icon symbol: ${ja.geometry.type}`),
null;var ya=X.renderingInfo;za=this._getVertexOpacityAndColor(ya);let Da=1;this._fastUpdates?.visualVariables.size||(Da=this._getScaleFactor(ya,la[0]>la[1]?la[0]:la[1]));Da*=this._symbolTextureRatio;la=t.fromValues(la[0]*Da,la[1]*Da);ya=this.setGraphicElevationContext(ja);this.ensureDrapedStatus("on-the-ground"===ya.mode)&&this._setDrapingDependentMaterialParameters();return this.draped?this._createAsOverlay(ja,va,na,za,la,X.layer.uid):this._createAs3DShape(ja,va,na,za,la,ya,ja.uid)}layerOpacityChanged(){const X=
this._getFillColor(),ja=this._getOutlineColor();this._forEachMaterial(la=>{la.setParameters({color:X});la.setParameters({outlineColor:ja})})}updateGeometry(X,ja){if(this.draped||!this._validateGeometry(ja))return!1;const {elevationContext:la,stageObject:na}=X;if(la.mode!==this.getGeometryElevationMode(ja))return!1;ja=M.placePointOnGeometry(ja);if(!ja)return!1;const va=M.updateStageObjectGeometry(na,this._context,ja,la);if(null==va)return!1;const za=M.getLocalOriginForPoint(this._context,ja);if(na.geometries[0].localOrigin!==
za)return!1;X.alignedSampledElevation=va;M.extendPointGraphicElevationContext(X,ja,this._context.elevationProvider);return!0}layerElevationInfoChanged(X,ja,la){const na=this._elevationContext.mode;la=N.elevationModeChangeUpdateType(da.elevationModeChangeTypes,la,na);if(la!==N.SymbolUpdateType.UPDATE)return la;const va=N.needsElevationUpdates2D(na)||"absolute-height"===na;return this.updateGraphics3DGraphicElevationInfo(X,ja,()=>va)}slicePlaneEnabledChanged(){this.draped||this._forEachMaterial(X=>
{X.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})});return!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(X,ja){for(const la in X.diff)switch(la){case "visualVariables":if(K.updateFastSymbolUpdatesState(this._fastUpdates,ja,this._fastVisualVariableConvertOptions()))this._materials[0]?.setParameters(this._fastUpdates.materialParameters);else return L.ApplyRendererDiffResult.RecreateSymbol;break;default:return L.ApplyRendererDiffResult.RecreateSymbol}return L.ApplyRendererDiffResult.FastUpdate}prepareSymbolLayerPatch(X){this._patchTask?.abort();
"partial"===X.diff.type&&this._preparePatchResource(X,X.diff.diff)}_preparePatchResource(X,ja){if(ja.resource&&"partial"===ja.resource.type&&(ja=ja.resource.diff,"complete"===ja?.href?.type)){var la=ja.href.newValue,{textures:na}=this._context.sharedResources;if(null!=la&&null!=na&&null==Y(la)){var va=this._getIconSize(),za=va*this._context.graphicsCoreOwner.view.state.pixelRatio;X.symbolLayerStatePatches.push(()=>{this._patchTask=f.abortMaybe(this._patchTask);this._patchTask=l.createTask(ya=>this._context.schedule(async(Da,
ra)=>{Da=await l.result(na.fromUrl(la,za,{signal:ra}));c.throwIfAborted(ra);(ra=!Da.ok)&&c.throwIfAbortError(Da.error);this._textureHandle=f.releaseMaybe(this._textureHandle);this._patchTask=null;if(ra)this._forEachMaterial(Ma=>{Ma.visible=!1;Ma.setParameters({textureId:null})}),this.logger.error(new p("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${la})`));else{this._textureHandle=Da.value;var xa=Da.value.texture;this._size=ba(xa,va);this._forEachMaterial(Ma=>
{Ma.setParameters({textureId:xa.id});Ma.visible=!0})}},ya))});delete ja.href}}}_defaultElevationInfoNoZ(){return ia}_createAs3DShape(X,ja,la,na,va,za,ya){X=this.getFastUpdateAttrValues(X);const Da=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:ya,layerUid:this._context.layer.uid});na=Q.createPointGeometry(la,U,null,na,va,ka,null,X,Da);ya=M.createStageObject(this._context,ja,na,za,ya);if(null==ya)return null;const ra=new G.Graphics3DObject3DGraphicLayer(this,ya.object,[na],null,
null,H.perObjectElevationAligner,za);ra.alignedSampledElevation=ya.sampledElevation;ra.needsElevationUpdates=N.needsElevationUpdates2D(za.mode)||"absolute-height"===za.mode;ra.getScreenSize=this._createScreenSizeGetter(va,X);ra.calculateRelativeScreenBounds=xa=>la.calculateRelativeScreenBounds(ra.getScreenSize(),1,xa);M.extendPointGraphicElevationContext(ra,ja,this._context.elevationProvider);return ra}_createAsOverlay(X,ja,la,na,va,za){la.renderPriority=this._renderPriority;const ya=w.create();m.projectPointToVector(ja,
ya,this._context.overlaySR);ya[2]=R.drapedZ;ja=this._context.clippingExtent;if(null!=ja&&!r.containsPoint(ja,ya))return null;ja=this.getFastUpdateAttrValues(X);const Da=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:X.uid,layerUid:this._context.layer.uid});na=Q.createPointGeometry(la,U,ya,na,va,null,null,ja,Da);X=new W.RenderGeometry(na,{layerUid:za,graphicUid:X.uid});const ra=new E.Graphics3DDrapedGraphicLayer(this,[X],null,this._context.drapeSourceRenderer);ra.getScreenSize=
this._createScreenSizeGetter(va,ja);ra.calculateRelativeScreenBounds=xa=>la.calculateRelativeScreenBounds(ra.getScreenSize(),1,xa);return ra}_createScreenSizeGetter(X,ja){const la=this._outlineSize+2;if(this._fastUpdates&&ja){const za=X[0]/this._symbolTextureRatio,ya=X[1]/this._symbolTextureRatio;return(Da=t.create())=>{const [ra,xa]=K.evaluateModelTransformScale(fa,this._fastUpdates.materialParameters,ja);Da[0]=ra*za+la;Da[1]=xa*ya+la;return Da}}const na=X[0]/this._symbolTextureRatio+la,va=X[1]/
this._symbolTextureRatio+la;return(za=t.create())=>{za[0]=na;za[1]=va;return za}}_fastVisualVariableConvertOptions(){var X=Math.max(this._size[0],this._size[1]);const ja=w.fromValues(X,X,X),la=e.px2pt(1);X*=la;X=w.fromValues(X,X,X);return new K.ConvertOptions({size:!0,color:!0,rotation:!0,opacity:!1},ja,X,la)}_forEachMaterial(X){this._materials.forEach(X);this._cimSymbolMaterials.forEach(X)}test(){return{...super.test(),material:this._materials[0]}}}da.PRIMITIVE_SIZE=[Z*ca,Z*ca];da.elevationModeChangeTypes=
{definedChanged:N.SymbolUpdateType.UPDATE,staysOnTheGround:N.SymbolUpdateType.NONE,onTheGroundChanged:N.SymbolUpdateType.RECREATE};const ia={mode:"relative-to-ground",offset:0},ka=v.fromValues(0,0,0,1),fa=w.create();b.Graphics3DIconSymbolLayer=da;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/CIMSymbolHelper":function(){define("exports ../../core/BidiText ../../core/has ../../core/lang ../../core/Logger ../../core/RandomLCG ../../core/screenUtils ../../geometry/support/aaBoundingRect ../../geometry/support/boundsUtils ../Font ./CIMPlacements ./CIMSymbolDrawHelper ./defaultCIMValues ./enums ./utils ../support/defaults ../../views/2d/engine/vectorTiles/GeometryUtils ../../views/2d/engine/webgl/definitions ../../views/2d/engine/webgl/mesh/templates/shapingUtils ../../views/2d/layers/graphics/graphicsUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){function y(S,V,T){switch(V.type){case "CIMSymbolReference":return y(S,V.symbol,T);case "CIMPointSymbol":null==T&&(T={x:0,y:0});S.drawSymbol(V,T);break;case "CIMLineSymbol":null==T&&(T={paths:[[[0,0],[10,0]]]});S.drawSymbol(V,T);break;case "CIMPolygonSymbol":null==T&&(T={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]});S.drawSymbol(V,T);break;case "CIMTextSymbol":S.drawSymbol(V,{x:0,y:0});break;case "CIMVectorMarker":T=new g.Placement,S.drawMarker(V,T)}return S.envelope()}
function z(S){if(!S)return 0;switch(S.type){case "CIMMarkerPlacementAlongLineSameSize":return Math.abs(S.offset);case "CIMMarkerPlacementAlongLineRandomSize":return Math.abs(S.offset);case "CIMMarkerPlacementAtExtremities":return Math.abs(S.offset);case "CIMMarkerPlacementAtMeasuredUnits":return Math.abs(S.offset);case "CIMMarkerPlacementAtRatioPositions":return Math.abs(S.offset);case "CIMMarkerPlacementInsidePolygon":return 0;case "CIMMarkerPlacementOnLine":return Math.abs(S.offset);case "CIMMarkerPlacementOnVertices":return Math.abs(S.offset);
case "CIMMarkerPlacementPolygonCenter":return 0;default:return 0}}function A(S){if(!S)return 0;switch(S.type){case "CIMGeometricEffectArrow":return Math.abs(.5*S.width);case "CIMGeometricEffectBuffer":return Math.abs(S.size);case "CIMGeometricEffectControlMeasureLine":return 500;case "CIMGeometricEffectExtension":return Math.abs(S.length);case "CIMGeometricEffectJog":return Math.abs(.5*S.length);case "CIMGeometricEffectMove":return Math.max(Math.abs(v.getNumericValue(S.offsetX)),Math.abs(v.getNumericValue(S.offsetY)));
case "CIMGeometricEffectOffset":return Math.abs(S.offset);case "CIMGeometricEffectOffsetTangent":return Math.abs(S.offset);case "CIMGeometricEffectRadial":return Math.abs(S.length);case "CIMGeometricEffectRegularPolygon":return Math.abs(S.radius);case "CIMGeometricEffectRotate":return 0;case "CIMGeometricEffectScale":return 0;case "CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(S.fromWidth),Math.abs(S.toWidth));case "CIMGeometricEffectWave":return Math.abs(S.amplitude);case "CIMGeometricEffectDonut":return Math.abs(S.width);
default:return 0}}function B(S){if(!S)return 0;let V=0;for(const T of S)V+=A(T);return V}function C(S,V){if(S)switch(S.type){case "CIMPointSymbol":case "CIMLineSymbol":case "CIMPolygonSymbol":if(S=S.symbolLayers)for(const T of S)switch(V(T),T.type){case "CIMVectorMarker":if(S=T.markerGraphics)for(const Y of S)Y&&(S=Y.symbol)&&C(S,V)}}}function D(S,V,T){S.effects&&null==V.geometryEngine&&(V.geometryEnginePromise?T.push(V.geometryEnginePromise):v.isGeometryEngineRequired(S.effects)&&(V.geometryEnginePromise=
v.importGeometryEngine(),T.push(V.geometryEnginePromise),V.geometryEnginePromise.then(Y=>V.geometryEngine=Y)))}function F(S){if(!S)return null;let V=null;const {cap:T,color:Y,join:ha,miterLimit:ba,style:U,width:Z}=S;"solid"!==U&&"none"!==U&&"esriSLSSolid"!==U&&"esriSLSNull"!==U&&(V=[{type:"CIMGeometricEffectDashes",dashTemplate:Q(U,T),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);return{type:"CIMSolidStroke",color:"esriSLSNull"!==U&&"none"!==U?R(Y):[0,0,0,0],capStyle:P(T),joinStyle:M(ha),
miterLimit:ba,width:Z,effects:V}}const H=Math.PI,N=H/2,E=Math.PI/180,G=96/72,I=()=>p.getLogger("esri.symbols.cim.CIMSymbolHelper");class O{static getSymbolInflateSize(S,V,T,Y,ha){S||=[0,0,0,0];return V?this._getInflateSize(S,V,T,Y,ha):S}static safeSize(S){const V=Math.max(Math.abs(S[0]),Math.abs(S[2]));S=Math.max(Math.abs(S[1]),Math.abs(S[3]));return Math.sqrt(V*V+S*S)}static _vectorMarkerBounds(S,V,T,Y){let ha=!0;const ba=f.create();if(V?.markerGraphics)for(const U of V.markerGraphics)V=[0,0,0,0],
U.geometry&&(c.getBoundsXY(ba,U.geometry),V[0]=0,V[1]=0,V[2]=0,V[3]=0,this.getSymbolInflateSize(V,U.symbol,T,0,Y),ba[0]+=V[0],ba[1]+=V[1],ba[2]+=V[2],ba[3]+=V[3],ha?(S[0]=ba[0],S[1]=ba[1],S[2]=ba[2],S[3]=ba[3],ha=!1):(S[0]=Math.min(S[0],ba[0]),S[1]=Math.min(S[1],ba[1]),S[2]=Math.max(S[2],ba[2]),S[3]=Math.max(S[3],ba[3])));return S}static _getInflateSize(S,V,T,Y,ha){return void 0!==V.symbolLayers?(S=this._getLayersInflateSize(S,V.symbolLayers,T,Y,ha),V=B(V.effects),0<V&&(S[0]-=V,S[1]-=V,S[2]+=V,S[3]+=
V),S):this._getTextInflatedSize(S,V,ha)}static _getLayersInflateSize(S,V,T,Y,ha){let ba=!0;if(!V)return S;for(const ia of V)if(ia){V=[0,0,0,0];switch(ia.type){case "CIMSolidStroke":case "CIMPictureStroke":case "CIMGradientStroke":var U=ia,Z=U.width;null!=Z&&(Z=U.capStyle===w.LineCapStyle.Square||U.joinStyle===w.LineJoinStyle.Miter?Z/1.4142135623730951:Z/2,V[0]=-Z,V[1]=-Z,V[2]=Z,V[3]=Z);break;case "CIMCharacterMarker":case "CIMVectorMarker":case "CIMPictureMarker":U=ia;if("CIMVectorMarker"===ia.type){if(Z=
ia,V=this._vectorMarkerBounds(V,Z,T,ha),Z.frame){var ca=(Z.frame.xmin+Z.frame.xmax)/2,ea=(Z.frame.ymin+Z.frame.ymax)/2;V[0]-=ca;V[1]-=ea;V[2]-=ca;V[3]-=ea;null!=Z.size&&(Z=Z.size/(Z.frame.ymax-Z.frame.ymin),V[0]*=Z,V[1]*=Z,V[2]*=Z,V[3]*=Z)}}else"CIMPictureMarker"===ia.type?(Z=ia,ea=T.getResource(Z.url),ca=1,null!=ea&&ea.height&&(ca=ea.width/ea.height),null!=U.size&&(V=U.size/2,Z=U.size*ca*Z.scaleX/2,V=[-Z,-V,Z,V])):null!=U.size&&(V=U.size/2,V=[-V,-V,V,V]);U.anchorPoint&&("Absolute"===U.anchorPointUnits?
(Z=U.anchorPoint.x,ca=U.anchorPoint.y):(Z=U.anchorPoint.x*(V[2]-V[0]),ca=U.anchorPoint.y*(V[3]-V[1])),Z=1.25*Math.sqrt(Z*Z+ca*ca),V[0]-=Z,V[1]-=Z,V[2]+=Z,V[3]+=Z);Z=v.getNumericValue(U.rotation);U.rotateClockwise&&(Z=-Z);Y&&(Z-=Y);Z&&(ca=E*Z,Z=Math.cos(ca),ca=Math.sin(ca),ea=f.create([r.cInfinity,r.cInfinity,-r.cInfinity,-r.cInfinity]),f.expandPointInPlace(ea,[V[0]*Z-V[1]*ca,V[0]*ca+V[1]*Z]),f.expandPointInPlace(ea,[V[0]*Z-V[3]*ca,V[0]*ca+V[3]*Z]),f.expandPointInPlace(ea,[V[2]*Z-V[1]*ca,V[2]*ca+V[1]*
Z]),f.expandPointInPlace(ea,[V[2]*Z-V[3]*ca,V[2]*ca+V[3]*Z]),V=ea);Z=v.getNumericValue(U.offsetX);ca=v.getNumericValue(U.offsetY);if(Y){var da=E*Y;ea=Math.cos(da);da=Math.sin(da);const ka=Z*da+ca*ea;Z=Z*ea-ca*da;ca=ka}V[0]+=Z;V[1]+=ca;V[2]+=Z;V[3]+=ca;U=z(U.markerPlacement);0<U&&(V[0]-=U,V[1]-=U,V[2]+=U,V[3]+=U)}U=B(ia.effects);0<U&&(V[0]-=U,V[1]-=U,V[2]+=U,V[3]+=U);ba?(S[0]=V[0],S[1]=V[1],S[2]=V[2],S[3]=V[3],ba=!1):(S[0]=Math.min(S[0],V[0]),S[1]=Math.min(S[1],V[1]),S[2]=Math.max(S[2],V[2]),S[3]=
Math.max(S[3],V[3]))}return S}static _getTextInflatedSize(S,V,T){var Y=x.roundPtToWholePixel(V.height??t.defaultCIMValues.CIMTextSymbol.height);S[0]=-Y/2;S[1]=-Y/2;S[2]=Y/2;S[3]=Y/2;if(!T)return S;T=T.get(V);if(!T||!T.glyphMosaicItems.glyphs.length)return S;const {lineGapType:ha,lineGap:ba}=V,U=ha?d.lineGapType2LineHeight(ha,ba??0,Y):0,Z="CIMBackgroundCallout"===V.callout?.type;V=u.shapeGlyphs(T.glyphMosaicItems,{scale:Y/n.glyphSize,angle:v.getNumericValue(V.angle),xOffset:v.getNumericValue(V.offsetX),
yOffset:v.getNumericValue(V.offsetY),horizontalAlignment:V.horizontalAlignment,verticalAlignment:V.verticalAlignment,maxLineWidth:x.getLineWidth(V.lineWidth),lineHeight:n.magicLabelLineHeight*Math.max(.25,Math.min(U||1,4)),decoration:V.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:Z}).boundsT;Y=Math.sqrt(V.width*V.width+V.height*V.height);S[0]-=V.x+Y;S[1]-=V.y-Y;S[2]+=V.x+Y;S[3]+=-V.y+Y;return S}}class L{static getEnvelope(S,V,T){if(!S)return null;T=new d.EnvDrawHelper(T);if(Array.isArray(S)){let Y;
for(const ha of S)Y?Y.union(y(T,ha,V)):Y=y(T,ha,V);return Y}return y(T,S,V)}static getTextureAnchor(S,V){S=this.getEnvelope(S,null,V);if(!S)return[0,0,0];V=S.height*G+2;return[-((S.x+.5*S.width)*G)/(S.width*G+2),-((S.y+.5*S.height)*G)/V,V]}static rasterize(S,V,T,Y,ha=!0){var ba=T||this.getEnvelope(V,null,Y);if(!ba)return[null,0,0,0,0];const U=(ba.x+.5*ba.width)*G,Z=(ba.y+.5*ba.height)*G;S.width=ba.width*G;S.height=ba.height*G;T||(S.width+=2,S.height+=2);T=S.getContext("2d",{willReadFrequently:!0});
ba=d.Transformation.createScale(G,-G);ba.translate(.5*S.width-U,.5*S.height+Z);Y=new d.CanvasDrawHelper(T,Y,ba);switch(V.type){case "CIMPointSymbol":Y.drawSymbol(V,{type:"point",x:0,y:0});break;case "CIMVectorMarker":ba=new g.Placement,Y.drawMarker(V,ba)}V=T.getImageData(0,0,S.width,S.height);V=new Uint8Array(V.data);if(ha)for(Y=0;Y<V.length;Y+=4)ha=V[Y+3]/255,V[Y]*=ha,V[Y+1]*=ha,V[Y+2]*=ha;return[V,S.width,S.height,-U/S.width,-Z/S.height]}static fromTextSymbol(S){const {text:V}=S;return{type:"CIMPointSymbol",
symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:L.createCIMTextSymbolfromTextSymbol(S),textString:V}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(S){const {height:V,outline:T,width:Y,xoffset:ha,xscale:ba,yoffset:U,yscale:Z}=S,ca=[],ea={type:"CIMPolygonSymbol",
symbolLayers:ca};if(T){var da=F(T);da&&ca.push(da)}da=S.url;"esriPFS"===S.type&&S.imageData&&(da=S.imageData);S="angle"in S?S.angle??0:0;ca.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:w.TextureFilter.Picture,tintColor:null,url:da,height:(V??0)*(Z||1),width:(Y??0)*(ba||1),offsetX:v.getNumericValue(ha),offsetY:v.getNumericValue(U),rotation:v.getNumericValue(-S),colorSubstitutions:null});return ea}static fromSimpleFillSymbol(S){const {color:V,style:T,outline:Y}=S;S=[];
const ha={type:"CIMPolygonSymbol",symbolLayers:S};if(Y){var ba=F(Y);ba&&S.push(ba)}if(T&&"solid"!==T&&"none"!==T&&"esriSFSSolid"!==T&&"esriSFSNull"!==T){ba={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:R(V),capStyle:w.LineCapStyle.Butt,joinStyle:w.LineJoinStyle.Miter,width:.75}]};let U=0;const Z=h.px2pt("vertical"===T||"horizontal"===T||"cross"===T||"esriSFSCross"===T||"esriSFSVertical"===T||"esriSFSHorizontal"===T?8:10);switch(T){case "vertical":case "esriSFSVertical":U=90;break;
case "forward-diagonal":case "esriSFSForwardDiagonal":U=-45;break;case "backward-diagonal":case "esriSFSBackwardDiagonal":U=45;break;case "cross":case "esriSFSCross":U=0;break;case "diagonal-cross":case "esriSFSDiagonalCross":U=-45}S.push({type:"CIMHatchFill",lineSymbol:ba,offsetX:0,offsetY:0,rotation:U,separation:Z});"cross"===T||"esriSFSCross"===T?S.push({type:"CIMHatchFill",lineSymbol:l.clone(ba),offsetX:0,offsetY:0,rotation:90,separation:Z}):("diagonal-cross"===T||"esriSFSDiagonalCross"===T)&&
S.push({type:"CIMHatchFill",lineSymbol:l.clone(ba),offsetX:0,offsetY:0,rotation:45,separation:Z})}else!T||"solid"!==T&&"esriSFSSolid"!==T||S.push({type:"CIMSolidFill",enable:!0,color:R(V)});return ha}static fromSimpleLineSymbol(S){const {cap:V,color:T,join:Y,marker:ha,miterLimit:ba,style:U,width:Z}=S;S=null;"solid"!==U&&"none"!==U&&"esriSLSSolid"!==U&&"esriSLSNull"!==U&&(S=[{type:"CIMGeometricEffectDashes",dashTemplate:Q(U,V),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const ca=
[];if(ha){let ea;switch(ha.placement){case "begin-end":ea=w.ExtremityPlacement.Both;break;case "begin":ea=w.ExtremityPlacement.JustBegin;break;case "end":ea=w.ExtremityPlacement.JustEnd;break;default:ea=w.ExtremityPlacement.None}const da=L.fromSimpleMarker(ha,Z,T).symbolLayers[0];da.markerPlacement={type:"CIMMarkerPlacementAtExtremities",placePerPart:!1,angleToLine:!0,offset:0,extremityPlacement:ea,offsetAlongLine:0};ca.push(da)}ca.push({type:"CIMSolidStroke",color:"none"!==U&&"esriSLSNull"!==U?R(T):
[0,0,0,0],capStyle:P(V),joinStyle:M(Y),miterLimit:ba,width:Z,effects:S});return{type:"CIMLineSymbol",symbolLayers:ca}}static fromPictureMarker(S){const {angle:V,height:T,width:Y,xoffset:ha,yoffset:ba}=S;let U=S.url;"esriPMS"===S.type&&S.imageData&&(U=S.imageData);return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:w.TextureFilter.Picture,tintColor:null,url:U,size:T,width:Y,offsetX:v.getNumericValue(ha),offsetY:v.getNumericValue(ba),rotation:v.getNumericValue(-V)}]}}static createCIMTextSymbolfromTextSymbol(S){const {angle:V,
color:T,font:Y,haloColor:ha,haloSize:ba,horizontalAlignment:U,kerning:Z,lineWidth:ca,text:ea,verticalAlignment:da,xoffset:ia,yoffset:ka,backgroundColor:fa,borderLineColor:X,borderLineSize:ja}=S;let la,na,va;if(Y){var za=Y.family;var ya=Y.style;var Da=Y.weight;la=Y.size;na=Y.decoration}S=!1;ea&&(S=b.bidiText(ea)[1]);if(fa||ja)va={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",color:R(fa)},{type:"CIMSolidStroke",color:R(X),width:ja}]},
accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null};var ra=w.BlockProgression.BTT,xa=w.FontEffects.Normal,Ma=w.FontEncoding.Unicode;za=za||"Arial";b:{if(Da)switch(Da.toLowerCase()){case "bold":case "bolder":Da="bold";break b}Da=""}b:{if(ya)switch(ya.toLowerCase()){case "italic":case "oblique":ya="italic";break b}ya=""}Da=Da&&ya?`${Da}-${ya}`:`${Da}${ya}`;return{type:"CIMTextSymbol",angle:V,blockProgression:ra,depth3D:1,extrapolateBaselines:!0,fontEffects:xa,fontEncoding:Ma,fontFamilyName:za,
fontStyleName:Da,fontType:w.FontType.Unspecified,haloSize:ba,height:la,hinting:w.GlyphHinting.Default,horizontalAlignment:K(U??"center"),kerning:Z,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:ca,offsetX:v.getNumericValue(ia),offsetY:v.getNumericValue(ka),strikethrough:"line-through"===na,underline:"underline"===na,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:R(T)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,
color:R(ha)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:S?w.TextReadingDirection.RTL:w.TextReadingDirection.LTR,verticalAlignment:J(da??"baseline"),verticalGlyphOrientation:w.VerticalGlyphOrientation.Right,wordSpacing:100,billboardMode3D:w.BillBoardMode.FaceNearPlane,callout:va}}static createPictureMarkerRasterizationParam(S){const {angle:V,height:T,width:Y,xoffset:ha,yoffset:ba}=S;return(S=S.url??S.source?.url??S.source?.imageData)?{type:"sprite-rasterization-param",
overrides:[],resource:{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:w.TextureFilter.Picture,tintColor:null,url:S,size:T,width:Y,offsetX:v.getNumericValue(ha),offsetY:v.getNumericValue(ba),rotation:v.getNumericValue(-V)}}:null}static createPictureFillRasterizationParam(S){const {width:V,height:T,xoffset:Y,yoffset:ha,url:ba}=S;return ba?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureFill",scaleX:1,textureFilter:w.TextureFilter.Picture,tintColor:null,
url:ba,width:V,height:T,offsetX:v.getNumericValue(Y),offsetY:v.getNumericValue(ha),rotation:0}}:null}static fromSimpleMarker(S,V,T){var {style:Y}=S;T=S.color??T;if("path"===Y||"esriSMSPath"===Y){V=[];if("outline"in S&&S.outline){var ha=S.outline;V.push({type:"CIMSolidStroke",enable:!0,width:ha.width,color:R(ha.color),path:S.path})}V.push({type:"CIMSolidFill",enable:!0,color:R(T),path:S.path});const [ea,da]=W("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:-v.getNumericValue(S.angle),
size:v.getNumericValue(S.size||6),offsetX:v.getNumericValue(S.xoffset),offsetY:v.getNumericValue(S.yoffset),scaleSymbolsProportionally:!1,frame:ea,markerGraphics:[{type:"CIMMarkerGraphic",geometry:da,symbol:{type:"CIMPolygonSymbol",symbolLayers:V}}]}]}}const ba=[];ha=S.size;let U;if("outline"in S&&S.outline&&"none"!==S.outline.style&&"esriSLSNull"!==S.outline.style){const ea=S.outline,da="solid"!==ea.style&&"esriSLSSolid"!==ea.style;[Y,U]=da?W(Y,S.size):W(Y);const ia=ea.width??m.defaultPolylineSymbol2D.width;
if(da){var Z=ia/S.size,ca=(Y.xmax-Y.xmin)*Z/2;Z=(Y.ymax-Y.ymin)*Z/2;Y.xmin-=ca;Y.xmax+=ca;Y.ymin-=Z;Y.ymax+=Z;ha&&(ha+=ia)}ca="cross"!==S.style&&"x"!==S.style||"dot"===S?.outline.style||"short-dot"===S?.outline.style?w.LineDashEnding.HalfGap:w.LineDashEnding.FullPattern;ca=da?[{type:"CIMGeometricEffectAddControlPoints"},{type:"CIMGeometricEffectDashes",dashTemplate:Q(ea.style,null).map(ka=>ea.width&&0<ea.width?ka*ea.width:ka),lineDashEnding:ca,controlPointEnding:w.LineDashEnding.FullPattern}]:void 0;
ba.push({type:"CIMSolidStroke",capStyle:da?w.LineCapStyle.Round:w.LineCapStyle.Butt,enable:!0,width:ia,color:R(ea.color),effects:ca})}else!V||"line-marker"!==S.type||"cross"!==S.style&&"x"!==S.style?[Y,U]=W(Y):([Y,U]=W(Y),ba.push({type:"CIMSolidStroke",enable:!0,width:V,color:R(T)}));ba.push({type:"CIMSolidFill",enable:!0,color:R(T)});T={type:"CIMPolygonSymbol",symbolLayers:ba};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:v.getNumericValue(-S.angle),size:v.getNumericValue(ha||
6*V),offsetX:v.getNumericValue(S.xoffset),offsetY:v.getNumericValue(S.yoffset),scaleSymbolsProportionally:!1,frame:Y,markerGraphics:[{type:"CIMMarkerGraphic",geometry:U,symbol:T}]}]}}static fromCIMHatchFill(S,V){const T=V*(S.separation??t.defaultCIMValues.CIMHatchFill.separation),Y=T/2;S=l.clone(S.lineSymbol);S.symbolLayers?.forEach(ba=>{switch(ba.type){case "CIMSolidStroke":null!=ba.width&&(ba.width*=V);ba.effects?.forEach(U=>{"CIMGeometricEffectDashes"===U.type&&(U.dashTemplate=U.dashTemplate?.map(Z=>
Z*V))});break;case "CIMVectorMarker":null!=ba.size&&(ba.size*=V),ba=ba.markerPlacement,null!=ba&&"placementTemplate"in ba&&(ba.placementTemplate=ba.placementTemplate.map(U=>U*V))}});for(var ha=this._getLineSymbolPeriod(S)||4;4>ha;)ha*=2;ha/=2;return{type:"CIMVectorMarker",frame:{xmin:-ha,xmax:ha,ymin:-Y,ymax:Y},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-ha,0],[ha,0]]]},symbol:S}],size:T}}static fetchResources(S,V,T,Y=null){if(!S||!V)return T;C(S,ha=>{D(ha,V,T);"url"in ha&&ha.url&&
T.push(V.fetchResource(ha.url,{signal:Y}))});return T}static fetchFonts(S,V,T){if(S&&V)if("symbolLayers"in S&&S.symbolLayers)for(const ba of S.symbolLayers){if("CIMVectorMarker"===ba.type&&ba.markerGraphics)for(const U of ba.markerGraphics)U?.symbol&&L.fetchFonts(U.symbol,V,T)}else if("CIMTextSymbol"===S.type){const {fontFamilyName:ba,fontStyleName:U}=S;if(ba&&"calcitewebcoreicons"!==ba.toLowerCase()){var {style:Y,weight:ha}=v.fromCIMFontStyle(U);S=v.fromCIMFontDecoration(S);S=new e({family:ba,style:Y,
weight:ha,decoration:S});T.push(V.loadFont(S).catch(()=>{I().error(`Unsupported font ${ba} in CIM symbol`)}))}}}static _getLineSymbolPeriod(S){if(S){const V=this._getEffectsRepeat(S.effects);if(V)return V;if(S.symbolLayers)for(const T of S.symbolLayers)if(T){if(S=this._getEffectsRepeat(T.effects))return S;switch(T.type){case "CIMCharacterMarker":case "CIMPictureMarker":case "CIMVectorMarker":case "CIMObjectMarker3D":case "CIMglTFMarker3D":if(S=this._getPlacementRepeat(T.markerPlacement))return S}}}return 0}static _getEffectsRepeat(S){if(S)for(var V of S)if(V)switch(V.type){case "CIMGeometricEffectDashes":if((S=
V.dashTemplate)&&S.length){V=0;for(const T of S)V+=T;S.length&1&&(V*=2);return V}break;case "CIMGeometricEffectWave":return V.period;default:I().error(`unsupported geometric effect type ${V.type}`)}return 0}static _getPlacementRepeat(S){if(S)switch(S.type){case "CIMMarkerPlacementAlongLineSameSize":case "CIMMarkerPlacementAlongLineRandomSize":case "CIMMarkerPlacementAlongLineVariableSize":if((S=S.placementTemplate)&&S.length){let V=0;for(const T of S)V+=+T;S.length&1&&(V*=2);return V}}return 0}static fromCIMInsidePolygon(S){var V=
S.markerPlacement;const T={...S,markerPlacement:null,anchorPoint:null};S=Math.abs(V.stepX);const Y=Math.abs(V.stepY);var ha=(V.randomness??100)/100;let ba,U;if("Random"===V.gridType){var Z=h.px2pt(n.randomInsidePolygonTextureSize);const ca=Math.max(Math.floor(Z/S),1),ea=Math.max(Math.floor(Z/Y),1);Z=ca*S/2;ba=ea*Y/2;U=2*ba;V=new k(V.seed);const da=ha*S/1.5,ia=ha*Y/1.5;ha=[];for(let ka=0;ka<ca;ka++)for(let fa=0;fa<ea;fa++){const X=ka*S-Z+da*(.5-V.getFloat()),ja=fa*Y-ba+ia*(.5-V.getFloat());ha.push({x:X,
y:ja});0===ka&&ha.push({x:X+2*Z,y:ja});0===fa&&ha.push({x:X,y:ja+2*ba})}}else!0===V.shiftOddRows?(Z=S/2,ba=Y,U=2*Y,ha=[{x:-Z,y:0},{x:Z,y:0},{x:0,y:ba},{x:0,y:-ba}]):(Z=S/2,ba=Y/2,U=Y,ha=[{x:-S,y:0},{x:0,y:-Y},{x:-S,y:-Y},{x:0,y:0},{x:S,y:0},{x:0,y:Y},{x:S,y:Y},{x:-S,y:Y},{x:S,y:-Y}]);S=ha.map(ca=>({type:"CIMMarkerGraphic",geometry:ca,symbol:{type:"CIMPointSymbol",symbolLayers:[T]}}));return{type:"CIMVectorMarker",frame:{xmin:-Z,xmax:Z,ymin:-ba,ymax:ba},markerGraphics:S,size:U}}}const P=S=>{if(!S)return w.LineCapStyle.Butt;
switch(S){case "butt":return w.LineCapStyle.Butt;case "square":return w.LineCapStyle.Square;case "round":return w.LineCapStyle.Round}},M=S=>{if(!S)return w.LineJoinStyle.Miter;switch(S){case "miter":return w.LineJoinStyle.Miter;case "round":return w.LineJoinStyle.Round;case "bevel":return w.LineJoinStyle.Bevel}},K=S=>{if(null==S)return"Center";switch(S){case "left":return"Left";case "right":return"Right";case "center":return"Center"}},J=S=>{if(null==S)return"Center";switch(S){case "baseline":return"Baseline";
case "top":return"Top";case "middle":return"Center";case "bottom":return"Bottom"}},R=S=>{if(!S)return[0,0,0,0];const {r:V,g:T,b:Y,a:ha}=S;return[V,T,Y,255*ha]},Q=(S,V)=>{const T=q("safari")?.001:0;V="butt"===V;switch(S){case "dash":case "esriSLSDash":return V?[4,3]:[3,4];case "dash-dot":case "esriSLSDashDot":return V?[4,3,1,3]:[3,4,T,4];case "dot":case "esriSLSDot":return V?[1,3]:[T,4];case "long-dash":case "esriSLSLongDash":return V?[8,3]:[7,4];case "long-dash-dot":case "esriSLSLongDashDot":return V?
[8,3,1,3]:[7,4,T,4];case "long-dash-dot-dot":case "esriSLSDashDotDot":return V?[8,3,1,3,1,3]:[7,4,T,4,T,4];case "short-dash":case "esriSLSShortDash":return V?[4,1]:[3,2];case "short-dash-dot":case "esriSLSShortDashDot":return V?[4,1,1,1]:[3,2,T,2];case "short-dash-dot-dot":case "esriSLSShortDashDotDot":return V?[4,1,1,1,1,1]:[3,2,T,2,T,2];case "short-dot":case "esriSLSShortDot":return V?[1,1]:[T,2];case "solid":case "esriSLSSolid":case "none":return I().error("Unexpected: style does not require rasterization"),
[0,0];default:return I().error(`Tried to rasterize SLS, but found an unexpected style: ${S}!`),[0,0]}},W=(S,V=100)=>{var T=V/2,Y;if("circle"===S||"esriSMSCircle"===S){var ha=Math.acos(1-.25/T);V=Math.ceil(H/ha/4);0===V&&(V=1);ha=N/V;V*=4;S=[];S.push([T,0]);for(Y=1;Y<V;Y++)S.push([T*Math.cos(Y*ha),-T*Math.sin(Y*ha)]);S.push([T,0]);ha={rings:[S]};Y={xmin:-T,ymin:-T,xmax:T,ymax:T}}else"cross"===S||"esriSMSCross"===S?(ha={paths:[[[0,T],[0,-T]],[[T,0],[-T,0]]]},Y={xmin:-T,ymin:-T,xmax:T,ymax:T}):"diamond"===
S||"esriSMSDiamond"===S?(ha={rings:[[[-T,0],[0,T],[T,0],[0,-T],[-T,0]]]},Y={xmin:-T,ymin:-T,xmax:T,ymax:T}):"square"===S||"esriSMSSquare"===S?(ha={rings:[[[-T,-T],[-T,T],[T,T],[T,-T],[-T,-T]]]},Y={xmin:-T,ymin:-T,xmax:T,ymax:T}):"x"===S||"esriSMSX"===S?(ha={paths:[[[T,T],[-T,-T]],[[T,-T],[-T,T]]]},Y={xmin:-T,ymin:-T,xmax:T,ymax:T}):"triangle"===S||"esriSMSTriangle"===S?(T=.5773502691896257*V,S=-T,Y=2/3*V,V=Y-V,ha={rings:[[[S,V],[0,Y],[T,V],[S,V]]]},Y={xmin:S,ymin:V,xmax:T,ymax:Y}):"arrow"===S&&(ha=
{rings:[[[-50,50],[50,0],[-50,-50],[-33,-20],[-33,20],[-50,50]]]},Y={xmin:-T,ymin:-T,xmax:T,ymax:T});return[Y,ha]};a.CIMSymbolHelper=L;a.CIMSymbolInflatedSizeHelper=O;a.capTypeToEnum=P;a.getEffectsInflateSize=B;a.slsDashToTemplateArray=Q;a.symbolToCIM=function(S){let V;switch(S.type){case "cim":return S.data;case "web-style":return S;case "simple-marker":S=L.fromSimpleMarker(S);if(!S)throw Error("InternalError: Cannot convert symbol to CIM");V=S;break;case "picture-marker":V=L.fromPictureMarker(S);
break;case "simple-line":V=L.fromSimpleLineSymbol(S);break;case "simple-fill":V=L.fromSimpleFillSymbol(S);break;case "picture-fill":V=L.fromPictureFillSymbol(S);break;case "text":V=L.fromTextSymbol(S)}return{type:"CIMSymbolReference",symbol:V}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/BidiText":function(){define(["exports","./BidiEngine"],function(a,b){const q=new b;a.bidiText=function(l){if(null==l)return["",!1];if(!q.hasBidiChar(l))return[l,!1];let p;p="rtl"===
q.checkContextual(l)?"IDNNN":"ICNNN";return[q.bidiTransform(l,p,"VLYSN"),!0]};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/BidiEngine":function(){define(["./bidiEngineTables"],function(a){function b(A,B,C,D,F){var H=A;void 0===B&&(B=F.defInFormat);void 0===C&&(C=F.defOutFormat);void 0===D&&(D=F.defSwap);if(B!==C){var N=B.substring(0,1),E=C.substring(0,1);var G=B.substring(1,4);var I=C.substring(1,4);"C"===G.charAt(0)&&(G=q(H),G="ltr"===G||"rtl"===G?G.toUpperCase():"L"===
B.charAt(2)?"LTR":"RTL",B=N+G);"C"===I.charAt(0)&&(G=q(H),"rtl"===G?I="RTL":"ltr"===G?(H=H.split(""),H.reverse(),G=q(H.join("")),I=G.toUpperCase()):I="L"===C.charAt(2)?"LTR":"RTL",C=E+I)}if(B===C)return A;E=B.substring(0,1);H=B.substring(1,4);N=C.substring(0,1);I=C.substring(1,4);F.inFormat=B;F.outFormat=C;F.swap=D;if("L"===E&&"VLTR"===C){if("LTR"===H)return F.dir=0,l(A,F);if("RTL"===H)return F.dir=1,l(A,F)}if("V"===E&&"V"===N)return F.dir="RTL"===H?1:0,k(A,F);if("L"===E&&"VRTL"===C)return F.dir=
"LTR"===H?0:1,A=l(A,F),k(A);if("VLTR"===B&&"LLTR"===C)return F.dir=0,l(A,F);if("V"===E&&"L"===N&&H!==I)return A=k(A),"RTL"===H?b(A,"LLTR","VLTR",D,F):b(A,"LRTL","VRTL",D,F);if("VRTL"===B&&"LRTL"===C)return b(A,"LRTL","VRTL",D,F);"L"===E&&"L"===N&&(B=F.swap,F.swap=B.substr(0,1)+"N","RTL"===H?(F.dir=1,A=l(A,F),F.swap="N"+B.substr(1,2),F.dir=0,A=l(A,F)):(F.dir=0,A=l(A,F),F.swap="N"+B.substr(1,2),A=b(A,"VLTR","LRTL",F.swap,F)));return A}function q(A){return(A=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(A))?
"z">=A[0]?"ltr":"rtl":""}function l(A,B){A=A.split("");const C=[];p(A,C,B);if(0!==B.hiLevel&&B.swap.substr(0,1)!==B.swap.substr(1,2))for(let H=0;H<A.length;H++)if(1===C[H]){var D=H;b:{let N=void 0;var F=A[H];let E=0,G=a.swapTable.length-1;for(;E<=G;)if(N=Math.floor((E+G)/2),F<a.swapTable[N][0])G=N-1;else if(F>a.swapTable[N][0])E=N+1;else{F=a.swapTable[N][1];break b}}A[D]=F}c(2,A,C,B);c(1,A,C,B);u=C;return A.join("")}function p(A,B,C){const D=A.length;var F=C.dir?a.impTabRtl:a.impTabLtr,H=0,N=-1;const E=
[],G=[];C.hiLevel=C.dir;C.lastArabic=!1;C.hasUbatAl=!1;C.hasUbatB=!1;C.hasUbatS=!1;for(var I=0;I<D;I++){var O=I,L=A[I].charCodeAt(0);const P=a.primaryTable[L>>8];E[O]=P<a.tbbase?P:a.unicodeTable[P-a.tbbase][L&255]}for(O=0;O<D;O++){I=e(A,E,G,O,C);G[O]=I;H=F[H][I];L=H&240;H&=15;I=F[H][5];B[O]=I;if(0<L){if(16===L)for(;N<O;N++)B[N]=1;N=-1}if(F[H][6])-1===N&&(N=O);else if(-1<N){for(;N<O;N++)B[N]=I;N=-1}E[O]===a.ubatB&&(B[O]=0);C.hiLevel|=I}if(C.hasUbatS)for(A=0;A<D;A++)if(E[A]===a.ubatS)for(B[A]=C.dir,
F=A-1;0<=F;F--)if(E[F]===a.ubatWs)B[F]=C.dir;else break}function k(A,B){A=A.split("");if(B){const C=[];p(A,C,B);u=C}A.reverse();r.reverse();return A.join("")}function h(A){for(let B=0;B<a.arabicAlefBetIntervalsBegine.length;B++)if(A>=a.arabicAlefBetIntervalsBegine[B]&&A<=a.arabicAlefBetIntervalsEnd[B])return!0;return!1}function f(A,B,C,D){for(;B*C<D&&d(A[B]);)B+=C;return B*C<D&&h(A[B])?!0:!1}function c(A,B,C,D){if(!(D.hiLevel<A))if(1!==A||1!==D.dir||D.hasUbatB){D=B.length;for(var F=0,H,N,E;F<D;){if(C[F]>=
A){for(H=F+1;H<D&&C[H]>=A;)H++;for(N=H-1;F<N;F++,N--)E=B[F],B[F]=B[N],B[N]=E,E=r[F],r[F]=r[N],r[N]=E;F=H}F++}}else B.reverse(),r.reverse()}function e(A,B,C,D,F){return{UBAT_L:()=>{F.lastArabic=!1;return a.ubatL},UBAT_R:()=>{F.lastArabic=!1;return a.ubatR},UBAT_ON:()=>a.ubatOn,UBAT_AN:()=>a.ubatAn,UBAT_EN:()=>F.lastArabic?a.ubatAn:a.ubatEn,UBAT_AL:()=>{F.lastArabic=!0;F.hasUbatAl=!0;return a.ubatR},UBAT_WS:()=>a.ubatOn,UBAT_CS:()=>{let H,N;if(1>D||D+1>=B.length||(H=C[D-1])!==a.ubatEn&&H!==a.ubatAn||
(N=B[D+1])!==a.ubatEn&&N!==a.ubatAn)return a.ubatOn;F.lastArabic&&(N=a.ubatAn);return N===H?N:a.ubatOn},UBAT_ES:()=>(0<D?C[D-1]:a.ubatB)===a.ubatEn&&D+1<B.length&&B[D+1]===a.ubatEn?a.ubatEn:a.ubatOn,UBAT_ET:()=>{if(0<D&&C[D-1]===a.ubatEn)return a.ubatEn;if(F.lastArabic)return a.ubatOn;let H=D+1;const N=B.length;for(;H<N&&B[H]===a.ubatEt;)H++;return H<N&&B[H]===a.ubatEn?a.ubatEn:a.ubatOn},UBAT_NSM:()=>{if("VLTR"===F.inFormat){for(var H=B.length,N=D+1;N<H&&B[N]===a.ubatNsm;)N++;if(N<H&&(H=A[D].charCodeAt(0),
N=B[N],(1425<=H&&2303>=H||64286===H)&&(N===a.ubatR||N===a.ubatAl)))return a.ubatR}return 1>D||B[D-1]===a.ubatB?a.ubatOn:C[D-1]},UBAT_B:()=>{F.lastArabic=!0;F.hasUbatB=!0;return F.dir},UBAT_S:()=>{F.hasUbatS=!0;return a.ubatOn},UBAT_LRE:()=>{F.lastArabic=!1;return a.ubatOn},UBAT_RLE:()=>{F.lastArabic=!1;return a.ubatOn},UBAT_LRO:()=>{F.lastArabic=!1;return a.ubatOn},UBAT_RLO:()=>{F.lastArabic=!1;return a.ubatOn},UBAT_PDF:()=>{F.lastArabic=!1;return a.ubatOn},UBAT_BN:()=>a.ubatOn}[a.typesNames[B[D]]]()}
function g(A,B){for(let C=0;C<a.baseForm.length;C++)if(A===a.baseForm[C])return B[C];return A}function d(A){return"\u064b"<=A&&"\u0655">=A}function t(A){return"L"===A?"LTR":"R"===A?"RTL":"C"===A?"CLR":"D"===A?"CRL":""}function w(A,B){for(let C=0;C<a.aLefTable.length;C++)if(A===a.aLefTable[C])return B[C];return A}function v(A,B,C,D){for(let F=0;F<A.length;F++)if(A[F]>B||!C&&A[F]===B)A[F]+=D}class m{constructor(){this.inputFormat="ILYNN";this.outputFormat="VLNNN";this.sourceToTarget=[];this.targetToSource=
[];this.levels=[]}bidiTransform(A,B,C){this.sourceToTarget=[];this.targetToSource=[];if(!A)return"";var D=this.sourceToTarget,F=this.targetToSource,H=A.length;r=[];u=[];for(var N=0;N<H;N++)D[N]=N,F[N]=N,r[N]=N;if(!this.checkParameters(B,C))return A;B=this.inputFormat;C=this.outputFormat;D=A;D=x;N=t(B.charAt(1));F=t(C.charAt(1));var E="I"===B.charAt(0)?"L":B.charAt(0);H="I"===C.charAt(0)?"L":C.charAt(0);N=E+N;F=H+F;H=B.charAt(2)+C.charAt(2);D.defInFormat=N;D.defOutFormat=F;D.defSwap=H;A=b(A,N,F,H,
D);D=!1;if("R"===C.charAt(1))D=!0;else if("C"===C.charAt(1)||"D"===C.charAt(1))D="rtl"===this.checkContextual(A);F=this.sourceToTarget=r;H=Array(F.length);for(N=0;N<F.length;N++)H[F[N]]=N;n=this.targetToSource=H;if(B.charAt(3)===C.charAt(3))D=A;else if("S"===C.charAt(3))if(B=D,C=A,0===C.length)D="";else{void 0===B&&(B=!0);C=String(C);C=C.split("");F=0;A=1;D=C.length;B||(F=C.length-1,A=-1,D=1);N=F;E=0;F=[];for(H=0;N*A<D;N+=A)if(h(C[N])||d(C[N])){var G;if(G="\u0644"===C[N])b:{for(var I=C,O=N+A,L=A,
P=D;O*L<P&&d(I[O]);)O+=L;G=" ";if(O*L<P)for(G=I[O],I=0;I<a.aLefTable.length;I++)if(a.aLefTable[I]===G){G=!0;break b}G=!1}if(G){C[N]=0===E?w(C[N+A],a.lamAlefInialTableFE):w(C[N+A],a.lamAlefMedialTableFE);N+=A;E=C;G=N;I=A;for(O=D;G*I<O&&d(E[G]);)G+=I;G*I<O&&(E[G]=" ");F[H]=N;H++;E=0}else{G=C[N];if(1===E){I=N;if(f(C,N+A,A,D))b:for(O=C[N],L=0;L<a.baseForm.length;L++){if(O===a.baseForm[L]){O=a.medialForm[L];break b}}else O=g(C[N],a.finalForm);C[I]=O}else!0===f(C,N+A,A,D)?C[N]=g(C[N],a.initialForm):C[N]=
g(C[N],a.isolatedForm);d(G)||(E=1);b:{for(I=0;I<a.standAlonForm.length;I++)if(a.standAlonForm[I]===G){G=!0;break b}G=!1}!0===G&&(E=0)}}else E=0;A=F;D="";for(F=0;F<C.length;F++){b:{for(H=0;H<A.length;H++)if(A[H]===F)break b;H=-1}-1<H?(v(n,F,!B,-1),r.splice(F,1)):D+=C[F]}}else if(B=A,C=D,0===B.length)D="";else{void 0===C&&(C=!0);B=String(B);A="";D=B.split("");for(F=0;F<B.length;F++)H=!1,"\ufe70"<=D[F]&&"\ufeff">D[F]?(N=B.charCodeAt(F),"\ufef5"<=D[F]&&"\ufefc">=D[F]?(C?(0<F&&" "===D[F-1]?A=A.substring(0,
A.length-1)+"\u0644":(A+="\u0644",H=!0),A+=a.aLefTable[(N-65269)/2]):(A+=a.aLefTable[(N-65269)/2],A+="\u0644",F+1<B.length&&" "===D[F+1]?F++:H=!0),H&&(v(n,F,!0,1),r.splice(F,0,r[F]))):A+=a.feTo06Table[N-65136]):A+=D[F];D=A}this.sourceToTarget=r;this.targetToSource=n;this.levels=u;return D}_inputFormatSetter(A){if(!y.test(A))throw Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.inputFormat=A}_outputFormatSetter(A){if(!y.test(A))throw Error("dojox/string/BidiEngine: the bidi layout string is wrong!");
this.outputFormat=A}checkParameters(A,B){A?this._inputFormatSetter(A):A=this.inputFormat;B?this._outputFormatSetter(B):B=this.outputFormat;return A===B?!1:!0}checkContextual(A){A=q(A);if("ltr"!==A&&"rtl"!==A){try{A=document.dir.toLowerCase()}catch(B){}"ltr"!==A&&"rtl"!==A&&(A="ltr")}return A}hasBidiChar(A){return z.test(A)}}let r=[],n=[],u=[];const x={dir:0,defInFormat:"LLTR",defoutFormat:"VLTR",defSwap:"YN",inFormat:"LLTR",outFormat:"VLTR",swap:"YN",hiLevel:0,lastArabic:!1,hasUbatAl:!1,hasBlockSep:!1,
hasSegSep:!1,defOutFormat:""},y=/^[(I|V)][(L|R|C|D)][(Y|N)][(S|N)][N]$/,z=/[\u0591-\u06ff\ufb1d-\ufefc]/;return m})},"esri/core/bidiEngineTables":function(){define(["exports"],function(a){a.aLefTable=["\u0622","\u0623","\u0625","\u0627"];a.arabicAlefBetIntervalsBegine=["\u0621","\u0641"];a.arabicAlefBetIntervalsEnd=["\u063a","\u064a"];a.baseForm="\u0627\u0628\u062a\u062b\u062c\u062d\u062e\u062f\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063a\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u064a\u0625\u0623\u0622\u0629\u0649\u0644\u0645\u0646\u0647\u0648\u064a\u0625\u0623\u0622\u0629\u0649\u06cc\u0626\u0624".split("");
a.feTo06Table="\u064b\u064b\u064c\u061f\u064d\u061f\u064e\u064e\u064f\u064f\u0650\u0650\u0651\u0651\u0652\u0652\u0621\u0622\u0622\u0623\u0623\u0624\u0624\u0625\u0625\u0626\u0626\u0626\u0626\u0627\u0627\u0628\u0628\u0628\u0628\u0629\u0629\u062a\u062a\u062a\u062a\u062b\u062b\u062b\u062b\u062c\u062c\u062c\u062c\u062d\u062d\u062d\u062d\u062e\u062e\u062e\u062e\u062f\u062f\u0630\u0630\u0631\u0631\u0632\u0632\u0633\u0633\u0633\u0633\u0634\u0634\u0634\u0634\u0635\u0635\u0635\u0635\u0636\u0636\u0636\u0636\u0637\u0637\u0637\u0637\u0638\u0638\u0638\u0638\u0639\u0639\u0639\u0639\u063a\u063a\u063a\u063a\u0641\u0641\u0641\u0641\u0642\u0642\u0642\u0642\u0643\u0643\u0643\u0643\u0644\u0644\u0644\u0644\u0645\u0645\u0645\u0645\u0646\u0646\u0646\u0646\u0647\u0647\u0647\u0647\u0648\u0648\u0649\u0649\u064a\u064a\u064a\u064a\ufef5\ufef6\ufef7\ufef8\ufef9\ufefa\ufefb\ufefc\u061f\u061f\u061f".split("");
a.finalForm="\ufe8e\ufe90\ufe96\ufe9a\ufe9e\ufea2\ufea6\ufeaa\ufeac\ufeae\ufeb0\ufeb2\ufeb6\ufeba\ufebe\ufec2\ufec6\ufeca\ufece\ufed2\ufed6\ufeda\ufede\ufee2\ufee6\ufeea\ufeee\ufef2\ufe88\ufe84\ufe82\ufe94\ufef0\ufbfd\ufe8a\ufe86\ufe70\ufe72\ufe74\ufe76\ufe78\ufe7a\ufe7c\ufe7e\ufe80\ufe8a\ufe86".split("");a.impTabLtr=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]];a.impTabRtl=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]];a.initialForm=
"\ufe8d\ufe91\ufe97\ufe9b\ufe9f\ufea3\ufea7\ufea9\ufeab\ufead\ufeaf\ufeb3\ufeb7\ufebb\ufebf\ufec3\ufec7\ufecb\ufecf\ufed3\ufed7\ufedb\ufedf\ufee3\ufee7\ufeeb\ufeed\ufef3\ufe87\ufe83\ufe81\ufe93\ufeef\ufbfe\ufe8b\ufe85\ufe70\ufe72\ufe74\ufe76\ufe78\ufe7a\ufe7c\ufe7e\ufe80\ufe8b\ufe85".split("");a.isolatedForm="\ufe8d\ufe8f\ufe95\ufe99\ufe9d\ufea1\ufea5\ufea9\ufeab\ufead\ufeaf\ufeb1\ufeb5\ufeb9\ufebd\ufec1\ufec5\ufec9\ufecd\ufed1\ufed5\ufed9\ufedd\ufee1\ufee5\ufee9\ufeed\ufef1\ufe87\ufe83\ufe81\ufe93\ufeef\ufbfc\ufe89\ufe85\ufe70\ufe72\ufe74\ufe76\ufe78\ufe7a\ufe7c\ufe7e\ufe80\ufe89\ufe85".split("");
a.lamAlefInialTableFE=["\ufef5","\ufef7","\ufef9","\ufefb"];a.lamAlefMedialTableFE=["\ufef6","\ufef8","\ufefa","\ufefc"];a.medialForm="\ufe8e\ufe92\ufe98\ufe9c\ufea0\ufea4\ufea8\ufeaa\ufeac\ufeae\ufeb0\ufeb4\ufeb8\ufebc\ufec0\ufec4\ufec8\ufecc\ufed0\ufed4\ufed8\ufedc\ufee0\ufee4\ufee8\ufeec\ufeee\ufef4\ufe88\ufe84\ufe82\ufe94\ufef0\ufbff\ufe8c\ufe86\ufe71\ufe72\ufe74\ufe77\ufe79\ufe7b\ufe7d\ufe7f\ufe80\ufe8c\ufe86".split("");a.primaryTable=[100,0,0,0,0,101,102,103,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,104,4,4,4,0,4,0,4,0,4,4,4,0,0,4,4,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,4,4,0,0,4,4,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,105,7,7,106,107];a.standAlonForm="\u0621\u0622\u0623\u0624\u0625\u0627\u0629\u062f\u0630\u0631\u0632\u0648\u0649".split("");
a.swapTable=[["(",")"],[")","("],["\x3c","\x3e"],["\x3e","\x3c"],["[","]"],["]","["],["{","}"],["}","{"],["\u00ab","\u00bb"],["\u00bb","\u00ab"],["\u2039","\u203a"],["\u203a","\u2039"],["\u207d","\u207e"],["\u207e","\u207d"],["\u208d","\u208e"],["\u208e","\u208d"],["\u2264","\u2265"],["\u2265","\u2264"],["\u2329","\u232a"],["\u232a","\u2329"],["\ufe59","\ufe5a"],["\ufe5a","\ufe59"],["\ufe5b","\ufe5c"],["\ufe5c","\ufe5b"],["\ufe5d","\ufe5e"],["\ufe5e","\ufe5d"],["\ufe64","\ufe65"],["\ufe65","\ufe64"]];
a.tbbase=100;a.typesNames="UBAT_L UBAT_R UBAT_EN UBAT_AN UBAT_ON UBAT_B UBAT_S UBAT_AL UBAT_WS UBAT_CS UBAT_ES UBAT_ET UBAT_NSM UBAT_LRE UBAT_RLE UBAT_PDF UBAT_LRO UBAT_RLO UBAT_BN".split(" ");a.ubatAl=7;a.ubatAn=3;a.ubatB=5;a.ubatBn=18;a.ubatCs=9;a.ubatEn=2;a.ubatEs=10;a.ubatEt=11;a.ubatL=0;a.ubatLre=13;a.ubatLro=16;a.ubatNsm=12;a.ubatOn=4;a.ubatPdf=15;a.ubatR=1;a.ubatRle=14;a.ubatRlo=17;a.ubatS=6;a.ubatWs=8;a.unicodeTable=[[18,18,18,18,18,18,18,18,18,6,5,6,8,5,18,18,18,18,18,18,18,18,18,18,18,18,
18,18,5,5,5,6,8,4,4,11,11,11,4,4,4,4,4,10,9,10,9,9,2,2,2,2,2,2,2,2,2,2,9,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,18,18,18,18,18,18,5,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,9,4,11,11,11,11,4,4,4,4,0,4,4,18,4,4,11,11,2,2,4,0,4,4,4,2,0,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,
0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,4,4,4,4,4,4,4,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,1,12,12,1,12,12,1,12,4,4,4,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,1,1,1,1,1,4,4,4,4,4,4,4,4,4,4,4],[3,3,3,3,4,4,4,4,7,11,11,7,9,7,4,4,12,12,12,12,12,12,12,12,12,12,12,7,4,4,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,3,3,3,3,3,3,3,3,3,3,11,3,3,7,7,7,12,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,12,12,12,12,12,12,12,3,4,12,12,12,12,12,12,7,7,12,12,4,12,12,12,12,7,7,2,2,2,2,2,2,2,2,2,2,7,7,7,7,7,7],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,4,7,7,12,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,4,4,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,12,12,
12,12,12,12,12,12,12,12,12,7,4,4,4,4,4,4,4,4,4,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,12,12,12,12,12,12,12,12,1,1,4,4,4,4,1,4,4,4,4,4],[8,8,8,8,8,8,8,8,8,8,8,18,18,18,0,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,5,13,14,15,16,17,9,11,11,11,11,11,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,18,18,18,18,18,4,4,4,4,4,18,18,18,18,18,18,2,0,4,4,2,2,2,2,2,2,10,10,4,4,4,0,2,2,2,2,2,2,2,2,2,2,10,
10,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4],[0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,4,4,4,4,4,1,12,1,1,1,1,1,1,1,1,1,1,10,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,4,1,4,1,1,4,1,1,4,1,1,1,1,1,1,1,1,1,1,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],[12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,12,12,12,12,12,12,12,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,9,4,
4,9,4,4,4,4,4,4,4,4,4,11,4,4,10,10,4,4,4,4,4,11,11,4,4,4,4,4,7,7,7,7,7,4,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,4,4,18],[4,4,4,11,11,11,4,4,4,4,4,10,9,10,9,9,2,2,2,2,2,2,2,2,2,2,9,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,0,0,0,0,0,0,4,4,0,0,0,0,0,0,4,4,0,0,0,0,0,0,4,4,0,0,0,4,4,4,11,11,4,4,4,11,11,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4]];Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/CIMPlacements":function(){define(["exports"],
function(a){class b{constructor(){this.setIdentity()}getAngle(){if(null==this.rz||0===this.rz&&1!==this.rzCos&&0!==this.rzSin)this.rz=Math.atan2(this.rzSin,this.rzCos);return this.rz}setIdentity(){this.tz=this.ty=this.tx=0;this.s=1;this.rz=this.ry=this.rx=0;this.rzCos=1;this.rzSin=0}setTranslate(l,p){this.tx=l;this.ty=p}setTranslateZ(l){this.tz=l}setRotateCS(l,p){this.rz=void 0;this.rzCos=l;this.rzSin=p}setRotate(l){this.rz=l;this.rzSin=this.rzCos=void 0}setRotateY(l){this.ry=l}setScale(l){this.s=
l}setMeasure(l){this.m=l}}class q{next(){return null}}a.EmptyPlacementCursor=q;a.Placement=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/CIMSymbolDrawHelper":function(){define("exports ../../core/fontUtils ../../core/has ../../core/lang ../../core/Logger ../../core/ObjectPool ../../core/screenUtils ../../geometry/GeometryCursor ../../geometry/support/aaBoundingRect ../../geometry/support/boundsUtils ../../geometry/support/centroid ../../geometry/support/jsonUtils ./CIMEffects ./CIMImageColorSubstitutionHelper ./CIMOperators ./CIMPlacements ./defaultCIMValues ./enums ./imageUtils ./Rect ./TextRasterizer ./utils ../../views/2d/engine/webgl/definitions ../../views/2d/engine/webgl/mesh/templates/shapingUtils ../../views/2d/layers/graphics/graphicsUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C){function D(M,K,J){for(const Q of K){K=Q.length;for(let W=1;W<K;W++){var R=Q[W-1];const S=Q[W];let V=(S[0]-R[0])*(S[0]-R[0])+(S[1]-R[1])*(S[1]-R[1]);if(0!==V&&(V=Math.sqrt(V),Math.abs(((S[0]-R[0])*(M[1]-R[1])-(S[1]-R[1])*(M[0]-R[0]))/V)<J&&(R=((S[0]-R[0])*(M[0]-R[0])+(S[1]-R[1])*(M[1]-R[1]))/V,R>-J&&R<V+J)))return!0}}return!1}function F(M,K=1){const J=z.fromCIMFontDecoration(M);var R=z.fromCIMFontStyle(M.fontStyleName);const Q=M.fontFamilyName??
b.defaultFontFamily,{weight:W,style:S}=R;R=K*(M.height||5);const V=z.fromCIMHorizontalAlignment(M.horizontalAlignment),T=z.fromCIMVerticalAlignment(M.verticalAlignment),Y=z.getFillColor(M),ha=z.getFillColor(M.haloSymbol);K=null!=ha?K*(M.haloSize??0):0;var ba="CIMBackgroundCallout"===M.callout?.type?M.callout.backgroundSymbol:null;M=z.getFillColor(ba);const U=z.getStrokeWidth(ba);ba=z.getStrokeColor(ba);return{color:Y,size:R,horizontalAlignment:V,verticalAlignment:T,font:{family:Q,style:z.getFontStyle(S),
weight:z.getFontWeight(W),decoration:J},halo:{size:K||0,color:ha,style:S},backgroundColor:M,borderLine:null!=U&&null!=ba?{size:U,color:ba}:null,pixelRatio:1,premultiplyColors:!0}}const H=Math.PI/180;class N{constructor(M){this._t=M}static createIdentity(){return new N([1,0,0,0,1,0])}clone(){return new N(this._t.slice())}transform(M){const K=this._t;return[K[0]*M[0]+K[1]*M[1]+K[2],K[3]*M[0]+K[4]*M[1]+K[5]]}static createScale(M,K){return new N([M,0,0,0,K,0])}scale(M,K){const J=this._t;J[0]*=M;J[1]*=
M;J[2]*=M;J[3]*=K;J[4]*=K;J[5]*=K;return this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(M,K){return new N([0,0,M,0,0,K])}translate(M,K){const J=this._t;J[2]+=M;J[5]+=K;return this}static createRotate(M){const K=Math.cos(M);M=Math.sin(M);return new N([K,-M,0,M,K,0])}rotate(M){return N.multiply(this,N.createRotate(M),this)}angle(){const M=this._t[0],K=this._t[3],J=Math.sqrt(M*M+K*K);return[M/J,K/J]}static multiply(M,K,J){M=M._t;K=K._t;const R=
M[1]*K[0]+M[4]*K[1],Q=M[2]*K[0]+M[5]*K[1]+K[2],W=M[0]*K[3]+M[3]*K[4],S=M[1]*K[3]+M[4]*K[4],V=M[2]*K[3]+M[5]*K[4]+K[5],T=J._t;T[0]=M[0]*K[0]+M[3]*K[1];T[1]=R;T[2]=Q;T[3]=W;T[4]=S;T[5]=V;return J}invert(){const M=this._t;let K=M[0]*M[4]-M[1]*M[3];if(0===K)return new N([0,0,0,0,0,0]);K=1/K;return new N([M[4]*K,-M[1]*K,(M[1]*M[5]-M[2]*M[4])*K,-M[3]*K,M[0]*K,(M[2]*M[3]-M[0]*M[5])*K])}}class E{constructor(M,K){this._resourceManager=M;this._transfos=[];this._sizeTransfos=[];this._geomUnitsPerPoint=1;this._placementPool=
new k(m.Placement,void 0,void 0,100);this._earlyReturn=!1;this._mapRotation=0;this._transfos.push(K||N.createIdentity());this._sizeTransfos.push(K?K.scaleRatio():1)}setTransform(M,K){this._transfos=[M||N.createIdentity()];this._sizeTransfos=[K||(M?M.scaleRatio():1)]}setGeomUnitsPerPoint(M){this._geomUnitsPerPoint=M}transformPt(M){return this._transfos[this._transfos.length-1].transform(M)}transformSize(M){return M*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(M){return this._transfos[this._transfos.length-
1].invert().transform(M)}reverseTransformSize(M){return M/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(M){return M/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return 2<this._transfos.length?1:this._geomUnitsPerPoint}isEmbedded(){return 1<this._transfos.length}back(){return this._transfos[this._transfos.length-
1]}push(M,K){K=K?M.scaleRatio():1;N.multiply(M,this.back(),M);this._transfos.push(M);this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*K)}pop(){this._transfos.splice(-1,1);this._sizeTransfos.splice(-1,1)}drawSymbol(M,K,J){if(M)switch(M.type){case "CIMPointSymbol":case "CIMLineSymbol":case "CIMPolygonSymbol":this.drawMultiLayerSymbol(M,K);break;case "CIMTextSymbol":this.drawTextSymbol(M,K,J)}}drawMultiLayerSymbol(M,K){if(M&&K){var J=M.symbolLayers;if(J)if((M=M.effects)&&0<M.length){if(K=
this.executeEffects(M,K))for(M=K.next();M;)this.drawSymbolLayers(J,M.asJSON()),M=K.next()}else this.drawSymbolLayers(J,K)}}executeEffects(M,K){const J=this._resourceManager.geometryEngine;K=new t.SimpleEffectCursor(f.GeometryCursor.fromJSONCIM(K));for(const R of M)(M=v.getEffectOperator(R))&&(K=M.execute(K,R,this.geomUnitsPerPoint(),null,J));return K}drawSymbolLayers(M,K){let J=M.length;for(;J--;){const Q=M[J];if(Q&&!1!==Q.enable){var R=Q.effects;if(R&&0<R.length){if(R=this.executeEffects(R,K)){let W=
null;for(;(W=R.next())&&(this.drawSymbolLayer(Q,W.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(Q,K);if(this._earlyReturn)break}}}drawSymbolLayer(M,K){switch(M.type){case "CIMSolidFill":this.drawSolidFill(K,M.color);break;case "CIMHatchFill":this.drawHatchFill(K,M);break;case "CIMPictureFill":this.drawPictureFill(K,M);break;case "CIMGradientFill":this.drawGradientFill(K,M);break;case "CIMSolidStroke":this.drawSolidStroke(K,M.color,M.width,M.capStyle,M.joinStyle,M.miterLimit);break;case "CIMPictureStroke":this.drawPictureStroke(K,
M);break;case "CIMGradientStroke":this.drawGradientStroke(K,M);break;case "CIMCharacterMarker":case "CIMPictureMarker":case "CIMVectorMarker":this.drawMarkerLayer(M,K)}}drawHatchFill(M,K){var J=this.geomUnitsPerPoint(),R=z.getNumericValue(K.separation,r.defaultCIMValues.CIMHatchFill.separation)*J;var Q=z.getNumericValue(K.rotation);if(0===R)Q=null;else{0>R&&(R=-R);for(var W=0,S=.5*R;W>S;)W-=R;for(;W<-S;)W+=R;var V=c.create();e.getBoundsXY(V,M);V[0]-=S;V[1]-=S;V[2]+=S;V[3]+=S;for(var T=[[V[0],V[1]],
[V[0],V[3]],[V[2],V[3]],[V[2],V[1]]];180<Q;)Q-=180;for(;0>Q;)Q+=180;V=Math.cos(Q*H);var Y=Math.sin(Q*H);Q=-R*Y;S=R*V;W=z.getNumericValue(K.offsetX)*J;J*=z.getNumericValue(K.offsetY);W=W*Y-J*V;var ha;var ba=J=Number.MAX_VALUE;var U=ha=-Number.MAX_VALUE;for(var Z of T){var ca=Z[0];const ea=Z[1];T=V*ca+Y*ea;ca=-Y*ca+V*ea;ba=Math.min(ba,T);J=Math.min(J,ca);U=Math.max(U,T);ha=Math.max(ha,ca)}J=Math.floor(J/R)*R;Z=V*ba-Y*J-Q*W/R;ba=Y*ba+V*J-S*W/R;T=V*U-Y*J-Q*W/R;V=Y*U+V*J-S*W/R;R=1+Math.round((ha-J)/R);
W=[];for(Y=0;Y<R;Y++)Z+=Q,ba+=S,T+=Q,V+=S,W.push([[Z,ba],[T,V]]);Q={paths:W}}Q&&(this.pushClipPath(M),this.drawMultiLayerSymbol(K.lineSymbol,Q),this.popClipPath())}drawPictureFill(M,K){}drawGradientFill(M,K){}drawPictureStroke(M,K){}drawGradientStroke(M,K){}drawMarkerLayer(M,K){var J=M.markerPlacement;if(J){var R=v.getPlacementOperator(J);if(R){var Q="CIMMarkerPlacementInsidePolygon"===J.type||"CIMMarkerPlacementPolygonCenter"===J.type&&J.clipAtBoundary;Q&&this.pushClipPath(K);if(K=R.execute(f.GeometryCursor.fromJSONCIM(K),
J,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine))for(J=null;(J=K.next())&&(this.drawMarker(M,J),!this._earlyReturn););Q&&this.popClipPath()}}else{Q=this._placementPool.acquire();if(d.isPoint(K))Q.tx=K.x,Q.ty=K.y,this.drawMarker(M,Q);else if(d.isPolygon(K)){if(K=g.polygonCentroid(K))[Q.tx,Q.ty]=K,this.drawMarker(M,Q)}else for(R of K.points)if(Q.tx=R[0],Q.ty=R[1],this.drawMarker(M,Q),this._earlyReturn)break;this._placementPool.release(Q)}}drawMarker(M,K){switch(M.type){case "CIMCharacterMarker":case "CIMPictureMarker":this.drawPictureMarker(M,
K);break;case "CIMVectorMarker":this.drawVectorMarker(M,K)}}drawPictureMarker(M,K){if(M){var J=this._resourceManager.getResource(M.url),R=z.getNumericValue(M.size,r.defaultCIMValues.CIMPictureMarker.size);if(!(null==J||0>=R)){var Q=J.width;J=J.height;if(Q&&J){J=Q/J;var W=z.getNumericValue(M.scaleX,1);Q=N.createIdentity();var S=M.anchorPoint;if(S){var V=S.x;S=S.y;"Absolute"!==M.anchorPointUnits&&(V*=R*J*W,S*=R);Q.translate(-V,-S)}J=z.getNumericValue(M.rotation);M.rotateClockwise&&(J=-J);this._mapRotation&&
(J+=this._mapRotation);J&&Q.rotate(J*H);J=z.getNumericValue(M.offsetX);W=z.getNumericValue(M.offsetY);if(J||W){if(this._mapRotation){S=H*this._mapRotation;V=Math.cos(S);S=Math.sin(S);const T=J*S+W*V;J=J*V-W*S;W=T}Q.translate(J,W)}J=this.geomUnitsPerPoint();1!==J&&Q.scale(J,J);(J=K.getAngle())&&Q.rotate(J);Q.translate(K.tx,K.ty);this.push(Q,!1);this.drawImage(M,R);this.pop()}}}}drawVectorMarker(M,K){if(M){var J=M.markerGraphics;if(J){var R=z.getNumericValue(M.size,r.defaultCIMValues.CIMVectorMarker.size),
Q=M.frame,W=Q?Q.ymax-Q.ymin:0;W=R&&W?R/W:1;R=N.createIdentity();Q&&R.translate(.5*-(Q.xmax+Q.xmin),.5*-(Q.ymax+Q.ymin));var S=M.anchorPoint;if(S){var V=S.x;S=S.y;"Absolute"!==M.anchorPointUnits?Q&&(V*=Q.xmax-Q.xmin,S*=Q.ymax-Q.ymin):(V/=W,S/=W);R.translate(-V,-S)}1!==W&&R.scale(W,W);Q=z.getNumericValue(M.rotation);M.rotateClockwise&&(Q=-Q);this._mapRotation&&(Q+=this._mapRotation);Q&&R.rotate(Q*H);Q=z.getNumericValue(M.offsetX);W=z.getNumericValue(M.offsetY);if(Q||W){if(this._mapRotation){S=H*this._mapRotation;
V=Math.cos(S);S=Math.sin(S);const T=Q*S+W*V;Q=Q*V-W*S;W=T}R.translate(Q,W)}Q=this.geomUnitsPerPoint();1!==Q&&R.scale(Q,Q);(Q=K.getAngle())&&R.rotate(Q);R.translate(K.tx,K.ty);this.push(R,M.scaleSymbolsProportionally);for(const T of J)if(T?.symbol&&T.geometry||p.getLogger("esri.symbols.cim.CIMSymbolDrawHelper").error("Invalid marker graphic",T),M=T.textString,"number"===typeof M&&(M=M.toString()),this.drawSymbol(T.symbol,T.geometry,M),this._earlyReturn)break;this.pop()}}}drawTextSymbol(M,K,J){if(M&&
d.isPoint(K)&&!(0>=z.getNumericValue(M.height,r.defaultCIMValues.CIMTextSymbol.height))){var R=N.createIdentity(),Q=z.getNumericValue(M.angle);(Q=-Q)&&R.rotate(Q*H);Q=z.getNumericValue(M.offsetX);var W=z.getNumericValue(M.offsetY);(Q||W)&&R.translate(Q,W);Q=this.geomUnitsPerPoint();1!==Q&&R.scale(Q,Q);R.translate(K.x,K.y);this.push(R,!1);this.drawText(M,J);this.pop()}}}class G extends E{constructor(M,K){super(M,K);this.reset()}reset(){this._xmin=this._ymin=Infinity;this._xmax=this._ymax=-Infinity;
this._clipCount=0}envelope(){return new x(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return c.fromValues(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(M){!M||0<this._clipCount||(d.isPolygon(M)?this._processPath(M.rings,0):d.isPolyline(M)?this._processPath(M.paths,0):d.isExtent(M)?(M=L(M))&&this._processPath(M.rings,0):console.error("drawSolidFill Unexpected geometry type!"))}drawSolidStroke(M,K,J){!M||0<this._clipCount||null==J||0>=J||(K=Math.max(.5*this.transformSize(z.getNumericValue(J,
r.defaultCIMValues.CIMSolidStroke.width)),.25),d.isPolygon(M)?this._processPath(M.rings,K):d.isPolyline(M)?this._processPath(M.paths,K):d.isExtent(M)?(M=L(M))&&this._processPath(M.rings,K):console.error("drawSolidStroke unexpected geometry type!"))}drawMarkerLayer(M,K){d.isPolygon(K)&&M.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===M.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===M.markerPlacement.type&&M.markerPlacement.clipAtBoundary)?this._processPath(K.rings,0):super.drawMarkerLayer(M,
K)}drawHatchFill(M,K){this.drawSolidFill(M)}drawPictureFill(M,K){this.drawSolidFill(M)}drawGradientFill(M,K){this.drawSolidFill(M)}drawPictureStroke(M,K){this.drawSolidStroke(M,null,K.width)}drawGradientStroke(M,K){this.drawSolidStroke(M,null,K.width)}pushClipPath(M){this.drawSolidFill(M);this._clipCount++}popClipPath(){this._clipCount--}drawImage(M,K){var {url:J}=M;M=z.getNumericValue(M.scaleX,1);let R=M*K;var Q=K;J=this._resourceManager.getResource(J);null!=J&&(Q=J.height/J.width,R=M*(K?1<Q?K:K/
Q:J.width),Q=K?1<Q?K*Q:K:J.height);this._merge(this.transformPt([-R/2,-Q/2]),0);this._merge(this.transformPt([-R/2,Q/2]),0);this._merge(this.transformPt([R/2,-Q/2]),0);this._merge(this.transformPt([R/2,Q/2]),0)}drawText(M,K){if(K&&0!==K.length){this._textRasterizer||(this._textRasterizer=new y);var J=F(M),[R,Q]=this._textRasterizer.computeTextSize(K,J);R=h.px2pt(R);Q=h.px2pt(Q);K=0;switch(M.horizontalAlignment){case "Left":K=R/2;break;case "Right":K=-R/2}J=0;switch(M.verticalAlignment){case "Bottom":J=
Q/2;break;case "Top":J=-Q/2;break;case "Baseline":J=Q/6}this._merge(this.transformPt([-R/2+K,-Q/2+J]),0);this._merge(this.transformPt([-R/2+K,Q/2+J]),0);this._merge(this.transformPt([R/2+K,-Q/2+J]),0);this._merge(this.transformPt([R/2+K,Q/2+J]),0)}}_processPath(M,K){if(M)for(const J of M)if(M=J?J.length:0,1<M){this._merge(this.transformPt(J[0]),K);for(let R=1;R<M;R++)this._merge(this.transformPt(J[R]),K)}}_merge(M,K){M[0]-K<this._xmin&&(this._xmin=M[0]-K);M[0]+K>this._xmax&&(this._xmax=M[0]+K);M[1]-
K<this._ymin&&(this._ymin=M[1]-K);M[1]+K>this._ymax&&(this._ymax=M[1]+K)}}class I extends E{constructor(){super(...arguments);this._searchPoint=[0,0];this._searchDistPoint=0;this._textInfo=null}hitTest(M,K,J,R,Q,W){W*=h.pt2px(1);this.setTransform();this.setGeomUnitsPerPoint(W);this._searchPoint=[(M[0]+M[2])/2,(M[1]+M[3])/2];this._searchDistPoint=(M[2]-M[0])/2/W;this._textInfo=R;this._mapRotation=K&&("CIMPointSymbol"===K.type&&"Map"!==K.angleAlignment||"CIMTextSymbol"===K.type)?Q:0;q("esri-mobile")||
(M=h.px2pt(A.hittestToleranceSmallSymbol*window.devicePixelRatio),R=h.px2pt(A.hittestSmallSymbolThreshold),("CIMLineSymbol"!==K?.type&&"CIMPolygonSymbol"!==K?.type||!K.symbolLayers?.some(z.isCIMFill))&&"CIMMeshSymbol"!==K?.type&&(z.getSize(K)??0)<R&&(this._searchDistPoint=M));this._earlyReturn=!1;this.drawSymbol(K,J);return this._earlyReturn}drawSolidFill(M,K){this._hitTestFill(M)}drawHatchFill(M,K){this._hitTestFill(M)}drawPictureFill(M,K){this._hitTestFill(M)}drawGradientFill(M,K){this._hitTestFill(M)}drawSolidStroke(M,
K,J,R,Q,W){this._hitTestStroke(M,J)}drawPictureStroke(M,K){this._hitTestStroke(M,K.width)}drawGradientStroke(M,K){this._hitTestStroke(M,K.width)}drawMarkerLayer(M,K){M.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===M.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===M.markerPlacement.type&&M.markerPlacement.clipAtBoundary)?this._hitTestFill(K):super.drawMarkerLayer(M,K)}pushClipPath(M){}popClipPath(){}drawImage(M,K){var {url:J}=M;M=z.getNumericValue(M.scaleX,1);J=this._resourceManager.getResource(J);
if(null!=J&&0!==J.height&&0!==K){K*=this.geomUnitsPerPoint();M=J.width/J.height*M*K;J=this.reverseTransformPt(this._searchPoint);var R=this._searchDistPoint;Math.abs(J[0])<M/2+R&&Math.abs(J[1])<K/2+R&&(this._earlyReturn=!0)}}drawText(M,K){if((K=this._textInfo)&&(K=K.get(M))&&K.glyphMosaicItems.glyphs.length){var J=C.roundPtToWholePixel(z.getNumericValue(M.height,r.defaultCIMValues.CIMTextSymbol.height)),{lineGapType:R,lineGap:Q}=M,W=R?P(R,z.getNumericValue(Q),J):0,S="CIMBackgroundCallout"===M.callout?.type;
M=B.shapeGlyphs(K.glyphMosaicItems,{scale:J/A.glyphSize,angle:0,xOffset:0,yOffset:0,horizontalAlignment:M.horizontalAlignment,verticalAlignment:M.verticalAlignment,maxLineWidth:C.getLineWidth(M.lineWidth),lineHeight:A.magicLabelLineHeight*Math.max(.25,Math.min(W||1,4)),decoration:M.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:S});J=this.reverseTransformPt(this._searchPoint);K=J[0];J=J[1];for(const V of M.glyphs)if(K>V.xTopLeft&&K<V.xBottomRight&&J>-V.yBottomRight&&J<-V.yTopLeft){this._earlyReturn=
!0;break}}}_hitTestFill(M){let K=null;if(d.isExtent(M))K=[[[M.xmin,M.ymin],[M.xmin,M.ymax],[M.xmax,M.ymax],[M.xmax,M.ymin],[M.xmin,M.ymin]]];else if(d.isPolygon(M))K=M.rings;else if(d.isPolyline(M))K=M.paths;else return;M=this.reverseTransformPt(this._searchPoint);let J=0;for(var R of K){const Q=R.length;for(let W=1;W<Q;W++){const S=R[W-1],V=R[W];S[1]>M[1]!==V[1]>M[1]&&(0<(V[0]-S[0])*(M[1]-S[1])-(V[1]-S[1])*(M[0]-S[0])?J++:J--)}}0!==J&&(this._earlyReturn=!0);this._earlyReturn||(R=this.reverseTransformScalar(this._searchDistPoint)*
this.prevGeomUnitsPerPoint(),D(M,K,R)&&(this._earlyReturn=!0))}_hitTestStroke(M,K){let J=null;if(d.isExtent(M))J=[[[M.xmin,M.ymin],[M.xmin,M.ymax],[M.xmax,M.ymax],[M.xmax,M.ymin],[M.xmin,M.ymin]]];else if(d.isPolygon(M))J=M.rings;else if(d.isPolyline(M))J=M.paths;else return;M=this.reverseTransformPt(this._searchPoint);K=z.getNumericValue(K,r.defaultCIMValues.CIMSolidStroke.width)*this.geomUnitsPerPoint();const R=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();D(M,
J,K/2+R)&&(this._earlyReturn=!0)}}class O extends E{constructor(M,K,J,R){super(K,J);this._applyAdditionalRenderProps=R;this._colorSubstitutionHelper=new w;this._ctx=M}drawSolidFill(M,K){if(M){if(d.isPolygon(M))this._buildPath(M.rings,!0);else if(d.isPolyline(M))this._buildPath(M.paths,!0);else if(d.isExtent(M))this._buildPath(L(M).rings,!0);else if(d.isMultipoint(M))console.log("CanvasDrawHelper.drawSolidFill - No implementation!");else return;M=this._ctx;M.fillStyle="string"===typeof K?K:"rgba("+
Math.round(K[0])+","+Math.round(K[1])+","+Math.round(K[2])+","+(K[3]??255)/255+")";M.fill("evenodd")}}drawSolidStroke(M,K,J,R,Q,W){if(M&&K&&0!==J){if(d.isPolygon(M))this._buildPath(M.rings,!0);else if(d.isPolyline(M))this._buildPath(M.paths,!1);else if(d.isExtent(M))this._buildPath(L(M).rings,!0);else{console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");return}M=this._ctx;M.strokeStyle="string"===typeof K?K:"rgba("+Math.round(K[0])+","+Math.round(K[1])+","+Math.round(K[2])+","+(K[3]??
255)/255+")";M.lineWidth=Math.max(this.transformSize(J),.5);this._setCapStyle(R);this._setJoinStyle(Q);M.miterLimit=W;M.stroke()}}pushClipPath(M){this._ctx.save();if(d.isPolygon(M))this._buildPath(M.rings,!0);else if(d.isPolyline(M))this._buildPath(M.paths,!0);else if(d.isExtent(M))this._buildPath(L(M).rings,!0);else return;this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(M,K){const {colorSubstitutions:J,url:R,tintColor:Q}=M;M=z.getNumericValue(M.scaleX,1);var W=this._resourceManager.getResource(R);
if(null!=W){var S=W.width/W.height*K,V=K;K||(S=W.width,V=W.height);var T=z.isSVGImage(R)||"src"in W&&z.isSVGImage(W.src);K="getFrame"in W?u.getFirstFrame(W):W;J&&(K=this._colorSubstitutionHelper.applyColorSubstituition(K,J));this._applyAdditionalRenderProps&&!T&&Q&&(K=this._colorSubstitutionHelper.tintImageData(K,Q));W=this.transformPt([0,0]);var [Y,ha]=this.getTransformAngle();T=this.transformSize(1);var ba=this._ctx;ba.save();ba.setTransform({m11:M*T*Y,m12:M*T*ha,m21:-T*ha,m22:T*Y,m41:W[0],m42:W[1]});
ba.drawImage(K,-S/2,-V/2,S,V);ba.restore()}}drawText(M,K){if(K&&0!==K.length&&(this._textRasterizer||(this._textRasterizer=new y),M=F(M),M.size*=this.transformSize(h.px2pt(1)),K=this._textRasterizer.rasterizeText(K,M))){var {size:J,anchorX:R,anchorY:Q,canvas:W}=K;K=J[0]*(R+.5);M=J[1]*(Q-.5);var S=this._ctx,V=this.transformPt([0,0]),[T,Y]=this.getTransformAngle();S.save();S.setTransform({m11:1*T,m12:1*Y,m21:-1*Y,m22:1*T,m41:V[0]-1*K,m42:V[1]+1*M});S.drawImage(W,0,0);S.restore()}}drawPictureFill(M,
K){if(M){var {colorSubstitutions:J,height:R,offsetX:Q,offsetY:W,rotation:S,scaleX:V,tintColor:T,url:Y}=K;K=this._resourceManager.getResource(Y);if(null!=K){if(d.isPolygon(M))this._buildPath(M.rings,!0);else if(d.isPolyline(M))this._buildPath(M.paths,!0);else if(d.isExtent(M))this._buildPath(L(M).rings,!0);else if(d.isMultipoint(M))console.log("CanvasDrawHelper.drawPictureFill - No implementation!");else return;M=this._ctx;var ha=z.isSVGImage(Y)||"src"in K&&z.isSVGImage(K.src),ba="getFrame"in K?u.getFirstFrame(K):
K;J&&(ba=this._colorSubstitutionHelper.applyColorSubstituition(ba,J));if(this._applyAdditionalRenderProps){if(ha||T&&(ba=this._colorSubstitutionHelper.tintImageData(ba,T)),ha=M.createPattern(ba,"repeat"),ba=this.transformSize(1),S||=0,Q=Q?ba*Q:0,W=W?ba*W:0,R&&=ba*R,ba=R?R/K.height:1,K=V&&R?V*R/K.width:1,0!==S||1!==ba||1!==K||0!==Q||0!==W){const U=new DOMMatrix;U.rotateSelf(0,0,-S).translateSelf(Q,W).scaleSelf(K,ba,1);ha.setTransform(U)}}else ha=M.createPattern(ba,"repeat");M.save();M.fillStyle=ha;
M.fill("evenodd");M.restore()}}}drawPictureStroke(M,K){if(M){var {colorSubstitutions:J,capStyle:R,joinStyle:Q,miterLimit:W,tintColor:S,url:V,width:T}=K;K=this._resourceManager.getResource(V);if(null!=K){if(d.isPolygon(M))var Y=M.rings;else if(d.isPolyline(M))Y=M.paths;else if(d.isExtent(M))Y=L(M).rings;else{d.isMultipoint(M)&&console.log("CanvasDrawHelper.drawPictureStroke - No implementation!");return}T||(T=K.width);M=z.isSVGImage(V)||"src"in K&&z.isSVGImage(K.src);var ha="getFrame"in K?u.getFirstFrame(K):
K;J&&(ha=this._colorSubstitutionHelper.applyColorSubstituition(ha,J));this._applyAdditionalRenderProps&&(M||S&&(ha=this._colorSubstitutionHelper.tintImageData(ha,S)));K=Math.max(this.transformSize(h.pt2px(T)),.5);M=K/ha.width;var ba=this._ctx;ha=ba.createPattern(ha,"repeat-y");ba.save();this._setCapStyle(R);this._setJoinStyle(Q);void 0!==W&&(ba.miterLimit=W);ba.lineWidth=K;var U;for(let ia of Y){ia=l.clone(ia);var Z=U=void 0,ca=void 0;let ka=Z=void 0;Y=ia;for(var ea=Y[0],da=1;da<Y.length;)ka=Y[da][0]-
ea[0],Z=Y[da][1]-ea[1],Z=0!==ka?Z/ka:Math.PI/2,void 0!==ca&&1E-4>=Z-ca?(Y.splice(da-1,1),ea=U):(U=ea,ea=Y[da],da++),ca=Z;if(ia&&!(1>=ia.length))for(Y=this.transformPt(ia[0]),ca=1;ca<ia.length;ca++)U=this.transformPt(ia[ca]),ea=180/Math.PI*Math.atan2(U[1]-Y[1],U[0]-Y[0]),da=new DOMMatrix,da.translateSelf(0,Y[1]-K/2).scaleSelf(M,M,1).rotateSelf(0,0,90-ea),ha.setTransform(da),ba.strokeStyle=ha,ba.beginPath(),ba.moveTo(Y[0],Y[1]),ba.lineTo(U[0],U[1]),ba.stroke(),Y=U}ba.restore()}}}_buildPath(M,K){const J=
this._ctx;J.beginPath();if(M)for(const R of M)if(M=R?R.length:0,1<M){let Q=this.transformPt(R[0]);J.moveTo(Q[0],Q[1]);for(let W=1;W<M;W++)Q=this.transformPt(R[W]),J.lineTo(Q[0],Q[1]);K&&J.closePath()}}_setCapStyle(M){switch(M){case n.LineCapStyle.Butt:this._ctx.lineCap="butt";break;case n.LineCapStyle.Round:this._ctx.lineCap="round";break;case n.LineCapStyle.Square:this._ctx.lineCap="square"}}_setJoinStyle(M){switch(M){case n.LineJoinStyle.Bevel:this._ctx.lineJoin="bevel";break;case n.LineJoinStyle.Round:this._ctx.lineJoin=
"round";break;case n.LineJoinStyle.Miter:this._ctx.lineJoin="miter"}}}const L=M=>M?{spatialReference:M.spatialReference,rings:[[[M.xmin,M.ymin],[M.xmin,M.ymax],[M.xmax,M.ymax],[M.xmax,M.ymin],[M.xmin,M.ymin]]]}:null,P=(M,K,J)=>{switch(M){case "ExtraLeading":return 1+K/J;case "Multiple":return K;case "Exact":return K/J}};a.CIMSymbolDrawHelper=E;a.CanvasDrawHelper=O;a.EnvDrawHelper=G;a.HittestDrawHelper=I;a.Transformation=N;a.cDegToRad=H;a.lineGapType2LineHeight=P;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/core/fontUtils":function(){define(["exports","../config"],function(a,b){function q(g){if(!g)return"arial-unicode-ms";g=g.toLowerCase().split(" ").join("-");switch(g){case "serif":return"noto-serif";case "sans-serif":return"arial-unicode-ms";case "monospace":return"ubuntu-mono";case "fantasy":return"cabin-sketch";case "cursive":return"redressed";default:return g}}function l(g){const d=k(g)+h(g);return q(g.family)+(0<d.length?d:"-regular")}function p(g){const d=k(g)+h(g);
return(g.family||"arial-unicode-ms")+(0<d.length?d:"-regular")}function k(g){if(!g.weight)return"";switch(g.weight.toLowerCase()){case "bold":case "bolder":return"-bold"}return""}function h(g){if(!g.style)return"";switch(g.style.toLowerCase()){case "italic":case "oblique":return"-italic"}return""}const f=new Map,c=new Set;class e{constructor(g,d){this.fontFace=g;this.promise=d}}a.clearFonts=function(){const g=document.fonts;f.forEach(d=>{g.delete(d.fontFace)});f.clear();c.clear()};a.defaultFontFamily=
"arial-unicode-ms";a.getFontFamily=q;a.getFullyQualifiedFontName=l;a.isCachedFontFace=function(g){return c.has(g)};a.loadFont=async function(g){const d=p(g),t=l(g),w=f.get(d);if(w)return w.promise;const v=new FontFace(g.family,`url('${b.fontsUrl}/woff2/${t}.${"woff2"}') format('${"woff2"}')`,{style:g.style,weight:g.weight}),m=document.fonts;if(m.has(v)&&"loading"===v.status)return v.loaded;g=v.load().then(()=>{m.add(v);return v});f.set(d,new e(v,g));c.add(v);return g};Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/geometry/GeometryCursor":function(){define(["exports","../core/lang","./geometryCursorCollectUtils","./support/jsonUtils","../layers/graphics/OptimizedGeometry"],function(a,b,q,l,p){function k(d){if(l.isPolygon(d))d=[d.rings,"esriGeometryPolygon"];else if(l.isPolyline(d))d=[d.paths,"esriGeometryPolyline"];else if(l.isMultipoint(d))d=[[d.points],"esriGeometryMultipoint"];else if(l.isExtent(d))d=[[[[d.xmin,d.ymin],[d.xmin,d.ymax],[d.xmax,d.ymax],[d.xmax,d.ymin],[d.xmin,d.ymin]]],
"esriGeometryEnvelope"];else if(l.isPoint(d)){const t=[d.x,d.y];d.z&&t.push(d.z);d.m&&t.push(d.m);d=[[[t]],"esriGeometryPoint"]}else d=[[],"esriGeometryPolyline"];return d}class h{static fromOptimized(d,t,w=!1,v=!1,m=1){return(new f).initialize(d,t,w,v,m)}static fromJSON(d,t=!1,w=!1){const [v,m]=k(d);return(new c).initialize(v,m,t,w,1)}static fromOptimizedCIM(d,t,w=!1,v=!1,m=1){return(new e).initialize(d,t,w,v,m)}static fromJSONCIM(d,t=!1,w=!1,v=1){const [m,r]=k(d);return(new g).initialize(m,r,t,
w,v)}static fromFeatureSetReader(d){const t=d.readGeometryForDisplay();d=d.geometryType;return t&&d?this.fromOptimized(t,d):null}static fromFeatureSetReaderCIM(d){const t=d.readGeometryForDisplay();d=d.geometryType;return t&&d?this.fromOptimizedCIM(t,d):null}static createEmptyOptimized(d,t=!1,w=!1,v=1){return(new f).initialize(new p,d,t,w,v)}static createEmptyJSON(d,t=!1,w=!1){return(new c).initialize([],d,t,w,1)}static createEmptyOptimizedCIM(d,t=!1,w=!1,v=1){return(new e).initialize(new p,d,t,w,
v)}static createEmptyJSONCIM(d,t=!1,w=!1,v=1){return(new g).initialize([],d,t,w,v)}asJSON(){const d=q.collectMultipath(this);return"esriGeometryEnvelope"===this.geometryType?{xmin:d[0][0][0],ymin:d[0][0][1],xmax:d[0][2][0],ymax:d[0][2][1]}:"esriGeometryMultipoint"===this.geometryType?{points:d.flat()}:"esriGeometryPoint"===this.geometryType?{x:d[0][0][0],y:d[0][0][1]}:"esriGeometryPolygon"===this.geometryType?{rings:d}:{paths:d}}getCurrentRingArea(){if(3>this.pathSize)return 0;let d=0,t,w;this.seekPathStart();
if(!this.nextPoint())return 0;t=this.x;w=this.y;const v=t,m=w;for(;this.nextPoint();)d+=(t-this.x)*(w+this.y),t=this.x,w=this.y;return-.5*(d+(t-v)*(w+m))}invertY(){this.yFactor*=-1}}class f extends h{constructor(){super(...arguments);this._end=-1}initialize(d,t,w,v,m){this.hasZ=w;this.hasM=v;this.geometryType=t;this._stride=2+Number(w)+Number(v);this._geometry=d;this._pathIndex=-1;this._pathOffset=0;this._pointOffset=-this._stride;this._end=-1;this.yFactor=m;return this}reset(){this.initialize(this._geometry,
this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(d){if(0<=d&&d<this.totalSize){if(this._pathIndex<d)for(;this._pathIndex<d&&this.nextPath(););else if(this._pathIndex>d)for(;this._pathIndex>d&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(d){d=this._pathOffset+d*this._stride;return 0<=d&&d<this._end?(this._pointOffset=d,!0):!1}nextPoint(){return(this._pointOffset+=this._stride)<this._end}prevPoint(){return(this._pointOffset-=
this._stride)>=this._pathOffset}nextPath(){if(this.pathIndex>=this.totalSize-1)return!1;0<=this._pathIndex&&(this._pathOffset+=this._stride*this.pathSize);this._pathIndex++;this._pointOffset=this._pathOffset-this._stride;this._end=this._pointOffset+this._stride+this._stride*this.pathSize;return!0}prevPath(){if(0>=this.pathIndex)return!1;this._pathIndex--;this._end=this._pathOffset;this._pathOffset-=this._stride*this.pathSize;this._pointOffset=this._pathOffset-this._stride;return!0}pathLength(){const d=
this._end,t=this._stride,w=this._geometry.coords;let v=0;for(let m=this._pathOffset+t;m<d;m+=t){const r=w[m]-w[m-t],n=w[m+1]-w[m-t+1];v+=Math.sqrt(r*r+n*n)}return v}startPath(){this._geometry.lengths.push(0)}pushPath(d){this.startPath();this.pushPoints(d)}pushPoint(d){for(let t=0;t<this._stride;++t)this._geometry.coords.push(d[t]);this._geometry.lengths[this.totalSize-1]++}pushXY(d,t){this._geometry.coords.push(d,t);this._geometry.lengths[this.totalSize-1]++}pushPoints(d){for(const t of d)for(let w=
0;w<this._stride;++w)this._geometry.coords.push(t[w]);this._geometry.lengths[this.totalSize-1]+=d.length}pushCursor(d){d=d.asOptimized();this._geometry.coords.push(...d.coords);this._geometry.lengths.push(...d.lengths)}asOptimized(){const d=this._geometry.clone();if(1!==this.yFactor)for(let t=1;t<d.coords.length;t+=this._stride)d.coords[t]*=this.yFactor;"esriGeometryPoint"===this.geometryType&&(d.lengths.length=0);return d}isClosed(){const d=this._geometry.coords,t=this._pathOffset,w=this._end-this._stride;
for(let v=0;v<this._stride;v++)if(d[t+v]!==d[w+v])return!1;return!0}clone(){return(new f).initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor)}get totalPoints(){return this._geometry.isPoint?1:this._geometry.lengths.reduce((d,t)=>d+t)}get pathSize(){const {lengths:d}=this._geometry;return this._geometry.isPoint?1:0>this._pathIndex||this._pathIndex>d.length-1?0:d[this._pathIndex]}get totalSize(){return this._geometry.isPoint?1:this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(d){this._geometry.coords[this._pointOffset]=
d}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(d){this._geometry.coords[this._pointOffset+1]=this.yFactor*d}get z(){return this._geometry.coords[this._pointOffset+2]}set z(d){this._geometry.coords[this._pointOffset+2]=d}get m(){return this._geometry.coords[this._pointOffset+(this.hasZ?3:2)]}set m(d){this._geometry.coords[this._pointOffset+3]=d}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}}class c extends h{initialize(d,
t,w,v,m){this._paths=d;this.geometryType=t;this.hasZ=w;this.hasM=v;this._pathIndex=this._pointIndex=-1;this.yFactor=m;this._mIndex=this.hasZ?3:2;return this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(d){this._pathIndex=d;this._pointIndex=-1;return 0<=d&&d<this.totalSize?(this._currentPath=this._paths[d],!0):!1}seekPathStart(){this._pointIndex=-1}seekPathEnd(){this._pointIndex=this._currentPath.length}seekInPath(d){return 0<=d&&d<this._currentPath.length?(this._pointIndex=d,this._currentPoint=
this._currentPath[this._pointIndex],!0):!1}nextPoint(){this._currentPoint=this._currentPath[++this._pointIndex];return this._pointIndex<this._currentPath.length}prevPoint(){this._currentPoint=this._currentPath[--this._pointIndex];return 0<=this._pointIndex}nextPath(){this._pointIndex=-1;this._currentPath=this._paths[++this._pathIndex];return this._pathIndex<this.totalSize}prevPath(){return 0<this.pathIndex?(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0):!1}pathLength(){const d=
this._currentPath.length,t=this._currentPath;let w=0;for(let m=1;m<d;m++){var v=t[m-1];const r=t[m],n=r[0]-v[0];v=r[1]-v[1];w+=Math.sqrt(n*n+v*v)}return w}startPath(){this._paths.push([])}pushPath(d){this._paths.push(d)}pushPoint(d){this._paths[this.totalSize-1].push(d)}pushXY(d,t){this._paths[this.totalSize-1].push([d,t])}pushPoints(d){this._paths[this.totalSize-1].push(...d)}pushCursor(d){d=q.collectMultipath(d);for(const t of d)this.pushPath(t)}asOptimized(){const d=new p;if("esriGeometryPoint"===
this.geometryType)d.coords.push(...this._paths[0][0]),d.lengths.length=0;else for(const t of this._paths){for(const w of t)d.coords.push(w[0]),d.coords.push(w[1]*this.yFactor),this.hasZ&&d.coords.push(w[2]),this.hasM&&d.coords.push(w[this._mIndex]);d.lengths.push(t.length)}return d}isClosed(){const d=this._currentPath[0],t=this._currentPath[this._currentPath.length-1];for(let w=0;w<d.length;w++)if(d[w]!==t[w])return!1;return!0}clone(){return(new c).initialize(b.clone(this._paths),this.geometryType,
this.hasZ,this.hasM,this.yFactor)}get totalPoints(){return this._paths.map(d=>d.length).reduce((d,t)=>d+t)}get pathSize(){return 0>this._pathIndex||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(d){this._currentPoint[0]=d}get y(){return this.yFactor*this._currentPoint[1]}set y(d){this._currentPoint[1]=this.yFactor*d}get z(){return this._currentPoint[2]}set z(d){this._currentPoint[2]=d}get m(){return this._currentPoint[this._mIndex]}set m(d){this._currentPoint[this._mIndex]=
d}get pathIndex(){return this._pathIndex}}class e extends f{initialize(d,t,w,v,m){super.initialize(d,t,w,v,m);this._controlPoints||(this._controlPoints=this._controlPoints=Array(this.totalSize).fill(void 0).map(r=>new Set));return this}startPath(){super.startPath();this._controlPoints.push(new Set)}clone(){const d=(new e).initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);d._controlPoints=this._controlPoints;return d}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(d){this._controlPoints[this.pathIndex].add(d)}getControlPointAt(d){return this._controlPoints[this.pathIndex].has(d)}}
class g extends c{initialize(d,t,w,v,m){return super.initialize(d,t,w,v,m)}clone(){return(new g).initialize(b.clone(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][4]=1}getControlPoint(){return 1===this._paths[this.pathIndex][this._pointIndex][4]}setControlPointAt(d){this._paths[this.pathIndex][d][4]=1}getControlPointAt(d){return 1===this._paths[this.pathIndex][d][4]}}a.GeometryCursor=h;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/symbols/cim/CIMEffects":function(){define(["exports","../../geometry/GeometryCursor","../../geometry/support/TileClipper"],function(a,b,q){let l;class p{constructor(k){this._geometry=k}next(){const k=this._geometry;this._geometry=null;return k}}a.SimpleEffectCursor=p;a.clipCursorToTileExtent=function(k,h){l||=new q.TileClipper(0,0,0,1);var f="esriGeometryPolygon"===k.geometryType;const c=f?3:2;l.reset(f?q.GeometryType.Polygon:q.GeometryType.LineString);l.setPixelMargin(h+
1);l.setExtent(512);let e;for(;k.nextPath();)if(!(k.pathSize<c)){k.nextPoint();h=k.x;e=-k.y;for(l.moveTo(h,e);k.nextPoint();)h=k.x,e=-k.y,l.lineTo(h,e);f&&l.close()}if(f=l.result(!1)){k=b.GeometryCursor.createEmptyOptimizedCIM(k.geometryType);for(const g of f){k.startPath();for(const d of g)k.pushXY(d.x,-d.y)}k.reset();return k}return null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/TileClipper":function(){define(["exports"],function(a){a.GeometryType=void 0;
(function(c){c[c.Unknown=0]="Unknown";c[c.Point=1]="Point";c[c.LineString=2]="LineString";c[c.Polygon=3]="Polygon"})(a.GeometryType||(a.GeometryType={}));class b{constructor(c,e){this.x=c;this.y=e}clone(){return new b(this.x,this.y)}equals(c,e){return c===this.x&&e===this.y}isEqual(c){return c.x===this.x&&c.y===this.y}setCoords(c,e){this.x=c;this.y=e;return this}normalize(){var c=this.x;const e=this.y;c=Math.sqrt(c*c+e*e);this.x/=c;this.y/=c;return this}rightPerpendicular(){const c=this.x;this.x=
this.y;this.y=-c;return this}leftPerpendicular(){const c=this.x;this.x=-this.y;this.y=c;return this}move(c,e){this.x+=c;this.y+=e;return this}assign(c){this.x=c.x;this.y=c.y;return this}assignAdd(c,e){this.x=c.x+e.x;this.y=c.y+e.y;return this}assignSub(c,e){this.x=c.x-e.x;this.y=c.y-e.y;return this}rotate(c,e){const g=this.x,d=this.y;this.x=g*c-d*e;this.y=g*e+d*c;return this}scale(c){this.x*=c;this.y*=c;return this}length(){const c=this.x,e=this.y;return Math.sqrt(c*c+e*e)}sub(c){this.x-=c.x;this.y-=
c.y;return this}add(c){this.x+=c.x;this.y+=c.y;return this}static distance(c,e){const g=e.x-c.x;c=e.y-c.y;return Math.sqrt(g*g+c*c)}static add(c,e){return new b(c.x+e.x,c.y+e.y)}static sub(c,e){return new b(c.x-e.x,c.y-e.y)}}class q{constructor(c,e,g){this.ratio=c;this.x=e;this.y=g}}class l{constructor(c,e,g,d=8,t=8){this._lines=[];this._starts=[];this.validateTessellation=!0;this._pixelRatio=d;this._pixelMargin=t;this._tileSize=512*d;this._dz=c;this._yPos=e;this._xPos=g}setPixelMargin(c){c!==this._pixelMargin&&
(this._pixelMargin=c,this.setExtent(this._extent))}setExtent(c){this._extent=c;this._finalRatio=this._tileSize/c*(1<<this._dz);let e=this._pixelRatio*this._pixelMargin;e/=this._finalRatio;c>>=this._dz;e>c&&(e=c);this._margin=e;this._xmin=c*this._xPos-e;this._ymin=c*this._yPos-e;this._xmax=this._xmin+c+2*e;this._ymax=this._ymin+c+2*e}reset(c){this._type=c;this._lines=[];this._starts=[];this._line=null;this._start=0}moveTo(c,e){this._pushLine();this._prevIsIn=this._isIn(c,e);this._moveTo(c,e,this._prevIsIn);
this._prevPt=new b(c,e);this._firstPt=new b(c,e);this._dist=0}lineTo(c,e){const g=this._isIn(c,e),d=new b(c,e),t=b.distance(this._prevPt,d);if(g)if(this._prevIsIn)this._lineTo(c,e,!0);else{var w=this._prevPt;var v=d;c=this._intersect(v,w);this._start=this._dist+t*(1-this._r);this._lineTo(c.x,c.y,!0);this._lineTo(v.x,v.y,!0)}else if(this._prevIsIn)v=this._prevPt,w=d,c=this._intersect(v,w),this._lineTo(c.x,c.y,!0),this._lineTo(w.x,w.y,!1);else{const r=this._prevPt;if(!(r.x<=this._xmin&&d.x<=this._xmin||
r.x>=this._xmax&&d.x>=this._xmax||r.y<=this._ymin&&d.y<=this._ymin||r.y>=this._ymax&&d.y>=this._ymax)){c=[];if(r.x<this._xmin&&d.x>this._xmin||r.x>this._xmin&&d.x<this._xmin){e=(this._xmin-r.x)/(d.x-r.x);var m=r.y+e*(d.y-r.y);m<=this._ymin?v=!1:m>=this._ymax?v=!0:c.push(new q(e,this._xmin,m))}if(r.x<this._xmax&&d.x>this._xmax||r.x>this._xmax&&d.x<this._xmax)e=(this._xmax-r.x)/(d.x-r.x),m=r.y+e*(d.y-r.y),m<=this._ymin?v=!1:m>=this._ymax?v=!0:c.push(new q(e,this._xmax,m));if(r.y<this._ymin&&d.y>this._ymin||
r.y>this._ymin&&d.y<this._ymin)e=(this._ymin-r.y)/(d.y-r.y),m=r.x+e*(d.x-r.x),m<=this._xmin?w=!1:m>=this._xmax?w=!0:c.push(new q(e,m,this._ymin));if(r.y<this._ymax&&d.y>this._ymax||r.y>this._ymax&&d.y<this._ymax)e=(this._ymax-r.y)/(d.y-r.y),m=r.x+e*(d.x-r.x),m<=this._xmin?w=!1:m>=this._xmax?w=!0:c.push(new q(e,m,this._ymax));if(0===c.length)w?v?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):v?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,
!0);else if(1<c.length&&c[0].ratio>c[1].ratio)this._start=this._dist+t*c[1].ratio,this._lineTo(c[1].x,c[1].y,!0),this._lineTo(c[0].x,c[0].y,!0);else for(this._start=this._dist+t*c[0].ratio,w=0;w<c.length;w++)this._lineTo(c[w].x,c[w].y,!0)}this._lineTo(d.x,d.y,!1)}this._dist+=t;this._prevIsIn=g;this._prevPt=d}close(){if(2<this._line.length){var c=this._firstPt,e=this._prevPt;c.x===e.x&&c.y===e.y||this.lineTo(c.x,c.y);c=this._line;for(e=c.length;4<=e;)if(c[0].x===c[1].x&&c[0].x===c[e-2].x||c[0].y===
c[1].y&&c[0].y===c[e-2].y)c.pop(),c[0].x=c[e-2].x,c[0].y=c[e-2].y,--e;else break}}result(c=!0){this._pushLine();if(0===this._lines.length)return null;this._type===a.GeometryType.Polygon&&c&&h.simplify(this._tileSize,this._margin*this._finalRatio,this._lines);return this._lines}resultWithStarts(){if(this._type!==a.GeometryType.LineString)throw Error("Only valid for lines");this._pushLine();const c=this._lines,e=c.length;if(0===e)return null;const g=[];for(let d=0;d<e;d++)g.push({line:c[d],start:this._starts[d]||
0});return g}_isIn(c,e){return c>=this._xmin&&c<=this._xmax&&e>=this._ymin&&e<=this._ymax}_intersect(c,e){let g,d,t;if(e.x>=this._xmin&&e.x<=this._xmax)d=e.y<=this._ymin?this._ymin:this._ymax,t=(d-c.y)/(e.y-c.y),g=c.x+t*(e.x-c.x);else if(e.y>=this._ymin&&e.y<=this._ymax)g=e.x<=this._xmin?this._xmin:this._xmax,t=(g-c.x)/(e.x-c.x),d=c.y+t*(e.y-c.y);else{d=e.y<=this._ymin?this._ymin:this._ymax;g=e.x<=this._xmin?this._xmin:this._xmax;const w=(g-c.x)/(e.x-c.x),v=(d-c.y)/(e.y-c.y);w<v?(t=w,d=c.y+w*(e.y-
c.y)):(t=v,g=c.x+v*(e.x-c.x))}this._r=t;return new b(g,d)}_pushLine(){this._line&&(this._type===a.GeometryType.Point?0<this._line.length&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===a.GeometryType.LineString?1<this._line.length&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===a.GeometryType.Polygon&&3<this._line.length&&(this._lines.push(this._line),this._starts.push(this._start)));this._line=[];this._start=0}_moveTo(c,e,g){this._type!==a.GeometryType.Polygon?
g&&(c=Math.round((c-(this._xmin+this._margin))*this._finalRatio),e=Math.round((e-(this._ymin+this._margin))*this._finalRatio),this._line.push(new b(c,e))):(g||(c<this._xmin&&(c=this._xmin),c>this._xmax&&(c=this._xmax),e<this._ymin&&(e=this._ymin),e>this._ymax&&(e=this._ymax)),c=Math.round((c-(this._xmin+this._margin))*this._finalRatio),e=Math.round((e-(this._ymin+this._margin))*this._finalRatio),this._line.push(new b(c,e)),this._isV=this._isH=!1)}_lineTo(c,e,g){if(this._type!==a.GeometryType.Polygon)if(g){c=
Math.round((c-(this._xmin+this._margin))*this._finalRatio);e=Math.round((e-(this._ymin+this._margin))*this._finalRatio);if(0<this._line.length&&(g=this._line[this._line.length-1],g.equals(c,e)))return;this._line.push(new b(c,e))}else this._line&&0<this._line.length&&this._pushLine();else if(g||(c<this._xmin&&(c=this._xmin),c>this._xmax&&(c=this._xmax),e<this._ymin&&(e=this._ymin),e>this._ymax&&(e=this._ymax)),c=Math.round((c-(this._xmin+this._margin))*this._finalRatio),e=Math.round((e-(this._ymin+
this._margin))*this._finalRatio),this._line&&0<this._line.length){g=this._line[this._line.length-1];const d=g.x===c,t=g.y===e;d&&t||(this._isH&&d?(g.x=c,g.y=e,g=this._line[this._line.length-2],g.x===c&&g.y===e?(this._line.pop(),1>=this._line.length?this._isV=this._isH=!1:(g=this._line[this._line.length-2],this._isH=g.x===c,this._isV=g.y===e)):(this._isH=g.x===c,this._isV=g.y===e)):this._isV&&t?(g.x=c,g.y=e,g=this._line[this._line.length-2],g.x===c&&g.y===e?(this._line.pop(),1>=this._line.length?this._isV=
this._isH=!1:(g=this._line[this._line.length-2],this._isH=g.x===c,this._isV=g.y===e)):(this._isH=g.x===c,this._isV=g.y===e)):(this._line.push(new b(c,e)),this._isH=d,this._isV=t))}else this._line.push(new b(c,e))}}class p{setExtent(c){this._ratio=4096===c?1:4096/c}get validateTessellation(){return 1>this._ratio}reset(c){this._lines=[];this._line=null}moveTo(c,e){this._line&&this._lines.push(this._line);this._line=[];const g=this._ratio;this._line.push(new b(c*g,e*g))}lineTo(c,e){const g=this._ratio;
this._line.push(new b(c*g,e*g))}close(){const c=this._line;c&&!c[0].isEqual(c[c.length-1])&&c.push(c[0])}result(){this._line&&this._lines.push(this._line);return 0===this._lines.length?null:this._lines}}var k;(function(c){c[c.sideLeft=0]="sideLeft";c[c.sideRight=1]="sideRight";c[c.sideTop=2]="sideTop";c[c.sideBottom=3]="sideBottom"})(k||={});class h{static simplify(c,e,g){if(g){var d=-e,t=c+e,w=-e,v=c+e;c=[];e=[];var m=g.length;for(let r=0;r<m;++r){const n=g[r];if(!n||2>n.length)continue;let u=n[0],
x;const y=n.length;for(let z=1;z<y;++z)x=n[z],u.x===x.x&&(u.x<=d&&(u.y>x.y?(c.push(r),c.push(z),c.push(k.sideLeft),c.push(-1)):(e.push(r),e.push(z),e.push(k.sideLeft),e.push(-1))),u.x>=t&&(u.y<x.y?(c.push(r),c.push(z),c.push(k.sideRight),c.push(-1)):(e.push(r),e.push(z),e.push(k.sideRight),e.push(-1)))),u.y===x.y&&(u.y<=w&&(u.x<x.x?(c.push(r),c.push(z),c.push(k.sideTop),c.push(-1)):(e.push(r),e.push(z),e.push(k.sideTop),e.push(-1))),u.y>=v&&(u.x>x.x?(c.push(r),c.push(z),c.push(k.sideBottom),c.push(-1)):
(e.push(r),e.push(z),e.push(k.sideBottom),e.push(-1)))),u=x}0!==c.length&&0!==e.length&&(h.fillParent(g,e,c),h.fillParent(g,c,e),d=[],h.calcDeltas(d,e,c),h.calcDeltas(d,c,e),h.addDeltas(d,g))}}static fillParent(c,e,g){const d=g.length,t=e.length;for(let n=0;n<t;n+=4){var w=e[n],v=e[n+1];const u=e[n+2],x=c[w][v-1];w=c[w][v];v=8092;let y=-1;for(let z=0;z<d;z+=4){if(g[z+2]!==u)continue;var m=g[z];const A=g[z+1];var r=c[m][A-1];m=c[m][A];switch(u){case k.sideLeft:case k.sideRight:f(x.y,r.y,m.y)&&f(w.y,
r.y,m.y)&&(r=Math.abs(m.y-r.y),r<v&&(v=r,y=z));break;case k.sideTop:case k.sideBottom:f(x.x,r.x,m.x)&&f(w.x,r.x,m.x)&&(r=Math.abs(m.x-r.x),r<v&&(v=r,y=z))}}e[n+3]=y}}static calcDeltas(c,e,g){const d=e.length;for(let t=0;t<d;t+=4){const w=h.calcDelta(t,e,g,[]);c.push(e[t]);c.push(e[t+1]);c.push(e[t+2]);c.push(w)}}static calcDelta(c,e,g,d){c=e[c+3];if(-1===c)return 0;const t=d.length;if(1<t&&d[t-2]===c)return 0;d.push(c);return h.calcDelta(c,g,e,d)+1}static addDeltas(c,e){const g=c.length;let d=0;for(var t=
0;t<g;t+=4){var w=c[t+3];w>d&&(d=w)}for(t=0;t<g;t+=4){w=e[c[t]];const v=c[t+1],m=d-c[t+3];switch(c[t+2]){case k.sideLeft:w[v-1].x-=m;w[v].x-=m;1===v&&(w[w.length-1].x-=m);v===w.length-1&&(w[0].x-=m);break;case k.sideRight:w[v-1].x+=m;w[v].x+=m;1===v&&(w[w.length-1].x+=m);v===w.length-1&&(w[0].x+=m);break;case k.sideTop:w[v-1].y-=m;w[v].y-=m;1===v&&(w[w.length-1].y-=m);v===w.length-1&&(w[0].y-=m);break;case k.sideBottom:w[v-1].y+=m,w[v].y+=m,1===v&&(w[w.length-1].y+=m),v===w.length-1&&(w[0].y+=m)}}}}
const f=(c,e,g)=>c>=e&&c<=g||c>=g&&c<=e;a.Point=b;a.SimpleBuilder=p;a.TileClipper=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/CIMImageColorSubstitutionHelper":function(){define(function(){class a{applyColorSubstituition(b,q){if(!q)return b;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const {width:l,height:p}=b,k=this._rasterizationCanvas,h=k.getContext("2d",{willReadFrequently:!0});b!==k&&(k.width=l,k.height=p,h.drawImage(b,
0,0,l,p));b=h.getImageData(0,0,l,p).data;if(q)for(var f of q)if(f&&f.oldColor&&4===f.oldColor.length&&f.newColor&&4===f.newColor.length){const [c,e,g,d]=f.oldColor,[t,w,v,m]=f.newColor;if(c!==t||e!==w||g!==v||d!==m)for(q=0;q<b.length;q+=4)c===b[q]&&e===b[q+1]&&g===b[q+2]&&d===b[q+3]&&(b[q]=t,b[q+1]=w,b[q+2]=v,b[q+3]=m)}f=new ImageData(b,l,p);h.putImageData(f,0,0);return k}tintImageData(b,q){if(!q||4>q.length)return b;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));
const {width:l,height:p}=b,k=this._rasterizationCanvas,h=k.getContext("2d",{willReadFrequently:!0});b!==k&&(k.width=l,k.height=p,h.drawImage(b,0,0,l,p));b=h.getImageData(0,0,l,p);b=new Uint8Array(b.data);q=[q[0]/255,q[1]/255,q[2]/255,q[3]/255];for(let f=0;f<b.length;f+=4)b[f]*=q[0],b[f+1]*=q[1],b[f+2]*=q[2],b[f+3]*=q[3];q=new ImageData(new Uint8ClampedArray(b.buffer),l,p);h.putImageData(q,0,0);return k}}return a})},"esri/symbols/cim/CIMOperators":function(){define("exports ./effects/EffectAddControlPoints ./effects/EffectArrow ./effects/EffectBuffer ./effects/EffectControlMeasureLine ./effects/EffectCut ./effects/EffectDashes ./effects/EffectDonut ./effects/EffectJog ./effects/EffectMove ./effects/EffectOffset ./effects/EffectReverse ./effects/EffectRotate ./effects/EffectScale ./effects/EffectWave ./placements/PlacementAlongLineSameSize ./placements/PlacementAtExtremities ./placements/PlacementAtRatioPositions ./placements/PlacementInsidePolygon ./placements/PlacementOnLine ./placements/PlacementOnVertices ./placements/PlacementPolygonCenter".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){a.getEffectOperator=function(A){if(!A)return null;switch(A.type){case "CIMGeometricEffectAddControlPoints":return b.EffectAddControlPoints.local();case "CIMGeometricEffectArrow":return q.EffectArrow.local();case "CIMGeometricEffectBuffer":return l.EffectBuffer.local();case "CIMGeometricEffectControlMeasureLine":return p.EffectControlMeasureLine.local();case "CIMGeometricEffectCut":return k.EffectCut.local();case "CIMGeometricEffectDashes":return h.EffectDashes.local();
case "CIMGeometricEffectDonut":return f.EffectDonut.local();case "CIMGeometricEffectJog":return c.EffectJog.local();case "CIMGeometricEffectMove":return e.EffectMove.local();case "CIMGeometricEffectOffset":return g.EffectOffset.local();case "CIMGeometricEffectReverse":return d.EffectReverse.local();case "CIMGeometricEffectRotate":return t.EffectRotate.local();case "CIMGeometricEffectScale":return w.EffectScale.local();case "CIMGeometricEffectWave":return v.EffectWave.local()}return null};a.getPlacementOperator=
function(A){if(!A)return null;switch(A.type){case "CIMMarkerPlacementAlongLineSameSize":return m.PlacementAlongLineSameSize.local();case "CIMMarkerPlacementAtExtremities":return r.PlacementAtExtremities.local();case "CIMMarkerPlacementAtRatioPositions":return n.PlacementAtRatioPositions.local();case "CIMMarkerPlacementInsidePolygon":return u.PlacementInsidePolygon.local();case "CIMMarkerPlacementOnLine":return x.PlacementOnLine.local();case "CIMMarkerPlacementOnVertices":return y.PlacementOnVertices.local();
case "CIMMarkerPlacementPolygonCenter":return z.PlacementPolygonCenter.local()}return null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectAddControlPoints":function(){define(["exports"],function(a){class b{static local(){null===b.instance&&(b.instance=new b);return b.instance}execute(l,p,k,h,f){return new q(l,p,k)}}b.instance=null;class q{constructor(l,p,k){this._inputGeometries=l;this._angleTolerance=void 0!==p.angleTolerance?p.angleTolerance:120;
this._maxCosAngle=Math.cos((1-Math.abs(this._angleTolerance)/180)*Math.PI)}next(){let l=this._inputGeometries.next();for(;l;){if("esriGeometryPolygon"===l.geometryType)this._isClosed=!0;else if("esriGeometryPolyline"===l.geometryType)this._isClosed=!1;else if("esriGeometryEnvelope"===l.geometryType){if(this._maxCosAngle)return l;this._isClosed=!0}else{l=this._inputGeometries.next();continue}for(;l.nextPath();)this._processPath(l);l.reset();return l}return null}_processPath(l){if(l.nextPoint()){const p=
l.x,k=l.y;let h=p,f=k,c=l.pathSize,e=0,g=0,d=0,t=0,w=0,v=0;this._isClosed&&++c;for(let m=1;l.nextPoint()||m<c;++m){let r,n;this._isClosed&&m===c-1?(r=p,n=k):(r=l.x,n=l.y);const u=r-h,x=n-f,y=Math.sqrt(u*u+x*x);1<m&&0<y&&0<d&&(e*u+g*x)/y/d<=this._maxCosAngle&&l.setControlPointAt(m-1);1===m&&(t=u,w=x,v=y);0<y&&(h=r,f=n,e=u,g=x,d=y)}this._isClosed&&0<d&&0<v&&(e*t+g*w)/v/d<=this._maxCosAngle&&l.setControlPointAt(0)}}}a.EffectAddControlPoints=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/symbols/cim/effects/EffectArrow":function(){define("exports ../../../geometry/GeometryCursor ../../../geometry/geometryCursorCollectUtils ../CIMCursor ../CurveHelper ../enums".split(" "),function(a,b,q,l,p,k){const h=k.GeometricEffectArrowType.OpenEnded;class f{static local(){null===f.instance&&(f.instance=new f);return f.instance}execute(e,g,d,t,w){return new c(e,g,d)}}f.instance=null;class c extends l.PathEffectCursor{constructor(e,g,d){super(e,!1,!0);this._curveHelper=new p.CurveHelper;this._width=
(void 0!==g.width?g.width:5)*d;this._arrowType=void 0!==g.geometricEffectArrowType?g.geometricEffectArrowType:void 0!==g.arrowType?g.arrowType:h;this._offsetFlattenError=p.pixelTolerance*d}processPath(e){const g=b.GeometryCursor.createEmptyOptimizedCIM(e.geometryType);switch(this._arrowType){default:this._constructSimpleArrow(g,e,!0);break;case k.GeometricEffectArrowType.Block:this._constructSimpleArrow(g,e,!1);break;case k.GeometricEffectArrowType.Crossed:this._constructCrossedArrow(g,e)}return g}_constructSimpleArrow(e,
g,d){var t=g.pathLength(),w=this._width;t<2*w&&(w=t/2);var v=this._curveHelper.getSubCurve(g,0,t-w);if(v&&v.nextPath()&&(v.seekPathStart(),t=w/2,!this._curveHelper.isEmpty(v)&&(v=q.collectPath(v),w=this._constructOffset(v,-t)))&&(v=this._constructOffset(v,t))){var m=this._constructArrowBasePoint(w,-t/2);m&&(t=this._constructArrowBasePoint(v,t/2))&&(g.seekInPath(g.pathSize-1),g=[g.x,g.y],e.pushPath(v),e.nextPath(),e.nextPoint(),e.setControlPoint(),e.pushPoint(t),e.nextPoint(),e.setControlPoint(),e.pushPoint(g),
e.nextPoint(),e.setControlPoint(),e.pushPoint(m),e.nextPoint(),e.setControlPoint(),e.pushPoints(w.reverse()),e.setControlPoint(),d||(e.setControlPointAt(0),e.setControlPointAt(e.pathSize-1),e.pushPoint(v[0])),e.reset())}}_constructCrossedArrow(e,g){var d=g.pathLength(),t=this._width;d<3.732050807568877*t&&(t=d/3.732050807568877);g.seekPathStart();var w=this._curveHelper.getSubCurve(g,0,d-2.732050807568877*t);if(w){w.nextPath();var v=t/2;if(!this._curveHelper.isEmpty(w)){var m=q.collectPath(w);if(w=
this._constructOffset(m,v))if(m=this._constructOffset(m,-v))if(d=this._curveHelper.getSubCurve(g,0,d-t))if(d.nextPath(),!this._curveHelper.isEmpty(d)&&(d=q.collectPath(d),t=this._constructOffset(d,v))){var r=this._constructOffset(d,-v);if(r&&(d=t[t.length-1],t=this._constructArrowBasePoint(t,v/2))){var n=r[r.length-1];if(v=this._constructArrowBasePoint(r,-v/2))g.seekInPath(g.pathSize-1),g=[g.x,g.y],e.pushPath(w),e.nextPath(),e.nextPoint(),e.setControlPoint(),e.pushPoint(n),e.nextPoint(),e.setControlPoint(),
e.pushPoint(v),e.nextPoint(),e.setControlPoint(),e.pushPoint(g),e.nextPoint(),e.setControlPoint(),e.pushPoint(t),e.nextPoint(),e.setControlPoint(),e.pushPoint(d),e.nextPoint(),e.setControlPoint(),e.pushPoints(m.reverse()),e.nextPoint(),e.setControlPoint(),e.reset()}}}}}_constructOffset(e,g){return this._curveHelper.offset(e,g,k.GeometricEffectOffsetMethod.Rounded,4,this._offsetFlattenError)}_constructArrowBasePoint(e,g){if(!e||2>e.length)return null;var d=e[e.length-2];e=e[e.length-1];d=[e[0]-d[0],
e[1]-d[1]];this._curveHelper.normalize(d);return[e[0]+d[1]*g,e[1]-d[0]*g]}}a.EffectArrow=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/CIMCursor":function(){define(["exports","./CIMEffects","./CIMPlacements"],function(a,b,q){class l{constructor(k,h=!0,f=!0,c=0){this.isClosed=!1;this.geometryCursor=null;this.geometryCursor=!h&&"esriGeometryPolygon"===k.geometryType||!f&&"esriGeometryPolyline"===k.geometryType?null:k;this.geomUnitsPerPoint=c;this.iteratePath=this.iterateMultiPath=
!1;this.internalPlacement=new q.Placement}next(){if(!this.geometryCursor)return null;const k=this.processMultiPath(this.geometryCursor);this.iterateMultiPath&&k||(this.geometryCursor=null);return k}processMultiPath(k){for(;this.iteratePath||k.pathIndex<k.totalSize-1;){this.iteratePath||k.nextPath();this.iterateMultiPath=!0;const h=this.processPath(k);if(h)return h}this.iterateMultiPath=!1;return null}}class p{constructor(k,h,f,c=0){this.isClosed=!1;this._tileKey=null;this.inputGeometries=k;this.acceptPolygon=
h;this.acceptPolyline=f;this.geomUnitsPerPoint=c;this.iteratePath=!1;this.multiPathCursor=null}next(){for(;;){if(!this.multiPathCursor){for(var k=this.inputGeometries.next();k&&!(this.isClosed=this.acceptPolygon&&"esriGeometryPolygon"===k.geometryType||"esriGeometryEnvelope"===k.geometryType,this.multiPathCursor=k);)k=this.inputGeometries.next();if(!this.multiPathCursor)return null;this._tileKey&&this.isClippingRequired(this.multiPathCursor)&&(this.multiPathCursor.reset(),this.multiPathCursor=b.clipCursorToTileExtent(this.multiPathCursor,
256))}for(;this.iteratePath||this.multiPathCursor.nextPath();)if(this.multiPathCursor.seekPathStart(),k=this.processPath(this.multiPathCursor))return k;this.multiPathCursor=null}}isClippingRequired(k){return!1}}a.PathEffectCursor=p;a.PathTransformationCursor=l;a.getId=function(k){return k[4]};a.setId=function(k,h){k[4]=h};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/CurveHelper":function(){define(["exports","../../geometry/GeometryCursor","./enums"],function(a,
b,q){class l{constructor(p,k){}isEmpty(p){if(!p.nextPoint())return!0;let k,h,f,c;k=p.x;for(h=p.y;p.nextPoint();k=h,h=c)if(f=p.x,c=p.y,f!==k||c!==h)return p.seekPathStart(),!1;p.seekPathStart();return!0}normalize(p){const k=Math.sqrt(p[0]*p[0]+p[1]*p[1]);0!==k&&(p[0]/=k,p[1]/=k)}getLength(p,k,h,f){p=h-p;k=f-k;return Math.sqrt(p*p+k*k)}getSegLength(p){const [[k,h],[f,c]]=p;return this.getLength(k,h,f,c)}getCoord2D(p,k,h,f,c){return[p+(h-p)*c,k+(f-k)*c]}getSegCoord2D(p,k){const [[h,f],[c,e]]=p;return this.getCoord2D(h,
f,c,e,k)}getAngle(p,k,h,f,c){return Math.atan2(f-k,h-p)}getAngleCS(p,k,h,f,c){p=h-p;k=f-k;f=Math.sqrt(p*p+k*k);return 0<f?[p/f,k/f]:[1,0]}getSegAngleCS(p,k){const [[h,f],[c,e]]=p;return this.getAngleCS(h,f,c,e,k)}cut(p,k,h,f,c,e){c=0>=c?[p,k]:this.getCoord2D(p,k,h,f,c);p=1<=e?[h,f]:this.getCoord2D(p,k,h,f,e);return[c,p]}getSubCurve(p,k,h){const f=b.GeometryCursor.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(f,p,k,h)?f:null}appendSubCurve(p,k,h,f){p.startPath();k.seekPathStart();
let c=0;var e=!0;if(!k.nextPoint())return!1;var g=k.x;let d=k.y;for(;k.nextPoint();){const t=this.getLength(g,d,k.x,k.y);if(0!==t){if(e){if(c+t>h){const w=(h-c)/t;let v=1;e=!1;c+t>=f&&(v=(f-c)/t,e=!0);(g=this.cut(g,d,k.x,k.y,w,v))&&p.pushPoints(g);if(e)break;e=!1}}else{if(c+t>f){(k=this.cut(g,d,k.x,k.y,0,(f-c)/t))&&p.pushPoint(k[1]);break}p.pushXY(k.x,k.y)}c+=t}g=k.x;d=k.y}return!0}getCIMPointAlong(p,k){if(!p.nextPoint())return null;let h=0,f,c,e,g;f=p.x;for(c=p.y;p.nextPoint();f=e,c=g){e=p.x;g=p.y;
const d=this.getLength(f,c,e,g);if(0!==d){if(h+d>k)return this.getCoord2D(f,c,e,g,(k-h)/d);h+=d}}return null}offset(p,k,h,f,c){if(!p||2>p.length)return null;var e=0,g=p[e++];for(c=e;e<p.length;){var d=p[e];if(d[0]!==g[0]||d[1]!==g[1])e!==c&&(p[c]=p[e]),g=p[c++];e++}(e=p[0][0]===p[c-1][0]&&p[0][1]===p[c-1][1])&&--c;if(c<(e?3:2))return null;d=[];g=e?p[c-1]:null;let t=p[0];for(let n=0;n<c;n++){const u=n===c-1?e?p[0]:null:p[n+1];if(g)if(u){var w=[u[0]-t[0],u[1]-t[1]];this.normalize(w);var v=[t[0]-g[0],
t[1]-g[1]];this.normalize(v);var m=v[0]*w[1]-v[1]*w[0],r=v[0]*w[0]+v[1]*w[1];if(0===m&&1===r){t=u;continue}if(0<=m===0>=k)1>r&&(w=[w[0]-v[0],w[1]-v[1]],this.normalize(w),v=Math.sqrt((1+r)/2),v>1/f&&(v=-Math.abs(k)/v,d.push([t[0]-w[0]*v,t[1]-w[1]*v])));else switch(h){case q.GeometricEffectOffsetMethod.Mitered:if(g=Math.sqrt((1+r)/2),0<g&&1/g<f){w=[w[0]-v[0],w[1]-v[1]];this.normalize(w);v=Math.abs(k)/g;d.push([t[0]-w[0]*v,t[1]-w[1]*v]);break}case q.GeometricEffectOffsetMethod.Bevelled:d.push([t[0]+
v[1]*k,t[1]-v[0]*k]);d.push([t[0]+w[1]*k,t[1]-w[0]*k]);break;case q.GeometricEffectOffsetMethod.Rounded:if(1>r){d.push([t[0]+v[1]*k,t[1]-v[0]*k]);g=Math.floor(2.5*(1-r));if(0<g){m=r=1/g;for(let x=1;x<g;x++,m+=r){const y=[v[1]*(1-m)+w[1]*m,-v[0]*(1-m)-w[0]*m];this.normalize(y);d.push([t[0]+y[0]*k,t[1]+y[1]*k])}}d.push([t[0]+w[1]*k,t[1]-w[0]*k])}break;default:0>m?(d.push([t[0]+(v[1]+v[0])*k,t[1]+(v[1]-v[0])*k]),d.push([t[0]+(w[1]-w[0])*k,t[1]-(w[0]+w[1])*k])):(g=Math.sqrt((1+Math.abs(r))/2),w=[w[0]-
v[0],w[1]-v[1]],this.normalize(w),v=k/g,d.push([t[0]-w[0]*v,t[1]-w[1]*v]))}}else w=[t[0]-g[0],t[1]-g[1]],this.normalize(w),d.push([t[0]+w[1]*k,t[1]-w[0]*k]);else w=[u[0]-t[0],u[1]-t[1]],this.normalize(w),d.push([t[0]+w[1]*k,t[1]-w[0]*k]);g=t;t=u}if(d.length<(e?3:2))return null;e&&d.push([d[0][0],d[0][1]]);return d}}a.CurveHelper=l;a.pixelTolerance=.03;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/enums":function(){define(["exports"],function(a){a.CapType=void 0;
(function(b){b[b.BUTT=0]="BUTT";b[b.ROUND=1]="ROUND";b[b.SQUARE=2]="SQUARE";b[b.UNKNOWN=4]="UNKNOWN"})(a.CapType||(a.CapType={}));a.JoinType=void 0;(function(b){b[b.BEVEL=0]="BEVEL";b[b.ROUND=1]="ROUND";b[b.MITER=2]="MITER";b[b.UNKNOWN=4]="UNKNOWN"})(a.JoinType||(a.JoinType={}));a.Alignment=void 0;(function(b){b[b.SCREEN=0]="SCREEN";b[b.MAP=1]="MAP"})(a.Alignment||(a.Alignment={}));a.ExternalColorMixMode=void 0;(function(b){b[b.Tint=0]="Tint";b[b.Ignore=1]="Ignore";b[b.Multiply=99]="Multiply"})(a.ExternalColorMixMode||
(a.ExternalColorMixMode={}));a.ExtremityPlacement=void 0;(function(b){b.Both="Both";b.JustBegin="JustBegin";b.JustEnd="JustEnd";b.None="None"})(a.ExtremityPlacement||(a.ExtremityPlacement={}));a.FillMode=void 0;(function(b){b[b.Mosaic=0]="Mosaic";b[b.Centered=1]="Centered"})(a.FillMode||(a.FillMode={}));a.FontEffects=void 0;(function(b){b[b.Normal=0]="Normal";b[b.Superscript=1]="Superscript";b[b.Subscript=2]="Subscript"})(a.FontEffects||(a.FontEffects={}));a.FontEncoding=void 0;(function(b){b[b.MSSymbol=
0]="MSSymbol";b[b.Unicode=1]="Unicode"})(a.FontEncoding||(a.FontEncoding={}));a.FontType=void 0;(function(b){b[b.Unspecified=0]="Unspecified";b[b.TrueType=1]="TrueType";b[b.PSOpenType=2]="PSOpenType";b[b.TTOpenType=3]="TTOpenType";b[b.Type1=4]="Type1"})(a.FontType||(a.FontType={}));a.AngleAlignment=void 0;(function(b){b[b.Display=0]="Display";b[b.Map=1]="Map"})(a.AngleAlignment||(a.AngleAlignment={}));a.AnimatedSymbolRepeatType=void 0;(function(b){b.None="None";b.Loop="Loop";b.Oscillate="Oscillate"})(a.AnimatedSymbolRepeatType||
(a.AnimatedSymbolRepeatType={}));a.DominantSizeAxis=void 0;(function(b){b[b.Z=0]="Z";b[b.X=1]="X";b[b.Y=2]="Y"})(a.DominantSizeAxis||(a.DominantSizeAxis={}));a.RotationOrder=void 0;(function(b){b[b.XYZ=0]="XYZ";b[b.ZXY=1]="ZXY";b[b.YXZ=2]="YXZ"})(a.RotationOrder||(a.RotationOrder={}));a.BalloonCalloutStyle=void 0;(function(b){b[b.Rectangle=0]="Rectangle";b[b.RoundedRectangle=1]="RoundedRectangle";b[b.Oval=2]="Oval"})(a.BalloonCalloutStyle||(a.BalloonCalloutStyle={}));a.BlendingMode=void 0;(function(b){b[b.None=
0]="None";b[b.Alpha=1]="Alpha";b[b.Screen=2]="Screen";b[b.Multiply=3]="Multiply";b[b.Add=4]="Add"})(a.BlendingMode||(a.BlendingMode={}));a.BlockProgression=void 0;(function(b){b[b.TTB=0]="TTB";b[b.RTL=1]="RTL";b[b.BTT=2]="BTT"})(a.BlockProgression||(a.BlockProgression={}));a.BillBoardMode=void 0;(function(b){b[b.None=0]="None";b[b.SignPost=1]="SignPost";b[b.FaceNearPlane=2]="FaceNearPlane"})(a.BillBoardMode||(a.BillBoardMode={}));a.CGAAttributeType=void 0;(function(b){b[b.Float=0]="Float";b[b.String=
1]="String";b[b.Boolean=2]="Boolean"})(a.CGAAttributeType||(a.CGAAttributeType={}));a.ClippingType=void 0;(function(b){b[b.Intersect=0]="Intersect";b[b.Subtract=1]="Subtract"})(a.ClippingType||(a.ClippingType={}));a.GeometricEffectArrowType=void 0;(function(b){b.OpenEnded="OpenEnded";b.Block="Block";b.Crossed="Crossed"})(a.GeometricEffectArrowType||(a.GeometricEffectArrowType={}));a.GeometricEffectControlMeasureLineRule=void 0;(function(b){b.FullGeometry="FullGeometry";b.PerpendicularFromFirstSegment=
"PerpendicularFromFirstSegment";b.ReversedFirstSegment="ReversedFirstSegment";b.PerpendicularToSecondSegment="PerpendicularToSecondSegment";b.SecondSegmentWithTicks="SecondSegmentWithTicks";b.DoublePerpendicular="DoublePerpendicular";b.OppositeToFirstSegment="OppositeToFirstSegment";b.TriplePerpendicular="TriplePerpendicular";b.HalfCircleFirstSegment="HalfCircleFirstSegment";b.HalfCircleSecondSegment="HalfCircleSecondSegment";b.HalfCircleExtended="HalfCircleExtended";b.OpenCircle="OpenCircle";b.CoverageEdgesWithTicks=
"CoverageEdgesWithTicks";b.GapExtentWithDoubleTicks="GapExtentWithDoubleTicks";b.GapExtentMidline="GapExtentMidline";b.Chevron="Chevron";b.PerpendicularWithArc="PerpendicularWithArc";b.ClosedHalfCircle="ClosedHalfCircle";b.TripleParallelExtended="TripleParallelExtended";b.ParallelWithTicks="ParallelWithTicks";b.Parallel="Parallel";b.PerpendicularToFirstSegment="PerpendicularToFirstSegment";b.ParallelOffset="ParallelOffset";b.OffsetOpposite="OffsetOpposite";b.OffsetSame="OffsetSame";b.CircleWithArc=
"CircleWithArc";b.DoubleJog="DoubleJog";b.PerpendicularOffset="PerpendicularOffset";b.LineExcludingLastSegment="LineExcludingLastSegment";b.MultivertexArrow="MultivertexArrow";b.CrossedArrow="CrossedArrow";b.ChevronArrow="ChevronArrow";b.ChevronArrowOffset="ChevronArrowOffset";b.PartialFirstSegment="PartialFirstSegment";b.Arch="Arch";b.CurvedParallelTicks="CurvedParallelTicks";b.Arc90Degrees="Arc90Degrees";b.TipWithPerpendicularAndTicks="TipWithPerpendicularAndTicks"})(a.GeometricEffectControlMeasureLineRule||
(a.GeometricEffectControlMeasureLineRule={}));a.GeometricEffectDonutMethod=void 0;(function(b){b.Mitered="Mitered";b.Bevelled="Bevelled";b.Rounded="Rounded";b.Square="Square";b.TrueBuffer="TrueBuffer"})(a.GeometricEffectDonutMethod||(a.GeometricEffectDonutMethod={}));a.GeometricEffectEnclosingPolygonMethod=void 0;(function(b){b.ClosePath="ClosePath";b.ConvexHull="ConvexHull";b.RectangularBox="RectangularBox"})(a.GeometricEffectEnclosingPolygonMethod||(a.GeometricEffectEnclosingPolygonMethod={}));
a.GeometricEffectExtensionOrigin=void 0;(function(b){b.BeginningOfLine="BeginningOfLine";b.EndOfLine="EndOfLine"})(a.GeometricEffectExtensionOrigin||(a.GeometricEffectExtensionOrigin={}));a.GeometricEffectOffsetMethod=void 0;(function(b){b.Mitered="Mitered";b.Bevelled="Bevelled";b.Rounded="Rounded";b.Square="Square"})(a.GeometricEffectOffsetMethod||(a.GeometricEffectOffsetMethod={}));a.GeometricEffectOffsetOption=void 0;(function(b){b.Fast="Fast";b.Accurate="Accurate"})(a.GeometricEffectOffsetOption||
(a.GeometricEffectOffsetOption={}));a.GeometricEffectOffsetTangentMethod=void 0;(function(b){b.BeginningOfLine="BeginningOfLine";b.EndOfLine="EndOfLine"})(a.GeometricEffectOffsetTangentMethod||(a.GeometricEffectOffsetTangentMethod={}));a.GeometricEffectWaveform=void 0;(function(b){b.Sinus="Sinus";b.Square="Square";b.Triangle="Triangle";b.Random="Random"})(a.GeometricEffectWaveform||(a.GeometricEffectWaveform={}));a.GlyphHinting=void 0;(function(b){b[b.None=0]="None";b[b.Default=1]="Default";b[b.Force=
2]="Force"})(a.GlyphHinting||(a.GlyphHinting={}));a.GradientAlignment=void 0;(function(b){b[b.Buffered=0]="Buffered";b[b.Left=1]="Left";b[b.Right=2]="Right";b[b.AlongLine=3]="AlongLine"})(a.GradientAlignment||(a.GradientAlignment={}));a.GradientFillMethod=void 0;(function(b){b[b.Linear=0]="Linear";b[b.Rectangular=1]="Rectangular";b[b.Circular=2]="Circular";b[b.Buffered=3]="Buffered"})(a.GradientFillMethod||(a.GradientFillMethod={}));a.GradientStrokeType=void 0;(function(b){b[b.Discrete=0]="Discrete";
b[b.Continuous=1]="Continuous"})(a.GradientStrokeType||(a.GradientStrokeType={}));a.GradientStrokeMethod=void 0;(function(b){b[b.AcrossLine=0]="AcrossLine";b[b.AloneLine=1]="AloneLine"})(a.GradientStrokeMethod||(a.GradientStrokeMethod={}));a.HorizontalAlignment=void 0;(function(b){b[b.Left=0]="Left";b[b.Right=1]="Right";b[b.Center=2]="Center";b[b.Justify=3]="Justify"})(a.HorizontalAlignment||(a.HorizontalAlignment={}));a.LeaderLineStyle=void 0;(function(b){b[b.Base=0]="Base";b[b.MidPoint=1]="MidPoint";
b[b.ThreePoint=2]="ThreePoint";b[b.FourPoint=3]="FourPoint";b[b.Underline=4]="Underline";b[b.CircularCW=5]="CircularCW";b[b.CircularCCW=6]="CircularCCW"})(a.LeaderLineStyle||(a.LeaderLineStyle={}));a.LineCapStyle=void 0;(function(b){b.Butt="Butt";b.Round="Round";b.Square="Square"})(a.LineCapStyle||(a.LineCapStyle={}));a.LineDashEnding=void 0;(function(b){b.NoConstraint="NoConstraint";b.HalfPattern="HalfPattern";b.HalfGap="HalfGap";b.FullPattern="FullPattern";b.FullGap="FullGap";b.Custom="Custom"})(a.LineDashEnding||
(a.LineDashEnding={}));a.LineDecorationStyle=void 0;(function(b){b[b.None=-1]="None";b[b.Custom=0]="Custom";b[b.Circle=1]="Circle";b[b.OpenArrow=2]="OpenArrow";b[b.ClosedArrow=3]="ClosedArrow";b[b.Diamond=4]="Diamond"})(a.LineDecorationStyle||(a.LineDecorationStyle={}));a.LineGapType=void 0;(function(b){b[b.ExtraLeading=0]="ExtraLeading";b[b.Multiple=1]="Multiple";b[b.Exact=2]="Exact"})(a.LineGapType||(a.LineGapType={}));a.LineJoinStyle=void 0;(function(b){b.Bevel="Bevel";b.Round="Round";b.Miter=
"Miter"})(a.LineJoinStyle||(a.LineJoinStyle={}));a.ExpressionReturnType=void 0;(function(b){b[b.Default=0]="Default";b[b.String=1]="String";b[b.Numeric=2]="Numeric"})(a.ExpressionReturnType||(a.ExpressionReturnType={}));a.MarkerPlacementType=void 0;(function(b){b[b.InsidePolygon=0]="InsidePolygon";b[b.PolygonCenter=1]="PolygonCenter";b[b.RandomlyInsidePolygon=2]="RandomlyInsidePolygon"})(a.MarkerPlacementType||(a.MarkerPlacementType={}));a.MaterialMode=void 0;(function(b){b[b.Tint=0]="Tint";b[b.Replace=
1]="Replace";b[b.Multiply=2]="Multiply"})(a.MaterialMode||(a.MaterialMode={}));a.PlacementClip=void 0;(function(b){b[b.ClipAtBoundary=0]="ClipAtBoundary";b[b.RemoveIfCenterOutsideBoundary=1]="RemoveIfCenterOutsideBoundary";b[b.DoNotTouchBoundary=2]="DoNotTouchBoundary";b[b.DoNotClip=3]="DoNotClip"})(a.PlacementClip||(a.PlacementClip={}));a.PlacementEndings=void 0;(function(b){b.NoConstraint="NoConstraint";b.WithMarkers="WithMarkers";b.WithFullGap="WithFullGap";b.WithHalfGap="WithHalfGap";b.Custom=
"Custom"})(a.PlacementEndings||(a.PlacementEndings={}));a.PlacementGridType=void 0;(function(b){b.Fixed="Fixed";b.Random="Random";b.RandomFixedQuantity="RandomFixedQuantity"})(a.PlacementGridType||(a.PlacementGridType={}));a.PlacementOnLineRelativeTo=void 0;(function(b){b.LineMiddle="LineMiddle";b.LineBeginning="LineBeginning";b.LineEnd="LineEnd";b.SegmentMidpoint="SegmentMidpoint"})(a.PlacementOnLineRelativeTo||(a.PlacementOnLineRelativeTo={}));a.PlacementPolygonCenterMethod=void 0;(function(b){b.OnPolygon=
"OnPolygon";b.CenterOfMass="CenterOfMass";b.BoundingBoxCenter="BoundingBoxCenter"})(a.PlacementPolygonCenterMethod||(a.PlacementPolygonCenterMethod={}));a.PlacementRandomlyAlongLineRandomization=void 0;(function(b){b[b.Low=0]="Low";b[b.Medium=1]="Medium";b[b.High=2]="High"})(a.PlacementRandomlyAlongLineRandomization||(a.PlacementRandomlyAlongLineRandomization={}));a.PlacementStepPosition=void 0;(function(b){b[b.MarkerCenter=0]="MarkerCenter";b[b.MarkerBounds=1]="MarkerBounds"})(a.PlacementStepPosition||
(a.PlacementStepPosition={}));a.PointSymbolCalloutScale=void 0;(function(b){b[b.None=0]="None";b[b.PropUniform=1]="PropUniform";b[b.PropNonuniform=2]="PropNonuniform";b[b.DifUniform=3]="DifUniform";b[b.DifNonuniform=4]="DifNonuniform"})(a.PointSymbolCalloutScale||(a.PointSymbolCalloutScale={}));a.Simple3DLineStyle=void 0;(function(b){b.Tube="Tube";b.Strip="Strip";b.Wall="Wall"})(a.Simple3DLineStyle||(a.Simple3DLineStyle={}));a.SizeVariationMethod=void 0;(function(b){b[b.Random=0]="Random";b[b.Increasing=
1]="Increasing";b[b.Decreasing=2]="Decreasing";b[b.IncreasingThenDecreasing=3]="IncreasingThenDecreasing"})(a.SizeVariationMethod||(a.SizeVariationMethod={}));a.SymbolUnits=void 0;(function(b){b[b.Relative=0]="Relative";b[b.Absolute=1]="Absolute"})(a.SymbolUnits||(a.SymbolUnits={}));a.TextCase=void 0;(function(b){b[b.Normal=0]="Normal";b[b.LowerCase=1]="LowerCase";b[b.Allcaps=2]="Allcaps"})(a.TextCase||(a.TextCase={}));a.TextReadingDirection=void 0;(function(b){b[b.LTR=0]="LTR";b[b.RTL=1]="RTL"})(a.TextReadingDirection||
(a.TextReadingDirection={}));a.TextureFilter=void 0;(function(b){b.Draft="Draft";b.Picture="Picture";b.Text="Text"})(a.TextureFilter||(a.TextureFilter={}));a.VerticalAlignment=void 0;(function(b){b[b.Top=0]="Top";b[b.Center=1]="Center";b[b.Baseline=2]="Baseline";b[b.Bottom=3]="Bottom"})(a.VerticalAlignment||(a.VerticalAlignment={}));a.VerticalGlyphOrientation=void 0;(function(b){b[b.Right=0]="Right";b[b.Upright=1]="Upright"})(a.VerticalGlyphOrientation||(a.VerticalGlyphOrientation={}));a.WaterbodySize=
void 0;(function(b){b[b.Small=0]="Small";b[b.Medium=1]="Medium";b[b.Large=2]="Large"})(a.WaterbodySize||(a.WaterbodySize={}));a.WaveStrength=void 0;(function(b){b[b.Calm=0]="Calm";b[b.Rippled=1]="Rippled";b[b.Slight=2]="Slight";b[b.Moderate=3]="Moderate"})(a.WaveStrength||(a.WaveStrength={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectBuffer":function(){define("exports ../../../geometry ../../../geometry/GeometryCursor ../../../geometry/geometryCursorCollectUtils ../CIMEffects ../CurveHelper ../enums ../../../geometry/SpatialReference".split(" "),
function(a,b,q,l,p,k,h,f){class c{static local(){null===c.instance&&(c.instance=new c);return c.instance}execute(g,d,t,w,v,m){return new e(g,d,t,w,v,m)}}c.instance=null;class e{constructor(g,d,t,w,v,m){this._inputGeometries=g;this._tileKey=w;this._geometryEngine=v;this._curveHelper=new k.CurveHelper;this._size=(void 0!==d.size?d.size:1)*t;this._maxInflateSize=m*t;this._offsetFlattenError=k.pixelTolerance*t}next(){for(var g;g=this._inputGeometries.next();){if(0===this._size)return g;if("esriGeometryEnvelope"===
g.geometryType)if(0<this._size){var d=q.GeometryCursor.createEmptyOptimizedCIM(g.geometryType),t=l.collectMultipath(g)[0];if(t=this._curveHelper.offset(t,this._size,h.GeometricEffectOffsetMethod.Rounded,4,this._offsetFlattenError))return d.pushPath(t),d}else if(0>this._size&&(d=g.asJSON(),0<Math.min(d.xmax-d.xmin,d.ymax-d.ymin)+2*this._size))return q.GeometryCursor.fromJSONCIM({xmin:d.xmin-this._size,xmax:d.xmax+this._size,ymin:d.ymin-this._size,ymax:d.ymax+this._size});d=this._geometryEngine;if(null==
d)break;if(g=this._tileKey?p.clipCursorToTileExtent(g,this._maxInflateSize):g)return(g=d.buffer(f.WebMercator,g.asJSON(),this._size,1))?q.GeometryCursor.fromJSONCIM(g):null}return null}}a.EffectBuffer=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectControlMeasureLine":function(){define(["exports","../../../geometry/GeometryCursor","../../../geometry/geometryCursorCollectUtils","../CIMCursor","../enums"],function(a,b,q,l,p){class k{static local(){null===
k.instance&&(k.instance=new k);return k.instance}execute(f,c,e,g,d){return new h(f,c,e)}}k.instance=null;class h{constructor(f,c,e){this._defaultPointSize=20;this._inputGeometries=f;this._geomUnitsPerPoint=e;this._rule=c.rule??p.GeometricEffectControlMeasureLineRule.FullGeometry;this._defaultSize=this._defaultPointSize*e}next(){for(var f;f=this._inputGeometries.next();)if(f=this._processGeom(q.collectMultipath(f)),f?.length)return b.GeometryCursor.fromJSONCIM({paths:f});return null}_clone(f){return[f[0],
f[1]]}_mid(f,c){return[(f[0]+c[0])/2,(f[1]+c[1])/2]}_mix(f,c,e,g){return[f[0]*c+e[0]*g,f[1]*c+e[1]*g]}_add(f,c){return[f[0]+c[0],f[1]+c[1]]}_add2(f,c,e){return[f[0]+c,f[1]+e]}_sub(f,c){return[f[0]-c[0],f[1]-c[1]]}_dist(f,c){return Math.sqrt((f[0]-c[0])*(f[0]-c[0])+(f[1]-c[1])*(f[1]-c[1]))}_norm(f){return Math.sqrt(f[0]*f[0]+f[1]*f[1])}_normalize(f,c=1){c/=this._norm(f);f[0]*=c;f[1]*=c}_leftPerpendicular(f){const c=f[0];f[0]=-f[1];f[1]=c}_leftPerp(f){return[-f[1],f[0]]}_rightPerpendicular(f){const c=
-f[0];f[0]=f[1];f[1]=c}_rightPerp(f){return[f[1],-f[0]]}_dotProduct(f,c){return f[0]*c[0]+f[1]*c[1]}_crossProduct(f,c){return f[0]*c[1]-f[1]*c[0]}_rotateDirect(f,c,e){const g=f[0]*e+f[1]*c;f[0]=f[0]*c-f[1]*e;f[1]=g}_makeCtrlPt(f){f=[f[0],f[1]];l.setId(f,1);return f}_addAngledTicks(f,c,e,g){const d=this._sub(e,c);this._normalize(d);var t=this._crossProduct(d,this._sub(g,c));g=0<t?this._rightPerp(d):this._leftPerp(d);t=Math.abs(t)/2;const w=[];w.push([c[0]+(g[0]-d[0])*t,c[1]+(g[1]-d[1])*t]);w.push(c);
w.push(e);w.push([e[0]+(g[0]+d[0])*t,e[1]+(g[1]+d[1])*t]);f.push(w)}_addBezier2(f,c,e,g,d){if(0===d--)f.push(g);else{var t=this._mid(c,e);e=this._mid(e,g);var w=this._mid(t,e);this._addBezier2(f,c,t,w,d);this._addBezier2(f,w,e,g,d)}}_addBezier3(f,c,e,g,d,t){if(0===t--)f.push(d);else{var w=this._mid(c,e),v=this._mid(e,g);g=this._mid(g,d);e=this._mid(w,v);v=this._mid(v,g);var m=this._mid(e,v);this._addBezier3(f,c,w,e,m,t);this._addBezier3(f,m,v,g,d,t)}}_add90DegArc(f,c,e,g,d){g=d??0<this._crossProduct(this._sub(e,
c),this._sub(g,c));d=this._mid(c,e);const t=this._sub(d,c);g?this._leftPerpendicular(t):this._rightPerpendicular(t);d[0]+=t[0];d[1]+=t[1];this._addBezier3(f,c,this._mix(c,.33333,d,.66667),this._mix(e,.33333,d,.66667),e,4)}_addArrow(f,c,e){var g=c[0],d=c[1],t=c[c.length-1],w=this._sub(g,d),v=this._norm(w);this._normalize(w);const m=Math.abs(this._crossProduct(w,this._sub(t,d)));t=this._dotProduct(w,this._sub(t,d));t<.05*v?t=.05*v:t>.95*v&&(t=.95*v);v=.5*m;var r=this._leftPerp(w);t=[d[0]+w[0]*t,d[1]+
w[1]*t];var n=c.length-1;d=[];d.push(e?[-r[0],-r[1]]:r);var u=[-w[0],-w[1]];for(e=1;e<n-1;e++){w=this._sub(c[e+1],c[e]);this._normalize(w);var x=this._dotProduct(w,u);r=this._crossProduct(w,u);x=Math.sqrt((1+x)/2);u=this._sub(w,u);this._normalize(u);u[0]/=x;u[1]/=x;d.push(0>r?[-u[0],-u[1]]:u);u=w}d.push(this._rightPerp(u));for(n=d.length-1;0<n;n--)f.push([c[n][0]+d[n][0]*v,c[n][1]+d[n][1]*v]);f.push([t[0]+d[0][0]*v,t[1]+d[0][1]*v]);f.push([t[0]+d[0][0]*m,t[1]+d[0][1]*m]);f.push(g);f.push([t[0]-d[0][0]*
m,t[1]-d[0][1]*m]);f.push([t[0]-d[0][0]*v,t[1]-d[0][1]*v]);for(g=1;g<d.length;g++)f.push([c[g][0]-d[g][0]*v,c[g][1]-d[g][1]*v])}_cp2(f,c,e){return 2<=f.length?f[1]:this._add2(f[0],c*this._defaultSize,e*this._defaultSize)}_cp3(f,c,e,g){if(3<=f.length)return f[2];e=this._mix(f[0],1-e,c,e);f=this._sub(c,f[0]);this._normalize(f);this._rightPerpendicular(f);return[e[0]+f[0]*g*this._defaultSize,e[1]+f[1]*g*this._defaultSize]}_arrowPath(f){if(2<f.length)return f;const c=f[0];f=this._cp2(f,-4,0);const e=
this._sub(c,f);this._normalize(e);const g=this._rightPerp(e);return[c,f,[c[0]+(g[0]-e[0])*this._defaultSize,c[1]+(g[1]-e[1])*this._defaultSize]]}_arrowLastSeg(f){var c=f[0];const e=this._cp2(f,-4,0);if(3<=f.length)c=f[f.length-1];else{f=this._sub(c,e);this._normalize(f);const g=this._rightPerp(f);c=[c[0]+(g[0]-f[0])*this._defaultSize,c[1]+(g[1]-f[1])*this._defaultSize]}return[e,c]}_processGeom(f){if(!f)return null;const c=[];for(const e of f){if(!e||0===e.length)continue;const g=e.length;let d=e[0];
switch(this._rule){case p.GeometricEffectControlMeasureLineRule.PerpendicularFromFirstSegment:const t=this._cp2(e,0,-1),w=this._cp3(e,t,.5,4),v=[];v.push(w);v.push(this._mid(d,t));c.push(v);break;case p.GeometricEffectControlMeasureLineRule.ReversedFirstSegment:const m=this._cp2(e,0,-1);c.push([m,d]);break;case p.GeometricEffectControlMeasureLineRule.PerpendicularToSecondSegment:if(3>e.length)return[];const r=this._cp2(e,-4,1),n=this._cp3(e,r,.882353,-1.94),u=[];u.push(this._mid(r,n));u.push(d);c.push(u);
break;case p.GeometricEffectControlMeasureLineRule.SecondSegmentWithTicks:if(3>e.length)return[];const x=this._cp2(e,-4,1),y=this._cp3(e,x,.882353,-1.94),z=this._sub(y,x);let A;A=0<this._crossProduct(z,this._sub(d,x))?this._rightPerp(z):this._leftPerp(z);const B=[];B.push([x[0]+(A[0]-z[0])/3,x[1]+(A[1]-z[1])/3]);B.push(x);B.push(y);B.push([y[0]+(A[0]+z[0])/3,y[1]+(A[1]+z[1])/3]);c.push(B);break;case p.GeometricEffectControlMeasureLineRule.DoublePerpendicular:const C=this._cp2(e,0,-1),D=this._cp3(e,
C,.5,3),F=this._mid(d,C),H=this._sub(F,D);this._normalize(H);const N=this._crossProduct(H,this._sub(d,D));this._leftPerpendicular(H);const E=[];E.push(d);E.push([D[0]+H[0]*N,D[1]+H[1]*N]);c.push(E);const G=[];G.push([D[0]-H[0]*N,D[1]-H[1]*N]);G.push(C);c.push(G);break;case p.GeometricEffectControlMeasureLineRule.OppositeToFirstSegment:const I=this._cp2(e,0,-1),O=this._cp3(e,I,.5,3),L=this._mid(d,I),P=this._sub(L,O);this._normalize(P);const M=this._crossProduct(P,this._sub(d,O));this._leftPerpendicular(P);
const K=[];K.push([O[0]+P[0]*M,O[1]+P[1]*M]);K.push([O[0]-P[0]*M,O[1]-P[1]*M]);c.push(K);break;case p.GeometricEffectControlMeasureLineRule.TriplePerpendicular:const J=this._cp2(e,0,-1),R=this._cp3(e,J,.5,4),Q=this._mid(d,J),W=this._sub(Q,R);this._normalize(W);const S=this._crossProduct(W,this._sub(d,R));this._leftPerpendicular(W);const V=[];V.push([R[0]+W[0]*S*.8,R[1]+W[1]*S*.8]);V.push([Q[0]+.8*(d[0]-Q[0]),Q[1]+.8*(d[1]-Q[1])]);c.push(V);c.push([R,Q]);const T=[];T.push([R[0]-W[0]*S*.8,R[1]-W[1]*
S*.8]);T.push([Q[0]+.8*(J[0]-Q[0]),Q[1]+.8*(J[1]-Q[1])]);c.push(T);break;case p.GeometricEffectControlMeasureLineRule.HalfCircleFirstSegment:const Y=this._cp2(e,0,-1),ha=this._cp3(e,Y,.5,4),ba=this._mid(d,Y);let U=this._sub(Y,d);const Z=Math.cos(Math.PI/18),ca=Math.sin(Math.PI/18),ea=Math.sqrt((1+Z)/2),da=Math.sqrt((1-Z)/2),ia=[];let ka;0<this._crossProduct(U,this._sub(ha,d))?(ia.push(d),U=this._sub(d,ba),ka=Y):(ia.push(Y),U=this._sub(Y,ba),ka=d);this._rotateDirect(U,ea,da);U[0]/=ea;U[1]/=ea;for(let Eb=
1;18>=Eb;Eb++)ia.push(this._add(ba,U)),this._rotateDirect(U,Z,ca);ia.push(ka);c.push(ia);break;case p.GeometricEffectControlMeasureLineRule.HalfCircleSecondSegment:const fa=this._cp2(e,0,-1),X=this._cp3(e,fa,1,-1);let ja=this._sub(d,fa);this._normalize(ja);const la=this._crossProduct(ja,this._sub(X,fa))/2;this._leftPerpendicular(ja);const na=[fa[0]+ja[0]*la,fa[1]+ja[1]*la];ja=this._sub(fa,na);const va=Math.cos(Math.PI/18);let za=Math.sin(Math.PI/18);0<la&&(za=-za);const ya=[fa];for(let Eb=1;18>=Eb;Eb++)this._rotateDirect(ja,
va,za),ya.push(this._add(na,ja));c.push(ya);break;case p.GeometricEffectControlMeasureLineRule.HalfCircleExtended:const Da=this._cp2(e,0,-2),ra=this._cp3(e,Da,1,-1);let xa;if(4<=g)xa=e[3];else{const Eb=this._sub(d,Da);xa=this._add(ra,Eb)}const Ma=this._dist(Da,ra)/2/.75,Ga=this._sub(Da,d);this._normalize(Ga,Ma);const Pa=this._sub(ra,xa);this._normalize(Pa,Ma);c.push([xa,ra]);const Qa=[this._clone(ra)];this._addBezier3(Qa,ra,this._add(ra,Pa),this._add(Da,Ga),Da,4);Qa.push(d);c.push(Qa);break;case p.GeometricEffectControlMeasureLineRule.OpenCircle:const Ea=
this._cp2(e,-2,0),ua=this._sub(Ea,d),Na=Math.cos(Math.PI/18),Ua=-Math.sin(Math.PI/18),wa=[Ea];for(let Eb=1;33>=Eb;Eb++)this._rotateDirect(ua,Na,Ua),wa.push(this._add(d,ua));c.push(wa);break;case p.GeometricEffectControlMeasureLineRule.CoverageEdgesWithTicks:const sa=this._cp2(e,0,-1);let Ha;if(3<=g)Ha=e[2];else{const Eb=this._sub(sa,d),ec=this._leftPerp(Eb);Ha=[d[0]+ec[0]-.25*Eb[0],d[1]+ec[1]-.25*Eb[1]]}let Ka;if(4<=g)Ka=e[3];else{const Eb=this._mid(d,sa),ec=this._sub(d,sa);this._normalize(ec);this._leftPerpendicular(ec);
const pc=this._crossProduct(ec,this._sub(Ha,Eb));this._rightPerpendicular(ec);Ka=[Ha[0]+ec[0]*pc*2,Ha[1]+ec[1]*pc*2]}const Aa=this._sub(sa,d);let Sa,Ya;Sa=0<this._crossProduct(Aa,this._sub(Ha,d))?this._rightPerp(Aa):this._leftPerp(Aa);Ya=[];Ya.push(Ha);Ya.push(d);Ya.push([d[0]+(Sa[0]-Aa[0])/3,d[1]+(Sa[1]-Aa[1])/3]);c.push(Ya);Sa=0<this._crossProduct(Aa,this._sub(Ka,sa))?this._rightPerp(Aa):this._leftPerp(Aa);Ya=[];Ya.push([sa[0]+(Sa[0]+Aa[0])/3,sa[1]+(Sa[1]+Aa[1])/3]);Ya.push(sa);Ya.push(Ka);c.push(Ya);
break;case p.GeometricEffectControlMeasureLineRule.GapExtentWithDoubleTicks:const qa=this._cp2(e,0,2),aa=this._cp3(e,qa,0,1);let Ja;if(4<=g)Ja=e[3];else{const Eb=this._sub(qa,d);Ja=this._add(aa,Eb)}this._addAngledTicks(c,d,qa,this._mid(aa,Ja));this._addAngledTicks(c,aa,Ja,this._mid(d,qa));break;case p.GeometricEffectControlMeasureLineRule.GapExtentMidline:const Ta=this._cp2(e,2,0),Ra=this._cp3(e,Ta,0,1);let $a;if(4<=g)$a=e[3];else{const Eb=this._sub(Ta,d);$a=this._add(Ra,Eb)}const bb=[];bb.push(this._mid(d,
Ra));bb.push(this._mid(Ta,$a));c.push(bb);break;case p.GeometricEffectControlMeasureLineRule.Chevron:const pa=this._cp2(e,-1,-1);let Ba;if(3<=g)Ba=e[2];else{const Eb=this._sub(pa,d);this._leftPerpendicular(Eb);Ba=this._add(d,Eb)}c.push([pa,this._makeCtrlPt(d),Ba]);break;case p.GeometricEffectControlMeasureLineRule.PerpendicularWithArc:const Ia=this._cp2(e,0,-2),Wa=this._cp3(e,Ia,.5,-1),gb=this._sub(Ia,d),ib=this._norm(gb);gb[0]/=ib;gb[1]/=ib;const La=this._crossProduct(gb,this._sub(Wa,d));let Xa=
this._dotProduct(gb,this._sub(Wa,d));Xa<.05*ib?Xa=.05*ib:Xa>.95*ib&&(Xa=.95*ib);const eb=[d[0]+gb[0]*Xa,d[1]+gb[1]*Xa];let db=this._leftPerp(gb),jb=[];jb.push([eb[0]-db[0]*La,eb[1]-db[1]*La]);jb.push([eb[0]+db[0]*La,eb[1]+db[1]*La]);c.push(jb);if(4<=g){const Eb=e[3];let ec=this._dotProduct(gb,this._sub(Eb,d));ec<.1*ib?ec=.1*ib:ec>.9*ib&&(ec=.9*ib);const pc=[d[0]+gb[0]*ec,d[1]+gb[1]*ec],Fc=this._crossProduct(gb,this._sub(Eb,d)),Fe=[];Fe.push([pc[0]-db[0]*Fc,pc[1]-db[1]*Fc]);Fe.push([pc[0]+db[0]*Fc,
pc[1]+db[1]*Fc]);c.push(Fe)}const nb=[Ia[0]+db[0]*La,Ia[1]+db[1]*La];db=this._sub(Ia,nb);const qb=Math.cos(Math.PI/18);let ub=Math.sin(Math.PI/18);0>La&&(ub=-ub);jb=[d,Ia];for(let Eb=1;9>=Eb;Eb++)this._rotateDirect(db,qb,ub),jb.push(this._add(nb,db));c.push(jb);break;case p.GeometricEffectControlMeasureLineRule.ClosedHalfCircle:const xb=this._cp2(e,2,0),pb=this._mid(d,xb),Bb=this._sub(xb,pb),Kb=Math.cos(Math.PI/18),bc=Math.sin(Math.PI/18),Ib=[d,xb];for(let Eb=1;18>=Eb;Eb++)this._rotateDirect(Bb,Kb,
bc),Ib.push(this._add(pb,Bb));c.push(Ib);break;case p.GeometricEffectControlMeasureLineRule.TripleParallelExtended:const $b=this._cp2(e,0,-2),kc=this._cp3(e,$b,1,-2),fc=this._mid(d,$b),Pb=this._sub(kc,$b);this._normalize(Pb);const Cb=Math.abs(this._crossProduct(Pb,this._sub(fc,$b)))/2,Vb=this._dist($b,kc),gc=[$b,d];gc.push([d[0]+Pb[0]*Vb*.5,d[1]+Pb[1]*Vb*.5]);c.push(gc);const Lb=[];Lb.push([fc[0]-Pb[0]*Cb,fc[1]-Pb[1]*Cb]);Lb.push([fc[0]+Pb[0]*Vb*.375,fc[1]+Pb[1]*Vb*.375]);l.setId(Lb[Lb.length-1],
1);Lb.push([fc[0]+Pb[0]*Vb*.75,fc[1]+Pb[1]*Vb*.75]);c.push(Lb);c.push([$b,kc]);break;case p.GeometricEffectControlMeasureLineRule.ParallelWithTicks:const lb=this._cp2(e,3,0),oa=this._cp3(e,lb,.5,-1),Fa=this._sub(oa,lb);this._normalize(Fa);const Va=this._crossProduct(Fa,this._sub(oa,d));this._leftPerpendicular(Fa);this._addAngledTicks(c,d,lb,oa);this._addAngledTicks(c,this._mix(d,1,Fa,Va),this._mix(lb,1,Fa,Va),this._mid(d,lb));break;case p.GeometricEffectControlMeasureLineRule.Parallel:const Za=this._cp2(e,
3,0),fb=this._cp3(e,Za,.5,-1),kb=this._sub(Za,d);this._normalize(kb);const mb=this._leftPerp(kb),rb=this._crossProduct(kb,this._sub(fb,d));let tb=[d,Za];c.push(tb);tb=[];tb.push([d[0]+mb[0]*rb,d[1]+mb[1]*rb]);tb.push([Za[0]+mb[0]*rb,Za[1]+mb[1]*rb]);c.push(tb);break;case p.GeometricEffectControlMeasureLineRule.PerpendicularToFirstSegment:const yb=this._cp2(e,3,0),zb=this._cp3(e,yb,.5,-1),Ab=this._mid(d,yb),Fb=this._sub(yb,d);this._normalize(Fb);const Qb=this._crossProduct(Fb,this._sub(zb,d));this._leftPerpendicular(Fb);
const sb=[];sb.push([Ab[0]-Fb[0]*Qb*.25,Ab[1]-Fb[1]*Qb*.25]);sb.push([Ab[0]+Fb[0]*Qb*1.25,Ab[1]+Fb[1]*Qb*1.25]);c.push(sb);break;case p.GeometricEffectControlMeasureLineRule.ParallelOffset:const vb=this._cp2(e,3,0),Gb=this._cp3(e,vb,.5,-1),Hb=this._sub(vb,d);this._normalize(Hb);const Tb=this._crossProduct(Hb,this._sub(Gb,d));this._leftPerpendicular(Hb);const lc=[];lc.push([d[0]-Hb[0]*Tb,d[1]-Hb[1]*Tb]);lc.push([vb[0]-Hb[0]*Tb,vb[1]-Hb[1]*Tb]);c.push(lc);const Ub=[];Ub.push([d[0]+Hb[0]*Tb,d[1]+Hb[1]*
Tb]);Ub.push([vb[0]+Hb[0]*Tb,vb[1]+Hb[1]*Tb]);c.push(Ub);break;case p.GeometricEffectControlMeasureLineRule.OffsetOpposite:const Zb=this._cp2(e,3,0),ac=this._cp3(e,Zb,.5,-1),Mb=this._sub(Zb,d);this._normalize(Mb);const Jb=this._crossProduct(Mb,this._sub(ac,d));this._leftPerpendicular(Mb);const Wb=[];Wb.push([d[0]-Mb[0]*Jb,d[1]-Mb[1]*Jb]);Wb.push([Zb[0]-Mb[0]*Jb,Zb[1]-Mb[1]*Jb]);c.push(Wb);break;case p.GeometricEffectControlMeasureLineRule.OffsetSame:const cc=this._cp2(e,3,0),Db=this._cp3(e,cc,.5,
-1),Nb=this._sub(cc,d);this._normalize(Nb);const hc=this._crossProduct(Nb,this._sub(Db,d));this._leftPerpendicular(Nb);const xc=[];xc.push([d[0]+Nb[0]*hc,d[1]+Nb[1]*hc]);xc.push([cc[0]+Nb[0]*hc,cc[1]+Nb[1]*hc]);c.push(xc);break;case p.GeometricEffectControlMeasureLineRule.CircleWithArc:let nc=this._cp2(e,3,0);const Xb=this._cp3(e,nc,.5,-1);let tc,Yb;if(4<=g)tc=e[3],Yb=0<this._crossProduct(this._sub(tc,nc),this._sub(Xb,nc));else{tc=nc;Yb=0<this._crossProduct(this._sub(tc,d),this._sub(Xb,d));const Eb=
24*this._geomUnitsPerPoint,ec=this._sub(tc,d);this._normalize(ec,Eb);const pc=Math.sqrt(2)/2;this._rotateDirect(ec,pc,Yb?pc:-pc);nc=this._add(d,ec)}const dc=this._sub(nc,d),Gc=Math.cos(Math.PI/18),Cc=Math.sin(Math.PI/18),uc=[nc];for(let Eb=1;36>=Eb;Eb++)this._rotateDirect(dc,Gc,Cc),uc.push(this._add(d,dc));this._add90DegArc(uc,nc,tc,Xb,Yb);l.setId(uc[uc.length-8],1);c.push(uc);break;case p.GeometricEffectControlMeasureLineRule.DoubleJog:let oc=this._cp2(e,-3,1),yc=this._cp3(e,oc,-1,-.5),Dc;if(4<=
g)Dc=e[3];else{const Eb=d;d=oc;Dc=yc;const ec=this._dist(d,Eb),pc=this._dist(Dc,Eb);let Fc=30*this._geomUnitsPerPoint;.5*ec<Fc&&(Fc=.5*ec);.5*pc<Fc&&(Fc=.5*pc);oc=this._mix(d,Fc/ec,Eb,(ec-Fc)/ec);yc=this._mix(Dc,Fc/pc,Eb,(pc-Fc)/pc)}const Hc=this._mid(d,oc),Oc=this._mid(Dc,yc),dd=this._dist(d,oc),Yc=this._dist(yc,Dc);let Ic=Math.min(dd,Yc)/8;Ic=Math.min(Ic,24*this._geomUnitsPerPoint);const wc=Math.cos(Math.PI/4);let qc=this._sub(d,oc);this._normalize(qc,Ic);0<this._crossProduct(qc,this._sub(Dc,oc))?
this._rotateDirect(qc,wc,-wc):this._rotateDirect(qc,wc,wc);let zc=[];zc.push(oc);zc.push(this._add(Hc,qc));zc.push(this._sub(Hc,qc));zc.push(d);c.push(zc);qc=this._sub(Dc,yc);this._normalize(qc,Ic);0>this._crossProduct(qc,this._sub(d,yc))?this._rotateDirect(qc,wc,wc):this._rotateDirect(qc,wc,-wc);zc=[];zc.push(yc);zc.push(this._add(Oc,qc));zc.push(this._sub(Oc,qc));zc.push(Dc);c.push(zc);break;case p.GeometricEffectControlMeasureLineRule.PerpendicularOffset:const rd=this._cp2(e,-4,1),Pd=this._cp3(e,
rd,.882353,-1.94),ed=this._sub(Pd,rd);0<this._crossProduct(ed,this._sub(d,rd))?this._rightPerpendicular(ed):this._leftPerpendicular(ed);const Qd=[ed[0]/8,ed[1]/8],sd=this._sub(this._mid(rd,Pd),Qd);c.push([sd,d]);break;case p.GeometricEffectControlMeasureLineRule.LineExcludingLastSegment:const fd=this._arrowPath(e),Rd=[];let Gd=fd.length-2;for(;Gd--;)Rd.push(fd[Gd]);c.push(Rd);break;case p.GeometricEffectControlMeasureLineRule.MultivertexArrow:const ve=this._arrowPath(e),Sd=[];this._addArrow(Sd,ve,
!1);c.push(Sd);break;case p.GeometricEffectControlMeasureLineRule.CrossedArrow:const we=this._arrowPath(e),Hd=[];this._addArrow(Hd,we,!0);c.push(Hd);break;case p.GeometricEffectControlMeasureLineRule.ChevronArrow:const [td,xe]=this._arrowLastSeg(e),ad=10*this._geomUnitsPerPoint,vc=this._sub(d,td),Rc=this._norm(vc);this._normalize(vc);const Pc=this._crossProduct(vc,this._sub(xe,td));let Sc=this._dotProduct(vc,this._sub(xe,td));Sc<.05*Rc?Sc=.05*Rc:Sc>.95*Rc-ad&&(Sc=.95*Rc-ad);const ud=[td[0]+vc[0]*
Sc,td[1]+vc[1]*Sc],Tc=this._leftPerp(vc),Uc=[];Uc.push([ud[0]+Tc[0]*Pc+vc[0]*ad,ud[1]+Tc[1]*Pc+vc[1]*ad]);Uc.push(d);Uc.push([ud[0]-Tc[0]*Pc+vc[0]*ad,ud[1]-Tc[1]*Pc+vc[1]*ad]);c.push(Uc);break;case p.GeometricEffectControlMeasureLineRule.ChevronArrowOffset:const [Qc,Id]=this._arrowLastSeg(e),Ac=this._sub(d,Qc),gd=this._norm(Ac);this._normalize(Ac);const hd=this._crossProduct(Ac,this._sub(Id,Qc));let Ec=this._dotProduct(Ac,this._sub(Id,Qc));Ec<.05*gd?Ec=.05*gd:Ec>.95*gd&&(Ec=.95*gd);const id=[Qc[0]+
Ac[0]*Ec,Qc[1]+Ac[1]*Ec];this._leftPerpendicular(Ac);const Jd=[];Jd.push([id[0]+Ac[0]*hd*.5,id[1]+Ac[1]*hd*.5]);Jd.push(this._mid(id,d));Jd.push([id[0]-Ac[0]*hd*.5,id[1]-Ac[1]*hd*.5]);c.push(Jd);break;case p.GeometricEffectControlMeasureLineRule.PartialFirstSegment:const [jd,ye]=this._arrowLastSeg(e),kd=this._sub(d,jd),vd=this._norm(kd);this._normalize(kd);let bd=this._dotProduct(kd,this._sub(ye,jd));bd<.05*vd?bd=.05*vd:bd>.95*vd&&(bd=.95*vd);c.push([jd,[jd[0]+kd[0]*bd,jd[1]+kd[1]*bd]]);break;case p.GeometricEffectControlMeasureLineRule.Arch:const Kd=
this._cp2(e,0,-1),wd=this._cp3(e,Kd,.5,1),Ld=this._sub(d,Kd),Td=this._mix(wd,1,Ld,.55),Ud=this._mix(wd,1,Ld,-.55),xd=[d];this._addBezier2(xd,d,Td,wd,4);this._addBezier2(xd,wd,Ud,Kd,4);c.push(xd);break;case p.GeometricEffectControlMeasureLineRule.CurvedParallelTicks:const Vc=this._cp2(e,-4,1),ld=this._cp3(e,Vc,.882353,-1.94),Zc=this._sub(ld,Vc);0<this._crossProduct(Zc,this._sub(d,Vc))?this._rightPerpendicular(Zc):this._leftPerpendicular(Zc);const Md=[Zc[0]/8,Zc[1]/8],Nd=this._sub(this._mid(Vc,ld),
Md),ze=this._sub(this._mix(Vc,.75,ld,.25),Md),Ae=this._sub(this._mix(Vc,.25,ld,.75),Md),yd=[Vc];this._addBezier2(yd,Vc,ze,Nd,3);this._addBezier2(yd,Nd,Ae,ld,3);c.push(yd);for(let Eb=0;8>Eb;Eb++){const ec=yd[2*Eb+1],pc=[this._clone(ec)];pc.push(this._add(ec,[Zc[0]/4,Zc[1]/4]));c.push(pc)}break;case p.GeometricEffectControlMeasureLineRule.Arc90Degrees:const zd=this._cp2(e,0,-1),Vd=this._cp3(e,zd,.5,1),Be=[zd];this._add90DegArc(Be,zd,d,Vd);c.push(Be);break;case p.GeometricEffectControlMeasureLineRule.TipWithPerpendicularAndTicks:const [Wd,
Xd]=this._arrowLastSeg(e),Od=10*this._geomUnitsPerPoint,Wc=this._sub(d,Wd),Yd=this._norm(Wc);this._normalize(Wc);let $c=this._crossProduct(Wc,this._sub(Xd,Wd)),Zd=this._dotProduct(Wc,this._sub(Xd,Wd));Zd<.05*Yd?Zd=.05*Yd:Zd>.95*Yd-Od&&(Zd=.95*Yd-Od);const md=this._leftPerp(Wc),cd=[d[0]-Wc[0]*Od,d[1]-Wc[1]*Od],nd=.5*Math.max(Yd-Zd-Od,Od);$c=Math.abs($c);const $d=[];$d.push([cd[0]+md[0]*($c+nd)-Wc[0]*nd,cd[1]+md[1]*($c+nd)-Wc[1]*nd]);$d.push([cd[0]+md[0]*$c,cd[1]+md[1]*$c]);$d.push([cd[0]-md[0]*$c,
cd[1]-md[1]*$c]);$d.push([cd[0]-md[0]*($c+nd)-Wc[0]*nd,cd[1]-md[1]*($c+nd)-Wc[1]*nd]);c.push($d);c.push([cd,d]);break;default:c.push(e)}}return c}}a.EffectControlMeasureLine=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectCut":function(){define(["exports","../../../geometry/GeometryCursor","../CIMCursor","../CurveHelper"],function(a,b,q,l){class p{static local(){null===p.instance&&(p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h,
f,c)}}p.instance=null;class k extends q.PathEffectCursor{constructor(h,f,c){super(h,!0,!0);this._curveHelper=new l.CurveHelper;this._beginCut=(void 0!==f.beginCut?f.beginCut:1)*c;this._endCut=(void 0!==f.endCut?f.endCut:1)*c;this._middleCut=(void 0!==f.middleCut?f.middleCut:0)*c;this._invert=void 0!==f.invert?f.invert:!1;0>this._beginCut&&(this._beginCut=0);0>this._endCut&&(this._endCut=0);0>this._middleCut&&(this._middleCut=0)}processPath(h){const {_beginCut:f,_endCut:c,_middleCut:e}=this,g=h.pathLength(),
d=b.GeometryCursor.createEmptyOptimizedCIM("esriGeometryPolyline");if(!this._invert)if(0===f&&0===c&&0===e)for(d.startPath();h.nextPoint();)d.pushXY(h.x,h.y);else f+c+e<g&&(0===e?this._curveHelper.appendSubCurve(d,h,f,g-c):(this._curveHelper.appendSubCurve(d,h,f,.5*(g-e)),this._curveHelper.appendSubCurve(d,h,.5*(g+e),g-c)));else if(0!==f||0!==c||0!==e)if(f+c+e>=g)for(d.startPath();h.nextPoint();)d.pushXY(h.x,h.y);else this._curveHelper.appendSubCurve(d,h,0,f),this._curveHelper.appendSubCurve(d,h,
.5*(g-e),.5*(g+e)),this._curveHelper.appendSubCurve(d,h,g-c,c);return 0===d.totalSize?null:d}}a.EffectCut=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectDashes":function(){define("exports ../../../geometry/GeometryCursor ../../../geometry/geometryCursorCollectUtils ../../../geometry/support/coordsUtils ../CIMCursor ../enums ../GeometryWalker ../utils".split(" "),function(a,b,q,l,p,k,h,f){class c{static local(){null===c.instance&&(c.instance=new c);
return c.instance}execute(g,d,t,w,v){return new e(g,d,t,w)}}c.instance=null;class e extends p.PathEffectCursor{constructor(g,d,t,w){super(g,!0,!0);this._firstCurve=null;this._walker=new h.GeometryWalker;this._walker.updateTolerance(t);this._endings=d.lineDashEnding;this._customDashPos=-(d.offsetAlongLine??0)*t;this._offsetAtEnd=(d.customEndingOffset??0)*t;this._tileKey=w;g=f.normalizeDashTemplate(d).dashTemplate;null==g&&(g=[]);g.length%2&&(g=[...g,...g]);d=0;for(w=0;w<g.length;w++){let v=Math.abs(g[w]);
1E-7>v&&(v=1E-7);d+=v}this._patternLength=d;this._numOfDashesPerPattern=g.length/2;this._pattern=new h.DashPattern;this._pattern.init(g,!0);this._pattern.scale(t)}processPath(g){if(0===this._pattern.length())return this.iteratePath=!1,g=q.collectPath(g),b.GeometryCursor.fromJSONCIM({paths:[g]});if(!this.iteratePath){var d=!0;switch(this._endings){default:this._pattern.extPtGap=0;break;case k.LineDashEnding.FullPattern:this.isClosed||(this._pattern.extPtGap=.5*this._pattern.firstValue());break;case k.LineDashEnding.FullGap:this.isClosed||
(this._pattern.extPtGap=.5*this._pattern.lastValue());break;case k.LineDashEnding.NoConstraint:this.isClosed||(d=!1);break;case k.LineDashEnding.Custom:this.isClosed||(this._pattern.extPtGap=.5*this._offsetAtEnd)}var t=g.pathLength();if(this._pattern.isEmpty()||t<.1*this._pattern.length()||!this._walker.init(g,this._pattern,d))return g=q.collectPath(g),b.GeometryCursor.fromJSONCIM({paths:[g]})}if(this.iteratePath)g=this._pattern.nextValue();else{switch(this._endings){default:d=.5*this._pattern.firstValue();
break;case k.LineDashEnding.HalfGap:d=.5*-this._pattern.lastValue();break;case k.LineDashEnding.FullGap:d=-this._pattern.lastValue();break;case k.LineDashEnding.FullPattern:d=0;break;case k.LineDashEnding.NoConstraint:case k.LineDashEnding.Custom:d=-this._customDashPos}g=d/this._pattern.length();g-=Math.floor(g);d=g*this._pattern.length();this._pattern.reset();g=this._pattern.nextValue();for(t=!1;d>=g;)d-=g,g=this._pattern.nextValue(),t=!t;g-=d;t?(this._walker.nextPosition(g),g=this._pattern.nextValue()):
this.isClosed&&(this._firstCurve=this._walker.nextCurve(g),g=this._pattern.nextValue(),this._walker.nextPosition(g),g=this._pattern.nextValue())}if(d=this._walker.nextCurve(g))if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)d.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else g=this._pattern.nextValue(),!this._walker.nextPosition(g)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&
(d.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,d=this._firstCurve,this._firstCurve=null;d?.reset();return d}isClippingRequired(g){g=q.collectMultipath(g);let d=0;for(const t of g)d+=l.getPathLength(t);return 1E3<Math.round(d/this._patternLength*this._numOfDashesPerPattern)}}a.EffectDashes=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/GeometryWalker":function(){define(["exports","../../geometry/GeometryCursor",
"./CurveHelper"],function(a,b,q){class l{constructor(){this._values=[];this._currentValue=this._length=this.ctrlPtGap=this.extPtGap=0}isEmpty(){return 0===this._values.length}size(){return this._values.length}init(f,c,e=!0){this._setEmpty();if(!f||0===f.length)return!1;for(let g=0;g<f.length;g++){let d=Math.abs(f[g]);e&&1E-7>d&&(d=1E-7);this._values.push(d);this._length+=d}c&&f.length&1&&(this._length*=2);if(0===this._length)return!1;this.ctrlPtGap=this.extPtGap=0;this._currentValue=-1;return!0}scale(f){const c=
this._values?this._values.length:0;for(let e=0;e<c;++e)this._values[e]*=f;this._length*=f;this.extPtGap*=f;this.ctrlPtGap*=f}addValue(f){this._length+=f;this._values.push(f)}firstValue(){return this._values[0]}lastValue(){return this._values[this._values.length-1]}nextValue(){this._currentValue++;this._currentValue===this._values.length&&(this._currentValue=0);return this._values[this._currentValue]}reset(){this._currentValue=-1}length(){return this._length}_setEmpty(){this.extPtGap=this.ctrlPtGap=
this._length=0;this._currentValue=-1;this._values.length=0}}class p{constructor(){this.pt=null;this.sa=this.ca=0}}a.EndType=void 0;(function(f){f[f.FAIL=0]="FAIL";f[f.END=1]="END";f[f.CONTINUE=2]="CONTINUE"})(a.EndType||(a.EndType={}));class k{constructor(){this.reset()}reset(){this.segment=null;this.abscissa=this.segmentLength=0;this.isPartEnd=this.isPathEnd=!1}isValid(){return null!==this.segment}copyTo(f){f.segment=this.segment;f.segmentLength=this.segmentLength;f.abscissa=this.abscissa;f.isPathEnd=
this.isPathEnd;f.isPartEnd=this.isPartEnd}}class h extends q.CurveHelper{constructor(f=0,c=!1){super(f,c);this._tolerance=q.pixelTolerance;this._currentPosition=new k}updateTolerance(f){this._tolerance=q.pixelTolerance*f}init(f,c,e=!0){e?(this._patternLength=c.length(),this._partExtPtGap=c.extPtGap,this._partCtrlPtGap=c.ctrlPtGap):this._partCtrlPtGap=this._partExtPtGap=this._patternLength=0;this._currentPosition.reset();this._partSegCount=0;this._pathCursor=f;this._seg=-1;return this._setPosAtNextPart()}curPositionIsValid(){return this._currentPosition.isValid()}nextPosition(f,
c=a.EndType.FAIL){const e=new k;if(!this._nextPosition(f,e,null,c))return!1;e.copyTo(this._currentPosition);return!0}curPointAndAngle(f){f.pt=this._getPoint(this._currentPosition);const [c,e]=this._getAngleCS(this._currentPosition);f.ca=c;f.sa=e}nextPointAndAngle(f,c,e=a.EndType.FAIL){const g=new k;if(!this._nextPosition(f,g,null,e))return!1;g.copyTo(this._currentPosition);c.pt=this._getPoint(g);const [d,t]=this._getAngleCS(g);c.ca=d;c.sa=t;return!0}nextCurve(f){if(0===f)return null;const c=b.GeometryCursor.createEmptyOptimizedCIM("esriGeometryPolyline");
c.startPath();c.nextPath();const e=new k;if(!this._nextPosition(f,e,c,a.EndType.END))return null;e.copyTo(this._currentPosition);return c}isPathEnd(){return this._currentPosition.isPathEnd}getPathEnd(){return this._currentPosition.segment[1]}getPt(f){this._pathCursor.seekInPath(f);return[this._pathCursor.x,this._pathCursor.y]}getSeg(f){const c=this.getPt(f);f=this.getPt(f+1);return[c,f]}_nextPosition(f,c,e,g){if(this._currentPosition.isPathEnd)return!1;var d=this._currentPosition.abscissa;0<this._currentPosition.segmentLength&&
(d/=this._currentPosition.segmentLength);for(this._currentPosition.copyTo(c);c.abscissa+f*this._partLengthRatio>c.segmentLength+this._tolerance;)if(e&&(0===e.pathSize&&(0===d?(d=c.segment[0],e.pushXY(d[0],d[1])):e.pushPoint(this.getSegCoord2D(c.segment,d))),d=c.segment[1],e.pushXY(d[0],d[1])),d=0,f-=(c.segmentLength-c.abscissa)/this._partLengthRatio,this._partSegCount)c.segment=this._nextSegment(),c.segmentLength=this.getSegLength(c.segment),c.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart()){if(g===
a.EndType.FAIL)return!1;c.segmentLength=this.getSegLength(c.segment);c.isPartEnd=!0;g===a.EndType.END?(c.abscissa=c.segmentLength,c.isPathEnd=!0):c.abscissa=c.segmentLength+f;return!0}this._currentPosition.copyTo(c)}c.abscissa+=f*this._partLengthRatio;e&&(0===e.pathSize&&(0===d?e.pushPoint(c.segment[0]):e.pushPoint(this.getSegCoord2D(c.segment,d))),f=c.abscissa/c.segmentLength,1===f?e.pushPoint(c.segment[1]):e.pushPoint(this.getSegCoord2D(c.segment,f)));!this._partSegCount&&Math.abs(c.abscissa-c.segmentLength)<
this._tolerance&&(c.isPathEnd=this._partIsLast,c.isPartEnd=!0);return!0}_getPoint(f){return this.getSegCoord2D(this._currentPosition.segment,0>=f.segmentLength?0:f.abscissa/f.segmentLength)}_getAngleCS(f){return this.getSegAngleCS(this._currentPosition.segment,0>=f.segmentLength?0:f.abscissa/f.segmentLength)}_setPosAtNextPart(){for(;this._partSegCount;)this._hasNextSegment()&&this._nextSegment(),this._partSegCount--;if(!this._hasNextSegment())return!1;this._partLength=0;this._partIsLast=!0;for(this._partSegCount=
0;this._hasNextSegment();)if(this._partLength+=this.getSegLength(this._nextSegment()),this._partSegCount++,this._pathCursor.getControlPointAt(this._getEndPointIndex())){this._partIsLast=!this._hasNextSegment();break}for(var f=this._partSegCount;f;)this._previousSegment(),--f;this._currentPosition.segment=this._nextSegment();this._currentPosition.segmentLength=this.getSegLength(this._currentPosition.segment);this._currentPosition.abscissa=0;this._currentPosition.isPathEnd=this._currentPosition.isPartEnd=
!1;--this._partSegCount;f=this._getStartPointIndex();this._ctrlPtBegin=this._pathCursor.getControlPointAt(f);f=f+this._partSegCount+1;f>=this._pathCursor.pathSize&&(f=0);this._ctrlPtEnd=this._pathCursor.getControlPointAt(f);if(0<this._patternLength){f=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap;const c=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let e=Math.round((this._partLength-(f+c))/this._patternLength);0>=e&&(e=0<f+c?0:1);this._partLengthRatio=this._partLength/(f+c+e*
this._patternLength);.01>this._partLengthRatio&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg<this._pathCursor.pathSize-2}_previousSegment(){return this.getSeg(--this._seg)}_nextSegment(){return this.getSeg(++this._seg)}_getStartPointIndex(){return this._seg}_getEndPointIndex(){return this._seg+1}}a.DashPattern=l;a.GeometryWalker=h;a.Pos=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectDonut":function(){define("exports ../../../geometry ../../../geometry/GeometryCursor ../CIMEffects ../enums ../../../geometry/SpatialReference".split(" "),
function(a,b,q,l,p,k){class h{static local(){null===h.instance&&(h.instance=new h);return h.instance}execute(c,e,g,d,t,w){return new f(c,e,g,d,t,w)}}h.instance=null;class f{constructor(c,e,g,d,t,w){this._inputGeometries=c;this._tileKey=d;this._geometryEngine=t;this._maxInflateSize=w*g;this._width=(void 0!==e.width?e.width:2)*g;this._option=e.option}next(){for(var c;c=this._inputGeometries.next();){if("esriGeometryEnvelope"===c.geometryType&&0<this._width){var e=c.asJSON();return 0>Math.min(e.xmax-
e.xmin,e.ymax-e.ymin)-2*this._width?c:q.GeometryCursor.fromJSONCIM({paths:[[[e.xmin+this._width,e.ymin+this._width],[e.xmax-this._width,e.ymin+this._width],[e.xmax-this._width,e.ymax-this._width],[e.xmin+this._width,e.ymax-this._width],[e.xmin+this._width,e.ymin+this._width]],[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]})}if("esriGeometryPolygon"===c.geometryType){if(0===this._width)return c.clone();var g=this._geometryEngine;if(null==g)break;if(c=this._tileKey?
l.clipCursorToTileExtent(c,this._maxInflateSize):c.clone()){if(g=g.buffer(k.WebMercator,c.asJSON(),-this._width,1))for(e of g.rings)if(e){c.startPath();for(const d of e.reverse())c.pushXY(d[0],c.yFactor*d[1])}return c}}}return null}}a.EffectDonut=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectJog":function(){define(["exports","../../../geometry/GeometryCursor","../CIMCursor","../CurveHelper"],function(a,b,q,l){class p{static local(){null===p.instance&&
(p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h,f,c)}}p.instance=null;class k extends q.PathEffectCursor{constructor(h,f,c){super(h,!1,!0);this._curveHelper=new l.CurveHelper;this._length=(void 0!==f.length?f.length:20)*c;this._angle=void 0!==f.angle?f.angle:225;this._position=void 0!==f.position?f.position:50;0>this._length&&(this._length=-this._length);20>this._position&&(this._position=20);80<this._position&&(this._position=80);this._mirror=!1}processPath(h){const f=b.GeometryCursor.createEmptyOptimizedCIM("esriGeometryPolyline");
if(this._curveHelper.isEmpty(h))return null;h.seekInPath(0);const c=h.x,e=h.y;h.seekInPath(h.pathSize-1);const g=h.x;h=h.y;this._curveHelper.normalize([g-c,h-e]);const d=c+(g-c)*this._position/100,t=e+(h-e)*this._position/100,w=Math.cos((90-this._angle)/180*Math.PI);let v=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(v=-v);this._mirror=!this._mirror;f.pushPath([[c,e],[d-this._length/2*w,t-this._length/2*v],[d+this._length/2*w,t+this._length/2*v],[g,h]]);return f}}a.EffectJog=p;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectMove":function(){define(["exports"],function(a){class b{static local(){null===b.instance&&(b.instance=new b);return b.instance}execute(l,p,k,h,f){return new q(l,p,k)}}b.instance=null;class q{constructor(l,p,k){this._inputGeometries=l;this._offsetX=void 0!==p.offsetX?p.offsetX*k:0;this._offsetY=void 0!==p.offsetY?p.offsetY*k:0}next(){let l=this._inputGeometries.next();for(;l;){if(0<l.totalSize)return this._move(l.clone(),this._offsetX,
this._offsetY);l=this._inputGeometries.next()}return null}_move(l,p,k){for(;l.nextPath();)for(;l.nextPoint();)l.x+=p,l.y+=k;l.reset();return l}}a.EffectMove=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectOffset":function(){define("exports ../../../geometry ../../../geometry/GeometryCursor ../../../geometry/geometryCursorCollectUtils ../../../geometry/support/jsonUtils ../CIMEffects ../CurveHelper ../enums ../../../geometry/SpatialReference".split(" "),
function(a,b,q,l,p,k,h,f,c){class e{static local(){null===e.instance&&(e.instance=new e);return e.instance}execute(d,t,w,v,m,r){return new g(d,t,w,v,m,r)}}e.instance=null;class g{constructor(d,t,w,v,m,r){this._inputGeometries=d;this._tileKey=v;this._geometryEngine=m;this._curveHelper=new h.CurveHelper;this._offset=(t.offset??1)*w;this._method=t.method;this._maxInflateSize=Math.max(Math.abs(r*w),10);this._option=t.option;this._offsetFlattenError=h.pixelTolerance*w}next(){for(var d;d=this._inputGeometries.next();){if(0===
this._offset)return d.clone();if("esriGeometryEnvelope"===d.geometryType){if(this._method===f.GeometricEffectOffsetMethod.Rounded&&0<this._offset){var t=l.collectPath(d);if(t=this._curveHelper.offset(t,-this._offset,this._method,4,this._offsetFlattenError))return d=q.GeometryCursor.createEmptyOptimizedCIM(d.geometryType),d.pushPath(t),d;break}t=d.asJSON();if(p.isExtent(t)&&0<Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._offset)return q.GeometryCursor.fromJSONCIM({xmin:t.xmin-this._offset,xmax:t.xmax+
this._offset,ymin:t.ymin-this._offset,ymax:t.ymax+this._offset})}t=this._geometryEngine;if(null!=t&&(d=this._tileKey?k.clipCursorToTileExtent(d,this._maxInflateSize):d.clone()))return(d=t.offset(c.WebMercator,d.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError))?q.GeometryCursor.fromJSONCIM(d):null}return null}}a.EffectOffset=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectReverse":function(){define(["exports"],function(a){class b{static local(){null===
b.instance&&(b.instance=new b);return b.instance}execute(l,p,k,h,f){return new q(l,p,k)}}b.instance=null;class q{constructor(l,p,k){this._inputGeometries=l;this._reverse=void 0!==p.reverse?p.reverse:!0}next(){for(var l=this._inputGeometries.next();l;){if(!this._reverse)return l;if("esriGeometryPolyline"===l.geometryType){for(l=l.clone();l.nextPath();)for(let p=0;p<l.pathSize/2;p++){l.seekInPath(p);const k=l.x,h=l.y;l.seekInPath(l.pathSize-p-1);const f=l.x,c=l.y;l.x=k;l.y=h;l.seekInPath(p);l.x=f;l.y=
c}l.reset();return l}l=this._inputGeometries.next()}return null}}a.EffectReverse=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectRotate":function(){define(["exports","../../../geometry/support/boundsUtils"],function(a,b){class q{static local(){null===q.instance&&(q.instance=new q);return q.instance}execute(p,k,h,f,c){return new l(p,k,h)}}q.instance=null;class l{constructor(p,k,h){this._inputGeometries=p;this._rotateAngle=void 0!==k.angle?k.angle*Math.PI/
180:0}next(){let p=this._inputGeometries.next();for(;p;){if(0===this._rotateAngle||"esriGeometryPoint"===p.geometryType)return p;if(0<p.totalSize){var k=b.getCursorBoundsXY(p);const h=(k[2]+k[0])/2;k=(k[3]+k[1])/2;p.reset();return this._rotate(p.clone(),h,k)}p=this._inputGeometries.next()}return null}_rotate(p,k,h){const f=Math.cos(this._rotateAngle),c=Math.sin(this._rotateAngle);for(;p.nextPath();)for(;p.nextPoint();){const e=p.x-k,g=p.y-h;p.x=k+e*f-g*c;p.y=h+e*c+g*f}p.reset();return p}}a.EffectRotate=
q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectScale":function(){define(["exports","../../../geometry/support/boundsUtils"],function(a,b){class q{static local(){null===q.instance&&(q.instance=new q);return q.instance}execute(p,k,h,f,c){return new l(p,k,h)}}q.instance=null;class l{constructor(p,k,h){this._inputGeometries=p;this._xFactor=void 0!==k.xScaleFactor?k.xScaleFactor:1.15;this._yFactor=void 0!==k.yScaleFactor?k.yScaleFactor:1.15}next(){const p=
this._inputGeometries.next();if(p){if(1===this._xFactor&&1===this._yFactor||"esriGeometryPoint"===p.geometryType)return p;if(0<p.totalSize){var k=b.getCursorBoundsXY(p);const h=(k[2]+k[0])/2;k=(k[3]+k[1])/2;p.reset();return this._scaleCursor(p.clone(),h,k)}}return null}_scaleCursor(p,k,h){for(;p.nextPath();)for(;p.nextPoint();)p.x=k+(p.x-k)*this._xFactor,p.y=h+(p.y-h)*this._yFactor;p.reset();return p}}a.EffectScale=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectWave":function(){define(["exports",
"../../../geometry/GeometryCursor","../enums","../GeometryWalker"],function(a,b,q,l){class p{static local(){null===p.instance&&(p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h,f,c)}}p.instance=null;class k{constructor(h,f,c){this._inputGeometries=h;this._height=(void 0!==f.amplitude?f.amplitude:2)*c;this._period=(void 0!==f.period?f.period:3)*c;this._style=f.waveform;0>=this._height&&(this._height=Math.abs(this._height));0>=this._period&&(this._period=Math.abs(this._period));
this._pattern=new l.DashPattern;this._pattern.addValue(this._period);this._pattern.addValue(this._period);this._walker=new l.GeometryWalker;this._walker.updateTolerance(c)}next(){for(var h=this._inputGeometries.next();h;){if(0===this._height||0===this._period||(h=this._processGeom(h)))return h;h=this._inputGeometries.next()}return null}_processGeom(h){const f=b.GeometryCursor.createEmptyOptimizedCIM(h.geometryType);for(;h.nextPath();){f.startPath();const c=h.pathLength();if(this._walker.init(h,this._pattern))switch(this._style){default:this._constructCurve(f,
c,!1);break;case q.GeometricEffectWaveform.Square:this._constructSquare(f,c);break;case q.GeometricEffectWaveform.Triangle:this._constructTriangle(f,c);break;case q.GeometricEffectWaveform.Random:this._constructCurve(f,c,!0)}else for(;h.nextPoint();)f.pushXY(h.x,h.y)}return f}_constructCurve(h,f,c){var e=Math.round(f/this._period);0===e&&(e=1);const g=this._period/16,d=1/(16*e+1);f=2*Math.PI*f/(f/e);e=2*Math.PI*Math.random();const t=2*Math.PI*Math.random(),w=2*Math.PI*Math.random(),v=.75-Math.random()/
2,m=.75-Math.random()/2,r=new l.Pos;this._walker.curPointAndAngle(r);h.pushPoint(r.pt);let n=0;for(;;)if(this._walker.nextPointAndAngle(g,r)){const u=n;n+=d;let x;if(c){const y=this._height/2*(1+.3*Math.sin(v*f*u+e));x=y*Math.sin(f*u+t);x+=y*Math.sin(m*f*u+w);x/=2}else x=.5*this._height*Math.sin(.5*f*u);h.pushXY(r.pt[0]-x*r.sa,r.pt[1]+x*r.ca)}else{h.pushPoint(this._walker.getPathEnd());break}}_constructSquare(h,f){Math.round(f/this._period);for(f=!0;;){let c=!1;if(this._walker.curPositionIsValid()){const e=
new l.Pos;this._walker.curPointAndAngle(e);const g=new l.Pos;if(this._walker.nextPointAndAngle(this._period,g)){const d=new l.Pos;this._walker.nextPointAndAngle(this._period,d)&&(f?(h.pushPoint(e.pt),f=!1):h.pushPoint(e.pt),h.pushXY(e.pt[0]-this._height/2*e.sa,e.pt[1]+this._height/2*e.ca),h.pushXY(g.pt[0]-this._height/2*g.sa,g.pt[1]+this._height/2*g.ca),h.pushXY(g.pt[0]+this._height/2*g.sa,g.pt[1]-this._height/2*g.ca),h.pushXY(d.pt[0]+this._height/2*d.sa,d.pt[1]-this._height/2*d.ca),c=!0)}}if(!c){h.pushPoint(this._walker.getPathEnd());
break}}}_constructTriangle(h,f){Math.round(f/this._period);for(f=!0;;){let c=!1;if(this._walker.curPositionIsValid()){const e=new l.Pos;this._walker.curPointAndAngle(e);const g=new l.Pos;if(this._walker.nextPointAndAngle(this._period/2,g)){const d=new l.Pos;this._walker.nextPointAndAngle(this._period,d)&&(this._walker.nextPosition(this._period/2)&&(f?(h.pushPoint(e.pt),f=!1):h.pushPoint(e.pt),h.pushXY(g.pt[0]-this._height/2*g.sa,g.pt[1]+this._height/2*g.ca),h.pushXY(d.pt[0]+this._height/2*d.sa,d.pt[1]-
this._height/2*d.ca)),c=!0)}}if(!c){h.pushPoint(this._walker.getPathEnd());break}}}}a.EffectWave=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementAlongLineSameSize":function(){define(["exports","../CIMCursor","../enums","../GeometryWalker"],function(a,b,q,l){class p{static local(){null===p.instance&&(p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h,f,c)}}p.instance=null;class k extends b.PathTransformationCursor{constructor(h,
f,c){super(h);this._geometryWalker=new l.GeometryWalker;this._geometryWalker.updateTolerance(c);this._angleToLine=f.angleToLine??!0;this._offset=(f.offset?f.offset:0)*c;this._originalEndings=f.endings;this._offsetAtEnd=(f.customEndingOffset?f.customEndingOffset:0)*c;this._position=-(f.offsetAlongLine?f.offsetAlongLine:0)*c;this._pattern=new l.DashPattern;this._pattern.init(f.placementTemplate,!1);this._pattern.scale(c);this._endings=this._originalEndings}processPath(h){if(this._pattern.isEmpty())return null;
if(this.iteratePath)var f=this._pattern.nextValue();else{this._endings=this._originalEndings===q.PlacementEndings.WithFullGap&&this.isClosed?q.PlacementEndings.WithMarkers:this._originalEndings;this._pattern.extPtGap=0;let c=!0;switch(this._endings){case q.PlacementEndings.NoConstraint:f=-this._position;f=this._adjustPosition(f);c=!1;break;default:f=-this._pattern.lastValue()/2;break;case q.PlacementEndings.WithFullGap:f=-this._pattern.lastValue();this._pattern.extPtGap=this._pattern.lastValue();
break;case q.PlacementEndings.WithMarkers:f=0;break;case q.PlacementEndings.Custom:f=-this._position,f=this._adjustPosition(f),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(h,this._pattern,c))return null;this._pattern.reset();for(h=0;f>h;)f-=h,h=this._pattern.nextValue();f=h-f;this.iteratePath=!0}h=new l.Pos;if(!this._geometryWalker.nextPointAndAngle(f,h)||this._endings===q.PlacementEndings.WithFullGap&&this._geometryWalker.isPathEnd())return this.iteratePath=!1,null;if(this._endings===
q.PlacementEndings.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed))return null;this.internalPlacement.setTranslate(h.pt[0]-this._offset*h.sa,h.pt[1]+this._offset*h.ca);this._angleToLine&&this.internalPlacement.setRotateCS(h.ca,h.sa);return this.internalPlacement}_adjustPosition(h){h/=this._pattern.length();h-=Math.floor(h);return h*this._pattern.length()}}a.PlacementAlongLineSameSize=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementAtExtremities":function(){define(["exports",
"../CIMCursor","../CurveHelper","../enums"],function(a,b,q,l){class p{static local(){null===p.instance&&(p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h,f,c)}}p.instance=null;class k extends b.PathTransformationCursor{constructor(h,f,c){super(h,!1,!0);this._curveHelper=new q.CurveHelper;this._placePerPart=f.placePerPart??!1;this._angleToLine=void 0!==f.angleToLine?f.angleToLine:!0;this._offset=void 0!==f.offset?f.offset*c:0;this._type=f.extremityPlacement;this._position=void 0!==
f.offsetAlongLine?f.offsetAlongLine*c:0;this._beginProcessed=!1}processMultiPath(h){return this._placePerPart?super.processMultiPath(h):this.processPath(h)}processPath(h){let f;switch(this._type){default:this._beginProcessed?(f=this._atExtremities(h,this._position,!1),this.iteratePath=this.iterateMultiPath=this._beginProcessed=!1):(f=this._atExtremities(h,this._position,!0),this.iteratePath=this.iterateMultiPath=this._beginProcessed=!0);break;case l.ExtremityPlacement.JustBegin:f=this._atExtremities(h,
this._position,!0);break;case l.ExtremityPlacement.JustEnd:f=this._atExtremities(h,this._position,!1);case l.ExtremityPlacement.None:}return f}_atExtremities(h,f,c){this._placePerPart||(c?h.seekPath(0):h.seekPath(h.totalSize-1));c||h.seekPathEnd();if(c?h.nextPoint():h.prevPoint()){let e=0,[g,d]=[0,0],[t,w]=[h.x,h.y];for(;c?h.nextPoint():h.prevPoint();){g=t;d=w;t=h.x;w=h.y;const v=this._curveHelper.getLength(g,d,t,w);if(e+v>f){h=(f-e)/v;const [m,r]=this._curveHelper.getAngleCS(g,d,t,w,h);h=this._curveHelper.getCoord2D(g,
d,t,w,h);this.internalPlacement.setTranslate(h[0]-this._offset*r,h[1]+this._offset*m);this._angleToLine&&this.internalPlacement.setRotateCS(-m,-r);return this.internalPlacement}e+=v}}return null}}a.PlacementAtExtremities=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementAtRatioPositions":function(){define(["exports","../CIMCursor","../GeometryWalker"],function(a,b,q){class l{static local(){null===l.instance&&(l.instance=new l);return l.instance}execute(k,
h,f,c,e){return new p(k,h,f)}}l.instance=null;class p extends b.PathTransformationCursor{constructor(k,h,f){super(k);this._walker=new q.GeometryWalker;this._walker.updateTolerance(f);this._angleToLine=void 0!==h.angleToLine?h.angleToLine:!0;this._offset=void 0!==h.offset?h.offset*f:0;this._beginGap=void 0!==h.beginPosition?h.beginPosition*f:0;this._endGap=void 0!==h.endPosition?h.endPosition*f:0;this._flipFirst=void 0!==h.flipFirst?h.flipFirst:!0;this._pattern=new q.DashPattern;this._pattern.init(h.positionArray,
!1,!1);this._subPathLen=0;this._posCount=this._pattern.size();this._isFirst=!0;this._prevPos=0}processPath(k){if(this._pattern.isEmpty())return null;if(this.iteratePath){k=this._pattern.nextValue()*this._subPathLen;var h=this._beginGap+k;k=h-this._prevPos;this._prevPos=h}else{this._posCount=this._pattern.size();this._isFirst=!0;this._prevPos=0;this._subPathLen=k.pathLength()-this._beginGap-this._endGap;if(0>this._subPathLen)return this.iteratePath=!1,null;if(!this._walker.init(k,this._pattern,!1))return null;
this._pattern.reset();k=this._pattern.nextValue()*this._subPathLen;h=this._beginGap+k;k=h-this._prevPos;this._prevPos=h;this.iteratePath=!0}h=new q.Pos;if(!this._walker.nextPointAndAngle(k,h,q.EndType.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(h.pt[0]-this._offset*h.sa,h.pt[1]+this._offset*h.ca);k=this._isFirst&&this._flipFirst;let f;this._angleToLine?(f=h.ca,h=h.sa):(f=1,h=0);k&&(f=-f,h=-h);this.internalPlacement.setRotateCS(f,h);this._isFirst=!1;this._posCount--;0===
this._posCount&&(this.iteratePath=!1);return this.internalPlacement}}a.PlacementAtRatioPositions=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementInsidePolygon":function(){define(["exports","../../../core/RandomLCG","../CIMPlacements","../enums"],function(a,b,q,l){class p{static local(){null===p.instance&&(p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h,f,c,e,g)}}p.instance=null;class k{constructor(h,f,c,e,g){this._currentY=
this._currentX=this._yMax=this._yMin=this._xMax=this._xMin=0;this._accelerationMap=null;this._testInsidePolygon=!1;this._verticalSubdivision=!0;this._stepX=Math.abs(f.stepX??16)*c;this._stepY=Math.abs(f.stepY??16)*c;this._stepX=Math.round(128*this._stepX)/128;this._stepY=Math.round(128*this._stepY)/128;if(0!==this._stepX&&0!==this._stepY){this._gridType=f.gridType??l.PlacementGridType.Fixed;if(this._gridType===l.PlacementGridType.Random)this._randomLCG=new b(1*(f.seed??13)),this._randomness=(f.randomness??
100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._offsetY=this._offsetX=this._sinAngle=0,this._buildRandomValues();else{this._randomness=0;this._gridAngle=f.gridAngle??0;this._shiftOddRows=f.shiftOddRows??!1;this._offsetX=(f.offsetX??0)*c;this._offsetY=(f.offsetY??0)*c;this._cosAngle=Math.cos(this._gridAngle/180*Math.PI);this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI);if(this._stepX)if(0>this._offsetX)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=
.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(0>this._offsetY)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}this._graphicOriginY=this._graphicOriginX=0;if(null!=e){const [d,t,w,v]=e.split("/");f=parseFloat(d);c=parseFloat(t);e=parseFloat(w);this._graphicOriginX=512*-(parseFloat(v)*2**f+e);this._graphicOriginY=512*c;this._testInsidePolygon=!0}this._internalPlacement=new q.Placement;this._calculateMinMax(h);
this._geometryCursor=h}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!k._randValues){k._randValues=[];for(let h=0;24>h;h++)for(let f=0;24>f;f++)k._randValues.push(this._randomLCG.getFloat()),k._randValues.push(this._randomLCG.getFloat())}}_calculateMinMax(h){this._yMax=this._yMin=this._xMax=this._xMin=0;let f,c,e,g,d,t,w,v;f=c=w=d=Number.MAX_VALUE;e=g=v=t=-Number.MAX_VALUE;var m=1!==this._cosAngle;for(h.reset();h.nextPath();)for(;h.nextPoint();){var r=h.x;var n=
h.y;var u=r-this._graphicOriginX-this._offsetX;var x=n-this._graphicOriginY-this._offsetY;if(m){var y=this._cosAngle*u-this._sinAngle*x;u=this._sinAngle*u+this._cosAngle*x}else y=u,u=x;f=Math.min(f,y);e=Math.max(e,y);c=Math.min(c,u);g=Math.max(g,u);d=Math.min(d,n);t=Math.max(t,n);w=Math.min(w,r);v=Math.max(v,r)}d=d!==Number.MAX_VALUE?d:-512-this._stepY;t=t!==-Number.MAX_VALUE?t:this._stepY;w=w!==Number.MAX_VALUE?w:-this._stepX;v=v!==-Number.MAX_VALUE?v:512+this._stepX;this._polygonMin=(this._verticalSubdivision=
t-d>=v-w)?d:w;if(this._testInsidePolygon){y=0-this._graphicOriginX-this._offsetX-this._stepX;n=512-this._graphicOriginX-this._offsetX+this._stepX;r=-512-this._graphicOriginY-this._offsetY-this._stepY;u=0-this._graphicOriginY-this._offsetY+this._stepY;if(m){m=[[y,r],[y,u],[n,r],[n,u]];y=r=Number.MAX_VALUE;n=u=-Number.MAX_VALUE;for(const z of m)m=this._cosAngle*z[0]-this._sinAngle*z[1],x=this._sinAngle*z[0]+this._cosAngle*z[1],y=Math.min(y,m),n=Math.max(n,m),r=Math.min(r,x),u=Math.max(u,x)}f=f!==Number.MAX_VALUE?
Math.max(f,y):y;c=c!==Number.MAX_VALUE?Math.max(c,r):r;e=e!==-Number.MAX_VALUE?Math.min(e,n):n;g=g!==-Number.MAX_VALUE?Math.min(g,u):u}this._xMin=Math.round(f/this._stepX);this._xMax=Math.round(e/this._stepX);this._yMin=Math.round(c/this._stepY);this._yMax=Math.round(g/this._stepY);this._currentX=this._xMax+1;this._currentY=this._yMin-1;this._buildAccelerationMap(h,w,v,d,t)}_buildAccelerationMap(h,f,c,e,g){h.reset();const d=new Map,t=this._verticalSubdivision;c=t?g-e:c-f;g=Math.ceil(c/10);if(!(1>=
g)){c=Math.floor(c/g);g++;this._delta=c;var w,v;if(t){g=-512-2*this._stepY;var m=2*this._stepY;var r=e}else g=-2*this._stepX,m=512+2*this._stepX,r=f;for(;h.nextPath();)if(!(2>h.pathSize)&&h.nextPoint()){var n=h.x;for(w=h.y;h.nextPoint();n=f,w=e){f=h.x;e=h.y;if(t){if(w===e||w<g&&e<g||w>m&&e>m)continue;var u=Math.min(w,e);var x=Math.max(w,e)}else{if(n===f||n<g&&f<g||n>m&&f>m)continue;u=Math.min(n,f);x=Math.max(n,f)}for(;u<x;){var y=v=Math.floor((u-r)/c),z=n,A=w,B=f,C=e,D=d;let F=D.get(y);F||(F=[],D.set(y,
F));F.push([[z,A],[B,C]]);u+=c}u=Math.floor((x-r)/c);u>v&&(x=f,y=e,z=d,A=z.get(u),A||(A=[],z.set(u,A)),A.push([[n,w],[x,y]]))}}this._accelerationMap=d}}_nextInside(){for(;;){if(this._currentX>this._xMax){this._currentY++;if(this._currentY>this._yMax)return null;this._currentX=this._xMin;this._shiftOddRows&&this._currentY%2&&this._currentX--}var h=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(h+=.5*this._stepX);const f=this._currentY*this._stepY+this._offsetY;this._currentX++;
let c;if(this._gridType===l.PlacementGridType.Random){const e=(this._currentX%24+24)%24,g=(this._currentY%24+24)%24;c=this._graphicOriginX+h+this._stepX*this._randomness*(.5-k._randValues[24*g+e])*2/3;h=this._graphicOriginY+f+this._stepY*this._randomness*(.5-k._randValues[24*g+e+1])*2/3}else c=this._graphicOriginX+this._cosAngle*h+this._sinAngle*f,h=this._graphicOriginY-this._sinAngle*h+this._cosAngle*f;if(!this._testInsidePolygon||this._isInsidePolygon(c,h,this._geometryCursor))return this._internalPlacement.setTranslate(c,
h),this._internalPlacement}}_isInsidePolygon(h,f,c){if(null==this._accelerationMap){var e=0,g;let w;h+=1E-6;f+=1E-6;for(c.reset();c.nextPath();)if(c.nextPoint()){var d=c.x;for(g=c.y;c.nextPoint();d=t,g=w){var t=c.x;w=c.y;g>f!==w>f&&(0<(t-d)*(f-g)-(w-g)*(h-d)?e++:e--)}}return 0!==e}h+=1E-6;f+=1E-6;c=this._verticalSubdivision;g=this._accelerationMap.get(Math.floor(((c?f:h)-this._polygonMin)/this._delta));if(!g)return!1;d=0;for(e of g){g=e[0];t=e[1];if(c){if(g[1]>f===t[1]>f)continue;g=(t[0]-g[0])*(f-
g[1])-(t[1]-g[1])*(h-g[0])}else{if(g[0]>h===t[0]>h)continue;g=(t[1]-g[1])*(h-g[0])-(t[0]-g[0])*(f-g[1])}0<g?d++:d--}return 0!==d}}a.PlacementInsidePolygon=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementOnLine":function(){define(["exports","../CIMCursor","../CurveHelper","../enums"],function(a,b,q,l){class p{static local(){null===p.instance&&(p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h,f,c)}}p.instance=null;class k extends b.PathTransformationCursor{constructor(h,
f,c){super(h);this._curveHelper=new q.CurveHelper;this._angleToLine=void 0!==f.angleToLine?f.angleToLine:!0;this._offset=void 0!==f.offset?f.offset*c:0;this._relativeTo=f.relativeTo;this._position=void 0!==f.startPointOffset?f.startPointOffset*c:0;this._epsilon=.001*c}processPath(h){var f=this._position;if(this._relativeTo===l.PlacementOnLineRelativeTo.SegmentMidpoint){this.iteratePath||(this.iteratePath=!0);if(h.nextPoint()){let [c,e]=[h.x,h.y],[g,d]=[0,0];for(;h.nextPoint();){g=h.x;d=h.y;f=this._curveHelper.getLength(c,
e,g,d);if(f<this._epsilon){c=g;e=d;continue}h=.5+this._position/f;const [t,w]=this._curveHelper.getAngleCS(c,e,g,d,h);h=this._curveHelper.getCoord2D(c,e,g,d,h);this.internalPlacement.setTranslate(h[0]-this._offset*w,h[1]+this._offset*t);this._angleToLine&&this.internalPlacement.setRotateCS(t,w);return this.internalPlacement}}this.iteratePath=!1;return null}return this.onLine(h,f,this._relativeTo===l.PlacementOnLineRelativeTo.LineEnd)}onLine(h,f,c){let e=!1;switch(this._relativeTo){default:h.seekPathStart();
f=h.pathLength()/2+f;break;case l.PlacementOnLineRelativeTo.LineBeginning:break;case l.PlacementOnLineRelativeTo.LineEnd:e=!0}c?h.seekPathEnd():h.seekPathStart();let g=0;if(c?h.prevPoint():h.nextPoint()){let [d,t]=[h.x,h.y],[w,v]=[0,0];for(;c?h.prevPoint():h.nextPoint();){w=h.x;v=h.y;const m=this._curveHelper.getLength(d,t,w,v);if(g+m>f){h=(f-g)/m;const [r,n]=this._curveHelper.getAngleCS(d,t,w,v,h);h=this._curveHelper.getCoord2D(d,t,w,v,h);c=e?-this._offset:this._offset;this.internalPlacement.setTranslate(h[0]-
c*n,h[1]+c*r);this._angleToLine&&(e?this.internalPlacement.setRotateCS(-r,-n):this.internalPlacement.setRotateCS(r,n));return this.internalPlacement}d=w;t=v;g+=m}}return null}}a.PlacementOnLine=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementOnVertices":function(){define(["exports","../CIMCursor","../CurveHelper"],function(a,b,q){function l(h,f){const c=Math.PI;for(;Math.abs(f-h)>c+2E-15;)f=f-h>c?f-2*c:f+2*c;return(h+f)/2}class p{static local(){null===
p.instance&&(p.instance=new p);return p.instance}execute(h,f,c,e,g){return new k(h,f,c)}}p.instance=null;class k extends b.PathTransformationCursor{constructor(h,f,c){super(h);this._curveHelper=new q.CurveHelper;this._angleToLine=void 0!==f.angleToLine?f.angleToLine:!0;this._offset=void 0!==f.offset?f.offset*c:0;this._endPoints=void 0!==f.placeOnEndPoints?f.placeOnEndPoints:!0;this._controlPoints=void 0!==f.placeOnControlPoints?f.placeOnControlPoints:!0;this._regularVertices=void 0!==f.placeOnRegularVertices?
f.placeOnRegularVertices:!0;this._tags=[];this._tagIterator=0}processPath(h){this.iteratePath||(this._preparePath(h),this.iteratePath=!0);if(this._tagIterator>=this._tags.length)return this._tagIterator=this._tags.length=0,this.iteratePath=!1,null;h=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(h[2]);let f=h[0],c=h[1];if(0!==this._offset){const e=Math.cos(h[2]);f-=this._offset*Math.sin(h[2]);c+=this._offset*e}this.internalPlacement.setTranslate(f,c);this._tagIterator++;
return this.internalPlacement}_preparePath(h){this._tagIterator=this._tags.length=0;h.seekPathStart();const f=h.isClosed();let c=0,e=!1,g=0,d=0;h.seekPathStart();if(h.nextPoint()){let t=h.x,w=h.y,v=h.getControlPoint(),m=!0,r=h.nextPoint();for(;r;){const n=h.x,u=h.y,x=h.getControlPoint();if(this._angleToLine||0!==this._offset)g=this._curveHelper.getAngle(t,w,n,u,0);m?(m=!1,f?(c=g,e=v):(this._endPoints||this._controlPoints&&v)&&this._tags.push([t,w,g])):v?this._controlPoints&&this._tags.push([t,w,l(d,
g)]):this._regularVertices&&this._tags.push([t,w,l(d,g)]);if(this._angleToLine||0!==this._offset)d=this._curveHelper.getAngle(t,w,n,u,1);(r=h.nextPoint())||(f?x||e?this._controlPoints&&this._tags.push([n,u,l(d,c)]):this._regularVertices&&this._tags.push([n,u,l(d,c)]):(this._endPoints||this._controlPoints&&x)&&this._tags.push([n,u,d]));t=n;w=u;v=x}}this._tagIterator=0}}a.PlacementOnVertices=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementPolygonCenter":function(){define("exports ../../../geometry/support/boundsUtils ../../../geometry/support/centroid ../../../geometry/support/labelPoint ../CIMPlacements ../enums".split(" "),
function(a,b,q,l,p,k){class h{static local(){null===h.instance&&(h.instance=new h);return h.instance}execute(c,e,g,d,t){return new f(c,e,g)}}h.instance=null;class f{constructor(c,e,g){this._geometryCursor=c;this._offsetX=void 0!==e.offsetX?e.offsetX*g:0;this._offsetY=void 0!==e.offsetY?e.offsetY*g:0;this._method=void 0!==e.method?e.method:k.PlacementPolygonCenterMethod.OnPolygon;this._internalPlacement=new p.Placement}next(){const c=this._geometryCursor;this._geometryCursor=null;return c?this._polygonCenter(c):
null}_polygonCenter(c){let e=!1;switch(this._method){case k.PlacementPolygonCenterMethod.CenterOfMass:if(c=q.weightedAreaCentroid(c))this._internalPlacement.setTranslate(c[0]+this._offsetX,c[1]+this._offsetY),e=!0;break;case k.PlacementPolygonCenterMethod.BoundingBoxCenter:if(c=b.getCursorBoundsXY(c))this._internalPlacement.setTranslate((c[2]+c[0])/2+this._offsetX,(c[3]+c[1])/2+this._offsetY),e=!0;break;default:c=l.getLabelPoint(c),null!==c&&(this._internalPlacement.setTranslate(c[0]+this._offsetX,
c[1]+this._offsetY),e=!0)}return e?this._internalPlacement:null}}a.PlacementPolygonCenter=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/labelPoint":function(){define("exports ../../core/PriorityQueue ./aaBoundingRect ./boundsUtils ./centroid ./coordsUtils ./intersectsBase".split(" "),function(a,b,q,l,p,k,h){function f(v,m){let r=0,n,u,x,y;for(m.reset();m.nextPath()&&m.nextPoint();)for(n=m.x,u=m.y;m.nextPoint();n=x,u=y)x=m.x,y=m.y,u>v[1]!==y>v[1]&&(0<(x-n)*
(v[1]-u)-(y-u)*(v[0]-n)?r++:r--);return 0!==r}function c(v,m,r){if(r&&f(v,m))return{coord:v,distance:0};r=Infinity;let n=0,u=0;var x=[0,0];let y=[0,0];const z=[0,0];for(m.reset();m.nextPath()&&m.nextPoint();)if(!(2>m.pathSize))for(x[0]=m.x,x[1]=m.y;m.nextPoint();x=y)y=[m.x,m.y],k.projectPointOnLineSeg(z,v,x,y),x=d(v,z),x<r&&(r=x,n=z[0],u=z[1]);return{coord:[n,u],distance:Math.sqrt(r)}}function e(v,m,r,n){r=[m,0];let u=Infinity,x=Infinity,y=!1,z=!1;m=[[m,n[1]-1],[m,n[3]+1]];n=[0,0];const A=[0,0],B=
[0,0],C=[[0,0],[0,0]],D=q.create();for(v.reset();v.nextPath()&&v.nextPoint();)if(!(2>v.pathSize))for(C[0][0]=v.x,C[0][1]=v.y;v.nextPoint();C[0][0]=C[1][0],C[0][1]=C[1][1]){C[1][0]=v.x;C[1][1]=v.y;a:{var F=D;var H=C;if(2>H.length){F=null;break a}F||=q.create();const [E,G]=H[0],[I,O]=H[1];F[0]=Math.min(E,I);F[1]=Math.min(G,O);F[2]=Math.max(E,I);F[3]=Math.max(G,O)}if(null!==F){A[0]=m[0][0];A[1]=m[0][1];B[0]=m[1][0];B[1]=m[1][1];a:{F=D;H=A;var N=B;let E=g(H,F),G=g(N,F);const I=F[0],O=F[1],L=F[2],P=F[3];
if(E&G){F=0;break a}if(!(E|G)){F=4;break a}const M=(E?1:0)|(G?2:0);do{const K=N[0]-H[0],J=N[1]-H[1];if(K>J)E&3?(E&1?(H[1]+=J*(I-H[0])/K,H[0]=I):(H[1]+=J*(L-H[0])/K,H[0]=L),E=g(H,F)):G&3?(G&1?(N[1]+=J*(I-N[0])/K,N[0]=I):(N[1]+=J*(L-N[0])/K,N[0]=L),G=g(N,F)):E?(E&4?(H[0]+=K*(O-H[1])/J,H[1]=O):(H[0]+=K*(P-H[1])/J,H[1]=P),E=g(H,F)):(G&4?(N[0]+=K*(O-N[1])/J,N[1]=O):(N[0]+=K*(P-N[1])/J,N[1]=P),G=g(N,F));else if(E&12?(E&4?(H[0]+=K*(O-H[1])/J,H[1]=O):(H[0]+=K*(P-H[1])/J,H[1]=P),E=g(H,F)):G&12?(G&4?(N[0]+=
K*(O-N[1])/J,N[1]=O):(N[0]+=K*(P-N[1])/J,N[1]=P),G=g(N,F)):E?(E&1?(H[1]+=J*(I-H[0])/K,H[0]=I):(H[1]+=J*(L-H[0])/K,H[0]=L),E=g(H,F)):(G&1?(N[1]+=J*(I-N[0])/K,N[0]=I):(N[1]+=J*(L-N[0])/K,N[0]=L),G=g(N,F)),E&G){F=0;break a}}while(E|G);F=M}0!==F&&h.segmentIntersects(m[0],m[1],C[0],C[1],n)&&(F=n[1],u>x?F<u&&(u=F,y=!0):F<x&&(x=F,z=!0))}}y&&z?r[1]=(u+x)/2:r[0]=r[1]=NaN;return r}function g(v,m){return(v[0]<m[0]?1:0)|(v[0]>m[2]?1:0)<<1|(v[1]<m[1]?1:0)<<2|(v[1]>m[3]?1:0)<<3}function d(v,m){return(v[0]-m[0])*
(v[0]-m[0])+(v[1]-m[1])*(v[1]-m[1])}function t(v,m){if(v<m)return-1;if(v>m)return 1;if(v===m)return 0;v=isNaN(v);m=isNaN(m);return v<m?-1:v>m?1:0}class w{constructor(v,m,r,n){this.x=v;this.y=m;this.cellSize=r;this.distancefromCellCenter=k.distanceFromPointToPolygon(v,m,n);this.maxDistanceToPolygon=this.distancefromCellCenter+this.cellSize*Math.SQRT2}}a.getLabelPoint=function(v){if(0===v.totalSize)return null;var m=l.getCursorBoundsXY(v);if(!m)return null;var r=8.8818E-14*(Math.abs(m[0])+Math.abs(m[2])+
Math.abs(m[1])+Math.abs(m[3])+1),n=0,u=0;v.reset();for(var x=0;v.nextPath();x++){var y=v.getCurrentRingArea();y>u&&(u=y,n=x)}v.seekPath(n);if(0===v.pathSize)return null;v.seekPathStart();y=l.getCursorPathBounds(v);if(Math.abs(u)<=2*r*r)return[(y[0]+y[2])/2,(y[1]+y[3])/2];v.seekPathStart();var z=p.ringCentroidCursorXY(v,q.create());if(null===z)return null;if(4>v.totalPoints)return z;u=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]];n=[NaN,NaN,NaN,NaN];x=[NaN,NaN,NaN,NaN];var A=!1,B=c(z,v,!0);0===B.distance&&
(A=!0,u[0][0]=z[0],u[0][1]=z[1],B=c(z,v,!1));n[0]=B.distance;x[0]=0;var C=[NaN,NaN];let D=!1,F=.25,H=-1;B=NaN;do{B=NaN;var N=y[0];u[1]=e(v,N+(y[2]-N)*F,r,m);isNaN(u[1][0])||isNaN(u[1][1])||(B=c(u[1],v,!1),B=B.distance);if(!isNaN(B)&&B>r&&f(u[1],v))D=!0,n[1]=B,x[1]=d(u[1],z);else if(!isNaN(B)&&B>H&&(H=B,C[0]=u[1][0],C[1]=u[1][1]),F-=.01,.1>F)if(0<=H)D=!0,n[1]=H,u[1][0]=C[0],u[1][1]=C[1],x[1]=d(u[1],z);else break}while(!D);D=!1;F=.5;H=-1;N=.01;let E=1;do{B=NaN;var G=y[0];u[2]=e(v,G+(y[2]-G)*F,r,m);
isNaN(u[2][0])||isNaN(u[2][1])||(B=c(u[2],v,!1),B=B.distance);if(!isNaN(B)&&B>r&&f(u[2],v))D=!0,n[2]=B,x[2]=d(u[2],z);else if(!isNaN(B)&&B>H)H=B,C[0]=u[2][0],C[1]=u[2][1];else if(B>H&&(H=B,C[0]=u[2][0],C[1]=u[2][1]),F=.5+N*E,N+=.01,E*=-1,.3>F||.7<F)if(0<=H)D=!0,n[2]=H,u[2][0]=C[0],u[2][1]=C[1],x[2]=d(u[2],z);else break}while(!D);D=!1;F=.75;H=-1;do if(B=NaN,N=y[0],u[3]=e(v,N+(y[2]-N)*F,r,m),isNaN(u[3][0])||isNaN(u[3][1])||(B=c(u[3],v,!1),B=B.distance),!isNaN(B)&&B>r&&f(u[3],v))D=!0,n[3]=B,x[3]=d(u[3],
z);else if(B>H&&(H=B,C[0]=u[3][0],C[1]=u[3][1]),F+=.01,.9<F)if(0<=H)D=!0,n[3]=H,u[3][0]=C[0],u[3][1]=C[1],x[3]=d(u[3],z);else break;while(!D);v=[0,1,2,3];m=A?0:1;for(y=m;4>y;y++)for(A=m;3>A;A++)z=x[A],C=x[A+1],0<t(z,C)&&(r=v[A],v[A]=v[A+1],v[A+1]=r,x[A]=C,x[A+1]=z);x=m;for(y=r=0;4>m;m++){switch(m){case 0:y=2*n[v[m]];break;case 1:y=1.66666666*n[v[m]];break;case 2:y=1.33333333*n[v[m]];break;case 3:y=n[v[m]]}y>r&&(r=y,x=v[m])}return u[x]};a.getPolylabelPoint=function(v){if(!v.nextPath()||!v.pathSize)return null;
var m=l.getCursorPathBounds(v),r=m[2]-m[0],n=m[3]-m[1];if(0===r||0===n)return[m[0]+r/2,m[1]+n/2];const u=Math.max(Math.min(r,n)/100,1),x=new b((A,B)=>B.maxDistanceToPolygon-A.maxDistanceToPolygon);n=Math.min(r,n);r=n/2;let y=0,z=0;for(y=m[0];y<m[2];y+=n)for(z=m[1];z<m[3];z+=n)x.enqueue(new w(y+r,z+r,r,v));v.reset();v.nextPath();m=p.ringsCentroidCursor(v);if(null===m)return null;for(m=new w(m[0],m[1],0,v);0<x.size;)n=x.dequeue(),n.distancefromCellCenter>m.distancefromCellCenter&&(m=n),n.maxDistanceToPolygon-
m.distancefromCellCenter<=u||(r=n.cellSize/2,x.enqueue(new w(n.x-r,n.y-r,r,v)),x.enqueue(new w(n.x+r,n.y-r,r,v)),x.enqueue(new w(n.x-r,n.y+r,r,v)),x.enqueue(new w(n.x+r,n.y+r,r,v)));return[m.x,m.y]};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/PriorityQueue":function(){define(function(){class a{constructor(q=b){this._data=[];this._compare=q}get size(){return this._data.length}enqueue(q){if(null!=q){var {_data:l,_compare:p}=this;l.push(q);q=l.length-1>>>0;for(var k=l[q];0<
q;){const h=q-1>>1,f=l[h];if(0>=p(f,k))l[h]=k,l[q]=f,q=h;else break}}}dequeue(){const {_data:q,_compare:l}=this,p=q[0];var k=q.pop();if(0===q.length)return p;q[0]=k;k=0;const h=q.length,f=q[0];let c;let e=null;for(;;){var g=2*k+1;const d=2*k+2;e=null;g<h&&(c=q[g],0<l(c,f)&&(e=g));d<h&&(g=q[d],null===e&&0>=l(g,f)||null!==e&&0>=l(g,c))&&(e=d);if(null===e)break;q[k]=q[e];q[e]=f;k=e}return p}}const b=(q,l)=>q<l?-1:q>l?1:0;return a})},"esri/symbols/cim/imageUtils":function(){define(["exports"],function(a){a.getFirstFrame=
function(b){const q=b.getFrame(0);if(q instanceof HTMLImageElement||q instanceof HTMLCanvasElement)return q;const l=document.createElement("canvas");l.width=b.width;l.height=b.height;b=l.getContext("2d");q instanceof ImageData?b.putImageData(q,0,0):b.drawImage(q,0,0);return l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/Rect":function(){define(function(){class a{constructor(b=0,q=0,l=0,p=0){this.x=b;this.y=q;this.width=l;this.height=p}static fromExtent(b){return new a(b.xmin,
-b.ymax,b.xmax-b.xmin,b.ymax-b.ymin)}get isEmpty(){return 0>=this.width||0>=this.height}union(b){this.x=Math.min(this.x,b.x);this.y=Math.min(this.y,b.y);this.width=Math.max(this.width,b.width);this.height=Math.max(this.height,b.height)}}return a})},"esri/symbols/cim/TextRasterizer":function(){define(["../../core/screenUtils","../support/textUtils"],function(a,b){function q(k){return`rgba(${k.slice(0,3).toString()},${k[3]})`}function l(k,h){var f=h.font;f=`${f.style} ${f.weight} ${a.pt2px(Math.max(h.size,
.5)*h.pixelRatio).toFixed(1)}px ${f.family}, sans-serif`;k.font=f;k.textBaseline="top";switch(h.horizontalAlignment){case "left":h="left";break;case "right":h="right";break;case "center":h="center";break;default:h="left"}k.textAlign=h}class p{constructor(k){k&&(this._textRasterizationCanvas=k)}rasterizeText(k,h){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const f=this._textRasterizationCanvas;var c=f.getContext("2d",{willReadFrequently:!0});l(c,
h);this._parameters=h;this._textLines=k.split(/\r?\n/);this._lineHeight=this._computeLineHeight();const {decoration:e,weight:g}=h.font;this._lineThroughWidthOffset=e&&"line-through"===e?.1*this._lineHeight:0;var d=(k=null!=h.backgroundColor||null!=h.borderLine)?b.backgroundPadding:0,t=this._computeTextWidth(c,h)+2*d,w=this._lineHeight*this._textLines.length+2*d;f.width=t+2*this._lineThroughWidthOffset;f.height=w;if(0===f.width||0===f.height)return f.width=f.height=1,{size:[0,0],image:new Uint32Array(0),
sdf:!1,simplePattern:!1,anchorX:0,anchorY:0,canvas:f};this._renderedLineHeight=Math.round(this._lineHeight*h.pixelRatio);this._renderedHaloSize=a.pt2px(h.halo.size)*h.pixelRatio;this._renderedWidth=t*h.pixelRatio;this._renderedHeight=w*h.pixelRatio;this._lineThroughWidthOffset*=h.pixelRatio;t=h.halo&&h.halo.color?h.halo.color:[0,0,0,0];this._fillStyle=q(h.color??[0,0,0,0]);this._haloStyle=`rgb(${t.slice(0,3).toString()})`;t=this._renderedLineHeight;var v=this._renderedHaloSize;c.save();c.clearRect(0,
0,f.width,f.height);l(c,h);w=d*h.pixelRatio;d=c.textAlign;var m=this._renderedWidth-2*w;d=("center"===d?.5*m:"right"===d?m:0)+v+w;w=v+w;v=0<v;m=this._lineThroughWidthOffset;let r=0;if(k){c.save();k=h.backgroundColor??[0,0,0,0];const u=h.borderLine?.color??[0,0,0,0],x=2*a.pt2px(h.borderLine?.size??0);c.fillStyle=q(k);c.strokeStyle=q(u);c.lineWidth=x;c.fillRect(0,0,f.width,f.height);c.strokeRect(0,0,f.width,f.height);c.restore()}v&&this._renderHalo(c,d,w,m,r,h);r+=w;m+=d;for(var n of this._textLines)v&&
(c.globalCompositeOperation="destination-out",c.fillStyle="rgb(0, 0, 0)",c.fillText(n,m,r),c.globalCompositeOperation="source-over"),c.fillStyle=this._fillStyle,c.fillText(n,m,r),e&&"none"!==e&&this._renderDecoration(c,m,r,e,g),r+=t;c.restore();n=this._renderedWidth+2*this._lineThroughWidthOffset;k=this._renderedHeight;c=c.getImageData(0,0,n,k);c=new Uint8Array(c.data);if(h.premultiplyColors)for(d=0;d<c.length;d+=4)t=c[d+3]/255,c[d]*=t,c[d+1]*=t,c[d+2]*=t;switch(h.horizontalAlignment){case "left":t=
-.5;break;case "right":t=.5;break;default:t=0}switch(h.verticalAlignment){case "bottom":h=-.5;break;case "top":h=.5;break;case "baseline":h=-1/6;break;default:h=0}return{size:[n,k],image:new Uint32Array(c.buffer),sdf:!1,simplePattern:!1,anchorX:t,anchorY:h,canvas:f}}_renderHalo(k,h,f,c,e,g){const d=this._renderedWidth,t=this._renderedHeight;this._haloRasterizationCanvas||(this._haloRasterizationCanvas=document.createElement("canvas"));this._haloRasterizationCanvas.width=d;this._haloRasterizationCanvas.height=
t;const w=this._haloRasterizationCanvas,v=w.getContext("2d");v.clearRect(0,0,d,t);l(v,g);const {decoration:m,weight:r}=g.font;v.fillStyle=this._haloStyle;v.strokeStyle=this._haloStyle;v.lineJoin="round";this._renderHaloNative(v,h,f,m,r);k.globalAlpha=this._parameters.halo.color[3];k.drawImage(w,0,0,d,t,c,e,d,t);k.globalAlpha=1}_renderHaloNative(k,h,f,c,e){const g=this._renderedLineHeight,d=this._renderedHaloSize;for(const t of this._textLines){const w=2*d;for(let v=0;5>v;v++){const m=(.6+.1*v)*w;
k.lineWidth=m;k.strokeText(t,h,f);c&&"none"!==c&&this._renderDecoration(k,h,f,c,e,m)}f+=g}}computeTextSize(k,h){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const f=this._textRasterizationCanvas;var c=f.getContext("2d");l(c,h);this._parameters=h;this._textLines=k.split(/\r?\n/);this._lineHeight=this._computeLineHeight();k=this._computeTextWidth(c,h);c=this._lineHeight*this._textLines.length;f.width=k;f.height=c;return[k*h.pixelRatio,c*h.pixelRatio]}_computeTextWidth(k,
h){let f=0;for(const c of this._textLines)f=Math.max(f,k.measureText(c).width);h=h.font;if("italic"===h.style||"oblique"===h.style||"string"===typeof h.weight&&("bold"===h.weight||"bolder"===h.weight)||"number"===typeof h.weight&&600<h.weight)f+=.3*k.measureText("w").width;f+=2*a.pt2px(this._parameters.halo.size);return Math.round(f)}_computeLineHeight(){let k=1.275*this._parameters.size;const h=this._parameters.font.decoration;h&&"underline"===h&&(k*=1.3);return Math.round(k+2*a.pt2px(this._parameters.halo.size))}_renderDecoration(k,
h,f,c,e,g){const d=.9*this._lineHeight;switch(k.textAlign){case "center":h-=this._renderedWidth/2;break;case "right":h-=this._renderedWidth}const t=k.textBaseline;if("underline"===c)switch(t){case "top":f+=d;break;case "middle":f+=d/2}else if("line-through"===c)switch(t){case "top":f+=d/1.5;break;case "middle":f+=d/3}c=g?1.5*g:Math.ceil(d*("bold"===e?.06:"bolder"===e?.09:.04));k.save();k.beginPath();k.strokeStyle=k.fillStyle;k.lineWidth=c;k.moveTo(h-this._lineThroughWidthOffset,f);k.lineTo(h+this._renderedWidth+
2*this._lineThroughWidthOffset,f);k.stroke();k.restore()}}return p})},"esri/views/2d/engine/webgl/definitions":function(){define(["exports"],function(a){a.AttributeDataType=void 0;var b=a.AttributeDataType||(a.AttributeDataType={});b[b.FilterFlags=0]="FilterFlags";b[b.Animation=1]="Animation";b[b.GPGPU=2]="GPGPU";b[b.VV=3]="VV";b[b.DD0=4]="DD0";b[b.DD1=5]="DD1";b[b.DD2=6]="DD2";a.MAX_TILE_RESHUFFLES_PER_FRAME=1;a.RESHUFFLING_EXEMPT_DRAW_CALLS=10;a.RESHUFFLING_EXEMPT_MEMORY_BYTES=1048576;a.RESHUFFLING_TARGET_DRAW_EFFICIENCY=
.75;a.RESHUFFLING_TARGET_MEMORY_EFFICIENCY=.75;a.angleFactor256=256/360;a.animationUnit=2;a.attributeStoreInitialSize=256;a.attributeStoreTextureSize=1024;a.averageGlyphMosaicItem={metrics:{width:15,height:17,left:0,top:-7,advance:14}};a.bitsetFillHasPatternHeightPrecisionFactor=32;a.bitsetFillHasPatternWidthPrecisionFactor=64;a.bitsetFillHasUnresolvedReplacementColor=8;a.bitsetFillRandomPatternOffset=4;a.bitsetGenericConsiderAlphaOnly=16;a.bitsetGenericLockColor=2;a.bitsetLineScaleDash=4;a.bitsetMarkerAlignmentMap=
1;a.bitsetMarkerAlignmentScreen=0;a.bitsetMarkerOutlineAllowColorOverride=4;a.bitsetMarkerScaleSymbolsProportionally=8;a.bitsetTypeFillOutline=1;a.bufferDataMinimumSize=128;a.bufferDataPoolSize=4;a.chartMaxFields=10;a.collisionBoxPadding=16;a.collisionBucketSize=128;a.collisionEarlyRejectBucketSize=16;a.collisionMaxZoomDelta=1;a.collisionPlacementPadding=8;a.collisionTileBoxSize=4;a.compressionFactorForU16=128;a.dataDrivenUnit0=4;a.dataDrivenUnit1=5;a.dataDrivenUnit2=6;a.debugLabels=!1;a.defaultSdfTextureSize=
128;a.displayRecordIntPerElement=8;a.dotDensityMaxFields=8;a.effectFlag0=16;a.enableEarlyLabelDiscard=!1;a.extrudeScale=64;a.filterFlag0=8;a.filterFlagsUnit=1;a.glyphSize=24;a.gpgpuUnit=12;a.heuristicGlyphsPerFeature=10;a.heuristicGlyphsPerLine=50;a.highlightReasonsCount=3;a.hittestSmallSymbolThreshold=3;a.hittestToleranceDesktop=1;a.hittestToleranceMobile=3;a.hittestToleranceSmallSymbol=3;a.labelPlacementOffsetPadding=4;a.magicLabelLineHeight=29;a.maxGeohashLevel=12;a.maxGpuUploadsPerFrame=2;a.maxRepresentableInt=
16777216;a.maxTextLineWidth=512;a.minMaxZoomPrecisionFactor=10;a.minTextLineWidth=32;a.nanMagicNumber=1E-30;a.patchPixelBufferAllocSize=500;a.patternFillRasterizationScale=2;a.pictureFillColor=4294967295;a.randomInsidePolygonTextureSize=1024;a.rasterTileSize=256;a.spritePadding=2;a.svgSdfTextureInnerSize=252;a.svgSdfTextureSize=256;a.textureBindingBitmap=0;a.textureBindingGlyphAtlas=0;a.textureBindingHighlight0=5;a.textureBindingHighlight1=6;a.textureBindingRenderer0=5;a.textureBindingRenderer1=6;
a.textureBindingSpriteAtlas=0;a.textureUploadManagerBudget=4;a.textureUploadManagerChunkSize=128;a.thinLineHalfWidthThreshold=1.05;a.tileSize=512;a.visualVariableUnit=3;a.vtlHighResCutoff=1.15;a.vtlTextureBindingUnitGlyphs=6;a.vtlTextureBindingUnitSprites=5;a.webglMaxInnerStops=6;a.webglMaxStops=8;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/mesh/templates/shapingUtils":function(){define("exports ../../../../../../core/libs/gl-matrix-2/math/mat2d ../../../../../../core/libs/gl-matrix-2/factories/mat2df32 ../../../../../../core/libs/gl-matrix-2/math/vec2 ../../../../../../core/libs/gl-matrix-2/factories/vec2f32 ../../alignmentUtils ../../Rect ../../collisions/BoundingBox".split(" "),
function(a,b,q,l,p,k,h,f){function c(w,v){w.forEach(m=>l.transformMat2d(m,m,v));return{topLeft:w[0],topRight:w[1],bottomLeft:w[2],bottomRight:w[3]}}const e=Math.PI/180;class g{constructor(w,v,m,r){this._rotationT=q.create();this.minZoom=this._yBounds=this._xBounds=0;this.maxZoom=255;this._bounds=null;const n=m.rect,u=new Float32Array(8);w*=r;v*=r;const x=m.code?n.width*r:m.metrics.width,y=m.code?n.height*r:m.metrics.height;this.width=x;this.height=y;u[0]=w;u[1]=v;u[2]=w+x;u[3]=v;u[4]=w;u[5]=v+y;u[6]=
w+x;u[7]=v+y;this._data=u;this._setTextureCoords(n);this._scale=r;this._mosaic=m;this.x=w;this.y=v;this.maxOffset=Math.max(w+x,v+y)}get mosaic(){return this._mosaic}set angle(w){this._angle=w;b.fromRotation(this._rotationT,-w);this._setOffsets()}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){this._offsets||
this._setOffsets();return this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const {height:n,width:u}=this._mosaic.metrics;var w=u*this._scale,v=Math.abs(n)*this._scale,m=new Float32Array(8);m[0]=this.x;m[1]=this.y;m[2]=this.x+w;m[3]=this.y;m[4]=this.x;m[5]=this.y+v;m[6]=this.x+w;m[7]=this.y+v;w=b.multiply(q.create(),this._rotationT,this._transform);q.transformMany(m,m,w);v=w=Infinity;let x=0;var r=0;for(let y=
0;4>y;y++){const z=m[2*y],A=m[2*y+1];w=Math.min(w,z);v=Math.min(v,A);x=Math.max(x,z);r=Math.max(r,A)}m=x-w;r-=v;this._bounds=new f(w+m/2,v+r/2,m,r)}return this._bounds}setTransform(w){this._transform=w;this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const w=b.multiply(q.create(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0];this._offsets.topLeft[1]=this._data[1];this._offsets.topRight[0]=this._data[2];
this._offsets.topRight[1]=this._data[3];this._offsets.bottomLeft[0]=this._data[4];this._offsets.bottomLeft[1]=this._data[5];this._offsets.bottomRight[0]=this._data[6];this._offsets.bottomRight[1]=this._data[7];l.transformMat2d(this._offsets.topLeft,this._offsets.topLeft,w);l.transformMat2d(this._offsets.topRight,this._offsets.topRight,w);l.transformMat2d(this._offsets.bottomLeft,this._offsets.bottomLeft,w);l.transformMat2d(this._offsets.bottomRight,this._offsets.bottomRight,w)}_setTextureCoords({x:w,
y:v,width:m,height:r}){this._texcoords={topLeft:[w,v],topRight:[w+m,v],bottomLeft:[w,v+r],bottomRight:[w+m,v+r]}}}class d{constructor(w,v,m){this._rotation=0;this._decorate(w,v,m);this.glyphs=w;this.bounds=this._createBounds(w);this.isMultiline=1<v.length;this._hasRotation=0!==m.angle;this._transform=this._createGlyphTransform(this.bounds,m);if((this._borderLineSizePx=m.borderLineSizePx)||m.hasBackground)[this.bounds,this.textBox]=this.shapeBackground(this._transform);for(const r of w)r.setTransform(this._transform)}setRotation(w){if(0!==
w||0!==this._rotation){this._rotation=w;var v=this._transform;w=b.fromRotation(q.create(),w);b.multiply(v,w,v);for(const m of this.glyphs)m.setTransform(this._transform)}}_decorate(w,v,m){if(m.decoration&&"none"!==m.decoration&&w.length){var r=m.scale;m="underline"===m.decoration?26:16;var n=w[0].textureBinding;for(const z of v){const A=z.startX*r,B=z.startY*r;v=w;var u=v.push;var x=(z.width+z.glyphWidthEnd)*r;var y=n;x={code:0,page:0,sdf:!0,rect:new h(0,0,11,8),textureBinding:y,metrics:{advance:0,
height:4,width:x,left:0,top:0}};u.call(v,new g(A,B+m*r,x,1))}}}shapeBackground(w){const v=(1.5+(this._borderLineSizePx||0))/2;var m=this._borderLineSizePx?v:0;const {xmin:r,ymin:n,xmax:u,ymax:x,x:y,y:z,width:A,height:B}=this.bounds,C=[r-8,n-8],D=[u+8,n-8],F=[r-8,x+8],H=[u+8,x+8],N=c([[C[0]-v,C[1]-v],[D[0]+v,D[1]-v],[C[0]+m,C[1]+m],[D[0]-m,D[1]+m]],w),E=c([[F[0]+m,F[1]-m],[H[0]-m,H[1]-m],[F[0]-v,F[1]+v],[H[0]+v,H[1]+v]],w),G=c([[C[0]-v,C[1]-v],[C[0]+m,C[1]+m],[F[0]-v,F[1]+v],[F[0]+m,F[1]-m]],w);m=
c([[D[0]-m,D[1]+m],[D[0]+v,D[1]-v],[H[0]-m,H[1]-m],[H[0]+v,H[1]+v]],w);w={main:c([C,D,F,H],w),top:N,bot:E,left:G,right:m};return[new f(y,z,A+2*v,B+2*v),w]}get boundsT(){var w=this.bounds;const v=l.set(p.create(),w.x,w.y);l.transformMat2d(v,v,this._transform);return this._hasRotation?(w=Math.max(w.width,w.height),new f(v[0],v[1],w,w)):new f(v[0],v[1],w.width,w.height)}_createBounds(w){let v=Infinity,m=Infinity,r=0;var n=0;for(const u of w)v=Math.min(v,u.xTopLeft),m=Math.min(m,u.yTopLeft),r=Math.max(r,
u.xBottomRight),n=Math.max(n,u.yBottomRight);w=r-v;n-=m;return new f(v+w/2,m+n/2,w,n)}_createGlyphTransform(w,v){const m=e*v.angle,r=q.create(),n=p.create();b.translate(r,r,l.set(n,v.xOffset,-v.yOffset));v.useCIMAngleBehavior?b.rotate(r,r,m):(b.translate(r,r,l.set(n,w.x,w.y)),b.rotate(r,r,m),b.translate(r,r,l.set(n,-w.x,-w.y)));return r}}class t{constructor(w,v,m,r,n,u){this.startY=this.startX=this.glyphWidthEnd=0;this.start=Math.max(0,Math.min(v,m));this.end=Math.max(0,Math.max(v,m));this.end<w.length&&
(this.glyphWidthEnd=w[this.end].metrics.width);this.width=r;this.yMin=n;this.yMax=u}}a.ShapedGlyph=g;a.ShapingInfo=d;a.shapeGlyphs=function(w,v){const m=v.scale,r=[],{glyphs:n,isRightToLeft:u}=w;w=[];var x=1/v.scale*v.maxLineWidth,y=u?n.length-1:0,z=u?-1:n.length,A=u?-1:1,B=y,C=0,D=0,F=B;let H=F,N=0,E=Infinity,G=0;for(;B!==z;){const {code:O,metrics:L}=n[B];var I=Math.abs(L.top);10!==O&&32!==O&&(E=Math.min(E,I),G=Math.max(G,I+L.height));10===O?(B!==y&&(w.push(new t(n,F,B-A,C,Infinity===E?0:E,G)),E=
Infinity,G=0),C=0,F=B+A,H=B+A,D=0):32===O?(H=B+A,D=0,N=L.advance,C+=L.advance):(C>x&&(H!==F?(I=H-2*A,C-=N,w.push(new t(n,F,I,C-D,E,G)),E=Infinity,G=0,F=H,C=D):(w.push(new t(n,F,B-A,C,E,G)),E=Infinity,G=0,H=F=B,C=0)),C+=L.advance,D+=L.advance);B+=A}x=new t(n,F,B-A,C,E,G);0<=x.start&&x.end<n.length&&w.push(x);if(w.length){x=0;for(y=0;y<w.length;y++)({width:z}=w[y]),x=Math.max(z,x);y=w[0].yMin;x={x:0,y,height:w[w.length-1].yMax+v.lineHeight*(w.length-1)+("underline"===v.decoration?4:0)-y,width:x}}else x=
{x:0,y:0,height:0,width:0};y=x;x=k.getXAnchorDirection(v.horizontalAlignment);z=k.getYAnchorDirection(v.verticalAlignment);A=z===k.VAlign.Baseline?1:0;y=(1-A)*-y.y+y.height/2*(A?0:z-1)+-22*(A?1:0);for(z=0;z<w.length;z++){const {start:O,end:L,width:P}=w[z];A=P/2*(x+1)*-1-3;B=z*v.lineHeight+y-3;w[z].startX=A;w[z].startY=B;for(C=O;C<=L;C++)D=n[C],10!==D.code&&(F=new g(A+D.metrics.left,B-D.metrics.top,D,m),A+=D.metrics.advance,r.push(F))}return new d(r,w,v)};Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/core/libs/gl-matrix-2/math/mat2d":function(){define(["exports","./common"],function(a,b){function q(B,C){B[0]=C[0];B[1]=C[1];B[2]=C[2];B[3]=C[3];B[4]=C[4];B[5]=C[5];return B}function l(B){B[0]=1;B[1]=0;B[2]=0;B[3]=1;B[4]=0;B[5]=0;return B}function p(B,C,D,F,H,N,E){B[0]=C;B[1]=D;B[2]=F;B[3]=H;B[4]=N;B[5]=E;return B}function k(B,C){const D=C[0],F=C[1],H=C[2],N=C[3],E=C[4];C=C[5];let G=D*N-F*H;if(!G)return null;G=1/G;B[0]=N*G;B[1]=-F*G;B[2]=-H*G;B[3]=D*G;B[4]=(H*C-N*E)*G;B[5]=
(F*E-D*C)*G;return B}function h(B){return B[0]*B[3]-B[1]*B[2]}function f(B,C,D){const F=C[0],H=C[1],N=C[2],E=C[3],G=C[4];C=C[5];const I=D[0],O=D[1],L=D[2],P=D[3],M=D[4];D=D[5];B[0]=F*I+N*O;B[1]=H*I+E*O;B[2]=F*L+N*P;B[3]=H*L+E*P;B[4]=F*M+N*D+G;B[5]=H*M+E*D+C;return B}function c(B,C,D){const F=C[0],H=C[1],N=C[2],E=C[3],G=C[4];C=C[5];const I=Math.sin(D);D=Math.cos(D);B[0]=F*D+N*I;B[1]=H*D+E*I;B[2]=F*-I+N*D;B[3]=H*-I+E*D;B[4]=G;B[5]=C;return B}function e(B,C,D){const F=C[1],H=C[2],N=C[3],E=C[4],G=C[5],
I=D[0];D=D[1];B[0]=C[0]*I;B[1]=F*I;B[2]=H*D;B[3]=N*D;B[4]=E;B[5]=G;return B}function g(B,C,D){const F=C[0],H=C[1],N=C[2],E=C[3],G=C[4];C=C[5];const I=D[0];D=D[1];B[0]=F;B[1]=H;B[2]=N;B[3]=E;B[4]=F*I+N*D+G;B[5]=H*I+E*D+C;return B}function d(B,C){const D=Math.sin(C);C=Math.cos(C);B[0]=C;B[1]=D;B[2]=-D;B[3]=C;B[4]=0;B[5]=0;return B}function t(B,C){B[0]=C[0];B[1]=0;B[2]=0;B[3]=C[1];B[4]=0;B[5]=0;return B}function w(B,C){B[0]=1;B[1]=0;B[2]=0;B[3]=1;B[4]=C[0];B[5]=C[1];return B}function v(B){return"mat2d("+
B[0]+", "+B[1]+", "+B[2]+", "+B[3]+", "+B[4]+", "+B[5]+")"}function m(B){return Math.sqrt(B[0]**2+B[1]**2+B[2]**2+B[3]**2+B[4]**2+B[5]**2+1)}function r(B,C,D){B[0]=C[0]+D[0];B[1]=C[1]+D[1];B[2]=C[2]+D[2];B[3]=C[3]+D[3];B[4]=C[4]+D[4];B[5]=C[5]+D[5];return B}function n(B,C,D){B[0]=C[0]-D[0];B[1]=C[1]-D[1];B[2]=C[2]-D[2];B[3]=C[3]-D[3];B[4]=C[4]-D[4];B[5]=C[5]-D[5];return B}function u(B,C,D){B[0]=C[0]*D;B[1]=C[1]*D;B[2]=C[2]*D;B[3]=C[3]*D;B[4]=C[4]*D;B[5]=C[5]*D;return B}function x(B,C,D,F){B[0]=C[0]+
D[0]*F;B[1]=C[1]+D[1]*F;B[2]=C[2]+D[2]*F;B[3]=C[3]+D[3]*F;B[4]=C[4]+D[4]*F;B[5]=C[5]+D[5]*F;return B}function y(B,C){return B[0]===C[0]&&B[1]===C[1]&&B[2]===C[2]&&B[3]===C[3]&&B[4]===C[4]&&B[5]===C[5]}function z(B,C){const D=B[0],F=B[1],H=B[2],N=B[3],E=B[4];B=B[5];const G=C[0],I=C[1],O=C[2],L=C[3],P=C[4];C=C[5];const M=b.getEpsilon();return Math.abs(D-G)<=M*Math.max(1,Math.abs(D),Math.abs(G))&&Math.abs(F-I)<=M*Math.max(1,Math.abs(F),Math.abs(I))&&Math.abs(H-O)<=M*Math.max(1,Math.abs(H),Math.abs(O))&&
Math.abs(N-L)<=M*Math.max(1,Math.abs(N),Math.abs(L))&&Math.abs(E-P)<=M*Math.max(1,Math.abs(E),Math.abs(P))&&Math.abs(B-C)<=M*Math.max(1,Math.abs(B),Math.abs(C))}const A=Object.freeze(Object.defineProperty({__proto__:null,add:r,copy:q,determinant:h,equals:z,exactEquals:y,frob:m,fromRotation:d,fromScaling:t,fromTranslation:w,identity:l,invert:k,mul:f,multiply:f,multiplyScalar:u,multiplyScalarAndAdd:x,rotate:c,scale:e,set:p,str:v,sub:n,subtract:n,translate:g},Symbol.toStringTag,{value:"Module"}));a.add=
r;a.copy=q;a.determinant=h;a.equals=z;a.exactEquals=y;a.frob=m;a.fromRotation=d;a.fromScaling=t;a.fromTranslation=w;a.identity=l;a.invert=k;a.mat2d=A;a.mul=f;a.multiply=f;a.multiplyScalar=u;a.multiplyScalarAndAdd=x;a.rotate=c;a.scale=e;a.set=p;a.str=v;a.sub=n;a.subtract=n;a.translate=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/factories/mat2df32":function(){define(["exports"],function(a){function b(){const c=new Float32Array(6);c[0]=1;c[3]=1;return c}
function q(c){const e=new Float32Array(6);e[0]=c[0];e[1]=c[1];e[2]=c[2];e[3]=c[3];e[4]=c[4];e[5]=c[5];return e}function l(c,e,g,d,t,w){const v=new Float32Array(6);v[0]=c;v[1]=e;v[2]=g;v[3]=d;v[4]=t;v[5]=w;return v}function p(c,e){return new Float32Array(c,e,6)}function k(c,e,g,d){const t=e[d];e=e[d+1];c[d]=g[0]*t+g[2]*e+g[4];c[d+1]=g[1]*t+g[3]*e+g[5]}function h(c,e,g,d=0,t=0,w=2){for(t=t||e.length/w;d<t;d++)k(c,e,g,d*w)}const f=Object.freeze(Object.defineProperty({__proto__:null,clone:q,create:b,
createView:p,fromValues:l,transform:k,transformMany:h},Symbol.toStringTag,{value:"Module"}));a.clone=q;a.create=b;a.createView=p;a.fromValues=l;a.mat2df32=f;a.transform=k;a.transformMany=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/alignmentUtils":function(){define(["exports","../../../../core/Logger"],function(a,b){a.HAlign=void 0;(function(q){q[q.Left=-1]="Left";q[q.Center=0]="Center";q[q.Right=1]="Right"})(a.HAlign||(a.HAlign={}));a.VAlign=void 0;
(function(q){q[q.Top=1]="Top";q[q.Center=0]="Center";q[q.Bottom=-1]="Bottom";q[q.Baseline=2]="Baseline"})(a.VAlign||(a.VAlign={}));a.getAlignmentFromPlacement=function(q){switch(q){case "above-left":case "esriServerPointLabelPlacementAboveLeft":return["right","bottom"];case "above-center":case "above-along":case "esriServerPointLabelPlacementAboveCenter":case "esriServerLinePlacementAboveAlong":return["center","bottom"];case "above-right":case "esriServerPointLabelPlacementAboveRight":return["left",
"bottom"];case "center-left":case "esriServerPointLabelPlacementCenterLeft":return["right","middle"];case "center-center":case "center-along":case "esriServerPointLabelPlacementCenterCenter":case "esriServerLinePlacementCenterAlong":return["center","middle"];case "center-right":case "esriServerPointLabelPlacementCenterRight":return["left","middle"];case "below-left":case "esriServerPointLabelPlacementBelowLeft":return["right","top"];case "below-center":case "below-along":case "esriServerPointLabelPlacementBelowCenter":case "esriServerLinePlacementBelowAlong":return["center",
"top"];case "below-right":case "esriServerPointLabelPlacementBelowRight":return["left","top"];case "always-horizontal":case "esriServerPolygonPlacementAlwaysHorizontal":return["center","middle"];default:return console.debug(`Found invalid placement type ${q}`),["center","middle"]}};a.getJustification=function(q){switch(q){case "left":return a.HAlign.Left;case "right":return a.HAlign.Right;case "center":return a.HAlign.Center}};a.getXAnchorDirection=function(q){if(!q)return a.HAlign.Center;switch(q){case "Left":case "left":return a.HAlign.Left;
case "Right":case "right":return a.HAlign.Right;case "Justify":return b.getLogger("esri.views.2d.engine.webgl.alignmentUtils").warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),a.HAlign.Center;case "Center":case "center":return a.HAlign.Center}};a.getXDirection=function(q){switch(q){case a.HAlign.Right:case "right":return-1;case a.HAlign.Center:case "center":return 0;case a.HAlign.Left:case "left":return 1;default:return console.debug(`Found invalid horizontal alignment ${q}`),
0}};a.getYAnchorDirection=function(q){if(!q)return a.VAlign.Center;switch(q){case "Top":case "top":return a.VAlign.Top;case "Center":case "middle":return a.VAlign.Center;case "Baseline":case "baseline":return a.VAlign.Baseline;case "Bottom":case "bottom":return a.VAlign.Bottom}};a.getYDirection=function(q){switch(q){case a.VAlign.Top:case "top":return 1;case a.VAlign.Center:case "middle":return 0;case a.VAlign.Bottom:case a.VAlign.Baseline:case "baseline":case "bottom":return-1;default:return console.debug(`Found invalid vertical alignment ${q}`),
0}};a.isMapAligned=function(q){switch(q){case "above-along":case "below-along":case "center-along":case "esriServerLinePlacementAboveAlong":case "esriServerLinePlacementBelowAlong":case "esriServerLinePlacementCenterAlong":return!0;default:return!1}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/Rect":function(){define(function(){class a{constructor(b=0,q=0,l=0,p=0){this.x=b;this.y=q;this.width=l;this.height=p}get isEmpty(){return 0>=this.width||0>=this.height}union(b){this.x=
Math.min(this.x,b.x);this.y=Math.min(this.y,b.y);this.width=Math.max(this.width,b.width);this.height=Math.max(this.height,b.height)}}return a})},"esri/views/2d/engine/webgl/collisions/BoundingBox":function(){define(["../../../../../core/libs/gl-matrix-2/factories/vec2f32"],function(a){class b{constructor(q,l,p,k){this.computedY=this.computedX=0;this.center=a.fromValues(q,l);this.centerT=a.create();this.halfWidth=p/2;this.halfHeight=k/2;this.width=p;this.height=k}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+
this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(q){this.center[0]=q}set y(q){this.center[1]=q}clone(){return new b(this.x,this.y,this.width,this.height)}serialize(q){q.writeF32(this.center[0]);q.writeF32(this.center[1]);q.push(this.width);
q.push(this.height);return q}findCollisionDelta(q,l=4){return Math.log2(Math.min((q.halfWidth+this.halfWidth+l)/Math.abs(q.centerT[0]-this.centerT[0]),(q.halfHeight+this.halfHeight+l)/Math.abs(q.centerT[1]-this.centerT[1])))}extend(q){const l=Math.min(this.xmin,q.xmin),p=Math.min(this.ymin,q.ymin),k=Math.max(this.xmax,q.xmax)-l;q=Math.max(this.ymax,q.ymax)-p;this.width=k;this.height=q;this.halfWidth=k/2;this.halfHeight=q/2;this.x=l+k/2;this.y=p+q/2}static deserialize(q){const l=q.readF32(),p=q.readF32(),
k=q.readInt32();q=q.readInt32();return new b(l,p,k,q)}}return b})},"esri/views/2d/layers/graphics/graphicsUtils":function(){define("exports ../../../../core/screenUtils ../../../../geometry/Polygon ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/spatialReferenceUtils ../../engine/webgl/definitions".split(" "),function(a,b,q,l,p,k){a.getLineWidth=function(h){const f=b.px2pt(k.minTextLineWidth),c=b.px2pt(k.maxTextLineWidth);return Math.max(f,Math.min(h||c,c))};a.intersectingInternationalDateline=
function(h,f){f=p.getInfo(f);if(!f)return null;const [c,e]=f.valid;return h[2]>e?[l.create([h[0],h[1],e,h[3]]),l.create([c,h[1],c+h[2]-e,h[3]])]:h[0]<c?[l.create([c,h[1],h[2],h[3]]),l.create([e-(c-h[0]),h[1],e,h[3]])]:null};a.isMarkerSymbol=function(h){return"simple-marker"===h||"picture-marker"===h||"esriSMS"===h||"esriPMS"===h};a.isTextSymbol=function(h){return"text"===h||"esriTS"===h};a.pixelBuffer=50;a.polygonFromExtent=function(h){if(!h)return null;const {xmin:f,ymin:c,xmax:e,ymax:g,spatialReference:d}=
h;return new q({rings:[[[f,c],[f,g],[e,g],[e,c],[f,c]]],spatialReference:d})};a.roundPtToWholePixel=function(h){return b.px2pt(Math.round(b.pt2px(h)))};a.tileSize=512;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/GeometryUtils":function(){define(["exports","../../../../geometry/support/coordsUtils","../../../../geometry/support/TileClipper"],function(a,b,q){function l(e,g){e%=g;return 0<=e?e:e+g}const p=Number.POSITIVE_INFINITY,k=Math.PI,h=128/k,
f=256/360,c=1/Math.LN2;a.between=function(e,g,d){return e>=g&&e<=d||e>=d&&e<=g};a.c2pi=2*k;a.cDegTo256=f;a.cDegToRad=k/180;a.cInfinity=p;a.cPi=k;a.cRadTo256=h;a.degToByte=function(e){return l(e*f,256)};a.distanceFromToPolylineWithinThreshold=function(e,g,d,t){let w,v,m;t*=t;for(const r of d){const n=r.length;if(!(2>n)){d=r[0].x;w=r[0].y;for(let u=1;u<n;++u){v=r[u].x;m=r[u].y;if(b.distanceToSegmentSquared(e,g,d,w,v,m)<t)return!0;d=v;w=m}}}return!1};a.getTileMargins=function(e){return 8+Math.max(16*
(e-14),0)};a.interpolate=function(e,g,d){return e*(1-d)+g*d};a.isCircleOverlapingRect=function(e,g,d,t,w,v,m){g=Math.max(t,Math.min(g,v))-g;d=Math.max(w,Math.min(d,m))-d;return g*g+d*d<=e*e};a.log2=function(e){return Math.log(e)*c};a.offsetLine=function(e,g){if(0===g||Number.isNaN(g))return e;const d=[],t=new q.Point(0,0),w=new q.Point(0,0),v=new q.Point(0,0);for(let r=0;r<e.length;r++){const n=e[r],u=[];for(let x=0;x<n.length;x++){var m=n[x-1];const y=n[x],z=n[x+1];0===x?t.setCoords(0,0):t.assignSub(y,
m).normalize().rightPerpendicular();x===n.length-1?w.setCoords(0,0):w.assignSub(z,y).normalize().rightPerpendicular();v.assignAdd(t,w).normalize();m=v.x*w.x+v.y*w.y;0!==m&&v.scale(1/m);u.push(q.Point.add(y,v.scale(g)))}d.push(u)}return d};a.pointInPolygon=function(e,g,d){let t=0,w,v;for(const m of d){d=m.length;for(let r=1;r<d;++r)w=m[r-1],v=m[r],w.y>g!==v.y>g&&(0<(v.x-w.x)*(g-w.y)-(v.y-w.y)*(e-w.x)?t++:t--)}return 0!==t};a.positiveMod=l;a.radToByte=function(e){return l(e*h,256)};a.sqr=function(e){return e*
e};a.translateAnchor=function(e,g,d,t){e=new q.Point(e[0],e[1]);e.scale(t);"viewport"===g&&(g=Math.PI/180*-d,e.rotate(Math.cos(g),Math.sin(g)));return e};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/support/cimSymbolUtils":function(){define(["exports","../../Color","../cim/utils"],function(a,b,q){function l(d){d=q.toCIMSymbolJSON(d);if("CIMTextSymbol"===d?.type)return d.height??0;let t=0;if(d?.symbolLayers)for(const w of d.symbolLayers)q.isCIMMarker(w)&&null!=w.size&&
w.size>t?t=w.size:q.isCIMStroke(w)&&null!=w.width&&w.width>t?t=w.width:q.isCIMFill(w);return t}function p(d,t,w,v){if(d)if("CIMTextSymbol"===d.type)null!=d.height&&(d.height*=t);else{if(w&&d.effects)for(const m of d.effects)f(m,t);if(d.symbolLayers)for(const m of d.symbolLayers)switch(m.type){case "CIMPictureMarker":case "CIMVectorMarker":k(m,t,v);break;case "CIMPictureStroke":case "CIMSolidStroke":!v?.preserveOutlineWidth&&m.width&&(m.width*=t);break;case "CIMPictureFill":m.height&&(m.height*=t);
m.offsetX&&(m.offsetX*=t);m.offsetY&&(m.offsetY*=t);break;case "CIMHatchFill":p(m.lineSymbol,t,!0,{...v,preserveOutlineWidth:!1}),m.offsetX&&(m.offsetX*=t),m.offsetY&&(m.offsetY*=t),m.separation&&(m.separation*=t)}}}function k(d,t,w){if(d&&(d.markerPlacement&&h(d.markerPlacement,t),d.offsetX&&(d.offsetX*=t),d.offsetY&&(d.offsetY*=t),d.anchorPoint&&"Absolute"===d.anchorPointUnits&&(d.anchorPoint={x:d.anchorPoint.x*t,y:d.anchorPoint.y*t}),d.size=null!=d.size?d.size*t:0,"CIMVectorMarker"===d.type&&d.markerGraphics))for(const v of d.markerGraphics)d.scaleSymbolsProportionally||
p(v.symbol,t,!0,w)}function h(d,t){q.isCIMMarkerStrokePlacement(d)&&d.offset&&(d.offset*=t);switch(d.type){case "CIMMarkerPlacementAlongLineRandomSize":case "CIMMarkerPlacementAlongLineSameSize":d.customEndingOffset&&(d.customEndingOffset*=t);d.offsetAlongLine&&(d.offsetAlongLine*=t);if(d.placementTemplate&&d.placementTemplate.length){var w=d.placementTemplate.map(v=>v*t);d.placementTemplate=w}break;case "CIMMarkerPlacementAlongLineVariableSize":d.maxRandomOffset&&(d.maxRandomOffset*=t);d.placementTemplate&&
d.placementTemplate.length&&(w=d.placementTemplate.map(v=>v*t),d.placementTemplate=w);break;case "CIMMarkerPlacementOnLine":d.startPointOffset&&(d.startPointOffset*=t);break;case "CIMMarkerPlacementAtExtremities":d.offsetAlongLine&&(d.offsetAlongLine*=t);break;case "CIMMarkerPlacementAtRatioPositions":d.beginPosition&&(d.beginPosition*=t);d.endPosition&&(d.endPosition*=t);break;case "CIMMarkerPlacementPolygonCenter":d.offsetX&&(d.offsetX*=t);d.offsetY&&(d.offsetY*=t);break;case "CIMMarkerPlacementInsidePolygon":d.offsetX&&
(d.offsetX*=t),d.offsetY&&(d.offsetY*=t),d.stepX&&(d.stepX*=t),d.stepY&&(d.stepY*=t)}}function f(d,t){switch(d.type){case "CIMGeometricEffectArrow":case "CIMGeometricEffectDonut":d.width&&(d.width*=t);break;case "CIMGeometricEffectBuffer":d.size&&(d.size*=t);break;case "CIMGeometricEffectCut":d.beginCut&&(d.beginCut*=t);d.endCut&&(d.endCut*=t);d.middleCut&&(d.middleCut*=t);break;case "CIMGeometricEffectDashes":d.customEndingOffset&&(d.customEndingOffset*=t);d.offsetAlongLine&&(d.offsetAlongLine*=
t);if(d.dashTemplate&&d.dashTemplate.length){const w=d.dashTemplate.map(v=>v*t);d.dashTemplate=w}break;case "CIMGeometricEffectExtension":case "CIMGeometricEffectJog":case "CIMGeometricEffectRadial":d.length&&(d.length*=t);break;case "CIMGeometricEffectMove":d.offsetX&&(d.offsetX*=t);d.offsetY&&(d.offsetY*=t);break;case "CIMGeometricEffectOffset":case "CIMGeometricEffectOffsetTangent":d.offset&&(d.offset*=t);break;case "CIMGeometricEffectRegularPolygon":d.radius&&(d.radius*=t);break;case "CIMGeometricEffectTaperedPolygon":d.fromWidth&&
(d.fromWidth*=t);d.length&&(d.length*=t);d.toWidth&&(d.toWidth*=t);break;case "CIMGeometricEffectWave":d.amplitude&&(d.amplitude*=t),d.period&&(d.period*=t)}}function c(d,t){if(d){var w="CIMTextSymbol"===d.type?d.symbol:d;d="CIMPolygonSymbol"===d.type;if(w?.symbolLayers)for(const v of w.symbolLayers)if(!(v.colorLocked||d&&(q.isCIMStroke(v)||q.isCIMMarker(v)&&v.markerPlacement&&q.isCIMMarkerStrokePlacement(v.markerPlacement))))switch(v.type){case "CIMPictureMarker":case "CIMPictureStroke":case "CIMPictureFill":v.tintColor&&
e(t,v.tintColor);break;case "CIMVectorMarker":v.markerGraphics?.forEach(m=>{c(m.symbol,t)});break;case "CIMSolidStroke":case "CIMSolidFill":e(t,v.color);break;case "CIMHatchFill":c(v.lineSymbol,t)}}}function e(d,t){for(const w of d)if(w.join(".")===t.join("."))return;d.push(t)}function g(d,t,w){if(d){var v="CIMTextSymbol"===d.type?d.symbol:d;d="CIMPolygonSymbol"===v?.type;if(v?.symbolLayers)for(const m of v.symbolLayers)if(!m.colorLocked){if(d)if(w){if({layersToColor:v}=w,(q.isCIMStroke(m)||q.isCIMMarker(m)&&
m.markerPlacement&&q.isCIMMarkerStrokePlacement(m.markerPlacement))&&"fill"===v||q.isCIMFill(m)&&"outline"===v)continue}else if(q.isCIMStroke(m)||q.isCIMMarker(m)&&m.markerPlacement&&q.isCIMMarkerStrokePlacement(m.markerPlacement))continue;v=t.toArray();switch(m.type){case "CIMPictureMarker":case "CIMPictureStroke":case "CIMPictureFill":m.tintColor=v;break;case "CIMVectorMarker":m.markerGraphics?.forEach(r=>{g(r.symbol,t,w)});break;case "CIMSolidStroke":case "CIMSolidFill":m.color=v;break;case "CIMHatchFill":g(m.lineSymbol,
t,w)}}}}a.applyCIMSymbolColor=function(d,t,w){t instanceof b||(t=new b(t));(d=q.toCIMSymbolJSON(d))&&g(d,t,w)};a.applyCIMSymbolRotation=function(d,t,w=!1){d=q.toCIMSymbolJSON(d);w&&(t=360-t);if("CIMTextSymbol"===d?.type)d.angle=t;else if("CIMPointSymbol"===d?.type&&d.symbolLayers){w=t-(d.angle||0);for(const v of d.symbolLayers)if(q.isCIMMarker(v)){let m=v.rotation||0;m=v.rotateClockwise?m-w:m+w;v.rotation=m}d.angle=t}};a.getCIMSymbolColor=function(d){d=q.toCIMSymbolJSON(d);const t=[];c(d,t);return t.length?
new b(q.normalizeAlpha(t[0])):null};a.getCIMSymbolRotation=function(d,t=!1){d=q.toCIMSymbolJSON(d);return"CIMTextSymbol"===d?.type||"CIMPointSymbol"===d?.type?(d=d.angle,null!=d&&t?360-d:d??0):0};a.getCIMSymbolSize=l;a.getCIMSymbolType=function(d){d=q.toCIMSymbolJSON(d);if(!d)return null;switch(d.type){case "CIMPointSymbol":return"CIMPointSymbol";case "CIMLineSymbol":return"CIMLineSymbol";case "CIMPolygonSymbol":return"CIMPolygonSymbol";case "CIMTextSymbol":return"CIMTextSymbol";case "CIMMeshSymbol":return"CIMMeshSymbol";
default:return null}};a.scaleCIMMarker=k;a.scaleCIMSymbol=p;a.scaleCIMSymbolTo=function(d,t,w){if(d){var v=q.toCIMSymbolJSON(d);d=l(d);if(0===d){if(v)if("CIMTextSymbol"===v.type)v.height=t;else if(v.symbolLayers)for(const m of v.symbolLayers)switch(m.type){case "CIMPictureMarker":case "CIMVectorMarker":m.size=t;break;case "CIMPictureStroke":case "CIMSolidStroke":m.width=t}}else p(v,t/d,!1,w)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/support/utils":function(){define("require exports ../../Color ../../symbols ../../core/asyncUtils ../../core/has ../../core/screenUtils ../../core/libs/gl-matrix-2/factories/vec3f64 ../../layers/effects/jsonUtils ./cimSymbolUtils ./gfxUtils ./Symbol3DMaterial".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){function t(B){B=B.symbolLayers;if(!B)return null;let C=null;B.forEach(D=>{"object"===D.type&&D.resource?.href||(C="water"===D.type?D.color:D.material?D.material.color:null)});return C?new q(C):null}function w(B,C){if(null==C||null==B)return B;B=B.toRgba();B[3]*=C;return new q(B)}function v(B,C,D){if(B=B.symbolLayers){var F=H=>{C=C??H??(null!=D?A:null);return w(C,D)};B.forEach(H=>{if("object"!==H.type||!H.resource?.href||C)if("water"===H.type)H.color=F(H.color);else{const N=
F(null!=H.material?H.material.color:null);null==H.material?H.material=new d.Symbol3DMaterial({color:N}):H.material.color=N;null!=D&&"outline"in H&&null!=H.outline?.color&&(H.outline.color=w(H.outline.color,D))}})}}async function m(B,C){(B=B.symbolLayers)&&await p.forEach(B,async D=>r(D,C))}async function r(B,C){switch(B.type){case "extrude":B.size="number"===typeof C[2]?C[2]:0;break;case "icon":case "line":case "text":C=n(C);null!=C&&(B.size=C);break;case "path":const D=x(C,f.ONES,[B.width,void 0,
B.height]);B.width=z(C[0],B.width,1,D);B.height=z(C[2],B.height,1,D);break;case "object":await u(B,C)}}function n(B){for(const C of B)if("number"===typeof C)return C;return null}async function u(B,C){const {resourceSize:D,symbolSize:F}=await y(B),H=x(C,D,F);B.width=z(C[0],F[0],D[0],H);B.depth=z(C[1],F[1],D[1],H);B.height=z(C[2],F[2],D[2],H)}function x(B,C,D){for(let F=0;3>F;F++){const H=B[F];switch(H){case "symbol-value":return B=D[F],null!=B?B/C[F]:1;case "proportional":break;default:if(H&&C[F])return H/
C[F]}}return 1}async function y(B){var {computeObjectLayerResourceSize:C}=await new Promise((G,I)=>a(["./symbolLayerUtils"],G,I));C=await C(B,10);const {width:D,height:F,depth:H}=B;B=[D,H,F];let N=1;for(var E=0;3>E;E++){const G=B[E];if(null!=G){N=G/C[E];break}}for(E=0;3>E;E++)null==B[E]&&(B[E]=C[E]*N);return{resourceSize:C,symbolSize:B}}function z(B,C,D,F){switch(B){case "proportional":return D*F;case "symbol-value":return null!=C?C:D;default:return B}}const A=new q("white");b.applyColorToSymbol=
function(B,C,D){if(B&&(C||null!=D))if(C&&=new q(C),l.isSymbol3D(B))v(B,C,D);else if(l.isSymbol2D(B)){if(C=C??B.color)B.color=w(C,D);null!=D&&"outline"in B&&B.outline?.color&&(B.outline.color=w(B.outline.color,D))}};b.applyOpacityToColor=w;b.applyRotationToSymbol=function(B,C,D){B&&null!=C&&(l.isSymbol3D(B)?(B=B.symbolLayers)&&B.forEach(F=>{if(F&&"object"===F.type)switch(D){case "tilt":F.tilt=(F.tilt??0)+C;break;case "roll":F.roll=(F.roll??0)+C;break;default:F.heading=(F.heading??0)+C}}):!l.isSymbol2D(B)||
"simple-marker"!==B.type&&"picture-marker"!==B.type&&"text"!==B.type||(B.angle+=C))};b.applySizesToSymbol=async function(B,C){if(B&&C){if(l.isSymbol3D(B))return m(B,C);if(l.isSymbol2D(B)&&(C=n(C),null!=C))switch(B.type){case "simple-marker":B.size=C;break;case "picture-marker":const D=B.width/B.height;1<D?(B.width=C,B.height=C*D):(B.width=C*D,B.height=C);break;case "simple-line":B.width=C;break;case "text":B.font.size=C}}};b.fetchWebStyleSymbol=async function(B,C){const D=await B.fetchSymbol(C);return D?
D:B.fetchCIMSymbol(C)};b.getCSSFilterFromEffectList=function(B){if(!B)return null;B=B.effects.filter(C=>"bloom"!==C.type).map(C=>C.toJSON());return c.effectFunctionsFromJSON(B)};b.getColorFromSymbol=function(B,C){if(!B)return null;let D=null;l.isSymbol3D(B)?D=t(B):l.isSymbol2D(B)&&(D="cim"===B.type?e.getCIMSymbolColor(B):B.color?new q(B.color):null);return D?w(D,C):null};b.getIconHref=function(B){return B.resource?.href??""};b.getSymbolOutlineSize=function(B){return B?l.isSymbol3D(B)?(B=(B=B.symbolLayers?.at(-1))&&
"outline"in B?B?.outline?.size:void 0,null!=B?B:0):h.px2pt(g.getStroke(B)?.width):0};b.isVolumetricSymbol=function(B){if(null==B||!("symbolLayers"in B)||null==B.symbolLayers)return!1;switch(B.type){case "point-3d":return B.symbolLayers.some(C=>"object"===C.type);case "line-3d":return B.symbolLayers.some(C=>"path"===C.type);case "polygon-3d":return B.symbolLayers.some(C=>"object"===C.type||"extrude"===C.type);default:return!1}};b.symbolHasExtrudeSymbolLayer=function(B){return null!=B&&"polygon-3d"===
B.type&&B.symbolLayers.some(C=>"extrude"===C.type)};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/support/gfxUtils":function(){define("exports ../../assets ../../Color ../../request ../../core/LRUCache ../../core/screenUtils ./cimSymbolUtils".split(" "),function(a,b,q,l,p,k,h){function f(t){if(!t)return null;let w=null;switch(t.type){case "simple-fill":case "picture-fill":case "simple-marker":w=f(t.outline);break;case "simple-line":const v=k.pt2px(t.width);null!=t.style&&
"none"!==t.style&&0!==v&&(w={color:t.color,style:d(t.style),width:v,cap:t.cap,join:"miter"===t.join?k.pt2px(t.miterLimit):t.join},w.dashArray=c(w).join(",")||"none");break;default:w=null}return w}function c(t){if(!t?.style)return[];const {dashArray:w,style:v,width:m}=t;if("string"===typeof w&&"none"!==w)return w.split(",").map(u=>Number(u));const r=m??0,n=e.has(v)?e.get(v).map(u=>u*r):[];if("butt"!==t.cap)for(const [u,x]of n.entries())n[u]=1===u%2?x+r:Math.max(x-r,1);return n}const e=new Map([["dash",
[4,3]],["dashdot",[4,3,1,3]],["dot",[1,3]],["longdash",[8,3]],["longdashdot",[8,3,1,3]],["longdashdotdot",[8,3,1,3,1,3]],["shortdash",[4,1]],["shortdashdot",[4,1,1,1]],["shortdashdotdot",[4,1,1,1,1,1]],["shortdot",[1,1]],["solid",[]]]),g=new p.LRUCache(1E3),d=(()=>{const t={};return w=>{if(t[w])return t[w];const v=w.replaceAll("-","");return t[w]=v}})();q=new q([128,128,128]);a.defaultThematicColor=q;a.dekebabifyLineStyle=d;a.getDashArray=c;a.getFill=function(t){const w=t.style;let v=null;if(t)switch(t.type){case "simple-marker":"cross"!==
w&&"x"!==w&&(v=t.color);break;case "simple-fill":w&&"solid"!==w?"none"!==w&&(v={type:"pattern",x:0,y:0,src:b.getAssetUrl(`esri/symbols/patterns/${w}.png`),width:5,height:5}):v=t.color;break;case "picture-fill":v={type:"pattern",src:t.url,width:k.pt2px(t.width)*t.xscale,height:k.pt2px(t.height)*t.yscale,x:k.pt2px(t.xoffset),y:k.pt2px(t.yoffset)};break;case "text":v=t.color;break;case "cim":v=h.getCIMSymbolColor(t)}return v};a.getPatternUrlWithColor=function(t,w){const v=t+"-"+w;return void 0!==g.get(v)?
Promise.resolve(g.get(v)):l(t,{responseType:"image"}).then(m=>{m=m.data;const r=m.naturalWidth,n=m.naturalHeight,u=document.createElement("canvas");u.width=r;u.height=n;const x=u.getContext("2d");x.fillStyle=w;x.fillRect(0,0,r,n);x.globalCompositeOperation="destination-in";x.drawImage(m,0,0);m=u.toDataURL();g.put(v,m);return m})};a.getStroke=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/constants":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/vec4f64"],
function(a,b){b=b.ZEROS;a.labelMarginPx=4;a.suspendResumeExtentOptimism=1.2;a.transparentUnit=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer":function(){define("exports ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/aaBoundingRect ./graphicUtils ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/ModelDirtyTypes".split(" "),
function(a,b,q,l,p,k,h,f){class c{constructor(t,w,v,m){this.graphics3DSymbolLayer=t;this.renderGeometries=w;this.boundingBox=v;this._drapeSourceRenderer=m;this.type="draped";this.stage=null;this.isElevationSource=this._addedToStage=this._visible=!1}initialize(t){this.stage=t.stage}setVisibility(t){if(null!=this.stage&&this._visible!==t)if((this._visible=t)&&!this._addedToStage)this._addedToStage=!0,this._drapeSourceRenderer.addGeometries(this.renderGeometries,f.DirtyOperation.ADD);else if(t||this._addedToStage){for(const w of this.renderGeometries)w.visible=
this._visible;this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,f.DirtyState.VISIBILITY)}}destroy(){this.stage&&this._addedToStage&&this._drapeSourceRenderer.removeGeometries(this.renderGeometries,f.DirtyOperation.REMOVE);this._visible=this._addedToStage=!1;this.stage=null}getCenterObjectSpace(t=q.create()){return b.set(t,0,0,0)}getBoundingBoxObjectSpace(t=l.create()){return l.empty(t)}addObjectState(t,w){t===h.Object3DState.Highlight&&(this.renderGeometries.forEach(v=>{const m=v.geometry.addHighlight();
w.addRenderGeometry(v,m,this)}),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,f.DirtyState.HIGHLIGHT))}removeObjectState(t){this.renderGeometries.forEach(w=>{t.removeRenderGeometry(w)})}removeRenderGeometryObjectState(t,w){t.geometry.removeHighlight(w);this._addedToStage&&this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,f.DirtyState.HIGHLIGHT)}computeAttachmentOrigin(t){for(const w of this.renderGeometries)w.geometry.computeAttachmentOrigin(d)&&
(t.draped.origin[0]+=d[0],t.draped.origin[1]+=d[1],t.draped.num++)}async getProjectedBoundingBox(t,w,v,m,r){l.empty(r);for(let n=0;n<this.renderGeometries.length;n++)this._getRenderGeometryProjectedBoundingRect(this.renderGeometries[n],t,e,v),l.expandWithRect(r,e);if(w){l.center(r,d);let n;t=k.demResolutionForBoundingBox(r,w.service.spatialReference,w);try{n=await w.service.queryElevation(d[0],d[1],m,t,"ground")}catch(u){}null!=n&&(r[2]=Math.min(r[2],n),r[5]=Math.max(r[5],n))}return r}_getRenderGeometryProjectedBoundingRect(t,
w,v,m){if(this.boundingBox)l.set(g,this.boundingBox);else{t=t.boundingSphere;const r=t[3];g[0]=t[0]-r;g[1]=t[1]-r;g[2]=t[2]-r;g[3]=t[0]+r;g[4]=t[1]+r;g[5]=t[2]+r}w(g,0,2);this.calculateRelativeScreenBounds&&m.push({location:l.center(g),screenSpaceBoundingRect:this.calculateRelativeScreenBounds()});return l.toRect(g,v)}}const e=p.create(),g=l.create(),d=q.create();a.Graphics3DDrapedGraphicLayer=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/placementUtils":function(){define(["exports",
"../../../../core/libs/gl-matrix-2/math/vec2","../../../../core/libs/gl-matrix-2/factories/vec2f64","../../webgl-engine/lib/TextRenderer"],function(a,b,q,l){const p=Object.freeze({left:0,center:.5,right:1}),k=Object.freeze({"bottom-left":q.fromValues(0,0),bottom:q.fromValues(.5,0),"bottom-right":q.fromValues(1,0),left:q.fromValues(0,.5),center:q.fromValues(.5,.5),right:q.fromValues(1,.5),"top-left":q.fromValues(0,1),top:q.fromValues(.5,1),"top-right":q.fromValues(1,1)});a.anchorFromPlacements=function(h,
f){switch(f){case "bottom":return"left"===h?"bottom-left":"right"===h?"bottom-right":"bottom";case "center":return h;case "top":return"left"===h?"top-left":"right"===h?"top-right":"top"}};a.horizontalPlacementFromAnchor=function(h){switch(h){case "bottom-left":case "left":case "top-left":return"left";case "bottom":case "center":case "top":return"center";case "bottom-right":case "right":case "top-right":return"right"}};a.horizontalPlacementToAnchorX=p;a.namedAnchorToHUDMaterialAnchorPos=k;a.textRenderAlignmentFromHorizontalPlacement=
function(h){switch(h){case "left":return l.TextRenderAlignment.Left;case "right":return l.TextRenderAlignment.Right;default:return l.TextRenderAlignment.Center}};a.verticalPlacementFromAlignment=function(h){return"middle"===h?"center":h};a.verticalPlacementFromAnchor=function(h){switch(h){case "bottom-left":case "bottom":case "bottom-right":return"bottom";case "left":case "center":case "right":return"center";case "top-left":case "top":case "top-right":return"top"}};a.verticalScreenOffsetFromAlignment=
function(h,f){switch(h){case "top":return b.set(f,0,l.textVerticalPaddingPx);case "bottom":return b.set(f,0,-l.textVerticalPaddingPx);default:return b.copy(f,q.ZEROS)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextRenderer":function(){define(["exports","../../../../core/mathUtils","../../support/debugFlags","./FontMetrics","./TextHelperCanvas"],function(a,b,q,l,p){class k{constructor(e,g,d,t){this.text=e;this._alignment=g;this._parameters=d;this._maxSize=
t;this._textWidths=[];this._lineWidths=[];this._metricsCached=this._renderPixelRatio=null;this.key=`TextRenderer-${this._parameters.key}-${this._alignment}--${e}`;this._lines=e.replaceAll(" ","\u00a0").split(/\r?\n/)}get displayWidth(){return Math.ceil(this._displayWidth+2*this._horizontalPadding)}get displayHeight(){let e=this._metrics.firstLineAscent;for(let g=0;g<this._lines.length-1;g++)e+=this._lineSpacing;e+=this._metrics.lastLineDescent;return Math.ceil(e+2*this._haloSize+2*this._verticalPadding)}get renderedWidth(){return this._toRoundedRenderUnit(this.displayWidth)}get renderedHeight(){return this._toRoundedRenderUnit(this.displayHeight)}get firstRenderedBaselinePosition(){return this._toRenderUnit(this._firstLineYOffset+
this._metrics.firstLineAscent)}get _firstLineYOffset(){return this._verticalPadding+this._haloSize}get _metrics(){if(null==this._metricsCached){const g=p.getTextHelperCanvas(f,512,512).getContext("2d"),d=this._parameters.definition.pixelRatio;this._parameters.setFontProperties(g,this._fontSize*d);let t=2*this._haloSize;var e=this._parameters.definition.font;if("italic"===e.style||"oblique"===e.style||"bold"===e.weight||"bolder"===e.weight)t+=.3*g.measureText("A").width;this._textWidths.length=0;let w=
this._lineWidths.length=0,v=0,m=0,r=0,n=0;this._lines.forEach((x,y)=>{x=g.measureText(x);const z=x.width/d,A=z+t;this._textWidths.push(z);this._lineWidths.push(A);w=Math.max(w,A);r=Math.max(r,x.actualBoundingBoxAscent/d);n=Math.max(n,x.actualBoundingBoxDescent/d);0===y&&(v=x.actualBoundingBoxAscent/d);y===this._lines.length-1&&(m=x.actualBoundingBoxDescent/d)});e=l.getFontMetrics(this._parameters);const u=Math.max(n,e.maxDescent);this._metricsCached=new c(v,"underline"===this._parameters.definition.font.decoration?
u:m,Math.max(r,e.maxAscent),u,w)}return this._metricsCached}get _lineSpacing(){return(this._midLineHeight+this._linePadding)*this._parameters.definition.lineSpacingFactor}get _midLineHeight(){return this._metrics.midLineHeight}get _linePadding(){return.2*this._midLineHeight}get _midLineAscent(){return this._metrics.maxLineAscent}get _renderedFontSize(){return this._toRenderUnit(this._fontSize)}get _fontSize(){return this._parameters.definition.size}get _renderedHaloSize(){return this._toRenderUnit(this._haloSize)}get _haloSize(){return this._parameters.haloSize}get _horizontalPadding(){return this._hasBackground?
this._parameters.definition.background.padding[0]:0}get _verticalPadding(){return Math.max(this._hasBackground?this._parameters.definition.background.padding[1]:0,1)}get _hasBackground(){return!!this._parameters.backgroundStyle}get renderPixelRatio(){null==this._renderPixelRatio&&(this._renderPixelRatio=Math.min(this._parameters.definition.pixelRatio,Math.min(this._maxSize[0]/this.displayWidth,this._maxSize[1]/this.displayHeight)));return this._renderPixelRatio}_getLineXOffset(e){switch(this._alignment){case a.TextRenderAlignment.Left:return this._horizontalPadding;
case a.TextRenderAlignment.Center:return(this.displayWidth-this._lineWidths[e])/2;case a.TextRenderAlignment.Right:return this.displayWidth-this._horizontalPadding-this._lineWidths[e]}}render(e,g,d){e.save();g/=this.renderPixelRatio;d/=this.renderPixelRatio;const t=g,w=d;var v=this._haloSize;const m=this._firstLineYOffset+this._metrics.firstLineAscent;g+=v;d+=m;const r=0<this._haloSize;r&&this._renderHalo(e,t,w,v,m);this._parameters.setFontProperties(e,this._renderedFontSize);for(v=0;v<this._lines.length;++v){const n=
this._lines[v],u=this._getLineXOffset(v);r&&(e.globalCompositeOperation="destination-out",e.fillStyle="rgb(0, 0, 0)",this._fillText(e,n,g+u,d),this._renderLineDecoration(e,g+u,d,this._textWidths[v]));e.globalCompositeOperation="source-over";e.fillStyle=this._parameters.textStyle;this._fillText(e,n,g+this._getLineXOffset(v),d);this._renderLineDecoration(e,g+u,d,this._textWidths[v]);d+=this._lineSpacing}if(q.debugFlags.TEXT_SHOW_BASELINE)for(e.strokeStyle="rgb(255, 0, 255, 0.5)",e.setLineDash([2,2]),
e.lineWidth=1,g=w+m,d=0;d<this._lines.length;++d)this._drawLine(e,[t,g],[t+this.displayWidth,g]),g+=this._lineSpacing;q.debugFlags.TEXT_SHOW_BORDER&&(e.strokeStyle="rgb(255, 0, 255, 0.5)",e.setLineDash([]),e.lineWidth=1,this._drawBox(e,[t,w],[this.displayWidth,this.displayHeight]));this._hasBackground&&(this._roundedRect(e,t,w,this._parameters.definition.background.borderRadius*this.renderPixelRatio),e.globalCompositeOperation="destination-over",e.fillStyle=this._parameters.backgroundStyle,e.fill());
e.restore()}_renderLineDecoration(e,g,d,t,w=!1){if("none"!==this._parameters.definition.font.decoration&&0!==t){var v=Math.max(this._parameters.definition.size/16,1);switch(this._parameters.definition.font.decoration){case "underline":d+=2*v;break;case "line-through":d-=.33*this._midLineAscent}var m=w?this._haloSize:0;e.strokeStyle=w?this._parameters.haloStyle:this._parameters.textStyle;e.lineWidth=this._toRenderUnit(v+2*m);e.beginPath();e.moveTo(this._toRenderUnit(g-m),this._toRenderUnit(d));e.lineTo(this._toRenderUnit(g+
t+m),this._toRenderUnit(d));e.stroke()}}_roundedRect(e,g,d,t){g=this._toRenderUnit(g);d=this._toRenderUnit(d);const w=this.renderedWidth,v=this.renderedHeight;0===t?e.rect(g,d,w,v):(t=b.clamp(t,0,Math.floor(v/2)),e.beginPath(),e.moveTo(g,d+t),e.arcTo(g,d,g+t,d,t),e.lineTo(g+w-t,d),e.arcTo(g+w,d,g+w,d+t,t),e.lineTo(g+w,d+v-t),e.arcTo(g+w,d+v,g+w-t,d+v,t),e.lineTo(g+t,d+v),e.arcTo(g,d+v,g,d+v-t,t),e.closePath())}_renderHalo(e,g,d,t,w){const v=this.renderedWidth,m=this.renderedHeight,r=p.getTextHelperCanvas(f,
Math.max(v,512),Math.max(m,512)),n=r.getContext("2d");n.clearRect(0,0,v,m);this._parameters.setFontProperties(n,this._renderedFontSize);n.fillStyle=this._parameters.haloStyle;n.strokeStyle=this._parameters.haloStyle;var u=3>this._renderedHaloSize;n.lineJoin=u?"miter":"round";u?this._renderHaloEmulated(n,t,w):this._renderHaloNative(n,t,w);for(u=0;u<this._lines.length;++u){const x=this._getLineXOffset(u);this._renderLineDecoration(n,t+x,w,this._textWidths[u],!0);w+=this._lineSpacing}e.globalAlpha=this._parameters.definition.halo.color[3];
e.drawImage(r,0,0,v,m,this._toRenderUnit(g),this._toRenderUnit(d),v,m);e.globalAlpha=1}_renderHaloEmulated(e,g,d){for(let t=0;t<this._lines.length;++t){const w=this._lines[t],v=this._getLineXOffset(t);for(const [m,r]of h)this._fillText(e,w,g+v+this._haloSize*m,d+this._haloSize*r);d+=this._lineSpacing}}_renderHaloNative(e,g,d){const t=2*this._haloSize;for(let w=0;w<this._lines.length;++w){const v=this._lines[w],m=this._getLineXOffset(w);for(let r=0;5>r;r++)e.lineWidth=this._toRenderUnit((.6+.1*r)*
t),this._strokeText(e,v,g+m,d);d+=this._lineSpacing}}get _displayWidth(){return this._metrics.displayWidth}_toRenderUnit(e){return e*this.renderPixelRatio}_toRoundedRenderUnit(e){return Math.round(e*this.renderPixelRatio)}_fillText(e,g,d,t){e.fillText(g,this._toRenderUnit(d),this._toRenderUnit(t))}_strokeText(e,g,d,t){e.strokeText(g,this._toRenderUnit(d),this._toRenderUnit(t))}_drawLine(e,g,d){e.beginPath();e.moveTo(this._toRoundedRenderUnit(g[0])+.5,this._toRoundedRenderUnit(g[1])+.5);e.lineTo(this._toRoundedRenderUnit(d[0])+
.5,this._toRoundedRenderUnit(d[1])+.5);e.stroke()}_drawBox(e,g,d){var t=this._toRenderUnit(g[0]);g=this._toRenderUnit(g[1]);var w=this._toRenderUnit(d[0]);const v=this._toRenderUnit(d[1]);d=Math.floor(t)+.5;t=Math.ceil(t+w)-.5;w=Math.floor(g)+.5;g=Math.ceil(g+v)-.5;e.beginPath();e.moveTo(d,w);e.lineTo(t,w);e.lineTo(t,g);e.lineTo(d,g);e.lineTo(d,w);e.stroke()}}const h=[];for(let e=0;360>e;e+=22.5)h.push([Math.cos(Math.PI*e/180),Math.sin(Math.PI*e/180)]);a.TextRenderAlignment=void 0;(function(e){e[e.Left=
0]="Left";e[e.Center=1]="Center";e[e.Right=2]="Right"})(a.TextRenderAlignment||(a.TextRenderAlignment={}));const f={canvas:null};class c{get firstLineHeight(){return this.firstLineAscent+this.maxLineDescent}get midLineHeight(){return this.maxLineAscent+this.maxLineDescent}get lastLineHeight(){return this.maxLineAscent+this.lastLineDescent}constructor(e,g,d,t,w){this.firstLineAscent=e;this.lastLineDescent=g;this.maxLineAscent=d;this.maxLineDescent=t;this.displayWidth=w}}a.TextRenderer=k;a.textVerticalPaddingPx=
1;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/FontMetrics":function(){define(["exports","./TextHelperCanvas"],function(a,b){const q=new Map;class l{get maxHeight(){return this.maxAscent+this.maxDescent}constructor(h,f){this.maxAscent=h;this.maxDescent=f}}const p={canvas:null},k=(()=>{let h="";for(let f=32;127>f;f++)h+=String.fromCharCode(f);return h})();a.getFontMetrics=function(h){const {size:f}=h.definition,c=h.fontString(f);var e=q.get(c);e||
(e=b.getTextHelperCanvas(p,0,0).getContext("2d"),h.setFontProperties(e,f),h=e.measureText(k),e=new l(h.actualBoundingBoxAscent,h.actualBoundingBoxDescent),q.set(c,e));return e};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextHelperCanvas":function(){define(["exports"],function(a){a.getTextHelperCanvas=function(b,q,l){b.canvas||(b.canvas=document.createElement("canvas"));b.canvas.width=q;b.canvas.height=l;return b.canvas};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/RenderGeometry":function(){define("exports ../../../../core/uid ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../chunks/sphere ../../support/mathUtils".split(" "),function(a,b,q,l,p,k,h){class f{constructor(e,g={}){this.geometry=e;this.screenToWorldRatio=1;this._transformation=l.create();this._boundingSphere=this._shaderTransformation=null;this.id=
b.generateUID();this.layerUid=g.layerUid;this.graphicUid=g.graphicUid;this.castShadow=g.castShadow??!1;null!=g.objectShaderTransformation&&this.objectShaderTransformationChanged(g.objectShaderTransformation)}get transformation(){return this._transformation}set transformation(e){q.copy(this._transformation,e);this._boundingSphere=null}get boundingInfo(){return this.geometry.boundingInfo}objectShaderTransformationChanged(e){null==e?this._shaderTransformation=null:(this._shaderTransformation??(this._shaderTransformation=
l.create()),q.multiply(this._shaderTransformation,e,this.geometry.transformation));this._boundingSphere=null}get boundingSphere(){if(!this.boundingInfo)return k.NullSphere;null==this._boundingSphere&&(this._boundingSphere??(this._boundingSphere=k.create()),p.transformMat4(k.getCenter(this._boundingSphere),this.boundingInfo.center,this.shaderTransformation),this._boundingSphere[3]=this.boundingInfo.radius*h.maxScale(this.shaderTransformation));return this._boundingSphere}get material(){return this.geometry.material}get type(){return this.geometry.type}get shaderTransformation(){return this._shaderTransformation??
this.transformation}get attributes(){return this.geometry.attributes}get highlights(){return this.geometry.highlights}get occludees(){return this.geometry.occludees}get visible(){return this.geometry.visible}set visible(e){this.geometry.visible=e}}class c extends f{}a.RenderGeometry=f;a.ValidatedRenderGeometry=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DLineSymbolLayer":function(){define("exports ../../../../geometry ../../../../core/Error ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/support/aaBoundingBox ../../../../renderers/support/renderingInfoUtils ./ElevationAligners ./elevationAlignmentUtils ./Graphics3DDrapedGraphicLayer ./Graphics3DObject3DGraphicLayer ./Graphics3DSymbolLayer ./interfaces ./lineUtils ../support/FastSymbolUpdates ../../support/debugFlags ../../support/engineContent/line ../../support/renderInfoUtils/line ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/RenderGeometry ../../webgl-engine/materials/LineMarkerMaterial ../../webgl-engine/materials/lineStippleUtils ../../webgl-engine/materials/RibbonLineMaterial ../../../../geometry/Extent ../../../../geometry/Polygon".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C){function D(O){switch(O.type){case "extent":if(O instanceof B)return C.fromExtent(O);break;case "polygon":case "polyline":return O}return null}function F(O,L,P){null!=L&&P.symbolLayerStatePatches.push(()=>L.setParameters({color:O}))}const H=["polyline","polygon","extent"],N=new v.ConvertOptions({size:!0,color:!0,rotation:!1,opacity:!0});class E extends d.Graphics3DSymbolLayer{constructor(O,L,P,M){super(O,L,P,M)}async doLoad(){this._fastUpdates=
v.initFastSymbolUpdatesState(this._context.renderer,N);if(!this._drivenProperties.size&&0>(null!=this.symbolLayer.size?this.symbolLayer.size:l.px2pt(1)))throw new q("graphics3dlinesymbollayer:invalid-size","Symbol sizes may not be negative values");}_getMaterialParameters(O,L=!1){const P=this._getCombinedOpacityAndColor(L&&this._markerColor||this._materialColor);this._patternHidesLine&&!L&&(P[3]=0);O={width:this._computeMaterialWidth(this.symbolLayer?.size),color:P,hasPolygonOffset:!0,join:this.symbolLayer.join||
"miter",cap:w.parseCapType(this.symbolLayer.cap||"butt"),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:O,stipplePattern:z.getStipplePatternForLinePattern(this.symbolLayer.pattern)};return this._fastUpdates?.visualVariables?{...O,...this._fastUpdates.materialParameters}:O}get _materialColor(){return this.symbolLayer.material?.color}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){null==this._materials[I.Line]&&(this._materials[I.Line]=new A.RibbonLineMaterial(this._getMaterialParameters(!1)),
this._context.stage.add(this._materials[I.Line]));return this._materials[I.Line]}get _ringMaterial(){null==this._materials[I.Ring]&&(this._materials[I.Ring]=new A.RibbonLineMaterial(this._getMaterialParameters(!0)),this._context.stage.add(this._materials[I.Ring]));return this._materials[I.Ring]}get _wireframeLineMaterial(){null==this._materials[I.LineWireframe]&&(this._materials[I.LineWireframe]=new A.RibbonLineMaterial({...this._getMaterialParameters(!1),wireframe:!0}),this._context.stage.add(this._materials[I.LineWireframe]));
return this._materials[I.LineWireframe]}get _wireframeRingMaterial(){null==this._materials[I.RingWireframe]&&(this._materials[I.RingWireframe]=new A.RibbonLineMaterial({...this._getMaterialParameters(!0),wireframe:!0}),this._context.stage.add(this._materials[I.RingWireframe]));return this._materials[I.RingWireframe]}get _markerMaterial(){null==this._materials[I.Marker]&&null!=this.symbolLayer.marker&&(this._materials[I.Marker]=new y.LineMarkerMaterial({...this._getMaterialParameters(!1,!0),placement:this.symbolLayer.marker.placement,
markerPrimitive:w.parseLineMarkerStyle(this.symbolLayer.marker.style)}),this._context.stage.add(this._materials[I.Marker]));return this._materials[I.Marker]}destroy(){super.destroy();this._forEachMaterial(O=>this._context.stage.remove(O));this._materials.length=0}_getDrivenSize(O){return this._drivenProperties.size&&O.size?l.pt2px(h.getDriverAxisSizeValueAny(O.size)):1}_getDrivenColor(O){const L=p.fromValues(1,1,1,1);this._drivenProperties.color&&O.color&&(L[0]=O.color[0],L[1]=O.color[1],L[2]=O.color[2],
0<O.color.length&&(L[3]=O.color[3]));this._drivenProperties.opacity&&O.opacity&&(L[3]=O.opacity);return L}createGraphics3DGraphic(O){const L=O.graphic;if(!this._validateGeometry(L.geometry,H,this.symbolLayer.type))return null;const P=this.setGraphicElevationContext(L);this.ensureDrapedStatus("on-the-ground"===P.mode);return this.draped?this._createAsOverlay(O,this._context.layer.uid):this._createAs3DShape(O,P,L.uid)}applyRendererDiff(O,L){for(const P in O.diff)switch(P){case "visualVariables":const M=
this._fastUpdates;if(v.updateFastSymbolUpdatesState(M,L,N))this._forEachMaterial(K=>K?.setParameters(M.materialParameters));else return t.ApplyRendererDiffResult.RecreateSymbol;break;default:return t.ApplyRendererDiffResult.RecreateSymbol}return t.ApplyRendererDiffResult.FastUpdate}prepareSymbolLayerPatch(O){if("partial"===O.diff.type){var L=O.diff.diff,P={};"complete"===L.size?.type&&(P.width=this._computeMaterialWidth(L.size.newValue),delete L.size);"complete"===L.cap?.type&&(P.cap=w.parseCapType(L.cap.newValue??
"butt"),delete L.cap);var M=this._prepareMarkerPatch(O,L);this._prepareMaterialPatch(O,L,M);O.symbolLayerStatePatches.push(()=>this._forEachMaterial(K=>K?.setParameters(P)))}}layerOpacityChanged(){this._forEachMaterial((O,L)=>this._updateMaterialLayerOpacity(O,L===I.Marker))}_forEachMaterial(O){this._materials.forEach(O)}_updateMaterialLayerOpacity(O,L=!1){if(null!=O){var P=O.parameters.color,M=this.symbolLayer?.material?.color;L=this._patternHidesLine&&!L?0:this._getCombinedOpacity(M);P=p.fromValues(P[0],
P[1],P[2],L);O.setParameters({color:P})}}layerElevationInfoChanged(O,L,P){const M=this._elevationContext.mode;P=c.elevationModeChangeUpdateType(E.elevationModeChangeTypes,P,M);if(P!==c.SymbolUpdateType.UPDATE)return P;const K=c.needsElevationUpdates2D(M);return this.updateGraphics3DGraphicElevationInfo(O,L,()=>K)}slicePlaneEnabledChanged(){const O={hasSlicePlane:this._context.slicePlaneEnabled};this._forEachMaterial(L=>L?.setParameters(O));return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(O,
L,P){const M=D(O.graphic.geometry);var K="polygon"===M.type?M.rings:M.paths,J=[];const R=k.create(),Q=n.geometryToRenderInfo(M,this._context.elevationProvider,this._context.renderCoordsHelper,L);this._logGeometryCreationWarnings(Q,K,"polygon"===M.type?"rings":"paths","LineSymbol3DLayer");for(K=0;K<Q.lines.length;K++){var W=Q.lines[K],S=W.position;W=W.mapPositions;if(null!=this._context.clippingExtent&&(k.empty(R),k.expandWithBuffer(R,W),!k.intersectsClippingArea(R,this._context.clippingExtent)))continue;
S=this._createGeometry("polygon"===M.type?this._ringMaterial:this._lineMaterial,O,S,W,M.type,G.ELEVATED,P);J.push(S);m.debugFlags.LINE_WIREFRAMES&&J.push(S.instantiate({material:"polygon"===M.type?this._wireframeRingMaterial:this._wireframeLineMaterial}));null!=this._markerMaterial&&J.push(S.instantiate({material:this._markerMaterial}))}if(0===J.length)return null;O=new u.Object3D({geometries:J,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:P});J=new g.Graphics3DObject3DGraphicLayer(this,
O,J,null,null,f.sharedGeometryElevationAligner,L);J.alignedSampledElevation=Q.sampledElevation;J.needsElevationUpdates=c.needsElevationUpdates2D(L.mode);return J}_createGeometry(O,L,P,M,K,J,R){J=J===G.DRAPED?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null;K="polygon"===K;const Q=this._fastUpdates?.visualVariables.color,W=this._fastUpdates?.visualVariables.size,S=this._fastUpdates?.visualVariables.opacity;R=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:R,
layerUid:this._context.layer.uid});L={position:P,size:W?null:this._getDrivenSize(L.renderingInfo),color:Q?null:this._getDrivenColor(L.renderingInfo),sizeFeature:W?v.getAttributeValue(W.field,L.graphic):null,colorFeature:Q?v.getAttributeValue(Q.field,L.graphic):null,opacityFeature:S?v.getAttributeValue(S.field,L.graphic):null};return r.createGeometry(O,{overlayInfo:J,removeDuplicateStartEnd:K,mapPositions:M,attributeData:L},R)}_createAsOverlay(O,L){const P=O.graphic,M=D(P.geometry);var K="polygon"===
M.type?M.rings:M.paths;const J="polygon"===M.type?this._ringMaterial:this._lineMaterial;J.renderPriority=this._renderPriority;const R=m.debugFlags.LINE_WIREFRAMES?"polygon"===M.type?this._wireframeRingMaterial:this._wireframeLineMaterial:null,Q=this._markerMaterial;null!=R&&(R.renderPriority=this._renderPriority-.001);null!=Q&&(Q.renderPriority=this._renderPriority-.002);const W=[],S=k.create(),V=k.empty();var T=n.geometryToRenderInfoDraped(M,this._context.overlaySR);this._logGeometryCreationWarnings(T,
K,"polygon"===M.type?"rings":"paths","LineSymbol3DLayer");for(const Y of T.lines)k.empty(S),k.expandWithBuffer(S,Y.position),k.intersectsClippingArea(S,this._context.clippingExtent)&&(k.expandWithAABB(V,S),K=ha=>{ha=this._createGeometry(ha,O,Y.position,void 0,M.type,G.DRAPED,P.uid);ha=new x.RenderGeometry(ha,{layerUid:L,graphicUid:P.uid});W.push(ha)},null!=Q&&(K(Q),T=this.symbolLayer.marker.placement,"begin"!==T&&"begin-end"!==T||k.expandWithBuffer(S,Y.position,0,1),"end"!==T&&"begin-end"!==T||k.expandWithBuffer(S,
Y.position,Y.position.length-3,1)),K(J),m.debugFlags.LINE_WIREFRAMES&&K(R));return new e.Graphics3DDrapedGraphicLayer(this,W,V,this._context.drapeSourceRenderer)}get _patternHidesLine(){const O=this.symbolLayer.pattern;return null!=O&&"style"===O.type&&"none"===O.style}_computeMaterialWidth(O){O=O??l.px2pt(1);return this._drivenProperties.size?this._fastUpdates?.visualVariables.size?l.pt2px(1):1:l.pt2px(O)}_prepareMaterialPatch(O,L,P){var M=L.material;null==M?P.changed&&P.useMaterialColor&&F(this._getCombinedOpacityAndColor(this._materialColor),
this._materials[I.Marker],O):"collection"!==M.type&&(M=this._getCombinedOpacityAndColor("complete"===M.type?M.newValue?.color:"complete"===M.diff.color?.type?M.diff.color.newValue:null),P.useMaterialColor&&F(p.clone(M),this._materials[I.Marker],O),this._patternHidesLine&&(M[3]=0),F(M,this._materials[I.Line],O),delete L.material)}_prepareMarkerPatch(O,L){const P=L.marker,M=this._markerMaterial;if(null==P||"partial"!==P.type||null==P.diff||null!=P.diff.placement||null!=P.diff.style&&"complete"!==P.diff.style.type||
null!=P.diff.color&&"complete"!==P.diff.color.type||null==M)return{changed:!1,useMaterialColor:null==this._markerColor};var K=P.diff.color;const J=null!=K;K=J?K.newValue:null;const R=null==K&&null==this._markerColor;K&&F(this._getCombinedOpacityAndColor(K),M,O);const Q=P.diff.style?.newValue;Q&&O.symbolLayerStatePatches.push(()=>M.setParameters({markerPrimitive:w.parseLineMarkerStyle(Q)}));delete L.marker;return{changed:J,useMaterialColor:R}}}E.elevationModeChangeTypes={definedChanged:c.SymbolUpdateType.RECREATE,
staysOnTheGround:c.SymbolUpdateType.NONE,onTheGroundChanged:c.SymbolUpdateType.RECREATE};var G;(function(O){O[O.DRAPED=0]="DRAPED";O[O.ELEVATED=1]="ELEVATED"})(G||={});var I;(function(O){O[O.Line=0]="Line";O[O.Ring=1]="Ring";O[O.LineWireframe=2]="LineWireframe";O[O.RingWireframe=3]="RingWireframe";O[O.Marker=4]="Marker"})(I||={});a.Graphics3DLineSymbolLayer=E;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/lineUtils":function(){define(["exports","../../../../core/has",
"../../webgl-engine/shaders/RibbonLineTechniqueConfiguration"],function(a,b,q){a.parseCapType=function(l){switch(l){case "butt":return q.CapType.BUTT;case "square":return q.CapType.SQUARE;case "round":return q.CapType.ROUND;default:return null}};a.parseLineMarkerStyle=function(l){return"diamond"===l?"kite":l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/engineContent/line":function(){define("exports ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/projection/projectors ../../../../geometry/support/DoubleArray ../../../../geometry/support/FloatArray ../../../../geometry/support/Indices ../../../ViewingMode ../../webgl-engine/lib/Attribute ../../webgl-engine/lib/ContentObjectType ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){const v=q.create(),m=q.create();a.createGeometry=function(r,n,u=null){const x=[],y=n.mapPositions,{attributeData:{position:z},removeDuplicateStartEnd:A}=n;var B=z.length;B=z[0]===z[B-3]&&z[1]===z[B-2]&&z[2]===z[B-1]&&A;var C=z.length/3-(B?1:0),D=Array(2*(C-1)),F=B?z.slice(0,-3):z,H=0;for(var N=0;N<C-1;N++)D[H++]=N,D[H++]=N+1;x.push([w.VertexAttribute.POSITION,new g.Attribute(F,D,3,B)]);C=x[0][1].data;B=c.getZeroIndexArray(x[0][1].indices.length);null==n.attributeData.colorFeature&&
x.push([w.VertexAttribute.COLOR,new g.Attribute(n.attributeData.color??l.ONES,B,4)]);null==n.attributeData.sizeFeature&&x.push([w.VertexAttribute.SIZE,new g.Attribute([n.attributeData.size??1],B,1,!0)]);n.attributeData.normal&&x.push([w.VertexAttribute.NORMAL,new g.Attribute(n.attributeData.normal,B,3)]);null!=n.attributeData.colorFeature&&x.push([w.VertexAttribute.COLORFEATUREATTRIBUTE,new g.Attribute([n.attributeData.colorFeature],B,1,!0)]);null!=n.attributeData.sizeFeature&&x.push([w.VertexAttribute.SIZEFEATUREATTRIBUTE,
new g.Attribute([n.attributeData.sizeFeature],B,1,!0)]);null!=n.attributeData.opacityFeature&&x.push([w.VertexAttribute.OPACITYFEATUREATTRIBUTE,new g.Attribute([n.attributeData.opacityFeature],B,1,!0)]);if(null!=n.overlayInfo&&n.overlayInfo.renderCoordsHelper.viewingMode===e.ViewingMode.Global&&n.overlayInfo.spatialReference.isGeographic){B=h.newDoubleArray(C.length);n=p.getReferenceEllipsoid(n.overlayInfo.spatialReference);for(D=0;D<B.length;D+=3)k.lonLatToWebMercatorComparable(C,D,B,D,n);n=C.length/
3;C=f.newFloatArray(n+1);D=v;F=m;N=H=0;b.set(D,B[N++],B[N++]);N++;C[0]=0;for(let E=1;E<n+1;++E)E===n&&(N=0),b.set(F,B[N++],B[N++]),N++,H+=b.dist(D,F),C[E]=H,[D,F]=[F,D];x.push([w.VertexAttribute.DISTANCETOSTART,new g.Attribute(C,x[0][1].indices,1,!0)])}return new t.Geometry(r,x,y,d.ContentObjectType.Line,u)};a.lineStripsToParameters=function(r,n){if(null==r||0===r.length)return[];const u=[];r.forEach(x=>{const y=h.newDoubleArray(3*x.length);x.forEach((z,A)=>{y[3*A]=z[0];y[3*A+1]=z[1];y[3*A+2]=z[2]});
u.push({attributeData:{position:y,normal:n},removeDuplicateStartEnd:!1})});return u};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/renderInfoUtils/line":function(){define("exports ../../../../geometry/projection/projectBuffer ../../../../geometry/support/DoubleArray ../../../../geometry/support/triangulationUtils ../../layers/graphics/elevationAlignmentUtils ../../terrain/OverlayRenderer".split(" "),function(a,b,q,l,p,k){function h(f,c,e=null){const g=[];for(const {index:d,
count:t}of f){if(1>=t)continue;f=3*d;const w=3*t;g.push({position:q.doubleSubArray(c,3*d,3*t),mapPositions:null!=e?q.doubleSubArray(e,f,w):void 0})}return g}a.geometryToRenderInfo=function(f,c,e,g){const {position:d,outlines:t}=l.ringsToTriangulationInfo("polygon"===f.type?f.rings:f.paths,!!f.hasZ,"polygon"===f.type?l.CounterClockwiseMode.CCW_IS_HOLE:l.CounterClockwiseMode.NONE,f.spatialReference),w=q.newDoubleArray(d.length);f=p.applyPerVertexElevationAlignment(d,f.spatialReference,0,w,0,d,0,d.length/
3,c,e,g);c=null!=f;return{lines:c?h(t,d,w):[],projectionSuccess:c,sampledElevation:f}};a.geometryToRenderInfoDraped=function(f,c){const {position:e,outlines:g}=l.ringsToTriangulationInfo("polygon"===f.type?f.rings:f.paths,!1,"polygon"===f.type?l.CounterClockwiseMode.CCW_IS_HOLE:l.CounterClockwiseMode.NONE);f=b.projectBuffer(e,f.spatialReference,0,e,c,0,e.length/3);for(c=2;c<e.length;c+=3)e[c]=k.drapedZ;return{lines:f?h(g,e):[],projectionSuccess:f}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/materials/LineMarkerMaterial":function(){define("exports ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../lib/GLTextureMaterial ../lib/Material ../lib/RenderSlot ../lib/VertexAttribute ./VisualVariablePassParameters ../shaders/LineMarkerTechnique ../shaders/LineMarkerTechniqueConfiguration ../shaders/RibbonLineTechniqueConfiguration".split(" "),function(a,b,q,l,p,k,
h,f,c,e,g,d,t){class w extends h.Material{constructor(x){super(x,new m);this.produces=new Map([[f.RenderSlot.OPAQUE_MATERIAL,y=>y===p.ShaderOutput.Highlight||p.isColor(y)&&this.parameters.renderOccluded===h.RenderOccludedFlag.OccludeAndTransparentStencil],[f.RenderSlot.OPAQUE_NO_SSAO_DEPTH,y=>p.isDepth(y)],[f.RenderSlot.OCCLUDER_MATERIAL,y=>p.isColorHighlightOrDepth(y)&&this.parameters.renderOccluded===h.RenderOccludedFlag.OccludeAndTransparentStencil],[f.RenderSlot.TRANSPARENT_OCCLUDER_MATERIAL,
y=>p.isColorHighlightOrDepth(y)&&this.parameters.renderOccluded===h.RenderOccludedFlag.OccludeAndTransparentStencil],[f.RenderSlot.TRANSPARENT_MATERIAL,y=>p.isColor(y)&&this.parameters.writeDepth],[f.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,y=>p.isColor(y)&&!this.parameters.writeDepth],[f.RenderSlot.DRAPED_MATERIAL,y=>y===p.ShaderOutput.Color||y===p.ShaderOutput.Highlight]]);this._vertexAttributeLocations=g.vertexAttributeLocations;this._configuration=new d.LineMarkerTechniqueConfiguration;
this._layout=this.createLayout()}getConfiguration(x,y){this._configuration.output=x;this._configuration.space=y.slot===f.RenderSlot.DRAPED_MATERIAL?d.LineMarkerSpace.Draped:this.parameters.worldSpace?d.LineMarkerSpace.World:d.LineMarkerSpace.Screen;this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments;this._configuration.hasCap=this.parameters.cap!==t.CapType.BUTT;this._configuration.anchor=this.parameters.anchor;this._configuration.hasTip=this.parameters.hasTip;this._configuration.hasSlicePlane=
this.parameters.hasSlicePlane;this._configuration.hasOccludees=this.parameters.hasOccludees;this._configuration.writeDepth=this.parameters.writeDepth;this._configuration.vvSize=!!this.parameters.vvSize;this._configuration.vvColor=!!this.parameters.vvColor;this._configuration.vvOpacity=!!this.parameters.vvOpacity;this._configuration.occluder=this.parameters.renderOccluded===h.RenderOccludedFlag.OccludeAndTransparentStencil;this._configuration.transparencyPassType=y.transparencyPassType;this._configuration.multipassEnabled=
y.multipassEnabled;this._configuration.cullAboveGround=y.multipassTerrain.cullAboveGround;return this._configuration}intersect(){}createLayout(){const x=l.newLayout().vec3f(c.VertexAttribute.POSITION).vec3f(c.VertexAttribute.PREVPOSITION).vec2f(c.VertexAttribute.UV0);this.parameters.worldSpace&&x.vec3f(c.VertexAttribute.NORMAL);this.parameters.vvSize?x.f32(c.VertexAttribute.SIZEFEATUREATTRIBUTE):x.f32(c.VertexAttribute.SIZE);this.parameters.vvColor?x.f32(c.VertexAttribute.COLORFEATUREATTRIBUTE):x.vec4f(c.VertexAttribute.COLOR);
this.parameters.vvOpacity&&x.f32(c.VertexAttribute.OPACITYFEATUREATTRIBUTE);return x}createBufferWriter(){return new r(this._layout,this.parameters)}createGLMaterial(x){return new v(x)}}class v extends k.GLTextureMaterial{constructor(){super(...arguments);this._markerPrimitive=null}dispose(){super.dispose();this._markerTextures.release(this._markerPrimitive);this._markerPrimitive=null}_updateParameters(x){const y=this._material.parameters.markerPrimitive;y!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(y,
this._markerPrimitive)}),this._markerPrimitive=y);this._material.setParameters(this.textureBindParameters);return this.ensureTechnique(g.LineMarkerTechnique,x)}_updateOccludeeState(x){x.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:x.hasOccludees})}beginSlot(x){this._output===p.ShaderOutput.Color&&this._updateOccludeeState(x);return this._updateParameters(x)}}class m extends e.VisualVariablePassParameters{constructor(){super(...arguments);this.width=
0;this.color=[1,1,1,1];this.markerPrimitive="arrow";this.placement="end";this.cap=t.CapType.BUTT;this.anchor=d.LineMarkerAnchor.Center;this.hideOnShortSegments=this.worldSpace=this.hasTip=!1;this.writeDepth=!0;this.hasOccludees=this.vvFastUpdate=this.hasSlicePlane=!1;this.markerTexture=null}}class r{constructor(x,y){this.vertexBufferLayout=x;this._parameters=y}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(x,y,z,A,B){const C=z.attributes.get(c.VertexAttribute.POSITION).data,
D=C.length/3;let F=[1,0,0];y=z.attributes.get(c.VertexAttribute.NORMAL);this._parameters.worldSpace&&null!=y&&(F=y.data);let H=1,N=0;this._parameters.vvSize?N=z.attributes.get(c.VertexAttribute.SIZEFEATUREATTRIBUTE).data[0]:z.attributes.has(c.VertexAttribute.SIZE)&&(H=z.attributes.get(c.VertexAttribute.SIZE).data[0]);let E=[1,1,1,1],G=0;this._parameters.vvColor?G=z.attributes.get(c.VertexAttribute.COLORFEATUREATTRIBUTE).data[0]:z.attributes.has(c.VertexAttribute.COLOR)&&(E=z.attributes.get(c.VertexAttribute.COLOR).data);
let I=0;this._parameters.vvOpacity&&(I=z.attributes.get(c.VertexAttribute.OPACITYFEATUREATTRIBUTE).data[0]);const O=new Float32Array(A.buffer);let L=this.vertexBufferLayout.stride/4*B;const P=(K,J,R,Q)=>{O[L++]=K[0];O[L++]=K[1];O[L++]=K[2];O[L++]=J[0];O[L++]=J[1];O[L++]=J[2];O[L++]=R[0];O[L++]=R[1];this._parameters.worldSpace&&(O[L++]=F[0],O[L++]=F[1],O[L++]=F[2]);this._parameters.vvSize?O[L++]=N:O[L++]=H;this._parameters.vvColor?O[L++]=G:(K=Math.min(4*Q,E.length-4),O[L++]=E[K],O[L++]=E[K+1],O[L++]=
E[K+2],O[L++]=E[K+3]);this._parameters.vvOpacity&&(O[L++]=I)};let M;(function(K){K[K.ASCENDING=1]="ASCENDING";K[K.DESCENDING=-1]="DESCENDING"})(M||={});z=(K,J)=>{const R=b.set(n,C[3*K],C[3*K+1],C[3*K+2]),Q=u;let W=K+J;do b.set(Q,C[3*W],C[3*W+1],C[3*W+2]),W+=J;while(b.equals(R,Q)&&0<=W&&W<D);x&&(b.transformMat4(R,R,x),b.transformMat4(Q,Q,x));P(R,Q,[-1,-1],K);P(R,Q,[1,-1],K);P(R,Q,[1,1],K);P(R,Q,[-1,-1],K);P(R,Q,[1,1],K);P(R,Q,[-1,1],K)};A=this._parameters.placement;"begin"!==A&&"begin-end"!==A||z(0,
M.ASCENDING);"end"!==A&&"begin-end"!==A||z(D-1,M.DESCENDING)}}const n=q.create(),u=q.create();a.LineMarkerMaterial=w;a.Parameters=m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/LineMarkerTechnique":function(){define("require exports ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/OrderIndependentTransparency ../lib/Program ../lib/StencilUtils ../lib/TransparencyPassType ../lib/VertexAttribute ../../../../chunks/LineMarker.glsl ./LineMarkerTechniqueConfiguration ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){const v=new Map([[e.VertexAttribute.POSITION,0],[e.VertexAttribute.PREVPOSITION,1],[e.VertexAttribute.UV0,2],[e.VertexAttribute.NORMAL,3],[e.VertexAttribute.COLOR,4],[e.VertexAttribute.COLORFEATUREATTRIBUTE,4],[e.VertexAttribute.SIZE,5],[e.VertexAttribute.SIZEFEATUREATTRIBUTE,5],[e.VertexAttribute.OPACITYFEATUREATTRIBUTE,6]]);class m extends p.ShaderTechnique{initializeProgram(r){return new h.Program(r.rctx,m.shader.get().build(this.configuration),v)}_makePipelineState(r,
n){const u=this.configuration,x=r===c.TransparencyPassType.NONE;return w.makePipelineState({blending:u.output===q.ShaderOutput.Color?x?k.blendingDefault:k.oitBlending(r):null,depthTest:u.space===d.LineMarkerSpace.Draped?null:{func:k.oitDepthTest(r)},depthWrite:u.space===d.LineMarkerSpace.Draped?null:x?u.writeDepth?w.defaultDepthWriteParams:null:k.oitDepthWrite(r),drawBuffers:u.output===q.ShaderOutput.Depth?{buffers:[t.SpecialDrawBuffers.NONE]}:k.oitDrawBuffers(r),colorWrite:w.defaultColorWriteParams,
stencilWrite:u.hasOccludees?f.stencilWriteMaskOn:null,stencilTest:u.hasOccludees?n?f.stencilToolMaskBaseParams:f.stencilBaseAllZerosParams:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(){this.configuration.occluder&&(this._occluderPipelineTransparent=w.makePipelineState({blending:k.blendingDefault,depthTest:f.depthCompareAlways,depthWrite:null,colorWrite:w.defaultColorWriteParams,stencilWrite:null,stencilTest:f.stencilToolTransparentOccluderParams}),this._occluderPipelineOpaque=w.makePipelineState({blending:k.blendingDefault,
depthTest:f.depthCompareAlways,depthWrite:null,colorWrite:w.defaultColorWriteParams,stencilWrite:f.stencilWriteMaskOff,stencilTest:f.stencilToolMaskOccluderParams}),this._occluderPipelineMaskWrite=w.makePipelineState({blending:null,depthTest:f.depthCompareLess,depthWrite:null,colorWrite:null,stencilWrite:f.stencilWriteMaskOn,stencilTest:f.stencilToolMaskBaseParams}));this._occludeePipelineState=this._makePipelineState(this.configuration.transparencyPassType,!0);return this._makePipelineState(this.configuration.transparencyPassType,
!1)}getPipeline(r,n,u){return r?this._occludeePipelineState:this.configuration.occluder?u?this._occluderPipelineTransparent:n?this._occluderPipelineOpaque:this._occluderPipelineMaskWrite:super.getPipeline()}}m.shader=new l.ReloadableShaderModule(g.LineMarker,()=>new Promise((r,n)=>a(["./LineMarker.glsl"],r,n)));b.LineMarkerTechnique=m;b.vertexAttributeLocations=v;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/LineMarker.glsl":function(){define("exports ../views/3d/support/engineContent/marker ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute ../views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){function z(B){const C=new r.ShaderBuilder,D=B.multipassEnabled&&B.output===q.ShaderOutput.Color,F=B.space===y.LineMarkerSpace.World;C.include(p.RibbonVertexPosition,B);C.include(k.MarkerSizing,B);const {vertex:H,fragment:N}=C;N.include(e.RgbaFloatEncoding);g.addProjViewLocalOrigin(H,B);C.attributes.add(x.VertexAttribute.POSITION,"vec3");C.attributes.add(x.VertexAttribute.PREVPOSITION,"vec3");C.attributes.add(x.VertexAttribute.UV0,"vec2");C.varyings.add("vColor",
"vec4");C.varyings.add("vpos","vec3");C.varyings.add("vUV","vec2");C.varyings.add("vSize","float");D&&C.varyings.add("depth","float");B.hasTip&&C.varyings.add("vLineWidth","float");H.uniforms.add(new d.Float2PassUniform("nearFar",(E,G)=>G.camera.nearFar),new t.Float4PassUniform("viewport",(E,G)=>G.camera.fullViewport));H.code.add(v.glsl`vec4 projectAndScale(vec4 pos) {
vec4 posNdc = proj * pos;
posNdc.xy *= viewport.zw / posNdc.w;
return posNdc;
}`);H.code.add(v.glsl`void clip(vec4 pos, inout vec4 prev) {
float vnp = nearFar[0] * 0.99;
if (prev.z > -nearFar[0]) {
float interpolation = (-vnp - pos.z) / (prev.z - pos.z);
prev = mix(pos, prev, interpolation);
}
}`);F?(C.attributes.add(x.VertexAttribute.NORMAL,"vec3"),g.addViewNormal(H),H.constants.add("tiltThreshold","float",.7),H.code.add(v.glsl`vec3 perpendicular(vec3 v) {
vec3 n = (viewNormal * vec4(normal.xyz, 1.0)).xyz;
vec3 n2 = cross(v, n);
vec3 forward = vec3(0.0, 0.0, 1.0);
float tiltDot = dot(forward, n);
return abs(tiltDot) < tiltThreshold ? n : n2;
}`)):H.code.add(v.glsl`vec2 perpendicular(vec2 v) {
return vec2(v.y, -v.x);
}`);H.code.add(v.glsl`
#define vecN ${F?"vec3":"vec2"}
vecN normalizedSegment(vecN pos, vecN prev) {
vecN segment = pos - prev;
float segmentLen = length(segment);
// normalize or zero if too short
return (segmentLen > 0.001) ? segment / segmentLen : ${F?"vec3(0.0, 0.0, 0.0)":"vec2(0.0, 0.0)"};
}
vecN displace(vecN pos, vecN prev, float displacementLen) {
vecN segment = normalizedSegment(pos, prev);
vecN displacementDirU = perpendicular(segment);
vecN displacementDirV = segment;
${B.anchor===y.LineMarkerAnchor.Tip?"pos -\x3d 0.5 * displacementLen * displacementDirV;":""}
return pos + displacementLen * (uv0.x * displacementDirU + uv0.y * displacementDirV);
}
`);B.space===y.LineMarkerSpace.Screen&&(H.uniforms.add(new m.Matrix4PassUniform("inverseProjectionMatrix",(E,G)=>G.camera.inverseProjectionMatrix)),H.code.add(v.glsl`vec3 inverseProject(vec4 posScreen) {
posScreen.xy = (posScreen.xy / viewport.zw) * posScreen.w;
return (inverseProjectionMatrix * posScreen).xyz;
}`),H.code.add(v.glsl`bool rayIntersectPlane(vec3 rayDir, vec3 planeOrigin, vec3 planeNormal, out vec3 intersection) {
float cos = dot(rayDir, planeNormal);
float t = dot(planeOrigin, planeNormal) / cos;
intersection = t * rayDir;
return abs(cos) > 0.001 && t > 0.0;
}`),H.uniforms.add(new w.FloatPassUniform("perScreenPixelRatio",(E,G)=>G.camera.perScreenPixelRatio)),H.code.add(v.glsl`
vec4 toFront(vec4 displacedPosScreen, vec3 posLeft, vec3 posRight, vec3 prev, float lineWidth) {
// Project displaced position back to camera space
vec3 displacedPos = inverseProject(displacedPosScreen);
// Calculate the plane that we want the marker to lie in. Note that this will always be an approximation since ribbon lines are generally
// not planar and we do not know the actual position of the displaced prev vertices (they are offset in screen space, too).
vec3 planeNormal = normalize(cross(posLeft - posRight, posLeft - prev));
vec3 planeOrigin = posLeft;
${B.hasCap?"\n if(prev.z \x3e posLeft.z) {\n vec2 diff \x3d posLeft.xy - posRight.xy;\n planeOrigin.xy +\x3d perpendicular(diff) / 2.0;\n }\n ":""};
// Move the plane towards the camera by a margin dependent on the line width (approximated in world space). This tolerance corrects for the
// non-planarity in most cases, but sharp joins can place the prev vertices at arbitrary positions so markers can still clip.
float offset = lineWidth * perScreenPixelRatio;
planeOrigin *= (1.0 - offset);
// Intersect camera ray with the plane and make sure it is within clip space
vec3 rayDir = normalize(displacedPos);
vec3 intersection;
if (rayIntersectPlane(rayDir, planeOrigin, planeNormal, intersection) && intersection.z < -nearFar[0] && intersection.z > -nearFar[1]) {
return vec4(intersection.xyz, 1.0);
}
// Fallback: use depth of pos or prev, whichever is closer to the camera
float minDepth = planeOrigin.z > prev.z ? length(planeOrigin) : length(prev);
displacedPos *= minDepth / length(displacedPos);
return vec4(displacedPos.xyz, 1.0);
}
`));g.addPixelRatio(H);H.code.add(v.glsl`void main(void) {
if (uv0.y == 0.0) {
gl_Position = vec4(1e038, 1e038, 1e038, 1.0);
}
else {
float lineWidth = getLineWidth();
float screenMarkerSize = getScreenMarkerSize();
vec4 pos = view * vec4(position, 1.0);
vec4 prev = view * vec4(prevPosition, 1.0);
clip(pos, prev);`);F?(B.hideOnShortSegments&&H.code.add(v.glsl`if (areWorldMarkersHidden(pos, prev)) {
gl_Position = vec4(1e038, 1e038, 1e038, 1.0);
return;
}`),H.code.add(v.glsl`pos.xyz = displace(pos.xyz, prev.xyz, getWorldMarkerSize(pos));
vec4 displacedPosScreen = projectAndScale(pos);`)):(H.code.add(v.glsl`vec4 posScreen = projectAndScale(pos);
vec4 prevScreen = projectAndScale(prev);
vec4 displacedPosScreen = posScreen;
displacedPosScreen.xy = displace(posScreen.xy, prevScreen.xy, screenMarkerSize);`),B.space===y.LineMarkerSpace.Screen&&H.code.add(v.glsl`vec2 displacementDirU = perpendicular(normalizedSegment(posScreen.xy, prevScreen.xy));
vec3 lineRight = inverseProject(posScreen + lineWidth * vec4(displacementDirU.xy, 0.0, 0.0));
vec3 lineLeft = pos.xyz + (pos.xyz - lineRight);
pos = toFront(displacedPosScreen, lineLeft, lineRight, prev.xyz, lineWidth);
displacedPosScreen = projectAndScale(pos);`));H.code.add(v.glsl`
${D?"depth \x3d pos.z;":""}
// Convert back into NDC
displacedPosScreen.xy = (displacedPosScreen.xy / viewport.zw) * displacedPosScreen.w;
// Convert texture coordinate into [0,1]
vUV = (uv0 + 1.0) / 2.0;
${F?"":"vUV *\x3d displacedPosScreen.w;"}
${B.hasTip?"vLineWidth \x3d lineWidth;":""}
vSize = screenMarkerSize;
vColor = getColor();
// Use camera space for slicing
vpos = pos.xyz;
gl_Position = displacedPosScreen;
}
}
`);D&&C.include(h.multipassTerrainTest,B);C.include(l.SliceDraw,B);N.uniforms.add(new t.Float4PassUniform("intrinsicColor",E=>E.color),new n.Texture2DPassUniform("tex",E=>E.markerTexture));N.include(c.ColorConversion);C.constants.add("texelSize","float",1/b.markerTextureSize);N.code.add(v.glsl`float markerAlpha(vec2 samplePos) {
samplePos += vec2(0.5, -0.5) * texelSize;
float sdf = rgba2float(texture(tex, samplePos)) - 0.5;
float distance = sdf * vSize;
distance -= 0.5;
return clamp(0.5 - distance, 0.0, 1.0);
}`);B.hasTip&&(C.constants.add("relativeMarkerSize","float",b.markerSymbolSize/b.markerTextureSize),C.constants.add("relativeTipLineWidth","float",b.markerTipThicknessFactor),N.code.add(v.glsl`
float tipAlpha(vec2 samplePos) {
// Convert coordinates s.t. they are in pixels and relative to the tip of an arrow marker
samplePos -= vec2(0.5, 0.5 + 0.5 * relativeMarkerSize);
samplePos *= vSize;
float halfMarkerSize = 0.5 * relativeMarkerSize * vSize;
float halfTipLineWidth = 0.5 * max(1.0, relativeTipLineWidth * vLineWidth);
${F?"halfTipLineWidth *\x3d fwidth(samplePos.y);":""}
float distance = max(abs(samplePos.x) - halfMarkerSize, abs(samplePos.y) - halfTipLineWidth);
return clamp(0.5 - distance, 0.0, 1.0);
}
`));B.transparencyPassType===u.TransparencyPassType.ColorAlpha&&(C.outputs.add("fragColor","vec4",0),C.outputs.add("fragAlpha","float",1));C.constants.add("symbolAlphaCutoff","float",f.symbolAlphaCutoff);N.code.add(v.glsl`
void main() {
discardBySlice(vpos);
${D?"terrainDepthTest(depth);":""}
vec4 finalColor = intrinsicColor * vColor;
${F?"vec2 samplePos \x3d vUV;":"vec2 samplePos \x3d vUV * gl_FragCoord.w;"}
${B.hasTip?"finalColor.a *\x3d max(markerAlpha(samplePos), tipAlpha(samplePos));":"finalColor.a *\x3d markerAlpha(samplePos);"}
${B.output===q.ShaderOutput.ObjectAndLayerIdColor?v.glsl`finalColor.a = 1.0;`:""}
if (finalColor.a < symbolAlphaCutoff) {
discard;
}
${B.output===q.ShaderOutput.Color?v.glsl`fragColor = highlightSlice(finalColor, vpos);`:""}
${B.output===q.ShaderOutput.Color&&B.transparencyPassType===u.TransparencyPassType.ColorAlpha?v.glsl`
fragColor = premultiplyAlpha(fragColor);
fragAlpha = fragColor.a;`:""}
${B.output===q.ShaderOutput.Highlight?v.glsl`fragColor = vec4(1.0);`:""}
}
`);return C}const A=Object.freeze(Object.defineProperty({__proto__:null,build:z},Symbol.toStringTag,{value:"Module"}));a.LineMarker=A;a.build=z})},"esri/views/3d/webgl-engine/materials/lineStippleUtils":function(){define(["exports"],function(a){function b(p){null!=p?(p=l[p],p=null==p?p:{pattern:p.slice(),pixelRatio:8}):p=null;return p}const q={dash:[4,3],dot:[1,3],"long-dash":[8,3],"short-dash":[4,1],"short-dot":[1,1]},l={dash:q.dash,"dash-dot":[...q.dash,...q.dot],dot:q.dot,"long-dash":q["long-dash"],
"long-dash-dot":[...q["long-dash"],...q.dot],"long-dash-dot-dot":[...q["long-dash"],...q.dot,...q.dot],none:null,"short-dash":q["short-dash"],"short-dash-dot":[...q["short-dash"],...q["short-dot"]],"short-dash-dot-dot":[...q["short-dash"],...q["short-dot"],...q["short-dot"]],"short-dot":q["short-dot"],solid:null};a.createStipplePatternSimple=function(p){return{pattern:[p,p],pixelRatio:2}};a.getStipplePatternForLinePattern=function(p){return null!=p&&"style"===p.type?b(p.style):null};a.getStipplePatternForPatternStyle=
b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer":function(){define("exports ../../../../Color ../../../../core/has ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/projection ../../../../geometry/projection/computeTranslationToOriginAndRotation ../../../../geometry/projection/projectBuffer ../../../../geometry/projection/projectVectorToPoint ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/FloatArray ../../../../geometry/support/Indices ../../../../geometry/support/MeshComponent ../../../../geometry/support/MeshMaterialMetallicRoughness ../../../../geometry/support/MeshTextureTransform ../../../../geometry/support/meshVertexSpaceUtils ../../../../geometry/support/spatialReferenceUtils ../../../../chunks/vec3 ../../../../geometry/support/meshUtils/projection ../../../../layers/graphics/dehydratedPoint ../../../../layers/graphics/sources/interfaces ../../../ViewingMode ../../glTF/internal/resourceUtils ../../glTF/internal/TextureTransformUtils ./ElevationAligners ./elevationAlignmentUtils ./Graphics3DMeshObject3DGraphicLayer ./Graphics3DObject3DGraphicLayer ./Graphics3DSymbolLayer ./MeshFastUpdateProcessor ../support/edgeUtils ../support/symbolColorUtils ../../support/debugFlags ../../webgl-engine/lib/Attribute ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/ContentObjectType ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/Texture ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/DefaultMaterial ../../webgl-engine/materials/NativeLineMaterial ../../webgl-engine/materials/pbrUtils ../../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U,Z,ca,ea){function da(wa,sa){const Ha=n.newFloatArray(sa.length),Ka=Array(3*sa.length);for(let Aa=0;Aa<sa.length;Aa+=3){const Sa=ka(wa,sa,Aa,Pa);for(let Ya=0;3>Ya;Ya++)Ha[Aa+Ya]=Sa[Ya],Ka[Aa+Ya]=Aa/3}return new ya(Ha,Ka,!1)}function ia(wa,sa,Ha,Ka,Aa,Sa){const Ya=3*sa[Ha],qa=3*sa[Ha+1];sa=3*sa[Ha+2];Ka[0]=wa[Ya];Ka[1]=wa[Ya+1];Ka[2]=wa[Ya+2];Aa[0]=wa[qa];Aa[1]=wa[qa+1];Aa[2]=wa[qa+2];Sa[0]=wa[sa];
Sa[1]=wa[sa+1];Sa[2]=wa[sa+2]}function ka(wa,sa,Ha,Ka){ia(wa,sa,Ha,xa,Ma,Ga);e.subtract(Ma,Ma,xa);e.subtract(Ga,Ga,xa);e.cross(xa,Ma,Ga);e.normalize(Ka,xa);return Ka}function fa(wa){if(!wa)return null;const {scale:sa,offset:Ha,rotation:Ka}=wa;return{scale:sa,offset:Ha,rotation:l.deg2rad(Ka)}}function X(wa="repeat"){return"string"===typeof wa?(wa=ja(wa),{s:wa,t:wa}):{s:ja(wa.horizontal),t:ja(wa.vertical)}}function ja(wa){switch(wa){case "clamp":return ea.TextureWrapMode.CLAMP_TO_EDGE;case "mirror":return ea.TextureWrapMode.MIRRORED_REPEAT;
default:return ea.TextureWrapMode.REPEAT}}function la(wa){return null==wa?"-":wa instanceof b?wa.toHex():wa.contentHash}function na(wa){const {offset:sa,scale:Ha,rotation:Ka}=wa??Da;return`${sa[0]},${sa[1]},${Ka},${Ha[0]},${Ha[1]}`}const va=["mesh"];class za extends M.Graphics3DSymbolLayer{constructor(wa,sa,Ha,Ka){super(wa,sa,Ha,Ka);this._materialInfoCache=new K.MaterialInfoCache;this._fastUpdateProcessor=new K.MeshFastUpdateProcessor;this._textures=new Map;this.ensureDrapedStatus(!1)}async doLoad(){Q.debugFlags.DRAW_MESH_GEOMETRY_NORMALS&&
(this._debugVertexNormalMaterial=new Z.NativeLineMaterial({color:[1,0,1,1]}),this._debugTangentNormalMaterial=new Z.NativeLineMaterial({color:[1,.5,0,1]}),this._debugFaceNormalMaterial=new Z.NativeLineMaterial({color:[0,1,1,1]}))}destroy(){super.destroy();this._textures.forEach(wa=>wa.unload());this._context.stage.removeMany(this._materialInfoCache.materials);this._context.stage.removeMany(Array.from(this._textures.values()));this._materialInfoCache.clear();this._textures.clear();this._fastUpdateProcessor.destroy(this._context.stage)}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(wa){const sa=
wa.graphic;if(!this._validateGeometry(sa.geometry,va,"fill on mesh-3d"))return null;const Ha=this.setGraphicElevationContext(sa);return this._createAs3DShape(sa,wa.renderingInfo,Ha,sa.uid)}onRemoveGraphic(wa){this._fastUpdateProcessor.onRemoveGraphic(wa,this._materialInfoCache,this._context)}layerOpacityChanged(wa,sa){const Ha=this._getLayerOpacity();this._updateMaterialParameters(Ka=>{Ka.material.setParameters({layerOpacity:Ha});const Aa=Ka.material.parameters;this._setMaterialTransparentParameter(Aa,
Ka);Ka.material.setParameters({transparent:Aa.transparent})});wa.forEach(Ka=>sa(Ka)?.layerOpacityChanged(Ha,this._context.isAsync))}layerElevationInfoChanged(wa,sa){return this.updateGraphics3DGraphicElevationInfo(wa,sa,O.needsElevationUpdates3D)}slicePlaneEnabledChanged(wa,sa){this._updateMaterialParameters(({material:Ha})=>{Ha.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})});wa.forEach(Ha=>sa(Ha)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync));return!0}physicalBasedRenderingChanged(){const wa=
this._usePBR();this._updateMaterialParameters(({material:sa})=>sa.setParameters({usePBR:wa}));return!0}updateTransform(wa,sa,Ha,Ka){if(!wa.fastTransformUpdatesAllowed)return!1;var Aa=wa.fastTransformUpdatesEnabled;switch(Ka){case H.MeshTransformUpdateAction.EnableFastUpdates:if(Aa)return!0;break;case H.MeshTransformUpdateAction.DisableFastUpdates:if(!Aa)return!0;break;default:if(!Aa)return this.updateTransform(wa,sa,Ha,H.MeshTransformUpdateAction.EnableFastUpdates)?(wa.autoDisableFastTransformUpdates(()=>
this.updateTransform(wa,sa,Ha,H.MeshTransformUpdateAction.DisableFastUpdates)),!0):!1}Aa=this._context.renderCoordsHelper.spatialReference;const Sa=Ea,{origin:Ya,transform:qa}=Ha;if(!w.computeTranslationToOriginAndRotation(sa,e.set(xa,Ya.x,Ya.y,Ya.z??0),Sa,Aa))return!1;switch(Ka){case H.MeshTransformUpdateAction.EnableFastUpdates:this._fastUpdateProcessor.enable(wa,this._materialInfoCache,this._context);break;case H.MeshTransformUpdateAction.DisableFastUpdates:this._fastUpdateProcessor.disable(wa,
this._materialInfoCache,this._context);break;case H.MeshTransformUpdateAction.UpdateFastLocalOrigin:wa.updateFastLocalOrigin(Sa,qa,this._context.localOriginFactory)}const {elevationContext:aa}=wa;aa.centerPointInElevationSR=this._getCenterPointInElevationSR(Sa);const {elevationProvider:Ja,renderCoordsHelper:Ta}=this._context;wa.alignedSampledElevation=I.perObjectElevationAligner(wa,aa,Ja.spatialReference,(Ra,$a)=>O.evaluateElevationInfoAtPoint(Ra,Ja,aa,Ta,$a),Ta,Sa);wa.updateTransform(Sa,qa,this._context.isAsync);
wa.updateAutoDisableFastTransformUpdates(()=>this.updateTransform(wa,sa,Ha,H.MeshTransformUpdateAction.DisableFastUpdates));return!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_materialPropertiesDefault(wa,sa){const Ha=this._requiresSymbolVertexColors(),Ka=!!wa.vertexAttributes.color;wa=!!wa.vertexAttributes.tangent;return{hasSymbolVertexColors:Ha,hasVertexColors:Ka,hasVertexTangents:wa,uid:`vc:${Ka},vt:${wa},vct${sa},svc:${Ha}`}}_materialProperties(wa,
sa,Ha){wa=this._materialPropertiesDefault(wa,Ha);if(!sa.material)return wa;const {color:Ka,colorTexture:Aa,colorTextureTransform:Sa,normalTexture:Ya,normalTextureTransform:qa,doubleSided:aa,alphaCutoff:Ja,alphaMode:Ta}=sa.material;Ha=la(Ka);var Ra=la(Aa),$a=na(Sa),bb=la(Ya),pa=na(qa);wa.color=Ka;wa.colorTexture=Aa;wa.normalTexture=Ya;wa.uid=`${wa.uid},cmuid:${Ha},ctmuid:${Ra},cttuid:${$a},ntmuid:${bb},nttuid:${pa},ds:${aa},ac:${Ja},am:${Ta}`;if(sa.material instanceof y){const {metallic:Ba,roughness:Ia,
metallicRoughnessTexture:Wa,metallicRoughnessTextureTransform:gb,emissiveColor:ib,emissiveTexture:La,emissiveTextureTransform:Xa,occlusionTexture:eb,occlusionTextureTransform:db}=sa.material;sa=la(Wa);Ha=na(gb);Ra=la(ib);$a=la(La);bb=na(Xa);pa=la(eb);const jb=na(db);wa.metallic=Ba;wa.roughness=Ia;wa.metallicRoughnessTexture=Wa;wa.emissiveColor=ib;wa.emissiveTexture=La;wa.occlusionTexture=eb;wa.colorTextureTransform=fa(Sa);wa.normalTextureTransform=fa(qa);wa.emissiveTextureTransform=fa(Xa);wa.occlusionTextureTransform=
fa(db);wa.metallicRoughnessTextureTransform=fa(gb);wa.uid=`${wa.uid},mrm:${Ba},mrr:${Ia},mrt:${sa},mrtt:${Ha},emuid:${Ra},etmuid:${$a},ett:${bb},otmuid:${pa},ott:${jb}`}return wa}_getInternalTextureId(wa){return this._getInternalTexture(wa,S.AlphaDiscardMode.Opaque)?.id}_getInternalTexture(wa,sa){const Ha=wa.data??wa.url;if(!Ha)return null;const Ka=`${wa.contentHash}/${sa}`;var Aa=this._textures.get(Ka);Aa||(Aa=null,Aa=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,wa=
{wrap:X(wa.wrap),noUnpackFlip:!0,maxAnisotropy:Aa,mipmap:1<Aa},E.isEncodedMeshTexture(Ha)?(Aa=Ha.data,wa.preMultiplyAlpha=!1,wa.encoding=Ha.encoding):(Aa=Ha,wa.preMultiplyAlpha=sa!==S.AlphaDiscardMode.Opaque,wa.downsampleUncompressed=this._context.graphicsCoreOwner.view.qualitySettings.graphics3D.uncompressedTextureDownsamplingEnabled),Aa=new ha.Texture(Aa,wa),this._textures.set(Ka,Aa),Aa.load(this._context.stage.renderView.renderingContext),this._context.stage.add(Aa));return Aa}_setInternalMaterialParameters(wa,
sa){if(null!=wa.color){var Ha=wa.color;sa.diffuse=b.toUnitRGB(Ha);sa.opacity=Ha.a}null!=wa.colorTexture&&((Ha=this._getInternalTexture(wa.colorTexture,sa.textureAlphaMode))?(sa.textureId=Ha.id,sa.textureAlphaPremultiplied=!!Ha.parameters.preMultiplyAlpha):sa.textureId=void 0);wa.normalTexture&&(sa.normalTextureId=this._getInternalTextureId(wa.normalTexture));wa.emissiveColor&&(sa.emissiveFactor=b.toUnitRGB(wa.emissiveColor));wa.emissiveTexture&&(sa.emissiveTextureId=this._getInternalTextureId(wa.emissiveTexture));
wa.occlusionTexture&&(sa.occlusionTextureId=this._getInternalTextureId(wa.occlusionTexture));wa.metallicRoughnessTexture&&(sa.metallicRoughnessTextureId=this._getInternalTextureId(wa.metallicRoughnessTexture));sa.colorTextureTransformMatrix=G.getTransformMatrix(wa.colorTextureTransform);sa.normalTextureTransformMatrix=G.getTransformMatrix(wa.normalTextureTransform);Ha=null!=wa.normalTextureTransform?.scale?wa.normalTextureTransform?.scale:c.ONES;sa.scale=[Ha[0],Ha[1]];sa.occlusionTextureTransformMatrix=
G.getTransformMatrix(wa.occlusionTextureTransform);sa.emissiveTextureTransformMatrix=G.getTransformMatrix(wa.emissiveTextureTransform);sa.metallicRoughnessTextureTransformMatrix=G.getTransformMatrix(wa.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(wa){let sa=this.symbolLayer.material?.colorMixMode??null;if(this._drivenProperties.color)wa.externalColor=d.ONES;else{const Ha=this.symbolLayer.material?.color??null;Ha?wa.externalColor=b.toUnitRGBA(Ha):(sa=null,wa.externalColor=d.ONES)}sa&&
(wa.colorMixMode=sa);wa.castShadows=!!this.symbolLayer.castShadows}_getOrCreateMaterial(wa,sa){var Ha=sa.material?.color,Ka=sa.material?.colorTexture,Aa=sa.material?.alphaMode,Sa="blend"===Aa;if(Aa="opaque"!==Aa){a:{Aa=wa.vertexAttributes.color;if(null!=Aa)for(let Ya=3;Ya<Aa.length;Ya+=4)if(255!==Aa[Ya]){Aa=!0;break a}Aa=!1}Aa=Aa||null!=Ha&&1>Ha.a||Ka?.transparent||Sa}Ha=Aa;wa=this._materialProperties(wa,sa,Ha);if(Ka=this._materialInfoCache.byUid(wa.uid))return Ka.material;Ha={uid:wa.uid,material:null,
isComponentTransparent:Ha,alphaMode:sa.material?sa.material.alphaMode:"opaque"};Ka=ca.useSchematicPBR({normalTexture:wa.normalTexture,metallicRoughnessTexture:wa.metallicRoughnessTexture,metallicFactor:wa.metallic,roughnessFactor:wa.roughness,emissiveTexture:wa.emissiveTexture,emissiveFactor:b.toUnitRGB(wa.emissiveColor),occlusionTexture:wa.occlusionTexture});Sa={usePBR:this._usePBR(),isSchematic:Ka,hasVertexColors:wa.hasVertexColors,hasSymbolColors:wa.hasSymbolVertexColors,hasVertexTangents:wa.hasVertexTangents,
ambient:g.ZEROS,diffuse:g.ONES,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:S.CullFaceOptions.None,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,initTextureTransparent:!0};Sa.mrrFactors=Ka?[...ca.defaultSchematicMRRFactors]:[wa.metallic,wa.roughness,ca.defaultAdvancedMRRFactors[2]];sa.material&&(Sa.doubleSided=sa.material.doubleSided,Sa.cullFace=sa.material.doubleSided?S.CullFaceOptions.None:S.CullFaceOptions.Back,Sa.textureAlphaCutoff=sa.material.alphaCutoff);
this._setExternalMaterialParameters(Sa);this._setMaterialTransparentParameter(Sa,Ha);this._setInternalMaterialParameters(wa,Sa);sa=new U.DefaultMaterial(Sa);Ha.material=sa;this._materialInfoCache.set(wa.uid,Ha);this._context.stage.add(sa);return sa}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTransparentParameter(wa,sa){wa.transparent=this.needsDrivenTransparentPass||sa.isComponentTransparent||1>wa.layerOpacity||1>wa.opacity||wa.externalColor&&1>wa.externalColor[3];wa.textureAlphaMode=
"auto"===sa.alphaMode?wa.transparent?S.AlphaDiscardMode.MaskBlend:S.AlphaDiscardMode.Opaque:"opaque"===sa.alphaMode?S.AlphaDiscardMode.Opaque:"mask"===sa.alphaMode?S.AlphaDiscardMode.Mask:S.AlphaDiscardMode.Blend}_createFaceDebugNormals(wa,sa){const Ha=sa.length;var Ka=wa.spatialReference.isGeographic?20015077/180:1;wa=.1*Math.max(wa.extent.width*Ka,wa.extent.height*Ka,wa.extent.zmax-wa.extent.zmin);Ka=[];const Aa=[],Sa=sa[0].transformation,Ya=p.normalFromMat4(k.create(),Sa);for(let aa=0;aa<Ha;aa++){var qa=
sa[aa].attributes.get(ba.VertexAttribute.POSITION);if(!qa)continue;const Ja=qa.data;qa=qa.indices;for(let Ta=0;Ta<qa.length;Ta+=3)ka(Ja,qa,Ta,Pa),ia(Ja,qa,Ta,xa,Ma,Ga),e.add(xa,xa,Ma),e.add(xa,xa,Ga),e.scale(xa,xa,1/3),e.transformMat4(xa,xa,Sa),Ka.push(...xa),e.transformMat3(Pa,Pa,Ya),e.normalize(Pa,Pa),e.scaleAndAdd(xa,xa,Pa,wa),Ka.push(...xa),Aa.push(Aa.length),Aa.push(Aa.length)}return Ka.length?new T.Geometry(this._debugFaceNormalMaterial,[[ba.VertexAttribute.POSITION,new W.Attribute(Ka,Aa,3,
!0)]],null,V.ContentObjectType.Line):null}_createPerVertexDebugVectors(wa,sa,Ha,Ka,Aa){const Sa=sa.length;var Ya=wa.spatialReference.isGeographic?20015077/180:1;wa=.1*Aa*Math.max(wa.extent.width*Ya,wa.extent.height*Ya,wa.extent.zmax-wa.extent.zmin);Aa=[];Ya=[];const qa=sa[0].transformation,aa=p.normalFromMat4(k.create(),qa);Ha===ba.VertexAttribute.TANGENT&&p.fromMat4(aa,qa);for(let Ra=0;Ra<Sa;Ra++){var Ja=sa[Ra],Ta=Ja.attributes.get(ba.VertexAttribute.POSITION);Ja=Ja.attributes.get(Ha);if(!Ta||!Ja)continue;
const $a=Ta.data;Ta=Ta.indices;const bb=Ja.data,pa=Ja.indices;for(let Ba=0;Ba<Ta.length;Ba++){const Ia=3*Ta[Ba],Wa=pa[Ba]*Ja.stride;e.set(xa,$a[Ia+0],$a[Ia+1],$a[Ia+2]);e.transformMat4(xa,xa,qa);Aa.push(...xa);e.set(Ma,bb[Wa+0],bb[Wa+1],bb[Wa+2]);e.transformMat3(Ma,Ma,aa);e.normalize(Ma,Ma);e.scaleAndAdd(xa,xa,Ma,wa);Aa.push(...xa);Ya.push(Ya.length);Ya.push(Ya.length)}}return Aa.length?new T.Geometry(Ka,[[ba.VertexAttribute.POSITION,new W.Attribute(Aa,Ya,3,!0)]],null,V.ContentObjectType.Line):null}_createAs3DShape(wa,
sa,Ha,Ka){wa=wa.geometry;if("mesh"!==wa.type)return null;sa=this._createGeometryInfo(wa,sa,Ka);if(null==sa)return null;const {geometries:Aa,objectTransformation:Sa}=sa;if(Q.debugFlags.DRAW_MESH_GEOMETRY_NORMALS){sa=this._createPerVertexDebugVectors(wa,Aa,ba.VertexAttribute.NORMAL,this._debugVertexNormalMaterial,1);const aa=this._createPerVertexDebugVectors(wa,Aa,ba.VertexAttribute.TANGENT,this._debugTangentNormalMaterial,.5),Ja=this._createFaceDebugNormals(wa,Aa);sa&&Aa.push(sa);aa&&Aa.push(aa);Ja&&
Aa.push(Ja)}Ka=new Y.Object3D({geometries:Aa,layerUid:this._context.layer.uid,graphicUid:Ka,isElevationSource:!0});Ka.transformation=Sa;sa=(sa=J.createMaterial(this.symbolLayer,{opacity:this._getLayerOpacity()}))?new P.Object3DEdgeState(Aa[0].material,[sa],{mergeGeometries:!0,hasSlicePlane:this._context.slicePlaneEnabled}):null;sa=new L.Graphics3DMeshObject3DGraphicLayer(this,Ka,Aa,null,null,I.perObjectElevationAligner,Ha,sa);this._fastUpdateProcessor.onAddGraphic();sa.needsElevationUpdates=O.needsElevationUpdates3D(Ha.mode);
sa.useObjectOriginAsAttachmentOrigin=!0;sa.fastTransformUpdatesAllowed=this._fastTransformUpdatesAllowed(wa);Ha.centerPointInElevationSR=this._getCenterPointInElevationSR(Ka.transformation);const {elevationProvider:Ya,renderCoordsHelper:qa}=this._context;sa.alignedSampledElevation=I.perObjectElevationAligner(sa,Ha,Ya.spatialReference,(aa,Ja)=>O.evaluateElevationInfoAtPoint(aa,Ya,Ha,qa,Ja),qa);return sa}_fastTransformUpdatesAllowed(wa){const {vertexSpace:sa,spatialReference:Ha}=wa;if(!A.isRelativeVertexSpace(sa))return!1;
({type:wa}=sa);var {view:Ka}=this._context.graphicsCoreOwner;const {viewingMode:Aa}=Ka.state;Ka=Ka.spatialReference;return Aa===N.ViewingMode.Global&&"local"===wa||Aa===N.ViewingMode.Local&&B.equals(Ka,Ha)&&"georeferenced"===wa&&!Ha.isGeographic}_getCenterPointInElevationSR(wa){const sa=F.makeDehydratedPoint(0,0,0,null!=this._context.elevationProvider.spatialReference?this._context.elevationProvider.spatialReference:null);m.projectVectorToPoint([wa[12],wa[13],wa[14]],this._context.renderCoordsHelper.spatialReference,
sa);return sa}_passthroughReprojectionInfo(wa){return wa.reprojection===Ua.NONE&&!!wa.objectTransformation}_createPositionBuffer(wa,sa){const Ha=wa.vertexAttributes.position;let Ka=Ha,Aa=null;if(sa.reprojection===Ua.NONE)return{position:Ka,georeferencedPositionBuffer:Aa};const Sa=sa.reprojection===Ua.RENDER?sa.transformBeforeProject:null;Sa&&(Ka=C.transformMat4(new Float64Array(Ka.length),Ka,Sa));const {normal:Ya,tangent:qa}=wa.vertexAttributes;this._passthroughReprojectionInfo(sa)||!Ya&&!qa||(Aa=
Ka);sa=Ka===Ha||Ka===Aa?new Float64Array(Ka.length):Ka;v.projectBuffer(Ka,wa.spatialReference,0,sa,this._context.renderCoordsHelper.spatialReference,0,Ka.length/3);return{position:sa,georeferencedPositionBuffer:Aa}}_createNormalBuffer(wa,sa,Ha,Ka){const Aa=wa.vertexAttributes.normal;if(null==Aa)return null;let Sa=Aa;const Ya=Ka.reprojection===Ua.RENDER?Ka.transformBeforeProject:null;Ya&&(Sa=D.transformNormal(Sa,new Float32Array(Sa.length),Ya));if(Ka.reprojection===Ua.NONE)return Sa;if("local"===this._context.graphicsCoreOwner.view.viewingMode)return B.isPlateCarree(this._context.renderCoordsHelper.spatialReference)?
null==Ha?null:wa.spatialReference.isGeographic?(wa=Sa===Aa?new Float32Array(Sa.length):Sa,D.transformVectorENUPlateCarree(Sa,D.VectorType.NORMAL,Ha,wa)):wa.spatialReference.isWebMercator?(wa=Sa===Aa?new Float32Array(Sa.length):Sa,D.transformVectorWMPlateCarree(Sa,D.VectorType.NORMAL,Ha,wa)):Sa:Sa;if(null==Ha)return null;Ka=Sa===Aa?new Float32Array(Sa.length):Sa;return D.projectNormalToPCPF(Sa,Ha,sa,wa.spatialReference,Ka)}_createTangentBuffer(wa,sa,Ha,Ka){const Aa=wa.vertexAttributes.tangent;if(null==
Aa)return null;let Sa=Aa;const Ya=Ka.reprojection===Ua.RENDER?Ka.transformBeforeProject:null;Ya&&(Sa=D.transformTangent(Sa,new Float32Array(Sa.length),Ya));if(Ka.reprojection===Ua.NONE)return Sa;if("local"===this._context.graphicsCoreOwner.view.viewingMode)return B.isPlateCarree(this._context.renderCoordsHelper.spatialReference)?null==Ha?null:wa.spatialReference.isGeographic?(wa=Sa===Aa?new Float32Array(Sa.length):Sa,D.transformVectorENUPlateCarree(Sa,D.VectorType.TANGENT,Ha,wa)):wa.spatialReference.isWebMercator?
(wa=Sa===Aa?new Float32Array(Sa.length):Sa,D.transformVectorWMPlateCarree(Sa,D.VectorType.TANGENT,Ha,wa)):Sa:Sa;if(null==Ha)return null;Ka=Sa===Aa?new Float32Array(Sa.length):Sa;return D.projectTangentToPCPF(Sa,Ha,sa,wa.spatialReference,Ka)}_createSymbolColorBuffer(wa){if(this._requiresSymbolVertexColors()){wa=this._getVertexOpacityAndColor(wa);const sa=R.parseColorMixMode(this.symbolLayer?.material?.colorMixMode),Ha=new Uint8Array(4);R.encodeSymbolColor(wa,sa,Ha);return Ha}return null}_createBuffers(wa,
sa){var Ha=wa.vertexAttributes&&wa.vertexAttributes.position;if(!Ha)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;var Ka=wa.vertexAttributes.normal;const Aa=wa.vertexAttributes.uv;var Sa=wa.vertexAttributes.tangent;if(Ka&&Ka.length!==Ha.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(Sa&&Sa.length/4!==Ha.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),
null;if(Aa&&Aa.length/2!==Ha.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;Ka=this._computeReprojectionInfo(wa);const {position:Ya,georeferencedPositionBuffer:qa}=this._createPositionBuffer(wa,Ka);Ha=wa.vertexAttributes.color;sa=this._createSymbolColorBuffer(sa);Sa=this._createNormalBuffer(wa,Ya,qa,Ka);const aa=this._createTangentBuffer(wa,Ya,qa,Ka),{transformation:Ja,position:Ta,normal:Ra,tangent:$a}=this._passthroughReprojectionInfo(Ka)?
{transformation:Ka.objectTransformation,position:Ya,normal:Sa,tangent:aa}:this._transformOriginLocal(wa,Ya,Sa,aa);wa=Ka.reprojection===Ua.NONE&&Ka.geometryTransformation?Ka.geometryTransformation:f.create();return{positionBuffer:Ta,normalBuffer:Ra,tangentBuffer:$a,uvBuffer:Aa,colorBuffer:Ha,symbolColorBuffer:sa,objectTransformation:Ja,geometryTransformation:wa}}_computeReprojectionInfo(wa){var {vertexSpace:sa}=wa;const Ha="georeferenced"===sa.type?B.equals(this._context.renderCoordsHelper.spatialReference,
wa.spatialReference)?Ua.NONE:Ua.RENDER:Ua.NONE;if(A.isAbsoluteVertexSpace(sa))return{reprojection:Ha};const Ka=sa.origin;sa=f.create();const Aa=wa.transform?.localMatrix??f.IDENTITY;if(Ha===Ua.NONE)return w.computeTranslationToOriginAndRotation(wa.spatialReference,Ka,sa,this._context.renderCoordsHelper.spatialReference),wa=f.clone(Aa),{reprojection:Ha,objectTransformation:sa,geometryTransformation:wa};wa=h.fromTranslation(f.create(),Ka);h.multiply(wa,wa,Aa);return{reprojection:Ha,transformBeforeProject:wa}}_transformOriginLocal(wa,
sa,Ha,Ka){var Aa=this._context.renderCoordsHelper.spatialReference,Sa=wa.anchor;ra[0]=Sa.x;ra[1]=Sa.y;ra[2]=Sa.z??0;Sa=f.create();w.computeTranslationToOriginAndRotation(wa.spatialReference,ra,Sa,Aa);h.invert(Qa,Sa);const {position:Ya,normal:qa,tangent:aa}=wa.vertexAttributes;wa=sa===Ya?new Float64Array(sa.length):sa;C.transformMat4(wa,sa,Qa);sa=Ha?Ha===qa?new Float32Array(Ha.length):Ha:null;Aa=Ka?Ka===aa?new Float32Array(Ka.length):Ka:null;Ha&&sa&&D.transformNormal(Ha,sa,Qa);Ka&&Aa&&D.transformTangent(Ka,
Aa,Qa);return{transformation:Sa,position:wa,normal:sa,tangent:Aa}}_validateFaces(wa,sa){wa=wa.vertexAttributes.position.length/3;if(sa=sa.faces){let Ha=-1;for(let Ka=0;Ka<sa.length;Ka++){const Aa=sa[Ka];Aa>Ha&&(Ha=Aa)}if(wa<=Ha)return this.logger.warn(`Vertex index ${Ha} is out of bounds of the mesh position buffer`),!1}else if(0!==wa%3)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;
return!0}_isOutsideClippingArea(wa){if(!this._context.clippingExtent)return!1;var sa=wa.vertexAttributes?.position;if(!sa)return!1;wa=D.project({positions:sa,transform:wa.transform,vertexSpace:wa.vertexSpace,inSpatialReference:wa.spatialReference,outSpatialReference:this._context.elevationProvider.spatialReference??wa.spatialReference,localMode:this._context.stage.viewingMode===N.ViewingMode.Local});if(!wa)return!1;sa=wa.length/3;r.empty(ua);r.expandWithBuffer(ua,wa,0,sa);return!r.intersectsClippingArea(ua,
this._context.clippingExtent)}_createGeometryInfo(wa,sa,Ha){if(!t.canProjectWithoutEngine(wa.spatialReference,this._context.renderCoordsHelper.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(!this._validateVertexSpace(wa)||this._isOutsideClippingArea(wa))return null;sa=this._createBuffers(wa,sa);if(null==sa)return null;const {positionBuffer:Ka,uvBuffer:Aa,colorBuffer:Sa,symbolColorBuffer:Ya,normalBuffer:qa,tangentBuffer:aa,objectTransformation:Ja,
geometryTransformation:Ta}=sa;var Ra=wa.components??Na;sa=[];let $a=!1;var bb=h.getTranslation(xa,Ja);bb=this._context.localOriginFactory.getOrigin(bb);for(const Xa of Ra){if(!this._validateFaces(wa,Xa))return null;Ra=Xa.faces??u.getContinuousIndexArray(wa.vertexAttributes.position.length/3);if(0!==Ra.length){a:{var pa=Ka;var Ba=Ra;switch(Xa.shading||"flat"){default:case "source":var Ia=qa,Wa=Xa,gb=Ba;if(null==Ia)pa=da(pa,gb);else{Ba=!1;if(!Wa.trustSourceNormals)for(Wa=0;Wa<gb.length;Wa+=3){ka(pa,
gb,Wa,Pa);for(var ib=0;3>ib;ib++){var La=3*gb[Wa+ib];xa[0]=Ia[La];xa[1]=Ia[La+1];xa[2]=Ia[La+2];0>e.dot(Pa,xa)&&(Ia[La]=-Ia[La],Ia[La+1]=-Ia[La+1],Ia[La+2]=-Ia[La+2],Ba=!0)}}pa=new ya(Ia,gb,Ba)}break a;case "flat":pa=da(pa,Ba);break a;case "smooth":gb=pa;pa=Ba;Ia={};for(Ba=0;Ba<pa.length;Ba+=3)for(Wa=ka(gb,pa,Ba,Pa),ib=0;3>ib;ib++){La=pa[Ba+ib];let eb=Ia[La];eb||(eb={normal:g.create(),count:0},Ia[La]=eb);e.add(eb.normal,eb.normal,Wa);eb.count++}gb=n.newFloatArray(3*pa.length);Ba=Array(3*pa.length);
for(Wa=0;Wa<pa.length;Wa++){ib=Ia[pa[Wa]];1!==ib.count&&(e.normalize(ib.normal,ib.normal),ib.count=1);for(La=0;3>La;La++)gb[3*Wa+La]=ib.normal[La];Ba[Wa]=Wa}pa=new ya(gb,Ba,!1)}}pa.didFlipNormals&&($a=!0);pa=[[ba.VertexAttribute.POSITION,new W.Attribute(Ka,Ra,3,!0)],[ba.VertexAttribute.NORMAL,new W.Attribute(pa.normals,pa.indices,3,!0)]];Sa&&pa.push([ba.VertexAttribute.COLOR,new W.Attribute(Sa,Ra,4,!0)]);Ya&&pa.push([ba.VertexAttribute.SYMBOLCOLOR,new W.Attribute(Ya,u.getZeroIndexArray(Ra.length),
4,!0)]);Aa&&pa.push([ba.VertexAttribute.UV0,new W.Attribute(Aa,Ra,2,!0)]);aa&&pa.push([ba.VertexAttribute.TANGENT,new W.Attribute(aa,Ra,4,!0)]);Ra=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:Ha,layerUid:this._context.layer.uid});Ia=this._getOrCreateMaterial(wa,Xa);Ra=new T.Geometry(Ia,pa,null,V.ContentObjectType.Mesh,Ra);Ra.transformation=Ta;Ra.localOrigin=bb;sa.push(Ra)}}$a&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals.");
return{geometries:sa,objectTransformation:Ja}}_updateMaterialParameters(wa){this._materialInfoCache.forEachMaterialInfo(wa);this._fastUpdateProcessor.forEachMaterialInfo(wa);this._fastUpdateProcessor.forEachClonedMaterial((sa,Ha)=>{Ha.setParameters(sa.parameters)})}_validateVertexSpace(wa){const {_context:{graphicsCoreOwner:{view:{state:{viewingMode:sa}}}}}=this;({vertexSpace:wa}=wa);return sa===N.ViewingMode.Local&&"local"===wa.type?(this.logger.warn("Displaying a mesh with a local vertex space in a view in local viewing mode is not supported."),
!1):!0}test(){return{...super.test(),materials:this._materialInfoCache.materials}}}class ya{constructor(wa,sa,Ha){this.normals=wa;this.indices=sa;this.didFlipNormals=Ha}}const Da=new z,ra=g.create(),xa=g.create(),Ma=g.create(),Ga=g.create(),Pa=g.create(),Qa=f.create(),Ea=f.create(),ua=r.create(),Na=[new x];var Ua;(function(wa){wa[wa.NONE=0]="NONE";wa[wa.RENDER=1]="RENDER"})(Ua||={});a.Graphics3DMeshFillSymbolLayer=za;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/MeshComponent":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/lang ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/ensureType ./MeshMaterial ./MeshMaterialMetallicRoughness ./MeshVertexAttributes".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){var d;b=d=class extends b.JSONSupport{static from(t){return f.ensureClass(d,t)}constructor(t){super(t);this.material=this.faces=null;this.name=void 0;this.shading="source";this.trustSourceNormals=!1}castFaces(t){return g.castArray(t,Uint32Array,[Uint16Array],{loggerTag:".faces\x3d",stride:3},l.getLogger(this))}castMaterial(t){return t&&"object"===typeof t&&("metallic"in t||"roughness"in t||"metallicRoughnessTexture"in t)?f.ensureClass(e,t):f.ensureClass(c,t)}clone(){return new d({faces:q.clone(this.faces),
shading:this.shading,material:q.clone(this.material),trustSourceNormals:this.trustSourceNormals,name:this.name})}cloneWithDeduplication(t,w){t={faces:q.clone(this.faces),shading:this.shading,material:this.material?this.material.cloneWithDeduplication(t,w):null,trustSourceNormals:this.trustSourceNormals,name:this.name};return new d(t)}get memoryUsage(){let t=0;null!=this.faces&&(t+=this.faces.byteLength);null!=this.material&&(t+=this.material.memoryUsage);return t}};a.__decorate([p.property({json:{write:!0}})],
b.prototype,"faces",void 0);a.__decorate([k.cast("faces")],b.prototype,"castFaces",null);a.__decorate([p.property({type:c,json:{write:!0}})],b.prototype,"material",void 0);a.__decorate([k.cast("material")],b.prototype,"castMaterial",null);a.__decorate([p.property()],b.prototype,"name",void 0);a.__decorate([p.property({type:String,json:{write:!0}})],b.prototype,"shading",void 0);a.__decorate([p.property({type:Boolean})],b.prototype,"trustSourceNormals",void 0);return b=d=a.__decorate([h.subclass("esri.geometry.support.MeshComponent")],
b)})},"esri/geometry/support/MeshMaterial":function(){define("../../chunks/tslib.es6 ../../Color ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./MeshTexture ./MeshTextureTransform".split(" "),function(a,b,q,l,p,k,h,f,c,e){var g;q=g=class extends q.JSONSupport{constructor(d){super(d);this.colorTextureTransform=this.colorTexture=this.color=null;this.normalTextureTransform=this.normalTexture=
void 0;this.alphaMode="auto";this.alphaCutoff=.5;this.doubleSided=!0}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(d,t){const w=null!=d?d.get(this):null;if(w)return w;t=new g(this.clonePropertiesWithDeduplication(t));null!=d&&d.set(this,t);return t}clonePropertiesWithDeduplication(d){return{color:null!=this.color?this.color.clone():null,colorTexture:this.colorTexture?.cloneWithDeduplication(d),normalTexture:this.normalTexture?.cloneWithDeduplication(d),alphaMode:this.alphaMode,
alphaCutoff:this.alphaCutoff,doubleSided:this.doubleSided,colorTextureTransform:this.colorTextureTransform?.clone(),normalTextureTransform:this.normalTextureTransform?.clone()}}get memoryUsage(){return this.getMemoryUsage()}getMemoryUsage(){let d;d=null!=this.color?16:0;null!=this.colorTexture&&(d+=this.colorTexture.memoryUsage);d+=null!=this.colorTextureTransform?20:0;null!=this.normalTexture&&(d+=this.normalTexture.memoryUsage);return d+=null!=this.normalTextureTransform?20:0}};a.__decorate([l.property({type:b,
json:{write:!0}})],q.prototype,"color",void 0);a.__decorate([l.property({type:c,json:{write:!0}})],q.prototype,"colorTexture",void 0);a.__decorate([l.property({type:e,json:{write:!0}})],q.prototype,"colorTextureTransform",void 0);a.__decorate([l.property({type:c,json:{write:!0}})],q.prototype,"normalTexture",void 0);a.__decorate([l.property({type:e,json:{write:!0}})],q.prototype,"normalTextureTransform",void 0);a.__decorate([l.property({nonNullable:!0,json:{write:!0}})],q.prototype,"alphaMode",void 0);
a.__decorate([l.property({nonNullable:!0,json:{write:!0}})],q.prototype,"alphaCutoff",void 0);a.__decorate([l.property({nonNullable:!0,json:{write:!0}})],q.prototype,"doubleSided",void 0);return q=g=a.__decorate([f.subclass("esri.geometry.support.MeshMaterial")],q)})},"esri/geometry/support/MeshTexture":function(){define("../../chunks/tslib.es6 ../../core/has ../../core/imageUtils ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ../../chunks/persistableUrlUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){function d(n){let u="";for(let x=0;x<n.data.length;x++)u+=String.fromCharCode(n.data[x]);return{data:btoa(u),width:n.width,height:n.height}}function t(n){const u=atob(n.data),x=new Uint8ClampedArray(u.length);for(let y=0;y<u.length;y++)x[y]=u.charCodeAt(y);return q.wrapImageData(x,n.width,n.height)}function w(n){for(let u=3;u<n.data.length;u+=4)if(255!==n.data[u])return!0;return!1}var v;const m=new WeakMap;let r=0;b=v=class extends l.JSONSupport{constructor(n){super(n);
this.wrap="repeat"}get url(){return this._get("url")||null}set url(n){this._set("url",n);n&&this._set("data",null)}get data(){return this._get("data")||null}set data(n){this._set("data",n);n&&this._set("url",null)}writeData(n,u,x,y){n instanceof HTMLImageElement?(n={type:"image-element",src:g.toJSON(n.src,y),crossOrigin:n.crossOrigin},u[x]=n):n instanceof HTMLCanvasElement?(n=n.getContext("2d").getImageData(0,0,n.width,n.height),n={type:"canvas-element",imageData:d(n)},u[x]=n):n instanceof HTMLVideoElement?
(n={type:"video-element",src:g.toJSON(n.src,y),autoplay:n.autoplay,loop:n.loop,muted:n.muted,crossOrigin:n.crossOrigin,preload:n.preload},u[x]=n):n instanceof ImageData&&(n={type:"image-data",imageData:d(n)},u[x]=n)}readData(n){switch(n.type){case "image-element":var u=new Image;u.src=n.src;u.crossOrigin=n.crossOrigin;return u;case "canvas-element":return n=t(n.imageData),u=document.createElement("canvas"),u.width=n.width,u.height=n.height,u.getContext("2d").putImageData(n,0,0),u;case "image-data":return t(n.imageData);
case "video-element":return u=document.createElement("video"),u.src=n.src,u.crossOrigin=n.crossOrigin,u.autoplay=n.autoplay,u.loop=n.loop,u.muted=n.muted,u.preload=n.preload,u}}get transparent(){var n=this.data,u=this.url;return n instanceof HTMLCanvasElement?w(n.getContext("2d").getImageData(0,0,n.width,n.height)):n instanceof ImageData?w(n):u&&(n=u.substr(u.length-4,4).toLowerCase(),u=u.substr(0,15).toLocaleLowerCase(),".png"===n||"data:image/png;"===u)?!0:!1}set transparent(n){this._overrideIfSome("transparent",
n)}get contentHash(){const n="string"===typeof this.wrap?this.wrap:"object"===typeof this.wrap?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",u=(x="")=>`d:${x},t:${this.transparent},w:${n}`;if(null!=this.url)return u(this.url);if(null!=this.data){if(this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement)return u(this.data.src);m.has(this.data)||m.set(this.data,++r);return u(m.get(this.data))}return u()}get memoryUsage(){let n;n=0+(null!=this.url?this.url.length:0);if(null!=
this.data){const u=this.data;"data"in u?n+=u.data.byteLength:u instanceof HTMLImageElement?n+=u.naturalWidth*u.naturalHeight*3:u instanceof HTMLCanvasElement&&(n+=u.width*u.height*3)}return n}clone(){const n={url:this.url,data:this.data,wrap:this._cloneWrap()};return new v(n)}cloneWithDeduplication(n){var u=n.get(this);if(u)return u;u=this.clone();n.set(this,u);return u}_cloneWrap(){return"string"===typeof this.wrap?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}static from(n){return"string"===
typeof n?new v({url:n}):n instanceof HTMLImageElement||n instanceof HTMLCanvasElement||n instanceof ImageData||n instanceof HTMLVideoElement?new v({data:n}):k.ensureClass(v,n)}};a.__decorate([p.property({type:String,json:{write:g.write}})],b.prototype,"url",null);a.__decorate([p.property({json:{write:{overridePolicy(){return{enabled:!this.url}}}}}),p.property()],b.prototype,"data",null);a.__decorate([e.writer("data")],b.prototype,"writeData",null);a.__decorate([f.reader("data")],b.prototype,"readData",
null);a.__decorate([p.property({type:Boolean,json:{write:{overridePolicy(){return{enabled:this._isOverridden("transparent")}}}}})],b.prototype,"transparent",null);a.__decorate([p.property({json:{write:!0}})],b.prototype,"wrap",void 0);a.__decorate([p.property({readOnly:!0})],b.prototype,"contentHash",null);return b=v=a.__decorate([c.subclass("esri.geometry.support.MeshTexture")],b)})},"esri/core/imageUtils":function(){define("require exports ../request ./Error ./promiseUtils ./urlUtils ../support/base64Utils".split(" "),
function(a,b,q,l,p,k,h){function f(t,w,v){v||(g||(g=document.createElement("canvas"),g.width=1,g.height=1),v=g);return v.getContext("2d").createImageData(t,w)}async function c(t,w){t=window.URL.createObjectURL(t);try{const {data:v}=await q(t,{...w,responseType:"image"});return v}catch(v){if(!p.isAbortError(v))throw new l("invalid-image",`Could not fetch requested image at ${t}`);throw v;}finally{window.URL.revokeObjectURL(t)}}async function e(t,w){const v=k.dataComponents(t);if(v?.isBase64)return{arrayBuffer:h.base64ToArrayBuffer(v.data),
mediaType:v.mediaType};w=await q(t,{responseType:"array-buffer",...w});t=w.data;w=w.getHeader?.("Content-Type")??"";return{arrayBuffer:t,mediaType:w}}let g=null,d=!0;b.createEmptyImageData=function(t,w,v){if(!t||!w)throw Error("Cannot construct image data without dimensions");if(d)try{return new ImageData(t,w)}catch(m){d=!1}return f(t,w,v)};b.getImageData=async function(t,w){const {arrayBuffer:v,mediaType:m}=await e(t,w);t="image/png"===m;if("image/gif"===m){const {isAnimatedGIF:r,parseGif:n}=await new Promise((u,
x)=>a(["./image/gif"],u,x));if(r(v))return n(v,w)}if(t){const {isAnimatedPNG:r,parseApng:n}=await new Promise((u,x)=>a(["./image/apng"],u,x));if(r(v))return n(v,w)}t=new Blob([v],{type:m});return c(t,w)};b.wrapImageData=function(t,w,v,m){if(!w||!v)throw Error("Cannot construct image data without dimensions");if(d)try{return new ImageData(t,w,v)}catch(r){d=!1}w=f(w,v,m);w.data.set(t,0);return w};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/MeshTextureTransform":function(){define("../../chunks/tslib.es6 ../../core/Clonable ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){b=class extends b.ClonableMixin(q.JSONSupport){constructor(c){super(c);this.offset=[0,0];this.rotation=0;this.scale=[1,1]}};a.__decorate([l.property({type:[Number],nonNullable:!0,json:{write:!0}})],b.prototype,"offset",void 0);a.__decorate([l.property({type:Number,nonNullable:!0,json:{write:!0}})],b.prototype,"rotation",void 0);a.__decorate([l.property({type:[Number],nonNullable:!0,json:{write:!0}})],b.prototype,"scale",void 0);return b=a.__decorate([f.subclass("esri.geometry.support.MeshTextureTransform")],
b)})},"esri/geometry/support/MeshMaterialMetallicRoughness":function(){define("../../chunks/tslib.es6 ../../Color ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./MeshMaterial ./MeshTexture ./MeshTextureTransform".split(" "),function(a,b,q,l,p,k,h,f,c,e){var g;l=g=class extends f{constructor(d){super(d);this.emissiveTexture=this.emissiveColor=null;this.emissiveTextureTransform=void 0;this.occlusionTexture=
null;this.occlusionTextureTransform=void 0;this.roughness=this.metallic=1;this.metallicRoughnessTexture=null;this.metallicRoughnessTextureTransform=void 0}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(d,t){const w=null!=d?d.get(this):null;if(w)return w;t=new g(this.clonePropertiesWithDeduplication(t));null!=d&&d.set(this,t);return t}getMemoryUsage(){let d=super.getMemoryUsage();d+=null!=this.emissiveColor?16:0;null!=this.emissiveTexture&&(d+=this.emissiveTexture.memoryUsage);
d+=null!=this.emissiveTextureTransform?20:0;null!=this.occlusionTexture&&(d+=this.occlusionTexture.memoryUsage);d+=null!=this.occlusionTextureTransform?20:0;null!=this.metallicRoughnessTexture&&(d+=this.metallicRoughnessTexture.memoryUsage);return d+=null!=this.metallicRoughnessTextureTransform?20:0}clonePropertiesWithDeduplication(d){return{...super.clonePropertiesWithDeduplication(d),emissiveColor:this.emissiveColor?.clone(),emissiveTexture:this.emissiveTexture?.cloneWithDeduplication(d),emissiveTextureTransform:this.emissiveTextureTransform?.clone(),
occlusionTexture:this.occlusionTexture?.cloneWithDeduplication(d),occlusionTextureTransform:this.occlusionTextureTransform?.clone(),metallic:this.metallic,roughness:this.roughness,metallicRoughnessTexture:this.metallicRoughnessTexture?.cloneWithDeduplication(d),metallicRoughnessTextureTransform:this.metallicRoughnessTextureTransform?.clone()}}};a.__decorate([q.property({type:b,json:{write:!0}})],l.prototype,"emissiveColor",void 0);a.__decorate([q.property({type:c,json:{write:!0}})],l.prototype,"emissiveTexture",
void 0);a.__decorate([q.property({type:e,json:{write:!0}})],l.prototype,"emissiveTextureTransform",void 0);a.__decorate([q.property({type:c,json:{write:!0}})],l.prototype,"occlusionTexture",void 0);a.__decorate([q.property({type:e,json:{write:!0}})],l.prototype,"occlusionTextureTransform",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],l.prototype,"metallic",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,
max:1}})],l.prototype,"roughness",void 0);a.__decorate([q.property({type:c,json:{write:!0}})],l.prototype,"metallicRoughnessTexture",void 0);a.__decorate([q.property({type:e,json:{write:!0}})],l.prototype,"metallicRoughnessTextureTransform",void 0);return l=g=a.__decorate([h.subclass("esri.geometry.support.MeshMaterialMetallicRoughness")],l)})},"esri/geometry/support/MeshVertexAttributes":function(){define("exports ../../chunks/tslib.es6 ../../core/JSONSupport ../../core/lang ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){function c(t,w,v,m){const {loggerTag:r,stride:n}=w;return 0!==t.length%n?(m.error(r,`Invalid array length, expected a multiple of ${n}`),new v([])):t}function e(t,w,v,m,r){if(!t)return t;if(t instanceof w)return c(t,m,w,r);for(const n of v)if(t instanceof n)return c(new w(t),m,w,r);if(Array.isArray(t))return c(new w(t),m,w,r);v=v.map(n=>`'${n.name}'`);r.error(`Failed to set property, expected one of ${v}, but got ${t.constructor.name}`);return new w([])}function g(t,w,v){const m=
Array(t.length);for(let r=0;r<t.length;r++)m[r]=t[r];w[v]=m}var d;a.MeshVertexAttributes=d=class extends q.JSONSupport{constructor(t){super(t);this.color=null;this.position=new Float64Array(0);this.tangent=this.normal=this.uv=null}castColor(t){return e(t,Uint8Array,[Uint8ClampedArray],{loggerTag:".color\x3d",stride:4},p.getLogger(this))}castPosition(t){t&&t instanceof Float32Array&&p.getLogger(this).warn(".position\x3d","Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array");
return e(t,Float64Array,[Float32Array],{loggerTag:".position\x3d",stride:3},p.getLogger(this))}castUv(t){return e(t,Float32Array,[Float64Array],{loggerTag:".uv\x3d",stride:2},p.getLogger(this))}castNormal(t){return e(t,Float32Array,[Float64Array],{loggerTag:".normal\x3d",stride:3},p.getLogger(this))}castTangent(t){return e(t,Float32Array,[Float64Array],{loggerTag:".tangent\x3d",stride:4},p.getLogger(this))}clone(){const t={position:l.clone(this.position),uv:l.clone(this.uv),normal:l.clone(this.normal),
tangent:l.clone(this.tangent),color:l.clone(this.color)};return new d(t)}clonePositional(){const t={position:l.clone(this.position),normal:l.clone(this.normal),tangent:l.clone(this.tangent),uv:this.uv,color:this.color};return new d(t)}get memoryUsage(){let t;t=0+this.position.byteLength;null!=this.uv&&(t+=this.uv.byteLength);null!=this.normal&&(t+=this.normal.byteLength);null!=this.tangent&&(t+=this.tangent.byteLength);null!=this.color&&(t+=this.color.byteLength);return t}};b.__decorate([k.property({json:{write:g}})],
a.MeshVertexAttributes.prototype,"color",void 0);b.__decorate([h.cast("color")],a.MeshVertexAttributes.prototype,"castColor",null);b.__decorate([k.property({nonNullable:!0,json:{write:g}})],a.MeshVertexAttributes.prototype,"position",void 0);b.__decorate([h.cast("position")],a.MeshVertexAttributes.prototype,"castPosition",null);b.__decorate([k.property({json:{write:g}})],a.MeshVertexAttributes.prototype,"uv",void 0);b.__decorate([h.cast("uv")],a.MeshVertexAttributes.prototype,"castUv",null);b.__decorate([k.property({json:{write:g}})],
a.MeshVertexAttributes.prototype,"normal",void 0);b.__decorate([h.cast("normal")],a.MeshVertexAttributes.prototype,"castNormal",null);b.__decorate([k.property({json:{write:g}})],a.MeshVertexAttributes.prototype,"tangent",void 0);b.__decorate([h.cast("tangent")],a.MeshVertexAttributes.prototype,"castTangent",null);a.MeshVertexAttributes=d=b.__decorate([f.subclass("esri.geometry.support.MeshVertexAttributes")],a.MeshVertexAttributes);a.castArray=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/geometry/support/meshUtils/projection":function(){define("exports ../../../core/mathUtils ../../../core/libs/gl-matrix-2/math/mat3 ../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../projection ../../spatialReferenceEllipsoidUtils ../../projection/computeTranslationToOriginAndRotation ../../projection/projectBuffer ../DoubleArray ../Ellipsoid ../spatialReferenceUtils ../webMercatorUtils ../buffer/BufferView ../../../chunks/vec3 ../../../chunks/vec4".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){function x(E,G,I,O,L){G=G===a.VectorType.NORMAL?3:4;const P=[0,0];for(let M=0,K=1;M<E.length;M+=G,K+=3){O(I[K],P);const J=E[M]*P[0],R=E[M+1]*P[1],Q=E[M+2],W=1/Math.sqrt(J*J+R*R+Q*Q);L[M]=J*W;L[M+1]=R*W;L[M+2]=Q*W;4===G&&(L[M+3]=E[M+3])}return L}function y(E,G,I,O,L){g.computeTranslationToOriginAndRotation(O,I,H,O);E===C.FROM_PCPF&&p.invert(H,H);switch(G){case a.VectorType.NORMAL:return q.normalFromMat4(L,H);case a.VectorType.TANGENT:return q.fromMat4(L,
H)}}function z(E,G,I,O,L,P,M){if(G){var K=O.count,J=e.getSphericalPCPF(P);if(P.isWGS84||v.isCGCS2000(P)||v.isMars(P)||v.isMoon(P))for(O=0;O<K;O++)L.getVec(O,D),G.getVec(O,F),h.transformMat3(F,F,y(E,I,D,J,N)),M.setVec(O,F);else for(P=0;P<K;P++){L.getVec(P,D);G.getVec(P,F);var R=m.y2lat(O.get(P,1));R=Math.cos(R);I===a.VectorType.TANGENT!==(E===C.TO_PCPF)&&(R=1/R);y(E,I,D,J,N);E===C.TO_PCPF?(N[0]*=R,N[1]*=R,N[2]*=R,N[3]*=R,N[4]*=R,N[5]*=R):(N[0]*=R,N[3]*=R,N[6]*=R,N[1]*=R,N[4]*=R,N[7]*=R);h.transformMat3(F,
F,N);h.normalize(F,F);M.setVec(P,F)}return M}}function A({vertexSpace:E,transform:G,inSpatialReference:I,outSpatialReference:O,localMode:L,outPositions:P,positions:M}){const K=E.origin??f.ZEROS;E=null!=E.origin?G?.localMatrix??k.IDENTITY:k.IDENTITY;G=e.getSphericalPCPF(I);L=O.isWebMercator&&L||!c.canProjectWithoutEngine(I,G)?I:G;g.computeTranslationToOriginAndRotation(I,K,H,L);p.multiply(H,H,E);I=P??t.newDoubleArray(M.length);n.transformMat4(I,M,H);d.projectBuffer(I,L,0,I,O,0,I.length/3);return I}
function B({vertexSpace:E,transform:G,outPositions:I,positions:O,inSpatialReference:L,outSpatialReference:P}){G=null!=E.origin?G?.localMatrix??k.IDENTITY:k.IDENTITY;I=I??t.newDoubleArray(O.length);p.equals(G,k.IDENTITY)?t.copyInto(I,O):n.transformMat4(I,O,G);E=E.origin??f.ZEROS;if(!h.exactEquals(E,f.ZEROS)){const [M,K,J]=E;for(E=0;E<I.length;E+=3)I[E]+=M,I[E+1]+=K,I[E+2]+=J}return d.projectBuffer(I,L,0,I,P,0,I.length/3)?I:null}a.VectorType=void 0;(function(E){E[E.NORMAL=0]="NORMAL";E[E.TANGENT=1]=
"TANGENT"})(a.VectorType||(a.VectorType={}));var C;(function(E){E[E.TO_PCPF=0]="TO_PCPF";E[E.FROM_PCPF=1]="FROM_PCPF"})(C||={});const D=f.create(),F=f.create(),H=k.create(),N=l.create();a.loadProjectErrorMessage="Projection may be possible after calling projection.load().";a.logProjectionError=function(E,G,I,O){E.error(`Failed to project from (wkid:${G.wkid}) to (wkid:${I.wkid}).${O?" ":""}${O}`)};a.project=function(E){return"local"===E.vertexSpace.type?A(E):B(E)};a.projectFromPCPF=function(E,G,I){return d.projectBuffer(E,
e.getSphericalPCPF(I),0,G,I,0,E.length/3)?G:null};a.projectNormalFromPCPF=function(E,G,I,O,L){return z(C.FROM_PCPF,r.BufferViewVec3f.fromTypedArray(E),a.VectorType.NORMAL,r.BufferViewVec3f64.fromTypedArray(G),r.BufferViewVec3f64.fromTypedArray(I),O,r.BufferViewVec3f.fromTypedArray(L))?L:null};a.projectNormalToPCPF=function(E,G,I,O,L){return z(C.TO_PCPF,r.BufferViewVec3f.fromTypedArray(E),a.VectorType.NORMAL,r.BufferViewVec3f64.fromTypedArray(G),r.BufferViewVec3f64.fromTypedArray(I),O,r.BufferViewVec3f.fromTypedArray(L))?
L:null};a.projectTangentFromPCPF=function(E,G,I,O,L){if(!z(C.FROM_PCPF,r.BufferViewVec3f.fromTypedArray(E,16),a.VectorType.TANGENT,r.BufferViewVec3f64.fromTypedArray(G),r.BufferViewVec3f64.fromTypedArray(I),O,r.BufferViewVec3f.fromTypedArray(L,16)))return null;for(G=3;G<E.length;G+=4)L[G]=E[G];return L};a.projectTangentToPCPF=function(E,G,I,O,L){if(!z(C.TO_PCPF,r.BufferViewVec3f.fromTypedArray(E,4*Float32Array.BYTES_PER_ELEMENT),a.VectorType.TANGENT,r.BufferViewVec3f64.fromTypedArray(G),r.BufferViewVec3f64.fromTypedArray(I),
O,r.BufferViewVec3f.fromTypedArray(L,4*Float32Array.BYTES_PER_ELEMENT)))return null;for(G=3;G<E.length;G+=4)L[G]=E[G];return L};a.projectToPCPF=function(E,G,I){return d.projectBuffer(E,G,0,I,e.getSphericalPCPF(G),0,E.length/3)?I:null};a.transformNormal=function(E,G,I){q.normalFromMat4(N,I);n.transformMat3(G,E,N);b.hasScaling(N)&&n.normalize(G,G);return G};a.transformTangent=function(E,G,I){q.fromMat4(N,I);u.transformMat3(G,E,N);b.hasScaling(N)&&n.normalize(G,G,4);return G};a.transformVectorENUPlateCarree=
function(E,G,I,O){const L=G===a.VectorType.NORMAL;return x(E,G,I,(P,M)=>{P=Math.cos(b.deg2rad(P));M[0]=L?P:1/P;M[1]=1},O)};a.transformVectorWMPlateCarree=function(E,G,I,O){const L=G===a.VectorType.NORMAL;return x(E,G,I,(P,M)=>{P=Math.cosh(-P/w.earth.radius);M[0]=1;M[1]=L?P:1/P},O)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/vec4":function(){define(["exports","../core/has","../geometry/support/buffer/math/common"],function(a,b,q){function l(g,d,t){if(g.count===d.count){var w=
g.count,v=t[0],m=t[1],r=t[2],n=t[3],u=t[4],x=t[5],y=t[6],z=t[7],A=t[8],B=t[9],C=t[10],D=t[11],F=t[12],H=t[13],N=t[14];t=t[15];var E=g.typedBuffer;g=g.typedBufferStride;var G=d.typedBuffer;d=d.typedBufferStride;for(let O=0;O<w;O++){const L=O*g;var I=O*d;const P=G[I],M=G[I+1],K=G[I+2];I=G[I+3];E[L]=v*P+u*M+A*K+F*I;E[L+1]=m*P+x*M+B*K+H*I;E[L+2]=r*P+y*M+C*K+N*I;E[L+3]=n*P+z*M+D*K+t*I}}}function p(g,d,t,w=4,v=w){if(g.length/w!==d.length/v)q.getMathLogger().error("source and destination buffers need to have the same number of elements");
else{var m=g.length/w,r=t[0],n=t[1],u=t[2],x=t[3],y=t[4],z=t[5],A=t[6],B=t[7],C=t[8],D=t[9],F=t[10],H=t[11],N=t[12],E=t[13],G=t[14];t=t[15];var I=0,O=0;for(let L=0;L<m;L++){const P=d[I],M=d[I+1],K=d[I+2],J=d[I+3];g[O]=r*P+y*M+C*K+N*J;g[O+1]=n*P+z*M+D*K+E*J;g[O+2]=u*P+A*M+F*K+G*J;g[O+3]=x*P+B*M+H*K+t*J;I+=v;O+=w}}}function k(g,d,t){h(g.typedBuffer,d.typedBuffer,t,g.typedBufferStride,d.typedBufferStride)}function h(g,d,t,w=4,v=w){if(g.length/w===d.length/v){var m=g.length/w,r=t[0],n=t[1],u=t[2],x=t[3],
y=t[4],z=t[5],A=t[6],B=t[7];t=t[8];var C=0,D=0;for(let F=0;F<m;F++){const H=d[C],N=d[C+1],E=d[C+2],G=d[C+3];g[D]=r*H+x*N+A*E;g[D+1]=n*H+y*N+B*E;g[D+2]=u*H+z*N+t*E;g[D+3]=G;C+=v;D+=w}}}function f(g,d){const t=Math.min(g.count,d.count),w=g.typedBuffer;g=g.typedBufferStride;const v=d.typedBuffer;d=d.typedBufferStride;for(let n=0;n<t;n++){const u=n*g;var m=n*d;const x=v[m],y=v[m+1];m=v[m+2];var r=x*x+y*y+m*m;0<r&&(r=1/Math.sqrt(r),w[u]=r*x,w[u+1]=r*y,w[u+2]=r*m)}}function c(g,d,t){e(g.typedBuffer,d,t,
g.typedBufferStride)}function e(g,d,t,w=4){const v=Math.min(g.length/w,d.count),m=d.typedBuffer;d=d.typedBufferStride;let r=0,n=0;for(let u=0;u<v;u++)g[n]=t*m[r],g[n+1]=t*m[r+1],g[n+2]=t*m[r+2],g[n+3]=t*m[r+3],r+=d,n+=w}b=Object.freeze(Object.defineProperty({__proto__:null,normalize:f,scale:e,scaleView:c,transformMat3:h,transformMat3View:k,transformMat4:p,transformMat4View:l},Symbol.toStringTag,{value:"Module"}));a.normalize=f;a.scale=e;a.scaleView=c;a.transformMat3=h;a.transformMat3View=k;a.transformMat4=
p;a.transformMat4View=l;a.vec4=b})},"esri/geometry/support/buffer/math/common":function(){define(["exports","../../../../core/Logger"],function(a,b){a.getMathLogger=()=>b.getLogger("esri.views.3d.support.buffer.math");Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/sources/interfaces":function(){define(["exports"],function(a){a.MeshTransformUpdateAction=void 0;var b=a.MeshTransformUpdateAction||(a.MeshTransformUpdateAction={});b[b.EnableFastUpdates=0]="EnableFastUpdates";
b[b.DisableFastUpdates=1]="DisableFastUpdates";b[b.UpdateFastLocalOrigin=2]="UpdateFastLocalOrigin";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/internal/resourceUtils":function(){define(["exports","../../../../core/has","../../webgl-engine/lib/basicInterfaces"],function(a,b,q){class l{constructor(p){this.data=p;this.type="encoded-mesh-texture";this.encoding=q.TextureEncodingMimeType.KTX2_ENCODING}}a.EncodedMeshTexture=l;a.imageFromBinaryData=async function(p,
k){if(k===q.TextureEncodingMimeType.KTX2_ENCODING)return new l(p);p=new Blob([p],{type:k});const h=URL.createObjectURL(p),f=new Image;if(b("esri-iPhone"))return new Promise((c,e)=>{const g=()=>{t();c(f)},d=w=>{t();e(w)},t=()=>{URL.revokeObjectURL(h);f.removeEventListener("load",g);f.removeEventListener("error",d)};f.addEventListener("load",g);f.addEventListener("error",d);f.src=h});try{f.src=h,await f.decode()}catch(c){console.warn("Failed decoding HTMLImageElement")}URL.revokeObjectURL(h);return f};
a.isEncodedMeshTexture=function(p){return"encoded-mesh-texture"===p?.type};a.jsonFromBinaryData=async function(p){p=await (new Blob([p])).text();return JSON.parse(p)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/internal/TextureTransformUtils":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/mat3f64","../../../../core/libs/gl-matrix-2/factories/vec2f32","../../../../core/libs/gl-matrix-2/math/mat3"],function(a,b,q,l){a.getTransformMatrix=
function(p){if(null==p)return null;var k=null!=p.offset?p.offset:q.ZEROS,h=null!=p.rotation?p.rotation:0;p=null!=p.scale?p.scale:q.ONES;k=b.fromValues(1,0,0,0,1,0,k[0],k[1],1);h=b.fromValues(Math.cos(h),-Math.sin(h),0,Math.sin(h),Math.cos(h),0,0,0,1);p=b.fromValues(p[0],0,0,0,p[1],0,0,0,1);const f=b.create();l.multiply(f,h,p);l.multiply(f,k,f);return f};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer":function(){define("exports ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ./ElevationAligners ./elevationAlignmentUtils ./featureExpressionInfoUtils ./Graphics3DObject3DGraphicLayer ./meshAutoFastUpdateConstants".split(" "),
function(a,b,q,l,p,k,h,f,c,e){class g extends c.Graphics3DObject3DGraphicLayer{constructor(){super(...arguments);this.fastTransformUpdatesAllowed=!1;this._originalGeometries=[];this._fastTransformUpdatesEnabled=!1;this._autoDisableFastUpdatesTimeoutId=0}get fastTransformUpdatesEnabled(){return this._fastTransformUpdatesEnabled}destroy(){super.destroy();this._cancelAutoDisableFastUpdates()}enableFastTransformUpdates(x,y){if(this.fastTransformUpdatesAllowed&&!this._fastTransformUpdatesEnabled){this._cancelAutoDisableFastUpdates();
this._fastTransformUpdatesEnabled=!0;var {stageObject:z}=this,A=z.geometries.slice();z.removeAllGeometries();var B=b.getTranslation(d,z.transformation);y=y.getOrigin(B);for(const C of A)B=x(C.material),B=C.instantiate({material:B}),B.localOrigin=y,z.addGeometry(B);this._originalGeometries=A}}autoDisableFastTransformUpdates(x){this._cancelAutoDisableFastUpdates();this._autoDisableFastUpdatesTimeoutId=setTimeout(()=>{this._autoDisableFastUpdatesTimeoutId=0;x()},e.meshAutoFastUpdateConstants.disableDelayMs)}updateAutoDisableFastTransformUpdates(x){this._autoDisableFastUpdatesTimeoutId&&
this.autoDisableFastTransformUpdates(x)}_cancelAutoDisableFastUpdates(){clearTimeout(this._autoDisableFastUpdatesTimeoutId);this._autoDisableFastUpdatesTimeoutId=0}disableFastTransformUpdates(x){if(this._fastTransformUpdatesEnabled){this._cancelAutoDisableFastUpdates();this._fastTransformUpdatesEnabled=!1;var {stageObject:y}=this,z=y.geometries.map(A=>x(A.material));y.removeAllGeometries();for(let A=0;A<this._originalGeometries.length;A++){const B=this._originalGeometries[A],C=z[A];C.setParameters({modelTransformation:null});
C===B.material?y.addGeometry(B):y.addGeometry(B.instantiate({material:C}))}this._originalGeometries.length=0}}updateFastLocalOrigin(x,y,z){if(this._fastTransformUpdatesEnabled){var {stageObject:A}=this;if(0!==A.geometries.length){var B=A.geometries[0].localOrigin,C=b.getTranslation(d,x),D=z.getOrigin(C);if(D!==B){var F=y?.localMatrix??q.IDENTITY;A.shaderTransformation=null;A.transformation=x;A.geometries.forEach(H=>{H.transformation=F;H.localOrigin=D})}}}}updateTransform(x,y,z){const {stageObject:A}=
this,B=y?.localMatrix??q.IDENTITY;if(this._fastTransformUpdatesEnabled){var C=A.geometries[0].transformation;y=b.multiply(t,A.transformation,C);x=b.multiply(w,x,B);C=b.multiply(m,x,b.invert(m,C));A.shaderTransformation=C;this._setFastMaterialTransformation({matA:y,matB:x})}else A.shaderTransformation=null,A.transformation=x,A.geometries.forEach(D=>D.transformation=B);this._updateEdgeTransform(z)}alignWithElevation(x,y,z,A){if(this._fastTransformUpdatesEnabled){null!=z&&f.setContextFeature(this.elevationContext.featureExpressionInfoContext,
z);var {stageObject:B}=this;if(B.geometries[0].material.parameters.modelTransformation){z=b.multiply(t,B.transformation,B.geometries[0].transformation);var C=b.copy(v,B.effectiveTransformation);this.alignedSampledElevation=k.perObjectElevationAligner(this,this.elevationContext,x.spatialReference,(D,F)=>h.evaluateElevationInfoAtPoint(D,x,this.elevationContext,y,F),y,C);B.shaderTransformation=C;B=b.multiply(w,C,B.geometries[0].transformation);this._setFastMaterialTransformation({matA:z,matB:B});this._updateEdgeTransform(A)}}else super.alignWithElevation(x,
y,z,A)}_setFastMaterialTransformation({matA:x,matB:y}){const {stageObject:z}=this;if(0!==z.geometries.length){var A=b.fromTranslation(u,l.scale(d,z.geometries[0].localOrigin.vec3,-1));x=b.multiply(r,A,x);y=b.multiply(n,A,y);A=b.invert(r,x);y=b.multiply(n,y,A);for(const B of z.geometries)B.material.setParameters({modelTransformation:y})}}_updateEdgeTransform(x){const {stageObject:y,_stageLayer:z}=this;z.stage.renderer.withEdgeView(A=>{A.fastUpdateObject3DEdgesTransform(y)||this.resetEdgeObject(x)})}}
const d=p.create(),t=q.create(),w=q.create(),v=q.create(),m=q.create(),r=q.create(),n=q.create(),u=q.create();a.Graphics3DMeshObject3DGraphicLayer=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/meshAutoFastUpdateConstants":function(){define(["exports"],function(a){a.meshAutoFastUpdateConstants={disableDelayMs:2E3};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/MeshFastUpdateProcessor":function(){define(["exports",
"../../webgl-engine/materials/DefaultMaterial"],function(a,b){class q{constructor(){this._fastTransformOriginalMaterials=new Map;this._fastTransformClonedMaterials=new Map;this._graphicReferenceCount=0}enable(p,k,h){p.enableFastTransformUpdates(f=>{if(1>=this._graphicReferenceCount){if(this._fastTransformOriginalMaterials.has(f))return f;var c=k.byMaterial(f);this._fastTransformOriginalMaterials.set(f,c);k.delete(f);return f}c=new b.DefaultMaterial(f.parameters);h.stage.add(c);this._fastTransformClonedMaterials.set(c,
f);return c},h.localOriginFactory)}disable(p,k,h){const f=new Set,c=new Set;p.disableFastTransformUpdates(e=>{if(!this._fastTransformClonedMaterials.has(e)){var g=this._fastTransformOriginalMaterials.get(e);if(k.has(g.uid))return f.add(e),k.byUid(g.uid).material;c.add(e);return g.material}g=this._fastTransformClonedMaterials.get(e);this._fastTransformClonedMaterials.delete(e);h.stage.remove(e);return g});for(const e of f)this._fastTransformOriginalMaterials.delete(e),h.stage.remove(e);for(const e of c)p=
this._fastTransformOriginalMaterials.get(e),this._fastTransformOriginalMaterials.delete(e),k.set(p.uid,p)}onAddGraphic(){this._graphicReferenceCount++}onRemoveGraphic(p,k,h){this._graphicReferenceCount--;this.disable(p,k,h)}forEachMaterialInfo(p){this._fastTransformOriginalMaterials.forEach(p)}forEachClonedMaterial(p){this._fastTransformClonedMaterials.forEach(p)}destroy(p){p.removeMany(Array.from(this._fastTransformClonedMaterials.keys()));p.removeMany(Array.from(this._fastTransformOriginalMaterials.values(),
({material:k})=>k));this._fastTransformClonedMaterials.clear();this._fastTransformOriginalMaterials.clear()}}class l{constructor(){this._byUid=new Map;this._byMaterial=new Map}get materials(){return Array.from(this._byUid.values(),p=>p.material)}byUid(p){return this._byUid.get(p)}byMaterial(p){return this._byMaterial.get(p)}set(p,k){this._byUid.set(p,k);this._byMaterial.set(k.material,k)}delete(p){const k=this._byMaterial.get(p)?.uid;k&&(this._byUid.delete(k),this._byMaterial.delete(p))}has(p){return this._byUid.has(p)}forEachMaterialInfo(p){this._byUid.forEach(p)}clear(){this._byUid.clear();
this._byMaterial.clear()}}a.MaterialInfoCache=l;a.MeshFastUpdateProcessor=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/NativeLineMaterial":function(){define("exports ../../../../core/Logger ../../../../core/mathUtils ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/support/frustum ../../../../geometry/support/lineSegment ../../../../geometry/support/plane ../core/shaderLibrary/ShaderOutput ../lib/GLMaterial ../lib/Material ../lib/RenderSlot ../lib/Util ../lib/VertexAttribute ./DefaultBufferWriter ./DefaultLayouts ../shaders/NativeLineTechnique ../shaders/NativeLineTechniqueConfiguration".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){class z extends w.Material{constructor(S){super(S,new B);this._configuration=new y.NativeLineTechniqueConfiguration;this.produces=new Map([[v.RenderSlot.OPAQUE_MATERIAL,V=>V===d.ShaderOutput.Color||V===d.ShaderOutput.Highlight||V===d.ShaderOutput.ObjectAndLayerIdColor]])}getConfiguration(S){this._configuration.output=S;this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.hasVertexColors=this.parameters.hasVertexColors;
this._configuration.transparent=1>this.parameters.color[3]||1>this.parameters.width;this._configuration.hasOccludees=this.parameters.hasOccludees;return this._configuration}intersect(S,V,T,Y,ha,ba){if(T.options.selectionMode&&S.visible)if(m.isTranslationMatrix(V)){ha=S.attributes.get(r.VertexAttribute.POSITION).data;var U=T.camera,Z=P;p.copy(Z,T.point);k.set(M[0],Z[0]-2,Z[1]+2,0);k.set(M[1],Z[0]+2,Z[1]+2,0);k.set(M[2],Z[0]+2,Z[1]-2,0);k.set(M[3],Z[0]-2,Z[1]-2,0);for(S=0;4>S;S++)if(!U.unprojectFromRenderScreen(M[S],
K[S]))return;g.fromPoints(U.eye,K[0],K[1],J);g.fromPoints(U.eye,K[1],K[2],R);g.fromPoints(U.eye,K[2],K[3],Q);g.fromPoints(U.eye,K[3],K[0],W);Y=Number.MAX_VALUE;S=0;for(let ea=0;ea<ha.length-5;ea+=3)if(C[0]=ha[ea]+V[12],C[1]=ha[ea+1]+V[13],C[2]=ha[ea+2]+V[14],D[0]=ha[ea+3]+V[12],D[1]=ha[ea+4]+V[13],D[2]=ha[ea+5]+V[14],!(0>g.signedDistance(J,C)&&0>g.signedDistance(J,D)||0>g.signedDistance(R,C)&&0>g.signedDistance(R,D)||0>g.signedDistance(Q,C)&&0>g.signedDistance(Q,D)||0>g.signedDistance(W,C)&&0>g.signedDistance(W,
D))){U.projectToRenderScreen(C,N);U.projectToRenderScreen(D,E);if(0>N[2]&&0<E[2]){k.subtract(F,C,D);var ca=U.frustum;ca=-g.signedDistance(ca[c.PlaneIndex.NEAR],C)/k.dot(F,g.getNormal(ca[c.PlaneIndex.NEAR]));k.scale(F,F,ca);k.add(C,C,F);U.projectToRenderScreen(C,N)}else if(0<N[2]&&0>E[2])k.subtract(F,D,C),ca=U.frustum,ca=-g.signedDistance(ca[c.PlaneIndex.NEAR],D)/k.dot(F,g.getNormal(ca[c.PlaneIndex.NEAR])),k.scale(F,F,ca),k.add(D,D,F),U.projectToRenderScreen(D,E);else if(0>N[2]&&0>E[2])continue;N[2]=
0;E[2]=0;ca=e.distance2(e.fromPoints(N,E,O),Z);ca<Y&&(Y=ca,k.copy(G,C),k.copy(I,D),S=ea/3)}V=T.rayBegin;T=T.rayEnd;4>Y&&(Y=Number.MAX_VALUE,e.closestLineSegmentPoint(e.fromPoints(G,I,O),e.fromPoints(V,T,L),H)&&(k.subtract(H,H,V),Y=k.length(H),k.scale(H,H,1/Y),Y/=k.distance(V,T)),ba(Y,H,S,!1))}else b.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix")}intersectDraped(S,V,T,Y,ha,ba){if(T.options.selectionMode){V=S.attributes.get(r.VertexAttribute.POSITION).data;
var U=S.attributes.get(r.VertexAttribute.SIZE);T=Y[0];Y=Y[1];S=(((U?U.data[0]:0)+1)/2+4)*S.screenToWorldRatio;U=Number.MAX_VALUE;var Z=0;for(let ka=0;ka<V.length-5;ka+=3){var ca=V[ka],ea=V[ka+1],da=T-ca,ia=Y-ea;ca=V[ka+3]-ca;ea=V[ka+4]-ea;const fa=q.clamp((ca*da+ea*ia)/(ca*ca+ea*ea),0,1);da=ca*fa-da;ia=ea*fa-ia;ia=da*da+ia*ia;ia<U&&(U=ia,Z=ka/3)}U<S*S&&ha(ba.dist,ba.normal,Z,!1)}}createGLMaterial(S){return new A(S)}createBufferWriter(){return new n.DefaultBufferWriter(this.parameters.hasVertexColors?
u.PositionColorLayout:u.PositionLayout)}}class A extends t{_updateOccludeeState(S){S.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:S.hasOccludees})}beginSlot(S){this._output===d.ShaderOutput.Color&&this._updateOccludeeState(S);return this.ensureTechnique(x.NativeLineTechnique,S)}}class B extends w.MaterialParameters{constructor(){super(...arguments);this.color=f.ONES;this.hasSlicePlane=this.hasVertexColors=!1;this.width=1;this.hasOccludees=!1}}const C=
h.create(),D=h.create(),F=h.create(),H=h.create(),N=l.createRenderScreenPointArray3(),E=l.createRenderScreenPointArray3(),G=h.create(),I=h.create(),O=e.create(),L=e.create(),P=h.create(),M=[l.createRenderScreenPointArray3(),l.createRenderScreenPointArray3(),l.createRenderScreenPointArray3(),l.createRenderScreenPointArray3()],K=[h.create(),h.create(),h.create(),h.create()],J=g.create(),R=g.create(),Q=g.create(),W=g.create();a.NativeLineMaterial=z;a.Parameters=B;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/webgl-engine/materials/DefaultLayouts":function(){define(["exports","../../support/buffer/InterleavedLayout","../lib/VertexAttribute"],function(a,b,q){const l=b.newLayout().vec3f(q.VertexAttribute.POSITION),p=b.newLayout().vec3f(q.VertexAttribute.POSITION).vec2f(q.VertexAttribute.UV0),k=b.newLayout().vec3f(q.VertexAttribute.POSITION).vec4u8(q.VertexAttribute.COLOR);b=b.newLayout().vec3f(q.VertexAttribute.POSITION).vec2f(q.VertexAttribute.UV0).vec4u8(q.VertexAttribute.OBJECTANDLAYERIDCOLOR);
a.PositionColorLayout=k;a.PositionLayout=l;a.PositionUVLayout=p;a.PositionUVLayoutObjectAndLayerId=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/NativeLineTechnique":function(){define("require exports ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../lib/StencilUtils ../../../../chunks/NativeLine.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){class d extends p.ShaderTechnique{initializeProgram(t){return new h.Program(t.rctx,d.shader.get().build(this.configuration),k.Default3D)}initializePipeline(){const t=this.configuration,w=g.separateBlendingParams(e.BlendFactor.SRC_ALPHA,e.BlendFactor.ONE,e.BlendFactor.ONE_MINUS_SRC_ALPHA,e.BlendFactor.ONE_MINUS_SRC_ALPHA),v=(m,r=null,n=null)=>g.makePipelineState({blending:r,depthTest:f.depthCompareLess,depthWrite:n,colorWrite:g.defaultColorWriteParams,stencilWrite:t.hasOccludees?
f.stencilWriteMaskOn:null,stencilTest:t.hasOccludees?m?f.stencilToolMaskBaseParams:f.stencilBaseAllZerosParams:null});return t.output===q.ShaderOutput.Color?(this._occludeePipelineState=v(!0,t.transparent?w:null,g.defaultDepthWriteParams),v(!1,t.transparent?w:null,g.defaultDepthWriteParams)):v(!1)}get primitiveType(){return e.PrimitiveType.LINES}getPipeline(t){return t?this._occludeePipelineState:super.getPipeline()}}d.shader=new l.ReloadableShaderModule(c.NativeLine,()=>new Promise((t,w)=>a(["./NativeLine.glsl"],
t,w)));b.NativeLineTechnique=d;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/NativeLine.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){function w(m){const r=new d.ShaderBuilder,{vertex:n,fragment:u}=r;r.include(l.Transform,m);r.include(p.VertexColor,m);f.addProjViewLocalOrigin(n,m);r.attributes.add(t.VertexAttribute.POSITION,"vec3");r.varyings.add("vpos","vec3");n.code.add(g.glsl`void main(void) {
vpos = position;
forwardNormalizedVertexColor();
gl_Position = transformPosition(proj, view, vpos);
}`);m.output===b.ShaderOutput.Highlight&&r.include(k.OutputHighlight,m);r.include(q.SliceDraw,m);u.uniforms.add(new e.FloatPassUniform("alphaCoverage",(x,y)=>Math.min(1,x.width*y.camera.pixelRatio)));m.hasVertexColors||u.uniforms.add(new c.Float4PassUniform("constantColor",x=>x.color));u.code.add(g.glsl`
void main() {
discardBySlice(vpos);
vec4 color = ${m.hasVertexColors?"vColor":"constantColor"};
${m.output===b.ShaderOutput.ObjectAndLayerIdColor?g.glsl`color.a = 1.0;`:""}
if (color.a < ${g.glsl.float(h.symbolAlphaCutoff)}) {
discard;
}
${m.output===b.ShaderOutput.Color?g.glsl`fragColor = highlightSlice(color, vpos);`:""}
${m.output===b.ShaderOutput.Highlight?g.glsl`outputHighlight();`:""}
}
`);return r}const v=Object.freeze(Object.defineProperty({__proto__:null,build:w},Symbol.toStringTag,{value:"Module"}));a.NativeLine=v;a.build=w})},"esri/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderLibrary/ShaderOutput","../core/shaderTechnique/ShaderTechniqueConfiguration","../materials/DefaultTechniqueConfiguration"],function(a,b,q,l,p){class k extends p.DefaultTechniqueConfiguration{constructor(){super(...arguments);
this.output=q.ShaderOutput.Color;this.hasOccludees=this.transparent=this.hasVertexColors=this.hasSlicePlane=!1}}b.__decorate([l.parameter({count:q.ShaderOutput.COUNT})],k.prototype,"output",void 0);b.__decorate([l.parameter()],k.prototype,"hasSlicePlane",void 0);b.__decorate([l.parameter()],k.prototype,"hasVertexColors",void 0);b.__decorate([l.parameter()],k.prototype,"transparent",void 0);b.__decorate([l.parameter()],k.prototype,"hasOccludees",void 0);a.NativeLineTechniqueConfiguration=k;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DObjectSymbolLayer":function(){define("exports ../../../../Color ../../../../core/has ../../../../core/promiseUtils ../../../../core/screenUtils ../../../../core/typedArrayUtil ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/projection/computeTranslationToOriginAndRotation ../../../../geometry/projection/projectPointToVector ../../../../geometry/support/aaBoundingBox ../../../../symbols/support/ObjectSymbol3DLayerResource ../../../../symbols/support/symbolLayerUtils3D ./defaultSymbolComplexity ./ElevationAligners ./elevationAlignmentUtils ./Graphics3DLodInstanceGraphicLayer ./Graphics3DSymbolLayer ./graphicUtils ./interfaces ./Loadable ./lodResourceUtils ./objectResourceUtils ./pointUtils ./primitiveObjectSymbolUtils ./SymbolComplexity ./webStyleUtils ../support/FastSymbolUpdates ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/lib/lodRendering/LodRenderer ../../webgl-engine/lib/lodRendering/LodResources ../../webgl-engine/materials/DefaultMaterial ../../webgl-engine/materials/pbrUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K){function J(ha,ba,U){const Z=e.create();switch(U.anchor){case "center":c.copy(Z,w.center(ha));c.negate(Z,Z);break;case "top":ba=w.center(ha);c.set(Z,-ba[0],-ba[1],-ha[5]);break;case "bottom":ba=w.center(ha);c.set(Z,-ba[0],-ba[1],-ha[2]);break;case "relative":ba=w.center(ha);ha=w.size(ha);U=(U=U.anchorPosition)?e.fromValues(U.x,U.y,U.z):e.ZEROS;c.multiply(Z,ha,U);c.add(Z,Z,ba);c.negate(Z,Z);break;default:null!=ba?c.negate(Z,
ba):c.copy(Z,e.ZEROS)}return Z}class R{constructor(ha,ba,U,Z,ca,ea,da,ia,ka,fa,X,ja){this.lodResources=ha;this.lodRenderer=ba;this.stageResources=U;this.originalMaterialParameters=Z;this.resourceSize=ca;this.isEsriSymbolResource=ea;this.isWosr=da;this.resourceBoundingBox=ia;this.symbolSize=ka;this.extentPadding=fa;this.physicalBasedRenderingEnabled=X;this.pivotOffset=ja}}class Q extends y.Graphics3DSymbolLayer{getCachedSize(){const [ha,ba,U]=null!=this._resources?this._resources.symbolSize:[1,1,1];
return{width:ha,depth:ba,height:U}}constructor(ha,ba,U,Z){super(ha,ba,U,Z);this._resources=null;this._optionalFields=[];this._instanceIndexToGraphicUid=new Map;this._hasLoadedPBRTextures=!1;this._disposeResourceHandles=[];this.skipHighSymbolLodsChanged=!1;this.ensureDrapedStatus(!1);this._hasLoadedPBRTextures=U.physicalBasedRenderingEnabled}async doLoad(ha){if(!this._drivenProperties.size&&z.validateSymbolLayerSize(this.symbolLayer))throw Error();if(this._isPrimitive){var ba=this.symbolLayer.resource;
ba=ba&&H.isValidPrimitive(ba?.primitive)?ba.primitive:v.defaultPrimitive;this._resources=await this._createResourcesForPrimitive(ba,ha)}else ba=(await E.getResourceUrlFromSymbolStyle(this.symbol.styleOrigin))?.href??this.symbolLayer.resource?.href,this._resources=await this._createResourcesForUrl(ba,ha);this.layerOpacityChanged();this.slicePlaneEnabledChanged();this.physicalBasedRenderingChanged();this.complexity=this.computeComplexity()}get extentPadding(){return null!=this._resources?this._resources.extentPadding:
0}get _isPrimitive(){return!this.symbolLayer.resource?.href}get lodRenderer(){return this._resources?.lodRenderer}get materials(){return this._resources?.stageResources.materials??[]}_setMaterialTransparencyParameters(ha,ba=this.symbolLayer?.material?.color){ba=this._getCombinedOpacity(ba);const U=1>ba||this.needsDrivenTransparentPass;ha.transparent=U;ha.opacity=ba;ha.cullFace=U?I.CullFaceOptions.None:I.CullFaceOptions.Back;return ha}async _createResourcesForPrimitive(ha,ba){var U=this.symbolLayer;
const Z=w.create(m.objectSymbolLayerPrimitiveBoundingBox(ha)),ca=e.fromArray(w.size(Z)),ea=e.fromArray(m.objectSymbolLayerSizeWithResourceSize(ca,U)),da=c.length(ea);var ia={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:[...K.defaultSchematicMRRFactors],ambient:e.ONES,diffuse:e.ONES,hasSlicePlane:this._context.slicePlaneEnabled,hasSliceHighlight:!1,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!this.symbolLayer.isPrimitive};const ka=!!ia.usePBR;
this._setMaterialTransparencyParameters(ia);const fa=this.symbol;if("point-3d"===fa.type&&fa.verticalOffset){const {screenLength:X,minWorldLength:ja,maxWorldLength:la}=fa.verticalOffset;ia.verticalOffset={screenLength:p.pt2px(X),minWorldLength:ja||0,maxWorldLength:null!=la?la:Infinity};ia.castShadows=!1}this._context.screenSizePerspectiveEnabled&&(ia.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings);this._drivenProperties.color?ia.externalColor=g.ONES:(U=null!=U.material?
U.material.color:null,U=null!=U?b.toUnitRGBA(U):g.ONES,ia.externalColor=U);this._fastUpdates=G.initFastSymbolUpdatesState(this._context.renderer,this._fastVisualVariableConvertOptions(Z,ea,ca,null));ia.isInstanced=!0;this._fastUpdates?(Object.assign(ia,this._fastUpdates.materialParameters),this._optionalFields.push(O.VertexAttribute.FEATUREATTRIBUTE)):this._hasPerInstanceColor()&&(ia.hasInstancedColor=!0,this._optionalFields.push(O.VertexAttribute.COLOR));q("enable-feature:objectAndLayerId-rendering")&&
this._optionalFields.push(O.VertexAttribute.OBJECTANDLAYERIDCOLOR);ia=new M.DefaultMaterial(ia);ia=H.primitiveLodResources(ha,ia);if(!ia)throw Error(`Unknown object symbol primitive: ${ha}`);ha=P.materialsFromLodResources(ia).map(X=>({opacity:1,transparent:X.parameters.transparent}));U=await this._createStageResources(ia,ka,ba);ba=await this._createLodRenderer(ia,ba);return new R(ia,ba,U,ha,ca,!1,!1,Z,ea,da,ka,null)}async _createResourcesForUrl(ha,ba){var U={materialParameters:{isInstanced:!0,hasSlicePlane:this._context.slicePlaneEnabled,
castShadows:this.symbolLayer.castShadows},streamDataRequester:this._context.streamDataRequester,cache:this._context.sharedResources.objectResourceCache};(this._fastUpdates=G.initFastSymbolUpdatesState(this._context.renderer,this._fastVisualVariableConvertOptions(null,null,null,null)))?(Object.assign(U.materialParameters,this._fastUpdates.materialParameters),this._optionalFields.push(O.VertexAttribute.FEATUREATTRIBUTE)):this._hasPerInstanceColor()&&(U.materialParameters.hasInstancedColor=!0,this._optionalFields.push(O.VertexAttribute.COLOR));
q("enable-feature:objectAndLayerId-rendering")&&this._optionalFields.push(O.VertexAttribute.OBJECTANDLAYERIDCOLOR);var Z=this.symbol;if("point-3d"===Z.type&&Z.verticalOffset){const {screenLength:Da,minWorldLength:ra,maxWorldLength:xa}=Z.verticalOffset;U.materialParameters.verticalOffset={screenLength:p.pt2px(Da),minWorldLength:ra||0,maxWorldLength:null!=xa?xa:Infinity};U.materialParameters.castShadows=!1}Z=this._context.physicalBasedRenderingEnabled;U.signal=ba;U.usePBR=Z;U.skipHighLods=this._context.skipHighSymbolLods;
var ca=await D.fetch(ha,U);ha=ca.isEsriSymbolResource;U=ca.isWosr;const ea=C.makeLodResources(ca.lods),da=this._context,ia=this._getExternalColorParameters(this.symbolLayer.material),ka=this._getCombinedOpacity(this.symbolLayer?.material?.color,{hasIntrinsicColor:!0}),fa=this.needsDrivenTransparentPass;var X=P.materialsFromLodResources(ea);const ja=P.materialsFromLodResources(ea).map(Da=>({opacity:Da.parameters.opacity||1,transparent:Da.parameters.transparent}));X.forEach(Da=>{const ra=Da.parameters;
Da.setParameters(ia);const xa=ra.opacity*ka;Da.setParameters({opacity:xa,transparent:1>xa||fa||ra.transparent});da.screenSizePerspectiveEnabled&&Da.setParameters({screenSizePerspective:da.sharedResources.screenSizePerspectiveSettings})});ca=ca.referenceBoundingBox;const la=e.fromArray(w.size(ca)),na=e.fromArray(ea.levels[0].pivotOffset),va=e.fromArray(m.objectSymbolLayerSizeWithResourceSize(la,this.symbolLayer)),za=c.length(va),ya=this._fastUpdates;G.updateFastSymbolUpdatesState(ya,this._context.renderer,
this._fastVisualVariableConvertOptions(ca,va,la,na))&&X.forEach(Da=>Da.setParameters(ya.materialParameters));X=await this._createStageResources(ea,Z,ba);ba=await this._createLodRenderer(ea,ba);return new R(ea,ba,X,ja,la,ha,U,ca,va,za,Z,na)}_addDisposeResource(ha){this._disposeResourceHandles.push(ha)}async _createStageResources(ha,ba,U){const Z=this._context.stage,ca=P.materialsFromLodResources(ha);ba!==this._context.physicalBasedRenderingEnabled&&this.physicalBasedRenderingChanged();Z.addMany(ca);
this._addDisposeResource(()=>Z.removeMany(ca));const ea=P.texturesFromLodResources(ha);Z.addMany(ea);this._addDisposeResource(()=>{ea.forEach(ia=>ia.unload());Z.removeMany(ea)});await Promise.all(ea.map(ia=>this._context.stage.schedule(()=>ia.load(Z.renderView.renderingContext),U)));l.throwIfAborted(U);const da=P.geometriesFromLodResources(ha);Z.addMany(da);this._addDisposeResource(()=>Z.removeMany(da));return{materials:ca,textures:ea,geometries:da}}async _createLodRenderer(ha,ba){const U=this._context.stage,
Z=this._fastUpdates,ca=new L.LodRenderer({symbol:ha,optionalFields:this._optionalFields,metadata:{layerUid:this._context.layer.uid,graphicUid:ea=>this._instanceIndexToGraphicUid.get(ea),notifyGraphicGeometryChanged:ea=>this._context.notifyGraphicGeometryChanged(this._instanceIndexToGraphicUid.get(ea)),notifyGraphicVisibilityChanged:ea=>this._context.notifyGraphicVisibilityChanged(this._instanceIndexToGraphicUid.get(ea))},shaderTransformation:Z?{applyTransform:(ea,da,ia)=>{ea.getFeatureAttribute(da,
T);h.copy(ia,G.evaluateModelTransform(Z.materialParameters,T,ia))},scaleFactor:(ea,da,ia)=>{da.getFeatureAttribute(ia,T);G.evaluateModelTransformScale(ea,Z.materialParameters,T)}}:null},this._context.scheduler);ca.slicePlaneEnabled=this._context.slicePlaneEnabled;this._addDisposeResource(()=>{U.removeRenderPlugin(ca);ca.destroy()});await U.addRenderPlugin(ca,ba);return ca}_getExternalColorParameters(ha){const ba={};this._drivenProperties.color?ba.externalColor=g.ONES:null!=ha?.color?ba.externalColor=
b.toUnitRGBA(ha.color):(ba.externalColor=g.ONES,ba.colorMixMode="ignore");return ba}destroy(){super.destroy();this._cleanupResources()}_cleanupResources(){this._disposeResourceHandles.forEach(ha=>ha());this._disposeResourceHandles.length=0;this._resources=null}createGraphics3DGraphic(ha){const ba=ha.graphic;if(!this._validateGeometry(ba.geometry))return null;const U=F.placePointOnGeometry(ba.geometry);if(null==U)return this.logger.warn(`unsupported geometry type for icon symbol: ${ba.geometry.type}`),
null;const Z=this.setGraphicElevationContext(ba);return this._createAs3DShape(ba,U,ha.renderingInfo,Z,ba.uid,ha.layer.uid)}notifyDestroyGraphicLayer(ha){this._instanceIndexToGraphicUid.delete(ha.instanceIndex)}graphicLayerToGraphicId(){return 0}layerOpacityChanged(){if(null!=this._resources){var ha=this._drivenProperties.opacity,ba=!this._isPrimitive,U=this._resources.stageResources.materials,Z=this._resources.originalMaterialParameters;for(let ea=0;ea<U.length;ea++){const da=U[ea];var ca=Z[ea];const ia=
this._getCombinedOpacity(this.symbolLayer?.material?.color,{hasIntrinsicColor:ba})*ca.opacity;ca=1>ia||ha||ca.transparent;da.setParameters({opacity:ia,transparent:ca});this._isPrimitive&&da.setParameters({cullFace:ca?I.CullFaceOptions.None:I.CullFaceOptions.Back})}}}layerElevationInfoChanged(ha,ba){return this.updateGraphics3DGraphicElevationInfo(ha,ba,u.needsElevationUpdates3D)}slicePlaneEnabledChanged(){if(null==this._resources)return!0;this._resources.lodRenderer.slicePlaneEnabled=this._context.slicePlaneEnabled;
for(const ha of this._resources.stageResources.materials)ha.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){if(null==this._resources)return!0;const {stageResources:ha,isWosr:ba}=this._resources;for(const U of ha.materials)this._isPrimitive?U.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}):ba||U.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!1});return!1===this._hasLoadedPBRTextures&&
!0===this._context.physicalBasedRenderingEnabled?(this._hasLoadedPBRTextures=!0,!1):!0}applyRendererDiff(ha,ba){if(null==this._resources)return A.ApplyRendererDiffResult.RecreateSymbol;const {stageResources:{materials:U},lodRenderer:Z,resourceBoundingBox:ca,symbolSize:ea,resourceSize:da,pivotOffset:ia}=this._resources;for(const ka in ha.diff)switch(ka){case "visualVariables":if(G.updateFastSymbolUpdatesState(this._fastUpdates,ba,this._fastVisualVariableConvertOptions(ca,ea,da,ia))){for(const fa of U)fa.setParameters(this._fastUpdates.materialParameters);
Z.notifyShaderTransformationChanged()}else return A.ApplyRendererDiffResult.RecreateSymbol;break;default:return A.ApplyRendererDiffResult.RecreateSymbol}return A.ApplyRendererDiffResult.FastUpdate}computeComplexity(){if(null==this._resources)return super.computeComplexity();var ha=this._resources.lodResources;const ba=r.estimateNumVerticesForLods(ha.levels),U=ca=>Array.from(ca.attributes.values()).reduce((ea,da)=>ea+k.estimateSize(da.data,da.indices),0),Z=P.geometriesFromLodResources(ha).reduce((ca,
ea)=>ca+U(ea),0);ha=P.texturesFromLodResources(ha).reduce((ca,ea)=>ca+ea.memoryEstimate,0)+Z;ha={...r.defaultSymbolLayerMemoryComplexity(this.symbol,this.symbolLayer),resourceBytes:ha};return new N.SymbolComplexity({verticesPerFeature:ba,memory:ha})}_hasLodRenderer(){return null!=this._resources}_createAs3DShape(ha,ba,U,Z,ca,ea){if(!this._hasLodRenderer()||null==this._resources)return null;ha=this.getFastUpdateAttrValues(ha);var da=this._context.clippingExtent;t.projectPointToVector(ba,W,this._context.elevationProvider.spatialReference);
if(null!=da&&!w.containsPoint(da,W))return null;da="absolute-height"!==Z.mode;const ia=this._computeGlobalTransform(ba,Z,V,Y),ka=this._computeLocalTransform(this._resources,this.symbolLayer,U,S),fa=this._resources.lodRenderer.instanceData,X=fa.addInstance();this._instanceIndexToGraphicUid.set(X,ca);fa.setLocalTransform(X,ka,!1);fa.setGlobalTransform(X,ia);ha&&fa.setFeatureAttribute(X,ha);null==this._fastUpdates&&this._hasPerInstanceColor()&&fa.setColor(X,z.mixinColorAndOpacity(U.color,U.opacity,255));
null!=this._context.stage.renderView.objectAndLayerIdRenderHelper&&fa.setObjectAndLayerIdColor(X,this._context.stage.renderView.objectAndLayerIdRenderHelper.getObjectAndLayerIdColor({graphicUid:ca,layerUid:ea}));U=new x.Graphics3DLodInstanceGraphicLayer(this,X,n.perLodInstanceElevationAligner,Z);da&&(U.alignedSampledElevation=Y.sampledElevation);U.needsElevationUpdates=u.needsElevationUpdates3D(Z.mode);F.extendPointGraphicElevationContext(U,ba,this._context.elevationProvider);return U}_computeGlobalTransform(ha,
ba,U,Z){u.evaluateElevationInfoAtPoint(ha,this._context.elevationProvider,ba,this._context.renderCoordsHelper,Z);W[0]=ha.x;W[1]=ha.y;W[2]=Z.z;d.computeTranslationToOriginAndRotation(ha.spatialReference,W,U,this._context.renderCoordsHelper.spatialReference);return U}_computeLocalTransform(ha,ba,U,Z){h.identity(Z);this._applyObjectRotation(U,!1,Z);this._applyObjectRotation(ba,!0,Z);this._applyObjectScale(ha,U,Z);this._applyAnchor(ha,ba,Z);return Z}_applyObjectScale(ha,ba,U){this._fastUpdates?.requiresShaderTransformation||
(ha=z.computeObjectScale(this._drivenProperties.size&&ba.size?ba.size:ha.symbolSize,ha.symbolSize,ha.resourceSize,this._context.renderCoordsHelper.unitInMeters),1===ha[0]&&1===ha[1]&&1===ha[2]||h.scale(U,U,ha))}prepareSymbolLayerPatch(ha){if("partial"===ha.diff.type){var ba=ha.diff.diff;this._preparePatchTransform(ha,ba);this._preparePatchColor(ha,ba)}}updateGeometry(ha,ba){if(null==this._resources)return!0;const U=ba&&F.placePointOnGeometry(ba);if(null==U)return!1;ba=this.getGeometryElevationMode(ba);
if(ha.elevationContext.mode!==ba)return!1;this._computeGlobalTransform(U,ha.elevationContext,V,Y);"absolute-height"!==ha.elevationContext.mode&&(ha.alignedSampledElevation=Y.sampledElevation);this._resources.lodRenderer.instanceData.setGlobalTransform(ha.instanceIndex,V,!0);F.extendPointGraphicElevationContext(ha,U,this._context.elevationProvider);return!0}_preparePatchTransform(ha,ba){if((ba.heading||ba.tilt||ba.roll||ba.width||ba.height||ba.depth||ba.anchor||ba.anchorPosition)&&null!=this._resources){var U=
(la,na,va)=>(null!=la&&"complete"===la.type?la.newValue:na)??va,Z=U(ba.heading,this.symbolLayer.heading,0),ca=U(ba.tilt,this.symbolLayer.tilt,0),ea=U(ba.roll,this.symbolLayer.roll,0),da=U(ba.width,this.symbolLayer.width,void 0),ia=U(ba.height,this.symbolLayer.height,void 0),ka=U(ba.depth,this.symbolLayer.depth,void 0),fa=U(ba.anchor,this.symbolLayer.anchor,void 0);U=U(ba.anchorPosition,this.symbolLayer.anchorPosition,void 0);delete ba.heading;delete ba.tilt;delete ba.roll;delete ba.width;delete ba.height;
delete ba.depth;delete ba.anchor;delete ba.anchorPosition;var X={heading:Z,tilt:ca,roll:ea,anchor:fa,anchorPosition:U},ja=this._resources;this.loadStatus===B.LoadStatus.LOADED&&ha.symbolLayerStatePatches.push(()=>{ja.symbolSize=e.fromArray(m.objectSymbolLayerSizeWithResourceSize(ja.resourceSize,{width:da,height:ia,depth:ka,isPrimitive:this.symbolLayer.isPrimitive}))});ha.graphics3DGraphicPatches.push((la,na)=>{na=this._computeLocalTransform(ja,X,na,S);ja.lodRenderer.instanceData.setLocalTransform(la.instanceIndex,
na,!0)})}}_preparePatchColor(ha,ba){if(ba.material&&"partial"===ba.material.type&&(ba=ba.material.diff,ba.color&&"complete"===ba.color.type&&null!=ba.color.newValue&&null!=ba.color.oldValue)){var U=ba.color.newValue,Z=null!=U?b.toUnitRGBA(U):g.ONES;delete ba.color;var ca=this._resources;null!=ca&&ha.graphics3DGraphicPatches.push(ea=>{this._hasPerInstanceColor()?(ca.lodRenderer.instanceData.setColor(ea.instanceIndex,Z),ea=this._setMaterialTransparencyParameters({},U)):ea=this._setMaterialTransparencyParameters({externalColor:Z},
U);for(const da of ca.stageResources.materials)da.setParameters(ea)})}}_applyObjectRotation(ha,ba,U){if(!this._fastUpdates?.requiresShaderTransformation||!ba)return z.computeObjectRotation(ha.heading,ha.tilt,ha.roll,U)}_applyAnchor(ha,ba,U){this._fastUpdates?.requiresShaderTransformation||(ha=J(ha.resourceBoundingBox,ha.pivotOffset,ba))&&h.translate(U,U,ha)}_hasPerInstanceColor(){return this._drivenProperties.color||this._drivenProperties.opacity}_fastVisualVariableConvertOptions(ha,ba,U,Z){const ca=
null!=ha?e.fromArray(w.size(ha)):e.ONES;ha=null!=ha?J(ha,Z,this.symbolLayer):e.ZEROS;Z=this._context.renderCoordsHelper.unitInMeters;U=z.computeObjectScale(null!=ba?ba:void 0,ba,U,Z);const ea=e.fromValues(this.symbolLayer.tilt||0,this.symbolLayer.roll||0,this.symbolLayer.heading||0);return new G.ConvertOptions({size:!0,color:!0,rotation:!0,opacity:!1},ca,ba??e.ONES,Z,ha,U,ea)}}const W=e.create(),S=f.create(),V=f.create(),T=g.create(),Y=new u.SampleElevationInfo;a.Graphics3DObjectSymbolLayer=Q;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ./elevationAlignmentUtils ./featureExpressionInfoUtils ./graphicUtils ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/Object3DStateID".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g{constructor(r,
n,u,x){this.graphics3DSymbolLayer=r;this.instanceIndex=n;this.elevationAligner=u;this.elevationContext=x;this.type="lod-instance";this._highlights=new Set;this.alignedSampledElevation=0;this.needsElevationUpdates=this.isElevationSource=!1}initialize(){}setVisibility(r){const n=this._lodRenderer.instanceData;r!==n.getVisible(this.instanceIndex)&&n.setVisible(this.instanceIndex,r)}destroy(){null!=this.instanceIndex&&(this._lodRenderer.instanceData.removeInstance(this.instanceIndex),this.graphics3DSymbolLayer.notifyDestroyGraphicLayer(this))}alignWithElevation(r,
n,u){this.elevationAligner&&(h.setContextFeature(this.elevationContext.featureExpressionInfoContext,u),u=this.elevationAligner(this,this.elevationContext,r.spatialReference,(x,y)=>k.evaluateElevationInfoAtPoint(x,r,this.elevationContext,n,y),n),null!=u&&(this.alignedSampledElevation=u))}getCenterObjectSpace(r=l.create()){this._lodRenderer.instanceData.getCombinedLocalTransform(this.instanceIndex,m);return q.transformMat4(r,this._lodRenderer.baseBoundingSphere.center,m)}getBoundingBoxObjectSpace(r=
p.create()){this._lodRenderer.instanceData.getCombinedLocalTransform(this.instanceIndex,m);const n=this._lodRenderer.baseBoundingBox;p.empty(r);for(let u=0;8>u;++u)q.set(t,0===(u&1)?n[0]:n[3],0===(u&2)?n[1]:n[4],0===(u&4)?n[2]:n[5]),q.transformMat4(t,t,m),p.expandWithVec3(r,t);return r}computeAttachmentOrigin(r){this._lodRenderer.instanceData.getGlobalTransform(this.instanceIndex,m);r.render.origin[0]+=m[12];r.render.origin[1]+=m[13];r.render.origin[2]+=m[14];r.render.num++}async getProjectedBoundingBox(r,
n,u,x,y){y=this.getBoundingBoxObjectSpace(y);var z=v;const A=p.isPoint(y)?1:z.length;this._lodRenderer.instanceData.getGlobalTransform(this.instanceIndex,m);for(var B=0;B<A;B++){const C=z[B];t[0]=y[C[0]];t[1]=y[C[1]];t[2]=y[C[2]];q.transformMat4(t,t,m);d[3*B]=t[0];d[3*B+1]=t[1];d[3*B+2]=t[2]}if(!r(d,0,A))return null;p.empty(y);r=null;this.calculateRelativeScreenBounds&&(r=this.calculateRelativeScreenBounds());for(z=0;z<3*A;z+=3){for(B=0;3>B;B++)y[B]=Math.min(y[B],d[z+B]),y[B+3]=Math.max(y[B+3],d[z+
B]);r&&u.push({location:d.slice(z,z+3),screenSpaceBoundingRect:r})}if(n&&(p.center(y,w),"absolute-height"!==this.elevationContext.mode)){let C;u=f.demResolutionForBoundingBox(y,n.service.spatialReference,n);try{C=await n.service.queryElevation(w[0],w[1],x,u,"ground")}catch(D){}null!=C&&p.offset(y,0,0,-this.alignedSampledElevation+C)}return y}addObjectState(r,n){r===c.Object3DState.Highlight&&(r=new e.Object3DStateID(r),this._addHighlightId(r),n.addExternal(u=>{this._removeHighlightId(u)},r))}removeObjectState(r){this._highlights.forEach(n=>
r.remove(n))}_addHighlightId(r){this._highlights.add(r);this._lodRenderer.instanceData.setHighlight(this.instanceIndex,!0)}_removeHighlightId(r){this._highlights.delete(r);this._lodRenderer.instanceData.setHighlight(this.instanceIndex,0<this._highlights.size)}get _lodRenderer(){return this.graphics3DSymbolLayer.lodRenderer}}const d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=l.create(),w=l.create(),v=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]],m=b.create();a.Graphics3DLodInstanceGraphicLayer=
g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/lodResourceUtils":function(){define(["exports","../../webgl-engine/lib/lodRendering/LodResources"],function(a,b){function q(p,k){const h=p.stageResources.geometries.map(f=>new b.LodComponentResources(f,p.stageResources.textures));k=null==p.lodThreshold||0===p.lodThreshold&&0<k?l(h):p.lodThreshold;return new b.LodLevelResources(h,k,p.pivotOffset)}function l(p){p=p.reduce((k,{geometry:h})=>k+h.indexCount/
3,0);return Math.sqrt(20*p/Math.PI)}a.makeLodResources=function(p){return new b.LodResources(p.map((k,h)=>q(k,h)))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/objectResourceUtils":function(){define("exports ../../../../core/devEnvironmentUtils ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/FloatArray ../../../../geometry/support/buffer/BufferView ../../../../chunks/vec3 ../../../../chunks/vec4 ../../../../chunks/vec2 ../../../../chunks/vec33 ../../../../chunks/vec43 ../../glTF/DefaultLoadingContext ../../glTF/loader ../../glTF/internal/indexUtils ../../glTF/internal/resourceUtils ../../glTF/internal/TextureTransformUtils ./ProcessedObjectResource ./wosrLoader ../../webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl ../../webgl-engine/lib/Attribute ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/Texture ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/DefaultMaterial ../../webgl-engine/materials/DefaultMaterial_COLOR_GAMMA ../../webgl-engine/materials/pbrUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L){function P(R){const Q=R.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return Q?{fileType:"gltf",url:Q[1],specifiedLodIndex:null!=Q[4]?Number(Q[4]):null}:R.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:R,specifiedLodIndex:null}:{fileType:"unknown",url:R,specifiedLodIndex:null}}function M(R,Q,W,S){const V=R.model,T=[],Y=new Map,ha=new Map,ba=V.lods.length,U=g.empty();V.lods.forEach((Z,ca)=>{const ea=!0===S.skipHighLods&&
(1<ba&&0===ca||3<ba&&1===ca)||!1===S.skipHighLods&&null!=S.singleLodIndex&&ca!==S.singleLodIndex;if(!ea||0===ca){var da=new B.ProcessedObjectResource(Z.name,Z.lodThreshold,[0,0,0]);Z.parts.forEach(ia=>{const ka=ea?new I.DefaultMaterial({}):K(V,ia,da,Q,W,Y,ha);var fa=null!=ka?ka:new I.DefaultMaterial({});const X=ia.attributes.position.count,ja=y.convertPrimitiveToTriangles(ia.indices||X,ia.primitiveType);var la=d.newFloatArray(3*X);const {typedBuffer:na,typedBufferStride:va}=ia.attributes.position;
w.transformMat4(la,na,ia.transform,3,va);la=[[G.VertexAttribute.POSITION,new F.Attribute(la,ja,3,!0)]];if(null!=ia.attributes.normal){var za=d.newFloatArray(3*X);const {typedBuffer:ra,typedBufferStride:xa}=ia.attributes.normal;l.normalFromMat4(J,ia.transform);w.transformMat3(za,ra,J,3,xa);q.hasScaling(J)&&w.normalize(za,za);la.push([G.VertexAttribute.NORMAL,new F.Attribute(za,ja,3,!0)])}if(null!=ia.attributes.tangent){za=d.newFloatArray(4*X);const {typedBuffer:ra,typedBufferStride:xa}=ia.attributes.tangent;
l.fromMat4(J,ia.transform);v.transformMat3(za,ra,J,4,xa);q.hasScaling(J)&&w.normalize(za,za,4);la.push([G.VertexAttribute.TANGENT,new F.Attribute(za,ja,4,!0)])}if(null!=ia.attributes.texCoord0){za=d.newFloatArray(2*X);const {typedBuffer:ra,typedBufferStride:xa}=ia.attributes.texCoord0;m.normalizeIntegerBuffer(za,ra,2,xa);la.push([G.VertexAttribute.UV0,new F.Attribute(za,ja,2,!0)])}za=ia.attributes.color;if(null!=za){const ra=new Uint8Array(4*X);4===za.elementCount?za instanceof t.BufferViewVec4f?
v.scale(ra,za,255):za instanceof t.BufferViewVec4u8?n.copy(ra,za):za instanceof t.BufferViewVec4u16&&v.scale(ra,za,1/256):(ra.fill(255),za instanceof t.BufferViewVec3f?w.scale(ra,za.typedBuffer,255,4,za.typedBufferStride):ia.attributes.color instanceof t.BufferViewVec3u8?r.copy(ra,za.typedBuffer,4,ia.attributes.color.typedBufferStride):ia.attributes.color instanceof t.BufferViewVec3u16&&w.scale(ra,za.typedBuffer,1/256,4,za.typedBufferStride));la.push([G.VertexAttribute.COLOR,new F.Attribute(ra,ja,
4,!0)])}ia={geometry:new N.Geometry(fa,la),vertexCount:X};const {geometry:ya,vertexCount:Da}=ia;ia=ya.boundingInfo;null!=ia&&0===ca&&(g.expandWithVec3(U,ia.bbMin),g.expandWithVec3(U,ia.bbMax));null!=ka&&(da.stageResources.geometries.push(ya),da.numberOfVertices+=Da)});ea||T.push(da)}});return{engineResources:T,referenceBoundingBox:U}}function K(R,Q,W,S,V,T,Y){const ha=Q.material+(Q.attributes.normal?"_normal":"")+(Q.attributes.color?"_color":"")+(Q.attributes.texCoord0?"_texCoord0":"")+(Q.attributes.tangent?
"_tangent":""),ba=R.materials.get(Q.material);var U=null!=Q.attributes.texCoord0;const Z=null!=Q.attributes.normal;if(null==ba)return null;a:{switch(ba.alphaMode){case "BLEND":var ca=H.AlphaDiscardMode.Blend;break a;case "MASK":ca=H.AlphaDiscardMode.Mask;break a;case "OPAQUE":case null:case void 0:ca=H.AlphaDiscardMode.Opaque;break a}ca=void 0}if(!T.has(ha)){if(U){var ea=(va,za=!1)=>{if(null!=va&&!Y.has(va)){const ya=R.textures.get(va);if(null!=ya){const Da=ya.data;Y.set(va,new E.Texture(z.isEncodedMeshTexture(Da)?
Da.data:Da,{...ya.parameters,preMultiplyAlpha:z.isEncodedMeshTexture(Da)?!1:za,encoding:z.isEncodedMeshTexture(Da)&&null!=Da.encoding?Da.encoding:void 0}))}}};ea(ba.textureColor,ca!==H.AlphaDiscardMode.Opaque);ea(ba.textureNormal);ea(ba.textureOcclusion);ea(ba.textureEmissive);ea(ba.textureMetallicRoughness)}ea=ba.color[0]**(1/O.colorGamma);const da=ba.color[1]**(1/O.colorGamma),ia=ba.color[2]**(1/O.colorGamma),ka=ba.emissiveFactor[0]**(1/O.colorGamma),fa=ba.emissiveFactor[1]**(1/O.colorGamma),X=
ba.emissiveFactor[2]**(1/O.colorGamma),ja=null!=ba.textureColor&&U?Y.get(ba.textureColor):null,la=L.useSchematicPBR({normalTexture:ba.textureNormal,metallicRoughnessTexture:ba.textureMetallicRoughness,metallicFactor:ba.metallicFactor,roughnessFactor:ba.roughnessFactor,emissiveTexture:ba.textureEmissive,emissiveFactor:ba.emissiveFactor,occlusionTexture:ba.textureOcclusion}),na=null!=ba.normalTextureTransform?.scale?ba.normalTextureTransform?.scale:f.ONES;T.set(ha,new I.DefaultMaterial({...S,transparent:ca===
H.AlphaDiscardMode.Blend,customDepthTest:H.DepthTestFunction.Lequal,textureAlphaMode:ca,textureAlphaCutoff:ba.alphaCutoff,diffuse:[ea,da,ia],ambient:[ea,da,ia],opacity:ba.opacity,doubleSided:ba.doubleSided,doubleSidedType:"winding-order",cullFace:ba.doubleSided?H.CullFaceOptions.None:H.CullFaceOptions.Back,hasVertexColors:!!Q.attributes.color,hasVertexTangents:!!Q.attributes.tangent,normalType:Z?D.NormalType.Attribute:D.NormalType.ScreenDerivative,castShadows:!0,receiveShadows:ba.receiveShadows,receiveAmbientOcclusion:ba.receiveAmbientOcclustion,
textureId:null!=ja?ja.id:void 0,colorMixMode:ba.colorMixMode,normalTextureId:null!=ba.textureNormal&&U?Y.get(ba.textureNormal).id:void 0,textureAlphaPremultiplied:null!=ja&&!!ja.parameters.preMultiplyAlpha,occlusionTextureId:null!=ba.textureOcclusion&&U?Y.get(ba.textureOcclusion).id:void 0,emissiveTextureId:null!=ba.textureEmissive&&U?Y.get(ba.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=ba.textureMetallicRoughness&&U?Y.get(ba.textureMetallicRoughness).id:void 0,emissiveFactor:[ka,
fa,X],mrrFactors:la?[...L.defaultSchematicMRRFactors]:[ba.metallicFactor,ba.roughnessFactor,S.mrrFactors[2]],isSchematic:la,colorTextureTransformMatrix:A.getTransformMatrix(ba.colorTextureTransform),normalTextureTransformMatrix:A.getTransformMatrix(ba.normalTextureTransform),scale:[na[0],na[1]],occlusionTextureTransformMatrix:A.getTransformMatrix(ba.occlusionTextureTransform),emissiveTextureTransformMatrix:A.getTransformMatrix(ba.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:A.getTransformMatrix(ba.metallicRoughnessTextureTransform),
...V}))}Q=T.get(ha);W.stageResources.materials.push(Q);U&&(U=da=>{null!=da&&W.stageResources.textures.push(Y.get(da))},U(ba.textureColor),U(ba.textureNormal),U(ba.textureOcclusion),U(ba.textureEmissive),U(ba.textureMetallicRoughness));return Q}const J=p.create();a.fetch=async function(R,Q){R=P(b.adjustStaticAGOUrl(R));if("wosr"===R.fileType){R=await (Q.cache?Q.cache.loadWOSR(R.url,Q):C.load(R.url,Q));const {engineResources:Z,referenceBoundingBox:ca}=C.processLoadResult(R,Q);return{lods:Z,referenceBoundingBox:ca,
isEsriSymbolResource:!1,isWosr:!0}}const W=await (Q.cache?Q.cache.loadGLTF(R.url,Q,!!Q.usePBR):x.loadGLTF(new u.DefaultLoadingContext(Q.streamDataRequester),R.url,Q,Q.usePBR)),S=W.model.meta?.ESRI_proxyEllipsoid,V=W.meta.isEsriSymbolResource&&null!=S&&"EsriRealisticTreesStyle"===W.meta.ESRI_webstyle;if(V&&!W.customMeta.esriTreeRendering){W.customMeta.esriTreeRendering=!0;a:for(let Z=0;Z<W.model.lods.length;++Z){var T=W.model.lods[Z];for(var Y of T.parts){T=Y.attributes.normal;if(null==T)break a;const ca=
Y.attributes.position,ea=ca.count,da=e.create(),ia=e.create(),ka=e.create(),fa=new Uint8Array(4*ea),X=new Float64Array(3*ea),ja=k.invert(h.create(),Y.transform);let la=0,na=0;for(let va=0;va<ea;va++){ca.getVec(va,ia);T.getVec(va,da);c.transformMat4(ia,ia,Y.transform);c.subtract(ka,ia,S.center);c.divide(ka,ka,S.radius);const za=ka[2];var ha=c.length(ka);ha=Math.min(.45+.55*ha*ha,1);c.divide(ka,ka,S.radius);null!==ja&&c.transformMat4(ka,ka,ja);c.normalize(ka,ka);Z+1!==W.model.lods.length&&1<W.model.lods.length&&
(-1<za?c.lerp(ka,ka,da,.2):c.lerp(ka,ka,da,Math.min(-4*za-3.8,1)));X[la]=ka[0];X[la+1]=ka[1];X[la+2]=ka[2];la+=3;fa[na]=255*ha;fa[na+1]=255*ha;fa[na+2]=255*ha;fa[na+3]=255;na+=4}Y.attributes.normal=new t.BufferViewVec3f(X);Y.attributes.color=new t.BufferViewVec4u8(fa)}}}Y=!!Q.usePBR;Y=W.meta.isEsriSymbolResource?{usePBR:Y,isSchematic:!1,treeRendering:V,mrrFactors:[...L.defaultEsriSymbologyMRRFactors]}:{usePBR:Y,isSchematic:!1,treeRendering:!1,mrrFactors:[...L.defaultAdvancedMRRFactors]};const {engineResources:ba,
referenceBoundingBox:U}=M(W,Y,{...Q.materialParameters,treeRendering:V},Q.skipHighLods&&null==R.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:R.specifiedLodIndex});return{lods:ba,referenceBoundingBox:U,isEsriSymbolResource:W.meta.isEsriSymbolResource,isWosr:!1}};a.gltfToEngineResources=M;a.parseUrl=P;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/devEnvironmentUtils":function(){define(["exports"],function(a){const b=/^devext\.arcgis\.com$/,q=/^qaext\.arcgis\.com$/,
l=/^[\w-]*\.mapsdevext\.arcgis\.com$/,p=/^[\w-]*\.mapsqa\.arcgis\.com$/,k=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,b,q,/^jsapps\.esri\.com$/,l,p];a.adjustStaticAGOUrl=function(h,f){return h?(f=f||globalThis.location.hostname)?null!=f.match(b)||null!=f.match(l)?h.replace("static.arcgis.com","staticdev.arcgis.com"):null!=f.match(q)||null!=f.match(p)?h.replace("static.arcgis.com","staticqa.arcgis.com"):h:h:h};a.devHostnames=k;a.isDevEnvironment=function(h){h=h||globalThis.location.hostname;return k.some(f=>
null!=h?.match(f))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/vec2":function(){define(["exports","../core/typedArrayUtil"],function(a,b){function q(h,f){l(h.typedBuffer,f.typedBuffer,h.typedBufferStride,f.typedBufferStride)}function l(h,f,c=2,e=c){const g=f.length/2;let d=0,t=0;if(b.isArray(f)||b.isFloat(f))for(var w=0;w<g;++w)h[d]=f[t],h[d+1]=f[t+1],d+=c,t+=e;else if(w=b.maximumValue(f),b.isSigned(f))for(var v=0;v<g;++v)h[d]=Math.max(f[t]/w,-1),h[d+1]=Math.max(f[t+
1]/w,-1),d+=c,t+=e;else for(v=0;v<g;++v)h[d]=f[t]/w,h[d+1]=f[t+1]/w,d+=c,t+=e}function p(h,f,c,e){const g=h.typedBuffer,d=h.typedBufferStride;h=e?.count??h.count;e=(e?.dstIndex??0)*d;for(let t=0;t<h;++t)g[e]=f,g[e+1]=c,e+=d}const k=Object.freeze(Object.defineProperty({__proto__:null,fill:p,normalizeIntegerBuffer:l,normalizeIntegerBufferView:q},Symbol.toStringTag,{value:"Module"}));a.fill=p;a.normalizeIntegerBuffer=l;a.normalizeIntegerBufferView=q;a.vec2=k})},"esri/chunks/vec33":function(){define(["exports"],
function(a){function b(k,h){q(k.typedBuffer,h.typedBuffer,k.typedBufferStride,h.typedBufferStride)}function q(k,h,f=3,c=f){const e=h.length/c;let g=0,d=0;for(let t=0;t<e;++t)k[g]=h[d],k[g+1]=h[d+1],k[g+2]=h[d+2],g+=f,d+=c}function l(k,h,f,c,e){const g=k.typedBuffer,d=k.typedBufferStride;k=e?.count??k.count;e=(e?.dstIndex??0)*d;for(let t=0;t<k;++t)g[e]=h,g[e+1]=f,g[e+2]=c,e+=d}const p=Object.freeze(Object.defineProperty({__proto__:null,copy:q,copyView:b,fill:l},Symbol.toStringTag,{value:"Module"}));
a.copy=q;a.copyView=b;a.fill=l;a.vec3=p})},"esri/chunks/vec43":function(){define(["exports"],function(a){function b(k,h){q(k.typedBuffer,h,k.typedBufferStride)}function q(k,h,f=4){const c=h.typedBuffer,e=h.typedBufferStride;h=h.count;let g=0,d=0;for(let t=0;t<h;++t)k[g]=c[d],k[g+1]=c[d+1],k[g+2]=c[d+2],k[g+3]=c[d+3],g+=f,d+=e}function l(k,h,f,c,e,g){const d=k.typedBuffer,t=k.typedBufferStride;k=g?.count??k.count;g=(g?.dstIndex??0)*t;for(let w=0;w<k;++w)d[g]=h,d[g+1]=f,d[g+2]=c,d[g+3]=e,g+=t}const p=
Object.freeze(Object.defineProperty({__proto__:null,copy:q,copyView:b,fill:l},Symbol.toStringTag,{value:"Module"}));a.copy=q;a.copyView=b;a.fill=l;a.vec4=p})},"esri/views/3d/glTF/DefaultLoadingContext":function(){define("exports ../../../request ../../../core/asyncUtils ../../../core/Error ../../../core/promiseUtils ../../../core/urlUtils".split(" "),function(a,b,q,l,p,k){class h{constructor(c){this._streamDataRequester=c}async loadJSON(c,e){return this._load("json",c,e)}async loadBinary(c,e){return k.isDataProtocol(c)?
(p.throwIfAborted(e),k.dataToArrayBuffer(c)):this._load("binary",c,e)}async loadImage(c,e){return this._load("image",c,e)}async _load(c,e,g){if(null==this._streamDataRequester)return(await b(e,{responseType:f[c]})).data;c=await q.result(this._streamDataRequester.request(e,c,g));if(!0===c.ok)return c.value;p.throwIfAbortError(c.error);throw new l("",`Request for resource failed: ${c.error}`);}}const f={image:"image",binary:"array-buffer",json:"json","image+type":void 0};a.DefaultLoadingContext=h;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/loader":function(){define("exports ../../../core/Logger ../../../core/libs/gl-matrix-2/factories/mat4f64 ./LoaderResult ./internal/Resource ../../webgl/enums".split(" "),function(a,b,q,l,p,k){function h(d){let t=null;d.json.nodes.forEach(w=>{w=w.extras;null!=w&&(w.ESRI_proxyEllipsoid||w.ESRI_lod)&&(t=w)});return t}async function f(d,t){async function w(u,x){const y=v.nodes[u];u=d.getNodeTransform(u);null!=y.weights&&b.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported.");
if(null!=y.mesh){const z=v.meshes[y.mesh];for(const A of z.primitives)n.push(t(A,u,x,z.name))}for(const z of y.children||[])n.push(w(z,x))}const v=d.json;var m=v.scenes[v.scene||0].nodes;const r=1<m.length,n=[];for(const u of m)m=v.nodes[u],n.push(w(u,0)),m.extensions?.MSFT_lod&&Array.isArray(m.extensions.MSFT_lod.ids)&&!r&&m.extensions.MSFT_lod.ids.forEach((x,y)=>w(x,y+1));await Promise.all(n)}function c(d,t,w){const v=r=>{const n=`${w}_tex_${r&&r.id}${r?.name?"_"+r.name:""}`;r&&!d.textures.has(n)&&
(r=l.makeTextureSource(r.data,{wrap:{s:r.wrapS,t:r.wrapT},mipmap:g.has(r.minFilter),noUnpackFlip:!0}),d.textures.set(n,r));return n},m=`${w}_mat_${t.id}_${t.name}`;d.materials.has(m)||(t=l.makeMaterialParameters({color:[t.color[0],t.color[1],t.color[2]],opacity:t.color[3],alphaMode:t.alphaMode,alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,colorMixMode:t.ESRI_externalColorMixMode,textureColor:t.colorTexture?v(t.colorTexture):void 0,textureNormal:t.normalTexture?v(t.normalTexture):void 0,textureOcclusion:t.occlusionTexture?
v(t.occlusionTexture):void 0,textureEmissive:t.emissiveTexture?v(t.emissiveTexture):void 0,textureMetallicRoughness:t.metallicRoughnessTexture?v(t.metallicRoughnessTexture):void 0,emissiveFactor:[t.emissiveFactor[0],t.emissiveFactor[1],t.emissiveFactor[2]],colorTextureTransform:t.colorTextureTransform,normalTextureTransform:t.normalTextureTransform,occlusionTextureTransform:t.occlusionTextureTransform,emissiveTextureTransform:t.emissiveTextureTransform,metallicRoughnessTextureTransform:t.metallicRoughnessTextureTransform,
metallicFactor:t.metallicFactor,roughnessFactor:t.roughnessFactor,receiveShadows:t.receiveShadows,receiveAmbientOcclustion:t.receiveAmbientOcclusion}),d.materials.set(m,t));return m}let e=0;const g=new Set([k.TextureSamplingMode.LINEAR_MIPMAP_LINEAR,k.TextureSamplingMode.LINEAR_MIPMAP_NEAREST]);a.loadGLTF=async function(d,t,w={},v=!0){const m=await p.GLTFResource.load(d,t,w),r=`gltf_${e++}`,n={lods:[],materials:new Map,textures:new Map,meta:h(m)};d=!(!m.json.asset.extras||"symbolResource"!==m.json.asset.extras.ESRI_type);
t=m.json.asset.extras?.ESRI_webstyleSymbol?.webstyle;const u=new Map;await f(m,async(y,z,A,B)=>{const C=u.get(A)??0;u.set(A,C+1);var D=void 0!==y.mode?y.mode:k.PrimitiveType.TRIANGLES,F=D===k.PrimitiveType.TRIANGLES||D===k.PrimitiveType.TRIANGLE_STRIP||D===k.PrimitiveType.TRIANGLE_FAN?D:null;if(null==F)b.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+k.PrimitiveType[D]+"). Skipping primitive.");else if(m.hasPositions(y)){D=m.getPositionData(y,w);var H=m.getMaterial(y,
w,v),N=m.hasNormals(y)?m.getNormalData(y,w):null,E=m.hasTangents(y)?m.getTangentData(y,w):null,G=m.hasTextureCoordinates(y)?m.getTextureCoordinates(y,w):null,I=m.hasVertexColors(y)?m.getVertexColors(y,w):null;y=m.getIndexData(y,w);z={name:B,transform:q.clone(z),attributes:{position:await D,normal:N?await N:null,texCoord0:G?await G:null,color:I?await I:null,tangent:E?await E:null},indices:await y,primitiveType:F,material:c(n,await H,r)};F=null;null!=n.meta?.ESRI_lod&&"screenSpaceRadius"===n.meta.ESRI_lod.metric&&
(F=n.meta.ESRI_lod.thresholds[A]);n.lods[A]=n.lods[A]||{parts:[],name:B,lodThreshold:F};n.lods[A].parts[C]=z}else b.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.")});for(var x of n.lods)x.parts=x.parts.filter(y=>!!y);x=await m.getLoadedBuffersSize();return{model:n,meta:{isEsriSymbolResource:d,uri:m.uri,ESRI_webstyle:t},customMeta:{},size:x}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/LoaderResult":function(){define(["exports",
"../../webgl/enums"],function(a,b){a.makeMaterialParameters=function(q={}){return{color:[1,1,1],opacity:1,alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1,castShadows:!0,receiveShadows:!0,receiveAmbientOcclustion:!0,textureColor:null,textureNormal:null,textureOcclusion:null,textureEmissive:null,textureMetallicRoughness:null,colorTextureTransform:null,normalTextureTransform:null,occlusionTextureTransform:null,emissiveTextureTransform:null,metallicRoughnessTextureTransform:null,emissiveFactor:[0,0,
0],metallicFactor:1,roughnessFactor:1,colorMixMode:"multiply",...q}};a.makeTextureSource=function(q,l={}){return{data:q,parameters:{wrap:{s:b.TextureWrapMode.REPEAT,t:b.TextureWrapMode.REPEAT,...l.wrap},noUnpackFlip:!0,mipmap:!1,...l}}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/internal/Resource":function(){define("exports ../../../../core/Error ../../../../core/Logger ../../../../core/MapUtils ../../../../core/promiseUtils ../../../../core/urlUtils ../../../../core/Version ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/math/quat ../../../../core/libs/gl-matrix-2/factories/quatf64 ../../../../geometry/support/buffer/BufferView ../../../../chunks/scalar ../../../../core/has ./BinaryStreamReader ./enums ./fillDefaults ./pathUtils ./resourceUtils ../../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){function y(I){switch(I.componentType){case x.DataType.BYTE:return new d.BufferViewVec2i8(I.raw,I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount);case x.DataType.UNSIGNED_BYTE:return new d.BufferViewVec2u8(I.raw,I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount);case x.DataType.SHORT:return new d.BufferViewVec2i16(I.raw,I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount);case x.DataType.UNSIGNED_SHORT:return new d.BufferViewVec2u16(I.raw,
I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount);case x.DataType.UNSIGNED_INT:return new d.BufferViewVec2u32(I.raw,I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount);case x.DataType.FLOAT:return new d.BufferViewVec2f(I.raw,I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount)}}function z(I,O){return new I(O.raw,O.byteOffset,O.byteStride,O.byteOffset+O.byteStride*(O.entryCount-1)+O.componentByteSize*O.componentCount)}function A(I){if(null!=I.extensions?.KHR_texture_basisu)return I.extensions.KHR_texture_basisu.source;
if(null!==I.source)return I.source;throw new b("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.");}class B{constructor(I,O,L,P){this._context=I;this.uri=O;this.json=L;this._glbBuffer=P;this._bufferLoaders=new Map;this._textureLoaders=new Map;this._textureCache=new Map;this._materialCache=new Map;this._nodeParentMap=new Map;this._nodeTransformCache=new Map;this._supportedExtensions=["KHR_texture_basisu",
"KHR_texture_transform"];this._baseUri=n.splitURI(this.uri).dirPart;this._checkVersionSupported();this._checkRequiredExtensionsSupported();if(null==L.scenes)throw new b("gltf-loader-unsupported-feature","Scenes must be defined.");if(null==L.meshes)throw new b("gltf-loader-unsupported-feature","Meshes must be defined");if(null==L.nodes)throw new b("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(I,O,L){if(k.isDataProtocol(O)){var P=k.dataComponents(O);
if(P&&"model/gltf-binary"!==P.mediaType)try{const M=JSON.parse(P.isBase64?atob(P.data):P.data);return new B(I,O,M)}catch{}P=k.dataToArrayBuffer(O);if(B._isGLBData(P))return this._fromGLBData(I,O,P)}if(E.test(O)||"gltf"===L?.expectedType)return L=await I.loadJSON(O,L),new B(I,O,L);P=await I.loadBinary(O,L);if(B._isGLBData(P))return this._fromGLBData(I,O,P);if(G.test(O)||"glb"===L?.expectedType)throw new b("gltf-loader-invalid-glb","This is not a valid glb file.");L=await I.loadJSON(O,L);return new B(I,
O,L)}static _isGLBData(I){if(null==I)return!1;I=new v.BinaryStreamReader(I);return 4<=I.remainingBytes()&&1179937895===I.readUint32()}static async _fromGLBData(I,O,L){L=await B._parseGLBData(L);return new B(I,O,L.json,L.binaryData)}static async _parseGLBData(I){const O=new v.BinaryStreamReader(I);if(12>O.remainingBytes())throw new b("gltf-loader-error","glb binary data is insufficiently large.");var L=O.readUint32(),P=O.readUint32();const M=O.readUint32();if(1179937895!==L)throw new b("gltf-loader-error",
"Magic first 4 bytes do not fit to expected glb value.");if(I.byteLength<M)throw new b("gltf-loader-error","glb binary data is smaller than header specifies.");if(2!==P)throw new b("gltf-loader-unsupported-feature","An unsupported glb container version was detected. Only version 2 is supported.");I=0;let K,J;for(;8<=O.remainingBytes();){L=O.readUint32();P=O.readUint32();if(0===I){if(1313821514!==P)throw new b("gltf-loader-error","First glb chunk must be JSON.");if(0>L)throw new b("gltf-loader-error",
"No JSON data found.");K=await u.jsonFromBinaryData(O.readUint8Array(L))}else if(1===I){if(5130562!==P)throw new b("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");J=O.readUint8Array(L)}else q.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");I+=1}if(!K)throw new b("gltf-loader-error","No glb JSON chunk detected.");return{json:K,binaryData:J}}async getBuffer(I,O){const L=this.json.buffers[I];if(null==L.uri){if(null==this._glbBuffer)throw new b("gltf-loader-error",
"glb buffer not present");return this._glbBuffer}I=await this._getBufferLoader(I,O);if(I.byteLength!==L.byteLength)throw new b("gltf-loader-error","Buffer byte lengths should match.");return I}async _getBufferLoader(I,O){const L=this._bufferLoaders.get(I);if(L)return L;O=this._context.loadBinary(this._resolveUri(this.json.buffers[I].uri),O).then(P=>new Uint8Array(P));this._bufferLoaders.set(I,O);return O}async getAccessor(I,O){if(!this.json.accessors)throw new b("gltf-loader-unsupported-feature",
"Accessors missing.");I=this.json.accessors[I];if(null==I?.bufferView)throw new b("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(I.type in[m.AttributeType.MAT2,m.AttributeType.MAT3,m.AttributeType.MAT4])throw new b("gltf-loader-unsupported-feature",`AttributeType ${I.type} is not supported`);const L=this.json.bufferViews[I.bufferView];O=await this.getBuffer(L.buffer,O);const P=H[I.type],M=N[I.componentType],K=P*M,J=L.byteStride||K;return{raw:O.buffer,byteStride:J,
byteOffset:O.byteOffset+(L.byteOffset||0)+(I.byteOffset||0),entryCount:I.count,isDenselyPacked:J===K,componentCount:P,componentByteSize:M,componentType:I.componentType,min:I.min,max:I.max,normalized:!!I.normalized}}async getIndexData(I,O){if(null!=I.indices)if(I=await this.getAccessor(I.indices,O),I.isDenselyPacked)switch(I.componentType){case x.DataType.UNSIGNED_BYTE:return new Uint8Array(I.raw,I.byteOffset,I.entryCount);case x.DataType.UNSIGNED_SHORT:return new Uint16Array(I.raw,I.byteOffset,I.entryCount);
case x.DataType.UNSIGNED_INT:return new Uint32Array(I.raw,I.byteOffset,I.entryCount)}else switch(I.componentType){case x.DataType.UNSIGNED_BYTE:return t.makeDense(z(d.BufferViewUint8,I));case x.DataType.UNSIGNED_SHORT:return t.makeDense(z(d.BufferViewUint16,I));case x.DataType.UNSIGNED_INT:return t.makeDense(z(d.BufferViewUint32,I))}}async getPositionData(I,O){if(null==I.attributes.POSITION)throw new b("gltf-loader-unsupported-feature","No POSITION vertex data found.");I=await this.getAccessor(I.attributes.POSITION,
O);if(I.componentType!==x.DataType.FLOAT)throw new b("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+x.DataType[I.componentType]);if(3!==I.componentCount)throw new b("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+I.componentCount.toFixed());return z(d.BufferViewVec3f,I)}async getNormalData(I,O){if(null==I.attributes.NORMAL)throw new b("gltf-loader-error","No NORMAL vertex data found.");I=await this.getAccessor(I.attributes.NORMAL,
O);if(I.componentType!==x.DataType.FLOAT)throw new b("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+x.DataType[I.componentType]);if(3!==I.componentCount)throw new b("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+I.componentCount.toFixed());return z(d.BufferViewVec3f,I)}async getTangentData(I,O){if(null==I.attributes.TANGENT)throw new b("gltf-loader-error","No TANGENT vertex data found.");I=await this.getAccessor(I.attributes.TANGENT,
O);if(I.componentType!==x.DataType.FLOAT)throw new b("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+x.DataType[I.componentType]);if(4!==I.componentCount)throw new b("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+I.componentCount.toFixed());return new d.BufferViewVec4f(I.raw,I.byteOffset,I.byteStride,I.byteOffset+I.byteStride*I.entryCount)}async getTextureCoordinates(I,O){if(null==I.attributes.TEXCOORD_0)throw new b("gltf-loader-error",
"No TEXCOORD_0 vertex data found.");I=await this.getAccessor(I.attributes.TEXCOORD_0,O);if(2!==I.componentCount)throw new b("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+I.componentCount.toFixed());if(I.componentType===x.DataType.FLOAT)return z(d.BufferViewVec2f,I);if(!I.normalized)throw new b("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return y(I)}async getVertexColors(I,
O){if(null==I.attributes.COLOR_0)throw new b("gltf-loader-error","No COLOR_0 vertex data found.");I=await this.getAccessor(I.attributes.COLOR_0,O);if(4!==I.componentCount&&3!==I.componentCount)throw new b("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+I.componentCount.toFixed());if(4===I.componentCount){if(I.componentType===x.DataType.FLOAT)return z(d.BufferViewVec4f,I);if(I.componentType===x.DataType.UNSIGNED_BYTE)return z(d.BufferViewVec4u8,I);if(I.componentType===
x.DataType.UNSIGNED_SHORT)return z(d.BufferViewVec4u16,I)}else if(3===I.componentCount){if(I.componentType===x.DataType.FLOAT)return z(d.BufferViewVec3f,I);if(I.componentType===x.DataType.UNSIGNED_BYTE)return z(d.BufferViewVec3u8,I);if(I.componentType===x.DataType.UNSIGNED_SHORT)return z(d.BufferViewVec3u16,I)}throw new b("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+x.DataType[I.componentType]);}hasPositions(I){return void 0!==I.attributes.POSITION}hasNormals(I){return void 0!==
I.attributes.NORMAL}hasVertexColors(I){return void 0!==I.attributes.COLOR_0}hasTextureCoordinates(I){return void 0!==I.attributes.TEXCOORD_0}hasTangents(I){return void 0!==I.attributes.TANGENT}async getMaterial(I,O,L){var P=I.material?this._materialCache.get(I.material):void 0;if(!P){P=null!=I.material?r.material(this.json.materials[I.material]):r.material();const M=P.pbrMetallicRoughness,K=this.hasVertexColors(I),J=this.getTexture(M.baseColorTexture,O),R=this.getTexture(P.normalTexture,O),Q=L?this.getTexture(P.occlusionTexture,
O):void 0,W=L?this.getTexture(P.emissiveTexture,O):void 0;O=L?this.getTexture(M.metallicRoughnessTexture,O):void 0;I=null!=I.material?I.material:-1;P={alphaMode:P.alphaMode,alphaCutoff:P.alphaCutoff,color:M.baseColorFactor,doubleSided:!!P.doubleSided,colorTexture:await J,normalTexture:await R,name:P.name,id:I,occlusionTexture:await Q,emissiveTexture:await W,emissiveFactor:P.emissiveFactor,metallicFactor:M.metallicFactor,roughnessFactor:M.roughnessFactor,metallicRoughnessTexture:await O,hasVertexColors:K,
ESRI_externalColorMixMode:P.extras.ESRI_externalColorMixMode,colorTextureTransform:M?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:P.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:P.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:P.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:M?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:P.extras.ESRI_receiveAmbientOcclusion,
receiveShadows:P.extras.ESRI_receiveShadows}}return P}async getTexture(I,O){if(I){if(0!==(I.texCoord||0))throw new b("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");var L=I.index;I=this.json.textures[L];var P=r.textureSampler(null!=I.sampler?this.json.samplers[I.sampler]:{}),M=A(I),K=this.json.images[M],J=await this._loadTextureImageData(L,I,O);return l.getOrCreateMapValue(this._textureCache,L,()=>{const R=W=>33071===W||33648===W||10497===W,Q=W=>{throw new b("gltf-loader-error",
`Unexpected TextureSampler WrapMode: ${W}`);};return{data:J,wrapS:R(P.wrapS)?P.wrapS:Q(P.wrapS),wrapT:R(P.wrapT)?P.wrapT:Q(P.wrapT),minFilter:P.minFilter,name:K.name,id:L}})}}getNodeTransform(I){if(void 0===I)return C;var O=this._nodeTransformCache.get(I);if(!O){O=this.getNodeTransform(this._getNodeParent(I));const L=this.json.nodes[I];L.matrix?O=f.multiply(c.create(),O,L.matrix):L.translation||L.rotation||L.scale?(O=c.clone(O),L.translation&&f.translate(O,O,L.translation),L.rotation&&(F[3]=e.getAxisAngle(F,
L.rotation),f.rotate(O,O,F[3],F)),L.scale&&f.scale(O,O,L.scale)):O=c.clone(O);this._nodeTransformCache.set(I,O)}return O}_resolveUri(I){return k.makeAbsolute(I,this._baseUri)}_getNodeParent(I){return this._nodeParentMap.get(I)}_checkVersionSupported(){const I=h.Version.parse(this.json.asset.version,"glTF");D.validate(I)}_checkRequiredExtensionsSupported(){const I=this.json;if(I.extensionsRequired&&!I.extensionsRequired.every(O=>this._supportedExtensions.includes(O)))throw new b("gltf-loader-unsupported-feature",
"gltf loader was not able to load unsupported feature. Required extensions: "+I.extensionsRequired.join(", "));}_computeNodeParents(){this.json.nodes.forEach((I,O)=>{I.children&&I.children.forEach(L=>{this._nodeParentMap.set(L,O)})})}async _loadTextureImageData(I,O,L){const P=this._textureLoaders.get(I);if(P)return P;O=this._createTextureLoader(O,L);this._textureLoaders.set(I,O);return O}async _createTextureLoader(I,O){I=A(I);I=this.json.images[I];if(I.uri)return I.uri.endsWith(".ktx2")?(O=await this._context.loadBinary(this._resolveUri(I.uri),
O),new u.EncodedMeshTexture(new Uint8Array(O))):this._context.loadImage(this._resolveUri(I.uri),O);if(null==I.bufferView)throw new b("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(null==I.mimeType)throw new b("gltf-loader-unsupported-feature","Image mimeType must be defined.");const L=this.json.bufferViews[I.bufferView];O=await this.getBuffer(L.buffer,O);if(null!=L.byteStride)throw new b("gltf-loader-unsupported-feature","byteStride not supported for image buffer");return u.imageFromBinaryData(new Uint8Array(O.buffer,
O.byteOffset+(L.byteOffset||0),L.byteLength),I.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const I=await p.allSettledValues(Array.from(this._bufferLoaders.values())),O=await p.allSettledValues(Array.from(this._textureLoaders.values()));return I.reduce((L,P)=>L+(P?.byteLength??0),0)+O.reduce((L,P)=>L+(P?u.isEncodedMeshTexture(P)?P.data.byteLength:P.width*P.height*4:0),0)}}const C=f.fromXRotation(c.create(),Math.PI/2),D=new h.Version(2,0,"glTF"),F=g.create(),
H={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},N={[x.DataType.BYTE]:1,[x.DataType.UNSIGNED_BYTE]:1,[x.DataType.SHORT]:2,[x.DataType.UNSIGNED_SHORT]:2,[x.DataType.HALF_FLOAT]:2,[x.DataType.FLOAT]:4,[x.DataType.INT]:4,[x.DataType.UNSIGNED_INT]:4},E=/\.gltf$/i,G=/\.glb$/i;a.GLTFResource=B;a.transformGltfToEngine=C;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/scalar":function(){define(["exports"],function(a){function b(l,p){const k=l.count;p||=new l.TypedArrayConstructor(k);
for(let h=0;h<k;h++)p[h]=l.get(h);return p}const q=Object.freeze(Object.defineProperty({__proto__:null,makeDense:b},Symbol.toStringTag,{value:"Module"}));a.makeDense=b;a.scalar=q})},"esri/views/3d/glTF/internal/BinaryStreamReader":function(){define(["exports"],function(a){class b{constructor(q){this._data=q;this._offset4=0;this._dataUint32=new Uint32Array(this._data,0,Math.floor(this._data.byteLength/4))}readUint32(){const q=this._offset4;this._offset4+=1;return this._dataUint32[q]}readUint8Array(q){const l=
4*this._offset4;this._offset4+=q/4;return new Uint8Array(this._data,l,q)}remainingBytes(){return this._data.byteLength-4*this._offset4}}a.BinaryStreamReader=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/internal/enums":function(){define(["exports"],function(a){a.AttributeType=void 0;(function(b){b.SCALAR="SCALAR";b.VEC2="VEC2";b.VEC3="VEC3";b.VEC4="VEC4";b.MAT2="MAT2";b.MAT3="MAT3";b.MAT4="MAT4"})(a.AttributeType||(a.AttributeType={}));a.BufferViewTarget=void 0;
(function(b){b[b.ARRAY_BUFFER=34962]="ARRAY_BUFFER";b[b.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"})(a.BufferViewTarget||(a.BufferViewTarget={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/internal/fillDefaults":function(){define(["exports","../../../../core/compilerUtils","../../../webgl/enums"],function(a,b,q){const l={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1},p={pbrMetallicRoughness:l,emissiveFactor:[0,0,0],alphaMode:"OPAQUE",
alphaCutoff:.5,doubleSided:!1},k={ESRI_externalColorMixMode:"tint",ESRI_receiveShadows:!0,ESRI_receiveAmbientOcclusion:!0},h={magFilter:q.TextureSamplingMode.LINEAR,minFilter:q.TextureSamplingMode.LINEAR_MIPMAP_LINEAR,wrapS:q.TextureWrapMode.REPEAT,wrapT:q.TextureWrapMode.REPEAT};a.material=(f={})=>{const c={...l,...f.pbrMetallicRoughness};var e={...k,...f.extras};switch(e.ESRI_externalColorMixMode){case "multiply":case "tint":case "ignore":case "replace":break;default:b.neverReached(e.ESRI_externalColorMixMode),
e.ESRI_externalColorMixMode="tint"}return{...p,...f,pbrMetallicRoughness:c,extras:e}};a.textureSampler=f=>({...h,...f});Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/internal/pathUtils":function(){define(["exports"],function(a){a.splitURI=function(b){let q,l;b.replace(/^(.*\/)?([^/]*)$/,(p,k,h)=>{q=k||"";l=h||"";return""});return{dirPart:q,filePart:l}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/glTF/internal/indexUtils":function(){define(["exports",
"../../../../core/typedArrayUtil","../../../../geometry/support/Indices","../../../webgl/enums"],function(a,b,q,l){a.convertPrimitiveToTriangles=function(p,k){switch(k){case l.PrimitiveType.TRIANGLES:return p="number"===typeof p?q.getContinuousIndexArray(p):b.isUint8Array(p)?new Uint16Array(p):p,p;case l.PrimitiveType.TRIANGLE_STRIP:k="number"===typeof p?p:p.length;if(3>k)p=[];else{k-=2;var h=q.newIndexArray(3*k);if("number"===typeof p){p=0;for(var f=0;f<k;f+=1)0===f%2?(h[p++]=f,h[p++]=f+1):(h[p++]=
f+1,h[p++]=f),h[p++]=f+2}else{f=0;for(var c=0;c<k;c+=1)0===c%2?(h[f++]=p[c],h[f++]=p[c+1]):(h[f++]=p[c+1],h[f++]=p[c]),h[f++]=p[c+2]}p=h}return p;case l.PrimitiveType.TRIANGLE_FAN:k="number"===typeof p?p:p.length;if(3>k)p=new Uint16Array(0);else{k-=2;h=65536>=k?new Uint16Array(3*k):new Uint32Array(3*k);if("number"===typeof p)for(p=0,f=0;f<k;++f)h[p++]=0,h[p++]=f+1,h[p++]=f+2;else{f=p[0];c=p[1];var e=0;for(let g=0;g<k;++g){const d=p[g+2];h[e++]=f;h[e++]=c;c=h[e++]=d}}p=h}return p}};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/ProcessedObjectResource":function(){define(["exports"],function(a){class b{constructor(){this.geometries=[];this.materials=[];this.textures=[]}}class q{constructor(l,p,k){this.name=l;this.lodThreshold=p;this.pivotOffset=k;this.stageResources=new b;this.numberOfVertices=0}}a.ProcessedObjectResource=q;a.ProcessedObjectStageResources=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/wosrLoader":function(){define("exports ../../../../request ../../../../core/asyncUtils ../../../../core/byteSizeEstimations ../../../../core/Error ../../../../core/Logger ../../../../core/NestedMap ../../../../core/promiseUtils ../../../../core/Version ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/Indices ../../../../support/requestImageUtils ../../webgl-engine/lib/Attribute ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/Texture ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/DefaultMaterial ../../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){async function y(G,I){const O=I?.streamDataRequester;if(O)return z(G,O,I);G=await q.result(b(G,I));if(!0===G.ok)return G.value.data;f.throwIfAbortError(G.error);A(G.error)}async function z(G,I,O){G=await q.result(I.request(G,"json",O));if(!0===G.ok)return G.value;f.throwIfAbortError(G.error);A(G.error.details.url)}function A(G){throw new p("",`Request for object resource failed: ${G}`);}function B(G){var I=G.params,O=I.topology;let L=!0;I.vertexAttributes||
(N().warn("Geometry must specify vertex attributes"),L=!1);switch(I.topology){case "PerAttributeArray":break;case "Indexed":case null:case void 0:O=I.faces;if(!O)N().warn("Indexed geometries must specify faces"),L=!1;else if(I.vertexAttributes)for(const P in I.vertexAttributes)I=O[P],I?.values?(null!=I.valueType&&"UInt32"!==I.valueType&&(N().warn(`Unsupported indexed geometry indices type '${I.valueType}', only UInt32 is currently supported`),L=!1),null!=I.valuesPerElement&&1!==I.valuesPerElement&&
(N().warn(`Unsupported indexed geometry values per element '${I.valuesPerElement}', only 1 is currently supported`),L=!1)):(N().warn(`Indexed geometry does not specify face indices for '${P}' attribute`),L=!1);break;default:N().warn(`Unsupported topology '${O}'`),L=!1}G.params.material||(N().warn("Geometry requires material"),L=!1);G=G.params.vertexAttributes;for(const P in G)G[P].values||(N().warn("Geometries with externally defined attributes are not yet supported"),L=!1);return L}function C(G){const I=
g.empty();G.forEach(O=>{O=O.boundingInfo;null!=O&&(g.expandWithVec3(I,O.bbMin),g.expandWithVec3(I,O.bbMax))});return I}async function D(G,I){const O=[];for(const M in G){var L=G[M],P=L.images[0].data;if(!P){N().warn("Externally referenced texture data is not yet supported");continue}P=L.encoding+";base64,"+P;const K="/textureDefinitions/"+M,J="rgba"===L.channels?L.alphaChannelUsage||"transparency":"none",R={noUnpackFlip:!0,wrap:{s:x.TextureWrapMode.REPEAT,t:x.TextureWrapMode.REPEAT},preMultiplyAlpha:F(J)!==
v.AlphaDiscardMode.Opaque};L=I?.disableTextures?Promise.resolve(null):t.requestImage(P,I);O.push(L.then(Q=>({refId:K,image:Q,parameters:R,alphaChannelUsage:J})))}G=await Promise.all(O);I={};for(const M of G)I[M.refId]=M;return I}function F(G){switch(G){case "mask":return v.AlphaDiscardMode.Mask;case "maskAndTransparency":return v.AlphaDiscardMode.MaskBlend;case "none":return v.AlphaDiscardMode.Opaque;case "transparency":return v.AlphaDiscardMode.Blend;default:return v.AlphaDiscardMode.Blend}}function H(G){G=
G.params;return{id:1,material:G.material,texture:G.texture,region:G.texture}}const N=()=>k.getLogger("esri.views.3d.layers.graphics.objectResourceUtils"),E=new c.Version(1,2,"wosr");a.createTextureResources=D;a.load=async function(G,I){G=await y(G,I);I=await D(G.textureDefinitions??{},I);let O=0;for(const L in I)if(I.hasOwnProperty(L)){const P=I[L];O+=P?.image?P.image.width*P.image.height*4:0}return{resource:G,textures:I,size:O+l.estimateNestedObjectSize(G)}};a.processLoadResult=function(G,I){const O=
[],L=[],P=[],M=new h.NestedMap,K=G.resource;var J=c.Version.parse(K.version||"1.0","wosr");E.validate(J);J=K.model.name;const R=K.model.geometries,Q=K.materialDefinitions??{};G=G.textures;let W=0;const S=new Map;for(let ca=0;ca<R.length;ca++){const ea=R[ca];if(!B(ea))continue;var V=H(ea),T=ea.params.vertexAttributes;const da=[];var Y=ia=>{if("PerAttributeArray"===ea.params.topology)return null;const ka=ea.params.faces;for(const fa in ka)if(fa===ia)return ka[fa].values;return null},ha=T[n.VertexAttribute.POSITION];
ha=ha.values.length/ha.valuesPerElement;for(const ia in T){var ba=T[ia],U=ba.values,Z=Y(ia)??d.getContinuousIndexArray(ha);da.push([ia,new w.Attribute(U,Z,ba.valuesPerElement,!0)])}T=V.texture;if((Y=G&&G[T])&&!S.has(T)){const {image:ia,parameters:ka}=Y;ha=new r.Texture(ia,ka);L.push(ha);S.set(T,ha)}ha=(ha=S.get(T))?ha.id:void 0;V=V.material;ba=M.get(V,T);null==ba&&(ba=V.substring(V.lastIndexOf("/")+1),ba=Q[ba].params,1===ba.transparency&&(ba.transparency=0),U=Y&&Y.alphaChannelUsage,U=0<ba.transparency||
"transparency"===U||"maskAndTransparency"===U,Z=Y?F(Y.alphaChannelUsage):void 0,Y={ambient:e.fromArray(ba.diffuse),diffuse:e.fromArray(ba.diffuse),opacity:1-(ba.transparency||0),transparent:U,textureAlphaMode:Z,textureAlphaCutoff:.33,textureId:ha,initTextureTransparent:!0,doubleSided:!0,cullFace:v.CullFaceOptions.None,colorMixMode:ba.externalColorMixMode||"tint",textureAlphaPremultiplied:Y?.parameters.preMultiplyAlpha??!1},I?.materialParameters&&Object.assign(Y,I.materialParameters),ba=new u.DefaultMaterial(Y),
M.set(V,T,ba));P.push(ba);T=new m.Geometry(ba,da);W+=da.find(ia=>ia[0]===n.VertexAttribute.POSITION)?.[1]?.indices.length??0;O.push(T)}return{engineResources:[{name:J,stageResources:{textures:L,materials:P,geometries:O},pivotOffset:K.model.pivotOffset,numberOfVertices:W,lodThreshold:null}],referenceBoundingBox:C(O)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/DefaultMaterial_COLOR_GAMMA":function(){define(["exports"],function(a){a.colorGamma=
2.1;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/webStyleUtils":function(){define(["exports","../../../../core/Error","../../../../symbols/support/styleUtils","../../../../symbols/support/webStyleSymbolUtils"],function(a,b,q,l){a.getResourceUrlFromSymbolStyle=async function(p){if(null===p||null==p.styleName&&null==p.styleUrl)return null;var k=p.name;if(null==k)throw new b("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference");
const h={portal:p.portal};p=await q.fetchStyle(p,h).catch(()=>null);if(null===p)return null;const f=l.getStyleItemFromStyle(k,p.data);if(f&&!f.formatInfos?.some(c=>"gltf_basisu"===c.type))return null;k=await l.fetchSymbolFromStyle(p,k,h,"webRef",(c,e)=>q.symbolUrlFromStyleItem(c,e,["gltf_basisu","gltf"])).catch(()=>null);if(null===k||"point-3d"!==k.type)return null;k=k.symbolLayers.items[0];return"object"===k.type?k.resource:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/support/webStyleSymbolUtils":function(){define("exports ../../symbols ../../core/devEnvironmentUtils ../../core/Error ../../core/urlUtils ../../portal/Portal ../../chunks/persistableUrlUtils ./jsonUtils ./StyleOrigin ./styleUtils ./Thumbnail".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){function d(v,m){return m.items.find(r=>r.name===v)}function t(v,m,r,n,u,x){const y=null!=r?.portal?r.portal:k.getDefault(),z={portal:y,url:p.urlToObject(v.baseUrl),origin:"portal-item"},A=d(m,v.data);if(!A)return Promise.reject(new l("symbolstyleutils:symbol-name-not-found",`The symbol name '${m}' could not be found`,{symbolName:m}));u=h.fromJSON(u(A,n),z);let B=A.thumbnail?.href??null;const C=A.thumbnail?.imageData;q.isDevEnvironment()&&(u=q.adjustStaticAGOUrl(u)??
"",B=q.adjustStaticAGOUrl(B));const D={portal:y,url:p.urlToObject(p.removeFile(u)),origin:"portal-item"};return e.requestJSON(u,x).then(F=>{F="cimRef"===n?e.makeCIMSymbolRef(F.data):F.data;if((F=f.fromJSON(F,D))&&b.isSymbol3D(F)){if(B){const H=h.fromJSON(B,z);F.thumbnail=new g.Thumbnail({url:H})}else C&&(F.thumbnail=new g.Thumbnail({url:`data:image/png;base64,${C}`}));v.styleUrl?F.styleOrigin=new c({portal:r.portal,styleUrl:v.styleUrl,name:m}):v.styleName&&(F.styleOrigin=new c({portal:r.portal,styleName:v.styleName,
name:m}))}return F})}function w(v,m,r){const n=e.Style2DUrlTemplate.replaceAll(/\{SymbolName\}/gi,v),u=null!=m.portal?m.portal:k.getDefault();return e.requestJSON(n,r).then(x=>{x=e.makeCIMSymbolRef(x.data);return f.fromJSON(x,{portal:u,url:p.urlToObject(p.removeFile(n)),origin:"portal-item"})})}a.fetchSymbolFromStyle=t;a.getStyleItemFromStyle=d;a.resolveWebStyleSymbol=function(v,m,r,n){const u=v.name;return null==u?Promise.reject(new l("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference")):
v.styleName&&"Esri2DPointSymbolsStyle"===v.styleName?w(u,m,n):e.fetchStyle(v,m,n).then(x=>t(x,u,m,r,e.symbolUrlFromStyleItem,n))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/lodRendering/LodRenderer":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/arrayUtils ../../../../../core/maybe ../../../../../core/promiseUtils ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/accessorSupport/decorators/subclass ../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../support/debugFlags ../../../support/buffer/glUtil ../../../support/buffer/InterleavedLayout ../../../webgl/RenderCamera ../../core/shaderLibrary/ShaderOutput ../../effects/RenderPlugin ../DefaultVertexAttributeLocations ../IntersectorInterfaces ../Octree ../RenderSlot ../Util ../VertexAttribute ./InstanceData ./InstanceOctree ./LevelSelector ./LodLevel ./RenderInstanceData ../../materials/internal/MaterialUtil ../../materials/renderers/utils ../../shaders/DefaultMaterialTechnique ../../../../support/Scheduler ../../../../webgl/Util".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P){function M(ha,ba,U){const Z=ha.allocateHead();ha=ha.view;I.encodeDoubleVec3(ba.modelOrigin,U,ha.modelOriginHi,ha.modelOriginLo,Z);ha.model.copyFrom(Z,ba.model,U);ha.modelNormal.copyFrom(Z,ba.modelNormal,U);ba.color&&ha.color&&ha.color.copyFrom(Z,ba.color,U);ba.objectAndLayerIdColor&&ha.objectAndLayerIdColor&&ha.objectAndLayerIdColor.copyFrom(Z,ba.objectAndLayerIdColor,U);ba.featureAttribute&&ha.featureAttribute&&ha.featureAttribute.copyFrom(Z,
ba.featureAttribute,U)}function K(ha){let ba=m.newLayout().vec3f(C.VertexAttribute.INSTANCEMODELORIGINHI).vec3f(C.VertexAttribute.INSTANCEMODELORIGINLO).mat3f(C.VertexAttribute.INSTANCEMODEL).mat3f(C.VertexAttribute.INSTANCEMODELNORMAL);null!=ha&&ha.includes("featureAttribute")&&(ba=ba.vec4f(C.VertexAttribute.INSTANCEFEATUREATTRIBUTE));null!=ha&&ha.includes("color")&&(ba=ba.vec4u8(C.VertexAttribute.INSTANCECOLOR));null!=ha&&ha.includes("objectAndLayerIdColor")&&(ba=ba.vec4u8(C.VertexAttribute.INSTANCEOBJECTANDLAYERIDCOLOR));
return ba}const J=ha=>{const ba=ha.baseBoundingSphere.radius;ha=ha.levels.map(U=>U.minScreenSpaceRadius);return new H.LevelSelector(ba,ha)};a.LodRenderer=class extends u.ASyncPreparesRenderPlugin{constructor(ha,ba){super(ha);this.type=y.IntersectorType.LOD;this.isGround=!1;this._levels=[];this._defaultRenderInstanceData=[[]];this._highlightRenderInstanceData=[[]];this._allRenderInstanceData=[this._defaultRenderInstanceData[0],this._highlightRenderInstanceData[0]];this._cycleStartIndex=this._instanceIndex=
0;this._slicePlane=!1;this._camera=new r;this._updateCyclesWithStaticCamera=-1;this._needFullCycle=!1;this.produces=new Map([[A.RenderSlot.OPAQUE_MATERIAL,U=>this._produces(U)],[A.RenderSlot.TRANSPARENT_MATERIAL,U=>this._hasTransparentLevels()?this._produces(U):!1]]);this._instanceData=new D.InstanceData({shaderTransformation:ha.shaderTransformation},ha.optionalFields);this.addHandles(ba.registerTask(L.TaskPriority.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=K(this.optionalFields);
this._glInstanceBufferLayout=v.glLayout(this._instanceBufferLayout,1);this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:ha})=>{this._requestUpdateCycle();this.metadata.notifyGraphicGeometryChanged(ha)}),this._instanceData.events.on("instance-visibility-changed",({index:ha})=>{this._requestUpdateCycle(!0);this.metadata.notifyGraphicVisibilityChanged(ha)}),this._instanceData.events.on("instance-highlight-changed",
()=>this._requestUpdateCycle(!0))])}get _enableLevelSelection(){return 1<this.symbol.levels.length}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(ha){this._slicePlane=ha}get layerUid(){return this.metadata.layerUid}get instanceData(){return this._instanceData}get usedMemory(){return this._allRenderInstanceData.reduce((ha,
ba)=>ba.reduce((U,Z)=>U+Z.usedMemory,ha),0)}get renderStats(){const ha=this._instanceData.size,ba=[];this._levels.forEach((U,Z)=>{Z=this._allRenderInstanceData[0][Z].size+this._allRenderInstanceData[1][Z].size;U=U.triangleCount;ba.push({renderedInstances:Z,renderedTriangles:Z*U,trianglesPerInstance:U})});return{totalInstances:ha,renderedInstances:ba.reduce((U,Z)=>U+Z.renderedInstances,0),renderedTriangles:ba.reduce((U,Z)=>U+Z.renderedTriangles,0),levels:ba}}async initializeRenderContext(ha,ba){this._context=
ha;const U=ha.renderContext.rctx,Z=await Promise.allSettled(this.symbol.levels.map(ea=>{this._defaultRenderInstanceData[0].push(new E.RenderInstanceData(U,this._instanceBufferLayout));this._highlightRenderInstanceData[0].push(new E.RenderInstanceData(U,this._instanceBufferLayout));return N.LodLevel.create(ha,ea,ba)})),ca=Z.map(ea=>"fulfilled"===ea.status?ea.value:null).filter(q.isSome);if(p.isAborted(ba)||ca.length!==Z.length){ca.forEach(ea=>ea.destroy());p.throwIfAborted(ba);for(const ea of Z)if("rejected"===
ea.status)throw ea.reason;}this._levels=ca;this._levelSelector=J(this)}uninitializeRenderContext(){this._invalidateOctree();this._levels.forEach(ha=>ha.destroy());this._defaultRenderInstanceData[0].forEach(ha=>ha.destroy());this._highlightRenderInstanceData[0].forEach(ha=>ha.destroy())}_hasTransparentLevels(){return this._levels.some(ha=>ha.components.some(ba=>ba.material.produces.get(A.RenderSlot.TRANSPARENT_MATERIAL)?.(n.ShaderOutput.Color)))}hasHighlights(){return this._highlightRenderInstanceData[0].some(ha=>
0<ha.size)}_produces(ha){return ha!==n.ShaderOutput.Highlight&&ha!==n.ShaderOutput.ShadowHighlight||this.hasHighlights()}prepareRender(ha){if(!w.debugFlags.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const ba=ha.bindParameters.contentCamera.equals(this._camera);this._camera.copyFrom(ha.bindParameters.contentCamera);ba||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(L.noBudget),this._needFullCycle=!1)}}prepareTechniques(ha){if(!this.baseMaterial.isVisible()||
!this.baseMaterial.isVisibleForOutput(ha.output))return null;const ba=this._getInstanceDatas(ha.output);if(!ba)return null;const U=[];ba.forEach(Z=>this.levels.forEach((ca,ea)=>{ca.components.forEach(da=>U.push(this._beginComponent(ha,Z[ea],da)))}));return U}renderNode(ha,ba){const U=this._getInstanceDatas(ha.output);if(U&&null!=ba){var Z=0;ha.rctx.bindVAO();U.forEach(ca=>this.levels.forEach((ea,da)=>{ea.components.forEach(ia=>this._renderComponent(ha,ba[Z++],ca[da],ia,da))}))}}_getInstanceDatas(ha){const ba=
ha!==n.ShaderOutput.Highlight&&ha!==n.ShaderOutput.ShadowHighlight;ha=ha!==n.ShaderOutput.ShadowExcludeHighlight;return ba&&ha?this._allRenderInstanceData:ba?this._defaultRenderInstanceData:ha?this._highlightRenderInstanceData:null}intersect(ha,ba,U,Z){if(this.baseMaterial.isVisible()&&null!=this._octree){var ca=d.create();g.subtract(ca,Z,U);var ea=da=>{this._instanceData.getCombinedModelTransform(da,W);ha.transform.set(W);g.transformMat4(S,U,ha.transform.inverse);g.transformMat4(V,Z,ha.transform.inverse);
const ia=this._instanceData.getState(da),ka=this._instanceData.getLodLevel(da),fa=this._levels.length;B.assert(0!==(ia&D.StateFlags.ACTIVE),"invalid instance state");B.assert(0<=ka&&ka<fa,"invaid lod level");this._levels[ka].intersect(ha,ba,S,V,da,this.metadata,fa)};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(ea):this._octree.forEachAlongRay(U,ca,ea)}}notifyShaderTransformationChanged(){this._invalidateOctree();this._requestUpdateCycle()}get _octree(){if(null==this._octreeCached){const ha=
this._instanceData,ba=ha.view?.state;if(!ba)return null;this._octreeCached=new F.InstanceOctree(ha,this.baseBoundingSphere);for(let U=0;U<ha.capacity;++U)ba.get(U)&D.StateFlags.ACTIVE&&this._octreeCached.addInstance(U)}return this._octreeCached}_invalidateOctree(){this._octreeCached=l.destroyMaybe(this._octreeCached)}queryDepthRange(ha){if(null==this._octree)return{near:Infinity,far:-Infinity};var ba=ha.viewForward,U=this._octree.findClosest(ba,z.DepthOrder.FRONT_TO_BACK,ha.frustum);const Z=this._octree.findClosest(ba,
z.DepthOrder.BACK_TO_FRONT,ha.frustum);if(null==U||null==Z)return{near:Infinity,far:-Infinity};const ca=ha.eye,ea=this._instanceData.view;ea.boundingSphere.getVec(U,Q);g.subtract(Q,Q,ca);U=g.dot(Q,ba)-Q[3];ea.boundingSphere.getVec(Z,Q);g.subtract(Q,Q,ca);ba=g.dot(Q,ba)+Q[3];return{near:Math.max(ha.near,U),far:Math.min(ha.far,ba)}}_requestUpdateCycle(ha=!1){this._updateCyclesWithStaticCamera=-1;this._cycleStartIndex=this._instanceIndex;ha&&(this._needFullCycle=!0,this._context.requestRender())}_startUpdateCycle(){this._updateCyclesWithStaticCamera++;
this._allRenderInstanceData.forEach(ha=>ha.forEach(ba=>ba.startUpdateCycle()))}get running(){return 0<this._instanceData.size&&1>this._updateCyclesWithStaticCamera}runTask(ha){const {_enableLevelSelection:ba,_camera:U,_levelSelector:Z}=this;this._allRenderInstanceData.forEach(la=>la.forEach(na=>na.beginUpdate()));const ca=this._instanceData,ea=ca.view;let da=ca.size;const ia=ca.capacity;let ka=this._instanceIndex;const fa=Math.ceil(ia/500);for(let la=0;la<da&&!ha.done;++la){ka===this._cycleStartIndex&&
this._startUpdateCycle();const na=ea.state.get(ka);var X=0;if(na&D.StateFlags.ALLOCATED){var ja=ea.lodLevel.get(ka);na&D.StateFlags.DEFAULT_ACTIVE&&this._defaultRenderInstanceData[0][ja].freeTail();na&D.StateFlags.HIGHLIGHT_ACTIVE&&this._highlightRenderInstanceData[0][ja].freeTail();na&D.StateFlags.REMOVE?ca.freeInstance(ka):na&D.StateFlags.VISIBLE?(ja=0,ba&&(ea.modelOrigin.getVec(ka,R),ja=Z.selectLevel(R,ca.getCombinedMedianScaleFactor(ka),U)),X=na&~(D.StateFlags.ACTIVE|D.StateFlags.TRANSFORM_CHANGED),
0<=ja&&(na&D.StateFlags.HIGHLIGHT?(M(this._highlightRenderInstanceData[0][ja],ea,ka),X|=D.StateFlags.HIGHLIGHT_ACTIVE):(M(this._defaultRenderInstanceData[0][ja],ea,ka),X|=D.StateFlags.DEFAULT_ACTIVE)),ea.state.set(ka,X),ea.lodLevel.set(ka,ja)):(X=na&~(D.StateFlags.ACTIVE|D.StateFlags.TRANSFORM_CHANGED),ea.state.set(ka,X));null!=this._octreeCached&&(ja=!!(na&D.StateFlags.ACTIVE),X=!!(X&D.StateFlags.ACTIVE),!ja&&X?this._octreeCached.addInstance(ka):ja&&!X?this._octreeCached.removeInstance(ka):ja&&X&&
na&D.StateFlags.TRANSFORM_CHANGED&&(this._octreeCached.removeInstance(ka),this._octreeCached.addInstance(ka)));ka=ka+1===ia?0:ka+1;0===ka%fa&&ha.madeProgress()}else ka=ka+1===ia?0:ka+1,da++}this._instanceIndex=ka;this._allRenderInstanceData.forEach(la=>la.forEach(na=>na.endUpdate()));this._context.requestRender()}_beginComponent(ha,ba,U){if(0===ba.size)return null;ba=U.glMaterials.load(ha.rctx,ha.bindParameters.slot,ha.output);return null!=ba?ba.beginSlot(ha.bindParameters):null}_renderComponent(ha,
ba,U,Z,ca){if(ba){var {bindParameters:ea,rctx:da}=ha;da.runAppleAmdDriverHelper();var ia=da.bindTechnique(ba,ea,Z.material.parameters,Y);da.bindVAO(Z.vao);ba.ensureAttributeLocations(Z.vao);w.debugFlags.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&ha.output===n.ShaderOutput.Color&&(ia.setUniform4fv("externalColor",T[Math.min(ca,T.length-1)]),ia.setUniform1i("colorMixMode",G.colorMixModes.replace));ha=U.capacity;ca=U.headIndex;ia=U.tailIndex;var ka=U.firstIndex,fa=this._glInstanceBufferLayout,X=(ja,la)=>
{P.bindVertexBufferLayout(da,x.Default3D,U.buffer,fa,ja);da.drawArraysInstanced(ba.primitiveType,0,Z.vertexCount,la-ja);P.unbindVertexBufferLayout(da,x.Default3D,U.buffer,fa)};Z.material.parameters.transparent&&null!=ka?ca>ia?(B.assert(ka>=ia&&ka<=ca,"invalid firstIndex"),X(ka,ca),X(ia,ka)):ca<ia&&(ka<=ca?(B.assert(0<=ka&&ka<=ca,"invalid firstIndex"),X(ka,ca),X(ia,ha),X(0,ka)):(B.assert(ka>=ia&&ka<=ha,"invalid firstIndex"),X(ka,ha),X(0,ca),X(ia,ka))):ca>ia?X(ia,ca):ca<ia&&(X(0,ca),X(ia,ha));da.bindVAO(null)}}};
b.__decorate([k.property({constructOnly:!0})],a.LodRenderer.prototype,"symbol",void 0);b.__decorate([k.property({constructOnly:!0})],a.LodRenderer.prototype,"optionalFields",void 0);b.__decorate([k.property({constructOnly:!0})],a.LodRenderer.prototype,"metadata",void 0);b.__decorate([k.property({constructOnly:!0})],a.LodRenderer.prototype,"shaderTransformation",void 0);b.__decorate([k.property()],a.LodRenderer.prototype,"_instanceData",void 0);b.__decorate([k.property()],a.LodRenderer.prototype,"_cycleStartIndex",
void 0);b.__decorate([k.property({readOnly:!0})],a.LodRenderer.prototype,"_enableLevelSelection",null);b.__decorate([k.property()],a.LodRenderer.prototype,"_updateCyclesWithStaticCamera",void 0);b.__decorate([k.property({readOnly:!0})],a.LodRenderer.prototype,"running",null);a.LodRenderer=b.__decorate([c.subclass("esri.views.3d.webgl-engine.lib.lodRendering.LodRenderer")],a.LodRenderer);const R=d.create(),Q=t.create(),W=e.create(),S=d.create(),V=d.create(),T=[t.fromValues(1,0,1,1),t.fromValues(0,
0,1,1),t.fromValues(0,1,0,1),t.fromValues(1,1,0,1),t.fromValues(1,0,0,1)],Y=new O.DefaultMaterialDrawParameters;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/lodRendering/InstanceData":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/Accessor ../../../../../core/arrayUtils ../../../../../core/Evented ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/accessorSupport/decorators/subclass ../../../../../core/libs/gl-matrix-2/math/mat3 ../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../core/libs/gl-matrix-2/math/mat4 ../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../geometry/support/buffer/BufferView ../../../support/mathUtils ../../../support/buffer/InterleavedLayout ../Util ../VertexAttribute ./RenderInstanceData".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){a.StateFlags=void 0;(function(F){F[F.ALLOCATED=1]="ALLOCATED";F[F.DEFAULT_ACTIVE=2]="DEFAULT_ACTIVE";F[F.VISIBLE=4]="VISIBLE";F[F.HIGHLIGHT=8]="HIGHLIGHT";F[F.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE";F[F.REMOVE=32]="REMOVE";F[F.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED";F[F.ACTIVE=18]="ACTIVE"})(a.StateFlags||(a.StateFlags={}));class z{constructor(F){this.localTransform=F.getField(x.VertexAttribute.LOCALTRANSFORM,m.BufferViewMat4f64);this.globalTransform=
F.getField(x.VertexAttribute.GLOBALTRANSFORM,m.BufferViewMat4f64);this.modelOrigin=F.getField(x.VertexAttribute.MODELORIGIN,m.BufferViewVec3f64);this.model=F.getField(x.VertexAttribute.INSTANCEMODEL,m.BufferViewMat3f);this.modelNormal=F.getField(x.VertexAttribute.INSTANCEMODELNORMAL,m.BufferViewMat3f);this.modelScaleFactors=F.getField(x.VertexAttribute.MODELSCALEFACTORS,m.BufferViewVec2f);this.boundingSphere=F.getField(x.VertexAttribute.BOUNDINGSPHERE,m.BufferViewVec4f64);this.featureAttribute=F.getField(x.VertexAttribute.FEATUREATTRIBUTE,
m.BufferViewVec4f);this.color=F.getField(x.VertexAttribute.COLOR,m.BufferViewVec4u8);this.objectAndLayerIdColor=F.getField(x.VertexAttribute.OBJECTANDLAYERIDCOLOR,m.BufferViewVec4u8);this.state=F.getField(x.VertexAttribute.STATE,m.BufferViewUint8);this.lodLevel=F.getField(x.VertexAttribute.LODLEVEL,m.BufferViewUint8)}}a.InstanceData=class extends q{constructor(F,H){super(F);this.events=new p;this._next=this._size=this._capacity=0;F=n.newLayout().mat4f64(x.VertexAttribute.LOCALTRANSFORM).mat4f64(x.VertexAttribute.GLOBALTRANSFORM).vec4f64(x.VertexAttribute.BOUNDINGSPHERE).vec3f64(x.VertexAttribute.MODELORIGIN).mat3f(x.VertexAttribute.INSTANCEMODEL).mat3f(x.VertexAttribute.INSTANCEMODELNORMAL).vec2f(x.VertexAttribute.MODELSCALEFACTORS);
H.includes(x.VertexAttribute.FEATUREATTRIBUTE)&&(F=F.vec4f(x.VertexAttribute.FEATUREATTRIBUTE));H.includes(x.VertexAttribute.COLOR)&&(F=F.vec4u8(x.VertexAttribute.COLOR));H.includes(x.VertexAttribute.OBJECTANDLAYERIDCOLOR)&&(F=F.vec4u8(x.VertexAttribute.OBJECTANDLAYERIDCOLOR));this._layout=F=F.u8(x.VertexAttribute.STATE).u8(x.VertexAttribute.LODLEVEL);this._capacity=y.initialCapacity;this._buffer=this._layout.createBuffer(this._capacity);this._view=new z(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+
1>this._capacity&&this._grow();const F=this._findSlot();this._view.state.set(F,a.StateFlags.ALLOCATED);this._size++;this.events.emit("instances-changed");return F}removeInstance(F){const H=this._view.state;u.assert(0<=F&&F<this._capacity&&0!==(H.get(F)&a.StateFlags.ALLOCATED),"invalid instance handle");this._getStateFlag(F,a.StateFlags.ACTIVE)?this._setStateFlags(F,a.StateFlags.REMOVE):this.freeInstance(F);this.events.emit("instances-changed")}freeInstance(F){const H=this._view.state;u.assert(0<=
F&&F<this._capacity&&0!==(H.get(F)&a.StateFlags.ALLOCATED),"invalid instance handle");H.set(F,0);this._size--}setLocalTransform(F,H,N=!0){this._view.localTransform.setMat(F,H);N&&this.updateModelTransform(F)}getLocalTransform(F,H){this._view.localTransform.getMat(F,H)}setGlobalTransform(F,H,N=!0){this._view.globalTransform.setMat(F,H);N&&this.updateModelTransform(F)}getGlobalTransform(F,H){this._view.globalTransform.getMat(F,H)}updateModelTransform(F){const H=this._view;var N=A;const E=B;H.localTransform.getMat(F,
C);H.globalTransform.getMat(F,D);const G=d.multiply(D,D,C);w.set(N,G[12],G[13],G[14]);H.modelOrigin.setVec(F,N);e.fromMat4(E,G);H.model.setMat(F,E);N=r.scaleFromMatrix(A,G);N.sort();H.modelScaleFactors.set(F,0,N[1]);H.modelScaleFactors.set(F,1,N[2]);e.invert(E,E);e.transpose(E,E);H.modelNormal.setMat(F,E);this._setStateFlags(F,a.StateFlags.TRANSFORM_CHANGED);this.events.emit("instance-transform-changed",{index:F})}getModelTransform(F,H){const N=this._view;N.model.getMat(F,B);N.modelOrigin.getVec(F,
A);H[0]=B[0];H[1]=B[1];H[2]=B[2];H[3]=0;H[4]=B[3];H[5]=B[4];H[6]=B[5];H[7]=0;H[8]=B[6];H[9]=B[7];H[10]=B[8];H[11]=0;H[12]=A[0];H[13]=A[1];H[14]=A[2];H[15]=1}applyShaderTransformation(F,H){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,F,H)}getCombinedModelTransform(F,H){this.getModelTransform(F,H);null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,F,H);return H}getCombinedLocalTransform(F,H){this._view.localTransform.getMat(F,H);null!=this.shaderTransformation&&
this.shaderTransformation.applyTransform(this,F,H)}getCombinedMaxScaleFactor(F){let H=this._view.modelScaleFactors.get(F,1);null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(A,this,F),H*=Math.max(A[0],A[1],A[2]));return H}getCombinedMedianScaleFactor(F){let H=this._view.modelScaleFactors.get(F,0);if(null!=this.shaderTransformation){this.shaderTransformation.scaleFactor(A,this,F);F=A[0];var N=A[1];H*=Math.max(Math.min(F,N),Math.min(Math.max(F,N),A[2]))}return H}getModel(F,H){this._view.model.getMat(F,
H)}setFeatureAttribute(F,H){this._view.featureAttribute.setVec(F,H)}getFeatureAttribute(F,H){this._view.featureAttribute.getVec(F,H)}setColor(F,H){this._view.color.setVec(F,H)}setObjectAndLayerIdColor(F,H){this._view.objectAndLayerIdColor.setVec(F,H)}setVisible(F,H){H!==this.getVisible(F)&&(this._setStateFlag(F,a.StateFlags.VISIBLE,H),this.events.emit("instance-visibility-changed",{index:F}))}getVisible(F){return this._getStateFlag(F,a.StateFlags.VISIBLE)}setHighlight(F,H){H!==this.getHighlight(F)&&
(this._setStateFlag(F,a.StateFlags.HIGHLIGHT,H),this.events.emit("instance-highlight-changed"))}getHighlight(F){return this._getStateFlag(F,a.StateFlags.HIGHLIGHT)}getState(F){return this._view.state.get(F)}getLodLevel(F){return this._view.lodLevel.get(F)}countFlags(F){let H=0;for(let N=0;N<this._capacity;++N)this.getState(N)&F&&++H;return H}_setStateFlags(F,H){const N=this._view.state;H|=N.get(F);N.set(F,H)}_clearStateFlags(F,H){const N=this._view.state;H=N.get(F)&~H;N.set(F,H)}_setStateFlag(F,H,
N){N?this._setStateFlags(F,H):this._clearStateFlags(F,H)}_getStateFlag(F,H){return!!(this._view.state.get(F)&H)}_grow(){this._capacity=Math.max(y.initialCapacity,Math.floor(this._capacity*l.reallocGrowthFactor));this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer);this._view=new z(this._buffer)}_findSlot(){const F=this._view.state;let H=this._next;for(;F.get(H)&a.StateFlags.ALLOCATED;)H=H+1===this._capacity?0:H+1;this._next=H+1===this._capacity?0:H+1;return H}};b.__decorate([k.property({constructOnly:!0})],
a.InstanceData.prototype,"shaderTransformation",void 0);b.__decorate([k.property()],a.InstanceData.prototype,"_size",void 0);b.__decorate([k.property({readOnly:!0})],a.InstanceData.prototype,"size",null);a.InstanceData=b.__decorate([c.subclass("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],a.InstanceData);const A=v.create(),B=g.create(),C=t.create(),D=t.create();a.InstanceDataView=z;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData":function(){define("exports ../../../../../core/arrayUtils ../../../../../geometry/support/buffer/BufferView ../Util ../VertexAttribute ./BackedBufferObject".split(" "),
function(a,b,q,l,p,k){class h{constructor(c){this.modelOriginHi=c.getField(p.VertexAttribute.INSTANCEMODELORIGINHI,q.BufferViewVec3f);this.modelOriginLo=c.getField(p.VertexAttribute.INSTANCEMODELORIGINLO,q.BufferViewVec3f);this.model=c.getField(p.VertexAttribute.INSTANCEMODEL,q.BufferViewMat3f);this.modelNormal=c.getField(p.VertexAttribute.INSTANCEMODELNORMAL,q.BufferViewMat3f);this.featureAttribute=c.getField(p.VertexAttribute.INSTANCEFEATUREATTRIBUTE,q.BufferViewVec4f);this.color=c.getField(p.VertexAttribute.INSTANCECOLOR,
q.BufferViewVec4u8);this.objectAndLayerIdColor=c.getField(p.VertexAttribute.INSTANCEOBJECTANDLAYERIDCOLOR,q.BufferViewVec4u8)}}class f{constructor(c,e){this._rctx=c;this._instanceBufferLayout=e;this._tailIndex=this._headIndex=0;this._firstIndex=null;this._captureFirstIndex=!0;this._updating=!1;this._prevHeadIndex=0;this._resized=!1;this._capacity=1}destroy(){this._buffer&&this._buffer.destroy()}get buffer(){return this._buffer.buffer}get view(){return this._view}get capacity(){return this._capacity}get size(){const c=
this._headIndex,e=this._tailIndex;return c>=e?c-e:c+this._capacity-e}get isEmpty(){return this._headIndex===this._tailIndex}get isFull(){return this._tailIndex===(this._headIndex+1)%this._capacity}get headIndex(){return this._headIndex}get tailIndex(){return this._tailIndex}get firstIndex(){return this._firstIndex}get usedMemory(){return this._buffer?.usedMemory??0}reset(){this._tailIndex=this._headIndex=0;this._firstIndex=null}startUpdateCycle(){this._captureFirstIndex=!0}beginUpdate(){l.assert(!this._updating,
"already updating");this._updating=!0;this._prevHeadIndex=this._headIndex}endUpdate(){l.assert(this._updating,"not updating");this.size<b.reallocShrinkThreshold*this.capacity&&this._shrink();this._resized?(this._buffer.transferAll(),this._resized=!1):this._transferRange(this._prevHeadIndex,this._headIndex);this._updating=!1}allocateHead(){l.assert(this._updating,"not updating");this.isFull&&this._grow();const c=this.headIndex;this._captureFirstIndex&&(this._firstIndex=c,this._captureFirstIndex=!1);
this._incrementHead();l.assert(this._headIndex!==this._tailIndex,"invalid pointers");return c}freeTail(){l.assert(this._updating,"not updating");l.assert(0<this.size,"invalid size");const c=this._tailIndex===this._firstIndex;this._incrementTail();c&&(this._firstIndex=this._tailIndex)}_grow(){this._resize(Math.max(64,Math.floor(this._capacity*b.reallocGrowthFactor)))}_shrink(){this._resize(Math.max(64,Math.floor(this._capacity*b.reallocShrinkFactor)))}_resize(c){l.assert(this._updating,"not updating");
if(c!==this._capacity){var e=new k(this._rctx,this._instanceBufferLayout.stride,c);if(this._buffer){this._firstIndex&&(this._firstIndex=(this._firstIndex+this._capacity-this._tailIndex)%this._capacity);const g=this.size,d=this._compactInstances(e);l.assert(d===g,"invalid compaction");this._buffer.destroy();this._tailIndex=0;this._headIndex=d;this._prevHeadIndex=0}this._resized=!0;this._capacity=c;this._buffer=e;this._view=new h(this._instanceBufferLayout.createView(this._buffer.array))}}_compactInstances(c){const e=
this._headIndex,g=this._tailIndex;return g<e?(this._buffer.copyRange(g,e,c),e-g):g>e?(this._buffer.copyRange(g,this._capacity,c),0<e&&this._buffer.copyRange(0,e,c,this._capacity-g),e+(this._capacity-g)):0}_incrementHead(c=1){this._headIndex=(this._headIndex+c)%this._capacity}_incrementTail(c=1){this._tailIndex=(this._tailIndex+c)%this._capacity}_transferRange(c,e){c<e?this._buffer.transferRange(c,e):c>e&&(0<e&&this._buffer.transferRange(0,e),this._buffer.transferRange(c,this._capacity))}}a.RenderInstanceData=
f;a.RenderInstanceDataView=h;a.initialCapacity=64;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/lodRendering/BackedBufferObject":function(){define(["../../../../webgl/BufferObject","../../../../webgl/enums"],function(a,b){class q{constructor(l,p,k){this._elementSize=p;this._buffer=a.BufferObject.createVertex(l,b.Usage.STATIC_DRAW);this.resize(k)}destroy(){this._buffer.dispose()}get elementSize(){return this._elementSize}get capacity(){return this._capacity}get array(){return this._array}get buffer(){return this._buffer}get usedMemory(){return this._array.byteLength+
this._buffer.usedMemory}copyRange(l,p,k,h=0){l=new Uint8Array(this.array,l*this.elementSize,(p-l)*this.elementSize);(new Uint8Array(k.array,h*this.elementSize)).set(l)}transferAll(){this._buffer.setData(this._array)}transferRange(l,p){l*=this._elementSize;p*=this._elementSize;this._buffer.setSubData(new Uint8Array(this._array),l,l,p)}resize(l){const p=l*this._elementSize,k=new ArrayBuffer(p);this._array&&(l>=this._capacity?(new Uint8Array(k)).set(new Uint8Array(this._array)):(new Uint8Array(k)).set((new Uint8Array(this._array)).subarray(0,
l*this._elementSize)));this._array=k;this._buffer.setSize(p);this._capacity=l}}return q})},"esri/views/3d/webgl-engine/lib/lodRendering/InstanceOctree":function(){define("exports ../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../chunks/vec32 ../../../../../chunks/sphere ../../../support/mathUtils ../Octree".split(" "),function(a,b,q,l,p,k){class h extends k{constructor(f,c){super(e=>l.wrap(this._instanceData.view.boundingSphere.getVec(e,this._tmpSphere)),{maximumDepth:25});this._instanceData=
f;this._boundingSphere=c;this._tmpSphere=l.create();this._tmpMat4=b.create()}addInstance(f){const c=this._instanceData.view.boundingSphere,e=this._instanceData.getCombinedModelTransform(f,this._tmpMat4);q.transformMat4(l.getCenter(this._tmpSphere),this._boundingSphere.center,e);this._tmpSphere[3]=this._boundingSphere.radius*p.maxScale(e);c.setVec(f,this._tmpSphere);this.add([f])}removeInstance(f){this.remove([f])}}a.InstanceOctree=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/lib/lodRendering/LevelSelector":function(){define(["exports"],function(a){class b{constructor(q,l){this._worldSpaceRadius=q;this._minScreenSpaceRadii=l}selectLevel(q,l,p){q=p.computeScreenPixelSizeAt(q);l=this._worldSpaceRadius*l/q;q=0;for(p=1;p<this._minScreenSpaceRadii.length;++p)l>=this._minScreenSpaceRadii[p]&&(q=p);return q}}a.LevelSelector=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/lodRendering/LodLevel":function(){define("exports ../../../../../core/arrayUtils ../../../../../core/promiseUtils ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../geometry/support/aaBoundingBox ./LodComponentData".split(" "),
function(a,b,q,l,p,k){class h{static async create(f,c,e){const g=await Promise.allSettled(c.components.map(t=>f.controller.schedule(()=>new k.LodComponentData(f,t),e))),d=g.map(t=>"fulfilled"===t.status?t.value:null).filter(b.isSome);if(q.isAborted(e)||d.length!==g.length){d.forEach(t=>t.destroy());q.throwIfAborted(e);for(const t of g)if("rejected"===t.status)throw t.reason;}return new h(c.minScreenSpaceRadius,d)}constructor(f,c){this.minScreenSpaceRadius=f;this.components=c}destroy(){this.components.forEach(f=>
f.destroy())}intersect(f,c,e,g,d,t,w){this.components.forEach(v=>v.intersect(f,c,e,g,d,t,this.boundingSphere,w))}get boundingBox(){if(null==this._boundingBox){const f=p.empty();this.components.forEach(c=>{null!=c.boundingInfo&&(p.expandWithVec3(f,c.boundingInfo.bbMin),p.expandWithVec3(f,c.boundingInfo.bbMax))});this._boundingBox=f}return this._boundingBox}get boundingSphere(){if(null==this._boundingSphere){const f=this.boundingBox,c=l.create();p.center(f,c);this._boundingSphere={center:c,radius:.5*
p.diameter(f)}}return this._boundingSphere}get triangleCount(){return this.components.reduce((f,c)=>f+c.triangleCount,0)}}a.LodLevel=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/lodRendering/LodComponentData":function(){define("exports ../../../support/buffer/glUtil ../DefaultVertexAttributeLocations ../GLMaterials ../Intersector ../IntersectorInterfaces ../VertexArrayObject ./Intersector ../../../../webgl/BufferObject ../../../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f,c,e){class g{constructor(d,t){const w=d.renderContext.rctx;t=t.geometry;this._materials=d.materials;t.material.setParameters({instancedDoublePrecision:!0});d=t.material.createBufferWriter();const v=d.vertexBufferLayout,m=d.elementCount(t),r=v.createBuffer(m);d.write(null,null,t,r,0);this.geometry=t;this.material=t.material;this.glMaterials=new l.GLMaterials(t.material,this._materials);this.vertexBufferLayout=v;this.vbo=c.BufferObject.createVertex(w,e.Usage.STATIC_DRAW,r.buffer);
this.vao=new h.VertexArrayObject(w,q.Default3D,{geometry:b.glLayout(v)},{geometry:this.vbo});this.vertexCount=m}destroy(){this.glMaterials.dispose();this.vbo.dispose();this.vao.dispose()}get boundingInfo(){return this.geometry.boundingInfo}get triangleCount(){return this.vertexCount/3}intersect(d,t,w,v,m,r,n,u){const x=this.geometry.id;this.material.intersect(this.geometry,d.transform.transform,d,w,v,(y,z,A,B,C)=>{0<=y&&(null==t||t(d.rayBegin,d.rayEnd,y))&&(A=new f.LodTarget(r.layerUid,r.graphicUid(m),
x,A,n,u),(null==d.results.min.drapedLayerOrder||C>=d.results.min.drapedLayerOrder)&&(null==d.results.min.dist||y<d.results.min.dist)&&d.results.min.set(k.IntersectorType.LOD,A,y,z,d.transform.transform,C),d.options.store!==k.StoreResults.MIN&&(null==d.results.max.drapedLayerOrder||C>=d.results.max.drapedLayerOrder)&&(null==d.results.max.dist||y>d.results.max.dist)&&d.results.max.set(k.IntersectorType.LOD,A,y,z,d.transform.transform,C),d.options.store===k.StoreResults.ALL&&(B=p.newIntersectorResult(d.results.min.ray),
B.set(k.IntersectorType.LOD,A,y,z,d.transform.transform,C),d.results.all.push(B)))})}}a.LodComponentData=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/lodRendering/Intersector":function(){define(["exports","../IntersectorInterfaces","../IntersectorTarget","../intersectorUtils"],function(a,b,q,l){class p extends q.Graphic3DTarget{constructor(k,h,f,c,e,g){super(k,h);this.layerUid=k;this.graphicUid=h;this.geometryId=f;this.triangleNr=c;this.baseBoundingSphere=
e;this.numLodLevels=g}}a.LodTarget=p;a.isLodIntersectorResult=function(k){return l.isValidIntersectorResult(k)&&k.intersector===b.IntersectorType.LOD&&!!k.target};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DPathSymbolLayer":function(){define("exports ../../../../core/has ../../../../core/Error ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/projectBuffer ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/DoubleArray ./elevationAlignmentUtils ./Graphics3DObject3DGraphicLayer ./Graphics3DPathSymbolLayerConstants ./Graphics3DSymbolLayer ./graphicUtils ./interfaces ../support/FastSymbolUpdates ../../support/ElevationProvider ../../webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/Path ../../webgl-engine/lib/PathBuilder ../../webgl-engine/lib/PathCapBuilder ../../webgl-engine/lib/PathExtruder ../../webgl-engine/lib/PathGeometry ../../webgl-engine/lib/PathGeometryData ../../webgl-engine/lib/pathGeometryUtils ../../webgl-engine/lib/PathProfile ../../webgl-engine/lib/PathVertex ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/DefaultMaterial ../../webgl-engine/materials/PathMaterial".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P){function M(S,V,T){const {origin:Y,positions:ha}=S;let ba=S.offset;switch(V){default:case H.UpVectorAlignment.World:for(const U of S.vertices)Q[0]=ha[ba++]+Y[0],Q[1]=ha[ba++]+Y[1],Q[2]=ha[ba++]+Y[2],T.worldUpAtPosition(Q,Q),U.setFrameFromUpVector(Q);break;case H.UpVectorAlignment.Path:Q[0]=ha[ba]+Y[0],Q[1]=ha[ba+1]+Y[1],Q[2]=ha[ba+2]+Y[2],T.worldUpAtPosition(Q,Q),E.computeMinimumRotationTangentFrame(S,Q)}}function K(S,
V,T){switch(S){case "symbol-value":return T;case "proportional":return V;default:return S}}const J=["polyline"];class R extends m.Graphics3DSymbolLayer{constructor(S,V,T,Y){super(S,V,T,Y);this._intrinsicSize=h.fromValues(1,1);this._upVectorAlignment=H.UpVectorAlignment.Path;this._stencilWidth=.1;this.usedMemory=0;this.ensureDrapedStatus(!1)}async doLoad(){var S=null!=this.symbolLayer.width?this.symbolLayer.width:this.symbolLayer.height;const V=null!=this.symbolLayer.height?this.symbolLayer.height:
S;this._vvConvertOptions=new u.ConvertOptions({size:!0,color:!0,rotation:!1,opacity:!0},[1,1,1],[S,1,V],this._context.renderCoordsHelper.unitInMeters);this._fastUpdates=0<this._context.renderer?.visualVariables?.length?u.initFastSymbolUpdatesState(this._context.renderer,this._vvConvertOptions):null;var T=this.symbolLayer.anchor||"center";this._upVectorAlignment="heading"===this.symbolLayer.profileRotation?H.UpVectorAlignment.World:H.UpVectorAlignment.Path;var Y=this.symbolLayer.profile||"circle";
switch(Y){default:case "circle":this._profile=G.circleProfiles[T];break;case "quad":this._profile=G.quadProfiles[T]}switch(this.symbolLayer.join){case "round":this._extruder=new F.MiterExtruder(0,v.pathNumRoundJoinSubdivisions);break;case "bevel":this._extruder=new F.MiterExtruder(0,1);break;case "miter":this._extruder=new F.MiterExtruder(.8*Math.PI,1);break;default:this._extruder=new F.SimpleExtruder}T=this.symbolLayer.cap||"butt";switch(T){case "none":this._startCap=new D.NoCapBuilder;this._endCap=
new D.NoCapBuilder;break;default:this._startCap=new D.TriangulationCapBuilder(this._profile,0);this._endCap=new D.TriangulationCapBuilder(this._profile,0,!0);break;case "square":this._startCap=new D.TriangulationCapBuilder(this._profile,-.5);this._endCap=new D.TriangulationCapBuilder(this._profile,.5,!0);break;case "round":Y="quad"===Y,this._startCap=new D.RoundCapBuilder({profile:this._profile,flip:!1,breakNormals:Y,subdivisions:v.pathNumRoundCapExtrusionSubdivisions}),this._endCap=new D.RoundCapBuilder({profile:this._profile,
flip:!0,breakNormals:Y,subdivisions:v.pathNumRoundCapExtrusionSubdivisions})}var ha=this._getCombinedOpacityAndColor(this.symbolLayer?.material?.color);Y=c.fromArray(ha);ha=ha[3];const ba=1>ha||this.needsDrivenTransparentPass;T={diffuse:Y,ambient:Y,opacity:ha,transparent:ba,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,cullFace:ba||"none"===T?z.CullFaceOptions.None:z.CullFaceOptions.Back,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&&
(k.set(this._intrinsicSize,S,V),!r.isValidSize(this._intrinsicSize[0])||!r.isValidSize(this._intrinsicSize[1])))throw new q("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");this._fastUpdates?.visualVariables.size||k.scale(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters);this._fastUpdates?(S={...T,...this._fastUpdates.materialParameters,size:h.fromArray(this._intrinsicSize)},this._materials[0]=new P.PathMaterial(S)):(T.hasVertexColors=
this._drivenProperties.color||this._drivenProperties.opacity,T.normalType=y.NormalType.Compressed,this._materials[0]=new L.DefaultMaterial(T));this._materials[0].setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0});this._context.stage.add(this._materials[0])}destroy(){super.destroy();this._context.stage.remove(this._materials[0]);this._materials[0]=null;this._materials.length=0}createGraphics3DGraphic(S){const V=S.graphic;if(!this._validateGeometry(V.geometry,J,this.symbolLayer.type))return null;
const T=this.setGraphicElevationContext(V);return this._createAs3DShape(V,S.renderingInfo,T,V.uid)}layerOpacityChanged(){const S=this._getCombinedOpacity(this.symbolLayer?.material?.color),V=1>S||this.needsDrivenTransparentPass;this._materials[0]?.setParameters({opacity:S,transparent:V})}layerElevationInfoChanged(S,V){return this.updateGraphics3DGraphicElevationInfo(S,V,t.needsElevationUpdates3D)}slicePlaneEnabledChanged(){this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});
return!0}physicalBasedRenderingChanged(){this._materials[0]?.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0});return!0}applyRendererDiff(S,V){for(const T in S.diff)switch(T){case "visualVariables":if(u.updateFastSymbolUpdatesState(this._fastUpdates,V,this._vvConvertOptions))this._materials[0]?.setParameters(this._fastUpdates.materialParameters);else return n.ApplyRendererDiffResult.RecreateSymbol;break;default:return n.ApplyRendererDiffResult.RecreateSymbol}return n.ApplyRendererDiffResult.FastUpdate}_getVertexData(S){let V=
0;const T=S.paths,Y=[],ha=S.spatialReference,ba=this._context.elevationProvider.spatialReference,U=this._context.renderCoordsHelper.spatialReference;for(var Z of T)V+=Z.length;Z=d.newDoubleArray(3*V);let ca=0;for(const ea of T){Y.push({offset:ca,numVertices:ea.length});for(const da of ea)Z[ca++]=da[0],Z[ca++]=da[1],Z[ca++]=S.hasZ?da[2]:0}if(null!=ba&&!ha.equals(ba)&&!e.projectBuffer(Z,ha,0,Z,ba,0,V))return null;null==ba||ba.equals(U)?S=d.doubleArrayFrom(Z):(S=d.newDoubleArray(3*V),e.projectBuffer(Z,
ba,0,S,U,0,V));return{pathVertexDataInfos:Y,vertexDataES:Z,vertexDataRS:S}}_createAs3DShape(S,V,T,Y){this.usedMemory=0;var ha=S.geometry;const ba=this._getVertexData(ha);if(null==ba)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(0===ba.pathVertexDataInfos.length)return 0!==ha.paths.length&&ha.paths.some(X=>0<X.length)||this.logger.warn("PathSymbol3DLayer geometry failed to be created (no paths were defined)"),
null;var U=[];ha=ha.spatialReference;const Z=g.create(),ca=this._context.renderCoordsHelper,ea=new x.SamplePosition(ba.vertexDataES);for(const X of ba.pathVertexDataInfos){var da=X.numVertices;if(!(2>da)){var ia=X.offset;if(null!=this._context.clippingExtent&&(g.empty(Z),g.expandWithBuffer(Z,ba.vertexDataES,ia,da),!g.intersectsClippingArea(Z,this._context.clippingExtent)))continue;var ka=[];da=ia+3*da;for(var fa=ia;fa<da;fa+=3){ea.offset=fa;const ja=t.evaluateElevationAlignmentAtPoint(ea,this._context.elevationProvider,
T,ca);f.set(Q,ba.vertexDataRS[fa],ba.vertexDataRS[fa+1],ba.vertexDataRS[fa+2]);ca.setAltitude(Q,ja);ba.vertexDataRS[fa]=Q[0];ba.vertexDataRS[fa+1]=Q[1];ba.vertexDataRS[fa+2]=Q[2];ka.push(I.newPathVertex(this._upVectorAlignment))}ia=new B.Path(ka,ba.vertexDataES,ba.vertexDataRS,ia);M(ia,this._upVectorAlignment,this._context.renderCoordsHelper);ia=new C.PathBuilder(ia,this._profile,this._extruder,this._startCap,this._endCap);ka=null;this._fastUpdates?(fa=this._fastUpdates.visualVariables,ka=u.getAttributeValue(fa.size?.field,
S)??0,da=u.getAttributeValue(fa.color?.field,S)??0,fa=u.getAttributeValue(fa.opacity?.field,S)??0,ka=new N.FastUpdatePathGeometry(ia,ka,da,fa)):(ka=[this._intrinsicSize[0],this._intrinsicSize[1]],this._drivenProperties.size&&(da=V.size,ka[0]*=K(da[0],"symbol-value"===da[2]?this.symbolLayer.height||0:da[2],this.symbolLayer.width||0),ka[1]*=K(da[2],"symbol-value"===da[0]?this.symbolLayer.width||0:da[0],this.symbolLayer.height||0)),da=void 0,this._drivenProperties.color&&(da=V.color),this._drivenProperties.opacity&&
null!=V.opacity&&(da=da?[da[0],da[1],da[2],V.opacity]:[1,1,1,V.opacity]),fa=new N.StaticPathGeometry(ia),fa.bake(ka),da&&fa.bakeVertexColors(da),ka=fa);da=ka.createGeometryData();fa=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:Y,layerUid:this._context.layer.uid});ka=new H.PathGeometry(this._materials[0],da,ka,ha,this._stencilWidth,fa);ka.transformation=l.translate(p.create(),p.IDENTITY,ia.path.origin);U.push(ka);this.usedMemory+=ia.usedMemory}}if(0===U.length)return null;S=
new A.Object3D({geometries:U,layerUid:this._context.layer.uid,graphicUid:Y});U=new w.Graphics3DObject3DGraphicLayer(this,S,U,null,null,(X,ja,la,na,va)=>{ja=this._upVectorAlignment;X=X.stageObject;la=X.geometries;var za=0;for(const xa of la){if(!H.isPathGeometry(xa))continue;const Ma=xa.path,Ga=Ma.builder.path;var ya=Ga,Da=na,ra=va;let Pa=0;const {origin:Qa,vertices:Ea,positions:ua,positionsES:Na}=ya,Ua=ya.offset+3*Ea.length;for(let wa=ya.offset;wa<Ua;wa+=3)f.set(Q,Na[wa],Na[wa+1],Na[wa+2]),Da(Q,W),
Pa+=W.sampledElevation,Q[0]=ua[wa]+Qa[0],Q[1]=ua[wa+1]+Qa[1],Q[2]=ua[wa+2]+Qa[2],ra.setAltitude(Q,W.z),ua[wa]=Q[0]-Qa[0],ua[wa+1]=Q[1]-Qa[1],ua[wa+2]=Q[2]-Qa[2];ya.updatePathVertexInformation();za+=Pa/Ea.length;ja!==H.UpVectorAlignment.World&&M(Ga,ja,va);Ma.onPathChanged(xa);xa.invalidateBoundingInfo();X.geometryVertexAttributeUpdated(xa,O.VertexAttribute.POSITION)}return za/la.length},T);U.alignedSampledElevation=0;U.needsElevationUpdates=t.needsElevationUpdates3D(T.mode);return U}}const Q=c.create(),
W=new t.SampleElevationInfo;a.Graphics3DPathSymbolLayer=R;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Path":function(){define(["exports","../../../../core/typedArrayUtil","../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64","../../../../geometry/support/FloatArray"],function(a,b,q,l,p){class k{constructor(h,f,c,e){this.vertices=h;this.positionsES=f;this.offset=e;var g=h.length;e=this.offset+3*Math.floor(g/2);h=c[e];f=
c[e+1];e=c[e+2];this.origin=l.fromValues(h,f,e);this.positions=p.newFloatArray(3*g);g=this.offset+3*g;for(let d=this.offset;d<g;d+=3)this.positions[d]=c[d]-h,this.positions[d+1]=c[d+1]-f,this.positions[d+2]=c[d+2]-e;this.updatePathVertexInformation()}get usedMemory(){return b.estimateSize(this.positions)}updatePathVertexInformation(){const h=this.vertices.length;var f=this.vertices[0];let c=this.offset;const e=this.positions;f.vRight[0]=e[c+3]-e[c];f.vRight[1]=e[c+4]-e[c+1];f.vRight[2]=e[c+5]-e[c+
2];c+=3;let g=q.length(f.vRight);f.vMinSiblingLength=g;q.normalize(f.vRight,f.vRight);var d=f;for(f=1;f<h;++f){const t=this.vertices[f];t.vLeft=d.vRight;f<h-1?(t.vRight[0]=e[c+3]-e[c],t.vRight[1]=e[c+4]-e[c+1],t.vRight[2]=e[c+5]-e[c+2],d=q.length(t.vRight),t.vMinSiblingLength=Math.min(g,d),g=d,q.normalize(t.vRight,t.vRight)):(q.copy(t.vRight,t.vLeft),t.vMinSiblingLength=g);d=t;c+=3}}}a.Path=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/PathBuilder":function(){define(["exports",
"../../../../core/typedArrayUtil","../../../../geometry/support/FloatArray","../../../../geometry/support/Indices"],function(a,b,q,l){class p{constructor(k,h,f,c,e,g={}){this.path=k;this.profile=h;this.extruder=f;this.startCap=c;this.endCap=e;this.options=g;this._extrusionVertexCount=0;c=this.path.vertices.length-2;this.numExtrusionProfiles=f.numProfilesPerJoin()*c+2;this.numVerticesTotal=h.vertices.length*this.numExtrusionProfiles;this.startCap.vertexBufferStart=this.numVerticesTotal;this.numVerticesTotal+=
this.startCap.numVertices;this.endCap.vertexBufferStart=this.numVerticesTotal;this.numVerticesTotal+=this.endCap.numVertices;this.pathVertexData=l.newIntArray(1*this.numVerticesTotal);this.profileRightAxes=q.newFloatArray(4*this.numVerticesTotal);this.profileUpAxes=q.newFloatArray(4*this.numVerticesTotal);this.profileVertexAndNormals=q.newFloatArray(4*this.numVerticesTotal);this.positions=q.floatSubArray(k.positions,k.offset,3*k.vertices.length);this._rebuildGeometry();this.buildTopology()}get usedMemory(){return b.estimateSize(this.pathVertexData,
this.profileRightAxes,this.profileUpAxes,this.profileVertexAndNormals)+this.path.usedMemory+this.profile.usedMemory}emitVertex(k,h,f,c,e){const g=4*this._extrusionVertexCount;this.profileRightAxes[g]=h.right[0];this.profileRightAxes[g+1]=h.right[1];this.profileRightAxes[g+2]=h.right[2];this.profileUpAxes[g]=h.up[0];this.profileUpAxes[g+1]=h.up[1];this.profileUpAxes[g+2]=h.up[2];this.profileVertexAndNormals[g]=f[0];this.profileVertexAndNormals[g+1]=f[1];this.profileVertexAndNormals[g+2]=c[0];this.profileVertexAndNormals[g+
3]=c[1];this.pathVertexData[this._extrusionVertexCount]=k;e?(k=this.path.vertices[k],h=k.maxStretchDistance,this.profileRightAxes[g+3]=k.rotationRight[0]*h,this.profileUpAxes[g+3]=k.rotationRight[1]*h):(this.profileRightAxes[g+3]=0,this.profileUpAxes[g+3]=0);++this._extrusionVertexCount}emitCapVertex(k,h,f,c,e,g){const d=4*this._extrusionVertexCount;this.profileRightAxes[d]=h.right[0];this.profileRightAxes[d+1]=h.right[1];this.profileRightAxes[d+2]=h.right[2];this.profileRightAxes[d+3]=e;this.profileUpAxes[d]=
h.up[0];this.profileUpAxes[d+1]=h.up[1];this.profileUpAxes[d+2]=h.up[2];this.profileUpAxes[d+3]=g;this.profileVertexAndNormals[d]=f[0];this.profileVertexAndNormals[d+1]=f[1];this.profileVertexAndNormals[d+2]=c[0];this.profileVertexAndNormals[d+3]=c[1];this.pathVertexData[this._extrusionVertexCount]=k;++this._extrusionVertexCount}_rebuildGeometry(){this._extrusionVertexCount=0;const {positions:k,offset:h,vertices:f}=this.path;this.positions=q.floatSubArray(k,h,3*f.length);let c=0;const e=(d,t,w,v,
m)=>this.emitCapVertex(c,d,t,w,v,m),g=(d,t,w,v)=>this.emitVertex(c,d,t,w,v);this.startCap.rebuildConnectingProfileGeometry(f[c],this.profile,e);for(c=1;c<f.length-1;++c)this.extruder.extrude(f[c],this.profile,g);this.endCap.rebuildConnectingProfileGeometry(f[c],this.profile,e);c=0;this.startCap.rebuildCapGeometry(f[c],e);c=f.length-1;this.endCap.rebuildCapGeometry(f[c],e)}buildTopology(){const k=this.profile.vertices.length,h=this.profile.numSegments,f=this.numExtrusionProfiles-1;var c=h*f*6;this.startCap.indexBufferStart=
c;this.startCap.firstProfileVertexIndex=0;c+=this.startCap.numIndices;this.endCap.indexBufferStart=c;this.endCap.firstProfileVertexIndex=k*(this.numExtrusionProfiles-1);const e=[],g=[],d=[];c=(t,w,v)=>{e.push(t);e.push(w);e.push(v);g.push(t);g.push(w);g.push(v);d.push(this.pathVertexData[t]);d.push(this.pathVertexData[w]);d.push(this.pathVertexData[v])};for(let t=0;t<h;++t){const w=this.profile.indices[2*t],v=this.profile.indices[2*t+1];for(let m=0;m<f;++m){const r=m*k+w,n=(m+1)*k+v,u=m*k+v;c(r,(m+
1)*k+w,n);c(r,n,u)}}this.startCap.buildTopology(this.path.vertices[0],c);this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],c);this.vertexIndices=l.compactIndices(e);this.normalIndices=l.compactIndices(g);this.pathVertexIndices=l.compactIndices(d)}onPathChanged(){this._rebuildGeometry()}}a.PathBuilder=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/PathCapBuilder":function(){define(["exports","../../../../core/libs/gl-matrix-2/math/vec2",
"../../../../core/libs/gl-matrix-2/factories/vec2f64"],function(a,b,q){class l{rebuildConnectingProfileGeometry(e,g,d){for(let t=0;t<g.vertices.length;++t)d(e.frame,g.vertices[t],g.normals[t],0,0)}}class p extends l{constructor(){super();this.numIndices=this.numVertices=0}rebuildCapGeometry(){}buildTopology(){}}class k extends l{constructor(e,g=0,d=!1){super();this.profile=e;this.profilePlaneOffset=g;this.flip=d}get numVertices(){return this.profile.vertices.length}get numIndices(){return 3*this.profile.numSegments}rebuildConnectingProfileGeometry(e,
g,d){const t=this.profilePlaneOffset;for(let w=0;w<g.vertices.length;++w)d(e.frame,g.vertices[w],g.normals[w],t,0)}rebuildCapGeometry(e,g){const d=this.profile,t=this.flip?1:-1,w=this.profilePlaneOffset,v=c;b.set(v,0,0);for(let m=0;m<d.vertices.length;++m)g(e.frame,d.vertices[m],v,w,t)}buildTopology(e,g){e=this.profile;const d=this.vertexBufferStart+e.indices[0];for(let t=1;t<e.numSegments;++t){const w=this.vertexBufferStart+e.indices[2*t],v=this.vertexBufferStart+e.indices[2*t+1];this.flip?g(v,w,
d):g(d,w,v)}}}class h extends l{constructor(e){super();this.flip=!1;this.sign=0;this.breakNormals=!1;this.numSegments=3;this.profile=e.profile;this.sign=(this.flip=e.flip)?1:-1;this.breakNormals=e.breakNormals;this.numSegments=e.subdivisions}get numVertices(){let e=this.profile.vertices.length*(this.numSegments-1)+this.profile.poles.length;this.breakNormals&&(e+=this.profile.vertices.length);return e}get numIndices(){let e;const g=this.profile;e=2*g.numSegments*(this.numSegments-1);for(let d=0;d<
g.numSegments;++d)e=g.poleIndices[g.indices[2*d]]===g.poleIndices[g.indices[2*d+1]]?e+1:e+2;return 3*e}rebuildCapGeometry(e,g){const d=this.profile;e=e.frame;const t=.5*this.sign,w=f,v=c;b.set(v,0,0);for(var m of d.poles)m.normal?g(e,m.position,m.normal,t,0):g(e,m.position,v,t,this.sign);if(this.breakNormals)for(m=0;m<d.vertices.length;++m)g(e,d.vertices[m],d.normals[m],0,0);for(m=0;m<this.numSegments-1;++m){var r=(1-(m+1)/this.numSegments)*Math.PI*.5;const n=Math.sin(r);r=Math.cos(r);for(let u=0;u<
d.vertices.length;++u){const x=d.poles[d.poleIndices[u]];b.subtract(w,d.vertices[u],x.position);b.scale(w,w,n);x.normal?(b.add(w,w,x.position),g(e,w,x.normal,t*r,0)):(b.normalize(v,w),b.scale(v,v,n),b.add(w,w,x.position),g(e,w,v,t*r,this.sign*r))}}}buildTopology(e,g){e=this.profile;const d=this.breakNormals?this.vertexBufferStart+e.poles.length:this.firstProfileVertexIndex,t=this.breakNormals?this.vertexBufferStart+e.poles.length+e.vertices.length:this.vertexBufferStart+e.poles.length;for(let w=0;w<
e.numSegments;++w){const v=e.indices[2*w],m=e.indices[2*w+1],r=this.vertexBufferStart+e.poleIndices[v],n=this.vertexBufferStart+e.poleIndices[m];let u=d+v,x=d+m;for(let y=0;y<this.numSegments-1;++y){const z=t+y*e.vertices.length+v,A=t+y*e.vertices.length+m;this.flip?(g(z,x,u),g(x,z,A)):(g(u,x,z),g(A,z,x));u=z;x=A}this.flip?(g(r,x,u),r!==n&&g(r,n,x)):(g(u,x,r),r!==n&&g(x,n,r))}}}const f=q.create(),c=q.create();a.NoCapBuilder=p;a.PathCapBuilder=l;a.RoundCapBuilder=h;a.TriangulationCapBuilder=k;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/PathExtruder":function(){define("exports ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64".split(" "),function(a,b,q,l,p,k,h){class f{}class c{numProfilesPerJoin(){return 1}extrude(v,m,r){for(let n=0;n<m.vertices.length;++n)r(v.frame,
m.vertices[n],m.normals[n],!1)}}class e{constructor(v,m){this.cutoffAngle=v;this.numBendSubdivisions=m}numProfilesPerJoin(){return this.numBendSubdivisions+1}extrude(v,m,r){var n=w;const {rotationAngle:u,rotationRight:x,frame:y}=v;if(Math.abs(u)>=this.cutoffAngle){var z=v.rotationFrameUp;for(var A=0;A<this.numBendSubdivisions+1;++A){b.fromRotation(t,.5*-u+A*u/this.numBendSubdivisions,z);var B=n,C=y,D=t;k.transformMat4(B.up,C.up,D);k.transformMat4(B.right,C.right,D);for(B=0;B<m.vertices.length;++B)0<=
l.dot(m.vertices[B],x)*u?r(n,m.vertices[B],m.normals[B],!1):(C=v.applyMiterStretch(d,m.vertices[B]),r(y,C,m.normals[B],!0))}}else for(n=0;n<this.numBendSubdivisions+1;++n)for(z=0;z<m.vertices.length;++z)A=0<=l.dot(m.vertices[z],x)*u,B=v.applyMiterStretch(d,m.vertices[z]),r(y,B,m.normals[z],!A)}}class g{constructor(){this.up=h.create();this.right=h.create()}}const d=p.create(),t=q.create(),w=new g;a.Frame2D=g;a.MiterExtruder=e;a.PathExtruder=f;a.SimpleExtruder=c;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/webgl-engine/lib/PathGeometry":function(){define(["exports","./ContentObjectType","./Geometry"],function(a,b,q){class l extends q.Geometry{constructor(p,k,h,f,c,e){super(p,k,null,b.ContentObjectType.Mesh,e);this.path=h;this.geometrySR=f;this.stencilWidth=c}}a.UpVectorAlignment=void 0;(function(p){p[p.World=0]="World";p[p.Path=1]="Path"})(a.UpVectorAlignment||(a.UpVectorAlignment={}));a.PathGeometry=l;a.isPathGeometry=function(p){return"path"in p};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/PathGeometryData":function(){define("exports ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/support/FloatArray ../../../../geometry/support/Indices ./Attribute ./Normals ./RayIntersections ./VertexAttribute".split(" "),function(a,
b,q,l,p,k,h,f,c,e,g,d){class t{constructor(A){this.builder=A}onPathChanged(A){this.builder.onPathChanged()}}class w extends t{constructor(A){super(A);this.vertexAttributeColor=k.fromValues(255,255,255,255);this.size=[];this.vertexAttributePosition=h.newFloatArray(3*this.builder.numVerticesTotal);this.vertexAttributeNormal=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(A){this.vertexAttributeColor[0]=255*A[0];this.vertexAttributeColor[1]=255*A[1];this.vertexAttributeColor[2]=255*
A[2];this.vertexAttributeColor[3]=255*(3<A.length?A[3]:1)}bake(A){this.size=A;const {numVerticesTotal:B,pathVertexData:C,path:D,positions:F,profileRightAxes:H,profileUpAxes:N,profileVertexAndNormals:E}=this.builder;for(let L=0;L<B;++L){var G=C[L],I=0===G||G===D.vertices.length-1;G*=3;const P=x;let M=0,K=0;const J=4*L,R=l.set(y,H[J],H[J+1],H[J+2]),Q=l.set(z,N[J],N[J+1],N[J+2]);var O=b.set(m,E[J]*A[0],E[J+1]*A[1]);if(I)l.cross(P,Q,R),M=H[J+3]*A[0],K=N[J+3];else{I=r;const W=n;b.set(I,H[J+3],N[J+3]);
const S=b.length(I);b.normalize(I,I);const V=b.dot(O,I);if(Math.abs(V)>S){b.set(W,-I[1],I[0]);const T=b.dot(O,W);b.scale(I,I,S*Math.sign(V));b.scale(W,W,T);b.add(O,I,W)}l.set(P,0,0,0)}O=l.set(u,R[0]*O[0]+Q[0]*O[1],R[1]*O[0]+Q[1]*O[1],R[2]*O[0]+Q[2]*O[1]);I=3*L;this.vertexAttributePosition[I]=F[G]+O[0]+P[0]*M;this.vertexAttributePosition[I+1]=F[G+1]+O[1]+P[1]*M;this.vertexAttributePosition[I+2]=F[G+2]+O[2]+P[2]*M;G=b.set(m,E[J+2],E[J+3]);e.compressNormal(this.vertexAttributeNormal,L,R[0]*G[0]+Q[0]*
G[1]+P[0]*K,R[1]*G[0]+Q[1]*G[1]+P[1]*K,R[2]*G[0]+Q[2]*G[1]+P[2]*K)}}createGeometryData(){const A=this.builder.vertexIndices.length,{normalIndices:B,vertexIndices:C}=this.builder;return[[d.VertexAttribute.POSITION,new c.Attribute(this.vertexAttributePosition,C,3,!0)],[d.VertexAttribute.NORMALCOMPRESSED,new c.Attribute(this.vertexAttributeNormal,B,2,!0)],[d.VertexAttribute.COLOR,new c.Attribute(this.vertexAttributeColor,f.getZeroIndexArray(A),4)]]}onPathChanged(A){super.onPathChanged(A);this.bake(this.size)}intersect(A,
B,C,D){const F=this.builder.vertexIndices,H=new c.Vertices(this.vertexAttributePosition,3);g.intersectTriangles(A,B,0,F.length/3,F,H,void 0,C,(N,E,G)=>{D(N,G,E,!1)})}}class v extends t{constructor(A,B,C,D){super(A);this.sizeAttributeValue=B;this.colorAttributeValue=C;this.opacityAttributeValue=D;this.vvData=null;this.baked=new w(A);this.vvData=h.newFloatArray(4*this.builder.path.vertices.length);for(A=0;A<this.builder.path.vertices.length;++A)this.vvData[4*A]=B,this.vvData[4*A+1]=C,this.vvData[4*
A+2]=D,this.vvData[4*A+3]=0===A||A===this.builder.path.vertices.length-1?1:0}createGeometryData(){const {positions:A,profileRightAxes:B,profileUpAxes:C,profileVertexAndNormals:D,pathVertexIndices:F,vertexIndices:H}=this.builder;return[[d.VertexAttribute.POSITION,new c.Attribute(A,F,3,!0)],[d.VertexAttribute.PROFILERIGHT,new c.Attribute(B,H,4,!0)],[d.VertexAttribute.PROFILEUP,new c.Attribute(C,H,4,!0)],[d.VertexAttribute.PROFILEVERTEXANDNORMAL,new c.Attribute(D,H,4,!0)],[d.VertexAttribute.FEATUREVALUE,
new c.Attribute(this.vvData,F,4,!0)]]}onPathChanged(A){super.onPathChanged(A);if(A=A.getMutableAttribute(d.VertexAttribute.POSITION))A.data=this.builder.positions}}const m=q.create(),r=q.create(),n=q.create(),u=p.create(),x=p.create(),y=p.create(),z=p.create();a.FastUpdatePathGeometry=v;a.PathGeometryData=t;a.StaticPathGeometry=w;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/pathGeometryUtils":function(){define("exports ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/plane ../../../../geometry/support/ray ./GeometryUtil".split(" "),
function(a,b,q,l,p,k){const h=q.create();a.computeMinimumRotationTangentFrame=function(f,c){let e=null;const g=f.vertices.length,d=q.create(),t=q.create(),w=q.create(),v=q.create(),m=q.create(),r=q.create(),n=l.create();let u=f.vertices[0];b.copy(t,c);b.set(d,0,1,0);k.makeOrthoBasisDirUpFallback(u.vRight,t,d,d,w,t,.99619469809);b.copy(u.frame.up,t);b.copy(u.frame.right,w);c=f.positions;let x=f.offset;e=u;for(let z=1;z<g;++z){u=f.vertices[z];b.add(m,u.vLeft,u.vRight);var y=b.length(m);0<y?(y=1/Math.sqrt(y),
m[0]*=y,m[1]*=y,m[2]*=y):(m[0]=u.vRight[0],m[1]=u.vRight[1],m[2]=u.vRight[2]);r[0]=c[x]+e.frame.up[0];r[1]=c[x+1]+e.frame.up[1];r[2]=c[x+2]+e.frame.up[2];x+=3;y=b.set(h,c[x],c[x+1],c[x+2]);l.fromPositionAndNormal(y,m,n);l.intersectRay(n,p.wrap(r,u.vLeft),v)?(v[0]-=c[x],v[1]-=c[x+1],v[2]-=c[x+2],b.normalize(t,v),b.cross(w,m,t),b.normalize(w,w)):k.makeOrthoBasisDirUpFallback(m,e.frame.up,e.frame.right,d,w,t,.99619469809);b.copy(u.frame.up,t);b.copy(u.frame.right,w);e=u}};Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/webgl-engine/lib/PathProfile":function(){define(["exports","../../../../core/typedArrayUtil","../../../../core/libs/gl-matrix-2/factories/vec2f64","../../layers/graphics/Graphics3DPathSymbolLayerConstants"],function(a,b,q,l){function p(g){const d=l.pathNumCircleProfileSubdivisions,t=new h,w={v0:0,v1:0};t.addPole(q.fromValues(0,0));for(var v=0;v<d;++v){var m=2*v*Math.PI/d,r=Math.cos(m);const n=Math.sin(m);m=q.fromValues(.5*r,.5*n);r=q.fromValues(r,n);t.addVertex(m,
r)}for(v=0;v<d-1;++v)t.addSegment({v0:v,v1:v+1},w);t.addSegment({v0:d-1,v1:0},w);"center"!==g&&(g=f[g],t.translate(g[0],g[1]));return t}function k(g){const d=new h,t=q.fromValues(-.5,-.5),w=q.fromValues(.5,-.5),v=q.fromValues(.5,.5),m=q.fromValues(-.5,.5),r=q.fromValues(0,-1),n=q.fromValues(1,0),u=q.fromValues(0,1),x=q.fromValues(-1,0);d.addPole(q.fromValues(0,.5),u);d.addPole(q.fromValues(0,.5));d.addPole(q.fromValues(0,-.5));d.addPole(q.fromValues(0,-.5),r);d.addVertex(t,r);d.addVertex(w,r);d.addSegment({v0:0,
v1:1},{v0:3,v1:3});d.addVertex(w,n);d.addVertex(v,n);d.addSegment({v0:2,v1:3},{v0:2,v1:1});d.addVertex(v,u);d.addVertex(m,u);d.addSegment({v0:4,v1:5},{v0:0,v1:0});d.addVertex(m,x);d.addVertex(t,x);d.addSegment({v0:6,v1:7},{v0:1,v1:2});"center"!==g&&(g=f[g],d.translate(g[0],g[1]));return d}class h{constructor(){this.vertices=[];this.normals=[];this.indices=[];this.poles=[];this.poleIndices=[]}addVertex(g,d){this.vertices.push(q.clone(g));this.normals.push(q.clone(d));return this.vertices.length-1}addPole(g,
d=null){this.poles.push({position:q.clone(g),normal:d?q.clone(d):null});return this.poles.length-1}addSegment(g,d=null){this.indices.push(g.v0);this.indices.push(g.v1);d&&(this.poleIndices.push(d.v0),this.poleIndices.push(d.v1))}get numSegments(){return this.indices.length/2}translate(g,d){for(const t of this.vertices)t[0]+=g,t[1]+=d;for(const t of this.poles)t.position[0]+=g,t.position[1]+=d}get usedMemory(){return this.vertices.length*b.estimateSize(this.vertices[0])*2+b.estimateSize(this.indices)}}
const f={top:[0,-.5],bottom:[0,.5]},c={center:p("center"),top:p("top"),bottom:p("bottom")},e={center:k("center"),top:k("top"),bottom:k("bottom")};a.PathProfile=h;a.circleProfiles=c;a.quadProfiles=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/PathVertex":function(){define("exports ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/mat2 ../../../../core/libs/gl-matrix-2/factories/mat2f64 ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ./PathExtruder ./PathGeometry".split(" "),
function(a,b,q,l,p,k,h,f,c,e){class g{constructor(){this.vLeft=f.create();this.vRight=f.create();this.vMinSiblingLength=0;this.frame=new c.Frame2D}setFrameFromUpVector(C){h.copy(this.frame.up,C);h.add(z,this.vLeft,this.vRight);h.normalize(z,z);h.scale(y,this.frame.up,h.dot(z,this.frame.up));h.subtract(A,z,y);h.normalize(A,A);h.cross(this.frame.right,A,this.frame.up)}get foldingAngle(){return Math.PI-this.rotationAngle}}class d extends g{get rotationFrameUp(){return this.frame.up}get rotationRight(){return k.UNIT_X}get rotationAngle(){h.scale(u,
this.frame.up,h.dot(this.frame.up,this.vLeft));h.subtract(u,this.vLeft,u);h.negate(u,u);h.normalize(u,u);h.scale(x,this.frame.up,h.dot(this.frame.up,this.vRight));h.subtract(x,this.vRight,x);h.normalize(x,x);h.cross(n,this.rotationFrameUp,this.vLeft);return Math.sign(h.dot(n,this.vRight))*(Math.PI-b.acosClamped(h.dot(u,x)))}get maxStretchDistance(){return Math.abs(this.vMinSiblingLength/Math.cos(.5*this.foldingAngle))}applyMiterStretch(C,D){var F=this.rotationAngle;if(0>=Math.abs(F))return D;F=b.reciprocalClamped(Math.cos(.5*
F));return p.set(C,(1+(F-1))*D[0],D[1])}}class t extends g{get rotationFrameUp(){const C=Math.sign(h.dot(this.frame.right,this.vRight));h.cross(w,this.vRight,this.vLeft);h.scale(w,w,C);return h.normalize(w,w)}get rotationRight(){var C=this.rotationFrameUp,D=h.dot(C,this.frame.up);C=h.dot(C,this.frame.right);h.scale(m,this.frame.up,-C);h.scale(r,this.frame.right,D);h.add(m,m,r);h.normalize(m,m);D=this.frame;C=m;p.set(v,h.dot(C,D.right),h.dot(C,D.up));return v}get rotationAngle(){const C=Math.sign(h.dot(this.frame.right,
this.vRight));h.negate(n,this.vLeft);return-C*(Math.PI-b.acosClamped(h.dot(n,this.vRight)))}get maxStretchDistance(){return Math.abs(this.vMinSiblingLength*b.reciprocalClamped(Math.cos(.5*this.foldingAngle)))}applyMiterStretch(C,D){var F=this.rotationAngle;if(0===Math.abs(F))return D;F=b.reciprocalClamped(Math.cos(.5*F));const H=this.rotationRight;F=q.set(B,1+(F-1)*H[0]*H[0],(F-1)*H[0]*H[1],(F-1)*H[0]*H[1],1+(F-1)*H[1]*H[1]);return p.transformMat2(C,D,F)}}const w=f.create(),v=k.create(),m=f.create(),
r=f.create(),n=f.create(),u=f.create(),x=f.create(),y=f.create(),z=f.create(),A=f.create(),B=l.create();a.PathVertex=g;a.newPathVertex=function(C){switch(C){case e.UpVectorAlignment.World:return new d;case e.UpVectorAlignment.Path:return new t}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/math/mat2":function(){define(["exports","./common"],function(a,b){function q(C,D){C[0]=D[0];C[1]=D[1];C[2]=D[2];C[3]=D[3];return C}function l(C){C[0]=1;C[1]=0;C[2]=
0;C[3]=1;return C}function p(C,D,F,H,N){C[0]=D;C[1]=F;C[2]=H;C[3]=N;return C}function k(C,D){if(C===D){const F=D[1];C[1]=D[2];C[2]=F}else C[0]=D[0],C[1]=D[2],C[2]=D[1],C[3]=D[3];return C}function h(C,D){const F=D[0],H=D[1],N=D[2];D=D[3];let E=F*D-N*H;if(!E)return null;E=1/E;C[0]=D*E;C[1]=-H*E;C[2]=-N*E;C[3]=F*E;return C}function f(C,D){const F=D[0];C[0]=D[3];C[1]=-D[1];C[2]=-D[2];C[3]=F;return C}function c(C){return C[0]*C[3]-C[2]*C[1]}function e(C,D,F){const H=D[0],N=D[1],E=D[2];D=D[3];const G=F[0],
I=F[1],O=F[2];F=F[3];C[0]=H*G+E*I;C[1]=N*G+D*I;C[2]=H*O+E*F;C[3]=N*O+D*F;return C}function g(C,D,F){const H=D[0],N=D[1],E=D[2];D=D[3];const G=Math.sin(F);F=Math.cos(F);C[0]=H*F+E*G;C[1]=N*F+D*G;C[2]=H*-G+E*F;C[3]=N*-G+D*F;return C}function d(C,D,F){const H=D[1],N=D[2],E=D[3],G=F[0];F=F[1];C[0]=D[0]*G;C[1]=H*G;C[2]=N*F;C[3]=E*F;return C}function t(C,D){const F=Math.sin(D);D=Math.cos(D);C[0]=D;C[1]=F;C[2]=-F;C[3]=D;return C}function w(C,D){C[0]=D[0];C[1]=0;C[2]=0;C[3]=D[1];return C}function v(C){return"mat2("+
C[0]+", "+C[1]+", "+C[2]+", "+C[3]+")"}function m(C){return Math.sqrt(C[0]**2+C[1]**2+C[2]**2+C[3]**2)}function r(C,D,F,H){C[2]=H[2]/H[0];F[0]=H[0];F[1]=H[1];F[3]=H[3]-C[2]*F[1];return[C,D,F]}function n(C,D,F){C[0]=D[0]+F[0];C[1]=D[1]+F[1];C[2]=D[2]+F[2];C[3]=D[3]+F[3];return C}function u(C,D,F){C[0]=D[0]-F[0];C[1]=D[1]-F[1];C[2]=D[2]-F[2];C[3]=D[3]-F[3];return C}function x(C,D){return C[0]===D[0]&&C[1]===D[1]&&C[2]===D[2]&&C[3]===D[3]}function y(C,D){const F=C[0],H=C[1],N=C[2];C=C[3];const E=D[0],
G=D[1],I=D[2];D=D[3];const O=b.getEpsilon();return Math.abs(F-E)<=O*Math.max(1,Math.abs(F),Math.abs(E))&&Math.abs(H-G)<=O*Math.max(1,Math.abs(H),Math.abs(G))&&Math.abs(N-I)<=O*Math.max(1,Math.abs(N),Math.abs(I))&&Math.abs(C-D)<=O*Math.max(1,Math.abs(C),Math.abs(D))}function z(C,D,F){C[0]=D[0]*F;C[1]=D[1]*F;C[2]=D[2]*F;C[3]=D[3]*F;return C}function A(C,D,F,H){C[0]=D[0]+F[0]*H;C[1]=D[1]+F[1]*H;C[2]=D[2]+F[2]*H;C[3]=D[3]+F[3]*H;return C}const B=Object.freeze(Object.defineProperty({__proto__:null,LDU:r,
add:n,adjoint:f,copy:q,determinant:c,equals:y,exactEquals:x,frob:m,fromRotation:t,fromScaling:w,identity:l,invert:h,mul:e,multiply:e,multiplyScalar:z,multiplyScalarAndAdd:A,rotate:g,scale:d,set:p,str:v,sub:u,subtract:u,transpose:k},Symbol.toStringTag,{value:"Module"}));a.LDU=r;a.add=n;a.adjoint=f;a.copy=q;a.determinant=c;a.equals=y;a.exactEquals=x;a.frob=m;a.fromRotation=t;a.fromScaling=w;a.identity=l;a.invert=h;a.mat2=B;a.mul=e;a.multiply=e;a.multiplyScalar=z;a.multiplyScalarAndAdd=A;a.rotate=g;
a.scale=d;a.set=p;a.str=v;a.sub=u;a.subtract=u;a.transpose=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/factories/mat2f64":function(){define(["exports"],function(a){function b(){return[1,0,0,1]}function q(h){return[h[0],h[1],h[2],h[3]]}function l(h,f,c,e){return[h,f,c,e]}function p(h,f){return new Float64Array(h,f,4)}const k=Object.freeze(Object.defineProperty({__proto__:null,clone:q,create:b,createView:p,fromValues:l},Symbol.toStringTag,{value:"Module"}));
a.clone=q;a.create=b;a.createView=p;a.fromValues=l;a.mat2f64=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/PathMaterial":function(){define("exports ../../../../core/has ../../../../core/mathUtils ../../../../geometry/support/aaBoundingBox ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/shading/Normals.glsl ../lib/GLMaterial ../lib/Material ../lib/PathGeometry ../lib/RayIntersections ../lib/RenderSlot ../lib/VertexAttribute ./DefaultBufferWriter ./PathTechnique".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(x,y,z,A,B,C){x.baked.size&&x.baked.size[0]===y[0]&&x.baked.size[1]===y[1]||x.baked.bake(y);x.baked.intersect(z,A,B,C)}class r extends c.Material{constructor(x){super(x,new u);this.supportsEdges=!0;this.produces=new Map([[d.RenderSlot.OPAQUE_MATERIAL,y=>(this.parameters.castShadows&&k.isShadowRelatedOutput(y)||k.is3DGeometryOutput(y))&&!this.parameters.transparent],[d.RenderSlot.TRANSPARENT_MATERIAL,y=>(this.parameters.castShadows&&k.isShadowRelatedOutput(y)||
k.is3DGeometryOutput(y))&&this.parameters.transparent]]);this._vertexAttributeLocations=v.vertexAttributeLocations;this._configuration=new v.PathTechniqueConfiguration;this._vertexBufferLayout=r.getVertexBufferLayout()}getConfiguration(x,y){this._configuration.output=x;this._configuration.vvSize=!!this.parameters.vvSize;this._configuration.vvColor=!!this.parameters.vvColor;this._configuration.vvOpacity=!!this.parameters.vvOpacity;this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.transparent=
this.parameters.transparent;this._configuration.hasOccludees=this.parameters.hasOccludees;x===k.ShaderOutput.Color&&(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?h.NormalsDoubleSidedMode.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?h.NormalsDoubleSidedMode.WindingOrder:h.NormalsDoubleSidedMode.None,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.receiveAmbientOcclusion=
null!=y.ssao);this._configuration.transparencyPassType=y.transparencyPassType;this._configuration.multipassEnabled=y.multipassEnabled;this._configuration.cullAboveGround=y.multipassTerrain.cullAboveGround;return this._configuration}isVisibleForOutput(x){return x===k.ShaderOutput.Shadow||x===k.ShaderOutput.ShadowExcludeHighlight||x===k.ShaderOutput.ShadowHighlight?this.parameters.castShadows:!0}isVisible(){return super.isVisible()&&0<this.parameters.opacity}intersect(x,y,z,A,B,C){if(e.isPathGeometry(x)){y=
x.path;var D=[this.parameters.size[0],this.parameters.size[1]];if(this.parameters.vvSize){const {offset:E,factor:G,minSize:I,maxSize:O}=this.parameters.vvSize;var F=y.sizeAttributeValue;D[0]*=q.clamp(E[0]+F*G[0],I[0],O[0]);D[1]*=q.clamp(E[2]+F*G[2],I[2],O[2])}F=new g.MeshIntersectionOptions(!1,z.options.normalRequired);var H=Math.max(D[0],D[1]);x=x.boundingInfo;if(null==x)m(y,D,A,B,F,C);else{x=l.fromValues(x.bbMin[0]-H,x.bbMin[1]-H,x.bbMin[2]-H,x.bbMax[0]+H,x.bbMax[1]+H,x.bbMax[2]+H);H=[B[0]-A[0],
B[1]-A[1],B[2]-A[2]];var N=Math.sqrt(H[0]*H[0]+H[1]*H[1]+H[2]*H[2]);g.intersectAabbInvDir(x,A,[N/H[0],N/H[1],N/H[2]],z.tolerance)&&m(y,D,A,B,F,C)}}}createBufferWriter(){return new w.DefaultBufferWriter(this._vertexBufferLayout)}createGLMaterial(x){return new n(x)}static getVertexBufferLayout(){const x=p.newLayout().vec3f(t.VertexAttribute.POSITION).vec4f(t.VertexAttribute.PROFILERIGHT).vec4f(t.VertexAttribute.PROFILEUP).vec4f(t.VertexAttribute.PROFILEVERTEXANDNORMAL).vec4f(t.VertexAttribute.FEATUREVALUE);
b("enable-feature:objectAndLayerId-rendering")&&x.vec4u8(t.VertexAttribute.OBJECTANDLAYERIDCOLOR);return x}}class n extends f{_updateOccludeeState(x){x.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:x.hasOccludees})}_updateShadowState(x){null!=this.technique&&x.shadowMap.enabled===this.technique.configuration.receiveShadows||this._material.setParameters({receiveShadows:x.shadowMap.enabled})}beginSlot(x){this._output===k.ShaderOutput.Color&&(this._updateShadowState(x),
this._updateOccludeeState(x));return this.ensureTechnique(v.PathTechnique,x)}}class u extends v.PathPassParameters{constructor(){super(...arguments);this.doubleSided=!1;this.doubleSidedType="normal";this.receiveShadows=!1;this.castShadows=!0;this.hasOccludees=this.transparent=this.hasSlicePlane=!1}}a.PathMaterial=r;a.PathMaterialParameters=u;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/PathTechnique":function(){define("require exports ../../../../chunks/tslib.es6 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../ViewingMode ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/attributes/PathVertexPosition.glsl ../core/shaderLibrary/shading/Normals.glsl ../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/OrderIndependentTransparency ../lib/Program ../lib/StencilUtils ../lib/TransparencyPassType ../lib/VertexAttribute ./DefaultTechniqueConfiguration ../../../../chunks/Path.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){const z=new Map([[r.VertexAttribute.POSITION,0],[r.VertexAttribute.PROFILERIGHT,1],[r.VertexAttribute.PROFILEUP,2],[r.VertexAttribute.PROFILEVERTEXANDNORMAL,3],[r.VertexAttribute.FEATUREVALUE,4],[r.VertexAttribute.OBJECTANDLAYERIDCOLOR,5]]);class A extends h.PathVertexPositionPassParameters{constructor(){super(...arguments);this.ambient=l.fromValues(.2,.2,.2);this.diffuse=l.fromValues(.8,.8,.8);this.specular=l.fromValues(0,0,0);this.opacity=1;this.origin=
l.create();this.modelTransformation=null}}class B extends g.ShaderTechnique{initializeConfiguration(D,F){F.spherical=D.viewingMode===p.ViewingMode.Global;F.doublePrecisionRequiresObfuscation=D.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(D){return new w.Program(D.rctx,B.shader.get().build(this.configuration),z)}initializePipeline(){const D=this.configuration.transparencyPassType,F=this.configuration,H=D===m.TransparencyPassType.NONE,N=D===m.TransparencyPassType.FrontFace;
return y.makePipelineState({blending:F.output===k.ShaderOutput.Color&&F.transparent?H?t.blendingDefault:t.oitBlending(D):null,culling:F.hasSlicePlane&&!F.transparent&&F.doubleSidedMode!==f.NormalsDoubleSidedMode.None?y.frontFaceCullingParams:null,depthTest:{func:t.oitDepthTest(D)},depthWrite:H||N?y.defaultDepthWriteParams:null,drawBuffers:F.output===k.ShaderOutput.Depth?{buffers:[x.SpecialDrawBuffers.NONE]}:t.oitDrawBuffers(D),colorWrite:y.defaultColorWriteParams,stencilWrite:F.hasOccludees?v.stencilWriteMaskOn:
null,stencilTest:F.hasOccludees?v.stencilBaseAllZerosParams:null,polygonOffset:H||N?null:t.OITPolygonOffset})}}B.shader=new e.ReloadableShaderModule(u.Path,()=>new Promise((D,F)=>a(["../shaders/Path.glsl"],D,F)));class C extends n.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=k.ShaderOutput.Color;this.doubleSidedMode=f.NormalsDoubleSidedMode.None;this.transparencyPassType=m.TransparencyPassType.NONE;this.objectAndLayerIdColorInstanced=this.doublePrecisionRequiresObfuscation=
this.cullAboveGround=this.multipassEnabled=this.hasOccludees=this.transparent=this.hasSlicePlane=this.vvOpacity=this.vvColor=this.vvSize=this.receiveAmbientOcclusion=this.receiveShadows=this.spherical=!1}}q.__decorate([d.parameter({count:k.ShaderOutput.COUNT})],C.prototype,"output",void 0);q.__decorate([d.parameter({count:f.NormalsDoubleSidedMode.COUNT})],C.prototype,"doubleSidedMode",void 0);q.__decorate([d.parameter({count:m.TransparencyPassType.COUNT})],C.prototype,"transparencyPassType",void 0);
q.__decorate([d.parameter()],C.prototype,"spherical",void 0);q.__decorate([d.parameter()],C.prototype,"receiveShadows",void 0);q.__decorate([d.parameter()],C.prototype,"receiveAmbientOcclusion",void 0);q.__decorate([d.parameter()],C.prototype,"vvSize",void 0);q.__decorate([d.parameter()],C.prototype,"vvColor",void 0);q.__decorate([d.parameter()],C.prototype,"vvOpacity",void 0);q.__decorate([d.parameter()],C.prototype,"hasSlicePlane",void 0);q.__decorate([d.parameter()],C.prototype,"transparent",void 0);
q.__decorate([d.parameter()],C.prototype,"hasOccludees",void 0);q.__decorate([d.parameter()],C.prototype,"multipassEnabled",void 0);q.__decorate([d.parameter()],C.prototype,"cullAboveGround",void 0);q.__decorate([d.parameter()],C.prototype,"doublePrecisionRequiresObfuscation",void 0);q.__decorate([d.parameter({constValue:!1})],C.prototype,"occlusionPass",void 0);q.__decorate([d.parameter({constValue:c.PBRMode.Disabled})],C.prototype,"pbrMode",void 0);q.__decorate([d.parameter({constValue:!0})],C.prototype,
"hasVvInstancing",void 0);q.__decorate([d.parameter({constValue:!1})],C.prototype,"useCustomDTRExponentForWater",void 0);q.__decorate([d.parameter({constValue:!1})],C.prototype,"useFillLights",void 0);q.__decorate([d.parameter({constValue:!1})],C.prototype,"hasColorTexture",void 0);b.PathPassParameters=A;b.PathTechnique=B;b.PathTechniqueConfiguration=C;b.vertexAttributeLocations=z;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/factories/vec2f64 ./PositionAttribute.glsl ../../shaderModules/Float2PassUniform ../../shaderModules/Float3PassUniform ../../shaderModules/Float4sPassUniform ../../shaderModules/FloatsPassUniform ../../shaderModules/interfaces ../../../lib/VertexAttribute ../../../materials/VisualVariablePassParameters".split(" "),
function(a,b,q,l,p,k,h,f,c,e){class g extends e.VisualVariablePassParameters{constructor(){super(...arguments);this.size=b.fromValues(1,1)}}a.PathVertexPosition=function(d,t){const w=c.VertexAttribute.FEATUREVALUE;d.attributes.add(w,"vec4");const v=d.vertex;v.code.add(f.glsl`
bool isCapVertex() {
return ${w}.w == 1.0;
}
`);v.uniforms.add(new l.Float2PassUniform("size",m=>m.size));t.vvSize?(v.uniforms.add(new p.Float3PassUniform("vvSizeMinSize",m=>m.vvSize.minSize),new p.Float3PassUniform("vvSizeMaxSize",m=>m.vvSize.maxSize),new p.Float3PassUniform("vvSizeOffset",m=>m.vvSize.offset),new p.Float3PassUniform("vvSizeFactor",m=>m.vvSize.factor)),v.code.add(f.glsl`
vec2 getSize() {
return size * clamp(vvSizeOffset + ${w}.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz;
}
`)):v.code.add(f.glsl`vec2 getSize(){
return size;
}`);t.vvOpacity?(v.constants.add("vvOpacityNumber","int",8),v.uniforms.add(new h.FloatsPassUniform("vvOpacityValues",m=>m.vvOpacity.values,8),new h.FloatsPassUniform("vvOpacityOpacities",m=>m.vvOpacity.opacityValues,8)),v.code.add(f.glsl`
vec4 applyOpacity(vec4 color) {
float value = ${w}.z;
if (value <= vvOpacityValues[0]) {
return vec4( color.xyz, vvOpacityOpacities[0]);
}
for (int i = 1; i < vvOpacityNumber; ++i) {
if (vvOpacityValues[i] >= value) {
float f = (value - vvOpacityValues[i-1]) / (vvOpacityValues[i] - vvOpacityValues[i-1]);
return vec4( color.xyz, mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f));
}
}
return vec4( color.xyz, vvOpacityOpacities[vvOpacityNumber - 1]);
}
`)):v.code.add(f.glsl`vec4 applyOpacity(vec4 color){
return color;
}`);t.vvColor?(v.constants.add("vvColorNumber","int",e.vvColorNumber),v.uniforms.add(new h.FloatsPassUniform("vvColorValues",m=>m.vvColor.values,e.vvColorNumber),new k.Float4sPassUniform("vvColorColors",m=>m.vvColor.colors,e.vvColorNumber)),v.code.add(f.glsl`
vec4 getColor() {
float value = ${w}.y;
if (value <= vvColorValues[0]) {
return applyOpacity(vvColorColors[0]);
}
for (int i = 1; i < vvColorNumber; ++i) {
if (vvColorValues[i] >= value) {
float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
return applyOpacity(mix(vvColorColors[i-1], vvColorColors[i], f));
}
}
return applyOpacity(vvColorColors[vvColorNumber - 1]);
}
`)):v.code.add(f.glsl`vec4 getColor(){
return applyOpacity(vec4(1, 1, 1, 1));
}`);d.include(q.PositionAttribute);d.attributes.add(c.VertexAttribute.PROFILERIGHT,"vec4");d.attributes.add(c.VertexAttribute.PROFILEUP,"vec4");d.attributes.add(c.VertexAttribute.PROFILEVERTEXANDNORMAL,"vec4");v.code.add(f.glsl`vec3 calculateVPos() {
vec2 size = getSize();
vec3 origin = position;
vec3 right = profileRight.xyz;
vec3 up = profileUp.xyz;
vec3 forward = cross(up, right);
vec2 profileVertex = profileVertexAndNormal.xy * size;
vec2 profileNormal = profileVertexAndNormal.zw;
float positionOffsetAlongProfilePlaneNormal = 0.0;
float normalOffsetAlongProfilePlaneNormal = 0.0;`);v.code.add(f.glsl`if(!isCapVertex()) {
vec2 rotationRight = vec2(profileRight.w, profileUp.w);
float maxDistance = length(rotationRight);`);v.code.add(f.glsl`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
float rx = dot(profileVertex, rotationRight);
if (abs(rx) > maxDistance) {
vec2 rotationUp = vec2(-rotationRight.y, rotationRight.x);
float ry = dot(profileVertex, rotationUp);
profileVertex = rotationRight * maxDistance * sign(rx) + rotationUp * ry;
}
}else{
positionOffsetAlongProfilePlaneNormal = profileRight.w * size[0];
normalOffsetAlongProfilePlaneNormal = profileUp.w;
}
vec3 offset = right * profileVertex.x + up * profileVertex.y + forward * positionOffsetAlongProfilePlaneNormal;
return origin + offset;
}`);v.code.add(f.glsl`vec3 localNormal() {
vec3 right = profileRight.xyz;
vec3 up = profileUp.xyz;
vec3 forward = cross(up, right);
vec2 profileNormal = profileVertexAndNormal.zw;
vec3 normal = right * profileNormal.x + up * profileNormal.y;
if(isCapVertex()) {
normal += forward * profileUp.w;
}
return normal;
}`)};a.PathVertexPositionPassParameters=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Path.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/TransparencyPassType".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){function B(D){const F=new z.ShaderBuilder,{vertex:H,fragment:N}=F;n.addProjViewLocalOrigin(H,D);F.varyings.add("vpos","vec3");F.include(h.PathVertexPosition,D);if(D.output===q.ShaderOutput.Color||D.output===q.ShaderOutput.ObjectAndLayerIdColor)F.include(p.Transform,D),F.include(m.ReadShadowMapDraw,D),F.include(b.ForwardLinearDepth,D),F.include(k.ObjectAndLayerIdColor,D),F.varyings.add("vnormal","vec3"),F.varyings.add("vcolor","vec4"),D.multipassEnabled&&
F.varyings.add("depth","float"),H.code.add(y.glsl`
void main() {
vpos = calculateVPos();
vnormal = normalize(localNormal());
${D.multipassEnabled?"depth \x3d (view * vec4(vpos, 1.0)).z;":""}
gl_Position = transformPosition(proj, view, vpos);
${D.output===q.ShaderOutput.Color?"forwardLinearDepth();":""}
forwardObjectAndLayerIdColor();
vcolor = getColor();
}
`);F.include(t.multipassTerrainTest,D);switch(D.output){case q.ShaderOutput.Color:F.include(l.SliceDraw,D);F.include(g.EvaluateSceneLighting,D);F.include(e.EvaluateAmbientOcclusion,D);F.include(m.ReadShadowMapDraw,D);F.include(w.Normals,D);n.addCameraPosition(N,D);g.addAmbientBoostFactor(N);g.addLightingGlobalFactor(N);N.uniforms.add(H.uniforms.get("localOrigin"),new u.Float3PassUniform("ambient",E=>E.ambient),new u.Float3PassUniform("diffuse",E=>E.diffuse),new u.Float3PassUniform("specular",
E=>E.specular),new x.FloatPassUniform("opacity",E=>E.opacity));N.include(r.ColorConversion);D.transparencyPassType===A.TransparencyPassType.ColorAlpha&&(F.outputs.add("fragColor","vec4",0),F.outputs.add("fragAlpha","float",1));d.addMainLightIntensity(N);N.code.add(y.glsl`
void main() {
discardBySlice(vpos);
${D.multipassEnabled?"terrainDepthTest(depth);":""}
shadingParams.viewDirection = normalize(vpos - cameraPosition);
shadingParams.normalView = vnormal;
vec3 normal = shadingNormal(shadingParams);
float ssao = evaluateAmbientOcclusionInverse();
float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
${D.receiveShadows?"float shadow \x3d readShadowMap(vpos, linearDepth);":D.spherical?"float shadow \x3d lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow \x3d 0.0;"}
vec3 albedo = vcolor.rgb * max(ambient, diffuse); // combine the old material parameters into a single one
float combinedOpacity = vcolor.a * opacity;
albedo += 0.25 * specular; // don't completely ignore specular for now
vec3 shadedColor = evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight);
fragColor = vec4(shadedColor, combinedOpacity);
fragColor = highlightSlice(fragColor, vpos);
${D.transparencyPassType===A.TransparencyPassType.ColorAlpha?y.glsl`
fragColor = premultiplyAlpha(fragColor);
fragAlpha = fragColor.a;`:""}
}
`);break;case q.ShaderOutput.Depth:F.include(p.Transform,D);H.code.add(y.glsl`void main() {
vpos = calculateVPos();
gl_Position = transformPosition(proj, view, vpos);
}`);F.include(l.SliceDraw,D);N.code.add(y.glsl`void main() {
discardBySlice(vpos);
}`);break;case q.ShaderOutput.Shadow:case q.ShaderOutput.ShadowHighlight:case q.ShaderOutput.ShadowExcludeHighlight:case q.ShaderOutput.ViewshedShadow:F.include(p.Transform,D);b.addNearFar(F);F.varyings.add("depth","float");H.code.add(y.glsl`void main() {
vpos = calculateVPos();
gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
}`);F.include(l.SliceDraw,D);F.include(f.OutputDepth,D);N.code.add(y.glsl`void main() {
discardBySlice(vpos);
outputDepth(depth);
}`);break;case q.ShaderOutput.ObjectAndLayerIdColor:F.include(l.SliceDraw,D);N.code.add(y.glsl`void main() {
discardBySlice(vpos);
outputObjectAndLayerIdColor();
}`);break;case q.ShaderOutput.Normal:F.include(p.Transform,D);F.include(v.NormalUtils,D);n.addViewNormal(H);F.varyings.add("vnormal","vec3");H.code.add(y.glsl`void main(void) {
vpos = calculateVPos();
vnormal = normalize((viewNormal * vec4(localNormal(), 1.0)).xyz);
gl_Position = transformPosition(proj, view, vpos);
}`);F.include(l.SliceDraw,D);N.code.add(y.glsl`void main() {
discardBySlice(vpos);
vec3 normal = normalize(vnormal);
if (gl_FrontFacing == false) normal = -normal;
fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);
}`);break;case q.ShaderOutput.Highlight:F.include(p.Transform,D),F.include(v.NormalUtils,D),F.varyings.add("vnormal","vec3"),H.code.add(y.glsl`void main(void) {
vpos = calculateVPos();
gl_Position = transformPosition(proj, view, vpos);
}`),F.include(l.SliceDraw,D),F.include(c.OutputHighlight,D),N.code.add(y.glsl`void main() {
discardBySlice(vpos);
outputHighlight();
}`)}return F}const C=Object.freeze(Object.defineProperty({__proto__:null,build:B},Symbol.toStringTag,{value:"Module"}));a.Path=C;a.build=B})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.NormalUtils=function(q,l){l.spherical?q.vertex.code.add(b.glsl`vec3 getLocalUp(in vec3 pos, in vec3 origin) {
return normalize(pos + origin);
}`):q.vertex.code.add(b.glsl`vec3 getLocalUp(in vec3 pos, in vec3 origin) {
return vec3(0.0, 0.0, 1.0);
}`);l.spherical?q.vertex.code.add(b.glsl`mat3 getTBNMatrix(in vec3 n) {
vec3 t = normalize(cross(vec3(0.0, 0.0, 1.0), n));
vec3 b = normalize(cross(n, t));
return mat3(t, b, n);
}`):q.vertex.code.add(b.glsl`mat3 getTBNMatrix(in vec3 n) {
vec3 t = vec3(1.0, 0.0, 0.0);
vec3 b = normalize(cross(n, t));
return mat3(t, b, n);
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer":function(){define("exports ../../../../Color ../../../../core/screenUtils ../../../../chunks/earcut ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/DoubleArray ../../../../geometry/support/FloatArray ./elevationAlignmentUtils ./Graphics3DDrapedGraphicLayer ./Graphics3DObject3DGraphicLayer ./Graphics3DSymbolLayer ./graphicUtils ./interfaces ./lineUtils ./polygonUtils ../support/FastSymbolUpdates ../support/patternUtils ../support/uvUtils ../../support/engineContent/line ../../support/renderInfoUtils/polygon ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/RenderGeometry ../../webgl-engine/materials/lineStippleUtils ../../webgl-engine/materials/PatternMaterial ../../webgl-engine/materials/RibbonLineMaterial".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C){const D=["polyline","polygon","extent"],F=new m.ConvertOptions({size:!1,color:!0,rotation:!1,opacity:!1});class H extends g.Graphics3DSymbolLayer{constructor(O,L,P,M){super(O,L,P,M);this._needsUV=!1}async doLoad(){this._fastUpdates=m.initFastSymbolUpdatesState(this._context.renderer,F)}_createMaterials(){if(!(0<this._materials.length)){var O=this._getCombinedOpacityAndColor(this.symbolLayer?.material?.color);this._materials[I.Fill]=r.createMaterial(this.symbolLayer,
{color:O,forceTransparentMode:this.needsDrivenTransparentPass,polygonOffset:!1,hasVertexColors:!0,writeLinearDepth:!0,draped:this.draped,hasSlicePlane:this._context.slicePlaneEnabled,...this._fastUpdates?.materialParameters});this._needsUV=this._materials[I.Fill]instanceof B.PatternMaterial;O=this.symbolLayer.outline;if(null!=O?.size&&0<O.size&&null!=O.color&&(null==O.pattern||"style"!==O.pattern.type||"none"!==O.pattern.style)){const L=A.getStipplePatternForLinePattern(O.pattern);this._materials[I.Outline]=
new C.RibbonLineMaterial({width:q.pt2px(O.size),color:this._getOutlineColor(),hasPolygonOffset:!0,hasSlicePlane:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:L,cap:w.parseCapType(O.patternCap||"butt")})}this._context.stage.addMany(this._materials)}}destroy(){super.destroy();this._context.stage.removeMany(this._materials);this._materials.length=0}createGraphics3DGraphic(O){const L=O.graphic;if(!this._validateGeometry(L.geometry,D,this.symbolLayer.type))return null;O=this._getVertexOpacityAndColor(O.renderingInfo,
255);const P=this.setGraphicElevationContext(L);this.ensureDrapedStatus("on-the-ground"===P.mode);this._createMaterials();return this.draped?this._createAsOverlay(L,O):this._createAs3DShape(L,O,P)}applyRendererDiff(O,L){for(const P in O.diff)switch(P){case "visualVariables":if(m.updateFastSymbolUpdatesState(this._fastUpdates,L,F))this._materials[I.Fill]?.setParameters(this._fastUpdates.materialParameters);else return t.ApplyRendererDiffResult.RecreateSymbol;break;default:return t.ApplyRendererDiffResult.RecreateSymbol}return t.ApplyRendererDiffResult.FastUpdate}layerOpacityChanged(){if(null!=
this._materials[I.Fill]){var O=this._materials[I.Fill].parameters.color;const L=this._getCombinedOpacity(this.symbolLayer?.material?.color);this._materials[I.Fill].setParameters({color:[O[0],O[1],O[2],L],forceTransparentMode:this.needsDrivenTransparentPass})}null!=this._materials[I.Outline]&&(O=this._materials[I.Outline].parameters.color,this._materials[I.Outline].setParameters({color:[O[0],O[1],O[2],this._getOutlineOpacity()]}))}layerElevationInfoChanged(O,L,P){const M=this._elevationContext.mode;
P=f.elevationModeChangeUpdateType(H.elevationModeChangeTypes,P,M);if(P!==f.SymbolUpdateType.UPDATE)return P;const K=f.needsElevationUpdates2D(M);return this.updateGraphics3DGraphicElevationInfo(O,L,()=>K)}slicePlaneEnabledChanged(){this._materials[I.Fill]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});this._materials[I.Outline]&&this._materials[I.Outline].setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(O,
L,P){const M=v.geometryAsPolygon(O.geometry);if(!M)return null;var K=x.geometryToRenderInfo(M,this._context.elevationProvider,this._context.renderCoordsHelper,P);L=new E(K,L,this._context.layer.uid,O.uid);K=L.renderData.position.length/3;this._needsUV&&(L.uvMapSpace=h.newFloatArray(4*K,!0),L.boundingRect=k.newDoubleArray(9*K,!0),n.createMapSpaceUVCoords(L.uvMapSpace,L.boundingRect,L.renderData.position,this._context.renderCoordsHelper));L.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(L);
this._createAs3DShapeFill(O,L);this._materials[I.Outline]&&this._createAs3DShapeOutline(L);this._logGeometryCreationWarnings(L.renderData,M.rings,"rings","FillSymbol3DLayer");if(0===L.outGeometries.length)return null;O=new y.Object3D({geometries:L.outGeometries,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:O.uid});O=new e.Graphics3DObject3DGraphicLayer(this,O,L.outGeometries,null,null,r.uvElevationAligner,P);O.alignedSampledElevation=L.renderData.sampledElevation;O.needsElevationUpdates=
f.needsElevationUpdates2D(P.mode);return O}_createAs3DShapeFill(O,L){var P=L.renderData.polygons;for(const {position:M,mapPositions:K,holeIndices:J,index:R,count:Q}of P){if(null!=this._context.clippingExtent&&(p.empty(N),p.expandWithBuffer(N,K),!p.intersectsClippingArea(N,this._context.clippingExtent)))continue;P=v.createIndices3D(K,J,this._context.elevationProvider.spatialReference);if(0===P.length)continue;const W=this._fastUpdates?.visualVariables.color;P=v.createColorGeometry({material:this._materials[I.Fill],
indices:P,mapPositions:K,attributeData:{position:M,color:W?null:L.color,colorFeature:W?m.getAttributeValue(W.field,O):null,uvMapSpace:this._needsUV?h.floatSubArray(L.uvMapSpace,4*R,4*Q):null,boundingRect:this._needsUV?k.doubleSubArray(L.boundingRect,9*R,9*Q):null,objectAndLayerIdColor:L.objectAndLayerIdColor}});L.outGeometries.push(P)}}_createAs3DShapeOutline(O){if(null!=this._materials[I.Outline]){var L=O.renderData.outlines;for(const {mapPositions:P,position:M}of L){if(null!=this._context.clippingExtent&&
(p.empty(N),p.expandWithBuffer(N,P),!p.intersectsClippingArea(N,this._context.clippingExtent)))continue;L=u.createGeometry(this._materials[I.Outline],{overlayInfo:null,removeDuplicateStartEnd:!0,mapPositions:P,attributeData:{position:M}},O.objectAndLayerIdColor);O.outGeometries.push(L)}}}_createAsOverlay(O,L){const P=v.geometryAsPolygon(O.geometry);if(null==P)return null;this._materials[I.Fill].renderPriority=this._renderPriority+this._renderPriorityStep/2;null!=this._materials[I.Outline]&&(this._materials[I.Outline].renderPriority=
this._renderPriority);var M=x.geometryToRenderInfoDraped(P,this._context.overlaySR);L=new G(M,L,this._context.layer.uid,O.uid);M=L.renderData.position.length/3;this._needsUV&&(L.uvMapSpace=h.newFloatArray(4*M,!0),n.createMapSpaceUVCoordsDraped(L.uvMapSpace,L.renderData.position,this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode));L.outBoundingBox=p.empty();L.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(L);this._createAsOverlayFill(O,L);
this._materials[I.Outline]&&this._createAsOverlayOutline(L);this._logGeometryCreationWarnings(L.renderData,P.rings,"rings","FillSymbol3DLayer");return 0===L.outGeometries.length?null:new c.Graphics3DDrapedGraphicLayer(this,L.outGeometries,L.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayFill(O,L){var P=L.renderData.polygons;for(const {position:K,holeIndices:J,index:R,count:Q}of P){var M=p.empty(N);p.expandWithBuffer(M,K);p.intersectsClippingArea(M,this._context.clippingExtent)&&
(P=l.earcut(K,J,3),0!==P.length&&(p.expandWithAABB(L.outBoundingBox,M),M=this._fastUpdates?.visualVariables.color,P=v.createColorGeometry({material:this._materials[I.Fill],indices:P,attributeData:{position:K,color:M?null:L.color,colorFeature:M?m.getAttributeValue(M.field,O):null,uvMapSpace:this._needsUV?h.floatSubArray(L.uvMapSpace,4*R,4*Q):null,objectAndLayerIdColor:L.objectAndLayerIdColor}}),L.outGeometries.push(new z.RenderGeometry(P,L))))}}_createAsOverlayOutline(O){if(null!=this._materials[I.Outline]){var L=
O.renderData.outlines;for(let M=0;M<L.length;++M){var {position:P}=L[M];p.empty(N);p.expandWithBuffer(N,P);p.intersectsClippingArea(N,this._context.clippingExtent)&&(p.expandWithAABB(O.outBoundingBox,N),P=u.createGeometry(this._materials[I.Outline],{overlayInfo:{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper},removeDuplicateStartEnd:!0,attributeData:{position:P}},O.objectAndLayerIdColor),O.outGeometries.push(new z.RenderGeometry(P,O)))}}}_getOutlineOpacity(){const O=
this.symbolLayer?.outline?.color;return(this.draped?1:this._getLayerOpacity())*(null!=O?O.a:0)}_getOutlineColor(){const O=this.symbolLayer?.outline?.color,L=this._getOutlineOpacity();return d.mixinColorAndOpacity(null!=O?b.toUnitRGB(O):null,L)}test(){return{...super.test(),createAsOverlay:(O,L)=>this._createAsOverlay(O,L),createAs3DShape:(O,L,P)=>this._createAs3DShape(O,L,P)}}}H.elevationModeChangeTypes={definedChanged:f.SymbolUpdateType.RECREATE,staysOnTheGround:f.SymbolUpdateType.NONE,onTheGroundChanged:f.SymbolUpdateType.RECREATE};
const N=p.create();class E extends v.PolygonCreationDataBase{constructor(O,L,P,M){super(O,P,M);this.color=L}}class G extends v.PolygonCreationDataBase{constructor(O,L,P,M){super(O,P,M);this.color=L}}var I;(function(O){O[O.Fill=0]="Fill";O[O.Outline=1]="Outline"})(I||={});a.Graphics3DPolygonFillSymbolLayer=H;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/patternUtils":function(){define("exports ../../../../core/has ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../graphics/ElevationAligners ./uvUtils ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/ColorMaterial ../../webgl-engine/materials/PatternMaterial ../../webgl-engine/materials/PatternStyle".split(" "),
function(a,b,q,l,p,k,h,f,c){function e(t){switch(t){case "horizontal":return c.Style.Horizontal;case "vertical":return c.Style.Vertical;case "cross":return c.Style.Cross;case "forward-diagonal":return c.Style.ForwardDiagonal;case "backward-diagonal":return c.Style.BackwardDiagonal;case "diagonal-cross":return c.Style.DiagonalCross}}function g(t){return t.material instanceof f.PatternMaterial&&!t.material.parameters.draped}function d(t,w){if(g(t)){const v=t.attributes.get(k.VertexAttribute.POSITION).data,
m=t.getMutableAttribute(k.VertexAttribute.UVMAPSPACE).data;t=t.getMutableAttribute(k.VertexAttribute.BOUNDINGRECT).data;p.createMapSpaceUVCoords(m,t,v,w)}}a.createMaterial=function(t,w){t=t?.pattern??null;if(null==t)return new h.ColorMaterial(w);if("none"===t.style||"solid"===t.style)return"none"===t.style&&(w.color=q.fromValues(0,0,0,0),w.forceTransparentMode=!0),new h.ColorMaterial(w);w.style=e(t.style);return new f.PatternMaterial(w)};a.parsePatternStyle=e;a.requiresUVUpdates=g;a.updateMapSpaceUVCoords=
d;a.uvElevationAligner=function(t,w,v,m,r){w=l.perVertexElevationAligner(t,w,v,m,r);t=t.stageObject.geometries;for(const n of t)d(n,r);return w};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/uvUtils":function(){define("exports ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/projection/projectors ../../../../geometry/support/DoubleArray ../../../../geometry/support/plane ../../../ViewingMode".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){function d(N,E,G,I,O,L,P){p.set(N,E*O[0]+G*L[0]+I*P[0],E*O[1]+G*L[1]+I*P[1],E*O[2]+G*L[2]+I*P[2])}const t=k.create(),w=k.create(),v=e.create(),m=k.create(),r=k.create(),n=k.create(),u=l.create(),x=l.create(),y=k.create(),z=k.create(),A=k.create(),B=b.create(),C=k.create(),D=k.create(),F=k.create(),H=k.create();a.createMapSpaceUVCoords=function(N,E,G,I,O=1){p.set(m,1,0,0);p.set(r,0,1,0);p.set(n,0,0,1);p.set(H,0,0,0);for(var L=0;L<G.length-3;L+=3)H[0]+=G[L],H[1]+=G[L+
1],H[2]+=G[L+2];p.scale(t,H,1/(G.length/3-1));if(e.fromArray(v,G)){null!=I?(I.basisMatrixAtPosition(t,B),p.set(C,B[0],B[1],B[2]),p.set(D,B[4],B[5],B[6]),p.set(F,B[8],B[9],B[10])):(p.set(C,1,0,0),p.set(D,0,1,0),p.set(F,0,0,1));I=e.getNormal(v);0>p.dot(I,F)&&p.scale(I,I,-1);p.copy(n,I);L=p.dot(I,D);var P=p.dot(I,C);Math.abs(L)>Math.abs(P)?(p.scaleAndAdd(m,C,I,-P),p.normalize(m,m),p.cross(r,m,I),p.normalize(r,r),p.scale(r,r,-1)):(p.scaleAndAdd(r,D,I,-L),p.normalize(r,r),p.cross(m,r,I),p.normalize(m,
m))}q.set(u,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);q.set(x,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(I=0;I<G.length;I+=3)p.set(w,G[I],G[I+1],G[I+2]),L=p.dot(m,w),P=p.dot(r,w),u[0]=Math.min(u[0],L),u[1]=Math.min(u[1],P),x[0]=Math.max(x[0],L),x[1]=Math.max(x[1],P);I=p.dot(n,t);d(y,u[0],u[1],I,m,r,n);d(z,x[0],u[1],I,m,r,n);d(A,u[0],x[1],I,m,r,n);p.subtract(z,z,y);p.scale(z,z,.5);p.subtract(A,A,y);p.scale(A,A,.5);p.add(y,y,z);p.add(y,y,A);I=u[0]-u[0]%O;L=u[1]-u[1]%O;for(P=0;P<
G.length;P+=3){p.set(w,G[P],G[P+1],G[P+2]);var M=P/3,K=4*M;N[K]=(p.dot(m,w)-I)/O;N[K+1]=(p.dot(r,w)-L)/O;N[K+2]=I/O;N[K+3]=L/O;M*=9;for(K=0;3>K;K++)E[M+K]=y[K],E[M+K+3]=z[K],E[M+K+6]=A[K]}};a.createMapSpaceUVCoordsDraped=function(N,E,G,I,O=1){if(G.isGeographic&&I===g.ViewingMode.Global){I=c.newDoubleArray(E.length);var L=E.length;G=h.getReferenceEllipsoid(G);for(var P=0;P<L;P+=3)f.lonLatToWebMercatorComparable(E,P,I,P,G);E=I}q.set(u,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);for(I=0;I<E.length;I+=
3)u[0]=Math.min(u[0],E[I]),u[1]=Math.min(u[1],E[I+1]);I=u[0]-u[0]%O;L=u[1]-u[1]%O;for(G=0;G<E.length;G+=3)P=G/3*4,N[P]=(E[G]-I)/O,N[P+1]=(E[G+1]-L)/O,N[P+2]=I/O,N[P+3]=L/O};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/ColorMaterial":function(){define("exports ../../../../core/has ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../lib/basicInterfaces ../lib/GLMaterial ../lib/OrderIndependentTransparency ../lib/RenderSlot ../lib/VertexAttribute ./DefaultBufferWriter ./TriangleMaterial ./VisualVariablePassParameters ../shaders/ColorMaterialTechnique ../shaders/ColorMaterialTechniqueConfiguration".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){class m extends d.TriangleMaterial{constructor(u){super(u,new n);this.supportsEdges=!0;this.produces=new Map([[c.RenderSlot.OPAQUE_MATERIAL,x=>x===p.ShaderOutput.Highlight||p.isColorOrOID(x)&&!this._isTransparent],[c.RenderSlot.OPAQUE_NO_SSAO_DEPTH,x=>p.isDepth(x)&&this.parameters.writeLinearDepth&&!this._isTransparent],[c.RenderSlot.TRANSPARENT_MATERIAL,x=>p.isColorOrOID(x)&&this._isTransparent&&this.parameters.writeDepth],[c.RenderSlot.TRANSPARENT_NO_SSAO_DEPTH,
x=>p.isDepth(x)&&this.parameters.writeLinearDepth&&this._isTransparent&&this.parameters.writeDepth],[c.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,x=>(p.isColorOrOID(x)||p.isDepth(x)&&this.parameters.writeLinearDepth)&&this._isTransparent&&!this.parameters.writeDepth],[c.RenderSlot.DRAPED_MATERIAL,x=>p.is2DGeometryOutput(x)]]);this._configuration=new v.ColorMaterialTechniqueConfiguration}getConfiguration(u,x){this._configuration.output=u;this._configuration.cullFace=this.parameters.cullFace;
this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor;this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.transparent=this._isTransparent;this._configuration.polygonOffset=this.parameters.polygonOffset;this._configuration.writeDepth=this.parameters.writeDepth;this._configuration.hasOccludees=this.parameters.hasOccludees;this._configuration.transparencyPassType=x.transparencyPassType;this._configuration.enableOffset=x.camera.relativeElevation<
f.OITPolygonOffsetLimit;this._configuration.multipassEnabled=x.multipassEnabled;this._configuration.cullAboveGround=x.multipassTerrain.cullAboveGround;this._configuration.vvColor=!!this.parameters.vvColor;this._configuration.draped=this.parameters.draped;return this._configuration}createGLMaterial(u){return new r(u)}createBufferWriter(){const u=l.newLayout().vec3f(e.VertexAttribute.POSITION);b("enable-feature:objectAndLayerId-rendering")&&u.vec4u8(e.VertexAttribute.OBJECTANDLAYERIDCOLOR);this.parameters.vvColor?
u.f32(e.VertexAttribute.COLORFEATUREATTRIBUTE):u.vec4u8(e.VertexAttribute.COLOR);return new g.DefaultBufferWriter(u)}get _isTransparent(){return 1>this.parameters.color[3]||this.parameters.forceTransparentMode}}class r extends h{_updateOccludeeState(u){u.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:u.hasOccludees})}beginSlot(u){this._output===p.ShaderOutput.Color&&this._updateOccludeeState(u);return this.ensureTechnique(w.ColorMaterialTechnique,
u)}}class n extends t.VisualVariablePassParameters{constructor(){super(...arguments);this.color=q.ZEROS;this.forceTransparentMode=!1;this.writeDepth=!0;this.hasSlicePlane=this.polygonOffset=this.hasVertexColors=this.writeLinearDepth=!1;this.cullFace=k.CullFaceOptions.None;this.draped=this.hasOccludees=!1}}a.ColorMaterial=m;a.Parameters=n;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/TriangleMaterial":function(){define(["exports","../lib/Material",
"../lib/RayIntersections"],function(a,b,q){class l extends b.Material{intersect(p,k,h,f,c,e){return q.intersectTriangleGeometry(p,h,f,c,void 0,e)}}a.TriangleMaterial=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ColorMaterialTechnique":function(){define("require exports ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/OrderIndependentTransparency ../lib/Program ../lib/StencilUtils ../lib/TransparencyPassType ../materials/VisualVariablePassParameters ../../../../chunks/ColorMaterial.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){class m extends d.VisualVariablePassParameters{constructor(){super(...arguments);this.color=q.ZEROS}}class r extends k.ShaderTechnique{initializeProgram(u){return new c.Program(u.rctx,r.shader.get().build(this.configuration),h.Default3D)}_createPipeline(u,x){const y=this.configuration,z=u===g.TransparencyPassType.NONE,A=u===g.TransparencyPassType.FrontFace;return v.makePipelineState({blending:y.output===l.ShaderOutput.Color&&y.transparent?z?f.blendingDefault:
f.oitBlending(u):null,culling:v.cullingParams(y.cullFace),depthTest:y.draped?null:{func:f.oitDepthTest(u)},depthWrite:y.draped?null:z||A?y.writeDepth?v.defaultDepthWriteParams:null:null,drawBuffers:y.output===l.ShaderOutput.Depth?{buffers:[w.SpecialDrawBuffers.NONE]}:f.oitDrawBuffers(u),colorWrite:v.defaultColorWriteParams,stencilWrite:y.hasOccludees?e.stencilWriteMaskOn:null,stencilTest:y.hasOccludees?x?e.stencilToolMaskBaseParams:e.stencilBaseAllZerosParams:null,polygonOffset:z||A?y.polygonOffset?
n:null:f.getOITPolygonOffset(y.enableOffset)})}initializePipeline(){this._occludeePipelineState=this._createPipeline(this.configuration.transparencyPassType,!0);return this._createPipeline(this.configuration.transparencyPassType,!1)}getPipeline(u){return u?this._occludeePipelineState:super.getPipeline()}}r.shader=new p.ReloadableShaderModule(t.ColorMaterial,()=>new Promise((u,x)=>a(["./ColorMaterial.glsl"],u,x)));const n={factor:1,units:1};b.ColorMaterialPassParameters=m;b.ColorMaterialTechnique=
r;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/ColorMaterial.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){function n(x){const y=new v.ShaderBuilder,{vertex:z,fragment:A,attributes:B,varyings:C}=y;d.addProjViewLocalOrigin(z,x);y.include(l.Transform,x);y.include(k.VertexColor,x);y.include(c.VisualVariables,x);y.include(p.ObjectAndLayerIdColor,x);B.add(r.VertexAttribute.POSITION,"vec3");x.vvColor&&B.add(r.VertexAttribute.COLORFEATUREATTRIBUTE,"float");C.add("vColor","vec4");C.add("vpos","vec3");const D=x.multipassEnabled&&x.output===b.ShaderOutput.Color;D&&C.add("depth",
"float");z.uniforms.add(new t.Float4PassUniform("eColor",H=>H.color));z.code.add(w.glsl`
void main(void) {
vpos = position;
forwardNormalizedVertexColor();
forwardObjectAndLayerIdColor();
${x.hasVertexColors?"vColor *\x3d eColor;":x.vvColor?"vColor \x3d eColor * interpolateVVColor(colorFeatureAttribute);":"vColor \x3d eColor;"}
${D?"depth \x3d (view * vec4(vpos, 1.0)).z;":""}
gl_Position = transformPosition(proj, view, vpos);
}
`);y.include(q.SliceDraw,x);D&&y.include(f.multipassTerrainTest,x);A.include(g.ColorConversion);const F=x.output===b.ShaderOutput.Highlight;F&&y.include(h.OutputHighlight,x);x.transparencyPassType===m.TransparencyPassType.ColorAlpha&&(y.outputs.add("fragColor","vec4",0),y.outputs.add("fragAlpha","float",1));A.code.add(w.glsl`
void main() {
discardBySlice(vpos);
${D?"terrainDepthTest(depth);":""}
vec4 fColor = vColor;
${x.output===b.ShaderOutput.ObjectAndLayerIdColor?w.glsl`fColor.a = 1.0;`:""}
if (fColor.a < ${w.glsl.float(e.symbolAlphaCutoff)}) {
discard;
}
${x.output===b.ShaderOutput.Color?w.glsl`fragColor = highlightSlice(fColor, vpos); ${x.transparencyPassType===m.TransparencyPassType.ColorAlpha?w.glsl`
fragColor = premultiplyAlpha(fragColor);
fragAlpha = fragColor.a;`:""}`:""}
${F?w.glsl`outputHighlight();`:""};
${x.output===b.ShaderOutput.ObjectAndLayerIdColor?w.glsl`outputObjectAndLayerIdColor();`:""}
}
`);return y}const u=Object.freeze(Object.defineProperty({__proto__:null,build:n},Symbol.toStringTag,{value:"Module"}));a.ColorMaterial=u;a.build=n})},"esri/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration":function(){define("exports ../../../../chunks/tslib.es6 ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/basicInterfaces ../lib/TransparencyPassType ../materials/DefaultTechniqueConfiguration".split(" "),function(a,b,q,l,p,k,h){class f extends h.DefaultTechniqueConfiguration{constructor(){super(...arguments);
this.output=q.ShaderOutput.Color;this.cullFace=p.CullFaceOptions.None;this.transparencyPassType=k.TransparencyPassType.NONE;this.polygonOffset=this.transparent=this.hasVertexColors=this.hasSlicePlane=!1;this.writeDepth=this.enableOffset=!0;this.draped=this.vvColor=this.objectAndLayerIdColorInstanced=this.cullAboveGround=this.multipassEnabled=this.hasOccludees=!1}}b.__decorate([l.parameter({count:q.ShaderOutput.COUNT})],f.prototype,"output",void 0);b.__decorate([l.parameter({count:p.CullFaceOptions.COUNT})],
f.prototype,"cullFace",void 0);b.__decorate([l.parameter({count:k.TransparencyPassType.COUNT})],f.prototype,"transparencyPassType",void 0);b.__decorate([l.parameter()],f.prototype,"hasSlicePlane",void 0);b.__decorate([l.parameter()],f.prototype,"hasVertexColors",void 0);b.__decorate([l.parameter()],f.prototype,"transparent",void 0);b.__decorate([l.parameter()],f.prototype,"polygonOffset",void 0);b.__decorate([l.parameter()],f.prototype,"enableOffset",void 0);b.__decorate([l.parameter()],f.prototype,
"writeDepth",void 0);b.__decorate([l.parameter()],f.prototype,"hasOccludees",void 0);b.__decorate([l.parameter()],f.prototype,"multipassEnabled",void 0);b.__decorate([l.parameter()],f.prototype,"cullAboveGround",void 0);b.__decorate([l.parameter()],f.prototype,"objectAndLayerIdColorInstanced",void 0);b.__decorate([l.parameter()],f.prototype,"vvColor",void 0);b.__decorate([l.parameter()],f.prototype,"draped",void 0);b.__decorate([l.parameter({constValue:!1})],f.prototype,"occlusionPass",void 0);b.__decorate([l.parameter({constValue:!0})],
f.prototype,"hasVvInstancing",void 0);b.__decorate([l.parameter({constValue:!1})],f.prototype,"vvSize",void 0);b.__decorate([l.parameter({constValue:!1})],f.prototype,"vvOpacity",void 0);a.ColorMaterialTechniqueConfiguration=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/PatternMaterial":function(){define("exports ../../../../core/has ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/support/buffer/BufferView ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../lib/basicInterfaces ../lib/GLMaterial ../lib/OrderIndependentTransparency ../lib/RenderSlot ../lib/Util ../lib/VertexAttribute ./DefaultBufferWriter ./PatternStyle ./TriangleMaterial ./VisualVariablePassParameters ./internal/bufferWriterUtils ../shaders/PatternTechnique".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){class u extends v.TriangleMaterial{constructor(A){super(A,new z);this.supportsEdges=!0;this.produces=new Map([[e.RenderSlot.OPAQUE_MATERIAL,B=>k.isOIDorHighlight(B)],[e.RenderSlot.TRANSPARENT_MATERIAL,B=>k.isColor(B)],[e.RenderSlot.TRANSPARENT_NO_SSAO_DEPTH,B=>k.isDepth(B)&&this.parameters.writeLinearDepth],[e.RenderSlot.DRAPED_MATERIAL,B=>this.parameters.draped&&B===k.ShaderOutput.Color||k.isOIDorHighlight(B)]]);this._vertexAttributeLocations=b("enable-feature:objectAndLayerId-rendering")?
n.vertexAttributeLocationsOID:n.vertexAttributeLocations;this._configuration=new n.PatternTechniqueConfiguration}getConfiguration(A,B){this._configuration.output=A;this._configuration.cullFace=this.parameters.cullFace;this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor;this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.polygonOffset=this.parameters.polygonOffset;this._configuration.style=this.parameters.style;this._configuration.patternSpacing=
this.parameters.patternSpacing;this._configuration.lineWidth=this.parameters.lineWidth;this._configuration.draped=this.parameters.draped;this._configuration.transparencyPassType=B.transparencyPassType;this._configuration.enableOffset=B.camera.relativeElevation<c.OITPolygonOffsetLimit;this._configuration.multipassEnabled=B.multipassEnabled;this._configuration.cullAboveGround=B.multipassTerrain.cullAboveGround;this._configuration.vvColor=!!this.parameters.vvColor;return this._configuration}createGLMaterial(A){return new x(A)}createBufferWriter(){const A=
p.newLayout().vec3f(d.VertexAttribute.POSITION).vec4f(d.VertexAttribute.UVMAPSPACE);this.parameters.draped||A.mat3f(d.VertexAttribute.BOUNDINGRECT);this.parameters.vvColor?A.f32(d.VertexAttribute.COLORFEATUREATTRIBUTE):A.vec4u8(d.VertexAttribute.COLOR);b("enable-feature:objectAndLayerId-rendering")&&A.vec4u8(d.VertexAttribute.OBJECTANDLAYERIDCOLOR);return new y(A)}}class x extends f{_updateParameters(A){return this.ensureTechnique(n.PatternTechnique,A)}_updateOccludeeState(A){A.hasOccludees!==this._material.parameters.hasOccludees&&
this._material.setParameters({hasOccludees:A.hasOccludees})}beginSlot(A){this._output===k.ShaderOutput.Color&&this._updateOccludeeState(A);return this._updateParameters(A)}}class y extends t.DefaultBufferWriter{write(A,B,C,D,F){r.writeDefaultAttributes(C,this.vertexBufferLayout,A,B,D,F);for(const G of this.vertexBufferLayout.fields.keys()){var H=C.attributes.get(G);B=H?.indices;if(H&&B)switch(G){case d.VertexAttribute.UVMAPSPACE:g.assert(4===H.size);(B=D.getField(G,l.BufferViewVec4f))&&r.writeBufferVec4(H,
B,F);break;case d.VertexAttribute.BOUNDINGRECT:g.assert(9===H.size);var N=D.getField(G,l.BufferViewMat3f);if(N){B=F;const {data:I,indices:O}=H;H=A;const L=N.typedBuffer;N=N.typedBufferStride;const P=O.length;B*=N;for(let M=0;M<P;++M){const K=9*O[M];var E=I[K];const J=I[K+1],R=I[K+2];L[B]=H[0]*E+H[4]*J+H[8]*R+H[12];L[B+1]=H[1]*E+H[5]*J+H[9]*R+H[13];L[B+2]=H[2]*E+H[6]*J+H[10]*R+H[14];for(E=3;9>E;++E)L[B+E]=I[K+E];B+=N}}}}}}class z extends m.VisualVariablePassParameters{constructor(){super(...arguments);
this.color=q.fromValues(1,1,1,1);this.hasSlicePlane=this.polygonOffset=this.hasVertexColors=this.writeLinearDepth=!1;this.cullFace=h.CullFaceOptions.None;this.hasOccludees=!1;this.style=w.Style.Cross;this.patternSpacing=10;this.lineWidth=1;this.draped=!0}}a.Parameters=z;a.PatternMaterial=u;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/PatternStyle":function(){define(["exports"],function(a){a.Style=void 0;var b=a.Style||(a.Style={});b[b.Horizontal=
0]="Horizontal";b[b.Vertical=1]="Vertical";b[b.Cross=2]="Cross";b[b.ForwardDiagonal=3]="ForwardDiagonal";b[b.BackwardDiagonal=4]="BackwardDiagonal";b[b.DiagonalCross=5]="DiagonalCross";b[b.COUNT=6]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/PatternTechnique":function(){define("require exports ../../../../chunks/tslib.es6 ../../../../core/has ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/basicInterfaces ../lib/OrderIndependentTransparency ../lib/Program ../lib/StencilUtils ../lib/TransparencyPassType ../lib/VertexAttribute ../materials/DefaultTechniqueConfiguration ../materials/PatternStyle ../../../../chunks/Pattern.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){class x extends h.ShaderTechnique{initializeProgram(C){return new g.Program(C.rctx,x.shader.get().build(this.configuration),l("enable-feature:objectAndLayerId-rendering")?B:A)}_setPipelineState(C,D){const F=this.configuration,H=C===t.TransparencyPassType.NONE,N=C===t.TransparencyPassType.FrontFace;return u.makePipelineState({blending:F.output===p.ShaderOutput.Color?H?e.blendingDefault:e.oitBlending(C):null,culling:u.cullingParams(F.cullFace),depthTest:F.draped?
null:{func:e.oitDepthTest(C)},depthWrite:F.draped?null:H?u.defaultDepthWriteParams:e.oitDepthWrite(C),drawBuffers:F.output===p.ShaderOutput.Depth?{buffers:[n.SpecialDrawBuffers.NONE]}:e.oitDrawBuffers(C),colorWrite:u.defaultColorWriteParams,stencilWrite:F.hasOccludees?d.stencilWriteMaskOn:null,stencilTest:F.hasOccludees?D?d.stencilToolMaskBaseParams:d.stencilBaseAllZerosParams:null,polygonOffset:H||N?F.polygonOffset?y:null:e.getOITPolygonOffset(F.enableOffset)})}initializePipeline(){this._occludeePipelineState=
this._setPipelineState(this.configuration.transparencyPassType,!0);return this._setPipelineState(this.configuration.transparencyPassType,!1)}getPipeline(C){return C?this._occludeePipelineState:super.getPipeline()}}x.shader=new k.ReloadableShaderModule(r.Pattern,()=>new Promise((C,D)=>a(["./Pattern.glsl"],C,D)));const y={factor:1,units:1};class z extends v.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=p.ShaderOutput.Color;this.cullFace=c.CullFaceOptions.None;this.transparencyPassType=
t.TransparencyPassType.NONE;this.hasOccludees=this.polygonOffset=this.hasVertexColors=this.hasSlicePlane=!1;this.enableOffset=!0;this.objectAndLayerIdColorInstanced=this.vvColor=this.cullAboveGround=this.multipassEnabled=!1}}q.__decorate([f.parameter({count:p.ShaderOutput.COUNT})],z.prototype,"output",void 0);q.__decorate([f.parameter({count:c.CullFaceOptions.COUNT})],z.prototype,"cullFace",void 0);q.__decorate([f.parameter({count:m.Style.COUNT})],z.prototype,"style",void 0);q.__decorate([f.parameter({count:t.TransparencyPassType.COUNT})],
z.prototype,"transparencyPassType",void 0);q.__decorate([f.parameter()],z.prototype,"hasSlicePlane",void 0);q.__decorate([f.parameter()],z.prototype,"hasVertexColors",void 0);q.__decorate([f.parameter()],z.prototype,"polygonOffset",void 0);q.__decorate([f.parameter()],z.prototype,"hasOccludees",void 0);q.__decorate([f.parameter()],z.prototype,"patternSpacing",void 0);q.__decorate([f.parameter()],z.prototype,"lineWidth",void 0);q.__decorate([f.parameter()],z.prototype,"enableOffset",void 0);q.__decorate([f.parameter()],
z.prototype,"draped",void 0);q.__decorate([f.parameter()],z.prototype,"multipassEnabled",void 0);q.__decorate([f.parameter()],z.prototype,"cullAboveGround",void 0);q.__decorate([f.parameter()],z.prototype,"vvColor",void 0);q.__decorate([f.parameter({constValue:!0})],z.prototype,"writeDepth",void 0);q.__decorate([f.parameter({constValue:!1})],z.prototype,"occlusionPass",void 0);q.__decorate([f.parameter({constValue:!1})],z.prototype,"hasVvInstancing",void 0);q.__decorate([f.parameter({constValue:!1})],
z.prototype,"vvSize",void 0);q.__decorate([f.parameter({constValue:!1})],z.prototype,"vvOpacity",void 0);const A=new Map([[w.VertexAttribute.POSITION,0],[w.VertexAttribute.COLOR,3],[w.VertexAttribute.UVMAPSPACE,4],[w.VertexAttribute.COLORFEATUREATTRIBUTE,5],[w.VertexAttribute.BOUNDINGRECT,6]]),B=new Map([[w.VertexAttribute.POSITION,0],[w.VertexAttribute.COLOR,3],[w.VertexAttribute.UVMAPSPACE,4],[w.VertexAttribute.COLORFEATUREATTRIBUTE,5],[w.VertexAttribute.BOUNDINGRECT,6],[w.VertexAttribute.OBJECTANDLAYERIDCOLOR,
9]]);b.PatternTechnique=x;b.PatternTechniqueConfiguration=z;b.vertexAttributeLocations=A;b.vertexAttributeLocationsOID=B;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Pattern.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute ../views/3d/webgl-engine/materials/PatternStyle".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){function x(A){const B=new m.ShaderBuilder,C=A.multipassEnabled&&A.output===b.ShaderOutput.Color,{vertex:D,fragment:F,attributes:H,varyings:N}=B;d.addProjViewLocalOrigin(D,A);B.include(l.Transform,A);B.include(k.VertexColor,A);B.include(c.VisualVariables,A);B.include(p.ObjectAndLayerIdColor,A);A.draped?D.uniforms.add(new w.FloatPassUniform("worldToScreenRatio",(G,I)=>1/I.screenToPCSRatio)):H.add(n.VertexAttribute.BOUNDINGRECT,"mat3");H.add(n.VertexAttribute.POSITION,
"vec3");H.add(n.VertexAttribute.UVMAPSPACE,"vec4");A.vvColor&&H.add(n.VertexAttribute.COLORFEATUREATTRIBUTE,"float");N.add("vColor","vec4");N.add("vpos","vec3");N.add("vuv","vec2");C&&N.add("depth","float");D.uniforms.add(new t.Float4PassUniform("uColor",G=>G.color));const E=A.style===u.Style.ForwardDiagonal||A.style===u.Style.BackwardDiagonal||A.style===u.Style.DiagonalCross;E&&D.code.add(v.glsl`
const mat2 rotate45 = mat2(${v.glsl.float(.70710678118)}, ${v.glsl.float(-.70710678118)},
${v.glsl.float(.70710678118)}, ${v.glsl.float(.70710678118)});
`);A.draped||(d.addCameraPosition(D,A),D.uniforms.add(new w.FloatPassUniform("worldToScreenPerDistanceRatio",(G,I)=>1/I.camera.perScreenPixelRatio)),D.code.add(v.glsl`vec3 projectPointToLineSegment(vec3 center, vec3 halfVector, vec3 point) {
float projectedLength = dot(halfVector, point - center) / dot(halfVector, halfVector);
return center + halfVector * clamp(projectedLength, -1.0, 1.0);
}`),D.code.add(v.glsl`vec3 intersectRayPlane(vec3 rayDir, vec3 rayOrigin, vec3 planeNormal, vec3 planePoint) {
float d = dot(planeNormal, planePoint);
float t = (d - dot(planeNormal, rayOrigin)) / dot(planeNormal, rayDir);
return rayOrigin + t * rayDir;
}`),D.code.add(v.glsl`
float boundingRectDistanceToCamera() {
vec3 center = vec3(boundingRect[0][0], boundingRect[0][1], boundingRect[0][2]);
vec3 halfU = vec3(boundingRect[1][0], boundingRect[1][1], boundingRect[1][2]);
vec3 halfV = vec3(boundingRect[2][0], boundingRect[2][1], boundingRect[2][2]);
vec3 n = normalize(cross(halfU, halfV));
vec3 viewDir = - vec3(view[0][2], view[1][2], view[2][2]);
float viewAngle = dot(viewDir, n);
float minViewAngle = ${v.glsl.float(.08715574274)};
if (abs(viewAngle) < minViewAngle) {
// view direction is (almost) parallel to plane -> clamp it to min angle
float normalComponent = sign(viewAngle) * minViewAngle - viewAngle;
viewDir = normalize(viewDir + normalComponent * n);
}
// intersect view direction with infinite plane that contains bounding rect
vec3 planeProjected = intersectRayPlane(viewDir, cameraPosition, n, center);
// clip to bounds by projecting to u and v line segments individually
vec3 uProjected = projectPointToLineSegment(center, halfU, planeProjected);
vec3 vProjected = projectPointToLineSegment(center, halfV, planeProjected);
// use to calculate the closest point to camera on bounding rect
vec3 closestPoint = uProjected + vProjected - center;
return length(closestPoint - cameraPosition);
}
`));D.code.add(v.glsl`
vec2 scaledUV() {
vec2 uv = uvMapSpace.xy ${E?" * rotate45":""};
vec2 uvCellOrigin = uvMapSpace.zw ${E?" * rotate45":""};
${A.draped?"":v.glsl`
float distanceToCamera = boundingRectDistanceToCamera();
float worldToScreenRatio = worldToScreenPerDistanceRatio / distanceToCamera;
`}
// Logarithmically discretize ratio to avoid jittering
float step = 0.1;
float discreteWorldToScreenRatio = log(worldToScreenRatio);
discreteWorldToScreenRatio = ceil(discreteWorldToScreenRatio / step) * step;
discreteWorldToScreenRatio = exp(discreteWorldToScreenRatio);
vec2 uvOffset = mod(uvCellOrigin * discreteWorldToScreenRatio, ${v.glsl.float(A.patternSpacing)});
return uvOffset + (uv * discreteWorldToScreenRatio);
}
`);D.code.add(v.glsl`
void main(void) {
vuv = scaledUV();
vpos = position;
${C?"depth \x3d (view * vec4(vpos, 1.0)).z;":""}
forwardNormalizedVertexColor();
forwardObjectAndLayerIdColor();
${A.hasVertexColors?"vColor *\x3d uColor;":A.vvColor?"vColor \x3d uColor * interpolateVVColor(colorFeatureAttribute);":"vColor \x3d uColor;"}
gl_Position = transformPosition(proj, view, vpos);
}
`);B.include(q.SliceDraw,A);F.include(g.ColorConversion);A.draped&&F.uniforms.add(new w.FloatPassUniform("texelSize",(G,I)=>1/I.camera.pixelRatio));A.output===b.ShaderOutput.Highlight&&B.include(h.OutputHighlight,A);C&&B.include(f.multipassTerrainTest,A);A.output!==b.ShaderOutput.Highlight&&(F.code.add(v.glsl`
const float lineWidth = ${v.glsl.float(A.lineWidth)};
const float spacing = ${v.glsl.float(A.patternSpacing)};
const float spacingINV = ${v.glsl.float(1/A.patternSpacing)};
float coverage(float p, float txlSize) {
p = mod(p, spacing);
float halfTxlSize = txlSize / 2.0;
float start = p - halfTxlSize;
float end = p + halfTxlSize;
float coverage = (ceil(end * spacingINV) - floor(start * spacingINV)) * lineWidth;
coverage -= min(lineWidth, mod(start, spacing));
coverage -= max(lineWidth - mod(end, spacing), 0.0);
return coverage / txlSize;
}
`),A.draped||F.code.add(v.glsl`const int maxSamples = 5;
float sampleAA(float p) {
vec2 dxdy = abs(vec2(dFdx(p), dFdy(p)));
float fwidth = dxdy.x + dxdy.y;
ivec2 samples = 1 + ivec2(clamp(dxdy, 0.0, float(maxSamples - 1)));
vec2 invSamples = 1.0 / vec2(samples);
float accumulator = 0.0;
for (int j = 0; j < maxSamples; j++) {
if(j >= samples.y) {
break;
}
for (int i = 0; i < maxSamples; i++) {
if(i >= samples.x) {
break;
}
vec2 step = vec2(i,j) * invSamples - 0.5;
accumulator += coverage(p + step.x * dxdy.x + step.y * dxdy.y, fwidth);
}
}
accumulator /= float(samples.x * samples.y);
return accumulator;
}`));A.transparencyPassType===r.TransparencyPassType.ColorAlpha&&(B.outputs.add("fragColor","vec4",0),B.outputs.add("fragAlpha","float",1));F.code.add(v.glsl`
void main() {
discardBySlice(vpos);
${C?"terrainDepthTest(depth);":""}
vec4 color = vColor;
color = highlightSlice(color, vpos);
${A.output!==b.ShaderOutput.Highlight?v.glsl`color.a *= ${y(A)};`:""}
${A.output===b.ShaderOutput.ObjectAndLayerIdColor?v.glsl`color.a = 1.0;`:""}
if (color.a < ${v.glsl.float(e.symbolAlphaCutoff)}) {
discard;
}
${A.output===b.ShaderOutput.Color?v.glsl`fragColor = color; ${A.transparencyPassType===r.TransparencyPassType.ColorAlpha?v.glsl`
fragColor = premultiplyAlpha(fragColor);
fragAlpha = fragColor.a;`:""}`:""}
${A.output===b.ShaderOutput.Highlight?v.glsl`outputHighlight();`:""}
${A.output===b.ShaderOutput.ObjectAndLayerIdColor?v.glsl`outputObjectAndLayerIdColor();`:""}
}
`);return B}function y(A){function B(C){return A.draped?v.glsl`coverage(vuv.${C}, texelSize)`:v.glsl`sampleAA(vuv.${C})`}switch(A.style){case u.Style.ForwardDiagonal:case u.Style.Horizontal:return B("y");case u.Style.BackwardDiagonal:case u.Style.Vertical:return B("x");case u.Style.DiagonalCross:case u.Style.Cross:return v.glsl`
1.0 - (1.0 - ${B("x")}) * (1.0 - ${B("y")})
`;default:return"0.0"}}const z=Object.freeze(Object.defineProperty({__proto__:null,build:x},Symbol.toStringTag,{value:"Module"}));a.Pattern=z;a.build=x})},"esri/views/3d/layers/graphics/Graphics3DTextSymbolLayer":function(){define("exports ../../../../core/Error ../../../../core/has ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../symbols/callouts/calloutUtils ./ElevationAligners ./elevationAlignmentUtils ./ElevationContext ./Graphics3DObject3DGraphicLayer ./Graphics3DObjectMetadata ./Graphics3DSymbolLayer ./graphicUtils ./LabelParameters ./placementUtils ./pointUtils ../../webgl-engine/lib/FontMetrics ../../webgl-engine/lib/GeometryUtil ../../webgl-engine/lib/TextRenderParameters ../../webgl-engine/lib/TextTextureFactory ../../webgl-engine/materials/HUDMaterial".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){function C(E,G,I){E&&E.forEach(O=>{const L=G(O);null!=L&&I(L,O.graphic)})}function D(E,G){if("baseline"===G.verticalPlacement)return h.fromValues(n.horizontalPlacementToAnchorX[G.horizontalPlacement],null!=E?E.baselineAnchorY:0);E=n.anchorFromPlacements(G.horizontalPlacement,G.verticalPlacement);return n.namedAnchorToHUDMaterialAnchorPos[E]}const F=f.fromValues(0,0,1);class H extends v.Graphics3DSymbolLayer{constructor(E,G,I,O){super(E,G,I,
O);this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1};this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const E=m.validateSymbolLayerSize(this.symbolLayer.size);if(E)throw new b("graphics3dtextsymbollayer:invalid-size",E);}await this._createTextRenderParameters()}async _createTextRenderParameters(){this._textRenderParameters=await z.TextRenderParameters.fromSymbol(this.symbolLayer,this._context.graphicsCoreOwner.view.state.rasterPixelRatio)}destroy(){super.destroy()}createGraphics3DGraphic(E){E=
E.graphic;const G=u.placePointOnGeometry(E.geometry);if(null==G)return this.logger.warn(`unsupported geometry type for text symbol: ${E.geometry.type}`),null;const I=this.symbolLayer.text;if(null==I||""===I)return null;var O=c.hasCalloutSupport(this.symbol)&&this.symbol.hasVisibleVerticalOffset()?this.symbol.verticalOffset:null;if(null!=O&&!c.textSymbolLayerSupportsVerticalOffset(this.symbolLayer))return this.logger.errorOncePerTick("Callouts and vertical offset on text symbols are currently only supported with 'center' "+
`horizontal alignment (not with '${this.symbolLayer.horizontalAlignment}' alignment)`),null;var {verticalAlignment:L}=this.symbolLayer;O=new r.LabelPlacement(O);n.verticalScreenOffsetFromAlignment(L,O.screenOffset);L=new r.LabelParameters(O,this.symbolLayer.horizontalAlignment,n.verticalPlacementFromAlignment(L));return this._createAs3DShape(E,G,I,L)}createLabel(E,G,I,O,L){E=E.graphic;const P=u.placePointOnGeometry(E.geometry);if(null==P)return this.logger.warn(`unsupported geometry type for label: ${E.geometry.type}`),
null;const M=G.text;return!M||/^\s+$/.test(M)?null:this._createAs3DShape(E,P,M,G,I,O,L)}setGraphicElevationContext(E,G,I=0){super.setGraphicElevationContext(E,G);G.addOffsetRenderUnits(I);return G}layerOpacityChanged(){this.logger.warn("layer opacity change not yet implemented in Graphics3DTextSymbolLayer");return!1}layerElevationInfoChanged(E,G){C(E,G,(I,O)=>{this.updateGraphicElevationContext(O,I)});return g.SymbolUpdateType.UPDATE}slicePlaneEnabledChanged(E,G){C(E,G,I=>{for(const O of I.stageObject.geometries)O.material.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})});
return!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return!1}updateGraphicElevationContext(E,G){const I=G.elevationContext;this.setGraphicElevationContext(E,I,null!=G.metadata?G.metadata.elevationOffset:0);G.needsElevationUpdates=g.needsElevationUpdates2D(I.mode)||"absolute-height"===I.mode}updateGeometry(E,G){if(this.draped||!this._validateGeometry(G))return!1;const {elevationContext:I,stageObject:O}=E;if(I.mode!==this.getGeometryElevationMode(G))return!1;G=u.placePointOnGeometry(G);
if(!G)return!1;const L=u.updateStageObjectGeometry(O,this._context,G,I);if(null==L)return!1;const P=u.getLocalOriginForPoint(this._context,G);if(O.geometries[0].localOrigin!==P)return!1;E.alignedSampledElevation=L;u.extendPointGraphicElevationContext(E,G,this._context.elevationProvider);return!0}_defaultElevationInfoNoZ(){return N}_createAs3DShape(E,G,I,O,L=null,P=null,M=()=>O.placement.elevationOffset){const K=this.setGraphicElevationContext(E,new d.ElevationContext,O.placement.elevationOffset);
var J="polyline"===E.geometry?.type,R=E.uid;let Q=null,W=null;if(null==P){var S=n.textRenderAlignmentFromHorizontalPlacement(O.horizontalPlacement);Q=new A(I,S,this._textRenderParameters);let Y=null;if(null!=this._context.sharedResources.textures){W=this._context.sharedResources.textures.fromData(Q.key,()=>Q.create());W.texture.events.on("unloaded",()=>Y=l.releaseMaybe(Y));S=this._context.stage.renderView.textures.acquire(W.texture.id);if(null==S||p.isPromiseLike(S))return W.release(),null;Y=S}}var V=
D(Q,O);S={occlusionTest:!q("enable-feature:non-occluded-hud"),screenOffset:O.placement.screenOffset,anchorPosition:V,polygonOffset:!0,color:[1,1,1,1],centerOffsetUnits:O.placement.centerOffsetUnits,drawInSecondSlot:!0};J&&(S.shaderPolygonOffset=1E-4);P?S.textureId=P.id:W&&(S.textureId=W.texture.id);if(null!=O.placement.verticalOffset){const {screenLength:Y,minWorldLength:ha,maxWorldLength:ba}=O.placement.verticalOffset;S.verticalOffset={screenLength:k.pt2px(Y),minWorldLength:ha||0,maxWorldLength:null!=
ba?ba:Infinity}}P={screenOffset:S.screenOffset,anchorPosition:V,centerOffsetUnits:S.centerOffsetUnits,verticalOffset:S.verticalOffset,shaderPolygonOffset:S.shaderPolygonOffset};if(this._context.screenSizePerspectiveEnabled){const {screenSizePerspectiveSettings:Y,screenSizePerspectiveSettingsLabels:ha}=this._context.sharedResources;J=x.getFontMetrics(this._textRenderParameters);S.screenSizePerspective=ha.overrideFontHeight(J.maxHeight);S.screenSizePerspectiveAlignment=Y;P.fontHeight=J.maxHeight}S.hasSlicePlane=
this._context.slicePlaneEnabled;J=(Y,ha,ba)=>{let U=Y.get(ba);null==U&&(U=new B.HUDMaterial(ha),Y.add(ba,U));return U};S=L?J(L,S,JSON.stringify(P)):new B.HUDMaterial(S);P=O.placement.translation;J=Q?h.fromValues(Q.displayWidth,Q.displayHeight):h.ZEROS;V=O.placement.centerOffset;const T=h.create();P=y.createPointGeometry(S,F,P,null,J,V,T,null);R=u.createStageObject(this._context,G,P,K,R);if(null==R)return null;L=new t.Graphics3DObject3DGraphicLayer(this,R.object,[P],null==L?[S]:null,W,(Y,ha,ba,U,Z,
ca)=>{const ea=M()||O.placement.elevationOffset;ha=this.setGraphicElevationContext(E,ha,ea);return e.perObjectElevationAligner(Y,ha,ba,U,Z,ca)},K);L.alignedSampledElevation=R.sampledElevation;L.needsElevationUpdates=g.needsElevationUpdates2D(K.mode)||"absolute-height"===K.mode;L.getScreenSize=(Y=h.create())=>{Y[0]=Q?Q.displayWidth:O.displaySize[0];Y[1]=Q?Q.displayHeight:O.displaySize[1];return Y};I=new w.Graphics3DObjectMetadata(O.placement.elevationOffset,I);L.metadata=I;u.extendPointGraphicElevationContext(L,
G,this._context.elevationProvider);return L}}const N={mode:"relative-to-ground",offset:0};a.Graphics3DTextSymbolLayer=H;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/LabelParameters":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/vec2f64","../../../../core/libs/gl-matrix-2/factories/vec3f64","../../../../core/libs/gl-matrix-2/factories/vec4f64"],function(a,b,q,l){class p{constructor(h,f="center",c=!1,e=b.create(),g=l.fromValues(0,
0,0,-1),d="world",t=q.create(),w=0){this.verticalOffset=h;this.anchor=f;this.hasLabelVerticalOffset=c;this.screenOffset=e;this.centerOffset=g;this.centerOffsetUnits=d;this.translation=t;this.elevationOffset=w}}class k{constructor(h,f="center",c="center",e=null,g=b.create()){this.placement=h;this.horizontalPlacement=f;this.verticalPlacement=c;this.text=e;this.displaySize=g}}a.LabelParameters=k;a.LabelPlacement=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextRenderParameters":function(){define("exports ../../../../Color ../../../../core/fontUtils ../../../../core/Logger ../../../../core/screenUtils ../../../../core/libs/gl-matrix-2/factories/vec4f64".split(" "),
function(a,b,q,l,p,k){function h(g){return`rgb(${g.slice(0,3).map(d=>Math.floor(255*d)).toString()})`}function f(g){return`rgba(${g.slice(0,3).map(d=>Math.floor(255*d)).toString()},${g[3]})`}class c{constructor(g){this.definition=g;this.key=JSON.stringify(g);this.haloSize=Math.round(g.halo.size);this.textStyle=f(g.color);this.haloStyle=h(g.halo.color);this.backgroundStyle=0!==g.background.color[3]?f(g.background.color):null}fontString(g){const d=this.definition.font;return`${d.style} ${d.weight} ${g}px ${d.family}, ${"sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji"}`}setFontProperties(g,
d){g.font=this.fontString(d);g.textAlign="left";g.textBaseline="alphabetic"}static async fromSymbol(g,d){var t=b.toUnitRGBA(g?.material?.color)??k.ZEROS,w=null!=g.size?p.pt2px(g.size):12;const v=g.lineHeight,m=null!=g.background?b.toUnitRGBA(g.background.color):k.ZEROS,r={family:g.font?.family??"sans-serif",decoration:g.font?.decoration??"none",weight:g.font?.weight??"normal",style:g.font?.style??"normal"};var n=g.halo;n=null!=n?.color&&0<n.size?{size:p.pt2px(n.size),color:b.toUnitRGBA(n.color)}:
{size:0,color:k.ZEROS};d=new c({color:t,size:w,background:{color:m,padding:null!=g.background?[.65*w,.5*w]:[0,0],borderRadius:null!=g.background?.375*w:0},lineSpacingFactor:v,font:r,halo:n,pixelRatio:d});if(g.font){t=!1;w=d.fontString(w);try{t=(await document.fonts.load(w)).some(u=>!q.isCachedFontFace(u))}catch(u){l.getLogger("esri.views.3d.webgl-engine.lib.TextRenderParameters").warnOnce(`Failed to preload font '${w}'. Some text symbology may be rendered using the default browser font.`)}if(!t&&
!e.has(g.font.family))try{await q.loadFont(g.font)}catch(u){}}return d}}const e=new Set("Arial;Times New Roman;Courier New;serif;sans-serif;monospace;cursive;fantasy;system-ui;ui-serif;ui-sans-serif;ui-monospace;ui-rounded;math;emoji;fangsong".split(";"));a.TextRenderParameters=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextTextureFactory":function(){define(["./TextHelperCanvas","./TextRenderer","./TextTextureAtlas","./Texture","../../../webgl/enums"],
function(a,b,q,l,p){class k{constructor(f,c,e){this._renderer=new b.TextRenderer(f,c,e,q.TextTextureAtlas.maxSize)}get key(){return this._renderer.key}get baselineAnchorY(){return 1-this._renderer.firstRenderedBaselinePosition/this._renderer.renderedHeight}get displayWidth(){return this._renderer.displayWidth}get displayHeight(){return this._renderer.displayHeight}create(){const f=a.getTextHelperCanvas(h,this._renderer.renderedWidth,this._renderer.renderedHeight),c=f.getContext("2d");c.save();this._renderer.render(c,
0,0);c.restore();return new l.Texture(f,{wrap:{s:p.TextureWrapMode.CLAMP_TO_EDGE,t:p.TextureWrapMode.CLAMP_TO_EDGE},noUnpackFlip:!1,mipmap:!0,preMultiplyAlpha:!0})}}const h={canvas:null};return k})},"esri/views/3d/webgl-engine/lib/TextTextureAtlas":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/has ../../../../core/maybe ../../../../core/uid ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ./ContentObjectType ./testUtils ./textureUtils ./VertexAttribute ../../../support/Scheduler ../../../support/Yield ../../../webgl/enums ../../../webgl/Texture ../../../webgl/TextureDescriptor".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){function A(H,N){H.geometries[0].setAttributeData(r.VertexAttribute.UV0,N.uv);H.geometryVertexAttributeUpdated(H.geometries[0],r.VertexAttribute.UV0,!0)}a.TextTextureAtlas=class extends q{constructor(H){super(H);this.type=w.ContentObjectType.Texture;this.id=h.generateUID();this.events=new l;this._glTexture=null;this._atlas=new C(256,256);this._needsRepack=!1;this._canRepack=!0;this._elementsToRender=new Map;this._elements=new Map;this._stageObjects=
new Map;this.updating=!1}initialize(){this._canvas=document.createElement("canvas");this._canvas.setAttribute("id","textAtlasCanvas");this._canvas.setAttribute("style","display:none");this._ctx=this._canvas.getContext("2d");this._stage=this.view._stage;this._stage.add(this);this._updateCanvasElementSize(this._atlas);this._reset()}unload(){this._glTexture=k.disposeMaybe(this._glTexture);this.updating=!1;this.events.emit("unloaded")}get glTexture(){return this._glTexture}static get maxSize(){F=v.textTextureAtlas.stableRendering?
2:0;return[4094-F,4094-F-2]}load(H){if(this._glTexture)return this._glTexture;const N=new z.TextureDescriptor;N.wrapMode=x.TextureWrapMode.CLAMP_TO_EDGE;N.samplingMode=x.TextureSamplingMode.LINEAR_MIPMAP_LINEAR;N.hasMipmap=!0;N.preMultiplyAlpha=!0;N.maxAnisotropy=H.parameters.maxMaxAnisotropy;this._glTexture=new y.Texture(H,N,this._canvas);this._frameWorker=this.view.resourceController.scheduler.registerTask(n.TaskPriority.TEXT_TEXTURE_ATLAS,this);this.setDirty();return this._glTexture}dispose(){this._elements.clear();
this._elementsToRender.clear();this._frameWorker=k.removeMaybe(this._frameWorker);this._glTexture&&(this._stage.remove(this),this._glTexture=k.disposeMaybe(this._glTexture));this._canvas.width=0;this._canvas.height=0;this._ctx=this._canvas=null}_updateCanvasElementSize(H){this._canvas.setAttribute("width",H.width.toString());this._canvas.setAttribute("height",H.height.toString())}_resizeAtlas(H,N){const {width:E,height:G}=this._atlas;if(E!==H||G!==N)this._atlas.width=H,this._atlas.height=N,this._glTexture?.resize(H,
N),this._glTexture?.updateData(0,0,0,E,G,this._canvas),this._updateCanvasElementSize(this._atlas),this._elements.forEach(I=>{this._stageObjects.get(I.textRenderer.key)?.forEach(O=>A(O,I))}),this._reset()}_reset(){this._elementsToRender.clear();this._atlas.reset();this._needsRepack=!0;this.setDirty()}_addAtlasElement(H,N,E,G){const I=this._atlas;if(I.width<E||I.height<G)return!1;let O=I.cursors.get(G);if(!O){if(I.height<I.nextY+G)return!1;O=[new D(I.nextY)];I.cursors.set(G,O);I.nextY+=G}let L=O.find(P=>
I.width>=P.x+E);if(null==L){if(I.height<I.nextY+G)return!1;L=new D(I.nextY);I.nextY+=G;O.push(L)}H.setNewPosition(L);this._elements.set(N,H);this._elementsToRender.set(N,H);L.x+=E;return!0}_ensureStageObjects(H){var N=this._stageObjects.get(H);if(N)return N;N=new Set;this._stageObjects.set(H,N);return N}_addStageObject(H,N){this._ensureStageObjects(H).add(N)}_removeStageObject(H,N){this._stageObjects.get(H)?.delete(N)&&(N.geometries[0].setAttributeData(r.VertexAttribute.SIZE,[0,0]),N.geometryVertexAttributeUpdated(N.geometries[0],
r.VertexAttribute.SIZE),this._elementsToRender.delete(H))}_processAddition(H){const N=H.textRenderer.key;if(this._needsRepack)this._elements.set(N,H);else{var E=this._atlas,G=H.textRenderer.renderedWidth+2,I=H.textRenderer.renderedHeight+2+2;this._addAtlasElement(H,N,G,I)||(this._canRepack?this._reset():E.width<G?(G=Math.min(m.applyTextureResizeModulo(Math.max(G,1.5*E.width)),4096),this._resizeAtlas(G,E.height)):(G=Math.min(m.applyTextureResizeModulo(Math.max(E.nextY+I,1.5*E.height)),4096),G>E.height?
this._resizeAtlas(E.width,G):4096>E.width&&(G=Math.min(m.applyTextureResizeModulo(1.5*E.width),4096),this._resizeAtlas(G,E.height))),this._elements.set(N,H))}}_renderElement(H){const N=H.commitNewPosition(),E=H.textRenderer;this._ctx.clearRect(N[0]-2,N[1]-2,E.renderedWidth+4,E.renderedHeight+4);E.render(this._ctx,N[0],N[1]);this._stageObjects.get(E.key)?.forEach(G=>A(G,H))}get running(){return this.updating}runTask(H){if(null==this._glTexture)return u.Yield;for(;this._needsRepack&&(this._canRepack||
4096>this._atlas.height&&4096>this._atlas.height);){this._canRepack=this._needsRepack=!1;const N=this._elements;this._elements=new Map;N.forEach(E=>this._processAddition(E));H.madeProgress()}if(0<this._elementsToRender.size){for(const [N,E]of this._elementsToRender){if(H.done)break;this._renderElement(E);this._elementsToRender.delete(N);H.madeProgress()}this._glTexture.setData(this._canvas)}this.updating=0<this._elementsToRender.size}addTextTexture(H,N){var E=H.key;this._addStageObject(E,N);E=this._elements.get(E);
null==E&&(E=new B(this._atlas,H),this._processAddition(E),this.setDirty());N.geometries[0].setAttributeData(r.VertexAttribute.SIZE,[E.textRenderer.displayWidth,E.textRenderer.displayHeight]);N.geometryVertexAttributeUpdated(N.geometries[0],r.VertexAttribute.SIZE);A(N,E)}removeTextTexture(H,N){H=H.key;this._elements.get(H)&&(this._removeStageObject(H,N),(N=this._stageObjects.get(H))&&0!==N.size||this._elements.delete(H),0===N?.size&&this._stageObjects.delete(H),this._canRepack=!0)}setDirty(){this._glTexture&&
(this.updating=!0)}get test(){}};b.__decorate([f.property({constructOnly:!0})],a.TextTextureAtlas.prototype,"view",void 0);b.__decorate([f.property({type:Boolean})],a.TextTextureAtlas.prototype,"updating",void 0);a.TextTextureAtlas=b.__decorate([g.subclass("esri.views.3d.webgl-engine.lib.TextTextureAtlas")],a.TextTextureAtlas);class B{constructor(H,N){this._atlas=H;this.textRenderer=N;this._uv=t.create();this._newPosition=[0,0]}get uv(){if(null==this._xOffset||null==this._yOffset)return t.ZEROS;const {renderedWidth:H,
renderedHeight:N}=this.textRenderer;return d.set(this._uv,this._xOffset/this._atlas.width,(this._yOffset+N)/this._atlas.height,(this._xOffset+H)/this._atlas.width,this._yOffset/this._atlas.height)}setNewPosition(H){this._newPosition[0]=H.x;this._newPosition[1]=H.y}commitNewPosition(){this._xOffset=this._newPosition[0];this._yOffset=this._newPosition[1];return this._newPosition}get xOffset(){return this._xOffset}get yOffset(){return this._yOffset}}class C{constructor(H,N){this.width=H;this.height=
N;this.cursors=new Map;this.nextY=0}reset(){this.cursors.clear();this.nextY=F}}class D{constructor(H){this.y=H;this.x=F}}let F=0;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DWaterSymbolLayer":function(){define("exports ../../../../Color ../../../../core/unitUtils ../../../../chunks/earcut ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/math/common ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/DoubleArray ./ElevationAligners ./elevationAlignmentUtils ./Graphics3DDrapedGraphicLayer ./Graphics3DObject3DGraphicLayer ./Graphics3DSymbolLayer ./polygonUtils ../../support/renderInfoUtils/polygon ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/RenderGeometry ../../webgl-engine/materials/WaterMaterial ../../webgl-engine/materials/internal/waterMaterialUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){function A(I,O,L,P){P=q.getMetersPerUnitForSR(P);e.empty(F);for(var M=0;M<L;M++)p.set(H,O[3*M],O[3*M+1]),e.expandPointInPlace(F,H);h.scale(F,F,P);M=F[1]%C.unitSizeOfTexture;D[0]=F[0]-F[0]%C.unitSizeOfTexture;D[1]=F[1]-M;for(M=0;M<L;M++)I[2*M]=(O[3*M]*P-D[0])/C.unitSizeOfTexture,I[2*M+1]=(O[3*M+1]*P-D[1])/C.unitSizeOfTexture}const B=["polyline","polygon","extent"];class C extends m.Graphics3DSymbolLayer{constructor(I,O,L,P){super(I,O,L,P)}async doLoad(){}destroy(){super.destroy();
this._context.stage.remove(this._materials[0]);this._materials.length=0}createGraphics3DGraphic(I){I=I.graphic;if(!this._validateGeometry(I.geometry,B,this.symbolLayer.type))return null;const O=this.setGraphicElevationContext(I);this.ensureDrapedStatus("on-the-ground"===O.mode);this.ensureMaterial();return this.draped?this._createAsOverlay(I):this._createAs3DShape(I,O,I.uid)}ensureMaterial(){if(!this._materials[0]){var I=new y.WaterMaterialParameters,O=this.symbolLayer.color;null!=O&&(I.color=b.toUnitRGBA(O));
O=this._getCombinedOpacity(O,{hasIntrinsicColor:!0});I.color=[I.color[0],I.color[1],I.color[2],O];I.transparent=1>O||this.needsDrivenTransparentPass;I.waveDirection=null!=this.symbolLayer.waveDirection?C.headingVectorFromAngle(this.symbolLayer.waveDirection):k.fromValues(0,0);O=z.wavePresets[this.symbolLayer.waveStrength+"-"+this.symbolLayer.waterbodySize];I.waveStrength=O.waveStrength;I.waveTextureRepeat=O.textureRepeat;I.waveVelocity=O.waveVelocity;I.flowStrength=O.perturbationStrength;I.hasSlicePlane=
this._context.slicePlaneEnabled;I.draped=this.draped;this._materials[0]=new y.WaterMaterial(I);this._context.stage.add(this._materials[0])}}layerOpacityChanged(){if(null!=this._materials[0]){var I=this._materials[0].parameters.color,O=this._getCombinedOpacity(this.symbolLayer.color,{hasIntrinsicColor:!0});this._materials[0].setParameters({color:[I[0],I[1],I[2],O],transparent:1>O||this.needsDrivenTransparentPass})}}layerElevationInfoChanged(I,O,L){const P=this._elevationContext.mode;L=t.elevationModeChangeUpdateType(C.elevationModeChangeTypes,
L,P);if(L!==t.SymbolUpdateType.UPDATE)return L;const M=t.needsElevationUpdates2D(P);return this.updateGraphics3DGraphicElevationInfo(I,O,()=>M)}slicePlaneEnabledChanged(){this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(I,O,L){const P=r.geometryAsPolygon(I.geometry);if(null==P)return null;const M=n.geometryToRenderInfo(P,this._context.elevationProvider,this._context.renderCoordsHelper,O),K=M.position.length/
3,J=g.newDoubleArray(2*K);A(J,M.mapPositions,K,this._context.elevationProvider.spatialReference);I=new E(M,J,this._context.layer.uid,I.uid);I.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(I);this._create3DShapeGeometries(I);this._logGeometryCreationWarnings(I.renderData,P.rings,"rings","WaterSymbol3DLayer");if(0===I.outGeometries.length)return null;L=new u.Object3D({geometries:I.outGeometries,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:L});L=new v.Graphics3DObject3DGraphicLayer(this,
L,I.outGeometries,null,null,d.perVertexElevationAligner,O);L.alignedSampledElevation=I.renderData.sampledElevation;L.needsElevationUpdates=t.needsElevationUpdates2D(O.mode);return L}_create3DShapeGeometries(I){var O=I.renderData.polygons;const L=I.uvCoords;for(const {count:P,index:M,position:K,mapPositions:J,holeIndices:R}of O){if(null!=this._context.clippingExtent&&(c.empty(N),c.expandWithBuffer(N,J),!c.intersectsClippingArea(N,this._context.clippingExtent)))continue;O=l.earcut(J,R,3);if(0===O.length)continue;
const Q=g.doubleSubArray(L,2*M,2*P);O=r.createWaterGeometry({material:this._materials[0],indices:O,mapPositions:J,attributeData:{position:K,uv0:Q}},I.objectAndLayerIdColor);I.outGeometries.push(O)}}_createAsOverlay(I){const O=r.geometryAsPolygon(I.geometry);if(null==O)return null;this._materials[0].renderPriority=this._renderPriority;const L=n.geometryToRenderInfoDraped(O,this._context.overlaySR),P=L.position.length/3,M=g.newDoubleArray(2*P);A(M,L.position,P,this._context.overlaySR);I=new G(L,M,this._context.layer.uid,
I.uid);I.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(I);I.outBoundingBox=c.empty();this._createAsOverlayWater(I);this._logGeometryCreationWarnings(I.renderData,O.rings,"rings","WaterSymbol3DLayer");return 0===I.outGeometries.length?null:new w.Graphics3DDrapedGraphicLayer(this,I.outGeometries,I.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayWater(I){const O=I.uvCoords;var L=I.renderData.polygons;for(const {position:P,holeIndices:M,index:K,count:J}of L){c.empty(N);
c.expandWithBuffer(N,P);if(!c.intersectsClippingArea(N,this._context.clippingExtent))continue;c.expandWithAABB(I.outBoundingBox,N);L=l.earcut(P,M,3);if(0===L.length)continue;const R=g.doubleSubArray(O,2*K,2*J);L=r.createWaterGeometry({material:this._materials[0],indices:L,attributeData:{position:P,uv0:R}},I.objectAndLayerIdColor);I.outGeometries.push(new x.RenderGeometry(L,I))}}static headingVectorFromAngle(I){const O=k.create();I=f.toRadian(I);O[0]=Math.sin(I);O[1]=Math.cos(I);return O}test(){return{...super.test(),
create3DShape:I=>this._createAs3DShape(I.graphic,I.elevationContext,I.graphicUid),ensureMaterial:()=>this.ensureMaterial()}}}C.unitSizeOfTexture=100;C.elevationModeChangeTypes={definedChanged:t.SymbolUpdateType.RECREATE,staysOnTheGround:t.SymbolUpdateType.NONE,onTheGroundChanged:t.SymbolUpdateType.RECREATE};const D=k.create(),F=e.create(),H=k.create(),N=c.create();class E extends r.PolygonCreationDataBase{constructor(I,O,L,P){super(I,L,P);this.uvCoords=O}}class G extends r.PolygonCreationDataBase{constructor(I,
O,L,P){super(I,L,P);this.uvCoords=O}}a.Graphics3DWaterSymbolLayer=C;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/WaterMaterial":function(){define("exports ../../../../core/has ../../../../core/time ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../core/shaderLibrary/ShaderOutput ../lib/AnimationTimer ../lib/Material ../lib/OrderIndependentTransparency ../lib/RenderSlot ./DefaultBufferWriter ./DefaultLayouts ./TriangleMaterial ./WaterGLMaterial ./WaterTechnique".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){class r extends w.TriangleMaterial{constructor(u){super(u,new n);this._configuration=new m.WaterTechniqueConfiguration;this._animation=new f.AnimationTimer;this.produces=new Map([[g.RenderSlot.OPAQUE_MATERIAL,x=>h.isColor(x)&&!this.parameters.transparent||h.isOIDorHighlight(x)],[g.RenderSlot.TRANSPARENT_MATERIAL,x=>h.isColor(x)&&this.parameters.transparent||h.isOIDorHighlight(x)],[g.RenderSlot.DRAPED_MATERIAL,x=>this.parameters.draped&&x===h.ShaderOutput.Color||
h.isOIDorHighlight(x)],[g.RenderSlot.DRAPED_WATER,x=>x===h.ShaderOutput.Normal]])}getConfiguration(u,x){this._configuration.output=u;this._configuration.writeDepth=!0;this._configuration.receiveShadows=this.parameters.receiveShadows;this._configuration.hasSlicePlane=this.parameters.hasSlicePlane;this._configuration.transparent=this.parameters.transparent;this._configuration.hasScreenSpaceReflections=this.parameters.hasScreenSpaceReflections;this._configuration.hasCloudsReflections=this.parameters.hasCloudsReflections;
this._configuration.draped=this.parameters.draped;this._configuration.transparencyPassType=x.transparencyPassType;this._configuration.enableOffset=x.camera.relativeElevation<e.OITPolygonOffsetLimit;this._configuration.multipassEnabled=x.multipassEnabled;this._configuration.cullAboveGround=x.multipassTerrain.cullAboveGround;return this._configuration}update(u){this._animation.enabled=35E3>Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*Math.min(u.camera.relativeElevation,
u.camera.distance);u=this._animation.advance(u);this.setParameters({timeElapsed:q.secondsFromMilliseconds(this._animation.time)*this.parameters.animationSpeed},!1);return this._animation.enabled&&u}createGLMaterial(u){return new v.WaterGLMaterial(u)}createBufferWriter(){return new d.DefaultBufferWriter(b("enable-feature:objectAndLayerId-rendering")?t.PositionUVLayoutObjectAndLayerId:t.PositionUVLayout)}get test(){}}class n extends c.MaterialParameters{constructor(){super(...arguments);this.waveStrength=
.06;this.waveTextureRepeat=32;this.waveDirection=l.fromValues(1,0);this.waveVelocity=.05;this.flowStrength=.015;this.flowOffset=-.5;this.animationSpeed=.35;this.timeElapsed=0;this.color=k.fromValues(0,0,0,0);this.transparent=!0;this.draped=this.hasSlicePlane=!1;this.receiveShadows=!0;this.hasCloudsReflections=this.hasScreenSpaceReflections=!1;this.origin=p.create();this.modelTransformation=null}}a.WaterMaterial=r;a.WaterMaterialParameters=n;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/materials/WaterGLMaterial":function(){define(["exports","../core/shaderLibrary/ShaderOutput","../lib/GLMaterial","./WaterTechnique"],function(a,b,q,l){class p extends q{_updateShadowState(k){k.shadowMap.enabled!==this._material.parameters.receiveShadows&&this._material.setParameters({receiveShadows:k.shadowMap.enabled})}_updateSSRState(k){k=null!=k.ssr.lastFrameColor;k!==this._material.parameters.hasScreenSpaceReflections&&this._material.setParameters({hasScreenSpaceReflections:k})}_updateCloudsReflectionState(k){k=
null!=k.cloudsFade.data;k!==this._material.parameters.hasCloudsReflections&&this._material.setParameters({hasCloudsReflections:k})}ensureResources(k){return this._techniques.constructionContext.waterTextures.ensureResources(k)}beginSlot(k){this._output===b.ShaderOutput.Color&&(this._updateShadowState(k),this._updateSSRState(k),this._updateCloudsReflectionState(k));this._material.setParameters(this._techniques.constructionContext.waterTextures.passParameters);return this.ensureTechnique(l.WaterTechnique,
k)}}a.WaterGLMaterial=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/WaterTechnique":function(){define("require exports ../../../../chunks/tslib.es6 ../../../ViewingMode ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../core/shaderLibrary/shading/WaterDistortion.glsl ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/DefaultVertexAttributeLocations ../lib/OrderIndependentTransparency ../lib/Program ../lib/TransparencyPassType ./DefaultTechniqueConfiguration ../../../../chunks/WaterSurface.glsl ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){class n extends h.WaterDistortionPassParameters{}class u extends c.ShaderTechnique{initializeConfiguration(y,z){z.spherical=y.viewingMode===l.ViewingMode.Global;z.doublePrecisionRequiresObfuscation=y.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(y){return new t.Program(y.rctx,u.shader.get().build(this.configuration),g.Default3D)}_setPipelineState(y){const z=this.configuration,A=y===w.TransparencyPassType.NONE,B=y===w.TransparencyPassType.FrontFace;
return r.makePipelineState({blending:z.output!==p.ShaderOutput.Normal&&z.output!==p.ShaderOutput.Highlight&&z.output!==p.ShaderOutput.ObjectAndLayerIdColor&&z.transparent?A?d.blendingDefault:d.oitBlending(y):null,depthTest:z.draped?null:{func:d.oitDepthTest(y)},depthWrite:z.draped?null:A?z.writeDepth?r.defaultDepthWriteParams:null:d.oitDepthWrite(y),drawBuffers:d.oitDrawBuffers(y),colorWrite:r.defaultColorWriteParams,polygonOffset:A||B?null:d.getOITPolygonOffset(z.enableOffset)})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}}
u.shader=new f.ReloadableShaderModule(m.WaterSurface,()=>new Promise((y,z)=>a(["../shaders/WaterSurface.glsl"],y,z)));class x extends v.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=p.ShaderOutput.Color;this.transparencyPassType=w.TransparencyPassType.NONE;this.transparent=this.hasSlicePlane=this.receiveShadows=this.spherical=!1;this.enableOffset=!0;this.cullAboveGround=this.multipassEnabled=this.draped=this.objectAndLayerIdColorInstanced=this.hasCloudsReflections=this.doublePrecisionRequiresObfuscation=
this.hasScreenSpaceReflections=this.writeDepth=!1}}q.__decorate([e.parameter({count:p.ShaderOutput.COUNT})],x.prototype,"output",void 0);q.__decorate([e.parameter({count:w.TransparencyPassType.COUNT})],x.prototype,"transparencyPassType",void 0);q.__decorate([e.parameter()],x.prototype,"spherical",void 0);q.__decorate([e.parameter()],x.prototype,"receiveShadows",void 0);q.__decorate([e.parameter()],x.prototype,"hasSlicePlane",void 0);q.__decorate([e.parameter()],x.prototype,"transparent",void 0);q.__decorate([e.parameter()],
x.prototype,"enableOffset",void 0);q.__decorate([e.parameter()],x.prototype,"writeDepth",void 0);q.__decorate([e.parameter()],x.prototype,"hasScreenSpaceReflections",void 0);q.__decorate([e.parameter()],x.prototype,"doublePrecisionRequiresObfuscation",void 0);q.__decorate([e.parameter()],x.prototype,"hasCloudsReflections",void 0);q.__decorate([e.parameter()],x.prototype,"objectAndLayerIdColorInstanced",void 0);q.__decorate([e.parameter()],x.prototype,"draped",void 0);q.__decorate([e.parameter()],
x.prototype,"multipassEnabled",void 0);q.__decorate([e.parameter()],x.prototype,"cullAboveGround",void 0);q.__decorate([e.parameter({constValue:!1})],x.prototype,"occlusionPass",void 0);q.__decorate([e.parameter({constValue:k.PBRMode.Water})],x.prototype,"pbrMode",void 0);q.__decorate([e.parameter({constValue:!0})],x.prototype,"useCustomDTRExponentForWater",void 0);q.__decorate([e.parameter({constValue:!0})],x.prototype,"highStepCount",void 0);q.__decorate([e.parameter({constValue:!1})],x.prototype,
"useFillLights",void 0);b.WaterMaterialPassParameters=n;b.WaterTechnique=u;b.WaterTechniqueConfiguration=x;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/math/vec2 ../../../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../../../chunks/vec42 ../../../../../../core/libs/gl-matrix-2/factories/vec4f64 ./FoamRendering.glsl ./ReadShadowMap.glsl ../../shaderModules/Float2PassUniform ../../shaderModules/Float4PassUniform ../../shaderModules/interfaces ../../shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){class d extends h.ReadShadowMapPassParameters{}const t=p.create(),w=q.create();a.WaterDistortion=function(v){v.fragment.uniforms.add(new g.Texture2DPassUniform("texWaveNormal",m=>m.waveNormal),new g.Texture2DPassUniform("texWavePerturbation",m=>m.wavePerturbation),new c.Float4PassUniform("waveParams",m=>l.set(t,m.waveStrength,m.waveTextureRepeat,m.flowStrength,m.flowOffset)),new f.Float2PassUniform("waveDirection",m=>b.set(w,m.waveDirection[0]*m.waveVelocity,m.waveDirection[1]*
m.waveVelocity)));v.include(k.FoamIntensity);v.fragment.code.add(e.glsl`const vec2 FLOW_JUMP = vec2(6.0/25.0, 5.0/24.0);
vec2 textureDenormalized2D(sampler2D _tex, vec2 _uv) {
return 2.0 * texture(_tex, _uv).rg - 1.0;
}
float sampleNoiseTexture(vec2 _uv) {
return texture(texWavePerturbation, _uv).b;
}
vec3 textureDenormalized3D(sampler2D _tex, vec2 _uv) {
return 2.0 * texture(_tex, _uv).rgb - 1.0;
}
float computeProgress(vec2 uv, float time) {
return fract(time);
}
float computeWeight(vec2 uv, float time) {
float progress = computeProgress(uv, time);
return 1.0 - abs(1.0 - 2.0 * progress);
}
vec3 computeUVPerturbedWeigth(sampler2D texFlow, vec2 uv, float time, float phaseOffset) {
float flowStrength = waveParams[2];
float flowOffset = waveParams[3];
vec2 flowVector = textureDenormalized2D(texFlow, uv) * flowStrength;
float progress = computeProgress(uv, time + phaseOffset);
float weight = computeWeight(uv, time + phaseOffset);
vec2 result = uv;
result -= flowVector * (progress + flowOffset);
result += phaseOffset;
result += (time - progress) * FLOW_JUMP;
return vec3(result, weight);
}
const float TIME_NOISE_TEXTURE_REPEAT = 0.3737;
const float TIME_NOISE_STRENGTH = 7.77;
vec3 getWaveLayer(sampler2D _texNormal, sampler2D _dudv, vec2 _uv, vec2 _waveDir, float time) {
float waveStrength = waveParams[0];
vec2 waveMovement = time * -_waveDir;
float timeNoise = sampleNoiseTexture(_uv * TIME_NOISE_TEXTURE_REPEAT) * TIME_NOISE_STRENGTH;
vec3 uv_A = computeUVPerturbedWeigth(_dudv, _uv + waveMovement, time + timeNoise, 0.0);
vec3 uv_B = computeUVPerturbedWeigth(_dudv, _uv + waveMovement, time + timeNoise, 0.5);
vec3 normal_A = textureDenormalized3D(_texNormal, uv_A.xy) * uv_A.z;
vec3 normal_B = textureDenormalized3D(_texNormal, uv_B.xy) * uv_B.z;
vec3 mixNormal = normalize(normal_A + normal_B);
mixNormal.xy *= waveStrength;
mixNormal.z = sqrt(1.0 - dot(mixNormal.xy, mixNormal.xy));
return mixNormal;
}
vec4 getSurfaceNormalAndFoam(vec2 _uv, float _time) {
float waveTextureRepeat = waveParams[1];
vec3 normal = getWaveLayer(texWaveNormal, texWavePerturbation, _uv * waveTextureRepeat, waveDirection, _time);
float foam = normals2FoamIntensity(normal, waveParams[0]);
return vec4(normal, foam);
}`)};a.WaterDistortionPassParameters=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/WaterSurface.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/TransparencyPassType ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){function C(F){const H=new z.ShaderBuilder,{vertex:N,fragment:E}=H;n.addProjViewLocalOrigin(N,F);H.include(p.Transform,F);H.attributes.add(B.VertexAttribute.POSITION,"vec3");H.attributes.add(B.VertexAttribute.UV0,"vec2");const G=new u.Float4PassUniform("waterColor",I=>I.color);if(F.output===q.ShaderOutput.Color&&F.draped)return H.varyings.add("vpos","vec3"),N.uniforms.add(G),N.code.add(y.glsl`
void main(void) {
if (waterColor.a < ${y.glsl.float(m.symbolAlphaCutoff)}) {
// Discard this vertex
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
return;
}
vpos = position;
gl_Position = transformPosition(proj, view, vpos);
}
`),E.uniforms.add(G),E.code.add(y.glsl`void main() {
fragColor = waterColor;
}`),H;F.output===q.ShaderOutput.Color&&(H.include(g.NormalUtils,F),H.include(b.ForwardLinearDepth,F),H.varyings.add("vuv","vec2"),H.varyings.add("vpos","vec3"),H.varyings.add("vnormal","vec3"),H.varyings.add("vtbnMatrix","mat3"),F.multipassEnabled&&H.varyings.add("depth","float"),N.uniforms.add(G),N.code.add(y.glsl`
void main(void) {
if (waterColor.a < ${y.glsl.float(m.symbolAlphaCutoff)}) {
// Discard this vertex
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
return;
}
vuv = uv0;
vpos = position;
vnormal = getLocalUp(vpos, localOrigin);
vtbnMatrix = getTBNMatrix(vnormal);
${F.multipassEnabled?"depth \x3d (view * vec4(vpos, 1.0)).z;":""}
gl_Position = transformPosition(proj, view, vpos);
${F.output===q.ShaderOutput.Color?"forwardLinearDepth();":""}
}
`));H.include(e.multipassTerrainTest,F);switch(F.output){case q.ShaderOutput.Color:H.include(c.MainLighting);H.include(f.EvaluateAmbientLighting,{pbrMode:d.PBRMode.Disabled,lightingSphericalHarmonicsOrder:2});H.include(v.WaterDistortion);H.include(l.SliceDraw,F);H.include(t.ReadShadowMapDraw,F);H.include(w.Water,F);E.uniforms.add(G,new x.FloatPassUniform("timeElapsed",I=>I.timeElapsed),N.uniforms.get("view"),N.uniforms.get("localOrigin"));n.addCameraPosition(E,F);E.include(r.ColorConversion);
F.transparencyPassType===A.TransparencyPassType.ColorAlpha&&(H.outputs.add("fragColor","vec4",0),H.outputs.add("fragAlpha","float",1));c.addMainLightDirection(E);c.addMainLightIntensity(E);E.code.add(y.glsl`
void main() {
discardBySlice(vpos);
${F.multipassEnabled?"terrainDepthTest(depth);":""}
vec3 localUp = vnormal;
// the created normal is in tangent space
vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed);
// we rotate the normal according to the tangent-bitangent-normal-Matrix
vec3 n = normalize(vtbnMatrix * tangentNormalFoam.xyz);
vec3 v = -normalize(vpos - cameraPosition);
float shadow = ${F.receiveShadows?y.glsl`1.0 - readShadowMap(vpos, linearDepth)`:"1.0"};
vec4 vPosView = view * vec4(vpos, 1.0);
vec4 final = vec4(getSeaColor(n, v, mainLightDirection, waterColor.rgb, mainLightIntensity, localUp, shadow, tangentNormalFoam.w, vPosView.xyz, vpos + localOrigin), waterColor.w);
// gamma correction
fragColor = delinearizeGamma(final);
fragColor = highlightSlice(fragColor, vpos);
${F.transparencyPassType===A.TransparencyPassType.ColorAlpha?y.glsl`
fragColor = premultiplyAlpha(fragColor);
fragAlpha = fragColor.a;`:""}
}
`);break;case q.ShaderOutput.Normal:H.include(g.NormalUtils,F);H.include(v.WaterDistortion,F);H.include(l.SliceDraw,F);H.varyings.add("vpos","vec3");H.varyings.add("vuv","vec2");N.uniforms.add(G);N.code.add(y.glsl`
void main(void) {
if (waterColor.a < ${y.glsl.float(m.symbolAlphaCutoff)}) {
// Discard this vertex
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
return;
}
vuv = uv0;
vpos = position;
gl_Position = transformPosition(proj, view, vpos);
}
`);E.uniforms.add(new x.FloatPassUniform("timeElapsed",I=>I.timeElapsed));E.code.add(y.glsl`void main() {
discardBySlice(vpos);
vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed);
tangentNormalFoam.xyz = normalize(tangentNormalFoam.xyz);
fragColor = vec4((tangentNormalFoam.xyz + vec3(1.0)) * 0.5, tangentNormalFoam.w);
}`);break;case q.ShaderOutput.Highlight:H.include(h.OutputHighlight,F);H.varyings.add("vpos","vec3");N.uniforms.add(G);N.code.add(y.glsl`
void main(void) {
if (waterColor.a < ${y.glsl.float(m.symbolAlphaCutoff)}) {
// Discard this vertex
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
return;
}
vpos = position;
gl_Position = transformPosition(proj, view, vpos);
}
`);H.include(l.SliceDraw,F);E.code.add(y.glsl`void main() {
discardBySlice(vpos);
outputHighlight();
}`);break;case q.ShaderOutput.ObjectAndLayerIdColor:H.include(k.ObjectAndLayerIdColor,F),H.varyings.add("vpos","vec3"),N.uniforms.add(G),N.code.add(y.glsl`
void main(void) {
if (waterColor.a < ${y.glsl.float(m.symbolAlphaCutoff)}) {
// Discard this vertex
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
return;
}
vpos = position;
gl_Position = transformPosition(proj, view, vpos);
forwardObjectAndLayerIdColor();
}
`),H.include(l.SliceDraw,F),E.code.add(y.glsl`void main() {
discardBySlice(vpos);
outputObjectAndLayerIdColor();
}`)}return H}const D=Object.freeze(Object.defineProperty({__proto__:null,build:C},Symbol.toStringTag,{value:"Module"}));a.WaterSurface=D;a.build=C})},"esri/views/3d/webgl-engine/materials/internal/waterMaterialUtils":function(){define(["exports"],function(a){a.wavePresets={"calm-small":{waveStrength:.005,perturbationStrength:.02,textureRepeat:12,waveVelocity:.01},"rippled-small":{waveStrength:.02,perturbationStrength:.09,textureRepeat:32,waveVelocity:.07},"slight-small":{waveStrength:.05,perturbationStrength:.07,
textureRepeat:28,waveVelocity:.1},"moderate-small":{waveStrength:.075,perturbationStrength:.07,textureRepeat:24,waveVelocity:.1},"calm-medium":{waveStrength:.003125,perturbationStrength:.01,textureRepeat:8,waveVelocity:.02},"rippled-medium":{waveStrength:.035,perturbationStrength:.015,textureRepeat:12,waveVelocity:.07},"slight-medium":{waveStrength:.06,perturbationStrength:.015,textureRepeat:8,waveVelocity:.12},"moderate-medium":{waveStrength:.09,perturbationStrength:.03,textureRepeat:4,waveVelocity:.12},
"calm-large":{waveStrength:.01,perturbationStrength:0,textureRepeat:4,waveVelocity:.05},"rippled-large":{waveStrength:.025,perturbationStrength:.01,textureRepeat:8,waveVelocity:.11},"slight-large":{waveStrength:.06,perturbationStrength:.02,textureRepeat:3,waveVelocity:.13},"moderate-large":{waveStrength:.14,perturbationStrength:.03,textureRepeat:2,waveVelocity:.15}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DWebStyleSymbol":function(){define(["exports",
"./defaultSymbolComplexity","./interfaces","./Loadable"],function(a,b,q,l){class p extends l.Loadable{constructor(k,h,f){super(h);this.symbol=k;this._convert=f;this.symbologySnappingSupported=!1;this.graphics3DSymbol=null;this.referenced=0}getSymbolLayerSize(k){return null!=this.graphics3DSymbol?this.graphics3DSymbol.getSymbolLayerSize(k):null}get symbolLayers(){return null!=this.graphics3DSymbol?this.graphics3DSymbol.symbolLayers:[]}get extentPadding(){return null!=this.graphics3DSymbol?this.graphics3DSymbol.extentPadding:
0}async doLoad(k){k=await this.symbol.fetchSymbol({signal:k});k.id=this.symbol.id;this.graphics3DSymbol=this._convert(k);null!=this.graphics3DSymbol&&await this.graphics3DSymbol.load()}createGraphics3DGraphic(k){return null!=this.graphics3DSymbol?this.graphics3DSymbol.createGraphics3DGraphic(k,this):null}get complexity(){return null!=this.graphics3DSymbol?this.graphics3DSymbol.complexity:b.emptySymbolComplexity}globalPropertyChanged(k,h){return null!=this.graphics3DSymbol?this.graphics3DSymbol.globalPropertyChanged(k,
h):!1}applyRendererDiff(k,h){return null!=this.graphics3DSymbol?this.graphics3DSymbol.applyRendererDiff(k,h):q.ApplyRendererDiffResult.RecreateSymbol}prepareSymbolPatch(k){null!=this.graphics3DSymbol&&this.graphics3DSymbol.prepareSymbolPatch(k)}updateGeometry(k,h){return null!=this.graphics3DSymbol?this.graphics3DSymbol.updateGeometry(k,h):!1}updateTransform(k,h,f,c){return this.graphics3DSymbol?.updateTransform(k,h,f,c)??!1}onRemoveGraphic(){}getFastUpdateStatus(){return null!=this.graphics3DSymbol?
this.graphics3DSymbol.getFastUpdateStatus():{loading:1,fast:0,slow:0}}destroy(){null!=this.graphics3DSymbol&&this.graphics3DSymbol.destroy();this.graphics3DSymbol=void 0;super.destroy()}get destroyed(){return void 0===this.graphics3DSymbol}}a.Graphics3DWebStyleSymbol=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/labelPlacement":function(){define("exports ../../../../core/has ../../../../core/Logger ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ./constants ./graphicSymbolUtils ./LabelParameters ../../webgl-engine/lib/TextRenderer ../../webgl-engine/materials/HUDMaterial".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){function d(B){B=f.getGraphics3DSymbol(B.graphics3DGraphic.graphics3DSymbol);return null!=B?B.symbol.symbolLayers.at(0):null}function t(B,C){var D=C.graphics3DGraphic.graphic.geometry;if(null==D)return null;if(null!=C.disablePlacement)return C.labelClass.labelPlacement?(u().warnOncePerTick(w(B?.placement,C.disablePlacement.logEntityDescription)),v(C)):B;D=D.type;switch(D){case "polyline":case "polygon":case "extent":case "multipoint":if(C.labelClass.labelPlacement)return u().warnOncePerTick(w(B?.placement,
`'${D}' geometries`)),v(C)}return B}function w(B,C){return`the requested label placement '${B}' is currently unsupported for ${C} in SceneView.`}function v(B){const C=B.graphics3DGraphic.graphic.geometry;if(null==C)return null;switch(C.type){case "polyline":case "extent":case "multipoint":return{placement:"center-center",normalizedOffset:p.ZEROS,anchor:"center"};case "polygon":return B=d(B),null!=B&&"extrude"===B.type?y["above-center"]:{placement:"center-center",normalizedOffset:p.ZEROS,anchor:"center"};
case "point":return y["above-center"];case "mesh":return y["above-center"]}}function m(B,C=z){({graphics3DGraphic:B}=B);(B=B.layers[0]?.stageObject.geometries[0].material??null)&&B instanceof g.HUDMaterial?(B=B.parameters.anchorPosition,C[0]=2*(B[0]-.5),C[1]=2*(B[1]-.5)):(C[0]=0,C[1]=0);return C}function r(B,C,D){D=null!=D?D.getBoundingBoxObjectSpace(A):A;D=p.fromValues(D[3]-D[0],D[4]-D[1],D[5]-D[2]);B.centerOffset[0]=Math.sqrt(D[0]*D[0]+D[1]*D[1])/2*C.normalizedOffset[0];const F=B.translation[2],
H=D[2]/2*C.normalizedOffset[1];B.translation[2]=0;B.elevationOffset=F+H;D=l.length(D);B.centerOffset[2]=D/2*C.normalizedOffset[2]}function n(B){const C=B.labelClass.labelPlacement,{labelSymbol:D,graphics3DGraphic:F}=B;var H=f.getGraphics3DSymbol(F.graphics3DSymbol);H="point-3d"===H?.symbol.type?H.symbol:null;B=y[C]||v(B);if(null!=H&&H.supportsCallout()&&H.hasVisibleVerticalOffset()&&!F.isDraped)return{placement:null,hasLabelVerticalOffset:!1,verticalOffset:H.verticalOffset.clone(),anchor:null,normalizedOffset:null};
if(D&&D.hasVisibleVerticalOffset()&&(null==H||!H.supportsCallout()||!H.verticalOffset||F.isDraped)){if(!(H=!B)){a:switch(B.placement){case "above-center":H=!0;break a;default:H=!1}H=!H}return H?(u().errorOncePerTick("Callouts and vertical offset on labels are currently only supported with 'above-center' label placement (not with "+C+" placement)"),null):{placement:"above-center",verticalOffset:D.verticalOffset.clone(),anchor:"bottom",normalizedOffset:[0,B.normalizedOffset[1],0],hasLabelVerticalOffset:!0}}return{placement:null,
verticalOffset:null,anchor:null,normalizedOffset:null,hasLabelVerticalOffset:!1}}const u=()=>q.getLogger("esri.views.3d.layers.graphics.labelPlacement");class x{constructor(B,C,D,F=null){this.graphics3DGraphic=B;this.labelSymbol=C;this.labelClass=D;this.disablePlacement=F}}const y={"above-center":{placement:"above-center",normalizedOffset:[0,1,0],anchor:"bottom"},"above-left":{placement:"above-left",normalizedOffset:[-1,1,0],anchor:"bottom-right"},"above-right":{placement:"above-right",normalizedOffset:[1,
1,0],anchor:"bottom-left"},"below-center":{placement:"below-center",normalizedOffset:[0,-1,2],anchor:"top"},"below-left":{placement:"below-left",normalizedOffset:[-1,-1,0],anchor:"top-right"},"below-right":{placement:"below-right",normalizedOffset:[1,-1,0],anchor:"top-left"},"center-center":{placement:"center-center",normalizedOffset:[0,0,1],anchor:"center"},"center-left":{placement:"center-left",normalizedOffset:[-1,0,0],anchor:"right"},"center-right":{placement:"center-right",normalizedOffset:[1,
0,0],anchor:"left"}};b={"above-center":["default","esriServerPointLabelPlacementAboveCenter"],"above-left":["esriServerPointLabelPlacementAboveLeft"],"above-right":["esriServerPointLabelPlacementAboveRight"],"below-center":["esriServerPointLabelPlacementBelowCenter"],"below-left":["esriServerPointLabelPlacementBelowLeft"],"below-right":["esriServerPointLabelPlacementBelowRight"],"center-center":["esriServerPointLabelPlacementCenterCenter"],"center-left":["esriServerPointLabelPlacementCenterLeft"],
"center-right":["esriServerPointLabelPlacementCenterRight"]};for(const B in b){const C=y[B];b[B].forEach(D=>{y[D]=C})}Object.freeze&&(Object.freeze(y),Object.keys(y).forEach(B=>{Object.freeze(y[B]);Object.freeze(y[B]?.normalizedOffset)}));const z=[0,0],A=k.create();a.LabelInfo=x;a.getLabelPlacement=function(B){var C=n(B);if(null==C)return null;if(C.anchor)var D=C;else{D=B.labelClass.labelPlacement;var F=y[D],H=F||v(B);D&&!F&&u().warnOncePerTick(`the requested label placement '${D}' is currently unsupported in SceneView.`);
D=t(H,B)}if(null==D)return null;C=new c.LabelPlacement(C.verticalOffset,D.anchor,!!C.hasLabelVerticalOffset);F=B.graphics3DGraphic.graphic.geometry;if(null==F)B=null;else{switch(F.type){case "point":case "mesh":H=d(B);if(null!=H)switch(F=B.graphics3DGraphic.layers[0],null!=F?F.getCenterObjectSpace(C.translation):l.set(C.translation,0,0,0),H.type){case "icon":case "text":({graphics3DGraphic:H}=B);F=null!=F?F.getScreenSize():null;H.isDraped||null==F?C.hasLabelVerticalOffset||"center"===C.anchor||(y[B.labelClass.labelPlacement]&&
u().warnOncePerTick(`the requested placement '${D.placement}' is currently unsupported for draped graphics`),C.anchor="center"):(B=m(B),C.screenOffset[0]=F[0]/2*(D.normalizedOffset[0]-B[0]),B=F[1]/2*(D.normalizedOffset[1]-B[1]),C.hasLabelVerticalOffset?(C.centerOffset[1]=B,C.centerOffsetUnits="screen"):C.screenOffset[1]=B);break;case "object":case "fill":r(C,D,F)}break;case "polygon":if(F=d(B),null!=F)switch(F.type){case "extrude":B=B.graphics3DGraphic.layers[0],null!=B?(B.getBoundingBoxObjectSpace(A),
k.center(A,C.translation),C.translation[2]=k.height(A)/2):l.set(C.translation,0,0,0),r(C,D,B)}}B=h.labelMarginPx-e.textVerticalPaddingPx;C.screenOffset[0]+=B*D.normalizedOffset[0];C.screenOffset[1]+=B*D.normalizedOffset[1];B=C}return B};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/MaterialCollection":function(){define(["exports"],function(a){class b{constructor(q){this._stage=q;this._materials=new Map}get(q){return this._materials.get(q)}add(q,l){this._materials.set(q,
l);this._stage.add(l)}dispose(){this._stage.removeMany(Array.from(this._materials.values()));this._materials.clear()}}a.MaterialCollection=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileTree3D":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Collection ../../../../core/handleUtils ../../../../core/Logger ../../../../core/maybe ../../../../core/PooledArray ../../../../core/reactiveUtils ../../../../core/uid ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/support/aaBoundingRect ./FeatureTileDescriptor3D ./FeatureTileMeasurements3D ../../support/extentUtils ../../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){a.FeatureTileTree3D=class extends q{get tilingScheme(){const y=this.tilingSchemeOwner.tilingScheme;return y?y.clone():null}set filterExtent(y){if(null==y||y.spatialReference.equals(this.viewState.spatialReference)){var z=this._get("filterExtent");z===y||null!=z&&y&&z.equals(y)||(y=null!=y?y.clone():null,this._set("filterExtent",y),this._setDirty())}else k.getLogger(this).error("#extent","extent spatial reference needs to be in the same spatial reference as the view")}get _filterExtentRect(){if(null==
this.filterExtent)return null;const y=v.create();n.toBoundingRect(this.filterExtent,y,this.tilingScheme.spatialReference);return y}get _rootTileIds(){const {tilingScheme:y}=this;return this._filterExtentRect&&y?y.rootTilesInExtent(this._filterExtentRect):[[0,0,0]]}set suspended(y){y!==this._get("suspended")&&(this._set("suspended",y),this._setDirty())}get updating(){return this._dirty||!!this._pendingTiles}constructor(y){super(y);this.tiles=new l;this.tileSize=512;this._idToTile=new Map;this._clients=
new Set;this._dirty=!1;this._pendingTiles=null;this._newTiles=new f}initialize(){this.addHandles([c.watch(()=>[this.tilingScheme,this.tileSize],()=>this._reset(),c.sync),c.watch(()=>[this.tileSize,this.cameraOnSurface?.location,this.tilingScheme,this.viewState?.contentCamera,this.focus?.location],()=>this._setDirty(),c.syncAndInitial),c.watch(()=>this.terrain?.baseOpacity??1,()=>this._setDirty())]);this.scheduler&&(this._frameWorker=this.scheduler.registerTask(u.TaskPriority.FEATURE_TILE_TREE,this))}destroy(){this._frameWorker=
h.removeMaybe(this._frameWorker)}addClient(){const y=e.generateUID();this._clients.add(y);1===this._clients.size&&this._setDirty();return p.makeHandle(()=>this._removeClient(y))}_removeClient(y){this._clients.delete(y);this._hasClients||this._clear()}get _hasClients(){return 0<this._clients.size}_setDirty(){!this._hasClients||this.suspended||this._dirty||(this._frameWorker?(this._dirty=!0,this.notifyChange("updating")):this.runTask(u.noBudget))}_clear(){this.tiles.removeAll();this._idToTile.clear();
this._reset();this._dirty=!1;this.notifyChange("updating")}get running(){return this.updating}runTask(y){this._dirty=!1;this._pendingTiles||(this._startUpdate(),null!=this._frameWorker&&(this._frameWorker.priority=u.TaskPriority.FEATURE_TILE_TREE_ACTIVE));this._subdivideTilesForView(y);this._pendingTiles||null==this._frameWorker||(this._frameWorker.priority=u.TaskPriority.FEATURE_TILE_TREE);this.notifyChange("updating")}_startUpdate(){this.suspended||(this.tilingScheme?(this._tileMeasurements||(this._tileMeasurements=
new r.FeatureTileMeasurements3D({renderCoordsHelper:this.renderCoordsHelper,tilingScheme:this.tilingScheme,tileSize:this.tileSize,getIsGroundOpaque:()=>1===(this.terrain?.baseOpacity??1)})),this._tileMeasurements.begin(this.viewState.contentCamera,this.focus.location,this.cameraOnSurface.location.z??0),this._pendingTiles=this._getRootTiles()):this._clear())}_reset(){this._newTiles.clear();this._pendingTiles=this._tileMeasurements=null;this._setDirty()}_getRootTiles(){const {tilingScheme:y}=this;return this._rootTileIds.map(z=>
new m.FeatureTileDescriptor3D(z[0],z[1],z[2],y))}_purgeHorizonTiles(y){y.sort((z,A)=>{z=z.measures.screenRect;A=A.measures.screenRect;return z[1]+z[3]-(A[1]+A[3])});if(!(50<y.length))return y.toArray();v.empty(x);for(let z=0;z<y.length;z++)if(v.expand(x,y.data[z].measures.screenRect,x),10<v.height(x))return y.data.slice(z,y.length);return[]}_subdivideTilesForView(y){if(this._pendingTiles){for(var {tilingScheme:z}=this;0<this._pendingTiles.length&&!y.done;){const A=this._pendingTiles.pop();y.madeProgress();
if(!this._filterExtentRect||v.intersects(this._filterExtentRect,A.extent))this._tileMeasurements.updateTile(A),A.measures.visibility!==m.Visibility.INVISIBLE&&(A.measures.shouldSplit?(z.ensureMaxLod(A.lij[0]+1),this._pendingTiles.push(...A.getChildren())):this._newTiles.push(A))}0===this._pendingTiles.length&&(this._updateTiles(this._purgeHorizonTiles(this._newTiles)),this._newTiles.clear(),this._tileMeasurements.end(),this._pendingTiles=null)}}_updateTiles(y){for(var z of this.tiles.items)z.used=
!1;y=y.filter(A=>{const B=this._idToTile.get(A.id);B?(B.copyMeasurementsFrom(A),B.used=!0):this._idToTile.set(A.id,A);return!B});z=this.tiles.items.filter(A=>A.used?!1:(this._idToTile.delete(A.id),!0));this.tiles.removeMany(z);this.tiles.addMany(y);this._sortTiles()}_sortTiles(){this.viewState.fixedContentCamera||this.tiles.sort((y,z)=>y.measures.visibility!==z.measures.visibility?y.measures.visibility===m.Visibility.VISIBLE_ON_SURFACE?-1:1:y.measures.distance-z.measures.distance);this.tiles.forEach((y,
z)=>y.loadPriority=z)}};b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype,"scheduler",void 0);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype,"renderCoordsHelper",void 0);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype,"tilingSchemeOwner",void 0);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype,"cameraOnSurface",void 0);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype,
"focus",void 0);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype,"viewState",void 0);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileTree3D.prototype,"terrain",void 0);b.__decorate([g.property()],a.FeatureTileTree3D.prototype,"tiles",void 0);b.__decorate([g.property()],a.FeatureTileTree3D.prototype,"tileSize",void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileTree3D.prototype,"tilingScheme",null);b.__decorate([g.property()],a.FeatureTileTree3D.prototype,
"filterExtent",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileTree3D.prototype,"_filterExtentRect",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileTree3D.prototype,"_rootTileIds",null);b.__decorate([g.property({value:!1})],a.FeatureTileTree3D.prototype,"suspended",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileTree3D.prototype,"updating",null);a.FeatureTileTree3D=b.__decorate([w.subclass("esri.views.3d.layers.support.FeatureTileTree3D")],a.FeatureTileTree3D);
const x=v.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileDescriptor3D":function(){define(["exports","../../../../geometry/support/aaBoundingRect"],function(a,b){class q{constructor(l,p,k,h=null){this.lij=[0,0,0];this.extent=b.create();this.loadPriority=this.resolution=0;this.measures={visibility:a.Visibility.VISIBLE_ON_SURFACE,screenRect:b.create(),distance:0,shouldSplit:!1};this.used=!1;h&&this.acquire(l,p,k,h)}acquire(l,p,k,h){this.tilingScheme=
h;this.id=q.id(l,p,k);this.lij[0]=l;this.lij[1]=p;this.lij[2]=k;h.getExtent(l,p,k,this.extent);this.resolution=h.resolutionAtLevel(l)}release(){this.tilingScheme=null}getChildren(l){const p=this.lij[0]+1,k=2*this.lij[1],h=2*this.lij[2];if(!l)return[new q(p,k,h,this.tilingScheme),new q(p,k+1,h,this.tilingScheme),new q(p,k,h+1,this.tilingScheme),new q(p,k+1,h+1,this.tilingScheme)];l[0].acquire(p,k,h,this.tilingScheme);l[1].acquire(p,k+1,h,this.tilingScheme);l[2].acquire(p,k,h+1,this.tilingScheme);l[3].acquire(p,
k+1,h+1,this.tilingScheme);return l}copyMeasurementsFrom(l){this.measures.visibility=l.measures.visibility;this.measures.shouldSplit=l.measures.shouldSplit;this.measures.distance=l.measures.distance;b.copy(l.measures.screenRect,this.measures.screenRect)}static id(l,p,k){return`${l}/${p}/${k}`}}a.Visibility=void 0;(function(l){l[l.INVISIBLE=0]="INVISIBLE";l[l.VISIBLE_WHEN_EXTENDED=1]="VISIBLE_WHEN_EXTENDED";l[l.VISIBLE_ON_SURFACE=2]="VISIBLE_ON_SURFACE"})(a.Visibility||(a.Visibility={}));a.FeatureTileDescriptor3D=
q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileMeasurements3D":function(){define("exports ../../../../core/screenUtils ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/frustum ../../../../geometry/support/plane ../../../../geometry/support/triangle ../../../ViewingMode ./FeatureTileDescriptor3D ./FeatureTileVisibility3D ../../webgl/RenderCamera".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){function t(A,B,C,D){const F=h.signedDistance(D,B);D=h.signedDistance(D,C);const H=Math.abs(D-F);q.scale(A,B,Math.abs(D)/H);q.scaleAndAdd(A,A,C,Math.abs(F)/H)}class w{constructor(A){this._camera=new d;this._focusOnMap=[0,0];this._screenRect=p.create();this._tileSize=A.tileSize;this._renderCoordsHelper=A.renderCoordsHelper;this._tilingScheme=A.tilingScheme;this._visibility=new g.FeatureTileVisibility3D(A.renderCoordsHelper,A.getIsGroundOpaque)}begin(A,B,C){this._camera.copyFrom(A);
this._surfaceElevation=C;this._focusOnMap[0]=B.x;this._focusOnMap[1]=B.y;p.fromValues(0,0,A.fullWidth,A.fullHeight,this._screenRect);this._visibility.begin(this._camera,C)}end(){this._visibility.end()}updateTile(A){A.measures.visibility=this._visibility.calculate(A);A.measures.distance=p.distance(A.extent,this._focusOnMap);A.measures.visibility!==e.Visibility.INVISIBLE&&this._updateScreenMeasure(A)}_updateScreenMeasure(A){const B=A.measures.screenRect;p.empty(B);let C=0;var D=A.lij,F=D[0];const H=
F+2,N=D[1]<<2,E=D[2]<<2;var G=this._tileSizeWithBias(A);G*=G;var I=this._camera;const {frustum:O,viewport:L}=I;if(this._renderCoordsHelper.viewingMode===c.ViewingMode.Local||F>g.globalTileLevelThreshold){F=m;this._tilingScheme.getExtent(D[0],D[1],D[2],F);const P=v,M=y;D=p.empty();for(let K=0;4>K;++K)this._toRenderCoords(F,z[K][0],z[K][1],M[K]),I.projectToScreen(M[K],P[K]),p.expandPointInPlace(D,P[K]);I=g.isConvexHullOutsideOfFrustum(O,M,4);F=D[0]>L[2]||D[1]>L[3]||D[2]<L[0]||D[3]<L[1];if(I||F){A.measures.shouldSplit=
!1;return}}for(I=0;4>I;I++)for(F=0;4>F;F++)if(C+=this._computeScreenArea(H,N+I,E+F,B),C>G){A.measures.shouldSplit=!0;return}A.measures.shouldSplit=!1}_tileSizeWithBias(A){return A.measures.visibility===e.Visibility.VISIBLE_WHEN_EXTENDED?5*this._tileSize:this._tileSize}_computeScreenArea(A,B,C,D){this._tilingScheme.ensureMaxLod(A);const F=m;this._tilingScheme.getExtent(A,B,C,F);A=n;this._toRenderCoords(F,0,3,A[0]);this._toRenderCoords(F,2,3,A[1]);this._toRenderCoords(F,2,1,A[2]);this._toRenderCoords(F,
0,1,A[3]);return this._computeTriangleScreenArea([A[0],A[1],A[2]],D)+this._computeTriangleScreenArea([A[2],A[1],A[3]],D)}_computeTriangleScreenArea(A,B){const C=this._camera.frustum[k.PlaneIndex.NEAR];var D=0,F=-1,H=-1;for(var N=0;3>N;++N)0<h.signedDistance(C,A[N])?(D++,-1===F&&(F=N)):-1===H&&(H=N);return 0===D?this._computeTriangleScreenAreaInside(A,B):1===D?(H=x,D=(F+1)%3,N=(F+2)%3,q.copy(H[0],A[D]),q.copy(H[1],A[N]),t(H[2],A[N],A[F],C),N=this._computeTriangleScreenAreaInside(H,B),t(H[1],A[D],A[F],
C),A=this._computeTriangleScreenAreaInside(H,B),N+A):2===D?(F=x,D=H,q.copy(F[0],A[D]),N=(H+2)%3,t(F[1],A[D],A[(H+1)%3],C),t(F[2],A[D],A[N],C),this._computeTriangleScreenAreaInside(F,B)):0}_computeTriangleScreenAreaInside(A,B){for(let C=0;3>C;C++)this._camera.projectToRenderScreen(A[C],u),this._camera.renderToScreen(u,v[C]),p.expand(B,v[C],B);return f.areaPoints2d(v[0],v[1],v[2])}_toRenderCoords(A,B,C,D){r[0]=A[B];r[1]=A[C];r[2]=this._surfaceElevation;this._renderCoordsHelper.toRenderCoords(r,this._tilingScheme.spatialReference,
D);return D}}const v=[b.createScreenPointArray(),b.createScreenPointArray(),b.createScreenPointArray(),b.createScreenPointArray()],m=p.create(),r=l.create(),n=[l.create(),l.create(),l.create(),l.create()],u=b.createRenderScreenPointArray3(),x=[l.create(),l.create(),l.create()],y=[l.create(),l.create(),l.create(),l.create()],z=[[0,3],[2,3],[2,1],[0,1]];a.FeatureTileMeasurements3D=w;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileVisibility3D":function(){define("exports ../../../../core/mathUtils ../../../../core/ObjectPool ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/spatialReferenceEllipsoidUtils ../../../../geometry/projection/projectBuffer ../../../../geometry/projection/projectVec3Array ../../../../geometry/support/frustum ../../../../geometry/support/plane ../../../../geometry/support/ray ../../../ViewingMode ./FeatureTileDescriptor3D ../../state/Frustum ../../support/FrustumExtentIntersection".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(Ea){var ua=v.Frustum.nearFarLineIndices;const Na=Ea.mutablePoints;for(const Ua of ua){const [wa,sa]=Ua;ua=Na[wa];l.subtract(C,Na[sa],ua);l.scale(C,C,.95);l.add(Na[sa],ua,C)}Ea.updatePoints(Na)}function n(Ea,ua,Na){l.cross(Ea,ua,Na);l.normalize(Ea,Ea);return Ea}function u(Ea,ua,Na){l.sub(Ea,ua,Na);l.normalize(Ea,Ea);return Ea}function x(Ea,ua){l.scale(Ea,Ea,ua/l.len(Ea));return Ea}function y(Ea,ua,Na){for(const Ha of N){a:{var Ua=Ea[Ha];var wa=ua,
sa=Na;for(let Ka=0;Ka<sa;++Ka)if(0>=g.signedDistance(Ua,wa[Ka])){Ua=!1;break a}Ua=!0}if(Ua)return!0}return!1}function z(Ea,ua,Na){for(const Ua of ua)if(l.dot(Ua,Ea)<Na)return!1;return!0}function A(Ea,ua,Na,Ua){if(0===Na.length||0===Ua.length)return!0;var wa=la;n(wa,Ea,ua);var sa=Ua[0]<Na[0];Ea=sa?Na:Ua;ua=Ma;sa=sa?Ua:Na;Na=Infinity;Ua=-Infinity;for(var Ha of sa)sa=l.dot(wa,Ha),Na=Math.min(Na,sa),Ua=Math.max(Ua,sa);ua[0]=Na;ua[1]=Ua;a:{Ha=ua[0];ua=ua[1];Na=Infinity;Ua=-Infinity;for(const Ka of Ea)if(Ea=
l.dot(wa,Ka),Na=Math.min(Na,Ea),Ua=Math.max(Ua,Ea),Na<=ua&&Ua>=Ha){wa=!1;break a}wa=!0}return wa}class B{constructor(Ea,ua){this._renderCoordsHelper=Ea;this._getIsGroundOpaque=ua;this._surfaceElevation=0;this._isGroundOpaque=!1;this._cache=new Map;this._frustumBoundingSphereCenter=p.create();this._frustumBoundingSphereRadius=0;this._frustum=new v.Frustum(Ea);this._extendedFrustum=new v.Frustum(Ea);this._intersector=new m.FrustumExtentIntersection({renderCoordsHelper:Ea});this._renderSR=Ea.spatialReference;
ua=h.getSphericalPCPF(this._renderSR);this._renderSREllipsoidRadius=k.getReferenceEllipsoid(ua).radius;this._renderCoordsHelper=Ea}begin(Ea,ua){this._surfaceElevation=ua;this._aboveGround=Ea.aboveGround;this._isGroundOpaque=this._getIsGroundOpaque();this._frustum.update(Ea);r(this._frustum);this._updateExtendedFrustum(Ea);this._updateFrustumBoundingSphere()}end(){this._cache.clear()}calculate(Ea){const ua=this._renderCoordsHelper.viewingMode===t.ViewingMode.Global&&2<=Ea.lij[0]&&6>Ea.lij[0],Na=this._getOrCalculateSingleTileVisibility(Ea,
!ua);return Na!==w.Visibility.INVISIBLE&&ua?this._calculateAggregatedChildrenVisibility(Ea):Na}_calculateAggregatedChildrenVisibility(Ea){let ua=w.Visibility.INVISIBLE;var Na=this._cache.get(Ea.id);if(null!=Na)return Na;Na=H.acquire();Ea.getChildren(Na);for(const Ua of Na){const wa=this.calculate(Ua);if(wa!==w.Visibility.INVISIBLE&&(ua=wa,wa===w.Visibility.VISIBLE_ON_SURFACE))break}H.release(Na);this._cache.set(Ea.id,ua);return ua}_getOrCalculateSingleTileVisibility(Ea,ua){var Na=this._cache.get(Ea.id);
if(null!=Na)return Na;Na=this._calculateSingleTileVisibility(Ea);ua&&this._cache.set(Ea.id,Na);return Na}_calculateSingleTileVisibility(Ea){if(!this._aboveGround&&this._renderCoordsHelper.viewingMode===t.ViewingMode.Global&&12>Ea.lij[0]){if(this._calculateSingleTileVisibilitySided(Ea,!1)===w.Visibility.INVISIBLE)return this._calculateSingleTileVisibilitySided(Ea,!0)}else return this._calculateSingleTileVisibilitySided(Ea,this._aboveGround)}_isTileVisibleInFrustum(Ea){return this._renderCoordsHelper.viewingMode===
t.ViewingMode.Local?this._isTileVisibleInFrustumLocal(Ea):this._isTileVisibleInFrustumGlobal(Ea)}_updateFrustumBoundingSphere(){var Ea=this._frustum;const ua=Ea.origin,Na=W;l.normalize(Na,Ea.direction);var Ua=S;l.sub(Ua,Ea.points[4],ua);Ea=l.dot(Ua,Ua);Ua=l.dot(Na,Ua);Ua=.5*Ea/Ua;l.scaleAndAdd(this._frustumBoundingSphereCenter,ua,Na,Ua);this._frustumBoundingSphereRadius=1+Ua}_isTileVisibleInFrustumLocal(Ea){var ua=Ea.tilingScheme.spatialReference,Na=Ea.extent,Ua=this._renderSR;Ea=G;Ea[0]=Na[0];Ea[1]=
Na[1];Ea[2]=0;Ea[3]=Na[2];Ea[4]=Na[3];Ea[5]=0;if(!f.projectBuffer(Ea,ua,0,Ea,Ua,0,2))return!1;ua=I;l.set(ua[0],Ea[0],Ea[1],0);l.set(ua[1],Ea[3],Ea[1],0);l.set(ua[2],Ea[3],Ea[4],0);l.set(ua[3],Ea[0],Ea[4],0);var wa=O;l.set(wa,.5*(Ea[0]+Ea[3]),.5*(Ea[1]+Ea[4]),.5*(Ea[2]+Ea[5]));Ea=L;l.set(Ea,0,0,1);var sa=.5*l.dist(ua[0],ua[2]);Na=this._frustum;Ua=this._frustumBoundingSphereRadius;const Ha=this._frustumBoundingSphereCenter;var Ka=T;l.sub(Ka,Ha,wa);Ka=l.dot(Ea,Ka);const Aa=V;l.scaleAndAdd(Aa,wa,Ea,Ka);
if(l.dist(Aa,Ha)>sa+Ua)return!1;wa=E;sa=Math.min(this._isGroundOpaque&&!this._aboveGround?430:Infinity,Ka+Ua);Ua=Math.max(this._isGroundOpaque&&this._aboveGround?-430:-Infinity,Ka-Ua);for(Ka=0;4>Ka;++Ka)l.scaleAndAdd(wa[Ka],ua[Ka],Ea,sa),l.scaleAndAdd(wa[Ka+4],ua[Ka],Ea,Ua);return!y(Na.planes,wa,8)}_isTileVisibleInFrustumGlobal(Ea){var ua=Ea.tilingScheme.spatialReference,Na=Ea.extent;const Ua=this._isGroundOpaque&&this._aboveGround,wa=this._isGroundOpaque&&!this._aboveGround;if(4>Ea.lij[0])return!0;
var sa=I,Ha=.5*(Na[0]+Na[2]);l.set(sa[0],Na[0],Na[1],0);l.set(sa[1],Na[2],Na[1],0);l.set(sa[2],Na[2],Na[3],0);l.set(sa[3],Na[0],Na[3],0);l.set(sa[4],Ha,Na[1],0);l.set(sa[5],Ha,Na[3],0);if(!c.projectVec3Array(sa,ua,0,sa,this._renderSR,0,6))return!1;var Ka=0<sa[0][2],Aa=0>sa[3][2];Na=this._renderSREllipsoidRadius;if(Ka||Aa){var Sa=p.fromValues(0,0,1),Ya=M;n(Ya,Sa,sa[0]);Ha=K;n(Ha,Sa,sa[1]);if(Ka){Ka=P;Aa=sa[4];var qa=J;n(qa,Aa,Sa);n(Ka,qa,Aa);Sa=sa[0];l.cross(Sa,Ya,Ka);x(Sa,Na);Ya=sa[1];l.cross(Ya,
Ha,Ka);x(Ya,Na)}else Aa&&(Ka=P,Aa=sa[5],qa=J,n(qa,Aa,Sa),n(Ka,Aa,qa),Sa=sa[3],l.cross(Sa,Ka,Ya),x(Sa,Na),Ya=sa[2],l.cross(Ya,Ka,Ha),x(Ya,Na))}Aa=O;Ha=l.sub(Z,sa[3],sa[0]);l.normalize(Ha,Ha);Ya=l.add(ca,sa[0],sa[3]);l.scale(Ya,Ya,.5);Sa=-l.dot(Ya,Ha);Ya=l.add(ea,sa[0],sa[1]);l.scale(Ya,Ya,.5);Ka=l.add(da,sa[2],sa[3]);l.scale(Ka,Ka,.5);Ka=l.sub(ia,Ka,Ya);l.normalize(Ka,Ka);Ha=-(Sa+l.dot(Ha,Ya))/l.dot(Ha,Ka);l.scaleAndAdd(Aa,Ya,Ka,Ha);x(Aa,Na);Ka=this._frustumBoundingSphereRadius;qa=this._frustumBoundingSphereCenter;
const aa=this._frustum;Ya=aa.planes;var Ja=R;l.normalize(Ja,Aa);Sa=l.dot(sa[0],Ja)/l.len(sa[0]);var Ta=aa.origin;Ha=aa.points;var Ra=!1;if(Ua){Ra=!0;var $a=l.normalize(p.create(),Ta);for(var bb=0;4>bb;++bb){var pa=Ha[4+bb];pa=l.sub(p.create(),pa,Ta);l.normalize(pa,pa);var Ba=l.cross(p.create(),$a,pa);l.normalize(Ba,Ba);pa=l.cross(p.create(),pa,Ba);l.normalize(pa,pa);if(l.dot(Ta,pa)>Na){Ra=!1;break}}if(Ra&&l.dot(Ta,Ja)<Na*Sa-430)return!1;Ta=l.normalize(Ga,aa.origin);if(0>l.dot(Ta,Ja))return!1;Ta=l.normalize(Pa,
aa.direction);if(l.dot(Ta,Ja)>Qa)return!1}$a=Math.sqrt(1-Sa*Sa);if(.9<$a)return!0;Ta=!1;pa=l.dot(Ja,qa);Ba=l.len(qa);if(Ba<=Ka&&!Ya.some(Wa=>0<g.signedDistance(Wa,Y)))if(Ua)Ta=!0;else return!0;bb=pa/Ba;if(!Ta&&0>=pa&&-pa>Ka)return!1;pa=Ka/Ba;if(Math.sqrt(1-bb*bb)*Math.sqrt(1-pa*pa)-pa*bb>$a)return!1;if(!Ra&&(sa.some(Wa=>aa.intersectsPoint(Wa))||aa.intersectsPoint(Aa)))return!0;Aa=ha;l.sub(Aa,qa,Y);Aa=l.dot(Aa,Ja);Ra=Q;l.scale(Ra,Ja,Aa);qa=l.dist(Ra,qa);ua=ua.isWGS84;Ja=Ea.lij;Ea=ua&&Ja[2]===2**Ja[0]-
1;ua=(Ja=ua&&0===Ja[2])?Da:Ea?za:na;Ea=Ja?ra:Ea?ya:va;if(!Ta){Ja=xa;Ta=ka;Ra=fa;$a=Y;for(var Ia of ua)if(ua=sa[Ia],u(Ta,sa[(Ia+1)%4],ua),u(Ra,$a,ua),n(Ja,Ra,Ta),z(Ja,Ha,1))return!1}Ia=null;if(!Ua&&Aa<1.01*Ka){Ia=2.5*Ka;if(qa>Sa*Ia+Ka)return!1;ua=U;Ia/=Sa;for(Sa=0;4>Sa;++Sa)l.scale(ua[Sa],sa[Sa],Ia/Na);l.set(ua[4],0,0,0);Ia=ua}else{Ia=(wa?Na+430:Aa+Ka)/Sa;ua=Ua?Na-430:(Aa-Ka)/Sa;Sa=ba;for(Ka=0;4>Ka;++Ka)Aa=sa[Ka],l.scale(Sa[Ka],Aa,ua/Na),l.scale(Sa[Ka+4],Aa,Ia/Na);Ia=Sa}if(y(Ya,Ia,Ia.length))return!1;
ua=aa.lines;sa=X;Na=ja;for(const Wa of ua){l.normalize(Na,Wa.direction);for(const gb of Ea){ua=Ia[gb];l.normalize(sa,ua);if(A(Na,sa,Ia,Ha))return!1;Ya=(gb+1)%4;if(Ua&&(l.sub(sa,Ia[Ya],ua),l.normalize(sa,sa),A(Na,sa,Ia,Ha))||wa&&(l.sub(sa,Ia[4+Ya],Ia[4+gb]),l.normalize(sa,sa),A(Na,sa,Ia,Ha)))return!1}}return!0}_calculateSingleTileVisibilitySided(Ea,ua){return this._isTileVisibleInFrustum(Ea)?(this._intersector.update(Ea.extent,Ea.tilingScheme.spatialReference,this._surfaceElevation,ua),this._intersector.isVisibleInFrustum(this._frustum,
this._renderSREllipsoidRadius,!0)?w.Visibility.VISIBLE_ON_SURFACE:w.Visibility.VISIBLE_WHEN_EXTENDED):w.Visibility.INVISIBLE}_updateExtendedFrustum(Ea){this._extendedFrustum.update(Ea);r(this._extendedFrustum);var ua=this._renderCoordsHelper.worldUpAtPosition(Ea.eye,C);this._aboveGround||l.negate(ua,ua);if(this._hasExtendedFrustum=b.acosClamped(-l.dot(ua,Ea.viewForward))>Ea.fovY/2){Ea=this._extendedFrustumParameters();ua=this._extendedFrustum.mutablePoints;for(let Na=0;4>Na;Na++){const Ua=Ea.pointIndices[Na],
wa=ua[Ua],sa=this._renderCoordsHelper.getAltitude(wa);if(Ea.needsAltitudeAdjustment(sa)){this._renderCoordsHelper.worldUpAtPosition(wa,C);switch(Ua){case e.PointIndex.FAR_BOTTOM_LEFT:case e.PointIndex.FAR_TOP_LEFT:case e.PointIndex.NEAR_BOTTOM_LEFT:case e.PointIndex.NEAR_TOP_LEFT:g.projectVector(this._extendedFrustum.planes[e.PlaneIndex.LEFT],C,C);break;case e.PointIndex.FAR_BOTTOM_RIGHT:case e.PointIndex.FAR_TOP_RIGHT:case e.PointIndex.NEAR_BOTTOM_RIGHT:case e.PointIndex.NEAR_TOP_RIGHT:g.projectVector(this._extendedFrustum.planes[e.PlaneIndex.RIGHT],
C,C)}l.scale(C,C,Ea.direction);this._renderCoordsHelper.intersectInfiniteManifold(d.wrap(wa,C),Ea.zWithMargin,wa)}}this._extendedFrustum.updatePoints(ua);g.fromPoints(ua[e.PointIndex.NEAR_BOTTOM_LEFT],ua[e.PointIndex.NEAR_BOTTOM_RIGHT],ua[e.PointIndex.NEAR_TOP_RIGHT],D);g.fromPoints(ua[e.PointIndex.NEAR_BOTTOM_RIGHT],ua[e.PointIndex.NEAR_TOP_RIGHT],ua[e.PointIndex.NEAR_TOP_LEFT],F);0>l.dot(g.getNormal(D),g.getNormal(F))&&(Ea=this._extendedFrustum.mutablePoints,this._aboveGround?[Ea[e.PointIndex.NEAR_BOTTOM_LEFT],
Ea[e.PointIndex.NEAR_BOTTOM_RIGHT]]=[Ea[e.PointIndex.NEAR_BOTTOM_RIGHT],Ea[e.PointIndex.NEAR_BOTTOM_LEFT]]:[Ea[e.PointIndex.NEAR_TOP_LEFT],Ea[e.PointIndex.NEAR_TOP_RIGHT]]=[Ea[e.PointIndex.NEAR_TOP_RIGHT],Ea[e.PointIndex.NEAR_TOP_LEFT]],this._extendedFrustum.updatePoints(Ea))}}_extendedFrustumParameters(){return this._aboveGround?this._extendedFrustumParametersAboveSurface():this._extendedFrustumParametersBelowSurface()}_extendedFrustumParametersAboveSurface(){const Ea=this._surfaceElevation-1;return{zWithMargin:Ea,
pointIndices:v.Frustum.planePointIndices.bottom,direction:-1,needsAltitudeAdjustment(ua){return ua>Ea}}}_extendedFrustumParametersBelowSurface(){const Ea=this._surfaceElevation+1;return{zWithMargin:Ea,pointIndices:v.Frustum.planePointIndices.top,direction:1,needsAltitudeAdjustment(ua){return ua<Ea}}}}const C=p.create(),D=g.create(),F=g.create(),H=new q(Array,Ea=>{4!==Ea.length&&(Ea[0]=new w.FeatureTileDescriptor3D,Ea[1]=new w.FeatureTileDescriptor3D,Ea[2]=new w.FeatureTileDescriptor3D,Ea[3]=new w.FeatureTileDescriptor3D)},
Ea=>{Ea[0].release();Ea[1].release();Ea[2].release();Ea[3].release()}),N=[e.PlaneIndex.LEFT,e.PlaneIndex.RIGHT,e.PlaneIndex.BOTTOM,e.PlaneIndex.TOP,e.PlaneIndex.FAR],E=[p.create(),p.create(),p.create(),p.create(),p.create(),p.create(),p.create(),p.create()],G=[0,0,0,0,0,0],I=[p.create(),p.create(),p.create(),p.create(),p.create(),p.create()],O=p.create(),L=p.create(),P=p.create(),M=p.create(),K=p.create(),J=p.create(),R=p.create(),Q=p.create(),W=p.create(),S=p.create(),V=p.create(),T=p.create(),Y=
p.fromValues(0,0,0),ha=p.create(),ba=[p.create(),p.create(),p.create(),p.create(),p.create(),p.create(),p.create(),p.create()],U=[p.create(),p.create(),p.create(),p.create(),p.create()],Z=p.create(),ca=p.create(),ea=p.create(),da=p.create(),ia=p.create(),ka=p.create(),fa=p.create(),X=p.create(),ja=p.create(),la=p.create(),na=[0,1,2,3],va=[0,1,2,3],za=[0,1,3],ya=[0,1,3],Da=[1,2,3],ra=[1,2,3],xa=p.create(),Ma=[0,0],Ga=p.create(),Pa=p.create(),Qa=Math.cos(.25*Math.PI);a.FeatureTileVisibility3D=B;a.globalTileLevelThreshold=
4;a.isConvexHullOutsideOfFrustum=y;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/projectVec3Array":function(){define(["exports","../../chunks/vec32","./projectors"],function(a,b,q){a.projectVec3Array=function(l,p,k,h,f,c,e=1){p=q.getProjector(p,f,q.projectorCache);if(null==p)return!1;if(p===q.copy3){if(l===h&&k===c)return!0;e=k+e;for(let g=k,d=c;g<e;++g,++d)b.copy(h[d],l[g]);return!0}e=k+e;for(let g=k,d=c;g<e;++g,++d)p(l[g],0,h[d],0);return!0};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/FrustumExtentIntersection":function(){define("exports ../../../core/compilerUtils ../../../core/mathUtils ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ../../../geometry/projection/computeTranslationToOriginAndRotation ../../../geometry/projection/projectBoundingRect ../../../geometry/projection/projectVectorToVector ../../../geometry/support/aaBoundingBox ../../../geometry/support/aaBoundingRect ../../../geometry/support/frustum ../../../geometry/support/lineSegment ../../../geometry/support/plane ../../../geometry/support/ray ../../ViewingMode ./intersectionUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){const x=.5*Math.PI,y=x/Math.PI*180;class z{constructor(E){this._renderCoordsHelper=E.renderCoordsHelper;this._extent=Array(4);this._planes=Array(6);this._maxSpan=0;this._center={origin:h.create(),direction:h.create()};for(E=0;4>E;E++)this._extent[E]={origin:h.create(),direction:h.create(),cap:{next:null,direction:h.create()}},this._planes[E]=m.create();this._planes[w.PlaneIndex.NEAR]=m.create();this._planes[w.PlaneIndex.FAR]=m.create();this._planesWithoutFar=
this._planes.slice(0,5)}update(E,G,I,O=!0){const L=this._extent;this._toRenderBoundingExtent(E,G,I);k.add(this._center.origin,L[0].origin,L[2].origin);k.scale(this._center.origin,this._center.origin,.5);this._renderCoordsHelper.worldUpAtPosition(this._center.origin,this._center.direction);O||k.scale(this._center.direction,this._center.direction,-1);for(I=0;4>I;I++){const P=L[I];this._renderCoordsHelper.worldUpAtPosition(P.origin,P.direction);const M=L[3===I?0:I+1];P.cap.next=M.origin;k.direction(P.cap.direction,
P.origin,M.origin);m.fromVectorsAndPoint(P.direction,P.cap.direction,P.origin,this._planes[I]);O||k.scale(P.direction,P.direction,-1)}m.fromVectorsAndPoint(L[0].cap.direction,L[1].cap.direction,L[0].origin,this._planes[w.PlaneIndex.NEAR]);O?m.negate(this._planes[w.PlaneIndex.NEAR],this._planes[w.PlaneIndex.FAR]):(m.copy(this._planes[w.PlaneIndex.FAR],this._planes[w.PlaneIndex.NEAR]),m.negate(this._planes[w.PlaneIndex.NEAR],this._planes[w.PlaneIndex.NEAR]));this._maxSpan=Math.max(Math.abs(E[0]-E[2]),
Math.abs(E[1]-E[3]));this._maxSpanSpatialReference=G;this._minGlobalAltitude=.9*f.getReferenceEllipsoid(this._maxSpanSpatialReference).radius}isVisibleInFrustum(E,G,I=!1){if(null==E)return!1;if(this._renderCoordsHelper.viewingMode===n.ViewingMode.Global){if(this._maxSpan>(this._maxSpanSpatialReference.isGeographic?y:x*G))return!0;if(null!=E.altitude&&E.altitude>=this._minGlobalAltitude)return this._isVisibleInFrustumGlobal(E)}if(0===this._maxSpan)return G=this._extent[0],!I&&E.intersectsRay(r.wrap(G.origin,
G.direction))?!0:!1;for(G=0;G<this._extent.length;G++){var O=this._extent[G];if(!I&&E.intersectsRay(r.wrap(O.origin,O.direction))||E.intersectsLineSegment(v.fromPoints(O.origin,O.cap.next,N),O.cap.direction))return!0}I=I?this._planes:this._planesWithoutFar;for(G=0;G<E.lines.length;G++)if(O=E.lines[G],u.frustumLineSegment(I,O.origin,O.endpoint,O.direction))return!0;return!1}_toRenderBoundingExtentGlobal(E,G,I){t.center(E,B);B[2]=I;c.computeTranslationToOriginAndRotation(G,B,C,this._renderCoordsHelper.spatialReference);
l.invert(D,C);d.empty(F);for(const {x0:O,x1:L,y0:P,y1:M}of A)for(let K=0;5>K;K++){const J=K/4;B[0]=q.lerp(E[O],E[L],J);B[1]=q.lerp(E[P],E[M],J);B[2]=I;g.projectVectorToVector(B,G,B,this._renderCoordsHelper.spatialReference);k.transformMat4(B,B,D);d.expandWithVec3(F,B)}k.set(this._extent[0].origin,F[0],F[1],F[2]);k.set(this._extent[1].origin,F[3],F[1],F[2]);k.set(this._extent[2].origin,F[3],F[4],F[2]);k.set(this._extent[3].origin,F[0],F[4],F[2]);for(E=0;4>E;++E)k.transformMat4(this._extent[E].origin,
this._extent[E].origin,C)}_toRenderBoundingExtentLocal(E,G,I){e.projectBoundingRect(E,G,H,this._renderCoordsHelper.spatialReference);k.set(this._extent[0].origin,H[0],H[1],I);k.set(this._extent[1].origin,H[2],H[1],I);k.set(this._extent[2].origin,H[2],H[3],I);k.set(this._extent[3].origin,H[0],H[3],I)}_toRenderBoundingExtent(E,G,I){switch(this._renderCoordsHelper.viewingMode){case n.ViewingMode.Global:this._toRenderBoundingExtentGlobal(E,G,I);break;case n.ViewingMode.Local:this._toRenderBoundingExtentLocal(E,
G,I);break;default:b.neverReached(this._renderCoordsHelper.viewingMode)}}_isVisibleInFrustumGlobal(E){if(0>m.signedDistance(E.planes[w.PlaneIndex.NEAR],this._center.origin)&&0>k.dot(this._center.direction,E.direction))return!0;for(let G=0;4>G;G++){const I=this._extent[G];if(0>m.signedDistance(E.planes[w.PlaneIndex.NEAR],I.origin)&&0>k.dot(I.direction,E.direction))return!0}return!1}}const A=[{x0:0,y0:1,x1:2,y1:1},{x0:0,y0:3,x1:2,y1:3},{x0:0,y0:1,x1:0,y1:3},{x0:2,y0:1,x1:2,y1:3}],B=h.create(),C=p.create(),
D=p.create(),F=d.create(),H=t.create(),N=v.create();a.FrustumExtentIntersection=z;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/extentUtils":function(){define(["exports","../../../core/libs/gl-matrix-2/factories/vec3f64","../../../geometry/projection/projectBuffer"],function(a,b,q){const l=b.create();a.projectToBoundingBox=function(p,k,h){if(null==p||null==h)return!1;let f;l[0]=null!=p.xmin?p.xmin:0;l[1]=null!=p.ymin?p.ymin:0;l[2]=null!=p.zmin?p.zmin:0;f=q.projectBuffer(l,
p.spatialReference,0,k,h,0,1);l[0]=null!=p.xmax?p.xmax:0;l[1]=null!=p.ymax?p.ymax:0;l[2]=null!=p.zmax?p.zmax:0;f=f&&q.projectBuffer(l,p.spatialReference,0,k,h,3,1);null==p.xmin&&(k[0]=-Infinity);null==p.ymin&&(k[1]=-Infinity);null==p.zmin&&(k[2]=-Infinity);null==p.xmax&&(k[3]=Infinity);null==p.ymax&&(k[4]=Infinity);null==p.zmax&&(k[5]=Infinity);return f};a.toBoundingRect=function(p,k,h){if(null==p||null==h)return!1;let f;l[0]=null!=p.xmin?p.xmin:0;l[1]=null!=p.ymin?p.ymin:0;l[2]=null!=p.zmin?p.zmin:
0;f=q.projectBuffer(l,p.spatialReference,0,l,h,0,1);k[0]=l[0];k[1]=l[1];l[0]=null!=p.xmax?p.xmax:0;l[1]=null!=p.ymax?p.ymax:0;l[2]=null!=p.zmax?p.zmax:0;f=f&&q.projectBuffer(l,p.spatialReference,0,l,h,0,1);k[2]=l[0];k[3]=l[1];null==p.xmin&&(k[0]=-Infinity);null==p.ymin&&(k[1]=-Infinity);null==p.xmax&&(k[2]=Infinity);null==p.ymax&&(k[3]=Infinity);return f};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/state/ViewState":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Evented ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/accessorSupport/watch ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ../../ViewAnimation ../../ViewingMode ./Constraints ./controllers/AnimationController ./controllers/CameraController ../support/PropertiesPool ../webgl/RenderCamera ../webgl-engine/lib/rendererUtils ../../support/RenderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){function z(B,C){return B.fov!==C.fov||B.fullViewport[0]!==C.fullViewport[0]||B.fullViewport[1]!==C.fullViewport[1]||B.fullViewport[2]!==C.fullViewport[2]||B.fullViewport[3]!==C.fullViewport[3]||B.padding[x.PaddingSide.TOP]!==C.padding[x.PaddingSide.TOP]||B.padding[x.PaddingSide.RIGHT]!==C.padding[x.PaddingSide.RIGHT]||B.padding[x.PaddingSide.BOTTOM]!==C.padding[x.PaddingSide.BOTTOM]||B.padding[x.PaddingSide.LEFT]!==C.padding[x.PaddingSide.LEFT]?
!0:!1}b=class extends b{constructor(){super(...arguments);this._propertiesPool=new n.PropertiesPool({camera:u},this);this._lastSeenCameraProjectionValues=new u;this.mode=y.RenderState.ANIMATING;this._cssCamera=new u;this._camera=new u;this.contentPixelRatio=this.rasterPixelRatio=1;this.events=new q;this.viewingMode=w.ViewingMode.Global;this._cameraChanged=!1;this._updateQueue=[];this._processingUpdates=!1}init(B,C){this._set("viewingMode",B);this._set("spatialReference",C);this._set("constraints",
new v.Constraints({mode:this.viewingMode}))}exit(){this.cameraController=null;this._propertiesPool.destroy();this._propertiesPool=new n.PropertiesPool({camera:u},this)}destroy(){this.cameraController=null;this._propertiesPool?.destroy();this._propertiesPool=null}createInitialCamera(){if(this.viewingMode===w.ViewingMode.Global){const B=d.getReferenceEllipsoid(this.spatialReference).radius;this.camera=new u({eye:g.fromValues(4*B,0,0),center:g.fromValues(B,0,0),up:g.fromValues(0,0,1)})}else this.camera=
new u({eye:g.fromValues(0,0,100),center:g.fromValues(0,0,0),up:g.fromValues(0,1,0)})}get animation(){return this.cameraController instanceof m.AnimationController&&null!=this.cameraController.viewAnimation?this.cameraController.viewAnimation:null}get cssCamera(){const B=this._cssCamera.copyFrom(this.camera),{height:C,width:D,pixelRatio:F}=this.camera;B.pixelRatio=1;B.height=Math.round(C/F);B.width=Math.round(D/F);return B}get camera(){return this._camera}set camera(B){B!==A&&A.copyFrom(B);A.computeUp(this.viewingMode);
this.events.emit("before-camera-change",A);B=this._camera;z(this._lastSeenCameraProjectionValues,A)&&(this._lastSeenCameraProjectionValues.copyFrom(A),this.events.emit("camera-projection-changed",this._lastSeenCameraProjectionValues));if(!B.equals(A)&&(this._camera=this._propertiesPool.get("camera").copyFrom(A),this._cameraChanged=!B.almostEquals(A))){const C=e.afterDispatch(()=>{this._cameraChanged=!1;C.remove()})}}get pixelRatio(){return this.camera.pixelRatio}get alignPixelEnabled(){return this.pixelRatio===
this.rasterPixelRatio&&this.mode===y.RenderState.IDLE}get updating(){return this.mode!==y.RenderState.IDLE}get contentCamera(){return this._contentCamera??this.camera}set contentCamera(B){this._contentCamera=null!=B?B.clone():null}get fixedContentCamera(){return null!=this._contentCamera}get isGlobal(){return this.viewingMode===w.ViewingMode.Global}get isLocal(){return this.viewingMode===w.ViewingMode.Local}get navigating(){return!!this.cameraController?.isInteractive}get stationary(){return!this._cameraChanged&&
!this.navigating}get cameraController(){return this._get("cameraController")}set cameraController(B){this.stopActiveCameraController()?(this.cameraController?.destroy(),B&&(this.removeHandles("ViewStateHandles"),this.addHandles(l.when(()=>B.state===r.State.Finished||B.state===r.State.Stopped,()=>{this._set("cameraController",null);this.updateCamera(C=>B.onControllerEnd(C))},{sync:!0,once:!0}),"ViewStateHandles"),B.onControllerStart(this.camera)),this._set("cameraController",B)):B&&(B.state=r.State.Rejected)}switchCameraController(B){this.cameraController=
B;return B.state!==r.State.Rejected}stopActiveCameraController(){return this.cameraController&&!this.cameraController.stopController()?!1:!0}updateCamera(B){this._updateQueue.push(B);this._processUpdateQueue()}_processUpdateQueue(){if(0!==this._updateQueue.length&&!this._processingUpdates){this._processingUpdates=!0;var B=this._updateQueue.shift();A.copyFrom(this._get("camera"));B(A);this.camera=A;this._processingUpdates=!1;this._processUpdateQueue()}}};a.__decorate([p.property()],b.prototype,"mode",
void 0);a.__decorate([p.property({readOnly:!0,type:t})],b.prototype,"animation",null);a.__decorate([p.property({type:u})],b.prototype,"cssCamera",null);a.__decorate([p.property()],b.prototype,"_cssCamera",void 0);a.__decorate([p.property({type:u})],b.prototype,"camera",null);a.__decorate([p.property()],b.prototype,"_camera",void 0);a.__decorate([p.property({readOnly:!0})],b.prototype,"pixelRatio",null);a.__decorate([p.property()],b.prototype,"rasterPixelRatio",void 0);a.__decorate([p.property()],
b.prototype,"contentPixelRatio",void 0);a.__decorate([p.property({readOnly:!0})],b.prototype,"alignPixelEnabled",null);a.__decorate([p.property({readOnly:!0})],b.prototype,"updating",null);a.__decorate([p.property({})],b.prototype,"_contentCamera",void 0);a.__decorate([p.property({type:u})],b.prototype,"contentCamera",null);a.__decorate([p.property({readOnly:!0})],b.prototype,"fixedContentCamera",null);a.__decorate([p.property({readOnly:!0})],b.prototype,"constraints",void 0);a.__decorate([p.property({readOnly:!0})],
b.prototype,"events",void 0);a.__decorate([p.property({readOnly:!0})],b.prototype,"isGlobal",null);a.__decorate([p.property({readOnly:!0})],b.prototype,"isLocal",null);a.__decorate([p.property({readOnly:!0})],b.prototype,"viewingMode",void 0);a.__decorate([p.property({readOnly:!0})],b.prototype,"spatialReference",void 0);a.__decorate([p.property()],b.prototype,"navigating",null);a.__decorate([p.property()],b.prototype,"stationary",null);a.__decorate([p.property()],b.prototype,"_cameraChanged",void 0);
a.__decorate([p.property()],b.prototype,"cameraController",null);a=b=a.__decorate([c.subclass("esri.views.3d.state.ViewState")],b);const A=new u;return a})},"esri/views/3d/state/helpers/SceneIntersectionHelper":function(){define("exports ../../../../core/PooledArray ../../../../core/screenUtils ../../../../core/unitUtils ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/ray ../../../../geometry/support/vectorStacks ../../../../support/elevationInfoUtils ../../../ViewingMode ../../support/hitTest ../../support/geometryUtils/ray ../../webgl-engine/lib/Intersector ../../webgl-engine/lib/IntersectorInterfaces ../../webgl-engine/lib/intersectorUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(D){y&&y.viewingMode===D||(y=w.newIntersector(D));return y}class n{constructor(D,F,H){this.viewingMode=D;this._forEachLayer=F;this._view=H;this._externalIntersectionHandlers=new b;this._tolerance=w.defaultTolerance;this._tmpRay=f.create();this._tmpRegion=h.create();this._validateHUDIntersector=w.newIntersector(this.viewingMode);this._validateHUDIntersector.options.hud=!1}intersectScreen(D,F,H){return this.intersectRay(this._getPickRay(D,this._tmpRay),
r(this.viewingMode),F,H)}intersectScreenFreePointFallback(D,F,H){return this.intersectRayFreePointFallback(this._getPickRay(D,this._tmpRay),F,H)}intersectRayFreePointFallback(D,F,H){return this.intersectRay(D,r(this.viewingMode),F,H)||this._intersectRayFreePointLocal(D,F)}intersectRay(D,F,H,N){F.options.selectionMode=!1;F.options.store=v.StoreResults.MIN;this.computeIntersection(D,F,N);return F.results.min?F.results.min.getIntersectionPoint(H):!1}getCenterRayWithSubpixelOffset(D,F,H=.5,N=.5){D.getRenderCenter(C,
H,N);C[0]+=.0466;C[1]-=.0123;return t.fromRenderAtEye(D,C,F)}intersectIntersectorScreen(D,F,H){this.computeIntersection(this._getPickRay(D,this._tmpRay),F,H)}intersectToolIntersectorScreen(D,F,H){D=this._getPickRay(D,this._tmpRay);this.intersectToolIntersectorRay(D,F,H)}intersectToolIntersectorRay(D,F,H){F.options.selectionMode=!0;this.computeIntersection(D,F,H);const N=F.results.min;this._view.basemapTerrain&&this._view.basemapTerrain.opaque||m.isValidIntersectorResult(N)&&N.intersector!==v.IntersectorType.TERRAIN||
(F.options.selectionMode=!1,this.computeIntersection(D,F,H))}setTolerance(D=w.defaultTolerance){this._tolerance=D}addIntersectionHandler(D){this._externalIntersectionHandlers.push(D);this._externalIntersectionHandlers.sort((F,H)=>F.type===v.IntersectorType.TERRAIN?1:H.type===v.IntersectorType.TERRAIN?-1:0)}removeIntersectionHandler(D){null!=this._externalIntersectionHandlers.removeUnordered(D)&&this._externalIntersectionHandlers.sort((F,H)=>F.type===v.IntersectorType.TERRAIN?1:H.type===v.IntersectorType.TERRAIN?
-1:0)}_getPickRay(D,F){return t.fromScreen(this._view.state.camera,D,F)}_intersectRayFreePointLocal(D,F){if(this.viewingMode!==g.ViewingMode.Local||null==D)return!1;p.add(F,D.origin,p.normalize(c.sv3d.get(),D.direction));return!1}intersectElevationFromScreen(D,F,H=0,N=null){return this._intersectElevation(this._getPickRay(D,this._tmpRay),F,H,N)}_intersectElevation(D,F,H=0,N=null){if(null==D)return null;var E=this._view,{renderCoordsHelper:G}=E,I=l.getMetersPerVerticalUnitForSR(E.spatialReference),
O=null!=F?F.mode:"absolute-height";F=e.getElevationOffsetInMeters(F)/I;const L=("on-the-ground"!==O?F+H:0)*I/G.unitInMeters;({camera:I}=E.state);if("absolute-height"===O)return H=G?.getAltitude(I.eye),O=p.dot(p.normalize(A,D.direction),G.worldUpAtPosition(I.eye,B)),H<L&&0>O||H>=L&&0<O?null:G.intersectInfiniteManifold(D,L,A)?(E=d.computeMapPointFromVec3d(E,A),E.z??(E.z=0),E.z-=F,E):null;const P=q.castRenderScreenPointArray3(c.sv3d.get());I.projectToRenderScreen(D.origin,P);G=new z(null,this._forEachLayer);
({slicePlane:F}=E);const M=null!=F?m.sliceFilterPredicate(F):null,K=w.newIntersector(this.viewingMode);K.options.store=v.StoreResults.MIN;K.options.verticalOffset=L;K.options.normalRequired=!1;F=D.origin;D=p.add(c.sv3d.get(),F,D.direction);K.reset(F,D,I);K.point=P;const J=N?"type"in N&&"graphics"===N.type?R=>R.layerUid!==N.uid:R=>R.graphicUid!==N.uid:null;switch(O){case "relative-to-scene":K.intersect(G.layers,P,this._tolerance,null,R=>(!J||J(R))&&!!R.lastValidElevationBB);this._externalIntersectionHandlers.forAll(R=>
{R.type!==v.IntersectorType.I3S&&R.type!==v.IntersectorType.TERRAIN&&R.type!==v.IntersectorType.TILES3D||R.intersect(K,R.slicePlaneEnabled?M:null,K.rayBegin,K.rayEnd,P)});break;case "on-the-ground":case "relative-to-ground":this._externalIntersectionHandlers.forAll(R=>{R.isGround&&R.intersect(K,R.slicePlaneEnabled?M:null,K.rayBegin,K.rayEnd,P)})}return K.results.min.getIntersectionPoint(A)?(E=d.computeMapPointFromVec3d(E,A),E.z=H,E):null}computeIntersection(D,F,H,N){if(null!=D){var E=this._view.state.camera,
G=q.castRenderScreenPointArray3(c.sv3d.get());E.projectToRenderScreen(D.origin,G);var I=new z(H,this._forEachLayer);F.options.selectOpaqueTerrainOnly=!H||!("include"in H||"exclude"in H);var O=D.origin,L=p.add(c.sv3d.get(),D.origin,D.direction);F.reset(O,L,E);F.intersect(I.layers,G,this._tolerance);D=this._view.slicePlane;var P=null!=D?m.sliceFilterPredicate(D):null;F.intersect(I.sliceableLayers,G,this._tolerance,P);var M=H&&(H.requiresGroundFeedback||H.enableDraped);this._externalIntersectionHandlers.forAll(K=>
{var J=K.layerUid;const R=Array.isArray(J);J=R?J:[J];R&&(F.options.filteredLayerUids=[]);let Q=!1;for(const W of J)I.filterLayerUid(W)?Q=!0:R&&F.options.filteredLayerUids.push(W);F.options.isFiltered=!Q;(K.isGround&&M||!F.options.isFiltered)&&K.intersect(F,K.slicePlaneEnabled?P:null,O,L,G,N)});D=c.sv3d.get();E=this._view.basemapTerrain;if(H&&H.enableDraped&&null!=E.spatialReference&&F.results.ground.getIntersectionPoint(D)){H=E.overlayManager.renderer;const K=this._view.renderCoordsHelper.spatialReference,
J=c.sv3d.get();this._view.renderCoordsHelper.fromRenderCoords(D,J,E.spatialReference);J[2]=this._view.elevationProvider?.getElevation(D[0],D[1],D[2],K,"ground")??0;H.intersect(F,J,F.results.ground,R=>I.filterRenderGeometry(R))}F.sortResults();this._processHUDResults(F)}}_processHUDResults(D){var F=D.results.hud;h.copy(this._tmpRegion,h.negativeInfinity);const H=this._view.state.camera,N=[],E=this._tmpRegion;var G=K=>{const J=new x(K);H.projectToRenderScreen(K.target.center,J.screenPoint);J.screenPoint[0]=
Math.floor(J.screenPoint[0]);J.screenPoint[1]=Math.floor(J.screenPoint[1]);N.push(J);h.expandPointInPlace(E,J.screenPoint)};D.sortResults(F.all);null!=F.min.dist&&G(F.min);for(var I of F.all)F.min.target.object!==I.target.object&&F.max.target.object!==I.target.object&&G(I);null!=F.max.dist&&F.max.target.object!==F.min.target.object&&G(F.max);if(N.length){E[0]===E[2]&&(E[2]+=1);E[1]===E[3]&&(E[3]+=1);F=H.fullWidth;G=H.fullHeight;var O=Math.max(0,E[0]-1),L=Math.max(0,E[1]-1);I=Math.min(h.width(E)+2,
F-O);var P=Math.min(h.height(E)+2,G-L);if(!(0>=I||0>=P)){var M=new Uint8Array(I*P*4);this._view._stage.renderer.readHUDVisibility(O,L,I,P,M);O=!0;L=null==D.results.max.dist;P=0;for(const K of N)for(const J of u){const R=4*(Math.min(K.screenPoint[0]+J[0],F)-E[0]+(Math.min(K.screenPoint[1]+J[1],G)-E[1])*I);if(!(0>R||R>=M.length)&&M[R]){O&&(D.results.min.copy(K.result),O=!1);L&&D.results.max.copy(K.result);D.options.store===v.StoreResults.ALL&&D.results.all.splice(P++,0,K.result);break}}}}}}const u=
(()=>{const D=[];for(let F=-1;1>=F;F++)for(let H=-1;1>=H;H++)D.push([H+1,F+1]);return D})();class x{constructor(D){this.result=D;this.screenPoint=q.createRenderScreenPointArray3()}}let y;class z{constructor(D,F){this.layers=[];this.sliceableLayers=[];this.include=D?.include;this.exclude=D?.exclude;F(H=>{H.pickable&&this.filterLayerUid(H.apiLayerUid)&&(H.sliceable?this.sliceableLayers:this.layers).push(H)})}filterLayerUid(D){const {include:F,exclude:H}=this;return null==D?null==F&&null==H:(null==F||
F.has(D))&&(null==H||!H.has(D))}filterRenderGeometry(D){return this.filterLayerUid(D.layerUid)}}const A=k.create(),B=k.create(),C=q.createRenderScreenPointArray3();a.SceneIntersectionHelper=n;a.isIntersectionHandler=function(D){return"object"===typeof D&&"intersect"in D};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/support/elevationInfoUtils":function(){define(["exports","../core/unitUtils","../symbols/support/unitConversionUtils"],function(a,b,q){function l(r,n){return n?.mode?
n.mode:(r?v:m).mode}function p(r,n){return null!=n?n:r?v:m}function k(r,n){return l(null!=r?r.hasZ:!1,n)}function h(r){const n=e(r);r=k(r.geometry,n);const u=null!=n&&"on-the-ground"!==r?w(n):0;return{mode:r,offset:u,featureExpressionInfo:n?.featureExpressionInfo}}function f(r){return"0"===r?.featureExpressionInfo?.expression}function c(r){if(!r||"on-the-ground"===r.mode)return!1;r=r?.featureExpressionInfo?r.featureExpressionInfo.expression:null;return!(!r||"0"===r)}function e(r){return r.layer&&
"elevationInfo"in r.layer?r.layer.elevationInfo:null}function g(r,n){if(!r?.offset)return 0;const {offset:u,unit:x}=r;if("decimal-degrees"===x)return 0;r="unknown"!==x&&x?x:"meters";return(n=b.verticalLengthUnitFromSpatialReference(n))?b.convertUnit(u,r,n):0}function d(r,n,u,x,y,z,A=null){if(null!=z){var B=null!=A?A.mode:"absolute-height";if("on-the-ground"===B)return 0;({absoluteZ:z}=t(n,u,x,y,r,z));a:{A=g(A,y);switch(B){case "absolute-height":r=z-A;break a;case "relative-to-ground":r=z-((r.elevationProvider.getElevation(n,
u,x,y,"ground")??0)+A);break a;case "relative-to-scene":r=z-((r.elevationProvider.getElevation(n,u,x,y,"scene")??0)+A);break a}r=void 0}return r}}function t(r,n,u,x,y,z){const A=g(z,x);switch(z.mode){case "absolute-height":return{absoluteZ:u+A,elevation:0};case "on-the-ground":return u=y.elevationProvider.getElevation(r,n,0,x,"ground")??0,{absoluteZ:u,elevation:u};case "relative-to-ground":return r=y.elevationProvider.getElevation(r,n,u,x,"ground")??0,{absoluteZ:u+r+A,elevation:r};case "relative-to-scene":return r=
y.elevationProvider.getElevation(r,n,u,x,"scene")??0,{absoluteZ:u+r+A,elevation:r}}}function w(r){return(r?.offset??0)*q.getMetersPerUnit(r?.unit)}const v={mode:"absolute-height",offset:0},m={mode:"on-the-ground",offset:null};a.absoluteHeightElevationInfo=v;a.elevationContextAffectsAlignment=function(r,n){if(null==n)return!1;({mode:n}=n);return null!=n&&("scene"===r&&"relative-to-scene"===n||"ground"===r&&"absolute-height"!==n)};a.elevationModeRequiredMessage=function(r,n,u){return u&&u.mode!==n?
`${r} only support ${n} elevation mode`:null};a.elevationModeUnsupportedMessage=function(r,n,u){return u?.mode===n?`${r} do not support ${n} elevation mode`:null};a.featureExpressionInfoIsZero=f;a.featureExpressionUnsupportedMessage=function(r,n){return null!=n?.featureExpressionInfo&&"0"!==n.featureExpressionInfo.expression?`${r} do not support featureExpressionInfo`:null};a.getConvertedElevation=function(r,n,u,x=null){return d(r,n.x,n.y,n.hasZ?n.z:0,n.spatialReference,u,x)};a.getConvertedElevationFromVector=
function(r,n,u,x,y=null){return d(r,n[0],n[1],2<n.length?n[2]:0,u,x,y)};a.getConvertedElevationFromXYZ=d;a.getEffectiveElevationInfo=p;a.getEffectiveElevationMode=l;a.getElevationOffset=g;a.getElevationOffsetInMeters=w;a.getGeometryEffectiveElevationInfo=function(r,n){return p(null!=r?!!r.hasZ:!1,n)};a.getGeometryEffectiveElevationMode=k;a.getGraphicEffectiveElevationInfo=h;a.getGraphicEffectiveElevationMode=function(r){const n=e(r);return k(r.geometry,n)};a.getZForElevationMode=function(r,n,u){if(u?.mode){var x=
r.hasZ?r.z:0,y=g(u,r.spatialReference);switch(u.mode){case "absolute-height":return x-y;case "on-the-ground":return 0;case "relative-to-ground":return r=(n.elevationProvider.getElevation(r.x,r.y,x,r.spatialReference,"ground")??0)+y,x-r;case "relative-to-scene":return r=(n.elevationProvider.getElevation(r.x,r.y,x,r.spatialReference,"scene")??0)+y,x-r}}};a.hasEffectiveFeatureExpressionInfo=c;a.hasFeatureExpressionInfo=function(r){return c(r)||f(r)};a.hasGraphicFeatureExpressionInfo=function(r){return c(h(r))};
a.logInvalidElevationInfoWarning=function(r,n){n&&r.warn(".elevationInfo\x3d",n)};a.onTheGroundElevationInfo=m;a.zValueInAbsoluteHeightMode=t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/hitTest":function(){define("exports ../../../geometry ../../../Graphic ../../../core/iteratorUtils ../../../core/screenUtils ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/projection/projectVectorToVector ../../../layers/LayerConstants ../../../layers/support/layerUtils ./debugFlags ./ElevationProvider ../webgl-engine/lib/Intersector ../webgl-engine/lib/IntersectorInterfaces ../webgl-engine/lib/intersectorUtils ../webgl-engine/lib/intersectorUtilsConversions ../webgl-engine/lib/verticalOffsetUtils ../../../geometry/SpatialReference ../../../geometry/Point".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){function u(N,E,G){return E.getIntersectionPoint(F)?(G=A(N,F,G),E.intersector===t.IntersectorType.TERRAIN&&N.basemapTerrain&&(G.z=g.getElevationAtPoint(N.basemapTerrain,G)??0),G):null}function x(N){var E=N.sourceLayer,G=N.layer;if(E=E&&"objectIdField"in E?E:G&&"objectIdField"in G?G:E)if(G=E.objectIdField??f.fallbackObjectIDAttribute,G=N.attributes?.[G])return`o-${E.id}-${G}`;return`u-${N.uid}`}function y(N,E){E=x(E);return z(N,E)}function z(N,E){return null==
N||(null==N.include||N.include.has(E))&&(null==N.exclude||!N.exclude.has(E))}function A(N,E,G){let I=N.spatialReference||r.WGS84;h.projectVectorToVector(E,N.renderSpatialReference,F,I)?E=F:(I=r.WGS84,h.projectVectorToVector(E,N.renderSpatialReference,F,I)&&(E=F));G?(G.x=E[0],G.y=E[1],G.z=E[2],G.spatialReference=I):G=new n(E,I);return G}function B(N,E){const G=C(N,E.include,H.INCLUDE);N=C(N,E.exclude,H.EXCLUDE);return{include:G.layerUids,exclude:N.layerUids,graphics:{include:G.graphicUids,exclude:N.graphicUids},
mediaElements:{include:G.mediaElements,exclude:N.mediaElements}}}function C(N,E,G,I={layerUids:void 0,graphicUids:void 0,mediaElements:void 0}){if(!E)return I;if(E instanceof q){var O=x(E);I.graphicUids||(I.graphicUids=new Set);I.graphicUids.add(O);G===H.INCLUDE&&(null!=N.graphicsView&&E.layer===N?D(I,N.graphicsView.processor.layer.id):E.layer&&D(I,E.layer.uid))}else if("layer"in E&&"element"in E)N=E.element,I.mediaElements||(I.mediaElements=new Set),I.mediaElements.add(N),G===H.INCLUDE&&D(I,E.layer.uid);
else if(l.isIterable(E))for(O of E)O===N.graphics&&null!=N.graphicsView?D(I,N.graphicsView.processor.layer.id):O===N.map.ground?D(I,m.terrainId):C(N,O,G,I);else"uid"in E&&D(I,E.uid);return I}function D(N,E){N.layerUids||(N.layerUids=new Set);N.layerUids.add(E)}const F=k.create();var H;(function(N){N[N.INCLUDE=0]="INCLUDE";N[N.EXCLUDE=1]="EXCLUDE"})(H||={});a.computeMapPointFromVec3d=A;a.externalToInternalIntersectOptions=B;a.getGraphicFilterUid=x;a.hitTest=async function(N,E,G,I){I=G?B(N,G):I;var O=
p.createScreenPointArray(E.x,E.y);I.requiresGroundFeedback=!0;I.enableDraped=!0;G=d.newIntersector(N.state.viewingMode);G.options.selectionMode=!0;G.options.store=t.StoreResults.ALL;N.sceneIntersectionHelper.intersectIntersectorScreen(O,G,I);O=G.results.all;var L=I.graphics;I=[];let P=null;for(let R=0;R<O.length;R++){var M=O[R],K=v.toOwner(M,N);if(null!=K&&(K===N.map.ground||"type"in K&&c.isIntegratedMeshLayer(K.type)))break;K=v.toHit(M,N);if(null!=K){if("graphic"===K.type){null==P&&R!==O.length-
1&&(P=new Set);if(null!=P){var J=x(K.graphic);if(P.has(J))continue;P.add(J)}if(!y(L,K.graphic))continue}J=u(N,M);M=M.distanceInRenderSpace;if("media"===K.type){const Q=K.element.toSource(J);I.push({...K,mapPoint:J,distance:M,sourcePoint:Q})}else I.push({...K,mapPoint:J,distance:M})}}O=G.results.ground;L=v.toOwner(O,N);L=null!=L&&"type"in L&&c.isIntegratedMeshLayer(L.type)?L:null;N={screenPoint:E,results:I,ground:{mapPoint:u(N,O),distance:w.isValidIntersectorResult(O)?O.distanceInRenderSpace:0,layer:L}};
e.debugFlags.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(N.intersector=G);return N};a.intersectResultToMapPoint=u;a.toMap=function(N,E,G,I){I=G?B(N,G):I;const O=!(!I.graphics?.include&&!I.graphics?.exclude),L=!(!I.mediaElements?.include&&!I.mediaElements?.exclude);E=p.screenPointObjectToArray(E);I.enableDraped=I.include&&!I.include.has(m.terrainId)||I.exclude?.has(m.terrainId);const P=N.sceneIntersectionHelper,M=d.newIntersector(N.state.viewingMode);M.options.selectionMode=!0;M.options.store=O||L?t.StoreResults.ALL:
t.StoreResults.MIN;M.options.hud=!G?.excludeHud;P.intersectIntersectorScreen(E,M,I);if(O||L){for(const K of M.results.all)if(G=v.toHit(K,N),null==G||O&&("graphic"!==G.type||y(I.graphics,G.graphic))||L&&("media"!==G.type||z(I.mediaElements,G.element)))return u(N,K);return null}return u(N,M.results.min)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/LayerConstants":function(){define(["exports"],function(a){a.fallbackObjectIDAttribute="OBJECTID";Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/intersectorUtilsConversions":function(){define("exports ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ../../../../chunks/sphere ../../layers/i3s/Intersector ../../terrain/Intersector ./intersectorUtils ./lodRendering/Intersector".split(" "),function(a,b,q,l,p,k,h,f,c){function e(r,n){return null==r?null:f.isObjectIntersectorResult(r)||
f.isHudIntersectorResult(r)?g(r.target?.object,n):k.isPclIntersectorResult(r)?(r=r.target.createGraphic(),{type:"graphic",graphic:r,layer:r.layer}):k.isVoxelIntersectorResult(r)?(r=r.target.createVoxelGraphic(),{type:"graphic",graphic:r,layer:r.layer}):k.isTiles3DIntersectorResult(r)?(r=r.target.createTiles3DGraphic(),{type:"graphic",graphic:r,layer:r.layer}):h.isOverlayIntersectorResult(r)||c.isLodIntersectorResult(r)?g(r.target,n):k.isI3sIntersectorResult(r)?d(r.target,n):null}function g(r,n){if(null==
r?.graphicUid)return null;const u=v(r,n);if(null==u)return null;if(u===n.graphics)return null==n.graphicsView||"number"!==typeof r.graphicUid?null:n.graphicsView.getHit(r.graphicUid);n=n.allLayerViews.find(x=>x.layer===u);return!n||n.suspended||null==r.graphicUid?null:"getHit"in n?n.getHit(r.graphicUid):null}function d(r,n){const u=v(r,n);return null==u?null:(n=n.allLayerViews.find(x=>x.layer===u))&&!n.suspended&&"getGraphicFromIntersectorTarget"in n?w(n.getGraphicFromIntersectorTarget(r)):null}function t(r,
n){const u=v(r,n);return null==u?null:(n=n.allLayerViews.find(x=>x.layer===u))&&!n.suspended&&"getAABBFromIntersectorTarget"in n?n.getAABBFromIntersectorTarget(r):null}function w(r){return null!=r?{type:"graphic",graphic:r,layer:r.layer}:null}function v(r,n){return null==r?.layerUid?null:null!=n.graphicsView&&r.layerUid===n.graphicsView.processor.layer.id?n.graphics:n.map.allLayers.find(u=>u.uid===r.layerUid)}const m=q.create();a.getIntersectedFeatureBSRadius=function(r,n){return f.isObjectIntersectorResult(r)||
f.isHudIntersectorResult(r)?p.getRadius(r.target.object.boundingVolumeWorldSpace.bounds):c.isLodIntersectorResult(r)?(b.getScaling(m,r.transformation),r.target.baseBoundingSphere.radius*Math.max(m[0],m[1],m[2])):k.isI3sIntersectorResult(r)?(r=t(r.target,n))?.5*l.diameter(r):null:null};a.hasLod=function(r){return f.isObjectIntersectorResult(r)||f.isHudIntersectorResult(r)?!1:c.isLodIntersectorResult(r)?1<r.target.numLodLevels:k.isI3sIntersectorResult(r)?!0:!1};a.toGraphic=function(r,n){r=e(r,n);return null!=
r&&"graphic"===r.type?r.graphic:null};a.toHit=e;a.toOwner=function(r,n){return f.isObjectIntersectorResult(r)||f.isHudIntersectorResult(r)?v(r.target?.object,n):h.isTerrainIntersectorResult(r)?n.map?.ground:k.isPclIntersectorResult(r)||k.isI3sIntersectorResult(r)||h.isOverlayIntersectorResult(r)||k.isVoxelIntersectorResult(r)?v(r.target,n):null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/Intersector":function(){define(["exports","../../webgl-engine/lib/IntersectorInterfaces",
"../../webgl-engine/lib/IntersectorTarget","../../webgl-engine/lib/intersectorUtils"],function(a,b,q,l){class p extends q.Graphic3DTarget{constructor(c,e,g,d){super(e,g);this.point=c;this.createGraphic=d}}class k extends q.LayerTarget{constructor(c,e,g,d,t){super(c);this.layerUid=c;this.sublayerUid=e;this.nodeIndex=g;this.componentIndex=d;this.triangleNr=t}}class h extends q.Graphic3DTarget{constructor(c,e,g){super(e,null);this.point=c;this.createVoxelGraphic=g}}class f extends q.Graphic3DTarget{constructor(c,
e){super(c,null);this.createTiles3DGraphic=e}}a.I3sTarget=k;a.PclTarget=p;a.Tiles3DTarget=f;a.VoxelTarget=h;a.isI3sIntersectorResult=function(c){return l.isValidIntersectorResult(c)&&c.intersector===b.IntersectorType.I3S&&!!c.target};a.isPclIntersectorResult=function(c){return l.isValidIntersectorResult(c)&&c.intersector===b.IntersectorType.PCL&&!!c.target};a.isTiles3DIntersectorResult=function(c){return l.isValidIntersectorResult(c)&&c.intersector===b.IntersectorType.TILES3D&&!!c.target};a.isVoxelIntersectorResult=
function(c){return l.isValidIntersectorResult(c)&&c.intersector===b.IntersectorType.VOXEL&&!!c.target};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/CombinedElevationProvider":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Evented ../../../core/maybe ../../../core/promiseUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/SpatialReference ../../../geometry/support/spatialReferenceUtils ../layers/graphics/ElevationQuery ./ElevationRange".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(r,n,u,x,y,z,A){for(const B of n)n=B.getElevation(u,x,y,z,A),null!=n&&(r=null!=r?Math.max(n,r):n);return r}a.CombinedElevationProvider=class extends l.EventedMixin(q){get spatialReference(){return this.view?.basemapTerrain?.spatialReference}constructor(r){super(r);this._im=[];this._ground=[];this._scene=[];this.lastElevationQuery=null;this._cacheEnabled=!1}destroy(){this._cachedQuery=p.destroyMaybe(this._cachedQuery)}enableCache(r){r||(this.lastElevationQuery=
null);this._cacheEnabled=r}getElevation(r,n,u,x,y){if(this._cacheEnabled&&null!=this.lastElevationQuery){var z=this.lastElevationQuery;if(r===z.x&&n===z.y&&u===z.z&&t.equals(x,z.spatialReference)&&y===z.queryContext)return z.result}z=m(null,this._im,r,n,u,x,y);null==z&&(z=m(z,this._ground,r,n,u,x,y));"scene"===y&&(z=m(z,this._scene,r,n,u,x,y));this._cacheEnabled&&(this.lastElevationQuery={x:r,y:n,z:u,spatialReference:x,queryContext:y,result:z});return z}getSphereElevationBounds(r,n,u){function x(z){for(const A of z)A.getSphereElevationBounds&&
(z=A.getSphereElevationBounds(r,n,u),null!=z&&y.expandElevationRangeValues(z.elevationRangeMin,z.elevationRangeMax))}const y=new v.ElevationRange;x(this._ground);x(this._im);"scene"===u&&x(this._scene);return y}getRootElevationBounds(){const r=new v.ElevationRange;for(const n of[this._im,this._ground,this._scene])n.forEach(u=>{u.getRootElevationBounds&&(u=u.getRootElevationBounds(),null!=u&&r.expandElevationRangeValues(u.elevationRangeMin,u.elevationRangeMax))});return r}async queryElevation(r,n,
u,x,y,z=null,A=0){const B=this._getElevationQuery(x);try{const C=await B.queryElevation(r,n,z,A);return"scene"===y?m(C,this._scene,r,n,u,x,y):C}catch(C){return k.throwIfAbortError(C),this.getElevation(r,n,u,x,y)}}register(r,n){this.addHandles(n.on("elevation-change",u=>this.emit("elevation-change",u)),n);this._providersFromContext(r).push(n)}unregister(r){this.removeHandles(r);for(const n of[this._im,this._ground,this._scene]){const u=n.indexOf(r);-1<u&&n.splice(u,1)}}_providersFromContext(r){switch(r){case "ground":return this._ground;
case "im":return this._im;case "scene":return this._scene}}_getElevationQuery(r=this.view.spatialReference){const n=this._cachedQuery;if(null!=n&&t.equals(r,n.spatialReference))return n;n?.destroy({completeTasks:!0});const {wkid:u,wkt:x,wkt2:y,latestWkid:z}=r;return this._cachedQuery=r=new w.ElevationQuery(this.view.resourceController.scheduler,new d({wkid:u,wkt:x,wkt2:y,latestWkid:z}),()=>this.view.map?.ground,{maximumAutoTileRequests:4})}};b.__decorate([h.property({constructOnly:!0})],a.CombinedElevationProvider.prototype,
"view",void 0);b.__decorate([h.property()],a.CombinedElevationProvider.prototype,"spatialReference",null);a.CombinedElevationProvider=b.__decorate([g.subclass("esri.views.3d.support.CombinedElevationProvider")],a.CombinedElevationProvider);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/ElevationQuery":function(){define("exports ../../../../geometry ../../../../core/arrayUtils ../../../../core/has ../../../../core/promiseUtils ../../../support/Scheduler ../../../../geometry/Multipoint".split(" "),
function(a,b,q,l,p,k,h){class f{constructor(e,g){this.spatialReference=e;this._view=g}getElevation(e,g,d){return this._view.elevationProvider.getElevation(e,g,0,this.spatialReference,d)}async queryElevation(e,g,d,t,w){return this._view.elevationProvider.queryElevation(e,g,0,this.spatialReference,w,d,t)}}class c{constructor(e,g,d,t){this.spatialReference=g;this._getElevationQueryProvider=d;this._queries=[];this._queryOptions={...t,ignoreInvisibleLayers:!0};this._frameTask=e.registerTask(k.TaskPriority.ELEVATION_QUERY,
this)}destroy({completeTasks:e}={completeTasks:!1}){this._frameTask.remove();if(this.running)if(e)this.runTask(k.noBudget);else for(const g of this._queries)g.result.reject(p.createAbortError())}queryElevation(e,g,d,t=0){const w=p.createResolver(),v={x:e,y:g,minDemResolution:t,result:w,signal:d};this._queries.push(v);p.onAbort(d,()=>{q.remove(this._queries,v);w.reject(p.createAbortError())});return w.promise}get running(){return 0<this._queries.length}runTask(e){const g=this._queries;this._queries=
[];const d=this._getElevationQueryProvider();if(d){var t=g.map(r=>[r.x,r.y]),w=g.reduce((r,n)=>Math.min(r,n.minDemResolution),Infinity);t=new h({points:t,spatialReference:this.spatialReference});var v=1<g.length&&g.some(r=>!!r.signal)?new AbortController:null,m=null!=v?v.signal:g[0].signal;if(null!=v){let r=0;g.forEach(n=>p.onAbort(n.signal,()=>{r++;n.result.reject(p.createAbortError());r===g.length&&v.abort()}))}d.queryElevation(t,{...this._queryOptions,minDemResolution:w,signal:m}).then(r=>{g.forEach((n,
u)=>{null!=n.signal&&n.signal.aborted?n.result.reject(p.createAbortError()):n.result.resolve(r.geometry.points[u][2])})}).catch(r=>{g.forEach(n=>n.result.reject(r))})}else g.forEach(r=>r.result.reject());e.madeProgress()}get test(){}}a.ElevationQuery=c;a.ViewElevationProvider=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/ElevationRange":function(){define(["exports"],function(a){class b{constructor(q=Infinity,l=-Infinity){this.elevationRangeMin=q;this.elevationRangeMax=
l}get elevationRangeValid(){return!Number.isNaN(this.elevationRangeMin)}invalidateElevationRange(){this.elevationRangeMin=NaN}expandElevationRangeValues(q,l){this.elevationRangeMin=Math.min(this.elevationRangeMin,q);this.elevationRangeMax=Math.max(this.elevationRangeMax,l)}expandElevationRange(q){this.elevationRangeMin=Math.min(this.elevationRangeMin,q.elevationRangeMin);this.elevationRangeMax=Math.max(this.elevationRangeMax,q.elevationRangeMax)}setElevationRange(q){this.elevationRangeMin=q.elevationRangeMin;
this.elevationRangeMax=q.elevationRangeMax}}a.ElevationRange=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/DisplayQualityProfile":function(){define(["../../../core/has","../../../core/time"],function(a,b){function q(){const k=!!a("esri-mobile"),h=!!a("ios"),f=b.Milliseconds(400);return{low:{graphics3D:{maxTotalNumberOfFeatures:25E3,maxNumberOfDrawCalls:8E3,maxTotalNumberOfVertices:255E4,polygonLodFactor:.5,polylineLodFactor:1,snapshotAvailable:!1,skipHighSymbolLods:!0,
uncompressedTextureDownsamplingEnabled:!0},heatmap:{pixelRatio:.125,maxTotalNumberOfFeatures:5E4},sceneService:{object:{lodFactor:.2},point:{lodFactor:1},integratedMesh:{lodFactor:.6},pointCloud:{lodFactor:.5},uncompressedTextureDownsamplingEnabled:!0},tiledSurface:{lodBias:-1,angledSplitBias:.5,vtlContentZoom:.75,elevationLevelDelta:3,reduceTileLevelDifferences:!0},fadeDuration:b.Milliseconds(0),antialiasingEnabled:!1,physicalBasedRenderingEnabled:!1,highQualityTransparency:!1,highResolutionAtmosphere:!1,
reflections:!1,ambientOcclusion:!1,memoryLimit:200+p.IPhone12Pro,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:1},medium:{graphics3D:{maxTotalNumberOfFeatures:1E5,maxNumberOfDrawCalls:17E3,maxTotalNumberOfVertices:625E4,polygonLodFactor:k?.8:1,polylineLodFactor:k?1.2:1.5,snapshotAvailable:!h,skipHighSymbolLods:!1,uncompressedTextureDownsamplingEnabled:k},heatmap:{pixelRatio:.25,maxTotalNumberOfFeatures:13E4},sceneService:{object:{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},
pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:k},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:3,reduceTileLevelDifferences:!a("disable-feature:reduce-map-tile-levels")},fadeDuration:f,antialiasingEnabled:!1,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,memoryLimit:k?600+p.GalaxyS20:750+p.FullHD,additionalCacheMemory:k?-100:150,frameRate:0,maximumPixelRatio:1},high:{graphics3D:{maxTotalNumberOfFeatures:1E5,
maxNumberOfDrawCalls:17E3,maxTotalNumberOfVertices:125E5,polygonLodFactor:k?1.2:2,polylineLodFactor:k?1.2:2,snapshotAvailable:!h,skipHighSymbolLods:!1,uncompressedTextureDownsamplingEnabled:!1},heatmap:{pixelRatio:.5,maxTotalNumberOfFeatures:23E4},sceneService:{object:{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:!1},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:2,reduceTileLevelDifferences:!a("disable-feature:reduce-map-tile-levels")},
fadeDuration:f,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!0,reflections:!0,ambientOcclusion:!0,memoryLimit:k?900+p.SurfacePro7:1500+p.FullHDRetina,additionalCacheMemory:k?-150:0,frameRate:0,maximumPixelRatio:k?1:Infinity}}}class l{static isValidProfile(k){return k in l.profiles}static getDefaultProfile(){return a("esri-iPhone")?"low":"medium"}static apply(k,h){k=l.profiles[k];h.graphics3D.maxTotalNumberOfFeatures=k.graphics3D.maxTotalNumberOfFeatures;
h.graphics3D.maxNumberOfDrawCalls=k.graphics3D.maxNumberOfDrawCalls;h.graphics3D.maxTotalNumberOfVertices=k.graphics3D.maxTotalNumberOfVertices;h.graphics3D.polygonLodFactor=k.graphics3D.polygonLodFactor;h.graphics3D.polylineLodFactor=k.graphics3D.polylineLodFactor;h.graphics3D.snapshotAvailable=k.graphics3D.snapshotAvailable;h.graphics3D.skipHighSymbolLods=k.graphics3D.skipHighSymbolLods;h.graphics3D.uncompressedTextureDownsamplingEnabled=k.graphics3D.uncompressedTextureDownsamplingEnabled;h.sceneService.object.lodFactor=
k.sceneService.object.lodFactor;h.sceneService.point.lodFactor=k.sceneService.point.lodFactor;h.sceneService.integratedMesh.lodFactor=k.sceneService.integratedMesh.lodFactor;h.sceneService.pointCloud.lodFactor=k.sceneService.pointCloud.lodFactor;h.sceneService.uncompressedTextureDownsamplingEnabled=k.sceneService.uncompressedTextureDownsamplingEnabled;h.tiledSurface.lodBias=k.tiledSurface.lodBias;h.tiledSurface.angledSplitBias=k.tiledSurface.angledSplitBias;h.tiledSurface.vtlContentZoom=k.tiledSurface.vtlContentZoom;
h.tiledSurface.elevationLevelDelta=k.tiledSurface.elevationLevelDelta;h.tiledSurface.reduceTileLevelDifferences=k.tiledSurface.reduceTileLevelDifferences;h.heatmap.pixelRatio=k.heatmap.pixelRatio;h.heatmap.maxTotalNumberOfFeatures=k.heatmap.maxTotalNumberOfFeatures;h.fadeDuration=k.fadeDuration;h.antialiasingEnabled=k.antialiasingEnabled;h.physicallyBasedRenderingEnabled=k.physicalBasedRenderingEnabled;h.highQualityTransparency=k.highQualityTransparency;h.highResolutionAtmosphere=k.highResolutionAtmosphere;
h.reflections=k.reflections;h.ambientOcclusion=k.ambientOcclusion;h.memoryLimit=k.memoryLimit;h.additionalCacheMemory=k.additionalCacheMemory;h.frameRate=k.frameRate;h.maximumPixelRatio=k.maximumPixelRatio}}l.test={reset(){const k=q();for(const h of Object.keys(k))l.profiles[h]=k[h]}};const p={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430};(l||={}).profiles=q();return l})},"esri/views/3d/support/HighlightOptions":function(){define("../../../chunks/tslib.es6 ../../../Color ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../webgl-engine/effects/highlight/HighlightDefaults".split(" "),
function(a,b,q,l,p,k,h,f,c){q=class extends q{constructor(){super(...arguments);this.color=c.defaultColor.clone();this.haloColor=null;this.haloOpacity=c.defaultHaloOpacity;this.fillOpacity=c.defaultFillOpacity;this.shadowOpacity=c.defaultShadowOpacity;this.shadowColor=c.defaultShadowColor.clone();this.shadowDifference=c.defaultShadowDifference}};a.__decorate([l.property({type:b})],q.prototype,"color",void 0);a.__decorate([l.property({type:b})],q.prototype,"haloColor",void 0);a.__decorate([l.property()],
q.prototype,"haloOpacity",void 0);a.__decorate([l.property()],q.prototype,"fillOpacity",void 0);a.__decorate([l.property()],q.prototype,"shadowOpacity",void 0);a.__decorate([l.property({type:b})],q.prototype,"shadowColor",void 0);a.__decorate([l.property()],q.prototype,"shadowDifference",void 0);return q=a.__decorate([f.subclass("esri.views.3d.support.HighlightOptions")],q)})},"esri/views/3d/webgl-engine/effects/highlight/HighlightDefaults":function(){define(["exports","../../../../../Color"],function(a,
b){const q=new b([0,255,255]);b=new b([0,0,0]);a.defaultColor=q;a.defaultFillOpacity=.25;a.defaultHaloOpacity=1;a.defaultShadowColor=b;a.defaultShadowDifference=.2;a.defaultShadowOpacity=.4;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/MapCoordsHelper":function(){define("exports ../../../geometry ../../../core/Error ../../../core/unitUtils ../../../geometry/ellipsoidUtils ../../../portal/support/geometryServiceUtils ../../../rest/geometryService/project ../../../rest/support/ProjectParameters ../../../geometry/Point ../../../geometry/SpatialReference".split(" "),
function(a,b,q,l,p,k,h,f,c,e){class g{constructor(d,t){this.spatialReference=t;this.unitInMeters=l.getMetersPerUnitForSR(this.spatialReference,p.getReferenceEllipsoid(this.spatialReference).metersPerDegree);this._geometryServiceURLPromise=k.getGeometryServiceURL(d&&"portalItem"in d?d.portalItem:void 0).catch(()=>{throw new q("mapcoordshelper:missing-geometry-service","Must specify geometryService in esri/config");})}async toGeographic(d){var t=await this._geometryServiceURLPromise;let w=!0;Array.isArray(d[0])&&
"number"!==typeof d[0]||(d=[d],w=!1);d=d.map(v=>v instanceof c?v:new c(v,this.spatialReference));d=new f({geometries:d,outSpatialReference:e.WGS84});t=(await h.project(t,d)).map(v=>"point"===v.type?[v.x,v.y]:void 0).filter(v=>!!v);return w?t:t[0]}}a.MapCoordsHelper=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/portal/support/geometryServiceUtils":function(){define("exports ../../config ../../core/Error ../Portal ../../rest/geometryService/project ../../rest/support/ProjectParameters".split(" "),
function(a,b,q,l,p,k){async function h(f=null,c){if(b.geometryServiceUrl)return b.geometryServiceUrl;if(!f)throw new q("internal:geometry-service-url-not-configured");f="portal"in f?f.portal||l.getDefault():f;await f.load({signal:c});c=f.helperServices?.geometry?.url;if(!c)throw new q("internal:geometry-service-url-not-configured");return c}a.getGeometryServiceURL=h;a.projectGeometry=async function(f,c,e=null,g){e=await h(e,g);f=new k({geometries:[f],outSpatialReference:c});if((g=await p.project(e,
f,{signal:g}))&&Array.isArray(g)&&1===g.length)return g[0];throw new q("internal:geometry-service-projection-failed");};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/rest/geometryService/project":function(){define("exports ../../request ../../core/accessorSupport/ensureType ../../geometry/support/jsonUtils ../utils ./utils ../support/ProjectParameters".split(" "),function(a,b,q,l,p,k,h){const f=q.ensureType(h);a.project=async function(c,e,g){e=f(e);c=p.parseUrl(c);const d=
{...c.query,f:"json",...e.toJSON()},t=e.outSpatialReference,w=l.getJsonType(e.geometries[0]);e=p.asValidOptions(d,g);return b(c.path+"/project",e).then(({data:{geometries:v}})=>k.decodeGeometries(v,w,t))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/rest/support/ProjectParameters":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../geometry/support/jsonUtils ../../geometry/support/spatialReferenceUtils".split(" "),
function(a,b,q,l,p,k,h,f,c){b=class extends b.JSONSupport{constructor(e){super(e);this.geometries=[];this.transformForward=this.transformation=this.outSpatialReference=null}toJSON(){const e=this.geometries.map(t=>t.toJSON()),g=this.geometries[0],d={};d.outSR=c.srToRESTValue(this.outSpatialReference);d.inSR=c.srToRESTValue(g.spatialReference);d.geometries=JSON.stringify({geometryType:f.getJsonType(g),geometries:e});this.transformation&&(d.transformation=this.transformation.wkid||JSON.stringify(this.transformation));
null!=this.transformForward&&(d.transformForward=this.transformForward);return d}};a.__decorate([q.property()],b.prototype,"geometries",void 0);a.__decorate([q.property({json:{read:{source:"outSR"}}})],b.prototype,"outSpatialReference",void 0);a.__decorate([q.property()],b.prototype,"transformation",void 0);a.__decorate([q.property()],b.prototype,"transformForward",void 0);return b=a.__decorate([h.subclass("esri.rest.support.ProjectParameters")],b)})},"esri/views/3d/support/popupHitTest":function(){define(["exports",
"../../../layers/support/layerUtils","../terrain/LayerClass","../../support/hitTestSelectUtils"],function(a,b,q,l){function p(f,c){const e=new Set,g=[];var d=f.basemapTerrain.numLayers(q.LayerClass.MAP);for(--d;0<=d;d--){const t=f.basemapTerrain.layerViewByIndex(d,q.LayerClass.MAP);e.add(t.layer.uid);g.push(t)}f=f.basemapTerrain.overlayManager.renderer.layers;for(const {uid:t}of f)if(f=c.get(t))e.add(t),g.push(f);g.reverse();return{layerUids:e,layerViews:g}}function k(f){const c=new Map;for(const e of f.allLayerViews)c.set(e.layer.uid,
e);return c}const h={layerUids:new Set,layerViews:[]};a.popupHitTest=async function(f,c){const {results:e,ground:g}=await l.hitTestSelectSimilarDistance(f,c),d=(!g.layer||!b.isIntegratedMeshLayer(g.layer.type))&&g.mapPoint,t=[];c=k(f);const w=d?p(f,c):h;let v=0,m=0;const r=()=>{const u=w.layerViews[m];d&&u&&"fetchPopupFeaturesAtLocation"in u&&t.push({mapPoint:g.mapPoint,layerView:u});++m};let n=null;for(;v<e.length||m<w.layerViews.length;){const u=e[v];if(u&&"graphic"!==u.type)++v;else if("scene"===
u?.layer?.type&&u?.layer?.parent===f?.map?.basemap)++v;else if(u){const x=w.layerUids.has(u.layer?.uid)&&u.distance===g.distance,y=c.get(u.layer?.uid);n??=u.mapPoint;m<w.layerViews.length&&(x||(u.distance??0)>g.distance)&&w.layerViews[m]!==y?r():(t.push({graphic:u.graphic,layerView:y}),++v)}else r()}n??=g.mapPoint;return{hits:t,location:n}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/LayerClass":function(){define(["exports"],function(a){a.LayerClass=void 0;
var b=a.LayerClass||(a.LayerClass={});b[b.ELEVATION=0]="ELEVATION";b[b.MAP=1]="MAP";a.LayerClasses=[a.LayerClass.ELEVATION,a.LayerClass.MAP];Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/hitTestSelectUtils":function(){define(["exports"],function(a){function b(q){return"graphic"===q?.type}a.filterGraphicHits=function(q){return q.filter(b)};a.findFirstGraphicHit=function(q){return q.find(b)??null};a.hitTestSelectSimilarDistance=async function(q,l){if("2d"===q.type)return q.hitTest(l);
q=await q.hitTest(l);if(0===q.results.length)return q;l=q.results[0];const p=1.05*(l.distance??0),k=q.results.findIndex(h=>(h.distance??0)>p);-1!==k&&(q.results=q.results.slice(0,k));l&&q.ground.distance>p&&(q.ground.mapPoint=null);return q};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/QualitySettings":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/time ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){let c=class extends b{constructor(){super(...arguments);this.minTotalNumberOfFeatures=2E3;this.maxTotalNumberOfFeatures=5E4;this.maxNumberOfDrawCalls=17E3;this.maxTotalNumberOfVertices=17E5;this.snapshotAvailable=!0;this.polylineLodFactor=this.polygonLodFactor=1;this.uncompressedTextureDownsamplingEnabled=this.skipHighSymbolLods=!1}};a.__decorate([l.property()],c.prototype,"minTotalNumberOfFeatures",void 0);a.__decorate([l.property()],c.prototype,"maxTotalNumberOfFeatures",
void 0);a.__decorate([l.property()],c.prototype,"maxNumberOfDrawCalls",void 0);a.__decorate([l.property()],c.prototype,"maxTotalNumberOfVertices",void 0);a.__decorate([l.property()],c.prototype,"snapshotAvailable",void 0);a.__decorate([l.property()],c.prototype,"polygonLodFactor",void 0);a.__decorate([l.property()],c.prototype,"polylineLodFactor",void 0);a.__decorate([l.property()],c.prototype,"skipHighSymbolLods",void 0);a.__decorate([l.property()],c.prototype,"uncompressedTextureDownsamplingEnabled",
void 0);c=a.__decorate([f.subclass("esri.views.3d.support.QualitySettings.Graphics3DSettings")],c);let e=class extends b{constructor(){super(...arguments);this.lodFactor=1}};a.__decorate([l.property()],e.prototype,"lodFactor",void 0);e=a.__decorate([f.subclass("esri.views.3d.support.QualitySettings.LoDFactorSettings")],e);let g=class extends b{constructor(){super(...arguments);this.object=new e;this.point=new e;this.integratedMesh=new e;this.pointCloud=new e;this.uncompressedTextureDownsamplingEnabled=
!1}};a.__decorate([l.property({type:e})],g.prototype,"object",void 0);a.__decorate([l.property({type:e})],g.prototype,"point",void 0);a.__decorate([l.property({type:e})],g.prototype,"integratedMesh",void 0);a.__decorate([l.property({type:e})],g.prototype,"pointCloud",void 0);a.__decorate([l.property()],g.prototype,"uncompressedTextureDownsamplingEnabled",void 0);g=a.__decorate([f.subclass("esri.views.3d.support.QualitySettings.SceneServiceSettings")],g);let d=class extends b{constructor(){super(...arguments);
this.lodBias=0;this.vtlContentZoom=this.angledSplitBias=1;this.elevationLevelDelta=3;this.reduceTileLevelDifferences=!0}};a.__decorate([l.property()],d.prototype,"lodBias",void 0);a.__decorate([l.property()],d.prototype,"angledSplitBias",void 0);a.__decorate([l.property()],d.prototype,"vtlContentZoom",void 0);a.__decorate([l.property()],d.prototype,"elevationLevelDelta",void 0);a.__decorate([l.property()],d.prototype,"reduceTileLevelDifferences",void 0);d=a.__decorate([f.subclass("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")],
d);let t=class extends b{constructor(){super(...arguments);this.pixelRatio=1;this.maxTotalNumberOfFeatures=5E4}};a.__decorate([l.property()],t.prototype,"pixelRatio",void 0);a.__decorate([l.property()],t.prototype,"maxTotalNumberOfFeatures",void 0);t=a.__decorate([f.subclass("esri.views.3d.support.QualitySettings.HeatmapSettings")],t);b=class extends b{constructor(){super(...arguments);this.graphics3D=new c;this.sceneService=new g;this.tiledSurface=new d;this.heatmap=new t;this.fadeDuration=q.Milliseconds(400);
this.antialiasingEnabled=!0;this.physicallyBasedRenderingEnabled=!1;this.highQualityTransparency=!0;this.ambientOcclusion=this.reflections=this.highResolutionAtmosphere=!1;this.memoryLimit=750;this.additionalCacheMemory=0;this.frameRate=void 0;this.maximumPixelRatio=Infinity}};a.__decorate([l.property({type:c})],b.prototype,"graphics3D",void 0);a.__decorate([l.property({type:g})],b.prototype,"sceneService",void 0);a.__decorate([l.property({type:d})],b.prototype,"tiledSurface",void 0);a.__decorate([l.property({type:t})],
b.prototype,"heatmap",void 0);a.__decorate([l.property()],b.prototype,"fadeDuration",void 0);a.__decorate([l.property()],b.prototype,"antialiasingEnabled",void 0);a.__decorate([l.property()],b.prototype,"physicallyBasedRenderingEnabled",void 0);a.__decorate([l.property()],b.prototype,"highQualityTransparency",void 0);a.__decorate([l.property()],b.prototype,"highResolutionAtmosphere",void 0);a.__decorate([l.property()],b.prototype,"reflections",void 0);a.__decorate([l.property()],b.prototype,"ambientOcclusion",
void 0);a.__decorate([l.property()],b.prototype,"memoryLimit",void 0);a.__decorate([l.property()],b.prototype,"additionalCacheMemory",void 0);a.__decorate([l.property()],b.prototype,"frameRate",void 0);a.__decorate([l.property()],b.prototype,"maximumPixelRatio",void 0);return b=a.__decorate([f.subclass("esri.views.3d.support.QualitySettings")],b)})},"esri/views/3d/support/RenderCoordsHelper":function(){define("exports ../../../core/mathUtils ../../../core/unitUtils ../../../core/libs/gl-matrix-2/math/mat4 ../../../chunks/vec32 ../../../geometry/ellipsoidUtils ../../../geometry/spatialReferenceEllipsoidUtils ../../../geometry/projection/projectPointToVector ../../../geometry/projection/projectVectorToPoint ../../../geometry/projection/projectVectorToVector ../../../geometry/support/Axis ../../../geometry/support/coordinateSystem ../../../geometry/support/plane ../../../geometry/support/vector ../../../geometry/support/vectorStacks ../../../layers/graphics/dehydratedFeatureUtils ../../ViewingMode".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){class n{constructor(u,x,y,z){this.viewingMode=u;this.spatialReference=x;this.unitInMeters=y;this._coordinateSystem=z;this._tmpCoordinateSystem=d.create(z);this.referenceEllipsoid=k.getReferenceEllipsoid(x);this.sphericalPCPF=h.getSphericalPCPF(x)}set extent(u){u&&d.setExtent(this._coordinateSystem,u,this._coordinateSystem)}getAltitude(u){return d.altitudeAt(this._coordinateSystem,u)}setAltitude(u,x,y=u){return d.setAltitudeAt(this._coordinateSystem,y,x,
u)}setAltitudeOfTransformation(u,x){d.setAltitudeOfTransformation(this._coordinateSystem,x,u,x)}worldUpAtPosition(u,x){return d.normalAt(this._coordinateSystem,u,x)}worldBasisAtPosition(u,x,y){return d.axisAt(this._coordinateSystem,u,x,y)}basisMatrixAtPosition(u,x){const y=this.worldBasisAtPosition(u,g.Axis.X,v.sv3d.get()),z=this.worldBasisAtPosition(u,g.Axis.Y,v.sv3d.get());u=this.worldBasisAtPosition(u,g.Axis.Z,v.sv3d.get());l.set(x,y[0],y[1],y[2],0,z[0],z[1],z[2],0,u[0],u[1],u[2],0,0,0,0,1);return x}headingAtPosition(u,
x){const y=this.worldUpAtPosition(u,v.sv3d.get());u=this.worldBasisAtPosition(u,g.Axis.Y,v.sv3d.get());x=w.angleAroundAxis(x,u,y);return b.rad2deg(x)}intersectManifoldClosestSilhouette(u,x,y){d.elevate(this._coordinateSystem,x,this._tmpCoordinateSystem);d.intersectRayClosestSilhouette(this._tmpCoordinateSystem,u,y);return y}intersectManifold(u,x,y){d.elevate(this._coordinateSystem,x,this._tmpCoordinateSystem);x=v.sv3d.get();return d.intersectRay(this._tmpCoordinateSystem,u,x)?p.copy(y,x):null}intersectInfiniteManifold(u,
x,y){if(this.viewingMode===r.ViewingMode.Global)return this.intersectManifold(u,x,y);d.elevate(this._coordinateSystem,x,this._tmpCoordinateSystem);x=this._tmpCoordinateSystem.value;const z=v.sv3d.get();return t.intersectRay(x.plane,u,z)?p.copy(y,z):null}toRenderCoords(u,x,y){return m.isDehydratedPoint(u)?f.projectPointToVector(u,x,this.spatialReference):e.projectVectorToVector(u,x,y,this.spatialReference)}fromRenderCoords(u,x,y=null){return m.isDehydratedPoint(x)?(null!=y&&(x.spatialReference=y),
c.projectVectorToPoint(u,this.spatialReference,x)?x:null):e.projectVectorToVector(u,this.spatialReference,x,y)?x:null}static create(u,x){switch(u){case r.ViewingMode.Local:return new n(r.ViewingMode.Local,x,q.getMetersPerUnitForSR(x),d.createLocal());case r.ViewingMode.Global:return new n(r.ViewingMode.Global,x,1,d.createGlobal(x))}}static renderUnitScaleFactor(u,x){return q.getMetersPerCartesianUnitForSR(u)/q.getMetersPerCartesianUnitForSR(x)}}a.RenderCoordsHelper=n;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/support/ResourceController":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/handleUtils ../../../core/has ../../../core/maybe ../../../core/reactiveUtils ../../../core/scheduling ../../../core/signal ../../../core/time ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./index ./MemoryController ./StreamDataLoader ../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){q=class extends q{constructor(){super(...arguments);this.updating=!1}};b.__decorate([g.property({readOnly:!0})],q.prototype,"updating",void 0);q=b.__decorate([w.subclass("esri.views.3d.support.ResourceController.ResourceControllerMain")],q);let u=class extends q{constructor(){super(...arguments);this._normalTask=this._immediateTask=n.ImmediateTask;this._updatingObjects=c.signal([]);this._frameTask=null}get immediate(){return this._immediateTask}get normal(){return this._normalTask}initialize(){this._scheduler=
n.newScheduler();this._memoryController=m.newMemoryController(this.view);this._streamDataLoader=new r.StreamDataLoader;this._streamDataLoader.setup(v.maxDownloadSlots,v.downloadSlotsPerClient,this._scheduler);this.addHandles([h.watch(()=>this.view.state?.mode,x=>{null!=x&&(this._scheduler.state=x)},h.sync),h.watch(()=>this.view.stationary,()=>this._stationaryChangedHandler())]);this._frameTask=f.addFrameTask({update:x=>this._frame(x)});this._immediateTask=this._scheduler.registerTask(n.TaskPriority.RESOURCE_CONTROLLER_IMMEDIATE);
this._normalTask=this._scheduler.registerTask(n.TaskPriority.RESOURCE_CONTROLLER)}destroy(){this._immediateTask.remove();this._normalTask.remove();this._frameTask=k.removeMaybe(this._frameTask);this._streamDataLoader=k.destroyMaybe(this._streamDataLoader);this._memoryController=k.destroyMaybe(this._memoryController);this._scheduler=k.destroyMaybe(this._scheduler);this.view=null}get updating(){return!!(this._memoryController?.updating||this._streamDataLoader?.updating||this._immediateTask?.updating)||
this._updatingObjects?.value.some(x=>x.updating)}get scheduler(){return this._scheduler}get memoryController(){return this._memoryController}createStreamDataRequester(x){const y=this._streamDataLoader;return{request(z,A,B){return y.request(z,A,x,B)},get busy(){return!y.hasDownloadSlots(x)}}}addUpdatingObject(x){const y=this._updatingObjects;y.value=[...y.value,x];return l.makeHandle(()=>{y.value=y.value.filter(z=>z!==x)})}_frame(x){if(!this.view.suspended){if(this.view.stateManager&&(this.view.stateManager.step(e.secondsFromMilliseconds(x.deltaTime)),
!this._scheduler))return;this._memoryController.update();this._scheduler.updateBudget(x)&&this._scheduler.frame()}}_stationaryChangedHandler(){this.memoryController.resetStableQuality()}get test(){}};b.__decorate([g.property()],u.prototype,"view",void 0);b.__decorate([g.property()],u.prototype,"_scheduler",void 0);b.__decorate([g.property()],u.prototype,"_memoryController",void 0);b.__decorate([g.property()],u.prototype,"_streamDataLoader",void 0);b.__decorate([g.property()],u.prototype,"_immediateTask",
void 0);b.__decorate([g.property()],u.prototype,"_normalTask",void 0);b.__decorate([g.property()],u.prototype,"_updatingObjects",void 0);b.__decorate([g.property({readOnly:!0})],u.prototype,"updating",null);u=b.__decorate([w.subclass("esri.views.3d.support.ResourceController")],u);a.newResourceController=function(x){return new u({view:x})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/index":function(){define(["exports"],function(a){a.ClientType=void 0;(function(q){q[q.ELEVATION=
0]="ELEVATION";q[q.BASEMAP=1]="BASEMAP";q[q.I3S_INDEX=2]="I3S_INDEX";q[q.I3S_DATA=3]="I3S_DATA";q[q.SYMBOLOGY=4]="SYMBOLOGY"})(a.ClientType||(a.ClientType={}));const b=(()=>{const q=[];q[a.ClientType.ELEVATION]=10;q[a.ClientType.BASEMAP]=10;q[a.ClientType.I3S_INDEX]=10;q[a.ClientType.I3S_DATA]=10;q[a.ClientType.SYMBOLOGY]=5;return q})();a.downloadSlotsPerClient=b;a.maxDownloadSlots=30;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/MemoryController":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/has ../../../core/Logger ../../../core/MemCache ../../../core/scheduling ../../../core/accessorSupport/decorators/property ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./MemoryManagedView".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){let d=class extends q{constructor(t){super(t);this._quality=1;this._usedMemory=0;this._updating=!1;this._downscaleMemoryUsed=this._stableQuality=0;this._canFastRecover=!1;this._memoryPredicted=0;this._cacheStorage=new k.MemCacheStorage;this._warnMemoryUsage=null;this._numQualityChanges=0;this._maxMemory=750;this._additionalCacheMemory=0;this.addHandles(h.addFrameTask({prepare:()=>this._updateMemory()}))}destroy(){this._cacheStorage.destroy()}get maxMemory(){return this._maxMemory}set maxMemory(t){null==
t||0>=t||(this._stableQuality=0,this._canFastRecover=!1,this._maxMemory<t&&this._updateQuality(1),this._maxMemory=t)}get additionalCacheMemory(){return this._additionalCacheMemory}set additionalCacheMemory(t){null!=t&&(this._additionalCacheMemory=t)}get memoryFactor(){return this._quality}get updating(){return this._updating}get usedMemory(){return this._usedMemory}get usedCacheMemory(){return this._cacheStorage.size}newCache(t,w){return new k.MemCache(t,this._cacheStorage,w)}resetStableQuality(){this._stableQuality=
0}disableMemCache(){this.additionalCacheMemory=-4096}update(){if(!(0>=this._memoryPredicted)||this._updating){var t=this._layersUpdating();if(.6>this._memoryPredicted&&this._canFastRecover)this._stableQuality=this._downscaleMemoryUsed=0,this._canFastRecover=!1,this._updateQuality(1);else if(t){if(1.1<this._memoryPredicted||1<this._usedMemory)0<this._stableQuality?(this._downscaleMemoryUsed=0,this._updateQuality(this._stableQuality)):.1<this._quality&&this._downscaleMemoryUsed<this._usedMemory&&(this._updateQuality(this._quality/
1.3),this._downscaleMemoryUsed=this._usedMemory,this._canFastRecover=!1)}else this._downscaleMemoryUsed=0,1<this._usedMemory?(this._stableQuality=0,this._canFastRecover=!1,t=this._updateQuality(this._quality/1.3),this._downscaleMemoryUsed=this._memoryPredicted):this._stableQuality!==this._quality&&(.75>this._usedMemory&&1>this._quality?(this._stableQuality=this._quality,t=this._updateQuality(this._quality+.05)):1>this._quality&&(this._canFastRecover=!0));this._updating=t}}_updateQuality(t){t=Math.min(Math.max(t,
.1),1);if(t===this._quality)return!1;this._quality=t;++this._numQualityChanges;return!0}_layersUpdating(){return this.view.allLayerViews.some(t=>!!t.updating)}_updateMemory(){if(this.view){this.view._stage?.renderer?.tick();var t=this.view._stage?.renderer?.usedMemory,w=(this.view.basemapTerrain?.usedMemory??0)+(t?t.fbos+t.edges+t.plugins:0),v=0;this.view.allLayerViews&&this.view.allLayerViews.forEach(r=>{if(g.isMemoryManagedView(r)){const n=r.ignoresMemoryFactor?this._quality:1;w+=r.usedMemory*n;
v+=r.unloadedMemory*n}});var m=null==this._warnMemoryUsage||Math.round(10*w)!==Math.round(10*this._warnMemoryUsage);t=1048576*this.maxMemory;if(w>t&&m){this._warnMemoryUsage=w;m=n=>(n/1048576).toLocaleString(void 0,{maximumFractionDigits:1})+" MB";const r=Math.round(100*this._quality);p.getLogger(this).warn(`Memory Limit exceeded! Limit: ${m(t)} Current: ${m(w)} Projected: ${m(w+v)} Quality: ${r}%`)}this._usedMemory=w/t;this._memoryPredicted=(w+v)/t;this._cacheStorage.maxSize=Math.max(0,t-w+1048576*
this.additionalCacheMemory)}}get test(){}};b.__decorate([f.property({constructOnly:!0})],d.prototype,"view",void 0);b.__decorate([f.property()],d.prototype,"maxMemory",null);b.__decorate([f.property()],d.prototype,"additionalCacheMemory",null);b.__decorate([f.property({readOnly:!0})],d.prototype,"memoryFactor",null);b.__decorate([f.property({readOnly:!0})],d.prototype,"updating",null);b.__decorate([f.property({readOnly:!0})],d.prototype,"usedMemory",null);b.__decorate([f.property({readOnly:!0})],
d.prototype,"usedCacheMemory",null);b.__decorate([f.property()],d.prototype,"_quality",void 0);b.__decorate([f.property()],d.prototype,"_usedMemory",void 0);b.__decorate([f.property()],d.prototype,"_updating",void 0);b.__decorate([f.property()],d.prototype,"_stableQuality",void 0);b.__decorate([f.property()],d.prototype,"_maxMemory",void 0);b.__decorate([f.property()],d.prototype,"_additionalCacheMemory",void 0);d=b.__decorate([e.subclass("esri.views.3d.support.MemoryController")],d);a.minQuality=
.1;a.newMemoryController=function(t){return new d({view:t})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/MemoryManagedView":function(){define(["exports"],function(a){a.isMemoryManagedView=function(b){return"usedMemory"in b&&"unloadedMemory"in b&&"ignoresMemoryFactor"in b};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/StreamDataLoader":function(){define("exports ../../../chunks/tslib.es6 ../../../request ../../../core/Accessor ../../../core/arrayUtils ../../../core/Error ../../../core/has ../../../core/lang ../../../core/maybe ../../../core/promiseUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/accessorSupport/decorators/subclass ./AsyncWorkerQueue ./ImageWithType ../terrain/TerrainData ../webgl-engine/lib/Util ../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){function u(z){if(2>z.byteLength)return"unknown";z=new Uint8Array(z,0,z.byteLength);return 137===z[0]&&80===z[1]?"image/png":71===z[0]&&73===z[1]?"image/gif":66===z[0]&&77===z[1]?"image/bmp":255===z[0]&&216===z[1]?"image/jpeg":"unknown"}a.StreamDataLoader=class extends l{constructor(){super(...arguments);this._tasks=new Map;this._onLoadQueue=[];this._doneQueue=[];this.updating=!1}setup(z,A,B){this._loadQueue=new w.AsyncWorkerQueue((C,D)=>this._startLoading(C,
D),(C,D)=>this._doneLoadingCB(C,D),z,A);B&&(this._frameTask=B.registerTask(n.TaskPriority.STREAM_DATA_LOADER,this))}destroy(){this._frameTask=c.removeMaybe(this._frameTask);this._tasks.forEach(z=>c.abortMaybe(z.abortController));this._loadQueue=c.destroyMaybe(this._loadQueue);this._tasks=this._doneQueue=this._onLoadQueue=null}hasDownloadSlots(z){return this._loadQueue.hasQuota(z)}request(z,A,B,C={}){const D=e.createResolver();D.__signal=null!=C?C.signal:null;const F=this._createOrUpdateTask(z,A,B,
C,D);e.onAbort(C,()=>this._cancelRequest(F,D));return D.promise}_createTask(z,A,B,C,D,F){z=new y(z,A,B,C,D);this._updateTask(z,F);this._tasks.set(D,z);1===this._tasks.size&&this._set("updating",!0);this._loadQueue.push(z);return z}_cancelRequest(z,A){p.removeUnordered(z.resolvers,A);A.reject(e.createAbortError());0===z.resolvers.length&&(z.status===a.TaskStatus.DOWNLOADING&&(z.status=a.TaskStatus.CANCELLED,this._loadQueue.cancel(z),z.abortController?.abort(),z.request=null,z.abortController=null),
z.status=a.TaskStatus.CANCELLED,this._tasks.delete(z.key),0===this._tasks.size&&this._set("updating",!1))}_updateTask(z,A){z.resolvers.push(A)}_createOrUpdateTask(z,A,B,C,D){const F=`${C?.uid||z}:${A}:${B}`,H=this._tasks.get(F);return H?(this._updateTask(H,D),H):this._createTask(z,C,A,B,F,D)}_doneLoadingCB(z,A){this._loadQueue&&(r.assert(z.status===a.TaskStatus.DOWNLOADING),z.status=a.TaskStatus.DOWNLOADED,this._frameTask?this._doneQueue.push({task:z,err:A}):this._doneLoading(z,A))}get running(){return 0<
this._doneQueue.length||0<this._onLoadQueue.length}runTask(z){for(;!z.done&&0<this._onLoadQueue.length;){var A=this._onLoadQueue.shift();e.throwIfAborted(A.task.abortController);A.task.abortController=null;A.callback(A.task);z.madeProgress()}for(;!z.done&&0<this._doneQueue.length;)A=this._doneQueue.shift(),A.task.status!==a.TaskStatus.DOWNLOADED&&(A.err=A.err||e.createAbortError()),this._doneLoading(A.task,A.err),z.madeProgress()}_doneLoading(z,A){if(A&&!e.isAbortError(A)&&0<z.numRetries)--z.numRetries,
this._loadQueue.push(z);else{var B=m.isImageWithType(z.result)||z.result instanceof HTMLImageElement?0:z.resolvers.length;for(const C of z.resolvers)if(A)e.isAbortError(A)?C.reject(A):C.reject(new k("stream-data-loader:request-error",`Failed to request resource at '${z.url}'. ${A}`,{url:z.url,error:A}));else{--B;const D=0<B?f.clone(z.result):z.result;C.resolve(D)}this._tasks.delete(z.key);0===this._tasks.size&&this._set("updating",!1)}}_startLoading(z,A){if(z.status===a.TaskStatus.CANCELLED)return!1;
z.startTime=performance.now();z.status=a.TaskStatus.DOWNLOADING;let B,C;switch(z.docType){case "binary":C="array-buffer";B=0;break;case "image":C="image";break;case "image+type":C="array-buffer";break;default:C="json"}z.abortController=new AbortController;const D=z.abortController.signal;z.request=q(z.url,{...z.options,responseType:C,timeout:B,signal:D});const F=N=>{z.duration=performance.now()-z.startTime;z.size=N instanceof ArrayBuffer?N.byteLength:z.size||0;z.result=N;this._frameTask?this._onLoadQueue.push({callback:A,
task:z}):(z.abortController=null,A(z))},H=N=>{z.status===a.TaskStatus.DOWNLOADING&&A(z,N)};if("image+type"!==z.docType)return z.request.then(N=>F(N.data),H),!0;z.request.then(N=>{N=N.data;const E=u(N);C="image";z.size=N.byteLength;if("unknown"===E)z.request=q(z.url,{responseType:C,timeout:B,signal:D}),z.request.then(I=>F(I.data),H);else{N=new Blob([N],{type:E});var G=window.URL.createObjectURL(N);z.request=q(G,{responseType:C,timeout:B,signal:D});z.request.then(I=>F(new v.ImageWithType(I.data,E)),
H).finally(()=>window.URL.revokeObjectURL(G))}},H);return!0}get test(){}};b.__decorate([g.property({readOnly:!0})],a.StreamDataLoader.prototype,"updating",void 0);a.StreamDataLoader=b.__decorate([t.subclass("esri.views.3d.support.StreamDataLoader")],a.StreamDataLoader);const x={numRetries:0};class y extends w.BaseTask{constructor(z,A,B,C,D){super(C);this.url=z;this.options=A;this.docType=B;this.key=D;this.result=null;this.status=a.TaskStatus.QUEUED;this.abortController=this.request=null;this.resolvers=
[];this.startTime=0;this.numRetries=x.numRetries}}a.TaskStatus=void 0;(function(z){z[z.QUEUED=1]="QUEUED";z[z.DOWNLOADING=2]="DOWNLOADING";z[z.DOWNLOADED=3]="DOWNLOADED";z[z.CANCELLED=4]="CANCELLED"})(a.TaskStatus||(a.TaskStatus={}));a.test=x;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/AsyncWorkerQueue":function(){define(["exports","../../../core/has","../webgl-engine/lib/Util"],function(a,b,q){class l{constructor(f){this.client=f;this._cancelled=!1;this.duration=
this.size=0}}class p{constructor(f){this.typeWorkerQuota=f;this.tasks=[];this.numWorkers=0;this.statistics=new k}}class k{constructor(){this.speed=this.duration=this.size=this.requests=0}}class h{constructor(f,c,e,g){this._workerFunc=f;this._callbackFunc=c;this._maxTotalNumWorkers=e;this._totalNumWorkers=0;this._clients=g.map(d=>new p(d))}destroy(){this._clients.length=0}hasQuota(f){return(f=this._clients[f])?this._totalNumWorkers<this._maxTotalNumWorkers||f.numWorkers+f.tasks.length<f.typeWorkerQuota:
!1}push(f){const c=this._clients[f.client];c&&(this._totalNumWorkers<this._maxTotalNumWorkers?(c.numWorkers++,this._totalNumWorkers++,this._workerFunc(f,(e,g)=>this._taskCallback(e,g))):c.tasks.push(f))}cancel(f){this._taskFinished(f);f._cancelled=!0}_taskFinished(f){const c=this._clients[f.client];this._totalNumWorkers--;c&&(c.numWorkers--,c.statistics.requests++,c.statistics.size+=f.size||0,c.statistics.duration+=f.duration||0,c.statistics.speed=0<c.statistics.duration?c.statistics.size/c.statistics.duration:
0,q.assert(0<=c.numWorkers));this._next()}_next(){for(const f of this._clients)if(f&&f.numWorkers<f.typeWorkerQuota&&this._processQueue(f))return;for(const f of this._clients)if(f&&this._processQueue(f))break}_processQueue(f){for(;0<f.tasks.length;)if(this._workerFunc(f.tasks.shift(),(c,e)=>this._taskCallback(c,e)))return f.numWorkers++,this._totalNumWorkers++,!0;return!1}_taskCallback(f,c){f._cancelled||(this._callbackFunc(f,c),this._taskFinished(f))}getStatsForType(f){return(f=this._clients[f])?
{quota:f.typeWorkerQuota,workers:f.numWorkers,queueSize:f.tasks.length,requestStats:f.statistics}:null}get test(){}}a.AsyncWorkerQueue=h;a.BaseTask=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/ImageWithType":function(){define(["exports"],function(a){class b{constructor(q,l){this.element=q;this.type="image+type";this.isOpaque="image/jpeg"===l}}a.ImageWithType=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TerrainData":function(){define(["exports"],
function(a){a.isImageWithType=function(b){return null!=b&&"type"in b&&"image+type"===b.type};a.isRasterTile=function(b){return null!=b&&"type"in b&&"raster-tile"===b.type};a.isTileTexture=function(b){return null!=b&&"type"in b&&"tile-texture"===b.type};a.isVectorTile=function(b){return null!=b&&"type"in b&&"vector-tile"===b.type};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/SceneViewPerformanceInfo":function(){define(["../../../core/ByteSizeUnit","../layers/support/LayerViewPerformanceInfo",
"./LayerPerformanceInfo"],function(a,b,q){class l{constructor(p){this.usedMemory=this.totalMemory=0;this.quality=1;this.edgesMemory=this.terrainMemory=this.load=0;this.layerPerformanceInfos=[];this.fboMemory=this.cachedMemory=0;if(null!=p.resourceController){const k=p.resourceController.memoryController;this.totalMemory=(k.maxMemory??0)*a.ByteSizeUnit.MEGABYTES;this.usedMemory=Math.round(k.usedMemory*this.totalMemory);this.quality=p.quality;this.load=p.resourceController.scheduler.load;this.cachedMemory=
k.usedCacheMemory}this.terrainMemory=p.basemapTerrain?.usedMemory??0;this.edgesMemory=p._stage?.renderer.usedMemory.edges??0;this.fboMemory=p._stage?.renderer.usedMemory.fbos??0;p.allLayerViews?.items.forEach(k=>{b.isPerformanceInfoLayerView(k)&&this.layerPerformanceInfos.push(new q(k))});this.layerPerformanceInfos.sort((k,h)=>h.memory-k.memory)}}return l})},"esri/core/ByteSizeUnit":function(){define(["exports"],function(a){a.ByteSizeUnit=void 0;var b=a.ByteSizeUnit||(a.ByteSizeUnit={});b[b.KILOBYTES=
1024]="KILOBYTES";b[b.MEGABYTES=1048576]="MEGABYTES";b[b.GIGABYTES=1073741824]="GIGABYTES";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/LayerViewPerformanceInfo":function(){define(["exports"],function(a){class b{constructor(q,l=0,p=0,k=0,h=0,f=null){this.usedMemory=q;this.displayedFeatures=l;this.totalFeatures=p;this.maximumFeatures=k;this.nodes=h;this.core=f}}a.LayerViewPerformanceInfo=b;a.isPerformanceInfoLayerView=function(q){return"performanceInfo"in
q};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/LayerPerformanceInfo":function(){define(function(){class a{constructor(b){this.layer=null;this.displayedNumberOfFeatures=this.memory=0;this.totalNumberOfFeatures=this.maximumNumberOfFeatures=null;this.layer=b.layer;b=b.performanceInfo;this.memory=b.usedMemory;this.displayedNumberOfFeatures=b.displayedFeatures;this.maximumNumberOfFeatures=b.maximumFeatures;this.totalNumberOfFeatures=b.totalFeatures}}return a})},
"esri/views/3d/support/SharedSymbolResources":function(){define("exports ../../../core/arrayUtils ../../../core/Handles ../../../core/handleUtils ../../../core/has ../../../core/maybe ../../../core/reactiveUtils ../../../geometry/ellipsoidUtils ../layers/graphics/ObjectResourceCache ./index ./StreamTextureCollection ../webgl-engine/lib/screenSizePerspectiveUtils".split(" "),function(a,b,q,l,p,k,h,f,c,e,g,d){class t{constructor(v){this.streamDataRequester=null;this._graphicsOwners=[];this.cimSymbolRasterizer=
this._screenSizePerspectiveHandles=null;this._viewState=v.viewState;this._view=v.view;this._pointsOfInterest=v.pointsOfInterest;this.streamDataRequester=v.resourceController.createStreamDataRequester(e.ClientType.SYMBOLOGY);this.objectResourceCache=new c.ObjectResourceCache((r,n)=>v.resourceController.memoryController.newCache(r,n));this.textures=new g.StreamTextureCollection(this.streamDataRequester,v.view._stage,v.resourceController.scheduler);const m=f.getReferenceEllipsoid(this._view.spatialReference).radius;
this.screenSizePerspectiveSettings=d.getSettings(v.viewingMode,m);this.screenSizePerspectiveSettingsLabels=d.getLabelSettings(v.viewingMode,m)}destroy(){this.textures.destroy();this.streamDataRequester=null}addGraphicsOwner(v){if(!v)return l.makeHandle();this._graphicsOwners.push(v);const m=h.watch(()=>v.layer?.screenSizePerspectiveEnabled,()=>this._updateScreenSizePerspectiveEnabled());this._updateScreenSizePerspectiveEnabled();return l.makeHandle(()=>{m.remove();b.removeUnordered(this._graphicsOwners,
v);this._updateScreenSizePerspectiveEnabled()})}_updateScreenSizePerspectiveEnabled(){var v=this._graphicsOwners.some(m=>!0===m.layer?.screenSizePerspectiveEnabled);v&&!this._screenSizePerspectiveHandles?(this._screenSizePerspectiveHandles=new q,v=()=>this._updateScreenSizePerspectiveSettings(),this._screenSizePerspectiveHandles.add([h.watch(()=>this._pointsOfInterest.centerOnSurfaceInfrequent.distance,v,h.sync),this._viewState.events.on("camera-projection-changed",v)]),this._updateScreenSizePerspectiveSettings()):
v||(this._screenSizePerspectiveHandles=k.destroyMaybe(this._screenSizePerspectiveHandles))}_updateScreenSizePerspectiveSettings(){w.distance=this._pointsOfInterest.centerOnSurfaceInfrequent.distance;w.fovY=this._viewState.camera.fovY;this.screenSizePerspectiveSettings.update(w);this.screenSizePerspectiveSettingsLabels.update(w);this._view._stage.renderView.requestRender()}get test(){}}const w={distance:0,fovY:0};a.SharedSymbolResources=t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/layers/graphics/ObjectResourceCache":function(){define("exports ../../../../core/maybe ../../../../core/promiseUtils ../../glTF/DefaultLoadingContext ../../glTF/loader ./wosrLoader".split(" "),function(a,b,q,l,p,k){async function h(c,e,g,d,t){q.throwIfAborted(t);const w=q.onAbort(t,()=>{{const m=c.get(g);null!=m&&0<--m.refCount||(c.delete(g),null!=m&&m.abortController.abort())}});var v=c.get(g);v?v.refCount++:(v=new AbortController,d=d({...t,signal:v.signal}),v={refCount:1,abortController:v,
promise:d},c.set(g,v));try{const m=await v.promise;e.put(g,m,m.size);c.delete(g);q.throwIfAborted(t);return m}finally{b.removeMaybe(w)}}class f{constructor(c){this._gltfLoading=new Map;this._wosrLoading=new Map;this._gltfMemCache=c("gltf-resources",()=>{});this._wosrMemCache=c("wosr-resources",()=>{})}destroy(){this._gltfLoading.forEach(c=>c.abortController.abort());this._wosrLoading.forEach(c=>c.abortController.abort());this._gltfMemCache.destroy();this._wosrMemCache.destroy()}loadGLTF(c,e,g){const d=
g?`gltfPBR:${c}`:`gltf:${c}`,t=this._gltfMemCache.get(d);return null!=t?Promise.resolve(t):h(this._gltfLoading,this._gltfMemCache,d,w=>p.loadGLTF(new l.DefaultLoadingContext(w.streamDataRequester),c,w,g),e)}loadWOSR(c,e){const g=`wosr:${c}:${e.disableTextures}`,d=this._wosrMemCache.get(g);return null!=d?Promise.resolve(d):h(this._wosrLoading,this._wosrMemCache,g,t=>k.load(c,t),e)}}a.ObjectResourceCache=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/StreamTextureCollection":function(){define("exports ../../../core/promiseUtils ../../../core/urlUtils ./TextureCollection ../webgl-engine/lib/Texture ../../webgl/enums".split(" "),
function(a,b,q,l,p,k){class h extends l.TextureCollection{constructor(f,c,e){super(c,e);this._streamDataRequester=f}async fromUrl(f,c,e){b.throwIfAborted(e);e=e?.signal;const g=this.makeUid(f,c);let d=this._textureRequests.get(g);if(!d){const t=new AbortController,w=this._streamDataRequester.request(f,"image",{uid:g,signal:t.signal});d=new l.TextureRequest;d.abortController=t;const v=d;this._textureRequests.set(g,d);d.textureAsync=w.then(async m=>{m=this._createTexture(f,m,c);v.texture=m;v.abortController=
null;await m.load(this._stage.renderView.renderingContext);this._stage.add(m);return new l.TextureResult(g,m,()=>this._release(g))},m=>{v.abortController=null;throw m;})}d.referenceCount++;try{return await b.whenOrAbort(d.textureAsync,e)}catch(t){throw this._release(g),t;}}_createTexture(f,c,e){const g={width:c.width,height:c.height,wrap:{s:k.TextureWrapMode.CLAMP_TO_EDGE,t:k.TextureWrapMode.CLAMP_TO_EDGE},preMultiplyAlpha:!0,reloadable:!0};if(q.isSVG(f)){if(e||0===c.width&&0===c.height)f=c.width?
c.height/c.width:1,e=e||64,1<f?(c.width=Math.round(e/f),c.height=e):(c.width=e,c.height=Math.round(e*f));this._stage.renderView?.renderingContext.driverTest.svgPremultipliesAlpha.result&&(g.preMultiplyAlpha=!1)}return new p.Texture(c,g)}}a.StreamTextureCollection=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/TextureCollection":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/has ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c){a.TextureCollection=class extends q{constructor(d,t){super({});this._stage=d;this._textureRequests=new Map;this._frameTask=t?.registerTask(c.TaskPriority.TEXTURE_UNLOAD)??c.ImmediateTask}normalizeCtorArgs(){return{}}destroy(){super.destroy();this._frameTask?.remove();this._textureRequests?.forEach(d=>this._releaseTextureRequest(d));this._textureRequests?.clear()}get updating(){return this._frameTask.updating}fromData(d,t){const w=this.makeUid(d);d=this._textureRequests.get(w);
d||(d=new g,d.texture=t(),this._stage&&(d.texture.load(this._stage.renderView.renderingContext),this._stage.add(d.texture)),this._textureRequests.set(w,d));d.referenceCount++;return new e(w,d.texture,()=>this._release(w))}_release(d){const t=this._textureRequests.get(d);t?(1>t.referenceCount&&console.warn("TextureCollection: reference count is \x3c 1 for "+d),t.referenceCount--,1>t.referenceCount&&this._frameTask.schedule(()=>this._releaseNow(d))):console.warn(`TextureCollection: texture doesn't exist: '${d}'`)}get test(){}_releaseNow(d){if(this._textureRequests){var t=
this._textureRequests.get(d);!t||0<t.referenceCount||(t.texture?.unload(),this._releaseTextureRequest(t),this._textureRequests.delete(d))}}_releaseTextureRequest(d){d.texture?this._stage?.remove(d.texture):d.abortController&&(d.abortController.abort(),d.abortController=null)}makeUid(d,t=null){return null!=t?`${d}.${t}px`:d}};b.__decorate([p.property()],a.TextureCollection.prototype,"_frameTask",void 0);b.__decorate([p.property()],a.TextureCollection.prototype,"updating",null);a.TextureCollection=
b.__decorate([f.subclass("esri.views.3d.support.TextureCollection")],a.TextureCollection);class e{constructor(d,t,w){this.uid=d;this.texture=t;this.release=w}}class g{constructor(){this.referenceCount=0}}a.TextureRequest=g;a.TextureResult=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/PointsOfInterest":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/ray ../debugFlags ../debugUtils ../PropertiesPool ../geometryUtils/ray ./CameraOnSurface ./CenterOnSurface ./ContentGeometryUpdates ./Focus ./StableSurfaceCenter ./SurfaceGeometryUpdates ../../webgl-engine/lib/Intersector ../../webgl-engine/lib/IntersectorInterfaces ../../webgl-engine/lib/verticalOffsetUtils ../../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D){a.PointsOfInterest=class extends q{constructor(G){super(G);this.renderPointOfView=g.create();this._pois=[];this._debugCenters=new Map;this._tmpRay=d.create();this._centerRayDirty=!0;this._surfaceAltitudeAtCenter=0;this._surfaceAltitudeAtCenterDirty=!0;this._contentAltitudeAtCenter=0;this._contentAltitudeAtCenterDirty=!0;this._propertiesPool=new v.PropertiesPool({renderPointOfView:F},this)}initialize(){const {state:G,basemapTerrain:I,renderCoordsHelper:O,
map:L}=this.view;this._surfaceIntersector=A.newIntersector(G.viewingMode);this._surfaceIntersector.options.backfacesTerrain=G.isGlobal?!1:!0;this._surfaceIntersector.options.invisibleTerrain=!1;this._surfaceIntersector.options.store=B.StoreResults.MIN;this._contentIntersector=A.newIntersector(G.viewingMode);var P=()=>this._estimateSurfaceAltitudeAtCenter();const M=this.view.resourceController.scheduler,K=this.view.basemapTerrain?.elevationQueryCache,J={state:G,scheduler:M,surface:I,renderCoordsHelper:O};
this._set("centerOnSurfaceInfrequent",new n.CenterOnSurface({...J,task:D.TaskPriority.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:P}));this._set("centerOnSurfaceFrequent",new n.CenterOnSurface({...J,task:D.TaskPriority.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:P}));this._set("centerOnContent",new n.CenterOnSurface({...J,task:D.TaskPriority.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:()=>this._estimateContentAltitudeAtCenter()}));this._set("cameraOnSurface",
new r.CameraOnSurface({...J,cache:K,task:D.TaskPriority.POINT_OF_INTEREST_INFREQUENT,map:L}));this._set("surfaceGeometryUpdates",new z.SurfaceGeometryUpdates({...J,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]}));this._set("contentGeometryUpdates",new u.ContentGeometryUpdates({contentLayerViews:this.view.allLayerViews,renderCoordsHelper:O}));this._set("surfaceOrigin",new y.StableSurfaceCenter({cache:K,view:this.view}));this._set("focus",new x.Focus({state:G,
scheduler:M,surface:I,renderCoordsHelper:O,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(R,Q)=>this._estimateSurfaceIntersectionAtRenderPoint(R,this.view.state.contentCamera,Q)}));this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus);P=this.view.graphics;this._debugCenters.set(this.centerOnContent,new w.PointGraphics(P,"red","CenterOnContent"));this._debugCenters.set(this.centerOnSurfaceFrequent,
new w.PointGraphics(P,"red","CenterOnSurface"));this._debugCenters.set(this.centerOnSurfaceInfrequent,new w.PointGraphics(P,"red","CenterOnSurface"));this._debugCenters.set(this.cameraOnSurface,new w.PointGraphics(P,"blue","CameraOnSurface"));this._debugCenters.set(this.focus,new w.PointGraphics(P,"green","Focus"));this.addHandles([p.watch(()=>G.contentCamera,R=>this._cameraChanged(R),p.sync),p.watch(()=>I.extent,()=>this._updateCenterPointsOfInterest()),p.when(()=>!I.updating,()=>this._updateCenterPointsOfInterest(),
p.sync),p.on(()=>this.surfaceGeometryUpdates.events,"request-update",()=>this._updateCenterPointsOfInterest()),p.on(()=>this.contentGeometryUpdates.events,"request-update",()=>this._updateCenterOnContent()),p.when(()=>t.debugFlags.SHOW_POI,R=>this._setDebug(R),p.initial)]);this._cameraChanged(this.view.state.contentCamera);for(const R of this._pois)R.runTask()}destroy(){this._setDebug(!1);this._propertiesPool.destroy();for(const G of this._pois)G.destroy();this.surfaceOrigin.destroy()}get updating(){return!(!this.surfaceGeometryUpdates?.updating&&
!this._pois.some(G=>G.updating))}get _centerRay(){this._centerRayDirty&&(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),this._centerRayDirty=!1);return this._centerRayCached}_estimateContentAltitudeAtCenter(){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;this._contentAltitudeAtCenterDirty=!1;const G=this._centerRay;if(null==G)return this._contentAltitudeAtCenter;this.view.sceneIntersectionHelper.intersectRay(G,
this._contentIntersector,H,E)?this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(H):this._contentAltitudeAtCenter=this._estimateSurfaceAltitudeAtCenter();return this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(){if(!this.view.basemapTerrain)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;this._surfaceAltitudeAtCenterDirty=!1;const G=this._centerRay;if(null==G)return this._surfaceAltitudeAtCenter;const I=G.origin,O=e.add(H,G.origin,
G.direction);this._surfaceIntersector.resetWithRay(G,this.view.state.contentCamera);this.view.basemapTerrain.intersect(this._surfaceIntersector,null,I,O);this._surfaceIntersector.results.min.getIntersectionPoint(H)&&(this._surfaceAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(H));return this._surfaceAltitudeAtCenter}_estimateSurfaceIntersectionAtRenderPoint(G,I,O){G=m.fromRenderAtEye(I,G,N);if(null==G)return null;const L=G.origin,P=e.add(H,G.origin,G.direction);this._surfaceIntersector.resetWithRay(G,
I);this.view.basemapTerrain.intersect(this._surfaceIntersector,null,L,P);return this._surfaceIntersector.results.min.getIntersectionPoint(O)?O:null}_cameraChanged(G){this._updateCenterPointsOfInterest();G=G.eye;e.exactEquals(this.renderPointOfView,G)||this._set("renderPointOfView",e.copy(this._propertiesPool.get("renderPointOfView"),G))}_updateCenterPointsOfInterest(){this._contentAltitudeAtCenterDirty=this._surfaceAltitudeAtCenterDirty=this._centerRayDirty=!0;for(const G of this._pois)G.updateRenderLocation()}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=
!0;this.centerOnContent.updateRenderLocation()}_setDebug(G){if(G)for(const I of this._pois)this.addHandles(p.watch(()=>I.renderLocation,O=>this._debugCenters.get(I)?.show(O,I.renderCoordsHelper.spatialReference),p.initial),"debug");else this._debugCenters.forEach(I=>I.hide()),this.removeHandles("debug")}get test(){}};b.__decorate([k.property()],a.PointsOfInterest.prototype,"centerOnContent",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"centerOnSurfaceFrequent",void 0);b.__decorate([k.property()],
a.PointsOfInterest.prototype,"centerOnSurfaceInfrequent",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"cameraOnSurface",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"focus",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"renderPointOfView",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"surfaceOrigin",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"contentGeometryUpdates",void 0);b.__decorate([k.property()],
a.PointsOfInterest.prototype,"surfaceGeometryUpdates",void 0);b.__decorate([k.property({constructOnly:!0})],a.PointsOfInterest.prototype,"view",void 0);b.__decorate([k.property()],a.PointsOfInterest.prototype,"updating",null);a.PointsOfInterest=b.__decorate([c.subclass("esri.views.3d.support.pointsOfInterest.PointsOfInterest")],a.PointsOfInterest);const F=Array,H=g.create(),N=d.create(),E={exclude:new Set([C.terrainId])};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/debugUtils":function(){define("exports ../../../geometry ../../../Graphic ../../../symbols ../../../core/Collection ../../../symbols/PointSymbol3D ../../../symbols/IconSymbol3DLayer ../../../symbols/TextSymbol3DLayer ../../../geometry/Point".split(" "),
function(a,b,q,l,p,k,h,f,c){class e{constructor(g,d,t=""){this.graphics=g;this._symbol=new k({symbolLayers:new p([new h({material:{color:d},outline:{color:[255,255,255],size:1},resource:{primitive:"circle"}}),new f({text:t,halo:{color:"white",size:1/.75},material:{color:d},size:12})])})}show(g,d){null!=d&&(this.hide(),g=new c({x:g[0],y:g[1],z:g[2],spatialReference:d}),this._graphic=new q({geometry:g,symbol:this._symbol}),this.graphics.add(this._graphic))}hide(){null!=this._graphic&&(this.graphics.remove(this._graphic),
this._graphic=null)}}a.PointGraphics=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/CameraOnSurface":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/Point ../../../ViewingMode ../cameraUtils ../PropertiesPool ./PointOfInterest ../../../support/Yield".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){const u=Array;a.CameraOnSurface=class extends r.PointOfInterest{constructor(y){super(y);this._dirty=!1;this._propertiesPool=new m.PropertiesPool({location:t,renderLocation:u},this);this._estimatedSurfaceAltitude=0;this._pendingElevationQueryController=null;this.renderLocation=d.create();this._tmpPoint=new t}initialize(){this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this));this.runTask();if(this.map){const y=()=>this._setDirty();
this.addHandles(p.on(()=>this.map?.ground?.layers,"change",y,{onListenerAdd:y,onListenerRemove:y}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest();this._propertiesPool=q.destroyMaybe(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const y=this._propertiesPool.get("location");y.spatialReference=this.state.spatialReference;this.renderCoordsHelper.fromRenderCoords(this.renderLocation,y);return y}get scale(){const y=this._camera,z=g.distance(y.eye,
this.renderLocation);return v.distanceToScale({renderCoordsHelper:this.renderCoordsHelper,state:{camera:y}},z,0)}get updating(){return this._dirty||null!=this._pendingElevationQueryController}updateRenderLocation(){this._setDirty();this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const y=this._pendingElevationQueryController;y&&(this._pendingElevationQueryController=null,y.abort(),this.notifyChange("updating"))}get running(){return!this._pendingElevationQueryController&&
this._dirty}runTask(){this._cancelPendingRequest();this._dirty=!1;this.notifyChange("updating");if(!this.map?.ground)return this._updateSurfaceAltitude(0),n.Yield;var y=this.state.spatialReference;this._tmpPoint.spatialReference=y;this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);y=1E5<(this._tmpPoint.z??0)&&this.renderCoordsHelper.viewingMode===w.ViewingMode.Global&&(y.isWGS84||y.isWebMercator);let z=new AbortController;this.map.ground.queryElevation(this._tmpPoint,{signal:z.signal,
cache:this.cache,minDemResolution:y?1E6:0}).then(A=>this._updateSurfaceAltitude(A.geometry.z??0)).catch(A=>{l.isAbortError(A)||this._updateSurfaceAltitude(0)}).catch(()=>{}).then(()=>{this._pendingElevationQueryController===z&&(this._pendingElevationQueryController=null,this.notifyChange("updating"));z=null});this._pendingElevationQueryController=z;return n.Yield}_updateSurfaceAltitude(y){this._estimatedSurfaceAltitude!==y&&(this._estimatedSurfaceAltitude=y,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(x,
this._estimatedSurfaceAltitude,this._camera.eye);g.exactEquals(this._get("renderLocation"),x)||(this._set("renderLocation",g.copy(this._propertiesPool.get("renderLocation"),x)),this.notifyChange("renderLocation"))}};b.__decorate([k.property({constructOnly:!0})],a.CameraOnSurface.prototype,"scheduler",void 0);b.__decorate([k.property({constructOnly:!0})],a.CameraOnSurface.prototype,"cache",void 0);b.__decorate([k.property({constructOnly:!0})],a.CameraOnSurface.prototype,"task",void 0);b.__decorate([k.property()],
a.CameraOnSurface.prototype,"location",null);b.__decorate([k.property({constructOnly:!0})],a.CameraOnSurface.prototype,"map",void 0);b.__decorate([k.property()],a.CameraOnSurface.prototype,"renderLocation",void 0);b.__decorate([k.property()],a.CameraOnSurface.prototype,"scale",null);b.__decorate([k.property()],a.CameraOnSurface.prototype,"updating",null);a.CameraOnSurface=b.__decorate([e.subclass("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],a.CameraOnSurface);const x=d.create();Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/PointOfInterest":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h,f){a.PointOfInterest=class extends q{constructor(c){super(c)}};b.__decorate([l.property({constructOnly:!0})],
a.PointOfInterest.prototype,"renderCoordsHelper",void 0);b.__decorate([l.property({constructOnly:!0})],a.PointOfInterest.prototype,"surface",void 0);b.__decorate([l.property({constructOnly:!0})],a.PointOfInterest.prototype,"state",void 0);a.PointOfInterest=b.__decorate([f.subclass("esri.views.3d.support.pointsOfInterest.PointOfInterest")],a.PointOfInterest);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/CenterOnSurface":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/maybe ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/Point ../../../../geometry/projection/projectBoundingRect ../../../../geometry/support/aaBoundingRect ../debugFlags ../PropertiesPool ./PointOfInterest ../../../support/Yield".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){const x=Array;a.CenterOnSurface=class extends n.PointOfInterest{constructor(B){super(B);this._propertiesPool=new r.PropertiesPool({location:t,renderLocation:x},this);this.distance=this._latestSurfaceAltitude=this._currentSurfaceAltitude=0;this.renderLocation=g.create();this.updating=!1}initialize(){this._frameWorker=this.scheduler.registerTask(this.task,this);this.runTask()}destroy(){this._frameWorker=l.removeMaybe(this._frameWorker);this._propertiesPool=
l.destroyMaybe(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const B=this._propertiesPool.get("location");B.spatialReference=this.state.spatialReference;this.renderCoordsHelper.fromRenderCoords(this.renderLocation,B);return B}updateRenderLocation(){this.updating=!0;this._updateRenderLocation()}get estimatedSurfaceAltitude(){return this._latestSurfaceAltitude}get running(){return this.updating}runTask(){this._latestSurfaceAltitude=this.estimateSurfaceAltitudeAtCenter();
this._updateRenderLocation();this.updating=!1;return u.Yield}_updateRenderLocation(){const B=y;let C=this._calculateSurfaceIntersection(this._currentSurfaceAltitude,B);var D=this._currentSurfaceAltitude!==this._latestSurfaceAltitude;!C&&D&&(C=this._calculateSurfaceIntersection(this._latestSurfaceAltitude,B))&&(this._currentSurfaceAltitude=this._latestSurfaceAltitude);D=z;C&&this._latestSurfaceAltitudeChangesDistanceSignificantly(B,D)&&(e.copy(B,D),this._currentSurfaceAltitude=this._latestSurfaceAltitude);
C?this.distance=e.distance(this._camera.eye,B):(e.scale(B,this._camera.viewForward,this._get("distance")),e.add(B,B,this._camera.eye));e.exactEquals(this._get("renderLocation"),B)||this._set("renderLocation",e.copy(this._propertiesPool.get("renderLocation"),B))}_calculateSurfaceIntersection(B,C){var D=this._camera;if(!this.renderCoordsHelper.intersectInfiniteManifold(D.ray,B,C))return!1;if(this.state.isGlobal){const F=d.getReferenceEllipsoid(this.renderCoordsHelper.spatialReference).radius;B=F+B;
const H=e.squaredLength(D.eye),N=H<B*B,E=e.distance(D.eye,C);N&&E>F/4&&(e.scale(C,D.viewForward,B-Math.sqrt(H)),e.add(C,C,D.eye))}else D=this.surface?.ready?this.surface.extent:null,null!=D&&w.projectBoundingRect(D,this.surface?.spatialReference,A,this.renderCoordsHelper.spatialReference)&&(C[0]=q.clamp(C[0],A[0],A[2]),C[1]=q.clamp(C[1],A[1],A[3]));return!0}_latestSurfaceAltitudeChangesDistanceSignificantly(B,C){if(this._latestSurfaceAltitude===this._currentSurfaceAltitude||null==B)return!1;if(this._calculateSurfaceIntersection(this._latestSurfaceAltitude,
C)){if(m.debugFlags.TESTS_DISABLE_OPTIMIZATIONS)return!0;const D=this._camera.eye;B=e.distance(D,B);C=e.distance(D,C);if(.05<Math.abs(C-B)/B)return!0}return!1}};b.__decorate([p.property({constructOnly:!0})],a.CenterOnSurface.prototype,"scheduler",void 0);b.__decorate([p.property({constructOnly:!0})],a.CenterOnSurface.prototype,"task",void 0);b.__decorate([p.property()],a.CenterOnSurface.prototype,"distance",void 0);b.__decorate([p.property({constructOnly:!0})],a.CenterOnSurface.prototype,"estimateSurfaceAltitudeAtCenter",
void 0);b.__decorate([p.property({readOnly:!0})],a.CenterOnSurface.prototype,"location",null);b.__decorate([p.property({readOnly:!0})],a.CenterOnSurface.prototype,"renderLocation",void 0);b.__decorate([p.property()],a.CenterOnSurface.prototype,"updating",void 0);a.CenterOnSurface=b.__decorate([c.subclass("esri.views.3d.support.pointsOfInterest.CenterOnSurface")],a.CenterOnSurface);const y=g.create(),z=g.create(),A=v.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/ContentGeometryUpdates":function(){define(["exports",
"../../../../core/Evented","../../../../core/Handles","../../../../core/maybe"],function(a,b,q,l){class p{constructor(h){this._handles=new q;this.events=new b;this._contentLayerViews=h.contentLayerViews;this._handles.add(this._contentLayerViews.on("change",f=>this._layerViewsChanged(f)));this._layerViewsChanged({added:this._contentLayerViews.toArray(),removed:[],moved:[],target:this._contentLayerViews})}destroy(){this._handles=l.destroyMaybe(this._handles);this._contentLayerViews.destroy()}_layerViewsChanged(h){h.added.forEach(f=>
{"esri.views.3d.layers.SceneLayerView3D"===f.declaredClass&&this._handles.add(f.on("visible-geometry-changed",()=>this._contentChanged()),f.uid)});h.removed.forEach(f=>this._handles.remove(f.uid))}_contentChanged(){this.events.emit("request-update",k)}}const k={};a.ContentGeometryUpdates=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/Focus":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/maybe ../../../../core/reactiveUtils ../../../../core/screenUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/Point ../../../../geometry/support/ray ../PropertiesPool ./PointOfInterest ../../webgl-engine/lib/rendererUtils ../../../support/Scheduler ../../../support/Yield".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){const y=Array;a.Focus=class extends r.PointOfInterest{constructor(C){super(C);this._propertiesPool=new m.PropertiesPool({location:w,renderLocation:y},this);this._dirty=!0;this.renderLocation=this._propertiesPool.get("renderLocation")}initialize(){this.addHandles([p.watch(()=>this.centerOnSurface.renderLocation,()=>this.updateRenderLocation()),p.watch(()=>this.state.contentCamera,()=>this.updateRenderLocation())]);this.scheduler&&this.addHandles(this.scheduler.registerTask(u.TaskPriority.POINT_OF_INTEREST_FREQUENT,
this))}destroy(){this._propertiesPool=l.destroyMaybe(this._propertiesPool)}get updating(){return this._dirty||this.centerOnSurface.updating}get location(){const C=this._propertiesPool.get("location");C.spatialReference=this.state.spatialReference;this.renderCoordsHelper.fromRenderCoords(this.renderLocation,C);return C}get worldUnitsPerContentPixel(){const {camera:C,contentPixelRatio:D}=this.state;return C.computeRenderPixelSizeAt(this.renderLocation)*(C.pixelRatio/D)}get running(){return this._dirty}runTask(){var C=
this._get("renderLocation");const D=this.centerOnSurface.renderLocation;var F=this.renderCoordsHelper,H=this.state.contentCamera;this._dirty=!1;F.worldUpAtPosition(D,z);F=Math.max(0,(Math.acos(d.dot(z,H.viewForward))-.5*Math.PI)*(H.aboveGround?1:-1));if(Number.isNaN(F))return C&&d.equals(C,D)||(C=this._propertiesPool.get("renderLocation"),d.copy(C,D),this._set("renderLocation",C)),x.Yield;F=1-q.clamp(F/(.5*Math.PI),0,1);F*=F*F;this._calculateScreenHorizontalEdgeOnSurface(B);H=this._propertiesPool.get("renderLocation");
d.lerp(H,D,B,F);C&&d.equals(C,H)||this._set("renderLocation",H);return x.Yield}_calculateScreenHorizontalEdgeOnSurface(C){const D=this.state.contentCamera;var F=D.getRenderCenter(k.createRenderScreenPointArray3());F[1]=D.aboveGround?D.padding[n.PaddingSide.BOTTOM]:D.fullHeight-D.padding[n.PaddingSide.TOP];if(this.estimateSurfaceIntersectionAtRenderPoint(F,C))return C;const H=this.renderCoordsHelper.getAltitude(this.centerOnSurface.renderLocation);return D.unprojectFromRenderScreen(F,A)&&(d.subtract(A,
A,D.eye),F=d.normalize(A,A),this.renderCoordsHelper.intersectInfiniteManifold(v.wrap(D.eye,F),H,C))?C:this.renderCoordsHelper.setAltitude(C,H,D.eye)}updateRenderLocation(){this._dirty=!0}};b.__decorate([h.property()],a.Focus.prototype,"_dirty",void 0);b.__decorate([h.property({constructOnly:!0})],a.Focus.prototype,"scheduler",void 0);b.__decorate([h.property({constructOnly:!0})],a.Focus.prototype,"centerOnSurface",void 0);b.__decorate([h.property({constructOnly:!0})],a.Focus.prototype,"estimateSurfaceIntersectionAtRenderPoint",
void 0);b.__decorate([h.property()],a.Focus.prototype,"updating",null);b.__decorate([h.property()],a.Focus.prototype,"location",null);b.__decorate([h.property()],a.Focus.prototype,"renderLocation",void 0);b.__decorate([h.property()],a.Focus.prototype,"worldUnitsPerContentPixel",null);a.Focus=b.__decorate([g.subclass("esri.views.3d.support.pointsOfInterest.Focus")],a.Focus);const z=t.create(),A=t.create(),B=t.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/StableSurfaceCenter":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/Error ../../../../core/Logger ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/Point ../../../../geometry/support/aaBoundingRect".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.StableSurfaceCenter=class extends q{get surface(){return this.view.map?.ground}get surfaceView(){return this.view.basemapTerrain}get renderLocation(){if(!this.location)return null;const w=g.create();this.view.renderCoordsHelper.toRenderCoords(this.location,w);return w}constructor(w){super(w);this._updateController=this.location=null}initialize(){this.view.state.isLocal&&(this.addHandles([h.watch(()=>[this.surfaceView?.spatialReference,this.surfaceView?.extent],
()=>this._update()),h.on(()=>this.surface?.layers,"change",()=>this._update())]),this._update())}_update(){this._updateController&&(this._updateController.abort(),this._updateController=null);if(null==this.surfaceView?.extent||null==this.surfaceView.spatialReference)this._set("location",null);else{var w=t.center(this.surfaceView.extent);w=new d({x:w[0],y:w[1],z:0,spatialReference:this.surfaceView.spatialReference});this.surface&&0<this.surface.layers.length?(this._set("location",null),this._updateController=
new AbortController,this.surface.queryElevation(w,{noDataValue:0,signal:this._updateController.signal,cache:this.cache}).then(v=>{this._updateController=null;this._set("location",v.geometry)}).catch(v=>{})):this._set("location",w)}}};b.__decorate([f.property({constructOnly:!0})],a.StableSurfaceCenter.prototype,"view",void 0);b.__decorate([f.property({constructOnly:!0})],a.StableSurfaceCenter.prototype,"cache",void 0);b.__decorate([f.property()],a.StableSurfaceCenter.prototype,"surface",null);b.__decorate([f.property()],
a.StableSurfaceCenter.prototype,"surfaceView",null);b.__decorate([f.property({readOnly:!0})],a.StableSurfaceCenter.prototype,"location",void 0);b.__decorate([f.property({readOnly:!0})],a.StableSurfaceCenter.prototype,"renderLocation",null);a.StableSurfaceCenter=b.__decorate([e.subclass("esri.views.3d.support.pointsOfInterest.StableSurfaceCenter")],a.StableSurfaceCenter);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingRect ../../../support/Scheduler ../../../support/Yield".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.SurfaceGeometryUpdates=class extends q{constructor(n){super(n);this._tileGeometryUpdateExtent=g.empty();this._tileGeometryUpdateSpatialReference=null;this.events=new l;this.updating=!1}initialize(){this.addHandles([this.surface.on("elevation-change",n=>this._tileGeometryChanged(n)),this.scheduler.registerTask(d.TaskPriority.SURFACE_GEOMETRY_UPDATES,this)])}get running(){return this.updating}runTask(){if(!this.updating)return t.Yield;this._tileGeometryUpdateSpatialReference&&
this._centerIntersectsExtent(this._tileGeometryUpdateExtent,this._tileGeometryUpdateSpatialReference)&&this.events.emit("request-update",w);g.empty(this._tileGeometryUpdateExtent);this._set("updating",!1);return t.Yield}_tileGeometryChanged(n){this._tileGeometryUpdateSpatialReference=n.spatialReference;g.expand(this._tileGeometryUpdateExtent,n.extent,this._tileGeometryUpdateExtent);this._set("updating",!0)}_furthestCenterOnSurface(){let n=this.centerOnSurfaces[0];for(let u=1;u<this.centerOnSurfaces.length;u++){const x=
this.centerOnSurfaces[u];x.distance>n.distance&&(n=x)}return n}_centerIntersectsExtent(n,u){const x=this.state.contentCamera.eye,y=r,z=this._furthestCenterOnSurface();this.renderCoordsHelper.fromRenderCoords(x,v,u);this.renderCoordsHelper.fromRenderCoords(z.renderLocation,m,u);v[0]<m[0]?(y[0]=v[0],y[2]=m[0]):(y[0]=m[0],y[2]=v[0]);v[1]<m[1]?(y[1]=v[1],y[3]=m[1]):(y[1]=m[1],y[3]=v[1]);return g.intersects(y,n)}};b.__decorate([p.property({constructOnly:!0})],a.SurfaceGeometryUpdates.prototype,"state",
void 0);b.__decorate([p.property({constructOnly:!0})],a.SurfaceGeometryUpdates.prototype,"centerOnSurfaces",void 0);b.__decorate([p.property({constructOnly:!0})],a.SurfaceGeometryUpdates.prototype,"renderCoordsHelper",void 0);b.__decorate([p.property({constructOnly:!0})],a.SurfaceGeometryUpdates.prototype,"scheduler",void 0);b.__decorate([p.property({constructOnly:!0})],a.SurfaceGeometryUpdates.prototype,"surface",void 0);b.__decorate([p.property({readOnly:!0})],a.SurfaceGeometryUpdates.prototype,
"updating",void 0);a.SurfaceGeometryUpdates=b.__decorate([c.subclass("esri.views.3d.support.pointsOfInterest.SurfaceGeometryUpdates")],a.SurfaceGeometryUpdates);const w={},v=e.create(),m=e.create(),r=g.empty();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TerrainSurface":function(){define("require ../../../chunks/tslib.es6 ../../../Color ../../../core/Accessor ../../../core/arrayUtils ../../../core/CollectionFlattener ../../../core/Evented ../../../core/has ../../../core/Logger ../../../core/mathUtils ../../../core/maybe ../../../core/MemCachePool ../../../core/ObjectPool ../../../core/PooledArray ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../core/support/UpdatingHandles ../../../geometry/ellipsoidUtils ../../../geometry/SpatialReference ../../../geometry/projection/projectors ../../../geometry/projection/projectPointToVector ../../../geometry/projection/projectVectorToVector ../../../geometry/support/aaBoundingRect ../../../geometry/support/frustum ../../../geometry/support/spatialReferenceUtils ../../../chunks/sphere ../../../layers/support/ElevationQueryTileCache ../../../layers/support/layerUtils ../../2d/engine/vectorTiles/VectorTile ../support/debugFlags ../support/ElevationRange ../support/ElevationUpdateEvent ../support/extentUtils ../support/index ../support/updatingProperties ./ElevationBounds ./ElevationData ./ExtentHelper ./interfaces ./LayerClass ./OverlayManager ./PlanarPatch ./RenderOrder ./ScaleRangeQueries ./SphericalPatch ./SplitLimits ./TerrainConst ./TerrainRenderer ./TerrainSurfacePerformanceInfo ./terrainUtils ./Tile ./TilePerLayerInfo ./TileUpdate ./tileUtils ./TilingSchemeLogic ./UpsampleInfo ../webgl-engine/core/shaderLibrary/output/BlendOptions ../webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../webgl-engine/lib/basicInterfaces ../../support/RenderState ../../support/Scheduler ../../support/Yield".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U,Z,ca,ea,da,ia,ka,fa,X,ja,la,na,va,za,ya,Da,ra,xa,Ma,Ga,Pa){function Qa(qa,aa,Ja){for(const Ta of qa)if(Ta.containsPointXY(aa,Ja)){for(qa=Ta;qa&&!qa.renderData;)qa=qa.children[(aa>qa.extentMidX?1:0)+(Ja<qa.extentMidY?2:0)];return V.sampleElevation(aa,Ja,qa?.renderData?.geometryState.samplerData??null)}return null}function Ea(qa,aa){!qa.isLeaf||qa.level<ia.maxTileNeighborLevelDelta||Ua(qa,Ja=>
{aa&&ua(Ja);var Ta=0===Ja.maxLevelDeltaNeighborCount&&0===Ja.unmergableChildCount;Ja.maxLevelDeltaNeighborCount++;if(Ta)for(Ja=Ja.parent;Ja;)if(Ta=0===Ja.maxLevelDeltaNeighborCount&&0===Ja.unmergableChildCount,Ja.unmergableChildCount++,Ta)Ja=Ja.parent;else break})}function ua(qa){if(!qa.hasPendingUpdate(na.TileUpdate.SPLIT)){for(var aa=qa.parent;aa?.resetPendingUpdate(na.TileUpdate.MERGE);)aa=aa.parent;qa.resetPendingUpdate(na.TileUpdate.MERGE);qa.isLeaf&&qa.setPendingUpdate(na.TileUpdate.SPLIT);
qa.level<ia.maxTileNeighborLevelDelta||Ua(qa,Ja=>{ua(Ja)})}}function Na(qa){qa.level<ia.maxTileNeighborLevelDelta||Ua(qa,aa=>{aa.maxLevelDeltaNeighborCount--;if(0===aa.maxLevelDeltaNeighborCount&&0===aa.unmergableChildCount)for(aa=aa.parent;aa;)if(aa.unmergableChildCount--,0===aa.maxLevelDeltaNeighborCount&&0===aa.unmergableChildCount)aa=aa.parent;else break})}function Ua(qa,aa){if(!(qa.level<ia.maxTileNeighborLevelDelta)){var Ja=qa.level-ia.maxTileNeighborLevelDelta,Ta=qa.lij[1]>>ia.maxTileNeighborLevelDelta,
Ra=qa.lij[2]>>ia.maxTileNeighborLevelDelta,$a=bb=>bb.isLeaf||bb.level===Ja;for(let bb=0;4>bb;++bb){const pa=qa.findNeighborTile(X.neighborEdgeIndices[bb],$a);if(!pa||pa.level!==Ja)continue;const Ba=pa.lij;Ba[1]===Ta&&Ba[2]===Ra||aa(pa)}}}var wa;l=wa=class extends h.EventedMixin(l){constructor(qa){super(qa);this._scaleRangeQueries=new ca.ScaleRangeQueries;this._iteratorPool=new t(va.IteratorPreorder,aa=>aa.remove=()=>this._iteratorPool.release(aa));this._postorderIterator=new va.IteratorPostorder;
this._hasPendingUpdates=!1;this._asyncWorkItems=this._pendingUpdates=0;this._allTilesSorted=this._allTilesDirty=!0;this._usedMemory=null;this._performanceInfo=new fa;this._viewChanged=!1;this.heading=0;this._viewChangeUpdateDirty=this._inFrameTask=!1;this._eyePosRenderSR=z.create();this._eyePosSurfaceSR=z.create();this._splitLimits=new da.SplitLimits;this._frustum=E.create();this._viewProjectionMatrix=x.create();this._layerViews=[[],[]];this._layerIndexByUid=[new Map,new Map];this._basemapLayerViewHandles=
new Map;this._watchUpdatingTracking=new A.UpdatingHandles;this._frameTask=Ga.ImmediateTask;this._allTiles=new w;this._upsampleInfoPool=new t(ya.UpsampleInfo);this._shouldEmitChangeEvent=!1;this._rootTilesExtent=N.create();this.updatingProgress=.5;this._maxNumUpdating=1;this.maxTextureScale=1.2;this._spatialReference=C.WebMercator;this._elevationProjectorCache=new Map;this.visibleElevationBounds=new S.ElevationBounds(Infinity,-Infinity);this.rootTileElevationBounds=new S.ElevationBounds(Infinity,-Infinity);
this._sebProjectorMap=new Map;this._sebProjectorCache=D.createEmptyProjectorCache();this._tilingSchemeSpatialReference=null;this._updatingRootTiles=!1;this._pendingTilesForElevationUpdateEvent=new Set;this._pendingTilesToUpdate=new Set;this.totalTileUpdates=this.totalGeometryUpdates=0;this._oneBatchPerFrameTask=!0;this._layerViewsDirty=!1;this.unloadedMemory=0;this._isWebMercatorOnPlateCarree=this._isWebMercator=this.ignoresMemoryFactor=!1;this.overlayManager=new ba.OverlayManager({...qa,surface:this});
this._isGlobal=!qa.view?.state?.isLocal;this._isGeographic=this._spatialReference?.isGeographic??!1;this._tileConstructor=this._isGlobal?ea.SphericalPatch:U.PlanarPatch}initialize(){const qa=this.view,aa=qa.resourceController,Ja=aa.memoryController;this._tileCache=new d.MemCachePool((bb,pa)=>Ja.newCache(bb,pa),"terrain-tile");this._upsampleMapCache=Ja.newCache("terrain-upsample",bb=>bb.unloadMapData());this._elevationQueryCache=new O.ElevationQueryTileCache(Ja.newCache("elevation-query"));const Ta=
this.overlayManager;this._renderer=new ka.TerrainRenderer(Ta.renderer,qa._stage,this._allTiles,B.getReferenceEllipsoid(qa.spatialReference).radius,Ja);this.addHandles([m.watch(()=>Ta.renderer.isEmpty,()=>this._evaluateTransparency()),m.watch(()=>this.renderer.visible,bb=>this.suspended=!bb),m.watch(()=>this.heading,bb=>{this._renderer.updateHeading(bb);this._updateTileTextures(Y.TextureUpdate.FADING)}),m.watch(()=>({heading:qa.camera?.heading,state:qa.state?.mode}),({heading:bb,state:pa})=>{if(null!=
bb)if(this.isGlobal&&this.isGeographic||this.isWebMercatorOnPlateCarree)this.heading=90*Math.round(bb/90)%360;else{bb=Math.round(bb)%360;var Ba=Math.abs(bb-this.heading);if(pa===Ma.RenderState.IDLE||30<=Math.min(Ba,360-Ba))this.heading=bb}})],"overlayManager");this.addHandles([m.watch(()=>this.baseOpacity,()=>{this._handleLayerViewChanges();this._updateTileTextures(this._evaluateTransparency()?Y.TextureUpdate.UNFADED:Y.TextureUpdate.IMMEDIATE)},m.syncAndInitial),m.watch(()=>this.hasCompositeBlendMode,
()=>this._updateTileTextures(this._evaluateTransparency()?Y.TextureUpdate.UNFADED:Y.TextureUpdate.IMMEDIATE),m.syncAndInitial),m.watch(()=>this.backgroundColor,(bb,pa)=>{bb?.equals(pa)||(this._handleLayerViewChanges(),this._renderer.updateTileBackground(bb))},m.sync),m.watch(()=>this.snapLevel,()=>this._viewChanged=!0,m.sync),m.watch(()=>this.view.pointsOfInterest,bb=>{this._renderer.pointsOfInterest=bb;this._watchUpdatingTracking.removeAll();bb&&this._watchUpdatingTracking.add(()=>bb.focus.renderLocation,
()=>this._allTilesSorted=!1)}),m.watch(()=>M.debugFlags.TERRAIN_TILE_TREE_SHOW_TILES,bb=>{bb&&!this._treeDebugger?(new Promise((pa,Ba)=>a(["../layers/support/TerrainTileTree3DDebugger"],pa,Ba))).then(({TerrainTileTree3DDebugger:pa})=>{!this._treeDebugger&&M.debugFlags.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new pa({view:qa}))}):bb||(this._treeDebugger=g.destroyMaybe(this._treeDebugger))},m.initial)]);var {spatialReference:Ra}=qa;this._extentHelper=T.create(this.viewingMode,{layers:qa.map.allLayers,
layerViews:qa.allLayerViews,viewSpatialReference:Ra});const $a=new k({getCollections:()=>qa.defaultsFromMap?.mapCollections?.map(({layers:bb})=>bb),getChildrenFunction:bb=>bb&&"layers"in bb?bb.layers:null});Ra=new za.TilingSchemeLogic({layers:$a,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:Ra});this._set("tilingSchemeLogic",Ra);this._updateTilingScheme();this._elevationDataRequester=aa.createStreamDataRequester(Q.ClientType.ELEVATION);this._mapDataRequester=aa.createStreamDataRequester(Q.ClientType.BASEMAP);
this._frameTask=aa.scheduler.registerTask(Ga.TaskPriority.TERRAIN_SURFACE,this);this.addHandles([m.watch(()=>this._extentHelper.stencilEnabledExtents,bb=>this._renderer.setStencilEnabledLayerExtents(bb),m.initial),m.watch(()=>this.tilingSchemeLogic.tilingScheme,()=>this._updateTilingScheme(),m.sync),m.watch(()=>this.extent,()=>this._updateRootTiles(),m.initial),qa.on("resize",()=>this._viewChangeUpdate()),m.watch(()=>{const bb=qa.state;return[this._lodBias,this.lodSnapping,qa.quality,bb.camera,bb.contentCamera,
bb.fixedContentCamera]},()=>this._viewChangeUpdate(),m.syncAndInitial),m.watch(()=>qa.qualitySettings?.fadeDuration,bb=>this._renderer.textureFadingEnabled=0<bb,m.initial),m.watch(()=>qa.qualitySettings?.physicallyBasedRenderingEnabled,bb=>this._renderer.pbrMode=bb?ra.PBRMode.Simplified:ra.PBRMode.Disabled,m.initial),m.watch(()=>qa.qualitySettings?.tiledSurface.elevationLevelDelta,()=>this._updateAllTileGeometries()),m.watch(()=>this._userClippingExtent,()=>this._updateClippingExtent(),m.sync)]);
this.addHandles(qa.allLayerViews.on("after-changes",()=>this._layerViewsDirty=!0));this._layerViewsDirty=!0;this._handleLayerViewChanges();this._renderer.updateTileBackground(this.backgroundColor)}destroy(){this._frameTask.remove();this._watchUpdatingTracking.destroy();this._removeAllTiles();this._set("tilingSchemeLogic",g.destroyMaybe(this.tilingSchemeLogic));this._basemapLayerViewHandles.forEach((qa,aa)=>this._unregisterTiledLayerView(aa));this._mapDataRequester=this._elevationDataRequester=null;
this._set("overlayManager",g.destroyMaybe(this.overlayManager));this._tileCache=g.destroyMaybe(this._tileCache);ja.Tile.prune();this._treeDebugger=g.destroyMaybe(this._treeDebugger);this._renderer=g.destroyMaybe(this._renderer);this._iteratorPool=g.destroyMaybe(this._iteratorPool);this._upsampleMapCache=g.destroyMaybe(this._upsampleMapCache);this._elevationQueryCache=g.destroyMaybe(this._elevationQueryCache);this._set("view",null);this._extentHelper=g.destroyMaybe(this._extentHelper);this._upsampleInfoPool=
g.destroyMaybe(this._upsampleInfoPool);P.printAllocations();la.printAllocations()}get renderer(){return this._renderer}get frustum(){return this._frustum}get snapLevel(){if(this.lodSnapping===Y.LODSnapping.ON){var qa=this.view,aa=this.tilingScheme;const Ja=qa.terrainScale;if(aa&&Ja)return qa=aa.levelAtScale(Ja)+qa.qualitySettings.tiledSurface.lodBias,aa=aa.getMaxLod(),Math.min(qa,aa||Infinity)}return null}get lodSnapping(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences?Y.LODSnapping.ON:
Y.LODSnapping.OFF}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get _userClippingExtent(){var {spatialReference:qa}=this,{clippingArea:aa}=this.view;if(null==aa||null==qa)return null;const Ja=N.create();qa=R.toBoundingRect(aa,Ja,qa)?Ja:null;aa=this._get("extent");return N.equals(qa,aa)?aa:qa}get rootTilesExtent(){return this._rootTilesExtent}get extent(){const qa=N.intersection(this.groundExtent,
this._userClippingExtent,N.create()),aa=this._get("extent");return N.equals(qa,aa)?aa:qa}get groundExtent(){return null!=this._tilingSchemeExtent?this._tilingSchemeExtent:this._rootTilesExtent}get _tilingSchemeExtent(){return this.tilingSchemeLogic?.extent}get updating(){this._hasPendingUpdates||(this._maxNumUpdating=1);return!!((this.running||this._watchUpdatingTracking?.updating||0<this._asyncWorkItems)&&this.ready&&!this.suspended||this.overlayManager?.updating)}get running(){return(this._hasPendingUpdates||
this._viewChanged||this._allTilesDirty||!this._allTilesSorted||this._layerViewsDirty||this._scaleRangeQueries.updating||this._frameTask.updating)&&this.ready&&!this.suspended}get updatingProgressValue(){this._maxNumUpdating=Math.max(this._pendingUpdates,this._maxNumUpdating);return 1-this._pendingUpdates/this._maxNumUpdating}get baseOpacity(){return this.view?.map?.ground?.opacity??1}set baseOpacity(qa){this.view.map.ground.opacity=qa}get viewingMode(){return this.view.state.viewingMode}get ready(){return null!=
this._rootTiles}set renderOrder(qa){this._renderer.renderOrder=qa;this._set("renderOrder",qa)}get rootTiles(){return this._rootTiles}get spatialReference(){return this.tilingScheme?.spatialReference??null}get backgroundColor(){return this.view?.map?.ground?.surfaceColor}set backgroundColor(qa){this.view.map.ground.surfaceColor=qa}set slicePlaneEnabled(qa){this._renderer.slicePlaneEnabled=qa;this._set("slicePlaneEnabled",qa);this._evaluateTransparency()}get tilingSchemeLocked(){return this.tilingSchemeLogic?.tilingSchemeLocked??
!1}get wireframe(){return this._renderer?.wireframe}set wireframe(qa){qa!==this._renderer.wireframe&&(this._renderer.wireframe=qa,this._updateAllTileGeometries())}get opaque(){return this._renderer.transparency===ka.TransparencyMode.Opaque}set suspended(qa){this._set("suspended",qa);this._viewChangeUpdate()}get fadeDuration(){return this.view.qualitySettings.fadeDuration??0}intersect(qa,aa,Ja,Ta){this._renderer.intersect(qa,aa,Ja,Ta)}getElevationLevelDelta(qa){return 4>qa?3:this.view.qualitySettings.tiledSurface.elevationLevelDelta}getElevation(qa,
aa,Ja,Ta){const Ra=this._rootTiles;if(!Ra?.length||0===Ra[0].layerInfo[ha.LayerClass.ELEVATION].length)return null;let $a=this._elevationProjectorCache.get(Ta);void 0===$a&&($a=D.getProjector(Ta,this._spatialReference)??null,this._elevationProjectorCache.set(Ta,$a));if(null==$a)return c.getLogger(this).error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;qa=y.set(sa,qa,aa,Ja);$a(qa,0,qa,0);return Qa(Ra,qa[0],qa[1])}getElevations(qa,aa,Ja){const Ta=
this._rootTiles;var Ra=Ta?Ta[0].layerInfo[ha.LayerClass.ELEVATION].length:0;if(Ta?.length&&0!==Ra)for(Ra=0;Ra<aa;++Ra){var $a=3*Ra;$a=Qa(Ta,qa[$a],qa[$a+1]);Ja(Ra,$a)}else for(qa=0;qa<aa;++qa)Ja(qa,null)}getScale(qa){if(!this.tilingScheme)return null;if(!F.projectPointToVector(qa,sa,this.spatialReference))return c.getLogger(this).error("TerrainSurface.getScale(): could not project given point to tiling scheme coordinate system"),null;qa=this._rootTiles;if(null!=qa)for(var aa of qa)if(aa?.containsPoint(sa)){for(;aa.children[0]&&
!aa.rendered;){qa=aa.children[0].extent;let Ja=0;sa[0]>qa[2]&&(Ja+=1);sa[1]<qa[1]&&(Ja+=2);aa=aa.children[Ja]}return this._getLodBiasCorrectedScale(aa.level)}return Infinity}_ensureSEBProject(qa){var aa=this._sebProjectorMap.get(qa);if(aa)return aa;aa=D.getProjector(qa,this._tilingSchemeSpatialReference,this._sebProjectorCache)??null;this._sebProjectorMap.set(qa,aa);return aa}getSphereElevationBounds(qa,aa){aa=this._ensureSEBProject(aa);if(null==aa)return c.getLogger(this).error("TerrainSurface.getSphereElevationBounds(): could not project given point to tiling scheme coordinate system"),
null;I.copy(qa,Ha);qa=I.getCenter(Ha);aa(qa,0,qa,0);qa=new K.ElevationRange;var Ja=this._rootTiles;if(null!=Ja){aa=[];for(var Ta of Ja)aa.push(Ta);for(Ta=0;Ta<aa.length;){Ja=aa[Ta];++Ta;if(!N.intersectsSphere(Ja.extent,Ha))continue;const Ra=Ja.children;if(null==Ra[0]||Ja.rendered)qa.expandElevationRangeValues(Ja.elevationBoundsMin,Ja.elevationBoundsMax);else for(const $a of Ra)aa.push($a)}}return qa}getRootElevationBounds(){return new K.ElevationRange(this.rootTileElevationBounds.min,this.rootTileElevationBounds.max)}getSphereScale(qa,
aa){if(!this.tilingScheme)return null;if(!F.projectPointToVector(qa,I.getCenter(Ha),this.spatialReference))return c.getLogger(this).error("TerrainSurface.getSphereScale(): could not project given point to tiling scheme coordinate system"),null;Ha[3]=aa;let Ja=null;const Ta=Ra=>{if(Ra&&N.intersectsSphere(Ra.extent,Ha)){const $a=Ra.children;if($a[0]&&!Ra.rendered)for(const bb of $a)Ta(bb);else Ra=this._getLodBiasCorrectedScale(Ra.level),Ja=null==Ja?Ra:Math.min(Ja,Ra)}};qa=this._rootTiles;if(null!=qa)for(const Ra of qa)Ta(Ra);
return Ja}queryVisibleScaleRange(qa,aa,Ja,Ta){aa=aa?this.tilingScheme.levelAtScale(aa):0;Ja=Ja?this.tilingScheme.levelAtScale(Ja):Infinity;const Ra=this._lodBias;this._scaleRangeQueries.queryVisibleLevelRange(qa,aa+Ra,Ja+Ra,Ta)}_evaluateTransparency(){var qa=this.baseOpacity;const aa=this.overlayManager.renderer.isEmpty;var Ja=this._renderer.transparency;qa=this._allSurfaceLayersTransparent()?aa?ka.TransparencyMode.Empty:ka.TransparencyMode.TransparentWithDraped:1<=qa&&!this.hasCompositeBlendMode&&
!this._renderer.slicePlaneEnabled?ka.TransparencyMode.Opaque:ka.TransparencyMode.Semitransparent;if(Ja=Ja!==qa)this._renderer.transparency=qa,this.view?._stage?.renderer.setParameters({terrainTransparency:this._renderer.transparency});return Ja}_updateTilingScheme(){const qa=this.tilingSchemeLogic.tilingScheme;if(qa!==this.tilingScheme){X.weakAssert(!!qa,"tiling scheme cannot be reset to undefined");this._isGlobal=!this.view?.state?.isLocal;this.tilingScheme&&this._removeAllTiles();var aa=qa?.spatialReference??
C.WebMercator;this._spatialReference=aa;this._isWebMercatorOnPlateCarree=(this._isWebMercator=!!aa?.isWebMercator)&&G.isPlateCarree(this.view?.renderSpatialReference);this._isGeographic=aa?.isGeographic??!1;this._set("tilingScheme",qa);this._tilingSchemeSpatialReference=this.tilingScheme?.spatialReference;this._sebProjectorMap.clear();this._updateClippingExtent();qa&&(this._updateTiledLayers(),this._renderer.setTileSize(qa.pixelSize),this.overlayManager.setSpatialReference(qa.spatialReference),this._updateRootTiles())}}_acquireTile(qa,
aa,Ja,Ta){const Ra=this._tileCache.pop(wa._tileMemcacheKey);return Ra?(Ra.init(qa,aa,Ja,Ta,this),Ra):new this._tileConstructor(qa,aa,Ja,Ta,this)}get updatingRootTiles(){return this._updatingRootTiles}_updateRootTiles(){const {extent:qa,tilingScheme:aa}=this;if(aa){var Ja=Ka,Ta=aa.rootTilesInExtent(qa,Ja,5*ia.maxRootTiles);if(null!=this._rootTiles){if(Ta.length>ia.maxRootTiles){c.getLogger(this).warn(ia.tooManyRootTilesAfterChangeError);return}const Ra=this._rootTiles.map(bb=>bb.lij),$a=p.difference(Ra,
Ta,ja.lijEquals);this._updatingRootTiles=!0;if(0<$a.removed.length||0<$a.added.length){const bb=this._rootTiles.filter(pa=>-1<$a.removed.findIndex(Ba=>ja.lijEquals(Ba,pa.lij))?(this._purgeTile(pa),!1):!0);$a.added.forEach(pa=>bb.push(this._newRootTile(pa)));this._setRootTiles(bb)}}else this._updatingRootTiles=!0,Ta.length>ia.maxRootTiles&&(c.getLogger(this).warn(ia.tooManyRootTilesForLayerError),Ta=aa.rootTilesInExtent(qa,Ja,ia.maxRootTiles)),this._setRootTiles(Ta.map(Ra=>this._newRootTile(Ra)));
N.equals(Ja,this._rootTilesExtent)||(this._rootTilesExtent=N.create(Ja));this.renderer.visible=!0;this._viewChangeUpdate();this.overlayManager.setPlacementDirty();this.notifyChange("ready");this._updateAllTileGeometries();this._updatingRootTiles=!1;this.checkAllTilesWaterproofness()}}_updateAllTileGeometries(){const qa=this._allTiles.filter(aa=>aa.isLoaded&&aa.intersectsClippingArea);qa.sort(va.compareTilesByLij);qa.forEach(aa=>this._renderer.updateTileGeometryState(aa));qa.forEach(aa=>aa.renderData.updateNeighborData());
this._updateTilesGeometries(qa);this._pendingTilesToUpdate.clear()}_updateTilesGeometries(qa){if(0!==qa.length){qa.sort(va.compareTilesByLij);var aa=this.renderer;qa.forEach(Ja=>aa.updateGeometryIfNeeded(Ja));qa.forEach(Ja=>this._pendingTilesForElevationUpdateEvent.add(Ja))}}_shouldSplit(qa){return qa.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.snapLevel)===na.TileUpdate.SPLIT}_newRootTile(qa){qa=this._acquireTile(0,qa[1],qa[2],null);this._shouldSplit(qa)&&qa.setPendingUpdate(na.TileUpdate.SPLIT);
this._loadTile(qa);this._markTileToUpdate(qa);this._updateRootTileElevationBounds();return qa}_setRootTiles(qa){this._rootTiles=qa;this._allTiles.clear();if(null!=qa){const aa=this._iteratorPool.acquire();for(aa.reset(qa);!aa.done;)this._allTiles.push(aa.next());aa.remove()}this._renderer.setRootTiles(this._rootTiles);this._updateTilesVisibility(qa)}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){this.view&&!this.suspended&&
this.tilingScheme&&this.renderer.visible&&(this._inFrameTask?this._viewChangeUpdateDirty=!0:(this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateTilesVisibility(this._rootTiles)))}_updateClippingStatus(qa){qa.updateClippingStatus(this.extent)&&qa.resetPendingUpdate(na.TileUpdate.GEOMETRY)&&this._updateTileGeometryState(qa)}_updateTilesVisibility(qa){if(null!=qa){var aa=va.hasLoadableSiblings(qa),Ja=this.visibleElevationBounds,Ta=aa?Ja.min:Infinity;aa=aa?Ja.max:-Infinity;
var Ra=this.extent,$a=this._viewProjectionMatrix;this.setTileTreeDirty();var bb=this._iteratorPool.acquire();for(bb.reset(qa);!bb.done;)qa=bb.next(),qa.updateClippingStatus(Ra)&&qa.resetPendingUpdate(na.TileUpdate.GEOMETRY)&&this._updateTileGeometryState(qa),qa.computeVisibility(),qa.updateScreenDepth($a),qa.renderData&&(Ta=Math.min(qa.elevationBoundsMin,Ta),aa=Math.max(qa.elevationBoundsMax,aa));bb.remove();this._allTilesDirty=this._viewChanged=!0;this._updatePendingTileGeometries();isFinite(Ta)&&
isFinite(aa)&&(Ja.min!==Ta||Ja.max!==aa)&&(this.visibleElevationBounds=new S.ElevationBounds(Ta,aa))}}_updateRootTileElevationBounds(){let qa=Infinity,aa=-Infinity;var Ja=this._rootTiles;null!=Ja&&Ja.forEach(({elevationBoundsMin:Ta,elevationBoundsMax:Ra})=>{qa=Math.min(qa,Ta);aa=Math.max(aa,Ra)});Ja=this.rootTileElevationBounds;if(Ja.min!==qa||Ja.max!==aa)this.rootTileElevationBounds=new S.ElevationBounds(qa,aa)}_updateViewDependentParameters(){const {camera:qa,contentCamera:aa}=this.view.state,Ja=
Math.tan(.5*aa.fovX),Ta=Math.tan(.5*aa.fovY),Ra=this.tilingScheme.pixelSize,$a=2**-this._lodBias*qa.pixelRatio;this._splitLimits.aboveGround=qa.aboveGround;this._splitLimits.fovX=Ja;this._splitLimits.fovY=Ta;this._splitLimits.relativeWidthLimit=Ra/qa.width*this.maxTextureScale*$a;this._splitLimits.relativeHeightLimit=Ra/qa.height*this.maxTextureScale*$a;this._splitLimits.maxLod=this.tilingScheme.getMaxLod();this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias;this._splitLimits.frustum=
this.view.state.fixedContentCamera?E.copy(this._splitLimits.frustum??E.create(),aa.frustum):null;E.copy(this._frustum,qa.frustum);u.multiply(this._viewProjectionMatrix,aa.projectionMatrix,aa.viewMatrix);y.copy(this._eyePosRenderSR,aa.eye);H.projectVectorToVector(qa.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateTileGeometryState(qa){qa.updateVisibility();this._renderer.updateTileGeometryState(qa)&&this._markTileToUpdate(qa);this._usedMemory=null}_markAllTileNeighborsForUpdate(qa){qa.forEachLoadedNeighbor(aa=>
{this._layerViews[ha.LayerClass.MAP].some(X.isVectorTileLayerView)&&aa.setPendingUpdate(na.TileUpdate.TEXTURE_FADING);this._pendingTilesToUpdate.add(aa)})}_updateTileTexture(qa,aa){const Ja=qa.resetPendingUpdate(na.TileUpdate.TEXTURE_FADING)?na.TileUpdate.TEXTURE_FADING:qa.resetPendingUpdate(na.TileUpdate.TEXTURE_NOFADING)?na.TileUpdate.TEXTURE_NOFADING:!1;Ja&&(this._renderer.updateTileTexture(qa,Ja),this._usedMemory=null,aa.madeProgress())}_emitElevationUpdateEventForTiles(){if(this._shouldEmitChangeEvent){var qa=
Aa.extent;N.empty(qa);this._pendingTilesForElevationUpdateEvent.forEach(aa=>N.expand(qa,aa.extent,qa));this._pendingTilesForElevationUpdateEvent.clear();Aa.spatialReference=this.spatialReference;this.emit("elevation-change",Aa);this._shouldEmitChangeEvent=!1}}runTask(qa){this._handleLayerViewChanges(qa);this._frameTask.processQueue(qa);this.renderer.processScaleRangeQueries(this._scaleRangeQueries,qa);this._inFrameTask=!0;this._pendingUpdates=0;this._hasPendingUpdates=!1;this._updateAllTilesStatus(qa);
this._sortTiles(qa);const aa=!this.view.state.fixedContentCamera;this._mergeAndSplit(qa,aa);this._updateElevation(qa);this._updateTextures(qa);aa||this._mergeAndSplit(qa,!0);this._inFrameTask=!1;this._runViewChangeUpdateIfDirty();this._updatePendingTileGeometries();this._emitElevationUpdateEventForTiles();qa.done&&qa.hasProgressed&&this.requestUpdate();this.notifyChange("updatingProgressValue");X.enableTerrainInternalChecks&&this._checkTileInvariant();if(!qa.hasProgressed)return Pa.Yield}_checkTileInvariant(){const qa=
new Map;this._allTiles.forAll(aa=>qa.set(aa,new Set));this._allTiles.forAll(aa=>{X.weakAssert(aa.rendered===aa.isLeaf,` rendered ${aa.rendered} != ${aa.isLeaf} leaf`);if(!aa.isLeaf){var Ja=aa.children.reduce(($a,bb)=>$a+(0===bb.unmergableChildCount&&0===bb.maxLevelDeltaNeighborCount?0:1),0);X.weakAssert(aa.unmergableChildCount===Ja,` Tile[${aa.lij.toString()}] unmergeable child count mismatch:`+` actual ${aa.unmergableChildCount} vs ${Ja}`);if(aa.hasPendingUpdate(na.TileUpdate.MERGE)){X.weakAssert(!aa.hasPendingUpdate(na.TileUpdate.SPLIT),
"Tile can be both split and merge at the same time");for(var Ta of aa.children)X.weakAssert(Ta.isLeaf||Ta.hasPendingUpdate(na.TileUpdate.MERGE),"Child of tile to merge must also merge")}}for(Ja=0;4>Ja;++Ja){if(aa.rendered&&(Ta=aa.renderData?.geometryState.edgePeerNeighbors[Ja],null!=Ta)){var Ra=aa.level-Ta.level<=ia.maxTileNeighborLevelDelta;Ra||(console.log(`tile level delta [${aa.lij.toString()}] vs [${Ta.lij.toString()}] > ${ia.maxTileNeighborLevelDelta} (edge[${Ja}])`),X.weakAssert(Ra,`tile level delta [${aa.level}] vs [${Ta.level}] > ${ia.maxTileNeighborLevelDelta}`));
X.weakAssert(aa.level-Ta.level<=ia.maxTileNeighborLevelDelta,`Max tile lod delta exceeded: [${aa.lij.toString()}] vs [${Ta.lij.toString()}]`)}Ra=aa.level-ia.maxTileNeighborLevelDelta;Ta=aa.findNeighborTile(X.neighborEdgeIndices[Ja],$a=>$a.isLeaf||$a.level===aa.level);if(null!=Ta){if(aa.isLeaf&&aa.level>=ia.maxTileNeighborLevelDelta){let $a=Ta;for(;aa.level-$a.level<ia.maxTileNeighborLevelDelta;)$a=$a.parent;ja.lijEquals([Ra,aa.lij[1]>>ia.maxTileNeighborLevelDelta,aa.lij[2]>>ia.maxTileNeighborLevelDelta],
$a.lij)||(Ra=qa.get($a),X.weakAssert(!Ra.has(aa),"Cannot already have neighbor"),Ra.add(aa))}X.weakAssert(Ta.rendered||Ta.level===aa.level,"Non-same-level-neighbor of rendered must be rendered");X.weakAssert(aa.level-Ta.level<=ia.maxTileNeighborLevelDelta,`Tile level delta [${aa.level}] vs [${Ta.level}] > ${ia.maxTileNeighborLevelDelta}`)}}});this._allTiles.forAll(aa=>{const Ja=aa.maxLevelDeltaNeighborCount,Ta=qa.get(aa);X.weakAssert(Ja===Ta.size,`Tile[${aa.lij.toString()}] merge-blocker mismatch: actual ${Ja} vs ${Ta.size}`)})}_updateAllTilesStatus(qa){if(this._viewChanged&&
this._rootTiles&&!qa.done){this._viewChanged=!1;var aa=new Ya(this._allTiles.length);aa.pushAll(this._rootTiles);var Ja=this.snapLevel,Ta=this._splitLimits,Ra=this._eyePosRenderSR;this._allTiles.forAll(pa=>{pa.maxLevelDeltaNeighborCount=0;pa.unmergableChildCount=0});for(var $a=this._viewProjectionMatrix;!aa.empty;){const pa=aa.pop();var bb=pa.parent;const Ba=(bb=null!=bb&&bb.hasPendingUpdate(na.TileUpdate.MERGE))?na.TileUpdate.MERGE:pa.shouldSplit(Ta,Ra,Ja),Ia=Ba===na.TileUpdate.SPLIT;pa.isLeaf?Ea(pa,
Ia):aa.pushAll(pa.children);bb?(pa.resetPendingUpdate(na.TileUpdate.SPLIT),pa.isLeaf||pa.setPendingUpdate(na.TileUpdate.MERGE),this._updateClippingStatus(pa),pa.updateVisibility(),pa.updateScreenDepth($a)):Ia?(pa.resetPendingUpdate(na.TileUpdate.MERGE),pa.isLeaf&&pa.setPendingUpdate(na.TileUpdate.SPLIT)):(pa.resetPendingUpdate(na.TileUpdate.SPLIT)&&pa.updateAgentSuspension(),Ba===na.TileUpdate.ELEVATION&&pa.updateAgents(ha.LayerClass.ELEVATION),pa.isLeaf||(pa.setPendingUpdate(na.TileUpdate.MERGE),
pa.resetPendingUpdate(na.TileUpdate.SPLIT)))}this.requestUpdate();!this._shortBatches&&this._oneBatchPerFrameTask||this._updatePendingTileGeometries();qa.madeProgress()}}_sortTiles(qa){qa.done||this._allTilesSorted||(va.sortTilesByPOI(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger&&this._treeDebugger.update(),qa.madeProgress())}_markTileToUpdate(qa){X.internalAssert(qa.isLoaded);qa.intersectsClippingArea&&(this._pendingTilesToUpdate.add(qa),
this._markAllTileNeighborsForUpdate(qa))}_updatePendingTileGeometries(){const qa=this._pendingTilesToUpdate,aa=Array.from(qa.keys()).filter(Ra=>Ra.isLoaded&&Ra.intersectsClippingArea);if(0===aa.length)qa.clear();else{var Ja=(Ra,$a)=>{!$a?.isLoaded||!$a.intersectsClippingArea||$a.level<Ra.level||qa.has($a)||(qa.add($a),aa.push($a),$a.renderData.updateNeighborData())};aa.sort(va.compareTilesByLij);var Ta=aa.length;for(let Ra=0;Ra<Ta;++Ra){const $a=aa[Ra];X.internalAssert($a.isLoaded);X.internalAssert($a.intersectsClippingArea);
const bb=$a.renderData;bb.updateNeighborData();const pa=bb.dirtyEdgeResolutions,Ba=bb.geometryState,Ia=Wa=>{const gb=X.neighborCornerIndices[Wa];Ja($a,Ba.cornerPeerNeighbors[Wa]?.findCorner(X.oppositeCorner(gb),ib=>ib.isLoaded))};for(let Wa=0;4>Wa;++Wa)if(pa&1<<Wa){const gb=bb.geometryState.edgePeerNeighbors[Wa];gb&&gb?.level>=$a.level&&gb.forAllSubtreeOnSide(X.oppositeEdge(X.neighborEdgeIndices[Wa]),ib=>ib.isLoaded&&ib.intersectsClippingArea?(X.internalAssert(qa.has(ib)||0>va.compareTilesByLij($a,
ib)),Ja($a,ib),!0):!1);Ia((Wa+1)%4);Ia(Wa)}}qa.clear();this._updateTilesGeometries(aa);this._shouldEmitChangeEvent=!0;X.enableTerrainInternalChecks&&X.enableWaterproofTests&&this.checkAllTilesWaterproofness()}}_mergeAndSplit(qa,aa){if(!this.suspended&&!qa.done&&this._allTilesDirty){this._allTilesDirty=!1;this.requestUpdate();for(var Ja=!1,Ta=this.view.state.fixedContentCamera,Ra=!1;!qa.done;){Ra=!0;let $a=!1;const bb=!this._allTiles.some(pa=>{if(!Ja&&!Ta&&!pa.visible)return qa.done;var Ba=pa;if(pa.hasPendingUpdate(na.TileUpdate.MERGE)){if(!aa||
0<pa.unmergableChildCount)return qa.done;for(pa.resetPendingUpdate(na.TileUpdate.MERGE);null!=Ba.parent&&0===Ba.parent.unmergableChildCount&&Ba.parent.resetPendingUpdate(na.TileUpdate.MERGE);)Ba=Ba.parent;this._mergeTile(Ba);$a=!0;qa.madeProgress()}else if(pa.resetPendingUpdate(na.TileUpdate.SPLIT)){Ba=!0;const Ia=pa.level;if(Ia>=ia.maxTileNeighborLevelDelta){const Wa=gb=>gb.isLeaf||Ia-gb.level<ia.maxTileNeighborLevelDelta;for(let gb=0;4>gb;++gb){const ib=pa.findNeighborTile(X.neighborEdgeIndices[gb],
Wa);null!=ib&&Ia-ib.level===ia.maxTileNeighborLevelDelta&&(Ba=!1,X.enableTerrainInternalChecks&&(X.internalAssert(ib.isLeaf),X.internalAssert(ib.hasPendingUpdate(na.TileUpdate.SPLIT))))}}Ba?(this._splitTile(pa),qa.madeProgress(),$a=!0):pa.setPendingUpdate(na.TileUpdate.SPLIT)}return qa.done});$a&&(this._allTilesSorted=!1,this._allTilesDirty=!0,!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries());if(bb)if(!Ja)Ja=!0;else{if(!$a)break}else this._allTilesDirty=!0}Ra?qa.madeProgress():this._allTilesDirty=
!0;!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries();this._sortTiles(qa)}}_updateElevation(qa){qa.done||(this._allTiles.some(aa=>{aa.resetPendingUpdate(na.TileUpdate.GEOMETRY)&&(this._updateTileGeometryState(aa),this._shortBatches&&this._updatePendingTileGeometries(),qa.madeProgress());return qa.done}),!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries())}_updateTextures(qa){qa.done||this._allTiles.some(aa=>{this._updateTileTexture(aa,qa);return qa.done})}_updateClippingExtent(){this.spatialReference&&
(this.updateTileOverlayParams(xa.RenderRequestType.UPDATE),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get _lodBias(){return this.view.qualitySettings.tiledSurface.lodBias-(1-this.view.quality)*ia.maxMemoryLodBias}_getLodBiasCorrectedScale(qa){const aa=this.tilingScheme.levels;qa=e.clamp(qa-this._lodBias,0,aa.length-1);const Ja=qa-Math.floor(qa);return aa[Math.floor(qa)].scale*(1-Ja)+aa[Math.ceil(qa)].scale*Ja}_removeAllTiles(){null!=this._rootTiles&&(this._rootTiles.forEach(qa=>
this._purgeTile(qa)),this._setRootTiles(null),this.notifyChange("ready"));this._allTiles.clear();this.renderer.visible=!1}_purgeDescendantTiles(qa){if(qa.children[0]){var aa=qa.children.slice();qa.unsetChildren();for(qa=0;4>qa;++qa)this._purgeTile(aa[qa])}}_purgeTile(qa){qa.isLeaf?Na(qa):this._purgeDescendantTiles(qa);this._allTiles.removeUnordered(qa);this._unloadTile(qa);this._tileCache.put(wa._tileMemcacheKey,qa)}_unloadTile(qa){this._pendingTilesToUpdate.delete(qa);this._pendingTilesForElevationUpdateEvent.delete(qa);
qa.unload(this._renderer)}_splitTile(qa){X.weakAssert(qa.isLeaf,"Tile that is already split should not be split again!");X.weakAssert(qa.rendered,"Tile marked to split is not rendered");Na(qa);var aa=qa.level+1;const Ja=2*qa.lij[1],Ta=2*qa.lij[2];aa=qa.setChildren(this._createTile(aa,Ja,Ta,qa),this._createTile(aa,Ja,Ta+1,qa),this._createTile(aa,Ja+1,Ta,qa),this._createTile(aa,Ja+1,Ta+1,qa));this._allTiles.pushArray(aa);qa.updateAgentSuspension();X.weakAssert(qa.rendered,"parent should be rendered");
this._unloadTile(qa);aa.forEach(Ra=>this._loadTile(Ra));aa.forEach(Ra=>this._pendingTilesToUpdate.add(Ra));this._markAllTileNeighborsForUpdate(qa);this._emitTileScaleChange(qa,qa.level+1);this._allTilesDirty=!0;this._shortBatches&&this._updatePendingTileGeometries();aa.forEach(Ra=>Ea(Ra,Ra.hasPendingUpdate(na.TileUpdate.SPLIT)));++this._performanceInfo.numSplit}_emitTileScaleChange(qa,aa=qa.level){Sa.spatialReference=this.spatialReference;Sa.extent=qa.extent;Sa.scale=this._getLodBiasCorrectedScale(aa);
this.emit("scale-change",Sa)}_createTile(qa,aa,Ja,Ta){X.weakAssert(!!Ta,"_createTile sanity check");qa=this._acquireTile(qa,aa,Ja,Ta);qa.updateClippingStatus(this.extent);qa.updateScreenDepth(this._viewProjectionMatrix);this._shouldSplit(qa)&&qa.setPendingUpdate(na.TileUpdate.SPLIT);return qa}get _shortBatches(){return this.view.state.mode!==Ma.RenderState.IDLE}_mergeTile(qa){X.weakAssert(!qa.hasPendingUpdate(na.TileUpdate.SPLIT),"_mergeTile sanity check");X.weakAssert(!qa.isLeaf,"Cannot merge a leaf");
qa.isLeaf||(this._purgeDescendantTiles(qa),X.weakAssert(!qa.renderData,"_mergeTile sanity check"),this._loadTile(qa),this._markTileToUpdate(qa),this._emitTileScaleChange(qa),this._shortBatches&&this._updatePendingTileGeometries(),Ea(qa,!1),this._allTilesDirty=!0,++this._performanceInfo.numMerged)}_loadTile(qa){qa.load();this.requestUpdate();this._allTilesDirty=!0;this.overlayManager&&this.overlayManager.hasOverlays&&this.overlayManager.setTileParameters(qa)}_handleLayerViewChanges(qa=Ga.noBudget){if(this._layerViewsDirty){var aa=
this._layerViewsDirty=!1,Ja=new Set,Ta=-1;for(let $a=this.view.allLayerViews.length-1;0<=$a;$a--){var Ra=this.view.allLayerViews.items[$a];Ja.add(Ra.uid);if(X.isSurfaceLayerView(Ra)||X.isGroupLayerView(Ra))if(this._basemapLayerViewHandles.has(Ra.uid)&&!X.isGroupLayerView(Ra)){const bb=this._layerClassFromLayerView(Ra);Ra=this._getLayerIdxByUID(bb,Ra.uid);if(null!=Ra){if(Ra<Ta||null==Ta)aa=!0;Ta=Ra}}else this._registerTiledLayerView(Ra),Ra.layer.loaded&&(aa=!0)}this._basemapLayerViewHandles.forEach(($a,
bb)=>{Ja.has(bb)||(this._unregisterTiledLayerView(bb),aa=!0)});aa&&this._updateTiledLayers();this.hasCompositeBlendMode=this._hasCompositeBlendMode();this._evaluateTransparency();qa.madeProgress()}}_allSurfaceLayersTransparent(){let qa=0===this.view.map?.ground?.opacity;for(const aa of this.view.allLayerViews.items)if(X.isMapTileLayerView(aa)&&!L.isBaseLayer(aa.layer)&&0!==aa.fullOpacity){qa=!1;break}return qa}_hasCompositeBlendMode(){for(const qa of this.view.allLayerViews.items)if((X.isBlendableLayerView(qa)||
X.isGroupLayerView(qa))&&Da.isCompositeBlendMode(Da.blendModeFromString[qa.layer.blendMode]))return!0;return!1}_layerClassFromLayerView(qa){return X.isElevationLayerView(qa)?ha.LayerClass.ELEVATION:ha.LayerClass.MAP}_registerTiledLayerView(qa){const aa=[];(X.isBlendableLayerView(qa)||X.isGroupLayerView(qa))&&aa.push(m.watch(()=>qa.layer.blendMode,()=>{this.hasCompositeBlendMode=this._hasCompositeBlendMode();this._updateTileTextures(Y.TextureUpdate.UNFADED)}));if(!X.isGroupLayerView(qa)){const Ja=
this._layerClassFromLayerView(qa);aa.push(m.watch(()=>qa.suspended,()=>this._updateTiledLayers()));aa.push(m.watch(()=>qa.fullOpacity,()=>this._updateTileTextures(Y.TextureUpdate.UNFADED)));aa.push(m.watch(()=>"effectiveScaleRange"in qa.layer?qa.layer.effectiveScaleRange:null,()=>this._restartAllAgents(Ja)));aa.push(qa.on("data-changed",()=>{const Ta=this._getLayerIdxByUID(Ja,qa.uid);null!=Ta&&this._invalidateLayerData(Ta,Ja)}))}this._unregisterTiledLayerView(qa.uid);this._basemapLayerViewHandles.set(qa.uid,
aa)}_unregisterTiledLayerView(qa){const aa=this._basemapLayerViewHandles.get(qa);if(aa){for(const Ja of aa)Ja.remove();this._basemapLayerViewHandles.delete(qa)}}_updateTiledLayers(){if(this.tilingScheme&&!this.view.suspended){var qa=[[],[]],aa=null;this.view.allLayerViews.forEach(Ta=>{if(Ta.layer&&!Ta.suspended&&X.isSurfaceLayerView(Ta)&&Ta.fullExtent){var Ra=this._layerClassFromLayerView(Ta);if(Ra===ha.LayerClass.MAP){const $a=Ta.displayLevelRange.maxLevel;Infinity!==$a&&(null===aa||$a>aa)&&(aa=
$a)}qa[Ra].push(Ta)}});for(const Ta of ha.LayerClasses){var Ja=this._layerViews[Ta];const Ra=qa[Ta];Ra.reverse();const $a=Ra.length;let bb=Ja.length!==$a;const pa=Array($a),Ba=Array(Ja.length);this._layerIndexByUid[Ta].clear();for(let Ia=0;Ia<$a;Ia++){this._layerIndexByUid[Ta].set(Ra[Ia].uid,Ia);const Wa=Ja.indexOf(Ra[Ia]);pa[Ia]=Wa;Ia!==Wa&&(bb=!0);-1<Wa&&(Ba[Wa]=Ia)}if(bb){Ja=this._postorderIterator;for(Ja.reset(this._rootTiles);!Ja.done;)Ja.next().modifyLayers(Ba,pa,Ta);this._layerViews[Ta]=Ra;
this._restartAllAgents(Ta);this._updateTilesVisibility(this._rootTiles)}}this.tilingScheme.ensureMaxLod(aa)&&(this._viewChangeUpdate(),this.notifyChange("tilingScheme"))}}_restartAllAgents(qa){const aa=this._postorderIterator;for(aa.reset(this._rootTiles);!aa.done;){const Ja=aa.next();Ja.restartAgents(qa);qa===ha.LayerClass.ELEVATION&&Ja.computeElevationBounds()}this._updateRootTileElevationBounds()}layerViewByIndex(qa,aa){return this._layerViews[aa][qa]}numLayers(qa){return this._layerViews[qa].length}_updateTileTextures(qa){this._allTiles.forAll(aa=>
{aa.updateAgents(ha.LayerClass.MAP);qa===Y.TextureUpdate.IMMEDIATE?this.renderer.updateTileTexture(aa,na.TileUpdate.TEXTURE_NOFADING):aa.updateRenderData(ha.LayerClass.MAP,qa)});this._evaluateTransparency()}_invalidateLayerData(qa,aa){this._allTiles.forAll(Ja=>Ja.removeLayerAgent(qa,aa));this._allTiles.forAll(Ja=>Ja.invalidateLayerData(qa,aa))}setTileTreeDirty(){this._allTilesDirty=!0}requestRender(qa=xa.RenderRequestType.UPDATE){this.renderer.setNeedsRender(qa)}requestUpdate(){1===++this._pendingUpdates&&
(this._hasPendingUpdates=!0)}requestTileData(qa,aa,Ja,Ta){const Ra=this.layerViewByIndex(aa,Ja);aa=Ra.layer;if(!aa.tilemapCache||X.isVectorTileLayerView(Ra))return this._requestTileData(qa,Ja,Ra,Ta);++this._asyncWorkItems;return aa.tilemapCache.fetchAvailability(qa.lij[0],qa.lij[1],qa.lij[2],{...Ta,timeout:6E3}).then(()=>--this._asyncWorkItems).catch($a=>{--this._asyncWorkItems;v.throwIfAborted(Ta);v.isAbortError($a)||this._dataMissing(qa,Ja,Ra);throw $a;}).then(()=>this._frameTask.schedule(()=>this._requestTileData(qa,
Ja,Ra,Ta),Ta.signal))}_requestTileData(qa,aa,Ja,Ta){aa=aa===ha.LayerClass.ELEVATION;Ta.requester??(Ta.requester=aa?this._elevationDataRequester:this._mapDataRequester);return aa?X.isElevationLayerView(Ja)?this._requestElevationTileData(qa,Ja,Ta):Promise.reject():X.isMapTileLayerView(Ja)?this._requestMapTileData(qa,Ja,Ta):Promise.reject()}_requestElevationTileData(qa,aa,Ja){++this._asyncWorkItems;const Ta=Ra=>{!v.isAborted(Ja)&&Ra&&(this._usedMemory=null,this.requestUpdate(),this._elevationDataArrived(qa,
aa,Ra))};return aa.fetchTile(qa.lij,Ja).then(Ra=>this._frameTask.schedule(()=>Ta(Ra)),Ra=>{v.isAbortError(Ra)||(c.getLogger(this).error(`Tile ${qa.lij.toString()} layer ${ha.LayerClass.ELEVATION}/${aa.uid} error ${Ra}`),this._dataMissing(qa,ha.LayerClass.ELEVATION,aa),this.requestUpdate())}).finally(()=>--this._asyncWorkItems)}_elevationDataArrived(qa,aa,Ja){aa=this._layerIndexByUid[ha.LayerClass.ELEVATION].get(aa.uid);if(null==aa)c.getLogger(this).warn("TerrainSurface: received data from unknown layer %d %s",
ha.LayerClass.ELEVATION,qa.lij.toString());else{Ja=new V.ElevationData(qa.lij,qa.extent,Ja);qa.dataArrived(aa,ha.LayerClass.ELEVATION,Ja);Ja=[qa];qa=qa.level;var Ta=this._iteratorPool.acquire();for(Ta.reset(Ja);!Ta.done;){const Ra=Ta.next();Ra.findElevationBoundsForLayer(aa,qa);Ra.computeElevationBounds()}0===qa&&this._updateRootTileElevationBounds();Ta.remove();this._updateTilesVisibility(Ja)}}_requestMapTileData(qa,aa,Ja){++this._asyncWorkItems;const Ta=($a,bb)=>{X.releaseTerrainData(bb);v.isAborted(Ja)||
(console.error(`Tile ${qa.lij.toString()} layer ${ha.LayerClass.MAP}/${aa.uid} error ${$a}`),this._dataMissing(qa,ha.LayerClass.MAP,aa),this.requestUpdate())},Ra=$a=>bb=>Ta(bb,$a);return aa.fetchTile(qa.lij,Ja).then($a=>this._frameTask.schedule(()=>{this.requestUpdate();v.isAborted(Ja)?X.releaseTerrainData($a):this._mapTileDataArrived(qa,aa,$a)},Ja.signal,Ra($a)).catch(Ra($a)),($a,bb=null)=>this._frameTask.schedule(()=>Ta($a,bb))).finally(()=>--this._asyncWorkItems)}_mapTileDataArrived(qa,aa,Ja){aa=
this._getLayerIdxByUID(ha.LayerClass.MAP,aa.uid);null==aa?(X.releaseTerrainData(Ja),c.getLogger(this).warn("TerrainSurface: received data from unknown layer")):qa.dataArrived(aa,ha.LayerClass.MAP,Ja)}_getLayerIdxByUID(qa,aa){return this._layerIndexByUid[qa].get(aa)}_dataMissing(qa,aa,Ja){Ja=this._getLayerIdxByUID(aa,Ja.uid);null!=Ja?qa.dataMissing(Ja,aa):c.getLogger(this).warn("TerrainSurface: received data from unknown layer")}updateTileOverlayParams(qa){this._rootTiles&&this.overlayManager&&(this._allTiles.forAll(aa=>
{aa.renderData&&this.overlayManager.setTileParameters(aa)}),this._renderer.setNeedsRender(qa))}get performanceInfo(){const qa=this._performanceInfo;qa.numNodes=this._allTiles.length;qa.numLeaves=qa.numVisible=qa.numRendered=qa.numLoadedPerLevel.length=qa.numRenderedPerLevel.length=0;this._allTiles.forAll(aa=>{aa.isLeaf&&qa.numLeaves++;const Ja=aa.level;aa.renderData&&(qa.numLoadedPerLevel[Ja]=(qa.numLoadedPerLevel[Ja]||0)+1);aa.visible&&(qa.numVisible++,aa.rendered&&(qa.numRenderedPerLevel[Ja]=(qa.numRenderedPerLevel[Ja]||
0)+1,qa.numRendered++))});return qa}get usedMemory(){if(!this.tilingScheme)return 0;null==this._usedMemory&&(this._usedMemory=this._recalculateUsedMemory());return this._usedMemory??0}_recalculateUsedMemory(){return this.tilingScheme?Math.round(this._allTiles.reduce((qa,aa)=>qa+aa.usedMemory,0)):null}getUsedMemoryForLayerView(qa){let aa=0;const Ja=this._layerClassFromLayerView(qa),Ta=this._getLayerIdxByUID(Ja,qa.uid);null!=Ta&&this._allTiles.forAll(Ra=>aa+=Ra.getUsedMemoryForLayer(Ja,Ta));return aa}getTile(qa){if(null==
qa||null==this._rootTiles)return null;const aa=qa.split("/").map($a=>+$a);if(0===aa[0])return this._rootTiles.find($a=>$a.lij[1]===aa[1]&&$a.lij[2]===aa[2]);qa=aa[0];const Ja=aa[1]>>qa,Ta=aa[2]>>qa;let Ra;this._rootTiles.some($a=>$a.lij[1]===Ja&&$a.lij[2]===Ta?(Ra=$a,!0):!1);if(Ra){for(qa=1<<aa[0]-1;Ra.lij[0]<aa[0];){let $a=aa[1]&qa?2:0;0<(aa[2]&qa)&&$a++;if(!Ra.children[$a])return null;Ra=Ra.children[$a];qa>>=1}X.weakAssert(Ra.lij[0]===aa[0]&&Ra.lij[1]===aa[1]&&Ra.lij[2]===aa[2],"not the right tile?");
return Ra}return null}get renderPatchBorders(){return this._renderer.renderPatchBorders}set renderPatchBorders(qa){this._renderer.renderPatchBorders=qa}get visualizeNormals(){return this._renderer.visualizeNormals}set visualizeNormals(qa){this._renderer.visualizeNormals=qa}get renderingDisabled(){return this._renderer.renderingDisabled}set renderingDisabled(qa){this._renderer.renderingDisabled=qa}get test(){}checkAllTilesWaterproofness(){if(X.enableWaterproofTests){var qa=this._rootTiles;if(null!=
qa){var aa=Ra=>0<Ra?.renderData?.geometry?.indices?.length,Ja=Ra=>{if(Ra.intersectsClippingArea)if(Ra.renderData&&!Ra.renderData.geometryState&&console.error("Tile[",Ra.lij,"] has renderData but not geometryState"),Ra.renderData&&!Ra.renderData.geometry&&console.error("Tile[",Ra.lij,"] has renderData but not geometryInfo"),!Ra.renderData?.geometry||0<(Ra.renderData.geometry.indices?.length??0)||console.error("Tile[",Ra.lij,"] has renderData but no indices - geometryInfo: ",Ra.renderData.geometry),
aa(Ra)){Ra.checkGeometryWaterproofness();for(const pa of Ra.children){var $a=pa,bb=Ra;aa($a)&&console.error("Tile[",$a.lij,"] has geometry although parent[",bb.lij,"] has geom")}}else if(Ra.isLeaf)console.error("Tile[",Ra.lij,"] has no geometry and no children, from root to leaf");else for($a of Ra.children)Ja($a)},Ta=Ra=>{const $a=Ra.parent?.visible??!0,bb=Ra.visible;Ra.computeVisibility();const pa=Ra.visible;bb!==pa&&$a&&console.error(" Tile[",Ra.lij,"] has out of date visibility: ",bb," instead of ",
pa);if(!Ra.isLeaf)for(const Ba of Ra.children)Ta(Ba)};for(const Ra of qa)Ja(Ra),Ta(Ra)}}}get isGlobal(){return this._isGlobal}get isGeographic(){return this._isGeographic}get isWebMercator(){return this._isWebMercator}get isWebMercatorOnPlateCarree(){return this._isWebMercatorOnPlateCarree}isEastEndWrap(qa){return this._isGlobal&&qa[2]===this.lijEastEnd(qa[0])-1}isWestEndWrap(qa){return this._isGlobal&&0===qa[2]}lijEastEnd(qa){return 1<<qa+(this._isGeographic?1:0)}wrapEastWest(qa){const aa=this.lijEastEnd(qa[0]),
Ja=qa[2];return 0<=Ja&&Ja<aa?qa:this._isGlobal?[qa[0],qa[1],(Ja+(0>Ja?aa:0))%aa]:null}enableInternalChecks(qa){X.enableInternalTerrainChecks(qa)}enableWaterproofnessChecks(qa){X.enableTerrainWaterproofChecks(qa)}};l._tileMemcacheKey="TerrainTileMemcache";b.__decorate([r.property()],l.prototype,"_renderer",void 0);b.__decorate([r.property({constructOnly:!0})],l.prototype,"_scaleRangeQueries",void 0);b.__decorate([r.property({constructOnly:!0})],l.prototype,"view",void 0);b.__decorate([r.property({constructOnly:!0})],
l.prototype,"overlayManager",void 0);b.__decorate([r.property()],l.prototype,"_hasPendingUpdates",void 0);b.__decorate([r.property()],l.prototype,"_asyncWorkItems",void 0);b.__decorate([r.property()],l.prototype,"_allTilesDirty",void 0);b.__decorate([r.property()],l.prototype,"_allTilesSorted",void 0);b.__decorate([r.property()],l.prototype,"_viewChanged",void 0);b.__decorate([r.property({type:Number})],l.prototype,"heading",void 0);b.__decorate([r.property()],l.prototype,"_splitLimits",void 0);b.__decorate([r.property({readOnly:!0})],
l.prototype,"_watchUpdatingTracking",void 0);b.__decorate([r.property()],l.prototype,"_frameTask",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"snapLevel",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"lodSnapping",null);b.__decorate([r.property()],l.prototype,"_userClippingExtent",null);b.__decorate([r.property()],l.prototype,"_rootTilesExtent",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"extent",null);b.__decorate([r.property({readOnly:!0})],l.prototype,
"groundExtent",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"_tilingSchemeExtent",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"updating",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"running",null);b.__decorate([r.property(W.updatingProgress)],l.prototype,"updatingProgress",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"updatingProgressValue",null);b.__decorate([r.property()],l.prototype,"_maxNumUpdating",void 0);b.__decorate([r.property()],
l.prototype,"baseOpacity",null);b.__decorate([r.property()],l.prototype,"hasCompositeBlendMode",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"viewingMode",null);b.__decorate([r.property()],l.prototype,"maxTextureScale",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"ready",null);b.__decorate([r.property({value:Z.RenderOrder.FRONT_TO_BACK})],l.prototype,"renderOrder",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"rootTiles",null);b.__decorate([r.property()],
l.prototype,"_rootTiles",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"spatialReference",null);b.__decorate([r.property({type:q})],l.prototype,"backgroundColor",null);b.__decorate([r.property({value:!1})],l.prototype,"slicePlaneEnabled",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"tilingScheme",void 0);b.__decorate([r.property({readOnly:!0})],l.prototype,"tilingSchemeLocked",null);b.__decorate([r.property({readOnly:!0})],l.prototype,"tilingSchemeLogic",void 0);b.__decorate([r.property()],
l.prototype,"wireframe",null);b.__decorate([r.property({value:!1})],l.prototype,"suspended",null);b.__decorate([r.property()],l.prototype,"fadeDuration",null);b.__decorate([r.property()],l.prototype,"visibleElevationBounds",void 0);b.__decorate([r.property()],l.prototype,"rootTileElevationBounds",void 0);b.__decorate([r.property()],l.prototype,"_layerViewsDirty",void 0);b.__decorate([r.property()],l.prototype,"renderPatchBorders",null);b.__decorate([r.property()],l.prototype,"visualizeNormals",null);
b.__decorate([r.property()],l.prototype,"renderingDisabled",null);b=l=wa=b.__decorate([n.subclass("esri.views.3d.terrain.TerrainSurface")],l);const sa=z.create(),Ha=I.create(),Ka=N.create();new w;const Aa=new J.ElevationUpdateEvent("ground"),Sa={spatialReference:null,extent:null,scale:0};class Ya{constructor(qa){this.capacity=qa;this._tail=this._head=0;this._data=Array(qa)}push(qa){const aa=this._tail;if(aa<this.capacity)this._data[aa]=qa,this._tail=aa+1;else throw Error("Queue full");}pushAll(qa){const aa=
qa.length;if(0!==aa){var Ja=this._tail;if(Ja+aa<=this.capacity){for(let Ta=0;Ta<aa;++Ta)this._data[Ja+Ta]=qa[Ta];this._tail=Ja+aa}else throw Error("Queue full");}}pop(){const qa=this._head;if(qa<this._tail){const aa=this._data[qa];this._head=qa+1;return aa}}get empty(){return this._head>=this._tail}get full(){return this._tail>=this._data.length}}return b})},"esri/layers/support/ElevationQueryTileCache":function(){define(["exports"],function(a){class b{constructor(q){this._store=q}destroy(){this._store.destroy()}get(q){return this._store.get(q)}put(q,
l){this._store.put(q,l,l.values.byteLength+256)}}a.ElevationQueryTileCache=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/VectorTile":function(){define("exports ../../../../core/has ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f32 ./enums ./RenderBucket ./decluttering/config ../webgl/TiledDisplayObject".split(" "),function(a,b,q,l,p,k,h,f){class c extends f.TiledDisplayObject{constructor(g,d,t,w,v,
m,r,n=null){super(g,d,t,w,v,m,4096,4096);this.styleRepository=r;this._memCache=n;this.type="vector-tile";this._referenced=0;this._hasSymbolBuckets=!1;this._memoryUsedByLayerData=0;this.layerData=new Map;this.status="loading";this.allSymbolsFadingOut=!1;this.lastOpacityUpdate=0;this.symbols=new Map;this.decluttered=this.neededForCoverage=this.isCoverage=!1;this.parentTile=null;this.childrenTiles=new Set;this.featureIndex=null;this.triangleCount=0;this._processed=!1;this._referenced=1;this.id=g.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&
performance.now()-this.lastOpacityUpdate<h.fadeDuration}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<h.fadeDuration)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(g){this.changeDataImpl(g);this.requestRender();this.ready();this._processed=!0}deleteLayerData(g){let d=!1;for(const t of g)if(g=this.layerData.get(t))this._memoryUsedByLayerData-=g.memoryUsed,g.type===
p.BucketType.SYMBOL&&this.symbols.delete(t)&&(d=!0),g.destroy(),this.layerData.delete(t);this._memCache?.updateSize(this.key.id,this,this._memoryUsedByLayerData);d&&(this.featureIndex?.clear(),this.emit("symbols-changed"));this.requestRender()}processed(){return this._processed}hasData(){return 0<this.layerData.size}dispose(){"unloaded"!==this.status&&(this.featureIndex=null,e.delete(this),c._destroyRenderBuckets(this.layerData),this.layerData.clear(),this._memoryUsedByLayerData=0,this.destroy(),
this.status="unloaded")}release(){return 0===--this._referenced?(this.dispose(),this.stage=null,!0):!1}retain(){++this._referenced}get referenced(){return this._referenced}get usedMemory(){return this._memoryUsedByLayerData+256}changeDataImpl(g){this.featureIndex?.clear();let d=!1;if(g){const {bucketsWithData:t,emptyBuckets:w}=g;g=this._createRenderBuckets(t);if(w&&0<w.byteLength){const v=new Uint32Array(w);for(const m of v)this._deleteLayerData(m)}for(const [v,m]of g)this._deleteLayerData(v),m.type===
p.BucketType.SYMBOL&&(this.symbols.set(v,m.symbols),d=!0),this._memoryUsedByLayerData+=m.memoryUsed,this.layerData.set(v,m);this._memCache?.updateSize(this.key.id,this,this.usedMemory)}this._hasSymbolBuckets=!1;for(const [,t]of this.layerData)t.type===p.BucketType.SYMBOL&&(this._hasSymbolBuckets=!0);d&&this.emit("symbols-changed")}attachWithContext(g){this.stage={context:g,trashDisplayObject(d){d.processDetach()},untrashDisplayObject(){return!1}}}setTransform(g){super.setTransform(g);var d=this.resolution/
(g.resolution*g.pixelRatio);const t=this.width/this.rangeX*d;d*=this.height/this.rangeY;const w=[0,0];g.toScreen(w,[this.x,this.y]);const v=this.transforms.tileUnitsToPixels;q.identity(v);q.translate(v,v,w);q.rotate(v,v,Math.PI*g.rotation/180);q.scale(v,v,[t,d,1])}_createTransforms(){return{displayViewScreenMat3:l.create(),tileMat3:l.create(),tileUnitsToPixels:l.create()}}static _destroyRenderBuckets(g){if(g){var d=new Set;for(const t of g.values())d.has(t)||(t.destroy(),d.add(t));g.clear()}}_createRenderBuckets(g){const d=
new Map,t=new Map;for(const w of g){g=this._deserializeBucket(w,t);for(const v of g.layerUIDs)d.set(v,g)}return d}_deserializeBucket(g,d){let t=d.get(g);if(t)return t;switch((new Uint32Array(g))[0]){case p.BucketType.FILL:t=new k.FillRenderBucket(g,this.styleRepository);break;case p.BucketType.LINE:t=new k.LineRenderBucket(g,this.styleRepository);break;case p.BucketType.SYMBOL:t=new k.SymbolRenderBucket(g,this.styleRepository,this);break;case p.BucketType.CIRCLE:t=new k.CircleRenderBucket(g,this.styleRepository)}d.set(g,
t);return t}_deleteLayerData(g){if(this.layerData.has(g)){var d=this.layerData.get(g);this._memoryUsedByLayerData-=d.memoryUsed;d.destroy();this.layerData.delete(g)}}}const e=new Map;a.VectorTile=c;a.printAllocations=function(){e.forEach((g,d)=>{console.log(`\n${d.key}:`);g[0].forEach(t=>console.log(t));console.log("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d");g[1].forEach(t=>console.log(t))})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/factories/mat3f32":function(){define(["exports"],
function(a){function b(){const h=new Float32Array(9);h[0]=1;h[4]=1;h[8]=1;return h}function q(h){const f=new Float32Array(9);f[0]=h[0];f[1]=h[1];f[2]=h[2];f[3]=h[3];f[4]=h[4];f[5]=h[5];f[6]=h[6];f[7]=h[7];f[8]=h[8];return f}function l(h,f,c,e,g,d,t,w,v){const m=new Float32Array(9);m[0]=h;m[1]=f;m[2]=c;m[3]=e;m[4]=g;m[5]=d;m[6]=t;m[7]=w;m[8]=v;return m}function p(h,f){return new Float32Array(h,f,9)}const k=Object.freeze(Object.defineProperty({__proto__:null,clone:q,create:b,createView:p,fromValues:l},
Symbol.toStringTag,{value:"Module"}));a.clone=q;a.create=b;a.createView=p;a.fromValues=l;a.mat3f32=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/enums":function(){define(["exports"],function(a){a.BucketType=void 0;(function(b){b[b.FILL=1]="FILL";b[b.LINE=2]="LINE";b[b.SYMBOL=3]="SYMBOL";b[b.CIRCLE=4]="CIRCLE"})(a.BucketType||(a.BucketType={}));a.ShaderProgramType=void 0;(function(b){b[b.BACKGROUND=0]="BACKGROUND";b[b.FILL=1]="FILL";b[b.OUTLINE=
2]="OUTLINE";b[b.LINE=3]="LINE";b[b.ICON=4]="ICON";b[b.CIRCLE=5]="CIRCLE";b[b.TEXT=6]="TEXT";b[b.TILEINFO=7]="TILEINFO"})(a.ShaderProgramType||(a.ShaderProgramType={}));a.StyleUpdateType=void 0;(function(b){b[b.PAINTER_CHANGED=0]="PAINTER_CHANGED";b[b.LAYOUT_CHANGED=1]="LAYOUT_CHANGED";b[b.LAYER_CHANGED=2]="LAYER_CHANGED";b[b.LAYER_REMOVED=3]="LAYER_REMOVED";b[b.SPRITES_CHANGED=4]="SPRITES_CHANGED"})(a.StyleUpdateType||(a.StyleUpdateType={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/2d/engine/vectorTiles/RenderBucket":function(){define("exports ../../../../core/maybe ../../../../core/typedArrayUtil ../../tiling/TileInfoView ../../tiling/TileKey ../../tiling/TileQueue ../../tiling/TileStrategy ./enums ./decluttering/util ../../../webgl/BufferObject ../../../webgl/enums ../../../webgl/VertexArrayObject".split(" "),function(a,b,q,l,p,k,h,f,c,e,g,d){class t{constructor(n,u){this.layerUIDs=[];this.isDestroyed=!1;this._data=n;let x=1;n=new Uint32Array(n);this.layerUIDs=
[];const y=n[x++];for(let z=0;z<y;z++)this.layerUIDs[z]=n[x++];this.bufferDataOffset=x;u&&(this.layer=u.getStyleLayerByUID(this.layerUIDs[0]))}get isPreparedForRendering(){return null==this._data}get offset(){return this.bufferDataOffset}get data(){return this._data}destroy(){this.isDestroyed||(this.doDestroy(),this._data=null,this.isDestroyed=!0)}prepareForRendering(n){null!=this._data&&(this.doPrepareForRendering(n,this._data,this.bufferDataOffset),this._data=null)}}class w extends t{constructor(n,
u){super(n,u);this.type=f.BucketType.LINE;this.lineIndexCount=this.lineIndexStart=0;n=new Uint32Array(n);u=this.bufferDataOffset;this.lineIndexStart=n[u++];this.lineIndexCount=n[u++];const x=n[u++];if(0<x){this.patternMap=new Map;for(let y=0;y<x;y++){const z=n[u++],A=n[u++],B=n[u++];this.patternMap.set(z,[A,B])}}this.bufferDataOffset=u}get memoryUsed(){return(this.data?.byteLength??0)+(this.vao?.usedMemory??0)}hasData(){return 0<this.lineIndexCount}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=
b.disposeMaybe(this.vao)}doPrepareForRendering(n,u,x){var y=new Uint32Array(u);u=new Int32Array(y.buffer);var z=y[x++];u=e.BufferObject.createVertex(n,g.Usage.STATIC_DRAW,new Int32Array(u.buffer,4*x,z));x+=z;z=y[x++];y=e.BufferObject.createIndex(n,g.Usage.STATIC_DRAW,new Uint32Array(y.buffer,4*x,z));x+=z;x=this.layer.lineMaterial;this.vao=new d.VertexArrayObject(n,x.getAttributeLocations(),x.getLayoutInfo(),{geometry:u},y)}}class v extends t{constructor(n,u){super(n,u);this.type=f.BucketType.FILL;
this.outlineIndexCount=this.outlineIndexStart=this.fillIndexCount=this.fillIndexStart=0;n=new Uint32Array(n);u=this.bufferDataOffset;this.fillIndexStart=n[u++];this.fillIndexCount=n[u++];this.outlineIndexStart=n[u++];this.outlineIndexCount=n[u++];const x=n[u++];if(0<x){this.patternMap=new Map;for(let y=0;y<x;y++){const z=n[u++],A=n[u++],B=n[u++];this.patternMap.set(z,[A,B])}}this.bufferDataOffset=u}get memoryUsed(){return(this.data?.byteLength??0)+(this.fillVAO?.usedMemory??0)+(this.outlineVAO?.usedMemory??
0)}hasData(){return 0<this.fillIndexCount||0<this.outlineIndexCount}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=b.disposeMaybe(this.fillVAO);this.outlineVAO=b.disposeMaybe(this.outlineVAO)}doPrepareForRendering(n,u,x){var y=new Uint32Array(u),z=new Int32Array(y.buffer),A=y[x++];u=e.BufferObject.createVertex(n,g.Usage.STATIC_DRAW,new Int32Array(z.buffer,4*x,A));x+=A;var B=y[x++];A=e.BufferObject.createIndex(n,g.Usage.STATIC_DRAW,new Uint32Array(y.buffer,
4*x,B));x+=B;B=y[x++];z=e.BufferObject.createVertex(n,g.Usage.STATIC_DRAW,new Int32Array(z.buffer,4*x,B));x+=B;B=y[x++];y=e.BufferObject.createIndex(n,g.Usage.STATIC_DRAW,new Uint32Array(y.buffer,4*x,B));x+=B;B=this.layer;x=B.fillMaterial;B=B.outlineMaterial;this.fillVAO=new d.VertexArrayObject(n,x.getAttributeLocations(),x.getLayoutInfo(),{geometry:u},A);this.outlineVAO=new d.VertexArrayObject(n,B.getAttributeLocations(),B.getLayoutInfo(),{geometry:z},y)}}class m extends t{constructor(n,u,x){super(n,
u);this.type=f.BucketType.SYMBOL;this.iconPerPageElementsMap=new Map;this.glyphPerPageElementsMap=new Map;this.symbolInstances=[];this.opacityChanged=this.isIconSDF=!1;this.lastOpacityUpdate=0;this.symbols=[];u=new Uint32Array(n);const y=new Int32Array(n);n=new Float32Array(n);let z=this.bufferDataOffset;this.isIconSDF=!!u[z++];var A=u[z++],B=u[z++],C=u[z++];A=new p(A,B,C,0);B=u[z++];for(C=0;C<B;C++){var D=u[z++],F=u[z++],H=u[z++];this.iconPerPageElementsMap.set(D,[F,H])}B=u[z++];for(C=0;C<B;C++)D=
u[z++],F=u[z++],H=u[z++],this.glyphPerPageElementsMap.set(D,[F,H]);B=u[z++];C=u[z++];this.iconOpacity=new Int32Array(B);this.textOpacity=new Int32Array(C);this.bufferDataOffset=z=c.deserializeSymbols(u,y,n,z,this.symbols,x,A)}get memoryUsed(){return(this.data?.byteLength??0)+(this.iconVAO?.usedMemory??0)+(this.textVAO?.usedMemory??0)+q.estimateSize(this.iconOpacity)+q.estimateSize(this.textOpacity)}hasData(){return 0<this.iconPerPageElementsMap.size||0<this.glyphPerPageElementsMap.size}triangleCount(){let n=
0;for(const [,u]of this.iconPerPageElementsMap)n+=u[1];for(const [,u]of this.glyphPerPageElementsMap)n+=u[1];return n/3}doDestroy(){this.iconVAO=b.disposeMaybe(this.iconVAO);this.textVAO=b.disposeMaybe(this.textVAO)}updateOpacityInfo(){if(this.opacityChanged){this.opacityChanged=!1;var n=this.iconOpacity,u=this.iconVAO.vertexBuffers.opacity;0<n.length&&n.byteLength===u.usedMemory&&u.setSubData(n,0,0,n.length);n=this.textOpacity;u=this.textVAO.vertexBuffers.opacity;0<n.length&&n.byteLength===u.usedMemory&&
u.setSubData(n,0,0,n.length)}}doPrepareForRendering(n,u,x){var y=new Uint32Array(u),z=new Int32Array(y.buffer),A=y[x++];u=e.BufferObject.createVertex(n,g.Usage.STATIC_DRAW,new Int32Array(z.buffer,4*x,A));x+=A;var B=y[x++];A=e.BufferObject.createIndex(n,g.Usage.STATIC_DRAW,new Uint32Array(y.buffer,4*x,B));x+=B;B=y[x++];z=e.BufferObject.createVertex(n,g.Usage.STATIC_DRAW,new Int32Array(z.buffer,4*x,B));x+=B;B=y[x++];y=e.BufferObject.createIndex(n,g.Usage.STATIC_DRAW,new Uint32Array(y.buffer,4*x,B));
x+=B;x=e.BufferObject.createVertex(n,g.Usage.STATIC_DRAW,this.iconOpacity.buffer);B=e.BufferObject.createVertex(n,g.Usage.STATIC_DRAW,this.textOpacity.buffer);var C=this.layer;const D=C.iconMaterial;C=C.textMaterial;this.iconVAO=new d.VertexArrayObject(n,D.getAttributeLocations(),D.getLayoutInfo(),{geometry:u,opacity:x},A);this.textVAO=new d.VertexArrayObject(n,C.getAttributeLocations(),C.getLayoutInfo(),{geometry:z,opacity:B},y)}}class r extends t{constructor(n,u){super(n,u);this.type=f.BucketType.CIRCLE;
this.circleIndexCount=this.circleIndexStart=0;n=new Uint32Array(n);u=this.bufferDataOffset;this.circleIndexStart=n[u++];this.circleIndexCount=n[u++];this.bufferDataOffset=u}get memoryUsed(){return(this.data?.byteLength??0)+(this.vao?.usedMemory??0)}hasData(){return 0<this.circleIndexCount}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=b.disposeMaybe(this.vao)}doPrepareForRendering(n,u,x){var y=new Uint32Array(u);u=new Int32Array(y.buffer);var z=y[x++];u=e.BufferObject.createVertex(n,
g.Usage.STATIC_DRAW,new Int32Array(u.buffer,4*x,z));x+=z;z=y[x++];y=e.BufferObject.createIndex(n,g.Usage.STATIC_DRAW,new Uint32Array(y.buffer,4*x,z));x+=z;x=this.layer.circleMaterial;this.vao=new d.VertexArrayObject(n,x.getAttributeLocations(),x.getLayoutInfo(),{geometry:u},y)}}a.CircleRenderBucket=r;a.FillRenderBucket=v;a.LineRenderBucket=w;a.RenderBucketBase=t;a.SymbolRenderBucket=m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/tiling/TileInfoView":function(){define(["../../../geometry/support/spatialReferenceUtils",
"./LODInfo","./TileCoverage","./TileKey","./TileSpan"],function(a,b,q,l,p){const k=new l("0/0/0/0");class h{static create(e,g){e[1]>g[1]&&([e,g]=[g,e]);const [d,t]=e,[w,v]=g;e=w-d;g=v-t;g=0!==g?e/g:0;const m=(Math.ceil(t)-t)*g,r=(Math.floor(t)-t)*g;return new h(d,Math.floor(t),Math.ceil(v),g,0>e?m:r,0>e?r:m,0>e?w:d,0>e?d:w)}constructor(e,g,d,t,w,v,m,r){this.x=e;this.ymin=g;this.ymax=d;this.invM=t;this.leftAdjust=w;this.rightAdjust=v;this.leftBound=m;this.rightBound=r}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+
this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}}const f=[[0,0],[0,0],[0,0],[0,0]];class c{constructor(e,g=null,d=e.lods[0].level,t=e.lods[e.lods.length-1].level){this.tileInfo=e;this.fullExtent=g;this.scales=[];this._infoByScale={};this._infoByLevel={};const w=e.lods.filter(m=>m.level>=d&&m.level<=t);this.minScale=w[0].scale;this.maxScale=w[w.length-1].scale;const v=this._lodInfos=w.map(m=>b.create(e,m,g));w.forEach((m,r)=>{this._infoByLevel[m.level]=
v[r];this._infoByScale[m.scale]=v[r];this.scales[r]=m.scale},this);this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(e){return this._infoByLevel["number"===typeof e?e:e.level]}getTileBounds(e,g,d=!1){k.set(g);return(g=this._infoByLevel[k.level])?g.getTileBounds(e,k,d):e}getTileCoords(e,g,d=!1){k.set(g);return(g=this._infoByLevel[k.level])?g.getTileCoords(e,k,d):e}getTileCoverage(e,g=192,d=!0,t="closest"){if(!d&&(e.scale>this.minScale||e.scale<this.maxScale))return null;
d="closest"===t?this.getClosestInfoForScale(e.scale):this.getSmallestInfoForScale(e.scale);t=q.pool.acquire(d);const w=this._wrap;var v=Infinity;let m=-Infinity;const r=t.spans;f[0][0]=f[0][1]=f[1][1]=f[3][0]=-g;f[1][0]=f[2][0]=e.size[0]+g;f[2][1]=f[3][1]=e.size[1]+g;for(n of f)e.toMap(n,n),n[0]=d.getColumnForX(n[0]),n[1]=d.getRowForY(n[1]);e=[];var n=3;for(g=0;4>g;g++)f[g][1]===f[n][1]?n=g:(n=h.create(f[g],f[n]),v=Math.min(n.ymin,v),m=Math.max(n.ymax,m),void 0===e[n.ymin]&&(e[n.ymin]=[]),e[n.ymin].push(n),
n=g);if(null==v||null==m||100<m-v)return null;for(g=[];v<m;){null!=e[v]&&(g=g.concat(e[v]));n=Infinity;var u=-Infinity;for(var x=g.length-1;0<=x;x--){var y=g[x];n=Math.min(n,y.getLeftCol());u=Math.max(u,y.getRightCol())}n=Math.floor(n);u=Math.floor(u);if(v>=d.first[1]&&v<=d.last[1])if(w)if(d.size[0]<d.worldSize[0])for(x=Math.floor(u/d.worldSize[0]),y=Math.floor(n/d.worldSize[0]);y<=x;y++)r.push(new p(v,Math.max(d.getFirstColumnForWorld(y),n),Math.min(d.getLastColumnForWorld(y),u)));else r.push(new p(v,
n,u));else n>d.last[0]||u<d.first[0]||(n=Math.max(n,d.first[0]),u=Math.min(u,d.last[0]),r.push(new p(v,n,u)));v+=1;for(n=g.length-1;0<=n;n--)u=g[n],u.ymax>=v?u.incrRow():g.splice(n,1)}return t}getTileParentId(e){k.set(e);e=this._lodInfos.indexOf(this._infoByLevel[k.level])-1;if(0>e)return null;this._getTileIdAtLOD(k,this._lodInfos[e],k);return k.id}getTileResolution(e){return(e=this._infoByLevel["object"===typeof e?e.level:e])?e.resolution:-1}getTileScale(e){return(e=this._infoByLevel[e.level])?e.scale:
-1}intersects(e,g){k.set(g);g=this._infoByLevel[k.level];const d=e.lodInfo;if(d.resolution>g.resolution){this._getTileIdAtLOD(k,d,k);var t=d.denormalizeCol(k.col,k.world);for(var w of e.spans)if(w.row===k.row&&w.colFrom<=t&&w.colTo>=t)return!0}if(d.resolution<g.resolution){const [m,r,n,u]=e.spans.reduce((x,y)=>{x[0]=Math.min(x[0],y.row);x[1]=Math.max(x[1],y.row);x[2]=Math.min(x[2],y.colFrom);x[3]=Math.max(x[3],y.colTo);return x},[Infinity,-Infinity,Infinity,-Infinity]);t=g.denormalizeCol(k.col,k.world);
e=d.getColumnForX(g.getXForColumn(t));w=d.getRowForY(g.getYForRow(k.row));t=d.getColumnForX(g.getXForColumn(t+1))-1;g=d.getRowForY(g.getYForRow(k.row+1))-1;return!(e>u||t<n||w>r||g<m)}const v=d.denormalizeCol(k.col,k.world);return e.spans.some(m=>m.row===k.row&&m.colFrom<=v&&m.colTo>=v)}normalizeBounds(e,g,d){e[0]=g[0];e[1]=g[1];e[2]=g[2];e[3]=g[3];this._wrap&&(g=a.getInfo(this.tileInfo.spatialReference),d=-d*(g.valid[1]-g.valid[0]),e[0]+=d,e[2]+=d);return e}getSmallestInfoForScale(e){const g=this.scales;
if(this._infoByScale[e])return this._infoByScale[e];if(e>g[0])return this._infoByScale[g[0]];for(let d=1;d<g.length-1;d++)if(e>g[d]+1E-6)return this._infoByScale[g[d-1]];return this._infoByScale[g[g.length-1]]}getClosestInfoForScale(e){const g=this.scales;if(this._infoByScale[e])return this._infoByScale[e];e=g.reduce((d,t)=>Math.abs(t-e)<Math.abs(d-e)?t:d,g[0]);return this._infoByScale[e]}scaleToLevel(e){const g=this.scales;if(this._infoByScale[e])return this._infoByScale[e].level;for(let d=g.length-
1;0<=d;d--)if(e<g[d])return d===g.length-1?this._infoByScale[g[g.length-1]].level:this._infoByScale[g[d]].level+(g[d]-e)/(g[d]-g[d+1]);return this._infoByScale[g[0]].level}scaleToZoom(e){return this.tileInfo.scaleToZoom(e)}zoomToScale(e){return this.tileInfo.zoomToScale(e)}_getTileIdAtLOD(e,g,d){const t=this._infoByLevel[d.level];e.set(d);if(g.resolution<t.resolution)return null;if(g.resolution===t.resolution)return e;e.level=g.level;e.col=Math.floor(d.col*t.resolution/g.resolution+.01);e.row=Math.floor(d.row*
t.resolution/g.resolution+.01);return e}}return c})},"esri/views/2d/tiling/LODInfo":function(){define(["../../../geometry/support/spatialReferenceUtils","./TileKey"],function(a,b){function q(k,h,f){k[0]=h;k[1]=f;return k}const l=new b("0/0/0/0");class p{static create(k,h,f=null){var c=a.getInfo(k.spatialReference);const e=h.origin||[k.origin.x,k.origin.y],g=[k.size[0]*h.resolution,k.size[1]*h.resolution],d=[-Infinity,-Infinity],t=[Infinity,Infinity],w=[Infinity,Infinity];null!=f&&(q(d,Math.max(0,
Math.floor((f.xmin-e[0])/g[0])),Math.max(0,Math.floor((e[1]-f.ymax)/g[1]))),q(t,Math.max(0,Math.floor((f.xmax-e[0])/g[0])),Math.max(0,Math.floor((e[1]-f.ymin)/g[1]))),q(w,t[0]-d[0]+1,t[1]-d[1]+1));const {cols:v,rows:m}=h;!f&&v&&m&&(q(d,v[0],m[0]),q(t,v[1],m[1]),q(w,v[1]-v[0]+1,m[1]-m[0]+1));let r;k.isWrappable?(k=[Math.ceil(Math.round((c.valid[1]-c.valid[0])/h.resolution)/k.size[0]),w[1]],c=[Math.floor((c.origin[0]-e[0])/g[0]),d[1]],f=[k[0]+c[0]-1,t[1]],r=!0):(c=d,f=t,k=w,r=!1);return new p(h.level,
h.resolution,h.scale,e,d,t,w,g,c,f,k,r)}constructor(k,h,f,c,e,g,d,t,w,v,m,r){this.level=k;this.resolution=h;this.scale=f;this.origin=c;this.first=e;this.last=g;this.size=d;this.norm=t;this.worldStart=w;this.worldEnd=v;this.worldSize=m;this.wrap=r}normalizeCol(k){if(!this.wrap)return k;const h=this.worldSize[0];return 0>k?h-1-Math.abs((k+1)%h):k%h}denormalizeCol(k,h){return this.wrap?this.worldSize[0]*h+k:k}getWorldForColumn(k){return this.wrap?Math.floor(k/this.worldSize[0]):0}getFirstColumnForWorld(k){return k*
this.worldSize[0]+this.first[0]}getLastColumnForWorld(k){return k*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(k){return(k-this.origin[0])/this.norm[0]}getXForColumn(k){return this.origin[0]+k*this.norm[0]}getRowForY(k){return(this.origin[1]-k)/this.norm[1]}getYForRow(k){return this.origin[1]-k*this.norm[1]}getTileBounds(k,h,f=!1){l.set(h);var c=f?l.col:this.denormalizeCol(l.col,l.world),e=l.row;h=this.getXForColumn(c);f=this.getYForRow(e+1);c=this.getXForColumn(c+1);e=this.getYForRow(e);
k[0]=h;k[1]=f;k[2]=c;k[3]=e;return k}getTileCoords(k,h,f=!1){l.set(h);h=f?l.col:this.denormalizeCol(l.col,l.world);Array.isArray(k)?q(k,this.getXForColumn(h),this.getYForRow(l.row)):(k.x=this.getXForColumn(h),k.y=this.getYForRow(l.row));return k}}return p})},"esri/views/2d/tiling/TileKey":function(){define(["../../../core/ObjectPool"],function(a){class b{static getId(q,l,p,k){return"object"===typeof q?`${q.level}/${q.row}/${q.col}/${q.world}`:`${q}/${l}/${p}/${k}`}constructor(q,l,p,k){this.set(q,
l,p,k)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(q){this.set(q)}get hash(){return(this.world&3)<<30|(this.col&4095)<<22|(this.row&4095)<<8|this.level&63}acquire(q,l,p,k){this.set(q,l,p,k)}contains(q){const l=q.level-this.level;return 0<=l&&this.row===q.row>>l&&this.col===q.col>>l&&this.world===q.world}containsChild(q){const l=q.level-this.level;return 0<l&&this.row===q.row>>l&&this.col===q.col>>l&&this.world===q.world}equals(q){return this.level===
q.level&&this.row===q.row&&this.col===q.col&&this.world===q.world}clone(){return new b(this)}release(){this.world=this.col=this.row=this.level=0}set(q,l,p,k){if(null==q)this.world=this.col=this.row=this.level=0;else if("object"===typeof q)this.level=q.level||0,this.row=q.row||0,this.col=q.col||0,this.world=q.world||0;else if("string"===typeof q){const [h,f,c,e]=q.split("/");this.level=parseFloat(h);this.row=parseFloat(f);this.col=parseFloat(c);this.world=parseFloat(e)}else this.level=+q,this.row=
+l,this.col=+p,this.world=+k||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return 0>=this.level?null:new b(this.level-1,this.row>>1,this.col>>1,this.world)}getNeighborId(q,l){return`${this.level}/${this.row+l}/${this.col+q}/${this.world}`}getChildKeys(){const q=this.level+1,l=this.row<<1,p=this.col<<1,k=this.world;return[new b(q,l,p,k),new b(q,l,p+1,k),new b(q,l+1,p,k),new b(q,l+1,p+1,k)]}compareRowMajor(q){return this.row<q.row?-1:this.row>q.row?
1:this.col<q.col?-1:this.col>q.col?1:0}}b.pool=new a(b,null,null,25,50);return b})},"esri/views/2d/tiling/TileCoverage":function(){define(["../../../core/ObjectPool","./TileKey"],function(a,b){class q{constructor(){this.spans=[]}acquire(l){this.lodInfo=l}release(){this.lodInfo=null;this.spans.length=0}*keys(){const l=this.lodInfo;for(const {row:p,colFrom:k,colTo:h}of this.spans)for(let f=k;f<=h;f++){const c=l.getWorldForColumn(f);yield new b(l.level,p,l.normalizeCol(f),c)}}forEach(l,p){const {spans:k,
lodInfo:h}=this,{level:f}=h;if(0!==k.length)for(const {row:c,colFrom:e,colTo:g}of k)for(let d=e;d<=g;d++)l.call(p,f,c,h.normalizeCol(d),h.getWorldForColumn(d))}}q.pool=new a(q);return q})},"esri/views/2d/tiling/TileSpan":function(){define(function(){class a{constructor(b,q,l){this.row=b;this.colFrom=q;this.colTo=l}}return a})},"esri/views/2d/tiling/TileQueue":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/maybe ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/vec2 ../../support/QueueProcessor".split(" "),
function(a,b,q,l,p,k,h,f,c,e){function g(m,r){m.length=0;r.forEach(n=>m.push(n));return m}const d=new Set,t=[],w=new Map,v=[0,0];b=class extends b{constructor(m){super(m);this._keyToItem=new Map;this.concurrency=6;this.strategy="scale-first";this.tileInfoView=null}initialize(){const {concurrency:m,process:r,strategy:n}=this;this._queue=new e.QueueProcessor({concurrency:m,process:(u,x)=>{u=this._keyToItem.get(u);return r(u,{signal:x})},peeker:"scale-first"===n?u=>this._peekByScaleFirst(u):u=>this._peekByCenterFirst(u)})}destroy(){this.clear();
this._queue=q.destroyMaybe(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}abort(m){this._queue.abort("string"===typeof m?m:m.id)}clear(){this._queue.clear();this._keyToItem.clear()}has(m){return"string"===typeof m?this._keyToItem.has(m):this._keyToItem.has(m.id)}isOngoing(m){m="string"===typeof m?m:m.id;return this.has(m)&&this._queue.isOngoing(m)}pause(){this._queue.pause()}push(m){const r=m.key.id;if(this._queue.has(r))return this._queue.get(r);
const n=this._queue.push(r),u=()=>{this._keyToItem.delete(r)};this._keyToItem.set(r,m);n.then(u,u);return n}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(m){if(!this.state)return m.values().next().value;const r=this.tileInfoView;let n=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY;m.forEach(B=>{B=this._keyToItem.get(B);const C=this.tileInfoView.getTileScale(B.key);w.has(C)||(w.set(C,[]),n=Math.max(C,n),u=Math.min(C,u));w.get(C).push(B.key);d.add(C)});let x=this.state.scale;
w.has(x)||(g(t,d),t.sort((B,C)=>B-C),x=t.reduce((B,C)=>Math.abs(C-x)<Math.abs(B-x)?C:B,t[0]));x=Math.min(x,n);x=Math.max(x,u);m=w.get(x);const y=r.getClosestInfoForScale(x),z=y.getColumnForX(this.state.center[0]),A=y.getRowForY(this.state.center[1]);m.sort((B,C)=>{const D=y.denormalizeCol(B.col,B.world),F=y.denormalizeCol(C.col,C.world);return Math.sqrt((z-D)*(z-D)+(A-B.row)*(A-B.row))-Math.sqrt((z-F)*(z-F)+(A-C.row)*(A-C.row))});d.clear();w.clear();return m[0].id}_peekByCenterFirst(m){if(!this.state)return m.values().next().value;
const r=this.tileInfoView,n=this.state.center;let u=Number.POSITIVE_INFINITY,x;m.forEach(y=>{y=this._keyToItem.get(y);r.getTileCoords(v,y.key);const z=c.distance(v,n);z<u&&(u=z,x=y.key)});return x.id}};a.__decorate([l.property({constructOnly:!0})],b.prototype,"concurrency",void 0);a.__decorate([l.property({constructOnly:!0})],b.prototype,"process",void 0);a.__decorate([l.property()],b.prototype,"state",void 0);a.__decorate([l.property({constructOnly:!0})],b.prototype,"strategy",void 0);a.__decorate([l.property({constructOnly:!0})],
b.prototype,"tileInfoView",void 0);return b=a.__decorate([f.subclass("esri.views.2d.tiling.TileQueue")],b)})},"esri/views/support/QueueProcessor":function(){define("exports ../../core/has ../../core/maybe ../../core/promiseUtils ../../core/Queue ../../core/ReactiveMap ../../core/scheduling ../../core/signal".split(" "),function(a,b,q,l,p,k,h,f){class c{constructor(g,d){this.item=g;this.controller=d;this.promise=null}}class e{constructor(g){this._task=this._schedule=null;this._deferreds=new k;this._controllers=
new k;this._processingItems=new k;this._pausedSignal=f.signal(!1);this.concurrency=1;g.concurrency&&(this.concurrency=g.concurrency);this._queue=new p(g.peeker);this.process=g.process;const d=g.scheduler;g.priority&&d&&(this._task=d.registerTask(g.priority,this))}destroy(){this.clear();this._schedule=q.removeMaybe(this._schedule);this._task=q.removeMaybe(this._task)}get updating(){return!!this._task?.updating||this.running}get length(){return this._processingItems.size+this._queue.length}abort(g){(g=
this._controllers.get(g))&&g.abort()}clear(){this._queue.clear();const g=[];this._controllers.forEach(d=>g.push(d));this._controllers.clear();g.forEach(d=>d.abort());this._processingItems.clear();this._cancelNext()}forEach(g){this._deferreds.forEach((d,t)=>g(t))}get(g){return(g=this._deferreds.get(g))?g.promise:void 0}isOngoing(g){return this._processingItems.has(g)}has(g){return this._deferreds.has(g)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(g,d){const t=
this.get(g);if(t)return t;const w=new AbortController;let v=null;d&&(v=l.onAbort(d,()=>w.abort()));const m=()=>{r.remove();null!=v&&v.remove();this._removeItem(g);this._queue.remove(g);this._scheduleNext()},r=l.onAbortOrThrow(w.signal,()=>{const u=this._processingItems.get(g);u&&u.controller.abort();m();n.reject(l.createAbortError())}),n=l.createResolver();this._deferreds.set(g,n);this._controllers.set(g,w);n.promise.then(m,m);this._queue.push(g);this._scheduleNext();return n.promise}last(){return this._queue.last()}lastPromise(){const g=
this.last();return g?this.get(g):null}peek(){return this._queue.peek()}popLast(){const g=this._queue.popLast();g&&(this._deferreds.get(g)?.reject(l.createAbortError("Removed from queue")),this._removeItem(g));return g}reset(){const g=[];this._processingItems.forEach(d=>g.push(d));this._processingItems.clear();for(const d of g)this._queue.push(d.item),d.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const g=[];
for(;this._queue.length;)g.push(this._queue.pop());this.clear();return g}get running(){return!this._pausedSignal.value&&0<this._queue.length&&this._processingItems.size<this.concurrency}runTask(g){for(;!g.done&&0<this._queue.length&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop()),g.madeProgress()}_removeItem(g){this._deferreds.delete(g);this._controllers.delete(g);this._processingItems.delete(g)}_scheduleNext(){this._task||this._pausedSignal.value||this._schedule||(this._schedule=
h.schedule(()=>{this._schedule=null;this._next()}))}_next(){for(;0<this._queue.length&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(g,d){this._canProcessFulfillment(g)&&(this._scheduleNext(),this._deferreds.get(g.item).resolve(d))}_processError(g,d){this._canProcessFulfillment(g)&&(this._scheduleNext(),this._deferreds.get(g.item).reject(d))}_canProcessFulfillment(g){return this._deferreds.get(g.item)&&
this._processingItems.get(g.item)===g?!0:!1}_process(g){if(null!=g){var d=new AbortController,t=new c(g,d);this._processingItems.set(g,t);try{var w=this.process(g,d.signal)}catch(v){this._processError(t,v)}l.isPromiseLike(w)?(t.promise=w,w.then(v=>this._processResult(t,v),v=>this._processError(t,v))):this._processResult(t,w)}}get test(){}}a.QueueProcessor=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/tiling/TileStrategy":function(){define(["../../../geometry/support/aaBoundingRect",
"./TileCache","./TileCoverage","./TileKey"],function(a,b,q,l){const p=new l(0,0,0,0),k=new Map,h=[],f=[];class c{constructor(e){this._previousScale=Number.POSITIVE_INFINITY;this.cachePolicy="keep";this.coveragePolicy="closest";this.resampling=!0;this.tileIndex=new Map;this.tiles=[];this.buffer=192;this.acquireTile=e.acquireTile;this.releaseTile=e.releaseTile;this.tileInfoView=e.tileInfoView;null!=e.resampling&&(this.resampling=e.resampling);e.cachePolicy&&(this.cachePolicy=e.cachePolicy);e.coveragePolicy&&
(this.coveragePolicy=e.coveragePolicy);null!=e.buffer&&(this.buffer=e.buffer);e.cacheSize&&(this._tileCache=new b(e.cacheSize,this.tileInfoView,g=>{this.releaseTile(g)}))}destroy(){this.tileIndex.clear()}update(e){const {resampling:g,tileIndex:d}=this,{scale:t,center:w,resolution:v}=e.state,{minScale:m,maxScale:r}=this.tileInfoView,n=!e.stationary&&t>this._previousScale;this._previousScale=t;if(!g&&(t>m||t<r))this.tiles.length=0,this.clear();else if(e=this.tileInfoView.getTileCoverage(e.state,this.buffer,
this.resampling,this.coveragePolicy)){var {spans:u,lodInfo:x}=e,{level:y}=x;this.tiles.length=0;d.forEach(C=>C.visible=!0);var z=0,A=0;if(0<u.length)for(const {row:C,colFrom:D,colTo:F}of u)for(var B=D;B<=F;B++){z++;const H=p.set(y,C,x.normalizeCol(B),x.getWorldForColumn(B)).id;let N=d.get(H);if(N)N.isReady?(k.set(H,N),A++):n||this._addParentTile(H,k);else{if(this._tileCache?.has(H)){if(N=this._tileCache.pop(H),this.tileIndex.set(H,N),N.isReady){k.set(H,N);A++;continue}}else N=this.acquireTile(p),
this.tileIndex.set(H,N);n||this._addParentTile(H,k)}}z=A===z;for(const [C,D]of d)k.has(C)||(p.set(C),A=this.tileInfoView.intersects(e,p),B="purge"===this.cachePolicy?p.level!==y:p.level>y,!A||!n&&z?!B&&A||h.push(D):D.isReady?B&&"purge"===this.cachePolicy&&this._hasReadyAncestor(p,y)?h.push(D):f.push(D):B&&h.push(D));for(const C of f)C.isReady&&k.set(C.key.id,C);for(const C of h)this._tileCache?this._tileCache.add(C):this.releaseTile(C),d.delete(C.key.id);for(const C of k.values())this.tiles.push(C);
for(const C of d.values())k.has(C.key.id)||(C.visible=!1);this._tileCache?.prune(y,w,v);q.pool.release(e);f.length=0;h.length=0;k.clear()}else this.tiles.length=0,this.clear()}clear(){const {tileIndex:e}=this;for(const g of e.values())this.releaseTile(g);e.clear()}refresh(e){for(const g of this.tileIndex.values())this.tiles.includes(g)?e(g):h.push(g);for(const g of h)this.releaseTile(g),this.tileIndex.delete(g.key.id);this._tileCache?.clear()}updateCacheSize(e){this._tileCache&&(this._tileCache.maxSize=
e)}_addParentTile(e,g){let d=null;for(;;){e=this.tileInfoView.getTileParentId(e);if(!e)break;if(this.tileIndex.has(e)){if(d=this.tileIndex.get(e),d?.isReady){g.has(d.key.id)||g.set(d.key.id,d);break}}else if(this._tileCache?.has(e)&&(d=this._tileCache.pop(e),this.tileIndex.set(e,d),d?.isReady)){g.has(d.key.id)||g.set(d.key.id,d);break}}}_hasReadyAncestor(e,g){const d=a.create();this.tileInfoView.getTileBounds(d,e,!0);for(const t of this.tileIndex.values())if(t.isReady&&t.key.level>=g&&t.key.level<
e.level){const w=a.create();this.tileInfoView.getTileBounds(w,t.key,!0);if(a.contains(w,d))return!0}return!1}}return c})},"esri/views/2d/tiling/TileCache":function(){define(["../../../core/libs/gl-matrix-2/math/vec2"],function(a){class b{constructor(q,l,p){this.maxSize=q;this._tileInfoView=l;this._removedFunc=p;this._tilePerId=new Map;this._tileKeysPerLevel=[]}clear(){this._tilePerId.clear();this._tileKeysPerLevel=[]}has(q){return this._tilePerId.has(q)}get(q){return this._tilePerId.get(q)}pop(q){const l=
this._tilePerId.get(q);if(l){var p=this._tileKeysPerLevel[l.key.level];this._tilePerId["delete"](q);for(let k=0;k<p.length;k++)if(p[k].id===q){p.splice(k,1);break}l.visible=!0;return l}}add(q){q.visible=!1;const l=q.key,p=l.id;this._tilePerId.has(p)||(this._tilePerId.set(p,q),q=l.level,this._tileKeysPerLevel[q]||(this._tileKeysPerLevel[q]=[]),this._tileKeysPerLevel[q].push(l))}prune(q,l,p){let k=this._tilePerId.size;if(!(k<=this.maxSize)){for(var h=this._tileKeysPerLevel.length-1;k>this.maxSize&&
0<=h;)h!==q&&(k=this._pruneAroundCenterTile(k,l,p,h)),h--;k>this.maxSize&&(k=this._pruneAroundCenterTile(k,l,p,q))}}_pruneAroundCenterTile(q,l,p,k){k=this._tileKeysPerLevel[k];if(!k||0===k.length)return q;const {size:h,origin:f}=this._tileInfoView.tileInfo,c=p*h[0],e=p*h[1],g=[0,0],d=[0,0];for(k.sort((t,w)=>{g[0]=f.x+c*(t.col+.5);g[1]=f.y-e*(t.row+.5);d[0]=f.x+c*(w.col+.5);d[1]=f.y-e*(w.row+.5);return a.squaredDistance(g,l)-a.squaredDistance(d,l)});0<k.length&&(p=k.pop(),this._removeTile(p.id),q--,
q!==this.maxSize););return q}_removeTile(q){const l=this._tilePerId.get(q);this._removedFunc&&l&&this._removedFunc(l);this._tilePerId["delete"](q)}}return b})},"esri/views/2d/engine/vectorTiles/decluttering/util":function(){define(["exports","../enums","../GeometryUtils","./core"],function(a,b,q,l){class p{constructor(k,h,f){this._rows=Math.ceil(h/f);this._columns=Math.ceil(k/f);this._cellSize=f;this.cells=Array(this._rows);for(k=0;k<this._rows;k++)for(this.cells[k]=Array(this._columns),h=0;h<this._columns;h++)this.cells[k][h]=
[]}getCell(k,h){h=Math.min(Math.max(Math.floor(h/this._cellSize),0),this._rows-1);k=Math.min(Math.max(Math.floor(k/this._cellSize),0),this._columns-1);return this.cells[h]&&this.cells[h][k]||null}getCellSpan(k,h,f,c){return[Math.min(Math.max(Math.floor(k/this._cellSize),0),this.columns-1),Math.min(Math.max(Math.floor(h/this._cellSize),0),this.rows-1),Math.min(Math.max(Math.floor(f/this._cellSize),0),this.columns-1),Math.min(Math.max(Math.floor(c/this._cellSize),0),this.rows-1)]}get cellSize(){return this._cellSize}get columns(){return this._columns}get rows(){return this._rows}}
a.GridIndex=p;a.deserializeSymbols=function(k,h,f,c,e,g,d){const t=h[c++];for(let m=0;m<t;m++){const r=new l.VTLSymbol(g,d);r.xTile=h[c++];r.yTile=h[c++];r.hash=h[c++];r.priority=h[c++];r.featureIndex=h[c++];var w=h[c++];for(var v=0;v<w;v++){const n=h[c++],u=h[c++],x=h[c++],y=h[c++],z=!!h[c++],A=h[c++],B=f[c++],C=f[c++],D=h[c++],F=h[c++];r.colliders.push({xTile:n,yTile:u,dxPixels:x,dyPixels:y,hard:z,partIndex:A,width:D,height:F,minLod:B,maxLod:C})}w=k[c++];for(v=0;v<w;v++)r.textVertexRanges.push([k[c++],
k[c++]]);w=k[c++];for(v=0;v<w;v++)r.iconVertexRanges.push([k[c++],k[c++]]);e.push(r)}return c};a.isSearchCircleOverlapingSymbol=function(k,h,f,c){var e=k.colliders;let g,d,t;for(const w of e)if(k.unique.show&&k.unique.parts[w.partIndex].show&&(e=w.xScreen-c[0]+w.dxScreen,g=w.yScreen-c[1]+w.dyScreen,d=e+w.width,t=g+w.height,q.isCircleOverlapingRect(f,h.x,h.y,e,g,d,t)))return!0;return!1};a.tileCoordChange=function(k,h,f,c,e,g){f-=e;if(0<=f)return(h>>f)+(c-(g<<f))*(k>>f);f=-f;return h-(g-(c<<f))*(k>>
f)<<f};a.writeOpacityToBuffers=function(k,h,f){for(const [v,m]of k.symbols){{var c=k,e=h,g=f,d=m;const r=c.layerData.get(v);if(r.type===b.BucketType.SYMBOL){for(const n of d){d=n.unique;var t=void 0;if(n.selectedForRendering){var w=d.parts[0];t=w.startOpacity;w=w.targetOpacity;c.allSymbolsFadingOut=c.allSymbolsFadingOut&&0===w;t=g?Math.floor(127*t)|w<<7:w?255:0;t|=t<<24|t<<16|t<<8}else t=0;for(const [u,x]of n.iconVertexRanges)for(w=u;w<u+x;w+=4)r.iconOpacity[w/4]=t;n.selectedForRendering?(t=d.parts[1],
d=t.startOpacity,t=t.targetOpacity,c.allSymbolsFadingOut=c.allSymbolsFadingOut&&0===t,d=g?Math.floor(127*d)|t<<7:t?255:0,t=d<<24|d<<16|d<<8|d):t=0;for(const [u,x]of n.textVertexRanges)for(d=u;d<u+x;d+=4)r.textOpacity[d/4]=t}r.lastOpacityUpdate=e;r.opacityChanged=!0}}}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/decluttering/core":function(){define(["exports"],function(a){class b{constructor(l,p){this.sourceTile=p;this.hash=this.yTile=this.xTile=
0;this.priority=1;this.featureIndex=0;this.colliders=[];this.textVertexRanges=[];this.iconVertexRanges=[];this.tile=l}}class q{constructor(){this.tileSymbols=[];this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}];this.show=!1}}a.VTLSymbol=b;a.VTLUniqueSymbol=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/decluttering/config":function(){define(["exports"],function(a){a.collisionGridCellSize=
32;a.declutterBudget=1.5;a.declutterTiles=!0;a.fadeDuration=200;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/TiledDisplayObject":function(){define(["exports","../../../../core/libs/gl-matrix-2/math/mat3","../DisplayObject","../../tiling/TileKey"],function(a,b,q,l){class p extends q.DisplayObject{constructor(k,h,f,c,e,g,d=e,t=g){super();this.tileDebugInfoTexture=null;this.debugInfo={display:{length:0,minOrderedLength:0,minUnorderedLength:0,triangleCount:0},
memory:{bytesUsed:0,bytesReserved:0}};this._destroyed=!1;this.key=new l(k);this.resolution=h;this.x=f;this.y=c;this.width=e;this.height=g;this.rangeX=d;this.rangeY=t}destroy(){this.tileDebugInfoTexture&&(this.tileDebugInfoTexture.dispose(),this.tileDebugInfoTexture=null);this._destroyed=!0}get debugSlot(){let k=this;for(;k.parent!==this._stage;){if(!k.parent)return 0;k=k.parent}return this._stage.children.indexOf(k)}setTransform(k){const h=this.resolution/(k.resolution*k.pixelRatio),f=this.transforms.tileMat3,
[c,e]=k.toScreenNoRotation([0,0],[this.x,this.y]);b.set(f,this.width/this.rangeX*h,0,0,0,this.height/this.rangeY*h,0,c,e,1);b.multiply(this.transforms.displayViewScreenMat3,k.displayViewMat3,f)}get destroyed(){return this._destroyed}}a.TiledDisplayObject=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/DisplayObject":function(){define(["exports","../../../core/Evented","../../../core/has","../../../core/promiseUtils"],function(a,b,q,l){class p extends b{constructor(){super(...arguments);
this._clips=this._fadeInResolver=this._fadeOutResolver=null;this.computedVisible=!0;this.computedOpacity=1;this._isReady=this.inFadeTransition=this.fadeTransitionEnabled=!1;this._opacity=1;this._stage=this.parent=null;this._visible=!0}get clips(){return this._clips}set clips(k){this._clips=k;this.requestRender()}get isReady(){return this._isReady}get opacity(){return this._opacity}set opacity(k){this._opacity!==k&&(this._opacity=Math.min(1,Math.max(k,0)),this.requestRender())}get stage(){return this._stage}set stage(k){if(this._stage!==
k){var h=this._stage;(this._stage=k)?this._stage?.untrashDisplayObject(this)||(this.onAttach(),this.emit("attach")):h?.trashDisplayObject(this)}}get transforms(){return this._getTransforms()}_getTransforms(){null==this._transforms&&(this._transforms=this._createTransforms());return this._transforms}get visible(){return this._visible}set visible(k){this._visible!==k&&(this._visible=k,this.requestRender())}get hasLabels(){return!1}get hasHighlight(){return!1}get hasBlending(){return!1}fadeIn(){if(this._fadeInResolver)return this._fadeInResolver.promise;
this._fadeOutResolver&&(this._fadeOutResolver(),this._fadeOutResolver=null);this.opacity=1;this.computedOpacity=0;this.fadeTransitionEnabled=!0;this._fadeInResolver=l.createResolver();this.requestRender();return this._fadeInResolver.promise}fadeOut(){if(this._fadeOutResolver)return this._fadeOutResolver.promise;this.opacity=0;this._fadeInResolver&&(this._fadeInResolver(),this._fadeInResolver=null);this.fadeTransitionEnabled=!0;this._fadeOutResolver=l.createResolver();this.requestRender();return this._fadeOutResolver.promise}endTransitions(){this._fadeInResolver?.();
this._fadeInResolver=null;this._fadeOutResolver?.();this._fadeOutResolver=null;this.computedOpacity=this.visible?this.opacity:0;this.requestRender()}beforeRender(k){this.updateTransitionProperties(k.deltaTime,k.state.scale);this.setTransform(k.state)}afterRender(k){this._fadeInResolver&&this.computedOpacity===this.opacity?(this._fadeInResolver(),this._fadeInResolver=null):this._fadeOutResolver&&0===this.computedOpacity&&(this._fadeOutResolver(),this._fadeOutResolver=null)}remove(){this.parent?.removeChild(this)}setTransform(k){}processRender(k){this.stage&&
this.computedVisible&&this.doRender(k)}requestRender(){this.stage&&this.stage.requestRender()}processDetach(){this._fadeInResolver&&(this._fadeInResolver(),this._fadeInResolver=null);this._fadeOutResolver&&(this._fadeOutResolver(),this._fadeOutResolver=null);this.onDetach();this.emit("detach")}updateTransitionProperties(k,h){const f=0===q("mapview-transitions-duration")?0:1/q("mapview-transitions-duration");if(this.fadeTransitionEnabled&&0!==f){h=this._fadeOutResolver||!this.visible?0:this.opacity;
const c=this.computedOpacity;c===h?this.computedVisible=this.visible:(k*=f,this.computedOpacity=c>h?Math.max(h,c-k):Math.min(h,c+k),this.computedVisible=0<this.computedOpacity,k=h===this.computedOpacity,this.inFadeTransition=!k,k||this.requestRender())}else this.computedOpacity=this.opacity,this.computedVisible=this.visible}onAttach(){}onDetach(){}doRender(k){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}}a.DisplayObject=p;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/support/ElevationUpdateEvent":function(){define(["exports","../../../geometry/support/aaBoundingRect"],function(a,b){class q{constructor(l="scene"){this.context=l;this.extent=b.empty()}}a.ElevationUpdateEvent=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/updatingProperties":function(){define(["exports"],function(a){a.updatingProgress={readOnly:!0,value:.5,get(){return this.updating?this.updatingProgressValue:1}};a.updatingProgressValue=
{value:.5,readOnly:!0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/ElevationBounds":function(){define(["exports"],function(a){class b{constructor(q=0,l=0){this.min=q;this.max=l;this.level=0;this.hasNoDataValues=!1}copyFrom(q){this.min=q.min;this.max=q.max;this.level=q.level;this.hasNoDataValues=q.hasNoDataValues}}a.ElevationBounds=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/ElevationData":function(){define(["exports",
"../../../core/mathUtils","../../../layers/support/ElevationSamplerData","../support/mathUtils","./TerrainConst"],function(a,b,q,l,p){class k{constructor(f,c,e){this.type="elevation";this.level=f[0];this.i=f[1];this.j=f[2];this.extent=c;this.samplerData=new q.ElevationSamplerData(e,c)}computeMinMaxValue(f,c,e,g){g.min=Infinity;g.max=-Infinity;g.hasNoDataValues=!1;f-=this.level;if(0>=f)return g;var d=2**f;if(Math.floor(c/d)!==this.i||Math.floor(e/d)!==this.j)return g;var t=Infinity,w=-Infinity,v=this.samplerData.data.width,
m=this.samplerData.data.values,r=.5*p.elevationNoDataValue;f=(v-1)/d;e=(e-this.j*d)*f;let n=(c-this.i*d)*f;if(1>f){const y=Math.floor(e),z=Math.floor(n);var u=y+z*v;c=m[u];d=m[u+1];var x=m[u+v];u=m[u+v+1];if(c+d+x+u<r)return t=e-y,r=n-z,w=l.bilerp(c,d,x,u,t,r),v=l.bilerp(c,d,x,u,t+f,r),m=l.bilerp(c,d,x,u,t,r+f),f=l.bilerp(c,d,x,u,t+f,r+f),g.min=Math.min(w,v,m,f),g.max=Math.max(w,v,m,f),g;e=y;n=z;f=1}else e=Math.floor(e),n=Math.floor(n),f=Math.ceil(f);for(c=e;c<=e+f;c++)for(d=n;d<=n+f;d++)x=m[c+d*
v],x<r?(t=Math.min(t,x),w=Math.max(w,x)):g.hasNoDataValues=!0;g.min=t;g.max=w;return g}}const h=.5*p.elevationNoDataValue;a.ElevationData=k;a.sampleElevation=function(f,c,e){if(null==e)return null;for(const v of e){if(!v)continue;var g=v.safeWidth;e=b.clamp(v.dy*(v.y1-c),0,g);g=b.clamp(v.dx*(f-v.x0),0,g);const m=Math.floor(e),r=Math.floor(g);var d=v.data.width,t=m*d+r,w=v.data.values;const n=w[t],u=w[t+1];t+=d;d=w[t];w=w[t+1];if(n+d+u+w<h)return e-=m,g-=r,f=n+(u-n)*g,f+(d+(w-d)*g-f)*e}return null};
Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/ElevationSamplerData":function(){define(["exports"],function(a){class b{constructor(q,l){this.data=q;this.safeWidth=.99999999*(q.width-1);this.dx=(q.width-1)/(l[2]-l[0]);this.dy=(q.width-1)/(l[3]-l[1]);this.x0=l[0];this.y1=l[3]}}a.ElevationSamplerData=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/ExtentHelper":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/projection ../../../geometry/support/aaBoundingRect ../../../layers/support/layerUtils ../../ViewingMode ./TerrainConst ./terrainUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(n,u){return null==n||n.spatialReference.equals(u)?n:c.projectWithoutEngine(n,n.spatialReference,u)}a.ExtentHelper=class extends q{constructor(n){super(n)}initialize(){this.addHandles([this.layerViews.on("change",()=>this.notifyChange("stencilEnabledExtents"))])}destroy(){}get layerViewsExtent(){return this._computeLayerViewsExtent()}get tiledLayersExtent(){return this._computeTiledLayersExtent()}get stencilEnabledExtents(){return this._computeStencilEnabledExtents()}_computeStencilEnabledExtents(){const n=
[];this.layerViews.forEach(u=>{u=u.layer;"operationalLayerType"in u&&g.isIntegratedMeshOperationalLayer(u.operationalLayerType)&&null!=this.viewSpatialReference&&(u=v(u.fullExtent,this.viewSpatialReference),null!=u&&n.push(e.fromExtent(u)))});return n}};b.__decorate([l.property({readOnly:!0})],a.ExtentHelper.prototype,"layerViewsExtent",null);b.__decorate([l.property({readOnly:!0})],a.ExtentHelper.prototype,"tiledLayersExtent",null);b.__decorate([l.property({readOnly:!0})],a.ExtentHelper.prototype,
"stencilEnabledExtents",null);b.__decorate([l.property()],a.ExtentHelper.prototype,"viewSpatialReference",void 0);b.__decorate([l.property()],a.ExtentHelper.prototype,"tilingScheme",void 0);b.__decorate([l.property()],a.ExtentHelper.prototype,"defaultTiledLayersExtent",void 0);b.__decorate([l.property({constructOnly:!0})],a.ExtentHelper.prototype,"layers",void 0);b.__decorate([l.property({constructOnly:!0})],a.ExtentHelper.prototype,"layerViews",void 0);a.ExtentHelper=b.__decorate([f.subclass("esri.views.3d.terrain.ExtentHelper")],
a.ExtentHelper);let m=class extends a.ExtentHelper{_computeLayerViewsExtent(){return this._globalExtent}_computeTiledLayersExtent(){return this._globalExtent}get _globalExtent(){return this.viewSpatialReference.isWebMercator?t.webMercatorWorldExtent:t.geographicWorldExtent}};m=b.__decorate([f.subclass("esri.views.3d.terrain.ExtentHelper.ExtentHelperGlobal")],m);let r=class extends a.ExtentHelper{_computeLayerViewsExtent(){const n=e.empty(),u=this.viewSpatialReference;this.layerViews.forEach(z=>{const A=
z.layer;!z.isResolved()||"graphics"===A.type&&A.internal||(z=v("fullExtentInLocalViewSpatialReference"in z&&z.fullExtentInLocalViewSpatialReference||z.layer.fullExtent,u),e.expand(n,z,n))});const x=e.allFinite(n)?n:null,y=this._get("layerViewsExtent");return e.equals(x,y)?y:x}_computeTiledLayersExtent(){const n=this.tilingScheme;if(!n)return null;const u=this.viewSpatialReference,x=e.empty();this.layers.forEach(A=>{if(A.loaded&&g.isTiledLayer(A)){var B=w.getTiledLayerInfo(A,u,d.ViewingMode.Local);
if(null!=B){var {tileInfo:C,fullExtent:D}=B;B="tilemapCache"in A?A.tilemapCache?.effectiveMaxLOD:void 0;null!=C&&null!=D&&(w.isProjectableRasterLayer(A)||n.compatibleWith(C,B)&&D.spatialReference.equals(n.spatialReference))&&e.expand(x,D,x)}}});e.expand(x,this.defaultTiledLayersExtent,x);const y=e.allFinite(x)?x:null,z=this._get("tiledLayersExtent");return e.equals(y,z)?z:y}};r=b.__decorate([f.subclass("esri.views.3d.terrain.ExtentHelper.ExtentHelperLocal")],r);a.create=function(n,u){return n===d.ViewingMode.Global?
new m(u):new r(u)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/terrainUtils":function(){define("exports ../../../core/Collection ../../../geometry/support/spatialReferenceUtils ../../../layers/support/layerUtils ../../ViewingMode ./NeighborIndex ./TerrainData ../../../chunks/terrainUtilsPlanar ../../../chunks/terrainUtilsSpherical".split(" "),function(a,b,q,l,p,k,h,f,c){function e(A){return"imagery-tile"===A?.type||"wcs"===A?.type}function g(A){return"imagery-tile-3d"===
A?.type}function d(A){return"tile-3d"===A?.type}function t(A){return"vector-tile-3d"===A?.type}function w(A){return"wmts-3d"===A?.type}function v(A){return"elevation-3d"===A?.type}function m(A){return A&&(d(A)||g(A)||t(A)||w(A))}function r(A){return h.isVectorTile(A?.data)}function n(A,B,C,D,F){return y[D].checkIfTileInfoSupportedForViewSR(A,C,B,F)}function u(A,B,C){A=l.getTileMaxtrixSetFromActiveLayer(A);if(null!=A)if(b.isCollection(A)){if(A=A.find(D=>null==n(D.tileInfo,D.fullExtent,B,C)))return{tileInfo:A.tileInfo,
fullExtent:A.fullExtent}}else return{tileInfo:A.tileInfo,fullExtent:A.fullExtent};return{tileInfo:null,fullExtent:null}}function x(A){return A.isWGS84||A.isWebMercator||q.isCGCS2000(A)||!q.isEarth(A)}const y={[p.ViewingMode.Global]:c.terrainUtilsSpherical,[p.ViewingMode.Local]:f.terrainUtilsPlanar};a.enableTerrainInternalChecks=!1;a.enableWaterproofTests=!1;const z={force512VTL:!1};f=[k.NeighborIndex.NORTH,k.NeighborIndex.EAST,k.NeighborIndex.SOUTH,k.NeighborIndex.WEST];c=[k.NeighborIndex.NORTH_EAST,
k.NeighborIndex.SOUTH_EAST,k.NeighborIndex.SOUTH_WEST,k.NeighborIndex.NORTH_WEST];a.almostEquals=function(A,B,C=1E-5){return Math.abs(A-B)<C};a.checkIfTileInfoSupportedForView=n;a.enableInternalTerrainChecks=function(A){a.enableTerrainInternalChecks=A};a.enableTerrainWaterproofChecks=function(A){a.enableWaterproofTests=A;a.enableTerrainInternalChecks=a.enableTerrainInternalChecks||A};a.eps=1E-5;a.getLayerWithExtentRange=function(A){return g(A)?{fullExtent:A.fullExtent,minScale:A.layer.minScale,maxScale:A.layer.maxScale,
tilemapCache:null}:A.layer};a.getTileInfoAndExtentFromWMTSLayer=u;a.getTiledLayerInfo=function(A,B,C){var D=null,F=null;"wmts"===A?.type?(F=u(A,B,C),D=F.tileInfo,F=F.fullExtent):(F=e(A)?A.getCompatibleFullExtent(B):A.fullExtent,D=C===p.ViewingMode.Local,D=e(A)?A.getCompatibleTileInfo(B,F,D):"vector-tile"===A?.type?D&&!x(B)||z.force512VTL?A.tileInfo:A.tileInfo.getCompatibleForVTL(256):A.tileInfo);A="tilemapCache"in A?A.tilemapCache?.effectiveMaxLOD:void 0;return null!=D&&null!=F&&null==n(D,F,B,C,A)?
{tileInfo:D,fullExtent:F}:null};a.internalAssert=function(A,B){if(a.enableTerrainInternalChecks&&!A)throw A=Error().stack?.slice(5),console.warn("Terrain internal: "+(B??"")+" at "+A),Error("Assertion failed"+(B?": "+B:""));};a.isBlendableLayerView=function(A){return A&&(d(A)||w(A)||g(A)||t(A))};a.isEast=function(A){return A===k.NeighborIndex.NORTH_EAST||A===k.NeighborIndex.EAST||A===k.NeighborIndex.SOUTH_EAST};a.isElevationLayer=function(A){return"elevation"===A?.type};a.isElevationLayerView=v;a.isGroupLayerView=
function(A){return"group"===A?.type};a.isImageSourceRenderInfo=function(A){A=A?.sourceLayerInfo?.data;return h.isImageWithType(A)||A instanceof HTMLImageElement||A instanceof HTMLCanvasElement||A instanceof ImageData};a.isImageryTileLayerView=g;a.isImageryTileRenderInfo=function(A){return h.isRasterTile(A?.sourceLayerInfo?.data)};a.isMapTileLayerView=m;a.isNorth=function(A){return A===k.NeighborIndex.NORTH_EAST||A===k.NeighborIndex.NORTH||A===k.NeighborIndex.NORTH_WEST};a.isNorthCorner=function(A){return A===
k.NeighborIndex.NORTH_WEST||A===k.NeighborIndex.NORTH_EAST};a.isProjectableRasterLayer=e;a.isSouth=function(A){return A===k.NeighborIndex.SOUTH_EAST||A===k.NeighborIndex.SOUTH||A===k.NeighborIndex.SOUTH_WEST};a.isSurfaceLayerView=function(A){return m(A)||v(A)};a.isTextureTileRenderInfo=function(A){return h.isTileTexture(A?.sourceLayerInfo?.data)};a.isTileLayerView=d;a.isVectorTileLayerView=t;a.isVectorTilePerLayerInfo=r;a.isVectorTileRenderInfo=function(A){return r(A?.sourceLayerInfo)||!!A?.isVTLBackground};
a.isWMTSLayerView=w;a.isWest=function(A){return A===k.NeighborIndex.NORTH_WEST||A===k.NeighborIndex.WEST||A===k.NeighborIndex.SOUTH_WEST};a.isWestCorner=function(A){return A===k.NeighborIndex.NORTH_WEST||A===k.NeighborIndex.SOUTH_WEST};a.lij2s=function(A){return"["+A[0]+","+A[1]+","+A[2]+"]"};a.neighborCornerIndices=c;a.neighborEdgeIndices=f;a.oppositeCorner=function(A){return A===k.NeighborIndex.NORTH_EAST?k.NeighborIndex.SOUTH_WEST:A===k.NeighborIndex.NORTH_WEST?k.NeighborIndex.SOUTH_EAST:A===k.NeighborIndex.SOUTH_WEST?
k.NeighborIndex.NORTH_EAST:k.NeighborIndex.NORTH_WEST};a.oppositeEdge=function(A){return A===k.NeighborIndex.NORTH?k.NeighborIndex.SOUTH:A===k.NeighborIndex.EAST?k.NeighborIndex.WEST:A===k.NeighborIndex.SOUTH?k.NeighborIndex.NORTH:k.NeighborIndex.EAST};a.releaseTerrainData=function(A){null!=A&&"release"in A&&A.release();return null};a.test=z;a.useFetchTileForLayer=function(A){return A.fetchTile&&!1!==A.hasOverriddenFetchTile};a.v32s=function(A){return"("+A[0]+","+A[1]+","+A[2]+")"};a.vtlAssumes256PixelSizeAsDefault=
x;a.weakAssert=function(A,B){A||console.warn("Terrain: "+B)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/NeighborIndex":function(){define(["exports"],function(a){a.NeighborIndex=void 0;var b=a.NeighborIndex||(a.NeighborIndex={});b[b.NORTH=0]="NORTH";b[b.NORTH_EAST=1]="NORTH_EAST";b[b.EAST=2]="EAST";b[b.SOUTH_EAST=3]="SOUTH_EAST";b[b.SOUTH=4]="SOUTH";b[b.SOUTH_WEST=5]="SOUTH_WEST";b[b.WEST=6]="WEST";b[b.NORTH_WEST=7]="NORTH_WEST";Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/chunks/terrainUtilsPlanar":function(){define("exports ../core/Error ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../geometry/support/aaBoundingRect ../views/3d/support/supportedSpatialReference ../views/3d/terrain/TerrainConst ../views/3d/terrain/TilingScheme".split(" "),function(a,b,q,l,p,k,h,f){function c(r,n,u=0){r=r.extent;return null==r?!1:0===u?p.containsPoint(r,n):p.containsPointWithMargin(r,n,u*Math.min(r[2]-r[0],r[3]-r[1]))}function e(r,n,u,x){q.copy(t,u);
t[x]=n[x];x=q.subtract(t,t,n);var y=q.subtract(w,r,n);y=q.dot(y,x);const z=q.dot(x,x);n=0>=y?n:z<=y?u:q.add(t,n,q.scale(x,x,y/z));r=q.subtract(t,r,n);return Math.PI/2-Math.atan(r[2]/Math.sqrt(r[0]*r[0]+r[1]*r[1]))}function g(r,n,u){r=r.extent;if(null==r)return 0;v[0]=r[0];v[1]=r[1];v[2]=u;m[0]=r[2];m[1]=r[3];m[2]=u;r=u=Infinity;n[0]<v[0]?u=e(n,v,m,0):n[0]>m[0]&&(u=e(n,m,v,0));n[1]<v[1]?r=e(n,v,m,1):n[1]>m[1]&&(r=e(n,m,v,1));return Math.min(u,r)}function d(r,n,u,x){if(null==r)return f.getMissingTileInfoError();
x=r.spatialReference;if(x.isGeographic&&!k.isSupportedEarthGCS(x))return new b("tilingscheme:local-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in local scenes");var y=f.TilingScheme.checkUnsupported(r);if(null!=y)return y;if(null==u)return new b("tilingscheme:extent-not-exist","The layer does not provide a layer extent.");{var z=r.lods;y=z[0].resolution*2**z[0].level;var A=[y*r.size[0],y*r.size[1]];const B=[r.origin.x,r.origin.y];u=p.fromExtent(u);const C=
p.create();f.TilingScheme.computeRowColExtent(u,A,B,C);A=(C[2]-C[0])*(C[3]-C[1]);A>h.maxRootTiles?(z=z[0].scale*2**z[0].level,r=Math.max((u[3]-u[1])/r.size[1],(u[2]-u[0])/r.size[0])*z/y,y=Math.floor(Math.log(r)/Math.log(10)),r=Math.ceil(r/10**y)*10**y,r=new b("tilingscheme:too-many-root-tiles","Scale of level 0 of the tiling scheme (1:"+Math.floor(z).toLocaleString()+") is too large for the layer's extent. Suggested scale: 1:"+r.toLocaleString()+".",{level0Scale:z,suggestedLevel0Scale:r,requiredNumRootTiles:A,
allowedNumRootTiles:h.maxRootTiles})):r=null}return r?r:null==n||x.equals(n)||n.isWGS84&&x.isWebMercator?null:new b("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the local scene")}const t=l.create(),w=l.create(),v=l.create(),m=l.create();l=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:d,isInsideExtent:c,tiltToExtentEdge:g},Symbol.toStringTag,{value:"Module"}));a.checkIfTileInfoSupportedForViewSR=d;a.isInsideExtent=
c;a.terrainUtilsPlanar=l;a.tiltToExtentEdge=g})},"esri/views/3d/support/supportedSpatialReference":function(){define(["exports","../../../geometry/support/spatialReferenceUtils"],function(a,b){function q(l){return b.isWGS84(l)||b.isCGCS2000(l)}a.isSupportedEarthGCS=q;a.isSupportedGCSOnGlobe=function(l){return q(l)||b.isMars(l)||b.isMoon(l)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/terrainUtilsSpherical":function(){define(["exports","../core/Error","../views/3d/support/supportedSpatialReference",
"../views/3d/terrain/TilingScheme"],function(a,b,q,l){function p(){return!0}function k(){return 0}function h(c,e,g,d){if(null==c)return l.getMissingTileInfoError();g=c?.lods.length-1;const t=c.spatialReference;if(t.isWebMercator){if(!l.TilingScheme.makeWebMercatorAuxiliarySphere(g).compatibleWith(c,d))return new b("tilingscheme:incompatible-global-web-mercator","The tiling scheme is not compatible with the ArcGIS Online Web Mercator tiling scheme")}else if(q.isSupportedGCSOnGlobe(t)){if(!l.TilingScheme.makeGCSWithTileSize(c.spatialReference,
c.size[0],g).compatibleWith(c,d))return c.spatialReference.isWGS84?new b("tilingscheme:incompatible-global-wgs84","The tiling scheme is not compatible with the ArcGIS Online WGS84 tiling scheme"):new b("tilingscheme:incompatible-global","The tiling scheme is not compatible with the ArcGIS Online tiling scheme")}else return new b("tilingscheme:global-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in global scenes");return null==e||c.spatialReference.equals(e)?
null:new b("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the global scene")}const f=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:h,isInsideExtent:p,tiltToExtentEdge:k},Symbol.toStringTag,{value:"Module"}));a.checkIfTileInfoSupportedForViewSR=h;a.isInsideExtent=p;a.terrainUtilsSpherical=f;a.tiltToExtentEdge=k})},"esri/views/3d/terrain/OverlayManager":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Cyclical ../../../core/has ../../../core/mathUtils ../../../core/maybe ../../../core/reactiveUtils ../../../core/time ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/vec2 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../chunks/vec42 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../geometry/ellipsoidUtils ../../../geometry/projection/projectVectorToVector ../../../geometry/support/aaBoundingRect ../../../geometry/support/ray ../../../chunks/sphere ../../../geometry/support/vector ../../../geometry/support/webMercatorUtils ../state/utils/viewUtils ../support/debugFlags ../support/debugUtils ./interfaces ./OverlayRenderer ../webgl-engine/lib/basicInterfaces ../webgl-engine/lib/Intersector ../webgl-engine/lib/LocalOriginFactory ../webgl-engine/lib/Material ../webgl-engine/lib/SortedRenderGeometryRenderer ../webgl-engine/lib/textureUtils ../webgl-engine/parts/requireUtils ../../support/Scheduler ../../support/Yield".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R){const Q=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let W;a.OverlayManager=class extends q{constructor(ca){super(ca);this._renderSR=this._spatialReference=null;this._overlaySREqualsRenderSR=!0;this._drapeSources=new Set;this._drapeTargets=new Set;this._drawTexturesAnimateDirty=this._drawTexturesDirty=this._contentUpdated=
this._placementDirty=!1;this._longitudeCyclical=null;this._latestOriginId=0;this._maxResolution=p("esri-mobile")?2048:4096;this._animationTimeLast=0}initialize(){const ca=this.view;this.renderer=new E.OverlayRenderer({view:ca,worldToPCSRatio:this._worldToPCSRatio,spatialReference:this._spatialReference});ca._stage.renderer.plugins.add(this.renderer);const ea=()=>this.setDrawTexturesDirty();this._groundIntersector=I.newIntersector(this.view.state.viewingMode);this._groundIntersector.options.backfacesTerrain=
!0;this._groundIntersector.options.invisibleTerrain=!0;this._groundIntersector.options.hud=!1;this.addHandles([f.watch(()=>this.renderer.hasHighlights,ea),this.renderer.events.on("has-water",da=>ca._stage?.renderer.setParameters({hasOverlayWater:da})),this.renderer.events.on("content-changed",ea),f.watch(()=>ca.state.camera.pixelRatio,ea),f.watch(()=>ca.state.alignPixelEnabled,ea),this.renderer.events.on("textures-disposed",()=>this.surface.requestRender()),f.watch(()=>[ca.pointsOfInterest?.renderPointOfView,
ca.pointsOfInterest?.centerOnSurfaceFrequent?.location],()=>this.setPlacementDirty()),f.watch(()=>[ca.state?.pixelRatio,ca.state?.contentPixelRatio],()=>this.setPlacementDirty(),f.sync),this.surface.on("elevation-change",()=>this.setPlacementDirty()),ca.on("resize",()=>this.setPlacementDirty()),ca.resourceController.scheduler.registerTask(J.TaskPriority.OVERLAY,this),ca._stage.renderView.events.on("force-camera-for-screenshot",da=>{this._updateOverlays(J.noBudget,da.camera,G.RenderRequestType.BACKGROUND);
this.renderer.hasOverlays&&this._drawOverlays(G.RenderRequestType.BACKGROUND,da)})]);ca._stage.renderer.renderOverlay=da=>this._renderOverlay(da)}destroy(){this.view?._stage&&(this.view._stage.renderer.plugins.remove(this.renderer),this.view._stage.renderer.renderOverlay=()=>{});W&&(W.hide(),W=null);this.renderer=h.destroyMaybe(this.renderer)}get running(){return this._placementDirty&&(0<this._drapeSources.size||0<this.view.graphics.length||F.debugFlags.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&
!this.suspended&&this.surface.ready}get _isSpherical(){return this.view.state.isGlobal}get _worldToPCSRatio(){return null!=this._spatialReference&&this._spatialReference.isGeographic&&!this.view.state.isLocal?u.getReferenceEllipsoid(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return 1.3/this.view.resolutionScale}get suspended(){return this.surface.suspended}get updating(){return this.running||this.renderer.updating||this._contentUpdated}get rendersOccludedDraped(){return this.renderer.rendersOccludedDraped}_renderOverlay(ca){this._contentUpdated=
!1;this.renderer.processSyncDrapeSources();if(this.renderer.hasOverlays)return this._dispatchAnimationUpdate(ca),this._drawOverlays(G.RenderRequestType.UPDATE,this.view.state)}get hasOverlays(){return this.renderer.hasOverlays}setSpatialReference(ca){this._spatialReference=ca;this.renderer.spatialReference=ca;this._longitudeCyclical=null;const ea=this.view.renderSpatialReference;null!=ca&&null!=ea?(this._renderSR=ea,this._overlaySREqualsRenderSR=ca.equals(this._renderSR),this._isSpherical&&(this._longitudeCyclical=
ca.isWebMercator?new l.Cyclical(-2.0037508342787E7,2.0037508342787E7):new l.Cyclical(-180,180),this.renderer.longitudeCyclical=this._longitudeCyclical),this.renderer&&(this.renderer.worldToPCSRatio=this._worldToPCSRatio)):this.renderer.disposeOverlays()}registerDrapeSource(ca,ea,da){this._drapeSources.add(ca);this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources);ea=this.renderer.createDrapeSourceRenderer(ca,ea,da);this._updateDrapeSourceExtent(ca);this._setContentDirty();this.notifyChange("running");
return ea}registerGeometryDrapeSource(ca){return this.registerDrapeSource(ca,P.SortedRenderGeometryRenderer)}_updateDrapeSourceExtent(ca){2===this.renderer.overlays.length&&null!=ca.setDrapingExtent&&null!=this._spatialReference&&ca.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(ca){this._drapeSources.has(ca)&&(this._drapeSources.delete(ca),this.renderer.removeDrapeSourceRenderer(ca),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),
this.notifyChange("running"))}registerDrapeTarget(ca){this._drapeTargets.add(ca);this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(ca){this._drapeTargets.delete(ca);this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty();this.setDrawTexturesDirty()}setPlacementDirty(){this._placementDirty=!0}runTask(ca){return this._updateOverlays(ca,this.view.state.contentCamera,G.RenderRequestType.UPDATE)}_updateOverlays(ca,ea,da){if(!this._spatialReference)return R.Yield;
var ia=this._computeOverlayResolution(ea);this._computeOverlayExtents(ea,ia,Y);this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,Y.stretch);ea=this._updateOverlay(N.OverlayIndex.INNER,Y.inner,ia,1*Y.pixelRatioAdjustment,Y.mapUnitsPerPixel);const ka=y.width(Y.inner)/y.width(Y.outer);ia=this._updateOverlay(N.OverlayIndex.OUTER,Y.outer,ia,ka*Y.pixelRatioAdjustment,Y.mapUnitsPerPixel);if(ea===Z.EXTENT||ia===Z.EXTENT)this._drapeSources.forEach(fa=>this._updateDrapeSourceExtent(fa)),this.surface.updateTileOverlayParams(da);
ea===Z.NONE&&ia===Z.NONE||this.setDrawTexturesDirty();this._placementDirty=!1;ca.madeProgress()}_computeOverlayResolution(ca){const ea=this.view.state.contentPixelRatio*this.view.resolutionScale;return Math.min(M.applyTextureResizeModulo(Math.ceil(1.5*Math.max(ca.fullWidth/ca.pixelRatio*ea,ca.fullHeight/ca.pixelRatio*ea))),this._maxResolution)}_updateOverlay(ca,ea,da,ia,ka){if(0===this.renderer.overlays.length)return Z.NONE;ca=this.renderer.overlays[ca];const fa=ca.mapUnitsPerPixel;ca.mapUnitsPerPixel=
ka;ca.pixelRatio=ia;ia=ca.extent;const X=F.debugFlags.TESTS_DISABLE_OPTIMIZATIONS?0:1E-5*Math.max(ea[2]-ea[0],ea[3]-ea[1],ia[2]-ia[0],ia[3]-ia[1]);if(Math.abs(ia[0]-ea[0])<=X&&Math.abs(ia[1]-ea[1])<=X&&Math.abs(ia[2]-ea[2])<=X&&Math.abs(ia[3]-ea[3])<=X&&da===ca.resolution)return fa===ka?Z.NONE:Z.RERENDER_ONLY;y.copy(ca.extent,ea);ca.resolution=da;ea=y.center(ca.extent);ca.renderLocalOrigin=O.fromValues(ea[0],ea[1],0,`OV_${this._latestOriginId++}`);return Z.EXTENT}setTileParameters(ca){const ea=ca.renderData.overlay;
if(0<this.renderer.overlays.length){const da=this.renderer.overlays[N.OverlayIndex.INNER],ia=this.renderer.overlays[N.OverlayIndex.OUTER];ca=ca.extent;this._rectInsideRect(da.extent,ca)||this._rectanglesOverlap(ca,da.extent)||this._rectanglesOverlap(ca,ia.extent)?(this._setTileOverlayData(ca,N.OverlayIndex.INNER,ea),this._setTileOverlayData(ca,N.OverlayIndex.OUTER,ea)):(this._clearTileOverlayData(N.OverlayIndex.INNER,ea),this._clearTileOverlayData(N.OverlayIndex.OUTER,ea))}else this._clearTileOverlayData(N.OverlayIndex.INNER,
ea),this._clearTileOverlayData(N.OverlayIndex.OUTER,ea)}overlayPixelSizeInMapUnits(ca,ea){if(0===this.renderer.overlays.length)return ea();ea=this.renderer.overlays[N.OverlayIndex.INNER];const da=this.renderer.overlays[N.OverlayIndex.OUTER];ca=this._pointIsInExtent(ca,ea.extent)?ea:da;return(ca.extent[2]-ca.extent[0])/ca.resolution}_setTileOverlayData(ca,ea,da){if(0!==this.renderer.overlays.length){var ia=this.renderer.overlays[ea].extent,ka=y.width(ia),fa=y.height(ia),X=ca[0];if(this._longitudeCyclical){X=
this._longitudeCyclical.minimalMonotonic(ia[0],X);const ja=this._longitudeCyclical.minimalMonotonic(ia[0],ca[2]);X>ja&&(X=ja-(ca[2]-ca[0]))}da.setScale(ea,y.width(ca)/ka,y.height(ca)/fa);da.setOffset(ea,(X-ia[0])/ka,(ca[1]-ia[1])/fa)}}_clearTileOverlayData(ca,ea){ea.setScale(ca,-1,-1);ea.setOffset(ca,-1,-1)}async reloadShaders(){K.removeLoadedShaderModules();await this.renderer.reloadShaders();this.setDrawTexturesDirty();this.runTask(J.noBudget)}_dispatchAnimationUpdate(ca){var ea=c.Milliseconds(ca-
this._animationTimeLast);if(ea>=this.surface.view._stage.renderer.animationTimestep||null!=this.view.state.forcedAnimationTime||this._drawTexturesDirty||this._drawTexturesAnimateDirty)ea=c.Milliseconds(ea/this.surface.view._stage.renderer.animationTimeDilation),ea=new L.UpdateParameters(this.view.state.camera,ea,this.view.state.forcedAnimationTime),this.renderer.updateAnimation(ea)&&(this._drawTexturesAnimateDirty=!0),this._animationTimeLast=ca}setDrawTexturesDirty(){this.renderer.hasOverlays?(this._drawTexturesDirty=
this._contentUpdated=!0,this.view._stage.renderView.requestRender()):this.setPlacementDirty()}_intersectGroundFromView(ca,ea,da,ia){da=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(ca,U,ea,da);if(null==da)return!1;ea=da.origin;da=v.add(T,da.origin,da.direction);this._groundIntersector.reset(ea,da,ca);this._groundIntersector.intersect([]);this.view.basemapTerrain.intersect(this._groundIntersector,null,ea,da);return this._groundIntersector.results.min.getIntersectionPoint(ia)}_findHorizonBasedPointOfInterest(ca,
ea){var da=.5;da=this.view.renderCoordsHelper.getAltitude(ca.eye);const ia=this.view.pointsOfInterest.centerOnSurfaceFrequent;var ka=k.clamp(ia.estimatedSurfaceAltitude,ca.aboveGround?-Infinity:da+1E-5,ca.aboveGround?da-1E-5:Infinity);da=ca.aboveGround;if("global"===this.view.viewingMode){var fa=T;A.closestPointOnSilhouette(A.fromRadius(A.tmpSphere,u.getReferenceEllipsoid(this.view.spatialReference).radius+ka),z.wrap(ca.eye,ca.viewForward),fa);v.subtract(fa,fa,ca.eye);ka=l.cyclicalPI.normalize(B.angleAroundAxis(ca.viewForward,
fa,ca.viewRight))/ca.fovY+.5;fa=0>=ka||1<=ka?.5:.55;da=da?fa*ka:ka+fa*(1-ka)}else ka=n.fromValues(0,Math.tan(.5*Math.PI-Math.acos(-ca.viewForward[2])),1,0),ka=r.transformMat4(ka,ka,ca.projectionMatrix)[1],ka=k.clamp(.5+.5*ka,0,1),da=1===ka||0===ka?.5:da?.55*ka:1-.55*(1-ka);return this._intersectGroundFromView(ca,.5,da,ea)?v.sqrDist(ea,ca.eye)<ia.distance*ia.distance:!1}_computeOverlayExtents(ca,ea,da){var ia=this.view.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;const ka=m.create();this._findHorizonBasedPointOfInterest(ca,
ka)||v.copy(ka,ia);F.debugFlags.OVERLAY_SHOW_CENTER?(null==W&&(W=new H.PointGraphics(this.view.graphics,"red")),W.show(ka,this._renderSR)):null!=W&&W.hide();var fa=Math.max(.1,v.distance(ca.eye,ka));const X=D.viewAngle(this.view.renderCoordsHelper,ia,ca.eye);this._overlaySREqualsRenderSR||x.projectVectorToVector(ka,this._renderSR,ka,this._spatialReference);ia=this.surface.extent;var ja=!this._isSpherical&&this._spatialReference?.isGeographic,la=ja&&this._spatialReference?1/u.getReferenceEllipsoid(this._spatialReference).metersPerDegree:
1;fa=ca.perScreenPixelRatio/this.view.state.contentPixelRatio*fa*la;da.mapUnitsPerPixel=fa/this._worldToPCSRatio;da.stretch=this._overlayStretch;fa=ea*fa/2*da.stretch;var na=!1;ja=ja?90:Infinity;this._isSpherical&&ia&&this._spatialReference&&(this._spatialReference.isWebMercator?(fa/=Math.cos(C.y2lat(ka[1])),ja=ia[3]):(na=!0,fa/=u.getReferenceEllipsoid(this._spatialReference).metersPerDegree,ja=90),fa>=ja&&(fa=ja,ka[1]=0,this._spatialReference.isWebMercator&&(ka[0]=0)));la=1;na&&(la=1/Math.max(.2,
Math.cos(Math.abs(k.deg2rad(ka[1])))),180<fa*la&&(la=180/fa),da.mapUnitsPerPixel*=la);na=Math.log(2)/12;fa=Math.exp(Math.round(Math.log(fa)/na)*na);const va=fa*la;na=.5*ea/(32*va);var za=.5*ea/(32*fa);ka[0]=Math.round(ka[0]*na)/na;ka[1]=Math.round(ka[1]*za)/za;na=da.inner;na[0]=ka[0]-va;na[1]=ka[1]-fa;na[2]=ka[0]+va;na[3]=ka[1]+fa;this._isSpherical&&this._shiftExtentToFitBounds(na,Infinity,ja);za=da.outer;6*va>y.width(ia)?y.copy(za,ia):Math.PI/2-Math.abs(X-Math.PI/2)<=.25*Math.PI?(za[0]=na[0]-va,
za[1]=na[1]-fa,za[2]=na[2]+va,za[3]=na[3]+fa):(x.projectVectorToVector(ca.eye,this._renderSR,T,this._spatialReference),w.subtract(V,ka,T),ca=-Math.atan2(V[1],V[0])+.125*Math.PI,0>ca&&(ca+=2*Math.PI),r.scale(V,Q[Math.floor(ca/(.25*Math.PI))],2*fa),V[0]*=la,V[2]*=la,r.add(za,na,V));this._isSpherical?(za[0]=this._longitudeCyclical.clamp(za[0]),za[2]=this._longitudeCyclical.clamp(za[2]),za[1]=Math.max(za[1],-ja),za[3]=Math.min(za[3],ja)):(ca=y.intersection(na,ia,ha),ia=y.intersection(za,ia,ba),y.contains(ca,
ia)&&(za[2]=za[0],za[3]=za[1]));ea=Math.abs(na[2]-na[0])/ea;da.mapUnitsPerPixel=Math.max(da.mapUnitsPerPixel,ea);da.pixelRatioAdjustment=da.mapUnitsPerPixel/ea}_drawOverlays(ca,ea){if(this.renderer.hasOverlays){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;var da=this._drawTexturesDirty;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;var ia=this.renderer.computeValidity();this.renderer.releaseRenderTargets();this.renderer.drawOverlays(ea);ea=this.renderer.computeValidity();
ia!==ea&&this.surface.updateTileOverlayParams(G.RenderRequestType.UPDATE);da?(this.surface.requestRender(ca),ca===G.RenderRequestType.UPDATE&&this.surface.requestUpdate()):this.surface.requestRender(G.RenderRequestType.BACKGROUND);return this.renderer}}_rectanglesOverlap(ca,ea){return null==ca?!1:this._longitudeCyclical?(this._longitudeCyclical.contains(ea[0],ea[2],ca[0])||this._longitudeCyclical.contains(ea[0],ea[2],ca[2])||this._longitudeCyclical.contains(ca[0],ca[2],ea[0]))&&!(ca[1]>ea[3]||ca[3]<
ea[1]):y.intersects(ca,ea)}_rectInsideRect(ca,ea){return null==ea?!1:this._longitudeCyclical?this._longitudeCyclical.contains(ca[0],ca[2],ea[0])&&this._longitudeCyclical.contains(ca[0],ca[2],ea[2])&&ea[1]>ca[1]&&ea[3]<ca[3]:y.contains(ca,ea)}_pointIsInExtent(ca,ea){if(this._longitudeCyclical)return this._longitudeCyclical.contains(ea[0],ea[2],ca.x)&&ca.y>=ea[1]&&ca.y<=ea[3];const da=ca.x;ca=ca.y;return da>ea[0]&&da<ea[2]&&ca>ea[1]&&ca<ea[3]}_shiftExtentToFitBounds(ca,ea,da){let ia=0,ka=0;ca[0]<-ea?
ia=ca[0]+ea:ca[2]>ea&&(ia=ea-ca[2]);ca[1]<-da?ka=ca[1]+da:ca[3]>da&&(ka=da-ca[3]);y.offset(ca,ia,ka)}get test(){}};b.__decorate([e.property()],a.OverlayManager.prototype,"_spatialReference",void 0);b.__decorate([e.property({readOnly:!0})],a.OverlayManager.prototype,"running",null);b.__decorate([e.property()],a.OverlayManager.prototype,"_placementDirty",void 0);b.__decorate([e.property()],a.OverlayManager.prototype,"_contentUpdated",void 0);b.__decorate([e.property()],a.OverlayManager.prototype,"_isSpherical",
null);b.__decorate([e.property()],a.OverlayManager.prototype,"_worldToPCSRatio",null);b.__decorate([e.property()],a.OverlayManager.prototype,"renderer",void 0);b.__decorate([e.property({constructOnly:!0})],a.OverlayManager.prototype,"view",void 0);b.__decorate([e.property({constructOnly:!0})],a.OverlayManager.prototype,"surface",void 0);b.__decorate([e.property()],a.OverlayManager.prototype,"suspended",null);b.__decorate([e.property()],a.OverlayManager.prototype,"updating",null);b.__decorate([e.property({type:Boolean})],
a.OverlayManager.prototype,"rendersOccludedDraped",null);a.OverlayManager=b.__decorate([t.subclass("esri.views.3d.terrain.OverlayManager")],a.OverlayManager);class S{constructor(){this.inner=y.create();this.outer=y.create();this.mapUnitsPerPixel=0;this.pixelRatioAdjustment=1;this.stretch=1.3}}const V=n.create(),T=m.create(),Y=new S,ha=y.create(),ba=y.create(),U=z.create();var Z;(function(ca){ca[ca.NONE=0]="NONE";ca[ca.EXTENT=1]="EXTENT";ca[ca.RERENDER_ONLY=2]="RERENDER_ONLY"})(Z||={});Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/parts/requireUtils":function(){define(["exports"],function(a){a.removeLoadedShaderModules=function(){const b=globalThis.require?.modules;if(b){const q=Object.keys(b);for(const l of q)l.includes(".glsl")&&delete b[l]}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/PlanarPatch":function(){define("exports ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/SpatialReference ../../../geometry/projection/projectVectorToVector ../../../geometry/support/aaBoundingBox ../../../geometry/support/aaBoundingRect ../../../geometry/support/spatialReferenceUtils ./PatchGeometryFactory ./Tile ./TileFrustumVisibility ../webgl-engine/lib/RayIntersections".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){class d extends c.Tile{constructor(w,v,m,r,n){super();this._horizontalScaleFactor=1;this._extentInRenderSR=k.create();this._baseUsedMemory=900;this._subtreeGeometryElevationBoundMax=this._subtreeGeometryElevationBoundMin=0;this.init(w,v,m,r,n)}init(w,v,m,r,n){super.init(w,v,m,r,n);w=n.view.renderSpatialReference;v=n.spatialReference;this._horizontalScaleFactor=w=null!=w&&h.isPlateCarree(w)&&null!=v&&v.isGeographic?this.ellipsoid.radius*Math.PI/180:1;({isWebMercatorOnPlateCarree:m}=
n);n=this._extentInRenderSR;v=this.extent;if(m)w=b.fromValues(v[0],v[1],0),l.projectVectorToVector(w,q.WebMercator,w,q.PlateCarree),v=b.fromValues(v[2],v[3],0),l.projectVectorToVector(v,q.WebMercator,v,q.PlateCarree),n[0]=w[0],n[1]=w[1],n[2]=v[0],n[3]=v[1];else for(m=0;4>m;++m)n[m]=v[m]*w;this.centerAtSeaLevel[0]=.5*(n[0]+n[2]);this.centerAtSeaLevel[1]=.5*(n[1]+n[3]);this.centerAtSeaLevel[2]=0;this._edgeLen=Math.max(n[2]-n[0],n[3]-n[1]);this._edgeLen2=this._edgeLen*this._edgeLen;this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateCenter();
var w=this._extentInRenderSR;const v=.5*(w[2]-w[0]);w=.5*(w[3]-w[1]);this._center[c.CenterPosition.MIDDLE][3]=Math.max(Math.sqrt(v*v+w*w),.5*(this.elevationBoundsMax-this.elevationBoundsMin))}_calculateFrustumVisibilityStatus(w){var v=this._aabb();const m=v[0],r=v[1],n=v[2],u=v[3],x=v[4];v=v[5];let y=!0;for(let A=0;6>A;A++){var z=w[A];const B=z[0],C=z[1],D=z[2];z=z[3];if(0<=B*(0<B?m:u)+C*(0<C?r:x)+D*(0<D?n:v)+z)return e.TileFrustumVisibility.OUTSIDE;y=y&&0>=B*(0>B?m:u)+C*(0>C?r:x)+D*(0>D?n:v)+z}return y?
e.TileFrustumVisibility.INSIDE:e.TileFrustumVisibility.INTERSECTS}_aabb(){const w=this._extentInRenderSR;return p.wrap(w[0],w[1],Math.min(this.elevationBoundsMin,this._subtreeGeometryElevationBoundMin),w[2],w[3],Math.max(this.elevationBoundsMax,this._subtreeGeometryElevationBoundMax))}intersectsRay(w,v,m,r){t[0]=1/v[0];t[1]=1/v[1];t[2]=1/v[2];return g.intersectAabbInvDirBefore(this._aabb(),w,t,m,r)}createGeometry(){f.createPlanarGlobePatch(this.renderData,this._horizontalScaleFactor);this._updateSubtreeGeometryElevationsBounds();
this.setMemoryDirty()}_updateSubtreeGeometryElevationsBounds(){var w=this.renderData;let v=this._subtreeGeometryElevationBoundMin,m=this._subtreeGeometryElevationBoundMax;if(w)w=w.geometry.boundingBox,v=w[2],m=w[5];else if(!this.isLeaf){v=Infinity;m=-Infinity;for(const r of this.children)v=Math.min(v,r._subtreeGeometryElevationBoundMin),m=Math.max(m,r._subtreeGeometryElevationBoundMax)}if(v!==this._subtreeGeometryElevationBoundMin||m!==this._subtreeGeometryElevationBoundMax)this._subtreeGeometryElevationBoundMin=
v,this._subtreeGeometryElevationBoundMax=m,this.parent?._updateSubtreeGeometryElevationsBounds()}getDefaultVerticesPerSide(){return 9>this.level?3:2}updateCornerElevations(){f.updateCornersPlanar(this.renderData,this._horizontalScaleFactor);this._updateSubtreeGeometryElevationsBounds()}updateEdgeElevations(){f.updateEdgesAndCornersPlanar(this.renderData,this._horizontalScaleFactor);this._updateSubtreeGeometryElevationsBounds()}updateEdgeElevationsAndResolutions(){f.updateEdgeElevationsAndResolutionsPlanar(this.renderData,
this._horizontalScaleFactor);this._updateSubtreeGeometryElevationsBounds()}get horizontalScale(){return this._horizontalScaleFactor}}const t=b.create();a.PlanarPatch=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/PatchGeometryFactory":function(){define("exports ../../../core/mathUtils ../../../geometry/support/aaBoundingBox ../../../geometry/support/aaBoundingRect ./ElevationData ./interfaces ./NeighborIndex ./PatchGeometry ./PatchGeometryLUT ./PatchRenderData ./terrainUtils ./Tile ./tileUtils ../webgl-engine/lib/Normals".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(U,Z,ca){const {tile:ea,localOrigin:da,geometry:ia}=U,{extent:ka,ellipsoid:fa}=ea,{boundingBox:X,numVerticesPerSide:ja,vertexAttributes:la,poleVerticesStartIndex:na}=ia,va=ja-1,za=da[0],ya=da[1],Da=da[2],ra=fa.radius,xa=ka[1],Ma=ka[3],Ga=[];let Pa=na;U=(Qa,Ea)=>{Ea*=ja;K(-za,-ya,-Da+Qa*ra,X);Ga.push(new W(1===Qa,Ea,1===Qa?0:2,Pa,6));Ea=Math.PI/2-2*Math.atan(Math.exp(-(-1===Qa?xa:Ma)/ra));const ua=Qa*Math.PI/2-Ea;Qa=.99*(1===Qa?1:-1);const Na=ra+0,{position:Ua,
uv0:wa}=la,{typedBuffer:sa,typedBufferStride:Ha}=la.normalCompressed;for(let Aa=1;6>=Aa;++Aa){var Ka=Ea+Aa/6*ua;const Sa=Math.cos(Ka);Ka=Math.sin(Ka);for(let Ya=0;Ya<=va;Ya++){const qa=Ya/va,aa=V.cosLonLUT[Ya]*Sa,Ja=V.sinLonLUT[Ya]*Sa,Ta=Ka,Ra=aa*Na-za,$a=Ja*Na-ya,bb=Ta*Na-Da;K(Ra,$a,bb,X);Ua.setValues(Pa,Ra,$a,bb);f.encodeUVInBuffer(wa,Pa,qa,Qa);w.compressNormal(sa,Pa,aa,Ja,Ta,Ha);++Pa}}};Z&&U(-1,0);ca&&U(1,va);return Ga}function m(U){U.tile.intersectsClippingArea&&(I(U),r(U))}function r(U,Z=!1){const {geometry:ca,
geometryState:ea,tile:da,localOrigin:ia}=U,{level:ka,extent:fa,extentInRadians:X,ellipsoid:ja}=da,la=ja.radius,na=X[0],va=X[2],za=X[1],ya=X[3],{samplerData:Da}=ea,ra=fa[0],xa=fa[2],Ma=fa[1],Ga=fa[3],Pa=n(U),{boundingBox:Qa,vertexAttributes:Ea}=ca,ua=ia[0],Na=ia[1],Ua=ia[2];var wa=Ea.position;const sa=wa.typedBuffer,Ha=wa.typedBufferStride,Ka=Ea.uv0;for(let aa=0;4>aa;++aa){const Ja=1===aa||3===aa;wa=ea.edgeResolutions[aa];g.internalAssert(b.isPowerOfTwo(wa));const Ta=wa+1;var Aa=e.neighborTileIfLoadedOrSelf(da,
ea.edgePeerNeighbors[aa]);if(M(da,Aa,aa)){G(U,aa,Aa);continue}const Ra=null!=Aa;g.internalAssert(!Ra||Aa.level===da.level);g.internalAssert(!Ra||0>=t.compareTilesByLij(da,Aa));var Sa=Aa?.renderData?.geometryState;if(g.enableTerrainInternalChecks){var Ya=da.surface;if(!Aa&&Ya&&!Ya.updatingRootTiles){var qa=g.neighborEdgeIndices[aa];const pb=da.findNeighborTile(qa,Bb=>Bb.isLoaded||Bb.isLeaf||Bb.level===da.level);pb?pb.intersectsClippingArea&&(g.internalAssert(!pb.isLoaded),g.internalAssert(!pb.isLeaf),
g.internalAssert(pb.level===ka)):g.internalAssert(null==Ya?.rootTiles||!da.shouldHaveNeighbor(qa))}}const $a=1===aa?fa[2]:fa[0],bb=(Aa=Aa?.extent)&&Ja?1===aa?Aa[0]:Aa[2]:$a,pa=0===aa?fa[3]:fa[1],Ba=1===aa?1:0,Ia=0===aa?1:0,Wa=1===aa?va:na,gb=0===aa?ya:za,ib=Math.sin(Wa),La=Math.cos(Wa),Xa=Math.sin(gb),eb=Math.cos(gb),db=Sa?.samplerData;Sa=(pb,Bb,Kb)=>p.sampleElevation(pb,Bb,Da);Ya=(pb,Bb,Kb)=>.5*(p.sampleElevation(pb,Bb,Da)+p.sampleElevation(Kb,Bb,db));const jb=Ra?Ya:Sa;Sa=ca.outerEdgesOffsetAndLength[2*
aa];const nb=Z&&3<Ta?Ta-3:1;Ya=null!=Da&&Da.some(pb=>null!=pb);qa=null!=db&&db.some(pb=>null!=pb);const qb=Ya||qa,ub=1/wa,xb=Sa;g.internalAssert(!Aa||g.almostEquals(Aa[2]-Aa[0],fa[2]-fa[0]));(()=>{const pb=1===aa?-1:3===aa?1:0,Bb=0===aa?-1:2===aa?1:0,Kb=(fa[2]-fa[0])*ub,bc=pb*Kb,Ib=Bb*Kb,$b=va-na,kc=Ja?pb*$b*ub:0,fc=Ja?0:Bb*ub,Pb=Ia,Cb=Ja?Wa+kc:Wa,Vb=Ja?Math.sin(Cb):ib,gc=Ja?Math.cos(Cb):La,Lb=Ja?Wa-kc:Wa,lb=Ja?Math.sin(Lb):ib,oa=Ja?Math.cos(Lb):La,Fa=Ja?gb:Pa(Pb+fc),Va=Ja?Xa:Math.sin(Fa),Za=Ja?eb:
Math.cos(Fa),fb=Ja?gb:Pa(Pb-fc),kb=Ja?Xa:Math.sin(fb),mb=Ja?eb:Math.cos(fb);let rb=0,tb=0,yb=0;const zb=0*ub,Ab=Ja?$a:ra*(1-zb)+xa*zb,Fb=Ja?bb:Ab,Qb=Ja?Ma*(1-zb)+Ga*zb:pa,sb=Ja?Wa:na*(1-zb)+va*zb,vb=Ja?ib:Math.sin(sb),Gb=Ja?La:Math.cos(sb),Hb=Ja?Pa(zb):gb,Tb=Ja?Math.sin(Hb):Xa,lc=Ja?Math.cos(Hb):eb,Ub=la+jb(Ab,Qb,Fb);rb=Gb*lc*Ub;tb=vb*lc*Ub;yb=Tb*Ub;let Zb=0,ac=0,Mb=0;const Jb=1*ub,Wb=Ja?$a:ra*(1-Jb)+xa*Jb,cc=Ja?bb:Wb,Db=Ja?Ma*(1-Jb)+Ga*Jb:pa,Nb=Ja?Wa:na*(1-Jb)+va*Jb,hc=Ja?ib:Math.sin(Nb),xc=Ja?La:
Math.cos(Nb),nc=Ja?Pa(Jb):gb,Xb=Ja?Math.sin(nc):Xa,tc=Ja?Math.cos(nc):eb,Yb=la+jb(Wb,Db,cc);Zb=xc*tc*Yb;ac=hc*tc*Yb;Mb=Xb*Yb;for(let dc=1;dc<Ta-1;dc+=nb){let Gc=0,Cc=0,uc=0;const oc=(dc+1)*ub,yc=Ja?$a:ra*(1-oc)+xa*oc,Dc=Ja?bb:yc,Hc=Ja?Ma*(1-oc)+Ga*oc:pa,Oc=Ja?Wa:na*(1-oc)+va*oc,dd=Ja?ib:Math.sin(Oc),Yc=Ja?La:Math.cos(Oc),Ic=Ja?Pa(oc):gb,wc=Ja?Math.sin(Ic):Xa,qc=Ja?Math.cos(Ic):eb,zc=la+jb(yc,Hc,Dc);Gc=Yc*qc*zc;Cc=dd*qc*zc;uc=wc*zc;const rd=Gc,Pd=Cc,ed=uc,Qd=Zb,sd=ac,fd=Mb;Zb=rd;ac=Pd;Mb=ed;const Rd=
xb+dc,Gd=Rd*Ha,ve=Qd-ua,Sd=sd-Na,we=fd-Ua;sa[Gd]=ve;sa[Gd+1]=Sd;sa[Gd+2]=we;K(ve,Sd,we,Qa);const Hd=dc*ub;f.encodeUVInBuffer(Ka,Rd,Ja?Ba:Hd,Ja?Hd:Ia);const td=rb,xe=tb,ad=yb;rb=Qd;tb=sd;yb=fd;const vc=Qd,Rc=sd,Pc=fd,Sc=1/Math.sqrt(vc*vc+Rc*Rc+Pc*Pc),ud=Pc*Sc;let Tc=0,Uc=0,Qc=0;if(qb&&.999>ud*ud){let Id=0,Ac=0,gd=0;const hd=0===aa?-1:1;Id=hd*(rd-td);Ac=hd*(Pd-xe);gd=hd*(ed-ad);const Ec=dc*ub,id=Ja?$a:ra*(1-Ec)+xa*Ec,Jd=Ja?bb:id,jd=Ja?Ma*(1-Ec)+Ga*Ec:pa,ye=Ja?Wa:na*(1-Ec)+va*Ec,kd=Ja?ib:Math.sin(ye),
vd=Ja?La:Math.cos(ye),bd=Ja?Pa(Ec):gb,Kd=Ja?Math.sin(bd):Xa,wd=Ja?Math.cos(bd):eb;let Ld=vc,Td=Rc,Ud=Pc;if(Ra){const Vd=la+p.sampleElevation(Jd-bc,jd-Ib,db),Be=Ja?lb:kd,Wd=Ja?Kd:kb,Xd=Ja?wd:mb;Ld=(Ja?oa:vd)*Xd*Vd;Td=Be*Xd*Vd;Ud=Wd*Vd}const xd=la+p.sampleElevation(id+bc,jd+Ib,Da),Vc=Ja?wd:Za,ld=(Ja?gc:vd)*Vc*xd,Zc=(Ja?Vb:kd)*Vc*xd,Md=(Ja?Kd:Va)*xd;Ra||(Ld=2*vc-ld,Td=2*Rc-Zc,Ud=2*Pc-Md);const Nd=3===aa?-1:1,ze=Nd*(Ld-ld),Ae=Nd*(Td-Zc),yd=Nd*(Ud-Md);Tc=gd*Ae-Ac*yd;Uc=Id*yd-gd*ze;Qc=Ac*ze-Id*Ae;const zd=
1/Math.sqrt(Tc*Tc+Uc*Uc+Qc*Qc);Tc*=zd;Uc*=zd;Qc*=zd}else Tc=vc*Sc,Uc=Rc*Sc,Qc=Pc*Sc;ca.setEdgeNormalFromValues(aa,dc,Tc,Uc,Qc)}})()}}function n(U){({tile:U}=U);if(U.surface.isWebMercator){const ca=U.extent,ea=U.ellipsoid.radius;return da=>Math.PI/2-2*Math.atan(Math.exp(-(ca[1]*(1-da)+ca[3]*da)/ea))}const Z=U.extentInRadians;return ca=>Z[1]*(1-ca)+Z[3]*ca}function u(U,Z){U.tile.intersectsClippingArea&&(I(U),x(U,!1))}function x(U,Z){const {geometry:ca,geometryState:ea,localOrigin:da}=U,ia=U.tile,{surface:ka,
extent:fa}=ia,{clippingArea:X,samplerData:ja}=ea,la=null!=X?X:T,na=fa[0],va=fa[2],za=fa[1],ya=fa[3],Da=[ya>la[3],va>la[2],za<la[1],na<la[0]],ra=ia.horizontalScale,xa=y(ka.isWebMercatorOnPlateCarree,ia.ellipsoid.radius,ra),{minu:Ma,minv:Ga,maxu:Pa,maxv:Qa,boundingBox:Ea}=ca,ua=Math.max(na,la[0]),Na=Math.min(va,la[2]),Ua=Math.max(za,la[1]),wa=Math.min(ya,la[3]),sa=da[0],Ha=da[1],Ka=da[2];for(let Aa=0;4>Aa;++Aa){const Sa=1===Aa||3===Aa,Ya=ea.edgeResolutions[Aa];g.internalAssert(b.isPowerOfTwo(Ya));const qa=
Ya+1,aa=Da[Aa],Ja=e.neighborTileIfLoadedOrSelf(ia,ea.edgePeerNeighbors[Aa]);if(!aa&&M(ia,Ja,Aa)){G(U,Aa,Ja);continue}const Ta=null!=Ja&&!aa,Ra=Ja?.renderData?.geometryState;if(g.enableTerrainInternalChecks&&(g.internalAssert(!Ta||Ja.level===ia.level),g.internalAssert(!Ta||0>=t.compareTilesByLij(ia,Ja)),ia&&!Ja&&!ka.updatingRootTiles)){const oa=g.neighborEdgeIndices[Aa],Fa=ia.findNeighborTile(oa,Va=>Va.isLoaded||Va.isLeaf||Va.level===ia.level);ka.updatingRootTiles||(Fa?Fa.intersectsClippingArea&&(g.internalAssert(!Fa.isLoaded),
g.internalAssert(!Fa.isLeaf),g.internalAssert(Fa.level===ia.level)):g.internalAssert(null==ka?.rootTiles||!ia.shouldHaveNeighbor(oa)))}const $a=b.clamp(1===Aa?va:na,ua,Na),bb=b.clamp(0===Aa?ya:za,Ua,wa),pa=Ra?.samplerData,Ba=Z&&3<qa?qa-3:1,Ia=b.clamp(1===Aa?1:0,Ma,Pa),Wa=b.clamp(0===Aa?1:0,Ga,Qa),gb=(oa,Fa)=>p.sampleElevation(oa,Fa,ja),ib=(oa,Fa)=>.5*(p.sampleElevation(oa,Fa,pa)+p.sampleElevation(oa,Fa,ja)),La=Ta?ib:gb,Xa=(va-na)/Ya,eb=Sa?1===Aa?Xa:-Xa:0,db=Sa?0:0===Aa?Xa:-Xa,jb=-eb,nb=-db;let qb=
0,ub=0,xb=0;const pb=0/Ya,Bb=Sa?$a:b.clamp(na*(1-pb)+va*pb,ua,Na),Kb=Sa?b.clamp(za*(1-pb)+ya*pb,Ua,wa):bb,bc=La(Bb,Kb);qb=Bb*ra;ub=xa(Kb);xb=bc;let Ib=0,$b=0,kc=0;const fc=1/Ya,Pb=Sa?$a:b.clamp(na*(1-fc)+va*fc,ua,Na),Cb=Sa?b.clamp(za*(1-fc)+ya*fc,Ua,wa):bb,Vb=La(Pb,Cb),gc=Pb*ra,Lb=xa(Cb),lb=Vb;Ib=gc;$b=Lb;kc=lb;for(let oa=1;oa<qa-1;oa+=Ba){const Fa=oa/Ya,Va=Ib,Za=$b,fb=kc,kb=Sa?Ia:b.clamp(Fa,Ma,Pa),mb=Sa?b.clamp(Fa,Ga,Qa):Wa,rb=Va-sa,tb=Za-Ha,yb=fb-Ka;K(Va,tb,yb,Ea);ca.setEdgeVertexFromValuesRawPositionUV(Aa,
oa,rb,tb,yb,kb,mb);const zb=(oa+1)/Ya,Ab=Sa?$a:b.clamp(na*(1-zb)+va*zb,ua,Na),Fb=Sa?b.clamp(za*(1-zb)+ya*zb,Ua,wa):bb,Qb=La(Ab,Fb);Ib=Ab*ra;$b=xa(Fb);kc=Qb;const sb=Ib,vb=$b,Gb=kc,Hb=qb,Tb=ub,lc=xb;qb=Va;ub=Za;xb=fb;let Ub=0,Zb=0,ac=0;if(Sa){const Jb=vb-Za,Wb=Gb-fb,cc=Tb-Za,Db=lc-fb,Nb=b.clamp(za*(1-Fa)+ya*Fa,Ua,wa),hc=$a+jb,xc=hc*ra,nc=p.sampleElevation(hc,Nb,ja),Xb=xc-Va,tc=nc-fb,Yb=3===Aa?-1:1;Ub=Yb*(-cc+Jb)*tc;Zb=Yb*Xb*(-Db+Wb);ac=-Yb*Xb*(-cc+Jb);if(Ta){const dc=$a+eb,Gc=dc*ra,Cc=p.sampleElevation(dc,
Nb,pa),uc=Gc-Va;Ub=(-cc+Jb)*(tc-(Cc-fb));Zb=(Xb-uc)*(-Db+Wb);ac=-(Xb-uc)*(-cc+Jb)}}else{const Jb=sb-Va,Wb=Gb-fb,cc=Hb-Va,Db=lc-fb,Nb=b.clamp(na*(1-Fa)+va*Fa,ua,Na),hc=bb+nb,xc=p.sampleElevation(Nb,hc,ja)-fb,nc=xa(hc)-Za,Xb=2===Aa?-1:1;Ub=Xb*nc*(-Db+Wb);Zb=Xb*(-cc+Jb)*xc;ac=-Xb*nc*(-cc+Jb);if(Ta){const tc=Nb,Yb=bb+db,dc=xa(Yb),Gc=p.sampleElevation(tc,Yb,pa)-fb,Cc=dc-Za;Ub=(-nc+Cc)*(-Db+Wb);Zb=(-cc+Jb)*(-xc+Gc);ac=-(-nc+Cc)*(-cc+Jb)}}const Mb=1/Math.sqrt(Ub*Ub+Zb*Zb+ac*ac);ca.setEdgeNormalFromValues(Aa,
oa,Ub*Mb,Zb*Mb,ac*Mb)}}}function y(U,Z,ca){return U?ea=>(Math.PI/2-2*Math.atan(Math.exp(-ea/Z)))*Z:ea=>ea*ca}function z(U,Z,ca){const {numVerticesPerSide:ea,vertexAttributes:da,maxEdgeVertexCount:ia}=U,ka=ea-1;var fa=da.count;const X=2*(ea-3)*(ea-3);var ja=4*(ka+ia-3);const la=e.zeroToFour.reduce((za,ya)=>za+(ka+U.getEdgeCount(ya)-3),0),na=Z.reduce((za,ya)=>za+ka*(2*(ya.latitudeResolution-1)+1),0),va=3*(ca?2:1);ja=(X+ja+na)*va;fa=65536<=fa?new Uint32Array(ja):new Uint16Array(ja);for(let za=0;za<ja;++za)fa[za]=
0;U.indices=fa;U.indexCount=(X+la+na)*va;U.poleIndicesStartIndex=X*va;U.edgeIndicesStartIndex=(X+na)*va;ca?(D(U),F(U,Z),H(U)):(A(U),B(U,Z),C(U))}function A(U){const {numVerticesPerSide:Z,indices:ca,vertexAttributes:ea}=U;({position:U}=ea);const {typedBuffer:da,typedBufferStride:ia}=U;U=Z-2;const ka=Z-3,fa=Z-3;let X=0;for(let ja=0;ja<ka;++ja){const la=ja*U;for(let na=0;na<fa;++na){const va=la+na,za=va+1,ya=za+U,Da=ya-1;R(va,za,ya,Da,ia,da)?(ca[X]=va,ca[X+1]=za,ca[X+2]=ya,ca[X+3]=ya,ca[X+4]=Da,ca[X+
5]=va):(ca[X]=va,ca[X+1]=za,ca[X+2]=Da,ca[X+3]=Da,ca[X+4]=za,ca[X+5]=ya);X+=6}}}function B(U,Z){const {numVerticesPerSide:ca,indices:ea,poleIndicesStartIndex:da}=U,ia=ca-1;let ka=da;for(const fa of Z){Z=fa.isNorth?1:2;const X=fa.isNorth?2:1,ja=fa.isNorth?3:4,la=fa.isNorth?4:3;let na=U.getEdgeVertexIndex(fa.connectedOuterEdgeOffset,0),va=1;for(let za=0;za<fa.latitudeResolution;++za){const ya=0===za?fa.rowOffset:na+ca;for(let Da=0;Da<ia;Da++){const ra=ya+Da;ea[ka]=na;ea[ka+Z]=na+1;ea[ka+X]=ra;za<fa.latitudeResolution-
1?(ea[ka+ja]=na+1,ea[ka+la]=ra+1,ea[ka+5]=ra,ka+=6):ka+=3;na+=va}na=ya;va=1}}}function C(U){const {indices:Z,numVerticesPerSide:ca,edgeIndicesStartIndex:ea}=U,da=ca-1,ia=da-2;let ka=ea;for(let la=0;4>la;++la){var fa=ba[la];let na=0,va=0;const za=U.getEdgeCount(la),ya=fa.count;g.internalAssert(ya===da-1);var X=1===la||2===la;const Da=X?1:2;X=X?2:1;const ra=U.getEdgeFirstVertexIndex(la),xa=fa.vertex0Index;for(fa=fa.stride;na<za-1||va<ya-1;){const Ma=xa+va*fa,Ga=ra+1*na;var ja=na<za-1;const Pa=va<ya-
1,Qa=ja?da*(na+.5)/(za-1):0,Ea=Pa?1+ia*(va+.5)/(ya-1):0;(ja=ja&&(!Pa||Qa<=Ea))?++na:++va;ja=ja?Ga+1:Ma+fa;Z[ka]=Ma;Z[ka+Da]=Ga;Z[ka+X]=ja;ka+=3}}U.indexCount=ka}function D(U){const {indices:Z,numVerticesPerSide:ca,vertexAttributes:ea}=U;({position:U}=ea);const {typedBuffer:da,typedBufferStride:ia}=U;U=ca-2;let ka=0;for(let fa=0;fa<ca-3;++fa){const X=fa*U;for(let ja=0;ja<ca-3;++ja){const la=fa*U+ja,na=la+1,va=na+U,za=va-1,ya=X+ja,Da=ya+1,ra=Da+U;R(ya,Da,ra,ra-1,ia,da)?(Q(Z,ka,la,na,va),ka+=6,Q(Z,ka,
va,za,la)):(Q(Z,ka,la,na,za),ka+=6,Q(Z,ka,za,va,na));ka+=6}}}function F(U,Z){const {indices:ca,numVerticesPerSide:ea,poleIndicesStartIndex:da}=U,ia=ea-1;let ka=da;for(const fa of Z){Z=U.getEdgeVertexIndex(fa.connectedOuterEdgeOffset,0);let X=1;for(let ja=0;ja<fa.latitudeResolution;++ja){const la=0===ja?fa.rowOffset:Z+ea;for(let na=0;na<ia;na++)Q(ca,ka,Z,Z+1,la+na),ka+=6,ja<fa.latitudeResolution-1&&(Q(ca,ka,Z+1,la+na+1,la+na),ka+=6),Z+=X;Z=la;X=1}}}function H(U){const {indices:Z,numVerticesPerSide:ca,
edgeIndicesStartIndex:ea}=U,da=ca-1,ia=da-2;let ka=ea;for(let la=0;4>la;++la){var fa=ba[la];let na=0,va=0;const za=U.getEdgeCount(la),ya=fa.count;g.internalAssert(ya===da-1);var X=1===la||2===la;const Da=X?1:3;X=X?3:1;const ra=U.getEdgeFirstVertexIndex(la),xa=fa.vertex0Index;for(fa=fa.stride;na<za-1||va<ya-1;){const Ma=xa+va*fa,Ga=ra+1*na;var ja=na<za-1;const Pa=va<ya-1,Qa=ja?da*(na+.5)/(za-1):0,Ea=Pa?1+ia*(va+.5)/(ya-1):0;(ja=ja&&(!Pa||Qa<=Ea))?++na:++va;ja=ja?Ga+1:Ma+fa;Z[ka]=Ma;Z[ka+Da]=Ga;Z[ka+
Da+1]=Ga;Z[ka+X]=ja;Z[ka+X+1]=ja;Z[ka+5]=Ma;ka+=6}}U.indexCount=ka}function N(U){const {geometry:Z,geometryState:ca}=U;({edgeResolutions:U}=ca);const {numVerticesPerSide:ea,edgeVerticesStartIndex:da}=Z,ia=ea-2;let ka=da;for(let X=0;4>X;++X){var fa=0===X||2===X;fa=(fa?0:1)*ia+(fa?1:0);const ja=ba[X];ja.vertex0Index=(0===X?ia-1:0)*ia+(1===X?ia-1:0);ja.stride=fa;ja.count=ia;fa=U[X]+1;Z.outerEdgesOffsetAndLength[2*X]=ka;Z.outerEdgesOffsetAndLength[2*X+1]=fa;ka+=fa}}function E(U){N(U);U.geometryState.wireframe?
H(U.geometry):C(U.geometry)}function G(U,Z,ca){const {geometryState:ea,geometry:da,tile:ia,localOrigin:ka}=U;U=1===Z||3===Z;const fa=ea.edgeResolutions[Z];g.internalAssert(b.isPowerOfTwo(fa));const X=fa+1,{boundingBox:ja,minu:la,minv:na,maxu:va,maxv:za,vertexAttributes:ya}=da,Da=b.clamp(1===Z?1:0,la,va),ra=b.clamp(0===Z?1:0,na,za);var xa=ca.renderData,Ma=xa.geometryState,Ga=xa.geometry,Pa=(Z+2)%4,Qa=Ga.getEdgeCount(Pa);const Ea=ia.getNeighborEdgeStartVertexIndex(Z,ca)*fa;ca=fa*2**(ia.level-ca.level);
g.internalAssert(Ma.edgeResolutions[Pa]===ca);g.internalAssert(Qa-1===ca);ca=xa.localOrigin[0]-ka[0];Ma=xa.localOrigin[1]-ka[1];xa=xa.localOrigin[2]-ka[2];Z=da.getEdgeFirstVertexIndex(Z);var ua=ya.position;Qa=ua.typedBuffer;ua=ua.typedBufferStride;var Na=ya.normalCompressed;const Ua=Na.typedBuffer;Na=Na.typedBufferStride;const wa=ya.uv0;var sa=Ga.vertexAttributes;Ga=Ga.getEdgeFirstVertexIndex(Pa);Pa=sa.position.typedBuffer;const Ha=sa.position.typedBufferStride,Ka=sa.normalCompressed.typedBuffer;
sa=sa.normalCompressed.typedBufferStride;for(let qa=1;qa<X-1;++qa){const aa=Z+qa;var Aa=Ga+(Ea+qa),Sa=aa*ua,Ya=Aa*Ha;const Ja=Pa[Ya]+ca,Ta=Pa[Ya+1]+Ma;Ya=Pa[Ya+2]+xa;Qa[Sa]=Ja;Qa[Sa+1]=Ta;Qa[Sa+2]=Ya;K(Ja,Ta,Ya,ja);Sa=aa*Na;Aa*=sa;Ua[Sa]=Ka[Aa];Ua[Sa+1]=Ka[Aa+1];Sa=qa/fa;Aa=U?Da:b.clamp(Sa,la,va);Sa=U?b.clamp(Sa,na,za):ra;f.encodeUVInBuffer(wa,aa,Aa,Sa)}}function I(U){const {geometry:Z,geometryState:ca,localOrigin:ea}=U,{clippingArea:da,samplerData:ia}=ca,{minu:ka,minv:fa,maxu:X,maxv:ja,boundingBox:la,
vertexAttributes:na}=Z,va=U.tile,{surface:za,ellipsoid:ya,extent:Da,extentInRadians:ra,horizontalScale:xa}=va,Ma="local"===za.view?.viewingMode,Ga=ya.radius;let Pa=0,Qa=0,Ea=0;const ua=()=>{const db=null!=da&&(Da[3]>da[3]||Da[2]>da[2]||Da[1]<da[1]||Da[0]<da[0]),jb=y(za.isWebMercatorOnPlateCarree,Ga,xa);return(nb,qb,ub)=>{nb=0===nb?Da[0]:Da[2];qb=0===qb?Da[1]:Da[3];nb=db?b.clamp(nb,da[0],da[2]):nb;qb=db?b.clamp(qb,da[1],da[3]):qb;Pa=nb*xa;Qa=jb(qb);Ea=ub}},Na=(db,jb,nb)=>{var qb=ra[0===jb?1:3];db=
ra[0===db?0:2];jb=Math.cos(qb);qb=Math.sin(qb);const ub=Math.sin(db);nb=Ga+nb;Pa=Math.cos(db)*jb*nb;Qa=ub*jb*nb;Ea=qb*nb},Ua=Ma?ua():Na;let wa=0,sa=0,Ha=0,Ka=0,Aa=0,Sa=0,Ya=0,qa=0,aa=0;const Ja=Ma&&za.isWebMercatorOnPlateCarree,Ta=(db,jb,nb,qb,ub)=>{var xb=0,pb=0;let Bb=0;Ma?(nb=Ja?(Math.PI/2-2*Math.atan(Math.exp(-nb/Ga)))*Ga:nb*xa,xb=jb*xa-Pa,pb=nb-Qa,Bb=qb-Ea):(xb=n(db),db=db.tile,pb=db.extent,db=db.extentInRadians,jb=(jb-pb[0])/(pb[2]-pb[0]),jb=db[0]*(1-jb)+db[2]*jb,xb=xb((nb-pb[1])/(pb[3]-pb[1])),
nb=Math.cos(xb),db=Math.sin(xb),pb=Math.sin(jb),qb=Ga+qb,xb=Math.cos(jb)*nb*qb-Pa,pb=pb*nb*qb-Qa,Bb=db*qb-Ea);switch(ub){case 0:Ya+=xb;qa+=pb;aa+=Bb;break;case 1:Ka-=xb;Aa-=pb;Sa-=Bb;break;case 2:Ya-=xb;qa-=pb;aa-=Bb;break;case 3:Ka+=xb,Aa+=pb,Sa+=Bb}},Ra=da??T,$a=Da[0],bb=Da[2],pa=Da[1],Ba=Da[3],Ia=[Ba>Ra[3],bb>Ra[2],pa<Ra[1],$a<Ra[0]],Wa=Math.max($a,Ra[0]),gb=Math.min(bb,Ra[2]),ib=Math.max(pa,Ra[1]),La=Math.min(Ba,Ra[3]),Xa=db=>{var jb=ca.cornerNeighborCornerTiles;sa=wa=0;Ha=1;aa=qa=Ya=Sa=Aa=Ka=
0;var nb=Infinity;for(var qb=0;4>qb;++qb)nb=Math.min(nb,jb[4*db+qb]?.level??Infinity);for(qb=0;4>qb;++qb){var ub=jb[4*db+qb];Y[qb]=ub?.level===nb?ub:null}db=1;jb=0;for(nb=0;4>nb;++nb)if(qb=Y[nb])db=Math.max(db,qb?.renderData.geometryState.numVerticesPerSide),jb=qb.extent[2]-qb.extent[0];g.internalAssert(1<db);db=jb/db;for(jb=0;4>jb;++jb){ub=Y[(jb+3)%4];var xb=Y[jb%4];if(ub||xb){qb=0===jb?1:1===jb?2:2===jb?3:0;var pb=0===jb?2:1===jb?3:2===jb?0:1;if(ub&&xb){var Bb=S[jb][0]*db,Kb=S[jb][1]*db,bc=ub.extent;
nb=Math.max(Ra[0],Math.min(Ra[2],bc[0===qb||1===qb?2:0]+Bb));qb=Math.max(Ra[1],Math.min(Ra[3],bc[0===qb||3===qb?3:1]+Kb));bc=xb.extent;Bb=Math.max(Ra[0],Math.min(Ra[2],bc[0===pb||1===pb?2:0]+Bb));pb=Math.max(Ra[1],Math.min(Ra[3],bc[0===pb||3===pb?3:1]+Kb));ub=ub.renderData;Kb=xb.renderData;xb=p.sampleElevation(nb,qb,ub.geometryState.samplerData);pb=p.sampleElevation(Bb,pb,Kb.geometryState.samplerData);Ta(ub,nb,qb,.5*(xb+pb),jb)}else nb=ub??xb,ub=ub?qb:pb,xb=nb.extent,pb=S[jb],qb=Math.max(Ra[0],Math.min(Ra[2],
xb[0===ub||1===ub?2:0]+pb[0]*db)),ub=Math.max(Ra[1],Math.min(Ra[3],xb[0===ub||3===ub?3:1]+pb[1]*db)),nb=nb.renderData,xb=p.sampleElevation(qb,ub,nb.geometryState.samplerData),Ta(nb,qb,ub,xb,jb)}}Ma||(db=Math.sqrt(Pa*Pa+Qa*Qa+Ea*Ea),wa=Pa/db,sa=Qa/db,Ha=Ea/db);if(Ma||.999>Ha*Ha)db=Math.sqrt(Ka*Ka+Aa*Aa+Sa*Sa),Ka/=db,Aa/=db,Sa/=db,db=Math.sqrt(Ya*Ya+qa*qa+aa*aa),Ya/=db,qa/=db,aa/=db,wa=Sa*qa-Aa*aa,sa=Ka*aa-Sa*Ya,Ha=Aa*Ya-Ka*qa,db=1/Math.sqrt(wa*wa+sa*sa+Ha*Ha),wa*=db,sa*=db,Ha*=db},eb=ca.cornerNeighborCornerTiles;
for(let db=0;4>db;++db){const jb=db,nb=(db+1)%4,qb=0===db||1===db?1:0,ub=0===db||3===db?1:0,xb=b.clamp(qb,ka,X),pb=b.clamp(ub,fa,ja),Bb=Z.getEdgeFirstVertexIndex(jb),Kb=Z.getEdgeCount(jb),bc=0===db||3===db?Kb-1:0,Ib=Z.getEdgeFirstVertexIndex(nb),$b=Z.getEdgeCount(nb),kc=0===db||1===db?$b-1:0;let fc=-1;for(let Vb=0;4>Vb;++Vb){const gc=eb[4*db+Vb],Lb=eb[4*db+fc];gc&&(-1===fc||0<t.compareTilesByLij(Lb,gc))&&(fc=Vb)}const Pb=fc,Cb=eb[4*db+Pb];if(Cb!==va){const Vb=va.level-Cb.level,gc=2**Vb,Lb=[Cb.lij[0]+
Vb,Cb.lij[1]*gc,Cb.lij[2]*gc],lb=[Lb[1]+gc===va.lij[1],0===db&&(1===Pb||0===Pb&&Cb!==eb[4*db+3])||1===db&&(0===Pb||1===Pb&&Cb!==eb[4*db+2]),Lb[1]===va.lij[1]+1,2===db&&(3===Pb||2===Pb&&Cb!==eb[4*db+1])||3===db&&(2===Pb||3===Pb&&Cb!==eb[4*db])],oa=lb.reduce((Db,Nb)=>Db+(Nb?1:0),0);g.internalAssert(1===oa||2===oa);let Fa=-1,Va=-1;const Za=Cb.renderData;if(1===oa){const Db=lb.findIndex(hc=>hc);g.internalAssert(0<=Db&&3>=Db);Fa=(Db+2)%4;const Nb=ca.edgeResolutions[Db];Va=va.getNeighborEdgeStartVertexIndex(Db,
Cb)*Nb+Nb*(0===Db&&0===db||1===Db&&0===db||2===Db&&1===db||3===Db&&3===db?1:0)}else{g.internalAssert(lb[1]||lb[3]);Fa=lb[1]?3:1;const Db=Za.geometryState.edgeResolutions[Fa];Va=0===db||3===db?0:Db}const fb=Za.geometry,kb=Bb+bc,mb=Ib+kc,rb=fb.getEdgeFirstVertexIndex(Fa)+Va,tb=fb.vertexAttributes,yb=Za.localOrigin,zb=tb.position,Ab=zb.typedBuffer,Fb=rb*zb.typedBufferStride,Qb=Ab[Fb]+yb[0]-ea[0],sb=Ab[Fb+1]+yb[1]-ea[1],vb=Ab[Fb+2]+yb[2]-ea[2];K(Qb,sb,vb,la);const Gb=na.position,Hb=Gb.typedBuffer,Tb=
kb*Gb.typedBufferStride;Hb[Tb]=Qb;Hb[Tb+1]=sb;Hb[Tb+2]=vb;const lc=mb*Gb.typedBufferStride;Hb[lc]=Qb;Hb[lc+1]=sb;Hb[lc+2]=vb;const Ub=na.uv0;f.encodeUVInBuffer(Ub,kb,xb,pb);f.encodeUVInBuffer(Ub,mb,xb,pb);const Zb=tb.normalCompressed.typedBuffer,ac=rb*tb.normalCompressed.typedBufferStride,Mb=na.normalCompressed,Jb=Mb.typedBuffer,Wb=kb*Mb.typedBufferStride;Jb[Wb]=Zb[ac];Jb[Wb+1]=Zb[ac+1];const cc=mb*Mb.typedBufferStride;Jb[cc]=Zb[ac];Jb[cc+1]=Zb[ac+1]}else{const Vb=Ia[nb];let gc=void 0;if(Ia[jb]||
Vb){const Fa=b.clamp($a*(1-qb)+bb*qb,Wa,gb),Va=b.clamp(pa*(1-ub)+Ba*ub,ib,La);gc=p.sampleElevation(Fa,Va,ia)}else gc=O(eb,db);Ua(qb,ub,gc);Xa(db);const Lb=Pa-ea[0],lb=Qa-ea[1],oa=Ea-ea[2];K(Lb,lb,oa,la);Z.setEdgeVertexFromValuesRawPositionUVNormal(jb,bc,Lb,lb,oa,xb,pb,wa,sa,Ha);Z.setEdgeVertexFromValuesRawPositionUVNormal(nb,kc,Lb,lb,oa,xb,pb,wa,sa,Ha)}}for(let db=0;4>db;++db)Y[db]=null}function O(U,Z){const ca=4*Z;Z=e.zeroToFour.reduce((ka,fa)=>Math.min(ka,U[ca+fa]?.level??Infinity),Infinity);g.enableTerrainInternalChecks&&
(g.internalAssert(!U[ca+0]||!U[ca+2]||d.isCornerNeighbor(U[ca+0],U[ca+2],h.NeighborIndex.SOUTH_WEST)),g.internalAssert(!U[ca+1]||!U[ca+3]||d.isCornerNeighbor(U[ca+1],U[ca+3],h.NeighborIndex.NORTH_WEST)));let ea=0,da=0;for(let ka=0;4>ka;++ka){var ia=U[ca+ka];if(ia&&ia.level===Z){const fa=ia.extent;ia=p.sampleElevation(fa[0===ka||1===ka?0:2],fa[0===ka||3===ka?1:3],ia.renderData?.geometryState?.samplerData);da+=ia;ea++}}Z=ea?da/ea:0;g.internalAssert(null!=Z);return Z}function L(U){const {vao:Z,geometry:ca}=
U,{vertexAttributes:ea,edgeVerticesStartIndex:da}=ca;U=ea.position.typedBuffer;Z.vertexBuffers.geometry.setSubData(U,da,da,U.length)}function P(U){const {vao:Z,geometry:ca}=U,{indices:ea,indexCount:da,edgeIndicesStartIndex:ia}=ca;Z.indexBuffer.setSubData(ea,ia,ia,da)}function M(U,Z,ca){if(!Z)return!1;U=t.compareTilesByLij(U,Z);return 0<U||0===U&&2<=ca}function K(U,Z,ca,ea){U<ea[0]?ea[0]=U:U>ea[3]&&(ea[3]=U);Z<ea[1]?ea[1]=Z:Z>ea[4]&&(ea[4]=Z);ca<ea[2]?ea[2]=ca:ca>ea[5]&&(ea[5]=ca)}function J(U){const {edgeResolutions:Z,
numVerticesPerSide:ca}=U;U=1+Math.max(...Z);return Math.max(ca,U)}function R(U,Z,ca,ea,da,ia){var ka=U*da;U=ia[ka];const fa=ia[ka+1];ka=ia[ka+2];var X=Z*da;Z=ia[X];const ja=ia[X+1];X=ia[X+2];var la=ca*da;ca=ia[la];const na=ia[la+1];la=ia[la+2];const va=ea*da;ea=ia[va];da=ia[va+1];ia=ia[va+2];return(Z-ea)*(Z-ea)+(ja-da)*(ja-da)+(X-ia)*(X-ia)>(U-ca)*(U-ca)+(fa-na)*(fa-na)+(ka-la)*(ka-la)}function Q(U,Z,ca,ea,da){U[Z]=ca;U[Z+1]=ea;U[Z+2]=ea;U[Z+3]=da;U[Z+4]=da;U[Z+5]=ca}class W{constructor(U,Z,ca,ea,
da){this.isNorth=U;this.connectedRowOffset=Z;this.connectedOuterEdgeOffset=ca;this.rowOffset=ea;this.latitudeResolution=da}}const S=[[0,1],[1,0],[0,-1],[-1,0]],V=new c.PatchGeometryLUT,T=l.fromValues(-Infinity,-Infinity,Infinity,Infinity),Y=[null,null,null,null];class ha{constructor(){this.vertex0Index=0;this.stride=1;this.count=0}getVertexIndex(U){g.internalAssert(0<=U&&U<this.count);return this.vertex0Index+this.stride*U}}const ba=[new ha,new ha,new ha,new ha];a.createPlanarGlobePatch=function(U,
Z){const {tile:ca,geometryState:ea,geometry:da}=U,{extent:ia,surface:ka}=ca,{wireframe:fa}=ea,X=ia[0],ja=ia[1],la=ia[2]-X,na=ia[3]-ja,{numVerticesPerSide:va,clippingArea:za}=ea,ya=null!=za?Math.max(0,(za[0]-X)/la):0,Da=null!=za?Math.max(0,(za[1]-ja)/na):0,ra=null!=za?Math.min(1,(za[2]-X)/la):1,xa=null!=za?Math.min(1,(za[3]-ja)/na):1,Ma=(va-2)**2,Ga=J(ea),Pa=ka.renderer.tileGeometryCache.acquire(Ma+4*Ga),{boundingBox:Qa}=da;q.empty(Qa);da.numVerticesPerSide=va;da.vertexAttributes=Pa;da.maxEdgeVertexCount=
Ga;da.minu=ya;da.minv=Da;da.maxu=ra;da.maxv=xa;{const gc=U.tile;if(gc.intersectsClippingArea){var {geometry:Ea,geometryState:ua,localOrigin:Na}=U,{samplerData:Ua,clippingArea:wa,numVerticesPerSide:sa}=ua,{surface:Ha,extent:Ka,ellipsoid:Aa}=gc,{isWebMercatorOnPlateCarree:Sa}=Ha,Ya=null!=wa?wa:T,qa=Ka[0],aa=Ka[1],Ja=Ka[2],Ta=Ka[3],Ra=Math.max(qa,Ya[0]),$a=Math.min(Ja,Ya[2]),bb=Math.max(aa,Ya[1]),pa=Math.min(Ta,Ya[3]),Ba=Aa.radius,Z=gc.horizontalScale,Ia=sa-1,Wa=sa-2,{minu:gb,minv:ib,maxu:La,maxv:Xa,
boundingBox:eb,vertexAttributes:db}=Ea,jb=db.position,nb=db.uv0,{typedBuffer:qb,typedBufferStride:ub}=db.normalCompressed,xb=Na[0],pb=Na[1],Bb=Na[2],Kb=jb.typedBuffer,bc=jb.typedBufferStride,Ib=0,$b=b.clamp(aa,bb,pa),kc=Sa?(Math.PI/2-2*Math.atan(Math.exp(-$b/Ba)))*Ba:$b*Z,fc=1/Ia,Pb=b.clamp(aa*(1-fc)+Ta*fc,bb,pa),Cb=kc,Vb=Sa?(Math.PI/2-2*Math.atan(Math.exp(-Pb/Ba)))*Ba:Pb*Z;for(let Lb=1;Lb<=Wa;Lb++){const lb=Lb/Ia,oa=b.clamp(aa*(1-lb)+Ta*lb,bb,pa),Fa=b.clamp(lb,ib,Xa),Va=Vb,Za=(Lb-1)/Ia,fb=b.clamp(aa*
(1-Za)+Ta*Za,bb,pa),kb=Cb,mb=(Lb+1)/Ia,rb=b.clamp(aa*(1-mb)+Ta*mb,bb,pa),tb=Sa?(Math.PI/2-2*Math.atan(Math.exp(-rb/Ba)))*Ba:rb*Z,yb=b.clamp(mb,ib,Xa);Cb=Vb;Vb=tb;const zb=b.clamp(qa,Ra,$a);let Ab=zb*Z,Fb=p.sampleElevation(zb,oa,Ua);const Qb=1/Ia,sb=b.clamp(Qb,gb,La),vb=b.clamp(qa*(1-sb)+Ja*sb,Ra,$a);let Gb=sb,Hb=vb,Tb=vb*Z,lc=p.sampleElevation(vb,oa,Ua);if(1===Lb){const Ub=Tb-xb,Zb=Cb-pb,ac=lc-Bb,Mb=0*bc;Kb[Mb]=Ub;Kb[Mb+1]=Zb;Kb[Mb+2]=ac;K(Ub,Zb,ac,eb);const Jb=b.clamp(Qb,gb,La);f.encodeUVInBuffer(nb,
Ib,Jb,Fa)}for(let Ub=1;Ub<=Wa;Ub++){const Zb=Tb,ac=lc,Mb=(Ub+1)/Ia,Jb=b.clamp(Mb,gb,La),Wb=b.clamp(qa*(1-Mb)+Ja*Mb,Ra,$a),cc=Hb;Hb=Wb;const Db=Ib+1,Nb=Db*bc;if(1===Lb||Ub===Wa){const Hc=p.sampleElevation(Wb,oa,Ua),Oc=Wb*Z,dd=Va,Yc=Hc;if(1===Lb&&Ub<Wa){const Ic=Oc-xb,wc=dd-pb,qc=Yc-Bb;Kb[Nb]=Ic;Kb[Nb+1]=wc;Kb[Nb+2]=qc;K(Ic,wc,qc,eb);f.encodeUVInBuffer(nb,Db,Jb,Fa)}Tb=Oc;lc=Yc}else Tb=Kb[Nb]+xb,lc=Kb[Nb+2]+Bb;const hc=Tb,xc=lc,nc=Ab,Xb=Fb;Ab=Zb;Fb=ac;const tc=(Ib-Wa)*bc,Yb=1===Lb?p.sampleElevation(cc,
fb,Ua):Kb[tc+2]+Bb,dc=p.sampleElevation(cc,rb,Ua);if(Lb<Wa){const Hc=Ib+Wa,Oc=Hc*bc,dd=Zb-xb,Yc=tb-pb,Ic=dc-Bb;Kb[Oc]=dd;Kb[Oc+1]=Yc;Kb[Oc+2]=Ic;K(dd,Yc,Ic,eb);const wc=Gb;Gb=Jb;f.encodeUVInBuffer(nb,Hc,wc,yb)}const Gc=hc-nc,Cc=kb-tb,uc=Cc*(xc-Xb),oc=Gc*(Yb-dc),yc=-Cc*Gc,Dc=uc*uc+oc*oc+yc*yc;if(0===Dc)w.compressNormal(qb,Ib,0,0,1,ub);else{const Hc=1/Math.sqrt(Dc);w.compressNormal(qb,Ib,uc*Hc,oc*Hc,yc*Hc,ub)}++Ib}}}}da.edgeVerticesStartIndex=Ma;N(U);u(U);z(da,[],fa);U.intersectionData=null};a.createSphericalGlobePatch=
function(U,Z){const {tile:ca,geometry:ea,geometryState:da}=U,{extentInRadians:ia,surface:ka}=ca,{isWebMercator:fa,renderer:X}=ka,{numVerticesPerSide:ja,wireframe:la}=da,na=ja-1,va=(ja-2)**2,za=fa&&(Z===k.PatchType.HAS_SOUTH_POLE||Z===k.PatchType.HAS_BOTH_POLES),ya=fa&&(Z===k.PatchType.HAS_NORTH_POLE||Z===k.PatchType.HAS_BOTH_POLES),Da=6*((za?1:0)+(ya?1:0))*ja,ra=J(da),xa=X.tileGeometryCache.acquire(va+Da+4*ra);ea.numVerticesPerSide=ja;ea.vertexAttributes=xa;ea.maxEdgeVertexCount=ra;const {boundingBox:Ma}=
ea;q.empty(Ma);const Ga=n(U);V.update(na,ia,Ga);{const {tile:Xa}=U;if(Xa.intersectsClippingArea){var {geometry:Pa,geometryState:Qa,localOrigin:Ea}=U,{numVerticesPerSide:ua,samplerData:Na}=Qa,Ua=ua-2,wa=ua-1,{vertexAttributes:sa,boundingBox:Ha}=Pa,Ka=sa.position,Aa=sa.uv0,{typedBuffer:Sa,typedBufferStride:Ya}=sa.normalCompressed,{extent:qa}=Xa,aa=qa[0],Ja=qa[2],Ta=qa[1],Ra=qa[3],$a=Xa.ellipsoid.radius,bb=Ea[0],pa=Ea[1],Ba=Ea[2],Ia=Ka.typedBuffer,Wa=Ka.typedBufferStride,gb=1/wa,ib=0;if(1<=Ua){const eb=
Ta*(1-gb)+Ra*gb,db=V.sinLatLUT[1],jb=V.cosLatLUT[1];for(let nb=1;nb<=Ua;nb++){const qb=nb*gb,ub=V.sinLonLUT[nb],xb=V.cosLonLUT[nb],pb=$a+p.sampleElevation(aa*(1-qb)+Ja*qb,eb,Na),Bb=-bb+pb*xb*jb,Kb=-pa+pb*ub*jb,bc=-Ba+pb*db;K(Bb,Kb,bc,Ha);const Ib=(nb-1)*Wa;Ia[Ib]=Bb;Ia[Ib+1]=Kb;Ia[Ib+2]=bc;f.encodeUVInBuffer(Aa,nb-1,qb,gb)}}for(let eb=1;eb<=Ua;eb++){const db=eb*gb,jb=Ta*(1-db)+Ra*db,nb=V.sinLatLUT[eb],qb=V.cosLatLUT[eb],ub=eb+1,xb=ub*gb,pb=Ta*(1-xb)+Ra*xb,Bb=V.sinLatLUT[ub],Kb=V.cosLatLUT[ub],bc=
V.sinLonLUT[0],Ib=V.cosLonLUT[0],$b=$a+p.sampleElevation(aa,jb,Na);let kc=Ib*qb*$b-bb,fc=bc*qb*$b-pa,Pb=nb*$b-Ba;const Cb=ib*Wa;let Vb=Ia[Cb],gc=Ia[Cb+1],Lb=Ia[Cb+2];for(let lb=1;lb<=Ua;lb++){const oa=lb*gb,Fa=aa*(1-oa)+Ja*oa,Va=V.sinLonLUT[lb],Za=V.cosLonLUT[lb];let fb=0,kb=0,mb=0;if(lb<Ua){const Db=(ib+1)*Wa;fb=Ia[Db];kb=Ia[Db+1];mb=Ia[Db+2]}else{const Db=V.sinLonLUT[wa],Nb=V.cosLonLUT[wa],hc=$a+p.sampleElevation(Ja,jb,Na);fb=Nb*qb*hc-bb;kb=Db*qb*hc-pa;mb=nb*hc-Ba}const rb=kc,tb=fc,yb=Pb;kc=Vb;
fc=gc;Pb=Lb;Vb=fb;gc=kb;Lb=mb;const zb=fb-rb,Ab=kb-tb,Fb=mb-yb;let Qb=0,sb=0,vb=0;if(1<eb){const Db=(ib-Ua)*Wa;Qb=Ia[Db];sb=Ia[Db+1];vb=Ia[Db+2]}else{const Db=V.sinLatLUT[0],Nb=V.cosLatLUT[0],hc=$a+p.sampleElevation(Fa,Ta,Na);Qb=Za*Nb*hc-bb;sb=Va*Nb*hc-pa;vb=Db*hc-Ba}const Gb=$a+p.sampleElevation(Fa,pb,Na),Hb=Za*Kb*Gb-bb,Tb=Va*Kb*Gb-pa,lc=Bb*Gb-Ba;if(eb<Ua){const Db=ib+Ua,Nb=Db*Wa;Ia[Nb]=Hb;Ia[Nb+1]=Tb;Ia[Nb+2]=lc;K(Hb,Tb,lc,Ha);f.encodeUVInBuffer(Aa,Db,oa,xb)}const Ub=Qb-Hb,Zb=sb-Tb,ac=vb-lc;let Mb=
Za*qb,Jb=Va*qb,Wb=nb;.999>Wb*Wb&&(Mb=Fb*Zb-Ab*ac,Jb=zb*ac-Fb*Ub,Wb=Ab*Ub-zb*Zb);const cc=1/Math.sqrt(Mb*Mb+Jb*Jb+Wb*Wb);w.compressNormal(Sa,ib,Mb*cc,Jb*cc,Wb*cc,Ya);++ib}}}}ea.poleVerticesStartIndex=va;const La=v(U,za,ya);ea.edgeVerticesStartIndex=va+Da;N(U);m(U);z(ea,La,la);U.intersectionData=null};a.updateCornerSpherical=function(U){U.tile.intersectsClippingArea&&(I(U),r(U,!0),L(U),U.intersectionData=null)};a.updateCornersPlanar=function(U,Z){U.tile.intersectsClippingArea&&(I(U),x(U,!0),L(U),U.intersectionData=
null)};a.updateEdgeElevationsAndResolutionsPlanar=function(U,Z){U.tile.intersectsClippingArea&&(E(U),u(U),L(U),P(U),U.intersectionData=null)};a.updateEdgeElevationsAndResolutionsSpherical=function(U){U.tile.intersectsClippingArea&&(E(U),m(U),L(U),P(U),U.intersectionData=null)};a.updateEdgesAndCornersPlanar=function(U,Z){U.tile.intersectsClippingArea&&(u(U),L(U),U.intersectionData=null)};a.updateEdgesAndCornersSpherical=function(U){U.tile.intersectsClippingArea&&(m(U),L(U),U.intersectionData=null)};
Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/PatchGeometry":function(){define("exports ../../../core/maybe ../../../chunks/vec32 ../../../geometry/support/aaBoundingBox ./terrainUtils ../webgl-engine/lib/Normals".split(" "),function(a,b,q,l,p,k){function h(c,e,g,d){c.setValues(e,16384*g,16384*d)}class f{constructor(){this.indices=null;this.poleIndicesStartIndex=this.edgeIndicesStartIndex=this.indexCount=0;this.vertexAttributes=null;this.maxEdgeVertexCount=
this.poleVerticesStartIndex=this.edgeVerticesStartIndex=0;this.boundingBox=l.empty();this.minv=this.minu=this.numVerticesPerSide=0;this.maxv=this.maxu=1;this.outerEdgesOffsetAndLength=[0,0,0,0,0,0,0,0]}release(){this.vertexAttributes=b.releaseMaybe(this.vertexAttributes);this.indices=null}reset(){this.vertexAttributes=this.indices=null;l.empty(this.boundingBox);this.numVerticesPerSide=0}getEdgeFirstVertexIndex(c){return this.outerEdgesOffsetAndLength[2*c]}getEdgeCount(c){return this.outerEdgesOffsetAndLength[2*
c+1]}getEdgeVertexIndex(c,e){return this.getEdgeAttributeIndex(c,e)}getEdgeVertexPosition(c,e,g,d){this._getEdgeVertexRaw(this.getEdgeAttributeIndex(c,d),e);q.add(e,e,g)}getEdgeNormal(c,e,g){const {typedBuffer:d,typedBufferStride:t}=this.vertexAttributes.normalCompressed;k.decompressNormal(e,d,this.getEdgeAttributeIndex(c,g),t)}setEdgeNormalFromValues(c,e,g,d,t){this._setNormal(this.getEdgeAttributeIndex(c,e),g,d,t)}setEdgeVertexFromValuesRawPositionUV(c,e,g,d,t,w,v){c=this.getEdgeAttributeIndex(c,
e);this.vertexAttributes.position.setValues(c,g,d,t);this._setUV(c,w,v)}setEdgeVertexFromValuesRawPositionUVNormal(c,e,g,d,t,w,v,m,r,n){c=this.getEdgeAttributeIndex(c,e);this.vertexAttributes.position.setValues(c,g,d,t);this._setUV(c,w,v);this._setNormal(c,m,r,n)}_getEdgeVertexRaw(c,e){this.vertexAttributes.position.getVec(c,e)}_setNormal(c,e,g,d){const {typedBuffer:t,typedBufferStride:w}=this.vertexAttributes.normalCompressed;k.compressNormal(t,c,e,g,d,w)}_setUV(c,e,g){h(this.vertexAttributes.uv0,
c,e,g)}getEdgeAttributeIndex(c,e){p.internalAssert(0<=e&&e<this.getEdgeCount(c));return this.getEdgeFirstVertexIndex(c)+e}}a.PatchGeometry=f;a.encodeUVInBuffer=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/PatchGeometryLUT":function(){define(["exports","./TerrainConst"],function(a,b){class q{constructor(){this.sinLonLUT=Array(b.maxPatchTesselation+1);this.cosLonLUT=Array(b.maxPatchTesselation+1);this.sinLatLUT=Array(b.maxPatchTesselation+1);this.cosLatLUT=
Array(b.maxPatchTesselation+1)}update(l,p,k){const h=p[0];p=p[2];for(let c=0;c<=l;c++){var f=c/l;const e=h*(1-f)+p*f;this.sinLonLUT[c]=Math.sin(e);this.cosLonLUT[c]=Math.cos(e);f=k(f);this.sinLatLUT[c]=Math.sin(f);this.cosLatLUT[c]=Math.cos(f)}}}a.PatchGeometryLUT=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/PatchRenderData":function(){define("exports ../../../core/arrayUtils ../../../core/has ../../../core/mathUtils ../../../core/maybe ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/support/aaBoundingRect ../../../geometry/support/Ellipsoid ../support/buffer/glUtil ./GeometryState ./LayerClass ./NeighborIndex ./PatchGeometry ./TerrainConst ./terrainUtils ./TextureFader ./Tile ./TileOverlayData ./tileUtils ../webgl-engine/lib/VertexArrayObject ../webgl-engine/shaders/TerrainTechnique ../../webgl/BufferObject ../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){function C(P,M){return M?.isLoaded||M===P?M:null}class D{constructor(){this.geometry=new w.PatchGeometry;this._texture=this._vao=this.geometryState=this.intersectionData=null;this._textureRef=new r.TextureFader(()=>this.tile.surface.fadeDuration);this.overlay=new u;this._localOrigin=null;this._geometryStateChangedSinceLastUpdate=!0;this._hasGeometry=!1;this._modifiedFlags=0}get tile(){return this._tile}get localOrigin(){return this._localOrigin}init(P,
M){this.clear();this._tile=P;this.geometry.reset();this.intersectionData=null;this.geometryState=new g.GeometryState;this._localOrigin=M;this.overlay.clear()}clear(){this.releaseGeometry();this.releaseTexture();this._textureRef.clear();this.geometryState=this.intersectionData=this._tile=null}updateGeometryIfNeeded(P){if(!this._vao||this._geometryStateChangedSinceLastUpdate||this.wireframeChanged||this.clippingAreaChanged||this.samplerDataChanged||this.numVerticesPerSideChanged||this.dirtyCorners||
this.dirtyEdgeResolutions||this.dirtyEdges)this._updateGeometry(P),this._geometryStateChangedSinceLastUpdate=!1;if(m.enableTerrainInternalChecks&&this.tile.intersectsClippingArea)for(P=0;4>P;++P)m.internalAssert(this.geometry.getEdgeCount(P)===this.geometryState.edgeResolutions[P]+1)}_calculateEdgeResolution(P,M){const K=this.tile,J=this.geometryState.numVerticesPerSide-1;if(!K.surface.isGlobal){var R=K.surface.extent;if(null!=R&&(0===P&&K.extent[3]>R[3]||1===P&&K.extent[2]>R[2]||2===P&&K.extent[1]<
R[1]||3===P&&K.extent[0]<R[0]))return J}const Q=K.level;R=m.neighborEdgeIndices[P];if(!M)return m.internalAssert(null==K.surface?.rootTiles||K.surface.updatingRootTiles||!K.shouldHaveNeighbor(R)),J;if(M.isLoaded)return R=M.renderData.geometryState,M=Q-M.level,m.internalAssert(0<=M),0===M?Math.max(R.numVerticesPerSide-1,J):Math.max(1,R.edgeResolutions[(P+2)%4]/2**M);m.internalAssert(!M.isLeaf);let W=J;M.forAllSubtreeOnSide(m.oppositeEdge(R),S=>{if(S===K)return!0;if(S.isLoaded)return W=Math.max(W,2**
(S.level-Q)),!0;m.internalAssert(!S.isLeaf);return!1});return W}updateNeighborData(){const P=this.tile;if(P.intersectsClippingArea){var M=P.renderData.geometryState,K=Y=>(Y.isLoaded||Y.level===P.level)&&Y?.intersectsClippingArea,J=M.edgePeerNeighbors,R=M.edgePeerNeighborSamplerVersions;for(var Q=0;4>Q;++Q){var W=P.findNeighborTile(m.neighborEdgeIndices[Q],K),S=C(P,W),V=S?.renderData?.geometryState.samplerDataVersion??-1,T=C(P,J[Q]);S=S!==T;T=R[Q]!==V;m.enableTerrainInternalChecks&&W&&(m.internalAssert(P.level>=
W.level),m.internalAssert(P.level-W.level<=v.maxTileNeighborLevelDelta));J[Q]=W;if(S||T)R[Q]=V,this._markEdgeDirty(Q);V=M.edgeResolutions[Q];W=this._calculateEdgeResolution(Q,W);m.internalAssert(l.isPowerOfTwo(W));m.internalAssert(1<=W);M.edgeResolutions[Q]=W;V!==W&&this._markEdgeResolutionDirty(Q)}for(let Y=0;4>Y;++Y){W=P.findNeighborTile(m.neighborCornerIndices[Y],K);M.cornerPeerNeighbors[Y]=W;R=C(P,J[Y]);Q=C(P,J[(Y+1)%4]);W=C(P,W);O[Y]=W;O[(Y+1)%4]=Q;O[(Y+2)%4]=P;O[(Y+3)%4]=R;m.internalAssert(O.some(U=>
U?.isLoaded||U===P));const ha=O.reduce((U,Z)=>Math.min(U,Z?.level??Infinity),Infinity);O.forEach((U,Z)=>{U&&U?.level>ha&&(O[Z]=null)});m.internalAssert(O.some(U=>U?.isLoaded||U===P));const ba=M.cornerNeighborCornerTiles;R=M.cornerNeighborCornerTileSamplerVersions;for(Q=0;4>Q;++Q){W=O[Q];V=W?.renderData.geometryState.samplerDataVersion??-1;S=4*Y+Q;T=ba[S]!==W;const U=!T&&R[S]!==V;if(T||U)ba[S]=W,R[S]=V,this._markCornerDirty(Y)}m.enableTerrainInternalChecks&&m.internalAssert(L.some(U=>ba[4*Y+U]?.isLoaded||
ba[4*Y+U]===P))}m.enableTerrainInternalChecks&&m.internalAssert(this.geometryState.edgeResolutions.every(Y=>0<Y));for(M=0;4>M;++M)O[M]=null}}_updateGeometry(P){if(this.tile.intersectsClippingArea){m.enableTerrainInternalChecks&&m.internalAssert(!this.tile.intersectsClippingArea||this.geometryState.edgeResolutions.every(T=>0<T));this.intersectionData=null;var {tile:M,_vao:K,geometry:J,geometryState:R}=this,Q={geometry:J},W=!K||!Q||this.wireframeChanged||this.samplerDataChanged||this.clippingAreaChanged||
this.numVerticesPerSideChanged;Q=0!==this.dirtyEdgeResolutions;var S=R.edgeResolutions.reduce((T,Y)=>T+Y+1,0);W=W||Q&&S>(J?.maxEdgeVertexCount??0);S=!W&&Q;Q=!S&&(0!==this.dirtyEdges||Q);var V=!Q&&0!==this.dirtyCorners;W?(this.releaseGeometry(),this._createGeometry(P)):S?M.updateEdgeElevationsAndResolutions():Q||V?M.updateEdgeElevations():V?M.updateCornerElevations():console.warn("Update for no reason?");this._modifiedFlags=0}}get hasGeometry(){return this._hasGeometry}releaseGeometry(){this._hasGeometry=
!1;this.intersectionData=null;if(!this._vao)return!1;this._vao=p.disposeMaybe(this._vao);this.geometry.release();return!0}ensureTexture(P,M,K){M=M?B.PixelFormat.RGBA:B.PixelFormat.RGB;null==this._texture||this._texture.descriptor.width===P&&this._texture.descriptor.pixelFormat===M||this.releaseTexture();null==this._texture&&(this._texture=K(),this.tile.setMemoryDirty());return this._texture}releaseTexture(){null!=this._texture&&(this._texture.release(),this._texture=null,this.tile.setMemoryDirty())}get numVerticesPerSideChanged(){return 0!==
(this._modifiedFlags&1)}get samplerDataChanged(){return 0!==(this._modifiedFlags&2)}get clippingAreaChanged(){return 0!==(this._modifiedFlags&4)}get wireframeChanged(){return 0!==(this._modifiedFlags&8)}get dirtyEdges(){return this._modifiedFlags>>4&15}get dirtyCorners(){return this._modifiedFlags>>8&15}get dirtyEdgeResolutions(){return this._modifiedFlags>>12&15}_markCornerDirty(P){this._modifiedFlags|=1<<P<<8}_markEdgeDirty(P){this._modifiedFlags|=1<<P<<4;this._markCornerDirty((P+0)%4);this._markCornerDirty((P+
3)%4)}_markEdgeResolutionDirty(P){this._modifiedFlags|=1<<P<<12;this._markEdgeDirty(P)}_markAllEdgesAndCornersDirty(){this._modifiedFlags|=65520}updateGeometryState(){var P=this._getElevationInfo();const M=this.tile;var K=P.samplerData?M.getElevationVerticesPerSide(P.maxTileLevel):M.getDefaultVerticesPerSide();const J=Math.max(K,5);let R=M.clippingArea;if(!M.intersectsClippingArea||M.isWithinClippingArea)R=null;K=this.geometryState;let Q=!1;K.numVerticesPerSide!==J&&(this._modifiedFlags|=1,K.numVerticesPerSide=
J,K.samplerDataVersion++,Q=!0);P.changed&&(this._modifiedFlags|=2,K.samplerData=P.samplerData,K.samplerDataVersion++,Q=!0);b.equals(K.clippingArea,R)||(this._modifiedFlags=4,K.clippingArea=R,Q=!0);P=M.surface.wireframe;K.wireframe!==P&&(this._modifiedFlags=8,K.wireframe=P,Q=!0);this._geometryStateChangedSinceLastUpdate||(this._geometryStateChangedSinceLastUpdate=Q);Q&&this._markAllEdgesAndCornersDirty();this._hasGeometry=!0;return this._geometryStateChangedSinceLastUpdate}_createGeometry(P){this.tile.createGeometry();
const M=this.geometry.vertexAttributes,K=this.geometry.indices,J=P.gl;this._vao=new y.VertexArrayObject(P,z.terrainVertexAttributeLocations,{geometry:e.glLayout(M.layout)},{geometry:A.BufferObject.createVertex(P,J.STATIC_DRAW,M.buffer)},A.BufferObject.createIndex(P,J.STATIC_DRAW,K));this._hasGeometry=!0}get vao(){return this._vao}setTextureReference(P,M=r.ActivationTime.Immediate){null!=P&&P.texture!==this._texture&&this.releaseTexture();this._textureRef.push(P,M)}get textureReference(){return this._textureRef.current}get nextTextureReference(){return this._textureRef.next}get textureFadeFactor(){return this._textureRef.fadeFactor}get textureIsFading(){return this._textureRef.isFading}_getElevationInfo(){var P=
this.geometryState.samplerData;const M=this.tile.layerInfo[d.LayerClass.ELEVATION],K=M.length,J=Array(K);let R=0;var Q=0;let W=!1;for(let T=0;T<K;T++){var S=M[T];if(null!=S.upsampleInfo){S=S.upsampleInfo.tile;var V=S.layerInfo[d.LayerClass.ELEVATION][T].data;V=V&&V.samplerData;P&&P[R]===V||(W=!0);J[R++]=V;Q=Math.max(Q,S.lij[0])}else S.data&&(V=this.tile.surface.layerViewByIndex(T,d.LayerClass.ELEVATION),x.fallsWithinLayer(this.tile,V.layer,!1)&&(Q=S.data,P&&P[R]===Q.samplerData||(W=!0),J[R++]=Q.samplerData,
Q=this.tile.level))}null!=P&&P.length!==R&&(W=!0);if(P=0<R)J.length=R;return{changed:W,samplerData:P?J:null,maxTileLevel:Q}}get estimatedGeometryMemoryUsage(){return(this.geometry.indices?.byteLength??0)+(this.geometry.vertexAttributes?.byteLength??0)+(this.intersectionData?.estimatedMemoryUsage??0)}get texture(){return this._texture}get test(){}checkGeometryWaterproofness(){if(m.enableTerrainInternalChecks){var P=this.tile;if(P.isLoaded&&P.intersectsClippingArea&&0!==P.level){var M=P.surface.extent;
if(null==M||P.intersectsExtent(M)){var K=m.neighborEdgeIndices.map((W,S)=>null!=M?0>(2>S?-1:1)*(P.extent[3-S]-M[3-S]):!1),J=P.level;m.internalAssert(0===this.dirtyCorners);m.internalAssert(0===this.dirtyEdges);m.internalAssert(0===this.dirtyEdgeResolutions);m.internalAssert(!this.numVerticesPerSideChanged);m.internalAssert(!this.samplerDataChanged);m.internalAssert(!this.clippingAreaChanged);m.internalAssert(!this.wireframeChanged);var R=m.neighborCornerIndices.map(W=>P.findNeighborCornerTileExact(W,
S=>!S.intersectsClippingArea||S.isLoaded||S.level===P.level)??null).map(W=>W?.intersectsClippingArea?W:null),Q=this.geometryState;for(let W=0;4>W;++W){const S=Q.cornerPeerNeighbors[W],V=R[W];m.internalAssert(V===S,`Tile[${P.lij}].corner[${W}] out of date: cur=[${S?.lij}] exp=[${V?.lij}]`)}m.neighborEdgeIndices.forEach((W,S)=>{if(!K[S]){var V=P.findNeighborTile(W,Ma=>(Ma.level===J||Ma?.isLoaded)&&Ma?.intersectsClippingArea);if(V){m.internalAssert(V.isLoaded||V.level===P.level);m.internalAssert(V===
this.geometryState.edgePeerNeighbors[S]);var T=J-V.level;if(V.isLoaded){var Y=V.renderData;m.internalAssert(n.isEdgeNeighbor(P,V,W));m.internalAssert(0<=T);var ha=2**T;if(0>T)m.internalAssert(!1);else{var ba=P.renderData,U=ba.geometry,Z=ba.localOrigin,ca=U.getEdgeCount(S),ea=U.numVerticesPerSide-1,da=Y.geometry;if(da){var ia=Y.localOrigin,ka=this.geometryState.edgePeerNeighbors[S];ka?.isLoaded&&(ka=ka.renderData,m.internalAssert(ba.geometryState.edgePeerNeighborSamplerVersions[S]===ka.geometryState.samplerDataVersion),
m.internalAssert(this.geometryState.edgePeerNeighborSamplerVersions[S]===ka.geometryState.samplerDataVersion));var fa=(S+2)%4,X=da.getEdgeCount(fa);ka=ca-1;var ja=X-1;m.internalAssert(ka*ha===ja,`Tile[${P.lij}]:e${S},res=${ka} edgeRes mismatch with`+` Neighbor[${V.lij}]:e${fa},res=${ja} (expected:${ka*ha})`);ka=P.extent;ja=W===t.NeighborIndex.NORTH||W===t.NeighborIndex.SOUTH;var la=X-1,na=la>>T,va=ca-1;if(1>na)m.internalAssert(1===va);else{m.internalAssert(na===va);m.internalAssert(l.isPowerOfTwo(na));
va=da.numVerticesPerSide-1;m.internalAssert(0<T||na===Math.max(va,ea));T=P.getNeighborEdgeStartVertexIndex(S,V);m.internalAssert(0<=T&&T<ha);ha=T*na;m.internalAssert(0<=ha&&ha<=la-na);var za=0,ya=ha;U.getEdgeVertexPosition(S,F,Z,0);U.getEdgeVertexPosition(S,H,Z,ca-1);ha=k.distance(F,H);ha=Math.max(1,1E-4*ha);for(T=0;T<=na;++T){U.getEdgeVertexPosition(S,F,Z,za);da.getEdgeVertexPosition(fa,H,ia,ya);ea=T/na;var Da=ja?ka[0]+ea*(ka[2]-ka[0]):W===t.NeighborIndex.WEST?ka[0]:ka[2],ra=ja?W===t.NeighborIndex.SOUTH?
ka[1]:ka[3]:ka[1]+ea*(ka[3]-ka[1]);const Ma=P.surface.extent;if(null==Ma||f.containsXY(Ma,Da,ra)){ea=k.dist(F,H);la=k.len(F)-c.earth.radius;va=k.len(H)-c.earth.radius;var xa=ea<ha;xa||(console.warn("Tile edge vertex position mismatch: between"+` [${P.lij}].edge${S}[${za}/${ca}] and`+` [${V.lij}].edge${fa}[${ya}/${X}]`),null!=Ma&&console.warn(" surface extent\x3d ",Ma," x,y\x3d",Da,",",ra),Da=h.create(),k.subtract(Da,ba.localOrigin,Y.localOrigin),0<k.len(Da)&&console.warn(` localOrigins: ${ba.localOrigin} vs ${Y.localOrigin}`+
` d=${k.len(Da)} [${Da}]`),(()=>{const Pa=h.clone(F),Qa=h.clone(H);P.updateEdgeElevations();V.updateEdgeElevations();U.getEdgeVertexPosition(S,F,Z,za);da.getEdgeVertexPosition(fa,H,ia,ya);const Ea=h.create();k.sub(Ea,F,Pa);0<k.len(Ea)&&console.warn(` XXX Tile[${P.lij}] edge out of date: ${Pa} vs ${F} d=${k.len(Ea)} [${Ea}]`);k.sub(Ea,H,Qa);0<k.len(Ea)&&console.warn(` XXX Neighbor[${V.lij}] edge out of date: ${Qa} vs ${H} d=${k.len(Ea)} [${Ea}]`)})(),Da=U.getEdgeCount(S),ra=da.getEdgeCount(X),m.internalAssert(xa,
"Mismatch in tile"+` [${P.lij}].edge[${S}][${za}/${Da}] vs neighbor`+` [${V.lij}].edge[${fa}][${ya}/${ra}]`+` ${m.v32s(F)} vs ${m.v32s(H)} dist=${ea} h(t|n|d)=${la}|${va}|${va-la}`));U.getEdgeNormal(S,N,za);da.getEdgeNormal(fa,E,ya);k.normalize(G,N);k.normalize(I,E);const Ga=k.dot(G,I);ea=.01>1-Ga||P===V;if(!ea){const Pa=h.create();k.sub(Pa,N,E);la=()=>`Mismatch in tile edge normal ${m.lij2s(P.lij)} (${za}/${ca-1}) edge ${S} vs neighbor ${m.lij2s(V.lij)} (${ya}/${X-1}) nedge ${fa} :`+`${m.v32s(N)} vs ${m.v32s(E)} dot = ${Ga} : ${m.v32s(Pa)}`;
console.warn("Mismatch in tile edge normal: ",la());P.updateEdgeElevations();V.updateEdgeElevations();va=h.create();xa=h.create();U.getEdgeNormal(S,va,za);da.getEdgeNormal(fa,xa,ya);k.equals(N,va)||console.warn("Missing update in tile normal: ",m.v32s(N)," \x3d\x3e ",m.v32s(va));k.equals(E,xa)||console.warn("Missing update in neighbor normal: ",m.v32s(E)," \x3d\x3e ",m.v32s(xa));m.internalAssert(ea,la())}}za+=1;ya+=1}}}else m.internalAssert(!1)}}else m.internalAssert(!V.isLeaf),m.internalAssert(0===
T)}else W=!P.surface.updatingRootTiles&&null!=P.surface.rootTiles&&0<P.surface.rootTiles.length&&P.shouldHaveNeighbor(W),m.internalAssert(!W)}})}}else m.internalAssert(P?.isLoaded)}}}const F=h.create(),H=h.create(),N=h.create(),E=h.create(),G=h.create(),I=h.create(),O=[null,null,null,null],L=[0,1,2,3];Object.defineProperty(a,"ActivationTime",{enumerable:!0,get:()=>r.ActivationTime});a.PatchRenderData=D;a.neighborTileIfLoadedOrSelf=C;a.zeroToFour=L;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/terrain/GeometryState":function(){define(["exports"],function(a){class b{constructor(){this.numVerticesPerSide=0;this.samplerData=null;this.samplerDataVersion=0;this.clippingArea=null;this.wireframe=!1;this.cornerPeerNeighbors=[null,null,null,null];this.cornerNeighborCornerTiles=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];this.cornerNeighborCornerTileSamplerVersions=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];this.edgeResolutions=[-1,-1,-1,
-1];this.edgePeerNeighbors=[null,null,null,null];this.edgePeerNeighborSamplerVersions=[-1,-1,-1,-1]}}a.GeometryState=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TextureFader":function(){define(["exports","../../../core/maybe","./interfaces"],function(a,b,q){class l{constructor(p){this._getFadeDuration=p;this._delayedTime=this._fadeStart=0}clear(){this._current=b.destroyMaybe(this._current);this._next=b.destroyMaybe(this._next);this._waiting=b.destroyMaybe(this._waiting);
this._delayed=b.destroyMaybe(this._delayed)}get current(){if(null==this._current)return null;if(!this._isFadingEnabled){var p=this._delayed||this._waiting||this._next||this._current;p!==this._current&&(this._current=null,this.clear(),this._current=p)}p=l.test.fadeMoment;null!=this._delayed&&(p=p||performance.now(),p>=this._delayedTime&&(this._push(this._delayed,a.ActivationTime.Immediate),this._delayed=null));if(null!=this._next){p=p||performance.now();const k=this._next.type!==q.TextureUpdate.FADING,
h=p-this._fadeStart>=this._fadeDuration;if(null!=this._current&&this._next.texture===this._current.texture||k||h)b.destroyMaybe(this._current),this._current=this._next,this._next=this._waiting,this._waiting=null,this._fadeStart=this._alignFadeStart(p)}return this._current}get next(){return this._next}get fadeFactor(){if(null==this._next)return 1;var p=l.test.fadeMoment||performance.now();p=Math.max(0,p-this._fadeStart);const k=this._fadeDuration;return p>k?0:1-p/k}get isFading(){return null!=this._next||
null!=this._delayed}push(p,k=a.ActivationTime.Immediate){this._delayed=b.destroyMaybe(this._delayed);this._push(p,k)}_push(p,k){this._isFadingEnabled||this.clear();if(null==this._current)this._current=p;else{var h=l.test.fadeMoment||performance.now();k!==a.ActivationTime.Immediate?(this._delayed=p,this._delayedTime=h+k):null==this._next?(this._next=p,this._fadeStart=this._alignFadeStart(h)):null!=p&&(b.destroyMaybe(this._waiting),this._waiting=p)}}get _fadeDuration(){return null==this._waiting?this._getFadeDuration():
.5*this._getFadeDuration()}_alignFadeStart(p){const k=this._getFadeDuration();return p+k-p%k}get _isFadingEnabled(){return 0<this._getFadeDuration()}}l.test={fadeMoment:0};a.ActivationTime=void 0;(function(p){p[p.Immediate=0]="Immediate";p[p.Delayed=5E3]="Delayed"})(a.ActivationTime||(a.ActivationTime={}));a.TextureFader=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/Tile":function(){define("exports ../../../core/mathUtils ../../../core/maybe ../../../core/ObjectPool ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../core/libs/gl-matrix-2/math/common ../../../geometry/ellipsoidUtils ../../../geometry/support/aaBoundingRect ../../../chunks/sphere ../../../layers/support/layerUtils ./ElevationBounds ./ElevationTileAgent ./interfaces ./LayerClass ./MapTileAgent ./NeighborIndex ./TerrainConst ./TerrainData ./terrainUtils ./TileAgent ./TileFrustumVisibility ./TilePerLayerInfo ./TileUpdate ./tileUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C){function D(J){J.dispose();t.isElevationTileAgent(J)?I.release(J):m.isMapTileAgent(J)&&G.release(J)}function F(J,R){return J[0]===R[0]&&J[1]===R[1]&&J[2]===R[2]}function H(J,R,Q){return null==J||null==R||R===J?!1:J.level>=R.level?N(J,R,Q):N(R,J,x.oppositeCorner(Q))}function N(J,R,Q){x.internalAssert(J.level>=R.level);var W=x.isWestCorner(Q),S=x.isNorthCorner(Q),V=J.extent;Q=R.extent;var T=[W?V[0]:V[2],S?V[3]:V[1]];const Y=[W?Q[2]:Q[0],S?Q[1]:
Q[3]];W=1E-5*(V[2]-V[0]);S=x.almostEquals(T[0],Y[0],W)||J.surface.isGlobal&&x.almostEquals(T[0],-Y[0],W);T=x.almostEquals(T[1],Y[1],W);if(S&&T)return!0;if(J.level===R.level||!S&&!T)return x.internalAssert(!1),!1;S?(J=V[1],V=V[3],Q=Q[1]-W<=J&&J<=V&&V<=Q[3]+W):(J=V[0],V=V[2],Q=Q[0]-W<=J&&J<=V&&V<=Q[2]+W);x.internalAssert(Q);return Q}class E{constructor(){this._lij=[0,0,0];this._children=[null,null,null,null];this._pendingUpdates=0;this.renderData=null;this._dirty=!0;this._previouslyRendered=!1;this.extent=
c.create();this._elevationBoundsMin=NaN;this._elevationBoundsMax=0;this.layerInfo=[[],[]];this.extentInRadians=c.create();this.centerAtSeaLevel=k.create();this._center=[k.create(),e.create(),k.create()];this.up=k.unitZ();this._intersectsClippingArea=this._isWithinClippingArea=!0;this._maxTesselation=0;this._usedMemory=null;this.extentMidY=this.extentMidX=this._curvatureHeight=this._edgeLen2=this._edgeLen=this.renderOrder=this.screenDepth=this._mapDataRefCount=this._mapTileMemoryInternal=0;this.distanceToPOI=
-1;this._lastPOI=k.create();this.unmergableChildCount=this.maxLevelDeltaNeighborCount=0}get lij(){return this._lij}get elevationLevelDelta(){return this._surface.getElevationLevelDelta(this.level)}static prune(){G.prune(0);I.prune(0);A.TilePerLayerInfo.prune()}get _isCached(){return!this.isLeaf&&0>=this._mapDataRefCount}get maxTesselation(){return this._maxTesselation}get isWithinClippingArea(){return this._isWithinClippingArea}get intersectsClippingArea(){return this._intersectsClippingArea}get clippingArea(){return this._clippingArea}get parent(){return this._parent}get children(){return this._children}get surface(){return this._surface}get elevationBoundsMin(){return this._elevationBoundsMin}get elevationBoundsMax(){return this._elevationBoundsMax}get level(){return this._lij[0]}get key(){return`${this._lij[0]}/${this._lij[1]}/${this._lij[2]}`}get edgeLen(){return this._edgeLen}get radius(){return this._center[a.CenterPosition.MIDDLE][3]}get visible(){this._dirty&&
this.computeVisibility();return this._visible}get frustumVisibility(){this._dirty&&this.computeVisibility();return this._frustumVisibility}computeVisibility(){this._dirty=!1;var J=this.parent?.frustumVisibility??z.TileFrustumVisibility.INTERSECTS;this._frustumVisibility=J===z.TileFrustumVisibility.INSIDE?z.TileFrustumVisibility.INSIDE:J===z.TileFrustumVisibility.OUTSIDE?z.TileFrustumVisibility.OUTSIDE:this._calculateFrustumVisibilityStatus(this.surface.frustum);J=this._frustumVisibility!==z.TileFrustumVisibility.OUTSIDE&&
this._intersectsClippingArea;J!==this._visible&&(this._visible=J,this._surface.emit("tiles-visibility-changed"),this._surface.renderer.setDirty(),this.updateAgentSuspension())}get loadable(){return this.visible||this._surface.view.state.fixedContentCamera}get rendered(){const J=!!this.renderData;J!==this._previouslyRendered&&(this._surface.emit("tiles-visibility-changed"),this._previouslyRendered=J,this._surface.renderer.setDirty());return J}init(J,R,Q,W,S){this._lij[0]=J;this._lij[1]=R;this._lij[2]=
Q;this.ellipsoid=f.getReferenceEllipsoid(S.tilingScheme.spatialReference);S.tilingScheme.getExtent(J,R,Q,this.extent);S.tilingScheme.convertExtentToRadians(this.extent,this.extentInRadians);this.extentMidX=.5*(this.extent[0]+this.extent[2]);this.extentMidY=.5*(this.extent[1]+this.extent[3]);this._intersectsClippingArea=this._isWithinClippingArea=!0;this._clippingArea=null;this._mapDataRefCount=0;S.upsampleMapCache.pop(this.key);this._edgeLen2=this._edgeLen=0;this._center[a.CenterPosition.MIDDLE][3]=
0;this.elevationLevel=J;W&&!Number.isNaN(W.elevationBoundsMin)?(this._elevationBoundsMin=W.elevationBoundsMin,this._elevationBoundsMax=W.elevationBoundsMax):this._elevationBoundsMax=this._elevationBoundsMin=0;this._pendingUpdates=0;this.renderData=null;this.screenDepth=0;this._previouslyRendered=this._visible=!1;this._parent=W;this.unsetChildren();this._surface=S;this.updateVisibility();this.unmergableChildCount=this.maxLevelDeltaNeighborCount=0;for(const V of v.LayerClasses){J=S.numLayers(V);R=this.layerInfo[V];
for(const T of R)T.release();R.length=J;for(Q=0;Q<J;Q++)R[Q]=A.TilePerLayerInfo.acquire(this._surface.upsampleInfoPool),V===v.LayerClass.ELEVATION&&this.findElevationBoundsForLayer(Q,-1)}this.computeElevationBounds();this._maxTesselation=Math.min(S.tilingScheme.pixelSize,n.maxPatchTesselation)}dispose(){x.weakAssert(!this.renderData,"tile.renderData was not unloaded");this._surface.upsampleMapCache.pop(this.key);for(var J of v.LayerClasses){for(const R of this.layerInfo[J])R.release();this.layerInfo[J].length=
0}this._parent=null;for(J=0;4>J;++J)this._children[J]=null;this._surface=null;this.setMemoryDirty()}refMapData(){++this._mapDataRefCount;this._isCached||this._surface.upsampleMapCache.pop(this.key)}unrefMapData(){--this._mapDataRefCount;if(this._isCached){this.setMemoryDirty();const J=this._cachedMemory;0<J&&this._surface.upsampleMapCache.put(this.key,this,J)}}setMemoryDirty(){this._usedMemory=null}get usedMemory(){return this._ensureUsedMemory()+(this._isCached?0:this._mapTileMemoryInternal)}get _cachedMemory(){return this._isCached?
this._mapTileMemory:0}get _mapTileMemory(){this._ensureUsedMemory();return this.layerInfo[v.LayerClass.MAP].reduce((J,{data:R})=>J+(u.isVectorTile(R)?R.usedMemory/R.referenced:0),this._mapTileMemoryInternal)}get _cpuImageMemorySize(){const J=this._surface.tilingScheme.pixelSize;return J*J*4}_ensureUsedMemory(){if(null!=this._usedMemory)return this._usedMemory;this._usedMemory=this._baseUsedMemory;let J=this._mapTileMemoryInternal=0;for(var {data:R}of this.layerInfo[v.LayerClass.MAP])u.isVectorTile(R)?
J+=this._getTerrainDataMemory(R):this._mapTileMemoryInternal+=this._getTerrainDataMemory(R);R=this._cpuImageMemorySize;for(const Q of this.layerInfo[v.LayerClass.ELEVATION])this._usedMemory+=Q.data?R:0;this.renderData&&(this._usedMemory+=this.renderData.estimatedGeometryMemoryUsage,this._mapTileMemoryInternal+=this.renderData.texture?.usedMemory??0);this._isCached&&this._surface.upsampleMapCache.updateSize(this.key,this,this._mapTileMemoryInternal+J);return this._usedMemory}getUsedMemoryForLayer(J,
R){R=this.layerInfo[J][R];return R?.data?J===v.LayerClass.MAP?this._isCached?0:this._getTerrainDataMemory(R.data):J===v.LayerClass.ELEVATION?this._cpuImageMemorySize:0:0}_getTerrainDataMemory(J){return u.isTileTexture(J)?J.texture.usedMemory:u.isRasterTile(J)?J.memoryUsage:u.isVectorTile(J)?J.usedMemory/J.referenced:u.isImageWithType(J)||J instanceof HTMLImageElement?this._cpuImageMemorySize:0}updateScreenDepth(J){var R=this._center[a.CenterPosition.MIDDLE];const Q=R[0],W=R[1];R=R[2];const S=J[2]*
Q+J[6]*W+J[10]*R+J[14];this.screenDepth=0>S?0:S/(J[3]*Q+J[7]*W+J[11]*R+J[15])}shouldSplit(J,R,Q){if(!this.visible||J.frustum&&(!this._intersectsClippingArea||this._calculateFrustumVisibilityStatus(J.frustum)===z.TileFrustumVisibility.OUTSIDE))return B.TileUpdate.NONE;const W=this.level;p.subtract(L,e.getCenter(this._center[a.CenterPosition.MIDDLE]),R);var S=p.squaredLength(L),V=L;let T=e.getCenter(this._center[a.CenterPosition.MIDDLE]);p.subtract(P,this._center[a.CenterPosition.TOP],R);var Y=p.squaredLength(P);
Y<S&&(S=Y,V=P,T=this._center[a.CenterPosition.TOP]);p.subtract(M,this._center[a.CenterPosition.BOTTOM],R);Y=p.squaredLength(M);Y<S&&(S=Y,V=M,T=this._center[a.CenterPosition.BOTTOM]);if(this._edgeLen2>S&&W<J.maxLod)return B.TileUpdate.SPLIT;S=Math.sqrt(S);const ha=this._edgeLen/(J.fovX*S*2),ba=()=>{if(W<J.maxLod)return this.elevationLevel=W,B.TileUpdate.NONE;const ea=W+Math.ceil(-Math.log2(J.relativeWidthLimit/ha));return ea!==this.elevationLevel?(this.elevationLevel=ea,B.TileUpdate.ELEVATION):B.TileUpdate.NONE},
U=null!=Q?Q-W:Infinity;if(.5>=U)return ba();const Z=p.dot(this.up,L);Y=this._elevationBoundsMax-this._elevationBoundsMin;const ca=Y/this.edgeLen;if(J.aboveGround&&0<Z&&.001>ca&&0<Z/S-Math.sin(this._curvatureHeight/(this.edgeLen*Math.SQRT1_2)*Math.PI)-ca)return B.TileUpdate.NONE;Q=null!=Q?3-Math.min(U,2):1;if(ha*Q<J.relativeWidthLimit||W>=J.maxLod)return ba();if(7>W)return B.TileUpdate.SPLIT;p.scale(K,this.up,Z);p.subtract(K,K,V);V=p.squaredLength(K);if(V<=this.radius*this.radius)return B.TileUpdate.SPLIT;
p.scale(K,K,this.radius/Math.sqrt(V));p.add(K,K,T);p.subtract(K,R,K);return Math.min(1,(Math.abs(p.dot(K,this.up))+.5*Y+this._curvatureHeight)/p.length(K))*(this._edgeLen/(J.fovY*S*2))*Q<.1/J.angledSplitBias*J.relativeHeightLimit?B.TileUpdate.NONE:B.TileUpdate.SPLIT}setChildren(J,R,Q,W){x.weakAssert(!!(J&&R&&Q&&W),"Null child passed");const S=this._children;S[0]=J;S[1]=R;S[2]=Q;S[3]=W;return S}unsetChildren(){this._children[0]=null;this._children[1]=null;this._children[2]=null;this._children[3]=null}get isLoaded(){return this.renderData?.hasGeometry??
!1}load(){this.refMapData();for(const J of v.LayerClasses)this._createOrUpdateAgents(0,J);this.surface.renderer.loadTile(this)}unload(J){J.unloadTile(this);for(const R of v.LayerClasses){J=this.layerInfo[R];for(const Q of J)Q.loadingAgent&&Q.loadingAgent!==y.tileAgentDone&&(D(Q.loadingAgent),Q.loadingAgent=null),Q.pendingUpdates=0}this.resetPendingUpdate(B.TileUpdate.GEOMETRY);this.resetPendingUpdate(B.TileUpdate.TEXTURE_NOFADING);this.resetPendingUpdate(B.TileUpdate.TEXTURE_FADING);this.unrefMapData()}unloadMapData(){const J=
this.layerInfo[v.LayerClass.MAP];for(const R of J)R.loadingAgent&&R.loadingAgent!==y.tileAgentDone&&(D(R.loadingAgent),R.loadingAgent=null),R.pendingUpdates=0;this.renderData&&this.renderData.releaseTexture();this.setMemoryDirty()}updateClippingStatus(J){if(c.equals(J,this._clippingArea))return!1;var R=this._intersectsClippingArea;const Q=this._isWithinClippingArea;null!=J?(this._intersectsClippingArea=this.intersectsExtent(J),this._isWithinClippingArea=this._isWithinExtent(J)):this._isWithinClippingArea=
this._intersectsClippingArea=!0;this._clippingArea=J;this.updateVisibility();J=Q&&this._isWithinClippingArea;R=!Q&&!R&&!this._isWithinClippingArea&&!this._intersectsClippingArea;!this.renderData||J||R||this.setPendingUpdate(B.TileUpdate.GEOMETRY);return!0}updateVisibility(){this._dirty=!0;this._surface.setTileTreeDirty()}getLayerInfo(J,R){return this.layerInfo[R][J]}hasLayerData(J,R){J=this.layerInfo[R][J];return!(!J?.data||J.dataInvalidated)}get updating(){if(this.hasPendingUpdates)return!0;for(const J of v.LayerClasses){const R=
this.layerInfo[J];for(const Q of R)if(Q.loadingAgent&&Q.loadingAgent!==y.tileAgentDone&&Q.loadingAgent.updating)return!0}return!1}_isSuspended(J){return this.hasPendingUpdate(B.TileUpdate.SPLIT)?!0:J===v.LayerClass.ELEVATION?!1:!this.loadable}get hasPendingUpdates(){return 0!==this._pendingUpdates}hasPendingUpdate(J){return(this._pendingUpdates&J)===J}setPendingUpdate(J){const R=this._pendingUpdates;this._pendingUpdates|=J;J===B.TileUpdate.SPLIT||J===B.TileUpdate.MERGE?this._surface.setTileTreeDirty():
this._surface.requestUpdate();return R!==this._pendingUpdates}resetPendingUpdate(J){return this.hasPendingUpdate(J)?(this._pendingUpdates&=~J,!0):!1}requestLayerData(J,R,Q){const W=this.layerInfo[R][J];if(W.waitingAgents.has(Q))return console.warn("agent already requested this piece of map data (tile %s, agent tile %s, layer: %d/%d)",this._lij.toString(),Q.tile.lij.toString(),R,J),!0;W.waitingAgents.push(Q);if(W.data&&!W.dataInvalidated)return console.warn("agent requested existing data (tile %s, agent tile %s, layer: %d/%d)",
this._lij.toString(),Q.tile.lij.toString(),R,J),J=u.isVectorTile(W.data),Q.dataArrived(this,J),!0;if(W.requestPromise)return!0;q.abortMaybe(W.requestAbort);W.requestAbort=new AbortController;const S=this._surface.requestTileData(this,J,R,W.requestAbort);if(!S)return W.requestAbort=null,!1;Q=()=>{W.requestPromise===S&&(W.requestPromise=null,W.requestAbort=null)};W.requestPromise=S;S.then(Q,Q);return!0}get isLeaf(){return null==this._children[0]}hasLij(J){return this._lij[0]===J[0]&&this._lij[1]===
J[1]&&this._lij[2]===J[2]}findByLij(J){if(this.hasLij(J))return this;const R=this._children;return R[0]?R[0].findByLij(J)||R[1].findByLij(J)||R[2].findByLij(J)||R[3].findByLij(J):null}distanceToSquared(J){return p.squaredLength(p.subtract(K,e.getCenter(this._center[a.CenterPosition.MIDDLE]),J))}containsPoint(J){const R=this.extent;return J[0]>=R[0]&&J[1]>=R[1]&&J[0]<=R[2]&&J[1]<=R[3]}containsPointXY(J,R){const Q=this.extent;return J>=Q[0]&&R>=Q[1]&&J<=Q[2]&&R<=Q[3]}unrequestLayerData(J,R,Q){J=this.layerInfo[R][J];
R=J.waitingAgents;Q=null!=R.removeUnordered(Q);x.weakAssert(Q,"agent has not requested this piece of map data");1>R.length&&(J.abortRequest(),this.setMemoryDirty())}dataArrived(J,R,Q){const W=u.isVectorTile(Q);J=this.layerInfo[R][J];J.data=Q;J.dataInvalidated=!1;J.waitingAgents.forAll(S=>S.dataArrived(this,W));J.waitingAgents.clear();this.setMemoryDirty()}dataMissing(J,R){J=this.layerInfo[R][J];J.dataMissing=!0;J.waitingAgents.forAll(Q=>Q.dataMissing());J.waitingAgents.clear();this.setMemoryDirty()}updateRenderData(J,
R,Q){Q&&this.forEachLoadedNeighbor(W=>W.updateRenderData(J,R));switch(J){case v.LayerClass.MAP:return this._updateTexture(R);case v.LayerClass.ELEVATION:return this._updateGeometry()}}_updateTexture(J){this.renderData&&(this.resetPendingUpdate(J===w.TextureUpdate.FADING?B.TileUpdate.TEXTURE_NOFADING:B.TileUpdate.TEXTURE_FADING),this.setPendingUpdate(J===w.TextureUpdate.FADING?B.TileUpdate.TEXTURE_FADING:B.TileUpdate.TEXTURE_NOFADING))}_updateGeometry(){this.setPendingUpdate(B.TileUpdate.GEOMETRY);
for(const J of this.layerInfo[v.LayerClass.ELEVATION])J.pendingUpdates|=B.TileUpdate.GEOMETRY}invalidateLayerData(J,R){this.layerInfo[R][J].invalidateSourceData();this.restartAgents(R)}computeElevationBounds(){const J=this._elevationBoundsMin,R=this._elevationBoundsMax;let Q=Infinity,W=-Infinity;const S=this.layerInfo[v.LayerClass.ELEVATION];let V=!0;for(const T of S)null!=T.elevationBounds&&(Q=Math.min(Q,T.elevationBounds.min),W=Math.max(W,T.elevationBounds.max),T.elevationBounds.hasNoDataValues||
(V=!1));V&&(Q=Math.min(Q,0),W=Math.max(W,0));if(J!==Q||R!==W)this._elevationBoundsMin=Q,this._elevationBoundsMax=W,this.updateRadiusAndCenter(),this._surface.setTileTreeDirty()}_updateCenter(){const J=this._elevationBoundsMin,R=this._elevationBoundsMax,Q=this._center;p.scale(K,this.up,.5*(J+R));p.add(e.getCenter(Q[a.CenterPosition.MIDDLE]),this.centerAtSeaLevel,K);p.scale(K,this.up,J);p.add(Q[a.CenterPosition.TOP],this.centerAtSeaLevel,K);p.scale(K,this.up,R);p.add(Q[a.CenterPosition.BOTTOM],this.centerAtSeaLevel,
K)}findElevationBoundsForLayer(J,R){const Q=this.layerInfo[v.LayerClass.ELEVATION][J],W=this.elevationLevelDelta,S=Math.max(this.elevationLevel-W,0);var V=Q.elevationBounds;if(!(null!=V&&V.level>=R&&V.level<=S)&&(R=this._surface.layerViewByIndex(J,v.LayerClass.ELEVATION),R=x.getLayerWithExtentRange(R),C.fallsWithinLayer(this,R,!1))){R=O;V=!1;var T=Q.data;if(T&&T.level<=S)J=Q.data,R.min=J.samplerData.data.minValue,R.max=J.samplerData.data.maxValue,R.hasNoDataValues=J.samplerData.data.hasNoDataValues,
R.level=this.level,V=!0;else{T=0;let Y,ha;for(let ba=this._parent;ba&&(!ha||T<W)&&!(T=this.elevationLevel-ba.level,Y=ha||Y,ha=ba.layerInfo[v.LayerClass.ELEVATION][J].data,!ha&&Y&&ba.level<=S);ba=ba.parent);if(ha=ha||Y)ha.computeMinMaxValue(this._lij[0],this._lij[1],this._lij[2],R),Infinity!==R.min&&(R.level=ha.level,V=!0)}V&&(null==Q.elevationBounds&&(Q.elevationBounds=new d.ElevationBounds),Q.elevationBounds.copyFrom(R))}}modifyLayers(J,R,Q){Q=this.layerInfo[Q];for(var W of Q)W.loadingAgent&&W.loadingAgent!==
y.tileAgentDone&&(D(W.loadingAgent),W.loadingAgent=null),W.waitingAgents.clear();for(W=0;W<Q.length;++W)void 0===J[W]&&Q[W].release();J=Array(...Q);W=R.length;Q.length=W;for(let S=0;S<W;S++){const V=R[S];Q[S]=-1<V?J[V]:A.TilePerLayerInfo.acquire(this._surface.upsampleInfoPool)}this.setMemoryDirty()}restartAgents(J){this.renderData&&(this._createOrUpdateAgents(0,J),this.updateRenderData(J,w.TextureUpdate.FADING))}updateAgents(J){if(this.renderData){const R=this.layerInfo[J];for(const Q of R)Q.loadingAgent===
y.tileAgentDone&&(Q.loadingAgent=null);this._createOrUpdateAgents(0,J)}}updateAgentSuspension(){for(const J of v.LayerClasses){const R=this._isSuspended(J);for(const Q of this.layerInfo[J])Q.loadingAgent&&Q.loadingAgent!==y.tileAgentDone&&(Q.loadingAgent.setSuspension(R),Q.loadingAgent===y.tileAgentDone&&this.updateRenderData(J,w.TextureUpdate.FADING))}}removeLayerAgent(J,R){J=this.layerInfo[R][J];J.loadingAgent&&J.loadingAgent!==y.tileAgentDone&&J.loadingAgent.dispose();J.loadingAgent=null}agentDone(J,
R){const Q=this.layerInfo[R][J];Q.loadingAgent=y.tileAgentDone;Q.data||null!=Q.upsampleInfo||this._createOrUpdateAgents(J+1,R)}_hasBlendableAncestor(J){return"normal"!==J.blendMode||g.isGroupLayer(J.parent)&&this._hasBlendableAncestor(J.parent)}_hasBlendModes(J,R,Q){for(;J<R;++J){const W=this._surface.layerViewByIndex(J,Q);if(x.isBlendableLayerView(W)&&"normal"!==W?.layer?.blendMode||g.isGroupLayer(W?.layer?.parent)&&this._hasBlendableAncestor(W?.layer?.parent))return!0}return!1}_createOrUpdateAgents(J,
R){const Q=this.layerInfo[R];if(0!==Q.length){var W=this._isSuspended(R);for(let Y=J;Y<Q.length;++Y){const ha=Q[Y];var S=!1;const ba=this._surface.layerViewByIndex(Y,R);var V=x.getLayerWithExtentRange(ba);if(ha.loadingAgent)C.fallsWithinLayer(this,V,!1)?(ha.loadingAgent!==y.tileAgentDone&&ha.loadingAgent.setSuspension(W),ha.loadingAgent!==y.tileAgentDone&&(S=ha.loadingAgent.update())):ha.dispose();else if(C.fallsWithinLayer(this,V,!1)){S=Y;V=R;var T=W;const U=V===v.LayerClass.ELEVATION?I.acquire():
G.acquire();U.init(this,S,V,T);ha.loadingAgent=U;(S=ha.loadingAgent.startLoading())?ha.loadingAgent===y.tileAgentDone&&this.setPendingUpdate(B.TileUpdate.GEOMETRY):(D(ha.loadingAgent),ha.loadingAgent=y.tileAgentDone)}ha.loadingAgent===y.tileAgentDone&&this.updateRenderData(R,w.TextureUpdate.FADING);if(!this._hasBlendModes(J,Q.length,R)&&S&&ba.isOpaque)break}}}_isWithinExtent(J){const R=this.extent;return R[0]>=J[0]&&J[2]>=R[2]&&R[1]>=J[1]&&J[3]>=R[3]}intersectsExtent(J){const R=this.extent;return R[2]>=
J[0]&&J[2]>=R[0]&&R[3]>=J[1]&&J[3]>=R[1]}getElevationVerticesPerSide(J){J=b.clamp((this.maxTesselation>>Math.max(this.level-J,this.elevationLevelDelta-(this.elevationLevel-this.level)))+1,2,this.maxTesselation+1);const R=this.getDefaultVerticesPerSide();return Math.max(J,R)}_findLIJ(J,R){if(!J)return null;var Q=this.surface.rootTiles;if(null!=Q)for(var W of Q){{Q=W.lij;const S=J[0]-Q[0];Q=0>S?!1:J[1]>>S===Q[1]&&J[2]>>S===Q[2]}if(Q){for(Q=J[0]-W.level-1;0<=Q&&!W.isLeaf&&!R(W);)W=W.children[2*(J[1]>>
Q&1)+(J[2]>>Q&1)],Q--;return R(W)?W:null}}return null}findNeighborTile(J,R){const Q=this._lij;return(J=this.getNeighborLIJ(Q,J))?F(Q,J)?R(this)?this:null:this._findLIJ(J,R):null}findCorner(J,R){J=J===r.NeighborIndex.NORTH_EAST?1:J===r.NeighborIndex.NORTH_WEST?0:J===r.NeighborIndex.SOUTH_WEST?2:3;let Q=this;for(;Q.children[0]&&(!R||!R(Q));)Q=Q.children[J];return Q}findNeighborCornerTileExact(J,R){return this.findNeighborTile(J,Q=>R(Q)||Q.level===this.level)?.findCorner(x.oppositeCorner(J),R)||null}forAllSubtreeOnSide(J,
R){const Q=J===r.NeighborIndex.NORTH?[0,1]:J===r.NeighborIndex.NORTH_EAST?[1]:J===r.NeighborIndex.EAST?[1,3]:J===r.NeighborIndex.SOUTH_EAST?[3]:J===r.NeighborIndex.SOUTH?[2,3]:J===r.NeighborIndex.SOUTH_WEST?[2]:J===r.NeighborIndex.WEST?[0,2]:[0],W=S=>{const V=S.children;!R(S)&&V[0]&&Q.forEach(T=>W(V[T]))};W(this)}getNeighborEdgeStartVertexIndex(J,R){if(!R)return 0;var Q=this.level-R.level;x.internalAssert(!x.enableTerrainInternalChecks||0<=Q);if(0===Q)return 0;Q=2**Q;var W=(J=1===(J&1))?0:1;R=R.lij[W+
1]*Q;W=this._lij[W+1];const S=W-R;J=J?Q-1-S:S;x.enableTerrainInternalChecks&&(x.internalAssert(R<=W&&W<R+Q),x.internalAssert(0<=J&&J<Q));return J}forEachLoadedNeighbor(J){const R=this.level,Q=W=>W.level===R||W.isLoaded;x.neighborEdgeIndices.forEach(W=>{const S=this.findNeighborTile(W,Q);null!=S&&S!==this&&S.forAllSubtreeOnSide(x.oppositeEdge(W),V=>V.isLoaded?(J(V,W),!0):!1)});x.neighborCornerIndices.forEach(W=>{const S=this.findNeighborTile(W,Q)?.findCorner(x.oppositeCorner(W),V=>V.isLoaded);x.internalAssert(!S||
H(this,S,W));S?.isLoaded&&J(S,W)})}getNeighborLIJ(J,R){const Q=x.isNorth(R)?-1:x.isSouth(R)?1:0;R=x.isWest(R)?-1:x.isEast(R)?1:0;J=[J[0],J[1]+Q,J[2]+R];return 0>J[1]?null:this.surface.isGlobal?this.wrapLIJ(J):0>J[2]?null:J}wrapLIJ(J){return!J||0>J[1]||J[1]>=2**J[0]?null:this.surface.wrapEastWest(J)}get westNeighborWestExtent(){return this.extent[0]*(this.isWestEnd?-1:1)}get eastNeighborEastExtent(){return this.extent[2]*(this.isEastEnd?-1:1)}get isEastEnd(){return this._lij[2]===this.surface.lijEastEnd(this.level)-
1}get isWestEnd(){return 0===this._lij[2]}get isNorthEnd(){return 0===this._lij[1]}get isSouthEnd(){const J=this.surface.extent?.[1]??null;return null!=J&&this.extent[1]+h.getEpsilon()>=J}checkGeometryWaterproofness(){x.enableWaterproofTests&&(x.internalAssert(this.isLoaded),this.renderData?.checkGeometryWaterproofness())}shouldHaveNeighbor(J){const R=this.extent,Q=this.surface.rootTilesExtent,W=.25*(R[2]-R[0]);if(x.isNorth(J)&&R[3]+W>=Q[3]||x.isSouth(J)&&R[1]-W<=Q[1])return!1;const S=this.surface.isGlobal;
return!S&&x.isWest(J)&&R[0]-W<=Q[0]||!S&&x.isEast(J)&&R[2]+W>=Q[2]?!1:!0}updateDistanceToPOI(J){var R=this._lastPOI;if(!(0<=this.distanceToPOI&&R[0]===J[0]&&R[1]===J[1]&&R[2]===J[2])){p.copy(this._lastPOI,J);var Q=this._center[a.CenterPosition.MIDDLE];R=J[0]-Q[0];var W=J[1]-Q[1];J=J[2]-Q[2];this.distanceToPOI=R*R+W*W+J*J}}get test(){return{cachedMemory:this._cachedMemory}}}const G=new l(m.MapTileAgent),I=new l(t.ElevationTileAgent),O=new d.ElevationBounds;a.CenterPosition=void 0;(function(J){J[J.TOP=
0]="TOP";J[J.MIDDLE=1]="MIDDLE";J[J.BOTTOM=2]="BOTTOM"})(a.CenterPosition||(a.CenterPosition={}));const L=k.create(),P=k.create(),M=k.create(),K=k.create();a.Tile=E;a.isCornerNeighbor=H;a.isEdgeNeighbor=function(J,R,Q){if(null==J||null==R)return!1;if(0===J.level&&0===R.level&&(J.isEastEnd&&R.isWestEnd&&Q===r.NeighborIndex.EAST||J.isWestEnd&&R.isEastEnd&&Q===r.NeighborIndex.WEST))return!0;const W=Math.max(1E-6*(J.extent[2]-J.extent[0]),1);switch(Q){case r.NeighborIndex.NORTH:return x.almostEquals(J.extent[3],
R.extent[1],W);case r.NeighborIndex.SOUTH:return x.almostEquals(J.extent[1],R.extent[3],W);case r.NeighborIndex.EAST:return x.almostEquals(J.extent[2],R.extent[0],W)||x.almostEquals(J.extent[2],-R.extent[0],W);case r.NeighborIndex.WEST:return x.almostEquals(J.extent[0],R.extent[2],W)||x.almostEquals(J.extent[0],-R.extent[2],W)}};a.lijEquals=F;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/ElevationTileAgent":function(){define(["exports","./TileAgent"],function(a,
b){class q extends b.TileAgent{constructor(){super(...arguments);this.type="elevation";this._scaleRangeEnabled=!1}get _desiredMinLevelDelta(){return this.tile.elevationLevelDelta-(this.tile.elevationLevel-this.tile.level)}get _progressiveLevelModulo(){return 0}}a.ElevationTileAgent=q;a.isElevationTileAgent=function(l){return"elevation"===l.type};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileAgent":function(){define("exports ../../../core/has ./interfaces ./TerrainConst ./terrainUtils ./tileUtils".split(" "),
function(a,b,q,l,p,k){class h{get updating(){return!!this._tileRequested}init(e,g,d,t){this.tile=e;this._layerIdx=g;this._layerClass=d;this._suspended=t;this._tileLayerInfo=e.getLayerInfo(g,d);this._tileRequested=null;e=this._findAncestorWithData();this._setUpsampleTile(e)}startLoading(){return this._requestNext()}dispose(){this._tileRequested&&(this._tileRequested.unrequestLayerData(this._layerIdx,this._layerClass,this),this._tileRequested=null);this._tileLayerInfo=this.tile=null}setSuspension(e){e!==
this._suspended&&((this._suspended=e)?this._tileRequested&&(this._tileRequested.unrequestLayerData(this._layerIdx,this._layerClass,this),this._tileRequested=null):this._tileLayerInfo.data||this.update())}update(){const e=this._findAncestorWithData();this._setUpsampleTile(e);return this._requestNext()}dataArrived(e,g){this._setUpsampleTile(e,g);this._tileRequested=null;e===this.tile?this.tile.updateRenderData(this._layerClass,q.TextureUpdate.FADING,g):this._requestNext()}dataMissing(){this._tileRequested=
null;this._tileLayerInfo.data=null;this._requestNext()}_agentDone(){this.tile.agentDone(this._layerIdx,this._layerClass);this.dispose()}_requestNext(){if(this._suspended)return!0;const e=this._findNextDownload();if(this._tileRequested){if(e===this._tileRequested)return!0;this._tileRequested.unrequestLayerData(this._layerIdx,this._layerClass,this);this._tileRequested=null}null!=e?e.requestLayerData(this._layerIdx,this._layerClass,this)&&(this._tileRequested=e):this._agentDone();return!!this._tileRequested}_findNextDownload(){const e=
this._layerIdx,g=this._layerClass;var d=this.tile.surface.layerViewByIndex(e,g),t=p.getLayerWithExtentRange(d);const {minLevel:w,maxLevel:v}=d.dataLevelRange,m=this._desiredMinLevelDelta,r=this._progressiveLevelModulo+m,n=this._scaleRangeEnabled?k.fallsWithinLayer:()=>!0;let u=this.tile;const x=u.level;let y;const z=this._tileLayerInfo.upsampleInfo,A=null!=z?z.tile.level:-1,B=null!=z?A-x>=m:!1,C=t?.tilemapCache;for(d="vector-tile-3d"===d.type?d.schemaHelper:null;u&&n(u,t,!1)&&u.level>=w;){const D=
u.level,F=x-D,H=u.layerInfo[g][e];if(H.data&&F>=m){(!B||D>A)&&this._setUpsampleTile(u);H.dataInvalidated&&(y=u);break}const N=d?.getLevelRowColumn(u.lij)??u.lij;if("unavailable"!==C?.getAvailability(N[0],N[1],N[2])&&D<=v&&!H.data&&!H.dataMissing){if(!y||u.level===w||0===D%l.progressiveLoadingModulo||x-y.level<m)y=u;if(F>=r)break}u=u.parent}null!=y&&x-y.level<m&&(z?y=null:(t=this._findAncestorWithData(),null!=t&&(this._setUpsampleTile(t),y=t.layerInfo[g][e].dataInvalidated?t:null)));return y}_findAncestorWithData(){const e=
this.tile.elevationLevel,g=this._desiredMinLevelDelta;let d;for(let t=this.tile;t;t=t.parent)if(t.hasLayerData(this._layerIdx,this._layerClass)){if(e-t.level>=g)return t;d=t}return d}_setUpsampleTile(e,g){this._tileLayerInfo.setUpsampleInfo(this.tile,e);this.tile.updateRenderData(this._layerClass,q.TextureUpdate.FADING,g)}get test(){}}class f extends h{constructor(){super(...arguments);this.type="none"}get _desiredMinLevelDelta(){throw c;}get _progressiveLevelModulo(){throw c;}dispose(){}}const c=
Error("Abstract method called on TileAgent");b=new f;a.TileAgent=h;a.tileAgentDone=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/tileUtils":function(){define(["exports","../../../core/PooledArray","./RenderOrder"],function(a,b,q){function l(w,v){v(w);if(!w.isLeaf)for(const m of w.children)l(m,v)}function p(w,v){w=w.lij;v=v.lij;return w[0]-v[0]||w[1]-v[1]||w[2]-v[2]}function k(w,v){const m=v.screenDepth-w.screenDepth;if(0!==m)return m;w=w.lij;v=v.lij;return w[0]-
v[0]||w[1]-v[1]||w[2]-v[2]}function h(w,v){const m=w.screenDepth-v.screenDepth;if(0!==m)return m;w=w.lij;v=v.lij;return w[0]-v[0]||w[1]-v[1]||w[2]-v[2]}function f(w,v,m){const r=w.screenDepth,n=v.screenDepth;return r<n?-m:r>n?m:p(w,v)}function c(w,v,m,r){const n=e(w,r);r=e(v,r);return n===r?f(w,v,m):w?m:-m}function e(w,v){for(const m of v)if(w.intersectsExtent(m))return!0;return!1}function g(w,v){const m=w.distanceToPOI-v.distanceToPOI;if(0!==m)return m;w=w.lij;v=v.lij;return w[0]-v[0]||w[1]-v[1]||
w[2]-v[2]}class d{constructor(){this._queue=new b;this.remove=()=>{}}get done(){return 0===this._queue.length&&(!this._last||this._last.isLeaf)}resetOne(w){this._queue.clear();this._queue.push(w);this._last=void 0}reset(w=null){this._queue.clear();null!=w&&this._queue.pushArray(w);this._last=void 0}skipSubtree(){this._last=void 0}next(){const w=this._last?.children;w?.[0]&&this._queue.pushArray(w);return this._last=this._queue.pop()}}class t{constructor(){this._q=new b}get done(){return 0===this._q.length}reset(w){this._q.clear();
if(null!=w)for(this._q.pushArray(w),w=0;w<this._q.length;++w){const v=this._q.data[w];v.isLeaf||this._q.pushArray(v.children)}}next(){return this._q.pop()}}a.IteratorPostorder=t;a.IteratorPreorder=d;a.compareTiles=f;a.compareTilesByLij=p;a.compareTilesWithStencil=c;a.computeUpsampleInfo=function(w,v,m){let r=1,n=0,u=0;for(;w!==v;)if(r*=.5,n*=.5,u*=.5,w.lij[2]&1&&(n+=.5),0===(w.lij[1]&1)&&(u+=.5),w=w.parent,null==w)throw Error("tile was not a descendant of upsampleTile");m.init(v,n,u,r)};a.fallsWithinLayer=
function(w,v,m){if(null==v?.fullExtent)return!1;const r=v.fullExtent,n=w.extent;if(m){if(n[0]<r.xmin||n[1]<r.ymin||n[2]>r.xmax||n[3]>r.ymax)return!1}else if(r.xmin>n[2]||r.ymin>n[3]||r.xmax<n[0]||r.ymax<n[1])return!1;w=w.surface.tilingScheme.levels[w.level].scale;m=v.minScale;if(0<m&&w>1.00000001*m)return!1;v=v.maxScale;return 0<v&&w<.99999999*v?!1:!0};a.hasLoadableSiblings=function(w){for(let v=0;v<w.length;v++){const m=w[v],r=m.parent;if(r)for(let n=0;4>n;n++){const u=r.children[n];if(u&&u!==m)return!0}}return!1};
a.sortTiles=function(w,v,m=null){null==m||0===m.length?w===q.RenderOrder.BACK_TO_FRONT?v.sort(k):v.sort(h):v.sort((r,n)=>c(r,n,w,m))};a.sortTilesByPOI=function(w,v){const m=w.length;for(let r=0;r<m;++r)w.at(r).updateDistanceToPOI(v);w.sort(g)};a.tilesAreRelated=function(w,v){if(!w||!v||w[0]===v[0])return!1;const m=w[0]<v[0],r=m?w:v;w=m?v:w;v=1<<w[0]-r[0];return Math.floor(w[1]/v)===r[1]&&Math.floor(w[2]/v)===r[2]};a.traverseTilesPreorder=function(w,v){if(Array.isArray(w))for(let m=0;m<w.length;m++)l(w[m],
v);else l(w,v)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/RenderOrder":function(){define(["exports"],function(a){a.RenderOrder=void 0;var b=a.RenderOrder||(a.RenderOrder={});b[b.BACK_TO_FRONT=-1]="BACK_TO_FRONT";b[b.NONE=0]="NONE";b[b.FRONT_TO_BACK=1]="FRONT_TO_BACK";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/MapTileAgent":function(){define(["exports","./TerrainConst","./TileAgent"],function(a,b,q){class l extends q.TileAgent{constructor(){super();
this.type="map";this._scaleRangeEnabled=!0}get _desiredMinLevelDelta(){return 0}get _progressiveLevelModulo(){return b.progressiveLoadingModulo}}a.MapTileAgent=l;a.isMapTileAgent=function(p){return"map"===p.type};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileFrustumVisibility":function(){define(["exports"],function(a){a.TileFrustumVisibility=void 0;var b=a.TileFrustumVisibility||(a.TileFrustumVisibility={});b[b.INSIDE=0]="INSIDE";b[b.INTERSECTS=1]="INTERSECTS";
b[b.OUTSIDE=2]="OUTSIDE";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TilePerLayerInfo":function(){define("exports ../../../core/maybe ../../../core/ObjectPool ../../../core/PooledArray ./terrainUtils ./tileUtils".split(" "),function(a,b,q,l,p,k){class h{constructor(){this.waitingAgents=new l;this.requestAbort=this.requestPromise=this.loadingAgent=this._upsampleInfo=null;this.pendingUpdates=0}static acquire(e){const g=f.acquire();g._init(e);return g}release(){this.dispose();
c.delete(this);f.release(this)}dispose(){this.loadingAgent=b.disposeMaybe(this.loadingAgent);this.abortRequest();this._unsetUpsampleInfo();this.pendingUpdates=0;this._data=p.releaseTerrainData(this._data)}static prune(){f.prune(0)}_init(e){this.waitingAgents.clear();this._data=p.releaseTerrainData(this._data);this.dataInvalidated=this.dataMissing=!1;this._unsetUpsampleInfo();this.abortRequest();this.loadingAgent=null;this.pendingUpdates=0;this._pool=e;this.elevationBounds=null}invalidateSourceData(){this.dataInvalidated=
!0;this.dataMissing=!1;this._unsetUpsampleInfo()}abortRequest(){this.requestAbort=b.abortMaybe(this.requestAbort);this.requestPromise=null}get upsampleInfo(){return this._upsampleInfo}_unsetUpsampleInfo(){null!=this._upsampleInfo&&(this._upsampleInfo.tile.unrefMapData(),this._pool.release(this._upsampleInfo),this._upsampleInfo=null)}setUpsampleInfo(e,g){if(e===g||null==g)this._unsetUpsampleInfo();else{if(null==this._upsampleInfo)this._upsampleInfo=this._pool.acquire();else{if(this._upsampleInfo.tile===
g)return;this._upsampleInfo.tile.unrefMapData()}g.refMapData();k.computeUpsampleInfo(e,g,this._upsampleInfo)}}get data(){return this._data}set data(e){p.releaseTerrainData(this._data);this._data=e}}const f=new q(h,null,()=>{}),c=new Map;a.TilePerLayerInfo=h;a.printAllocations=function(){0<c.size&&(console.log(`${c.size} live TilePerLayerInfo allocations:`),c.forEach(e=>console.log(e,"\n")))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileUpdate":function(){define(["exports"],
function(a){a.TileUpdate=void 0;var b=a.TileUpdate||(a.TileUpdate={});b[b.NONE=0]="NONE";b[b.SPLIT=1]="SPLIT";b[b.ELEVATION=2]="ELEVATION";b[b.MERGE=4]="MERGE";b[b.GEOMETRY=8]="GEOMETRY";b[b.TEXTURE_NOFADING=16]="TEXTURE_NOFADING";b[b.TEXTURE_FADING=32]="TEXTURE_FADING";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileOverlayData":function(){define(["../../../core/libs/gl-matrix-2/factories/vec4f64"],function(a){class b{constructor(){this._scales=a.fromValues(-1,
-1,-1,-1);this._offsets=a.fromValues(-1,-1,-1,-1)}clear(){this._scales[0]=this._scales[1]=this._scales[2]=this._scales[3]=-1;this._offsets[0]=this._offsets[1]=this._offsets[2]=this._offsets[3]=-1}setScale(q,l,p){this._scales[2*q]=l;this._scales[2*q+1]=p}setOffset(q,l,p){this._offsets[2*q]=l;this._offsets[2*q+1]=p}get scales(){return this._scales}get offsets(){return this._offsets}}return b})},"esri/views/3d/webgl-engine/shaders/TerrainTechnique":function(){define("require exports ../../../ViewingMode ../core/shaderLibrary/ShaderOutput ../../../../chunks/Terrain.glsl ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/basicInterfaces ../lib/Program ../lib/StencilUtils ../lib/VertexAttribute ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w extends h.ShaderTechnique{constructor(){super(...arguments);this.useStencil=!1}initializeConfiguration(m,r){r.spherical=m.viewingMode===q.ViewingMode.Global}initializeProgram(m){return new c.Program(m.rctx,w.shader.get().build(this.configuration),v)}initializePipeline(){this._stencilPipelineState=this._createPipeline(!0);return this._createPipeline(!1)}_createPipeline(m){const r=this.configuration,n=r.backfaceCullingEnabled&&!r.renderOccluded;return t.makePipelineState({blending:r.renderOccluded?
t.simpleBlendingParams(d.BlendFactor.ONE,d.BlendFactor.ONE_MINUS_SRC_ALPHA):null,culling:n?t.backFaceCullingParams:null,depthTest:r.renderOccluded?null:{func:d.CompareFunction.LESS},depthWrite:r.renderOccluded?null:t.defaultDepthWriteParams,colorWrite:t.defaultColorWriteParams,stencilTest:m?e.renderWhenBitIsNotSet(f.StencilBits.IntegratedMeshMaskExcluded):null,drawBuffers:r.output===l.ShaderOutput.Depth?{buffers:[d.SpecialDrawBuffers.NONE]}:null})}getPipeline(){return this.useStencil?this._stencilPipelineState:
super.getPipeline()}}w.shader=new k.ReloadableShaderModule(p.Terrain,()=>new Promise((m,r)=>a(["../core/shaderLibrary/terrain/Terrain.glsl"],m,r)));const v=new Map([[g.VertexAttribute.POSITION,0],[g.VertexAttribute.UV0,1],[g.VertexAttribute.NORMALCOMPRESSED,2]]);b.TerrainTechnique=w;b.terrainVertexAttributeLocations=v;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Terrain.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../views/3d/terrain/OverlayContent ../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E){function G(P){const M=new N.ShaderBuilder,{vertex:K,fragment:J,varyings:R}=M;M.include(d.PositionAttribute);M.include(g.NormalAttribute,P);M.include(t.TextureCoordinateAttribute,P);var Q=()=>{M.include(x.NormalUtils,P);K.code.add(F.glsl`vec3 getNormal() {
float z = 1.0 - abs(normalCompressed.x) - abs(normalCompressed.y);
vec3 n = vec3(normalCompressed + vec2(normalCompressed.x >= 0.0 ? 1.0 : -1.0,
normalCompressed.y >= 0.0 ? 1.0 : -1.0) * min(z, 0.0), z);
return normalize(n);
}`)};C.addProjViewLocalOrigin(K,P);M.include(e.Transform,P);const W=P.overlayMode!==A.OverlayMode.Disabled;var S=W&&P.invisible;switch(P.output){case f.ShaderOutput.Color:M.include(B.TerrainTexture,P);M.include(n.EvaluateSceneLighting,P);W&&M.include(A.OverlayTerrain,{...P,pbrMode:P.pbrMode===y.PBRMode.Simplified?y.PBRMode.TerrainWithWater:y.PBRMode.Water});(S=P.overlayMode===A.OverlayMode.EnabledWithWater)&&M.include(w.VertexTangent,P);R.add("vnormal","vec3");R.add("vpos","vec3");R.add("vup","vec3");
Q();P.screenSizePerspective&&C.addViewNormal(K);(Q=P.receiveShadows&&!P.renderOccluded)&&M.include(h.ForwardLinearDepth,P);P.screenSizePerspective&&(R.add("screenSizeDistanceToCamera","float"),R.add("screenSizeCosAngle","float"));K.code.add(F.glsl`
void main(void) {
//Position
vpos = position;
vec3 positionWorld = position + localOrigin;
gl_Position = transformPosition(proj, view, vpos);
//Normal
vnormal = getNormal();
//Up
vup = getLocalUp(position, localOrigin);
${S?F.glsl`forwardVertexTangent(vnormal);`:F.glsl``}
//Texture UV
vec2 uv = getUV0();
forwardTextureCoordinatesWithTransform(uv);
${W?F.glsl`setOverlayVTC(uv);`:""}
${P.tileBorders?F.glsl`forwardTextureCoordinates();`:""}
${P.screenSizePerspective?F.glsl`
vec3 viewPos = (view * vec4(vpos, 1.0)).xyz;
screenSizeDistanceToCamera = length(viewPos);
vec3 viewSpaceNormal = (viewNormal * vec4(normalize(positionWorld), 1.0)).xyz;
screenSizeCosAngle = abs(viewSpaceNormal.z);`:""}
${Q?F.glsl`forwardLinearDepth();`:""}
}
`);M.include(c.SliceDraw,P);M.include(n.EvaluateSceneLighting,P);M.include(r.EvaluateAmbientOcclusion,P);M.include(z.ReadShadowMapDraw,P);C.addCameraPosition(J,P);n.addAmbientBoostFactor(J);n.addLightingGlobalFactor(J);J.uniforms.add(K.uniforms.get("localOrigin"),new D.Float3PassUniform("viewDirection",(V,T)=>l.normalize(L,l.set(L,T.camera.viewMatrix[12],T.camera.viewMatrix[13],T.camera.viewMatrix[14]))));S&&J.uniforms.add(new E.Texture2DPassUniform("ovWaterTex",(V,T)=>T.overlay?.getTexture(k.OverlayContent.WaterNormal)),
new H.Matrix4DrawUniform("view",(V,T)=>b.translate(O,T.camera.viewMatrix,V.origin)));J.code.add(F.glsl`const float sliceOpacity = 0.2;
float lum(vec3 c) {
return (min(min(c.r, c.g), c.b) + max(max(c.r, c.g), c.b)) * 0.5;
}`);u.addMainLightDirection(J);u.addMainLightIntensity(J);J.code.add(F.glsl`
void main() {
vec3 normal = normalize(vnormal);
float vndl = dot(normal, mainLightDirection);
float additionalAmbientScale = smoothstep(0.0, 1.0, clamp(vndl*2.5, 0.0, 1.0));
float shadow = ${P.receiveShadows&&!P.renderOccluded?"readShadowMap(vpos, linearDepth)":P.spherical?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
float ssao = evaluateAmbientOcclusionInverse();
vec4 tileColor = getTileColor();
${W?F.glsl`
vec4 overlayColorOpaque = getOverlayColor(ovColorTex, vtcOverlay);
vec4 overlayColor = overlayOpacity * overlayColorOpaque;
${P.invisible?F.glsl`if (overlayColor.a == 0.0) { discard; }`:""}
vec4 groundColor = tileColor;
tileColor = tileColor * (1.0 - overlayColor.a) + overlayColor;`:""}
// If combined alpha is 0 we can discard pixel. The performance impact by having a discard here
// is neglectable because terrain typically renders first into the framebuffer.
if(tileColor.a <= 0.0) {
discard;
}
bool sliced = rejectBySlice(vpos);
if (sliced) {
tileColor *= sliceOpacity;
}
vec3 albedo = tileColor.rgb;
// heuristic shading function used in the old terrain, now used to add ambient lighting
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
${P.pbrMode===y.PBRMode.Simplified||P.pbrMode===y.PBRMode.TerrainWithWater?F.glsl`fragColor = vec4(evaluatePBRSimplifiedLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight, normalize(vpos - cameraPosition), vup), tileColor.a);`:F.glsl`fragColor = vec4(evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight), tileColor.a);`}
${S?F.glsl`
vec4 overlayWaterMask = getOverlayColor(ovWaterTex, vtcOverlay);
float waterNormalLength = length(overlayWaterMask);
if (waterNormalLength > 0.95) {
mat3 tbnMatrix = mat3(tbnTangent, tbnBiTangent, vnormal);
vec4 waterOverlayColor = vec4(overlayColor.w > 0.0 ? overlayColorOpaque.xyz/overlayColor.w : vec3(1.0), overlayColor.w);
vec4 viewPosition = view*vec4(vpos, 1.0);
vec4 waterColorLinear = getOverlayWaterColor(overlayWaterMask, waterOverlayColor, -normalize(vpos - cameraPosition), shadow, vnormal, tbnMatrix, viewPosition.xyz, vpos + localOrigin);
vec4 waterColorNonLinear = delinearizeGamma(vec4(waterColorLinear.xyz, 1.0));
float opacity = sliced ? sliceOpacity : 1.0;
// un-gamma the ground color to mix in linear space
fragColor = mix(groundColor, waterColorNonLinear, waterColorLinear.w) * opacity;
}`:""}
${P.screenSizePerspective?F.glsl`
float perspectiveScale = screenSizePerspectiveScaleFloat(1.0, screenSizeCosAngle, screenSizeDistanceToCamera, vec4(0.0, 0.0, 0.0, 0.0));
if (perspectiveScale <= 0.25) {
fragColor = mix(fragColor, vec4(1.0, 0.0, 0.0, 1.0), perspectiveScale * 4.0);
}
else if (perspectiveScale <= 0.5) {
fragColor = mix(fragColor, vec4(0.0, 0.0, 1.0, 1.0), (perspectiveScale - 0.25) * 4.0);
}
else if (perspectiveScale >= 0.99) {
fragColor = mix(fragColor, vec4(0.0, 1.0, 0.0, 1.0), 0.2);
}
else {
fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), (perspectiveScale - 0.5) * 2.0);
}`:""}
${P.visualizeNormals?P.spherical?F.glsl`
vec3 localUp = normalize(vpos + localOrigin);
vec3 right = normalize(cross(vec3(0.0, 0.0, 1.0), localUp));
vec3 forward = normalize(cross(localUp, right));
mat3 tbn = mat3(right, forward, localUp);
vec3 tNormal = normalize(normal * tbn);
fragColor = vec4(vec3(0.5) + 0.5 * tNormal, 0.0);
`:F.glsl`
vec3 tNormal = normalize(normal);
fragColor = vec4(vec3(0.5) + 0.5 * tNormal, 0.0);
`:""}
${P.tileBorders?F.glsl`
vec2 dVuv = fwidth(vuv0);
vec2 edgeFactors = smoothstep(vec2(0.0), 1.5 * dVuv, min(vuv0, 1.0 - vuv0));
float edgeFactor = 1.0 - min(edgeFactors.x, edgeFactors.y);
fragColor = mix(fragColor, vec4(1.0, 0.0, 0.0, 1.0), edgeFactor);`:""}
fragColor = highlightSlice(fragColor, vpos);
}
`);break;case f.ShaderOutput.Depth:S&&M.include(A.OverlayTerrain,P);K.code.add(F.glsl`
void main(void) {
${S?F.glsl`setOverlayVTC(getUV0());`:""}
gl_Position = transformPosition(proj, view, position);
}
`);J.code.add(F.glsl`
void main() {
${S?F.glsl`if (getCombinedOverlayColor().a == 0.0) { discard; }`:""}
}
`);break;case f.ShaderOutput.Shadow:case f.ShaderOutput.ShadowHighlight:case f.ShaderOutput.ShadowExcludeHighlight:case f.ShaderOutput.ViewshedShadow:M.include(v.OutputDepth,P);h.addLinearDepth(M);h.addNearFar(M);K.code.add(F.glsl`void main(void) {
gl_Position = transformPositionWithDepth(proj, view, position, nearFar, linearDepth);
}`);J.code.add(F.glsl`void main() {
outputDepth(linearDepth);
}`);break;case f.ShaderOutput.Normal:S&&M.include(A.OverlayTerrain,P);R.add("vnormal","vec3");C.addViewNormal(K);Q();K.code.add(F.glsl`
void main(void) {
${S?F.glsl`setOverlayVTC(getUV0());`:""}
gl_Position = transformPosition(proj, view, position);
vnormal = normalize((viewNormal * vec4(getNormal(), 1.0)).xyz);
}
`);J.code.add(F.glsl`
void main() {
${S?F.glsl`if (getCombinedOverlayColor().a == 0.0) { discard; }`:""}
vec3 normal = normalize(vnormal);
if (gl_FrontFacing == false) {
normal = -normal;
}
fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);
}
`);break;case f.ShaderOutput.Highlight:W&&M.include(A.OverlayTerrain,P),K.code.add(F.glsl`
void main() {
${W?F.glsl`setOverlayVTC(getUV0());`:""}
gl_Position = transformPosition(proj, view, position);
}
`),M.include(m.OutputHighlight,P),J.code.add(F.glsl`
void main() {
${W?F.glsl`if (getCombinedOverlayColor().a == 0.0) { discard; }`:""}
outputHighlight();
}
`)}P.output===f.ShaderOutput.ObjectAndLayerIdColor&&(W?(M.include(A.OverlayTerrain,{...P,pbrMode:y.PBRMode.Disabled}),K.code.add(F.glsl`void main(void) {
gl_Position = transformPosition(proj, view, position);
setOverlayVTC(getUV0());
}`),J.code.add(F.glsl`void main() {
fragColor = getOverlayColorTexel(vtcOverlay);
}`)):(K.code.add(F.glsl`void main(void) {
${P.opaque?F.glsl` gl_Position = transformPosition(proj, view, position);`:""}
}`),J.code.add(F.glsl`void main() {
fragColor = vec4(0.0);
}`)));return M}class I extends B.OverlayTerrainPassParameters{}const O=q.create(),L=p.create();q=Object.freeze(Object.defineProperty({__proto__:null,TerrainPassParameters:I,build:G},Symbol.toStringTag,{value:"Module"}));a.Terrain=q;a.TerrainPassParameters=I;a.build=G})},"esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.VertexTangent=function(q,l){q.varyings.add("tbnTangent","vec3");q.varyings.add("tbnBiTangent",
"vec3");l.spherical?q.vertex.code.add(b.glsl`void forwardVertexTangent(vec3 n) {
tbnTangent = normalize(cross(vec3(0.0, 0.0, 1.0), n));
tbnBiTangent = normalize(cross(n, tbnTangent));
}`):q.vertex.code.add(b.glsl`void forwardVertexTangent(vec3 n) {
tbnTangent = vec3(1.0, 0.0, 0.0);
tbnBiTangent = normalize(cross(n, tbnTangent));
}`);q.fragment.code.add(b.glsl`mat3 getTBNMatrix(vec3 n) {
return mat3(tbnTangent, tbnBiTangent, n);
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl":function(){define("exports ../shading/ReadShadowMap.glsl ./BackgroundGrid.glsl ./TileBlendInput ../../shaderModules/interfaces ../../shaderModules/Uniform".split(" "),function(a,b,q,l,p,k){class h extends b.ReadShadowMapPassParameters{constructor(){super(...arguments);this.overlayOpacity=1}}class f extends k.Uniform{constructor(d){super(d,"float")}}class c extends k.Uniform{constructor(d){super(d,
"vec3")}}class e extends k.Uniform{constructor(d){super(d,"vec4")}}class g extends k.Uniform{constructor(d){super(d,"sampler2D")}}a.Float3Uniform=c;a.OverlayTerrainPassParameters=h;a.TerrainTexture=function(d,t){const {vertex:w,fragment:v,varyings:m}=d;m.add("vtc","vec2");w.uniforms.add(new e("texOffsetAndScale"));v.uniforms.add(new g("tex"));v.uniforms.add(new c("textureOpacities"));if(d=t.textureFadingEnabled&&!t.renderOccluded)w.uniforms.add(new e("nextTexOffsetAndScale")),m.add("nvtc","vec2"),
v.uniforms.add(new g("texNext")),v.uniforms.add(new c("nextTexOpacities")),v.uniforms.add(new f("fadeFactor"));const r=t.tileBlendInput===l.TileBlendInput.ColorComposite;(t=t.tileBlendInput===l.TileBlendInput.GridComposite)&&v.include(q.BackgroundGrid);r&&v.uniforms.add(new c("backgroundColor"));w.code.add(p.glsl`
void forwardTextureCoordinatesWithTransform(in vec2 uv) {
vtc = uv * texOffsetAndScale.zw + texOffsetAndScale.xy;
${d?p.glsl`nvtc = uv * nextTexOffsetAndScale.zw + nextTexOffsetAndScale.xy;`:p.glsl``}
}`);v.code.add(p.glsl`
vec4 getColor(vec4 color, vec2 uv, vec3 opacities) {
${t||r?p.glsl`
if (opacities.y <= 0.0) {
return color * opacities.z * opacities.x;
}
vec4 bg = vec4(${r?p.glsl`backgroundColor`:p.glsl`gridColor(uv)`} * opacities.y, opacities.y);
vec4 layer = color * opacities.z;
return (bg * (1.0 - layer.a) + layer) * opacities.x;`:p.glsl`return color;`}
}`);d?v.code.add(p.glsl`vec4 getTileColor() {
vec4 color = getColor(texture(tex, vtc), vtc, textureOpacities);
if (fadeFactor >= 1.0) {
return color;
}
vec4 nextColor = getColor(texture(texNext, nvtc), nvtc, nextTexOpacities);
return mix(nextColor, color, fadeFactor);
}`):v.code.add(p.glsl`vec4 getTileColor() {
return getColor(texture(tex, vtc), vtc, textureOpacities);
}`)};a.Texture2DUniform=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/BackgroundGrid.glsl":function(){define(["exports","../../shaderModules/interfaces"],function(a,b){a.BackgroundGrid=function(q){q.code.add(b.glsl`
float lineFactorAtPosition(float value) {
float pos = value * ${b.glsl.float(257)};
if(pos < 0.5 || pos > ${b.glsl.float(256.5)}) {
return 1.0;
}
pos = pos + 0.5;
float modulo = mod(pos, 16.0);
return modulo <= 2.0 ? 1.0 - abs(modulo - 1.0) : 0.0;
}
float lineFactorAtUV(vec2 uv) {
return max(lineFactorAtPosition(uv.x), lineFactorAtPosition(uv.y));
}
float lineFactor(vec2 uv) {
vec2 offset = fwidth(uv) * 0.25;
return (lineFactorAtUV(vec2(uv.x + offset.x, uv.y + offset.y)) +
lineFactorAtUV(vec2(uv.x - offset.x, uv.y + offset.y)) +
lineFactorAtUV(vec2(uv.x + offset.x, uv.y - offset.y)) +
lineFactorAtUV(vec2(uv.x - offset.x, uv.y - offset.y))) / 4.0;
}
vec3 gridColor(vec2 uv) {
float line = lineFactor(uv) * 0.1 + 0.9;
return vec3(1.0, 0.972, 0.918) * line;
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBlendInput":function(){define(["exports"],function(a){a.TileBlendInput=void 0;var b=a.TileBlendInput||(a.TileBlendInput={});b[b.LayerOnly=0]="LayerOnly";b[b.ColorComposite=1]="ColorComposite";b[b.GridComposite=2]="GridComposite";b[b.COUNT=3]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/ScaleRangeQueries":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/ObjectPool ../../../core/PooledArray ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec42 ../../../core/libs/gl-matrix-2/factories/vec4f64".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){class t{constructor(){this.extent=d.create();this.maxLevel=this.minLevel=0;this.callback=null}}a.ScaleRangeQueries=class extends q{constructor(){super(...arguments);this._queries=new p({initialSize:10});this._queriesInvPtr=0;this._queryQueue=new p({initialSize:30});this._queryPool=new l(t)}queryVisibleLevelRange(w,v,m,r){const n=this._queryPool.acquire();g.copy(n.extent,w);n.minLevel=null==v?-Number.MAX_VALUE:v;n.maxLevel=null==m?Number.MAX_VALUE:m;n.callback=r;this._queryQueue.push(n);
this.notifyChange("updating")}get updating(){return 0!==this._queryQueue.length}prepare(){for(;this._queries.length<this._queries.data.length&&0<this._queryQueue.length;){const w=this._queryQueue.pop();this._queries.push(w)}this._queriesInvPtr=this._queries.length}process(){for(let w=0;w<this._queries.length;w++){const v=this._queries.data[w];this._queryPool.release(v);v.callback(w>=this._queriesInvPtr);v.callback=null}this._queries.clear();this.notifyChange("updating")}queriesForTile(w){const v=
w.level;let m=0;for(;m<this._queriesInvPtr;){const r=this._queries.data[m],n=r.extent;v>=r.minLevel&&v<=r.maxLevel&&n[0]<=w.extent[2]&&n[2]>=w.extent[0]&&n[1]<=w.extent[3]&&n[3]>=w.extent[1]?(this._queries.swapElements(m,this._queriesInvPtr-1),this._queriesInvPtr--):m++}}};b.__decorate([k.property()],a.ScaleRangeQueries.prototype,"updating",null);a.ScaleRangeQueries=b.__decorate([e.subclass("esri.views.3d.terrain.ScaleRangeQueries")],a.ScaleRangeQueries);Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/terrain/SphericalPatch":function(){define("exports ../../../core/mathUtils ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/projection/lonLatToSphericalPCPF ../../../geometry/support/DoubleArray ../../../geometry/support/frustum ../../../chunks/sphere ./interfaces ./PatchGeometryFactory ./terrainUtils ./Tile ./TileFrustumVisibility ./tileUtils".split(" "),function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(z,A,B,C,D,F){z=C-z;
A=D-A;B=F-B;return z*z+A*A+B*B}class m extends d.Tile{constructor(z,A,B,C,D){super();this._convexHull=Array(24);this._boundingSphere=f.create();this._baseUsedMemory=1816;this.init(z,A,B,C,D)}init(z,A,B,C,D){super.init(z,A,B,C,D);A=this.ellipsoid.radius;B=this.extentInRadians[0];C=this.extentInRadians[1];D=this.extentInRadians[2];const F=this.extentInRadians[3],H=b.lerp(C,F,.5),N=b.lerp(B,D,.5);this._edgeLen=(D-B)*Math.cos(0===z?0:Math.min(Math.abs(C),Math.abs(F)))*A;this._edgeLen2=this._edgeLen*this._edgeLen;
this._curvatureHeight=A-Math.sqrt(A*A-this._edgeLen2/4);p.lonLatToSphericalPCPF(this.centerAtSeaLevel,N,H,this.ellipsoid.radius);q.normalize(this.up,this.centerAtSeaLevel);this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateBoundingVolumes();const z=this._center;if(0===this.lij[0])q.set(f.getCenter(z[d.CenterPosition.MIDDLE]),0,0,0),q.set(z[d.CenterPosition.TOP],0,0,0),q.set(z[d.CenterPosition.BOTTOM],0,0,0),z[d.CenterPosition.MIDDLE][3]=this.ellipsoid.radius+this.elevationBoundsMax;
else{this._updateCenter();const H=z[d.CenterPosition.MIDDLE],N=this.convexHull;var A=0;for(let E=0;8>E;++E){var B=Math,C=B.max;var D=f.getCenter(H);var F=3*E;D=v(D[0],D[1],D[2],N[F],N[F+1],N[F+2]);A=C.call(B,A,D)}z[d.CenterPosition.MIDDLE][3]=Math.sqrt(A)}}_calculateFrustumVisibilityStatus(z){if(!h.intersectsSphere(z,this._boundingSphere))return t.TileFrustumVisibility.OUTSIDE;if(10>this.lij[0])return t.TileFrustumVisibility.INTERSECTS;const A=this.convexHull,B=this.surface.view.state.camera.near;
let C=!0;for(let F=0;F<h.numPlanes;F++){var D=z[F];const H=D[0],N=D[1],E=D[2];D=D[3]-(F===h.PlaneIndex.NEAR?B:0);let G=!1;for(let I=0;8>I;++I){const O=3*I;if(0>H*A[O]+N*A[O+1]+E*A[O+2]+D){if(G=!0,!C)break}else C=!1}if(!G)return t.TileFrustumVisibility.OUTSIDE}return C?t.TileFrustumVisibility.INSIDE:t.TileFrustumVisibility.INTERSECTS}computeElevationBounds(){super.computeElevationBounds();this._updateBoundingVolumes()}createGeometry(){e.createSphericalGlobePatch(this.renderData,this._getPatchType());
this._updateBoundingVolumes();this.setMemoryDirty()}_updateBoundingVolumes(){this._updateConvexHull();this._updateBoundingSphere();g.enableTerrainInternalChecks&&this._checkBVs()}_updateBoundingSphere(){const z=this._boundingSphere,A=f.getCenter(z);var B=this.elevationBoundsMin,C=this.elevationBoundsMax,D=this.ellipsoid.radius;if(0===this.level)q.set(A,0,0,0),z[3]=D+C;else{var F=this.extentInRadians,H=.5*(F[0]+F[2]),N=F[3];n(x,H,F[1],D);n(y,H,N,D);q.add(A,x,y);q.scale(A,A,(D+.5*(B+C))/q.len(A));B=
this.convexHull;C=0;for(D=0;8>D;++D)F=A[0]-B[3*D],H=A[1]-B[3*D+1],N=A[2]-B[3*D+2],C=Math.max(C,Math.sqrt(F*F+H*H+N*N));z[3]=C+2}}_updateConvexHull(){var z=this.extentInRadians,A=this.ellipsoid.radius;if(0!==this.level){var B=this.elevationBoundsMin,C=this.elevationBoundsMax,D=this._getPatchType(),F=this.surface.isWebMercator,H=F&&D===c.PatchType.HAS_NORTH_POLE,N=(D=F&&D===c.PatchType.HAS_SOUTH_POLE)||H;F=Math.PI/2;var E=z[0],G=z[2];D=D?-F:z[1];var I=H?F:z[3],O=.5*(E+G),L=A+(N?Math.min(0,B-1):B);B=
l.create();z=l.create();H=l.create();F=l.create();n(B,E,D,L);n(z,E,I,L);n(H,G,I,L);n(F,G,D,L);E=(R,Q)=>{for(let W=0;3>W;++W)this._convexHull[3*Q+W]=R[W]};E(B,0);E(z,1);E(H,2);E(F,3);var P=A+(N?Math.max(0,C+1):C),M=l.create();A=l.create();C=l.create();n(A,O,I,L);n(C,O,D,L);q.add(M,A,C);q.normalize(M,M);var K=l.create(),J=l.create();D=(R,Q)=>{q.sub(J,R,Q);q.normalize(J,J);Q=-q.dot(R,K)/q.dot(J,K);g.internalAssert(0<=Q);q.scale(J,J,Q);q.add(R,R,J)};2**this.lij[0]>2*this.lij[1]?(A=l.create(),q.cross(A,
u,C),q.normalize(A,A),q.cross(K,C,A),q.normalize(K,K),g.internalAssert(g.almostEquals(q.dot(K,C)/q.len(C),0)),D(B,z),D(F,H),E(B,0),E(F,3)):2**this.lij[0]!==2*this.lij[1]&&(C=l.create(),q.cross(C,u,A),q.normalize(C,C),q.cross(K,C,A),q.normalize(K,K),D(z,B),D(H,F),E(z,1),E(H,2));A=(R,Q)=>{const W=P/q.dot(Q,M);for(let S=0;3>S;++S)this._convexHull[3*R+S]=Q[S]*W};A(4,B);A(5,z);A(6,H);A(7,F)}}_getPatchType(){const z=this.lij[1],A=z===(1<<this.level)-1;return 0===z?A?c.PatchType.HAS_BOTH_POLES:c.PatchType.HAS_NORTH_POLE:
A?c.PatchType.HAS_SOUTH_POLE:c.PatchType.REGULAR}intersectsRay(z,A,B,C){var D=this._boundingSphere;B=D[3]+B;var F=D[0]-z[0];C=D[1]-z[1];z=D[2]-z[2];D=(F*A[0]+C*A[1]+z*A[2])/(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]);F=A[0]*D-F;C=A[1]*D-C;A=A[2]*D-z;return F*F+C*C+A*A<B*B}getDefaultVerticesPerSide(){return this.level<r.length?r[this.level]+1:2}updateCornerElevations(){e.updateCornerSpherical(this.renderData);this._updateBoundingVolumes()}updateEdgeElevations(){e.updateEdgesAndCornersSpherical(this.renderData);
this._updateBoundingVolumes()}updateEdgeElevationsAndResolutions(){e.updateEdgeElevationsAndResolutionsSpherical(this.renderData);this._updateBoundingVolumes()}_checkBVs(){if(g.enableTerrainInternalChecks&&!(2>=this.level)){var z=this._boundingSphere,A=z[3],B=f.getCenter(z);z=l.create();var C=this.ellipsoid.radius,D=this.elevationBoundsMin,F=this.elevationBoundsMax,H=C+D,N=this._center[d.CenterPosition.MIDDLE][3],E=this.convexHull,G=(za,ya)=>{for(let Da=0;3>Da;++Da)za[Da]=E[3*ya+Da]},I=l.create(),
O=l.create(),L=l.create(),P=l.create(),M=l.create(),K=(za,ya,Da,ra)=>{G(O,za);G(L,ya);G(P,Da);q.sub(O,O,L);q.sub(P,P,L);q.cross(I,O,P);q.normalize(I,I);var xa=q.dot(I,L);G(M,ra);const Ma=q.dot(I,M);xa=Math.abs(Ma-xa);g.internalAssert(g.almostEquals(xa,0),`Non coplanar ${za},${ya},${Da},${ra} diff = ${xa}`)};K(0,1,2,3);K(4,5,6,7);K(0,1,4,5);K(1,2,5,6);K(2,3,6,7);K(3,0,7,4);var J=k.newDoubleArray(24),R=l.create(),Q=l.create(),W=l.create(),S=l.create();K=(za,ya,Da,ra)=>{G(R,ya);G(Q,Da);G(W,ra);q.sub(R,
R,Q);q.normalize(R,R);q.sub(W,W,Q);q.normalize(W,W);q.cross(S,R,W);q.normalize(S,S);ya=q.dot(S,Q);za*=4;for(Da=0;3>Da;++Da)J[za+Da]=S[Da];J[za+3]=ya};K(0,0,1,2);K(1,1,0,4);K(2,1,5,2);K(3,3,2,6);K(4,4,0,3);K(5,4,6,5);var V=(za,ya,Da,ra)=>{za*=4;return J[za]*ya+J[za+1]*Da+J[za+2]*ra-J[za+3]},T=(za,ya,Da,ra)=>-1<=V(za,ya,Da,ra),Y=2**this.lij[0]>2*this.lij[1];K=(za,ya,Da)=>Math.sqrt(v(za,ya,Da,B[0],B[1],B[2]))<A;var ha=this.extentInRadians,ba=.5*(ha[0]+ha[2]),U=ha[1],Z=ha[3];ha=l.create();var ca=l.create();
n(ha,ba,Z,H);n(ca,ba,U,H);H=Y?"Upper":"Lower";Y=!0;for(ba=0;6>ba;++ba){for(U=0;8>U;++U)Z=3*U,Z=-1<=V(ba,E[Z],E[Z+1],E[Z+2]),Y&&=Z,g.internalAssert(Z,`Tile[${this.lij}] Convex hull point ${U} outside of plane ${ba}`);g.internalAssert(T(ba,ca[0],ca[1],ca[2]),`Tile[${this.lij}] (${H}) bottom mid outside of plane ${ba}`);g.internalAssert(T(ba,ha[0],ha[1],ha[2]),`Tile[${this.lij}] (${H}) top mid outside of plane ${ba}`)}g.internalAssert(Y,"Not all convex hull points are inside convex hull polyhedron");
g.internalAssert(K(ca[0],ca[1],ca[2]),`Tile[${this.lij}] (${H}) bottom mid outside of bounding sphere`);g.internalAssert(K(ha[0],ha[1],ha[2]),`Tile[${this.lij}] (${H}) top mid outside of bounding sphere`);for(T=0;8>T;++T)ha=3*T,ha=K(E[ha],E[ha+1],E[ha+2]),g.internalAssert(ha,`Tile[${this.lij}] Convex hull point ${T} outside of bounding sphere`);for(K=0;6>K;++K)for(T=0;8>T;++T)ha=3*T,-1<=V(K,E[ha],E[ha+1],E[ha+2])||console.error(`Tile[${this.lij}] Convex hull point ${T} outside of plane ${K}`);({extentInRadians:K}=
this);K=Math.round(Math.max(K[2]-K[0],K[3]-K[1])*C);({renderData:T}=this);if(T){var {geometry:ea,geometryState:da,localOrigin:ia}=T;if(T=ea.vertexAttributes?.position){ha=l.create();ca=ea.numVerticesPerSide-2;var {indices:ka,indexCount:fa,edgeVerticesStartIndex:X,poleVerticesStartIndex:ja}=ea;if(ka)for(H=new Set,Y=0;Y<fa;++Y){const za=ka[Y];if(H.has(za))continue;H.add(za);const ya=za<ja,Da=za>=X;let ra=!1;ba=-1;if(Da)for(U=X,Z=0;4>Z;++Z){var la=da.edgeResolutions[Z];if(za===U||za===U+la-1){ra=!0;
break}U+=la;if(za<U){ba=Z;break}}ba=Da?da.edgePeerNeighbors[ba]:null;const xa=Da&&ba&&0<w.compareTilesByLij(this,ba);T.getVec(za,z);q.add(ha,z,ia);ba=q.len(ha)-C;U=0;Z=!1;la=D-ba;const Ma=ba-F,Ga=1<la,Pa=1<Ma;var na=Ga||Pa;const Qa=()=>{const Ea=Da&&!ra;return`Tile[${this.lij}].vertex[${za}]:${ya?"internal":Ea?"edge":ra?"corner":"pole"}`+(Ga?"(below)":Pa?"(above)":"")+(xa?"(Neighbor)":"")};var va=q.dist(ha,B);va>=A+0&&(va-=A,na||(console.error(`${Qa()} is out of the bounding sphere by ${va.toFixed(0)} / ${A.toFixed(0)}`+
"[tol\x3d0]"+` h=${ba.toFixed(0)} / [${D.toFixed(0)}..${F.toFixed(0)}] (${(va/A).toFixed(0)})`),Z=!0));for(na=0;6>na;++na)if(!(-1<=V(na,ha[0],ha[1],ha[2]))){va=V(na,ha[0],ha[1],ha[2]);const Ea=za%ca,ua=(za-Ea)/ca;0===na&&la||5===na&&Ma||(console.error(`${Qa()} (${Ea},${ua})|${ca}] is out of the bounding trapezoid plane ${na}`+` h=${Math.round(ba)} / [${Math.round(D)}..${Math.round(F)}] dist=${Math.round(va)}`+` radii = ${Math.round(A)}/${Math.round(N)}} : maxL = ${K}`),++U)}if(Z||0<U)break}}}}}get convexHull(){return this._convexHull}}
const r=[128,64,64,32,16,8,8,4],n=(z,A,B,C)=>{const D=Math.sin(A),F=Math.cos(B);B=Math.sin(B);z[0]=C*F*Math.cos(A);z[1]=C*F*D;z[2]=C*B},u=[0,0,1],x=l.create(),y=l.create();a.SphericalPatch=m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/lonLatToSphericalPCPF":function(){define(["exports"],function(a){a.lonLatToSphericalPCPF=function(b,q,l,p){const k=Math.cos(l);b[0]=Math.cos(q)*k*p;b[1]=Math.sin(q)*k*p;b[2]=Math.sin(l)*p};Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/terrain/SplitLimits":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h,f){a.SplitLimits=class extends q{constructor(){super(...arguments);this.angledSplitBias=this.maxLod=this.relativeHeightLimit=this.relativeWidthLimit=this.fovY=this.fovX=0;
this.aboveGround=!0}};b.__decorate([l.property()],a.SplitLimits.prototype,"fovX",void 0);b.__decorate([l.property()],a.SplitLimits.prototype,"fovY",void 0);b.__decorate([l.property()],a.SplitLimits.prototype,"relativeWidthLimit",void 0);b.__decorate([l.property()],a.SplitLimits.prototype,"relativeHeightLimit",void 0);b.__decorate([l.property()],a.SplitLimits.prototype,"maxLod",void 0);b.__decorate([l.property()],a.SplitLimits.prototype,"angledSplitBias",void 0);b.__decorate([l.property()],a.SplitLimits.prototype,
"aboveGround",void 0);b.__decorate([l.property()],a.SplitLimits.prototype,"frustum",void 0);a.SplitLimits=b.__decorate([f.subclass("esri.views.3d.terrain.SplitLimits")],a.SplitLimits);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TerrainRenderer":function(){define("exports ../../../chunks/tslib.es6 ../../../Color ../../../core/has ../../../core/maybe ../../../core/MemCachePool ../../../core/ObjectPool ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../geometry/support/aaBoundingBox ../../../geometry/support/buffer/BufferView ../../ViewingMode ./interfaces ./LayerClass ./OverlayContent ./OverlayRenderer ./PatchRenderData ./RenderOrder ./TerrainAttributesCache ./terrainUtils ./TileRenderer ./TileUpdate ./tileUtils ../webgl-engine/collections/Component/ComponentIntersectionData ../webgl-engine/core/shaderLibrary/ShaderOutput ../../../chunks/Terrain.glsl ../webgl-engine/core/shaderLibrary/terrain/TileBlendInput ../webgl-engine/effects/RenderPlugin ../webgl-engine/lib/Attribute ../webgl-engine/lib/basicInterfaces ../webgl-engine/lib/glUtil3D ../webgl-engine/lib/Intersector ../webgl-engine/lib/IntersectorInterfaces ../webgl-engine/lib/Material ../webgl-engine/lib/RayIntersections ../webgl-engine/lib/RenderSlot ../webgl-engine/lib/screenSizePerspectiveUtils ../webgl-engine/lib/VertexAttribute ../webgl-engine/lib/verticalOffsetUtils ../webgl-engine/materials/DrawParameters ../webgl-engine/shaders/TerrainTechnique ../webgl-engine/shaders/TerrainTechniqueConfiguration ../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U,Z,ca){const ea=r.create();a.TransparencyMode=void 0;(function(X){X[X.Opaque=0]="Opaque";X[X.Semitransparent=1]="Semitransparent";X[X.TransparentWithDraped=2]="TransparentWithDraped";X[X.Empty=3]="Empty"})(a.TransparencyMode||(a.TransparencyMode={}));a.TerrainRenderer=class extends P.SyncPrepareRenderPlugin{get _isGlobal(){return this._stage.viewingMode===u.ViewingMode.Global}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}constructor(X,
ja,la,na,va){super({});this._overlayRenderer=X;this._stage=ja;this._allTiles=la;this._ellipsoidRadius=na;this.type=Q.IntersectorType.TERRAIN;this.isGround=!0;this._tileSize=256;this._techniqueConfiguration=new Z.TerrainTechniqueConfiguration;this._passParameters=new O.TerrainPassParameters;this._drawParameters=new ba.DrawParameters;this._renderDataPool=new h(B.PatchRenderData);this._visiblePatchesByOrigin=new Map;this._allPatchesByOrigin=new Map;this._patchSortingDirty=this._patchesByOriginDirty=
!0;this._tileIterator=new E.IteratorPreorder;this._transparencyState=a.TransparencyMode.Opaque;this._inViewshed=this._castShadows=!1;this._tileRenderer=this._emptyTex=null;this._stencilEnabledLayerExtents=[];this._numOriginsRendered=this._numTilesCulled=this._numTilesRendered=0;this.renderOccludedFlags=W.RenderOccludedFlag.Occlude;this.produces=new Map([[V.RenderSlot.OPAQUE_TERRAIN,()=>this._produces()],[V.RenderSlot.TRANSPARENT_TERRAIN,()=>this._produces()],[V.RenderSlot.OCCLUDED_TERRAIN,()=>this._produces()]]);
this._tileTextureCache=new k.MemCachePool((za,ya)=>va.newCache(za,ya),"TileTexture");this.tileGeometryCache=new D.TerrainAttributesCache(va)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this);this.addHandles(f.watch(()=>this._overlayRenderer.rendersOccludedDraped,X=>{this.renderOccludedFlags=X?A.overlayRenderOccludedFlag:W.RenderOccludedFlag.Occlude;this.setNeedsRender()},f.sync))}destroy(){this._stage.removeRenderPlugin(this);this._tileTextureCache.destroy();this.tileGeometryCache.destroy()}_produces(){return this.visible&&
!!this._rootTiles&&!this.renderingDisabled}consumes(){return this._overlayRenderer.hasWater?P.ConsumesDepth:P.ConsumesNone}set renderingDisabled(X){this._set("renderingDisabled",!!X);this.setDirty()}set visible(X){this._set("visible",!!X);this.setDirty()}updateHeading(X){this._tileRenderer?.updateHeading(X)}set transparency(X){this._transparencyState!==X&&(this._techniqueConfiguration.invisible=X===a.TransparencyMode.TransparentWithDraped||X===a.TransparencyMode.Empty,this._techniqueConfiguration.opaque=
X===a.TransparencyMode.Opaque,this._transparencyState=X,this.setNeedsRender())}get transparency(){return this._transparencyState}get renderPatchBorders(){return!!this._techniqueConfiguration.tileBorders}set renderPatchBorders(X){this._techniqueConfiguration.tileBorders!==X&&(this._techniqueConfiguration.tileBorders=X,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get visualizeNormals(){return!!this._techniqueConfiguration.visualizeNormals}set visualizeNormals(X){this._techniqueConfiguration.visualizeNormals!==
X&&(this._techniqueConfiguration.visualizeNormals=X,this.setNeedsRender(),this.notifyChange("visualizeNormals"))}get cullBackFaces(){return this._techniqueConfiguration.backfaceCullingEnabled}set cullBackFaces(X){this._techniqueConfiguration.backfaceCullingEnabled!==X&&(this._techniqueConfiguration.backfaceCullingEnabled=X,this.notifyChange("cullBackFaces"),this.setNeedsRender())}set renderOrder(X){this._set("renderOrder",X);this._setSortingDirty()}get layerUid(){return ha.terrainId}get slicePlaneEnabled(){return this._techniqueConfiguration.hasSlicePlane}set slicePlaneEnabled(X){this._techniqueConfiguration.hasSlicePlane!==
X&&(this._techniqueConfiguration.hasSlicePlane=X,this.setNeedsRender())}set textureFadingEnabled(X){this._techniqueConfiguration.textureFadingEnabled!==X&&(this._techniqueConfiguration.textureFadingEnabled=X,this.setNeedsRender())}set pbrMode(X){this._techniqueConfiguration.pbrMode!==X&&(this._techniqueConfiguration.pbrMode=X,this.setNeedsRender())}setDebugScreenSizePerspective(X){this._techniqueConfiguration.screenSizePerspective!==X&&(this._techniqueConfiguration.screenSizePerspective=X,this.setNeedsRender())}setRootTiles(X){this._rootTiles=
X;this.setDirty()}setStencilEnabledLayerExtents(X){this._stencilEnabledLayerExtents=X;this._setSortingDirty()}setTileSize(X){this._tileSize=X;null!=this._tileRenderer&&(this._tileRenderer.tileSize=X);this.setDirty()}_prepareTileForLoading(X){X.renderData||(X.renderData=this._renderDataPool.acquire(),X.renderData.init(X,this._getLocalOriginOfTile(X)))}loadTile(X){this._prepareTileForLoading(X);this.updateTileGeometryState(X);this.updateTileTexture(X,N.TileUpdate.TEXTURE_FADING)}updateTileTexture(X,
ja){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(X,ja===N.TileUpdate.TEXTURE_FADING?x.TextureUpdate.FADING:x.TextureUpdate.UNFADED),this.setNeedsRender(),X.resetPendingUpdate(ja))}updateTileGeometryState(X){for(const ja of X.layerInfo[y.LayerClass.ELEVATION])ja.pendingUpdates&=~N.TileUpdate.GEOMETRY;X.resetPendingUpdate(N.TileUpdate.GEOMETRY);(X=X.renderData.updateGeometryState())&&this.setDirty();return X}updateGeometryIfNeeded(X){X.isLoaded&&X.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(X){const ja=
X.renderData;ja&&(ja.releaseGeometry(),this._renderDataPool.release(ja),ja.clear(),X.renderData=null,X.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(X){const ja=Math.max(0,7*Math.floor((X.level-3)/7));if(this._isGlobal&&0===ja)return v.ZEROS;for(;X.parent&&X.level>ja;)X=X.parent;return X.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(X){this._get("wireframe")!==X&&(this._set("wireframe",
X),this.setNeedsRender())}setDirty(X=K.RenderRequestType.UPDATE){this._patchesByOriginDirty=!0;this._context.requestRender(X)}_setSortingDirty(X=K.RenderRequestType.UPDATE){this._patchSortingDirty=!0;this._context.requestRender(X)}setNeedsRender(X=K.RenderRequestType.UPDATE){this._context.requestRender(X)}initializeRenderContext(X){this._context=X;this._tileRenderer=new H.TileRenderer(this._rctx,this._tileSize,this._techniques,this._tileTextureCache);this.updateTileBackground();this._emptyTex=J.createEmptyTexture(this._rctx)}uninitializeRenderContext(){this._emptyTex=
p.disposeMaybe(this._emptyTex);this._tileRenderer=p.disposeMaybe(this._tileRenderer)}intersect(X,ja,la,na){if(!(!this._rootTiles||X.options.selectOpaqueTerrainOnly&&X.options.selectionMode&&this.transparency!==a.TransparencyMode.Opaque)){var va=da,za=ia;w.subtract(va,na,la);w.set(za,1/va[0],1/va[1],1/va[2]);var ya=X.results.min,Da=X.results.max,ra=X.results.ground,xa=X.options.store===Q.StoreResults.MIN,Ma=!!X.results.ground.target,Ga=ha.getVerticalOffsetTerrain(X.verticalOffset),Pa=X.tolerance,Qa,
Ea=xa&&null!=ya.dist?ya.dist:Infinity,ua=X.options,Na=ua.normalRequired||!ua.backfacesTerrain,Ua=new S.MeshIntersectionOptions(!1,Na),wa=Ha=>{var Ka=Ha.renderData;if(Ka?.vao){var Aa=Ka.geometry;r.set(ea,Aa.boundingBox);var Sa=Ka.localOrigin;null!=Ga&&(Ga.localOrigin=Sa,Ga.applyToAabb(ea));ka[0]=la[0]-Sa[0];ka[1]=la[1]-Sa[1];ka[2]=la[2]-Sa[2];if(S.intersectAabbInvDirBefore(ea,ka,za,Pa,Ea)){var Ya=(Ta,Ra,$a)=>{Ta.set(this.type,Ha,Ra,$a,t.IDENTITY);Ea=xa&&null!=ya.dist?ya.dist:Infinity};Ka=(Ta,Ra,$a)=>
{(!Na||null!=$a)&&0<=Ta&&(ua.backfacesTerrain||0>w.dot($a,va))&&(ua.invisibleTerrain||!ua.selectionMode||null==ja||ja(la,na,Ta))&&((null==ra.dist||Ta<ra.dist)&&Ya(ra,Ta,$a),ua.isFiltered||(ua.store===Q.StoreResults.ALL&&(null==Qa?(Qa=R.newIntersectorResult(X.ray),Ya(Qa,Ta,$a),X.results.all.push(Qa)):Ta<Qa.dist&&Ya(Qa,Ta,$a)),(null==ya.dist||Ta<ya.dist)&&Ya(ya,Ta,$a),ua.store!==Q.StoreResults.MIN&&(null==Da.dist||Ta>Da.dist)&&Ya(Da,Ta,$a)))};var qa=fa;w.subtract(qa,na,Sa);var {indices:aa,indexCount:Ja}=
Aa;Aa=Aa.vertexAttributes;Sa=Aa.getField(Y.VertexAttribute.POSITION,n.BufferViewVec3f);Aa=new M.Vertices(Sa.typedBuffer,3,Aa.stride/4);Sa=Ja/3;if(!Ga&&Sa>G.componentMinimalSizeForIntersectionData){const Ta=Ha.renderData;null==Ta.intersectionData&&(Ta.intersectionData=new G.ComponentIntersectionData(aa,0,Sa,Aa));Ta.intersectionData.intersectRay(ka,qa,Ua,Ka)}else S.intersectTriangles(ka,qa,0,Sa,aa,Aa,Ga,Ua,Ka)}}},sa=this._rootTiles;null!=sa&&(()=>{const Ha=this._tileIterator;Ha.reset(sa);const Ka=X.options.invisibleTerrain;
for(let Aa=Ha.next();Aa;Aa=Ha.next())!(Aa.visible||Ka&&Aa.intersectsClippingArea)||null==Ga&&!Aa.intersectsRay(la,va,Pa,Ea)||Ma&&this._useStencilForTile(Aa)?Ha.skipSubtree():wa(Aa)})()}}processScaleRangeQueries(X,ja){if(!ja.done)for(this._updatePatchGroups();X.updating&&!ja.done;){X.prepare();for(const la of this._visiblePatchesByOrigin.values())for(const na of la)null!=na.renderData?.textureReference&&X.queriesForTile(na);X.process();ja.madeProgress()}}prepareTechnique(X){var ja=l("enable-feature:terrain-shadows")&&
X.bindParameters.shadowMap.enabled;ja!==this._castShadows&&(this._castShadows=ja,this._patchesByOriginDirty=!0);ja=X.bindParameters.viewshedEnabled;this._inViewshed!==ja&&(this._inViewshed=ja,this._patchesByOriginDirty=!0);if(X.bindParameters.slot===V.RenderSlot.OCCLUDED_TERRAIN){if(0===(X.renderOccludedMask&A.overlayRenderOccludedFlag))return null}else if(X.bindParameters.slot!==(this.transparency===a.TransparencyMode.Opaque?V.RenderSlot.OPAQUE_TERRAIN:V.RenderSlot.TRANSPARENT_TERRAIN))return null;
if(this.transparency===a.TransparencyMode.Empty)return null;switch(X.output){case I.ShaderOutput.Color:return this._techniqueConfiguration.hasScreenSpaceReflections=null!=X.bindParameters.ssr.lastFrameColor,this._techniqueConfiguration.hasCloudsReflections=null!=X.bindParameters.cloudsFade.data,this._techniqueConfiguration.receiveShadows=X.bindParameters.shadowMap.ready,this._techniqueConfiguration.receiveAmbientOcclusion=null!=X.bindParameters.ssao,this._techniqueConfiguration.overlayMode=this._overlayRenderer.mode,
this._updateTechnique(I.ShaderOutput.Color,X.bindParameters.slot===V.RenderSlot.OCCLUDED_TERRAIN);case I.ShaderOutput.Shadow:case I.ShaderOutput.ShadowExcludeHighlight:if(this._castShadows)return this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(I.ShaderOutput.Shadow,!1);break;case I.ShaderOutput.ViewshedShadow:if(this._inViewshed)return this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=
!1,this._updateTechnique(I.ShaderOutput.ViewshedShadow,!1);break;case I.ShaderOutput.Depth:return this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(I.ShaderOutput.Depth,!1);case I.ShaderOutput.Normal:return this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(I.ShaderOutput.Normal,!1);case I.ShaderOutput.ObjectAndLayerIdColor:return this._updateTechnique(I.ShaderOutput.ObjectAndLayerIdColor,
!1);case I.ShaderOutput.Highlight:if(this._overlayRenderer.hasHighlights)return this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(I.ShaderOutput.Highlight,!1)}return null}renderNode(X,ja){this._updatePatchGroups();ja.useStencil=!1;switch(X.output){case I.ShaderOutput.Color:this._renderMaterialPass(X,ja,X.bindParameters.slot===V.RenderSlot.OCCLUDED_TERRAIN?z.OverlayContent.Occluded:z.OverlayContent.Color);break;case I.ShaderOutput.Depth:case I.ShaderOutput.Normal:this._renderAuxiliaryPass(X,
ja,z.OverlayContent.Color,this._visiblePatchesByOrigin);break;case I.ShaderOutput.Highlight:this._renderAuxiliaryPass(X,ja,z.OverlayContent.Highlight,this._visiblePatchesByOrigin);break;case I.ShaderOutput.Shadow:case I.ShaderOutput.ShadowExcludeHighlight:case I.ShaderOutput.ViewshedShadow:this._renderAuxiliaryPass(X,ja,null,this._allPatchesByOrigin);break;case I.ShaderOutput.ObjectAndLayerIdColor:this._renderAuxiliaryPass(X,ja,z.OverlayContent.ObjectAndLayerIdColor,this._visiblePatchesByOrigin)}}updateTileBackground(X){if(null!=
this._tileRenderer){var ja=this._tileRenderer;if(null!=X){X=q.toUnitRGBA(X);var la=v.fromValues(X[0]||0,X[1]||0,X[2]||0)}ja.setBackground(la);this._allTiles.forAll(na=>ja.updateTileTexture(na,x.TextureUpdate.FADING));this._techniqueConfiguration.tileBlendInput=ja.backgroundIsGrid?L.TileBlendInput.GridComposite:null!=ja.backgroundColor?L.TileBlendInput.ColorComposite:L.TileBlendInput.LayerOnly;this.setNeedsRender()}}_updatePatchGroups(){this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=
!1,this._patchSortingDirty=!0);if(this._patchSortingDirty&&this.renderOrder!==C.RenderOrder.NONE){const X=Array.from(this._visiblePatchesByOrigin.values()),ja=this._stencilEnabledLayerExtents;for(const la of X)E.sortTiles(this.renderOrder,la,ja);X.sort((la,na)=>E.compareTiles(la[0],na[0],this.renderOrder));this._visiblePatchesByOrigin=new Map(X.map(la=>[la[0].renderData.localOrigin,la]));this._patchSortingDirty=!1}}_rebuildPatchGroups(){const X=this._rootTiles;if(null!=X){X[0]?.surface.checkAllTilesWaterproofness();
this._visiblePatchesByOrigin.clear();this._allPatchesByOrigin.clear();for(const ja of X)this._rebuildPatchGroupsForRootTile(ja)}}_rebuildPatchGroupsForRootTile(X){const ja=this._tileIterator;for(ja.resetOne(X);!ja.done;){X=ja.next();var la=X.renderData;if(la){la=la.localOrigin;if(this._castShadows||this._inViewshed){var na=this._allPatchesByOrigin.get(la);na||(na=[],this._allPatchesByOrigin.set(la,na));na.push(X)}X.visible?(na=this._visiblePatchesByOrigin.get(la),na||(na=[],this._visiblePatchesByOrigin.set(la,
na)),na.push(X),ja.skipSubtree()):(this._numTilesCulled++,ja.skipSubtree())}else this._numTilesCulled++}}_useStencilForTile(X){for(const ja of this._stencilEnabledLayerExtents)if(X.intersectsExtent(ja))return!0;return!1}_renderAuxiliaryPass(X,ja,la,na){const va=X.rctx;this._passParameters.overlayContent=la;va.bindTechnique(ja,X.bindParameters,this._passParameters);const za=0<this._stencilEnabledLayerExtents.length;na.forEach(ya=>{this._drawParameters.origin=ya[0].renderData.localOrigin;ja.program.bindDraw(this._drawParameters,
X.bindParameters,this._passParameters);for(let Da=0;Da<ya.length;Da++)this._renderPatch(X,ja,ya[Da],ca.PrimitiveType.TRIANGLES,za,la)});X.rctx.bindVAO(null)}_renderMaterialPass(X,ja,la){var {rctx:na}=X;this._passParameters.overlayContent=la;na.bindTechnique(ja,X.bindParameters,this._passParameters);this._numOriginsRendered=this._numTilesCulled=this._numTilesRendered=0;var va=X.bindParameters.camera;na=ja.program;this._techniqueConfiguration.screenSizePerspective&&this.pointsOfInterest&&T.getSettings(this._stage.viewingMode,
this._ellipsoidRadius).update({distance:this.pointsOfInterest.centerOnSurfaceFrequent.distance,fovY:va.fovY});va=0<this._stencilEnabledLayerExtents.length;const za=la===z.OverlayContent.Occluded;za&&(na.bindTexture("tex",this._emptyTex),na.setUniform3fv("textureOpacities",v.ZEROS),na.setUniform4fv("texOffsetAndScale",m.ZEROS));var ya=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:v.ZEROS;this._techniqueConfiguration.tileBlendInput===L.TileBlendInput.ColorComposite&&na.setUniform3fv("backgroundColor",
ya);ya=this.wireframe?ca.PrimitiveType.LINES:ca.PrimitiveType.TRIANGLES;this._techniqueConfiguration.textureFadingEnabled&&na.bindTexture("texNext",this._emptyTex);var Da=this._visiblePatchesByOrigin;for(const ra of Da.values()){ja.program.bindDraw(new ba.DrawParameters(ra[0].renderData.localOrigin),X.bindParameters,this._passParameters);this._numOriginsRendered++;for(const xa of ra){Da=xa.renderData;const Ma=Da.textureReference;if(null!=Ma){if(!za){na.setUniform4fv("texOffsetAndScale",Ma.offsetAndScale);
na.bindTexture("tex",Ma.texture.texture);const Ga=Da.textureFadeFactor,Pa=1>Ga?Da.nextTextureReference:null;this._techniqueConfiguration.textureFadingEnabled&&null!=Pa&&1>Ga?(na.setUniform1f("fadeFactor",Ga),na.setUniform4fv("nextTexOffsetAndScale",Pa.offsetAndScale),na.setUniform3fv("nextTexOpacities",Pa.opacities),na.bindTexture("texNext",Pa.texture.texture)):na.setUniform1f("fadeFactor",1);Da.textureIsFading&&this.setNeedsRender();na.setUniform3fv("textureOpacities",Ma.opacities)}this._renderPatch(X,
ja,xa,ya,va,la);xa.renderOrder=this._numTilesRendered;this._numTilesRendered++}}}X.rctx.bindVAO(null)}_renderPatch(X,ja,la,na,va,za){const ya=la.renderData,Da=ya.vao,ra=Da?.indexBuffer;if(Da&&null!=ra){var xa=ja.program;null==za||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(xa,ya.overlay);va&&(ja.useStencil=this._useStencilForTile(la),X.rctx.setPipelineState(ja.getPipeline()));ja=ya.geometry.indexCount;X.rctx.bindVAO(Da);xa.assertCompatibleVertexAttributeLocations(Da);X.rctx.drawElements(na,
ja,ra.indexType,0)}else F.enableTerrainInternalChecks&&console.error("Rendered tile with no indices: ",la.lij," : ",ya)}_bindOverlayPatchData(X,ja){X.setUniform4fv("overlayTexOffset",ja.offsets);X.setUniform4fv("overlayTexScale",ja.scales)}_updateTechnique(X,ja){this._techniqueConfiguration.output=X;this._techniqueConfiguration.renderOccluded=ja;return this._shaderTechnique=this._techniques.releaseAndAcquire(U.TerrainTechnique,this._techniqueConfiguration,this._shaderTechnique)}get test(){}};b.__decorate([c.property({readOnly:!0})],
a.TerrainRenderer.prototype,"_isGlobal",null);b.__decorate([c.property()],a.TerrainRenderer.prototype,"renderOccludedFlags",void 0);b.__decorate([c.property({value:!1})],a.TerrainRenderer.prototype,"renderingDisabled",null);b.__decorate([c.property({value:!0})],a.TerrainRenderer.prototype,"visible",null);b.__decorate([c.property()],a.TerrainRenderer.prototype,"renderPatchBorders",null);b.__decorate([c.property()],a.TerrainRenderer.prototype,"visualizeNormals",null);b.__decorate([c.property()],a.TerrainRenderer.prototype,
"cullBackFaces",null);b.__decorate([c.property({value:C.RenderOrder.FRONT_TO_BACK})],a.TerrainRenderer.prototype,"renderOrder",null);b.__decorate([c.property()],a.TerrainRenderer.prototype,"wireframe",null);a.TerrainRenderer=b.__decorate([d.subclass("esri.views.3d.terrain.TerrainRenderer")],a.TerrainRenderer);const da=v.create(),ia=v.create(),ka=v.create(),fa=v.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TerrainAttributesCache":function(){define(["exports",
"../../../core/MemCachePool","./TerrainAttributes"],function(a,b,q){class l{constructor(p){this._storage=new b.MemCachePool((k,h)=>p.newCache(k,h),"TileGeometry")}acquire(p){p=4*Math.ceil(p/4);const k=this._storage,h=p.toString(),f=k.pop(h);if(f)return f;const c=q.terrainAttributesLayout.createBuffer(p);c.release=()=>k.put(h,c);return c}clear(){this._storage.clear()}destroy(){this._storage.destroy()}}a.TerrainAttributesCache=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TerrainAttributes":function(){define(["exports",
"../support/buffer/InterleavedLayout","../webgl-engine/lib/VertexAttribute"],function(a,b,q){b=b.newLayout().vec3f(q.VertexAttribute.POSITION).vec2i16(q.VertexAttribute.UV0).vec2i16(q.VertexAttribute.NORMALCOMPRESSED,{glNormalized:!0});a.terrainAttributesLayout=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileRenderer":function(){define("exports ../../../core/has ../../../core/maybe ../../../core/libs/gl-matrix-2/math/vec2 ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../layers/support/layerUtils ./BlendLayersTechnique ./interfaces ./LayerClass ./NeighborIndex ./TerrainData ./terrainUtils ./TextureFader ./TextureReference ./TileCompositor ./TileRenderInfo ./TileTexture ./TileUpdate ../webgl-engine/core/shaderLibrary/output/BlendOptions ../webgl-engine/core/shaderLibrary/terrain/BlendLayersOutput ../webgl-engine/lib/glUtil3D ../../webgl/enums ../../webgl/Texture ../../webgl/TextureDescriptor".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){function C(M,K,J){O.layerIndex=K;O.vtlNeighborInfos.clear();const R=M.layerInfo[c.LayerClass.MAP][K];l.set(O.offset,0,0);O.tile=M;O.scale=1;O.sourceLod=M.lij;O.sourceLayerInfo=R;O.isVTLBackground=J;if(R.data)return J&&M.forEachLoadedNeighbor((W,S)=>{if(W.level===M.level){var V=W.layerInfo[c.LayerClass.MAP][K];if(d.isVectorTilePerLayerInfo(V)&&R.data!==V.data){var T=O.vtlNeighborInfos.pushNew();T.offset=P[S];T.sourceLod=W.lij;T.sourceLayerInfo=
V}}}),O;const Q=R.upsampleInfo;return Q?(J=Q.tile.layerInfo[c.LayerClass.MAP][K],O.tile=Q.tile,l.copy(O.offset,Q.offset),O.scale=Q.scale,O.sourceLod=Q.tile.lij,O.sourceLayerInfo=J,O):J?O:null}function D(M){M=M.sourceLayerInfo.data;return M.source?"nearest"===M.interpolation:!1}function F(M){let K="normal"!==M.blendMode;k.isGroupLayer(M.parent)&&(K=F(M.parent)||K);return K}function H(M,K){k.isGroupLayer(M.parent)&&H(M.parent,K);const J=M.uid;if(null!=J&&""!==J){const R=G.get(J);R?R.start=K:G.set(J,
new N(K,K,M.blendMode,M.opacity,x.BlendLayersOutput.Composite,1))}}class N{constructor(M,K,J,R,Q,W){this.start=M;this.end=K;this.blendMode=J;this.opacity=R;this.output=Q;this.baseOpacity=W}}class E{constructor(M,K,J,R){this._rctx=M;this.tileSize=K;this._techniques=J;this._cache=R;this._passParameters=new h.BlendLayersPassParameters;this._backgroundColor=this._backgroundTexture=null;this._backgroundDirty=!1;this._maxAnisotropy=this._rctx.parameters.maxMaxAnisotropy;this._compositor=new v.TileCompositor(this._rctx,
this._techniques);this._ensureBackgroundTexture(this.tileSize)}dispose(){this._compositor=q.disposeMaybe(this._compositor);this._backgroundTexture=q.releaseMaybe(this._backgroundTexture)}get backgroundIsGrid(){return null==this._backgroundColor}get backgroundColor(){return this._backgroundColor}updateHeading(M){this._compositor?.updateHeading(M)}updateTileTexture(M,K){if(M.renderData){var J=M.surface,R=J.baseOpacity,Q=0,W=0,S=this.tileSize,V=!1,T=!1,Y=J.view.state.contentPixelRatio,ha=!1;G.clear();
I.length=0;for(var ba=M.layerInfo[c.LayerClass.MAP],U=0,Z=null;U<ba.length;U++){const ia=J.layerViewByIndex(U,c.LayerClass.MAP);var ca=ia.layer.opacity;const ka=ia.fullOpacity;T=T||k.isBaseLayer(ia.layer);if(d.isBlendableLayerView(ia)){var ea="normal"!==ia.layer.blendMode;if(k.isGroupLayer(ia.layer.parent)){var da=ia.layer.parent.uid;null!=da&&""!==da&&(ea=F(ia.layer.parent)||ea)}ea&&(ha=ea,V=!1)}if(0!==ca||ha){if(++W,ca=d.isVectorTileLayerView(ia),ea=C(M,U,ca))ba[U].pendingUpdates&=~(n.TileUpdate.TEXTURE_NOFADING&
n.TileUpdate.TEXTURE_FADING),k.isGroupLayer(ia.layer.parent)&&(da=ia.layer.parent.uid,null!=da&&""!==da&&H(ia.layer.parent,U)),ca?S=Math.max(S,this.tileSize*Y):1===R&&1===ka&&(ia.isOpaque||this._dataToTexture(ea)&&ea.sourceLayerInfo.data.descriptor.isOpaque)&&(V=!0),++Q,null===Z&&(Z=U)}else ba[U].pendingUpdates&=~(n.TileUpdate.TEXTURE_NOFADING&n.TileUpdate.TEXTURE_FADING)}R=S/this.tileSize;J=this._ensureBackgroundTexture(this.tileSize);0===Q||null===Z?(Q=M.renderData,K=K===f.TextureUpdate.FADING&&
null!=Q.textureReference&&(M.surface.view.layerViewManager.updating||0<W)?t.ActivationTime.Delayed:t.ActivationTime.Immediate,Q.setTextureReference(new w.TextureReference(J,f.TextureUpdate.FADING,L,M.surface.baseOpacity,0,1),K)):1===Q&&!ha&&this._useLayerTexture(M,Z)||this._composeLayers(M,K,U-1,T,S,R,!V||ha,G,ha)}}_ensureBackgroundTexture(M){null==this._backgroundTexture&&(this._backgroundTexture=this._buildTexture(M,!1),this._backgroundDirty=!0);this._backgroundDirty&&(this._compositor.bind(M),
this._passParameters.offset=p.ZEROS,this._passParameters.scale=1,this._passParameters.opacity=1,this.backgroundColor&&(this._passParameters.backgroundColor=this.backgroundColor),this._compositor.drawBackground(this._passParameters,null!=this.backgroundColor),this._compositor.copyFBOToTexture(this._backgroundTexture),this._compositor.unbind(),this._backgroundDirty=!1);return this._backgroundTexture}_useLayerTexture(M,K){var J=M.surface.layerViewByIndex(K,c.LayerClass.MAP),R=k.isBaseLayer(J.layer);
const Q=R?M.surface.baseOpacity:1;R=R?1:M.surface.baseOpacity;J=J.fullOpacity;K=C(M,K,!1);return this._dataToTexture(K)?(M.renderData.setTextureReference(new w.TextureReference(K.sourceLayerInfo.data,f.TextureUpdate.FADING,K,Q,R,J)),!0):!1}_composeLayers(M,K,J,R,Q,W,S,V,T){this._compositor.ensureBuffer(Q);const Y=M.surface.baseOpacity;let ha=!1,ba=z.TextureSamplingMode.LINEAR_MIPMAP_LINEAR,U=!1,Z=0;for(let ia=J;0<=ia;ia--){J=M.surface.layerViewByIndex(ia,c.LayerClass.MAP);var ca=d.isVectorTileLayerView(J);
ca=C(M,ia,ca);const ka=J.layer.opacity;if(!ca||0===ka&&!T)continue;const fa=!k.isBaseLayer(J.layer)&&!ha;fa&&(ha=!0);let X=!1;V.forEach(ja=>{ja.start===ia&&(ja.output=R?x.BlendLayersOutput.Composite:S&&fa?this.backgroundIsGrid?x.BlendLayersOutput.GridComposite:x.BlendLayersOutput.ColorComposite:x.BlendLayersOutput.Composite,ja.baseOpacity=fa?Y:1,I.push(ja),this._compositor.openGroup(Q),X=!0)});var ea=0===Z;ea=X?x.BlendLayersOutput.GroupBackgroundComposite:S&&ea?this.backgroundIsGrid?x.BlendLayersOutput.GridComposite:
x.BlendLayersOutput.ColorComposite:x.BlendLayersOutput.Composite;J=u.blendModeFromString[d.isBlendableLayerView(J)?J.layer.blendMode:"normal"];this._passParameters.baseOpacity=fa&&!X&&1>Y?Y:1;this._passParameters.opacity=ka;d.isVectorTileRenderInfo(ca)?U=this._compositor.drawVectorData(this._passParameters,ea,Q,J,ca,W,this.tileSize,U):d.isImageryTileRenderInfo(ca)?(this._compositor.drawRasterData(this._passParameters,ea,Q,J,ca),D(ca)&&(ba=z.TextureSamplingMode.NEAREST)):this._dataToTexture(ca)&&(this._passParameters.texture=
ca.sourceLayerInfo.data.texture,this._passParameters.offset=ca.offset,this._passParameters.scale=ca.scale,this._compositor.drawImageData(this._passParameters,ea,Q,J));for(;0<I.length&&I[I.length-1].end===ia;)J=I.pop(),this._passParameters.baseOpacity=J.baseOpacity,this._passParameters.opacity=J.opacity,this._passParameters.offset=p.ZEROS,this._passParameters.scale=1,this._compositor.drawGroup(this._passParameters,J.output,Q,u.blendModeFromString[J.blendMode]);Z++}M=M.renderData;const da=T||ha&&1>
Y;T=M.ensureTexture(Q,da,()=>this._buildTexture(Q,da,ba));this._compositor.copyFBOToTexture(T);this._compositor.unbind();M.setTextureReference(new w.TextureReference(T,K,L,ha?1:Y,0,1))}_dataToTexture(M){if(d.isImageSourceRenderInfo(M)){const K=M.sourceLayerInfo;K.data=this._buildTexture(K.data,!0);M.tile.setMemoryDirty()}return d.isTextureTileRenderInfo(M)}setBackground(M){this._backgroundColor!==M&&(this._backgroundColor=M,this._backgroundDirty=!0)}_buildTexture(M,K,J=z.TextureSamplingMode.LINEAR_MIPMAP_LINEAR){if(null==
M)return null;const R=new B.TextureDescriptor;R.wrapMode=z.TextureWrapMode.CLAMP_TO_EDGE;R.samplingMode=J;R.maxAnisotropy=this._maxAnisotropy;R.preMultiplyAlpha=!0;R.flipped=!0;R.hasMipmap=!0;K||(R.pixelFormat=z.PixelFormat.RGB);K=this._rctx;let Q;if("number"===typeof M)R.width=R.height=M,Q=this._buildTileTexture(R,M);else if(g.isImageWithType(M))R.isOpaque=M.isOpaque,R.isOpaque&&(R.pixelFormat=z.PixelFormat.RGB),Q=this._buildTileTexture(R,M.element.width,M.element);else try{R.width=M.width,R.height=
M.height,Q=this._buildTileTexture(R,M.width,M)}catch(W){Q=new r(y.createEmptyTexture(K)),console.warn("TileRenderer: failed to execute 'texImage2D', cross-origin image may not be loaded.")}M=K.bindTexture(Q.texture,A.Texture.TEXTURE_UNIT_FOR_UPDATES);Q.generateMipmap();K.bindTexture(M,A.Texture.TEXTURE_UNIT_FOR_UPDATES);return Q}_buildTileTexture(M,K,J){K=this._cache.pop(`${K} ${M.pixelFormat}`);if(!K)return new r(new A.Texture(this._rctx,M,J),this._cache);K.retain();K.texture.setData(J);return K}get test(){}}
const G=new Map,I=[],O=new m.TileRenderInfo,L={offset:[0,0],scale:1},P=[];P[e.NeighborIndex.NORTH]=[0,-1];P[e.NeighborIndex.NORTH_EAST]=[-1,-1];P[e.NeighborIndex.EAST]=[-1,0];P[e.NeighborIndex.SOUTH_EAST]=[-1,1];P[e.NeighborIndex.SOUTH]=[0,1];P[e.NeighborIndex.SOUTH_WEST]=[1,1];P[e.NeighborIndex.WEST]=[1,0];P[e.NeighborIndex.NORTH_WEST]=[1,-1];a.GroupInfo=N;a.TileRenderer=E;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/BlendLayersTechnique":function(){define("require exports ../../../chunks/tslib.es6 ../../../core/libs/gl-matrix-2/factories/vec3f64 ./TileBlendTechniqueConfiguration ../webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl ../../../chunks/BlendLayers.glsl ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){class v extends k.TileCompositePassParameters{constructor(){super(...arguments);this.baseOpacity=this.opacity=1;this.fboTexture=this.texture=null;this.backgroundColor=l.ZEROS}}class m extends c.ShaderTechnique{initializeProgram(n){return new d.Program(n.rctx,m.shader.get().build(this.configuration),g.Default3D)}initializePipeline(){return w.makePipelineState({blending:w.simpleBlendingParams(t.BlendFactor.ONE,t.BlendFactor.ONE_MINUS_SRC_ALPHA),colorWrite:w.defaultColorWriteParams})}}
m.shader=new f.ReloadableShaderModule(h.BlendLayers,()=>new Promise((n,u)=>a(["../webgl-engine/core/shaderLibrary/util/BlendLayers.glsl"],n,u)));class r extends p.TileBlendTechniqueConfiguration{constructor(){super(...arguments);this.background=h.BackgroundMode.BelowLayer}}q.__decorate([e.parameter()],r.prototype,"background",void 0);b.BlendLayersPassParameters=v;b.BlendLayersTechnique=m;b.BlendLayersTechniqueConfiguration=r;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileBlendTechniqueConfiguration":function(){define("exports ../../../chunks/tslib.es6 ./BlendModeTechniqueConfiguration ../webgl-engine/core/shaderLibrary/terrain/BaseOpacityMode ../webgl-engine/core/shaderLibrary/terrain/BlendLayersOutput ../webgl-engine/core/shaderLibrary/terrain/PremultipliedAlphaSource ../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration".split(" "),
function(a,b,q,l,p,k,h){class f extends q.BlendModeTechniqueConfiguration{constructor(){super(...arguments);this.output=p.BlendLayersOutput.Composite;this.baseOpacityMode=l.BaseOpacityMode.NotRequired;this.premultipliedSource=k.PremultipliedAlphaSource.Off}}b.__decorate([h.parameter({count:p.BlendLayersOutput.COUNT})],f.prototype,"output",void 0);b.__decorate([h.parameter({count:l.BaseOpacityMode.COUNT})],f.prototype,"baseOpacityMode",void 0);b.__decorate([h.parameter()],f.prototype,"premultipliedSource",
void 0);a.TileBlendTechniqueConfiguration=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/BlendModeTechniqueConfiguration":function(){define(["exports","../../../chunks/tslib.es6","../webgl-engine/core/shaderLibrary/output/BlendOptions","../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q,l){class p extends l.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.blendMode=q.LayerBlendMode.Normal}}b.__decorate([l.parameter({count:q.LayerBlendMode.COUNT})],
p.prototype,"blendMode",void 0);a.BlendModeTechniqueConfiguration=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/output/BlendOptions":function(){define(["exports"],function(a){a.LayerBlendMode=void 0;(function(b){b[b.Normal=0]="Normal";b[b.Average=1]="Average";b[b.Lighten=2]="Lighten";b[b.Lighter=3]="Lighter";b[b.Plus=4]="Plus";b[b.Screen=5]="Screen";b[b.ColorDodge=6]="ColorDodge";b[b.Darken=7]="Darken";b[b.Multiply=8]="Multiply";b[b.ColorBurn=
9]="ColorBurn";b[b.Overlay=10]="Overlay";b[b.SoftLight=11]="SoftLight";b[b.HardLight=12]="HardLight";b[b.VividLight=13]="VividLight";b[b.Hue=14]="Hue";b[b.Saturation=15]="Saturation";b[b.Luminosity=16]="Luminosity";b[b.Color=17]="Color";b[b.DestinationOver=18]="DestinationOver";b[b.DestinationAtop=19]="DestinationAtop";b[b.DestinationIn=20]="DestinationIn";b[b.DestinationOut=21]="DestinationOut";b[b.SourceAtop=22]="SourceAtop";b[b.SourceIn=23]="SourceIn";b[b.SourceOut=24]="SourceOut";b[b.Xor=25]=
"Xor";b[b.Difference=26]="Difference";b[b.Exclusion=27]="Exclusion";b[b.Minus=28]="Minus";b[b.Invert=29]="Invert";b[b.Reflect=30]="Reflect";b[b.COUNT=31]="COUNT"})(a.LayerBlendMode||(a.LayerBlendMode={}));a.blendModeFromString={normal:a.LayerBlendMode.Normal,average:a.LayerBlendMode.Average,lighten:a.LayerBlendMode.Lighten,lighter:a.LayerBlendMode.Lighter,screen:a.LayerBlendMode.Screen,plus:a.LayerBlendMode.Plus,"color-dodge":a.LayerBlendMode.ColorDodge,darken:a.LayerBlendMode.Darken,multiply:a.LayerBlendMode.Multiply,
"color-burn":a.LayerBlendMode.ColorBurn,overlay:a.LayerBlendMode.Overlay,"soft-light":a.LayerBlendMode.SoftLight,"hard-light":a.LayerBlendMode.HardLight,"vivid-light":a.LayerBlendMode.VividLight,hue:a.LayerBlendMode.Hue,saturation:a.LayerBlendMode.Saturation,luminosity:a.LayerBlendMode.Luminosity,color:a.LayerBlendMode.Color,difference:a.LayerBlendMode.Difference,exclusion:a.LayerBlendMode.Exclusion,minus:a.LayerBlendMode.Minus,invert:a.LayerBlendMode.Invert,reflect:a.LayerBlendMode.Reflect,"destination-over":a.LayerBlendMode.DestinationOver,
"destination-atop":a.LayerBlendMode.DestinationAtop,"destination-in":a.LayerBlendMode.DestinationIn,"destination-out":a.LayerBlendMode.DestinationOut,"source-atop":a.LayerBlendMode.SourceAtop,"source-in":a.LayerBlendMode.SourceIn,"source-out":a.LayerBlendMode.SourceOut,xor:a.LayerBlendMode.Xor};a.isCompositeBlendMode=function(b){return b===a.LayerBlendMode.DestinationOver||b===a.LayerBlendMode.DestinationAtop||b===a.LayerBlendMode.DestinationIn||b===a.LayerBlendMode.DestinationOut||b===a.LayerBlendMode.SourceAtop||
b===a.LayerBlendMode.SourceIn||b===a.LayerBlendMode.SourceOut||b===a.LayerBlendMode.Xor};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/BaseOpacityMode":function(){define(["exports"],function(a){a.BaseOpacityMode=void 0;var b=a.BaseOpacityMode||(a.BaseOpacityMode={});b[b.NotRequired=0]="NotRequired";b[b.Required=1]="Required";b[b.COUNT=2]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/BlendLayersOutput":function(){define(["exports"],
function(a){a.BlendLayersOutput=void 0;var b=a.BlendLayersOutput||(a.BlendLayersOutput={});b[b.Composite=0]="Composite";b[b.ColorComposite=1]="ColorComposite";b[b.GridComposite=2]="GridComposite";b[b.GroupBackgroundComposite=3]="GroupBackgroundComposite";b[b.COUNT=4]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/PremultipliedAlphaSource":function(){define(["exports"],function(a){a.PremultipliedAlphaSource=void 0;var b=
a.PremultipliedAlphaSource||(a.PremultipliedAlphaSource={});b[b.Off=0]="Off";b[b.On=1]="On";b[b.COUNT=2]="COUNT";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../shaderModules/Float2PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../../lib/VertexAttribute".split(" "),function(a,b,q,l,
p,k){class h extends p.NoParameters{constructor(){super(...arguments);this.scale=1;this.offset=b.ZEROS}}a.TileComposite=function(f){f.attributes.add(k.VertexAttribute.POSITION,"vec2");f.attributes.add(k.VertexAttribute.UV0,"vec2");f.varyings.add("uv","vec2");f.varyings.add("vuv","vec2");f.vertex.uniforms.add(new l.FloatPassUniform("scale",c=>c.scale),new q.Float2PassUniform("offset",c=>c.offset)).code.add(p.glsl`void main(void) {
gl_Position = vec4(position, 0.0, 1.0);
uv = uv0 * scale + offset;
vuv = uv0;
}`)};a.TileCompositePassParameters=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/BlendLayers.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/terrain/BackgroundGrid.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/BlendLayersOutput ../views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e){function g(t){const w=new c.ShaderBuilder,v=w.fragment;w.include(p.TileComposite);if(t.background===a.BackgroundMode.Only)return(t=t.output===q.BlendLayersOutput.ColorComposite)?v.uniforms.add(new k.Float3PassUniform("backgroundColor",m=>m.backgroundColor)):v.include(b.BackgroundGrid),v.code.add(f.glsl`
void main() {
fragColor = vec4(${t?f.glsl`backgroundColor`:f.glsl`gridColor(uv)`}, 1.0);
}
`),w;w.include(l.TileBackground,t);v.uniforms.add(new e.Texture2DPassUniform("tex",m=>m.texture),new h.FloatPassUniform("opacity",m=>m.opacity)).code.add(f.glsl`void main() {
fragColor = blendLayers(uv, texture(tex, uv), opacity);
}`);return w}a.BackgroundMode=void 0;(function(t){t[t.BelowLayer=0]="BelowLayer";t[t.Only=1]="Only";t[t.COUNT=2]="COUNT"})(a.BackgroundMode||(a.BackgroundMode={}));const d=Object.freeze(Object.defineProperty({__proto__:null,get BackgroundMode(){return a.BackgroundMode},build:g},Symbol.toStringTag,{value:"Module"}));a.BlendLayers=d;a.build=g})},"esri/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../output/BlendOptions ./BackgroundGrid.glsl ./BaseOpacityMode ./BlendLayersOutput ./PremultipliedAlphaSource ../util/BlendModes.glsl ../../shaderModules/Float3PassUniform ../../shaderModules/FloatPassUniform ../../shaderModules/interfaces ../../shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){class t extends g.NoParameters{constructor(){super(...arguments);this.baseOpacity=1;this.backgroundColor=b.ZEROS;this.fboTexture=null}}a.TileBackground=function(w,v){const m=v.output===k.BlendLayersOutput.GridComposite,r=v.output===k.BlendLayersOutput.ColorComposite,n=v.output===k.BlendLayersOutput.GroupBackgroundComposite;var u=v.output===k.BlendLayersOutput.Composite;const x=v.baseOpacityMode===p.BaseOpacityMode.Required;w=w.fragment;x&&w.uniforms.add(new e.FloatPassUniform("baseOpacity",
A=>A.baseOpacity));m?w.include(l.BackgroundGrid):r?w.uniforms.add(new c.Float3PassUniform("backgroundColor",A=>A.backgroundColor)):u&&w.uniforms.add(new d.Texture2DPassUniform("fboColor",A=>A.fboTexture));const y=v.blendMode!==q.LayerBlendMode.Normal,z=v.premultipliedSource===h.PremultipliedAlphaSource.On;u=!y&&!z&&(u&&!x||n);w.include(f.BlendModes,v);w.code.add(g.glsl`
vec4 getBackground(vec2 uv) {
return ${x?g.glsl`baseOpacity *`:""} ${n?g.glsl`vec4(0.0, 0.0, 0.0, 0.0)`:r?g.glsl`vec4(backgroundColor, 1.0)`:m?g.glsl`vec4(gridColor(uv), 1.0)`:g.glsl`texelFetch(fboColor, ivec2(gl_FragCoord.xy), 0)`};
}
vec4 blendLayers(vec2 bgUV, vec4 colorLayer, float opacity) {
${y?g.glsl`
vec3 cl = colorLayer.a == 0.0 ? colorLayer.rgb : colorLayer.rgb / colorLayer.a;
vec4 bgColor = getBackground(bgUV);
vec3 cb = bgColor.a == 0.0 ? bgColor.rgb : bgColor.rgb / bgColor.a;
return applyBlendMode(clamp(cl, vec3(0.0), vec3(1.0)), colorLayer.a * opacity, cb, bgColor.a);`:g.glsl`
float composeAlpha = colorLayer.a * opacity;
${u?g.glsl`return colorLayer * opacity;`:g.glsl`
vec4 bgColor = getBackground(bgUV);
return bgColor * (1.0 - composeAlpha) + colorLayer * opacity;`}`}
}`)};a.TileBackgroundPassParameters=t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl":function(){define(["exports","../output/BlendOptions","../../shaderModules/interfaces"],function(a,b,q){a.BlendModes=function(l,p){p=p.blendMode;if(p!==b.LayerBlendMode.Normal){p===b.LayerBlendMode.Reflect&&l.code.add(q.glsl`float reflectBlend(in float cb, in float cl) {
return (cl == 1.0) ? cl : min(cb * cb / (1.0 - cl), 1.0);
}`);p!==b.LayerBlendMode.ColorDodge&&p!==b.LayerBlendMode.VividLight||l.code.add(q.glsl`float colorDodge(in float cb, in float cl) {
return (cb == 0.0) ? 0.0 : (cl == 1.0) ? 1.0 : min(1.0, cb / (1.0 - cl));
}`);p!==b.LayerBlendMode.ColorBurn&&p!==b.LayerBlendMode.VividLight||l.code.add(q.glsl`float colorBurn(in float cb, in float cl) {
return (cb == 1.0) ? 1.0 : (cl == 0.0) ? 0.0 : 1.0 - min(1.0, (1.0 - cb) / cl);
}`);p===b.LayerBlendMode.Overlay&&l.code.add(q.glsl`float overlay(in float cb, in float cl) {
return (1.0 - step(0.5, cl)) * (1.0 - 2.0 * (1.0 - cl ) * (1.0 - cb)) + step(0.5, cl) * (2.0 * cl * cb);
}`);p===b.LayerBlendMode.HardLight&&l.code.add(q.glsl`float hardLight(in float cb, in float cl) {
return (1.0 - step(0.5, cl)) * (2.0 * cl * cb) + step(0.5, cl) * (1.0 - 2.0 * (1.0 - cl) * (1.0 - cb));
}`);p===b.LayerBlendMode.SoftLight&&l.code.add(q.glsl`float softLight(in float cb, in float cl) {
if (cl <= 0.5) {
return cb - (1.0 - 2.0 * cl) * cb * (1.0 - cb);
}
if (cb <= 0.25) {
return cb + (2.0 * cl - 1.0) * cb * ((16.0 * cb - 12.0) * cb + 3.0);
}
return cb + (2.0 * cl - 1.0) * (sqrt(cb) - cb);
}`);p===b.LayerBlendMode.VividLight&&l.code.add(q.glsl`float vividLight(in float cb, in float cl) {
return (1.0 - step(0.5, cl)) * colorBurn(cb, 2.0 * cl) + step(0.5, cl) * colorDodge(cb, (2.0 * (cl - 0.5)));
}`);if(p===b.LayerBlendMode.Hue||p===b.LayerBlendMode.Saturation||p===b.LayerBlendMode.Color||p===b.LayerBlendMode.Luminosity)l.code.add(q.glsl`float minv3(in vec3 c) {
return min(min(c.r, c.g), c.b);
}
float maxv3(in vec3 c) {
return max(max(c.r, c.g), c.b);
}
float lumv3(in vec3 c) {
return dot(c, vec3(0.3, 0.59, 0.11));
}
vec3 clipColor(vec3 color) {
float lum = lumv3(color);
float mincol = minv3(color);
float maxcol = maxv3(color);
if (mincol < 0.0) {
color = lum + ((color - lum) * lum) / (lum - mincol);
}
if (maxcol > 1.0) {
color = lum + ((color - lum) * (1.0 - lum)) / (maxcol - lum);
}
return color;
}
vec3 setLum(vec3 cbase, vec3 clum) {
return clipColor(cbase + vec3(lumv3(clum) - lumv3(cbase)));
}`),p!==b.LayerBlendMode.Hue&&p!==b.LayerBlendMode.Saturation||l.code.add(q.glsl`float satv3(vec3 c) {
return maxv3(c) - minv3(c);
}
vec3 setLumSat(vec3 cbase, vec3 csat, vec3 clum)
{
float minbase = minv3(cbase);
float sbase = satv3(cbase);
float ssat = satv3(csat);
return setLum(sbase > 0.0 ? (cbase - minbase) * ssat / sbase : vec3(0.0), clum);
}`);l.code.add(q.glsl`
vec4 applyBlendMode(vec3 cl, float ol, vec3 cb, float ob) {
${p===b.LayerBlendMode.Multiply?q.glsl`return vec4(cl * ol * cb * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Average?q.glsl`return vec4((cb + cl) * 0.5 * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Lighten?q.glsl`return vec4(max(cb, cl) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Darken?q.glsl`return vec4(min(cl, cb) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:
p===b.LayerBlendMode.Lighter?q.glsl`return vec4(cl * ol + cb * ob, ol + ob);`:p===b.LayerBlendMode.Plus?q.glsl`return clamp(vec4(cl.rgb + cb.rgb, ol + ob), 0.0, 1.0);`:p===b.LayerBlendMode.Minus?q.glsl`return vec4(clamp(vec3(cb.rgb - cl.rgb), 0.0, 1.0), ob * ol);`:p===b.LayerBlendMode.Screen?q.glsl`return vec4((cl + cb - cl * cb) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Difference?q.glsl`return vec4(abs(cb - cl) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:
p===b.LayerBlendMode.Invert?q.glsl`return vec4((1.0 - cb) * ol * ob + cb * ob * (1.0 - ol), ob);`:p===b.LayerBlendMode.DestinationOver?q.glsl`return vec4(cl * ol * (1.0 - ob) + cb * ob, ol + ob - ol * ob);`:p===b.LayerBlendMode.DestinationAtop?q.glsl`return vec4(cl * ol * (1.0 - ob) + cb * ob * ol, ol);`:p===b.LayerBlendMode.DestinationOut?q.glsl`return vec4(cb * ob * (1.0 - ol), ob * (1.0 - ol));`:p===b.LayerBlendMode.SourceAtop?q.glsl`return vec4(cl * ol * ob + cb * ob * (1.0 - ol), ob);`:p===b.LayerBlendMode.SourceOut?
q.glsl`return vec4(cl * ol * (1.0 - ob), ol * (1.0 - ob));`:p===b.LayerBlendMode.Xor?q.glsl`return vec4(cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), ol * (1.0 - ob) + ob * (1.0 - ol));`:p===b.LayerBlendMode.DestinationIn?q.glsl`return vec4(cb * ob * ol, ol * ob);`:p===b.LayerBlendMode.SourceIn?q.glsl`return vec4(cl * ol * ob, ol * ob);`:p===b.LayerBlendMode.Hue?q.glsl`
vec3 f = setLumSat(cl, cb, cb);
return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Saturation?q.glsl`
vec3 f = setLumSat(cb, cl, cb);
return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Color?q.glsl`
vec3 f = setLum(cl, cb);
return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Luminosity?q.glsl`
vec3 f = setLum(cb, cl);
return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Exclusion?q.glsl`
vec3 f = cl + cb - 2.0 * cl * cb;
return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Reflect?q.glsl`
vec3 f = vec3(reflectBlend(cb.r, cl.r), reflectBlend(cb.g, cl.g), reflectBlend(cb.b, cl.b));
return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.ColorDodge?q.glsl`
vec3 f = vec3(colorDodge(cb.r, cl.r), colorDodge(cb.g, cl.g), colorDodge(cb.b, cl.b));
return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.ColorBurn?q.glsl`
vec3 f = vec3(colorBurn(cb.r, cl.r), colorBurn(cb.g, cl.g), colorBurn(cb.b, cl.b));
return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.Overlay?q.glsl`
vec3 f = vec3(overlay(cb.r, cl.r), overlay(cb.g, cl.g), overlay(cb.b, cl.b));
return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.SoftLight?q.glsl`
vec3 f = vec3(softLight(cb.r, cl.r), softLight(cb.g, cl.g), softLight(cb.b, cl.b));
return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.HardLight?q.glsl`
vec3 f = vec3(hardLight(cb.r, cl.r), hardLight(cb.g, cl.g), hardLight(cb.b, cl.b));
return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:p===b.LayerBlendMode.VividLight?q.glsl`
vec3 f = vec3(vividLight(cb.r, cl.r), vividLight(cb.g, cl.g), vividLight(cb.b, cl.b));
return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:q.glsl``}
}
`)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TextureReference":function(){define(["exports","../../../core/libs/gl-matrix-2/factories/vec3f64","../../../core/libs/gl-matrix-2/factories/vec4f64"],function(a,b,q){class l{constructor(p,k,h,f,c,e){this.texture=p;this.type=k;p.retain();this.offsetAndScale=q.fromValues(h.offset[0],h.offset[1],h.scale,h.scale);this.opacities=b.fromValues(f,c,e)}destroy(){this.texture.release()}}a.TextureReference=l;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileCompositor":function(){define("exports ../../../core/Logger ../../../core/maybe ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../2d/engine/imagery/enums ../../2d/engine/vectorTiles/VectorTileRendererHelper3D ./BlendLayersTechnique ./LayerClass ./RasterColorizerTechnique ./support/MultiSizeFramebuffer ../webgl-engine/core/shaderLibrary/output/BlendOptions ../webgl-engine/core/shaderLibrary/terrain/BaseOpacityMode ../webgl-engine/core/shaderLibrary/terrain/BlendLayersOutput ../webgl-engine/core/shaderLibrary/terrain/PremultipliedAlphaSource ../../../chunks/BlendLayers.glsl ../webgl-engine/lib/BindParameters ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/glUtil3D ../../webgl/enums ../../webgl/Texture ../../webgl/Util".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){class z{constructor(A,B){this._rctx=A;this._techniques=B;this._fbos=[];this._vectorTileHelper=new k.VectorTileRendererHelper3D;this._bindParameters=new m.BindParameters(null,null);this._blendLayersTechniqueConfig=new h.BlendLayersTechniqueConfiguration;this._current=0;this._lastUsedIds=[];this._lastCreatedBufferId=0;this._onHoldIds=[];this._vaoQuad=n.createQuadVAO(this._rctx,r.Pos2Tex)}dispose(){this._fbos.forEach(q.disposeMaybe);this._fbos=null;
this._vtFBO=q.disposeMaybe(this._vtFBO);this._vaoQuad=q.disposeMaybe(this._vaoQuad);this._vectorTileHelper=q.disposeMaybe(this._vectorTileHelper);this._backgroundTechnique=q.releaseMaybe(this._backgroundTechnique);this._applyOpacityTechnique=q.releaseMaybe(this._applyOpacityTechnique);this._blendLayersTechnique=q.releaseMaybe(this._blendLayersTechnique)}updateHeading(A){this._vectorTileHelper?.updateHeading(A)}_getBlendLayersTechnique(A,B,C,D=w.PremultipliedAlphaSource.Off,F=v.BackgroundMode.BelowLayer){this._blendLayersTechniqueConfig.output=
B;this._blendLayersTechniqueConfig.blendMode=A;this._blendLayersTechniqueConfig.baseOpacityMode=C;this._blendLayersTechniqueConfig.premultipliedSource=D;this._blendLayersTechniqueConfig.background=F;return this._blendLayersTechnique=this._techniques.releaseAndAcquire(h.BlendLayersTechnique,this._blendLayersTechniqueConfig,this._blendLayersTechnique)}drawBackground(A,B){B=this._getBlendLayersTechnique(g.LayerBlendMode.Normal,B?t.BlendLayersOutput.ColorComposite:t.BlendLayersOutput.GridComposite,d.BaseOpacityMode.NotRequired,
w.PremultipliedAlphaSource.Off,v.BackgroundMode.Only);A=this._rctx.bindTechnique(B,this._bindParameters,A);this._render(A)}_render(A){this._rctx.bindVAO(this._vaoQuad);A.assertCompatibleVertexAttributeLocations(this._vaoQuad);this._rctx.drawArrays(u.PrimitiveType.TRIANGLE_STRIP,0,y.vertexCount(this._vaoQuad,"geometry"))}drawGroup(A,B,C,D,F=w.PremultipliedAlphaSource.On){B===t.BlendLayersOutput.Composite&&(A.fboTexture=this._fbos[this.getLastOnHoldId()].get(C).colorTexture);A.texture=this.currentFBO(C).colorTexture;
this.closeGroup(C);B=this._getBlendLayersTechnique(D,B,1>A.baseOpacity?d.BaseOpacityMode.Required:d.BaseOpacityMode.NotRequired,F);A=this._rctx.bindTechnique(B,this._bindParameters,A);this._render(A)}drawImageData(A,B,C,D,F=w.PremultipliedAlphaSource.Off){if(null!=A.texture){var H=1>A.baseOpacity?d.BaseOpacityMode.Required:d.BaseOpacityMode.NotRequired;A.fboTexture=B===t.BlendLayersOutput.GroupBackgroundComposite||D===g.LayerBlendMode.Normal&&H===d.BaseOpacityMode.NotRequired&&F===w.PremultipliedAlphaSource.Off?
null:this.switch(C).colorTexture;B=this._getBlendLayersTechnique(D,B,H,F);A=this._rctx.bindTechnique(B,this._bindParameters,A);this._render(A)}}drawRasterData(A,B,C,D,F){var H=F.sourceLayerInfo.data;if(H.source&&(F.tile.surface.layerViewByIndex(F.layerIndex,f.LayerClass.MAP).ensureSymbolizerParameters(H),H.bind(this._rctx))){var N=1>A.baseOpacity?d.BaseOpacityMode.Required:d.BaseOpacityMode.NotRequired;A.fboTexture=D===g.LayerBlendMode.Normal&&N===d.BaseOpacityMode.NotRequired?null:this.switch(C).colorTexture;
B=this._getRasterColorizerTechnique(H,B,D,N);H.opacity=A.opacity;H=H.getUniforms();H.scale=F.scale;H.offset=F.offset;H.backgroundColor=A.backgroundColor;H.fboTexture=A.fboTexture;H.baseOpacity=A.baseOpacity;A=this._rctx.bindTechnique(B,null,H);this._render(A)}}_getRasterColorizerTechnique(A,B,C,D){const F=A.symbolizerParameters,H=["stretch","lut","hillshade"].indexOf(F.type);null==this._rasterColorizerConfig&&(this._rasterColorizerConfig=new c.RasterColorizerTechniqueConfiguration,this._rctx.gl.getExtension("WEBGL_color_buffer_float"),
this._rctx.gl.getExtension("OES_texture_float"));this._rasterColorizerConfig.output=B;this._rasterColorizerConfig.blendMode=C;this._rasterColorizerConfig.baseOpacityMode=D;this._rasterColorizerConfig.colorizerType=H;this._rasterColorizerConfig.applyColormap=!!F.colormap;this._rasterColorizerConfig.requireBilinearWithNN=A.isBilinearWithStretchColorRamp;this._rasterColorizerConfig.stretchType=A.hasStretchTypeNone()?p.RasterColorizerStretchType.Noop:p.RasterColorizerStretchType.PerBand;return this._rasterColorizerTechnique=
this._techniques.releaseAndAcquire(c.RasterColorizerTechnique,this._rasterColorizerConfig,this._rasterColorizerTechnique)}drawVectorData(A,B,C,D,F,H,N,E){const G=this._rctx,I=F.sourceLayerInfo.data,O=F.tile.surface.layerViewByIndex(F.layerIndex,f.LayerClass.MAP);var L=1>A.baseOpacity?d.BaseOpacityMode.Required:d.BaseOpacityMode.NotRequired;const P=L===d.BaseOpacityMode.Required||1>A.opacity||D!==g.LayerBlendMode.Normal||B!==t.BlendLayersOutput.Composite,M=P?w.PremultipliedAlphaSource.On:w.PremultipliedAlphaSource.Off;
L=this._getBlendLayersTechnique(D,B,L,M);G.setPipelineState(L.getPipeline());let K=L=null;P?(K=this.currentFBO(C),null==this._vtFBO&&(this._vtFBO=new e.MultiSizeFramebuffer(this._rctx)),L=this._vtFBO.get(C),G.bindFramebuffer(L),this._clearCurrentFBO()):E&&G.clear(u.ClearBufferBit.DEPTH_BUFFER_BIT);try{this._vectorTileHelper.renderBackground(G,F.sourceLod,O.painter,O.layer.styleRepository,O.schemaHelper,Math.round(1/F.scale),F.offset,N,H,O.contentZoom),I&&this._vectorTileHelper.renderContent(G,F.sourceLod,
I,F.vtlNeighborInfos,O.painter,O.layer.styleRepository,O.schemaHelper,Math.round(1/F.scale),F.offset,N,H,O.contentZoom)}catch(J){b.getLogger("esri.views.3d.terrain").warnOnce("A render call containing vector tiles did not resolve correctly.",J)}return null!=L?(G.bindFramebuffer(K),A.texture=L.colorTexture,A.offset=l.ZEROS,A.scale=1,this.drawImageData(A,B,C,D,M),E):!0}copyFBOToTexture(A){const B=this._rctx,C=B.bindTexture(A.texture,x.Texture.TEXTURE_UNIT_FOR_UPDATES),D=A.descriptor;B.gl.copyTexImage2D(u.TextureType.TEXTURE_2D,
0,D.pixelFormat,0,0,D.width,D.height,0);A.generateMipmap();B.bindTexture(C,x.Texture.TEXTURE_UNIT_FOR_UPDATES)}_clearCurrentFBO(){this._rctx.setStencilWriteMask(255);this._rctx.setClearColor(0,0,0,0);this._rctx.setClearDepth(1);this._rctx.setClearStencil(0);this._rctx.clear(u.ClearBufferBit.COLOR_BUFFER_BIT|u.ClearBufferBit.DEPTH_BUFFER_BIT|u.ClearBufferBit.STENCIL_BUFFER_BIT)}_initFBO(A,B,C){this._rctx.bindFramebuffer(A);C&&(this._rctx.setViewport(0,0,B,B),this._clearCurrentFBO())}ensureBuffer(A){this._lastUsedIds.length=
0;this._lastUsedIds.push(1);this._lastCreatedBufferId=1;this._onHoldIds.length=0;this.bind(A)}bind(A,B=0,C=!0){this._current=B;if(B>=this._fbos.length)for(let D=this._fbos.length;D<=B;D++)this._fbos.push(new e.MultiSizeFramebuffer(this._rctx));this._initFBO(this._fbos[B].get(A),A,C)}_bindNextFreeBuffer(A){0<this._lastUsedIds.length?this.bind(A,this._lastUsedIds.pop()):(this._lastCreatedBufferId++,this.bind(A,this._lastCreatedBufferId))}openGroup(A){this._onHoldIds.push(this._current);this._bindNextFreeBuffer(A)}switch(A){const B=
this.currentFBO(A),C=this._current;this._bindNextFreeBuffer(A);this._lastUsedIds.push(C);return B}getLastOnHoldId(){return this._onHoldIds[this._onHoldIds.length-1]}closeGroup(A){const B=this._current;this._bindNextFreeBuffer(A);this._lastUsedIds.push(B);this._lastUsedIds.push(this._onHoldIds.pop())}unbind(){this._rctx.bindFramebuffer(null)}currentFBO(A){return this._fbos[this._current].get(A)}}a.TileCompositor=z;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/imagery/enums":function(){define(["exports"],
function(a){a.RasterColorizerType=void 0;(function(b){b[b.Stretch=0]="Stretch";b[b.Lut=1]="Lut";b[b.Hillshade=2]="Hillshade";b[b.COUNT=3]="COUNT"})(a.RasterColorizerType||(a.RasterColorizerType={}));a.RasterColorizerStretchType=void 0;(function(b){b[b.Noop=0]="Noop";b[b.PerBand=1]="PerBand";b[b.COUNT=2]="COUNT"})(a.RasterColorizerStretchType||(a.RasterColorizerStretchType={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/VectorTileRendererHelper3D":function(){define("exports ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../core/libs/gl-matrix-2/math/common ../../tiling/TileInfoView ../../tiling/TileKey ../../tiling/TileQueue ../../tiling/TileStrategy ./decluttering/jobsUtil ./style/StyleDefinition ../webgl/RenderableTile ../webgl/TileReshuffleManager ../../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w{constructor(){this._renderParams={reshuffleManager:new d.TileReshuffleManager,context:null,drawPhase:1,state:new v,stationary:!0,pixelRatio:1,displayLevel:-1,requiredLevel:-1,globalOpacity:1,renderPass:"background",styleLayer:null,styleLayerUID:-1,painter:null,glyphMosaic:null,spriteMosaic:null,profiler:null,renderingOptions:null,requestRender:null,allowDelayedRender:!1,deltaTime:-1,timeline:null,time:0,hasClipping:!1,blendMode:null,dataUploadCounter:0,
effects:null,inFadeTransition:!1,requireFBO:!1,highlightGradient:null,stencilSymbols:!0,is3D:!0,backgroundColor:null};this._backgroundTile=new g.RenderableTile(new k(0,0,0,0),0,0,0,512,512,4096,4096);this._heading=0;this._declutteredForHeading=new WeakMap}dispose(){this._renderParams=null}renderBackground(m,r,n,u,x,y,z,A,B,C){const D=this._backgroundTile;this._updateRenderParameters(m,r,D,n,x,y,z,A,B,C);this._renderParams.stencilSymbols=!1;n.drawBackground(this._renderParams,D,u)}renderContent(m,
r,n,u,x,y,z,A,B,C,D,F){this._declutter(n);u.forAll(N=>this._declutter(N.sourceLayerInfo.data));this._stencilSymbols(m,r,n,u,x,y,z,Math.round(1/A),B,C,D,F);let H=1;n.stencilRef=H++;m.setStencilFunction(t.CompareFunction.EQUAL,n.stencilRef,255);this._render(m,r,n,x,y,z,A,B,C,D,F);u.forAll(N=>{N.sourceLayerInfo.data.stencilRef=H++;this._renderSymbols(m,N.sourceLod,N.sourceLayerInfo.data,x,y,z,Math.round(1/A),N.offset,C,D,F)})}_stencilSymbols(m,r,n,u,x,y,z,A,B,C,D,F){let H=1;n.stencilRef=H++;m.setDepthTestEnabled(!1);
m.setDepthWriteEnabled(!1);m.setStencilTestEnabled(!0);m.setBlendingEnabled(!1);m.setColorMask(!1,!1,!1,!1);m.setStencilOp(t.StencilOperation.KEEP,t.StencilOperation.KEEP,t.StencilOperation.REPLACE);m.setStencilWriteMask(255);m.setStencilFunction(t.CompareFunction.ALWAYS,n.stencilRef,255);this._stencilTileSymbols(m,r,n,x,y,z,A,B,C,D,F);for(const N of u.toArray()){const {sourceLod:E,offset:G,sourceLayerInfo:I}=N;I.data.stencilRef=H++;m.setStencilFunction(t.CompareFunction.ALWAYS,I.data.stencilRef,
255);this._stencilTileSymbols(m,E,I.data,x,y,z,A,G,C,D,F)}m.setStencilWriteMask(0);m.setBlendingEnabled(!0);m.setDepthTestEnabled(!0);m.setColorMask(!0,!0,!0,!0)}_renderSymbols(m,r,n,u,x,y,z,A,B,C,D){m.setStencilFunction(t.CompareFunction.EQUAL,n.stencilRef,255);this._render(m,r,n,u,x,y,z,A,B,C,D,e.StyleLayerType.SYMBOL)}_render(m,r,n,u,x,y,z,A,B,C,D,F){this._updateRenderParameters(m,r,n,u,y,z,A,B,C,D);this._renderParams.stencilSymbols=!1;u.drawTile(this._renderParams,n,x,F)}_stencilTileSymbols(m,
r,n,u,x,y,z,A,B,C,D){this._updateRenderParameters(m,r,n,u,y,z,A,B,C,D);this._renderParams.stencilSymbols=!0;n.triangleCount=0;u.drawSymbols(this._renderParams,n,x)}_updateRenderParameters(m,r,n,u,x,y,z,A,B,C){"type"in n&&"vector-tile"===n.type&&!n.stage&&n.attachWithContext(m);const D=r[0]-x.getLevelShift(r[0]),F=this._renderParams;F.context=m;F.painter=u;F.glyphMosaic=u.glyphMosaic;F.spriteMosaic=u.spriteMosaic;F.pixelRatio=B*C;F.displayLevel=D;F.requiredLevel=D;m=x.getScale(r[0]);const [H,N]=x.getOffset(r,
y*m);r=.125*y*m/A;n=n.transforms.displayViewScreenMat3;n[0]=r;n[4]=-r;n[6]=-1-H-z[0]*y*2;n[7]=1+N+(1-z[1])*y*2-2;y=F.state;A/=C;y.size[0]=A;y.size[1]=A;y.pixelRatio=C;y.rotation=(360-this._heading)%360;C=2/A;b.set(y.displayViewMat3,C,0,0,0,-C,0,-1,1,1);C=b.identity(y.displayMat3);z=l.toRadian(this._heading);b.translate(C,C,[A/2,A/2]);b.rotate(C,C,z);b.translate(C,C,[-A/2,-A/2]);b.multiply(C,y.displayViewMat3,C)}updateHeading(m){this._heading=m}_declutter(m){this._declutteredForHeading.get(m)!==this._heading&&
(c.declutterSingleTile(m,(360-this._heading)%360),this._declutteredForHeading.set(m,this._heading))}}class v{constructor(){this.size=[0,0];this.pixelRatio=1;this.rotation=0;this.displayMat3=q.create();this.displayViewMat3=q.create();this.viewMat3=this.viewMat2d=this.inverseTransform=this.transform=null;this.id=0;this.center=this.extent=null;this.scale=1;this.worldScreenWidth=this.resolution=0;this.toJSON=this.copy=this.clone=this.toScreen=this.toMap=this.getScreenTransform=this.viewpoint=this.spatialReference=
null}}a.VectorTileRendererHelper3D=w;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/decluttering/jobsUtil":function(){define("exports ../../../../../core/libs/gl-matrix-2/math/mat3 ../../../../../core/libs/gl-matrix-2/factories/mat3f32 ../../../../../core/libs/gl-matrix-2/math/common ./core ./jobs ./SymbolDeclutterer ./SymbolRepository ./util ../style/StyleDefinition".split(" "),function(a,b,q,l,p,k,h,f,c,e){const g=q.create();a.declutterSingleTile=
function(d,t){const w=d.transforms.tileUnitsToPixels;var v=l.toRadian(t);const m=Math.ceil(512*(Math.abs(Math.sin(v))+Math.abs(Math.cos(v))));b.identity(g);b.translate(g,g,[m/2,m/2]);b.rotate(g,g,v);b.translate(g,g,[-256,-256]);b.scale(g,g,[.125,.125,1]);d.transforms.tileUnitsToPixels=g;v=[];const r=new f.SymbolRepository(4096,v,()=>new p.VTLUniqueSymbol),n=new h.SymbolDeclutterer(v,r,(u,x,y)=>new k.CollisionJob(u,x,y,d.styleRepository,d.key.level,t),(u,x)=>{c.writeOpacityToBuffers(u,x,!1)},()=>0,
u=>(u=d.styleRepository.getStyleLayerByUID(u).getLayoutProperty("visibility"))&&u.getValue()===e.Visibility.NONE?!1:!0);v.push(d);r.add(d);n.setScreenSize(m,m);n.continue(Infinity);r.removeTile(d);d.transforms.tileUnitsToPixels=w};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/decluttering/jobs":function(){define(["exports","../../../../../core/libs/gl-matrix-2/factories/mat3f32","./config","./util","../style/StyleDefinition"],function(a,b,q,l,p){class k{constructor(h,
f,c,e,g,d){this._symbols=h;this._styleRepository=e;this._zoom=g;this._currentSymbolCursor=this._currentLayerCursor=0;this._styleProps=new Map;this._allNeededMatrices=new Map;this._gridIndex=new l.GridIndex(f,c,q.collisionGridCellSize);this._si=Math.sin(Math.PI*d/180);this._co=Math.cos(Math.PI*d/180);for(const t of h)for(const w of t.symbols)this._allNeededMatrices.has(w.tile)||this._allNeededMatrices.set(w.tile,b.clone(w.tile.transforms.tileUnitsToPixels))}work(h){const f=this._gridIndex,c=performance.now();
for(;this._currentLayerCursor<this._symbols.length;this._currentLayerCursor++,this._currentSymbolCursor=0){const x=this._symbols[this._currentLayerCursor],y=this._getProperties(x.styleLayerUID);for(;this._currentSymbolCursor<x.symbols.length;this._currentSymbolCursor++){if(99===this._currentSymbolCursor%100&&performance.now()-c>h)return!1;var e=x.symbols[this._currentSymbolCursor];if(!e.unique.show)continue;var g=e,d=this._si,t=this._co,w=this._allNeededMatrices.get(e.tile),v=this._zoom;const {iconRotationAlignment:z,
textRotationAlignment:A,iconTranslate:B,iconTranslateAnchor:C,textTranslate:D,textTranslateAnchor:F}=y;var m=0;for(const I of g.colliders){const [O,L]=0===I.partIndex?B:D;var r=0===I.partIndex?C:F,n=I.minLod<=v&&v<=I.maxLod;m+=n?0:1;I.enabled=n;I.xScreen=I.xTile*w[0]+I.yTile*w[3]+w[6];I.yScreen=I.xTile*w[1]+I.yTile*w[4]+w[7];r===p.TranslateAnchor.MAP?(I.xScreen+=t*O-d*L,I.yScreen+=d*O+t*L):(I.xScreen+=O,I.yScreen+=L);p.RotationAlignment.VIEWPORT===(0===I.partIndex?z:A)?(I.dxScreen=I.dxPixels,I.dyScreen=
I.dyPixels):(I.dxScreen=t*(I.dxPixels+I.width/2)-d*(I.dyPixels+I.height/2)-I.width/2,I.dyScreen=d*(I.dxPixels+I.width/2)+t*(I.dyPixels+I.height/2)-I.height/2)}0<g.colliders.length&&m===g.colliders.length&&(g.unique.show=!1);g=e.unique;if(!g.show)continue;const {iconAllowOverlap:H,iconIgnorePlacement:N,textAllowOverlap:E,textIgnorePlacement:G}=y;for(const I of e.colliders)if(I.enabled&&(d=g.parts[I.partIndex],d.show)){if(t=!(I.partIndex?E:H))a:{t=I.xScreen+I.dxScreen;w=I.yScreen+I.dyScreen;v=t+I.width;
m=w+I.height;const [O,L,P,M]=f.getCellSpan(t,w,v,m);for(r=L;r<=M;r++)for(n=O;n<=P;n++){var u=f.cells[r][n];for(const K of u){u=K.xScreen+K.dxScreen;const J=K.yScreen+K.dyScreen,R=u+K.width,Q=J+K.height;if(!(v<u||t>R||m<J||w>Q)){t=!0;break a}}}t=!1}t&&(I.hard?g.show=!1:d.show=!1)}if(g.show)for(const I of e.colliders){if(!I.enabled)continue;if(I.partIndex?G:N)continue;if(!g.parts[I.partIndex].show)continue;e=I.xScreen+I.dxScreen;d=I.yScreen+I.dyScreen;const [O,L,P,M]=this._gridIndex.getCellSpan(e,d,
e+I.width,d+I.height);for(e=L;e<=M;e++)for(d=O;d<=P;d++)this._gridIndex.cells[e][d].push(I)}}}return!0}_getProperties(h){var f=this._styleProps.get(h);if(f)return f;f=this._zoom;const c=this._styleRepository.getStyleLayerByUID(h);var e=c.getLayoutValue("symbol-placement",f)!==p.SymbolPlacement.POINT;let g=c.getLayoutValue("icon-rotation-alignment",f);g===p.RotationAlignment.AUTO&&(g=e?p.RotationAlignment.MAP:p.RotationAlignment.VIEWPORT);let d=c.getLayoutValue("text-rotation-alignment",f);d===p.RotationAlignment.AUTO&&
(d=e?p.RotationAlignment.MAP:p.RotationAlignment.VIEWPORT);e=c.getPaintValue("icon-translate",f);const t=c.getPaintValue("icon-translate-anchor",f),w=c.getPaintValue("text-translate",f),v=c.getPaintValue("text-translate-anchor",f);f={iconAllowOverlap:c.getLayoutValue("icon-allow-overlap",f),iconIgnorePlacement:c.getLayoutValue("icon-ignore-placement",f),textAllowOverlap:c.getLayoutValue("text-allow-overlap",f),textIgnorePlacement:c.getLayoutValue("text-ignore-placement",f),iconRotationAlignment:g,
textRotationAlignment:d,iconTranslateAnchor:t,iconTranslate:e,textTranslateAnchor:v,textTranslate:w};this._styleProps.set(h,f);return f}}a.CollisionJob=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/style/StyleDefinition":function(){define(["exports","../../../../../symbols/cim/enums"],function(a,b){a.StyleLayerType=void 0;(function(l){l[l.BACKGROUND=0]="BACKGROUND";l[l.FILL=1]="FILL";l[l.LINE=2]="LINE";l[l.SYMBOL=3]="SYMBOL";l[l.CIRCLE=4]="CIRCLE"})(a.StyleLayerType||
(a.StyleLayerType={}));a.Visibility=void 0;(function(l){l[l.VISIBLE=0]="VISIBLE";l[l.NONE=1]="NONE"})(a.Visibility||(a.Visibility={}));a.SymbolPlacement=void 0;(function(l){l[l.POINT=0]="POINT";l[l.LINE=1]="LINE";l[l.LINE_CENTER=2]="LINE_CENTER"})(a.SymbolPlacement||(a.SymbolPlacement={}));a.RotationAlignment=void 0;(function(l){l[l.MAP=0]="MAP";l[l.VIEWPORT=1]="VIEWPORT";l[l.AUTO=2]="AUTO"})(a.RotationAlignment||(a.RotationAlignment={}));a.TextJustification=void 0;(function(l){l[l.AUTO=0]="AUTO";
l[l.LEFT=1]="LEFT";l[l.CENTER=2]="CENTER";l[l.RIGHT=3]="RIGHT"})(a.TextJustification||(a.TextJustification={}));a.SymbolAnchor=void 0;(function(l){l[l.CENTER=0]="CENTER";l[l.LEFT=1]="LEFT";l[l.RIGHT=2]="RIGHT";l[l.TOP=3]="TOP";l[l.BOTTOM=4]="BOTTOM";l[l.TOP_LEFT=5]="TOP_LEFT";l[l.TOP_RIGHT=6]="TOP_RIGHT";l[l.BOTTOM_LEFT=7]="BOTTOM_LEFT";l[l.BOTTOM_RIGHT=8]="BOTTOM_RIGHT"})(a.SymbolAnchor||(a.SymbolAnchor={}));a.TextTransform=void 0;(function(l){l[l.NONE=0]="NONE";l[l.UPPERCASE=1]="UPPERCASE";l[l.LOWERCASE=
2]="LOWERCASE"})(a.TextTransform||(a.TextTransform={}));a.TranslateAnchor=void 0;(function(l){l[l.MAP=0]="MAP";l[l.VIEWPORT=1]="VIEWPORT"})(a.TranslateAnchor||(a.TranslateAnchor={}));a.TextWritingMode=void 0;(function(l){l[l.HORIZONTAL=0]="HORIZONTAL";l[l.VERTICAL=1]="VERTICAL"})(a.TextWritingMode||(a.TextWritingMode={}));class q{}q.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.Visibility.VISIBLE}};q.fillLayoutDefinition={visibility:{type:"enum",values:["visible",
"none"],default:a.Visibility.VISIBLE}};q.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.Visibility.VISIBLE},"line-cap":{type:"enum",values:["butt","round","square"],default:b.CapType.BUTT},"line-join":{type:"enum",values:["bevel","round","miter"],default:b.JoinType.MITER},"line-miter-limit":{type:"number",default:2},"line-round-limit":{type:"number",default:1.05}};q.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.Visibility.VISIBLE},
"symbol-avoid-edges":{type:"boolean",default:!1},"symbol-placement":{type:"enum",values:["point","line","line-center"],default:a.SymbolPlacement.POINT},"symbol-sort-key":{type:"number",default:-1},"symbol-spacing":{type:"number",minimum:1,default:250},"icon-allow-overlap":{type:"boolean",default:!1},"icon-anchor":{type:"enum",values:"center left right top bottom top-left top-right bottom-left bottom-right".split(" "),default:a.SymbolAnchor.CENTER},"icon-ignore-placement":{type:"boolean",default:!1},
"icon-image":{type:"string"},"icon-keep-upright":{type:"boolean",default:!1},"icon-offset":{type:"array",value:"number",length:2,default:[0,0]},"icon-optional":{type:"boolean",default:!1},"icon-padding":{type:"number",minimum:0,default:2},"icon-rotate":{type:"number",default:0},"icon-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:a.RotationAlignment.AUTO},"icon-size":{type:"number",minimum:0,default:1},"text-allow-overlap":{type:"boolean",default:!1},"text-anchor":{type:"enum",
values:"center left right top bottom top-left top-right bottom-left bottom-right".split(" "),default:a.SymbolAnchor.CENTER},"text-field":{type:"string"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"]},"text-ignore-placement":{type:"boolean",default:!1},"text-justify":{type:"enum",values:["auto","left","center","right"],default:a.TextJustification.CENTER},"text-keep-upright":{type:"boolean",default:!0},"text-letter-spacing":{type:"number",default:0},
"text-line-height":{type:"number",default:1.2},"text-max-angle":{type:"number",minimum:0,default:45},"text-max-width":{type:"number",minimum:0,default:10},"text-offset":{type:"array",value:"number",length:2,default:[0,0]},"text-optional":{type:"boolean",default:!1},"text-padding":{type:"number",minimum:0,default:2},"text-rotate":{type:"number",default:0},"text-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:a.RotationAlignment.AUTO},"text-size":{type:"number",minimum:0,default:16},
"text-transform":{type:"enum",values:["none","uppercase","lowercase"],default:a.TextTransform.NONE},"text-writing-mode":{type:"array",value:"enum",values:["horizontal","vertical"],default:[a.TextWritingMode.HORIZONTAL]}};q.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.Visibility.VISIBLE}};q.backgroundPaintDefinition={"background-color":{type:"color",default:[0,0,0,1]},"background-opacity":{type:"number",minimum:0,maximum:1,default:1},"background-pattern":{type:"string"}};
q.fillPaintDefinition={"fill-antialias":{type:"boolean",default:!0},"fill-color":{type:"color",default:[0,0,0,1]},"fill-opacity":{type:"number",minimum:0,maximum:1,default:1},"fill-outline-color":{type:"color",default:[0,0,0,0]},"fill-pattern":{type:"string"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0]},"fill-translate-anchor":{type:"enum",values:["map","viewport"],default:a.TranslateAnchor.MAP}};q.linePaintDefinition={"line-blur":{type:"number",minimum:0,default:0},"line-color":{type:"color",
default:[0,0,0,1]},"line-dasharray":{type:"array",value:"number",default:[]},"line-gap-width":{type:"number",minimum:0,default:0},"line-offset":{type:"number",default:0},"line-opacity":{type:"number",minimum:0,maximum:1,default:1},"line-pattern":{type:"string"},"line-translate":{type:"array",value:"number",length:2,default:[0,0]},"line-translate-anchor":{type:"enum",values:["map","viewport"],default:a.TranslateAnchor.MAP},"line-width":{type:"number",minimum:0,default:1}};q.symbolPaintDefinition={"icon-color":{type:"color",
default:[0,0,0,1]},"icon-halo-blur":{type:"number",minimum:0,default:0},"icon-halo-color":{type:"color",default:[0,0,0,0]},"icon-halo-width":{type:"number",minimum:0,default:0},"icon-opacity":{type:"number",minimum:0,maximum:1,default:1},"icon-translate":{type:"array",value:"number",length:2,default:[0,0]},"icon-translate-anchor":{type:"enum",values:["map","viewport"],default:a.TranslateAnchor.MAP},"text-color":{type:"color",default:[0,0,0,1]},"text-halo-blur":{type:"number",minimum:0,default:0},
"text-halo-color":{type:"color",default:[0,0,0,0]},"text-halo-width":{type:"number",minimum:0,default:0},"text-opacity":{type:"number",minimum:0,maximum:1,default:1},"text-translate":{type:"array",value:"number",length:2,default:[0,0]},"text-translate-anchor":{type:"enum",values:["map","viewport"],default:a.TranslateAnchor.MAP}};q.rasterPaintDefinition={"raster-opacity":{type:"number",minimum:0,maximum:1,default:1},"raster-hue-rotate":{type:"number",default:0},"raster-brightness-min":{type:"number",
minimum:0,maximum:1,default:0},"raster-brightness-max":{type:"number",minimum:0,maximum:1,default:1},"raster-saturation":{type:"number",minimum:-1,maximum:1,default:0},"raster-contrast":{type:"number",minimum:-1,maximum:1,default:0},"raster-fade-duration":{type:"number",minimum:0,default:300}};q.circlePaintDefinition={"circle-blur":{type:"number",minimum:0,default:0},"circle-color":{type:"color",default:[0,0,0,1]},"circle-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-radius":{type:"number",
minimum:0,default:5},"circle-stroke-color":{type:"color",default:[0,0,0,1]},"circle-stroke-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-stroke-width":{type:"number",minimum:0,default:0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0]},"circle-translate-anchor":{type:"enum",values:["map","viewport"],default:a.TranslateAnchor.MAP}};a.StyleDefinition=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer":function(){define(["exports",
"./config"],function(a,b){function q(p,k){if(p.priority-k.priority)return p.priority-k.priority;const h=p.tile.key,f=k.tile.key;return h.world-f.world?h.world-f.world:h.level-f.level?h.level-f.level:h.row-f.row?h.row-f.row:h.col-f.col?h.col-f.col:p.xTile-k.xTile?p.xTile-k.xTile:p.yTile-k.yTile}class l{get running(){return this._running}constructor(p,k,h,f,c,e){this._visibleTiles=p;this._symbolRepository=k;this._createCollisionJob=h;this._assignTileSymbolsOpacity=f;this._symbolLayerSorter=c;this._isLayerVisible=
e;this._selectionJob=null;this._selectionJobCompleted=!1;this._collisionJob=null;this._collisionJobCompleted=!1;this._opacityJob=null;this._opacityJobCompleted=!1;this._running=!0}setScreenSize(p,k){this._screenWidth===p&&this._screenHeight===k||this.restart();this._screenWidth=p;this._screenHeight=k}restart(){this._selectionJob=null;this._selectionJobCompleted=!1;this._collisionJob=null;this._collisionJobCompleted=!1;this._opacityJob=null;this._opacityJobCompleted=!1;this._running=!0}continue(p){this._selectionJob||
(this._selectionJob=this._createSelectionJob());if(!this._selectionJobCompleted){var k=performance.now();if(!this._selectionJob.work(p))return!1;this._selectionJobCompleted=!0;p=Math.max(0,p-(performance.now()-k));if(0===p)return!1}this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight));if(!this._collisionJobCompleted){k=performance.now();if(!this._collisionJob.work(p))return!1;this._collisionJobCompleted=!0;p=Math.max(0,
p-(performance.now()-k));if(0===p)return!1}this._opacityJob||(this._opacityJob=this._createOpacityJob());if(!this._opacityJobCompleted){k=performance.now();if(!this._opacityJob.work(p))return!1;this._opacityJobCompleted=!0;p=Math.max(0,p-(performance.now()-k));if(0===p)return!1}this._running=!1;return!0}_createSelectionJob(){const p=this._symbolRepository.uniqueSymbols;for(let g=0;g<p.length;g++){const d=p[g];for(let t=0;t<d.uniqueSymbols.length;t++){const w=d.uniqueSymbols[t];for(const v of w.tileSymbols)v.selectedForRendering=
!1}}const k=[];let h=0,f=0;const c=this._isLayerVisible,e=this._symbolLayerSorter;return{work:function(g){const d=performance.now();for(;f<p.length;f++,h=0){const w=p[f];var t=w.styleLayerUID;if(!c(t)){k[f]||(k[f]={styleLayerUID:t,symbols:[]});continue}k[f]=k[f]||{styleLayerUID:t,symbols:[]};const v=k[f];for(;h<w.uniqueSymbols.length;h++){t=w.uniqueSymbols[h];if(99===h%100&&performance.now()-d>g)return!1;let m=null,r=!1,n=!1;for(const u of t.tileSymbols)if(!n||!r){const x=u.tile;if(!m||x.isCoverage||
x.neededForCoverage&&!r){m=u;if(x.neededForCoverage||x.isCoverage)n=!0;x.isCoverage&&(r=!0)}}m.selectedForRendering=!0;if(n){v.symbols.push(m);t.show=!0;for(const u of t.parts)u.show=!0}else t.show=!1}}for(const w of k)w.symbols.sort(q);return!0},get sortedSymbols(){return k.sort(e)}}}_createOpacityJob(){function p(c,e){var g=c.symbols;for(const [,t]of g){var d=t;g=e;for(const w of d){d=w.unique;for(const v of d.parts)v.startOpacity+=(g-v.startTime)/b.fadeDuration*(.5<v.targetOpacity?1:-1),v.startOpacity=
Math.min(Math.max(v.startOpacity,0),1),v.startTime=g,v.targetOpacity=d.show&&v.show?1:0}}k(c,e);for(const t of c.childrenTiles)p(t,e)}const k=this._assignTileSymbolsOpacity,h=this._visibleTiles;let f=0;return{work(c){const e=performance.now();for(;f<h.length;f++){if(performance.now()-e>c)return!1;const g=h[f];if(null!=g.parentTile)continue;const d=performance.now();p(g,d)}return!0}}}}a.SymbolDeclutterer=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/decluttering/SymbolRepository":function(){define(["exports",
"./util"],function(a,b){class q{constructor(l,p,k){this.tileCoordRange=l;this._visibleTiles=p;this._createUnique=k;this._tiles=new Map;this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){null==this._uniqueSymbolLayerArray&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray());return this._uniqueSymbolLayerArray}get uniqueSymbolsReferences(){return this._uniqueSymbolsReferences}add(l,p){this._uniqueSymbolLayerArray=null;let k=this._tiles.get(l.id);k||(k={symbols:new Map},this._tiles.set(l.id,
k));var h=new Map;if(p)for(var f of p)k.symbols.has(f)&&(h.set(f,k.symbols.get(f)),k.symbols.delete(f));else for(var [c]of l.layerData)k.symbols.has(c)&&(h.set(c,k.symbols.get(c)),k.symbols.delete(c));this._removeSymbols(h);p=l.symbols;h=new Map;for(const [e,g]of p)if(f=g.length,32<=f){c=this.tileCoordRange;do c/=2,f/=4;while(8<f&&64<c);f=new b.GridIndex(this.tileCoordRange,this.tileCoordRange,c);h.set(e,{flat:g,index:f});k.symbols.set(e,{flat:g,index:f});for(const d of g)f.getCell(d.xTile,d.yTile).push(d)}else h.set(e,
{flat:g}),k.symbols.set(e,{flat:g});this._addSymbols(l.key,p)}deleteStyleLayers(l){this._uniqueSymbolLayerArray=null;for(const [p,k]of this._tiles){const h=new Map;for(const f of l)k.symbols.has(f)&&(h.set(f,k.symbols.get(f)),k.symbols.delete(f));this._removeSymbols(h);0===k.symbols.size&&this._tiles.delete(p)}}removeTile(l){this._uniqueSymbolLayerArray=null;const p=this._tiles.get(l.id);if(p){var k=new Map;for(const [h]of l.symbols)p.symbols.has(h)&&(k.set(h,p.symbols.get(h)),p.symbols.delete(h));
this._removeSymbols(k);0===p.symbols.size&&this._tiles.delete(l.id)}}querySymbols(l,p,k,h){h=[];var f=this.uniqueSymbols;for(const e of f){f=e.styleLayerUID;var c=e.uniqueSymbols;for(const g of c)(c=g.tileSymbols.find(d=>d.selectedForRendering))&&b.isSearchCircleOverlapingSymbol(c,l,p*(window.devicePixelRatio||1),k)&&h.push({vtlSymbol:c,styleLayerUID:f,tileKey:c.tile.key})}return h}_removeSymbols(l){for(const [k,{flat:h}]of l)for(const f of h){l=f.unique;var p=l.tileSymbols;const c=p.length-1;for(let e=
0;e<c;e++)if(p[e]===f){p[e]=p[c];break}p.length=c;0===c&&(p=this._uniqueSymbolsReferences.get(k),p.delete(l),0===p.size&&this._uniqueSymbolsReferences.delete(k));f.unique=null}}_addSymbols(l,p){if(0!==p.size){var k=this._visibleTiles;for(const h of k)h.parentTile||h.key.world!==l.world||h.key.level===l.level&&!h.key.equals(l)||this._matchSymbols(h,l,p);for(const [h,f]of p)for(const c of f)null==c.unique&&(l=this._createUnique(),c.unique=l,l.tileSymbols.push(c),p=this._uniqueSymbolsReferences.get(h),
p||(p=new Set,this._uniqueSymbolsReferences.set(h,p)),p.add(l))}}_matchSymbols(l,p,k){if(l.key.level>p.level){var h=l.key.level-p.level;if(l.key.row>>h!==p.row||l.key.col>>h!==p.col)return}if(p.level>l.key.level&&(h=p.level-l.key.level,p.row>>h!==l.key.row||p.col>>h!==l.key.col))return;if(p.equals(l.key))for(var f of l.childrenTiles)this._matchSymbols(f,p,k);else{f=new Map;for(const [g,d]of k){var c=[];for(const w of d)k=b.tileCoordChange(this.tileCoordRange,w.xTile,p.level,p.col,l.key.level,l.key.col),
h=b.tileCoordChange(this.tileCoordRange,w.yTile,p.level,p.row,l.key.level,l.key.row),0<=k&&k<this.tileCoordRange&&0<=h&&h<this.tileCoordRange&&c.push({symbol:w,xTransformed:k,yTransformed:h});k=[];h=(l.key.level<p.level?1:1<<l.key.level-p.level)+20;const t=this._tiles.get(l.id).symbols.get(g);if(t){const w=t.flat;for(const v of c){var e=!1;let m;const r=v.xTransformed,n=v.yTransformed;m=null!=t.index?t.index.getCell(r,n):w;c=v.symbol;const u=c.hash;for(const x of m)if(u===x.hash&&Math.abs(r-x.xTile)<=
h&&Math.abs(n-x.yTile)<=h){e=x.unique;c.unique=e;e.tileSymbols.push(c);e=!0;break}e||k.push(c)}}0<k.length&&f.set(g,k)}for(const g of l.childrenTiles)this._matchSymbols(g,p,f)}}_createUniqueSymbolLayerArray(){var l=this._uniqueSymbolsReferences;const p=Array(l.size);let k=0;for(const [h,f]of l){const c=Array(f.size);l=0;for(const e of f)c[l++]=e;p[k]={styleLayerUID:h,uniqueSymbols:c};k++}return p}}a.SymbolRepository=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/RenderableTile":function(){define(["exports",
"../../../../core/libs/gl-matrix-2/factories/mat3f32","./TiledDisplayObject"],function(a,b,q){class l extends q.TiledDisplayObject{_createTransforms(){return{displayViewScreenMat3:b.create(),tileMat3:b.create()}}}a.RenderableTile=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/TileReshuffleManager":function(){define(["exports"],function(a){class b{constructor(){this._candidateTiles=[]}schedule(q){this._candidateTiles.includes(q)||this._candidateTiles.push(q)}reshuffle(q){const l=
[];for(const p of this._candidateTiles)0<q?(p.reshuffle(),q--):l.push(p);this._candidateTiles=l}}a.TileReshuffleManager=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/RasterColorizerTechnique":function(){define("require exports ../../../chunks/tslib.es6 ../../2d/engine/imagery/enums ./TileBlendTechniqueConfiguration ../../../chunks/RasterColorizer.glsl ../webgl-engine/core/shaderTechnique/ReloadableShaderModule ../webgl-engine/core/shaderTechnique/ShaderTechnique ../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/Program ../../webgl/enums ../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w extends f.ShaderTechnique{initializeProgram(m){return new g.Program(m.rctx,w.shader.get().build(this.configuration),e.Default3D)}initializePipeline(){return t.makePipelineState({blending:t.simpleBlendingParams(d.BlendFactor.ONE,d.BlendFactor.ONE_MINUS_SRC_ALPHA),colorWrite:t.defaultColorWriteParams})}}w.shader=new h.ReloadableShaderModule(k.RasterColorizer,()=>new Promise((m,r)=>a(["../webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl"],m,r)));
class v extends p.TileBlendTechniqueConfiguration{constructor(){super(...arguments);this.colorizerType=l.RasterColorizerType.Stretch;this.stretchType=l.RasterColorizerStretchType.Noop;this.applyColormap=!0;this.requireBilinearWithNN=!1}}q.__decorate([c.parameter({count:l.RasterColorizerType.COUNT})],v.prototype,"colorizerType",void 0);q.__decorate([c.parameter({count:l.RasterColorizerStretchType.COUNT})],v.prototype,"stretchType",void 0);q.__decorate([c.parameter()],v.prototype,"applyColormap",void 0);
q.__decorate([c.parameter()],v.prototype,"requireBilinearWithNN",void 0);b.RasterColorizerTechnique=w;b.RasterColorizerTechniqueConfiguration=v;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/RasterColorizer.glsl":function(){define("exports ../core/libs/gl-matrix-2/factories/vec3f64 ../views/2d/engine/imagery/enums ../views/3d/webgl-engine/core/shaderLibrary/raster/Colormap.glsl ../views/3d/webgl-engine/core/shaderLibrary/raster/Common.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl ../views/3d/webgl-engine/core/shaderModules/BooleanPassUniform ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/FloatsPassUniform ../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(B){const C=new v.ShaderBuilder;C.include(h.TileComposite);C.include(p.Common,B);C.include(l.Colormap,B);C.include(k.TileBackground,B);C.fragment.code.add(w.glsl`vec4 applyBackgroundBlend(vec4 layerColor) {
return blendLayers(vuv, layerColor, u_opacity);
}`);B.colorizerType===q.RasterColorizerType.Stretch?n(C,B):B.colorizerType===q.RasterColorizerType.Lut?C.fragment.code.add(w.glsl`void main() {
vec2 pixelLocation = getPixelLocation(uv);
if (isOutside(pixelLocation)) {
fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0));
return;
}
vec4 currentPixel = getPixel(pixelLocation);
fragColor = applyBackgroundBlend(colormap(currentPixel, true));
}`):B.colorizerType===q.RasterColorizerType.Hillshade&&u(C,B);return C}function n(B,C){B.fragment.uniforms.add(new t.IntegerPassUniform("u_bandCount",F=>F.symbolizer.u_bandCount),new d.FloatsPassUniform("u_minCutOff",F=>F.symbolizer.u_minCutOff,3),new d.FloatsPassUniform("u_maxCutOff",F=>F.symbolizer.u_maxCutOff,3),new d.FloatsPassUniform("u_factor",F=>F.symbolizer.u_factor,3),new g.FloatPassUniform("u_minOutput",F=>F.symbolizer.u_minOutput),new g.FloatPassUniform("u_maxOutput",F=>F.symbolizer.u_maxOutput),
new c.BooleanPassUniform("u_useGamma",F=>F.symbolizer.u_useGamma),new d.FloatsPassUniform("u_gamma",F=>F.symbolizer.u_gamma,3),new d.FloatsPassUniform("u_gammaCorrection",F=>F.symbolizer.u_gammaCorrection,3),new g.FloatPassUniform("u_opacity",F=>F.common.u_opacity));B.fragment.code.add(w.glsl`float stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, bool useGamma, float gamma, float gammaCorrection) {
if (val >= maxCutOff) {
return maxOutput;
} else if (val <= minCutOff) {
return minOutput;
}
float stretchedVal;
if (useGamma) {
float tempf = 1.0;
float outRange = maxOutput - minOutput;
float relativeVal = (val - minCutOff) / (maxCutOff - minCutOff);
if (gamma > 1.0) {
tempf -= pow(1.0 / outRange, relativeVal * gammaCorrection);
}
stretchedVal = (tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput) / 255.0;
} else {
stretchedVal = minOutput + (val - minCutOff) * factor;
}
return stretchedVal;
}`);const D=C.applyColormap?w.glsl`fragColor = applyBackgroundBlend(colormap(vec4(grayVal, grayVal, grayVal, currentPixel.a), !u_useGamma));`:w.glsl`fragColor = applyBackgroundBlend(vec4(grayVal, grayVal, grayVal, currentPixel.a));`;B.fragment.code.add(w.glsl`
void main() {
vec2 pixelLocation = getPixelLocation(uv);
if (isOutside(pixelLocation)) {
fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0));
return;
}
vec4 currentPixel = getPixel(pixelLocation);
${C.stretchType===q.RasterColorizerStretchType.Noop?w.glsl`
fragColor = applyBackgroundBlend(currentPixel);`:w.glsl`
if (currentPixel.a == 0.0) {
fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0));
return;
}
if (u_bandCount == 1) {
float grayVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]);
${D}
} else {
float redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]);
float greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_useGamma, u_gamma[1], u_gammaCorrection[1]);
float blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_useGamma, u_gamma[2], u_gammaCorrection[2]);
fragColor = applyBackgroundBlend(vec4(redVal, greenVal, blueVal, currentPixel.a));
}`}
}`)}function u(B,C){B=B.fragment;B.uniforms.add(new m.Texture2DPassUniform("u_image",D=>D.u_image),new t.IntegerPassUniform("u_hillshadeType",D=>D.symbolizer.u_hillshadeType),new d.FloatsPassUniform("u_sinZcosAs",D=>D.symbolizer.u_sinZcosAs,6),new d.FloatsPassUniform("u_sinZsinAs",D=>D.symbolizer.u_sinZsinAs,6),new d.FloatsPassUniform("u_cosZs",D=>D.symbolizer.u_cosZs,6),new d.FloatsPassUniform("u_weights",D=>D.symbolizer.u_weights,6),new e.Float2PassUniform("u_factor",D=>D.symbolizer.u_factor),
new g.FloatPassUniform("u_minValue",D=>D.symbolizer.u_minValue),new g.FloatPassUniform("u_maxValue",D=>D.symbolizer.u_maxValue),new e.Float2PassUniform("u_srcImageSize",D=>D.common.u_srcImageSize));B.include(f.ColorConversion);B.code.add(w.glsl`vec4 overlay(float val, float minValue, float maxValue, float hillshade, float alpha) {
val = clamp((val - minValue) / (maxValue - minValue), 0.0, 1.0);
vec4 color = colormap(vec4(val, val, val, 1.0), false);
vec3 hsv = rgb2hsv(color.rgb);
hsv.z = hillshade;
return vec4(hsv2rgb(hsv), 1.0) * alpha * color.a;
}`);B.code.add(w.glsl`float getNeighborHoodAlpha(float a, float b, float c, float d, float e, float f, float g, float h, float i){
if (a == 0.0 || a == 0.0 || a==0.0 || a == 0.0 || a == 0.0 || a==0.0 || a == 0.0 || a == 0.0 || a==0.0) {
return 0.0;
} else {
return e;
}
}`);C=C.applyColormap?w.glsl`fragColor = applyBackgroundBlend(overlay(ve.r, u_minValue, u_maxValue, hillshade, alpha));`:w.glsl`hillshade *= alpha;
fragColor = applyBackgroundBlend(vec4(hillshade, hillshade, hillshade, alpha));`;B.code.add(w.glsl`
void main() {
vec2 pixelLocation = getPixelLocation(uv);
if (isOutside(pixelLocation)) {
fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0));
return;
}
vec4 currentPixel = getPixel(pixelLocation);
if (currentPixel.a == 0.0) {
fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0));
return;
}
//mirror edge pixels
vec2 axy = vec2(-1.0, -1.0);
vec2 bxy = vec2(0.0, -1.0);
vec2 cxy = vec2(1.0, -1.0);
vec2 dxy = vec2(-1.0, 0.0);
vec2 fxy = vec2(1.0, 0.0);
vec2 gxy = vec2(-1.0, 1.0);
vec2 hxy = vec2(0.0, 1.0);
vec2 ixy = vec2(1.0, 1.0);
vec2 onePixel = 1.0 / u_srcImageSize;
if (pixelLocation.s < onePixel.s) {
axy[0] = 1.0;
dxy[0] = 1.0;
gxy[0] = 1.0;
}
if (pixelLocation.t < onePixel.t) {
axy[1] = 1.0;
bxy[1] = 1.0;
cxy[1] = 1.0;
}
if (pixelLocation.s > 1.0 - onePixel.s) {
cxy[0] = -1.0;
fxy[0] = -1.0;
ixy[0] = -1.0;
}
if (pixelLocation.t > 1.0 - onePixel.t) {
gxy[1] = -1.0;
hxy[1] = -1.0;
ixy[1] = -1.0;
}
// calculate hillshade
vec4 va = texture(u_image, pixelLocation + onePixel * axy);
vec4 vb = texture(u_image, pixelLocation + onePixel * bxy);
vec4 vc = texture(u_image, pixelLocation + onePixel * cxy);
vec4 vd = texture(u_image, pixelLocation + onePixel * dxy);
vec4 ve = texture(u_image, pixelLocation);
vec4 vf = texture(u_image, pixelLocation + onePixel * fxy);
vec4 vg = texture(u_image, pixelLocation + onePixel * gxy);
vec4 vh = texture(u_image, pixelLocation + onePixel * hxy);
vec4 vi = texture(u_image, pixelLocation + onePixel * ixy);
// calculate the rate of z change along the x, y, and diagonal direction
float dzx = (vc + 2.0 * vf + vi - va - 2.0 * vd - vg).r * u_factor.s;
float dzy = (vg + 2.0 * vh + vi - va - 2.0 * vb - vc).r * u_factor.t;
float dzd = sqrt(1.0 + dzx * dzx + dzy * dzy);
float hillshade = 0.0;
// traditional single light source
if (u_hillshadeType == 0){
float cosDelta = u_sinZsinAs[0] * dzy - u_sinZcosAs[0] * dzx;
float z = (u_cosZs[0] + cosDelta) / dzd;
if (z < 0.0) z = 0.0;
hillshade = z;
} else {
// multi-directional with 6 light sources
for (int k = 0; k < 6; k++) {
float cosDelta = u_sinZsinAs[k] * dzy - u_sinZcosAs[k] * dzx;
float z = (u_cosZs[k] + cosDelta) / dzd;
if (z < 0.0) z = 0.0;
hillshade = hillshade + z * u_weights[k];
if (k == 5) break;
}
}
// set color
float alpha = getNeighborHoodAlpha(va.a, vb.a, vc.a, vd.a, ve.a, vf.a, vg.a, vh.a, vi.a);
alpha *= u_opacity;
${C}
}
`)}class x extends p.CommonPassParameters{constructor(B,C,D,F,H,N){super(B,F,H);this.colormap=C;this.symbolizer=D;this.u_colormap=N;this.backgroundColor=b.ZEROS;this.fboTexture=null;this.baseOpacity=1}}class y extends x{}class z extends x{}const A=Object.freeze(Object.defineProperty({__proto__:null,ColorizerHillshadeUniforms:z,ColorizerStretchUniforms:y,ColorizerUniforms:x,build:r},Symbol.toStringTag,{value:"Module"}));a.ColorizerHillshadeUniforms=z;a.ColorizerStretchUniforms=y;a.ColorizerUniforms=
x;a.RasterColorizer=A;a.build=r})},"esri/views/3d/webgl-engine/core/shaderLibrary/raster/Colormap.glsl":function(){define(["exports","../../shaderModules/FloatPassUniform","../../shaderModules/interfaces","../../shaderModules/Texture2DPassUniform"],function(a,b,q,l){a.Colormap=function(p){p.fragment.uniforms.add(new l.Texture2DPassUniform("u_colormap",k=>k.u_colormap),new b.FloatPassUniform("u_colormapOffset",k=>k.colormap.u_colormapOffset),new b.FloatPassUniform("u_colormapMaxIndex",k=>k.colormap.u_colormapMaxIndex),
new b.FloatPassUniform("u_opacity",k=>k.common.u_opacity));p.fragment.code.add(q.glsl`vec4 colormap(vec4 currentPixel, bool isFloat) {
float colorIndex = isFloat ? currentPixel.r - u_colormapOffset : currentPixel.r * 255.0 - u_colormapOffset;
vec4 result;
if (currentPixel.a == 0.0 || colorIndex > u_colormapMaxIndex) {
result = vec4(0.0, 0.0, 0.0, 0.0);
} else {
vec2 texelCoordinates = vec2((colorIndex + 0.5), 0.5);
result = texelFetch(u_colormap, ivec2(texelCoordinates), 0);
}
return result;
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/raster/Common.glsl":function(){define("exports ./Projection.glsl ../terrain/TileComposite.glsl ../../shaderModules/BooleanPassUniform ../../shaderModules/Float2PassUniform ../../shaderModules/interfaces ../../shaderModules/Texture2DPassUniform".split(" "),function(a,b,q,l,p,k,h){class f extends q.TileCompositePassParameters{constructor(c,e,g){super();this.common=c;this.u_image=e;this.u_transformGrid=
g}}a.Common=function(c,e){c.include(b.Projection);c.fragment.uniforms.add(new h.Texture2DPassUniform("u_image",g=>g.u_image),new l.BooleanPassUniform("u_flipY",g=>g.common.u_flipY),new l.BooleanPassUniform("u_applyTransform",g=>g.common.u_applyTransform));({requireBilinearWithNN:e}=e);e&&c.fragment.uniforms.add(new p.Float2PassUniform("u_srcImageSize",g=>g.common.u_srcImageSize));c.fragment.code.add(k.glsl`vec2 getPixelLocation(vec2 coords) {
vec2 targetLocation = u_flipY ? vec2(coords.s, 1.0 - coords.t) : coords;
if (!u_applyTransform) {
return targetLocation;
}
return projectPixelLocation(targetLocation);
}
bool isOutside(vec2 coords){
if (coords.t>1.00001 ||coords.t<-0.00001 || coords.s>1.00001 ||coords.s<-0.00001) {
return true;
} else {
return false;
}
}`);e?c.fragment.code.add(k.glsl`vec4 sampleBilinear(sampler2D sampler, vec2 coords, vec2 texSize) {
vec2 texelStart = floor(coords * texSize);
vec2 coord0 = texelStart / texSize;
vec2 coord1 = (texelStart + vec2(1.0, 0.0)) / texSize;
vec2 coord2 = (texelStart + vec2(0.0, 1.0)) / texSize;
vec2 coord3 = (texelStart + vec2(1.0, 1.0)) / texSize;
vec4 color0 = texture(sampler, coord0);
vec4 color1 = texture(sampler, coord1);
vec4 color2 = texture(sampler, coord2);
vec4 color3 = texture(sampler, coord3);
vec2 blend = fract(coords * texSize);
vec4 color01 = mix(color0, color1, blend.x);
vec4 color23 = mix(color2, color3, blend.x);
vec4 color = mix(color01, color23, blend.y);
float alpha = floor(color0.a * color1.a * color2.a * color3.a + 0.5);
color = color * alpha + (1.0 - alpha) * texture(sampler, coords);
return color;
}
vec4 getPixel(vec2 pixelLocation) {
return sampleBilinear(u_image, pixelLocation, u_srcImageSize);
}`):c.fragment.code.add(k.glsl`vec4 getPixel(vec2 pixelLocation) {
return texture(u_image, pixelLocation);
}`)};a.CommonPassParameters=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/raster/Projection.glsl":function(){define(["exports","../../shaderModules/Float2PassUniform","../../shaderModules/interfaces","../../shaderModules/Texture2DPassUniform"],function(a,b,q,l){a.Projection=function(p){p.fragment.uniforms.add(new l.Texture2DPassUniform("u_transformGrid",k=>k.u_transformGrid),new b.Float2PassUniform("u_transformSpacing",k=>k.common.u_transformSpacing),
new b.Float2PassUniform("u_targetImageSize",k=>k.common.u_targetImageSize));p.fragment.code.add(q.glsl`vec2 projectPixelLocation(vec2 coords) {
vec2 index_image = floor(coords * u_targetImageSize);
vec2 oneTransformPixel = vec2(4.0, 1.0);
vec2 index_transform = floor(index_image / u_transformSpacing) * oneTransformPixel;
vec2 pos = fract((index_image + 0.5) / u_transformSpacing);
vec2 transform_location = index_transform + 0.5;
vec2 srcLocation;
if (pos.s <= pos.t) {
vec3 ll_abc = texelFetch(u_transformGrid, ivec2(transform_location), 0).rgb;
vec3 ll_def = texelFetch(u_transformGrid, ivec2(transform_location.s + 1.0, transform_location.t), 0).rgb;
srcLocation.s = dot(ll_abc, vec3(pos, 1.0));
srcLocation.t = dot(ll_def, vec3(pos, 1.0));
} else {
vec3 ur_abc = texelFetch(u_transformGrid, ivec2(transform_location.s + 2.0, transform_location.t), 0).rgb;
vec3 ur_def = texelFetch(u_transformGrid, ivec2(transform_location.s + 3.0, transform_location.t), 0).rgb;
srcLocation.s = dot(ur_abc, vec3(pos, 1.0));
srcLocation.t = dot(ur_def, vec3(pos, 1.0));
}
return srcLocation;
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/support/MultiSizeFramebuffer":function(){define(["exports","../../../webgl/enums","../../../webgl/FramebufferObject","../../../webgl/RenderbufferDescriptor","../../../webgl/TextureDescriptor"],function(a,b,q,l,p){class k{constructor(h){this._rctx=h;this._fbos=new Map}get(h){return this._getPool(h)}dispose(){this._fbos.forEach(h=>h.dispose());this._fbos.clear()}_getPool(h){var f=this._fbos.get(h);if(f)return f;
f=new q.FramebufferObject(this._rctx,new p.TextureDescriptor(h),new l.RenderbufferDescriptor(b.RenderbufferFormat.DEPTH24_STENCIL8,h));this._fbos.set(h,f);return f}}a.MultiSizeFramebuffer=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileRenderInfo":function(){define(["exports","../../../core/PooledArray"],function(a,b){class q{constructor(){this.sourceLod=[0,0,0];this.offset=[0,0];this.scale=1;this.layerIndex=0;this.isVTLBackground=!1;this.vtlNeighborInfos=
new b({allocator:p=>p||new l})}}class l{constructor(){this.sourceLayerInfo=null;this.sourceLod=[0,0,0];this.offset=[-1,0]}}a.TileRenderInfo=q;a.VTLNeighhborInfo=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TileTexture":function(){define(function(){class a{constructor(b,q){this._texture=b;this._cache=q;this.type="tile-texture";this._refCount=1}retain(){++this._refCount}release(){--this._refCount;0===this._refCount&&(this._cache?this._cache.put(`${this._texture.descriptor.width} ${this._texture.descriptor.pixelFormat}`,
this):this.dispose())}dispose(){this._texture.dispose()}get texture(){return this._texture}generateMipmap(){this._texture.generateMipmap()}get descriptor(){return this._texture.descriptor}get usedMemory(){return this._texture.usedMemory}}return a})},"esri/views/3d/webgl-engine/collections/Component/ComponentIntersectionData":function(){define(["exports","../../../../../core/mathUtils","../../../../../core/libs/gl-matrix-2/factories/vec3f64","../../../../../geometry/support/aaBoundingBox","../../lib/RayIntersections"],
function(a,b,q,l,p){function k(r,n,u){let x=0,y=Infinity;for(let A=0;3>A;++A){var z=r[A];if(n[A]<z){if(1E-6>=u[A])return!1;x=Math.max(x,(z-n[A])/u[A])}else-1E-6>=u[A]&&(y=Math.min(y,(z-n[A])/u[A]));if(x>y)return!1;z=r[A+3];if(n[A]>z){if(-1E-6<=u[A])return!1;x=Math.max(x,(z-n[A])/u[A])}else 1E-6<=u[A]&&(y=Math.min(y,(z-n[A])/u[A]));if(x>y)return!1}return!0}function h(r,n,u,x,y,z){let A=x;for(;u<A;){var B=r[u];n[6*B+y+3]<=z?++u:(--A,r[u]=r[A],r[A]=B)}B=u;for(A=x;B<A;)x=r[A-1],n[6*x+y]>=z?--A:(r[A-1]=
r[B],r[B]=x,++B);return{next:u,mid:B}}function f(r,n,u,x){if(x<=u)return l.fromValues(NaN,NaN,NaN,NaN,NaN,NaN);var y=6*r[u];for(var z=0;3>z;++z)t[z]=n[y+0+z],w[z]=n[y+3+z];for(u+=1;u<x;++u)for(y=6*r[u],z=0;3>z;++z)t[z]=Math.min(t[z],n[y+0+z]),w[z]=Math.max(w[z],n[y+3+z]);return l.fromValues(t[0],t[1],t[2],w[0],w[1],w[2])}function c(r){var n=r[3]-r[0];const u=r[4]-r[1],x=r[5]-r[2];n=n>u?n>x?0:u>x?1:2:u>x?1:x>n?2:0;return{axis:n,midValue:(r[n]+r[n+3])/2}}function e(r,n,u,x,y){u-=n;const z=new Float32Array(6*
u);for(let B=0;B<u;++B){var A=3*(B+n);const C=r[A]*y,D=r[A+1]*y;A=r[A+2]*y;for(let F=0;3>F;++F){const H=x[C+F],N=x[D+F],E=x[A+F];z[6*B+F]=Math.min(H,N,E);z[6*B+3+F]=Math.max(H,N,E)}}return z}class g{constructor(r,n,u,x,y){this.aabb=r;this.axis=n;this.d=u;this.midStartIndex=x;this.rightStartIndex=y}}class d{constructor(r,n,u,x){this.globalTriangleVertexIndices=r;this.firstTriangleIndex=n;this.positions=x;this._rayDirection=q.create();this._callback=m;this._intersectionOptions=v;this.bspNodeTree=[];
const y=u-n,z=new (255>y?Uint8Array:65535>y?Uint16Array:Uint32Array)(y);this.triangleIndexMap=z;for(let D=0;D<y;++D)z[D]=D;const A=e(r,n,u,x.data,x.stride),B=b.clamp(Math.log2(y/40),2,10),C=(D,F,H)=>{var N=f(z,A,D,F);const E=F-D;if(40>=E)return D=new g(N,void 0,0,D,F),this.bspNodeTree.push(D),D;const {axis:G,midValue:I}=c(N),O=h(z,A,D,F,G,I),L=(P,M)=>{if(!(H>B)){var K=M-P;if(!(40>K||K>=.8*E))return C(P,M,H+1)}};N=new g(N,G,I,O.next,O.mid);this.bspNodeTree.push(N);N.leftNode=L(D,O.next);N.rightNode=
L(O.mid,F);return N};C(0,y,0)}intersectRayTriangleRange(r,n){if(!(r>=n)){var u=this.positions;p.intersectRayTriangles(this._rayFrom,this._rayDirection,r,n,this.globalTriangleVertexIndices,u.data,u.stride,this._intersectionOptions.normalRequired,this._callback,this.triangleIndexMap,this.firstTriangleIndex);d.numFacesTested+=n-r}}intersectRay(r,n,u,x){d.numFacesTested=0;var y=n[0]-r[0];const z=n[1]-r[1];n=n[2]-r[2];1E-6>y*y+z*z+n*n||(this._rayFrom=r,r=this._rayDirection,r[0]=y,r[1]=z,r[2]=n,y=this.triangleIndexMap.length,
this._callback=x,this._intersectionOptions=u,this.intersectRayBSP(this.bspNodeTree[0],0,y),this._callback=m,this._intersectionOptions=v)}intersectRayBSP(r,n,u){const x=this._rayFrom,y=this._rayDirection;if(k(r.aabb,x,y)){var z=r.axis,A=r.d;if(x[z]<A||0>y[z]){const B=r.midStartIndex;if(n<B){const C=r.leftNode;void 0!==C?this.intersectRayBSP(C,n,B):this.intersectRayTriangleRange(n,B)}}this.intersectRayTriangleRange(r.midStartIndex,r.rightStartIndex);if(x[z]>A||0<y[z])n=r.rightStartIndex,n<u&&(r=r.rightNode,
void 0!==r?this.intersectRayBSP(r,n,u):this.intersectRayTriangleRange(n,u))}}get estimatedMemoryUsage(){return this.triangleIndexMap.byteLength}}d.numFacesTested=0;const t=[Infinity,Infinity,Infinity],w=[-Infinity,-Infinity,-Infinity],v=new p.MeshIntersectionOptions,m=()=>{};a.ComponentIntersectionData=d;a.componentMinimalSizeForIntersectionData=200;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration":function(){define("exports ../../../../chunks/tslib.es6 ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/attributes/NormalAttribute.glsl ../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../core/shaderLibrary/terrain/Overlay.glsl ../core/shaderLibrary/terrain/TileBlendInput ../core/shaderTechnique/ShaderTechniqueConfiguration ../materials/DefaultTechniqueConfiguration".split(" "),
function(a,b,q,l,p,k,h,f,c,e){class g extends e.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=q.ShaderOutput.Color;this.overlayMode=h.OverlayMode.Disabled;this.tileBlendInput=f.TileBlendInput.LayerOnly;this.invisible=this.hasCloudsReflections=this.hasScreenSpaceReflections=this.renderOccluded=this.textureFadingEnabled=this.backfaceCullingEnabled=this.hasSlicePlane=this.receiveShadows=this.doublePrecisionRequiresObfuscation=this.spherical=!1;this.opaque=!0;this.receiveAmbientOcclusion=
this.screenSizePerspective=this.visualizeNormals=this.tileBorders=!1;this.pbrMode=k.PBRMode.Simplified}}b.__decorate([c.parameter({count:q.ShaderOutput.COUNT})],g.prototype,"output",void 0);b.__decorate([c.parameter({count:h.OverlayMode.COUNT})],g.prototype,"overlayMode",void 0);b.__decorate([c.parameter({count:f.TileBlendInput.COUNT})],g.prototype,"tileBlendInput",void 0);b.__decorate([c.parameter()],g.prototype,"spherical",void 0);b.__decorate([c.parameter()],g.prototype,"doublePrecisionRequiresObfuscation",
void 0);b.__decorate([c.parameter()],g.prototype,"receiveShadows",void 0);b.__decorate([c.parameter()],g.prototype,"hasSlicePlane",void 0);b.__decorate([c.parameter()],g.prototype,"backfaceCullingEnabled",void 0);b.__decorate([c.parameter()],g.prototype,"textureFadingEnabled",void 0);b.__decorate([c.parameter()],g.prototype,"renderOccluded",void 0);b.__decorate([c.parameter()],g.prototype,"hasScreenSpaceReflections",void 0);b.__decorate([c.parameter()],g.prototype,"hasCloudsReflections",void 0);b.__decorate([c.parameter()],
g.prototype,"invisible",void 0);b.__decorate([c.parameter()],g.prototype,"opaque",void 0);b.__decorate([c.parameter()],g.prototype,"tileBorders",void 0);b.__decorate([c.parameter()],g.prototype,"visualizeNormals",void 0);b.__decorate([c.parameter()],g.prototype,"screenSizePerspective",void 0);b.__decorate([c.parameter()],g.prototype,"receiveAmbientOcclusion",void 0);b.__decorate([c.parameter({count:k.PBRMode.COUNT})],g.prototype,"pbrMode",void 0);b.__decorate([c.parameter({constValue:l.NormalType.Compressed})],
g.prototype,"normalType",void 0);b.__decorate([c.parameter({constValue:p.TextureCoordinateAttributeType.Compressed})],g.prototype,"textureCoordinateType",void 0);b.__decorate([c.parameter({constValue:!1})],g.prototype,"highStepCount",void 0);b.__decorate([c.parameter({constValue:!1})],g.prototype,"useCustomDTRExponentForWater",void 0);b.__decorate([c.parameter({constValue:!1})],g.prototype,"useFillLights",void 0);b.__decorate([c.parameter({constValue:!0})],g.prototype,"hasColorTexture",void 0);a.TerrainTechniqueConfiguration=
g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/TerrainSurfacePerformanceInfo":function(){define(function(){class a{constructor(){this.numMerged=this.numSplit=this.numRendered=this.numVisible=this.numLeaves=this.numNodes=0;this.numRenderedPerLevel=[];this.numLoadedPerLevel=[]}}return a})},"esri/views/3d/terrain/TilingSchemeLogic":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/has ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/support/aaBoundingRect ../../../layers/support/layerUtils ../../ViewingMode ../support/supportedSpatialReference ./terrainUtils ./TilingScheme".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){a.TilingSchemeLogic=class extends q{constructor(m){super(m)}initialize(){this.addHandles([this.layers.on("change",()=>this._update()),p.watch(()=>this.extentHelper.layerViewsExtent,()=>this._setAdHocTilingScheme())]);this._update();this.tilingSchemeLocked||this._setAdHocTilingScheme()}destroy(){this._waitTask=null;this.layers.destroy()}_update(){this._waitTask=null;if(!this.tilingSchemeLocked){var m;this.layers.some(n=>!g.isTiledLayer(n)||n.isRejected()?!1:
n.isFulfilled()&&null==w.getTiledLayerInfo(n,this.viewSpatialReference,this.viewingMode)?!1:(m=n,"vector-tile"!==n?.type&&!w.isProjectableRasterLayer(n)));if(m)if(m.isResolved()){var r=w.getTiledLayerInfo(m,this.viewSpatialReference,this.viewingMode);null!=r&&(r=new v.TilingScheme(r.tileInfo),this._lockTilingScheme(r))}else this._updateWhen(m)}}_updateWhen(m){const r=m.when().catch(()=>{}).then(()=>{r!==this._waitTask||this.destroyed||this._update()});this._waitTask=r}_lockTilingScheme(m){if(this.viewingMode===
d.ViewingMode.Global){const r=m.levels.length-1,n=m.spatialReference;n.isWebMercator?m=v.TilingScheme.makeWebMercatorAuxiliarySphere(r):t.isSupportedEarthGCS(n)&&(m=v.TilingScheme.makeGCSWithTileSize(m.spatialReference,m.pixelSize,r))}this.tilingSchemeLocked=!0;this.tilingScheme=m;this.extentHelper.tilingScheme=this.tilingScheme;this._updateTiledLayerExtent();this.removeAllHandles();this.addHandles(p.watch(()=>this.extentHelper.tiledLayersExtent,()=>this._updateTiledLayerExtent()))}_updateTiledLayerExtent(){this._set("extent",
this.extentHelper.tiledLayersExtent)}_setAdHocTilingScheme(){if(this.viewingMode===d.ViewingMode.Global){var m=this.extentHelper.viewSpatialReference;m.isWebMercator?this.tilingScheme=v.TilingScheme.WebMercatorAuxiliarySphere:t.isSupportedGCSOnGlobe(m)&&(this.tilingScheme=v.TilingScheme.makeGCSWithTileSize(m,256));this._set("extent",this.extentHelper.layerViewsExtent)}else m=this.extentHelper.layerViewsExtent,null==m||e.equals(m,this.extent)||(this.tilingScheme=v.TilingScheme.fromExtent(m,this.extentHelper.viewSpatialReference),
this._set("extent",m))}get test(){}};b.__decorate([k.property()],a.TilingSchemeLogic.prototype,"tilingScheme",void 0);b.__decorate([k.property({readOnly:!0})],a.TilingSchemeLogic.prototype,"extent",void 0);b.__decorate([k.property({value:!1})],a.TilingSchemeLogic.prototype,"tilingSchemeLocked",void 0);b.__decorate([k.property({constructOnly:!0})],a.TilingSchemeLogic.prototype,"viewSpatialReference",void 0);b.__decorate([k.property({constructOnly:!0})],a.TilingSchemeLogic.prototype,"layers",void 0);
b.__decorate([k.property({constructOnly:!0})],a.TilingSchemeLogic.prototype,"extentHelper",void 0);b.__decorate([k.property({constructOnly:!0})],a.TilingSchemeLogic.prototype,"viewingMode",void 0);a.TilingSchemeLogic=b.__decorate([c.subclass("esri.views.3d.terrain.TilingSchemeLogic")],a.TilingSchemeLogic);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/terrain/UpsampleInfo":function(){define(["exports","../../../core/libs/gl-matrix-2/factories/vec2f64"],function(a,b){class q{constructor(){this.offset=
b.create();this.scale=0;this.tile=null}init(l,p,k,h){this.tile=l;this.offset[0]=p;this.offset[1]=k;this.scale=h}dispose(){this.tile=null;this.offset[0]=0;this.scale=this.offset[1]=0}}a.UpsampleInfo=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/Stage":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/has ../../../core/PooledArray ../../../core/promiseUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../state/helpers/SceneIntersectionHelper ./lib/ChangeSet ./lib/UpdatePolicy ./lib/WebGLLayer ./parts/Model ./parts/RenderView ../../support/Scheduler ../../support/Yield".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){a.Stage=class extends q{constructor(u){super(u);this._model=new v.Model;this._layers=new p;this._asyncChangeSet=new d.ChangeSet;this._syncChangeSet=new d.ChangeSet;this._layerSyncSet=new Set}initialize(){this._set("renderView",new m.RenderView(this));this._frameTask=this.view.resourceController.scheduler.registerTask(r.TaskPriority.STAGE,this);this.addHandles(this._frameTask)}destroy(){this.renderView.destroy()}get viewingMode(){return this.view.state.viewingMode}get updating(){return this.running||
this.renderView.updating||this._frameTask.updating}get renderer(){return this.renderView?.renderer}add(u){this._model.add(u);w.isWebGLLayer(u)&&this._addLayer(u);this.renderView.requestRender()}remove(u){null!=u&&!this.destroyed&&this._model.remove(u)&&(w.isWebGLLayer(u)&&this._removeLayer(u),this.renderView.requestRender())}addMany(u){null!=u&&(this._model.addMany(u),this.renderView.requestRender())}removeMany(u){null!=u&&(this._model?.removeMany(u),this.renderView?.requestRender())}forEachOfType(u,
x){this._model.forEachOfType(u,x)}handleEvent(u,x){this.destroyed||(this._model.dirtySet[u](x),this.renderView.requestRender())}get running(){return this._model.dirtySet.dirty||!this._asyncChangeSet.empty}runTask(u){this._frameTask.processQueue(u);this._commit(u);if(!u.hasProgressed)return n.Yield}_commit(u){const x=this._model.dirtySet;this._asyncChangeSet.empty||u.done||(this.renderer.modify(this._asyncChangeSet,u),this.renderView.requestRender(),u.madeProgress());this._layers.forAll(y=>{if(!u.done){var z=
this._layerSyncSet.has(y.id)||y.updatePolicy===t.UpdatePolicy.SYNC,A=z?this._syncChangeSet:this._asyncChangeSet;x.commitLayer(y.id,A);this._layerSyncSet.delete(y.id);A.empty||(this.renderer.modify(A,z?r.noBudget:u),this.renderView.requestRender(),u.madeProgress())}});this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,r.noBudget),this.renderView.requestRender(),u.madeProgress());this._layers.forAll(y=>{u.done||this._layerSyncSet.has(y.id)||y.updatePolicy!==t.UpdatePolicy.ASYNC||(x.commitLayer(y.id,
this._asyncChangeSet),this._asyncChangeSet.empty||(this.renderer.modify(this._asyncChangeSet,u),this.renderView.requestRender(),u.madeProgress()))});this._layerSyncSet.clear();this.notifyChange("running")}commitSyncLayers(){const u=this._model.dirtySet;this._layers.forAll(x=>{this._layerSyncSet.has(x.id)||x.updatePolicy===t.UpdatePolicy.SYNC?(u.commitLayer(x.id,this._syncChangeSet),this._layerSyncSet.delete(x.id)):u.commitSyncUpdates(x.id,this._syncChangeSet)});for(const x of this._layerSyncSet)u.commitLayer(x,
this._syncChangeSet);this._layerSyncSet.clear();this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,r.noBudget),this.renderView.requestRender())}_commitLayer(u){this._model.dirtySet.commitLayer(u.id,this._syncChangeSet);this._layerSyncSet.delete(u.id);this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,r.noBudget),this.renderView.requestRender())}schedule(u,x){return this._frameTask.schedule(u,x)}reschedule(u,x){return this._frameTask.reschedule(u,x)}syncLayer(u){this._layerSyncSet.add(u);
this.renderView.requestRender()}getObject(u){return this._model.getObject(u)}get layers(){return this._layers}_addLayer(u){this._layers.includes(u)||this._layers.push(u)}_removeLayer(u){this._commitLayer(u);null!=this._layers.removeUnordered(u)&&(this._model.dirtySet.getResidentRenderGeometries(u.id,this._syncChangeSet.removes),this.renderer.modify(this._syncChangeSet,r.noBudget))}addRenderPlugin(u,x){x=this.renderer.plugins.add(u,x);const y=()=>{g.isIntersectionHandler(u)&&this.view.sceneIntersectionHelper.addIntersectionHandler(u)};
if(k.isPromiseLike(x))return x.then(y);y()}removeRenderPlugin(u){this.destroyed||(g.isIntersectionHandler(u)&&this.view.sceneIntersectionHelper.removeIntersectionHandler(u),this.renderer.plugins.remove(u))}get performanceInfo(){return this._model.getStats()}get test(){}};a.Stage.DebugSettings={endFrameContentValidation:!1};b.__decorate([h.property({constructOnly:!0})],a.Stage.prototype,"view",void 0);b.__decorate([h.property({constructOnly:!0})],a.Stage.prototype,"options",void 0);b.__decorate([h.property({readOnly:!0})],
a.Stage.prototype,"viewingMode",null);b.__decorate([h.property({constructOnly:!0})],a.Stage.prototype,"container",void 0);b.__decorate([h.property({readOnly:!0})],a.Stage.prototype,"updating",null);b.__decorate([h.property({constructOnly:!0})],a.Stage.prototype,"_model",void 0);b.__decorate([h.property()],a.Stage.prototype,"renderView",void 0);b.__decorate([h.property({readOnly:!0})],a.Stage.prototype,"renderer",null);b.__decorate([h.property({readOnly:!0})],a.Stage.prototype,"running",null);a.Stage=
b.__decorate([e.subclass("esri.views.3d.webgl-engine.Stage")],a.Stage);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/parts/Model":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/sphere ../lib/ContentObjectType ../lib/GridLocalOriginFactory ../lib/ModelDirtySet ../lib/RenderGeometry ../lib/Util ../lib/WebGLLayer".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){a.Model=class extends q{constructor(){super(...arguments);this.dirtySet=new t({model:this});this._content=new Map;this._originFactory=new d.GridLocalOriginFactory(null)}getObject(n){return this._content.get(n)}add(n){const u=n.id;v.assert(!this._content.has(u),"Model/Stage already contains object to be added");this._content.set(u,n);m.isWebGLLayer(n)&&this.dirtySet.layerAdded(n)}remove(n){if(!this._content.has(n.id))return!1;this._content.delete(n.id);m.isWebGLLayer(n)&&
this.dirtySet.layerRemoved(n);return!0}addMany(n){for(const u of n)u&&(v.assert(!this._content.has(u.id),"Model/Stage already contains object to be added"),this._content.set(u.id,u))}removeMany(n){for(const u of n)u&&(v.assert(this._content.has(u.id),"Model/Stage doesn't contain object to be removed"),this._content.delete(u.id))}has(n){return this._content.has(n.id)}forEachOfType(n,u){this._content.forEach(x=>{x.type===n&&u(x)})}getRenderGeometry(n,u){const x=new w.RenderGeometry(u,{castShadow:n.castShadow,
objectShaderTransformation:n.shaderTransformation});x.transformation=n.getCombinedStaticTransformation(u,r);({localOrigin:n}=u);x.localOrigin=null!=n?n:this._originFactory.getOrigin(e.getCenter(x.boundingSphere));return x}updateRenderGeometryTransformation(n,u,x){if(null==n)return!1;x.transformation=n.getCombinedStaticTransformation(u,r);n=this._originFactory.getOrigin(e.getCenter(x.boundingSphere));return x.localOrigin!==n}getStats(){const n={},u=Array.from(this._content.values());for(let x=0;x<
g.ContentObjectType.COUNT;++x)n[x]=u.filter(y=>y.type===x).length;return{contentTypes:n,dirtySet:this.dirtySet.formatDebugInfo()}}get test(){}};b.__decorate([p.property({constructOnly:!0})],a.Model.prototype,"dirtySet",void 0);a.Model=b.__decorate([f.subclass("esri.views.3d.webgl-engine.parts.Model")],a.Model);const r=c.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ModelDirtySet":function(){define("../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/uid ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ./ModelDirtyTypes ./Util".split(" "),
function(a,b,q,l,p,k,h,f,c,e){class g{constructor(d,t,w,v){this.operation=d;this.geometry=t;this.states=w;this.sync=v}}b=class extends b{constructor(d){super(d);this._residentGeomRecords=new Map;this._dirtyGeomRecords=new Map;this.dirty=!1}commitLayer(d,t){const w=this._dirtyGeomRecords.get(d);w&&(w.forEach((v,m)=>{const r=this._ensureGeomRecord(d,m);v.forEach(({geometry:n,operation:u,states:x},y)=>{let z=!1;if(u===c.DirtyOperation.UPDATE){const A=r.get(y);if(A){if(x&c.DirtyState.TRANSFORMATION){const B=
this.model.getObject(m);this.model.updateRenderGeometryTransformation(B,n,A)&&(z=!0)}z||t.updates.push({renderGeometry:A,updateType:x})}else e.assert(!1,"ModelDirtySet.commitLayer: invalid update")}if(u===c.DirtyOperation.REMOVE||z)(x=r.get(y))?(t.removes.push(x),r.delete(y)):u===c.DirtyOperation.REMOVE&&e.assert(!1,"ModelDirtySet.commitLayer: invalid remove");if(u===c.DirtyOperation.ADD||z)u=this.model.getObject(m),null!=u&&(n=this.model.getRenderGeometry(u,n),t.adds.push(n),r.set(y,n))});0===r.size&&
this._residentGeomRecords.get(d).delete(m)}),0===this._residentGeomRecords.get(d).size&&this._residentGeomRecords.delete(d),this._dirtyGeomRecords.delete(d),this.dirty=this._hasDirtyGeometryRecords)}commitSyncUpdates(d,t){const w=this._dirtyGeomRecords.get(d);w&&w.forEach((v,m)=>{const r=this._ensureGeomRecord(d,m);v.forEach(({geometry:n,operation:u,states:x,sync:y},z)=>{let A=!1;u===c.DirtyOperation.UPDATE&&y&&((u=r.get(z))?(x&c.DirtyState.TRANSFORMATION&&(y=this.model.getObject(m),this.model.updateRenderGeometryTransformation(y,
n,u)&&(A=!0)),A||t.updates.push({renderGeometry:u,updateType:x})):e.assert(!1,"ModelDirtySet.commitSyncUpdates: invalid update"))})})}getResidentRenderGeometries(d,t){(d=this._residentGeomRecords.get(d))&&d.forEach(w=>w.forEach(v=>t.push(v)))}_objectStateChanged(d,t){for(const w of t.geometries)this._updateOrCreateDirtyRecord(t,w,null,c.DirtyOperation.UPDATE,d)}visibilityChanged(d){this._objectStateChanged(c.DirtyState.VISIBILITY,d)}highlightChanged(d){this._objectStateChanged(c.DirtyState.HIGHLIGHT,
d)}occlusionChanged(d){this._objectStateChanged(c.DirtyState.OCCLUDEE,d)}attributesChanged({object:d,geometry:t,sync:w}){this._updateOrCreateDirtyRecord(d,t,null,c.DirtyOperation.UPDATE,c.DirtyState.GEOMETRY,w)}layerAdded(d){d.objects.forAll(t=>this._layerObjectAdded(d,t))}layerRemoved(d){d.objects.forAll(t=>this._layerObjectRemoved(d,t))}layerObjectAdded(d){this._layerObjectAdded(d.layer,d.object)}_layerObjectAdded(d,t){d=d.id;for(const w of t.geometries)this._geometryAdded(t,w,d)}layerObjectRemoved(d){this._layerObjectRemoved(d.layer,
d.object)}layerObjectsAdded(d){for(const t of d.objects)this._layerObjectAdded(d.layer,t)}layerObjectsRemoved(d){for(const t of d.objects)this._layerObjectRemoved(d.layer,t)}_layerObjectRemoved(d,t){d=d.id;for(const w of t.geometries)this._geometryRemoved(t,w,d)}transformationChanged(d){const t=this._getParentLayerId(d);this._ensureGeomRecord(t,d.id).forEach(w=>{this._updateOrCreateDirtyRecord(d,w.geometry,t,c.DirtyOperation.UPDATE,c.DirtyState.TRANSFORMATION)})}shaderTransformationChanged(d){const t=
this._getParentLayerId(d);this._ensureGeomRecord(t,d.id).forEach(w=>{w.objectShaderTransformationChanged(d.shaderTransformation)})}geometryAdded(d){this._geometryAdded(d.object,d.geometry)}_geometryAdded(d,t,w=null){this._updateOrCreateDirtyRecord(d,t,w,c.DirtyOperation.ADD)}geometryRemoved(d){this._geometryRemoved(d.object,d.geometry)}_geometryRemoved(d,t,w=null){this._updateOrCreateDirtyRecord(d,t,w,c.DirtyOperation.REMOVE)}_updateOrCreateDirtyRecord(d,t,w,v,m=c.DirtyState.NONE,r=!1){w=w??this._getParentLayerId(d);
const n=t.id;d=this._ensureDirtyRecord(w,d.id);w=d.get(n);let u=!1;w?(t=w.operation,t===c.DirtyOperation.REMOVE&&v===c.DirtyOperation.ADD&&w.states!==c.DirtyState.NONE?w.operation=c.DirtyOperation.UPDATE:t===c.DirtyOperation.REMOVE&&v===c.DirtyOperation.ADD||t===c.DirtyOperation.ADD&&v===c.DirtyOperation.REMOVE?(d.delete(n),u=!0):(t!==c.DirtyOperation.UPDATE||v!==c.DirtyOperation.REMOVE&&v!==c.DirtyOperation.UPDATE?e.assert((t===c.DirtyOperation.REMOVE||t===c.DirtyOperation.ADD)&&v===c.DirtyOperation.UPDATE,
"ModelDirtySet.objectGeometryAdded: inconsistent state"):w.operation=v,w.states|=m),w.sync=w.sync||r):d.set(n,new g(v,t,m,r));this.dirty=u?this._hasDirtyGeometryRecords:!0}_ensureGeomRecord(d,t){let w=this._residentGeomRecords.get(d);w||(w=new Map,this._residentGeomRecords.set(d,w));d=w.get(t);d||(d=new Map,w.set(t,d));return d}get _hasDirtyGeometryRecords(){for(const d of this._dirtyGeomRecords.values())for(const t of d.values())if(0<t.size)return!0;return!1}_ensureDirtyRecord(d,t){let w=this._dirtyGeomRecords.get(d);
w||(w=new Map,this._dirtyGeomRecords.set(d,w));d=w.get(t);d||(d=new Map,w.set(t,d));return d}_getParentLayerId(d){return d.parentLayer?d.parentLayer.id:l.nullUid}formatDebugInfo(){const d=["ADD","UPD",void 0,"REM"];let t="";this._dirtyGeomRecords.forEach((w,v)=>{w.forEach((m,r)=>{0<t.length&&(t+="\n");t+=v+"."+r;const n=[];m.forEach(u=>{const x=u.operation;n[x]||(n[x]=[]);n[x].push(u.geometry.id)});for(m=0;m<n.length;m++)if(n[m])for(t+=" "+d[m-1]+": ",r=0;r<n[m].length;r++)t+=n[m][r]+", "})});return t}get test(){}};
a.__decorate([p.property({constructOnly:!0})],b.prototype,"model",void 0);a.__decorate([p.property()],b.prototype,"dirty",void 0);return b=a.__decorate([f.subclass("esri.views.3d.webgl-engine.lib.ModelDirtySet")],b)})},"esri/views/3d/webgl-engine/parts/RenderView":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/has ../../../../core/Logger ../../../../core/maybe ../../../../core/reactiveUtils ../../../../core/scheduling ../../../../core/time ../../../../core/accessorSupport/decorators/property ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../collections/Component/ComponentObjectCollection ../core/shaderTechnique/ShaderTechniqueRepository ../effects/highlight/Highlight ../effects/highlight/ShadowHighlight ../effects/magnifier/MagnifierRenderNode ../effects/smaa/SMAA ../effects/ssao/SSAO ../lib/basicInterfaces ../lib/CompositingHelper ../lib/depthRangeUtils ../lib/GLMaterialRepository ../lib/Material ../lib/ObjectAndLayerIdRenderHelper ../lib/Renderer ../lib/RenderingContext ../lib/TextureRepository ../materials/markerTextureRepository ../materials/stippleTextureRepository ../materials/internal/WaterTextureRepository ./contextCache ./requireUtils ./ScreenshotManager ./testUtils ../../../support/RenderState ../../../webgl/contextUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J){function R(W,S){const V={disabledExtensions:S.options.deactivatedWebGLExtensions||{},debugWebGLExtensions:S.options.debugWebGLExtensions||{},maxAnisotropy:8},T=(Y,ha)=>S.view.resourceController.memoryController.newCache(Y,ha);if(M.contextCache.enabled){let Y=Q.get(W);if(Y)return Y.configure(V),Y.newCache=T,Y.ref(),Y;Y=new H.RenderingContext(W,V,T);Q.set(W,Y);Y.ref();return Y}return new H.RenderingContext(W,V,T)}
a.RenderView=class extends q{constructor(W){super({});this.events=new l;this.waterTextures=new I.WaterTextureRepository;this.objectAndLayerIdRenderHelper=p("enable-feature:objectAndLayerId-rendering")?new D.ObjectAndLayerIdRenderHelper:null;this._idleSuspend=this._needsRender=this._needsUpdate=!0;this._needsWaterReflectionUpdate=!1;this._lastAnimationUpdate=0;this._container=W.container;this._viewingMode=W.viewingMode;try{this._initializeContext(W)}catch(V){console.error("Failed to initialize context",
V);return}const {memoryController:S}=W.view.resourceController;this.stippleTextures=G.createStippleTextureRepository(this._rctx,S);this.markerTextures=E.createMarkerTextureRepository(this._rctx,S);this._techniques=new v.ShaderTechniqueRepository({rctx:this._rctx,viewingMode:W.viewingMode,stippleTextures:this.stippleTextures,waterTextures:this.waterTextures,markerTextures:this.markerTextures});this._textures=new N.TextureRepository(W,this._techniques,this._rctx);this.addHandles(this._textures.events.on("changed",
V=>this.requestRender(V)));this._materials=new B.GLMaterialRepository(this._textures,this._techniques,()=>this.requestRender(),()=>this.requestRender());this._compositingHelper=new z(this._rctx,this._techniques);this.renderer=new F.Renderer(W,this._materials,this._techniques,this._rctx,this._compositingHelper,V=>this.requestRender(V));this.addHandles([f.watch(()=>W.view.ready,V=>{V&&this._createRenderNodes(W.view,W.viewingMode)},f.initial),f.watch(()=>this.waterTextures?.updating,()=>this.requestRender(),
f.initial),f.watch(()=>W.view.qualityProfile,V=>this.renderer?.updateRenderFeatures(V),f.syncAndInitial)]);this._screenshotManager=new P.ScreenshotManager(this._rctx,{renderScene:(V,T,Y,ha)=>this.renderer.render(V,T,Y,ha),requestRenderScene:V=>this.requestRender(V),prepareOverlay:()=>W.options.screenshot.prepareOverlay(),renderOverlay:(V,T,Y)=>W.options.screenshot.renderOverlay(V,T,Y)},V=>this.events.emit("force-camera-for-screenshot",V));this._registerFrameTask(W)}normalizeCtorArgs(){return{}}destroy(){this._container.contains(this._canvas)&&
this._container.removeChild(this._canvas);this._frameTask=h.removeMaybe(this._frameTask);this._techniques=h.destroyMaybe(this._techniques);this._componentObjects=h.destroyMaybe(this._componentObjects);this._screenshotManager=h.destroyMaybe(this._screenshotManager);h.destroyMaybe(this.renderer);this._textures=h.destroyMaybe(this._textures);h.destroyMaybe(this.waterTextures);h.destroyMaybe(this.markerTextures);h.destroyMaybe(this.stippleTextures);this._container=this._canvas=null;this._rctx=h.destroyMaybe(this._rctx)}_createRenderNodes(W,
S){new x.SSAO({view:W,isEnabled:()=>this.renderer.hasSSAO,techniques:this._techniques});new u.SMAA({view:W,isEnabled:()=>this.renderer.hasSMAA,techniques:this._techniques});new n.MagnifierRenderNode({view:W,techniques:this._techniques});new m.Highlight({view:W,techniques:this._techniques});new r.ShadowHighlight({view:W,viewingMode:S,techniques:this._techniques})}requestRender(W=y.RenderRequestType.UPDATE){this._needsRender=!0;W===y.RenderRequestType.UPDATE&&(this._needsUpdate=!0)}get updating(){return this._needsUpdate||
this._needsWaterReflectionUpdate||this.renderer.updating||this._textures.updating||this.waterTextures.updating}get textures(){return this._textures}get compositingHelper(){return this._compositingHelper}setIdleSuspend(W){this._idleSuspend!==W&&(this._idleSuspend=W,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(W){return this._screenshotManager.takeScreenshot(W).then(S=>S[0])}takeScreenshotWithOID(W){W.objectAndLayerIdColor=
!0;return this._screenshotManager.takeScreenshot(W)}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(W,S,V,T,Y,ha=Y){ha=T.constrainWindowSize(S,V,Y*T.pixelRatio,ha*T.pixelRatio);const ba=this._ensureDepthBuffer(ha);this.renderer.readDepthPixels(ha,ba);Y=Number.MAX_VALUE;for(let U=0;U<ha[2]*ha[3];U++){const Z=A.textureToDepth(4*U,ba,T.nearFar);Y>Z&&Z!==T.nearFar[0]&&Z!==T.nearFar[1]&&(Y=Z)}W&&(W=W.pickDepth(S*T.pixelRatio,V*T.pixelRatio,T),null!=W&&Y>W&&W!==T.nearFar[0]&&
W!==T.nearFar[1]&&(Y=W));return Y===Number.MAX_VALUE?void 0:Y}_ensureDepthBuffer(W){W=4*W[2]*W[3];if(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<W)this._tmpDepthBuffer=new Uint8Array(W);return this._tmpDepthBuffer}async reloadShaders(){L.removeLoadedShaderModules();await this._techniques.reloadAll();this.requestRender()}_registerFrameTask(W){const S=W.view.state;let V=!1,T=y.RenderRequestType.BACKGROUND,Y=!1;this._frameTask=c.addFrameTask({preRender:({time:ha})=>{V=this.updating;T=
this._needsUpdate?y.RenderRequestType.UPDATE:y.RenderRequestType.BACKGROUND;W.commitSyncLayers();var ba=e.Milliseconds(ha-this._lastAnimationUpdate);if(ba>this.renderer.animationTimestep||null!=S.forcedAnimationTime||V||this._needsRender)ba=e.Milliseconds(ba/this.renderer.animationTimeDilation),ba=new C.UpdateParameters(S.camera,ba,S.forcedAnimationTime),this.renderer.updateAnimation(ba)&&this.requestRender(y.RenderRequestType.BACKGROUND),this._lastAnimationUpdate=ha},render:({time:ha})=>{if((this._needsRender||
!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&0<S.camera.fullWidth&&0<S.camera.fullHeight){const ba=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsWaterReflectionUpdate=this._needsUpdate=this._needsRender=!1;this.renderer.render(S,ha);Y=!0;ba&&this.renderer.hasReflections&&(this.requestRender(y.RenderRequestType.BACKGROUND),this._needsWaterReflectionUpdate=!0)}},update:({time:ha})=>{const ba=new P.ScreenshotContext(S,this.renderer.hasSlicePlane||
this.renderer.hasDecorations||this.renderer.hasHighlights,this.renderer.fboCache);this._textures.update();this._screenshotManager.update(ba,ha)},finish:()=>{Y&&(this.renderer.finish(S.mode===K.RenderState.IDLE?T:y.RenderRequestType.UPDATE),Y=!1)}})}_initializeContext(W){const S=W.options;this._canvas=S.canvas;this._canvas||(this._canvas=document.createElement("canvas"));this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");const V=J.createContext(this._canvas,{alpha:S.alpha||
!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:S.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:S.preserveDrawingBuffer??!1});null==V?k.getLogger(this).error("A WebGL2 context could not be created."):(this._rctx=R(V,W),this._loadShaderOnlyExtensions(),!S.alpha&&this._rctx.contextAttributes.alpha&&k.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested"),!this._rctx.contextAttributes.alpha&&11<=p("safari")&&(this._container.style.backgroundColor=
"black"),this._container.appendChild(this._canvas))}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}getObjectAndLayerIdColor(W){return null!=this.objectAndLayerIdRenderHelper?this.objectAndLayerIdRenderHelper.getObjectAndLayerIdColor(W):null}get componentObjectCollection(){null==this._componentObjects&&(this._componentObjects=new w.ComponentObjectCollection(this.renderer.renderPassManager,this._viewingMode));return this._componentObjects}set componentObjectCollection(W){this._componentObjects=
W}};b.__decorate([g.property({type:Boolean,readOnly:!0})],a.RenderView.prototype,"updating",null);b.__decorate([g.property()],a.RenderView.prototype,"_rctx",void 0);b.__decorate([g.property()],a.RenderView.prototype,"_container",void 0);b.__decorate([g.property()],a.RenderView.prototype,"_canvas",void 0);b.__decorate([g.property()],a.RenderView.prototype,"stippleTextures",void 0);b.__decorate([g.property()],a.RenderView.prototype,"markerTextures",void 0);b.__decorate([g.property()],a.RenderView.prototype,
"waterTextures",void 0);b.__decorate([g.property({readOnly:!0})],a.RenderView.prototype,"objectAndLayerIdRenderHelper",void 0);b.__decorate([g.property()],a.RenderView.prototype,"_textures",void 0);b.__decorate([g.property({readOnly:!0})],a.RenderView.prototype,"renderer",void 0);b.__decorate([g.property()],a.RenderView.prototype,"_screenshotManager",void 0);b.__decorate([g.property()],a.RenderView.prototype,"componentObjectCollection",null);b.__decorate([g.property()],a.RenderView.prototype,"_componentObjects",
void 0);b.__decorate([g.property()],a.RenderView.prototype,"_needsUpdate",void 0);b.__decorate([g.property()],a.RenderView.prototype,"_needsWaterReflectionUpdate",void 0);a.RenderView=b.__decorate([t.subclass("esri.views.3d.webgl-engine.parts.RenderView")],a.RenderView);const Q=O.getContextCache();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/ComponentObjectCollection":function(){define("exports ../../../../../core/has ../../../../../core/Logger ../../../../../core/PooledArray ../../../../../core/typedArrayUtil ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../geometry/support/aaBoundingBox ../../../../../geometry/support/Indices ../../../../../chunks/vec3 ../../../../../chunks/vec33 ../../../../ViewingMode ../../../layers/support/symbolColorUtils ../../../support/orientedBoundingBox ../../../support/buffer/glUtil ../../../support/buffer/InterleavedLayout ./ComponentData ./ComponentObject ./IntersectionGeometry ./Renderable ./RenderGeometry ./RenderSubmitSystem ./SourceGeometry ./UniformComponentParameters ./Material/ComponentMaterial ./Material/ComponentTechnique ./Material/shader/ComponentData.glsl ../../lib/ComponentUtils ../../lib/Util ../../lib/VertexAttribute ../../lib/verticalOffsetUtils ../../lib/edgeRendering/bufferLayouts ../../lib/edgeRendering/edgeProcessing ../../lib/TextureBackedBuffer/BufferManager ../../../../webgl/BufferObject ../../../../webgl/enums ../../../../webgl/VertexArrayObject".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K){function J(V,T){return V===T?C.ComponentParameterSummary.All:0===V?C.ComponentParameterSummary.None:C.ComponentParameterSummary.Some}const R=()=>q.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class Q{constructor(V,T){this._renderManager=V;this._viewingMode=T;this._elevationRangeCacheMax=this._elevationRangeCacheMin=this._elevationRangeCacheVerticalOffset=NaN;this._visible=
new l;this._hidden=new l;this._renderSubmit=new z.RenderSubmitSystem(this);this._renderManager.register(this._renderSubmit);this._hasObjectAndLayerId=b("enable-feature:objectAndLayerId-rendering");this._componentBufferManager=new L.BufferManager(V.rctx,2+(this._hasObjectAndLayerId?1:0))}destroy(){N.assert(0===this._hidden.length&&0===this._visible.length,"ObjectCollection should be empty upon disposal");this._componentBufferManager.destroy();this._visible.forAll(V=>V.destroy());this._hidden.forAll(V=>
V.destroy());this._visible.clear();this._hidden.clear()}createObject(V){var T=V.geometry;const Y=new r(this._componentBufferManager,c.compactIndices(T.componentOffsets)),ha=this._createRenderable(V,Y);T=new u.IntersectionGeometry(this._viewingMode,T.positionData,Y);V=new n.ComponentObject(V.transform,V.toMapSpace,V.obb.clone(),Y,ha,T);(V.visible?this._visible:this._hidden).push(V);return V}destroyObject(V){(V.visible?this._visible:this._hidden).removeUnordered(V);V.destroy();this._notifyDirty()}setObjectVisibility(V,
T){T!==V.visible&&(T?(this._hidden.removeUnordered(V),this._visible.push(V)):(this._visible.removeUnordered(V),this._hidden.push(V)),V.visible=T,this._notifyDirty())}preSubmit(V){const T=V.camera.eye;this.visibleObjects.forAll(Y=>Y.renderable.meta.cameraDepthSquared=k.squaredDistance(T,Y.obb.center))}getMaterial(V){return V.renderable.material}updateMaterial(V,T){V=V.renderable.material;T(V);V.dirty&&this._notifyDirty()}setAllComponentVisibilities(V,T){V.components.visibility.reset(T);V.components.visibilityDirty();
this._notifyDirty()}forEachVisibleComponent(V,T){return V.components.visibility.forEachComponent(T)}getComponentCount(V){const T=V.components.visibility.componentCount;return{visible:T,invisible:V.components.count-T}}setComponentData(V,T){const Y=V.renderable.material,ha=V.components;var ba=ha.materialDataBuffer;const U=ha.materialDataIndices,Z=new B.UniformComponentParameters;ba=ba.textureBuffer;const ca=new Uint8Array(4),ea=new Uint32Array(ca.buffer);let da=0,ia=0,ka=0,fa=ha.verticalOffsets,X=Infinity,
ja=-Infinity,la=!1,na=!1,va=0;for(let za=0;za<ha.count;za++){T(za,Z);da+=+(1>Z.externalColor[3]);ia+=+(Z.externalColorMixMode===t.ColorMixModeEnum.Replace&&1===Z.externalColor[3]);ka+=+Z.castShadows;t.encodeSymbolColor(Z.externalColor,Z.externalColorMixMode,ca);ca[2]=ca[2]&254|+Z.castShadows;ba.setData(U[za],0,ca[0],ca[1],ca[2],ca[3]);la||=0<za&&va!==ea[0];va=ea[0];na||=0!==Z.elevationOffset;na&&null==fa&&(fa=Array(za).fill(0));null!=fa&&(fa[za]=Z.elevationOffset);X=Math.min(X,Z.elevationOffset);
ja=Math.max(ja,Z.elevationOffset);F.encodeElevationOffset(Z.elevationOffset,ca);ba.setData(U[za],1,ca[0],ca[1],ca[2],ca[3]);const ya=Z.objectAndLayerIdColor;null!=ya&&ba.setData(U[za],2,ya[0],ya[1],ya[2],ya[3]);Z.pickable!==H.getVisibility(ha.pickability,za)&&(ha.pickability=H.updateVisibilityWithCount(ha.pickability,ha.count,za,Z.pickable))}ha.verticalOffsets=na?fa:null;V.offsetObb=na?w.computeOffsetObb(V.obb,X,ja,this._viewingMode,V.offsetObb??V.obb.clone()):null;la||na||this._hasObjectAndLayerId?
(Y.componentParameters=new C.ComponentParametersVarying,Y.componentParameters.castShadows=J(ka,ha.count),Y.componentParameters.transparent=J(da,ha.count),Y.componentParameters.opaqueOverride=J(ia,ha.count),Y.componentParameters.texture=ba,ba.updateTexture()):(Y.componentParameters=new C.ComponentParametersUniform,Y.componentParameters.castShadows=Z.castShadows?C.ComponentParameterSummary.All:C.ComponentParameterSummary.None,Y.componentParameters.externalColor=Z.externalColor,Y.componentParameters.externalColorMixMode=
Z.externalColorMixMode);this._elevationRangeCacheVerticalOffset=NaN;this._notifyDirty()}getComponentAabb(V,T,Y,ha=!1){V.intersectionGeometry.getComponentAabb(T,Y);const ba=V.components.verticalOffsets;if(ha||null==ba)return Y;T=ba[T];if(this._viewingMode===d.ViewingMode.Local||0===T)return Y[2]+=T,Y[5]+=T,Y;T=G.getVerticalOffsetI3S(T);T.localOrigin=V.transform.position;return T.applyToAabb(Y)}getComponentObb(V){return V.obb}getObjectTransform(V){return V.transform}getComponentPositions(V,T,Y){return V.intersectionGeometry.getComponentPositions(T,
Y)}expandRangeWithComponentObjectElevationRange(V,T,Y,ha){Number.isNaN(this._elevationRangeCacheVerticalOffset)||this._elevationRangeCacheVerticalOffset!==T||ha.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);var ba=V.components;const U=ba.count;ba=ba.verticalOffsets;const Z=this._viewingMode===d.ViewingMode.Local,ca=V.intersectionGeometry.getComponentAabbs(),ea=S;let da=Infinity,ia=-Infinity;for(let X=0;X<U;X++){var ka=6*X,fa=ba?.[X]??0;let ja=Infinity,la=-Infinity;
if(Z)ja=ca[ka+2]+fa+T,la=ca[ka+5]+fa+T;else{ea[0]=ca[ka];ea[1]=ca[ka+1];ea[2]=ca[ka+2];ea[3]=ca[ka+3];ea[4]=ca[ka+4];ea[5]=ca[ka+5];0!==fa&&(ka=G.getVerticalOffsetI3S(fa),ka.localOrigin=V.transform.position,ka.applyToAabb(ea));ka=Math.max(Math.abs(ea[3]),Math.abs(ea[0]));fa=Math.max(Math.abs(ea[4]),Math.abs(ea[1]));const na=T+ea[5]+Y;ha.expandElevationRangeValues(T+ea[2],Math.sqrt(ka*ka+fa*fa+na*na)-Y)}ha.expandElevationRangeValues(ja,la);da=Math.min(da,ja);ia=Math.max(ia,la)}this._elevationRangeCacheVerticalOffset=
T;this._elevationRangeCacheMin=da;this._elevationRangeCacheMax=ia}intersect(V,T,Y,ha,ba,U,Z){const {transform:ca}=V,{position:ea}=ca;null!=ba&&(ba.localOrigin=ea);return V.intersectionGeometry.intersect(T,Y,ha,ba,V.components.verticalOffsets,ca,U,Z)}addEdges(V,T,Y,ha,ba){const {indices:U,positions:Z}=V.intersectionGeometry;return T.addComponentObject(V,Z,U,V.components.offsets,Y,ha,ba)}async extractEdgeInformation(V,T,Y){var ha=V.components.visibility;if(ha.allInvisible())return{buffer:O.extractComponentsEdgeLocationsLayout.createBuffer(0),
origin:[0,0,0]};const {indices:ba,positions:U}=V.intersectionGeometry,Z=V.components.offsets,ca=I.EdgeInputBufferLayout.createBuffer(U.length/3);g.copy(ca.position.typedBuffer,U,ca.position.typedBufferStride,3);e.transformMat3View(ca.position,ca.position,V.transform.rotationScale);this._setComponentIndices(ca.componentIndex,ba,Z);ha=this._computeVisibilityIndices(ba,ha,Z,ca.count);V=h.clone(V.transform.position);T=await T.extractComponentsEdgeLocations({indices:ha,indicesLength:ha.length,skipDeduplicate:!0,
data:ca,writerSettings:{reducedPrecision:!1,variants:0}},Y);return{origin:V,buffer:T}}_setComponentIndices(V,T,Y){let ha=0;for(let U=0;U<Y.length-1;U++){var ba=Y[U];const Z=Y[U+1];for(;ba<Z;ba++)V.set(T?T[ba]:ba,ha);ha++}}_computeVisibilityIndices(V,T,Y,ha){if(V&&T.allVisible())return V;let ba=0;T.forEachComponentRange((ca,ea)=>{ba+=Y[ea]-Y[ca];return!0});const U=p.isArray(V)?Array(ba):2===V?.BYTES_PER_ELEMENT||65536>=ha?new Uint16Array(ba):new Uint32Array(ba);let Z=0;T.forEachComponentRange((ca,
ea)=>{ca=Y[ca];for(ea=Y[ea];ca<ea;ca++)U[Z++]=V?V[ca]:ca;return!0});return U}addComponentHighlight(V,T){V=V.components;null==V.highlightCounts&&(V.highlightCounts=new Uint32Array(V.count+1));0===V.highlightCounts[T]++&&(V.highlightsDirty(),this._notifyDirty());V.highlightCounts[V.count]++}removeComponentHighlight(V,T){V=V.components;if(null==V.highlightCounts)R().warn("Removing non-existing highlight.");else{var Y=V.highlightCounts[T],ha=V.highlightCounts[V.count];0===Y?R().warn("Removing non-existing highlight."):
1<Y?(V.highlightCounts[T]=Y-1,V.highlightCounts[V.count]=ha-1):(V.highlightCounts[T]=0,V.highlightsDirty(),this._notifyDirty(),1===ha?V.highlightCounts=null:V.highlightCounts[V.count]=ha-1)}}clearHighlights(V){V=V.components;null!=V.highlightCounts&&(V.highlightCounts=null,V.highlightsDirty(),this._notifyDirty())}getObjectGPUMemoryUsage(V){return V.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(V,T){var Y=this._renderManager.rctx;const ha=V.geometry;
var ba=ha.vertices.layoutParameters;const U=P.BufferObject.createVertex(Y,M.Usage.STATIC_DRAW,ha.vertices.data),Z=ha.indices?P.BufferObject.createIndex(Y,M.Usage.STATIC_DRAW,ha.indices):null,ca=v.glLayout(A.createVertexBufferLayout(ba)),ea=new Uint16Array(ha.vertices.count);for(let ia=0;ia<T.count;ia++){var da=T.offsets[ia];const ka=T.offsets[ia+1],fa=T.materialDataIndices[ia];if(null!=ha.indices)for(;da<ka;da++)ea[ha.indices[da]]=fa;else for(;da<ka;da++)ea[da]=fa}T=P.BufferObject.createVertex(Y,
M.Usage.STATIC_DRAW,ea.buffer);V=new C.ComponentMaterial(V.transform,V.toMapSpace);Y=new K.VertexArrayObject(Y,D.attributeLocations,{data:ca,componentIndices:W},{data:U,componentIndices:T},Z);ba=new y.RenderGeometry(Y,M.PrimitiveType.TRIANGLES,ba,null!=Z);return new x.Renderable(V,ba,{cameraDepthSquared:.5,gpuMemoryEstimate:U.usedMemory+T.usedMemory+(null!=Z?Z.usedMemory:0)})}_notifyDirty(){this._renderManager.notifyDirty()}}const W=v.glLayout(m.newLayout().u16(E.VertexAttribute.COMPONENTINDEX)),
S=f.create();a.ComponentObjectCollection=Q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/ComponentData":function(){define(["./IndexRange/ComponentRangeRunLengthEncoded"],function(a){function b(l,p,k){const h=[],f=[];let c=k.length,e=k.length;p.forEachComponent(g=>{0<l[g]?(c!==g-1&&(h.length&&h.push(k[c+1]-h[h.length-1]),h.push(k[g])),c=g):(e!==g-1&&(f.length&&f.push(k[e+1]-f[f.length-1]),f.push(k[g])),e=g);return!0});h.length&&h.push(k[c+
1]-h[h.length-1]);f.length&&f.push(k[e+1]-f[f.length-1]);return{highlightRanges:h,defaultRanges:f}}class q{constructor(l,p){this.offsets=p;this.cachedDefaultRanges=this.cachedHighlightRanges=this.cachedGeometryRanges=this.verticalOffsets=this.highlightCounts=this.pickability=null;p=this.count;this.visibility=new a.ComponentRangeRunLengthEncoded(p);this.materialDataBuffer=l.getBuffer(p);this.materialDataIndices=new Uint16Array(p);for(l=0;l<p;l++)this.materialDataIndices[l]=this.materialDataBuffer.acquireIndex()}destroy(){for(let l=
0;l<this.count;l++)this.materialDataBuffer.releaseIndex(this.materialDataIndices[l])}get count(){return this.offsets.length-1}get geometryRanges(){null==this.cachedGeometryRanges&&(this.cachedGeometryRanges=this.visibility.computeOffsetRanges(this.offsets));return this.cachedGeometryRanges}get highlightRanges(){if(null==this.highlightCounts)return null;this._updateCachedHighlightRanges();return this.cachedHighlightRanges}get defaultShadowMapRanges(){if(null==this.highlightCounts)return this.geometryRanges;
this._updateCachedHighlightRanges();return this.cachedDefaultRanges}highlightsDirty(){this.cachedDefaultRanges=this.cachedHighlightRanges=null}visibilityDirty(){this.cachedGeometryRanges=null;this.highlightsDirty()}_updateCachedHighlightRanges(){if((null==this.cachedHighlightRanges||null==this.cachedDefaultRanges)&&null!=this.highlightCounts){const {highlightRanges:l,defaultRanges:p}=b(this.highlightCounts,this.visibility,this.offsets);this.cachedHighlightRanges=l;this.cachedDefaultRanges=p}}}return q})},
"esri/views/3d/webgl-engine/collections/Component/IndexRange/ComponentRangeRunLengthEncoded":function(){define(["exports"],function(a){class b{constructor(q){this._totalCount=q;this._componentCountCache=-1;this._indexRanges=[0,q]}allVisible(){return this.componentCount===this._totalCount}allInvisible(){return 0===this._indexRanges.length}isVisible(q){if(0>q||q>=this._totalCount)return!1;if(this.allVisible())return!0;const l=this._indexRanges;let p=0,k=l.length/2;if(q<l[2*p]||q>l[2*k]+l[2*k+1])return!1;
for(;0<k-p;){const h=Math.floor(.5*(p+k)),f=l[2*h];if(q<f){if(1===k-p)break;k=h}else{if(q<f+l[2*h+1])return!0;if(1===k-p)break;p=h+1}}return!1}get componentCount(){if(-1===this._componentCountCache){const q=this._indexRanges;let l=0;for(let p=0;p<q.length;p+=2)l+=q[p+1];this._componentCountCache=l}return this._componentCountCache}reset(q){if("all"===q||q.length===this._totalCount)this._indexRanges=[0,this._totalCount];else{{const k=[];if(0!==q.length){var l=q[0],p=1;for(let h=1;h<q.length;h++){const f=
q[h];l+p===f?p+=1:(k.push(l),k.push(p),l=f,p=1)}k.push(l);k.push(p)}q=k}this._indexRanges=q}this._componentCountCache=-1}forEachComponent(q){const l=this._indexRanges;for(let k=0;k<l.length;k+=2){var p=l[k];const h=p+l[k+1];for(;p<h;p++)if(!q(p))return!1}return!0}forEachComponentRange(q){const l=this._indexRanges;for(let p=0;p<l.length;p+=2){const k=l[p];if(!q(k,k+l[p+1]))return!1}return!0}computeOffsetRanges(q){const l=Array(this._indexRanges.length),p=this._indexRanges;for(let h=0;h<p.length;h+=
2){var k=p[h];const f=q[k];k=q[k+p[h+1]];l[h]=f;l[h+1]=k-f}return l}}a.ComponentRangeRunLengthEncoded=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/ComponentObject":function(){define(["exports","../../../../../core/maybe"],function(a,b){class q{constructor(l,p,k,h,f,c){this.transform=l;this.toMapSpace=p;this.obb=k;this.components=h;this.renderable=f;this.intersectionGeometry=c;this.visible=!1;this.offsetObb=null}destroy(){this.intersectionGeometry=
b.destroyMaybe(this.intersectionGeometry);this.renderable=b.destroyMaybe(this.renderable);this.components=b.destroyMaybe(this.components)}}a.ComponentObject=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/IntersectionGeometry":function(){define("exports ../../../../../core/libs/gl-matrix-2/math/mat3 ../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../geometry/support/FloatArray ../../../../../geometry/support/Indices ../../../../ViewingMode ./ComponentObjectElevationAgnosticComponentBVH".split(" "),
function(a,b,q,l,p,k,h,f,c){class e{constructor(m,r,n){this.viewingMode=m;this.positionData=r;this._components=n;this.componentVerticalOffsets=this.verticalOffset=null;this._planetCenter=p.create();this._componentBvh=null;this._aabb=[0,0,0,0,0,0];this._indices=r.indices?h.compactIndices(r.indices):h.getContinuousIndexArray(r.positions.length/3);this._positions=r.positions}destroy(){this._componentBvh=this._perComponentAabbs=this._indices=this._positions=null}getComponentAabb(m,r){const n=this._ensureComponentAabbs();
m*=6;r[0]=n[m];r[1]=n[m+1];r[2]=n[m+2];r[3]=n[m+3];r[4]=n[m+4];r[5]=n[m+5];return r}getComponentAabbs(){return this._ensureComponentAabbs()}_ensureComponentAabbs(){this._perComponentAabbs||(this._perComponentAabbs=this._computePerComponentAabbs());return this._perComponentAabbs}getComponentPositions(m,r){r.indices=this._indices;r.data=this._positions;r.stride=3;r.startIndex=this._components.offsets[m];r.endIndex=this._components.offsets[m+1]}intersect(m,r,n,u,x,y,z,A){this.verticalOffset=u;this.componentVerticalOffsets=
x;const {position:B}=y;m=l.sub(g,m,B);r=l.sub(d,r,B);y=b.invert(t,y.rotationScale);l.transformMat3(m,m,y);l.transformMat3(r,r,y);const C=b.transpose(v,y);if(this.viewingMode===f.ViewingMode.Global){const D=this._planetCenter;l.negate(D,B);l.transformMat3(D,D,y)}this._intersectComponents(m,r,x,u,(D,F,H,N)=>{A(H,D,N?l.transformMat3(w,N,C):null,F)},n,z)}_computePerComponentAabbs(){var m=this._aabb;const r=.5*(m[0]+m[3]),n=.5*(m[1]+m[4]);m=.5*(m[2]+m[5]);const u=this._components.count,x=k.newFloatArray(6*
u),y=this._indices,z=this._positions,A=this._components.offsets;let B=0,C=Infinity,D=Infinity,F=Infinity,H=-Infinity,N=-Infinity,E=-Infinity;for(let O=0;O<u;O++){var G=A[O];const L=A[O+1];let P=Infinity,M=Infinity,K=Infinity,J=-Infinity,R=-Infinity,Q=-Infinity;if(G<L)for(;G<L;G++){var I=3*y[G];const W=z[I],S=z[I+1];I=z[I+2];P=Math.min(P,W);M=Math.min(M,S);K=Math.min(K,I);J=Math.max(J,W);R=Math.max(R,S);Q=Math.max(Q,I)}else P=r,M=n,K=m,J=r,R=n,Q=m;x[B++]=P;x[B++]=M;x[B++]=K;x[B++]=J;x[B++]=R;x[B++]=
Q;C=Math.min(C,P);D=Math.min(D,M);F=Math.min(F,K);H=Math.max(H,J);N=Math.max(N,R);E=Math.max(E,Q)}this._aabb[0]=C;this._aabb[1]=D;this._aabb[2]=F;this._aabb[3]=H;this._aabb[4]=N;this._aabb[5]=E;return x}_intersectComponents(m,r,n,u,x,y,z){let A=this._componentBvh;null==A&&(this._componentBvh=A=new c.ComponentObjectElevationAgnosticComponentBVH(this._positions,3,this._indices,this._components,this._ensureComponentAabbs(),this.geometryMinZ,this.planetCenterZ,this.localMode));A.intersectRay(m,r,n,u,
x,y,z)}get geometryMinZ(){return this._aabb[2]}get planetCenterZ(){return this._planetCenter[2]}get numTriangles(){return this._indices.length/3}get localMode(){return this.viewingMode===f.ViewingMode.Local}get positions(){return this._positions}get indices(){return this._indices}get aabb(){this._ensureComponentAabbs();return this._aabb}}const g=p.create(),d=p.create(),t=q.create(),w=p.create(),v=q.create();a.IntersectionGeometry=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentBVH":function(){define("exports ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../geometry/support/aaBoundingBox ./ComponentObjectElevationAgnosticComponentGeometryBVH ./ElevationAgnosticBVH ../../lib/ComponentUtils ../../lib/RayIntersections".split(" "),
function(a,b,q,l,p,k,h,f){class c{constructor(r,n,u,x,y,z,A,B){this.vertexData=r;this.vertexStride=n;this.indexData=u;this._components=x;this._componentAabbs3D=y;this.geometryMinZ=z;this.planetCenterZ=A;this.localMode=B;this.maxBspNodeDepth=6;this.minElementCountForBVH=10;this.minBspNodeElementCount=3;this._ray0=t;this._ray1=w;this._invDir=q.create();this._verticalOffset=this._componentVerticalOffsets=null;this._tolerance=0;this._intersectionOptions=m;this._callback=v;this.rayDirectionC=q.create();
this._componentIndexMap=null;this._bvh=new k.ElevationAgnosticBVH(x.count,this);this.componentIntersectionData=Array(x.count)}get numComponents(){return this._components.count}get minZGlobal(){return this.geometryMinZ-this.planetCenterZ}getAabbs2D(){return this.localMode?this.getAabbs2DLocal():this.getAabbs2DGlobal()}getAabbs2DGlobal(){const {numComponents:r,planetCenterZ:n,minZGlobal:u}=this,x=new Float64Array(4*r),y=this._componentAabbs3D;for(let D=0;D<r;++D){var z=6*D;const F=y[z+0];var A=y[z+
1],B=y[z+3],C=y[z+4];const H=u/(y[z+2]-n);z=u/(y[z+5]-n);A=Math.min(A*H,A*z);B=Math.max(B*H,B*z);C=Math.max(C*H,C*z);const N=4*D;x[N+0]=Math.min(F*H,F*z);x[N+1]=A;x[N+2]=B;x[N+3]=C}return x}getAabbs2DLocal(){const {numComponents:r}=this,n=new Float64Array(4*r),u=this._componentAabbs3D;for(let x=0;x<r;++x){const y=6*x,z=u[y+1],A=u[y+3],B=u[y+4],C=4*x;n[C+0]=u[y+0];n[C+1]=z;n[C+2]=A;n[C+3]=B}return n}intersectRay(r,n,u,x,y,z,A){const {isVerticalRay:B}=A;this._ray0=r;this._ray1=n;this._componentVerticalOffsets=
u;this._verticalOffset=x;this._tolerance=z;this._intersectionOptions=A;this._componentIndexMap=this._bvh.elementIndexMap;f.computeInvDir(r,n,this._invDir);this._callback=y;this._bvh.intersectRay(r,n,B);this._callback=v}intersectRange(r,n){const u=this._componentIndexMap;var x=this._components;const y=x.pickability;for(x=x.visibility;r<n;++r){const z=u?u[r]:r;h.getVisibility(y,z)&&x.isVisible(z)&&this._intersectComponent(z)}}getComponentTriangleCount(r){const n=this._components.offsets;return n[r+
1]/3-n[r]/3}getComponentAabb3D(r,n){const u=this._componentAabbs3D;r*=6;n[0]=u[r];n[1]=u[r+1];n[2]=u[r+2];n[3]=u[r+3];n[4]=u[r+4];n[5]=u[r+5];return n}_intersectComponent(r){if(h.getVisibility(this._components.pickability,r)){var n=this.getComponentAabb3D(r,e),u=!1,{localMode:x,_componentVerticalOffsets:y,_verticalOffset:z,_ray0:A,_ray1:B,_invDir:C,planetCenterZ:D,_tolerance:F,rayDirectionC:H,componentIntersectionData:N}=this,{isVerticalRay:E}=this._intersectionOptions,G=this._components.offsets,
I=b.copy(g,A),O=b.copy(d,B),L=y?.[r]??0,P=L+(z?.offset??0);0!==P&&(x?(I[2]=A[2]-P,O[2]=B[2]-P,u=!0):null!=z&&(z.componentOffset=L));null==z||u||0===P||z.applyToAabb(n);if(f.intersectAabbInvDir(n,I,C,F)){b.sub(H,O,I);n=G[r]/3;G=G[r+1]/3;L=(W,S,V)=>{this._callback(W,S,r,V)};var {vertexData:M,vertexStride:K,indexData:J,_intersectionOptions:R}=this,{normalRequired:Q}=R;if(40<G-n){let W=N[r];null==W&&(W=new p.ComponentObjectElevationAgnosticComponentGeometryBVH(r,M,K,J,n,G,this.geometryMinZ,D,x),N[r]=
W);W.intersectRay(I,O,E,u?0:P,L,Q)}else p.intersectTriangleRangeForComponent(I,H,n,G,J,M,K,u?0:P,D,Q,L)}}}}const e=l.create(),g=q.create(),d=q.create(),t=q.create(),w=q.create(),v=()=>{},m=new f.MeshIntersectionOptions;a.ComponentObjectElevationAgnosticComponentBVH=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH":function(){define("exports ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ./ElevationAgnosticBVH ../../lib/RayIntersections ../../lib/triangleIntersectionUtils".split(" "),
function(a,b,q,l,p,k){function h(e,g,d,t,w,v,m,r,n,u,x,y=null,z=0){0!==r?p.intersectRayTrianglesWithVerticalOffsetENUGlobal(e,g,d,t,w,v,m,r,n,u,x,y,z):p.intersectRayTriangles(e,g,d,t,w,v,m,u,x,y,z)}function f(){}class c{constructor(e,g,d,t,w,v,m,r,n){this.componentIndex=e;this.vertexData=g;this.vertexStride=d;this.indexData=t;this.startTriangleNumber=w;this.endTriangleNumber=v;this.geometryMinZ=m;this.planetCenterZ=r;this.localMode=n;this.maxBspNodeDepth=8;this.minElementCountForBVH=20;this.minBspNodeElementCount=
10;this.rayDirection=q.create();this.ray0=q.create();this.isVerticalRay=!1;this._triangleHitCallback=f;this.totalElevationOffset=0;this.normalRequired=!1;this._bvh=new l.ElevationAgnosticBVH(v-w,this)}getAabbs2D(){return this.localMode?k.generateTriangleAabbsLocal(this.startTriangleNumber,this.endTriangleNumber,this.indexData,this.vertexData,this.vertexStride):k.generateTriangleAabbsGlobal(this.startTriangleNumber,this.endTriangleNumber,this.indexData,this.vertexData,this.vertexStride,this.geometryMinZ,
this.planetCenterZ)}get numTriangles(){return this.endTriangleNumber-this.startTriangleNumber}intersectRay(e,g,d,t,w,v){b.copy(this.ray0,e);b.sub(this.rayDirection,g,e);this.isVerticalRay=d;this.totalElevationOffset=t;this.normalRequired=v;this._triangleHitCallback=w;this._bvh.intersectRay(e,g,d);this._triangleHitCallback=f}intersectRange(e,g){h(this.ray0,this.rayDirection,e,g,this.indexData,this.vertexData,this.vertexStride,this.totalElevationOffset,this.planetCenterZ,this.normalRequired,this._triangleHitCallback,
this._bvh.elementIndexMap,this.startTriangleNumber)}getTriangleElevationOffset(e){return this.totalElevationOffset}}a.ComponentObjectElevationAgnosticComponentGeometryBVH=c;a.intersectTriangleRangeForComponent=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH":function(){define(["exports","../../../../../core/mathUtils","../../../../../core/libs/gl-matrix-2/factories/vec3f64","../../lib/triangleIntersectionUtils"],
function(a,b,q,l){function p(f,c,e,g){f*=4;const d=g[f+0+c];return g[f+2+c]<e?-1:d>e?1:0}class k{constructor(f,c){this.elementCount=f;this.model=c;this._elementIndexMap=null;this._bspNodes=[];this._generatedBVH=!1;this.localMode=c.localMode;this.planetCenterZ=c.planetCenterZ;this.geometryMinZ=c.geometryMinZ;this.planetCenter=q.fromValues(0,0,this.planetCenterZ);this.maxBspNodeDepth=c.maxBspNodeDepth??8;this.minElementCountForBVH=c.minElementCountForBVH??15;this.minBspNodeElementCount=c.minBspNodeElementCount??
5}get elementIndexMap(){this._ensureBVH();return this._elementIndexMap}get _skipBVH(){return this.elementCount<this.minElementCountForBVH||this.geometryMinZ<.5*this.planetCenterZ}_ensureBVH(){this._generatedBVH||this._skipBVH||0===this._bspNodes.length&&this._generateBsp()}intersectRay(f,c,e){1>this.elementCount||(this._skipBVH?this._intersectRayWithoutBVH(e):this._intersectRayWithBVH(f,c,e))}_intersectRayWithoutBVH(f){this._intersectRange(0,this.elementCount)}_intersectRange(f,c){this.model.intersectRange(f,
c)}_intersectRayWithBVH(f,c,e){this._ensureBVH();e?this._intersectGeometryWithBVHVerticalRay(f):this._intersectGeometryWithBVHGeneralRay(f,c)}_intersectGeometryWithBVHVerticalRay(f){let c=f[0];var e=f[1];if(!this.localMode){const {geometryMinZ:d,planetCenterZ:t}=this;e=(d-t)/(f[2]-t);c=f[0]*e;e*=f[1]}({_bspNodes:f}=this);for(var g=0;0<=g;){g=f[g];const {d,dim:t,minIndexIndex:w,minMidIndexIndex:v,maxMidIndexIndex:m,maxIndexIndex:r,aabb2D:n}=g;if(c<n[0]||c>n[2]||e<n[1]||e>n[3])break;if(-1===t||-1===
g.child0&&-1===g.child1){this._intersectRange(w,r);break}else{this._intersectRange(v,m);const u=(0===t?c:e)-d;if(0>u){if(-1===g.child0){this._intersectRange(w,v);break}g=g.child0}else if(0<u){if(-1===g.child1){this._intersectRange(m,r);break}g=g.child1}else break}}}_intersectGeometryWithBVHGeneralRay(f,c){var e=f[0],g=f[1],d=c[0],t=c[1],{geometryMinZ:w}=this;if(!this.localMode){t=0;var v=1;e=Math.min(.5*this.planetCenterZ,w);g=f[2];d=c[2];if(g<e&&d<e)return;g<e&&(t=(e-g)/(d-g));d<e&&(v=(e-g)/(d-g));
if(t>v)return;e=(1-t)*f[0]+t*c[0];g=(1-t)*f[1]+t*c[1];var m=(1-t)*f[2]+t*c[2];d=(1-v)*f[0]+v*c[0];t=(1-v)*f[1]+v*c[1];f=(1-v)*f[2]+v*c[2];({planetCenterZ:c}=this);w-=c;v=w/(m-c);e*=v;g*=v;w/=f-c;d*=w;t*=w}w=d-e;f=t-g;c=this._bspNodes;let r=1;({aabb2D:t}=c[0]);d=(z,A,B,C)=>{if(Math.abs(A)<1E-5*Math.max(C-B,1))return!1;const D=0<A;B=D?C:B;C=z+r*A;return(D?C<B:C>B)?(r=Math.max((B-z)/A,r),!0):!1};Math.abs(w)>=Math.abs(f)?d(e,w,t[0],t[2])||d(g,f,t[1],t[3]):d(g,f,t[1],t[3])||d(e,w,t[0],t[2]);t=[0,0,r];
for(d=0;d<t.length;){var n=t[d];v=t[d+1];m=t[d+2];d+=3;if(v>m)continue;n=c[n];const {minIndexIndex:z,maxIndexIndex:A}=n,{child0:B,child1:C,minMidIndexIndex:D,maxMidIndexIndex:F,aabb2D:H,d:N,dim:E}=n;var u=e+v*w,x=e+m*w;n=Math.min(u,x);u=Math.max(u,x);var y=H[0];x=H[2];if(!(u<y||x<n||(n<y&&(n=(y-e)/w,0<w?v=Math.max(v,n):m=Math.min(m,n)),x<u&&(n=(x-e)/w,0<w?m=Math.min(m,n):v=Math.max(v,n)),u=g+v*f,x=g+m*f,n=Math.min(u,x),u=Math.max(u,x),y=H[1],x=H[3],u<y||x<n)))if(n<y&&(n=(y-g)/f,0<f?v=Math.max(v,n):
m=Math.min(m,n)),x<u&&(n=(x-g)/f,0<f?m=Math.min(m,n):v=Math.max(v,n)),-1===B&&-1===C)this._intersectRange(z,A);else{x=0===E?e:g;n=0===E?w:f;y=x+v*n;const G=x+m*n;u=Math.min(y,G);y=Math.max(y,G);x=b.clamp((N-x)/n,0,r);z<D&&u<=N&&(-1!==B?(t.push(B),t.push(0<=n?v:Math.max(v,x)),t.push(0<=n?Math.min(m,x):m)):this._intersectRange(z,D));this._intersectRange(D,F);F<A&&N<=y&&(-1!==C?(t.push(C),t.push(0<=n?Math.max(v,x):v),t.push(0<=n?m:Math.min(m,x))):this._intersectRange(F,A))}}}_generateBsp(){var {elementCount:f}=
this;if(!(1>f)){var c=l.createUintArray(f,f);this._elementIndexMap=c;for(var e=0;e<f;++e)c[e]=e;var g=this.model.getAabbs2D();e=0;var d=this._bspNodes;d.length=0;var {localMode:t}=this,w=!1;if(!t){const {planetCenterZ:x,geometryMinZ:y}=this;w=0<=x||y<.5*x}var v=[],m=(x,y,z,A,B)=>{v.push(x);v.push(y);v.push(z);v.push(0>A?-1:(B?0:1)+2*A)},{maxBspNodeDepth:r,minBspNodeElementCount:n}=this,u=(x,y,z,A,B)=>{const C=d.length;if(!(0<C&&(w||z>=r||y-x<n))){var D=[0,0,0,0],F=Infinity,H=Infinity,N=-Infinity,
E=-Infinity;for(var G=x;G<y;++G){const M=4*c[G];F=Math.min(F,g[M+0]);H=Math.min(H,g[M+1]);N=Math.max(N,g[M+2]);E=Math.max(E,g[M+3])}D[0]=F;D[1]=H;D[2]=N;D[3]=E;t?(F=D[0],H=D[1],N=D[2],E=D[3],N-F>=E-H?(H=.5*(F+N),F=0):(H=.5*(H+E),F=1),F={d:H,dim:F}):(H=D[0],N=D[1],E=D[2],G=D[3],E-H>=G-N?(F=0,H=.5*(H+E)):(F=1,H=.5*(N+G)),F={dim:F,d:H});var {d:I,dim:O}=F;H=x;for(F=y;H<F;)N=c[H],0>p(N,O,I,g)?++H:(--F,c[H]=c[F],c[F]=N);F=H;for(N=y;H<N;)E=c[N-1],0<p(E,O,I,g)?--N:(c[N-1]=c[H],c[H]=E,++H);var {rangeMidStart:L,
rangeMidEnd:P}={rangeMidStart:F,rangeMidEnd:N};H=z===r-1;F=!H&&L>=x+n;H=!H&&y>=P+n;if(F||H||0===C)D=new h(x,L,P,y,O,I,D),F&&m(x,L,z+1,C,!0),H&&m(P,y,z+1,C,!1),d.push(D),-1!==A&&(x=d[A],B?x.child0=C:x.child1=C)}};for(m(0,f,0,-1,!1);e<v.length;){f=v[e];const x=v[e+1],y=v[e+2],z=v[e+3];e+=4;const A=z>>1;u(f,x,y,A,0===z-(A<<1))}this._generatedBVH=!0}}}class h{constructor(f,c,e,g,d,t,w){this.minIndexIndex=f;this.minMidIndexIndex=c;this.maxMidIndexIndex=e;this.maxIndexIndex=g;this.dim=d;this.d=t;this.aabb2D=
w;this.child1=this.child0=-1}}a.ElevationAgnosticBVH=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/triangleIntersectionUtils":function(){define(["exports","../../../../chunks/vec32","../../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b,q){function l(w,v,m){w=b.dot(w,v)-m;return 1E-5>=Math.abs(w)}function p(w,v,m){const r=q.create(),n=q.create();b.sub(n,v,w);v=q.create();b.sub(v,m,w);b.cross(r,n,v);b.normalize(r,r);return r}function k(w,
v,m,r){const n=[v,m,r];v=p(v,m,r);m=b.dot(n[0],v);if(!l(w,v,m))return!1;for(w=0;3>w;++w){v=n[w];var u=n[(w+1)%3];m=n[(w+2)%3];r=q.create();b.sub(r,u,v);b.normalize(r,r);u=q.create();b.sub(u,m,v);const x=b.dot(u,r);u=q.create();b.scaleAndAdd(u,v,r,x);r=q.create();b.sub(r,m,u);b.normalize(r,r);v=b.dot(v,r);if(!(-1E-4<=b.dot(r,u)-v))return!1}return!0}function h(w){const v=q.create();b.sub(v,w[1],w[0]);b.normalize(v,v);const m=q.create();b.sub(m,w[2],w[0]);b.normalize(m,m);w=q.create();b.cross(w,v,m);
b.normalize(w,w);return w}function f(w,v,m){const r=q.create();b.sub(r,m,v);b.normalize(r,r);m=q.create();b.sub(m,w,v);w=b.dot(m,r);m=q.create();b.scaleAndAdd(m,v,r,w);return m}function c(w,v,m){const r=q.create();b.sub(r,m,v);const n=b.len(r);b.normalize(r,r);var u=q.create();b.sub(u,w,v);u=b.dot(u,r);if(0>u)return b.dist(v,w);if(u>n)return b.dist(m,w);m=q.create();b.scaleAndAdd(m,v,r,u);return b.dist(m,w)}function e(w,v,m){return b.dot(w,v)-m}function g(w,v,m){const r=q.create(),n=q.create();b.sub(n,
v,w);v=q.create();b.sub(v,m,w);b.cross(r,n,v);b.normalize(r,r);w=b.dot(r,w);return{normal:r,d:w}}function d(w,v,m,r){const {normal:n,d:u}=g(v,m,r),x=e(w,n,u),y=q.create();b.scaleAndAdd(y,w,n,-x);return k(y,v,m,r)?x:Math.min(c(w,v,m),c(w,m,r),c(w,r,v))}function t(w){return 128>w?Uint8Array:32768>w?Uint16Array:-2147483648>w?Uint32Array:Array}a.binarySearchSortedArray=function(w,v){var m=w.length;if(0===m)return 0;if(v<w[0])return-1;if(v>=w[m-1])return m;let r=0;for(--m;1<m-r;){const n=Math.floor(.5*
(m+r));v>=w[n]?r=n:m=n}return r};a.calculateNormalFromVertices=h;a.createUintArray=function(w,v){return new (t(w))(v)};a.distancePointLine=function(w,v,m){v=f(w,v,m);return b.dist(v,w)};a.distancePointPlane=e;a.distancePointSegment=c;a.distancePointTriangle=d;a.elevationAlignVertexGlobal=function(w,v,m,r){const [n,u,x]=r??w;m=x-m;v/=Math.sqrt(n*n+u*u+m*m);w[0]+=n*v;w[1]+=u*v;w[2]+=m*v};a.elevationAlignVertexLocal=function(w,v){w[2]+=v};a.generateTriangleAabbsGlobal=function(w,v,m,r,n,u,x){u-=x;v-=
w;const y=new Float64Array(4*v);for(let H=0;H<v;++H){var z=3*(H+w),A=n*m[z+0],B=u/(r[A+2]-x);const N=r[A+0]*B;A=r[A+1]*B;var C=n*m[z+1],D=u/(r[C+2]-x);B=r[C+0]*D;C=r[C+1]*D;D=n*m[z+2];var F=u/(r[D+2]-x);z=r[D+0]*F;D=r[D+1]*F;F=4*H;y[F+0]=Math.min(N,B,z);y[F+1]=Math.min(A,C,D);y[F+2]=Math.max(N,B,z);y[F+3]=Math.max(A,C,D)}return y};a.generateTriangleAabbsLocal=function(w,v,m,r,n){v-=w;const u=new Float64Array(4*v);for(let B=0;B<v;++B){var x=3*(B+w),y=n*m[x+0];const C=r[y+0];y=r[y+1];var z=n*m[x+1];
const D=r[z+0];z=r[z+1];var A=n*m[x+2];x=r[A+0];A=r[A+1];const F=4*B;u[F+0]=Math.min(C,D,x);u[F+1]=Math.min(y,z,A);u[F+2]=Math.max(C,D,x);u[F+3]=Math.max(y,z,A)}return u};a.getConstructorForValueCount=t;a.getNearestPointOnLine=f;a.getRayTriangleIntersectionDistance=function(w,v,m){const r=q.create();b.sub(r,v,w);var n=h(m);const u=b.dot(n,m[0]),x=b.dot(n,w)-u;v=b.dot(n,v)-u;if(0<x*v)return Infinity;n=q.create();b.scaleAndAdd(n,w,r,(0-x)/(v-x));return k(n,m[0],m[1],m[2])?0:d(n,m[0],m[1],m[2])};a.getTriangleNormal=
p;a.getTrianglePlane=g;a.isPointInPlane=l;a.isPointInTriangle=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ComponentUtils":function(){define(["exports","../../../../core/arrayUtils"],function(a,b){function q(l=!0){return{isVisibleBit:!l,data:new Uint32Array(0)}}a.defaultVisibilities=q;a.getVisibility=function(l,p){if(null==l)return!0;const {isVisibleBit:k,data:h}=l,f=8*h.BYTES_PER_ELEMENT;return p<h.length*f?(l=p/f|0,0!==(h[l]&1<<p-l*f)===k):!l.isVisibleBit};
a.updateVisibilityWithCount=function(l,p,k,h){if(k>=p)return l;null==l&&(l=q());let f=l.data;const c=8*f.BYTES_PER_ELEMENT,e=k/c|0,g=k-c*e,d=f;h=h===l.isVisibleBit;k<d.length*c||!h||(k=Math.max(e+1,Math.ceil(d.length*b.reallocGrowthFactor)),k=Math.min(k,((p-1)/c|0)+1),f=new Uint32Array(k),f.set(d));e<f.length&&(f[e]=f[e]&~(1<<g)|(h?1:0)<<g);l.data=f;return l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/Renderable":function(){define(["exports"],
function(a){class b{constructor(q,l,p){this.material=q;this.geometry=l;this.meta=p}destroy(){this.material.dispose();this.geometry.dispose()}}a.Renderable=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/RenderGeometry":function(){define(["exports"],function(a){class b{constructor(q,l,p,k){this.vao=q;this.primitiveType=l;this.parameters=p;this.indexed=k}dispose(){this.vao.dispose()}}a.RenderGeometry=b;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/RenderSubmitSystem":function(){define(["exports","./DepthRange"],function(a,b){class q{constructor(l){this._objects=l}submit(l,p){this._objects.preSubmit(p);this._objects.visibleObjects.forAll(k=>k.renderable.material.submit(l,p,k))}queryShadowCasterDepthRange(l){return this._objects.visibleObjects.length?b.computeDepthRange(l,this._objects.visibleObjects):null}}a.RenderSubmitSystem=q;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/DepthRange":function(){define("exports ../../../../../core/PooledArray ../../../../../core/libs/gl-matrix-2/math/mat3 ../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../core/libs/gl-matrix-2/math/quat ../../../../../core/libs/gl-matrix-2/factories/quatf64 ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../geometry/support/plane ../../lib/depthRange".split(" "),function(a,
b,q,l,p,k,h,f,c,e){function g(H,N,E){return h.set(H,N.data[E],N.data[E+1],N.data[E+2])}function d(H,N){H.push(N[0]);H.push(N[1]);H.push(N[2])}function t(H,N,E,G){p.conjugate(z,H.quaternion);h.sub(A,N,H.center);h.transformQuat(A,A,z);N=H.halfSize;const I=8*((A[0]<-N[0]?-1:A[0]>N[0]?1:0)+3*(A[1]<-N[1]?-1:A[1]>N[1]?1:0)+9*(A[2]<-N[2]?-1:A[2]>N[2]?1:0)+13);N=x[I];if(0===N)return N;q.fromQuat(y,H.quaternion);q.scale(y,y,H.halfSize);const O=(L,P)=>{P=x[I+P+1];h.set(L,((P&1)<<1)-1,(P&2)-1,((P&4)>>1)-1);
h.transformMat3(L,L,y);return h.add(L,H.center,L)};E.length=0;d(E,O(B,0));d(E,O(C,1));d(E,O(A,2));d(E,O(D,3));G(E);if(1===N)return N;E.length=0;d(E,B);d(E,D);d(E,O(A,4));d(E,O(F,5));G(E);if(2===N)return N;E.length=0;d(E,B);d(E,F);d(E,O(A,6));d(E,C);G(E);return N}const w=new b({allocator:H=>H||{near:Infinity,far:-Infinity,mask:0,object:null},deallocator:H=>{H.object=null;return H}}),v=e.empty(),m=f.create(),r=f.create(),n=new b({deallocator:null}),u=new b({deallocator:null}),x=(()=>{const H=Array(216);
let N=0;const E=G=>{for(let I=0;I<G.length;I++)H[N+I]=G[I];N+=8};E([3,0,6,2,3,1,5,4]);E([2,0,2,3,1,5,4,0]);E([3,1,0,2,3,7,5,4]);E([2,0,1,3,2,6,4,0]);E([1,0,1,3,2,0,0,0]);E([2,1,5,7,3,2,0,0]);E([3,2,0,1,3,7,6,4]);E([2,2,0,1,3,7,6,0]);E([3,3,0,1,5,7,6,2]);E([2,0,1,5,4,6,2,0]);E([1,0,1,5,4,0,0,0]);E([2,1,3,7,5,4,0,0]);E([1,0,2,6,4,0,0,0]);E([0,0,0,0,0,0,0,0]);E([1,1,3,7,5,0,0,0]);E([2,2,3,7,6,4,0,0]);E([1,2,3,7,6,0,0,0]);E([2,3,1,5,7,6,2,0]);E([3,4,0,1,5,7,6,2]);E([2,5,7,6,4,0,1,0]);E([3,5,0,1,3,7,6,
4]);E([2,4,5,7,6,2,0,0]);E([1,4,5,7,6,0,0,0]);E([2,5,1,3,7,6,4,0]);E([3,6,0,2,3,7,5,4]);E([2,6,2,3,7,5,4,0]);E([3,7,6,2,3,1,5,4]);return H})(),y=l.create(),z=k.create(),A=f.create(),B=f.create(),C=f.create(),D=f.create(),F=f.create();a.computeDepthRange=function(H,N){const E=e.empty(),{eye:G,frustum:I,viewForward:O}=H;N.forAll(L=>{var P=null!=L.offsetObb?L.offsetObb:L.obb;const M=h.dot(h.sub(A,P.center,G),O),K=P.projectedRadius(O);if(!e.within(E,M-K)||!e.within(E,M+K)){a:{var J=0;for(let R=0;4>R;R++){const Q=
P.intersectPlane(I[R]);if(0<Q){P=-1;break a}0===Q&&(J|=1<<R)}P=J}-1!==P&&(0===P?(v.far=M+K,v.near=M-K,e.union(E,v)):(J=w.pushNew(),J.near=M-K,J.far=M+K,J.mask=P,J.object=L))}});for(H=0;H<w.length;H++){const L=w.data[H];e.within(E,L.near)&&e.within(E,L.far)||(v.far=L.far,v.near=Infinity,0===t(null!=L.object.offsetObb?L.object.offsetObb:L.object.obb,G,n,P=>{var M=u;for(var K=0;4>K&&0<P.length;K++){if(0===(L.mask&1<<K))continue;var J=I[K],R=P,Q=M;Q.length=0;const W=R.length-3;g(m,R,W);const S=c.signedDistance(J,
m);0>=S&&(Q.push(m[0]),Q.push(m[1]),Q.push(m[2]));let V=0,T=S;for(V;V<W;V+=3){g(r,R,V);const Y=c.signedDistance(J,r);0>T*Y&&(h.lerp(m,r,m,Y/(Y-T)),d(Q,m));0>=Y&&d(Q,r);T=Y;h.copy(m,r)}0>T*S&&(g(r,R,W),h.lerp(m,r,m,S/(S-T)),d(Q,m));J=P;P=M;M=J}for(M=0;M<P.length;M+=3)h.set(m,P.data[M],P.data[M+1],P.data[M+2]),K=h.dot(h.sub(m,m,G),O),v.near=Math.min(v.near,K)})&&(v.near=0),e.union(E,v))}w.length=0;return E};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/depthRange":function(){define(["exports"],
function(a){function b(p,k){return{near:p,far:k}}function q(p,k,h){p.near=k;p.far=h;return p}class l{constructor(){this.near=Number.MAX_VALUE;this.far=-Number.MAX_VALUE}}a.DepthRange=l;a.create=b;a.empty=function(p){return p?q(p,Infinity,-Infinity):b(Infinity,-Infinity)};a.set=q;a.union=function(p,k){null!=k&&(p.near=Math.min(p.near,k.near),p.far=Math.max(p.far,k.far))};a.within=function(p,k){return p.near<=k&&k<=p.far};a.zero={near:0,far:0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/collections/Component/SourceGeometry":function(){define(["exports","../../../support/buffer/InterleavedLayout","../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl","../../lib/VertexAttribute"],function(a,b,q,l){a.createVertexBufferLayout=function(p){const k=b.newLayout().vec3f(l.VertexAttribute.POSITION);p.hasNormals&&k.vec2i16(l.VertexAttribute.NORMALCOMPRESSED,{glNormalized:!0});p.textureCoordinates===q.TextureCoordinateAttributeType.Default?k.vec2f(l.VertexAttribute.UV0):
p.textureCoordinates===q.TextureCoordinateAttributeType.Atlas&&(k.vec2f(l.VertexAttribute.UV0),k.vec4u16(l.VertexAttribute.UVREGION,{glNormalized:!0}));p.colors&&k.vec4u8(l.VertexAttribute.COLOR,{glNormalized:!0});return k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/UniformComponentParameters":function(){define(["exports","../../../../../core/libs/gl-matrix-2/factories/vec4f64","../../../layers/support/symbolColorUtils"],function(a,
b,q){class l{constructor(){this.externalColor=b.create();this.externalColorMixMode=q.ColorMixModeEnum.Multiply;this.pickable=this.castShadows=!0;this.elevationOffset=0}}a.UniformComponentParameters=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial":function(){define("exports ../../../../../../chunks/tslib.es6 ../../../../../../core/maybe ../../../../../../core/libs/gl-matrix-2/math/mat3 ../../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../../chunks/vec32 ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../../../chunks/vec42 ../../../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../layers/support/symbolColorUtils ../../../../terrain/OverlayContent ./ComponentTechnique ./ComponentTechniqueConfiguration ./shader/ComponentData.glsl ./shader/VertexDiscardByOpacity.glsl ../../../core/material/MaterialBase ../../../core/renderPasses/AllRenderPasses ../../../core/shaderLibrary/ShaderOutput ../../../core/shaderLibrary/attributes/NormalAttribute.glsl ../../../core/shaderLibrary/shading/Normals.glsl ../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../../../core/shaderLibrary/util/AlphaCutoff ../../../core/shaderLibrary/util/EllipsoidMode ../../../core/util/TwoVectorPosition ../../../lib/basicInterfaces ../../../lib/TransparencyPassType ../../../materials/pbrUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F){class H extends m.MaterialBase{constructor(O,L){super();this.toMapSpace=L;this.baseColor=c.fromValues(1,1,1,1);this.hasParametersFromSource=this.usePBR=!1;this.mrrFactors=h.fromArray(F.defaultAdvancedMRRFactors);this.emissiveFactor=h.fromValues(0,0,0);this.normalTexture=this.occlusionTexture=this.emissionTexture=this.metallicRoughnessTexture=this.baseColorTexture=null;this.objectOpacity=1;this.commonMaterialParameters=new E;this.componentParameters=
new G;this.textureAlphaCutoff=z.defaultMaskAlphaCutoff;this.alphaDiscardMode=C.AlphaDiscardMode.Opaque;this.polygonOffsetEnabled=this.isIntegratedMesh=!1;this.ellipsoidMode=A.EllipsoidMode.Earth;this.hasOccludees=!1;this._techniqueConfiguration=new t.ComponentTechniqueConfiguration;L=new B.TwoVectorPosition(O.position);const P=p.clone(O.rotationScale);l.invert(P,P);l.transpose(P,P);this.transformNormalGlobalFromModel=P;this.transformWorldFromModelTL=L.low;this.transformWorldFromModelTH=L.high;this.transformWorldFromModelRS=
O.rotationScale}dispose(){this._technique=q.releaseMaybe(this._technique);this.normalTexture=this.occlusionTexture=this.emissionTexture=this.metallicRoughnessTexture=this.baseColorTexture=null}get texture(){return null!=this.baseColorTexture?this.baseColorTexture.glTexture:null}get textureMetallicRoughness(){return null!=this.metallicRoughnessTexture?this.metallicRoughnessTexture.glTexture:null}get textureEmissive(){return null!=this.emissionTexture?this.emissionTexture.glTexture:null}get textureOcclusion(){return null!=
this.occlusionTexture?this.occlusionTexture.glTexture:null}get textureNormal(){return null!=this.normalTexture?this.normalTexture.glTexture:null}prepareTechnique(O,L,P,M){const K=this._techniqueConfiguration;K.hasVertexColors=M.colors;K.hasNormals=M.hasNormals;K.textureCoordinateType=M.textureCoordinates;K.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture;K.hasEmissionTexture=null!=this.emissionTexture;K.hasOcclusionTexture=null!=this.occlusionTexture;K.hasNormalTexture=null!=this.normalTexture;
K.transparencyPassType=L.identifier===r.RenderPassIdentifier.Material&&null!=P.transparencyPassType?P.transparencyPassType:D.TransparencyPassType.NONE;K.multipassEnabled=L.identifier===r.RenderPassIdentifier.Material&&P.multipassEnabled;K.cullAboveGround=L.identifier===r.RenderPassIdentifier.Material?P.multipassTerrain.cullAboveGround:!1;K.ellipsoidMode=this.ellipsoidMode;K.componentData=this.componentParameters.type;K.cullFace=this.commonMaterialParameters.cullFace;K.doubleSidedMode=this.commonMaterialParameters.doubleSided?
x.NormalsDoubleSidedMode.View:x.NormalsDoubleSidedMode.None;K.hasColorTexture=null!=this.baseColorTexture;const J=this._computeWhichMaterialPass();K.blendingEnabled=J===N.Transparent||J===N.OpaqueAndTransparent;K.alphaDiscardMode=this.alphaDiscardMode;K.integratedMeshMode=this.isIntegratedMesh?null!=P.overlay?.getTexture(g.OverlayContent.ColorNoRasterImage)?null!=P.overlay?.getTexture(g.OverlayContent.WaterNormal)?t.IntegratedMeshMode.ColorOverlayWithWater:t.IntegratedMeshMode.ColorOverlay:t.IntegratedMeshMode.NoOverlay:
t.IntegratedMeshMode.None;K.hasPolygonOffset=this.polygonOffsetEnabled;K.pbrMode=K.integratedMeshMode===t.IntegratedMeshMode.ColorOverlayWithWater?y.PBRMode.WaterOnIntegratedMesh:this.usePBR?this.hasParametersFromSource?M.needsNormals&&this.isIntegratedMesh?y.PBRMode.Disabled:y.PBRMode.Schematic:y.PBRMode.Normal:y.PBRMode.Disabled;K.normalType=M.needsNormals?K.hasNormals?u.NormalType.Compressed:u.NormalType.ScreenDerivative:u.NormalType.Ground;K.hasSlicePlane=null!=P.slicePlane&&this.commonMaterialParameters.hasSlicePlane;
if(L.identifier===r.RenderPassIdentifier.ShadowMap)K.output=n.ShaderOutput.Shadow,K.vertexDiscardMode=v.VertexDiscardMode.None;else if(L.identifier===r.RenderPassIdentifier.ViewshedShadowMap)K.output=n.ShaderOutput.ViewshedShadow,K.vertexDiscardMode=v.VertexDiscardMode.None;else if(L.identifier===r.RenderPassIdentifier.Highlight)K.output=n.ShaderOutput.Highlight,K.vertexDiscardMode=v.VertexDiscardMode.None;else{K.vertexDiscardMode=J===N.OpaqueAndTransparent?L.transparent?v.VertexDiscardMode.Opaque:
v.VertexDiscardMode.Transparent:v.VertexDiscardMode.None;K.output=L.output;K.receiveAmbientOcclusion=!1;K.receiveShadows=!1;switch(L.output){case n.ShaderOutput.Color:K.receiveAmbientOcclusion=null!=P.ssao;K.hasOccludees=P.hasOccludees;K.receiveShadows=P.shadowMap.ready;K.hasScreenSpaceReflections=null!=P.ssr.lastFrameColor;K.hasCloudsReflections=null!=P.cloudsFade.data;break;case n.ShaderOutput.ObjectAndLayerIdColor:K.objectAndLayerIdColor=!0}K.snowCover=this.hasSnowCover(P)}this._technique=O.releaseAndAcquire(d.ComponentTechnique,
K,this._technique);this._setClean();return this._technique}hasSnowCover(O){return null!=O.weather&&O.weatherVisible&&"snowy"===O.weather.type&&"enabled"===O.weather.snowCover}submit(O,L,P){if(0!==this.objectOpacity){var M=P.renderable.geometry,K=P.components;P=P.renderable.meta.cameraDepthSquared;var J=K.geometryRanges,R=K.highlightRanges;K=K.defaultShadowMapRanges;switch(this._computeWhichMaterialPass()){case N.Opaque:O.materialOpaque.submitDraw(this,M,J,P);break;case N.Transparent:O.materialTransparent.submitDraw(this,
M,J,P);break;case N.OpaqueAndTransparent:O.materialOpaque.submitDraw(this,M,J,P);O.materialTransparent.submitDraw(this,M,J,P);break;case N.IntegratedMesh:O.materialIntegratedMesh.submitDraw(this,M,J,P),null!=L.overlay?.getTexture(g.OverlayContent.Highlight)&&O.highlightIntegratedMesh.submitDraw(this,M,J,P)}var Q=this.componentParameters.castShadows!==a.ComponentParameterSummary.None;Q&&O.shadowMap.submitDraw(this,M,J,P);null!=R&&(O.highlight.submitDraw(this,M,R,P),Q&&O.highlightShadowMap.submitDraw(this,
M,R,P));L.viewshedEnabled&&O.viewshedShadowMap.submitDraw(this,M,J,P);Q&&null!=K&&O.defaultShadowMap.submitDraw(this,M,K,P)}}_computeWhichMaterialPass(){return this.isIntegratedMesh?N.IntegratedMesh:1>this.objectOpacity?N.Transparent:this.componentParameters.opaqueOverride===a.ComponentParameterSummary.All?N.Opaque:1>this.baseColor[3]||this.alphaDiscardMode===C.AlphaDiscardMode.Blend||this.alphaDiscardMode===C.AlphaDiscardMode.MaskBlend?N.Transparent:this.componentParameters.transparent===a.ComponentParameterSummary.None?
N.Opaque:this.componentParameters.transparent===a.ComponentParameterSummary.All?N.Transparent:N.OpaqueAndTransparent}}b.__decorate([m.parameter({vectorOps:f.vec4})],H.prototype,"baseColor",void 0);b.__decorate([m.parameter()],H.prototype,"usePBR",void 0);b.__decorate([m.parameter()],H.prototype,"hasParametersFromSource",void 0);b.__decorate([m.parameter({vectorOps:k.vec3})],H.prototype,"mrrFactors",void 0);b.__decorate([m.parameter({vectorOps:k.vec3})],H.prototype,"emissiveFactor",void 0);b.__decorate([m.parameter({dispose:!0})],
H.prototype,"baseColorTexture",void 0);b.__decorate([m.parameter({dispose:!0})],H.prototype,"metallicRoughnessTexture",void 0);b.__decorate([m.parameter({dispose:!0})],H.prototype,"emissionTexture",void 0);b.__decorate([m.parameter({dispose:!0})],H.prototype,"occlusionTexture",void 0);b.__decorate([m.parameter({dispose:!0})],H.prototype,"normalTexture",void 0);b.__decorate([m.parameter()],H.prototype,"objectOpacity",void 0);b.__decorate([m.parameterBlock()],H.prototype,"commonMaterialParameters",
void 0);b.__decorate([m.parameterBlock()],H.prototype,"componentParameters",void 0);b.__decorate([m.parameter()],H.prototype,"textureAlphaCutoff",void 0);b.__decorate([m.parameter()],H.prototype,"alphaDiscardMode",void 0);b.__decorate([m.parameter()],H.prototype,"isIntegratedMesh",void 0);b.__decorate([m.parameter()],H.prototype,"polygonOffsetEnabled",void 0);b.__decorate([m.parameter()],H.prototype,"ellipsoidMode",void 0);b.__decorate([m.parameter()],H.prototype,"hasOccludees",void 0);var N;(function(O){O[O.Opaque=
0]="Opaque";O[O.Transparent=1]="Transparent";O[O.OpaqueAndTransparent=2]="OpaqueAndTransparent";O[O.IntegratedMesh=3]="IntegratedMesh"})(N||={});class E extends m.MaterialParameterBlock{constructor(){super(...arguments);this.doubleSided=!1;this.cullFace=C.CullFaceOptions.Back;this.hasSlicePlane=!0}}b.__decorate([m.parameter()],E.prototype,"doubleSided",void 0);b.__decorate([m.parameter()],E.prototype,"cullFace",void 0);b.__decorate([m.parameter()],E.prototype,"hasSlicePlane",void 0);class G extends m.MaterialParameterBlock{constructor(){super(...arguments);
this.externalColor=c.fromValues(1,1,1,1);this.externalColorMixMode=e.ColorMixModeEnum.Multiply;this.castShadows=a.ComponentParameterSummary.All}get transparent(){return 1>this.externalColor[3]?a.ComponentParameterSummary.All:a.ComponentParameterSummary.None}get opaqueOverride(){return this.externalColorMixMode===e.ColorMixModeEnum.Replace&&1===this.externalColor[3]?a.ComponentParameterSummary.All:a.ComponentParameterSummary.None}get visible(){return 0<this.externalColor[3]?a.ComponentParameterSummary.All:
a.ComponentParameterSummary.None}get type(){return w.ComponentDataType.Uniform}}b.__decorate([m.parameter({vectorOps:f.vec4})],G.prototype,"externalColor",void 0);b.__decorate([m.parameter()],G.prototype,"externalColorMixMode",void 0);b.__decorate([m.parameter()],G.prototype,"castShadows",void 0);a.ComponentParameterSummary=void 0;(function(O){O[O.All=0]="All";O[O.Some=1]="Some";O[O.None=2]="None"})(a.ComponentParameterSummary||(a.ComponentParameterSummary={}));class I extends m.MaterialParameterBlock{constructor(){super(...arguments);
this.texture=null;this.castShadows=this.opaqueOverride=this.transparent=a.ComponentParameterSummary.None}get type(){return w.ComponentDataType.Varying}}b.__decorate([m.parameter()],I.prototype,"texture",void 0);b.__decorate([m.parameter()],I.prototype,"transparent",void 0);b.__decorate([m.parameter()],I.prototype,"opaqueOverride",void 0);b.__decorate([m.parameter()],I.prototype,"castShadows",void 0);a.CommonMaterialParameters=E;a.ComponentMaterial=H;a.ComponentParametersUniform=G;a.ComponentParametersVarying=
I;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique":function(){define("require exports ../../../../../ViewingMode ./ComponentTechniqueConfiguration ../../../../../../chunks/ComponentShader.glsl ../../../core/shaderLibrary/ShaderOutput ../../../core/shaderTechnique/ReloadableShaderModule ../../../core/shaderTechnique/ShaderTechnique ../../../lib/basicInterfaces ../../../lib/OrderIndependentTransparency ../../../lib/Program ../../../lib/StencilUtils ../../../lib/TransparencyPassType ../../../lib/VertexAttribute ../../../../../webgl/enums ../../../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){class r extends f.ShaderTechnique{initializeConfiguration(u,x){x.spherical=u.viewingMode===q.ViewingMode.Global;x.doublePrecisionRequiresObfuscation=u.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(u){return new g.Program(u.rctx,r.shader.get().build(this.configuration),n)}_setPipelineState(u){const x=this.configuration,y=x.integratedMeshMode!==l.IntegratedMeshMode.None,z=u===t.TransparencyPassType.NONE,A=u===t.TransparencyPassType.FrontFace;
return m.makePipelineState({blending:x.output===k.ShaderOutput.Color&&x.blendingEnabled?z?e.blendingDefault:e.oitBlending(u):null,culling:m.cullingParams(x.cullFace),depthTest:{func:e.oitDepthTest(u)},depthWrite:z||A?m.defaultDepthWriteParams:null,drawBuffers:x.output===k.ShaderOutput.Depth?{buffers:[v.SpecialDrawBuffers.NONE]}:e.oitDrawBuffers(u),colorWrite:m.defaultColorWriteParams,stencilWrite:y||x.hasOccludees?d.stencilWriteMaskOn:null,stencilTest:y?d.replaceBitWhenDepthTestPasses(c.StencilBits.IntegratedMeshMaskExcluded):
x.hasOccludees?d.stencilBaseAllZerosParams:null,polygonOffset:z||A?x.hasPolygonOffset?{factor:2,units:2}:null:e.OITPolygonOffset})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}}r.shader=new h.ReloadableShaderModule(p.ComponentShader,()=>new Promise((u,x)=>a(["./shader/ComponentShader.glsl"],u,x)));const n=new Map([[w.VertexAttribute.POSITION,0],[w.VertexAttribute.NORMAL,1],[w.VertexAttribute.NORMALCOMPRESSED,1],[w.VertexAttribute.COLOR,2],[w.VertexAttribute.UV0,
3],[w.VertexAttribute.UVREGION,4],[w.VertexAttribute.COMPONENTINDEX,5]]);b.ComponentTechnique=r;b.attributeLocations=n;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration":function(){define("exports ../../../../../../chunks/tslib.es6 ./shader/ComponentData.glsl ./shader/VertexDiscardByOpacity.glsl ../../../core/shaderLibrary/ShaderOutput ../../../core/shaderLibrary/attributes/NormalAttribute.glsl ../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../../../core/shaderLibrary/shading/Normals.glsl ../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../../../core/shaderLibrary/util/EllipsoidMode ../../../core/shaderTechnique/BindType ../../../core/shaderTechnique/ShaderTechniqueConfiguration ../../../lib/basicInterfaces ../../../lib/TransparencyPassType".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){a.IntegratedMeshMode=void 0;(function(m){m[m.None=0]="None";m[m.NoOverlay=1]="NoOverlay";m[m.ColorOverlay=2]="ColorOverlay";m[m.ColorOverlayWithWater=3]="ColorOverlayWithWater";m[m.COUNT=4]="COUNT"})(a.IntegratedMeshMode||(a.IntegratedMeshMode={}));class v extends d.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.output=p.ShaderOutput.Color;this.textureCoordinateType=h.TextureCoordinateAttributeType.None;this.componentData=q.ComponentDataType.Uniform;
this.cullFace=t.CullFaceOptions.Back;this.vertexDiscardMode=l.VertexDiscardMode.None;this.doubleSidedMode=f.NormalsDoubleSidedMode.WindingOrder;this.alphaDiscardMode=t.AlphaDiscardMode.Opaque;this.integratedMeshMode=a.IntegratedMeshMode.None;this.transparencyPassType=w.TransparencyPassType.NONE;this.ellipsoidMode=e.EllipsoidMode.Earth;this.pbrMode=c.PBRMode.Disabled;this.normalType=k.NormalType.Attribute;this.hasColorTexture=this.hasSlicePlane=this.hasNormals=this.hasVertexColors=this.doublePrecisionRequiresObfuscation=
this.spherical=!1;this.blendingEnabled=this.receiveShadows=this.receiveAmbientOcclusion=!0;this.hasNormalTextureTransform=this.cullAboveGround=this.multipassEnabled=this.hasOccludees=this.hasNormalTexture=this.hasOcclusionTexture=this.hasEmissionTexture=this.hasMetallicRoughnessTexture=this.hasPolygonOffset=this.hasScreenSpaceReflections=!1;this.hasCloudsReflections=!0;this.objectAndLayerIdColor=this.snowCover=!1}}b.__decorate([d.parameter({count:p.ShaderOutput.COUNT})],v.prototype,"output",void 0);
b.__decorate([d.parameter({count:h.TextureCoordinateAttributeType.COUNT})],v.prototype,"textureCoordinateType",void 0);b.__decorate([d.parameter({count:q.ComponentDataType.COUNT})],v.prototype,"componentData",void 0);b.__decorate([d.parameter({count:t.CullFaceOptions.COUNT})],v.prototype,"cullFace",void 0);b.__decorate([d.parameter({count:l.VertexDiscardMode.COUNT})],v.prototype,"vertexDiscardMode",void 0);b.__decorate([d.parameter({count:f.NormalsDoubleSidedMode.COUNT})],v.prototype,"doubleSidedMode",
void 0);b.__decorate([d.parameter({count:t.AlphaDiscardMode.COUNT})],v.prototype,"alphaDiscardMode",void 0);b.__decorate([d.parameter({count:a.IntegratedMeshMode.COUNT})],v.prototype,"integratedMeshMode",void 0);b.__decorate([d.parameter({count:w.TransparencyPassType.COUNT})],v.prototype,"transparencyPassType",void 0);b.__decorate([d.parameter({count:e.EllipsoidMode.COUNT})],v.prototype,"ellipsoidMode",void 0);b.__decorate([d.parameter({count:c.PBRMode.COUNT})],v.prototype,"pbrMode",void 0);b.__decorate([d.parameter({count:k.NormalType.COUNT})],
v.prototype,"normalType",void 0);b.__decorate([d.parameter()],v.prototype,"spherical",void 0);b.__decorate([d.parameter()],v.prototype,"doublePrecisionRequiresObfuscation",void 0);b.__decorate([d.parameter()],v.prototype,"hasVertexColors",void 0);b.__decorate([d.parameter()],v.prototype,"hasNormals",void 0);b.__decorate([d.parameter()],v.prototype,"hasSlicePlane",void 0);b.__decorate([d.parameter()],v.prototype,"hasColorTexture",void 0);b.__decorate([d.parameter()],v.prototype,"receiveAmbientOcclusion",
void 0);b.__decorate([d.parameter()],v.prototype,"receiveShadows",void 0);b.__decorate([d.parameter()],v.prototype,"blendingEnabled",void 0);b.__decorate([d.parameter()],v.prototype,"hasScreenSpaceReflections",void 0);b.__decorate([d.parameter()],v.prototype,"hasPolygonOffset",void 0);b.__decorate([d.parameter()],v.prototype,"hasMetallicRoughnessTexture",void 0);b.__decorate([d.parameter()],v.prototype,"hasEmissionTexture",void 0);b.__decorate([d.parameter()],v.prototype,"hasOcclusionTexture",void 0);
b.__decorate([d.parameter()],v.prototype,"hasNormalTexture",void 0);b.__decorate([d.parameter()],v.prototype,"hasOccludees",void 0);b.__decorate([d.parameter()],v.prototype,"multipassEnabled",void 0);b.__decorate([d.parameter()],v.prototype,"cullAboveGround",void 0);b.__decorate([d.parameter()],v.prototype,"hasNormalTextureTransform",void 0);b.__decorate([d.parameter()],v.prototype,"hasCloudsReflections",void 0);b.__decorate([d.parameter()],v.prototype,"snowCover",void 0);b.__decorate([d.parameter()],
v.prototype,"objectAndLayerIdColor",void 0);b.__decorate([d.parameter({constValue:!1})],v.prototype,"occlusionPass",void 0);b.__decorate([d.parameter({constValue:g.BindType.Draw})],v.prototype,"pbrTextureBindType",void 0);b.__decorate([d.parameter({constValue:!0})],v.prototype,"hasSliceHighlight",void 0);b.__decorate([d.parameter({constValue:!1})],v.prototype,"hasSliceInVertexProgram",void 0);b.__decorate([d.parameter({constValue:!1})],v.prototype,"useCustomDTRExponentForWater",void 0);b.__decorate([d.parameter({constValue:!1})],
v.prototype,"hasVertexTangents",void 0);b.__decorate([d.parameter({constValue:!0})],v.prototype,"supportsTextureAtlas",void 0);b.__decorate([d.parameter({constValue:!1})],v.prototype,"highStepCount",void 0);b.__decorate([d.parameter({constValue:!1})],v.prototype,"instancedDoublePrecision",void 0);b.__decorate([d.parameter({constValue:!1})],v.prototype,"hasModelTransformation",void 0);b.__decorate([d.parameter({constValue:!0})],v.prototype,"useFillLights",void 0);b.__decorate([d.parameter({constValue:!1})],
v.prototype,"objectAndLayerIdColorInstanced",void 0);a.ComponentTechniqueConfiguration=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/Material/shader/VertexDiscardByOpacity.glsl":function(){define(["exports","../../../../../../../core/compilerUtils","../../../../core/shaderModules/interfaces"],function(a,b,q){a.VertexDiscardMode=void 0;(function(l){l[l.None=0]="None";l[l.Transparent=1]="Transparent";l[l.Opaque=2]="Opaque";l[l.COUNT=
3]="COUNT"})(a.VertexDiscardMode||(a.VertexDiscardMode={}));a.VertexDiscardByOpacity=function(l,p){l=l.vertex;l.code.add(q.glsl`#define VERTEX_DISCARD_CUTOFF (1.0 - 1.0 / 255.0)`);switch(p.vertexDiscardMode){case a.VertexDiscardMode.None:l.code.add(q.glsl`#define vertexDiscardByOpacity(_opacity_) {}`);break;case a.VertexDiscardMode.Opaque:l.code.add(q.glsl`#define vertexDiscardByOpacity(_opacity_) { if (_opacity_ > VERTEX_DISCARD_CUTOFF) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } }`);
break;case a.VertexDiscardMode.Transparent:l.code.add(q.glsl`#define vertexDiscardByOpacity(_opacity_) { if (_opacity_ <= VERTEX_DISCARD_CUTOFF) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } }`);break;case a.VertexDiscardMode.COUNT:break;default:b.neverReached(p.vertexDiscardMode)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/EllipsoidMode":function(){define(["exports","../../../../../../geometry/support/spatialReferenceUtils"],
function(a,b){a.EllipsoidMode=void 0;(function(q){q[q.Earth=1]="Earth";q[q.Mars=2]="Mars";q[q.Moon=3]="Moon";q[q.COUNT=4]="COUNT"})(a.EllipsoidMode||(a.EllipsoidMode={}));a.getEllipsoidMode=function(q){return q&&b.isMars(q)?a.EllipsoidMode.Mars:q&&b.isMoon(q)?a.EllipsoidMode.Moon:a.EllipsoidMode.Earth};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/ComponentShader.glsl":function(){define("exports ../geometry/support/Ellipsoid ../views/3d/terrain/OverlayContent ../views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration ../views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl ../views/3d/webgl-engine/collections/Component/Material/shader/VertexDiscardByOpacity.glsl ../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl ../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff ../views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/EllipsoidMode ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/TransparencyPassType".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L){function P(K){const J=new I.ShaderBuilder;J.include(w.VertexPosition,K);J.include(t.VertexNormal,K);J.include(d.VertexColor,K);J.include(g.TextureCoordinateAttribute,K);J.include(h.ForwardLinearDepth,K);J.include(p.ComponentData,K);J.include(N.DiscardOrAdjustAlphaDraw,K);J.include(c.SlicePass,K);J.include(C.ReadBaseColorTexture,K);J.include(k.VertexDiscardByOpacity,K);const {vertex:R,fragment:Q}=J;if(K.pbrMode===B.PBRMode.Normal||
K.pbrMode===B.PBRMode.Schematic)J.include(B.PhysicallyBasedRenderingParameters,K),K.hasNormalTexture&&J.include(u.ComputeNormalTexture,K);const W=K.output===f.ShaderOutput.Shadow||K.output===f.ShaderOutput.ShadowHighlight||K.output===f.ShaderOutput.ShadowExcludeHighlight;W&&K.componentData===p.ComponentDataType.Varying?R.code.add(G.glsl`#define discardShadows(castShadows) { if(!castShadows) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } }`):R.code.add(G.glsl`#define discardShadows(castShadows) {}`);
const S=K.integratedMeshMode===l.IntegratedMeshMode.ColorOverlay||K.integratedMeshMode===l.IntegratedMeshMode.ColorOverlayWithWater;var V=S&&K.output===f.ShaderOutput.Color&&K.pbrMode===B.PBRMode.WaterOnIntegratedMesh;S&&(J.include(y.EvaluateSceneLighting,K),J.include(F.OverlayIM,K),K.spherical?R.code.add(G.glsl`
const float invEllipsoidRadius = ${G.glsl.float(1/(K.ellipsoidMode===E.EllipsoidMode.Earth?b.earth.radius:K.ellipsoidMode===E.EllipsoidMode.Mars?b.mars.radius:b.moon.radius))};
vec2 projectOverlay(vec3 pos) {
return pos.xy / (1.0 + invEllipsoidRadius * pos.z);
}
`):R.code.add(G.glsl`vec2 projectOverlay(vec3 pos) { return pos.xy; }`));V&&(J.varyings.add("tbnTangent","vec3"),J.varyings.add("tbnBiTangent","vec3"),J.varyings.add("groundNormal","vec3"));R.code.add(G.glsl`
void main() {
bool castShadows;
vec4 externalColor = forwardExternalColor(castShadows);
discardShadows(castShadows);
vertexDiscardByOpacity(externalColor.a);
${K.output===f.ShaderOutput.ObjectAndLayerIdColor?G.glsl`externalColor.a = 1.0;`:""}
if (externalColor.a < ${G.glsl.float(H.symbolAlphaCutoff)}) {
// Discard this vertex
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
return;
}
forwardPosition(readElevationOffset());
forwardNormal();
forwardTextureCoordinates();
forwardVertexColor();
forwardLinearDepth();
${K.output===f.ShaderOutput.ObjectAndLayerIdColor?G.glsl`forwardObjectAndLayerIdColor();`:""}
${V?K.spherical?G.glsl`
groundNormal = normalize(positionWorld());
tbnTangent = normalize(cross(vec3(0.0, 0.0, 1.0), groundNormal));
tbnBiTangent = normalize(cross(groundNormal, tbnTangent));`:G.glsl`
groundNormal = vec3(0.0, 0.0, 1.0);
tbnTangent = vec3(1.0, 0.0, 0.0);
tbnBiTangent = vec3(0.0, 1.0, 0.0);`:""}
${S?G.glsl`setOverlayVTC(projectOverlay(position));`:""}
}
`);K.output===f.ShaderOutput.Color&&(Q.include(r.ReadLinearDepth),J.include(A.multipassTerrainTest,K),J.include(n.ComputeMaterialColor,K),J.include(x.ComputeShadingNormal,K),J.include(y.EvaluateSceneLighting,K),K.transparencyPassType===L.TransparencyPassType.ColorAlpha&&(J.outputs.add("fragColor","vec4",0),J.outputs.add("fragAlpha","float",1)),K.receiveShadows?(J.include(D.ReadShadowMapPass,K),Q.code.add(G.glsl`float evaluateShadow() {
return readShadowMap(vPositionWorldCameraRelative, linearDepth);
}`)):Q.code.add(G.glsl`float evaluateShadow() { return 0.0; }`),S&&Q.uniforms.add(new O.Texture2DPassUniform("ovColorTex",(T,Y)=>F.getIMColorTexture(T,Y))),Q.code.add(G.glsl`
void main() {
discardBySlice(vPositionWorldCameraRelative);
${K.multipassEnabled?G.glsl`terrainDepthTest(vPosition_view.z);`:""}
vec4 textureColor = readBaseColorTexture();
discardOrAdjustAlpha(textureColor);
vec4 externalColor;
int externalColorMixMode;
readExternalColor(externalColor, externalColorMixMode);
vec4 materialColor = computeMaterialColor(
textureColor,
externalColor,
externalColorMixMode
);
${S?G.glsl`vec4 overlayColor = getOverlayColor(ovColorTex, vtcOverlay);`:""}
`),K.pbrMode===B.PBRMode.Normal||K.pbrMode===B.PBRMode.Schematic?(z.addMainLightIntensity(Q),Q.code.add(G.glsl`
${K.pbrMode===B.PBRMode.Normal?G.glsl`
applyPBRFactors();
if (int(externalColorMixMode) == 3) {
mrr = vec3(0.0, 0.6, 0.2);
}`:""}
vec3 normalVertex = shadingNormalWorld();
float additionalIrradiance = 0.02 * mainLightIntensity[2];
`),K.hasNormalTexture?Q.code.add(G.glsl`mat3 tangentSpace = computeTangentSpace(normalVertex, vPositionWorldCameraRelative, vuv0);
vec3 shadingNormal = computeTextureNormal(tangentSpace, vuv0);`):Q.code.add(G.glsl`vec3 shadingNormal = normalVertex;`),Q.code.add(G.glsl`${K.spherical?G.glsl`vec3 normalGround = normalize(positionWorld());`:G.glsl`vec3 normalGround = vec3(0.0, 0.0, 1.0);`}
`),Q.code.add(G.glsl`
vec3 viewDir = normalize(vPositionWorldCameraRelative);
float ssao = 1.0 - occlusion * evaluateAmbientOcclusionInverse();
${K.snowCover?G.glsl`
vec3 surfaceNormal = normalize(shadingNormalWorld());
float snow = smoothstep(0.5, 0.55, dot(surfaceNormal, normalize(positionWorld())));
materialColor.rgb = mix(materialColor.rgb, vec3(1.1), snow);
ssao = mix(ssao, 0.5 * ssao, snow);
shadingNormal = mix(shadingNormal, surfaceNormal, snow);`:""}
${S?G.glsl` materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;`:""}
vec3 additionalLight = evaluateAdditionalLighting(ssao, positionWorld());
vec4 shadedColor = vec4(evaluateSceneLightingPBR(shadingNormal, materialColor.rgb, evaluateShadow(), ssao, additionalLight, viewDir, normalGround, mrr, emission, additionalIrradiance), materialColor.a);
`)):(K.receiveShadows?Q.code.add(G.glsl`float shadow = evaluateShadow();`):K.spherical?(y.addLightingGlobalFactor(Q),Q.code.add(G.glsl`float additionalAmbientScale = additionalDirectedAmbientLight(positionWorld());
float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);`)):Q.code.add(G.glsl`float shadow = 0.0;`),V&&Q.uniforms.add(new O.Texture2DPassUniform("ovNormalTex",(T,Y)=>Y.overlay?.getTexture(q.OverlayContent.WaterNormal))),K.snowCover&&Q.code.add(G.glsl`vec3 surfaceNormal = normalize(cross(dFdx(vPositionWorldCameraRelative), dFdy(vPositionWorldCameraRelative)));
float snow = smoothstep(0.5, 0.55, dot(surfaceNormal, normalize(positionWorld())));
materialColor.rgb = mix(materialColor.rgb, vec3(1), snow);`),Q.code.add(G.glsl`
float ambientOcclusion = evaluateAmbientOcclusion();
vec3 additionalLight = evaluateAdditionalLighting(ambientOcclusion, positionWorld());
${S?G.glsl` materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;`:""}
vec4 shadedColor = vec4(evaluateSceneLighting(shadingNormalWorld(), materialColor.rgb, shadow, ambientOcclusion, additionalLight), materialColor.a);
${V?G.glsl`
vec4 overlayWaterMask = getOverlayColor(ovNormalTex, vtcOverlay);
float waterNormalLength = length(overlayWaterMask);
if (waterNormalLength > 0.95) {
mat3 tbnMatrix = mat3(tbnTangent, tbnBiTangent, groundNormal);
vec4 waterColorLinear = getOverlayWaterColor(overlayWaterMask, overlayColor, -normalize(vPositionWorldCameraRelative), shadow, groundNormal, tbnMatrix, vPosition_view, positionWorld());
vec4 waterColorNonLinear = delinearizeGamma(vec4(waterColorLinear.xyz, 1.0));
// un-gamma the ground color to mix in linear space
shadedColor = mix(shadedColor, waterColorNonLinear, waterColorLinear.w);
}`:""}
`)),Q.code.add(G.glsl`
fragColor = highlightSlice(shadedColor, vPositionWorldCameraRelative);
${K.transparencyPassType===L.TransparencyPassType.ColorAlpha?G.glsl`
fragColor = premultiplyAlpha(fragColor);
fragAlpha = fragColor.a;`:""}
}
`));if((V=K.output===f.ShaderOutput.Depth)||W||K.output===f.ShaderOutput.ViewshedShadow)V||J.include(v.OutputDepth,K),Q.code.add(G.glsl`
void main() {
discardBySlice(vPositionWorldCameraRelative);
vec4 textureColor = readBaseColorTexture();
discardOrAdjustAlpha(textureColor);
${V?"":G.glsl`outputDepth(linearDepth);`}
}
`);K.output===f.ShaderOutput.Normal&&(J.include(x.ComputeShadingNormal,K),Q.code.add(G.glsl`
void main() {
discardBySlice(vPositionWorldCameraRelative);
vec4 textureColor = readBaseColorTexture();
discardOrAdjustAlpha(textureColor);
// note: the alpha component needs to be 1.0 in order for this material to influence ambient occlusion,
// see the ssao fragment shader
float alpha = ${K.normalType===e.NormalType.Ground?"0.0":"1.0"};
fragColor = vec4(vec3(.5) + .5 * shadingNormal_view(), alpha);
}
`));K.output===f.ShaderOutput.ObjectAndLayerIdColor&&J.fragment.code.add(G.glsl`
void main() {
discardBySlice(vPositionWorldCameraRelative);
vec4 textureColor = readBaseColorTexture();
discardOrAdjustAlpha(textureColor);
${S?G.glsl`fragColor = getOverlayColorTexel(vtcOverlay);`:"outputObjectAndLayerIdColor();"}
}
`);K.output===f.ShaderOutput.Highlight&&(J.include(m.OutputHighlight),Q.code.add(G.glsl`
void main() {
discardBySlice(vPositionWorldCameraRelative);
vec4 textureColor = readBaseColorTexture();
discardOrAdjustAlpha(textureColor);
${S?G.glsl`
vec4 overlayColor = getCombinedOverlayColor();
if (overlayColor.a == 0.0) {
fragColor = vec4(0.0);
return;
}`:""}
outputHighlight();
}
`));return J}const M=Object.freeze(Object.defineProperty({__proto__:null,build:P},Symbol.toStringTag,{value:"Module"}));a.ComponentShader=M;a.build=P})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl":function(){define("exports ../attributes/VertexColor.glsl ../util/MixExternalColor.glsl ../../shaderModules/Float4DrawUniform ../../shaderModules/FloatDrawUniform ../../shaderModules/interfaces".split(" "),function(a,b,q,l,p,k){a.ComputeMaterialColor=function(h,
f){h.include(b.VertexColor,f);h.fragment.include(q.MixExternalColor);h=h.fragment;h.uniforms.add(new l.Float4DrawUniform("baseColor",c=>c.baseColor));h.uniforms.add(new p.FloatDrawUniform("objectOpacity",c=>c.objectOpacity));f.hasVertexColors?h.code.add(k.glsl`vec3 _baseColor() {
return baseColor.rgb * vColor.rgb;
}
float _baseOpacity() {
return baseColor.a * vColor.a;
}`):h.code.add(k.glsl`vec3 _baseColor() {
return baseColor.rgb;
}
float _baseOpacity() {
return baseColor.a;
}`);h.code.add(k.glsl`vec4 computeMaterialColor(vec4 textureColor, vec4 externalColor, int externalColorMixMode) {
vec3 baseColor = _baseColor();
float baseOpacity = _baseOpacity();
vec3 color = mixExternalColor(
baseColor,
textureColor.rgb,
externalColor.rgb,
externalColorMixMode
);
float opacity = objectOpacity * mixExternalOpacity(
baseOpacity,
textureColor.a,
externalColor.a,
externalColorMixMode
);
return vec4(color, opacity);
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl":function(){define("exports ../../../../../../core/compilerUtils ../attributes/NormalAttribute.glsl ../attributes/VertexNormal.glsl ../attributes/VertexPosition.glsl ./Normals.glsl ../../shaderModules/interfaces".split(" "),function(a,b,q,l,p,k,h){a.ComputeShadingNormal=function(f,c){const e=f.fragment;switch(c.doubleSidedMode){case k.NormalsDoubleSidedMode.None:e.code.add(h.glsl`vec3 _adjustDoublesided(vec3 normal) {
return normal;
}`);break;case k.NormalsDoubleSidedMode.View:f.include(p.VertexPosition,c);e.code.add(h.glsl`vec3 _adjustDoublesided(vec3 normal) {
return dot(normal, vPositionWorldCameraRelative) > 0.0 ? -normal : normal;
}`);break;case k.NormalsDoubleSidedMode.WindingOrder:e.code.add(h.glsl`vec3 _adjustDoublesided(vec3 normal) {
return gl_FrontFacing ? normal : -normal;
}`);break;default:b.neverReached(c.doubleSidedMode);case k.NormalsDoubleSidedMode.COUNT:}switch(c.normalType){case q.NormalType.Attribute:case q.NormalType.Compressed:f.include(l.VertexNormal,c);e.code.add(h.glsl`vec3 shadingNormalWorld() {
return _adjustDoublesided(normalize(vNormalWorld));
}
vec3 shadingNormal_view() {
vec3 normal = normalize(vNormalView);
return gl_FrontFacing ? normal : -normal;
}`);break;case q.NormalType.ScreenDerivative:f.include(p.VertexPosition,c);e.code.add(h.glsl`vec3 shadingNormalWorld() {
return normalize(cross(
dFdx(vPositionWorldCameraRelative),
dFdy(vPositionWorldCameraRelative)
));
}
vec3 shadingNormal_view() {
return normalize(cross(dFdx(vPosition_view),dFdy(vPosition_view)));
}`);break;case q.NormalType.Ground:c.spherical?(f.include(p.VertexPosition,c),e.code.add(h.glsl`vec3 shadingNormalWorld() {
return normalize(positionWorld());
}`)):e.code.add(h.glsl`vec3 shadingNormalWorld() {
return vec3(0.0, 0.0, 1.0);
}`);e.code.add(h.glsl`vec3 shadingNormal_view() {
return normalize(cross(dFdx(vPosition_view),dFdy(vPosition_view))).xyz;
}`);break;default:b.neverReached(c.normalType);case q.NormalType.COUNT:}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl":function(){define("exports ../ShaderOutput ../attributes/TextureCoordinateAttribute.glsl ../attributes/VertexTextureCoordinates.glsl ../util/TextureAtlasLookup.glsl ../../shaderModules/interfaces ../../shaderModules/Texture2DDrawUniform ../../../lib/basicInterfaces".split(" "),function(a,
b,q,l,p,k,h,f){a.ReadBaseColorTexture=function(c,e){const g=c.fragment;!e.hasColorTexture||e.output!==b.ShaderOutput.Color&&e.alphaDiscardMode===f.AlphaDiscardMode.Opaque?g.code.add(k.glsl`vec4 readBaseColorTexture() { return vec4(1.0); }`):(c.include(l.VertexTextureCoordinates,e),e=e.textureCoordinateType===q.TextureCoordinateAttributeType.Atlas,g.uniforms.add(new h.Texture2DDrawUniform("baseColorTexture",d=>d.texture)),e?(c.include(p.TextureAtlasLookup),g.code.add(k.glsl`vec4 readBaseColorTexture() {
return textureAtlasLookup(baseColorTexture, vuv0, vuvRegion);
}`)):g.code.add(k.glsl`vec4 readBaseColorTexture() {
return texture(baseColorTexture, vuv0);
}`))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/material/MaterialBase":function(){define(["exports","../shaderModules/interfaces"],function(a,b){class q extends b.NoParameters{constructor(){super(...arguments);this._dirty=!0}_setDirty(){this._dirty=!0}_setClean(){this._dirty=!1;if(null!=this._parameterBlocks)for(const p of this._parameterBlocks)this[p]._setClean()}get dirty(){return this._dirty||this._checkParameterBlocksDirty()}_checkParameterBlocksDirty(){if(null==
this._parameterBlocks)return!1;for(const p of this._parameterBlocks)if(this[p].dirty)return!0;return!1}}class l{constructor(){this._dirty=!0}_setDirty(){this._dirty=!0}_setClean(){this._dirty=!1}get dirty(){return this._dirty}}a.MaterialBase=q;a.MaterialParameterBlock=l;a.parameter=function(p={}){return(k,h)=>{const f=k._parameterCount??0;k._parameterCount=f+1;if(p.vectorOps){const c=p.vectorOps;Object.defineProperty(k,h,{get(){return this[f]},set(e){const g=this[f];if(null==g)this[f]=e;else{if(c.equals(g,
e))return;c.copy(g,e)}this._setDirty()}})}else Object.defineProperty(k,h,{get(){return this[f]},set(c){this[f]!==c&&(p.dispose&&this[f]&&this[f].dispose(),this[f]=c,this._setDirty())}})}};a.parameterBlock=function(){return(p,k)=>{const h=p._parameterCount??0;p._parameterCount=h+1;p._parameterBlocks=p._parameterBlocks||[];p._parameterBlocks.push(h);Object.defineProperty(p,k,{get(){return this[h]},set(f){this[h]!==f&&(this[h]=f,this._setDirty())}})}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/core/util/TwoVectorPosition":function(){define(["exports","../../../../../chunks/vec32","../../../../../core/libs/gl-matrix-2/factories/vec3f32","../../../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b,q,l){class p{constructor(h){this._low=l.create();this._high=l.create();h&&this.set(h)}get low(){return this._low}get high(){return this._high}set(h){b.copy(this._low,b.copy(k,h));h=b.sub(k,h,this._low);b.copy(this._high,h)}get(h){return b.add(h,this._low,this._high)}getLowScaled(h){return b.scale(h,
this._low,1)}}const k=q.create();a.TwoVectorPosition=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts":function(){define(["exports","../../../support/buffer/glUtil","../../../support/buffer/InterleavedLayout","../VertexAttribute"],function(a,b,q,l){const p=q.newLayout().vec3f(l.VertexAttribute.POSITION).u16(l.VertexAttribute.COMPONENTINDEX).freeze(),k=q.newLayout().vec2u8(l.VertexAttribute.SIDENESS).freeze();b=b.glLayout(k);
const h=q.newLayout().vec3f(l.VertexAttribute.POSITION0).vec3f(l.VertexAttribute.POSITION1).vec2i16(l.VertexAttribute.NORMALCOMPRESSED).u16(l.VertexAttribute.COMPONENTINDEX).u8(l.VertexAttribute.VARIANTOFFSET,{glNormalized:!0}).u8(l.VertexAttribute.VARIANTSTROKE).u8(l.VertexAttribute.VARIANTEXTENSION,{glNormalized:!0}).freeze();q=q.newLayout().vec3f(l.VertexAttribute.POSITION0).vec3f(l.VertexAttribute.POSITION1).vec2i16(l.VertexAttribute.NORMALCOMPRESSED).vec2i16(l.VertexAttribute.NORMAL2COMPRESSED).u16(l.VertexAttribute.COMPONENTINDEX).u8(l.VertexAttribute.VARIANTOFFSET,
{glNormalized:!0}).u8(l.VertexAttribute.VARIANTSTROKE).u8(l.VertexAttribute.VARIANTEXTENSION,{glNormalized:!0}).freeze();l=new Map([[l.VertexAttribute.POSITION0,0],[l.VertexAttribute.POSITION1,1],[l.VertexAttribute.COMPONENTINDEX,2],[l.VertexAttribute.VARIANTOFFSET,3],[l.VertexAttribute.VARIANTSTROKE,4],[l.VertexAttribute.VARIANTEXTENSION,5],[l.VertexAttribute.NORMALCOMPRESSED,6],[l.VertexAttribute.NORMAL2COMPRESSED,7],[l.VertexAttribute.SIDENESS,8]]);a.EdgeInputBufferLayout=p;a.EdgeShaderAttributeLocations=
l;a.RegularEdgeInstancesLayout=h;a.SilhouetteEdgeInstancesLayout=q;a.VertexLayout=k;a.glVertexLayout=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/edgeRendering/edgeProcessing":function(){define("exports ../../../../../geometry/support/meshUtils/deduplicate ../../../support/meshProcessing ../../../support/buffer/InterleavedLayout ../VertexAttribute ./bufferLayouts ./edgeBufferWriters ./edgePreprocessing".split(" "),function(a,b,q,l,p,k,h,f){function c(t,
w,v,m){if(w)return w=q.computeNeighbors(v,m,t.count),new e(v,m,w,t);t=b.deduplicate(t.buffer,t.stride/4,{originalIndices:v,originalIndicesLength:m});m=q.computeNeighbors(t.indices,m,t.uniqueCount);return{faces:t.indices,facesLength:t.indices.length,neighbors:m,vertices:k.EdgeInputBufferLayout.createView(t.buffer)}}class e{constructor(t,w,v,m){this.faces=t;this.facesLength=w;this.neighbors=v;this.vertices=m}}const g=new h.RegularEdgeBufferWriter,d=new h.SilhouetteEdgeBufferWriter;h=l.newLayout().vec3f(p.VertexAttribute.POSITION0).vec3f(p.VertexAttribute.POSITION1);
l=l.newLayout().vec3f(p.VertexAttribute.POSITION0).vec3f(p.VertexAttribute.POSITION1).u16(p.VertexAttribute.COMPONENTINDEX);a.extract=function(t){const w=c(t.data,t.skipDeduplicate,t.indices,t.indicesLength);g.updateSettings(t.writerSettings);d.updateSettings(t.writerSettings);return f.extractEdges(w,g,d)};a.extractComponentsEdgeLocationsLayout=l;a.extractEdgeInformation=c;a.extractEdgeLocationsLayout=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/meshProcessing":function(){define(["exports"],
function(a){a.computeNeighbors=function(b,q,l){q/=3;const p=new Uint32Array(l+1),k=new Uint32Array(l+1);var h=(m,r)=>{m<r?p[m+1]++:k[r+1]++};for(var f=0;f<q;f++){var c=b[3*f],e=b[3*f+1],g=b[3*f+2];h(c,e);h(e,g);h(g,c)}f=h=0;for(c=0;c<l;c++)e=p[c+1],g=k[c+1],p[c+1]=h,k[c+1]=f,h+=e,f+=g;const d=new Uint32Array(6*q),t=p[l];h=(m,r,n)=>{m<r?(m=p[m+1]++,d[2*m]=r,d[2*m+1]=n):(r=k[r+1]++,d[2*t+2*r]=m,d[2*t+2*r+1]=n)};for(f=0;f<q;f++)c=b[3*f],e=b[3*f+1],g=b[3*f+2],h(c,e,f),h(e,g,f),h(g,c,f);h=(m,r)=>{const n=
2*m;m=r-m;for(r=1;r<m;r++){const u=d[n+2*r],x=d[n+2*r+1];let y=r-1;for(y;0<=y&&d[n+2*y]>u;y--)d[n+2*y+2]=d[n+2*y],d[n+2*y+3]=d[n+2*y+1];d[n+2*y+2]=u;d[n+2*y+3]=x}};for(f=0;f<l;f++)h(p[f],p[f+1]),h(t+k[f],t+k[f+1]);const w=new Int32Array(3*q),v=(m,r)=>m===b[3*r]?0:m===b[3*r+1]?1:m===b[3*r+2]?2:-1;q=(m,r)=>{m=v(m,r);w[3*r+m]=-1};h=(m,r,n,u)=>{m=v(m,r);w[3*r+m]=u;n=v(n,u);w[3*u+n]=r};for(f=0;f<l;f++){c=p[f];e=p[f+1];g=k[f];const m=k[f+1];for(;c<e&&g<m;){const r=d[2*c],n=d[2*t+2*g];r===n?(h(f,d[2*c+1],
n,d[2*t+2*g+1]),c++,g++):r<n?(q(f,d[2*c+1]),c++):(q(n,d[2*t+2*g+1]),g++)}for(;c<e;)q(f,d[2*c+1]),c++;for(;g<m;)q(d[2*t+2*g],d[2*t+2*g+1]),g++}return w};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters":function(){define("exports ../../../../../core/RandomLCG ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../support/buffer/glUtil ../Normals ./bufferLayouts".split(" "),function(a,
b,q,l,p,k,h){function f(u){d[0]=u.position0[0];d[1]=u.position0[1];d[2]=u.position0[2];d[3]=u.position1[0];d[4]=u.position1[1];d[5]=u.position1[2];w[0]=31*(31*(31*(31*(31*(166811+t[0])+t[1])+t[2])+t[3])+t[4])+t[5];return w[0]}function c(u){const x=d;x[0]=e(u.position0[0]);x[1]=e(u.position0[1]);x[2]=e(u.position0[2]);x[3]=e(u.position1[0]);x[4]=e(u.position1[1]);x[5]=e(u.position1[2]);w[0]=5381;for(u=0;u<t.length;u++)w[0]=31*w[0]+t[u];return w[0]}function e(u){return Math.round(1E4*u)/1E4}class g{updateSettings(u){this.settings=
u;this._edgeHashFunction=u.reducedPrecision?c:f}write(u,x,y){n.seed=this._edgeHashFunction(y);const z=n.getIntRange(0,255),A=n.getIntRange(0,this.settings.variants-1);var B=n.getFloat();B=-(1-Math.min(B/.7,1))+Math.max(0,B-.7)/(1-.7);B=255*(Math.abs(B)**1.2*Math.sign(B)*.5+.5);u.position0.setVec(x,y.position0);u.position1.setVec(x,y.position1);u.componentIndex.set(x,y.componentIndex);u.variantOffset.set(x,z);u.variantStroke.set(x,A);u.variantExtension.set(x,B)}}const d=new Float32Array(6),t=new Uint32Array(d.buffer),
w=new Uint32Array(1);class v{constructor(){this._commonWriter=new g}updateSettings(u){this._commonWriter.updateSettings(u)}allocate(u){return h.RegularEdgeInstancesLayout.createBuffer(u)}write(u,x,y){this._commonWriter.write(u,x,y);q.add(r,y.faceNormal0,y.faceNormal1);q.normalize(r,r);const {typedBuffer:z,typedBufferStride:A}=u.normalCompressed;k.compressNormal(z,x,r[0],r[1],r[2],A)}}v.Layout=h.RegularEdgeInstancesLayout;v.glLayout=p.glLayout(h.RegularEdgeInstancesLayout,1);class m{constructor(){this._commonWriter=
new g}updateSettings(u){this._commonWriter.updateSettings(u)}allocate(u){return h.SilhouetteEdgeInstancesLayout.createBuffer(u)}write(u,x,y){this._commonWriter.write(u,x,y);const {typedBuffer:z,typedBufferStride:A}=u.normalCompressed;k.compressNormal(z,x,y.faceNormal0[0],y.faceNormal0[1],y.faceNormal0[2],A);const {typedBuffer:B,typedBufferStride:C}=u.normal2Compressed;k.compressNormal(B,x,y.faceNormal1[0],y.faceNormal1[1],y.faceNormal1[2],C)}}m.Layout=h.SilhouetteEdgeInstancesLayout;m.glLayout=p.glLayout(h.SilhouetteEdgeInstancesLayout,
1);const r=l.create(),n=new b;a.RegularEdgeBufferWriter=v;a.SilhouetteEdgeBufferWriter=m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing":function(){define("exports ../../../../../core/mathUtils ../../../../../core/PooledArray ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ./Edge".split(" "),function(a,b,q,l,p,k){function h(y){const z=y.faces.length/3,A=y.faces,B=y.neighbors;y=y.vertices.position;
e.length=g.length=0;for(let D=0;D<z;D++){var C=3*D;const F=B[C],H=B[C+1],N=B[C+2],E=A[C],G=A[C+1];C=A[C+2];y.getVec(E,v);y.getVec(G,m);y.getVec(C,r);l.subtract(m,m,v);l.subtract(r,r,v);l.cross(v,m,r);l.normalize(v,v);g.pushArray(v);if(-1===F||E<G)e.push(E),e.push(G),e.push(D),e.push(F);if(-1===H||G<C)e.push(G),e.push(C),e.push(D),e.push(H);if(-1===N||C<E)e.push(C),e.push(E),e.push(D),e.push(N)}return{edges:e,normals:g}}class f{constructor(){this.length=this.index=0}}const c=new q({allocator:y=>y||
new f,deallocator:null}),e=new q({deallocator:null}),g=new q({deallocator:null}),d=new k.Edge,t=p.create(),w=p.create(),v=p.create(),m=p.create(),r=p.create(),n=b.deg2rad(4),u=Math.cos(n);q=b.deg2rad(35);const x=Math.cos(q);a.extractEdges=function(y,z,A){const B=y.vertices.position,C=y.vertices.componentIndex,D=d.position0,F=d.position1,H=d.faceNormal0,N=d.faceNormal1,{edges:E,normals:G}=h(y);y=E.length/4;const I=z.allocate(y);let O=0;const L=A?.allocate(y);let P=0,M=0,K=0;c.length=0;for(var J=0;J<
y;++J){var R=4*J;B.getVec(E.data[R],D);B.getVec(E.data[R+1],F);R=c.pushNew();R.index=4*J;R.length=l.distance(D,F)}c.sort((S,V)=>V.length-S.length);const Q=[],W=[];c.forAll(({length:S,index:V})=>{var T=E.data[V],Y=E.data[V+1];const ha=E.data[V+2],ba=E.data[V+3];V=-1===ba;B.getVec(T,D);B.getVec(Y,F);if(V)Y=3*ha,l.set(H,G.data[Y],G.data[Y+1],G.data[Y+2]),l.copy(N,H),d.componentIndex=C.get(T),d.cosAngle=l.dot(H,N);else{Y=3*ha;l.set(H,G.data[Y],G.data[Y+1],G.data[Y+2]);Y=3*ba;l.set(N,G.data[Y],G.data[Y+
1],G.data[Y+2]);d.componentIndex=C.get(T);d.cosAngle=l.dot(H,N);if(d.cosAngle>u)return;-.9999>d.cosAngle&&l.copy(N,H)}M+=S;K++;V||d.cosAngle<x?(z.write(I,O++,d),Q.push(S)):(T=b.acosClamped(d.cosAngle),l.direction(w,d.position1,d.position0),V=0<l.dot(l.cross(t,d.faceNormal0,d.faceNormal1),w)?-1:1,T*V>n&&(L&&A&&A.write(L,P++,d),W.push(S)))});y=new Float32Array(Q.reverse());J=new Float32Array(W.reverse());J=L&&A?{instancesData:L.slice(0,P),lodInfo:{lengths:J}}:void 0;return{regular:{instancesData:I.slice(0,
O),lodInfo:{lengths:y}},silhouette:J,averageEdgeLength:M/K}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/edgeRendering/Edge":function(){define(["exports","../../../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b){class q{constructor(){this.position0=b.create();this.position1=b.create();this.faceNormal0=b.create();this.faceNormal1=b.create();this.cosAngle=this.componentIndex=0}}a.Edge=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager":function(){define(["exports","./ManagedTextureBackedBuffer"],function(a,b){class q{constructor(l,p=1){this._rctx=l;this._fieldCount=p;this._buffers=[]}garbageCollect(){this._buffers=this._buffers.filter(l=>0===l.activeCount?(l.dispose(),!1):!0)}destroy(){this._buffers.forEach(l=>l.dispose());this._buffers=[]}getBuffer(l){for(const p of this._buffers)if(p.availableCount>=l)return p;if(l>b.maxIndexCount)return null;l=new b.ManagedTextureBackedBuffer(this._rctx,
this._fieldCount);this._buffers.push(l);return l}updateTextures(){for(const l of this._buffers)l.textureBuffer.updateTexture()}}a.BufferManager=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer":function(){define(["exports","./SimpleIndexManager","./TextureBackedBuffer"],function(a,b,q){class l{constructor(p,k=1){this.textureBuffer=new q.TextureBackedBuffer(p,k);this._indexManager=new b.SimpleIndexManager(65536)}dispose(){this.textureBuffer.dispose();
this.textureBuffer=void 0}get availableCount(){return this._indexManager.availableCount}get activeCount(){return this._indexManager.activeCount}acquireIndex(){const p=this._indexManager.acquire();this.textureBuffer.resizeToFit(p);return p}releaseIndex(p){this._indexManager.release(p)}}a.ManagedTextureBackedBuffer=l;a.maxIndexCount=65536;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextureBackedBuffer/SimpleIndexManager":function(){define(["exports"],
function(a){class b{constructor(q){this._maxCount=q;this._nextIndex=0;this._recycledIndices=[]}get activeCount(){return this._nextIndex-this._recycledIndices.length}get availableCount(){return this._recycledIndices.length+this._maxCount-this._nextIndex}acquire(){if(0<this._recycledIndices.length)return this._recycledIndices.pop();if(this.availableCount)return this._nextIndex++}release(q){this._recycledIndices.push(q)}}a.SimpleIndexManager=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer":function(){define(["exports","../../../../../geometry/support/buffer/BufferView","../../../../webgl/enums","../../../../webgl/Texture","../../../../webgl/TextureDescriptor"],function(a,b,q,l,p){class k{constructor(h,f=1){this._rctx=h;this._fieldCount=f;this.textureWidth=4096;this._dirty=!0;h=new p.TextureDescriptor(this.textureWidth,1);h.samplingMode=q.TextureSamplingMode.NEAREST;h.wrapMode=q.TextureWrapMode.CLAMP_TO_EDGE;this._texture=
new l.Texture(this._rctx,h);this._data=new b.BufferViewVec4u8(new ArrayBuffer(4*this.textureWidth))}dispose(){this._texture.dispose();this._data=this._texture=void 0}setData(h,f,c,e,g,d){h=h*this._fieldCount+f;this._dirty=!0;this._data.set(h,0,c);this._data.set(h,1,e);this._data.set(h,2,g);this._data.set(h,3,d)}setDataElement(h,f,c,e){h=h*this._fieldCount+f;this._dirty=!0;this._data.set(h,c,e)}getDataElement(h,f,c){h=h*this._fieldCount+f;this._dirty=!0;return this._data.get(h,c)}resizeToFit(h){h=
(h+1)*this._fieldCount;h>this._data.count&&(h=new b.BufferViewVec4u8(new ArrayBuffer(Math.ceil(h/this.textureWidth)*this.textureWidth*4)),h.typedBuffer.set(this._data.typedBuffer),this._data=h)}updateTexture(){if(this._dirty){var h=this._texture.descriptor.width;this._data.count>h*this._texture.descriptor.height&&this._texture.resize(h,this._data.count/h);this._texture.setData(this._data.typedBuffer);this._dirty=!1}}get texture(){return this._texture}}a.TextureBackedBuffer=k;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/highlight/Highlight":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/colorUtils ../../../../../core/has ../../../../../core/maybe ../../../../../core/reactiveUtils ../../../../../core/accessorSupport/decorators/property ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../core/libs/gl-matrix-2/math/vec2 ../../../webgl/formats ../../../webgl/RenderNode ./HighlightApplyTechnique ./HighlightBlurTechnique ./HighlightDefaults ./HighlightDownsampleTechnique ./HighlightPassParameters ../../lib/basicInterfaces ../../lib/DefaultVertexAttributeLocations ../../lib/DefaultVertexBufferLayouts ../../lib/VertexArrayObject ../../../../../chunks/HighlightBlur.glsl ../../../../../chunks/HighlightDownsample.glsl ../../../../webgl/BufferObject ../../../../webgl/enums ../../../../webgl/Util".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F){a.Highlight=class extends t{constructor(H){super(H);this.produces="highlight-color";this.consumes={required:["highlight-color","highlights"]};this._passParameters=new n.HighlightPassParameters;this._downsampleDrawParameters=new B.HighlightDownsampleDrawParameters;this._blurDrawParameters=new A.HighlightBlurDrawParameters;this._blurColorFormat=l("mac")?d.ColorFormat.RGBA:d.ColorFormat.RGBA4;this._grid={coverage:null,vao:null,verticalCellCount:0,
horizontalCellCount:0,viewportWidth:0,viewportHeight:0};this._blurTechnique=H.techniques.acquire(v.HighlightBlurTechnique);this._downsampleTechnique=H.techniques.acquire(r.HighlightDownsampleTechnique);this._applyTechnique=H.techniques.acquire(w.HighlightApplyTechnique)}initialize(){this.addHandles([k.watch(()=>this.view.highlightOptions.color,H=>{this._passParameters.color=q.unitRGBAFromColor(H??m.defaultColor);this.view.highlightOptions.haloColor||(this._passParameters.haloColor=this._passParameters.color);
this.requestRender(u.RenderRequestType.UPDATE)},k.syncAndInitial),k.watch(()=>this.view.highlightOptions.haloColor,H=>{this._passParameters.haloColor=null!=H?q.unitRGBAFromColor(H):this._passParameters.color;this.requestRender(u.RenderRequestType.UPDATE)},k.syncAndInitial),k.watch(()=>this.view.highlightOptions.haloOpacity,H=>{this._passParameters.haloOpacity=H??m.defaultHaloOpacity;this._passParameters.haloOpacityOccluded=.25*this._passParameters.haloOpacity;this.requestRender(u.RenderRequestType.UPDATE)},
k.syncAndInitial),k.watch(()=>this.view.highlightOptions.fillOpacity,H=>{this._passParameters.fillOpacity=H??m.defaultFillOpacity;this._passParameters.fillOpacityOccluded=.25*this._passParameters.fillOpacity;this.requestRender(u.RenderRequestType.UPDATE)},k.syncAndInitial)])}destroy(){this._blurTechnique.release();this._downsampleTechnique.release();this._applyTechnique.release();this._grid.coverage=p.releaseMaybe(this._grid.coverage);this._grid.vao=p.disposeMaybe(this._grid.vao)}render(H){if(this.bindParameters.decorations===
u.Decorations.OFF)return H.find(({name:J})=>"highlight-color"===J);if(!(this._blurTechnique.compiled&&this._downsampleTechnique.compiled&&this._applyTechnique.compiled))return this.requestRender(u.RenderRequestType.UPDATE),H.find(({name:J})=>"highlight-color"===J);var N=H.find(({name:J})=>"highlights"===J).getTexture();const E=this.bindParameters.camera;var G=E.pixelRatio,I=Math.ceil(E.fullWidth/G);const O=Math.ceil(E.fullHeight/G);G=this.renderingContext;this._gridUpdateResources(N);this._gridComputeCoverage(N,
this.bindParameters);this._passParameters.highlightTexture=N;this._passParameters.coverageTexture=this._grid.coverage?.getTexture();const {width:L,height:P}=N.descriptor;g.set(this._passParameters.coverageRounding,L/(Math.ceil(L/B.gridCellPixelSize)*B.gridCellPixelSize),P/(Math.ceil(P/B.gridCellPixelSize)*B.gridCellPixelSize));const M=this._grid.vao;G.bindVAO(M);const K=this.fboCache.acquire(I,O,"highlight blur",this._blurColorFormat);G.unbindTexture(K.fbo?.colorTexture);G.bindFramebuffer(K.fbo);
G.setClearColor(0,0,0,0);G.clear(D.ClearBufferBit.COLOR_BUFFER_BIT);G.setViewport(0,0,I,O);this._blurDrawParameters.blurInputTexture=N;g.set(this._blurDrawParameters.blurSize,1/I,0);N=G.bindTechnique(this._blurTechnique,this.bindParameters,this._passParameters,this._blurDrawParameters);G.drawArrays(this._blurTechnique.primitiveType,0,F.vertexCount(M,"geometry"));I=this.fboCache.acquire(I,O,"highlight blur",this._blurColorFormat);G.unbindTexture(I.fbo?.colorTexture);G.bindFramebuffer(I.fbo);G.setClearColor(0,
0,0,0);G.clear(D.ClearBufferBit.COLOR_BUFFER_BIT);this._blurDrawParameters.blurInputTexture=K.getTexture();g.set(this._blurDrawParameters.blurSize,0,1/O);N.bindDraw(this._blurDrawParameters,this.bindParameters,this._passParameters);G.drawArrays(this._blurTechnique.primitiveType,0,F.vertexCount(M,"geometry"));H=H.find(({name:J})=>"highlight-color"===J);G.bindFramebuffer(H.fbo);G.setViewport4fv(E.fullViewport);this._passParameters.blurTexture=I.getTexture();G.bindTechnique(this._applyTechnique,this.bindParameters,
this._passParameters);G.drawArrays(this._applyTechnique.primitiveType,0,F.vertexCount(M,"geometry"));K.release();I.release();return H}_gridUpdateResources(H){const N=this.renderingContext,E=this._grid;var G=Math.ceil(H.descriptor.height/B.gridCellPixelSize),I=Math.ceil(H.descriptor.width/B.gridCellPixelSize);if(!E.vao||E.verticalCellCount!==G||E.horizontalCellCount!==I){E.verticalCellCount=G;E.horizontalCellCount=I;H=G+1;var O=I+1;G=1/G;I=1/I;var L=new Float32Array(24*H*O),P=0;for(let M=0;M<H;M++)for(let K=
0;K<O;K++)L[P++]=(K-.5)*I*2-1,L[P++]=(M-.5)*G*2-1,L[P++]=K*I,L[P++]=M*G,L[P++]=(K+.5)*I*2-1,L[P++]=(M-.5)*G*2-1,L[P++]=K*I,L[P++]=M*G,L[P++]=(K-.5)*I*2-1,L[P++]=(M+.5)*G*2-1,L[P++]=K*I,L[P++]=M*G,L[P++]=(K-.5)*I*2-1,L[P++]=(M+.5)*G*2-1,L[P++]=K*I,L[P++]=M*G,L[P++]=(K+.5)*I*2-1,L[P++]=(M-.5)*G*2-1,L[P++]=K*I,L[P++]=M*G,L[P++]=(K+.5)*I*2-1,L[P++]=(M+.5)*G*2-1,L[P++]=K*I,L[P++]=M*G;E.vao?.dispose();E.vao=new z.VertexArrayObject(N,x.Default3D,{geometry:y.Pos2Tex},{geometry:C.BufferObject.createVertex(N,
D.Usage.STATIC_DRAW,L)})}}_gridComputeCoverage(H,N){const E=this.renderingContext,G=this._grid;var I=H.descriptor;const O=Math.ceil(I.width/B.gridCellPixelSize);I=Math.ceil(I.height/B.gridCellPixelSize);this._downsampleDrawParameters.input=H;G.coverage?.release();G.coverage=this.fboCache.acquire(O,I,"highlight coverage",d.ColorFormat.RG);E.unbindTexture(G.coverage.fbo?.colorTexture);E.bindFramebuffer(G.coverage.fbo);E.bindTechnique(this._downsampleTechnique,N,this._passParameters,this._downsampleDrawParameters);
E.setViewport(0,0,O,I);E.screen.draw()}get test(){}};b.__decorate([h.property()],a.Highlight.prototype,"produces",void 0);b.__decorate([h.property()],a.Highlight.prototype,"consumes",void 0);b.__decorate([h.property({constructOnly:!0})],a.Highlight.prototype,"techniques",void 0);a.Highlight=b.__decorate([e.subclass("esri.views.3d.webgl-engine.effects.highlight.Highlight")],a.Highlight);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/HighlightApply.glsl ../../../../webgl/enums ../../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c){class e extends l.ShaderTechnique{initializeProgram(g){return new k.Program(g.rctx,e.shader.get().build(),p.Default3D)}initializePipeline(){return c.makePipelineState({blending:c.separateBlendingParams(f.BlendFactor.SRC_ALPHA,f.BlendFactor.ONE,f.BlendFactor.ONE_MINUS_SRC_ALPHA,f.BlendFactor.ONE_MINUS_SRC_ALPHA),colorWrite:c.defaultColorWriteParams})}}e.shader=new q.ReloadableShaderModule(h.HighlightApply,()=>new Promise((g,d)=>a(["../../shaders/HighlightApply.glsl"],g,
d)));b.HighlightApplyTechnique=e;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/HighlightApply.glsl":function(){define("exports ./vec42 ../core/libs/gl-matrix-2/factories/vec4f64 ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/VertexAttribute ./HighlightDownsample.glsl".split(" "),
function(a,b,q,l,p,k,h,f,c,e){function g(){const t=new h.ShaderBuilder,{vertex:w,fragment:v}=t,m=w.code,r=v.code;t.attributes.add(c.VertexAttribute.POSITION,"vec2");t.varyings.add("uv","vec2");t.attributes.add(c.VertexAttribute.UV0,"vec2");w.uniforms.add(new f.Texture2DPassUniform("coverageTex",n=>n.coverageTexture),new l.Float2PassUniform("coverageRounding",n=>n.coverageRounding));m.add(k.glsl`void main() {
vec4 cov = texture(coverageTex, uv0 * coverageRounding);
if (cov.r == 0.0) {
gl_Position = vec4(0.0);
return;
}
gl_Position = vec4(position, 0.0, 1.0);
uv = position.xy * 0.5 + vec2(0.5);
}`);v.uniforms.add(new f.Texture2DPassUniform("tex",n=>n.blurTexture),new f.Texture2DPassUniform("highlightTexture",n=>n.highlightTexture),new p.Float4PassUniform("uColor",n=>n.color),new p.Float4PassUniform("haloColor",n=>n.haloColor),new p.Float4PassUniform("opacities",n=>b.set(d,n.haloOpacity,n.haloOpacityOccluded,n.fillOpacity,n.fillOpacityOccluded)));v.constants.add("inner","float",1-(e.outlineSize-e.blurSize)/e.outlineSize);r.add(k.glsl`void main() {
vec4 blurredHighlightValue = texture(tex, uv);
float highlightIntensity = blurredHighlightValue.a;
if (highlightIntensity == 0.0) {
discard;
}
vec4 origin_color = texture(highlightTexture, uv);
float outlineIntensity;
float fillIntensity;
if (blurredHighlightValue.g > blurredHighlightValue.b) {
outlineIntensity = haloColor.w * opacities[1];
fillIntensity = uColor.w * opacities[3];
}
else {
outlineIntensity = haloColor.w * opacities[0];
fillIntensity = uColor.w * opacities[2];
}
float outlineFactor = smoothstep(0.0, inner, highlightIntensity);
float fillFactor = any(notEqual(origin_color, vec4(0.0, 0.0, 0.0, 0.0))) ? 1.0 : 0.0;
float intensity = outlineIntensity * outlineFactor * (1.0 - fillFactor) + fillIntensity * fillFactor;
fragColor = vec4(mix(haloColor.rgb, uColor.rgb, fillFactor), intensity);
}`);return t}const d=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:g},Symbol.toStringTag,{value:"Module"}));a.HighlightApply=q;a.build=g})},"esri/chunks/HighlightDownsample.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl","../views/3d/webgl-engine/core/shaderModules/interfaces","../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform"],function(a,b,q,l,
p){function k(){const c=new l.ShaderBuilder,{outputs:e,fragment:g}=c;c.include(b.ScreenSpacePass);g.uniforms.add(new p.Texture2DDrawUniform("textureInput",d=>d.input));g.constants.add("sampleArea","int",5);e.add("fragGrid","vec2");g.code.add(q.glsl`
void main() {
float red = 0.0;
float green = 1.0;
int cellSize = ${q.glsl.int(32)};
vec2 texelSize = 1.0 / vec2(textureSize(textureInput, 0));
vec2 offset = floor(gl_FragCoord.xy) * vec2(float(cellSize));
for(int x = -sampleArea; x < cellSize + sampleArea; x += 2) {
for(int y = -sampleArea; y < cellSize + sampleArea; y += 2) {
vec2 coord = (offset + vec2(float(x), float(y))) * texelSize;
vec4 value = texture(textureInput, coord);
float mx = floor(max(value.g, value.b));
red = max(red, ceil(value.r));
green = min(green, mx);
if(red == 1.0 && green == 0.0) {
fragGrid = vec2(red, green);
return;
}
}
}
fragGrid = vec2(red, green);
}`);return c}class h extends q.NoParameters{}const f=Object.freeze(Object.defineProperty({__proto__:null,HighlightDownsampleDrawParameters:h,blurSize:.4,build:k,gridCellPixelSize:32,outlineSize:9},Symbol.toStringTag,{value:"Module"}));a.HighlightDownsample=f;a.HighlightDownsampleDrawParameters=h;a.blurSize=.4;a.build=k;a.gridCellPixelSize=32;a.outlineSize=9})},"esri/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/HighlightBlur.glsl ../../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx,c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.HighlightBlur,()=>new Promise((e,g)=>a(["../../shaders/HighlightBlur.glsl"],e,g)));b.HighlightBlurTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/HighlightBlur.glsl":function(){define("exports ../core/libs/gl-matrix-2/factories/vec2f64 ../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c){function e(){const t=new k.ShaderBuilder,{attributes:w,varyings:v,vertex:m,fragment:r}=t;w.add(c.VertexAttribute.POSITION,"vec2");w.add(c.VertexAttribute.UV0,"vec2");v.add("blurCoordinate","vec3");m.uniforms.add(new f.Texture2DPassUniform("coverageTex",n=>n.coverageTexture),new l.Float2PassUniform("coverageRounding",n=>n.coverageRounding));m.code.add(p.glsl`void main() {
gl_Position = vec4(position, 0.0, 1.0);
vec4 cov = texture(coverageTex, uv0 * coverageRounding);
if (cov.r == 0.0) {
gl_Position = vec4(0.0);
}
blurCoordinate = vec3(gl_Position.xy * 0.5 + vec2(0.5), cov.g);
}`);r.uniforms.add(new q.Float2DrawUniform("blurSize",n=>n.blurSize),new h.Texture2DDrawUniform("tex",n=>n.blurInputTexture));r.code.add(p.glsl`void main() {
vec2 uv = blurCoordinate.xy;
vec4 center = texture(tex, uv);
if (blurCoordinate.z == 1.0) {
fragColor = center;
} else {
vec4 sum = center * 0.204164;
sum += texture(tex, uv + blurSize * 1.407333) * 0.304005;
sum += texture(tex, uv - blurSize * 1.407333) * 0.304005;
sum += texture(tex, uv + blurSize * 3.294215) * 0.093913;
sum += texture(tex, uv - blurSize * 3.294215) * 0.093913;
fragColor = sum;
}
}`);return t}class g extends p.NoParameters{constructor(){super(...arguments);this.blurSize=b.create()}}const d=Object.freeze(Object.defineProperty({__proto__:null,HighlightBlurDrawParameters:g,build:e},Symbol.toStringTag,{value:"Module"}));a.HighlightBlur=d;a.HighlightBlurDrawParameters=g;a.build=e})},"esri/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/HighlightDownsample.glsl ../../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx,c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.HighlightDownsample,()=>new Promise((e,g)=>a(["../../shaders/HighlightDownsample.glsl"],e,g)));b.HighlightDownsampleTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/highlight/HighlightPassParameters":function(){define(["exports",
"../../../../../core/libs/gl-matrix-2/factories/vec2f64","../../../../../core/libs/gl-matrix-2/factories/vec4f64","../../core/shaderModules/interfaces"],function(a,b,q,l){class p extends l.NoParameters{constructor(){super(...arguments);this.color=q.fromValues(1,0,1,1);this.haloColor=q.fromValues(1,0,1,1);this.haloOpacity=1;this.haloOpacityOccluded=.25;this.fillOpacity=.2;this.fillOpacityOccluded=.05;this.coverageRounding=b.fromValues(1,1)}}a.HighlightPassParameters=p;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/webgl-engine/effects/highlight/ShadowHighlight":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/colorUtils ../../../../../core/mathUtils ../../../../../core/reactiveUtils ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../ViewingMode ../../../webgl/RenderNode ./HighlightDefaults ./ShadowHighlightTechnique ../../lib/basicInterfaces".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){a.ShadowHighlight=class extends w{constructor(u){super(u);this.produces="composite-color";this.consumes={required:["composite-color","highlights"]};this._passParameters=new m.ShadowHighlightPassParameters;this._maxOpacity=1;this._shadowDifference=.2;this._technique=u.techniques.acquire(m.ShadowHighlightTechnique)}initialize(){this.addHandles([p.watch(()=>this.view.highlightOptions.shadowOpacity,u=>{this._passParameters.shadowOpacity=u??v.defaultShadowOpacity;
this._updateOccludedShadowOpacity();this._updateMaxOpacity()},p.syncAndInitial),p.watch(()=>this.view.highlightOptions.shadowDifference,u=>{this._shadowDifference=u??v.defaultShadowDifference;this._updateOccludedShadowOpacity();this._updateMaxOpacity()},p.syncAndInitial),p.watch(()=>this.view.highlightOptions.shadowColor,u=>{this._passParameters.shadowColor=q.unitRGBAFromColor(u??v.defaultShadowColor);this._updateMaxOpacity()},p.syncAndInitial)])}destroy(){this._technique.release()}_updateOccludedShadowOpacity(){this._passParameters.occludedShadowOpacity=
this._passParameters.shadowOpacity*(1-this._shadowDifference)}_updateMaxOpacity(){this._maxOpacity=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity)*this._passParameters.shadowColor[3]}render(u){const x=u.find(({name:z})=>"composite-color"===z),y=this.bindParameters;if(!y.shadowHighlightsVisible||!y.depth||!this._ensureIfVisible(y.camera,y.lighting.mainLight.direction))return x;if(!this._technique.compiled)return this.requestRender(r.RenderRequestType.UPDATE),
x;this._passParameters.highlight=u.find(({name:z})=>"highlights"===z)?.getTexture();this._passParameters.origin=y.camera.center;u=this.renderingContext;u.bindFramebuffer(x.fbo);u.bindTechnique(this._technique,y,this._passParameters);u.screen.draw();return x}_ensureIfVisible(u,x){this._passParameters.opacityElevation=1-l.smoothstep(4E4,5E4,u.relativeElevation);u=this.viewingMode===t.ViewingMode.Global?g.normalize(n,u.center):g.set(n,0,0,1);x=g.dot(u,x);this._passParameters.dayNightTerminator=l.smoothstep(0,
1,l.clamp(30*x,0,1));return.001953125<=this._maxOpacity*this._passParameters.opacityElevation*this._passParameters.dayNightTerminator}};b.__decorate([k.property()],a.ShadowHighlight.prototype,"produces",void 0);b.__decorate([k.property()],a.ShadowHighlight.prototype,"consumes",void 0);b.__decorate([k.property({constructOnly:!0})],a.ShadowHighlight.prototype,"viewingMode",void 0);b.__decorate([k.property({constructOnly:!0})],a.ShadowHighlight.prototype,"techniques",void 0);a.ShadowHighlight=b.__decorate([e.subclass("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlight")],
a.ShadowHighlight);const n=d.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique":function(){define("require exports ../../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../core/shaderLibrary/shading/ReadShadowMap.glsl ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../shaders/ShadowConfiguration ../../../../../chunks/ShadowHighlight.glsl ../../../../webgl/enums ../../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){class t extends l.ReadShadowMapPassParameters{constructor(){super(...arguments);this.shadowColor=q.fromValues(1,0,1,1);this.shadowOpacity=.2;this.occludedShadowOpacity=.1;this.dayNightTerminator=this.opacityElevation=1}}class w extends k.ShaderTechnique{constructor(v){super(v,new c.ShadowConfiguration,()=>this.destroy())}initializeProgram(v){return new f.Program(v.rctx,w.shader.get().build(this.configuration),h.Default3D)}initializePipeline(){return d.makePipelineState({blending:d.separateBlendingParams(g.BlendFactor.SRC_ALPHA,
g.BlendFactor.ONE,g.BlendFactor.ONE_MINUS_SRC_ALPHA,g.BlendFactor.ONE_MINUS_SRC_ALPHA),colorWrite:d.defaultColorWriteParams,depthTest:null,depthWrite:null})}get primitiveType(){return g.PrimitiveType.TRIANGLE_STRIP}}w.shader=new p.ReloadableShaderModule(e.ShadowHighlight,()=>new Promise((v,m)=>a(["../../shaders/ShadowHighlight.glsl"],v,m)));b.ShadowHighlightPassParameters=t;b.ShadowHighlightTechnique=w;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ShadowConfiguration":function(){define(["exports",
"../../../../chunks/tslib.es6","../core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q){class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.receiveShadows=!0}}b.__decorate([q.parameter()],l.prototype,"receiveShadows",void 0);a.ShadowConfiguration=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/ShadowHighlight.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/ShadowMap".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){function u(z){const A=new m.ShaderBuilder;A.include(c.ReadShadowMapPass,z);A.include(h.ScreenSpacePass);A.include(k.NormalFromDepth);z=A.fragment;z.include(e.RgbaFloatEncoding);z.uniforms.add(new r.Texture2DPassUniform("defaultDepthTex",(B,C)=>C.shadowMap.getSnapshot(n.SnapshotSlot.ExcludeHighlight)),new r.Texture2DPassUniform("highlightDepthTex",(B,C)=>C.shadowMap.getSnapshot(n.SnapshotSlot.Highlight)),new r.Texture2DPassUniform("depthMap",(B,C)=>C.depth?.attachment),
new r.Texture2DPassUniform("highlightTexture",B=>B.highlight),new d.Float4PassUniform("uColor",B=>B.shadowColor),new t.FloatPassUniform("opacity",B=>B.shadowOpacity),new t.FloatPassUniform("occludedOpacity",B=>B.occludedShadowOpacity),new t.FloatPassUniform("terminationFactor",B=>B.opacityElevation*B.dayNightTerminator),new g.Float3PassUniform("lightingMainDirectionView",(B,C)=>l.normalize(y,l.transformMat4(y,C.lighting.mainLight.direction,C.camera.viewInverseTransposeMatrix))),new v.Matrix4PassUniform("inverseViewMatrix",
(B,C)=>b.invert(x,b.translate(x,C.camera.viewMatrix,C.camera.center))));z.constants.add("unoccludedHighlightFlag","vec4",f.unoccludedHighlightFlag);z.code.add(w.glsl`
void main(void) {
vec4 highlightInfo = texture(highlightTexture, uv);
float visiblyHighlighted = (1.0 - clamp(distance(unoccludedHighlightFlag, highlightInfo), 0.0, 1.0)) * highlightInfo.a;
if (visiblyHighlighted > ${w.glsl.float(.99999)}) {
discard;
}
float depth = depthFromTexture(depthMap, uv);
// 1.0 is the clear value of depthMap, which means nothing has been drawn there and we should discard
if (depth >= 1.0 || depth <= 0.0) {
discard;
}
float currentPixelDepth = linearizeDepth(depth);
vec4 currentPixelPos = vec4(reconstructPosition(gl_FragCoord.xy, currentPixelDepth), 1.0);
vec4 worldSpacePos = inverseViewMatrix * currentPixelPos;
mat4 shadowMatrix;
float linearDepth = -currentPixelDepth;
int i = chooseCascade(linearDepth, shadowMatrix);
if (i >= numCascades) {
discard;
}
vec3 lvpos = lightSpacePosition(worldSpacePos.xyz, shadowMatrix);
// vertex completely outside? -> no shadow
if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) {
discard;
}
ivec2 texSize = textureSize(highlightDepthTex, 0);
ivec2 uvShadow = ivec2(cascadeCoordinates(i, texSize, lvpos) * vec2(texSize));
float depthHighlight = readShadowMapDepth(uvShadow, highlightDepthTex);
bool shadowHighlight = depthHighlight < lvpos.z;
if (!shadowHighlight) {
discard;
}
float depthDefault = readShadowMapDepth(uvShadow, defaultDepthTex);
bool shadowDefault = depthDefault < lvpos.z;
vec3 normal = normalFromDepth(depthMap, currentPixelPos.xyz, gl_FragCoord.xy, uv);
bool shaded = dot(normal, lightingMainDirectionView) < ${w.glsl.float(.025)};
float fragOpacity = (shadowDefault || shaded) ? occludedOpacity : opacity;
fragColor = vec4(uColor.rgb, uColor.a * fragOpacity * terminationFactor);
}
`);return A}const x=q.create(),y=p.create();q=Object.freeze(Object.defineProperty({__proto__:null,build:u},Symbol.toStringTag,{value:"Module"}));a.ShadowHighlight=q;a.build=u})},"esri/views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl":function(){define(["exports","./output/ReadDepth.glsl","./util/CameraSpace.glsl","../shaderModules/interfaces"],function(a,b,q,l){a.NormalFromDepth=function(p){const k=p.fragment;p.include(q.CameraSpace);k.include(b.ReadDepth);k.code.add(l.glsl`vec3 normalFromDepth(sampler2D depthMap, vec3 pixelPos, vec2 fragCoord, vec2 uv) {
ivec2 iuv = ivec2(uv * vec2(textureSize(depthMap, 0)));
float leftPixelDepth = linearizeDepth(texelFetch(depthMap, iuv + ivec2(-1, 0), 0).r);
float rightPixelDepth = linearizeDepth(texelFetch(depthMap, iuv + ivec2(1, 0), 0).r);
float bottomPixelDepth = linearizeDepth(texelFetch(depthMap, iuv + ivec2(0, -1), 0).r);
float topPixelDepth = linearizeDepth(texelFetch(depthMap, iuv + ivec2(0, 1), 0).r);
bool pickLeft = abs(pixelPos.z - leftPixelDepth) < abs(pixelPos.z - rightPixelDepth);
bool pickBottom = abs(pixelPos.z - bottomPixelDepth) < abs(pixelPos.z - topPixelDepth);
vec3 fragCoordHorizontal = pickLeft
? vec3(fragCoord + vec2(-1.0, 0.0), leftPixelDepth)
: vec3(fragCoord + vec2(1.0, 0.0), rightPixelDepth);
vec3 fragCoordVertical = pickBottom
? vec3(fragCoord + vec2(0.0, -1.0), bottomPixelDepth)
: vec3(fragCoord + vec2(0.0, 1.0), topPixelDepth);
vec3 verticalPixelPos = reconstructPosition(fragCoordHorizontal.xy, fragCoordHorizontal.z);
vec3 horizontalPixelPos = reconstructPosition(fragCoordVertical.xy, fragCoordVertical.z);
vec3 normal = normalize(cross(verticalPixelPos - pixelPos, horizontalPixelPos - pixelPos));
return pickLeft == pickBottom ? normal : -normal;
}`)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/magnifier/MagnifierRenderNode":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/asyncUtils ../../../../../core/mathUtils ../../../../../core/maybe ../../../../../core/reactiveUtils ../../../../../core/screenUtils ../../../../../core/urlUtils ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../support/requestImageUtils ../../../webgl/RenderNode ./MagnifierTechnique ../../lib/basicInterfaces ../../lib/DefaultVertexAttributeLocations ../../lib/DefaultVertexBufferLayouts ../../lib/glUtil3D ../../../../../chunks/Magnifier.glsl ../../../../magnifier/resources ../../../../webgl/enums ../../../../webgl/Texture ../../../../webgl/TextureDescriptor".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C){a.MagnifierRenderNode=class extends v{constructor(D){super(D);this.produces="magnifier-color";this.consumes={required:["magnifier-color"]};this._imageLoadTask=this._imageSources=null;this._passParameters=new y.MagnifierPassParameters;this._magnifier=this._technique=this._vao=null;this._tmpScreenPoint=h.createScreenPointArray();this._tmpRenderPoint=h.createRenderScreenPointArray()}initialize(){this.addHandles([k.watch(()=>this.view.magnifier,
D=>this._update(D),k.syncAndInitial)])}_update(D){D!==this._magnifier&&(this.removeAllHandles(),this._magnifier=D,D=()=>{const F=this._validMagnifier;F?(this._loadResources(F),this.produces="magnifier-color"):this.produces="disabled";this.requestRender()},this._magnifier&&this.addHandles(k.watch(()=>this._magnifier?.version,D)),D())}get _validMagnifier(){return this._magnifier?.visible&&this._magnifier?.position&&0<this._magnifier?.size?this._magnifier:null}get _factor(){return this._magnifier?.factor||
1}destroy(){this._magnifier=null;null!=this._imageLoadTask&&(this._imageLoadTask.task.abort(),this._imageLoadTask=null);this._disposeTextures();this._vao=p.disposeMaybe(this._vao)}_disposeTextures(){this._passParameters.mask=p.disposeMaybe(this._passParameters.mask);this._passParameters.overlay=p.disposeMaybe(this._passParameters.overlay);this._passParameters.input=p.disposeMaybe(this._passParameters.input)}render(D){const F=this._validMagnifier;D=D.find(({name:P})=>"magnifier-color"===P);if(null==
F)return D;if(null==this._imageSources)return this.requestRender(r.RenderRequestType.UPDATE),D;const H=this.renderingContext;var N=Math.ceil(this.camera.pixelRatio*F.size);this._vao??(this._vao=x.createQuadVAO(H,u.Pos2,n.Default3D,0,1));this._technique??(this._technique=this.techniques.acquire(m.MagnifierTechnique));this._ensureTextureResources(H,N);if(!this._technique?.compiled||!this._passParameters.input)return this.requestRender(r.RenderRequestType.UPDATE),D;N=Math.ceil(1/this._factor*N);const E=
this._passParameters.input;E.resize(N,N);h.screenPointObjectToArray(F.position,this._tmpScreenPoint);var G=this.camera.screenToRender(this._tmpScreenPoint,this._tmpRenderPoint),I=this.camera.fullHeight;const O=.5*N,L=.5*N;G[0]=l.clamp(G[0],O,this.camera.fullWidth-O-1);G[1]=l.clamp(G[1],L,I-L-1);I=Math.floor(G[0]-O);G=Math.floor(G[1]-L);H.bindFramebuffer(D.fbo);this._technique.program.bindTexture("textureInput",E);H.gl.copyTexImage2D(E.descriptor.target,0,E.descriptor.pixelFormat,I,G,N,N,0);this._passParameters.magnifier=
F;H.bindTechnique(this._technique,this.bindParameters,this._passParameters);H.bindVAO(this._vao);H.drawArrays(A.PrimitiveType.TRIANGLE_STRIP,0,4);return D}_loadResources(D){const {maskUrl:F,overlayUrl:H}=D;if(this._imageLoadTask?.maskUrl!==F||this._imageLoadTask?.overlayUrl!==H)this._imageLoadTask?.task.abort(),this._imageLoadTask=this._imageSources=null;this._imageSources||this._imageLoadTask||(this._imageLoadTask={maskUrl:F,overlayUrl:H,task:q.createTask(async N=>{const E=null==F||null==H?z.loadMagnifierResources(N):
null,G=null!=F?w.requestImage(F,{signal:N}):E.then(I=>I.mask);N=null!=H?w.requestImage(H,{signal:N}):E.then(I=>I.overlay);this._imageSources={mask:await G,overlay:await N}})})}_ensureTextureResources(D,F){null==this._imageSources||this._passParameters.size===F&&this._passParameters.input&&this._passParameters.mask&&this._passParameters.overlay||(this._disposeTextures(),this._imageSources.overlay.width=this._imageSources.mask.width=F,this._imageSources.overlay.height=this._imageSources.mask.height=
F,F=new C.TextureDescriptor,F.internalFormat=A.PixelFormat.RGBA,F.wrapMode=A.TextureWrapMode.CLAMP_TO_EDGE,F.flipped=!0,F.preMultiplyAlpha=!f.isSVG(this._imageSources.overlay.src)||!D.driverTest.svgPremultipliesAlpha.result,this._passParameters.overlay=new B.Texture(D,F,this._imageSources.overlay),F.pixelFormat=F.internalFormat=A.PixelFormat.ALPHA,F.preMultiplyAlpha=!1,this._passParameters.mask=new B.Texture(D,F,this._imageSources.mask),F.pixelFormat=F.internalFormat=A.PixelFormat.RGBA,F.flipped=
!1,this._passParameters.input=new B.Texture(D,F))}};b.__decorate([c.property()],a.MagnifierRenderNode.prototype,"produces",void 0);b.__decorate([c.property()],a.MagnifierRenderNode.prototype,"consumes",void 0);b.__decorate([c.property()],a.MagnifierRenderNode.prototype,"_imageSources",void 0);b.__decorate([c.property()],a.MagnifierRenderNode.prototype,"_imageLoadTask",void 0);b.__decorate([c.property({constructOnly:!0})],a.MagnifierRenderNode.prototype,"techniques",void 0);a.MagnifierRenderNode=b.__decorate([t.subclass("esri.views.3d.webgl-engine.effects.magnifier.MagnifierRenderNode")],
a.MagnifierRenderNode);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/Magnifier.glsl ../../../../webgl/enums ../../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c){class e extends l.ShaderTechnique{initializeProgram(g){return new k.Program(g.rctx,
e.shader.get().build(),p.Default3D)}initializePipeline(){return c.makePipelineState({blending:c.simpleBlendingParams(f.BlendFactor.ONE,f.BlendFactor.ONE_MINUS_SRC_ALPHA),depthTest:null,depthWrite:null,colorWrite:c.defaultColorWriteParams})}}e.shader=new q.ReloadableShaderModule(h.Magnifier,()=>new Promise((g,d)=>a(["../../shaders/Magnifier.glsl"],g,d)));b.MagnifierTechnique=e;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Magnifier.glsl":function(){define("exports ../core/screenUtils ./vec42 ../core/libs/gl-matrix-2/factories/vec4f64 ../views/3d/webgl-engine/core/shaderModules/BooleanPassUniform ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e){function g(){const m=new f.ShaderBuilder;m.attributes.add(e.VertexAttribute.POSITION,"vec2");m.vertex.uniforms.add(new k.Float4PassUniform("drawPosition",(r,n)=>{var u=n.camera.pixelRatio;const x=r.magnifier.offset.x*u,y=r.magnifier.offset.y*u;b.screenPointObjectToArray(r.magnifier.position,t);const z=n.camera.screenToRender(t,w);r=Math.ceil(u*r.magnifier.size);u=n.camera.fullWidth;n=n.camera.fullHeight;return q.set(v,-1+(z[0]+x)/u*2,-1+(z[1]-y)/n*2,r/u*2,r/n*2)}));m.varyings.add("vUV",
"vec2");m.vertex.code.add(h.glsl`void main(void) {
vUV = position;
gl_Position = vec4(drawPosition.xy + vec2(position - 0.5) * drawPosition.zw, 0.0, 1.0);
}`);m.fragment.uniforms.add(new c.Texture2DPassUniform("textureInput",r=>r.input));m.fragment.uniforms.add(new c.Texture2DPassUniform("textureMask",r=>r.mask));m.fragment.uniforms.add(new c.Texture2DPassUniform("textureOverlay",r=>r.overlay));m.fragment.uniforms.add(new p.BooleanPassUniform("maskEnabled",r=>r.magnifier.maskEnabled));m.fragment.uniforms.add(new p.BooleanPassUniform("overlayEnabled",r=>r.magnifier.overlayEnabled));m.fragment.code.add(h.glsl`const float barrelFactor = 1.1;
vec2 barrel(vec2 uv) {
vec2 uvn = uv * 2.0 - 1.0;
if (uvn.x == 0.0 && uvn.y == 0.0) {
return vec2(0.5, 0.5);
}
float theta = atan(uvn.y, uvn.x);
float r = pow(length(uvn), barrelFactor);
return r * vec2(cos(theta), sin(theta)) * 0.5 + 0.5;
}
void main() {
float mask = maskEnabled ? texture(textureMask, vUV).a : 1.0;
vec4 inputColor = texture(textureInput, barrel(vUV)) * mask;
vec4 overlayColor = overlayEnabled ? texture(textureOverlay, vUV) : vec4(0);
fragColor = overlayColor + (1.0 - overlayColor.a) * inputColor;
}`);return m}class d extends h.NoParameters{constructor(){super(...arguments);this.input=this.overlay=this.mask=null;this.size=0}}const t=b.createScreenPointArray(),w=b.createRenderScreenPointArray(),v=l.create();l=Object.freeze(Object.defineProperty({__proto__:null,MagnifierPassParameters:d,build:g},Symbol.toStringTag,{value:"Module"}));a.Magnifier=l;a.MagnifierPassParameters=d;a.build=g})},"esri/views/magnifier/resources":function(){define(["require","exports","../../core/promiseUtils","../../support/requestImageUtils"],
function(a,b,q,l){const p=k=>Object.freeze(Object.defineProperty({__proto__:null,default:k},Symbol.toStringTag,{value:"Module"}));b.loadMagnifierResources=async function(k){var h=new Promise((c,e)=>a(["./mask-svg"],g=>c(p(g)),e)),f=new Promise((c,e)=>a(["./overlay-svg"],g=>c(p(g)),e));h=l.requestImage((await h).default,{signal:k});f=l.requestImage((await f).default,{signal:k});f={mask:await h,overlay:await f};q.throwIfAborted(k);return f};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/effects/smaa/SMAA":function(){define("require exports ../../../../../chunks/tslib.es6 ../../../../../core/maybe ../../../../../core/promiseUtils ../../../../../core/reactiveUtils ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/Logger ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../support/requestImageUtils ../../../webgl/formats ../../../webgl/RenderNode ./SMAABlendWeightsTechnique ./SMAABlurTechnique ./SMAAEdgeDetectTechnique ./SMAAPassParameters ../../lib/basicInterfaces ../../../../webgl/enums ../../../../webgl/Texture ../../../../webgl/TextureDescriptor".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){function A(B,C,D,F){const H=new z.TextureDescriptor;H.pixelFormat=D;H.wrapMode=x.TextureWrapMode.CLAMP_TO_EDGE;H.width=F.width;H.height=F.height;H.samplingMode=C;return new y.Texture(B,H,F)}b.SMAA=class extends w{constructor(B){super(B);this.produces="disabled";this.consumes={required:["aa-color","composite-color"]};this._searchTexture=this._areaTexture=null;this._smaaParameters=new n.SMAAPassParameters;this._edgeTechnique=B.techniques.acquire(r.SMAAEdgeDetectTechnique);
this._blendTechnique=B.techniques.acquire(v.SMAABlendWeightsTechnique);this._blurTechnique=B.techniques.acquire(m.SMAABlurTechnique)}initialize(){this.addHandles([k.watch(()=>this.isEnabled(),B=>B?this.enable():this.disable(),k.syncAndInitial)])}async enable(){this.produces="aa-color";if(!(this._abortController||this._areaTexture&&this._searchTexture)){this._abortController=new AbortController;var B=this._abortController.signal;try{const C=await new Promise((D,F)=>a(["./SMAAData"],D,F));await this._loadTextures(C,
B);this.requestRender(u.RenderRequestType.UPDATE)}catch{}this._abortController=null}}async _loadTextures(B,C){p.throwIfAborted(C);const [D,F]=await Promise.allSettled([d.requestImage(B.areaTexture,{signal:C}),d.requestImage(B.searchTexure,{signal:C})]);p.throwIfAborted(C);"fulfilled"===D.status&&"fulfilled"===F.status&&(B=this.renderingContext,this._areaTexture=A(B,x.TextureSamplingMode.LINEAR,x.PixelFormat.RGB,D.value),this._searchTexture=A(B,x.TextureSamplingMode.NEAREST,x.PixelFormat.LUMINANCE,
F.value))}disable(){this.produces="disabled"}destroy(){this._searchTexture=l.disposeMaybe(this._searchTexture);this._areaTexture=l.disposeMaybe(this._areaTexture);this._blurTechnique.release();this._blendTechnique.release();this._edgeTechnique.release()}render(B){const C=B.find(({name:E})=>"aa-color"===E);if(!(this._edgeTechnique.compiled&&this._blendTechnique.compiled&&this._blurTechnique.compiled&&this._areaTexture&&this._searchTexture))return this.requestRender(u.RenderRequestType.UPDATE),C;var D=
B.find(({name:E})=>"composite-color"===E);const F=D.fbo.width,H=D.fbo.height;B=this.renderingContext;B.setViewport(0,0,F,H);const N=this.fboCache.acquire(F,H,"smaa edges",t.ColorFormat.RG);B.unbindTexture(N.fbo?.colorTexture);B.bindFramebuffer(N.fbo);B.setClearColor(0,0,0,1);B.clear(x.ClearBufferBit.COLOR_BUFFER_BIT);this._smaaParameters.color=D.getTexture();B.bindTechnique(this._edgeTechnique,null,this._smaaParameters);B.screen.draw();D=this.fboCache.acquire(F,H,"smaa blend");B.unbindTexture(D.fbo?.colorTexture);
B.bindFramebuffer(D.fbo);B.setClearColor(0,0,1,1);B.clear(x.ClearBufferBit.COLOR_BUFFER_BIT);this._smaaParameters.inputTexture=N.getTexture();this._smaaParameters.areaTexture=this._areaTexture;this._smaaParameters.searchTexture=this._searchTexture;B.bindTechnique(this._blendTechnique,null,this._smaaParameters);B.screen.draw();N.release();B.bindFramebuffer(C.fbo);B.setClearColor(0,1,0,1);B.clear(x.ClearBufferBit.COLOR_BUFFER_BIT);this._smaaParameters.inputTexture=D.getTexture();B.bindTechnique(this._blurTechnique,
null,this._smaaParameters);B.screen.draw();D.release();return C}};q.__decorate([h.property()],b.SMAA.prototype,"produces",void 0);q.__decorate([h.property()],b.SMAA.prototype,"consumes",void 0);q.__decorate([h.property({constructOnly:!0})],b.SMAA.prototype,"isEnabled",void 0);q.__decorate([h.property({constructOnly:!0})],b.SMAA.prototype,"techniques",void 0);q.__decorate([h.property()],b.SMAA.prototype,"_abortController",void 0);b.SMAA=q.__decorate([g.subclass("esri.views.3d.webgl-engine.effects.smaa.SMAA")],
b.SMAA);Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/BlendWeights.glsl ../../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx,
c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.BlendWeights,()=>new Promise((e,g)=>a(["../../shaders/BlendWeights.glsl"],e,g)));b.SMAABlendWeightsTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/BlendWeights.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl","../views/3d/webgl-engine/core/shaderModules/interfaces",
"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform"],function(a,b,q,l,p){function k(){const c=new l.ShaderBuilder;c.include(b.ScreenSpacePass);c.fragment.uniforms.add(new p.Texture2DPassUniform("edgesTexture",e=>e.inputTexture),new p.Texture2DPassUniform("areaTexture",e=>e.areaTexture),new p.Texture2DPassUniform("searchTexture",e=>e.searchTexture));c.fragment.code.add(q.glsl`
#define SMAA_AREATEX_PIXEL_SIZE ( 1.0 / vec2( 160.0, 560.0 ) )
#define SMAA_AREATEX_SUBTEX_SIZE ( 1.0 / 7.0 )
vec4 sampleLevelZeroOffset(sampler2D tex, vec2 coord, vec2 offset, vec2 resolution) {
return texture(tex, coord + offset.x * resolution, 0.0);
}
float searchLength(sampler2D searchTex, vec2 e, float bias, float scale) {
e.r = bias + e.r * scale;
return 255.0 * texture( searchTex, e, 0.0 ).r;
}
float searchLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end, vec2 resolution ) {
vec2 e = vec2( 0.0, 1.0 );
for ( int i = 0; i < ${q.glsl.int(h.maxSearchSteps)}; i ++ ) {
e = texture( edgesTex, texcoord, 0.0 ).rg;
texcoord -= vec2( 2.0, 0.0 ) * resolution;
if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;
}
texcoord.x += 0.25 * resolution.x;
texcoord.x += resolution.x;
texcoord.x += 2.0 * resolution.x;
texcoord.x -= resolution.x * searchLength(searchTex, e, 0.0, 0.5);
return texcoord.x;
}
float searchRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end, vec2 resolution ) {
vec2 e = vec2( 0.0, 1.0 );
for ( int i = 0; i < ${q.glsl.int(h.maxSearchSteps)}; i ++ ) {
e = texture( edgesTex, texcoord, 0.0 ).rg;
texcoord += vec2( 2.0, 0.0 ) * resolution;
if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;
}
texcoord.x -= 0.25 * resolution.x;
texcoord.x -= resolution.x;
texcoord.x -= 2.0 * resolution.x;
texcoord.x += resolution.x * searchLength( searchTex, e, 0.5, 0.5 );
return texcoord.x;
}
float searchUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end, vec2 resolution ) {
vec2 e = vec2( 1.0, 0.0 );
for ( int i = 0; i < ${q.glsl.int(h.maxSearchSteps)}; i ++ ) {
e = texture( edgesTex, texcoord, 0.0 ).rg;
texcoord += vec2( 0.0, 2.0 ) * resolution;
if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;
}
texcoord.y -= 0.25 * resolution.y;
texcoord.y -= resolution.y;
texcoord.y -= 2.0 * resolution.y;
texcoord.y += resolution.y * searchLength( searchTex, e.gr, 0.0, 0.5 );
return texcoord.y;
}
float searchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end, vec2 resolution ) {
vec2 e = vec2( 1.0, 0.0 );
for ( int i = 0; i < ${q.glsl.int(h.maxSearchSteps)}; i ++ ) {
e = texture( edgesTex, texcoord, 0.0 ).rg;
texcoord -= vec2( 0.0, 2.0 ) * resolution;
if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;
}
texcoord.y += 0.25 * resolution.y;
texcoord.y += resolution.y;
texcoord.y += 2.0 * resolution.y;
texcoord.y -= resolution.y * searchLength( searchTex, e.gr, 0.5, 0.5 );
return texcoord.y;
}
vec2 getArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {
vec2 texcoord = float( ${q.glsl.int(h.maxDistanceAreaTex)} ) * round( 4.0 * vec2( e1, e2 ) ) + dist;
texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );
texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;
return texture( areaTex, texcoord, 0.0 ).rg;
}
void main() {
vec2 size = vec2(textureSize(edgesTexture, 0));
vec2 resolution = 1.0 / size;
vec2 pixelCoord = uv * size;
vec4 offsets[2];
offsets[0] = uv.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );
offsets[1] = uv.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );
vec4 maxOffset = vec4( offsets[0].xz, offsets[1].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( ${q.glsl.int(h.maxSearchSteps)} );
ivec4 subsampleIndices = ivec4(0.0);
vec4 weights = vec4(0.0);
vec2 e = texture( edgesTexture, uv ).rg;
if ( e.g > 0.0 ) {
vec2 d;
vec2 coords;
coords.x = searchLeft( edgesTexture, searchTexture, offsets[0].xy, maxOffset.x, resolution );
coords.y = offsets[1].y;
d.x = coords.x;
float e1 = texture( edgesTexture, coords, 0.0 ).r;
coords.x = searchRight( edgesTexture, searchTexture, offsets[0].zw, maxOffset.y, resolution );
d.y = coords.x;
d = d * size.x - pixelCoord.x;
vec2 sqrt_d = sqrt( abs(d) );
coords.y -= 1.0 * resolution.y;
float e2 = sampleLevelZeroOffset( edgesTexture, coords, vec2( 1.0, 0.0 ), resolution).r;
weights.rg = getArea( areaTexture, sqrt_d, e1, e2, float( subsampleIndices.y ) );
}
if ( e.r > 0.0 ) {
vec2 d;
vec2 coords;
coords.y = searchUp( edgesTexture, searchTexture, offsets[1].xy, maxOffset.z, resolution );
coords.x = offsets[0].x;
d.x = coords.y;
float e1 = texture( edgesTexture, coords, 0.0 ).g;
coords.y = searchYDown( edgesTexture, searchTexture, offsets[1].zw, maxOffset.w, resolution );
d.y = coords.y;
d = d * size.y - pixelCoord.y;
vec2 sqrt_d = sqrt(abs(d));
coords.y -= 1.0 * resolution.y;
float e2 = sampleLevelZeroOffset( edgesTexture, coords, vec2(0.0, 1.0), resolution).g;
weights.ba = getArea( areaTexture, sqrt_d, e1, e2, float( subsampleIndices.x ) );
// for some reason the following lines are necessary to prevent
// texture lookup precision issues on some Intel integrated graphics chips
vec4 dbg = (offsets[0] + offsets[1] + maxOffset + coords.xyyx);
weights.r += 0.00000001 * dot(vec4(0, 1, 0, 1), dbg);
}
fragColor = weights;
}`);return c}const h={maxSearchSteps:8,maxDistanceAreaTex:16},f=Object.freeze(Object.defineProperty({__proto__:null,build:k},Symbol.toStringTag,{value:"Module"}));a.BlendWeights=f;a.build=k})},"esri/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/Blur.glsl ../../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx,c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.Blur,()=>new Promise((e,g)=>a(["../../shaders/Blur.glsl"],e,g)));b.SMAABlurTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Blur.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl",
"../views/3d/webgl-engine/core/shaderModules/interfaces","../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform"],function(a,b,q,l,p){function k(){const f=new l.ShaderBuilder;f.include(b.ScreenSpacePass);f.fragment.uniforms.add(new p.Texture2DPassUniform("blendWeightsTexture",c=>c.inputTexture),new p.Texture2DPassUniform("colorTexture",c=>c.color));f.fragment.code.add(q.glsl`void main() {
vec2 resolution = 1.0 / vec2(textureSize(colorTexture, 0));
vec4 offsets = vec4(uv.x + resolution.x, uv.y, uv.x, uv.y - resolution.y);
vec4 a;
a.rb = texture(blendWeightsTexture, uv).rb;
a.g = texture(blendWeightsTexture, offsets.zw).g;
a.a = texture(blendWeightsTexture, offsets.xy).a;
if ( dot(a, vec4(1.0)) < 1e-5 ) {
fragColor = texture( colorTexture, uv, 0.0 );
} else {
vec2 offset;
offset.x = a.a > a.b ? a.a : -a.b;
offset.y = a.g > a.r ? -a.g : a.r;
if ( abs( offset.x ) > abs( offset.y )) {
offset.y = 0.0;
} else {
offset.x = 0.0;
}
vec4 C = texture( colorTexture, uv, 0.0 );
vec4 Cop = texture( colorTexture, uv + sign( offset ) * resolution.xy, 0.0 );
float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );
fragColor = mix(C, Cop, s);
}
}`);return f}const h=Object.freeze(Object.defineProperty({__proto__:null,build:k},Symbol.toStringTag,{value:"Module"}));a.Blur=h;a.build=k})},"esri/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique":function(){define("require exports ../../core/shaderTechnique/ReloadableShaderModule ../../core/shaderTechnique/ShaderTechnique ../../lib/DefaultVertexAttributeLocations ../../lib/Program ../../../../../chunks/EdgeDetect.glsl ../../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx,
c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:f.defaultColorWriteParams})}}c.shader=new q.ReloadableShaderModule(h.EdgeDetect,()=>new Promise((e,g)=>a(["../../shaders/EdgeDetect.glsl"],e,g)));b.SMAAEdgeDetectTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/EdgeDetect.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl","../views/3d/webgl-engine/core/shaderModules/interfaces",
"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform"],function(a,b,q,l,p){function k(){const c=new l.ShaderBuilder;c.include(b.ScreenSpacePass);c.fragment.uniforms.add(new p.Texture2DPassUniform("colorTexture",e=>e.color));c.outputs.add("fragEdges","vec2");c.fragment.code.add(q.glsl`
float absMax3(vec3 v) {
vec3 t = abs(v);
return max(max(t.r, t.g), t.b);
}
void main() {
vec2 resolution = 1.0 / vec2(textureSize(colorTexture, 0));
vec4 offsets[3];
offsets[0] = vec4(uv.x - resolution.x, uv.y, uv.x, uv.y + resolution.y);
offsets[1] = vec4(uv.x + resolution.x, uv.y, uv.x, uv.y - resolution.y);
offsets[2] = vec4(uv.x - 2.0 * resolution.x, uv.y, uv.x, uv.y + 2.0 * resolution.y);
// Calculate color deltas:
vec4 delta;
vec3 C = texture(colorTexture, uv).rgb;
vec3 Cleft = texture(colorTexture, offsets[0].xy).rgb;
delta.x = absMax3(C - Cleft);
vec3 Ctop = texture(colorTexture, offsets[0].zw).rgb;
delta.y = absMax3(C - Ctop);
vec2 edges = step(vec2(${q.glsl.float(h.threshold)}), delta.xy);
// discard if there is no edge:
if (dot(edges, vec2(1.0)) == 0.0) {
discard;
}
// Calculate right and bottom deltas:
vec3 Cright = texture(colorTexture, offsets[1].xy).rgb;
delta.z = absMax3(C - Cright);
vec3 Cbottom = texture(colorTexture, offsets[1].zw).rgb;
delta.w = absMax3(C - Cbottom);
// Calculate the maximum delta in the direct neighborhood:
float maxDelta = max(max(max(delta.x, delta.y), delta.z), delta.w);
// Calculate left-left and top-top deltas:
vec3 Cleftleft = texture(colorTexture, offsets[2].xy).rgb;
delta.z = absMax3(C - Cleftleft);
vec3 Ctoptop = texture(colorTexture, offsets[2].zw).rgb;
delta.w = absMax3(C - Ctoptop);
// Calculate the final maximum delta:
maxDelta = max(max(maxDelta, delta.z), delta.w);
// Local contrast adaptation in action:
edges *= step(maxDelta, float(${q.glsl.float(h.localConstrastAdaption)}) * delta.xy);
fragEdges = edges;
}
`);return c}const h={threshold:.05,localConstrastAdaption:2},f=Object.freeze(Object.defineProperty({__proto__:null,build:k},Symbol.toStringTag,{value:"Module"}));a.EdgeDetect=f;a.build=k})},"esri/views/3d/webgl-engine/effects/smaa/SMAAPassParameters":function(){define(["exports","../../core/shaderModules/interfaces"],function(a,b){class q extends b.NoParameters{}a.SMAAPassParameters=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/CompositingHelper":function(){define("../../../../chunks/Compositing.glsl ../shaders/CompositingTechnique ../shaders/CompositingTechniqueConfiguration ../../../../chunks/HUDCompositing.glsl ../shaders/HUDCompositingTechnique ../../../../chunks/OITCompositing.glsl ../shaders/OITCompositingTechnique".split(" "),
function(a,b,q,l,p,k,h){class f{constructor(c,e){this._rctx=c;this._techniques=e;this._configuration=new q.CompositingTechniqueConfiguration;this._passParameters=new a.CompositingPassParameters;this._oitParameters=new k.OITCompositingPassParameters;this._hudParameters=new l.HUDCompositingPassParameters}compositeOIT(c,e,g,d){this._oitParameters.colorTexture=e;this._oitParameters.alphaTexture=g;this._oitParameters.frontFaceTexture=d;e=this._techniques.acquire(h.OITCompositingTechnique);this._rctx.bindTechnique(e,
c,this._oitParameters);this._rctx.screen.draw();e.release()}compositeHUD(c,e){this._hudParameters.texture=e;e=this._techniques.acquire(p.HUDCompositingTechnique);this._rctx.bindTechnique(e,c,this._hudParameters);this._rctx.screen.draw();e.release()}composite(c,e,g=q.AlphaMode.None,d=1){this._configuration.alphaMode=g;this._configuration.hasOpacityFactor=1!==d;this._passParameters.texture=e;this._passParameters.opacity=d;e=this._techniques.acquire(b.CompositingTechnique,this._configuration);this._rctx.bindTechnique(e,
c,this._passParameters);this._rctx.screen.draw();e.release()}blitDepthToLinearDepth(c,e){this._configuration.isDepthBlit=!0;this.composite(c,e);this._configuration.isDepthBlit=!1}}return f})},"esri/chunks/Compositing.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c){function e(t){const w=new f.ShaderBuilder;w.include(b.ScreenSpacePass);w.fragment.uniforms.add(new c.Texture2DPassUniform("tex",v=>v.texture));t.hasOpacityFactor&&w.fragment.uniforms.add(new k.FloatPassUniform("opacity",v=>v.opacity));t.isDepthBlit&&(w.fragment.uniforms.add(new p.Float2PassUniform("nearFar",(v,m)=>m.camera.nearFar)),w.fragment.include(q.ReadDepth),w.fragment.include(l.RgbaFloatEncoding));w.fragment.code.add(h.glsl`
void main() {
${t.isDepthBlit?h.glsl`
float normalizedLinearDepth = (-linearDepthFromTexture(tex, uv) - nearFar[0]) / (nearFar[1] - nearFar[0]);
fragColor = float2rgba(normalizedLinearDepth);`:h.glsl`
fragColor = texture(tex, uv) ${t.hasOpacityFactor?"* opacity":""};`}
}`);return w}class g extends h.NoParameters{constructor(){super(...arguments);this.opacity=1}}const d=Object.freeze(Object.defineProperty({__proto__:null,CompositingPassParameters:g,build:e},Symbol.toStringTag,{value:"Module"}));a.Compositing=d;a.CompositingPassParameters=g;a.build=e})},"esri/views/3d/webgl-engine/shaders/CompositingTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../../../../chunks/Compositing.glsl ./CompositingTechniqueConfiguration ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e){class g extends l.ShaderTechnique{initializeProgram(d){return new k.Program(d.rctx,g.shader.get().build(this.configuration),p.Default3D)}initializePipeline(){switch(this.configuration.alphaMode){case f.AlphaMode.None:return e.makePipelineState({colorWrite:e.defaultColorWriteParams});case f.AlphaMode.Alpha:return e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.SRC_ALPHA,c.BlendFactor.ONE,c.BlendFactor.ONE_MINUS_SRC_ALPHA,c.BlendFactor.ONE_MINUS_SRC_ALPHA),
colorWrite:e.defaultColorWriteParams});case f.AlphaMode.PremultipliedAlpha:case f.AlphaMode.COUNT:return e.makePipelineState({blending:e.simpleBlendingParams(c.BlendFactor.ONE,c.BlendFactor.ONE_MINUS_SRC_ALPHA),colorWrite:e.defaultColorWriteParams})}}}g.shader=new q.ReloadableShaderModule(h.Compositing,()=>new Promise((d,t)=>a(["./Compositing.glsl"],d,t)));b.CompositingTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration":function(){define(["exports",
"../../../../chunks/tslib.es6","../core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q){a.AlphaMode=void 0;(function(p){p[p.None=0]="None";p[p.Alpha=1]="Alpha";p[p.PremultipliedAlpha=2]="PremultipliedAlpha";p[p.COUNT=3]="COUNT"})(a.AlphaMode||(a.AlphaMode={}));class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.alphaMode=a.AlphaMode.None;this.isDepthBlit=this.hasOpacityFactor=!1}}b.__decorate([q.parameter({count:a.AlphaMode.COUNT})],l.prototype,"alphaMode",
void 0);b.__decorate([q.parameter()],l.prototype,"hasOpacityFactor",void 0);b.__decorate([q.parameter()],l.prototype,"isDepthBlit",void 0);a.CompositingTechniqueConfiguration=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/HUDCompositing.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl","../views/3d/webgl-engine/core/shaderModules/interfaces","../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform"],
function(a,b,q,l,p){function k(){const c=new l.ShaderBuilder;c.include(b.ScreenSpacePass);c.fragment.uniforms.add(new p.Texture2DPassUniform("tex",e=>e.texture));c.fragment.code.add(q.glsl`void main() {
fragColor = vec4(1.0 - texture(tex, uv).a);
}`);return c}class h extends q.NoParameters{}const f=Object.freeze(Object.defineProperty({__proto__:null,HUDCompositingPassParameters:h,build:k},Symbol.toStringTag,{value:"Module"}));a.HUDCompositing=f;a.HUDCompositingPassParameters=h;a.build=k})},"esri/views/3d/webgl-engine/shaders/HUDCompositingTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../../../../chunks/HUDCompositing.glsl ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f){class c extends l.ShaderTechnique{initializeProgram(e){return new k.Program(e.rctx,c.shader.get().build(),p.Default3D)}initializePipeline(){return f.makePipelineState({colorWrite:{r:!1,g:!0,b:!1,a:!1}})}}c.shader=new q.ReloadableShaderModule(h.HUDCompositing,()=>new Promise((e,g)=>a(["./HUDCompositing.glsl"],e,g)));b.HUDCompositingTechnique=c;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/OITCompositing.glsl":function(){define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl",
"../views/3d/webgl-engine/core/shaderModules/interfaces","../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform"],function(a,b,q,l,p){function k(){const c=new l.ShaderBuilder;c.include(b.ScreenSpacePass);c.fragment.uniforms.add(new p.Texture2DPassUniform("colorTexture",e=>e.colorTexture),new p.Texture2DPassUniform("alphaTexture",e=>e.alphaTexture),new p.Texture2DPassUniform("frontFaceTexture",e=>e.frontFaceTexture));c.fragment.code.add(q.glsl`void main() {
float srcAlpha = texture(alphaTexture, uv).r;
if(srcAlpha <= 1e-5){
discard;
}
vec4 srcColor = texture(colorTexture, uv);
vec4 frontFace = texture(frontFaceTexture, uv);
fragColor = vec4(mix(srcColor.rgb / srcAlpha, frontFace.rgb, frontFace.a), 1.0 - srcColor.a);
}`);return c}class h extends q.NoParameters{}const f=Object.freeze(Object.defineProperty({__proto__:null,OITCompositingPassParameters:h,build:k},Symbol.toStringTag,{value:"Module"}));a.OITCompositing=f;a.OITCompositingPassParameters=h;a.build=k})},"esri/views/3d/webgl-engine/shaders/OITCompositingTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../../../../chunks/OITCompositing.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c){class e extends l.ShaderTechnique{initializeProgram(g){return new k.Program(g.rctx,e.shader.get().build(),p.Default3D)}initializePipeline(){return c.makePipelineState({blending:c.separateBlendingParams(f.BlendFactor.SRC_ALPHA,f.BlendFactor.ONE,f.BlendFactor.ONE_MINUS_SRC_ALPHA,f.BlendFactor.ONE_MINUS_SRC_ALPHA),colorWrite:c.defaultColorWriteParams})}}e.shader=new q.ReloadableShaderModule(h.OITCompositing,()=>new Promise((g,d)=>a(["./OITCompositing.glsl"],g,d)));b.OITCompositingTechnique=
e;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/depthRangeUtils":function(){define("exports ../../../../core/floatRGBA ../../../../core/PooledArray ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/support/frustum ../../../../chunks/sphere ../../support/mathUtils ./depthRange ./Octree ./Util".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(O,L){if(L.visible){var P=d.empty(),M=L.getSpatialQueryAccelerator();M?m(P,O,M):r(P,O,L.objects);return P}}function m(O,L,P){var M=L.eye;const K=L.viewForward,J=L.frustum,R=W=>W.visible;var Q=P.objectCount;500>Q?(d.set(N,L.near,Math.min(O.near,L.far)),P.forEachInDepthRange(M,K,t.DepthOrder.FRONT_TO_BACK,N,(W,S)=>{n(O,L,W);N.far=O.near;S.setRange(N)},J,R),d.set(N,Math.max(O.far,L.near),L.far),P.forEachInDepthRange(M,K,t.DepthOrder.BACK_TO_FRONT,N,(W,
S)=>{n(O,L,W);N.near=O.far;S.setRange(N)},J,R)):(Q=Math.max(Math.min(Q,500),Math.ceil(.1*Q)),M=P.findClosest(K,t.DepthOrder.FRONT_TO_BACK,J,R,Q),P=P.findClosest(K,t.DepthOrder.BACK_TO_FRONT,J,R,Q),M&&P&&(x(O,L,M.boundingVolumeWorldSpace.bounds),x(O,L,P.boundingVolumeWorldSpace.bounds)))}function r(O,L,P){E.clear();P.forAll(M=>{M.visible&&0!==M.geometries.length&&E.add(M)});E.empty||(E.sort(L),d.set(N,L.near,Math.min(O.near,L.far)),E.forEachInDepthRange(N,t.DepthOrder.FRONT_TO_BACK,(M,K)=>{K<O.near&&
n(O,L,M)}),d.set(N,Math.max(O.far,L.near),L.far),E.forEachInDepthRange(N,t.DepthOrder.BACK_TO_FRONT,(M,K,J)=>{O.far=Math.max(O.far,J)}))}function n(O,L,P){if(P.visible&&c.intersectsSphere(L.frustum,P.boundingVolumeWorldSpace.bounds)){var M=P.transformation,K=H;P.geometries.forEach(J=>{l.multiply(K,M,J.transformation);const R=g.maxScale(K);u(O,L,J.boundingInfo,K,R)})}}function u(O,L,P,M,K){if(null!=P){k.transformMat4(e.getCenter(F),P.center,M);var {eye:J,viewForward:R}=L,Q=R[0]*(F[0]-J[0])+R[1]*(F[1]-
J[1])+R[2]*(F[2]-J[2]);F[3]=P.radius*K;if(!(Q-F[3]>O.near&&Q+F[3]<O.far)&&c.intersectsSphere(L.frustum,F))if(100<P.radius&&P.getChildren())for(const W of P.getChildren())u(O,L,W,M,K);else I.unionDepthRangeWithAABB(O,L.viewProjectionMatrix,M,P.bbMin,P.bbMax)}}function x(O,L,P){var M=L.eye;L=L.viewForward;M=(P[0]-M[0])*L[0]+(P[1]-M[1])*L[1]+(P[2]-M[2])*L[2];O.near=Math.min(O.near,M-P[3]);O.far=Math.max(O.far,M+P[3])}function y(O,L){if(0===L)return O[0]>=-O[3];if(1===L)return O[1]>=-O[3];if(2===L)return O[0]<=
O[3];if(3===L)return O[1]<=O[3];w.assert(!1)}function z(O,L,P){let M=0;0===P?M=(-O[3]-O[0])/(L[0]-O[0]+L[3]-O[3]):1===P?M=(-O[3]-O[1])/(L[1]-O[1]+L[3]-O[3]):2===P?M=(O[3]-O[0])/(L[0]-O[0]-L[3]+O[3]):3===P&&(M=(O[3]-O[1])/(L[1]-O[1]-L[3]+O[3]));return h.lerp(f.create(),O,L,M)}class A{constructor(){this._items=new q({allocator:O=>O||{object:null,distance:0,near:0,far:0},deallocator:O=>{O.object=null;O.distance=0;O.near=0;O.far=0;return O}})}get length(){return this._items.length}get empty(){return 0===
this._items.length}clear(){this._items.clear()}add(O){this._items.pushNew().object=O}sort(O){const L=O.eye,P=O.viewForward;this._items.forAll(M=>{const K=M.object.boundingVolumeWorldSpace.bounds,J=(K[0]-L[0])*P[0]+(K[1]-L[1])*P[1]+(K[2]-L[2])*P[2];M.distance=J;M.near=J-K[3];M.far=J+K[3]});this._items.sort((M,K)=>M.distance-K.distance)}forEachInDepthRange(O,L,P){if(L===t.DepthOrder.FRONT_TO_BACK)for(L=0;L<this._items.length;++L){var M=this._items.data[L];M.far<O.near||M.near>O.far||P(M.object,M.near,
M.far)}else for(L=this._items.length-1;0<=L;--L)M=this._items.data[L],M.far<O.near||M.near>O.far||P(M.object,M.near,M.far)}}class B{constructor(){this._view=p.create();this._viewProj=p.create();this._frustum=c.create();this._geometries=[];this._near=[];this._far=[];this._nearCandidates=[];this._farCandidates=[];this._looseRange={near:0,far:0}}compute(O,L){this._reset();l.copy(this._view,O.viewMatrix);l.multiply(this._viewProj,O.projectionMatrix,this._view);c.copy(this._frustum,O.frustum);O=this._view;
const P=O[2],M=O[6],K=O[10],J=O[14];L.forAll(W=>{W.materialReference&&W.forEachGeometry&&W.forEachGeometry(S=>{if(S.visible&&S.castShadow){var V=S.boundingSphere,T=P*V[0]+M*V[1]+K*V[2]+J,Y=T-V[3];V=T+V[3];this._geometries.push(S);this._near.push(-V);this._far.push(-Y)}})});L=new d.DepthRange;if(0===this._geometries.length)return L;for(O=0;O<this._geometries.length;++O)this._near[O]>L.far&&(L.far=this._near[O]),2<this._near[O]&&this._far[O]<L.near&&(L.near=this._far[O]);O=this._looseRange;O.near=Math.max(.5*
L.near,2);O.far=2*L.far;var R=0;let Q=0;for(let W=0;W<this._geometries.length;++W)this._near[W]<L.near&&(this._near[W]>=O.near?L.near=this._near[W]:this._nearCandidates[R++]=W),this._far[W]>L.far&&(this._far[W]<=O.far?L.far=this._far[W]:this._farCandidates[Q++]=W);if(0===this._nearCandidates.length&&0===this._farCandidates.length)return L;this._nearCandidates.sort((W,S)=>this._near[W]<this._near[S]?-1:this._near[W]>this._near[S]?1:0);this._farCandidates.sort((W,S)=>this._far[W]<this._far[S]?1:this._far[W]>
this._far[S]?-1:0);for(O=0;O<this._nearCandidates.length;++O)R=this._nearCandidates[O],this._near[R]<L.near&&(R=this._geometries[R],this._includeNearBoundingInfoRec(R.boundingInfo,R.shaderTransformation,L));for(O=0;O<this._farCandidates.length;++O)R=this._farCandidates[O],this._far[R]>L.far&&(R=this._geometries[R],this._includeFarBoundingInfoRec(R.boundingInfo,R.shaderTransformation,L));this._reset();return L}_reset(){this._geometries.length=0;this._near.length=0;this._far.length=0;this._nearCandidates.length=
0;this._farCandidates.length=0}_includeNearBoundingInfoRec(O,L,P){if(null!=O){var M=O.center;k.transformMat4(e.getCenter(F),M,L);M=g.maxScale(L);var K=F[0],J=F[1],R=F[2];M*=O.radius;var Q=this._frustum;if(!(Q[0][0]*K+Q[0][1]*J+Q[0][2]*R+Q[0][3]>M||Q[1][0]*K+Q[1][1]*J+Q[1][2]*R+Q[1][3]>M||Q[2][0]*K+Q[2][1]*J+Q[2][2]*R+Q[2][3]>M||Q[3][0]*K+Q[3][1]*J+Q[3][2]*R+Q[3][3]>M||(K=this._view[2]*K+this._view[6]*J+this._view[10]*R+this._view[14],J=K+M,2>-(K-M)||-J>=P.near)))if(-J>this._looseRange.near)P.near=
-J;else{if(100<M&&(M=O.getChildren(),void 0!==M)){for(const W of M)this._includeNearBoundingInfoRec(W,L,P);return}I.unionDepthRangeWithAABB(P,this._viewProj,L,O.bbMin,O.bbMax)}}}_includeFarBoundingInfoRec(O,L,P){if(null!=O){var M=O.radius,K=O.center;k.transformMat4(e.getCenter(F),K,L);var J=g.maxScale(L);K=F[0];var R=F[1],Q=F[2];M*=J;J=this._frustum;if(!(J[0][0]*K+J[0][1]*R+J[0][2]*Q+J[0][3]>M||J[1][0]*K+J[1][1]*R+J[1][2]*Q+J[1][3]>M||J[2][0]*K+J[2][1]*R+J[2][2]*Q+J[2][3]>M||J[3][0]*K+J[3][1]*R+J[3][2]*
Q+J[3][3]>M||(K=this._view[2]*K+this._view[6]*R+this._view[10]*Q+this._view[14]-M,-K<=P.far)))if(-K<this._looseRange.far)P.far=-K;else{if(100<M&&(M=O.getChildren(),void 0!==M)){for(const W of M)this._includeFarBoundingInfoRec(W,L,P);return}I.unionDepthRangeWithAABB(P,this._viewProj,L,O.bbMin,O.bbMax)}}}}class C{constructor(){this._modelViewProj=p.create();this._clipPosition=[f.create(),f.create(),f.create(),f.create(),f.create(),f.create(),f.create(),f.create()]}unionDepthRangeWithAABB(O,L,P,M,K){var J=
this._modelViewProj;l.multiply(J,L,P);L=!1;for(P=0;8>P;++P){var R=this._clipPosition[P],Q=0===P||3===P||4===P||7===P?M[0]:K[0],W=0===P||1===P||4===P||5===P?M[1]:K[1];const S=4>P?M[2]:K[2];R[0]=J[0]*Q+J[4]*W+J[8]*S+J[12];R[1]=J[1]*Q+J[5]*W+J[9]*S+J[13];R[2]=J[2]*Q+J[6]*W+J[10]*S+J[14];R[3]=J[3]*Q+J[7]*W+J[11]*S+J[15]}for(M=0;12>M;++M){K=[this._clipPosition[D[M][0]],this._clipPosition[D[M][1]],this._clipPosition[D[M][2]]];for(J=0;4>J;++J)for(P=K,K=[],R=0;R<P.length;++R)Q=P[R],W=P[(R+1)%P.length],y(W,
J)?(y(Q,J)||K.push(z(Q,W,J)),K.push(W)):y(Q,J)&&K.push(z(Q,W,J));J=!0;for(P=0;P<K.length;++P)if(2<=K[P][3]){J=!1;break}if(!J)for(L=!0,J=0;J<K.length;++J)P=K[J][3],Number.isFinite(P)&&(O.near=Math.min(P,O.near),O.far=Math.max(P,O.far))}return L}}const D=[[0,1,3],[2,3,1],[1,5,2],[6,2,5],[5,4,6],[7,6,4],[4,0,7],[3,7,0],[3,2,7],[6,7,2],[4,5,0],[1,0,5]],F=e.create(),H=p.create(),N=d.empty(),E=new A,G=new B,I=new C;a.DepthRangeFromRenderGeometries=B;a.depthRangeFromLayer=v;a.depthRangeFromScene=function(O,
L,P){let M=0;if(!L.some(J=>{if(!J.materialReference)return!1;M+=J.numGeometries;return 1E4<=M}))return G.compute(O,L);const K=d.empty();P.forAll(J=>d.union(K,v(O,J)));return K};a.textureToDepth=function(O,L,P){return b.unpackFloatRGBA(L,O)*(P[1]-P[0])+P[0]};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper":function(){define(["exports","../../../../core/NestedMap","../../../../core/libs/gl-matrix-2/factories/vec4f64","../../../../geometry/support/buffer/BufferView"],
function(a,b,q,l){class p{constructor(){this.declaredClass="esri.views.3d.webgl-engine.lib.ObjectAndLayerIdRenderHelper";this.colorZero=new l.BufferViewVec4u8(new ArrayBuffer(4));this._layerToOidToColor=new b.NestedMap;this._colorToUID=new Map;this._layerUidToGraphicsUidToObjectId=new b.NestedMap;this._layerUidToId=new Map;this._layerUidToPopupEnabled=new Map}setUidToObjectAndLayerId(k,h,f,c,e,g=null,d=null,t=null){k&&h&&f&&c&&(this._layerUidToId.set(c,f),this._layerUidToPopupEnabled.set(c,e),e&&
this._layerUidToGraphicsUidToObjectId.set(c,h,{objectId:k,attributeNodeId:g,attributeIndex:d,subLayerId:t}))}getObjectAndLayerIdColor(k){k=this.getObjectAndLayerIdColorArray(k);return q.fromValues(k.get(0,1),k.get(0,2),k.get(0,3),255)}getObjectAndLayerIdColorArray(k){if(!k.layerUid||!k.graphicUid)return this.colorZero;var h=this._layerUidToPopupEnabled.get(k.layerUid);if(void 0===h||!1===h)return this.colorZero;const f=this._layerUidToGraphicsUidToObjectId.get(k.layerUid,k.graphicUid)?.objectId;if(!f)return this.colorZero;
h=this._layerToOidToColor.get(k.layerUid,f);if(!h){for(;!h;){const c=Math.floor(16777214*Math.random())+1;this._colorToUID.has(c)||(h=c)}if(16777215<h)throw Error("Object ID Overflow");this._layerToOidToColor.set(k.layerUid,f,h);this._colorToUID.set(h,k)}k=new ArrayBuffer(4);(new DataView(k)).setUint32(0,h,!1);return new l.BufferViewVec4u8(k)}getColorToObjectAndLayerIdMapping(){const k=new Map;for(const [h,f]of this._colorToUID.entries()){const c=this._layerUidToGraphicsUidToObjectId.get(f.layerUid,
f.graphicUid),e=this._layerUidToId.get(f.layerUid);c&&e&&k.set(h,c.attributeNodeId?{type:"object-and-layer-and-i3s-id",oid:c.objectId,lid:e,attrId:c.attributeNodeId,attrIdx:c.attributeIndex,subLayerId:c.subLayerId}:{type:"object-and-layer-id",oid:c.objectId,lid:e})}return k}}a.ObjectAndLayerIdRenderHelper=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Renderer":function(){define("require exports ../../../../chunks/tslib.es6 ../../../../core/arrayUtils ../../../../core/asyncUtils ../../../../core/colorUtils ../../../../core/has ../../../../core/maybe ../../../../core/PooledArray ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/signal ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/accessorSupport/interfaces ../../../../core/accessorSupport/tracking/Flags ../../../../core/Warning ../../../../core/Error ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../chunks/boundedPlane ../../webgl ../../support/debugFlags ../../terrain/TerrainRenderer ../../webgl/formats ../core/FBOCache ../core/renderPasses/RenderPassManager ../core/shaderLibrary/ShaderOutput ../core/shaderLibrary/hud/HUDRenderStyle ../core/shaderLibrary/shading/ScreenSpaceConstants ../effects/RenderNodes ../effects/RenderPlugin ../effects/RenderPluginManager ../effects/blit/Blit ./AnimationTimeStep ./basicInterfaces ./BoundingInfo ./depthRange ./depthRangeUtils ./Material ./OffscreenRendering ./RenderContext ./rendererUtils ./RenderFeature ./RenderPluginInput ./RenderSlot ./ShadowAccumulator ./ShadowMap ./SliceHelper ./TransparencyPassType ./Viewshed ./edgeRendering/interfaces ../materials/renderers/MergedRenderer ../shaders/CompositingTechniqueConfiguration ../shaders/OITCompositingTechnique ../statistics/RendererPerformanceInfo ../../../support/RenderState ../../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U,Z,ca,ea,da,ia,ka,fa,X,ja,la,na,va){function za(ua){return Na=>ua.immediate.schedule(Na)}class ya{constructor(ua,Na,Ua,wa,sa,Ha){this._stage=ua;this._techniques=Ua;this._rctx=wa;this._compositingHelper=sa;this._requestRender=Ha;this._pluginsHas={hudElements:!1,water:!1};this._hasOverlayWater=!1;this.renderOverlay=Ka=>{};this._inGlobeView=this._isRendering=!1;this._backgroundColor=z.fromValues(0,
0,0,1);this._sliceHelper=new ea;this._blit=null;this._state=d.signal(na.RenderState.IDLE);this._highQualityTransparencyEnabled=!0;this._terrainTransparency=D.TransparencyMode.Opaque;this._hasAnimations=this._ssrEnabled=!1;this._animationTimestep=new K.AnimationTimeStep;this._loadEdgeViewTask=null;this._edgeViewCallbacks=[];this._reprojectionMatrixVersion=d.signal(0);this._renderHiddenTransparentEdges=()=>{};this._pluginInput=new ba.RenderPluginInput;this._releaseNormals=Ka=>{Ka.some(({name:Aa})=>
"normals"===Aa)&&this._pluginInput.release("normals")};this._debugNeedsDepth=!1;this.fboCache=new H.FBOCache(wa);this._renderStateFeatures=d.signal(ha.setupFeatureDefaults(!h("disable-feature:high-quality-idle"),ua.view.qualityProfile));this._offscreen=new V.OffscreenRendering(this.fboCache,this._compositingHelper);this.performanceInfo=new la.RendererPerformanceInfo(this._rctx);this._shadowMap=new ca.ShadowMap(this.fboCache,ua.viewingMode);this._viewshed=new ia.Viewshed({fboCache:this.fboCache,view:ua.view},
(Ka,Aa,Sa)=>{Aa.setGLViewport(this._rctx);const {camera:Ya,contentCamera:qa}=Ka;this._ensureBindParametersCamera(Aa,Aa);this._renderAllGeometry(Sa);this._ensureBindParametersCamera(Ya,qa);Ka.camera.setGLViewport(this._rctx)});this._shadowAccumulator=new Z.ShadowAccumulator(this.fboCache,Ua,ua,Ka=>{const Aa=this.shadowsEnabled;this._shadowMap.enabled=!0;this._ensureBindParametersCamera(Ka.camera,Ka.contentCamera);this._plugins.prepareRender();this._shadowMap.enabled=Aa},(Ka,Aa,Sa)=>{Ka.shadowMap.start(Ka.camera,
Aa,Sa,!0,this._stage.view.qualitySettings.maximumPixelRatio);this._renderShadowCascades(E.ShaderOutput.Shadow,Ka.shadowMap);Ka.shadowMap.finish();Ka.camera.setGLViewport(this._rctx);this._ensureBindParametersCamera(Ka.camera,Ka.contentCamera)},Ha);this._renderContext=new T.RenderContext(this._rctx,this._offscreen,this._shadowMap,this._sliceHelper);this._nodes=new O.RenderNodes(this._renderContext);this._plugins=new P.RenderPluginManager({renderContext:this._renderContext,techniques:Ua,materials:Na,
requestRender:Ha,controller:ua,fbos:this.fboCache,isFeatureEnabled:Ka=>this.isFeatureEnabled(Ka)});this.renderPassManager=new N.RenderPassManager;this._plugins.add(this.renderPassManager);this._plugins.add(this._viewshed);this._handles=[g.watch(()=>this._stage.view.state.camera,()=>Ha(),g.syncAndInitial),g.watch(()=>C.debugFlags.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,Ka=>{this._renderHiddenTransparentEdges=Ka?()=>this._renderEdges(ka.Transparency.TRANSPARENT):()=>{};Ha()},g.initial),g.watch(()=>this._stage.view.environment.background?.color,
Ka=>{Ka=Ka?k.unitRGBAFromColor(Ka):z.ZEROS;y.set(this._backgroundColor,Ka[0]*Ka[3],Ka[1]*Ka[3],Ka[2]*Ka[3],Ka[3]);Ha()},g.syncAndInitial),g.watch(()=>this._stage.view.state.camera.relativeElevation,Ka=>{this._inGlobeView=(Ka??Infinity)>=I.distanceFadeEnd},g.syncAndInitial)]}destroy(){this._handles.forEach(ua=>ua.remove());this._gpuTimerHandle=f.removeMaybe(this._gpuTimerHandle);this._nodes.destroy();this._offscreen.dispose();this._shadowMap.dispose();this._shadowAccumulator.dispose();this._loadEdgeViewTask=
f.abortMaybe(this._loadEdgeViewTask);this._edgeView=f.destroyMaybe(this._edgeView);this.renderPassManager.dispose();this._releaseFBOs();this._disposeOffscreenBuffers();this.fboCache.destroy();this._plugins.destroy();R.BoundingInfo.prune()}get _bindParameters(){return this._renderContext.bindParameters}updateRenderFeatures(ua=null,Na=!h("disable-feature:high-quality-idle")){this._renderStateFeatures.value=ha.setupFeatureDefaults(Na,ua);this._plugins.renderFeatureChanged();this._requestRender()}isFeatureEnabled(ua,
Na=this._state.value){return this._renderStateFeatures.value.get(Na,ua)??!1}setFeatureEnabled(ua,Na,Ua){this._renderStateFeatures.mutate(wa=>wa.set(Na,ua,Ua));this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(ha.RenderFeature.HighQualityTransparency)}get hasReflections(){return(this._pluginsHas.water||this._hasOverlayWater)&&(this._ssrEnabled||this.isFeatureEnabled(ha.RenderFeature.WaterReflection))}get hasDecorations(){return this._plugins.hasDecorations||
this._nodes.produces("magnifier-color")}get hasHighlights(){return this._plugins.produces(E.ShaderOutput.Highlight,U.RenderSlot.OPAQUE_MATERIAL,U.RenderSlot.TRANSPARENT_MATERIAL,U.RenderSlot.DRAPED_MATERIAL)}get hasLaserlines(){return this._plugins.produces(this._renderContext.output,U.RenderSlot.LASERLINES,U.RenderSlot.LASERLINES_CONTRAST_CONTROL)}get hasSSAO(){return(this._stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(ha.RenderFeature.SSAO))&&!this._inGlobeView}get hasSMAA(){return this._stage.view.qualitySettings.antialiasingEnabled||
this.isFeatureEnabled(ha.RenderFeature.Antialiasing)}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(ha.RenderFeature.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=f.releaseMaybe(this._bindParameters.ssr.lastFrameColor);this._bindParameters.multipassTerrain.depth=f.releaseMaybe(this._bindParameters.multipassTerrain.depth);this._bindParameters.multipassGeometry.depth=f.releaseMaybe(this._bindParameters.multipassGeometry.depth)}_disposeOffscreenBuffers(){this._offscreen.dispose();
this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers();this._viewshed.viewshedShadowMap.disposeOffscreenBuffers();this._bindParameters.depth=f.releaseMaybe(this._bindParameters.depth);this._bindParameters.hudVisibility=f.releaseMaybe(this._bindParameters.hudVisibility)}get updating(){return null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){if(this._loadEdgeViewTask)return this._loadEdgeViewTask.promise;
this._loadEdgeViewTask=p.createTask(async ua=>{const {EdgeView:Na}=await new Promise((wa,sa)=>a(["./edgeRendering/EdgeView"],wa,sa));e.throwIfAborted(ua);const Ua=this._edgeView=new Na({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:za(this._stage.view.resourceController)});this._handles.push(g.watch(()=>Ua.updating,()=>this._requestRender(),g.sync));this._requestRender();
this._edgeViewCallbacks.forEach(wa=>wa(Ua));this._edgeViewCallbacks.length=0;return Ua});return this._loadEdgeViewTask.promise}withEdgeView(ua){this.loadEdgeView();null==this._edgeView?this._edgeViewCallbacks.push(ua):ua(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return 0<=this._reprojectionMatrixVersion.value&&u.equals(this._bindParameters.ssr.reprojectionMatrix,x.IDENTITY)}set _reprojectionMatrix(ua){l.update(this._bindParameters.ssr.reprojectionMatrix,ua)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(ua){const {_shadowMap:Na,
_bindParameters:Ua}=this;void 0!==ua.qualitySettings?.reflections&&this._ssrEnabled!==ua.qualitySettings.reflections&&(this._ssrEnabled=ua.qualitySettings.reflections,this._requestRender());void 0!==ua.shadowMap&&this._shadowMap.enabled!==ua.shadowMap&&(this._shadowMap.enabled=ua.shadowMap,this._requestRender());void 0!==ua.shadowMapMaxCascades&&Na.maxCascades!==ua.shadowMapMaxCascades&&(Na.maxCascades=ua.shadowMapMaxCascades,this._requestRender());if(null!=ua.environment){null!=ua.environment.weather&&
(this._bindParameters.weather=ua.environment.weather,this._bindParameters.weatherVisible=!!ua.weatherVisible);const wa="virtual"!==ua.environment.lighting.type;Ua.enableFillLights!==wa&&(Ua.enableFillLights=wa,this._requestRender())}void 0!==ua.highQualityTransparency&&this._highQualityTransparencyEnabled!==ua.highQualityTransparency&&(this._highQualityTransparencyEnabled=ua.highQualityTransparency,this._requestRender());void 0!==ua.hasOverlayWater&&this._hasOverlayWater!==ua.hasOverlayWater&&(this._hasOverlayWater=
ua.hasOverlayWater,this._requestRender());void 0!==ua.slicePlane&&this._sliceHelper.plane!==ua.slicePlane&&(this._sliceHelper.plane=ua.slicePlane,this._requestRender());void 0!==ua.terrainTransparency&&this._terrainTransparency!==ua.terrainTransparency&&(this._terrainTransparency=ua.terrainTransparency,this._requestRender());void 0!==ua.shadowCast&&this._shadowAccumulator.setOptions(ua.shadowCast)}get hasSlicePlane(){return!!this._sliceHelper.plane}get plugins(){return this._plugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&
this._hasOITSupport}modify(ua,Na){this._isRendering&&console.warn("Renderer.modify called while rendering");const {adds:Ua,removes:wa,updates:sa}=ua;if(0!==Ua.length||0!==wa.length||0!==sa.length){var Ha=!1;Y.splitRenderGeometryChangeSetByMaterial(ua).forEach((Ka,Aa)=>{if(!Na.done){var Sa=this._plugins.getMaterialRenderer(Aa);null==Sa&&0<Ka.adds.length&&(Aa=new fa.MergedRenderer({material:Aa}),Aa.initializeRenderContext(this._plugins._context),Sa=Aa,this._plugins.add(Sa));Sa&&(Sa.modify(Ka),0===Sa.numGeometries&&
(Ha=!0));Ka.removes.forEach(Ya=>ua.removes.removeUnordered(Ya));Ka.adds.forEach(Ya=>ua.adds.removeUnordered(Ya));Ka.updates.forEach(Ya=>ua.updates.removeUnordered(Ya));Na.madeProgress()}});Ha&&this._plugins.removeEmptyMaterialRenderers();this._updateHasFlags();this._requestRender()}}_updateHasFlags(){const ua=this._pluginsHas;ua.hudElements=this._plugins.produces(E.ShaderOutput.Color,U.RenderSlot.LINE_CALLOUTS_HUD_DEPTH,U.RenderSlot.HUD_MATERIAL,U.RenderSlot.LABEL_MATERIAL);ua.water=this._plugins.produces(E.ShaderOutput.Normal,
U.RenderSlot.DRAPED_WATER);this._bindParameters.hasOccludees=this._plugins.hasOccludees}updateAnimation(ua){const Na=this._hasAnimations;this._hasAnimations=this._plugins.updateAnimation(ua);this._hasAnimations=this._nodes.updateAnimation()||this._hasAnimations;this._hasAnimations!==Na&&(this._gpuTimerHandle=Na?f.removeMaybe(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo());return this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(ua,
Na,Ua=Y.RendererTarget.Default,wa=J.Decorations.ON){this._isRendering=!0;this.performanceInfo.startFrame();this.fboCache.frameStart();this._disposeBindBuffers();const sa=this._offscreen,{camera:Ha,contentCamera:Ka,mode:Aa,alignPixelEnabled:Sa}=ua;this._state.value=Aa;this._bindParameters.overlay=this.renderOverlay(Na);this._bindParameters.overlay&&this.performanceInfo.advance(la.PerformanceCategory.OVERLAY);this._renderContext.time=Na;this._bindParameters.transparencyPassType=da.TransparencyPassType.NONE;
this._bindParameters.alignPixelEnabled=Sa;this._bindParameters.decorations=wa;this._bindParameters.mainColor=this._bindParameters.mainDepth=null;this._bindParameters.viewshedEnabled=this._viewshed.enabled;ua=this._nodes.produces("magnifier-color");const Ya=this._nodes.produces("final-color"),qa=A.create(this._sliceHelper.plane);wa===J.Decorations.OFF&&(this._sliceHelper.plane=null);Ha.setGLViewport(this._rctx);var aa=sa.initializeFrame(Ha,this._backgroundColor,Ua);this.hasReflections?this._bindParameters.ssr.lastFrameColor=
aa:aa?.release();this._ensureBindParametersCamera(Ha,Ka);this._plugins.prepareRender();this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&wa===J.Decorations.ON;var Ja=this._plugins.produces(E.ShaderOutput.Color,U.RenderSlot.OPAQUE_TERRAIN)&&(this._terrainTransparency===D.TransparencyMode.Semitransparent||this._terrainTransparency===D.TransparencyMode.TransparentWithDraped);aa=this._highQualityTransparency&&Ja;const Ta=this._plugins.produces(E.ShaderOutput.Color,...Ma);this._prepareShaders(aa,
Ta);this.performanceInfo.advance(la.PerformanceCategory.PREPARE);var Ra=this._computeDepthRange(Ha);this._renderShadowMap(Ha,this._bindParameters.lighting.mainLight.direction,Ra);this._ensureBindParametersCamera(Ha,Ka);let $a=this._renderNormals();this._pluginInput.set("normals",$a);if($a){let pa=null;this._needsDepth&&(pa=$a.getAttachment(va.DepthStencilAttachment),pa?.retain());this._pluginInput.set("ssao",this._renderSSAO());this._renderNoSSAOGeometryDepth(pa);$a=null}else this._renderAllGeometryDepth();
this._renderShadowAccumulation(Ra,Ha,Ka);this._ensureBindParametersSSR(Na);this._renderContext.output=E.ShaderOutput.Color;sa.bindFbo();this._bindParameters.mainColor=sa.colorTexture;this._bindParameters.mainDepth=sa.depthTexture;const bb=this.plugins.produces(E.ShaderOutput.Color,...xa);bb&&this._renderOpaqueGeometry();this._offscreen.updateColor(pa=>this._renderNodes(B.RenderCategory.OPAQUE,pa,bb));this.fboCache.debugCallback?.("opaque-color",this._offscreen.color.fbo);this._renderPlugins(U.RenderSlot.OPAQUE_ENVIRONMENT,
la.PerformanceCategory.OPAQUE_ENVIRONMENT);this._renderMultipassTerrainDepth(aa);this._setMultipassTerrain(aa);this._renderEdges(ka.Transparency.OPAQUE);sa.bindFbo();this._renderPlugins(U.RenderSlot.VOXEL,la.PerformanceCategory.VOXEL);this._renderHiddenTransparentEdges();Ta&&(this._oitEnabled?this._renderOITPass(Da.Geometry):this._renderTransparentMaterial());this._offscreen.updateColor(pa=>this._renderNodes(B.RenderCategory.TRANSPARENT,pa,Ta));this.fboCache.debugCallback?.("transparent-color",this._offscreen.color.fbo);
this._renderMultipassGeometryDepth(aa);this._renderHUDVisibility();aa||this._plugins.render(this._pluginInput,U.RenderSlot.LINE_CALLOUTS);Na=Ua===Y.RendererTarget.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;this._renderEdges(ka.Transparency.TRANSPARENT);if(Ja=Ja?this._renderTransparentTerrain():null)this.performanceInfo.advance(la.PerformanceCategory.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(aa?this._renderLineCallouts(G.HUDRenderStyle.Occluded):sa.compositeToHUDVisibility(this._bindParameters,
Ja.getTexture()),this._renderHUD(G.HUDRenderStyle.Occluded,sa.color));this._setTerrainCulling(!1);Ja&&(sa.compositeToFramebuffer(this._bindParameters,Ja.getTexture(),X.AlphaMode.PremultipliedAlpha,1),Ja.release(),aa&&(this._renderEdges(ka.Transparency.OPAQUE),Ta&&(this._oitEnabled?this._renderOITPass(Da.Geometry):this._renderTransparentMaterial(),this.performanceInfo.advance(la.PerformanceCategory.TRANSPARENT)),this._renderEdges(ka.Transparency.TRANSPARENT)));this._bindParameters.ssao=f.releaseMaybe(this._bindParameters.ssao);
aa&&this._renderLineCallouts(G.HUDRenderStyle.NotOccluded);this._setMultipassEnabled(!1);this._renderTransparentEnvironment();this._renderViewshed();this._renderLaserlines();this._renderOccluded();this._pluginInput.set("highlights",this._renderHighlightPrepass());this._offscreen.updateColor(pa=>this._renderNodes(B.RenderCategory.COMPOSITE,pa));aa=this._nodes.produces("aa-color");Ra=Ua===Y.RendererTarget.Default&&!Ya&&!(ua&&wa===J.Decorations.ON&&Ua===Y.RendererTarget.Default);Ja=this._pluginInput.get("composite-color");
Ra=Ra?H.defaultWebGLFBO:this.fboCache.acquire(Ja.fbo.width,Ja.fbo.height,"aa-color");aa=aa?this._renderNodes(B.InternalRenderCategory.ANTIALIASING,Ra):this._blitToDefault(Ja,Ra,!1);this._pluginInput.set(B.InternalRenderCategory.ANTIALIASING,aa);this._renderHUD(G.HUDRenderStyle.NotOccluded,aa);aa=this._renderNodes(B.InternalRenderCategory.HIGHLIGHTS,aa);aa=this._renderNodes(B.InternalRenderCategory.MAGNIFIER,aa);ua&&wa===J.Decorations.ON&&Ua===Y.RendererTarget.Default&&!Ya&&(aa=this._blitToDefault(aa));
Ya?(aa.attachDepth(sa.depth),this._blitToDefault(this._renderNodes(B.RenderCategory.FINAL,aa)),aa.detachDepth()):this._pluginInput.set(B.RenderCategory.FINAL,aa);this._pluginInput.release("highlights");if(this.onPostRender)this.onPostRender();this._releaseFBOs();this._offscreen.releaseBuffers();this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera);this._sliceHelper.plane=qa;this._isRendering=!1;this.fboCache.frameEnd();this.performanceInfo.finishFrame();Ua!==Y.RendererTarget.Default&&
(this._releaseFBOs(),this._disposeOffscreenBuffers());return{screen:this._pluginInput.get("final-color"),oid:Na}}_prepareShaders(ua,Na){this._renderContext.output=E.ShaderOutput.Color;this._prepareOpaqueGeometry();this._setMultipassTerrain(ua);this._plugins.prepare(U.RenderSlot.TRANSPARENT_TERRAIN);this._setMultipassTerrain(!1);ua||this._plugins.prepare(U.RenderSlot.LINE_CALLOUTS);Na&&this._prepareTransparencySlots();this._plugins.prepare(U.RenderSlot.VIEWSHED,U.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,
U.RenderSlot.TRANSPARENT_ENVIRONMENT,U.RenderSlot.LASERLINES);this._rctx.gl.flush()}_renderObjectAndLayerIdColor(){if(h("enable-feature:objectAndLayerId-rendering")){var ua=this._renderContext.output,Na=this.fboCache.acquire(this._offscreen.width,this._offscreen.height,"oid");Na.acquireDepth(F.DepthFormat.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(Na.fbo);this.fboCache.rctx.clearFramebuffer([0,0,0,0],!0,!0);this._renderAllGeometry(E.ShaderOutput.ObjectAndLayerIdColor);this._rctx.bindFramebuffer(Na.fbo);
this.fboCache.rctx.clearFramebuffer(void 0,!0,!0);this._bindParameters.hudRenderStyle=G.HUDRenderStyle.NotOccluded;this._plugins.render(this._pluginInput,U.RenderSlot.HUD_MATERIAL);this._renderContext.output=ua;this.performanceInfo.advance(la.PerformanceCategory.OBJECT_AND_LAYER_ID_COLOR);return Na}}finish(ua){this._hasAnimations||this._animationTimestep.clear();var Na=this.performanceInfo.gpuSamplingEnabled;if((ua=ua===J.RenderRequestType.BACKGROUND)||Na){const Ua=ua?this.performanceInfo.elapsedTime:
0;Na=Na?this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError();this._animationTimestep.frame(Math.max(Ua,Na),ua)}}readDepthPixels(ua,Na){if(this._bindParameters.mainDepth){var {width:Ua,height:wa}=this._offscreen,sa=this.fboCache.acquire(Ua,wa,"linear-depth");this._rctx.bindFramebuffer(sa.fbo);this._bindParameters.camera.setGLViewport(this._rctx);this._rctx.clearFramebuffer([0,0,0,0],!0,!0);this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,this._bindParameters.mainDepth);
sa.fbo?.readPixels(ua[0],ua[1],ua[2],ua[3],va.PixelFormat.RGBA,va.PixelType.UNSIGNED_BYTE,Na);sa.release()}}readHUDVisibility(ua,Na,Ua,wa,sa){this._bindParameters.hudVisibility?.fbo?.readPixels(ua,Na,Ua,wa,va.PixelFormat.RGBA,va.PixelType.UNSIGNED_BYTE,sa)}readAccumulatedShadow(ua){return this._shadowAccumulator.readAccumulatedShadow(ua[0],ua[1])}_setMultipassTerrain(ua){this._setMultipassEnabled(ua);this._setTerrainCulling(ua)}_setMultipassEnabled(ua){this._bindParameters.multipassEnabled=ua}_setTerrainCulling(ua){this._bindParameters.multipassTerrain.cullAboveGround=
ua}_renderEdges(ua){const Na=this._edgeView;if(Na?.shouldRender()){var {width:Ua,height:wa,depth:sa}=this._offscreen,Ha=this.fboCache.acquire(Ua,wa,"edges");this._offscreen.renderToTargets(()=>Na.render(this._bindParameters,ua),Ha,this._bindParameters.multipassGeometry.depth??sa,ra);this._offscreen.compositeToFramebuffer(this._bindParameters,Ha.getTexture(),X.AlphaMode.Alpha,1);Ha.release();this.performanceInfo.advance(ua===ka.Transparency.OPAQUE?la.PerformanceCategory.OPAQUE_EDGES:la.PerformanceCategory.TRANSPARENT_EDGES)}}_renderShadowMap(ua,
Na,Ua){const wa=this._shadowMap;wa.enabled&&(wa.start(ua,Na,Ua,this.isFeatureEnabled(ha.RenderFeature.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(E.ShaderOutput.ShadowHighlight,this._shadowMap),wa.moveSnapshot(ca.SnapshotSlot.Highlight),this._renderShadowCascades(E.ShaderOutput.ShadowExcludeHighlight,this._shadowMap),wa.copySnapshot(ca.SnapshotSlot.ExcludeHighlight),this._renderShadowCascades(E.ShaderOutput.ShadowHighlight,
this._shadowMap)):this._renderShadowCascades(E.ShaderOutput.Shadow),wa.finish(),ua.setGLViewport(this._rctx),this.performanceInfo.advance(la.PerformanceCategory.SHADOW_MAP))}_renderShadowCascades(ua,Na=this._shadowMap){for(const Ua of Na.cascades)Ua.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(Ua.camera,Ua.camera),this._renderAllGeometry(ua)}get _needsDepth(){return this._plugins.consumes(E.ShaderOutput.Depth)||this.hasReflections||this._needsShadowHighlight||this._needsShadowCast||
this._debugNeedsDepth}_renderNoSSAOGeometryDepth(ua){if(this._needsDepth&&ua){var {width:Na,height:Ua}=this._offscreen,wa=this.fboCache.acquire(Na,Ua,"depth");wa.attachDepth(ua);ua.release();this._rctx.bindFramebuffer(wa.fbo);this._rctx.clearFramebuffer(void 0,!1,!0);this._renderGeometryExcludedFromSSAO(E.ShaderOutput.Depth);f.releaseMaybe(this._bindParameters.depth);this._bindParameters.depth=wa.obtainDepthTexture();wa.release();this.performanceInfo.advance(la.PerformanceCategory.DEPTH)}else this._bindParameters.depth=
f.releaseMaybe(this._bindParameters.depth)}_renderAllGeometryDepth(){if(this._needsDepth){var {width:ua,height:Na}=this._offscreen,Ua=this.fboCache.acquire(ua,Na,"depth").acquireDepth(F.DepthFormat.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(Ua.fbo);this._rctx.clearFramebuffer(void 0,!0,!0);this._renderAllGeometry(E.ShaderOutput.Depth);f.releaseMaybe(this._bindParameters.depth);this._bindParameters.depth=Ua.obtainDepthTexture();Ua.release();this.performanceInfo.advance(la.PerformanceCategory.DEPTH)}else this._bindParameters.depth=
f.releaseMaybe(this._bindParameters.depth)}_renderMultipassTerrainDepth(ua){if(ua){ua=this._renderContext.output;this._renderContext.output=E.ShaderOutput.Depth;var {width:Na,height:Ua}=this._offscreen,wa=this.fboCache.acquire(Na,Ua,"terrain depth").acquireDepth(F.DepthFormat.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(wa.fbo);this._rctx.clearFramebuffer(void 0,!0,!0);this._renderTransparentTerrain();f.releaseMaybe(this._bindParameters.multipassTerrain.depth);this._bindParameters.multipassTerrain.depth=
wa.obtainDepthTexture();this._renderContext.output=ua;wa.release()}else this._bindParameters.multipassTerrain.depth=f.releaseMaybe(this._bindParameters.multipassTerrain.depth)}_renderMultipassGeometryDepth(ua){if(ua){ua=this._renderContext.output;var {width:Na,height:Ua}=this._offscreen,wa=this.fboCache.acquire(Na,Ua,"geometry depth").acquireDepth(F.DepthFormat.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(wa.fbo);this._rctx.clearFramebuffer(void 0,!0,!0);this._renderOpaqueGeometryAndTransparentMaterial(E.ShaderOutput.Depth);
this._renderContext.output=ua;f.releaseMaybe(this._bindParameters.multipassGeometry.depth);this._bindParameters.multipassGeometry.depth=wa.obtainDepthTexture();wa.release()}else this._bindParameters.multipassGeometry.depth=f.releaseMaybe(this._bindParameters.multipassGeometry.depth)}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(ua){if(!this._needsDepthRange)return Q.zero;const Na=W.depthRangeFromScene(ua,this._plugins.plugins,this._stage.layers);Q.union(Na,
this._plugins.queryDepthRange(ua));Na.near=Math.max(ua.near,Na.near);Na.far=Math.min(ua.far,Na.far);return Na}_renderNormals(){var ua=this._nodes.require("normals","final-color","composite-color","opaque-color","transparent-color");ua=(this.hasSSAO?1:0)+(this.hasLaserlines?1:0)+ua;if(0!==ua){var Na=this._offscreen.renderToCachedFBO(null,"normals",()=>this._renderGeometryForSSAO(E.ShaderOutput.Normal),[0,0,0,0],F.ColorFormat.RGBA,F.DepthFormat.DEPTH_STENCIL_TEXTURE),Ua=this._nodes.optional("normals",
"final-color","composite-color","opaque-color","transparent-color")+(this._viewshedEnabled?1:0);Na.retain(ua+Ua-1);this.performanceInfo.advance(la.PerformanceCategory.NORMALS);return Na}}_renderSSAO(){const ua=this._pluginInput.get("normals");if(this.hasSSAO&&ua){var Na=this._nodes.render("ssao",this._pluginInput);this._bindParameters.ssao=Na;ua.detachDepth();this._pluginInput.release("normals");this.performanceInfo.advance(la.PerformanceCategory.SSAO);return Na}ua?.detachDepth()}_renderAllGeometry(ua){this._renderContext.output=
ua;this._plugins.prepare(U.RenderSlot.TRANSPARENT_TERRAIN);this._renderOpaqueGeometryAndTransparentMaterial(ua);this._renderTransparentTerrain()}_renderOpaqueGeometryAndTransparentMaterial(ua){this._renderContext.output=ua;this._plugins.prepare(U.RenderSlot.TRANSPARENT_MATERIAL,U.RenderSlot.TRANSPARENT_NO_SSAO_DEPTH);this._renderOpaqueGeometry();this._renderTransparentMaterial()}_renderGeometryForSSAO(ua){this._renderContext.output=ua;this._plugins.render(this._pluginInput,U.RenderSlot.INTEGRATED_MESH,
U.RenderSlot.OPAQUE_TERRAIN,U.RenderSlot.OPAQUE_MATERIAL,U.RenderSlot.TRANSPARENT_MATERIAL);this._renderTransparentTerrain()}_renderGeometryExcludedFromSSAO(ua){this._renderContext.output=ua;this._plugins.render(this._pluginInput,U.RenderSlot.OPAQUE_NO_SSAO_DEPTH,U.RenderSlot.TRANSPARENT_NO_SSAO_DEPTH)}_prepareOpaqueGeometry(){this._plugins.prepare(...xa,U.RenderSlot.OPAQUE_ENVIRONMENT)}_renderOpaqueGeometry(){this._plugins.render(this._pluginInput,...xa)}_renderTransparentMaterial(){this._plugins.render(this._pluginInput,
...Ma)}_renderTransparentTerrain(){var ua=this._renderContext.output;if(this._plugins.produces(ua,U.RenderSlot.TRANSPARENT_TERRAIN)){var Na=()=>this._plugins.render(this._pluginInput,U.RenderSlot.TRANSPARENT_TERRAIN);if(ua!==E.ShaderOutput.Color)Na();else{var {width:Ua,height:wa,depth:sa}=this._offscreen;ua=this.fboCache.acquire(Ua,wa,"transparent terrain");this._offscreen.renderToTargets(Na,ua,sa,[0,0,0,0]);return ua}}}_renderHUDVisibility(){this._plugins.produces(this._renderContext.output,U.RenderSlot.OCCLUSION_PIXELS)?
(this._bindParameters.hudVisibility=this._offscreen.renderHUDVisibility(this._bindParameters.hudVisibility,()=>this._plugins.render(this._pluginInput,U.RenderSlot.OCCLUSION_PIXELS),this._bindParameters.multipassGeometry.depth),this._offscreen.bindFbo(),this.performanceInfo.advance(la.PerformanceCategory.HUD_VISIBILITY)):this._bindParameters.hudVisibility=f.releaseMaybe(this._bindParameters.hudVisibility)}_renderLineCallouts(ua){this._bindParameters.hudRenderStyle=ua;if(ua===G.HUDRenderStyle.Occluded){const {width:Na,
height:Ua,color:wa}=this._offscreen;ua=this.fboCache.acquireDepth(F.DepthFormat.DEPTH16_BUFFER,Na,Ua,"line callouts");this._offscreen.renderToTargets(()=>this._plugins.render(this._pluginInput,U.RenderSlot.LINE_CALLOUTS),wa,ua,void 0,!0,!0);ua.release()}else this._plugins.render(this._pluginInput,U.RenderSlot.LINE_CALLOUTS)}_renderLaserlines(){if(this.hasLaserlines){this._plugins.render(this._pluginInput,U.RenderSlot.LASERLINES);if(this._plugins.produces(this._renderContext.output,U.RenderSlot.LASERLINES_CONTRAST_CONTROL)){const ua=
this._offscreen,{width:Na,height:Ua,depth:wa}=ua,sa=this.fboCache.acquire(Na,Ua,"laser lines");ua.renderToTargets(()=>this._plugins.render(this._pluginInput,U.RenderSlot.LASERLINES_CONTRAST_CONTROL),sa,wa,ra);ua.compositeToFramebuffer(this._bindParameters,sa.getTexture(),X.AlphaMode.PremultipliedAlpha,1);sa.release()}this._pluginInput.release("normals");this.performanceInfo.advance(la.PerformanceCategory.LASER_LINES)}}_renderHUD(ua,Na){if(this._pluginsHas.hudElements){if(this._oitEnabled){const Ua=
this._renderOITPass(Da.HUD,ua);this._rctx.bindFramebuffer(Na.fbo);this._compositingHelper.composite(this._bindParameters,Ua.getTexture(),X.AlphaMode.PremultipliedAlpha);Ua.release()}else if(ua===G.HUDRenderStyle.Occluded){this._renderContext.output=E.ShaderOutput.Color;const {width:Ua,height:wa,color:sa}=this._offscreen;Na=this.fboCache.acquireDepth(F.DepthFormat.DEPTH16_BUFFER,Ua,wa,"hud");this._offscreen.renderToTargets(()=>this._renderHUDElements(ua),sa,Na,void 0,!0,!0);Na.release()}else this._renderContext.output=
E.ShaderOutput.Color,Na.acquireDepth(F.DepthFormat.DEPTH16_BUFFER),this._rctx.bindFramebuffer(Na.fbo),this._renderHUDElements(ua),Na.detachDepth();this.performanceInfo.advance(ua===G.HUDRenderStyle.Occluded?la.PerformanceCategory.HUD_OCCLUDED:la.PerformanceCategory.HUD)}}_renderHUDElements(ua){this._bindParameters.hudRenderStyle=ua;this._plugins.prepare(U.RenderSlot.LINE_CALLOUTS_HUD_DEPTH,U.RenderSlot.HUD_MATERIAL,U.RenderSlot.LABEL_MATERIAL);this._plugins.render(this._pluginInput,U.RenderSlot.LINE_CALLOUTS_HUD_DEPTH,
U.RenderSlot.HUD_MATERIAL,U.RenderSlot.LABEL_MATERIAL)}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._plugins.produces(E.ShaderOutput.ShadowHighlight,U.RenderSlot.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(this.hasHighlights){var ua=this._offscreen.renderToCachedFBO(null,"highlights",()=>{this._renderAllGeometry(E.ShaderOutput.Highlight);this._rctx.clear(va.ClearBufferBit.DEPTH_BUFFER_BIT);this._renderHUDElements(G.HUDRenderStyle.Both)},[0,0,0,0],F.ColorFormat.RGBA4,F.DepthFormat.DEPTH_STENCIL_TEXTURE);
ua.detachDepth();return ua}}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_renderShadowAccumulation(ua,Na,Ua){this._needsShadowCast&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,ua,Na,Ua)&&this.performanceInfo.advance(la.PerformanceCategory.ACCUMULATED_SHADOWS)}_prepareTransparencySlots(){this._renderContext.output=E.ShaderOutput.Color;this._bindParameters.transparencyPassType=da.TransparencyPassType.ColorAlpha;this._plugins.prepare(...Ma);
this._bindParameters.transparencyPassType=da.TransparencyPassType.FrontFace;this._plugins.prepare(...Ma);this._bindParameters.transparencyPassType=da.TransparencyPassType.NONE;this._techniques.acquire(ja.OITCompositingTechnique).release()}_renderOITPass(ua,Na=G.HUDRenderStyle.Both){var Ua=ua===Da.HUD;ua=Ua?this.fboCache.acquire(this._offscreen.width,this._offscreen.height,"oit hud composite"):null;const wa=Ua?()=>this._renderHUDElements(Na):()=>this._renderTransparentMaterial(),sa=this._renderContext.output;
this._renderContext.output=E.ShaderOutput.Color;this._bindParameters.transparencyPassType=da.TransparencyPassType.ColorAlpha;const Ha=this._offscreen.renderOITPass(wa,da.TransparencyPassType.ColorAlpha,Ua);this._bindParameters.transparencyPassType=da.TransparencyPassType.FrontFace;Ua=this._offscreen.renderOITPass(wa,da.TransparencyPassType.FrontFace,Ua);this._offscreen.compositeOIT(this._bindParameters,Ha,Ua,ua);ua?.detachDepth();Ua.release();Ha.release();this._bindParameters.transparencyPassType=
da.TransparencyPassType.NONE;this._renderContext.output=sa;return ua}_renderOccluded(){let ua=0;Ga.clear();this._plugins.plugins.forAll(Aa=>{Aa.materialReference&&Aa.queryRenderOccludedState(S.RenderOccludedFlag.OccludeAndTransparentStencil)&&(ua|=S.RenderOccludedFlag.OccludeAndTransparentStencil,Ga.push(Aa))});const Na=this._offscreen,Ua=(Aa,Sa,Ya,qa,aa)=>{if(0!==(ua&Sa)){var {width:Ja,height:Ta,depth:Ra}=Na;Sa=this.fboCache.acquire(Ja,Ta,"tmp color");Na.renderToTargets(Ya,Sa,Ra,[0,0,0,0],qa,aa);
Na.compositeToFramebuffer(this._bindParameters,Sa.getTexture(),X.AlphaMode.PremultipliedAlpha,Aa);Sa.release()}},wa=(Aa,Sa)=>{this._bindParameters.slot=Aa;Sa.forAll(Ya=>{if(L.isPrepareRenderPlugin(Ya)){const qa=Ya.prepareTechnique(this._renderContext);qa&&Ya.renderNode(this._renderContext,qa)}})};0!==Ga.length&&(wa(U.RenderSlot.OCCLUDER_MATERIAL,Ga),Ua(.5,S.RenderOccludedFlag.OccludeAndTransparentStencil,()=>wa(U.RenderSlot.TRANSPARENT_OCCLUDER_MATERIAL,Ga),!1,!1));const sa=0<Ga.length;Ga.clear();
this._plugins.plugins.forAll(Aa=>{if(Aa.materialReference){var Sa=Aa.queryRenderOccludedState(S.RenderOccludedFlag.OccludeAndTransparent),Ya=Aa.queryRenderOccludedState(S.RenderOccludedFlag.Transparent),qa=Aa.queryRenderOccludedState(S.RenderOccludedFlag.Opaque);if(Sa||Ya||qa)ua|=Sa?S.RenderOccludedFlag.OccludeAndTransparent:Ya?S.RenderOccludedFlag.Transparent:S.RenderOccludedFlag.Opaque,Ga.push(Aa)}});const Ha=this._plugins.renderOccludedFlags;if(ua|=Ha){var Ka=Aa=>{this._renderContext.renderOccludedMask=
Aa;Ha>S.RenderOccludedFlag.Occlude&&this._plugins.render(this._pluginInput,U.RenderSlot.OCCLUDED_TERRAIN);wa(U.RenderSlot.OPAQUE_MATERIAL,Ga);wa(U.RenderSlot.TRANSPARENT_MATERIAL,Ga);wa(U.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,Ga);this._renderContext.renderOccludedMask=T.defaultRenderOccludedMask};this._renderContext.output=E.ShaderOutput.Color;Ua(.5,S.RenderOccludedFlag.OccludeAndTransparent,()=>Ka(S.RenderOccludedFlag.OccludeAndTransparent),!0,J.StencilBits.OutlineVisualElementMask);
Ua(.5,S.RenderOccludedFlag.Transparent,()=>Ka(S.RenderOccludedFlag.Transparent),!0,J.StencilBits.OutlineVisualElementMask);Ua(1,S.RenderOccludedFlag.Opaque,()=>Ka(S.RenderOccludedFlag.Opaque),!0,J.StencilBits.OutlineVisualElementMask);(sa||0<Ga.length)&&this.performanceInfo.advance(la.PerformanceCategory.OCCLUDED);Ga.clear()}}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters);this._offscreen.bindFbo();this._plugins.render(this._pluginInput,U.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,
U.RenderSlot.TRANSPARENT_ENVIRONMENT);this.performanceInfo.advance(la.PerformanceCategory.TRANSPARENT_ENVIRONMENT)}_renderViewshed(){this._viewshedEnabled&&(this._viewshed.renderHighQuality=this.isFeatureEnabled(ha.RenderFeature.HighResolutionViewshed),this._plugins.render(this._pluginInput,U.RenderSlot.VIEWSHED),this._pluginInput.release("normals"),this.performanceInfo.advance(la.PerformanceCategory.VIEWSHED))}_renderPlugins(ua,Na){this._plugins.produces(this._renderContext.output,ua)&&(this._plugins.render(this._pluginInput,
ua),this.performanceInfo.advance(Na))}_renderNodes(ua,Na,Ua=!1){if(!this._nodes.produces(ua))return Ua&&this.performanceInfo.advance(ua),Na;Na.setName(ua);this._pluginInput.set(ua,Na);Na=this._nodes.render(Na,this._pluginInput,this._releaseNormals);this.performanceInfo.advance(ua);return Na}_blitToDefault(ua,Na=H.defaultWebGLFBO,Ua=!0){this._blit||(this._blit=new M.Blit(this._techniques));Na=this._blit.render(this._rctx,ua,Na,this._bindParameters,this._requestRender);this._pluginInput.set(ua.name,
Na);Ua&&ua.release();return Na}_ensureBindParametersCamera(ua,Na){this._bindParameters.camera=ua;this._bindParameters.contentCamera=Na}_ensureBindParametersSSR(ua){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=ua);this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=x.IDENTITY:(u.invert(Qa,this._bindParameters.camera.viewMatrix),u.invert(Pa,this._bindParameters.camera.projectionMatrix),u.multiply(Ea,Qa,Pa),u.multiply(Ea,
this._renderContext.lastFrameCamera.viewMatrix,Ea),u.multiply(Ea,this._renderContext.lastFrameCamera.projectionMatrix,Ea),this._reprojectionMatrix=Ea);const Na=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=0<Na?Math.min(Na,ua-this._ssrEnableTime)/Na:1;1>this._bindParameters.ssr.fadeFactor&&this._requestRender()}else this._reprojectionMatrix=x.IDENTITY,this._ssrEnableTime=null}addRenderNode(ua){this._nodes.add(ua);this._requestRender()}removeRenderNode(ua){this._nodes.remove(ua);
this._requestRender()}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}get _viewshedEnabled(){return this._viewshed.enabled&&this._plugins.produces(this._renderContext.output,U.RenderSlot.VIEWSHED)}get test(){}}q.__decorate([t.property({readOnly:!0})],ya.prototype,"fullResolutionAtmosphere",null);q.__decorate([t.property()],ya.prototype,"_edgeView",void 0);q.__decorate([t.property()],ya.prototype,"updating",null);var Da;(function(ua){ua[ua.Geometry=
0]="Geometry";ua[ua.HUD=1]="HUD"})(Da||={});b.FramebufferId=void 0;(function(ua){ua[ua.Color=0]="Color";ua[ua.LinearDepth=1]="LinearDepth";ua[ua.ShadowMap=2]="ShadowMap";ua[ua.HudVisibility=3]="HudVisibility";ua[ua.ViewshedShadowMap=4]="ViewshedShadowMap"})(b.FramebufferId||(b.FramebufferId={}));const ra=[0,0,0,0],xa=[U.RenderSlot.INTEGRATED_MESH,U.RenderSlot.OPAQUE_TERRAIN,U.RenderSlot.OPAQUE_MATERIAL,U.RenderSlot.OPAQUE_NO_SSAO_DEPTH],Ma=[U.RenderSlot.TRANSPARENT_MATERIAL,U.RenderSlot.TRANSPARENT_NO_SSAO_DEPTH],
Ga=new c,Pa=x.create(),Qa=x.create(),Ea=x.create();b.Renderer=ya;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl":function(){define(["exports","../../core/libs/gl-matrix-2/factories/mat4f64","../../geometry/projection/computeTranslationToOriginAndRotation","../../geometry/projection/projectBuffer"],function(a,b,q,l){a.RenderCategory=void 0;(function(p){p.OPAQUE="opaque-color";p.TRANSPARENT="transparent-color";p.COMPOSITE="composite-color";p.FINAL="final-color"})(a.RenderCategory||
(a.RenderCategory={}));a.InternalRenderCategory=void 0;(function(p){p.ANTIALIASING="aa-color";p.HIGHLIGHTS="highlight-color";p.MAGNIFIER="magnifier-color"})(a.InternalRenderCategory||(a.InternalRenderCategory={}));a.fromRenderCoordinates=function(p,k,h,f,c,e,g){e=e||p.spatialReference;return l.projectBuffer(k,p.renderCoordsHelper.spatialReference,h,f,e,c,g)?f:null};a.renderCoordinateTransformAt=function(p,k,h,f){f||=b.create();h=h||p.spatialReference;return q.computeTranslationToOriginAndRotation(h,
k,f,p.renderCoordsHelper.spatialReference)?f:null};a.toRenderCoordinates=function(p,k,h,f,c,e,g){f=f||p.spatialReference;return l.projectBuffer(k,f,h,c,p.renderCoordsHelper.spatialReference,e,g)?c:null};a.webgl=null;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/FBOCache":function(){define("exports ../../webgl/formats ../../webgl/ManagedColorAttachment ../../webgl/ManagedDepthAttachment ../../webgl/ManagedFBO ../../webgl/ManagedFBObject ./FBOPool ../../../webgl/enums ../../../webgl/FramebufferObject ../../../webgl/Renderbuffer ../../../webgl/RenderbufferDescriptor ../../../webgl/Texture ../../../webgl/TextureDescriptor".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w{constructor(C){this.rctx=C;this._acquired=new Set;this._cache=new h.FBOPool(C.newCache,"FBOCache");this._depthCache=new h.FBOPool(C.newCache,"DepthAttachmentCache");this._colorCache=new h.FBOPool(C.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy();this._depthCache.destroy();this._colorCache.destroy()}clean(){this._cache.clean();this._colorCache.clean();this._depthCache.clean()}frameStart(){this._cache.frame();this._colorCache.frame();this._depthCache.frame();
this.debugCallback&&this.debugCallback()}frameEnd(){const C=this.debugCallback;C&&this._acquired.forEach(D=>D.type===k.AttachmentType.FBO&&C(D.name,D.fbo))}get usedMemory(){return Array.from(this._acquired.values()).reduce((C,D)=>C+("getTexture"in D?D.getTexture()?.usedMemory??0:D.usedMemory),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(C){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=C}acquire(C,D,F,H=b.ColorFormat.RGBA){const N=
`${H}x${C}x${D}`;let E=this._cache.pop(N);E?(E.retain(),E.setName(F),F=this.rctx.getBoundFramebufferObject(),this.rctx.bindFramebuffer(E.fbo),this.rctx.setDrawBuffers([f.ColorAttachment.COLOR_ATTACHMENT0]),this.rctx.bindFramebuffer(F)):E=new p(N,F,new c.FramebufferObject(this.rctx,{...A[H],width:C,height:D}),G=>{G??=b.DepthFormat.DEPTH_STENCIL_TEXTURE;G=this._acquireDepth(G,E.fbo.width,E.fbo.height,`${E.name} depth`);E.attachDepth(G);G.release();return E},(G,I)=>{I??=b.ColorFormat.RGBA;I=this._acquireColor(I,
C,D,`${E.name} color ${G}`);E.attachColor(I,G);I.release();return E},()=>{this.debugCallback&&this.debugCallback(E.name,E.fbo);this._acquired.delete(E);E.detachAll();this._cache.put(E)});return this._trackHandle(E)}acquireDepth(C,D,F,H){return this._acquireDepth(C,D,F,H)}_acquireDepth(C,D,F,H){const N=`${C}x${D}x${F}`,E=this._depthCache.pop(N);if(E)return E.retain(),E.name=H,this._trackHandle(E);const G=C===b.DepthFormat.DEPTH_STENCIL_TEXTURE?new l.ManagedDepthAttachment(N,new d.Texture(this.rctx,
{...B[C],width:D,height:F}),()=>{this._acquired.delete(G);this._depthCache.put(G)}):new l.ManagedDepthAttachment(N,new e.Renderbuffer(this.rctx,{...B[C],width:D,height:F}),()=>{this._acquired.delete(G);this._depthCache.put(G)});G.name=H;return this._trackHandle(G)}_acquireColor(C,D,F,H){const N=`${C}x${D}x${F}`,E=this._colorCache.pop(N);if(E)return E.retain(),E.name=H,this._trackHandle(E);const G=new q.ManagedColorAttachment(N,new d.Texture(this.rctx,{...A[C],width:D,height:F}),()=>{this._acquired.delete(G);
this._colorCache.put(G)});G.name=H;return this._trackHandle(G)}_trackHandle(C){this._acquired.add(C);return C}}const v=new p("default","default",null,()=>v,()=>v,()=>{}),m=new t.TextureDescriptor;m.pixelFormat=f.PixelFormat.RED;m.internalFormat=f.SizedPixelFormat.R8;m.wrapMode=f.TextureWrapMode.CLAMP_TO_EDGE;const r=new t.TextureDescriptor;r.pixelFormat=f.PixelFormat.RG;r.internalFormat=f.SizedPixelFormat.RG8;r.wrapMode=f.TextureWrapMode.CLAMP_TO_EDGE;const n=new t.TextureDescriptor;n.internalFormat=
f.SizedPixelFormat.RGBA4;n.dataType=f.PixelType.UNSIGNED_SHORT_4_4_4_4;n.wrapMode=f.TextureWrapMode.CLAMP_TO_EDGE;const u=new t.TextureDescriptor;u.wrapMode=f.TextureWrapMode.CLAMP_TO_EDGE;const x=new t.TextureDescriptor;x.wrapMode=f.TextureWrapMode.CLAMP_TO_EDGE;x.samplingMode=f.TextureSamplingMode.LINEAR_MIPMAP_LINEAR;x.hasMipmap=!0;x.maxAnisotropy=8;const y=new t.TextureDescriptor;y.pixelFormat=f.PixelFormat.RED;y.dataType=f.PixelType.HALF_FLOAT;y.internalFormat=f.SizedPixelFormat.R16F;y.samplingMode=
f.TextureSamplingMode.NEAREST;const z=new t.TextureDescriptor;z.dataType=f.PixelType.HALF_FLOAT;z.internalFormat=f.SizedPixelFormat.RGBA16F;z.samplingMode=f.TextureSamplingMode.NEAREST;const A={[b.ColorFormat.RED]:m,[b.ColorFormat.RG]:r,[b.ColorFormat.RGBA4]:n,[b.ColorFormat.RGBA]:u,[b.ColorFormat.RGBA_MIPMAP]:x,[b.ColorFormat.R16F]:y,[b.ColorFormat.RGBA16F]:z};t=new t.TextureDescriptor;t.pixelFormat=f.PixelFormat.DEPTH_STENCIL;t.dataType=f.PixelType.UNSIGNED_INT_24_8;t.samplingMode=f.TextureSamplingMode.NEAREST;
t.wrapMode=f.TextureWrapMode.CLAMP_TO_EDGE;const B={[b.DepthFormat.DEPTH_STENCIL_TEXTURE]:t,[b.DepthFormat.DEPTH16_BUFFER]:new g.RenderbufferDescriptor(f.RenderbufferFormat.DEPTH_COMPONENT16,4)};a.FBOCache=w;a.defaultWebGLFBO=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/ManagedColorAttachment":function(){define(["exports","./ManagedFBOAttachment","./ManagedFBObject"],function(a,b,q){class l extends b.ManagedFBOAttachment{constructor(p,k,h){super(p,k,h);this.attachment=
k;this.type=q.AttachmentType.COLOR}}a.ManagedColorAttachment=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/ManagedFBOAttachment":function(){define(["exports","./ManagedFBObject"],function(a,b){class q extends b.ManagedFBObject{constructor(l,p,k){super(l,k);this.attachment=p;this.name=""}dispose(){this.attachment.dispose()}get usedMemory(){return this.attachment.usedMemory}}a.ManagedFBOAttachment=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl/ManagedFBObject":function(){define(["exports"],function(a){class b{constructor(q,l){this.key=q;this.free=l;this.incarnation=0;this._refCount=1}retain(q=1){this._refCount+=q}release(){if(0===this._refCount)return console.log(`Releasing already released FBO attachment in ${Error().stack}`),!0;--this._refCount;return 0===this._refCount?(this.free(),!0):!1}}a.AttachmentType=void 0;(function(q){q[q.FBO=0]="FBO";q[q.DEPTH=1]="DEPTH";q[q.COLOR=2]="COLOR"})(a.AttachmentType||(a.AttachmentType=
{}));a.ManagedFBObject=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/ManagedDepthAttachment":function(){define(["exports","./ManagedFBOAttachment","./ManagedFBObject"],function(a,b,q){class l extends b.ManagedFBOAttachment{constructor(){super(...arguments);this.type=q.AttachmentType.DEPTH}}a.ManagedDepthAttachment=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/ManagedFBO":function(){define(["../../../core/maybe","./ManagedDepthTexture",
"./ManagedFBObject","../../webgl/enums"],function(a,b,q,l){class p extends q.ManagedFBObject{constructor(k,h,f,c,e,g){super(k,g);this.type=q.AttachmentType.FBO;this._colors=new Map;this._name="composite-color";this.acquireColor=this.acquireDepth=null;this._name=h;this.fbo=f;this.acquireDepth=c;this.acquireColor=e}dispose(){this.fbo?.dispose()}get usedMemory(){return this.fbo?.usedMemory||0}get name(){return this._name}setName(k){this._name=k}getTexture(k=l.ColorAttachment.COLOR_ATTACHMENT0){return k===
l.DepthStencilAttachment?this.fbo?.depthStencilTexture:this.fbo?.getColorTexture(k)}getAttachment(k=l.ColorAttachment.COLOR_ATTACHMENT0){return k===l.DepthStencilAttachment?this._depth:this._colors.get(k)}attachDepth(k){k?.retain();this.detachDepth();k&&this.fbo?.attachDepthStencil(k.attachment);this._depth=k;return this}detachDepth(){this.fbo?.detachDepthStencilTexture();this.fbo?.detachDepthStencilBuffer();this._depth=a.releaseMaybe(this._depth)}obtainDepthTexture(){const k=this._depth;if(!b.isManagedDepthTexture(k))return null;
this.fbo?.detachDepthStencilTexture();this._depth=null;return k}attachColor(k,h){k.retain();this.detachColor(h);this.fbo?.attachColorTexture(k.attachment,h);this._colors.set(h,k);return this}detachColor(k){this.fbo?.detachColorTexture(k);const h=this._colors.get(k);this._colors.delete(k);h?.release()}detachAll(){this._colors.forEach((k,h)=>this.detachColor(h));this.detachDepth()}}return p})},"esri/views/3d/webgl/ManagedDepthTexture":function(){define(["exports","../../webgl/GLObjectType"],function(a,
b){a.isManagedDepthTexture=function(q){return q?.attachment.type===b.GLObjectType.Texture};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/FBOPool":function(){define(["exports","../../../../core/MemCachePool","../../../../core/PooledArray"],function(a,b,q){class l{constructor(p,k){this._last=new q;this._incarnation=0;this._cache=new b.MemCachePool(p,k)}destroy(){this._last?.forAll(p=>p.dispose());this._last=null;this._cache.destroy()}set interactive(p){p&&
!this._last?this._last=new q:p||(this._last?.forAll(k=>k.dispose()),this._last=null)}clean(){this._last?.filterInPlace(p=>p.incarnation<this._incarnation?(this._cache.put(p.key,p),!1):!0)}frame(){++this._incarnation}pop(p){if(this._last){const k=this._last.find(h=>h.key===p);if(k)return this._last.removeUnordered(k),k}return this._cache.pop(p)}put(p){p.incarnation=this._incarnation;this._last?this._last.push(p):this._cache.put(p.key,p)}get usedMemory(){return this._last?.reduce((p,k)=>p+k.usedMemory,
0)??0}}a.FBOPool=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/renderPasses/RenderPassManager":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../core/Logger ../../../../../core/has ../../../../../core/RandomLCG ../../../../../core/Error ../../../../../core/accessorSupport/decorators/subclass ../../../../../core/libs/gl-matrix-2/math/mat3 ../../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../../core/libs/gl-matrix-2/math/mat4 ../../../../../chunks/vec32 ../../../../../core/libs/gl-matrix-2/factories/vec3f64 ./AllRenderPasses ./RenderPass ../shaderLibrary/ShaderOutput ../util/TwoVectorPosition ../../effects/RenderPlugin ../../lib/depthRange ../../lib/RenderSlot".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u){a.RenderPassManager=class extends r.SyncPreparesRenderPlugin{constructor(){super({});this._passes=null;this.produces=new Map([[u.RenderSlot.OPAQUE_MATERIAL,A=>this._produces(A)],[u.RenderSlot.TRANSPARENT_MATERIAL,A=>this._passes&&0<this._passes.materialTransparent.count?this._produces(A):!1],[u.RenderSlot.INTEGRATED_MESH,A=>this._produces(A)]]);this._materialPassParameters=new t.MaterialPassParameters;this._shadowPassParameters=new t.ShadowMapPassParameters;
this._highlightPassParameters=new t.HighlightPassParameters;this._viewshedPassParameters=new t.ViewshedShadowMapPassParameters;this._systems=new Set}initializeRenderContext(A){this._context=A;const B=A.renderContext.rctx;A=A.techniques;this._passes={materialOpaque:new w.RenderPass(B,A),materialTransparent:new w.RenderPass(B,A,w.RenderPassSorting.BackToFront),materialIntegratedMesh:new w.RenderPass(B,A),shadowMap:new w.RenderPass(B,A),highlight:new w.RenderPass(B,A),highlightIntegratedMesh:new w.RenderPass(B,
A),highlightShadowMap:new w.RenderPass(B,A),viewshedShadowMap:new w.RenderPass(B,A),defaultShadowMap:new w.RenderPass(B,A)}}get rctx(){return this._context.renderContext.rctx}uninitializeRenderContext(){}dispose(){this._context=null;this._systems.clear()}register(A){this._systems.add(A)}_produces(A){return 0===this._systems.size||null===this._passes?!1:A===v.ShaderOutput.Highlight?0<this._passes.highlight.count||0<this._passes.highlightIntegratedMesh.count:A===v.ShaderOutput.ShadowHighlight?0<this._passes.highlight.count:
!0}prepareRender(A){if(0!==this._systems.size&&null!==this._passes){for(const B of Object.values(this._passes))B.prepareSubmit();this._systems.forEach(B=>B.submit(this._passes,A.bindParameters));for(const B of Object.values(this._passes))B.finishSubmit();this._context.techniques.frameUpdate()}}prepareTechniques(A){if(0===this._systems.size)return null;const B=A.bindParameters;this._updateParameters(B.camera,A.output===v.ShaderOutput.Shadow||A.output===v.ShaderOutput.ShadowHighlight||A.output===v.ShaderOutput.ShadowExcludeHighlight?
this._shadowPassParameters:A.output===v.ShaderOutput.ViewshedShadow?this._viewshedPassParameters:A.output===v.ShaderOutput.Highlight?this._highlightPassParameters:this._materialPassParameters,B.slot===u.RenderSlot.TRANSPARENT_MATERIAL);this._materialPassParameters.output=A.output;return this._invoke(A,(C,D)=>C.prepare(D,A.bindParameters))}renderNode(A,B){this._invoke(A,(C,D)=>C.dispatch(D,A.bindParameters,B))}_invoke(A,B){if(null===this._passes)return null;switch(A.bindParameters.slot){case u.RenderSlot.OPAQUE_MATERIAL:switch(A.output){case v.ShaderOutput.Color:case v.ShaderOutput.Depth:case v.ShaderOutput.Normal:case v.ShaderOutput.ObjectAndLayerIdColor:return B(this._passes.materialOpaque,
this._materialPassParameters);case v.ShaderOutput.Highlight:return B(this._passes.highlight,this._highlightPassParameters);case v.ShaderOutput.Shadow:return B(this._passes.shadowMap,this._shadowPassParameters);case v.ShaderOutput.ShadowHighlight:return B(this._passes.highlightShadowMap,this._shadowPassParameters);case v.ShaderOutput.ShadowExcludeHighlight:return B(this._passes.defaultShadowMap,this._shadowPassParameters);case v.ShaderOutput.ViewshedShadow:return B(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break;
case u.RenderSlot.TRANSPARENT_MATERIAL:switch(A.output){case v.ShaderOutput.Color:case v.ShaderOutput.Depth:case v.ShaderOutput.Normal:case v.ShaderOutput.ObjectAndLayerIdColor:return B(this._passes.materialTransparent,this._materialPassParameters)}break;case u.RenderSlot.INTEGRATED_MESH:switch(A.output){case v.ShaderOutput.Color:case v.ShaderOutput.Depth:case v.ShaderOutput.Normal:case v.ShaderOutput.ObjectAndLayerIdColor:return B(this._passes.materialIntegratedMesh,this._materialPassParameters);
case v.ShaderOutput.Highlight:return B(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}}return null}notifyDirty(){this._context.requestRender()}queryDepthRange(A){const B=new n.DepthRange;this._systems.forEach(C=>n.union(B,C.queryShadowCasterDepthRange(A)));return B}_updateParameters(A,B,C){const D=A.viewInverseTransposeMatrix;g.set(x,D[3],D[7],D[11]);z.set(x);g.copy(B.transformWorldFromViewTH,z.high);g.copy(B.transformWorldFromViewTL,z.low);g.copy(B.slicePlaneLocalOrigin,x);f.fromMat4(B.transformViewFromCameraRelativeRS,
A.viewMatrix);e.copy(B.transformProjFromView,A.projectionMatrix);B.identifier===t.RenderPassIdentifier.Material&&(this._materialPassParameters.transparent=C,f.transpose(y,B.transformViewFromCameraRelativeRS),f.invert(B.transformNormalViewFromGlobal,y))}};a.RenderPassManager=b.__decorate([h.subclass("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],a.RenderPassManager);const x=d.create(),y=c.create(),z=new m.TwoVectorPosition;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/core/renderPasses/RenderPass":function(){define(["exports","../../../../../core/PooledArray","../../lib/TransparencyPassType","../../../../webgl/enums"],function(a,b,q,l){a.RenderPassSorting=void 0;(function(h){h[h.FrontToBack=0]="FrontToBack";h[h.BackToFront=1]="BackToFront"})(a.RenderPassSorting||(a.RenderPassSorting={}));class p{constructor(h,f,c=a.RenderPassSorting.FrontToBack){this._rctx=h;this._techniques=f;this._sorting=c;this._draws=new b({initialSize:32,allocator:e=>
e||{material:null,geometry:null,geometryRanges:null,bindDrawParams:null,depthSquaredHint:0,indexType:0}});this._previouslyBoundDraw=new Map}submitDraw(h,f,c,e){const g=this._draws.pushNew();g.geometry=f;g.geometryRanges=c;g.material=h;g.depthSquaredHint=e;g.indexType=(f.indexed?f.vao.indexBuffer.indexType:null)??0}prepare(h,f){return this._draws.map(c=>c.material.prepareTechnique(this._techniques,h,f,c.geometry.parameters))}dispatch(h,f,c){const e=this._rctx;this._previouslyBoundDraw.clear();let g=
null;const d=this._draws.length;for(let v=0;v<d;v++){var t=c[v];if(t!==g||t.configuration.transparencyPassType!==q.TransparencyPassType.NONE)e.bindTechnique(t,f,h),g=t;var w=this._draws.data[v];const m=w.geometry;e.bindVAO(m.vao);this._previouslyBoundDraw.get(t)!==w.material&&(t.program.bindDraw(w.material,f,h),this._previouslyBoundDraw.set(t,w.material));t=w.geometryRanges;const r=t.length;if(0!==w.indexType){const n=k.get(w.indexType);for(let u=0;u<r;u+=2)e.drawElements(m.primitiveType,t[u+1],w.indexType,
t[u]*n)}else for(w=0;w<r;w+=2)e.drawArrays(m.primitiveType,t[w],t[w+1])}}prepareSubmit(){this._draws.clear()}finishSubmit(){const h=this._sorting===a.RenderPassSorting.FrontToBack?1:-1;this._draws.sort((f,c)=>{const e=h*(f.depthSquaredHint-c.depthSquaredHint);return 0!==e?e:f.geometry.vao.byteSize-c.geometry.vao.byteSize})}get count(){return this._draws.length}}const k=new Map;k.set(l.DataType.UNSIGNED_BYTE,1);k.set(l.DataType.UNSIGNED_SHORT,2);k.set(l.DataType.UNSIGNED_INT,4);a.RenderPass=p;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/RenderNodes":function(){define("exports ../../../../core/Logger ../../../../core/PooledArray ../../webgl/utils ../core/FBOCache ../../../webgl/checkWebGLError".split(" "),function(a,b,q,l,p,k){class h{constructor(f){this._context=f;this._nodes=new q}destroy(){this._nodes.forEach(f=>f.destroy());this._nodes.clear()}add(f){this._nodes.push(f);k.hasFeatureFlagWebGLDebug&&console.log(`Registered render nodes: ${this._nodes.map(({declaredClass:c})=>
c).join(", ")}`)}remove(f){this._nodes.remove(f);k.hasFeatureFlagWebGLDebug&&console.log(`Registered render nodes: ${this._nodes.map(({declaredClass:c})=>c).join(", ")}`)}produces(f){return this._nodes.some(({produces:c})=>c===f)}require(f,...c){const e=this._nodes;return c.reduce((g,d)=>g+e.reduce((t,{consumes:w,produces:v})=>t+(w.required.includes(f)&&v===d?1:0),0),0)}optional(f,...c){const e=this._nodes;return c.reduce((g,d)=>g+e.reduce((t,{consumes:w,produces:v})=>t+(w.optional?.includes(f)&&
v===d?1:0),0),0)}updateAnimation(){return this._nodes.reduce((f,c)=>c.updateAnimation()||f,!1)}render(f,c,e=()=>{}){const g=l.isManagedFBO(f)?f.name:f,d=this._nodes.filter(({produces:t})=>t===g);if(0===d.length)return l.isManagedFBO(f)?f:p.defaultWebGLFBO;d.forEach(t=>{const w=l.isManagedFBO(f)?[f]:[];for(var v of t.consumes.required){if(v===g)continue;const m=c.get(v);if(!m){e&&e(w);return}w.push(m)}if(t.consumes.optional)for(const m of t.consumes.optional)m!==g&&(v=c.get(m))&&w.push(v);try{const m=
t.doRender(w,this._context);m&&m!==f&&(l.isManagedFBO(f)?(f.release(),f=m,c.set(g,f)):f=m)}catch(m){b.getLogger(t).errorOnce(m)}e&&e(w)});this._context.rctx.enforceState();return l.isManagedFBO(f)?f:p.defaultWebGLFBO}}a.RenderNodes=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl/utils":function(){define(["exports"],function(a){a.isManagedFBO=function(b){return b.name};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/RenderPluginManager":function(){define("exports ../../../../core/has ../../../../core/PooledArray ../../../../core/promiseUtils ../../../../core/signal ../core/shaderLibrary/ShaderOutput ./RenderPlugin ../lib/basicInterfaces ../lib/depthRange ../lib/Material ../lib/RenderSlot".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){class d{constructor(t){this._context=t;this._renderPlugins=new q;this._materialRenderers=new Map;this._slots=[];this._renderVersion=p.signal(0);for(t=0;t<g.RenderSlot.MAX_SLOTS;++t)this._slots[t]=[]}destroy(){this._renderPlugins.forEach(t=>t.destroy());this._renderPlugins.clear();this._materialRenderers.clear()}get plugins(){return this._renderPlugins}add(t,w){const v=()=>{if(w?.aborted)throw t.uninitializeRenderContext(),l.createAbortError();this._renderPlugins.push(t);
t.materialReference&&this._materialRenderers.set(t.materialReference,t);t.produces.forEach((r,n)=>{this._slots[n].push(t)});this._context.requestRender();this._renderVersion.value++},m=t.initializeRenderContext(this._context,w);if(l.isPromiseLike(m))return m.then(v);v()}remove(t){null!=t.materialReference&&this._materialRenderers.delete(t.materialReference);if(null!=this._renderPlugins.removeUnordered(t)){for(let w=0;w<this._slots.length;++w)this._slots[w]=this._slots[w].filter(v=>v!==t);t.uninitializeRenderContext();
this._context.requestRender();this._renderVersion.value++}}prepareRender(){this._renderPlugins.forAll(t=>{t.prepareRender&&t.prepareRender(this._context.renderContext)})}updateAnimation(t){let w=!1;this._renderPlugins.forAll(v=>{v.updateAnimation&&(w=v.updateAnimation(t)||w)});return w}renderFeatureChanged(){this._renderPlugins.forAll(t=>{t.renderFeatureChanged&&t.renderFeatureChanged()})}prepare(...t){for(const w of t)this._context.renderContext.bindParameters.slot=w,this._slots[w].forEach(v=>{v.produces.get(w)?.(k.ShaderOutput.Color)&&
(h.isPrepareRenderPlugin(v)&&v.prepareTechnique(this._context.renderContext),h.isPreparesRenderPlugin(v)&&v.prepareTechniques(this._context.renderContext))})}_getRenderables(){const t=this._context.renderContext.bindParameters.slot,w=this._context.renderContext.output??k.ShaderOutput.Color,v=new Map;this._slots[t].forEach(m=>{if(m.produces.get(t)?.(w)&&(!m.isDecoration||this._context.renderContext.bindParameters.decorations!==f.Decorations.OFF))if(h.isPrepareRenderPlugin(m)){var r=m.prepareTechnique(this._context.renderContext);
null!=r&&v.set(m,r)}else h.isPreparesRenderPlugin(m)?(r=m.prepareTechniques(this._context.renderContext),null!=r&&v.set(m,r)):v.set(m,null)});return v}render(t,...w){for(const v of w)this._context.renderContext.bindParameters.slot=v,this._getRenderables().forEach((m,r)=>r.renderNode(this._context.renderContext,m,t))}queryDepthRange(t){const w=new c.DepthRange;this._renderPlugins.forAll(v=>{v=v.queryDepthRange?.(t);c.union(w,v)});return w}get updating(){return 0<=this._renderVersion.value&&this._renderPlugins.some(t=>
t.running)}produces(t,...w){for(const v of w)if(this._slots[v].some(m=>(m=m.produces.get(v))?m(t):!1))return!0;return!1}consumes(t){return this._renderPlugins.some(w=>w.consumes().required.includes(t))}getMaterialRenderer(t){return this._materialRenderers.get(t)}removeEmptyMaterialRenderers(){this._renderPlugins.filterInPlace(t=>t.materialReference&&0===t.numGeometries?(this._materialRenderers.delete(t.materialReference),t.destroy(),!1):!0)}get hasDecorations(){return this._renderPlugins.some(t=>
t.isDecoration)}get hasOccludees(){return this._renderPlugins.some(t=>t.hasOccludees)}get renderOccludedFlags(){return this._renderPlugins.reduce((t,w)=>t|w.renderOccludedFlags,e.RenderOccludedFlag.None)}get usedMemory(){return this._renderPlugins.reduce((t,w)=>null!==w.materialReference?t:t+(w.usedMemory??0),0)}get test(){}}a.RenderPluginManager=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/blit/Blit":function(){define("exports ../../lib/basicInterfaces ../../../../../chunks/Compositing.glsl ../../shaders/CompositingTechnique ../../shaders/CompositingTechniqueConfiguration ../../../../webgl/enums".split(" "),
function(a,b,q,l,p,k){class h{constructor(f){this.techniques=f;this._blitConfiguration=new p.CompositingTechniqueConfiguration;this._blitParameters=new q.CompositingPassParameters}render(f,c,e,g,d){f.bindFramebuffer(e.fbo);const t=this.techniques.acquire(l.CompositingTechnique,this._blitConfiguration);f.setClearColor(0,0,0,1);f.clear(k.ClearBufferBit.COLOR_BUFFER_BIT);if(!t?.compiled)return d(b.RenderRequestType.UPDATE),e;this._blitParameters.texture=c.getTexture();f.bindTechnique(t,g,this._blitParameters);
f.screen.draw();t.release();return e}}a.Blit=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/AnimationTimeStep":function(){define(["exports","../../../../core/has","../../../../core/mathUtils","../../../../core/time"],function(a,b,q,l){class p{constructor(){this._step=f;this._dilation=1;this._firstIdleTime=l.Milliseconds(0)}frame(e,g){g?0===this._firstIdleTime&&(this._firstIdleTime=l.Milliseconds(performance.now())):this._firstIdleTime=l.Milliseconds(0);
if(b("disable-feature:high-quality-idle"))this._dilation=1;else{g=g?performance.now()-this._firstIdleTime:0;if(g>=k+h){this._step=l.Milliseconds(Infinity);this._dilation=1;return}this._dilation=g>=k?10:1}e=q.clamp(e/.5,f,c);this._step=Infinity===this._step?l.Milliseconds(e):l.Milliseconds(.9*this._step+e*(1-.9))}get value(){return this._step}get timeDilation(){return this._dilation}clear(){this._step=this._firstIdleTime=l.Milliseconds(0)}}const k=l.Milliseconds(12E4),h=l.Milliseconds(1E4),f=l.Milliseconds(1E3),
c=l.Milliseconds(1E3/30);a.AnimationTimeStep=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/OffscreenRendering":function(){define("exports ../../../../core/has ../../../../core/maybe ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../webgl/formats ./rendererUtils ./TransparencyPassType ../../../webgl/enums ../../../webgl/FramebufferObject".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g{constructor(t,w){this._fbos=
t;this.compositingHelper=w;this._height=this._width=4;this._clearColor=p.create()}dispose(){this._color=q.releaseMaybe(this._color);this.releaseBuffers()}get framebuffer(){this.color.attachDepth(this.depth);return this.color.fbo}get colorTexture(){return this.color.getTexture()}get depthTexture(){return this.depth.attachment}initializeFrame(t,w,v){this._fbos.interactive=v===h.RendererTarget.Default;v=this._fbos.rctx;this._width=t.fullWidth;this._height=t.fullHeight;e.ensureAttachmentMaxSize(this,
v.parameters.maxTextureSize);t=this._color;this._color=null;this.releaseBuffers();l.copy(this._clearColor,w);return t}releaseBuffers(){this._color?.detachDepth();this._depth=q.releaseMaybe(this._depth)}renderHUDVisibility(t,w,v){if(t?.fbo?.width!==this._width||t?.fbo?.height!==this._height)t?.release(),t=this._fbos.acquire(this._width,this._height,"hud visibility",k.ColorFormat.RGBA4);t.attachDepth(v||this.depth);this._fbos.rctx.bindFramebuffer(t.fbo);this._fbos.rctx.clearFramebuffer(d);w();t.detachDepth();
return t}compositeToHUDVisibility(t,w){this._fbos.rctx.bindFramebuffer(t.hudVisibility?.fbo);this.compositingHelper.compositeHUD(t,w)}renderOITPass(t,w,v){let m,r;const {_width:n,_height:u}=this;switch(w){case f.TransparencyPassType.ColorAlpha:m=this._fbos.acquire(n,u,v?"oit hud color alpha":"oit color alpha",k.ColorFormat.RGBA16F);m.acquireColor(c.ColorAttachment.COLOR_ATTACHMENT1,k.ColorFormat.R16F);r=[0,0,0,1];break;case f.TransparencyPassType.FrontFace:m=this._fbos.acquire(n,u,v?"oit hud front":
"oit front"),r=[0,0,0,0]}v?m.acquireDepth(k.DepthFormat.DEPTH16_BUFFER):m.attachDepth(this.depth);this._fbos.rctx.bindFramebuffer(m.fbo);this._fbos.rctx.clearFramebuffer(r,v,v);t();m.detachDepth();return m}compositeToFramebuffer(t,w,v,m){this.bindFbo();this.compositingHelper.composite(t,w,v,m)}compositeOIT(t,w,v,m){m?(this._fbos.rctx.bindFramebuffer(m.fbo),this._fbos.rctx.setClearColor(0,0,0,1E-13),this._fbos.rctx.clear(c.ClearBufferBit.COLOR_BUFFER_BIT)):this.bindFbo();this.compositingHelper.compositeOIT(t,
w.getTexture(),w.getTexture(c.ColorAttachment.COLOR_ATTACHMENT1),v.getTexture())}renderDepthDetached(t){this._bindTarget(this.color);t();this._bindTarget(this.color,this.depth)}renderToCachedFBO(t,w,v,m,r=k.ColorFormat.RGBA,n=k.DepthFormat.DEPTH16_BUFFER,u=this._width,x=this._height,y=null){if(t?.fbo?.width!==u||t?.fbo?.height!==x)t=q.releaseMaybe(t);t=t??this._fbos.acquire(u,x,w,r);y?.forEach(z=>t.acquireColor(z.attachment,z.format));null!=n&&t.acquireDepth(n);this._fbos.rctx.bindFramebuffer(t.fbo);
this._fbos.rctx.clearFramebuffer(m,!0,!0);v();return t}renderToTargets(t,w,v,m,r=!1,n=!1){this._bindTarget(w,v);this._fbos.rctx.clearFramebuffer(m,r,n);t();w.detachDepth()}bindFbo(){var t=null==this._color;this._bindTarget(this.color,this.depth);t&&(t=this._fbos.rctx,t.setClearStencil(0),t.setClearColor(this._clearColor[0],this._clearColor[1],this._clearColor[2],this._clearColor[3]),t.clear(c.ClearBufferBit.COLOR_BUFFER_BIT|c.ClearBufferBit.DEPTH_BUFFER_BIT|c.ClearBufferBit.STENCIL_BUFFER_BIT))}_bindTarget(t,
w){t.attachDepth(w);this._fbos.rctx.bindFramebuffer(t.fbo)}get width(){return this._width}get height(){return this._height}get color(){return this._ensureColor()}_ensureColor(){this._color||(this._color=this._fbos.acquire(this._width,this._height,"composite-color"));return this._color}updateColor(t){const w=this._ensureColor();w.attachDepth(this.depth);this._color=t(w)}get depth(){this._depth||(this._depth=this._fbos.acquireDepth(k.DepthFormat.DEPTH_STENCIL_TEXTURE,this._width,this._height,"depth"));
return this._depth}}const d=[0,1,0,1];a.OffscreenRendering=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/RenderPluginInput":function(){define(["exports"],function(a){class b{constructor(){this._inputs=new Map}set(q,l){this._inputs.set(q,l)}get(q){return this._inputs.get(q)}has(q){return this._inputs.has(q)}release(q){this._inputs.get(q)?.release()&&this._inputs.delete(q)}}a.RenderPluginInput=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/lib/ShadowAccumulator":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/arrayUtils ../../../../core/has ../../../../core/mathUtils ../../../../core/maybe ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../core/shaderLibrary/shading/ReadShadowMap.glsl ./BindParameters ./depthRange ./glUtil3D ./ShadowCastRenderer ./ShadowMap ../../../../chunks/ShadowCastAccumulate.glsl ../shaders/ShadowCastAccumulateTechnique ../../../support/Scheduler ../../../webgl/enums ../../../webgl/FramebufferObject ../../../webgl/TextureDescriptor ../../../webgl/Util".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D){a.ShadowAccumulator=class extends q{constructor(H,N,E,G,I,O){super({});this.fbos=H;this._stage=E;this._prepareForShadowMapPass=G;this._renderToShadowMap=I;this._requestRender=O;this._sampleCount=this._progress=0;this._passParameters=new w.ReadShadowMapPassParameters;this._cachedLightDirections=[];this._depthRange=m.zero;this._cameraForcedForScreenshot=this._previewing=!1;this._shadowAccumulatorKey="shadowAccumulator";this._rctx=H.rctx;
this._bindParameters=new v.BindParameters(new u.ShadowMap(H,E.viewingMode),null);this._bindParameters.shadowMap.enabled=!0;this._vao=r.createQuadVAO(this._rctx);this._accumulationRenderer=new n.ShadowCastRenderer(N,this._rctx,this,O);this.addHandles([this._stage.view.resourceController.scheduler.registerTask(z.TaskPriority.SHADOW_ACCUMULATOR,this),f.watch(()=>E.renderView,L=>{this.removeHandles("renderView");null!=L&&this.addHandles(L.events.on("force-camera-for-screenshot",()=>this._cameraForcedForScreenshot=
!0),"renderView")},f.syncAndInitial),f.watch(()=>this._previewing,()=>this._requestRenderIfEnabled(),f.sync)],this._shadowAccumulatorKey)}normalizeCtorArgs(){return{}}dispose(){this._disable();this.removeHandles(this._shadowAccumulatorKey);this._accumulationRenderer=h.disposeMaybe(this._accumulationRenderer);this._bindParameters.shadowMap.dispose();this._fbo=h.disposeMaybe(this._fbo);this._vao=h.disposeMaybe(this._vao);this._accumulationTechniqueCached=h.releaseMaybe(this._accumulationTechniqueCached);
this._sampleCount=this._cachedLightDirections.length=0}get computedSamples(){return this._progress}get shadowCastTexture(){return this._fbo?.colorTexture}get isAccumulating(){return this._isPreviewing||this._isRefining}get _accumulationTechnique(){null==this._accumulationTechniqueCached&&(this._accumulationTechniqueCached=new y.ShadowCastAccumulateTechnique({rctx:this._rctx,viewingMode:this._stage.viewingMode}));return this._accumulationTechniqueCached}get _isRefining(){return this._isActive&&!this._isDoneAccumulating&&
!this._previewing}get _isPreviewing(){return this._isActive&&this._previewing}get _isActive(){return null!=this._fbo&&0<this._sampleCount}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==m.zero&&this._opacityFromElevation>n.shadowCastDisabledElevationThreshold}get _isDoneAccumulating(){return this._progress>=this._sampleCount}get _lightDirections(){return this._cachedLightDirections}set _lightDirections(H){const N=this._cachedLightDirections;if(!l.equals(N,H,d.equals)){var E=
Math.min(x.ShadowCastMaxSamples,H.length);this._sampleCount=N.length=E;for(let G=0;G<E;++G)N[G]=d.copy(N[G]??t.create(),H[G]);this._invalidate()}}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(H){this._accumulationRenderer.opacityFromElevation=H}get running(){return this._isRefining&&this.canAccumulate&&0<this._progress}runTask(H){for(this._prepareForShadowMapPass(this._bindParameters);!H.done&&!this._isDoneAccumulating;)this._accumulateShadow(),
H.madeProgress();this._requestRender()}renderAccumulation(H,N,E,G){this._depthRange=N;this._updateCamera(E);this._bindParameters.contentCamera=G;this._bindParameters.depth=H;this._passParameters.origin=this._bindParameters.camera.center;this.notifyChange("canAccumulate");if(!this.isAccumulating||!this.canAccumulate)return!1;(this._previewing||0===this._progress||this._cameraForcedForScreenshot)&&this._clear();H=this._cameraForcedForScreenshot?this._sampleCount:Math.min(6,this._sampleCount-this._progress);
for(N=0;N<H;++N)this._accumulateShadow();this._cameraForcedForScreenshot=!1;this._requestRender();return 0<H}render(H){this._accumulationRenderer.render(H)}setOptions(H){void 0!==H.enabled&&H.enabled!==(null!=this._fbo)&&(H.enabled?this._enable():this._disable());void 0!==H.previewing&&(this._previewing=H.previewing);void 0!==H.lightDirections&&(this._lightDirections=H.lightDirections);this._accumulationRenderer.setOptions(H)}readAccumulatedShadow(H,N){if(!this._isActive||!this._fbo||1>this._progress||
0>H||H>=this._fbo.width||0>N||N>=this._fbo.height)return 0;this._fbo.readPixels(H,N,1,1,A.PixelFormat.RGBA,A.PixelType.UNSIGNED_BYTE,F);return F[0]/this._progress}_enable(){this._progress=0;const H=new C.TextureDescriptor;H.pixelFormat=A.PixelFormat.RED;H.internalFormat=A.SizedPixelFormat.R8;H.wrapMode=A.TextureWrapMode.CLAMP_TO_EDGE;this._fbo=new B.FramebufferObject(this._rctx,H);this._requestRender()}_disable(){this._fbo=h.disposeMaybe(this._fbo);this._requestRender()}_invalidate(){this._progress=
0;this._requestRenderIfEnabled()}_clear(){this._rctx.bindFramebuffer(this._fbo);this._rctx.setClearColor(0,0,0,0);this._rctx.clear(A.ClearBufferBit.COLOR_BUFFER_BIT);this._progress=0}_accumulateShadow(){this._renderToShadowMap(this._bindParameters,this._lightDirections[this._progress++],this._depthRange);const H=this._accumulationTechnique;this._rctx.bindFramebuffer(this._fbo);this._rctx.bindTechnique(H,this._bindParameters,this._passParameters);this._rctx.bindVAO(this._vao);this._rctx.drawArrays(H.primitiveType,
0,D.vertexCount(this._vao,"geometry"))}_updateCamera(H){const N=this._fbo;if(null!=N){var E=this._bindParameters.camera;H.equals(E)||E.copyFrom(H);N.resize(H.fullWidth,H.fullHeight);this._opacityFromElevation=1-k.smoothstep(n.shadowCastDisableElevationMin,n.shadowCastDisableElevationMax,H.relativeElevation)}}_requestRenderIfEnabled(){this._fbo&&this._requestRender()}get test(){}};b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_progress",void 0);b.__decorate([c.property()],a.ShadowAccumulator.prototype,
"_sampleCount",void 0);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_fbo",void 0);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_depthRange",void 0);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_previewing",void 0);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_accumulationRenderer",void 0);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_isRefining",null);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_isActive",null);b.__decorate([c.property()],
a.ShadowAccumulator.prototype,"canAccumulate",null);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_isDoneAccumulating",null);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"_opacityFromElevation",null);b.__decorate([c.property()],a.ShadowAccumulator.prototype,"running",null);a.ShadowAccumulator=b.__decorate([g.subclass("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],a.ShadowAccumulator);const F=new Uint8Array(4);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/lib/ShadowCastRenderer":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/maybe ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec42 ./glUtil3D ../../../../chunks/ShadowCastVisualize.glsl ../shaders/ShadowCastVisualizeTechnique ../shaders/ShadowCastVisualizeTechniqueConfiguration ../../../webgl/Util".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){const m=1/512;a.ShadowCastRenderer=class extends q{constructor(r,n,u,x){super({});this._techniques=r;this._rctx=n;this._data=u;this._requestRender=x;this._passParameters=new d.ShadowCastVisualizePassParameters(this._data);this._techniqueConfig=new w.ShadowCastVisualizeTechniqueConfiguration;this._enabled=!1;this._vao=g.createQuadVAO(n)}normalizeCtorArgs(){return{}}dispose(){this._stop();this._vao=l.disposeMaybe(this._vao);this._techniques.release(this._technique);
this._technique=null}get _visualizeShadowCastTechnique(){return this._technique=this._techniques.releaseAndAcquire(t.ShadowCastVisualizeTechnique,this._techniqueConfig,this._technique)}render(r){if(this._showVisualization){this._passParameters.sampleScale=1/this._data.computedSamples;var n=this._visualizeShadowCastTechnique;this._rctx.bindVAO(this._vao);this._rctx.bindTechnique(n,r,this._passParameters);this._rctx.drawArrays(n.primitiveType,0,v.vertexCount(this._vao,"geometry"))}}setOptions(r){void 0!==
r.enabled&&this._setEnabled(r.enabled);void 0!==r.color&&this._setColor(r.color);void 0!==r.threshold&&(this._threshold=r.threshold);void 0!==r.visualization&&(this._visualization=r.visualization);void 0!==r.bandSize&&(this._bandSize=r.bandSize);void 0!==r.bandsEnabled&&(this._bandsEnabled=r.bandsEnabled)}get opacityFromElevation(){return this._passParameters.opacityFromElevation}set opacityFromElevation(r){this._passParameters.opacityFromElevation!==r&&(this._passParameters.opacityFromElevation=
r,this.notifyChange("opacityFromElevation"))}get _showVisualization(){return this._enabled&&0<this._data.computedSamples&&this.opacityFromElevation>m}get _threshold(){return this._passParameters.threshold}set _threshold(r){this._threshold!==r&&(this._passParameters.threshold=r,this._requestRenderIfRunning())}get _visualization(){return this._techniqueConfig.visualization}set _visualization(r){r!==this._visualization&&(this._techniqueConfig.visualization=r,this._techniques.release(this._technique),
this._technique=null,this._requestRenderIfRunning())}get _bandSize(){return this._passParameters.bandSize}set _bandSize(r){r!==this._bandSize&&(this._passParameters.bandSize=r,this._requestRenderIfRunning())}get _bandsEnabled(){return this._techniqueConfig.bandsEnabled}set _bandsEnabled(r){r!==this._bandsEnabled&&(this._techniqueConfig.bandsEnabled=r,this._techniques.release(this._technique),this._technique=null,this._requestRenderIfRunning())}_setColor(r){e.exactEquals(r,this._passParameters.color)||
(e.copy(this._passParameters.color,r),this._requestRenderIfRunning())}_setEnabled(r){r!==this._enabled&&(r?this._start():this._stop())}_requestRenderIfRunning(){this._enabled&&this._requestRender()}_start(){this._enabled=!0;this._requestRender()}_stop(){this._enabled=!1;this._requestRender()}};b.__decorate([p.property()],a.ShadowCastRenderer.prototype,"opacityFromElevation",null);a.ShadowCastRenderer=b.__decorate([c.subclass("esri.views.3d.webgl-engine.lib.ShadowCastRenderer")],a.ShadowCastRenderer);
a.shadowCastDisableElevationMax=5E4;a.shadowCastDisableElevationMin=4E4;a.shadowCastDisabledElevationThreshold=m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/ShadowCastVisualize.glsl":function(){define("exports ../core/libs/gl-matrix-2/factories/vec4f64 ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderModules/Float4PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform ./ShadowCastAccumulate.glsl ../views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){function w(n){const u=new e.ShaderBuilder,x=u.fragment;x.include(k.RgbaFloatEncoding);x.include(l.ReadLinearDepth);u.include(p.CameraSpace);u.include(q.ScreenSpacePass);const {visualization:y,bandsEnabled:z}=n;x.constants.add("inverseSampleValue","float",d.ShadowCastMaxSamples);x.uniforms.add(new g.Texture2DPassUniform("shadowCastMap",B=>B.shadowCastMap),new f.FloatPassUniform("sampleScale",B=>B.sampleScale),new f.FloatPassUniform("opacityFromElevation",B=>B.opacityFromElevation),
new h.Float4PassUniform("uColor",B=>B.color));n=y===t.ShadowCastVisualization.Gradient;const A=y===t.ShadowCastVisualization.Threshold;n&&z?x.uniforms.add(new f.FloatPassUniform("bandSize",B=>B.bandSize)):A&&x.uniforms.add(new f.FloatPassUniform("threshold",B=>B.threshold));x.code.add(c.glsl`
void main(void) {
float record = texture(shadowCastMap, uv).r;
float pixelSamples = record * inverseSampleValue;
if (pixelSamples < 1.0) {
discard;
}
float strength = pixelSamples * sampleScale;
${A?c.glsl`
if (strength <= threshold) {
discard;
}`:""}
${n&&z?c.glsl`strength = ceil(strength / bandSize) * bandSize;`:""}
fragColor = vec4(uColor.xyz, uColor.a * opacityFromElevation ${n?c.glsl`* strength`:""});
}
`);return u}class v extends c.NoParameters{constructor(n){super();this._data=n;this.sampleScale=0;this.opacityFromElevation=1;this.color=b.clone(m);this.bandSize=.1;this.threshold=.5}get shadowCastMap(){return this._data.shadowCastTexture}}const m=b.fromValues(.01,0,.25,1),r=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastVisualizePassParameters:v,build:w},Symbol.toStringTag,{value:"Module"}));a.ShadowCastVisualize=r;a.ShadowCastVisualizePassParameters=v;a.build=w})},"esri/chunks/ShadowCastAccumulate.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){function t(m){const r=new g.ShaderBuilder,n=r.fragment;n.include(f.RgbaFloatEncoding);n.include(p.ReadDepth);r.include(h.CameraSpace);r.include(l.ScreenSpacePass);r.include(k.ReadShadowMapPass,m);n.uniforms.add(new d.Texture2DPassUniform("shadowMap",(u,x)=>x.shadowMap.depthTexture),new d.Texture2DPassUniform("depthMap",(u,x)=>x.depth?.attachment),new e.Matrix4PassUniform("inverseViewMatrix",(u,x)=>b.invert(v,b.translate(v,x.camera.viewMatrix,x.camera.center))));n.constants.add("sampleValue",
"float",w);r.outputs.add("sampleCount","float");n.code.add(c.glsl`void main(void) {
float depth = depthFromTexture(depthMap, uv);
if (depth >= 1.0 || depth <= 0.0) {
discard;
}
float currentPixelDepth = linearizeDepth(depth);
vec4 currentPixelPos = vec4(reconstructPosition(gl_FragCoord.xy, currentPixelDepth), 1.0);
vec4 worldSpacePos = inverseViewMatrix * currentPixelPos;
mat4 shadowMatrix;
float linearDepth = -currentPixelDepth;
int i = chooseCascade(linearDepth, shadowMatrix);
if (i >= numCascades) {
discard;
}
vec3 lvpos = lightSpacePosition(worldSpacePos.xyz, shadowMatrix);
if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) {
discard;
}
ivec2 texSize = textureSize(shadowMap, 0);
ivec2 uvShadow = ivec2(cascadeCoordinates(i, texSize, lvpos) * vec2(texSize));
float depthShadow = readShadowMapDepth(uvShadow, shadowMap);
bool shadow = depthShadow < lvpos.z;
if (!shadow) {
discard;
}
sampleCount = sampleValue;
}`);return r}const w=1/255,v=q.create();q=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastMaxSamples:255,build:t},Symbol.toStringTag,{value:"Module"}));a.ShadowCastAccumulate=q;a.ShadowCastMaxSamples=255;a.build=t})},"esri/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderTechnique/ShaderTechniqueConfiguration"],function(a,b,q){a.ShadowCastVisualization=void 0;(function(p){p[p.Gradient=
0]="Gradient";p[p.Threshold=1]="Threshold";p[p.COUNT=2]="COUNT"})(a.ShadowCastVisualization||(a.ShadowCastVisualization={}));class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.visualization=a.ShadowCastVisualization.Gradient;this.bandsEnabled=!1}}b.__decorate([q.parameter({count:a.ShadowCastVisualization.COUNT})],l.prototype,"visualization",void 0);b.__decorate([q.parameter()],l.prototype,"bandsEnabled",void 0);a.ShadowCastVisualizeTechniqueConfiguration=l;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/OrderIndependentTransparency ../lib/Program ../../../../chunks/ShadowCastVisualize.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g extends l.ShaderTechnique{constructor(d,t){super(d,
t,()=>this.destroy())}initializeProgram(d){return new h.Program(d.rctx,g.shader.get().build(this.configuration),p.Default3D)}initializePipeline(){return e.makePipelineState({blending:k.blendingDefault,colorWrite:e.defaultColorWriteParams,depthTest:null,depthWrite:null})}get primitiveType(){return c.PrimitiveType.TRIANGLE_STRIP}}g.shader=new q.ReloadableShaderModule(f.ShadowCastVisualize,()=>new Promise((d,t)=>a(["./ShadowCastVisualize.glsl"],d,t)));b.ShadowCastVisualizeTechnique=g;Object.defineProperty(b,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../../../../chunks/ShadowCastAccumulate.glsl ./ShadowConfiguration ../../../webgl/enums ../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g extends l.ShaderTechnique{constructor(d){super(d,new f.ShadowConfiguration,
()=>this.destroy())}initializeProgram(d){return new k.Program(d.rctx,g.shader.get().build(this.configuration),p.Default3D)}initializePipeline(){return e.makePipelineState({blending:e.separateBlendingParams(c.BlendFactor.ONE,c.BlendFactor.ONE,c.BlendFactor.ONE,c.BlendFactor.ONE),colorWrite:e.defaultColorWriteParams,depthTest:null,depthWrite:null})}get primitiveType(){return c.PrimitiveType.TRIANGLE_STRIP}}g.shader=new q.ReloadableShaderModule(h.ShadowCastAccumulate,()=>new Promise((d,t)=>a(["./ShadowCastAccumulate.glsl"],
d,t)));b.ShadowCastAccumulateTechnique=g;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/SliceHelper":function(){define(["../../../../chunks/boundedPlane"],function(a){const b=a.create();class q{constructor(){this._plane=a.create()}get isEnabled(){return!a.equals(this.plane,b)}get plane(){return this._plane}set plane(l){a.copy(l||b,this._plane)}}return q})},"esri/views/3d/webgl-engine/lib/Viewshed":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Collection ../../../../core/mathUtils ../../../../core/maybe ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../core/shaderLibrary/ShaderOutput ../effects/RenderPlugin ./RenderSlot ./ViewshedShadowMap ../../../../chunks/Viewshed.glsl ../shaders/ViewshedTechnique ../shaders/ViewshedTechniqueConfiguration".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){a.Viewshed=class extends r.SyncRenderPlugin{get viewshedShadowMap(){return this._viewshedShadowMap}get enabled(){return 0<this._viewsheds.length}constructor(C,D){super(C);this._pluginContext=null;this.renderHighQuality=!1;this._parameters=new x.ViewshedPassParameters;this._configuration=new z.ViewshedTechniqueConfiguration;this._viewsheds=new q;this.produces=new Map([[n.RenderSlot.VIEWSHED,()=>!0]]);this._renderShadowMap=D}initialize(){this.addHandles(k.watch(()=>
this.view.qualitySettings.maximumPixelRatio,C=>this._maximumPixelRatio=C,k.syncAndInitial))}destroy(){this.uninitializeRenderContext()}consumes(){return this.enabled?r.ConsumesDepth:r.ConsumesNone}initializeRenderContext(C){this._pluginContext=C;this._viewshedShadowMap=new u.ViewshedShadowMap(this.fboCache);this._viewshedShadowMap.enabled=!0}renderNode(C,D,F){const {bindParameters:H,rctx:N}=C;if(this.enabled&&H.depth&&null!=F){D=this._setupNormals(F);if(null==this._technique||this._configuration.useNormalMap!==
D)this._configuration.useNormalMap=D,this._technique=this._pluginContext?.techniques.acquire(y.ViewshedTechnique,this._configuration);if(this._technique?.compiled)for(const E of this._viewsheds){D=C.rctx.getBoundFramebufferObject();F=this._renderViewshedShadowCubeMap(H,E);const G=this._viewshedShadowMap;F&&null!=G.depthTexture&&!G.isTextureZero&&(this._setPassParameters(E),C.rctx.bindFramebuffer(D),N.bindTechnique(this._technique,H,this._parameters),N.screen.draw())}else this._pluginContext?.requestRender()}}uninitializeRenderContext(){this._pluginContext=
null;this._viewshedShadowMap.dispose();this._technique=p.destroyMaybe(this._technique)}updateViewsheds(C){const D=C.removes;null!=D&&(q.isCollection(D)?this._viewsheds.removeMany(D):this._viewsheds.remove(D));C=C.adds;null!=C&&(q.isCollection(C)?(C=C.filter(F=>!this._viewsheds.includes(F)),this._viewsheds.addMany(C)):this._viewsheds.includes(C)||this._viewsheds.add(C))}_renderViewshedShadowCubeMap(C,D){const F=this._viewshedShadowMap;if(!F.enabled)return!1;if(D=F.start(C.camera,D,this.renderHighQuality,
this._maximumPixelRatio))for(const H of F.faces)this._renderShadowMap(C,H,m.ShaderOutput.ViewshedShadow);F.finish();return D}_setPassParameters(C){const D=this._parameters,F=this._viewshedShadowMap,H=C.observerRenderSpace;D.localOrigin=H;D.fovs=[l.deg2rad(C.horizontalFieldOfView),l.deg2rad(C.verticalFieldOfView)];D.headingAndTilt=[l.deg2rad(C.heading),l.deg2rad(C.tiltParallelToSurface)];D.upVector=C.tiltedUpVector;C=C.targetRenderSpace;var N=v.create();C=w.sub(N,C,H);D.targetVector=C;D.shadowMap=
F;C=[];N=[];for(let O=0;O<F.numActiveFaces;O++){d.translate(A,F.viewshedViewMatrices[O],H);C.push(...A.flat());var E=F.viewshedProjectionMatrices[O],G=A,I=B;const L=v.fromValues(.5,.5,.5);d.fromTranslation(I,L);d.scale(I,I,L);d.mul(I,I,E);d.mul(I,I,G);N.push(...B.flat())}D.viewMatrices=C;D.projectionMatrices=N}_setupNormals(C){C=C.get("normals")?.getTexture();this._parameters.normalTexture=C;return null!=C}get test(){return{viewsheds:this._viewsheds}}};b.__decorate([h.property()],a.Viewshed.prototype,
"_pluginContext",void 0);b.__decorate([h.property()],a.Viewshed.prototype,"fboCache",void 0);b.__decorate([h.property()],a.Viewshed.prototype,"view",void 0);b.__decorate([h.property()],a.Viewshed.prototype,"viewshedShadowMap",null);a.Viewshed=b.__decorate([g.subclass("esri.views.3d.webgl-engine.lib.Viewshed")],a.Viewshed);const A=t.create(),B=t.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ViewshedShadowMap":function(){define("exports ../../../../core/has ../../../../core/mathUtils ../../../../core/maybe ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../webgl/formats ./textureUtils ./ViewshedFaceCamera ../../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){class t{constructor(){this.textureSizeModHighQuality=1.3;this.textureSizeModLowQuality=.9;this.textureSizeMultiple=128;this.toleranceSides=5;this.toleranceBottomTop=10}textureSizeModifier(m){return m?this.textureSizeModHighQuality:this.textureSizeModLowQuality}textureResizeModulo(m){return Math.ceil(m/this.textureSizeMultiple)*this.textureSizeMultiple}}const w="front left right back top bottom".split(" ");class v{constructor(m){this._fbos=m;this._enabled=!1;this._faces=
{};this._textureHeight=this._textureWidth=0;this.settings=new t;this._maxTextureWidth=Math.min(b("esri-mobile")?4096:16384,m.rctx.parameters.maxTextureSize)}get depthTexture(){return this._handle?.getTexture()}get enabled(){return this._enabled}set enabled(m){(this._enabled=m)||this.disposeOffscreenBuffers()}get isTextureZero(){return 0===this._textureWidth||0===this._textureHeight}get nearFar(){const m=this.faces;return 0===m.length?null:m[0].nearFar}get numActiveFaces(){const m=this._faces;let r=
0;Object.keys(m).forEach(n=>{m[n]&&(r+=1)});return r}get faces(){const m=this._faces,r=[];for(const n of w){const u=m[n];u&&r.push(u)}return r}get atlasRegions(){return this.faces.map(m=>[m.x/this._textureWidth,(m.x+m.width)/this._textureWidth,m.y/this._textureHeight,(m.y+m.height)/this._textureHeight])}get viewshedProjectionMatrices(){return this.faces.map(m=>m.projectionMatrix)}get viewshedViewMatrices(){return this.faces.map(m=>m.viewMatrix)}_setupFaceCamera(m,r,n,u){const {observerRenderSpace:x,
tiltedUpVector:y,targetRenderSpace:z,farDistanceRenderSpace:A,horizontalFieldOfView:B,verticalFieldOfView:C}=r,D=f.create();h.sub(D,z,x);const F=f.create(),H=f.create(),N=(K,J)=>{const R=f.create(),Q=k.create();p.fromRotation(Q,K,J);h.transformMat4(R,D,Q);h.add(R,x,R);return R};let E=y;const G=Math.min(90,B),I=Math.min(90,Math.max(0,(B-90)/2));r=-45;let O=45,L=-45,P=45;["top","bottom"].includes(m)||(L=q.clamp(-C/2,-45,45)-this.settings.toleranceBottomTop,P=q.clamp(+C/2,-45,45)+this.settings.toleranceBottomTop);
switch(m){case "front":var M=z;r=-G/2;O=G/2;break;case "left":M=N(Math.PI/2,y);r=45-I;break;case "right":M=N(-Math.PI/2,y);O=-45+I;break;case "top":M=h.add(F,x,y);E=h.negate(H,D);break;case "bottom":M=h.sub(F,x,y);E=D;break;case "back":M=N(Math.PI,y)}M=new g.ViewshedFaceCamera({center:M,eye:x,up:E,far:A});M.sectionAnglesDeg=[r-this.settings.toleranceSides,O+this.settings.toleranceSides,L,P];M.fovY=Math.PI/2;n=M.setViewport(n,u);this._faces[m]=M;return n}_bindFBO(){const m=this._fbos.rctx;m.unbindTexture(this.depthTexture);
m.bindFramebuffer(this._handle?.fbo)}_computeActiveFaces(m){const r=new Set,{horizontalFieldOfView:n,verticalFieldOfView:u}=m;m=-u/2;const x=u/2;if(0===n||0===u)return r;45>=m&&-45<=x&&r.add("front");90<n&&(r.add("left"),r.add("right"));270<n&&r.add("back");x>45-this.settings.toleranceBottomTop&&r.add("top");m<-45+this.settings.toleranceBottomTop&&r.add("bottom");return r}_computeBaseTextureSize(m,r,n,u){r=Math.min(window.devicePixelRatio,r)/m.pixelRatio;n=this.settings.textureSizeModifier(n);m=e.applyTextureResizeModulo(Math.floor(Math.max(m.fullWidth,
m.fullHeight)*r*n));return e.applyTextureResizeFloorModulo(Math.min(Math.floor(this._maxTextureWidth/u),m))}_ensureFBO(){const m=this._textureWidth,r=this._textureHeight;if(this._handle?.fbo?.width!==m||this._handle?.fbo?.height!==r)this._handle?.release(),this._handle=this._fbos.acquire(m,r,"viewshed shadow map",c.ColorFormat.RGBA4);this._handle.acquireDepth(c.DepthFormat.DEPTH16_BUFFER)}clearFBO(){const m=this._fbos.rctx;this._ensureFBO();this._bindFBO();m.setClearColor(1,1,1,1);m.clear(d.ClearBufferBit.COLOR_BUFFER_BIT|
d.ClearBufferBit.DEPTH_BUFFER_BIT)}dispose(){this.enabled=!1;this.disposeOffscreenBuffers()}disposeOffscreenBuffers(){this._handle=l.releaseMaybe(this._handle)}start(m,r,n,u){this._faces={};if(!this.enabled)return!1;const x=this._computeActiveFaces(r),y=x.size;if(0===y)return!1;const z=this._computeBaseTextureSize(m,u,n,y);if(0===z)return!1;let A=0,B=0,C=0;w.filter(D=>x.has(D)).forEach(D=>{if(4>y)var F=0;else F="front"===D||"left"===D,F=4===y?F?0:1:F||"right"===D?0:1;F>B&&(C=Math.max(C,A),A=0);B=
F;A+=this._setupFaceCamera(D,r,[A,F*z],z)});C=Math.max(C,A);this._textureWidth=this.settings.textureResizeModulo(C);this._textureHeight=(4>y?1:2)*z;this.clearFBO();return!0}finish(){this._handle?.detachDepth()}get test(){return{faces:this._faces,faceTypes:w}}}a.ViewshedShadowMap=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ViewshedFaceCamera":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/mathUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../webgl/RenderCamera ./Util".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.ViewshedFaceCamera=class extends d{constructor(){super(...arguments);this.sectionAngles=g.create()}get sectionAnglesDeg(){return g.fromArray(this.sectionAngles.map(w=>q.rad2deg(w)))}set sectionAnglesDeg(w){this.sectionAngles=g.fromArray(w.map(v=>q.deg2rad(v)))}get projectionMatrix(){const w=e.create();return c.mul(w,this.sectionMatrix,this._projectionMatrixInternal)}get sectionMatrix(){var w=this.sectionAngles[0],v=this.sectionAngles[1],m=this.sectionAngles[2],
r=this.sectionAngles[3];t.assert(w<=v);t.assert(m<=r);var n=2*Math.tan(this.fovX/2),u=2*Math.tan(this.fovY/2);w=Math.tan(w);m=Math.tan(m);const x=Math.tan(v)-w,y=Math.tan(r)-m;r=n/x;v=u/y;n=-(w+x/2)/n*2;w=-(m+y/2)/u*2;u=e.create();c.fromTranslation(u,[n,w,0]);n=e.create();c.fromScaling(n,[r,v,1]);r=e.create();return c.mul(r,n,u)}get _sectionRatioX(){return Math.min(1,(Math.tan(this.sectionAngles[1])-Math.tan(this.sectionAngles[0]))/(2*Math.tan(this.fovX/2)))}setViewport(w,v){const m=v*this._sectionRatioX;
this.viewport=[w[0],w[1],m,v];return m}};b.__decorate([l.property()],a.ViewshedFaceCamera.prototype,"sectionAngles",void 0);b.__decorate([l.property()],a.ViewshedFaceCamera.prototype,"sectionAnglesDeg",null);b.__decorate([l.property()],a.ViewshedFaceCamera.prototype,"projectionMatrix",null);b.__decorate([l.property()],a.ViewshedFaceCamera.prototype,"sectionMatrix",null);b.__decorate([l.property()],a.ViewshedFaceCamera.prototype,"_sectionRatioX",null);a.ViewshedFaceCamera=b.__decorate([f.subclass("esri.views.3d.webgl-engine.lib.ViewshedFaceCamera")],
a.ViewshedFaceCamera);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/Viewshed.glsl":function(){define("exports ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/LocalFromScreenSpace.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloat16Encoding.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/TextureAtlasLookup.glsl ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float3PassUniform ../views/3d/webgl-engine/core/shaderModules/FloatsPassUniform ../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/Matrix4sPassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){function u(A){const B=new r.ShaderBuilder,C=B.fragment;B.include(p.ScreenSpacePass);B.include(h.LocalFromScreenSpace);B.include(c.TextureAtlasLookup);C.include(k.ReadDepth);C.include(f.Rgba4FloatEncoding);C.uniforms.add(new n.Texture2DPassUniform("depthTexture",(D,F)=>F.depth?.attachment));C.uniforms.add(new v.Matrix4PassUniform("inverseProjectionMatrix",(D,F)=>F.camera.inverseProjectionMatrix),new v.Matrix4PassUniform("inverseViewNormalMatrix",(D,F)=>
b.invertOrIdentity(y,F.camera.viewInverseTransposeMatrix)));C.uniforms.add(new g.Float3PassUniform("viewshedTargetVector",(D,F)=>D.targetVector),new g.Float3PassUniform("viewshedUpVector",(D,F)=>D.upVector),new e.Float2PassUniform("viewshedFOVs",(D,F)=>D.fovs),new e.Float2PassUniform("viewshedHeadingAndTilt",(D,F)=>D.headingAndTilt),new e.Float2PassUniform("viewshedNearFar",(D,F)=>D.shadowMap.nearFar??[1,100]));C.uniforms.add(new n.Texture2DPassUniform("viewshedShadowMap",D=>D.shadowMap.depthTexture),
new m.Matrix4sPassUniform("viewshedProjectionMatrices",(D,F)=>D.projectionMatrices,6),new m.Matrix4sPassUniform("viewshedViewMatrices",(D,F)=>D.viewMatrices,6),new t.IntegerPassUniform("viewshedNumFaces",(D,F)=>D.shadowMap.numActiveFaces),new d.FloatsPassUniform("viewshedAtlasRegions",(D,F)=>D.shadowMap.atlasRegions.flat(),24));C.constants.add("visibleColor","vec4",[0,1,0,.5]);C.constants.add("occludedColor","vec4",[1,0,0,.5]);(A=A.useNormalMap)?(C.uniforms.add(new n.Texture2DPassUniform("normalMap",
(D,F)=>D.normalTexture)),C.code.add(w.glsl`vec3 normalFromTexture() {
vec4 norm4 = texture(normalMap, uv);
vec3 nNormal = vec3(-1.0) + 2.0 * norm4.xyz;
return normalize((inverseViewNormalMatrix * vec4(nNormal, 1.0)).xyz);
}`)):B.include(l.NormalFromDepth);C.code.add(w.glsl`
// UV coordinates of point projected onto viewshed shadow map
vec2 getViewshedUv(vec4 worldPosition, int face) {
mat4 viewshedMatrix = viewshedProjectionMatrices[face];
vec4 viewshedUv4 = viewshedMatrix * worldPosition;
vec3 viewshedUv = viewshedUv4.xyz / viewshedUv4.w;
return viewshedUv.xy;
}
float viewshedDepthToFloat(float depth) {
return (depth - viewshedNearFar[0]) / (viewshedNearFar[1] - viewshedNearFar[0]);
}
// Orthographic depth to viewshed of given point and given cube map face in range [0, 1].
float getOrthographicDepthToViewshed(vec4 worldPosition, int face) {
mat4 viewshedViewMatrix = viewshedViewMatrices[face];
vec4 viewshedUv4 = viewshedViewMatrix * worldPosition;
vec3 viewshedUv = viewshedUv4.xyz / viewshedUv4.w;
float depth = -viewshedUv.z;
return viewshedDepthToFloat(depth);
}
// Read depth from shadow map given uv and cube map face
float getDepthFromShadowMap(vec2 uv, int face) {
int index = 4 * face;
float umin = viewshedAtlasRegions[index];
float umax = viewshedAtlasRegions[index + 1];
float vmin = viewshedAtlasRegions[index + 2];
float vmax = viewshedAtlasRegions[index + 3];
vec4 atlasRegion = vec4(umin, vmin, umax, vmax);
return rgba4ToFloat(textureAtlasLookup(viewshedShadowMap, uv, atlasRegion));
}
struct ViewshedPoint {
int face;
vec2 uv;
bool isWithin;
float orthographicDepth;
};
// Find cube map face the given position lies in and return relevant information about it
bool getViewshedPoint(vec4 worldPosition, out ViewshedPoint point) {
vec3 nUp = normalize(viewshedUpVector);
// Try with all active cube map faces
for(int i=0; i < viewshedNumFaces; i++) {
// Check if when projected, point lies within shadow map texture
vec2 viewshedUv = getViewshedUv(worldPosition, i);
if (viewshedUv.x > 0.0 && viewshedUv.x < 1.0 && viewshedUv.y > 0.0 && viewshedUv.y < 1.0) {
float orthoDepth = getOrthographicDepthToViewshed(worldPosition, i);
if (orthoDepth >= 0.0) { // found a cube map face
// Check whether point is really inside viewshed geometry, not just within the camera frustum
// outside farDistance
vec3 position = worldPosition.xyz;
bool isWithin = length(position) <= viewshedNearFar[1];
// horizontally outside fov
float t = dot(nUp, position);
bool isBottomHalf = t > 0.0;
vec3 nProjVector = normalize(position - t * nUp);
if (isWithin) {
float angle = acos(dot(normalize(viewshedTargetVector), nProjVector));
if (angle > viewshedFOVs[0] / 2.0) {
isWithin = false;
}
}
// vertically outside fov
if (isWithin) {
float angle = acos(dot(nProjVector, normalize(position)));
if (!isBottomHalf) {
angle = -angle;
}
float tilt = viewshedHeadingAndTilt[1];
float limit = viewshedFOVs[1] / 2.0;
if (angle > limit || angle < -limit) {
isWithin = false;
}
}
point = ViewshedPoint(i, viewshedUv, isWithin, orthoDepth);
return true;
}
}
}
// no cube face matches
return false;
}
float normalCosAngle(float linearDepth, vec3 localPosition) {
${A?w.glsl`vec3 normal = normalFromTexture();`:w.glsl`
vec3 cameraSpacePosition = reconstructPosition(gl_FragCoord.xy, linearDepth);
vec3 normal = normalFromDepth(depthTexture, cameraSpacePosition, gl_FragCoord.xy, uv);
normal = (inverseViewNormalMatrix * vec4(normal, 1.0)).xyz;
`};
vec3 viewingDir = normalize(localPosition);
return dot(normal, viewingDir);
}
void main() {
float depth = depthFromTexture(depthTexture, uv);
// Outside camera planes
if (depth >= 1.0 || depth <= 0.0) {
return;
}
float linearDepth = linearizeDepth(depth);
// Relative to viewshed position
vec4 localPosition = reconstructLocalPosition(gl_FragCoord.xy, linearDepth);
ViewshedPoint point;
bool foundFace = getViewshedPoint(localPosition, point);
// Outside every viewshed
if (!foundFace || !point.isWithin) {
return;
}
float viewshedDepth = getDepthFromShadowMap(point.uv, point.face);
float distance = point.orthographicDepth;
bool visible = distance < viewshedDepth;
fragColor = visible ? visibleColor : occludedColor;
float cosAngle = normalCosAngle(linearDepth, localPosition.xyz);
// Everything facing away, and close to parallel is considered occluded.
// Theshold corresponds to around 0.6 degrees, tuned empirically.
if (cosAngle > -0.01) {
fragColor = occludedColor;
}
}`);return B}class x extends h.LocalFromScreenSpacePassParameters{constructor(){super(...arguments);this.targetVector=[1,0,0];this.upVector=[0,0,1];this.fovs=[45,45];this.headingAndTilt=[0,0];this.shadowMap={depthTexture:null,nearFar:[1,100],numActiveFaces:1,atlasRegions:[[0,0,1,1]]};this.projectionMatrices=q.IDENTITY.flat();this.viewMatrices=q.IDENTITY.flat()}}const y=q.create(),z=Object.freeze(Object.defineProperty({__proto__:null,ViewshedPassParameters:x,build:u},Symbol.toStringTag,{value:"Module"}));
a.Viewshed=z;a.ViewshedPassParameters=x;a.build=u})},"esri/views/3d/webgl-engine/core/shaderLibrary/util/LocalFromScreenSpace.glsl":function(){define("exports ../../../../../../core/libs/gl-matrix-2/math/mat4 ../../../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../../../core/libs/gl-matrix-2/factories/vec3f64 ./CameraSpace.glsl ../../shaderModules/interfaces ../../shaderModules/Matrix4PassUniform".split(" "),function(a,b,q,l,p,k,h){class f extends k.NoParameters{constructor(){super(...arguments);
this.localOrigin=l.zeros()}}a.LocalFromScreenSpace=function(c){c.include(p.CameraSpace);c.fragment.uniforms.add(new h.Matrix4PassUniform("inverseViewMatrix",(e,g)=>{const d=q.create();b.translate(d,g.camera.viewMatrix,e.localOrigin);return b.invertOrIdentity(d,d)}));c.fragment.code.add(k.glsl`vec4 reconstructLocalPosition(vec2 coord, float linearDepth) {
vec4 cameraSpace = vec4(reconstructPosition(coord, linearDepth), 1.0);
return inverseViewMatrix * cameraSpace;
}`)};a.LocalFromScreenSpacePassParameters=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ViewshedTechnique":function(){define("require exports ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/OrderIndependentTransparency ../lib/Program ../../../../chunks/Viewshed.glsl ../../../webgl/renderState".split(" "),function(a,b,q,l,p,k,h,f,c){class e extends l.ShaderTechnique{initializeProgram(g){return new h.Program(g.rctx,
e.shader.get().build(this.configuration),p.Default3D)}initializePipeline(){return c.makePipelineState({colorWrite:c.defaultColorWriteParams,blending:k.blendingDefault})}}e.shader=new q.ReloadableShaderModule(f.Viewshed,()=>new Promise((g,d)=>a(["./Viewshed.glsl"],g,d)));b.ViewshedTechnique=e;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/ViewshedTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderTechnique/ShaderTechniqueConfiguration"],
function(a,b,q){class l extends q.ShaderTechniqueConfiguration{constructor(){super(...arguments);this.useNormalMap=!0}}b.__decorate([q.parameter()],l.prototype,"useNormalMap",void 0);a.ViewshedTechniqueConfiguration=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/statistics/RendererPerformanceInfo":function(){define("exports ../../../../core/maybe ../../../../core/PerformanceSampler ../../../../core/time ../../webgl ../../../webgl/TimerPool".split(" "),
function(a,b,q,l,p,k){a.PerformanceCategory=void 0;(function(c){c.OVERLAY="overlay";c.PREPARE="prepare";c.SHADOW_MAP="shadow map";c.DEPTH="depth";c.ACCUMULATED_SHADOWS="accumulated shadows";c.OBJECT_AND_LAYER_ID_COLOR="object/layer id color";c.NORMALS="normals";c.SSAO="SSAO";c.OPAQUE_EDGES="opaque edges";c.VOXEL="voxel";c.TRANSPARENT="transparent";c.TRANSPARENT_EDGES="transparent edges";c.HUD_VISIBILITY="HUD visibility";c.TRANSPARENT_TERRAIN="transparent terrain";c.OPAQUE_ENVIRONMENT="opaque environment";
c.TRANSPARENT_ENVIRONMENT="transparent environment";c.LASER_LINES="laser lines";c.VIEWSHED="viewshed";c.OCCLUDED="occluded";c.HUD="HUD";c.HUD_OCCLUDED="HUD occluded";c.FINISH="finish"})(a.PerformanceCategory||(a.PerformanceCategory={}));const h=Object.values(p.RenderCategory).concat(Object.values(p.InternalRenderCategory)).concat(Object.values(a.PerformanceCategory));class f{constructor(c){this._rctx=c;this._startTimeStampCPU=l.Milliseconds(0);this._lastTimeStampCPU=l.Milliseconds(0);this._totalCPUTime=
new q("Total");this._cpuTimeSamplers=new Map(h.map(e=>[e,new q(e)]));this._enableGPUTimer=0;this._totalGPUTime=new q("GPU");this._gpuTimeSamplers=new Map(h.map(e=>[e,new q(e)]));this._totalTime=l.Milliseconds(0);this._totalFrameCount=0}get totalCPUTimeSampler(){return this._totalCPUTime}get cpuTimeSamplers(){return Array.from(this._cpuTimeSamplers.values())}get totalGPUTimeSampler(){return this._totalGPUTime}get gpuTimeSamplers(){return Array.from(this._gpuTimeSamplers.values())}get gpuSamplingEnabled(){return null!=
this._gpuTimerPool}get totalTime(){return this._totalTime}get totalFrameCount(){return this._totalFrameCount}get elapsedTime(){return l.Milliseconds(performance.now()-this._startTimeStampCPU)}enableGPUPerformanceInfo(){if(null==this._gpuTimerPool){const e=[...h,"Total"];this._gpuTimerPool=k.createElapsedTimerPool(this._rctx,e)}if(null==this._gpuTimerPool)return{hasGPUTimerSupport:!1,remove:()=>{}};++this._enableGPUTimer;let c=!1;return{hasGPUTimerSupport:!0,remove:()=>{c||(c=!0,--this._enableGPUTimer,
0===this._enableGPUTimer&&(this._gpuTimerPool=b.disposeMaybe(this._gpuTimerPool)))}}}startFrame(){this._startTimeStampCPU=this._lastTimeStampCPU=l.Milliseconds(performance.now());this._gpuTimerPool&&this._gpuTimerPool.start()}advance(c){var e=l.Milliseconds(performance.now());this._cpuTimeSamplers.get(c).record(e-this._lastTimeStampCPU);this._lastTimeStampCPU=e;this._gpuTimerPool&&(e=this._gpuTimerPool.stop(c),this._gpuTimeSamplers.get(c).record(e),this._gpuTimerPool.start())}finishFrame(){if(this._gpuTimerPool){var c=
this._gpuTimerPool.stop(a.PerformanceCategory.FINISH);this._gpuTimeSamplers.get(a.PerformanceCategory.FINISH).record(c);this._rctx.gl.flush()}c=l.Milliseconds(performance.now()-this._startTimeStampCPU);this._totalTime=l.Milliseconds(this._totalTime+c);this._totalCPUTime.record(c);this._gpuTimerPool&&this._totalGPUTime.record(this.gpuTimeSamplers.reduce((e,g)=>e+(g.last||0),0));++this._totalFrameCount}}a.PerformanceCategories=h;a.RendererPerformanceInfo=f;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/webgl/TimerPool":function(){define(["exports","./capabilities/DisjointTimerQuery"],function(a,b){class q{constructor(l,p){this._timer=l;this._queryPool=[];this._queryResults=new Map;this._currentQuery=null;p.forEach(k=>{const h=this._timer.createQuery(),f=this._timer.createQuery();this._queryPool.push(h,f);this._queryResults.set(k,null)})}start(){b.hasRunningElapsedTimer||(this._currentQuery=this._queryPool.pop(),null!=this._currentQuery&&(this._timer.disjoint(),this._timer.beginTimeElapsed(this._currentQuery)))}stop(l){if(this._timer.disjoint()||
null==this._currentQuery||!this._queryResults.has(l))return this.abort(),null;this._timer.endTimeElapsed();const p=this._queryResults.get(l);if(null==p)return this._queryResults.set(l,this._currentQuery),this._currentQuery=null;if(!this._timer.resultAvailable(p))return this._queryPool.unshift(this._currentQuery),this._currentQuery=null;const k=this._timer.getResult(p)/1E6;this._queryPool.unshift(p);this._queryResults.set(l,this._currentQuery);this._currentQuery=null;return k}abort(){null!=this._currentQuery&&
(this._timer.deleteQuery(this._currentQuery),this._queryPool.unshift(this._timer.createQuery()),this._currentQuery=null)}dispose(){null!=this._currentQuery&&this._timer.deleteQuery(this._currentQuery);this._queryPool.forEach(l=>{this._timer.deleteQuery(l)});this._queryResults.forEach(l=>{null!=l&&this._timer.deleteQuery(l)})}}a.createElapsedTimerPool=function(l,p){l=l.capabilities.disjointTimerQuery;return null==l?null:new q(l,p)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/capabilities/DisjointTimerQuery":function(){define(["exports"],
function(a){class b{constructor(q,l,p,k,h,f,c,e,g){this.createQuery=q;this.deleteQuery=l;this.resultAvailable=p;this.getResult=k;this.disjoint=h;this.beginTimeElapsed=f;this.endTimeElapsed=c;this.createTimestamp=e;this.timestampBits=g}}a.hasRunningElapsedTimer=!1;a.DisjointTimerQuery=b;a.createDisjointTimerQuery=function(q,l){if(l.disjointTimerQuery)return null;let p=q.getExtension("EXT_disjoint_timer_query_webgl2");return p?new b(()=>q.createQuery(),k=>{q.deleteQuery(k);a.hasRunningElapsedTimer=
!1},k=>q.getQueryParameter(k,q.QUERY_RESULT_AVAILABLE),k=>q.getQueryParameter(k,q.QUERY_RESULT),()=>q.getParameter(p.GPU_DISJOINT_EXT),k=>{a.hasRunningElapsedTimer||(a.hasRunningElapsedTimer=!0,q.beginQuery(p.TIME_ELAPSED_EXT,k))},()=>{q.endQuery(p.TIME_ELAPSED_EXT);a.hasRunningElapsedTimer=!1},k=>p.queryCounterEXT(k,p.TIMESTAMP_EXT),()=>q.getQuery(p.TIMESTAMP_EXT,p.QUERY_COUNTER_BITS_EXT)):(p=q.getExtension("EXT_disjoint_timer_query"))?new b(()=>p.createQueryEXT(),k=>{p.deleteQueryEXT(k);a.hasRunningElapsedTimer=
!1},k=>p.getQueryObjectEXT(k,p.QUERY_RESULT_AVAILABLE_EXT),k=>p.getQueryObjectEXT(k,p.QUERY_RESULT_EXT),()=>q.getParameter(p.GPU_DISJOINT_EXT),k=>{a.hasRunningElapsedTimer||(a.hasRunningElapsedTimer=!0,p.beginQueryEXT(p.TIME_ELAPSED_EXT,k))},()=>{p.endQueryEXT(p.TIME_ELAPSED_EXT);a.hasRunningElapsedTimer=!1},k=>p.queryCounterEXT(k,p.TIMESTAMP_EXT),()=>p.getQueryEXT(p.TIMESTAMP_EXT,p.QUERY_COUNTER_BITS_EXT)):null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/RenderingContext":function(){define(["exports",
"../../../../core/has","../effects/ScreenSpaceGeometry","../../../webgl/AppleAmdDriverHelper","../../../webgl/RenderingContext"],function(a,b,q,l,p){class k extends p.RenderingContext{constructor(h,f,c){super(h,f);this.gl=h;this.newCache=c;this._appleAmdDriverHelper=null;this._refCount=1;this.screen=new q.ScreenSpaceGeometry(this)}destroy(){0<--this._refCount||this.dispose()}ref(){++this._refCount}dispose(){super.dispose();this._appleAmdDriverHelper?.dispose();this.screen.destroy()}bindTechnique(h,
f,c,e,g){this.useProgram(h.program);this.setPipelineState(h.getPipeline(!!g));h.program.bindPass(c,f);e&&h.program.bindDraw(e,f,c);return h.program}runAppleAmdDriverHelper(){this.driverTest.drawArraysRequiresIndicesTypeReset.result&&(this._appleAmdDriverHelper??(this._appleAmdDriverHelper=new l.AppleAmdDriverHelper(this)),this._appleAmdDriverHelper.run())}get test(){}}a.RenderingContext=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/effects/ScreenSpaceGeometry":function(){define("exports ../../../../core/has ../../../../core/maybe ../lib/DefaultVertexAttributeLocations ../lib/DefaultVertexBufferLayouts ../lib/VertexArrayObject ../../../webgl/BufferObject ../../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f){function c(g,d=p.Pos2,t=l.Default3D){const w=new Float32Array([-1,-1,3,-1,-1,3]);return new k.VertexArrayObject(g,t,{geometry:d},{geometry:h.BufferObject.createVertex(g,f.Usage.STATIC_DRAW,w)})}class e{constructor(g){this._rctx=g;this._vao=c(g)}destroy(){this._vao=q.disposeMaybe(this._vao)}draw(){null!=this._vao&&(this._rctx.bindVAO(this._vao),this._rctx.drawArrays(f.PrimitiveType.TRIANGLES,0,3))}get test(){}}a.ScreenSpaceGeometry=e;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/webgl/AppleAmdDriverHelper":function(){define(["exports","../../core/has","./BufferObject","./enums"],function(a,b,q,l){class p{constructor(k){this._rctx=k;this._indexBuffer=this._createIndexbuffer();this._program=this._createHelperProgram()}static getShaderSources(){return{vertex:"#version 300 es\n precision highp float;\n\n void main(void) {\n gl_Position \x3d vec4(0.0, 0.0, float(gl_VertexID)-2.0, 1.0);\n }",fragment:"#version 300 es\n precision highp float;\n\n out vec4 fragColor;\n\n void main(void) {\n fragColor \x3d vec4(0.0, 0.0, 0.0, 1.0);\n }"}}_createHelperProgram(){const k=
p.getShaderSources();return this._rctx.programCache.acquire(k.vertex,k.fragment,new Map([]))}_createIndexbuffer(){return q.BufferObject.createIndex(this._rctx,l.Usage.STATIC_DRAW,new Uint32Array([0]))}run(){this._program.compiled&&this._indexBuffer&&(this._rctx.bindVAO(null),this._rctx.useProgram(this._program),this._rctx.bindBuffer(this._indexBuffer,l.BufferType.ELEMENT_ARRAY_BUFFER),this._rctx.drawElements(l.PrimitiveType.POINTS,1,l.DataType.UNSIGNED_INT,0))}dispose(){this._program.dispose();this._indexBuffer.dispose()}get test(){}}
a.AppleAmdDriverHelper=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/RenderingContext":function(){define("exports ../../core/maybe ../../core/promiseUtils ../../core/time ./checkWebGLError ./ContextState ./enums ./InstanceCounter ./Parameters ./ProgramCache ./renderState ./Texture ./Util ./WebGLDriverTest ./capabilities/Capabilities".split(" "),function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(n,u,x,y){u?y!==u&&n.bindBuffer(x,u.glName):n.bindBuffer(x,null);return u}
function r(n,u){switch(n){case h.PrimitiveType.POINTS:return 2*u;case h.PrimitiveType.TRIANGLES:return u/3;case h.PrimitiveType.TRIANGLE_STRIP:return u-2;case h.PrimitiveType.TRIANGLE_FAN:return u-2;default:return 0}}a.RenderingContext=class{constructor(n,u){this.gl=n;this.instanceCounter=new f.InstanceCounter;this.programCache=new e.ProgramCache(this);this._transformFeedbackRequestInfo=null;this._state=new k.ContextState;this._numOfTriangles=this._numOfDrawCalls=0;this._loadExtensions();this.configure(u)}configure(n){this._capabilities=
new v.Capabilities(this.gl,n);this._parameters=new c.Parameters(this.gl,this._capabilities,n);d.Texture.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;n=this.gl.getParameter(this.gl.VIEWPORT);this._state=new k.ContextState;this._state.viewport={x:n[0],y:n[1],width:n[2],height:n[3]};this._stateTracker=new g.StateTracker({setBlending:u=>{u?(this.setBlendingEnabled(!0),this.setBlendEquationSeparate(u.opRgb,u.opAlpha),this.setBlendFunctionSeparate(u.srcRgb,u.dstRgb,u.srcAlpha,u.dstAlpha),
u=u.color,this.setBlendColor(u.r,u.g,u.b,u.a)):this.setBlendingEnabled(!1)},setCulling:u=>{u?(this.setFaceCullingEnabled(!0),this.setCullFace(u.face),this.setFrontFace(u.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:u=>{u?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(u.factor,u.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:u=>{u?(this.setDepthTestEnabled(!0),this.setDepthFunction(u.func)):this.setDepthTestEnabled(!1)},setStencilTest:u=>{if(u){this.setStencilTestEnabled(!0);
const x=u.function;this.setStencilFunction(x.func,x.ref,x.mask);u=u.operation;this.setStencilOp(u.fail,u.zFail,u.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:u=>{u?(this.setDepthWriteEnabled(!0),this.setDepthRange(u.zNear,u.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:u=>{u?this.setColorMask(u.r,u.g,u.b,u.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:u=>{u?this.setStencilWriteMask(u.mask):this.setStencilWriteMask(0)},setDrawBuffers:u=>{u?this.setDrawBuffers(u.buffers):({drawFramebuffer:u}=
this._state,null===u?this.setDrawBuffers([h.SpecialDrawBuffers.BACK]):0===u.colorAttachments.length?this.setDrawBuffers([h.SpecialDrawBuffers.NONE]):this.setDrawBuffers([h.ColorAttachment.COLOR_ATTACHMENT0]))}});this.enforceState();b.disposeMaybe(this._driverTest);this._driverTest=new w.WebGLDriverTest(this)}dispose(){b.disposeMaybe(this._driverTest);this.programCache.dispose();this.bindVAO(null);this.unbindBuffer(h.BufferType.ARRAY_BUFFER);this.unbindBuffer(h.BufferType.ELEMENT_ARRAY_BUFFER);this.unbindBuffer(h.BufferType.UNIFORM_BUFFER);
this._state.uniformBufferBindingPoints.length=0;this.unbindBuffer(h.BufferType.PIXEL_PACK_BUFFER);this.unbindBuffer(h.BufferType.PIXEL_UNPACK_BUFFER);this.unbindBuffer(h.BufferType.COPY_READ_BUFFER);this.unbindBuffer(h.BufferType.COPY_WRITE_BUFFER);this._state.textureUnitMap.length=0;p.webglDebugEnabled()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}setPipelineState(n){this._stateTracker.setPipeline(n)}setBlendingEnabled(n){this._state.blend!==
n&&(!0===n?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=n,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop();this._state.program=null}externalTextureUnitUpdate(n,u){for(let x=0;x<n.length;++x)this._state.textureUnitMap[n[x]]=null;0<=u&&(this._state.activeTexture=u)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null);this._state.vertexArrayObject=null;this._state.vertexBuffer=null;this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=
null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(n,u,x,y){if(n!==this._state.blendColor.r||u!==this._state.blendColor.g||x!==this._state.blendColor.b||y!==this._state.blendColor.a)this.gl.blendColor(n,u,x,y),this._state.blendColor.r=n,this._state.blendColor.g=u,this._state.blendColor.b=x,this._state.blendColor.a=y,this._stateTracker.invalidateBlending()}setBlendFunction(n,u){if(n!==this._state.blendFunction.srcRGB||u!==this._state.blendFunction.dstRGB)this.gl.blendFunc(n,
u),this._state.blendFunction.srcRGB=n,this._state.blendFunction.srcAlpha=n,this._state.blendFunction.dstRGB=u,this._state.blendFunction.dstAlpha=u,this._stateTracker.invalidateBlending()}setBlendFunctionSeparate(n,u,x,y){if(this._state.blendFunction.srcRGB!==n||this._state.blendFunction.srcAlpha!==x||this._state.blendFunction.dstRGB!==u||this._state.blendFunction.dstAlpha!==y)this.gl.blendFuncSeparate(n,u,x,y),this._state.blendFunction.srcRGB=n,this._state.blendFunction.srcAlpha=x,this._state.blendFunction.dstRGB=
u,this._state.blendFunction.dstAlpha=y,this._stateTracker.invalidateBlending()}setBlendEquation(n){this._state.blendEquation.mode!==n&&(this.gl.blendEquation(n),this._state.blendEquation.mode=n,this._state.blendEquation.modeAlpha=n,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(n,u){if(this._state.blendEquation.mode!==n||this._state.blendEquation.modeAlpha!==u)this.gl.blendEquationSeparate(n,u),this._state.blendEquation.mode=n,this._state.blendEquation.modeAlpha=u,this._stateTracker.invalidateBlending()}setColorMask(n,
u,x,y){if(this._state.colorMask.r!==n||this._state.colorMask.g!==u||this._state.colorMask.b!==x||this._state.colorMask.a!==y)this.gl.colorMask(n,u,x,y),this._state.colorMask.r=n,this._state.colorMask.g=u,this._state.colorMask.b=x,this._state.colorMask.a=y,this._stateTracker.invalidateColorWrite()}setClearColor(n,u,x,y){if(this._state.clearColor.r!==n||this._state.clearColor.g!==u||this._state.clearColor.b!==x||this._state.clearColor.a!==y)this.gl.clearColor(n,u,x,y),this._state.clearColor.r=n,this._state.clearColor.g=
u,this._state.clearColor.b=x,this._state.clearColor.a=y}setFaceCullingEnabled(n){this._state.faceCulling!==n&&(!0===n?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=n,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(n){this._state.polygonOffsetFill!==n&&(!0===n?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=n,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(n,
u){if(this._state.polygonOffset[0]!==n||this._state.polygonOffset[1]!==u)this._state.polygonOffset[0]=n,this._state.polygonOffset[1]=u,this.gl.polygonOffset(n,u),this._stateTracker.invalidatePolygonOffset()}setCullFace(n){this._state.cullFace!==n&&(this.gl.cullFace(n),this._state.cullFace=n,this._stateTracker.invalidateCulling())}setFrontFace(n){this._state.frontFace!==n&&(this.gl.frontFace(n),this._state.frontFace=n,this._stateTracker.invalidateCulling())}setScissorTestEnabled(n){this._state.scissorTest!==
n&&(!0===n?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=n)}setScissorRect(n,u,x,y){if(this._state.scissorRect.x!==n||this._state.scissorRect.y!==u||this._state.scissorRect.width!==x||this._state.scissorRect.height!==y)this.gl.scissor(n,u,x,y),this._state.scissorRect.x=n,this._state.scissorRect.y=u,this._state.scissorRect.width=x,this._state.scissorRect.height=y}setDepthTestEnabled(n){this._state.depthTest!==n&&(!0===n?this.gl.enable(this.gl.DEPTH_TEST):
this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=n,this._stateTracker.invalidateDepthTest())}setClearDepth(n){this._state.clearDepth!==n&&(this.gl.clearDepth(n),this._state.clearDepth=n)}setDepthFunction(n){this._state.depthFunction!==n&&(this.gl.depthFunc(n),this._state.depthFunction=n,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(n){this._state.depthWrite!==n&&(this.gl.depthMask(n),this._state.depthWrite=n,this._stateTracker.invalidateDepthWrite())}setDepthRange(n,u){if(this._state.depthRange.zNear!==
n||this._state.depthRange.zFar!==u)this.gl.depthRange(n,u),this._state.depthRange.zNear=n,this._state.depthRange.zFar=u,this._stateTracker.invalidateDepthWrite()}setStencilTestEnabled(n){this._state.stencilTest!==n&&(!0===n?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=n,this._stateTracker.invalidateStencilTest())}setClearStencil(n){n!==this._state.clearStencil&&(this.gl.clearStencil(n),this._state.clearStencil=n)}setStencilFunction(n,u,x){if(this._state.stencilFunction.func!==
n||this._state.stencilFunction.ref!==u||this._state.stencilFunction.mask!==x)this.gl.stencilFunc(n,u,x),this._state.stencilFunction.face=h.Face.FRONT_AND_BACK,this._state.stencilFunction.func=n,this._state.stencilFunction.ref=u,this._state.stencilFunction.mask=x,this._stateTracker.invalidateStencilTest()}setStencilFunctionSeparate(n,u,x,y){if(this._state.stencilFunction.face!==n||this._state.stencilFunction.func!==u||this._state.stencilFunction.ref!==x||this._state.stencilFunction.mask!==y)this.gl.stencilFuncSeparate(n,
u,x,y),this._state.stencilFunction.face=n,this._state.stencilFunction.func=u,this._state.stencilFunction.ref=x,this._state.stencilFunction.mask=y,this._stateTracker.invalidateStencilTest()}setStencilWriteMask(n){this._state.stencilWriteMask!==n&&(this.gl.stencilMask(n),this._state.stencilWriteMask=n,this._stateTracker.invalidateStencilWrite())}setStencilOp(n,u,x){if(this._state.stencilOperation.face!==h.Face.FRONT_AND_BACK||this._state.stencilOperation.fail!==n||this._state.stencilOperation.zFail!==
u||this._state.stencilOperation.zPass!==x)this.gl.stencilOp(n,u,x),this._state.stencilOperation.face=h.Face.FRONT_AND_BACK,this._state.stencilOperation.fail=n,this._state.stencilOperation.zFail=u,this._state.stencilOperation.zPass=x,this._stateTracker.invalidateStencilTest()}setStencilOpSeparate(n,u,x,y){if(this._state.stencilOperation.face!==n||this._state.stencilOperation.fail!==u||this._state.stencilOperation.zFail!==x||this._state.stencilOperation.zPass!==y)this.gl.stencilOpSeparate(n,u,x,y),
this._state.stencilOperation.face=n,this._state.stencilOperation.fail=u,this._state.stencilOperation.zFail=x,this._state.stencilOperation.zPass=y,this._stateTracker.invalidateStencilTest()}setActiveTexture(n,u=!1){const x=this._state.activeTexture;0<=n&&(u||n!==this._state.activeTexture)&&(this.gl.activeTexture(h.baseTextureUnit+n),this._state.activeTexture=n);return x}setDrawBuffers(n){const {drawFramebuffer:u}=this._state,x=null===u,y=x?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(u);
if(y?.length!==n.length||!y.every((z,A)=>z===n[A]))if(n.length>this.parameters.maxDrawBuffers)console.error("Setting more active draw buffers than GL.MAX_DRAW_BUFFERS allows.");else{if(x){if(1<n.length){console.error("The default framebuffer can only have one active draw buffer.");return}if(n[0]!==h.SpecialDrawBuffers.BACK&&n[0]!==h.SpecialDrawBuffers.NONE){console.error("The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers.");return}}!x&&n.includes(h.SpecialDrawBuffers.BACK)?
console.error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTi or GL.NONE as draw buffers."):(this.gl.drawBuffers(n),x?this._state.drawBuffers.defaultFramebuffer=n:this._state.drawBuffers.fbos.set(u,n),this._stateTracker.invalidateDrawBuffers())}}clear(n,u=255){if(n){if(n&h.ClearBufferBit.COLOR_BUFFER_BIT){const x=this._state.drawFramebuffer?.colorAttachments;x&&this.setDrawBuffers(x);this.setColorMask(!0,!0,!0,!0)}n&h.ClearBufferBit.DEPTH_BUFFER_BIT&&this.setDepthWriteEnabled(!0);
n&h.ClearBufferBit.STENCIL_BUFFER_BIT&&this.setStencilWriteMask(u);this.gl.clear(n)}}clearFramebuffer(n,u=!1,x=!1){let y=0;n&&(this.setClearColor(n[0],n[1],n[2],Math.max(1E-13,n[3])),y|=h.ClearBufferBit.COLOR_BUFFER_BIT);u&&(y|=h.ClearBufferBit.DEPTH_BUFFER_BIT);!1===x?x=0:(!0===x&&(x=255),y|=h.ClearBufferBit.STENCIL_BUFFER_BIT);y&&this.clear(y,x)}drawArrays(n,u,x){if(this._transformFeedbackRequestInfo){if(n!==this._transformFeedbackRequestInfo.primitiveType)throw Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");
if(null==this._state.program?.hasTransformFeedbackVaryings)throw Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying");}if(p.webglDebugEnabled()){this._numOfDrawCalls++;this._numOfTriangles+=r(n,x);const y=this._state.textureUnitMap;for(let z=0;z<y.length;z++){const A=y[z];if(null!=A&&A===this._state.drawFramebuffer?.colorTexture)throw Error(`Detected readWrite. Texture already bound at index ${z}`);}}this.gl.drawArrays(n,u,x);
p.checkWebGLError(this.gl)}drawArraysInstanced(n,u,x,y){this.gl.drawArraysInstanced(n,u,x,y);p.checkWebGLError(this.gl)}drawElements(n,u,x,y){if(this._transformFeedbackRequestInfo)throw Error("Cannot called drawElements during a transform feedback request");p.webglDebugEnabled()&&(this._numOfDrawCalls++,this._numOfTriangles+=r(n,u));this.gl.drawElements(n,u,x,y);if(p.webglDebugEnabled()){const z=t.getErrorString(this);if(z){const A=this.getBoundVAO(),B=A?.indexBuffer,C=B?.size??0,D=y+u;console.error(`drawElements: ${z}${C<
D?`. Buffer is too small. Attempted to draw index ${D} of ${C}`:""}`,{args:{mode:n,count:u,type:x,offset:y},vao:{indexBuffer:B,vertexBuffers:A?.vertexBuffers}})}}}logInfo(){p.webglDebugEnabled()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}resetInfo(){p.webglDebugEnabled()&&(this._numOfTriangles=this._numOfDrawCalls=0)}get capabilities(){return this._capabilities}setViewport(n,u,x,y){x=Math.max(Math.round(x),1);y=Math.max(Math.round(y),1);const z=this._state.viewport;
if(z.x!==n||z.y!==u||z.width!==x||z.height!==y)z.x=n,z.y=u,z.width=x,z.height=y,this.gl.viewport(n,u,x,y)}setViewport4fv(n){this.setViewport(n[0],n[1],n[2],n[3])}restoreViewport({x:n,y:u,width:x,height:y}){this.setViewport(n,u,x,y)}getViewport(){const n=this._state.viewport;return{x:n.x,y:n.y,width:n.width,height:n.height}}useProgram(n){this._state.program!==n&&(this._state.program?.stop(),this._state.program=n,this.gl.useProgram(n?.glName??null))}bindTexture(n,u,x=!1){(u>=this.parameters.maxTextureImageUnits||
0>u)&&console.error("Input texture unit is out of range of available units!");const y=this._state.textureUnitMap[u];if(null==n?.glName)return null!=y&&(this.setActiveTexture(u,x),this.gl.bindTexture(y.descriptor.target,null)),this._state.textureUnitMap[u]=null,y;if(!x&&y===n)return n.isDirty&&(this.setActiveTexture(u,x),n.applyChanges()),y;this.setActiveTexture(u,x);this.gl.bindTexture(n.descriptor.target,n.glName);n.applyChanges();this._state.textureUnitMap[u]=n;return y}unbindTexture(n){if(null!=
n)for(let u=0;u<this.parameters.maxTextureImageUnits;u++)this._state.textureUnitMap[u]===n&&(this.bindTexture(null,u),this._state.textureUnitMap[u]=null)}bindFramebuffer(n,u=!1){if(u||this._state.readFramebuffer!==n||this._state.drawFramebuffer!==n)this._stateTracker.invalidateDrawBuffers(),null==n?(this.gl.bindFramebuffer(h.FramebufferTarget.FRAMEBUFFER,null),this._state.readFramebuffer=this._state.drawFramebuffer=null):(n.initializeAndBind(h.FramebufferTarget.FRAMEBUFFER),this._state.readFramebuffer=
n,this._state.drawFramebuffer=n)}bindFramebufferSeparate(n,u,x=!1){const y=u===h.FramebufferTarget.READ_FRAMEBUFFER,z=y?this._state.readFramebuffer:this._state.drawFramebuffer;if(x||z!==n)null==n?this.gl.bindFramebuffer(u,null):n.initializeAndBind(u),y?this._state.readFramebuffer=n??null:(this._stateTracker.invalidateDrawBuffers(),this._state.drawFramebuffer=n??null)}blitFramebuffer(n,u,x=0,y=0,z=n.width,A=n.height,B=0,C=0,D=u.width,F=u.height,H=h.ClearBufferBit.COLOR_BUFFER_BIT,N=h.TextureSamplingMode.NEAREST){this.bindFramebufferSeparate(n,
h.FramebufferTarget.READ_FRAMEBUFFER);this.bindFramebufferSeparate(u,h.FramebufferTarget.DRAW_FRAMEBUFFER);this.gl.blitFramebuffer(x,y,z,A,B,C,D,F,H,N)}bindBuffer(n,u){if(n)switch(u??=n.bufferType,u){case h.BufferType.ARRAY_BUFFER:this._state.vertexBuffer=m(this.gl,n,u,this._state.vertexBuffer);break;case h.BufferType.ELEMENT_ARRAY_BUFFER:this._state.indexBuffer=m(this.gl,n,u,this._state.indexBuffer);break;case h.BufferType.UNIFORM_BUFFER:this._state.uniformBuffer=m(this.gl,n,u,this._state.uniformBuffer);
break;case h.BufferType.PIXEL_PACK_BUFFER:this._state.pixelPackBuffer=m(this.gl,n,u,this._state.pixelPackBuffer);break;case h.BufferType.PIXEL_UNPACK_BUFFER:this._state.pixelUnpackBuffer=m(this.gl,n,u,this._state.pixelUnpackBuffer);break;case h.BufferType.COPY_READ_BUFFER:this._state.copyReadBuffer=m(this.gl,n,u,this._state.copyReadBuffer);break;case h.BufferType.COPY_WRITE_BUFFER:this._state.copyWriteBuffer=m(this.gl,n,u,this._state.copyWriteBuffer);break;case h.BufferType.TRANSFORM_FEEDBACK_BUFFER:this._state.transformFeedbackBuffer=
m(this.gl,n,u,this._state.transformFeedbackBuffer)}}bindRenderbuffer(n){const u=this.gl;n||(u.bindRenderbuffer(u.RENDERBUFFER,null),this._state.renderbuffer=null);this._state.renderbuffer!==n&&(u.bindRenderbuffer(u.RENDERBUFFER,n.glName),this._state.renderbuffer=n)}_getBufferBinding(n,u){if(u>=this.parameters.maxUniformBufferBindings||0>u)return console.error("Uniform buffer binding point is out of range!"),null;n=n===h.BufferType.UNIFORM_BUFFER?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;
let x=n[u];null==x&&(x={buffer:null,offset:0,size:0},n[u]=x);return x}bindBufferBase(n,u,x){const y=this._getBufferBinding(n,u);null==y||y.buffer===x&&0===y.offset&&0===y.size||(this.gl.bindBufferBase(n,u,x?x.glName:null),y.buffer=x,y.offset=0,y.size=0)}bindBufferRange(n,u,x,y,z){const A=this._getBufferBinding(n,u);null==A||A.buffer===x&&A.offset===y&&A.size===z||(0!==y%this._parameters.uniformBufferOffsetAlignment?console.error("Uniform buffer binding offset is not a multiple of the context offset alignment"):
(this.gl.bindBufferRange(n,u,x.glName,y,z),A.buffer=x,A.offset=y,A.size=z))}bindUBO(n,u,x,y){null==u?this.bindBufferBase(h.BufferType.UNIFORM_BUFFER,n,null):(p.webglDebugEnabled()&&(y??u.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),u.initialize(),void 0!==x&&void 0!==y?this.bindBufferRange(h.BufferType.UNIFORM_BUFFER,n,u.buffer,x,y):this.bindBufferBase(h.BufferType.UNIFORM_BUFFER,n,u.buffer))}unbindUBO(n){for(let u=
0,x=this._state.uniformBufferBindingPoints.length;u<x;u++){const y=this._state.uniformBufferBindingPoints[u];null!=y&&y.buffer===n.buffer&&this.bindBufferBase(h.BufferType.UNIFORM_BUFFER,u,null)}}unbindBuffer(n){switch(n){case h.BufferType.ARRAY_BUFFER:this._state.vertexBuffer=m(this.gl,null,n,this._state.vertexBuffer);break;case h.BufferType.ELEMENT_ARRAY_BUFFER:this._state.indexBuffer=m(this.gl,null,n,this._state.indexBuffer);break;case h.BufferType.UNIFORM_BUFFER:this._state.uniformBuffer=m(this.gl,
null,n,this._state.uniformBuffer);break;case h.BufferType.PIXEL_PACK_BUFFER:this._state.pixelPackBuffer=m(this.gl,null,n,this._state.pixelPackBuffer);break;case h.BufferType.PIXEL_UNPACK_BUFFER:this._state.pixelUnpackBuffer=m(this.gl,null,n,this._state.pixelUnpackBuffer);break;case h.BufferType.COPY_READ_BUFFER:this._state.copyReadBuffer=m(this.gl,null,n,this._state.copyReadBuffer);break;case h.BufferType.COPY_WRITE_BUFFER:this._state.copyWriteBuffer=m(this.gl,null,n,this._state.copyWriteBuffer)}}bindVAO(n=
null){null==n?this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null):this._state.vertexArrayObject!==n&&(n.bind(),this._state.vertexArrayObject=n)}bindTransformFeedback(n){const {gl:u}=this;u.bindTransformFeedback(u.TRANSFORM_FEEDBACK,n.glName)}beginTransformFeedback(n,u){if(this._transformFeedbackRequestInfo)throw Error("Already in a transform feedback request");const {gl:x}=this;x.bindTransformFeedback(x.TRANSFORM_FEEDBACK,n.glName);x.beginTransformFeedback(u);
this._transformFeedbackRequestInfo={primitiveType:u}}endTransformFeedback(){if(!this._transformFeedbackRequestInfo)throw Error("Not in a transform feedback request");const {gl:n}=this;n.endTransformFeedback();n.bindTransformFeedback(n.TRANSFORM_FEEDBACK,null);this._transformFeedbackRequestInfo=null}async clientWaitAsync(n=l.Milliseconds(10)){const {gl:u}=this,x=u.fenceSync(h.SyncCondition.SYNC_GPU_COMMANDS_COMPLETE,0);if(!x)throw Error("Client wait failed, could not create sync object");this.instanceCounter.increment(h.ResourceType.Sync,
x);u.flush();let y;do await q.after(n),y=u.clientWaitSync(x,0,0);while(y===h.ClientWaitSyncStatus.TIMEOUT_EXPIRED);this.instanceCounter.decrement(h.ResourceType.Sync,x);u.deleteSync(x);if(y===h.ClientWaitSyncStatus.WAIT_FAILED)throw Error("Client wait failed");}getBoundFramebufferObject(n=h.FramebufferTarget.FRAMEBUFFER){return n===h.FramebufferTarget.READ_FRAMEBUFFER?this._state.readFramebuffer:this._state.drawFramebuffer}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null);
this.bindVAO(null);this.bindFramebuffer(null,!0);this.unbindBuffer(h.BufferType.ARRAY_BUFFER);this.unbindBuffer(h.BufferType.ELEMENT_ARRAY_BUFFER);this.unbindBuffer(h.BufferType.UNIFORM_BUFFER);this._state.uniformBufferBindingPoints.length=0;this.unbindBuffer(h.BufferType.PIXEL_PACK_BUFFER);this.unbindBuffer(h.BufferType.PIXEL_UNPACK_BUFFER);this.unbindBuffer(h.BufferType.COPY_READ_BUFFER);this.unbindBuffer(h.BufferType.COPY_WRITE_BUFFER);for(let n=0;n<this.parameters.maxTextureImageUnits;++n)this.bindTexture(null,
n);this.setBlendingEnabled(!1);this.setBlendFunction(h.BlendFactor.ONE,h.BlendFactor.ZERO);this.setBlendEquation(h.BlendOperation.ADD);this.setBlendColor(0,0,0,0);this.setFaceCullingEnabled(!1);this.setCullFace(h.Face.BACK);this.setFrontFace(h.CullMode.CCW);this.setPolygonOffsetFillEnabled(!1);this.setPolygonOffset(0,0);this.setScissorTestEnabled(!1);this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height);this.setDepthTestEnabled(!1);this.setDepthFunction(h.CompareFunction.LESS);this.setDepthRange(0,
1);this.setStencilTestEnabled(!1);this.setStencilFunction(h.CompareFunction.ALWAYS,0,0);this.setStencilOp(h.StencilOperation.KEEP,h.StencilOperation.KEEP,h.StencilOperation.KEEP);this.setClearColor(0,0,0,0);this.setClearDepth(1);this.setClearStencil(0);this.setColorMask(!0,!0,!0,!0);this.setStencilWriteMask(4294967295);this.setDepthWriteEnabled(!0);this.setDrawBuffers([h.SpecialDrawBuffers.BACK]);this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){const {gl:n}=this;n.bindVertexArray(null);
for(var u=0;u<this.parameters.maxVertexAttributes;u++)n.disableVertexAttribArray(u);this._state.vertexBuffer?n.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):n.bindBuffer(h.BufferType.ARRAY_BUFFER,null);this._state.indexBuffer?n.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):n.bindBuffer(h.BufferType.ELEMENT_ARRAY_BUFFER,null);this._state.uniformBuffer?n.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):
n.bindBuffer(h.BufferType.UNIFORM_BUFFER,null);for(u=0;u<this._parameters.maxUniformBufferBindings;u++){var x=this._state.uniformBufferBindingPoints[u];if(null!=x){const {buffer:y,offset:z,size:A}=x;null!==y?0===z&&0===A?n.bindBufferBase(h.BufferType.UNIFORM_BUFFER,u,y.glName):n.bindBufferRange(h.BufferType.UNIFORM_BUFFER,u,y.glName,z,A):n.bindBufferBase(h.BufferType.UNIFORM_BUFFER,u,null)}}this._state.pixelPackBuffer?n.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):
n.bindBuffer(h.BufferType.PIXEL_PACK_BUFFER,null);this._state.pixelUnpackBuffer?n.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):n.bindBuffer(h.BufferType.PIXEL_UNPACK_BUFFER,null);this._state.copyReadBuffer?n.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):n.bindBuffer(h.BufferType.COPY_READ_BUFFER,null);this._state.copyWriteBuffer?n.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):
n.bindBuffer(h.BufferType.COPY_WRITE_BUFFER,null);n.bindFramebuffer(h.FramebufferTarget.READ_FRAMEBUFFER,null);n.readBuffer(n.BACK);this._state.readFramebuffer&&(n.bindFramebuffer(h.FramebufferTarget.READ_FRAMEBUFFER,this._state.readFramebuffer.glName),n.readBuffer(h.ColorAttachment.COLOR_ATTACHMENT0));n.bindFramebuffer(h.FramebufferTarget.DRAW_FRAMEBUFFER,this._state.drawFramebuffer?.glName??null);null===this._state.drawFramebuffer?n.drawBuffers(this._state.drawBuffers.defaultFramebuffer??[h.SpecialDrawBuffers.BACK]):
(u=this._state.drawBuffers.fbos.get(this._state.drawFramebuffer),n.drawBuffers(u??[h.ColorAttachment.COLOR_ATTACHMENT0]));if(this._state.vertexArrayObject){if(u=this._state.vertexArrayObject)this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null;this.bindVAO(u)}n.useProgram(this._state.program?.glName??null);n.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a);n.bindRenderbuffer(n.RENDERBUFFER,this._state.renderbuffer?.glName??
null);!0===this._state.blend?n.enable(this.gl.BLEND):n.disable(this.gl.BLEND);n.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha);n.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha);n.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a);n.clearDepth(this._state.clearDepth);n.clearStencil(this._state.clearStencil);
n.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a);n.cullFace(this._state.cullFace);n.depthFunc(this._state.depthFunction);n.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar);!0===this._state.depthTest?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST);n.depthMask(this._state.depthWrite);n.frontFace(this._state.frontFace);n.lineWidth(1);!0===this._state.faceCulling?n.enable(n.CULL_FACE):n.disable(n.CULL_FACE);n.polygonOffset(this._state.polygonOffset[0],
this._state.polygonOffset[1]);!0===this._state.polygonOffsetFill?n.enable(n.POLYGON_OFFSET_FILL):n.disable(n.POLYGON_OFFSET_FILL);n.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height);!0===this._state.scissorTest?n.enable(n.SCISSOR_TEST):n.disable(n.SCISSOR_TEST);n.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask);n.stencilOpSeparate(this._state.stencilOperation.face,
this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass);!0===this._state.stencilTest?n.enable(n.STENCIL_TEST):n.disable(n.STENCIL_TEST);n.stencilMask(this._state.stencilWriteMask);for(u=0;u<this.parameters.maxTextureImageUnits;u++)n.activeTexture(h.baseTextureUnit+u),n.bindTexture(h.TextureType.TEXTURE_2D,null),n.bindTexture(h.TextureType.TEXTURE_CUBE_MAP,null),n.bindTexture(h.TextureType.TEXTURE_3D,null),n.bindTexture(h.TextureType.TEXTURE_2D_ARRAY,
null),x=this._state.textureUnitMap[u],null!=x&&n.bindTexture(x.descriptor.target,x.glName);n.activeTexture(h.baseTextureUnit+this._state.activeTexture);u=this._state.viewport;n.viewport(u.x,u.y,u.width,u.height);this.resetInfo()}_loadExtensions(){this.gl.getExtension("KHR_parallel_shader_compile")}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/ContextState":function(){define(["exports","./enums"],function(a,b){class q{constructor(){this.blend=!1;this.blendColor=
{r:0,g:0,b:0,a:0};this.blendFunction={srcRGB:b.BlendFactor.ONE,dstRGB:b.BlendFactor.ZERO,srcAlpha:b.BlendFactor.ONE,dstAlpha:b.BlendFactor.ZERO};this.blendEquation={mode:b.BlendOperation.ADD,modeAlpha:b.BlendOperation.ADD};this.colorMask={r:!0,g:!0,b:!0,a:!0};this.faceCulling=!1;this.cullFace=b.Face.BACK;this.frontFace=b.CullMode.CCW;this.scissorTest=!1;this.scissorRect={x:0,y:0,width:0,height:0};this.depthTest=!1;this.depthFunction=b.CompareFunction.LESS;this.clearDepth=1;this.depthWrite=!0;this.depthRange=
{zNear:0,zFar:1};this.viewport=null;this.polygonOffsetFill=this.stencilTest=!1;this.polygonOffset=[0,0];this.stencilFunction={face:b.Face.FRONT_AND_BACK,func:b.CompareFunction.ALWAYS,ref:0,mask:1};this.clearStencil=0;this.stencilWriteMask=1;this.stencilOperation={face:b.Face.FRONT_AND_BACK,fail:b.StencilOperation.KEEP,zFail:b.StencilOperation.KEEP,zPass:b.StencilOperation.KEEP};this.clearColor={r:0,g:0,b:0,a:0};this.transformFeedbackBuffer=this.copyWriteBuffer=this.copyReadBuffer=this.pixelUnpackBuffer=
this.pixelPackBuffer=this.uniformBuffer=this.indexBuffer=this.vertexBuffer=this.program=null;this.uniformBufferBindingPoints=[];this.transformBufferBindingPoints=[];this.drawFramebuffer=this.readFramebuffer=null;this.drawBuffers={defaultFramebuffer:[b.SpecialDrawBuffers.BACK],fbos:new WeakMap};this.renderbuffer=null;this.activeTexture=0;this.textureUnitMap=[];this.vertexArrayObject=null}}a.ContextState=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/InstanceCounter":function(){define(["exports",
"./AllocationTracer","./enums"],function(a,b,q){const l={RECORD_ALLOCATIONS:!1};class p{constructor(){this._current=[];for(this._allocations=l.RECORD_ALLOCATIONS?new b.AllocationTracer("WebGLObject"):null;this._current.length<q.ResourceType.COUNT;)this._current.push(0)}increment(k,h,f=1){this._current[k]+=f;this._allocations?.add(h)}decrement(k,h,f=1){this._current[k]-=f;this._allocations?.remove(h)}get current(){return this._current}get total(){return this.current.reduce((k,h,f)=>k+(f<q.ResourceType.UNCOUNTED?
h:0),0)}get resourceInformation(){let k="";if(0<this.total){k+="Live objects:\n";for(let h=0;h<q.ResourceType.COUNT;++h){const f=this._current[h];0<f&&(k+=`${q.ResourceType[h]}: ${f}\n`)}}return k+=this._allocations?.resetLog()}}a.InstanceCounter=p;a.test=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/AllocationTracer":function(){define(["exports"],function(a){class b{constructor(q){this._objectType=q;this._active=new Map}add(q){const l=Error().stack.split("\n");
l.shift();l.shift();this._active.set(q,l.join("\n"))}remove(q){this._active.delete(q)}resetLog(){const q=new Map;this._active.forEach((k,{usedMemory:h})=>{q.has(k)||q.set(k,new Map);k=q.get(k);k.set(h??0,k.get(h??0)??1)});this._active.clear();let l=0;const p=[];q.forEach((k,h)=>{let f=0;k.forEach((c,e)=>f+=c*e);k.set(-1,f);l+=f;p.push([h,k])});q.clear();p.sort((k,h)=>h[1].get(-1)-k[1].get(-1));return p.reduce((k,[h,f])=>{const c=Math.round(f.get(-1)/1024);f.delete(-1);f=Array.from(f.values()).reduce((e,
g)=>e+g,0);return k+=` ${c}KB from ${f} allocations at ${h}\n`},`Total unestimated ${this._objectType} memory: ${Math.round(l/1024)}KB\n`)}}a.AllocationTracer=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Parameters":function(){define(["exports"],function(a){class b{constructor(q,l,p){l=l.textureFilterAnisotropic;p=p.maxAnisotropy??Infinity;this.versionString=q.getParameter(q.VERSION);this.maxVertexTextureImageUnits=q.getParameter(q.MAX_VERTEX_TEXTURE_IMAGE_UNITS);
this.maxVertexAttributes=q.getParameter(q.MAX_VERTEX_ATTRIBS);this.maxMaxAnisotropy=l?Math.min(q.getParameter(l.MAX_TEXTURE_MAX_ANISOTROPY),p):1;this.maxTextureImageUnits=q.getParameter(q.MAX_TEXTURE_IMAGE_UNITS);this.maxTextureSize=q.getParameter(q.MAX_TEXTURE_SIZE);this.maxRenderbufferSize=q.getParameter(q.MAX_RENDERBUFFER_SIZE);this.maxViewportDims=q.getParameter(q.MAX_VIEWPORT_DIMS);this.maxUniformBufferBindings=q.getParameter(q.MAX_UNIFORM_BUFFER_BINDINGS);this.maxVertexUniformBlocks=q.getParameter(q.MAX_VERTEX_UNIFORM_BLOCKS);
this.maxFragmentUniformBlocks=q.getParameter(q.MAX_FRAGMENT_UNIFORM_BLOCKS);this.maxUniformBlockSize=q.getParameter(q.MAX_UNIFORM_BLOCK_SIZE);this.uniformBufferOffsetAlignment=q.getParameter(q.UNIFORM_BUFFER_OFFSET_ALIGNMENT);this.maxArrayTextureLayers=q.getParameter(q.MAX_ARRAY_TEXTURE_LAYERS);this.maxSamples=q.getParameter(q.MAX_SAMPLES);this.maxDrawBuffers=q.getParameter(q.MAX_DRAW_BUFFERS)}}a.Parameters=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/ProgramCache":function(){define(["exports",
"../../core/has","../../core/NestedMap","./Program"],function(a,b,q,l){class p{constructor(k){this._rctx=k;this._store=new q.NestedMap}dispose(){this._store.forEach(k=>k.forEach(h=>h.dispose()));this._store.clear()}acquire(k,h,f,c){const e=this._store.get(k,h);if(null!=e)return e.ref(),e;f=new l.Program(this._rctx,k,h,f,c);f.ref();this._store.set(k,h,f);return f}get test(){}}a.ProgramCache=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Program":function(){define(["exports",
"../../core/has","./checkWebGLError","./enums","./ShaderTranspiler"],function(a,b,q,l,p){function k(g,d,t){g=g.gl;const w=g.createShader(d);g.shaderSource(w,t);g.compileShader(w);q.webglValidateShadersEnabled()&&!g.getShaderParameter(w,g.COMPILE_STATUS)&&(console.error("Compile error in ".concat(d===l.ShaderType.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(g.getShaderInfoLog(w)),console.error(h(t)));return w}function h(g){let d=2;return g.replaceAll("\n",()=>{var t=d++;t=1E3<=t?t.toString():
(" "+t).slice(-3);return"\n"+t+":"})}function f(g,d,t){const w=g.get(d);if(!w)return g.set(d,Array.from(t)),!0;const v=t.length;if(w.length!==v)return g.set(d,Array.from(t)),!0;for(g=0;g<v;++g)if(d=t[g],w[g]!==d){for(w[g]=d;g<v;++g)w[g]=t[g];return!0}return!1}class c{constructor(g,d,t,w,v=new Map,m=[]){this._context=g;this._locations=w;this._uniformBlockBindings=v;this._transformFeedbackVaryings=m;this._refCount=1;this._compiled=!1;this._linesOfCode=0;this._nameToUniformLocation=new Map;this._nameToUniform1=
new Map;this._nameToUniform1v=new Map;this._nameToUniform2=new Map;this._nameToUniform3=new Map;this._nameToUniform4=new Map;this._nameToUniformMatrix3=new Map;this._nameToUniformMatrix4=new Map;g||console.error("RenderingContext isn't initialized!");0===d.length&&console.error("Shaders source should not be empty!");d=p.transpileShader(d,l.ShaderType.VERTEX_SHADER);t=p.transpileShader(t,l.ShaderType.FRAGMENT_SHADER);this._vShader=k(this._context,l.ShaderType.VERTEX_SHADER,d);this._fShader=k(this._context,
l.ShaderType.FRAGMENT_SHADER,t);e.enabled&&(this._linesOfCode=d.match(/\n/g).length+t.match(/\n/g).length+2,this._context.instanceCounter.increment(l.ResourceType.LinesOfCode,this._vShader,this._linesOfCode));this._vShader&&this._fShader||console.error("Error loading shaders!");this._context.instanceCounter.increment(l.ResourceType.Shader,this);q.webglValidateShadersEnabled()&&(this.vertexShader=d,this.fragmentShader=t);this.usedMemory=d.length+t.length;const r=this._context.gl,n=r.createProgram();
r.attachShader(n,this._vShader);r.attachShader(n,this._fShader);this._locations.forEach((u,x)=>r.bindAttribLocation(n,u,x));this._transformFeedbackVaryings?.length&&r.transformFeedbackVaryings(n,this._transformFeedbackVaryings,r.SEPARATE_ATTRIBS);r.linkProgram(n);q.webglValidateShadersEnabled()&&!r.getProgramParameter(n,r.LINK_STATUS)&&console.error("Could not link shader\n"+`validated: ${r.getProgramParameter(n,r.VALIDATE_STATUS)}`+`, gl error ${r.getError()}`+`, vertex: ${r.getShaderParameter(this._vShader,
r.COMPILE_STATUS)}`+`, fragment: ${r.getShaderParameter(this._fShader,r.COMPILE_STATUS)}`+`, info log: ${r.getProgramInfoLog(n)}`+`, vertex source: ${this.vertexShader}`+`, fragment source: ${this.fragmentShader}`);for(const [u,x]of this._uniformBlockBindings)g=r.getUniformBlockIndex(n,u),4294967295>g&&r.uniformBlockBinding(n,g,x);this._glName=n;this._context.instanceCounter.increment(l.ResourceType.Program,this)}get glName(){return this._glName}get hasGLName(){return null!=this._glName}get hasTransformFeedbackVaryings(){return!!this._transformFeedbackVaryings?.length}get compiled(){if(this._compiled)return!0;
const g=this._context.gl.getExtension("KHR_parallel_shader_compile");return null==g||null==this.glName?this._compiled=!0:this._compiled=!!this._context.gl.getProgramParameter(this.glName,g.COMPLETION_STATUS_KHR)}dispose(){if(!(0<--this._refCount)){var g=this._context.gl,d=this._context.instanceCounter;this._nameToUniformLocation.forEach(t=>t&&d.decrement(l.ResourceType.Uniform,t));this._nameToUniformLocation.clear();this._vShader&&(0<this._linesOfCode&&(d.decrement(l.ResourceType.LinesOfCode,this._vShader,
this._linesOfCode),this._linesOfCode=0),g.deleteShader(this._vShader),this._vShader=null,d.decrement(l.ResourceType.Shader,this));this._fShader&&(g.deleteShader(this._fShader),this._fShader=null);this._glName&&(g.deleteProgram(this._glName),this._glName=null,d.decrement(l.ResourceType.Program,this))}}ref(){++this._refCount}_getUniformLocation(g){var d=this._nameToUniformLocation.get(g);return void 0!==d?d:this.glName?(d=this._context.gl.getUniformLocation(this.glName,g),this._nameToUniformLocation.set(g,
d),d&&this._context.instanceCounter.increment(l.ResourceType.Uniform,d),d):null}hasUniform(g){return null!=this._getUniformLocation(g)}setUniform1i(g,d){const t=this._nameToUniform1.get(g);if(void 0===t||d!==t)this._context.gl.uniform1i(this._getUniformLocation(g),d),this._nameToUniform1.set(g,d)}setUniform1iv(g,d){f(this._nameToUniform1v,g,d)&&this._context.gl.uniform1iv(this._getUniformLocation(g),d)}setUniform2iv(g,d){f(this._nameToUniform2,g,d)&&this._context.gl.uniform2iv(this._getUniformLocation(g),
d)}setUniform3iv(g,d){f(this._nameToUniform3,g,d)&&this._context.gl.uniform3iv(this._getUniformLocation(g),d)}setUniform4iv(g,d){f(this._nameToUniform4,g,d)&&this._context.gl.uniform4iv(this._getUniformLocation(g),d)}setUniform1f(g,d){const t=this._nameToUniform1.get(g);if(void 0===t||d!==t)this._context.gl.uniform1f(this._getUniformLocation(g),d),this._nameToUniform1.set(g,d)}setUniform1fv(g,d){f(this._nameToUniform1v,g,d)&&this._context.gl.uniform1fv(this._getUniformLocation(g),d)}setUniform2f(g,
d,t){const w=this._nameToUniform2.get(g);if(void 0===w)this._context.gl.uniform2f(this._getUniformLocation(g),d,t),this._nameToUniform2.set(g,[d,t]);else if(d!==w[0]||t!==w[1])this._context.gl.uniform2f(this._getUniformLocation(g),d,t),w[0]=d,w[1]=t}setUniform2fv(g,d){f(this._nameToUniform2,g,d)&&this._context.gl.uniform2fv(this._getUniformLocation(g),d)}setUniform3f(g,d,t,w){const v=this._nameToUniform3.get(g);if(void 0===v)this._context.gl.uniform3f(this._getUniformLocation(g),d,t,w),this._nameToUniform3.set(g,
[d,t,w]);else if(d!==v[0]||t!==v[1]||w!==v[2])this._context.gl.uniform3f(this._getUniformLocation(g),d,t,w),v[0]=d,v[1]=t,v[2]=w}setUniform3fv(g,d){const t=this._getUniformLocation(g);null!=t&&f(this._nameToUniform3,g,d)&&this._context.gl.uniform3fv(t,d)}setUniform4f(g,d,t,w,v){const m=this._nameToUniform4.get(g);if(void 0===m)this._context.gl.uniform4f(this._getUniformLocation(g),d,t,w,v),this._nameToUniform4.set(g,[d,t,w,v]);else if(void 0===m||d!==m[0]||t!==m[1]||w!==m[2]||v!==m[3])this._context.gl.uniform4f(this._getUniformLocation(g),
d,t,w,v),m[0]=d,m[1]=t,m[2]=w,m[3]=v}setUniform4fv(g,d){const t=this._getUniformLocation(g);null!=t&&f(this._nameToUniform4,g,d)&&this._context.gl.uniform4fv(t,d)}setUniformMatrix3fv(g,d,t=!1){const w=this._getUniformLocation(g);null!=w&&f(this._nameToUniformMatrix3,g,d)&&this._context.gl.uniformMatrix3fv(w,t,d)}setUniformMatrix4fv(g,d,t=!1){const w=this._getUniformLocation(g);null!=w&&f(this._nameToUniformMatrix4,g,d)&&this._context.gl.uniformMatrix4fv(w,t,d)}stop(){}}const e={enabled:!1};a.Program=
c;a.test=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/ShaderTranspiler":function(){define("exports ../../core/has ./enums ./reservedWordsGLSL3 ./testUtils ../../chunks/builtins".split(" "),function(a,b,q,l,p,k){function h(){function r(J){J.length&&E.push({type:w[D],data:J,position:O,line:G,column:I})}function n(){N=N.length?[]:N;if("/"===H&&"*"===F)return O=C+B-1,D=0,H=F,B+1;if("/"===H&&"/"===F)return O=C+B-1,D=1,H=F,B+1;if("#"===F)return D=2,O=C+B,B;if(/\s/.test(F))return D=
9,O=C+B,B;L=/\d/.test(F);P=/[^\w_]/.test(F);O=C+B;D=L?4:P?3:9999;return B}function u(){if(("\r"===F||"\n"===F)&&"\\"!==H)return r(N.join("")),D=999,B;N.push(F);H=F;return B+1}function x(){if("."===H&&/\d/.test(F))return D=5,B;if("/"===H&&"*"===F)return D=0,B;if("/"===H&&"/"===F)return D=1,B;if("."===F&&N.length){for(;y(N););D=5;return B}if(";"===F||")"===F||"("===F){if(N.length)for(;y(N););r(F);D=999;return B+1}var J=2===N.length&&"\x3d"!==F;if(/[\w_\d\s]/.test(F)||J){for(;y(N););D=999;return B}N.push(F);
H=F;return B+1}function y(J){var R=0;do{var Q=k.operators.indexOf(J.slice(0,J.length+R).join(""));var W=k.operators[Q];if(-1===Q){if(0<R--+J.length)continue;W=J.slice(0,1).join("")}r(W);O+=W.length;N=N.slice(W.length);return N.length}while(1)}function z(){if("."===F||/[eE]/.test(F))return N.push(F),D=5,H=F,B+1;if("x"===F&&1===N.length&&"0"===N[0])return D=11,N.push(F),H=F,B+1;if(/[^\d]/.test(F))return r(N.join("")),D=999,B;N.push(F);H=F;return B+1}function A(){"f"===F&&(N.push(F),H=F,B+=1);if(/[eE]/.test(F)||
"-"===F&&/[eE]/.test(H))return N.push(F),H=F,B+1;if(/[^\d]/.test(F))return r(N.join("")),D=999,B;N.push(F);H=F;return B+1}var B=0,C=0,D=999,F,H,N=[],E=[],G=1,I=0,O=0,L=!1,P=!1,M="",K;return function(J){E=[];if(null!==J){J=J.replace?J.replace(/\r\n/g,"\n"):J;B=0;M+=J;for(K=M.length;F=M[B],B<K;){J=B;switch(D){case 0:"/"===F&&"*"===H?(N.push(F),r(N.join("")),D=999):(N.push(F),H=F);B+=1;break;case 1:B=u();break;case 2:B=u();break;case 3:B=x();break;case 4:B=z();break;case 11:/[^a-fA-F0-9]/.test(F)?(r(N.join("")),
D=999):(N.push(F),H=F,B+=1);break;case 5:B=A();break;case 9999:if(/[^\d\w_]/.test(F)){var R=N.join("");D=-1<k.literals.indexOf(R)?8:-1<k.builtins.indexOf(R)?7:6;r(N.join(""));D=999}else N.push(F),H=F,B+=1;break;case 9:/[^\s]/g.test(F)?(r(N.join("")),D=999):(N.push(F),H=F,B+=1);break;case 999:B=n()}if(J!==B)switch(M[J]){case "\n":I=0;++G;break;default:++I}}C+=B;M=M.slice(B);return E}N.length&&r(N.join(""));D=10;r("(eof)");return E}}function f(r){return r.map(n=>"eof"!==n.type?n.data:"").join("")}function c(r,
n="100",u="300 es"){const x=/^\s*#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const y of r)if("preprocessor"===y.type){const z=x.exec(y.data);if(z){r=z[1].replaceAll(/\s{2,}/g," ");if(r===u)return r;if(r===n)return y.data="#version "+u,n;throw Error("unknown glsl version: "+r);}}r.splice(0,0,{type:"preprocessor",data:"#version "+u},{type:"whitespace",data:"\n"});return null}function e(r,n,u,x){x=x||u;for(const y of r)if("ident"===y.type&&y.data===u)return x in n?n[x]++:n[x]=0,e(r,n,x+"_"+n[x],x);return u}
function g(r,n,u="afterVersion"){const x={data:"\n",type:"whitespace"},y=A=>A<r.length?/[^\r\n]$/.test(r[A].data):!1;let z=function(A){let B=-1,C=0,D=-1;for(let H=0;H<A.length;H++){var F=A[H];"preprocessor"===F.type&&(/#(if|ifdef|ifndef)\s+.+/.test(F.data)?++C:/#endif\s*.*/.test(F.data)&&--C);("afterVersion"===u||"afterPrecision"===u)&&"preprocessor"===F.type&&F.data.startsWith("#version")&&(D=Math.max(D,H));if("afterPrecision"===u&&"keyword"===F.type&&"precision"===F.data){a:{for(F=H;F<A.length;F++){const N=
A[F];if("operator"===N.type&&";"===N.data)break a}F=null}if(null===F)throw Error("precision statement not followed by any semicolons!");D=Math.max(D,F)}B<D&&0===C&&(B=H)}return B+1}(r);y(z-1)&&r.splice(z++,0,x);for(const A of n)r.splice(z++,0,A);y(z-1)&&y(z)&&r.splice(z,0,x)}function d(r,n,u,x="lowp"){g(r,[{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:x},{type:"whitespace",data:" "},{type:"keyword",data:u},{type:"whitespace",data:" "},{type:"ident",data:n},{type:"operator",
data:";"}],"afterPrecision")}function t(r,n,u,x,y="lowp"){g(r,[{type:"keyword",data:"layout"},{type:"operator",data:"("},{type:"keyword",data:"location"},{type:"whitespace",data:" "},{type:"operator",data:"\x3d"},{type:"whitespace",data:" "},{type:"integer",data:x.toString()},{type:"operator",data:")"},{type:"whitespace",data:" "},{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:y},{type:"whitespace",data:" "},{type:"keyword",data:u},{type:"whitespace",data:" "},{type:"ident",
data:n},{type:"operator",data:";"}],"afterPrecision")}var w="block-comment line-comment preprocessor operator integer float ident builtin keyword whitespace eof integer".split(" ");const v=new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),m=new Map;a.transpileShader=function(r,n){if(r.startsWith("#version 300"))return r;var u=p.shaderTranspiler.enableCache?m.get(r):null;if(null!=u)return u;u=h();var x=[];x=x.concat(u(r));u=x=x.concat(u(null));
if("300 es"===c(u,"100","300 es"))return r;var y=x=null;const z={},A={};for(let F=0;F<u.length;++F){const H=u[F];switch(H.type){case "keyword":n===q.ShaderType.VERTEX_SHADER&&"attribute"===H.data?H.data="in":"varying"===H.data&&(H.data=n===q.ShaderType.VERTEX_SHADER?"out":"in");break;case "builtin":/^texture(2D|Cube)(Proj)?(Lod|Grad)?(EXT)?$/.test(H.data.trim())&&(H.data=H.data.replaceAll(/(2D|Cube|EXT)/g,""));n===q.ShaderType.FRAGMENT_SHADER&&"gl_FragColor"===H.data&&(x||(x=e(u,z,"fragColor"),d(u,
x,"vec4")),H.data=x);if(n===q.ShaderType.FRAGMENT_SHADER&&"gl_FragData"===H.data){var B=void 0;let N=void 0;var C=u,D=F+1;let E=-1;for(;D<C.length;D++){const G=C[D];if("operator"===G.type&&("["===G.data&&(N=D),"]"===G.data)){B=D;break}"integer"===G.type&&(E=parseInt(G.data,10))}N&&B&&C.splice(N,B-N+1);C=E;B=e(u,z,"fragData");t(u,B,"vec4",C,"mediump");H.data=B}else n===q.ShaderType.FRAGMENT_SHADER&&"gl_FragDepthEXT"===H.data&&(y||=e(u,z,"gl_FragDepth"),H.data=y);break;case "ident":if(l.includes(H.data)){if(C=
n===q.ShaderType.VERTEX_SHADER)a:{for(C=F-1;0<=C;C--)if(B=u[C],"whitespace"!==B.type&&"block-comment"!==B.type)if("keyword"===B.type){if("attribute"===B.data||"in"===B.data){C=!0;break a}}else break;C=!1}if(C)throw Error("attribute in vertex shader uses a name that is a reserved word in glsl 300 es");H.data in A||(A[H.data]=e(u,z,H.data));H.data=A[H.data]}}}for(n=u.length-1;0<=n;--n)x=u[n],"preprocessor"===x.type&&(y=x.data.match(/#extension\s+(.*):/),y?.[1]&&v.has(y[1].trim())&&(y=u[n+1],u.splice(n,
y&&"whitespace"===y.type?2:1)),y=x.data.match(/#ifdef\s+(.*)/),y?.[1]&&v.has(y[1].trim())&&(x.data="#if 1"),y=x.data.match(/#ifndef\s+(.*)/),y?.[1]&&v.has(y[1].trim())&&(x.data="#if 0"));u=f(u);p.shaderTranspiler.enableCache&&m.set(r,u);return u};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/reservedWordsGLSL3":function(){define(function(){return"layout centroid smooth case mat2x2 mat2x3 mat2x4 mat3x2 mat3x3 mat3x4 mat4x2 mat4x3 mat4x4 uint uvec2 uvec3 uvec4 samplerCubeShadow sampler2DArray sampler2DArrayShadow isampler2D isampler3D isamplerCube isampler2DArray usampler2D usampler3D usamplerCube usampler2DArray coherent restrict readonly writeonly resource atomic_uint noperspective patch sample subroutine common partition active filter image1D image2D image3D imageCube iimage1D iimage2D iimage3D iimageCube uimage1D uimage2D uimage3D uimageCube image1DArray image2DArray iimage1DArray iimage2DArray uimage1DArray uimage2DArray image1DShadow image2DShadow image1DArrayShadow image2DArrayShadow imageBuffer iimageBuffer uimageBuffer sampler1DArray sampler1DArrayShadow isampler1D isampler1DArray usampler1D usampler1DArray isampler2DRect usampler2DRect samplerBuffer isamplerBuffer usamplerBuffer sampler2DMS isampler2DMS usampler2DMS sampler2DMSArray isampler2DMSArray usampler2DMSArray trunc round roundEven isnan isinf floatBitsToInt floatBitsToUint intBitsToFloat uintBitsToFloat packSnorm2x16 unpackSnorm2x16 packUnorm2x16 unpackUnorm2x16 packHalf2x16 unpackHalf2x16 outerProduct transpose determinant inverse texture textureSize textureProj textureLod textureOffset texelFetch texelFetchOffset textureProjOffset textureLodOffset textureProjLod textureProjLodOffset textureGrad textureGradOffset textureProjGrad textureProjGradOffset".split(" ")})},
"esri/views/webgl/testUtils":function(){define(["exports"],function(a){a.shaderTranspiler={enableCache:!1};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/builtins":function(){define(["exports","./_commonjsHelpers"],function(a,b){var q={exports:{}};(function(k){(function(h){h=h();void 0!==h&&(k.exports=h)})(function(){return"precision highp mediump lowp attribute const uniform varying break continue do for while if else in out inout float int void bool true false discard return mat2 mat3 mat4 vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow struct asm class union enum typedef template this packed goto switch default inline noinline volatile public static extern external interface long short double half fixed unsigned input output hvec2 hvec3 hvec4 dvec2 dvec3 dvec4 fvec2 fvec3 fvec4 sampler2DRect sampler3DRect sampler2DRectShadow sizeof cast namespace using".split(" ")})})(q);
q=b.getDefaultExportFromCjs(q.exports);var l={exports:{}};(function(k){(function(h){h=h();void 0!==h&&(k.exports=h)})(function(){return"\x3c\x3c\x3d \x3e\x3e\x3d ++ -- \x3c\x3c \x3e\x3e \x3c\x3d \x3e\x3d \x3d\x3d !\x3d \x26\x26 || +\x3d -\x3d *\x3d /\x3d %\x3d \x26\x3d ^^ ^\x3d |\x3d ( ) [ ] . ! ~ * / % + - \x3c \x3e \x26 ^ | ? : \x3d , ; { }".split(" ")})})(l);l=b.getDefaultExportFromCjs(l.exports);var p={exports:{}};(function(k){(function(h){h=h();void 0!==h&&(k.exports=h)})(function(){return"abs acos all any asin atan ceil clamp cos cross dFdx dFdy degrees distance dot equal exp exp2 faceforward floor fract gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_DepthRangeParameters gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FogParameters gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FragDepthEXT gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_LightModel gl_LightModelParameters gl_LightModelProducts gl_LightProducts gl_LightSource gl_LightSourceParameters gl_MaterialParameters gl_MaxClipPlanes gl_MaxCombinedTextureImageUnits gl_MaxDrawBuffers gl_MaxFragmentUniformComponents gl_MaxLights gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingFloats gl_MaxVertexAttribs gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_Point gl_PointCoord gl_PointParameters gl_PointSize gl_Position gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SecondaryColor gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex greaterThan greaterThanEqual inversesqrt length lessThan lessThanEqual log log2 matrixCompMult max min mix mod normalize not notEqual pow radians reflect refract sign sin smoothstep sqrt step tan texture2D texture2DLod texture2DProj texture2DProjLod textureCube textureCubeLod texture2DLodEXT texture2DProjLodEXT textureCubeLodEXT texture2DGradEXT texture2DProjGradEXT textureCubeGradEXT textureSize texelFetch".split(" ")})})(p);
b=b.getDefaultExportFromCjs(p.exports);a.builtins=b;a.literals=q;a.operators=l})},"esri/views/webgl/WebGLDriverTest":function(){define(["exports","./testAppleAmdDrawArrays","./testDoublePrecisionArithmetic","./testFloatBufferBlend","./testSVGPremultipliedAlpha"],function(a,b,q,l,p){class k{constructor(h){this.rctx=h;this.floatBufferBlend=new l.FloatBufferBlend(h);this.svgPremultipliesAlpha=new p.SVGPremultipliedAlpha(h);this.doublePrecisionRequiresObfuscation=new q.DoublePrecisionRequiresObfuscation(h);
this.drawArraysRequiresIndicesTypeReset=new b.DrawArraysRequiresIndicesTypeReset(h)}dispose(){this.doublePrecisionRequiresObfuscation.dispose();this.svgPremultipliesAlpha.dispose();this.floatBufferBlend.dispose();this.drawArraysRequiresIndicesTypeReset.dispose()}}a.WebGLDriverTest=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/testAppleAmdDrawArrays":function(){define("exports ../../core/has ../3d/webgl-engine/core/shaderModules/interfaces ./AppleAmdDriverHelper ./BufferObject ./enums ./FramebufferObject ./TextureDescriptor ./WebGLDriverTestModule".split(" "),
function(a,b,q,l,p,k,h,f,c){class e extends c.WebGLDriverTestModule{constructor(g){super();this._rctx=g;this._helperProgram=null;b("mac")&&b("chrome")&&(this._program=this._prepareProgram(),this._helperProgram=this._prepareHelperProgram())}dispose(){super.dispose();this._helperProgram?.dispose();this._helperProgram=null}_test(g){const d=this._rctx,t=d.getBoundFramebufferObject(),{x:w,y:v,width:m,height:r}=d.getViewport();d.resetState();var n=new f.TextureDescriptor(1);n.wrapMode=k.TextureWrapMode.CLAMP_TO_EDGE;
n.samplingMode=k.TextureSamplingMode.NEAREST;n=new h.FramebufferObject(d,n);const u=p.BufferObject.createIndex(this._rctx,k.Usage.STATIC_DRAW,new Uint8Array([0]));d.bindFramebuffer(n);d.setViewport(0,0,1,1);d.useProgram(this._helperProgram);d.bindBuffer(u,k.BufferType.ELEMENT_ARRAY_BUFFER);d.drawElements(k.PrimitiveType.POINTS,1,k.DataType.UNSIGNED_BYTE,0);d.useProgram(g);d.bindVAO(null);d.drawArrays(k.PrimitiveType.TRIANGLES,0,258);g=new Uint8Array(4);n.readPixels(0,0,1,1,k.PixelFormat.RGBA,k.PixelType.UNSIGNED_BYTE,
g);d.setViewport(w,v,m,r);d.bindFramebuffer(t);n.dispose();u.dispose();return 255===g[0]}_prepareProgram(){const g=`#version 300 es\n precision highp float;\n\n out float triangleId;\n\n const vec3 triangleVertices[3] = vec3[3](vec3(-0.5, -0.5, 0.0), vec3(0.5, -0.5, 0.0), vec3(0.0, 0.5, 0.0));\n\n void main(void) {\n triangleId = floor(float(gl_VertexID)/3.0);\n\n vec3 position = triangleVertices[gl_VertexID % 3];\n float offset = triangleId / ${q.glsl.float(85)};\n position.z = 0.5 - offset;\n\n gl_Position = vec4(position, 1.0);\n }\n `,
d=`#version 300 es\n precision highp float;\n\n in float triangleId;\n\n out vec4 fragColor;\n\n void main(void) {\n fragColor = triangleId == ${q.glsl.float(85)} ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);\n }\n `;return this._rctx.programCache.acquire(g,d,new Map([]))}_prepareHelperProgram(){const g=l.AppleAmdDriverHelper.getShaderSources();return this._rctx.programCache.acquire(g.vertex,g.fragment,new Map([]))}}a.DrawArraysRequiresIndicesTypeReset=e;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/WebGLDriverTestModule":function(){define(["exports","../../core/maybe"],function(a,b){class q{constructor(){this._result=!1}dispose(){this._program=b.disposeMaybe(this._program)}get result(){null!=this._program&&(this._result=this._test(this._program),this.dispose());return this._result}}a.WebGLDriverTestModule=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/testDoublePrecisionArithmetic":function(){define("exports ../../core/floatRGBA ../../core/has ../../core/maybe ../../core/libs/gl-matrix-2/factories/vec3f64 ./BufferObject ./doublePrecisionUtils ./enums ./FramebufferObject ./TextureDescriptor ./VertexArrayObject ./VertexElementDescriptor ./WebGLDriverTestModule".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){function w(m,r){return m.programCache.acquire(`\n\n precision highp float;\n\n attribute vec2 position;\n\n uniform vec3 u_highA;\n uniform vec3 u_lowA;\n uniform vec3 u_highB;\n uniform vec3 u_lowB;\n\n varying vec4 v_color;\n\n ${r?"#define DOUBLE_PRECISION_REQUIRES_OBFUSCATION":""}\n\n #ifdef DOUBLE_PRECISION_REQUIRES_OBFUSCATION\n\n vec3 dpPlusFrc(vec3 a, vec3 b) {\n return mix(a, a + b, vec3(notEqual(b, vec3(0))));\n }\n\n vec3 dpMinusFrc(vec3 a, vec3 b) {\n return mix(vec3(0), a - b, vec3(notEqual(a, b)));\n }\n\n vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {\n vec3 t1 = dpPlusFrc(hiA, hiB);\n vec3 e = dpMinusFrc(t1, hiA);\n vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB;\n return t1 + t2;\n }\n\n #else\n\n vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {\n vec3 t1 = hiA + hiB;\n vec3 e = t1 - hiA;\n vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB;\n return t1 + t2;\n }\n\n #endif\n\n const float MAX_RGBA_FLOAT =\n 255.0 / 256.0 +\n 255.0 / 256.0 / 256.0 +\n 255.0 / 256.0 / 256.0 / 256.0 +\n 255.0 / 256.0 / 256.0 / 256.0 / 256.0;\n\n const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0);\n\n vec4 float2rgba(const float value) {\n // Make sure value is in the domain we can represent\n float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT);\n\n // Decompose value in 32bit fixed point parts represented as\n // uint8 rgba components. Decomposition uses the fractional part after multiplying\n // by a power of 256 (this removes the bits that are represented in the previous\n // component) and then converts the fractional part to 8bits.\n vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0);\n\n // Convert uint8 values (from 0 to 255) to floating point representation for\n // the shader\n const float toU8AsFloat = 1.0 / 255.0;\n\n return fixedPointU8 * toU8AsFloat;\n }\n\n void main() {\n vec3 val = dpAdd(u_highA, u_lowA, -u_highB, -u_lowB);\n\n v_color = float2rgba(val.z / 25.0);\n\n gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0);\n }\n `,
"\n precision highp float;\n\n varying vec4 v_color;\n\n void main() {\n gl_FragColor \x3d v_color;\n }\n ",new Map([["position",0]]))}class v extends t.WebGLDriverTestModule{constructor(m){super();this._rctx=m;this._program=w(this._rctx,!1);this._obfuscated=w(this._rctx,!0)}dispose(){super.dispose();this._obfuscated=l.disposeMaybe(this._obfuscated)}_test(m){if(q("force-double-precision-obfuscation"))return!0;if(null==this._obfuscated)return!1;const r=this._rctx,n=r.getBoundFramebufferObject(),
{x:u,y:x,width:y,height:z}=r.getViewport();m=this._runProgram(m);const A=this._runProgram(this._obfuscated);r.setViewport(u,x,y,z);r.bindFramebuffer(n);return 0!==m&&(0===A||5<m/A)}_runProgram(m){var r=this._rctx;r.resetState();var n=new e.TextureDescriptor(1);n.wrapMode=f.TextureWrapMode.CLAMP_TO_EDGE;n.samplingMode=f.TextureSamplingMode.NEAREST;n=new c.FramebufferObject(r,n);var u=k.BufferObject.createVertex(r,f.Usage.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1]));u=new g.VertexArrayObject(r,new Map([["position",
0]]),{geometry:[new d.VertexElementDescriptor("position",2,f.DataType.UNSIGNED_SHORT,0,4)]},{geometry:u});const x=p.fromValues(5633261.287538229,2626832.878767164,1434988.0495278358),y=p.fromValues(5633271.46742708,2626873.6381334523,1434963.231608387),z=new Float32Array(6);h.encodeDoubleArray(x,z,3);const A=new Float32Array(6);h.encodeDoubleArray(y,A,3);r.useProgram(m);m.setUniform3f("u_highA",z[0],z[2],z[4]);m.setUniform3f("u_lowA",z[1],z[3],z[5]);m.setUniform3f("u_highB",A[0],A[2],A[4]);m.setUniform3f("u_lowB",
A[1],A[3],A[5]);r.bindFramebuffer(n);r.setViewport(0,0,1,1);r.bindVAO(u);r.drawArrays(f.PrimitiveType.TRIANGLE_STRIP,0,4);m=new Uint8Array(4);n.readPixels(0,0,1,1,f.PixelFormat.RGBA,f.PixelType.UNSIGNED_BYTE,m);u.dispose();n.dispose();r=(x[2]-y[2])/25;m=b.unpackFloatRGBA(m);return Math.abs(r-m)}}a.DoublePrecisionRequiresObfuscation=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/testFloatBufferBlend":function(){define("exports ./BufferObject ./enums ./FramebufferObject ./renderState ./TextureDescriptor ./VertexArrayObject ./VertexElementDescriptor ./WebGLDriverTestModule".split(" "),
function(a,b,q,l,p,k,h,f,c){class e extends c.WebGLDriverTestModule{constructor(g){super();this._rctx=g;g.gl&&g.capabilities.colorBufferFloat?.textureFloat&&g.capabilities.colorBufferFloat?.floatBlend&&(this._program=g.programCache.acquire("\n precision highp float;\n attribute vec2 a_pos;\n\n void main() {\n gl_Position \x3d vec4(a_pos * 2.0 - 1.0, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n void main() {\n gl_FragColor \x3d vec4(0.5, 0.5, 0.5, 0.5);\n }\n ",
new Map([["a_pos",0]])))}_test(g){const d=this._rctx;var t=new k.TextureDescriptor(1);t.wrapMode=q.TextureWrapMode.CLAMP_TO_EDGE;t.dataType=q.PixelType.FLOAT;t.internalFormat=q.SizedPixelFormat.RGBA32F;t.samplingMode=q.TextureSamplingMode.NEAREST;t=new l.FramebufferObject(d,t);var w=b.BufferObject.createVertex(d,q.Usage.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1]));w=new h.VertexArrayObject(d,new Map([["a_pos",0]]),{geometry:[new f.VertexElementDescriptor("a_pos",2,q.DataType.UNSIGNED_SHORT,0,4)]},
{geometry:w});d.gl.getError();d.useProgram(g);g=d.getBoundFramebufferObject();const {x:v,y:m,width:r,height:n}=d.getViewport();d.bindFramebuffer(t);d.setViewport(0,0,1,1);d.bindVAO(w);d.drawArrays(q.PrimitiveType.TRIANGLE_STRIP,0,4);var u=p.makePipelineState({blending:p.simpleBlendingParams(q.BlendFactor.ZERO,q.BlendFactor.ONE_MINUS_SRC_ALPHA)});d.setPipelineState(u);d.drawArrays(q.PrimitiveType.TRIANGLE_STRIP,0,4);u=d.gl.getError();d.setViewport(v,m,r,n);d.bindFramebuffer(g);w.dispose();t.dispose();
return u===d.gl.INVALID_OPERATION?(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1):!0}}a.FloatBufferBlend=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/testSVGPremultipliedAlpha":function(){define("exports ../2d/engine/webgl/DefaultVertexAttributeLayouts ./BufferObject ./enums ./FramebufferObject ./Texture ./TextureDescriptor ./VertexArrayObject ./WebGLDriverTestModule".split(" "),function(a,
b,q,l,p,k,h,f,c){class e extends c.WebGLDriverTestModule{constructor(d){super();this._rctx=d;this._program=d.programCache.acquire("\n precision highp float;\n\n attribute vec2 a_pos;\n varying vec2 v_uv;\n\n void main() {\n v_uv \x3d a_pos;\n gl_Position \x3d vec4(a_pos * 2.0 - 1.0, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n varying vec2 v_uv;\n\n uniform sampler2D u_texture;\n\n void main() {\n gl_FragColor \x3d texture2D(u_texture, v_uv);\n }\n ",
new Map([["a_pos",0]]))}dispose(){super.dispose()}_test(d){const t=this._rctx;if(!t.gl)return d.dispose(),!0;var w=new h.TextureDescriptor(1);w.wrapMode=l.TextureWrapMode.CLAMP_TO_EDGE;w.samplingMode=l.TextureSamplingMode.NEAREST;w=new p.FramebufferObject(t,w);var v=q.BufferObject.createVertex(t,l.Usage.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1]));v=new f.VertexArrayObject(t,new Map([["a_pos",0]]),b.Pos2us,{geometry:v});var m=new h.TextureDescriptor;m.samplingMode=l.TextureSamplingMode.LINEAR;
m.wrapMode=l.TextureWrapMode.CLAMP_TO_EDGE;m=new k.Texture(t,m,g);t.useProgram(d);t.bindTexture(m,0);d.setUniform1i("u_texture",0);d=t.getBoundFramebufferObject();const {x:r,y:n,width:u,height:x}=t.getViewport();t.bindFramebuffer(w);t.setViewport(0,0,1,1);t.setClearColor(0,0,0,0);t.setBlendingEnabled(!1);t.clear(l.ClearBufferBit.COLOR_BUFFER_BIT);t.bindVAO(v);t.drawArrays(l.PrimitiveType.TRIANGLE_STRIP,0,4);const y=new Uint8Array(4);w.readPixels(0,0,1,1,l.PixelFormat.RGBA,l.PixelType.UNSIGNED_BYTE,
y);v.dispose();w.dispose();m.dispose();t.setViewport(r,n,u,x);t.bindFramebuffer(d);return 255!==y[0]}}const g=new Image;g.src="data:image/svg+xml,%3C%3Fxml version\x3d'1.0' encoding\x3d'UTF-8'%3F%3E%3Csvg width\x3d'5' height\x3d'5' version\x3d'1.1' viewBox\x3d'0 0 5 5' xmlns\x3d'http://www.w3.org/2000/svg'%3E%3Crect width\x3d'5' height\x3d'5' fill\x3d'%23f00' fill-opacity\x3d'.5'/%3E%3C/svg%3E%0A";g.width=5;g.height=5;g.decode();a.SVGPremultipliedAlpha=e;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/2d/engine/webgl/DefaultVertexAttributeLayouts":function(){define(["exports","../../../webgl/enums","../../../webgl/VertexElementDescriptor"],function(a,b,q){const l={geometry:[new q.VertexElementDescriptor("a_pos",2,b.DataType.BYTE,0,2)]},p={geometry:[new q.VertexElementDescriptor("a_pos",2,b.DataType.BYTE,0,4),new q.VertexElementDescriptor("a_tex",2,b.DataType.BYTE,2,4)]};b={geometry:[new q.VertexElementDescriptor("a_pos",2,b.DataType.UNSIGNED_SHORT,0,4)]};a.Pos2b=
l;a.Pos2us=b;a.PosTex2b=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/capabilities/Capabilities":function(){define(["exports","./DisjointTimerQuery","./load","./LoseContext"],function(a,b,q,l){class p{constructor(k,h){this._gl=k;this._textureFloatLinear=this._textureNorm16=this._loseContext=this._colorBufferFloat=this._textureFilterAnisotropic=this._compressedTextureS3TC=this._compressedTextureETC=null;this._disabledExtensions=h.disabledExtensions||{};this._debugWebGLExtensions=
h.debugWebGLExtensions||{}}get compressedTextureETC(){this._compressedTextureETC??(this._compressedTextureETC=q.loadCompressedTextureETC(this._gl,this._disabledExtensions));return this._compressedTextureETC}get compressedTextureS3TC(){this._compressedTextureS3TC??(this._compressedTextureS3TC=q.loadCompressedTextureS3TC(this._gl,this._disabledExtensions));return this._compressedTextureS3TC}get textureFilterAnisotropic(){this._textureFilterAnisotropic??(this._textureFilterAnisotropic=q.loadTextureFilterAnisotropicCapability(this._gl,
this._disabledExtensions));return this._textureFilterAnisotropic}get disjointTimerQuery(){this._disjointTimerQuery??(this._disjointTimerQuery=b.createDisjointTimerQuery(this._gl,this._disabledExtensions));return this._disjointTimerQuery}get colorBufferFloat(){this._colorBufferFloat??(this._colorBufferFloat=q.loadColorBufferFloat(this._gl,this._disabledExtensions));return this._colorBufferFloat}get loseContext(){this._loseContext??(this._loseContext=l.load(this._gl,this._debugWebGLExtensions));return this._loseContext}get textureNorm16(){this._textureNorm16??
(this._textureNorm16=q.loadTextureNorm16(this._gl,this._disabledExtensions));return this._textureNorm16}get textureFloatLinear(){this._textureFloatLinear??(this._textureFloatLinear=q.loadBooleanExtension(this._gl,this._disabledExtensions,"textureFloatLinear",!1,["OES_texture_float_linear"]));return this._textureFloatLinear}enable(k){return this[k]}}a.Capabilities=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/capabilities/load":function(){define(["exports"],function(a){a.loadBooleanExtension=
function(b,q,l,p,k){if(p)return!0;if(q[l])return!1;for(const h of k)if(b.getExtension(h))return!0;return!1};a.loadColorBufferFloat=function(b,q){const l=!q.colorBufferHalfFloat&&b.getExtension("EXT_color_buffer_half_float")||!q.colorBufferFloat&&b.getExtension("EXT_color_buffer_float"),p=!q.colorBufferFloat&&b.getExtension("EXT_color_buffer_float");q=!q.floatBlend&&!q.colorBufferFloat&&b.getExtension("EXT_float_blend");return l||p||q?{textureFloat:!!p,textureHalfFloat:!!l,floatBlend:!!q,R16F:b.R16F,
RG16F:b.RG16F,RGBA16F:b.RGBA16F,R32F:b.R32F,RG32F:b.RG32F,RGBA32F:b.RGBA32F,R11F_G11F_B10F:b.R11F_G11F_B10F,RGB16F:b.RGB16F}:null};a.loadCompressedTextureETC=function(b,q){return q.compressedTextureETC?null:(b=b.getExtension("WEBGL_compressed_texture_etc"))?{COMPRESSED_R11_EAC:b.COMPRESSED_R11_EAC,COMPRESSED_SIGNED_R11_EAC:b.COMPRESSED_SIGNED_R11_EAC,COMPRESSED_RG11_EAC:b.COMPRESSED_RG11_EAC,COMPRESSED_SIGNED_RG11_EAC:b.COMPRESSED_SIGNED_RG11_EAC,COMPRESSED_RGB8_ETC2:b.COMPRESSED_RGB8_ETC2,COMPRESSED_SRGB8_ETC2:b.COMPRESSED_SRGB8_ETC2,
COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:b.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:b.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_RGBA8_ETC2_EAC:b.COMPRESSED_RGBA8_ETC2_EAC,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:b.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}:null};a.loadCompressedTextureS3TC=function(b,q){return q.compressedTextureS3TC?null:(b=b.getExtension("WEBGL_compressed_texture_s3tc"))?{COMPRESSED_RGB_S3TC_DXT1:b.COMPRESSED_RGB_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT1:b.COMPRESSED_RGBA_S3TC_DXT1_EXT,
COMPRESSED_RGBA_S3TC_DXT3:b.COMPRESSED_RGBA_S3TC_DXT3_EXT,COMPRESSED_RGBA_S3TC_DXT5:b.COMPRESSED_RGBA_S3TC_DXT5_EXT}:null};a.loadTextureFilterAnisotropicCapability=function(b,q){return q.textureFilterAnisotropic?null:(b=b.getExtension("EXT_texture_filter_anisotropic")||b.getExtension("MOZ_EXT_texture_filter_anisotropic")||b.getExtension("WEBKIT_EXT_texture_filter_anisotropic"))?{MAX_TEXTURE_MAX_ANISOTROPY:b.MAX_TEXTURE_MAX_ANISOTROPY_EXT,TEXTURE_MAX_ANISOTROPY:b.TEXTURE_MAX_ANISOTROPY_EXT}:null};
a.loadTextureNorm16=function(b,q){return q.textureNorm16?null:(b=b.getExtension("EXT_texture_norm16"))?{R16:b.R16_EXT,RG16:b.RG16_EXT,RGB16:b.RGB16_EXT,RGBA16:b.RGBA16_EXT,R16_SNORM:b.R16_SNORM_EXT,RG16_SNORM:b.RG16_SNORM_EXT,RGB16_SNORM:b.RGB16_SNORM_EXT,RGBA16_SNORM:b.RGBA16_SNORM_EXT}:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/capabilities/LoseContext":function(){define(["exports"],function(a){a.load=function(b,q){const l=q.loseContext&&b.getExtension("WEBGL_lose_context");
return l?{loseRenderingContext:()=>l.loseContext()}:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/TextureRepository":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/Logger ../../../../core/promiseUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ./basicInterfaces ./ContentObjectType ./ITexture ./TextureTechnique ./TextureTechniqueConfiguration ./Util ../../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r){a.TextureRepository=class extends q{constructor(u,x,y){super({});this._stage=u;this._techniques=x;this._rctx=y;this._textures=new Map;this._loadingCount=0;this._frameUpdates=new Map;this.events=new l;this._frameTask=u.view.resourceController.scheduler.registerTask(r.TaskPriority.TEXTURE_UNLOAD)}normalizeCtorArgs(){return{}}destroy(){this._frameTask.remove();this._stage.forEachOfType(d.ContentObjectType.Texture,u=>u.unload())}get updating(){return 0<this._loadingCount||
this._frameTask.updating}get textureTechnique(){null==this._textureTechnique&&(this._textureTechnique=this._techniques.acquire(w.TextureTechnique,new v.TextureTechniqueConfiguration));return this._textureTechnique}acquire(u){const x=this._textures.get(u);return x?(x.ref(),x.loadingPromise??x):this._createNewRef(u)}update(){let u=!1;this._frameUpdates.forEach(x=>{const y=x.texture.frameUpdate(x.previousToken);0<=y&&y!==x.previousToken&&(x.previousToken=y,u=!0)});u&&this.events.emit("changed",g.RenderRequestType.BACKGROUND)}_createNewRef(u){const x=
this._stage.getObject(u);if(null==x)return m.assert(void 0!==x),null;const y=x.events.on("unloaded",()=>{y.remove();this._onTextureUnloaded(u)}),z=new n(u,()=>{this._frameTask.schedule(()=>{z.isUnreferenced&&x.unload()})});this._textures.set(u,z);z.ref();if(x.glTexture)return this._updateGLTexture(z,x.glTexture),t.isFrameUpdateTexture(x)&&this._frameUpdates.set(u,{texture:x,previousToken:-1}),z;this._loadingCount++;z.loadingPromise=this._stage.schedule(()=>{const A=x.load(this._rctx),B=D=>{this._loadingCount--;
z.loadingPromise=null;this._updateGLTexture(z,D);t.isFrameUpdateTexture(x)&&this._frameUpdates.set(u,{texture:x,previousToken:-1});return z},C=D=>{this._loadingCount--;z.loadingPromise=null;k.isAbortError(D)||p.getLogger(this).error(D);return null};return k.isPromiseLike(A)?A.then(B,C):B(A)});return z.loadingPromise}_updateGLTexture(u,x){u.glTexture=x;this.events.emit("changed",g.RenderRequestType.UPDATE)}_onTextureUnloaded(u){this._textures.delete(u);this._frameUpdates.delete(u)}};b.__decorate([h.property()],
a.TextureRepository.prototype,"_loadingCount",void 0);b.__decorate([h.property()],a.TextureRepository.prototype,"_frameTask",void 0);b.__decorate([h.property()],a.TextureRepository.prototype,"updating",null);a.TextureRepository=b.__decorate([e.subclass("esri.views.3d.webgl-engine.lib.TextureRepository")],a.TextureRepository);class n{constructor(u,x){this.id=u;this._release=x;this._refCount=0}get isUnreferenced(){return 0===this._refCount}ref(){++this._refCount}release(){--this._refCount;0<this._refCount||
(0===this._refCount?this._release():(p.getLogger("esri.views.3d.webgl-engine.lib.TextureRepository.RefCountedTextureImpl").error("Cannot dereference texture that has no references!"),this._refCount=0))}}Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/ITexture":function(){define(["exports"],function(a){a.isFrameUpdateTexture=function(b){return!!b.frameUpdate};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/markerTextureRepository":function(){define(["exports",
"../../support/engineContent/marker","./ProceduralTextureRepository"],function(a,b,q){a.createMarkerTextureRepository=function(l,p){return new q.ProceduralTextureRepository(k=>b.createMarkerTexture(k,l),k=>k,p)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/materials/internal/WaterTextureRepository":function(){define("exports ../../../../../chunks/tslib.es6 ../../../../../assets ../../../../../core/Accessor ../../../../../core/asyncUtils ../../../../../core/Logger ../../../../../core/maybe ../../../../../core/promiseUtils ../../../../../core/accessorSupport/decorators/property ../../../../../core/has ../../../../../core/RandomLCG ../../../../../core/accessorSupport/decorators/subclass ../../../../../support/requestImageUtils ../../core/shaderModules/interfaces ../../lib/basicInterfaces ../../../../webgl/enums ../../../../webgl/Texture ../../../../webgl/TextureDescriptor".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){a.WaterTextureRepository=class extends l{constructor(){super(...arguments);this._passParameters=new u;this._resourcesTask=null}get passParameters(){return this._passParameters}destroy(){this._resourcesTask=h.abortMaybe(this._resourcesTask);this._passParameters.waveNormal=h.disposeMaybe(this._passParameters.waveNormal);this._passParameters.wavePerturbation=h.disposeMaybe(this._passParameters.wavePerturbation)}get updating(){return!!this._resourcesTask&&
!this._resourcesTask.finished}ensureResources(x){this._resourcesTask||(this._resourcesTask=p.createTask(async y=>{await Promise.allSettled([this._loadImageResource(x,q.getAssetUrl("esri/images/materials/water/normals.jpg"),z=>this._passParameters.waveNormal=z,y),this._loadImageResource(x,q.getAssetUrl("esri/images/materials/water/perturbation.jpg"),z=>this._passParameters.wavePerturbation=z,y)])}));return this._resourcesTask.finished?v.ResourceState.LOADED:v.ResourceState.LOADING}async _loadImageResource(x,
y,z,A){try{const B=await t.requestImage(y,{signal:A});f.throwIfAborted(A);const C=new n.TextureDescriptor(B.width,B.height);C.pixelFormat=m.PixelFormat.RGB;C.samplingMode=m.TextureSamplingMode.LINEAR_MIPMAP_LINEAR;C.hasMipmap=!0;C.maxAnisotropy=8;z(new r.Texture(x,C,B))}catch(B){k.getLogger(this).error("Failed to load water material normal texture.",B)}}};b.__decorate([c.property()],a.WaterTextureRepository.prototype,"_resourcesTask",void 0);b.__decorate([c.property({type:Boolean,readOnly:!0})],a.WaterTextureRepository.prototype,
"updating",null);a.WaterTextureRepository=b.__decorate([d.subclass("esri.views.3d.webgl-engine.materials.internal.WaterTextureRepository")],a.WaterTextureRepository);class u extends w.NoParameters{}a.WaterTexturePassParameters=u;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/parts/contextCache":function(){define(["exports"],function(a){const b=new Map;a.getContextCache=function(){return b};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/webgl-engine/parts/ScreenshotManager":function(){define("exports ../../../../core/promiseUtils ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../lib/basicInterfaces ../lib/rendererUtils ../../../support/RenderState ../../../support/screenshotUtils ../../../webgl/enums ../../../webgl/FramebufferObject ../../../../core/imageUtils".split(" "),function(a,b,q,l,p,k,h,f,c,e){class g{constructor(t,w,v){this.parameters=t;this.frameHasDecorations=w;this.fbos=v}}class d{constructor(t,w,
v){this._rctx=t;this._renderFunctions=w;this._forceCameraHook=v;this.supersample=!0;this._screenshotQueue=[]}destroy(){this._rctx=null}async takeScreenshot(t){await this._renderFunctions.prepareOverlay();this._renderFunctions.requestRenderScene(l.RenderRequestType.BACKGROUND);const w=b.createResolver();this._screenshotQueue.push({settings:t,resolver:w});return w.promise}update(t,w){for(const v of this._screenshotQueue){if(null==this._rctx){v.resolver.reject();continue}const m=this._renderScreenshot(t,
{...v.settings,pixelRatio:v.settings.pixelRatio*t.parameters.camera.pixelRatio},w);v.resolver(m)}this._screenshotQueue.length=0}_renderScreenshotOverlay(t,w,v){t.width=w.width;t.height=w.height;const m=t.getContext("2d"),r=v.pixelRatio;m.save();m.translate(0,w.height);m.scale(1,-1);v.region&&m.translate(-v.region.x,-v.region.y);m.scale(r,r);w=this._renderFunctions.renderOverlay(t,v.disableDecorations?l.Decorations.OFF:l.Decorations.ON,w);m.restore();return w}_readbackScreenshot(t,w){return t.resample?
this._readbackScreenshotResampled({...t,resample:t.resample},w):this._readbackScreenshotImmediate(t,w)}_readbackScreenshotResampled(t,w){const {framebufferWidth:v,framebufferHeight:m,region:r,resample:n}=t,u=this._ensureScreenshotEncodeCanvas();let x=e.createEmptyImageData(v,m,u);this._rctx.gl.readPixels(0,0,v,m,f.PixelFormat.RGBA,f.DataType.UNSIGNED_BYTE,new Uint8Array(x.data.buffer));w();x=this._renderScreenshotOverlay(u,x,{...t,region:void 0});t=e.createEmptyImageData(r.width,r.height,u);return h.resampleHermite(x,
t,!0,n.region.x,m-(n.region.y+n.region.height),n.region.width,n.region.height)}_readbackScreenshotImmediate(t,w){const {framebufferHeight:v,region:m}=t,r=this._ensureScreenshotEncodeCanvas(),n=e.createEmptyImageData(m.width,m.height,r);this._rctx.gl.readPixels(m.x,v-(m.y+m.height),m.width,m.height,f.PixelFormat.RGBA,f.DataType.UNSIGNED_BYTE,new Uint8Array(n.data.buffer));w();return this._renderScreenshotOverlay(r,n,t)}_renderScreenshot(t,w,v){var m=t.parameters.camera,r={width:w.framebufferWidth,
height:w.framebufferHeight};c.ensureAttachmentMaxSize(r,Math.min(this._rctx.parameters.maxTextureSize,this._rctx.parameters.maxRenderbufferSize));var n=!1,u=w.disableDecorations&&t.frameHasDecorations,x=w.ignorePadding&&m.pixelRatio!==w.pixelRatio;u=r.width!==m.fullWidth||r.height!==m.fullHeight||u||x||w.objectAndLayerIdColor;let y=null,z=null;if(u){n=m.clone();if(w.ignorePadding){x=q.clone(n.padding);for(let A=0;4>A;A++)x[A]=Math.round(x[A]/n.pixelRatio*w.pixelRatio);n.padding=x}n.fullWidth=r.width;
n.fullHeight=r.height;n.pixelRatio=w.pixelRatio;r=m.fovX-n.fovX;x=m.fovY-n.fovY;0>r&&r<x?n.fovX=m.fovX:0>x&&x<r&&(n.fovY=m.fovY);m={camera:n,contentCamera:n,mode:k.RenderState.IDLE,alignPixelEnabled:!0,contentPixelRatio:n.pixelRatio};this._forceCameraHook(m);n=!0;v=this._renderFunctions.renderScene(m,v,w.objectAndLayerIdColor?p.RendererTarget.ObjectAndLayerID:p.RendererTarget.Screenshot,w.disableDecorations?l.Decorations.OFF:l.Decorations.ON);z=v.screen;y=v.oid}this._rctx.bindFramebuffer(z?.fbo);
v=this._readbackScreenshot(w,()=>{this._rctx.bindFramebuffer(null);z?.release()});m=null;w.objectAndLayerIdColor&&(this._rctx.bindFramebuffer(y?.fbo),m=this._readbackScreenshot(w,()=>{this._rctx.bindFramebuffer(null);y?.release()}),this._rctx.bindFramebuffer(null));if(u&&!this._rctx.contextAttributes.alpha)for(w=3;w<v.data.length;w+=4)v.data[w]=255;if(m&&!this._rctx.contextAttributes.alpha)for(w=3;w<m.data.length;w+=4)m.data[w]=255;n&&this._forceCameraHook(t.parameters);return[v,m]}_ensureScreenshotEncodeCanvas(){this._screenshotEncodeCanvas||
(this._screenshotEncodeCanvas=document.createElement("canvas"));return this._screenshotEncodeCanvas}}a.ScreenshotContext=g;a.ScreenshotManager=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/screenshotUtils":function(){define(["exports","../../core/has","../../core/mathUtils","../../core/imageUtils"],function(a,b,q,l){function p(m,r){const {format:n,quality:u,rotation:x,disableDecorations:y}=m||{};var z=e(m,r.padding);var A=r.width-z.left-z.right;r=r.height-z.top-
z.bottom;z={x:0,y:0,width:A,height:r};if(m?.area){null!=m.area.x&&(z.x=Math.floor(m.area.x));null!=m.area.y&&(z.y=Math.floor(m.area.y));var B=null!=m.area.width?Math.floor(m.area.width):null,C=null!=m.area.height?Math.floor(m.area.height):null;z.width=A-z.x;z.height=r-z.y;null!=B&&null!=C?(z.width=Math.min(z.width,B),z.height=Math.min(z.height,C)):null==B&&null!=C?(B=Math.min(z.width,B),z.height*=B/z.width,z.width=B):null!=B&&null==C&&(B=Math.min(z.height,C),z.width*=B/z.height,z.height=B)}z=c(z,
m);B=Math.floor(Math.max(z.x,0));C=Math.floor(Math.max(z.y,0));A={x:B,y:C,width:Math.floor(Math.min(z.width,A-B)),height:Math.floor(Math.min(z.height,r-C))};r=A.width/A.height;z=z.width/z.height;z!==r&&(z>r?(r=Math.floor(A.width/z),A={x:A.x,y:Math.floor(A.y+(A.height-r)/2),width:A.width,height:r}):(r=Math.floor(A.height*z),A={x:Math.floor(A.x+(A.width-r)/2),y:A.y,width:r,height:A.height}));const {width:D,height:F}=f(m,A);r=g(n);z=w[r];z=q.clamp(null!=u?u:z,0,100);return{format:r,quality:z,area:A,
width:D,height:F,rotation:x,disableDecorations:!!y,ignoreBackground:!!m?.ignoreBackground,ignorePadding:!!m?.ignorePadding}}function k(m,r){null==d&&(d=document.createElement("canvas"));var n=d;if(r.premultipliedAlpha){var u=m.data;const y=u.length;for(let z=0;z<y;z+=4){var x=u[z+3];255!==x&&0<x&&(x=255/x,u[z]*=x,u[z+1]*=x,u[z+2]*=x)}}n.width=m.width;n.height=m.height;u=n.getContext("2d",{willReadFrequently:!0});u.putImageData(m,0,0);r.flipY&&(u.save(),u.globalCompositeOperation="copy",u.scale(1,
-1),u.translate(0,-u.canvas.height),u.drawImage(u.canvas,0,0),u.restore());return{ctx:u,canvas:n}}function h(m,r){return m.toDataURL(t[r.format],r.quality/100)}function f(m,r){if(!m)return r;const n=m.width;m=m.height;if(null!=n&&null!=m)return{width:Math.floor(n),height:Math.floor(m)};if(null==n&&null==m)return r;r=r.width/r.height;return null==m?{width:Math.floor(n),height:Math.floor(n/r)}:{width:Math.floor(m*r),height:Math.floor(m)}}function c(m,r){if(null==r?.width||null==r.height)return m;r=
r.width/r.height;const n=m.width/m.height;if(n===r)return m;if(n<r)return r=Math.floor(m.height*r),m.x-=(r-m.width)/2,m.width=r,m;r=Math.floor(m.width/r);m.y-=(r-m.height)/2;m.height=r;return m}function e(m,r){return!r||m?.ignorePadding?v:r}function g(m){switch(m){case "png":case "jpg":case "jpeg":return m;case null:case void 0:return"png";default:return"png"}}let d=null;const t={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},w={png:100,jpg:98,jpeg:98},v={top:0,right:0,bottom:0,left:0};a.createEmptyImageData=
l.createEmptyImageData;a.completeUserSettings=p;a.encode=function(m,r,n){const {ctx:u,canvas:x}=k(m,n);m=u.getImageData(0,0,m.width,m.height);r=h(x,r);x.width=0;x.height=0;return{dataUrl:r,data:m}};a.encodeData=function(m,r){const {ctx:n,canvas:u}=k(m,r);m=n.getImageData(0,0,m.width,m.height);u.width=0;u.height=0;return m};a.getFormatAndQuality=function(m,r){m=g(m);const n=w[m];r=q.clamp(null!=r?r:n,0,100);return{format:m,quality:r}};a.getMaximumResolutionScale=function(m,r){return r/Math.max(m[0],
m[1])};a.resampleHermite=function(m,r,n,u=0,x=0,y=m.width-u,z=m.height-x,A=!1){const {data:B}=m,{width:C,height:D,data:F}=r;y/=C;z/=D;const H=Math.ceil(y/2),N=Math.ceil(z/2);m=m.width;for(let I=0;I<D;I++)for(let O=0;O<C;O++){const L=4*(O+(A?D-I-1:I)*C);let P=0,M=0,K=0,J=0,R=0,Q=0;const W=(I+.5)*z;for(let S=Math.floor(I*z);S<(I+1)*z;S++){var E=Math.abs(W-(S+.5))/N;const V=(O+.5)*y;E*=E;for(let T=Math.floor(O*y);T<(O+1)*y;T++){var G=Math.abs(V-(T+.5))/H;G=Math.sqrt(E+G*G);if(1<=G)continue;G=2*G*G*G-
3*G*G+1;const Y=4*(u+T+(x+S)*m);Q+=G*B[Y+3];M+=G;!n&&255>B[Y+3]&&(G=G*B[Y+3]/255);K+=G*B[Y];J+=G*B[Y+1];R+=G*B[Y+2];P+=G}}F[L]=K/P;F[L+1]=J/P;F[L+2]=R/P;F[L+3]=Q/M}return r};a.screenshotSuperSampleSettings=function(m,r,n){if(!r)return m;const {framebufferWidth:u,framebufferHeight:x,pixelRatio:y,region:z}=m;r=e(m,n);n=r.left+r.right;const A=r.top+r.bottom,B=u-n,C=x-A,D=Math.min(8,Math.min((2048-n)/B,(2048-A)/C));return 1.5>D?m:{...m,framebufferWidth:Math.round(B*D)+n,framebufferHeight:Math.round(C*
D)+A,pixelRatio:y*D,resample:{region:{x:Math.round((z.x-r.left)*D)+r.left,y:Math.round((z.y-r.top)*D)+r.top,width:Math.round(z.width*D),height:Math.round(z.height*D)},width:u,height:x}}};a.toDataUrl=h;a.toRenderSettings=function(m,r){const n=p(m,r),u=n.area,x=n.width/u.width,y=e(n,r.padding),z=y.left+y.right,A=y.top+y.bottom;return{framebufferWidth:Math.floor((r.width-z)*x+z),framebufferHeight:Math.floor((r.height-A)*x+A),region:{x:Math.floor(u.x*x)+y.left,y:Math.floor(u.y*x)+y.top,width:n.width,
height:n.height},format:n.format,quality:n.quality,rotation:n.rotation,pixelRatio:x,layers:m?.layers??[],disableDecorations:n.disableDecorations,ignoreBackground:n.ignoreBackground,ignorePadding:n.ignorePadding,objectAndLayerIdColor:!1}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/parts/testUtils":function(){define(["exports","./contextCache"],function(a,b){a.contextCache={enabled:!1,disposeContextCache:()=>{const q=b.getContextCache();q.forEach(l=>
l.dispose());q.clear()}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/contextUtils":function(){define(["exports"],function(a){a.createContext=function(b,q={}){return(b=b.getContext("webgl2",q))?b:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/WebGLRequirements":function(){define(["exports","../../core/Error","../webgl/capabilities"],function(a,b,q){a.check=function(l){const p=q.getWebGLCapabilities();return p.available?
"3d"===l&&p.majorPerformanceCaveat?new b("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist."):p.supportsHighPrecisionFragment?p.supportsVertexShaderSamplers?null:new b("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):new b("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):
new b("webgl:required","WebGL2 is required but not supported.",Error().stack)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/capabilities":function(){define(["exports","./contextUtils"],function(a,b){function q(k){if("undefined"===typeof WebGL2RenderingContext)return null;var h=document.createElement("canvas");if(!h)return null;let f=b.createContext(h,{failIfMajorPerformanceCaveat:!0});null==f&&(f=b.createContext(h),null!=f&&(k.majorPerformanceCaveat=!0));if(null==
f)return f;k.available=!0;k.maxTextureSize=f.getParameter(f.MAX_TEXTURE_SIZE);k.supportsVertexShaderSamplers=0<f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS);if(h=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_FLOAT))k.supportsHighPrecisionFragment=0<h.precision;return f}let l;class p{constructor(){this.majorPerformanceCaveat=this.available=!1;this.maxTextureSize=0;this.supportsColorBufferHalfFloat=this.supportsColorBufferFloatBlend=this.supportsColorBufferFloat=this.supportsHighPrecisionFragment=
this.supportsVertexShaderSamplers=!1}}a.getWebGLCapabilities=function(){if(!l){{const k=new p,h=q(k);null!=h&&(k.supportsColorBufferFloat=null!==h.getExtension("EXT_color_buffer_float"),k.supportsColorBufferFloatBlend=null!==h.getExtension("EXT_float_blend"),k.supportsColorBufferHalfFloat=k.supportsColorBufferFloat||null!==h.getExtension("EXT_color_buffer_half_float"));l=k}}return l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/ui/DefaultUI":function(){define("../../chunks/tslib.es6 ../../core/has ../../core/Logger ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./Component ./UI ../../widgets/Attribution ../../widgets/Compass ../../widgets/NavigationToggle ../../widgets/Zoom".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){b=class extends c{constructor(w){super(w);this._defaultPositionLookup={attribution:"manual",compass:"top-left","navigation-toggle":"top-left",zoom:"top-left"};this.components=[];this._updateViewAwareWidgets=v=>{this.components.forEach(m=>{m=this._find(m)?.widget;void 0!==m?.view&&(m.view=v)})};this._componentsWatcher=(v,m)=>{this._removeComponents(m);this._addComponents(v);this._adjustPadding(v)}}initialize(){this.addHandles([l.watch(()=>this.components,this._componentsWatcher,
l.initial),l.watch(()=>this.view,this._updateViewAwareWidgets,l.initial)])}_add(w,v,m,r,n){let u=w;if("string"===typeof w&&this._defaultPositionLookup[w]){if(this._find(w))return;u=this._createComponent(w)}super._add(u,v,m,r,n)}_removeComponents(w){w.forEach(v=>{if(v=this._find(v))this.remove(v),v.destroy()})}_adjustPadding(w){w.includes("attribution")||this._isOverridden("padding")||({top:w}=this.padding,this.padding=w)}_addComponents(w){this.constructed&&w.forEach(v=>this.add(this._createComponent(v),
this._defaultPositionLookup[v]))}_createComponent(w){const v=this._createWidget(w);return new f({id:w,node:v})}_createWidget(w){const v=this.view;switch(w){case "attribution":return new e({view:v});case "compass":return new g({view:v});case "navigation-toggle":return new d({view:v});case "zoom":return new t({view:v})}}};a.__decorate([p.property()],b.prototype,"components",void 0);return b=a.__decorate([h.subclass("esri.views.ui.DefaultUI")],b)})},"esri/views/ui/Component":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/domUtils ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){b=class extends b{constructor(){super(...arguments);this.widget=null}destroy(){this.node=null;this.widget?.destroy()}get id(){return this._get("id")??this.widget?.id??this.node?.id}set id(c){this._set("id",c)}set node(c){const e=this._get("node");c!==e&&(c&&c.classList.add("esri-component"),e&&e.classList.remove("esri-component"),this._set("node",c))}castNode(c){this.widget?.destroy();if(!c)return this._set("widget",null),null;if("string"===typeof c||c&&"nodeType"in c)return this._set("widget",
null),q.byId(c);c&&"function"===typeof c.render&&!c.domNode&&(c.domNode=document.createElement("div"));this._set("widget",c);return c.domNode}};a.__decorate([l.property()],b.prototype,"id",null);a.__decorate([l.property()],b.prototype,"node",null);a.__decorate([p.cast("node")],b.prototype,"castNode",null);a.__decorate([l.property({readOnly:!0})],b.prototype,"widget",void 0);return b=a.__decorate([f.subclass("esri.views.ui.Component")],b)})},"esri/views/ui/UI":function(){define("../../chunks/tslib.es6 ../../intl ../../core/Accessor ../../core/arrayUtils ../../core/domUtils ../../core/Evented ../../core/handleUtils ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/has ../../core/accessorSupport/decorators/subclass ../../support/themeUtils ./Component ../../widgets/support/widgetUtils ../../intl/locale".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(z){return 0===z?"0":`${z}px`}function n(z){const A="object"===typeof z&&null!==z&&Object.getPrototypeOf(z);return null!==A&&A!==Object.prototype||!("component"in z||"index"in z||"position"in z)?null:z}function u(z,{top:A,bottom:B,left:C,right:D}){z.style.top=A;z.style.bottom=B;z.style.left=C;z.style.right=D}const x={left:0,top:0,bottom:0,right:0},y={bottom:30,top:15,right:15,left:15};b=class extends k.EventedAccessor{constructor(z){super(z);this._cornerNameToContainerLookup=
{};this._positionNameToContainerLookup={};this._components=[];this._componentMap=new Map;this._removeWidgetHandleKey=Symbol("componentOnRemoveSymbol");this._locale=m.getLocale();this.view=null;this._applyViewPadding=()=>{const A=this.container;A&&u(A,this._toPixelPosition(this._getViewPadding()))};this._applyUIPadding=()=>{const A=this._innerContainer;A&&u(A,this._toPixelPosition(this.padding))};this._initContainers()}initialize(){this.addHandles([f.watch(()=>[this.view?.padding,this.container],this._applyViewPadding,
f.initial),f.watch(()=>this.padding,this._applyUIPadding,f.initial),f.watch(()=>[this.container,this._locale],([z,A])=>{z&&z.setAttribute("lang",A)},f.initial),m.onLocaleChange(z=>{this._locale=z})])}destroy(){this.container=null;for(const z of this._components)z.destroy();this._components.length=0;this._componentMap.clear()}set container(z){const A=this._get("container");z!==A&&(z&&(z.classList.add("esri-ui"),t.setCalciteThemeClass(z),this._attachContainers(z)),A&&(A.classList.remove("esri-ui"),
u(A,{top:"",bottom:"",left:"",right:""}),p.empty(A)),this._set("container",z))}get height(){const z=this.view?.height??0;if(0===z)return z;const A=this._getViewPadding(),{top:B,bottom:C}=A;return Math.max(z-B-C,0)}get padding(){return this._get("padding")}set padding(z){this._overrideIfSome("padding",z)}castPadding(z){return"number"===typeof z?{bottom:z,top:z,right:z,left:z}:{...y,...z}}get width(){const z=this.view?.width??0;if(0===z)return z;const A=this._getViewPadding(),{left:B,right:C}=A;return Math.max(z-
B-C,0)}add(z,A){let B,C,D;if(Array.isArray(z))z.forEach(H=>this.add(H,A));else{var F=n(z);F&&({index:B,position:A,component:z,key:C}=F);A&&"object"===typeof A&&({index:B,key:C,position:A,internal:D}=A);!z||A&&!this._isValidPosition(A)||this._add(z,A,B,C,D)}}remove(z,A){if(z){if(Array.isArray(z))return z.map(C=>this.remove(C,A));if((z=this._find(z))&&(!this._componentMap.has(z)||this._componentMap.get(z)?.key===A)){var B=this._components.indexOf(z);z.node.parentNode?.removeChild(z.node);this._componentMap.delete(z);
z.widget?.removeHandlesReference(this._removeWidgetHandleKey);return this._components.splice(B,1)[0]}}}empty(z,A={removeInternal:!1}){if(Array.isArray(z))for(const B of z)this.empty(B,A);else{z=Array.prototype.slice.call(this._positionNameToContainerLookup[z??"manual"].children).map(B=>this._findByNode(B)).filter(B=>null==B?!1:!(this._componentMap.get(B)?.internal??!1)||A.removeInternal);for(const B of z)this.remove(B)}}move(z,A){Array.isArray(z)&&z.forEach(D=>this.move(D,A));if(z){var B=n(z)||n(A);
if(B){var C=B.index;A=B.position;z=B.component||z}(!A||this._isValidPosition(A))&&(z=this.remove(z))&&this.add(z,{position:A,index:C})}}find(z){return z?(z=this._findById(z))&&(z.widget||z.node):null}getComponents(z,A={includeInternal:!1}){return z?Array.isArray(z)?z.flatMap(B=>this._getComponentsAtPosition(B,A)):this._getComponentsAtPosition(z,A):this._components.filter(B=>A.includeInternal||!(this._componentMap.get(B)?.internal??!1)).map(({widget:B,node:C})=>B??C)}getPosition(z){for(const A in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[A].contains(z))return A;
return null}_add(z,A,B,C,D){z instanceof w||(z=new w({node:z}));const {widget:F}=z;null!=F&&F instanceof q&&F.addHandles(h.makeHandle(()=>{queueMicrotask(()=>this.remove(z))}),this._removeWidgetHandleKey);this._place({component:z,position:A,index:B});this._components.push(z);this._componentMap.set(z,{key:C,internal:D})}_find(z){return z?z instanceof w?this._findByComponent(z):"string"===typeof z?this._findById(z):this._findByNode(z.domNode||z):null}_getViewPadding(){return this.view?.padding??x}_attachContainers(z){z.appendChild(this._innerContainer);
z.appendChild(this._manualContainer)}_initContainers(){var z=document.createElement("div");z.classList.add("esri-ui-inner-container","esri-ui-corner-container");const A=document.createElement("div");A.classList.add("esri-ui-inner-container","esri-ui-manual-container");const B=document.createElement("div");B.classList.add("esri-ui-top-left","esri-ui-corner");z.appendChild(B);const C=document.createElement("div");C.classList.add("esri-ui-top-right","esri-ui-corner");z.appendChild(C);const D=document.createElement("div");
D.classList.add("esri-ui-bottom-left","esri-ui-corner");z.appendChild(D);const F=document.createElement("div");F.classList.add("esri-ui-bottom-right","esri-ui-corner");z.appendChild(F);this._innerContainer=z;this._manualContainer=A;z=v.isRTL();this._cornerNameToContainerLookup={"top-left":B,"top-right":C,"bottom-left":D,"bottom-right":F,"top-leading":z?C:B,"top-trailing":z?B:C,"bottom-leading":z?F:D,"bottom-trailing":z?D:F};this._positionNameToContainerLookup={manual:A,...this._cornerNameToContainerLookup}}_isValidPosition(z){return!!this._positionNameToContainerLookup[z]}_place(z){var A=
z.position??"manual";const {component:B,index:C}=z;z=this._positionNameToContainerLookup[A];A=null!=C&&-1<C;var D=B.widget;D&&!D._started&&"function"===typeof D.postMixInProperties&&"function"===typeof D.buildRendering&&"function"===typeof D.postCreate&&"function"===typeof D.startup&&B.widget.startup();A?(A=Array.from(z.children),0===C?z.firstChild?p.insertBefore(B.node,z.firstChild):z.appendChild(B.node):C>=A.length?z.appendChild(B.node):p.insertBefore(B.node,A[C])):z.appendChild(B.node)}_toPixelPosition(z){return{top:r(z.top),
left:r(z.left),right:r(z.right),bottom:r(z.bottom)}}_findByComponent(z){return this._components.find(A=>A===z)??null}_findById(z){return this._components.find(({id:A})=>A===z)??null}_findByNode(z){return this._components.find(({node:A})=>A===z)??null}_getComponentsAtPosition(z,A){return Array.prototype.slice.call(this._positionNameToContainerLookup[z].children).map(B=>this._findByNode(B)).filter(l.isSome).filter(B=>A.includeInternal||!(this._componentMap.get(B)?.internal??!1)).map(({widget:B,node:C})=>
B??C)}};a.__decorate([c.property()],b.prototype,"_locale",void 0);a.__decorate([c.property()],b.prototype,"container",null);a.__decorate([c.property()],b.prototype,"height",null);a.__decorate([c.property({value:y})],b.prototype,"padding",null);a.__decorate([e.cast("padding")],b.prototype,"castPadding",null);a.__decorate([c.property()],b.prototype,"view",void 0);a.__decorate([c.property()],b.prototype,"width",null);return b=a.__decorate([d.subclass("esri.views.ui.UI")],b)})},"esri/widgets/Attribution":function(){define("../chunks/tslib.es6 ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./Widget ./Attribution/AttributionViewModel ./support/globalCss ./support/decorators/accessibleHandler ./support/decorators/messageBundle ./support/jsxFactory ./support/widgetUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){l=class extends f{constructor(v,m){super(v,m);this._attributionTextOverflowed=this._isOpen=!1;this._prevSourceNodeHeight=0;this._resizeObserver=new ResizeObserver(r=>r.forEach(({target:n})=>this._checkSourceTextOverflow(n)));this.itemDelimiter=" | ";this.messages=null;this.viewModel=new c}initialize(){this.addHandles(b.on(()=>this.viewModel?.items,"change",()=>this.scheduleRender()))}destroy(){this._resizeObserver?.disconnect()}get _isInteractive(){return this._isOpen||
this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((v,m)=>{v.includes(m.text)||v.push(m.text);return v},[]).join(this.itemDelimiter)}get icon(){return"description"}set icon(v){this._overrideIfSome("icon",v)}get label(){return this.messages?.widgetLabel??""}set label(v){this._overrideIfSome("label",v)}get view(){return this.viewModel.view}set view(v){this.viewModel.view=v}render(){return t.tsx("div",{bind:this,class:this.classes("esri-attribution",e.globalCss.widget,
{["esri-attribution--open"]:this._isOpen}),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return t.tsx("div",{class:"esri-attribution__powered-by"},"Powered by"," ",t.tsx("a",{class:"esri-attribution__link",href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const v=this._isOpen,m=this._isInteractive,r=m?0:void 0,{attributionText:n}=this;return t.tsx("div",{afterCreate:this._afterSourcesNodeCreate,
bind:this,class:this.classes("esri-attribution__sources",{["esri-attribution__sources--open"]:v,[e.globalCss.interactive]:m}),innerHTML:n,tabIndex:r})}_afterSourcesNodeCreate(v){this._prevSourceNodeHeight=v.clientWidth;this._resizeObserver.observe(v)}_checkSourceTextOverflow(v){let m=!1;const {clientHeight:r,clientWidth:n,scrollWidth:u}=v;v=u>n;const x=this._attributionTextOverflowed!==v;this._attributionTextOverflowed=v;x&&(m=!0);this._isOpen&&(v=r<this._prevSourceNodeHeight,this._prevSourceNodeHeight=
r,v&&(this._isOpen=!1,m=!0));m&&this.scheduleRender()}_toggleState(){this._isInteractive&&(this._isOpen=!this._isOpen)}};a.__decorate([q.property()],l.prototype,"_isOpen",void 0);a.__decorate([q.property()],l.prototype,"_isInteractive",null);a.__decorate([q.property()],l.prototype,"_attributionTextOverflowed",void 0);a.__decorate([q.property()],l.prototype,"_prevSourceNodeHeight",void 0);a.__decorate([q.property({readOnly:!0,dependsOn:["viewModel.items.length","itemDelimiter"]})],l.prototype,"attributionText",
null);a.__decorate([q.property()],l.prototype,"icon",null);a.__decorate([q.property()],l.prototype,"itemDelimiter",void 0);a.__decorate([q.property()],l.prototype,"label",null);a.__decorate([q.property(),d.messageBundle("esri/widgets/Attribution/t9n/Attribution")],l.prototype,"messages",void 0);a.__decorate([q.property()],l.prototype,"view",null);a.__decorate([q.property({type:c})],l.prototype,"viewModel",void 0);a.__decorate([g.accessibleHandler()],l.prototype,"_toggleState",null);return l=a.__decorate([h.subclass("esri.widgets.Attribution")],
l)})},"esri/widgets/Attribution/AttributionViewModel":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/asyncUtils ../../core/Collection ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../geometry/Extent ../../geometry/SpatialReference ../../geometry/support/contains ../../geometry/support/webMercatorUtils ../../views/3d/layers/Lyr3DWasm".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(x,y){return x&&"copyright"in x&&(!y||"function"===typeof x.originOf&&"user"===x.originOf("copyright"))}function r(x,y){return x.length!==y.length||x.some((z,A)=>z.text!==y[A].text)}function n(x,y,z){z&&y&&(x.find(A=>A.layerView===y&&A.text===z)||x.push({text:z,layerView:y}))}const u=[];b=class extends b{constructor(x){super(x);this._clear=()=>{this._fetchedAttributionData.clear();this._pendingAttributions.clear();this.removeHandles("suspension");
this.notifyChange("state")};this._pendingAttributions=new Set;this._fetchedAttributionData=new Map;this.items=new l;this.view=null;this._allLayerViewsChange=y=>{this.removeHandles("suspension");this.removeHandles("visible-geometry-changed");const z=this.view?.allLayerViews;z&&(this.addHandles(z.map(A=>p.watch(()=>[A.suspended,A.layer?.attributionVisible],()=>this._updateAttributionItems())).toArray(),"suspension"),z.forEach(A=>{"esri.views.3d.layers.Tiles3DLayerView3D"===A.declaredClass&&this.addHandles(A.on("visible-geometry-changed",
()=>this._updateAttributionItems()),"visible-geometry-changed")}));y?.removed&&y.removed.forEach(A=>{this._pendingAttributions.delete(A);this._fetchedAttributionData.delete(A)});this._updateAttributionItems()};this.addHandles([p.on(()=>this.view?.allLayerViews,"change",y=>this._allLayerViewsChange(y),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),p.when(()=>!0===this.view?.stationary,()=>this._updateAttributionItems())])}destroy(){this.view=null;this._fetchedAttributionData.clear();
this._pendingAttributions.clear();this.items.removeAll()}get state(){return this.view?.ready?0<this._pendingAttributions.size?"loading":"ready":"disabled"}_updateAttributionItems(){const x=this.view;var y=x?.allLayerViews;u.length=0;if(x&&y){y.forEach(A=>{if(!A.suspended&&A.layer?.attributionVisible){var B=A.layer;if(m(B,"user"))n(u,A,B.copyright);else if(B.hasAttributionData)if(this._fetchedAttributionData.has(A)){var C=this._fetchedAttributionData.get(A);C?n(u,A,this._getDynamicAttribution(C,x,
B)):m(B)&&n(u,A,B.copyright)}else this._fetchAttributionData(A);else(C="portalItem"in B?B.portalItem?.accessInformation:void 0)?n(u,A,C):n(u,A,B.copyright)}});y=y.find(A=>"integrated-mesh-3dtiles"===A.layer?.type);if(this.view&&y){var z=v.getLyr3DWasm(this.view);if(z){z=z.getAttributionText();for(let A=0;A<z.length;++A)n(u,y,z[A])}}r(this.items,u)&&(this.items.removeAll(),this.items.addMany(u));u.length=0;this.notifyChange("state")}else this._clear()}async _fetchAttributionData(x){if(!this._pendingAttributions.has(x)){this._pendingAttributions.add(x);
var y=await q.result(x.layer.fetchAttributionData());this._pendingAttributions.has(x)&&(y=y.ok?this._createContributionIndex(y.value,"bing-maps"===x.layer.type):null,this._pendingAttributions.delete(x),this._fetchedAttributionData.set(x,y));this._updateAttributionItems()}}_createContributionIndex(x,y){x=x.contributors;const z={};if(!x)return z;for(let D=0;D<x.length;D++){const F=x[D];var A=F.coverageAreas;if(!A)return;for(const H of A){var B=H.bbox,C=H.zoomMin-(y&&H.zoomMin?1:0);A=H.zoomMax-(y&&H.zoomMax?
1:0);B=new g({xmin:B[1],ymin:B[0],xmax:B[3],ymax:B[2],spatialReference:d.WGS84});for(B={extent:w.geographicToWebMercator(B),attribution:F.attribution||"",score:null!=H.score?H.score:100,id:D};C<=A;C++){let N,E;(N=z)[E=C]??(N[E]=[]);z[C].push(B)}}}z.maxKey=Math.max.apply(null,Object.keys(z));return z}_getDynamicAttribution(x,y,z){const {extent:A,scale:B}=y;z=z.tileInfo?.scaleToZoom(B)??0;z=Math.min(x.maxKey??0,Math.round(z));if(!A||null==z||-1>=z)return"";x=x[z];const C=w.project(A.center.clone().normalize(),
y.spatialReference),D=new Set;return x?x.filter(F=>{const H=F.id;(F=!D.has(H)&&C&&F.extent&&t.extentContainsPoint(F.extent,C))&&D.add(H);return F}).sort((F,H)=>H.score-F.score||F.objectId-H.objectId).map(F=>F.attribution).join(", "):""}};a.__decorate([k.property({readOnly:!0,type:l})],b.prototype,"items",void 0);a.__decorate([k.property({readOnly:!0})],b.prototype,"state",null);a.__decorate([k.property()],b.prototype,"view",void 0);return b=a.__decorate([e.subclass("esri.widgets.Attribution.AttributionViewModel")],
b)})},"esri/views/3d/layers/Lyr3DWasm":function(){define(["require","exports"],function(a,b){let q,l=null;const p=new Map;b.addLayerViewToWasm=async function(k){null==l&&(null==q&&(q=new Promise((c,e)=>a(["../../../layers/Lyr3DWasmPerSceneView"],g=>c(Object.freeze(Object.defineProperty({__proto__:null,default:g},Symbol.toStringTag,{value:"Module"}))),e))),l=await q);const h=k.view;let f=p.get(h);f||(f=new l.default({view:h}),p.set(h,f));await f.initializeWasm();return f.add3DTilesLayerView(k)};b.getLyr3DWasm=
function(k){return p.get(k)};b.removeLayerViewFromWasm=function(k){const h=k.view,f=p.get(h);f&&1>f.remove3DTilesLayerView(k)&&(p.delete(h),0===p.size&&(l=q=null))};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/support/globalCss":function(){define(["exports"],function(a){a.globalCss={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",
buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation",loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",
menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table",widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",
widgetDisabled:"esri-widget--disabled"};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Compass":function(){define("require ../chunks/tslib.es6 ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./Widget ./Compass/CompassViewModel ./Compass/css ../chunks/componentsUtils ./support/globalCss ./support/widgetUtils ./support/decorators/messageBundle ./support/jsxFactory".split(" "),function(a,
b,q,l,p,k,h,f,c,e,g,d,t,w,v){l=class extends f{constructor(m,r){super(m,r);this.messages=null;this.viewModel=new c;this._reset=()=>{this.viewModel.reset()};this._toRotationTransform=n=>({transform:`rotateZ(${n.z}deg)`})}loadDependencies(){return g.loadCalciteComponents({button:()=>new Promise((m,r)=>a(["../chunks/calcite-button"],m,r)),icon:()=>new Promise((m,r)=>a(["../chunks/calcite-icon"],m,r))})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(m){this.viewModel.goToOverride=
m}get icon(){return"rotation"===this.viewModel.state?"arrow-up":"compass-needle"}set icon(m){this._overrideIfSome("icon",m)}get label(){return this.messages?.widgetLabel??""}set label(m){this._overrideIfSome("label",m)}get view(){return this.viewModel.view}set view(m){this.viewModel.view=m}reset(){return this.viewModel.reset()}render(){const {orientation:m,state:r}=this.viewModel,{messages:n}=this;return v.tsx("div",{class:this.classes(e.css.base,d.globalCss.widget)},v.tsx("calcite-button",{class:d.globalCss.widgetButton,
disabled:"disabled"===r,kind:"neutral",label:n.reset,onclick:this._reset,round:!0,scale:"s",title:n.reset},v.tsx("div",{"aria-hidden":"true",class:e.css.iconContainer,title:n.reset},v.tsx("calcite-icon",{icon:this.icon,styles:this._toRotationTransform(m)}))))}};b.__decorate([q.property()],l.prototype,"goToOverride",null);b.__decorate([q.property()],l.prototype,"icon",null);b.__decorate([q.property()],l.prototype,"label",null);b.__decorate([q.property(),w.messageBundle("esri/widgets/Compass/t9n/Compass")],
l.prototype,"messages",void 0);b.__decorate([q.property()],l.prototype,"view",null);b.__decorate([q.property({type:c})],l.prototype,"viewModel",void 0);return l=b.__decorate([h.subclass("esri.widgets.Compass")],l)})},"esri/widgets/Compass/CompassViewModel":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/has ../../core/reactiveUtils ../../core/time ../../core/accessorSupport/decorators/property ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./utils ../support/GoTo".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){b=class extends g.GoToMixin(b){constructor(d){super(d);this.orientation={x:0,y:0,z:0};this.view=null;this._updateForCamera=this._updateForCamera.bind(this);this._updateForRotation=this._updateForRotation.bind(this);this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this.addHandles(l.watch(()=>this.view,this._updateRotationWatcher,l.initial))}destroy(){this.view=null}get canShowNorth(){return e.canShowNorth(this.view)}get state(){return!this.view?.ready||
"2d"===this.view.type&&!this.view.constraints.rotationEnabled?"disabled":this.canShowNorth?"compass":"rotation"}reset(){this.view?.ready&&("2d"===this.view?.type?this.callGoTo({target:{rotation:0},options:{animationMode:"always",duration:p.Milliseconds(q("mapview-essential-goto-duration"))}}):this.callGoTo({target:{heading:0}}))}_updateForRotation(d){void 0!==d&&null!==d&&this._set("orientation",{z:d})}_updateForCamera(d){d&&this._set("orientation",{x:0,y:0,z:-d.heading})}_updateRotationWatcher(d){this.removeAllHandles();
d&&this.addHandles("2d"===d.type?l.watch(()=>d?.rotation,this._updateForRotation,l.initial):l.watch(()=>d?.camera,this._updateForCamera,l.initial))}};a.__decorate([k.property({readOnly:!0})],b.prototype,"canShowNorth",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"orientation",void 0);a.__decorate([k.property({readOnly:!0})],b.prototype,"state",null);a.__decorate([k.property()],b.prototype,"view",void 0);return b=a.__decorate([c.subclass("esri.widgets.Compass.CompassViewModel")],b)})},
"esri/widgets/Compass/utils":function(){define(["exports"],function(a){a.canShowNorth=function(b){return b?.spatialReference?.isWebMercator||b?.spatialReference?.isGeographic||!1};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/support/GoTo":function(){define("exports ../../chunks/tslib.es6 ../../core/maybe ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),function(a,
b,q,l,p,k,h,f){a.GoToMixin=c=>{c=class extends c{constructor(...e){super(...e);this.view=this.goToOverride=null}callGoTo(e){const {view:g}=this;q.assertIsSome(g);return this.goToOverride?this.goToOverride(g,e):g.goTo(e.target,e.options)}};b.__decorate([l.property()],c.prototype,"goToOverride",void 0);b.__decorate([l.property()],c.prototype,"view",void 0);return c=b.__decorate([f.subclass("esri.widgets.support.GoTo")],c)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Compass/css":function(){define(["exports"],
function(a){a.css={base:"esri-compass",iconContainer:"esri-compass__icon-container"};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/NavigationToggle":function(){define("require ../chunks/tslib.es6 ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./Widget ./NavigationToggle/css ./NavigationToggle/NavigationToggleViewModel ../chunks/componentsUtils ./support/globalCss ./support/widgetUtils ./support/decorators/messageBundle ./support/jsxFactory".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){l=class extends f{constructor(m,r){super(m,r);this.messages=null;this.viewModel=new e;this.toggle=()=>this.viewModel.toggle();this._rotateButton=this._panButton=null;this._toggle=()=>{("pan"===this.viewModel?.navigationMode?this._rotateButton:this._panButton)?.setFocus();this.toggle()}}loadDependencies(){return g.loadCalciteComponents({button:()=>new Promise((m,r)=>a(["../chunks/calcite-button"],m,r))})}get icon(){return"move"}set icon(m){this._overrideIfSome("icon",
m)}get label(){return this.messages?.widgetLabel??""}set label(m){this._overrideIfSome("label",m)}set layout(m){"horizontal"!==m&&(m="vertical");this._set("layout",m)}get view(){return this.viewModel.view}set view(m){this.viewModel.view=m}render(){const m="disabled"===this.viewModel?.state,r="pan"===this.viewModel?.navigationMode,n=this.messages.toggle;return v.tsx("div",{class:this.classes(c.css.base,d.globalCss.widget,{[c.css.isLayoutHorizontal]:"horizontal"===this.layout})},v.tsx("calcite-button",
{afterCreate:u=>{this._panButton=u},appearance:r?"outline-fill":"solid",class:d.globalCss.widgetButton,disabled:m,iconStart:"move",kind:"neutral",label:n,onclick:this._toggle,tabIndex:r?void 0:-1,title:n}),v.tsx("calcite-button",{afterCreate:u=>{this._rotateButton=u},appearance:r?"solid":"outline-fill",class:d.globalCss.widgetButton,disabled:m,iconStart:"rotate",kind:"neutral",label:n,onclick:this._toggle,tabIndex:r?-1:void 0,title:n}))}};b.__decorate([q.property()],l.prototype,"icon",null);b.__decorate([q.property()],
l.prototype,"label",null);b.__decorate([q.property({value:"vertical"})],l.prototype,"layout",null);b.__decorate([q.property(),w.messageBundle("esri/widgets/NavigationToggle/t9n/NavigationToggle")],l.prototype,"messages",void 0);b.__decorate([q.property()],l.prototype,"view",null);b.__decorate([q.property({type:e})],l.prototype,"viewModel",void 0);return l=b.__decorate([h.subclass("esri.widgets.NavigationToggle")],l)})},"esri/widgets/NavigationToggle/css":function(){define(["exports"],function(a){a.css=
{base:"esri-navigation-toggle",isLayoutHorizontal:"esri-navigation-toggle--horizontal"};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/NavigationToggle/NavigationToggleViewModel":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h,f){b=class extends b{constructor(c){super(c);
this._navigationMode="pan";this.view=null}initialize(){this.addHandles(q.when(()=>this.view?.inputManager,()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.view?.ready&&"3d"===this.view?.type?"ready":"disabled"}get navigationMode(){return this._navigationMode}set navigationMode(c){this._navigationMode=c;this._setNavigationMode()}toggle(){"disabled"!==this.state&&(this.navigationMode="pan"!==this.navigationMode?"pan":"rotate")}_setNavigationMode(){const c=this.view?.inputManager;
c&&(c.primaryDragAction="pan"===this._navigationMode?"pan":"rotate")}};a.__decorate([l.property({readOnly:!0})],b.prototype,"state",null);a.__decorate([l.property()],b.prototype,"_navigationMode",void 0);a.__decorate([l.property()],b.prototype,"view",void 0);return b=a.__decorate([f.subclass("esri.widgets.NavigationToggle.NavigationToggleViewModel")],b)})},"esri/widgets/Zoom":function(){define("require ../chunks/tslib.es6 ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./Widget ../chunks/componentsUtils ./support/globalCss ./support/widgetUtils ./support/decorators/messageBundle ./support/jsxFactory ./Zoom/ZoomViewModel".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){l=class extends f{constructor(v,m){super(v,m);this.messages=null;this.viewModel=new w;this.zoomIn=()=>this.viewModel.zoomIn();this.zoomOut=()=>this.viewModel.zoomOut()}loadDependencies(){return c.loadCalciteComponents({button:()=>new Promise((v,m)=>a(["../chunks/calcite-button"],v,m))})}get icon(){return"magnifying-glass-plus"}set icon(v){this._overrideIfSome("icon",v)}get label(){return this.messages?.widgetLabel??""}set label(v){this._overrideIfSome("label",
v)}set layout(v){"horizontal"!==v&&(v="vertical");this._set("layout",v)}set view(v){this.viewModel.view=v}get view(){return this.viewModel.view}render(){const v={["esri-zoom--horizontal"]:"horizontal"===this.layout},{canZoomIn:m,canZoomOut:r}=this.viewModel,{zoomIn:n,zoomOut:u}=this.messages;return t.tsx("div",{class:this.classes("esri-zoom",e.globalCss.widget,v)},t.tsx("calcite-button",{class:e.globalCss.widgetButton,disabled:!m,iconStart:"plus",kind:"neutral",label:n,onclick:this.zoomIn,title:n}),
t.tsx("calcite-button",{class:e.globalCss.widgetButton,disabled:!r,iconStart:"minus",kind:"neutral",label:u,onclick:this.zoomOut,title:u}))}};b.__decorate([q.property()],l.prototype,"icon",null);b.__decorate([q.property()],l.prototype,"label",null);b.__decorate([q.property({value:"vertical"})],l.prototype,"layout",null);b.__decorate([q.property(),d.messageBundle("esri/widgets/Zoom/t9n/Zoom")],l.prototype,"messages",void 0);b.__decorate([q.property()],l.prototype,"view",null);b.__decorate([q.property({type:w})],
l.prototype,"viewModel",void 0);return l=b.__decorate([h.subclass("esri.widgets.Zoom")],l)})},"esri/widgets/Zoom/ZoomViewModel":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/promiseUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./ZoomConditions2D ./ZoomConditions3D".split(" "),function(a,b,q,l,p,k,h,f,c,e){b=class extends b{constructor(g){super(g)}destroy(){this.view=
null}get canZoomIn(){return null!=this._zoomConditions&&this._zoomConditions.canZoomIn}get canZoomOut(){return null!=this._zoomConditions&&this._zoomConditions?.canZoomOut}get state(){return this.view?.ready?"ready":"disabled"}set view(g){g?"2d"===g.type?this._zoomConditions=new c({view:g}):"3d"===g.type&&(this._zoomConditions=new e({view:g})):this._zoomConditions=null;this._set("view",g)}zoomIn(){if(this.canZoomIn){var g=this.view;"2d"===g.type?g.mapViewNavigation.zoomIn():q.ignoreAbortErrors(g.goTo({zoomFactor:2}))}}zoomOut(){if(this.canZoomOut){var g=
this.view;"2d"===g.type?g.mapViewNavigation.zoomOut():q.ignoreAbortErrors(g.goTo({zoomFactor:.5}))}}};a.__decorate([l.property()],b.prototype,"_zoomConditions",void 0);a.__decorate([l.property()],b.prototype,"canZoomIn",null);a.__decorate([l.property()],b.prototype,"canZoomOut",null);a.__decorate([l.property({readOnly:!0})],b.prototype,"state",null);a.__decorate([l.property()],b.prototype,"view",null);return b=a.__decorate([f.subclass("esri.widgets.Zoom.ZoomViewModel")],b)})},"esri/widgets/Zoom/ZoomConditions2D":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h){b=class extends b{get canZoomIn(){if(!this.view?.ready)return!1;const f=this.view?.constraints?.effectiveMaxScale;return 0===f||this._scale>f}get canZoomOut(){var {view:f}=this;if(!f?.ready)return!1;f=f.constraints?.effectiveMinScale;return 0===f||this._scale<f}get _scale(){const f=this.view?.animation?.target;return(f&&"then"in f?void 0:f?.scale)??this.view?.scale??0}};a.__decorate([q.property({readOnly:!0})],b.prototype,"canZoomIn",null);a.__decorate([q.property({readOnly:!0})],
b.prototype,"canZoomOut",null);a.__decorate([q.property()],b.prototype,"view",void 0);a.__decorate([q.property()],b.prototype,"_scale",null);return b=a.__decorate([h.subclass("esri.widgets.Zoom.ZoomConditions2D")],b)})},"esri/widgets/Zoom/ZoomConditions3D":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h){b=
class extends b{get canZoomIn(){return!!this.view.ready}get canZoomOut(){return!!this.view.ready}};a.__decorate([q.property({readOnly:!0})],b.prototype,"canZoomIn",null);a.__decorate([q.property({readOnly:!0})],b.prototype,"canZoomOut",null);a.__decorate([q.property()],b.prototype,"view",void 0);return b=a.__decorate([h.subclass("esri.widgets.Zoom.ZoomConditions3D")],b)})},"esri/views/ui/3d/DefaultUI3D":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../DefaultUI".split(" "),
function(a,b,q,l,p,k,h){q=class extends h{constructor(f){super(f);this.components=["attribution","zoom","navigation-toggle","compass"]}};a.__decorate([b.property()],q.prototype,"components",void 0);return q=a.__decorate([k.subclass("esri.views.ui.3d.DefaultUI3D")],q)})},"esri/layers/SceneLayer":function(){define("require ../chunks/tslib.es6 ../Graphic ../PopupTemplate ../renderers/ClassBreaksRenderer ../renderers/DictionaryRenderer ../renderers/DotDensityRenderer ../renderers/HeatmapRenderer ../renderers/PieChartRenderer ../renderers/Renderer ../renderers/SimpleRenderer ../renderers/UniqueValueRenderer ../renderers/support/jsonUtils ../renderers/support/types ../core/Clonable ../core/Collection ../core/Error ../core/Logger ../core/MultiOriginJSONSupport ../core/promiseUtils ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/has ../core/RandomLCG ../core/accessorSupport/utils ../core/accessorSupport/decorators/reader ../core/accessorSupport/decorators/subclass ../core/accessorSupport/PropertyOrigin ../geometry/Mesh ../geometry/Point ./Layer ./graphics/sources/support/uploadAssetErrors ./mixins/APIKeyMixin ./mixins/ArcGISService ./mixins/CustomParametersMixin ./mixins/EditBusLayer ./mixins/OperationalLayer ./mixins/PortalLayer ./mixins/ScaleRangeLayer ./mixins/SceneService ./mixins/TemporalLayer ./mixins/TemporalSceneLayer ./support/arcgisLayerUrl ./support/associatedFeatureServiceUtils ./support/capabilities ./support/commonProperties ./support/featureLayerUtils ./support/FeatureReduction ./support/FeatureReductionSelection ./support/fieldProperties ./support/FieldsIndex ./support/fieldUtils ./support/I3SLayerDefinitions ./support/infoFor3D ./support/LabelClass ./support/labelingInfo ./support/LayerFloorInfo ./support/lazyLayerLoader ./support/RangeInfo ./support/SceneFilter ./support/sceneLayerCacheUtils ./support/sceneLayerStatistics ../renderers/support/styleUtils ../rest/support/Query ../support/elevationInfoUtils ../support/featureFlags ../support/popupUtils ../support/zipUtils ../views/3d/layers/i3s/I3SUtil ../views/layers/support/popupUtils ../webdoc/support/opacityUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U,Z,ca,ea,da,ia,ka,fa,X,ja,la,na,va,za,ya,Da,ra,xa,Ma,Ga,Pa,Qa,Ea,ua){const Na=new Set(["3DObject","Point"]);p=ca.defineFieldProperties();v=class extends S.TemporalSceneLayer(M.EditBusLayer(Q.SceneService(L.ArcGISService(K.OperationalLayer(J.PortalLayer(R.ScaleRangeLayer(u.MultiOriginJSONMixin(P.CustomParametersMixin(O.APIKeyMixin(v.ClonableMixin(G))))))))))){constructor(...sa){super(...sa);this.rangeInfos=
this.featureReduction=null;this.operationalLayerType="ArcGISSceneServiceLayer";this.type="scene";this.serviceUpdateTimeStamp=this.geometryDefinitions=this.textureSetDefinitions=this.materialDefinitions=this.nodePages=this.outFields=this.floorInfo=this.fields=null;this.excludeObjectIds=new m;this.path=this.filter=this.definitionExpression=null;this.labelsVisible=!0;this.labelingInfo=null;this.legendEnabled=!0;this.semantic=this.priority=null;this.cachedDrawingInfo={color:!1};this.popupEnabled=!0;this.globalIdField=
this.objectIdField=this.popupTemplate=null;this._fieldUsageInfo={};this.screenSizePerspectiveEnabled=!0;this.serviceItemId=void 0}normalizeCtorArgs(sa,Ha){return"string"===typeof sa?{url:sa,...Ha}:sa}destroy(){this._set("renderer",null)}getField(sa){return this.fieldsIndex.get(sa)}getFieldDomain(sa,Ha){return(Ha=this.getFeatureType(Ha?.feature)?.domains?.[sa])&&"inherited"!==Ha.type?Ha:this.getField(sa)?.domain??null}getFeatureType(sa){return sa&&this.associatedLayer?this.associatedLayer.getFeatureType(sa):
null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new ea(this.fields)}readNodePages(sa,Ha,Ka){"Point"===Ha.layerType&&(sa=Ha.pointNodePages);return null==sa||"object"!==typeof sa?null:ia.I3SNodePageDefinition.fromJSON(sa,Ka)}set elevationInfo(sa){this._set("elevationInfo",sa);
this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&ba.computeEffectiveEditingEnabled(this.associatedLayer)}get geometryType(){return wa[this.profile]||"mesh"}set renderer(sa){da.fixRendererFields(sa,this.fieldsIndex);this._set("renderer",sa)}readCachedDrawingInfo(sa){if(null==sa||"object"!==typeof sa)sa={};null==sa.color&&
(sa.color=!1);return sa}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(sa){sa=null!=sa?sa:Y.zeroCapabilities;const {query:Ha,queryRelated:Ka,editing:{supportsGlobalId:Aa,supportsRollbackOnFailure:Sa,supportsUploadWithItemId:Ya,supportsGeometryUpdate:qa,supportsReturnServiceEditsInSourceSpatialReference:aa},data:{supportsZ:Ja,supportsM:Ta,isVersioned:Ra,supportsAttachment:$a},operations:{supportsEditing:bb,
supportsAdd:pa,supportsUpdate:Ba,supportsDelete:Ia,supportsQuery:Wa,supportsQueryAttachments:gb,supportsAsyncConvert3D:ib}}=sa;sa=sa.operations.supportsChangeTracking;const La=!!this.associatedLayer?.infoFor3D&&Ma.sceneLayerEditingEnabled();return{query:Ha,queryRelated:Ka,editing:{supportsGlobalId:Aa,supportsReturnServiceEditsInSourceSpatialReference:aa,supportsRollbackOnFailure:Sa,supportsGeometryUpdate:La&&qa,supportsUploadWithItemId:Ya},data:{supportsAttachment:$a,supportsZ:Ja,supportsM:Ta,isVersioned:Ra},
operations:{supportsQuery:Wa,supportsQueryAttachments:gb,supportsEditing:bb&&sa,supportsAdd:La&&pa&&sa,supportsDelete:La&&Ia&&sa,supportsUpdate:Ba&&sa,supportsAsyncConvert3D:ib}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(sa){this._overrideIfSome("editingEnabled",sa)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||
this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(sa,Ha){!sa&&Ha.fields&&Ha.fields.some(Ka=>{"esriFieldTypeOID"===Ka.type&&(sa=Ka.name);return!!sa});return sa||void 0}readGlobalIdField(sa,Ha){!sa&&Ha.fields&&Ha.fields.some(Ka=>{"esriFieldTypeGlobalID"===Ka.type&&(sa=Ka.name);return!!sa});return sa||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(sa,Ha){sa=Ha.store.profile;if(null!=sa&&Ua[sa])return Ua[sa];n.getLogger(this).error("Unknown or missing profile",
{profile:sa,layer:this});return"mesh-pyramids"}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(sa){this._override("useViewTime",sa)}load(sa){this.addResolvingPromise(this._load(sa));return Promise.resolve(this)}async _load(sa){const Ha=null!=sa?sa.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},sa).catch(x.throwIfAbortError);await this._fetchService(Ha);await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,Ha),this._setAssociatedFeatureLayer(Ha),
this._loadFilterGeometries()]);this._validateElevationInfo();this._applyAssociatedLayerOverrides();this._populateFieldUsageInfo();await this.loadTimeInfoFromService(sa);await Da.loadStyleRenderer(this,{origin:"service"},Ha);da.fixRendererFields(this.renderer,this.fieldsIndex);await this.finishLoadEditablePortalLayer(sa)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(sa){n.getLogger(this).error("#_loadFilterGeometries()",
this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:sa}),this.filter=null}}createQuery(){const sa=new ra;"mesh"===this.geometryType?this.associatedLayer?.infoFor3D&&(sa.returnGeometry=!0):(sa.returnGeometry=!0,sa.returnZ=!0);sa.where=this.definitionExpression||"1\x3d1";sa.sqlFormat="standard";sa.outFields=["*"];return sa}queryExtent(sa,Ha){return this._getAssociatedLayerForQuery().then(Ka=>Ka.queryExtent(sa||this.createQuery(),Ha))}queryFeatureCount(sa,
Ha){return this._getAssociatedLayerForQuery().then(Ka=>Ka.queryFeatureCount(sa||this.createQuery(),Ha))}queryFeatures(sa,Ha){return this._getAssociatedLayerForQuery().then(Ka=>Ka.queryFeatures(sa||this.createQuery(),Ha)).then(Ka=>{if(Ka?.features)for(const Aa of Ka.features)Aa.layer=this,Aa.sourceLayer=this;return Ka})}async queryRelatedFeatures(sa,Ha){await this.load();if(!this.associatedLayer)throw new r("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",
{layer:this});return this.associatedLayer.queryRelatedFeatures(sa,Ha)}async queryRelatedFeaturesCount(sa,Ha){await this.load();if(!this.associatedLayer)throw new r("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(sa,Ha)}async queryCachedAttributes(sa,Ha){const Ka=da.unpackFieldNames(this.fieldsIndex,await Ea.getRequiredFields(this,Ea.getFetchPopupTemplate(this)));return Qa.queryAttributesFromCachedAttributesId(this.parsedUrl?.path??
"",this.attributeStorageInfo??[],sa,Ha,Ka,this.apiKey,this.customParameters)}async queryCachedFeature(sa,Ha){sa=await this.queryCachedAttributes(sa,[Ha]);if(!sa||0===sa.length)throw new r("scenelayer:feature-not-in-cached-data","Feature not found in cached data");Ha=new q;Ha.attributes=sa[0];Ha.layer=this;Ha.sourceLayer=this;return Ha}queryObjectIds(sa,Ha){return this._getAssociatedLayerForQuery().then(Ka=>Ka.queryObjectIds(sa||this.createQuery(),Ha))}queryAttachments(sa,Ha){return this._getAssociatedLayerForQuery().then(Ka=>
Ka.queryAttachments(sa,Ha))}getFieldUsageInfo(sa){const Ha={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[sa]||Ha:(n.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),Ha)}createPopupTemplate(sa){return Ga.createPopupTemplate(this,sa)}_getAssociatedLayerForQuery(){const sa=this.associatedLayer;return sa?.loaded?Promise.resolve(sa):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){await this.load();
if(!this.associatedLayer)throw new r("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(sa){throw new r("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:sa});}return this.associatedLayer}hasCachedStatistics(sa){return null!=this.statisticsInfo&&this.statisticsInfo.some(Ha=>Ha.name===sa)}async queryCachedStatistics(sa,Ha){await this.load(Ha);
return await this.fetchStatistics(sa,Ha)}async saveAs(sa,Ha){return this._debouncedSaveOperations(Q.SaveOperationType.SAVE_AS,{...Ha,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},sa)}async save(){return this._debouncedSaveOperations(Q.SaveOperationType.SAVE,{getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"})}async applyEdits(sa,Ha){const {applyEdits:Ka}=await new Promise((aa,Ja)=>a(["./graphics/editingSupport"],aa,Ja));await this.load();const Aa=this.associatedLayer;
if(!Aa)throw new r(`${this.type}-layer:not-editable`,"Service is not editable");await Aa.load();const {globalIdField:Sa}=Aa,Ya=!!Aa.infoFor3D,qa=Ha?.globalIdUsed??!0;if(Ya&&null==Sa)throw new r(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(Ya&&!qa)throw new r(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");V.isHostedAgolService(Aa.url)&&Ya&&null!=sa.deleteFeatures&&null!=Sa&&(Ha=
{...Ha,globalIdToObjectId:await ba.getGlobalIdToObjectIdMap(Aa,sa.deleteFeatures,Sa)});return Ka(this,Aa.source,sa,Ha)}async uploadAssets(sa,Ha){await this.load();if(null==this.associatedLayer)throw new r(`${this.type}-layer:not-editable`,"Service is not editable");await this.associatedLayer.load();return this.associatedLayer.uploadAssets(sa,Ha)}on(sa,Ha){return super.on(sa,Ha)}async convertMesh(sa,Ha){var Ka=Sa=>{n.getLogger(this).error(".convertMesh()",Sa.message);throw Sa;};await this.load();this.infoFor3D||
Ka(new r("invalid:layer","SceneLayer has no capability for mesh conversion"));sa=await this.extractAndFilterFiles(sa);const Aa=sa.reduce((Sa,Ya)=>ka.isFileEditFormat(this.infoFor3D,Ya)?Sa+1:Sa,0);0===Aa&&Ka(new I.NoModelError);1<Aa&&Ka(new I.MultipleModelsError);Ka=this.spatialReference;Ka=Ha?.location??new E({x:0,y:0,z:0,spatialReference:Ka});sa=N.createWithExternalSource(Ka,sa,{vertexSpace:Ka.spatialReference.isGeographic?"local":"georeferenced"});[Ha]=await this.uploadAssets([sa],Ha);return Ha}async extractAndFilterFiles(sa){await this.load();
const Ha=this.infoFor3D;return Ha?(await Pa.extractZipFiles(sa)).filter(Ka=>ka.isFileSupported(Ha,Ka)):sa}validateLayer(sa){if(sa.layerType&&!Na.has(sa.layerType))throw new r("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:sa.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new r("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});
if(2<this.version.major)throw new r("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});sa=this.normalReferenceFrame;var Ha=this.spatialReference;let Ka=!1,Aa=!1;if(null==sa)Aa=Ka=!0;else switch(Ha=Ha&&Ha.isGeographic,sa){case "east-north-up":case "earth-centered":Ka=!0;Aa=Ha;break;case "vertex-reference-frame":Ka=!0;Aa=!Ha;break;default:Ka=!1}if(!Ka)throw new r("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");
if(!Aa)throw new r("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.");}_getTypeKeywords(){const sa=[];if("points"===this.profile)sa.push("Point");else if("mesh-pyramids"===this.profile)sa.push("3DObject");else throw new r("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);return sa}_populateFieldUsageInfo(){this._fieldUsageInfo={};if(this.fields)for(const sa of this.fields){const Ha=
!!this.attributeStorageInfo?.some(Aa=>Aa.name===sa.name),Ka=!!this.associatedLayer?.fields?.some(Aa=>Aa&&sa.name===Aa.name);this._fieldUsageInfo[sa.name]={supportsLabelingInfo:Ha,supportsRenderer:Ha,supportsPopupTemplate:Ha||Ka,supportsLayerQuery:Ka}}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides();this._applyAssociatedLayerPopupOverrides();this._applyAssociatedLayerExtentOverride();this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(this.associatedLayer?.fields){var sa=
null;for(const Ha of this.associatedLayer.fields){const Ka=this.getField(Ha.name);Ka?(!Ka.domain&&Ha.domain&&(Ka.domain=Ha.domain.clone()),Ka.editable=Ha.editable,Ka.nullable=Ha.nullable,Ka.length=Ha.length):(sa||=this.fields?this.fields.slice():[],sa.push(Ha.clone()))}sa&&this._set("fields",sa)}}_applyAssociatedLayerPopupOverrides(){if(this.associatedLayer){var sa=["popupTemplate","popupEnabled"],Ha=C.getProperties(this);for(let Ka=0;Ka<sa.length;Ka++){const Aa=sa[Ka],Sa=this.originIdOf(Aa),Ya=this.associatedLayer.originIdOf(Aa);
Sa<Ya&&(Ya===H.OriginId.SERVICE||Ya===H.OriginId.PORTAL_ITEM)&&Ha.setAtOrigin(Aa,this.associatedLayer[Aa],Ya)}}}_applyAssociatedLayerExtentOverride(){const sa=this.associatedLayer?.getAtOrigin("fullExtent","service");Ma.sceneLayerEditingEnabled()&&null!=this.associatedLayer?.infoFor3D&&sa&&V.isHostedAgolService(this.associatedLayer?.url)&&za.cacheIsOutOfSync(this)&&C.getProperties(this).setAtOrigin("fullExtent",sa.clone(),H.OriginId.SERVICE)}_applyAssociatedLayerPrivileges(){const sa=this.associatedLayer;
sa&&(this._set("userHasEditingPrivileges",sa.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",sa.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",sa.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(sa){if(["mesh-pyramids","points"].includes(this.profile))try{const {serverUrl:Ha,layerId:Ka,portalItem:Aa}=await T.findAssociatedFeatureService(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,
apiKey:this.apiKey,signal:sa});this.associatedLayer=new (await la.layerLookupMap.FeatureLayer())({url:Ha,customParameters:this.customParameters,layerId:Ka,portalItem:Aa});await this.associatedLayer.load()}catch(Ha){x.isAbortError(Ha)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await y.whenOnce(()=>this.popupEnabled&&null!=this.popupTemplate);const sa=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?n.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${sa}`):
n.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${sa}`)}_validateElevationInfo(){const sa=this.elevationInfo;"mesh-pyramids"===this.profile&&xa.logInvalidElevationInfoWarning(n.getLogger(this),xa.elevationModeUnsupportedMessage("Mesh scene layers","relative-to-scene",sa));xa.logInvalidElevationInfoWarning(n.getLogger(this),xa.featureExpressionUnsupportedMessage("Scene layers",sa))}async fetchStatistics(sa,Ha){return await ya.fetchStatistics({fieldName:sa,
statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:Ha?.signal})}};b.__decorate([z.property({types:{key:"type",base:U.FeatureReduction,typeMap:{selection:Z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],v.prototype,"featureReduction",void 0);b.__decorate([z.property({type:[na.RangeInfo],
json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],v.prototype,"rangeInfos",void 0);b.__decorate([z.property({json:{read:!1}})],v.prototype,"associatedLayer",void 0);b.__decorate([z.property({type:["show","hide"]})],v.prototype,"listMode",void 0);b.__decorate([z.property({type:["ArcGISSceneServiceLayer"]})],v.prototype,"operationalLayerType",void 0);b.__decorate([z.property({json:{read:!1},readOnly:!0})],
v.prototype,"type",void 0);b.__decorate([z.property({...p.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],v.prototype,"fields",void 0);b.__decorate([z.property()],v.prototype,"types",null);b.__decorate([z.property()],v.prototype,"typeIdField",null);b.__decorate([z.property()],v.prototype,"templates",null);b.__decorate([z.property()],v.prototype,"formTemplate",null);b.__decorate([z.property({readOnly:!0,clonable:!1})],v.prototype,"fieldsIndex",null);b.__decorate([z.property({type:ja,
json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],v.prototype,"floorInfo",void 0);b.__decorate([z.property(p.outFields)],v.prototype,"outFields",void 0);b.__decorate([z.property({type:ia.I3SNodePageDefinition,readOnly:!0,json:{read:!1}})],v.prototype,"nodePages",void 0);b.__decorate([D.reader("service","nodePages",["nodePages","pointNodePages"])],v.prototype,"readNodePages",null);b.__decorate([z.property({type:[ia.I3SMaterialDefinition],readOnly:!0})],
v.prototype,"materialDefinitions",void 0);b.__decorate([z.property({type:[ia.I3STextureSetDefinition],readOnly:!0})],v.prototype,"textureSetDefinitions",void 0);b.__decorate([z.property({type:[ia.I3SGeometryDefinition],readOnly:!0})],v.prototype,"geometryDefinitions",void 0);b.__decorate([z.property({readOnly:!0})],v.prototype,"serviceUpdateTimeStamp",void 0);b.__decorate([z.property({readOnly:!0})],v.prototype,"attributeStorageInfo",void 0);b.__decorate([z.property({readOnly:!0})],v.prototype,"statisticsInfo",
void 0);b.__decorate([z.property({type:m.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],v.prototype,"excludeObjectIds",void 0);b.__decorate([z.property({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],v.prototype,"definitionExpression",void 0);b.__decorate([z.property({type:va,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,
allowNull:!0},origins:{service:{read:!1,write:!1}}}})],v.prototype,"filter",void 0);b.__decorate([z.property({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],v.prototype,"path",void 0);b.__decorate([z.property(ha.elevationInfo)],v.prototype,"elevationInfo",null);b.__decorate([z.property({readOnly:!0,json:{read:!1}})],v.prototype,"effectiveCapabilities",null);b.__decorate([z.property({readOnly:!0})],v.prototype,"effectiveEditingEnabled",null);b.__decorate([z.property({type:String})],
v.prototype,"geometryType",null);b.__decorate([z.property(ha.labelsVisible)],v.prototype,"labelsVisible",void 0);b.__decorate([z.property({type:[fa],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:X.reader},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:X.reader},write:!0}})],v.prototype,"labelingInfo",void 0);b.__decorate([z.property(ha.legendEnabled)],v.prototype,"legendEnabled",void 0);b.__decorate([z.property({type:Number,json:{origins:{"web-document":{default:1,
write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(sa,Ha){if("number"===typeof sa&&0<=sa&&1>=sa)return sa;sa=Ha.layerDefinition?.drawingInfo?.transparency;return void 0!==sa?ua.transparencyToOpacity(sa):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],v.prototype,"opacity",void 0);b.__decorate([z.property({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],
v.prototype,"priority",void 0);b.__decorate([z.property({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],v.prototype,"semantic",void 0);b.__decorate([z.property({types:w.webSceneRendererTypes,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],v.prototype,"renderer",null);b.__decorate([z.property({json:{read:!1}})],v.prototype,"cachedDrawingInfo",void 0);b.__decorate([D.reader("service","cachedDrawingInfo")],
v.prototype,"readCachedDrawingInfo",null);b.__decorate([z.property({readOnly:!0,json:{read:!1}})],v.prototype,"capabilities",null);b.__decorate([z.property({type:Boolean,json:{read:!1}})],v.prototype,"editingEnabled",null);b.__decorate([z.property({readOnly:!0,json:{write:!1,read:!1}})],v.prototype,"infoFor3D",null);b.__decorate([z.property({readOnly:!0,json:{write:!1,read:!1}})],v.prototype,"relationships",null);b.__decorate([z.property(ha.popupEnabled)],v.prototype,"popupEnabled",void 0);b.__decorate([z.property({type:l,
json:{name:"popupInfo",write:!0}})],v.prototype,"popupTemplate",void 0);b.__decorate([z.property({readOnly:!0,json:{read:!1}})],v.prototype,"defaultPopupTemplate",null);b.__decorate([z.property({type:String,json:{read:!1}})],v.prototype,"objectIdField",void 0);b.__decorate([D.reader("service","objectIdField",["objectIdField","fields"])],v.prototype,"readObjectIdField",null);b.__decorate([z.property({type:String,json:{read:!1}})],v.prototype,"globalIdField",void 0);b.__decorate([D.reader("service",
"globalIdField",["globalIdField","fields"])],v.prototype,"readGlobalIdField",null);b.__decorate([z.property({readOnly:!0,type:String,json:{read:!1}})],v.prototype,"displayField",null);b.__decorate([z.property({type:String,json:{read:!1}})],v.prototype,"profile",void 0);b.__decorate([D.reader("service","profile",["store.profile"])],v.prototype,"readProfile",null);b.__decorate([z.property({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],v.prototype,
"normalReferenceFrame",void 0);b.__decorate([z.property(ha.screenSizePerspectiveEnabled)],v.prototype,"screenSizePerspectiveEnabled",void 0);b.__decorate([z.property({json:{read:!1,origins:{service:{read:!0}}}})],v.prototype,"serviceItemId",void 0);b.__decorate([z.property(W.useViewTimeProperty)],v.prototype,"useViewTime",null);v=b.__decorate([F.subclass("esri.layers.SceneLayer")],v);const Ua={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points",
"features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},wa={"mesh-pyramids":"mesh",points:"point"};return v})},"esri/geometry/Mesh":function(){define("require ../chunks/tslib.es6 ../core/deprecate ../core/Error ../core/Loadable ../core/Logger ../core/Promise ../core/promiseUtils ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/has ../core/RandomLCG ../core/accessorSupport/decorators/subclass ../core/libs/gl-matrix-2/factories/vec3f64 ./Extent ./Geometry ./Point ./Polygon ./support/axisAngleDegrees ./support/MeshComponent ./support/meshErrors ./support/MeshGeoreferencedVertexSpace ./support/MeshLocalVertexSpace ./support/MeshTransform ./support/MeshVertexAttributes ./support/meshVertexSpaceUtils ./support/triangulationUtils ./support/meshUtils/bounds ./support/meshUtils/centerAt ./support/meshUtils/loadExternal ./support/meshUtils/Metadata ./support/meshUtils/primitives ./support/meshUtils/rotate ./support/meshUtils/scale".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L){function P(){return k.getLogger("esri.geometry.Mesh")}var M;g={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:z,local:A}};p=M=class extends p.LoadableMixin(h.EsriPromiseMixin(m)){constructor(J){super(J);this.components=null;this.vertexSpace=new z;this.transform=null;this.metadata=new G.Metadata;this.hasZ=!0;this.hasM=!1;this.vertexAttributes=new C.MeshVertexAttributes;this.type="mesh"}initialize(){if(0===
this.metadata.externalSources.length||this.vertexAttributes.position.length)this.loadStatus="loaded";this.when(()=>{this.addHandles(c.watch(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(J=>J.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?0<this.vertexAttributes.position.length&&(!this.components||0<this.components.length):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const {components:J,spatialReference:R,
vertexAttributes:Q,vertexSpace:W}=this,S=Q.position;if(0===S.length||J&&0===J.length)return new v({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:R});if(D.isRelativeVertexSpace(W)){const {_untransformedBounds:V,transform:T}=this;return H.getExtentFromBounds(V,T,W,R)}return H.getExtentFromPositions(S,R)}get _untransformedBounds(){return H.getBoundsFromPositions(this.vertexAttributes.position)}get anchor(){const J=D.vertexSpaceOriginToPoint(this.vertexSpace,this.spatialReference);if(null!=
J)return J;const {center:R,zmin:Q}=this._transformedExtent;return new r({x:R.x,y:R.y,z:Q,spatialReference:this.spatialReference})}get origin(){const J=D.vertexSpaceOriginToPoint(this.vertexSpace,this.spatialReference);return null!=J?J:this._transformedExtent.center}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(J){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),
this.components.push(x.from(J)),this.notifyChange("components"))}removeComponent(J){if(this._checkIfLoaded("removeComponent()")){if(this.components&&(J=this.components.indexOf(J),-1!==J)){this.components.splice(J,1);this.notifyChange("components");return}P().error("removeComponent()",y.componentNotFoundMessage)}}rotate(J,R,Q,W){u.composeAxes(J,R,Q,K);O.rotate(this,K,W);return this}offset(J,R,Q){if(!this._checkIfLoaded("offset()"))return this;const {vertexSpace:W,vertexAttributes:S}=this,V=S?.position;
if(!V)return this;if(D.isRelativeVertexSpace(W)){const [T,Y,ha]=W.origin;W.origin=w.fromValues(T+J,Y+R,ha+Q)}else{for(let T=0;T<V.length;T+=3)V[T]+=J,V[T+1]+=R,V[T+2]+=Q;this.vertexAttributesChanged()}return this}scale(J,R){if(!this._checkIfLoaded("scale()"))return this;L.scale(this,J,R);return this}centerAt(J,R){if(!this._checkIfLoaded("centerAt()"))return this;N.centerAt(this,J,R);return this}load(J){const {metadata:{displaySource:R}}=this;R&&this.addResolvingPromise(E.loadExternal(this,R,J));return Promise.resolve(this)}addExternalSources(J){this.metadata.externalSources.addMany(J)}updateDisplaySource(J){this.metadata.displaySource=
J}clone(){return this.cloneAndModifyVertexAttributes(this.vertexAttributes.clone(),this.vertexSpace.clone())}cloneAndModifyVertexAttributes(J,R){let Q=null;if(this.components){const W=new Map,S=new Map;Q=this.components.map(V=>V.cloneWithDeduplication(W,S))}J={components:Q,spatialReference:this.spatialReference,vertexAttributes:J,vertexSpace:R,transform:this.transform?.clone()??null,metadata:this.metadata.clone()};return new M(J)}cloneShallow(){return new M({components:this.components,spatialReference:this.spatialReference,
vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(J){const [{toBinaryGLTF:R}]=await Promise.all([new Promise((Q,W)=>a(["./support/meshUtils/exporters/gltf/gltfexport"],Q,W)),this.load(J)]);f.throwIfAborted(J);return await R(this,J)}get memoryUsage(){let J;J=0+this.vertexAttributes.memoryUsage;if(null!=this.components)for(const R of this.components)J+=
R.memoryUsage;return J}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(J){return this.loaded?!0:(P().error(J,y.meshNotLoadedMessage),!1)}static createBox(J,R){if(!(J instanceof r))return P().error(".createBox()",y.invalidLocationMessage),null;J=new M(I.convertUnitGeometry(I.createUnitSizeBox(),J,R));return R?.imageFace&&"all"!==R.imageFace?I.extractSingleFaceOfBox(J,R.imageFace):J}static createSphere(J,R){return J instanceof r?new M(I.convertUnitGeometry(I.createUnitSizeSphere(R?.densificationFactor||
0),J,R)):(P().error(".createSphere()",y.invalidLocationMessage),null)}static createCylinder(J,R){return J instanceof r?new M(I.convertUnitGeometry(I.createUnitSizeCylinder(R?.densificationFactor||0),J,R)):(P().error(".createCylinder()",y.invalidLocationMessage),null)}static createPlane(J,R){if(!(J instanceof r))return P().error(".createPlane()",y.invalidLocationMessage),null;const Q=R?.facing??"up",W=I.convertPlaneSizeParameter(Q,R?.size);return new M(I.convertUnitGeometry(I.createUnitSizePlane(Q),
J,{...R,size:W}))}static createFromPolygon(J,R){if(!(J instanceof n))return P().error(".createFromPolygon()",y.invalidPolygonMessage),null;const Q=F.triangulate(J);return new M({vertexAttributes:new C.MeshVertexAttributes({position:Q.position}),components:[new x({faces:Q.faces,shading:"flat",material:R?.material??null})],spatialReference:J.spatialReference,vertexSpace:new z})}static async createFromGLTF(J,R,Q){if(!(J instanceof r))throw J=new y.InvalidLocationError,P().error(".createfromGLTF()",J.message),
J;const {loadGLTFMesh:W}=await f.whenOrAbort(new Promise((S,V)=>a(["./support/meshUtils/loadGLTFMesh"],S,V)),Q);return new M(await W(J,R,Q))}static async createFromFiles(J,R,Q){q.deprecatedFunction(P(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});if(!(J instanceof r))throw J=R=new y.InvalidLocationError,P().error(".createFromFiles()",J.message),R;if(!Q?.layer)throw new l("invalid:no-layer","SceneLayer required for file to mesh conversion.");
return Q.layer.convertMesh(R,{location:J,...Q})}static createWithExternalSource(J,R,Q){var W=Q?.extent??null;const {spatialReference:S}=J,V=Q?.transform?.clone()??new B;J=D.selectVertexSpace(J,Q);R={source:R,extent:W};W=new G.Metadata;W.externalSources.push(R);return new M({metadata:W,transform:V,vertexSpace:J,spatialReference:S})}static createIncomplete(J,R){var {spatialReference:Q}=J;const W=R?.transform?.clone()??new B;J=D.selectVertexSpace(J,R);Q=new M({transform:W,vertexSpace:J,spatialReference:Q});
Q.addResolvingPromise(Promise.reject(new l("mesh-incomplete","Mesh resources are not complete")));return Q}};b.__decorate([e.property({type:[x],json:{write:!0}})],p.prototype,"components",void 0);b.__decorate([e.property({nonNullable:!0,types:g,constructOnly:!0,json:{write:!0}})],p.prototype,"vertexSpace",void 0);b.__decorate([e.property({type:B,json:{write:!0}})],p.prototype,"transform",void 0);b.__decorate([e.property({constructOnly:!0})],p.prototype,"metadata",void 0);b.__decorate([e.property()],
p.prototype,"hasExtent",null);b.__decorate([e.property()],p.prototype,"_transformedExtent",null);b.__decorate([e.property()],p.prototype,"_untransformedBounds",null);b.__decorate([e.property()],p.prototype,"anchor",null);b.__decorate([e.property()],p.prototype,"origin",null);b.__decorate([e.property({readOnly:!0,json:{read:!1}})],p.prototype,"extent",null);b.__decorate([e.property({readOnly:!0,json:{read:!1,write:!0,default:!0}})],p.prototype,"hasZ",void 0);b.__decorate([e.property({readOnly:!0,json:{read:!1,
write:!0,default:!1}})],p.prototype,"hasM",void 0);b.__decorate([e.property({type:C.MeshVertexAttributes,nonNullable:!0,json:{write:!0}})],p.prototype,"vertexAttributes",void 0);p=M=b.__decorate([t.subclass("esri.geometry.Mesh")],p);const K=u.create();return p})},"esri/geometry/support/meshErrors":function(){define(["exports","../../core/Error"],function(a,b){class q extends b{constructor(){super("invalid-input:location","Expected location to be a Point instance")}}a.InvalidLocationError=q;a.componentNotFoundMessage=
"Provided component is not part of the list of components";a.invalidLocationMessage="Expected location to be a Point instance";a.invalidPolygonMessage="Expected polygon to be a Polygon instance";a.meshNotLoadedMessage="Mesh must be loaded before applying operations";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/bounds":function(){define(["exports","../../Extent","../aaBoundingBox","./projection"],function(a,b,q,l){function p(f){if(0===f.length)return q.zero;
const c=q.create([Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,-Number.POSITIVE_INFINITY,-Number.POSITIVE_INFINITY,-Number.POSITIVE_INFINITY]);q.expandWithBuffer(c,f);return c}function k(f,c){const [e,g,d,t,w,v]=p(f);return new b({xmin:e,ymin:g,zmin:d,xmax:t,ymax:w,zmax:v,spatialReference:c})}let h=null;a.getBoundsFromPositions=p;a.getExtentFromBounds=function([f,c,e,g,d,t],w,v,m){h??=new Float64Array(24);const r=h;r[0]=f;r[1]=c;r[2]=e;r[3]=f;r[4]=d;r[5]=e;r[6]=g;r[7]=
d;r[8]=e;r[9]=g;r[10]=c;r[11]=e;r[12]=f;r[13]=c;r[14]=t;r[15]=f;r[16]=d;r[17]=t;r[18]=g;r[19]=d;r[20]=t;r[21]=g;r[22]=c;r[23]=t;l.project({positions:r,transform:w,vertexSpace:v,inSpatialReference:m,outSpatialReference:m,outPositions:r});return k(r,m)};a.getExtentFromPositions=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/centerAt":function(){define("exports ../../../core/Logger ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../projection/projectPointToVector ../MeshGeoreferencedVertexSpace ../MeshLocalVertexSpace ../meshVertexSpaceUtils ./geographicUtils ./projection ./vertexSpaceConversion".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){const d=()=>b.getLogger("esri.geometry.support.meshUtils.centerAt"),t=l.create(),w=l.create(),v=l.create();a.centerAt=function(m,r,n){if(m.vertexAttributes?.position){var {vertexSpace:u}=m,x=n?.origin??m.anchor;n=c.performGlobalOperation(d,u,x.spatialReference,n?.geographic);if(f.isRelativeVertexSpace(u))({vertexSpace:u}=m),f.isRelativeVertexSpace(u)&&(p.projectPointToVector(r,t,m.spatialReference)?p.projectPointToVector(x,w,m.spatialReference)?(m=q.subtract(v,t,w),
u.origin=q.add(l.create(),u.origin,m)):(r=m.origin,w[0]=r.x,w[1]=r.y,w[2]=r.z,e.logProjectionError(d(),x.spatialReference,m.spatialReference,e.loadProjectErrorMessage)):e.logProjectionError(d(),r.spatialReference,m.spatialReference,e.loadProjectErrorMessage));else if(n){if(x=l.fromValues(x.x,x.y,x.z??0),x=g.convertVertexSpace(m,new h({origin:x})))if(r=l.fromValues(r.x,r.y,r.z??0),r=g.convertVertexSpace({vertexAttributes:x,spatialReference:m.spatialReference,vertexSpace:new h({origin:r})},new k)){var {position:y,
normal:z,tangent:A}=r;m.vertexAttributes.position=y;m.vertexAttributes.normal=z;m.vertexAttributes.tangent=A;m.vertexAttributesChanged()}}else if(p.projectPointToVector(r,t,m.spatialReference))if(p.projectPointToVector(x,w,m.spatialReference)){if(r=m.vertexAttributes.position)for(x=0;x<r.length;x+=3)for(u=0;3>u;u++)r[x+u]+=t[u]-w[u];m.vertexAttributesChanged()}else r=m.origin,w[0]=r.x,w[1]=r.y,w[2]=r.z,e.logProjectionError(d(),x.spatialReference,m.spatialReference,e.loadProjectErrorMessage);else e.logProjectionError(d(),
r.spatialReference,m.spatialReference,e.loadProjectErrorMessage)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/geographicUtils":function(){define(["exports","../../../core/deprecate","../meshVertexSpaceUtils"],function(a,b,q){a.isGlobal=function(l,p){return l.isGeographic||l.isWebMercator&&(p??!0)};a.performGlobalOperation=function(l,p,k,h){if(void 0!==h){b.deprecated(l(),"option: geographic",{replacement:"Use mesh `vertexSpace` and spatial reference to control how operations are performed instead.",
version:"4.30",warnOnce:!0});const f="local"===p.type;if(q.isRelativeVertexSpace(p)&&h!==f)l().warnOnce(`Specifying the 'geographic' parameter (${h}) for a Mesh vertex space of type "${p.type}" is not supported. This parameter will be ignored.`);else return k.isGeographic||k.isWebMercator&&h}switch(p.type){case "georeferenced":return k.isGeographic;case "local":return k.isGeographic||k.isWebMercator}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/vertexSpaceConversion":function(){define("exports ../../../core/Logger ../../../core/mathUtils ../../../core/unitUtils ../../../core/libs/gl-matrix-2/math/mat3 ../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../spatialReferenceEllipsoidUtils ../../projection/computeTranslationToOriginAndRotation ../../projection/projectPointToVector ../meshVertexSpaceUtils ../../../chunks/vec3 ./projection".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r({vertexAttributes:G,transform:I,spatialReference:O},{origin:L},P,M){const {position:K,normal:J,tangent:R}=I?y(G,I.localMatrix):G,Q=new Float64Array(K.length);I=K;L&&(I=v.translate(Q,I,L));P&&(L=c.negate(H,P),I=v.translate(Q,I,L));z(O,M,E.NONE);O=M?.allowBufferReuse;return{position:I!==G.position||O?I:I.slice(),normal:J!==G.normal||O?J:J?.slice(),tangent:R!==G.tangent||O?R:R?.slice()}}function n({spatialReference:G,vertexAttributes:I,transform:O},
{origin:L},P,M){var K=g.getSphericalPCPF(G);if(!d.computeTranslationToOriginAndRotation(G,L,C,K))return m.logProjectionError(B(),G,K),null;O&&h.multiply(C,C,O.localMatrix);O=C;M=z(G,M,E.SOURCE);1!==M&&h.scale(O,O,[M,M,M]);M=new Float64Array(I.position.length);O=I.position;v.transformMat4(M,O,C);O=new Float64Array(O.length);m.projectFromPCPF(M,O,G)||(m.logProjectionError(B(),g.getSphericalPCPF(G),G),O=null);if(!O)return null;L=I.normal;K=C;if(null==L)L=null;else{var J=new Float32Array(L.length);m.transformNormal(L,
J,K);m.projectNormalFromPCPF(J,O,M,G,J)?L=J:(m.logProjectionError(B(),g.getSphericalPCPF(G),G),L=null)}if(I.normal&&!L)return null;K=I.tangent;J=C;if(null==K)G=null;else{var R=new Float32Array(K.length);m.transformTangent(K,R,J);m.projectTangentFromPCPF(R,O,M,G,R)?G=R:(m.logProjectionError(B(),g.getSphericalPCPF(G),G),G=null)}if(I.tangent&&!G)return null;P&&(I=c.negate(H,P),v.translate(O,O,I));return{position:O,normal:L,tangent:G}}function u({vertexAttributes:G,spatialReference:I,transform:O},{origin:L},
P,M){const K=g.getSphericalPCPF(I);if(!d.computeTranslationToOriginAndRotation(I,P,C,K))return m.logProjectionError(B(),I,K),null;P=1/z(I,M,E.TARGET);h.scale(C,C,[P,P,P]);P=h.invert(D,C);if(L)if(O)O=y(G,O.localMatrix),v.translate(O.position,O.position,L),L=O;else{const {position:W,normal:S,tangent:V}=G;L={position:v.translate(new Float64Array(W.length),W,L),tangent:V,normal:S}}else L=G;const {position:J,normal:R,tangent:Q}=L;L=new Float64Array(J.length);(M=m.projectToPCPF(J,I,L))?(O=new Float64Array(M.length),
v.transformMat4(O,M,P)):(m.logProjectionError(B(),I,g.getSphericalPCPF(I)),O=null);if(!O)return null;P=p.normalFromMat4(F,P);null==R?M=null:(M=(R!==G.normal?R:void 0)??new Float32Array(R.length),m.projectNormalToPCPF(R,J,L,I,M)?v.transformMat3(M,M,P):(m.logProjectionError(B(),I,g.getSphericalPCPF(I)),M=null));if(!M&&R)return null;null==Q?I=null:(G=(Q!==G.tangent?Q:void 0)??new Float32Array(Q.length),m.projectTangentToPCPF(Q,J,L,I,G)?(v.transformMat3(G,G,P,4),I=G):(m.logProjectionError(B(),I,g.getSphericalPCPF(I)),
I=null));return!I&&Q?null:{position:O,normal:M,tangent:I}}function x({vertexAttributes:G,spatialReference:I,transform:O},{origin:L},P,M){const K=g.getSphericalPCPF(I);if(!d.computeTranslationToOriginAndRotation(I,L,C,K))return m.logProjectionError(B(),I,K),null;O&&h.multiply(C,C,O.localMatrix);if(!d.computeTranslationToOriginAndRotation(I,P,D,K))return m.logProjectionError(B(),K,I),null;h.invert(D,D);O=h.multiply(C,D,C);I=z(I,M,E.SOURCE|E.TARGET);1!==I&&h.scale(O,O,[I,I,I]);return y(G,O)}function y(G,
I){const O=new Float64Array(G.position.length);v.transformMat4(O,G.position,I);const L=G.normal?new Float32Array(G.normal.length):null,P=G.tangent?new Float32Array(G.tangent.length):null;L&&G.normal&&m.transformNormal(G.normal,L,I);P&&G.tangent&&m.transformTangent(G.tangent,P,I);return{position:O,normal:L,tangent:P}}function z(G,I,O){const L=!!(O&E.SOURCE);O=!!(O&E.TARGET);const P=I?.sourceUnit;I=I?.targetUnit;if(!P&&!I)return 1;let M=A(P,G);!L&&P&&1!==M&&(B().warn("source unit conversion not supported"),
M=1);G=1/A(I,G);!O&&I&&1!==G&&(B().warn("target unit conversion not supported"),G=1);return M*G}function A(G,I){if(null==G)return 1;I=l.getMetersPerCartesianUnitForSR(I);return 1/l.convertUnit(I,"meters",G)}const B=()=>b.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion"),C=f.create(),D=f.create(),F=k.create(),H=e.create(),N=f.create();var E;(function(G){G[G.NONE=0]="NONE";G[G.SOURCE=1]="SOURCE";G[G.TARGET=2]="TARGET"})(E||={});a.convertVertexSpace=function(G,I,O){const {vertexSpace:L,
transform:P,vertexAttributes:M}=G,K=z(G.spatialReference,O,E.SOURCE|E.TARGET);if(w.vertexSpaceEquals(L,I)&&(!P||h.exactEquals(P.localMatrix,f.IDENTITY))&&q.floatEqualUlp(K,1)){const {position:J,normal:R,tangent:Q}=M;G=O?.allowBufferReuse;return{position:G?J:J.slice(),normal:G?R:R?.slice(),tangent:G?Q:Q?.slice()}}switch(G.vertexSpace.type){case "local":return"local"===I.type?x(G,G.vertexSpace,I.origin,O):n(G,G.vertexSpace,I.origin,O);case "georeferenced":return"local"===I.type?u(G,G.vertexSpace,I.origin,
O):r(G,G.vertexSpace,I.origin,O)}};a.getUnitToSpatialReferenceScaleConversion=A;a.projectPointToVertexSpace=function(G,I,{vertexSpace:O,spatialReference:L}){if("georeferenced"===O.type){if(!t.projectPointToVector(I,G,L))return!1;({origin:L}=O);c.subtract(G,G,L);return!0}const P=g.getSphericalPCPF(L);if(!t.projectPointToVector(I,G,P))return!1;({origin:I}=O);if(!d.computeTranslationToOriginAndRotation(L,I,N,P))return!1;L=h.invert(N,N);if(null==L)return!1;c.transformMat4(G,G,L);return!0};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/loadExternal":function(){define("require exports ../../../core/Error ../../../core/promiseUtils ../../../core/urlUtils ../../Point".split(" "),function(a,b,q,l,p,k){function h(u){const x=p.removeFile(u.url);return y=>{var z=p.makeRelative(y,x,x);return((z=z?z.replace(/^ *\.\//,""):null)?u.files.get(z):null)??y}}async function f(u,x){if(Array.isArray(u)){if(!u.length)throw new q("mesh-load-external:missing-assets","There must be at least one file to load");
return u[0]instanceof File?e(u):g(u,x)}return n.fromBlob(u,t(u.name,u.type))}async function c(u,x){const {parts:y,assetMimeType:z,assetName:A}=u;if(1===y.length)return new n(y[0].partUrl);u=await u.toBlob(x);l.throwIfAborted(x);return n.fromBlob(u,t(A,z))}function e(u){u=u.map(x=>({name:x.name,mimeType:x.type,source:n.fromBlob(x,t(x.name,x.type))}));return d(u)}async function g(u,x){u=await l.allSettledValues(u.map(async y=>{const z=await c(y);l.throwIfAborted(x);return{name:y.assetName,mimeType:y.assetMimeType,
source:z}}));if(l.isAborted(x))throw u.forEach(y=>y.source.dispose()),l.createAbortError();return d(u)}function d(u){const x=new Map;let y=null,z=void 0;for(const {name:A,mimeType:B,source:C}of u){if(null===y)if(w.test(B)||m.test(A))y=C.url,z="gltf";else if(v.test(B)||r.test(A))y=C.url,z="glb";x.set(A,C.url);C.files.forEach((D,F)=>x.set(F,D))}if(null==y)throw new q("mesh-load-external:missing-files","Missing files to load external mesh source");return new n(y,()=>u.forEach(({source:A})=>A.dispose()),
x,z)}function t(u,x){return w.test(x)||m.test(u)?"gltf":v.test(x)||m.test(u)?"glb":void 0}const w=/^model\/gltf\+json$/,v=/^model\/gltf-binary$/,m=/\.gltf$/i,r=/\.glb$/i;class n{constructor(u,x=()=>{},y=new Map,z){this.url=u;this.dispose=x;this.files=y;this.type=z}static fromBlob(u,x){const y=URL.createObjectURL(u);return new n(y,()=>URL.revokeObjectURL(y),void 0,x)}}b.loadExternal=async function(u,x,y){({source:x}=x);const {loadGLTFMesh:z}=await l.whenOrAbort(new Promise((D,F)=>a(["./loadGLTFMesh"],
D,F)),y),A=await f(x,y);l.throwIfAborted(y);y=z(new k({x:0,y:0,z:0,spatialReference:u.spatialReference}),A.url,{resolveFile:h(A),signal:y?.signal,expectedType:A.type});y.then(()=>A.dispose(),()=>A.dispose());const {vertexAttributes:B,components:C}=await y;u.vertexAttributes=B;u.components=C};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/Metadata":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Clonable ../../../core/Collection ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./External".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){a.Metadata=class extends q.Clonable{constructor(d){super(d);this.externalSources=new l;this._explicitDisplaySource=null;this.addHandles(p.on(()=>this.externalSources,"after-remove",({item:t})=>{t===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(d){if(null!=d&&!g.isDisplayExternal(d))throw Error("Cannot use this source for display: it is not in a supported format.");
(this._explicitDisplaySource=d)&&this.externalSources.every(t=>!g.externalSourcesAreEqual(t,d))&&this.externalSources.add(d)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(d){return this.externalSources.items.filter(t=>g.externalIsOnService(t,d))}get _implicitDisplaySource(){return this.externalSources.find(g.isDisplayExternal)}};b.__decorate([k.property()],a.Metadata.prototype,"externalSources",void 0);b.__decorate([k.property()],a.Metadata.prototype,"displaySource",
null);b.__decorate([k.property()],a.Metadata.prototype,"_implicitDisplaySource",null);b.__decorate([k.property()],a.Metadata.prototype,"_explicitDisplaySource",void 0);a.Metadata=b.__decorate([e.subclass("esri.geometry.support.meshUtils.Metadata")],a.Metadata);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/primitives":function(){define("exports ../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../MeshComponent ../MeshVertexAttributes ../meshVertexSpaceUtils ./vertexSpaceConversion".split(" "),
function(a,b,q,l,p,k,h,f){var c=[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],e=[0,0,1,0,0,1,0,0,1,0,0,1],g=[0,1,1,1,1,0,0,0],d=[0,1,2,0,2,3],t={east:[3,1,2],west:[-3,-1,2],north:[-1,3,2],south:[1,-3,2],up:[1,2,3],down:[1,-2,-3]};const w={faceDescriptions:[{axis:[0,-1,0],uvOrigin:[0,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[1,0,0],uvOrigin:[.25,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,1,0],uvOrigin:[.5,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[-1,0,0],uvOrigin:[.75,.625],
corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[0,0,1],uvOrigin:[0,.375],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,0,-1],uvOrigin:[0,.875],corners:[[-1,1],[1,1],[1,-1],[-1,-1]]}],uvScales:[[0,0],[1,0],[1,1],[0,1]],faceVertexOffsets:[0,1,2,0,2,3]},v={south:0,east:1,north:2,west:3,up:4,down:5},m=l.create(),r=b.create();a.boxFaceOrder=v;a.convertPlaneSizeParameter=function(n,u){const x="number"===typeof u?u:null!=u?u.width:1;u="number"===typeof u?u:null!=u?u.height:1;switch(n){case "up":case "down":return{width:x,
depth:u};case "north":case "south":return{width:x,height:u};case "east":case "west":return{depth:x,height:u}}};a.convertUnitGeometry=function(n,u,x){if(!n.isPlane)for(var y=0;y<n.position.length;y+=3)n.position[y+2]+=.5;y=x?.size;var z=f.getUnitToSpatialReferenceScaleConversion(x?.unit,u.spatialReference);null==y&&1===z?y=null:null==y?y=[z,z,z]:"number"===typeof y?(y*=z,y=[y,y,y]):y=[null!=y.width?y.width*z:z,null!=y.depth?y.depth*z:z,null!=y.height?y.height*z:z];if(null!=y){r[0]=y[0];r[4]=y[1];r[8]=
y[2];for(z=0;z<n.position.length;z+=3){for(var A=0;3>A;A++)m[A]=n.position[z+A];q.transformMat3(m,m,r);for(A=0;3>A;A++)n.position[z+A]=m[A]}if(y[0]!==y[1]||y[1]!==y[2])for(r[0]=1/y[0],r[4]=1/y[1],r[8]=1/y[2],y=0;y<n.normal.length;y+=3){for(z=0;3>z;z++)m[z]=n.normal[y+z];q.transformMat3(m,m,r);q.normalize(m,m);for(z=0;3>z;z++)n.normal[y+z]=m[z]}}y=h.selectVertexSpace(u,x);z=u.spatialReference.isGeographic?h.selectVertexSpace(u):y;z=f.convertVertexSpace({vertexAttributes:n,vertexSpace:z,spatialReference:u.spatialReference},
y,{allowBufferReuse:!0});return{vertexAttributes:new k.MeshVertexAttributes({...z,uv:n.uv}),vertexSpace:y,components:[new p({faces:n.faces,material:x?.material||null})],spatialReference:u.spatialReference}};a.createUnitSizeBox=function(){const {faceDescriptions:n,faceVertexOffsets:u,uvScales:x}=w;var y=4*n.length;const z=new Float64Array(3*y),A=new Float32Array(3*y);y=new Float32Array(2*y);const B=new Uint32Array(6*n.length);let C=0,D=0,F=0,H=0;for(let E=0;E<n.length;E++){const G=n[E];var N=C/3;for(const I of u)B[H++]=
N+I;N=G.corners;for(let I=0;4>I;I++){const O=N[I];let L=0;y[F++]=.25*x[I][0]+G.uvOrigin[0];y[F++]=G.uvOrigin[1]-.25*x[I][1];for(let P=0;3>P;P++)0!==G.axis[P]?(z[C++]=.5*G.axis[P],A[D++]=G.axis[P]):(z[C++]=.5*O[L++],A[D++]=0)}}return{position:z,normal:A,uv:y,faces:B}};a.createUnitSizeCylinder=function(n=0){n=Math.round(16*2**n);var u=4*(n+1)+2*n;const x=new Float64Array(3*u),y=new Float32Array(3*u);u=new Float32Array(2*u);const z=new Uint32Array(12*n);let A=0,B=0,C=0,D=0,F=0;for(let N=0;5>=N;N++){const E=
0===N||5===N,G=1>=N||4<=N,I=2===N||4===N,O=E?n-1:n;for(let L=0;L<=O;L++){var H=L/O*2*Math.PI;const P=E?0:.5;m[0]=P*Math.sin(H);m[1]=P*-Math.cos(H);m[2]=2>=N?.5:-.5;for(H=0;3>H;H++)x[A++]=m[H],G?y[B++]=2===H?1>=N?1:-1:0:y[B++]=2===H?0:m[H]/P;u[C++]=(L+(E?.5:0))/n;1>=N?u[C++]=1*N/3:3>=N?u[C++]=(N-2)/3+1/3:u[C++]=(N-4)/3+2/3;I||0===N||L===n||(5!==N&&(z[D++]=F,z[D++]=F+1,z[D++]=F-n),1!==N&&(z[D++]=F,z[D++]=F-n,z[D++]=F-n-1));F++}}return{position:x,normal:y,uv:u,faces:z}};a.createUnitSizePlane=function(n){n=
t[n];const u=new Float64Array(c.length),x=new Float32Array(e.length);let y=0;for(let A=0;4>A;A++){const B=y;for(let C=0;3>C;C++){var z=n[C];const D=Math.abs(z)-1;z=0<=z?1:-1;u[y]=c[B+D]*z;x[y]=e[B+D]*z;y++}}return{position:u,normal:x,uv:new Float32Array(g),faces:new Uint32Array(d),isPlane:!0}};a.createUnitSizeSphere=function(n=0){n=Math.round(8*2**n);const u=2*n;var x=(n-1)*(u+1)+2*u;const y=new Float64Array(3*x),z=new Float32Array(3*x);x=new Float32Array(2*x);const A=new Uint32Array((n-1)*u*6);let B=
0,C=0,D=0,F=0;for(let E=0;E<=n;E++){var H=E/n*Math.PI+.5*Math.PI;const G=Math.cos(H);m[2]=Math.sin(H);const I=(H=0===E||E===n)?u-1:u;for(let O=0;O<=I;O++){var N=O/I*2*Math.PI;m[0]=-Math.sin(N)*G;m[1]=Math.cos(N)*G;for(N=0;3>N;N++)y[B]=.5*m[N],z[B]=m[N],++B;x[C++]=(O+(H?.5:0))/u;x[C++]=E/n;0!==E&&O!==u&&(E!==n&&(A[D++]=F,A[D++]=F+1,A[D++]=F-u),1!==E&&(A[D++]=F,A[D++]=F-u,A[D++]=F-u-1));F++}}return{position:y,normal:z,uv:x,faces:A}};a.extractSingleFaceOfBox=function(n,u){const x=n.components[0];var y=
x.faces,z=v[u],A=6*z;u=Array(6);const B=Array(y.length-6);var C=0;let D=0;for(let F=0;F<y.length;F++)F>=A&&F<A+6?u[C++]=y[F]:B[D++]=y[F];if(null!=n.vertexAttributes.uv){y=new Float32Array(n.vertexAttributes.uv);z*=8;A=[0,1,1,1,1,0,0,0];for(C=0;C<A.length;C++)y[z+C]=A[C];n.vertexAttributes.uv=y}n.components=[new p({faces:u,material:x.material}),new p({faces:B})];return n};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/rotate":function(){define("exports ../../../core/Logger ../../../core/libs/gl-matrix-2/math/mat3 ../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/math/quat ../../../core/libs/gl-matrix-2/factories/quatf64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../Point ../../spatialReferenceEllipsoidUtils ../../projection/computeTranslationToOriginAndRotation ../../projection/projectPointToVector ../axisAngleDegrees ../MeshTransform ../meshVertexSpaceUtils ./geographicUtils ./projection ./vertexSpaceConversion".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){function y(E,G,I,O=e.ZEROS){if(null!=E)for(p.fromRotation(D,v.angleRad(G),v.axis(G)),G=0;G<E.length;G+=I){for(var L=0;3>L;L++)A[L]=E[G+L]-O[L];c.transformMat4(A,A,D);for(L=0;3>L;L++)E[G+L]=A[L]+O[L]}}const z=()=>b.getLogger("esri.geometry.support.meshUtils.rotate"),A=e.create(),B=k.create(),C=v.create(),D=k.create(),F=l.create(),H=e.create(),N=f.create();a.rotate=function(E,G,I){if(E.vertexAttributes?.position&&0!==G[3]){var {spatialReference:O,vertexSpace:L}=
E,P=I?.origin??E.anchor;I=n.performGlobalOperation(z,L,O,I?.geographic);if(r.isMeshWithRelativeVertexSpace(E))a:{E.transform??(E.transform=new m);const {vertexSpace:K,transform:J,spatialReference:R}=E,[Q,W,S]=K.origin;I=new g({x:Q,y:W,z:S,spatialReference:R});var M=A;if(I.equals(P))c.set(M,0,0,0);else if(!x.projectPointToVertexSpace(M,P,E)){u.logProjectionError(z(),P.spatialReference,R,u.loadProjectErrorMessage);break a}h.setAxisAngle(N,v.axis(G),v.angleRad(G));E=p.fromRotationTranslationScaleOrigin(B,
N,e.ZEROS,e.ONES,M);({localMatrix:G}=J);E=p.multiply(B,E,G);J.scale=p.getScaling(e.create(),E);p.scale(E,E,c.inverse(A,J.scale));G=J.rotationAxis;J.rotation=v.fromMatrix(E);0===J.rotationAngle&&(J.rotationAxis=G);J.translation=p.getTranslation(e.create(),E)}else if(I)a:{I=E.spatialReference;M=d.getSphericalPCPF(I);if(!w.projectPointToVector(P,H,M)&&(u.logProjectionError(z(),P.spatialReference,M,"Falling back to mesh origin"),!w.projectPointToVector(E.origin,H,M))){u.logProjectionError(z(),E.origin.spatialReference,
M);break a}P=E.vertexAttributes.position;const K=E.vertexAttributes.normal,J=E.vertexAttributes.tangent,R=new Float64Array(P.length),Q=null!=K?new Float32Array(K.length):null,W=null!=J?new Float32Array(J.length):null;t.computeTranslationToOriginAndRotation(M,H,D,M);q.fromMat4(F,D);c.transformMat3(v.axis(C),v.axis(G),F);C[3]=G[3];if(u.projectToPCPF(P,I,R))if(null==K||null==Q||u.projectNormalToPCPF(K,P,R,I,Q))if(null==J||null==W||u.projectTangentToPCPF(J,P,R,I,W))if(y(R,C,3,H),u.projectFromPCPF(R,P,
I)){if(null!=K&&null!=Q&&(y(Q,C,3),!u.projectNormalFromPCPF(Q,P,R,I,K))){u.logProjectionError(z(),M,I);break a}if(null!=J&&null!=W&&(y(W,C,4),!u.projectTangentFromPCPF(W,P,R,I,J))){u.logProjectionError(z(),M,I);break a}E.vertexAttributesChanged()}else u.logProjectionError(z(),M,I);else u.logProjectionError(z(),I,M);else u.logProjectionError(z(),I,M);else u.logProjectionError(z(),I,M)}else w.projectPointToVector(P,H,E.spatialReference)?(y(E.vertexAttributes.position,G,3,H),y(E.vertexAttributes.normal,
G,3),y(E.vertexAttributes.tangent,G,4),E.vertexAttributesChanged()):(G=E.origin,H[0]=G.x,H[1]=G.y,H[2]=G.z,u.logProjectionError(z(),P.spatialReference,E.spatialReference,u.loadProjectErrorMessage))}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/scale":function(){define("exports ../../../core/Logger ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/factories/quatf64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../Point ../../spatialReferenceEllipsoidUtils ../../projection/projectPointToVector ../axisAngleDegrees ../MeshTransform ../meshVertexSpaceUtils ./geographicUtils ./projection ./vertexSpaceConversion".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){function r(A,B,C=h.ZEROS){if(A)for(let F=0;F<A.length;F+=3){for(var D=0;3>D;D++)u[D]=A[F+D]-C[D];k.scale(u,u,B);for(D=0;3>D;D++)A[F+D]=u[D]+C[D]}}const n=()=>b.getLogger("esri.geometry.support.meshUtils.scale"),u=h.create(),x=h.create(),y=l.create(),z=h.create();a.scale=function(A,B,C){if(A.vertexAttributes?.position){var {vertexSpace:D,spatialReference:F}=A,H=C?.origin??A.anchor;C=w.performGlobalOperation(n,D,F,C?.geographic);if(t.isMeshWithRelativeVertexSpace(A))a:{A.transform??
(A.transform=new d);const {vertexSpace:E,transform:G,spatialReference:I}=A,[O,L,P]=E.origin;var N=new f({x:O,y:L,z:P,spatialReference:I});C=u;if(N.equals(H))k.set(C,0,0,0);else if(!m.projectPointToVertexSpace(C,H,A)){v.logProjectionError(n(),H.spatialReference,I,v.loadProjectErrorMessage);break a}A=k.set(x,B,B,B);A=q.fromRotationTranslationScaleOrigin(y,p.IDENTITY,h.ZEROS,A,C);({localMatrix:B}=G);A=q.multiply(y,A,B);G.scale=q.getScaling(h.create(),A);q.scale(A,A,k.inverse(u,G.scale));B=G.rotationAxis;
G.rotation=g.fromMatrix(A);0===G.rotationAngle&&(G.rotationAxis=B);G.translation=q.getTranslation(h.create(),A)}else if(C)a:{C=A.spatialReference;N=c.getSphericalPCPF(C);if(!e.projectPointToVector(H,z,N)&&(v.logProjectionError(n(),H.spatialReference,N,"Falling back to mesh origin"),!e.projectPointToVector(A.origin,z,N))){v.logProjectionError(n(),A.origin.spatialReference,N);break a}H=A.vertexAttributes.position;const E=A.vertexAttributes.normal,G=A.vertexAttributes.tangent,I=new Float64Array(H.length),
O=null!=E?new Float32Array(E.length):null,L=null!=G?new Float32Array(G.length):null;v.projectToPCPF(H,C,I)?null==E||null==O||v.projectNormalToPCPF(E,H,I,C,O)?null==G||null==L||v.projectTangentToPCPF(G,H,I,C,L)?(r(I,B,z),v.projectFromPCPF(I,H,C)?null==E||null==O||v.projectNormalFromPCPF(O,H,I,C,E)?null==G||null==L||v.projectTangentFromPCPF(L,H,I,C,G)?A.vertexAttributesChanged():v.logProjectionError(n(),N,C):v.logProjectionError(n(),N,C):v.logProjectionError(n(),N,C)):v.logProjectionError(n(),C,N):
v.logProjectionError(n(),C,N):v.logProjectionError(n(),C,N)}else e.projectPointToVector(H,z,A.spatialReference)?(r(A.vertexAttributes.position,B,z),A.vertexAttributesChanged()):(B=A.origin,z[0]=B.x,z[1]=B.y,z[2]=B.z,v.logProjectionError(n(),H.spatialReference,A.spatialReference,v.loadProjectErrorMessage))}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/sources/support/uploadAssetErrors":function(){define(["exports","../../../../core/Error"],function(a,b){class q extends b{constructor(){super("upload-assets:unsupported",
"Layer does not support asset uploads.",Error())}}class l extends b{constructor(){super("upload-assets:no-glb-support","Layer does not support glb.",Error())}}class p extends b{constructor(){super("upload-assets:no-supported-source","No supported external source found",Error())}}class k extends b{constructor(){super("upload-assets:not-base-64","Expected gltf data in base64 format after conversion.",Error())}}class h extends b{constructor(){super("upload-assets:unable-to-prepare-options","Unable to prepare uploadAsset request options.",
Error())}}class f extends b{constructor(w,v){super("upload-assets:bad-response",`Bad response. Uploaded ${w} items and received ${v} results.`,Error())}}class c extends b{constructor(w,v){super("upload-assets-layer:upload-failed",`Failed to upload mesh file ${w}. Error code: ${v?.code??"-1"}. Error message: ${v?.messages??"unknown"}`,Error())}}class e extends b{constructor(w){super("upload-assets-layer:unsupported-format",`The service allowed us to upload an asset of FormatID ${w}, but it does not list it in its supported formats.`,
Error())}}class g extends b{constructor(){super("upload-assets:convert3D-failed","convert3D failed.")}}class d extends b{constructor(){super("invalid-input:no-model","No supported model found")}}class t extends b{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}a.BadResponseError=f;a.Convert3DFailedError=g;a.MultipleModelsError=t;a.NoGlbSupportError=l;a.NoModelError=d;a.NoSupportedSourceError=p;a.NotBase64Error=k;a.UnableToPrepareOptionsError=h;a.UnsupportedError=
q;a.UnsupportedFormatUploadedError=e;a.UploadFailedError=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/mixins/SceneService":function(){define("exports ../../chunks/tslib.es6 ../../request ../../core/Error ../../core/Logger ../../core/promiseUtils ../../core/urlUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/RandomLCG ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ../../core/accessorSupport/originUtils ../../geometry/Extent ../../geometry/HeightModelInfo ../../geometry/SpatialReference ../support/arcgisLayerUrl ../support/commonProperties ../support/I3SIndexInfo ../support/schemaValidatorLoader ../../portal/Portal ../../portal/PortalItem ../../portal/support/jsonContext ../../webdoc/support/resourceUtils ../../webdoc/support/saveAPIKeyUtils ../../webdoc/support/saveUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F){function H(I){if(null!=I.spatialReference)return r.fromJSON(I.spatialReference);I=I.store;I=(I=I.indexCRS||I.geographicCRS)&&parseInt(I.substring(I.lastIndexOf("/")+1,I.length),10);return null!=I?new r(I):null}function N(I,O,L){I.typeKeywords||(I.typeKeywords=[]);O=O.getTypeKeywords();for(const P of O)I.typeKeywords.push(P);I.typeKeywords&&(I.typeKeywords=I.typeKeywords.filter((P,M,K)=>K.indexOf(P)===M),L===E.newItem&&(I.typeKeywords=
I.typeKeywords.filter(P=>"Hosted Service"!==P)))}var E;(function(I){I[I.existingItem=0]="existingItem";I[I.newItem=1]="newItem"})(E||={});const G={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};a.SaveOperationType=void 0;(function(I){I[I.SAVE=0]="SAVE";I[I.SAVE_AS=1]="SAVE_AS"})(a.SaveOperationType||(a.SaveOperationType={}));a.SceneService=I=>{I=class extends I{constructor(){super(...arguments);this.heightModelInfo=this.fullExtent=
this.spatialReference=null;this.maxScale=this.minScale=0;this.version={major:Number.NaN,minor:Number.NaN,versionString:""};this.copyright=null;this.sublayerTitleMode="item-title";this.indexInfo=this.layerId=this.title=null;this._debouncedSaveOperations=k.debounce(async(O,L,P)=>{switch(O){case a.SaveOperationType.SAVE:return this._save(L);case a.SaveOperationType.SAVE_AS:return this._saveAs(P,L)}})}readSpatialReference(O,L){return H(L)}readFullExtent(O,L,P){if(null!=O&&"object"===typeof O)return L=
null==O.spatialReference?{...O,spatialReference:H(L)}:O,v.fromJSON(L,P);P=L.store;L=H(L);return null==L||null==P?.extent||!Array.isArray(P.extent)||P.extent.some(M=>-1E38>M)?null:new v({xmin:P.extent[0],ymin:P.extent[1],xmax:P.extent[2],ymax:P.extent[3],spatialReference:L})}parseVersionString(O){const L={major:Number.NaN,minor:Number.NaN,versionString:O};O=O.split(".");2<=O.length&&(L.major=parseInt(O[0],10),L.minor=parseInt(O[1],10));return L}readVersion(O,L){O=L.store;return this.parseVersionString(null!=
O.version?O.version.toString():"")}readTitlePortalItem(O){return"item-title"!==this.sublayerTitleMode?void 0:O}readTitleService(O,L){O=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?n.titleFromUrlAndName(this.url,L.name):L.name;L=L.name;if(!L&&this.url){const P=n.parse(this.url);null!=P&&(L=P.title)}"item-title-and-service-name"===this.sublayerTitleMode&&O&&(L=O+" - "+L);return n.cleanTitle(L)}set url(O){null==O?this._set("url",O):(O=n.sanitizeUrlWithLayerId({layer:this,
url:O,nonStandardUrlAllowed:!1,logger:p.getLogger(this)}),this._set("url",O.url),null!=O.layerId&&this._set("layerId",O.layerId))}writeUrl(O,L,P,M){n.writeUrlWithLayerId(this,O,"layers",L,M)}get parsedUrl(){var O=this._get("url");(O=h.urlToObject(O))&&null!=this.layerId&&(O.path=`${O.path}/layers/${this.layerId}`);return O}async _fetchIndexAndUpdateExtent(O,L){this.indexInfo=x.fetchIndexInfo(this.parsedUrl?.path??"",this.rootNode,O,this.customParameters,this.apiKey,p.getLogger(this),L);null==this.fullExtent||
this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(O){if("page"===O?.type){var L=O.rootIndex%O.pageSize;L=O.rootPage?.nodes?.[L];if(null==L?.obb?.center||null==L.obb.halfSize)throw new l("sceneservice:invalid-node-page","Invalid node page.");-1E38>L.obb.center[0]||null==this.fullExtent||this.fullExtent.hasZ||(O=L.obb.halfSize,L=L.obb.center[2],O=Math.sqrt(O[0]*O[0]+O[1]*O[1]+O[2]*O[2]),this.fullExtent.zmin=L-O,this.fullExtent.zmax=L+O)}else if("node"===O?.type&&(L=O.rootNode?.mbs,
Array.isArray(L)&&4===L.length&&!(-1E38>L[0]))){O=L[2];L=L[3];var {fullExtent:P}=this;P&&(P.zmin=O-L,P.zmax=O+L)}}async _fetchService(O){if(null==this.url)throw new l("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const L=await this._fetchFirstLayerId(O);null!=L&&(this.layerId=L)}return this._fetchServiceLayer(O)}async _fetchFirstLayerId(O){O=await q(this.url??"",{query:{f:"json",...this.customParameters,
token:this.apiKey},responseType:"json",signal:O});if(O.data&&Array.isArray(O.data.layers)&&0<O.data.layers.length)return O.data.layers[0].id}async _fetchServiceLayer(O){O=await q(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:O});O.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let L=!1;O.data.layerType&&"Voxel"===O.data.layerType&&(L=!0);if(L)return this._fetchVoxelServiceLayer();O=O.data;this.read(O,this._getServiceContext());
this.validateLayer(O)}async _fetchVoxelServiceLayer(O){O=(await q(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:O})).data;this.read(O,this._getServiceContext());this.validateLayer(O)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load();"beforeSave"in this&&"function"===typeof this.beforeSave&&await this.beforeSave()}validateLayer(O){}async _saveAs(O,
L){L={...G,...L};O=A.from(O);if(!O)throw new l("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");D.validateSaveAPIKey(O);O.id&&(O=O.clone(),O.id=null);const P=O.portal||z.getDefault();await this._ensureLoadBeforeSave();O.type="Scene Service";O.portal=P;const M=B.createForItemWrite(O,"portal-item",!0),K={layers:[this.write({},M)]};await Promise.all(M.resources.pendingOperations??[]);await this._validateAgainstJSONSchema(K,M,L);this.url&&(O.url=this.url);O.title||(O.title=
this.title);N(O,L,E.newItem);await P.signIn();await P.user?.addItem({item:O,folder:L?.folder,data:K});await C.saveResources(this.resourceReferences,M);this.portalItem=O;w.updateOrigins(M);return M.portalItem=O}async _save(O){O={...G,...O};if(!this.portalItem)throw new l("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");D.validateSaveAPIKey(this.portalItem);if("Scene Service"!==this.portalItem.type)throw new l("sceneservice:portal-item-wrong-type",'Portal item needs to have type "Scene Service"');
await this._ensureLoadBeforeSave();const L=B.createForItemWrite(this.portalItem,"portal-item",!0),P={layers:[this.write({},L)]};await Promise.all(L.resources.pendingOperations??[]);await this._validateAgainstJSONSchema(P,L,O);this.url&&(this.portalItem.url=this.url);this.portalItem.title||(this.portalItem.title=this.title);N(this.portalItem,O,E.existingItem);await C.updateItemWithResources(this.portalItem,P,this.resourceReferences,L);w.updateOrigins(L);return this.portalItem}async _validateAgainstJSONSchema(O,
L,P){var M=P?.validationOptions;F.evaluateWriteErrors(L,{errorName:"sceneservice:save"},{ignoreUnsupported:M?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});L=M?.enabled;const K=y.getLoader();if(L&&K&&(P=(await K()).validate(O,P.portalItemLayerType),P.length&&(O=`Layer item did not validate:\n${P.join("\n")}`,p.getLogger(this).error(`_validateAgainstJSONSchema(): ${O}`),"throw"===M.failPolicy)))throw M=P.map(J=>new l("sceneservice:schema-validation",J)),new l("sceneservice-validate:error",
"Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:M});}};b.__decorate([f.property(u.id)],I.prototype,"id",void 0);b.__decorate([f.property({type:r})],I.prototype,"spatialReference",void 0);b.__decorate([g.reader("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],I.prototype,"readSpatialReference",null);b.__decorate([f.property({type:v})],I.prototype,"fullExtent",void 0);b.__decorate([g.reader("fullExtent",["fullExtent","store.extent",
"spatialReference","store.indexCRS","store.geographicCRS"])],I.prototype,"readFullExtent",null);b.__decorate([f.property({readOnly:!0,type:m})],I.prototype,"heightModelInfo",void 0);b.__decorate([f.property({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],I.prototype,"minScale",void 0);b.__decorate([f.property({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],I.prototype,
"maxScale",void 0);b.__decorate([f.property({readOnly:!0})],I.prototype,"version",void 0);b.__decorate([g.reader("version",["store.version"])],I.prototype,"readVersion",null);b.__decorate([f.property({type:String,json:{read:{source:"copyrightText"}}})],I.prototype,"copyright",void 0);b.__decorate([f.property({type:String,json:{read:!1}})],I.prototype,"sublayerTitleMode",void 0);b.__decorate([f.property({type:String})],I.prototype,"title",void 0);b.__decorate([g.reader("portal-item","title")],I.prototype,
"readTitlePortalItem",null);b.__decorate([g.reader("service","title",["name"])],I.prototype,"readTitleService",null);b.__decorate([f.property({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],I.prototype,"layerId",void 0);b.__decorate([f.property(u.url)],I.prototype,"url",null);b.__decorate([t.writer("url")],I.prototype,"writeUrl",null);b.__decorate([f.property()],I.prototype,"parsedUrl",null);b.__decorate([f.property({readOnly:!0})],
I.prototype,"store",void 0);b.__decorate([f.property({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],I.prototype,"rootNode",void 0);return I=b.__decorate([d.subclass("esri.layers.mixins.SceneService")],I)};a.sceneServiceItemType="Scene Service";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/accessorSupport/originUtils":function(){define(["exports","../multiOriginJSONSupportUtils"],function(a,b){a.updateOrigins=function(q){q?.writtenProperties&&q.writtenProperties.forEach(({target:l,
propName:p,newOrigin:k})=>{b.isMultiOriginJSONMixin(l)&&k&&l.originOf(p)!==k&&l.updateOrigin(p,k)})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/multiOriginJSONSupportUtils":function(){define(["exports"],function(a){a.isMultiOriginJSONMixin=function(b){return b&&"getAtOrigin"in b&&"originOf"in b};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/I3SIndexInfo":function(){define(["exports","../../request","../../core/Error"],function(a,
b,q){a.fetchIndexInfo=async function(l,p,k,h,f,c,e){var g=null;if(null!=k){g=`${l}/nodepages/`;const d=g+Math.floor(k.rootIndex/k.nodesPerPage);try{return{type:"page",rootPage:(await b(d,{query:{f:"json",...h,token:f},responseType:"json",signal:e})).data,rootIndex:k.rootIndex,pageSize:k.nodesPerPage,lodMetric:k.lodSelectionMetricType,urlPrefix:g}}catch(t){null!=c&&c.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",d,t),g=t}}if(!p)return null;p=p?.split("/").pop();
l=`${l}/nodes/`;p=l+p;try{return{type:"node",rootNode:(await b(p,{query:{f:"json",...h,token:f},responseType:"json",signal:e})).data,urlPrefix:l}}catch(d){throw new q("sceneservice:root-node-missing","Root node missing.",{pageError:g,nodeError:d,url:p});}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/schemaValidatorLoader":function(){define(["exports"],function(a){let b=null;a.getLoader=function(){return b};a.registerLoader=function(q){b=q};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/portal/support/jsonContext":function(){define(["exports","../../core/urlUtils","../Portal"],function(a,b,q){function l(p,k){return{origin:k,url:b.urlToObject(p.itemUrl),portal:p.portal||q.getDefault(),portalItem:p}}a.createForItemRead=function(p,k){return{...l(p,k),readResourcePaths:[]}};a.createForItemWrite=function(p,k,h){const f=b.urlToObject(p.itemUrl);return{...l(p,k),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:f?
{rootPath:f.path,writtenUrls:[]}:null,resources:h?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webdoc/support/resourceUtils":function(){define("require exports ../../core/Error ../../core/promiseUtils ../../core/uuid ../../portal/support/resourceUtils".split(" "),function(a,b,q,l,p,k){async function h(c,e,g){if(e?.resources){var d=e.portalItem===c.portalItem?new Set(c.paths):new Set;c.paths.length=0;c.portalItem=
e.portalItem;var t=new Set(e.resources.toKeep.map(u=>u.resource.path)),w=new Set,v=[];t.forEach(u=>{d.delete(u);c.paths.push(u)});var m=[],r=[],n=[];for(const u of e.resources.toUpdate)if(d.delete(u.resource.path),t.has(u.resource.path)||w.has(u.resource.path)){const {resource:x,content:y,finish:z}=u,A=k.getSiblingOfSameTypeI(x,p.generateUUID());c.paths.push(A.path);m.push({resource:A,content:await k.contentToBlob(y),compress:u.compress});z&&n.push(()=>z(A))}else{c.paths.push(u.resource.path);r.push({resource:u.resource,
content:await k.contentToBlob(u.content),compress:u.compress});const x=u.finish;x&&n.push(()=>x(u.resource));w.add(u.resource.path)}for(const u of e.resources.toAdd)if(c.paths.push(u.resource.path),d.has(u.resource.path))d.delete(u.resource.path);else{m.push({resource:u.resource,content:await k.contentToBlob(u.content),compress:u.compress});const x=u.finish;x&&n.push(()=>x(u.resource))}if(m.length||r.length)({addOrUpdateResources:t}=await new Promise((u,x)=>a(["../../portal/support/resourceUtils"],
u,x))),await t(e.portalItem,m,"add",g),await t(e.portalItem,r,"update",g);n.forEach(u=>u());if(0===v.length)return d;e=await l.allSettledErrors(v);l.throwIfAborted(g);if(0<e.length)throw new q("save:resources","Failed to save one or more resources",{errors:e});return d}}async function f(c,e,g){if(c&&e.portalItem){var d=[];for(const t of c)c=e.portalItem.resourceFromPath(t),d.push(c.portalItem.removeResource(c,g));await l.eachAlways(d)}}b.saveResources=async function(c,e,g){c=await h(c,e,g);await f(c,
e,g)};b.updateItemWithResources=async function(c,e,g,d,t){g=await h(g,d,t);await c.update({data:e});await f(g,d,t)};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/portal/support/resourceUtils":function(){define(["exports","../../request","../../core/Error","../../core/urlUtils"],function(a,b,q,l){function p(h){const f=h.lastIndexOf("/");return-1===f?[".",h]:[h.slice(0,f),h.slice(f+1)]}function k(h){{const d=l.getPathExtension(h);h=null==d?[h,""]:[h.slice(0,h.length-d.length-
1),`.${d}`]}const [f,c]=h,[e,g]=p(f);return[e,g,c]}a.addOrUpdateResources=async function(h,f,c,e){var g=new Map;for(const {resource:d,content:t,compress:w,access:v}of f){if(!d.hasPath())throw new q(`portal-item-resource-${c}:invalid-path`,"Resource does not have a valid path");const [m,r]=p(d.path);f=`${m}/${w??""}/${v??""}`;g.has(f)||g.set(f,{prefix:m,compress:w,access:v,files:[]});g.get(f).files.push({fileName:r,content:t})}await h.load(e);c=l.join(h.userItemUrl,"add"===c?"addResources":"updateResources");
for(const {prefix:d,compress:t,access:w,files:v}of g.values())for(g=0;g<v.length;g+=25){f=v.slice(g,g+25);const m=new FormData;d&&"."!==d&&m.append("resourcesPrefix",d);t&&m.append("compress","true");w&&m.append("access",w);let r=0;for(const {fileName:n,content:u}of f)m.append(`file${++r}`,u,n);m.append("f","json");await h.portal.request(c,{method:"post",body:m,signal:e?.signal})}};a.contentToBlob=async function(h){return"blob"===h.type?h.blob:"json"===h.type?new Blob([h.jsonString],{type:"application/json"}):
(await b(h.url,{responseType:"blob"})).data};a.fetchResources=async function(h,f={},c){await h.load(c);const e=l.join(h.itemUrl,"resources"),{start:g=1,num:d=10,sortOrder:t="asc",sortField:w="resource"}=f;f=await h.portal.request(e,{query:{start:g,num:d,sortOrder:t,sortField:w,token:h.apiKey},signal:c?.signal});return{total:f.total,nextStart:f.nextStart,resources:f.resources.map(({created:v,size:m,resource:r})=>({created:new Date(v),size:m,resource:h.resourceFromPath(r)}))}};a.getSiblingOfSameType=
function(h,f){if(!h.hasPath())return null;const [c,,e]=k(h.path);return h.portalItem.resourceFromPath(l.join(c,f+e))};a.getSiblingOfSameTypeI=function(h,f){if(!h.hasPath())return null;const [c,,e]=k(h.path);return h.portalItem.resourceFromPath(l.join(c,f+e))};a.removeAllResources=async function(h,f){await h.load(f);const c=l.join(h.userItemUrl,"removeResources");return h.portal.request(c,{method:"post",query:{deleteAll:!0},signal:f?.signal})};a.removeResource=async function(h,f,c){if(!f.hasPath())throw new q("portal-item-resources-remove:invalid-path",
"Resource does not have a valid path");await h.load(c);const e=l.join(h.userItemUrl,"removeResources");await h.portal.request(e,{method:"post",query:{resource:f.path},signal:c?.signal});f.portalItem=null};a.splitPrefixFileNameAndExtension=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webdoc/support/saveAPIKeyUtils":function(){define(["exports","../../config","../../core/Error","../../support/apiKeyUtils"],function(a,b,q,l){a.validateSaveAPIKey=function(p){if(b.apiKey&&l.supportsApiKey(p.portal.url))throw new q("save-api-key-utils:api-key-not-supported",
`Saving is not supported on ${p.portal.url} when using an api key`);};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webdoc/support/saveUtils":function(){define(["exports","../../core/Error"],function(a,b){const q=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);a.beforeSave=async function(l){const p=[];for(const k of l.allLayers)"beforeSave"in k&&"function"===typeof k.beforeSave&&(l=k.beforeSave())&&p.push(l);
await Promise.allSettled(p)};a.evaluateWriteErrors=function(l,p,k){let h=(l.messages??[]).filter(({type:f})=>"error"===f).map(({name:f,message:c,details:e})=>new b(f,c,e));l.blockedRelativeUrls&&(h=h.concat(l.blockedRelativeUrls.map(f=>new b("url:unsupported",`Relative url '${f}' is not supported`))));if(k){const {ignoreUnsupported:f,supplementalUnsupportedErrors:c=[],requiredPropertyChecksDisabled:e}=k;f&&(h=h.filter(({name:g})=>!(q.has(g)||c.includes(g))));e&&(h=h.filter(g=>"web-document-write:property-required"!==
g.name))}if(0<h.length)throw new b(p.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:h});};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/mixins/TemporalSceneLayer":function(){define("exports ../../chunks/tslib.es6 ../../TimeExtent ../../TimeInterval ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../support/fieldUtils ../support/sceneLayerCacheUtils ../support/TimeInfo".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){let w=class extends p.JSONSupport{constructor(){super(...arguments);this.startTimeField=this.endTimeField=null}};b.__decorate([k.property({type:String})],w.prototype,"endTimeField",void 0);b.__decorate([k.property({type:String})],w.prototype,"startTimeField",void 0);w=b.__decorate([e.subclass("esri.layers.mixins.TemporalSceneLayer.SceneServiceTimeInfo")],w);a.TemporalSceneLayer=v=>{v=class extends v{constructor(){super(...arguments);this.serviceTimeInfo=null}get timeInfo(){var m=
this.associatedLayer?.timeInfo;if(null==m)return null;m=m.clone();g.fixTimeInfoFields(m,this.fieldsIndex);return m}set timeInfo(m){g.fixTimeInfoFields(m,this.fieldsIndex);this._override("timeInfo",m)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(m){this._override("timeExtent",m)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(m){this._override("timeOffset",m)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(m){this._override("datesInUnknownTimezone",
m)}async loadTimeInfoFromService(m){var {serviceTimeInfo:r}=this;if(null!=r){var {startTimeField:n,endTimeField:u}=r;if((null!=n||null!=u)&&!d.cacheIsOutOfSync({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp})){r=async z=>{let A=null;try{A=(await this.fetchStatistics?.(z,m))?.stats}catch{}if(null==A)return null;const {minTimeStr:B,min:C,maxTimeStr:D,max:F}=A;z=z===n?B??C:D??F;return null!=z?new Date(z):null};var [x,y]=await Promise.all([r(n),r(u)]);null!=n&&
null==x||null!=u&&null==y||(r=new q({start:x,end:y}),this.setAtOrigin("timeInfo",new t({endField:u,startField:n,fullTimeExtent:r}),"service"))}}}};b.__decorate([k.property({type:t,json:{read:!1,write:!1}})],v.prototype,"timeInfo",null);b.__decorate([k.property({type:q,json:{read:!1,write:!1}})],v.prototype,"timeExtent",null);b.__decorate([k.property({type:l,json:{read:!1,write:!1}})],v.prototype,"timeOffset",null);b.__decorate([k.property({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],v.prototype,
"datesInUnknownTimezone",null);b.__decorate([k.property({type:w,readOnly:!0,json:{read:{source:"timeInfo"}}})],v.prototype,"serviceTimeInfo",void 0);return v=b.__decorate([e.subclass("esri.layers.mixins.TemporalSceneLayer")],v)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/sceneLayerCacheUtils":function(){define(["exports"],function(a){a.cacheIsOutOfSync=function({associatedLayer:b,serviceUpdateTimeStamp:q}){const l=b?.editingInfo?.lastEditDate;b=b?.serverGens;
const p=null!=l,k=null!=q;q=p&&k&&q.lastUpdate!==l.getTime();return p&&(q||!k&&b?.minServerGen!==b?.serverGen)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/capabilities":function(){define(["exports"],function(a){a.zeroCapabilities={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,
supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,
supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,
supportsCompactGeometry:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,
supportsResultType:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/I3SLayerDefinitions":function(){define("exports ../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/enumeration ../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f,c){a.I3SNodePageDefinition=class extends q.JSONSupport{constructor(){super(...arguments);this.nodesPerPage=null;this.rootIndex=0;this.lodSelectionMetricType=null}};b.__decorate([l.property({type:Number})],a.I3SNodePageDefinition.prototype,"nodesPerPage",void 0);b.__decorate([l.property({type:Number})],a.I3SNodePageDefinition.prototype,"rootIndex",void 0);b.__decorate([l.property({type:String})],a.I3SNodePageDefinition.prototype,"lodSelectionMetricType",void 0);a.I3SNodePageDefinition=
b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SNodePageDefinition")],a.I3SNodePageDefinition);a.I3SMaterialTexture=class extends q.JSONSupport{constructor(){super(...arguments);this.factor=1}};b.__decorate([l.property({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],a.I3SMaterialTexture.prototype,"id",void 0);b.__decorate([l.property({type:Number})],a.I3SMaterialTexture.prototype,"factor",void 0);a.I3SMaterialTexture=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SMaterialTexture")],
a.I3SMaterialTexture);a.I3SMaterialPBRMetallicRoughness=class extends q.JSONSupport{constructor(){super(...arguments);this.baseColorFactor=[1,1,1,1];this.metallicRoughnessTexture=this.baseColorTexture=null;this.roughnessFactor=this.metallicFactor=1}};b.__decorate([l.property({type:[Number]})],a.I3SMaterialPBRMetallicRoughness.prototype,"baseColorFactor",void 0);b.__decorate([l.property({type:a.I3SMaterialTexture})],a.I3SMaterialPBRMetallicRoughness.prototype,"baseColorTexture",void 0);b.__decorate([l.property({type:a.I3SMaterialTexture})],
a.I3SMaterialPBRMetallicRoughness.prototype,"metallicRoughnessTexture",void 0);b.__decorate([l.property({type:Number})],a.I3SMaterialPBRMetallicRoughness.prototype,"metallicFactor",void 0);b.__decorate([l.property({type:Number})],a.I3SMaterialPBRMetallicRoughness.prototype,"roughnessFactor",void 0);a.I3SMaterialPBRMetallicRoughness=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SMaterialPBRMetallicRoughness")],a.I3SMaterialPBRMetallicRoughness);a.I3SMaterialDefinition=class extends q.JSONSupport{constructor(){super(...arguments);
this.alphaMode="opaque";this.alphaCutoff=.25;this.doubleSided=!1;this.cullFace="none";this.pbrMetallicRoughness=this.emissiveFactor=this.emissiveTexture=this.occlusionTexture=this.normalTexture=null}};b.__decorate([f.enumeration({opaque:"opaque",mask:"mask",blend:"blend"})],a.I3SMaterialDefinition.prototype,"alphaMode",void 0);b.__decorate([l.property({type:Number})],a.I3SMaterialDefinition.prototype,"alphaCutoff",void 0);b.__decorate([l.property({type:Boolean})],a.I3SMaterialDefinition.prototype,
"doubleSided",void 0);b.__decorate([f.enumeration({none:"none",back:"back",front:"front"})],a.I3SMaterialDefinition.prototype,"cullFace",void 0);b.__decorate([l.property({type:a.I3SMaterialTexture})],a.I3SMaterialDefinition.prototype,"normalTexture",void 0);b.__decorate([l.property({type:a.I3SMaterialTexture})],a.I3SMaterialDefinition.prototype,"occlusionTexture",void 0);b.__decorate([l.property({type:a.I3SMaterialTexture})],a.I3SMaterialDefinition.prototype,"emissiveTexture",void 0);b.__decorate([l.property({type:[Number]})],
a.I3SMaterialDefinition.prototype,"emissiveFactor",void 0);b.__decorate([l.property({type:a.I3SMaterialPBRMetallicRoughness})],a.I3SMaterialDefinition.prototype,"pbrMetallicRoughness",void 0);a.I3SMaterialDefinition=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SMaterialDefinition")],a.I3SMaterialDefinition);a.I3STextureFormat=class extends q.JSONSupport{};b.__decorate([l.property({type:String,json:{read:{source:["name","index"],reader:(e,g)=>null!=e?e:`${g.index}`}}})],a.I3STextureFormat.prototype,
"name",void 0);b.__decorate([f.enumeration({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],a.I3STextureFormat.prototype,"format",void 0);a.I3STextureFormat=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3STextureFormat")],a.I3STextureFormat);a.I3STextureSetDefinition=class extends q.JSONSupport{constructor(){super(...arguments);this.atlas=!1}};b.__decorate([l.property({type:[a.I3STextureFormat]})],a.I3STextureSetDefinition.prototype,"formats",
void 0);b.__decorate([l.property({type:Boolean})],a.I3STextureSetDefinition.prototype,"atlas",void 0);a.I3STextureSetDefinition=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3STextureSetDefinition")],a.I3STextureSetDefinition);a.I3SGeometryAttribute=class extends q.JSONSupport{};b.__decorate([f.enumeration({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],a.I3SGeometryAttribute.prototype,"type",void 0);b.__decorate([l.property({type:Number})],
a.I3SGeometryAttribute.prototype,"component",void 0);a.I3SGeometryAttribute=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SGeometryAttribute")],a.I3SGeometryAttribute);a.I3SGeometryCompressedAttributes=class extends q.JSONSupport{};b.__decorate([f.enumeration({draco:"draco"})],a.I3SGeometryCompressedAttributes.prototype,"encoding",void 0);b.__decorate([l.property({type:[String]})],a.I3SGeometryCompressedAttributes.prototype,"attributes",void 0);a.I3SGeometryCompressedAttributes=
b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SGeometryCompressedAttributes")],a.I3SGeometryCompressedAttributes);a.I3SGeometryBuffer=class extends q.JSONSupport{constructor(){super(...arguments);this.offset=0}};b.__decorate([l.property({type:Number})],a.I3SGeometryBuffer.prototype,"offset",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype,"position",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype,
"normal",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype,"uv0",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype,"color",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype,"uvRegion",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype,"featureId",void 0);b.__decorate([l.property({type:a.I3SGeometryAttribute})],a.I3SGeometryBuffer.prototype,
"faceRange",void 0);b.__decorate([l.property({type:a.I3SGeometryCompressedAttributes})],a.I3SGeometryBuffer.prototype,"compressedAttributes",void 0);a.I3SGeometryBuffer=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SGeometryBuffer")],a.I3SGeometryBuffer);a.I3SGeometryDefinition=class extends q.JSONSupport{};b.__decorate([f.enumeration({triangle:"triangle"})],a.I3SGeometryDefinition.prototype,"topology",void 0);b.__decorate([l.property()],a.I3SGeometryDefinition.prototype,"geometryBuffers",
void 0);a.I3SGeometryDefinition=b.__decorate([c.subclass("esri.layers.support.I3SLayerDefinitions.I3SGeometryDefinition")],a.I3SGeometryDefinition);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/RangeInfo":function(){define("exports ../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h,f){a.RangeInfo=
class extends q.JSONSupport{constructor(){super(...arguments);this.fullRangeExtent=this.currentRangeExtent=this.field=this.name=null;this.type="rangeInfo"}};b.__decorate([l.property({type:String,json:{read:!0,write:!0}})],a.RangeInfo.prototype,"name",void 0);b.__decorate([l.property({type:String,json:{read:!0,write:!0}})],a.RangeInfo.prototype,"field",void 0);b.__decorate([l.property({type:[Number],json:{read:!0,write:!0}})],a.RangeInfo.prototype,"currentRangeExtent",void 0);b.__decorate([l.property({type:[Number],
json:{read:!0,write:!0}})],a.RangeInfo.prototype,"fullRangeExtent",void 0);b.__decorate([l.property({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],a.RangeInfo.prototype,"type",void 0);a.RangeInfo=b.__decorate([f.subclass("esri.layers.support.RangeInfo")],a.RangeInfo);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/SceneFilter":function(){define("../../chunks/tslib.es6 ../../request ../../core/JSONSupport ../../core/lang ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/persistable ./PolygonCollection ../../chunks/persistableUrlUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){var w;q=w=class extends q.JSONSupport{constructor(v){super(v);this.spatialRelationship="disjoint";this.geometries=new d;this._geometriesSource=null}initialize(){this.addHandles(p.on(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,p.sync))}readGeometries(v,m,r){Array.isArray(v)?this.geometries=d.fromJSON(v,r):this._geometriesSource={url:t.fromJSON(v,r),context:r}}async loadGeometries(v,m){if(null!=this._geometriesSource){var {url:r,context:n}=
this._geometriesSource;m=await b(r,{responseType:"json",signal:m?.signal});var u=v.toJSON();v=m.data.map(x=>({...x,spatialReference:u}));this.geometries=d.fromJSON(v,n);this._geometriesSource=null}}clone(){const v=new w({geometries:l.clone(this.geometries),spatialRelationship:this.spatialRelationship});v._geometriesSource=this._geometriesSource;return v}};a.__decorate([k.property({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],q.prototype,"spatialRelationship",void 0);a.__decorate([k.property({type:d,
nonNullable:!0,json:{write:!0}}),g.persistable({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],q.prototype,"geometries",void 0);a.__decorate([c.reader(["web-scene","portal-item"],"geometries")],q.prototype,"readGeometries",null);return q=w=a.__decorate([e.subclass("esri.layers.support.SceneFilter")],q)})},"esri/core/accessorSupport/decorators/persistable":function(){define("exports ../../Error ../../MD5 ../../multiOriginJSONSupportUtils ../../urlUtils ../../uuid ../metadata ../PropertyOrigin ./property ../../../portal/support/resourceExtension ../../../chunks/persistableUrlUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){function d(r,n,u){const x=h.getPropertyMetadata(n,u);return{type:String,read:(y,z,A)=>{y=g.read(y,z,A);if(x.type===String)return y;if("function"===typeof x.type)return new x.type({url:y})},write:{writer(y,z,A,B){if(B?.resources){var C=null==y?null:"string"===typeof y?y:y.url;C=g.toJSON(C,{...B,verifyItemRelativeUrls:B?.verifyItemRelativeUrls?{writtenUrls:B.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},g.MarkKeep.NO);var D=x.type!==String&&(!l.isMultiOriginJSONMixin(this)||
B?.origin&&this.originIdOf(u)>f.nameToId(B.origin));y={object:this,propertyName:u,value:y,targetUrl:C,dest:z,targetPropertyName:A,context:B,params:r};if(B?.portalItem&&C&&!p.isAbsolute(C))if(D&&r?.contentAddressed)t(y);else if(D){{const {context:F,targetUrl:H,params:N,value:E,dest:G,targetPropertyName:I}=y;F.portalItem&&(z=F.portalItem.resourceFromPath(H),A=m(E,H,F),B=e.getResourceContentExtension(A),C=p.getPathExtension(z.path),D=N?.compress??!1,B!==C?t(y):(F.resources&&v({...y,resource:z,content:A,
compress:D,updates:F.resources.toUpdate}),G[I]=H))}}else w(y);else B?.portalItem&&(null==C||null!=g.itemIdFromResourceUrl(C)||p.isBlobProtocol(C)||D)?t(y):z[A]=C}else z[A]="string"===typeof y?g.toJSON(y,B):y.write({},B)}}}}function t(r){const {targetUrl:n,params:u,value:x,context:y,dest:z,targetPropertyName:A}=r;if(y.portalItem){var B=g.prefixAndFilenameFromResourceUrl(n),C=m(x,n,y);if(u?.contentAddressed&&"json"!==C.type)y.messages?.push(new b("persistable:contentAddressingUnsupported",`Property "${A}" is trying to serializing a resource with content of type ${C.type} with content addressing. Content addressing is only supported for json resources.`,
{content:C}));else{var D=u?.contentAddressed&&"json"===C.type?q.createMD5Hash(C.jsonString):B?.filename??k.generateUUID(),F=p.join(u?.prefix??B?.prefix,D),H=`${F}.${e.getResourceContentExtension(C)}`;if(u?.contentAddressed&&y.resources&&"json"===C.type&&(B=y.resources.toKeep.find(({resource:E})=>E.path===H)??y.resources.toAdd.find(({resource:E})=>E.path===H))){z[A]=B.resource.itemRelativeUrl;return}var N=y.portalItem.resourceFromPath(H);p.isBlobProtocol(n)&&y.resources&&y.resources.pendingOperations.push(p.blobUrlToBlob(n).then(E=>
{N.path=`${F}.${e.getResourceContentExtension({type:"blob",blob:E})}`;z[A]=N.itemRelativeUrl}).catch(()=>{}));y.resources&&v({...r,resource:N,content:C,compress:u?.compress??!1,updates:y.resources.toAdd});z[A]=N.itemRelativeUrl}}}function w({context:r,targetUrl:n,dest:u,targetPropertyName:x}){r.portalItem&&r.resources&&(r.resources.toKeep.push({resource:r.portalItem.resourceFromPath(n),compress:!1}),u[x]=n)}function v({object:r,propertyName:n,updates:u,resource:x,content:y,compress:z}){u.push({resource:x,
content:y,compress:z,finish:A=>{"string"===typeof r[n]?r[n]=A.url:r[n].url=A.url}})}function m(r,n,u){return"string"===typeof r?{type:"url",url:n}:{type:"json",jsonString:JSON.stringify(r.toJSON(u))}}a.persistable=function(r){const n=r?.origins??[void 0];return(u,x)=>{a:if("resource"===r?.type)var y=d(r,u,x);else{switch(r?.type??"other"){case "other":y={read:!0,write:!0};break a;case "url":const {read:z,write:A}=g.persistableUrlUtils;y={read:z,write:A};break a}y=void 0}for(const z of n){const A=c.propertyJSONMeta(u,
z,x);for(const B in y)A[B]=y[B]}}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/portal/support/resourceExtension":function(){define(["exports","../../core/urlUtils"],function(a,b){const q={},l=q["text/plain"],p={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};
for(const k in p)q[p[k]]=k;a.getResourceContentExtension=function(k){"json"===k.type?k="application/json":"blob"===k.type?k=k.blob.type:(k=b.getPathExtension(k.url),k=p[k]||"text/plain");return q[k]||l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/PolygonCollection":function(){define("../../chunks/tslib.es6 ../../core/Collection ../../core/JSONSupport ../../core/Warning ../../core/Logger ../../core/has ../../core/RandomLCG ../../core/Error ../../core/accessorSupport/decorators/subclass ../../geometry/Polygon ../../geometry/projection".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){var d;b=d=class extends q.JSONSupportMixin(b.ofType(e)){constructor(t){super(t)}clone(){return new d(this.items.map(t=>t.clone()))}write(t,w){return this.toJSON(w)}toJSON(t){const w=t?.layer?.spatialReference;return w?this.toArray().map(v=>{if(!w.equals(v.spatialReference)){if(!g.canProjectWithoutEngine(v.spatialReference,w))return t?.messages&&t.messages.push(new l("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,
spatialReference:t.layer.spatialReference,context:t})),null;const m=new e;g.projectPolygon(v,m,w);v=m}v=v.toJSON(t);delete v.spatialReference;return v}).filter(v=>null!=v):(t?.messages&&t.messages.push(new l("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:t.layer.spatialReference,context:t})),this.toArray().map(v=>v.toJSON(t)))}static fromJSON(t,w){const v=new d;t.forEach(m=>v.add(e.fromJSON(m,w)));return v}};return b=d=
a.__decorate([c.subclass("esri.layers.support.PolygonCollection")],b)})},"esri/layers/support/sceneLayerStatistics":function(){define(["exports","../../request","../../core/Error","../../core/urlUtils"],function(a,b,q,l){a.fetchStatistics=async function({fieldName:p,statisticsInfo:k,errorContext:h,fieldsIndex:f,path:c,customParameters:e,apiKey:g,signal:d}){if(null==k)throw new q(`${h}:no-cached-statistics`,"Cached statistics are not available for this layer");const t=f.get(p);if(null==t)throw new q(`${h}:field-unexisting`,
`Field '${p}' does not exist on the layer`);p=k.find(w=>w.name===t.name);if(null==p)throw new q(`${h}:no-cached-statistics`,"Cached statistics for this attribute are not available");h=l.join(c,p.href);({data:e}=await b(h,{query:{f:"json",...e,token:g},responseType:"json",signal:d}));return e};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/support/zipUtils":function(){define(["require","exports"],function(a,b){async function q(l){const {BlobReader:p,ZipReader:k,BlobWriter:h}=
await new Promise((c,e)=>a(["./zipjs-wrapper"],c,e)),f=[];l=new p(l);(await (new k(l)).getEntries()).forEach(c=>{if(!c.directory&&!/^__MACOS/i.test(c.filename)){var e=new h;(e=c.getData?.(e).then(g=>new File([g],c.filename)))&&f.push(e)}});return Promise.all(f)}b.extractZipFile=q;b.extractZipFiles=async function(l){const p=[];for(const k of l)k.name.toLowerCase().endsWith(".zip")?p.push(q(k)):p.push(Promise.resolve(k));return(await Promise.all(p)).flat()};Object.defineProperty(b,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/layers/i3s/I3SUtil":function(){define("exports ../../../../geometry ../../../../request ../../../../core/arrayUtils ../../../../core/Error ../../../../core/has ../../../../core/typedArrayUtil ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection ../../../../geometry/spatialReferenceEllipsoidUtils ../../../../geometry/projection/projectVectorToVector ../../../../geometry/support/aaBoundingRect ../../../../chunks/sphere ../../../../rest/support/Query ./I3SBinaryReader ./I3SProjectionUtil ../support/edgeUtils ../support/symbolColorUtils ../../support/orientedBoundingBox ../../../../geometry/SpatialReference".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){function B(ba){return ba?parseInt(ba.substring(ba.lastIndexOf("/")+1,ba.length),10):void 0}function C(ba,U){var Z=U[0],ca=U[1];U=U[3];const ea=ba[0]-Z;Z-=ba[2];const da=ba[1]-ca;ba=ca-ba[3];ca=Math.max(ea,Z,0);const ia=Math.max(da,ba,0);ca=ca*ca+ia*ia;return ca>U*U?a.MbsIntersectResult.OUTSIDE:0<ca?a.MbsIntersectResult.INTERSECTS_CENTER_OUTSIDE:-Math.max(ea,Z,da,ba)>U?a.MbsIntersectResult.INSIDE:a.MbsIntersectResult.INTERSECTS_CENTER_INSIDE}
function D(ba,U,Z){const ca=[],ea=Z?.missingFields;Z=Z?.originalFields;for(const da of ba){ba=da.toLowerCase();let ia=!1;for(const ka of U)if(ba===ka.name.toLowerCase()){ca.push(ka.name);ia=!0;Z&&Z.push(da);break}!ia&&ea&&ea.push(da)}return ca}function F(ba,U,Z){const ca=new Map,ea=[];Z=Z();for(const ka of ba){var da=ka.attributes[U];for(var ia=0;ia<Z.length;ia++){ba=Z[ia];const fa=ba.featureIds.indexOf(da);if(0<=fa){da=ca.get(ba.node);da||(da={node:ba.node,indices:[],graphics:[]},ea.push(da),ca.set(ba.node,
da));da.indices.push(fa);for(da.graphics.push(ka);0<ia;ia--)Z[ia]=Z[ia-1];Z[0]=ba;break}}}return ea}async function H(ba,U,Z,ca,ea){U.sort((ka,fa)=>ka.attributes[Z]-fa.attributes[Z]);var da=U.map(ka=>ka.attributes[Z]);const ia=[];ca=D(ca,ba.fields,{originalFields:ia});ba=await N(ba,da,ca,ea);for(ea=0;ea<U.length;ea++){da=U[ea];const ka=ba[ea],fa={};if(da.attributes)for(const X in da.attributes)fa[X]=da.attributes[X];for(let X=0;X<ia.length;X++)fa[ia[X]]=ka[ca[X]];da.attributes=fa}return U}function N(ba,
U,Z,ca){var ea=ba.capabilities.query.maxRecordCount;if(null!=ea&&U.length>ea)return ea=l.splitIntoChunks(U,ea),Promise.all(ea.map(da=>N(ba,da,Z,ca))).then(da=>da.flat());ea=new r({objectIds:U,outFields:Z,orderByFields:[ba.objectIdField]});return ba.queryFeatures(ea,ca).then(da=>{if(da&&da.features&&da.features.length===U.length)return da.features.map(ia=>ia.attributes);throw new p("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer");})}async function E(ba,
U,Z,ca,ea,da,ia,ka){const fa=[];for(const X of U)X&&ea.includes(X.name)&&fa.push({url:`${ba}/nodes/${Z}/attributes/${X.key}/0`,storageInfo:X});ba=await Promise.allSettled(fa.map(X=>q(X.url,{responseType:"array-buffer",query:{...ia,token:da},signal:ka?.signal}).then(ja=>n.readBinaryAttribute(X.storageInfo,ja.data))));U=[];for(const X of ca){ca={};for(Z=0;Z<ba.length;Z++)ea=ba[Z],"fulfilled"===ea.status&&(ca[fa[Z].storageInfo.name]=G(ea.value,X));U.push(ca)}return U}function G(ba,U){if(!ba)return null;
U=ba[U];return h.isInt16Array(ba)?-32768===U?null:U:h.isInt32Array(ba)?U===J?null:U:U!==U?null:U}function I(ba){var U=ba.store,Z=U.indexCRS||U.geographicCRS;if(U=void 0===Z?U.indexWKT:void 0)if(ba.spatialReference){if(U!==ba.spatialReference.wkt)throw new p("layerview:store-spatial-reference-wkt-index-incompatible","The indexWKT of the scene layer store does not match the WKT of the layer spatial reference",{});}else throw new p("layerview:no-store-spatial-reference-wkt-index-and-no-layer-spatial-reference",
"Found indexWKT in the scene layer store but no layer spatial reference",{});Z=Z?new A(B(Z)):ba.spatialReference;return Z.equals(ba.spatialReference)?ba.spatialReference:Z}function O(ba){var U=ba.store,Z=U.vertexCRS||U.projectedCRS;if(U=void 0===Z?U.vertexWKT:void 0)if(ba.spatialReference){if(U!==ba.spatialReference.wkt)throw new p("layerview:store-spatial-reference-wkt-vertex-incompatible","The vertexWKT of the scene layer store does not match the WKT of the layer spatial reference",{});}else throw new p("layerview:no-store-spatial-reference-wkt-vertex-and-no-layer-spatial-reference",
"Found vertexWKT in the scene layer store but no layer spatial reference",{});Z=Z?new A(B(Z)):ba.spatialReference;return Z.equals(ba.spatialReference)?ba.spatialReference:Z}function L(ba,U,Z){if(!d.canProjectWithoutEngine(ba,U))throw new p("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{});if("local"===Z&&!P(ba,U))throw new p("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",
{});}function P(ba,U){return ba.equals(U)||ba.isWGS84&&U.isWebMercator||ba.isWebMercator&&U.isWGS84}function M(ba,U,Z){const ca=I(ba);ba=O(ba);L(ca,U,Z);L(ba,U,Z)}const K=v.create();a.MbsIntersectResult=void 0;(function(ba){ba[ba.OUTSIDE=0]="OUTSIDE";ba[ba.INTERSECTS_CENTER_OUTSIDE=1]="INTERSECTS_CENTER_OUTSIDE";ba[ba.INTERSECTS_CENTER_INSIDE=2]="INTERSECTS_CENTER_INSIDE";ba[ba.INSIDE=3]="INSIDE"})(a.MbsIntersectResult||(a.MbsIntersectResult={}));const J=-(2**31);b=x.createSolidEdgeMaterial({color:[0,
0,0,0],opacity:0});class R{constructor(){this.material=this.edgeMaterial=null;this.castShadows=!0}}const Q=[g.create(),g.create(),g.create(),g.create(),g.create(),g.create(),g.create(),g.create()],W=v.create(),S=v.create(),V=new z.Obb,T=g.create(),Y={data:Array(72),size:3,exclusive:!0,stride:3},ha=c.create();a.SymbolInfo=R;a.addWraparound=function(ba,U){return(ba|0)+(U|0)|0};a.checkPointCloudLayerCompatibleWithView=function(ba,U){L(ba.spatialReference,U.spatialReference,U.viewingMode)};a.checkPointCloudLayerValid=
function(ba){var U;(U=null==ba.store?.defaultGeometrySchema)||(ba=ba.store.defaultGeometrySchema,U=!!(null==ba.geometryType||"points"!==ba.geometryType||null!=ba.topology&&"PerAttributeArray"!==ba.topology||null!=ba.encoding&&""!==ba.encoding&&"lepcc-xyz"!==ba.encoding||null==ba.vertexAttributes?.position));if(U)throw new p("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",{});};a.checkRecyclable=function(ba,U,Z){if(ba.serviceUpdateTimeStamp?.lastUpdate!==
U.serviceUpdateTimeStamp?.lastUpdate||!Z.isEmpty||ba.associatedLayer?.url!==U.associatedLayer?.url)throw new p("layerview:recycle-failed");};a.checkSceneLayerCompatibleWithView=function(ba,U){M(ba,U.spatialReference,U.viewingMode)};a.checkSceneLayerValid=function(ba){var U;(U=null==ba.store?.defaultGeometrySchema)||(U=ba.store.defaultGeometrySchema,U=!!(null!=U.geometryType&&"triangles"!==U.geometryType||null!=U.topology&&"PerAttributeArray"!==U.topology||null==U.vertexAttributes?.position));if(U)throw new p("scenelayer:unsupported-geometry-schema",
"The geometry schema of this scene layer is not supported.",{url:ba.parsedUrl.path});};a.checkSpatialReference=L;a.checkSpatialReferences=M;a.computeVisibilityObb=function(ba,U,Z,ca,ea,da,ia){if(!da||0===da.length||null==U||!ba.serviceMbsInIndexSR)return null;const ka=u.computeGlobalTransformation(ba.serviceMbsInIndexSR,ea,"none",Z,U);f.invert(ha,ka);let fa=null;const X=()=>{if(!fa)if(fa=Q,v.empty(S),null!=ba.serviceObbInIndexSR){ba.serviceObbInIndexSR.transform(V,Z,U,ea,ia);V.getCorners(fa);for(var va of fa)e.transformMat4(va,
va,ha),v.expandPointInPlace(S,va)}else{var za=ba.serviceMbsInIndexSR;if(za)for(va=za[3],w.projectVectorToVector(m.getCenter(za),Z,T,U),e.transformMat4(T,T,ha),T[2]+=ea,za=0;8>za;++za){const ya=fa[za];e.copy(ya,[T[0]+(za&1?va:-va),T[1]+(za&2?va:-va),T[2]+(za&4?va:-va)]);v.expandPointInPlace(S,ya)}}};let ja=Infinity,la=-Infinity;const na=va=>{if("replace"===va.type&&(va=va.geometry,va?.hasZ)){v.empty(W);var za=va.spatialReference||ca;va=va.rings.reduce((ya,Da)=>Da.reduce((ra,xa)=>{e.set(T,xa[0],xa[1],
xa[2]);w.projectVectorToVector(T,za,T,U);e.transformMat4(T,T,ha);v.expandPointInPlace(W,T);return Math.min(T[2],ra)},ya),Infinity);X();v.intersects(S,W)&&(ja=Math.min(ja,va),la=Math.max(la,va))}};da.forEach(va=>na(va));if(Infinity===ja)return null;da=(va,za,ya)=>{e.transformMat4(T,ya,ka);va[za]=T[0];va[za+1]=T[1];va[za+2]=T[2];za+=24;ya[2]=ja;e.transformMat4(T,ya,ka);va[za]=T[0];va[za+1]=T[1];va[za+2]=T[2];za+=24;ya[2]=la;e.transformMat4(T,ya,ka);va[za]=T[0];va[za+1]=T[1];va[za+2]=T[2]};for(let va=
0;8>va;++va)da(Y.data,3*va,fa[va]);return z.compute(Y)};a.containsDraco=function(ba){if(k("disable-feature:i3s-draco")||!ba)return!1;for(const U of ba)for(const Z of U.geometryBuffers)if("draco"===Z.compressedAttributes?.encoding)return!0;return!1};a.extractWkid=B;a.filterInPlace=function(ba,U,Z){let ca=0,ea=0;for(let da=0;da<U.length&&ca<ba.length;da++)ba[ca]===U[da]&&(Z(da)&&(ba[ea]=ba[ca],ea++),ca++);ba.length=ea};a.findFieldsCaseInsensitive=D;a.findIntersectingNodes=function(ba,U,Z,ca){Z.traverse(U,
ea=>{const da=ea.serviceMbsInIndexSR;if((null!=da&&C(ba,da))===a.MbsIntersectResult.OUTSIDE)return!1;ca(ea);return!0})};a.getCacheKeySuffix=function(ba,U){return null==U?"@null":U===t.getSphericalPCPF(U)?"@ECEF":ba.equals(U)?"":null!=U.wkid?"@"+U.wkid:null};a.getCachedAttributeValue=G;a.getClipRect=function(ba,U){if(0===U.rotationScale[1]&&0===U.rotationScale[2]&&0===U.rotationScale[3]&&0===U.rotationScale[5]&&0===U.rotationScale[6]&&0===U.rotationScale[7])return K[0]=(ba[0]-U.position[0])/U.rotationScale[0],
K[1]=(ba[1]-U.position[1])/U.rotationScale[4],K[2]=(ba[2]-U.position[0])/U.rotationScale[0],K[3]=(ba[3]-U.position[1])/U.rotationScale[4],K};a.getIndexCrs=I;a.getSymbolInfo=function(ba){const U=new R;var Z=!1;let ca=!1;for(const da of ba.symbolLayers.items)if("fill"===da.type&&da.enabled){var ea=da.material;ba=da.edges;null==ea||Z||(Z=ea.color,ea=y.parseColorMixMode(ea.colorMixMode),U.material=null!=Z?{color:[Z.r/255,Z.g/255,Z.b/255],alpha:Z.a,colorMixMode:ea}:{color:[1,1,1],alpha:1,colorMixMode:y.ColorMixModeEnum.Multiply},
U.castShadows=da.castShadows,Z=!0);null==ba||ca||(U.edgeMaterial=x.createMaterialFromEdges(ba,{}),ca=!0)}U.material||(U.material={color:[1,1,1],alpha:1,colorMixMode:y.ColorMixModeEnum.Multiply});return U};a.getVertexCrs=O;a.intersectBoundingRectWithMbs=C;a.invalidateMbs=function(ba){null!=ba&&(ba[3]=-1)};a.isSupportedLocalModeProjection=P;a.isValidMbs=function(ba){return 0<=ba[3]};a.objectIdFilter=function(ba,U,Z){let ca=0,ea=0;for(;ca<Z.length;)0<=l.binaryIndexOf(ba,Z[ca])===U&&(Z[ea]=Z[ca],ea++),
ca++;Z.length=ea};a.queryAttributesFromCachedAttributesId=E;a.rendererNeedsTextures=function(ba){if(null==ba||"simple"!==ba.type&&"class-breaks"!==ba.type&&"unique-value"!==ba.type||("unique-value"===ba.type||"class-breaks"===ba.type)&&null==ba.defaultSymbol)return!0;ba=ba.getSymbols();if(0===ba.length)return!0;for(const U of ba){if("mesh-3d"!==U.type||0===U.symbolLayers.length)return!0;for(const Z of U.symbolLayers.items)if("fill"!==Z.type||null==Z.material?.color||"replace"!==Z.material.colorMixMode)return!0}return!1};
a.transparentEdgeMaterial=b;a.whenGraphicAttributes=async function(ba,U,Z,ca,ea,da){if(0===U.length)return[];const ia=ba.attributeStorageInfo;if(null!=ba.associatedLayer)try{return await H(ba.associatedLayer,U,Z,ca,da)}catch(ka){if(ba.associatedLayer.loaded)throw ka;}if(ia){U=F(U,Z,ea);if(null==U)throw new p("scenelayer:features-not-loaded","Tried to query attributes for unloaded features");const ka=ba.parsedUrl.path;return(await Promise.all(U.map(fa=>E(ka,ia,fa.node.resources.attributes,fa.indices,
ca,ba.apiKey,ba.customParameters,da).then(X=>{for(let ja=0;ja<fa.graphics.length;ja++){const la=fa.graphics[ja],na=X[ja];if(la.attributes)for(const va in la.attributes)va in na||(na[va]=la.attributes[va]);la.attributes=na}return fa.graphics})))).flat()}throw new p("scenelayer:no-attribute-source","This scene layer does not have a source for attributes available");};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SBinaryReader":function(){define("exports ../../../../core/Error ../../../../core/lang ../../../../core/Logger ./LEPCC ../../webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k){function h(A,B){const C={byteOffset:0,byteCount:0,fields:Object.create(null)};let D=0;for(let F=0;F<B.length;F++){const H=B[F],N=H.valueType||H.type;C.fields[H.property]=(0,z[N])(A,D);D+=y[N].BYTES_PER_ELEMENT}C.byteCount=D;return C}function f(A,B,C){return c(A,B,C).map(D=>{D=D?Date.parse(D):null;return null==D||Number.isNaN(D)?null:D})}function c(A,B,C){const D=[];let F,H=0,N;for(N=0;N<A;N+=1){F=B[N];if(0<F){var E=D,G=E.push,I=C,O=H,L=F-1;let M="",K=0;for(;K<L;){var P=I[O+K];
if(128>P)M+=String.fromCharCode(P),K++;else if(192<=P&&224>P){if(K+1>=L)throw new b("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");M+=String.fromCharCode((P&31)<<6|I[O+K+1]&63);K+=2}else if(224<=P&&240>P){if(K+2>=L)throw new b("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");M+=String.fromCharCode((P&15)<<12|(I[O+K+1]&63)<<6|I[O+K+2]&63);K+=3}else if(240<=P&&248>P){if(K+3>=L)throw new b("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");
P=(P&7)<<18|(I[O+K+1]&63)<<12|(I[O+K+2]&63)<<6|I[O+K+3]&63;M=65536<=P?M+String.fromCharCode((P-65536>>10)+55296,(P&1023)+56320):M+String.fromCharCode(P);K+=4}else throw new b("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");}G.call(E,M);if(0!==C[H+F-1])throw new b("string-array-error","Invalid string array: missing null termination.");}else D.push(null);H+=F}return D}function e(A,B){return new y[B.valueType](A,B.byteOffset,B.count*B.valuesPerElement)}function g(A,B){return new Uint8Array(A,
B.byteOffset,B.byteCount)}function d(A,B,C){A=null!=B.header?h(A,B.header):{byteOffset:0,byteCount:0,fields:{count:C}};C={header:A,byteOffset:A.byteCount,byteCount:0,entries:Object.create(null)};let D=A.byteCount;for(let F=0;F<B.ordering.length;F++){const H=B.ordering[F],N=q.clone(B[H]);N.count=A.fields.count??0;if("String"===N.valueType){N.byteOffset=D;N.byteCount=A.fields[H+"ByteCount"];if("UTF-8"!==N.encoding)throw new b("unsupported-encoding","Unsupported String encoding.",{encoding:N.encoding});
if(N.timeEncoding&&"ECMA_ISO8601"!==N.timeEncoding)throw new b("unsupported-time-encoding","Unsupported time encoding.",{timeEncoding:N.timeEncoding});}else if(r(N.valueType)){const E=n(N.valueType);D+=0!==D%E?E-D%E:0;N.byteOffset=D;N.byteCount=E*N.valuesPerElement*N.count}else throw new b("unsupported-value-type","Unsupported binary valueType",{valueType:N.valueType});D+=N.byteCount??0;C.entries[H]=N}C.byteCount=D-C.byteOffset;return C}function t(A,B,C){B!==A&&u().error(`Invalid ${C} buffer size\n expected: ${A}, actual: ${B})`);
if(B<A)throw new b("buffer-too-small","Binary buffer is too small",{expectedSize:A,actualSize:B});}function w(A){return{isDraco:!1,isLegacy:!1,color:null!=A.color,normal:null!=A.normal,uv0:null!=A.uv0,uvRegion:null!=A.uvRegion,featureIndex:null!=A.faceRange&&null!=A.featureId}}function v(A){const B={isDraco:!1,isLegacy:!0,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const C of A.ordering)if(A.vertexAttributes[C])switch(C){case "normal":B.normal=!0;break;case "color":B.color=!0;break;
case "uv0":B.uv0=!0;break;case "region":B.uvRegion=!0}A.featureAttributes&&A.featureAttributeOrder&&(B.featureIndex=!0);return B}function m(A){const B={isDraco:!0,isLegacy:!1,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const C of A)switch(C){case "normal":B.normal=!0;break;case "uv0":B.uv0=!0;break;case "color":B.color=!0;break;case "uv-region":B.uvRegion=!0;break;case "feature-index":B.featureIndex=!0}return B}function r(A){return y.hasOwnProperty(A)}function n(A){return r(A)?y[A].BYTES_PER_ELEMENT:
0}const u=()=>l.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader"),x={position:k.VertexAttribute.POSITION,normal:k.VertexAttribute.NORMAL,color:k.VertexAttribute.COLOR,uv0:k.VertexAttribute.UV0,region:k.VertexAttribute.UVREGION},y={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array},z={Float32:(A,B)=>(new DataView(A,0)).getFloat32(B,!0),Float64:(A,B)=>(new DataView(A,0)).getFloat64(B,!0),UInt8:(A,B)=>
(new DataView(A,0)).getUint8(B),Int8:(A,B)=>(new DataView(A,0)).getInt8(B),UInt16:(A,B)=>(new DataView(A,0)).getUint16(B,!0),Int16:(A,B)=>(new DataView(A,0)).getInt16(B,!0),UInt32:(A,B)=>(new DataView(A,0)).getUint32(B,!0),Int32:(A,B)=>(new DataView(A,0)).getInt32(B,!0)};a.createAttributeDataIndex=d;a.createGeometryDescriptor=function(A,B){return A&&A.compressedAttributes&&"draco"===A.compressedAttributes.encoding?m(A.compressedAttributes.attributes):A?w(A):v(B)};a.createGeometryDescriptorForDraco=
m;a.createGeometryDescriptorFromDefinition=w;a.createGeometryDescriptorFromSchema=v;a.createGeometryIndexFromSchema=function(A,B){var C=h(A,B&&B.header);let D=C.byteCount;const F={isDraco:!1,header:C,byteOffset:C.byteCount,byteCount:0,vertexAttributes:{}};C=C.fields;var H=null!=C.vertexCount?C.vertexCount:C.count;for(var N of B.ordering){if(!B.vertexAttributes[N])continue;const G={...B.vertexAttributes[N],byteOffset:D,count:H};F.vertexAttributes[x[N]||"_"+N]=G;D+=n(G.valueType)*G.valuesPerElement*
H}N=C.faceCount;if(B.faces&&N){F.faces={};for(var E of B.ordering)B.faces[E]&&(H={...B.faces[E],byteOffset:D,count:N},F.faces[E]=H,D+=n(H.valueType)*H.valuesPerElement*N)}E=C.featureCount;if(B.featureAttributes&&B.featureAttributeOrder&&E){F.featureAttributes={};for(const G of B.featureAttributeOrder)B.featureAttributes[G]&&(C={...B.featureAttributes[G],byteOffset:D,count:E},F.featureAttributes[G]=C,N="UInt64"===C.valueType?8:n(C.valueType),D+=N*C.valuesPerElement*E)}t(D,A.byteLength,"geometry");
F.byteCount=D-F.byteOffset;return F};a.createRawView=g;a.createTypedView=e;a.getBytesPerValue=n;a.isValueType=r;a.readBinaryAttribute=function(A,B,C){if("lepcc-rgb"===A.encoding)return p.decodeRGB(B);if("lepcc-intensity"===A.encoding)return p.decodeIntensity(B);if(null!=A.encoding&&""!==A.encoding)throw new b("unknown-attribute-storage-info-encoding","Unknown Attribute Storage Info Encoding");A["attributeByteCounts "]&&!A.attributeByteCounts&&(u().warn("Warning: Trailing space in 'attributeByteCounts '."),
A.attributeByteCounts=A["attributeByteCounts "]);"ObjectIds"===A.ordering[0]&&A.hasOwnProperty("objectIds")&&(u().warn("Warning: Case error in objectIds"),A.ordering[0]="objectIds");C=d(B,A,C);t(C.byteOffset+C.byteCount,B.byteLength,"attribute");if(A=C.entries.attributeValues||C.entries.objectIds){if("String"===A.valueType){C=C.entries.attributeByteCounts;const D=e(B,C);B=g(B,A);return A.timeEncoding?f(C.count,D,B):c(C.count,D,B)}return e(B,A)}throw new b("bad-attribute-storage-info","Bad attributeStorageInfo specification.");
};a.readDateStringArray=f;a.readHeader=h;a.readStringArray=c;a.valueType2ArrayBufferReader=z;a.valueType2TypedArrayClassMap=y;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/LEPCC":function(){define(["exports","../../../../core/Error"],function(a,b){function q(h,f,c){return{identifier:String.fromCharCode.apply(null,new Uint8Array(h,c+k.identifierOffset,k.identifierLength)),version:f.getUint16(c+k.versionOffset,!0),checksum:f.getUint32(c+k.checksumOffset,!0)}}
function l(h,f,c){const e=[];f=p(h,f,e);const g=[];for(let d=0;d<e.length;d++){g.length=0;f=p(h,f,g);for(let t=0;t<g.length;t++)c.push(g[t]+e[d])}return f}function p(h,f,c){var e=new DataView(h,f),g=e.getUint8(0);const d=g&31;var t=!!(g&32),w=(g&192)>>6;g=0;if(0===w)g=e.getUint32(1,!0),f+=5;else if(1===w)g=e.getUint16(1,!0),f+=3;else if(2===w)g=e.getUint8(1),f+=2;else throw new b("lepcc-decode-error","Bad count type");if(t)throw new b("lepcc-decode-error","LUT not implemented");h=new Uint8Array(h,
f,Math.ceil(g*d/8));w=t=e=0;const v=-1>>>32-d;for(let m=0;m<g;m++){for(;t<d;)e|=h[w]<<t,t+=8,w+=1;c[m]=e&v;e>>>=d;t-=d;32<t+d&&(e|=h[w-1]>>8-t)}return f+w}const k={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};a.decodeIntensity=function(h){const f=new DataView(h,0);var c=0;const {identifier:e,version:g}=q(h,f,c);c+=k.byteCount;if("Intensity "!==e)throw new b("lepcc-decode-error","Bad identifier");if(1<g)throw new b("lepcc-decode-error","Unknown version");
var d=c;var t=f.getUint32(d+0,!0);var w=f.getUint32(d+4,!0);var v=f.getUint32(d+8,!0);var m=f.getUint16(d+12,!0);var r=f.getUint8(d+14);f.getUint8(d+15);c+=16;if(w*2**32+t!==h.byteLength)throw new b("lepcc-decode-error","Bad size");t=new Uint16Array(v);if(8===r){if(v+c!==h.byteLength)throw new b("lepcc-decode-error","Bad size");h=new Uint8Array(h,c,v);for(c=0;c<v;c++)t[c]=h[c]*m}else if(16===r){if(2*v+c!==h.byteLength)throw new b("lepcc-decode-error","Bad size");h=new Uint16Array(h,c,v);for(c=0;c<
v;c++)t[c]=h[c]*m}else{r=[];if(p(h,c,r)!==h.byteLength)throw new b("lepcc-decode-error","Bad size");for(h=0;h<v;h++)t[h]=r[h]*m}return t};a.decodeRGB=function(h){var f=new DataView(h,0),c=0;const {identifier:e,version:g}=q(h,f,c);c+=k.byteCount;if("ClusterRGB"!==e)throw new b("lepcc-decode-error","Bad identifier");if(1<g)throw new b("lepcc-decode-error","Unknown version");var d=c;var t=f.getUint32(d+0,!0);var w=f.getUint32(d+4,!0);var v=f.getUint32(d+8,!0);var m=f.getUint16(d+12,!0);var r=f.getUint8(d+
14);d=f.getUint8(d+15);c+=16;if(w*2**32+t!==h.byteLength)throw new b("lepcc-decode-error","Bad size");if((2===r||1===r)&&0===d){if(3*m+v+c!==h.byteLength||256<m)throw new b("lepcc-decode-error","Bad count");f=new Uint8Array(h,c,3*m);c=new Uint8Array(h,c+3*m,v);h=new Uint8Array(3*v);for(m=0;m<v;m++)t=c[m],h[3*m]=f[3*t],h[3*m+1]=f[3*t+1],h[3*m+2]=f[3*t+2];return h}if(0===r&&0===d){if(3*v+c!==h.byteLength||0!==m)throw new b("lepcc-decode-error","Bad count");return(new Uint8Array(h,c)).slice()}if(2>=
r&&1===d){if(c+3!==h.byteLength||1!==m)throw new b("lepcc-decode-error","Bad count");h=f.getUint8(c);m=f.getUint8(c+1);c=f.getUint8(c+2);f=new Uint8Array(3*v);for(t=0;t<v;t++)f[3*t]=h,f[3*t+1]=m,f[3*t+2]=c;return f}throw new b("lepcc-decode-error","Bad method "+r+","+d);};a.decodeXYZ=function(h){var f=new DataView(h,0),c=0;const {identifier:e,version:g}=q(h,f,c);c+=k.byteCount;if("LEPCC "!==e)throw new b("lepcc-decode-error","Bad identifier");if(1<g)throw new b("lepcc-decode-error","Unknown version");
var d=c;var t=f.getUint32(d+0,!0);var w=f.getUint32(d+4,!0);var v=f.getFloat64(d+8,!0);var m=f.getFloat64(d+16,!0);var r=f.getFloat64(d+24,!0);var n=f.getFloat64(d+32,!0);var u=f.getFloat64(d+40,!0);var x=f.getFloat64(d+48,!0);var y=f.getFloat64(d+56,!0);var z=f.getFloat64(d+64,!0);var A=f.getFloat64(d+72,!0);var B=f.getUint32(d+80,!0);f.getUint32(d+84,!0);c+=88;if(w*2**32+t!==h.byteLength)throw new b("lepcc-decode-error","Bad size");t=new Float64Array(3*B);w=[];B=[];f=[];d=[];c=l(h,c,w);c=l(h,c,
B);c=l(h,c,f);c=l(h,c,d);if(c!==h.byteLength)throw new b("lepcc-decode-error","Bad length");c=h=0;for(let C=0;C<w.length;C++){c+=w[C];let D=0;for(let F=0;F<B[C];F++){D+=f[h];const H=d[h];t[3*h]=Math.min(n,v+2*y*D);t[3*h+1]=Math.min(u,m+2*z*c);t[3*h+2]=Math.min(x,r+2*A*H);h++}}return{errorX:y,errorY:z,errorZ:A,result:t}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SProjectionUtil":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/mat4f64",
"../../../../core/libs/gl-matrix-2/factories/vec3f64","../../../../geometry/ellipsoidUtils","../../../../geometry/projection/computeTranslationToOriginAndRotation"],function(a,b,q,l,p){function k(h,f,c){const e=q.create(),g=2**(4*Math.ceil(Math.log(h[3])*Math.LOG2E/4)+1);if(c.isGeographic){var d=g/l.getReferenceEllipsoid(c).radius*180/Math.PI;c=Math.max(-90,Math.min(90,Math.round(h[1]/d)*d));d/=Math.cos((Math.abs(c)-d/2)/180*Math.PI);e[0]=Math.round(h[0]/d)*d;e[1]=c}else c=Math.round(h[1]/g),e[0]=
Math.round(h[0]/g)*g,e[1]=c*g;e[2]=Math.round((h[2]+f)/g)*g;return e}a.computeGlobalTransformation=function(h,f,c,e,g){h="east-north-up"===c?q.clone(h):k(h,f,e);f=b.create();p.computeTranslationToOriginAndRotation(e,h,f,g);return f};a.getLocalOrigin=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/layers/support/popupUtils":function(){define(["exports","../../../layers/support/fieldUtils"],function(a,b){function q(l,p){return l.popupTemplate?l.popupTemplate:null!=p&&p.defaultPopupTemplateEnabled&&
null!=l.defaultPopupTemplate?l.defaultPopupTemplate:null}a.getFetchPopupTemplate=q;a.getRequiredFields=async function(l,p=l.popupTemplate){if(null==p)return[];const k=await p.getRequiredFields(l.fieldsIndex);({lastEditInfoEnabled:p}=p);const {objectIdField:h,typeIdField:f,globalIdField:c,relationships:e}=l;if(k.includes("*"))return["*"];p=p?b.getFeatureEditFields(l):[];const g=b.fixFields(l.fieldsIndex,[...k,...p]);f&&g.push(f);g&&h&&l.fieldsIndex?.has(h)&&!g.includes(h)&&g.push(h);g&&c&&l.fieldsIndex?.has(c)&&
!g.includes(c)&&g.push(c);e&&e.forEach(d=>{({keyField:d}=d);g&&d&&l.fieldsIndex?.has(d)&&!g.includes(d)&&g.push(d)});return g};a.hasPopupTemplate=function(l,p){return null!=q(l,{defaultPopupTemplateEnabled:p})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/ElevationLayerView3D":function(){define("../../../chunks/tslib.es6 ../../../core/Error ../../../core/Logger ../../../core/maybe ../../../core/promiseUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../layers/support/ElevationTileData ../../../layers/support/LercDecoder ./LayerView3D ./TiledLayerView3D ../terrain/TerrainConst ../terrain/terrainUtils ../../layers/LayerView".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){h=class extends t.TiledLayerView3D(d.LayerView3D(m)){constructor(){super(...arguments);this.type="elevation-3d"}get tileInfo(){return this.layer.tileInfo}initialize(){const r=this.view;var n=r.map?.allLayers;n=n&&n.includes(this.layer);var u=r.map?.ground?.layers;u=u&&u.includes(this.layer);n&&!u&&(n=new b("layerview:elevation-layer-only",`3D elevation layer '${this.layer.id}' can only be added to layers in map.ground`),this.addResolvingPromise(Promise.reject(n)));
this._lercDecoder=g.acquireDecoder(r.resourceController);this._addTilingSchemeMatchPromise()}destroy(){this._lercDecoder=l.releaseMaybe(this._lercDecoder)}async fetchTile(r,n){const u=this.layer;if(v.useFetchTileForLayer(u)){r=await u.fetchTile(r[0],r[1],r[2],{noDataValue:w.elevationNoDataValue,signal:n.signal});if(p.isAborted(n)){q.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true.");return}return r}r=
this.getTileUrl(r);r=await n.requester.request(r,"binary",n);if(n=await this._lercDecoder.decode(r,{noDataValue:w.elevationNoDataValue},n.signal))return new e.ElevationTileData(n);throw Error("LERC decoding failed");}};a.__decorate([k.property()],h.prototype,"layer",void 0);a.__decorate([k.property()],h.prototype,"tileInfo",null);return h=a.__decorate([c.subclass("esri.views.3d.layers.ElevationLayerView3D")],h)})},"esri/layers/support/ElevationTileData":function(){define(["exports"],function(a){class b{constructor(q,
l,p,k){this._maxValue=this._minValue=this._hasNoDataValues=null;"pixelData"in q?(this.values=q.pixelData,this.width=q.width,this.height=q.height,this.noDataValue=q.noDataValue):(this.values=q,this.width=l,this.height=p,this.noDataValue=k)}get hasNoDataValues(){null==this._hasNoDataValues&&(this._hasNoDataValues=this.values.includes(this.noDataValue));return this._hasNoDataValues}get minValue(){this._ensureBounds();return this._minValue}get maxValue(){this._ensureBounds();return this._maxValue}_ensureBounds(){if(null==
this._minValue){var {noDataValue:q,values:l}=this,p=Infinity,k=-Infinity,h=!0;for(const f of l)f===q?this._hasNoDataValues=!0:(p=f<p?f:p,k=f>k?f:k,h=!1);h?this._maxValue=this._minValue=0:(this._minValue=p,this._maxValue=-3E38<k?k:0)}}}a.ElevationTileData=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/LercDecoder":function(){define(["exports","../../core/workers/WorkerHandle"],function(a,b){class q extends b.WorkerHandle{constructor(p=null){super("LercWorker",
"_decode",{_decode:k=>[k.buffer]},p,{strategy:"dedicated"});this.schedule=p;this.ref=0}decode(p,k,h){return p&&0!==p.byteLength?this.invoke({buffer:p,options:k},h):Promise.resolve(null)}release(){0>=--this.ref&&(l.forEach((p,k)=>{p===this&&l.delete(k)}),this.destroy())}}const l=new Map;a.acquireDecoder=function(p=null){let k=l.get(p);k||(null!=p?(k=new q(h=>p.immediate.schedule(h)),l.set(p,k)):(k=new q,l.set(null,k)));++k.ref;return k};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/core/workers/WorkerHandle":function(){define("exports ../arrayUtils ../handleUtils ../Logger ../promiseUtils ./workers".split(" "),function(a,b,q,l,p,k){class h{constructor(f,c,e,g,d={}){this._mainMethod=c;this._transferLists=e;this._listeners=[];this._promise=k.open(f,{...d,schedule:g}).then(t=>{if(void 0===this._thread){this._thread=t;this._promise=null;d.hasInitialize&&this.broadcast({},"initialize");for(const w of this._listeners)this._connectListener(w)}else t.close()});this._promise.catch(t=>
l.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${f} worker: ${t}`))}on(f,c){const e={removed:!1,eventName:f,callback:c,threadHandle:null};this._listeners.push(e);this._connectListener(e);return q.makeHandle(()=>{e.removed=!0;b.remove(this._listeners,e);this._thread&&null!=e.threadHandle&&e.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null);this._promise=null;this._listeners.length=0;this._transferLists={}}invoke(f,c){return this.invokeMethod(this._mainMethod,
f,c)}invokeMethod(f,c,e){if(this._thread){var g=this._transferLists[f];g=g?g(c):[];return this._thread.invoke(f,c,{transferList:g,signal:e})}return this._promise?this._promise.then(()=>{p.throwIfAborted(e);return this.invokeMethod(f,c,e)}):Promise.reject(null)}broadcast(f,c){return this._thread?Promise.all(this._thread.broadcast(c,f)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(f,c)):Promise.reject()}get promise(){return this._promise}_connectListener(f){this._thread&&this._thread.on(f.eventName,
f.callback).then(c=>{f.removed||(f.threadHandle=c)})}}a.WorkerHandle=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/LayerView3D":function(){define("exports ../../../chunks/tslib.es6 ../../../core/handleUtils ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/support/heightModelInfoUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){a.LayerView3D=d=>{d=class extends d{constructor(){super(...arguments);this.supportsHeightUnitConversion=this.slicePlaneEnabled=!1}postscript(){super.postscript();g.supportsHeightModelInfo(this.layer)&&this.addResolvingPromise(this._validateHeightModelInfo())}async _validateHeightModelInfo(){const t=new AbortController;var w=t.signal;this.addHandles(q.makeHandle(()=>t.abort()));await p.whenOnce(()=>this.view.defaultsFromMap?.heightModelInfoReady,w);l.throwIfAborted(w);
if(w=g.rejectLayerError(this.layer,this.view.heightModelInfo,this.supportsHeightUnitConversion))throw w;}};b.__decorate([k.property()],d.prototype,"view",void 0);b.__decorate([k.property()],d.prototype,"slicePlaneEnabled",void 0);return d=b.__decorate([e.subclass("esri.views.3d.layers.LayerView3D")],d)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/TiledLayerView3D":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Error ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./support/LayerViewPerformanceInfo ../support/updatingProperties ../terrain/terrainUtils ../../support/layerViewUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.TiledLayerView3D=w=>{w=class extends w{constructor(){super(...arguments);this.hasMixedImageFormats=!0}get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return 1<=this.fullOpacity&&this.imageFormatIsOpaque}get visibleAtCurrentScale(){if(!t.isScaleRangeActive(this.layer.minScale,this.layer.maxScale)||!this.view.terrainScale)return!0;const v=Math.round(this.view.basemapTerrain.tilingScheme.levelAtScale(this.view.terrainScale));
return v>=this.displayLevelRange.minLevel&&v<=this.displayLevelRange.maxLevel}get dataScaleRange(){var v=this.tileInfo.lods;let m=v[0].scale;v=v[v.length-1].scale;if("tilemapCache"in this.layer&&this.layer.tilemapCache){const {effectiveMinLOD:r,effectiveMaxLOD:n}=this.layer.tilemapCache;m=this.tileInfo.lodAt(r).scale;v=this.tileInfo.lodAt(n).scale}return{minScale:m,maxScale:v}}canResume(){const v=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&
this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&t.validateScaleRange(v)&&this.visibleAtCurrentTimeExtent||!1}get dataLevelRange(){const {minScale:v,maxScale:m}=this.dataScaleRange;return this.levelRangeFromScaleRange(v,m)}get displayLevelRange(){const v=this.levelRangeFromScaleRange(this.layer.minScale||this.dataScaleRange.minScale,this.layer.maxScale||this.dataScaleRange.maxScale);this.layer.maxScale&&v.maxLevel++;return v}get performanceInfo(){return new e.LayerViewPerformanceInfo(this.view.basemapTerrain.getUsedMemoryForLayerView(this))}getTileUrl(v){return this.layer.getTileUrl(v[0],
v[1],v[2])}_addTilingSchemeMatchPromise(){if(null==this.fullExtent)return this.addResolvingPromise(Promise.reject(new q("tilingscheme:extent-not-defined","This layer doesn't define a fullExtent.")));const v=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(v)return this.addResolvingPromise(Promise.reject(v));this.addResolvingPromise(l.whenOnce(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const m=this._getTileInfoCompatibilityError(this.tileInfo,this.view.basemapTerrain.tilingScheme,
"tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0);if(m)throw m;}))}_getTileInfoSupportError(v,m){if(v=d.checkIfTileInfoSupportedForView(v,m,this.view.spatialReference,this.view.state.viewingMode,"tilemapCache"in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0))switch(m={layer:this.layer,error:v},v.name){case "tilingscheme:spatial-reference-mismatch":case "tilingscheme:global-unsupported-spatial-reference":case "tilingscheme:local-unsupported-spatial-reference":return new q("layerview:spatial-reference-incompatible",
"The spatial reference of this layer does not meet the requirements of the view",m);default:return new q("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",m)}}_getTileInfoCompatibilityError(v,m,r){return null!=v&&m.compatibleWith(v,r)?null:new q("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface")}levelRangeFromScaleRange(v,m){const r={minLevel:0,maxLevel:Infinity};var n=
this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.tilingScheme;if(!n)return r;const u=n.levels[0];n=x=>{x=Math.log(u.scale/x)/Math.LN2;return 1E-9>.5-Math.abs(.5-x%1)?Math.round(x):Math.ceil(x)};null!=v&&0<v&&(r.minLevel=Math.max(0,n(v)));null!=m&&0<m&&(r.maxLevel=Math.max(0,n(m)));return r}isUpdating(){return!!(this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.updating)}};b.__decorate([p.property({readOnly:!0})],w.prototype,"imageFormatIsOpaque",null);b.__decorate([p.property({readOnly:!0})],
w.prototype,"updating",void 0);b.__decorate([p.property(g.updatingProgress)],w.prototype,"updatingProgress",void 0);b.__decorate([p.property(g.updatingProgressValue)],w.prototype,"updatingProgressValue",void 0);b.__decorate([p.property()],w.prototype,"hasMixedImageFormats",void 0);b.__decorate([p.property()],w.prototype,"fullExtent",null);b.__decorate([p.property({readOnly:!0})],w.prototype,"isOpaque",null);b.__decorate([p.property({readOnly:!0})],w.prototype,"visibleAtCurrentScale",null);b.__decorate([p.property()],
w.prototype,"dataScaleRange",null);b.__decorate([p.property({readOnly:!0})],w.prototype,"dataLevelRange",null);b.__decorate([p.property({readOnly:!0})],w.prototype,"displayLevelRange",null);b.__decorate([p.property()],w.prototype,"layer",void 0);return w=b.__decorate([c.subclass("esri.views.3d.layers.TiledLayerView3D")],w)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/FeatureLayerView3D":function(){define("../../../chunks/tslib.es6 ../../../core/Error ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/projection ../../../layers/support/layerUtils ../../../support/featureFlags ./FeatureLayerViewBase3D".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){p=class extends d{constructor(){super(...arguments);this.type="feature-3d";this.direct3DObjectFeatureLayerDisplayEnabled=g.direct3DObjectFeatureLayerDisplayEnabled()}initialize(){const {layer:t,view:w}=this;e.getEffectiveLayerCapabilities(t)?.operations.supportsQuery||this.addResolvingPromise(Promise.reject(new b("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:t})));null!=t.infoFor3D&&(this.direct3DObjectFeatureLayerDisplayEnabled?
this.addResolvingPromise((async()=>{const v=await q.whenOnce(()=>this.graphicsPipeline);this.destroyed||v.destroyed||(v.suspendResumeExtentMode="computed")})()):this.addResolvingPromise(Promise.reject(new b("featurelayerview3d:unsupported-geometry-type",`Unsupported geometry type ${t.geometryType}`))));"mesh"!==t.geometryType||c.canProjectWithoutEngine(t.spatialReference,w.spatialReference)||this.addResolvingPromise(Promise.reject(new b("layerview:spatial-reference-incompatible","The spatial references of the feature layer is incompatible with the spatial reference of the view")))}get featureSpatialReference(){return this.view.featureTiles?.tilingScheme?.spatialReference}};
a.__decorate([l.property({constructOnly:!0})],p.prototype,"direct3DObjectFeatureLayerDisplayEnabled",void 0);a.__decorate([l.property()],p.prototype,"layer",void 0);return p=a.__decorate([f.subclass("esri.views.3d.layers.FeatureLayerView3D")],p)})},"esri/views/3d/layers/FeatureLayerViewBase3D":function(){define("../../../chunks/tslib.es6 ../../../core/Error ../../../core/has ../../../core/maybe ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../layers/graphics/dehydratedFeatures ./FeatureLikeLayerView3D ./LayerView3D ./graphics/FeatureGraphics3DGraphicsPipeline ../support/updatingProperties ../webgl-engine/lib/UpdatePolicy ../../layers/FeatureLayerView ../../layers/LayerView ../../layers/RefreshableLayerView".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){q=class extends n(g.FeatureLikeLayerView3D(m(d.LayerView3D(r)))){constructor(u){super(u)}initialize(){this.addHandles(p.watch(()=>this._updatingRequiredFieldsPromise,u=>this._updatingHandles.addPromise(u),p.syncAndInitial))}destroy(){this._updatingHandles.removeAll();this._fetcherContext=l.destroyMaybe(this._fetcherContext)}get maximumNumberOfFeatures(){return this.graphicsPipeline.maximumNumberOfFeatures}set maximumNumberOfFeatures(u){this.graphicsPipeline.maximumNumberOfFeatures=
u}get maximumNumberOfFeaturesExceeded(){return null!=this.graphicsPipeline&&!this.suspended&&this.graphicsPipeline.maximumNumberOfFeaturesExceeded}get updatingProgressValue(){return this.graphicsPipeline?.updatingProgressValue??0}get updatePolicy(){return this.graphicsPipeline?.updatePolicy??v.UpdatePolicy.ASYNC}get hasZ(){const u=this.layer,x=u.capabilities&&u.capabilities.data;return x&&x.supportsZ?"returnZ"in u&&null!=u.returnZ?u.returnZ:x.supportsZ:!1}get hasM(){const u=this.layer,x=u.capabilities&&
u.capabilities.data;return x&&x.supportsM?"returnM"in u&&null!=u.returnM?u.returnM:!1:!1}setVisibility(u,x){this.graphicsPipeline?.setVisibility(u,x)}createQuery(){return super.createQuery()}queryFeatures(u,x){const y=()=>super.queryFeatures(u,x);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(u),y):y()}createGraphicsPipeline(){return new t.FeatureGraphics3DGraphicsPipeline({layerView:this})}async doRefresh(u){return await this.graphicsPipeline.doRefresh(u)}_popupFeatureHasRequiredFields(u,
x){if(!super._popupFeatureHasRequiredFields(u,x))return!1;u=e.getObjectId(u,this.layer.objectIdField);if(null==u)return!0;u=this.graphicsPipeline.getMissingAttributesForFeature(u);if(null==u)return!0;for(const y of x)if(u.has(y))return!1;return!0}get usedMemory(){return this.graphicsPipeline?.usedMemory??0}get unloadedMemory(){return this.graphicsPipeline?.unloadedMemory??0}get ignoresMemoryFactor(){return this.graphicsPipeline?.ignoresMemoryFactor??!1}async _queryFeaturesMesh(u,x){await this._validateQueryFeaturesMesh(u);
x=await x();const y=this.graphicsPipeline;if(u?.outStatistics||null==y)return x;u=this.layer.objectIdField;const z=[];for(const A of x.features)if(A.geometry){const B=y.getHydratedGeometry(A.attributes[u]);B&&(A.geometry=B,z.push(A))}else z.push(A);x.features=z;return x}async _validateQueryFeaturesMesh(u){if(u){var x=z=>{throw new b("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${z}'`);},y=["quantizationParameters","geometryPrecision","maxAllowableOffset"];
for(const z of y)null!=u[z]&&x(z);"returnM"in u&&u.returnM&&x("returnM");"returnCentroid"in u&&u.returnCentroid&&x("returnCentroid");null==u.outSpatialReference||u.outSpatialReference.equals(this.view.spatialReference)||x("outSpatialReference")}}get test(){}};a.__decorate([k.property()],q.prototype,"layer",void 0);a.__decorate([k.property()],q.prototype,"graphicsPipeline",void 0);a.__decorate([k.property()],q.prototype,"maximumNumberOfFeatures",null);a.__decorate([k.property()],q.prototype,"maximumNumberOfFeaturesExceeded",
null);a.__decorate([k.property(w.updatingProgress)],q.prototype,"updatingProgress",void 0);a.__decorate([k.property({readOnly:!0})],q.prototype,"updatingProgressValue",null);a.__decorate([k.property({readOnly:!0})],q.prototype,"updatePolicy",null);a.__decorate([k.property({readOnly:!0})],q.prototype,"hasZ",null);a.__decorate([k.property({readOnly:!0})],q.prototype,"hasM",null);return q=a.__decorate([c.subclass("esri.views.3d.layers.FeatureLayerViewBase3D")],q)})},"esri/views/3d/layers/FeatureLikeLayerView3D":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Error ../../../core/maybe ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../layers/graphics/hydratedFeatures ../../../layers/support/timeSupport ../../../rest/support/Query ./support/projectExtentUtils ../webgl-engine/lib/UpdatePolicy".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){a.FeatureLikeLayerView3D=v=>{v=class extends v{constructor(){super(...arguments);this.updatePolicy=w.UpdatePolicy.SYNC;this.slicePlaneEnabled=!1;this.fullExtentInLocalViewSpatialReference=null;this.supportsHeightUnitConversion=!0}initialize(){const m=this.layer;"isTable"in m&&m.isTable?this.addResolvingPromise(Promise.reject(new q("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:m}))):(this.addResolvingPromise(this._validateGeometryType()),
this.addResolvingPromise((async()=>{this.fullExtentInLocalViewSpatialReference=await t.toViewIfLocal(this);const r=this.createGraphicsPipeline();this.graphicsPipeline=r;await r.when()})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=l.destroyMaybe(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return!(this.graphicsPipeline?.scaleVisibilitySuspended??
!1)}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return g.combineTimeExtent(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get queryEngine(){return this.graphicsPipeline.queryEngine}getHit(m){var r=this.graphicsPipeline.findGraphic(n=>
n.uid===m);if(null==r)return null;r=e.hydrateGraphic(r,this.layer);return{type:"graphic",graphic:r,layer:r.layer}}whenGraphicBounds(m,r){return this.graphicsPipeline?.whenGraphicBounds(m,r)}computeAttachmentOrigin(m,r){return this.graphicsPipeline?.computeAttachmentOrigin(m,r)}async elevationAlignPointsInFeatures(m,r){return this.graphicsPipeline.elevationAlignPointsInFeatures(m,r)}async queryForSymbologySnapping(m,r){return this.graphicsPipeline.queryForSymbologySnapping(m,r)}queryFeatures(m,r){return this.queryEngine.executeQuery(this._ensureQuery(m),
r?.signal)}queryObjectIds(m,r){return this.queryEngine.executeQueryForIds(this._ensureQuery(m),r?.signal)}queryFeatureCount(m,r){return this.queryEngine.executeQueryForCount(this._ensureQuery(m),r?.signal)}queryExtent(m,r){return this.queryEngine.executeQueryForExtent(this._ensureQuery(m),r?.signal)}_ensureQuery(m){return null==m?this.createQuery():d.from(m)}highlight(m){return this.graphicsPipeline.highlight(m)}maskOccludee(m){return this.graphicsPipeline.maskOccludee(m)}getSuspendInfo(){return{...super.getSuspendInfo(),
...this.graphicsPipeline.suspendInfo}}isUpdating(){return!this.graphicsPipeline||this.graphicsPipeline.destroyed?!1:!(!this.graphicsPipeline?.updating&&this.view?.basemapTerrain?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case "multipatch":case "multipoint":throw new q("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType});}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}};b.__decorate([p.property()],
v.prototype,"graphicsPipeline",void 0);b.__decorate([p.property({readOnly:!0})],v.prototype,"dataUpdating",null);b.__decorate([p.property()],v.prototype,"suspended",void 0);b.__decorate([p.property({readOnly:!0})],v.prototype,"legendEnabled",null);b.__decorate([p.property({readOnly:!0})],v.prototype,"visibleAtCurrentScale",null);b.__decorate([p.property()],v.prototype,"updating",void 0);b.__decorate([p.property({readOnly:!0})],v.prototype,"updatePolicy",void 0);b.__decorate([p.property({type:Boolean})],
v.prototype,"slicePlaneEnabled",void 0);b.__decorate([p.property({readOnly:!0})],v.prototype,"suspendInfo",void 0);b.__decorate([p.property()],v.prototype,"symbologySnappingSupported",null);b.__decorate([p.property({readOnly:!0})],v.prototype,"hasAllFeatures",null);b.__decorate([p.property({readOnly:!0})],v.prototype,"hasAllFeaturesInView",null);b.__decorate([p.property({readOnly:!0})],v.prototype,"hasFullGeometries",null);b.__decorate([p.property({readOnly:!0})],v.prototype,"timeExtent",null);return v=
b.__decorate([c.subclass("esri.views.3d.layers.FeatureLikeLayerView3D")],v)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/timeSupport":function(){define(["exports","../../support/timeUtils"],function(a,b){a.combineTimeExtent=function(q,l,p){if(null==q?.timeInfo)return null;const {datesInUnknownTimezone:k=!1,timeOffset:h,useViewTime:f}=q;q=q.timeExtent;k&&(q=b.toLocalTimeExtent(q));l=f?l&&q?l.intersection(q):l||q:q;if(!l||l.isEmpty||l.isAllTime)return l;h&&(l=
l.offset(-h.value,h.unit));k&&(l=b.toUTCTimeExtent(l));return l.equals(p)?p:l};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/support/timeUtils":function(){define("exports ../TimeExtent ../core/arrayUtils ../core/deprecate ../core/lang ../core/Logger ../core/timeUtils ../webmap/utils ../webscene/utils".split(" "),function(a,b,q,l,p,k,h,f,c){function e(v){return void 0!==v.timeInfo}async function g(v,m){return v.widgets?.timeSlider?.fullTimeExtent??d(v.allLayers,m)}async function d(v,
m){if(0===v.length)return b.allTime;await Promise.all(v.map(x=>x.load({signal:m})));var r=v.filter(e),n=v.filter(x=>!e(x)&&null!=x.visibilityTimeExtent);if(0===r.length&&0===n.length)return b.allTime;v=[];const u=[];for(const x of r)"feature"!==x?.type&&"map-image"!==x?.type||!x.timeInfo?.hasLiveData?u.push(x):v.push(x);r=x=>null==x||x.isAllTime;n=[...u.map(x=>{const y=x.timeInfo?.fullTimeExtent;({visibilityTimeExtent:x}=x);return y?.intersection(x)??x}),...n.map(x=>x.visibilityTimeExtent)];if(n.some(r))return b.allTime;
v=v.map(async x=>{const y=(await x.fetchRecomputedExtents({signal:m}))?.timeExtent??x.timeInfo?.fullTimeExtent;({visibilityTimeExtent:x}=x);return y?.intersection(x)??x});v=(await Promise.allSettled(v)).map(x=>"fulfilled"===x.status?x.value:null);if(v.some(r))return b.allTime;v=[...v,...n].filter(q.isSome);return 0===v.length?b.allTime:v.reduce((x,y)=>x.union(y))}function t(v,m){v=v.currentTimeExtent;if(!v)return null;const {start:r,end:n}=v;v=r??n??null;switch(m){case "time-window":return new b({start:r,
end:n});case "cumulative-from-start":return new b({start:null,end:v});case "cumulative-from-end":return new b({start:v,end:null});case "instant":return new b({start:v,end:v})}}async function w(v,m){if(!f.isWebMap(v)&&!c.isWebScene(v))return null;await v.load({signal:m});var r=v?.widgets?.timeSlider;if(!r)return null;v=await g(v,m);m=r.loop;var n=r.numThumbs??2;var u=r.currentTimeExtent;if(u){const {start:y,end:z}=u;n=null!=y&&null!=z&&y.getTime()===z.getTime()?"instant":2===n?"time-window":null==
y||0===y.getTime()?"cumulative-from-start":"cumulative-from-end"}else n=2===n?"time-window":"cumulative-from-start";u=r.stopDelay??2E3;{const {numStops:y,stopInterval:z,stops:A}=r;var x=A?{dates:p.clone(A)}:z?{interval:z.clone()}:{count:y??5}}r=t(r,n);return{fullTimeExtent:v,loop:m,mode:n,playRate:u,stops:x,timeExtent:r}}a.getTimeExtentFromLayers=d;a.getTimeSliderSettingsFromWebDocument=w;a.getTimeSliderSettingsFromWebMap=async function(v,m){l.deprecatedFunction(k.getLogger("esri.support.timeUtils.getTimeSliderSettingsFromWebMap"),
"`timeUtils.getTimeSliderSettingsFromWebMap` is deprecated in favor of 'timeUtils.getTimeSliderSettingsFromWebDocument'",{replacement:"timeUtils.getTimeSliderSettingsFromWebDocument",version:"4.30",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-support-timeUtils.html#getTimeSliderSettingsFromWebDocument",warnOnce:!0});return null!=v&&f.isWebMap(v)?await w(v,m):null};a.toLocalTimeExtent=function(v){if(!v)return v;const {start:m,end:r}=v;return new b({start:null!=m?h.offsetDate(m,
m.getTimezoneOffset(),"minutes"):m,end:null!=r?h.offsetDate(r,r.getTimezoneOffset(),"minutes"):r})};a.toUTCTimeExtent=function(v){if(!v)return v;const {start:m,end:r}=v;return new b({start:null!=m?h.offsetDate(m,-m.getTimezoneOffset(),"minutes"):m,end:null!=r?h.offsetDate(r,-r.getTimezoneOffset(),"minutes"):r})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webmap/utils":function(){define(["exports"],function(a){a.isWebMap=function(b){return null!=b&&"object"===typeof b&&"declaredClass"in
b&&"esri.WebMap"===b.declaredClass};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webscene/utils":function(){define(["exports","../support/tagSymbols"],function(a,b){a.isWebScene=function(q){return null!=q&&"object"===typeof q&&b.WebSceneTag in q};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/support/tagSymbols":function(){define(["exports"],function(a){const b=Symbol("WebScene");a.WebSceneTag=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/layers/support/projectExtentUtils":function(){define(["exports","../../../../geometry/support/webMercatorUtils","../../../../portal/support/geometryServiceUtils"],function(a,b,q){a.toViewIfLocal=function(l){const p=l.view.spatialReference,k=l.layer.fullExtent;var h=null!=k&&k.spatialReference;if(null==k||!h)return Promise.resolve(null);if(h.equals(p))return Promise.resolve(k.clone());h=b.project(k,p);return null!=h?Promise.resolve(h):l.view.state.isLocal?q.projectGeometry(k,p,l.layer.portalItem).then(f=>
!l.destroyed&&f?f:null).catch(()=>null):Promise.resolve(null)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/maybe ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../layers/graphics/hydratedFeatures ../../../../layers/graphics/controllers/FeatureTileController3D ../FeatureLayerViewPerformanceInfo ./Graphics3DGraphicsPipeline ../support/FeatureTileFetcher3DLayerViewContext ../../support/EventedSet ../../webgl-engine/lib/UpdatePolicy".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){a.FeatureGraphics3DGraphicsPipeline=class extends t.Graphics3DGraphicsPipeline{constructor(n){super(n);this._processorTotal=this._controllerTotal=0;this._needsRefresh=!1;this.suspendResumeExtentMode="data"}initialize(){this.addHandles(l.watch(()=>({controller:this.controller,suspended:this.suspended}),({controller:n,suspended:u})=>{n&&!u&&this._needsRefresh&&(n.refetch(),this._needsRefresh=!1)}))}destroy(){this._fetcherContext=q.destroyMaybe(this._fetcherContext)}get maximumNumberOfFeatures(){return this.controller?.maximumNumberOfFeatures??
this._get("maximumNumberOfFeatures")}set maximumNumberOfFeatures(n){this._set("maximumNumberOfFeatures",n);this.controller&&(this.controller.maximumNumberOfFeatures=n)}get maximumNumberOfFeaturesExceeded(){return this.controller?!(this.suspended||!this.controller.maximumNumberOfFeaturesExceeded):!1}get updatingProgressValue(){let n=0;if(this.controller?.updating){var u=this.controller.updatingRemaining,x=Math.max(this.controller.updatingTotal,this._controllerTotal);0<x&&(n=(x-u)/x,this._controllerTotal=
x)}u=0;if(this.processor?.updating){x=this.processor.updatingRemaining;const y=Math.max(x,this._processorTotal);0<y&&(u=(y-x)/y,this._processorTotal=y)}return.5*(n+u)}get updatePolicy(){if(!this.controller)return m.UpdatePolicy.ASYNC;switch(this.controller.mode){case "snapshot":const n=r.get(this.layer.geometryType);return null==n||this.controller.serviceDataCount>n?m.UpdatePolicy.ASYNC:m.UpdatePolicy.SYNC;case "tiles":return m.UpdatePolicy.ASYNC}}get usedMemory(){return(this.processor?.usedMemory??
0)+(this.controller?.memoryForUnusedFeatures??0)}get unloadedMemory(){const n=this.controller?.expectedFeatureDiff??0,u=this.processor?.loadedFeatures??0;return(this.processor?.unprocessedMemoryEstimate??0)+n*(this.processor?.usedMemoryPerFeature??0)*(0<u+n?u/(u+n):1)}get ignoresMemoryFactor(){return this.controller?.hasMaximumNumberOfFeaturesOverride}get performanceInfo(){var n=this.controller?.displayFeatureLimit;n=null!=n?n.averageSymbolComplexity:void 0;return new d.FeatureLayerViewPerformanceInfo(super.performanceInfo,
this.controller?.performanceInfo?.storedFeatures??0,this.controller?.performanceInfo?.totalVertices??0,this.maximumNumberOfFeaturesExceeded,this.controller?.mode??"n/a",null!=n?`f:${n.verticesPerFeature},v:${n.verticesPerCoordinate}`:"n/a")}async doRefresh(n){const {controller:u,processor:x,suspended:y}=this;n&&u&&(y?this._needsRefresh=!0:(u.refetch(),this._needsRefresh=!1));x.refreshFilter()}setVisibility(n,u){this.processor?.setObjectIdVisibility(n,u)}getMissingAttributesForFeature(n){return this.controller.getMissingAttributesForFeature(n)}getHydratedGeometry(n){var u=
this.graphics3DProcessor;if(null==u)return null;u=u.graphics3DGraphicsByObjectID;if(null==u)return null;n=u.get(n);return null==n?null:e.hydrateGeometry(n.graphic.geometry)}createController(){this._fetcherContext=new w.FeatureTileFetcher3DLayerViewContext({layerView:this.layerView,returnZ:this.hasZ,returnM:this.hasM});const n=new g.FeatureTileController3D({layerView:this.layerView,context:this._fetcherContext,graphics:new v.EventedSet,extent:this.clippingExtent});this.updatingHandles.add(()=>n.serviceDataExtent,
u=>{this.processor&&(this.processor.dataExtent=u)},l.initial);this.addHandles(l.watch(()=>this.suspended&&this.layerView.updateSuspended,u=>{u?n.suspend():n.resume()},l.syncAndInitial));this.updatingHandles.add(()=>this.processor?.displayFeatureLimit,u=>n.displayFeatureLimit=u,l.initial);this.addHandles(l.when(()=>!this.updating,()=>{this._processorTotal=this._controllerTotal=0}));return n}beforeSetController(n){n.maximumNumberOfFeatures=this.maximumNumberOfFeatures}get test(){return{controller:this.controller,
graphics3DProcessor:this.graphics3DProcessor,heatmapProcessor:this.heatmapProcessor,loadedGraphics:this.loadedGraphics}}};b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"layerView",void 0);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"controller",void 0);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"_controllerTotal",void 0);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"_processorTotal",
void 0);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"_needsRefresh",void 0);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"maximumNumberOfFeatures",null);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"maximumNumberOfFeaturesExceeded",null);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"updatingProgressValue",null);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,
"updatePolicy",null);b.__decorate([p.property()],a.FeatureGraphics3DGraphicsPipeline.prototype,"suspendResumeExtentMode",void 0);a.FeatureGraphics3DGraphicsPipeline=b.__decorate([c.subclass("esri.views.3d.layers.graphics.FeatureGraphics3DGraphicsPipeline")],a.FeatureGraphics3DGraphicsPipeline);const r=new Map([["point",5E3],["polygon",500],["polyline",1E3]]);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/controllers/FeatureTileController3D":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/asyncUtils ../../../core/Collection ../../../core/has ../../../core/Error ../../../core/lang ../../../core/Logger ../../../core/maybe ../../../core/Promise ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/subclass ../../../core/support/UpdatingHandles ../../support/arcgisLayerUrl ../../support/layerUtils ../../../portal/support/geometryServiceUtils ../../../rest/support/StatisticDefinition ../../../views/3d/layers/support/FeatureTileFetcher3D ../../../views/3d/layers/support/FeatureTileFetcher3DDebugger ../../../views/3d/support/debugFlags".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A){function B(C,D){if(!D)return!1;for(const F of D)if(!C.has(F))return!0;return!1}a.FeatureTileController3D=class extends g.EsriPromiseMixin(q){get dataUpdating(){return this._tileFetcher?.dataUpdating??!1}set extent(C){if(null==C||C.spatialReference.equals(this.layerView.view.spatialReference)){var D=this._get("extent");D===C||null!=D&&C&&D.equals(C)||(C=null!=C?C.clone():null,this._set("extent",C))}else c.getLogger(this).error("#extent\x3d","extent needs to be in the same spatial reference as the view")}get updating(){return!!(null!=
this._tileFetcher&&this._tileFetcher.updating||null!=this._fetchDataInfoPromise||"tiles"===this.mode&&this.layerView.view.featureTiles&&this.layerView.view.featureTiles.updating||this._updatingHandles&&this._updatingHandles.updating)}get updatingTotal(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingTotal:0}get updatingRemaining(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingRemaining:0}get expectedFeatureDiff(){return this.updating&&null!=this._tileFetcher?
this._tileFetcher.expectedFeatureDiff:0}get memoryForUnusedFeatures(){return null!=this._tileFetcher?this._tileFetcher.memoryForUnusedFeatures:0}get maximumNumberOfFeaturesExceeded(){return!(null==this._tileFetcher||!this._tileFetcher.maximumNumberOfFeaturesExceeded)}get maximumNumberOfFeatures(){return this.displayFeatureLimit?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(C){C!==this.maximumNumberOfFeatures&&this._overrideIfSome("maximumNumberOfFeatures",C)}get hasMaximumNumberOfFeaturesOverride(){return this._isOverridden("maximumNumberOfFeatures")}get hasAllFeatures(){return this.serviceDataCount===
a.FeatureTileController3DConstants.noServiceDataCount&&"snapshot"===this.mode&&this.hasAllFeaturesInView||this.serviceDataCount===this.graphics.length}get hasAllFeaturesInView(){return this._tileFetcher?.hasAllFeatures??!1}get hasFullGeometries(){return this._tileFetcher?.hasFullGeometries??!1}get mode(){var C=this.layerView.layer;if("feature"===C.type&&null!=C.infoFor3D)return"snapshot";if("catalog-footprint"===C.type||this._forceTilesMode)return"tiles";var D=this.layerView.view;if(!1===D.qualitySettings?.graphics3D?.snapshotAvailable||
this.serviceDataCount===a.FeatureTileController3DConstants.noServiceDataCount||this._snapshotLimitExceeded||this.maximumNumberOfFeaturesExceeded||1>D.quality)return"tiles";D=(D=D&&D.featureTiles)&&D.tilingScheme;return C&&C.minScale&&this.serviceDataExtent&&D&&(C=this._approximateExtentSizeAtScale(C.minScale,D),(this.serviceDataExtent.width/C+this.serviceDataExtent.height/C)/2>a.FeatureTileController3DConstants.maxSnapshotMinScaleFactor)?"tiles":!this.maximumNumberOfFeatures||this.serviceDataCount<=
this.maximumNumberOfFeatures?"snapshot":"tiles"}get maxTotalSnapshotVertices(){const C=this._get("maxTotalSnapshotVertices")||0;return Math.max(C,"snapshot"===this.mode&&this._tileFetcher?.totalVertices||0)}_approximateExtentSizeAtScale(C,D){const F=this.layerView.view,H=D.levels[0];return(H.tileSize[0]/(H.scale/C)+H.tileSize[1]/(H.scale/C))/2*Math.ceil((F.width/D.pixelSize+F.height/D.pixelSize)/2)}get tileDescriptors(){const C=this.layerView.view.featureTiles;return"snapshot"===this.mode?new p([{id:"dummy-tile-full-extent",
lij:[0,0,0]}]):C?C.tiles:new p}get test(){}constructor(C){super(C);this.type="feature-tile-3d";this._updatingHandles=new m.UpdatingHandles;this.serviceDataExtent=null;this.serviceDataCount=a.FeatureTileController3DConstants.noServiceDataCount;this._snapshotLimitExceeded=!1;this.displayFeatureLimit=null;this._suspended=this._forceTilesMode=!1;this._fetchDataInfoAbortController=this._fetchDataInfoPromise=this._tileFetcher=null;this._lifeCycleAbortController=new AbortController}initialize(){this._updatingHandles.add(()=>
this.displayFeatureLimit,C=>this._updatingHandles.addPromise(this._updateSnapshotLimit(C,null,this._lifeCycleAbortController.signal)));this._updatingHandles.add(()=>this.mode,()=>this._modeChanged(),t.initial);this._updatingHandles.add(()=>this.mode,(C,D)=>{"tiles"===C&&"snapshot"===D&&(this._forceTilesMode=!0)},t.initial);this.addResolvingPromise(Promise.resolve().then(()=>this._verifyCapabilities()).then(()=>this._updatingHandles.addPromise(this._fetchServiceDataInfo())).then(()=>this._initializeTileFetcher()))}_verifyCapabilities(){const C=
this.layerView.layer;if("ogc-feature"!==C.type&&!n.getEffectiveLayerCapabilities(C)?.operations.supportsQuery)throw new h("graphicscontroller:query-capability-required","Service requires query capabilities to be used as a feature layer",{layer:C});}destroy(){this._cancelFetchServiceDataInfo();this._tileFetcher=e.destroyMaybe(this._tileFetcher);this._tilesHandle=e.removeMaybe(this._tilesHandle);this._lifeCycleAbortController=e.abortMaybe(this._lifeCycleAbortController);this._updatingHandles.destroy();
this._set("_updatingHandles",null)}suspend(){this._suspended||(this._suspended=!0,null!=this._tileFetcher&&this._tileFetcher.suspend())}resume(){this._suspended&&(this._suspended=!1,null!=this._tileFetcher&&this._tileFetcher.resume())}restart(){const C=()=>{null!=this._tileFetcher&&this._tileFetcher.restart()};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(C,C))}refetch(){this._refetch({resetForceTilesMode:!1})}getMissingAttributesForFeature(C){return this._tileFetcher?.getMissingAttributesForFeature(C)}_refetch(C){const D=
()=>{null!=this._tileFetcher&&(C.resetForceTilesMode&&(this._forceTilesMode=!1),this._tileFetcher.refetch())};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(D,D))}_initializeTileFetcher(){const C=this.layerView.view;if(C){var D=t.whenOnce(()=>C.featureTiles?.tilingScheme,this._lifeCycleAbortController.signal);this._updatingHandles.addPromise(D);D.then(()=>{const {layerView:F,tileDescriptors:H}=this,N=F.layer,E=new y.FeatureTileFetcher3D({context:this.context,filterExtent:this.extent,
tileDescriptors:H,features:this.graphics});this._tileFetcher=E;this._suspended?E.suspend():E.resume();const G=this.layerView.view;G&&this.addHandles(t.watch(()=>G.quality,O=>E.memoryFactor=O,t.syncAndInitial));const I="polygon"===this.context.geometryType?"polygonLodFactor":"polyline"===this.context.geometryType?"polylineLodFactor":null;I&&this.addHandles(t.watch(()=>this.layerView.view?.qualitySettings?.graphics3D?.[I],O=>E.lodFactor=O||1,t.initial));"ogc-feature"!==N.type&&this._updatingHandles.add(()=>
N.createQueryVersion,()=>this._dataFilterChanged());this._updatingHandles.add(()=>F.availableFields,(O,L)=>this._availableFieldsChanged(L,O));this._updatingHandles.add(()=>F.requiredFields,(O,L)=>this._requiredFieldsChanged(L,O));"customParameters"in N&&this._updatingHandles.add(()=>N.customParameters,()=>this.restart());this.addHandles([N.on("apply-edits",O=>this._applyEdits(O)),t.watch(()=>this.extent,O=>E.filterExtent=O,t.sync),t.watch(()=>this.tileDescriptors,O=>E.tileDescriptors=O,t.sync),t.watch(()=>
this.maximumNumberOfFeatures,O=>{E.maximumNumberOfFeatures=O;E.useTileCount=this.serviceDataCount>O},t.syncAndInitial),t.watch(()=>this.serviceDataCount,O=>{E.useTileCount=O>this.maximumNumberOfFeatures},t.syncAndInitial),t.watch(()=>A.debugFlags.FEATURE_TILE_FETCH_SHOW_TILES,O=>{O&&E&&!E.debugger?(E.debugger=new z.FeatureTileFetcher3DDebugger(E,G.featureTiles.tilingScheme.toTileInfo(),G),E.debugger.update()):!O&&this._tileFetcher&&E.debugger&&(E.debugger.destroy(),E.debugger=null)},t.syncAndInitial)]);
this._supportsExceedsLimitQuery||this._updatingHandles.add(()=>this.maxTotalSnapshotVertices,()=>this._updatingHandles.addPromise(this._updateSnapshotLimit(this.displayFeatureLimit,null,this._lifeCycleAbortController.signal)))}).catch(()=>{})}}_modeChanged(){switch(this.mode){case "tiles":this._tilesHandle||(this._tilesHandle=this.layerView.view.featureTiles.addClient());break;default:c.getLogger(this).warn("Unhandled feature layer mode "+this.mode);case "snapshot":null!=this._tilesHandle&&(this._tilesHandle.remove(),
this._tilesHandle=null)}}_dataFilterChanged(){this._set("maxTotalSnapshotVertices",0);this.notifyChange("maxTotalSnapshotVertices");this._refetch({resetForceTilesMode:!0})}_applyEdits(C){const D=this.layerView.layer;null!=this._tileFetcher&&this._tileFetcher.applyEdits(C).then(F=>{if(F){if(!this._lifeCycleAbortController)throw d.createAbortError();F.exceededTransferLimit&&"refresh"in D?D.refresh():(F.deletedFeatures.length||F.updatedFeatures.length||F.addedFeatures.length)&&this._updatingHandles.addPromise(this._updateServiceDataExtent(this._lifeCycleAbortController.signal))}}).catch(F=>
{if(!d.isAbortError(F))throw F;})}_availableFieldsChanged(C,D){null!=this._tileFetcher&&B(this._tileFetcher.availableFields,D)&&this._refetch({resetForceTilesMode:!1})}_requiredFieldsChanged(C,D){null!=this._tileFetcher&&B(this._tileFetcher.availableFields,D)&&this.restart()}_createVertexLimitExceededQuery(C){const D=this.layerView.layer,F=D.createQuery();F.returnGeometry=!1;F.outStatistics=[new x({statisticType:"exceedslimit",maxVertexCount:C,outStatisticFieldName:"exceedslimit",maxPointCount:1E8,
maxRecordCount:1E8})];D.capabilities?.query.supportsCacheHint&&(F.cacheHint=!0);return F}_createDataInfoQuery(){const C=this.layerView.layer,D=C.createQuery();D.returnGeometry=!1;D.outSpatialReference=this.layerView.view.spatialReference;C.capabilities?.query.supportsCacheHint&&(D.cacheHint=!0);return D}_fullExtentIsAccurate(){const C=this.layerView.layer;if("definitionExpression"in C&&C.definitionExpression)return!1;switch(C.type){case "feature":case "catalog-footprint":case "oriented-imagery":return r.isHostedAgolService(C.url);
case "csv":case "geojson":case "ogc-feature":case "wfs":return!0}}async _updateServiceDataExtent(C){try{await this._tryUpdateServiceDataExtent(C)}catch(D){d.isAbortError(D)||this._set("serviceDataExtent",f.clone(this.layerView.fullExtentInLocalViewSpatialReference))}}async _tryUpdateServiceDataExtent(C){var D=this.layerView;const F=D.layer,H=F.capabilities?.query.supportsExtent??!1,N=f.clone(D.fullExtentInLocalViewSpatialReference),E=F.fullExtent,G=this._fullExtentIsAccurate(),I=this.serviceDataCount;
H&&I<=a.FeatureTileController3DConstants.maxFeatureCountForExtent&&(!N||!G)&&"queryExtent"in F?(D=this._createDataInfoQuery(),C=await F.queryExtent(D,{timeout:a.FeatureTileController3DConstants.queryExtentTimeout,signal:C}),this._set("serviceDataExtent",C.extent)):N?this._set("serviceDataExtent",N):null!=E?(C=await u.projectGeometry(E,D.view.spatialReference,"portalItem"in F?F.portalItem:null,C),this._set("serviceDataExtent",C)):this._set("serviceDataExtent",null)}async _updateServiceDataCount(C){const D=
this.layerView.layer;if("queryFeatureCount"in D&&k("featurelayer-snapshot-enabled"))if(C=await l.result(D.queryFeatureCount(this._createDataInfoQuery(),{timeout:a.FeatureTileController3DConstants.queryStatisticsTimeout,signal:C})),!0===C.ok)this._set("serviceDataCount",C.value);else{if(d.isAbortError(C.error))throw C.error;this._set("serviceDataCount",a.FeatureTileController3DConstants.noServiceDataCount)}else this._set("serviceDataCount",a.FeatureTileController3DConstants.noServiceDataCount)}get _supportsExceedsLimitQuery(){const C=
this.layerView.layer;return null!=C.capabilities&&C.capabilities.operations&&C.capabilities.operations.supportsExceedsLimitStatistics}get _minimumNumberOfVerticesForGeometry(){switch(this.layerView.layer.geometryType){case "point":return 1;case "multipoint":return 1;case "polygon":return 4;case "polyline":return 2;case "multipatch":case "mesh":return 3;case null:return 0;default:return 0}}async _updateSnapshotLimit(C,D,F){if(null==C?.averageSymbolComplexity)this._snapshotLimitExceeded=!1;else{var {maximumTotalNumberOfVertices:H,
averageSymbolComplexity:N}=C,{verticesPerFeature:E,verticesPerCoordinate:G}=N;C=1<this._minimumNumberOfVerticesForGeometry;if(0>=E||C){0!==E&&null!=D&&await D;var I=Math.min(H,1E6);D=this.serviceDataCount;var O=D!==a.FeatureTileController3DConstants.noServiceDataCount;I=O?Math.ceil((I-D*E)/(G||1)):Math.ceil(I/(G||1));C&&(I=Math.min(I,5E6));if(O&&this._minimumNumberOfVerticesForGeometry*D>I)this._snapshotLimitExceeded=!0;else if(this._supportsExceedsLimitQuery&&k("featurelayer-snapshot-enabled"))if(F=
await l.result(this.layerView.layer.queryFeatures(this._createVertexLimitExceededQuery(I),{timeout:a.FeatureTileController3DConstants.queryStatisticsTimeout,signal:F})),!1===F.ok){if(d.isAbortError(F.error))throw F.error;this._snapshotLimitExceeded=!1}else F=F.value.features[0],this._snapshotLimitExceeded=F?.attributes?!!F.attributes.exceedslimit:!1;else this._snapshotLimitExceeded=this.maxTotalSnapshotVertices>I}else this._snapshotLimitExceeded=!1}}async _fetchServiceDataInfo(){this._cancelFetchServiceDataInfo();
let C=new AbortController;const D=C.signal;var F=this._updateServiceDataCount(D);F=Promise.allSettled([F,this._updateSnapshotLimit(this.displayFeatureLimit,F,D)]);const H=F.then(()=>this._updateServiceDataExtent(D)).catch(N=>{d.isAbortError(N)||c.getLogger(this).error("#fetchServiceDataInfo()",N)}).then(()=>{H===this._fetchDataInfoPromise&&(this._fetchDataInfoAbortController=this._fetchDataInfoPromise=null);C=null});C&&(this._fetchDataInfoPromise=H);this._fetchDataInfoAbortController=C;return F.then(()=>
{},()=>{})}_cancelFetchServiceDataInfo(){const C=this._fetchDataInfoAbortController;C&&(this._fetchDataInfoPromise=this._fetchDataInfoAbortController=null,C.abort())}get performanceInfo(){return{storedFeatures:this._tileFetcher?.storedFeatures??0,totalFeatures:this._tileFetcher?.totalFeatures??0,totalVertices:this._tileFetcher?.totalVertices??0,missingTiles:this._tileFetcher?.missingTiles??0}}};b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"type",void 0);b.__decorate([w.property({constructOnly:!0})],
a.FeatureTileController3D.prototype,"graphics",void 0);b.__decorate([w.property({constructOnly:!0})],a.FeatureTileController3D.prototype,"layerView",void 0);b.__decorate([w.property({constructOnly:!0})],a.FeatureTileController3D.prototype,"context",void 0);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"dataUpdating",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"extent",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"updating",
null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"_updatingHandles",void 0);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"updatingTotal",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"updatingRemaining",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"expectedFeatureDiff",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"memoryForUnusedFeatures",null);b.__decorate([w.property()],
a.FeatureTileController3D.prototype,"maximumNumberOfFeaturesExceeded",null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"serviceDataExtent",void 0);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"serviceDataCount",void 0);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"_snapshotLimitExceeded",void 0);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"displayFeatureLimit",void 0);b.__decorate([w.property({type:Number})],
a.FeatureTileController3D.prototype,"maximumNumberOfFeatures",null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"hasAllFeatures",null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"hasAllFeaturesInView",null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"hasFullGeometries",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"_forceTilesMode",void 0);b.__decorate([w.property({readOnly:!0})],
a.FeatureTileController3D.prototype,"mode",null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"maxTotalSnapshotVertices",null);b.__decorate([w.property({readOnly:!0})],a.FeatureTileController3D.prototype,"tileDescriptors",null);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"_tileFetcher",void 0);b.__decorate([w.property()],a.FeatureTileController3D.prototype,"_fetchDataInfoPromise",void 0);a.FeatureTileController3D=b.__decorate([v.subclass("esri.layers.graphics.controllers.FeatureTileController3D")],
a.FeatureTileController3D);a.FeatureTileController3DConstants=void 0;(function(C){C.noServiceDataCount=Infinity;C.maxSnapshotMinScaleFactor=5;C.reset=function(){C.maxFeatureCountForExtent=1E4;C.queryStatisticsTimeout=12E3;C.queryExtentTimeout=1E4}})(a.FeatureTileController3DConstants||(a.FeatureTileController3DConstants={}));a.FeatureTileController3DConstants.reset();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileFetcher3D":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/Logger ../../../../core/MapUtils ../../../../core/promiseUtils ../../../../core/ReactiveMap ../../../../core/reactiveUtils ../../../../core/scheduling ../../../../core/accessorSupport/decorators/property ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/support/aaBoundingRect ../../../../layers/graphics/dehydratedFeatures ../../../../rest/support/QuantizationParameters ../../../../rest/support/Query ../../../ViewingMode ./featureReference ./FeatureTile ../../terrain/tileUtils ../../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){function A(G){return"dummy-tile-full-extent"===G.id}function B(G){let I=0;for(const O of G)O.features&&0<O.features.length&&O.alive&&(I=Math.max(I,O.descriptor.lij[0]));return I}function C(G){G.setFeatures([],0,null,void 0);G.featuresMissing=!1;return x.FetchStatus.DONE}function D(G){return null==G?new Set:new Set(G.map(I=>I.name))}function F(G,I){if(null==G||null==I)return D(I);const O=new Set;for(const {name:L}of I)G.has(L)&&O.add(L);return O}
function H(G,I){if(!I?.length)return G;G??=new Map;const O=()=>new Set;for(const {objectId:L,attribute:P}of I)k.getOrCreateMapValue(G,L,O).add(P);return G}a.FeatureTileFetcher3D=class extends q{set maximumNumberOfFeatures(G){G=G||Infinity;const I=this._get("maximumNumberOfFeatures");G===I||1>G||(this._set("maximumNumberOfFeatures",G),this._maximumFeaturesUpdated(I,G))}set memoryFactor(G){this.memoryFactor!==G&&(this._set("memoryFactor",G),this._setDirty())}set lodFactor(G){this.lodFactor!==G&&(this._set("lodFactor",
G),this._supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&null!=this.context.query.queryFeatureCount}set useTileCount(G){this._useTileCount=G;this.notifyChange("useTileCount")}get updating(){return this._dirty||!!this._pendingEdits||this._isFetching||(this.tileDescriptors?.updating??!1)}get memoryForUnusedFeatures(){let G=0;this._featureTiles.forEach(I=>G+=I.estimatedUnusedSize);return G}get totalVertices(){let G=0;this._featureTiles.forEach(I=>G+=I.numVertices);return G}get totalFeatures(){let G=
0;this._featureTiles.forEach(I=>G+=I.numFeatures);return G}get hasAllFeatures(){if(this._paused||this.dataUpdating)return!1;for(const [,G]of this._featureTiles)if(!this.hasFullGeometries&&0!==G.emptyFeatureRatio||!G.hasAllFeatures)return!1;return!0}get hasFullGeometries(){return this._supportsResolution?!this.tileDescriptors.find(G=>null!=G.resolution)||!this.context.capabilities.supportsQuantization&&"polyline"!==this.context.geometryType:!0}set filterExtent(G){if(null!=G&&this.context.tilingScheme&&
!G.spatialReference.equals(this.context.tilingScheme.spatialReference))p.getLogger(this).error("#filterExtent\x3d","extent needs to be in the same spatial reference as the tiling scheme");else{var I=this._get("filterExtent");I===G||null!=I&&G&&I.equals(G)||(G=null!=G?G.clone():null,this._set("filterExtent",G),this._reclip(G,I))}}constructor(G){super(G);this.running=this.dataUpdating=this._useTileCount=!1;this.expectedFeatureDiff=this.updatingRemaining=this.updatingTotal=0;this.maximumNumberOfFeaturesExceeded=
!1;this._farRatio=this._fullRatio=1;this._changes={updates:{adds:[],removes:[]},adds:[],removes:[]};this._frameTask=z.ImmediateTask;this._dirty=!1;this._featureTiles=new f;this._displayingFeatureReferences=new Map;this._numDisplayingFeatureReferences=0;this._suspended=!0;this._pendingEdits=null;this._isFetching=this._applyEditsTilesUpdated=!1}initialize(){this.addHandles(c.on(()=>this.tileDescriptors,"change",()=>this._setDirty(),{sync:!0,onListenerAdd:()=>this._setDirty()}));this._objectIdField=
this.context.objectIdField;this.FeatureReferenceClass=this.context.capabilities.supportsMultipleResolutions?u.MultiFeatureReference:u.SingleFeatureReference;const G=this.context.scheduler;null!=G&&(this._frameTask=G.registerTask(z.TaskPriority.FEATURE_TILE_FETCHER,this));this._setDirty()}destroy(){this._frameTask.remove();this._featureTiles.forEach(G=>{this._cancelFetchTile(G);this._removeTile(G)});this._featureTiles.clear();this._displayingFeatureReferences.clear();this._pendingEdits?.controller.abort();
this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach(G=>{this._cancelFetchTile(G);this._clearTile(G);this._resetFetchTile(G)});null!=this.context.memoryCache&&this.context.memoryCache.clear();this._setDirty()}refetch(){this._featureTiles.forEach(G=>{this._cancelFetchTile(G);this._resetFetchTile(G)});null!=this.context.memoryCache&&this.context.memoryCache.clear();this._setDirty()}suspend(){this._suspended||(this._suspended=!0,this._pause(),
this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}getMissingAttributesForFeature(G){for(const [,I]of this._featureTiles){const O=I.missingAttributes?.get(G);if(null!=O)return O}}_pause(){this._paused&&(this._featureTiles.forEach(G=>this._cancelFetchTile(G)),this._updated())}_unpause(){this._paused||this._setDirty()}get availableFields(){let G=null;this._featureTiles.forEach(I=>{null!=I.displayingFeatures&&0!==I.displayingFeatures.length&&(null==G?G=new Set(I.availableFields):
G.forEach(O=>{I.availableFields.has(O)||G.delete(O)}))});return null!=G?G:new Set}applyEdits(G){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const I=this._pendingEdits;I.count++;const O=I.edits.then(()=>G.result.catch(L=>{if(h.isAbortError(L))throw L;return null}).then(L=>{if(!L)return L;this._applyEditsDeleteFeatures(L.deletedFeatures);return this._applyEditsAddUpdateFeatures(L.addedFeatures,L.updatedFeatures,I.controller.signal).then(()=>
L)}).then(L=>{0===--I.count&&(this._pendingEdits===I&&(this._pendingEdits=null),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._applyEditsTilesUpdated=!1,this._unpause());return L}));I.edits=O;this._updated();return O}_applyEditsDeleteFeatures(G){if(0!==G.length){var I=this.context.globalIdField,O=I&&this.availableFields.has(I),L=new Set,P=this._objectIdField;G.forEach(({objectId:M,globalId:K})=>{(!M||0>M)&&I&&K&&(O||p.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${I} to be included the layer's outFields for updates to be reflected in the view`),
M=this._objectIdFromGlobalId(K,P,I));null!=M&&0<=M&&L.add(M)});this._featureTiles.forEach(M=>{if(M.features){var K=M.features.filter(J=>!L.has(v.getObjectId(J,this._objectIdField)));K.length!==M.features.length&&(this._applyEditsTileUpdated(),M.setFeatures(K,0,M.availableFields,M.missingAttributes),this._invalidateCounts())}})}}_objectIdFromGlobalId(G,I,O){if(null==G)return null;const L=this.features.find(P=>P.attributes?.[O]===G);return L?v.getObjectId(L,I):null}async _applyEditsAddUpdateFeatures(G,
I,O){const {objectIdField:L,globalIdField:P}=this.context,M=P&&this.availableFields.has(P),K=new Set,J=new Set;for(const Q of G)G=Q.objectId,null!=G&&K.add(G);for(const {objectId:Q,globalId:W}of I)I=Q,(null==I||0>I)&&P&&(M||p.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${P} to be included the layer's outFields for updates to be reflected in the view`),I=this._objectIdFromGlobalId(W,L,P)),null!=I&&0<=I&&(K.add(I),J.add(I));if(0!==K.size){var R=
[];this._featureTiles.forEach(Q=>{(Q=this._applyEditsAddUpdateTile(Q,K,J,O))&&R.push(Q)});this._updated();await Promise.allSettled(R)}}async _applyEditsAddUpdateTile(G,I,O,L){if(G.features){var P=this._createQuery(G);P.resultType=void 0;P.cacheHint=!1;P.objectIds=Array.from(I);I=await this._queryFeatures(P,L);L=null;0<O.size&&(P=G.features.filter(M=>!O.has(v.getObjectId(M,this._objectIdField))),P.length!==G.features.length&&(L=P));if(0<I.features.length){L||=G.features.slice();for(const M of I.features)L.push(M)}L&&
(G.hasPreciseFeatureCount&&(G.numFeatures=Math.max(G.numFeatures,L.length)),this._applyEditsTileUpdated(),G.setFeatures(L,0,F(G.availableFields,I.fields),H(G.missingAttributes,I.missingAttributes)),this._invalidateCounts())}}_applyEditsTileUpdated(){this._applyEditsTilesUpdated||(this._applyEditsTilesUpdated=!0,this._updated())}_queryFeatures(G,I){return this.context.query.queryFeaturesDehydrated(G,{signal:I,timeout:6E5})}_setDirty(){this._dirty=!0;this._updated()}runTask(G){const I=this._frameTask.processQueue(G);
if(!this._dirty||!this.initialized)return I;this._dirty=!1;const O=this._getListOfTiles();this._markTilesNotAlive(O);if(G.run(()=>this._addTiles(O,G))&&G.run(()=>this._filterExtentTiles(O,G))&&G.run(()=>this._removeTiles(O,G))&&!G.done){var L=this._sortTiles(O);G.run(()=>this._showTiles(L,G))&&G.run(()=>this._fetchTiles(L,G))&&G.run(()=>this._updateMemoryEstimates(L,G))||this._setDirty();this._updated();this.updating||this._updateMaximumNumberOfFeaturesExceeded()}else this._setDirty()}_markTilesNotAlive(G){for(const I of G)I.alive=
!1}_addTiles(G,I){if(this._suspended||!this.tileDescriptors)return!1;this.tileDescriptors.forEach(O=>{const L=this._featureTiles.get(O.id);L?L.alive=!0:I.done||(G.push(this._addTile(O)),I.madeProgress())});return I.hasProgressed}_filterExtentTiles(G,I){for(const O of G){if(I.done)break;O.alive&&(O.filtered=!O.intersects(this.filterExtent),O.filtered&&(this._clearTile(O),I.madeProgress()))}return I.hasProgressed}_removeTiles(G,I){for(let O=G.length-1;0<=O&&!I.done;O--){const L=G[O];L.alive||(this._removeTile(L),
O!==G.length-1&&(G[O]=G[G.length-1]),G.pop(),I.madeProgress())}return I.hasProgressed}_sortTiles(G){G.sort((I,O)=>(I.descriptor.loadPriority??0)-(O.descriptor.loadPriority??0));return G}_showTiles(G,I){const O=this._updateRatio(G),L=P=>{const M=1>this._fullRatio?O(P)*this._farRatio:1;P.reduceFeatures(M,this.memoryFactor,this._objectIdField)&&this._setDirty();return this._showTile(P)};for(const P of G)if(!I.run(()=>L(P))){this._setDirty();break}return I.hasProgressed}_fetchTiles(G,I){if(this._paused)return!1;
var O=!1;for(const P of G)if(P.needsFetching){var L=null!=this.context.memoryCache?this.context.memoryCache.pop(P.id):null;if(null!=L)P.cache=L,P.numFeatures&&this._notifyDataUpdating(),this._setDirty(),this._scheduleUpdated(),I.madeProgress();else if(this._needsNumFeatures(P)&&(O=new AbortController,L=this._fetchTileCount(P,O.signal),this._handleRequest(P,L,O,()=>P.numFeatures=x.failedFeatureCount),O=!0,I.madeProgress()),I.done)return!0}if(O)return I.hasProgressed;for(const P of G)if(P.needsFetching&&
(G=new AbortController,O=this._fetchTile(P,G.signal),this._handleRequest(P,O,G,M=>{P.setFeatures([],0,null,void 0);this._invalidateCounts();P.featuresMissing=!1;P.fetchFailed=!0;this.context.logFetchError(p.getLogger(this),M)}),I.madeProgress()))return!0;return I.hasProgressed}_updateMemoryEstimates(G,I){G.some(O=>I.run(()=>O.updateMemoryEstimates())?!1:(this._setDirty(),!0));return I.hasProgressed}_reclip(G,I){if(this.initialized){var O=[];this._featureTiles.forEach(L=>{null!=L.displayingFeatures&&
0!==L.displayingFeatures.length&&(L.intersectionIncludingBorrowed(I,N),L.intersectionIncludingBorrowed(G,E),w.equals(N,E)||O.push(L))});this._refreshDisplayingFeatures(O);this._updated()}}_refreshDisplayingFeatures(G){const I=new Set,O=this._changes.updates;for(const L of G)if(null!=L.displayingFeatures)for(const P of L.displayingFeatures)G=v.getObjectId(P,this._objectIdField),I.has(G)||(I.add(G),G=this._displayingFeatureReferences.get(G).feature,O.removes.push(G),O.adds.push(G));this._applyChanges()}_updated(){let G=
0;this._paused||this._featureTiles.forEach(I=>I.isFetching?++G:0);this._isFetching=0<G;this._set("running",this._dirty);0<G||this._applyEditsTilesUpdated?this._notifyDataUpdating():this._dirty||this._set("dataUpdating",!1);if(this.updating){let I=0,O=0,L=0,P=0,M=0;const K=this._displayingFeatureReferences.size/this._numDisplayingFeatureReferences;this._featureTiles.forEach(Q=>{++O;if(Q.isFetching&&Q.hasPreciseFeatureCount){const W=this._maximumFeaturesForTile(Q)*(1-Q.emptyFeatureRatio);M+=W-(null!=
Q.displayingFeatures?Q.displayingFeatures.length*K:0)}Q.needsFetching?++P:0<Q.numFeatures&&(++L,I+=Q.numFeatures)});P+=G;let J=0,R=0;I?(R=I,J=Math.min(P*I/L,I)):(R=O,J=P);M=Math.min(this.maximumNumberOfFeatures-this.features.length,M);this._set("updatingTotal",R);this._set("updatingRemaining",J);this._set("expectedFeatureDiff",M)}else this._set("updatingTotal",0),this._set("updatingRemaining",0),this._set("expectedFeatureDiff",0);this.debugger&&this.debugger.update()}_updateMaximumNumberOfFeaturesExceeded(){const G=
k.someMap(this._featureTiles,I=>I.perTileMaximumNumberOfFeaturesExceeded);this._set("maximumNumberOfFeaturesExceeded",G)}_updateRatio(G){const I=B(G),O=M=>1/(1<<Math.max(0,I-M.descriptor.lij[0]));let L=0,P=0;for(const M of G)G=M.numFeatures,L+=G,P+=G*O(M);this._fullRatio=Math.min(1,this.maximumNumberOfFeatures/L);this._farRatio=this.maximumNumberOfFeatures/P;this._scheduleUpdated();return O}_maximumFeaturesUpdated(G,I){G!==I&&(I>G&&this._featureTiles.forEach(O=>{if(O.featuresMissing){var L=this._maximumFeaturesForTile(O);
O.features&&(O.features.length>=L||O.fetchStatus===x.FetchStatus.FULL)||(this._cancelFetchTile(O),this._resetFetchTile(O))}}),this._setDirty())}_addTile(G){G=new x.FeatureTile(G);this._featureTiles.set(G.id,G);this._resetFetchTile(G);this._referenceDisplayingFeaturesFromRelatedTiles(G);return G}_referenceDisplayingFeaturesFromRelatedTiles(G){const I=G.descriptor.resolution;this._featureTiles.forEach(O=>{if(!(null==O.displayingFeatures||G===O||G.descriptor.lij&&O.descriptor.lij&&!y.tilesAreRelated(G.descriptor.lij,
O.descriptor.lij))){null==G.displayingFeatures&&(G.displayingFeatures=[]);G.descriptor.extent&&O.descriptor.extent&&(null==G.extentIncludingBorrowedFeatures&&(G.extentIncludingBorrowedFeatures=w.clone(G.descriptor.extent)),w.expand(G.extentIncludingBorrowedFeatures,O.descriptor.extent,G.extentIncludingBorrowedFeatures));for(const L of O.displayingFeatures)G.displayingFeatures.push(L),O=this._displayingFeatureReferences.get(v.getObjectId(L,this._objectIdField)),O.ref(O.feature,I),this._numDisplayingFeatureReferences++}});
G.featureLimit=null!=G.displayingFeatures?G.displayingFeatures.length:0}_removeTile(G){this._clearTile(G);this._featureTiles.delete(G.id)}_resetFetchTile(G){G.filtered=!G.intersects(this.filterExtent);G.filtered?G.needsFetching&&(G.fetchStatus=x.FetchStatus.DONE):G.fetchStatus=x.FetchStatus.FETCH_NEEDED}_cancelFetchTile(G){const I=G.requestController;null!=I&&(G.requestController=null,G.resetFetching(),I.abort())}async _fetchTileCount(G,I){G.numFeatures=await this._fetchCount(G,I);this._updateRatio(this._getListOfTiles());
return G.fetchStatus===x.FetchStatus.REFETCHING?x.FetchStatus.REFETCH_NEEDED:x.FetchStatus.FETCH_NEEDED}async _fetchTile(G,I){G.fetchFailed=!1;var O=this._maximumFeaturesForTile(G);if(0>=O)return G.hasPreciseFeatureCount&&0===G.numFeatures||(G.fetchFailed=!0),C(G);const L=this._getMaxRecordCount(G);var P=Math.ceil(O/L);if(A(G)||!this.context.capabilities.supportsMaxRecordCountFactor||G.numFeatures<=O&&P>r.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(G,I);P=this._createQuery(G);P.maxRecordCountFactor=
Math.ceil(O/L);G.isRefetching&&G.features&&0<G.features.length&&(P.maxRecordCountFactor=Math.max(Math.ceil(G.features.length/(1-G.emptyFeatureRatio)/L)+1,P.maxRecordCountFactor));const {features:M,exceededTransferLimit:K,fields:J,missingAttributes:R}=await this._queryFeatures(P,I);O=K?P.maxRecordCountFactor>=r.MAX_MAX_RECORD_COUNT_FACTOR?x.FetchStatus.FULL:x.FetchStatus.DONE:x.FetchStatus.FULL;await this._frameTask.schedule(()=>{G.featuresMissing=G.hasPreciseFeatureCount&&M.length<G.numFeatures||
!!K;const Q=this._removeEmptyFeatures(M);G.setFeatures(M,Q,D(J),H(void 0,R))},I);h.throwIfAborted(I);this._invalidateCounts();return O}async _fetchCount(G,I){return this.context.query.queryFeatureCount(this._createFeatureCountQuery(G),{signal:I})}async _fetchPagedTile(G,I){let O=0,L=0,P,M=0,K=this._maximumFeaturesForTile(G)-M;const J=this._getMaxRecordCount(G);let R=null,Q;for(;;){const W=this._createQuery(G),S=this._setPagingParameters(W,O,K,J),{features:V,exceededTransferLimit:T,fields:Y,missingAttributes:ha}=
await this._queryFeatures(W,I);await this._frameTask.schedule(()=>{S&&(O+=W.num);M+=V.length;L+=this._removeEmptyFeatures(V);G.featuresMissing=S&&G.hasPreciseFeatureCount&&O<G.numFeatures||!!T;P=P?P.concat(V):V;R=F(R,Y);Q=H(Q,ha);G.setFeatures(P,L,R,Q)},I);h.throwIfAborted(I);this._invalidateCounts();this._setDirty();K=this._maximumFeaturesForTile(G)-M;if(!S||!T||0>=K)return T?x.FetchStatus.DONE:x.FetchStatus.FULL}}_createFeatureCountQuery(G){G=this._createQuery(G);this.context.capabilities.supportsCacheHint&&
(G.resultType=void 0,G.cacheHint=!0);return G}_createQuery(G){const I=this.context.createQuery(),O=G.descriptor.extent;O&&(I.geometry=w.toExtent(O,this.context.tilingScheme.spatialReference));this._setResolutionParams(I,G);this._useTileQuery(G)?I.resultType="tile":this.context.capabilities.supportsCacheHint&&(I.cacheHint=!0);return I}_setPagingParameters(G,I,O,L){if(!this.context.capabilities.supportsPagination)return!1;G.start=I;0<O&&this.context.capabilities.supportsMaxRecordCountFactor?(G.maxRecordCountFactor=
Math.ceil(O/L),G.num=Math.min(G.maxRecordCountFactor*L,O)):G.num=Math.min(L);return!0}_getEffectiveTileResolution(G){if(null==G.descriptor.resolution)return null;const I=this.context.viewingMode===n.ViewingMode.Global?this.context.tilingScheme.resolutionAtLevel(3):Infinity;return Math.min(G.descriptor.resolution,I)/this.lodFactor}get _supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&"point"!==this.context.geometryType}_setResolutionParams(G,I){this._supportsResolution&&
(I=this._getEffectiveTileResolution(I),null!=I&&(this.context.capabilities.supportsQuantization?G.quantizationParameters=new m({mode:"view",originPosition:"upper-left",tolerance:I,extent:this.context.fullExtent}):"polyline"===this.context.geometryType&&(G.maxAllowableOffset=I)))}_removeEmptyFeatures(G){const I=G.length;for(let O=0;O<G.length;)v.hasVertices(G[O].geometry)?++O:(G[O]=G[G.length-1],--G.length);return I-G.length}_needsNumFeatures(G){return this.useTileCount&&G.needsFeatureCount&&!A(G)}_getMaxRecordCount(G){const {tileMaxRecordCount:I,
maxRecordCount:O}=this.context;return this._useTileQuery(G)&&null!=I&&0<I&&this.context.capabilities.supportsResultType?I:null!=O&&0<O?O:2E3}_useTileQuery(G){return A(G)&&this.context.capabilities.supportsCacheHint?!1:this.context.capabilities.supportsResultType}_handleRequest(G,I,O,L){G.fetchStatus=G.needsRefetching?x.FetchStatus.REFETCHING:x.FetchStatus.FETCHING;G.requestController=O;let P=!1;I.then(M=>{G.requestController=null;G.fetchStatus=M}).catch(M=>{G.requestController===O&&(G.requestController=
null,G.fetchStatus=x.FetchStatus.DONE);h.isAbortError(M)?P=!0:L(M)}).then(()=>{P||this._setDirty();this._scheduleUpdated()})}_scheduleUpdated(){this.hasHandles("scheduleUpdated")||this.addHandles(e.schedule(()=>{this.removeHandles("scheduleUpdated");this._updated()}),"scheduleUpdated")}_showTile(G){if(null!=G.displayingFeatures&&!G.needsDisplayUpdate)return!1;var I=G.features;if(0===G.featureLimit||!I)return I=null!=G.displayingFeatures&&0<G.displayingFeatures.length,this._hideTileFeatures(G),G.displayingFeatures=
[],I;const O=G.descriptor.resolution,L=this._changes.updates,P=this._changes.adds,M=Math.min(G.featureLimit,I.length);G.featureLimit=M;for(let J=0;J<M;++J){var K=I[J];const R=v.getObjectId(K,this._objectIdField),Q=this._displayingFeatureReferences.get(R);Q?(K=Q.ref(K,O),K.oldVersion!==K.newVersion&&(K.oldVersion&&L.removes.push(K.oldVersion),K.newVersion&&L.adds.push(K.newVersion))):(this._displayingFeatureReferences.set(R,new this.FeatureReferenceClass(K,O)),P.push(K));this._numDisplayingFeatureReferences++}this._hideTileFeatures(G);
this._applyChanges();G.displayingFeatures=I.slice(0,M);return!0}_hideTile(G){this._cancelFetchTile(G);this._hideTileFeatures(G)}_hideTileFeatures(G){if(null!=G.displayingFeatures){var I=this._changes.updates,O=this._changes.removes;for(const P of G.displayingFeatures){const M=v.getObjectId(P,this._objectIdField);var L=this._displayingFeatureReferences.get(M);L&&((L=L.unref(G.descriptor.resolution),this._numDisplayingFeatureReferences--,L)?L.oldVersion!==L.newVersion&&(null==L.newVersion?(this._displayingFeatureReferences.delete(M),
L.oldVersion&&O.push(L.oldVersion)):(I.adds.push(L.newVersion),L.oldVersion&&I.removes.push(L.oldVersion))):console.error("Hiding unreferenced feature"))}this._applyChanges();G.displayingFeatures=null}}_notifyDataUpdating(){this._get("dataUpdating")||this._set("dataUpdating",!0)}_applyChanges(){var G=this._changes.updates;0<G.removes.length&&(this._notifyDataUpdating(),this.features.removeMany(G.removes),G.removes.length=0);0<G.adds.length&&(this._notifyDataUpdating(),this.features.addMany(G.adds),
G.adds.length=0);G=this._changes.adds;const I=this._changes.removes,O=Math.min(G.length,I.length);let L=0;for(;L<O;){const P=Math.min(L+200,O);this._notifyDataUpdating();this.features.addMany(G.slice(L,P));this.features.removeMany(I.slice(L,P));L=P}G.length>O&&(this._notifyDataUpdating(),this.features.addMany(0===L?G:G.slice(L)));I.length>O&&(this._notifyDataUpdating(),this.features.removeMany(0===L?I:I.slice(L)));G.length=0;I.length=0}_clearTile(G){this._hideTile(G);G.features&&null!=this.context.memoryCache&&
this.context.memoryCache.put(G.id,G.cache,16+G.estimatedSize);G.setFeatures(null,0,null,void 0);this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices");this.notifyChange("totalFeatures");this.notifyChange("memoryForUnusedFeatures")}_getListOfTiles(){return Array.from(this._featureTiles.values())}get storedFeatures(){return this._getListOfTiles().reduce((G,I)=>G+(I.features?I.features.length:0),0)}get missingTiles(){return Array.from(this._featureTiles.values()).reduce((G,I)=>
G+(I.needsFetching||I.isFetching?1:0),0)}_maximumFeaturesForTile(G){const I=G.hasPreciseFeatureCount?G.numFeatures:Infinity;return Math.min(Math.ceil((G.hasPreciseFeatureCount?I:this.maximumNumberOfFeatures)*(1>this._fullRatio?this._farRatio:1)/(1-G.emptyFeatureRatio)),I)}get test(){}};b.__decorate([g.property({constructOnly:!0})],a.FeatureTileFetcher3D.prototype,"features",void 0);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"tileDescriptors",void 0);b.__decorate([g.property({value:Infinity})],
a.FeatureTileFetcher3D.prototype,"maximumNumberOfFeatures",null);b.__decorate([g.property({value:1})],a.FeatureTileFetcher3D.prototype,"memoryFactor",null);b.__decorate([g.property({value:1})],a.FeatureTileFetcher3D.prototype,"lodFactor",null);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"useTileCount",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"updating",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"dataUpdating",
void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"running",void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"updatingTotal",void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"updatingRemaining",void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"expectedFeatureDiff",void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"memoryForUnusedFeatures",
null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"maximumNumberOfFeaturesExceeded",void 0);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"totalVertices",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"totalFeatures",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"hasAllFeatures",null);b.__decorate([g.property({readOnly:!0})],a.FeatureTileFetcher3D.prototype,"hasFullGeometries",
null);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"filterExtent",null);b.__decorate([g.property({constructOnly:!0})],a.FeatureTileFetcher3D.prototype,"context",void 0);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"_dirty",void 0);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"_suspended",void 0);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"_pendingEdits",void 0);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"_applyEditsTilesUpdated",
void 0);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"_paused",null);b.__decorate([g.property()],a.FeatureTileFetcher3D.prototype,"_isFetching",void 0);a.FeatureTileFetcher3D=b.__decorate([t.subclass("esri.views.3d.layers.support.FeatureTileFetcher3D")],a.FeatureTileFetcher3D);const N=w.create(),E=w.create();a.contextCapabilitiesFromLayer=function(G){const I=G.capabilities.query;a:switch(G.geometryType){case "polyline":G=!0;break a;case "polygon":G=G.capabilities&&G.capabilities.query&&
G.capabilities.query.supportsQuantization;break a;default:G=!1}return{supportsMultipleResolutions:G,supportsPagination:!(!I||!I.supportsPagination),supportsResultType:!(!I||!I.supportsResultType),supportsCacheHint:!(!I||!I.supportsCacheHint),supportsQuantization:!(!I||!I.supportsQuantization),supportsQuantizationEditMode:!(!I||!I.supportsQuantizationEditMode),supportsMaxRecordCountFactor:!(!I||!I.supportsMaxRecordCountFactor),supportsFormatPBF:!(!I||!I.supportsFormatPBF)}};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/featureReference":function(){define("exports ../../../../core/has ../../../../geometry/SpatialReference ../../../../geometry/support/aaBoundingBox ../../../../core/mathUtils ../../../../geometry/Extent ../../../../geometry/Geometry ../../../../geometry/Multipoint ../../../../geometry/Point ../../../../geometry/Polygon ../../../../geometry/Polyline ../../../../geometry/support/typeUtils ../../../../layers/support/Field ../../../../layers/graphics/dehydratedFeatureComparison".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){class v{get isReferenced(){return 0!==this.versions.length}get isSingle(){return 1===this.versions.length&&1===this.versions[0].refCount}constructor(n,u){this._highestResolutionVersion=null;this.versions=[];this.ref(n,u)}ref(n,u){const x=this.feature;r.oldVersion=x;this.feature&&Object.defineProperty(n,"uid",{value:this.feature.uid,configurable:!0});for(var y of this.versions)if(y.resolution===u){y.refCount++;if((u=this._highestResolutionVersion===y&&!w.equals(n,
y.feature))||this._highestResolutionVersion!==y)y.feature=n;r.newVersion=u?n:x;return r}y={feature:n,resolution:u,refCount:1};this.versions.push(y);!this._highestResolutionVersion||u<this._highestResolutionVersion.resolution?(r.newVersion=n,this._highestResolutionVersion=y):r.newVersion=x;return r}unref(n){for(let u=0;u<this.versions.length;u++){const x=this.versions[u];if(x.resolution===n)return x.refCount--,r.oldVersion=this.feature,0===x.refCount&&(this.versions[u]=this.versions[this.versions.length-
1],this.versions.length--,this._highestResolutionVersion===x&&(this._recalculateHighestResolutionVersion(),r.oldVersion=x.feature)),r.newVersion=this.feature,r}return null}get feature(){return this._highestResolutionVersion?this._highestResolutionVersion.feature:null}_recalculateHighestResolutionVersion(){if(0===this.versions.length)this._highestResolutionVersion=null;else{var n=this.versions[0];for(let u=1;u<this.versions.length;u++){const x=this.versions[u];x.resolution<n.resolution&&(n=x)}this._highestResolutionVersion=
n}}}class m{get isReferenced(){return 0!==this._refCount}get isSingle(){return 1===this._refCount}constructor(n){this._feature=n;this._refCount=1}ref(n){++this._refCount;r.oldVersion=this._feature;this.feature&&Object.defineProperty(n,"uid",{value:this.feature.uid,configurable:!0});w.equals(this._feature,n)||(this._feature=n);r.newVersion=this._feature;return r}unref(){r.oldVersion=this._feature;if(0<this._refCount&&(this._refCount--,!this.isReferenced))return r.newVersion=null,r;r.newVersion=this._feature;
return r}get feature(){return this._feature}}const r={oldVersion:null,newVersion:null};a.MultiFeatureReference=v;a.SingleFeatureReference=m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTile":function(){define(["exports","../../../../core/arrayUtils","../../../../core/signal","../../../../geometry/support/aaBoundingRect","../../../../layers/graphics/dehydratedFeatures"],function(a,b,q,l,p){const k=new Set;class h{get featuresMissing(){return this._featuresMissing.value}set featuresMissing(c){this._featuresMissing.value=
c}get missingAttributes(){return this._missingAttributes}get fetchFailed(){return this._fetchFailed.value}set fetchFailed(c){this._fetchFailed.value=c}get displayingFeatures(){return this._displayingFeatures}set displayingFeatures(c){this._displayingFeatures=c;this.extentIncludingBorrowedFeatures=null}get perTileMaximumNumberOfFeaturesExceeded(){const c=(this.fetchStatus===a.FetchStatus.DONE||this.fetchStatus===a.FetchStatus.FULL)&&this.featuresMissing;return!this.filtered&&(c||this.hasFeatureLimit)}get features(){return this._features}get featureLimit(){return this._featureLimit.value}set featureLimit(c){this._featureLimit.value!==
c&&(this._featureLimit.value=c,this._estimatedUnusedSizeDirty=!0)}get hasFeatureLimit(){return this.featureLimit!==this._featuresLength.value}get hasAllFeatures(){return!(this.featuresMissing||this.fetchFailed||this.hasFeatureLimit)}get availableFields(){return this._availableFields}setFeatures(c,e,g,d){this._availableFields=g??k;this._features=c;this._featuresLength.value=c?.length??0;this._shuffled=!1;this._estimatedSize=-1;this._estimatedUnusedSizeDirty=!0;this._missingAttributes=d;c&&0<c.length?
(this._emptyFeatureRatio.value=e/(c.length+e),this._numVertices=c.reduce((t,w)=>t+p.numVertices(w.geometry),0)):this._numVertices=this._emptyFeatureRatio.value=0}get emptyFeatureRatio(){return this._emptyFeatureRatio.value}get numFeatures(){return this.hasPreciseFeatureCount?this._numFeatures:this._features?this._features.length:0}set numFeatures(c){this._numFeatures=c}get hasPreciseFeatureCount(){return-1<this._numFeatures}get needsFeatureCount(){return-1===this._numFeatures}get numVertices(){return this._numVertices}constructor(c){this.descriptor=
c;this.fetchStatus=a.FetchStatus.FETCH_NEEDED;this._features=null;this._featuresLength=q.signal(0);this._numVertices=0;this._featureLimit=q.signal(0);this._featuresMissing=q.signal(!0);this._fetchFailed=q.signal(!1);this._shuffled=!1;this._numFeatures=-1;this._emptyFeatureRatio=q.signal(0);this._estimatedSize=-1;this._estimatedUnusedSize=0;this._estimatedUnusedSizeDirty=!1;this._availableFields=k;this._displayingFeatures=null;this.alive=!0;this.filtered=!1}get id(){return this.descriptor.id}get estimatedSize(){this.updateMemoryEstimates();
return this._estimatedSize}get estimatedUnusedSize(){return this._estimatedUnusedSize}updateMemoryEstimates(){if(0>this._estimatedSize){this._estimatedUnusedSize=this._estimatedSize=0;if(this._features)for(var c=0;c<this._features.length;++c){const e=p.estimateSize(this._features[c]);this._estimatedSize+=e;c>=this.featureLimit&&(this._estimatedUnusedSize+=e)}return!0}if(this._estimatedUnusedSizeDirty){this._estimatedUnusedSize=0;this._estimatedUnusedSizeDirty=!1;if(this._features)for(c=this.featureLimit;c<
this._features.length;++c)this._estimatedUnusedSize+=p.estimateSize(this._features[c]);return!0}return!1}get isFetching(){return this.fetchStatus===a.FetchStatus.FETCHING||this.fetchStatus===a.FetchStatus.REFETCHING}get isRefetching(){return this.fetchStatus===a.FetchStatus.REFETCHING}get needsFetching(){return this.fetchStatus===a.FetchStatus.FETCH_NEEDED||this.fetchStatus===a.FetchStatus.REFETCH_NEEDED}get needsRefetching(){return this.fetchStatus===a.FetchStatus.REFETCH_NEEDED}get isFetched(){return this.fetchStatus===
a.FetchStatus.DONE||this.fetchStatus===a.FetchStatus.FULL}resetFetching(){this.fetchStatus=this.fetchStatus===a.FetchStatus.REFETCHING?a.FetchStatus.REFETCH_NEEDED:a.FetchStatus.FETCH_NEEDED}get needsDisplayUpdate(){var c;if(c=!!this._features){a:{c=this._features;var e=this.displayingFeatures,g=this.featureLimit;if(null==e||null==c||g!==e.length||g>c.length)c=!1;else{for(let d=0;d<g;++d)if(c[d]!==e[d]){c=!1;break a}c=!0}}c=!c}return c}intersects(c){if(null==c||!this.descriptor.extent)return!0;l.fromExtent(c,
f);return l.intersects(this.descriptor.extent,f)}intersectionIncludingBorrowed(c,e){const g=null!=this.extentIncludingBorrowedFeatures?this.extentIncludingBorrowedFeatures:this.descriptor.extent;if(!c&&!g)return l.copy(e,l.positiveInfinity),e;null!=c?(l.fromExtent(c,e),l.intersection(e,g,e)):l.copy(e,g);return e}_shuffle(c){this._features&&(this._features.sort((e,g)=>p.getObjectId(e,c)-p.getObjectId(g,c)),b.shuffle(this._features,16438),this._estimatedUnusedSizeDirty=this._shuffled=!0)}reduceFeatures(c,
e,g){if(0>=c)return!1;if(!this._features)return this.featureLimit=0,!1;let d=!1;this.featureLimit=Math.ceil(this.numFeatures*c);this.featureLimit>this._features.length&&(this.featureLimit=this._features.length,this.fetchStatus===a.FetchStatus.DONE&&0<this._features.length&&(this.fetchStatus=a.FetchStatus.REFETCH_NEEDED,d=!0));!this._shuffled&&1>c&&this._shuffle(g);c=Math.max(this.featureLimit,Math.ceil(e*this.numFeatures));this._features.length>c&&(this._features.length=c,this._featuresLength.value=
c,this.featuresMissing=!0,this.fetchStatus===a.FetchStatus.FULL&&(this.fetchStatus=a.FetchStatus.DONE));return d}get cache(){return{availableFields:this._availableFields,features:this._features,numFeatures:this._numFeatures,emptyFeatureRatio:this._emptyFeatureRatio.value,fetchStatus:this.fetchStatus,featuresMissing:this.featuresMissing}}set cache(c){this.requestController=null;this._availableFields=c.availableFields;this._features=c.features;this._featuresLength.value=c.features?.length??0;this._numFeatures=
c.numFeatures;this._emptyFeatureRatio.value=c.emptyFeatureRatio;this.fetchStatus=c.fetchStatus;this.featuresMissing=c.featuresMissing;this._estimatedSize=-1;this._estimatedUnusedSizeDirty=!0}}a.FetchStatus=void 0;(function(c){c[c.FETCH_NEEDED=0]="FETCH_NEEDED";c[c.REFETCH_NEEDED=1]="REFETCH_NEEDED";c[c.FETCHING=2]="FETCHING";c[c.REFETCHING=3]="REFETCHING";c[c.DONE=4]="DONE";c[c.FULL=5]="FULL"})(a.FetchStatus||(a.FetchStatus={}));const f=l.create();a.FeatureTile=h;a.failedFeatureCount=-2;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileFetcher3DDebugger":function(){define("exports ../../../../Color ../../../../Graphic ../../../../symbols ../../../../core/Collection ../../../../geometry/Polygon ../../../../symbols/FillSymbol3DLayer ../../../../symbols/PointSymbol3D ../../../../symbols/PolygonSymbol3D ../../../../symbols/TextSymbol3DLayer ../../../../symbols/support/Symbol3DVerticalOffset ../../terrain/TilingScheme ../../../../symbols/callouts/LineCallout3D ../../../../symbols/callouts/LineCallout3DBorder".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){const v=[[0,179,255],[117,62,128],[0,104,255],[215,189,166],[32,0,193],[98,162,206],[102,112,129],[52,125,0],[142,118,246],[138,83,0],[92,122,255],[122,55,83],[0,142,255],[81,40,179],[0,200,244],[13,24,127],[0,170,147],[19,58,241],[22,44,35]];class m{constructor(r,n,u){this._loadingGraphics=new Map;this._loadedGraphics=new Map;this._pendingGraphics=new Map;this._dataExtentGraphic=null;this._enabled=!0;this._tileFetcher=r;this._view=u;this._tilingScheme=new d.TilingScheme(n);
this._loadedSymbols=v.map(x=>new c({symbolLayers:new p([new h({material:{color:[x[0],x[1],x[2],.6]},outline:{color:"black",size:1}})])}));this._loadingSymbols=[new c({symbolLayers:new p([new h({material:{color:[200,200,200,.4]},outline:{color:[30,30,30],size:1}})])})];this._pendingSymbols=[new c({symbolLayers:new p([new h({material:{color:[100,100,100,.4]},outline:{color:[30,30,30],size:1}})])})];this._dataExtentSymbol=new c({symbolLayers:new p([new h({material:{color:[0,0,0,0]},outline:{color:"green",
size:4}})])})}destroy(){this.enabled=!1}get enabled(){return this._enabled}set enabled(r){this._enabled=r;this.update()}update(){this._enabled?(this._synchronizeMaps(this._loadingGraphics,{filter:r=>r.isFetching,symbols:this._loadingSymbols}),this._synchronizeMaps(this._loadedGraphics,{filter:r=>!r.isFetching,symbols:this._loadedSymbols}),this._synchronizeMaps(this._pendingGraphics,{filter:r=>!r.isFetching,symbols:this._pendingSymbols}),this.showDataExtent(this._tileFetcher.filterExtent)):(this._loadingGraphics.forEach(r=>
{this._view.graphics.removeMany(r)}),this._loadingGraphics.clear(),this._loadedGraphics.forEach(r=>{this._view.graphics.removeMany(r)}),this._loadedGraphics.clear(),this._pendingGraphics.forEach(r=>{this._view.graphics.removeMany(r)}),this._pendingGraphics.clear(),this._dataExtentGraphic&&(this._view.graphics.remove(this._dataExtentGraphic),this._dataExtentGraphic=null))}showDataExtent(r){this._dataExtentGraphic&&(this._view.graphics.remove(this._dataExtentGraphic),this._dataExtentGraphic=null);null!=
r&&(r=k.fromExtent(r),this._dataExtentGraphic=new q({geometry:r,symbol:this._dataExtentSymbol}),this._view.graphics.add(this._dataExtentGraphic))}_synchronizeMaps(r,n){const u=[];r.forEach((x,y)=>{const z=this._tileFetcher.test.getFeatureTileById(y);z&&n.filter(z)||(this._view.graphics.removeMany(x),u.push(y))});u.forEach(x=>r.delete(x));this._tileFetcher.test.forEachFeatureTile(x=>{if(n.filter(x)&&!r.has(x.id)){const [A,B,C]=x.descriptor.lij;this._tilingScheme.ensureMaxLod(A);var y=this._tilingScheme.getExtentGeometry(A,
B,C),z=new q({geometry:y,symbol:n.symbols[A%n.symbols.length]});y=new q({geometry:y.center,symbol:new f({verticalOffset:new g({screenLength:40/.75}),callout:new t({color:new b("white"),border:new w({color:new b("black")})}),symbolLayers:new p([new e({text:`${A}/${B}/${C}`,halo:{color:"white",size:1/.75},material:{color:"black"},size:16})])})});z=[z,y];r.set(x.id,z);this._view.graphics.addMany(z)}})}}a.FeatureTileFetcher3DDebugger=m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/FeatureLayerViewPerformanceInfo":function(){define(["exports",
"./support/LayerViewPerformanceInfo"],function(a,b){class q extends b.LayerViewPerformanceInfo{constructor(l,p,k,h,f,c){super(l.usedMemory,l.displayedFeatures,l.totalFeatures,l.maximumFeatures,l.nodes,l.core);this.storedFeatures=p;this.totalVertices=k;this.partial=h;this.mode=f;this.symbolComplexity=c}}a.FeatureLayerViewPerformanceInfo=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DGraphicsPipeline":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Error ../../../../core/maybe ../../../../core/Promise ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/support/UpdatingHandles ../../../../layers/graphics/controllers/FeatureTileController3D ../../../../symbols/support/utils ./elevationAlignPointsInFeatures ./Graphics3DFeatureProcessor ./QueryEngine ./queryForSymbologySnapping ../support/HeatmapFeatureProcessor ../support/LayerViewPerformanceInfo ../../webgl-engine/lib/UpdatePolicy ../../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z){a.Graphics3DGraphicsPipeline=class extends p.EsriPromise{constructor(B){super(B);this._dataUpdatingState=A.NONE;this.controller=null;this.updatingHandles=new d.UpdatingHandles;this._controllerCreated=!1;this._pendingController=null}initialize(){this.addResolvingPromise(this._initializeController());this.updatingHandles.add(()=>this.layer.renderer,C=>this._recreateProcessor(C),k.initial);this.updatingHandles.add(()=>this.updatePolicy,C=>this.processor.preferredUpdatePolicy=
C);const B=()=>this.processor.featureStore;this.queryEngine=new r.QueryEngine({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return B()},hasZ:this.hasZ,hasM:this.hasM},priority:z.TaskPriority.FEATURE_QUERY_ENGINE})}destroy(){this.removeAllHandles();this.updatingHandles.destroy();this._destroyPendingController();this.controller=l.destroyMaybe(this.controller);this.processor=l.destroyMaybe(this.processor);this.queryEngine=
l.destroyMaybe(this.queryEngine);this.loadedGraphics=null}_destroyPendingController(){this._pendingController=l.destroyMaybe(this._pendingController)}get updating(){return this.updatingHandles.updating||!this._controllerCreated||this.controller?.updating||this.processor?.updating}get legendEnabled(){return this.processor.legendEnabled}get layer(){return this.layerView.layer}get view(){return this.layerView.view}get hasZ(){return this.layerView.hasZ}get hasM(){return this.layerView.hasM}get fullOpacity(){return this.layerView.fullOpacity}get suspended(){return this.layerView.suspended}get filter(){return"filter"in
this.layerView?this.layerView.filter:null}get slicePlaneEnabled(){return this.layerView.slicePlaneEnabled}get featureSpatialReference(){return"featureSpatialReference"in this.layerView?this.layerView.featureSpatialReference:null}get graphics3DProcessor(){return"graphics-3d"===this.processor?.type?this.processor:null}get heatmapProcessor(){return"heatmap"===this.processor?.type?this.processor:null}get hasAllFeatures(){return this.controller&&"hasAllFeatures"in this.controller?this.controller.hasAllFeatures:
!1}get hasAllFeaturesInView(){return this.controller&&"hasAllFeaturesInView"in this.controller?this.controller.hasAllFeaturesInView:!1}get hasFullGeometries(){return this.controller&&"hasFullGeometries"in this.controller?this.controller.hasFullGeometries:!1}get symbologySnappingSupported(){return this.layer?.renderer?.getSymbols()?.some(w.symbolHasExtrudeSymbolLayer)??!1}get updatePolicy(){return y.UpdatePolicy.SYNC}get scaleVisibilitySuspended(){return this.processor?.scaleVisibilitySuspended}get timeExtent(){return"timeExtent"in
this.layerView?this.layerView.timeExtent:null}get dataUpdating(){return this._dataUpdatingState!==A.NONE}get suspendInfo(){return this.processor?.suspendInfo??{}}forEachGraphic(B){this.loadedGraphics.forEach(B)}findGraphic(B){return this.loadedGraphics.find(B)}queryObjectIds(B,C){return this.layerView.queryObjectIds(B,C)}whenGraphicBounds(B,C){return this.processor?.whenGraphicBounds(B,C)}computeAttachmentOrigin(B,C){return this.processor?.computeAttachmentOrigin(B,C)}async elevationAlignPointsInFeatures(B,
C){const D=this.graphics3DProcessor;if(null==D)throw new q("featurelayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");return v.elevationAlignPointsInFeatures(this.view,this.layer,F=>D.getGraphics3DGraphicByObjectId(F),B,C)}async queryForSymbologySnapping(B,C){return this.symbologySnappingSupported?n.queryForSymbologySnapping(this.graphics3DProcessor,B,C):{candidates:[],sourceCandidateIndices:[]}}highlight(B){return this.processor.highlight(B,this.layer.objectIdField)}maskOccludee(B){return this.processor.maskOccludee(B)}async _initializeController(){const B=
this.createController();this._pendingController=B;this._setupDataUpdating(B);await B.when();this._setControllerWhenInitialized(B)}_setupDataUpdating(B){"dataUpdating"in B&&this.addHandles([k.watch(()=>B.dataUpdating,C=>{C&&this._dataUpdatingState===A.NONE?this._dataUpdatingState=A.CONTROLLER:C||this._dataUpdatingState!==A.CONTROLLER||(this._dataUpdatingState=A.NONE)},k.sync),k.watch(()=>!!this.graphics3DProcessor?.dataUpdating,C=>{C&&this._dataUpdatingState===A.CONTROLLER?this._dataUpdatingState=
A.CORE:C||this._dataUpdatingState!==A.CORE||(this._dataUpdatingState=B.dataUpdating?A.CONTROLLER:A.NONE)},k.sync)])}async _setControllerWhenInitialized(B){try{await this.when()}catch(C){}this._controllerCreated=!0;!this.isResolved()||this.destroyed?this._destroyPendingController():(await k.whenOnce(()=>this.view?.basemapTerrain?.ready),this.beforeSetController(B),this._pendingController=null,this.controller=B,this.loadedGraphics=B.graphics)}_recreateProcessor(B){var C="heatmap"===B?.type;const D=
"heatmap"===this.processor?.type;B=this.processor;B&&C===D||(this.processor=C=C?new u.HeatmapFeatureProcessor({owner:this}):new m.Graphics3DFeatureProcessor({owner:this,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:F=>this._updateClippingExtent(F)}),B?.destroy(),this.queryEngine?.clear(),this.addResolvingPromise(C.initializePromise))}_updateClippingExtent(B){this.clippingExtent=
B;if(!this.controller)return!1;switch(this.controller.type){case "stream":return!1;case "feature-tile-3d":return this.controller.extent=B,!0}}get performanceInfo(){const B=this.controller instanceof t.FeatureTileController3D?this.controller:null;return new x.LayerViewPerformanceInfo(this.processor.usedMemory,this.loadedGraphics?.length,B?.serviceDataCount??-1,B?.maximumNumberOfFeatures??-1,0,this.processor.performanceInfo)}};b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"updating",
null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"legendEnabled",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"layerView",void 0);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"layer",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"view",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"hasZ",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"hasM",null);
b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"fullOpacity",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"suspended",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"filter",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"slicePlaneEnabled",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"featureSpatialReference",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,
"loadedGraphics",void 0);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"graphics3DProcessor",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"heatmapProcessor",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"hasAllFeatures",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"hasAllFeaturesInView",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"hasFullGeometries",null);b.__decorate([h.property()],
a.Graphics3DGraphicsPipeline.prototype,"symbologySnappingSupported",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"updatePolicy",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"queryEngine",void 0);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"scaleVisibilitySuspended",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"timeExtent",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,
"_dataUpdatingState",void 0);b.__decorate([h.property({readOnly:!0})],a.Graphics3DGraphicsPipeline.prototype,"dataUpdating",null);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"controller",void 0);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"processor",void 0);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"updatingHandles",void 0);b.__decorate([h.property()],a.Graphics3DGraphicsPipeline.prototype,"_controllerCreated",void 0);a.Graphics3DGraphicsPipeline=
b.__decorate([g.subclass("esri.views.3d.layers.graphics.Graphics3DGraphicsPipeline")],a.Graphics3DGraphicsPipeline);var A;(function(B){B[B.NONE=0]="NONE";B[B.CONTROLLER=1]="CONTROLLER";B[B.CORE=2]="CORE"})(A||={});Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/elevationAlignPointsInFeatures":function(){define("exports ../../../../geometry ../../../../core/promiseUtils ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/projectPointToVector ../../../../layers/graphics/dehydratedPoint ../../../../support/elevationInfoUtils ./elevationAlignmentUtils ./ElevationContext ./featureExpressionInfoUtils ../../../../geometry/SpatialReference".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){a.elevationAlignPointsInFeatures=async function(d,t,w,v,m){const {elevationProvider:r,renderCoordsHelper:n}=d,{elevationInfo:u}=t,{pointsInFeatures:x,spatialReference:y}=v;var z=g.fromJSON(y);v=e.extractExpressionInfo(u,!0);v=await e.createContext(v,z,m);q.throwIfAborted(m);const A=[],B=new Set,C=new Set,D=new c.ElevationContext,F=k.makeDehydratedPoint(0,0,0,g.WGS84),H=new f.SampleElevationInfo,N=l.create();F.spatialReference=z;d=d.elevationProvider.spatialReference??
d.spatialReference;for(const {objectId:E,points:G}of x)if(z=w(E),null==z){for(const I of G)A.push(I.z??0);B.add(E)}else{z.isDraped&&C.add(E);D.setFromElevationInfo(h.getGeometryEffectiveElevationInfo(z.graphic.geometry,u));D.updateFeatureExpressionInfoContext(v,z.graphic,t);for(const {x:I,y:O,z:L}of G)F.x=I,F.y=O,F.z=L??0,await p.projectPointToVectorAsync(F,N,d,0,{signal:m}),f.evaluateElevationInfoAtPoint(N,r,D,n,H),A.push(H.z)}return{elevations:A,drapedObjectIds:C,failedObjectIds:B}};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DFeatureProcessor":function(){define("exports ../../../../chunks/tslib.es6 ../../../../Graphic ../../../../arcade/functions/hash ../../../../core/Accessor ../../../../core/compilerUtils ../../../../core/handleUtils ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/accessorSupport/diffUtils ../../../../core/support/UpdatingHandles ../../../../geometry/support/webMercatorUtils ../../../../renderers/support/randomRotationExpression ../../../../renderers/support/renderingInfoUtils ../../../../rest/support/Query ../interfaces ./constants ./DisplayFeatureLimit ./Graphics3DCore ./Graphics3DElevationAlignment ./Graphics3DFrustumVisibility ./Graphics3DObjectStates ./Graphics3DScaleVisibility ./graphicUtils ../support/attributeUtils ../support/FeatureVisibilityFilter ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/UpdatePolicy".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O){a.Graphics3DFeatureProcessor=class extends p{constructor(L){super(L);this.type="graphics-3d";this._randomRotationRenderers=null;this._updatingHandles=new m.UpdatingHandles;this.timeExtentEnabled=this.elevationAlignmentEnabled=this.frustumVisibilityEnabled=this.filterVisibilityEnabled=this.scaleVisibilityEnabled=this.elevationFeatureExpressionEnabled=!1;this.setUidToIdOnAdd=!0;this.dataExtent=null;this.drapeSourceType=y.DrapeSourceType.Features;
this.preferredUpdatePolicy=O.UpdatePolicy.ASYNC;this._suspendResumeExtent=null}initialize(){const L=this.owner,P=new B.Graphics3DCore({owner:this,layer:this.layer,preferredUpdatePolicy:this.preferredUpdatePolicy,elevationFeatureExpressionEnabled:this.elevationFeatureExpressionEnabled,graphicSymbolSupported:!1,hasZ:L.hasZ,hasM:L.hasM,setUidToIdOnAdd:this.setUidToIdOnAdd,componentFactories:{deconflictor:M=>L.view.deconflictor.addGraphicsOwner(M),labeler:(M,K)=>L.view.labeler.addGraphicsOwner(M,K),elevationAlignment:this.elevationAlignmentEnabled?
(M,K)=>new C.Graphics3DElevationAlignment({graphicsCoreOwner:this,graphicsCore:M,queryGraphicUIDsInExtent:K,elevationProvider:L.view.elevationProvider}):null,scaleVisibility:this.scaleVisibilityEnabled?(M,K)=>new H.Graphics3DScaleVisibility({graphicsCoreOwner:this,layer:this.layer,queryGraphicUIDsInExtent:K,graphicsCore:M,basemapTerrain:L.view.basemapTerrain}):null,filterVisibility:(this.filterVisibilityEnabled||this.timeExtentEnabled)&&"multipatch"!==L.layer.geometryType?M=>new G.FeatureVisibilityFilter({context:{...M,
configuration:L}}):null,objectStates:M=>new F.Graphics3DObjectStates(M)}});this._set("graphicsCore",P);this.frustumVisibilityEnabled&&this._set("frustumVisibility",new D.Graphics3DFrustumVisibility({graphicsCoreOwner:this}));this.elevationAlignment&&this._updatingHandles.add(()=>this.layer.elevationInfo,(M,K)=>{v.diff(M,K)&&this._updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())});this._updatingHandles.add(()=>this.layer.labelsVisible,()=>this.graphicsCore.updateVisibilityInfo());
this._updatingHandles.add(()=>this.layer.labelingInfo,(M,K)=>{v.diff(M,K)&&this.graphicsCore.updateLabelingInfo()});this._updatingHandles.add(()=>this.preferredUpdatePolicy,M=>this.graphicsCore.preferredUpdatePolicy=M);this._set("initializePromise",this._initializeAsync());this._updatingHandles.addPromise(this.initializePromise)}async _initializeAsync(){await c.logOnError(this.graphicsCore.initializePromise);const L=this.owner;this._updatingHandles.add(()=>this.renderer,P=>this._updatingHandles.addPromise(this.graphicsCore.rendererChange(P)));
this._updatingHandles.add(()=>L.fullOpacity,()=>this.graphicsCore.opacityChange());this._setupSuspendResumeExtent();this.updateClippingExtent&&(this._updatingHandles.add(()=>L.view.clippingArea,()=>this._updateClippingExtent()),this._updateClippingExtent());this.graphicsCore.startCreateGraphics();this.graphicsCore.labelsEnabled&&await c.logOnError(this.graphicsCore.updateLabelingInfo())}destroy(){this._updatingHandles.destroy();this._set("frustumVisibility",f.destroyMaybe(this.frustumVisibility));
this._set("graphicsCore",f.destroyMaybe(this.graphicsCore));this._set("owner",null)}get layer(){return this.owner.layer}get dataUpdating(){return this.graphicsCore?.dataUpdating??!1}get renderer(){const {renderer:L,objectIdField:P}=this.layer;if(!L||!P||"heatmap"===L.type||!L.visualVariables)return L;const M=L.visualVariables.findIndex(J=>"rotation"===J.type&&null!=J.valueExpression&&n.matchRandomRotationExpression(J.valueExpression)===P&&(null==J.axis||"heading"===J.axis)&&"geographic"===J.rotationType);
if(0>M)return L;const K=L.clone();K.visualVariables.splice(M,1);this._randomRotationRenderers||(this._randomRotationRenderers=new WeakMap);this._randomRotationRenderers.set(K,P);return K}get scaleVisibility(){return this.graphicsCore?.scaleVisibility}get filterVisibility(){return this.graphicsCore?.filterVisibility}get elevationAlignment(){return this.graphicsCore?.elevationAlignment}get suspendResumeExtentMode(){return this.owner.suspendResumeExtentMode??"computed"}get scaleVisibilitySuspended(){return null!=
this.scaleVisibility&&this.scaleVisibility.suspended}get suspended(){return this.owner.suspended}get legendEnabled(){return null==this.frustumVisibility||!this.frustumVisibility.suspended}get suspendInfo(){const L={};this.scaleVisibilitySuspended&&(L.outsideScaleRange=!0);null!=this.frustumVisibility&&this.frustumVisibility.suspended&&(L.outsideOfView=!0);return L}get updating(){return!!(this.graphicsCore?.updating||this.frustumVisibility?.updating||this._updatingHandles.updating)}get updatingRemaining(){return this.graphicsCore?.updatingRemaining??
0}get featureStore(){return this.graphicsCore?.featureStore}get view(){return this.owner.view}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner?.fullOpacity}get filter(){return"filter"in this.owner?this.owner.filter:null}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get updatePolicy(){return this.owner.updatePolicy}get featureSpatialReference(){return"featureSpatialReference"in this.owner?this.owner.featureSpatialReference:this.owner.view.spatialReference}get graphics3DGraphics(){return this.graphicsCore?.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.graphicsCore?.graphics3DGraphicsByObjectID}get symbolUpdateType(){return this.graphicsCore?.symbolUpdateType}get displayFeatureLimit(){const L=
this.view.quality,P=this.graphicsCore?.displayFeatureLimit;return 1===L?P:new A.DisplayFeatureLimit(P.maximumTotalNumberOfVertices,Math.ceil(P.maximumNumberOfFeatures*L),P.averageSymbolComplexity)}get usedMemory(){return this.graphicsCore?.usedMemory??0}get loadedFeatures(){return this.graphicsCore?.numberOfGraphics??0}get usedMemoryPerFeature(){return this.graphicsCore?.usedMemoryPerGraphic??0}get unprocessedMemoryEstimate(){return this.graphicsCore?.unprocessedMemoryEstimate??0}get performanceInfo(){return this.graphicsCore.performanceInfo}maskOccludee(L){const P=
this.graphicsCore?.objectStates;if(!P)return h.makeHandle();const {set:M,handle:K}=P.acquireSet(I.Object3DState.MaskOccludee,null);P.setUid(M,L.uid);return K}highlight(L,P){const M=this.graphicsCore?.objectStates;if(!M)return h.makeHandle();if(L instanceof x){const {set:K,handle:J}=M.acquireSet(I.Object3DState.Highlight,P);this.owner.queryObjectIds(L).then(R=>M.setObjectIds(K,R));return J}if("number"===typeof L||"string"===typeof L||L instanceof q)return this.highlight([L],P);"toArray"in L&&(L=L.toArray());
if(Array.isArray(L)&&0<L.length){if(L[0]instanceof q)if(null!=E.attributeLookup(this.layer.fieldsIndex,L[0].attributes,P))L=L.map(K=>E.attributeLookup(this.layer.fieldsIndex,K.attributes,P));else{L=L.map(R=>R.uid);const {set:K,handle:J}=M.acquireSet(I.Object3DState.Highlight,null);M.setUids(K,L);return J}if(Array.isArray(L)&&("number"===typeof L[0]||"string"===typeof L[0])){const {set:K,handle:J}=M.acquireSet(I.Object3DState.Highlight,P);M.setObjectIds(K,L);return J}}return h.makeHandle()}resetObjectStates(){this.graphicsCore?.objectStates?.reset()}whenGraphicBounds(L,
P){return this.graphicsCore?.whenGraphicBounds(L,P)}computeAttachmentOrigin(L,P){return this.graphicsCore?.computeAttachmentOrigin(L,P)}notifyGraphicGeometryChanged(L){this.graphicsCore.notifyGraphicGeometryChanged(L)}notifyGraphicVisibilityChanged(L){this.graphicsCore.notifyGraphicVisibilityChanged(L)}getRenderingInfo(L,P,M){M=u.getRenderingInfo(L,{renderer:P,arcade:M});if(M?.color){const K=M.color;K[0]/=255;K[1]/=255;K[2]/=255}null!=M&&null!=P&&this._randomRotationRenderers?.has(P)&&(P=this._randomRotationRenderers.get(P),
L=L.attributes[P],P=new l.XXH(0),P.updateFloatArray([L]),P.updateUint8Array([173]),M.heading=8.381E-8*P.digest());return M}getRenderingInfoAsync(L,P,M,K){return u.getRenderingInfoAsync(L,{renderer:P,arcade:M,...K})}getSymbolLayerSize(L,P){return this.graphicsCore?.getSymbolLayerSize(L,P)}setObjectIdVisibility(L,P){this.graphicsCore?.setObjectIdVisibility(L,P)}refreshFilter(){null!=this.filterVisibility&&this.filterVisibility.reapply()}getGraphics3DGraphicByObjectId(L){return this.graphicsCore?.getGraphics3DGraphicByObjectId(L)}_updateClippingExtent(){const L=
this.owner.view.clippingArea;this.graphicsCore.setClippingExtent(L,this.owner.view.spatialReference)&&(this.updateClippingExtent(L)||this.graphicsCore.recreateAllGraphics())}_setupSuspendResumeExtent(){(this.frustumVisibility||this.scaleVisibility)&&this.addHandles(e.watch(()=>this.suspendResumeExtentMode,()=>{this.removeHandles("suspendResumeExtentMode");switch(this.suspendResumeExtentMode){case "computed":this.addHandles([e.watch(()=>this.graphicsCore.computedExtent,L=>this._updateSuspendResumeExtent(L),
e.initial),e.watch(()=>this.graphicsCore.extentPadding,()=>this._updateSuspendResumeExtent(this.graphicsCore.computedExtent))],"suspendResumeExtentMode");break;case "data":this.addHandles([e.when(()=>this.dataExtent,L=>this._updateSuspendResumeExtent(L),e.initial),e.watch(()=>this.graphicsCore.extentPadding,()=>this._updateSuspendResumeExtent(this.dataExtent))],"suspendResumeExtentMode");break;default:k.neverReached(this.suspendResumeExtentMode)}},e.initial))}_updateSuspendResumeExtent(L){L?this._suspendResumeExtentChanged(this._extentToSuspendResumeRect(L,
this._suspendResumeExtent)):this._suspendResumeExtentChanged(null)}_extentToSuspendResumeRect(L,P){const M=this.owner.view.spatialReference;if(!L.spatialReference.equals(M)){if(!r.canProject(L,M))return;L=r.project(L,M)}return N.enlargeExtent(L,P,z.suspendResumeExtentOptimism,this.graphicsCore.extentPadding)}_suspendResumeExtentChanged(L){null!=this.frustumVisibility&&this.frustumVisibility.setExtent(L);null!=this.scaleVisibility&&this.scaleVisibility.setExtent(L)}};b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,
"type",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"owner",void 0);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"layer",null);b.__decorate([g.property({readOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"dataUpdating",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"renderer",null);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"updateClippingExtent",void 0);b.__decorate([g.property({constructOnly:!0})],
a.Graphics3DFeatureProcessor.prototype,"elevationFeatureExpressionEnabled",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"graphicsCore",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"scaleVisibilityEnabled",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"filterVisibilityEnabled",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,
"frustumVisibilityEnabled",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"elevationAlignmentEnabled",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"timeExtentEnabled",void 0);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"setUidToIdOnAdd",void 0);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"scaleVisibility",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,
"filterVisibility",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"elevationAlignment",null);b.__decorate([g.property({constructOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"frustumVisibility",void 0);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"initializePromise",void 0);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"suspendResumeExtentMode",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"dataExtent",
void 0);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"scaleVisibilitySuspended",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"suspended",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"legendEnabled",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"suspendInfo",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"updating",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,
"updatingRemaining",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"featureStore",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"view",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"loadedGraphics",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"fullOpacity",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"filter",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,
"slicePlaneEnabled",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"drapeSourceType",void 0);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"updatePolicy",null);b.__decorate([g.property()],a.Graphics3DFeatureProcessor.prototype,"preferredUpdatePolicy",void 0);b.__decorate([g.property({readOnly:!0})],a.Graphics3DFeatureProcessor.prototype,"displayFeatureLimit",null);a.Graphics3DFeatureProcessor=b.__decorate([w.subclass("esri.views.3d.layers.graphics.Graphics3DFeatureProcessor")],
a.Graphics3DFeatureProcessor);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/functions/hash":function(){define(["exports"],function(a){function b(l){const p=[];for(let k=0,h=l.length;k<h;k++){let f=l.charCodeAt(k);128>f?p.push(f):2048>f?p.push(192|f>>6,128|f&63):55296>f||57344<=f?p.push(224|f>>12,128|f>>6&63,128|f&63):(k++,f=65536+((f&1023)<<10|l.charCodeAt(k)&1023),p.push(240|f>>18,128|f>>12&63,128|f>>6&63,128|f&63))}return new Uint8Array(p)}class q{constructor(l){this._seed=
l;this._totallen=0;this._bufs=[];this.init()}init(){this._bufs=[];this._totallen=0;return this}updateFloatArray(l){const p=[];for(const k of l)isNaN(k)?p.push("NaN"):Infinity===k?p.push("Infinity"):-Infinity===k?p.push("-Infinity"):0===k?p.push("0"):p.push(k.toString(16));this.update(b(p.join("")))}updateIntArray(l){l=Int32Array.from(l);this.update(new Uint8Array(l.buffer))}updateUint8Array(l){this.update(Uint8Array.from(l))}updateWithString(l){return this.update(b(l))}update(l){this._bufs.push(l);
this._totallen+=l.length;return this}digest(){const l=new Uint8Array(this._totallen);let p=0;for(const k of this._bufs)l.set(k,p),p+=k.length;this.init();return this._xxHash32(l,this._seed)}_xxHash32(l,p=0){var k=p+374761393&4294967295;let h=0;if(16<=l.length){k=[p+2654435761+2246822519&4294967295,p+2246822519&4294967295,p+0&4294967295,p-2654435761&4294967295];p=l.length-16;var f=0;for(h=0;(h&4294967280)<=p;h+=4){var c=h;c=k[f]+(2246822519*(l[c]+(l[c+1]<<8))+(2246822519*(l[c+2]+(l[c+3]<<8))<<16))&
4294967295;c=c<<13|c>>>19;k[f]=2654435761*(c&65535)+(2654435761*(c>>>16)<<16)&4294967295;f=f+1&3}k=(k[0]<<1|k[0]>>>31)+(k[1]<<7|k[1]>>>25)+(k[2]<<12|k[2]>>>20)+(k[3]<<18|k[3]>>>14)&4294967295}k=k+l.length&4294967295;for(p=l.length-4;h<=p;h+=4)f=h,k=k+(3266489917*(l[f]+(l[f+1]<<8))+(3266489917*(l[f+2]+(l[f+3]<<8))<<16))&4294967295,k=k<<17|k>>>15,k=668265263*(k&65535)+(668265263*(k>>>16)<<16)&4294967295;for(;h<l.length;++h)k+=374761393*l[h],k=k<<11|k>>>21,k=2654435761*(k&65535)+(2654435761*(k>>>16)<<
16)&4294967295;k^=k>>>15;k=(2246822519*(k&65535)&4294967295)+(2246822519*(k>>>16)<<16);k^=k>>>13;k=(3266489917*(k&65535)&4294967295)+(3266489917*(k>>>16)<<16);k^=k>>>16;return 0>k?k+4294967296:k}}a.XXH=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/DisplayFeatureLimit":function(){define(["exports"],function(a){class b{constructor(q,l,p){this.maximumTotalNumberOfVertices=q;this.maximumNumberOfFeatures=l;this.averageSymbolComplexity=p}}a.DisplayFeatureLimit=
b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DCore":function(){define("exports ../../../../chunks/tslib.es6 ../../../../geometry ../../../../renderers/ClassBreaksRenderer ../../../../renderers/DictionaryRenderer ../../../../renderers/DotDensityRenderer ../../../../renderers/HeatmapRenderer ../../../../renderers/PieChartRenderer ../../../../renderers/Renderer ../../../../renderers/SimpleRenderer ../../../../renderers/UniqueValueRenderer ../../../../renderers/support/jsonUtils ../../../../core/Logger ../../../../symbols ../../../../core/Accessor ../../../../core/arrayUtils ../../../../core/has ../../../../core/Error ../../../../core/handleUtils ../../../../core/MapUtils ../../../../core/maybe ../../../../core/MemCache ../../../../core/PooledArray ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/scheduling ../../../../core/accessorSupport/decorators/property ../../../../core/accessorSupport/decorators/subclass ../../../../core/accessorSupport/diffUtils ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection ../../../../geometry/projection/projectBuffer ../../../../geometry/projection/projectVectorToVector ../../../../geometry/projection/projectXYZToVector ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/spatialReferenceUtils ../../../../layers/Layer ../../../../layers/graphics/dehydratedFeatures ../../../../layers/graphics/hydratedFeatures ../../../../layers/support/PromiseQueue ../../../../renderers/support/rendererConversion ../../../../support/arcadeOnDemand ../../../../support/basemapUtils ../../../../symbols/support/defaults3D ../../../../symbols/support/symbolConversion ./defaultSymbolComplexity ./DisplayFeatureLimit ./ElevationQuery ./enums ./featureExpressionInfoUtils ./Graphics3DFeatureStore ./Graphics3DGraphicCreationContext ./Graphics3DSymbolCreationContext ./Graphics3DSymbolFactory ./Graphics3DWebStyleSymbol ./GraphicsCorePerformanceInfo ./GraphicStateTracking ./graphicUtils ./interfaces ./Loadable ./SpatialIndex2D ./symbolMemory ../support/StageLayerElevationProvider ../../support/extentUtils ../../support/PropertiesPool ../../webgl-engine/lib/GridLocalOriginFactory ../../webgl-engine/lib/UpdatePolicy ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/lib/WebGLLayer ../../../layers/support/popupUtils ../../../support/Scheduler ../../../support/Yield ../../../../geometry/Extent ../../../../geometry/Point ../../../../symbols/LabelSymbol3D ../../../../symbols/TextSymbol ../../../../symbols/WebStyleSymbol".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U,Z,ca,ea,da,ia,ka,fa,X,ja,la,na,va,za,ya,Da,ra,xa,Ma,Ga,Pa,Qa,Ea,ua,Na,Ua,wa,sa,Ha,Ka,Aa,Sa){var Ya;const qa=G.create(),aa=M.create();a.Graphics3DCore=Ya=class extends v{get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){this._spatialIndex||(this._spatialIndex=new Da.SpatialIndex2D({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference,
hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values())));this._spatialIndex.update();return this._spatialIndex}get deconflictor(){return this._deconflictor}get labeler(){return this._labeler}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return null!=this.currentRenderer&&"dictionary"===this.currentRenderer.type?Qa.UpdatePolicy.ASYNC:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this.dataUpdating||
this._elevationAlignment?.updating||this._scaleVisibility?.updating||this._filterVisibility?.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._frameTaskHandle.updating||this.running)}get dataUpdating(){return!!(0<this._graphicsWaitingForSymbol.size||0<this._pendingUpdates.size||this._spatialIndex?.updating||this._updatingPendingLoadedGraphicsChange||this._dataUpdateQueue.running||0<this._loadingSymbols)}get running(){return 0<this._pendingUpdates.size||
!!this._spatialIndex?.updating||this._dataUpdateQueue.running||this._updateQueue.running}get suspendedOrOutsideOfView(){return this.owner.suspended||!!this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return this.updating?this._pendingUpdates.size+.1*(this._spatialIndex?.updatingRemaining||0)+.1*(this._elevationAlignment?.updatingRemaining||0):0}get displayFeatureLimit(){var pa=this.owner&&this.owner.view&&this.owner.view.qualitySettings,Ba=pa?.graphics3D.maxTotalNumberOfFeatures??0;const Ia=
pa?.graphics3D.maxNumberOfDrawCalls??0,Wa=pa?.graphics3D.maxTotalNumberOfVertices??0,gb=this.averageSymbolComplexity;pa=Math.max(pa?.graphics3D.minTotalNumberOfFeatures??0,Math.min(Ba,Math.ceil(Wa/Math.max(1,gb?.verticesPerFeature??1)),gb&&0<gb.drawCallsPerFeature&&0<Ia?Ia/gb.drawCallsPerFeature:Ba));return(Ba=this._get("displayFeatureLimit"))&&Ba.maximumTotalNumberOfVertices===Wa&&Ba.averageSymbolComplexity===gb&&Ba.maximumNumberOfFeatures===pa?Ba:new Z.DisplayFeatureLimit(Wa,pa,gb)}get averageSymbolComplexity(){const pa=
U.averageSymbolComplexities(this._symbolComplexities),Ba=this._get("averageSymbolComplexity");return 0===pa.numComplexities||null!=Ba&&(pa.estimated&&(Ba.verticesPerFeature>=pa.verticesPerFeature||Ba.verticesPerCoordinate>=pa.verticesPerCoordinate||Ba.drawCallsPerFeature>=pa.drawCallsPerFeature)||Ba.verticesPerFeature===pa.verticesPerFeature&&Ba.verticesPerCoordinate===pa.verticesPerCoordinate&&Ba.drawCallsPerFeature===pa.drawCallsPerFeature)?Ba:pa}get usedMemory(){const pa=null!=this.averageSymbolComplexity&&
this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel*this._numberOfGraphics:0,Ba=this._getSymbolComplexitiesUsed().reduce((ib,La)=>ib+La.memory.resourceBytes,0);if(null==this._symbolMaterials){this._symbolMaterials=[];for(var Ia of this._symbols.values())if(null!=Ia)for(const ib of Ia.symbolLayers)if(ib)for(const La of ib.materials)La&&this._symbolMaterials.push(La)}const Wa=this.owner.view._stage.renderer.plugins,gb=this.owner.view.basemapTerrain.overlayManager.renderer;Ia=
this._symbolMaterials.reduce((ib,La)=>ib+((Wa.getMaterialRenderer(La)||gb.getMaterialRenderer(La))?.usedMemory??0),0);return this._usedMemory+pa+Ba+Ia}get usedMemoryPerGraphic(){return this._usedMemory&&this._numberOfGraphics?this._usedMemory/this._numberOfGraphics*(this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves))):null!=this.averageSymbolComplexity?this.averageSymbolComplexity.memory.bytesPerFeature+(this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:
0):0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}get _symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}get visible(){return this._visible}_getConvertedSymbol(pa){if("web-style"===pa.type)return pa.clone();var Ba=this._symbolConversionCache.get(pa.id);if(null!=Ba)return Ba;Ba=ba.to3D(pa,{geometryType:this.layer?.geometryType??void 0,retainId:!0,
hasLabelingContext:this._hasLabelingContext(pa),cimFallbackEnabled:!0});const Ia=Ba.symbol||null;null==Ia&&Ba.error&&t.getLogger(this).error(Ba.error.message);this._symbolConversionCache.set(pa.id,Ia);return Ia}_getSymbolComplexitiesUsedOrRenderer(pa){if(null==pa)return[];var Ba=pa.getSymbols(),Ia="backgroundFillSymbol"in pa?pa.backgroundFillSymbol:null;if(!Ia&&!Ba?.length)return[];pa=[];Ia=this._getSymbolComplexityUsedOrRenderer(Ia);null!=Ia&&pa.push(Ia);for(const Wa of Ba)Ba=this._getSymbolComplexityUsedOrRenderer(Wa),
null!=Ba&&pa.push(Ba);return pa}_getSymbolComplexityUsedOrRenderer(pa){if(null==pa)return null;const Ba=this._symbols.get(pa.id);if(null!=Ba)return Ba.complexity;pa=this._getConvertedSymbol(pa);return null!=pa?U.defaultSymbolComplexity(pa):null}_getSymbolComplexitiesUsed(){const pa=[];this._symbols.forEach(Ba=>{null!=Ba&&pa.push(Ba.complexity)});return pa}get _objectIdField(){return this.layer.objectIdField}constructor(pa){super(pa);this._propertiesPool=new Ga.PropertiesPool({computedExtent:sa},this);
this.currentRenderer=this.computedExtent=null;this.rendererHasGeometryOperations=!1;this._graphicStateTracking=null;this.graphics3DGraphics=new Map;this.stage=this.stageLayer=null;this._graphicsDrapedUids=new Set;this._graphicsBySymbol=new Map;this._symbolConversionCache=new Map;this._symbols=new Map;this._graphicsWithoutSymbol=new Map;this._graphicsWaitingForSymbol=new Map;this._graphicsUpdateId=0;this._frameTaskHandle=Ua.ImmediateTask;this._dataUpdateQueue=new S.PromiseQueue;this._updateQueue=new S.PromiseQueue;
this._suspendSymbolCleanup=!1;this._spatialIndex=this._filterVisibility=this._scaleVisibility=this._elevationAlignment=this._initializeAbortController=this._elevationInfoChangeAbortController=this._rendererChangeAbortController=this._arcadeOnDemand=null;this.extentPadding=0;this._sharedSymbolResourcesOwnerHandle=this._stageLayerElevationProvider=this._viewElevationProvider=this._objectStates=this._labeler=this._deconflictor=this._featureStore=this._updatingPendingLoadedGraphicsChange=null;this._whenGraphics3DGraphicRequests=
{};this._pendingUpdates=new Map;this._pendingRemoves=this._pendingAdds=this._numberOfGraphicsProvidingElevation=this._numberOfGraphics=0;this._applyPendingRemovesFirst=!1;this._loadingSymbols=0;this._pendingUpdatesPool=new A({allocator:Ba=>Ba||new Ta,deallocator:Ba=>{Ba.clear();return Ba}});this._geometryWarningLogged=this._symbolWarningLogged=!1;this._objectIdInvisibleSet=new Set;this._whenSymbolRemoved=new A;this.preferredUpdatePolicy=Qa.UpdatePolicy.SYNC;this._forcedUpdatePolicy=null;this.elevationFeatureExpressionEnabled=
!0;this.layer=this.owner=null;this.graphicSymbolSupported=!0;this.getRenderingInfoWithoutRenderer=!1;this.setUidToIdOnAdd=!0;this.hasM=this.hasZ=null;this._usedMemory=0;this._startCreateGraphics=this._visible=!1;this._unusedSymbolsCache=pa.owner.view.resourceController.memoryController.newCache("graphics-3d-unused-symbols",Ba=>Ba.destroy());this.symbolCreationContext=new fa.Graphics3DSymbolCreationContext(pa.owner.view.resourceController.scheduler,(Ba,Ia)=>this._updateQueue.push(Ba,Ia))}initialize(){this._featureStore=
new ia.Graphics3DFeatureStore({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:Ia=>this.graphics3DGraphics.forEach(Ia)});const pa=(Ia,Wa,gb)=>this.spatialIndex.queryGraphicUIDsInExtent(Ia,Wa,gb),{componentFactories:Ba}=this;this._elevationAlignment=Ba.elevationAlignment?.(this,pa);this._scaleVisibility=Ba.scaleVisibility?.(this,
pa);this._filterVisibility=Ba.filterVisibility?.({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:Ia=>this.modifyGraphics3DGraphicVisibilities(Wa=>Wa.setVisibilityFlag(ea.VisibilityGroup.GRAPHIC,ea.VisibilityFlag.FILTER,Ia(Q.getObjectId(Wa.graphic,this._objectIdField)))),setAllFeaturesVisibility:Ia=>this.modifyGraphics3DGraphicVisibilities(Wa=>Wa.setVisibilityFlag(ea.VisibilityGroup.GRAPHIC,ea.VisibilityFlag.FILTER,Ia)),clearFeaturesVisibility:()=>
this.modifyGraphics3DGraphicVisibilities(Ia=>Ia.setVisibilityFlag(ea.VisibilityGroup.GRAPHIC,ea.VisibilityFlag.FILTER,!0))});this._deconflictor=Ba.deconflictor?.(this);this._labeler=Ba.labeler?.(this,this._scaleVisibility);this._objectStates=Ba.objectStates?.(this);this._initializeAbortController=new AbortController;this._initializePromise=this._initializeAsync()}async _initializeAsync(){const pa=this._initializeAbortController?.signal,Ba=this.owner.view;this._viewElevationProvider=new ca.ViewElevationProvider(this._viewSpatialReference,
Ba);this._initializeStage(Ba,this.layer.uid);var Ia=Ba.sharedSymbolResources;this.symbolCreationContext.sharedResources=Ia;this._sharedSymbolResourcesOwnerHandle=Ia.addGraphicsOwner(this.owner);null!=this.currentRenderer&&(this.symbolCreationContext.renderer=this.currentRenderer);this.symbolCreationContext.stage=this.stage;this.symbolCreationContext.streamDataRequester=Ia.streamDataRequester;this.symbolCreationContext.renderCoordsHelper=Ba.renderCoordsHelper;this.symbolCreationContext.layer=this.layer;
this.symbolCreationContext.graphicsCoreOwner=this.owner;this.symbolCreationContext.localOriginFactory=new Pa.GridLocalOriginFactory(Ba.renderSpatialReference);this.symbolCreationContext.elevationProvider=Ba.elevationProvider;this.symbolCreationContext.notifyGraphicGeometryChanged=Wa=>this.notifyGraphicGeometryChanged(Wa);this.symbolCreationContext.notifyGraphicVisibilityChanged=Wa=>this.notifyGraphicVisibilityChanged(Wa);Ia=da.extractExpressionInfo(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);
this.symbolCreationContext.featureExpressionInfoContext=await da.createContext(Ia,this._viewSpatialReference,pa,t.getLogger(this));B.throwIfAborted(pa);this.symbolCreationContext.screenSizePerspectiveEnabled=Ba.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled;this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled;this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled;this.symbolCreationContext.skipHighSymbolLods=
!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods;if("drapeSourceType"in this.owner){const {owner:Wa}=this;this.symbolCreationContext.drapeSourceRenderer=Ba.basemapTerrain.overlayManager.registerGeometryDrapeSource(Wa);this.addHandles(u.makeHandle(()=>Ba.basemapTerrain.overlayManager.unregisterDrapeSource(Wa)))}this.addHandles([C.watch(()=>this.suspendedOrOutsideOfView,()=>this._updateQueue.unshift(()=>this._updateLayerVisibility(),null).catch(B.ignoreAbortErrors)),C.watch(()=>[this.layer?.screenSizePerspectiveEnabled,
this.owner.view?.screenSizePerspectiveEnabled],()=>{const Wa=Ba.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled;Wa!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=Wa,this._labeler?.reset(),this.recreateAllGraphicsAndSymbols())}),C.watch(()=>this.owner.slicePlaneEnabled,Wa=>this._slicePlaneEnabledChange(!!Wa)),C.watch(()=>this.owner.view.state?.rasterPixelRatio,()=>this._pixelRatioChange()),C.watch(()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,
Wa=>this._physicalBasedRenderingChange(Wa)),C.watch(()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,Wa=>this._skipHighSymbolLoDsChange(Wa)),C.when(()=>Ba.basemapTerrain?.tilingScheme,Wa=>{Wa.spatialReference.equals(this.symbolCreationContext.overlaySR)||null==Ba.basemapTerrain.spatialReference||(this.symbolCreationContext.overlaySR=Ba.basemapTerrain.spatialReference);this.hasHandles("loaded-graphics")?this.recreateAllGraphics():this.addHandles([C.on(()=>this.owner?.loadedGraphics,
"change",gb=>{this._graphicsCollectionChanged(gb);this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics();this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],"loaded-graphics")},{initial:!0}),C.watch(()=>this.effectiveUpdatePolicy,Wa=>{null!=this.stageLayer&&(this.stageLayer.updatePolicy=Wa);this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===Qa.UpdatePolicy.ASYNC;Wa===Qa.UpdatePolicy.SYNC&&this.runTask(Ua.noBudget)},C.syncAndInitial)]);
this._frameTaskHandle=Ba.resourceController.scheduler.registerTask(Ua.TaskPriority.GRAPHICS_CORE,this);this.layer&&"featureReduction"in this.layer&&this.addHandles(C.watch(()=>this.layer.featureReduction,()=>this._deconflictor?.featureReductionChange()));this.notifyChange("averageSymbolComplexity");this.rendererChange(this.owner.renderer).catch(()=>{});this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController&&(this._initializeAbortController.abort(),this._initializeAbortController=
null)}destroy(){this._unusedSymbolsCache.destroy();this._abortInitialize();this._abortRendererChange();this._abortElevationInfoChange();this._frameTaskHandle.remove();this._frameTaskHandle=Ua.ImmediateTask;this._dataUpdateQueue.cancelAll();this._updateQueue.cancelAll();this._deconflictor=y.removeMaybe(this._deconflictor);this._labeler=y.removeMaybe(this._labeler);this._elevationAlignment=y.destroyMaybe(this._elevationAlignment);this._scaleVisibility=y.destroyMaybe(this._scaleVisibility);this._filterVisibility=
y.destroyMaybe(this._filterVisibility);this._objectStates=y.destroyMaybe(this._objectStates);this.clear();this._featureStore=y.destroyMaybe(this._featureStore);this._updatingPendingLoadedGraphicsChange=y.removeMaybe(this._updatingPendingLoadedGraphicsChange);this._graphicStateTracking=y.destroyMaybe(this._graphicStateTracking);this.stage&&(this.stageLayer=y.destroyMaybe(this.stageLayer),this.stage=null);this._set("owner",null);for(const pa in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[pa].reject(new n("graphic:layer-destroyed",
"Layer has been destroyed"));this._whenGraphics3DGraphicRequests=null;this._sharedSymbolResourcesOwnerHandle=y.removeMaybe(this._sharedSymbolResourcesOwnerHandle);this._propertiesPool=y.destroyMaybe(this._propertiesPool);this._pendingUpdatesPool=null;this._symbolConversionCache.clear();this._objectIdInvisibleSet.clear();this._spatialIndex=y.destroyMaybe(this._spatialIndex)}clear(){this._objectStates?.allGraphicsDeleted();null!=this._graphicStateTracking&&this._graphicStateTracking.allGraphicsDeleted();
this.graphics3DGraphics.forEach(pa=>pa.destroy());this._spatialIndex?.clear();this.graphics3DGraphics.clear();this._usedMemory=this._numberOfGraphics=0;this._updateLayerVisibility();this._symbols.forEach(y.destroyMaybe);this._symbols.clear();this._symbolMaterials=null;this._graphicsBySymbol.clear();this._graphicsWithoutSymbol.clear();this._graphicsWaitingForSymbol.clear();this._pendingUpdates.clear();this._pendingUpdatesPool.clear();this._pendingRemoves=this._pendingAdds=0;this._applyPendingRemovesFirst=
!1;this.notifyChange("dataUpdating");this.notifyChange("running");this.notifyChange("updatingRemaining");this._featureStore.events.emit("changed")}_initializeStage(pa,Ba){this.stage=pa._stage;this.stageLayer=new ua.WebGLLayer(this.stage,{pickable:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},Ba);pa=this.stageLayer.events;pa.on("transformationChanged",Ia=>this.notifyGraphicGeometryChanged(Ia.graphicUid));pa.on("shaderTransformationChanged",Ia=>this.notifyGraphicGeometryChanged(Ia.graphicUid));
pa.on("visibilityChanged",Ia=>this.notifyGraphicVisibilityChanged(Ia.graphicUid));pa.on("geometryAdded",Ia=>this.notifyGraphicGeometryChanged(Ia.object.graphicUid));pa.on("geometryRemoved",Ia=>this.notifyGraphicGeometryChanged(Ia.object.graphicUid));pa.on("attributesChanged",Ia=>Ea.affectsGeometry(Ia.attribute)&&this.notifyGraphicGeometryChanged(Ia.object.graphicUid))}notifyGraphicGeometryChanged(pa){null!=this._graphicStateTracking&&null!=pa&&(pa=this.graphics3DGraphics.get(pa))&&this._graphicStateTracking.updateGraphicGeometry(pa)}notifyGraphicVisibilityChanged(pa){null!=
this._graphicStateTracking&&null!=pa&&(pa=this.graphics3DGraphics.get(pa))&&this._graphicStateTracking.updateGraphicVisibility(pa)}_updateLayerVisibility(){var pa=this._numberOfGraphics>10*this.displayFeatureLimit.maximumNumberOfFeatures;pa=!this.suspendedOrOutsideOfView&&!pa;pa!==this._visible&&((this._visible=pa)?(this.stageLayer.pickable=!0,this.updateAllGraphicsVisibility()):(this.stageLayer.pickable=!1,this._hideAllGraphics()),this._updateStageLayerVisibility())}_updateStageLayerVisibility(){this.stageLayer.visible=
this._visible&&(null==this.layer.opacity||0<this.layer.opacity)}getGraphics3DGraphicById(pa){return null!=pa?this.graphics3DGraphics.get(pa):void 0}getGraphics3DGraphicByObjectId(pa){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(pa):null}_getGraphicObjectID(pa,Ba=this.owner.layer?.objectIdField){return Q.getObjectId(pa,Ba)}get graphics3DGraphicsByObjectID(){const pa=this.owner.layer?.objectIdField;if(pa){var Ba=new Map;this.graphics3DGraphics.forEach(Ia=>{if(Ia){var Wa=
this._getGraphicObjectID(Ia.graphic,pa);null!=Wa&&Ba.set(Wa,Ia)}});return Ba}}get labelsEnabled(){return!!this._labeler?.layerLabelsEnabled()}async updateLabelingInfo(pa){const Ba=this._deconflictor?.labelingInfoChange(pa);pa=this._labeler?.labelingInfoChange(pa);await Promise.allSettled([Ba,pa])}updateVisibilityInfo(){this._deconflictor?.labelingInfoChange();this._labeler?.visibilityInfoChange()}get symbolUpdateType(){if(0<this._pendingUpdates.size)return"unknown";let pa=0,Ba=0;return x.someMap(this._symbols,
(Ia,Wa)=>{if(null!=Ia){Ia=Ia.getFastUpdateStatus();if(0<Ia.loading)return!0;this._graphicsBySymbol.has(Wa)&&(Ba+=Ia.fast,pa+=Ia.slow)}return!1})?"unknown":0<=Ba&&0===pa?"fast":0<=pa&&0===Ba?"slow":"mixed"}runTask(pa){this._dataUpdateQueue.runTask(pa);this._updateQueue.runTask(pa);this._applyPendingUpdates(pa);this.notifyChange("running");this.running||this.notifyChange("dataUpdating");this.notifyChange("updatingRemaining");if(!pa.hasProgressed)return wa.Yield}setObjectIdVisibility(pa,Ba){Ba?this._objectIdInvisibleSet.delete(pa):
this._objectIdInvisibleSet.add(pa);pa=this._findGraphics3DGraphicByObjectId(pa);null!=pa&&this._updateUserVisibility(pa)}_findGraphics3DGraphicByObjectId(pa){return x.findInMap(this.graphics3DGraphics,Ba=>this._getGraphicObjectID(Ba.graphic)===pa)}_updateUserVisibility(pa){if(null==pa)return!1;var Ba=pa.graphic;const Ia=this._getGraphicObjectID(Ba);Ba=Ba.visible&&!this.owner.suspended&&(null==Ia||!this._objectIdInvisibleSet.has(Ia));return pa.setVisibilityFlag(ea.VisibilityGroup.GRAPHIC,ea.VisibilityFlag.USER,
Ba)}_whenGraphics3DGraphic(pa){var Ba=this.graphics3DGraphics.get(pa.uid);if(Ba)return Promise.resolve(Ba);if(Ba=this._whenGraphics3DGraphicRequests[pa.uid])return Ba.promise;Ba=B.createResolver();this._whenGraphics3DGraphicRequests[pa.uid]=Ba;return Ba.promise}async _boundsForGraphics3DGraphic(pa,Ba){const Ia=this._viewSpatialReference,Wa=this.owner.view.renderSpatialReference,gb=this.owner.view.basemapTerrain.spatialReference;pa=await pa.getProjectedBoundingBox((La,Xa,eb)=>O.projectBuffer(La,Wa,
Xa,La,Ia,Xa,eb),(La,Xa,eb)=>O.projectBuffer(La,gb,Xa,La,Ia,Xa,eb),this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:null!=Ba?!!Ba.useViewElevation:!1,minDemResolution:null!=Ba?Ba.minDemResolution:null,minDemResolutionForPoints:this.owner.view.resolution}:null,Ba?.signal);if(!pa)return null;Ba=pa.boundingBox;if(pa.requiresDrapedElevation){var ib=this.symbolCreationContext.elevationProvider;ib&&(M.center(Ba,qa),ib=ib.getElevation(qa[0],qa[1],0,Ia,"ground")??0,Ba[2]=Math.min(Ba[2],
ib),Ba[5]=Math.max(Ba[5],ib))}return{boundingBox:Ba,screenSpaceObjects:pa.screenSpaceObjects}}async whenGraphicBounds(pa,Ba){await C.whenOnce(()=>this.owner?.loadedGraphics);const Ia=this.owner.layer?.objectIdField;var Wa=this.owner.loadedGraphics.find(gb=>gb===pa?!0:null!=Ia&&null!=gb.attributes&&pa.attributes&&gb.attributes[Ia]===pa.attributes[Ia]);if(!Wa)throw new n("internal:graphic-not-part-of-view","Graphic is not part of this view");Wa=await this._whenGraphics3DGraphic(Wa);return this._boundsForGraphics3DGraphic(Wa,
Ba)}computeAttachmentOrigin(pa,Ba){pa=this.graphics3DGraphics.get(pa.uid);if(!pa)return null;var Ia=pa.computeAttachmentOrigin();if(0===Ia.render.num&&0===Ia.draped.num)return null;E.set(Ra,0,0,0);pa=0;if(0<Ia.render.num){if(!L.projectVectorToVector(Ia.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,$a,Ba))return null;E.add(Ra,Ra,$a);pa++}if(0<Ia.draped.num){const [Wa,gb]=Ia.draped.origin;Ia=this._viewElevationProvider.getElevation(Wa,gb,"ground")??0;E.set($a,Wa,gb,Ia);
if(!L.projectVectorToVector($a,this._viewElevationProvider.spatialReference,$a,Ba))return null;E.add(Ra,Ra,$a);pa++}1<pa&&E.scale(Ra,Ra,1/pa);return new Ha({x:Ra[0],y:Ra[1],z:Ra[2],spatialReference:Ba})}getSymbolLayerSize(pa,Ba){var Ia=this._symbols.get(pa.id);if(null==Ia)throw new n("internal:symbol-not-part-of-view","Symbol is not part of this view");pa=pa.symbolLayers.indexOf(Ba);if(-1===pa)throw new n("internal:missing-symbol-layer","Symbol layer is not in symbol");Ia=Ia.getSymbolLayerSize(pa);
if(null==Ia)throw new n("internal:missing-size","Symbol layer has no valid size");return Ia}_graphicsCollectionChanged(pa){this._startCreateGraphics&&(this.add(pa.added),this.remove(pa.removed))}graphicUpdateHandler(pa){const Ba=pa.graphic.uid,Ia=this.graphics3DGraphics.get(Ba);if(null!=Ia||null!=this._graphicsWithoutSymbol.get(Ba))switch(pa.property){case "visible":this._graphicUpdateVisibleHandler(Ia);break;case "geometry":this._graphicUpdateGeometryHandler(Ia,pa);break;case "symbol":this._graphicUpdateSymbolHandler(Ia,
pa);break;case "origin-transform":this._graphicUpdateTransformHandler(Ia,pa)}}_graphicUpdateGeometryHandler(pa,Ba){this._graphicUpdateGeometryOrTransformHandler(pa,Ba,()=>null!=Ba.newValue&&null!=pa&&pa.graphics3DSymbol.updateGeometry(pa,Ba.newValue)&&(this._labeler?.updateGraphicGeometry(pa)??!0)?(this._labeler?.setDirty(),!0):!1);const Ia=Ba.graphic.geometry;null!=Ia&&this._expandComputedExtent(Ia)}_graphicUpdateTransformHandler(pa,Ba){const Ia=Ba.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(pa,
Ba,()=>null!=Ba.newValue&&null!=pa&&null!=Ia&&pa.graphics3DSymbol.updateTransform(pa,Ia.spatialReference,Ba.newValue,Ba.action))}_graphicUpdateGeometryOrTransformHandler(pa,Ba,Ia){if(null==Ba.graphic.geometry)this._recreateGraphic(Ba.graphic);else if(null==pa){if(pa=Ba.graphic.symbol?.id)if(pa=this._symbols.get(pa),null!=pa&&pa.loadStatus===ya.LoadStatus.LOADING)return;this._recreateGraphic(Ba.graphic)}else Ia()||this._recreateGraphic(pa.graphic)}_graphicUpdateSymbolHandler(pa,Ba){var Ia=Ba.graphic;
const Wa=null!=pa?pa.graphics3DSymbol:null!=Ba.oldValue?this._symbols.get(Ba.oldValue.id):null;if(null==Wa||null==Ba.newValue)this._recreateGraphic(Ia);else{var gb=Wa.symbol;Ba=this._getConvertedSymbol(Ba.newValue);if(null!=Ba&&(Ba.type!==gb.type||"web-style"===Ba.type)||"web-style"===gb.type)this._recreateGraphic(Ia);else{var ib=this._graphicsBySymbol.get(gb.id);if(ib&&1!==ib.size)this._recreateGraphic(Ia);else if(ib=N.diff(gb,Ba),null==ib)this._updateSymbolMapping(gb.id,Ba);else if(ib={diff:ib,
graphics3DGraphicPatches:[],symbolStatePatches:[]},Wa.prepareSymbolPatch(ib),N.isEmpty(ib.diff)){var La=this._getRenderingInfo(Ia);if(null==La)this._recreateGraphic(Ia);else{Ia=Wa.extentPadding;for(const Xa of ib.symbolStatePatches)Xa();Ia!==Wa.extentPadding&&this._recomputeExtentPadding();if(null!=pa)for(const Xa of ib.graphics3DGraphicPatches)Xa(pa,La);this._updateSymbolMapping(gb.id,Ba)}}else this._recreateGraphic(Ia)}}}_graphicUpdateVisibleHandler(pa){this._updateUserVisibility(pa)&&(this._labeler?.setDirty(),
this._deconflictor?.setDirty())}recreateGraphics(pa){this._suspendSymbolCleanup=!0;this.remove(pa);this.add(pa);this._suspendSymbolCleanup=!1;this.effectiveUpdatePolicy===Qa.UpdatePolicy.SYNC&&this._cleanupSymbols()}_recreateGraphic(pa){this.recreateGraphics([pa])}_beginGraphicUpdate(pa){const Ba=this._graphicsUpdateId;this._graphicsUpdateId++;this._graphicsWaitingForSymbol.set(pa.uid,Ba);1===this._graphicsWaitingForSymbol.size&&this.notifyChange("dataUpdating");return Ba}_endGraphicUpdate(pa){pa&&
(this._graphicsWaitingForSymbol.delete(pa.uid),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("dataUpdating")))}_recomputeExtentPadding(){let pa=0;this._symbols.forEach(Ba=>{null!=Ba&&(pa=Math.max(pa,Ba.extentPadding))});this._set("extentPadding",pa)}_expandComputedExtent(pa){var Ba=pa.spatialReference;Q.computeAABB(pa,aa);pa=this._viewSpatialReference;var Ia=Ya.tmpVec;!J.equals(Ba,pa)&&P.projectXYZToVector(aa[0],aa[1],0,Ba,Ia,pa)&&(aa[0]=Ia[0],aa[1]=Ia[1],P.projectXYZToVector(aa[3],
aa[4],0,Ba,Ia,pa),aa[3]=Ia[0],aa[4]=Ia[1]);if(isFinite(aa[0])&&isFinite(aa[3])&&isFinite(aa[1])&&isFinite(aa[4])){Ba=this.computedExtent;Ia=null;var Wa=isFinite(aa[2])&&isFinite(aa[5]),gb=Wa&&(null==Ba?.zmin||aa[2]<Ba.zmin);Wa=Wa&&(null==Ba?.zmax||aa[5]>Ba.zmax);if(Ba){if(aa[0]<Ba.xmin||aa[1]<Ba.ymin||aa[3]>Ba.xmax||aa[4]>Ba.ymax||gb||Wa)Ia=this._propertiesPool.get("computedExtent"),Ia.xmin=Math.min(aa[0],Ba.xmin),Ia.ymin=Math.min(aa[1],Ba.ymin),Ia.xmax=Math.max(aa[3],Ba.xmax),Ia.ymax=Math.max(aa[4],
Ba.ymax),Ia.spatialReference=pa}else Ia=this._propertiesPool.get("computedExtent"),Ia.xmin=aa[0],Ia.ymin=aa[1],Ia.xmax=aa[3],Ia.ymax=aa[4],Ia.spatialReference=pa;Ia&&(gb&&(Ia.zmin=aa[2]),Wa&&(Ia.zmax=aa[5]),this._set("computedExtent",Ia))}}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&(this._elevationInfoChangeAbortController.abort(),this._elevationInfoChangeAbortController=null)}async elevationInfoChange(){this._abortElevationInfoChange();const pa=new AbortController;this._elevationInfoChangeAbortController=
pa;const Ba=da.extractExpressionInfo(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await da.createContext(Ba,this._viewSpatialReference,pa.signal,t.getLogger(this));B.throwIfAborted(pa.signal);this._elevationInfoChangeAbortController=null;this._labeler?.elevationInfoChange();this.forEachGraphics3DSymbol((Ia,Wa,gb)=>{Ia.globalPropertyChanged("elevationInfo",Wa)?Wa.forEach(ib=>{const La=ib.graphic;ib=ib.labelLayers;for(const Xa of ib)Xa.graphics3DSymbolLayer.updateGraphicElevationContext(La,
Xa)}):this._recreateSymbol(gb)});this.updateStageLayerElevationProvider();this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){if(this._stageLayerElevationProvider){if(this.layer.elevationInfo&&"relative-to-scene"===this.layer.elevationInfo.mode||0===this._numberOfGraphicsProvidingElevation)this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=y.disposeMaybe(this._stageLayerElevationProvider)}else(!this.layer.elevationInfo||
this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&0<this._numberOfGraphicsProvidingElevation&&(this._stageLayerElevationProvider=new xa.StageLayerElevationProvider({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register("scene",this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear();null!=this._filterVisibility&&this._filterVisibility.clear();this._labeler?.reset();this._deconflictor?.clear();
this._elevationAlignment?.clear();this.stageLayer?.invalidateSpatialQueryAccelerator();this._stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=y.disposeMaybe(this._stageLayerElevationProvider))}startCreateGraphics(){this._startCreateGraphics=!0;this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(pa=
!1){if(this._startCreateGraphics){var {loadedGraphics:Ba,view:Ia}=this.owner,Wa=Ia.basemapTerrain.tilingScheme&&Ba?.length?Ba.toArray():null;!pa&&Wa||this._clearSymbolsAndGraphics();this.symbolCreationContext.screenSizePerspectiveEnabled=this.owner.view.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled;this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled;this._set("computedExtent",null);Wa&&(pa?this.add(Wa):this.recreateGraphics(Wa))}}_recreateSymbol(pa){var Ba=
this._graphicsBySymbol.get(pa);const Ia=[];Ba&&(Ba.forEach((Wa,gb)=>{const ib=Wa.usedMemory;this._conditionalRemove(Wa,gb);this._spatialIndex?.remove(Wa);Ia.push(Wa.graphic);Wa.destroy();this._removeGraphics3DGraphic(gb,ib);this._updateLayerVisibility();this._featureStore.events.emit("changed")}),this._graphicsBySymbol.set(pa,new Map));Ba=this._symbols.get(pa);y.destroyMaybe(Ba);this._symbols.delete(pa);this._symbolMaterials=null;this.add(Ia)}_recreateGraphicsForSymbol(pa){if(pa=this._graphicsBySymbol.get(pa)){const Ba=
[];pa.forEach(Ia=>Ba.push(Ia.graphic));this.recreateGraphics(Ba)}}_conditionalRemove(pa,Ba){this._graphicsDrapedUids.delete(Ba);this._objectStates?.removeGraphic(pa);this._labeler?.removeGraphic(pa);this._deconflictor?.removeGraphic(pa);null!=this._graphicStateTracking&&this._graphicStateTracking.removeGraphic(pa)}add(pa){pa&&0!==pa.length&&(this.owner.view.basemapTerrain?.tilingScheme?(this._updatePolicyForGraphics(pa)===Qa.UpdatePolicy.ASYNC?this._addDelayed(pa):this._addImmediate(pa),this.notifyChange("dataUpdating")):
t.getLogger(this).error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(pa){if(this.effectiveUpdatePolicy===Qa.UpdatePolicy.SYNC&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const Ba of pa)if(null!=Ba.geometry&&"mesh"===Ba.geometry.type&&!Ba.geometry.loaded)return Qa.UpdatePolicy.ASYNC;return this.effectiveUpdatePolicy}_addImmediate(pa){this._symbolWarningLogged=this._geometryWarningLogged=!1;for(const Ba of pa)this._addGraphic(Ba,
this._getRenderingInfo(Ba,t.getLogger(this)),Qa.UpdatePolicy.SYNC);this._cleanupSymbols();this._labeler?.setDirty();this._deconflictor?.setDirty()}_addDelayed(pa){for(const Ba of pa){pa=Ba.uid;let Ia=this._pendingUpdates.get(pa);Ia?Ia.add?Ia.state!==Ja.NEW&&Ia.abortController?.abort():this._pendingAdds++:(Ia=this._pendingUpdatesPool.pushNew(),this._pendingAdds++,this._pendingUpdates.set(pa,Ia));Ia.add=Ba}this.notifyChange("running");this.notifyChange("updatingRemaining");this.notifyChange("dataUpdating")}remove(pa){this.effectiveUpdatePolicy===
Qa.UpdatePolicy.ASYNC?this._removeDelayed(pa):this._removeImmediate(pa);this.notifyChange("dataUpdating")}_removeImmediate(pa){for(const Ba of pa)this._removeGraphic(Ba);this._cleanupSymbols();this._labeler?.setDirty();this._deconflictor?.setDirty()}_removeDelayed(pa){for(const Ia of pa){pa=Ia.uid;var Ba=this._pendingUpdates.get(pa);Ba?Ba.add&&(Ba.remove?Ba.add=null:this._pendingUpdates.delete(pa),Ba.state===Ja.LOADING&&Ba.abortController?.abort(),this._pendingAdds--):(Ba=this._pendingUpdatesPool.pushNew(),
Ba.remove=Ia,this._pendingUpdates.set(pa,Ba),this._pendingRemoves++,this._applyPendingRemovesFirst=!0)}0===this._pendingUpdates.size&&this._finishPendingUpdates();this.notifyChange("running");this.notifyChange("updatingRemaining");this.notifyChange("dataUpdating")}_finishPendingUpdates(){this._pendingUpdatesPool.clear();this._cleanupSymbols();(this._pendingAdds||this._pendingRemoves)&&t.getLogger(this).warn("pendingAdds/Removes in inconsistent state!");this._pendingRemoves=this._pendingAdds=0;this._applyPendingRemovesFirst=
!1}_applyPendingUpdates(pa){this._symbolWarningLogged=this._geometryWarningLogged=!1;if(0===this._pendingUpdates.size&&this._spatialIndex?.updating)this._spatialIndex.update(),pa.madeProgress();else{if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(const [Ba,Ia]of this._pendingUpdates){if(pa.done){this._applyPendingRemovesFirst=!0;break}if(Ia.remove&&!Ia.add&&(this._pendingRemoves--,pa.madeProgress(),this._removeGraphic(Ia.remove),Ia.remove=null,this._pendingUpdates.delete(Ba),
0===this._pendingRemoves))break}}for(const [Ba,Ia]of this._pendingUpdates){if(pa.done)break;Ia.add&&Ia.state===Ja.NEW&&this._processPendingUpdateNew(Ia);let Wa=this.effectiveUpdatePolicy;!Ia.remove||Ia.add&&Ia.state!==Ja.READY||(this._pendingRemoves--,pa.madeProgress(),this._removeGraphic(Ia.remove),Ia.remove=null,Wa=Qa.UpdatePolicy.SYNC);if(Ia.add)switch(Ia.state){case Ja.READY:this._addGraphic(Ia.add,Ia.renderingInfo,Wa);Ia.add=null;this._pendingAdds--;pa.madeProgress();break;case Ja.REJECTED:Ia.add=
null,this._pendingAdds--}null==Ia.remove&&null==Ia.add&&this._pendingUpdates.delete(Ba)}0===this._pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("running"),this.notifyChange("dataUpdating"))}}_processPendingUpdateNew(pa){if(pa.add){var Ba=pa.add.geometry;null==Ba||"mesh"!==Ba.type||Ba.loaded?this._processPendingUpdateNewRenderingInfo(pa):this._processPendingUpdateNewMesh(pa,Ba)}else pa.state=Ja.READY}async _processPendingUpdateNewMesh(pa,Ba){pa.state=Ja.LOADING;pa.abortController=
new AbortController;const Ia=pa.abortController.signal;try{await Ba.load({signal:Ia})}catch(Wa){return this._processPendingUpdateNewError(pa,Wa)}pa.abortController=null;this._processPendingUpdateNewRenderingInfo(pa)}_processPendingUpdateNewError(pa,Ba){pa.abortController=null;B.isAbortError(Ba)?pa.state=Ja.NEW:pa.state=Ja.REJECTED}async _processPendingUpdateNewRenderingInfo(pa){if(null==this.layer.renderer||"dictionary"!==this.layer.renderer.type)pa.renderingInfo=this._getRenderingInfo(pa.add,t.getLogger(this));
else{pa.state=Ja.LOADING;pa.abortController=new AbortController;var Ba=null;try{Ba=await this._getRenderingInfoAsync(pa.add,{signal:pa.abortController.signal})}catch(Ia){pa.abortController=null;B.isAbortError(Ia)?pa.state=Ja.NEW:pa.state=Ja.REJECTED;return}null==Ba?.symbol?(this._symbolWarningLogged||(this._symbolWarningLogged=!0,t.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),pa.renderingInfo=null):pa.renderingInfo=Ba}pa.state=Ja.READY}_addGraphic(pa,
Ba,Ia){this._graphicsWithoutSymbol.set(pa.uid,pa);if(null!=Ba?.symbol&&Q.hasGeometry(pa)){if(null!=this.stage.renderView.objectAndLayerIdRenderHelper&&this.setUidToIdOnAdd){const jb=Y.isBasemapLayer(this.owner.view.map,this.layer.uid);this.stage.renderView.objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(pa.objectId,pa.uid,this.layer.id,this.layer.uid,!!this.layer.popupEnabled&&!jb&&Na.hasPopupTemplate(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}var Wa=this.getOrCreateGraphics3DSymbol(Ba.symbol,
Ba.renderer);if(null!=Wa){this._expandComputedExtent(pa.geometry);var gb=this._beginGraphicUpdate(pa),ib=new ka.Graphics3DGraphicCreationContext(pa,Ba,this.layer),La=!1,Xa=jb=>{jb===Wa.symbol.id&&(La=!0)};this._whenSymbolRemoved.push(Xa);var eb=()=>{--this._loadingSymbols;if(!this.destroyed){this._whenSymbolRemoved.removeUnordered(Xa);if(this._graphicsWaitingForSymbol.get(pa.uid)!==gb||La||Wa.destroyed||this.graphicSymbolSupported&&pa.symbol&&pa.symbol.id!==Wa.symbol.id)--Wa.referenced,this._cleanupSymbols();
else{const jb=this._createGraphics3DGraphic(Wa,ib);this._spatialIndex&&null!=jb&&this._spatialIndex.add(jb);--Wa.referenced;this._endGraphicUpdate(pa)}this._featureStore.events.emit("changed");this._labeler?.setDirty()}},db=jb=>{--this._loadingSymbols;this.destroyed||(this._whenSymbolRemoved.removeUnordered(Xa),La||(B.isAbortError(jb)?this.add([pa]):Wa.destroyed||this._endGraphicUpdate(pa)))};++this._loadingSymbols;Ia===Qa.UpdatePolicy.ASYNC?Wa.load(()=>this._dataUpdateQueue.push(eb,null).catch(B.ignoreAbortErrors),
jb=>this._dataUpdateQueue.push(()=>db(jb),null).catch(B.ignoreAbortErrors)):Wa.load(eb,db)}}}_removeGraphic(pa){pa=pa.uid;const Ba=this.graphics3DGraphics.get(pa);if(Ba){Ba.graphics3DSymbol.onRemoveGraphic(Ba);const Ia=Ba.usedMemory,Wa=Ba.isElevationSource;this._conditionalRemove(Ba,pa);this._spatialIndex?.remove(Ba);this._graphicsBySymbol.get(Ba.graphics3DSymbol.symbol.id)?.delete(pa);this._graphicsWithoutSymbol.delete(pa);this._removeGraphics3DGraphic(pa,Ia,Wa);Ba.destroy();this._featureStore.events.emit("changed")}else this._graphicsWithoutSymbol.delete(pa),
this._graphicsWaitingForSymbol.delete(pa),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("dataUpdating"))}_hasLabelingContext(pa){if(pa instanceof Ka||pa instanceof Aa){const Ba=this.symbolCreationContext.layer;return Ba.labelingInfo?Ba.labelingInfo.some(Ia=>Ia.symbol===pa):!1}return!1}_hasValidSymbolCreationContext(pa){return pa instanceof Ka&&!this._hasLabelingContext(pa)?(t.getLogger(this).error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),
!1):!0}_getRenderingInfo(pa,Ba){const Ia=pa.geometry;if(null==Ia)return Ba&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,Ba.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!I.canProjectWithoutEngine(Ia.spatialReference,this._viewSpatialReference))return Ba&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,Ba.warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&
null!=pa.symbol)return Ba&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,Ba.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;pa=this.rendererHasGeometryOperations?W.hydrateGraphic(pa,this.layer):pa;pa=this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||null!=this.currentRenderer)?this.owner.getRenderingInfo(pa,this.currentRenderer,this._arcadeOnDemand):{symbol:pa.symbol||ha.getDefaultSymbol3D(pa.geometry)};return null==
pa?.symbol?(Ba&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,Ba.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):pa}_getRenderingInfoAsync(pa,Ba){if(null==pa.geometry)return this._geometryWarningLogged||(this._geometryWarningLogged=!0,t.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&null!=pa.symbol)return this._symbolWarningLogged||(this._symbolWarningLogged=!0,t.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),
null;pa=this.rendererHasGeometryOperations?W.hydrateGraphic(pa,this.layer):pa;return this.owner.getRenderingInfoAsync(pa,this.currentRenderer,this._arcadeOnDemand,Ba)}_createGraphics3DSymbol(pa,Ba){if(!this._hasValidSymbolCreationContext(pa))return null;pa=this._getConvertedSymbol(pa);if(!pa)return null;let Ia;null!=Ba&&"backgroundFillSymbol"in Ba&&Ba.backgroundFillSymbol&&(Ba=ba.to3D(Ba.backgroundFillSymbol,{ignoreDrivers:!0}),null!=Ba.symbol&&(Ia=Ba.symbol.symbolLayers));const Wa=X.make(pa,this.symbolCreationContext,
Ia);Wa.load(()=>{const gb=Wa.extentPadding;gb>this.extentPadding&&this._set("extentPadding",gb);this.notifyChange("averageSymbolComplexity")},()=>{});return Wa}getOrCreateGraphics3DSymbol(pa,Ba){var Ia=this._symbols.get(pa.id);void 0===Ia&&(Ia=this._unusedSymbolsCache.pop(pa.id),Ia=null!=Ia?Ia:pa instanceof Sa?new ja.Graphics3DWebStyleSymbol(pa,Wa=>this._dataUpdateQueue.push(Wa,null),Wa=>this._createGraphics3DSymbol(Wa,Ba)):this._createGraphics3DSymbol(pa,Ba),this._symbols.set(pa.id,Ia),this._symbolMaterials=
null);null!=Ia&&++Ia.referenced;return Ia}trackGraphicState(pa){null==this._graphicStateTracking&&(this._graphicStateTracking=new na.GraphicStateTracking(this));return this._graphicStateTracking.add(pa)}_addGraphics3DGraphic(pa){this._usedMemory+=pa.usedMemory;this.graphics3DGraphics.set(pa.graphic.uid,pa);this._numberOfGraphics++;pa.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider());this._updateLayerVisibility()}_removeGraphics3DGraphic(pa,Ba,
Ia=!1){this._usedMemory-=Ba;this.graphics3DGraphics.delete(pa);this._numberOfGraphics--;Ia&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider());this._updateLayerVisibility()}_createGraphics3DGraphic(pa,Ba){const Ia=Ba.graphic;this._graphicsWithoutSymbol.delete(Ia.uid);if(!this._symbols.has(pa.symbol.id))return this.add([Ia]),null;if(this.graphics3DGraphics.has(Ia.uid))return null;Ba=pa.createGraphics3DGraphic(Ba);if(null==Ba)return null;this._addGraphics3DGraphic(Ba);
pa=pa.symbol.id;this._graphicsBySymbol.has(pa)||this._graphicsBySymbol.set(pa,new Map);this._graphicsBySymbol.get(pa).set(Ia.uid,Ba);Ba.isDraped&&this._graphicsDrapedUids.add(Ia.uid);Ba.centroid=null;null!=Ia.geometry&&"point"!==Ia.geometry.type&&(Ba.centroid=va.computeCentroid(Ia.geometry,this._viewSpatialReference));this._updateUserVisibility(Ba);null!=this._scaleVisibility&&this._scaleVisibility.updateVisibility(Ba);null!=this._filterVisibility&&({defaultVisibility:pa}=this._filterVisibility,Ba.setVisibilityFlag(ea.VisibilityGroup.GRAPHIC,
ea.VisibilityFlag.FILTER,pa),pa||this._filterVisibility.reapply());this._deconflictor?.addGraphic(Ba);this._labeler?.addGraphic(Ba);this._objectStates?.addGraphic(Ba);Ba.initialize(this.stageLayer,this.owner);null!=this._graphicStateTracking&&this._graphicStateTracking.addGraphic(Ba);if(pa=this._whenGraphics3DGraphicRequests[Ia.uid])delete this._whenGraphics3DGraphicRequests[Ia.uid],pa.resolve(Ba);this._symbolMaterials=null;return Ba}_abortRendererChange(){this._rendererChangeAbortController&&(this._rendererChangeAbortController.abort(),
this._rendererChangeAbortController=null)}async rendererChange(pa){this._abortRendererChange();if(pa!==this.currentRenderer)if(this._validateRenderer(pa),null==pa&&this._currentRendererChange(null,!1),V.isSupportedRenderer3D(pa))if(pa?.arcadeRequired){var Ba=new AbortController;this._rendererChangeAbortController=Ba;const {arcadeUtils:Ia}=await this._ensureArcade();B.throwIfAborted(Ba);const Wa=Ia.hasGeometryOperations(pa);Wa&&(await Ia.enableGeometryOperations(),B.throwIfAborted(Ba));this.effectiveUpdatePolicy===
Qa.UpdatePolicy.ASYNC?await this._updateQueue.push(()=>this._currentRendererChange(pa,Wa),Ba.signal):this._currentRendererChange(pa,Wa);this._rendererChangeAbortController=null}else this.effectiveUpdatePolicy===Qa.UpdatePolicy.ASYNC?(this._rendererChangeAbortController=Ba=new AbortController,await this._updateQueue.push(()=>this._currentRendererChange(pa,!1),Ba.signal),this._rendererChangeAbortController=null):this._currentRendererChange(pa,!1);else this._currentRendererChange(pa,!1)}async _ensureArcade(){null==
this._arcadeOnDemand&&(this._arcadeOnDemand=await T.loadArcade());return this._arcadeOnDemand}_currentRendererChange(pa,Ba){this.currentRenderer=pa;this.rendererHasGeometryOperations=Ba;this.symbolCreationContext.arcade=this._arcadeOnDemand;Ba=this.symbolCreationContext.renderer;if(pa!==Ba)if(this._symbolConversionCache.clear(),this._unusedSymbolsCache.clear(),null==pa)this.symbolCreationContext.renderer=null,this.recreateAllGraphicsAndSymbols();else{var Ia=N.diff(Ba,pa);this._updateUnchangedSymbolMappings(Ia,
pa,Ba);this.symbolCreationContext.renderer=pa;null!=Ia&&("complete"===Ia.type?this.recreateAllGraphicsAndSymbols():"partial"===Ia.type&&(this._applyRendererDiff(Ia,pa,Ba)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}}_diffHasSymbolChange(pa){for(const Ba in pa.diff)switch(Ba){case "visualVariables":case "defaultSymbol":case "uniqueValueInfos":break;case "uniqueValueGroups":case "authoringInfo":case "fieldDelimiter":delete pa.diff[Ba];break;
default:return!0}return!1}_applySymbolSetDiff(pa,Ba,Ia){pa=pa||[];Ba=Ba||[];const Wa=[];for(const gb of Ba){const ib=this._graphicsBySymbol.get(gb.id);ib&&ib.forEach((La,Xa)=>{var eb=La.graphic,db=this.layer instanceof R?this.layer:null;const jb=this._arcadeOnDemand;if(gb!==Ia.defaultSymbol||Ia.getSymbol(W.hydrateGraphic(eb,db),{arcade:jb})!==Ia.defaultSymbol)db=La.usedMemory,pa.length||Ia.defaultSymbol?Wa.push(eb):this._graphicsWithoutSymbol.set(Xa,eb),eb=this.graphics3DGraphics.get(Xa),this._conditionalRemove(eb,
Xa),La.destroy(),ib.delete(Xa),this._removeGraphics3DGraphic(Xa,db),this._updateLayerVisibility()});this._whenSymbolRemoved.forAll(La=>La(gb.id))}if(pa.length||Wa.length)this._graphicsWithoutSymbol.forEach(gb=>Wa.push(gb)),this._graphicsWithoutSymbol.clear(),this.add(Wa);this._cleanupSymbols();this._labeler?.setDirty();this._deconflictor?.setDirty()}_applyUniqueValueRendererDiff(pa,Ba,Ia){const Wa=pa.diff.defaultSymbol,gb=pa.diff.uniqueValueInfos;if(Wa||gb){const ib=gb?gb.added.map(Xa=>Xa.symbol).filter(m.isSome):
[],La=gb?gb.removed.map(Xa=>Xa.symbol).filter(m.isSome):[];if(gb)for(let Xa=0;Xa<gb.changed.length;Xa++)ib.push(gb.changed[Xa].newValue.symbol),La.push(gb.changed[Xa].oldValue.symbol);Wa?(Ia.defaultSymbol&&La.push(Ia.defaultSymbol),Ba.defaultSymbol&&ib.push(Ba.defaultSymbol)):Ia.defaultSymbol&&ib.length&&La.push(Ba.defaultSymbol);this._applySymbolSetDiff(ib,La,Ba);delete pa.diff.defaultSymbol;delete pa.diff.uniqueValueInfos;return!0}return!1}_calculateUnchangedSymbolMapping(pa,Ba,Ia){if("unique-value"!==
Ba?.type||"unique-value"!==Ia?.type||null!=pa&&"partial"!==pa.type)return[];const Wa=ib=>null!=ib?ib.id:null;var gb=pa&&pa.diff;pa=gb?.defaultSymbol;if(gb=gb&&gb.uniqueValueInfos)gb=gb.unchanged.map(ib=>({oldId:Wa(ib.oldValue.symbol),newId:Wa(ib.newValue.symbol)}));else{gb=[];for(const ib of Ia.uniqueValueInfos??[]){const La=Wa(ib.symbol),Xa=Ba.uniqueValueInfos?.find(eb=>eb.value===ib.value);Xa&&La!==Wa(Xa.symbol)&&gb.push({oldId:La,newId:Wa(Xa.symbol)})}}!pa&&Ia.defaultSymbol&&gb.push({oldId:Wa(Ia.defaultSymbol),
newId:Wa(Ba.defaultSymbol)});return gb}_updateSymbolMapping(pa,Ba){const Ia=null!=Ba&&Ba?"string"===typeof Ba?Ba:Ba.id:null;if(null!=pa&&pa!==Ia){var Wa=this._graphicsBySymbol.get(pa);this._graphicsBySymbol.delete(pa);void 0!==Wa&&this._graphicsBySymbol.set(Ia,Wa);Wa=this._symbols.get(pa);void 0!==Wa&&(this._symbols.delete(pa),this._symbols.set(Ia,Wa),this._symbolMaterials=null,null!=Wa&&(pa="string"===typeof Ba?null:Ba,null!=pa?Wa.symbol=pa:Wa.symbol.id=Ia))}}_updateUnchangedSymbolMappings(pa,Ba,
Ia){pa=this._calculateUnchangedSymbolMapping(pa,Ba,Ia);for(const {oldId:Wa,newId:gb}of pa)this._updateSymbolMapping(Wa,gb)}_applyRendererDiff(pa,Ba,Ia){if(this._diffHasSymbolChange(pa))return!1;if(Ba instanceof g&&Ia instanceof g&&this._applyUniqueValueRendererDiff(pa,Ba,Ia)&&0===Object.keys(pa.diff).length)return!0;for(const [Wa]of this._graphicsBySymbol)if(Ia=this._symbols.get(Wa),null!=Ia)switch(Ia.applyRendererDiff(pa,Ba)){case za.ApplyRendererDiffResult.RecreateSymbol:this._recreateSymbol(Wa);
break;case za.ApplyRendererDiffResult.RecreateGraphics:this._recreateGraphicsForSymbol(Wa)}return!0}opacityChange(){this.forEachGraphics3DSymbol((pa,Ba)=>pa.globalPropertyChanged("opacity",Ba));this._updateStageLayerVisibility()}_slicePlaneEnabledChange(pa){pa!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=pa,this.stageLayer.sliceable=pa,this.forEachGraphics3DSymbol((Ba,Ia)=>Ba.globalPropertyChanged("slicePlaneEnabled",Ia)),this._deconflictor?.slicePlaneEnabledChange(),
this._labeler?.slicePlaneEnabledChange())}_physicalBasedRenderingChange(pa){this.symbolCreationContext.physicalBasedRenderingEnabled=pa;this.forEachGraphics3DSymbol((Ba,Ia,Wa)=>{Ba.globalPropertyChanged("physicalBasedRenderingEnabled",Ia)||this._recreateSymbol(Wa)})}_skipHighSymbolLoDsChange(pa){this.symbolCreationContext.skipHighSymbolLods=pa;this.forEachGraphics3DSymbol((Ba,Ia,Wa)=>{Ba.globalPropertyChanged("skipHighSymbolLods",Ia)||this._recreateSymbol(Wa)})}_pixelRatioChange(){this.forEachGraphics3DSymbol((pa,
Ba,Ia)=>{pa.globalPropertyChanged("pixelRatio",Ba)||this._recreateSymbol(Ia)})}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove();this._updatingPendingLoadedGraphicsChange=D.schedule(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(pa,Ba){const Ia=this.symbolCreationContext.clippingExtent,Wa=K.create();Ma.toBoundingRect(pa,Wa,Ba)?this.symbolCreationContext.clippingExtent=M.fromRect(M.create(),
Wa):this.symbolCreationContext.clippingExtent=null;return!M.equals(this.symbolCreationContext.clippingExtent,Ia)}modifyGraphics3DGraphicVisibilities(pa){if(!this.destroyed){var Ba=!1;this.graphics3DGraphics.forEach(Ia=>{pa(Ia)&&(Ba=!0)});Ba&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}}forEachGraphics3DSymbol(pa){for(const [Ba,Ia]of this._symbols){if(null==Ia)break;const Wa=this._graphicsBySymbol.get(Ba);pa(Ia,Wa||bb,Ba)}}updateAllGraphicsVisibility(){null!=this._filterVisibility&&
this._filterVisibility.reapply();this.modifyGraphics3DGraphicVisibilities(pa=>{const Ba=this._updateUserVisibility(pa);pa=null!=this._scaleVisibility&&this._scaleVisibility.updateVisibility(pa);return Ba||pa})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(pa=>pa.setVisibilityFlag(ea.VisibilityGroup.GRAPHIC,ea.VisibilityFlag.USER,!1))}_validateRenderer(pa){const Ba=()=>`'${this.layer.title?`${this.layer.title}, `:""}id:${this.layer.id}'`;if(pa=V.validateTo3D(pa,{geometryType:this.layer?.geometryType,
logWarning:Ia=>t.getLogger(this).warn(`Symbology conversion for layer ${Ba()}: ${Ia}`)})){const Ia=`Renderer for layer ${Ba} is not supported in a SceneView`;t.getLogger(this).warn(Ia,pa.message)}}_cleanupSymbols(){if(!(0<this._graphicsWaitingForSymbol.size||this._suspendSymbolCleanup)){var pa=!1;this._symbols.forEach((Ba,Ia)=>{if(!(null==Ba||0<Ba.referenced)){var Wa=this._graphicsBySymbol.get(Ia);Wa&&0!==Wa.size||(this._graphicsBySymbol.delete(Ia),this._symbols.delete(Ia),this._symbolMaterials=null,
this._unusedSymbolsCache.put(Ia,Ba,ra.getSymbolMemorySize(Ba),z.MinPriority),pa=!0)}});pa&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}}get test(){}get performanceInfo(){return new la.GraphicsCorePerformanceInfo(this.graphics3DGraphics.size,this._graphicsWithoutSymbol.size,this._pendingUpdates.size)}};a.Graphics3DCore.tmpVec=G.create();b.__decorate([F.property({readOnly:!0})],a.Graphics3DCore.prototype,"computedExtent",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,
"currentRenderer",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"rendererHasGeometryOperations",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_frameTaskHandle",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_dataUpdateQueue",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_updateQueue",void 0);b.__decorate([F.property({readOnly:!0})],a.Graphics3DCore.prototype,"_viewSpatialReference",null);b.__decorate([F.property()],a.Graphics3DCore.prototype,
"_rendererChangeAbortController",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_elevationInfoChangeAbortController",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_initializeAbortController",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_elevationAlignment",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_scaleVisibility",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_filterVisibility",void 0);b.__decorate([F.property()],
a.Graphics3DCore.prototype,"_initializePromise",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_spatialIndex",void 0);b.__decorate([F.property({readOnly:!0})],a.Graphics3DCore.prototype,"extentPadding",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_updatingPendingLoadedGraphicsChange",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_featureStore",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_objectStates",void 0);b.__decorate([F.property()],
a.Graphics3DCore.prototype,"_loadingSymbols",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"preferredUpdatePolicy",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_forcedUpdatePolicy",void 0);b.__decorate([F.property({readOnly:!0})],a.Graphics3DCore.prototype,"effectiveUpdatePolicy",null);b.__decorate([F.property({constructOnly:!0})],a.Graphics3DCore.prototype,"elevationFeatureExpressionEnabled",void 0);b.__decorate([F.property({constructOnly:!0})],a.Graphics3DCore.prototype,
"owner",void 0);b.__decorate([F.property({constructOnly:!0})],a.Graphics3DCore.prototype,"layer",void 0);b.__decorate([F.property({constructOnly:!0})],a.Graphics3DCore.prototype,"graphicSymbolSupported",void 0);b.__decorate([F.property({constructOnly:!0})],a.Graphics3DCore.prototype,"getRenderingInfoWithoutRenderer",void 0);b.__decorate([F.property({constructOnly:!0})],a.Graphics3DCore.prototype,"componentFactories",void 0);b.__decorate([F.property({constructOnly:!0})],a.Graphics3DCore.prototype,
"setUidToIdOnAdd",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"featureStore",null);b.__decorate([F.property()],a.Graphics3DCore.prototype,"initializePromise",null);b.__decorate([F.property()],a.Graphics3DCore.prototype,"scaleVisibility",null);b.__decorate([F.property()],a.Graphics3DCore.prototype,"elevationAlignment",null);b.__decorate([F.property()],a.Graphics3DCore.prototype,"objectStates",null);b.__decorate([F.property()],a.Graphics3DCore.prototype,"filterVisibility",null);b.__decorate([F.property({readOnly:!0})],
a.Graphics3DCore.prototype,"updating",null);b.__decorate([F.property({readOnly:!0})],a.Graphics3DCore.prototype,"dataUpdating",null);b.__decorate([F.property({readOnly:!0})],a.Graphics3DCore.prototype,"running",null);b.__decorate([F.property({readOnly:!0})],a.Graphics3DCore.prototype,"suspendedOrOutsideOfView",null);b.__decorate([F.property({readOnly:!0,dependsOn:[]})],a.Graphics3DCore.prototype,"updatingRemaining",null);b.__decorate([F.property({readOnly:!0})],a.Graphics3DCore.prototype,"displayFeatureLimit",
null);b.__decorate([F.property({readOnly:!0,dependsOn:[]})],a.Graphics3DCore.prototype,"averageSymbolComplexity",null);b.__decorate([F.property({constructOnly:!0})],a.Graphics3DCore.prototype,"hasZ",void 0);b.__decorate([F.property({constructOnly:!0})],a.Graphics3DCore.prototype,"hasM",void 0);b.__decorate([F.property()],a.Graphics3DCore.prototype,"_objectIdField",null);a.Graphics3DCore=Ya=b.__decorate([H.subclass("esri.views.3d.layers.graphics.Graphics3DCore")],a.Graphics3DCore);var Ja;(function(pa){pa[pa.NEW=
0]="NEW";pa[pa.LOADING=1]="LOADING";pa[pa.READY=2]="READY";pa[pa.REJECTED=3]="REJECTED"})(Ja||={});class Ta{constructor(){this.renderingInfo=this.add=null;this.state=Ja.NEW;this.remove=this.abortController=null}clear(){this.renderingInfo=this.add=null;this.state=Ja.NEW;this.remove=this.abortController=null}}const Ra=G.create(),$a=G.create(),bb=new Map;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/renderers/support/rendererConversion":function(){define(["exports","../../core/arrayUtils",
"../../core/has","../../core/Error","../../symbols/support/symbolConversion"],function(a,b,q,l,p){function k(e){return null==e||"simple"===e.type||"unique-value"===e.type||"class-breaks"===e.type||"dictionary"===e.type||"heatmap"===e.type}function h(e,g){if(!g)return null;g=Array.isArray(g)?g:[g];if(0<g.length){const d=g.map(w=>w.details.symbol.type||w.details.symbol.declaredClass).filter(w=>!!w);d.sort();const t=[];d.forEach((w,v)=>{0!==v&&w===d[v-1]||t.push(w)});return new l("renderer-conversion-3d:unsupported-symbols",
`Renderer contains symbols (${t.join(", ")}) which are not supported in 3D`,{renderer:e,symbolErrors:g})}return null}function f(e,g){const d={...p.defaultTo3DOptions,...g,cimFallbackEnabled:!0};g=e.uniqueValueInfos?.map(w=>p.to3D(w.symbol,d).error).filter(b.isSome);const t=p.to3D(e.defaultSymbol,d);t.error&&g?.unshift(t.error);return h(e,g)}function c(e,g){const d={...p.defaultTo3DOptions,...g,cimFallbackEnabled:!0};g=e.classBreakInfos.map(w=>p.to3D(w.symbol,d).error).filter(b.isSome);const t=p.to3D(e.defaultSymbol,
d);t.error&&g.unshift(t.error);return h(e,g)}a.isSupportedRenderer3D=k;a.validateTo3D=function(e,g){if(null==e)return null;if(!k(e))return new l("renderer-conversion-3d:unsupported-renderer",`Unsupported renderer of type '${e.type||e.declaredClass}'`,{renderer:e});switch(e.type){case "simple":return h(e,p.to3D(e.symbol,{...p.defaultTo3DOptions,...g,cimFallbackEnabled:!0}).error);case "unique-value":return f(e,g);case "class-breaks":return c(e,g)}return null};Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DFeatureStore":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/projection ../../../../geometry/support/aaBoundingBox ../../../../layers/graphics/dehydratedFeatures ../../../../layers/graphics/OptimizedFeature ../../../../layers/graphics/OptimizedGeometry ../../../../layers/graphics/data/optimizedFeatureQueryEngineAdapter".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){const m=g.create();a.Graphics3DFeatureStore=class extends q{constructor(n){super(n);this.events=new l;this.objectIdField=this.hasM=this.hasZ=null;this.featureAdapter={getAttribute(u,x){return"graphic"in u?u.graphic.attributes[x]:v.optimizedFeatureQueryEngineAdapter.getAttribute(u,x)},getAttributes(u){return"graphic"in u?u.graphic.attributes:v.optimizedFeatureQueryEngineAdapter.getAttributes(u)},getObjectId:u=>"graphic"in u?d.getObjectId(u.graphic,this.objectIdField)??
void 0:v.optimizedFeatureQueryEngineAdapter.getObjectId(u),getGeometry:u=>"graphic"in u?u.getAsOptimizedGeometry(this.hasZ,this.hasM):v.optimizedFeatureQueryEngineAdapter.getGeometry(u),getCentroid:(u,x)=>{if("graphic"in u){let y=null;null!=u.centroid?y=u.centroid:"point"===u.graphic.geometry.type&&e.projectPoint(u.graphic.geometry,r,this.viewSpatialReference)&&(y=r);u=Array(2+(x.hasZ?1:0)+(x.hasM?1:0));null==y?(u[0]=0,u[1]=0,u[2]=0,u[3]=0):(u[0]=y.x,u[1]=y.y,x.hasZ&&(u[2]=y.hasZ?y.z:0),x.hasM&&(u[x.hasZ?
3:2]=y.hasM?y.m:0));return new w([],u)}return v.optimizedFeatureQueryEngineAdapter.getCentroid(u,x)},cloneWithGeometry:(u,x)=>"graphic"in u?new t.OptimizedFeature(x,this.featureAdapter.getAttributes(u),null,this.featureAdapter.getObjectId(u)):v.optimizedFeatureQueryEngineAdapter.cloneWithGeometry(u,x)}}forEachInBounds(n,u){this.getSpatialIndex().forEachInBounds(n,u)}forEachBounds(n,u){const x=this.getSpatialIndex();for(const y of n)n=this.featureAdapter.getObjectId(y),null!=x.getBounds(n,m)&&u(m)}};
b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"getSpatialIndex",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"forEach",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"hasZ",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"hasM",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"objectIdField",void 0);
b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"viewSpatialReference",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFeatureStore.prototype,"featureSpatialReference",void 0);a.Graphics3DFeatureStore=b.__decorate([c.subclass("esri.views.3d.layers.graphics.Graphics3DFeatureStore")],a.Graphics3DFeatureStore);const r={type:"point",x:0,y:0,hasZ:!1,hasM:!1,spatialReference:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/optimizedFeatureQueryEngineAdapter":function(){define(["exports",
"../centroid","../OptimizedFeature","../OptimizedGeometry"],function(a,b,q,l){a.optimizedFeatureQueryEngineAdapter={getObjectId(p){return p.objectId},getAttributes(p){return p.attributes},getAttribute(p,k){return p.attributes[k]},cloneWithGeometry(p,k){return new q.OptimizedFeature(k,p.attributes,null,p.objectId)},getGeometry(p){return p.geometry},getCentroid(p,k){null==p.centroid&&(p.centroid=b.getCentroidOptimizedGeometry(new l,p.geometry,k.hasZ,k.hasM));return p.centroid}};Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/centroid":function(){define(["exports"],function(a){function b(l,p,k,h,f,c){c=f?c?4:3:c?3:2;let e=k,g=k+c,d=0,t=0,w=k=0,v=0;for(let m=0,r=h-1;m<r;m++,e+=c,g+=c){h=p[e];const n=p[e+1],u=p[e+2],x=p[g],y=p[g+1],z=p[g+2];let A=h*y-x*n;w+=A;d+=(h+x)*A;t+=(n+y)*A;f&&(A=h*z-x*u,k+=(u+z)*A,v+=A);h<l[0]&&(l[0]=h);h>l[1]&&(l[1]=h);n<l[2]&&(l[2]=n);n>l[3]&&(l[3]=n);f&&(u<l[4]&&(l[4]=u),u>l[5]&&(l[5]=u))}0<w&&(w*=-1);0<v&&(v*=-1);if(!w)return null;
l=[d,t,.5*w];f&&(l[3]=k,l[4]=.5*v);return l}function q(l,p,k,h,f){f=h?f?4:3:f?3:2;let c=p,e=p+f,g=0,d=0,t=0,w=0;for(let n=0,u=k-1;n<u;n++,c+=f,e+=f){var v=l[c];const x=l[c+1],y=l[c+2],z=l[e],A=l[e+1],B=l[e+2];if(h){var m=z-v;var r=A-x;const C=B-y;m=Math.sqrt(m*m+r*r+C*C)}else m=z-v,r=A-x,m=Math.sqrt(m*m+r*r);m&&(g+=m,h?(v=[v+.5*(z-v),x+.5*(A-x),y+.5*(B-y)],d+=m*v[0],t+=m*v[1],w+=m*v[2]):(v=[v+.5*(z-v),x+.5*(A-x)],d+=m*v[0],t+=m*v[1]))}return 0<g?h?[d/g,t/g,w/g]:[d/g,t/g]:0<k?h?[l[p],l[p+1],l[p+2]]:
[l[p],l[p+1]]:null}a.getCentroidOptimizedGeometry=function(l,p,k,h){if(!p?.lengths.length)return null;l.lengths.length&&(l.lengths.length=0);l.coords.length&&(l.coords.length=0);const f=l.coords,c=[],e=k?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:g,coords:d}=p;var t=k?h?4:3:h?3:2;
let w=0;for(const v of g){const m=b(e,d,w,v,k,h);m&&c.push(m);w+=v*t}c.sort((v,m)=>{let r=v[2]-m[2];0===r&&k&&(r=v[4]-m[4]);return r});c.length&&(t=6*c[0][2],f[0]=c[0][0]/t,f[1]=c[0][1]/t,k&&(t=6*c[0][4],f[2]=0!==t?c[0][3]/t:0),f[0]<e[0]||f[0]>e[1]||f[1]<e[2]||f[1]>e[3]||k&&(f[2]<e[4]||f[2]>e[5]))&&(f.length=0);if(!f.length)if(p=p.lengths[0]?q(d,0,g[0],k,h):null)f[0]=p[0],f[1]=p[1],k&&2<p.length&&(f[2]=p[2]);else return null;return l};a.lineCentroid=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/layers/graphics/Graphics3DSymbolFactory":function(){define(["exports","./Graphics3DPointSymbol","./Graphics3DSymbol"],function(a,b,q){a.make=function(l,p,k){switch(l.type){case "point-3d":return new b.Graphics3DPointSymbol(l,p,k);default:return new q.Graphics3DSymbol(l,p,k)}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DPointSymbol":function(){define("exports ../../../../core/asyncUtils ../../../../core/maybe ../../../../core/promiseUtils ./Graphics3DCalloutSymbolLayerFactory ./Graphics3DLineCalloutSymbolLayer ./Graphics3DSymbol".split(" "),
function(a,b,q,l,p,k,h){class f extends h.Graphics3DSymbol{constructor(c,e,g){super(c,e,g);this._calloutSymbolLayer=null;this.symbol.hasVisibleCallout()&&(this._calloutSymbolLayer=p.make(this.symbol,e))}async doLoad(c){const e=this._calloutSymbolLayer?b.result(this._calloutSymbolLayer.load()):null;try{await super.doLoad(c),l.throwIfAborted(c)}catch(g){throw this._calloutSymbolLayer?.abortLoad(),g;}e&&await e}destroy(){super.destroy();this._calloutSymbolLayer=q.destroyMaybe(this._calloutSymbolLayer)}createGraphics3DGraphic(c,
e){e=super.createGraphics3DGraphic(c,e);null!=this._calloutSymbolLayer&&null!=e&&(c=this._createCalloutGraphic(c))&&e.setCalloutGraphic(c);return e}globalPropertyChanged(c,e){return super.globalPropertyChanged(c,e)?this._calloutSymbolLayer?this._calloutSymbolLayer.globalPropertyChanged(c,e,g=>g.calloutLayer):!0:!1}updateGeometry(c,e){const g=super.updateGeometry(c,e);return g&&this._calloutSymbolLayer&&(c=c.calloutLayer)?this._calloutSymbolLayer.updateGeometry(c,e):g}_createCalloutGraphic(c){const e=
c.renderingInfo;c.renderingInfo=new k.LineCalloutSymbolLayerRenderingInfo(e.renderer,e.symbol);return this._calloutSymbolLayer.createGraphics3DGraphic(c)}}a.Graphics3DPointSymbol=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/GraphicsCorePerformanceInfo":function(){define(["exports"],function(a){class b{constructor(q,l,p){this.visible=q;this.missing=l;this.pending=p}}a.GraphicsCorePerformanceInfo=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/layers/graphics/GraphicStateTracking":function(){define(["exports","../../../../core/arrayUtils","../../../../core/handleUtils","../../../../layers/graphics/dehydratedFeatures"],function(a,b,q,l){class p{constructor(k){this._graphicsCore=k;this._idToState=new Map;this._states=new Set;const h=k.owner.layer?.objectIdField;h?(this._getGraphicId=f=>l.getObjectId(f,h),this._getGraphics3DGraphicById=f=>this._graphicsCore.getGraphics3DGraphicByObjectId(f)):(this._getGraphicId=f=>f.uid,this._getGraphics3DGraphicById=
f=>this._graphicsCore.getGraphics3DGraphicById(f))}destroy(){this._idToState.clear();this._states.forEach((k,h)=>this.remove(h))}add(k){const h=q.makeHandle(()=>this.remove(k));if(this._states.has(k))return h;const f=this._getGraphicId(k.graphic),c=this._getGraphics3DGraphicById(f);this._states.has(k)||this._states.add(k);this._ensureStateList(f).push(k);k.displaying=null!=c?c.isVisible():!1;k.isDraped=null!=c?c.isDraped:!1;k.tracking=!0;null!=c&&k.emit("changed");return h}remove(k){if(this._states.has(k)){if(this._idToState.size){const h=
this._getGraphicId(k.graphic),f=this._idToState.get(h);f&&(b.remove(f,k),0===f.length&&this._idToState.delete(h))}this._states.delete(k);k.tracking=!1;k.displaying=!1}}addGraphic(k){this._forEachState(k,h=>{h.displaying=k.isVisible();h.isDraped=k.isDraped;h.emit("changed")})}removeGraphic(k){this._forEachState(k,h=>{h.displaying=!1;h.isDraped=!1})}updateGraphicGeometry(k){this._forEachState(k,h=>h.emit("changed"))}updateGraphicVisibility(k){this._forEachState(k,h=>h.displaying=k.isVisible())}allGraphicsDeleted(){this._states.forEach(k=>
k.displaying=!1)}_ensureStateList(k){var h=this._idToState.get(k);if(h)return h;h=[];this._idToState.set(k,h);return h}_forEachState(k,h){0!==this._states.size&&0!==this._idToState.size&&(k=this._getGraphicId(k.graphic),k=this._idToState.get(k),null!=k&&k.forEach(h))}}a.GraphicStateTracking=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/SpatialIndex2D":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/maybe ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/rbush/PooledRBush ../../../../geometry/support/aaBoundingBox ../../../../layers/graphics/dehydratedFeatures".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){a.SpatialIndex2D=class extends q{constructor(w){super(w);this._index=new e.PooledRBush(9,l("esri-csp-restrictions")?v=>({minX:v.extent[0],minY:v.extent[1],maxX:v.extent[2],maxY:v.extent[3]}):[".extent[0]",".extent[1]",".extent[2]",".extent[3]"]);this._missing=new Set;this._boundsByFeature=new Map;this.objectIdField=this.hasM=this.hasZ=this.spatialReference=null;this.updating=!1}setup(w){this._addMany(w)}destroy(){this._missing.clear();this._index=p.destroyMaybe(this._index);
this._boundsByFeature.clear();this._boundsByFeature=null}update(){0<this._missing.size&&(this._addMany(Array.from(this._missing.values())),this.updating=!1,this._missing.clear())}get updatingRemaining(){return this._missing.size}queryGraphicUIDsInExtent(w,v,m){null!=v&&v.equals(this.spatialReference)&&(t.minX=w[0],t.minY=w[1],t.maxX=w[2],t.maxY=w[3],this.update(),this._index.search(t,r=>m(r.graphic.uid)))}add(w){this._missing.add(w);this.updating=!0}remove(w){this._missing.delete(w)?this.updating=
0<this._missing.size:w.extent&&(this._index.remove(w),w=d.getObjectId(w.graphic,this._get("objectIdField")),null!=w&&this._boundsByFeature.delete(w))}_addMany(w){if(0!==w.length){var v=this._get("objectIdField");for(const m of w){m.computeExtent(this.spatialReference);const r=d.getObjectId(m.graphic,v);null!=r&&this._boundsByFeature.set(r,m.extent)}this._index.load(w)}}clear(){this._index.clear();this._missing.clear();this._boundsByFeature.clear();this.updating=!1}forEachInBounds(w,v){t.minX=w[0];
t.minY=w[1];t.maxX=w[2];t.maxY=w[3];this.update();this._index.search(t,m=>{v(m)})}getBounds(w,v){this.update();return(w=this._boundsByFeature.get(w))?g.fromRect(v,w):null}};b.__decorate([k.property({constructOnly:!0})],a.SpatialIndex2D.prototype,"spatialReference",void 0);b.__decorate([k.property({constructOnly:!0})],a.SpatialIndex2D.prototype,"hasZ",void 0);b.__decorate([k.property({constructOnly:!0})],a.SpatialIndex2D.prototype,"hasM",void 0);b.__decorate([k.property({constructOnly:!0})],a.SpatialIndex2D.prototype,
"objectIdField",void 0);b.__decorate([k.property()],a.SpatialIndex2D.prototype,"updating",void 0);b.__decorate([k.property({readOnly:!0})],a.SpatialIndex2D.prototype,"updatingRemaining",null);a.SpatialIndex2D=b.__decorate([c.subclass("esri.views.3d.layers.graphics.SpatialIndex2D")],a.SpatialIndex2D);const t={minX:0,minY:0,maxX:0,maxY:0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/rbush/PooledRBush":function(){define(["exports","../../arrayUtils","../../has","../../PooledArray",
"../../../chunks/quickselect"],function(a,b,q,l,p){function k(D,F){for(u.clear();D;){if(!0===D.leaf)for(const H of D.children)F(H);else u.pushArray(D.children);D=u.pop()??null}}function h(D,F){f(D,0,D.children.length,F,D)}function f(D,F,H,N,E){E||=new B([]);E.minX=Infinity;E.minY=Infinity;E.maxX=-Infinity;E.maxY=-Infinity;for(let G=F,I;G<H;G++)I=D.children[G],c(E,D.leaf?N(I):I);return E}function c(D,F){D.minX=Math.min(D.minX,F.minX);D.minY=Math.min(D.minY,F.minY);D.maxX=Math.max(D.maxX,F.maxX);D.maxY=
Math.max(D.maxY,F.maxY)}function e(D,F){return D.minX-F.minX}function g(D,F){return D.minY-F.minY}function d(D){return(D.maxX-D.minX)*(D.maxY-D.minY)}function t(D){return D.maxX-D.minX+(D.maxY-D.minY)}function w(D,F){return D.minX<=F.minX&&D.minY<=F.minY&&F.maxX<=D.maxX&&F.maxY<=D.maxY}function v(D,F){return F.minX<=D.maxX&&F.minY<=D.maxY&&F.maxX>=D.minX&&F.maxY>=D.minY}function m(D,F,H,N,E){for(F=[F,H];F.length;){H=F.pop();const G=F.pop();if(H-G<=N)continue;const I=G+Math.ceil((H-G)/N/2)*N;p.quickselect(D,
I,G,H,E);F.push(G,I,I,H)}}class r{constructor(D=9,F){this._compareMinX=e;this._compareMinY=g;this._toBBox=H=>H;this._maxEntries=Math.max(4,D||9);this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries));F&&("function"===typeof F?this._toBBox=F:this._initFormat(F));this.clear()}destroy(){this.clear();n.prune();u.prune();x.prune();y.prune()}all(D){k(this._data,D)}search(D,F){let H=this._data;const N=this._toBBox;if(v(D,H))for(n.clear();H;){for(let E=0,G=H.children.length;E<G;E++){const I=H.children[E],
O=H.leaf?N(I):I;v(D,O)&&(H.leaf?F(I):w(D,O)?k(I,F):n.push(I))}H=n.pop()}}collides(D){let F=this._data;const H=this._toBBox;if(!v(D,F))return!1;for(n.clear();F;){for(let N=0,E=F.children.length;N<E;N++){const G=F.children[N],I=F.leaf?H(G):G;if(v(D,I)){if(F.leaf||w(D,I))return!0;n.push(G)}}F=n.pop()}return!1}load(D){if(!D.length)return this;if(D.length<this._minEntries){for(let F=0,H=D.length;F<H;F++)this.insert(D[F]);return this}D=this._build(D.slice(0,D.length),0,D.length-1,0);if(this._data.children.length)if(this._data.height===
D.height)this._splitRoot(this._data,D);else{if(this._data.height<D.height){const F=this._data;this._data=D;D=F}this._insert(D,this._data.height-D.height-1,!0)}else this._data=D;return this}insert(D){D&&this._insert(D,this._data.height-1);return this}clear(){this._data=new B([]);return this}remove(D){if(!D)return this;let F=this._data,H=null,N=0,E=!1,G;const I=this._toBBox(D);x.clear();for(y.clear();F||0<x.length;){F||(F=x.pop(),H=x.data[x.length-1],N=y.pop()??0,E=!0);if(F.leaf&&(G=b.indexOf(F.children,
D,F.children.length,F.indexHint),-1!==G)){F.children.splice(G,1);x.push(F);this._condense(x);break}E||F.leaf||!w(F,I)?H?(N++,F=H.children[N],E=!1):F=null:(x.push(F),y.push(N),N=0,H=F,F=F.children[0])}return this}toJSON(){return this._data}fromJSON(D){this._data=D;return this}_build(D,F,H,N){var E=H-F+1,G=this._maxEntries;if(E<=G)return D=new B(D.slice(F,H+1)),h(D,this._toBBox),D;N||(N=Math.ceil(Math.log(E)/Math.log(G)),G=Math.ceil(E/G**(N-1)));const I=new C([]);I.height=N;E=Math.ceil(E/G);G=E*Math.ceil(Math.sqrt(G));
for(m(D,F,H,G,this._compareMinX);F<=H;F+=G){const O=Math.min(F+G-1,H);m(D,F,O,E,this._compareMinY);for(let L=F;L<=O;L+=E)I.children.push(this._build(D,L,Math.min(L+E-1,O),N-1))}h(I,this._toBBox);return I}_insert(D,F,H){var N=this._toBBox;H=H?D:N(D);x.clear();N=this._data;for(var E=F,G=x;;){G.push(N);if(!0===N.leaf||G.length-1===E)break;let I=Infinity,O=Infinity,L=void 0;for(let P=0,M=N.children.length;P<M;P++){const K=N.children[P],J=d(K),R=(Math.max(K.maxX,H.maxX)-Math.min(K.minX,H.minX))*(Math.max(K.maxY,
H.maxY)-Math.min(K.minY,H.minY))-J;R<O?(O=R,I=J<I?J:I,L=K):R===O&&J<I&&(I=J,L=K)}N=L||N.children[0]}N.children.push(D);for(c(N,H);0<=F;)if(x.data[F].children.length>this._maxEntries)this._split(x,F),F--;else break;for(D=x;0<=F;F--)c(D.data[F],H)}_split(D,F){const H=D.data[F];var N=H.children.length;const E=this._minEntries;this._chooseSplitAxis(H,E,N);if(N=this._chooseSplitIndex(H,E,N))N=H.children.splice(N,H.children.length-N),N=H.leaf?new B(N):new C(N),N.height=H.height,h(H,this._toBBox),h(N,this._toBBox),
F?D.data[F-1].children.push(N):this._splitRoot(H,N)}_splitRoot(D,F){this._data=new C([D,F]);this._data.height=D.height+1;h(this._data,this._toBBox)}_chooseSplitIndex(D,F,H){let N,E,G=void 0;N=E=Infinity;for(let O=F;O<=H-F;O++){var I=f(D,0,O,this._toBBox);const L=f(D,O,H,this._toBBox),P=Math.max(0,Math.min(I.maxX,L.maxX)-Math.max(I.minX,L.minX))*Math.max(0,Math.min(I.maxY,L.maxY)-Math.max(I.minY,L.minY));I=d(I)+d(L);P<N?(N=P,G=O,E=I<E?I:E):P===N&&I<E&&(E=I,G=O)}return G}_chooseSplitAxis(D,F,H){const N=
D.leaf?this._compareMinX:e,E=D.leaf?this._compareMinY:g,G=this._allDistMargin(D,F,H,N);F=this._allDistMargin(D,F,H,E);G<F&&D.children.sort(N)}_allDistMargin(D,F,H,N){D.children.sort(N);N=this._toBBox;var E=f(D,0,F,N);const G=f(D,H-F,H,N);let I=t(E)+t(G);for(let O=F;O<H-F;O++){const L=D.children[O];c(E,D.leaf?N(L):L);I+=t(E)}for(H=H-F-1;H>=F;H--)E=D.children[H],c(G,D.leaf?N(E):E),I+=t(G);return I}_condense(D){for(let F=D.length-1;0<=F;F--){const H=D.data[F];if(0===H.children.length)if(0<F){const N=
D.data[F-1],E=N.children;E.splice(b.indexOf(E,H,E.length,N.indexHint),1)}else this.clear();else h(H,this._toBBox)}}_initFormat(D){const F=["return a"," - b",";"];this._compareMinX=new Function("a","b",F.join(D[0]));this._compareMinY=new Function("a","b",F.join(D[1]));this._toBBox=new Function("a","return {minX: a"+D[0]+", minY: a"+D[1]+", maxX: a"+D[2]+", maxY: a"+D[3]+"};")}}const n=new l,u=new l,x=new l,y=new l({deallocator:void 0});class z{constructor(){this.minY=this.minX=Infinity;this.maxY=this.maxX=
-Infinity}}class A extends z{constructor(){super(...arguments);this.height=1;this.indexHint=new b.PositionHint}}class B extends A{constructor(D){super();this.children=D;this.leaf=!0}}class C extends A{constructor(D){super();this.children=D;this.leaf=!1}}a.BBox=z;a.PooledRBush=r;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/quickselect":function(){define(["exports","./_commonjsHelpers"],function(a,b){var q={exports:{}};(function(l){(function(p){p=p();void 0!==p&&(l.exports=
p)})(function(){function p(f,c,e,g,d){for(;g>e;){if(600<g-e){var t=g-e+1,w=c-e+1,v=Math.log(t),m=.5*Math.exp(2*v/3);v=.5*Math.sqrt(v*m*(t-m)/t)*(0>w-t/2?-1:1);p(f,c,Math.max(e,Math.floor(c-w*m/t+v)),Math.min(g,Math.floor(c+(t-w)*m/t+v)),d)}t=f[c];w=e;m=g;k(f,e,c);for(0<d(f[g],t)&&k(f,e,g);w<m;){k(f,w,m);w++;for(m--;0>d(f[w],t);)w++;for(;0<d(f[m],t);)m--}0===d(f[e],t)?k(f,e,m):(m++,k(f,m,g));m<=c&&(e=m+1);c<=m&&(g=m-1)}}function k(f,c,e){var g=f[c];f[c]=f[e];f[e]=g}function h(f,c){return f<c?-1:f>
c?1:0}return function(f,c,e,g,d){p(f,c,e||0,g||f.length-1,d||h)}})})(q);b=b.getDefaultExportFromCjs(q.exports);a.quickselect=b})},"esri/views/3d/layers/graphics/symbolMemory":function(){define(["exports"],function(a){a.getSymbolMemorySize=function(b){return 2216+4096*b.symbolLayers.length+b.complexity.memory.resourceBytes};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/StageLayerElevationProvider":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/Logger ../../../../core/unitUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/aaBoundingBox ../../../../symbols/support/unitConversionUtils ../../support/ElevationUpdateEvent ../../webgl-engine/lib/Intersector ../../webgl-engine/lib/IntersectorInterfaces ../../webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){const u=Symbol("layerHandles");a.StageLayerElevationProvider=class extends l.EventedMixin(q){get spatialReference(){return this.view?.spatialReference}constructor(C){super(C);this._elevationOffset=0}initialize(){this._renderCoordsHelper=this.view.renderCoordsHelper;this._intersectLayers=[this.stageLayer];this._intersector=m.newIntersector(this.view.state.viewingMode);this._intersector.options.store=r.StoreResults.MIN;var C=this._computeLayerExtent(this.spatialReference,
this.stageLayer);this._zmin=C[2];this._zmax=C[5];C=this.stageLayer.events;this.addHandles([C.on(["layerObjectAdded","layerObjectRemoved","geometryAdded","geometryRemoved"],({object:D})=>this._objectChanged(D)),C.on("attributesChanged",({attribute:D,object:F})=>n.affectsGeometry(D)&&this._objectChanged(F)),C.on(["transformationChanged","shaderTransformationChanged"],D=>this._objectChanged(D))],u)}dispose(){this.removeHandles(u)}elevationInfoChanged(){const C=null!=this.layer?this.layer.elevationInfo:
null;if(null!=C&&"on-the-ground"!==C.mode){const D=k.getMetersPerVerticalUnitForSR(this.layer.spatialReference),F=w.getMetersPerUnit(C.unit??"meters");this._elevationOffset=(C.offset??0)*F/D}else this._elevationOffset=0}getElevation(C,D,F,H){z[0]=C;z[1]=D;z[2]=F;if(!this._renderCoordsHelper.toRenderCoords(z,H,z))return p.getLogger(this).error("could not project point for elevation alignment"),null;C=this._elevationOffset;D=this._zmin+C;this._renderCoordsHelper.setAltitude(A,this._zmax+C,z);this._renderCoordsHelper.setAltitude(B,
D,z);this._intersector.reset(A,B,null);this._intersector.intersect(this._intersectLayers,null,1,null,N=>!!N.lastValidElevationBB);return this._intersector.results.min.getIntersectionPoint(z)?this._renderCoordsHelper.getAltitude(z):null}_objectChanged(C){const D=this.spatialReference;if(C.lastValidElevationBB&&D){t.empty(x);var F=C.lastValidElevationBB;F.isEmpty()||this._expandExtent(D,F.min,F.max,x);var {min:H,max:N}=C.boundingVolumeWorldSpace;this._expandExtent(D,H,N,x);t.toRect(x,y.extent);this._zmin=
Math.min(this._zmin,x[2]);this._zmax=Math.max(this._zmax,x[5]);y.spatialReference=D;this.emit("elevation-change",y);g.copy(F.min,H);g.copy(F.max,N)}}_computeLayerExtent(C,D){t.empty(x);null!=C&&D.objects.forAll(F=>this._expandExtent(C,F.boundingVolumeWorldSpace.min,F.boundingVolumeWorldSpace.max,x));return x}_expandExtent(C,D,F,H){for(let N=0;8>N;++N)z[0]=N&1?D[0]:F[0],z[1]=N&2?D[1]:F[1],z[2]=N&4?D[2]:F[2],this._renderCoordsHelper.fromRenderCoords(z,z,C),t.expandWithVec3(H,z);return H}};b.__decorate([h.property({constructOnly:!0})],
a.StageLayerElevationProvider.prototype,"layer",void 0);b.__decorate([h.property({constructOnly:!0})],a.StageLayerElevationProvider.prototype,"stageLayer",void 0);b.__decorate([h.property({constructOnly:!0})],a.StageLayerElevationProvider.prototype,"view",void 0);b.__decorate([h.property()],a.StageLayerElevationProvider.prototype,"spatialReference",null);a.StageLayerElevationProvider=b.__decorate([e.subclass("esri.views.3d.layers.support.StageLayerElevationProvider")],a.StageLayerElevationProvider);
const x=t.empty(),y=new v.ElevationUpdateEvent,z=d.create(),A=d.create(),B=d.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DElevationAlignment":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ./ExtentSet ../../webgl-engine/lib/UpdatePolicy ../../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){function w(v){return null==v?t.TaskPriority.ELEVATION_ALIGNMENT:"relative-to-scene"===v?t.TaskPriority.ELEVATION_ALIGNMENT_SCENE:t.TaskPriority.ELEVATION_ALIGNMENT}a.Graphics3DElevationAlignment=class extends q{constructor(v){super(v);this._dirtyExtents=new g.ExtentSet;this._globalDirty=!1;this._averageExtentUpdateSize=0;this._dirtyGraphicsSet=new Set;this._updateElevation=!1;this.graphicsCore=this.graphicsCoreOwner=null;this.events=new l}initialize(){const v=this.elevationProvider;
this._task=this.graphicsCoreOwner.view.resourceController.scheduler.registerTask(w(this.graphicsCore.layer.elevationInfo?.mode),this);this.addHandles([v.on("elevation-change",m=>this._elevationChanged(m)),p.watch(()=>this.graphicsCoreOwner.suspended,()=>this._suspendedChange()),this._task,p.watch(()=>w(this.graphicsCore.layer.elevationInfo?.mode),m=>this._task.priority=m)])}destroy(){this._dirtyGraphicsSet.clear();this.elevationProvider=this.queryGraphicUIDsInExtent=this.graphicsCore=this.graphicsCoreOwner=
null}clear(){this._dirtyGraphicsSet.clear();this.notifyChange("updating")}_suspendedChange(){!0===this.graphicsCoreOwner.suspended?this._updateElevation=!1:!1===this.graphicsCoreOwner.suspended&&this._updateElevation&&(this._globalDirty=!0,this.notifyChange("updating"))}elevationInfoChange(){this._globalDirty=!0;this.notifyChange("updating")}get updating(){return this.running}get running(){return 0<this._dirtyGraphicsSet.size||this._dirtyExtents&&!this._dirtyExtents.empty||this._globalDirty}get updatingRemaining(){return this._dirtyGraphicsSet.size+
this._dirtyExtents.size*this._averageExtentUpdateSize}runTask(v){this._globalDirty&&(this._markAllGraphicsElevationDirty(),this._globalDirty=!1,v.madeProgress());for(v.run(()=>this._dirtyExtents.merge(v));this.running&&!v.done;)this._updateDirtyGraphics(v),this._updateDirtyExtents(v);this.notifyChange("updating")}_updateDirtyGraphics(v){const m=this.graphicsCoreOwner.view.renderCoordsHelper,r=this.graphicsCore.effectiveUpdatePolicy===d.UpdatePolicy.ASYNC;for(const n of this._dirtyGraphicsSet.keys()){const u=
this.graphicsCore.getGraphics3DGraphicById(n);this._dirtyGraphicsSet.delete(n);null!=u&&(u.alignWithElevation(this.elevationProvider,m,r),this.graphicsCore.deconflictor?.setDirty(),v.madeProgress());if(v.done)break}}_updateDirtyExtents(v){for(;!this._dirtyExtents.empty&&!v.done;){const m=this._dirtyExtents.pop(),r=this.elevationProvider.spatialReference;this.events.emit("invalidate-elevation",{extent:m,spatialReference:r});const n=this._dirtyGraphicsSet.size;this.queryGraphicUIDsInExtent(m,r,u=>{const x=
this.graphicsCore.getGraphics3DGraphicById(u);null!=x&&x.needsElevationUpdates()&&this._dirtyGraphicsSet.add(u)});this._averageExtentUpdateSize=.1*(this._dirtyGraphicsSet.size-n)+.9*this._averageExtentUpdateSize;v.madeProgress()}}_markAllGraphicsElevationDirty(){this._dirtyExtents.clear();this._dirtyGraphicsSet.clear();this.graphicsCore.graphics3DGraphics.forEach((v,m)=>this._dirtyGraphicsSet.add(m))}_elevationChanged(v){if("scene"!==v.context||this.graphicsCore.layer.elevationInfo&&"relative-to-scene"===
this.graphicsCore.layer.elevationInfo.mode){var m=v.extent;if(this.graphicsCoreOwner.suspended){if(!this._updateElevation){const r=this.graphicsCore.computedExtent;r&&m[2]>r.xmin&&m[0]<r.xmax&&m[3]>r.ymin&&m[1]<r.ymax&&(this._updateElevation=!0)}this.events.emit("invalidate-elevation",v)}else-Infinity===m[0]?this._globalDirty=!0:this._dirtyExtents.add(m),this.notifyChange("updating")}}};b.__decorate([k.property()],a.Graphics3DElevationAlignment.prototype,"graphicsCoreOwner",void 0);b.__decorate([k.property()],
a.Graphics3DElevationAlignment.prototype,"graphicsCore",void 0);b.__decorate([k.property()],a.Graphics3DElevationAlignment.prototype,"queryGraphicUIDsInExtent",void 0);b.__decorate([k.property()],a.Graphics3DElevationAlignment.prototype,"elevationProvider",void 0);b.__decorate([k.property({readOnly:!0})],a.Graphics3DElevationAlignment.prototype,"updating",null);b.__decorate([k.property({readOnly:!0})],a.Graphics3DElevationAlignment.prototype,"updatingRemaining",null);a.Graphics3DElevationAlignment=
b.__decorate([e.subclass("esri.views.3d.layers.graphics.Graphics3DElevationAlignment")],a.Graphics3DElevationAlignment);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/ExtentSet":function(){define(["exports","../../../../core/has","../../../../core/PooledArray","../../../../geometry/support/aaBoundingRect","../../../support/Scheduler"],function(a,b,q,l,p){class k{constructor(){this._extents=new q({allocator:h=>h||l.create()});this._tmpExtent=l.create();
this._dirty=!1}get empty(){return 0===this._extents.length}get size(){return this._extents.length}clear(){this._extents.clear()}add(h){this._contains(h)||(this._removeContained(h),l.copy(this._extents.pushNew(),h),this._dirty=!0)}pop(){this._dirty&&this._mergeTight();return this._extents.pop()}merge(h){this._mergeTight(h);return h.hasProgressed}_mergeTight(h=p.noBudget){const f=this._extents,c=new Set;let e=0;for(;e!==f.length;){f.sort((g,d)=>g[0]-d[0]);e=f.length;c.clear();for(let g=0;g<f.length;++g){if(h.done)return;
const d=f.at(g);if(d){for(let t=g+1;t<f.length;++t){const w=f.at(t);if(null==w||w[0]>=d[2])break;c.add(w)}c.forEach(t=>{if(d!==t)if(t[2]<=d[0])c.delete(t);else{var w=l.area(d),v=l.area(t),m=this._tmpExtent;l.expand(d,t,m);w+=v;.05>(l.area(m)-w)/w&&(l.copy(d,m),c.delete(t),f.remove(t),h.madeProgress())}});c.add(d)}}}this._dirty=!1}_contains(h){return this._extents.some(f=>l.contains(f,h))}_removeContained(h){this._extents.filterInPlace(f=>!l.contains(h,f))}get test(){}}a.ExtentSet=k;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DFrustumVisibility":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/ellipsoidUtils ../../support/FrustumExtentIntersection ../../../support/Scheduler ../../../support/Yield".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){a.Graphics3DFrustumVisibility=class extends q{constructor(w){super(w);this.suspended=!1;this._extent=null;this._extentIntersectionDirty=!0;this._isVisibleBelowSurfaceInternal=!1;this.graphicsCoreOwner=null;this.updating=!0}initialize(){var {graphicsCoreOwner:w}=this;this._extentIntersection=new g.FrustumExtentIntersection({renderCoordsHelper:w.view.renderCoordsHelper});const v=w.view,m=v.basemapTerrain;w=v.resourceController.scheduler;this.addHandles([v.on("resize",
()=>this._viewChange()),l.watch(()=>v.state.camera,()=>this._viewChange(),l.sync),w.registerTask(d.TaskPriority.FRUSTUM_VISIBILITY,this),l.watch(()=>m.visibleElevationBounds,()=>this._elevationBoundsChange())]);"local"===v.viewingMode?this._isVisibleBelowSurface=!0:this.addHandles([l.watch(()=>[m.baseOpacity,m.wireframe,v.map?.ground?.navigationConstraint?.type],()=>this._updateIsVisibleBelowSurface(),l.initial)])}destroy(){this._set("graphicsCoreOwner",null);this._extentIntersection=this._extent=
null}_setDirty(){this.updating||this._set("updating",!0)}setExtent(w){this._extent=w;this._extentIntersectionDirty=!0;this._setDirty()}_viewChange(){this._setDirty()}_elevationBoundsChange(){this._setDirty();this._extentIntersectionDirty=!0}set _isVisibleBelowSurface(w){this._isVisibleBelowSurfaceInternal=w;this._setDirty();this._extentIntersectionDirty=!0}_updateIsVisibleBelowSurface(){const w=this.graphicsCoreOwner.view,v=w.basemapTerrain,m="none"===w.map.ground?.navigationConstraint?.type;this._isVisibleBelowSurface=
"local"===w.viewingMode||!v.opaque||m}_updateExtentIntersection(){if(this._extentIntersectionDirty){this._extentIntersectionDirty=!1;var w=this.graphicsCoreOwner.view;if(this._isVisibleBelowSurfaceInternal)var v=-.3*e.getReferenceEllipsoid(w.spatialReference).radius;else{const {min:m,max:r}=w.basemapTerrain.visibleElevationBounds;v=m-Math.max(1,(r-m)*(1.2-1))}this._extentIntersection.update(this._extent,w.spatialReference,v)}}get running(){return this.updating}runTask(w){this._set("updating",!1);
if(!this._extent)return this._set("suspended",!1),t.Yield;this._updateExtentIntersection();const v=this.graphicsCoreOwner.view.frustum,m=e.getReferenceEllipsoid(this.graphicsCoreOwner.view.spatialReference).radius;this._set("suspended",!this._extentIntersection.isVisibleInFrustum(v,m));w.madeProgress()}};b.__decorate([p.property({readOnly:!0})],a.Graphics3DFrustumVisibility.prototype,"suspended",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DFrustumVisibility.prototype,"graphicsCoreOwner",
void 0);b.__decorate([p.property({readOnly:!0})],a.Graphics3DFrustumVisibility.prototype,"updating",void 0);a.Graphics3DFrustumVisibility=b.__decorate([c.subclass("esri.views.3d.layers.graphics.Graphics3DFrustumVisibility")],a.Graphics3DFrustumVisibility);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DObjectStates":function(){define(["exports","../../../../core/handleUtils","../../../../core/has","./Graphics3DObjectStateSet"],function(a,b,
q,l){class p{constructor(k){this._graphicsCore=k;this._stateSets=[]}destroy(){this.reset();this._stateSets=null}reset(){this._stateSets&&(this._stateSets.forEach(k=>k.objectStateSet.removeAll()),this._stateSets.length=0)}acquireSet(k,h){const f=new l.Graphics3DObjectStateSet(k,h);this._stateSets.push(f);k=b.makeHandle(()=>this.releaseSet(f));return{set:f,handle:k}}releaseSet(k){k.objectStateSet.removeAll();k=this._stateSets?this._stateSets.indexOf(k):-1;-1!==k&&this._stateSets.splice(k,1)}setUid(k,
h){k.ids.add(h);(h=this._graphicsCore.graphics3DGraphics.get(h))&&h.addObjectStateSet(k.stateType,k.objectStateSet)}setUids(k,h){h.forEach(f=>this.setUid(k,f))}setObjectIds(k,h){h.forEach(f=>k.ids.add(f));this._initializeSet(k)}addGraphic(k){this._stateSets.forEach(h=>{!h.paused&&h.hasGraphic(k)&&k.addObjectStateSet(h.stateType,h.objectStateSet)})}removeGraphic(k){this._stateSets.forEach(h=>{h.hasGraphic(k)&&k.removeObjectState(h.objectStateSet)})}allGraphicsDeleted(){this._stateSets&&this._stateSets.forEach(k=>
k.objectStateSet.removeAll())}_initializeSet(k){const h=this._graphicsCore.graphics3DGraphics;k.objectIdField?h.forEach(f=>{f&&k.hasGraphic(f)&&f.addObjectStateSet(k.stateType,k.objectStateSet)}):k.ids.forEach(f=>{(f=h.get(f))&&f.addObjectStateSet(k.stateType,k.objectStateSet)})}get test(){}}a.Graphics3DObjectStates=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DObjectStateSet":function(){define(["exports","../../webgl-engine/lib/Object3DStateSet"],
function(a,b){class q{constructor(l,p){this.stateType=l;this.objectIdField=p;this.objectStateSet=new b.Object3DStateSet;this.ids=new Set;this.paused=!1}hasGraphic(l){return this.objectIdField?this.ids.has(l.graphic.attributes[this.objectIdField]):this.ids.has(l.graphic.uid)}}a.Graphics3DObjectStateSet=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Object3DStateSet":function(){define(["exports","./basicInterfaces"],function(a,b){function q(k){switch(k.type){case l.Object:k.objectStateId.channel===
b.Object3DState.Highlight?k.object.removeHighlight(k.objectStateId):k.objectStateId.channel===b.Object3DState.MaskOccludee&&k.object.removeOcclude(k.objectStateId);break;case l.RenderGeometry:k.owner.removeRenderGeometryObjectState(k.renderGeometry,k.objectStateId);break;case l.External:k.remove(k.objectStateId)}}var l;(function(k){k[k.Object=0]="Object";k[k.RenderGeometry=1]="RenderGeometry";k[k.External=2]="External";k[k.COUNT=3]="COUNT"})(l||={});class p{constructor(){this._items=[]}addObject(k,
h){this._items.push({type:l.Object,objectStateId:h,object:k})}addRenderGeometry(k,h,f){this._items.push({type:l.RenderGeometry,objectStateId:h,renderGeometry:k,owner:f})}addExternal(k,h){this._items.push({type:l.External,objectStateId:h,remove:k})}remove(k){for(let h=this._items.length-1;0<=h;--h){const f=this._items[h];f.objectStateId===k&&(q(f),this._items.splice(h,1))}}removeObject(k){for(let h=this._items.length-1;0<=h;--h){const f=this._items[h];f.type===l.Object&&f.object===k&&(q(f),this._items.splice(h,
1))}}removeRenderGeometry(k){for(let h=this._items.length-1;0<=h;--h){const f=this._items[h];f.type===l.RenderGeometry&&f.renderGeometry===k&&(q(f),this._items.splice(h,1))}}removeAll(){this._items.forEach(k=>{q(k)});this._items=[]}}a.Object3DStateSet=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/Graphics3DScaleVisibility":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Logger ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/support/UpdatingHandles ../../../../geometry/projection/projectBoundingRect ../../../../geometry/support/aaBoundingRect ./enums ../../../support/layerViewUtils ../../../support/Scheduler ../../../support/Yield".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){a.Graphics3DScaleVisibility=class extends q{constructor(r){super(r);this._layerScaleRangeVisibilityQuery=this._scaleRangeActive=!1;this._extent=null;this._updatingHandles=new c.UpdatingHandles;this.basemapTerrain=this.graphicsCore=this.queryGraphicUIDsInExtent=this.layer=this.graphicsCoreOwner=null;this.layerScaleEnabled=!0;this.suspended=!1;this._dirty=!0}initialize(){this.updateScaleRangeActive();this.addHandles(this.graphicsCoreOwner.view.resourceController.scheduler.registerTask(w.TaskPriority.SCALE_VISIBILITY,
this));this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this.layerMinMaxScaleChangeHandler())}destroy(){this._updatingHandles.destroy();this.removeHandles();this._dirty=!1;this.basemapTerrain=this.graphicsCore=this.queryGraphicUIDsInExtent=this.layer=this.graphicsCoreOwner=this._extent=null}get updating(){return this._dirty||this._updatingHandles.updating}_setDirty(){this._dirty=!0}setExtent(r){const n=this.graphicsCoreOwner.view.spatialReference,u=this.graphicsCoreOwner.view.basemapTerrain.spatialReference;
if(n===u)this._extent=r??null;else{const x=g.create();e.projectBoundingRect(r,n,x,u)?this._extent=x:this._extent=null}this._setDirty()}scaleRangeActive(){return this._scaleRangeActive}updateScaleRangeActive(){var r=this.layer,n=r.effectiveScaleRange;n=this.layerScaleEnabled&&null!=n&&(0<n.minScale||0<n.maxScale);r.labelingInfo&&!n&&(n=r.labelingInfo.some(u=>u&&(0<(u.minScale??0)||0<(u.maxScale??0))));r=this._scaleRangeActive!==n;(this._scaleRangeActive=n)&&!this.hasHandles("terrain-events")&&this.basemapTerrain?
(this.addHandles(this.basemapTerrain.on("scale-change",u=>this._scaleUpdateHandler(u)),"terrain-events"),this.layerScaleEnabled&&this.addHandles(this.basemapTerrain.on("tiles-visibility-changed",()=>this._setDirty()),"terrain-events")):!n&&this.hasHandles("terrain-events")&&this.removeHandles("terrain-events");return r}get running(){return!(!this.graphicsCoreOwner.view.basemapTerrain||!this.updating)}runTask(r){const n=this.graphicsCoreOwner.view.basemapTerrain;if(this._extent&&n&&n.ready&&this._scaleRangeActive&&
this.layerScaleEnabled){if(this._layerScaleRangeVisibilityQuery)return v.Yield;this._layerScaleRangeVisibilityQuery=!0;const {minScale:u,maxScale:x}=this.layer.effectiveScaleRange;n.queryVisibleScaleRange(this._extent,u,x,y=>this._finishUpdate(y))}else this._finishUpdate(!0);r.madeProgress()}_finishUpdate(r){this._layerScaleRangeVisibilityQuery=!1;this._set("suspended",!r);this._dirty=!1}_visibleAtLayerScale(r){const n=this.layer.effectiveScaleRange;return!this.layerScaleEnabled||t.scaleBoundsPredicate(r,
n.minScale||0,n.maxScale||0)}_visibleAtLabelScale(r,n){return t.scaleBoundsPredicate(r,n.minScale||0,n.maxScale||0)}_graphicScale(r){let n;null!=r.centroid?n=r.centroid:null!=r.graphic.geometry&&"point"===r.graphic.geometry.type&&(n=r.graphic.geometry);return n?this.graphicsCoreOwner.view.basemapTerrain?this.graphicsCoreOwner.view.basemapTerrain.getScale(n):1:null}_graphicVisible(r){if(!this.layerScaleEnabled)return!0;r=this._graphicScale(r);return this._visibleAtLayerScale(r)}updateVisibility(r){if(this._scaleRangeActive){const n=
this._graphicVisible(r);return r.setVisibilityFlag(d.VisibilityGroup.GRAPHIC,d.VisibilityFlag.SCALE_RANGE,n)}return!1}updateGraphicLabelScaleVisibility(r){if(!this._scaleRangeActive||!r.labelLayers||0===r.labelLayers.length)return!1;const n=this._graphicScale(r);if(r=this._updateLabelScaleVisibility(r,n))this.graphicsCore.deconflictor?.setDirty(),this.graphicsCore.labeler?.setDirty();return r}_updateLabelScaleVisibility(r,n){if(!r.labelLayers||0===r.labelLayers.length)return!1;const u=r.labelLayers[0]._labelClass;
return null!=u?.minScale&&null!=u.maxScale&&(n=this._visibleAtLabelScale(n,u),r.setVisibilityFlag(d.VisibilityGroup.LABEL,d.VisibilityFlag.SCALE_RANGE,n))?!0:!1}_scaleUpdateHandler(r){this._setDirty();if(this.graphicsCore.visible){var n=r.extent,u=r.scale,x=this._visibleAtLayerScale(u),y=!1,z=this.graphicsCoreOwner.view.spatialReference;r=r.spatialReference;if(null==r)l.getLogger(this).error("scaleUpdate: Internal error, no SpatialReference given for tiles");else{var A=!r.equals(z);A&&!e.projectBoundingRect(n,
r,m,z)?l.getLogger(this).error("scaleUpdate: Internal error, cannot project AABR from "+r+" to wkid "+z):(this.queryGraphicUIDsInExtent(A?m:n,z,B=>{B=this.graphicsCore.getGraphics3DGraphicById(B);if(null!=B){var C=B.centroid;null!=C&&(n[0]>C.x||n[1]>C.y||n[2]<C.x||n[3]<C.y)||(B.setVisibilityFlag(d.VisibilityGroup.GRAPHIC,d.VisibilityFlag.SCALE_RANGE,x)&&(y=!0),this._updateLabelScaleVisibility(B,u)&&(y=!0))}}),y&&(this.graphicsCore.deconflictor?.setDirty(),this.graphicsCore.labeler?.setDirty()))}}}layerMinMaxScaleChangeHandler(){this.updateScaleRangeActive()&&
!this._scaleRangeActive?this.graphicsCore.modifyGraphics3DGraphicVisibilities(r=>r.setVisibilityFlag(d.VisibilityGroup.GRAPHIC,d.VisibilityFlag.SCALE_RANGE,!0)):this._scaleRangeActive&&this.graphicsCore.updateAllGraphicsVisibility();this._setDirty()}};b.__decorate([p.property()],a.Graphics3DScaleVisibility.prototype,"graphicsCoreOwner",void 0);b.__decorate([p.property()],a.Graphics3DScaleVisibility.prototype,"layer",void 0);b.__decorate([p.property()],a.Graphics3DScaleVisibility.prototype,"queryGraphicUIDsInExtent",
void 0);b.__decorate([p.property()],a.Graphics3DScaleVisibility.prototype,"graphicsCore",void 0);b.__decorate([p.property()],a.Graphics3DScaleVisibility.prototype,"basemapTerrain",void 0);b.__decorate([p.property({constructOnly:!0})],a.Graphics3DScaleVisibility.prototype,"layerScaleEnabled",void 0);b.__decorate([p.property({readOnly:!0})],a.Graphics3DScaleVisibility.prototype,"suspended",void 0);b.__decorate([p.property({readOnly:!0})],a.Graphics3DScaleVisibility.prototype,"updating",null);b.__decorate([p.property()],
a.Graphics3DScaleVisibility.prototype,"_dirty",void 0);a.Graphics3DScaleVisibility=b.__decorate([f.subclass("esri.views.3d.layers.graphics.Graphics3DScaleVisibility")],a.Graphics3DScaleVisibility);const m=g.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/attributeUtils":function(){define(["exports"],function(a){a.attributeLookup=function(b,q,l){if(!l||null==q)return null;if(!b){a:{b=l.toLowerCase();for(var p in q)if(p.toLowerCase()===b){q=q[p];
break a}q=null}return q}return(p=b.get(l))?q[p.name]:null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureVisibilityFilter":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/asyncUtils ../../../../core/Logger ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/support/UpdatingHandles ../../../../layers/support/FeatureFilter ../../../../layers/support/floorFilterUtils ../graphics/QueryEngine ../../../support/Scheduler ../../../support/Yield".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){a.FeatureVisibilityFilter=class extends q{constructor(u){super(u);this._queryEngine=this._frameTask=this._updateTask=null;this._updateRequested=!0;this._updatingHandles=new t.UpdatingHandles;this._updateVisibility=async x=>{if(null==this._compositedFeatureFilter&&null==this._sceneFilter||0===this.context.getFeatureCount())return await this._frameTask.schedule(()=>this.clear(),x);try{const y=await this._queryEngine.executeQueryForIdSet(this._compositedFeatureFilter,
this._sceneFilter,x);h.throwIfAborted(x);return await this._frameTask.schedule(()=>{this.context.updateFeatureVisibilities(z=>y.has(z))},x)}catch(y){return h.throwIfAbortError(y),p.getLogger(this).warn(`FeatureFilter query failed: ${y}`,{error:y}),await this._frameTask.schedule(()=>{this.context.setAllFeaturesVisibility(!0)},x)}}}initialize(){const u=r.TaskPriority.FILTER_VISIBILITY,{layer:x,view:y}=this._configuration,{featureStore:z}=this.context;this._queryEngine=new m.QueryEngine({context:{spatialReference:y.spatialReference,
layer:x,scheduler:y.resourceController.scheduler,featureStore:z,hasM:this._configuration.hasM??!1,hasZ:this._configuration.hasZ??!1},priority:u});this._frameTask=y.resourceController.scheduler.registerTask(u,this);this._updatingHandles.add(()=>[this._compositedFeatureFilter,this._sceneFilter],()=>this.reapply(),f.initial)}destroy(){this._updateRequested=!1;this._updatingHandles.destroy();this.clear();this._updateTask=k.abortMaybe(this._updateTask);this._frameTask=k.removeMaybe(this._frameTask);this._queryEngine=
k.destroyMaybe(this._queryEngine);this._set("context",null)}get updating(){return this.running||this._updatingHandles.updating||null!=this._updateTask&&!this._updateTask.finished}get running(){return this._updateRequested||this._frameTask.updating}get defaultVisibility(){return null==this._compositedFeatureFilter&&null==this._sceneFilter}get _featureFilter(){return"filter"in this._configuration?this._configuration.filter:null}get _sceneFilter(){return"layerFilter"in this._configuration?this._configuration.layerFilter:
null}get _floorFilter(){return v.getFloorFilterClause(this._configuration)}get _timeExtent(){return"timeExtent"in this._configuration?this._configuration.timeExtent:null}get _compositedFeatureFilter(){const {_featureFilter:u,_timeExtent:x,_floorFilter:y}=this;if(null==x&&null==y)return u;const z=null!=u?u.clone():new w;null!=x&&(z.timeExtent=null!=z.timeExtent?z.timeExtent.intersection(x):x);null!=y&&(z.where=null==z.where||""===z.where?y:`(${z.where}) AND (${y})`);return z}get _configuration(){return this.context.configuration}reapply(){this._updateRequested=
!0}clear(){this._queryEngine.clear();this.context.clearFeaturesVisibility()}runTask(u){this._updateRequested&&(this._updateTask=k.abortMaybe(this._updateTask),this._updateTask=l.createTask(this._updateVisibility),this._updateRequested=!1,u.madeProgress());this._frameTask.processQueue(u);if(!u.hasProgressed)return n.Yield}};b.__decorate([c.property({constructOnly:!0})],a.FeatureVisibilityFilter.prototype,"context",void 0);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"updating",null);
b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"running",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"defaultVisibility",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_featureFilter",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_sceneFilter",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_floorFilter",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_timeExtent",
null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_compositedFeatureFilter",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_configuration",null);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_updateTask",void 0);b.__decorate([c.property()],a.FeatureVisibilityFilter.prototype,"_updateRequested",void 0);a.FeatureVisibilityFilter=b.__decorate([d.subclass("esri.views.3d.layers.support.FeatureVisibilityFilter")],a.FeatureVisibilityFilter);
Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/floorFilterUtils":function(){define(["exports"],function(a){function b(q,l){if(!q?.length)return null;q=q.filter(p=>""!==p).map(p=>`'${p}'`);q.push("''");return`${l} IN (${q.join(",")}) OR ${l} IS NULL`}a.getFloorFilterClause=function(q){const l=q.layer;return"floorInfo"in l&&l.floorInfo?.floorField&&"floors"in q.view?b(q.view.floors,l.floorInfo.floorField):null};a.getLayerFloorFilterClause=function(q,l){return"floorInfo"in
l&&l.floorInfo?.floorField?b(q,l.floorInfo.floorField):null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/QueryEngine":function(){define("exports ../../../../chunks/tslib.es6 ../../../../geometry ../../../../core/Accessor ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/Extent ../../../../layers/graphics/data/QueryEngine ../../../../layers/support/FieldsIndex ../../../../rest/support/FeatureSet ../../../../rest/support/Query ../../../../geometry/support/typeUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){const m=g.QueryEngine;a.QueryEngine=class extends l{get layer(){return this.context.layer}get spatialReference(){return this.context.spatialReference}get _queryGeometryType(){switch(this.layer.geometryType){case "multipoint":case "point":case "polygon":case "polyline":return this.layer.geometryType;case "mesh":return"polygon"}}get defaultQueryJSON(){return(new w({outSpatialReference:this.spatialReference})).toJSON()}get _dataQueryEngine(){return this._ensureDataQueryEngine()}constructor(r){super(r);
this._dataQueryEngineInstance=null}destroy(){this.clear()}clear(){return this._dataQueryEngineInstance?(this._dataQueryEngineInstance.destroy(),this._dataQueryEngineInstance=null,!0):!1}async executeQueryForIdSet(r,n,u){return this._dataQueryEngine.executeQueryForIdSet(this._ensureQueryJSON(r,n),u)}async executeQueryForCount(r,n){return this._dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(r),n)}async executeQueryForExtent(r,n){const {count:u,extent:x}=await this._dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(r),
n);r=e.fromJSON(x);return{count:u,extent:r}}async executeQueryForIds(r,n){return this._dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(r),n)}async executeQueryForLatestObservations(r,n){r=await this._dataQueryEngine.executeQueryForLatestObservations(this._ensureQueryJSON(r),n);r=t.fromJSON(r);r.features.forEach(u=>{u.layer=this.layer;u.sourceLayer=this.layer});return r}async executeQuery(r,n){r=await this._dataQueryEngine.executeQuery(this._ensureQueryJSON(r),n);r=t.fromJSON(r);r.features.forEach(u=>
{u.layer=this.layer;u.sourceLayer=this.layer});return r}_ensureQueryJSON(r,n){let u=this.defaultQueryJSON;null!=r&&("outSpatialReference"in r&&!r.outSpatialReference&&(r.outSpatialReference=this.spatialReference),u=r.toJSON());null!=n&&(r=n.geometries.map(x=>x.toJSON()).reduce((x,y)=>{x.rings=x.rings.concat(y.rings);return x}),u={...u,sceneFilter:{...n,geometry:r}});return u}_ensureDataQueryEngine(){if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;const r="timeInfo"in this.layer&&
this.layer.timeInfo?.toJSON()||null,n=this.layer.objectIdField,u=v.featureGeometryTypeKebabDictionary.toJSON(this._queryGeometryType),x=this.layer.fieldsIndex?.toJSON()||new d([]),y=this.priority,z=this.spatialReference.toJSON(),{hasZ:A,hasM:B,featureStore:C,scheduler:D}=this.context;return this._dataQueryEngineInstance=new m({hasZ:A,hasM:B,geometryType:u,fieldsIndex:x,timeInfo:r,spatialReference:z,objectIdField:n,featureStore:C,scheduler:D,priority:y})}};b.__decorate([p.property({constructOnly:!0})],
a.QueryEngine.prototype,"context",void 0);b.__decorate([p.property({constructOnly:!0})],a.QueryEngine.prototype,"priority",void 0);b.__decorate([p.property()],a.QueryEngine.prototype,"layer",null);b.__decorate([p.property()],a.QueryEngine.prototype,"spatialReference",null);b.__decorate([p.property()],a.QueryEngine.prototype,"_queryGeometryType",null);b.__decorate([p.property()],a.QueryEngine.prototype,"defaultQueryJSON",null);a.QueryEngine=b.__decorate([c.subclass("esri.views.3d.layers.graphics.QueryEngine")],
a.QueryEngine);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/QueryEngine":function(){define("exports ../../../core/arrayUtils ../../../core/Error ../../../core/JSONSupport ../../../core/lang ../../../core/maybe ../../../core/MemCache ../../../core/promiseUtils ../../../core/unitUtils ../../../geometry/projection ../../../geometry/support/aaBoundingBox ../../../geometry/support/aaBoundingRect ../../../geometry/support/boundsUtils ../../../geometry/support/jsonUtils ../../../geometry/support/normalizeUtils ../../../geometry/support/spatialReferenceUtils ../featureConversionUtils ./attributeSupport ./geometryUtils ./projectionSupport ./QueryEngineCapabilities ./QueryEngineResult ./queryUtils ./queryValidationUtils ./spatialQuerySupport ./timeSupport ../../support/FieldsIndex ../../../views/support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H){function N(L){if(C.canQueryWithRBush(L)){if(w.isExtent(L))return[d.fromValues(Math.min(L.xmin,L.xmax),Math.min(L.ymin,L.ymax),Math.max(L.xmin,L.xmax),Math.max(L.ymin,L.ymax))];if(w.isPolygon(L))return L.rings.map(P=>d.fromValues(Math.min(P[0][0],P[2][0]),Math.min(P[0][1],P[2][1]),Math.max(P[0][0],P[2][0]),Math.max(P[0][1],P[2][1])))}return[t.getBoundsXY(d.create(),L)]}class E{constructor(L,P=null,M,K,J){this.attributes=L;this.geometry=
M;this.centroid=K;this.filterFlags=J;this.groupId=-1;this.displayId=P}}const G=new h.MemCacheStorage(2E6);let I=0;class O{constructor(L){this._changeHandle=this._geometryQueryCache=null;this.capabilities={query:y.queryCapabilities};this.geometryType=L.geometryType;this.hasM=!!L.hasM;this.hasZ=!!L.hasZ;this.objectIdField=L.objectIdField;this.spatialReference=L.spatialReference;this.definitionExpression=L.definitionExpression;this.featureStore=L.featureStore;this.aggregateAdapter=L.aggregateAdapter;
this._changeHandle=this.featureStore.events.on("changed",()=>this.clearCache());this.timeInfo=L.timeInfo;L.cacheSpatialQueries&&(this._geometryQueryCache=new h.MemCache(I++ +"$$",G));this.fieldsIndex=l.isSerializable(L.fieldsIndex)?L.fieldsIndex:F.fromJSON(L.fieldsIndex);this.availableFields=!L.availableFields||1===L.availableFields.length&&"*"===L.availableFields[0]?new Set(this.fieldsIndex.fields.map(P=>P.name)):new Set(L.availableFields.map(P=>this.fieldsIndex.get(P)?.name).filter(P=>null!=P));
L.scheduler&&L.priority&&(this._frameTask=L.scheduler.registerTask(L.priority))}destroy(){this._frameTask=k.removeMaybe(this._frameTask);this.clearCache();k.destroyMaybe(this._geometryQueryCache);this._changeHandle=k.removeMaybe(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._geometryQueryCache?.clear();this._fullExtentPromise=this._timeExtentPromise=this._allFeaturesPromise=null}async executeQuery(L,P){P=f.signalFromSignalOrOptions(P);try{return(await this._executeQuery(L,
{},P)).createQueryResponse()}catch(M){if(M!==A.queryEngineEmptyResult)throw M;return(new z.QueryEngineResult([],L,this)).createQueryResponse()}}async executeQueryForCount(L={},P){P=f.signalFromSignalOrOptions(P);try{return(await this._executeQuery(L,{returnGeometry:!1,returnCentroid:!1,outSR:null},P)).createQueryResponseForCount()}catch(M){if(M!==A.queryEngineEmptyResult)throw M;return 0}}async executeQueryForExtent(L,P){P=f.signalFromSignalOrOptions(P);const M=L.outSR;try{const K=await this._executeQuery(L,
{returnGeometry:!0,returnCentroid:!1,outSR:null},P),J=K.size;if(!J)return{count:0,extent:null};const R=await this._getBounds(K.items,K.spatialReference,M||this.spatialReference);return{count:J,extent:R}}catch(K){if(K===A.queryEngineEmptyResult)return{count:0,extent:null};throw K;}}async executeQueryForIds(L,P){return this.executeQueryForIdSet(L,P).then(M=>Array.from(M))}async executeQueryForIdSet(L,P){P=f.signalFromSignalOrOptions(P);try{const M=await this._executeQuery(L,{returnGeometry:!0,returnCentroid:!1,
outSR:null},P),K=M.items,J=new Set;await this._reschedule(()=>{for(const R of K)J.add(M.featureAdapter.getObjectId(R))},P);return J}catch(M){if(M===A.queryEngineEmptyResult)return new Set;throw M;}}async executeQueryForSnapping(L,P){const M=f.signalFromSignalOrOptions(P),{point:K,distance:J,returnEdge:R,vertexMode:Q}=L;if(!R&&"none"===Q)return{candidates:[]};let W=p.clone(L.query);W=await this._schedule(()=>A.normalizeQueryLike(W,this.definitionExpression,this.spatialReference),M);W=await this._reschedule(()=>
B.validateQuery(W,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),M);(P=!m.equals(K.spatialReference,this.spatialReference))&&await x.checkProjectionSupport(K.spatialReference,this.spatialReference);var S="number"===typeof J?J:J.x,V="number"===typeof J?J:J.y;S={xmin:K.x-S,xmax:K.x+S,ymin:K.y-V,ymax:K.y+V,spatialReference:K.spatialReference};S=P?x.project(S,this.spatialReference):S;if(!S)return{candidates:[]};
V=(await v.normalizeCentralMeridian(w.fromJSON(K),null,{signal:M}))[0];const T=(await v.normalizeCentralMeridian(w.fromJSON(S),null,{signal:M}))[0];if(null==V||null==T)return{candidates:[]};const Y=new z.QueryEngineResult(await this._reschedule(()=>this._searchFeatures(N(T.toJSON())),M),W,this);await this._reschedule(()=>this._executeObjectIdsQuery(Y),M);await this._reschedule(()=>this._executeTimeQuery(Y),M);await this._reschedule(()=>this._executeAttributesQuery(Y),M);await this._reschedule(()=>
this._executeGeometryQueryForSnapping(Y,M),M);V=V.toJSON();V=P?x.project(V,this.spatialReference):V;return Y.createSnappingResponse({...L,point:V,distance:P?Math.max(S.xmax-S.xmin,S.ymax-S.ymin)/2:J},K.spatialReference)}async executeQueryForLatestObservations(L,P){P=f.signalFromSignalOrOptions(P);if(!this.timeInfo?.trackIdField)throw new q("unsupported-query","Missing timeInfo or timeInfo.trackIdField",{query:L,timeInfo:this.timeInfo});try{const M=await this._executeQuery(L,{},P);await this._reschedule(()=>
this._filterLatest(M),P);return M.createQueryResponse()}catch(M){if(M!==A.queryEngineEmptyResult)throw M;return(new z.QueryEngineResult([],L,this)).createQueryResponse()}}async executeQueryForSummaryStatistics(L={},P,M){M=f.signalFromSignalOrOptions(M);const {field:K,normalizationField:J,valueExpression:R}=P;return(await this._executeQueryForStatistics(L,{field:K,normalizationField:J,valueExpression:R},M)).createSummaryStatisticsResponse(P)}async executeQueryForUniqueValues(L={},P,M){M=f.signalFromSignalOrOptions(M);
const {field:K,field2:J,field3:R,valueExpression:Q}=P;return(await this._executeQueryForStatistics(L,{field:K,field2:J,field3:R,valueExpression:Q},M)).createUniqueValuesResponse(P)}async executeQueryForClassBreaks(L={},P,M){M=f.signalFromSignalOrOptions(M);const {field:K,normalizationField:J,valueExpression:R}=P;return(await this._executeQueryForStatistics(L,{field:K,normalizationField:J,valueExpression:R},M)).createClassBreaksResponse(P)}async executeQueryForHistogram(L={},P,M){M=f.signalFromSignalOrOptions(M);
const {field:K,normalizationField:J,valueExpression:R}=P;return(await this._executeQueryForStatistics(L,{field:K,normalizationField:J,valueExpression:R},M)).createHistogramResponse(P)}async fetchRecomputedExtents(L){L=f.signalFromSignalOrOptions(L);this._timeExtentPromise||(this._timeExtentPromise=D.getTimeExtent(this.timeInfo,this.featureStore));const [P,M]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);f.throwIfAborted(L);return{fullExtent:P,timeExtent:M}}async _getBounds(L,
P,M){const K=g.set(g.create(),g.negativeInfinity);await this.featureStore.forEachBounds(L,J=>g.expandWithAABB(K,J));L={xmin:K[0],ymin:K[1],xmax:K[3],ymax:K[4],spatialReference:u.cleanFromGeometryEngine(this.spatialReference)};this.hasZ&&isFinite(K[2])&&isFinite(K[5])&&(L.zmin=K[2],L.zmax=K[5],L.hasZ=!0);P=x.project(L,P,M);P.spatialReference=u.cleanFromGeometryEngine(M);0===P.xmax-P.xmin&&(M=c.getMetersPerUnitForSR(P.spatialReference),P.xmin-=M,P.xmax+=M);0===P.ymax-P.ymin&&(M=c.getMetersPerUnitForSR(P.spatialReference),
P.ymin-=M,P.ymax+=M);this.hasZ&&null!=P.zmin&&null!=P.zmax&&0===P.zmax-P.zmin&&(M=c.getMetersPerUnitForSR(P.spatialReference),P.zmin-=M,P.zmax+=M);return P}_getFullExtent(){this._fullExtentPromise||(this._fullExtentPromise="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(L=>this._getBounds(L,this.spatialReference,this.spatialReference)));return this._fullExtentPromise}async _schedule(L,
P){return null!=this._frameTask?this._frameTask.schedule(L,P):L(H.noBudget)}async _reschedule(L,P){return null!=this._frameTask?this._frameTask.reschedule(L,P):L(H.noBudget)}async _getAllFeaturesQueryEngineResult(L){return new z.QueryEngineResult(await this._getAllFeatures(),L,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const M=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(K=>M.push(K))})().then(()=>M)}const L=this._allFeaturesPromise,P=await L;return L===
this._allFeaturesPromise?P.slice():this._getAllFeatures()}async _executeQuery(L,P,M){L=p.clone(L);L=await this._schedule(()=>A.normalizeQuery(L,this.definitionExpression,this.spatialReference),M);L=await this._reschedule(()=>B.validateQuery(L,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),M);L={...L,...P};const K=await this._reschedule(()=>this._executeSceneFilterQuery(L,M),M),J=await this._reschedule(()=>
this._executeGeometryQuery(L,K,M),M);await this._reschedule(()=>this._executeAggregateIdsQuery(J),M);await this._reschedule(()=>this._executeObjectIdsQuery(J),M);await this._reschedule(()=>this._executeTimeQuery(J),M);await this._reschedule(()=>this._executeAttributesQuery(J),M);return J}async _executeSceneFilterQuery(L,P){if(null==L.sceneFilter)return null;const {outSR:M,returnGeometry:K,returnCentroid:J}=L;var R=this.featureStore.featureSpatialReference,Q=L.sceneFilter.geometry;const W=null==R||
m.equals(R,Q.spatialReference)?Q:x.project(Q,R);if(!W)return null;R=K||J;R=m.isValid(M)&&!m.equals(this.spatialReference,M)&&R?async Y=>this._project(Y,M):Y=>Y;const S=this.featureAdapter;Q=await this._reschedule(()=>this._searchFeatures(N(W)),P);if("disjoint"===L.sceneFilter.spatialRelationship){if(!Q.length)return null;const Y=new Set;for(var V of Q)Y.add(S.getObjectId(V));const ha=await this._reschedule(()=>this._getAllFeatures(),P);V=await this._reschedule(async()=>{const ba=await C.getSpatialQueryOperator("esriSpatialRelDisjoint",
W,this.geometryType,this.hasZ,this.hasM),U=await this._runSpatialFilter(ha,Z=>!Y.has(S.getObjectId(Z))||ba(S.getGeometry(Z)),P);return new z.QueryEngineResult(U,L,this)},P);return R(V)}if(!Q.length)return new z.QueryEngineResult([],L,this);if(this._canExecuteSinglePass(W,L))return R(new z.QueryEngineResult(Q,L,this));const T=await C.getSpatialQueryOperator("esriSpatialRelContains",W,this.geometryType,this.hasZ,this.hasM);V=await this._runSpatialFilter(Q,Y=>T(S.getGeometry(Y)),P);return R(new z.QueryEngineResult(V,
L,this))}async _executeGeometryQuery(L,P,M){if(null!=P&&0===P.items.length)return P;L=null!=P?P.query:L;const {geometry:K,outSR:J,spatialRel:R,returnGeometry:Q,returnCentroid:W}=L;var S=this.featureStore.featureSpatialReference;const V=!K||null==S||m.equals(S,K.spatialReference)?K:x.project(K,S),T=Q||W,Y=m.isValid(J)&&!m.equals(this.spatialReference,J),ha=this._geometryQueryCache&&null==P?Y&&T?JSON.stringify({originalFilterGeometry:K,spatialRelationship:R,outSpatialReference:J}):JSON.stringify({originalFilterGeometry:K,
spatialRelationship:R}):null;S=ha?this._geometryQueryCache.get(ha):null;if(null!=S)return new z.QueryEngineResult(S,L,this);S=async ea=>{Y&&T&&await this._project(ea,J);ha&&this._geometryQueryCache.put(ha,ea.items,ea.items.length+1);return ea};if(!V)return S(null!=P?P:await this._getAllFeaturesQueryEngineResult(L));const ba=this.featureAdapter;let U=await this._reschedule(()=>this._searchFeatures(N(K)),M);if("esriSpatialRelDisjoint"===R){if(!U.length)return S(null!=P?P:await this._getAllFeaturesQueryEngineResult(L));
const ea=new Set;for(var Z of U)ea.add(ba.getObjectId(Z));const da=null!=P?P.items:await this._reschedule(()=>this._getAllFeatures(),M);Z=await this._reschedule(async()=>{const ia=await C.getSpatialQueryOperator(R,V,this.geometryType,this.hasZ,this.hasM),ka=await this._runSpatialFilter(da,fa=>!ea.has(ba.getObjectId(fa))||ia(ba.getGeometry(fa)),M);return new z.QueryEngineResult(ka,L,this)},M);return S(Z)}if(null!=P){const ea=new b.PositionHint;U=U.filter(da=>0<=b.indexOf(P.items,da,P.items.length,
ea))}if(!U.length)return S=new z.QueryEngineResult([],L,this),ha&&this._geometryQueryCache.put(ha,S.items,1),S;if(this._canExecuteSinglePass(V,L))return S(new z.QueryEngineResult(U,L,this));const ca=await C.getSpatialQueryOperator(R,V,this.geometryType,this.hasZ,this.hasM);Z=await this._runSpatialFilter(U,ea=>ca(ba.getGeometry(ea)),M);return S(new z.QueryEngineResult(Z,L,this))}async _executeGeometryQueryForSnapping(L,P){const {query:M}=L,{spatialRel:K}=M;if(L?.items?.length&&M.geometry&&K){var J=
await C.getSpatialQueryOperator(K,M.geometry,this.geometryType,this.hasZ,this.hasM);P=await this._runSpatialFilter(L.items,R=>J(R.geometry),P);L.items=P}}_executeAggregateIdsQuery(L){if(0!==L.items.length&&L.query.aggregateIds?.length&&null!=this.aggregateAdapter){var P=new Set;for(const K of L.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(K).forEach(J=>P.add(J));var M=this.featureAdapter.getObjectId;L.items=L.items.filter(K=>P.has(M(K)))}}_executeObjectIdsQuery(L){if(0!==L.items.length&&
L.query.objectIds?.length){var P=new Set(L.query.objectIds),M=this.featureAdapter.getObjectId;L.items=L.items.filter(K=>P.has(M(K)))}}_executeTimeQuery(L){if(0!==L.items.length){var P=D.getTimeOperator(this.timeInfo,L.query.timeExtent,this.featureAdapter);null!=P&&(L.items=L.items.filter(P))}}_executeAttributesQuery(L){if(0!==L.items.length){var P=n.getWhereClause(L.query.where,this.fieldsIndex);if(P){if(!P.isStandardized)throw new TypeError("Where clause is not standardized");L.items=L.items.filter(M=>
P.testFeature(M,this.featureAdapter))}}}async _runSpatialFilter(L,P,M){if(!P)return L;if(null==this._frameTask)return L.filter(Q=>P(Q));let K=0;const J=[],R=async Q=>{for(;K<L.length;){const W=L[K++];P(W)&&(J.push(W),Q.madeProgress());Q.done&&await this._reschedule(S=>R(S),M)}};return this._reschedule(Q=>R(Q),M).then(()=>J)}_filterLatest(L){const {trackIdField:P,startTimeField:M,endTimeField:K}=this.timeInfo,J=K||M,R=new Map,Q=this.featureAdapter.getAttribute;for(const W of L.items){const S=Q(W,P),
V=Q(W,J),T=R.get(S);(!T||V>Q(T,J))&&R.set(S,W)}L.items=Array.from(R.values())}_canExecuteSinglePass(L,P){({spatialRel:P}=P);return C.canQueryWithRBush(L)&&("esriSpatialRelEnvelopeIntersects"===P||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===P||"esriSpatialRelContains"===P))}async _project(L,P){if(!P||m.equals(this.spatialReference,P))return L;const M=this.featureAdapter;let K=void 0;try{const J=await this._getFullExtent();K=e.getTransformation(this.spatialReference,P,J)}catch{}P=
await x.projectMany(L.items.map(J=>u.getGeometry(this.geometryType,this.hasZ,this.hasM,M.getGeometry(J))),this.spatialReference,P,K);L.items=P.map((J,R)=>M.cloneWithGeometry(L.items[R],r.convertFromGeometry(J,this.hasZ,this.hasM)));return L}async _searchFeatures(L){const P=new Set;await Promise.all(L.map(M=>this.featureStore.forEachInBounds(M,K=>P.add(K))));L=Array.from(P.values());P.clear();return L}async _executeQueryForStatistics(L,P,M){L=p.clone(L);try{L=await this._schedule(()=>A.normalizeQuery(L,
this.definitionExpression,this.spatialReference),M);L=await this._reschedule(()=>B.validateStatisticsQuery(L,P,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),M);const K=await this._reschedule(()=>this._executeSceneFilterQuery(L,M),M),J=await this._reschedule(()=>this._executeGeometryQuery(L,K,M),M);await this._reschedule(()=>this._executeAggregateIdsQuery(J),M);await this._reschedule(()=>this._executeObjectIdsQuery(J),
M);await this._reschedule(()=>this._executeTimeQuery(J),M);await this._reschedule(()=>this._executeAttributesQuery(J),M);return J}catch(K){if(K!==A.queryEngineEmptyResult)throw K;return new z.QueryEngineResult([],L,this)}}}a.Feature=E;a.QueryEngine=O;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/attributeSupport":function(){define(["exports","../../../core/Error","../../../core/sql/WhereClauseCache","../../support/fieldType"],function(a,b,q,l){function p(w,
v,m={}){const r=k(v,w);if(!r)throw m=g.getError(v,w),new b("unsupported-query","invalid SQL expression",{expression:v,error:m});w=m.expressionName||"expression";if(m.validateStandardized&&!r.isStandardized)throw new b("unsupported-query",`${w} is not standard`,{expression:v});if(m.validateAggregate&&!r.isAggregate)throw new b("unsupported-query",`${w} does not contain a valid aggregate function`,{expression:v});return r.fieldNames}function k(w,v){return w?g.get(w,v):null}function h(w){return/\((.*?)\)/.test(w)?
w:w.split(" as ")[0]}function f(w,v,m,r={}){const n=new Map;c(n,w,v,r.allowedFieldTypes??t,m);if(n.size)throw new b("unsupported-query",`${r.expressionName??"expression"} contains invalid or missing fields`,{errors:Array.from(n.values()),query:r.query});}function c(w,v,m,r,n){n=n.includes("*")?[...m,...n.filter(u=>"*"!==u)]:n;for(const u of n)if(v.get(u))e(w,v,m,r,u);else try{const x=h(u),y=p(v,x,{validateStandardized:!0});for(const z of y)e(w,v,m,r,z)}catch(x){w.set(u,{type:"expression-error",expression:u,
error:x})}}function e(w,v,m,r,n){(v=v.get(n))?m.has(v.name)?"all"!==r&&!1===r?.has(v.type)&&w.set(n,{type:"invalid-type",fieldName:v.name,fieldType:l.kebabDict.fromJSON(v.type),allowedFieldTypes:Array.from(r,u=>l.kebabDict.fromJSON(u))}):w.set(n,{type:"missing-field",fieldName:v.name}):w.set(n,{type:"invalid-field",fieldName:n})}const g=new q.WhereClauseCache(50,500);q=new Set("esriFieldTypeOID esriFieldTypeSmallInteger esriFieldTypeBigInteger esriFieldTypeInteger esriFieldTypeSingle esriFieldTypeDouble esriFieldTypeLong".split(" "));
const d=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),t=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...q,...d]);a.allDateAndTimeFieldTypes=d;a.getAliasFromFieldName=function(w){return w.split(" as ")[1]};a.getExpressionFromFieldName=h;a.getWhereClause=k;a.numericFieldTypes=q;a.validateFields=f;a.validateHaving=function(w,v,m,r,n){if(!m)return!0;const u=p(w,m,{validateAggregate:!0,expressionName:"having clause"});
f(w,v,u,{expressionName:"having clause",query:n});if(!k(m,w)?.getExpressions().every(x=>{const {aggregateType:y,field:z}=x,A=w.get(z)?.name;return r.some(B=>{const {onStatisticField:C,statisticType:D}=B;return w.get(C)?.name===A&&D.toLowerCase().trim()===y})}))throw new b("unsupported-query","expressions in having clause should also exist in outStatistics",{having:m});return!0};a.validateWhere=function(w,v,m,r){if(!m)return!0;m=p(w,m,{validateStandardized:!0,expressionName:"where clause"});f(w,v,
m,{expressionName:"where clause",query:r});return!0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/WhereClauseCache":function(){define(["exports","../LRUCache","./WhereClause"],function(a,b,q){class l{constructor(p,k){this._cache=new b.LRUCache(p);this._invalidCache=new b.LRUCache(k)}get(p,k){const h=`${k.uid}:${p}`,f=this._cache.get(h);if(f)return f;if(null!=this._invalidCache.get(h))return null;try{const c=q.WhereClause.create(p,k);this._cache.put(h,c);return c}catch(c){return this._invalidCache.put(h,
c),null}}getError(p,k){return this._invalidCache.get(`${k.uid}:${p}`)??null}}a.WhereClauseCache=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/WhereClause":function(){define("exports ../../arcade/ArcadeDate ../../arcade/featureset/support/errorsupport ../has ./AggregateFunctions ./DateOnly ./sqlArithmeticUtils ./sqlCompareUtils ./sqlDateParsingUtils ./SqlInterval ./SqlTimestampOffset ./StandardizedFunctions ./TimeOnly ./WhereGrammar ../../chunks/datetime".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v){function m(H){return Array.isArray(H)?H:[H]}function r(H){return null!==H?!0!==H:null}function n(H,N){return null!=H&&null!=N?!0===H&&!0===N:!1===H||!1===N?!1:null}function u(H,N){return null!=H&&null!=N?!0===H||!0===N:!0===H||!0===N?!0:null}function x(H,N,E){if(null==H)return null;E=!1;for(const G of N)if(null==G)E=null;else if(H===G){E=!0;break}else if(f.isDateOrTimeValue(H)&&f.isDateOrTimeValue(G)&&(E=f.sqlCompare(H,G,"\x3d")))break;return E}function y(H,
N,E){if(null==H)return null;let G="",I=D.Normal;for(let O=0;O<N.length;O++){const L=N.charAt(O);switch(I){case D.Normal:L===E?I=D.Escaped:G="-[]/{}()*+?.\\^$|".includes(L)?G+("\\"+L):"%"===L?G+".*":"_"===L?G+".":G+L;break;case D.Escaped:G="-[]/{}()*+?.\\^$|".includes(L)?G+("\\"+L):G+L,I=D.Normal}}return(new RegExp("^"+G+"$","m")).test(H)}function z(H,N,E,G){H=G.getAttribute(H,N);N=E?.get(N);return null==H||"esriFieldTypeDate"!==N?.type&&"date"!==N?.type?null==H||"esriFieldTypeDateOnly"!==N?.type&&
"date-only"!==N?.type?null==H||"esriFieldTypeTimeOnly"!==N?.type&&"time-only"!==N?.type?null==H||"esriFieldTypeTimestampOffset"!==N?.type&&"timestamp-offset"!==N?.type?H:new g.SqlTimeStampOffset(H):t.TimeOnly.fromReader(H):k.DateOnly.fromReader(H):c.convertToExecutingTimeZone(new Date(H),E?.getLuxonTimeZone(N.name)??v.FixedOffsetZone.utcInstance)}const A=new Set(["current_timestamp","current_date","current_time"]);class B{static makeBool(H){return!0===H}static featureValue(H,N,E,G){return z(H,N,E,
G)}static equalsNull(H){return null===H}static applyLike(H,N,E){return y(H,N,E)}static ensureArray(H){return m(H)}static applyIn(H,N,E){return x(H,N)}static currentDate(H){return k.DateOnly.fromNow(H)}static makeSqlInterval(H,N,E){return e.SqlInterval.createFromValueAndQualifier(H,N,E)}static convertInterval(H){return H instanceof e.SqlInterval?H.valueInMilliseconds():H}static currentTimestamp(H){return c.convertToExecutingTimeZone(new Date,H)}static compare(H,N,E,G){return f.sqlCompare(N,E,H)}static calculate(H,
N,E,G){return h.sqlCalculateFunction(H,N,E,G)}static evaluateTime(H){return c.parseTime(H)}static evaluateTimestamp(H,N,E){return c.parseTimestamp(H,N,E)}static evaluateDate(H,N){return c.parseDate(H,N)}static evaluateFunction(H,N,E){return d.evaluateFunction(H,N,E)}static lookup(H,N){H=N[H];return void 0===H?null:H}static between(H,N,E){return null==H||null==N[0]||null==N[1]?null:f.sqlCompare(H,N[0],"\x3e\x3d")&&f.sqlCompare(H,N[1],"\x3c\x3d")}static notbetween(H,N,E){return null==H||null==N[0]||
null==N[1]?null:f.sqlCompare(H,N[0],"\x3c")||f.sqlCompare(H,N[1],"\x3e")}static ternaryNot(H){return r(H)}static ternaryAnd(H,N){return n(H,N)}static ternaryOr(H,N){return u(H,N)}}class C{constructor(H,N,E="UTC"){this.fieldsIndex=N;this.timeZone=E;this.parameters={};this._hasDateFunctions=void 0;this.parseTree=w.WhereGrammar.parse(H);const {isStandardized:G,isAggregate:I,referencedFieldNames:O}=this._extractExpressionInfo(N);this._referencedFieldNames=O;this.isStandardized=G;this.isAggregate=I}static convertValueToStorageFormat(H,
N=null){if(null===N)return c.isDate(H)?H.getTime():c.isDateTime(H)?H.toMillis():c.isTimestampOffset(H)?H.toStorageFormat():c.isTimeOnly(H)?H.toStorageString():c.isDateOnly(H)?H.toStorageFormat():H;switch(N){case "date":if(c.isDate(H))return H.getTime();if(c.isDateTime(H))return H.toMillis();if(c.isTimestampOffset(H))return H.toMilliseconds();if(c.isDateOnly(H))return H.toNumber();break;case "date-only":if(c.isDate(H))return k.DateOnly.fromDateJS(H).toString();if(c.isTimestampOffset(H))return k.DateOnly.fromSqlTimeStampOffset(H).toString();
if(c.isDateTime(H))return k.DateOnly.fromDateTime(H).toString();break;case "time-only":if(c.isDate(H))return t.TimeOnly.fromDateJS(H).toStorageString();if(c.isDateTime(H))return t.TimeOnly.fromDateTime(H).toStorageString();if(c.isTimestampOffset(H))return t.TimeOnly.fromSqlTimeStampOffset(H).toStorageString();if(c.isTimeOnly(H))return H.toStorageString();break;case "timestamp-offset":if(c.isDate(H))return g.SqlTimeStampOffset.fromJSDate(H).toStorageFormat();if(c.isDateTime(H))return g.SqlTimeStampOffset.fromDateTime(H).toStorageFormat();
if(c.isTimestampOffset(H))return H.toStorageFormat()}return H}static create(H,N,E="UTC"){return new C(H,N,E)}get fieldNames(){return this._referencedFieldNames}testSet(H,N=F){return!!this._evaluateNode(this.parseTree,null,N,H)}calculateValue(H,N=F){H=this._evaluateNode(this.parseTree,H,N,null);return H instanceof e.SqlInterval?H.valueInMilliseconds()/864E5:H}calculateValueCompiled(H,N=F){if(null!=this.parseTree._compiledVersion)return this.parseTree._compiledVersion(H,this.parameters,N,this.fieldsIndex,
this.timeZone);if(l("esri-csp-restrictions"))return this.calculateValue(H,N);this._compileMe();return this.parseTree._compiledVersion(H,this.parameters,N,this.fieldsIndex,this.timeZone)}testFeature(H,N=F){return!!this._evaluateNode(this.parseTree,H,N,null)}testFeatureCompiled(H,N=F){if(null!=this.parseTree._compiledVersion)return!!this.parseTree._compiledVersion(H,this.parameters,N,this.fieldsIndex,this.timeZone);if(l("esri-csp-restrictions"))return this.testFeature(H,N);this._compileMe();return!!this.parseTree._compiledVersion(H,
this.parameters,N,this.fieldsIndex,this.timeZone)}get hasDateFunctions(){if(null!=this._hasDateFunctions)return this._hasDateFunctions;this._hasDateFunctions=!1;this._visitAll(this.parseTree,H=>{"current-time"===H.type?this._hasDateFunctions=!0:"function"===H.type&&(this._hasDateFunctions=this._hasDateFunctions||A.has(H.name.toLowerCase()))});return this._hasDateFunctions}getFunctions(){const H=new Set;this._visitAll(this.parseTree,N=>{"function"===N.type&&H.add(N.name.toLowerCase())});return Array.from(H)}getExpressions(){const H=
new Map;this._visitAll(this.parseTree,N=>{if("function"===N.type){const E=N.name.toLowerCase();N=N.args.value[0];if("column-reference"===N.type){N=N.column;const G=`${E}-${N}`;H.has(G)||H.set(G,{aggregateType:E,field:N})}}});return[...H.values()]}getVariables(){const H=new Set;this._visitAll(this.parseTree,N=>{"parameter"===N.type&&H.add(N.value.toLowerCase())});return Array.from(H)}_compileMe(){const H="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=
(new Function("feature","lookups","attributeAdapter","fieldsIndex","timeZone",H)).bind(B)}_extractExpressionInfo(H){const N=[],E=new Set;let G=!0,I=!1;this._visitAll(this.parseTree,O=>{switch(O.type){case "column-reference":var L=H?.get(O.column);let P;L?L=P=L.name??"":(P=O.column,L=P.toLowerCase());E.has(L)||(E.add(L),N.push(P));O.column=P;break;case "function":const {name:M,args:K}=O;O=K.value.length;G&&=d.isStandardized(M,O);!1===I&&(I=p.isAggregate(M,O))}});return{referencedFieldNames:Array.from(N),
isStandardized:G,isAggregate:I}}_visitAll(H,N){if(null!=H)switch(N(H),H.type){case "when-clause":this._visitAll(H.operand,N);this._visitAll(H.value,N);break;case "case-expression":for(const E of H.clauses)this._visitAll(E,N);"simple"===H.format&&this._visitAll(H.operand,N);null!==H.else&&this._visitAll(H.else,N);break;case "expression-list":for(const E of H.value)this._visitAll(E,N);break;case "unary-expression":this._visitAll(H.expr,N);break;case "binary-expression":this._visitAll(H.left,N);this._visitAll(H.right,
N);break;case "function":this._visitAll(H.args,N)}}evaluateNodeToJavaScript(H){switch(H.type){case "interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(H.value)+", "+JSON.stringify(H.qualifier)+","+JSON.stringify(H.op)+")";case "case-expression":var N="";if("simple"===H.format){var E=this.evaluateNodeToJavaScript(H.operand);N="( ";for(let G=0;G<H.clauses.length;G++)N+=" (this.compare('\x3d',"+E+","+this.evaluateNodeToJavaScript(H.clauses[G].operand)+") ? ("+this.evaluateNodeToJavaScript(H.clauses[G].value)+
") : "}else for(N="( ",E=0;E<H.clauses.length;E++)N+=" this.makeBool("+this.evaluateNodeToJavaScript(H.clauses[E].operand)+")\x3d\x3d\x3dtrue ? ("+this.evaluateNodeToJavaScript(H.clauses[E].value)+") : ";N=null!==H.else?N+this.evaluateNodeToJavaScript(H.else):N+"null";return N+" )";case "parameter":return"this.lookup("+JSON.stringify(H.value.toLowerCase())+",lookups)";case "expression-list":N="[";for(E of H.value)"["!==N&&(N+=","),N+=this.evaluateNodeToJavaScript(E);return N+"]";case "unary-expression":return"this.ternaryNot("+
this.evaluateNodeToJavaScript(H.expr)+")";case "binary-expression":switch(H.operator){case "AND":return"this.ternaryAnd("+this.evaluateNodeToJavaScript(H.left)+","+this.evaluateNodeToJavaScript(H.right)+" )";case "OR":return"this.ternaryOr("+this.evaluateNodeToJavaScript(H.left)+","+this.evaluateNodeToJavaScript(H.right)+" )";case "IS":if("null"!==H.right.type)throw new q.SqlError(q.SqlErrorCodes.UnsupportedIsRhs);return"this.equalsNull("+this.evaluateNodeToJavaScript(H.left)+")";case "ISNOT":if("null"!==
H.right.type)throw new q.SqlError(q.SqlErrorCodes.UnsupportedIsRhs);return"(!(this.equalsNull("+this.evaluateNodeToJavaScript(H.left)+")))";case "IN":return"this.applyIn("+this.evaluateNodeToJavaScript(H.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(H.right)+"), timeZone)";case "NOT IN":return"this.ternaryNot(this.applyIn("+this.evaluateNodeToJavaScript(H.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(H.right)+"), timeZone))";case "BETWEEN":return"this.between("+this.evaluateNodeToJavaScript(H.left)+
","+this.evaluateNodeToJavaScript(H.right)+", timeZone)";case "NOTBETWEEN":return"this.notbetween("+this.evaluateNodeToJavaScript(H.left)+","+this.evaluateNodeToJavaScript(H.right)+", timeZone)";case "LIKE":return"this.applyLike("+this.evaluateNodeToJavaScript(H.left)+","+this.evaluateNodeToJavaScript(H.right)+","+JSON.stringify(H.escape)+")";case "NOT LIKE":return"this.ternaryNot(this.applyLike("+this.evaluateNodeToJavaScript(H.left)+","+this.evaluateNodeToJavaScript(H.right)+","+JSON.stringify(H.escape)+
"))";case "\x3c\x3e":case "\x3c":case "\x3e":case "\x3e\x3d":case "\x3c\x3d":case "\x3d":return"this.compare("+JSON.stringify(H.operator)+","+this.evaluateNodeToJavaScript(H.left)+","+this.evaluateNodeToJavaScript(H.right)+", timeZone)";case "*":case "-":case "+":case "/":case "||":return"this.calculate("+JSON.stringify(H.operator)+","+this.evaluateNodeToJavaScript(H.left)+","+this.evaluateNodeToJavaScript(H.right)+", timeZone)"}throw new q.SqlError(q.SqlErrorCodes.UnsupportedOperator,{operator:H.operator});
case "null":case "boolean":case "string":case "number":return JSON.stringify(H.value);case "time":return"this.evaluateTime("+JSON.stringify(H.value)+")";case "date":return"this.evaluateDate("+JSON.stringify(H.value)+", 'unknown')";case "timestamp":return"this.evaluateTimestamp("+JSON.stringify(H.value)+", 'unknown')";case "current-time":return"date"===H.mode?"this.currentDate(timeZone)":"this.currentTimestamp(timeZone)";case "column-reference":return"this.featureValue(feature,"+JSON.stringify(H.column)+
",fieldsIndex,attributeAdapter)";case "function":return"this.evaluateFunction("+JSON.stringify(H.name)+","+this.evaluateNodeToJavaScript(H.args)+", timeZone)"}throw new q.SqlError(q.SqlErrorCodes.UnsupportedSyntax,{node:H.type});}_evaluateNode(H,N,E,G){switch(H.type){case "interval":return E=this._evaluateNode(H.value,N,E,G),e.SqlInterval.createFromValueAndQualifier(E,H.qualifier,H.op);case "case-expression":if("simple"===H.format){var I=this._evaluateNode(H.operand,N,E,G);for(var O=0;O<H.clauses.length;O++)if(f.sqlCompare(I,
this._evaluateNode(H.clauses[O].operand,N,E,G),"\x3d",this.timeZone))return this._evaluateNode(H.clauses[O].value,N,E,G)}else for(I=0;I<H.clauses.length;I++)if(!0===this._evaluateNode(H.clauses[I].operand,N,E,G))return this._evaluateNode(H.clauses[I].value,N,E,G);return null!==H.else?this._evaluateNode(H.else,N,E,G):null;case "parameter":return H=this.parameters[H.value.toLowerCase()],c.isDate(H)?v.DateTime.fromJSDate(H):H instanceof b.ArcadeDate?H.toDateTime():H;case "expression-list":I=[];for(var L of H.value)I.push(this._evaluateNode(L,
N,E,G));return I;case "unary-expression":return r(this._evaluateNode(H.expr,N,E,G));case "binary-expression":switch(H.operator){case "AND":return n(this._evaluateNode(H.left,N,E,G),this._evaluateNode(H.right,N,E,G));case "OR":return u(this._evaluateNode(H.left,N,E,G),this._evaluateNode(H.right,N,E,G));case "IS":if("null"!==H.right.type)throw new q.SqlError(q.SqlErrorCodes.UnsupportedIsRhs);return null===this._evaluateNode(H.left,N,E,G);case "ISNOT":if("null"!==H.right.type)throw new q.SqlError(q.SqlErrorCodes.UnsupportedIsRhs);
return null!==this._evaluateNode(H.left,N,E,G);case "IN":return I=m(this._evaluateNode(H.right,N,E,G)),x(this._evaluateNode(H.left,N,E,G),I,this.timeZone);case "NOT IN":return I=m(this._evaluateNode(H.right,N,E,G)),r(x(this._evaluateNode(H.left,N,E,G),I,this.timeZone));case "BETWEEN":return I=this._evaluateNode(H.left,N,E,G),H=this._evaluateNode(H.right,N,E,G),null==I||null==H[0]||null==H[1]?null:f.sqlCompare(I,H[0],"\x3e\x3d",this.timeZone)&&f.sqlCompare(I,H[1],"\x3c\x3d",this.timeZone);case "NOTBETWEEN":return I=
this._evaluateNode(H.left,N,E,G),H=this._evaluateNode(H.right,N,E,G),null==I||null==H[0]||null==H[1]?null:f.sqlCompare(I,H[0],"\x3c",this.timeZone)||f.sqlCompare(I,H[1],"\x3e",this.timeZone);case "LIKE":return y(this._evaluateNode(H.left,N,E,G),this._evaluateNode(H.right,N,E,G),H.escape);case "NOT LIKE":return r(y(this._evaluateNode(H.left,N,E,G),this._evaluateNode(H.right,N,E,G),H.escape));case "\x3c\x3e":case "\x3c":case "\x3e":case "\x3e\x3d":case "\x3c\x3d":case "\x3d":return f.sqlCompare(this._evaluateNode(H.left,
N,E,G),this._evaluateNode(H.right,N,E,G),H.operator,this.timeZone);case "-":case "+":case "*":case "/":case "||":return h.sqlCalculateFunction(H.operator,this._evaluateNode(H.left,N,E,G),this._evaluateNode(H.right,N,E,G),this.timeZone)}case "null":case "boolean":case "string":case "number":return H.value;case "date":return H.parsedValue??(H.parsedValue=c.parseDate(H.value,"unknown")),H.parsedValue;case "timestamp":return H.parsedValue??(H.parsedValue=c.parseTimestamp(H.value,"unknown")),H.parsedValue;
case "time":return c.parseTime(H.value);case "current-time":return"date"===H.mode?k.DateOnly.fromNow(this.timeZone):c.convertToExecutingTimeZone(new Date,this.timeZone);case "column-reference":return z(N,H.column,this.fieldsIndex,E);case "data-type":return H.value;case "function":if(this.isAggregate&&p.isAggregate(H.name,H.args.value.length)){N=[];for(I of H.args?.value||[]){L=[];for(O of G||[])L.push(this._evaluateNode(I,O,E,null));N.push(L)}return p.aggregateFunction(H.name,N)}E=this._evaluateNode(H.args,
N,E,G);return d.evaluateFunction(H.name,E,this.timeZone)}throw new q.SqlError(q.SqlErrorCodes.UnsupportedSyntax,{node:H.type});}}var D;(function(H){H[H.Normal=0]="Normal";H[H.Escaped=1]="Escaped"})(D||={});const F={getAttribute(H,N){return(H&&"object"===typeof H.attributes?H.attributes:H)[N]}};a.WhereClause=C;a.defaultAttributeAdapter=F;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/ArcadeDate":function(){define(["exports","../core/string","../core/sql/UnknownTimeZone",
"../chunks/datetime"],function(a,b,q,l){function p(e,g,d){return e<g?e-g:e>d?e-d:0}function k(e,g=!0){if(e instanceof l.Zone)return e;if("system"===e.toLowerCase())return"system";if("utc"===e.toLowerCase())return"UTC";if("unknown"===e.toLowerCase())return q.UnknownTimeZone.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(e)){const d=l.FixedOffsetZone.parseSpecifier("UTC"+(e.startsWith("+")||e.startsWith("-")?"":"+")+e);if(d)return d}e=l.IANAZone.create(e);if(!e.isValid){if(g)throw new f(a.ArcadeDateErrorCodes.TimeZoneNotRecognized);
return null}return e}a.ArcadeDateErrorCodes=void 0;(a.ArcadeDateErrorCodes||(a.ArcadeDateErrorCodes={})).TimeZoneNotRecognized="TimeZoneNotRecognized";const h={[a.ArcadeDateErrorCodes.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class f extends Error{constructor(e,g){super(b.replace(h[e],g));this.declaredRootClass="esri.arcade.arcadedate.dateerror";Error.captureStackTrace&&Error.captureStackTrace(this,f)}}class c{constructor(e){this._date=e;this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=
0,g=1,d=1,t=0,w=0,v=0,m=0,r){if(isNaN(e)||isNaN(g)||isNaN(d)||isNaN(t)||isNaN(w)||isNaN(v)||isNaN(m))return null;const n=l.DateTime.local(e,g).daysInMonth;e=l.DateTime.fromObject({day:1>d?1:d>n?n:d,year:e,month:1>g?1:12<g?12:g,hour:0>t?0:23<t?23:t,minute:0>w?0:59<w?59:w,second:0>v?0:59<v?59:v,millisecond:0>m?0:999<m?999:m},{zone:k(r)});e=e.plus({months:p(g,1,12),days:p(d,1,n),hours:p(t,0,23),minutes:p(w,0,59),seconds:p(v,0,59),milliseconds:p(m,0,999)});return new c(e)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??
"system"}static arcadeDateAndZoneToArcadeDate(e,g){g=k(g);return e.isUnknownTimeZone||g===q.UnknownTimeZone.instance?c.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,g):new c(e._date.setZone(g))}static dateJSToArcadeDate(e){return new c(l.DateTime.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,g="system"){g=k(g);return new c(l.DateTime.fromJSDate(e,{zone:g}))}static unknownEpochToArcadeDate(e){return new c(l.DateTime.fromMillis(e,{zone:q.UnknownTimeZone.instance}))}static unknownDateJSToArcadeDate(e){return new c(l.DateTime.fromMillis(e.getTime(),
{zone:q.UnknownTimeZone.instance}))}static epochToArcadeDate(e,g="system"){g=k(g);return new c(l.DateTime.fromMillis(e,{zone:g}))}static dateTimeToArcadeDate(e){return new c(e)}clone(){return new c(this._date)}changeTimeZone(e){e=k(e);return c.dateTimeToArcadeDate(this._date.setZone(e))}static dateTimeAndZoneToArcadeDate(e,g){g=k(g);return e.zone===q.UnknownTimeZone.instance||g===q.UnknownTimeZone.instance?c.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,g):new c(e.setZone(g))}static nowToArcadeDate(e){e=
k(e);return new c(l.DateTime.fromJSDate(new Date,{zone:e}))}static nowUTCToArcadeDate(){return new c(l.DateTime.utc())}get isSystem(){return"system"===this.timeZone||this.timeZone===c.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone!==e.isUnknownTimeZone?!1:this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===q.UnknownTimeZone.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=
this._date.weekday;6<e&&(e=0);return e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if("system"===this._date.zone.type)return"system";
const e=this.zone;return"fixed"===e.type?0===e.fixed?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new c(this._date.plus(e))}diff(e,g="milliseconds"){return this._date.diff(e._date,g)[g]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,g){return this._date.toISOTime({suppressMilliseconds:e,
includeOffset:g&&!this.isUnknownTimeZone})}toFormat(e,g){this.isUnknownTimeZone&&(e=e.replaceAll("Z",""));return this._date.toFormat(e,g)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new c(this._date.toUTC())}toLocal(){return new c(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;
e=l.DateTime.fromISO(e,{setZone:!0});return new c(e)}}a.ArcadeDate=c;a.ArcadeDateError=f;a.arcadeDateErrorMessages=h;a.createDateTimeZone=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/featureset/support/errorsupport":function(){define(["exports","../../../core/string"],function(a,b){a.SqlErrorCodes=void 0;(function(h){h.InvalidFunctionParameters="InvalidFunctionParameters";h.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction";h.UnsupportedSqlFunction=
"UnsupportedSqlFunction";h.UnsupportedOperator="UnsupportedOperator";h.UnsupportedSyntax="UnsupportedSyntax";h.UnsupportedIsRhs="UnsupportedIsRhs";h.UnsupportedIsLhs="UnsupportedIsLhs";h.InvalidDataType="InvalidDataType";h.CannotCastValue="CannotCastValue";h.FunctionNotRecognized="FunctionNotRecognized";h.InvalidTime="InvalidTime";h.InvalidParameterCount="InvalidParameterCount";h.InvalidTimeStamp="InvalidTimeStamp";h.InvalidDate="InvalidDate";h.InvalidOperator="InvalidOperator";h.IllegalInterval=
"IllegalInterval";h.YearMonthIntervals="YearMonthIntervals";h.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers";h.MissingStatisticParameters="MissingStatisticParameters"})(a.SqlErrorCodes||(a.SqlErrorCodes={}));const q={[a.SqlErrorCodes.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[a.SqlErrorCodes.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[a.SqlErrorCodes.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[a.SqlErrorCodes.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",
[a.SqlErrorCodes.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[a.SqlErrorCodes.UnsupportedOperator]:"Unsupported operator - {operator}",[a.SqlErrorCodes.UnsupportedSyntax]:"Unsupported syntax - {node}",[a.SqlErrorCodes.UnsupportedSqlFunction]:"Sql function not found \x3d {function}",[a.SqlErrorCodes.InvalidDataType]:"Invalid sql data type",[a.SqlErrorCodes.InvalidDate]:"Invalid date encountered",[a.SqlErrorCodes.InvalidOperator]:"Invalid operator encountered",[a.SqlErrorCodes.InvalidTime]:"Invalid time encountered",
[a.SqlErrorCodes.IllegalInterval]:"Illegal interval",[a.SqlErrorCodes.FunctionNotRecognized]:"Function not recognized",[a.SqlErrorCodes.InvalidTimeStamp]:"Invalid timestamp encountered",[a.SqlErrorCodes.InvalidParameterCount]:"Invalid parameter count for call to {name}",[a.SqlErrorCodes.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[a.SqlErrorCodes.YearMonthIntervals]:"Year-Month Intervals not supported",[a.SqlErrorCodes.CannotCastValue]:"Cannot cast value to the required data type"};
class l extends Error{constructor(h,f){super(b.replace(q[h],f));this.declaredRootClass="esri.arcade.featureset.support.sqlerror";Error.captureStackTrace&&Error.captureStackTrace(this,l)}}a.FeatureSetErrorCodes=void 0;(function(h){h.NeverReach="NeverReach";h.NotImplemented="NotImplemented";h.Cancelled="Cancelled";h.InvalidStatResponse="InvalidStatResponse";h.InvalidRequest="InvalidRequest";h.RequestFailed="RequestFailed";h.MissingFeatures="MissingFeatures";h.AggregationFieldNotFound="AggregationFieldNotFound";
h.DataElementsNotFound="DataElementsNotFound"})(a.FeatureSetErrorCodes||(a.FeatureSetErrorCodes={}));const p={[a.FeatureSetErrorCodes.Cancelled]:"Cancelled",[a.FeatureSetErrorCodes.InvalidStatResponse]:"Invalid statistics response from service",[a.FeatureSetErrorCodes.InvalidRequest]:"Invalid request",[a.FeatureSetErrorCodes.RequestFailed]:"Request failed - {reason}",[a.FeatureSetErrorCodes.MissingFeatures]:"Missing features",[a.FeatureSetErrorCodes.AggregationFieldNotFound]:"Aggregation field not found",
[a.FeatureSetErrorCodes.DataElementsNotFound]:"Data elements not found on service",[a.FeatureSetErrorCodes.NeverReach]:"Encountered unreachable logic",[a.FeatureSetErrorCodes.NotImplemented]:"Not implemented"};class k extends Error{constructor(h,f){super(b.replace(p[h],f));this.declaredRootClass="esri.arcade.featureset.support.featureseterror";Error.captureStackTrace&&Error.captureStackTrace(this,k)}}a.FeatureSetError=k;a.SqlError=l;a.featureSetErrorMessages=p;a.sqlErrorMessages=q;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/AggregateFunctions":function(){define("exports ../../arcade/featureset/support/errorsupport ./DateOnly ./SqlTimestampOffset ./TimeOnly ../../chunks/datetime".split(" "),function(a,b,q,l,p,k){function h(g){if(null===g)return null;let d=0,t=0;for(let w=0;w<g.length;w++){const v=g[w];if(null!==v){if("number"!==typeof v)throw new b.SqlError(b.SqlErrorCodes.InvalidValueForAggregateFunction);t++;d+=v}}return 0===t?null:d/g.length}function f(g,d){if(null===
g)return null;let t=null,w=null;for(const v of g)g=v,g=v instanceof q.DateOnly?v.toNumber():v instanceof p.TimeOnly?v.toNumber():v instanceof k.DateTime?v.toMillis():v instanceof l.SqlTimeStampOffset?v.toMilliseconds():v,null===t?(t=v,w=g):"max"===d&&null!==w&&null!==g&&w<=g?(t=v,w=g):"min"===d&&null!==w&&null!==g&&w>=g&&(t=v,w=g);return t}function c(g){if(null===g)return null;g=g.filter(w=>null!==w);if(0===g.length)return null;const d=h(g);if(null===d)return null;let t=0;for(const w of g){if("number"!==
typeof w)throw new b.SqlError(b.SqlErrorCodes.InvalidValueForAggregateFunction);t+=(d-w)**2}return t/(g.length-1)}const e={min:{minParams:1,maxParams:1,evaluate:g=>f(g[0],"min")},max:{minParams:1,maxParams:1,evaluate:g=>f(g[0],"max")},avg:{minParams:1,maxParams:1,evaluate:g=>h(g[0])},sum:{minParams:1,maxParams:1,evaluate:g=>{g=g[0];if(null===g)g=null;else{var d=0;for(let t=0;t<g.length;t++){const w=g[t];if(null!==w){if("number"!==typeof w)throw new b.SqlError(b.SqlErrorCodes.InvalidValueForAggregateFunction);
d+=w}}g=d}return g}},stddev:{minParams:1,maxParams:1,evaluate:g=>{g=g[0];null===g?g=null:(g=c(g),g=null===g?null:Math.sqrt(g));return g}},count:{minParams:1,maxParams:1,evaluate:g=>null==g[0]?null:g[0].length},var:{minParams:1,maxParams:1,evaluate:g=>c(g[0])}};a.aggregateFunction=function(g,d){const t=e[g.toLowerCase()];if(null==t)throw new b.SqlError(b.SqlErrorCodes.FunctionNotRecognized);if(d.length<t.minParams||d.length>t.maxParams)throw new b.SqlError(b.SqlErrorCodes.InvalidParameterCount,{name:g.toUpperCase()});
return t.evaluate(d)};a.isAggregate=function(g,d){g=e[g.toLowerCase()];return null!=g&&d>=g.minParams&&d<=g.maxParams};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/DateOnly":function(){define(["exports","../../arcade/ArcadeDate","../../intl/locale","../../chunks/datetime"],function(a,b,q,l){function p(h){h=h.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$\x26]");let f="";const c=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
for(const e of h.match(c)||[])switch(e){case "D":f+="d";break;case "DD":f+="dd";break;case "DDD":f+="o";break;case "d":f+="c";break;case "ddd":f+="ccc";break;case "dddd":f+="cccc";break;case "M":f+="L";break;case "MM":f+="LL";break;case "MMM":f+="LLL";break;case "MMMM":f+="LLLL";break;case "YY":f+="yy";break;case "Y":case "YYYY":f+="yyyy";break;case "Q":f+="q";break;case "X":case "x":f+=e;break;default:f=2<=e.length&&"["===e.slice(0,1)&&"]"===e.slice(-1)?f+`'${e.slice(1,-1)}'`:f+`'${e}'`}return f}
class k{constructor(h,f,c){this._year=h;this._month=f;this._day=c;this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(h){return h instanceof k&&h.day===this.day&&h.month===this.month&&h.year===this.year}clone(){return new k(this._year,this._month,this._day)}toDateTime(h){return l.DateTime.fromObject({day:this.day,month:this.month,
year:this.year},{zone:b.createDateTimeZone(h)})}toDateTimeLuxon(h){return l.DateTime.fromObject({day:this.day,month:this.month,year:this.year},{zone:b.createDateTimeZone(h)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(h=null,f=!0){if(null===h||""===h)return this.toString();f&&(h=p(h));if(!h)return"";f=this.toDateTime("unknown");return b.ArcadeDate.dateTimeToArcadeDate(f).toFormat(h,{locale:q.getLocale(),
numberingSystem:"latn"})}toArcadeDate(){const h=this.toDateTime("unknown");return b.ArcadeDate.dateTimeToArcadeDate(h)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(h,f){return k.fromDateTime(this.toUTCDateTime().plus({[h]:f}))}toUTCDateTime(){return l.DateTime.utc(this.year,
this.month,this.day,0,0,0,0)}difference(h,f){switch(f.toLowerCase()){case "days":case "day":case "d":return this.toUTCDateTime().diff(h.toUTCDateTime(),"days").days;case "months":case "month":return this.toUTCDateTime().diff(h.toUTCDateTime(),"months").months;case "minutes":case "minute":case "m":return"M"===f?this.toUTCDateTime().diff(h.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(h.toUTCDateTime(),"minutes").minutes;case "seconds":case "second":case "s":return this.toUTCDateTime().diff(h.toUTCDateTime(),
"seconds").seconds;case "milliseconds":case "millisecond":case "ms":return this.toUTCDateTime().diff(h.toUTCDateTime(),"milliseconds").milliseconds;case "hours":case "hour":case "h":return this.toUTCDateTime().diff(h.toUTCDateTime(),"hours").hours;case "years":case "year":case "y":return this.toUTCDateTime().diff(h.toUTCDateTime(),"years").years;default:return this.toUTCDateTime().diff(h.toUTCDateTime(),"milliseconds").milliseconds}}static fromMilliseconds(h){h=l.DateTime.fromMillis(h,{zone:l.FixedOffsetZone.utcInstance});
return h.isValid?k.fromParts(h.year,h.month,h.day):null}static fromSeconds(h){h=l.DateTime.fromSeconds(h,{zone:l.FixedOffsetZone.utcInstance});return h.isValid?k.fromParts(h.year,h.month,h.day):null}static fromReader(h){if(!h)return null;h=h.split("-");return 3!==h.length?null:new k(parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10))}static fromParts(h,f,c){h=new k(h,f,c);return!1===h.isValid?null:h}static fromDateJS(h){return k.fromParts(h.getFullYear(),h.getMonth()+1,h.getDay())}static fromDateTime(h){return k.fromParts(h.year,
h.month,h.day)}static fromSqlTimeStampOffset(h){return this.fromDateTime(h.toDateTime())}static fromString(h,f=null){if(""===h||null===h)return null;var c=[];if(f)(f=p(f))&&c.push(f);else if(null===f||""===f)return h=l.DateTime.fromISO(h,{setZone:!0}),h.isValid?k.fromParts(h.year,h.month,h.day):null;for(const e of c)if(c=l.DateTime.fromFormat(h,f??e),c.isValid)return new k(c.year,c.month,c.day);return null}static fromNow(h="system"){h=l.DateTime.fromJSDate(new Date).setZone(b.createDateTimeZone(h));
return new k(h.year,h.month,h.day)}}a.DateOnly=k;a.standardizeDateOnlyFormat=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/SqlTimestampOffset":function(){define(["exports","../../chunks/datetime"],function(a,b){function q(p){return Number.isNaN(p)||0===p?p:Math.trunc(p)}class l{constructor(p){this._timeStampOffset=p;this._date=null}toDateTime(){this._date??(this._date=b.DateTime.fromISO(this._timeStampOffset,{setZone:!0}));return this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return q(this.toDateTime().offset/
60)}get timezoneOffsetMinutes(){return q(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return l.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(p){return new l(b.DateTime.fromJSDate(p).toISO({includeOffset:!0}))}static fromDateTime(p){return new l(p.toISO({includeOffset:!0}))}static fromParts(p,
k,h=0,f=0,c=0,e=0,g=0,d=!1,t=0,w=0){p=`${p.toString().padStart(4,"0")}-${k.toString().padStart(2,"0")}-${h.toString().padStart(2,"0")}`;k="";10>e&&(k="0");f=`${f.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${k+e.toString()}`;0!==g&&(f+="."+g.toString().padStart(3,"0"));g=`${d?"-":"+"}${t.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}`;return new l(p+"T"+f+g)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let p=this.toDateTime().toSQL({includeOffset:!0,
includeOffsetSpace:!0});p&&=p.replace(".000","");return p}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(p){p=this.toDateTime().plus(p);return l.fromDateTime(p)}}a.SqlTimeStampOffset=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/TimeOnly":function(){define(["exports","../../arcade/kernel","../../intl/locale","../../chunks/datetime"],function(a,b,q,l){function p(h){if(!h)return"";const f=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let c="";for(const e of h.match(f)||
[])switch(e){case "SSS":c+=e;break;case "A":case "a":c+="a";break;case "m":case "mm":case "h":case "hh":case "H":case "HH":case "s":case "ss":c+=e;break;default:c+=`'${e}'`}return c}class k{constructor(h,f,c,e){this._hour=h;this._minute=f;this._second=c;this._millisecond=e;this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(h){return h instanceof k&&h.hour===
this.hour&&h.minute===this.minute&&h.second===this.second&&h.millisecond===this.millisecond}clone(){return new k(this.hour,this.minute,this.second,this.millisecond)}isValid(){return b.isInteger(this.hour)&&b.isInteger(this.minute)&&b.isInteger(this.second)&&b.isInteger(this.millisecond)&&0<=this.hour&&24>this.hour&&0<=this.minute&&60>this.minute&&0<=this.second&&60>this.second&&0<=this.millisecond&&1E3>this.millisecond}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,
"0")}:${this.second.toString().padStart(2,"0")}`+(0<this.millisecond?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${0<this.millisecond?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,
"0")}`}toFormat(h=null){return null===h||""===h?this.toString():(h=p(h))?l.DateTime.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(h,{locale:q.getLocale(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1E3*this.second+6E4*this.minute+36E5*this.hour}static fromParts(h,f,c,e){h=new k(h,f,c,e);return h.isValid()?h:null}static fromReader(h){if(!h)return null;h=h.split(":");return 3!==h.length?null:new k(parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],
10),0)}static fromMilliseconds(h){return 864E5<h||0>h?null:new k(Math.floor(h/36E5%24),Math.floor(h/6E4%60),Math.floor(h/1E3%60),Math.floor(h%1E3))}static fromDateJS(h){return new k(h.getHours(),h.getMinutes(),h.getSeconds(),h.getMilliseconds())}static fromDateTime(h){return new k(h.hour,h.minute,h.second,h.millisecond)}static fromSqlTimeStampOffset(h){return this.fromDateTime(h.toDateTime())}static fromString(h,f=null){if(""===h||null===h)return null;const c=[];if(f)(f=p(f))&&c.push(f);else if(null===
f||""===f)c.push("HH:mm:ss"),c.push("HH:mm:ss.SSS"),c.push("hh:mm:ss a"),c.push("hh:mm:ss.SSS a"),c.push("HH:mm"),c.push("hh:mm a"),c.push("H:mm"),c.push("h:mm a"),c.push("H:mm:ss"),c.push("h:mm:ss a"),c.push("H:mm:ss.SSS"),c.push("h:mm:ss.SSS a");for(const e of c)if(f=l.DateTime.fromFormat(h,e),f.isValid)return new k(f.hour,f.minute,f.second,f.millisecond);return null}plus(h,f){switch(h){case "days":case "years":case "months":return this.clone();case "hours":case "minutes":case "seconds":case "milliseconds":return k.fromDateTime(this.toUTCDateTime().plus({[h]:f}))}return null}toUTCDateTime(){return l.DateTime.utc(1970,
1,1,this.hour,this.minute,this.second,this.millisecond)}difference(h,f){switch(f.toLowerCase()){case "days":case "day":case "d":return this.toUTCDateTime().diff(h.toUTCDateTime(),"days").days;case "months":case "month":return this.toUTCDateTime().diff(h.toUTCDateTime(),"months").months;case "minutes":case "minute":case "m":return"M"===f?this.toUTCDateTime().diff(h.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(h.toUTCDateTime(),"minutes").minutes;case "seconds":case "second":case "s":return this.toUTCDateTime().diff(h.toUTCDateTime(),
"seconds").seconds;case "milliseconds":case "millisecond":case "ms":return this.toUTCDateTime().diff(h.toUTCDateTime(),"milliseconds").milliseconds;case "hours":case "hour":case "h":return this.toUTCDateTime().diff(h.toUTCDateTime(),"hours").hours;case "years":case "year":case "y":return this.toUTCDateTime().diff(h.toUTCDateTime(),"years").years;default:return this.toUTCDateTime().diff(h.toUTCDateTime(),"milliseconds").milliseconds}}}a.TimeOnly=k;a.standardizeTimeFormat=p;Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"})})},"esri/arcade/kernel":function(){define(["exports","../geometry/Extent"],function(a,b){a.cloneGeometry=function(q){if(null==q)return null;const l=q.clone();void 0!==q.cache._geVersion&&(l.cache._geVersion=q.cache._geVersion);return l};a.convertLinearUnitsToCode=function(q){if(null==q)return null;if("number"===typeof q)return q;q=q.toLowerCase();q=q.replaceAll(/\s/g,"");q=q.replaceAll("-","");switch(q){case "meters":case "meter":case "m":case "squaremeters":case "squaremeter":return 9001;
case "miles":case "mile":case "squaremile":case "squaremiles":return 9093;case "kilometers":case "kilometer":case "squarekilometers":case "squarekilometer":case "km":return 9036;case "yard":case "yd":case "yards":case "squareyards":case "squareyard":return 9096;case "feet":case "ft":case "foot":case "squarefeet":case "squarefoot":return 9002;case "nmi":case "nauticalmile":case "nauticalmiles":case "squarenauticalmile":case "squarenauticalmiles":return 9030}return null};a.convertSquareUnitsToCode=
function(q){if(null==q)return null;if("number"===typeof q)return q;q=q.toLowerCase();q=q.replaceAll(/\s/g,"");q=q.replaceAll("-","");switch(q){case "meters":case "meter":case "m":case "squaremeters":case "squaremeter":return 109404;case "miles":case "mile":case "squaremile":case "squaremiles":return 109439;case "kilometers":case "kilometer":case "squarekilometers":case "squarekilometer":case "km":return 109414;case "acres":case "acre":case "ac":return 109402;case "hectares":case "hectare":case "ha":return 109401;
case "yard":case "yd":case "yards":case "squareyards":case "squareyard":return 109442;case "feet":case "ft":case "foot":case "squarefeet":case "squarefoot":return 109405;case "nmi":case "nauticalmile":case "nauticalmiles":case "squarenauticalmile":case "squarenauticalmiles":return 109409}return null};a.isInteger=function(q){return"number"===typeof q&&isFinite(q)&&Math.floor(q)===q};a.sameGeomType=function(q,l){return q===l||"point"===q&&"esriGeometryPoint"===l||"polyline"===q&&"esriGeometryPolyline"===
l||"polygon"===q&&"esriGeometryPolygon"===l||"extent"===q&&"esriGeometryEnvelope"===l||"multipoint"===q&&"esriGeometryMultipoint"===l||"point"===l&&"esriGeometryPoint"===q||"polyline"===l&&"esriGeometryPolyline"===q||"polygon"===l&&"esriGeometryPolygon"===q||"extent"===l&&"esriGeometryEnvelope"===q||"multipoint"===l&&"esriGeometryMultipoint"===q?!0:!1};a.shapeExtent=function(q){if(null==q)return null;switch(q.type){case "polygon":case "multipoint":case "polyline":return q.extent;case "point":return new b({xmin:q.x,
ymin:q.y,xmax:q.x,ymax:q.y,spatialReference:q.spatialReference});case "extent":return q}return null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/sqlArithmeticUtils":function(){define(["exports","../../arcade/featureset/support/errorsupport","./sqlDateParsingUtils","./SqlInterval","./StandardizedFunctions"],function(a,b,q,l,p){function k(fa,X,ja){switch(ja){case "+":return fa+X;case "-":return fa-X;case "*":return fa*X;case "/":return fa/X}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);
}function h(fa,X,ja){switch(ja){case "+":return X.plus({milliseconds:fa.valueInMilliseconds()});case "-":return fa.valueInMilliseconds()-X.toMillis()}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function f(fa,X,ja){switch(ja){case "+":return X.plus("milliseconds",fa.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function c(fa,X,ja){switch(ja){case "+":return X.plus("milliseconds",fa.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);
}function e(fa,X,ja){switch(ja){case "+":return fa.plus("milliseconds",X.valueInMilliseconds());case "-":return fa.plus("milliseconds",-1*X.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function g(fa,X,ja){switch(ja){case "+":return X.addMilliseconds(fa.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function d(fa,X,ja){switch(ja){case "+":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()+X.valueInMilliseconds());case "-":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()-
X.valueInMilliseconds());case "*":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()*X.valueInMilliseconds());case "/":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()/X.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function t(fa,X,ja){switch(ja){case "+":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()+X);case "-":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()-X);case "*":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()*
X);case "/":return l.SqlInterval.createFromMilliseconds(fa.valueInMilliseconds()/X)}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function w(fa,X,ja){switch(ja){case "+":return l.SqlInterval.createFromMilliseconds(fa+X.valueInMilliseconds());case "-":return l.SqlInterval.createFromMilliseconds(fa-X.valueInMilliseconds());case "*":return l.SqlInterval.createFromMilliseconds(fa*X.valueInMilliseconds());case "/":return l.SqlInterval.createFromMilliseconds(fa/X.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);
}function v(fa,X,ja){switch(ja){case "+":return fa.plus("milliseconds",X.valueInMilliseconds());case "-":return fa.plus("milliseconds",-1*X.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function m(fa,X,ja){switch(ja){case "+":return fa.plus({milliseconds:X.valueInMilliseconds()});case "-":return fa.minus({milliseconds:X.valueInMilliseconds()})}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function r(fa,X,ja){switch(ja){case "+":return fa.addMilliseconds(X.valueInMilliseconds());
case "-":return fa.addMilliseconds(-1*X.valueInMilliseconds())}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function n(fa,X,ja){X*=864E5;switch(ja){case "+":return fa.plus({milliseconds:X});case "-":return fa.minus({milliseconds:X})}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function u(fa,X,ja){X*=864E5;switch(ja){case "+":return fa.plus("milliseconds",X);case "-":return fa.plus("milliseconds",-1*X)}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function x(fa,X,ja){X*=
864E5;switch(ja){case "+":return fa.plus("milliseconds",X);case "-":return fa.plus("milliseconds",-1*X)}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function y(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function z(fa,X,ja){X*=864E5;switch(ja){case "+":return fa.addMilliseconds(X);case "-":return fa.addMilliseconds(-1*X)}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function A(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function B(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);
}function C(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function D(fa,X,ja){X=parseFloat(X);if(isNaN(X))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);return k(fa,X,ja)}function F(fa,X,ja){fa=parseFloat(fa);if(isNaN(fa))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);return k(fa,X,ja)}function H(fa,X,ja){switch(ja){case "+":return fa+X}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function N(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}
function E(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function G(fa,X,ja){switch(ja){case "-":return fa.toDateTimeLuxon(X.zone).diff(X).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function I(fa,X,ja){switch(ja){case "-":return fa.toDateTimeLuxon(X.toDateTime().zone).diff(X.toDateTime()).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function O(fa,X,ja){switch(ja){case "-":return fa.toDateTimeLuxon("UTC").diff(X.toDateTimeLuxon("UTC")).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);
}function L(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function P(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function M(fa,X,ja){switch(ja){case "-":return fa.toDateTime().diff(X.toDateTimeLuxon(fa.toDateTime().zone)).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function K(fa,X,ja){switch(ja){case "-":return fa.toDateTime().diff(X).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function J(fa,X,ja){switch(ja){case "-":return fa.toDateTime().diff(X.toDateTime()).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);
}function R(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function Q(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function W(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function S(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function V(fa,X,ja){switch(ja){case "-":return fa.diff(X).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function T(fa,X,ja){switch(ja){case "-":return fa.diff(X.toDateTimeLuxon(fa.zone)).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);
}function Y(fa,X,ja){switch(ja){case "-":return fa.diff(X.toDateTime()).as("days")}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function ha(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function ba(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function U(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function Z(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function ca(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);
}function ea(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function da(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function ia(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}function ka(fa,X,ja){throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}a.calculateDateOnlyAndDateOnly=O;a.calculateDateOnlyAndDateTime=G;a.calculateDateOnlyAndNumber=u;a.calculateDateOnlyAndSqlInterval=v;a.calculateDateOnlyAndString=ba;a.calculateDateOnlyAndTimeOnly=
L;a.calculateDateOnlyAndTimestamp=I;a.calculateDateTimeAndDateOnly=T;a.calculateDateTimeAndDateTime=V;a.calculateDateTimeAndNumber=n;a.calculateDateTimeAndSqlInterval=m;a.calculateDateTimeAndString=Z;a.calculateDateTimeAndTimeOnly=ha;a.calculateDateTimeAndTimestamp=Y;a.calculateNumberAndDateOnly=C;a.calculateNumberAndDateTime=y;a.calculateNumberAndNumber=k;a.calculateNumberAndSqlInterval=w;a.calculateNumberAndString=D;a.calculateNumberAndTimeOnly=B;a.calculateNumberAndTimestamp=A;a.calculateSqlIntervalAndDateOnly=
c;a.calculateSqlIntervalAndDateTime=h;a.calculateSqlIntervalAndNumber=t;a.calculateSqlIntervalAndSqlInterval=d;a.calculateSqlIntervalAndString=N;a.calculateSqlIntervalAndTimeOnly=f;a.calculateSqlIntervalAndTimestamp=g;a.calculateStringAndDateOnly=da;a.calculateStringAndDateTime=ia;a.calculateStringAndNumber=F;a.calculateStringAndSqlInterval=E;a.calculateStringAndString=H;a.calculateStringAndTimeOnly=ea;a.calculateStringAndTimestamp=ka;a.calculateTimeOnlyAndDateOnly=Q;a.calculateTimeOnlyAndDateTime=
R;a.calculateTimeOnlyAndNumber=x;a.calculateTimeOnlyAndSqlInterval=e;a.calculateTimeOnlyAndString=U;a.calculateTimeOnlyAndTimeOnly=S;a.calculateTimeOnlyAndTimestamp=W;a.calculateTimestampAndDateOnly=M;a.calculateTimestampAndDateTime=K;a.calculateTimestampAndNumber=z;a.calculateTimestampAndSqlInterval=r;a.calculateTimestampAndString=ca;a.calculateTimestampAndTimeOnly=P;a.calculateTimestampAndTimestamp=J;a.sqlCalculateFunction=function(fa,X,ja,la){if("||"===fa)return p.evaluateFunction("concat",[X,
ja],la);if(null===X||null===ja)return null;if(q.isNumber(X)){if(q.isNumber(ja))return k(X,ja,fa);if(q.isSqlInterval(ja))return w(X,ja,fa);if(q.isTimeOnly(ja))return B();if(q.isDateOnly(ja))return C();if(q.isTimestampOffset(ja))return A();if(q.isDateTime(ja))return y();if(q.isString(ja))return D(X,ja,fa)}else if(q.isDateOnly(X)){if(q.isNumber(ja))return u(X,ja,fa);if(q.isSqlInterval(ja))return v(X,ja,fa);if(q.isTimeOnly(ja))return L();if(q.isDateOnly(ja))return O(X,ja,fa);if(q.isTimestampOffset(ja))return I(X,
ja,fa);if(q.isDateTime(ja))return G(X,ja,fa);if(q.isString(ja))return ba()}else if(q.isTimeOnly(X)){if(q.isNumber(ja))return x(X,ja,fa);if(q.isSqlInterval(ja))return e(X,ja,fa);if(q.isTimeOnly(ja))return S();if(q.isDateOnly(ja))return Q();if(q.isTimestampOffset(ja))return W();if(q.isDateTime(ja))return R();if(q.isString(ja))return U()}else if(q.isSqlInterval(X)){if(q.isNumber(ja))return t(X,ja,fa);if(q.isSqlInterval(ja))return d(X,ja,fa);if(q.isTimeOnly(ja))return f(X,ja,fa);if(q.isDateOnly(ja))return c(X,
ja,fa);if(q.isTimestampOffset(ja))return g(X,ja,fa);if(q.isDateTime(ja))return h(X,ja,fa);if(q.isString(ja))return N()}else if(q.isDateTime(X)){if(q.isNumber(ja))return n(X,ja,fa);if(q.isSqlInterval(ja))return m(X,ja,fa);if(q.isTimeOnly(ja))return ha();if(q.isDateOnly(ja))return T(X,ja,fa);if(q.isTimestampOffset(ja))return Y(X,ja,fa);if(q.isDateTime(ja))return V(X,ja,fa);if(q.isString(ja))return Z()}else if(q.isTimestampOffset(X)){if(q.isNumber(ja))return z(X,ja,fa);if(q.isSqlInterval(ja))return r(X,
ja,fa);if(q.isTimeOnly(ja))return P();if(q.isDateOnly(ja))return M(X,ja,fa);if(q.isTimestampOffset(ja))return J(X,ja,fa);if(q.isDateTime(ja))return K(X,ja,fa);if(q.isString(ja))return ca()}else if(q.isString(X)){if(q.isNumber(ja))return F(X,ja,fa);if(q.isSqlInterval(ja))return E();if(q.isTimeOnly(ja))return ea();if(q.isDateOnly(ja))return da();if(q.isTimestampOffset(ja))return ka();if(q.isDateTime(ja))return ia();if(q.isString(ja))return H(X,ja,fa)}throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);
};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/sqlDateParsingUtils":function(){define("exports ../../arcade/featureset/support/errorsupport ./DateOnly ./SqlInterval ./SqlTimestampOffset ./TimeOnly ./UnknownTimeZone ../../chunks/datetime".split(" "),function(a,b,q,l,p,k,h,f){function c(n,u,x){x=w.exec(n);if(null!==x){const [,y,z,A,B,C,D,F]=x;n=f.DateTime.fromObject({year:parseInt(y,10),month:parseInt(z,10),day:parseInt(A,10),hour:parseInt(B,10),minute:parseInt(C,10),
second:parseInt(D,10),millisecond:F?parseInt(F.replace(".",""),10):0},{zone:h.substituteUnknownTimezone(u)});if(!1===n.isValid)throw new b.SqlError(b.SqlErrorCodes.InvalidTimeStamp);return n}x=v.exec(n);if(null!==x){const [,y,z,A,B,C,D,F,H,N,E]=x;n=p.SqlTimeStampOffset.fromParts(parseInt(y,10),parseInt(z,10),parseInt(A,10),parseInt(B,10),parseInt(C,10),parseInt(D,10),F?parseInt(F.replace(".",""),10):0,"-"===H,parseInt(N,10),parseInt(E,10));if(!1===n.isValid)throw new b.SqlError(b.SqlErrorCodes.InvalidTimeStamp);
return n}x=m.exec(n);if(null!==x){const [,y,z,A,B,C,D,F,H]=x;n=p.SqlTimeStampOffset.fromParts(parseInt(y,10),parseInt(z,10),parseInt(A,10),parseInt(B,10),parseInt(C,10),0,0,"-"===D,parseInt(F,10),parseInt(H,10));if(!1===n.isValid)throw new b.SqlError(b.SqlErrorCodes.InvalidTimeStamp);return n}x=r.exec(n);if(null!==x){const [,y,z,A,B,C]=x;n=f.DateTime.fromObject({year:parseInt(y,10),month:parseInt(z,10),day:parseInt(A,10),hour:parseInt(B,10),minute:parseInt(C,10),second:0},{zone:h.substituteUnknownTimezone(u)});
if(!1===n.isValid)throw new b.SqlError(b.SqlErrorCodes.InvalidTimeStamp);return n}x=t.exec(n);if(null!==x){const [,y,z,A]=x;n=f.DateTime.fromObject({year:parseInt(y,10),month:parseInt(z,10),day:parseInt(A,10),hour:0,minute:0,second:0},{zone:h.substituteUnknownTimezone(u)});if(!1===n.isValid)throw new b.SqlError(b.SqlErrorCodes.InvalidTimeStamp);return n}throw new b.SqlError(b.SqlErrorCodes.InvalidTimeStamp);}const e=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,g=/^(\d{1,2}):(\d{1,2})$/,d=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,
t=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,w=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,v=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,m=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,r=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;a.convertToExecutingTimeZone=function(n,u){if(u instanceof f.Zone)return u===h.UnknownTimeZone.instance?f.DateTime.fromMillis(n.getTime(),{zone:h.UnknownTimeZone.instance}):
f.DateTime.fromJSDate(n,{zone:u});switch(u){case "system":case "local":case null:return f.DateTime.fromJSDate(n);default:return"unknown"===u?.toLowerCase()?f.DateTime.fromMillis(n.getTime(),{zone:h.UnknownTimeZone.instance}):f.DateTime.fromJSDate(n,{zone:u})}};a.isDate=function(n){return n instanceof Date};a.isDateOnly=function(n){return n instanceof q.DateOnly};a.isDateTime=function(n){return n instanceof f.DateTime};a.isNumber=function(n){return"number"===typeof n};a.isSqlInterval=function(n){return n instanceof
l.SqlInterval};a.isString=function(n){return"string"===typeof n||n instanceof String};a.isTimeOnly=function(n){return n instanceof k.TimeOnly};a.isTimestampOffset=function(n){return n instanceof p.SqlTimeStampOffset};a.parseDate=function(n,u){const x=t.exec(n);if(null===x)try{return c(n,u)}catch{throw new b.SqlError(b.SqlErrorCodes.InvalidDate);}const [,y,z,A]=x;n=q.DateOnly.fromParts(parseInt(y,10),parseInt(z,10),parseInt(A,10));if(null===n)throw new b.SqlError(b.SqlErrorCodes.InvalidDate);return n};
a.parseTime=function(n){let u=e.exec(n);if(null!==u){const [,x,y,z]=u;n=k.TimeOnly.fromParts(parseInt(x,10),parseInt(y,10),parseInt(z,10),0);if(null!==n)return n;throw new b.SqlError(b.SqlErrorCodes.InvalidTime);}u=g.exec(n);if(null!==u){const [,x,y]=u;n=k.TimeOnly.fromParts(parseInt(x,10),parseInt(y,10),0,0);if(null!==n)return n;throw new b.SqlError(b.SqlErrorCodes.InvalidTime);}u=d.exec(n);if(null!==u){const [,x,y,z,A]=u;n=k.TimeOnly.fromParts(parseInt(x,10),parseInt(y,10),parseInt(z,10),parseInt(A,
10));if(null!==n)return n}throw new b.SqlError(b.SqlErrorCodes.InvalidTime);};a.parseTimestamp=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/SqlInterval":function(){define(["exports","../../arcade/featureset/support/errorsupport"],function(a,b){class q{constructor(){this.op="+";this.millis=this.minute=this.year=this.month=this.hour=this.second=this.day=0}static _fixDefaults(l){if(null!==l.precision||null!==l.secondary)throw new b.SqlError(b.SqlErrorCodes.PrimarySecondaryQualifiers);
}static _parseSecondsComponent(l,p){p.includes(".")?(p=p.split("."),l.second=parseFloat(p[0]),l.millis=parseInt(p[1],10)):l.second=parseFloat(p)}static createFromMilliseconds(l){const p=new q;p.second=l/1E3;return p}static createFromValueAndQualifier(l,p,k){let h=null;const f=new q;f.op="-"===k?"-":"+";if("interval-period"===p.type){q._fixDefaults(p);k=RegExp("^[0-9]{1,}$");if("year"===p.period||"month"===p.period)throw new b.SqlError(b.SqlErrorCodes.YearMonthIntervals);if("second"===p.period)if(/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(l))q._parseSecondsComponent(f,
l);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);else if(k.test(l))f[p.period]=parseFloat(l);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);}else{q._fixDefaults(p.start);q._fixDefaults(p.end);if("year"===p.start.period||"month"===p.start.period||"year"===p.end.period||"month"===p.end.period)throw new b.SqlError(b.SqlErrorCodes.YearMonthIntervals);switch(p.start.period){case "day":switch(p.end.period){case "hour":h=RegExp("^[0-9]{1,} [0-9]{1,}$");if(h.test(l))f[p.start.period]=
parseFloat(l.split(" ")[0]),f[p.end.period]=parseFloat(l.split(" ")[1]);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);break;case "minute":h=RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$");if(h.test(l))f[p.start.period]=parseFloat(l.split(" ")[0]),l=l.split(" ")[1].split(":"),f.hour=parseFloat(l[0]),f.minute=parseFloat(l[1]);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);break;case "second":h=RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$");if(h.test(l))f[p.start.period]=
parseFloat(l.split(" ")[0]),l=l.split(" ")[1].split(":"),f.hour=parseFloat(l[0]),f.minute=parseFloat(l[1]),q._parseSecondsComponent(f,l[2]);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);break;default:throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);}break;case "hour":switch(p.end.period){case "minute":h=RegExp("^[0-9]{1,}:[0-9]{1,}$");if(h.test(l))f.hour=parseFloat(l.split(":")[0]),f.minute=parseFloat(l.split(":")[1]);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);break;
case "second":h=RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$");if(h.test(l))l=l.split(":"),f.hour=parseFloat(l[0]),f.minute=parseFloat(l[1]),q._parseSecondsComponent(f,l[2]);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);break;default:throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);}break;case "minute":switch(p.end.period){case "second":h=RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$");if(h.test(l))l=l.split(":"),f.minute=parseFloat(l[0]),q._parseSecondsComponent(f,
l[1]);else throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);break;default:throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);}break;default:throw new b.SqlError(b.SqlErrorCodes.IllegalInterval);}}return f}valueInMilliseconds(){return("-"===this.op?-1:1)*(this.millis+1E3*this.second+6E4*this.minute+36E5*this.hour+864E5*this.day+365/12*this.month*864E5+31536E6*this.year)}}a.SqlInterval=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/StandardizedFunctions":function(){define("exports ../../arcade/featureset/support/errorsupport ../string ./DateOnly ./sqlCompareUtils ./sqlDateParsingUtils ./TimeOnly ../../chunks/datetime".split(" "),
function(a,b,q,l,p,k,h,f){function c(m){return"string"===typeof m||m instanceof String}function e(m){return k.isDate(m)||k.isDateOnly(m)||k.isDateTime(m)||k.isTimeOnly(m)||k.isTimestampOffset(m)?!1:!0}function g(m){return k.isDateOnly(m)||k.isTimeOnly(m)?m.toString():k.isTimestampOffset(m)?m.toSQLValue():k.isDateTime(m)?0===m.millisecond?m.toFormat("yyyy-LL-dd HH:mm:ss"):m.toSQL({includeOffset:!1}):k.isDate(m)?g(f.DateTime.fromJSDate(m)):m.toString()}function d(m){if(k.isDate(m))return l.DateOnly.fromDateJS(m);
if(k.isDateTime(m))return l.DateOnly.fromParts(m.year,m.month,m.day);if(k.isDateOnly(m))return m;if(k.isTimeOnly(m))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);if(k.isTimestampOffset(m)&&null===l.DateOnly.fromParts(m.year,m.month,m.day))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);if(c(m)&&(m=l.DateOnly.fromReader(m),null!==m&&m.isValid))return m;throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);}function t(m,r,n){if(k.isDate(m))return k.convertToExecutingTimeZone(m,r);if(k.isDateTime(m))return m;
if(k.isDateOnly(m))return m.toDateTimeLuxon("unknown");if(k.isTimeOnly(m))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);if(k.isTimestampOffset(m))return m;if(c(m))return k.parseTimestamp(m,"unknown",n);throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);}function w(m){if(k.isDate(m))return h.TimeOnly.fromDateJS(m);if(k.isDateTime(m))return h.TimeOnly.fromDateTime(m);if(k.isDateOnly(m))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);if(k.isTimeOnly(m))return m;if(k.isTimestampOffset(m))return h.TimeOnly.fromSqlTimeStampOffset(m);
if(c(m))return k.parseTime(m);throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);}const v={extract:{minParams:2,maxParams:2,evaluate:([m,r])=>{if(null==r)return null;if(k.isDate(r))switch(m.toUpperCase()){case "SECOND":return r.getSeconds();case "MINUTE":return r.getMinutes();case "HOUR":return r.getHours();case "DAY":return r.getDate();case "MONTH":return r.getMonth()+1;case "YEAR":return r.getFullYear();case "TIMEZONE_HOUR":return 0;case "TIMEZONE_MINUTE":return 0}else if(k.isDateTime(r))switch(m.toUpperCase()){case "SECOND":return r.second;
case "MINUTE":return r.minute;case "HOUR":return r.hour;case "DAY":return r.day;case "MONTH":return r.month;case "YEAR":return r.year}else if(k.isDateOnly(r))switch(m.toUpperCase()){case "DAY":return r.day;case "MONTH":return r.month;case "YEAR":return r.year}else if(k.isTimeOnly(r))switch(m.toUpperCase()){case "SECOND":return r.second;case "MINUTE":return r.minute;case "HOUR":return r.hour}else if(k.isTimestampOffset(r))switch(m.toUpperCase()){case "SECOND":return r.second;case "MINUTE":return r.minute;
case "HOUR":return r.hour;case "DAY":return r.day;case "MONTH":return r.month;case "YEAR":return r.year;case "TIMEZONE_HOUR":return r.timezoneOffsetHour;case "TIMEZONE_MINUTE":return r.timezoneOffsetMinutes}throw new b.SqlError(b.SqlErrorCodes.InvalidFunctionParameters,{function:"EXTRACT"});}},substring:{minParams:2,maxParams:3,evaluate:m=>{if(2===m.length){const [r,n]=m;return null==r||null==n?null:r.toString().substring(n-1)}if(3===m.length){const [r,n,u]=m;return null==r||null==n||null==u?null:
0>=u?"":r.toString().substring(n-1,n+u-1)}}},position:{minParams:2,maxParams:2,evaluate:([m,r])=>null==m||null==r?null:r.indexOf(m)+1},trim:{minParams:2,maxParams:3,evaluate:m=>{var r=3===m.length,n=r?m[1]:" ";r=r?m[2]:m[1];if(null==n||null==r)return null;n=`(${q.escapeRegExpString(n)})`;switch(m[0]){case "BOTH":return r.replaceAll(new RegExp(`^${n}*|${n}*$`,"g"),"");case "LEADING":return r.replaceAll(new RegExp(`^${n}*`,"g"),"");case "TRAILING":return r.replaceAll(new RegExp(`${n}*$`,"g"),"")}throw new b.SqlError(b.SqlErrorCodes.InvalidFunctionParameters,
{function:"TRIM"});}},abs:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.abs(m[0])},ceiling:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.ceil(m[0])},floor:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.floor(m[0])},log:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.log(m[0])},log10:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.log(m[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.sin(m[0])},cos:{minParams:1,maxParams:1,
evaluate:m=>null==m[0]?null:Math.cos(m[0])},tan:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.tan(m[0])},asin:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.asin(m[0])},acos:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.acos(m[0])},atan:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.atan(m[0])},sign:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:0<m[0]?1:0>m[1]?-1:0},power:{minParams:2,maxParams:2,evaluate:m=>null==m[0]||null==m[1]?null:m[0]**m[1]},
mod:{minParams:2,maxParams:2,evaluate:m=>null==m[0]||null==m[1]?null:m[0]%m[1]},round:{minParams:1,maxParams:2,evaluate:m=>{const r=m[0];m=2===m.length?10**m[1]:1;return null==r?null:Math.round(r*m)/m}},truncate:{minParams:1,maxParams:2,evaluate:m=>null==m[0]?null:1===m.length?parseInt(m[0].toFixed(0),10):parseFloat(m[0].toFixed(m[1]))},char_length:{minParams:1,maxParams:1,evaluate:m=>c(m[0])?m[0].length:0},concat:{minParams:1,maxParams:Infinity,evaluate:m=>{let r="";for(let n=0;n<m.length;n++){if(null==
m[n])return null;r+=m[n].toString()}return r}},lower:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:m[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:m[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:Infinity,evaluate:m=>{for(const r of m)if(null!==r)return r;return null}},cosh:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.cosh(m[0])},sinh:{minParams:1,maxParams:1,evaluate:m=>null==m[0]?null:Math.sinh(m[0])},tanh:{minParams:1,
maxParams:1,evaluate:m=>null==m[0]?null:Math.tanh(m[0])},nullif:{minParams:2,maxParams:2,evaluate:(m,r)=>p.sqlCompare(m[0],m[1],"\x3d")?null:m[0]},cast:{minParams:2,maxParams:2,evaluate:(m,r)=>{const n=m[0];m=m[1];if(null===n)return null;switch(m.type){case "integer":if(!e(n))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);r=parseInt(n,10);if(isNaN(r))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);return r;case "smallint":if(!e(n))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);
r=parseInt(n,10);if(isNaN(r))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);if(32767<r||-32767>r)throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);return r;case "float":case "real":if(!e(n))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);r=parseFloat(n);if(isNaN(r))throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);return r;case "time":return w(n);case "date":return d(n);case "timestamp":return t(n,r,!0===m.withtimezone);case "varchar":r=g(n);if(r.length>m.size)throw new b.SqlError(b.SqlErrorCodes.CannotCastValue);
return r;default:throw new b.SqlError(b.SqlErrorCodes.InvalidDataType);}}}};a.evaluateFunction=function(m,r,n){const u=v[m.toLowerCase()];if(null==u)throw new b.SqlError(b.SqlErrorCodes.FunctionNotRecognized);if(r.length<u.minParams||r.length>u.maxParams)throw new b.SqlError(b.SqlErrorCodes.InvalidParameterCount,{name:m.toUpperCase()});return u.evaluate(r,n)};a.isStandardized=function(m,r){m=v[m.toLowerCase()];return null!=m&&r>=m.minParams&&r<=m.maxParams};Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/core/sql/sqlCompareUtils":function(){define("exports ../../arcade/featureset/support/errorsupport ./sqlDateParsingUtils ./SqlTimestampOffset ./UnknownTimeZone ../../chunks/datetime".split(" "),function(a,b,q,l,p,k){function h(m){return q.isDateTime(m)||q.isTimestampOffset(m)?!0:!1}function f(m){return q.isDateTime(m)||q.isDateOnly(m)||q.isTimestampOffset(m)||q.isTimeOnly(m)?!0:!1}function c(m){if(q.isDateTime(m))return m.toMillis();if(q.isDateOnly(m))return m.toNumber();
if(q.isTimestampOffset(m))return m.toMilliseconds();throw new b.SqlError(b.SqlErrorCodes.InvalidDataType);}function e(m,r,n){switch(n){case "\x3c\x3e":return m!==r;case "\x3d":return m===r;case "\x3e":return m>r;case "\x3c":return m<r;case "\x3e\x3d":return m>=r;case "\x3c\x3d":return m<=r}}function g(m,r,n){const u=parseFloat(r);if(!isNaN(u))return e(m,u,n);m=m.toString();switch(n){case "\x3c\x3e":return m!==r;case "\x3d":return m===r;case "\x3e":return m>r;case "\x3c":return m<r;case "\x3e\x3d":return m>=
r;case "\x3c\x3d":return m<=r}}function d(m,r,n){const u=parseFloat(m);if(!isNaN(u))return e(u,r,n);r=r.toString();switch(n){case "\x3c\x3e":return m!==r;case "\x3d":return m===r;case "\x3e":return m>r;case "\x3c":return m<r;case "\x3e\x3d":return m>=r;case "\x3c\x3d":return m<=r}}function t(m,r,n){switch(n){case "\x3c\x3e":return m!==r;case "\x3d":return m===r;case "\x3e":return m>r;case "\x3c":return m<r;case "\x3e\x3d":return m>=r;case "\x3c\x3d":return m<=r}}function w(m,r,n){m instanceof l.SqlTimeStampOffset&&
(m=m.toDateTime());r instanceof l.SqlTimeStampOffset&&(r=r.toDateTime());m=v(m);r=v(r);switch(n){case "\x3c\x3e":return m!==r;case "\x3d":return m===r;case "\x3e":return m>r;case "\x3c":return m<r;case "\x3e\x3d":return m>=r;case "\x3c\x3d":return m<=r}}function v(m){return 321408E5*m.year+26784E5*m.month+864E5*m.day+36E5*m.hour+6E4*m.minute+1E3*m.second+m.millisecond}a.dateValueInMilliseconds=c;a.isDateOrTimeValue=f;a.isDateTimeComparableValue=h;a.sqlCompare=function(m,r,n,u){if(null==m||null==r)return null;
if(q.isNumber(m)){if(q.isNumber(r))return e(m,r,n);if(q.isString(r))return g(m,r,n);if(f(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isDateOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}else if(q.isString(m)){if(q.isNumber(r))return d(m,r,n);if(q.isString(r))return t(m,r,n);if(q.isDateTime(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isDateOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isTimeOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);
if(q.isTimestampOffset(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}else if(q.isDateTime(m)){if(h(r)){if(m instanceof k.DateTime&&p.isUnknownTimeZone(m.zone)){if(r instanceof k.DateTime&&!1===p.isUnknownTimeZone(r.zone)||r instanceof l.SqlTimeStampOffset)return w(m,r,n)}else if(r instanceof k.DateTime&&p.isUnknownTimeZone(r.zone)&&(m instanceof k.DateTime&&!1===p.isUnknownTimeZone(m.zone)||m instanceof l.SqlTimeStampOffset))return w(m,r,n);return e(c(m),c(r),n)}if(q.isString(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);
if(q.isDateOnly(r))return r=r.toDateTimeLuxon(m.zone),m=m.startOf("day"),e(m.toMillis(),r.toMillis(),n);if(q.isTimeOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isNumber(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}else if(q.isDateOnly(m)){if(q.isTimestampOffset(r))return m=m.toDateTimeLuxon(r.toDateTime().zone),r=r.startOfDay(),e(m.toMillis(),r.toMilliseconds(),n);if(q.isDateTime(r))return m=m.toDateTimeLuxon(r.zone),r=r.startOf("day"),e(m.toMillis(),r.toMillis(),
n);if(q.isString(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isDateOnly(r))return e(m.toNumber(),r.toNumber(),n);if(q.isTimeOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isNumber(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}else if(q.isTimeOnly(m)){if(q.isTimeOnly(r))return e(m.toNumber(),r.toNumber(),n);if(q.isString(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isNumber(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isDateOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);
if(h(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);}else if(q.isTimestampOffset(m)){if(h(r))return r instanceof k.DateTime&&p.isUnknownTimeZone(r.zone)?w(m,r,n):e(c(m),c(r),n);if(q.isString(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isDateOnly(r))return r=r.toDateTimeLuxon(m.toDateTime().zone),m=m.startOfDay(),e(m.toMilliseconds(),r.toMillis(),n);if(q.isTimeOnly(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);if(q.isNumber(r))throw new b.SqlError(b.SqlErrorCodes.InvalidOperator);
}switch(n){case "\x3c\x3e":return m!==r;case "\x3d":return m===r;case "\x3e":return m>r;case "\x3c":return m<r;case "\x3e\x3d":return m>=r;case "\x3c\x3d":return m<=r}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/WhereGrammar":function(){define(["exports","../../chunks/_commonjsHelpers"],function(a,b){var q={exports:{}};(function(k){(function(h,f){k.exports&&(k.exports=f())})(b.commonjsGlobal,function(){function h(c,e,g,d){c=Error.call(this,c);Object.setPrototypeOf&&
Object.setPrototypeOf(c,h.prototype);c.expected=e;c.found=g;c.location=d;c.name="SyntaxError";return c}function f(c,e,g){g=g||" ";if(c.length>e)return c;e-=c.length;g+=g.repeat(e);return c+g.slice(0,e)}(function(c,e){function g(){this.constructor=c}g.prototype=e.prototype;c.prototype=new g})(h,Error);h.prototype.format=function(c){var e="Error: "+this.message;if(this.location){var g=null,d;for(d=0;d<c.length;d++)if(c[d].source===this.location.source){g=c[d].text.split(/\r\n|\n|\r/g);break}c=this.location.start;
d=this.location.source&&"function"===typeof this.location.source.offset?this.location.source.offset(c):c;var t=this.location.source+":"+d.line+":"+d.column;if(g){var w=this.location.end,v=f("",d.line.toString().length," ");g=g[c.line-1];w=(c.line===w.line?w.column:g.length+1)-c.column||1;e+="\n --\x3e "+t+"\n"+v+" |\n"+d.line+" | "+g+"\n"+v+" | "+f("",c.column-1," ")+f("",w,"^")}else e+="\n at "+t}return e};h.buildMessage=function(c,e){function g(m){return m.charCodeAt(0).toString(16).toUpperCase()}
function d(m){return m.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(r){return"\\x0"+g(r)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(r){return"\\x"+g(r)})}function t(m){return m.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(r){return"\\x0"+
g(r)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(r){return"\\x"+g(r)})}function w(m){return v[m.type](m)}var v={literal:function(m){return'"'+d(m.text)+'"'},class:function(m){var r=m.parts.map(function(n){return Array.isArray(n)?t(n[0])+"-"+t(n[1]):t(n)});return"["+(m.inverted?"^":"")+r.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(m){return m.description}};return"Expected "+function(m){m=m.map(w);var r,n;m.sort();if(0<m.length){for(n=r=1;r<
m.length;r++)m[r-1]!==m[r]&&(m[n]=m[r],n++);m.length=n}switch(m.length){case 1:return m[0];case 2:return m[0]+" or "+m[1];default:return m.slice(0,-1).join(", ")+", or "+m[m.length-1]}}(c)+" but "+(e?'"'+d(e)+'"':"end of input")+" found."};return{SyntaxError:h,parse:function(c,e){function g(ta,Ca){Ca=void 0!==Ca?Ca:v(hb,ma);throw new h(ta,null,null,Ca);}function d(ta,Ca){return{type:"literal",text:ta,ignoreCase:Ca}}function t(ta,Ca,Oa){return{type:"class",parts:ta,inverted:Ca,ignoreCase:Oa}}function w(ta){var Ca=
Re[ta],Oa;if(!Ca){for(Oa=ta-1;!Re[Oa];)Oa--;Ca=Re[Oa];for(Ca={line:Ca.line,column:Ca.column};Oa<ta;)10===c.charCodeAt(Oa)?(Ca.line++,Ca.column=1):Ca.column++,Oa++;Re[ta]=Ca}return Ca}function v(ta,Ca,Oa){Oa=w(ta);var ab=w(Ca);return{source:Ja,start:{offset:ta,line:Oa.line,column:Oa.column},end:{offset:Ca,line:ab.line,column:ab.column}}}function m(ta){ma<od||(ma>od&&(od=ma,rf=[]),rf.push(ta))}function r(){var ta=ma;Aa();var Ca=u();Ca!==aa?(Aa(),hb=ta,ta=Ca):(ma=ta,ta=aa);return ta}function n(){var ta=
ma;var Ca=u();if(Ca!==aa){var Oa=[];var ab=ma;var ob=Aa();var wb=sa();if(wb!==aa){var Ob=Aa();var Rb=u();Rb!==aa?ab=ob=[ob,wb,Ob,Rb]:(ma=ab,ab=aa)}else ma=ab,ab=aa;for(;ab!==aa;)Oa.push(ab),ab=ma,ob=Aa(),wb=sa(),wb!==aa?(Ob=Aa(),Rb=u(),Rb!==aa?ab=ob=[ob,wb,Ob,Rb]:(ma=ab,ab=aa)):(ma=ab,ab=aa);hb=ta;ta={type:"expression-list"};Ca=[Ca];for(ab=0;ab<Oa.length;ab++)Ca.push(Oa[ab][3]);ta.value=Ca}else ma=ta,ta=aa;return ta}function u(){var ta=ma;var Ca=x();if(Ca!==aa){var Oa=[];var ab=ma;var ob=Aa();var wb=
ja();if(wb!==aa){var Ob=Aa();var Rb=x();Rb!==aa?ab=ob=[ob,wb,Ob,Rb]:(ma=ab,ab=aa)}else ma=ab,ab=aa;for(;ab!==aa;)Oa.push(ab),ab=ma,ob=Aa(),wb=ja(),wb!==aa?(Ob=Aa(),Rb=x(),Rb!==aa?ab=ob=[ob,wb,Ob,Rb]:(ma=ab,ab=aa)):(ma=ab,ab=aa);hb=ta;ta=qa(Ca,Oa)}else ma=ta,ta=aa;return ta}function x(){var ta=ma;var Ca=y();if(Ca!==aa){var Oa=[];var ab=ma;var ob=Aa();var wb=X();if(wb!==aa){var Ob=Aa();var Rb=y();Rb!==aa?ab=ob=[ob,wb,Ob,Rb]:(ma=ab,ab=aa)}else ma=ab,ab=aa;for(;ab!==aa;)Oa.push(ab),ab=ma,ob=Aa(),wb=X(),
wb!==aa?(Ob=Aa(),Rb=y(),Rb!==aa?ab=ob=[ob,wb,Ob,Rb]:(ma=ab,ab=aa)):(ma=ab,ab=aa);hb=ta;ta=qa(Ca,Oa)}else ma=ta,ta=aa;return ta}function y(){var ta=ma;var Ca=fa();if(Ca===aa){Ca=ma;if(33===c.charCodeAt(ma)){var Oa=$a;ma++}else Oa=aa,0===cb&&m(Ic);if(Oa!==aa){var ab=ma;cb++;if(61===c.charCodeAt(ma)){var ob=bb;ma++}else ob=aa,0===cb&&m(wc);cb--;ob===aa?ab=void 0:(ma=ab,ab=aa);ab!==aa?Ca=Oa=[Oa,ab]:(ma=Ca,Ca=aa)}else ma=Ca,Ca=aa}Ca!==aa?(Oa=Aa(),ab=y(),ab!==aa?(hb=ta,ta={type:"unary-expression",operator:"NOT",
expr:ab}):(ma=ta,ta=aa)):(ma=ta,ta=aa);if(ta===aa){Ca=ma;ta=C();if(ta!==aa){Aa();Oa=ma;ab=[];ob=ma;var wb=Aa();var Ob=z();if(Ob!==aa){var Rb=Aa();var ae=C();ae!==aa?ob=wb=[wb,Ob,Rb,ae]:(ma=ob,ob=aa)}else ma=ob,ob=aa;if(ob!==aa)for(;ob!==aa;)ab.push(ob),ob=ma,wb=Aa(),Ob=z(),Ob!==aa?(Rb=Aa(),ae=C(),ae!==aa?ob=wb=[wb,Ob,Rb,ae]:(ma=ob,ob=aa)):(ma=ob,ob=aa);else ab=aa;ab!==aa&&(hb=Oa,ab={type:"arithmetic",tail:ab});Oa=ab;Oa===aa&&(Oa=ma,ab=B(),ab!==aa?(Aa(),ob=Ha(),ob!==aa?(Aa(),ob=n(),ob!==aa?(Aa(),wb=
Ka(),wb!==aa?(hb=Oa,Oa={op:ab,right:ob}):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa),Oa===aa&&(Oa=ma,ab=B(),ab!==aa?(Aa(),ob=Ha(),ob!==aa?(Aa(),ob=Ka(),ob!==aa?(hb=Oa,Oa={op:ab,right:{type:"expression-list",value:[]}}):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa),Oa===aa&&(Oa=ma,ab=B(),ab!==aa?(Aa(),ob=M(),ob!==aa?(hb=Oa,Oa={op:ab,right:ob}):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa))),Oa===aa&&(Oa=ma,wb=fa(),wb!==aa?(Aa(),ab=la(),ab!==aa?(Aa(),ob=C(),ob!==aa?(Aa(),Ob=X(),Ob!==aa?(Aa(),wb=C(),wb!==
aa?(hb=Oa,Oa={op:"NOT"+ab,right:{type:"expression-list",value:[ob,wb]}}):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa),Oa===aa&&(Oa=ma,wb=la(),wb!==aa?(Aa(),ab=C(),ab!==aa?(Aa(),ob=X(),ob!==aa?(Aa(),Ob=C(),Ob!==aa?(hb=Oa,Oa={op:wb,right:{type:"expression-list",value:[ab,Ob]}}):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)),Oa===aa&&(Oa=ma,ab=ia(),ab!==aa?(Aa(),ob=fa(),ob!==aa?(Aa(),ob=C(),ob!==aa?(hb=Oa,Oa={op:ab+"NOT",right:ob}):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)):
(ma=Oa,Oa=aa),Oa===aa&&(Oa=ma,ab=ia(),ab!==aa?(Aa(),ob=C(),ob!==aa?(hb=Oa,Oa={op:ab,right:ob}):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)),Oa===aa&&(Oa=ma,ab=A(),ab!==aa?(Aa(),ob=S(),ob!==aa?(Aa(),wb=ma,c.substr(ma,6).toLowerCase()===fc?(Ob=c.substr(ma,6),ma+=6):(Ob=aa,0===cb&&m(id)),Ob!==aa?(Ob=ma,cb++,Rb=I(),cb--,Rb===aa?Ob=void 0:(ma=Ob,Ob=aa),Ob!==aa?(hb=wb,wb="ESCAPE"):(ma=wb,wb=aa)):(ma=wb,wb=aa),wb!==aa?(Aa(),wb=V(),wb!==aa?(hb=Oa,Oa={op:ab,right:ob,escape:wb.value}):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)):(ma=Oa,
Oa=aa)):(ma=Oa,Oa=aa),Oa===aa&&(Oa=ma,ab=A(),ab!==aa?(Aa(),ob=S(),ob!==aa?(hb=Oa,Oa={op:ab,right:ob,escape:""}):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa))))));Oa===aa&&(Oa=null);hb=Ca;Ca=Oa;""==Ca||void 0==Ca||null==Ca?Ca=ta:(Oa=null,Ca=Oa="arithmetic"==Ca.type?qa(ta,Ca.tail):Ya(Ca.op,ta,Ca.right,Ca.escape))}else ma=Ca,Ca=aa;ta=Ca}return ta}function z(){if(c.substr(ma,2)===pa){var ta=pa;ma+=2}else ta=aa,0===cb&&m(qc);ta===aa&&(62===c.charCodeAt(ma)?(ta=Ba,ma++):(ta=aa,0===cb&&m(zc)),ta===aa&&(c.substr(ma,2)===
Ia?(ta=Ia,ma+=2):(ta=aa,0===cb&&m(rd)),ta===aa&&(c.substr(ma,2)===Wa?(ta=Wa,ma+=2):(ta=aa,0===cb&&m(Pd)),ta===aa&&(60===c.charCodeAt(ma)?(ta=gb,ma++):(ta=aa,0===cb&&m(ed)),ta===aa&&(61===c.charCodeAt(ma)?(ta=bb,ma++):(ta=aa,0===cb&&m(wc)),ta===aa&&(c.substr(ma,2)===ib?(ta=ib,ma+=2):(ta=aa,0===cb&&m(Qd))))))));return ta}function A(){var ta;var Ca=ta=ma;var Oa=fa();if(Oa!==aa){var ab=Aa();var ob=ka();ob!==aa?Ca=Oa=[Oa,ab,ob]:(ma=Ca,Ca=aa)}else ma=Ca,Ca=aa;Ca!==aa&&(hb=ta,Ca=Ca[0]+" "+Ca[2]);ta=Ca;ta===
aa&&(ta=ka());return ta}function B(){var ta;var Ca=ta=ma;var Oa=fa();if(Oa!==aa){var ab=Aa();var ob=da();ob!==aa?Ca=Oa=[Oa,ab,ob]:(ma=Ca,Ca=aa)}else ma=Ca,Ca=aa;Ca!==aa&&(hb=ta,Ca=Ca[0]+" "+Ca[2]);ta=Ca;ta===aa&&(ta=da());return ta}function C(){var ta=ma;var Ca=F();if(Ca!==aa){var Oa=[];var ab=ma;var ob=Aa();var wb=D();if(wb!==aa){var Ob=Aa();var Rb=F();Rb!==aa?ab=ob=[ob,wb,Ob,Rb]:(ma=ab,ab=aa)}else ma=ab,ab=aa;for(;ab!==aa;)Oa.push(ab),ab=ma,ob=Aa(),wb=D(),wb!==aa?(Ob=Aa(),Rb=F(),Rb!==aa?ab=ob=[ob,
wb,Ob,Rb]:(ma=ab,ab=aa)):(ma=ab,ab=aa);hb=ta;ta=qa(Ca,Oa)}else ma=ta,ta=aa;return ta}function D(){if(43===c.charCodeAt(ma)){var ta=La;ma++}else ta=aa,0===cb&&m(sd);ta===aa&&(45===c.charCodeAt(ma)?(ta=Xa,ma++):(ta=aa,0===cb&&m(fd)),ta===aa&&(c.substr(ma,2)===eb?(ta=eb,ma+=2):(ta=aa,0===cb&&m(Rd))));return ta}function F(){var ta=ma;var Ca=N();if(Ca!==aa){var Oa=[];var ab=ma;var ob=Aa();var wb=H();if(wb!==aa){var Ob=Aa();var Rb=N();Rb!==aa?ab=ob=[ob,wb,Ob,Rb]:(ma=ab,ab=aa)}else ma=ab,ab=aa;for(;ab!==
aa;)Oa.push(ab),ab=ma,ob=Aa(),wb=H(),wb!==aa?(Ob=Aa(),Rb=N(),Rb!==aa?ab=ob=[ob,wb,Ob,Rb]:(ma=ab,ab=aa)):(ma=ab,ab=aa);hb=ta;ta=qa(Ca,Oa)}else ma=ta,ta=aa;return ta}function H(){if(42===c.charCodeAt(ma)){var ta=db;ma++}else ta=aa,0===cb&&m(Gd);ta===aa&&(47===c.charCodeAt(ma)?(ta=jb,ma++):(ta=aa,0===cb&&m(ve)));return ta}function N(){var ta=V();if(ta===aa){var Ca=ma;var Oa=ma;var ab=ba();if(ab!==aa){var ob=U();if(ob!==aa){var wb=Z();wb!==aa?(hb=Oa,Oa=parseFloat(ab+ob+wb)):(ma=Oa,Oa=aa)}else ma=Oa,Oa=
aa}else ma=Oa,Oa=aa;Oa===aa&&(Oa=ma,ab=ba(),ab!==aa?(ob=U(),ob!==aa?(hb=Oa,Oa=parseFloat(ab+ob)):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa),Oa===aa&&(Oa=ma,ab=ba(),ab!==aa?(ob=Z(),ob!==aa?(hb=Oa,Oa=parseFloat(ab+ob)):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa),Oa===aa&&(Oa=ma,ab=ba(),ab!==aa&&(hb=Oa,ab=parseFloat(ab)),Oa=ab)));var Ob=Oa;if(Ob!==aa){var Rb=ma;cb++;var ae=G();cb--;ae===aa?Rb=void 0:(ma=Rb,Rb=aa);Rb!==aa?(hb=Ca,Ca={type:"number",value:Ob}):(ma=Ca,Ca=aa)}else ma=Ca,Ca=aa;ta=Ca;if(ta===aa){var be=ma;var Ce=ma;if(c.substr(ma,
4).toLowerCase()===Kb){var Se=c.substr(ma,4);ma+=4}else Se=aa,0===cb&&m(Id);if(Se!==aa){var Ge=ma;cb++;var ig=I();cb--;ig===aa?Ge=void 0:(ma=Ge,Ge=aa);Ge!==aa?Ce=Se=[Se,Ge]:(ma=Ce,Ce=aa)}else ma=Ce,Ce=aa;var ce=Ce;ce!==aa&&(hb=be,ce={type:"boolean",value:!0});be=ce;if(be===aa){be=ma;var De=ma;if(c.substr(ma,5).toLowerCase()===bc){var Te=c.substr(ma,5);ma+=5}else Te=aa,0===cb&&m(Ac);if(Te!==aa){var He=ma;cb++;var jg=I();cb--;jg===aa?He=void 0:(ma=He,He=aa);He!==aa?De=Te=[Te,He]:(ma=De,De=aa)}else ma=
De,De=aa;ce=De;ce!==aa&&(hb=be,ce={type:"boolean",value:!1});be=ce}ta=be;if(ta===aa){var kg=ma;var Ee=ma;if(c.substr(ma,4).toLowerCase()===Bb){var Ue=c.substr(ma,4);ma+=4}else Ue=aa,0===cb&&m(Qc);if(Ue!==aa){var Ie=ma;cb++;var lg=I();cb--;lg===aa?Ie=void 0:(ma=Ie,Ie=aa);Ie!==aa?Ee=Ue=[Ue,Ie]:(ma=Ee,Ee=aa)}else ma=Ee,Ee=aa;var sf=Ee;sf!==aa&&(hb=kg,sf={type:"null",value:null});ta=sf;if(ta===aa){var de=ma;if(ya()!==aa){Aa();var Ve=S();Ve!==aa?(hb=de,"string"===Ve.type&&!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(Ve.value)&&
g("Date literal is invalid"),de={type:"date",value:Ve.value}):(ma=de,de=aa)}else ma=de,de=aa;ta=de;if(ta===aa){var ee=ma;if(za()!==aa){Aa();var We=S();We!==aa?(hb=ee,"string"===We.type&&!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(We.value)&&
g("Timestamp literal is invalid"),ee={type:"timestamp",value:We.value}):(ma=ee,ee=aa)}else ma=ee,ee=aa;ta=ee;if(ta===aa){var rc=ma;var tf=ra();if(tf!==aa){Aa();if(45===c.charCodeAt(ma)){var Ad=Xa;ma++}else Ad=aa,0===cb&&m(fd);Ad===aa&&(43===c.charCodeAt(ma)?(Ad=La,ma++):(Ad=aa,0===cb&&m(sd)));if(Ad!==aa){Aa();var Je=S();if(Je!==aa){Aa();var Gf=J();Gf!==aa?(hb=rc,rc={type:"interval",value:Je,qualifier:Gf,op:Ad}):(ma=rc,rc=aa)}else ma=rc,rc=aa}else ma=rc,rc=aa}else ma=rc,rc=aa;rc===aa&&(rc=ma,tf=ra(),
tf!==aa?(Aa(),Ad=S(),Ad!==aa?(Aa(),Je=J(),Je!==aa?(hb=rc,rc={type:"interval",value:Ad,qualifier:Je,op:""}):(ma=rc,rc=aa)):(ma=rc,rc=aa)):(ma=rc,rc=aa));ta=rc;if(ta===aa){var fe=ma;if(Da()!==aa){Aa();var Xe=S();Xe!==aa?(hb=fe,"string"===Xe.type&&!0!==/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(Xe.value)&&g("Time literal is invalid"),fe={type:"time",value:Xe.value}):(ma=fe,fe=aa)}else ma=fe,fe=aa;ta=fe}}}}}}}var ic=ta;if(ic===aa){var Jc=ma;var ge=
ma;if(c.substr(ma,7).toLowerCase()===Fa){var Hf=c.substr(ma,7);ma+=7}else Hf=aa,0===cb&&m(wd);if(Hf!==aa){var Ye=ma;cb++;var mg=I();cb--;mg===aa?Ye=void 0:(ma=Ye,Ye=aa);Ye!==aa?(hb=ge,ge="EXTRACT"):(ma=ge,ge=aa)}else ma=ge,ge=aa;if(ge!==aa){Aa();var ng=Ha();if(ng!==aa){Aa();var Kc=xa();if(Kc===aa&&(Kc=Ma(),Kc===aa&&(Kc=Ga(),Kc===aa&&(Kc=Pa(),Kc===aa&&(Kc=Qa(),Kc===aa&&(Kc=Ea(),Kc===aa)))))){var he=ma;if(c.substr(ma,13).toLowerCase()===Ub){var If=c.substr(ma,13);ma+=13}else If=aa,0===cb&&m(Wc);if(If!==
aa){var Ze=ma;cb++;var og=I();cb--;og===aa?Ze=void 0:(ma=Ze,Ze=aa);Ze!==aa?(hb=he,he="TIMEZONE_HOUR"):(ma=he,he=aa)}else ma=he,he=aa;Kc=he;if(Kc===aa){var ie=ma;if(c.substr(ma,15).toLowerCase()===Zb){var Jf=c.substr(ma,15);ma+=15}else Jf=aa,0===cb&&m(Yd);if(Jf!==aa){var $e=ma;cb++;var pg=I();cb--;pg===aa?$e=void 0:(ma=$e,$e=aa);$e!==aa?(hb=ie,ie="TIMEZONE_MINUTE"):(ma=ie,ie=aa)}else ma=ie,ie=aa;Kc=ie}}var Kf=Kc;if(Kf!==aa){Aa();var qg=na();if(qg!==aa){Aa();var Lf=u();if(Lf!==aa){Aa();var rg=Ka();
rg!==aa?(hb=Jc,Jc={type:"function",name:"extract",args:{type:"expression-list",value:[{type:"string",value:Kf},Lf]}}):(ma=Jc,Jc=aa)}else ma=Jc,Jc=aa}else ma=Jc,Jc=aa}else ma=Jc,Jc=aa}else ma=Jc,Jc=aa}else ma=Jc,Jc=aa;ic=Jc;if(ic===aa){var Lc=ma;var je=ma;if(c.substr(ma,9).toLowerCase()===oa){var Mf=c.substr(ma,9);ma+=9}else Mf=aa,0===cb&&m(Kd);if(Mf!==aa){var af=ma;cb++;var sg=I();cb--;sg===aa?af=void 0:(ma=af,af=aa);af!==aa?(hb=je,je="SUBSTRING"):(ma=je,je=aa)}else ma=je,je=aa;if(je!==aa){Aa();var tg=
Ha();if(tg!==aa){Aa();var uf=u();if(uf!==aa){Aa();var ug=na();if(ug!==aa){Aa();var vf=u();if(vf!==aa){Aa();var Bd=ma;var ke=ma;if(c.substr(ma,3).toLowerCase()===lb){var Nf=c.substr(ma,3);ma+=3}else Nf=aa,0===cb&&m(bd);if(Nf!==aa){var bf=ma;cb++;var vg=I();cb--;vg===aa?bf=void 0:(ma=bf,bf=aa);bf!==aa?(hb=ke,ke="FOR"):(ma=ke,ke=aa)}else ma=ke,ke=aa;var Ke=ke;if(Ke!==aa){var wg=Aa();var Of=u();if(Of!==aa){var xg=Aa();Bd=Ke=[Ke,wg,Of,xg]}else ma=Bd,Bd=aa}else ma=Bd,Bd=aa;Bd===aa&&(Bd=null);Ke=Ka();Ke!==
aa?(hb=Lc,Lc={type:"function",name:"substring",args:{type:"expression-list",value:Bd?[uf,vf,Bd[2]]:[uf,vf]}}):(ma=Lc,Lc=aa)}else ma=Lc,Lc=aa}else ma=Lc,Lc=aa}else ma=Lc,Lc=aa}else ma=Lc,Lc=aa}else ma=Lc,Lc=aa;ic=Lc;if(ic===aa){var mc=ma;var wf=va();if(wf!==aa){Aa();var xf=Ha();if(xf!==aa){Aa();var Cd=K();Cd===aa&&(Cd=null);Aa();var Le=u();if(Le!==aa){Aa();var yf=na();if(yf!==aa){Aa();var Pf=u();if(Pf!==aa){Aa();var yg=Ka();yg!==aa?(hb=mc,mc={type:"function",name:"trim",args:{type:"expression-list",
value:[{type:"string",value:null==Cd?"BOTH":Cd},Le,Pf]}}):(ma=mc,mc=aa)}else ma=mc,mc=aa}else ma=mc,mc=aa}else ma=mc,mc=aa}else ma=mc,mc=aa}else ma=mc,mc=aa;mc===aa&&(mc=ma,wf=va(),wf!==aa?(Aa(),xf=Ha(),xf!==aa?(Aa(),Cd=K(),Cd===aa&&(Cd=null),Aa(),Le=u(),Le!==aa?(Aa(),yf=Ka(),yf!==aa?(hb=mc,mc={type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:null==Cd?"BOTH":Cd},Le]}}):(ma=mc,mc=aa)):(ma=mc,mc=aa)):(ma=mc,mc=aa)):(ma=mc,mc=aa));ic=mc;if(ic===aa){var Mc=ma;var le=
ma;if(c.substr(ma,8).toLowerCase()===Za){var Qf=c.substr(ma,8);ma+=8}else Qf=aa,0===cb&&m(Td);if(Qf!==aa){var cf=ma;cb++;var zg=I();cb--;zg===aa?cf=void 0:(ma=cf,cf=aa);cf!==aa?(hb=le,le="POSITION"):(ma=le,le=aa)}else ma=le,le=aa;if(le!==aa){Aa();var Ag=Ha();if(Ag!==aa){Aa();var Rf=u();if(Rf!==aa){Aa();var Bg=da();if(Bg!==aa){Aa();var Sf=u();if(Sf!==aa){Aa();var Cg=Ka();Cg!==aa?(hb=Mc,Mc={type:"function",name:"position",args:{type:"expression-list",value:[Rf,Sf]}}):(ma=Mc,Mc=aa)}else ma=Mc,Mc=aa}else ma=
Mc,Mc=aa}else ma=Mc,Mc=aa}else ma=Mc,Mc=aa}else ma=Mc,Mc=aa;ic=Mc;if(ic===aa){var Nc=ma;var me=ma;if(c.substr(ma,4).toLowerCase()===zb){var Tf=c.substr(ma,4);ma+=4}else Tf=aa,0===cb&&m(Nd);if(Tf!==aa){var df=ma;cb++;var Dg=I();cb--;Dg===aa?df=void 0:(ma=df,df=aa);df!==aa?(hb=me,me="CAST"):(ma=me,me=aa)}else ma=me,me=aa;if(me!==aa){Aa();var Eg=Ha();if(Eg!==aa){Aa();var Uf=u();if(Uf!==aa){Aa();var ne=ma;if(c.substr(ma,2).toLowerCase()===Ab){var Vf=c.substr(ma,2);ma+=2}else Vf=aa,0===cb&&m(ze);if(Vf!==
aa){var ef=ma;cb++;var Fg=I();cb--;Fg===aa?ef=void 0:(ma=ef,ef=aa);ef!==aa?(hb=ne,ne="AS"):(ma=ne,ne=aa)}else ma=ne,ne=aa;var Gg=ne;if(Gg!==aa){Aa();var Sb=ma;var oe=ma;if(c.substr(ma,7).toLowerCase()===Fb){var Wf=c.substr(ma,7);ma+=7}else Wf=aa,0===cb&&m(Ae);if(Wf!==aa){var ff=ma;cb++;var Hg=I();cb--;Hg===aa?ff=void 0:(ma=ff,ff=aa);ff!==aa?(hb=oe,oe="INTEGER"):(ma=oe,oe=aa)}else ma=oe,oe=aa;var jc=oe;jc!==aa&&(hb=Sb,jc={type:"data-type",value:{type:"integer"}});Sb=jc;if(Sb===aa){Sb=ma;var pe=ma;
if(c.substr(ma,8).toLowerCase()===Qb){var Xf=c.substr(ma,8);ma+=8}else Xf=aa,0===cb&&m(yd);if(Xf!==aa){var gf=ma;cb++;var Ig=I();cb--;Ig===aa?gf=void 0:(ma=gf,gf=aa);gf!==aa?(hb=pe,pe="SMALLINT"):(ma=pe,pe=aa)}else ma=pe,pe=aa;jc=pe;jc!==aa&&(hb=Sb,jc={type:"data-type",value:{type:"smallint"}});Sb=jc;if(Sb===aa){Sb=ma;var qe=ma;if(c.substr(ma,5).toLowerCase()===sb){var Yf=c.substr(ma,5);ma+=5}else Yf=aa,0===cb&&m(zd);if(Yf!==aa){var hf=ma;cb++;var Jg=I();cb--;Jg===aa?hf=void 0:(ma=hf,hf=aa);hf!==
aa?(hb=qe,qe="FLOAT"):(ma=qe,qe=aa)}else ma=qe,qe=aa;jc=qe;jc!==aa&&(hb=Sb,jc={type:"data-type",value:{type:"float"}});Sb=jc;if(Sb===aa){Sb=ma;var re=ma;if(c.substr(ma,4).toLowerCase()===vb){var Zf=c.substr(ma,4);ma+=4}else Zf=aa,0===cb&&m(Vd);if(Zf!==aa){var jf=ma;cb++;var Kg=I();cb--;Kg===aa?jf=void 0:(ma=jf,jf=aa);jf!==aa?(hb=re,re="REAL"):(ma=re,re=aa)}else ma=re,re=aa;jc=re;jc!==aa&&(hb=Sb,jc={type:"data-type",value:{type:"real"}});Sb=jc;if(Sb===aa&&(Sb=ma,jc=ya(),jc!==aa&&(hb=Sb,jc={type:"data-type",
value:{type:"date"}}),Sb=jc,Sb===aa&&(Sb=ma,jc=za(),jc!==aa&&(hb=Sb,jc={type:"data-type",value:{type:"timestamp"}}),Sb=jc,Sb===aa&&(Sb=ma,jc=Da(),jc!==aa&&(hb=Sb,jc={type:"data-type",value:{type:"time"}}),Sb=jc,Sb===aa)))){Sb=ma;var se=ma;if(c.substr(ma,7).toLowerCase()===Gb){var $f=c.substr(ma,7);ma+=7}else $f=aa,0===cb&&m(Be);if($f!==aa){var kf=ma;cb++;var Lg=I();cb--;Lg===aa?kf=void 0:(ma=kf,kf=aa);kf!==aa?(hb=se,se="VARCHAR"):(ma=se,se=aa)}else ma=se,se=aa;jc=se;if(jc!==aa){Aa();var Mg=Ha();if(Mg!==
aa){Aa();var ag=ca();if(ag!==aa){Aa();var Ng=Ka();Ng!==aa?(hb=Sb,Sb={type:"data-type",value:{type:"varchar",size:parseInt(ag)}}):(ma=Sb,Sb=aa)}else ma=Sb,Sb=aa}else ma=Sb,Sb=aa}else ma=Sb,Sb=aa}}}}var bg=Sb;if(bg!==aa){Aa();var Og=Ka();Og!==aa?(hb=Nc,Nc={type:"function",name:"cast",args:{type:"expression-list",value:[Uf,bg]}}):(ma=Nc,Nc=aa)}else ma=Nc,Nc=aa}else ma=Nc,Nc=aa}else ma=Nc,Nc=aa}else ma=Nc,Nc=aa}else ma=Nc,Nc=aa;ic=Nc;if(ic===aa){var Dd=ma;var Xc=ma;var Me=E();Me!==aa&&(hb=Xc);Xc=Me;if(Xc===
aa)if(Xc=ma,96===c.charCodeAt(ma)?(Me=dc,ma++):(Me=aa,0===cb&&m(cg)),Me!==aa){var lf=[];if(Yc.test(c.charAt(ma))){var Ed=c.charAt(ma);ma++}else Ed=aa,0===cb&&m(dg);if(Ed!==aa)for(;Ed!==aa;)lf.push(Ed),Yc.test(c.charAt(ma))?(Ed=c.charAt(ma),ma++):(Ed=aa,0===cb&&m(dg));else lf=aa;lf!==aa?(96===c.charCodeAt(ma)?(Ed=dc,ma++):(Ed=aa,0===cb&&m(cg)),Ed!==aa?(hb=Xc,Xc=lf.join("")):(ma=Xc,Xc=aa)):(ma=Xc,Xc=aa)}else ma=Xc,Xc=aa;var eg=Xc;if(eg!==aa){Aa();var Pg=Ha();if(Pg!==aa){Aa();var mf=n();mf===aa&&(mf=
null);Aa();var Qg=Ka();Qg!==aa?(hb=Dd,Dd={type:"function",name:eg,args:mf?mf:{type:"expression-list",value:[]}}):(ma=Dd,Dd=aa)}else ma=Dd,Dd=aa}else ma=Dd,Dd=aa;ic=Dd;if(ic===aa){var pd;var sc=ma;var zf=ua();if(zf!==aa){Aa();var Ne=u();if(Ne!==aa){Aa();var Oe=[];for(pd=Y();pd!==aa;)Oe.push(pd),pd=Y();pd=Aa();var nf=Na();nf!==aa?(hb=sc,sc={type:"case-expression",format:"simple",operand:Ne,clauses:Oe,else:null}):(ma=sc,sc=aa)}else ma=sc,sc=aa}else ma=sc,sc=aa;if(sc===aa)if(sc=ma,zf=ua(),zf!==aa)if(Aa(),
Ne=u(),Ne!==aa){Aa();Oe=[];for(pd=Y();pd!==aa;)Oe.push(pd),pd=Y();pd=Aa();nf=ha();if(nf!==aa){Aa();var Rg=Na();Rg!==aa?(hb=sc,sc={type:"case-expression",format:"simple",operand:Ne,clauses:Oe,else:nf.value}):(ma=sc,sc=aa)}else ma=sc,sc=aa}else ma=sc,sc=aa;else ma=sc,sc=aa;var Af=sc;if(Af===aa){var qd;var Bc=ma;var Bf=ua();if(Bf!==aa){Aa();var Pe=[];for(qd=T();qd!==aa;)Pe.push(qd),qd=T();qd=Aa();var of=Na();of!==aa?(hb=Bc,Bc={type:"case-expression",format:"searched",clauses:Pe,else:null}):(ma=Bc,Bc=
aa)}else ma=Bc,Bc=aa;if(Bc===aa)if(Bc=ma,Bf=ua(),Bf!==aa){Aa();Pe=[];for(qd=T();qd!==aa;)Pe.push(qd),qd=T();qd=Aa();of=ha();if(of!==aa){Aa();var Sg=Na();Sg!==aa?(hb=Bc,Bc={type:"case-expression",format:"searched",clauses:Pe,else:of.value}):(ma=Bc,Bc=aa)}else ma=Bc,Bc=aa}else ma=Bc,Bc=aa;Af=Bc}ic=Af;if(ic===aa){var te=ma;var Tg=ma;var pf;var Qe=ma;var fg=G();if(fg!==aa){var gg=[];for(pf=O();pf!==aa;)gg.push(pf),pf=O();hb=Qe;Qe=fg+gg.join("")}else ma=Qe,Qe=aa;var hg=Qe;hg!==aa&&(hb=Tg);var Fd=hg;if(Fd!==
aa){hb=te;var Cf=Fd;Fd=/^CURRENT_DATE$/i.test(Cf)?{type:"current-time",mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(Cf)?{type:"current-time",mode:"timestamp"}:{type:"column-reference",table:"",column:Cf}}te=Fd;if(te===aa){te=ma;var ue=ma;if(P()!==aa){var qf;var Ug=ma;var Df=[];for(qf=L();qf!==aa;)Df.push(qf),qf=L();hb=Ug;var Vg=Df=Df.join("");var Wg=P();Wg!==aa?(hb=ue,ue=Vg):(ma=ue,ue=aa)}else ma=ue,ue=aa;Fd=ue;Fd!==aa&&(hb=te,Fd={type:"column-reference",table:"",column:Fd,delimited:!0});te=Fd}ic=te;
if(ic===aa&&(ic=M(),ic===aa)){ic=ma;var Xg=Ha();if(Xg!==aa){Aa();var Ef=u();if(Ef!==aa){Aa();var Yg=Ka();Yg!==aa?(hb=ic,Ef.paren=!0,ic=Ef):(ma=ic,ic=aa)}else ma=ic,ic=aa}else ma=ic,ic=aa}}}}}}}}}return ic}function E(){var ta;var Ca=ma;var Oa=G();if(Oa!==aa){var ab=[];for(ta=I();ta!==aa;)ab.push(ta),ta=I();hb=Ca;Ca=Oa+ab.join("")}else ma=Ca,Ca=aa;return Ca}function G(){if(Gc.test(c.charAt(ma))){var ta=c.charAt(ma);ma++}else ta=aa,0===cb&&m(Sd);return ta}function I(){if(Cc.test(c.charAt(ma))){var ta=
c.charAt(ma);ma++}else ta=aa,0===cb&&m(we);return ta}function O(){if(uc.test(c.charAt(ma))){var ta=c.charAt(ma);ma++}else ta=aa,0===cb&&m(Hd);return ta}function L(){if(uc.test(c.charAt(ma))){var ta=c.charAt(ma);ma++}else ta=aa,0===cb&&m(Hd);if(ta===aa)if(ta=ma,P()!==aa){var Ca=P();Ca!==aa?(hb=ta,ta='"'):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function P(){if(oc.test(c.charAt(ma))){var ta=c.charAt(ma);ma++}else ta=aa,0===cb&&m(td);return ta}function M(){var ta;var Ca=ta=ma;if(64===c.charCodeAt(ma)){var Oa=
nb;ma++}else Oa=aa,0===cb&&m(xe);if(Oa!==aa){var ab=E();ab!==aa?Ca=Oa=[Oa,ab]:(ma=Ca,Ca=aa)}else ma=Ca,Ca=aa;Ca!==aa&&(hb=ta,Ca={type:"parameter",value:Ca[1]});return Ca}function K(){var ta=ma;if(c.substr(ma,7).toLowerCase()===rb){var Ca=c.substr(ma,7);ma+=7}else Ca=aa,0===cb&&m(ld);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="LEADING"):(ma=ta,ta=aa)}else ma=ta,ta=aa;ta===aa&&(ta=ma,c.substr(ma,8).toLowerCase()===tb?(Ca=c.substr(ma,8),ma+=8):(Ca=aa,0===
cb&&m(Zc)),Ca!==aa?(Ca=ma,cb++,Oa=I(),cb--,Oa===aa?Ca=void 0:(ma=Ca,Ca=aa),Ca!==aa?(hb=ta,ta="TRAILING"):(ma=ta,ta=aa)):(ma=ta,ta=aa),ta===aa&&(ta=ma,c.substr(ma,4).toLowerCase()===yb?(Ca=c.substr(ma,4),ma+=4):(Ca=aa,0===cb&&m(Md)),Ca!==aa?(Ca=ma,cb++,Oa=I(),cb--,Oa===aa?Ca=void 0:(ma=Ca,Ca=aa),Ca!==aa?(hb=ta,ta="BOTH"):(ma=ta,ta=aa)):(ma=ta,ta=aa)));return ta}function J(){var ta=ma;var Ca=ma;var Oa=R();if(Oa!==aa){Aa();var ab=Ha();if(ab!==aa)if(Aa(),ab=W(),ab!==aa){Aa();var ob=Ka();ob!==aa?(hb=Ca,
Ca={type:"interval-period",period:Oa.value,precision:ab,secondary:null}):(ma=Ca,Ca=aa)}else ma=Ca,Ca=aa;else ma=Ca,Ca=aa}else ma=Ca,Ca=aa;Ca===aa&&(Ca=ma,Oa=R(),Oa!==aa&&(hb=Ca,Oa={type:"interval-period",period:Oa.value,precision:null,secondary:null}),Ca=Oa);if(Ca!==aa)if(Aa(),Oa=ma,c.substr(ma,2).toLowerCase()===Hb?(ab=c.substr(ma,2),ma+=2):(ab=aa,0===cb&&m(Wd)),ab!==aa?(ab=ma,cb++,ob=I(),cb--,ob===aa?ab=void 0:(ma=ab,ab=aa),ab!==aa?(hb=Oa,Oa="TO"):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa),Oa!==aa){Aa();Oa=ma;
ab=R();ab!==aa&&(hb=Oa,ab={type:"interval-period",period:ab.value,precision:null,secondary:null});Oa=ab;if(Oa===aa){Oa=ma;ab=Ea();if(ab!==aa)if(Aa(),ab=Ha(),ab!==aa)if(Aa(),ab=W(),ab!==aa)if(Aa(),ob=sa(),ob!==aa)if(Aa(),ob=Q(),ob!==aa){Aa();var wb=Ka();wb!==aa?(hb=Oa,Oa={type:"interval-period",period:"second",precision:ab,secondary:ob}):(ma=Oa,Oa=aa)}else ma=Oa,Oa=aa;else ma=Oa,Oa=aa;else ma=Oa,Oa=aa;else ma=Oa,Oa=aa;else ma=Oa,Oa=aa;Oa===aa&&(Oa=ma,ab=Ea(),ab!==aa?(Aa(),ab=Ha(),ab!==aa?(Aa(),ab=
W(),ab!==aa?(Aa(),ob=Ka(),ob!==aa?(hb=Oa,Oa={type:"interval-period",period:"second",precision:ab,secondary:null}):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa)):(ma=Oa,Oa=aa),Oa===aa&&(Oa=ma,ab=Ea(),ab!==aa&&(hb=Oa,ab={type:"interval-period",period:"second",precision:null,secondary:null}),Oa=ab))}Oa!==aa?(hb=ta,ta={type:"interval-qualifier",start:Ca,end:Oa}):(ma=ta,ta=aa)}else ma=ta,ta=aa;else ma=ta,ta=aa;ta===aa&&(ta=ma,Oa=R(),Oa!==aa?(Aa(),Ca=Ha(),Ca!==aa?(Aa(),Ca=Q(),Ca!==aa?(Aa(),ab=Ka(),ab!==aa?
(hb=ta,ta={type:"interval-period",period:Oa.value,precision:Ca,secondary:null}):(ma=ta,ta=aa)):(ma=ta,ta=aa)):(ma=ta,ta=aa)):(ma=ta,ta=aa),ta===aa&&(ta=ma,Oa=R(),Oa!==aa&&(hb=ta,Oa={type:"interval-period",period:Oa.value,precision:null,secondary:null}),ta=Oa,ta===aa&&(ta=ma,Oa=Ea(),Oa!==aa?(Aa(),Ca=Ha(),Ca!==aa?(Aa(),Ca=W(),Ca!==aa?(Aa(),ab=sa(),ab!==aa?(Aa(),Oa=Q(),Oa!==aa?(Aa(),ab=Ka(),ab!==aa?(hb=ta,ta={type:"interval-period",period:"second",precision:Ca,secondary:Oa}):(ma=ta,ta=aa)):(ma=ta,ta=
aa)):(ma=ta,ta=aa)):(ma=ta,ta=aa)):(ma=ta,ta=aa)):(ma=ta,ta=aa),ta===aa&&(ta=ma,Oa=Ea(),Oa!==aa?(Aa(),Ca=Ha(),Ca!==aa?(Aa(),Ca=Q(),Ca!==aa?(Aa(),ab=Ka(),ab!==aa?(hb=ta,ta={type:"interval-period",period:"second",precision:Ca,secondary:null}):(ma=ta,ta=aa)):(ma=ta,ta=aa)):(ma=ta,ta=aa)):(ma=ta,ta=aa),ta===aa&&(ta=ma,Oa=Ea(),Oa!==aa&&(hb=ta,Oa={type:"interval-period",period:"second",precision:null,secondary:null}),ta=Oa)))));return ta}function R(){var ta=ma;var Ca=Ga();Ca!==aa&&(hb=ta,Ca={type:"string",
value:"day"});ta=Ca;ta===aa&&(ta=ma,Ca=Pa(),Ca!==aa&&(hb=ta,Ca={type:"string",value:"hour"}),ta=Ca,ta===aa&&(ta=ma,Ca=Qa(),Ca!==aa&&(hb=ta,Ca={type:"string",value:"minute"}),ta=Ca,ta===aa&&(ta=ma,Ca=Ma(),Ca!==aa&&(hb=ta,Ca={type:"string",value:"month"}),ta=Ca,ta===aa&&(ta=ma,Ca=xa(),Ca!==aa&&(hb=ta,Ca={type:"string",value:"year"}),ta=Ca))));return ta}function Q(){var ta=ma;var Ca=ca();Ca!==aa&&(hb=ta,Ca=parseFloat(Ca));return Ca}function W(){var ta=ma;var Ca=ca();Ca!==aa&&(hb=ta,Ca=parseFloat(Ca));
return Ca}function S(){var ta=V();ta===aa&&(ta=M());return ta}function V(){var ta=ma;if(39===c.charCodeAt(ma)){var Ca=qb;ma++}else Ca=aa,0===cb&&m(ad);Ca===aa&&(c.substr(ma,2)===ub?(Ca=ub,ma+=2):(Ca=aa,0===cb&&m(vc)));if(Ca!==aa){Ca=[];var Oa=ma;if(c.substr(ma,2)===xb){var ab=xb;ma+=2}else ab=aa,0===cb&&m(Rc);ab!==aa&&(hb=Oa,ab="'");Oa=ab;Oa===aa&&(yc.test(c.charAt(ma))?(Oa=c.charAt(ma),ma++):(Oa=aa,0===cb&&m(Pc)));for(;Oa!==aa;)Ca.push(Oa),Oa=ma,c.substr(ma,2)===xb?(ab=xb,ma+=2):(ab=aa,0===cb&&m(Rc)),
ab!==aa&&(hb=Oa,ab="'"),Oa=ab,Oa===aa&&(yc.test(c.charAt(ma))?(Oa=c.charAt(ma),ma++):(Oa=aa,0===cb&&m(Pc)));39===c.charCodeAt(ma)?(Oa=qb,ma++):(Oa=aa,0===cb&&m(ad));Oa!==aa?(hb=ta,ta={type:"string",value:Ca.join("")}):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function T(){var ta=ma;if(Ua()!==aa){Aa();var Ca=u();if(Ca!==aa){Aa();var Oa=wa();Oa!==aa?(Aa(),Oa=u(),Oa!==aa?(hb=ta,ta={type:"when-clause",operand:Ca,value:Oa}):(ma=ta,ta=aa)):(ma=ta,ta=aa)}else ma=ta,ta=aa}else ma=ta,ta=aa;return ta}function Y(){var ta=
ma;if(Ua()!==aa){Aa();var Ca=u();if(Ca!==aa){Aa();var Oa=wa();Oa!==aa?(Aa(),Oa=u(),Oa!==aa?(hb=ta,ta={type:"when-clause",operand:Ca,value:Oa}):(ma=ta,ta=aa)):(ma=ta,ta=aa)}else ma=ta,ta=aa}else ma=ta,ta=aa;return ta}function ha(){var ta=ma;var Ca=ma;if(c.substr(ma,4).toLowerCase()===nc){var Oa=c.substr(ma,4);ma+=4}else Oa=aa,0===cb&&m(Fc);if(Oa!==aa){Oa=ma;cb++;var ab=I();cb--;ab===aa?Oa=void 0:(ma=Oa,Oa=aa);Oa!==aa?(hb=Ca,Ca="ELSE"):(ma=Ca,Ca=aa)}else ma=Ca,Ca=aa;Ca!==aa?(Aa(),Ca=u(),Ca!==aa?(hb=
ta,ta={type:"else-clause",value:Ca}):(ma=ta,ta=aa)):(ma=ta,ta=aa);return ta}function ba(){var ta=ca();if(ta===aa){ta=ma;if(45===c.charCodeAt(ma)){var Ca=Xa;ma++}else Ca=aa,0===cb&&m(fd);Ca===aa&&(43===c.charCodeAt(ma)?(Ca=La,ma++):(Ca=aa,0===cb&&m(sd)));if(Ca!==aa){var Oa=ca();Oa!==aa?(hb=ta,ta=Ca[0]+Oa):(ma=ta,ta=aa)}else ma=ta,ta=aa}return ta}function U(){var ta=ma;if(46===c.charCodeAt(ma)){var Ca=pb;ma++}else Ca=aa,0===cb&&m(Sc);Ca!==aa?(Ca=ca(),Ca===aa&&(Ca=null),hb=ta,ta="."+(null!=Ca?Ca:"")):
(ma=ta,ta=aa);return ta}function Z(){var ta;var Ca=ta=ma;if(Hc.test(c.charAt(ma))){var Oa=c.charAt(ma);ma++}else Oa=aa,0===cb&&m(Tc);Oa!==aa?(Oc.test(c.charAt(ma))?(Oa=c.charAt(ma),ma++):(Oa=aa,0===cb&&m(Uc)),Oa===aa&&(Oa=null),hb=Ca,Ca="e"+(null===Oa?"":Oa)):(ma=Ca,Ca=aa);Ca!==aa?(Oa=ca(),Oa!==aa?(hb=ta,ta=Ca+Oa):(ma=ta,ta=aa)):(ma=ta,ta=aa);return ta}function ca(){var ta=ma;var Ca=[];var Oa=ea();if(Oa!==aa)for(;Oa!==aa;)Ca.push(Oa),Oa=ea();else Ca=aa;Ca!==aa&&(hb=ta,Ca=Ca.join(""));return Ca}function ea(){if(Dc.test(c.charAt(ma))){var ta=
c.charAt(ma);ma++}else ta=aa,0===cb&&m(ud);return ta}function da(){var ta=ma;if(c.substr(ma,2).toLowerCase()===Ib){var Ca=c.substr(ma,2);ma+=2}else Ca=aa,0===cb&&m(gd);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="IN"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function ia(){var ta=ma;if(c.substr(ma,2).toLowerCase()===$b){var Ca=c.substr(ma,2);ma+=2}else Ca=aa,0===cb&&m(hd);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=
ta,ta="IS"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function ka(){var ta=ma;if(c.substr(ma,4).toLowerCase()===kc){var Ca=c.substr(ma,4);ma+=4}else Ca=aa,0===cb&&m(Ec);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="LIKE"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function fa(){var ta=ma;if(c.substr(ma,3).toLowerCase()===Pb){var Ca=c.substr(ma,3);ma+=3}else Ca=aa,0===cb&&m(Jd);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=
ta,ta="NOT"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function X(){var ta=ma;if(c.substr(ma,3).toLowerCase()===Cb){var Ca=c.substr(ma,3);ma+=3}else Ca=aa,0===cb&&m(jd);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="AND"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function ja(){var ta=ma;if(c.substr(ma,2).toLowerCase()===Vb){var Ca=c.substr(ma,2);ma+=2}else Ca=aa,0===cb&&m(ye);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=
ta,ta="OR"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function la(){var ta=ma;if(c.substr(ma,7).toLowerCase()===gc){var Ca=c.substr(ma,7);ma+=7}else Ca=aa,0===cb&&m(kd);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="BETWEEN"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function na(){var ta=ma;if(c.substr(ma,4).toLowerCase()===Lb){var Ca=c.substr(ma,4);ma+=4}else Ca=aa,0===cb&&m(vd);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?
(hb=ta,ta="FROM"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function va(){var ta=ma;if(c.substr(ma,4).toLowerCase()===Va){var Ca=c.substr(ma,4);ma+=4}else Ca=aa,0===cb&&m(Ld);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="TRIM"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function za(){var ta=ma;if(c.substr(ma,9).toLowerCase()===fb){var Ca=c.substr(ma,9);ma+=9}else Ca=aa,0===cb&&m(Ud);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==
aa?(hb=ta,ta="TIMESTAMP"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function ya(){var ta=ma;if(c.substr(ma,4).toLowerCase()===kb){var Ca=c.substr(ma,4);ma+=4}else Ca=aa,0===cb&&m(xd);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="DATE"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function Da(){var ta=ma;if(c.substr(ma,4).toLowerCase()===mb){var Ca=c.substr(ma,4);ma+=4}else Ca=aa,0===cb&&m(Vc);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=
aa);Ca!==aa?(hb=ta,ta="TIME"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function ra(){var ta=ma;if(c.substr(ma,8).toLowerCase()===Tb){var Ca=c.substr(ma,8);ma+=8}else Ca=aa,0===cb&&m(Xd);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="INTERVAL"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function xa(){var ta=ma;if(c.substr(ma,4).toLowerCase()===lc){var Ca=c.substr(ma,4);ma+=4}else Ca=aa,0===cb&&m(Od);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=
Ca,Ca=aa);Ca!==aa?(hb=ta,ta="YEAR"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function Ma(){var ta=ma;if(c.substr(ma,5).toLowerCase()===ac){var Ca=c.substr(ma,5);ma+=5}else Ca=aa,0===cb&&m($c);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="MONTH"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function Ga(){var ta=ma;if(c.substr(ma,3).toLowerCase()===Mb){var Ca=c.substr(ma,3);ma+=3}else Ca=aa,0===cb&&m(Zd);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:
(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="DAY"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function Pa(){var ta=ma;if(c.substr(ma,4).toLowerCase()===Jb){var Ca=c.substr(ma,4);ma+=4}else Ca=aa,0===cb&&m(md);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="HOUR"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function Qa(){var ta=ma;if(c.substr(ma,6).toLowerCase()===Wb){var Ca=c.substr(ma,6);ma+=6}else Ca=aa,0===cb&&m(cd);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:
(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="MINUTE"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function Ea(){var ta=ma;if(c.substr(ma,6).toLowerCase()===cc){var Ca=c.substr(ma,6);ma+=6}else Ca=aa,0===cb&&m(nd);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="SECOND"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function ua(){var ta=ma;if(c.substr(ma,4).toLowerCase()===Db){var Ca=c.substr(ma,4);ma+=4}else Ca=aa,0===cb&&m($d);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=
void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="CASE"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function Na(){var ta=ma;if(c.substr(ma,3).toLowerCase()===Nb){var Ca=c.substr(ma,3);ma+=3}else Ca=aa,0===cb&&m(Eb);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="END"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function Ua(){var ta=ma;if(c.substr(ma,4).toLowerCase()===hc){var Ca=c.substr(ma,4);ma+=4}else Ca=aa,0===cb&&m(ec);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?
Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="WHEN"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function wa(){var ta=ma;if(c.substr(ma,4).toLowerCase()===xc){var Ca=c.substr(ma,4);ma+=4}else Ca=aa,0===cb&&m(pc);if(Ca!==aa){Ca=ma;cb++;var Oa=I();cb--;Oa===aa?Ca=void 0:(ma=Ca,Ca=aa);Ca!==aa?(hb=ta,ta="THEN"):(ma=ta,ta=aa)}else ma=ta,ta=aa;return ta}function sa(){if(44===c.charCodeAt(ma)){var ta=Xb;ma++}else ta=aa,0===cb&&m(Fe);return ta}function Ha(){if(40===c.charCodeAt(ma)){var ta=tc;ma++}else ta=aa,0===
cb&&m(Zg);return ta}function Ka(){if(41===c.charCodeAt(ma)){var ta=Yb;ma++}else ta=aa,0===cb&&m($g);return ta}function Aa(){var ta;var Ca=[];for(ta=Sa();ta!==aa;)Ca.push(ta),ta=Sa();return Ca}function Sa(){if(dd.test(c.charAt(ma))){var ta=c.charAt(ma);ma++}else ta=aa,0===cb&&m(ah);return ta}function Ya(ta,Ca,Oa,ab){ta={type:"binary-expression",operator:ta,left:Ca,right:Oa};void 0!==ab&&(ta.escape=ab);return ta}function qa(ta,Ca){for(var Oa=0;Oa<Ca.length;Oa++)ta=Ya(Ca[Oa][1],ta,Ca[Oa][3]);return ta}
e=void 0!==e?e:{};var aa={},Ja=e.grammarSource,Ta={start:r},Ra=r,$a="!",bb="\x3d",pa="\x3e\x3d",Ba="\x3e",Ia="\x3c\x3d",Wa="\x3c\x3e",gb="\x3c",ib="!\x3d",La="+",Xa="-",eb="||",db="*",jb="/",nb="@",qb="'",ub="N'",xb="''",pb=".",Bb="null",Kb="true",bc="false",Ib="in",$b="is",kc="like",fc="escape",Pb="not",Cb="and",Vb="or",gc="between",Lb="from",lb="for",oa="substring",Fa="extract",Va="trim",Za="position",fb="timestamp",kb="date",mb="time",rb="leading",tb="trailing",yb="both",zb="cast",Ab="as",Fb="integer",
Qb="smallint",sb="float",vb="real",Gb="varchar",Hb="to",Tb="interval",lc="year",Ub="timezone_hour",Zb="timezone_minute",ac="month",Mb="day",Jb="hour",Wb="minute",cc="second",Db="case",Nb="end",hc="when",xc="then",nc="else",Xb=",",tc="(",Yb=")",dc="`",Gc=/^[A-Za-z_\x80-\uFFFF]/,Cc=/^[A-Za-z0-9_]/,uc=/^[A-Za-z0-9_.\x80-\uFFFF]/,oc=/^["]/,yc=/^[^']/,Dc=/^[0-9]/,Hc=/^[eE]/,Oc=/^[+\-]/,dd=/^[ \t\n\r]/,Yc=/^[^`]/,Ic=d("!",!1),wc=d("\x3d",!1),qc=d("\x3e\x3d",!1),zc=d("\x3e",!1),rd=d("\x3c\x3d",!1),Pd=d("\x3c\x3e",
!1),ed=d("\x3c",!1),Qd=d("!\x3d",!1),sd=d("+",!1),fd=d("-",!1),Rd=d("||",!1),Gd=d("*",!1),ve=d("/",!1),Sd=t([["A","Z"],["a","z"],"_",["\u0080","\uffff"]],!1,!1),we=t([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),Hd=t([["A","Z"],["a","z"],["0","9"],"_",".",["\u0080","\uffff"]],!1,!1),td=t(['"'],!1,!1),xe=d("@",!1),ad=d("'",!1),vc=d("N'",!1),Rc=d("''",!1),Pc=t(["'"],!0,!1),Sc=d(".",!1),ud=t([["0","9"]],!1,!1),Tc=t(["e","E"],!1,!1),Uc=t(["+","-"],!1,!1),Qc=d("NULL",!0),Id=d("TRUE",!0),Ac=d("FALSE",!0),
gd=d("IN",!0),hd=d("IS",!0),Ec=d("LIKE",!0),id=d("ESCAPE",!0),Jd=d("NOT",!0),jd=d("AND",!0),ye=d("OR",!0),kd=d("BETWEEN",!0),vd=d("FROM",!0),bd=d("FOR",!0),Kd=d("SUBSTRING",!0),wd=d("EXTRACT",!0),Ld=d("TRIM",!0),Td=d("POSITION",!0),Ud=d("TIMESTAMP",!0),xd=d("DATE",!0),Vc=d("TIME",!0),ld=d("LEADING",!0),Zc=d("TRAILING",!0),Md=d("BOTH",!0),Nd=d("CAST",!0),ze=d("AS",!0),Ae=d("INTEGER",!0),yd=d("SMALLINT",!0),zd=d("FLOAT",!0),Vd=d("REAL",!0),Be=d("VARCHAR",!0),Wd=d("TO",!0),Xd=d("INTERVAL",!0),Od=d("YEAR",
!0),Wc=d("TIMEZONE_HOUR",!0),Yd=d("TIMEZONE_MINUTE",!0),$c=d("MONTH",!0),Zd=d("DAY",!0),md=d("HOUR",!0),cd=d("MINUTE",!0),nd=d("SECOND",!0),$d=d("CASE",!0),Eb=d("END",!0),ec=d("WHEN",!0),pc=d("THEN",!0),Fc=d("ELSE",!0),Fe=d(",",!1),Zg=d("(",!1),$g=d(")",!1),ah=t([" ","\t","\n","\r"],!1,!1),cg=d("`",!1),dg=t(["`"],!0,!1),ma=0,hb=0,Re=[{line:1,column:1}],od=0,rf=[],cb=0;if("startRule"in e){if(!(e.startRule in Ta))throw Error("Can't start parsing from rule \""+e.startRule+'".');Ra=Ta[e.startRule]}var Ff=
Ra();if(Ff!==aa&&ma===c.length)return Ff;Ff!==aa&&ma<c.length&&m({type:"end"});throw function(ta,Ca,Oa){return new h(h.buildMessage(ta,Ca),ta,Ca,Oa)}(rf,od<c.length?c.charAt(od):null,od<c.length?v(od,od+1):v(od,od));}}})})(q);var l=q.exports;class p{static parse(k){return l.parse(k)}}a.WhereGrammar=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/geometryUtils":function(){define(["exports","../featureConversionUtils","../OptimizedGeometry"],function(a,b,
q){const l=new q,p=new q,k=new q,h={esriGeometryPoint:b.convertToPoint,esriGeometryPolyline:b.convertToPolyline,esriGeometryPolygon:b.convertToPolygon,esriGeometryMultipoint:b.convertToMultipoint},f=(c,e)=>"_geVersion"!==c?e:void 0;a.cleanFromGeometryEngine=function(c){return c&&"_geVersion"in c?JSON.parse(JSON.stringify(c,f)):c};a.getGeometry=function(c,e,g,d,t,w,v=e,m=g){const r=e&&v,n=g&&m;d=null!=d?"coords"in d?d:d.geometry:null;if(null==d)return null;if(t)return e=b.generalizeOptimizedGeometry(p,
d,e,g,c,t,v,m),w&&(e=b.quantizeOptimizedGeometry(k,e,r,n,c,w)),h[c]?.(e,r,n)??null;if(w)return w=b.quantizeOptimizedGeometry(k,d,e,g,c,w,v,m),h[c]?.(w,r,n)??null;b.removeZMValues(l,d,e,g,v,m);return h[c]?.(l,r,n)??null};a.transformCentroid=function(c,e,g,d=c.hasZ,t=c.hasM){if(null==e)return null;const w=c.hasZ&&d,v=c.hasM&&t;return g?(c=b.quantizeOptimizedGeometry(k,e,c.hasZ,c.hasM,"esriGeometryPoint",g,d,t),b.convertToPoint(c,w,v)):b.convertToPoint(e,w,v)};Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/layers/graphics/data/projectionSupport":function(){define("exports ../../../core/arrayUtils ../../../core/promiseUtils ../../../geometry/projection ../../../geometry/geometryAdapters/json ../../../geometry/support/spatialReferenceUtils ../../../geometry/support/webMercatorUtils".split(" "),function(a,b,q,l,p,k,h){function f(m,r){if(!r)return null;if("x"in r){var n={x:0,y:0};[n.x,n.y]=m(r.x,r.y,g);null!=r.z&&(n.z=r.z);null!=r.m&&(n.m=r.m);return n}return"xmin"in r?(n={xmin:0,
ymin:0,xmax:0,ymax:0},[n.xmin,n.ymin]=m(r.xmin,r.ymin,g),[n.xmax,n.ymax]=m(r.xmax,r.ymax,g),r.hasZ&&(n.zmin=r.zmin,n.zmax=r.zmax,n.hasZ=!0),r.hasM&&(n.mmin=r.mmin,n.mmax=r.mmax,n.hasM=!0),n):"rings"in r?{rings:c(r.rings,m),hasM:r.hasM,hasZ:r.hasZ}:"paths"in r?{paths:c(r.paths,m),hasM:r.hasM,hasZ:r.hasZ}:"points"in r?{points:e(r.points,m),hasM:r.hasM,hasZ:r.hasZ}:null}function c(m,r){const n=[];for(const u of m)n.push(e(u,r));return n}function e(m,r){const n=[];for(const u of m)m=r(u[0],u[1],[0,0]),
n.push(m),2<u.length&&m.push(u[2]),3<u.length&&m.push(u[3]);return n}const g=[0,0],d=f.bind(null,h.lngLatToXY),t=f.bind(null,h.xyToLngLat);class w{constructor(){this._jobs=[];this._timer=null;this._process=this._process.bind(this)}async push(m,r,n,u){if(!m?.length||!r||!n||k.equals(r,n))return m;m={geometries:m,inSpatialReference:r,outSpatialReference:n,geographicTransformation:u,resolve:q.createResolver()};this._jobs.push(m);this._timer??(this._timer=setTimeout(this._process,10));return m.resolve.promise}_process(){this._timer=
null;const m=this._jobs.shift();if(m){var {geometries:r,inSpatialReference:n,outSpatialReference:u,resolve:x,geographicTransformation:y}=m;h.canProject(n,u)?k.isWebMercator(u)?x(r.map(d)):x(r.map(t)):x(l.projectMany(p.jsonAdapter,r,n,u,y,null));0<this._jobs.length&&(this._timer=setTimeout(this._process,10))}}}const v=new w;a.checkProjectionSupport=async function(m,r){m&&r&&(m=Array.isArray(m)?m.map(n=>null!=n.geometry?n.geometry.spatialReference:null).filter(b.isSome):[m],await l.initializeProjection(m.map(n=>
({source:n,dest:r}))))};a.project=function(m,r,n,u){if(!m)return m;n||(n=r,r=m.spatialReference);return k.isValid(r)&&k.isValid(n)&&!k.equals(r,n)?h.canProject(r,n)?(m=k.isWebMercator(n)?d(m):t(m),m.spatialReference=n,m):l.projectMany(p.jsonAdapter,[m],r,n,null,u)[0]:m};a.projectMany=function(m,r,n,u){return v.push(m,r,n,u)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/geometryAdapters/json":function(){define(["exports"],function(a){class b{constructor(h,f,c){this.x=
h;this.y=f;this.spatialReference=c;this.m=this.z=void 0}}class q{constructor(h,f,c,e){this.rings=h;this.spatialReference=f;this.hasM=this.hasZ=void 0;c&&(this.hasZ=c);e&&(this.hasM=e)}}class l{constructor(h,f,c,e){this.paths=h;this.spatialReference=f;this.hasM=this.hasZ=void 0;c&&(this.hasZ=c);e&&(this.hasM=e)}}class p{constructor(h,f,c,e){this.points=h;this.spatialReference=f;this.hasM=this.hasZ=void 0;c&&(this.hasZ=c);e&&(this.hasM=e)}}class k{constructor(h,f,c,e,g){this.xmin=h;this.ymin=f;this.xmax=
c;this.ymax=e;this.spatialReference=g;this.mmax=this.mmin=this.zmax=this.zmin=void 0}}a.jsonAdapter={convertToGEGeometry:function(h,f){return null==f?null:h.convertJSONToGeometry(f)},exportPoint:function(h,f,c){c=new b(h.getPointX(f),h.getPointY(f),c);const e=h.hasZ(f),g=h.hasM(f);e&&(c.z=h.getPointZ(f));g&&(c.m=h.getPointM(f));return c},exportPolygon:function(h,f,c){return new q(h.exportPaths(f),c,h.hasZ(f),h.hasM(f))},exportPolyline:function(h,f,c){return new l(h.exportPaths(f),c,h.hasZ(f),h.hasM(f))},
exportMultipoint:function(h,f,c){return new p(h.exportPoints(f),c,h.hasZ(f),h.hasM(f))},exportExtent:function(h,f,c){var e=h.hasZ(f);const g=h.hasM(f);c=new k(h.getXMin(f),h.getYMin(f),h.getXMax(f),h.getYMax(f),c);e&&(e=h.getZExtent(f),c.zmin=e.vmin,c.zmax=e.vmax);g&&(h=h.getMExtent(f),c.mmin=h.vmin,c.mmax=h.vmax);return c}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/QueryEngineResult":function(){define("require exports ../../../core/lang ../../../geometry/support/centroid ../../../geometry/support/extentUtils ../../../geometry/support/quantizationUtils ../../../geometry/support/spatialReferenceUtils ./AttributesBuilder ./geometryUtils ./projectionSupport ./SnappingCandidate ../../support/fieldUtils ../../../statistics/utils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){function w(n,u,x,y){const z=y.x-x.x;y=y.y-x.y;u=Math.min(1,Math.max(0,((u.x-x.x)*z+(u.y-x.y)*y)/(z*z+y*y)));n.x=x.x+z*u;n.y=x.y+y*u}function v(n,u){return n?u?4:3:u?3:2}class m{constructor(n,u,x){this.items=n;this.query=u;this.geometryType=x.geometryType;this.hasM=x.hasM;this.hasZ=x.hasZ;this.fieldsIndex=x.fieldsIndex;this.objectIdField=x.objectIdField;this.spatialReference=x.spatialReference;this.featureAdapter=x.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const n=
new f(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return n.countDistinctValues(this.items);const {groupByFieldsForStatistics:u,having:x,outStatistics:y}=this.query;if(!u?.length)return 1;const z=new Map,A=new Map,B=new Set;for(const F of y){var {statisticType:C}=F;C="exceedslimit"!==C?F.onStatisticField:void 0;if(!A.has(C)){var D=[];for(const H of u){const N=this._getAttributeValues(n,H,z);D.push(N)}A.set(C,this._calculateUniqueValues(D,n.returnDistinctValues))}C=
A.get(C);for(const H in C){const {data:N,items:E}=C[H];D=N.join(",");x&&!n.validateItems(E,x)||B.add(D)}}return B.size}async createQueryResponse(){let n;n=this.query.outStatistics?this.query.outStatistics.some(u=>"exceedslimit"===u.statisticType)?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const u=this.query.geometry;h.isValid(this.query.outSR)&&!h.equals(u.spatialReference,
this.query.outSR)?n.queryGeometry=c.cleanFromGeometryEngine({spatialReference:this.query.outSR,...e.project(u,u.spatialReference,this.query.outSR)}):n.queryGeometry=c.cleanFromGeometryEngine({spatialReference:this.query.outSR,...u})}return n}createSnappingResponse(n,u){const x=this.featureAdapter,y=v(this.hasZ,this.hasM),{point:z,mode:A}=n,B="number"===typeof n.distance?n.distance:n.distance.x,C="number"===typeof n.distance?n.distance:n.distance.y,D={candidates:[]},F="esriGeometryPolygon"===this.geometryType;
u=this._getPointCreator(A,this.spatialReference,u);const H=new r(null,0),N=new r(null,0),E={x:0,y:0,z:0};for(const K of this.items){var G=x.getGeometry(K);if(null==G)continue;const {coords:J,lengths:R}=G;H.coords=J;N.coords=J;if(n.returnEdge){G=0;for(var I=0;I<R.length;I++){var O=R[I];for(var L=0;L<O;L++,G+=y){var P=H;P.coordsIndex=G;if(L!==O-1){const Q=N;Q.coordsIndex=G+y;const W=E;w(E,z,P,Q);var M=(z.x-W.x)/B;const S=(z.y-W.y)/C;M=M*M+S*S;1>=M&&D.candidates.push(g.makeEdgeCandidate(x.getObjectId(K),
u(W),Math.sqrt(M),u(P),u(Q)))}}}}if("none"!==n.vertexMode)if(G=F?J.length-y:J.length,"all"===n.vertexMode)for(I=0;I<G;I+=y)O=H,O.coordsIndex=I,L=(z.x-O.x)/B,P=(z.y-O.y)/C,L=L*L+P*P,1>=L&&D.candidates.push(g.makeVertexCandidate(x.getObjectId(K),u(O),Math.sqrt(L)));else if("ends"===n.vertexMode){G=[0];F||G.push(J.length-y);for(const Q of G)G=H,G.coordsIndex=Q,I=(z.x-G.x)/B,O=(z.y-G.y)/C,I=I*I+O*O,1>=I&&D.candidates.push(g.makeVertexCandidate(x.getObjectId(K),u(G),Math.sqrt(I)))}}D.candidates.sort((K,
J)=>K.distance-J.distance);return D}_getPointCreator(n,u,x){const y=null==x||h.equals(u,x)?A=>A:A=>e.project(A,u,x),{hasZ:z}=this;return"3d"===n?z?({x:A,y:B,z:C})=>y({x:A,y:B,z:C}):({x:A,y:B})=>y({x:A,y:B,z:0}):({x:A,y:B})=>y({x:A,y:B})}async createSummaryStatisticsResponse(n){const {field:u,valueExpression:x,normalizationField:y,normalizationType:z,normalizationTotal:A,minValue:B,maxValue:C,scale:D,timeZone:F}=n;var H=this.fieldsIndex.get(u);n=d.isDateField(H)||d.isDateOnlyField(H)||d.isTimestampOffsetField(H);
const N=await this._getDataValues({field:u,valueExpression:x,normalizationField:y,normalizationType:z,normalizationTotal:A,scale:D,timeZone:F}),E=t.isNullCountSupported({normalizationType:z,normalizationField:y,minValue:B,maxValue:C}),G={value:.5,fieldType:H?.type};H=d.isStringField(H)?t.calculateStringStatistics({values:N,supportsNullCount:E,percentileParams:G}):t.calculateStatistics({values:N,minValue:B,maxValue:C,useSampleStdDev:!z,supportsNullCount:E,percentileParams:G});return t.processSummaryStatisticsResult(H,
n)}async createUniqueValuesResponse(n){const {field:u,valueExpression:x,domains:y,returnAllCodedValues:z,scale:A,timeZone:B}=n;var C=await this._getDataValues({field:u,field2:n.field2,field3:n.field3,fieldDelimiter:n.fieldDelimiter,valueExpression:x,scale:A,timeZone:B},!1);C=t.calculateUniqueValuesCount(C);return t.createUVResult(C,y,z,n.fieldDelimiter)}async createClassBreaksResponse(n){const {field:u,valueExpression:x,normalizationField:y,normalizationType:z,normalizationTotal:A,classificationMethod:B,
standardDeviationInterval:C,minValue:D,maxValue:F,numClasses:H,scale:N,timeZone:E}=n;n=await this._getDataValues({field:u,valueExpression:x,normalizationField:y,normalizationType:z,normalizationTotal:A,scale:N,timeZone:E});n=t.calculateClassBreaks(n,{field:u,normalizationField:y,normalizationType:z,normalizationTotal:A,classificationMethod:B,standardDeviationInterval:C,minValue:D,maxValue:F,numClasses:H});return t.resolveCBResult(n,B)}async createHistogramResponse(n){const {field:u,valueExpression:x,
normalizationField:y,normalizationType:z,normalizationTotal:A,classificationMethod:B,standardDeviationInterval:C,minValue:D,maxValue:F,numBins:H,scale:N,timeZone:E}=n;n=await this._getDataValues({field:u,valueExpression:x,normalizationField:y,normalizationType:z,normalizationTotal:A,scale:N,timeZone:E});return t.calculateHistogram(n,{field:u,normalizationField:y,normalizationType:z,normalizationTotal:A,classificationMethod:B,standardDeviationInterval:C,minValue:D,maxValue:F,numBins:H})}_sortFeatures(n,
u,x){if(1<n.length&&u?.length)for(const y of u.reverse()){u=y.split(" ");const z=u[0],A=this.fieldsIndex.get(z);u=u[1]?"desc"===u[1].toLowerCase():!1;const B=t.getAttributeComparator(A?.type,u);n.sort((C,D)=>{C=x(C,z,A);D=x(D,z,A);return B(C,D)})}}_createFeatureQueryResponse(n){const u=this.items,{geometryType:x,hasM:y,hasZ:z,objectIdField:A,spatialReference:B}=this,{outFields:C,outSR:D,quantizationParameters:F,resultRecordCount:H,resultOffset:N,returnZ:E,returnM:G}=n,I=null!=H?u.length>(N||0)+H:
!1,O=C&&(C.includes("*")?[...this.fieldsIndex.fields]:C.map(L=>this.fieldsIndex.get(L)));return{exceededTransferLimit:I,features:this._createFeatures(n,u),fields:O,geometryType:x,hasM:y&&G,hasZ:z&&E,objectIdFieldName:A,spatialReference:c.cleanFromGeometryEngine(D||B),transform:F&&k.toQuantizationTransform(F)||null}}_createFeatures(n,u){const x=new f(n,this.featureAdapter,this.fieldsIndex),{hasM:y,hasZ:z}=this,{orderByFields:A,quantizationParameters:B,returnGeometry:C,returnCentroid:D,maxAllowableOffset:F,
resultOffset:H,resultRecordCount:N,returnZ:E=!1,returnM:G=!1}=n,I=z&&E,O=y&&G;n=[];var L=0;const P=[...u];this._sortFeatures(P,A,(Q,W,S)=>x.getFieldValue(Q,W,S));if(this.geometryType&&(C||D)){var M=k.toQuantizationTransform(B)??void 0;u="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(C&&!D)for(var K of P){var J=this.featureAdapter.getGeometry(K),R={attributes:x.getAttributes(K),geometry:c.getGeometry(this.geometryType,this.hasZ,this.hasM,J,F,M,I,O)};u&&J&&
!R.geometry&&(R.centroid=c.transformCentroid(this,this.featureAdapter.getCentroid(K,this),M));n[L++]=R}else if(!C&&D)for(J of P)n[L++]={attributes:x.getAttributes(J),centroid:c.transformCentroid(this,this.featureAdapter.getCentroid(J,this),M)};else for(R of P)n[L++]={attributes:x.getAttributes(R),centroid:c.transformCentroid(this,this.featureAdapter.getCentroid(R,this),M),geometry:c.getGeometry(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(R),F,M,I,O)}}else for(M of P)(K=x.getAttributes(M))&&
(n[L++]={attributes:K});L=H||0;null!=N&&(n=n.slice(L,Math.min(n.length,L+N)));return n}_createExceedsLimitQueryResponse(n){var u=!1;let x=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY;u=Number.POSITIVE_INFINITY;for(const z of n.outStatistics??[])if("exceedslimit"===z.statisticType){x=null!=z.maxPointCount?z.maxPointCount:Number.POSITIVE_INFINITY;y=null!=z.maxRecordCount?z.maxRecordCount:Number.POSITIVE_INFINITY;u=null!=z.maxVertexCount?z.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===
this.geometryType)u=this.items.length>x;else if(this.items.length>y)u=!0;else{n=v(this.hasZ,this.hasM);const z=this.featureAdapter;u=this.items.reduce((A,B)=>{B=z.getGeometry(B);return A+(null!=B&&B.coords.length||0)},0)/n>u}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(u)}}]}}async _createStatisticsQueryResponse(n){var u={attributes:{}};const x=[],y=new Map,z=
new Map,A=new Map,B=new Map,C=new f(n,this.featureAdapter,this.fieldsIndex);var D=n.outStatistics;const {groupByFieldsForStatistics:F,having:H,orderByFields:N,resultRecordCount:E}=n;n=F?.length;const G=!!n,I=G?F[0]:null,O=G&&!this.fieldsIndex.get(I);for(const J of D??[]){const {outStatisticFieldName:R,statisticType:Q}=J;D=J;const W="exceedslimit"!==Q?J.onStatisticField:void 0,S="percentile_disc"===Q||"percentile_cont"===Q;var L="EnvelopeAggregate"===Q||"CentroidAggregate"===Q||"ConvexHullAggregate"===
Q;const V=G&&1===n&&(W===I||O)&&"count"===Q;if(G){if(!A.has(W)){var P=[];for(const T of F){var M=this._getAttributeValues(C,T,y);P.push(M)}A.set(W,this._calculateUniqueValues(P,L?!1:C.returnDistinctValues))}P=A.get(W);if(!P)continue;M=Object.keys(P);for(const T of M){const {count:Y,data:ha,items:ba,itemPositions:U}=P[T];M=ha.join(",");if(!H||C.validateItems(ba,H)){const Z=B.get(M)||{attributes:{}};if(L){Z.aggregateGeometries||(Z.aggregateGeometries={});const {aggregateGeometries:ea,outStatisticFieldName:da}=
await this._getAggregateGeometry(D,ba);Z.aggregateGeometries[da]=ea}else{var K=null;if(V)K=Y;else{const ea=this._getAttributeValues(C,W,y);K=U.map(da=>ea[da]);K=S&&"statisticParameters"in D?this._getPercentileValue(D,K):this._getStatisticValue(D,K,null,C.returnDistinctValues)}Z.attributes[R]=K}let ca=0;F.forEach((ea,da)=>Z.attributes[this.fieldsIndex.get(ea)?ea:`EXPR_${++ca}`]=ha[da]);B.set(M,Z)}}}else if(L){u.aggregateGeometries||(u.aggregateGeometries={});const {aggregateGeometries:T,outStatisticFieldName:Y}=
await this._getAggregateGeometry(D,this.items);u.aggregateGeometries[Y]=T}else L=this._getAttributeValues(C,W,y),u.attributes[R]=S&&"statisticParameters"in D?this._getPercentileValue(D,L):this._getStatisticValue(D,L,z,C.returnDistinctValues);D="min"!==Q&&"max"!==Q||!d.isStringField(this.fieldsIndex.get(W))&&!this._isAnyDateField(W)?null:this.fieldsIndex.get(W)?.type;x.push({name:R,alias:R,type:D||"esriFieldTypeDouble"})}u=G?Array.from(B.values()):[u];this._sortFeatures(u,N,(J,R)=>J.attributes[R]);
E&&(u.length=Math.min(E,u.length));return{fields:x,features:u}}_isAnyDateField(n){n=this.fieldsIndex.get(n);return d.isDateField(n)||d.isDateOnlyField(n)||d.isTimestampOffsetField(n)||d.isTimeOnlyField(n)}async _getAggregateGeometry(n,u){const {convexHull:x,union:y}=await new Promise((E,G)=>a(["../../../geometry/geometryEngineJSON"],E,G)),{statisticType:z,outStatisticFieldName:A}=n,{featureAdapter:B,spatialReference:C,geometryType:D,hasZ:F,hasM:H}=this;u=u.map(E=>c.getGeometry(D,F,H,B.getGeometry(E)));
const N=x(C,u,!0)[0];n={aggregateGeometries:null,outStatisticFieldName:null};"EnvelopeAggregate"===z?(u=N?p.getPolygonExtent(N):p.getGeometryExtent(y(C,u)),n.aggregateGeometries={...u,spatialReference:C},n.outStatisticFieldName=A||"extent"):"CentroidAggregate"===z?(u=N?l.polygonCentroid(N):l.extentCentroid(p.getGeometryExtent(y(C,u))),n.aggregateGeometries={x:u[0],y:u[1],spatialReference:C},n.outStatisticFieldName=A||"centroid"):"ConvexHullAggregate"===z&&(n.aggregateGeometries=N,n.outStatisticFieldName=
A||"convexHull");return n}_getStatisticValue(n,u,x,y){const {onStatisticField:z,statisticType:A}=n;n=null;n=x?.has(z)?x.get(z):d.isStringField(this.fieldsIndex.get(z))||this._isAnyDateField(z)?t.calculateStringStatistics({values:u,returnDistinct:y}):t.calculateStatistics({values:y?[...(new Set(u))]:u,minValue:null,maxValue:null,useSampleStdDev:!0});x&&x.set(z,n);return n["var"===A?"variance":A]}_getPercentileValue(n,u){const {onStatisticField:x,statisticParameters:y,statisticType:z}=n,{value:A,orderBy:B}=
y;n=this.fieldsIndex.get(x);return t.calculatePercentile(u,{value:A,orderBy:B,fieldType:n?.type,isDiscrete:"percentile_disc"===z})}_getAttributeValues(n,u,x){if(x.has(u))return x.get(u);const y=this.fieldsIndex.get(u),z=this.items.map(A=>n.getFieldValue(A,u,y));x.set(u,z);return z}_calculateUniqueValues(n,u){const x={},y=this.items,z=y.length;for(let A=0;A<z;A++){const B=y[A],C=[];for(const F of n)C.push(F[A]);const D=C.join(",");null==x[D]?x[D]={count:1,data:C,items:[B],itemPositions:[A]}:(u||x[D].count++,
x[D].items.push(B),x[D].itemPositions.push(A))}return x}async _getDataValues(n,u=!0){const x=new f(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:y,scale:z,timeZone:A}=n;return y?x.getExpressionValues(this.items,y,{viewingMode:"map",scale:z,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},A):x.getDataValues(this.items,q.clone(n),u)}}class r{constructor(n,u){this.coords=n;this.coordsIndex=u}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+
1]}get z(){return this.coords[this.coordsIndex+2]}}b.QueryEngineResult=m;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/AttributesBuilder":function(){define("./attributeSupport ./geometryUtils ../../support/fieldUtils ../../../smartMapping/statistics/support/utils ../../../statistics/utils ../../../support/arcadeOnDemand".split(" "),function(a,b,q,l,p,k){class h{constructor(f,c,e){this._fieldDataCache=new Map;this._returnDistinctMap=new Map;this.returnDistinctValues=
f.returnDistinctValues??!1;this.fieldsIndex=e;this.featureAdapter=c;if((c=f.outFields)&&!c.includes("*")){this.outFields=c;f=0;for(const d of c){var g=a.getExpressionFromFieldName(d);g=(c=this.fieldsIndex.get(g))?null:a.getWhereClause(g,e);c=c?c.name:a.getAliasFromFieldName(d)||`FIELD_EXP_${f++}`;this._fieldDataCache.set(d,{alias:c,clause:g})}}}countDistinctValues(f){if(!this.returnDistinctValues)return f.length;f.forEach(c=>this.getAttributes(c));return this._returnDistinctMap.size}getAttributes(f){f=
this._processAttributesForOutFields(f);return this._processAttributesForDistinctValues(f)}getFieldValue(f,c,e){const g=e?e.name:c;let d=null;this._fieldDataCache.has(g)?d=this._fieldDataCache.get(g)?.clause:e||(d=a.getWhereClause(c,this.fieldsIndex),this._fieldDataCache.set(g,{alias:g,clause:d}));return e?this.featureAdapter.getAttribute(f,g):d?.calculateValue(f,this.featureAdapter)}getDataValues(f,c,e=!0){const g=c.normalizationType,d=c.normalizationTotal,t=this.fieldsIndex.get(c.field),w=q.isDateOnlyField(t)||
q.isTimestampOffsetField(t),v=q.isTimeOnlyField(t);return f.map(m=>{let r=c.field&&this.getFieldValue(m,c.field,this.fieldsIndex.get(c.field));c.field2?(r=`${p.processNullValue(r)}${c.fieldDelimiter}${p.processNullValue(this.getFieldValue(m,c.field2,this.fieldsIndex.get(c.field2)))}`,c.field3&&(r=`${r}${c.fieldDelimiter}${p.processNullValue(this.getFieldValue(m,c.field3,this.fieldsIndex.get(c.field3)))}`)):"string"===typeof r&&e&&(w?r=r?(new Date(r)).getTime():null:v&&(r=r?l.timeOnlyToMilliseconds(r):
null));g&&Number.isFinite(r)&&(m="field"===g&&c.normalizationField?this.getFieldValue(m,c.normalizationField,this.fieldsIndex.get(c.normalizationField)):null,r=p.getNormalizedValue(r,g,m,d));return r})}async getExpressionValues(f,c,e,g,d){const {arcadeUtils:t}=await k.loadArcade(),w=t.hasGeometryOperations(c);w&&await t.enableGeometryOperations();const v=t.createFunction(c),m=t.getViewInfo(e),r={fields:this.fieldsIndex.fields};return f.map(n=>{n={attributes:this.featureAdapter.getAttributes(n),layer:r,
geometry:w?{...b.getGeometry(g.geometryType,g.hasZ,g.hasM,this.featureAdapter.getGeometry(n)),spatialReference:e?.spatialReference}:null};n=t.createExecContext(n,m,d);return t.executeFunction(v,n)})}validateItem(f,c){this._fieldDataCache.has(c)||this._fieldDataCache.set(c,{alias:c,clause:a.getWhereClause(c,this.fieldsIndex)});return this._fieldDataCache.get(c)?.clause?.testFeature(f,this.featureAdapter)??!1}validateItems(f,c){this._fieldDataCache.has(c)||this._fieldDataCache.set(c,{alias:c,clause:a.getWhereClause(c,
this.fieldsIndex)});return this._fieldDataCache.get(c)?.clause?.testSet(f,this.featureAdapter)??!1}_processAttributesForOutFields(f){const c=this.outFields;if(!c?.length)return this.featureAdapter.getAttributes(f);const e={};for(const g of c){const {alias:d,clause:t}=this._fieldDataCache.get(g);e[d]=t?t.calculateValue(f,this.featureAdapter):this.featureAdapter.getAttribute(f,d)}return e}_processAttributesForDistinctValues(f){if(null==f||!this.returnDistinctValues)return f;var c=this.outFields,e=[];
if(c)for(const d of c){var {alias:g}=this._fieldDataCache.get(d);e.push(f[g])}else for(g in f)e.push(f[g]);c=`${(c||["*"]).join(",")}=${e.join(",")}`;e=this._returnDistinctMap.get(c)||0;this._returnDistinctMap.set(c,++e);return 1<e?null:f}}return h})},"esri/smartMapping/statistics/support/utils":function(){define("exports ../../../geometry ../../../core/Error ../../../core/screenUtils ../../../core/timeUtils ../../../geometry/SpatialReference ../../../geometry/support/quantizationUtils ../../../geometry/support/spatialReferenceUtils ../../../layers/support/fieldUtils ../../../renderers/support/heatmapUtils ../../support/utils ../../../statistics/utils ../../../support/arcadeOnDemand ../../../geometry/Point".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){function v(y){y=x.exec(y);if(!y)return null;const {hh:z,mm:A,ss:B,ms:C}=y.groups;return Number(z)*p.millisecondsPerTimeUnit.hours+Number(A)*p.millisecondsPerTimeUnit.minutes+Number(B)*p.millisecondsPerTimeUnit.seconds+Number(C||0)}function m(y,z){y=null!=y?y:"";null!=z&&z&&(y=y?"("+y+") AND ("+z+")":z);return y}function r(y){const z=y.layer;return y.fields.filter(A=>!z.getField(A))}function n(y){const z=y.layer;return y.fields.filter(A=>{A=z.getFieldUsageInfo(A);
return!A||!A.supportsStatistics})}let u=null;const x=/^(?<hh>([0-1][0-9])|([2][0-3])):(?<mm>[0-5][0-9])(:(?<ss>[0-5][0-9]))?([.](?<ms>\d+))?$/;a.calculateHeatmapStats=function(y,z=18,A,B,C){const D=new Float64Array(B*C);z=Math.round(l.pt2px(z));let F=Number.POSITIVE_INFINITY,H=Number.NEGATIVE_INFINITY;A=e.createValueFunction(A);for(const {geometry:G,attributes:I}of y){const {x:O,y:L}=G;y=Math.max(0,O-z);var N=Math.max(0,L-z);const P=Math.min(C,L+z),M=Math.min(B,O+z),K=+A(I);for(;N<P;N++)for(let J=
y;J<M;J++){var E=N*B+J;const R=e.evaluateDensityKernel(J-O,N-L,z)*K;E=D[E]+=R;F=Math.min(F,E);H=Math.max(H,E)}}return{min:F,max:H}};a.getDataValues=async function(y,z,A=!0){if(!z)return[];const {field:B,field2:C,field3:D,fieldDelimiter:F,fieldInfos:H,timeZone:N}=y;var E=B&&H?.find(W=>W.name.toLowerCase()===B.toLowerCase());const G=E?c.isTimeOnlyField(E):!1,I=E?g.isAnyDateField(E):!1,O=y.valueExpression,L=y.normalizationType,P=y.normalizationField,M=y.normalizationTotal,K=[];E=y.viewInfoParams;let J=
null,R=null;if(O){if(!u){const {arcadeUtils:W}=await t.loadArcade();u=W}u.hasGeometryOperations(O)&&await u.enableGeometryOperations();J=u.createFunction(O);R=E?u.getViewInfo({viewingMode:E.viewingMode,scale:E.scale,spatialReference:new k(E.spatialReference)}):null}y=y.fieldInfos;const Q=z[0]&&"declaredClass"in z[0]&&"esri.Graphic"===z[0].declaredClass||!y?null:{fields:y};z.forEach(W=>{var S=W.attributes;if(O){var V=u.createExecContext(Q?{...W,layer:Q}:W,R,N);V=u.executeFunction(J,V)}else S&&(V=S[B],
C?(V=`${d.processNullValue(V)}${F}${d.processNullValue(S[C])}`,D&&(V=`${V}${F}${d.processNullValue(S[D])}`)):"string"===typeof V&&A&&(I?V=V?(new Date(V)).getTime():null:G&&(V=V?v(V):null)));L&&"number"===typeof V&&isFinite(V)&&(S=S&&parseFloat(S[P]),V=d.getNormalizedValue(V,L,S,M));K.push(V)});return K};a.getRangeExpr=function(y,z,A){z=null!=z?y+" \x3e\x3d "+z:"";y=null!=A?y+" \x3c\x3d "+A:"";A="";return(A=z&&y?m(z,y):z||y)?"("+A+")":""};a.getSQLFilterForNormalization=function(y){const z=y.field,
A=y.normalizationType;y=y.normalizationField;let B;if("field"===A)B="(NOT "+y+" \x3d 0)";else if("log"===A||"natural-log"===A||"square-root"===A)B=`(${z} > 0)`;return B};a.getSumOfAttributesExpr=function(y,z,A){const B=[],C=[],D=[],F=[],H=[];y.forEach((G,I)=>{const O=G.field?"field":"expression",L=G.field||G.valueExpression;G.field?(H.push(L),C.push(`var ${O}${I} = Number($feature["${L}"]);`)):(B.push(`function getValueForExpr${I}() {\n ${L} \n}`),C.push(`var ${O}${I} = Number(getValueForExpr${I}());`));
A||D.push(`${O}${I} = IIf(${O}${I} < 0, 0, ${O}${I});`);F.push(`${O}${I}`)});y="return sum;";const N=B.length?null:H.reduce((G,I)=>`${G} + ${I}`);let E=null;z||A?z?A||(y="return IIf(sum \x3e\x3d 0, sum, null);",N&&(E=`(( ${N} ) >= 0)`)):(y="return IIf(sum !\x3d 0, sum, null);",N&&(E=`(( ${N} ) <> 0)`)):(y="return IIf(sum \x3e 0, sum, null);",N&&(E=`(( ${N} ) > 0)`));return{valueExpression:[B.length?B.join("\n"):"",C.join("\n"),D.join("\n"),`var sum = ${F.join(" + ")};`,y].filter(Boolean).join("\n\n"),
sqlExpression:N,sqlWhere:E}};a.mergeWhereClauses=m;a.quantizeFeatures=function(y,z,A,B){const C=f.isWrappable(A)?f.getInfo(A):null,D=C?Math.round((C.valid[1]-C.valid[0])/z.scale[0]):null;return y.map(F=>{const H=new w(F.geometry);h.quantizePoint(z,H,H);if(C){var N=D??0,E=B[0];0>H.x?H.x+=N:H.x>E&&(H.x-=N)}F.geometry=H;return F})};a.timeOnlyToMilliseconds=v;a.verifyBasicFieldValidity=function(y,z,A){const B=r({layer:y,fields:z});if(B.length)return new q(A,"Unknown fields: "+B.join(", ")+". You can only use fields defined in the layer schema");
y=n({layer:y,fields:z});if(y.length)return new q(A,"Unsupported fields: "+y.join(", ")+". You can only use fields that can be fetched i.e. AdapterFieldUsageInfo.supportsStatistics must be true")};a.verifyFieldType=function(y,z,A,B){let C;z?z.name!==y.objectIdField&&B.includes(z.type)||(C=new q(A,"'field' should be one of these types: "+B.join(","))):C=new q(A,"'field' is not defined in the layer schema");return C};a.verifyFilterValidty=function(y,z){if(y&&"intersects"!==y.spatialRelationship)return new q(z,
"Only 'intersects' spatialRelationship is supported for featureFilter")};a.verifyNumericField=function(y,z,A){let B;z?z.name!==y.objectIdField&&c.isNumericField(z)||(B=new q(A,"'field' should be one of these numeric types: "+c.numericTypes.join(","))):B=new q(A,"'field' is not defined in the layer schema");return B};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/smartMapping/support/utils":function(){define("exports ../../intl/date ../../layers/support/fieldUtils ../../support/arcadeOnDemand ../../support/basemapUtils ../../time/timeZoneUtils".split(" "),
function(a,b,q,l,p,k){function h(w){return String(w).padStart(2,"0")}function f(w,v,m){if("date"===v||"number"===v){"number"===v&&(w=new Date(w));v=m?w.getFullYear():w.getUTCFullYear();const r=h((m?w.getMonth():w.getUTCMonth())+1),n=h(m?w.getDate():w.getUTCDate()),u=h(m?w.getHours():w.getUTCHours()),x=h(m?w.getMinutes():w.getUTCMinutes());w=h(m?w.getSeconds():w.getUTCSeconds());w=`TIMESTAMP'${v}-${r}-${n} ${u}:${x}:${w}'`}return w}function c(w,v){if(v instanceof Date)return"date";if("number"===typeof v)return"number";
if("string"===typeof v&&(w=w.getField(v),"\x3cnow\x3e"!==v.toLowerCase()&&q.isDateField(w)))return"field"}const e={light:"streets gray topo terrain oceans osm gray-vector streets-vector topo-vector streets-relief-vector streets-navigation-vector topo-3d navigation-3d streets-3d osm-3d gray-3d arcgis-light-gray arcgis-navigation arcgis-streets arcgis-streets-relief arcgis-topographic arcgis-oceans osm-standard osm-standard-relief osm-streets osm-streets-relief osm-light-gray arcgis-terrain arcgis-charted-territory arcgis-community arcgis-colored-pencil arcgis-modern-antique arcgis-midcentury arcgis-newspaper arcgis-hillshade-light".split(" "),
dark:"satellite hybrid dark-gray dark-gray-vector streets-night-vector navigation-dark-3d streets-dark-3d dark-gray-3d arcgis-imagery arcgis-imagery-standard arcgis-dark-gray arcgis-navigation-night arcgis-streets-night osm-dark-gray arcgis-nova arcgis-hillshade-dark".split(" ")},g={years:365,months:30,days:1,hours:1/24,minutes:1/1440,seconds:1/86400,milliseconds:1/864E5},d=new Set(["integer","small-integer"]);let t=null;a.castIntegerFieldToFloat=function(w){return`cast(${w} as float)`};a.dateTypes=
["date","date-only","timestamp-offset"];a.defaultBasemapGroups=e;a.fieldDelimiter=",";a.formatAnyDate=function(w,v){const {format:m,timeZoneOptions:r,fieldType:n}=v??{};let u;r&&({timeZone:x,timeZoneName:u}=k.getTimeZoneFormattingOptions(r.layerTimeZone,r.datesInUnknownTimezone,r.viewTimeZone,b.convertDateFormatToIntlOptions(m||"short-date-short-time"),n));if("string"===typeof w&&isNaN(Date.parse("time-only"===n?`1970-01-01T${w}Z`:w)))return w;switch(n){case "date-only":var x=b.convertDateFormatToIntlOptions(m||
"short-date");return"string"===typeof w?b.formatDateOnly(w,{...x}):b.formatDate(w,{...x,timeZone:k.utc});case "time-only":return x=b.convertDateFormatToIntlOptions(m||"short-time"),"string"===typeof w?b.formatTimeOnly(w,x):b.formatDate(w,{...x,timeZone:k.utc});case "timestamp-offset":if(!x&&"string"===typeof w&&(new Date(w)).toISOString()!==w)return w;x=(v=m||r?b.convertDateFormatToIntlOptions(m||"short-date-short-time"):void 0)?{...v,timeZone:x,timeZoneName:u}:void 0;return"string"===typeof w?b.formatTimestamp(w,
x):b.formatDate(w,x);default:return v=m||r?b.convertDateFormatToIntlOptions(m||"short-date-short-time"):void 0,b.formatDate("string"===typeof w?new Date(w):w,v?{...v,timeZone:x,timeZoneName:u}:void 0)}};a.getBasemapGroup=function(w,v=e){for(const m in v)if(v[m].includes(w))return m};a.getBasemapId=function(w,v,m=!0){let r=null;w&&("string"===typeof w?v.includes(w)&&(r=w):r=p.getWellKnownBasemapId(w));return m?r||"gray":r};a.getDateDiffSQL=function(w,v,m,r){const {hasQueryEngine:n}=w;m=f(m,c(w,m),
n);w=f(v,c(w,v),n);w=`(${m} - ${w})`;r=g[r];v="/";1>r&&(r=1/r,v="*");return{sqlExpression:1===r?w:`(${w} ${v} ${r})`,sqlWhere:null}};a.getDateType=c;a.getFieldsList=async function(w){const {field:v,field2:m,field3:r,normalizationField:n,valueExpression:u}=w;w=[];u&&(t||({arcadeUtils:w}=await l.loadArcade(),t=w),w=t.extractFieldNames(u));v&&w.push(v);m&&w.push(m);r&&w.push(r);n&&w.push(n);return w};a.getNormalizationType=function(w){let v=w.normalizationType;v||(w.normalizationField?v="field":null!=
w.normalizationTotal&&(v="percent-of-total"));return v??void 0};a.isAnyDateField=function(w){return q.isDateField(w)||q.isDateOnlyField(w)||q.isTimestampOffsetField(w)};a.isIntegerField=function(w,v){w=v&&w.getField(v);return!!w&&d.has(w.type)};a.unitValueInDays=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/statistics/utils":function(){define(["exports","../rest/support/ClassBreaksDefinition","../rest/support/generateRendererUtils"],function(a,b,q){function l(E){return null==
E||"string"===typeof E&&!E?"\x3cNull\x3e":E}function p(E){const G=null!=E.minValue||null!=E.maxValue,I=!!E.sqlExpression&&E.supportsSQLExpression;return!(null!=E.normalizationField||null!=E.normalizationType)&&!G&&!I}function k(E){const {values:G,useSampleStdDev:I,supportsNullCount:O}=E;var L=Number.POSITIVE_INFINITY;let P=Number.NEGATIVE_INFINITY,M=null,K=null;var J=null;let R=null,Q=0;const W=null==E.minValue?-Infinity:E.minValue,S=null==E.maxValue?Infinity:E.maxValue;for(const V of G)Number.isFinite(V)?
V>=W&&V<=S&&(M=null===M?V:M+V,L=Math.min(L,V),P=Math.max(P,V),Q++):"string"===typeof V&&Q++;if(Q&&null!=M){K=M/Q;J=0;for(const V of G)Number.isFinite(V)&&V>=W&&V<=S&&(J+=(V-K)**2);R=I?1<Q?J/(Q-1):0:0<Q?J/Q:0;J=Math.sqrt(R)}else P=L=null;L={avg:K,count:Q,max:P,min:L,stddev:J,sum:M,variance:R};O&&(L.nullcount=G.length-Q);E.percentileParams&&(L.median=h(G,E.percentileParams));return L}function h(E,G){const {fieldType:I,value:O,orderBy:L,isDiscrete:P}=G,M=f(I,"desc"===L);E=[...E].filter(Q=>null!=Q).sort((Q,
W)=>M(Q,W));if(0===E.length)return null;if(0>=O)return E[0];if(1<=O)return E[E.length-1];var K=(E.length-1)*O,J=Math.floor(K);G=J+1;K%=1;J=E[J];const R=E[G];return G>=E.length||P||"string"===typeof J||"string"===typeof R?J:J*(1-K)+R*K}function f(E,G){if(E){if(u.has(E))return G?H:N;if(x.has(E))return c(G,!1);if("esriFieldTypeTimestampOffset"===E)return G?C:B;const P=c(G,!0);if("esriFieldTypeString"===E)return P;if("esriFieldTypeGUID"===E||"esriFieldTypeGlobalID"===E)return(M,K)=>P(e(M),e(K))}const I=
G?1:-1,O=G?H:N,L=c(G,!0);return(P,M)=>"number"===typeof P&&"number"===typeof M?O(P,M):"string"===typeof P&&"string"===typeof M?L(P,M):I}function c(E,G){if(!G)return E?F:D;const I=E?z:A;return E?(O,L)=>{const P=I(O,L);if(null!=P)return P;O=O.toUpperCase();L=L.toUpperCase();return O>L?-1:O<L?1:0}:(O,L)=>{const P=I(O,L);if(null!=P)return P;O=O.toUpperCase();L=L.toUpperCase();return O<L?-1:O>L?1:0}}function e(E){return E.substr(24,12)+E.substr(19,4)+E.substr(16,2)+E.substr(14,2)+E.substr(11,2)+E.substr(9,
2)+E.substr(6,2)+E.substr(4,2)+E.substr(2,2)+E.substr(0,2)}function g(E){return"coded-value"!==E?.type?[]:E.codedValues.map(G=>G.code)}function d(E,G){const I=w({field:G.field,normalizationType:G.normalizationType,normalizationField:G.normalizationField,classificationMethod:G.classificationMethod,standardDeviationInterval:G.standardDeviationInterval,breakCount:G.numClasses||5});E=t(E,G.minValue,G.maxValue);return q.createGenerateRendererClassBreaks({definition:I,values:E,normalizationTotal:G.normalizationTotal})}
function t(E,G,I){const O=null==G?-Infinity:G,L=null==I?Infinity:I;return E.filter(P=>Number.isFinite(P)&&P>=O&&P<=L)}function w(E){const {breakCount:G,field:I,normalizationField:O,normalizationType:L}=E,P=E.classificationMethod||"equal-interval";return new b({breakCount:G,classificationField:I,classificationMethod:P,normalizationField:"field"===L?O:void 0,normalizationType:L,standardDeviationInterval:"standard-deviation"===P?E.standardDeviationInterval||1:void 0})}function v(E,G){const {field:I,
classificationMethod:O,standardDeviationInterval:L,normalizationType:P,normalizationField:M,normalizationTotal:K,minValue:J,maxValue:R}=G,Q=G.numBins||10;let W=G=null,S=null;O&&"equal-interval"!==O||P?({classBreaks:E}=d(E,{field:I,normalizationType:P,normalizationField:M,normalizationTotal:K,classificationMethod:O,standardDeviationInterval:L,minValue:J,maxValue:R,numClasses:Q}),G=E[0].minValue,W=E[E.length-1].maxValue,S=E.map(V=>[V.minValue,V.maxValue])):(null!=J&&null!=R?(G=J,W=R):(E=k({values:E,
minValue:J,maxValue:R,useSampleStdDev:!P,supportsNullCount:p({normalizationType:P,normalizationField:M,minValue:J,maxValue:R})}),G=E.min??null,W=E.max??null),S=r(G??0,W??0,Q));return{min:G,max:W,intervals:S}}function m(E,G){let I=-1;for(let O=E.length-1;0<=O;O--)if(G>=E[O][0]){I=O;break}return I}function r(E,G,I){const O=(G-E)/I,L=[];let P;for(let M=1;M<=I;M++)P=E+O,P=Number(P.toFixed(16)),L.push([E,M===I?G:P]),E=P;return L}const n=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,u=new Set("esriFieldTypeDate esriFieldTypeInteger esriFieldTypeSmallInteger esriFieldTypeSingle esriFieldTypeDouble esriFieldTypeLong esriFieldTypeOID esriFieldTypeBigInteger".split(" ")),
x=new Set(["esriFieldTypeTimeOnly","esriFieldTypeDateOnly"]),y="min max avg stddev count sum variance nullcount median".split(" "),z=(E,G)=>null==E?null==G?0:1:null==G?-1:null,A=(E,G)=>null==E?null==G?0:-1:null==G?1:null,B=(E,G)=>A(E,G)??(E===G?0:(new Date(E)).getTime()-(new Date(G)).getTime()),C=(E,G)=>z(E,G)??(E===G?0:(new Date(G)).getTime()-(new Date(E)).getTime()),D=(E,G)=>A(E,G)??(E===G?0:E<G?-1:1),F=(E,G)=>z(E,G)??(E===G?0:E<G?1:-1),H=(E,G)=>z(E,G)??G-E,N=(E,G)=>A(E,G)??E-G;a.calculateClassBreaks=
d;a.calculateHistogram=function(E,G){var I=v(E,G);if(null==I.min&&null==I.max)return{bins:[],minValue:I.min,maxValue:I.max,normalizationTotal:G.normalizationTotal};const O=I.intervals,L=I.min??0;I=I.max??0;const P=O.map((M,K)=>({minValue:O[K][0],maxValue:O[K][1],count:0}));for(const M of E)null!=M&&M>=L&&M<=I&&(E=m(O,M),-1<E&&P[E].count++);return{bins:P,minValue:L,maxValue:I,normalizationTotal:G.normalizationTotal}};a.calculatePercentile=h;a.calculateStatistics=k;a.calculateStringStatistics=function(E){const G=
E.returnDistinct?[...(new Set(E.values))]:E.values;var I=G.filter(L=>null!=L).sort();const O=I.length;I={count:O,min:I[0],max:I[O-1]};E.supportsNullCount&&(I.nullcount=G.length-O);E.percentileParams&&(I.median=h(G,E.percentileParams));return I};a.calculateUniqueValuesCount=function(E){const G={};for(let I of E){if(null==I||"string"===typeof I&&""===I.trim())I=null;null==G[I]?G[I]={count:1,data:I}:G[I].count++}return{count:G}};a.createClassBreaksDefinition=w;a.createUVResult=function(E,G,I,O){E=E.count;
const L=[];if(I&&G){I=[];var P=g(G[0]);for(const M of P)if(G[1]){P=g(G[1]);for(const K of P)if(G[2]){P=g(G[2]);for(const J of P)I.push(`${l(M)}${O}${l(K)}${O}${l(J)}`)}else I.push(`${l(M)}${O}${l(K)}`)}else I.push(M);for(const M of I)E.hasOwnProperty(M)||(E[M]={data:M,count:0})}for(const M in E)G=E[M],L.push({value:G.data,count:G.count,label:G.label});return{uniqueValueInfos:L}};a.getAttributeComparator=f;a.getEqualIntervalBins=r;a.getNormalizedValue=function(E,G,I,O){let L=null;switch(G){case "log":0!==
E&&(L=Math.log(E)*Math.LOG10E);break;case "percent-of-total":Number.isFinite(O)&&0!==O&&(L=E/O*100);break;case "field":Number.isFinite(I)&&0!==I&&(L=E/I);break;case "natural-log":0<E&&(L=Math.log(E));break;case "square-root":0<E&&(L=E**.5)}return L};a.isNullCountSupported=p;a.processNullValue=l;a.processSummaryStatisticsResult=function(E,G){let I;for(I in E)y.includes(I)&&(Number.isFinite(E[I])||(E[I]=null));if(!G)return E;["avg","stddev","variance"].forEach(O=>{null!=E[O]&&(E[O]=Math.ceil(E[O]??
0))});return E};a.resolveCBResult=function(E,G){let I=E.classBreaks;const O=I[0]?.minValue,L=I[I.length-1]?.maxValue,P="standard-deviation"===G;I=I.map(M=>{const K=M.label;M={minValue:M.minValue,maxValue:M.maxValue,label:K};if(P&&K){const J=K.match(n)?.map(R=>+R.trim())??[];2===J.length?(M.minStdDev=J[0],M.maxStdDev=J[1],0>J[0]&&0<J[1]&&(M.hasAvg=!0)):1===J.length&&(K.includes("\x3c")?(M.minStdDev=null,M.maxStdDev=J[0]):K.includes("\x3e")&&(M.minStdDev=J[0],M.maxStdDev=null))}return M});return{minValue:O,
maxValue:L,classBreakInfos:I,normalizationTotal:E.normalizationTotal}};a.statisticTypes=y;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/rest/support/ClassBreaksDefinition":function(){define("../../chunks/tslib.es6 ../../core/jsonMap ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/enumeration ../../core/accessorSupport/decorators/subclass".split(" "),function(a,
b,q,l,p,k,h,f,c){p=new b.JSONMap({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"});b=new b.JSONMap({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});q=class extends q.JSONSupport{constructor(e){super(e);this.type="class-breaks-definition";this.normalizationType=
this.normalizationField=this.classificationMethod=this.classificationField=this.breakCount=null}set standardDeviationInterval(e){"standard-deviation"===this.classificationMethod&&this._set("standardDeviationInterval",e)}set definedInterval(e){"defined-interval"===this.classificationMethod&&this._set("definedInterval",e)}};a.__decorate([f.enumeration({classBreaksDef:"class-breaks-definition"})],q.prototype,"type",void 0);a.__decorate([l.property({json:{write:!0}})],q.prototype,"breakCount",void 0);
a.__decorate([l.property({json:{write:!0}})],q.prototype,"classificationField",void 0);a.__decorate([l.property({type:String,json:{read:p.read,write:p.write}})],q.prototype,"classificationMethod",void 0);a.__decorate([l.property({json:{write:!0}})],q.prototype,"normalizationField",void 0);a.__decorate([l.property({json:{read:b.read,write:b.write}})],q.prototype,"normalizationType",void 0);a.__decorate([l.property({value:null,json:{write:!0}})],q.prototype,"standardDeviationInterval",null);a.__decorate([l.property({value:null,
json:{write:!0}})],q.prototype,"definedInterval",null);return q=a.__decorate([c.subclass("esri.rest.support.ClassBreaksDefinition")],q)})},"esri/rest/support/generateRendererUtils":function(){define(["exports","../../core/Logger"],function(a,b){function q(d){var t=d.definition;const {classificationMethod:w,normalizationType:v,definedInterval:m}=t;t=t.breakCount??1;const r=[];var n=d.values;if(0===n.length)return[];n=n.sort((B,C)=>B-C);var u=n[0],x=n[n.length-1];if("equal-interval"===w)if(n.length>=
t){n=(x-u)/t;d=u;for(var y=1;y<t;y++){var z=Number((u+y*n).toFixed(6));r.push({minValue:d,maxValue:z,label:l(d,z,v)});d=z}r.push({minValue:d,maxValue:x,label:l(d,x,v)})}else n.forEach(B=>{r.push({minValue:B,maxValue:B,label:l(B,B,v)})});else if("natural-breaks"===w){n=p(n);d=k(n.uniqueValues,d.valueFrequency||n.valueFrequency,t);for(y=1;y<t;y++)n.uniqueValues.length>y&&(z=Number(n.uniqueValues[d[y]].toFixed(6)),r.push({minValue:u,maxValue:z,label:l(u,z,v)}),u=z);r.push({minValue:u,maxValue:x,label:l(u,
x,v)})}else if("quantile"===w)if(n.length>=t&&u!==x){d=Math.ceil(n.length/t);y=0;for(z=1;z<t;z++){var A=d+y-1;A>n.length&&(A=n.length-1);0>A&&(A=0);r.push({minValue:u,maxValue:n[A],label:l(u,n[A],v)});u=n[A];y+=d;d=Math.ceil((n.length-y)/(t-z))}r.push({minValue:u,maxValue:x,label:l(u,x,v)})}else for(t=-1,x=0;x<n.length;x++)u=n[x],u!==t&&(t=u,r.push({minValue:t,maxValue:u,label:l(t,u,v)}),t=u);else if("standard-deviation"===w)if(d=c(n),y=e(n,d),0===y)r.push({minValue:n[0],maxValue:n[0],label:l(n[0],
n[0],v)});else{n=f(u,x,t,d,y)*y;y=0;for(z=t;1<=z;z--)A=Number((d-(z-.5)*n).toFixed(6)),r.push({minValue:u,maxValue:A,label:l(u,A,v)}),u=A,y++;z=Number((d+.5*n).toFixed(6));r.push({minValue:u,maxValue:z,label:l(u,z,v)});u=z;y++;for(A=1;A<=t;A++)z=y===2*t?x:Number((d+(A+.5)*n).toFixed(6)),r.push({minValue:u,maxValue:z,label:l(u,z,v)}),u=z,y++}else if("defined-interval"===w){if(!m)return r;t=n[0];x=n[n.length-1];n=Math.ceil((x-t)/m);u=t;for(d=1;d<n;d++)y=Number((t+d*m).toFixed(6)),r.push({minValue:u,
maxValue:y,label:l(u,y,v)}),u=y;r.push({minValue:u,maxValue:x,label:l(u,x,v)})}return r}function l(d,t,w){let v=null;return v=d===t?w&&"percent-of-total"===w?d+"%":d.toString():w&&"percent-of-total"===w?d+"% - "+t+"%":d+" - "+t}function p(d){const t=[],w=[];let v=Number.MIN_VALUE,m=1,r=-1;for(let n=0;n<d.length;n++){const u=d[n];u===v?(m++,w[r]=m):null!==u&&(t.push(u),v=u,m=1,w.push(m),r++)}return{uniqueValues:t,valueFrequency:w}}function k(d,t,w){var v=d.length;const m=[];w>v&&(w=v);for(var r=0;r<
w;r++)m.push(Math.round(r*v/w-1));m.push(v-1);r=h(m,d,t,w);v=r.mean;r=r.sdcm;var n=w,u=0,x=0;let y=0,z=0,A=!0;for(let C=0;2>C&&A;C++){0===C&&(A=!1);for(var B=0;B<n-1;B++)for(;m[B+1]+1!==m[B+2];)if(m[B+1]+=1,u=g(B,m,d,t),y=u.sbMean,u=u.sbSdcm,x=g(B+1,m,d,t),z=x.sbMean,x=x.sbSdcm,u+x<r[B]+r[B+1])r[B]=u,r[B+1]=x,v[B]=y,v[B+1]=z,A=!0;else{--m[B+1];break}for(B=n-1;0<B;B--)for(;m[B]!==m[B-1]+1;)if(--m[B],u=g(B-1,m,d,t),y=u.sbMean,u=u.sbSdcm,x=g(B,m,d,t),z=x.sbMean,x=x.sbSdcm,u+x<r[B-1]+r[B])r[B-1]=u,r[B]=
x,v[B-1]=y,v[B]=z,A=!0;else{m[B]+=1;break}}A&&(r=h(m,d,t,w));return m}function h(d,t,w,v){let m=[];var r=[],n=[];let u=0;const x=[],y=[];for(var z=0;z<v;z++){var A=g(z,d,t,w);x.push(A.sbMean);y.push(A.sbSdcm);u+=y[z]}A=u;for(z=!0;z||u<A;){z=!1;m=[];for(r=0;r<v;r++)m.push(d[r]);for(n=0;n<v;n++)for(A=d[n]+1;A<=d[n+1];A++)if(r=t[A],0<n&&A!==d[n+1]&&Math.abs(r-x[n])>Math.abs(r-x[n-1]))d[n]=A;else if(n<v-1&&d[n]!==A-1&&Math.abs(r-x[n])>Math.abs(r-x[n+1])){d[n+1]=A-1;break}A=u;u=0;r=[];n=[];for(let B=0;B<
v;B++){r.push(x[B]);n.push(y[B]);const C=g(B,d,t,w);x[B]=C.sbMean;y[B]=C.sbSdcm;u+=y[B]}}if(u>A){for(t=0;t<v;t++)d[t]=m[t],x[t]=r[t],y[t]=n[t];u=A}return{mean:x,sdcm:y}}function f(d,t,w,v,m){d=Math.max(v-d,t-v)/m/w;return 1<=d?1:.5<=d?.5:.25}function c(d){let t=0;for(let w=0;w<d.length;w++)t+=d[w];return t/=d.length}function e(d,t){let w=0;for(let v=0;v<d.length;v++){const m=d[v];w+=(m-t)*(m-t)}w/=d.length;return Math.sqrt(w)}function g(d,t,w,v){var m=0,r=0;for(var n=t[d]+1;n<=t[d+1];n++){const u=
v[n];m+=w[n]*u;r+=u}0>=r&&b.getLogger("esri.rest.support.generateRendererUtils").warn("Exception in Natural Breaks calculation");m/=r;r=0;for(n=t[d]+1;n<=t[d+1];n++)r+=v[n]*(w[n]-m)**2;return{sbMean:m,sbSdcm:r}}a.createGenerateRendererClassBreaks=function(d){const {normalizationTotal:t}=d;return{classBreaks:q(d),normalizationTotal:t}};a.createGenerateRendererUniqueValues=function(d){d=p(d);const t=[],w=d.uniqueValues.length;for(let v=0;v<w;v++){const m=d.uniqueValues[v];t.push({value:m,count:d.valueFrequency[v],
label:m.toString()})}return{uniqueValues:t}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/queryUtils":function(){define("require exports ../../../core/jsonMap ../../../core/unitUtils ../../../geometry/projection ../../../geometry/support/extentUtils ../../../geometry/support/jsonUtils ../../../geometry/support/normalizeUtils ../../../geometry/support/spatialReferenceUtils ./projectionSupport".split(" "),function(a,b,q,l,p,k,h,f,c,e){async function g(r,
n,u){if(!r)return null;var {where:x}=r;r.where=x=x?.trim();if(!x||/^1 *= *1$/.test(x)||n&&n===x)r.where=null;if(!r.geometry)return r;n=await t(r);r.distance=0;r.units=null;"esriSpatialRelEnvelopeIntersects"===r.spatialRel&&({spatialReference:x}=r.geometry,n=k.getGeometryExtent(n),n.spatialReference=x);if(n){await e.checkProjectionSupport(n.spatialReference,u);x=n.spatialReference;n=d(n,u)&&h.isExtent(n)?{spatialReference:x,rings:[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,
n.ymin]]]}:n;x=(await f.normalizeCentralMeridian(h.fromJSON(n)))[0];if(null==x)throw m;const y="quantizationParameters"in r&&r.quantizationParameters?.tolerance||"maxAllowableOffset"in r&&r.maxAllowableOffset||0;n=y&&d(n,u)?{densificationStep:8*y}:void 0;x=x.toJSON();n=e.project(x,x.spatialReference,u,n);if(!n)throw m;n.spatialReference=u;r.geometry=n}return r}function d(r,n){if(!r)return!1;const u=r.spatialReference;return(h.isExtent(r)||h.isPolygon(r)||h.isPolyline(r))&&!c.equals(u,n)&&!p.canProjectWithoutEngine(u,
n)}async function t(r){const {distance:n,units:u}=r,x=r.geometry;if(null==n||"vertexAttributes"in x)return x;var y=x.spatialReference;r=u?v.fromJSON(u):l.getUnitString(y);y=y&&(c.isGeographic(y)||c.isWebMercator(y))?x:await e.checkProjectionSupport(y,c.wgs84).then(()=>e.project(x,c.wgs84));return(await w())(y.spatialReference,y,n,r)}async function w(){return(await new Promise((r,n)=>a(["../../../geometry/geometryEngineJSON"],r,n))).geodesicBuffer}const v=new q.JSONMap({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",
esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),m=Object.freeze({});b.normalizeQuery=async function(r,n,u){const {outFields:x,orderByFields:y,groupByFieldsForStatistics:z,outStatistics:A}=r;if(x)for(var B=0;B<x.length;B++)x[B]=x[B].trim();if(y)for(B=0;B<y.length;B++)y[B]=y[B].trim();if(z)for(B=0;B<z.length;B++)z[B]=z[B].trim();if(A)for(B=0;B<A.length;B++)A[B].onStatisticField&&(A[B].onStatisticField=A[B].onStatisticField.trim());
r.geometry&&!r.outSR&&(r.outSR=r.geometry.spatialReference);return g(r,n,u)};b.normalizeQueryLike=g;b.queryEngineEmptyResult=m;b.unitsKebabDict=v;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/queryValidationUtils":function(){define("exports ../../../core/Error ./attributeSupport ./projectionSupport ./spatialQuerySupport ../../../support/arcadeOnDemand".split(" "),function(a,b,q,l,p,k){function h(d,t,w){const {outFields:v,orderByFields:m,returnDistinctValues:r,
outStatistics:n}=w,u=n?n.map(x=>x.outStatisticFieldName&&x.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(m&&0<m.length){const x=m.map(y=>{const z=y.toLowerCase();return z.includes(" asc")?z.split(" asc")[0]:z.includes(" desc")?z.split(" desc")[0]:y}).filter(y=>!u.includes(y));q.validateFields(d,t,x,{expressionName:"orderByFields",query:w})}if(v&&0<v.length)q.validateFields(d,t,v,{expressionName:"outFields",query:w,allowedFieldTypes:"all"});else if(r)throw new b("unsupported-query","outFields should be specified for returnDistinctValues",
{query:w});q.validateWhere(d,t,w.where,w)}function f(d,t,w){const {outStatistics:v,groupByFieldsForStatistics:m,having:r}=w;var n=m?.length,u=v?.length;if(r){if(!n||!u)throw new b("unsupported-query","outStatistics and groupByFieldsForStatistics should be specified with having",{query:w});q.validateHaving(d,t,r,v,w)}if(u&&e(v)){u=v.map(x=>x.onStatisticField).filter(Boolean);q.validateFields(d,t,u,{expressionName:"onStatisticFields",query:w});n&&q.validateFields(d,t,m,{expressionName:"groupByFieldsForStatistics",
query:w});for(const x of v){const {onStatisticField:y,statisticType:z}=x;if(("percentile_disc"===z||"percentile_cont"===z)&&"statisticParameters"in x){if({statisticParameters:n}=x,!n)throw new b("unsupported-query","statisticParameters should be set for percentile type",{definition:x,query:w});}else d.get(y)&&"count"!==z&&"min"!==z&&"max"!==z&&q.validateFields(d,t,[y],{expressionName:`outStatistics with '${z}' statistic type`,allowedFieldTypes:g,query:w})}}}async function c(d,t,w,v){var m=[];w.valueExpression&&
({arcadeUtils:m}=await k.loadArcade(),m=m.extractFieldNames(w.valueExpression));w.field&&m.push(w.field);w.field2&&m.push(w.field2);w.field3&&m.push(w.field3);w.normalizationField&&m.push(w.normalizationField);if(!m.length&&!w.valueExpression)throw new b("unsupported-query","field or valueExpression is required",{params:w});q.validateFields(d,t,m,{expressionName:"statistics",query:v})}function e(d){return null!=d&&d.every(t=>"exceedslimit"!==t.statisticType)}const g=new Set([...q.numericFieldTypes,
...q.allDateAndTimeFieldTypes]);a.validateQuery=async function(d,{fieldsIndex:t,geometryType:w,spatialReference:v,availableFields:m}){if(0>(d.distance??0)||null!=d.geometryPrecision||d.multipatchOption&&"xyFootprint"!==d.multipatchOption||d.pixelSize||d.relationParam||d.text)throw new b("unsupported-query","Unsupported query options",{query:d});h(t,m,d);f(t,m,d);return Promise.all([p.checkSpatialQuerySupport(d,w,v),l.checkProjectionSupport(v,d.outSR)]).then(()=>d)};a.validateStatisticsQuery=async function(d,
t,{fieldsIndex:w,geometryType:v,spatialReference:m,availableFields:r}){if(0>(d.distance??0)||null!=d.geometryPrecision||d.multipatchOption||d.pixelSize||d.relationParam||d.text||d.outStatistics||d.groupByFieldsForStatistics||d.having||d.orderByFields)throw new b("unsupported-query","Unsupported query options",{query:d});h(w,r,d);return Promise.all([c(w,r,t,d),p.checkSpatialQuerySupport(d,v,m),l.checkProjectionSupport(m,d.outSR)]).then(()=>d)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/layers/graphics/data/spatialQuerySupport":function(){define("require exports ../../../core/Error ../../../geometry/support/contains ../../../geometry/support/intersects ../../../geometry/support/jsonUtils ../../../geometry/support/spatialReferenceUtils ../contains ../featureConversionUtils ../OptimizedGeometry ./geometryUtils ./projectionSupport".split(" "),function(a,b,q,l,p,k,h,f,c,e,g,d){function t(){return new Promise((n,u)=>a(["../../../geometry/geometryEngineJSON"],n,u))}const w={esriSpatialRelIntersects:"intersects",
esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"intersects",esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:null};var v={esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,
esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},m={esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},r={esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1};b.canQueryWithRBush=function(n){if(k.isExtent(n))return!0;if(k.isPolygon(n)){for(const u of n.rings)if(5!==u.length||u[0][0]!==u[1][0]||u[0][0]!==u[4][0]||u[2][0]!==u[3][0]||u[0][1]!==u[3][1]||u[0][1]!==
u[4][1]||u[1][1]!==u[2][1])return!1;return!0}return!1};b.checkSpatialQuerySupport=async function(n,u,x){const {spatialRel:y,geometry:z}=n;if(z){if(null==y||!0!==v[y])throw new q("unsupported-query","Unsupported query spatial relationship",{query:n});if(h.isValid(z.spatialReference)&&h.isValid(x)){if(null==z||!0!==m[k.getJsonType(z)])throw new q("unsupported-query","Unsupported query geometry type",{query:n});if(null==u||!0!==r[u])throw new q("unsupported-query","Unsupported layer geometry type",{query:n});
if(n.outSR)return d.checkProjectionSupport(n.geometry?.spatialReference,n.outSR)}}};b.getSpatialQueryOperator=function(n,u,x,y,z){if(k.isPolygon(u)&&"esriGeometryPoint"===x&&("esriSpatialRelIntersects"===n||"esriSpatialRelContains"===n)){const A=c.convertFromPolygon(new e,u,!1,!1);return Promise.resolve(B=>f.polygonContainsPoint(A,!1,!1,B))}if(k.isPolygon(u)&&"esriGeometryMultipoint"===x){const A=c.convertFromPolygon(new e,u,!1,!1);if("esriSpatialRelContains"===n)return Promise.resolve(B=>f.polygonContainsMultipoint(A,
!1,!1,B,y,z))}if(k.isExtent(u)&&"esriGeometryPoint"===x&&("esriSpatialRelIntersects"===n||"esriSpatialRelContains"===n))return Promise.resolve(A=>l.extentContainsPoint(u,g.getGeometry(x,y,z,A)));if(k.isExtent(u)&&"esriGeometryMultipoint"===x&&"esriSpatialRelContains"===n)return Promise.resolve(A=>l.extentContainsMultipoint(u,g.getGeometry(x,y,z,A)));if(k.isExtent(u)&&"esriSpatialRelIntersects"===n){const A=p.getExtentIntersector(x);return Promise.resolve(B=>A(u,g.getGeometry(x,y,z,B)))}return t().then(A=>
{const B=A[w[n]].bind(null,u.spatialReference,u);return C=>B(g.getGeometry(x,y,z,C))})};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/intersects":function(){define(["exports","./intersectsBase"],function(a,b){a.extentIntersectsExtent=b.extentIntersectsExtent;a.extentIntersectsMultipoint=b.extentIntersectsMultipoint;a.extentIntersectsPoint=b.extentIntersectsPoint;a.extentIntersectsPolygon=b.extentIntersectsPolygon;a.extentIntersectsPolyline=b.extentIntersectsPolyline;
a.getFeatureExtentIntersector=b.getFeatureExtentIntersector;a.isSelfIntersecting=b.isSelfIntersecting;a.segmentIntersects=b.segmentIntersects;a.getExtentIntersector=function(q){return"mesh"===q?b.extentIntersectsExtent:b.getFeatureExtentIntersector(q)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/contains":function(){define(["exports"],function(a){function b(q,l,p,k,h){if(!q)return!1;l=l?p?4:3:p?3:2;const {coords:f,lengths:c}=q;p=!1;q=0;for(const g of c){var e=
q;for(let d=q,t=q+g*l;d<t;d+=l){e=d+l;e===t&&(e=q);const w=f[d],v=f[d+1],m=f[e];e=f[e+1];(v<h&&e>=h||e<h&&v>=h)&&w+(h-v)/(e-v)*(m-w)<k&&(p=!p)}q+=g*l}return p}a.polygonContainsCoords=b;a.polygonContainsMultipoint=function(q,l,p,k,h,f){h=h?f?4:3:f?3:2;const {coords:c,lengths:e}=k;if(!e)return!1;for(let g=0,d=0;g<e.length;g++,d+=h)if(!b(q,l,p,c[d],c[d+1]))return!1;return!0};a.polygonContainsPoint=function(q,l,p,k){return b(q,l,p,k.coords[0],k.coords[1])};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/layers/graphics/data/timeSupport":function(){define(["exports"],function(a){function b(p,k,h,f,c){if(null!=f&&null!=c)return e=>{const g=p(e,k);e=p(e,h);return(null==g||g<=c)&&(null==e||e>=f)};if(null!=f)return e=>{e=p(e,h);return null==e||e>=f};if(null!=c)return e=>{e=p(e,k);return null==e||e<=c}}function q(p,k,h,f){if(null!=h&&null!=f&&h===f)return c=>p(c,k)===h;if(null!=h&&null!=f)return c=>{c=p(c,k);return null!=c&&c>=h&&c<=f};if(null!=h)return c=>{c=p(c,k);return null!=c&&c>=h};if(null!=
f)return c=>{c=p(c,k);return null!=c&&c<=f}}function l(){return()=>!1}a.getTimeExtent=async function(p,k){if(!p)return null;const h=k.featureAdapter,{startTimeField:f,endTimeField:c}=p;let e=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(f&&c)await k.forEach(d=>{const t=h.getAttribute(d,f);d=h.getAttribute(d,c);null==t||isNaN(t)||(e=Math.min(e,t));null==d||isNaN(d)||(g=Math.max(g,d))});else{const d=f||c;await k.forEach(t=>{t=h.getAttribute(t,d);null==t||isNaN(t)||(e=Math.min(e,t),g=Math.max(g,
t))})}return{start:e,end:g}};a.getTimeOperator=function(p,k,h){if(!k||!p)return null;const {startTimeField:f,endTimeField:c}=p;if(!f&&!c)return null;const {start:e,end:g}=k;if(null===e&&null===g)return null;if(void 0===e&&void 0===g)return l();p=h.getAttributeAsTimestamp?.bind(h)??h.getAttribute.bind(h);return f&&c?b(p,f,c,e,g):q(p,f||c,e,g)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/graphics/queryForSymbologySnapping":function(){define(["exports","../../../../core/promiseUtils",
"../../../../support/arcadeOnDemand"],function(a,b,q){const l={candidates:[],sourceCandidateIndices:[]};a.queryForSymbologySnapping=async function(p,k,h){if(null==p||0===k.candidates.length)return l;var f=p.graphics3DGraphicsByObjectID??p.graphics3DGraphics,c=[];const e=[],{renderer:g}=p,d=null!=g&&"arcadeRequired"in g&&g.arcadeRequired?q.loadArcade():null;var t=async(n,{graphic:u,graphics3DSymbol:x})=>{const y=await d;u=await p.getRenderingInfoAsync(u,g,y,{signal:h});return null==u?[]:x.queryForSnapping(n,
v,u,h)};const {candidates:w,spatialReference:v}=k;for(k=0;k<w.length;++k){var m=w[k],{objectId:r}=m;r="number"===typeof r?f?.get(r):void 0;if(null==r)continue;const {graphics3DSymbol:n}=r;n.symbologySnappingSupported&&(c.push(t(m,r)),e.push(k))}if(0===c.length)return l;f=await Promise.all(c);b.throwIfAborted(h);c=[];t=[];for(k=0;k<f.length;++k){m=f[k];r=e[k];for(const n of m)c.push(n),t.push(r)}return{candidates:c,sourceCandidateIndices:t}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/layers/support/HeatmapFeatureProcessor":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/arrayUtils ../../../../core/byteSizeEstimations ../../../../core/handleUtils ../../../../core/has ../../../../core/Logger ../../../../core/reactiveUtils ../../../../core/screenUtils ../../../../core/accessorSupport/decorators/property ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/support/UpdatingHandles ../../../../geometry/projection/projectPointToVector ../../../../geometry/support/Indices ../../../../geometry/support/scaleUtils ../../../../layers/graphics/dehydratedFeatures ../../../../layers/graphics/featureConversionUtils ../../../../layers/graphics/OptimizedFeature ../../../../layers/graphics/OptimizedGeometry ../../../../layers/graphics/data/FeatureStore ../../../../layers/support/fieldUtils ../../../../renderers/support/heatmapUtils ../interfaces ../graphics/DisplayFeatureLimit ../graphics/GraphicsCorePerformanceInfo ./FeatureVisibilityFilter ../../terrain/OverlayRenderer ../../webgl-engine/lib/Attribute ../../webgl-engine/lib/ContentObjectType ../../webgl-engine/lib/DrapedHeatmapRenderer ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/ModelDirtyTypes ../../webgl-engine/lib/RenderGeometry ../../webgl-engine/lib/UpdatePolicy ../../webgl-engine/lib/VertexAttribute ../../webgl-engine/materials/HeatmapDensityMaterial ../../../support/layerViewUtils ../../../webgl/enums ../../../webgl/heatmapTextureUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W){a.HeatmapFeatureProcessor=class extends q{constructor(S){super(S);this.type="heatmap";this.preferredUpdatePolicy=M.UpdatePolicy.ASYNC;this.dataExtent=null;this.drapeSourceType=C.DrapeSourceType.Features;this._renderGeometries=new Map;this._fieldTotal=0;this._drapeSourceRenderer=null;this._dataType=Q.PixelType.HALF_FLOAT;this._pixelFormat=Q.PixelFormat.RGBA;this._updatingHandles=new w.UpdatingHandles;this.initializePromise=
Promise.resolve()}initialize(){this._featureStore=new z({geometryType:"esriGeometryPoint",hasZ:this.hasZ,hasM:this.hasM});const {dataType:S,samplingMode:V,pixelFormat:T,internalFormat:Y}=W.loadHeatmapTextureConfiguration(this._renderView.renderingContext,f.getLogger(this));this._dataType=S;this._pixelFormat=T;const ha=S!==Q.PixelType.FLOAT;this._drapeSourceRenderer=this.view.basemapTerrain.overlayManager.registerDrapeSource(this,I.DrapedHeatmapRenderer,{...this._rendererParameters,dataType:S,samplingMode:V,
pixelFormat:T,internalFormat:Y});this._material=new J.HeatmapDensityMaterial({usesHalfFloats:ha});this._materialWithField=new J.HeatmapDensityMaterial({usesHalfFloats:ha,isAttributeDriven:!0});this._filterVisibility=new H.FeatureVisibilityFilter({context:{configuration:this.owner,featureStore:this.featureStore,getFeatureCount:()=>this._loadedPointGraphics.length,setAllFeaturesVisibility:ba=>this._setAllFeaturesVisibility(ba),clearFeaturesVisibility:()=>this._setAllFeaturesVisibility(!0),updateFeatureVisibilities:ba=>
this._updateFeatureVisibilities(ba)}});this._updatingHandles.addOnCollectionChange(()=>this._loadedPointGraphics,ba=>this._onLoadedFeaturesChange(ba),c.initial);this._updatingHandles.addWhen(()=>this._materialParameters,ba=>this._forEachMaterial(U=>U.setParameters(ba)),c.initial);this._updatingHandles.add(()=>this._rendererParameters,ba=>this._drapeSourceRenderer.set(ba));this._updatingHandles.add(()=>this._heatmapRendererField,()=>{this._recreate()},c.sync);this._updatingHandles.add(()=>({fieldName:this._heatmapRendererFieldName,
numeric:this._heatmapRendererFieldIsNumeric}),({fieldName:ba,numeric:U})=>{if(null!=ba&&U){let Z=0;this._featureStore.forEach(ca=>Z+=ca.attributes[ba]??0);this._fieldTotal=Z}else this._fieldTotal=this._featureStore.numFeatures},c.initial);this.addHandles([c.watch(()=>({fieldName:this._heatmapRendererFieldName,field:this._heatmapRendererField}),({fieldName:ba,field:U})=>{ba&&!U&&f.getLogger(this).warn(`Heatmap renderer field '${ba}' for layer '${this.layer.title??this.layer.id}' not found`)}),c.watch(()=>
({field:this._heatmapRendererField,numeric:this._heatmapRendererFieldIsNumeric}),({field:ba,numeric:U})=>{null==ba||U||f.getLogger(this).warn(`Heatmap renderer field '${ba.name}' for layer '${this.layer.title??this.layer.id}' does not contain numeric values and cannot be used to drive the heatmap density`)}),k.makeHandle(()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))])}destroy(){this._renderGeometries.clear();this._materialWithField=this._material=null;this._featureStore.clear();
this._featureStore=null;this._updatingHandles.destroy()}get layer(){return this.owner.layer}get featureStore(){return this._featureStore}get updating(){return this._updatingHandles.updating||this.filterVisibility.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get filterVisibility(){return this._filterVisibility}get displayFeatureLimit(){var S=this.owner?.view?.quality??1;const V=this.owner?.view?.qualitySettings;S=V?Math.ceil(V.heatmap.maxTotalNumberOfFeatures*
S):0;return new D.DisplayFeatureLimit(6*S,S)}get hasZ(){return"hasZ"in this.layer&&this.layer.hasZ}get hasM(){return"hasM"in this.layer&&this.layer.hasM}get view(){return this.owner.view}get fullOpacity(){return this.owner.fullOpacity}get updatePolicy(){return this.owner.updatePolicy}get scaleVisibilitySuspended(){if(!this._isScaleRangeActive)return!1;const {minScale:S,maxScale:V}=this.layer.effectiveScaleRange,{scale:T}=this.view;return!R.scaleBoundsPredicate(T,S??0,V??0)}get usedMemory(){const S=
Math.ceil((this._overlayRenderer?.overlays[0]?.resolution??0)*this._densityMapPixelRatio)??0;return S*S*(this._pixelFormat===Q.PixelFormat.RED?1:4)*(this._dataType===Q.PixelType.FLOAT?4:2)+this.usedMemoryPerFeature*this._featureStore.numFeatures}get usedMemoryPerFeature(){var S=this._loadedPointGraphics.find(()=>!0);if(null==S)return 0;S=p.estimateAttributesObjectSize(S);const V=p.estimateNumberByteSize(),T=6*p.estimateFixedArraySize([0,0,0],V),Y=6*p.estimateFixedArraySize([0,0],V);return T+Y+(this._heatmapRendererFieldIsNumeric?
6*V:0)+S}get loadedFeatures(){return this._featureStore.numFeatures}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return new F.GraphicsCorePerformanceInfo(this._visibleFeatures,0,0)}get renderer(){return this._heatmapRenderer}get _overlayRenderer(){return this.view.basemapTerrain.overlayManager.renderer}get _overlaySpatialReference(){return this._overlayRenderer.spatialReference}get _rendererParameters(){return{...this._radiusParameter,...this._densityParameters,...this._colorRampParameter,
...this._pixelRatioParameter}}get _materialParameters(){return{...this._radiusParameter,...this._resolutionForScaleParameter}}get _densityParameters(){const S=this._heatmapRenderer;if(null==S)return null;const {minDensity:V,maxDensity:T}=S;return{minDensity:V,maxDensity:T,fieldTotal:this._fieldTotal}}get _radiusParameter(){const S=this._heatmapRenderer;return S?{searchRadius:e.pt2px(this._clampSearchRadius(S.radius))}:null}get _resolutionForScaleParameter(){var S=this._heatmapRenderer;if(!S)return null;
({referenceScale:S}=S);return{resolutionForScale:0===S?0:r.getResolutionForScale(S,this.view.spatialReference)}}get _colorRampParameter(){const S=this._heatmapRenderer;return S?{colorRampData:B.generateGradient(S.colorStops)}:null}get _pixelRatioParameter(){return{pixelRatio:this._densityMapPixelRatio}}get _densityMapPixelRatio(){return this.owner?.view?.qualitySettings.heatmap.pixelRatio??1}get _renderView(){return this.view._stage.renderView}get _featuresArePoints(){return"point"===this.layer.geometryType}get _loadedPointGraphics(){return this.owner.loadedGraphics}get _heatmapRenderer(){const S=
this.layer.renderer;return"heatmap"===S?.type?S:null}get _heatmapRendererFieldName(){return this._heatmapRenderer?.field}get _heatmapRendererField(){const S=this._heatmapRendererFieldName;return null!=S?this.layer.fieldsIndex.get(S):null}get _heatmapRendererFieldIsNumeric(){const S=this._heatmapRendererField;return null==S?!1:A.isNumericField(S)}get _isScaleRangeActive(){const {layer:S}=this;if(!("effectiveScaleRange"in S))return!1;const {minScale:V,maxScale:T}=S.effectiveScaleRange;return R.isScaleRangeActive(V,
T)}get _visibleFeatures(){let S=0;this._renderGeometries.forEach(V=>{V.visible&&++S});return S}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlight(){return k.makeHandle()}maskOccludee(){return k.makeHandle()}setObjectIdVisibility(){}refreshFilter(){this.filterVisibility.reapply()}_onLoadedFeaturesChange(S){if(this._featuresArePoints){var {objectIdField:V}=this.layer;this._featureStore.removeManyById(S.removed.map(Y=>n.getObjectId(Y,V)));this._featureStore.addMany(S.added.map(Y=>
{const {attributes:ha,centroid:ba,geometry:U}=Y,Z=new x.OptimizedFeature(u.convertFromPoint(new y,U),ha,ba?u.convertFromPoint(new y,ba):null,n.getObjectId(Y,V));Z.displayId=Y.uid;return Z}));var T=S.added;S=S.removed;this._fieldTotal+=this._computeFieldTotalChange(T,S);S=S.map(({uid:Y})=>{const ha=this._renderGeometries.get(Y);this._renderGeometries.delete(Y);return ha}).filter(l.isSome);T=T.map(Y=>{const ha=this._pointGraphicToRenderGeometry(Y);this._renderGeometries.set(Y.uid,ha);return ha});0<
S.length&&this._drapeSourceRenderer.removeGeometries(S,L.DirtyOperation.REMOVE);0<T.length&&this._drapeSourceRenderer.addGeometries(T,L.DirtyOperation.ADD);if(0<T.length||0<S.length)this.filterVisibility.reapply(),this._renderView.requestRender()}}_recreate(){if(this._loadedPointGraphics){var S=this._loadedPointGraphics.toArray();this._onLoadedFeaturesChange({added:S,removed:S})}}_pointGraphicToRenderGeometry(S){const V=this._heatmapRendererFieldName,T=null!=V?this._materialWithField:this._material;
var Y=t.create();v.projectPointToVector(S.geometry,Y,this._overlaySpatialReference);Y[2]=N.drapedZ;const ha=m.getContinuousIndexArray(1);Y=[[K.VertexAttribute.POSITION,new E.Attribute(Y,ha,Y.length)]];const ba=this._heatmapRendererFieldIsNumeric;null!=V&&Y.push([K.VertexAttribute.FEATUREATTRIBUTE,new E.Attribute([ba?S.attributes[V]??0:0],ha,1)]);S=new P.RenderGeometry(new O.Geometry(T,Y,null,G.ContentObjectType.Point),{layerUid:this.layer.uid,graphicUid:S.uid});S.visible=this.filterVisibility.defaultVisibility;
return S}_forEachMaterial(S){S(this._material);S(this._materialWithField)}_computeFieldTotalChange(S,V){if(null==this._heatmapRendererFieldName||!this._heatmapRendererFieldIsNumeric)return S.length-V.length;const T=this._heatmapRendererFieldName,Y=(ha,ba)=>ha+(ba.attributes[T]??0);return S.reduce(Y,0)-V.reduce(Y,0)}_clampSearchRadius(S){112<S&&f.getLogger(this).warnOnce("SceneView supports a maximum radius of 112 pt for HeatmapRenderer.");return Math.min(S,112)}_updateFeatureVisibilities(S){const V=
[];this._featureStore.forEach(({objectId:T,displayId:Y})=>{T=S(T);(Y=this._renderGeometries.get(Y))&&Y.visible!==T&&(V.push(Y),Y.visible=T)});this._drapeSourceRenderer.modifyGeometries(V,L.DirtyState.VISIBILITY)}_setAllFeaturesVisibility(S){const V=[];for(const T of this._renderGeometries.values())T.visible!==S&&(V.push(T),T.visible=S);this._drapeSourceRenderer.modifyGeometries(V,L.DirtyState.VISIBILITY)}get test(){}};b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"type",void 0);
b.__decorate([g.property({constructOnly:!0})],a.HeatmapFeatureProcessor.prototype,"owner",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"layer",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"featureStore",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"updating",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"updatingRemaining",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"suspendInfo",
null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"legendEnabled",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"filterVisibility",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"displayFeatureLimit",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"preferredUpdatePolicy",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"hasZ",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,
"hasM",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"dataExtent",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"view",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"fullOpacity",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"updatePolicy",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"drapeSourceType",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"scaleVisibilitySuspended",
null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"renderer",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_featureStore",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_filterVisibility",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_overlayRenderer",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_overlaySpatialReference",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,
"_rendererParameters",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_materialParameters",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_densityParameters",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_radiusParameter",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_resolutionForScaleParameter",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_colorRampParameter",null);b.__decorate([g.property()],
a.HeatmapFeatureProcessor.prototype,"_pixelRatioParameter",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_densityMapPixelRatio",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_renderGeometries",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_material",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_materialWithField",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_renderView",
null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_featuresArePoints",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_loadedPointGraphics",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_heatmapRenderer",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_heatmapRendererFieldName",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_heatmapRendererField",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,
"_heatmapRendererFieldIsNumeric",null);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_fieldTotal",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_drapeSourceRenderer",void 0);b.__decorate([g.property()],a.HeatmapFeatureProcessor.prototype,"_isScaleRangeActive",null);a.HeatmapFeatureProcessor=b.__decorate([d.subclass("esri.views.3d.layers.support.HeatmapFeatureProcessor")],a.HeatmapFeatureProcessor);a.maxRadiusPt=112;Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/layers/graphics/data/FeatureStore":function(){define("../../../core/arrayUtils ../../../core/Error ../../../core/Evented ../../../core/Logger ../../../geometry/support/aaBoundingBox ../../../geometry/support/aaBoundingRect ../featureConversionUtils ./BoundsStore ./geometryUtils ./optimizedFeatureQueryEngineAdapter".split(" "),function(a,b,q,l,p,k,h,f,c,e){const g=p.create();class d{constructor(t){this.geometryInfo=t;this._boundsStore=new f.BoundsStore;this._featuresById=
new Map;this._markedIds=new Set;this.events=new q;this.featureAdapter=e.optimizedFeatureQueryEngineAdapter}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;this._featuresById.forEach(w=>{null!=w.geometry&&w.geometry.coords&&(t+=w.geometry.coords.length)});return{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 [w,v,m,r]=this.fullBounds;return{xmin:w,ymin:v,xmax:m,ymax:r,spatialReference:c.cleanFromGeometryEngine(t)}}add(t){this._add(t);this._emitChanged()}addMany(t){for(const w of t)this._add(w);this._emitChanged()}upsertMany(t){t=t.map(w=>this._upsert(w));this._emitChanged();return t.filter(a.isSome)}clear(){this._featuresById.clear();this._boundsStore.clear();this._emitChanged()}removeById(t){t=
this._featuresById.get(t);if(!t)return null;this._remove(t);this._emitChanged();return t}removeManyById(t){this._boundsStore.invalidateIndex();for(const w of t)(t=this._featuresById.get(w))&&this._remove(t);this._emitChanged()}forEachBounds(t,w){for(const v of t)(t=this._boundsStore.get(v.objectId))&&w(p.fromRect(g,t))}getFeature(t){return this._featuresById.get(t)}has(t){return this._featuresById.has(t)}forEach(t){this._featuresById.forEach(w=>t(w))}forEachInBounds(t,w){this._boundsStore.forEachInBounds(t,
v=>{w(this._featuresById.get(v))})}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex();this._markedIds.clear()}sweep(){let t=!1;this._featuresById.forEach((w,v)=>{this._markedIds.has(v)||(t=!0,this._remove(w))});this._markedIds.clear();t&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(t){if(t){var w=t.objectId;if(null==w)l.getLogger("esri.layers.graphics.data.FeatureStore").error(new b("featurestore:invalid-feature","feature id is missing",{feature:t}));else{var v=
this._featuresById.get(w);this._markedIds.add(w);if(v){t.displayId=v.displayId;var m=this._boundsStore.get(w);this._boundsStore.delete(w)}else if(null!=this.onFeatureAdd)this.onFeatureAdd(t);t.geometry?.coords?.length?(m=h.getBoundsOptimizedGeometry(null!=m?m:k.create(),t.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=m&&this._boundsStore.set(w,m)):this._boundsStore.set(w,null);this._featuresById.set(w,t)}}}_upsert(t){const w=t?.objectId;if(null==w)return l.getLogger("esri.layers.graphics.data.FeatureStore").error(new b("featurestore:invalid-feature",
"feature id is missing",{feature:t})),null;const v=this._featuresById.get(w);if(!v)return this._add(t),t;this._markedIds.add(w);const {geometry:m,attributes:r}=t;for(const n in r)v.attributes[n]=r[n];m&&(v.geometry=m,this._boundsStore.set(w,h.getBoundsOptimizedGeometry(k.create(),m,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null));return v}_remove(t){if(null!=this.onFeatureRemove)this.onFeatureRemove(t);const w=t.objectId;this._markedIds.delete(w);this._boundsStore.delete(w);this._featuresById.delete(w);
return t}}return d})},"esri/layers/graphics/data/BoundsStore":function(){define(["exports","../../../core/has","../../../core/libs/rbush/PooledRBush","../../../geometry/support/aaBoundingRect"],function(a,b,q,l){function p(f,c,e){k.minX=c[0];k.minY=c[1];k.maxX=c[2];k.maxY=c[3];f.search(k,e)}const k={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 q.PooledRBush(9,b("esri-csp-restrictions")?
f=>({minX:f[0],minY:f[1],maxX:f[2],maxY:f[3]}):["[0]","[1]","[2]","[3]"]);this._loadIndex=()=>{if(this._indexInvalid){const f=Array(this._idByBounds.size);let c=0;this._idByBounds.forEach((e,g)=>{f[c++]=g});this._indexInvalid=!1;this._index.clear();this._index.load(f)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(f=>this._idByBounds.has(f))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const f=l.empty();for(const c of this._boundsById.values())c&&
(f[0]=Math.min(c[0],f[0]),f[1]=Math.min(c[1],f[1]),f[2]=Math.max(c[2],f[2]),f[3]=Math.max(c[3],f[3]));return f}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1;this._boundsToLoad.length=0;this._boundsById.clear();this._idByBounds.clear();this._index.clear()}delete(f){const c=this._boundsById.get(f);this._boundsById.delete(f);c&&(this._idByBounds.delete(c),this._indexInvalid||this._index.remove(c))}forEachInBounds(f,c){this._loadIndex();p(this._index,f,e=>c(this._idByBounds.get(e)))}get(f){return this._boundsById.get(f)}has(f){return this._boundsById.has(f)}invalidateIndex(){this._indexInvalid||
(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(f,c){if(!this._indexInvalid){const e=this._boundsById.get(f);e&&(this._index.remove(e),this._idByBounds.delete(e))}this._boundsById.set(f,c);c&&(this._idByBounds.set(c,f),this._indexInvalid||(this._boundsToLoad.push(c),5E4<this._boundsToLoad.length&&this._loadIndex()))}}a.BoundsStore=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/DrapedHeatmapRenderer":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/maybe ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../ViewingMode ./glUtil3D ./SortedRenderGeometryRenderer ../shaders/HeatmapTechnique ../../../webgl/enums ../../../webgl/FramebufferObject ../../../webgl/Texture ../../../webgl/TextureDescriptor ../../../webgl/Util".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n){a.DrapedHeatmapRenderer=class extends d.SortedRenderGeometryRenderer{constructor(u){super(u);this.pixelRatio=1;this._colorRampData=new Uint8ClampedArray(4);this.type="draped-heatmap";this._heatmapParameters=new t.HeatmapPassParameters;var x=new r.TextureDescriptor;x.pixelFormat=u.pixelFormat;x.internalFormat=u.internalFormat;x.dataType=u.dataType;x.samplingMode=u.samplingMode;x.wrapMode=w.TextureWrapMode.CLAMP_TO_EDGE;const y=u.rendererContext.rctx;this._densityMap=
new v.FramebufferObject(y,x);this._quad=g.createQuadVAO(y);x=new t.HeatmapTechniqueConfiguration;x.usesHalfFloat=u.dataType!==w.PixelType.FLOAT;this._technique=new t.HeatmapTechnique({rctx:y,viewingMode:e.ViewingMode.Local},x)}initialize(){const u=this._colorRampData,x=new r.TextureDescriptor(u.length/4,1);x.wrapMode=w.TextureWrapMode.CLAMP_TO_EDGE;this._colorRamp=new m.Texture(this.rctx,x,u);this._heatmapParameters.densityMap=this._densityMap.colorTexture;this.addHandles(l.watch(()=>[this.colorRampData,
this.minDensity,this.maxDensity,this.fieldTotal,this.pixelRatio,this.searchRadius],()=>this.rendererContext.notifyContentChanged()))}destroy(){this._technique=q.releaseMaybe(this._technique);this._densityMap=q.disposeMaybe(this._densityMap);this._quad=q.disposeMaybe(this._quad);this._colorRamp=q.disposeMaybe(this._colorRamp)}get searchRadius(){return this._heatmapParameters.searchRadius}set searchRadius(u){u!==this._heatmapParameters.searchRadius&&(this._heatmapParameters.searchRadius=u,this.notifyChange("searchRadius"))}get minDensity(){return this._heatmapParameters.minDensity}set minDensity(u){u!==
this._heatmapParameters.minDensity&&(this._heatmapParameters.minDensity=u,this.notifyChange("minDensity"))}get maxDensity(){return this._heatmapParameters.maxDensity}set maxDensity(u){u!==this._heatmapParameters.maxDensity&&(this._heatmapParameters.maxDensity=u,this.notifyChange("maxDensity"))}get fieldTotal(){return this._heatmapParameters.fieldTotal}set fieldTotal(u){this._heatmapParameters.fieldTotal=u;this.notifyChange("fieldTotal")}get colorRampData(){return this._colorRampData}set colorRampData(u){const {colorRamp:x}=
this._heatmapParameters;if(null!=x&&u!==this._colorRampData){const y=u.length/4;y!==x.descriptor.width&&x.resize(y,1);x.setData(u)}this._colorRampData=u}get _colorRamp(){return this._heatmapParameters.colorRamp}set _colorRamp(u){this._heatmapParameters.colorRamp=u}get hasHighlights(){return!1}get hasWater(){return!1}get rendersOccludedDraped(){return!1}render(u){const x=this._sortedMaterialRenderers;if(0!==x.length){var y=this.rctx.getBoundFramebufferObject(),z=this.rctx.getViewport(),{pixelRatio:A}=
this,B=Math.ceil(z.width*A);A=Math.ceil(z.height*A);this._densityMap.resize(B,A);this.rctx.bindFramebuffer(this._densityMap);this.rctx.setViewport(0,0,B,A);this.rctx.clear(w.ClearBufferBit.COLOR_BUFFER_BIT);var C=!1;x.forAll(D=>{const F=D.prepareTechnique(u);null!=F&&(D.renderNode(u,F),C=!0)});this.rctx.bindFramebuffer(y);this.rctx.setViewport(z.x,z.y,z.width,z.height);C&&(this.rctx.bindVAO(this._quad),this.rctx.bindTechnique(this._technique,u.bindParameters,this._heatmapParameters),this.rctx.drawArrays(this._technique.primitiveType,
0,n.vertexCount(this._quad,"geometry")))}}};b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype,"searchRadius",null);b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype,"minDensity",null);b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype,"maxDensity",null);b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype,"fieldTotal",null);b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype,"pixelRatio",void 0);b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype,
"colorRampData",null);b.__decorate([p.property({constructOnly:!0})],a.DrapedHeatmapRenderer.prototype,"dataType",void 0);b.__decorate([p.property({constructOnly:!0})],a.DrapedHeatmapRenderer.prototype,"samplingMode",void 0);b.__decorate([p.property({constructOnly:!0})],a.DrapedHeatmapRenderer.prototype,"pixelFormat",void 0);b.__decorate([p.property({constructOnly:!0})],a.DrapedHeatmapRenderer.prototype,"internalFormat",void 0);b.__decorate([p.property()],a.DrapedHeatmapRenderer.prototype,"_colorRampData",
void 0);a.DrapedHeatmapRenderer=b.__decorate([c.subclass("esri.views.3d.webgl-engine.lib.DrapedHeatmapRenderer")],a.DrapedHeatmapRenderer);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/HeatmapTechnique":function(){define("require exports ../../../../chunks/tslib.es6 ../core/shaderModules/interfaces ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/DefaultVertexAttributeLocations ../lib/OrderIndependentTransparency ../lib/Program ../materials/DefaultTechniqueConfiguration ../../../../chunks/Heatmap.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){class v extends l.NoParameters{constructor(){super(...arguments);this.densityMap=this.colorRamp=null;this.searchRadius=1;this.minDensity=this.fieldTotal=0;this.maxDensity=100}}class m extends k.ShaderTechnique{constructor(n,u){super(n,u,()=>this.destroy())}initializeProgram(n){return new e.Program(n.rctx,m.shader.get().build(this.configuration),f.Default3D)}initializePipeline(){return w.makePipelineState({blending:c.blendingDefault,colorWrite:w.defaultColorWriteParams,
depthTest:null,depthWrite:null})}get primitiveType(){return t.PrimitiveType.TRIANGLE_STRIP}}m.shader=new p.ReloadableShaderModule(d.HeatmapShader,()=>new Promise((n,u)=>a(["./Heatmap.glsl"],n,u)));class r extends g.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.usesHalfFloat=!1}}q.__decorate([h.parameter()],r.prototype,"usesHalfFloat",void 0);b.HeatmapPassParameters=v;b.HeatmapTechnique=m;b.HeatmapTechniqueConfiguration=r;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},
"esri/chunks/Heatmap.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlphaBlend.glsl ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform".split(" "),function(a,b,q,l,p,k,h){function f(e){const g=new k.ShaderBuilder;
g.include(b.ScreenSpacePass);g.include(q.DiscardOrAdjustAlphaBlend);({usesHalfFloat:e}=e);g.fragment.uniforms.add(new h.Texture2DPassUniform("densityMap",d=>d.densityMap),new h.Texture2DPassUniform("tex",d=>d.colorRamp),new l.FloatPassUniform("densityNormalizer",d=>1/(d.maxDensity-d.minDensity)),new l.FloatPassUniform("minDensity",d=>d.minDensity),new l.FloatPassUniform("densityMultiplier",d=>3/(d.searchRadius*d.searchRadius*Math.PI)));e&&g.constants.add("compressionFactor","float",4);g.fragment.code.add(p.glsl`
void main() {
float density = texture(densityMap, uv).r * densityMultiplier${e?p.glsl` * compressionFactor`:""};
float densityRatio = (density - minDensity) * densityNormalizer;
vec4 color = texture(tex, vec2(clamp(densityRatio, 0.0, 1.0), 0.5));
discardOrAdjustAlpha(color);
fragColor = color;
}
`);return g}const c=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}));a.HeatmapShader=c;a.build=f})},"esri/views/3d/webgl-engine/materials/HeatmapDensityMaterial":function(){define("exports ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../support/buffer/InterleavedLayout ../core/shaderLibrary/ShaderOutput ../lib/GLMaterial ../lib/Material ../lib/RenderSlot ../lib/VertexAttribute ./internal/bufferWriterUtils ../shaders/HeatmapDensityTechnique".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){class d extends g.HeatmapDensityPassParameters{constructor(){super(...arguments);this.usesHalfFloats=this.isAttributeDriven=!1}}class t extends h.Material{constructor(u){super(u,new d);this.produces=new Map([[f.RenderSlot.DRAPED_MATERIAL,x=>x===p.ShaderOutput.Color]]);this._configuration=new g.HeatmapDensityTechniqueConfiguration}getConfiguration(){this._configuration.isAttributeDriven=this.parameters.isAttributeDriven;this._configuration.usesHalfFloat=this.parameters.usesHalfFloats;
return this._configuration}createGLMaterial(u){return new w(u)}intersect(){}intersectDraped(u,x,y,z,A,B){x=u.attributes.get(c.VertexAttribute.POSITION);({parameters:y}=this);({searchRadius:y}=y);({screenToWorldRatio:u}=u);u=y*u+2*u;u*=u;y=x.data.length/x.size;for(let D=0;D<y;D++){var C=D*x.size;C=b.set(n,x.data[C],x.data[C+1]);b.squaredDistance(C,z)<u&&A(B.dist,B.normal,-1,!1)}}createBufferWriter(){return new v(this.parameters.isAttributeDriven?r:m)}}class w extends k{beginSlot(u){return this.ensureTechnique(g.HeatmapDensityTechnique,
u)}}class v{constructor(u){this.vertexBufferLayout=u}elementCount(u){return 6*u.attributes.get(c.VertexAttribute.POSITION).indices.length}write(u,x,y,z,A){e.writePosition(y.attributes.get(c.VertexAttribute.POSITION),u,z.position,A,6);u=y.attributes.get(c.VertexAttribute.POSITION).indices.length;x=z.uv0;let B=A;for(let C=0;C<u;++C)x.setValues(B++,-1,-1),x.setValues(B++,1,-1),x.setValues(B++,1,1),x.setValues(B++,1,1),x.setValues(B++,-1,1),x.setValues(B++,-1,-1);(z=c.VertexAttribute.FEATUREATTRIBUTE in
z?z.featureAttribute:null)&&e.writeBufferFloat(y.attributes.get(c.VertexAttribute.FEATUREATTRIBUTE),z,A,6)}}const m=l.newLayout().vec3f(c.VertexAttribute.POSITION).vec2f(c.VertexAttribute.UV0),r=m.clone().f32(c.VertexAttribute.FEATUREATTRIBUTE),n=q.create();a.HeatmapDensityMaterial=t;a.HeatmapDensityMaterialParameters=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/HeatmapDensityTechnique":function(){define("require exports ../../../../chunks/tslib.es6 ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../core/shaderTechnique/ShaderTechniqueConfiguration ../lib/DefaultVertexAttributeLocations ../lib/Material ../lib/Program ../materials/DefaultTechniqueConfiguration ../../../../chunks/HeatmapDensity.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){class w extends f.MaterialParameters{constructor(){super(...arguments);this.searchRadius=128;this.resolutionForScale=0}}class v extends p.ShaderTechnique{initializeProgram(r){return new c.Program(r.rctx,v.shader.get().build(this.configuration),h.Default3D)}initializePipeline(){return t.makePipelineState({blending:t.simpleBlendingParams(d.BlendFactor.ONE,d.BlendFactor.ONE,d.BlendOperation.ADD),colorWrite:t.defaultColorWriteParams,depthTest:null,depthWrite:null})}destroy(){super.destroy()}}
v.shader=new l.ReloadableShaderModule(g.HeatmapDensity,()=>new Promise((r,n)=>a(["./HeatmapDensity.glsl"],r,n)));class m extends e.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.usesHalfFloat=this.isAttributeDriven=!1}}q.__decorate([k.parameter()],m.prototype,"isAttributeDriven",void 0);q.__decorate([k.parameter()],m.prototype,"usesHalfFloat",void 0);b.HeatmapDensityPassParameters=w;b.HeatmapDensityTechnique=v;b.HeatmapDensityTechniqueConfiguration=m;Object.defineProperty(b,
Symbol.toStringTag,{value:"Module"})})},"esri/chunks/HeatmapDensity.glsl":function(){define("exports ../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl ../views/3d/webgl-engine/core/shaderModules/FloatPassUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),function(a,b,q,l,p,k){function h(c){const e=new p.ShaderBuilder,{vertex:g,fragment:d,attributes:t,varyings:w}=
e;b.addProjViewLocalOrigin(g,c);const {isAttributeDriven:v,usesHalfFloat:m}=c;t.add(k.VertexAttribute.POSITION,"vec3");t.add(k.VertexAttribute.UV0,"vec2");v&&(t.add(k.VertexAttribute.FEATUREATTRIBUTE,"float"),w.add("attributeValue","float"));m&&e.constants.add("compressionFactor","float",.25);w.add("unitCirclePos","vec2");g.uniforms.add(new q.FloatPassUniform("radius",({resolutionForScale:r,searchRadius:n},{camera:u,screenToWorldRatio:x,overlayStretch:y})=>2*n*(0===r?1:r/x)*u.pixelRatio/u.fullViewport[2]/
y));g.code.add(l.glsl`
void main() {
unitCirclePos = uv0;
vec4 posProj = proj * (view * vec4(${k.VertexAttribute.POSITION}, 1.0));
vec4 quadOffset = vec4(unitCirclePos * radius, 0.0, 0.0);
${v?l.glsl`attributeValue = ${k.VertexAttribute.FEATUREATTRIBUTE};`:""}
gl_Position = posProj + quadOffset;
}
`);d.code.add(l.glsl`
void main() {
float radiusRatioSquared = dot(unitCirclePos, unitCirclePos);
if (radiusRatioSquared > 1.0) {
discard;
}
float oneMinusRadiusRatioSquared = 1.0 - radiusRatioSquared;
float density = oneMinusRadiusRatioSquared * oneMinusRadiusRatioSquared ${v?l.glsl` * attributeValue`:""} ${m?l.glsl` * compressionFactor`:""};
fragColor = vec4(density);
}
`);return e}const f=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}));a.HeatmapDensity=f;a.build=h})},"esri/views/webgl/heatmapTextureUtils":function(){define(["exports","../../core/Error","./enums"],function(a,b,q){class l{constructor(p,k,h,f){this.dataType=p;this.samplingMode=k;this.pixelFormat=h;this.internalFormat=f}}a.HeatmapTextureConfiguration=l;a.loadHeatmapTextureConfiguration=function(p,k){const {textureFloatLinear:h,colorBufferFloat:f}=
p.capabilities,c=f?.textureFloat,e=f?.textureHalfFloat,g=f?.floatBlend;p=p.driverTest.floatBufferBlend.result;if(!c&&!e)throw new b("heatmap:missing-color-buffer-float","HeatmapRenderer requires the WebGL extension EXT_color_buffer_float or EXT_color_buffer_half_float or WEBGL_color_buffer_float.");if(!(g&&p||e))throw new b("heatmap:missing-float-blend",`HeatmapRenderer requires the WebGL extension EXT_float_blend or EXT_color_buffer_half_float.${p?"":" This device claims support for EXT_float_blend, but does not actually support it."}`);
const d=!!f?.R32F,t=!!f?.R16F;if(c&&g&&p&&h)return h||k.warnOnce("Missing WebGL extension OES_texture_float_linear. Heatmap quality may be reduced."),new l(q.PixelType.FLOAT,h?q.TextureSamplingMode.LINEAR:q.TextureSamplingMode.NEAREST,d?q.PixelFormat.RED:q.PixelFormat.RGBA,d?q.SizedPixelFormat.R32F:q.PixelFormat.RGBA);if(e)return new l(q.PixelType.HALF_FLOAT,q.TextureSamplingMode.LINEAR,t?q.PixelFormat.RED:q.PixelFormat.RGBA,t?q.SizedPixelFormat.R16F:q.PixelFormat.RGBA);throw new b("heatmap:missing-hardware-support",
"HeatmapRenderer requires WebGL extensions that allow it to render and blend to float or half float textures.");};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/FeatureTileFetcher3DLayerViewContext":function(){define(["exports","../../../../core/maybe","./FeatureTileFetcher3D","./featureTileQuery3D"],function(a,b,q,l){class p{constructor(k){this._capabilities=this._memoryCache=null;const h=k.layerView.layer;this._layerView=k.layerView;this.objectIdField=
h.objectIdField;this.globalIdField="globalIdField"in h?h.globalIdField:null;this._returnZ=k.returnZ;this._returnM=k.returnM;k=this._layerView.view.resourceController;this.query=l.createFeatureTileQuery3D(this._layerView,k.normal);k&&this._memoryCacheEnabled&&(this._memoryCache=k.memoryController.newCache(`fl-${h.uid}`))}get _memoryCacheEnabled(){switch(this._layerView.layer.source.type){case "feature-layer":case "ogc-feature":case "oriented-imagery":return!0;case "csv":case "geojson":case "memory":case "wfs":return!1}}destroy(){this._memoryCache=
b.destroyMaybe(this._memoryCache);this.query.destroy()}createQuery(){const k=this._layerView.layer.createQuery();k.outFields=this._layerView.availableFields;k.returnZ=this._returnZ;k.returnM=this._returnM;k.outSpatialReference=this.tilingScheme.spatialReference;return k}get memoryCache(){return this._memoryCache}get viewingMode(){return this._layerView.view.state.viewingMode}get tilingScheme(){return this._layerView.view.featureTiles.tilingScheme}get scheduler(){const k=this._layerView.view.resourceController;
return k?k.scheduler:null}get geometryType(){return this._layerView.layer.geometryType}get fullExtent(){return this._layerView.layer.fullExtent}get tileMaxRecordCount(){return this._layerView.layer.capabilities.query.tileMaxRecordCount}get maxRecordCount(){return this._layerView.layer.capabilities.query.maxRecordCount}get capabilities(){return null!=this._capabilities?this._capabilities:this._capabilities=q.contextCapabilitiesFromLayer(this._layerView.layer)}logFetchError(k,h){k.error("#fetchTile()",
this._layerView.layer,h?.message??h)}}a.FeatureTileFetcher3DLayerViewContext=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/featureTileQuery3D":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/SetUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../layers/graphics/dehydratedFeatures ../../../../rest/query/operations/query ../../support/PBFDecoder".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){let v=class extends q{constructor(u){super(u)}get implicitFields(){if(!this.layer.outFields?.includes("*"))return new Set;const u=new Set(this.layerView.requiredFields),x=new Set(this.layerView.availableFields);return k.difference(x,u)}get queryFeaturesDehydrated(){const {layer:u}=this;var x=u.capabilities;x=x&&x.query;const y=u.parsedUrl;if(x&&x.supportsFormatPBF){null==this._decoder&&(this._decoder=new w.PBFDecoder(this.controller));const z={sourceSpatialReference:u.spatialReference?.toJSON()??
null,applyTransform:!0,maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:1024};return(A,B)=>t.runQuery(y,A,"pbf",this._createRequestOptions(B)).then(C=>{p.throwIfAborted(B);return null!=this._decoder?this._decoder.invoke({buffer:C.data,options:z},B.signal):Promise.reject(p.createAbortError())})}return(z,A)=>t.executeQuery(y,z,u.spatialReference,this._createRequestOptions(A)).then(B=>d.fromFeatureSetJSON(B.data,{maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:1024}))}queryFeatureCount(u,
x){return this.layer.queryFeatureCount(u,x)}destroy(){this._decoder=l.destroyMaybe(this._decoder)}_createRequestOptions(u){return{...u,query:{...this.layer.customParameters,token:this.layer.apiKey,...u?.query}}}};b.__decorate([h.property({constructOnly:!0})],v.prototype,"layer",void 0);b.__decorate([h.property({constructOnly:!0})],v.prototype,"layerView",void 0);b.__decorate([h.property({constructOnly:!0})],v.prototype,"controller",void 0);b.__decorate([h.property({readOnly:!0})],v.prototype,"implicitFields",
null);b.__decorate([h.property({readOnly:!0})],v.prototype,"queryFeaturesDehydrated",null);v=b.__decorate([g.subclass("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceQuery3D")],v);let m=class extends q{constructor(u){super(u)}queryFeaturesDehydrated(u,x){return this.layer.queryFeatures(u,x)}queryFeatureCount(u,x){return this.layer.queryFeatureCount(u,x)}};b.__decorate([h.property({constructOnly:!0})],m.prototype,"layer",void 0);b.__decorate([h.property({readOnly:!0})],m.prototype,
"queryFeaturesDehydrated",null);m=b.__decorate([g.subclass("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceMeshQuery3D")],m);let r=class extends q{constructor(u){super(u)}queryFeaturesDehydrated(u,x){return this.layer.queryFeatures(u,x)}};b.__decorate([h.property({constructOnly:!0})],r.prototype,"layer",void 0);r=b.__decorate([g.subclass("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileOGCServiceQuery3D")],r);let n=class extends q{constructor(u){super(u)}queryFeaturesDehydrated(u,
x){return this.source.queryFeaturesJSON(u,x).then(d.fromFeatureSetJSON,y=>{if(y&&"query-features-json:unsupported"===y.name)return this.layer.queryFeatures(u,x);throw y;})}queryFeatureCount(u,x){return this.layer.queryFeatureCount(u,x)}};b.__decorate([h.property({constructOnly:!0})],n.prototype,"layer",void 0);b.__decorate([h.property({constructOnly:!0})],n.prototype,"source",void 0);n=b.__decorate([g.subclass("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileClientQuery3D")],n);a.createFeatureTileQuery3D=
function(u,x){const {layer:y}=u;return"feature"===y.type&&"feature-layer"===y.source.type||"catalog-footprint"===y.type?"infoFor3D"in y&&null!=y.infoFor3D?new m({layer:y}):new v({layer:y,layerView:u,controller:x}):"feature"===y.type&&"memory"===y.source.type||"csv"===y.type||"geojson"===y.type||"oriented-imagery"===y.type||"wfs"===y.type?new n({layer:y,source:y.source}):"ogc-feature"===y.type?new r({layer:y}):null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/PBFDecoder":function(){define("exports ../../../Graphic ../../../core/typedArrayUtil ../../../core/workers/WorkerHandle ../../../geometry/SpatialReference ../../../layers/support/Field".split(" "),
function(a,b,q,l,p,k){function h(e){switch(e.type){case "polyline":e.paths.reduce((g,d)=>g+d.length,0)<q.nativeArrayMaxSize&&(e.paths=e.hasZ||e.hasM?e.paths.map(g=>g.map(d=>[d[0],d[1],d[2]])):e.paths.map(g=>g.map(d=>[d[0],d[1]])));break;case "polygon":e.rings.reduce((g,d)=>g+d.length,0)<q.nativeArrayMaxSize&&(e.rings=e.hasZ||e.hasM?e.rings.map(g=>g.map(d=>[d[0],d[1],d[2]])):e.rings.map(g=>g.map(d=>[d[0],d[1]])))}}class f{constructor(e){this._controller=e;this._handle=new c(g=>e.schedule(g))}destroy(){this._handle.destroy()}invoke(e,
g){if(!e.buffer||0===e.buffer.byteLength)return Promise.resolve(null);e.options.sourceSpatialReference&&e.options.sourceSpatialReference instanceof p&&(e.options={...e.options,sourceSpatialReference:e.options.sourceSpatialReference.toJSON()});return this._handle.invoke(e,g).then(d=>{let t=0,w=0;const v=p.fromJSON(d.spatialReference);d.spatialReference=v;const m=async r=>{var n=d.fields;if(n)for(;t<n.length;)if(n[t]=k.fromJSON(n[t]),t++,r.madeProgress())return this._controller.reschedule(x=>m(x));
for(n=d.features;w<n.length;){var u=n[w];++w;u.uid=b.generateUID();u=u.geometry;if(null!=u&&(u.spatialReference=v,h(u),r.madeProgress()))return this._controller.reschedule(x=>m(x))}return d};return this._controller.schedule(r=>m(r))})}}class c extends l.WorkerHandle{constructor(e){super("PBFDecoderWorker","_parseFeatureQuery",{_parseFeatureQuery:g=>[g.buffer]},e)}}a.PBFDecoder=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/EventedSet":function(){define(["exports",
"../../../core/Evented","../../../core/ObservableChangesType","../../../core/SetUtils","../../../core/signal"],function(a,b,q,l,p){class k extends b{constructor(){super(...arguments);this._set=new Set;this._length=p.signal(0)}clear(){if(0<this._set.size){const h=this.toArray();this._set.clear();this.emit("after-changes",{type:q.ObservableChangesType.REMOVE});this.emit("change",{added:[],removed:h})}}get length(){return this._length.value}addMany(h){if(0!==h.length){for(const f of h)this._set.add(f);
this._length.value=this._set.size;this.emit("after-changes",{type:q.ObservableChangesType.ADD});this.emit("change",{added:h,removed:[]})}}remove(h){this._set.delete(h)&&(this._length.value=this._set.size,this.emit("after-changes",{type:q.ObservableChangesType.REMOVE}),this.emit("change",{added:[],removed:[h]}))}removeMany(h){const f=[];for(const c of h)this._set.delete(c)&&f.push(c);0<f.length&&(this._length.value=this._set.size,this.emit("after-changes",{type:q.ObservableChangesType.REMOVE}),this.emit("change",
{added:[],removed:f}))}toArray(){return[...this._set]}find(h){let f;l.someSet(this._set,c=>h(c)?(f=c,!0):!1);return f}forEach(h){this._set.forEach(f=>h(f))}}a.EventedSet=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/layers/FeatureLayerView":function(){define("../../chunks/tslib.es6 ../../core/Error ../../core/has ../../core/Logger ../../core/promiseUtils ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../layers/support/FeatureEffect ../../layers/support/FeatureFilter ../../layers/support/fieldUtils ../../layers/support/floorFilterUtils ../../rest/support/Query ../../support/arcadeOnDemand ./support/popupUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){return r=>{r=class extends r{constructor(...n){super(...n);this._updatingRequiredFieldsPromise=null;this.dataUpdating=!1;this.layer=this.filter=null;this.requiredFields=[];this.view=null}initialize(){this.addHandles([k.watch(()=>{const n=this.layer;return[n&&"elevationInfo"in n?n.elevationInfo?.featureExpressionInfo:null,n&&"displayField"in n?n.displayField:null,n&&"timeInfo"in n&&n.timeInfo,n&&"renderer"in n&&n.renderer,n&&"labelingInfo"in n&&n.labelingInfo,
n&&"floorInfo"in n&&n.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),k.syncAndInitial),k.on(()=>this.view?.floors,"change",()=>this._handleRequiredFieldsChange()),k.on(()=>{const n=this.layer;return n&&"sublayers"in n?n.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){if(!this.layer)return[];const {layer:n,layer:{fieldsIndex:u},requiredFields:x}=this;return"outFields"in n&&n.outFields?d.fixFields(u,[...d.unpackFieldNames(u,
n.outFields),...x]):d.fixFields(u,x)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(n){this._override("featureEffect",n)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(n){l.getLogger(this).error("#maximumNumberOfFeatures\x3d","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(n){throw Error("missing implementation");}createQuery(){var n={outFields:["*"],
returnGeometry:!0,outSpatialReference:this.view.spatialReference};n=null!=this.filter?this.filter.createQuery(n):new w(n);if("floorInfo"in this.layer&&this.layer.floorInfo){const u=t.getFloorFilterClause(this);null!=u&&(n.where=n.where?`(${n.where}) AND (${u})`:u)}null!=this.timeExtent&&(n.timeExtent=null!=n.timeExtent?n.timeExtent.intersection(this.timeExtent):this.timeExtent.clone());return n}createAggregateQuery(){return new w({outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference})}queryFeatures(n,
u){throw Error("missing implementation");}queryObjectIds(n,u){throw Error("missing implementation");}queryFeatureCount(n,u){throw Error("missing implementation");}queryExtent(n,u){throw Error("missing implementation");}async fetchPopupFeaturesFromGraphics(n,u){this._validateFetchPopupFeatures(n,u);return this._fetchPopupFeatures(n,u)}_loadArcadeModules(n){return n.expressionInfos?.length||Array.isArray(n.content)&&n.content.some(u=>"expression"===u.type)?v.loadArcade():Promise.resolve()}_handleRequiredFieldsChange(){const n=
this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",n);n.then(()=>{this._updatingRequiredFieldsPromise===n&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(this.layer&&this.view){var n="3d"===this.view.type,{layer:u,layer:{fieldsIndex:x,objectIdField:y}}=this,z="renderer"in u&&u.renderer,A="orderBy"in u&&u.orderBy,B="featureReduction"in u?u.featureReduction:null,C=new Set;z=await Promise.allSettled([z?z.collectRequiredFields(C,x):null,d.collectLabelingFields(C,
u),n&&"elevationInfo"in u?d.collectElevationFields(C,u):null,null!=this.filter?d.collectFilterFields(C,u,this.filter):null,n||null==this.featureEffect?null:d.collectFilterFields(C,u,this.featureEffect.filter),!n&&B?d.collectFeatureReductionFields(C,u,B):null,!n&&A?d.collectOrderByInfos(C,u,A):null]);"timeInfo"in u&&u.timeInfo&&this.timeExtent&&d.collectFields(C,u.fieldsIndex,[u.timeInfo.startField,u.timeInfo.endField]);"floorInfo"in u&&u.floorInfo&&d.collectFields(C,u.fieldsIndex,[u.floorInfo.floorField]);
"feature"===u.type&&n&&null!=u.infoFor3D&&(null==u.globalIdField&&l.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),d.collectFields(C,u.fieldsIndex,[u.globalIdField]));"subtype-group"===u.type&&(d.collectField(C,x,u.subtypeField),A=u.sublayers.map(D=>Promise.all([D.renderer?.collectRequiredFields(C,x),d.collectLabelingFields(C,D)])),await Promise.allSettled(A));"catalog-footprint"===u.type&&u.parent&&(A=u.parent,d.collectFields(C,x,[A.itemNameField,A.itemSourceField,A.itemTypeField,
A.maxScaleField,A.minScaleField]));for(const D of z)"rejected"===D.status&&l.getLogger(this).error(D.reason);d.collectField(C,x,y);n&&"displayField"in u&&u.displayField&&d.collectField(C,x,u.displayField);n=Array.from(C).sort();this._set("requiredFields",n)}}_validateFetchPopupFeatures(n,u){if(null!=u)for(const x of n){n=x.origin&&"layer"in x.origin?x.origin.layer:x.layer;if("popupEnabled"in n&&!n.popupEnabled)throw new b("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:n});if(x.isAggregate){const y=
"featureReduction"in n?n.featureReduction:null;if(!(y&&"popupTemplate"in y&&y.popupEnabled&&y.popupTemplate))throw new b("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:n});}else if("popupTemplate"in n&&!m.getFetchPopupTemplate(n,u))throw new b("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:n});}}_popupFeatureHasRequiredFields(n,u){return d.featureHasFields(u,n)}async _fetchPopupFeatures(n,u){const x=Array(n.length),y=new Map,z=await this._createPopupQuery(n.map(B=>
B.origin?.layer??B.layer),u);for(let B=0;B<n.length;B++){const C=n[B];if(C.isAggregate){x[B]=C;continue}var A=C.origin?.layer??C.layer;if(!(A&&"popupEnabled"in A))continue;const D=d.unpackFieldNames(this.layer.fieldsIndex,z.outFields);A=m.getFetchPopupTemplate(A,u);if(null==A)continue;const F=await this._loadArcadeModules(A);p.throwIfAborted(u);F&&F.arcadeUtils.hasGeometryOperations(A)||!this._popupFeatureHasRequiredFields(C,D)?y.set(C.getObjectId(),{graphic:C,index:B}):x[B]=C}if("stream"===this.layer.type||
0===y.size)return x.filter(Boolean);z.objectIds=Array.from(y.keys());try{const B=await this.layer.queryFeatures(z,u);for(const C of B.features){const {graphic:{geometry:D,origin:F},index:H}=y.get(C.getObjectId());let N;(N=C).geometry||(N.geometry=D);C.origin=F;x[H]=C}}catch{}return x.filter(Boolean)}async _createPopupQuery(n,u){const x=this.layer.createQuery(),y=new Set;var z=!1;n=n??[this.layer];for(const A of n)if("popupEnabled"in A&&(n=m.getFetchPopupTemplate(A,u),null!=n)){z=await this._loadArcadeModules(n);
p.throwIfAborted(u);z=z&&z.arcadeUtils.hasGeometryOperations(n);z=!("point"!==this.layer.geometryType&&!z);n=await m.getRequiredFields(this.layer,n);p.throwIfAborted(u);for(const B of n)y.add(B)}x.returnGeometry=z;x.returnZ=z;x.returnM=z;x.outFields=Array.from(y);x.outSpatialReference=this.view.spatialReference;"floorInfo"in this.layer&&this.layer.floorInfo&&(u=t.getFloorFilterClause(this),null!=u&&(x.where=x.where?`(${x.where}) AND (${u})`:u));return x}canResume(){return!super.canResume()||null!=
this.timeExtent&&this.timeExtent.isEmpty?!1:!0}getTest(){}get test(){}};a.__decorate([h.property()],r.prototype,"_updatingRequiredFieldsPromise",void 0);a.__decorate([h.property({readOnly:!0})],r.prototype,"availableFields",null);a.__decorate([h.property({readOnly:!0})],r.prototype,"dataUpdating",void 0);a.__decorate([h.property({type:e})],r.prototype,"featureEffect",null);a.__decorate([h.property({type:g})],r.prototype,"filter",void 0);a.__decorate([h.property()],r.prototype,"layer",void 0);a.__decorate([h.property({type:Number})],
r.prototype,"maximumNumberOfFeatures",null);a.__decorate([h.property({readOnly:!0,type:Boolean})],r.prototype,"maximumNumberOfFeaturesExceeded",null);a.__decorate([h.property({readOnly:!0})],r.prototype,"requiredFields",void 0);a.__decorate([h.property()],r.prototype,"suspended",void 0);a.__decorate([h.property()],r.prototype,"view",void 0);return r=a.__decorate([c.subclass("esri.views.layers.FeatureLayerView")],r)}})},"esri/views/layers/RefreshableLayerView":function(){define("../../chunks/tslib.es6 ../../core/Logger ../../core/promiseUtils ../../core/reactiveUtils ../../core/has ../../core/RandomLCG ../../core/Error ../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){return c=>{c=class extends c{initialize(){this.addHandles(l.on(()=>this.layer,"refresh",e=>{this.doRefresh(e.dataChanged).catch(g=>{q.isAbortError(g)||b.getLogger(this).error(g)})}),"RefreshableLayerView")}};return c=a.__decorate([f.subclass("esri.views.layers.RefreshableLayerView")],c)}})},"esri/views/3d/layers/PointCloudLayerView3D":function(){define("../../../chunks/tslib.es6 ../../../core/arrayUtils ../../../core/asyncUtils ../../../core/Collection ../../../core/handleUtils ../../../core/has ../../../core/Logger ../../../core/maybe ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/screenUtils ../../../core/typedArrayUtil ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f32 ../../../geometry/support/aaBoundingBox ../../../geometry/support/plane ../../../layers/support/CodedValue ../../../layers/support/CodedValueDomain ../../../layers/support/Domain ../../../layers/support/InheritedDomain ../../../layers/support/RangeDomain ../../../layers/support/fieldUtils ../../../layers/support/PromiseQueue ../../../support/elevationInfoUtils ./LayerView3D ./PointCloudLayerViewPerformanceInfo ./PointCloudWorkerHandle ./i3s/I3SUtil ./i3s/LoDUtil ./i3s/PagedNodeIndex ./i3s/PointCloudRendererUtil ./i3s/PointCloudWorkerUtil ./i3s/PointGraphic ./i3s/PointRenderer ./support/PopupSceneLayerView ../support/extentUtils ../support/hitTest ../support/index ../support/orientedBoundingBox ../support/updatingProperties ../../layers/LayerView ../../support/layerViewUtils ../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y){function ha(U){return Z=>U.immediate.schedule(Z)}const ba=n.create();k=class extends K.PopupSceneLayerView(F.LayerView3D(V)){constructor(){super(...arguments);this.type="point-cloud-3d";this.maximumPointCount=4E6;this.slicePlaneEnabled=!1;this._renderer=null;this._rendererAdded=!1;this._renderedNodes=new Set;this._updateViewNeeded=!0;this._lodFactor=1;this._maxLoggedBoxWarnings=5;this._pageMultiplier=
1;this._nodeLoadEpoch=0;this._indexQueue=[];this._workQueue=[];this._idleQueue=new C.PromiseQueue;this._indexPagesLoading=new Map;this._loadingNodes=new Map;this._recalcWork=!0;this._layerIsVisible=!1;this._codedDomainPopulationAbortController=this._codedDomainPopulationPromise=null;this._totalWork=0;this._index=null;this._loadingInitNodePage=!1;this._nodeIdArray=[];this.ignoresMemoryFactor=!1}get baseUrl(){return this.layer.parsedUrl?.path??""}get pointScale(){const U=O.getSplatSizeAlgorithm(this.layer?.renderer);
return null!=U?.scaleFactor?U.scaleFactor:1}get useRealWorldSymbolSizes(){const U=O.getFixedSizeAlgorithm(this.layer?.renderer);return null!=U?.useRealWorldSymbolSizes?U.useRealWorldSymbolSizes:!1}get pointSize(){const U=O.getFixedSizeAlgorithm(this.layer?.renderer);return null!=U?.size?U.size:0}get inverseDensity(){return this.layer?.renderer?96/this.layer.renderer.pointsPerInch:5}get availableFields(){var U=O.getRendererInfo(this.layer);const Z=new Set;U.primaryAttribute&&Z.add(U.primaryAttribute.name);
U.modulationAttribute&&Z.add(U.modulationAttribute.name);if(U=O.getFilterInfo(this.layer))for(const ca of U)ca.attributeInfo&&Z.add(ca.attributeInfo.name);if(this.layer.outFields)for(const ca of B.unpackFieldNames(this.layer.fieldsIndex,this.layer.outFields))Z.add(ca);return Array.from(Z)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const U=r.create();return J.projectToBoundingBox(this.view.clippingArea,U,this.view.renderSpatialReference)?U:null}get _elevationOffset(){const U=
this.layer&&this.layer.elevationInfo;return U&&"absolute-height"===U.mode?D.getElevationOffset(U,this.layer.spatialReference):0}initialize(){const U=this.view.resourceController;var Z=ha(U);this._worker=new N.PointCloudWorkerHandle(Z);this.addResolvingPromise(this._worker.promise);E.checkPointCloudLayerValid(this.layer);E.checkPointCloudLayerCompatibleWithView(this.layer,this.view);this._indexRequester=U.createStreamDataRequester(Q.ClientType.I3S_INDEX);this._dataRequester=U.createStreamDataRequester(Q.ClientType.I3S_DATA);
this._initRenderer();Z=this._initNodePages();this._memCache=this.view.resourceController.memoryController.newCache(`pcl-${this.layer.uid}`);this._updatingHandles.add(()=>this._clippingBox,()=>this._setUpdateViewNeeded(),e.initial);this._updatingHandles.add(()=>this._elevationOffset,()=>this._elevationOffsetChanged(),e.initial);this._updatingHandles.add(()=>this.layer.renderer,()=>this._rendererChanged(),e.initial);this._updatingHandles.add(()=>this.layer.filters,()=>this._reload(),e.initial);this._updatingHandles.add(()=>
this.layer.outFields,()=>this._reload(),e.initial);this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this._setUpdateViewNeeded());this._updatingHandles.add(()=>this.view.state.contentCamera,()=>this._setUpdateViewNeeded());this.addHandles([e.watch(()=>this.view.quality,()=>this._setUpdateViewNeeded(),e.sync)]);this.addResolvingPromise(Z);this.when(()=>{this.addHandles([U.scheduler.registerTask(Y.TaskPriority.POINT_CLOUD_LAYER,this),U.scheduler.registerIdleStateCallbacks(()=>this._idleBegin(),
()=>this._idleEnd()),this._updatingHandles.add(()=>this.suspended,ca=>{ca?this._clearNodeState():this._setUpdateViewNeeded()},e.initial)])},()=>{this._updatingHandles.removeAll();this.removeAllHandles()})}_setUpdateViewNeeded(){this._updateViewNeeded=!0;this._updateLoading()}destroy(){this.cancelLoading();this._worker=f.destroyMaybe(this._worker);this._destroyRenderer();this._memCache=f.destroyMaybe(this._memCache);this._codedDomainPopulationAbortController=f.abortMaybe(this._codedDomainPopulationAbortController);
this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new M.PointRenderer({createGraphic:(U,Z,ca)=>this._createGraphic(U,Z,ca)});this._renderer.layerUid=this.layer.uid;this._updatingHandles.add(()=>this._clippingBox,U=>this._renderer.clippingBox=U,e.initial);this._updatingHandles.add(()=>this.suspended,U=>this._setPointsVisible(!U),e.initial);this._updatingHandles.add(()=>this.pointScale,U=>this._renderer.scaleFactor=U,e.initial);this._renderer.minSizePx=Math.sqrt(2);this._updatingHandles.add(()=>
this.useRealWorldSymbolSizes,U=>this._renderer.useRealWorldSymbolSizes=U,e.initial);this._updatingHandles.add(()=>this.pointSize,U=>{const Z=g.pt2px(U);this._renderer.size=U;this._renderer.sizePx=Z},e.initial);this._updatingHandles.add(()=>this.slicePlaneEnabled,U=>this._renderer.slicePlaneEnabled=U,e.initial);this._updatingHandles.add(()=>this.inverseDensity,()=>this._setUpdateViewNeeded(),e.initial);this._updatingHandles.add(()=>this.maximumPointCount,()=>this._setUpdateViewNeeded(),e.initial);
this._updatingHandles.add(()=>this.view.qualitySettings.sceneService.pointCloud.lodFactor,U=>{this._lodFactor=U;this._setUpdateViewNeeded()},e.initial)}_destroyRenderer(){this._renderer.removeAll();this._setPointsVisible(!1)}_createGraphic(U,Z,ca){const ea=null!=U.pointIdFilterMap?U.pointIdFilterMap[Z]:Z;ca=R.computeMapPointFromVec3d(this.view,ca);const da=this._createGraphicAttributes(U,ea);return new P.PointGraphic({pointCloudMetadata:{nodeId:U.id,pointIndexInNode:Z,attributePointIndexInNode:ea,
epoch:this._nodeLoadEpoch},geometry:ca,attributes:da,layer:this.layer,sourceLayer:this.layer})}_createGraphicAttributes(U,Z){const ca={};for(const ea of U.attributes)this._encodeGraphicAttribute(ea.attributeInfo,ea.values,Z,ca);return ca}_encodeGraphicAttribute(U,Z,ca,ea){var da=U.storageInfo?.attributeValues;const ia=da?.valuesPerElement??1;if(1===ia)ea[U.name]=Z[ca];else if("UInt8"===da?.valueType&&4>=ia){da=0;ca*=ia;for(let ka=ca;ka<ca+ia;ka++)da=(da<<8)+Z[ka];ea[U.name]=da}else ea[U.name]=void 0}_setPointsVisible(U){U&&
!this._rendererAdded?(this.view._stage.addRenderPlugin(this._renderer),this._rendererAdded=!0):!U&&this._rendererAdded&&(this.view._stage.removeRenderPlugin(this._renderer),this._rendererAdded=!1)}_rendererChanged(){this._renderer.useFixedSizes=O.rendererUsesFixedSizes(this.layer.renderer);this._reload()}_reload(){this._clearNodeState();this._memCache.clear();this._setUpdateViewNeeded()}_elevationOffsetChanged(){this._clearNodeState();this._memCache.clear();this._initNodePages()}_displayNodes(U){this._workQueue=
G.nodeDiff([...this._renderedNodes],U,this._index);G.sortFrontToBack(this._workQueue,this.view.state.contentCamera.viewForward,this._index);G.splitWorkEntries(this._workQueue,8,this._index);this._updateQueues();this._totalWork=this._computeWork();this._updateLoading();this._layerIsVisible=0<U.length||this._loadingInitNodePage;this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading();this._cancelIndexLoading()}_cancelNodeLoading(){const U=[];this._loadingNodes.forEach(({abortController:Z})=>
U.push(Z));this._loadingNodes.clear();for(const Z of U)Z.abort();this._workQueue=[];this._idleQueue.cancelAll();this._totalWork=this._computeWork();this._updateLoading()}_updateQueues(){const U=new Set;this._workQueue.forEach(ea=>ea.load.forEach(da=>U.add(da)));const Z=[],ca=new Map;this._loadingNodes.forEach((ea,da)=>{U.has(da)?ca.set(da,ea):Z.push(ea)});this._loadingNodes=ca;for(const {abortController:ea}of Z)ea.abort();this._workQueue=this._workQueue.filter(ea=>{for(const da of ea.load)if(this._loadingNodes.has(da))return this._recalcWork=
!0,!1;return!0});this._totalWork=this._computeWork();this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[];this._indexPagesLoading.forEach(({abortController:U})=>U.abort());this._indexPagesLoading.clear();this._totalWork=this._computeWork();this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++;this._renderedNodes.forEach(U=>this._removeFromRenderer(U));this._cancelNodeLoading()}_idleBegin(){this._setUpdateViewNeeded()}_idleEnd(){this._setUpdateViewNeeded()}get running(){return this.suspended?
this._updateViewNeeded:this._updateViewNeeded||0<this._indexQueue.length||0<this._workQueue.length||this._idleQueue.running}runTask(U){if(this.suspended)this._updateViewNeeded&&(this._updateViewNeeded=!1,U=this._isRootNodeVisible(),U!==this._layerIsVisible&&(this._layerIsVisible=U,this.notifyChange("suspended")),this._updateLoading());else{for(U.run(()=>this._updateWorkQueues());0<this._indexQueue.length&&U.run(()=>this._processIndexQueue()););this._processWorkQueue(U);this._idleQueue.runTask(U)}}_processIndexQueue(){const U=
this._indexQueue.shift(),Z=this._loadNodePage(U);this._indexPagesLoading.set(U,Z);Z.promise.then(ca=>{this._index.addPage(U,ca,this._elevationOffset);this._setUpdateViewNeeded()}).then(()=>{this._indexPagesLoading.delete(U)},()=>{this._indexPagesLoading.delete(U)});return!0}_processWorkQueue(U){for(;!U.done;){const Z=this._scheduleWorkEntry();if(null==Z){U.madeProgress();break}this._processWorkEntry(Z);U.madeProgress()}}_scheduleWorkEntry(){let U=this._workQueue.length;for(;U--;){const Z=this._workQueue.shift();
if(Z.remove.find(ca=>!this._renderedNodes.has(ca)))this._workQueue.push(Z);else return Z}return null}_processWorkEntry(U){if(0===U.load.length)for(const Z of U.remove)this._removeFromRenderer(Z);else Promise.all(U.load.map(Z=>{const ca=new AbortController,ea=this._memCache.pop(Z.toString());null!=ea?this._loadingNodes.set(Z,{abortController:ca,promise:Promise.resolve(ea)}):this._loadingNodes.has(Z)||this._loadingNodes.set(Z,{abortController:ca,promise:this._loadNode(Z,ca.signal)});return this._loadingNodes.get(Z).promise})).then(Z=>
{for(let ca=0;ca<U.load.length;ca++)if(Z[ca]){const ea=this._setupRendererData(U.load[ca],Z[ca]);this._addToRenderer(ea)}for(const ca of U.remove)this._removeFromRenderer(ca)}).catch(()=>{}).then(()=>{for(const Z of U.load)this._loadingNodes.delete(Z);this._updateLoading();this._recalcWork&&!this._idleQueue.running&&0===this._indexQueue.length&&0===this._loadingNodes.size&&(this._recalcWork=!1,this._setUpdateViewNeeded())}),this._updateLoading()}async _populateClassCodeCodedDomain(U,Z){const ca=this.layer.fieldsIndex.get("CLASS_CODE");
ca&&!ca.domain&&U.includes(ca.name)&&(U=await q.result(this.layer.queryCachedStatistics("CLASS_CODE",{signal:Z})),!1!==U.ok&&(U=U.value?.stats?.labels?.labels)&&Array.isArray(U)&&(ca.domain=new x({name:"CLASS_CODE",codedValues:U.map(ea=>new u.CodedValue({code:ea.value,name:ea.label}))})))}async prepareFetchPopupFeatures(U){this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this._populateClassCodeCodedDomain(U,this._codedDomainPopulationAbortController.signal).then(()=>
{this._codedDomainPopulationAbortController=null}));return this._codedDomainPopulationPromise}async whenGraphicAttributes(U,Z){const ca=this._splitGraphicsPerNode(U),ea=this.layer.attributeStorageInfo,da=Z.map(fa=>O.getAttributeInfo(ea,fa)).filter(b.isSome),ia=async(fa,X)=>{const ja=this._index.getNode(X);await q.forEach(da,async la=>{const na=la.useElevation?await this._loadElevationAttributeFromGeometry(ja.resourceId):await this._loadAndParseAttribute(ja,la);if(na)for(const va of fa)this._isValidPointGraphic(va)&&
this._encodeGraphicAttribute(la,na,va.pointCloudMetadata.attributePointIndexInNode,va.attributes)})},ka=[];ca.forEach((fa,X)=>{ka.push(ia(fa,X))});await Promise.allSettled(ka);return U}_isValidPointGraphic(U){return U instanceof P.PointGraphic&&U.pointCloudMetadata?.epoch===this._nodeLoadEpoch}_splitGraphicsPerNode(U){const Z=new Map;for(const ca of U){if(!this._isValidPointGraphic(ca))continue;U=ca.pointCloudMetadata;const ea=Z.get(U.nodeId);ea?ea.push(ca):Z.set(U.nodeId,[ca])}return Z}async _loadAndParseAttribute(U,
Z){const ca=await this._loadAttribute(U.resourceId,Z,null);return null!=ca?L.getAttributeValues({attributeInfo:Z,buffer:ca},null,U.vertexCount):null}async _loadElevationAttributeFromGeometry(U){U=L.readGeometry(this.layer.store.defaultGeometrySchema,await this._loadGeometry(U,null));return L.elevationFromPositions(U,U.length/3)}highlight(U){if(!U)return p.makeHandle();U=l.isCollection(U)?U.toArray():Array.isArray(U)?U:[U];return this._renderer.highlight(U.map(Z=>this._graphicToPointDefinition(Z)))}_graphicToPointDefinition(U){if(!this._isValidPointGraphic(U))return null;
const {nodeId:Z,pointIndexInNode:ca}=U.pointCloudMetadata;return null!=Z&&null!=ca?{nodeId:Z,pointId:ca}:null}_computeWork(){let U=0;for(const Z of this._workQueue)U+=Z.load.length+Z.remove.length;U+=this._loadingNodes.size;U+=(this._indexQueue.length+this._indexPagesLoading.size)*this._index.pageSize;U+=this._loadingInitNodePage?100:0;return U+=this._updateViewNeeded?100:0}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const U=this._computeWork();return 1-Math.min(this._totalWork,
U)/this._totalWork}_updateLoading(){this.notifyChange("updating");this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:0<this._computeWork()}get visibleAtCurrentScale(){return T.isInEffectiveScaleRange(this.layer.effectiveScaleRange,this.view.terrainScale)}_initNodePages(){const U=this.layer.store.index;this._index=new I.PagedNodeIndex(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,
U.nodesPerPage||U.nodePerIndexBlock);this._cancelIndexLoading();this._traverseVisible=this._index.createVisibilityTraverse();this._layerIsVisible=this._loadingInitNodePage=!0;this.notifyChange("suspended");this._updateLoading();this._pageMultiplier=null!=U.nodesPerPage?1:U.nodePerIndexBlock;return this._loadNodePage(0).promise.then(Z=>{this._index.addPage(0,Z,this._elevationOffset);this._loadingInitNodePage=!1;this._setUpdateViewNeeded()})}_loadNodePage(U){const Z=new AbortController;return{promise:this._requestNodePage(`${this.baseUrl}/nodepages/${U*
this._pageMultiplier}`,Z.signal).then(ca=>ca.nodes.map((ea,da)=>({resourceId:null!=ea.resourceId?ea.resourceId:U*this._index.pageSize+da,obb:W.Obb.fromJSON(ea.obb),obbInRenderSR:new W.Obb,firstChild:ea.firstChild,childCount:ea.childCount,vertexCount:ea.vertexCount??ea.pointCount,lodThreshold:ea.lodThreshold??ea.effectiveArea}))),abortController:Z}}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;var U=this.view.quality;let Z=this.inverseDensity/this._lodFactor*U;U*=this.maximumPointCount*this._lodFactor;
let ca=this._computeNodesForMinimumDensity(Z),ea=this._computePointCount(ca),da=Math.sqrt(ea/(.75*U));for(;ea>U;)Z*=da,ca=this._computeNodesForMinimumDensity(Z),ea=this._computePointCount(ca),da=Math.sqrt(2);this._displayNodes(ca);this._updateViewNeeded=!1;this._updateLoading();return!0}_computePointCount(U){let Z=0;for(let ca=0;ca<U.length;ca++){const ea=this._index.getNode(U[ca]);ea&&(Z+=ea.vertexCount)}return Z}_isRootNodeVisible(){let U=!1;this._traverseVisible({frustum:this.view.state.contentCamera.frustum,
clippingBox:this._clippingBox},{predicate:(Z,ca,ea)=>{U=ea;return!1},pageMiss:()=>{}});return U}_computeNodesForMinimumDensity(U){const Z=this.view.state.contentCamera,ca=Z.frustum,ea=this._clippingBox,da=Z.viewForward,ia=v.dot(da,Z.eye),ka=n.fromNormalAndOffset(da,-ia,ba),fa=Z.perScreenPixelRatio/2,X=U*U,ja=this._nodeIdArray;ja.length=0;this._traverseVisible({frustum:ca,clippingBox:ea},{predicate:(la,na,va)=>{if(!va)return!1;if(0===na.childCount)return ja.push(la),!1;va=this._index.getRenderObb(la);
return this._computeAveragePixelArea(va,na.lodThreshold,na.vertexCount,ka,fa)<=X?(ja.push(la),!1):!0},pageMiss:(la,na)=>{ja.push(la);this._indexQueue.includes(na)||this._indexQueue.push(na)}});return ja}_computeAveragePixelArea(U,Z,ca,ea,da){U=Math.max(1E-7,U.minimumDistancePlane(ea));return Z/(U*U)/(4*da*da)/ca}_loadNode(U,Z){try{return this._loadNodeAsync(U,Z)}catch(ca){throw c.isAbortError(ca)||h.getLogger(this).error(ca),ca;}}async _loadAdditionalUserAttributes(U,Z,ca){var ea=this.layer.outFields;
if(!ea)return[];ea=B.unpackFieldNames(this.layer.fieldsIndex,ea);U=new Set(U.map(ka=>null!=ka?ka.name:null));const da=this.layer.attributeStorageInfo,ia=[];for(const ka of ea)U.has(ka)||(ea=O.getAttributeInfo(da,ka))&&ia.push(Z(ea));Z=await c.allSettledValues(ia);c.throwIfAborted(ca);return Z.filter(b.isSome)}async _loadNodeAsync(U,Z){const ca=this._index.getNode(U),ea=O.getRendererInfo(this.layer),da=O.getFilterInfo(this.layer),ia=ca.resourceId,ka=async fa=>{if(!fa)return null;if(fa.useElevation)return{attributeInfo:fa,
buffer:null};const X=await this._loadAttribute(ia,fa,Z);return null!=X?{attributeInfo:fa,buffer:X}:null};return this._idleQueue.push(async()=>{var fa=this._loadGeometry(ia,Z);const {primaryAttribute:X,modulationAttribute:ja}=ea,la=ka(X),na=ka(ja);var va=da.map(Ga=>Ga.attributeInfo);const za=va.map(Ga=>ka(Ga));va=this._loadAdditionalUserAttributes([X,ja,...va],ka,Z);const [ya,Da,ra,xa,Ma]=await Promise.all([fa,la,na,Promise.all(za),va]);c.throwIfAborted(Z);fa={geometryBuffer:ya,primaryAttributeData:Da,
modulationAttributeData:ra,filterAttributesData:xa,userAttributesData:Ma,schema:this.layer.store.defaultGeometrySchema,rendererInfo:ea,filterInfo:da,obbData:this._index.getRenderObb(U).data,elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(fa,Z)},Z)}async _loadGeometry(U,Z){return this._requestData(`${this.baseUrl}/nodes/${U}/geometries/0`,Z)}async _loadAttribute(U,Z,ca){return Z?.storageInfo?
this._requestData(`${this.baseUrl}/nodes/${U}/attributes/${Z.storageInfo.key}`,ca):null}_requestNodePage(U,Z){return this._indexRequester.request(U,"json",{query:{f:"json",...this.layer.customParameters,token:this.layer.apiKey},signal:Z})}_requestData(U,Z){return this._dataRequester.request(U,"binary",{query:{...this.layer.customParameters,token:this.layer.apiKey},signal:Z})}_removeFromRenderer(U){if(this._renderedNodes.has(U)){const Z=this._renderer.removeNode(U);this._renderedNodes.delete(U);this._memCache.put(Z.id.toString(),
Z,5*Z.coordinates.length+128)}}_addToRenderer(U){this._renderedNodes.has(U.id)||(this._renderedNodes.add(U.id),this._renderer.addNode(U))}_setupRendererData(U,Z){const ca=this._index.getNode(U),ea=Math.sqrt(ca.lodThreshold/ca.vertexCount),da=this._index.getRenderObb(U);if(M.isPointRendererNode(Z))return Z.splatSize=ea,Z.obb=da,v.copy(Z.origin,Z.obb.center),Z;const ia=W.Obb.fromData(Z.obbData),ka=ia.halfSize,fa=da.halfSize,X=.01*Math.max(fa[0],fa[1],fa[2]);if(ka[0]>fa[0]+X||ka[1]>fa[1]+X||ka[2]>fa[2]+
X)0<this._maxLoggedBoxWarnings&&(h.getLogger(this).warn(`Node ${U} reported bounding box too small. got ${`[${da.halfSize[0]}, ${da.halfSize[1]}, ${da.halfSize[2]}]`} but points cover ${`[${ia.halfSize[0]}, ${ia.halfSize[1]}, ${ia.halfSize[2]}]`}`),0===--this._maxLoggedBoxWarnings&&h.getLogger(this).warn(" Too many bounding box errors, stopping reporting for this layer.")),this._index.setRenderObb(U,ia);return new M.PointRendererNode(U,ea,m.clone(da.center),da,0===ca.childCount,Z.points,Z.rgb,Z.attributes,
Z.pointIdFilterMap)}get usedMemory(){let U=0;this._renderer.forEachNode(Z=>{U+=160;U+=d.estimateSize(Z.coordinates);for(const ca of Z.attributes)Z=ca.values,d.isArrayBuffer(Z.buffer)&&(U+=d.estimateSize(Z))});return U}get unloadedMemory(){const U=this._renderedNodes.size;if(4>U)return 0;const Z=[...this._renderedNodes].reduce((ea,da)=>ea+this._index.getNode(da).vertexCount);let ca=this._loadingNodes.size;for(let ea=0;ea<this._workQueue.length;ea++)ca+=this._workQueue[ea].load.length,ca-=this._workQueue[ea].remove.length;
return 0>ca?0:ca*Z/U*((this.usedMemory-160*U)/Z)+160*ca}get performanceInfo(){return new H.PointCloudLayerViewPerformanceInfo(this.usedMemory,this._renderedNodes.size,[...this._renderedNodes].reduce((U,Z)=>U+this._index.getNode(Z).vertexCount,0),this.maximumPointCount,new H.QueuePerformanceInfo(this._loadingNodes.size,this._indexQueue.length,this._workQueue.length,this._idleQueue.length))}get test(){}};a.__decorate([t.property()],k.prototype,"layer",void 0);a.__decorate([t.property()],k.prototype,
"baseUrl",null);a.__decorate([t.property()],k.prototype,"pointScale",null);a.__decorate([t.property()],k.prototype,"useRealWorldSymbolSizes",null);a.__decorate([t.property()],k.prototype,"pointSize",null);a.__decorate([t.property()],k.prototype,"inverseDensity",null);a.__decorate([t.property()],k.prototype,"maximumPointCount",void 0);a.__decorate([t.property({readOnly:!0})],k.prototype,"availableFields",null);a.__decorate([t.property({readOnly:!0})],k.prototype,"_clippingBox",null);a.__decorate([t.property({readOnly:!0})],
k.prototype,"_elevationOffset",null);a.__decorate([t.property({type:Boolean})],k.prototype,"slicePlaneEnabled",void 0);a.__decorate([t.property()],k.prototype,"updating",void 0);a.__decorate([t.property(S.updatingProgress)],k.prototype,"updatingProgress",void 0);a.__decorate([t.property({readOnly:!0})],k.prototype,"updatingProgressValue",null);a.__decorate([t.property({readOnly:!0})],k.prototype,"visibleAtCurrentScale",null);return k=a.__decorate([w.subclass("esri.views.3d.layers.PointCloudLayerView3D")],
k)})},"esri/views/3d/layers/PointCloudLayerViewPerformanceInfo":function(){define(["exports","./support/LayerViewPerformanceInfo"],function(a,b){class q extends b.LayerViewPerformanceInfo{constructor(p,k,h,f,c){super(p,k,-1,h,f);this.queue=c}}class l{constructor(p,k,h,f){this.loading=p;this.indexLoading=k;this.processing=h;this.idleProcessing=f}}a.PointCloudLayerViewPerformanceInfo=q;a.QueuePerformanceInfo=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/PointCloudWorkerHandle":function(){define(["exports",
"../../../core/workers/WorkerHandle"],function(a,b){class q extends b.WorkerHandle{constructor(l){super("PointCloudWorker","transform",{transform:p=>{const k=[p.geometryBuffer];null!=p.primaryAttributeData&&p.primaryAttributeData.buffer&&k.push(p.primaryAttributeData.buffer);null!=p.modulationAttributeData&&p.modulationAttributeData.buffer&&k.push(p.modulationAttributeData.buffer);if(null!=p.filterAttributesData)for(const h of p.filterAttributesData)null!=h&&h.buffer&&k.push(h.buffer);for(const h of p.userAttributesData)h.buffer&&
k.push(h.buffer);return k}},l)}}a.PointCloudWorkerHandle=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/LoDUtil":function(){define(["exports","../../../../chunks/vec32"],function(a,b){function q(c,e,g){for(;0<c;){const d=e.indexOf(c);if(0<=d)return d;c=g.getParentId(c)}return e.indexOf(c)}function l(c,e,g){const d=[e.remove[0]],t=[];for(;1===d.length;){const v=d.pop();t.length=0;for(let m=0;m<e.load.length;m++){let r=e.load[m];for(var w=g.getParentId(r);w!==
v;)r=w,w=g.getParentId(r);w=d.indexOf(r);0>w&&(w=d.length,d.push(r),t.push([]));t[w].push(e.load[m])}}e.load=d;for(e=0;e<d.length;e++)1<t[e].length?c.push({remove:[d[e]],load:t[e]}):d[e]=t[e][0]}const p=[!1],k=[null],h=[!1],f=[null];a.nodeDiff=function(c,e,g){for(var d=0;d<e.length;d++)h[d]=!1,f[d]=null;for(d=0;d<c.length;d++)p[d]=!1,k[d]=null;for(d=0;d<e.length;d++){var t=q(e[d],c,g);0<=t&&(h[d]=!0,null!=k[t]?k[t].push(e[d]):k[t]=[e[d]])}for(d=0;d<c.length;d++)t=q(c[d],e,g),0<=t&&(p[d]=!0,null!=
f[t]?f[t].push(c[d]):f[t]=[c[d]]);g=[];for(d=0;d<c.length;d++)null!=k[d]||p[d]||g.push({load:[],remove:[c[d]]});for(d=0;d<e.length;d++)null!=f[d]||h[d]||g.push({load:[e[d]],remove:[]});for(d=0;d<e.length;d++)null!=f[d]&&(1<f[d].length||f[d][0]!==e[d])&&g.push({load:[e[d]],remove:f[d]});for(e=0;e<c.length;e++)null!=k[e]&&(1<k[e].length||k[e][0]!==c[e])&&g.push({load:k[e],remove:[c[e]]});return g};a.sortFrontToBack=function(c,e,g){return c.sort((d,t)=>{if(0===d.load.length&&0===t.load.length)return 0;
if(0===d.load.length)return-1;if(0===t.load.length)return 1;if(0===d.remove.length&&0===t.remove.length)return d=g.getRenderObb(d.load[0]).center,t=g.getRenderObb(t.load[0]).center,b.dot(d,e)-b.dot(t,e);if(0===d.remove.length)return-1;if(0===t.remove.length)return 1;if(1===d.load.length&&1===t.load.length)return d=g.getRenderObb(d.load[0]).center,t=g.getRenderObb(t.load[0]).center,b.dot(d,e)-b.dot(t,e);if(1===d.load.length)return-1;if(1===t.load.length)return 1;d=g.getRenderObb(d.remove[0]).center;
t=g.getRenderObb(t.remove[0]).center;return b.dot(d,e)-b.dot(t,e)})};a.splitWorkEntries=function(c,e,g){for(let d=0;d<c.length;++d){const t=c[d];t.load.length>e&&1===t.remove.length&&l(c,t,g)}};a.splitWorkEntry=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/PagedNodeIndex":function(){define(["exports","../../../../geometry/spatialReferenceEllipsoidUtils","../../../../geometry/support/aaBoundingBox"],function(a,b,q){class l{constructor(p,k,h){this._pages=
[];this.pageSize=0;this._nodeSR=p;this._renderSR=k;this._renderSRSphericalPCPF=b.getSphericalPCPF(k);this.pageSize=h}addPage(p,k,h=0){for(;this._pages.length<p;)this._pages.push(null);var f=this._nodeSR,c=this._renderSR,e=this._renderSRSphericalPCPF;for(var g=0;g<k.length;g++){const d=k[g];d.obb.transform(d.obbInRenderSR,f,c,h,e)}this._pages[p]={nodes:k,parents:new Uint32Array(this.pageSize)};p=this._pages;k=this.pageSize;for(h=[0];h.length;)for(f=h.pop(),c=p[f/k|0].nodes[f%k],e=0;e<c.childCount;e++)g=
c.firstChild+e,null!=p[g/k|0]&&(p[g/k|0].parents[g%k]=f,h.push(g))}hasPage(p){return!!this._pages[p]}getNode(p){const k=this.pageSize;return this._pages[p/k|0].nodes[p%k]}getRenderObb(p){const k=this.pageSize;return this._pages[p/k|0].nodes[p%k].obbInRenderSR}setRenderObb(p,k){const h=this.pageSize;this._pages[p/h|0].nodes[p%h].obbInRenderSR.copy(k)}getParentId(p){const k=this.pageSize;return this._pages[p/k|0].parents[p%k]}hasNodes(p,k){var h=p/this.pageSize|0;for(p=(p+k-1)/this.pageSize|0;h<=p;h++)if(null==
this._pages[h])return!1;return!0}forEachNodeId(p){for(let k=0;k<this._pages.length;k++){const h=this._pages[k];if(h)for(let f=0;f<h.nodes.length;f++)p(k*this.pageSize+f)}}createVisibilityTraverse(){var p=this,k=[],h=[],f=q.create();return(c,e)=>{if(p.hasNodes(0,1))for(k.length=0,k.push(0),h.length=0,h.push(0);0<k.length;){var g=k.pop();let r=h.pop();var d=p.getNode(g),t=p.getRenderObb(g),w=!0;if(null!=c.clippingBox){var v=1<<c.frustum.length;0===(r&v)&&(t.toAaBoundingBox(f),q.contains(c.clippingBox,
f)?r|=v:q.intersects(c.clippingBox,f)||(w=!1))}for(v=0;v<c.frustum.length&&w;v++){var m=1<<v;if(0===(r&m)){const n=t.intersectPlane(c.frustum[v]);0<n?w=!1:0>n&&(r|=m)}}if(e.predicate(g,d,w)){t=d.firstChild;d=d.childCount;w=!1;m=t/p.pageSize|0;for(v=(t+d-1)/p.pageSize|0;m<=v;m++)if(!p.hasPage(m)){e.pageMiss(g,m);w=!0;break}if(!w)for(g=0;g<d;g++)k.push(t+g),h.push(r)}}}}}a.PagedNodeIndex=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/PointCloudRendererUtil":function(){define(["exports"],
function(a){function b(l,p){for(const k of l??[])if(k.name===p&&null!=k.attributeValues&&"UInt8"===k.attributeValues.valueType&&3===k.attributeValues.valuesPerElement)return{name:p,storageInfo:k,useElevation:!1};return null}function q(l,p){for(const k of l??[])if(k.name===p)return(l="embedded-elevation"===k.encoding)?{name:p,storageInfo:null,useElevation:l}:{name:p,storageInfo:k,useElevation:l};return"elevation"===p?.toLowerCase()?{name:p,storageInfo:null,useElevation:!0}:null}a.getAttributeInfo=
q;a.getFilterInfo=function(l){const p=l.filters;return p?p.map(k=>({filterJSON:k.toJSON(),attributeInfo:q(l.attributeStorageInfo,k.field)})):[]};a.getFixedSizeAlgorithm=function(l){return(l=l?.pointSizeAlgorithm)&&"fixed-size"===l.type?l:null};a.getRendererInfo=function(l){const p=l.renderer;var k=p?.type;const h=p?.toJSON()??null;let f=null,c=!1;l=l.attributeStorageInfo;"point-cloud-unique-value"===k?f=q(l,p.field):"point-cloud-stretch"===k?f=q(l,p.field):"point-cloud-class-breaks"===k?f=q(l,p.field):
(f="point-cloud-rgb"===k?b(l,p.field):b(l,"RGB"),c=null!=f);k=null;p?.colorModulation&&(k=q(l,p.colorModulation.field));return{rendererJSON:h,isRGBRenderer:c,primaryAttribute:f,modulationAttribute:k}};a.getSplatSizeAlgorithm=function(l){return(l=l?.pointSizeAlgorithm)&&"splat"===l.type?l:null};a.rendererUsesFixedSizes=function(l){l=l?.pointSizeAlgorithm;return l?.type?"fixed-size"===l.type:!1};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/PointCloudWorkerUtil":function(){define("exports ../../../../core/has ../../../../renderers/PointCloudClassBreaksRenderer ../../../../renderers/PointCloudStretchRenderer ../../../../renderers/PointCloudUniqueValueRenderer ./I3SBinaryReader ./LEPCC".split(" "),
function(a,b,q,l,p,k,h){function f(g,d){const t=new Float64Array(d);for(let w=0;w<d;w++)t[w]=g[3*w+2];return t}function c(g){switch(g){default:case null:case "none":return d=>d;case "low-four-bit":return d=>d&15;case "high-four-bit":return d=>(d&240)>>4;case "absolute-value":return d=>Math.abs(d);case "modulo-ten":return d=>d%10}}function e(g){let d=0;for(const t of g||[])d|=1<<t;return d}a.elevationFromPositions=f;a.evaluateRenderer=function(g,d,t,w){const {rendererJSON:v,isRGBRenderer:m}=g;var r=
g=null;if(d&&m)g=d;else if(d&&"pointCloudUniqueValueRenderer"===v?.type){r=p.fromJSON(v);var n=r.colorUniqueValueInfos;g=new Uint8Array(3*w);var u=c(r.fieldTransformType);for(var x=0;x<w;x++){var y=(u?u(d[x]):d[x])+"";for(var z=0;z<n.length;z++)if(n[z].values.includes(y)){g[3*x]=n[z].color.r;g[3*x+1]=n[z].color.g;g[3*x+2]=n[z].color.b;break}}}else if(d&&"pointCloudStretchRenderer"===v?.type)for(r=l.fromJSON(v),n=r.stops,g=new Uint8Array(3*w),u=c(r.fieldTransformType),x=0;x<w;x++)if(y=u?u(d[x]):d[x],
z=n.length-1,y<n[0].value)g[3*x]=n[0].color.r,g[3*x+1]=n[0].color.g,g[3*x+2]=n[0].color.b;else if(y>=n[z].value)g[3*x]=n[z].color.r,g[3*x+1]=n[z].color.g,g[3*x+2]=n[z].color.b;else for(z=1;z<n.length;z++){if(y<n[z].value){y=(y-n[z-1].value)/(n[z].value-n[z-1].value);g[3*x]=n[z].color.r*y+n[z-1].color.r*(1-y);g[3*x+1]=n[z].color.g*y+n[z-1].color.g*(1-y);g[3*x+2]=n[z].color.b*y+n[z-1].color.b*(1-y);break}}else if(d&&"pointCloudClassBreaksRenderer"===v?.type)for(r=q.fromJSON(v),n=r.colorClassBreakInfos,
g=new Uint8Array(3*w),u=c(r.fieldTransformType),x=0;x<w;x++)for(y=u?u(d[x]):d[x],z=0;z<n.length;z++){if(y>=n[z].minValue&&y<=n[z].maxValue){g[3*x]=n[z].color.r;g[3*x+1]=n[z].color.g;g[3*x+2]=n[z].color.b;break}}else g=(new Uint8Array(3*w)).fill(255);if(t&&r?.colorModulation)for(d=r.colorModulation.minValue,r=r.colorModulation.maxValue,n=0;n<w;n++)u=t[n],u=u>=r?1:u<=d?.3:.3+.7*(u-d)/(r-d),g[3*n]*=u,g[3*n+1]*=u,g[3*n+2]*=u;return g};a.filterInPlace=function(g,d,t,w,v){const m=g.length/3;let r=0;for(let A=
0;A<m;A++){let B=!0;for(let C=0;C<w.length&&B;C++){var {filterJSON:n}=w[C],u=v[C].values[A];switch(n.type){case "pointCloudValueFilter":var x="exclude"===n.mode;n.values.includes(u)===x&&(B=!1);break;case "pointCloudBitfieldFilter":x=e(n.requiredSetBits);n=e(n.requiredClearBits);if((u&x)!==x||0!==(u&n))B=!1;break;case "pointCloudReturnFilter":var y=u&15,z=u>>>4&15;u=1<z;x=1===y;y=y===z;z=!1;for(const D of n.includedReturns)if("last"===D&&y||"firstOfMany"===D&&x&&u||"lastOfMany"===D&&y&&u||"single"===
D&&!u){z=!0;break}z||(B=!1)}}B&&(t[r]=A,g[3*r]=g[3*A],g[3*r+1]=g[3*A+1],g[3*r+2]=g[3*A+2],d[3*r]=d[3*A],d[3*r+1]=d[3*A+1],d[3*r+2]=d[3*A+2],r++)}return r};a.getAttributeValues=function(g,d,t){return g?.attributeInfo.useElevation?d?f(d,t):null:g?.attributeInfo.storageInfo?k.readBinaryAttribute(g.attributeInfo.storageInfo,g.buffer,t):null};a.readGeometry=function(g,d){if(null==g.encoding||""===g.encoding){g=k.createGeometryIndexFromSchema(d,g);if(null==g.vertexAttributes.position)return;d=k.createTypedView(d,
g.vertexAttributes.position);var t=g.header.fields;g=[t.offsetX,t.offsetY,t.offsetZ];t=[t.scaleX,t.scaleY,t.scaleZ];const w=d.length/3,v=new Float64Array(3*w);for(let m=0;m<w;m++)v[3*m]=d[3*m]*t[0]+g[0],v[3*m+1]=d[3*m+1]*t[1]+g[1],v[3*m+2]=d[3*m+2]*t[2]+g[2];return v}if("lepcc-xyz"===g.encoding)return h.decodeXYZ(d).result};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/renderers/PointCloudClassBreaksRenderer":function(){define("../chunks/tslib.es6 ../core/lang ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/accessorSupport/decorators/enumeration ../core/accessorSupport/decorators/subclass ./PointCloudRenderer ./support/LegendOptions ./support/pointCloud/ColorClassBreakInfo".split(" "),
function(a,b,q,l,p,k,h,f,c,e){var g;l=g=class extends f{constructor(d){super(d);this.type="point-cloud-class-breaks";this.colorClassBreakInfos=this.fieldTransformType=this.legendOptions=this.field=null}clone(){return new g({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:b.clone(this.colorClassBreakInfos),legendOptions:b.clone(this.legendOptions)})}};a.__decorate([k.enumeration({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],
l.prototype,"type",void 0);a.__decorate([q.property({json:{write:!0},type:String})],l.prototype,"field",void 0);a.__decorate([q.property({type:c.LegendOptions,json:{write:!0}})],l.prototype,"legendOptions",void 0);a.__decorate([q.property({type:f.fieldTransformTypeKebabDict.apiValues,json:{type:f.fieldTransformTypeKebabDict.jsonValues,read:f.fieldTransformTypeKebabDict.read,write:f.fieldTransformTypeKebabDict.write}})],l.prototype,"fieldTransformType",void 0);a.__decorate([q.property({type:[e],json:{write:!0}})],
l.prototype,"colorClassBreakInfos",void 0);return l=g=a.__decorate([h.subclass("esri.renderers.PointCloudClassBreaksRenderer")],l)})},"esri/renderers/PointCloudRenderer":function(){define("../chunks/tslib.es6 ../core/jsonMap ../core/JSONSupport ../core/lang ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/accessorSupport/decorators/subclass ./support/pointCloud/ColorModulation ./support/pointCloud/pointSizeAlgorithmTypeUtils".split(" "),function(a,b,q,l,p,k,h,f,c,e){k=
b.strict()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});q=class extends q.JSONSupport{constructor(g){super(g);this.type=void 0;this.colorModulation=this.pointSizeAlgorithm=null;this.pointsPerInch=10}clone(){console.warn(".clone() is not implemented for "+this.declaredClass);return null}cloneProperties(){return{pointSizeAlgorithm:l.clone(this.pointSizeAlgorithm),
colorModulation:l.clone(this.colorModulation),pointsPerInch:l.clone(this.pointsPerInch)}}};a.__decorate([p.property({type:k.apiValues,readOnly:!0,nonNullable:!0,json:{type:k.jsonValues,read:!1,write:k.write}})],q.prototype,"type",void 0);a.__decorate([p.property({types:e.pointSizeAlgorithmTypes,json:{write:!0}})],q.prototype,"pointSizeAlgorithm",void 0);a.__decorate([p.property({type:c,json:{write:!0}})],q.prototype,"colorModulation",void 0);a.__decorate([p.property({json:{write:!0},nonNullable:!0,
type:Number})],q.prototype,"pointsPerInch",void 0);q=a.__decorate([f.subclass("esri.renderers.PointCloudRenderer")],q);(q||={}).fieldTransformTypeKebabDict=new b.JSONMap({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"});return q})},"esri/renderers/support/pointCloud/ColorModulation":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h){var f;b=f=class extends b.JSONSupport{constructor(){super(...arguments);this.field=null;this.minValue=0;this.maxValue=255}clone(){return new f({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};a.__decorate([q.property({type:String,json:{write:!0}})],b.prototype,"field",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,json:{write:!0}})],b.prototype,"minValue",void 0);a.__decorate([q.property({type:Number,nonNullable:!0,json:{write:!0}})],b.prototype,
"maxValue",void 0);return b=f=a.__decorate([h.subclass("esri.renderers.support.pointCloud.ColorModulation")],b)})},"esri/renderers/support/pointCloud/pointSizeAlgorithmTypeUtils":function(){define(["exports","./PointSizeAlgorithm","./PointSizeFixedSizeAlgorithm","./PointSizeSplatAlgorithm"],function(a,b,q,l){a.pointSizeAlgorithmTypes={key:"type",base:b,typeMap:{"fixed-size":q,splat:l}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/renderers/support/pointCloud/PointSizeAlgorithm":function(){define("../../../chunks/tslib.es6 ../../../core/jsonMap ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){b=new b.JSONMap({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});q=class extends q.JSONSupport{};a.__decorate([l.property({type:b.apiValues,readOnly:!0,nonNullable:!0,json:{type:b.jsonValues,read:!1,write:b.write}})],q.prototype,"type",void 0);return q=a.__decorate([f.subclass("esri.renderers.support.pointCloud.PointSizeAlgorithm")],q)})},"esri/renderers/support/pointCloud/PointSizeFixedSizeAlgorithm":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass ./PointSizeAlgorithm".split(" "),
function(a,b,q,l,p,k,h,f){var c;q=c=class extends f{constructor(){super(...arguments);this.type="fixed-size";this.size=0;this.useRealWorldSymbolSizes=null}clone(){return new c({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};a.__decorate([k.enumeration({pointCloudFixedSizeAlgorithm:"fixed-size"})],q.prototype,"type",void 0);a.__decorate([b.property({type:Number,nonNullable:!0,json:{write:!0}})],q.prototype,"size",void 0);a.__decorate([b.property({type:Boolean,json:{write:!0}})],
q.prototype,"useRealWorldSymbolSizes",void 0);return q=c=a.__decorate([h.subclass("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],q)})},"esri/renderers/support/pointCloud/PointSizeSplatAlgorithm":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass ./PointSizeAlgorithm".split(" "),
function(a,b,q,l,p,k,h,f){var c;q=c=class extends f{constructor(){super(...arguments);this.type="splat";this.scaleFactor=1}clone(){return new c({scaleFactor:this.scaleFactor})}};a.__decorate([k.enumeration({pointCloudSplatAlgorithm:"splat"})],q.prototype,"type",void 0);a.__decorate([b.property({type:Number,value:1,nonNullable:!0,json:{write:!0}})],q.prototype,"scaleFactor",void 0);return q=c=a.__decorate([h.subclass("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],q)})},"esri/renderers/support/pointCloud/ColorClassBreakInfo":function(){define("../../../chunks/tslib.es6 ../../../Color ../../../core/JSONSupport ../../../core/lang ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/ensureType ../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h){var f;q=f=class extends q.JSONSupport{constructor(){super(...arguments);this.label=this.description=null;this.maxValue=this.minValue=0;this.color=null}clone(){return new f({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:l.clone(this.color)})}};a.__decorate([p.property({type:String,json:{write:!0}})],q.prototype,"description",void 0);a.__decorate([p.property({type:String,json:{write:!0}})],q.prototype,"label",void 0);a.__decorate([p.property({type:Number,
json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],q.prototype,"minValue",void 0);a.__decorate([p.property({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],q.prototype,"maxValue",void 0);a.__decorate([p.property({type:b,json:{type:[k.Integer],write:!0}})],q.prototype,"color",void 0);return q=f=a.__decorate([h.subclass("esri.renderers.support.pointCloud.ColorClassBreakInfo")],q)})},"esri/renderers/PointCloudStretchRenderer":function(){define("../chunks/tslib.es6 ../core/lang ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/accessorSupport/decorators/enumeration ../core/accessorSupport/decorators/subclass ./PointCloudRenderer ./support/LegendOptions ./visualVariables/support/ColorStop".split(" "),
function(a,b,q,l,p,k,h,f,c,e){var g;l=g=class extends f{constructor(d){super(d);this.type="point-cloud-stretch";this.stops=this.fieldTransformType=this.legendOptions=this.field=null}clone(){return new g({...this.cloneProperties(),field:b.clone(this.field),fieldTransformType:b.clone(this.fieldTransformType),stops:b.clone(this.stops),legendOptions:b.clone(this.legendOptions)})}};a.__decorate([k.enumeration({pointCloudStretchRenderer:"point-cloud-stretch"})],l.prototype,"type",void 0);a.__decorate([q.property({json:{write:!0},
type:String})],l.prototype,"field",void 0);a.__decorate([q.property({type:c.LegendOptions,json:{write:!0}})],l.prototype,"legendOptions",void 0);a.__decorate([q.property({type:f.fieldTransformTypeKebabDict.apiValues,json:{type:f.fieldTransformTypeKebabDict.jsonValues,read:f.fieldTransformTypeKebabDict.read,write:f.fieldTransformTypeKebabDict.write}})],l.prototype,"fieldTransformType",void 0);a.__decorate([q.property({type:[e],json:{write:!0}})],l.prototype,"stops",void 0);return l=g=a.__decorate([h.subclass("esri.renderers.PointCloudStretchRenderer")],
l)})},"esri/renderers/PointCloudUniqueValueRenderer":function(){define("../chunks/tslib.es6 ../core/lang ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/accessorSupport/decorators/enumeration ../core/accessorSupport/decorators/subclass ./PointCloudRenderer ./support/LegendOptions ./support/pointCloud/ColorUniqueValueInfo".split(" "),function(a,b,q,l,p,k,h,f,c,e){var g;l=g=class extends f{constructor(d){super(d);this.type="point-cloud-unique-value";this.legendOptions=
this.colorUniqueValueInfos=this.fieldTransformType=this.field=null}clone(){return new g({...this.cloneProperties(),field:b.clone(this.field),fieldTransformType:b.clone(this.fieldTransformType),colorUniqueValueInfos:b.clone(this.colorUniqueValueInfos),legendOptions:b.clone(this.legendOptions)})}};a.__decorate([k.enumeration({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],l.prototype,"type",void 0);a.__decorate([q.property({json:{write:!0},type:String})],l.prototype,"field",void 0);a.__decorate([q.property({type:f.fieldTransformTypeKebabDict.apiValues,
json:{type:f.fieldTransformTypeKebabDict.jsonValues,read:f.fieldTransformTypeKebabDict.read,write:f.fieldTransformTypeKebabDict.write}})],l.prototype,"fieldTransformType",void 0);a.__decorate([q.property({type:[e],json:{write:!0}})],l.prototype,"colorUniqueValueInfos",void 0);a.__decorate([q.property({type:c.LegendOptions,json:{write:!0}})],l.prototype,"legendOptions",void 0);return l=g=a.__decorate([h.subclass("esri.renderers.PointCloudUniqueValueRenderer")],l)})},"esri/renderers/support/pointCloud/ColorUniqueValueInfo":function(){define("../../../chunks/tslib.es6 ../../../Color ../../../core/JSONSupport ../../../core/lang ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/ensureType ../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h){var f;q=f=class extends q.JSONSupport{constructor(){super(...arguments);this.color=this.values=this.label=this.description=null}clone(){return new f({description:this.description,label:this.label,values:l.clone(this.values),color:l.clone(this.color)})}};a.__decorate([p.property({type:String,json:{write:!0}})],q.prototype,"description",void 0);a.__decorate([p.property({type:String,json:{write:!0}})],q.prototype,"label",void 0);a.__decorate([p.property({type:[String],json:{write:!0}})],
q.prototype,"values",void 0);a.__decorate([p.property({type:b,json:{type:[k.Integer],write:!0}})],q.prototype,"color",void 0);return q=f=a.__decorate([h.subclass("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],q)})},"esri/views/3d/layers/i3s/PointGraphic":function(){define("exports ../../../../chunks/tslib.es6 ../../../../Graphic ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass".split(" "),
function(a,b,q,l,p,k,h,f){a.PointGraphic=class extends q{constructor(c){super(c);this.pointCloudMetadata=null}};b.__decorate([l.property({constructOnly:!0,clonable:"reference"})],a.PointGraphic.prototype,"pointCloudMetadata",void 0);a.PointGraphic=b.__decorate([f.subclass("esri.views.3d.layers.i3s.PointGraphic")],a.PointGraphic);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/PointRenderer":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/maybe ../../../../core/PooledArray ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/vec42 ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/plane ../../../../geometry/support/ray ./Intersector ./PointHighlights ../../webgl-engine/core/shaderLibrary/ShaderOutput ../../webgl-engine/effects/RenderPlugin ../../webgl-engine/lib/DefaultVertexAttributeLocations ../../webgl-engine/lib/Intersector ../../webgl-engine/lib/IntersectorInterfaces ../../webgl-engine/lib/RenderSlot ../../webgl-engine/lib/VertexArrayObject ../../webgl-engine/lib/VertexAttribute ../../../../chunks/PointRenderer.glsl ../../webgl-engine/shaders/PointRendererTechnique ../../webgl-engine/shaders/PointRendererTechniqueConfiguration ../../../webgl/BufferObject ../../../webgl/enums ../../../webgl/VertexElementDescriptor".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G){function I(Q,W,S,V,T){if(S.drawScreenSpace)return S.fixedSize*W*V;T=D.getMaxPointSizeScreenspace(T)*W*V;return S.useFixedSizes?Math.min(S.fixedSize/2,T):0<S.screenMinSize?Math.min(Math.max(S.screenMinSize*W*V,Q/2),T):Math.min(Q/2,T)}function O(Q,W,S,V,T){return S.drawScreenSpace?0:I(Q,W,S,V,T)}function L(Q){return null!=Q.component?Q.component:-1}function P(Q,W){if(null==Q)return Q;Q=Q.filter(S=>S.id!==W);return 0===Q.length?
null:Q}function M(Q){return null!=Q.dist&&null!=Q.point&&null!=Q.pointId&&null!=Q.node}const K={positions:[new G.VertexElementDescriptor(C.VertexAttribute.POSITION,3,E.DataType.FLOAT,0,12)],colors:[new G.VertexElementDescriptor(C.VertexAttribute.COLOR,3,E.DataType.UNSIGNED_BYTE,0,3,!0)]};a.PointRenderer=class extends u.SyncPrepareRenderPlugin{constructor(Q){super(Q);this.type=z.IntersectorType.PCL;this.isGround=!1;this._passParameters=new D.PointRendererPassParameters;this._highlights=new r.PointHighlights({forEachNode:W=>
this.forEachNode(W),addHighlight:(W,S,V)=>this._addHighlight(W,S,V),removeHighlight:(W,S)=>this._removeHighlight(W,S)});this.produces=new Map([[A.RenderSlot.OPAQUE_MATERIAL,W=>!n.isDepth(W)&&(W!==n.ShaderOutput.Highlight||!this._highlights.empty)],[A.RenderSlot.OPAQUE_NO_SSAO_DEPTH,W=>n.isDepth(W)]]);this.layerUid="";this._slicePlaneEnabled=!1;this._techniqueConfig=new H.PointRendererTechniqueConfiguration;this._nodes=new l}initializeRenderContext(Q){this._context=Q;Q.requestRender()}uninitializeRenderContext(){}intersect(Q,
W,S,V){const T=g.create(),Y=g.create(),ha=g.create(),ba=g.create(),U=w.create(),Z=Q.camera.perScreenPixelRatio/2,ca=Q.camera.near;e.subtract(Y,V,S);const ea=1/e.length(Y);e.scale(Y,Y,ea);e.negate(ha,Y);d.set(U,Y[0],Y[1],Y[2],-e.dot(Y,S));const da=new R,ia=new R,ka=[],fa=t.create(),X=t.create(this._passParameters.clipBox);t.offset(X,-S[0],-S[1],-S[2],X);this._nodes.forAll(va=>{const za=va.splatSize*this._passParameters.scaleFactor;var ya=va.obb.minimumDistancePlane(U),Da=va.obb.maximumDistancePlane(U);
ya-=O(za,ya+ca,this._passParameters,Z,va.isLeaf);Da-=O(za,Da+ca,this._passParameters,Z,va.isLeaf);ya=null!=da.dist&&null!=ia.dist&&da.dist<ya*ea&&ia.dist>Da*ea;if(!(0>Da||ya)&&(Da=I(za,Da+ca,this._passParameters,Z,va.isLeaf),va.obb.intersectRay(S,Y,Da))){Da*=Da;va.obb.toAaBoundingBox(fa);t.offset(fa,-S[0],-S[1],-S[2],fa);ya=!t.contains(X,fa);e.subtract(ba,va.origin,S);var ra=va.coordinates.length/3;for(let Pa=0;Pa<ra;Pa++){T[0]=ba[0]+va.coordinates[3*Pa];T[1]=ba[1]+va.coordinates[3*Pa+1];T[2]=ba[2]+
va.coordinates[3*Pa+2];if(ya&&!t.containsPoint(X,T))continue;var xa=e.dot(T,Y),Ma=e.squaredLength(T)-xa*xa;if(Ma>Da)continue;var Ga=xa+ca;const Qa=O(za,Ga,this._passParameters,Z,va.isLeaf);if(0>xa-Qa)continue;Ga-=Qa;Ga=I(za,Ga,this._passParameters,Z,va.isLeaf);if(Ma>Ga*Ga)continue;const Ea=(xa-Qa)*ea;xa=ua=>{var Na=Pa,Ua=ua.point;null==Ua&&(Ua=g.create());Ua[0]=va.origin[0]+va.coordinates[3*Na];Ua[1]=va.origin[1]+va.coordinates[3*Na+1];Ua[2]=va.origin[2]+va.coordinates[3*Na+2];ua.point=Ua;ua.dist=
Ea;ua.normal=ha;ua.node=va;ua.pointId=Pa;ua.layerUid=this.layerUid;return ua};(null==da.dist||Ea<da.dist)&&(null==W||W(S,V,Ea))&&xa(da);Q.options.store!==z.StoreResults.MIN&&(null==ia.dist||Ea>ia.dist)&&(null==W||W(S,V,Ea))&&xa(ia);Q.options.store!==z.StoreResults.ALL||null!=W&&!W(S,V,Ea)||(Ma=new R,ka.push(xa(Ma)))}}});const ja=va=>{const {layerUid:za,node:ya,pointId:Da}=va;return new m.PclTarget(va.point,za,Da,()=>this.createGraphic(ya,Da,va.point))},la=(va,za)=>{const ya=ja(za);va.set(this.type,
ya,za.dist,za.normal)};if(M(da)){var na=Q.results.min;(null==na.dist||da.dist<na.dist)&&la(na,da)}M(ia)&&Q.options.store!==z.StoreResults.MIN&&(na=Q.results.max,(null==na.dist||ia.dist>na.dist)&&la(na,ia));if(Q.options.store===z.StoreResults.ALL){na=v.fromPoints(S,V);for(const va of ka){const za=y.newIntersectorResult(na);la(za,va);Q.results.all.push(za)}}}prepareTechnique(Q){if(0===this._nodes.length||!(Q.output===n.ShaderOutput.Color||n.isDepth(Q.output)&&Q.bindParameters.slot===A.RenderSlot.OPAQUE_NO_SSAO_DEPTH||
Q.output===n.ShaderOutput.Highlight))return null;this._nodes.forAll(W=>{null==W.vao&&this._initNode(Q,W)});this._techniqueConfig.drawScreenSize=this._passParameters.drawScreenSpace;this._techniqueConfig.useFixedSizes=this._passParameters.useFixedSizes;this._techniqueConfig.hasSlicePlane=this._slicePlaneEnabled;this._techniqueConfig.hasOccludees=Q.bindParameters.hasOccludees;this._techniqueConfig.clippingEnabled=this._clippingEnabled;this._techniqueConfig.output=Q.output;return this._context.techniques.releaseAndAcquire(F.PointRendererTechnique,
this._techniqueConfig,this._technique)}renderNode(Q,W){const S=Q.rctx,V=S.bindTechnique(W,Q.bindParameters,this._passParameters),T=Q.output===n.ShaderOutput.Highlight;this._nodes.forAll(Y=>{0===Y.coordinates.length||T&&!Y.highlights||(V.bindDraw(Y,Q.bindParameters,this._passParameters),S.bindVAO(Y.vao),T?this._renderHighlightFragments(S,Y):S.drawArrays(E.PrimitiveType.POINTS,0,Y.coordinates.length/3))})}_renderHighlightFragments(Q,W){var S=W.highlights;if(null!=S){W=S[0].component;var V=W+1;for(let T=
1;T<S.length;T++){const Y=S[T].component;Y!==V&&(V-=W,0<V&&Q.drawArrays(E.PrimitiveType.POINTS,W,V),W=Y);V=Y+1}S=V-W;0<S&&Q.drawArrays(E.PrimitiveType.POINTS,W,S)}}set useFixedSizes(Q){this._passParameters.useFixedSizes!==Q&&(this._passParameters.useFixedSizes=Q,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(Q){this._passParameters.scaleFactor!==Q&&(this._passParameters.scaleFactor=Q,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(Q){this._passParameters.minSizePx!==
Q&&(this._passParameters.minSizePx=Q,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(Q){this._passParameters.useRealWorldSymbolSizes!==Q&&(this._passParameters.useRealWorldSymbolSizes=Q,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(Q){this._passParameters.size!==Q&&(this._passParameters.size=Q,this._requestRender())}get size(){return this._passParameters.size}set sizePx(Q){this._passParameters.sizePx!==
Q&&(this._passParameters.sizePx=Q,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(Q){t.set(this._passParameters.clipBox,Q||t.positiveInfinity)}get _clippingEnabled(){return!t.equals(this._passParameters.clipBox,t.positiveInfinity,(Q,W)=>Q===W)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(Q){this._slicePlaneEnabled!==Q&&(this._slicePlaneEnabled=Q,this._requestRender())}addNode(Q){this._nodes.push(Q);this._highlights.nodeAdded(Q);
this._requestRender()}removeNode(Q){let W=null;this._nodes.filterInPlace(S=>S.id===Q?(W=S,S.vao=q.disposeMaybe(S.vao),this._highlights.nodeRemoved(S),!1):!0);this._requestRender();return W}forEachNode(Q){this._nodes.forAll(Q)}removeAll(){this._nodes.forAll(Q=>Q.vao=q.disposeMaybe(Q.vao));this._highlights.removeAll();this._nodes.clear();this._requestRender()}highlight(Q){return this._highlights.add(Q)}_addHighlight(Q,W,S){var V=Q.highlights;null==V&&(V=[]);W={component:W,id:S};V.push(W);W=L(W);for(S=
V.length-1;0<S&&W<L(V[S-1]);)[V[S-1],V[S]]=[V[S],V[S-1]],--S;Q.highlights=V;this._requestRender()}_removeHighlight(Q,W){Q.highlights=P(Q.highlights,W);this._requestRender()}_initNode(Q,W){Q=Q.rctx;W.vao=new B.VertexArrayObject(Q,x.Default3D,K,{positions:N.BufferObject.createVertex(Q,E.Usage.STATIC_DRAW,W.coordinates),colors:N.BufferObject.createVertex(Q,E.Usage.STATIC_DRAW,W.rgb)})}_requestRender(){this._context&&this._context.requestRender()}};b.__decorate([p.property({constructOnly:!0})],a.PointRenderer.prototype,
"createGraphic",void 0);a.PointRenderer=b.__decorate([c.subclass("esri.views.3d.layers.i3s.PointRenderer")],a.PointRenderer);class J extends D.PointRendererDrawParameters{constructor(Q,W,S,V,T,Y,ha,ba,U=null,Z=null){super(S,T,W);this.id=Q;this.obb=V;this.coordinates=Y;this.rgb=ha;this.attributes=ba;this.pointIdFilterMap=U;this.highlights=Z}}class R{constructor(){this.normal=this.dist=this.point=this.pointId=this.node=null;this.layerUid=""}}a.PointRendererNode=J;a.isPointRendererNode=function(Q){return Q.hasOwnProperty("splatSize")};
Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/PointHighlights":function(){define(["exports","../../../../core/handleUtils","../../webgl-engine/lib/basicInterfaces","../../webgl-engine/lib/Object3DStateID"],function(a,b,q,l){class p{constructor(h){this._context=h;this._highlights=new Set}get empty(){return 0===this._highlights.size}destroy(){this._highlights=null}add(h){const f=new k(h);this._highlights.add(f);this._enableSet(f);return b.makeHandle(()=>this._removeSet(f))}_removeSet(h){this._disableSet(h);
this._highlights.delete(h)}_enableSet(h){h.enabled||(h.enabled=!0,this._context.forEachNode(f=>this._enableSetForNode(h,f)))}_enableSetForNode(h,f){if(h.enabled){var c=h.ids.get(f.id);c&&c.forEach(e=>this._context.addHighlight(f,e,h.id))}}_disableSet(h){h.enabled&&(h.enabled=!1,this._context.forEachNode(f=>this._disableSetForNode(h,f)))}_disableSetForNode(h,f){h.enabled||this._context.removeHighlight(f,h.id)}nodeAdded(h){this._highlights.forEach(f=>this._enableSetForNode(f,h))}nodeRemoved(h){this._highlights.forEach(f=>
this._disableSetForNode(f,h))}removeAll(){this._highlights.forEach(h=>this._disableSet(h))}}class k{constructor(h){this.id=new l.Object3DStateID(q.Object3DState.Highlight);this.ids=new Map;this.enabled=!1;for(const f of h)null!=f&&this._add(f.nodeId,f.pointId)}_add(h,f){const c=this.ids.get(h);c?c.add(f):this.ids.set(h,new Set([f]))}}a.PointHighlights=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/PointRenderer.glsl":function(){define("exports ../core/mathUtils ../core/libs/gl-matrix-2/math/mat4 ../core/libs/gl-matrix-2/factories/mat4f64 ../core/libs/gl-matrix-2/math/vec2 ../core/libs/gl-matrix-2/factories/vec2f64 ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../geometry/support/aaBoundingBox ../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput ../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl ../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl ../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl ../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform ../views/3d/webgl-engine/core/shaderModules/Float2PassUniform ../views/3d/webgl-engine/core/shaderModules/Float3DrawUniform ../views/3d/webgl-engine/core/shaderModules/interfaces ../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform ../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform ../views/3d/webgl-engine/core/shaderModules/ShaderBuilder ../views/3d/webgl-engine/lib/VertexAttribute".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y){function z(N){const E=new x.ShaderBuilder,G=N.output===e.ShaderOutput.Color,I=N.output===e.ShaderOutput.Highlight,{vertex:O,fragment:L}=E;E.include(g.SliceDraw,N);E.attributes.add(y.VertexAttribute.POSITION,"vec3");E.attributes.add(y.VertexAttribute.COLOR,"vec3");O.uniforms.add(new n.Matrix4DrawUniform("modelView",(P,M)=>q.multiply(D,M.camera.viewMatrix,q.fromTranslation(D,P.origin))),new u.Matrix4PassUniform("proj",(P,M)=>M.camera.projectionMatrix),
new w.Float2DrawUniform("screenMinMaxSize",(P,M,K)=>p.set(H,K.useFixedSizes?0:K.minSizePx*M.camera.pixelRatio,(P.isLeaf?256:64)*M.camera.pixelRatio)),N.useFixedSizes?new v.Float2PassUniform("pointScale",(P,M)=>p.set(H,P.fixedSize*M.camera.pixelRatio,M.camera.fullHeight)):new w.Float2DrawUniform("pointScale",(P,M,K)=>p.set(H,P.splatSize*K.scaleFactor*M.camera.pixelRatio,M.camera.fullHeight/M.camera.pixelRatio)));N.clippingEnabled?O.uniforms.add(new m.Float3DrawUniform("clipMin",(P,M,K)=>h.set(F,K.clipBox[0]-
P.origin[0],K.clipBox[1]-P.origin[1],K.clipBox[2]-P.origin[2])),new m.Float3DrawUniform("clipMax",(P,M,K)=>h.set(F,K.clipBox[3]-P.origin[0],K.clipBox[4]-P.origin[1],K.clipBox[5]-P.origin[2]))):(O.constants.add("clipMin","vec3",[-b.numberMaxFloat32,-b.numberMaxFloat32,-b.numberMaxFloat32]),O.constants.add("clipMax","vec3",[b.numberMaxFloat32,b.numberMaxFloat32,b.numberMaxFloat32]));G&&E.varyings.add("vColor","vec3");O.code.add(r.glsl`
void main(void) {
// Move clipped points outside of clipspace
if (position.x < clipMin.x || position.y < clipMin.y || position.z < clipMin.z ||
position.x > clipMax.x || position.y > clipMax.y || position.z > clipMax.z) {
gl_Position = vec4(0.0,0.0,0.0,2.0);
gl_PointSize = 0.0;
return;
}
if (rejectBySlice(position)) {
gl_Position = vec4(0.0,0.0,0.0,2.0);
gl_PointSize = 0.0;
return;
}
// Position in camera space
vec4 camera = modelView * vec4(position, 1.0);
float pointSize = pointScale.x;
vec4 position = proj * camera;
${N.drawScreenSize?r.glsl`
float clampedScreenSize = pointSize;`:r.glsl`
float pointRadius = 0.5 * pointSize;
vec4 cameraOffset = camera + vec4(0.0, pointRadius, 0.0, 0.0);
vec4 positionOffset = proj * cameraOffset;
float radius = abs(positionOffset.y - position.y);
float viewHeight = pointScale.y;
// screen diameter = (2 * r / w) * (h / 2)
float screenPointSize = (radius / position.w) * viewHeight;
float clampedScreenSize = clamp(screenPointSize, screenMinMaxSize.x, screenMinMaxSize.y);
// Shift towards camera, to move rendered point out of terrain i.e. to
// the camera-facing end of the virtual point when considering it as a
// 3D sphere.
camera.xyz -= normalize(camera.xyz) * pointRadius * clampedScreenSize / screenPointSize;
position = proj * camera;`}
gl_PointSize = clampedScreenSize;
gl_Position = position;
${G?r.glsl`vColor = color;`:""}
}
`);L.include(t.RgbaFloatEncoding,N);I&&E.include(d.OutputHighlight,N);L.code.add(r.glsl`
void main(void) {
vec2 vOffset = gl_PointCoord - vec2(0.5, 0.5);
float r2 = dot(vOffset, vOffset);
if (r2 > 0.25) {
discard;
}
${I?r.glsl`outputHighlight();`:""}
${G?r.glsl`fragColor = vec4(vColor, 1.0);`:""}
}
`);return E}function A(N){return N?256:64}class B extends r.NoParameters{constructor(){super(...arguments);this.clipBox=c.create(c.positiveInfinity);this.useRealWorldSymbolSizes=this.useFixedSizes=!1;this.scaleFactor=1;this.sizePx=this.size=this.minSizePx=0}get fixedSize(){return this.drawScreenSpace?this.sizePx:this.size}get screenMinSize(){return this.useFixedSizes?0:this.minSizePx}get drawScreenSpace(){return this.useFixedSizes&&!this.useRealWorldSymbolSizes}}class C extends g.SlicePlaneParameters{constructor(N,
E,G){super(N);this.origin=N;this.isLeaf=E;this.splatSize=G}}const D=l.create(),F=f.create(),H=k.create();l=Object.freeze(Object.defineProperty({__proto__:null,PointRendererDrawParameters:C,PointRendererPassParameters:B,build:z,getMaxPointSizeScreenspace:A},Symbol.toStringTag,{value:"Module"}));a.PointRendererDrawParameters=C;a.PointRendererPassParameters=B;a.PointRendererShader=l;a.build=z;a.getMaxPointSizeScreenspace=A})},"esri/views/3d/webgl-engine/shaders/PointRendererTechnique":function(){define("require exports ../core/shaderLibrary/ShaderOutput ../core/shaderTechnique/ReloadableShaderModule ../core/shaderTechnique/ShaderTechnique ../lib/DefaultVertexAttributeLocations ../lib/Program ../lib/StencilUtils ../../../../chunks/PointRenderer.glsl ../../../webgl/enums ../../../webgl/renderState".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){class d extends p.ShaderTechnique{constructor(t,w,v){super(t,w,v)}initializeProgram(t){return new h.Program(t.rctx,d.shader.get().build(this.configuration),k.Default3D)}initializePipeline(){return g.makePipelineState({depthTest:{func:e.CompareFunction.LESS},depthWrite:g.defaultDepthWriteParams,colorWrite:g.defaultColorWriteParams,stencilWrite:this.configuration.hasOccludees?f.stencilWriteMaskOn:null,stencilTest:this.configuration.hasOccludees?f.stencilBaseAllZerosParams:
null,drawBuffers:this.configuration.output===q.ShaderOutput.Depth?{buffers:[e.SpecialDrawBuffers.NONE]}:null})}}d.shader=new l.ReloadableShaderModule(c.PointRendererShader,()=>new Promise((t,w)=>a(["./PointRenderer.glsl"],t,w)));b.PointRendererTechnique=d;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/shaders/PointRendererTechniqueConfiguration":function(){define(["exports","../../../../chunks/tslib.es6","../core/shaderLibrary/ShaderOutput","../core/shaderTechnique/ShaderTechniqueConfiguration",
"../materials/DefaultTechniqueConfiguration"],function(a,b,q,l,p){class k extends p.DefaultTechniqueConfiguration{constructor(){super(...arguments);this.output=q.ShaderOutput.Color;this.clippingEnabled=this.hasOccludees=this.useFixedSizes=this.drawScreenSize=this.hasSlicePlane=!1}}b.__decorate([l.parameter({count:q.ShaderOutput.COUNT})],k.prototype,"output",void 0);b.__decorate([l.parameter()],k.prototype,"hasSlicePlane",void 0);b.__decorate([l.parameter()],k.prototype,"drawScreenSize",void 0);b.__decorate([l.parameter()],
k.prototype,"useFixedSizes",void 0);b.__decorate([l.parameter()],k.prototype,"hasOccludees",void 0);b.__decorate([l.parameter()],k.prototype,"clippingEnabled",void 0);b.__decorate([l.parameter({constValue:!0})],k.prototype,"hasSliceInVertexProgram",void 0);a.PointRendererTechniqueConfiguration=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/PopupSceneLayerView":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Error ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../layers/support/fieldUtils ../../../layers/support/popupUtils".split(" "),
function(a,b,q,l,p,k,h,f,c){a.PopupSceneLayerView=e=>{e=class extends e{_validateFetchPopupFeatures(g){const {layer:d}=this,{popupEnabled:t}=d;if(!t)throw new q("scenelayerview3d:fetchPopupFeatures","Popups are disabled",{layer:d});if(!c.getFetchPopupTemplate(d,g))throw new q("scenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{layer:d});}async prepareFetchPopupFeatures(g){}async fetchPopupFeaturesFromGraphics(g,d){this._validateFetchPopupFeatures(d);if(0===g.length)return[];
const t="scene"===this.layer.type&&null!=this.layer.associatedLayer?this.layer.associatedLayer:this.layer;var w=[];"fieldsIndex"in this.layer&&(w=f.unpackFieldNames(this.layer.fieldsIndex,await c.getRequiredFields(t,c.getFetchPopupTemplate(this.layer,d))));await this.prepareFetchPopupFeatures(w);d=new Set;const v=[],m=[];for(const n of g)f.populateMissingFields(w,n,d)?m.push(n):v.push(n);if(0===m.length)return v;const r=new Map;for(w=0;w<g.length;w++)r.set(g[w].getObjectId()??0,w);g=await this.whenGraphicAttributes(m,
[...d]).catch(()=>m).then(n=>v.concat(n));g.sort((n,u)=>{n=n.getObjectId()??0;n=r.get(n)??0;u=u.getObjectId()??0;u=r.get(u)??0;return n-u});return g}};return e=b.__decorate([h.subclass("esri.views.3d.layers.support.PopupSceneLayerView")],e)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/SceneLayerView3D":function(){define("../../../chunks/tslib.es6 ../../../Graphic ../../../core/Logger ../../../core/maybe ../../../core/ReactiveSet ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/sql/WhereClause ../../../layers/support/FeatureFilter ../../../layers/support/floorFilterUtils ../../../rest/support/Query ../../../support/featureFlags ./I3SMeshView3D ./II3SMeshView3D ./LayerView3D ./i3s/featureEditing ./i3s/I3SGeometryUtil ./i3s/I3SMeshViewFilter ./i3s/I3SNode ./i3s/I3SOverrides ./i3s/I3SQueryEngine ./i3s/I3SQueryFeatureAdapter ./i3s/I3SQueryFeatureStore ./i3s/I3SUtil ./support/DefinitionExpressionSceneLayerView ./support/fieldProperties ./support/PopupSceneLayerView ./support/SceneLayerViewRequiredFields ./support/TemporalSceneLayerView ../support/updatingProperties ../../layers/SceneLayerView ../../layers/support/popupUtils ../../support/layerViewUtils ../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K){f=N.defineFieldProperties();m=class extends m.I3SMeshView3D(I.TemporalSceneLayerView(H.DefinitionExpressionSceneLayerView(E.PopupSceneLayerView(n.LayerView3D(L))))){constructor(){super(...arguments);this.type="scene-layer-3d";this._setVisibilityHiddenObjectIds=new p;this.progressiveLoadFactor=1;this._elevationContext="scene";this._isIntegratedMesh=!1;this._supportsLabeling=!0;this._pendingEditsQueue=Promise.resolve();
this._interactiveEditingSessions=new Map;this._queryEngine=null}get i3slayer(){return this.layer}tryRecycleWith(J,R){return J.url===this.layer.url&&this.i3sOverrides.isEmpty?J.load(R).then(()=>{F.checkRecyclable(this.layer,J,this.i3sOverrides);this.layer=J;this.i3sOverrides.destroy();this.i3sOverrides=new A.I3SOverrides({view:this.view,layer:J,memoryController:this.view.resourceController?.memoryController});this.resetHighlights()}):null}get layerPopupEnabledAndHasTemplate(){return this.layer.popupEnabled&&
P.hasPopupTemplate(this.layer,this.view.popup?.defaultPopupTemplateEnabled)}get filter(){return this._get("filter")}set filter(J){this._set("filter",y.I3SMeshViewFilter.checkSupport(J)?J:null)}get viewFilter(){const J=this.mergedFilter,R=this.layerFilter;if(null==J&&null==R)return null;const Q=this._get("viewFilter");if(null==Q)return new y.I3SMeshViewFilter({layerFilter:R,viewFilter:J,layerFieldsIndex:this.layer.fieldsIndex,loadAsyncModule:W=>this._loadAsyncModule(W),addSqlFilter:(W,S)=>this.addSqlFilter(W,
S,this.logError),addTimeFilter:(W,S)=>this.addTimeFilter(W,S)});Q.viewFilter=J;Q.layerFilter=R;return Q}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get _floorFilterClause(){const J=t.getFloorFilterClause(this);return null!=J?g.WhereClause.create(J,this.layer.fieldsIndex):null}get _excludeObjectIdsSorted(){const J=this.layer.excludeObjectIds.toArray();return J.length?J.sort((R,Q)=>R-Q):null}get _setVisibilityHiddenObjectIdsSorted(){return this._setVisibilityHiddenObjectIds.size?
Array.from(this._setVisibilityHiddenObjectIds).sort((J,R)=>J-R):null}get lodFactor(){return this.view?.qualitySettings?.sceneService?.object?.lodFactor??1}get lodCrossfadeUncoveredDuration(){return this.view?.qualitySettings?.fadeDuration??0}get updatingProgressValue(){return this._controller?.updatingProgress??0}get visibleAtCurrentScale(){return M.isInEffectiveScaleRange(this.i3slayer.effectiveScaleRange,this.view.terrainScale)}initialize(){this._fieldsHelper=new G.SceneLayerViewRequiredFields({layerView:this});
this._updatingHandles.add(()=>this.layer.rangeInfos,R=>this._rangeInfosChanged(R),k.initial);this._updatingHandles.add(()=>this.layer.renderer,R=>this._updatingHandles.addPromise(this._rendererChange(R)),k.initial);const J=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,J);this._updatingHandles.add(()=>this.mergedFilter,J);this._updatingHandles.add(()=>this._floorFilterClause,J);this._updatingHandles.add(()=>this._excludeObjectIdsSorted,J);this._updatingHandles.add(()=>
this._setVisibilityHiddenObjectIdsSorted,J);this._updatingHandles.add(()=>this.viewFilter?.sortedObjectIds,J);this._updatingHandles.add(()=>this.viewFilter?.parsedWhereClause,J);this._updatingHandles.add(()=>this.getTimeFilterDependencies(),J);this._updatingHandles.add(()=>[this.viewFilter?.parsedGeometry,this.mergedFilter?.spatialRelationship,this.layer.filter?.spatialRelationship],()=>this._geometryFilterChange());v.sceneLayerEditingEnabled()&&this.i3sOverrides.is3DOFL&&this._updatingHandles.add(()=>
this.i3sOverrides.sortedGeometryChangedObjectIds,J);this.addHandles(this.layer.on("apply-edits",R=>this._updatingHandles.addPromise(R.result)));this.addHandles(this.layer.on("edits",R=>{const Q=this._pendingEditsQueue.then(()=>this._handleEdits(R)).then();this._pendingEditsQueue=Q;this._updatingHandles.addPromise(Q)}))}destroy(){this._fieldsHelper=l.destroyMaybe(this._fieldsHelper)}_rangeInfosChanged(J){null!=J&&0<J.length&&q.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}createQuery(){const J=
{outFields:["*"],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return this.mergedFilter?.createQuery(J)??new w(J)}queryExtent(J,R){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(J),R?.signal)}queryFeatureCount(J,R){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(J),R?.signal)}queryFeatures(J,R){return this._ensureQueryEngine().executeQuery(this._ensureQuery(J),R?.signal).then(Q=>{if(!Q?.features)return Q;const W=this.layer;for(const S of Q.features)S.layer=
W,S.sourceLayer=W;return Q})}queryObjectIds(J,R){return this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(J),R?.signal)}_ensureQueryEngine(){this._queryEngine||(this._queryEngine=this._createQueryEngine());return this._queryEngine}_createQueryEngine(){const J=x.createGetFeatureExtent(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new B.I3SQueryEngine({layerView:this,priority:K.TaskPriority.FEATURE_QUERY_ENGINE,spatialIndex:new D.I3SQueryFeatureStore({featureAdapter:new C.I3SQueryFeatureAdapter({objectIdField:this.layer.objectIdField,
attributeStorageInfo:this.layer.attributeStorageInfo??[],getFeatureExtent:J}),forAllFeatures:(R,Q)=>this._forAllFeatures((W,S,V)=>R({id:W,index:S,meta:V}),Q,r.ForAllFeaturesMode.QUERYABLE),getFeatureExtent:J,sourceSpatialReference:F.getIndexCrs(this.layer),viewSpatialReference:this.view.spatialReference})})}highlight(J){const R=this._highlights;if(J instanceof w){const {set:Q,handle:W}=R.acquireSet();this.queryObjectIds(J).then(S=>R.setFeatureIds(Q,S));return W}return super.highlight(J)}createInteractiveEditSession(J){return u.createInteractiveEditSession(this._attributeEditingContext,
J)}_createLayerGraphic(J){return new b({attributes:J,layer:this.layer,sourceLayer:this.layer})}getFilters(){const J=super.getFilters();v.sceneLayerEditingEnabled()&&this.i3sOverrides.is3DOFL&&0<this.i3sOverrides.sortedGeometryChangedObjectIds.length&&J.push((W,S)=>{0<=S.node.index&&F.objectIdFilter(this.i3sOverrides.sortedGeometryChangedObjectIds,!1,W)});const R=this._setVisibilityHiddenObjectIdsSorted;null!=R&&J.push(W=>F.objectIdFilter(R,!1,W));const Q=this._excludeObjectIdsSorted;null!=Q&&J.push(W=>
F.objectIdFilter(Q,!1,W));this._floorFilterClause&&this.addSqlFilter(J,this._floorFilterClause,this.logError);this.addSqlFilter(J,this.parsedDefinitionExpression,this.logError);null!=this.viewFilter&&this.viewFilter.addFilters(J,this.view,this._controller.crsIndex,this._collection);return J}setVisibility(J,R){R?this._setVisibilityHiddenObjectIds.delete(J):this._setVisibilityHiddenObjectIds.add(J)}isUpdating(){return super.isUpdating()||this.layerFilterUpdating||null!=this.viewFilter&&this.viewFilter.updating||
null!=this.i3sOverrides&&this.i3sOverrides.updating}_ensureQuery(J){return this._addDefinitionExpressionToQuery(null==J?this.createQuery():w.from(J))}get _attributeEditingContext(){return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:this._getObjectIdField(),globalIdField:this._getGlobalIdField(),forEachNode:J=>this._forAllNodes(R=>null!=R?J(R.node,R.featureIds):null),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this.i3sOverrides,
getAttributeData:J=>this.getAttributeData(J),setAttributeData:(J,R)=>this.setAttributeData(J,R),clearMemCache:()=>this.clearMemCache()}}async _handleEdits(J){const R=v.sceneLayerEditingEnabled(),Q=this._attributeEditingContext;J=await u.normalizeEditResultsEvent(Q,J);R&&u.processGeometryEdits(Q,J);u.processAttributeEdits(Q,J)}get hasGeometryFilter(){return null!=this.viewFilter?.parsedGeometry}computeNodeFiltering(J){const R=this.viewFilter;return null==R||!this.view.spatialReference||R.isMBSGeometryVisible(J,
this.view.spatialReference,this._controller.crsIndex)?z.NodeFilterImpact.Unmodified:z.NodeFilterImpact.Culled}};a.__decorate([h.property()],m.prototype,"i3slayer",null);a.__decorate([h.property(O.updatingProgress)],m.prototype,"updatingProgress",void 0);a.__decorate([h.property({type:d})],m.prototype,"filter",null);a.__decorate([h.property({readOnly:!0})],m.prototype,"viewFilter",null);a.__decorate([h.property(f.requiredFields)],m.prototype,"requiredFields",null);a.__decorate([h.property(f.availableFields)],
m.prototype,"availableFields",void 0);a.__decorate([h.property()],m.prototype,"_fieldsHelper",void 0);a.__decorate([h.property()],m.prototype,"_floorFilterClause",null);a.__decorate([h.property()],m.prototype,"_excludeObjectIdsSorted",null);a.__decorate([h.property()],m.prototype,"_setVisibilityHiddenObjectIds",void 0);a.__decorate([h.property()],m.prototype,"_setVisibilityHiddenObjectIdsSorted",null);a.__decorate([h.property()],m.prototype,"lodFactor",null);a.__decorate([h.property()],m.prototype,
"updatingProgressValue",null);a.__decorate([h.property({readOnly:!0})],m.prototype,"visibleAtCurrentScale",null);return m=a.__decorate([e.subclass("esri.views.3d.layers.SceneLayerView3D")],m)})},"esri/core/ReactiveSet":function(){define(["./accessorSupport/tracking","./accessorSupport/tracking/SimpleObservable"],function(a,b){class q{constructor(l){this._observable=new b.SimpleObservable;this._set=new Set(l)}get size(){a.trackAccess(this._observable);return this._set.size}add(l){const p=this._set.size;
this._set.add(l);this._set.size!==p&&this._observable.notify();return this}clear(){0<this._set.size&&(this._set.clear(),this._observable.notify())}delete(l){(l=this._set.delete(l))&&this._observable.notify();return l}entries(){a.trackAccess(this._observable);return this._set.entries()}forEach(l,p){a.trackAccess(this._observable);this._set.forEach((k,h)=>l.call(p,k,h,this),p)}has(l){a.trackAccess(this._observable);return this._set.has(l)}keys(){a.trackAccess(this._observable);return this._set.keys()}values(){a.trackAccess(this._observable);
return this._set.values()}[Symbol.iterator](){a.trackAccess(this._observable);return this._set[Symbol.iterator]()}get [Symbol.toStringTag](){return this._set[Symbol.toStringTag]}}return q})},"esri/views/3d/layers/I3SMeshView3D":function(){define("require exports ../../../chunks/tslib.es6 ../../../Color ../../../Graphic ../../../symbols ../../../core/arrayUtils ../../../core/ByteSizeUnit ../../../core/Collection ../../../core/handleUtils ../../../core/has ../../../core/Logger ../../../core/MapUtils ../../../core/maybe ../../../core/PooledArray ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/scheduling ../../../core/typedArrayUtil ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/mat3 ../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/libs/gl-matrix-2/factories/quatf64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../chunks/vec42 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../core/support/UpdatingHandles ../../../geometry/projection/localLinearScaleFactors ../../../geometry/projection/projectBoundingSphere ../../../geometry/projection/projectBuffer ../../../geometry/projection/projectors ../../../geometry/projection/projectVectorToVector ../../../geometry/support/aaBoundingBox ../../../geometry/support/aaBoundingRect ../../../geometry/support/DoubleArray ../../../geometry/support/FloatArray ../../../geometry/support/Indices ../../../chunks/sphere ../../../geometry/support/UByteArray ../../../layers/LayerConstants ../../../layers/graphics/controllers/I3SOnDemandController ../../../layers/support/fieldUtils ../../../layers/support/SceneModification ../../../renderers/visualVariables/support/visualVariableUtils ../../../support/arcadeOnDemand ../../../support/basemapUtils ../../../support/elevationInfoUtils ../../../symbols/Symbol3D ./I3SMeshViewLabeler ./I3SMeshViewPerformanceInfo ./I3SMeshWorkerHandle ./II3SMeshView3D ./SceneLayerWorker ./graphics/graphicUtils ./graphics/Labeler ./i3s/enums ./i3s/Highlights ./i3s/I3SAsyncElevationUpdater ./i3s/I3SCrossfadeHelper ./i3s/I3SGeometryUtil ./i3s/I3SIntersectionHandler ./i3s/I3SMaterialUtil ./i3s/I3SNode ./i3s/I3SOverrides ./i3s/I3SProjectionUtil ./i3s/I3SUtil ./i3s/IDBCache ./i3s/IDBMockCache ./i3s/LayerElevationProvider ./support/attributeUtils ./support/makeScheduleFunction ./support/symbolColorUtils ../support/debugFlags ../support/ElevationRange ../support/extentUtils ../support/orientedBoundingBox ../support/updatingProperties ../support/buffer/glUtil ../webgl-engine/collections/Component/ObjectParameters ../webgl-engine/collections/Component/SourceGeometry ../webgl-engine/collections/Component/Transform ../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl ../webgl-engine/lib/BasisUtil ../webgl-engine/lib/edgeRendering/interfaces ../../../symbols/SimpleFillSymbol".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U,Z,ca,ea,da,ia,ka,fa,X,ja,la,na,va,za,ya,Da,ra,xa,Ma,Ga,Pa,Qa,Ea,ua,Na,Ua,wa,sa,Ha,Ka,Aa,Sa,Ya,qa,aa,Ja,Ta,Ra,$a,bb,pa,Ba){function Ia(lb,oa){m.isAbortError(lb)||d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn("Error while processing edges. Edges on this layer might not display correctly",oa,lb)}function Wa(lb){if(null==lb)return!1;const oa=lb.metallicRoughness;return oa&&0<=oa.baseColorTextureId||
oa&&0<=oa.metallicRoughnessTextureId||0<=lb.normalTextureId||0<=lb.emissiveTextureId||0<=lb.occlusionTextureId}function gb(lb){return null!=lb&&u.isArrayBuffer(lb.data)}function ib(lb,oa){lb=1024+lb.interleavedVertexData.byteLength+(lb.indices?lb.indices.byteLength:0)+lb.positionData.data.byteLength+lb.positionData.indices.byteLength;if(null!=oa)for(const Fa of oa)null!=Fa&&u.isArrayBuffer(Fa.data)&&(lb+=Fa.data.byteLength);return lb}function La(lb,oa){return oa.byteSize>xb?(d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn(`Node is too big to store in IndexedDB cache: ${lb.id} (${oa.byteSize} bytes)`),
!1):0<oa.byteSize}function Xa(lb){if(0!==lb.length){var oa=new Float64Array(10*lb.length),Fa=0;lb.forAll(Va=>{let Za=Va.serviceObbInIndexSR;null==Za&&(Za=Ib,Za.center=S.getCenter(Va.serviceMbsInIndexSR),Za.halfSize=[Va.serviceMbsInIndexSR[3],Va.serviceMbsInIndexSR[3],Va.serviceMbsInIndexSR[3]]);Va=Za.data;oa[Fa++]=Va[0];oa[Fa++]=Va[1];oa[Fa++]=Va[2];oa[Fa++]=Va[3];oa[Fa++]=Va[4];oa[Fa++]=Va[5];oa[Fa++]=Va[6];oa[Fa++]=Va[7];oa[Fa++]=Va[8];oa[Fa++]=Va[9]});return oa}}function eb(lb,oa){lb.forEach(Fa=>
Fa.opacity=oa)}function db(lb,oa,Fa){let Va=lb.elevationRangeMin,Za=lb.elevationRangeMax;if(0<Fa){oa.getCorners(gc);for(const kb of gc){var fb=F.len(kb)-Fa;Va=Math.min(Va,fb);Za=Math.max(Za,fb)}}else{oa.getCorners(gc);for(fb of gc)Fa=fb[2],Va=Math.min(Va,Fa),Za=Math.max(Za,Fa)}lb.expandElevationRangeValues(Va,Za)}function jb(lb,oa,Fa){const Va=S.getCenter(oa);Fa=0<Fa?F.len(Va)-Fa:Va[2];oa=S.getRadius(oa);lb.expandElevationRangeValues(Fa-oa,Fa+oa)}const nb=[1,1,1,1];class qb extends Da.NodeCrossfadeMetaData{constructor(lb,
oa,Fa,Va,Za,fb,kb,mb,rb){super();this.node=lb;this.featureIds=oa;this.objectHandle=Fa;this.cachedRendererVersion=Va;this.attributeInfo=Za;this.material=fb;this.textures=kb;this.anchorIds=mb;this.anchors=rb;this.cachedElevationAnchors=null;this.cachedEdgeMaterials=[];this.edgeMemoryUsage=0}}var ub;(function(lb){lb[lb.CastShadows=4]="CastShadows";lb[lb.Pickable=5]="Pickable"})(ub||={});const xb=100*f.ByteSizeUnit.MEGABYTES;var pb;(function(lb){lb[lb.ADD=0]="ADD";lb[lb.REMOVE=1]="REMOVE";lb[lb.UPDATE=
2]="UPDATE"})(pb||={});const Bb=K.create(),Kb=J.create(),bc=J.create(),Ib=new Ya.Obb,$b=[0,0,0,0],kc=new l([0,0,0,0]),fc=S.fromValues(0,0,0,0);class Pb{constructor(lb,oa){this.mode=lb;this.offset=oa}}const Cb=H.create(),Vb=K.create(),gc=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],Lb=new Aa.ElevationRange;b.I3SMeshView3D=lb=>{lb=class extends lb{constructor(){super(...arguments);this._needsNormals=!0;this._updatingHandles=new G.UpdatingHandles;this._nodeId2Meta=new Map;this._nodeId2MetaReloading=
new Map;this._i3sWasmLoaded=!1;this._snappingSourcesTrackers=[];this._hasLoadedPBRTextures=!1;this._asyncModuleLoading=0;this._addTasks=new Map;this._currentRenderer=null;this._rendererVersion=0;this._symbologyOverrideFields=this._symbologyOverride=this._symbologyFields=this._rendererFields=this._opacityVariable=this._colorVariable=null;this._symbolInfos=new Map;this._visibleGeometryChangedSchedulerHandle=null;this._hasVertexColors=this._hasComponentData=!1;this._nodeColorOverride=null;this.updating=
!0;this.holeFilling="auto";this.slicePlaneEnabled=this._hasData=this._hasTextures=this._hasColors=!1;this._modifications=[];this.ignoresMemoryFactor=!1;this._layerUrl="";this._cacheKeySuffix=null;this._planetRadiusInGlobalMode=0;this._elevationTask=null;this._filters=[];this._arcade=null;this._tmpAttributeOnlyGraphic=new p;this._crossfadeHelper=new Da.I3SCrossfadeHelper(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerUid(){return this.i3slayer&&
this.i3slayer.uid}get sublayerUid(){return null}get layerId(){return this.i3slayer&&this.i3slayer.id}get sublayerId(){return null}get contentVisible(){return!this.suspended&&this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Ea.rendererNeedsTextures(this._currentRenderer)?
this._usePBR||this._hasLoadedPBRTextures?va.TextureUsage.AllTexturesPBR:va.TextureUsage.AllTextures:this._usePBR||this._hasLoadedPBRTextures?va.TextureUsage.GeometryTexturesPBR:va.TextureUsage.GeometryTextures}get elevationOffset(){const oa=null!=this.i3slayer?this.i3slayer.elevationInfo:null;return null!=oa&&"absolute-height"===oa.mode?ea.getElevationOffset(oa,this.i3slayer.spatialReference):0}get elevationInfo(){const oa=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null==oa)return new Pb(X.ElevationMode.Absolute,
0);const Fa=ea.getElevationOffset(oa,this.i3slayer.spatialReference);switch(oa.mode){case "absolute-height":return new Pb(X.ElevationMode.Absolute,Fa);case "relative-to-ground":return new Pb(X.ElevationMode.RelativeToGround,Fa);case "on-the-ground":return new Pb(X.ElevationMode.OnTheGround,0);default:return new Pb(X.ElevationMode.Absolute,0)}}get supportedTextureEncodings(){return Ma.getSupportedEncodings(this.view._stage.renderView.capabilities)}get uncompressedTextureDownsamplingEnabled(){const oa=
0===(this.supportedTextureEncodings&va.TextureEncoding.DDS_S3TC);return this.view?.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled&&oa}get clientGeometry(){return this.i3sOverrides.geometryOverrides}get elevationRange(){var oa=this._nodeId2Meta;const Fa=new Aa.ElevationRange;for(const Va of oa.values()){if(null==Va)continue;({node:{serviceMbsInIndexSR:oa}}=Va);const [,,Za,fb]=oa;Fa.expandElevationRangeValues(Za-fb,Za+fb)}return Fa.elevationRangeValid?Fa:null}get fullExtent(){return this.i3slayer.fullExtent}initialize(){var oa=
g("enable-feature:idb-mock-cache");this._idbCache=oa?new Na.IDBMockCache(this.view,oa):new ua.IDBCache("esri-scenelayer-cache","geometries");this._preLoadBasis();this.addResolvingPromise(this.i3slayer.indexInfo);oa=this.view.resourceController;this.i3sOverrides=new Pa.I3SOverrides({view:this.view,layer:this.i3slayer,memoryController:oa.memoryController});this._worker=new fa.I3SMeshWorkerHandle(sa.makeScheduleFunction(oa));this.addResolvingPromise(this._worker.promise);oa=this.i3slayer.store;this._worker.setLegacySchema(this.uid,
oa.defaultGeometrySchema);Ea.checkSceneLayerValid(this.i3slayer);Ea.checkSceneLayerCompatibleWithView(this.i3slayer,this.view);this._layerUrl=this.i3slayer.parsedUrl.path;this._controller=new Y({layerView:this,worker:this._worker});this._geoMemoryEstimate=this._texMemoryEstimate=this._gpuMemoryEstimate=0;this._stage=this.view._stage;this._collection=this._stage.renderView.componentObjectCollection;this.resetHighlights();oa=oa.defaultGeometrySchema;if(this._isIntegratedMesh||!oa)this._hasComponentData=
!1;else{const mb=oa.featureAttributes;this._hasComponentData=!!(mb&&mb.faceRange&&mb.id)}this._hasVertexColors=null!=(oa?.vertexAttributes.color??null)&&!this.i3slayer.cachedDrawingInfo?.color;this._memCache=this.view.resourceController.memoryController.newCache(`sl-${this.uid}`,mb=>this._deleteComponentObject(mb));const Fa=this._controller,Va=this._nodeId2Meta,Za=this._nodeId2MetaReloading;this._intersectionHandler=new xa.I3SIntersectionHandler({layerUid:this.layerUid,sublayerUid:this.sublayerUid,
collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:mb=>{const rb=Fa.index;if(rb){var tb=rb.rootNode;tb&&rb.traverse(tb,yb=>{var zb=yb.index;zb=Va.get(zb)||Za.get(zb);return mb(yb,zb?.objectHandle??null)})}}});this._updatingHandles.add(()=>this.layerUid,mb=>this._intersectionHandler.layerUid=mb);this._updatingHandles.add(()=>this.sublayerUid,mb=>this._intersectionHandler.sublayerUid=mb);this._elevationProvider=new Ua.LayerElevationProvider({view:this.view,
layerElevationSource:this,intersectionHandler:this._intersectionHandler});this._hasLoadedPBRTextures=this._usePBR;this._updatingHandles.add(()=>this.view.clippingArea,()=>this._clippingAreaChanged(),r.initial);this._updatingHandles.add(()=>this.fullOpacity,mb=>this._opacityChange(mb));this._updatingHandles.add(()=>this.slicePlaneEnabled,mb=>this._slicePlaneEnabledChange(mb));this._updatingHandles.add(()=>this.elevationOffset,(mb,rb)=>{this._reloadAll(rb);this._controller.invalidateVisibilityObbs()});
this._updatingHandles.add(()=>this.elevationInfo,(mb,rb)=>this._elevationInfoChanged(mb,rb),r.initial);this._updatingHandles.add(()=>!this.suspended&&this.elevationInfo.mode!==X.ElevationMode.Absolute,(mb,rb)=>{mb?this.addHandles(this.view.basemapTerrain.on("elevation-change",({extent:tb})=>this._ensureElevationTask().addExtent(tb)),"elevation-change"):rb&&this.removeHandles("elevation-change")},r.initial);this._updatingHandles.add(()=>this._usePBR,mb=>this._updatePBR(mb));oa=()=>{this._reloadAll();
this.clearMemCache()};this._updatingHandles.add(()=>this.rendererTextureUsage,oa);this._updatingHandles.add(()=>this.uncompressedTextureDownsamplingEnabled,oa);this._updatingHandles.add(()=>this.contentVisible,mb=>this._contentVisibleChanged(mb),r.initial);this._updatingHandles.add(()=>this.i3slayer.labelsVisible,()=>this._labelingChanged(),r.initial);this._updatingHandles.add(()=>this.i3slayer.labelingInfo,()=>this._labelingChanged(),r.initial);this._updatingHandles.add(()=>this._modifications,()=>
this._modificationsChanged(),r.initial);this.addHandles([r.watch(()=>Ka.debugFlags.I3S_TREE_SHOW_TILES,mb=>{if(mb&&!this._treeDebugger){const rb=this._controller.crsIndex;(new Promise((tb,yb)=>a(["./support/I3STreeDebugger"],tb,yb))).then(({I3STreeDebugger:tb})=>{!this._treeDebugger&&Ka.debugFlags.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new tb({lv:this,view:this.view,nodeSR:rb}))})}else mb||Ka.debugFlags.I3S_TREE_SHOW_TILES||(this._treeDebugger=w.destroyMaybe(this._treeDebugger))},r.initial),r.watch(()=>
Ka.debugFlags.I3S_SHOW_MODIFICATIONS,()=>this._showModifications(),r.initial)]);this._cacheKeySuffix=Ea.getCacheKeySuffix(this.i3slayer.spatialReference,this.view.renderSpatialReference);this._idbCache.init().catch(mb=>d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn(`Failed to initialize IndexedDB cache: ${mb}`));({view:oa}=this);const {viewingMode:fb,renderCoordsHelper:kb}=oa;this._planetRadiusInGlobalMode="local"===fb?0:kb.referenceEllipsoid.radius}destroy(){this._clearAddTasks();this._elevationTask=
w.destroyMaybe(this._elevationTask);this.i3sOverrides=w.destroyMaybe(this.i3sOverrides);this._elevationProvider&&(this._elevationProvider.objectsChanged(this.getVisibleObbs()),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null);this._intersectionHandler&&(this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const oa=this._worker;oa&&(oa.destroyContext(this.uid).then(()=>oa.destroy()),
this._worker=null);this._removeAllNodeDataFromStage();this._memCache=w.destroyMaybe(this._memCache);this._edgeView=this._stage=this._collection=null;this._labeler=w.destroyMaybe(this._labeler);this._treeDebugger=w.destroyMaybe(this._treeDebugger);this._controller=w.destroyMaybe(this._controller);this._highlights.destroy();this._nodeId2Meta.clear();this._nodeId2MetaReloading.clear();this._crossfadeHelper=w.destroyMaybe(this._crossfadeHelper);this.emit("visible-geometry-changed");this._visibleGeometryChangedSchedulerHandle&&
(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null);this._updatingHandles=w.destroyMaybe(this._updatingHandles)}_memEstimateTextureAdded(oa){oa=oa.memoryEstimate;this._gpuMemoryEstimate+=oa;this._texMemoryEstimate+=oa;return oa}_memEstimateTextureRemoved(oa){null!=oa&&(oa=oa.memoryEstimate,this._gpuMemoryEstimate-=oa,this._texMemoryEstimate-=oa)}_memEstimateGeometryAdded(oa){oa=this._collection.getObjectGPUMemoryUsage(oa);this._gpuMemoryEstimate+=
oa;this._geoMemoryEstimate+=oa;return oa}_memEstimateGeometryRemoved(oa){oa=this._collection.getObjectGPUMemoryUsage(oa);this._gpuMemoryEstimate-=oa;this._geoMemoryEstimate-=oa}isNodeLoaded(oa){return this._nodeId2Meta.has(oa)}isNodeReloading(oa){return this._nodeId2MetaReloading.has(oa)}get usedMemory(){let oa=null!=this._labeler?this._labeler.usedMemory:0;this._nodeId2Meta.forEach(Fa=>oa+=null!=Fa?Fa.node.memory:0);this._nodeId2MetaReloading.forEach(Fa=>oa+=null!=Fa?Fa.node.memory:0);return oa}get unloadedMemory(){return(null!=
this._controller?this._controller.unloadedMemoryEstimate:0)+(null!=this._labeler?this._labeler.unloadedMemoryEstimate:0)}_labelingChanged(){if(!na.areLabelsVisible(this.i3slayer)||!this._supportsLabeling)null!=this._labeler&&(this._labeler.destroy(),this._labeler=null);else if(null==this._labeler){var oa=new ia({view:this.view,layer:this.i3slayer,collection:this._collection,overrides:this.i3sOverrides});this._nodeId2Meta.forEach(Fa=>null!=Fa&&this._addMetaToLabeler(oa,Fa));this._labeler=oa}}_loadAsyncModule(oa){++this._asyncModuleLoading;
return oa.then(Fa=>{--this._asyncModuleLoading;return Fa},Fa=>{--this._asyncModuleLoading;throw Fa;})}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)this._i3sWasmLoaded=ja.initialize().then(()=>{this._i3sWasmLoaded=!0;this._modificationsChanged();this.notifyUpdate()}),this.notifyUpdate();else if(!0===this._i3sWasmLoaded){var oa=this.uid,Fa=this.i3slayer.spatialReference;this._worker.setModifications(oa,this._layerClippingArea,this._modifications,Fa);var Va=fa.toWasmModification(this._layerClippingArea,
this._modifications,Fa);ja.setModificationsSync({context:oa,modifications:Va,isGeodetic:Fa.isGeographic});this._controller.modificationsChanged();var Za=this.hasModifications?new v:null;this._nodeId2Meta.forEach((fb,kb)=>{null==fb?(this._nodeId2Meta.delete(kb),this._controller.updateLoadStatus(kb,!1)):fb.node.hasModifications?(this._nodeId2Meta.delete(kb),this._nodeId2MetaReloading.set(kb,fb)):null!=Za&&Za.push(fb.node)});this.notifyChange("elevationRange");null!=Za&&this._nodeId2MetaReloading.forEach(fb=>
Za.push(fb.node));null!=Za&&0<Za.length&&(this.updateNodeModificationStatus(Za),Za.forAll(fb=>{if(fb.imModificationImpact!==Ga.NodeIMModificationImpact.Culled){const kb=this._nodeId2Meta.get(fb.index);this._controller.invalidateGeometryVisibility(fb.index);null!=kb?(this._nodeId2Meta.delete(fb.index),this._nodeId2MetaReloading.set(fb.index,kb),this.notifyChange("elevationRange")):this._nodeId2Meta.has(fb.index)&&(this._nodeId2Meta.delete(fb.index),this._controller.updateLoadStatus(fb.index,!1))}}));
this.clearMemCache();this._controller.restartNodeLoading();this._showModifications()}}_showModifications(){null!=this._modificationGraphics&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null);if(Ka.debugFlags.I3S_SHOW_MODIFICATIONS&&0!==this._modifications.length){var oa={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},Fa={outline:{color:[255,255,255],width:1}};this._modificationGraphics=[];for(const Va of this._modifications){const Za=Va.geometry;
Za.spatialReference=this.i3slayer.spatialReference;const fb=new Ba({...Fa,color:oa[Va.type]});this._modificationGraphics.push(new p({geometry:Za,symbol:fb}))}this.view.graphics.addMany(this._modificationGraphics)}}_addMetaToLabeler(oa,Fa){oa.addNodeMeta(Fa,(Va,Za)=>this._createAttributes(Va,Za))}_contentVisibleChanged(oa){oa?(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler)):
(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(oa){oa=this._nodeId2Meta.get(oa);if(null!=oa?.attributeInfo)return oa.attributeInfo.loadedAttributes}getAttributeData(oa){oa=this._nodeId2Meta.get(oa);if(null!=oa?.attributeInfo)return oa.attributeInfo.attributeData}setAttributeData(oa,Fa){oa=this._nodeId2Meta.get(oa);
null!=oa?.attributeInfo&&(oa.attributeInfo.attributeData=Fa,this._attributeValuesChanged(oa))}async updateAttributes(oa,Fa,Va){const Za=this._nodeId2Meta.get(oa);null!=Za&&(await this.i3sOverrides.applyAttributeOverrides(Za.featureIds,Fa,Va,this._controller.requiredAttributes),Za.attributeInfo=Fa,this._controller.reschedule(()=>this._attributeValuesChanged(Za),Va).catch(fb=>{m.isAbortError(fb)||d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn("Error while updating attribute values. Layer might not display correctly.",
fb)}))}_attributeValuesChanged(oa){oa.cachedRendererVersion=this._getInvalidRendererVersion();oa.filteredIds=null;null!=this._labeler&&this._labeler.setNodeMetaAttributes(oa,(Fa,Va)=>this._createAttributes(Fa,Va));this._updateEngineObject(oa)}clearMemCache(){null!=this._memCache&&this._memCache.clear()}getVisibleNodes(){const oa=[];this._nodeId2Meta.forEach(Fa=>null!=Fa&&oa.push(Fa.node));return oa}getVisibleObbs(){const oa=[];this._nodeId2Meta.forEach(Fa=>{null!=Fa&&(Fa=this.getNodeComponentObb(Fa.node),
null!=Fa&&oa.push(Fa))});return oa}getNodeComponentObb(oa){oa=this._nodeId2Meta.get(oa.index)??this._nodeId2MetaReloading.get(oa.index);return null!=oa?this._collection.getComponentObb(oa.objectHandle):null}getLoadedNodeIndices(oa){this._nodeId2Meta.forEach((Fa,Va)=>oa.push(Va));this._nodeId2MetaReloading.forEach((Fa,Va)=>oa.push(Va))}_preLoadBasis(){!g("disable-feature:i3s-basis")&&0!==(this.supportedTextureEncodings&va.TextureEncoding.Basis)&&this.i3slayer.textureSetDefinitions?.some(oa=>oa.formats.some(Fa=>
"basis"===Fa.format||"ktx2"===Fa.format))&&bb.loadBasis()}_getVertexBufferLayout(oa,Fa){oa={hasTexture:Wa(oa.params.material),hasNormals:Fa.normal,hasRegions:Fa.uvRegion};return aa.glLayout(Ta.createVertexBufferLayout(this._getGeometryParameters(oa)))}_getObjectIdField(){return this.i3slayer.objectIdField||T.fallbackObjectIDAttribute}_getGlobalIdField(){return this.i3slayer.associatedLayer?.globalIdField}_findGraphicNodeAndIndex(oa){const Fa=wa.attributeLookup(this.i3slayer.fieldsIndex,oa.attributes,
this._getObjectIdField());let Va=null;t.someMap(this._nodeId2Meta,Za=>{if(null==Za)return!1;const fb=Za.featureIds.indexOf(Fa);if(-1===fb)return!1;Va={node:Za.node,index:fb};return!0});return Va}_getGraphicIndices(oa,Fa){oa=this._nodeId2Meta.get(oa.index);if(null==oa)return[];const Va=[],Za=this._getObjectIdField(),fb=this.i3slayer.fieldsIndex;for(const kb of Fa)Fa=wa.attributeLookup(fb,kb.attributes,Za),Fa=oa.featureIds.indexOf(Fa),-1!==Fa&&Va.push(Fa);return Va}whenGraphicBounds(oa){oa=this._findGraphicNodeAndIndex(oa);
if(!oa)return Promise.reject();oa=this._getAABB(oa.node.index,oa.index);return null==oa?Promise.reject():Promise.resolve({boundingBox:oa,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(oa){return null==oa.nodeIndex||null==oa.componentIndex?null:this._getAABB(oa.nodeIndex,oa.componentIndex)}_getAABB(oa,Fa){oa=this._nodeId2Meta.get(oa);if(null==oa?.featureIds||Fa>=oa.featureIds.length)return null;Fa=ra.boundingBoxCornerPoints(Fa,this._collection,oa.objectHandle,R.newDoubleArray(24),0);if(!L.projectBuffer(Fa,
this.view.renderSpatialReference,0,Fa,this.view.spatialReference,0,8))return null;oa=K.empty();K.expandWithBuffer(oa,Fa,0,8);return oa}whenGraphicAttributes(oa,Fa){return Ea.whenGraphicAttributes(this.i3slayer,oa,this._getObjectIdField(),Fa,()=>[...this._nodeId2Meta.values()].filter(h.isSome))}getGraphicFromIntersectorTarget(oa){if(null==oa.nodeIndex||null==oa.componentIndex)return null;const Fa=this._nodeId2Meta.get(oa.nodeIndex);return null==Fa?.featureIds||oa.componentIndex>=Fa.featureIds.length?
null:this._createGraphic(oa.componentIndex,Fa)}_getCacheKey(oa){return`${this._layerUrl}/v${24}/${oa}${this._cacheKeySuffix}`}_getMemCacheKey(oa,Fa=this.elevationOffset){return oa+"#"+Fa}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(oa){return null!=this._memCache?this._memCache.pop(this._getMemCacheKey(oa)):null}deleteCachedGPUData(oa){null!=oa&&this._deleteComponentObject(oa)}_cacheGPUData(oa,
Fa=this.elevationOffset){if(null==this._memCache)this._deleteComponentObject(oa);else{var Va=this._controller.indexDepth-oa.node.level;this._memCache.put(this._getMemCacheKey(oa.node.index,Fa),oa,oa.node.memory,Va)}}loadMissingTextures(oa,Fa,Va,Za){const fb=oa?.filter((kb,mb)=>{if(0===(kb.usage&this.rendererTextureUsage))return!1;if(null==Fa)return!0;kb=Ma.selectEncoding(kb.encodings,this.supportedTextureEncodings);mb=Fa[mb];return null==mb?.data||kb&&mb.encoding!==kb.encoding?!0:!1})??[];return 0===
fb.length?Promise.resolve(!1):Va(fb,Za).then(kb=>{let mb=0;for(let rb=0;rb<oa.length;rb++)mb<kb.length&&kb[mb].id===oa[rb].id&&(Fa[rb]=kb[mb],mb++);return!0})}loadCachedNodeData(oa,Fa,Va){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(oa.id),Fa).then(Za=>{if(null==Za)return null;if(Za.nodeVersion!==oa.version)return this._idbCache.remove(this._getCacheKey(oa.id)),null;this.elevationInfo.mode===X.ElevationMode.Absolute&&(oa.geometryObbInRenderSR=Ya.Obb.fromData(Za.geometryObbData));
return this.loadMissingTextures(Za.requiredTextures,Za.textureData,Va,Fa).then(fb=>{fb&&this._idbCache.initialized&&null!=Za.textureData&&(Za.byteSize=ib(Za.transformedGeometry,Za.textureData),Za.textureData.every(gb)&&La(oa,Za)&&this._idbCache.put(this._getCacheKey(oa.id),Za).catch(kb=>d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn(`Failed to update node with textures in IndexedDB cache: ${oa.id}: ${kb}`)));m.throwIfAborted(Fa);return Za})}):Promise.resolve(null)}addNode(oa,Fa,Va){return"geometryData"in
Fa?null==Fa.geometryBuffer?(this._addNodeMeta(oa.index,null),Promise.resolve()):this._addData(oa,Fa.attributeDataInfo,()=>this._transformNode(oa,Fa,Va).then(Za=>this._safeReschedule(()=>{if(null==Za)return oa.hasModifications=!1,this._addCachedNodeData(oa,null,Va);oa.hasModifications=Za.transformedGeometry.hasModifications;const {obb:fb,componentOffsets:kb,featureIds:mb,anchorIds:rb,anchors:tb,transformedGeometry:yb,globalTrafo:zb}=Za;var Ab=F.set(Cb,fb.center.x,fb.center.y,fb.center.z);F.transformMat4(Ab,
Ab,zb);Ab=new Ya.Obb(Ab,[fb.extents.x,fb.extents.y,fb.extents.z],D.fromValues(fb.orientation.x,fb.orientation.y,fb.orientation.z,fb.orientation.w));this.elevationInfo.mode===X.ElevationMode.Absolute&&(oa.geometryObbInRenderSR=Ab);Fa.geometryData.componentOffsets=kb;mb&&(Fa.geometryData.featureIds=Array.from(mb));Fa.geometryData.anchorIds=rb;Fa.geometryData.anchors=tb;Ab={nodeVersion:oa.version,geometryData:Fa.geometryData,requiredTextures:Fa.requiredTextures,textureData:Fa.textureData,transformedGeometry:yb,
globalTrafo:zb,geometryObbData:Ab.data,byteSize:ib(yb,Fa.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&La(oa,Ab)){const Fb=null!=Ab.textureData?Ab.textureData.map(Qb=>gb(Qb)?Qb:null):null;this._idbCache.put(this._getCacheKey(oa.id),{...Ab,textureData:Fb}).catch(Qb=>d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn(`Failed to store node in IndexedDB cache: ${oa.id}: ${Qb}`))}return this._addCachedNodeData(oa,Ab,Va)},Va))):Promise.reject()}getElevationRange(oa){const Fa=new Aa.ElevationRange;
var Va=this._controller;const {index:Za}=Va;if(!Za)return Fa;const {rootNode:fb}=Za;if(!fb)return Fa;const kb=this._nodeId2Meta,mb=oa[3],rb=Va.viewportQueries,tb=this._planetRadiusInGlobalMode;({view:Va}=this);const {renderCoordsHelper:yb}=Va,zb=yb.referenceEllipsoid.radius,Ab=this._collection;Za.traverse(fb,Fb=>{const {childrenLoaded:Qb}=Fb;if(0===Qb)return!1;var sb=rb.getAndUpdateVisibilityObbInRenderSR(Fb),vb=null;let Gb=-1;if(sb){if(Gb=sb.radius,!sb.intersectSphereWithMBS(oa,Gb))return!1}else(vb=
rb.getServiceMbsInRenderSR(Fb))&&(Gb=vb[3]);if(0<=Gb&&mb>=1*Gb)return null!=sb?db(Fa,sb,tb):null!=vb&&0<=vb[3]&&jb(Fa,vb,tb),!1;Lb.elevationRangeMin=Infinity;Lb.elevationRangeMax=-Infinity;if(null!=sb||null!=vb)if(null!=sb?db(Lb,sb,tb):null!=vb&&jb(Lb,vb,tb),Lb.elevationRangeMin>=Fa.elevationRangeMin&&Lb.elevationRangeMax<=Fa.elevationRangeMax)return!1;if(sb=kb.get(Fb.index))if({geometryObbInRenderSR:Fb}=Fb,!Fb||Fb.intersectSphereWithMBS(oa)){if(Fb&&mb>0*Fb.radius)return db(Fa,Fb,tb),!1;({objectHandle:Fb}=
sb);vb=Ab.getObjectTransform(Fb);vb=yb.getAltitude(vb.position);Ab.expandRangeWithComponentObjectElevationRange(Fb,vb,zb,Fa)}return 0<Qb-(sb?1:0)});return Fa}computeVisibilityObb(oa){return Ea.computeVisibilityObb(oa,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications,this.view.renderCoordsHelper.sphericalPCPF)}_transformNode(oa,Fa,Va){var Za=Fa.geometryData.geometries??[];const fb=Array(Za.length);for(var kb=0;kb<Za.length;++kb)fb[kb]=
this._getVertexBufferLayout(Za[kb],Fa.geometryDescriptor);Za=this.i3slayer.normalReferenceFrame;Za=Fa.normalReferenceFrame??Za??"none";kb=oa.serviceMbsInIndexSR;const mb=this.elevationOffset;var rb=this._controller.crsIndex,tb=this._controller.crsVertex;const yb=this.view.renderSpatialReference,zb=Qa.computeGlobalTransformation(kb,mb,Za,rb,yb);rb=P.getProjectorName(rb,tb);tb=P.getProjectorName(tb,yb);return null==rb||null==tb?Promise.resolve(null):this._worker.invoke({context:this.uid,geometryBuffer:Fa.geometryBuffer,
geometryData:Fa.geometryData,geometryDescriptor:Fa.geometryDescriptor,layouts:fb,globalTrafo:zb,mbs:kb,obbData:oa.serviceObbInIndexSR?.data,elevationOffset:mb,needNormals:this._needsNormals&&this._controller.isMeshPyramid,normalReferenceFrame:Za,indexToVertexProjector:rb,vertexToRenderProjector:tb},Va)}get _supportsNodeCrossFading(){return!this.view?._stage?.renderer.shadowsEnabled}get nodeCrossfadingEnabled(){return this._supportsNodeCrossFading&&(0<this.lodCrossfadeinDuration||0<this.lodCrossfadeoutDuration||
0<this.lodCrossfadeUncoveredDuration)}get nodeFadeoutEnabled(){return this._supportsNodeCrossFading&&0<this.lodCrossfadeoutDuration}_setNewNodeOpacity(oa){this._setNodeOpacity(oa,this.nodeCrossfadingEnabled?0:this.fullOpacity)}addCachedGPUData(oa,Fa,Va){this.elevationInfo.mode===X.ElevationMode.Absolute&&(oa.geometryObbInRenderSR=this._collection.getComponentObb(Fa.objectHandle).clone());this._controller.isGeometryVisible(oa)?(null!=this._labeler&&this._addMetaToLabeler(this._labeler,Fa),oa=oa.index,
this._addNodeMeta(oa,Fa),this.updateNodeState(oa,Va),this._collection.setObjectVisibility(Fa.objectHandle,!0),this._updateMaterial(Fa),this._setNewNodeOpacity(Fa),this.elevationInfo.mode!==X.ElevationMode.Absolute&&this._ensureElevationTask().schedule(oa),this._updateEngineObject(Fa),this._highlights.objectCreated(Fa),null!=this._treeDebugger&&this._treeDebugger.update()):this._cacheGPUData(Fa)}addCachedNodeData(oa,Fa,Va,Za){return this._addData(oa,Va,()=>this._addCachedNodeData(oa,Fa,Za))}async deleteCachedNodeData(oa){if(this._idbCacheEnabled)return this._idbCache.remove(this._getCacheKey(oa))}async _addCachedNodeData(oa,
Fa,Va){if(this.contentVisible&&this._controller.isGeometryVisible(oa))if(null==Fa)this._addNodeMeta(oa.index,null);else{var Za=this._addTasks.get(oa.index),{geometryData:fb,transformedGeometry:kb,globalTrafo:mb}=Fa;await this.i3sOverrides.applyAttributeOverrides(fb.featureIds,Za.attributeInfo,Va,this._controller.requiredAttributes);var rb=null!=Fa.textureData?Fa.textureData.filter(Yb=>null!=Yb&&0!==(Yb.usage&this.rendererTextureUsage)):[];!g("disable-feature:i3s-basis")&&rb.some(Yb=>null!=Yb&&(Yb.encoding===
va.TextureEncoding.Basis||Yb.encoding===va.TextureEncoding.KTX2))&&await bb.loadBasis();oa.memory=0;var {componentOffsets:tb,geometries:yb,featureIds:zb,anchorIds:Ab,anchors:Fb}=fb,Qb=this._collection,sb=yb[0],{layout:vb,indices:Gb,interleavedVertexData:Hb,positionData:Tb,hasColors:lc}=kb,{material:Ub,geometryParameters:Zb}=this._materialParameters(sb,vb),ac=tb||new Uint32Array([0,Gb?Gb.length:Hb.byteLength/vb[0].stride]);ac={vertices:{data:Hb,count:Hb.byteLength/vb[0].stride,layoutParameters:Zb},
positionData:{positions:Q.compactFloatArray(Tb.data),indices:W.compactIndices(Tb.indices)},indices:Gb,componentOffsets:ac};var Mb=sb.transformation?C.clone(sb.transformation):C.create();B.multiply(Mb,mb,Mb);sb=B.getTranslation(H.create(),Mb);Mb=z.fromMat4(A.create(),Mb);var Jb=this.view.renderSpatialReference,Wb=this.view.basemapTerrain.spatialReference,cc=Ya.Obb.fromData(Fa.geometryObbData).center,Db=[1,1,1];I.localLinearScaleFactors(cc,Jb,Db,Wb)||d.getLogger("esri.views.3d.layers.I3SMeshView3D").errorOnce("Unsupported coordinate system for IM overlay");
var Nb=H.create();M.projectVectorToVector(cc,Jb,Nb,Wb);Jb=A.create();z.invert(Jb,Mb);Wb=H.create();F.transformMat3(Wb,F.sub(Wb,cc,sb),Jb);var hc=Qb.createObject(new Ja.ObjectParameters(E.fromValues(Nb[0]-Wb[0]*Db[0],Nb[1]-Wb[1]*Db[1],Db[0],Db[1]),new Ra.Transform(sb,Mb),Ya.Obb.fromData(Fa.geometryObbData),ac)),{textures:xc,texturePromise:nc}=this._initMaterialAndTextures(hc,Ub,rb,Zb.textureCoordinates===$a.TextureCoordinateAttributeType.Atlas);oa.memory+=this._memEstimateGeometryAdded(hc);oa.memory+=
xc.reduce((Yb,dc)=>Yb+(null!=dc?this._memEstimateTextureAdded(dc):0),0);rb=!!Ub.hasParametersFromSource;ac="blend"!==Ub.alphaMode&&1<=Ub.metallicRoughness.baseColorFactor[3];var Xb=new qb(oa,zb,hc,this._getInvalidRendererVersion(),Za.attributeInfo,{hasParametersFromSource:rb,isOpaque:ac},xc,Ab,Fb);Za.meta=Xb;!this._hasTextures&&Fa.requiredTextures?.some(({usage:Yb})=>0!==(Yb&va.TextureUsage.ColorTextures))&&(this._hasTextures=!0);this._hasData=!0;this._hasColors=this._hasColors||lc;this._hasTextures=
this._hasTextures||!!oa.resources.texture;this.notifyChange("hasTexturesOrVertexColors");var tc=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(Xb),nc]).then(([Yb])=>{this._addTasks.has(oa.index)&&Yb?.updateObjectVisibility(Xb.objectHandle,!1).catch(dc=>Ia(dc,this.i3slayer.title));return this._safeReschedule(()=>{var dc=this._addTasks.get(oa.index);if(dc)if(this._addNodeMeta(oa.index,Xb),dc.meta=null,this.contentVisible){Qb.setObjectVisibility(hc,!0);Yb?.updateObjectVisibility(Xb.objectHandle,
!0).catch(oc=>Ia(oc,this.i3slayer.title));Xb.attributeInfo=dc.attributeInfo;dc=Xb.cachedRendererVersion!==this._rendererVersion;var Gc=tc!==this.slicePlaneEnabled;this._updateElevationOffsets(Xb);var Cc=Xb.elevationOffsets;this._updateComponentData(Xb);var uc=this._applyFiltersToNode(Xb);(dc||null!=Yb&&(Gc||uc||Cc))&&this._addOrUpdateEdgeRendering(Xb);null!=this._labeler&&this._addMetaToLabeler(this._labeler,Xb);this._visibleGeometryChanged(Xb,pb.ADD);this._highlights.objectCreated(Xb);this._updateMaterial(Xb);
this._setNewNodeOpacity(Xb);null!=this._treeDebugger&&this._treeDebugger.update()}else this._removeNodeStageData(oa.index,this.elevationOffset)},Va)}).catch(Yb=>{null!=Za.meta&&(this._cacheGPUData(Za.meta),Za.meta=null);throw Yb;})}else this._removeNodeStageData(oa.index,this.elevationOffset,this._nodeId2MetaReloading)}_addNodeMeta(oa,Fa){this._removeNodeStageData(oa,this.elevationOffset,this._nodeId2MetaReloading);if(this._nodeId2Meta.has(oa)){d.getLogger("esri.views.3d.layers.I3SMeshView3D").error("Removing duplicated node");
const Va=this._nodeId2Meta.get(oa);null!=Va&&this._deleteComponentObject(Va)}else this._controller.updateLoadStatus(oa,!0);null!=Fa&&(Fa.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&eb(Fa.cachedEdgeMaterials,0));this._nodeId2Meta.set(oa,Fa);this.notifyChange("elevationRange")}_updateElevationOffsets(oa){const Fa=this.view.renderSpatialReference,Va=this._controller.crsIndex,Za=this.elevationInfo,fb=this.view.basemapTerrain,kb=fb.spatialReference,mb=Za.mode;if(null==Fa||null==kb||mb===X.ElevationMode.Absolute)oa.elevationOffsets=
null;else{var rb=this._collection.getObjectTransform(oa.objectHandle);oa.elevationOffsets=oa.elevationOffsets??[];var tb=mb===X.ElevationMode.OnTheGround,yb=this.view.renderCoordsHelper,zb=oa.featureIds.length,Ab=(()=>{if(oa.cachedElevationAnchors)return oa.cachedElevationAnchors;const sb=R.newDoubleArray(3*zb);oa.cachedElevationAnchors=sb;for(let vb=0;vb<zb;vb++){const Gb=3*vb,Hb=oa.anchorIds?.indexOf(vb)??-1;oa.anchors&&0<=Hb?(F.set(Cb,oa.anchors[3*Hb],oa.anchors[3*Hb+1],oa.anchors[3*Hb+2]),F.add(Cb,
Cb,S.getCenter(oa.node.serviceMbsInIndexSR)),M.projectVectorToVector(Cb,Va,Cb,kb),sb[Gb]=Cb[0],sb[Gb+1]=Cb[1],sb[Gb+2]=yb.getAltitude(Cb)):(this._collection.getComponentAabb(oa.objectHandle,vb,Vb,!0),F.set(Cb,(Vb[0]+Vb[3])/2,(Vb[1]+Vb[4])/2,Vb[2]),F.transformMat3(Cb,Cb,rb.rotationScale),F.add(Cb,Cb,rb.position),sb[Gb+2]=yb.getAltitude(Cb),M.projectVectorToVector(Cb,Fa,Cb,kb),sb[Gb]=Cb[0],sb[Gb+1]=Cb[1])}return sb})(),Fb=Za.offset,Qb=oa.elevationOffsets;fb.getElevations(Ab,zb,(sb,vb)=>{const Gb=tb?
Ab[3*sb+2]:0;Qb[sb]=Fb+(null!=vb?vb-Gb:0)})}}_ensureElevationTask(){return null!=this._elevationTask?this._elevationTask:this._elevationTask=new ya.I3SAsyncElevationUpdater(this.view.resourceController.scheduler,oa=>{oa=this._controller.updateElevationChanged(oa,this.view.basemapTerrain.spatialReference);return null!=oa?oa.filterInPlace(Fa=>null!=this._nodeId2Meta.get(Fa)):null},oa=>{oa=this._nodeId2Meta.get(oa);this._nodeElevationAlignmentChanged(oa)},()=>this.elevationInfo?.mode)}_elevationInfoChanged(oa,
Fa){const Va=oa.mode!==X.ElevationMode.Absolute;oa=!!Fa&&Fa!==oa&&Fa.mode!==X.ElevationMode.Absolute;this._intersectionHandler.updateElevationAlignState(Va,this.view.state.viewingMode);Va&&!oa&&this._controller.removeAllGeometryObbs();this._nodeId2Meta.forEach(Za=>this._nodeElevationAlignmentChanged(Za))}_nodeElevationAlignmentChanged(oa){null!=oa&&(this._updateElevationOffsets(oa),this._updateComponentData(oa),this._updateEdgeRendering(oa),null!=this._labeler&&this._labeler.updateLabelPositions(oa),
this._updateSnappingSources(oa,pb.UPDATE))}_safeReschedule(oa,Fa){m.throwIfAborted(Fa);return this._controller.reschedule(oa,Fa)}_materialParameters(oa,Fa){oa=null!=oa.params.material?oa.params.material:Ma.defaultMaterial();const Va=Fa.some(fb=>"uvRegion"===fb.name);Fa=Fa.some(fb=>"normalCompressed"===fb.name);const Za=Wa(oa);return{geometryParameters:this._getGeometryParameters({hasTexture:Za,hasNormals:Fa,hasRegions:Va}),material:oa}}_initMaterialAndTextures(oa,Fa,Va,Za){const fb=this._stage.renderView,
kb=Va.map(rb=>Ma.createTexture(rb,Fa,Za,fb));this._stage.addMany(kb);let mb=null;this._collection.updateMaterial(oa,rb=>{mb=Ma.configureMaterial(rb,Fa,kb,Va,this.view._stage.renderView.textures,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR,isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference});this._updateMaterialOverlay(rb)});return{textures:kb,texturePromise:mb}}_getGeometryParameters(oa){return{textureCoordinates:oa.hasTexture?
oa.hasRegions?$a.TextureCoordinateAttributeType.Atlas:$a.TextureCoordinateAttributeType.Default:$a.TextureCoordinateAttributeType.None,colors:this._hasVertexColors,hasNormals:oa.hasNormals&&this._needsNormals,needsNormals:this._needsNormals}}_addData(oa,Fa,Va){let Za=this._addTasks.get(oa.index);Za?Za.attributeInfo=Fa:(Za={...m.createResolver(),attributeInfo:Fa,meta:null},this._addTasks.set(oa.index,Za),Va().then(Za.resolve,Za.reject).then(()=>this._addTasks.delete(oa.index)).catch(fb=>{this._addTasks.delete(oa.index);
throw fb;}));return Za.promise}_clearAddTasks(){this._addTasks.forEach(oa=>{null!=oa.meta&&(this._cacheGPUData(oa.meta),oa.meta=null)});this._addTasks.clear()}_clippingAreaChanged(){var oa=this.view.renderSpatialReference;const Fa=this.i3slayer.spatialReference,Va=J.create();this._renderClippingArea=Sa.toBoundingRect(this.view.clippingArea,Va,oa)?Va:null;oa=J.create();this._layerClippingArea=Sa.toBoundingRect(this.view.clippingArea,oa,Fa)?oa:null;this._filterChange();this._controller&&this._controller.updateClippingArea(this.view.clippingArea);
this._isIntegratedMesh&&this._modificationsChanged()}get hasGeometryFilter(){return!1}_geometryFilterChange(){const oa=this.hasGeometryFilter;this._controller.geometryFilterChanged(oa);this._applyFilters(oa)}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(oa){this._filters=this.getFilters();oa?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach(Fa=>{null!=Fa&&this._applyFiltersToNode(Fa)&&(this._addOrUpdateEdgeRendering(Fa),this._visibleGeometryChanged(Fa,
pb.UPDATE))})}getFilters(){const oa=[],Fa=this._renderClippingArea;null!=Fa&&oa.push((Va,Za)=>this._boundingRectFilter(Va,Za,Fa));return oa}addSqlFilter(oa,Fa,Va){if(null!=Fa){const Za=Fa.fieldNames;oa.push((fb,kb)=>this._sqlFilter(fb,kb,Fa,Za,Va))}}_sqlFilter(oa,Fa,Va,Za,fb){const kb={},mb=this._createLayerGraphic(kb),rb=this.i3slayer.objectIdField,tb=Fa.featureIds,yb=Fa.attributeInfo?.attributeData;Za.every(zb=>zb===rb||null!=yb?.[zb])&&Ea.filterInPlace(oa,tb,zb=>{kb[rb]=tb[zb];for(const Ab of Za)Ab!==
rb&&(kb[Ab]=yb?Ea.getCachedAttributeValue(yb[Ab],zb):null);try{return Va.testFeature(mb)}catch(Ab){return fb(Ab),!1}})}_boundingRectNodeTest(oa,Fa){O.projectBoundingSphere(oa.node.serviceMbsInIndexSR,this._controller.crsIndex,fc,this.view.renderSpatialReference);return Ea.intersectBoundingRectWithMbs(Fa,fc)}_boundingRectFeatureTest(oa,Fa,Va){this._collection.getComponentAabb(oa.objectHandle,Fa,Bb);K.toRect(Bb,Kb);return J.intersects(Va,Kb)}_boundingRectFilter(oa,Fa,Va){var Za=this._collection;const fb=
this._boundingRectNodeTest(Fa,Va);if(fb!==Ea.MbsIntersectResult.INSIDE)if(fb===Ea.MbsIntersectResult.OUTSIDE)oa.length=0;else if(Za=Za.getComponentCount(Fa.objectHandle),Za.invisible+Za.visible===Fa.featureIds.length){var kb=this._transformClippingArea(bc,Va,Fa.objectHandle);Ea.filterInPlace(oa,Fa.featureIds,mb=>this._boundingRectFeatureTest(Fa,mb,kb))}}_transformClippingArea(oa,Fa,Va){var Za=this._collection.getObjectTransform(Va);Va=Za.position;Za=Za.rotationScale;oa[0]=(Fa[0]-Va[0])/Za[0];oa[1]=
(Fa[1]-Va[1])/Za[4];oa[2]=(Fa[2]-Va[0])/Za[0];oa[3]=(Fa[3]-Va[1])/Za[4];return oa}async _addOrUpdateEdgeRendering(oa,Fa=!0){const Va=oa.objectHandle,{hasEdges:Za,perFeatureEdgeMaterials:fb}=this._getFilteredEdgeMaterials(oa),kb={hasSlicePlane:this.slicePlaneEnabled};Za&&!this._edgeView&&(this._edgeView=await this._stage.renderer.loadEdgeView());const mb=this._edgeView;if(!mb)return null;var rb=mb.hasObject(Va);if(Za){if(rb)return this.nodeCrossfadingEnabled&&(rb=this.getNodeOpacity(oa),eb(fb,rb)),
mb.updateAllComponentMaterials(Va,fb,kb,Fa).catch(tb=>Ia(tb,this.i3slayer.title)),mb.updateObjectVisibility(Va,!0).catch(tb=>Ia(tb,this.i3slayer.title)),mb.updateAllVerticalOffsets(Va,oa.elevationOffsets).catch(tb=>Ia(tb,this.i3slayer.title)),mb;Fa=await this._collection.addEdges(Va,mb,fb,kb,oa.elevationOffsets);oa.edgeMemoryUsage=Fa;oa.node.memory+=Fa;return mb}rb&&(oa.node.memory-=oa.edgeMemoryUsage,oa.edgeMemoryUsage=0,mb.removeObject(Va));return null}_applyFiltersToNode(oa){return this._applyFiltersToNodeComponents(oa)?
(null!=this._labeler&&this._labeler.applyFilterChange(oa),!0):!1}_applyFiltersToNodeComponents(oa){const Fa=this._collection;var Va=Fa.getComponentCount(oa.objectHandle),Za=null!=oa.filteredIds;Va=0===Va.invisible;Fa.setAllComponentVisibilities(oa.objectHandle,"all");if(0===this._filters.length)return oa.filteredIds=null,!Va;this._updateCachedFilteredIds(oa);if(Za&&oa.filteredIds===oa.featureIds)return!Va;Za=this._computeFilteredComponentIndices(oa);Fa.setAllComponentVisibilities(oa.objectHandle,
Za);return!0}_updateCachedFilteredIds(oa){if(null==oa.filteredIds||oa.appliedFilters!==this._filters)oa.filteredIds=this._computeFilteredIds(oa),oa.appliedFilters=this._filters}_computeFilteredIds(oa){const Fa=oa.featureIds.slice();for(const Va of this._filters)if(Va(Fa,oa),0===Fa.length)break;return Fa.length===oa.featureIds.length?oa.featureIds:Fa}_computeFilteredComponentIndices(oa){const Fa=[],Va=oa.filteredIds;null!=Va&&oa.featureIds.forEach((Za,fb)=>{Va[Fa.length]===Za&&Fa.push(fb)});return Fa}_removeAllNodeDataFromStage(oa=
this.elevationOffset){this._nodeId2Meta.forEach((Fa,Va)=>this._removeNodeStageData(Va,oa));this._nodeId2MetaReloading.forEach((Fa,Va)=>this._removeNodeStageData(Va,oa,this._nodeId2MetaReloading));this._elevationTask=w.destroyMaybe(this._elevationTask)}removeNode(oa){const Fa=this.elevationOffset;this._removeNodeStageData(oa,Fa);this._removeNodeStageData(oa,Fa,this._nodeId2MetaReloading);null!=this._elevationTask&&this._elevationTask.remove(oa)}_removeNodeStageData(oa,Fa,Va=this._nodeId2Meta){Va.has(oa)&&
this._controller.updateLoadStatus(oa,!1);const Za=Va.get(oa);null==Za?Va.delete(oa):(this._collection.setObjectVisibility(Za.objectHandle,!1),null!=this._edgeView&&this._edgeView.hasObject(Za.objectHandle)&&this._edgeView.updateObjectVisibility(Za.objectHandle,!1).catch(fb=>Ia(fb,this.i3slayer.title)),this._visibleGeometryChanged(Za,pb.REMOVE),null!=this._labeler&&this._labeler.removeNodeMeta(Za),Va.delete(oa),this._highlights.objectDeleted(Za),Va===this._nodeId2Meta?(this._cacheGPUData(Za,Fa),this.nodeCrossfadingEnabled&&
this._crossfadeHelper.stopNodeFading(Za)):this._deleteComponentObject(Za),null!=this._treeDebugger&&this._treeDebugger.update())}_deleteComponentObject(oa){null!=this._edgeView&&this._edgeView.removeObject(oa.objectHandle);this._memEstimateGeometryRemoved(oa.objectHandle);this._collection.destroyObject(oa.objectHandle);if(oa.textures)for(const Fa of oa.textures)this._memEstimateTextureRemoved(Fa),this._stage.remove(Fa)}updateNodeState(oa,Fa){oa=this._nodeId2Meta.get(oa);null!=oa&&this._collection.updateMaterial(oa.objectHandle,
Va=>Va.polygonOffsetEnabled=Fa===Ga.NodeState.Hole)}updateNodeIndex(oa,Fa){if(this._nodeId2Meta.has(oa)){var Va=this._nodeId2Meta.get(oa);this._nodeId2Meta.delete(oa);this._nodeId2Meta.set(Fa,Va);this.notifyChange("elevationRange")}if(Va=this._nodeId2MetaReloading.get(oa))this._nodeId2MetaReloading.delete(oa),this._nodeId2MetaReloading.set(Fa,Va)}_invalidateAllSymbols(){this._rendererVersion=Ea.addWraparound(this._rendererVersion,1);this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return Ea.addWraparound(this._rendererVersion,
-1)}async _rendererChange(oa){this._currentRenderer=oa;this.notifyChange("rendererTextureUsage");this._rendererVersion=Ea.addWraparound(this._rendererVersion,1);this._opacityVariable=this._colorVariable=this._rendererFields=null;this._invalidateAllSymbols();oa&&(this._rendererFields=await oa.getRequiredFields(this.i3slayer.fieldsIndex));this._updateSymbologyFields();!this._arcade&&oa&&"arcadeRequired"in oa&&oa.arcadeRequired&&(this._arcade=await Z.loadArcade());if(oa&&"visualVariables"in oa&&oa.visualVariables)for(const Fa of oa.visualVariables)"color"===
Fa.type?this._colorVariable=Fa:"opacity"===Fa.type?this._opacityVariable=Fa:d.getLogger("esri.views.3d.layers.I3SMeshView3D").warn(`Unsupported visual variable type for 3D Object Scene Services: ${Fa.type}`);if(oa)for(const Fa of oa.getSymbols())"mesh-3d"!==Fa.type&&d.getLogger("esri.views.3d.layers.I3SMeshView3D").error(`Symbols of type '${Fa.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(oa){this._hasComponentData&&
oa.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(oa);return oa.cachedEdgeMaterials}_getComponentParameters(oa){this._hasComponentData&&oa.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(oa);const Fa=oa.cachedSymbology;return(Va,Za)=>{const fb=5*Va;N.set(Za.externalColor,Fa[fb]/255,Fa[fb+1]/255,Fa[fb+2]/255,Fa[fb+3]/255);if(null!=this._stage.renderView.objectAndLayerIdRenderHelper){const kb=oa.featureIds[Va],mb=ca.isBasemapLayer(this.view.map,
this.layerUid);this._stage.renderView.objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(kb,kb,this.layerId,this.layerUid+"_"+this.sublayerId,this.layerPopupEnabledAndHasTemplate&&!mb,oa.node.resources.attributes,Va,this.sublayerId);Za.objectAndLayerIdColor=this._stage.renderView.getObjectAndLayerIdColor({graphicUid:kb,layerUid:this.layerUid+"_"+this.sublayerId})}Za.externalColorMixMode=Fa[fb+4]&(1<<ub.CastShadows)-1;Za.castShadows=0!==(Fa[fb+4]&1<<ub.CastShadows);Za.pickable=0!==(Fa[fb+4]&1<<
ub.Pickable);Za.elevationOffset=oa.elevationOffsets?.[Va]??0}}_getSymbolInfo(oa,Fa){Fa=oa?.getSymbol(Fa,{arcade:this._arcade});if(!(Fa instanceof da))return null;oa=Fa.id;if(this._symbolInfos.has(oa))return this._symbolInfos.get(oa);Fa=Ea.getSymbolInfo(Fa);this._symbolInfos.set(oa,Fa);return Fa}_setSymbologyOverride(oa,Fa){this._symbologyOverride!==oa&&(this._symbologyOverride=oa,this._symbologyOverrideFields=Fa,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=
null!=this._symbologyOverrideFields&&0<this._symbologyOverrideFields.length?null!=this._rendererFields&&0<this._rendererFields.length?ha.fixFields(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(oa){oa.cachedRendererVersion=this._rendererVersion;if(this._hasComponentData){var Fa=this._tmpAttributeOnlyGraphic,Va={};Fa.attributes=Va;var Za=this._currentRenderer,fb=oa.attributeInfo?.attributeData,
kb=null!=oa.featureIds?this.i3slayer.objectIdField:null,mb=null!=fb&&null!=this._symbologyFields&&0<this._symbologyFields.length,rb=null,tb=null;if(mb&&null!=this._symbologyFields){rb=[];tb=[];for(var yb of this._symbologyFields){var zb=fb[yb];zb&&(rb.push(yb),tb.push(zb))}}oa.cachedSymbology||(oa.cachedSymbology=V.newUByteArray(5*oa.featureIds.length));fb={color:$b,castShadows:!0,pickable:!0,colorMixMode:Ha.ColorMixModeEnum.Multiply,edgeMaterial:null};yb=this.fullOpacity;yb=this.nodeCrossfadingEnabled?
this.getNodeOpacity(oa):yb;zb=null;var Ab=pa.Transparency.OPAQUE,Fb=Ea.transparentEdgeMaterial,Qb=0;for(let Hb=0;Hb<oa.featureIds.length;Hb++){null!=kb&&(Va[kb]=oa.featureIds[Hb]);if(mb&&rb)for(var sb=0;sb<rb.length;sb++)Va[rb[sb]]=Ea.getCachedAttributeValue(tb[sb],Hb);var vb=Za?this._getSymbolInfo(Za,Fa):null;let Tb=sb=null;if(Za&&"visualVariables"in Za){if(this._colorVariable){var Gb=U.getColor(this._colorVariable,Fa,{color:kc,arcade:this._arcade});Gb&&(sb=$b,sb[0]=Gb.r/255,sb[1]=Gb.g/255,sb[2]=
Gb.b/255,this._opacityVariable||null===Gb.a||(Tb=Gb.a))}this._opacityVariable&&(Tb=U.getOpacity(this._opacityVariable,Fa,{arcade:this._arcade}))}vb?.material&&(Gb=vb.material,sb=null==sb||null==Tb?la.overrideColor(sb,Tb,Gb.color,Gb.alpha,nb,$b):la.overrideColor(sb,Tb,null,null,nb,$b));null==sb&&(sb=$b,sb[0]=1,sb[1]=1,sb[2]=1,sb[3]=1);fb.pickable=!0;fb.castShadows=vb?vb.castShadows:!0;fb.colorMixMode=vb?.material?vb.material.colorMixMode:Ha.ColorMixModeEnum.Multiply;fb.edgeMaterial=vb?vb.edgeMaterial:
null;null!=this._symbologyOverride&&(fb.color=sb,this._symbologyOverride(Fa,fb),sb=fb.color);null!=this._nodeColorOverride&&(this._nodeColorOverride(oa.node,sb),fb.colorMixMode=Ha.ColorMixModeEnum.Replace);if(null!=fb.edgeMaterial){vb=0>=sb[3]?pa.Transparency.INVISIBLE:1<=sb[3]&&(oa.material.isOpaque||fb.colorMixMode===Ha.ColorMixModeEnum.Replace)?pa.Transparency.OPAQUE:pa.Transparency.TRANSPARENT;if(fb.edgeMaterial!==zb||vb!==Ab)Fb={...fb.edgeMaterial,opacity:yb,objectTransparency:vb},zb=fb.edgeMaterial,
Ab=vb;oa.cachedEdgeMaterials[Hb]=Fb}else oa.cachedEdgeMaterials[Hb]=Ea.transparentEdgeMaterial;oa.cachedSymbology[Qb++]=Math.round(255*sb[0]);oa.cachedSymbology[Qb++]=Math.round(255*sb[1]);oa.cachedSymbology[Qb++]=Math.round(255*sb[2]);oa.cachedSymbology[Qb++]=Math.round(255*sb[3]);oa.cachedSymbology[Qb++]=fb.colorMixMode|+fb.castShadows<<ub.CastShadows|+fb.pickable<<ub.Pickable}}}_getFilteredEdgeMaterials(oa){var Fa=this._getCachedEdgeMaterials(oa);this.nodeCrossfadingEnabled||eb(Fa,this.fullOpacity);
const Va=oa.filteredIds;if(null==Va)return{hasEdges:Fa.some(kb=>kb!==Ea.transparentEdgeMaterial),perFeatureEdgeMaterials:Fa};let Za=0,fb=!1;Fa=Fa.map((kb,mb)=>{if(oa.featureIds[mb]!==Va[Za])return Ea.transparentEdgeMaterial;fb=fb||kb!==Ea.transparentEdgeMaterial;Za++;return kb});return{hasEdges:fb,perFeatureEdgeMaterials:Fa}}_updateComponentData(oa){if(this._hasComponentData){var Fa=oa.objectHandle;oa=this._getComponentParameters(oa);this._collection.setComponentData(Fa,oa);this._stage.renderView.requestRender()}}_reloadAll(oa=
this.elevationOffset){this._removeAllNodeDataFromStage(oa);null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(oa){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading();this._nodeId2Meta.forEach(Fa=>{null!=Fa&&(this._collection.updateMaterial(Fa.objectHandle,Va=>Va.objectOpacity=oa),eb(Fa.cachedEdgeMaterials,oa),this._updateEdgeRendering(Fa))})}_updateMaterial(oa){this._collection.updateMaterial(oa.objectHandle,Fa=>{Fa.commonMaterialParameters.hasSlicePlane=
this.slicePlaneEnabled;Fa.usePBR=this._usePBR;this._updateMaterialOverlay(Fa)})}_updateMaterialOverlay(oa){}_updateEngineObject(oa){this._updateComponentData(oa);this._applyFiltersToNode(oa);this._addOrUpdateEdgeRendering(oa);this._visibleGeometryChanged(oa,pb.UPDATE)}_slicePlaneEnabledChange(oa){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=oa);null!=this._labeler&&(this._labeler.slicePlaneEnabled=oa);this._nodeId2Meta.forEach(Fa=>{null!=Fa&&(this._collection.updateMaterial(Fa.objectHandle,
Va=>Va.commonMaterialParameters.hasSlicePlane=oa),this._updateEdgeRendering(Fa,!1))})}_updatePBR(oa){this._nodeId2Meta.forEach(Fa=>{null!=Fa&&this._collection.updateMaterial(Fa.objectHandle,Va=>Va.usePBR=oa)});this._hasLoadedPBRTextures=!0}get _usePBR(){return this._needsNormals&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(oa,Fa=!0){null!=this._edgeView&&this._edgeView.hasObject(oa.objectHandle)&&this._addOrUpdateEdgeRendering(oa,Fa)}_forAllNodes(oa){this._nodeId2Meta.forEach(oa)}_ignoreClientNodeOverriddenFeatures(oa){return this.i3sOverrides.hasGeometryChanges?
(Fa,Va,Za)=>0<=Za.node.index&&this.i3sOverrides.featureHasGeometryChanges(Fa)?X.ForAllFeaturesReturnType.CONTINUE:oa(Fa,Va,Za):oa}_forAllFeatures(oa,Fa,Va){t.someMap(this._nodeId2Meta,Za=>{if(null==Za)return!1;if(null!=Fa)switch(Fa(Za)){case X.ForAllFeaturesReturnType.EXIT:return!0;case X.ForAllFeaturesReturnType.SKIP:return!1}let fb=X.ForAllFeaturesReturnType.CONTINUE;switch(Va){case X.ForAllFeaturesMode.ALL:fb=this._forAllFeaturesOfNode(Za,oa);break;case X.ForAllFeaturesMode.VISIBLE_ONLY:fb=this._forAllVisibleFeaturesOfNode(Za,
oa);break;case X.ForAllFeaturesMode.QUERYABLE:fb=this._forAllQueryableFeaturesOfNode(Za,oa)}return fb===X.ForAllFeaturesReturnType.EXIT})}_forAllFeaturesOfNode(oa,Fa){let Va=X.ForAllFeaturesReturnType.CONTINUE;const Za=oa.featureIds;for(let fb=0;fb<Za.length&&(Va=Fa(Za[fb],fb,oa),Va!==X.ForAllFeaturesReturnType.EXIT);fb++);return Va}_forAllVisibleFeaturesOfNode(oa,Fa){let Va=X.ForAllFeaturesReturnType.CONTINUE;const Za=oa.featureIds;this._collection.forEachVisibleComponent(oa.objectHandle,fb=>{Va=
Fa(Za[fb],fb,oa);return Va===X.ForAllFeaturesReturnType.CONTINUE});return Va}_forAllQueryableFeaturesOfNode(oa,Fa){Fa=this._ignoreClientNodeOverriddenFeatures(Fa);if(null==this._renderClippingArea)return this._forAllFeaturesOfNode(oa,Fa);var Va=this._boundingRectNodeTest(oa,this._renderClippingArea);if(Va===Ea.MbsIntersectResult.OUTSIDE)return X.ForAllFeaturesReturnType.CONTINUE;if(Va===Ea.MbsIntersectResult.INSIDE)return this._forAllFeaturesOfNode(oa,Fa);Va=X.ForAllFeaturesReturnType.CONTINUE;const Za=
oa.featureIds,fb=Ea.getClipRect(this._renderClippingArea,this._collection.getObjectTransform(oa.objectHandle));for(let kb=0;kb<Za.length;kb++){if(!this._boundingRectFeatureTest(oa,kb,fb))continue;const mb=Fa(Za[kb],kb,oa);if(mb===X.ForAllFeaturesReturnType.EXIT)return mb}return Va}_createAttributes(oa,Fa){const Va={};null!=Fa.featureIds&&(Va[this._getObjectIdField()]=Fa.featureIds[oa]);Fa=Fa.attributeInfo?.attributeData;if(null!=Fa)for(const Za of Object.keys(Fa))Va[Za]=Ea.getCachedAttributeValue(Fa[Za],
oa);return Va}_createGraphic(oa,Fa){return this._createLayerGraphic(this._createAttributes(oa,Fa))}highlight(oa){"number"===typeof oa?oa=[oa]:oa instanceof p?oa=[oa]:oa instanceof c&&(oa=oa.toArray());if(Array.isArray(oa)&&0<oa.length){if(oa[0]instanceof p){const Fa=this.i3slayer.fieldsIndex,Va=this._getObjectIdField();oa=oa.map(kb=>wa.attributeLookup(Fa,kb.attributes,Va));const {set:Za,handle:fb}=this._highlights.acquireSet();this._highlights.setFeatureIds(Za,oa);return fb}if("number"===typeof oa[0]){const {set:Fa,
handle:Va}=this._highlights.acquireSet();this._highlights.setFeatureIds(Fa,oa);return Va}}return e.makeHandle()}resetHighlights(){w.destroyMaybe(this._highlights);this._highlights=new za({collection:this._collection,forAllFeatures:oa=>this._forAllFeatures(oa,null,X.ForAllFeaturesMode.ALL),forAllFeaturesOfNode:(oa,Fa)=>this._forAllFeaturesOfNode(oa,Fa)})}_visibleGeometryChanged(oa,Fa){if(this._elevationProvider){var Va=this.getNodeComponentObb(oa.node);Va&&this._elevationProvider.objectChanged(Va);
null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=n.schedule(()=>{this.emit("visible-geometry-changed");this._visibleGeometryChangedSchedulerHandle=null}));this._updateSnappingSources(oa,Fa)}}get performanceInfo(){return new ka.I3SMeshViewPerformanceInfo(this.usedMemory,this._nodeId2Meta.size,Math.round(this._gpuMemoryEstimate/1048576),Math.round(this._geoMemoryEstimate/1048576),Math.round(this._texMemoryEstimate/1048576),Math.round(this.unloadedMemory/
1048576),this._idbCacheEnabled?Math.round(100*this._idbCache.getHitRate()):0)}get test(){}getNodeOpacityByIndex(oa){oa=this._nodeId2Meta.get(oa);return this.getNodeOpacity(oa)}getNodeOpacity(oa){return null!=oa?this._collection.getMaterial(oa.objectHandle).objectOpacity:0}isNodeFullyFadedIn(oa){return this._crossfadeHelper.isNodeFullyFadedIn(oa)}getNodeCrossfadeMetaData(oa){return this._nodeId2Meta.get(oa)}markNodeToRemove(oa){this._controller&&this._controller.markNodeToRemove(oa)}removeMarkedNodes(){this._controller&&
this._controller.removeMarkedNodes()}foreachCrossfadeNode(oa){this._nodeId2Meta.forEach(oa)}fadeNode(oa,Fa,Va){if(this.nodeCrossfadingEnabled){var Za=this._nodeId2Meta.get(oa);null!=Za&&this._crossfadeHelper.fadeNode(oa,Za,Fa,Va)}}setNodeOpacityByIndex(oa,Fa){oa=this._nodeId2Meta.get(oa);null!=oa&&this._setNodeOpacity(oa,Fa)}_setNodeOpacity(oa,Fa){this._collection.updateMaterial(oa.objectHandle,Va=>Va.objectOpacity=Fa);this._setNodeEdgeOpacity(oa,Fa)}_setNodeEdgeOpacity(oa,Fa){null!=this._edgeView&&
oa.cachedEdgeMaterials&&(eb(oa.cachedEdgeMaterials,Fa),oa=oa.objectHandle,this._edgeView.hasObject(oa)&&this._edgeView.updateAllComponentOpacities(oa,Fa).catch(Va=>Ia(Va,this.i3slayer.title)))}get hasModifications(){return this._isIntegratedMesh&&null!=this._layerClippingArea||this._modifications&&0<this._modifications.length}updateNodeModificationStatus(oa){var Fa=oa.length;if(this.hasModifications&&!(0>=Fa)&&!0===this._i3sWasmLoaded){Fa=this.uid;var Va=Xa(oa);if(Va){ja.filterObbsForModificationsSync({context:Fa,
buffer:Va.buffer});const Za=new Float64Array(Va.buffer);oa.forAll((fb,kb)=>{kb=ja.interpretObbModificationResults(Za[kb]);fb.imModificationImpact=kb;kb!==Ga.NodeIMModificationImpact.Unmodified&&this._controller.invalidateGeometryVisibility(fb.index)})}}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||null!=this._labeler&&this._labeler.updating||
this._crossfadeHelper?.updating||this._i3sWasmLoaded instanceof Promise||0<this._asyncModuleLoading||null!=this._elevationTask&&this._elevationTask.running}trackSnappingSources(oa){const Fa={events:oa,fetchEdgeLocations:async(Va,Za,fb)=>{Va=this._nodeId2Meta.get(Va);if(null==Va)throw Error("invalid-node");const {origin:kb,buffer:mb}=await this._collection.extractEdgeInformation(Va.objectHandle,Za,fb);this._snappingLocationsApplyElevation(Va,mb,kb);return{type:"components",objectIds:Va.featureIds,
locations:mb,origin:kb}},remove:()=>h.removeUnordered(this._snappingSourcesTrackers,Fa)};this._snappingSourcesTrackers.push(Fa);this._nodeId2Meta.forEach((Va,Za)=>{null!=Va&&(Va=this._controller.getRenderMbs(Va.node))&&oa.add(Za,Va)});return Fa}_snappingLocationsApplyElevation(oa,Fa,Va){if(oa.elevationOffsets&&this.elevationInfo.mode!==X.ElevationMode.Absolute){var Za=Fa.position0,fb=Fa.position1;Fa=Fa.componentIndex;var kb=H.create(),mb=H.create(),rb=(tb,yb)=>{F.add(tb,tb,Va);this.view.renderCoordsHelper.worldUpAtPosition(tb,
mb);F.add(tb,tb,F.scale(mb,mb,yb));F.subtract(tb,tb,Va)};for(let tb=0;tb<Za.count;tb++){const yb=oa.elevationOffsets[Fa.get(tb)];Za.getVec(tb,kb);rb(kb,yb);Za.setVec(tb,kb);fb.getVec(tb,kb);rb(kb,yb);fb.setVec(tb,kb)}}}_updateSnappingSources(oa,Fa){const {index:Va}=oa.node;oa=this._controller.getRenderMbs(oa.node);if(null!=oa)for(const Za of this._snappingSourcesTrackers)Fa!==pb.REMOVE&&Fa!==pb.UPDATE||Za.events.remove(Va),Fa!==pb.ADD&&Fa!==pb.UPDATE||Za.events.add(Va,oa)}};q.__decorate([x.property()],
lb.prototype,"_hasLoadedPBRTextures",void 0);q.__decorate([x.property()],lb.prototype,"_asyncModuleLoading",void 0);q.__decorate([x.property()],lb.prototype,"_visibleGeometryChangedSchedulerHandle",void 0);q.__decorate([x.property()],lb.prototype,"view",void 0);q.__decorate([x.property()],lb.prototype,"i3slayer",void 0);q.__decorate([x.property()],lb.prototype,"_controller",void 0);q.__decorate([x.property()],lb.prototype,"_labeler",void 0);q.__decorate([x.property()],lb.prototype,"updating",void 0);
q.__decorate([x.property()],lb.prototype,"suspended",void 0);q.__decorate([x.property()],lb.prototype,"contentVisible",null);q.__decorate([x.property({readOnly:!0})],lb.prototype,"legendEnabled",null);q.__decorate([x.property()],lb.prototype,"holeFilling",void 0);q.__decorate([x.property(qa.updatingProgress)],lb.prototype,"updatingProgress",void 0);q.__decorate([x.property()],lb.prototype,"updatingProgressValue",null);q.__decorate([x.property()],lb.prototype,"hasTexturesOrVertexColors",null);q.__decorate([x.property()],
lb.prototype,"rendererTextureUsage",null);q.__decorate([x.property()],lb.prototype,"elevationOffset",null);q.__decorate([x.property()],lb.prototype,"elevationInfo",null);q.__decorate([x.property({type:Boolean})],lb.prototype,"slicePlaneEnabled",void 0);q.__decorate([x.property()],lb.prototype,"supportedTextureEncodings",null);q.__decorate([x.property()],lb.prototype,"uncompressedTextureDownsamplingEnabled",null);q.__decorate([x.property({type:[ba]})],lb.prototype,"_modifications",void 0);q.__decorate([x.property({readOnly:!0})],
lb.prototype,"clientGeometry",null);q.__decorate([x.property()],lb.prototype,"elevationRange",null);q.__decorate([x.property()],lb.prototype,"fullExtent",null);q.__decorate([x.property()],lb.prototype,"_elevationTask",void 0);q.__decorate([x.property({readOnly:!0})],lb.prototype,"_usePBR",null);return lb=q.__decorate([y.subclass("esri.views.3d.layers.I3SMeshView3D")],lb)};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/projection/localLinearScaleFactors":function(){define(["exports",
"../../chunks/vec32","./projectors","../support/Ellipsoid","../support/spatialReferenceUtils"],function(a,b,q,l,p){a.localLinearScaleFactors=function(k,h,f,c){if(null==h||null==c)return!1;const e=q.classifySpatialReference(h,q.sourceClassificationCache);var g=q.classifySpatialReference(c,q.destClassificationCache);if(e===g&&e!==q.ProjectionID.UNKNOWN||p.equals(h,c))return f[0]=1,f[1]=1,f[2]=1,!0;if(e===q.ProjectionID.SPHERICAL_ECEF){h=b.length(k);k=h/Math.sqrt(k[0]*k[0]+k[1]*k[1]);h/=l.earth.radius;
if(g===q.ProjectionID.WEB_MERCATOR)return f[0]=k*h,f[1]=k*h,f[2]=1,!0;if(g===q.ProjectionID.WGS84||g===q.ProjectionID.CGCS2000)return g=q.invPlateCarreeScale,f[0]=g*k*h,f[1]=g*h,f[2]=1,!0}else if(e===q.ProjectionID.PLATE_CARREE){if(g===q.ProjectionID.WGS84||g===q.ProjectionID.CGCS2000)return f[0]=q.invPlateCarreeScale,f[1]=q.invPlateCarreeScale,f[2]=1,!0;if(g===q.ProjectionID.WEB_MERCATOR)return g=k[1]/l.earth.radius,f[0]=1,f[1]=1/Math.cos(g),f[2]=1,!0}return!1};Object.defineProperty(a,Symbol.toStringTag,
{value:"Module"})})},"esri/geometry/projection/projectBoundingSphere":function(){define(["exports","../../core/mathUtils","../../core/libs/gl-matrix-2/factories/vec3f64","./projectors","../support/Ellipsoid"],function(a,b,q,l,p){function k(e,g,d,t){g=t+g;if(g<t/2||d>g)return Number.MAX_VALUE;e=Math.abs(c*e)+Math.asin(d/g);return e>=Math.PI/2?Number.MAX_VALUE:d/Math.cos(e)}const h=q.create(),f=l.createEmptyProjectorCache(),c=b.deg2rad(1);a.projectBoundingSphere=function(e,g,d,t){if(null==g||null==
t)return!1;g=l.populateProjectorCache(g,t,f);if(g.projector===l.copy3)return d[0]=e[0],d[1]=e[1],d[2]=e[2],d[3]=e[3],!0;if(null==g.projector)return!1;const {source:w,dest:v}=g;if(v.spatialReferenceId===l.ProjectionID.WEB_MERCATOR){g=l.projectionTable[w.spatialReferenceId][l.ProjectionID.WGS84];if(null==g)return!1;g(e,0,h,0);l.wgs84ToWebMercator(h,0,d,0);d[3]=k(h[1],e[2],e[3],p.earth.radius);return!0}if(w.spatialReferenceId!==l.ProjectionID.WGS84&&w.spatialReferenceId!==l.ProjectionID.CGCS2000||v.spatialReferenceId!==
l.ProjectionID.PLATE_CARREE)g.projector(e,0,d,0),d[3]=e[3]*(w.metersPerUnit??1)/(v.metersPerUnit??1);else{t=l.projectionTable[l.ProjectionID.SPHERICAL_ECEF][l.ProjectionID.PLATE_CARREE];let m=e[3];null!=l.projectionTable[w.spatialReferenceId][l.ProjectionID.SPHERICAL_ECEF]&&null!=t&&(m=k(e[1],e[2],e[3],p.earth.radius));g.projector(e,0,d,0);d[3]=m}return!0};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/UByteArray":function(){define(["exports","../../core/typedArrayUtil"],
function(a,b){a.newUByteArray=function(q,l=!1){return q<=b.nativeArrayMaxSize?l?Array(q).fill(0):Array(q):new Uint8Array(q)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/controllers/I3SOnDemandController":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/has ../../../core/Logger ../../../core/PooledArray ../../../core/Promise ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/projection/projectBoundingRect ../../../geometry/support/aaBoundingRect ../../support/PromiseQueue ../../../views/ViewingMode ../../../views/3d/layers/i3s/I3SClientNodeLoader ../../../views/3d/layers/i3s/I3SFrameTask ../../../views/3d/layers/i3s/I3SIndex ../../../views/3d/layers/i3s/I3SLodHandling ../../../views/3d/layers/i3s/I3SNode ../../../views/3d/layers/i3s/I3SNodeLoader ../../../views/3d/layers/i3s/I3SStreamDataController ../../../views/3d/layers/i3s/I3SUtil ../../../views/3d/layers/i3s/I3SViewportQueries ../../../views/3d/layers/support/I3SLayerView ../../../views/3d/support/extentUtils ../../../views/3d/support/index ../../../views/3d/support/MemoryController ../../../views/support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N){function E(K,J){return null!=K&&K.length===J.length&&K.every(R=>0<=G(J,R.name))}function G(K,J){J=J.toLowerCase();for(let R=0;R<K.length;R++)if(K[R].name.toLowerCase()===J)return R;return-1}b=class extends k.EsriPromiseMixin(b){get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store?.lodType}get isGraphics3D(){return"points"===this.layer.profile}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&
(null==this.layer.priority||"High"===this.layer.priority)}get indexStreamController(){const K=this.layerView.view.resourceController.createStreamDataRequester(F.ClientType.I3S_INDEX);return new z.I3SStreamDataController(K,this.layer.customParameters,this.layer.apiKey)}get dataStreamController(){const K=this.layerView.view.resourceController.createStreamDataRequester(F.ClientType.I3S_DATA);return new z.I3SStreamDataController(K,this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return A.getVertexCrs(this.layer)}get crsIndex(){return A.getIndexCrs(this.layer)}get layer(){return this.layerView.i3slayer}get running(){return this.updating}get rootNodeVisible(){if(this._index){const K=
this._index.rootNode;if(K)return this._updateViewData(),this._index.isNodeVisible(K.index)}return!0}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(K){super(K);this.screenSizeFactor=0;this.featureTarget=5E4;this.fixedFeatureTarget=!1;this.updating=!0;this.updatingProgress=1;this.leavesReached=!1;this.worker=null;this._featureLOD=1;this._isIdle=this._stableFeatureLOD=!1;this._cameraDirty=!0;this._invisibleDirty=!1;this._idleStateCallbacks=null;this._newLoadingNodes=
new p({deallocator:null});this._modificationsNodeFilteringArray=new p;this._downloadingCount=0;this._loadingNodes=new Map;this._updatingNodes=new Map;this._progressMaxNumNodes=1;this._requiredAttributes=[];this._requiredAttributesDirty=!0;this._restartNodeLoading=this._disableMemCache=this.disableIDBCache=this._updatesDisabled=!1;this._attributeStorageInfo=this._fields=null;this._idleQueue=new w.PromiseQueue;this._elevationUpdateNodes=new p({deallocator:null});this._errorCount=0}initialize(){const {layerView:K,
layer:J}=this;this._disableMemCache=!K.loadCachedGPUData||!K.addCachedGPUData;this._lodHandling=new u(K);this._defaultGeometrySchema=J.store.defaultGeometrySchema;this.disableIDBCache=q("disable-feature:idb-cache");"fields"in J&&(this._fields=J.fields,this._attributeStorageInfo=J.attributeStorageInfo);this.addResolvingPromise(Promise.all([J.indexInfo,J.when(),K.when()]).then(([R])=>{if(!this.destroyed&&K&&!K.destroyed&&R){var {view:Q,clientGeometry:W}=K,{resourceController:S}=Q;this._setClippingArea(Q.clippingArea);
this.addHandles([f.watch(()=>Q?.pointsOfInterest?.focus?.renderLocation,V=>this._pointOfInterestChanged(V),f.initial),f.watch(()=>Q.quality,()=>this._setCameraDirty(),f.sync),f.watch(()=>K.contentVisible,V=>{const T=V?()=>this._updateIdleState(!0):()=>this._updateViewData(),Y=V?()=>this._updateIdleState(!1):()=>{};V&&null!=this._index&&this._index.invalidateAllElevationRanges();this._idleStateCallbacks?(V||this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=T,this._idleStateCallbacks.idleEnd=
Y):this._idleStateCallbacks=S.scheduler.registerIdleStateCallbacks(T,Y)},f.initial),r.addCallback(K.view.resourceController.scheduler,this),f.watch(()=>K.uncompressedTextureDownsamplingEnabled,()=>this.restartNodeLoading()),f.watch(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty();this._stableFeatureLOD=!1}),f.watch(()=>Q.state?.contentCamera,()=>this._setCameraDirty()),f.watch(()=>J.elevationInfo,V=>this._elevationInfoChanged(V)),f.watch(()=>K.lodFactor,()=>this._setCameraDirty()),
f.watch(()=>K.availableFields,()=>this._requiredFieldsChange()),f.watch(()=>K.holeFilling,V=>null!=this._index&&(this._index.holeFilling=V))]);this._viewportQueries=new B(this.crsIndex,Q.renderCoordsHelper,Q.state.contentCamera,!Q.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?Q.basemapTerrain:Q.elevationProvider,v.viewingModeFromString(Q.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,
angleDependentLoD:.5>this._lod});this._clientNodeLoader=new m.I3SClientNodeLoader(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:Q.renderCoordsHelper.spatialReference,localMode:"local"===Q.viewingMode},Q.resourceController.memoryController,this.worker);this._index=new n.I3SIndex(v.viewingModeFromString(Q.viewingMode),J,R,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,l.getLogger(this),K.holeFilling,V=>K.isNodeLoaded(V),V=>K.isNodeReloading(V),V=>this._shouldLoadNode(V),
V=>this._enableFromGPUCache(V,x.NodeState.Leaf),V=>this._needsUpdate(V),()=>!this.indexStreamController.busy,V=>K.computeVisibilityObb?.(V)??null,K?.computeNodeFiltering?V=>K.computeNodeFiltering(V):void 0);this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D);this._index.imModificationsChanged(!!K.hasModifications);this._index.layerFilterChanged(!!K.hasGeometryFilter);if(null!=W){for(const V of W)this._addMesh(V.mesh,V.oid);this.addHandles(W.on("change",
V=>{for(const T of V.removed)this._removeMesh(T.oid);for(const T of V.added)this._addMesh(T.mesh,T.oid)}))}this._startNodeLoading()}}))}updateNodeModificationStatus(K){const J=this._index,R=this.layerView;null!=J&&R?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),K.forAll(Q=>{Q=J.getNode(Q);null!=Q&&this._modificationsNodeFilteringArray.push(Q)}),R.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading();
this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null);this._nodeLoader=null;I.prune();null!=O&&(O.hide(),O=null)}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const K=this._attributeStorageInfo,J=this._fields,R=this.layer.objectIdField;return this.layerView.availableFields.map(Q=>{const W=G(K,Q);Q=G(J,Q);return 0<=W&&0<=Q?
{index:W,name:J[Q].name,field:J[Q],attributeStorageInfo:K[W]}:null}).filter(Q=>null!=Q&&Q.name!==R)}_requiredFieldsChange(){const K=this._getRequiredAttributes();E(this._requiredAttributes,K)||(this._requiredAttributes=K,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0;this.restartNodeLoading()}_setClippingArea(K){const J=t.create();D.toBoundingRect(K,J,this.layerView.view.renderSpatialReference)?this._clippingArea=J:this._clippingArea=null}_pointOfInterestChanged(K){null!=
this._viewportQueries&&(this._viewportQueries.setPointOfInterest(K),null!=this._index&&(this._index.progressiveLoadPenalty=L.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(K){this._setClippingArea(K);null!=this._viewportQueries&&null!=this._index&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache());this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0;this._lodHandling.setLodGlobalDirty();
this._evaluateUpdating()}_addMesh(K,J){null!=this._index&&(K=this._clientNodeLoader.createMeshNodeInfo(K,J),J=this._index.addClientNodeToIndex(K.id,K.mbs),this._clientNodeLoader.addMeshNode(J,K),this._evaluateUpdating(),this.notifyChange("rootNodeVisible"))}_removeMesh(K){K=this._clientNodeLoader.getMeshNodeIndex(K);if(null!=K)if(null!=this._index)this._index.removeClientNodeFromIndex(K,(J,R)=>{this.layerView.removeNode(R);this._clientNodeLoader.removeNode(J);this.layerView.deleteCachedNodeData&&
null!=J&&this.layerView.deleteCachedNodeData(J);this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(R))},(J,R,Q)=>{this._clientNodeLoader.updateNodeIndex(J,R,Q);this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(R,Q)}),this.notifyChange("rootNodeVisible");else throw Error("delayed removal of client side i3s node geometry not supported yet.");}updateElevationChanged(K,J){const R=this._index;if(null==R?.rootNode||null==J)return null;this.crsIndex.equals(J)||(d.projectBoundingRect(K,
J,P,this.crsIndex),K=P);const Q=this._elevationUpdateNodes;Q.clear();A.findIntersectingNodes(K,R.rootNode,R,W=>Q.push(W.index));Q.length&&(Q.forAll(W=>R.updateElevationChanged(W)),this._setCameraDirty());return Q}removeAllGeometryObbs(){null!=this._index&&this._index.removeAllGeometryObbs()}getRenderMbs(K){return null!=this._viewportQueries?this._viewportQueries.getServiceMbsInRenderSR(K):null}_elevationInfoChanged(K){null!=this._index&&(this._index.updateElevationInfo(K,this.isMeshPyramid||this.isGraphics3D),
this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0;this.cancelNodeLoading();this._evaluateUpdating()}schedule(K,J){return this._idleQueue.push(K,J)}reschedule(K,J){return this._idleQueue.unshift(K,J)}get _isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(K,J){return 0>K.index?this._clientNodeLoader.loadNodeData(K.id,
J):this._nodeLoader.loadNodeData(K,J)}async _loadAttributes(K,J,R){return(0>K.index?this._clientNodeLoader:this._nodeLoader).loadAttributes(K,J,R)}get indexDepth(){return null!=this._index?this._index.maxLevel:0}set disableMemCache(K){this._disableMemCache=this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData?K:!0}runTask(K,J){if(!this.layerView.contentVisible)return this._updateViewData(),this._evaluateUpdating(),-Infinity;if(!this.layerView.visible||null==this._index)return-Infinity;
this._processWithErrorLogging(K,J);return this._index.maxPriority}_processWithErrorLogging(K,J){try{this._process(K,J)}catch(R){50>this._errorCount?l.getLogger(this).error(`Error during processing: ${R} at ${R.stack}`):50===this._errorCount&&l.getLogger(this).error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(K,J){this._restartNodeLoading&&this._startNodeLoading();null!=this._nodeLoader&&null!=this._index&&(this._updateViewData(),this._invisibleDirty&&
this._removeInvisibleNodes(K)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(K.enabled=!1),K.run(()=>this._processIndex(K)),this._updateFeatureLOD(),K.run(()=>this._processCache(K)),this._isIntegratedMesh&&(K.enabled=!0),K.run(()=>this._processNodes(K,J)),this._idleQueue.runTask(K),K.run(()=>this._prefetchIndex()),J.numIndexLoading+=this._index.indexLoading,J.numNodesLoading+=this._downloadingCount,K.run(()=>this._lodHandling.lodGlobalHandling(K)),this._evaluateUpdating())}_processIndex(K){if(null==
this._index)return!1;this._index.dirty&&(this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),K,J=>this.updateNodeModificationStatus(J)),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length)),K=this._index.featureEstimate.leavesReached,this._index.isLoading||K===this._get("leavesReached")||this._set("leavesReached",
K));return this._index.load()}_prefetchIndex(){return null==this._index||0<this._loadingNodes.size||0<this._index.updates.add.length?!1:this._index.prefetch()}_updateFeatureLOD(){if(this.useMaximumNumberOfFeatures&&null!=this._index&&null!=this._viewportQueries){var K=!this._index.isLoading,J=this.featureTarget*this._baseLOD,R=this._index.featureEstimate;R.estimate=R.estimate||J/2;if(500<this._index.indexMissing){if(1E-4>=this._featureLOD)return;this._featureLOD/=1.5;this._stableFeatureLOD=!1}else if(K&&
R.estimate<J){if(R.leavesReached||1E4<=this._featureLOD||this._stableFeatureLOD)return;this._featureLOD*=Math.min(10,Math.max(J/R.estimate,1.001));K=this._lod;J=this._index.checkFeatureTarget(J,K);J!==K&&(this._featureLOD=J/this._baseLOD,this._stableFeatureLOD=!0)}else if(R.estimate>1.2*J||K&&R.estimate>J){if(1E-4>=this._featureLOD)return;this._featureLOD/=1+.25*(R.estimate/J-1);this._stableFeatureLOD=!1}else return;this._featureLOD=Math.min(1E4,Math.max(1E-4,this._featureLOD));this._viewportQueries.updateScreenSpaceErrorBias(this._lod);
this._index.requestUpdate()}}_processCache(K){const J=this._index;if(null==J)return!1;for(;0<this._newLoadingNodes.length&&!K.done;){var R=this._newLoadingNodes.pop();for(R=J.getParent(R);null!=R&&!this.layerView.isNodeLoaded(R.index);R=J.getParent(R.index))if(this._enableFromGPUCache(R,x.NodeState.Hole)){K.madeProgress();break}}return K.hasProgressed}_processNodes(K,J){if(null==this._index)return!1;let R=(this._isIdle?100:2)-this._loadingNodes.size;const Q=this._index.updates;Q.cancel.forEach(this._cancelNode,
this);for(Q.cancel=[];0<Q.remove.length&&!K.done;)this.layerView.removeNode(Q.remove.pop()),K.madeProgress();for(;0<Q.update.length&&!K.done;){var W=this._index.getNode(Q.update.pop());null!=W&&(this._updateLoadedNode(W),K.madeProgress())}for(;0<Q.add.length&&!K.done&&0<R;){--R;W=this._index.getNode(Q.add.back());if(null==W||W.cacheState!==x.CacheState.Cached&&!this._hasNodeLoadToken(J))break;Q.add.pop();this._loadNode(W);K.madeProgress()}return K.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach(K=>
K.abort());this._loadingNodes.clear();this._updatingNodes.forEach(K=>K.abort());this._updatingNodes.clear()}_cancelNode(K){const J=this._loadingNodes.get(K);J&&(J.abort(),this._loadingNodes.delete(K))}_hasNodeLoadToken(K){return!this._isIdle&&2<=K.numNodesLoading+this._loadingNodes.size?!1:this._downloadingCount<F.maxDownloadSlots&&!this.dataStreamController.busy}_evaluateUpdating(){let K=!1;var J=0;this.layerView&&(this.layerView.contentVisible?(J=(null!=this._index?this._index.indexMissing:0)+3*
(null!=this._index?this._index.updates.add.length:0)+2*this._loadingNodes.size,K=!!(0<J||0<this._updatingNodes.size||this._restartNodeLoading||this._cameraDirty||this._idleQueue.running||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||null!=this._index&&this._index.isPrefetching),0===J&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(J,this._progressMaxNumNodes),J=1-J/this._progressMaxNumNodes):J=(K=this._cameraDirty)?0:1,this.updating=K,this.updatingProgress=J)}_updateViewData(){if(this._cameraDirty&&
null!=this._index&&null!=this._viewportQueries){var K=this.layerView.view,{contentCamera:J,fixedContentCamera:R}=K.state;this.screenSizeFactor=1/(J.perScreenPixelRatio/2);this._viewportQueries.updateCamera(J,!R||this.isGraphics3D);this._viewportQueries.setPointOfInterest(K.pointsOfInterest.focus.renderLocation);this._viewportQueries.updateScreenSpaceErrorBias(this._lod);this._index.invalidateVisibilityCache();this._index.progressiveLoadPenalty=L.distancePenalty*this._viewportQueries.distCameraToPOI();
this._index.requestUpdate();this._stableFeatureLOD=!1;this._invisibleDirty=!0;this._cameraDirty=!1;this.notifyChange("rootNodeVisible")}}_getProgressiveLoadFactor(){return 1>this.layerView.view.quality?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const K=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(0<K?K:1)*this.layerView.view.quality}get _lodDropFactor(){return this.fixedFeatureTarget?1:(Math.min(this.layerView.view.quality,
.5)-H.minQuality)/(.5-H.minQuality)}isGeometryVisible(K){return!!this._index?.isGeometryVisible(K.index)}updateVisibility(K){this._index?.invalidateNodeVisibilityCache(K)}invalidateGeometryVisibility(K){this._index?.invalidateGeometryVisibility(K)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){this._index?.imModificationsChanged(!!this.layerView.hasModifications);this._invisibleDirty=!0}_shouldLoadNode(K){return this._lodHandling.shouldLoadNode(K)&&!this._shouldDropNode(K)&&
null!=this._index&&this._index.isGeometryVisible(K.index)?!0:!1}_shouldDropNode(K){if(null==this._viewportQueries)return!1;const J=this._lodDropFactor;return 1<=J||!this._lodHandling.hasNoVisibleChildren(K)?!1:Math.abs(this._viewportQueries.calcCameraDistanceToCenter(K))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*J}_startNodeLoading(){this._restartNodeLoading=!1;const K=this._index;if(!this._updatesDisabled&&null!=K&&null!=this._viewportQueries){this._updateViewData();
this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);var J={textureEncodings:this.layerView.supportedTextureEncodings,uncompressedTextureDownsamplingEnabled:this.layerView.uncompressedTextureDownsamplingEnabled,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new y(this.layer,this.dataStreamController,l.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,
J);K.requestUpdate();this._lodHandling.startNodeLoading((R,Q)=>this._removeNodes(R,Q,M.fadeout),K,{maxLodLevel:this._viewportQueries.maxLodLevel});this._evaluateUpdating()}}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(K){const J=this._index;
if(null==J||null==this._viewportQueries)return!1;I.clear();this.layerView.getLoadedNodeIndices(I);const R=0===this._viewportQueries.maxDistance,Q=R?()=>!1:W=>this._shouldDropNode(W);I.filterInPlace(W=>{const S=J.getNode(W);return null==S||!J.isGeometryVisible(W)||Q(S)});0<I.length&&this._lodHandling.setLodGlobalDirty();this._removeNodes(I,K,M.pop);if(R&&1>this._lodDropFactor)return!1;if(0===I.length)return!0;I.clear();return!1}markNodeToRemove(K){I.push(K)}removeMarkedNodes(){this._removeNodes(I,
N.noBudget,M.pop)}_removeNodes(K,J,R){if(0!==K.length&&!J.done)for(null!=this._index&&this._index.requestUpdate();0<K.length&&!J.done;){const Q=K.pop(),W=this._index;R===M.fadeout&&this.layerView.nodeFadeoutEnabled&&null!=W&&W.isGeometryVisible(Q)?this.layerView.fadeNode(Q,C.FadeDirection.FadeOut,!0):this.layerView.removeNode(Q);J.madeProgress()}}_needsUpdate(K){if(K.resources.isEmpty||this._updatingNodes.has(K.index))return!1;K=this.layerView.getLoadedAttributes(K.index);return null!=K&&K!==this._requiredAttributes}async _updateLoadedNode(K){const J=
new AbortController;this._updatingNodes.set(K.index,J);this._evaluateUpdating();try{const R=this.layerView.getLoadedAttributes(K.index);let Q=null;Q=E(R,this._requiredAttributes)?this.layerView.getAttributeData(K.index):await this._loadAttributes(K,this._requiredAttributes,J.signal);await this.schedule(()=>this.layerView.updateAttributes(K.index,{loadedAttributes:this._requiredAttributes,attributeData:Q},J.signal),J.signal)}catch(R){if(!h.isAbortError(R))return this.layerView.updateAttributes(K.index,
{loadedAttributes:this._requiredAttributes,attributeData:{}},J.signal)}this._updatingNodes.delete(K.index);this._evaluateUpdating()}_loadNode(K){if(this._loadingNodes.has(K.index))l.getLogger(this).error("already loading node "+K.index);else{var J=new AbortController;this._loadingNodes.set(K.index,J);this._evaluateUpdating();this._loadAndAddNode(K,J.signal).then(R=>{R&&null!=this._index&&this._loadingNodes.get(K.index)===J&&(this._loadingNodes.delete(K.index),this._index.requestUpdate())}).catch(R=>
{if(!h.isAbortError(R))throw R;}).finally(()=>{this._loadingNodes.get(K.index)===J&&this._loadingNodes.delete(K.index);this._evaluateUpdating()})}}_loadAndAddNode(K,J){return K.cacheState===x.CacheState.Uncached?this._loadUncached(K,J).then(()=>!1):this._loadCached(K,J).then(R=>{if(R)return!1;K.cacheState=x.CacheState.Uncached;return!0}).catch(R=>h.isAbortError(R)?!1:(K.cacheState=x.CacheState.Uncached,!0))}_enableFromGPUCache(K,J){if(this._disableMemCache||null==this._index)return!1;if(J===x.NodeState.Hole&&
!this._index.useNodeAsHole(K.index))return!0;const R=this._loadCachedGPUData(K);if(!R)return!1;this.layerView.addCachedGPUData(K,R,J);this._nodeAdded();return!0}_loadCachedGPUData(K){K=this.layerView.loadCachedGPUData(K.index);if(null!=K?.attributeInfo&&E(K.attributeInfo.loadedAttributes,this._requiredAttributes))return K;this.layerView.deleteCachedGPUData(K);return null}_nodeAdded(){null!=this._index&&this._index.requestUpdate();this._lodHandling.setLodGlobalDirty();this._evaluateUpdating()}updateLoadStatus(K,
J){const R=this._index;null!=R&&R.updateChildrenLoaded(K,J?1:-1)}async _loadCached(K,J){if(this._enableFromGPUCache(K,x.NodeState.Leaf))return!0;const R=this.layerView;if(this.disableIDBCache||!R.loadCachedNodeData||!R.addCachedNodeData)return!1;const Q=(ha,ba)=>this._nodeLoader.loadTextures(K,ha,ba),W=(ha,ba)=>this._clientNodeLoader.loadTextures(K,ha,ba),S=0<=K.index?Q:W,V=await this.schedule(()=>R.loadCachedNodeData(K,J,S),J);if(null==V)return!1;const T=this._requiredAttributes,Y=await this.reschedule(()=>
this._loadAttributes(K,T,J),J);await this.reschedule(()=>R.addCachedNodeData(K,V,{loadedAttributes:T,attributeData:Y},J),J);this._nodeAdded();return!0}_loadUncached(K,J){this._downloadingCount++;return this._loadNodeData(K,J).catch(R=>{this._downloadingCount--;throw R;}).then(R=>{this._downloadingCount--;return this.schedule(()=>this.layerView.addNode(K,R,J),J)}).then(()=>{this._nodeAdded();K.cacheState=x.CacheState.Cached}).catch(R=>{if(!h.isAbortError(R))throw l.getLogger(this).error("#loadNodeData()",
this.layer,`Failed to load node '${K.id}'`,R),K.failed=!0,null!=this._index&&this._index.requestUpdate(),R;})}_updateIdleState(K){K!==this._isIdle&&(this._isIdle=K,this._evaluateUpdating(),K&&this._index&&null!=this._index&&this._index.resetFailedNodes())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty();this._evaluateUpdating();null!=this._index&&this._index.requestUpdate()}geometryFilterChanged(K){const J=this._index;null!=J&&J.layerFilterChanged(K);this._setCameraDirty()}};a.__decorate([c.property({readOnly:!0})],
b.prototype,"isMeshPyramid",null);a.__decorate([c.property({readOnly:!0})],b.prototype,"isGraphics3D",null);a.__decorate([c.property({readOnly:!0})],b.prototype,"useMaximumNumberOfFeatures",null);a.__decorate([c.property({readOnly:!0})],b.prototype,"indexStreamController",null);a.__decorate([c.property({readOnly:!0})],b.prototype,"dataStreamController",null);a.__decorate([c.property({readOnly:!0})],b.prototype,"crsVertex",null);a.__decorate([c.property({readOnly:!0})],b.prototype,"crsIndex",null);
a.__decorate([c.property()],b.prototype,"screenSizeFactor",void 0);a.__decorate([c.property()],b.prototype,"featureTarget",void 0);a.__decorate([c.property()],b.prototype,"fixedFeatureTarget",void 0);a.__decorate([c.property()],b.prototype,"layerView",void 0);a.__decorate([c.property()],b.prototype,"layer",null);a.__decorate([c.property()],b.prototype,"updating",void 0);a.__decorate([c.property({readOnly:!0})],b.prototype,"running",null);a.__decorate([c.property()],b.prototype,"updatingProgress",
void 0);a.__decorate([c.property({readOnly:!0})],b.prototype,"leavesReached",void 0);a.__decorate([c.property({constructOnly:!0})],b.prototype,"worker",void 0);a.__decorate([c.property({readOnly:!0,dependsOn:[]})],b.prototype,"rootNodeVisible",null);b=a.__decorate([g.subclass("esri.layers.graphics.controllers.I3SOnDemandController")],b);const I=new p({deallocator:null});let O;const L={factorIM:.2,factor3dObject:.05,distancePenalty:10},P=t.create();var M;(function(K){K[K.pop=0]="pop";K[K.fadeout=1]=
"fadeout"})(M||={});return b})},"esri/views/3d/layers/i3s/I3SClientNodeLoader":function(){define("exports ../../../../core/Error ../../../../core/maybe ../../../../core/MemCache ../../../../core/promiseUtils ../../../../core/uuid ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/projectBoundingSphere ../../../../geometry/support/meshVertexSpaceUtils ../../../../chunks/sphere ./I3SClientMaterialUtil".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){async function v(x){return{id:x.id,version:x.meshNodeInfo.version,mbs:x.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null,isEmpty:!1}}function m(x,y){var {spatialReference:z}=x;const A=[1,-1],B=[.5*x.width,.5*x.height,x.hasZ?.5*(x.zmax-x.zmin):0];z=z.isGeographic?z.metersPerUnit:1;const C=x.center;let D=0;if(x.hasZ)for(x=0;2>x;++x)for(var F=0;2>F;++F)for(var H=0;2>H;++H){var N=(C.x+A[x]*B[0]-y.x)*z;const E=(C.y+
A[F]*B[1]-y.y)*z,G=C.z+A[H]*B[2]-y.z;D=Math.max(N*N+E*E+G*G,D)}else for(x=0;2>x;++x)for(F=0;2>F;++F)H=(C.x+A[x]*B[0]-y.x)*z,N=(C.y+A[F]*B[1]-y.y)*z,D=Math.max(H*H+N*N,D);return t.fromCenterAndRadius([y.x,y.y,y.z],Math.sqrt(D))}async function r(x,y,z,A){const {transform:B,vertexAttributes:C}=y.loadedMesh;x="source"===x.shading?C.normal:null;if(null==x||null==B||0===B.rotationAngle&&c.exactEquals(B.scale,e.ONES))return{transformed:x,original:C.normal};if(!y.normalsTransformPromise){q.assertIsSome(z,
"SceneLayerWorker is needed to transform mesh normals");const D=f.create();h.normalFromMat4(D,B.localMatrix);y.normalsTransformPromise=z.transformNormals({normalMatrix:D,normals:x},A)}return y.normalsTransformPromise}function n(x,y,z){x[y]=255&z;x[y+1]=255&z>>8;x[y+2]=255&z>>16;x[y+3]=255&z>>24}class u{constructor(x,y,z,A){this._uid=x;this._worker=A;this._id2Meta=new Map;this._oid2Meta=new Map;this._indexSR=y.indexSR;this._vertexSR=y.vertexSR;this._renderSR=y.renderSR;this._localMode=y.localMode;
this._memCache=z.newCache(`sl-client-mesh-data-${this._uid}`)}get uid(){return this._uid}get worker(){return this._worker}get indexSR(){return this._indexSR}get renderSR(){return this._renderSR}createMeshNodeInfo(x,y){const z=`mesh${y}`;var A=x.extent,B=A.spatialReference,C=this._indexSR;A=m(A,x.origin);g.projectBoundingSphere(A,B,A,C);C=x.metadata.displaySource?.source;if(null==C||!Array.isArray(C)||!C.length||C[0]instanceof File)B=k.generateUUID();else{B="";for(var D of C)B+=D.makeHash();D=JSON.stringify(x.transform?.toJSON()??
"");C=d.isRelativeVertexSpace(x.vertexSpace)?JSON.stringify(x.vertexSpace.origin):"";var F=JSON.stringify(x.spatialReference);B=B+D+C+F}return{type:"mesh",id:z,version:B,oid:y,mbs:A,componentNodeIds:[],unloadedMesh:x,nodeIndex:null,loadMeshPromise:null}}addMeshNode(x,y){if(null!=this.getMeshNodeIndex(y.oid))throw new b(`I3SClientNodeLoader: client side mesh for feature oid=${y.oid} already exists`);y.nodeIndex=x;this._id2Meta.set(y.id,y);this._oid2Meta.set(y.oid,y)}getMeshNodeIndex(x){x=this._oid2Meta.get(x);
return null==x||"mesh"!==x.type?null:x.nodeIndex}getMeshNodeInfo(x){const y=this._oid2Meta.values();for(const z of y)if("mesh"===z.type&&z.id===x)return z;return null}removeNode(x){const y=this._id2Meta.get(x);null!=y&&(this._id2Meta.delete(x),"mesh"===y.type&&this._oid2Meta.delete(y.oid))}async loadNodeJSON(x){const y=this._id2Meta.get(x);if(null==y)throw new b(`I3SClientNodeLoader::loadNodeJSON unable to find node ${x}`);switch(y.type){case "mesh":return this._loadMeshNodeJSON(y);case "mesh-component":return v(y);
default:throw new b(`I3SClientNodeLoader::loadNodeJSON unable to handle node ${x}`);}}async _loadMeshNodeJSON(x){const y=x.id;var z=(await this._getMeshData(x)).loadedMesh;if(null==z.components||0===z.components.length)return{id:y,version:null,mbs:x.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null};const A=[];z=z.components;for(let B=0;B<z.length;++B){const C=`${y}-component${B}`,D={type:"mesh-component",id:C,mbs:x.mbs,componentIndex:B,meshNodeInfo:x,
textureData:new Map};this._id2Meta.set(D.id,D);x.componentNodeIds.push(C);A.push({id:D.id,href:null,mbs:D.mbs,obb:null})}return{id:y,version:null,mbs:x.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:A}}updateNodeIndex(x,y,z){(x=this._id2Meta.get(x))&&"mesh"===x.type&&(x.nodeIndex=z)}async loadNodeData(x,y){var z=this._id2Meta.get(x);if(null==z||"mesh-component"!==z.type)throw new b(`Failed to load client node data for node ${x} (unexpected node info)`);
var A=z.meshNodeInfo,B=await this._getMeshData(A),C=B.loadedMesh;A=A.oid;if(null==C.components)throw new b(`Failed to load client node data for node ${x} (unexpected null reference)`);x=C.components[z.componentIndex];const {material:D,requiredTextures:F,textureData:H}=await w.convertMeshMaterialToPBRMaterial(x.material);if(null!=H)for(var N of H)null!=N&&z.textureData.set(N.id,N);z={params:{material:D},type:"ArrayBufferView"};const {vertexSpace:E,origin:G,transform:I}=C;N=[G.x,G.y,G.z??0];B.projectionPromise||
(q.assertIsSome(this._worker,"SceneLayerWorker is needed to project mesh"),B.projectionPromise=this._worker.project({positions:C.vertexAttributes.position,localMatrix:I?.localMatrix,vertexSpace:E.toJSON(),origin:N,inSpatialReference:C.spatialReference.toJSON(),outSpatialReference:this._vertexSR.toJSON(),localMode:this._localMode},y));const {projected:O,original:L,projectedOrigin:P}=await B.projectionPromise;C.vertexAttributes.position=L;const {transformed:M,original:K}=await r(x,B,this._worker,y);
C.vertexAttributes.normal=K;p.throwIfAborted(y);y=x.faces;B=C.vertexAttributes.uv;C=C.vertexAttributes.color;x=y.length/3;var J=3*x,R,Q=0;N=!1;var W=0;let S=!1;var V=0;let T=!1;var Y=0;let ha=0,ba=0;Q=R=8;R+=12*J;null!=M&&(N=!0,W=R,R+=12*J);null!=B&&(S=!0,V=R,R+=8*J);null!=C&&(T=!0,Y=R,R+=4*J);ha=R;ba=R+=8;R=new ArrayBuffer(R+8);const U=new Uint8Array(R);n(U,0,J);n(U,4,1);J=new Float32Array(R,Q);W=null!=M?new Float32Array(R,W):null;V=null!=B?new Float32Array(R,V):null;Y=null!=C?new Uint8Array(R,Y):
null;for(Q=0;Q<x;++Q){const ka=3*Q;for(let fa=0;3>fa;++fa){var Z=y[ka+fa],ca=3*Z,ea=9*Q+3*fa;J[ea]=O[ca];J[ea+1]=O[ca+1];J[ea+2]=O[ca+2];null!=W&&(W[ea]=M[ca],W[ea+1]=M[ca+1],W[ea+2]=M[ca+2]);null!=V&&(ca=2*Z,ea=6*Q+2*fa,V[ea]=B[ca],V[ea+1]=B[ca+1]);null!=Y&&(Z*=4,ca=12*Q+4*fa,Y[ca]=C[Z],Y[ca+1]=C[Z+1],Y[ca+2]=C[Z+2],Y[ca+3]=C[Z+3])}}n(U,ha,A);n(U,ha+4,A/2**32);n(U,ba,0);n(U,ba+4,x-1);const {geometryBuffer:da,geometryDescriptor:ia}={geometryBuffer:R,geometryDescriptor:{isDraco:!1,isLegacy:!0,color:T,
normal:N,uv0:S,uvRegion:!1,featureIndex:!0}};return{geometryData:{featureDataPosition:P,featureIds:[],geometries:[z]},attributeDataInfo:{attributeData:{},loadedAttributes:[]},geometryBuffer:da,geometryDescriptor:ia,requiredTextures:F,textureData:H,normalReferenceFrame:this._vertexSR.isGeographic?"east-north-up":"vertex-reference-frame"}}async loadAttributes(x,y,z){x=x.numFeatures;z={};for(const {field:{name:A}}of y)z[A]=Array(x);return z}async loadTextures(x,y,z){z=this._id2Meta.get(x.id);if(null==
z||"mesh-component"!==z.type)throw Error(`Failed to load textures for node ${x.id} (unexpected node info)`);x=[];for(const A of y)x.push(z.textureData.get(A.id)||null);return x}async _getMeshData(x){const y=x.version,z=this._memCache.get(y);if(null==z){if(null!=x.loadMeshPromise)return x.loadMeshPromise;const A=async(B,C)=>{var D=x.unloadedMesh.clone();try{await D.load()}catch(F){C(F)}C=D.memoryUsage;D={loadedMesh:D,projectionPromise:null,normalsTransformPromise:null,usedMemoryInBytes:C};this._memCache.put(y,
D,C,l.MinPriority);x.loadMeshPromise=null;B(D)};x.loadMeshPromise=new Promise((B,C)=>A(B,C));return x.loadMeshPromise}return z}}a.I3SClientNodeLoader=u;a.createSphereFromExtent=m;a.sizeOfFloat32=4;a.sizeOfInt32=4;a.sizeOfUInt64=8;a.sizeOfUInt8=1;a.transformNormals=r;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SClientMaterialUtil":function(){define("exports ../../../../Color ../../../../core/Error ../../../../support/requestUtils ../../glTF/internal/resourceUtils ./enums ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/textureUtils ../../webgl-engine/materials/pbrUtils".split(" "),
function(a,b,q,l,p,k,h,f,c){async function e(g,d,t,w){if(null==g)return-1;const v=t.length;var m=g.data;g=g.url;if(null!=m){if(m instanceof HTMLImageElement||m instanceof HTMLCanvasElement)return m=f.downsampleImage(m),t.push({id:v,usage:w,data:m,encoding:k.TextureEncoding.PNG,downsampled:!1}),d.push({id:v,usage:w,encodings:[{name:void 0,encoding:k.TextureEncoding.PNG}]}),v;if(!(m instanceof HTMLVideoElement)){if(m instanceof ImageData)throw new q("ImageData textures not supported yet for client side I3S nodes");
if(m instanceof p.EncodedMeshTexture)throw new q("EncodedMeshTexture textures not supported yet for client side I3S nodes");}}else if(null!=g)return m=new Image,m.src=g,m=await l.loadImageAsync(m,m.src,!1,void 0),m=f.downsampleImage(m),t.push({id:v,usage:w,data:m,encoding:k.TextureEncoding.PNG,downsampled:!1}),d.push({id:v,usage:w,encodings:[{name:void 0,encoding:k.TextureEncoding.PNG}]}),v;return-1}a.convertMeshMaterialToPBRMaterial=async function(g){const d=[],t=[];if(null==g)return{material:{alphaMode:"opaque",
alphaCutoff:.1,doubleSided:!0,cullFace:0,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[1,1,1,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6000000238418579},wrapTextures:!1,hasParametersFromSource:!0},requiredTextures:d,textureData:t};const w=g.hasOwnProperty("metallicRoughnessTexture");"auto"===g.alphaMode&&console.warn('alphaMode "auto" not supported by I3S PBRMaterial - defaulting to "blend".');
const v=c.useSchematicPBR({normalTexture:g.normalTexture,emissiveTexture:w?g.emissiveTexture:null,emissiveFactor:w?b.toUnitRGB(g.emissiveColor):null,occlusionTexture:w?g.occlusionTexture:null,metallicRoughnessTexture:w?g.metallicRoughnessTexture:null,metallicFactor:w?g.metallic:null,roughnessFactor:w?g.roughness:null}),m=v?c.defaultSchematicMRRFactors[0]:w?g.metallic:0,r=v?c.defaultSchematicMRRFactors[1]:w?g.roughness:0;return{material:{alphaMode:"auto"===g.alphaMode?"blend":g.alphaMode,alphaCutoff:g.alphaCutoff,
doubleSided:g.doubleSided,cullFace:g.doubleSided?h.CullFaceOptions.None:h.CullFaceOptions.Back,normalTextureId:await e(g.normalTexture,d,t,k.TextureUsage.Normal),emissiveTextureId:w?await e(g.emissiveTexture,d,t,k.TextureUsage.Emissive):-1,occlusionTextureId:w?await e(g.occlusionTexture,d,t,k.TextureUsage.Occlusion):-1,emissiveFactor:w&&null!=g.emissiveColor?b.toUnitRGB(g.emissiveColor):[0,0,0],metallicRoughness:{baseColorFactor:null!=g.color?b.toUnitRGBA(g.color):[1,1,1,1],baseColorTextureId:await e(g.colorTexture,
d,t,k.TextureUsage.Color),metallicRoughnessTextureId:w?await e(g.metallicRoughnessTexture,d,t,k.TextureUsage.MetallicRoughness):-1,metallicFactor:m,roughnessFactor:r},wrapTextures:!0,hasParametersFromSource:v},requiredTextures:d,textureData:t}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/enums":function(){define(["exports"],function(a){a.TextureEncoding=void 0;(function(b){b[b.KTX2=1]="KTX2";b[b.Basis=2]="Basis";b[b.DDS_S3TC=4]="DDS_S3TC";b[b.PNG=8]="PNG";
b[b.JPG=16]="JPG";b[b.KTX_ETC2=32]="KTX_ETC2"})(a.TextureEncoding||(a.TextureEncoding={}));a.TextureUsage=void 0;(function(b){b[b.None=0]="None";b[b.Color=1]="Color";b[b.MetallicRoughness=2]="MetallicRoughness";b[b.Normal=4]="Normal";b[b.Occlusion=8]="Occlusion";b[b.Emissive=16]="Emissive";b[b.AlphaMask=32]="AlphaMask";b[b.ColorTextures=19]="ColorTextures";b[b.GeometryTextures=36]="GeometryTextures";b[b.GeometryTexturesPBR=44]="GeometryTexturesPBR";b[b.AllTextures=37]="AllTextures";b[b.AllTexturesPBR=
63]="AllTexturesPBR"})(a.TextureUsage||(a.TextureUsage={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SFrameTask":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/arrayUtils ../../../../core/handleUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/accessorSupport/decorators/subclass ../../../support/Scheduler".split(" "),function(a,
b,q,l,p,k,h,f,c,e){let g=class extends q{constructor(){super();this.referenceCount=0;this.callbacks=[];this.runIndex=0}get running(){return this.callbacks.some(w=>w.running)}runTask(w){this._sort();const v=this.callbacks,m={numIndexLoading:0,numNodesLoading:0};for(let r=0;r<v.length&&!w.done;++r)v[r].priority=v[r].runTask(w,m),this.runIndex=r}_sort(){const w=this.callbacks;let v=w.length;for(let m=this.runIndex;0<m;m--){const r=w[m-1];let n=m;for(;n<w.length&&r.priority<=w[n].priority&&(n!==v||r.priority<
w[n].priority);)w[n-1]=w[n],n++;w[n-1]=r;v=n-1}this.runIndex=0}add(w){this._sort();w.priority=Infinity;this.callbacks.unshift(w);this.notifyChange("running")}remove(w){l.removeUnordered(this.callbacks,w);this.runIndex=this.callbacks.length;this._sort();this.notifyChange("running")}};b.__decorate([k.property({readOnly:!0})],g.prototype,"running",null);g=b.__decorate([c.subclass("esri.views.3d.layers.i3s.I3SFrameTask")],g);class d{constructor(w,v){this.task=w;this.handle=v}}const t=new Map;a.addCallback=
function(w,v){let m=t.get(w);if(null==m){const r=new g,n=w.registerTask(e.TaskPriority.I3S_CONTROLLER,r);m=new d(r,n);t.set(w,m)}m.task.add(v);return p.makeHandle(()=>{null!=m&&(m.task.remove(v),0<m.task.callbacks.length||(t.delete(w),m.handle.remove(),m.task.destroy()),m=null)})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SIndex":function(){define("exports ../../../../core/has ../../../../core/PooledArray ../../../../core/promiseUtils ../../../../geometry/projection/projectBoundingSphere ../../../../chunks/sphere ../../../../support/featureFlags ./I3SNode ./I3SUtil ./ValidatedNode ../../support/ElevationRange ../../support/orientedBoundingBox".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){function t(E,G){return 0>E?-1:0<G?E/G|0:0}function w(E,G){return 0>E?-E-1:0===G?E:E%G}function v(E,G,I){return-1===G?-(E+1):0===I?E:G*I+E}function m(E){if(E)for(let G=0;G<E.length;G++)for(const I of A)if(I[0]===E[G].metricType)return{lodMetric:I[1],maxError:E[G].maxError};return{lodMetric:f.LodMetric.None,maxError:0}}function r(E){return Math.sqrt(4/Math.PI*E)}class n{constructor(E,G,I,O,L){this.childOffset=E;this.childCount=G;this.visibilityCache=I;this.ref=O;this.node=
L;this.useAsHole=0;this.filterImpact=f.NodeFilterImpact.NotChecked;this.traversalState=null;this.parent=-1}invalidateBounds(){this.node?.invalidateServiceBVsInRenderSR();this.ref?.invalidateServiceBVsInRenderSR()}}class u{constructor(E=[],G=[]){this.nodes=E;this.children=G;this.numNodesWithLoadedChildren=this.lastTraversed=0}}class x{get _useNodePages(){return 0<this._pageSize}constructor(E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y){this.viewingMode=E;this._layer=G;this._streamDataController=O;this._clientNodeLoader=
L;this._viewportQueries=P;this._logger=M;this.holeFilling=K;this._isLoaded=J;this._isReloading=R;this._isSelected=Q;this._enable=W;this._needsUpdate=S;this._canRequest=V;this._computeVisibilityObb=T;this._computeNodeFiltering=Y;this._dirty=!0;this._nodePages=new Map;this._clientNodePage=null;this._rootIndex=this._pageSize=0;this._lodMetric=f.LodMetric.None;this._lodConversion=ha=>ha;this._isEditable=!1;this._urlPrefix="";this._loadingNodes=new Set;this._loadingPages=new Set;this._failedNodes=new Set;
this._failedPages=new Set;this._indexMissing=1;this._maxUnloadedPrio=Number.NEGATIVE_INFINITY;this._maxProcessingPrio=Number.POSITIVE_INFINITY;this._version=c.addWraparound(0,2);this._visibilityCacheVersion=c.addWraparound(0,2);this._maxLevel=1;this._featureEstimate={estimate:0,leavesReached:!1};this._unloadedMemoryEstimate=0;this._missingPagesAndNodes=new q({deallocator:null});this._prefetchNodes=new q({deallocator:null});this._updates=new z(this._missingPagesAndNodes);this._imModificationUncategorized=
new q({deallocator:null});this.ignoreServiceObb=!1;this.progressiveLoadPenalty=0;this._pageQueue=[];this._newPages=[];this._layerHasFilter=this.layerHasModifications=this.needNodeElevationRange=!1;this._frameNumber=0;this._traverseDescendantsQueue=[0];this._traverseDescendantsNestingLevel=0;this._isEditable=h.i3sPatchingEnabled()&&null!=G.associatedLayer?.infoFor3D;G.serviceUpdateTimeStamp?.lastUpdate&&(this._lastUpdate=`${G.serviceUpdateTimeStamp.lastUpdate}`);this._maxLodLevel=this._viewportQueries?
this._viewportQueries.maxLodLevel:1;this._init(I)}_init(E){if("page"===E.type){var G=E.rootPage;this._urlPrefix=E.urlPrefix;this._pageSize=E.pageSize;switch(E.lodMetric){case "maxScreenThreshold":this._lodMetric=f.LodMetric.MaxScreenThreshold;break;case "maxScreenThresholdSQ":this._lodMetric=f.LodMetric.MaxScreenThreshold,this._lodConversion=r}if(this._isEditable){this._rootIndex=-1;var I=w(E.rootIndex,E.pageSize);I=G.nodes[I];I={nodes:[{index:this._rootIndex,children:[E.rootIndex],mesh:void 0,obb:I.obb,
lodThreshold:I.lodThreshold}]};this._addPage(t(this._rootIndex,this._pageSize),I);this.getNode(-1).serviceObbInIndexSR=void 0}else this._rootIndex=E.rootIndex;this._addPage(t(E.rootIndex,this._pageSize),G);this._updateParentsAndLevel()}else"node"===E.type&&(this._urlPrefix=E.urlPrefix,G=new u,this._nodePages.set(0,G),this._isEditable?(this._clientNodePage=new u,G={id:"-1",version:null,mbs:E.rootNode.mbs,obb:E.rootNode.obb,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:[{id:"root",
href:"../root",mbs:E.rootNode.mbs,obb:E.rootNode.obb}]},this._rootIndex=this._makeClientRefNode(new f.NodeBase(G.id,null),-1),(G=this._validateNode(G.id,G))&&this._addNode(G,this._rootIndex)):this._rootIndex=this._makeRefNode(new f.NodeBase(E.rootNode.id,null),-1),(E=this._validateNode(E.rootNode.id,E.rootNode))&&this._addNode(E,0))}addClientNodeToIndex(E,G){E=new f.NodeBase(E,G);E=this._makeClientRefNode(E,-1);this._linkChildToParentNode(-1,E);this.requestUpdate();return E}removeClientNodeFromIndex(E,
G,I){this._destroyClientRefNode(E,G,I);this.requestUpdate()}_loadPage(E){this._loadingPages.add(E);this._streamDataController.request(this._urlPrefix+E,"json").then(G=>{this._pageQueue.push({pageIndex:E,page:G})}).catch(G=>{this._loadingPages.delete(E);l.isAbortError(G)||(this._failedPages.add(E),this._logger.error("#loadPage()",this._layer,`Error when loading page ${E}`,G))})}_addQueuedPages(E){for(;0<this._pageQueue.length&&!E.done;){const {pageIndex:G,page:I}=this._pageQueue.shift();this._addPage(G,
I);this._loadingPages.delete(G);E.madeProgress();this.needNodeElevationRange&&this._newPages.push(G)}this._updateParentsAndLevel()}_invalidateElevationRangeForNewPages(E){if(this.needNodeElevationRange)for(;0<this._newPages.length&&!E.done;)this._nodePages.get(this._newPages.shift())?.nodes.forEach(G=>{for(G=G.parent;null!=G&&G!==this._rootIndex;){const I=this.getNode(G);I&&!Number.isNaN(I?.elevationRangeMin)&&(I.invalidateElevationRange(),this.invalidateBoundingVolumeCache(G));G=this.getParentIndex(G)}})}_addPage(E,
G){const I=[],O=[];G=G.nodes.map((L,P)=>{const M=I.length,K=L.children?L.children.length:0;O.push(this._rootIndex);for(var J=0;J<K;J++)I.push(L.children[J]);const R=`${L.index}`;J=d.Obb.fromJSON(L.obb);const Q=k.fromCenterAndRadius(J.center,J.radius);var W=L.mesh?.attribute;const S=L.mesh?.geometry,V=L.mesh?.material;W={hasSharedResource:!1,isEmpty:null==S,attributes:null!=W?.resource?`${W.resource}`:void 0,geometry:null!=S?.resource?`${S.resource}`:void 0,texture:null!=V?.resource?`${V.resource}`:
void 0,geometryDefinition:S?S.definition:-1,materialDefinition:V?V.definition:-1};L=new f.Node(R,v(P,E,this._pageSize),Q,K,0,W,this._lastUpdate,this._lodMetric,this._lodConversion(L.lodThreshold),S?S.featureCount:null);L.serviceObbInIndexSR=J;L.visibilityObbInRenderSR=this._computeVisibilityObb(L);L.vertexCount=S?S.vertexCount:0;return new n(M,K,c.addWraparound(this._visibilityCacheVersion,-2),null,L)});G=new u(G,I);-1===E?this._clientNodePage=G:this._nodePages.set(E,G)}_updateParentsAndLevel(){const E=
[],G=(I,O,L)=>{var P=this._getPage(I);if(null!=P){const M=w(I,this._pageSize);P=P.nodes[M];P.parent=null!=O?O:-1;O=P.node;null!=O&&(O.level=L,E.push(I))}};for(G(this._rootIndex,null,0);E.length;){const I=E.pop(),O=this.getNode(I);if(null!=O)for(let L=0;L<O.childCount;L++){const P=this.getChildIndex(O.index,L);G(P,I,O.level+1);this._maxLevel=Math.max(this._maxLevel,O.level+1)}}}_getPage(E){E=t(E,this._pageSize);return this._getPageFromPageIndex(E)}_getPageFromPageIndex(E){return 0>E?this._clientNodePage:
this._nodePages.get(E)}_getNodeInternal(E){const G=this._getPage(E);if(null==G)return null;G.lastTraversed=this._frameNumber;return G.nodes[w(E,this._pageSize)]}_addNode(E,G){E.children&&this.populateChildren(G,E.children);var I=this.getParent(G);const O=null!=I?I.level+1:0;this._maxLevel=Math.max(this._maxLevel,E.children?O+1:O);const {lodMetric:L,maxError:P}=m(E.lodSelection);I=this._getNodeInternal(G);G=new f.Node(E.id,G,E.mbs,I.childCount,O,E.resources,E.version,L,P,E.numFeatures);I.node=G;E.obb&&
(G.serviceObbInIndexSR=d.Obb.fromJSON(E.obb));G.visibilityObbInRenderSR=this._computeVisibilityObb(G);I=I.ref;null!=I&&(null==I.serviceMbsInIndexSR&&(I.serviceMbsInIndexSR=E.mbs),G.shareServiceBVsInRenderSRWith(I),I.visibilityObbInRenderSR=G.visibilityObbInRenderSR);return G}_makeRefNode(E,G){const I=this._nodePages.get(0);if(-1>G)return this._makeClientRefNode(E,G);if(null==I)return-1;const O=I.nodes.length,L=new n(0,0,c.addWraparound(this._visibilityCacheVersion,-2),E,null);I.nodes.push(L);L.parent=
G;E.invalidateServiceBVsInRenderSR();return O}_makeClientRefNode(E,G){const I=this._clientNodePage;if(null==I)return-1;if(0<=G)throw Error("I3SIndex::client side nodes can not be made children of service side nodes.");const O=-(I.nodes.length+1),L=new n(0,0,c.addWraparound(this._visibilityCacheVersion,-2),E,null);I.nodes.push(L);L.parent=G;E.invalidateServiceBVsInRenderSR();return O}_linkChildToParentNode(E,G){const I=this._clientNodePage;if(!(null==I||0<=E)){var O=w(E,this._pageSize),L=w(G,this._pageSize);
O=I.nodes[O];var P=O.childOffset;I.children.splice(O.childOffset+O.childCount,0,G);O.childCount+=1;null!=O.node&&(O.node.childCount+=1);for(const M of I.nodes)M.childOffset>P&&(M.childOffset+=1);I.nodes[L].parent=E;this._updateParentBoundingInformation(E)}}_destroyClientRefNode(E,G,I){const O=this._clientNodePage;if(null!=O){var L=this.getParentIndex(E);if(null!=L){var P=new Set,M=new Map,K=ha=>{var ba=w(ha,this._pageSize);ba=O.nodes[ba];if(0<ba.childCount)for(var U=ba.childOffset;U<ba.childOffset+
ba.childCount;++U)K(O.children[U]);U=ba.node?.id??ba.ref?.id;if(null==U)throw Error("Node has no id");G(U,ha);P.add(ba)};K(E);E=O.nodes;var J=O.children,R=O.nodes.map(()=>-1),Q=[],W=[];for(var S=0;S<E.length;++S){var V=E[S];if(!P.has(V)){var T=Q.length,Y=v(S,-1,this._pageSize);T=v(T,-1,this._pageSize);V.node&&(V.node.index=T);R[S]=T;Q.push(V);if(Y!==T){V=V.node?.id??V.ref?.id;if(null==V)throw Error("Node has no id");I(V,Y,T);M.set(Y,T)}}}for(I=0;I<Q.length;++I){M=v(I,-1,this._pageSize);S=Q[I];Y=W.length;
for(V=S.childOffset;V<S.childOffset+S.childCount;++V)if(T=J[V],0<=T)W.push(T);else{T=w(T,this._pageSize);const ha=E[T];P.has(ha)||(W.push(R[T]),ha.parent=M)}S.childOffset=Y;S.childCount=W.length-Y;S.node&&(S.node.childCount=S.childCount)}O.nodes=Q;O.children=W;this._updateParentBoundingInformation(R[w(L,this._pageSize)])}}}_updateParentBoundingInformation(E){do{let O=null;var G=this._clientNodeLoader.indexSR;const L=this._clientNodeLoader.renderSR,P=this._getNodeInternal(E);if(null==P)break;for(let M=
0;M<P.childCount;M++){var I=this.getChildIndex(E,M);I=this._getNodeInternal(I);I=null!=I?I.ref||I.node:null;if(null!=I&&0<I.serviceMbsInIndexSR[3])if(null==O)O=k.copy(I.serviceMbsInIndexSR,C);else{const K=D,J=F,R=H;p.projectBoundingSphere(I.serviceMbsInIndexSR,G,K,L);p.projectBoundingSphere(O,G,J,L);k.union(K,J,R);p.projectBoundingSphere(R,L,O,G)}}G=P.ref||P.node;if(null!=G){if(null!=O){let M;(M=G).serviceMbsInIndexSR??(M.serviceMbsInIndexSR=k.create());k.copy(O,G.serviceMbsInIndexSR)}else c.invalidateMbs(G.serviceMbsInIndexSR);
G.invalidateServiceBVsInRenderSR();G.geometryObbInRenderSR=null}this.invalidateNodeVisibilityCacheInternal(P);E=this.getParentIndex(E)}while(null!=E)}populateChildren(E,G){var I=this._getNodeInternal(E);const O=this._getPage(E);I.childOffset=O.children.length;I.childCount=G.length;for(I=0;I<G.length;I++){const L=this._makeRefNode(G[I],E);O.children.push(L)}}getNode(E){E=this._getNodeInternal(E);return null!=E?E.node:null}getIndexById(E){let G;this._forAllNodes((I,O)=>{null!=I.node&&I.node.id===E?
G=O:null!=I.ref&&I.ref.id===E&&(G=O)});return G}getNodeById(E){E=this.getIndexById(E);return null!=E&&0<=E?this.getNode(E):null}getChildIndex(E,G){const I=this._getPage(E);if(null==I)return-1;E=I.nodes[w(E,this._pageSize)];return I.children[E.childOffset+G]}getParentIndex(E){const G=this._getPage(E);return null!=G&&E!==this._rootIndex?G.nodes[w(E,this._pageSize)].parent:null}getParent(E){E=this.getParentIndex(E);return null!=E?this.getNode(E):null}isLeaf(E){E=this._getNodeInternal(E);return null!=
E&&0===E.childCount}get rootNode(){return this.getNode(this._rootIndex)}get isEditable(){return this._isEditable}removeAllGeometryObbs(){this._forAllNodes(E=>{null!=E.node&&(E.node.geometryObbInRenderSR=null)})}invalidateVisibilityCache(){this._visibilityCacheVersion=c.addWraparound(this._visibilityCacheVersion,2)}invalidateNodeVisibilityCache(E){E=this._getNodeInternal(E);null!=E&&this.invalidateNodeVisibilityCacheInternal(E)}invalidateNodeVisibilityCacheInternal(E){E.visibilityCache=c.addWraparound(this._visibilityCacheVersion,
-2)}invalidateBoundingVolumeCache(E){E=this._getNodeInternal(E);null!=E&&(E?.invalidateBounds(),this.invalidateNodeVisibilityCacheInternal(E))}updateElevationChanged(E){const G=this._getNodeInternal(E);null!=G&&(this.needNodeElevationRange?(E=null!=G.node?G.node:G.ref,null!=E&&E.invalidateElevationRange()):this.invalidateBoundingVolumeCache(E))}invalidateGeometryVisibility(E){if(E=this._getNodeInternal(E)?.node)E.geometryObbInRenderSR=null,E.invalidateServiceBVsInRenderSR()}invalidateVisibilityObbs(){null!=
this.rootNode&&this.traverse(this.rootNode,E=>{E.visibilityObbInRenderSR=this._computeVisibilityObb(E);E.geometryObbInRenderSR=null;return!0})}_isElevationRangeUpToDate(E){return this.needNodeElevationRange?(E=E?.node??E?.ref)?E.elevationRangeValid:!0:!0}updateElevationRange(E){this._updateElevationRangeInternal(E,null)}_updateElevationRangeInternal(E,G){const I=this._getNodeInternal(E);if(!I)return!1;const O=I?.node??I?.ref;if(!O)return!1;if(O.elevationRangeValid)return G?.expandElevationRange(O),
!0;const L=new g.ElevationRange;var P=!1;for(let K=0;K<I.childCount;K++){var M=this.getChildIndex(E,K);M=this._updateElevationRangeInternal(M,L);P=P||!M}(0===I.childCount||P)&&this._viewportQueries.expandElevationRange(O,!I.node?.resources.isEmpty,L);P=O.elevationRangeMax;if(O.elevationRangeMin===L.elevationRangeMin&&P===L.elevationRangeMax)return G?.expandElevationRange(O),!0;I.node?.setElevationRange(L);I.ref?.setElevationRange(L);this.invalidateBoundingVolumeCache(E);G?.expandElevationRange(O);
return!0}isNodeVisible(E){const G=this._getNodeInternal(E);if(null==G)return!0;var I=G.ref;if(null!=I&&!I.serviceMbsInIndexSR)return!0;if(this._isElevationRangeUpToDate(G)&&(G.visibilityCache&-2)===this._visibilityCacheVersion)return 1===(G.visibilityCache&1);const O=G.node,L=this._viewportQueries;if(O){var P=L.ensureElevationAgnosticBoundingVolume(O),M=L.isElevationAgnosticBoundingVolumeVisible(P);let K=M;this.needNodeElevationRange&&M&&(M=L.getNodeObbInRenderSRIndependentOfElevationOffset(O),null!=
M&&(K=L.isObbVisibleIndependentOfElevation(P,M)));if(!K)return G.visibilityCache=this._visibilityCacheVersion+0,!1}this._layerHasFilter&&this._computeNodeFiltering&&(null!=O||null!=I)&&G.filterImpact===f.NodeFilterImpact.NotChecked&&(P=null!=O?O.serviceMbsInIndexSR:null!=I?I.serviceMbsInIndexSR:null,G.filterImpact=null!=P?this._computeNodeFiltering(P):f.NodeFilterImpact.Unmodified);P=null!=O&&G.filterImpact===f.NodeFilterImpact.Culled;if(P=!(null!=O&&O.imModificationImpact===f.NodeIMModificationImpact.Culled)&&
!P)I=!O||I&&!O.visibilityObbInRenderSR?I??null:O,null!=I&&(this.needNodeElevationRange&&this.updateElevationRange(E),P=L.isNodeVisible(I));G.visibilityCache=this._visibilityCacheVersion+(P?1:0);return P}isGeometryVisible(E){if(!this.isNodeVisible(E))return!1;E=this._getNodeInternal(E);return null==E?.node?.geometryObbInRenderSR||this.layerHasModifications&&E.node.imModificationImpact===f.NodeIMModificationImpact.NotChecked?!0:this._viewportQueries.isGeometryVisible(E.node)}_traverseCoverage(E,G,I,
O,L){E=this._getPage(E);if(null!=E&&0!==G.childCount){var P=G.childOffset+G.childCount,M=[];for(G=G.childOffset;G<P;++G){const K=E.children[G],J=this._getNodeInternal(K);null!=J?.node&&this.isGeometryVisible(K)&&M.push(J)}O/=M.length;for(const K of M)E=K.node.index,this._isLoaded(E)||this._isReloading(E)?(L.delta=Math.max(L.delta,I),L.coverage+=O):this._traverseCoverage(E,K,I+1,O,L)}}useNodeAsHole(E){if("off"===this.holeFilling)return!1;const G=this._getNodeInternal(E);if(null==G)return!1;if("always"===
this.holeFilling)return!0;if((G.useAsHole&-2)===this._version)return 1===(G.useAsHole&1);const I={delta:0,coverage:0};this._traverseCoverage(E,G,0,1,I);E=.5>=I.delta*I.coverage;G.useAsHole=this._version+(E?1:0);return E}get maxLevel(){return this._maxLevel}get dirty(){return this._dirty}destroy(){this._updates.add.prune();this._updates.update.prune()}requestUpdate(){this._dirty=!0;this._indexMissing=1;this._version=c.addWraparound(this._version,2)}imModificationsChanged(E){this.layerHasModifications=
E;this._forAllNodes(({node:G})=>{null!=G&&(G.imModificationImpact=f.NodeIMModificationImpact.NotChecked,G.visibilityObbInRenderSR=this._computeVisibilityObb(G),G.hasModifications&&this.invalidateGeometryVisibility(G.index))});this.invalidateVisibilityCache()}layerFilterChanged(E){this._layerHasFilter=E;this._forAllNodes(G=>{null!=G&&(G.filterImpact=f.NodeFilterImpact.NotChecked,G=G.node,null!=G&&this.invalidateNodeVisibilityCache(G.index))});this.invalidateVisibilityCache()}update(E,G,I){if(this._dirty){0<
this._pageQueue.length&&this._addQueuedPages(G);this._invalidateElevationRangeForNewPages(G);this._maxProcessingPrio=this._maxUnloadedPrio=Number.NEGATIVE_INFINITY;this._missingPagesAndNodes.clear();this._prefetchNodes.clear();this._updates.reset(E);y.clear();var O=!0,L=new B,P=new B,M=this._imModificationUncategorized;M.clear();var K=new Set,J=0;this.traverseVisible((R,Q,W)=>{var S=t(R,this._pageSize);if(null==Q)R=this._entryPriority(R),Infinity===R&&(R=this._entryPriority(W)),y.set(S,Math.max(R,
y.get(S)||0)),this._loadingPages.has(S)||this._failedPages.has(S)||(this._missingPagesAndNodes.push(S),++J),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,R);else{var V=Q.node;this._updateNodeFeatureEstimate(V,P);if(null==V)Q=this._entryPriority(R),this._loadingNodes.has(R)||this._failedNodes.has(R)||(this._missingPagesAndNodes.push(R),y.set(R,Q)),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,Q);else{W=this._getPage(R);if(0===this._missingPagesAndNodes.length&&!this._useNodePages)for(S=
0;S<Q.childCount;S++){const T=W.children[Q.childOffset+S],Y=this._getNodeInternal(T);null==Y||Y.node||this._loadingNodes.has(T)||this._failedNodes.has(T)||(y.set(T,this._entryPriority(T)),this._prefetchNodes.push(T))}V.failed||V.resources.isEmpty?O&&0<Q.childCount&&this._isSelected(V)&&(O=!1):this._isLoaded(R)?(L.known+=V.memory,++L.knownNodes,this._isSelected(V)?0<Q.childCount&&(O=!1):(L.unremoved+=V.memory,O=!1),this._needsUpdate(V)&&(Q=this._entryPriority(R),y.set(R,Q),this._maxProcessingPrio=
Math.max(this._maxProcessingPrio,Q),this._updates.update.push(R))):(V.memory&&(L.known+=V.memory,++L.knownNodes),this._isSelected(V)?(0<Q.childCount&&(O=!1),V.memory?(L.missing+=V.memory,L.known+=V.memory,++L.knownNodes):++L.missingNodes,E.includes(V.index)?(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,this._entryPriority(R)),this._updates.cancel=this._updates.cancel.filter(T=>T!==V.index)):!G.done&&this._enable(V)?G.madeProgress():(Q=this._entryPriority(R),y.set(R,Q),this._maxProcessingPrio=
Math.max(this._maxProcessingPrio,Q),this._updates.add.push(R),this.layerHasModifications&&I&&null!=V&&V.imModificationImpact===f.NodeIMModificationImpact.NotChecked&&M.push(R))):this._isReloading(R)&&this._updates.remove.push(R))}}},K);this._frameNumber++;this._missingPagesAndNodes.sort((R,Q)=>R-Q);this._missingPagesAndNodes.filterInPlace((R,Q)=>1>Q||this._missingPagesAndNodes.data[Q-1]!==R);this._missingPagesAndNodes.sort((R,Q)=>y.get(R)-y.get(Q));0<this._missingPagesAndNodes.length&&(this._maxUnloadedPrio=
y.get(this._missingPagesAndNodes.back()),this._prefetchNodes.clear());this._removeUnusedNodePages(K,J);K=this._updates.add;0<K.length&&this.layerHasModifications&&(0<M.length&&I?.(M),K.filterInPlace(R=>{var Q=this._getNodeInternal(R);(Q=null==Q?.node||Q.node.imModificationImpact!==f.NodeIMModificationImpact.Culled)||this.invalidateNodeVisibilityCache(R);return Q}));this._unloadedMemoryEstimate=L.missing-L.unremoved;3<L.knownNodes&&0<L.missingNodes&&(this._unloadedMemoryEstimate+=L.known/L.knownNodes*
L.missingNodes);this._unloadedMemoryEstimate=.8*Math.max(0,this._unloadedMemoryEstimate);this._featureEstimate.estimate=this._computeFeatureEstimate(P);this._featureEstimate.leavesReached=O;this._updates.add.filterInPlace(R=>y.get(R)>=this._maxUnloadedPrio).sort((R,Q)=>y.get(R)-y.get(Q));this._updates.update.sort((R,Q)=>y.get(R)-y.get(Q));this._indexMissing=this._loadingPages.size+this._loadingNodes.size+this._missingPagesAndNodes.length;this._dirty=0<this._indexMissing;y.clear()}}checkFeatureTarget(E,
G){const I=this._viewportQueries.updateScreenSpaceErrorBias(G);let O=G,L=G,P=I,M=10;for(;M--;){const K=new B;this._updateFeatureEstimate(O,K);if(this._computeFeatureEstimate(K)<=E){if(O>=G||0<K.missingNodes||0===M)break;P=O;O=.5*(O+L)}else L=O,O=.5*(O+P)}this._version=c.addWraparound(this._version,2);this._viewportQueries.updateScreenSpaceErrorBias(I);return Math.min(G,O)}_removeUnusedNodePages(E,G){if(this._useNodePages){var I=E.size,O=this._nodePages;G=O.size+this._loadingPages.size+G;if(G>N&&G>
I){I=[];for(const [L,P]of O)0!==P.numNodesWithLoadedChildren||E.has(L)||I.push([P.lastTraversed,L]);I.sort((L,P)=>L[0]-P[0]).some(L=>{this._deleteNodePage(L[1]);return O.size<=N})}}}_updateFeatureEstimate(E,G){this._version=c.addWraparound(this._version,2);this._viewportQueries.updateScreenSpaceErrorBias(E);this.traverseVisible((I,O)=>this._updateNodeFeatureEstimate(null!=O?O.node:void 0,G))}_updateNodeFeatureEstimate(E,G){null!=E&&!E.failed&&null!=E.numFeatures&&this._isSelected(E)&&(null!=E.numFeatures?
(G.missing+=E.numFeatures,G.known+=E.numFeatures,++G.knownNodes):++G.missingNodes)}_computeFeatureEstimate(E){let G=E.known-E.unremoved;3<E.knownNodes&&0<E.missingNodes&&(G+=E.known/E.knownNodes*E.missingNodes);return Math.max(0,G)}load(){return this._load(this._missingPagesAndNodes)}prefetch(){this._prefetchNodes.sort((E,G)=>y.get(E)-y.get(G));return this._load(this._prefetchNodes)}_load(E){if(0===E.length||!this._canRequest())return!1;for(;0<E.length&&this._canRequest();){const G=E.pop();this._useNodePages?
0<=G?this._loadPage(G):this._loadNode(G):this._loadNode(G)}return!0}get isLoading(){return 0<this._indexMissing}get isPrefetching(){return 0<this._prefetchNodes.length}get indexLoading(){return this._loadingPages.size+this._loadingNodes.size}get indexMissing(){return this._indexMissing}get unloadedMemoryEstimate(){return this._unloadedMemoryEstimate}get updates(){return this._updates}get featureEstimate(){return this._featureEstimate}get maxPriority(){return Math.max(this._maxProcessingPrio,this._maxUnloadedPrio)}nodeTraversalState(E){if(null==
E)return null;const G=E.index,I=this._getNodeInternal(G);if(!I)return null;let O=I?.traversalState;if(O&&(O.version&-2)===this._version)return O;const L=this._viewportQueries.getLodLevel(E),P=this._viewportQueries.hasLOD(E);let M=!0;P?(E=this.getParentIndex(G),null!=E?(E=this._getNodeInternal(E)?.traversalState,M=!!E&&L>E.lodLevel):M=0<L):M=0===E.childCount;if(O)return O.lodLevel=L,O.isChosen=M,O.version=this._version+1,O;O=new f.NodeTraversalState(P,M,L,this._version+1);return I.traversalState=O}async _loadNode(E){this._loadingNodes.add(E);
var G=this._getNodeInternal(E).ref;if(null==G)this._failedNodes.add(E);else{G=G.id;var I=this._urlPrefix+G,O=()=>{this._loadingNodes.delete(E);0===this._missingPagesAndNodes.length&&0===this._loadingNodes.size&&this.requestUpdate()},L=null;try{L=0<=E?await this._streamDataController.request(I,"json"):await this._clientNodeLoader.loadNodeJSON(G)}catch(P){O();l.isAbortError(P)||(this._logger.error("#loadNode()",this._layer,"Error loading node: "+I),this._failedNodes.add(E));return}O();G=this._validateNode(G,
L);null!=G&&(G.obb&&this.invalidateNodeVisibilityCache(E),G=this._addNode(G,E),this.nodeTraversalState(G))}}_validateNode(E,G){if(null==G||"object"!==typeof G||G.id!==E)return this._logger.error("#validateNode()",this._layer,`Invalid node. Wrong type or wrong id "${E}"`),null;if(!Array.isArray(G.mbs))return this._logger.error("#validateNode()",this._layer,`Invalid bounding volume on node ${E}.`),null;G.sharedResource&&"./shared"!==G.sharedResource.href&&"./shared/"!==G.sharedResource.href&&this._logger.warn("#validateNode()",
this._layer,`Invalid shared resource href on node "${E}"`);var I=G.geometryData;null==I||Array.isArray(I)&&0===I.length||Array.isArray(I)&&1===I.length&&"./geometries/0"===I[0].href||this._logger.warn("#validateNode()",this._layer,`Invalid geometry data on node "${E}"`);I=G.attributeData;const O=this._layer.attributeStorageInfo;null==I||Array.isArray(I)&&!I.some((K,J)=>K.href!==`./attributes/${O?.[J]?.key??`f_${J}`}/0`)||this._logger.warn("#validateNode()",this._layer,`Invalid attribute data on node "${E}"`);
G.featureData&&1<G.featureData.length&&this._logger.warn("#validateNode()",this._layer,`Node ${E} has ${G.featureData.length} bundles. Only the first bundle will be loaded.`);I=G.hasOwnProperty("obb")&&!this.ignoreServiceObb?G.obb:void 0;const L=G.featureData&&1===G.featureData.length&&G.featureData[0].featureRange?G.featureData[0].featureRange[1]-G.featureData[0].featureRange[0]+1:void 0;var P=K=>{if(null==K)return null;var J=R=>this._logger.error("#validateNode()",this._layer,`Invalid node reference on node ${E}: ${R}`);
if("number"===typeof K.id)J(`id ${K.id} is a number instead of a string.`);else if("string"!==typeof K.id||!Array.isArray(K.mbs))return J("Missing or invalid id."),null;if(!Array.isArray(K.mbs))return J(`Invalid bounding volume on reference ${K.id}.`),null;K.href&&K.href!=="../"+K.id&&this._logger.error("#validateNode()",this._layer,`Invalid node href on node "${E}"`);J=new f.NodeBase(`${K.id}`,K.mbs);J.serviceObbInIndexSR=!this.ignoreServiceObb&&K.hasOwnProperty("obb")&&K.obb?d.Obb.fromJSON(K.obb):
null;J.visibilityObbInRenderSR=this._computeVisibilityObb(J);return J};P=Array.isArray(G.children)?G.children.map(P).filter(K=>null!=K):null;const M=!0===G.isEmpty;return new e.ValidatedNode(E,G.mbs,I,"string"===typeof G.version?G.version:null,{isEmpty:!(G.featureData?.length??!1)&&M,hasSharedResource:null!=G.sharedResource,attributes:G.attributeData?E:void 0,texture:G.textureData&&0<G.textureData.length?E:void 0,geometry:null!=G.geometryData?E:void 0},P,Array.isArray(G.lodSelection)?G.lodSelection:
null,L)}resetFailedNodes(){this._failedNodes.clear();this._failedPages.clear();this._forAllNodes(E=>{null!=E.node&&(E.node.failed=!1)})}_entryPriority(E){var G=this._getNodeInternal(E),I=this.getParentIndex(E);if(null==G||null==I&&null==G.node)return null==I?Infinity:this._entryPriority(I);let O=0;G.node&&null!=I&&(I=this._getNodeInternal(I).traversalState,null!=I&&(O=I.lodLevel));for(I=this.progressiveLoadPenalty;null!=E;E=this.getParentIndex(E))if(this._isLoaded(E)){I=0;break}G=null!=G.ref?this._viewportQueries.distToPOI(G.ref):
null!=G.node?this._viewportQueries.distToPOI(G.node):0;return-G-O*(G+this.progressiveLoadPenalty)+I}traverseVisible(E,G){const I=this._getNodeInternal(this._rootIndex);null==I?E(this._rootIndex,null,null):this._traverseVisible(this._rootIndex,null,I,E,G)}_traverseVisible(E,G,I,O,L){var P=t(E,this._pageSize);L&&L.add(P);if(I.node&&0===I.childCount)this.isGeometryVisible(E)&&O(E,I,G);else if(this.isNodeVisible(E)&&(O(E,I,G),null!=I.node&&(G=this.nodeTraversalState(I.node),!G?.nodeHasLOD||G.lodLevel!==
this._maxLodLevel)))for(P=this._getPageFromPageIndex(P),G=0;G<I.childCount;G++){const K=P.children[I.childOffset+G];var M=this._getNodeInternal(K);M?this._traverseVisible(K,E,M,O,L):(L&&(M=t(K,this._pageSize),L.add(M)),O(K,null,E))}}traverse(E,G){G(E)&&this.traverseDescendants(E,G)}traverseDescendants(E,G){++this._traverseDescendantsNestingLevel;E=E.index;var I=this._pageSize,O=t(E,I),L=this._getPageFromPageIndex(O);if(null!=L){var P=this._frameNumber,M=this._nodePages;L.lastTraversed=P;E=w(E,I);
var K=L.nodes[E];({childCount:E}=K);if(0!==E){E=1===this._traverseDescendantsNestingLevel?this._traverseDescendantsQueue:[0];var J=0,R=[],{childOffset:Q,childCount:W}=K;({children:K}=L);E.length=2**Math.ceil(Math.log2(J+W));for(var S=Q;S<Q+W;++S){var V=K[S];0<=V?(E[J]=V,++J):R.push(V)}if(0<R.length&&(K=this._clientNodePage))for(S=K.children,V=0;V<R.length;){var T=R[V];++V;T=K.nodes[-T-1];var Y=T.node;if(Y&&G(Y)&&({childCount:Y}=T,0!==Y))for({childOffset:T}=T,Y=T+Y;T<Y;++T)R.push(S[T])}if(0<J)if(R=
0,0<I)for(O*=I,K=L.nodes;R<J;){V=E[R];++R;if(O<=V&&V<O+I)S=L;else{T=V/I|0;S=M.get(T);if(void 0===S)continue;S.lastTraversed=P;L=S;K=L.nodes;O=I*T}V=K[V-O];T=V.node;if(null!=T&&!1!==G(T)&&({childCount:T}=V,0!==T)){E.length<J+T&&(E.length=2**Math.ceil(Math.log2(J+T)));for(;E.length<J+T;)E.length+=E.length;S=S.children;({childOffset:V}=V);for(T=V+T;V<T;++V)E[J]=S[V],++J}}else if(I=M.get(0))for(;R<J;)if(P=E[R],++R,M=I.nodes[P],(P=M.node)&&G(P)&&({childCount:L}=M,0!==L))for(E.length=Math.max(E.length,
2**Math.ceil(Math.log2(J+L))),P=I.children,{childOffset:M}=M,L=M+L;M<L;++M)E[J]=P[M],++J;--this._traverseDescendantsNestingLevel}}}updateChildrenLoaded(E,G){for(E=this.getNode(E);null!=E;){var I=E.childrenLoaded;const O=I+G;E.childrenLoaded=O;I=0===I?1:0===O?-1:0;E=E.index;0!==I&&(this._getPage(E).numNodesWithLoadedChildren+=I);E=this.getParent(E)}}checkChildrenLoadedInvariant(){if(null==this.rootNode)return!0;const E=[],G=I=>{let O=this._isLoaded(I.index)||this._isReloading(I.index)?1:0;this.traverseDescendants(I,
L=>{O+=G(L);return!1});I.childrenLoaded!==O&&E.push(I.index);return O};G(this.rootNode);E.length&&this._logger.error("childrenLoaded invariant broken at following nodes: "+E.join(","));return 0<E.length}updateElevationInfo(E,G){this.needNodeElevationRange=G&&!!E&&("relative-to-ground"===E.mode||"relative-to-scene"===E.mode||"on-the-ground"===E.mode);this._viewportQueries.updateElevationInfo(E);this.invalidateAllElevationRanges()}invalidateAllElevationRanges(){this._forAllNodes(E=>{E?.invalidateBounds();
E.node?.invalidateElevationRange();E.ref?.invalidateElevationRange()})}_forAllNodes(E){if(null!=this._clientNodePage){var G=this._clientNodePage;for(var I=0;I<G.nodes.length;I++)E(G.nodes[I],-(I+1))}for(const [O,L]of this._nodePages)for(G=O*this._pageSize,I=0;I<L.nodes.length;I++)E(L.nodes[I],G+I)}clearCaches(){if(this._useNodePages){const E=this._nodePages,G=new Set;this.traverseVisible(I=>G.add(t(I,this._pageSize)));for(const [I,O]of E)if(0!==O.numNodesWithLoadedChildren||G.has(I))for(const L of O.nodes)L.traversalState=
null;else this._deleteNodePage(I)}}_deleteNodePage(E){this._nodePages.delete(E)}get test(){}}const y=new Map;class z{constructor(E){this.missing=E;this.update=new q({deallocator:null});this.add=new q({deallocator:null});this.remove=new q({deallocator:null});this.cancel=[]}reset(E){this.add.clear();this.update.clear();this.cancel=E}}const A=[["maxScreenThreshold",f.LodMetric.MaxScreenThreshold],["screenSpaceRelative",f.LodMetric.ScreenSpaceRelative],["removedFeatureDiameter",f.LodMetric.RemovedFeatureDiameter],
["distanceRangeFromDefaultCamera",f.LodMetric.DistanceRangeFromDefaultCamera]];class B{constructor(){this.unremoved=this.missingNodes=this.missing=this.knownNodes=this.known=0}}const C=k.create(),D=k.create(),F=k.create(),H=k.create(),N=b("esri-mobile")?100:300;a.I3SIndex=x;a.selectErrorMetric=m;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SNode":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/vec4f64","../../../../chunks/sphere",
"./I3SUtil","../../support/ElevationRange"],function(a,b,q,l,p){class k extends p.ElevationRange{constructor(c,e){super(NaN,NaN);this.id=c;this.serviceMbsInIndexSR=e;this.serviceMbsInRenderSR=q.fromValues(0,0,0,-1)}invalidateServiceBVsInRenderSR(){l.invalidateMbs(this.serviceMbsInRenderSR);this.serviceObbInRenderSR?.invalidate()}shareServiceBVsInRenderSRWith(c){this.serviceObbInRenderSR=c.serviceObbInRenderSR;this.serviceMbsInRenderSR=c.serviceMbsInRenderSR}}a.NodeFilterImpact=void 0;(function(c){c[c.Unmodified=
0]="Unmodified";c[c.Culled=1]="Culled";c[c.NotChecked=2]="NotChecked"})(a.NodeFilterImpact||(a.NodeFilterImpact={}));a.NodeIMModificationImpact=void 0;(function(c){c[c.Unmodified=0]="Unmodified";c[c.PotentiallyModified=1]="PotentiallyModified";c[c.Culled=2]="Culled";c[c.Unknown=3]="Unknown";c[c.NotChecked=4]="NotChecked"})(a.NodeIMModificationImpact||(a.NodeIMModificationImpact={}));class h extends k{constructor(c,e,g,d,t,w,v,m,r,n){super(c,g);this.index=e;this.childCount=d;this.level=t;this.resources=
w;this.version=v;this.lodMetric=m;this.maxError=r;this.numFeatures=n;this.failed=!1;this.cacheState=a.CacheState.Unknown;this.childrenLoaded=this.memory=this.vertexCount=0;this.hasModifications=!1;this.imModificationImpact=a.NodeIMModificationImpact.NotChecked;this.elevationAgnosticBoundingVolume=b.fromValues(0,0,0,-1)}invalidateServiceBVsInRenderSR(){super.invalidateServiceBVsInRenderSR();this.elevationAgnosticBoundingVolume[3]=-1}}a.CacheState=void 0;(function(c){c[c.Unknown=0]="Unknown";c[c.Uncached=
1]="Uncached";c[c.Cached=2]="Cached"})(a.CacheState||(a.CacheState={}));a.LodMetric=void 0;(function(c){c[c.None=0]="None";c[c.MaxScreenThreshold=1]="MaxScreenThreshold";c[c.ScreenSpaceRelative=2]="ScreenSpaceRelative";c[c.RemovedFeatureDiameter=3]="RemovedFeatureDiameter";c[c.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"})(a.LodMetric||(a.LodMetric={}));a.NodeState=void 0;(function(c){c[c.Hole=0]="Hole";c[c.Leaf=1]="Leaf"})(a.NodeState||(a.NodeState={}));class f{constructor(c,
e,g,d){this.nodeHasLOD=c;this.isChosen=e;this.lodLevel=g;this.version=d}}a.Node=h;a.NodeBase=k;a.NodeTraversalState=f;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/ValidatedNode":function(){define(["exports"],function(a){class b{constructor(q,l,p,k,h,f,c,e){this.id=q;this.mbs=l;this.obb=p;this.version=k;this.resources=h;this.children=f;this.lodSelection=c;this.numFeatures=e}}a.ValidatedNode=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/layers/i3s/I3SLodHandling":function(){define(["../../../../core/PooledArray","./I3SNode","../support/I3SLayerView"],function(a,b,q){class l{constructor(k){this._layerView=k;this._lodGlobalDirty=!1}startNodeLoading(k,h,f){this._maxLodLevel=f.maxLodLevel;this._index=h;this._removeNodes=k}shouldLoadNode(k){if(null==k)return!1;const h=this._index.nodeTraversalState(k);return this._isChosenMaxLOD(h)?!0:h.isChosen?this._childrenRequireLoading(k):!1}setLodGlobalDirty(){this._lodGlobalDirty=
!0}get requiresLODGlobalHandling(){return null!=this._index&&!0===this._lodGlobalDirty}lodGlobalHandling(k){if(!this.requiresLODGlobalHandling)return!1;this._lodGlobalDirty=!1;var h=Math.max(0,Math.floor(10*(this._layerView.view.resourceController.memoryController.usedMemory-1)));p.clear();this._lodGlobalHandling(this._index.rootNode,h,!1,!!this._layerView.nodeCrossfadingEnabled);h=p.length;this._removeNodes(p,k);k=p.length<h;0!==p.length&&(this._lodGlobalDirty=!0);p.clear();return k}_lodGlobalHandling(k,
h,f,c){if(null==k)return!1;const e=k.index,g=this._index,d=this._layerView;var t=g.nodeTraversalState(k);t=this._isChosenMaxLOD(t);var w=k.resources.isEmpty;if(t&&w)return 0<k.childrenLoaded&&this._removeChildrenRecursive(k),!0;w=d.isNodeLoaded(e);if(c&&w&&t){var v=!f&&this.hasNoVisibleChildren(k);d.fadeNode(e,q.FadeDirection.FadeIn,!v)}v=w&&(!d.isNodeFullyFadedIn||d.isNodeFullyFadedIn(e));if(w&&(d.updateNodeState(e,t?b.NodeState.Leaf:b.NodeState.Hole),t))return v&&this._removeChildrenRecursive(k),
v;var m=0<k.childCount;let r=m;if(m)for(m=0;m<k.childCount;m++){const n=g.getChildIndex(e,m),u=g.getNode(n);null!=u?g.isGeometryVisible(n)&&!this._lodGlobalHandling(u,h,f||v,c)&&(r=!1):g.isNodeVisible(n)&&(r=!1)}(h=w&&!t&&(r||p.length<h))&&p.push(e);!c||h||!w||f||r||d.fadeNode(e,q.FadeDirection.FadeIn,!1);k=k.resources.isEmpty;return r||v&&!h||k}_removeChildrenRecursive(k){this._index.traverseDescendants(k,h=>{(this._layerView.isNodeLoaded(h.index)||this._layerView.isNodeReloading(h.index))&&p.push(h.index);
return 0<h.childrenLoaded})}hasNoVisibleChildren(k){let h=!0;this._index.traverseDescendants(k,f=>h&&this._index.isNodeVisible(f.index)?this._layerView.isNodeLoaded(f.index)?h=!1:0<f.childrenLoaded:!1);return h}_childrenRequireLoading(k){let h=!1,f=!0;this._index.traverseDescendants(k,c=>{if(!f||!this._index.isNodeVisible(c.index))return!1;const e=this._index.nodeTraversalState(c);this._isChosenMaxLOD(e)&&this._index.isGeometryVisible(c.index)&&(h=!0);return this._layerView.isNodeLoaded(c.index)?
f=!1:0<c.childrenLoaded});return f&&h}_isChosenMaxLOD(k){return k.isChosen&&(!k.nodeHasLOD||k.lodLevel===this._maxLodLevel)}}const p=new a({deallocator:null});return l})},"esri/views/3d/layers/support/I3SLayerView":function(){define(["exports"],function(a){a.FadeDirection=void 0;var b=a.FadeDirection||(a.FadeDirection={});b[b.FadeIn=0]="FadeIn";b[b.FadeOut=1]="FadeOut";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SNodeLoader":function(){define("../../../../core/asyncUtils ../../../../core/has ../../../../core/lang ../../../../core/promiseUtils ../../../../core/urlUtils ./enums ./I3SBinaryReader ./I3SMaterialUtil".split(" "),
function(a,b,q,l,p,k,h,f){class c{constructor(e,g,d,t,w,v){this._streamDataController=g;this._logger=d;this._defaultGeometrySchema=t;this._requiredAttributes=w;this._options=v;this._logLayer=e;this._layerUrl=e.parsedUrl.path;this._geometryDefinitions=e.geometryDefinitions;if(e.materialDefinitions){const m=e.textureSetDefinitions;this._materialAndTextures=e.materialDefinitions.map(r=>f.getMaterialAndTextures(m,r,"integrated-mesh"===e.type))}}_load(e,g,d){return this._streamDataController.request(e,
g,d)}_loadAttribute(e,g,d){return this._load(`${this._layerUrl}/nodes/${e.resources.attributes}/attributes/${g.key}/0`,"binary",d).then(t=>h.readBinaryAttribute(g,t))}async loadAttributes(e,g,d){const t=await Promise.allSettled(g.map(m=>this._loadAttribute(e,m.attributeStorageInfo,d))),w={};for(let m=0;m<g.length;++m){var v=t[m];const r=g[m];"fulfilled"===v.status?w[r.name]=v.value:(v=v.reason,l.throwIfAbortError(v),this._logger.error("#loadAttributes",this._logLayer,`Failed to load attributeData for '${r.name}' on node '${e.id}'`,
v))}return w}async loadNodeData(e,g){var d=null!=this._requiredAttributes&&e.resources.attributes?a.result(this.loadAttributes(e,this._requiredAttributes,g)):null;var t=this._geometryDefinitions;var w={bufferDefinition:null,bufferIndex:0};var v=e.resources.geometryDefinition;if(!(null==t||null==v||0>v)&&(t=0<=v?t[v].geometryBuffers:null,null!=t))for(v=0;v<t.length;v++){var m=t[v];if(null!=m.compressedAttributes){if("draco"===m.compressedAttributes.encoding&&!b("disable-feature:i3s-draco")){w.bufferIndex=
v;w.bufferDefinition=m;break}}else w.bufferIndex=v,w.bufferDefinition=t[v]}const {bufferDefinition:r,bufferIndex:n}=w;v=(m=!!e.resources.geometry)?a.result(this._loadGeometry(e.resources.geometry,n,g)):null;t=e.resources.hasSharedResource?await this._loadShared(e,g):null;w=e.resources.materialDefinition;w=this._materialAndTextures&&null!=w&&0<=w?this._materialAndTextures[w]:null!=t?f.getMaterialAndTexturesFromShared(t):null;var u=w?.material;w=w?.textures??[];const x=`${e.id}`,y=!m&&this._options.loadFeatureData;
m=y?await this._loadFeatureData(x,g):null;if(y)a:{if(m)for(A of m.featureData)if(u=A.geometries,null!=u)for(var z of u){var A={featureIds:[A.id],featureDataPosition:A.position,geometries:[z]};break a}A=null}else A={featureIds:[],geometries:[{type:"ArrayBufferView",params:{material:u}}],featureDataPosition:[0,0,0]};if(null==A)if(m){z=[];for(B of m.featureData)null!=B.position&&z.push({featureIds:[B.id],featureDataPosition:B.position,geometries:[]});var B=z}else B=null;else B=null;z=0<w.length?a.result(this.loadTextures(e,
w,g)):null;g=e=null;v&&(e=a.assertResult(await v),(g=this._defaultGeometrySchema)&&t?.materialDefinitions&&(v=Object.keys(t.materialDefinitions)[0],!t.materialDefinitions[v].params.vertexRegions&&g.vertexAttributes.region&&(g=q.clone(g),delete g.vertexAttributes.region)),g=h.createGeometryDescriptor(r,g));t=z?a.assertResult(await z):null;d=(d=d?a.assertResult(await d):{})?{attributeData:d,loadedAttributes:this._requiredAttributes}:null;if(null!=A)return{geometryData:A,attributeDataInfo:d,geometryBuffer:e,
geometryDescriptor:g,requiredTextures:w,textureData:t};if(null!=B)return{pointData:B,attributeDataInfo:d,geometryBuffer:e,geometryDescriptor:g,requiredTextures:w,textureData:t};throw Error();}static _addAbsoluteHrefTexture(e,g){e=e.textureDefinitions;if(null!=e)for(const d of Object.keys(e))for(const t of e[d].images)Array.isArray(t.href)?t.hrefConcat=t.href.map(w=>p.makeAbsolute(w,g)):t.hrefConcat=p.makeAbsolute(t.href,g)}static _fixTextureEncodings(e){e=e.textureDefinitions;if(null!=e)for(const d in e){const t=
e[d];if(Array.isArray(t.encoding))for(var g=0;g<t.encoding.length;g++){const w=t.encoding[g];"data:"===w.substring(0,5)&&(t.encoding[g]=w.substring(5))}else g=t.encoding,"data:"===g.substring(0,5)&&(t.encoding=g.substring(5))}}async _loadShared(e,g){if(null==e.resources.geometry)return{};e=`${this._layerUrl}/nodes/${e.resources.geometry}/shared`;g=await this._load(e,"json",g);c._fixTextureEncodings(g);c._addAbsoluteHrefTexture(g,e);return g}_loadTexture(e,g,d,t,w,v){let m=!1;return w===k.TextureEncoding.DDS_S3TC||
w===k.TextureEncoding.KTX2||w===k.TextureEncoding.Basis?this._load(e,"binary",v).then(r=>({id:g,usage:d,data:r,encoding:w,downsampled:m})):this._load(e,"image",v).then(r=>{var n=r;if(t&&4096<=r.width*r.height){n=Math.ceil(r.width/2);const u=Math.ceil(r.height/2),x=document.createElement("canvas");x.width=n;x.height=u;x.getContext("2d").drawImage(r,0,0,n,u);n=x;m=!0}return{id:g,usage:d,data:n,encoding:w,downsampled:m}})}loadTextures(e,g,d){const t=!!this._options.uncompressedTextureDownsamplingEnabled,
w=this._options.textureUsageMask;return Promise.all(g.map(v=>{if(0===(v.usage&w))return null;const m=f.selectEncoding(v.encodings,this._options.textureEncodings);return null==m?(this._logger.error("#loadTextures",this._logLayer,`No known encoding for texture found on node ${e.id}`),Promise.reject()):this._loadTexture(`${this._layerUrl}/nodes/${e.resources.texture||e.id}/textures/${m.name}`,v.id,v.usage,t,m.encoding,d)}))}_loadFeatureData(e,g){return this._load(`${this._layerUrl}/nodes/${e}/features/0`,
"json",g)}_loadGeometry(e,g,d){return this._load(`${this._layerUrl}/nodes/${e}/geometries/${g}`,"binary",d)}}return c})},"esri/views/3d/layers/i3s/I3SMaterialUtil":function(){define("exports ../../../../core/has ../../../../core/mathUtils ./enums ../../webgl-engine/core/material/RenderTexture ../../webgl-engine/core/shaderLibrary/util/AlphaCutoff ../../webgl-engine/core/shaderLibrary/util/EllipsoidMode ../../webgl-engine/lib/basicInterfaces ../../webgl-engine/lib/Texture ../../webgl-engine/materials/pbrUtils ../../../webgl/enums".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){function d(x){return x.sort((y,z)=>y.encoding-z.encoding)}function t(x,y,z){if(null==x||z===l.TextureUsage.None)return null;for(let A=0;A<x.length;A++){const B=x[A];if(null!=B&&0!==(B.usage&z))return x=y[A],null!=x?x.id:null}return null}function w(x){switch(x){case l.TextureEncoding.KTX2:return f.TextureEncodingMimeType.KTX2_ENCODING;case l.TextureEncoding.Basis:return f.TextureEncodingMimeType.BASIS_ENCODING;case l.TextureEncoding.DDS_S3TC:return f.TextureEncodingMimeType.DDS_ENCODING;
case l.TextureEncoding.PNG:return"image/png";case l.TextureEncoding.JPG:return"image/jpeg";case l.TextureEncoding.KTX_ETC2:return"image/ktx";default:return""}}const v={ktx2:l.TextureEncoding.KTX2,basis:l.TextureEncoding.Basis,dds:l.TextureEncoding.DDS_S3TC,png:l.TextureEncoding.PNG,jpg:l.TextureEncoding.JPG,"ktx-etc2":l.TextureEncoding.KTX_ETC2},m={[f.TextureEncodingMimeType.KTX2_ENCODING]:l.TextureEncoding.Basis,[f.TextureEncodingMimeType.BASIS_ENCODING]:l.TextureEncoding.Basis,[f.TextureEncodingMimeType.DDS_ENCODING]:l.TextureEncoding.DDS_S3TC,
"image/png":l.TextureEncoding.PNG,"image/jpg":l.TextureEncoding.JPG,"image/jpeg":l.TextureEncoding.JPG,"image/ktx":l.TextureEncoding.KTX_ETC2},r=()=>({alphaMode:"opaque",alphaCutoff:k.defaultMaskAlphaCutoff,doubleSided:!0,cullFace:f.CullFaceOptions.None,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[.8,.8,.8,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6},wrapTextures:!1,hasParametersFromSource:!0}),
n={s:g.TextureWrapMode.CLAMP_TO_EDGE,t:g.TextureWrapMode.CLAMP_TO_EDGE},u={s:g.TextureWrapMode.REPEAT,t:g.TextureWrapMode.REPEAT};a.configureMaterial=function(x,y,z,A,B,C){const D=C.rendererTextureUsage;var F=y.metallicRoughness.baseColorFactor,H=q.clamp(y.metallicRoughness.baseColorFactor[3],0,1);x.baseColor=[F[0],F[1],F[2],H];x.hasParametersFromSource=!!y.hasParametersFromSource;x.usePBR=C.usePBR;x.mrrFactors=[y.metallicRoughness.metallicFactor,y.metallicRoughness.roughnessFactor,y.hasParametersFromSource?
e.defaultSchematicMRRFactors[2]:e.defaultAdvancedMRRFactors[2]];x.emissiveFactor=y.emissiveFactor;x.isIntegratedMesh=C.isIntegratedMesh;x.textureAlphaCutoff="mask"===y.alphaMode?y.alphaCutoff:k.defaultMaskAlphaCutoff;x.alphaDiscardMode="opaque"===y.alphaMode?f.AlphaDiscardMode.Opaque:"mask"===y.alphaMode?f.AlphaDiscardMode.Mask:f.AlphaDiscardMode.MaskBlend;F=[];H=t(A,z,(l.TextureUsage.Color|l.TextureUsage.AlphaMask)&D);null!=H&&(x.baseColorTexture=new p.RenderTexture(B,H),F.push(x.baseColorTexture.loadPromise));
H=t(A,z,l.TextureUsage.MetallicRoughness&D);null!=H&&(x.metallicRoughnessTexture=new p.RenderTexture(B,H),F.push(x.metallicRoughnessTexture.loadPromise));H=t(A,z,l.TextureUsage.Emissive&D);null!=H&&(x.emissionTexture=new p.RenderTexture(B,H),F.push(x.emissionTexture.loadPromise));H=t(A,z,l.TextureUsage.Occlusion&D);null!=H&&(x.occlusionTexture=new p.RenderTexture(B,H),F.push(x.occlusionTexture.loadPromise));z=t(A,z,l.TextureUsage.Normal&D);null!=z&&(x.normalTexture=new p.RenderTexture(B,z),F.push(x.normalTexture.loadPromise));
x.commonMaterialParameters.hasSlicePlane=C.slicePlaneEnabled;x.commonMaterialParameters.doubleSided=y.doubleSided;x.commonMaterialParameters.cullFace=y.cullFace;x.ellipsoidMode=h.getEllipsoidMode(C.viewSpatialReference);return Promise.all(F)};a.createTexture=function(x,y,z,A){if(null==x?.data)return null;const B=x.data;A=A.renderingContext.parameters.maxMaxAnisotropy;const C=1<A;z=z||!y.wrapTextures?n:u;const D=w(x.encoding);return new c.Texture(B,{mipmap:C,maxAnisotropy:A,encoding:D,wrap:z,components:x.usage&
l.TextureUsage.Color?"opaque"===y.alphaMode?3:4:3,noUnpackFlip:!0})};a.defaultMaterial=r;a.getMaterialAndTextures=function(x,y,z){const A=new Map,B=(G,I)=>{if(null==G)return-1;var O=A.get(G.id);if(O)return O.usage|=I,O.id;O=A.size;A.set(G.id,{id:O,usage:I});return O};var C=y.pbrMetallicRoughness;const D=C?.baseColorFactor,F=y.emissiveFactor,H=(z=b("disable-feature:diffuse-rendering-i3s")||z?e.useSchematicPBRI3S({normalTexture:y.normalTexture,emissiveTexture:y.emissiveTexture,emissiveFactor:y.emissiveFactor,
occlusionTexture:y.occlusionTexture,metallicRoughnessTexture:C?.metallicRoughnessTexture,metallicFactor:C?.metallicFactor,roughnessFactor:C?.roughnessFactor}):e.useSchematicPBR({normalTexture:y.normalTexture,emissiveTexture:y.emissiveTexture,emissiveFactor:y.emissiveFactor,occlusionTexture:y.occlusionTexture,metallicRoughnessTexture:C?.metallicRoughnessTexture,metallicFactor:C?.metallicFactor,roughnessFactor:C?.roughnessFactor}))?e.defaultSchematicMRRFactors[0]:C?.metallicFactor??e.defaultAdvancedMRRFactors[0],
N=z?e.defaultSchematicMRRFactors[1]:C?.roughnessFactor??e.defaultAdvancedMRRFactors[1];C={baseColorFactor:D?[D[0],D[1],D[2],D[3]]:[1,1,1,1],baseColorTextureId:B(C?.baseColorTexture,"mask"===y.alphaMode?l.TextureUsage.Color|l.TextureUsage.AlphaMask:l.TextureUsage.Color),metallicRoughnessTextureId:B(C?.metallicRoughnessTexture,l.TextureUsage.MetallicRoughness),metallicFactor:H,roughnessFactor:N};y={alphaMode:y.alphaMode,alphaCutoff:y.alphaCutoff,doubleSided:y.doubleSided,cullFace:"none"===y.cullFace?
f.CullFaceOptions.None:"back"===y.cullFace?f.CullFaceOptions.Back:"front"===y.cullFace?f.CullFaceOptions.Front:f.CullFaceOptions.None,normalTextureId:B(y.normalTexture,l.TextureUsage.Normal),emissiveTextureId:B(y.emissiveTexture,l.TextureUsage.Emissive),occlusionTextureId:B(y.occlusionTexture,l.TextureUsage.Occlusion),emissiveFactor:F?[F[0],F[1],F[2]]:[0,0,0],metallicRoughness:C,wrapTextures:!1,hasParametersFromSource:z};const E=[];A.forEach(({usage:G},I)=>{var O=null!=x&&x[I]&&x[I].formats;O=O?d(O.map(({name:L,
format:P})=>({name:L,encoding:v[P]}))):[];E.push({id:I,usage:G,encodings:O})});return{material:y,textures:E}};a.getMaterialAndTexturesFromShared=function(x){var y=x?.materialDefinitions?Object.keys(x.materialDefinitions)[0]:null,z=x?.textureDefinitions?Object.keys(x.textureDefinitions)[0]:null;y=y?x.materialDefinitions?.[y]:null;z=z?x.textureDefinitions?.[z]:null;x=r();if(null!=y){y=y.params;y.diffuse&&(x.metallicRoughness.baseColorFactor=[y.diffuse[0],y.diffuse[1],y.diffuse[2],1]);null!=y.doubleSided&&
(x.doubleSided=y.doubleSided,x.cullFace=y.doubleSided?f.CullFaceOptions.None:f.CullFaceOptions.Back);if("none"===y.cullFace||"front"===y.cullFace||"back"===y.cullFace)x.cullFace="none"===y.cullFace?f.CullFaceOptions.None:"back"===y.cullFace?f.CullFaceOptions.Back:f.CullFaceOptions.Front;y.transparency&&(x.metallicRoughness.baseColorFactor[3]=q.clamp(1-y.transparency,0,1));if(y.useVertexColorAlpha||1>x.metallicRoughness.baseColorFactor[3])x.alphaMode="blend"}y=[];if(null!=z){!z.wrap||"repeat"!==z.wrap[0]&&
"repeat"!==z.wrap[1]||(x.wrapTextures=!0);let A=l.TextureUsage.Color;"rgba"===z.channels&&(x.alphaMode="blend",A|=l.TextureUsage.AlphaMask);const B=z.images[z.images.length-1];z=Array.isArray(z.encoding)?d(z.encoding.map((C,D)=>({name:B.href[D]?.split("/").pop(),encoding:m[C]||0}))):[{name:B.href?.split("/").pop(),encoding:m[z.encoding]||0}];y.push({id:0,usage:A,encodings:z});x.metallicRoughness.baseColorTextureId=0}return{material:x,textures:y}};a.getSupportedEncodings=function(x){const y=!!x.compressedTextureS3TC;
x=!!x.compressedTextureETC;const z=b("disable-feature:i3s-basis")?0:l.TextureEncoding.Basis|l.TextureEncoding.KTX2,A=z|l.TextureEncoding.DDS_S3TC;return l.TextureEncoding.JPG|l.TextureEncoding.PNG|(y?A:0)|(x?z:0)};a.selectEncoding=function(x,y){if(null!=y)return x.find(z=>0!==(z.encoding&y))};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/material/RenderTexture":function(){define(["exports","../../../../../core/maybe","../../../../../core/promiseUtils"],
function(a,b,q){class l{constructor(p,k){this._textures=p;this.loadPromise=null;this._disposed=!1;p=this._textures.acquire(k);q.isPromiseLike(p)?(p.then(h=>{this._disposed?b.releaseMaybe(h):this._textureRef=h}),this.loadPromise=p):this._textureRef=p}dispose(){this._textureRef=b.releaseMaybe(this._textureRef);this._disposed=!0}get glTexture(){return null!=this._textureRef?this._textureRef.glTexture:null}}a.RenderTexture=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SStreamDataController":function(){define(["exports",
"../../../../core/promiseUtils"],function(a,b){class q{constructor(l,p,k){this._requester=l;this._customParameters=p;this._apiKey=k;this._activeRequests=new Set}get busy(){return this._requester.busy}request(l,p,k){const h=new AbortController;k=b.onAbortOrThrow(k,()=>h.abort());l=this._requester.request(l,p,{signal:h.signal,query:{...this._customParameters,token:this._apiKey}});const f={response:l,abortController:h,abortHandle:k};this._activeRequests.add(f);b.always(l,()=>{f.abortController=null;
f.abortHandle?.remove();f.abortHandle=null;this._activeRequests.delete(f)});return l}cancelAll(){this._activeRequests.forEach(l=>{l.abortController?.abort();l.abortController=null;l.abortHandle?.remove()});this._activeRequests.clear()}}a.I3SStreamDataController=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SViewportQueries":function(){define("../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../chunks/vec42 ../../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../../geometry/ellipsoidUtils ../../../../geometry/spatialReferenceEllipsoidUtils ../../../../geometry/projection/projectBoundingSphere ../../../../geometry/projection/projectors ../../../../geometry/support/frustum ../../../../geometry/support/plane ../../../../geometry/support/spatialReferenceUtils ../../../../chunks/sphere ../../../../layers/graphics/dehydratedPoint ../../../ViewingMode ../graphics/elevationAlignmentUtils ../graphics/ElevationContext ../graphics/featureExpressionInfoUtils ./I3SNode ./I3SUtil ../../support/orientedBoundingBox".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){class y{get _frustumMbsCenter(){return this._frustumMbs}get _frustumMbsRadius(){return this._frustumMbs[3]}get _frustumPlanes(){return this._frustum}constructor(M,K,J,R,Q,W,S,V,T={}){this._indexSR=M;this._renderCoordsHelper=K;this._clippingArea=Q;this._elevationProvider=W;this._viewingMode=S;this._options=T;this._frustum=c.create();this._frustumMbs=l.create();this._useFrustumCulling=!1;this._poi=b.create();this._elevationContext=null;this.minDistance=
Infinity;this.maxDistance=0;this.maxLodLevel=2;this._tmpObb=new x.Obb;this._tmp1=b.create();this._tmp2=b.create();this._tmp3=b.create();this._tmp0=b.create();this._screenspaceErrorBias=T.screenspaceErrorBias||1;this._progressiveLoadFactor=T.progressiveLoadFactor||1;this.updateCamera(J,R);this._renderSR=K=this._renderCoordsHelper.spatialReference;this._renderSRSphericalPCPF=k.getSphericalPCPF(K);this._isGlobalMode=K===this._renderSRSphericalPCPF;this.updateElevationInfo(V);this._tmpPoint=t.makeDehydratedPoint(0,
0,0,M);this._isECEFOBBInLocalMode=this._indexSR.isWGS84&&(K.isWebMercator||g.isPlateCarree(K));this._indexSREllipsoidRadius=p.getReferenceEllipsoid(this._indexSR).radius;this._indexSRSphericalPCPF=k.getSphericalPCPF(M);this._projectorIndexSRToIndexSRSphericalPCPF=f.getProjector(this._indexSR,this._indexSRSphericalPCPF)}updateElevationInfo(M){null==M?this._elevationContext=null:(this._elevationContext=m.ElevationContext.fromElevationInfo(M),this._elevationContext.updateFeatureExpressionInfoContext(r.createContextWithoutExpressionSupport(r.extractExpressionInfo(M,
!1))))}updateCamera(M,K){if(this._useFrustumCulling=K){c.fromMatrix(M.viewMatrix,M.projectionMatrix,this._frustum,A);K=M.eye;const Q=z;a.normalize(Q,M.viewForward);var J=B;a.sub(J,A[4],K);var R=a.dot(J,J);J=a.dot(Q,J);R=.5*R/J;J=this._frustumMbs;a.scaleAndAdd(J,K,Q,R);J[3]=1+R}this._screenSizeFactor=1/(M.perScreenPixelRatio/2);this._camPos=M.eye;this.minDistance=Infinity;this.maxDistance=0}setPointOfInterest(M){this._poi=M}updateScreenSpaceErrorBias(M){const K=this._screenspaceErrorBias;this._screenspaceErrorBias=
M;return K}updateClippingArea(M){this._clippingArea=M}expandElevationRange(M,K,J){if(null!=this._elevationContext&&(M=M.serviceMbsInIndexSR)){var R="relative-to-scene"===this._elevationContext.mode?"scene":"ground";this._elevationProvider.getSphereElevationBounds?(K=this._elevationProvider.getSphereElevationBounds(M,this._indexSR,R))&&J.expandElevationRange(K):((M=this._elevationProvider.getElevation(M[0],M[1],M[2],this._indexSR,R))&&J.expandElevationRangeValues(M,M),(K=K?null:this._elevationProvider.getRootElevationBounds?.())&&
J.expandElevationRange(K))}}getServiceMbsInRenderSR(M){const K=M.serviceMbsInRenderSR;if(u.isValidMbs(K))return K;M.serviceMbsInIndexSR&&q.copy(K,M.serviceMbsInIndexSR);const J=M.elevationRangeMin;if(this._elevationContext&&Number.isFinite(J)){let R=0,Q=0;M=M.elevationRangeMax;switch(this._elevationContext.mode){case "relative-to-ground":case "relative-to-scene":R=this._elevationContext.geometryZWithOffset(K[2],this._renderCoordsHelper)+J-K[2];Q=M-J;break;case "on-the-ground":R=J-K[2],Q=M-J}K[2]+=
R+.5*Q;K[3]+=.5*Q}else this._elevationContext&&1E5>K[3]&&(this._tmpPoint.x=K[0],this._tmpPoint.y=K[1],this._tmpPoint.z=K[2],K[2]=v.evaluateElevationAlignmentAtPoint(this._tmpPoint,this._elevationProvider,this._elevationContext,this._renderCoordsHelper));h.projectBoundingSphere(K,this._indexSR,K,this._renderSR);return K}getAndUpdateVisibilityObbInRenderSR(M){var K=M.visibilityObbInRenderSR;if(K)return K;K=.01*this._indexSREllipsoidRadius;const {serviceMbsInIndexSR:J,serviceObbInIndexSR:R}=M;if(null==
R||!J||!R.isValid||this._isECEFOBBInLocalMode&&(R.halfSizeX>K||R.halfSizeY>K||R.halfSizeZ>K))return null;K=M.serviceObbInRenderSR;if(null==K)K=new x.Obb,M.serviceObbInRenderSR=K;else if(K.isValid)return K;var Q=J[3],W=0;let S=0;var V=R.centerZ;const T=this._renderCoordsHelper,Y=this._elevationContext;if(Y&&M.elevationRangeValid)switch(Q=M.elevationRangeMin,M=M.elevationRangeMax,Y.mode){case "relative-to-ground":case "relative-to-scene":W=Y.geometryZWithOffset(V,T)+Q-V;S=M-Q;break;case "on-the-ground":W=
Q-V,S=M-Q}else Y&&1E5>Q&&(W=this._tmpPoint,W.x=R.centerX,W.y=R.centerY,W.z=V,W=v.evaluateElevationAlignmentAtPoint(W,this._elevationProvider,Y,T)-V);V=(M=0<S)?this._tmpObb:K;R.transform(V,this._indexSR,this._renderSR,W,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF);M&&x.computeOffsetObb(V,0,S,this._viewingMode,K);return K}getNodeObbInRenderSRIndependentOfElevationOffset(M){const K=M.visibilityObbInRenderSR??M.serviceObbInRenderSR??null;if(K?.isValid)return K;
M=M.serviceObbInIndexSR;if(!M)return null;M.transform(N,this._indexSR,this._renderSR,void 0,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF);return N}ensureElevationAgnosticBoundingVolume(M){-1===M.elevationAgnosticBoundingVolume[3]&&0<M.level&&(this._viewingMode===w.ViewingMode.Global?this._updateElevationAgnosticBoundingVolumeGlobal(M):this._updateElevationAgnosticBoundingVolumeLocal(M));return M.elevationAgnosticBoundingVolume}_updateElevationAgnosticBoundingVolumeGlobal(M){var K=
this.getNodeObbInRenderSRIndependentOfElevationOffset(M);const J=M.elevationAgnosticBoundingVolume;var R=-1;if(K){const W=E;K.getCenter(W);a.normalize(W,W);M=W;K.getCorners(G);for(var Q of G){a.normalize(Q,Q);K=a.dot(Q,W);if(0>=K){J[3]=-1;return}R=Math.max(R,Math.sqrt(1-K*K))}}else if(R=M.serviceMbsInRenderSR,u.isValidMbs(R)){Q=a.copy(E,d.getCenter(R));R=R[3];K=a.len(Q);if(K<R){J[3]=-1;return}R/=K;a.normalize(Q,Q);M=Q}else{J[3]=-1;return}q.copyVec3(J,M);J[3]=R+.001}_updateElevationAgnosticBoundingVolumeLocal(M){const K=
M.elevationAgnosticBoundingVolume;var J=this.getNodeObbInRenderSRIndependentOfElevationOffset(M);if(J){M=J.getCenter(E);M[2]=0;q.copyVec3(K,M);M=0;const Q=I;J.getCorners(G);for(var R of G)R[2]=0,J=a.sqrDist(Q,R),M=Math.max(M,J);K[3]=Math.sqrt(M)}else R=M.serviceMbsInRenderSR,u.isValidMbs(R)&&(J=a.copy(E,d.getCenter(R)),J[2]=0,q.copyVec3(K,J),K[3]=R[3])}isNodeVisible(M){const K=this.getServiceMbsInRenderSR(M);return this._isMBSinClippingArea(K)?this._useFrustumCulling?(M=this.getAndUpdateVisibilityObbInRenderSR(M))?
M.doesIntersectFrustumConservativeApproximation(this._frustum):c.intersectsSphere(this._frustum,d.wrap(K)):!0:!1}isElevationAgnosticBoundingVolumeVisible(M){return this._useFrustumCulling&&-1!==M[3]?this._viewingMode===w.ViewingMode.Global?this._isConeVisibleInFrustum(M):this._isCylinderVisibleInFrustum(M):!0}_isConeVisibleInFrustum(M){if(!this._isConeVisibleInFrustumMbs(M))return!1;var K=M[3];if(-1===K||.9<K)return!0;var J=this._frustumPlanes,R=a.dot(M,this._frustumMbsCenter),Q=this._frustumMbsRadius;
const W=R-Q;R+=Q;if(0>=W)return!0;Q=a.scale(D,M,W);const S=a.scale(F,M,R);K/=Math.sqrt(1-K*K);for(const T of J){J=e.getNormal(T);var V=a.normalize(H,J);const Y=a.dot(V,M);if(!(.01>Math.abs(1-Y)||(J=O,a.scale(J,M,Y),a.sub(J,J,V),a.normalize(J,J),V=L,a.scaleAndAdd(V,Q,J,W*K),0>=e.signedDistance(T,V)||(a.scaleAndAdd(V,S,J,R*K),0>=e.signedDistance(T,V)))))return!1}return!0}_isConeVisibleInFrustumMbs(M){const K=M[3];if(.9<K)return!0;var J=this._frustumMbsRadius,R=this._frustumMbsCenter;const Q=a.len(R);
if(Q<=J)return!0;var W=a.dot(M,R);M=a.scale(C,M,W);if(a.dist(M,R)<J)return!0;R=W/Q;if(0>=W)return-R<J;W=Math.sqrt(1-R*R);if(W<K)return!0;J/=Q;return W*Math.sqrt(1-J*J)-J*R<K}isObbVisibleIndependentOfElevation(M,K){if(!this._useFrustumCulling||-1===M[3])return!0;var J=this._frustumMbsRadius,R=this._frustumMbsCenter,Q=this._frustumPlanes;const W=G;K.getCorners(W);if(this._viewingMode===w.ViewingMode.Global){var S=a.dot(M,R),V=S-J;S+=J;if(0>=V)return!0;for(var T of Q){Q=!0;for(var Y of W){J=a.dot(Y,
M);R=P;a.scale(R,Y,V/J);if(0>=e.signedDistance(T,R)){Q=!1;break}R=P;a.scale(R,Y,S/J);if(0>=e.signedDistance(T,R)){Q=!1;break}}if(Q)return!1}}else{M=R[2]-J;T=R[2]+J;for(V of Q){Y=!0;R=e.getNormal(V);Q=R[0];J=R[1];R=R[2];K=V[3];for(S of W){const ha=Q*S[0]+J*S[1]+K;if(0>=ha+R*M||0>=ha+R*T){Y=!1;break}}if(Y)return!1}}return!0}_isCylinderVisibleInFrustum(M){const K=this._frustumMbsRadius,J=a.copy(C,this._frustumMbsCenter);J[2]=0;const R=M[3];return a.dist(J,M)<=R+K}isGeometryVisible(M){return this._useFrustumCulling?
M.geometryObbInRenderSR?.doesIntersectFrustumConservativeApproximation(this._frustum)??this.isNodeVisible(M):!0}_isMBSinClippingArea(M){return null==this._clippingArea?!0:u.intersectBoundingRectWithMbs(this._clippingArea,M)!==u.MbsIntersectResult.OUTSIDE}_screenSpaceDiameterMbs(M,K){var J=this.getServiceMbsInRenderSR(M);M=Math.sqrt(a.squaredDistance(d.getCenter(J),this._camPos));J=M-J[3];this._updateMinMaxDistance(M);return 0>J?.5*Number.MAX_VALUE:K/J*this._screenSizeFactor}calcCameraDistance(M){return this.calcCameraDistanceToCenter(M)-
this.getServiceMbsInRenderSR(M)[3]}calcCameraDistanceToCenter(M){M=this.getServiceMbsInRenderSR(M);M=a.distance(d.getCenter(M),this._camPos);this._updateMinMaxDistance(M);return M}calcAngleDependentLoD(M){M=this.getServiceMbsInRenderSR(M);const K=M[3];M=(Math.abs(M[0]*(M[0]-this._camPos[0])+M[1]*(M[1]-this._camPos[1])+M[2]*(M[2]-this._camPos[2]))/a.length(d.getCenter(M))+K)/a.distance(d.getCenter(M),this._camPos);return Math.min(1,M)}hasLOD(M){return M.lodMetric!==n.LodMetric.None}_getDistanceGlobeMode(M,
K){var J=a.length(d.getCenter(K));const R=a.length(M)-J;a.scale(this._tmp0,M,a.dot(M,d.getCenter(K))/a.squaredLength(M));var Q=a.squaredDistance(d.getCenter(K),this._tmp0),W=K[3];if(Q<=W*W)return Math.abs(R);K=a.scale(this._tmp0,d.getCenter(K),1/J);J=a.scale(this._tmp1,K,J-W*W/2/J);Q=a.subtract(this._tmp2,M,J);Q=a.subtract(this._tmp2,Q,a.scale(this._tmp3,K,a.dot(K,Q)));J=a.add(this._tmp2,J,a.scale(this._tmp2,Q,W/a.length(Q)));W=a.distance(M,J);2E5<=R&&(M=a.subtract(this._tmp1,M,J),M=a.dot(M,K)/a.length(M),
.08>M&&(M=1E-4),W/=M);return W}_getDistance(M,K){if(this._isGlobalMode)return this._getDistanceGlobeMode(M,K);{var J=M[0]-K[0];const R=M[1]-K[1];M=M[2]-K[2];J=J*J+R*R;K=K[3];J<=K*K?M=Math.abs(M):(K=Math.sqrt(J)-K,M=Math.sqrt(M*M+K*K))}return M}_updateMinMaxDistance(M){0<M?(this.minDistance=Math.min(this.minDistance,M),this.maxDistance=Math.max(this.maxDistance,M)):(this.minDistance=0,this.maxDistance=Math.max(this.maxDistance,-M))}getLodLevel(M){if(M.lodMetric===n.LodMetric.None)return 0;if(0===M.childCount)return this.maxLodLevel;
if(this._useFrustumCulling&&1>this._progressiveLoadFactor){const K=this._screenspaceErrorBias;return this.evaluateLODmetric(M,this._progressiveLoadFactor*this._screenspaceErrorBias)?this.evaluateLODmetric(M,K)?2:1:0}return this.evaluateLODmetric(M,this._screenspaceErrorBias)?this.maxLodLevel:0}evaluateLODmetric(M,K){switch(M.lodMetric){case n.LodMetric.ScreenSpaceRelative:const J=this.getServiceMbsInRenderSR(M),R=this._getDistance(this._camPos,J),Q=2*R/this._screenSizeFactor;this._updateMinMaxDistance(R+
J[3]);return M.maxError*K<=Q;case n.LodMetric.MaxScreenThreshold:return K=this._screenSpaceDiameterMbs(M,M.serviceMbsInIndexSR[3]*K),this._options.angleDependentLoD&&(K*=this.calcAngleDependentLoD(M)),K<M.maxError;case n.LodMetric.RemovedFeatureDiameter:return 10>this._screenSpaceDiameterMbs(M,M.maxError)*K;case n.LodMetric.DistanceRangeFromDefaultCamera:return this.calcCameraDistance(M)>M.maxError*K}return!1}distToPOI(M){M=this.getServiceMbsInRenderSR(M);return a.distance(d.getCenter(M),this._poi)-
M[3]}distCameraToPOI(){return a.distance(this._camPos,this._poi)}}const z=b.create(),A=c.createPoints(),B=b.create(),C=b.create(),D=b.create(),F=b.create(),H=b.create(),N=new x.Obb,E=b.create(),G=[b.create(),b.create(),b.create(),b.create(),b.create(),b.create(),b.create(),b.create()],I=b.create(),O=b.create(),L=b.create(),P=b.create();return y})},"esri/layers/support/SceneModification":function(){define("../../chunks/tslib.es6 ../../geometry ../../core/JSONSupport ../../core/lang ../../core/Warning ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ../../core/accessorSupport/decorators/persistable ../../geometry/projection ../../geometry/Polygon".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){var w;b=w=class extends q.JSONSupport{constructor(v){super(v);this.geometry=null;this.type="clip"}writeGeometry(v,m,r,n){if(n.layer?.spatialReference&&!n.layer.spatialReference.equals(this.geometry.spatialReference)){if(!d.canProjectWithoutEngine(v.spatialReference,n.layer.spatialReference)){n?.messages&&n.messages.push(new p("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:n.layer.spatialReference,
context:n}));return}const u=new t;d.projectPolygon(v,u,n.layer.spatialReference);m[r]=u.toJSON(n)}else m[r]=v.toJSON(n);delete m[r].spatialReference}clone(){return new w({geometry:l.clone(this.geometry),type:this.type})}};a.__decorate([k.property({type:t}),g.persistable()],b.prototype,"geometry",void 0);a.__decorate([e.writer(["web-scene","portal-item"],"geometry")],b.prototype,"writeGeometry",null);a.__decorate([k.property({type:["clip","mask","replace"],nonNullable:!0}),g.persistable()],b.prototype,
"type",void 0);return b=w=a.__decorate([c.subclass("esri.layers.support.SceneModification")],b)})},"esri/views/3d/layers/I3SMeshViewLabeler":function(){define("../../../chunks/tslib.es6 ../../../symbols ../../../core/Accessor ../../../core/arrayUtils ../../../core/has ../../../core/lang ../../../core/mathUtils ../../../core/maybe ../../../core/reactiveUtils ../../../core/uid ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/accessorSupport/decorators/subclass ../../../core/accessorSupport/diffUtils ../../../geometry/projection/projectBuffer ../../../geometry/support/aaBoundingBox ../../../geometry/support/DoubleArray ../../../layers/graphics/dehydratedPoint ./graphics/Graphics3DCore ./graphics/Graphics3DScaleVisibility ./i3s/I3SGeometryUtil ../support/LimitGraphicsMap ../webgl-engine/lib/UpdatePolicy ../../../symbols/PointSymbol3D".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B){class C{constructor(E,G){this.meta=E;this.index=G}}class D{constructor(E,G){this.graphic=E;this.geometry=G;this.components=[];this.overridesDirty=!1}}b=class extends q{get updating(){return this._graphicsCore?.updating??!1}constructor(E){super(E);this.loadedGraphics=new z.LimitGraphicsMap(5E4);this.slicePlaneEnabled=!1;this._renderingInfo={symbol:new B};this._featuresMap=new Map}initialize(){const E=this.view.basemapTerrain;this._graphicsCore=
new u.Graphics3DCore({owner:this,layer:this.layer,preferredUpdatePolicy:A.UpdatePolicy.ASYNC,elevationFeatureExpressionEnabled:!1,graphicSymbolSupported:!1,getRenderingInfoWithoutRenderer:!0,hasZ:!0,hasM:!1,componentFactories:{deconflictor:G=>this.view.deconflictor.addGraphicsOwner(G),labeler:(G,I)=>this.view.labeler.addGraphicsOwner(G,I,{emptySymbolLabelSupported:!0,elevationInfoOverride:{mode:"absolute-height",offset:0},disablePlacement:{logEntityDescription:"3D Object Scene Layer features"}}),
scaleVisibility:(G,I)=>new x.Graphics3DScaleVisibility({graphicsCoreOwner:this,layer:this.layer,queryGraphicUIDsInExtent:I,graphicsCore:G,basemapTerrain:E,layerScaleEnabled:!1})}});this._graphicsCore.initializePromise.then(()=>this._graphicsCore.startCreateGraphics()).catch(()=>{});this.addHandles(c.watch(()=>this.layer.labelingInfo,(G,I)=>{w.diff(G,I)&&this._graphicsCore.updateLabelingInfo()}))}destroy(){this._graphicsCore=f.destroyMaybe(this._graphicsCore);this.loadedGraphics=f.destroyMaybe(this.loadedGraphics);
this.view=null}addNodeMeta(E,G){let I=0;const O=E.filteredIds,L=this.view.spatialReference,P=[];for(let J=0;J<E.featureIds.length;J++){const R=E.featureIds[J];var M=null==O;O&&I<O.length&&R===O[I]&&(M=!0,I++);if(!this._enabledForFeatureInNode(E,J))continue;var K=this._featuresMap.get(R);if(K){K.components.push(new C(E,J));this._updateLabelPosition(R);continue}const Q=G(J,E);K=n.makeDehydratedPoint(0,0,0,L);M={objectId:R,uid:e.generateUID(),attributes:Q,visible:M,geometry:K};K=new D(M,K);K.components.push(new C(E,
J));this._featuresMap.set(R,K);this._updateLabelGeometry(R);P.push(M)}this.loadedGraphics.addMany(P)}updateLabelPositions(E){const G=this.view.renderCoordsHelper;this._forEachGraphic(E,(I,O,L)=>{O=this._graphicsCore.getGraphics3DGraphicById(O.uid);null!=O&&this._updateLabelGeometry(E.featureIds[I])&&O.alignWithAbsoluteElevation(L.z??0,G,!1)})}setNodeMetaAttributes(E,G){const I=[];this._forEachGraphic(E,(O,L)=>{O=G(O,E);k.equalsShallow(L.attributes,O)||(L.attributes=O,I.push(L.uid))});this._graphicsCore.updateLabelingInfo(I)}applyFilterChange(E){this._forEachFeature(E,
(G,I,O)=>{if(this._enabledForFeatureInNode(E,G))G=I.graphic,I=G.visible,I!==O&&(G.visible=O,F.graphic=G,F.property="visible",F.oldValue=I,F.newValue=O,this._graphicsCore.graphicUpdateHandler(F));else switch(O=E.featureIds[G],this._removeFeature(I,E,G)){case H.REMOVED:this.loadedGraphics.removeManyByObjectId([O]);break;case H.MODIFIED:this._updateLabelPosition(O)}})}removeNodeMeta(E){const G=[];this._forEachGraphic(E,I=>{const O=E.featureIds[I],L=this._featuresMap.get(O);if(L)switch(this._removeFeature(L,
E,I)){case H.MODIFIED:this._updateLabelPosition(O);break;case H.REMOVED:G.push(O)}});this.loadedGraphics.removeManyByObjectId(G)}_removeFeature(E,G,I){const O=E.components.length;l.filterInPlace(E.components,L=>!(L.meta===G&&L.index===I));return 0===E.components.length?(this._featuresMap.delete(G.featureIds[I]),H.REMOVED):O!==E.components.length?H.MODIFIED:H.UNMODIFIED}getRenderingInfo(){return this._renderingInfo}notifyGraphicGeometryChanged(){}notifyGraphicVisibilityChanged(){}_updateLabelPosition(E){const G=
this._featuresMap.get(E);G&&this._updateLabelGeometry(E)&&(this.loadedGraphics.removeManyByObjectId([E]),this.loadedGraphics.addMany([G.graphic]))}_updateLabelGeometry(E){E=this._featuresMap.get(E);if(!E)return!1;const G=E.geometry,I=this.view.spatialReference,O=this.view.renderCoordsHelper,L=G.x,P=G.y,M=G.z??0,K=r.newDoubleArray(E.components.length*y.boundingBoxCornersPointsStride);let J=0;for(const {meta:R,index:Q}of E.components)y.boundingBoxCornerPoints(Q,this.collection,R.objectHandle,K,J),J+=
y.boundingBoxCornersPointsStride;v.projectBuffer(K,O.spatialReference,0,K,I,0,K.length/3);m.set(N,m.negativeInfinity);m.expandWithBuffer(N,K);G.x=(N[0]+N[3])/2;G.y=(N[1]+N[4])/2;G.z=N[5];return!h.floatEqualUlp(G.x,L)||!h.floatEqualUlp(G.y,P)||!h.floatEqualUlp(G.z,M)}_forEachGraphic(E,G){this._forEachFeature(E,(I,{graphic:O,geometry:L},P)=>{this._enabledForFeatureInNode(E,I)&&G(I,O,L,P)})}_forEachFeature(E,G){let I=0;for(let O=0;O<E.featureIds.length;O++){const L=this._featuresMap.get(E.featureIds[O]);
let P=null==E.filteredIds;E.filteredIds&&E.filteredIds[I]===E.featureIds[O]&&(P=!0,I++);L&&G(O,L,P)}}_enabledForFeatureInNode(E,G){return 0>E.node.index||!this.overrides?.featureHasGeometryChanges(E.featureIds[G])}get updatePolicy(){return this._graphicsCore.effectiveUpdatePolicy}get usedMemory(){return this._graphicsCore.usedMemory}get unloadedMemoryEstimate(){return this._graphicsCore.unprocessedMemoryEstimate}get test(){}};a.__decorate([g.property()],b.prototype,"view",void 0);a.__decorate([g.property()],
b.prototype,"layer",void 0);a.__decorate([g.property()],b.prototype,"collection",void 0);a.__decorate([g.property()],b.prototype,"loadedGraphics",void 0);a.__decorate([g.property()],b.prototype,"overrides",void 0);a.__decorate([g.property()],b.prototype,"updating",null);a.__decorate([g.property()],b.prototype,"slicePlaneEnabled",void 0);a.__decorate([g.property()],b.prototype,"_graphicsCore",void 0);b=a.__decorate([t.subclass("esri.views.3d.layers.I3SMeshViewLabeler")],b);const F={graphic:null,property:null,
oldValue:null,newValue:null};var H;(function(E){E[E.UNMODIFIED=0]="UNMODIFIED";E[E.MODIFIED=1]="MODIFIED";E[E.REMOVED=2]="REMOVED"})(H||={});const N=m.create();return b})},"esri/views/3d/layers/i3s/I3SGeometryUtil":function(){define("exports ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/projectBuffer ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/DoubleArray".split(" "),function(a,b,q,l,p,k){function h(e,g,d,t,
w){e=g.getComponentAabb(d,e,f);g=g.getObjectTransform(d);for(d=0;8>d;++d)c[0]=d&1?e[0]:e[3],c[1]=d&2?e[1]:e[4],c[2]=d&4?e[2]:e[5],b.transformMat3(c,c,g.rotationScale),b.add(c,c,g.position),t[w++]=c[0],t[w++]=c[1],t[w++]=c[2];return t}const f=p.create(),c=q.create();a.boundingBoxCornerPoints=h;a.boundingBoxCornersPointsStride=24;a.createGetFeatureExtent=function(e,g,d){const t=k.newDoubleArray(24);return w=>{var v=w.meta.featureExtents;if(null==v){v=new Float64Array(6*w.meta.featureIds.length);w.meta.featureExtents=
v;for(let m=0;m<v.length;m+=6)v[m]=Number.POSITIVE_INFINITY}v=new Float64Array(v.buffer,6*w.index*Float64Array.BYTES_PER_ELEMENT,6);v[0]===Number.POSITIVE_INFINITY&&(h(w.index,d,w.meta.objectHandle,t,0),l.projectBuffer(t,g,0,t,e,0,8)?(p.set(v,p.negativeInfinity),p.expandWithBuffer(v,t,0,8)):p.set(v,p.zero));return v}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/LimitGraphicsMap":function(){define(["exports","../../../core/Evented","../../../core/MapUtils",
"./GraphicsMap"],function(a,b,q,l){class p extends b{constructor(c){super();this._limit=c;this._all=new l.GraphicsMap;this._active=new f(this);this._pending=new Map;this._handle=this._all.on("change",e=>this._handleChanges(e))}destroy(){this._handle.remove()}get length(){return this._active.length}toArray(){return this._active.toArray()}find(c){return this._active.find(c)}forEach(c){this._active.forEach(c)}addMany(c){this._all.addMany(c)}removeManyByObjectId(c){this._all.removeManyByObjectId(c)}_handleChanges(c){let e=
c.removed;if(0<this._pending.size){e=[];for(var g of c.removed)this._pending.delete(g.objectId)||e.push(g)}g=this._limit-this._active.length+e.length;g<c.added.length&&(this._active.removeMany(e),e=[],h.reset(1-this._limit/(this._active.length+c.added.length)),this._active.forEach(t=>{h.sample()&&(e.push(t),this._pending.set(t.objectId,t))}),g=this._limit-this._active.length+e.length);let d=c.added;if(g<c.added.length){d=[];h.reset(g/c.added.length);for(const t of c.added)h.sample()?d.push(t):this._pending.set(t.objectId,
t)}c=g-d.length;0<c&&0<this._pending.size&&(h.reset(c/this._pending.size),this._pending.forEach(t=>{h.sample()&&(d.push(t),this._pending.delete(t.objectId))}));this._active.addAndRemove(d,e)}}class k{constructor(){this._percentage=1;this._last=-1;this._index=0}reset(c){this._percentage=c;this._last=-1}sample(){const c=Math.floor(this._index*this._percentage);++this._index;if(c===this._last)return!1;this._last=c;return!0}}const h=new k;class f{constructor(c){this._parent=c;this._map=new Map}get length(){return this._map.size}forEach(c){this._map.forEach(e=>
c(e))}find(c){let e=void 0;q.someMap(this._map,g=>c(g)?(e=g,!0):!1);return e}toArray(){return[...this._map.values()]}addAndRemove(c,e){for(const g of c)this._map.set(g.objectId,g);for(const g of e)this._map.delete(g.objectId);(0<c.length||0<e.length)&&this._parent.emit("change",{added:c,removed:e})}removeMany(c){for(const e of c)this._map.delete(e.objectId);0<c.length&&this._parent.emit("change",{added:[],removed:c})}}a.LimitGraphicsMap=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},
"esri/views/3d/support/GraphicsMap":function(){define(["exports","../../../core/Evented","../../../core/MapUtils"],function(a,b,q){class l extends b{constructor(){super(...arguments);this._map=new Map}clear(){if(0<this._map.size){const p=this.toArray();this._map.clear();this.emit("change",{added:[],removed:p})}}get length(){return this._map.size}get(p){return this._map.get(p)}addMany(p){if(0!==p.length){var k=new Set;for(let h=0;h<p.length;h++){const f=p[h],c=f.objectId,e=this._map.get(c);e?(k.add(c),
f!==e&&(p[h]=e),e.refCount||(e.refCount=0),++e.refCount):(f.refCount=1,this._map.set(c,f))}p=0<k.size?p.filter(h=>!k.has(h.objectId)):p;0<p.length&&this.emit("change",{added:p,removed:[]})}}removeMany(p){const k=[];for(const h of p){p=h.objectId;const f=this._map.get(p);null!=f&&(!f.refCount||0>=--f.refCount)&&(this._map.delete(p),k.push(h))}0<k.length&&this.emit("change",{added:[],removed:k})}removeManyByObjectId(p){const k=[];for(const h of p)p=this._map.get(h),null!=p&&(!p.refCount||0>=--p.refCount)&&
(this._map.delete(h),k.push(p));0<k.length&&this.emit("change",{added:[],removed:k})}toArray(){return[...this._map.values()]}find(p){let k;q.someMap(this._map,h=>p(h)?(k=h,!0):!1);return k}forEach(p){this._map.forEach(k=>p(k))}}a.GraphicsMap=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/I3SMeshViewPerformanceInfo":function(){define(["exports","./support/LayerViewPerformanceInfo"],function(a,b){class q extends b.LayerViewPerformanceInfo{constructor(l,p,k,h,
f,c,e){super(l,0,0,0,p);this.gpuMB=k;this.geometryMB=h;this.textureMB=f;this.unloadedMB=c;this.idbHitRate=e}}a.I3SMeshViewPerformanceInfo=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/I3SMeshWorkerHandle":function(){define("exports ../../../core/Logger ../../../core/PooledArray ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../core/workers/WorkerHandle ../../../geometry/projection ../../../geometry/projection/projectVectorToVector ../../../libs/i3s/enums".split(" "),
function(a,b,q,l,p,k,h,f){function c(t,w,v){g.clear();var m=Infinity;let r=Infinity,n=-Infinity,u=-Infinity,x=!1;for(const z of w){var y="clip"===z.type?f.ModificationType.Inside:"mask"===z.type?f.ModificationType.Outside:f.ModificationType.Replace;const A=z.geometry;w=B=>B;if(A.spatialReference){if(!k.canProjectWithoutEngine(A.spatialReference,v)){b.getLogger("esri.views.3d.layers.I3SMeshWorkerHandle").warn("Can't project modification polygon into layer spatial reference, ignoring modification");
continue}w=B=>{h.projectVectorToVector(B,A.spatialReference,d,v);return d}}else A.hasZ||(d[2]=0,w=B=>{d[0]=B[0];d[1]=B[1];return d});x=x||y===f.ModificationType.Outside;g.push(y);g.push(A.rings.length);for(const B of A.rings){g.push(B.length);for(const C of B)y=w(C),g.push(y[0]),g.push(y[1]),g.push(y[2]),m=Math.min(m,y[0]),r=Math.min(r,y[1]),n=Math.max(n,y[0]),u=Math.max(u,y[1])}}null!=t&&(x?(g.push(f.ModificationType.Inside),g.push(2),g.push(4),g.push(m-1E-4),g.push(r-1E-4),g.push(0),g.push(n+1E-4),
g.push(r-1E-4),g.push(0),g.push(n+1E-4),g.push(u+1E-4),g.push(0),g.push(m-1E-4),g.push(u+1E-4),g.push(0)):(g.push(f.ModificationType.Outside),g.push(1)),g.push(4),g.push(t[0]),g.push(t[1]),g.push(0),g.push(t[2]),g.push(t[1]),g.push(0),g.push(t[2]),g.push(t[3]),g.push(0),g.push(t[0]),g.push(t[3]),g.push(0));g.push(f.ModificationType.Finished);t=new Float64Array(g.length);for(m=0;m<g.length;++m)t[m]=g.at(m);return t}class e extends p.WorkerHandle{constructor(t){super("SceneLayerWorker","process",{process:w=>
[w.geometryBuffer],project:w=>[w.positions.buffer],transformNormals:w=>[w.normals.buffer]},t,{hasInitialize:!0})}setModifications(t,w,v,m){t={context:t,modifications:c(w,v,m),isGeodetic:m.isGeographic};this.broadcast(t,"setModifications")}setLegacySchema(t,w){w=JSON.stringify(w);return this.broadcast({context:t,jsonSchema:w},"setLegacySchema")}destroyContext(t){return this.broadcast(t,"destroyContext")}project(t,w){return this.invokeMethod("project",t,w)}transformNormals(t,w){return this.invokeMethod("transformNormals",
t,w)}}const g=new q({deallocator:null}),d=l.create();a.I3SMeshWorkerHandle=e;a.toWasmModification=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/libs/i3s/enums":function(){define(["exports"],function(a){a.IndexType=void 0;(function(b){b[b.None=0]="None";b[b.Int16=1]="Int16";b[b.Int32=2]="Int32"})(a.IndexType||(a.IndexType={}));a.ModificationType=void 0;(function(b){b[b.Replace=0]="Replace";b[b.Outside=1]="Outside";b[b.Inside=2]="Inside";b[b.Finished=3]="Finished"})(a.ModificationType||
(a.ModificationType={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/II3SMeshView3D":function(){define(["exports"],function(a){a.ForAllFeaturesMode=void 0;(function(b){b[b.VISIBLE_ONLY=0]="VISIBLE_ONLY";b[b.ALL=1]="ALL";b[b.QUERYABLE=2]="QUERYABLE"})(a.ForAllFeaturesMode||(a.ForAllFeaturesMode={}));a.ForAllFeaturesReturnType=void 0;(function(b){b[b.EXIT=0]="EXIT";b[b.CONTINUE=1]="CONTINUE";b[b.SKIP=2]="SKIP"})(a.ForAllFeaturesReturnType||(a.ForAllFeaturesReturnType=
{}));a.ElevationMode=void 0;(function(b){b[b.Absolute=0]="Absolute";b[b.RelativeToGround=1]="RelativeToGround";b[b.OnTheGround=2]="OnTheGround"})(a.ElevationMode||(a.ElevationMode={}));Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/SceneLayerWorker":function(){define("require exports ../../../core/mathUtils ../../../geometry/SpatialReference ../../../geometry/support/DoubleArray ../../../geometry/support/MeshGeoreferencedVertexSpace ../../../geometry/support/MeshLocalVertexSpace ../../../chunks/vec3 ../../../libs/i3s/enums ../../../libs/i3s/I3SModule ./i3s/I3SNode".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){function d(y){if(u){var z=y.modifications,A=u._malloc(8*z.length),B=new Float64Array(u.HEAPU8.buffer,A,z.length);for(let C=0;C<z.length;++C)B[C]=z[C];u.setModifications(y.context,A,z.length,y.isGeodetic);u._free(A)}}function t(y,z,A){const {context:B,globalTrafo:C,mbs:D,obbData:F,elevationOffset:H,geometryBuffer:N,geometryDescriptor:E,indexToVertexProjector:G,vertexToRenderProjector:I}=z;var O=y._malloc(N.byteLength),L=y._malloc(33*Float64Array.BYTES_PER_ELEMENT),P=
new Uint8Array(y.HEAPU8.buffer,O,N.byteLength);P.set(new Uint8Array(N));var M=new Float64Array(y.HEAPU8.buffer,L,33);m(M,[NaN,NaN,NaN]);var K=M.byteOffset+3*M.BYTES_PER_ELEMENT,J=new Float64Array(M.buffer,K);m(J,C);K+=16*M.BYTES_PER_ELEMENT;J=new Float64Array(M.buffer,K);m(J,D);K+=4*M.BYTES_PER_ELEMENT;F&&(J=new Float64Array(M.buffer,K),m(J,F));M={isDraco:!1,isLegacy:!1,color:z.layouts.some(W=>W.some(S=>"color"===S.name)),normal:z.needNormals&&z.layouts.some(W=>W.some(S=>"normalCompressed"===S.name)),
uv0:z.layouts.some(W=>W.some(S=>"uv0"===S.name)),uvRegion:z.layouts.some(W=>W.some(S=>"uvRegion"===S.name)),featureIndex:E.featureIndex};P=y.process(B,!!z.obbData,O,P.byteLength,E,M,L,H,G,I,z.normalReferenceFrame);y._free(L);y._free(O);if(0<P.error.length)throw Error(`i3s.wasm: ${P.error}`);if(P.discarded)return null;y=0<P.componentOffsets.length?P.componentOffsets.slice():null;O=0<P.featureIds.length?P.featureIds.slice():null;L=0<P.anchorIds.length?Array.from(P.anchorIds):null;M=0<P.anchors.length?
Array.from(P.anchors):null;K=P.interleavedVertedData.slice().buffer;J=P.indicesType===c.IndexType.Int16?(new Uint16Array(P.indices.buffer,P.indices.byteOffset,P.indices.byteLength/2)).slice():(new Uint32Array(P.indices.buffer,P.indices.byteOffset,P.indices.byteLength/4)).slice();const R=P.positions.slice(),Q=P.positionIndicesType===c.IndexType.Int16?(new Uint16Array(P.positionIndices.buffer,P.positionIndices.byteOffset,P.positionIndices.byteLength/2)).slice():(new Uint32Array(P.positionIndices.buffer,
P.positionIndices.byteOffset,P.positionIndices.byteLength/4)).slice();z={layout:z.layouts[0],interleavedVertexData:K,indices:J,hasColors:P.hasColors,hasModifications:P.hasModifications,positionData:{data:R,indices:Q}};O&&A.push(O.buffer);y&&A.push(y.buffer);A.push(K);A.push(J.buffer);A.push(R.buffer);A.push(Q.buffer);return{componentOffsets:y,featureIds:O,anchorIds:L,anchors:M,transformedGeometry:z,obb:P.obb,globalTrafo:C}}function w(y){if(u){var {context:z,buffer:A}=y;y=u._malloc(A.byteLength);var B=
A.byteLength/Float64Array.BYTES_PER_ELEMENT,C=new Float64Array(u.HEAPU8.buffer,y,B),D=new Float64Array(A);C.set(D);u.filterOBBs(z,y,B);D.set(C);u._free(y)}}function v(y){u&&0===u.destroy(y)&&(u=null)}function m(y,z){for(let A=0;A<z.length;++A)y[A]=z[A]}function r(){if(u)return Promise.resolve(u);n||=e.get().then(y=>{u=y;n=null;return u});return n}let n,u;const x={transform:(y,z)=>u&&t(u,y,z),destroy:v};b.destroyContext=function(y){v(y)};b.dracoDecompressPointCloudData=async function(y){u=await r();
const z=[y.geometryBuffer];var {geometryBuffer:A}=y,B=A.byteLength;y=u._malloc(B);B=new Uint8Array(u.HEAPU8.buffer,y,B);B.set(new Uint8Array(A));A=u.dracoDecompressPointCloudData(y,B.byteLength);u._free(y);if(0<A.error.length)throw Error(`i3s.wasm: ${A.error}`);y=0<A.featureIds?.length?A.featureIds.slice():null;A=A.positions.slice();y&&z.push(y.buffer);z.push(A.buffer);return{result:{positions:A,featureIds:y},transferList:z}};b.filterObbsForModifications=async function(y){await r();w(y);y={buffer:y.buffer};
return{result:y,transferList:[y.buffer]}};b.filterObbsForModificationsSync=w;b.initialize=async function(){u||await r()};b.interpretObbModificationResults=function(y){return 0===y?g.NodeIMModificationImpact.Unmodified:1===y?g.NodeIMModificationImpact.PotentiallyModified:2===y?g.NodeIMModificationImpact.Culled:g.NodeIMModificationImpact.Unknown};b.process=async function(y){u=await r();const z=[y.geometryBuffer];return{result:t(u,y,z),transferList:z}};b.project=async function(y){const {localMatrix:z,
origin:A,positions:B,vertexSpace:C,localMode:D}=y;var F=l.fromJSON(y.inSpatialReference),H=l.fromJSON(y.outSpatialReference);const [{projectBuffer:N},{initializeProjection:E}]=await Promise.all([new Promise((P,M)=>a(["../../../geometry/projection/projectBuffer"],P,M)),new Promise((P,M)=>a(["../../../geometry/projection"],P,M))]);await E(F,H);y=[0,0,0];if(!N(A,F,0,y,H,0,1))throw Error("Failed to project");if("georeferenced"===C.type&&null==C.origin){var G=new Float64Array(B.length);if(!N(B,F,0,G,H,
0,G.length/3))throw Error("Failed to project");}else{G="georeferenced"===C.type?k.fromJSON(C):h.fromJSON(C);const {project:P}=await new Promise((M,K)=>a(["../../../geometry/support/meshUtils/projection"],M,K));F=P({positions:B,transform:z?{localMatrix:z}:void 0,vertexSpace:G,inSpatialReference:F,outSpatialReference:H,localMode:D});if(!F)throw Error("Failed to project");G=p.toFloat64Array(F)}F=G.length;const [I,O,L]=y;for(H=0;H<F;H+=3)G[H]-=I,G[H+1]-=O,G[H+2]-=L;return{result:{projected:G,original:B,
projectedOrigin:y},transferList:[G.buffer,B.buffer]}};b.setLegacySchema=async function(y){u=await r();u.setLegacySchema(y.context,y.jsonSchema)};b.setModifications=async function(y){await r();d(y)};b.setModificationsSync=d;b.test=x;b.transformNormals=async function({normalMatrix:y,normals:z}){const A=new Float32Array(z.length);f.transformMat3(A,z,y);q.hasScaling(y)&&f.normalize(A,A);return{result:{transformed:A,original:z},transferList:[A.buffer,z.buffer]}};Object.defineProperty(b,Symbol.toStringTag,
{value:"Module"})})},"esri/libs/i3s/I3SModule":function(){define(["require","exports","../../assets"],function(a,b,q){function l(k){return q.getAssetUrl(`esri/libs/i3s/${k}`)}let p;b.get=function(){p||=(new Promise(k=>(new Promise((h,f)=>a(["../../chunks/i3s"],h,f))).then(h=>h.i3s).then(({default:h})=>{const f=h({locateFile:l,onRuntimeInitialized:()=>k(f)});delete f.then}))).catch(k=>{throw k;});return p};Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/Highlights":function(){define(["../../../../core/arrayUtils",
"../../../../core/handleUtils","../II3SMeshView3D"],function(a,b,q){class l{constructor(){this.ids=new Set}}class p{constructor({collection:k,forAllFeatures:h,forAllFeaturesOfNode:f}){this._highlights=[];this._collection=k;this._forAllFeatures=h;this._forAllFeaturesOfNode=f}destroy(){this._highlights.forEach(k=>this._releaseSet(k));this._highlights=null}acquireSet(){const k=new l;this._highlights.push(k);const h=b.makeHandle(()=>{this._highlights&&(this._releaseSet(k),a.removeUnordered(this._highlights,
k))});return{set:k,handle:h}}setFeatureIds(k,h){h.forEach(f=>k.ids.add(f));this._initializeSet(k)}_initializeSet(k){this._forAllFeatures((h,f,c)=>{k.ids.has(h)&&this._collection.addComponentHighlight(c.objectHandle,f);return q.ForAllFeaturesReturnType.CONTINUE})}_releaseSet(k){this._forAllFeatures((h,f,c)=>{k.ids.has(h)&&this._collection.removeComponentHighlight(c.objectHandle,f);return q.ForAllFeaturesReturnType.CONTINUE})}objectCreated(k){this._highlights.forEach(h=>{this._forAllFeaturesOfNode(k,
(f,c)=>{h.ids.has(f)&&this._collection.addComponentHighlight(k.objectHandle,c);return q.ForAllFeaturesReturnType.CONTINUE})})}objectDeleted(k){this._collection.clearHighlights(k.objectHandle)}}return p})},"esri/views/3d/layers/i3s/I3SAsyncElevationUpdater":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../II3SMeshView3D ../graphics/ExtentSet ../../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){a.I3SAsyncElevationUpdater=class extends q{constructor(d,t,w,v){super({});this._updateExtent=t;this._updateNode=w;this._getElevationMode=v;this.running=!1;this._extentSet=new e.ExtentSet;this._nodeSet=new Set;t=this._taskPriority;d=d.registerTask(this._taskPriority,this);this.addHandles(d);this._task=d;this._lastTaskPriority=t}get _taskPriority(){const d=this._getElevationMode();return d?d===c.ElevationMode.RelativeToGround?g.TaskPriority.ELEVATION_ALIGNMENT_SCENE:
g.TaskPriority.ELEVATION_ALIGNMENT:g.TaskPriority.ELEVATION_ALIGNMENT}_updateTaskPriority(){const d=this._taskPriority;d!==this._lastTaskPriority&&(this._lastTaskPriority=this._task.priority=d)}normalizeCtorArgs(){return{}}addExtent(d){this._extentSet.add(d);this._updateTaskPriority();this.running=!0}schedule(d){this._nodeSet.add(d);this._updateTaskPriority();this.running=!0}remove(d){this._nodeSet.delete(d);this._updateRunning()}runTask(d){const t=this._extentSet;for(d.run(()=>t.merge(d));!t.empty&&
!d.done;){var w=this._updateExtent(t.pop());null!=w&&w.forAll(v=>this.schedule(v));d.madeProgress()}if(!d.done){w=this._nodeSet;for(const v of w)if(w.delete(v),this._updateNode(v),d.madeProgress(),d.done)break;this._updateRunning()}}_updateRunning(){this.running=0<this._nodeSet.size||0<this._extentSet.size}};b.__decorate([l.property()],a.I3SAsyncElevationUpdater.prototype,"running",void 0);a.I3SAsyncElevationUpdater=b.__decorate([f.subclass("esri.views.3d.layers.i3s.I3SAsyncElevationUpdater")],a.I3SAsyncElevationUpdater);
Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SCrossfadeHelper":function(){define(["exports","../../../../core/maybe","../../../../core/scheduling","../support/I3SLayerView"],function(a,b,q,l){class p{constructor(){this.lodCrossfadeSignedDuration=0}}class k{constructor(h){this._view=h;this._currentFrameStartTime=this._preRenderFrameTaskHandle=null;this._numFadingNodes=0}destroy(){this._preRenderFrameTaskHandle?.remove();this._view=this._preRenderFrameTaskHandle=
null}get updating(){return 0<this._numFadingNodes}stopNodeFading(h){null!=h.lodCrossfadeProgress&&(this._numFadingNodes--,h.lodCrossfadeProgress=null,0===this._numFadingNodes&&(null!=this._preRenderFrameTaskHandle&&(this._preRenderFrameTaskHandle=b.removeMaybe(this._preRenderFrameTaskHandle)),this._view.notifyLODUpdate(),this._view.notifyUpdate()))}_startNodeFading(h,f,c){0===this._numFadingNodes&&(this._preRenderFrameTaskHandle=q.addFrameTask({preRender:e=>this._updateAllNodeFading(e)}),this._view.notifyLODUpdate());
null==h.lodCrossfadeProgress&&(this._numFadingNodes++,this._view.notifyUpdate());h.lodCrossfadeSignedDuration=c;h.lodCrossfadeProgress=f}_updateAllNodeFading(h){const f=this._view.nodeCrossfadingEnabled;this._view.foreachCrossfadeNode((c,e)=>{if(null!=c?.lodCrossfadeProgress){const g=c.lodCrossfadeSignedDuration,d=c.lodCrossfadeProgress+Math.abs(h.deltaTime/g),t=!f||1<=d||0===g,w=(0<g?this._view.fullOpacity:0)-(t?0:0<g?1:-1)*(1-d);t?(this.stopNodeFading(c),0>g&&this._view.markNodeToRemove(e)):c.lodCrossfadeProgress=
d;this._view.setNodeOpacityByIndex(e,w)}});this._view.removeMarkedNodes()}stopAllNodeFading(){this._view.foreachCrossfadeNode((h,f)=>{null!=h?.lodCrossfadeProgress&&(this.stopNodeFading(h),h=h.lodCrossfadeSignedDuration,0>h&&this._view.markNodeToRemove(f),this._view.setNodeOpacityByIndex(f,0<h?this._view.fullOpacity:0))});this._view.removeMarkedNodes()}fadeNode(h,f,c,e){null==this._currentFrameStartTime&&(this._currentFrameStartTime=Date.now());var g=this._view;const d=g.nodeCrossfadingEnabled,t=
c===l.FadeDirection.FadeIn?g.fullOpacity:0;e=d?e?c===l.FadeDirection.FadeIn?g.lodCrossfadeinDuration:g.lodCrossfadeoutDuration:g.lodCrossfadeUncoveredDuration:0;g=this._view.getNodeOpacityByIndex(h);d&&g!==t&&0<e?this._startNodeFading(f,1-Math.abs(t-g),(c===l.FadeDirection.FadeIn?1:-1)*e):(this.stopNodeFading(f),this._view.setNodeOpacityByIndex(h,t),c===l.FadeDirection.FadeOut&&this._view.removeNode(h))}isNodeFullyFadedIn(h){const f=this._view.getNodeCrossfadeMetaData(h);return null==f||null==f.lodCrossfadeProgress&&
this._view.getNodeOpacityByIndex(h)===this._view.fullOpacity}}a.I3SCrossfadeHelper=k;a.NodeCrossfadeMetaData=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SIntersectionHandler":function(){define("exports ../../../ViewingMode ./I3SUtil ./Intersector ../../webgl-engine/lib/Intersector ../../webgl-engine/lib/IntersectorInterfaces ../../webgl-engine/lib/RayIntersections ../../webgl-engine/lib/verticalOffsetUtils".split(" "),function(a,b,q,l,p,k,h,f){function c(g,
d,t,w=0){w=g[3]+w;const v=d[0]-g[0],m=d[1]-g[1];g=d[2]-g[2];d=t[0];const r=t[1];t=t[2];const n=d*v+r*m+t*g;return 0<=n*n-(d*d+r*r+t*t)*(v*v+m*m+g*g-w*w)}class e{constructor(g){this.type=k.IntersectorType.I3S;this._needVerticalOffset=!1;this.layerUid=g.layerUid;this.sublayerUid=g.sublayerUid;this._collection=g.collection;this._traverseNodeHierarchy=g.traverseNodeHierarchy;this.slicePlaneEnabled=g.slicePlaneEnabled;this.isGround=g.isGround}updateElevationAlignState(g,d){this._needVerticalOffset=g&&
d===b.ViewingMode.Global}intersect(g,d,t,w,v,m){v=m??!1;const r=g.results,n=g.options.store===k.StoreResults.ALL,u=g.ray.direction,x=g.tolerance;let y=C=>C,z=C=>C;const A=f.getVerticalOffsetI3S(g.verticalOffset??(this._needVerticalOffset?0:null));null!=g.verticalOffset&&null!=A&&(y=C=>A.applyToMbs(C),z=C=>A.applyToObb(C));const B=new h.MeshIntersectionOptions(v,g.options.normalRequired);this._traverseNodeHierarchy((C,D)=>{if(0===C.childrenLoaded)return!1;const F=C.serviceObbInRenderSR?.isValid?C.serviceObbInRenderSR:
null;if(F&&!z(F).intersectRay(t,u,x))return!1;!D||!F&&q.isValidMbs(C.serviceMbsInRenderSR)&&!c(y(C.serviceMbsInRenderSR),t,u,x)||null!=C.geometryObbInRenderSR&&!z(C.geometryObbInRenderSR).intersectRay(t,u,x)||this._collection.intersect(D,t,w,x,A,B,(H,N,E,G)=>{if(!(0>N||null!=d&&!d(t,w,N))){var I=O=>{const L=new l.I3sTarget(this.layerUid,this.sublayerUid,C.index,H,G);O.set(this.type,L,N,E)};this.isGround&&(null==r.ground.dist||N<r.ground.dist)&&I(r.ground);if(!g.options.isFiltered&&((null==r.min.dist||
N<r.min.dist)&&I(r.min),(null==r.max.dist||N>r.max.dist)&&I(r.max),n)){const O=p.newIntersectorResult(g.ray);I(O);g.results.all.push(O)}}});return!0})}}a.I3SIntersectionHandler=e;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SOverrides":function(){define("exports ../../../../chunks/tslib.es6 ../../../../request ../../../../core/Accessor ../../../../core/arrayUtils ../../../../core/asyncUtils ../../../../core/byteSizeEstimations ../../../../core/Collection ../../../../core/handleUtils ../../../../core/has ../../../../core/Logger ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/ReactiveSet ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/support/spatialReferenceUtils ../../../../intl/number ../../../../layers/support/featureQueryAll ../../../../rest/support/meshFeatureSet ../../../../support/featureFlags ../../../../support/requestUtils ../../../ViewingMode ../FeatureLayerView3D".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C){function D(N,E,G,I){return`Displaying the edits of a SceneLayer with a${I===H.Mode?N.isGeographic?" geographic ":" projected ":" "}spatial reference (wkid:${N.wkid}) in ${G} viewing mode${I===H.SpatialReference?` with spatial reference (wkid:${E.wkid}) `:" "}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${I===H.Mode?"viewing mode":"view spatial reference"} to display edits.`}
a.I3SOverrides=class extends l{constructor(N){super(N);this._warnMaximumChangedObjectsExceeded=!1;this._maximumNumberOfEditOVerrides=5E4;this._original3DOFLDefinitionExpression=null;this._interactiveEditingSessions=new f;this.geometryOverrides=new f;this._clientGeometryCache=new Map;this._associatedLayerView=null;this._attributeChangedObjectIds=new w;this._geometryChangedObjectIds=new w;this._pendingFetchChangedObjectIds=null;this._pendingFetchAbortController=new AbortController;this._featureIdLocks=
new Map}initialize(){this._memCache=this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`);this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal);this._pendingFetchChangedObjectIds.finally(()=>{this._pendingFetchChangedObjectIds=this._pendingFetchAbortController=null});this.is3DOFL&&null!=this._associatedLayer&&(z.direct3DObjectFeatureLayerDisplayEnabled()?this._associatedLayer.load().then(N=>{this.destroyed||(this._original3DOFLDefinitionExpression=
N.definitionExpression,this.addHandles(v.watch(()=>this._definitionExpression,E=>N.definitionExpression=E,v.initial)),this._associatedLayerView=new C({layer:this._associatedLayer,view:this.view}))}):z.i3sPatchingEnabled())}destroy(){this.is3DOFL&&null!=this._associatedLayer&&(z.direct3DObjectFeatureLayerDisplayEnabled()?null!=this._associatedLayerView&&(this._associatedLayer.definitionExpression=this._original3DOFLDefinitionExpression):z.i3sPatchingEnabled());this._set("layer",null);this._memCache=
d.destroyMaybe(this._memCache);this._pendingFetchAbortController=d.abortMaybe(this._pendingFetchAbortController);this._pendingFetchChangedObjectIds=null;this._featureIdLocks.clear()}get is3DOFL(){return z.sceneLayerEditingEnabled()&&null!=this._associatedLayer?.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((N,E)=>N-E):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get hasGeometryChanges(){return 0<this._geometryChangedObjectIds.size}get _definitionExpression(){const N=
this.sortedGeometryChangedObjectIds;return 0===N.length?"1 \x3d 0":`OBJECTID IN (${N.join(",")})`}get updating(){return this.is3DOFL?this._pendingFetchChangedObjectIds?!0:z.direct3DObjectFeatureLayerDisplayEnabled()?null==this._associatedLayerView||null!=this._associatedLayerView&&this._associatedLayerView.updating:!1:!1}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._attributeChangedObjectIds.size&&0===this._geometryChangedObjectIds.size}featureHasGeometryChanges(N){return this._geometryChangedObjectIds.has(N)}featureHasAttributeChanges(N){return this._attributeChangedObjectIds.has(N)}createInteractiveEditSession(N){this._attributeChangedObjectIds.add(N);
const E=this._interactiveEditingSessions,G=new F(N,()=>{E.remove(G)});E.unshift(G);return G}async applyAttributeOverrides(N,E,G,I=[]){this._pendingFetchChangedObjectIds&&await t.whenOrAbort(this._pendingFetchChangedObjectIds,G);if(null!=E){var {attributeData:O,loadedAttributes:L}=E;if(null!=L&&null!=O&&0!==this._attributeChangedObjectIds.size){E=new Set;for(var P of L)E.add(P.index);for(const K of I)E.has(K.index)||(L.push(K),O[K.name]=Array(N.length));I=await this._lockFeatureIds(N);try{P={attributeData:O,
loadedAttributes:L};const K=this._getOverridesFromCache(N,P,this._attributeChangedObjectIds),{objectIds:J,fieldNames:R}=K;if(0!==J.length&&0!==R.length){var M=await this._queryAttributeOverridesFromAssociatedLayer(J,R,G);null!=M&&this._processOverridesFromAssociatedLayer(N,M,R,P)}}finally{I.remove()}}}}updateGeometry(N,E){this._geometryChangedObjectIds.add(N);const G=this._clientGeometryCache.get(N);null!=G&&(this.geometryOverrides.remove(G),this._clientGeometryCache.delete(N));null!=E&&(E={oid:N,
mesh:E},this.geometryOverrides.add(E),this._clientGeometryCache.set(N,E))}updateAttributeValue(N,E,G){this._attributeChangedObjectIds.add(N);this._cacheAttributeValue(N,E,G)}featureAdded(N){this.is3DOFL&&z.i3sPatchingEnabled()&&this._geometryChangedObjectIds.add(N);this._attributeChangedObjectIds.add(N)}_cacheAttributeValue(N,E,G){this._memCache.put(this._getAttributeCacheKey(N,E),G,this._memCacheAttributeValueSize(G))}_getOverridesFromCache(N,{loadedAttributes:E,attributeData:G},I){const O=new Set,
L=[];for(var P of E)L[P.index]=G[P.name];G=new Set;for(P=0;P<N.length;P++){const M=N[P];if(I.has(M))for(const K of E){const J=this._attributeFromCache(M,K.index);void 0!==J?L[K.index][P]=J:(O.add(M),G.add(K.name))}}return{objectIds:Array.from(O),fieldNames:Array.from(G)}}_attributeFromCache(N,E){const G=this._fromInteractiveEditingSession(N,E);if(void 0!==G)return G;N=this._getAttributeCacheKey(N,E);return this._memCache.get(N)}_fromInteractiveEditingSession(N,E){if(null!=this._interactiveEditingSessions)for(const G of this._interactiveEditingSessions){if(G.objectId!==
N)continue;const I=G.getAttribute(E);if(void 0!==I)return I}}_getAttributeCacheKey(N,E){return`${N}-${E}`}async _queryAttributeOverridesFromAssociatedLayer(N,E,G){if(0===N.length)return null;this._logWarningIfMaximumObjectsExceeded();const {associatedLayer:I}=this.layer;if(null==I)return null;const O=I.createQuery(),{objectIdField:L}=I;E=[L,...E];O.where="1\x3d1";O.returnGeometry=!1;O.outFields=E;O.cacheHint=!0;N=await this._executeBatchQuery(I,N,O,G);G=[];for(const P of N)if(P.ok)for(const M of P.value.features)G.push(M);
return G}async _queryGeometryOverridesFromAssociatedLayer(N,E){if(0===N.length||!this.is3DOFL||!z.i3sPatchingEnabled())return null;var G=this.layer.associatedLayer;const I=G.infoFor3D,{spatialReference:O}=G,{state:{viewingMode:L},spatialReference:P}=this.view;var M=L===B.ViewingMode.Global,K=O.isGeographic;if(M&&!K)return g.getLogger(this).warn("unsupported-pcs-edits-in-global-view",this.layer.title,D(O,P,this.view.viewingMode,H.Mode)),null;if(!M&&K)return g.getLogger(this).warn("unsupported-gcs-edits-in-local-view",
this.layer.title,D(O,P,this.view.viewingMode,H.Mode)),null;if(!(n.equals(O,P)||M&&P.isWebMercator&&O.isWGS84))return g.getLogger(this).warn("unsupported-mismatched-spatial-reference-edits",this.layer.title,D(O,P,this.view.viewingMode,H.SpatialReference)),null;this._logWarningIfMaximumObjectsExceeded();const {objectIdField:J,globalIdField:R}=G;M=[J,...(null!=R?[R]:[])];K=G.createQuery();K.where="1\x3d1";K.returnGeometry=!0;K.outFields=M;K.cacheHint=!0;K.returnZ=G.hasZ;K.returnM=G.hasM;E=await this._executeBatchQuery(G,
N,K,E);N=[];for(const Q of E){if(!Q.ok)continue;const {assetMaps:W,features:S,globalIdFieldName:V}=Q.value;if(null!=W){E=y.assetMapFromAssetMapsJSON(I,W);for(const T of S)G=y.extractMesh(T,V,O,I,E),M=T,null==G?M.geometry=null:(M.geometry=G,N.push(M))}}return N}_logWarningIfMaximumObjectsExceeded(){if(this._warnMaximumChangedObjectsExceeded){this._warnMaximumChangedObjectsExceeded=!1;var N=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${u.formatNumber(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`,
E=this.layer.portalItem;N=E?.loaded?N+` (${E.portal.url}/home/item.html?id=${E.id}#settings)`:N+` (${this.layer.parsedUrl.path})`;g.getLogger(this).warn("#queryOverrides()",this.layer.title,`${N}.`)}}async _executeBatchQuery(N,E,G,I){if(0===E.length)return[];const O=x.getMaximumQuerySize(N);E=[...E].sort((L,P)=>L-P);E=p.splitIntoChunks(E,O).map(L=>{const P=G.clone();P.objectIds=L;return k.resultOrAbort(x.queryAllJSON(N,P,{signal:I}))});return Promise.all(E)}_processOverridesFromAssociatedLayer(N,
E,G,{loadedAttributes:I,attributeData:O}){var L=this._associatedLayer;if(null!=L){L=L.objectIdField;var P=G.map(J=>{J in O||(O[J]=Array(N.length));return O[J]}),M=new Map(I.map(J=>[J.name,J.index]));I=G.map(J=>M.get(J));var K=new Map(Array.from(N,(J,R)=>[J,R]));for(const J of E){E=J.attributes[L];for(let R=0;R<G.length;R++){const Q=I[R],W=K.get(E),S=J.attributes[G[R]];P[R][W]=S;this._cacheAttributeValue(E,Q,S)}}}}_memCacheAttributeValueSize(N){return"string"===typeof N?h.estimateStringByteSize(N):
h.estimateNumberByteSize()}async _fetchChangedObjectIds(N){var E=this.layer;await E.load({signal:N});this._geometryChangedObjectIds.clear();this._attributeChangedObjectIds.clear();({associatedLayer:E}=E);if(null!=E&&E.capabilities?.operations?.supportsChangeTracking){var G=this._getFetchChangedObjectIdsServerGen();if(null!=G){var I=E.layerId,O=this.is3DOFL;G={f:"json",returnIdsOnly:!0,layers:`[${I}]`,returnUpdates:!0,returnDeletes:O,returnInserts:O,layerServerGens:JSON.stringify([{id:I,serverGen:G}])};
O&&(I=E.infoFor3D,G.fieldsToCompare=JSON.stringify({fields:[...Object.values(I.transformFieldRoles),I.sourceHashField]}));G=await k.result(q(`${E.url}/extractChanges`,{method:"post",query:G,timeout:1E4,signal:N}));!G.ok&&A.isTimeoutError(G.error)&&(I=this.layer.title,g.getLogger(this).warn("extractChanges:timeout",I,`${I} could not obtain edited features that are not cached in the scene service. Display of features may not be up to date with the latest edits. Consider re-caching the scene service.`));
if(G.ok&&1===G.value.data?.edits?.length){I=G.value.data.edits[0];G=I?.objectIds;var L=G?.adds??[];const P=G?.updates??[],M=G?.deletes??[];G=[...L,...P,...M];O=O?[...L,...(I?.fieldUpdates??P),...M]:[];I=Math.min(this._maximumNumberOfEditOVerrides,G.length);I<G.length&&(this._warnMaximumChangedObjectsExceeded=!0);G=G.sort((K,J)=>K-J);for(L=0;L<I;++L)this._attributeChangedObjectIds.add(G[L]);for(const K of O)this._geometryChangedObjectIds.add(K);if(this.is3DOFL&&z.i3sPatchingEnabled()&&0<this._geometryChangedObjectIds.size&&
(N=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),N),null!=N))for(const K of N)null!=K.geometry&&this.updateGeometry(K.attributes[E.objectIdField],K.geometry)}}}}_getFetchChangedObjectIdsServerGen(){var N=this.layer;if(null!=N.serviceUpdateTimeStamp?.lastUpdate)return N.serviceUpdateTimeStamp.lastUpdate;N=N.associatedLayer;return null!=N?.serverGens?.minServerGen?N.serverGens.minServerGen:null}async _lockFeatureIds(N){const E=this._featureIdLocks;
for(var G=!0;G;){const O=[];for(const L of N){const P=E.get(L);P&&O.push(P)}0===O.length?G=!1:await Promise.all(O)}const I=t.createResolver();G=I.promise;for(const O of N)E.set(O,G);return c.makeHandle(()=>{for(const O of N)E.delete(O);I.resolve()})}get test(){}};b.__decorate([m.property({constructOnly:!0})],a.I3SOverrides.prototype,"view",void 0);b.__decorate([m.property({constructOnly:!0})],a.I3SOverrides.prototype,"layer",void 0);b.__decorate([m.property({readOnly:!0})],a.I3SOverrides.prototype,
"is3DOFL",null);b.__decorate([m.property()],a.I3SOverrides.prototype,"_interactiveEditingSessions",void 0);b.__decorate([m.property({readOnly:!0})],a.I3SOverrides.prototype,"sortedGeometryChangedObjectIds",null);b.__decorate([m.property({readOnly:!0})],a.I3SOverrides.prototype,"geometryOverrides",void 0);b.__decorate([m.property()],a.I3SOverrides.prototype,"_clientGeometryCache",void 0);b.__decorate([m.property()],a.I3SOverrides.prototype,"_associatedLayer",null);b.__decorate([m.property()],a.I3SOverrides.prototype,
"_associatedLayerView",void 0);b.__decorate([m.property({constructOnly:!0})],a.I3SOverrides.prototype,"memoryController",void 0);b.__decorate([m.property()],a.I3SOverrides.prototype,"_attributeChangedObjectIds",void 0);b.__decorate([m.property()],a.I3SOverrides.prototype,"_geometryChangedObjectIds",void 0);b.__decorate([m.property()],a.I3SOverrides.prototype,"hasGeometryChanges",null);b.__decorate([m.property()],a.I3SOverrides.prototype,"_pendingFetchChangedObjectIds",void 0);b.__decorate([m.property()],
a.I3SOverrides.prototype,"_pendingFetchAbortController",void 0);b.__decorate([m.property()],a.I3SOverrides.prototype,"_definitionExpression",null);b.__decorate([m.property()],a.I3SOverrides.prototype,"updating",null);b.__decorate([m.property()],a.I3SOverrides.prototype,"isEmpty",null);a.I3SOverrides=b.__decorate([r.subclass("esri.views.3d.layers.i3s.I3SOverrides")],a.I3SOverrides);class F{constructor(N,E){this.objectId=N;this._remove=E;this._updates=new Map;this._isActive=!0}getAttribute(N){return this._updates.get(N)}setAttribute(N,
E){this.isActive&&this._updates.set(N,E)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}var H;(function(N){N[N.Mode=0]="Mode";N[N.SpatialReference=1]="SpatialReference"})(H||={});Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/rest/support/meshFeatureSet":function(){define("exports ../../Graphic ../../core/Logger ../../core/MapUtils ../../geometry/Extent ../../geometry/Mesh ../../geometry/Point ../../geometry/SpatialReference ../../geometry/support/MeshTransform ../../geometry/support/meshUtils/External ../../layers/support/infoFor3D ./FeatureSet".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d){function t(u){return({attributes:x})=>{if(!x)return{};if(!u)return x;for(const y in x)u.has(y)||delete x[y];return x}}function w(u,x,y,z,A){var B=A.get(u.attributes[x]);if(null==B||!u.geometry)return null;x=v(u,y,z);A=p.fromJSON(u.geometry);A.spatialReference=y;u=m(u.attributes,z);y=y.isGeographic?"local":"georeferenced";a:{B=Array.from(B.files.values());z=[];for(C of B){if(C.status!==n.COMPLETED){var C=null;break a}B=[];for(const D of C.parts){if(!D){C=null;break a}B.push(new e.ServiceAssetPart(D.url,
D.hash))}z.push(new e.ServiceAsset(C.name,C.mimeType,B))}C=z}return C?k.createWithExternalSource(x,C,{extent:A,transform:u,vertexSpace:y}):k.createIncomplete(x,{extent:A,transform:u,vertexSpace:y})}function v({attributes:u},x,{transformFieldRoles:y}){return new h({x:u[y.originX],y:u[y.originY],z:u[y.originZ],spatialReference:x})}function m(u,{transformFieldRoles:x}){return new c({translation:[u[x.translationX],-u[x.translationZ],u[x.translationY]],rotationAxis:[u[x.rotationX],-u[x.rotationZ],u[x.rotationY]],
rotationAngle:u[x.rotationDeg],scale:[u[x.scaleX],u[x.scaleZ],u[x.scaleY]]})}function r(u,x){const y=new Map;for(const A of x){var z=A.parentGlobalId;if(null==z)continue;const B=A.assetName,C=A.assetType;x=A.assetHash;const D=A.assetURL,F=A.conversionStatus,H=A.seqNo,N=g.getFormatIdMimeType(C,u.supportedFormats);N?(z=l.getOrCreateMapValue(y,z,()=>({files:new Map})),l.getOrCreateMapValue(z.files,B,()=>{a:switch(F){case "COMPLETED":case "SUBMITTED":var E=n.COMPLETED;break a;case "INPROGRESS":E=n.PENDING;
break a;default:E=n.FAILED}return{name:B,type:C,mimeType:N,status:E,parts:[]}}).parts[H]={hash:x,url:D}):q.getLogger("esri.rest.support.meshFeatureSet").error("mesh-feature-set:unknown-format",`Service returned an asset of type ${C}, but it does not list it as a supported type`)}return y}var n;(function(u){u[u.FAILED=0]="FAILED";u[u.PENDING=1]="PENDING";u[u.COMPLETED=2]="COMPLETED"})(n||={});a.assetMapFromAssetMapsJSON=r;a.extractMesh=w;a.meshFeatureSetFromJSON=function(u,x,y){var z=y.features;y.features=
[];delete y.geometryType;const A=d.fromJSON(y);A.geometryType="mesh";if(!y.assetMaps)return A;const B=r(x,y.assetMaps),C=u.sourceSpatialReference??f.WGS84;y=y.globalIdFieldName;({outFields:u}=u);u=null!=u&&0<u.length?t(u.includes("*")?null:new Set(u)):()=>({});for(const D of z)z=w(D,y,C,x,B),A.features.push(new b({geometry:z,attributes:u(D)}));return A};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/IDBCache":function(){define(["exports","../../../../core/ByteSizeUnit",
"../../../../core/Error","../../../../core/promiseUtils"],function(a,b,q,l){function p(f){return new Promise((c,e)=>{f.oncomplete=()=>c();f.onerror=()=>e(f.error);f.onabort=()=>e(f.error)})}function k(f){return new Promise((c,e)=>{"done"===f.readyState?null!=f.error?e(f.error):c(f.result):(f.onsuccess=()=>c(f.result),f.onerror=()=>e(f.error))})}class h{constructor(f,c,e=14){this._version=e;this._quotaReductionPromise=this._db=null;this._miss=this._hit=this._gcCounter=0;this._destroyed=!1;this.gcFrequency=
50;this.maxByteSize=b.ByteSizeUnit.GIGABYTES;this.quotaReductionFactor=.2;this._dbName=f;this._storeName=c}init(){return Promise.resolve().then(()=>{const f=indexedDB.open(this._dbName,this._version);f.onupgradeneeded=c=>{var e=f.result;const g=f.transaction,d=e.objectStoreNames.contains(this._storeName)?g.objectStore(this._storeName):e.createObjectStore(this._storeName);e=e.objectStoreNames.contains("last_access")?g.objectStore("last_access"):e.createObjectStore("last_access");e.indexNames.contains("date")||
e.createIndex("date","date",{unique:!1});e.indexNames.contains("byteSize")||e.createIndex("byteSize","byteSize",{unique:!1});c.oldVersion<this._version&&(d.clear(),e.clear())};return k(f)}).then(f=>{this._destroyed?f.close():this._db=f})}destroy(){this._db&&(this._db.close(),this._db=null);this._destroyed=!0}get initialized(){return null!=this._db}getHitRate(){return this._hit/(this._hit+this._miss)}put(f,c){return null==this._db?Promise.reject(new q("indexedb:not-initialized","IndexedDB Cache is not initialized")):
(null!=this._quotaReductionPromise?this._quotaReductionPromise:Promise.resolve()).then(()=>this._put(f,c)).catch(e=>{if(e&&"QuotaExceededError"===e.name)return null==this._quotaReductionPromise&&(this._quotaReductionPromise=this._getCacheSize().then(g=>this._removeLeastRecentlyAccessed(c.byteSize+Math.ceil(g*this.quotaReductionFactor))),this._quotaReductionPromise.then(()=>this._quotaReductionPromise=null,()=>this._quotaReductionPromise=null)),this._quotaReductionPromise.then(()=>this._put(f,c));
throw e;}).then(()=>{this._gcCounter--;0>this._gcCounter&&null!=this._db&&(this._gcCounter=this.gcFrequency,this._getCacheSize().then(e=>this._removeLeastRecentlyAccessed(e-this.maxByteSize)))})}get(f,c){const e=this._db;if(null==e)return Promise.resolve(void 0);let g=null;return Promise.resolve().then(()=>{const d=e.transaction(this._storeName,"readonly");g=l.onAbort(c,()=>{d.abort()});const t=d.objectStore(this._storeName).get(f);return k(t)}).then(d=>{null==d?++this._miss:this._db&&(++this._hit,
this._db.transaction("last_access","readwrite").objectStore("last_access").put({date:Date.now(),byteSize:d.byteSize},f));null!=g&&g.remove();return d}).catch(()=>{++this._miss;l.throwIfAborted(c);null!=g&&g.remove()})}remove(f){const c=this._db;return null==c?Promise.resolve():Promise.resolve().then(async()=>{const e=c.transaction([this._storeName,"last_access"],"readwrite");var g=e.objectStore(this._storeName),d=e.objectStore("last_access");g=g.delete(f);d=d.delete(f);await Promise.all([k(g),k(d),
p(e)])})}_put(f,c){var e=this._db;if(null==e)return Promise.resolve();e=e.transaction([this._storeName,"last_access"],"readwrite");var g=e.objectStore(this._storeName);const d=e.objectStore("last_access");g=g.put(c,f);f=d.put({date:Date.now(),byteSize:c.byteSize},f);return Promise.all([k(g),k(f),p(e)])}_removeLeastRecentlyAccessed(f){if(0>=f||!this._db)return Promise.resolve();const c=this._db.transaction([this._storeName,"last_access"],"readwrite"),e=c.objectStore(this._storeName),g=c.objectStore("last_access");
let d=0;const t=g.index("date").openCursor(null,"next");t.onsuccess=()=>{const w=t.result;null!=w&&(null!=w.value.byteSize&&(d+=w.value.byteSize),e.delete(w.primaryKey),g.delete(w.primaryKey),d<f&&w.continue())};return p(c)}_getCacheSize(){var f=this._db;if(null==f)return Promise.resolve(0);f=f.transaction("last_access");let c=0;const e=f.objectStore("last_access").index("byteSize").openKeyCursor();e.onsuccess=()=>{const g=e.result;if(g){var d=g.key;null!=d&&(c+=d);g.continue()}};return p(f).then(()=>
c)}}a.IDBCache=h;a.whenRequest=k;a.whenTransaction=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/IDBMockCache":function(){define(["exports"],function(a){const b=new WeakMap;class q{constructor(l,p){this._hit=this._miss=0;this.initialized=!0;switch(p){case "layer":this._data=new Map;break;case "view":(p=b.get(l))?this._data=p:(this._data=p=new Map,b.set(l,p))}}init(){return Promise.resolve()}async get(l,p){if(this._data.has(l))return this._hit++,this._data.get(l)??
void 0;this._miss++}destroy(){}put(l,p){this._data.set(l,p);return Promise.resolve()}remove(l){this._data.delete(l);return Promise.resolve()}getHitRate(){return this._hit/(this._hit+this._miss)}}a.IDBMockCache=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/LayerElevationProvider":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/Logger ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/mat4 ../../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/projection/projectBoundingSphere ../../../../geometry/support/aaBoundingRect ../../../../chunks/sphere ../../support/ElevationRange ../../support/ElevationUpdateEvent ../../webgl-engine/lib/Intersector ../../webgl-engine/lib/IntersectorInterfaces".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x){a.LayerElevationProvider=class extends l.EventedMixin(q){constructor(D){super(D);this._tmpEvent=new n.ElevationUpdateEvent;this._renderCoordsHelper=D.view.renderCoordsHelper;this._renderSR=this._renderCoordsHelper.spatialReference;this._layerElevationSource=D.layerElevationSource}initialize(){this._intersector=u.newIntersector(this.view.state.viewingMode);this._intersector.options.store=x.StoreResults.MIN;this._intersector.options.normalRequired=!1;
this._tmpEvent.context=this.intersectionHandler.isGround?"ground":"scene"}get spatialReference(){return this.view?.elevationProvider?.spatialReference}getElevation(D,F,H,N){const E=this._renderCoordsHelper;D=d.set(A,D,F,H);if(!E.toRenderCoords(D,N,D))return p.getLogger(this).error("could not project point to compute elevation"),null;const {layerElevationSource:G,_intersector:I,intersectionHandler:O}=this;N=G.fullExtent;F=null!=N&&Number.isFinite(N.xmin)&&Number.isFinite(N.xmax)&&Number.isFinite(N.ymin)&&
Number.isFinite(N.ymax)&&Number.isFinite(N.zmin)&&Number.isFinite(N.zmax)?new r.ElevationRange(N.zmin,N.zmax):G.elevationRange;if(null==F)return null;H=G.elevationOffset;N=F.elevationRangeMin+H;F=E.setAltitude(B,F.elevationRangeMax+H,D);N=E.setAltitude(C,N,D);I.reset(F,N,null);O.intersect(I,null,F,N,null,!0);return I.results.min.getIntersectionPoint(D)?E.getAltitude(D):null}getSphereElevationBounds(D,F){w.projectBoundingSphere(D,F,z,this._renderSR);return this._layerElevationSource.getElevationRange(z)}getRootElevationBounds(){const D=
this.layerElevationSource.fullExtent;return D?.hasZ?new r.ElevationRange(D.zmin,D.zmax):null}objectsChanged(D){this.spatialReference&&(this._computeLayerExtent(D,this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}objectChanged(D){this.spatialReference&&(this._computeObjectExtent(D,this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}_computeObjectExtent(D,F){v.empty(F);
this._expandExtent(D,F)}_computeLayerExtent(D,F){v.empty(F);for(const H of D)this._expandExtent(H,F)}_expandExtent(D,F){const H=this.spatialReference;if(null!=H&&null!=D){e.fromQuat(y,D.quaternion);y[12]=D.center[0];y[13]=D.center[1];y[14]=D.center[2];D=D.halfSize;for(let N=0;8>N;++N)A[0]=N&1?D[0]:-D[0],A[1]=N&2?D[1]:-D[1],A[2]=N&4?D[2]:-D[2],d.transformMat4(A,A,y),this._renderCoordsHelper.fromRenderCoords(A,A,H),v.expand(F,A,F)}}};b.__decorate([k.property({constructOnly:!0})],a.LayerElevationProvider.prototype,
"layerElevationSource",void 0);b.__decorate([k.property({constructOnly:!0})],a.LayerElevationProvider.prototype,"intersectionHandler",void 0);b.__decorate([k.property({constructOnly:!0})],a.LayerElevationProvider.prototype,"view",void 0);b.__decorate([k.property()],a.LayerElevationProvider.prototype,"spatialReference",null);a.LayerElevationProvider=b.__decorate([c.subclass("esri.views.3d.layers.i3s.LayerElevationProvider")],a.LayerElevationProvider);const y=g.create(),z=m.fromValues(0,0,0,0),A=t.create(),
B=t.create(),C=t.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/makeScheduleFunction":function(){define(["exports"],function(a){a.makeScheduleFunction=function(b){return q=>{if(b.immediate)return b.immediate.schedule(q);console.error("No immediate scheduler");throw Error("No immediate scheduler");}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/ObjectParameters":function(){define(["exports"],
function(a){class b{constructor(q,l,p,k){this.toMapSpace=q;this.transform=l;this.obb=p;this.geometry=k}}a.ObjectParameters=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/collections/Component/Transform":function(){define(["exports"],function(a){class b{constructor(q,l){this.position=q;this.rotationScale=l;this.origin=void 0}}a.Transform=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/featureEditing":function(){define(["exports",
"../../../../core/asyncUtils","../../../../core/lang","../../../../layers/support/featureQueryAll"],function(a,b,q,l){function p(t,w,v,m,r=null,n=!0){const u=[];t={gidToFeatureInfo:new Map,oidToFeatureInfo:new Map,featuresResolved:null==v,fieldsIndex:t.fieldsIndex,objectIdField:t.objectIdField,globalIdField:t.globalIdField,featureOrIdentifierList:v};for(const A of w)if(null==A.error){w=A.objectId??-1;v=A.globalId;if(-1===w||n){var x=w;var y=v,z=t;const {gidToFeatureInfo:B,oidToFeatureInfo:C,fieldsIndex:D,
objectIdField:F,globalIdField:H,featureOrIdentifierList:N}=z;if(!z.featuresResolved&&null!=N){for(const E of N){const G={feature:null,oid:-1,gid:null};if("attributes"in E){G.feature=E;const I=E.attributes;if(null!=I)for(const O in I){if(-1!==G.oid&&null!=G.gid)break;const L=D.normalizeFieldName(O);L===F&&(G.oid=I[O]??-1);L===H&&(G.gid=I[O])}}else G.oid=E.objectId??-1,G.gid=E.globalId;null!=G.gid&&B.set(G.gid,G);-1!==G.oid&&C.set(G.oid,G)}z.featuresResolved=!0}x=(-1!==x?C.get(x):null)??(null!=y?B.get(y):
null)}else x=null;x=x??{feature:null,oid:w,gid:v};w={oid:-1===w?x.oid:w,gid:v??x.gid,feature:x.feature,result:A};u.push(w);-1===w.oid&&null!=w.gid&&null!=r&&(w.oid=r.get(w.gid)??-1);-1===w.oid&&null!=w.gid&&(v=m.get(w.gid),null==v&&(v=[],m.set(w.gid,v)),v.push(w))}return u}async function k(t,w){t=t.i3sOverrides.layer.associatedLayer;if(null!=t?.globalIdField){var v=t.createQuery(),{objectIdField:m,globalIdField:r}=t;v.where=Array.from(w.keys()).map(n=>`${r}='${n}'`).join(" OR ");v.returnGeometry=
!1;v.outFields=[m,r];v.cacheHint=!1;t=await b.resultOrAbort(l.queryAllJSON(t,v));if(t.ok){t=t.value.features;for(const n of t)if(v=n.attributes[r],t=n.attributes[m],null!=v&&null!=t&&-1!==t&&(v=w.get(v),null!=v))for(const u of v)u.oid=t}}}function h(t,w){const v=new Map;w=w.adds;if(!w||0===w.length||null==t.globalIdField)return v;for(const m of w)t=m.oid,w=m.feature,"mesh"===w?.geometry?.type&&v.set(t,w);return v}function f(t,w){const v=w.updates;if(!v||0===v.length)return new d;const m=new d;w=new Map;
for(let r=0;r<t.attributeStorageInfo.length;r++)w.set(t.attributeStorageInfo[r].name,r);t.forEachNode((r,n)=>{for(const A of v){if(null==A.feature)continue;const B=A.feature,C=A.oid,D=n.indexOf(C);for(const F in B.attributes){var u=t.fieldsIndex.normalizeFieldName(F);var x=m;var y=r.index,z=x.get(y);z?x=z:(z=new g,x.set(y,z),x=z);(y=null!=u&&x.get(u))?u=y:(y=[],x.set(u,y),u=y);u.push({featureIndex:D,featureId:C,value:B.attributes[F]})}}});return m}const c={setAttribute(){},rollback(){},commit(){}};
var e;(function(t){t[t.EDITING=0]="EDITING";t[t.ROLLED_BACK=1]="ROLLED_BACK";t[t.COMMITTED=2]="COMMITTED"})(e||={});const g=Map,d=Map;a.createInteractiveEditSession=function(t,w){const v=w.attributes[t.objectIdField];if(null==v)return c;var m=t.sessions.get(v);if(m)return m;const r=q.clone(w.attributes),n=new Set,u=t.i3sOverrides.createInteractiveEditSession(v),x=new Map;let y=e.EDITING;m={setAttribute(z,A){if(y===e.EDITING){var B=t.fieldsIndex.get(z);if(B){var C=t.attributeStorageInfo.findIndex(H=>
H.name===B.name);if(!(0>C)){if(!(z in r))throw Error(`Attribute "${z}" is not an attribute of the edited feature.`);u.setAttribute(C,A);var D=t.attributeStorageInfo[C],F=!1;n.add(z);t.forEachNode((H,N)=>{var E=x.get(H);null==E?(N=N.indexOf(v),x.set(H,N)):N=E;if(-1!==N&&(E=t.getAttributeData(H.index))){const G=E[D.name];G&&(G[N]=A,t.setAttributeData(H.index,E,w),F=!0)}});F&&t.clearMemCache()}}}},rollback(){if(y===e.EDITING){for(const z of n)this.setAttribute(z,r[z]);u.remove();y=e.ROLLED_BACK;t.sessions.delete(v)}},
commit(){y===e.EDITING&&(u.remove(),y=e.COMMITTED,t.sessions.delete(v))}};t.sessions.set(v,m);return m};a.normalizeEditResultsEvent=async function(t,w){const v=new Map,m=p(t,w.addedFeatures,w.edits?.addFeatures,v),r=p(t,w.updatedFeatures,w.edits?.updateFeatures,v);w=p(t,w.deletedFeatures,w.edits?.deleteFeatures,v,w.globalIdToObjectId,!1);0<v.size&&await k(t,v);return{adds:m.filter(n=>-1!==n.oid),updates:r.filter(n=>-1!==n.oid),deletes:w.filter(n=>-1!==n.oid)}};a.processAttributeEdits=function(t,w){var v=
f(t,w);w=h(t,w);if(0!==v.size||0!==w.size){var m=new Map;for(var r=0;r<t.attributeStorageInfo.length;r++)m.set(t.attributeStorageInfo[r].name,r);var n=!1;v.forEach((A,B)=>{const C=t.getAttributeData(B);let D=!1;A.forEach((F,H)=>{const N=null!=C?C[H]:null;H=m.get(H);for(const {featureIndex:E,value:G,featureId:I}of F)N&&(N[E]=G,n=D=!0),t.i3sOverrides.updateAttributeValue(I,H,G)});D&&t.setAttributeData(B,C,null)});n&&t.clearMemCache();var {fieldsIndex:u,i3sOverrides:x,objectIdField:y,globalIdField:z}=
t;v=x.layer.associatedLayer?.infoFor3D;v=new Set(v?[...Object.values(v.assetMapFieldRoles),...Object.values(v.transformFieldRoles)]:[]);for(const [A,B]of w){x.featureAdded(A);({attributes:w}=B);for(const C in w)C!==y&&C!==z&&v.has(C)||(r=u.normalizeFieldName(C),r=null!=r?m.get(r):null,null!=r&&x.updateAttributeValue(A,r,w[C]))}}};a.processGeometryEdits=function(t,w){const v=new Map,m=r=>{for(const {oid:n,feature:u}of r)r=u?.geometry,"mesh"===r?.type&&v.set(n,r)};m(w.adds);m(w.updates);for(const r of w.deletes)v.set(r.oid,
null);for(const [r,n]of v)t.i3sOverrides.updateGeometry(r,n)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SMeshViewFilter":function(){define("require exports ../../../../chunks/tslib.es6 ../../../../geometry ../../../../core/Accessor ../../../../core/arrayUtils ../../../../core/Logger ../../../../core/mathUtils ../../../../core/maybeUpdating ../../../../core/reactiveUtils ../../../../core/unitUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../core/sql/WhereClause ../../../../geometry/ellipsoidUtils ../../../../geometry/projection ../../../../geometry/projection/projectBoundingSphere ../../../../geometry/projection/projectVectorToVector ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/DoubleArray ../../../../geometry/support/Ellipsoid ../../../../geometry/support/spatialReferenceUtils ../../../../chunks/sphere ../../../../geometry/support/webMercatorUtils ../../../../layers/support/FeatureFilter ./I3SUtil ../../../../geometry/SpatialReference".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G){function I(Y,ha,ba){if(null==ha)return null;if("disjoint"===ba&&"polygon"===ha.type){ba=ha.rings.length;const U=ha.spatialReference,Z=Array(ba);for(let da=0;da<ba;++da){const ia=A.fromValues(Infinity,Infinity,-Infinity,-Infinity);A.expandWithNestedArray(ia,ha.rings[da]);Z[da]={type:"polygon",rings:[ha.rings[da]],spatialReference:U,cache:{},aabr:ia}}Z.sort((da,ia)=>da.aabr[0]-ia.aabr[0]);const ca=new Set,ea=new k.PositionHint;
for(ha=0;ha<Z.length;++ha){const da=Z[ha],ia=da.aabr[0];ca.forEach(ka=>{ia>=ka.aabr[2]?ca.delete(ka):da.aabr[1]>ka.aabr[3]||da.aabr[3]<ka.aabr[1]||!Y.intersects(da,ka)||(da.rings=da.rings.concat(ka.rings),A.expand(da.aabr,ka.aabr,da.aabr),da.cache={},ca.delete(ka),ka=k.indexOf(Z,ka,Z.length,ea),Z.splice(ka,1))});ca.add(da)}for(const da of Z)da.aabr=void 0;return Z}return[ha]}function O(Y,ha,ba,U,Z){if(ha[3]>=.5*(ha[2]+n.getReferenceEllipsoid(U).radius))return!0;const ca=M(Y,ha,U);return ba.every(ea=>
K(Y,ea,ca,Z)!==S.DISCARD)}function L(Y,ha,ba,U,Z,ca,ea,da){const ia=ea[0].spatialReference||Z.spatialReference;if(x.projectBoundingSphere(ba.node.serviceMbsInIndexSR,ca,V,ia)){ca=M(Y,V,ia);var ka=P(da,Z,ia,U,ba.objectHandle);for(const fa of ea){if(0===ha.length)break;switch(K(Y,fa,ca,da)){case S.DISCARD:ha.length=0;return;case S.KEEP:continue}E.filterInPlace(ha,ba.featureIds,X=>Q(Y,fa,X,ka))}}else h.getLogger("esri.views.3d.layers.i3s.I3SMeshViewFilter").warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter")}
function P(Y,ha,ba,U,Z){ha=ha.renderSpatialReference;const ca=new Map,ea={type:"polygon",rings:[[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]],spatialReference:ba};ea.rings[0][3]=ea.rings[0][0];let da,ia;switch(Y){case "intersects":da=(ka,fa,X)=>ka.intersects(fa,X)?S.KEEP:S.TEST;ia=J;break;case "contains":da=(ka,fa,X)=>ka.contains(fa,X)?S.TEST:S.DISCARD;ia=J;break;default:da=(ka,fa,X)=>ka.disjoint(fa,X)?S.TEST:S.DISCARD,ia=R}return{collection:U,object:Z,type:Y,maskSR:ba,renderSR:ha,aabbCache:ca,triangle:ea,positions:{indices:null,
data:null,stride:0,startIndex:0,endIndex:0},triangleTest:da,geometryTest:ia}}function M(Y,ha,ba){const U={type:"point",x:ha[0],y:ha[1],hasZ:!1,hasM:!1,spatialReference:ba};ba=!D.isWGS84(ba)&&!D.isWebMercator(ba);ha=Number.isNaN(ha[3])?0:f.clamp(ha[3],0,2*C.earth.radius);Y=ba?Y.buffer(U,ha,1):Y.geodesicBuffer(U,ha,1);Y.type="polygon";return Y}function K(Y,ha,ba,U){switch(U){case "intersects":case "contains":return J(Y,ha,ba);case "disjoint":return R(Y,ha,ba)}}function J(Y,ha,ba){return Y.intersects(ha,
ba)?Y.contains(ha,ba)?S.KEEP:S.TEST:S.DISCARD}function R(Y,ha,ba){return Y.intersects(ha,ba)?Y.contains(ha,ba)?S.DISCARD:S.TEST:S.KEEP}function Q(Y,ha,ba,U){const {collection:Z,object:ca,renderSR:ea,maskSR:da,geometryTest:ia,aabbCache:ka}=U;var fa=ka.get(ba);if(!fa){fa=Z.getObjectTransform(ca);Z.getComponentAabb(ca,ba,T);var X=[m.fromValues(T[0],T[1],0),m.fromValues(T[0],T[4],0),m.fromValues(T[3],T[4],0),m.fromValues(T[3],T[1],0)];for(var ja=0;4>ja;++ja)v.transformMat3(X[ja],X[ja],fa.rotationScale),
v.add(X[ja],X[ja],fa.position),y.projectVectorToVector(X[ja],ea,X[ja],da);fa={type:"polygon",rings:[X],spatialReference:da,cache:{}};fa.rings[0][4]=fa.rings[0][0];ka.set(ba,fa)}switch(ia(Y,ha,fa)){case S.DISCARD:return!1;case S.KEEP:return!0}const {triangle:la,triangleTest:na,positions:va}=U;fa=la.rings[0][0];X=la.rings[0][1];ja=la.rings[0][2];const za=Z.getObjectTransform(ca);Z.getComponentPositions(ca,ba,va);const {indices:ya,data:Da,stride:ra,startIndex:xa,endIndex:Ma}=va;for(ba=xa;ba<Ma;ba+=3){const Ga=
ra*ya[ba],Pa=ra*ya[ba+1],Qa=ra*ya[ba+2];v.set(fa,Da[Ga],Da[Ga+1],Da[Ga+2]);v.set(X,Da[Pa],Da[Pa+1],Da[Pa+2]);v.set(ja,Da[Qa],Da[Qa+1],Da[Qa+2]);v.transformMat3(fa,fa,za.rotationScale);v.transformMat3(X,X,za.rotationScale);v.transformMat3(ja,ja,za.rotationScale);v.add(fa,fa,za.position);v.add(X,X,za.position);v.add(ja,ja,za.position);y.projectVectorToVector(fa,ea,fa,da);y.projectVectorToVector(X,ea,X,da);y.projectVectorToVector(ja,ea,ja,da);switch(na(Y,ha,la)){case S.DISCARD:return!1;case S.KEEP:return!0}}switch(U.type){case "intersects":return!1;
default:return!0}}b.I3SMeshViewFilter=class extends p{constructor(Y){super(Y);this._projectionEngineLoaded=!1}initialize(){e.whenOnce(()=>this.viewFilter?.geometry||null!=this.layerFilter).then(()=>this.loadAsyncModule((new Promise((Y,ha)=>a(["../../../../geometry/geometryEngine"],Y,ha))).then(Y=>{this.destroyed||(this._geometryEngine=Y)})))}get sortedObjectIds(){if(null==this.viewFilter?.objectIds)return null;const Y=B.doubleArrayFrom(this.viewFilter.objectIds);Y.sort();return Y}get parsedWhereClause(){const Y=
this.viewFilter?.where;if(null==Y||!Y)return null;try{return r.WhereClause.create(Y,this.layerFieldsIndex)}catch(ha){h.getLogger("esri.views.3d.layers.i3s.I3SMeshViewFilter").error(`Failed to parse filter where clause: ${ha}`)}return null}addFilters(Y,ha,ba,U){const Z=this.sortedObjectIds;null!=Z&&Y.push(ia=>E.objectIdFilter(Z,!0,ia));this.addSqlFilter(Y,this.parsedWhereClause);this.addTimeFilter(Y,this.viewFilter?.timeExtent);const ca=c.unwrapUpdating(this._layerMaskGeometries),ea=this._geometryEngine;
if(null!=ca&&null!=this.layerFilter&&null!=ea){const ia=this.layerFilter.spatialRelationship;Y.push((ka,fa)=>L(ea,ka,fa,U,ha,ba,ca,ia))}const da=c.unwrapUpdating(this._viewMaskGeometries);if(null!=da&&null!=this.viewFilter&&null!=ea){const ia=this.viewFilter.spatialRelationship;Y.push((ka,fa)=>L(ea,ka,fa,U,ha,ba,da,ia))}}isMBSGeometryVisible(Y,ha,ba){var U=c.unwrapUpdating(this._layerMaskGeometries);const Z=this._geometryEngine;if(null!=U&&null!=this.layerFilter&&null!=Z){var ca=this.layerFilter.spatialRelationship;
ha=U[0].spatialReference||ha;return x.projectBoundingSphere(Y,ba,V,ha)?O(Z,V,U,ha,ca):(h.getLogger("esri.views.3d.layers.i3s.I3SMeshViewFilter").warnOnce("SceneLayer.mask geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0)}U=c.unwrapUpdating(this._viewMaskGeometries);return null!=U&&null!=this.viewFilter&&null!=Z?(ca=this.viewFilter.spatialRelationship,ha=U[0].spatialReference||ha,x.projectBoundingSphere(Y,ba,V,ha)?O(Z,V,U,ha,ca):(h.getLogger("esri.views.3d.layers.i3s.I3SMeshViewFilter").warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),
!0)):!0}get parsedGeometry(){const Y=c.unwrapUpdating(this._viewMaskGeometries),ha=c.unwrapUpdating(this._layerMaskGeometries);return null==Y||null==ha?Y||ha:ha.concat(Y)}get _layerMaskGeometries(){const Y=this.layerFilter;return null==Y?null:null==this._geometryEngine?c.updating:"disjoint"===Y.spatialRelationship?Y.geometries.map(ha=>({type:"polygon",rings:ha.rings,spatialReference:ha.spatialReference,cache:{}})):[Y.geometries.reduce((ha,ba)=>{ha.rings=[...ha.rings,...ba.rings];return ha},{type:"polygon",
rings:[],spatialReference:Y.geometries[0].spatialReference,cache:{}})]}get _viewMaskGeometries(){if(null==this.viewFilter)return null;var {geometry:Y}=this.viewFilter;if(null==Y)return null;if(null==this.viewFilter||null==this._geometryEngine)return c.updating;const {distance:ha,units:ba}=this.viewFilter,U=this.viewFilter.spatialRelationship;Y="mesh"===Y.type?Y.extent:Y;if(null==ha||0===ha)return I(this._geometryEngine,Y,U);const Z=ba||g.getUnitString(Y.spatialReference);if(Y.spatialReference.isWGS84)return Y=
this._geometryEngine.geodesicBuffer(Y,ha,Z),I(this._geometryEngine,Y,U);var ca=H.project(Y,G.WGS84);if(null!=ca)return Y=H.project(this._geometryEngine.geodesicBuffer(ca,ha,Z),Y.spatialReference),I(this._geometryEngine,Y,U);if(!this._projectionEngineLoaded&&(this.loadAsyncModule(u.load().then(()=>this._projectionEngineLoaded=!0)),!this._projectionEngineLoaded))return null;ca=null;try{ca=u.project(Y,G.WGS84)}catch(ea){}if(ca)try{ca=u.project(this._geometryEngine.geodesicBuffer(ca,ha,Z),Y.spatialReference)}catch(ea){ca=
null}ca||h.getLogger("esri.views.3d.layers.i3s.I3SMeshViewFilter").error(`Filter by geodesic buffer (distance) unsupported, failed to project input geometry (${Y.spatialReference.wkid}) to WGS84.`);return I(this._geometryEngine,ca,U)}get updating(){return c.isUpdating(this._layerMaskGeometries)||c.isUpdating(this._viewMaskGeometries)}static checkSupport(Y){if(null==Y)return!1;Y=Y.spatialRelationship;return null!=Y&&W.includes(Y)?!0:(h.getLogger("esri.views.3d.layers.i3s.I3SMeshViewFilter").warn(`Filters with spatialRelationship other than ${W.join(", ")} are not supported for mesh scene layers`),
!1)}};q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"layerFilter",void 0);q.__decorate([d.property({type:N})],b.I3SMeshViewFilter.prototype,"viewFilter",void 0);q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"layerFieldsIndex",void 0);q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"loadAsyncModule",void 0);q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"addSqlFilter",void 0);q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"addTimeFilter",void 0);
q.__decorate([d.property({readOnly:!0})],b.I3SMeshViewFilter.prototype,"sortedObjectIds",null);q.__decorate([d.property({readOnly:!0})],b.I3SMeshViewFilter.prototype,"parsedWhereClause",null);q.__decorate([d.property({readOnly:!0})],b.I3SMeshViewFilter.prototype,"parsedGeometry",null);q.__decorate([d.property({readOnly:!0})],b.I3SMeshViewFilter.prototype,"_layerMaskGeometries",null);q.__decorate([d.property({readOnly:!0})],b.I3SMeshViewFilter.prototype,"_viewMaskGeometries",null);q.__decorate([d.property()],
b.I3SMeshViewFilter.prototype,"updating",null);q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"_projectionEngineLoaded",void 0);q.__decorate([d.property()],b.I3SMeshViewFilter.prototype,"_geometryEngine",void 0);b.I3SMeshViewFilter=q.__decorate([w.subclass("esri.views.3d.layers.i3s.I3SMeshViewFilter")],b.I3SMeshViewFilter);const W=["contains","intersects","disjoint"];var S;(function(Y){Y[Y.KEEP=0]="KEEP";Y[Y.DISCARD=1]="DISCARD";Y[Y.TEST=2]="TEST"})(S||={});const V=F.fromValues(0,0,0,0),
T=z.create();Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/core/maybeUpdating":function(){define(["exports"],function(a){a.isUpdating=function(b){return"updating"===b};a.unwrapUpdating=function(b){return"updating"===b?null:b};a.updating="updating";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SQueryEngine":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Error ../../../../core/maybe ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/Extent ../../../../layers/LayerConstants ../../../../layers/graphics/data/QueryEngine ../../../../layers/support/FieldsIndex ../../../../rest/support/FeatureSet ../../../../rest/support/Query".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m){const r=t.QueryEngine;a.I3SQueryEngine=class extends q{get spatialReference(){return this.layerView.view.spatialReference}get layer(){return this.layerView.i3slayer}get defaultQueryJSON(){return(new m({outSpatialReference:this.spatialReference})).toJSON()}get _dataQueryEngine(){return this._ensureDataQueryEngine()}constructor(n){super(n)}initialize(){this.addHandles(this.layerView.on("visible-geometry-changed",()=>this.spatialIndex.events.emit("changed")))}destroy(){this._dataQueryEngineInstance=
p.destroyMaybe(this._dataQueryEngineInstance);this._set("layerView",null)}async executeQueryForCount(n,u){return this._dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(n),u)}async executeQueryForExtent(n,u){const {count:x,extent:y}=await this._dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(n),u);n=g.fromJSON(y);return{count:x,extent:n}}async executeQueryForIds(n,u){return this._dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(n),u)}async executeQuery(n,u){n=this._ensureQueryJSON(n);
if(n.returnGeometry)throw new l("unsupported-query","returnGeometry is not supported when querying a mesh scene layer view, it is only supported when directly querying a scene layer");if(n.returnCentroid)throw new l("unsupported-query","returnCentroid is not yet supported for mesh scene layer queries");u=await this._dataQueryEngine.executeQuery(n,u);u=v.fromJSON(u);u.features.forEach(x=>x.geometry=null);return u}_ensureQueryJSON(n){return null==n?this.defaultQueryJSON:n.toJSON()}_ensureDataQueryEngine(){if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;
const n=this.layer.objectIdField||d.fallbackObjectIDAttribute,u=this.layer.fieldsIndex?.toJSON()||new w([]),x=this.layerView.view.resourceController.scheduler,y=this.spatialReference.toJSON();return this._dataQueryEngineInstance=new r({hasZ:!0,hasM:!1,geometryType:"esriGeometryPolygon",fieldsIndex:u,timeInfo:null,spatialReference:y,objectIdField:n,featureStore:this.spatialIndex,scheduler:x,priority:this.priority})}};b.__decorate([k.property({constructOnly:!0})],a.I3SQueryEngine.prototype,"layerView",
void 0);b.__decorate([k.property({constructOnly:!0})],a.I3SQueryEngine.prototype,"priority",void 0);b.__decorate([k.property({constructOnly:!0})],a.I3SQueryEngine.prototype,"spatialIndex",void 0);b.__decorate([k.property()],a.I3SQueryEngine.prototype,"spatialReference",null);b.__decorate([k.property()],a.I3SQueryEngine.prototype,"layer",null);b.__decorate([k.property()],a.I3SQueryEngine.prototype,"defaultQueryJSON",null);a.I3SQueryEngine=b.__decorate([e.subclass("esri.views.3d.layers.i3s.I3SQueryEngine")],
a.I3SQueryEngine);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SQueryFeatureAdapter":function(){define(["exports","../../../../geometry/support/aaBoundingBox","../../../../layers/graphics/centroid","../../../../layers/graphics/OptimizedGeometry","./I3SUtil"],function(a,b,q,l,p){class k{constructor(f){this._objectIdField=f.objectIdField;this._getFeatureExtent=f.getFeatureExtent}getObjectId(f){return f.id}getAttributes(f){const {meta:c,index:e}=f,g={};
this._objectIdField&&(g[this._objectIdField]=f.id);f=c.attributeInfo?.attributeData;if(null!=f)for(const d of Object.keys(f))g[d]=p.getCachedAttributeValue(f[d],e);return g}getAttribute(f,c){if(c===this._objectIdField)return f.id;const {meta:e,index:g}=f;f=e.attributeInfo?.attributeData;return null!=f?p.getCachedAttributeValue(f[c],g):null}getGeometry(f){if(f.geometry)return f.geometry;const [c,e,g,d,t]=this._getFeatureExtent(f,h);return new l([5],[c,e,g,d,e,g,d,t,g,c,t,g,c,e,g])}getCentroid(f,c){if(f.geometry)return q.getCentroidOptimizedGeometry(new l,
f.geometry,c.hasZ,c.hasM);const [e,g,d,t,w,v]=this._getFeatureExtent(f,h);return new l([0],[(e+t)/2,(g+w)/2,(d+v)/2])}cloneWithGeometry(f,c){const {id:e,index:g,meta:d}=f;return{id:e,index:g,meta:d,geometry:c}}}const h=b.create();a.I3SQueryFeatureAdapter=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SQueryFeatureStore":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Evented ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/projection/projectBoundingSphere ../../../../geometry/support/aaBoundingBox ../../../../geometry/support/aaBoundingRect ../../../../chunks/sphere ../II3SMeshView3D".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w){const v=g.create();a.I3SQueryFeatureStore=class extends q{constructor(u){super(u);this.events=new l}forEach(u){this.forAllFeatures(x=>{u(x);return w.ForAllFeaturesReturnType.CONTINUE})}forEachBounds(u,x){const y=this.getFeatureExtent;for(const z of u)x(y(z,v))}forEachInBounds(u,x){this.forAllFeatures(y=>{const z=this.getFeatureExtent(y,r);d.intersects(u,g.toRect(z,n))&&x(y);return w.ForAllFeaturesReturnType.CONTINUE},y=>{e.projectBoundingSphere(y.node.serviceMbsInIndexSR,
this.sourceSpatialReference,m,this.viewSpatialReference);if(m[0]>=u[0]&&m[2]<=u[2]&&m[1]>=u[1]&&m[3]<=u[3])return w.ForAllFeaturesReturnType.CONTINUE;y=m[0]-Math.max(u[0],Math.min(m[0],u[2]));const z=m[1]-Math.max(u[1],Math.min(m[1],u[3]));return y*y+z*z<=m[3]*m[3]?w.ForAllFeaturesReturnType.CONTINUE:w.ForAllFeaturesReturnType.SKIP})}};b.__decorate([p.property({constructOnly:!0})],a.I3SQueryFeatureStore.prototype,"featureAdapter",void 0);b.__decorate([p.property({constructOnly:!0})],a.I3SQueryFeatureStore.prototype,
"forAllFeatures",void 0);b.__decorate([p.property({constructOnly:!0})],a.I3SQueryFeatureStore.prototype,"getFeatureExtent",void 0);b.__decorate([p.property({constructOnly:!0})],a.I3SQueryFeatureStore.prototype,"sourceSpatialReference",void 0);b.__decorate([p.property({constructOnly:!0})],a.I3SQueryFeatureStore.prototype,"viewSpatialReference",void 0);a.I3SQueryFeatureStore=b.__decorate([c.subclass("esri.views.3d.layers.i3s.I3SQueryFeatureStore")],a.I3SQueryFeatureStore);const m=t.fromValues(0,0,0,
0),r=g.create(),n=d.create();Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/DefinitionExpressionSceneLayerView":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Logger ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/sql/WhereClause ../i3s/I3SUtil".split(" "),function(a,b,q,l,p,k,h,f,c){a.DefinitionExpressionSceneLayerView=
e=>{e=class extends e{constructor(){super(...arguments);this._definitionExpressionErrors=0;this._maxDefinitionExpressionErrors=20;this.logError=g=>{this._definitionExpressionErrors<this._maxDefinitionExpressionErrors&&q.getLogger(this).error("Error while evaluating definitionExpression: "+g);this._definitionExpressionErrors++;this._definitionExpressionErrors===this._maxDefinitionExpressionErrors&&q.getLogger(this).error("Further errors are ignored")}}get parsedDefinitionExpression(){if(!this.i3slayer?.definitionExpression)return null;
try{const g=f.WhereClause.create(this.i3slayer.definitionExpression,this.i3slayer.fieldsIndex);if(!g.isStandardized)return q.getLogger(this).error("definitionExpression is using non standard function"),null;const d=[];c.findFieldsCaseInsensitive(g.fieldNames,this.i3slayer.fields,{missingFields:d});if(0<d.length)return q.getLogger(this).error(`definitionExpression references unknown fields: ${d.join(", ")}`),null;this._definitionExpressionErrors=0;return g}catch(g){return q.getLogger(this).error("Failed to parse definitionExpression: "+
g),null}}get definitionExpressionFields(){return this.parsedDefinitionExpression?this.parsedDefinitionExpression.fieldNames:[]}_evaluateClause(g,d){try{return g.testFeature(d)}catch(t){return this.logError(t),!1}}_addDefinitionExpressionToQuery(g){if(!this.parsedDefinitionExpression)return g;const d=this.i3slayer.definitionExpression;g=g.clone();g.where=g.where?`(${d}) AND (${g.where})`:d;return g}};b.__decorate([l.property({readOnly:!0})],e.prototype,"parsedDefinitionExpression",null);b.__decorate([l.property({readOnly:!0})],
e.prototype,"definitionExpressionFields",null);return e=b.__decorate([h.subclass("esri.views.3d.layers.support.DefinitionExpressionSceneLayerView")],e)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/fieldProperties":function(){define(["exports","../../../../layers/support/fieldUtils"],function(a,b){a.defineFieldProperties=function(){return{requiredFields:{type:[String],readOnly:!0},availableFields:{type:[String],readOnly:!0,get:function(){const {layer:q,
layer:{fieldsIndex:l},requiredFields:p}=this;return q.outFields?b.fixFields(l,[...b.unpackFieldNames(l,q.outFields),...p]):b.fixFields(l,p)}}}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/SceneLayerViewRequiredFields":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/AsyncUpdate ../../../../core/Logger ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../layers/support/fieldUtils".split(" "),
function(a,b,q,l,p,k,h,f,c,e){a.SceneLayerViewRequiredFields=class extends l.AsyncUpdateMixin(q){get layer(){return this.layerView.layer}get requiredFields(){const {layerView:{layer:{fieldsIndex:g},definitionExpressionFields:d},rendererFields:t,labelingFields:w,viewFilterFields:v}=this;return e.fixFields(g,[...(d??[]),...(t??[]),...(w??[]),...(v??[])])}constructor(g){super(g)}initialize(){this.addHandles([this.autoUpdateAsync("rendererFields",async()=>{const {fieldsIndex:g,renderer:d}=this.layer;
return d?this._getFieldsAsync(t=>d.collectRequiredFields(t,g)):null}),this.autoUpdateAsync("labelingFields",async()=>{const {layer:g}=this;return g.labelsVisible?this._getFieldsAsync(d=>e.collectLabelingFields(d,g)):null}),this.autoUpdateAsync("viewFilterFields",()=>{const {layer:g,mergedFilter:d}=this.layerView;return this._getFieldsAsync(t=>e.collectFilterFields(t,g,d))})])}async _getFieldsAsync(g){const d=new Set;try{return await g(d),Array.from(d).sort()}catch(t){return p.getLogger(this).error(t),
null}}};b.__decorate([k.property()],a.SceneLayerViewRequiredFields.prototype,"layerView",void 0);b.__decorate([k.property()],a.SceneLayerViewRequiredFields.prototype,"layer",null);b.__decorate([k.property()],a.SceneLayerViewRequiredFields.prototype,"requiredFields",null);b.__decorate([k.property()],a.SceneLayerViewRequiredFields.prototype,"rendererFields",void 0);b.__decorate([k.property()],a.SceneLayerViewRequiredFields.prototype,"labelingFields",void 0);b.__decorate([k.property()],a.SceneLayerViewRequiredFields.prototype,
"viewFilterFields",void 0);a.SceneLayerViewRequiredFields=b.__decorate([c.subclass("esri.views.3d.layers.support.SceneLayerViewRequiredFields")],a.SceneLayerViewRequiredFields);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/AsyncUpdate":function(){define("exports ../chunks/tslib.es6 ./Accessor ./Logger ./promiseUtils ./reactiveUtils ./accessorSupport/decorators/property ./accessorSupport/decorators/subclass".split(" "),function(a,b,q,l,p,k,h,f){const c=e=>{e=class extends e{constructor(){super(...arguments);
this._numUpdating=0}get updating(){return 0<this._numUpdating}autoUpdateAsync(g,d){const t=p.debounce(async w=>{++this._numUpdating;try{const v=await w;this.destroyed||this._set(g,v)}catch(v){l.getLogger(this).warn(`Async update of "${String(g)}" failed. Async update functions should not throw exceptions.`)}--this._numUpdating});return k.watch(d,t,k.initial)}};b.__decorate([h.property({readOnly:!0})],e.prototype,"updating",null);b.__decorate([h.property()],e.prototype,"_numUpdating",void 0);return e=
b.__decorate([f.subclass("esri.core.AsyncUpdate")],e)};a.AsyncUpdate=class extends c(q){};a.AsyncUpdate=b.__decorate([f.subclass("esri.core.AsyncUpdate")],a.AsyncUpdate);a.AsyncUpdateMixin=c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/support/TemporalSceneLayerView":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../layers/graphics/data/timeSupport ../../../../layers/support/FeatureFilter ../../../../layers/support/timeSupport ../i3s/I3SUtil".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g){class d{constructor(t){this.attributeData=t}getAttribute(t,w){return g.getCachedAttributeValue(this.attributeData[w],t)}getAttributeAsTimestamp(t,w){t=this.getAttribute(t,w);return"string"===typeof t?(new Date(t)).getTime():"number"===typeof t||null==t?t:null}}a.TemporalSceneLayerView=t=>{t=class extends t{get timeExtent(){return e.combineTimeExtent(this.i3slayer,this.view?.timeExtent,this._get("timeExtent"))}get mergedFilter(){const {filter:w,timeExtent:v}=this;if(null==
v)return w;const m=w?.clone()??new c;null!=v&&(m.timeExtent=m.timeExtent?.intersection(v)??v);return m}getTimeFilterDependencies(){const {timeInfo:w}=this.i3slayer;if(null==w)return[];const {startField:v,endField:m}=w;return[v,m]}addTimeFilter(w,v){if(null!=v){var {timeInfo:m}=this.i3slayer;if(null!=m){var {startField:r,endField:n,useTime:u}=m;if(u&&(null!=r||null!=n)){var x=m.toJSON(),y=v.toJSON();w.push((z,A)=>{var B=A.attributeInfo?.attributeData;if(null!=B){var {startTimeField:C,endTimeField:D}=
x;null!=C&&null==B[C]||null!=D&&null==B[D]||(B=f.getTimeOperator(x,y,new d(B)),null!=B&&({featureIds:A}=A,g.filterInPlace(z,A,B)))}})}}}}};b.__decorate([q.property({readOnly:!0})],t.prototype,"timeExtent",null);b.__decorate([q.property()],t.prototype,"mergedFilter",null);return t=b.__decorate([h.subclass("esri.views.3d.layers.support.TemporalSceneLayerView")],t)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/layers/SceneLayerView":function(){define("require ../../chunks/tslib.es6 ../../core/arrayUtils ../../core/Logger ../../core/maybe ../../core/maybeUpdating ../../core/promiseUtils ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/accessorSupport/decorators/subclass ../../geometry/projection ./LayerView".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t){e=class extends t{constructor(){super(...arguments);this._geometryEngine=this.filter=this.layer=null;this._projectionEngineLoaded=!1;this._abortController=new AbortController}get availableFields(){return[]}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(w){throw Error("Not implemented");}get maximumNumberOfFeaturesExceeded(){return!1}get layerFilter(){return k.unwrapUpdating(this._layerFilter)}get _layerFilter(){const w=this.layer?.filter;if(null==
w||1>w.geometries.length)return null;const v=this._geometryEngine;if(null==v||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine)return k.updating;const m=w.geometries.at(0).spatialReference,r=w.geometries.toArray().map(y=>{try{y=v.simplify(y)}catch(z){return l.getLogger(this).warnOncePerTick("Failed to simplify scene filter mask polygon. Polygon will be ignored."),null}if(null==y)return null;if(y.spatialReference.equals(m))return y;try{return d.project(y,m)}catch(z){return l.getLogger(this).warnOncePerTick("Failed to project scene filter mask polygon. Polygon will be ignored."),
null}}).filter(q.isSome).sort((y,z)=>y.extent.xmin-z.extent.xmin),n=new Set,u=[],x=[];for(let y of r){const z=y.extent.xmin;u.length=0;n.forEach(A=>{z>=A.extent.xmax?(x.push(A),n.delete(A)):y.extent.ymin<=A.extent.ymax&&y.extent.ymax>=A.extent.ymin&&v.intersects(y,A)&&u.push(A)});if(0<u.length){u.push(y);try{y=v.union(u)}catch(A){l.getLogger(this).warnOncePerTick("Failed to unify filter mask polygons. Polygon will be ignored.");continue}u.pop();u.forEach(A=>n.delete(A))}n.add(y)}n.forEach(y=>x.push(y));
return 0<x.length?{spatialRelationship:w.spatialRelationship,geometries:x}:null}get _filterNeedsProjectionEngine(){const w=this.layer.filter;if(null==w||1>=w.geometries.length)return!1;const v=w.geometries.at(0).spatialReference;return w.geometries.some(({spatialReference:m})=>!m.equals(v)&&!d.canProjectWithoutEngine(m,v))}get layerFilterUpdating(){return k.isUpdating(this._layerFilter)}initialize(){const {signal:w}=this._abortController;f.whenOnce(()=>this.destroyed||!this._geometryEngine&&this.layer?.filter?.geometries?.length,
w).then(async()=>{h.throwIfAbortError(w);this._geometryEngine=await new Promise((v,m)=>a(["../../geometry/geometryEngine"],v,m))}).catch(h.throwIfNotAbortError);this._projectionEngineLoaded=d.isLoaded();f.whenOnce(()=>this.destroyed||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine,w).then(async()=>{h.throwIfAbortError(w);await d.load();this._projectionEngineLoaded=!0}).catch(h.throwIfNotAbortError)}destroy(){this._abortController=p.abortMaybe(this._abortController)}highlight(w){throw Error("Not implemented");
}queryFeatures(w,v){throw Error("Not implemented");}queryObjectIds(w,v){throw Error("Not implemented");}queryFeatureCount(w,v){throw Error("Not implemented");}createQuery(){throw Error("Not implemented");}queryExtent(w,v){throw Error("Not implemented");}};b.__decorate([c.property()],e.prototype,"layer",void 0);b.__decorate([c.property()],e.prototype,"availableFields",null);b.__decorate([c.property()],e.prototype,"maximumNumberOfFeatures",null);b.__decorate([c.property({readOnly:!0})],e.prototype,
"maximumNumberOfFeaturesExceeded",null);b.__decorate([c.property()],e.prototype,"filter",void 0);b.__decorate([c.property({readOnly:!0})],e.prototype,"layerFilter",null);b.__decorate([c.property({readOnly:!0})],e.prototype,"_layerFilter",null);b.__decorate([c.property()],e.prototype,"_geometryEngine",void 0);b.__decorate([c.property()],e.prototype,"_projectionEngineLoaded",void 0);b.__decorate([c.property()],e.prototype,"_filterNeedsProjectionEngine",null);b.__decorate([c.property()],e.prototype,
"layerFilterUpdating",null);return e=b.__decorate([g.subclass("esri.views.layers.SceneLayerView")],e)})},"esri/views/3d/layers/SceneLayerGraphicsView3D":function(){define("require ../../../chunks/tslib.es6 ../../../Graphic ../../../core/arrayUtils ../../../core/has ../../../core/Logger ../../../core/maybe ../../../core/reactiveUtils ../../../core/typedArrayUtil ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/projection/projectBuffer ../../../geometry/projection/projectVectorToVector ../../../geometry/support/contains ../../../geometry/support/DoubleArray ../../../geometry/support/zscale ../../../layers/LayerConstants ../../../layers/graphics/dehydratedFeatures ../../../layers/graphics/dehydratedPoint ../../../layers/graphics/hydratedFeatures ../../../layers/graphics/controllers/I3SOnDemandController ../../../layers/support/FeatureFilter ../../../rest/support/Query ../../../support/basemapUtils ./I3SPointsWorkerHandle ./LayerView3D ./graphics/Graphics3DFeatureProcessor ./graphics/QueryEngine ./i3s/featureEditing ./i3s/I3SGraphicsMap ./i3s/I3SOverrides ./i3s/I3SUtil ./support/DefinitionExpressionSceneLayerView ./support/fieldProperties ./support/LayerViewPerformanceInfo ./support/PopupSceneLayerView ./support/SceneLayerViewRequiredFields ./support/TemporalSceneLayerView ../support/debugFlags ../support/orientedBoundingBox ../support/updatingProperties ../webgl-engine/lib/Attribute ../webgl-engine/lib/UpdatePolicy ../../layers/SceneLayerView ../../layers/support/popupUtils ../../support/Scheduler".split(" "),
function(a,b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U){function Z(fa){return"geometryBuffer"in fa&&null!==fa.geometryBuffer}function ca(fa){const X=fa.attributeInfo,ja=fa.node.index;if(null!=X?.loadedAttributes&&null!=X.attributeData)for(let la=0;la<fa.graphics.length;la++){const na=fa.graphics[la];if(na.nodeIndex===ja){na.attributes||(na.attributes={});for(const {name:va}of X.loadedAttributes)X.attributeData[va]&&(na.attributes[va]=L.getCachedAttributeValue(X.attributeData[va],
la))}}}p=M.defineFieldProperties();class ea{constructor(fa,X,ja,la){this.graphics=fa;this.featureIds=X;this.attributeInfo=ja;this.node=la}}H=class extends Q.TemporalSceneLayerView(P.DefinitionExpressionSceneLayerView(J.PopupSceneLayerView(H.LayerView3D(ha)))){constructor(){super(...arguments);this.type="scene-layer-graphics-3d";this._memCache=this._queryEngine=null;this._interactiveEditingSessions=new Map;this._pendingEditsQueue=Promise.resolve();this.loadedGraphics=new I.I3SGraphicsMap((fa,X,ja)=>
{{const la=X.attributeInfo;if(null==la?.loadedAttributes||null==la.attributeData)fa=!1;else{X=!1;for(const {name:na}of la.loadedAttributes)if(la.attributeData[na]){const va=L.getCachedAttributeValue(la.attributeData[na],ja);va!==fa.attributes[na]&&(fa.attributes[na]=va,X=!0)}fa=X}}return fa},fa=>this.processor.graphicsCore.recreateGraphics(fa));this.holeFilling="always";this.progressiveLoadFactor=1;this.supportsHeightUnitConversion=!0;this._coordinatesOutsideExtentErrors=0;this._maxCoordinatesOutsideExtentErrors=
20}tryRecycleWith(fa,X){return fa.url===this.layer.url&&this._i3sOverrides.isEmpty?fa.load(X).then(()=>{L.checkRecyclable(this.layer,fa,this._i3sOverrides);this.layer=fa;this._i3sOverrides.destroy();this._i3sOverrides=new O.I3SOverrides({view:this.view,layer:fa,memoryController:this.view.resourceController?.memoryController});h.destroyMaybe(this._queryEngine);this._setupQueryEngine();this.processor.resetObjectStates()}):null}initialize(){this.addResolvingPromise(this.layer.indexInfo);this._i3sOverrides=
new O.I3SOverrides({view:this.view,layer:this.layer,memoryController:this.view.resourceController?.memoryController});L.checkSpatialReferences(this.layer,this.view.spatialReference,this.view.viewingMode);this._fieldsHelper=new R.SceneLayerViewRequiredFields({layerView:this});this._updatingHandles.add(()=>this.layer.rangeInfos,fa=>this._rangeInfosChanged(fa),f.initial);this._updatingHandles.add(()=>this.layer.renderer,(fa,X)=>this._rendererChange(fa,X));this._updatingHandles.add(()=>[this.parsedDefinitionExpression,
this._excludeObjectIdsSorted],()=>this._filterChange());this.addHandles(f.watch(()=>W.debugFlags.I3S_TREE_SHOW_TILES,fa=>{if(fa&&!this._treeDebugger){const X=this._controller.crsIndex;(new Promise((ja,la)=>a(["./support/I3STreeDebugger"],ja,la))).then(({I3STreeDebugger:ja})=>{!this._treeDebugger&&W.debugFlags.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new ja({lv:this,view:this.view,nodeSR:X}))})}else fa||!this._treeDebugger||W.debugFlags.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=
null)},f.initial));this._set("processor",new N.Graphics3DFeatureProcessor({owner:this,preferredUpdatePolicy:Y.UpdatePolicy.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:fa=>this._updateClippingExtent(fa)}));this.processor.elevationAlignment?.events.on("invalidate-elevation",({extent:fa,spatialReference:X})=>
this._controller.updateElevationChanged(fa,X));this.supportsHeightUnitConversion&&(this._verticalScale=n.getGeometryZScaler("point",this.layer.spatialReference,this.view.spatialReference));this.addResolvingPromise(this.processor.initializePromise);this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`);this._controller=new A({layerView:this});L.containsDraco(this.layer.geometryDefinitions)&&(this._worker=new F.I3SPointsWorkerHandle(fa=>this.view.resourceController.immediate.schedule(fa)));
this.addHandles(this.layer.on("apply-edits",fa=>this._updatingHandles.addPromise(fa.result)));this.addHandles(this.layer.on("edits",fa=>{const X=this._pendingEditsQueue.then(()=>this._handleEdits(fa)).then();this._pendingEditsQueue=X;this._updatingHandles.addPromise(X)}));this.when(()=>{this._setupQueryEngine();this._updatingHandles.add(()=>this.maximumNumberOfFeatures,fa=>this._controller.featureTarget=fa,f.initial);this._updatingHandles.add(()=>this.suspended,fa=>{fa&&this._removeAllNodeData()})})}destroy(){this._treeDebugger=
h.destroyMaybe(this._treeDebugger);this._i3sOverrides=h.destroyMaybe(this._i3sOverrides);this._set("processor",h.destroyMaybe(this.processor));this._controller=h.destroyMaybe(this._controller);this._queryEngine=h.destroyMaybe(this._queryEngine);this._worker=h.destroyMaybe(this._worker);this._memCache=h.destroyMaybe(this._memCache);this.loadedGraphics.clear();this._fieldsHelper=h.destroyMaybe(this._fieldsHelper)}get i3slayer(){return this.layer}get updatingProgressValue(){return this._controller?.updatingProgress??
1}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){return this.processor?.graphicsCore?.displayFeatureLimit?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(fa){null!=fa?(this._override("maximumNumberOfFeatures",fa),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return this.suspended?!1:!!this._controller?.useMaximumNumberOfFeatures&&
!this._controller.leavesReached}get _excludeObjectIdsSorted(){const fa=this.layer.excludeObjectIds;return fa.length?fa.toArray().sort((X,ja)=>X-ja):null}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}async whenGraphicAttributes(fa,X){return L.whenGraphicAttributes(this.layer,
fa,this._getObjectIdField(),X,()=>[...this.loadedGraphics.nodes()])}getHit(fa){if(!this.loadedGraphics)return null;const X=z.hydrateGraphic(this.loadedGraphics.find(la=>la.uid===fa),this.layer),ja=this._getObjectIdField();if(!X?.attributes?.[ja])return null;X.layer=this.layer;X.sourceLayer=this.layer;return{type:"graphic",graphic:X,layer:X.layer}}whenGraphicBounds(fa,X){return this.processor.whenGraphicBounds(fa,X)}computeAttachmentOrigin(fa,X){return this.processor.computeAttachmentOrigin(fa,X)}isUpdating(){return!!(this._controller?.updating||
this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(fa){return this.processor.highlight(fa,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(fa){return G.createInteractiveEditSession(this._attributeEditingContext,fa)}async _decompressBinaryPointData(fa,X){fa={geometryBuffer:fa.geometryBuffer};null==this._worker&&(this._worker=new F.I3SPointsWorkerHandle(ja=>this.view.resourceController.immediate.schedule(ja)));
X=await this._worker.invoke(fa,X);if(null==X)throw Error("Failed to decompress Draco point data");return{positionData:X.positions,featureIds:X.featureIds}}async addNode(fa,X,ja){if(!(Z(X)||"pointData"in X))throw Error();if(this.loadedGraphics.hasNode(fa.index))k.getLogger(this).error("I3S node "+fa.id+" already added");else{if(null!=this.layer.fullExtent){var la=this.layer.fullExtent.clone();la.xmin-=.5;la.ymin-=.5;la.xmax+=.5;la.ymax+=.5;null!=la.zmin&&null!=la.zmax&&(la.zmin-=.5,la.zmax+=.5);null!=
la.mmin&&null!=la.mmax&&(la.mmin-=.5,la.mmax+=.5)}else la=null;var na=la,{featureIds:va,pointPositions:za}=Z(X)?await this._extractBinaryPointPositions(fa,X,ja):this._extractLegacyPointPositions(X);la=[];this._validatePositions(fa,va,za,na,la);var ya=this._controller.crsVertex;w.projectBuffer(za,ya,0,za,this.view.spatialReference,0,va.length);na=Z(X)?fa.level:0;na=this._createGraphics(va,za,fa.index,na);na=new ea(na,va,X.attributeDataInfo,fa);await this._i3sOverrides.applyAttributeOverrides(na.featureIds,
X.attributeDataInfo,ja);fa.numFeatures=na.graphics.length;this._updateNodeMemory(fa);ca(na);0<la.length&&(this._computeObb(fa,la,ya),this._controller.updateVisibility(fa.index));if(this._controller.isGeometryVisible(fa)){if(null!=this._verticalScale)for(var Da of na.graphics)this._verticalScale(Da.geometry);X=this.view._stage.renderView.objectAndLayerIdRenderHelper;if(null!=X)for(ja=D.isBasemapLayer(this.view.map,this.layer.uid),Da=0;Da<na.featureIds.length;Da++)X.setUidToObjectAndLayerId(na.featureIds[Da],
na.graphics[Da].uid,this.layer.id,this.layer.uid,this.layer.popupEnabled&&!ja&&ba.hasPopupTemplate(this.layer,this.view.popup?.defaultPopupTemplateEnabled),na.node.resources.attributes,Da);this.loadedGraphics.addNode(fa.index,na);this._controller.updateLoadStatus(fa.index,!0);this._filterNode(na);this._treeDebugger&&this._treeDebugger.update()}else this._cacheNodeData(na)}}_computeObb(fa,X,ja){const la=this._controller.crsIndex,na=la.isGeographic?this.view.renderSpatialReference:la;w.projectBuffer(X,
ja,0,X,na,0,X.length/3);fa.serviceObbInIndexSR=S.compute(new T.Vertices(X,3));la.isGeographic&&(v.projectVectorToVector(fa.serviceObbInIndexSR.center,na,ia,la),fa.serviceObbInIndexSR.center=ia)}isNodeLoaded(fa){return this.loadedGraphics.hasNode(fa)}isNodeReloading(){return!1}updateNodeState(){}async _extractBinaryPointPositions(fa,X,ja){X=await this._decompressBinaryPointData(X,ja);ja=X.positionData;const la=ja.length/3,na=r.newDoubleArray(3*la);fa=null!=fa.serviceObbInIndexSR?fa.serviceObbInIndexSR.center:
t.ZEROS;const va=Math.abs(fa[2])*2**-20;for(let za=0;za<la;za++){const ya=3*za;na[ya]=ja[ya]+fa[0];na[ya+1]=ja[ya+1]+fa[1];na[ya+2]=ja[ya+2]+fa[2];Math.abs(na[ya+2])<va&&(na[ya+2]=0)}return{featureIds:X.featureIds?r.doubleArrayFrom(X.featureIds):[],pointPositions:na}}_extractLegacyPointPositions(fa){const X=fa.pointData.length,ja=r.newDoubleArray(3*X),la=[];for(let za=0;za<X;za++){var na=fa.pointData[za];const ya=na.featureDataPosition,Da=ya.length;var va=na.geometries?.[0]??da[Da];na=na.featureIds[0];
if("Embedded"!==va.type||"points"!==va.params.type||2>Da||3<Da)continue;va=va.params.vertexAttributes?.position??[0,0,0];const ra=3*la.length;ja[ra]=ya[0]+va[0];ja[ra+1]=ya[1]+va[1];ja[ra+2]=3===Da?ya[2]+va[2]:NaN;la.push(na)}return{featureIds:la,pointPositions:ja}}_validatePositions(fa,X,ja,la,na){if(null!=la||!fa.serviceObbInIndexSR){X=X.length;for(let za=0;za<X;za++){var va=3*za;d.set(ia,ja[va],ja[va+1],ja[va+2]);va=!Number.isNaN(ja[2]);null==la||(va?m.extentContainsCoords3D(la,ia):m.extentContainsCoords2D(la,
ia))||(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&k.getLogger(this).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&k.getLogger(this).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++);fa.serviceObbInIndexSR||na.push(ia[0],ia[1],ia[2])}}}_createGraphics(fa,X,ja,la){const na=fa.length,va=this._getObjectIdField(),
za=this.processor.graphicsCore,ya=[],Da=this.view.spatialReference;for(let Ga=0;Ga<na;Ga++){var ra=fa[Ga];const Pa={};null!=ra&&(Pa[va]=ra);ra=null==ra?q.generateUID():ra;var xa=3*Ga,Ma=isNaN(X[xa+2])?void 0:X[xa+2];xa=y.makeDehydratedPoint(X[xa],X[xa+1],Ma,Da);Ma=this.loadedGraphics.get(ra);if(null!=Ma){if(null==Ma.level||Ma.level<la)ka.property="geometry",ka.graphic=Ma,ka.oldValue=Ma.geometry,ka.newValue=xa,Ma.geometry=xa,Ma.level=la,za.graphicUpdateHandler(ka);ya.push(Ma)}else Ma=q.generateUID(),
ya.push({objectId:ra,uid:Ma,geometry:xa,attributes:Pa,visible:!0,nodeIndex:ja,level:la})}return ya}_updateNodeMemory(fa){fa.memory=4096+(null!=fa.numFeatures?fa.numFeatures*this.processor.graphicsCore.usedMemoryPerGraphic:0)}_cacheNodeData(fa){const X=fa.graphics.reduce((ja,la)=>x.estimateSize(la)+ja,c.estimateSize(fa.featureIds)+1024);this._memCache.put(this._getMemCacheKey(fa.node),fa,X)}_getMemCacheKey(fa){return`${fa.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode((fa,X)=>{fa&&(this._updateNodeMemory(fa.node),
this._cacheNodeData(fa));this._controller.updateLoadStatus(X,!1)});this._treeDebugger&&this._treeDebugger.update();this.loadedGraphics.clear()}removeNode(fa){if(fa=this._removeNodeStageData(fa))this._updateNodeMemory(fa.node),this._cacheNodeData(fa)}_removeNodeStageData(fa){const X=this.loadedGraphics.getNode(fa);if(null==X)return null;this._controller.updateLoadStatus(fa,!1);this.loadedGraphics.removeNode(fa);this._treeDebugger&&this._treeDebugger.update();return X}async loadCachedNodeData(fa){return this._memCache?.pop(this._getMemCacheKey(fa))}async addCachedNodeData(fa,
X,ja,la){this.loadedGraphics.hasNode(fa.index)?k.getLogger(this).error("I3S node "+fa.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(X.featureIds,ja,la),X.attributeInfo=ja,this.loadedGraphics.addNode(fa.index,X),this._controller.updateLoadStatus(fa.index,!0),this._updateNodeMemory(fa),ca(X),this._filterNode(X),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const fa=[];this.loadedGraphics.forEachNode(X=>fa.push(X.node.id));return fa.sort()}getVisibleNodes(){const fa=
[];this.loadedGraphics.forEachNode(X=>fa.push(X.node));return fa}getLoadedNodeIndices(fa){this.loadedGraphics.forEachNode((X,ja)=>fa.push(ja))}getLoadedAttributes(fa){fa=this.loadedGraphics.getNode(fa);if(null!=fa?.attributeInfo)return fa.attributeInfo.loadedAttributes}getAttributeData(fa){fa=this.loadedGraphics.getNode(fa);if(null!=fa?.attributeInfo)return fa.attributeInfo.attributeData}_setAttributeData(fa,X){fa=this.loadedGraphics.getNode(fa);null!=fa?.attributeInfo&&(fa.attributeInfo.attributeData=
X,this._attributeValuesChanged(fa))}async updateAttributes(fa,X,ja){fa=this.loadedGraphics.getNode(fa);null!=fa&&(await this._i3sOverrides.applyAttributeOverrides(fa.featureIds,X,ja),fa.attributeInfo=X,this._attributeValuesChanged(fa))}_attributeValuesChanged(fa){ca(fa);this._filterNode(fa);if(this.processor.graphicsCore.labelsEnabled){const X=fa.node.index,ja=[];fa.graphics.forEach(la=>la.nodeIndex===X&&ja.push(la.uid));this.processor.graphicsCore.updateLabelingInfo(ja)}}_updateClippingExtent(fa){this._controller&&
this._controller.updateClippingArea(fa);return!1}_getObjectIdField(){return this.layer.objectIdField||u.fallbackObjectIDAttribute}_getGlobalIdField(){return this.layer.associatedLayer?.globalIdField}async _rendererChange(fa,X){const {layer:{fieldsIndex:ja}}=this,la=new Set;let na;fa?(await fa.collectRequiredFields(la,ja),na=Array.from(la).sort()):na=[];la.clear();let va;X?(await X.collectRequiredFields(la,ja),va=Array.from(la).sort()):va=[];na.length===va.length&&na.every((za,ya)=>na[ya]===va[ya])||
this._reloadAllNodes()}_rangeInfosChanged(fa){null!=fa&&0<fa.length&&k.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this.loadedGraphics.forEachNode(fa=>this._filterNode(fa))}_reloadAllNodes(){this._removeAllNodeData();this._controller&&this._controller.restartNodeLoading()}_filterNode(fa){const X=this.parsedDefinitionExpression,ja=this._excludeObjectIdsSorted,la=this._getObjectIdField();for(const na of fa.graphics){fa=
na.visible;const va=!X||this._evaluateClause(X,na),za=null==ja||0>l.binaryIndexOf(ja,na.attributes[la]);na.visible=va&&za;fa!==na.visible&&(ka.graphic=na,ka.property="visible",ka.oldValue=fa,ka.newValue=na.visible,this.processor.graphicsCore.graphicUpdateHandler(ka))}}createQuery(){const fa={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return null!=this.filter?this.filter.createQuery(fa):new C(fa)}queryFeatures(fa,X){return this._queryEngine.executeQuery(this._ensureQuery(fa),
X?.signal)}queryObjectIds(fa,X){return this._queryEngine.executeQueryForIds(this._ensureQuery(fa),X?.signal)}queryFeatureCount(fa,X){return this._queryEngine.executeQueryForCount(this._ensureQuery(fa),X?.signal)}queryExtent(fa,X){return this._queryEngine.executeQueryForExtent(this._ensureQuery(fa),X?.signal)}_ensureQuery(fa){return this._addDefinitionExpressionToQuery(null==fa?this.createQuery():C.from(fa))}_setupQueryEngine(){const fa=()=>this.processor.featureStore;this._queryEngine=new E.QueryEngine({context:{spatialReference:this.view.spatialReference,
layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return fa()},hasZ:this.hasZ,hasM:this.hasM},priority:U.TaskPriority.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}async _handleEdits(fa){const X=
this._attributeEditingContext;fa=await G.normalizeEditResultsEvent(X,fa);G.processAttributeEdits(X,fa)}get _attributeEditingContext(){const fa=this._getObjectIdField(),X=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:fa,globalIdField:X,forEachNode:ja=>this.loadedGraphics.forEachNode(la=>ja(la.node,la.featureIds)),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:ja=>
this.getAttributeData(ja),setAttributeData:(ja,la,na)=>{this._setAttributeData(ja,la);ja=this.loadedGraphics.getNode(ja);null!=na?(na=this.loadedGraphics.get(na.attributes[fa]),null!=na&&this.processor.graphicsCore.recreateGraphics([na])):null!=ja&&this.processor.graphicsCore.recreateGraphics(ja.graphics)},clearMemCache:()=>{}}}get performanceInfo(){return new K.LayerViewPerformanceInfo(this.usedMemory,this.loadedGraphics.length,-1,this.maximumNumberOfFeatures,this.loadedGraphics.nodeCount,this.processor.graphicsCore.performanceInfo)}get test(){}};
b.__decorate([e.property()],H.prototype,"processor",void 0);b.__decorate([e.property({type:B})],H.prototype,"filter",void 0);b.__decorate([e.property()],H.prototype,"loadedGraphics",void 0);b.__decorate([e.property()],H.prototype,"i3slayer",null);b.__decorate([e.property()],H.prototype,"_controller",void 0);b.__decorate([e.property()],H.prototype,"updating",void 0);b.__decorate([e.property()],H.prototype,"suspended",void 0);b.__decorate([e.property()],H.prototype,"holeFilling",void 0);b.__decorate([e.property(V.updatingProgress)],
H.prototype,"updatingProgress",void 0);b.__decorate([e.property()],H.prototype,"updatingProgressValue",null);b.__decorate([e.property(p.requiredFields)],H.prototype,"requiredFields",null);b.__decorate([e.property(p.availableFields)],H.prototype,"availableFields",void 0);b.__decorate([e.property()],H.prototype,"_fieldsHelper",void 0);b.__decorate([e.property({type:Number})],H.prototype,"maximumNumberOfFeatures",null);b.__decorate([e.property({readOnly:!0})],H.prototype,"maximumNumberOfFeaturesExceeded",
null);b.__decorate([e.property()],H.prototype,"_excludeObjectIdsSorted",null);b.__decorate([e.property({readOnly:!0})],H.prototype,"lodFactor",null);b.__decorate([e.property({readOnly:!0})],H.prototype,"hasM",null);b.__decorate([e.property({readOnly:!0})],H.prototype,"hasZ",null);b.__decorate([e.property()],H.prototype,"contentVisible",null);b.__decorate([e.property({readOnly:!0})],H.prototype,"legendEnabled",null);b=H=b.__decorate([g.subclass("esri.views.3d.layers.SceneLayerGraphicsView3D")],H);
const da={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},ia=t.create(),ka={graphic:null,property:null,oldValue:null,newValue:null};return b})},"esri/views/3d/layers/I3SPointsWorkerHandle":function(){define(["exports","../../../core/workers/WorkerHandle"],function(a,b){class q extends b.WorkerHandle{constructor(l){super("SceneLayerWorker","dracoDecompressPointCloudData",{dracoDecompressPointCloudData:p=>
[p.geometryBuffer]},l,{hasInitialize:!0})}}a.I3SPointsWorkerHandle=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/layers/i3s/I3SGraphicsMap":function(){define(["exports","../../../../core/Evented","../../../../core/has","../../../../core/MapUtils"],function(a,b,q,l){class p extends b{constructor(k,h){super();this._updateAndCompare=k;this._notifyUpdated=h;this._nodes=new Map;this._graphics=new Map;this._duplicates=new Map}clear(){if(0<this._graphics.size){const k=
this.toArray();this._graphics.clear();this.emit("change",{added:[],removed:k})}this._nodes.clear()}get length(){return this._graphics.size}get(k){return this._graphics.get(k)}getNode(k){return this._nodes.get(k)}hasNode(k){return this._nodes.has(k)}nodes(){return this._nodes.values()}addNode(k,h){this._nodes.set(k,h);const f=h.graphics;if(0!==f.length){var c=new Set;for(let g=0;g<f.length;g++){var e=f[g];const d=e.objectId,t=this._graphics.get(d);t?(c.add(d),e!==t&&(f[g]=t),(e=this._duplicates.get(d))?
e.push(k):this._duplicates.set(d,[t.nodeIndex,k])):(e.nodeIndex=k,this._graphics.set(d,e))}c.size&&this._updateForeignGraphics(h);k=0<c.size?f.filter(g=>!c.has(g.objectId)):f;0<k.length&&this.emit("change",{added:k,removed:[]})}}removeNode(k){var h=this._nodes.get(k);if(h){this._nodes.delete(k);var f=new Set,c=[];for(const d of h.graphics){h=d.objectId;var e=this._graphics.get(h);if(!e)continue;const t=this._duplicates.get(h);if(t){var g=t.indexOf(k);if(-1!==g){t.splice(g,1);if(e.nodeIndex===k){e=
this.getNode(t[0]);for(g=1;g<t.length;g++){const w=this.getNode(t[g]);if(null==e||null!=w&&w.node.level>e.node.level)e=w}null!=e&&f.add(e)}1===t.length&&this._duplicates.delete(h)}}else this._graphics.delete(h),c.push(d)}0<c.length&&this.emit("change",{added:[],removed:c});f.forEach(d=>this._updateForeignGraphics(d))}}_updateForeignGraphics(k){const h=[],f=k.node.index,c=k.node.level;let e=0;for(;e<k.graphics.length;){var g=k.graphics[e].nodeIndex;if(g===f){e++;continue}let d=1;for(;e+d<k.graphics.length&&
k.graphics[e+d].nodeIndex===g;)d++;g=this.getNode(g);if(!(null!=g&&g.node.level>c))for(g=e;g<e+d;g++){const t=k.graphics[g];t.nodeIndex=f;this._updateAndCompare(t,k,g)&&h.push(t)}e+=d}0<h.length&&this._notifyUpdated(h)}toArray(){return Array.from(this._graphics.values())}find(k){let h=void 0;l.someMap(this._graphics,f=>k(f)?(h=f,!0):!1);return h}forEach(k){this._graphics.forEach(h=>k(h))}forEachNode(k){this._nodes.forEach((h,f)=>k(h,f))}get nodeCount(){return this._nodes.size}_checkInvariants(){const k=
new Map;this._nodes.forEach((h,f)=>{h.graphics.forEach(c=>{k.set(c.objectId,1+(k.get(c.objectId)??0));this._duplicates.get(c.objectId)})});k.forEach((h,f)=>{(h=this._graphics.get(f))&&this._nodes.get(h.nodeIndex)&&(f=this._duplicates.get(f))&&f.forEach(c=>{this._nodes.get(c)})})}}a.I3SGraphicsMap=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"*noref":1}});
define("require ../chunks/tslib.es6 ../Camera ../geometry ../Viewpoint ../core/Collection ../core/domUtils ../core/Error ../core/events ../core/handleUtils ../core/has ../core/Logger ../core/maybe ../core/ObservableChangesType ../core/promiseUtils ../core/reactiveUtils ../core/scheduling ../core/screenUtils ../core/workers/workers ../core/accessorSupport/decorators/property ../core/accessorSupport/decorators/cast ../core/RandomLCG ../core/accessorSupport/decorators/subclass ../core/accessorSupport/ensureType ../core/accessorSupport/overrideDefaultsFrom ../core/libs/gl-matrix-2/factories/vec3f64 ../core/support/OwningCollection ../geometry/HeightModelInfo ../geometry/projection ../geometry/projection/projectBoundingRect ../geometry/projection/projectPointToVector ../geometry/support/aaBoundingRect ../chunks/boundedPlane ../geometry/support/coordinateSystem ../geometry/support/scaleUtils ../layers/support/layerUtils ../support/AnalysesCollection ./BreakpointsOwner ./DOMContainer ./GroundView ./PopupView ./View ./ViewAnimation ./ViewingMode ./3d/layerViewModuleImportUtils ./3d/analysis/AnalysisViewManager3D ./3d/constraints/Constraints ./3d/environment/SceneViewEnvironment ./3d/environment/SceneViewEnvironmentManager ./3d/input/SceneInputManager ./3d/layers/graphics/GraphicsDeconflictor ./3d/layers/graphics/Labeler ./3d/layers/support/FeatureTileTree3D ./3d/state/ViewState ./3d/state/ViewStateManager ./3d/state/helpers/SceneIntersectionHelper ./3d/support/CombinedElevationProvider ./3d/support/debugFlags ./3d/support/DisplayQualityProfile ./3d/support/ElevationProvider ./3d/support/HighlightOptions ./3d/support/hitTest ./3d/support/MapCoordsHelper ./3d/support/popupHitTest ./3d/support/PropertiesPool ./3d/support/QualitySettings ./3d/support/RenderCoordsHelper ./3d/support/ResourceController ./3d/support/SceneViewPerformanceInfo ./3d/support/SharedSymbolResources ./3d/support/TextureCollection ./3d/support/pointsOfInterest/PointsOfInterest ./3d/terrain/TerrainSurface ./3d/terrain/terrainUtils ./3d/webgl-engine/Stage ./3d/webgl-engine/lib/basicInterfaces ./3d/webgl-engine/lib/Intersector ./3d/webgl-engine/lib/verticalOffsetUtils ./support/layerViewUtils ./support/screenshotUtils ./support/screenUtils ./support/spatialReferenceSupport ./support/WebGLRequirements ./ui/DefaultUI ./ui/3d/DefaultUI3D ../webscene/Environment ../geometry/Extent ../geometry/SpatialReference ../geometry/Point".split(" "),function(a,
b,q,l,p,k,h,f,c,e,g,d,t,w,v,m,r,n,u,x,y,z,A,B,C,D,F,H,N,E,G,I,O,L,P,M,K,J,R,Q,W,S,V,T,Y,ha,ba,U,Z,ca,ea,da,ia,ka,fa,X,ja,la,na,va,za,ya,Da,ra,xa,Ma,Ga,Pa,Qa,Ea,ua,Na,Ua,wa,sa,Ha,Ka,Aa,Sa,Ya,qa,aa,Ja,Ta,Ra,$a,bb,pa,Ba){function Ia(La,Xa){return null!=La&&N.canProjectWithoutEngine(La.spatialReference,Xa)?N.project(La,Xa):null}l=class extends J.BreakpointsOwner(W.PopupView(R.DOMContainer(S))){constructor(La){super(La);this._createGraphicsViewController=this._initialDefaultSpatialReference=this._clippingArea=
this._userClippingArea=null;this._resolveWhenReady=[];this._propertiesPool=new xa.PropertiesPool({slicePlane:O.BoundedPlaneClass},this);this._resourceController=Pa.newResourceController(this);this._defaultToMapOptions={include:new Set};this._defaultHitTestOptions={exclude:new Set};this.deconflictor=new ea.GraphicsDeconflictor({view:this});this.labeler=new da.Labeler({view:this,deconflictor:this.deconflictor.labels});this.sharedSymbolResources=null;this.analyses=new K.AnalysesCollection;this.canvas=
this.elevationProvider=this.basemapTerrain=null;this.constraints=new ba.Constraints;this.environment=new U;this.environmentManager=new Z.SceneViewEnvironmentManager;this.floors=new k;this.fullOpacity=1;this.graphicsView=null;this.analysisViewManager=new ha({view:this});this.map=this.groundView=null;this.screenSizePerspectiveEnabled=!0;this.state=new ka;this.spatialReference=null;this.preserveDrawingBufferEnabled=this.alphaCompositingEnabled=!1;this.supersampleScreenshotsEnabled=!0;this.type="3d";
this.ui=new Ra;this._lastUpdateTime=this._numUpdating=0;this.updatingProgress=.5;this.highlightOptions=new za;u.initialize();const Xa=(eb=null)=>{if(null==eb||eb.type!==w.ObservableChangesType.MOVE)this._updatingChanged(),this.map&&this.map.allLayers.forEach(async db=>{try{await db.when()}catch{}this._updatingChanged()})};this.addHandles([m.on(()=>this.map?.allLayers,"after-changes",eb=>Xa(eb),{onListenerAdd:()=>Xa(),onListenerRemove:()=>Xa(),sync:!0}),this.allLayerViews.on("after-changes",eb=>this._updateUpdatingMonitors(eb)),
m.watch(()=>this.map,eb=>{eb&&"load"in eb&&eb.load&&eb.load().catch(()=>{})})]);this.inputManager=new ca({view:this});this.stateManager=new fa.ViewStateManager({view:this})}initialize(){this.groundView=new Q({view:this});this._updateUpdatingMonitors();const La=()=>this._updateDefaultToMapOptions();this.addHandles(m.on(()=>this.map?.allLayers,"after-changes",La,{onListenerAdd:La,onListenerRemove:La}));this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,Xa=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=
Xa)},m.initial);this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,Xa=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=Xa)},m.initial);this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,Xa=>r.setFrameDuration(0<Xa?1E3/Math.ceil(Xa):0),m.initial);this.updatingHandles.add(()=>this.map?.ground,La,m.syncAndInitial);this.updatingHandles.add(()=>this.map?.ground?.opacity,()=>this._updateDefaultHitTestOptions(),m.syncAndInitial);
this.addHandles(m.watch(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),m.sync))}destroy(){this.destroyed||(this.updatingHandles.removeAll(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=t.destroyMaybe(this.sharedSymbolResources),this._set("labeler",t.destroyMaybe(this.labeler)),this._set("deconflictor",t.destroyMaybe(this.deconflictor)),this._resourceController=t.destroyMaybe(this._resourceController),
this._set("stateManager",t.destroyMaybe(this.stateManager)),this._set("inputManager",t.destroyMaybe(this.inputManager)),this.state.destroy(),this._propertiesPool.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",t.destroyMaybe(this.environmentManager)),this._set("environment",t.destroyMaybe(this.environment)),this.groundView=t.destroyMaybe(this.groundView),this._exitBasemapTerrain(),this._stage?.destroy())}get renderSpatialReference(){return this.renderCoordsHelper&&
this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get camera(){return this.stateManager?.camera}set camera(La){this.stateManager&&(this.stateManager.camera=La)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(La){this.stateManager&&(this.stateManager.contentCamera=La)}installContentCameraReset(La={sticky:!1}){return this.stateManager.installContentCameraReset(La)}get center(){return this.stateManager?.center}set center(La){this.stateManager&&
(this.stateManager.center=La)}get clippingArea(){if("global"===this.viewingMode)return null;const La=this.map;let Xa=this._userClippingArea||t.maybeProperty(La,"clippingArea");if(!this._userClippingArea&&!t.maybeProperty(La,"clippingEnabled")||null==Xa)return this._clippingArea=null;if(!(Xa instanceof bb))return d.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea;if(this.spatialReference&&(Xa=Ia(Xa,this.spatialReference),null==Xa))return d.getLogger(this).error("#clippingArea",
"setting clippingArea with incompatible SpatialReference"),this._clippingArea;Xa=Xa.clone();null==Xa.intersection(this._groundAndLayersExtent)&&(Xa.xmin=Xa.xmax,Xa.ymin=Xa.ymax);Xa.zmin=void 0;Xa.zmax=void 0;Xa.equals(this._clippingArea)||(this._clippingArea=Xa);return this._clippingArea}set clippingArea(La){this.ready&&"global"===this.viewingMode&&null!=La?d.getLogger(this).error("#clippingArea\x3d","Clipping area is only supported in local viewingMode"):this._userClippingArea=La}get renderDataExtent(){if(this.state.viewingMode===
T.ViewingMode.Global)return null;const La=this.renderSpatialReference,Xa=this.dataExtent;return null==Xa||null==La||Xa.spatialReference.equals(La)?Xa:Ia(Xa,La)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let La=this._groundAndLayersExtent;var Xa=Ia(this.clippingArea,this.spatialReference||pa.WGS84);null!=Xa&&(La=null!=La?La.intersection(Xa):Xa);Xa=this._get("dataExtent");return null!=La&&La.equals(Xa)?Xa:La}get _groundAndLayersExtent(){const La=this.spatialReference||
pa.WGS84;let Xa;const eb=jb=>{jb=Ia(jb,La);null!=jb&&(null!=Xa?Xa.union(jb):Xa=jb.clone())};var db=this.basemapTerrain;if(db?.spatialReference){const jb=db.groundExtent;eb(new bb({xmin:jb[0],ymin:jb[1],zmin:0,xmax:jb[2],ymax:jb[3],zmax:0,spatialReference:db.spatialReference}))}this.map&&this.map.allLayers.forEach(jb=>{null==jb.fullExtent||"graphics"===jb.type&&jb.internal||eb(jb.fullExtent)});if(null==Xa)return null;Xa.hasZ?(Xa.zmin=Math.min(0,Xa.zmin??0),Xa.zmax=Math.max(0,Xa.zmax??0)):(Xa.zmin=
0,Xa.zmax=0);db=this._get("_groundAndLayersExtent");return Xa.equals(db)?db:Xa}castEnvironment(La){return La?La instanceof U?La:La instanceof $a?this.environment?.cloneWithWebsceneEnvironment(La)??U.fromWebsceneEnvironment(La):B.ensureType(U,La):new U}get extent(){return this.stateManager?.extent}set extent(La){this.stateManager&&(this.stateManager.extent=La)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get initialExtentRequired(){return this.stateManager&&
!this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(null==this.state||this.state.stationary)}get navigating(){return this.state?.navigating??!1}get padding(){return this.stateManager?.padding}set padding(La){this.stateManager&&(this.stateManager.padding=La)}set qualityProfile(La){na.isValidProfile(La)&&
(na.apply(La,this.qualitySettings),this._set("qualityProfile",La))}get qualityProfile(){return this._get("qualityProfile")||na.getDefaultProfile()}set slicePlane(La){null!=this._stage&&this._stage.renderer.setParameters({slicePlane:La});if(null==La)this._set("slicePlane",null);else{var Xa=this._propertiesPool.get("slicePlane");O.copy(La,Xa);this._set("slicePlane",Xa)}}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){return null!=
this.spatialReference?P.getResolutionForScale(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(La){this.stateManager&&(this.stateManager.scale=La)}get terrainScale(){return this.stateManager?.terrainScale}get heightModelInfo(){const La=this.getDefaultHeightModelInfo();return null!=La?H.deriveUnitFromSR(La,this.spatialReference):null}get updating(){if(this.destroyed)return!1;let La=0,Xa=this.layerViewManager.updating,eb=Xa?this.layerViewManager.updatingRemaining:
0;this.allLayerViews.forEach(nb=>{nb.isFulfilled()?nb.updating&&(Xa=!0,nb.suspended||wa.isSurfaceLayerView(nb)||(++eb,La+=nb.updatingProgress)):++eb});for(var db of this._updatingObjects)null!=db&&db.updating&&(eb+=.1,La+=.05);for(var jb of this._updatingObjectsWithProgress)null!=jb&&jb.updating&&(++eb,La+=jb.updatingProgress);db=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;(Xa=!!(Xa||0<eb||this.updatingHandles.updating||!this.ready||!this.stationary||db||this._createGraphicsViewController||
this.inputManager?.updating||this.map?.allLayers?.some(nb=>!nb.isFulfilled())||this.textures?.updating))?(this._numUpdating=Math.max(eb,this._numUpdating),La+=this._numUpdating-eb):this._numUpdating=0;La=0<this._numUpdating?La/this._numUpdating:Xa?0:1;this._get("updatingProgress")!==La&&(db=performance.now(),1>La&&(jb=Math.min((db-this._lastUpdateTime)/2E3,1),La=this.updatingProgress*(1-jb)+La*jb),this._set("updatingProgress",La),this._lastUpdateTime=Xa&&1>La?db:0);return Xa}get _updatingObjects(){return[this.graphicsView,
this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){var La=this._predeterminedViewingMode;return null!=La?T.stringFromViewingMode(La):(La=this.spatialReference)?null!=this.defaultsFromMap?.viewingMode&&La.equals(this.defaultsFromMap.spatialReference)?
T.stringFromViewingMode(this.defaultsFromMap.viewingMode):aa.isSpatialReferenceSupported(La,T.ViewingMode.Global)?"global":"local":"global"}set viewingMode(La){this.ready?d.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",La)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(La){this.stateManager&&(this.stateManager.viewpoint=La)}get zoom(){return this.stateManager.zoom}set zoom(La){this.stateManager&&(this.stateManager.zoom=
La)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new Qa(this)}on(La,Xa,eb,db){return(eb=this.viewEvents.on(La,Xa,eb,db))?eb:super.on(La,Xa)}hasEventListener(La){return super.hasEventListener(La)||this.viewEvents.hasHandler(La)}toMap(La,Xa){if(!this.ready)return d.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),
null;La=qa.isSupportedScreenPointEvent(La)?qa.createScreenPointFromSupportedEvent(this,La):La;return ya.toMap(this,La,Xa,this._defaultToMapOptions)}toScreen(La){if(!this.ready)return d.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const Xa=(null==La.z?va.getElevationAtPoint(this.elevationProvider,La):null)??0;G.projectPointToVector(La,Wa,this.renderSpatialReference,Xa);this.state.camera.projectToScreen(Wa,gb);return n.createScreenPoint(gb[0],gb[1])}pixelSizeAt(La){if(!this.ready)return d.getLogger(this).error("#pixelSizeAt()",
"Scene view cannot be used before it is ready"),null;if(!La)return 0;G.projectPointToVector(La,Wa,this.renderSpatialReference);return this.state.camera.computeScreenPixelSizeAt(Wa)}overlayPixelSizeInMapUnits(La){const Xa=this.basemapTerrain.overlayManager;return Xa?Xa.overlayPixelSizeInMapUnits(La,()=>this.pixelSizeAt(La)):1}hitTest(La,Xa){if(!this.ready)return d.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;La=qa.isSupportedScreenPointEvent(La)?qa.createScreenPointFromSupportedEvent(this,
La):La;return ya.hitTest(this,La,Xa,this._defaultHitTestOptions)}async popupHitTest(La){return ra.popupHitTest(this,La)}goTo(La,Xa){return this.updatingHandles.addPromise(this.stateManager.goTo(La,Xa))}async whenAnalysisView(La){if(null==La.parent)throw new f("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:La});switch(La.parent.type){case "line-of-sight":case "dimension":return(await this.whenLayerView(La.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(La)}}whenLayerView(La){return super.whenLayerView(La)}async takeScreenshot(La){La=
this._completeSettings(La);await this.whenReady();const Xa=await this._stage.renderView.takeScreenshot(La);return Ya.encode(Xa,La,this._pixelFormat())}async _takeScreenshot(La){La=this._completeSettings(La);await this.whenReady();La=await this._stage.renderView.takeScreenshot(La);return Ya.encodeData(La,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(La){La=this._completeSettings(La);await this.whenReady();La=await this._stage.renderView.takeScreenshotWithOID(La);return[Ya.encodeData(La[0],
this._pixelFormat()),Ya.encodeData(La[1],this._pixelFormat())]}_completeSettings(La){La=Ya.toRenderSettings(La,this);La.pixelRatio/=this.state.pixelRatio;return Ya.screenshotSuperSampleSettings(La,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this._stage.renderView.getAlpha()}}get test(){}async takeScreenshotWithObjectAndLayerId(La){if(!g("enable-feature:objectAndLayerId-rendering"))throw Error("has enable-feature:objectAndLayerId-rendering must be true");
var Xa=this._completeSettings(La);await this.whenReady();var eb=await this._stage.renderView.takeScreenshotWithOID(Xa);Xa=Ya.encode(eb[0],Xa,this._pixelFormat());La=this._completeSettings(La);La.format="png";eb=Ya.encode(eb[1],La,this._pixelFormat());return[Xa,eb]}getColorToObjectAndLayerIdMapping(){if(null==this._stage.renderView.objectAndLayerIdRenderHelper)throw Error("has enable-feature:objectAndLayerId-rendering must be true");return this._stage.renderView.objectAndLayerIdRenderHelper.getColorToObjectAndLayerIdMapping()}addUpdatingPromise(La){return this.updatingHandles.addPromise(La)}importLayerView(La){return Y.layerView3DImporter.importLayerView(La)}hasLayerViewModule(La){return Y.layerView3DImporter.hasLayerViewModule(La)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&
"initialViewProperties"in this.map&&this.map.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let La=Ja.check(this.type);const Xa=g("safari");Xa&&9>Xa&&(La=new f("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari \x3c 9)",{type:"safari",requiredVersion:9,detectedVersion:Xa}));if(null!=La)throw d.getLogger(this).warn("#validate()",La.message),La;
}get _predeterminedViewingMode(){const La=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return null!=La?T.viewingModeFromString(La):null}getSpatialReferenceSupport(La,Xa){var eb=this._predeterminedViewingMode;if(null!=eb)return this._validateSpatialReferenceForViewingMode(La,Xa,eb)?{constraints:this._makeSpatialReferenceConstraints(La,Xa,eb)}:null;eb=this._validateSpatialReferenceForViewingMode(La,
Xa,T.ViewingMode.Local);const db=this._validateSpatialReferenceForViewingMode(La,Xa,T.ViewingMode.Global);return eb||db?eb&&db?{constraints:this._makeSpatialReferenceConstraints(La,Xa,null)}:eb?{constraints:this._makeSpatialReferenceConstraints(La,Xa,T.ViewingMode.Local)}:{constraints:this._makeSpatialReferenceConstraints(La,Xa,T.ViewingMode.Global)}:null}_validateSpatialReferenceForViewingMode(La,Xa,eb){return aa.isSpatialReferenceSupported(La,eb)?null==Xa||M.isImageryTileLayer(Xa)?!0:M.isTiledLayer(Xa)&&
null==wa.getTiledLayerInfo(Xa,La,eb)||M.isVoxelLayer(Xa)&&eb===T.ViewingMode.Global?!1:!0:!1}_makeSpatialReferenceConstraints(La,Xa,eb){if(null==Xa)return[{spatialReference:La,viewingMode:eb}];const {isWebMercator:db,isWGS84:jb}=La;return M.isImageryTileLayer(Xa)&&(db||jb)?(jb&&eb!==T.ViewingMode.Local?null===wa.checkIfTileInfoSupportedForView(Xa.tileInfo,Xa.fullExtent,La,T.ViewingMode.Global):1)?[{spatialReference:La,viewingMode:eb},{spatialReference:pa.WebMercator,viewingMode:eb}]:[{spatialReference:db?
pa.WGS84:pa.WebMercator,viewingMode:eb}]:M.isTiledLayer(Xa)||M.isVoxelLayer(Xa)||!db&&!jb?M.isTiledLayer(Xa)&&db&&eb!==T.ViewingMode.Global?[{spatialReference:La,viewingMode:eb},{spatialReference:pa.WGS84,viewingMode:T.ViewingMode.Local}]:[{spatialReference:La,viewingMode:eb}]:[{spatialReference:La,viewingMode:eb},{spatialReference:db?pa.WGS84:pa.WebMercator,viewingMode:eb}]}_validateSpatialReference(La){const Xa=null!=this.getSpatialReferenceSupport(La),eb=this._predeterminedViewingMode;Xa||(null!=
eb?d.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${T.stringFromViewingMode(eb)} viewing mode.`):La.isGeographic&&d.getLogger(this).warnOnce("Spatial reference is geographic but not supported."));return Xa}whenReady(){return new Promise(La=>{this.ready?La(this):this._resolveWhenReady.push(La)})}trackGraphicState(La){if(!La.graphic)return d.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const Xa=
this.getViewForGraphic(La.graphic);let eb=null,db=!1;const jb=nb=>{!db&&null!=nb&&"processor"in nb&&"graphics-3d"===nb.processor?.type&&nb.processor.graphicsCore&&(eb=nb.processor.graphicsCore.trackGraphicState(La))};null!=Xa?jb(Xa):this.whenViewForGraphic(La.graphic,{waitForLayer:!0}).then(nb=>jb(nb),()=>{}).catch(()=>{});return e.makeHandle(()=>{db=!0;null!=eb&&(eb.remove(),eb=null)})}highlight(La){if(Array.isArray(La))return e.handlesGroup(La.map(eb=>this.highlight(eb)));if(k.isCollection(La))return e.handlesGroup(La.toArray().map(eb=>
this.highlight(eb)));const Xa=this.getViewForGraphic(La);return Xa&&"highlight"in Xa?Xa.highlight(La):e.makeHandle()}maskOccludee(La){if(!La)return d.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const Xa=this.getViewForGraphic(La);let eb=null,db=!1;const jb=nb=>{!db&&null!=nb&&Sa.occludeesSupported(nb)&&(eb=nb.maskOccludee(La))};null!=Xa?jb(Xa):this.whenViewForGraphic(La,{waitForLayer:!0}).then(nb=>jb(nb),()=>{}).catch(()=>{});
return e.makeHandle(()=>{db=!0;null!=eb&&(eb.remove(),eb=null)})}getViewForGraphic(La){return La.layer===this.graphics?this.graphicsView:La.layer?this.allLayerViews.find(Xa=>Xa.layer===La.layer):null}graphicChanged(La){null!=this.graphicsView&&this.graphicsView.graphicChanged(La)}async whenViewForGraphic(La,Xa){if(La.layer===this)return await m.whenOnce(()=>this.graphicsView),this.graphicsView;if(!La.layer||!this.map)throw new f("no-view-for-graphic");return Xa&&Xa.waitForLayer&&!this.map.allLayers.includes(La.layer)?
new Promise((eb,db)=>{const jb=this.map.allLayers.on("change",nb=>{nb.added.includes(La.layer)&&(jb.remove(),this.whenLayerView(La.layer).then(eb,db))})}):this.whenLayerView(La.layer)}_initBasemapTerrain(){this._set("basemapTerrain",new Ua({view:this}));this._set("elevationProvider",new ja.CombinedElevationProvider({view:this}));this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),
this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem();this.state.createInitialCamera();this._initBasemapTerrain();this._set("pointsOfInterest",new Na.PointsOfInterest({view:this}));this._set("featureTiles",new ia.FeatureTileTree3D({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,
scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const La=()=>{var Xa=this.basemapTerrain?.extent;this.clippingArea||Xa?Xa&&this.basemapTerrain.spatialReference?(Xa=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?N.project(I.toExtent(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null,this.featureTiles.filterExtent=null!=this.clippingArea?this.clippingArea.intersection(Xa):Xa):this.featureTiles.filterExtent=
this.clippingArea:this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add(()=>la.debugFlags.FEATURE_TILE_TREE_SHOW_TILES,Xa=>{Xa&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(new Promise((eb,db)=>a(["./3d/layers/support/FeatureTileTree3DDebugger"],eb,db))).then(({FeatureTileTree3DDebugger:eb})=>{!this._featureTreeDebugger&&la.debugFlags.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new eb({view:this}))}):Xa||!this._featureTreeDebugger||
la.debugFlags.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)},m.syncAndInitial),this.updatingHandles.add(()=>this.clippingArea,La,m.syncAndInitial),this.updatingHandles.add(()=>this.basemapTerrain.extent,La,m.syncAndInitial)],"feature-tiles");this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",
null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){var La=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(La)||this._set("mapCoordsHelper",new Da.MapCoordsHelper(this.map,La));const Xa=this.state.isGlobal;La=L.renderSRFromViewSR(Xa,La);La!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ga.RenderCoordsHelper.create(this.state.viewingMode,
La)),Xa||this.addHandles(m.watch(()=>this.basemapTerrain?.extent,eb=>{const db=this.renderCoordsHelper.spatialReference;null==eb||0===eb[0]&&0===eb[1]&&0===eb[2]&&0===eb[3]||!E.projectBoundingRect(eb,this.basemapTerrain.spatialReference,ib,db)||(this.renderCoordsHelper.extent=ib)},m.sync),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Ka.defaultTolerance/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",
null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(La=null){if(null==La||La.type!==w.ObservableChangesType.MOVE)this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(Xa=>{Xa.destroyed||(this.addHandles(m.watch(()=>[Xa.updating,Xa.updatingProgress],()=>this._updatingChanged(),m.sync),"updatingMonitors"),
Xa.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged()}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(La,Xa,eb){if(!this.overlay||!this.overlay.hasVisibleItems)return eb;const db=La.getContext("2d");db.putImageData(eb,0,0);this.overlay.renderCanvas(La,{disableDecorations:Xa===Ha.Decorations.OFF});return db.getImageData(0,0,eb.width,eb.height)}_initStage(){const La={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,
debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(eb,db,jb)=>this._renderScreenshotOverlay(eb,db,jb)}};var Xa=new X.SceneIntersectionHelper(this.state.viewingMode,eb=>this._stage.layers.forAll(eb),this);this._set("sceneIntersectionHelper",Xa);Xa=h.byId(this.surface);this._stage=new sa.Stage({view:this,options:La,
container:Xa});this._stage.renderer.setParameters({slicePlane:this.slicePlane});this.addHandles([this.updatingHandles.add(()=>this.qualitySettings.highQualityTransparency,eb=>this._stage.renderer.setParameters({highQualityTransparency:eb}),m.initial),this.on("pointer-move",()=>this._stage?.renderer.resetAnimation()),c.on(this._stage.renderView.canvas,"webglcontextlost",eb=>{this.fatalError=new f("webgl-context-lost",eb.statusMessage)})],"stage");this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(Ka.defaultTolerance/
this.renderCoordsHelper.unitInMeters);this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null);this._stage=t.destroyMaybe(this._stage);this.removeHandles("stage");this._set("canvas",null)}_initSurface(La){this._exitSurface();this.state.init(La,this.spatialReference);this._initStage();this._initGlobe();this.sharedSymbolResources=new Ea.SharedSymbolResources({view:this,viewingMode:La,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,
viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(!this.graphicsView&&!this._createGraphicsViewController&&0!==this.graphics.length){this.removeHandles("graphics-view");this._createGraphicsViewController=new AbortController;var La=()=>{this._createGraphicsViewController=null;this._updatingChanged()};
this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(La,La);this._updatingChanged()}}async _createGraphicsViewAsync(La){const Xa=(await new Promise((eb,db)=>a(["./3d/layers/GraphicsView3D"],jb=>eb(Object.freeze(Object.defineProperty({__proto__:null,default:jb},Symbol.toStringTag,{value:"Module"}))),db))).default;v.throwIfAborted(La);await m.whenOnce(()=>this.basemapTerrain?.ready,La);this._set("graphicsView",new Xa({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&
(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null);this.removeHandles("graphics-view");null!=this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){var La=T.viewingModeFromString(this.viewingMode);La===T.ViewingMode.Global&&(this._clippingArea=null);this._initSurface(La);this._set("ready",!0);this.addHandles(m.on(()=>this.graphics,"after-changes",()=>this._createGraphicsViewIfNeeded()),
"graphics-view");this._createGraphicsViewIfNeeded();La=this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties:null;const Xa=La?.environment;Xa&&C.overrideDefaultsFrom(this.environment,Xa);this.timeExtent=La?.timeExtent;this.labeler.setup();this.environmentManager.connectView(this);this.inputManager.connect();this._set("textures",new ua.TextureCollection(this._stage,this.resourceController.scheduler));La=this._resolveWhenReady;this._resolveWhenReady=[];La.forEach(eb=>eb(this))}_teardown(){this._initialDefaultSpatialReference=
null;this.inputManager.disconnect();this.environmentManager.disconnectView();this.labeler.dispose();this._disposeGraphicsView();this.removeHandles("graphics-view");this._set("textures",t.destroyMaybe(this.textures));this._exitSurface();this._set("ready",!1)}_updateDefaultToMapOptions(){this._defaultToMapOptions.include.clear();if(this.map){this.map.ground&&this._defaultToMapOptions.include.add(Aa.terrainId);for(const La of this.map.allLayers.items)M.isIntegratedMeshLayer(La.type)&&this._defaultToMapOptions.include.add(La.uid)}}_updateDefaultHitTestOptions(){this._defaultHitTestOptions.exclude.clear();
if(this.map){this.map.ground&&1>this.map.ground.opacity&&this._defaultHitTestOptions.exclude.add(Aa.terrainId);for(const La of this.map.allLayers.items)M.isIntegratedMeshLayer(La.type)&&1>La.opacity&&this._defaultHitTestOptions.exclude.add(La.uid)}}};l.type="3d";b.__decorate([x.property()],l.prototype,"_userClippingArea",void 0);b.__decorate([x.property()],l.prototype,"_resourceController",void 0);b.__decorate([x.property()],l.prototype,"_stage",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,
"deconflictor",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"labeler",void 0);b.__decorate([x.property(F.owningCollectionProperty(K.AnalysesCollection,"analyses"))],l.prototype,"analyses",void 0);b.__decorate([x.property({type:V,readOnly:!0})],l.prototype,"animation",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"basemapTerrain",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"elevationProvider",void 0);b.__decorate([x.property()],l.prototype,"camera",null);
b.__decorate([x.property({type:q})],l.prototype,"contentCamera",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"canvas",void 0);b.__decorate([x.property({type:Ba})],l.prototype,"center",null);b.__decorate([x.property({type:bb})],l.prototype,"clippingArea",null);b.__decorate([x.property({type:ba.Constraints})],l.prototype,"constraints",void 0);b.__decorate([x.property({type:bb,readOnly:!0})],l.prototype,"renderDataExtent",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"tileInfo",
null);b.__decorate([x.property({type:bb,readOnly:!0})],l.prototype,"dataExtent",null);b.__decorate([x.property({type:bb,readOnly:!0})],l.prototype,"_groundAndLayersExtent",null);b.__decorate([x.property({type:U})],l.prototype,"environment",void 0);b.__decorate([y.cast("environment")],l.prototype,"castEnvironment",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"environmentManager",void 0);b.__decorate([x.property({type:bb})],l.prototype,"extent",null);b.__decorate([x.property()],l.prototype,
"floors",void 0);b.__decorate([x.property()],l.prototype,"screenCenter",null);b.__decorate([x.property()],l.prototype,"frustum",null);b.__decorate([x.property({type:Number,readOnly:!0})],l.prototype,"fullOpacity",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"graphicsView",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"analysisViewManager",void 0);b.__decorate([x.property()],l.prototype,"groundView",void 0);b.__decorate([x.property({type:Boolean})],l.prototype,"initialExtentRequired",
null);b.__decorate([x.property()],l.prototype,"_defaultsFromMapSettings",null);b.__decorate([x.property()],l.prototype,"interacting",null);b.__decorate([x.property()],l.prototype,"stationary",null);b.__decorate([x.property()],l.prototype,"navigating",null);b.__decorate([x.property()],l.prototype,"map",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"mapCoordsHelper",void 0);b.__decorate([x.property()],l.prototype,"padding",null);b.__decorate([x.property({type:Na.PointsOfInterest,readOnly:!0})],
l.prototype,"pointsOfInterest",void 0);b.__decorate([x.property({type:ia.FeatureTileTree3D,readOnly:!0})],l.prototype,"featureTiles",void 0);b.__decorate([x.property()],l.prototype,"_featureTreeDebugger",void 0);b.__decorate([x.property({type:Boolean})],l.prototype,"screenSizePerspectiveEnabled",void 0);b.__decorate([x.property({constructOnly:!0})],l.prototype,"deactivatedWebGLExtensions",void 0);b.__decorate([x.property({constructOnly:!0})],l.prototype,"debugWebGLExtensions",void 0);b.__decorate([x.property({constructOnly:!0})],
l.prototype,"renderCanvas",void 0);b.__decorate([x.property({constructOnly:!0})],l.prototype,"state",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"inputManager",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"stateManager",void 0);b.__decorate([x.property({type:["low","medium","high"]})],l.prototype,"qualityProfile",null);b.__decorate([x.property({type:Ma,get(){let La=this._get("qualitySettings");La||(La=new Ma,na.apply(this.qualityProfile,La));return La}})],l.prototype,
"qualitySettings",void 0);b.__decorate([x.property()],l.prototype,"slicePlane",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"typeSpecificPreconditionsReady",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"renderCoordsHelper",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"sceneIntersectionHelper",void 0);b.__decorate([x.property({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],l.prototype,"resolution",null);b.__decorate([x.property({type:Number})],
l.prototype,"scale",null);b.__decorate([x.property()],l.prototype,"heightModelInfo",null);b.__decorate([x.property()],l.prototype,"spatialReference",void 0);b.__decorate([x.property({type:Boolean,constructOnly:!0})],l.prototype,"alphaCompositingEnabled",void 0);b.__decorate([x.property({constructOnly:!0})],l.prototype,"preserveDrawingBufferEnabled",void 0);b.__decorate([x.property({type:Boolean})],l.prototype,"supersampleScreenshotsEnabled",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,
"type",void 0);b.__decorate([x.property(),y.cast(La=>La instanceof Ta?La:B.ensureClass(Ra,La))],l.prototype,"ui",void 0);b.__decorate([x.property({type:Boolean,readOnly:!0,dependsOn:"graphicsView.updating basemapView.updating basemapTerrain.updating layerViewManager.updating layerViewManager.updatingRemaining _resourceController.updating _stage.updating featureTiles.updating pointsOfInterest.updating environmentManager.updating overlay.updating updatingHandles.updating featureTreeDebugger.updating labeler.updating deconflictor.updating ready stationary inputManager.updating toolViewManager.updating analysisViewManager.updating state.updating textures.updating".split(" ")})],
l.prototype,"updating",null);b.__decorate([x.property()],l.prototype,"_updatingObjects",null);b.__decorate([x.property()],l.prototype,"_updatingObjectsWithProgress",null);b.__decorate([x.property({type:Number,readOnly:!0,dependsOn:["updating"]})],l.prototype,"updatingProgress",void 0);b.__decorate([x.property({type:["global","local"]})],l.prototype,"viewingMode",null);b.__decorate([x.property({type:p})],l.prototype,"viewpoint",null);b.__decorate([x.property({type:Number})],l.prototype,"zoom",null);
b.__decorate([x.property({type:za})],l.prototype,"highlightOptions",void 0);b.__decorate([x.property({readOnly:!0})],l.prototype,"quality",null);b.__decorate([x.property({readOnly:!0})],l.prototype,"resolutionScale",null);b.__decorate([x.property()],l.prototype,"textures",void 0);l=b.__decorate([A.subclass("esri.views.SceneView")],l);const Wa=D.create(),gb=n.createScreenPointArray(),ib=I.create();return l});