ow-eengine-power 2.2.1 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  (function(ot,zt){typeof exports=="object"&&typeof module<"u"?zt(exports):typeof define=="function"&&define.amd?define(["exports"],zt):(ot=typeof globalThis<"u"?globalThis:ot||self,zt(ot.OW_EEngine_Power={}))})(this,function(ot){"use strict";var Yx=Object.defineProperty;var Xx=(ot,zt,l)=>zt in ot?Yx(ot,zt,{enumerable:!0,configurable:!0,writable:!0,value:l}):ot[zt]=l;var se=(ot,zt,l)=>Xx(ot,typeof zt!="symbol"?zt+"":zt,l);var zt=typeof document<"u"?document.currentScript:null;function l(e){return e!=null}function C(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(C.prototype=Object.create(Error.prototype),C.prototype.constructor=C),C.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
2
- ${this.stack.toString()}`),e},C.throwInstantiationError=function(){throw new C("This function defines an interface and should not be called directly.")};const _={};_.typeOf={};function U0(e){return`${e} is required, actual value was undefined`}function wo(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}_.defined=function(e,t){if(!l(t))throw new C(U0(e))},_.typeOf.func=function(e,t){if(typeof t!="function")throw new C(wo(typeof t,"function",e))},_.typeOf.string=function(e,t){if(typeof t!="string")throw new C(wo(typeof t,"string",e))},_.typeOf.number=function(e,t){if(typeof t!="number")throw new C(wo(typeof t,"number",e))},_.typeOf.number.lessThan=function(e,t,n){if(_.typeOf.number(e,t),t>=n)throw new C(`Expected ${e} to be less than ${n}, actual value was ${t}`)},_.typeOf.number.lessThanOrEquals=function(e,t,n){if(_.typeOf.number(e,t),t>n)throw new C(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)},_.typeOf.number.greaterThan=function(e,t,n){if(_.typeOf.number(e,t),t<=n)throw new C(`Expected ${e} to be greater than ${n}, actual value was ${t}`)},_.typeOf.number.greaterThanOrEquals=function(e,t,n){if(_.typeOf.number(e,t),t<n)throw new C(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)},_.typeOf.object=function(e,t){if(typeof t!="object")throw new C(wo(typeof t,"object",e))},_.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new C(wo(typeof t,"boolean",e))},_.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new C(wo(typeof t,"bigint",e))},_.typeOf.number.equals=function(e,t,n,i){if(_.typeOf.number(e,n),_.typeOf.number(t,i),n!==i)throw new C(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};function g(e,t){return e??t}g.EMPTY_OBJECT=Object.freeze({});var Ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var di=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};di.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}},di.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648},di.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},di.prototype.random_int31=function(){return this.random_int()>>>1},di.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},di.prototype.random=function(){return this.random_int()*(1/4294967296)},di.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},di.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};var k0=di;const wf=lr(k0),S={};S.EPSILON1=.1,S.EPSILON2=.01,S.EPSILON3=.001,S.EPSILON4=1e-4,S.EPSILON5=1e-5,S.EPSILON6=1e-6,S.EPSILON7=1e-7,S.EPSILON8=1e-8,S.EPSILON9=1e-9,S.EPSILON10=1e-10,S.EPSILON11=1e-11,S.EPSILON12=1e-12,S.EPSILON13=1e-13,S.EPSILON14=1e-14,S.EPSILON15=1e-15,S.EPSILON16=1e-16,S.EPSILON17=1e-17,S.EPSILON18=1e-18,S.EPSILON19=1e-19,S.EPSILON20=1e-20,S.EPSILON21=1e-21,S.GRAVITATIONALPARAMETER=3986004418e5,S.SOLAR_RADIUS=6955e5,S.LUNAR_RADIUS=1737400,S.SIXTY_FOUR_KILOBYTES=64*1024,S.FOUR_GIGABYTES=4*1024*1024*1024,S.sign=g(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1}),S.signNotZero=function(e){return e<0?-1:1},S.toSNorm=function(e,t){return t=g(t,255),Math.round((S.clamp(e,-1,1)*.5+.5)*t)},S.fromSNorm=function(e,t){return t=g(t,255),S.clamp(e,0,t)/t*2-1},S.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:S.clamp((e-t)/n,0,1)},S.sinh=g(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2}),S.cosh=g(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2}),S.lerp=function(e,t,n){return(1-n)*e+n*t},S.PI=Math.PI,S.ONE_OVER_PI=1/Math.PI,S.PI_OVER_TWO=Math.PI/2,S.PI_OVER_THREE=Math.PI/3,S.PI_OVER_FOUR=Math.PI/4,S.PI_OVER_SIX=Math.PI/6,S.THREE_PI_OVER_TWO=3*Math.PI/2,S.TWO_PI=2*Math.PI,S.ONE_OVER_TWO_PI=1/(2*Math.PI),S.RADIANS_PER_DEGREE=Math.PI/180,S.DEGREES_PER_RADIAN=180/Math.PI,S.RADIANS_PER_ARCSECOND=S.RADIANS_PER_DEGREE/3600,S.toRadians=function(e){if(!l(e))throw new C("degrees is required.");return e*S.RADIANS_PER_DEGREE},S.toDegrees=function(e){if(!l(e))throw new C("radians is required.");return e*S.DEGREES_PER_RADIAN},S.convertLongitudeRange=function(e){if(!l(e))throw new C("angle is required.");const t=S.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},S.clampToLatitudeRange=function(e){if(!l(e))throw new C("angle is required.");return S.clamp(e,-1*S.PI_OVER_TWO,S.PI_OVER_TWO)},S.negativePiToPi=function(e){if(!l(e))throw new C("angle is required.");return e>=-S.PI&&e<=S.PI?e:S.zeroToTwoPi(e+S.PI)-S.PI},S.zeroToTwoPi=function(e){if(!l(e))throw new C("angle is required.");if(e>=0&&e<=S.TWO_PI)return e;const t=S.mod(e,S.TWO_PI);return Math.abs(t)<S.EPSILON14&&Math.abs(e)>S.EPSILON14?S.TWO_PI:t},S.mod=function(e,t){if(!l(e))throw new C("m is required.");if(!l(t))throw new C("n is required.");if(t===0)throw new C("divisor cannot be 0.");return S.sign(e)===S.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t},S.equalsEpsilon=function(e,t,n,i){if(!l(e))throw new C("left is required.");if(!l(t))throw new C("right is required.");n=g(n,0),i=g(i,n);const o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))},S.lessThan=function(e,t,n){if(!l(e))throw new C("first is required.");if(!l(t))throw new C("second is required.");if(!l(n))throw new C("absoluteEpsilon is required.");return e-t<-n},S.lessThanOrEquals=function(e,t,n){if(!l(e))throw new C("first is required.");if(!l(t))throw new C("second is required.");if(!l(n))throw new C("absoluteEpsilon is required.");return e-t<n},S.greaterThan=function(e,t,n){if(!l(e))throw new C("first is required.");if(!l(t))throw new C("second is required.");if(!l(n))throw new C("absoluteEpsilon is required.");return e-t>n},S.greaterThanOrEquals=function(e,t,n){if(!l(e))throw new C("first is required.");if(!l(t))throw new C("second is required.");if(!l(n))throw new C("absoluteEpsilon is required.");return e-t>-n};const ur=[1];S.factorial=function(e){if(typeof e!="number"||e<0)throw new C("A number greater than or equal to 0 is required.");const t=ur.length;if(e>=t){let n=ur[t-1];for(let i=t;i<=e;i++){const o=n*i;ur.push(o),n=o}}return ur[e]},S.incrementWrap=function(e,t,n){if(n=g(n,0),!l(e))throw new C("n is required.");if(t<=n)throw new C("maximumValue must be greater than minimumValue.");return++e,e>t&&(e=n),e},S.isPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new C("A number between 0 and (2^32)-1 is required.");return e!==0&&(e&e-1)===0},S.nextPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>2147483648)throw new C("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},S.previousPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new C("A number between 0 and (2^32)-1 is required.");return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e},S.clamp=function(e,t,n){return _.typeOf.number("value",e),_.typeOf.number("min",t),_.typeOf.number("max",n),e<t?t:e>n?n:e};let Af=new wf;S.setRandomNumberSeed=function(e){if(!l(e))throw new C("seed is required.");Af=new wf(e)},S.nextRandomNumber=function(){return Af.random()},S.randomBetween=function(e,t){return S.nextRandomNumber()*(t-e)+e},S.acosClamped=function(e){if(!l(e))throw new C("value is required.");return Math.acos(S.clamp(e,-1,1))},S.asinClamped=function(e){if(!l(e))throw new C("value is required.");return Math.asin(S.clamp(e,-1,1))},S.chordLength=function(e,t){if(!l(e))throw new C("angle is required.");if(!l(t))throw new C("radius is required.");return 2*t*Math.sin(e*.5)},S.logBase=function(e,t){if(!l(e))throw new C("number is required.");if(!l(t))throw new C("base is required.");return Math.log(e)/Math.log(t)},S.cbrt=g(Math.cbrt,function(t){const n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n}),S.log2=g(Math.log2,function(t){return Math.log(t)*Math.LOG2E}),S.fog=function(e,t){const n=e*t;return 1-Math.exp(-(n*n))},S.fastApproximateAtan=function(e){return _.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)},S.fastApproximateAtan2=function(e,t){_.typeOf.number("x",e),_.typeOf.number("y",t);let n,i=Math.abs(e);n=Math.abs(t);const o=Math.max(i,n);n=Math.min(i,n);const a=n/o;if(isNaN(a))throw new C("either x or y must be nonzero");return i=S.fastApproximateAtan(a),i=Math.abs(t)>Math.abs(e)?S.PI_OVER_TWO-i:i,i=e<0?S.PI-i:i,i=t<0?-i:i,i};function u(e,t,n){this.x=g(e,0),this.y=g(t,0),this.z=g(n,0)}u.fromSpherical=function(e,t){_.typeOf.object("spherical",e),l(t)||(t=new u);const n=e.clock,i=e.cone,o=g(e.magnitude,1),a=o*Math.sin(i);return t.x=a*Math.cos(n),t.y=a*Math.sin(n),t.z=o*Math.cos(i),t},u.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new u(e,t,n)},u.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new u(e.x,e.y,e.z)},u.fromCartesian4=u.clone,u.packedLength=3,u.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t},u.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new u),n.x=e[t++],n.y=e[t++],n.z=e[t],n},u.packArray=function(e,t){_.defined("array",e);const n=e.length,i=n*3;if(!l(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)u.pack(e[o],t,o*3);return t},u.unpackArray=function(e,t){if(_.defined("array",e),_.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new C("array length must be a multiple of 3.");const n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){const o=i/3;t[o]=u.unpack(e,i,t[o])}return t},u.fromArray=u.unpack,u.maximumComponent=function(e){return _.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)},u.minimumComponent=function(e){return _.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)},u.minimumByComponent=function(e,t,n){return _.typeOf.object("first",e),_.typeOf.object("second",t),_.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},u.maximumByComponent=function(e,t,n){return _.typeOf.object("first",e),_.typeOf.object("second",t),_.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},u.clamp=function(e,t,n,i){_.typeOf.object("value",e),_.typeOf.object("min",t),_.typeOf.object("max",n),_.typeOf.object("result",i);const o=S.clamp(e.x,t.x,n.x),a=S.clamp(e.y,t.y,n.y),r=S.clamp(e.z,t.z,n.z);return i.x=o,i.y=a,i.z=r,i},u.magnitudeSquared=function(e){return _.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z},u.magnitude=function(e){return Math.sqrt(u.magnitudeSquared(e))};const dr=new u;u.distance=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),u.subtract(e,t,dr),u.magnitude(dr)},u.distanceSquared=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),u.subtract(e,t,dr),u.magnitudeSquared(dr)},u.normalize=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=u.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new C("normalized result is not a number");return t},u.dot=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z},u.multiplyComponents=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},u.divideComponents=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},u.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},u.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},u.multiplyByScalar=function(e,t,n){return _.typeOf.object("cartesian",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},u.divideByScalar=function(e,t,n){return _.typeOf.object("cartesian",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},u.negate=function(e,t){return _.typeOf.object("cartesian",e),_.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t},u.abs=function(e,t){return _.typeOf.object("cartesian",e),_.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};const Ef=new u;u.lerp=function(e,t,n,i){return _.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i),u.multiplyByScalar(t,n,Ef),i=u.multiplyByScalar(e,1-n,i),u.add(Ef,i,i)};const pr=new u,Ma=new u;u.angleBetween=function(e,t){_.typeOf.object("left",e),_.typeOf.object("right",t),u.normalize(e,pr),u.normalize(t,Ma);const n=u.dot(pr,Ma),i=u.magnitude(u.cross(pr,Ma,pr));return Math.atan2(i,n)};const V0=new u;u.mostOrthogonalAxis=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=u.normalize(e,V0);return u.abs(n,n),n.x<=n.y?n.x<=n.z?t=u.clone(u.UNIT_X,t):t=u.clone(u.UNIT_Z,t):n.y<=n.z?t=u.clone(u.UNIT_Y,t):t=u.clone(u.UNIT_Z,t),t},u.projectVector=function(e,t,n){_.defined("a",e),_.defined("b",t),_.defined("result",n);const i=u.dot(e,t)/u.dot(t,t);return u.multiplyByScalar(t,i,n)},u.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},u.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},u.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&S.equalsEpsilon(e.x,t.x,n,i)&&S.equalsEpsilon(e.y,t.y,n,i)&&S.equalsEpsilon(e.z,t.z,n,i)},u.cross=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n);const i=e.x,o=e.y,a=e.z,r=t.x,f=t.y,c=t.z,h=o*c-a*f,d=a*r-i*c,p=i*f-o*r;return n.x=h,n.y=d,n.z=p,n},u.midpoint=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n},u.fromDegrees=function(e,t,n,i,o){return _.typeOf.number("longitude",e),_.typeOf.number("latitude",t),e=S.toRadians(e),t=S.toRadians(t),u.fromRadians(e,t,n,i,o)};let En=new u,Eo=new u;u._ellipsoidRadiiSquared=new u(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9),u.fromRadians=function(e,t,n,i,o){_.typeOf.number("longitude",e),_.typeOf.number("latitude",t),n=g(n,0);const a=l(i)?i.radiiSquared:u._ellipsoidRadiiSquared,r=Math.cos(t);En.x=r*Math.cos(e),En.y=r*Math.sin(e),En.z=Math.sin(t),En=u.normalize(En,En),u.multiplyComponents(a,En,Eo);const f=Math.sqrt(u.dot(En,Eo));return Eo=u.divideByScalar(Eo,f,Eo),En=u.multiplyByScalar(En,n,En),l(o)||(o=new u),u.add(Eo,En,o)},u.fromDegreesArray=function(e,t,n){if(_.defined("coordinates",e),e.length<2||e.length%2!==0)throw new C("the number of coordinates must be a multiple of 2 and at least 2");const i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){const a=e[o],r=e[o+1],f=o/2;n[f]=u.fromDegrees(a,r,0,t,n[f])}return n},u.fromRadiansArray=function(e,t,n){if(_.defined("coordinates",e),e.length<2||e.length%2!==0)throw new C("the number of coordinates must be a multiple of 2 and at least 2");const i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){const a=e[o],r=e[o+1],f=o/2;n[f]=u.fromRadians(a,r,0,t,n[f])}return n},u.fromDegreesArrayHeights=function(e,t,n){if(_.defined("coordinates",e),e.length<3||e.length%3!==0)throw new C("the number of coordinates must be a multiple of 3 and at least 3");const i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){const a=e[o],r=e[o+1],f=e[o+2],c=o/3;n[c]=u.fromDegrees(a,r,f,t,n[c])}return n},u.fromRadiansArrayHeights=function(e,t,n){if(_.defined("coordinates",e),e.length<3||e.length%3!==0)throw new C("the number of coordinates must be a multiple of 3 and at least 3");const i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){const a=e[o],r=e[o+1],f=e[o+2],c=o/3;n[c]=u.fromRadians(a,r,f,t,n[c])}return n},u.ZERO=Object.freeze(new u(0,0,0)),u.ONE=Object.freeze(new u(1,1,1)),u.UNIT_X=Object.freeze(new u(1,0,0)),u.UNIT_Y=Object.freeze(new u(0,1,0)),u.UNIT_Z=Object.freeze(new u(0,0,1)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t,n){return u.equalsEpsilon(this,e,t,n)},u.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};function Z(e,t,n,i){this.x=g(e,0),this.y=g(t,0),this.z=g(n,0),this.w=g(i,0)}Z.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new Z(e,t,n,i)},Z.fromColor=function(e,t){return _.typeOf.object("color",e),l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Z(e.red,e.green,e.blue,e.alpha)},Z.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Z(e.x,e.y,e.z,e.w)},Z.packedLength=4,Z.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},Z.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new Z),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n},Z.packArray=function(e,t){_.defined("array",e);const n=e.length,i=n*4;if(!l(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Z.pack(e[o],t,o*4);return t},Z.unpackArray=function(e,t){if(_.defined("array",e),_.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new C("array length must be a multiple of 4.");const n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){const o=i/4;t[o]=Z.unpack(e,i,t[o])}return t},Z.fromArray=Z.unpack,Z.maximumComponent=function(e){return _.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)},Z.minimumComponent=function(e){return _.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)},Z.minimumByComponent=function(e,t,n){return _.typeOf.object("first",e),_.typeOf.object("second",t),_.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},Z.maximumByComponent=function(e,t,n){return _.typeOf.object("first",e),_.typeOf.object("second",t),_.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},Z.clamp=function(e,t,n,i){_.typeOf.object("value",e),_.typeOf.object("min",t),_.typeOf.object("max",n),_.typeOf.object("result",i);const o=S.clamp(e.x,t.x,n.x),a=S.clamp(e.y,t.y,n.y),r=S.clamp(e.z,t.z,n.z),f=S.clamp(e.w,t.w,n.w);return i.x=o,i.y=a,i.z=r,i.w=f,i},Z.magnitudeSquared=function(e){return _.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},Z.magnitude=function(e){return Math.sqrt(Z.magnitudeSquared(e))};const mr=new Z;Z.distance=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),Z.subtract(e,t,mr),Z.magnitude(mr)},Z.distanceSquared=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),Z.subtract(e,t,mr),Z.magnitudeSquared(mr)},Z.normalize=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=Z.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new C("normalized result is not a number");return t},Z.dot=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},Z.multiplyComponents=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},Z.divideComponents=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},Z.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},Z.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},Z.multiplyByScalar=function(e,t,n){return _.typeOf.object("cartesian",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},Z.divideByScalar=function(e,t,n){return _.typeOf.object("cartesian",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},Z.negate=function(e,t){return _.typeOf.object("cartesian",e),_.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},Z.abs=function(e,t){return _.typeOf.object("cartesian",e),_.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};const bf=new Z;Z.lerp=function(e,t,n,i){return _.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i),Z.multiplyByScalar(t,n,bf),i=Z.multiplyByScalar(e,1-n,i),Z.add(bf,i,i)};const G0=new Z;Z.mostOrthogonalAxis=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=Z.normalize(e,G0);return Z.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=Z.clone(Z.UNIT_X,t):t=Z.clone(Z.UNIT_W,t):n.z<=n.w?t=Z.clone(Z.UNIT_Z,t):t=Z.clone(Z.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=Z.clone(Z.UNIT_Y,t):t=Z.clone(Z.UNIT_W,t):n.z<=n.w?t=Z.clone(Z.UNIT_Z,t):t=Z.clone(Z.UNIT_W,t),t},Z.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Z.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},Z.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&S.equalsEpsilon(e.x,t.x,n,i)&&S.equalsEpsilon(e.y,t.y,n,i)&&S.equalsEpsilon(e.z,t.z,n,i)&&S.equalsEpsilon(e.w,t.w,n,i)},Z.ZERO=Object.freeze(new Z(0,0,0,0)),Z.ONE=Object.freeze(new Z(1,1,1,1)),Z.UNIT_X=Object.freeze(new Z(1,0,0,0)),Z.UNIT_Y=Object.freeze(new Z(0,1,0,0)),Z.UNIT_Z=Object.freeze(new Z(0,0,1,0)),Z.UNIT_W=Object.freeze(new Z(0,0,0,1)),Z.prototype.clone=function(e){return Z.clone(this,e)},Z.prototype.equals=function(e){return Z.equals(this,e)},Z.prototype.equalsEpsilon=function(e,t,n){return Z.equalsEpsilon(this,e,t,n)},Z.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const Ua=new Float32Array(1),jt=new Uint8Array(Ua.buffer),q0=new Uint32Array([287454020]),xf=new Uint8Array(q0.buffer)[0]===68;Z.packFloat=function(e,t){return _.typeOf.number("value",e),l(t)||(t=new Z),Ua[0]=e,xf?(t.x=jt[0],t.y=jt[1],t.z=jt[2],t.w=jt[3]):(t.x=jt[3],t.y=jt[2],t.z=jt[1],t.w=jt[0]),t},Z.unpackFloat=function(e){return _.typeOf.object("packedFloat",e),xf?(jt[0]=e.x,jt[1]=e.y,jt[2]=e.z,jt[3]=e.w):(jt[0]=e.w,jt[1]=e.z,jt[2]=e.y,jt[3]=e.x),Ua[0]};function G(e,t,n,i,o,a,r,f,c){this[0]=g(e,0),this[1]=g(i,0),this[2]=g(r,0),this[3]=g(t,0),this[4]=g(o,0),this[5]=g(f,0),this[6]=g(n,0),this[7]=g(a,0),this[8]=g(c,0)}G.packedLength=9,G.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},G.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new G),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n},G.packArray=function(e,t){_.defined("array",e);const n=e.length,i=n*9;if(!l(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 9 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)G.pack(e[o],t,o*9);return t},G.unpackArray=function(e,t){if(_.defined("array",e),_.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)throw new C("array length must be a multiple of 9.");const n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){const o=i/9;t[o]=G.unpack(e,i,t[o])}return t},G.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new G(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},G.fromArray=G.unpack,G.fromColumnMajorArray=function(e,t){return _.defined("values",e),G.clone(e,t)},G.fromRowMajorArray=function(e,t){return _.defined("values",e),l(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new G(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},G.fromQuaternion=function(e,t){_.typeOf.object("quaternion",e);const n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,a=e.x*e.w,r=e.y*e.y,f=e.y*e.z,c=e.y*e.w,h=e.z*e.z,d=e.z*e.w,p=e.w*e.w,m=n-r-h+p,T=2*(i-d),y=2*(o+c),w=2*(i+d),A=-n+r-h+p,E=2*(f-a),b=2*(o-c),I=2*(f+a),O=-n-r+h+p;return l(t)?(t[0]=m,t[1]=w,t[2]=b,t[3]=T,t[4]=A,t[5]=I,t[6]=y,t[7]=E,t[8]=O,t):new G(m,T,y,w,A,E,b,I,O)},G.fromHeadingPitchRoll=function(e,t){_.typeOf.object("headingPitchRoll",e);const n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),a=Math.sin(-e.pitch),r=Math.sin(-e.heading),f=Math.sin(e.roll),c=n*i,h=-o*r+f*a*i,d=f*r+o*a*i,p=n*r,m=o*i+f*a*r,T=-f*i+o*a*r,y=-a,w=f*n,A=o*n;return l(t)?(t[0]=c,t[1]=p,t[2]=y,t[3]=h,t[4]=m,t[5]=w,t[6]=d,t[7]=T,t[8]=A,t):new G(c,h,d,p,m,T,y,w,A)},G.fromScale=function(e,t){return _.typeOf.object("scale",e),l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new G(e.x,0,0,0,e.y,0,0,0,e.z)},G.fromUniformScale=function(e,t){return _.typeOf.number("scale",e),l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new G(e,0,0,0,e,0,0,0,e)},G.fromCrossProduct=function(e,t){return _.typeOf.object("vector",e),l(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new G(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},G.fromRotationX=function(e,t){_.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new G(1,0,0,0,n,-i,0,i,n)},G.fromRotationY=function(e,t){_.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new G(n,0,i,0,1,0,-i,0,n)},G.fromRotationZ=function(e,t){_.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new G(n,-i,0,i,n,0,0,0,1)},G.toArray=function(e,t){return _.typeOf.object("matrix",e),l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},G.getElementIndex=function(e,t){return _.typeOf.number.greaterThanOrEquals("row",t,0),_.typeOf.number.lessThanOrEquals("row",t,2),_.typeOf.number.greaterThanOrEquals("column",e,0),_.typeOf.number.lessThanOrEquals("column",e,2),e*3+t},G.getColumn=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,2),_.typeOf.object("result",n);const i=t*3,o=e[i],a=e[i+1],r=e[i+2];return n.x=o,n.y=a,n.z=r,n},G.setColumn=function(e,t,n,i){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,2),_.typeOf.object("cartesian",n),_.typeOf.object("result",i),i=G.clone(e,i);const o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i},G.getRow=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,2),_.typeOf.object("result",n);const i=e[t],o=e[t+3],a=e[t+6];return n.x=i,n.y=o,n.z=a,n},G.setRow=function(e,t,n,i){return _.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,2),_.typeOf.object("cartesian",n),_.typeOf.object("result",i),i=G.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};const H0=new u;G.setScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("scale",t),_.typeOf.object("result",n);const i=G.getScale(e,H0),o=t.x/i.x,a=t.y/i.y,r=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*a,n[4]=e[4]*a,n[5]=e[5]*a,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*r,n};const j0=new u;G.setUniformScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number("scale",t),_.typeOf.object("result",n);const i=G.getScale(e,j0),o=t/i.x,a=t/i.y,r=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*a,n[4]=e[4]*a,n[5]=e[5]*a,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*r,n};const ka=new u;G.getScale=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t.x=u.magnitude(u.fromElements(e[0],e[1],e[2],ka)),t.y=u.magnitude(u.fromElements(e[3],e[4],e[5],ka)),t.z=u.magnitude(u.fromElements(e[6],e[7],e[8],ka)),t};const Sf=new u;G.getMaximumScale=function(e){return G.getScale(e,Sf),u.maximumComponent(Sf)};const Y0=new u;G.setRotation=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("result",n);const i=G.getScale(e,Y0);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};const X0=new u;G.getRotation=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=G.getScale(e,X0);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t},G.multiply=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n);const i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],r=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],f=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],h=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],d=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],p=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=a,n[3]=r,n[4]=f,n[5]=c,n[6]=h,n[7]=d,n[8]=p,n},G.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},G.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},G.multiplyByVector=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("cartesian",t),_.typeOf.object("result",n);const i=t.x,o=t.y,a=t.z,r=e[0]*i+e[3]*o+e[6]*a,f=e[1]*i+e[4]*o+e[7]*a,c=e[2]*i+e[5]*o+e[8]*a;return n.x=r,n.y=f,n.z=c,n},G.multiplyByScalar=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},G.multiplyByScale=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.object("scale",t),_.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},G.multiplyByUniformScale=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.number("scale",t),_.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},G.negate=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},G.transpose=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=e[0],i=e[3],o=e[6],a=e[1],r=e[4],f=e[7],c=e[2],h=e[5],d=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=r,t[5]=f,t[6]=c,t[7]=h,t[8]=d,t};function $0(e){let t=0;for(let n=0;n<9;++n){const i=e[n];t+=i*i}return Math.sqrt(t)}const Va=[1,0,0],Ga=[2,2,1];function Z0(e){let t=0;for(let n=0;n<3;++n){const i=e[G.getElementIndex(Ga[n],Va[n])];t+=2*i*i}return Math.sqrt(t)}function K0(e,t){const n=S.EPSILON15;let i=0,o=1;for(let h=0;h<3;++h){const d=Math.abs(e[G.getElementIndex(Ga[h],Va[h])]);d>i&&(o=h,i=d)}let a=1,r=0;const f=Va[o],c=Ga[o];if(Math.abs(e[G.getElementIndex(c,f)])>n){const h=e[G.getElementIndex(c,c)],d=e[G.getElementIndex(f,f)],p=e[G.getElementIndex(c,f)],m=(h-d)/2/p;let T;m<0?T=-1/(-m+Math.sqrt(1+m*m)):T=1/(m+Math.sqrt(1+m*m)),a=1/Math.sqrt(1+T*T),r=T*a}return t=G.clone(G.IDENTITY,t),t[G.getElementIndex(f,f)]=t[G.getElementIndex(c,c)]=a,t[G.getElementIndex(c,f)]=r,t[G.getElementIndex(f,c)]=-r,t}const _r=new G,If=new G;G.computeEigenDecomposition=function(e,t){_.typeOf.object("matrix",e);const n=S.EPSILON20,i=10;let o=0,a=0;l(t)||(t={});const r=t.unitary=G.clone(G.IDENTITY,t.unitary),f=t.diagonal=G.clone(e,t.diagonal),c=n*$0(f);for(;a<i&&Z0(f)>c;)K0(f,_r),G.transpose(_r,If),G.multiply(f,_r,f),G.multiply(If,f,f),G.multiply(r,_r,r),++o>2&&(++a,o=0);return t},G.abs=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},G.determinant=function(e){_.typeOf.object("matrix",e);const t=e[0],n=e[3],i=e[6],o=e[1],a=e[4],r=e[7],f=e[2],c=e[5],h=e[8];return t*(a*h-c*r)+o*(c*i-n*h)+f*(n*r-a*i)},G.inverse=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=e[0],i=e[1],o=e[2],a=e[3],r=e[4],f=e[5],c=e[6],h=e[7],d=e[8],p=G.determinant(e);if(Math.abs(p)<=S.EPSILON15)throw new C("matrix is not invertible");t[0]=r*d-h*f,t[1]=h*o-i*d,t[2]=i*f-r*o,t[3]=c*f-a*d,t[4]=n*d-c*o,t[5]=a*o-n*f,t[6]=a*h-c*r,t[7]=c*i-n*h,t[8]=n*r-a*i;const m=1/p;return G.multiplyByScalar(t,m,t)};const Q0=new G;G.inverseTranspose=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),G.inverse(G.transpose(e,Q0),t)},G.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},G.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},G.IDENTITY=Object.freeze(new G(1,0,0,0,1,0,0,0,1)),G.ZERO=Object.freeze(new G(0,0,0,0,0,0,0,0,0)),G.COLUMN0ROW0=0,G.COLUMN0ROW1=1,G.COLUMN0ROW2=2,G.COLUMN1ROW0=3,G.COLUMN1ROW1=4,G.COLUMN1ROW2=5,G.COLUMN2ROW0=6,G.COLUMN2ROW1=7,G.COLUMN2ROW2=8,Object.defineProperties(G.prototype,{length:{get:function(){return G.packedLength}}}),G.prototype.clone=function(e){return G.clone(this,e)},G.prototype.equals=function(e){return G.equals(this,e)},G.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},G.prototype.equalsEpsilon=function(e,t){return G.equalsEpsilon(this,e,t)},G.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
2
+ ${this.stack.toString()}`),e},C.throwInstantiationError=function(){throw new C("This function defines an interface and should not be called directly.")};const _={};_.typeOf={};function U0(e){return`${e} is required, actual value was undefined`}function Co(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}_.defined=function(e,t){if(!l(t))throw new C(U0(e))},_.typeOf.func=function(e,t){if(typeof t!="function")throw new C(Co(typeof t,"function",e))},_.typeOf.string=function(e,t){if(typeof t!="string")throw new C(Co(typeof t,"string",e))},_.typeOf.number=function(e,t){if(typeof t!="number")throw new C(Co(typeof t,"number",e))},_.typeOf.number.lessThan=function(e,t,n){if(_.typeOf.number(e,t),t>=n)throw new C(`Expected ${e} to be less than ${n}, actual value was ${t}`)},_.typeOf.number.lessThanOrEquals=function(e,t,n){if(_.typeOf.number(e,t),t>n)throw new C(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)},_.typeOf.number.greaterThan=function(e,t,n){if(_.typeOf.number(e,t),t<=n)throw new C(`Expected ${e} to be greater than ${n}, actual value was ${t}`)},_.typeOf.number.greaterThanOrEquals=function(e,t,n){if(_.typeOf.number(e,t),t<n)throw new C(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)},_.typeOf.object=function(e,t){if(typeof t!="object")throw new C(Co(typeof t,"object",e))},_.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new C(Co(typeof t,"boolean",e))},_.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new C(Co(typeof t,"bigint",e))},_.typeOf.number.equals=function(e,t,n,i){if(_.typeOf.number(e,n),_.typeOf.number(t,i),n!==i)throw new C(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};function g(e,t){return e??t}g.EMPTY_OBJECT=Object.freeze({});var wo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var di=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};di.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}},di.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648},di.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},di.prototype.random_int31=function(){return this.random_int()>>>1},di.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},di.prototype.random=function(){return this.random_int()*(1/4294967296)},di.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},di.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};var k0=di;const wf=lr(k0),S={};S.EPSILON1=.1,S.EPSILON2=.01,S.EPSILON3=.001,S.EPSILON4=1e-4,S.EPSILON5=1e-5,S.EPSILON6=1e-6,S.EPSILON7=1e-7,S.EPSILON8=1e-8,S.EPSILON9=1e-9,S.EPSILON10=1e-10,S.EPSILON11=1e-11,S.EPSILON12=1e-12,S.EPSILON13=1e-13,S.EPSILON14=1e-14,S.EPSILON15=1e-15,S.EPSILON16=1e-16,S.EPSILON17=1e-17,S.EPSILON18=1e-18,S.EPSILON19=1e-19,S.EPSILON20=1e-20,S.EPSILON21=1e-21,S.GRAVITATIONALPARAMETER=3986004418e5,S.SOLAR_RADIUS=6955e5,S.LUNAR_RADIUS=1737400,S.SIXTY_FOUR_KILOBYTES=64*1024,S.FOUR_GIGABYTES=4*1024*1024*1024,S.sign=g(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1}),S.signNotZero=function(e){return e<0?-1:1},S.toSNorm=function(e,t){return t=g(t,255),Math.round((S.clamp(e,-1,1)*.5+.5)*t)},S.fromSNorm=function(e,t){return t=g(t,255),S.clamp(e,0,t)/t*2-1},S.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:S.clamp((e-t)/n,0,1)},S.sinh=g(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2}),S.cosh=g(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2}),S.lerp=function(e,t,n){return(1-n)*e+n*t},S.PI=Math.PI,S.ONE_OVER_PI=1/Math.PI,S.PI_OVER_TWO=Math.PI/2,S.PI_OVER_THREE=Math.PI/3,S.PI_OVER_FOUR=Math.PI/4,S.PI_OVER_SIX=Math.PI/6,S.THREE_PI_OVER_TWO=3*Math.PI/2,S.TWO_PI=2*Math.PI,S.ONE_OVER_TWO_PI=1/(2*Math.PI),S.RADIANS_PER_DEGREE=Math.PI/180,S.DEGREES_PER_RADIAN=180/Math.PI,S.RADIANS_PER_ARCSECOND=S.RADIANS_PER_DEGREE/3600,S.toRadians=function(e){if(!l(e))throw new C("degrees is required.");return e*S.RADIANS_PER_DEGREE},S.toDegrees=function(e){if(!l(e))throw new C("radians is required.");return e*S.DEGREES_PER_RADIAN},S.convertLongitudeRange=function(e){if(!l(e))throw new C("angle is required.");const t=S.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},S.clampToLatitudeRange=function(e){if(!l(e))throw new C("angle is required.");return S.clamp(e,-1*S.PI_OVER_TWO,S.PI_OVER_TWO)},S.negativePiToPi=function(e){if(!l(e))throw new C("angle is required.");return e>=-S.PI&&e<=S.PI?e:S.zeroToTwoPi(e+S.PI)-S.PI},S.zeroToTwoPi=function(e){if(!l(e))throw new C("angle is required.");if(e>=0&&e<=S.TWO_PI)return e;const t=S.mod(e,S.TWO_PI);return Math.abs(t)<S.EPSILON14&&Math.abs(e)>S.EPSILON14?S.TWO_PI:t},S.mod=function(e,t){if(!l(e))throw new C("m is required.");if(!l(t))throw new C("n is required.");if(t===0)throw new C("divisor cannot be 0.");return S.sign(e)===S.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t},S.equalsEpsilon=function(e,t,n,i){if(!l(e))throw new C("left is required.");if(!l(t))throw new C("right is required.");n=g(n,0),i=g(i,n);const o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))},S.lessThan=function(e,t,n){if(!l(e))throw new C("first is required.");if(!l(t))throw new C("second is required.");if(!l(n))throw new C("absoluteEpsilon is required.");return e-t<-n},S.lessThanOrEquals=function(e,t,n){if(!l(e))throw new C("first is required.");if(!l(t))throw new C("second is required.");if(!l(n))throw new C("absoluteEpsilon is required.");return e-t<n},S.greaterThan=function(e,t,n){if(!l(e))throw new C("first is required.");if(!l(t))throw new C("second is required.");if(!l(n))throw new C("absoluteEpsilon is required.");return e-t>n},S.greaterThanOrEquals=function(e,t,n){if(!l(e))throw new C("first is required.");if(!l(t))throw new C("second is required.");if(!l(n))throw new C("absoluteEpsilon is required.");return e-t>-n};const ur=[1];S.factorial=function(e){if(typeof e!="number"||e<0)throw new C("A number greater than or equal to 0 is required.");const t=ur.length;if(e>=t){let n=ur[t-1];for(let i=t;i<=e;i++){const o=n*i;ur.push(o),n=o}}return ur[e]},S.incrementWrap=function(e,t,n){if(n=g(n,0),!l(e))throw new C("n is required.");if(t<=n)throw new C("maximumValue must be greater than minimumValue.");return++e,e>t&&(e=n),e},S.isPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new C("A number between 0 and (2^32)-1 is required.");return e!==0&&(e&e-1)===0},S.nextPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>2147483648)throw new C("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},S.previousPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new C("A number between 0 and (2^32)-1 is required.");return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e},S.clamp=function(e,t,n){return _.typeOf.number("value",e),_.typeOf.number("min",t),_.typeOf.number("max",n),e<t?t:e>n?n:e};let Af=new wf;S.setRandomNumberSeed=function(e){if(!l(e))throw new C("seed is required.");Af=new wf(e)},S.nextRandomNumber=function(){return Af.random()},S.randomBetween=function(e,t){return S.nextRandomNumber()*(t-e)+e},S.acosClamped=function(e){if(!l(e))throw new C("value is required.");return Math.acos(S.clamp(e,-1,1))},S.asinClamped=function(e){if(!l(e))throw new C("value is required.");return Math.asin(S.clamp(e,-1,1))},S.chordLength=function(e,t){if(!l(e))throw new C("angle is required.");if(!l(t))throw new C("radius is required.");return 2*t*Math.sin(e*.5)},S.logBase=function(e,t){if(!l(e))throw new C("number is required.");if(!l(t))throw new C("base is required.");return Math.log(e)/Math.log(t)},S.cbrt=g(Math.cbrt,function(t){const n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n}),S.log2=g(Math.log2,function(t){return Math.log(t)*Math.LOG2E}),S.fog=function(e,t){const n=e*t;return 1-Math.exp(-(n*n))},S.fastApproximateAtan=function(e){return _.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)},S.fastApproximateAtan2=function(e,t){_.typeOf.number("x",e),_.typeOf.number("y",t);let n,i=Math.abs(e);n=Math.abs(t);const o=Math.max(i,n);n=Math.min(i,n);const a=n/o;if(isNaN(a))throw new C("either x or y must be nonzero");return i=S.fastApproximateAtan(a),i=Math.abs(t)>Math.abs(e)?S.PI_OVER_TWO-i:i,i=e<0?S.PI-i:i,i=t<0?-i:i,i};function u(e,t,n){this.x=g(e,0),this.y=g(t,0),this.z=g(n,0)}u.fromSpherical=function(e,t){_.typeOf.object("spherical",e),l(t)||(t=new u);const n=e.clock,i=e.cone,o=g(e.magnitude,1),a=o*Math.sin(i);return t.x=a*Math.cos(n),t.y=a*Math.sin(n),t.z=o*Math.cos(i),t},u.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new u(e,t,n)},u.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new u(e.x,e.y,e.z)},u.fromCartesian4=u.clone,u.packedLength=3,u.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t},u.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new u),n.x=e[t++],n.y=e[t++],n.z=e[t],n},u.packArray=function(e,t){_.defined("array",e);const n=e.length,i=n*3;if(!l(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)u.pack(e[o],t,o*3);return t},u.unpackArray=function(e,t){if(_.defined("array",e),_.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new C("array length must be a multiple of 3.");const n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){const o=i/3;t[o]=u.unpack(e,i,t[o])}return t},u.fromArray=u.unpack,u.maximumComponent=function(e){return _.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)},u.minimumComponent=function(e){return _.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)},u.minimumByComponent=function(e,t,n){return _.typeOf.object("first",e),_.typeOf.object("second",t),_.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},u.maximumByComponent=function(e,t,n){return _.typeOf.object("first",e),_.typeOf.object("second",t),_.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},u.clamp=function(e,t,n,i){_.typeOf.object("value",e),_.typeOf.object("min",t),_.typeOf.object("max",n),_.typeOf.object("result",i);const o=S.clamp(e.x,t.x,n.x),a=S.clamp(e.y,t.y,n.y),r=S.clamp(e.z,t.z,n.z);return i.x=o,i.y=a,i.z=r,i},u.magnitudeSquared=function(e){return _.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z},u.magnitude=function(e){return Math.sqrt(u.magnitudeSquared(e))};const dr=new u;u.distance=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),u.subtract(e,t,dr),u.magnitude(dr)},u.distanceSquared=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),u.subtract(e,t,dr),u.magnitudeSquared(dr)},u.normalize=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=u.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new C("normalized result is not a number");return t},u.dot=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z},u.multiplyComponents=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},u.divideComponents=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},u.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},u.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},u.multiplyByScalar=function(e,t,n){return _.typeOf.object("cartesian",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},u.divideByScalar=function(e,t,n){return _.typeOf.object("cartesian",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},u.negate=function(e,t){return _.typeOf.object("cartesian",e),_.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t},u.abs=function(e,t){return _.typeOf.object("cartesian",e),_.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};const Ef=new u;u.lerp=function(e,t,n,i){return _.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i),u.multiplyByScalar(t,n,Ef),i=u.multiplyByScalar(e,1-n,i),u.add(Ef,i,i)};const pr=new u,Ma=new u;u.angleBetween=function(e,t){_.typeOf.object("left",e),_.typeOf.object("right",t),u.normalize(e,pr),u.normalize(t,Ma);const n=u.dot(pr,Ma),i=u.magnitude(u.cross(pr,Ma,pr));return Math.atan2(i,n)};const V0=new u;u.mostOrthogonalAxis=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=u.normalize(e,V0);return u.abs(n,n),n.x<=n.y?n.x<=n.z?t=u.clone(u.UNIT_X,t):t=u.clone(u.UNIT_Z,t):n.y<=n.z?t=u.clone(u.UNIT_Y,t):t=u.clone(u.UNIT_Z,t),t},u.projectVector=function(e,t,n){_.defined("a",e),_.defined("b",t),_.defined("result",n);const i=u.dot(e,t)/u.dot(t,t);return u.multiplyByScalar(t,i,n)},u.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},u.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},u.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&S.equalsEpsilon(e.x,t.x,n,i)&&S.equalsEpsilon(e.y,t.y,n,i)&&S.equalsEpsilon(e.z,t.z,n,i)},u.cross=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n);const i=e.x,o=e.y,a=e.z,r=t.x,f=t.y,c=t.z,h=o*c-a*f,d=a*r-i*c,p=i*f-o*r;return n.x=h,n.y=d,n.z=p,n},u.midpoint=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n},u.fromDegrees=function(e,t,n,i,o){return _.typeOf.number("longitude",e),_.typeOf.number("latitude",t),e=S.toRadians(e),t=S.toRadians(t),u.fromRadians(e,t,n,i,o)};let En=new u,Ao=new u;u._ellipsoidRadiiSquared=new u(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9),u.fromRadians=function(e,t,n,i,o){_.typeOf.number("longitude",e),_.typeOf.number("latitude",t),n=g(n,0);const a=l(i)?i.radiiSquared:u._ellipsoidRadiiSquared,r=Math.cos(t);En.x=r*Math.cos(e),En.y=r*Math.sin(e),En.z=Math.sin(t),En=u.normalize(En,En),u.multiplyComponents(a,En,Ao);const f=Math.sqrt(u.dot(En,Ao));return Ao=u.divideByScalar(Ao,f,Ao),En=u.multiplyByScalar(En,n,En),l(o)||(o=new u),u.add(Ao,En,o)},u.fromDegreesArray=function(e,t,n){if(_.defined("coordinates",e),e.length<2||e.length%2!==0)throw new C("the number of coordinates must be a multiple of 2 and at least 2");const i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){const a=e[o],r=e[o+1],f=o/2;n[f]=u.fromDegrees(a,r,0,t,n[f])}return n},u.fromRadiansArray=function(e,t,n){if(_.defined("coordinates",e),e.length<2||e.length%2!==0)throw new C("the number of coordinates must be a multiple of 2 and at least 2");const i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){const a=e[o],r=e[o+1],f=o/2;n[f]=u.fromRadians(a,r,0,t,n[f])}return n},u.fromDegreesArrayHeights=function(e,t,n){if(_.defined("coordinates",e),e.length<3||e.length%3!==0)throw new C("the number of coordinates must be a multiple of 3 and at least 3");const i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){const a=e[o],r=e[o+1],f=e[o+2],c=o/3;n[c]=u.fromDegrees(a,r,f,t,n[c])}return n},u.fromRadiansArrayHeights=function(e,t,n){if(_.defined("coordinates",e),e.length<3||e.length%3!==0)throw new C("the number of coordinates must be a multiple of 3 and at least 3");const i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){const a=e[o],r=e[o+1],f=e[o+2],c=o/3;n[c]=u.fromRadians(a,r,f,t,n[c])}return n},u.ZERO=Object.freeze(new u(0,0,0)),u.ONE=Object.freeze(new u(1,1,1)),u.UNIT_X=Object.freeze(new u(1,0,0)),u.UNIT_Y=Object.freeze(new u(0,1,0)),u.UNIT_Z=Object.freeze(new u(0,0,1)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t,n){return u.equalsEpsilon(this,e,t,n)},u.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};function Z(e,t,n,i){this.x=g(e,0),this.y=g(t,0),this.z=g(n,0),this.w=g(i,0)}Z.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new Z(e,t,n,i)},Z.fromColor=function(e,t){return _.typeOf.object("color",e),l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Z(e.red,e.green,e.blue,e.alpha)},Z.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Z(e.x,e.y,e.z,e.w)},Z.packedLength=4,Z.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},Z.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new Z),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n},Z.packArray=function(e,t){_.defined("array",e);const n=e.length,i=n*4;if(!l(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Z.pack(e[o],t,o*4);return t},Z.unpackArray=function(e,t){if(_.defined("array",e),_.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new C("array length must be a multiple of 4.");const n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){const o=i/4;t[o]=Z.unpack(e,i,t[o])}return t},Z.fromArray=Z.unpack,Z.maximumComponent=function(e){return _.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)},Z.minimumComponent=function(e){return _.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)},Z.minimumByComponent=function(e,t,n){return _.typeOf.object("first",e),_.typeOf.object("second",t),_.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},Z.maximumByComponent=function(e,t,n){return _.typeOf.object("first",e),_.typeOf.object("second",t),_.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},Z.clamp=function(e,t,n,i){_.typeOf.object("value",e),_.typeOf.object("min",t),_.typeOf.object("max",n),_.typeOf.object("result",i);const o=S.clamp(e.x,t.x,n.x),a=S.clamp(e.y,t.y,n.y),r=S.clamp(e.z,t.z,n.z),f=S.clamp(e.w,t.w,n.w);return i.x=o,i.y=a,i.z=r,i.w=f,i},Z.magnitudeSquared=function(e){return _.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},Z.magnitude=function(e){return Math.sqrt(Z.magnitudeSquared(e))};const mr=new Z;Z.distance=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),Z.subtract(e,t,mr),Z.magnitude(mr)},Z.distanceSquared=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),Z.subtract(e,t,mr),Z.magnitudeSquared(mr)},Z.normalize=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=Z.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new C("normalized result is not a number");return t},Z.dot=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},Z.multiplyComponents=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},Z.divideComponents=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},Z.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},Z.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},Z.multiplyByScalar=function(e,t,n){return _.typeOf.object("cartesian",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},Z.divideByScalar=function(e,t,n){return _.typeOf.object("cartesian",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},Z.negate=function(e,t){return _.typeOf.object("cartesian",e),_.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},Z.abs=function(e,t){return _.typeOf.object("cartesian",e),_.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};const bf=new Z;Z.lerp=function(e,t,n,i){return _.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i),Z.multiplyByScalar(t,n,bf),i=Z.multiplyByScalar(e,1-n,i),Z.add(bf,i,i)};const G0=new Z;Z.mostOrthogonalAxis=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=Z.normalize(e,G0);return Z.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=Z.clone(Z.UNIT_X,t):t=Z.clone(Z.UNIT_W,t):n.z<=n.w?t=Z.clone(Z.UNIT_Z,t):t=Z.clone(Z.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=Z.clone(Z.UNIT_Y,t):t=Z.clone(Z.UNIT_W,t):n.z<=n.w?t=Z.clone(Z.UNIT_Z,t):t=Z.clone(Z.UNIT_W,t),t},Z.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Z.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},Z.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&S.equalsEpsilon(e.x,t.x,n,i)&&S.equalsEpsilon(e.y,t.y,n,i)&&S.equalsEpsilon(e.z,t.z,n,i)&&S.equalsEpsilon(e.w,t.w,n,i)},Z.ZERO=Object.freeze(new Z(0,0,0,0)),Z.ONE=Object.freeze(new Z(1,1,1,1)),Z.UNIT_X=Object.freeze(new Z(1,0,0,0)),Z.UNIT_Y=Object.freeze(new Z(0,1,0,0)),Z.UNIT_Z=Object.freeze(new Z(0,0,1,0)),Z.UNIT_W=Object.freeze(new Z(0,0,0,1)),Z.prototype.clone=function(e){return Z.clone(this,e)},Z.prototype.equals=function(e){return Z.equals(this,e)},Z.prototype.equalsEpsilon=function(e,t,n){return Z.equalsEpsilon(this,e,t,n)},Z.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const Ua=new Float32Array(1),jt=new Uint8Array(Ua.buffer),q0=new Uint32Array([287454020]),xf=new Uint8Array(q0.buffer)[0]===68;Z.packFloat=function(e,t){return _.typeOf.number("value",e),l(t)||(t=new Z),Ua[0]=e,xf?(t.x=jt[0],t.y=jt[1],t.z=jt[2],t.w=jt[3]):(t.x=jt[3],t.y=jt[2],t.z=jt[1],t.w=jt[0]),t},Z.unpackFloat=function(e){return _.typeOf.object("packedFloat",e),xf?(jt[0]=e.x,jt[1]=e.y,jt[2]=e.z,jt[3]=e.w):(jt[0]=e.w,jt[1]=e.z,jt[2]=e.y,jt[3]=e.x),Ua[0]};function G(e,t,n,i,o,a,r,f,c){this[0]=g(e,0),this[1]=g(i,0),this[2]=g(r,0),this[3]=g(t,0),this[4]=g(o,0),this[5]=g(f,0),this[6]=g(n,0),this[7]=g(a,0),this[8]=g(c,0)}G.packedLength=9,G.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},G.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new G),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n},G.packArray=function(e,t){_.defined("array",e);const n=e.length,i=n*9;if(!l(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 9 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)G.pack(e[o],t,o*9);return t},G.unpackArray=function(e,t){if(_.defined("array",e),_.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)throw new C("array length must be a multiple of 9.");const n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){const o=i/9;t[o]=G.unpack(e,i,t[o])}return t},G.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new G(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},G.fromArray=G.unpack,G.fromColumnMajorArray=function(e,t){return _.defined("values",e),G.clone(e,t)},G.fromRowMajorArray=function(e,t){return _.defined("values",e),l(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new G(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},G.fromQuaternion=function(e,t){_.typeOf.object("quaternion",e);const n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,a=e.x*e.w,r=e.y*e.y,f=e.y*e.z,c=e.y*e.w,h=e.z*e.z,d=e.z*e.w,p=e.w*e.w,m=n-r-h+p,T=2*(i-d),y=2*(o+c),w=2*(i+d),A=-n+r-h+p,E=2*(f-a),b=2*(o-c),D=2*(f+a),O=-n-r+h+p;return l(t)?(t[0]=m,t[1]=w,t[2]=b,t[3]=T,t[4]=A,t[5]=D,t[6]=y,t[7]=E,t[8]=O,t):new G(m,T,y,w,A,E,b,D,O)},G.fromHeadingPitchRoll=function(e,t){_.typeOf.object("headingPitchRoll",e);const n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),a=Math.sin(-e.pitch),r=Math.sin(-e.heading),f=Math.sin(e.roll),c=n*i,h=-o*r+f*a*i,d=f*r+o*a*i,p=n*r,m=o*i+f*a*r,T=-f*i+o*a*r,y=-a,w=f*n,A=o*n;return l(t)?(t[0]=c,t[1]=p,t[2]=y,t[3]=h,t[4]=m,t[5]=w,t[6]=d,t[7]=T,t[8]=A,t):new G(c,h,d,p,m,T,y,w,A)},G.fromScale=function(e,t){return _.typeOf.object("scale",e),l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new G(e.x,0,0,0,e.y,0,0,0,e.z)},G.fromUniformScale=function(e,t){return _.typeOf.number("scale",e),l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new G(e,0,0,0,e,0,0,0,e)},G.fromCrossProduct=function(e,t){return _.typeOf.object("vector",e),l(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new G(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},G.fromRotationX=function(e,t){_.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new G(1,0,0,0,n,-i,0,i,n)},G.fromRotationY=function(e,t){_.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new G(n,0,i,0,1,0,-i,0,n)},G.fromRotationZ=function(e,t){_.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new G(n,-i,0,i,n,0,0,0,1)},G.toArray=function(e,t){return _.typeOf.object("matrix",e),l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},G.getElementIndex=function(e,t){return _.typeOf.number.greaterThanOrEquals("row",t,0),_.typeOf.number.lessThanOrEquals("row",t,2),_.typeOf.number.greaterThanOrEquals("column",e,0),_.typeOf.number.lessThanOrEquals("column",e,2),e*3+t},G.getColumn=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,2),_.typeOf.object("result",n);const i=t*3,o=e[i],a=e[i+1],r=e[i+2];return n.x=o,n.y=a,n.z=r,n},G.setColumn=function(e,t,n,i){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,2),_.typeOf.object("cartesian",n),_.typeOf.object("result",i),i=G.clone(e,i);const o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i},G.getRow=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,2),_.typeOf.object("result",n);const i=e[t],o=e[t+3],a=e[t+6];return n.x=i,n.y=o,n.z=a,n},G.setRow=function(e,t,n,i){return _.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,2),_.typeOf.object("cartesian",n),_.typeOf.object("result",i),i=G.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};const H0=new u;G.setScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("scale",t),_.typeOf.object("result",n);const i=G.getScale(e,H0),o=t.x/i.x,a=t.y/i.y,r=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*a,n[4]=e[4]*a,n[5]=e[5]*a,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*r,n};const j0=new u;G.setUniformScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number("scale",t),_.typeOf.object("result",n);const i=G.getScale(e,j0),o=t/i.x,a=t/i.y,r=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*a,n[4]=e[4]*a,n[5]=e[5]*a,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*r,n};const ka=new u;G.getScale=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t.x=u.magnitude(u.fromElements(e[0],e[1],e[2],ka)),t.y=u.magnitude(u.fromElements(e[3],e[4],e[5],ka)),t.z=u.magnitude(u.fromElements(e[6],e[7],e[8],ka)),t};const Sf=new u;G.getMaximumScale=function(e){return G.getScale(e,Sf),u.maximumComponent(Sf)};const Y0=new u;G.setRotation=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("result",n);const i=G.getScale(e,Y0);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};const X0=new u;G.getRotation=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=G.getScale(e,X0);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t},G.multiply=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n);const i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],r=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],f=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],h=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],d=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],p=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=a,n[3]=r,n[4]=f,n[5]=c,n[6]=h,n[7]=d,n[8]=p,n},G.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},G.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},G.multiplyByVector=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("cartesian",t),_.typeOf.object("result",n);const i=t.x,o=t.y,a=t.z,r=e[0]*i+e[3]*o+e[6]*a,f=e[1]*i+e[4]*o+e[7]*a,c=e[2]*i+e[5]*o+e[8]*a;return n.x=r,n.y=f,n.z=c,n},G.multiplyByScalar=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},G.multiplyByScale=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.object("scale",t),_.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},G.multiplyByUniformScale=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.number("scale",t),_.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},G.negate=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},G.transpose=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=e[0],i=e[3],o=e[6],a=e[1],r=e[4],f=e[7],c=e[2],h=e[5],d=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=r,t[5]=f,t[6]=c,t[7]=h,t[8]=d,t};function $0(e){let t=0;for(let n=0;n<9;++n){const i=e[n];t+=i*i}return Math.sqrt(t)}const Va=[1,0,0],Ga=[2,2,1];function Z0(e){let t=0;for(let n=0;n<3;++n){const i=e[G.getElementIndex(Ga[n],Va[n])];t+=2*i*i}return Math.sqrt(t)}function K0(e,t){const n=S.EPSILON15;let i=0,o=1;for(let h=0;h<3;++h){const d=Math.abs(e[G.getElementIndex(Ga[h],Va[h])]);d>i&&(o=h,i=d)}let a=1,r=0;const f=Va[o],c=Ga[o];if(Math.abs(e[G.getElementIndex(c,f)])>n){const h=e[G.getElementIndex(c,c)],d=e[G.getElementIndex(f,f)],p=e[G.getElementIndex(c,f)],m=(h-d)/2/p;let T;m<0?T=-1/(-m+Math.sqrt(1+m*m)):T=1/(m+Math.sqrt(1+m*m)),a=1/Math.sqrt(1+T*T),r=T*a}return t=G.clone(G.IDENTITY,t),t[G.getElementIndex(f,f)]=t[G.getElementIndex(c,c)]=a,t[G.getElementIndex(c,f)]=r,t[G.getElementIndex(f,c)]=-r,t}const _r=new G,If=new G;G.computeEigenDecomposition=function(e,t){_.typeOf.object("matrix",e);const n=S.EPSILON20,i=10;let o=0,a=0;l(t)||(t={});const r=t.unitary=G.clone(G.IDENTITY,t.unitary),f=t.diagonal=G.clone(e,t.diagonal),c=n*$0(f);for(;a<i&&Z0(f)>c;)K0(f,_r),G.transpose(_r,If),G.multiply(f,_r,f),G.multiply(If,f,f),G.multiply(r,_r,r),++o>2&&(++a,o=0);return t},G.abs=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},G.determinant=function(e){_.typeOf.object("matrix",e);const t=e[0],n=e[3],i=e[6],o=e[1],a=e[4],r=e[7],f=e[2],c=e[5],h=e[8];return t*(a*h-c*r)+o*(c*i-n*h)+f*(n*r-a*i)},G.inverse=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=e[0],i=e[1],o=e[2],a=e[3],r=e[4],f=e[5],c=e[6],h=e[7],d=e[8],p=G.determinant(e);if(Math.abs(p)<=S.EPSILON15)throw new C("matrix is not invertible");t[0]=r*d-h*f,t[1]=h*o-i*d,t[2]=i*f-r*o,t[3]=c*f-a*d,t[4]=n*d-c*o,t[5]=a*o-n*f,t[6]=a*h-c*r,t[7]=c*i-n*h,t[8]=n*r-a*i;const m=1/p;return G.multiplyByScalar(t,m,t)};const Q0=new G;G.inverseTranspose=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),G.inverse(G.transpose(e,Q0),t)},G.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},G.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},G.IDENTITY=Object.freeze(new G(1,0,0,0,1,0,0,0,1)),G.ZERO=Object.freeze(new G(0,0,0,0,0,0,0,0,0)),G.COLUMN0ROW0=0,G.COLUMN0ROW1=1,G.COLUMN0ROW2=2,G.COLUMN1ROW0=3,G.COLUMN1ROW1=4,G.COLUMN1ROW2=5,G.COLUMN2ROW0=6,G.COLUMN2ROW1=7,G.COLUMN2ROW2=8,Object.defineProperties(G.prototype,{length:{get:function(){return G.packedLength}}}),G.prototype.clone=function(e){return G.clone(this,e)},G.prototype.equals=function(e){return G.equals(this,e)},G.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},G.prototype.equalsEpsilon=function(e,t){return G.equalsEpsilon(this,e,t)},G.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
3
3
  (${this[1]}, ${this[4]}, ${this[7]})
4
4
  (${this[2]}, ${this[5]}, ${this[8]})`};function dt(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(dt.prototype=Object.create(Error.prototype),dt.prototype.constructor=dt),dt.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
5
- ${this.stack.toString()}`),e};function k(e,t,n,i,o,a,r,f,c,h,d,p,m,T,y,w){this[0]=g(e,0),this[1]=g(o,0),this[2]=g(c,0),this[3]=g(m,0),this[4]=g(t,0),this[5]=g(a,0),this[6]=g(h,0),this[7]=g(T,0),this[8]=g(n,0),this[9]=g(r,0),this[10]=g(d,0),this[11]=g(y,0),this[12]=g(i,0),this[13]=g(f,0),this[14]=g(p,0),this[15]=g(w,0)}k.packedLength=16,k.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},k.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new k),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},k.packArray=function(e,t){_.defined("array",e);const n=e.length,i=n*16;if(!l(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)k.pack(e[o],t,o*16);return t},k.unpackArray=function(e,t){if(_.defined("array",e),_.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new C("array length must be a multiple of 16.");const n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){const o=i/16;t[o]=k.unpack(e,i,t[o])}return t},k.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new k(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},k.fromArray=k.unpack,k.fromColumnMajorArray=function(e,t){return _.defined("values",e),k.clone(e,t)},k.fromRowMajorArray=function(e,t){return _.defined("values",e),l(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new k(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},k.fromRotationTranslation=function(e,t,n){return _.typeOf.object("rotation",e),t=g(t,u.ZERO),l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new k(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},k.fromTranslationQuaternionRotationScale=function(e,t,n,i){_.typeOf.object("translation",e),_.typeOf.object("rotation",t),_.typeOf.object("scale",n),l(i)||(i=new k);const o=n.x,a=n.y,r=n.z,f=t.x*t.x,c=t.x*t.y,h=t.x*t.z,d=t.x*t.w,p=t.y*t.y,m=t.y*t.z,T=t.y*t.w,y=t.z*t.z,w=t.z*t.w,A=t.w*t.w,E=f-p-y+A,b=2*(c-w),I=2*(h+T),O=2*(c+w),B=-f+p-y+A,L=2*(m-d),F=2*(h-T),N=2*(m+d),U=-f-p+y+A;return i[0]=E*o,i[1]=O*o,i[2]=F*o,i[3]=0,i[4]=b*a,i[5]=B*a,i[6]=N*a,i[7]=0,i[8]=I*r,i[9]=L*r,i[10]=U*r,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},k.fromTranslationRotationScale=function(e,t){return _.typeOf.object("translationRotationScale",e),k.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},k.fromTranslation=function(e,t){return _.typeOf.object("translation",e),k.fromRotationTranslation(G.IDENTITY,e,t)},k.fromScale=function(e,t){return _.typeOf.object("scale",e),l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new k(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},k.fromUniformScale=function(e,t){return _.typeOf.number("scale",e),l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new k(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)},k.fromRotation=function(e,t){return _.typeOf.object("rotation",e),l(t)||(t=new k),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};const bo=new u,xo=new u,ts=new u;k.fromCamera=function(e,t){_.typeOf.object("camera",e);const n=e.position,i=e.direction,o=e.up;_.typeOf.object("camera.position",n),_.typeOf.object("camera.direction",i),_.typeOf.object("camera.up",o),u.normalize(i,bo),u.normalize(u.cross(bo,o,xo),xo),u.normalize(u.cross(xo,bo,ts),ts);const a=xo.x,r=xo.y,f=xo.z,c=bo.x,h=bo.y,d=bo.z,p=ts.x,m=ts.y,T=ts.z,y=n.x,w=n.y,A=n.z,E=a*-y+r*-w+f*-A,b=p*-y+m*-w+T*-A,I=c*y+h*w+d*A;return l(t)?(t[0]=a,t[1]=p,t[2]=-c,t[3]=0,t[4]=r,t[5]=m,t[6]=-h,t[7]=0,t[8]=f,t[9]=T,t[10]=-d,t[11]=0,t[12]=E,t[13]=b,t[14]=I,t[15]=1,t):new k(a,r,f,E,p,m,T,b,-c,-h,-d,I,0,0,0,1)},k.computePerspectiveFieldOfView=function(e,t,n,i,o){_.typeOf.number.greaterThan("fovY",e,0),_.typeOf.number.lessThan("fovY",e,Math.PI),_.typeOf.number.greaterThan("near",n,0),_.typeOf.number.greaterThan("far",i,0),_.typeOf.object("result",o);const r=1/Math.tan(e*.5),f=r/t,c=(i+n)/(n-i),h=2*i*n/(n-i);return o[0]=f,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=r,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},k.computeOrthographicOffCenter=function(e,t,n,i,o,a,r){_.typeOf.number("left",e),_.typeOf.number("right",t),_.typeOf.number("bottom",n),_.typeOf.number("top",i),_.typeOf.number("near",o),_.typeOf.number("far",a),_.typeOf.object("result",r);let f=1/(t-e),c=1/(i-n),h=1/(a-o);const d=-(t+e)*f,p=-(i+n)*c,m=-(a+o)*h;return f*=2,c*=2,h*=-2,r[0]=f,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=c,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=h,r[11]=0,r[12]=d,r[13]=p,r[14]=m,r[15]=1,r},k.computePerspectiveOffCenter=function(e,t,n,i,o,a,r){_.typeOf.number("left",e),_.typeOf.number("right",t),_.typeOf.number("bottom",n),_.typeOf.number("top",i),_.typeOf.number("near",o),_.typeOf.number("far",a),_.typeOf.object("result",r);const f=2*o/(t-e),c=2*o/(i-n),h=(t+e)/(t-e),d=(i+n)/(i-n),p=-(a+o)/(a-o),m=-1,T=-2*a*o/(a-o);return r[0]=f,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=c,r[6]=0,r[7]=0,r[8]=h,r[9]=d,r[10]=p,r[11]=m,r[12]=0,r[13]=0,r[14]=T,r[15]=0,r},k.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,a){_.typeOf.number("left",e),_.typeOf.number("right",t),_.typeOf.number("bottom",n),_.typeOf.number("top",i),_.typeOf.number("near",o),_.typeOf.object("result",a);const r=2*o/(t-e),f=2*o/(i-n),c=(t+e)/(t-e),h=(i+n)/(i-n),d=-1,p=-1,m=-2*o;return a[0]=r,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=f,a[6]=0,a[7]=0,a[8]=c,a[9]=h,a[10]=d,a[11]=p,a[12]=0,a[13]=0,a[14]=m,a[15]=0,a},k.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new k),e=g(e,g.EMPTY_OBJECT);const o=g(e.x,0),a=g(e.y,0),r=g(e.width,0),f=g(e.height,0);t=g(t,0),n=g(n,1);const c=r*.5,h=f*.5,d=(n-t)*.5,p=c,m=h,T=d,y=o+c,w=a+h,A=t+d,E=1;return i[0]=p,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=m,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=T,i[11]=0,i[12]=y,i[13]=w,i[14]=A,i[15]=E,i},k.computeView=function(e,t,n,i,o){return _.typeOf.object("position",e),_.typeOf.object("direction",t),_.typeOf.object("up",n),_.typeOf.object("right",i),_.typeOf.object("result",o),o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-u.dot(i,e),o[13]=-u.dot(n,e),o[14]=u.dot(t,e),o[15]=1,o},k.toArray=function(e,t){return _.typeOf.object("matrix",e),l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},k.getElementIndex=function(e,t){return _.typeOf.number.greaterThanOrEquals("row",t,0),_.typeOf.number.lessThanOrEquals("row",t,3),_.typeOf.number.greaterThanOrEquals("column",e,0),_.typeOf.number.lessThanOrEquals("column",e,3),e*4+t},k.getColumn=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,3),_.typeOf.object("result",n);const i=t*4,o=e[i],a=e[i+1],r=e[i+2],f=e[i+3];return n.x=o,n.y=a,n.z=r,n.w=f,n},k.setColumn=function(e,t,n,i){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,3),_.typeOf.object("cartesian",n),_.typeOf.object("result",i),i=k.clone(e,i);const o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i},k.getRow=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,3),_.typeOf.object("result",n);const i=e[t],o=e[t+4],a=e[t+8],r=e[t+12];return n.x=i,n.y=o,n.z=a,n.w=r,n},k.setRow=function(e,t,n,i){return _.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,3),_.typeOf.object("cartesian",n),_.typeOf.object("result",i),i=k.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i},k.setTranslation=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.object("translation",t),_.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};const J0=new u;k.setScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("scale",t),_.typeOf.object("result",n);const i=k.getScale(e,J0),o=t.x/i.x,a=t.y/i.y,r=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*a,n[5]=e[5]*a,n[6]=e[6]*a,n[7]=e[7],n[8]=e[8]*r,n[9]=e[9]*r,n[10]=e[10]*r,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const e_=new u;k.setUniformScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number("scale",t),_.typeOf.object("result",n);const i=k.getScale(e,e_),o=t/i.x,a=t/i.y,r=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*a,n[5]=e[5]*a,n[6]=e[6]*a,n[7]=e[7],n[8]=e[8]*r,n[9]=e[9]*r,n[10]=e[10]*r,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const qa=new u;k.getScale=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t.x=u.magnitude(u.fromElements(e[0],e[1],e[2],qa)),t.y=u.magnitude(u.fromElements(e[4],e[5],e[6],qa)),t.z=u.magnitude(u.fromElements(e[8],e[9],e[10],qa)),t};const Df=new u;k.getMaximumScale=function(e){return k.getScale(e,Df),u.maximumComponent(Df)};const t_=new u;k.setRotation=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("result",n);const i=k.getScale(e,t_);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const n_=new u;k.getRotation=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=k.getScale(e,n_);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t},k.multiply=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n);const i=e[0],o=e[1],a=e[2],r=e[3],f=e[4],c=e[5],h=e[6],d=e[7],p=e[8],m=e[9],T=e[10],y=e[11],w=e[12],A=e[13],E=e[14],b=e[15],I=t[0],O=t[1],B=t[2],L=t[3],F=t[4],N=t[5],U=t[6],M=t[7],j=t[8],Y=t[9],s=t[10],x=t[11],P=t[12],z=t[13],H=t[14],X=t[15],ee=i*I+f*O+p*B+w*L,K=o*I+c*O+m*B+A*L,ce=a*I+h*O+T*B+E*L,le=r*I+d*O+y*B+b*L,we=i*F+f*N+p*U+w*M,Se=o*F+c*N+m*U+A*M,Ee=a*F+h*N+T*U+E*M,Le=r*F+d*N+y*U+b*M,Ke=i*j+f*Y+p*s+w*x,ct=o*j+c*Y+m*s+A*x,gt=a*j+h*Y+T*s+E*x,Fe=r*j+d*Y+y*s+b*x,At=i*P+f*z+p*H+w*X,Wt=o*P+c*z+m*H+A*X,Et=a*P+h*z+T*H+E*X,pn=r*P+d*z+y*H+b*X;return n[0]=ee,n[1]=K,n[2]=ce,n[3]=le,n[4]=we,n[5]=Se,n[6]=Ee,n[7]=Le,n[8]=Ke,n[9]=ct,n[10]=gt,n[11]=Fe,n[12]=At,n[13]=Wt,n[14]=Et,n[15]=pn,n},k.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},k.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},k.multiplyTransformation=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n);const i=e[0],o=e[1],a=e[2],r=e[4],f=e[5],c=e[6],h=e[8],d=e[9],p=e[10],m=e[12],T=e[13],y=e[14],w=t[0],A=t[1],E=t[2],b=t[4],I=t[5],O=t[6],B=t[8],L=t[9],F=t[10],N=t[12],U=t[13],M=t[14],j=i*w+r*A+h*E,Y=o*w+f*A+d*E,s=a*w+c*A+p*E,x=i*b+r*I+h*O,P=o*b+f*I+d*O,z=a*b+c*I+p*O,H=i*B+r*L+h*F,X=o*B+f*L+d*F,ee=a*B+c*L+p*F,K=i*N+r*U+h*M+m,ce=o*N+f*U+d*M+T,le=a*N+c*U+p*M+y;return n[0]=j,n[1]=Y,n[2]=s,n[3]=0,n[4]=x,n[5]=P,n[6]=z,n[7]=0,n[8]=H,n[9]=X,n[10]=ee,n[11]=0,n[12]=K,n[13]=ce,n[14]=le,n[15]=1,n},k.multiplyByMatrix3=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("rotation",t),_.typeOf.object("result",n);const i=e[0],o=e[1],a=e[2],r=e[4],f=e[5],c=e[6],h=e[8],d=e[9],p=e[10],m=t[0],T=t[1],y=t[2],w=t[3],A=t[4],E=t[5],b=t[6],I=t[7],O=t[8],B=i*m+r*T+h*y,L=o*m+f*T+d*y,F=a*m+c*T+p*y,N=i*w+r*A+h*E,U=o*w+f*A+d*E,M=a*w+c*A+p*E,j=i*b+r*I+h*O,Y=o*b+f*I+d*O,s=a*b+c*I+p*O;return n[0]=B,n[1]=L,n[2]=F,n[3]=0,n[4]=N,n[5]=U,n[6]=M,n[7]=0,n[8]=j,n[9]=Y,n[10]=s,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},k.multiplyByTranslation=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("translation",t),_.typeOf.object("result",n);const i=t.x,o=t.y,a=t.z,r=i*e[0]+o*e[4]+a*e[8]+e[12],f=i*e[1]+o*e[5]+a*e[9]+e[13],c=i*e[2]+o*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=r,n[13]=f,n[14]=c,n[15]=e[15],n},k.multiplyByScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("scale",t),_.typeOf.object("result",n);const i=t.x,o=t.y,a=t.z;return i===1&&o===1&&a===1?k.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)},k.multiplyByUniformScale=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.number("scale",t),_.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},k.multiplyByVector=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("cartesian",t),_.typeOf.object("result",n);const i=t.x,o=t.y,a=t.z,r=t.w,f=e[0]*i+e[4]*o+e[8]*a+e[12]*r,c=e[1]*i+e[5]*o+e[9]*a+e[13]*r,h=e[2]*i+e[6]*o+e[10]*a+e[14]*r,d=e[3]*i+e[7]*o+e[11]*a+e[15]*r;return n.x=f,n.y=c,n.z=h,n.w=d,n},k.multiplyByPointAsVector=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("cartesian",t),_.typeOf.object("result",n);const i=t.x,o=t.y,a=t.z,r=e[0]*i+e[4]*o+e[8]*a,f=e[1]*i+e[5]*o+e[9]*a,c=e[2]*i+e[6]*o+e[10]*a;return n.x=r,n.y=f,n.z=c,n},k.multiplyByPoint=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("cartesian",t),_.typeOf.object("result",n);const i=t.x,o=t.y,a=t.z,r=e[0]*i+e[4]*o+e[8]*a+e[12],f=e[1]*i+e[5]*o+e[9]*a+e[13],c=e[2]*i+e[6]*o+e[10]*a+e[14];return n.x=r,n.y=f,n.z=c,n},k.multiplyByScalar=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},k.negate=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},k.transpose=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=e[1],i=e[2],o=e[3],a=e[6],r=e[7],f=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=r,t[14]=f,t[15]=e[15],t},k.abs=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},k.equals=function(e,t){return e===t||l(e)&&l(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},k.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},k.getTranslation=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t},k.getMatrix3=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};const i_=new G,o_=new G,s_=new Z,r_=new Z(0,0,0,1);k.inverse=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=e[0],i=e[4],o=e[8],a=e[12],r=e[1],f=e[5],c=e[9],h=e[13],d=e[2],p=e[6],m=e[10],T=e[14],y=e[3],w=e[7],A=e[11],E=e[15];let b=m*E,I=T*A,O=p*E,B=T*w,L=p*A,F=m*w,N=d*E,U=T*y,M=d*A,j=m*y,Y=d*w,s=p*y;const x=b*f+B*c+L*h-(I*f+O*c+F*h),P=I*r+N*c+j*h-(b*r+U*c+M*h),z=O*r+U*f+Y*h-(B*r+N*f+s*h),H=F*r+M*f+s*c-(L*r+j*f+Y*c),X=I*i+O*o+F*a-(b*i+B*o+L*a),ee=b*n+U*o+M*a-(I*n+N*o+j*a),K=B*n+N*i+s*a-(O*n+U*i+Y*a),ce=L*n+j*i+Y*o-(F*n+M*i+s*o);b=o*h,I=a*c,O=i*h,B=a*f,L=i*c,F=o*f,N=n*h,U=a*r,M=n*c,j=o*r,Y=n*f,s=i*r;const le=b*w+B*A+L*E-(I*w+O*A+F*E),we=I*y+N*A+j*E-(b*y+U*A+M*E),Se=O*y+U*w+Y*E-(B*y+N*w+s*E),Ee=F*y+M*w+s*A-(L*y+j*w+Y*A),Le=O*m+F*T+I*p-(L*T+b*p+B*m),Ke=M*T+b*d+U*m-(N*m+j*T+I*d),ct=N*p+s*T+B*d-(Y*T+O*d+U*p),gt=Y*m+L*d+j*p-(M*p+s*m+F*d);let Fe=n*x+i*P+o*z+a*H;if(Math.abs(Fe)<S.EPSILON21){if(G.equalsEpsilon(k.getMatrix3(e,i_),o_,S.EPSILON7)&&Z.equals(k.getRow(e,3,s_),r_))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new dt("matrix is not invertible because its determinate is zero.")}return Fe=1/Fe,t[0]=x*Fe,t[1]=P*Fe,t[2]=z*Fe,t[3]=H*Fe,t[4]=X*Fe,t[5]=ee*Fe,t[6]=K*Fe,t[7]=ce*Fe,t[8]=le*Fe,t[9]=we*Fe,t[10]=Se*Fe,t[11]=Ee*Fe,t[12]=Le*Fe,t[13]=Ke*Fe,t[14]=ct*Fe,t[15]=gt*Fe,t},k.inverseTransformation=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=e[0],i=e[1],o=e[2],a=e[4],r=e[5],f=e[6],c=e[8],h=e[9],d=e[10],p=e[12],m=e[13],T=e[14],y=-n*p-i*m-o*T,w=-a*p-r*m-f*T,A=-c*p-h*m-d*T;return t[0]=n,t[1]=a,t[2]=c,t[3]=0,t[4]=i,t[5]=r,t[6]=h,t[7]=0,t[8]=o,t[9]=f,t[10]=d,t[11]=0,t[12]=y,t[13]=w,t[14]=A,t[15]=1,t};const a_=new k;k.inverseTranspose=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),k.inverse(k.transpose(e,a_),t)},k.IDENTITY=Object.freeze(new k(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),k.ZERO=Object.freeze(new k(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),k.COLUMN0ROW0=0,k.COLUMN0ROW1=1,k.COLUMN0ROW2=2,k.COLUMN0ROW3=3,k.COLUMN1ROW0=4,k.COLUMN1ROW1=5,k.COLUMN1ROW2=6,k.COLUMN1ROW3=7,k.COLUMN2ROW0=8,k.COLUMN2ROW1=9,k.COLUMN2ROW2=10,k.COLUMN2ROW3=11,k.COLUMN3ROW0=12,k.COLUMN3ROW1=13,k.COLUMN3ROW2=14,k.COLUMN3ROW3=15,Object.defineProperties(k.prototype,{length:{get:function(){return k.packedLength}}}),k.prototype.clone=function(e){return k.clone(this,e)},k.prototype.equals=function(e){return k.equals(this,e)},k.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},k.prototype.equalsEpsilon=function(e,t){return k.equalsEpsilon(this,e,t)},k.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
5
+ ${this.stack.toString()}`),e};function k(e,t,n,i,o,a,r,f,c,h,d,p,m,T,y,w){this[0]=g(e,0),this[1]=g(o,0),this[2]=g(c,0),this[3]=g(m,0),this[4]=g(t,0),this[5]=g(a,0),this[6]=g(h,0),this[7]=g(T,0),this[8]=g(n,0),this[9]=g(r,0),this[10]=g(d,0),this[11]=g(y,0),this[12]=g(i,0),this[13]=g(f,0),this[14]=g(p,0),this[15]=g(w,0)}k.packedLength=16,k.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},k.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new k),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},k.packArray=function(e,t){_.defined("array",e);const n=e.length,i=n*16;if(!l(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)k.pack(e[o],t,o*16);return t},k.unpackArray=function(e,t){if(_.defined("array",e),_.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new C("array length must be a multiple of 16.");const n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){const o=i/16;t[o]=k.unpack(e,i,t[o])}return t},k.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new k(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},k.fromArray=k.unpack,k.fromColumnMajorArray=function(e,t){return _.defined("values",e),k.clone(e,t)},k.fromRowMajorArray=function(e,t){return _.defined("values",e),l(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new k(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},k.fromRotationTranslation=function(e,t,n){return _.typeOf.object("rotation",e),t=g(t,u.ZERO),l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new k(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},k.fromTranslationQuaternionRotationScale=function(e,t,n,i){_.typeOf.object("translation",e),_.typeOf.object("rotation",t),_.typeOf.object("scale",n),l(i)||(i=new k);const o=n.x,a=n.y,r=n.z,f=t.x*t.x,c=t.x*t.y,h=t.x*t.z,d=t.x*t.w,p=t.y*t.y,m=t.y*t.z,T=t.y*t.w,y=t.z*t.z,w=t.z*t.w,A=t.w*t.w,E=f-p-y+A,b=2*(c-w),D=2*(h+T),O=2*(c+w),B=-f+p-y+A,L=2*(m-d),F=2*(h-T),N=2*(m+d),U=-f-p+y+A;return i[0]=E*o,i[1]=O*o,i[2]=F*o,i[3]=0,i[4]=b*a,i[5]=B*a,i[6]=N*a,i[7]=0,i[8]=D*r,i[9]=L*r,i[10]=U*r,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},k.fromTranslationRotationScale=function(e,t){return _.typeOf.object("translationRotationScale",e),k.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},k.fromTranslation=function(e,t){return _.typeOf.object("translation",e),k.fromRotationTranslation(G.IDENTITY,e,t)},k.fromScale=function(e,t){return _.typeOf.object("scale",e),l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new k(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},k.fromUniformScale=function(e,t){return _.typeOf.number("scale",e),l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new k(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)},k.fromRotation=function(e,t){return _.typeOf.object("rotation",e),l(t)||(t=new k),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};const Eo=new u,bo=new u,ts=new u;k.fromCamera=function(e,t){_.typeOf.object("camera",e);const n=e.position,i=e.direction,o=e.up;_.typeOf.object("camera.position",n),_.typeOf.object("camera.direction",i),_.typeOf.object("camera.up",o),u.normalize(i,Eo),u.normalize(u.cross(Eo,o,bo),bo),u.normalize(u.cross(bo,Eo,ts),ts);const a=bo.x,r=bo.y,f=bo.z,c=Eo.x,h=Eo.y,d=Eo.z,p=ts.x,m=ts.y,T=ts.z,y=n.x,w=n.y,A=n.z,E=a*-y+r*-w+f*-A,b=p*-y+m*-w+T*-A,D=c*y+h*w+d*A;return l(t)?(t[0]=a,t[1]=p,t[2]=-c,t[3]=0,t[4]=r,t[5]=m,t[6]=-h,t[7]=0,t[8]=f,t[9]=T,t[10]=-d,t[11]=0,t[12]=E,t[13]=b,t[14]=D,t[15]=1,t):new k(a,r,f,E,p,m,T,b,-c,-h,-d,D,0,0,0,1)},k.computePerspectiveFieldOfView=function(e,t,n,i,o){_.typeOf.number.greaterThan("fovY",e,0),_.typeOf.number.lessThan("fovY",e,Math.PI),_.typeOf.number.greaterThan("near",n,0),_.typeOf.number.greaterThan("far",i,0),_.typeOf.object("result",o);const r=1/Math.tan(e*.5),f=r/t,c=(i+n)/(n-i),h=2*i*n/(n-i);return o[0]=f,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=r,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},k.computeOrthographicOffCenter=function(e,t,n,i,o,a,r){_.typeOf.number("left",e),_.typeOf.number("right",t),_.typeOf.number("bottom",n),_.typeOf.number("top",i),_.typeOf.number("near",o),_.typeOf.number("far",a),_.typeOf.object("result",r);let f=1/(t-e),c=1/(i-n),h=1/(a-o);const d=-(t+e)*f,p=-(i+n)*c,m=-(a+o)*h;return f*=2,c*=2,h*=-2,r[0]=f,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=c,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=h,r[11]=0,r[12]=d,r[13]=p,r[14]=m,r[15]=1,r},k.computePerspectiveOffCenter=function(e,t,n,i,o,a,r){_.typeOf.number("left",e),_.typeOf.number("right",t),_.typeOf.number("bottom",n),_.typeOf.number("top",i),_.typeOf.number("near",o),_.typeOf.number("far",a),_.typeOf.object("result",r);const f=2*o/(t-e),c=2*o/(i-n),h=(t+e)/(t-e),d=(i+n)/(i-n),p=-(a+o)/(a-o),m=-1,T=-2*a*o/(a-o);return r[0]=f,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=c,r[6]=0,r[7]=0,r[8]=h,r[9]=d,r[10]=p,r[11]=m,r[12]=0,r[13]=0,r[14]=T,r[15]=0,r},k.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,a){_.typeOf.number("left",e),_.typeOf.number("right",t),_.typeOf.number("bottom",n),_.typeOf.number("top",i),_.typeOf.number("near",o),_.typeOf.object("result",a);const r=2*o/(t-e),f=2*o/(i-n),c=(t+e)/(t-e),h=(i+n)/(i-n),d=-1,p=-1,m=-2*o;return a[0]=r,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=f,a[6]=0,a[7]=0,a[8]=c,a[9]=h,a[10]=d,a[11]=p,a[12]=0,a[13]=0,a[14]=m,a[15]=0,a},k.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new k),e=g(e,g.EMPTY_OBJECT);const o=g(e.x,0),a=g(e.y,0),r=g(e.width,0),f=g(e.height,0);t=g(t,0),n=g(n,1);const c=r*.5,h=f*.5,d=(n-t)*.5,p=c,m=h,T=d,y=o+c,w=a+h,A=t+d,E=1;return i[0]=p,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=m,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=T,i[11]=0,i[12]=y,i[13]=w,i[14]=A,i[15]=E,i},k.computeView=function(e,t,n,i,o){return _.typeOf.object("position",e),_.typeOf.object("direction",t),_.typeOf.object("up",n),_.typeOf.object("right",i),_.typeOf.object("result",o),o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-u.dot(i,e),o[13]=-u.dot(n,e),o[14]=u.dot(t,e),o[15]=1,o},k.toArray=function(e,t){return _.typeOf.object("matrix",e),l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},k.getElementIndex=function(e,t){return _.typeOf.number.greaterThanOrEquals("row",t,0),_.typeOf.number.lessThanOrEquals("row",t,3),_.typeOf.number.greaterThanOrEquals("column",e,0),_.typeOf.number.lessThanOrEquals("column",e,3),e*4+t},k.getColumn=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,3),_.typeOf.object("result",n);const i=t*4,o=e[i],a=e[i+1],r=e[i+2],f=e[i+3];return n.x=o,n.y=a,n.z=r,n.w=f,n},k.setColumn=function(e,t,n,i){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,3),_.typeOf.object("cartesian",n),_.typeOf.object("result",i),i=k.clone(e,i);const o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i},k.getRow=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,3),_.typeOf.object("result",n);const i=e[t],o=e[t+4],a=e[t+8],r=e[t+12];return n.x=i,n.y=o,n.z=a,n.w=r,n},k.setRow=function(e,t,n,i){return _.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,3),_.typeOf.object("cartesian",n),_.typeOf.object("result",i),i=k.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i},k.setTranslation=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.object("translation",t),_.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};const J0=new u;k.setScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("scale",t),_.typeOf.object("result",n);const i=k.getScale(e,J0),o=t.x/i.x,a=t.y/i.y,r=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*a,n[5]=e[5]*a,n[6]=e[6]*a,n[7]=e[7],n[8]=e[8]*r,n[9]=e[9]*r,n[10]=e[10]*r,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const e_=new u;k.setUniformScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number("scale",t),_.typeOf.object("result",n);const i=k.getScale(e,e_),o=t/i.x,a=t/i.y,r=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*a,n[5]=e[5]*a,n[6]=e[6]*a,n[7]=e[7],n[8]=e[8]*r,n[9]=e[9]*r,n[10]=e[10]*r,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const qa=new u;k.getScale=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t.x=u.magnitude(u.fromElements(e[0],e[1],e[2],qa)),t.y=u.magnitude(u.fromElements(e[4],e[5],e[6],qa)),t.z=u.magnitude(u.fromElements(e[8],e[9],e[10],qa)),t};const Df=new u;k.getMaximumScale=function(e){return k.getScale(e,Df),u.maximumComponent(Df)};const t_=new u;k.setRotation=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("result",n);const i=k.getScale(e,t_);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const n_=new u;k.getRotation=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=k.getScale(e,n_);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t},k.multiply=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n);const i=e[0],o=e[1],a=e[2],r=e[3],f=e[4],c=e[5],h=e[6],d=e[7],p=e[8],m=e[9],T=e[10],y=e[11],w=e[12],A=e[13],E=e[14],b=e[15],D=t[0],O=t[1],B=t[2],L=t[3],F=t[4],N=t[5],U=t[6],M=t[7],j=t[8],Y=t[9],s=t[10],x=t[11],P=t[12],z=t[13],H=t[14],X=t[15],ee=i*D+f*O+p*B+w*L,K=o*D+c*O+m*B+A*L,ce=a*D+h*O+T*B+E*L,le=r*D+d*O+y*B+b*L,we=i*F+f*N+p*U+w*M,Se=o*F+c*N+m*U+A*M,Ee=a*F+h*N+T*U+E*M,Le=r*F+d*N+y*U+b*M,Ke=i*j+f*Y+p*s+w*x,ct=o*j+c*Y+m*s+A*x,gt=a*j+h*Y+T*s+E*x,Fe=r*j+d*Y+y*s+b*x,At=i*P+f*z+p*H+w*X,Wt=o*P+c*z+m*H+A*X,Et=a*P+h*z+T*H+E*X,pn=r*P+d*z+y*H+b*X;return n[0]=ee,n[1]=K,n[2]=ce,n[3]=le,n[4]=we,n[5]=Se,n[6]=Ee,n[7]=Le,n[8]=Ke,n[9]=ct,n[10]=gt,n[11]=Fe,n[12]=At,n[13]=Wt,n[14]=Et,n[15]=pn,n},k.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},k.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},k.multiplyTransformation=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n);const i=e[0],o=e[1],a=e[2],r=e[4],f=e[5],c=e[6],h=e[8],d=e[9],p=e[10],m=e[12],T=e[13],y=e[14],w=t[0],A=t[1],E=t[2],b=t[4],D=t[5],O=t[6],B=t[8],L=t[9],F=t[10],N=t[12],U=t[13],M=t[14],j=i*w+r*A+h*E,Y=o*w+f*A+d*E,s=a*w+c*A+p*E,x=i*b+r*D+h*O,P=o*b+f*D+d*O,z=a*b+c*D+p*O,H=i*B+r*L+h*F,X=o*B+f*L+d*F,ee=a*B+c*L+p*F,K=i*N+r*U+h*M+m,ce=o*N+f*U+d*M+T,le=a*N+c*U+p*M+y;return n[0]=j,n[1]=Y,n[2]=s,n[3]=0,n[4]=x,n[5]=P,n[6]=z,n[7]=0,n[8]=H,n[9]=X,n[10]=ee,n[11]=0,n[12]=K,n[13]=ce,n[14]=le,n[15]=1,n},k.multiplyByMatrix3=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("rotation",t),_.typeOf.object("result",n);const i=e[0],o=e[1],a=e[2],r=e[4],f=e[5],c=e[6],h=e[8],d=e[9],p=e[10],m=t[0],T=t[1],y=t[2],w=t[3],A=t[4],E=t[5],b=t[6],D=t[7],O=t[8],B=i*m+r*T+h*y,L=o*m+f*T+d*y,F=a*m+c*T+p*y,N=i*w+r*A+h*E,U=o*w+f*A+d*E,M=a*w+c*A+p*E,j=i*b+r*D+h*O,Y=o*b+f*D+d*O,s=a*b+c*D+p*O;return n[0]=B,n[1]=L,n[2]=F,n[3]=0,n[4]=N,n[5]=U,n[6]=M,n[7]=0,n[8]=j,n[9]=Y,n[10]=s,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},k.multiplyByTranslation=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("translation",t),_.typeOf.object("result",n);const i=t.x,o=t.y,a=t.z,r=i*e[0]+o*e[4]+a*e[8]+e[12],f=i*e[1]+o*e[5]+a*e[9]+e[13],c=i*e[2]+o*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=r,n[13]=f,n[14]=c,n[15]=e[15],n},k.multiplyByScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("scale",t),_.typeOf.object("result",n);const i=t.x,o=t.y,a=t.z;return i===1&&o===1&&a===1?k.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)},k.multiplyByUniformScale=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.number("scale",t),_.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},k.multiplyByVector=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("cartesian",t),_.typeOf.object("result",n);const i=t.x,o=t.y,a=t.z,r=t.w,f=e[0]*i+e[4]*o+e[8]*a+e[12]*r,c=e[1]*i+e[5]*o+e[9]*a+e[13]*r,h=e[2]*i+e[6]*o+e[10]*a+e[14]*r,d=e[3]*i+e[7]*o+e[11]*a+e[15]*r;return n.x=f,n.y=c,n.z=h,n.w=d,n},k.multiplyByPointAsVector=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("cartesian",t),_.typeOf.object("result",n);const i=t.x,o=t.y,a=t.z,r=e[0]*i+e[4]*o+e[8]*a,f=e[1]*i+e[5]*o+e[9]*a,c=e[2]*i+e[6]*o+e[10]*a;return n.x=r,n.y=f,n.z=c,n},k.multiplyByPoint=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("cartesian",t),_.typeOf.object("result",n);const i=t.x,o=t.y,a=t.z,r=e[0]*i+e[4]*o+e[8]*a+e[12],f=e[1]*i+e[5]*o+e[9]*a+e[13],c=e[2]*i+e[6]*o+e[10]*a+e[14];return n.x=r,n.y=f,n.z=c,n},k.multiplyByScalar=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},k.negate=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},k.transpose=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=e[1],i=e[2],o=e[3],a=e[6],r=e[7],f=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=r,t[14]=f,t[15]=e[15],t},k.abs=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},k.equals=function(e,t){return e===t||l(e)&&l(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},k.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},k.getTranslation=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t},k.getMatrix3=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};const i_=new G,o_=new G,s_=new Z,r_=new Z(0,0,0,1);k.inverse=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=e[0],i=e[4],o=e[8],a=e[12],r=e[1],f=e[5],c=e[9],h=e[13],d=e[2],p=e[6],m=e[10],T=e[14],y=e[3],w=e[7],A=e[11],E=e[15];let b=m*E,D=T*A,O=p*E,B=T*w,L=p*A,F=m*w,N=d*E,U=T*y,M=d*A,j=m*y,Y=d*w,s=p*y;const x=b*f+B*c+L*h-(D*f+O*c+F*h),P=D*r+N*c+j*h-(b*r+U*c+M*h),z=O*r+U*f+Y*h-(B*r+N*f+s*h),H=F*r+M*f+s*c-(L*r+j*f+Y*c),X=D*i+O*o+F*a-(b*i+B*o+L*a),ee=b*n+U*o+M*a-(D*n+N*o+j*a),K=B*n+N*i+s*a-(O*n+U*i+Y*a),ce=L*n+j*i+Y*o-(F*n+M*i+s*o);b=o*h,D=a*c,O=i*h,B=a*f,L=i*c,F=o*f,N=n*h,U=a*r,M=n*c,j=o*r,Y=n*f,s=i*r;const le=b*w+B*A+L*E-(D*w+O*A+F*E),we=D*y+N*A+j*E-(b*y+U*A+M*E),Se=O*y+U*w+Y*E-(B*y+N*w+s*E),Ee=F*y+M*w+s*A-(L*y+j*w+Y*A),Le=O*m+F*T+D*p-(L*T+b*p+B*m),Ke=M*T+b*d+U*m-(N*m+j*T+D*d),ct=N*p+s*T+B*d-(Y*T+O*d+U*p),gt=Y*m+L*d+j*p-(M*p+s*m+F*d);let Fe=n*x+i*P+o*z+a*H;if(Math.abs(Fe)<S.EPSILON21){if(G.equalsEpsilon(k.getMatrix3(e,i_),o_,S.EPSILON7)&&Z.equals(k.getRow(e,3,s_),r_))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new dt("matrix is not invertible because its determinate is zero.")}return Fe=1/Fe,t[0]=x*Fe,t[1]=P*Fe,t[2]=z*Fe,t[3]=H*Fe,t[4]=X*Fe,t[5]=ee*Fe,t[6]=K*Fe,t[7]=ce*Fe,t[8]=le*Fe,t[9]=we*Fe,t[10]=Se*Fe,t[11]=Ee*Fe,t[12]=Le*Fe,t[13]=Ke*Fe,t[14]=ct*Fe,t[15]=gt*Fe,t},k.inverseTransformation=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=e[0],i=e[1],o=e[2],a=e[4],r=e[5],f=e[6],c=e[8],h=e[9],d=e[10],p=e[12],m=e[13],T=e[14],y=-n*p-i*m-o*T,w=-a*p-r*m-f*T,A=-c*p-h*m-d*T;return t[0]=n,t[1]=a,t[2]=c,t[3]=0,t[4]=i,t[5]=r,t[6]=h,t[7]=0,t[8]=o,t[9]=f,t[10]=d,t[11]=0,t[12]=y,t[13]=w,t[14]=A,t[15]=1,t};const a_=new k;k.inverseTranspose=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),k.inverse(k.transpose(e,a_),t)},k.IDENTITY=Object.freeze(new k(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),k.ZERO=Object.freeze(new k(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),k.COLUMN0ROW0=0,k.COLUMN0ROW1=1,k.COLUMN0ROW2=2,k.COLUMN0ROW3=3,k.COLUMN1ROW0=4,k.COLUMN1ROW1=5,k.COLUMN1ROW2=6,k.COLUMN1ROW3=7,k.COLUMN2ROW0=8,k.COLUMN2ROW1=9,k.COLUMN2ROW2=10,k.COLUMN2ROW3=11,k.COLUMN3ROW0=12,k.COLUMN3ROW1=13,k.COLUMN3ROW2=14,k.COLUMN3ROW3=15,Object.defineProperties(k.prototype,{length:{get:function(){return k.packedLength}}}),k.prototype.clone=function(e){return k.clone(this,e)},k.prototype.equals=function(e){return k.equals(this,e)},k.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},k.prototype.equalsEpsilon=function(e,t){return k.equalsEpsilon(this,e,t)},k.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
6
6
  (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
7
7
  (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
8
- (${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};const R=Object.freeze({DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047}),c_=new u;function fe(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}const Lt={};Lt[R.FLOAT]="float",Lt[R.FLOAT_VEC2]="vec2",Lt[R.FLOAT_VEC3]="vec3",Lt[R.FLOAT_VEC4]="vec4",Lt[R.INT]="int",Lt[R.INT_VEC2]="ivec2",Lt[R.INT_VEC3]="ivec3",Lt[R.INT_VEC4]="ivec4",Lt[R.BOOL]="bool",Lt[R.BOOL_VEC2]="bvec2",Lt[R.BOOL_VEC3]="bvec3",Lt[R.BOOL_VEC4]="bvec4",Lt[R.FLOAT_MAT2]="mat2",Lt[R.FLOAT_MAT3]="mat3",Lt[R.FLOAT_MAT4]="mat4",Lt[R.SAMPLER_2D]="sampler2D",Lt[R.SAMPLER_CUBE]="samplerCube",fe.prototype.getDeclaration=function(e){let t=`uniform ${Lt[this._datatype]} ${e}`;const n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};const gr={czm_viewport:new fe({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new fe({size:1,datatype:R.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new fe({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new fe({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new fe({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new fe({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new fe({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return k.getTranslation(e.inverseView,c_)}}),czm_frameNumber:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new fe({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new fe({size:1,datatype:R.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new fe({size:1,datatype:R.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new fe({size:1,datatype:R.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new fe({size:9,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogMinimumBrightness:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new fe({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})};function Xn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function h_(){return!0}function st(e,t){t=g(t,"This object was destroyed, i.e., destroy() was called.");function n(){throw new C(t)}for(const i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=h_}const Pt={UNSIGNED_BYTE:R.UNSIGNED_BYTE,UNSIGNED_SHORT:R.UNSIGNED_SHORT,UNSIGNED_INT:R.UNSIGNED_INT};Pt.getSizeInBytes=function(e){switch(e){case Pt.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Pt.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Pt.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new C("indexDatatype is required and must be a valid IndexDatatype constant.")},Pt.fromSizeInBytes=function(e){switch(e){case 2:return Pt.UNSIGNED_SHORT;case 4:return Pt.UNSIGNED_INT;case 1:return Pt.UNSIGNED_BYTE;default:throw new C("Size in bytes cannot be mapped to an IndexDatatype")}},Pt.validate=function(e){return l(e)&&(e===Pt.UNSIGNED_BYTE||e===Pt.UNSIGNED_SHORT||e===Pt.UNSIGNED_INT)},Pt.createTypedArray=function(e,t){if(!l(e))throw new C("numberOfVertices is required.");return e>=S.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},Pt.createTypedArrayFromArrayBuffer=function(e,t,n,i){if(!l(e))throw new C("numberOfVertices is required.");if(!l(t))throw new C("sourceArray is required.");if(!l(n))throw new C("byteOffset is required.");return e>=S.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},Pt.fromTypedArray=function(e){if(e instanceof Uint8Array)return Pt.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Pt.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Pt.UNSIGNED_INT;throw new C("array must be a Uint8Array, Uint16Array, or Uint32Array.")};const bt=Object.freeze(Pt),Tr={STREAM_DRAW:R.STREAM_DRAW,STATIC_DRAW:R.STATIC_DRAW,DYNAMIC_DRAW:R.DYNAMIC_DRAW,validate:function(e){return e===Tr.STREAM_DRAW||e===Tr.STATIC_DRAW||e===Tr.DYNAMIC_DRAW}},We=Object.freeze(Tr);function Bt(e){if(e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context),!l(e.typedArray)&&!l(e.sizeInBytes))throw new C("Either options.sizeInBytes or options.typedArray is required.");if(l(e.typedArray)&&l(e.sizeInBytes))throw new C("Cannot pass in both options.sizeInBytes and options.typedArray.");if(l(e.typedArray)&&(_.typeOf.object("options.typedArray",e.typedArray),_.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!We.validate(e.usage))throw new C("usage is invalid.");const t=e.context._gl,n=e.bufferTarget,i=e.typedArray;let o=e.sizeInBytes;const a=e.usage,r=l(i);r&&(o=i.byteLength),_.typeOf.number.greaterThan("sizeInBytes",o,0);const f=t.createBuffer();t.bindBuffer(n,f),t.bufferData(n,r?i:o,a),t.bindBuffer(n,null),this._id=Xn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=a,this._buffer=f,this.vertexArrayDestroyable=!0}Bt.createVertexBuffer=function(e){return _.defined("options.context",e.context),new Bt({context:e.context,bufferTarget:R.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},Bt.createIndexBuffer=function(e){if(_.defined("options.context",e.context),!bt.validate(e.indexDatatype))throw new C("Invalid indexDatatype.");if(e.indexDatatype===bt.UNSIGNED_INT&&!e.context.elementIndexUint)throw new C("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.");const t=e.context,n=e.indexDatatype,i=bt.getSizeInBytes(n),o=new Bt({context:t,bufferTarget:R.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),a=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return a}}}),o},Object.defineProperties(Bt.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),Bt.prototype._getBuffer=function(){return this._buffer},Bt.prototype.copyFromArrayView=function(e,t){t=g(t,0),_.defined("arrayView",e),_.typeOf.number.lessThanOrEquals("offsetInBytes + arrayView.byteLength",t+e.byteLength,this._sizeInBytes);const n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)},Bt.prototype.copyFromBuffer=function(e,t,n,i){if(!this._webgl2)throw new C("A WebGL 2 context is required.");if(!l(e))throw new C("readBuffer must be defined.");if(!l(i)||i<=0)throw new C("sizeInBytes must be defined and be greater than zero.");if(!l(t)||t<0||t+i>e._sizeInBytes)throw new C("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!l(n)||n<0||n+i>this._sizeInBytes)throw new C("writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.");if(this._buffer===e._buffer&&(n>=t&&n<t+i||t>n&&t<n+i))throw new C("When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.");if(this._bufferTarget===R.ELEMENT_ARRAY_BUFFER&&e._bufferTarget!==R.ELEMENT_ARRAY_BUFFER||this._bufferTarget!==R.ELEMENT_ARRAY_BUFFER&&e._bufferTarget===R.ELEMENT_ARRAY_BUFFER)throw new C("Can not copy an index buffer into another buffer type.");const o=R.COPY_READ_BUFFER,a=R.COPY_WRITE_BUFFER,r=this._gl;r.bindBuffer(a,this._buffer),r.bindBuffer(o,e._buffer),r.copyBufferSubData(o,a,t,n,i),r.bindBuffer(a,null),r.bindBuffer(o,null)},Bt.prototype.getBufferData=function(e,t,n,i){if(t=g(t,0),n=g(n,0),!this._webgl2)throw new C("A WebGL 2 context is required.");if(!l(e))throw new C("arrayView is required.");let o,a,r=e.byteLength;if(l(i)?(o=i,l(r)?a=1:(r=e.length,a=e.BYTES_PER_ELEMENT)):l(r)?(o=r-n,a=1):(r=e.length,o=r-n,a=e.BYTES_PER_ELEMENT),n<0||n>r)throw new C("destinationOffset must be greater than zero and less than the arrayView length.");if(n+o>r)throw new C("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new C("sourceOffset must be greater than zero and less than the buffers size.");if(t+o*a>this._sizeInBytes)throw new C("sourceOffset + length must be less than the buffers size.");const f=this._gl,c=R.COPY_READ_BUFFER;f.bindBuffer(c,this._buffer),f.getBufferSubData(c,t,e,n,i),f.bindBuffer(c,null)},Bt.prototype.isDestroyed=function(){return!1},Bt.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),st(this)};let Bi;const pt={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},an={};Object.defineProperties(an,{element:{get:function(){if(an.supportsFullscreen())return document[pt.fullscreenElement]}},changeEventName:{get:function(){if(an.supportsFullscreen())return pt.fullscreenchange}},errorEventName:{get:function(){if(an.supportsFullscreen())return pt.fullscreenerror}},enabled:{get:function(){if(an.supportsFullscreen())return document[pt.fullscreenEnabled]}},fullscreen:{get:function(){if(an.supportsFullscreen())return an.element!==null}}}),an.supportsFullscreen=function(){if(l(Bi))return Bi;Bi=!1;const e=document.body;if(typeof e.requestFullscreen=="function")return pt.requestFullscreen="requestFullscreen",pt.exitFullscreen="exitFullscreen",pt.fullscreenEnabled="fullscreenEnabled",pt.fullscreenElement="fullscreenElement",pt.fullscreenchange="fullscreenchange",pt.fullscreenerror="fullscreenerror",Bi=!0,Bi;const t=["webkit","moz","o","ms","khtml"];let n;for(let i=0,o=t.length;i<o;++i){const a=t[i];n=`${a}RequestFullscreen`,typeof e[n]=="function"?(pt.requestFullscreen=n,Bi=!0):(n=`${a}RequestFullScreen`,typeof e[n]=="function"&&(pt.requestFullscreen=n,Bi=!0)),n=`${a}ExitFullscreen`,typeof document[n]=="function"?pt.exitFullscreen=n:(n=`${a}CancelFullScreen`,typeof document[n]=="function"&&(pt.exitFullscreen=n)),n=`${a}FullscreenEnabled`,document[n]!==void 0?pt.fullscreenEnabled=n:(n=`${a}FullScreenEnabled`,document[n]!==void 0&&(pt.fullscreenEnabled=n)),n=`${a}FullscreenElement`,document[n]!==void 0?pt.fullscreenElement=n:(n=`${a}FullScreenElement`,document[n]!==void 0&&(pt.fullscreenElement=n)),n=`${a}fullscreenchange`,document[`on${n}`]!==void 0&&(a==="ms"&&(n="MSFullscreenChange"),pt.fullscreenchange=n),n=`${a}fullscreenerror`,document[`on${n}`]!==void 0&&(a==="ms"&&(n="MSFullscreenError"),pt.fullscreenerror=n)}return Bi},an.requestFullscreen=function(e,t){an.supportsFullscreen()&&e[pt.requestFullscreen]({vrDisplay:t})},an.exitFullscreen=function(){an.supportsFullscreen()&&document[pt.exitFullscreen]()},an._names=pt;let Yt;typeof navigator<"u"?Yt=navigator:Yt={};function Qi(e){const t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}let yr,Of;function Ha(){if(!l(yr)&&(yr=!1,!Er())){const e=/ Chrome\/([\.0-9]+)/.exec(Yt.userAgent);e!==null&&(yr=!0,Of=Qi(e[1]))}return yr}function f_(){return Ha()&&Of}let Cr,vf;function Wf(){if(!l(Cr)&&(Cr=!1,!Ha()&&!Er()&&/ Safari\/[\.0-9]+/.test(Yt.userAgent))){const e=/ Version\/([\.0-9]+)/.exec(Yt.userAgent);e!==null&&(Cr=!0,vf=Qi(e[1]))}return Cr}function l_(){return Wf()&&vf}let wr,ja;function Pf(){if(!l(wr)){wr=!1;const e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Yt.userAgent);e!==null&&(wr=!0,ja=Qi(e[1]),ja.isNightly=!!e[2])}return wr}function u_(){return Pf()&&ja}let ns,Ya;function Bf(){if(!l(ns)){ns=!1;let e;Yt.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Yt.userAgent),e!==null&&(ns=!0,Ya=Qi(e[1]))):Yt.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Yt.userAgent),e!==null&&(ns=!0,Ya=Qi(e[1])))}return ns}function d_(){return Bf()&&Ya}let Ar,Rf;function Er(){if(!l(Ar)){Ar=!1;const e=/ Edg\/([\.0-9]+)/.exec(Yt.userAgent);e!==null&&(Ar=!0,Rf=Qi(e[1]))}return Ar}function p_(){return Er()&&Rf}let br,Xa;function xr(){if(!l(br)){br=!1;const e=/Firefox\/([\.0-9]+)/.exec(Yt.userAgent);e!==null&&(br=!0,Xa=Qi(e[1]))}return br}let $a;function m_(){return l($a)||($a=/Windows/i.test(Yt.appVersion)),$a}let Za;function __(){return l(Za)||(Za=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),Za}function g_(){return xr()&&Xa}let Ka;function T_(){return l(Ka)||(Ka=!xr()&&typeof PointerEvent<"u"&&(!l(Yt.pointerEnabled)||Yt.pointerEnabled)),Ka}let zf,Sr;function Lf(){if(!l(Sr)){const e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const t=e.style.imageRendering;Sr=l(t)&&t!=="",Sr&&(zf=t)}return Sr}function y_(){return Lf()?zf:void 0}function Xt(){if(!Xt.initialized)throw new C("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return Xt._result}Xt._promise=void 0,Xt._result=void 0,Xt.initialize=function(){return l(Xt._promise)||(Xt._promise=new Promise(e=>{const t=new Image;t.onload=function(){Xt._result=t.width>0&&t.height>0,e(Xt._result)},t.onerror=function(){Xt._result=!1,e(Xt._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Xt._promise},Object.defineProperties(Xt,{initialized:{get:function(){return l(Xt._result)}}});const So=[];typeof ArrayBuffer<"u"&&(So.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&So.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&So.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&So.push(BigInt64Array),typeof BigUint64Array<"u"&&So.push(BigUint64Array));const Ct={isChrome:Ha,chromeVersion:f_,isSafari:Wf,safariVersion:l_,isWebkit:Pf,webkitVersion:u_,isInternetExplorer:Bf,internetExplorerVersion:d_,isEdge:Er,edgeVersion:p_,isFirefox:xr,firefoxVersion:g_,isWindows:m_,isIPadOrIOS:__,hardwareConcurrency:g(Yt.hardwareConcurrency,3),supportsPointerEvents:T_,supportsImageRenderingPixelated:Lf,supportsWebP:Xt,imageRenderingValue:y_,typedArrayTypes:So};Ct.supportsBasis=function(e){return Ct.supportsWebAssembly()&&e.context.supportsBasis},Ct.supportsFullscreen=function(){return an.supportsFullscreen()},Ct.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"},Ct.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"},Ct.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"},Ct.supportsBigInt=function(){return typeof BigInt<"u"},Ct.supportsWebWorkers=function(){return typeof Worker<"u"},Ct.supportsWebAssembly=function(){return typeof WebAssembly<"u"},Ct.supportsWebgl2=function(e){return _.defined("scene",e),e.context.webgl2},Ct.supportsEsmWebWorkers=function(){return!xr()||parseInt(Xa)>=114};function Qa(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function D(e,t,n,i){this.red=g(e,1),this.green=g(t,1),this.blue=g(n,1),this.alpha=g(i,1)}D.fromCartesian4=function(e,t){return _.typeOf.object("cartesian",e),l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new D(e.x,e.y,e.z,e.w)},D.fromBytes=function(e,t,n,i,o){return e=D.byteToFloat(g(e,255)),t=D.byteToFloat(g(t,255)),n=D.byteToFloat(g(n,255)),i=D.byteToFloat(g(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new D(e,t,n,i)},D.fromAlpha=function(e,t,n){return _.typeOf.object("color",e),_.typeOf.number("alpha",t),l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new D(e.red,e.green,e.blue,t)};let Ja,ec,pi;Ct.supportsTypedArrays()&&(Ja=new ArrayBuffer(4),ec=new Uint32Array(Ja),pi=new Uint8Array(Ja)),D.fromRgba=function(e,t){return ec[0]=e,D.fromBytes(pi[0],pi[1],pi[2],pi[3],t)},D.fromHsl=function(e,t,n,i,o){e=g(e,0)%1,t=g(t,0),n=g(n,0),i=g(i,1);let a=n,r=n,f=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;const h=2*n-c;a=Qa(h,c,e+1/3),r=Qa(h,c,e),f=Qa(h,c,e-1/3)}return l(o)?(o.red=a,o.green=r,o.blue=f,o.alpha=i,o):new D(a,r,f,i)},D.fromRandom=function(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.red;if(!l(n)){const r=g(e.minimumRed,0),f=g(e.maximumRed,1);_.typeOf.number.lessThanOrEquals("minimumRed",r,f),n=r+S.nextRandomNumber()*(f-r)}let i=e.green;if(!l(i)){const r=g(e.minimumGreen,0),f=g(e.maximumGreen,1);_.typeOf.number.lessThanOrEquals("minimumGreen",r,f),i=r+S.nextRandomNumber()*(f-r)}let o=e.blue;if(!l(o)){const r=g(e.minimumBlue,0),f=g(e.maximumBlue,1);_.typeOf.number.lessThanOrEquals("minimumBlue",r,f),o=r+S.nextRandomNumber()*(f-r)}let a=e.alpha;if(!l(a)){const r=g(e.minimumAlpha,0),f=g(e.maximumAlpha,1);_.typeOf.number.lessThanOrEquals("minumumAlpha",r,f),a=r+S.nextRandomNumber()*(f-r)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=a,t):new D(n,i,o,a)};const C_=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,w_=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,A_=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,E_=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;D.fromCssColorString=function(e,t){_.typeOf.string("color",e),l(t)||(t=new D),e=e.trim();const n=D[e.toUpperCase()];if(l(n))return D.clone(n,t),t;let i=C_.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(g(i[4],"f"),16)/15,t):(i=w_.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(g(i[4],"ff"),16)/255,t):(i=A_.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(g(i[4],"1.0")),t):(i=E_.exec(e),i!==null?D.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(g(i[4],"1.0")),t):(t=void 0,t))))},D.packedLength=4,D.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t},D.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new D),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n},D.byteToFloat=function(e){return e/255},D.floatToByte=function(e){return e===1?255:e*256|0},D.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new D(e.red,e.green,e.blue,e.alpha)},D.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},D.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]},D.prototype.clone=function(e){return D.clone(this,e)},D.prototype.equals=function(e){return D.equals(this,e)},D.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t},D.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`},D.prototype.toCssColorString=function(){const e=D.floatToByte(this.red),t=D.floatToByte(this.green),n=D.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`},D.prototype.toCssHexString=function(){let e=D.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=D.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=D.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=D.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`},D.prototype.toBytes=function(e){const t=D.floatToByte(this.red),n=D.floatToByte(this.green),i=D.floatToByte(this.blue),o=D.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]},D.prototype.toRgba=function(){return pi[0]=D.floatToByte(this.red),pi[1]=D.floatToByte(this.green),pi[2]=D.floatToByte(this.blue),pi[3]=D.floatToByte(this.alpha),ec[0]},D.prototype.brighten=function(e,t){return _.typeOf.number("magnitude",e),_.typeOf.number.greaterThanOrEquals("magnitude",e,0),_.typeOf.object("result",t),e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},D.prototype.darken=function(e,t){return _.typeOf.number("magnitude",e),_.typeOf.number.greaterThanOrEquals("magnitude",e,0),_.typeOf.object("result",t),e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},D.prototype.withAlpha=function(e,t){return D.fromAlpha(this,e,t)},D.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n},D.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n},D.multiply=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n},D.divide=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n},D.mod=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n},D.lerp=function(e,t,n,i){return _.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i),i.red=S.lerp(e.red,t.red,n),i.green=S.lerp(e.green,t.green,n),i.blue=S.lerp(e.blue,t.blue,n),i.alpha=S.lerp(e.alpha,t.alpha,n),i},D.multiplyByScalar=function(e,t,n){return _.typeOf.object("color",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n},D.divideByScalar=function(e,t,n){return _.typeOf.object("color",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n},D.ALICEBLUE=Object.freeze(D.fromCssColorString("#F0F8FF")),D.ANTIQUEWHITE=Object.freeze(D.fromCssColorString("#FAEBD7")),D.AQUA=Object.freeze(D.fromCssColorString("#00FFFF")),D.AQUAMARINE=Object.freeze(D.fromCssColorString("#7FFFD4")),D.AZURE=Object.freeze(D.fromCssColorString("#F0FFFF")),D.BEIGE=Object.freeze(D.fromCssColorString("#F5F5DC")),D.BISQUE=Object.freeze(D.fromCssColorString("#FFE4C4")),D.BLACK=Object.freeze(D.fromCssColorString("#000000")),D.BLANCHEDALMOND=Object.freeze(D.fromCssColorString("#FFEBCD")),D.BLUE=Object.freeze(D.fromCssColorString("#0000FF")),D.BLUEVIOLET=Object.freeze(D.fromCssColorString("#8A2BE2")),D.BROWN=Object.freeze(D.fromCssColorString("#A52A2A")),D.BURLYWOOD=Object.freeze(D.fromCssColorString("#DEB887")),D.CADETBLUE=Object.freeze(D.fromCssColorString("#5F9EA0")),D.CHARTREUSE=Object.freeze(D.fromCssColorString("#7FFF00")),D.CHOCOLATE=Object.freeze(D.fromCssColorString("#D2691E")),D.CORAL=Object.freeze(D.fromCssColorString("#FF7F50")),D.CORNFLOWERBLUE=Object.freeze(D.fromCssColorString("#6495ED")),D.CORNSILK=Object.freeze(D.fromCssColorString("#FFF8DC")),D.CRIMSON=Object.freeze(D.fromCssColorString("#DC143C")),D.CYAN=Object.freeze(D.fromCssColorString("#00FFFF")),D.DARKBLUE=Object.freeze(D.fromCssColorString("#00008B")),D.DARKCYAN=Object.freeze(D.fromCssColorString("#008B8B")),D.DARKGOLDENROD=Object.freeze(D.fromCssColorString("#B8860B")),D.DARKGRAY=Object.freeze(D.fromCssColorString("#A9A9A9")),D.DARKGREEN=Object.freeze(D.fromCssColorString("#006400")),D.DARKGREY=D.DARKGRAY,D.DARKKHAKI=Object.freeze(D.fromCssColorString("#BDB76B")),D.DARKMAGENTA=Object.freeze(D.fromCssColorString("#8B008B")),D.DARKOLIVEGREEN=Object.freeze(D.fromCssColorString("#556B2F")),D.DARKORANGE=Object.freeze(D.fromCssColorString("#FF8C00")),D.DARKORCHID=Object.freeze(D.fromCssColorString("#9932CC")),D.DARKRED=Object.freeze(D.fromCssColorString("#8B0000")),D.DARKSALMON=Object.freeze(D.fromCssColorString("#E9967A")),D.DARKSEAGREEN=Object.freeze(D.fromCssColorString("#8FBC8F")),D.DARKSLATEBLUE=Object.freeze(D.fromCssColorString("#483D8B")),D.DARKSLATEGRAY=Object.freeze(D.fromCssColorString("#2F4F4F")),D.DARKSLATEGREY=D.DARKSLATEGRAY,D.DARKTURQUOISE=Object.freeze(D.fromCssColorString("#00CED1")),D.DARKVIOLET=Object.freeze(D.fromCssColorString("#9400D3")),D.DEEPPINK=Object.freeze(D.fromCssColorString("#FF1493")),D.DEEPSKYBLUE=Object.freeze(D.fromCssColorString("#00BFFF")),D.DIMGRAY=Object.freeze(D.fromCssColorString("#696969")),D.DIMGREY=D.DIMGRAY,D.DODGERBLUE=Object.freeze(D.fromCssColorString("#1E90FF")),D.FIREBRICK=Object.freeze(D.fromCssColorString("#B22222")),D.FLORALWHITE=Object.freeze(D.fromCssColorString("#FFFAF0")),D.FORESTGREEN=Object.freeze(D.fromCssColorString("#228B22")),D.FUCHSIA=Object.freeze(D.fromCssColorString("#FF00FF")),D.GAINSBORO=Object.freeze(D.fromCssColorString("#DCDCDC")),D.GHOSTWHITE=Object.freeze(D.fromCssColorString("#F8F8FF")),D.GOLD=Object.freeze(D.fromCssColorString("#FFD700")),D.GOLDENROD=Object.freeze(D.fromCssColorString("#DAA520")),D.GRAY=Object.freeze(D.fromCssColorString("#808080")),D.GREEN=Object.freeze(D.fromCssColorString("#008000")),D.GREENYELLOW=Object.freeze(D.fromCssColorString("#ADFF2F")),D.GREY=D.GRAY,D.HONEYDEW=Object.freeze(D.fromCssColorString("#F0FFF0")),D.HOTPINK=Object.freeze(D.fromCssColorString("#FF69B4")),D.INDIANRED=Object.freeze(D.fromCssColorString("#CD5C5C")),D.INDIGO=Object.freeze(D.fromCssColorString("#4B0082")),D.IVORY=Object.freeze(D.fromCssColorString("#FFFFF0")),D.KHAKI=Object.freeze(D.fromCssColorString("#F0E68C")),D.LAVENDER=Object.freeze(D.fromCssColorString("#E6E6FA")),D.LAVENDAR_BLUSH=Object.freeze(D.fromCssColorString("#FFF0F5")),D.LAWNGREEN=Object.freeze(D.fromCssColorString("#7CFC00")),D.LEMONCHIFFON=Object.freeze(D.fromCssColorString("#FFFACD")),D.LIGHTBLUE=Object.freeze(D.fromCssColorString("#ADD8E6")),D.LIGHTCORAL=Object.freeze(D.fromCssColorString("#F08080")),D.LIGHTCYAN=Object.freeze(D.fromCssColorString("#E0FFFF")),D.LIGHTGOLDENRODYELLOW=Object.freeze(D.fromCssColorString("#FAFAD2")),D.LIGHTGRAY=Object.freeze(D.fromCssColorString("#D3D3D3")),D.LIGHTGREEN=Object.freeze(D.fromCssColorString("#90EE90")),D.LIGHTGREY=D.LIGHTGRAY,D.LIGHTPINK=Object.freeze(D.fromCssColorString("#FFB6C1")),D.LIGHTSEAGREEN=Object.freeze(D.fromCssColorString("#20B2AA")),D.LIGHTSKYBLUE=Object.freeze(D.fromCssColorString("#87CEFA")),D.LIGHTSLATEGRAY=Object.freeze(D.fromCssColorString("#778899")),D.LIGHTSLATEGREY=D.LIGHTSLATEGRAY,D.LIGHTSTEELBLUE=Object.freeze(D.fromCssColorString("#B0C4DE")),D.LIGHTYELLOW=Object.freeze(D.fromCssColorString("#FFFFE0")),D.LIME=Object.freeze(D.fromCssColorString("#00FF00")),D.LIMEGREEN=Object.freeze(D.fromCssColorString("#32CD32")),D.LINEN=Object.freeze(D.fromCssColorString("#FAF0E6")),D.MAGENTA=Object.freeze(D.fromCssColorString("#FF00FF")),D.MAROON=Object.freeze(D.fromCssColorString("#800000")),D.MEDIUMAQUAMARINE=Object.freeze(D.fromCssColorString("#66CDAA")),D.MEDIUMBLUE=Object.freeze(D.fromCssColorString("#0000CD")),D.MEDIUMORCHID=Object.freeze(D.fromCssColorString("#BA55D3")),D.MEDIUMPURPLE=Object.freeze(D.fromCssColorString("#9370DB")),D.MEDIUMSEAGREEN=Object.freeze(D.fromCssColorString("#3CB371")),D.MEDIUMSLATEBLUE=Object.freeze(D.fromCssColorString("#7B68EE")),D.MEDIUMSPRINGGREEN=Object.freeze(D.fromCssColorString("#00FA9A")),D.MEDIUMTURQUOISE=Object.freeze(D.fromCssColorString("#48D1CC")),D.MEDIUMVIOLETRED=Object.freeze(D.fromCssColorString("#C71585")),D.MIDNIGHTBLUE=Object.freeze(D.fromCssColorString("#191970")),D.MINTCREAM=Object.freeze(D.fromCssColorString("#F5FFFA")),D.MISTYROSE=Object.freeze(D.fromCssColorString("#FFE4E1")),D.MOCCASIN=Object.freeze(D.fromCssColorString("#FFE4B5")),D.NAVAJOWHITE=Object.freeze(D.fromCssColorString("#FFDEAD")),D.NAVY=Object.freeze(D.fromCssColorString("#000080")),D.OLDLACE=Object.freeze(D.fromCssColorString("#FDF5E6")),D.OLIVE=Object.freeze(D.fromCssColorString("#808000")),D.OLIVEDRAB=Object.freeze(D.fromCssColorString("#6B8E23")),D.ORANGE=Object.freeze(D.fromCssColorString("#FFA500")),D.ORANGERED=Object.freeze(D.fromCssColorString("#FF4500")),D.ORCHID=Object.freeze(D.fromCssColorString("#DA70D6")),D.PALEGOLDENROD=Object.freeze(D.fromCssColorString("#EEE8AA")),D.PALEGREEN=Object.freeze(D.fromCssColorString("#98FB98")),D.PALETURQUOISE=Object.freeze(D.fromCssColorString("#AFEEEE")),D.PALEVIOLETRED=Object.freeze(D.fromCssColorString("#DB7093")),D.PAPAYAWHIP=Object.freeze(D.fromCssColorString("#FFEFD5")),D.PEACHPUFF=Object.freeze(D.fromCssColorString("#FFDAB9")),D.PERU=Object.freeze(D.fromCssColorString("#CD853F")),D.PINK=Object.freeze(D.fromCssColorString("#FFC0CB")),D.PLUM=Object.freeze(D.fromCssColorString("#DDA0DD")),D.POWDERBLUE=Object.freeze(D.fromCssColorString("#B0E0E6")),D.PURPLE=Object.freeze(D.fromCssColorString("#800080")),D.RED=Object.freeze(D.fromCssColorString("#FF0000")),D.ROSYBROWN=Object.freeze(D.fromCssColorString("#BC8F8F")),D.ROYALBLUE=Object.freeze(D.fromCssColorString("#4169E1")),D.SADDLEBROWN=Object.freeze(D.fromCssColorString("#8B4513")),D.SALMON=Object.freeze(D.fromCssColorString("#FA8072")),D.SANDYBROWN=Object.freeze(D.fromCssColorString("#F4A460")),D.SEAGREEN=Object.freeze(D.fromCssColorString("#2E8B57")),D.SEASHELL=Object.freeze(D.fromCssColorString("#FFF5EE")),D.SIENNA=Object.freeze(D.fromCssColorString("#A0522D")),D.SILVER=Object.freeze(D.fromCssColorString("#C0C0C0")),D.SKYBLUE=Object.freeze(D.fromCssColorString("#87CEEB")),D.SLATEBLUE=Object.freeze(D.fromCssColorString("#6A5ACD")),D.SLATEGRAY=Object.freeze(D.fromCssColorString("#708090")),D.SLATEGREY=D.SLATEGRAY,D.SNOW=Object.freeze(D.fromCssColorString("#FFFAFA")),D.SPRINGGREEN=Object.freeze(D.fromCssColorString("#00FF7F")),D.STEELBLUE=Object.freeze(D.fromCssColorString("#4682B4")),D.TAN=Object.freeze(D.fromCssColorString("#D2B48C")),D.TEAL=Object.freeze(D.fromCssColorString("#008080")),D.THISTLE=Object.freeze(D.fromCssColorString("#D8BFD8")),D.TOMATO=Object.freeze(D.fromCssColorString("#FF6347")),D.TURQUOISE=Object.freeze(D.fromCssColorString("#40E0D0")),D.VIOLET=Object.freeze(D.fromCssColorString("#EE82EE")),D.WHEAT=Object.freeze(D.fromCssColorString("#F5DEB3")),D.WHITE=Object.freeze(D.fromCssColorString("#FFFFFF")),D.WHITESMOKE=Object.freeze(D.fromCssColorString("#F5F5F5")),D.YELLOW=Object.freeze(D.fromCssColorString("#FFFF00")),D.YELLOWGREEN=Object.freeze(D.fromCssColorString("#9ACD32")),D.TRANSPARENT=Object.freeze(new D(0,0,0,0));const Nt=Object.freeze({ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11});function q(e,t){this.x=g(e,0),this.y=g(t,0)}q.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new q(e,t)},q.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new q(e.x,e.y)},q.fromCartesian3=q.clone,q.fromCartesian4=q.clone,q.packedLength=2,q.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.x,t[n]=e.y,t},q.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new q),n.x=e[t++],n.y=e[t],n},q.packArray=function(e,t){_.defined("array",e);const n=e.length,i=n*2;if(!l(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)q.pack(e[o],t,o*2);return t},q.unpackArray=function(e,t){if(_.defined("array",e),_.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)throw new C("array length must be a multiple of 2.");const n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){const o=i/2;t[o]=q.unpack(e,i,t[o])}return t},q.fromArray=q.unpack,q.maximumComponent=function(e){return _.typeOf.object("cartesian",e),Math.max(e.x,e.y)},q.minimumComponent=function(e){return _.typeOf.object("cartesian",e),Math.min(e.x,e.y)},q.minimumByComponent=function(e,t,n){return _.typeOf.object("first",e),_.typeOf.object("second",t),_.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},q.maximumByComponent=function(e,t,n){return _.typeOf.object("first",e),_.typeOf.object("second",t),_.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},q.clamp=function(e,t,n,i){_.typeOf.object("value",e),_.typeOf.object("min",t),_.typeOf.object("max",n),_.typeOf.object("result",i);const o=S.clamp(e.x,t.x,n.x),a=S.clamp(e.y,t.y,n.y);return i.x=o,i.y=a,i},q.magnitudeSquared=function(e){return _.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y},q.magnitude=function(e){return Math.sqrt(q.magnitudeSquared(e))};const Ir=new q;q.distance=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),q.subtract(e,t,Ir),q.magnitude(Ir)},q.distanceSquared=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),q.subtract(e,t,Ir),q.magnitudeSquared(Ir)},q.normalize=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=q.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,isNaN(t.x)||isNaN(t.y))throw new C("normalized result is not a number");return t},q.dot=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),e.x*t.x+e.y*t.y},q.cross=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),e.x*t.y-e.y*t.x},q.multiplyComponents=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n},q.divideComponents=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n},q.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n},q.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n},q.multiplyByScalar=function(e,t,n){return _.typeOf.object("cartesian",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n},q.divideByScalar=function(e,t,n){return _.typeOf.object("cartesian",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n},q.negate=function(e,t){return _.typeOf.object("cartesian",e),_.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t},q.abs=function(e,t){return _.typeOf.object("cartesian",e),_.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};const Nf=new q;q.lerp=function(e,t,n,i){return _.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i),q.multiplyByScalar(t,n,Nf),i=q.multiplyByScalar(e,1-n,i),q.add(Nf,i,i)};const Ff=new q,Mf=new q;q.angleBetween=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),q.normalize(e,Ff),q.normalize(t,Mf),S.acosClamped(q.dot(Ff,Mf))};const b_=new q;q.mostOrthogonalAxis=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=q.normalize(e,b_);return q.abs(n,n),n.x<=n.y?t=q.clone(q.UNIT_X,t):t=q.clone(q.UNIT_Y,t),t},q.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y},q.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},q.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&S.equalsEpsilon(e.x,t.x,n,i)&&S.equalsEpsilon(e.y,t.y,n,i)},q.ZERO=Object.freeze(new q(0,0)),q.ONE=Object.freeze(new q(1,1)),q.UNIT_X=Object.freeze(new q(1,0)),q.UNIT_Y=Object.freeze(new q(0,1)),q.prototype.clone=function(e){return q.clone(this,e)},q.prototype.equals=function(e){return q.equals(this,e)},q.prototype.equalsEpsilon=function(e,t,n){return q.equalsEpsilon(this,e,t,n)},q.prototype.toString=function(){return`(${this.x}, ${this.y})`};const x_=new u,S_=new u;function Uf(e,t,n,i,o){if(!l(e))throw new C("cartesian is required.");if(!l(t))throw new C("oneOverRadii is required.");if(!l(n))throw new C("oneOverRadiiSquared is required.");if(!l(i))throw new C("centerToleranceSquared is required.");const a=e.x,r=e.y,f=e.z,c=t.x,h=t.y,d=t.z,p=a*a*c*c,m=r*r*h*h,T=f*f*d*d,y=p+m+T,w=Math.sqrt(1/y),A=u.multiplyByScalar(e,w,x_);if(y<i)return isFinite(w)?u.clone(A,o):void 0;const E=n.x,b=n.y,I=n.z,O=S_;O.x=A.x*E*2,O.y=A.y*b*2,O.z=A.z*I*2;let B=(1-w)*u.magnitude(e)/(.5*u.magnitude(O)),L=0,F,N,U,M,j,Y,s,x,P,z,H;do{B-=L,U=1/(1+B*E),M=1/(1+B*b),j=1/(1+B*I),Y=U*U,s=M*M,x=j*j,P=Y*U,z=s*M,H=x*j,F=p*Y+m*s+T*x-1,N=p*P*E+m*z*b+T*H*I;const X=-2*N;L=F/X}while(Math.abs(F)>S.EPSILON12);return l(o)?(o.x=a*U,o.y=r*M,o.z=f*j,o):new u(a*U,r*M,f*j)}function oe(e,t,n){this.longitude=g(e,0),this.latitude=g(t,0),this.height=g(n,0)}oe.fromRadians=function(e,t,n,i){return _.typeOf.number("longitude",e),_.typeOf.number("latitude",t),n=g(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new oe(e,t,n)},oe.fromDegrees=function(e,t,n,i){return _.typeOf.number("longitude",e),_.typeOf.number("latitude",t),e=S.toRadians(e),t=S.toRadians(t),oe.fromRadians(e,t,n,i)};const I_=new u,D_=new u,O_=new u;oe._ellipsoidOneOverRadii=new u(1/6378137,1/6378137,1/6356752314245179e-9),oe._ellipsoidOneOverRadiiSquared=new u(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),oe._ellipsoidCenterToleranceSquared=S.EPSILON1,oe.fromCartesian=function(e,t,n){const i=l(t)?t.oneOverRadii:oe._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:oe._ellipsoidOneOverRadiiSquared,a=l(t)?t._centerToleranceSquared:oe._ellipsoidCenterToleranceSquared,r=Uf(e,i,o,a,D_);if(!l(r))return;let f=u.multiplyComponents(r,o,I_);f=u.normalize(f,f);const c=u.subtract(e,r,O_),h=Math.atan2(f.y,f.x),d=Math.asin(f.z),p=S.sign(u.dot(c,e))*u.magnitude(c);return l(n)?(n.longitude=h,n.latitude=d,n.height=p,n):new oe(h,d,p)},oe.toCartesian=function(e,t,n){return _.defined("cartographic",e),u.fromRadians(e.longitude,e.latitude,e.height,t,n)},oe.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new oe(e.longitude,e.latitude,e.height)},oe.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},oe.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},oe.ZERO=Object.freeze(new oe(0,0,0)),oe.prototype.clone=function(e){return oe.clone(this,e)},oe.prototype.equals=function(e){return oe.equals(this,e)},oe.prototype.equalsEpsilon=function(e,t){return oe.equalsEpsilon(this,e,t)},oe.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};function kf(e,t,n,i){t=g(t,0),n=g(n,0),i=g(i,0),_.typeOf.number.greaterThanOrEquals("x",t,0),_.typeOf.number.greaterThanOrEquals("y",n,0),_.typeOf.number.greaterThanOrEquals("z",i,0),e._radii=new u(t,n,i),e._radiiSquared=new u(t*t,n*n,i*i),e._radiiToTheFourth=new u(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new u(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new u(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=S.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function pe(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,kf(this,e,t,n)}Object.defineProperties(pe.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),pe.clone=function(e,t){if(!l(e))return;const n=e._radii;return l(t)?(u.clone(n,t._radii),u.clone(e._radiiSquared,t._radiiSquared),u.clone(e._radiiToTheFourth,t._radiiToTheFourth),u.clone(e._oneOverRadii,t._oneOverRadii),u.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new pe(n.x,n.y,n.z)},pe.fromCartesian3=function(e,t){return l(t)||(t=new pe),l(e)&&kf(t,e.x,e.y,e.z),t},pe.WGS84=Object.freeze(new pe(6378137,6378137,6356752314245179e-9)),pe.UNIT_SPHERE=Object.freeze(new pe(1,1,1)),pe.MOON=Object.freeze(new pe(S.LUNAR_RADIUS,S.LUNAR_RADIUS,S.LUNAR_RADIUS)),pe._default=pe.WGS84,Object.defineProperties(pe,{default:{get:function(){return pe._default},set:function(e){_.typeOf.object("value",e),pe._default=e,u._ellipsoidRadiiSquared=e.radiiSquared,oe._ellipsoidOneOverRadii=e.oneOverRadii,oe._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,oe._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}}),pe.prototype.clone=function(e){return pe.clone(this,e)},pe.packedLength=u.packedLength,pe.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),u.pack(e._radii,t,n),t},pe.unpack=function(e,t,n){_.defined("array",e),t=g(t,0);const i=u.unpack(e,t);return pe.fromCartesian3(i,n)},pe.prototype.geocentricSurfaceNormal=u.normalize,pe.prototype.geodeticSurfaceNormalCartographic=function(e,t){_.typeOf.object("cartographic",e);const n=e.longitude,i=e.latitude,o=Math.cos(i),a=o*Math.cos(n),r=o*Math.sin(n),f=Math.sin(i);return l(t)||(t=new u),t.x=a,t.y=r,t.z=f,u.normalize(t,t)},pe.prototype.geodeticSurfaceNormal=function(e,t){if(_.typeOf.object("cartesian",e),isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new C("cartesian has a NaN component");if(!u.equalsEpsilon(e,u.ZERO,S.EPSILON14))return l(t)||(t=new u),t=u.multiplyComponents(e,this._oneOverRadiiSquared,t),u.normalize(t,t)};const v_=new u,W_=new u;pe.prototype.cartographicToCartesian=function(e,t){const n=v_,i=W_;this.geodeticSurfaceNormalCartographic(e,n),u.multiplyComponents(this._radiiSquared,n,i);const o=Math.sqrt(u.dot(n,i));return u.divideByScalar(i,o,i),u.multiplyByScalar(n,e.height,n),l(t)||(t=new u),u.add(i,n,t)},pe.prototype.cartographicArrayToCartesianArray=function(e,t){_.defined("cartographics",e);const n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};const P_=new u,B_=new u,R_=new u;pe.prototype.cartesianToCartographic=function(e,t){const n=this.scaleToGeodeticSurface(e,B_);if(!l(n))return;const i=this.geodeticSurfaceNormal(n,P_),o=u.subtract(e,n,R_),a=Math.atan2(i.y,i.x),r=Math.asin(i.z),f=S.sign(u.dot(o,e))*u.magnitude(o);return l(t)?(t.longitude=a,t.latitude=r,t.height=f,t):new oe(a,r,f)},pe.prototype.cartesianArrayToCartographicArray=function(e,t){_.defined("cartesians",e);const n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},pe.prototype.scaleToGeodeticSurface=function(e,t){return Uf(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},pe.prototype.scaleToGeocentricSurface=function(e,t){_.typeOf.object("cartesian",e),l(t)||(t=new u);const n=e.x,i=e.y,o=e.z,a=this._oneOverRadiiSquared,r=1/Math.sqrt(n*n*a.x+i*i*a.y+o*o*a.z);return u.multiplyByScalar(e,r,t)},pe.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new u),u.multiplyComponents(e,this._oneOverRadii,t)},pe.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new u),u.multiplyComponents(e,this._radii,t)},pe.prototype.equals=function(e){return this===e||l(e)&&u.equals(this._radii,e._radii)},pe.prototype.toString=function(){return this._radii.toString()},pe.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){if(_.typeOf.object("position",e),!S.equalsEpsilon(this._radii.x,this._radii.y,S.EPSILON15))throw new C("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");_.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=g(t,0);const i=this._squaredXOverSquaredZ;if(l(n)||(n=new u),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};const z_=new u;pe.prototype.getLocalCurvature=function(e,t){_.typeOf.object("surfacePosition",e),l(t)||(t=new q);const n=this.getSurfaceNormalIntersectionWithZAxis(e,0,z_),i=u.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,a=i*o**2;return q.fromElements(1/i,1/a,t)};const L_=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],N_=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Vf(e,t,n){_.typeOf.number("a",e),_.typeOf.number("b",t),_.typeOf.func("func",n);const i=.5*(t+e),o=.5*(t-e);let a=0;for(let r=0;r<5;r++){const f=o*L_[r];a+=N_[r]*(n(i+f)+n(i-f))}return a*=o,a}pe.prototype.surfaceArea=function(e){_.typeOf.object("rectangle",e);const t=e.west;let n=e.east;const i=e.south,o=e.north;for(;n<t;)n+=S.TWO_PI;const a=this._radiiSquared,r=a.x,f=a.y,c=a.z,h=r*f;return Vf(i,o,function(d){const p=Math.cos(d),m=Math.sin(d);return Math.cos(d)*Vf(t,n,function(T){const y=Math.cos(T),w=Math.sin(T);return Math.sqrt(h*m*m+c*(f*y*y+r*w*w)*p*p)})})};function Wn(e){this._ellipsoid=g(e,pe.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Wn.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Wn.prototype.project=function(e,t){const n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,a=e.height;return l(t)?(t.x=i,t.y=o,t.z=a,t):new u(i,o,a)},Wn.prototype.unproject=function(e,t){if(!l(e))throw new C("cartesian is required");const n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,a=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=a,t):new oe(i,o,a)};const xt=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function is(e,t,n){_.defined("array",e),_.defined("itemToFind",t),_.defined("comparator",n);let i=0,o=e.length-1,a,r;for(;i<=o;){if(a=~~((i+o)/2),r=n(e[a],t),r<0){i=a+1;continue}if(r>0){o=a-1;continue}return a}return~(o+1)}function tc(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}function nc(e){if(e===null||isNaN(e))throw new C("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}const Gf=[31,28,31,30,31,30,31,31,30,31,30,31];function ic(e,t,n,i,o,a,r,f){e=g(e,1),t=g(t,1),n=g(n,1),i=g(i,0),o=g(o,0),a=g(a,0),r=g(r,0),f=g(f,!1),w(),A(),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=a,this.millisecond=r,this.isLeapSecond=f;function w(){_.typeOf.number.greaterThanOrEquals("Year",e,1),_.typeOf.number.lessThanOrEquals("Year",e,9999),_.typeOf.number.greaterThanOrEquals("Month",t,1),_.typeOf.number.lessThanOrEquals("Month",t,12),_.typeOf.number.greaterThanOrEquals("Day",n,1),_.typeOf.number.lessThanOrEquals("Day",n,31),_.typeOf.number.greaterThanOrEquals("Hour",i,0),_.typeOf.number.lessThanOrEquals("Hour",i,23),_.typeOf.number.greaterThanOrEquals("Minute",o,0),_.typeOf.number.lessThanOrEquals("Minute",o,59),_.typeOf.bool("IsLeapSecond",f),_.typeOf.number.greaterThanOrEquals("Second",a,0),_.typeOf.number.lessThanOrEquals("Second",a,f?60:59),_.typeOf.number.greaterThanOrEquals("Millisecond",r,0),_.typeOf.number.lessThan("Millisecond",r,1e3)}function A(){const E=t===2&&nc(e)?Gf[t-1]+1:Gf[t-1];if(n>E)throw new C("Month and Day represents invalid date")}}function Ye(e,t){this.julianDate=e,this.offset=t}const ht=Object.freeze({SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1}),Be=Object.freeze({UTC:0,TAI:1}),qf=new ic,Dr=[31,28,31,30,31,30,31,31,30,31,30,31],Or=29;function oc(e,t){return J.compare(e.julianDate,t.julianDate)}const Io=new Ye;function vr(e){Io.julianDate=e;const t=J.leapSeconds;let n=is(t,Io,oc);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&J.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),J.addSeconds(e,i,e)}function Hf(e,t){Io.julianDate=e;const n=J.leapSeconds;let i=is(n,Io,oc);if(i<0&&(i=~i),i===0)return J.addSeconds(e,-n[0].offset,t);if(i>=n.length)return J.addSeconds(e,-n[i-1].offset,t);const o=J.secondsDifference(n[i].julianDate,e);if(o===0)return J.addSeconds(e,-n[i].offset,t);if(!(o<=1))return J.addSeconds(e,-n[--i].offset,t)}function Ri(e,t,n){const i=t/ht.SECONDS_PER_DAY|0;return e+=i,t-=ht.SECONDS_PER_DAY*i,t<0&&(e--,t+=ht.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function sc(e,t,n,i,o,a,r){const f=(t-14)/12|0,c=e+4800+f;let h=(1461*c/4|0)+(367*(t-2-12*f)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);const d=a+(i*ht.SECONDS_PER_HOUR+o*ht.SECONDS_PER_MINUTE+r*ht.SECONDS_PER_MILLISECOND);return d>=43200&&(h-=1),[h,d]}const F_=/^(\d{4})$/,M_=/^(\d{4})-(\d{2})$/,U_=/^(\d{4})-?(\d{3})$/,k_=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,V_=/^(\d{4})-?(\d{2})-?(\d{2})$/,rc=/([Z+\-])?(\d{2})?:?(\d{2})?$/,G_=/^(\d{2})(\.\d+)?/.source+rc.source,q_=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rc.source,H_=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rc.source,Pn="Invalid ISO 8601 date.";function J(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=g(e,0),t=g(t,0),n=g(n,Be.UTC);const i=e|0;t=t+(e-i)*ht.SECONDS_PER_DAY,Ri(i,t,this),n===Be.UTC&&vr(this)}J.fromGregorianDate=function(e,t){if(!(e instanceof ic))throw new C("date must be a valid GregorianDate.");const n=sc(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(Ri(n[0],n[1],t),vr(t),t):new J(n[0],n[1],Be.UTC)},J.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new C("date must be a valid JavaScript Date.");const n=sc(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(Ri(n[0],n[1],t),vr(t),t):new J(n[0],n[1],Be.UTC)},J.fromIso8601=function(e,t){if(typeof e!="string")throw new C(Pn);e=e.replace(",",".");let n=e.split("T"),i,o=1,a=1,r=0,f=0,c=0,h=0;const d=n[0],p=n[1];let m,T;if(!l(d))throw new C(Pn);let y;if(n=d.match(V_),n!==null){if(y=d.split("-").length-1,y>0&&y!==2)throw new C(Pn);i=+n[1],o=+n[2],a=+n[3]}else if(n=d.match(M_),n!==null)i=+n[1],o=+n[2];else if(n=d.match(F_),n!==null)i=+n[1];else{let b;if(n=d.match(U_),n!==null){if(i=+n[1],b=+n[2],T=nc(i),b<1||T&&b>366||!T&&b>365)throw new C(Pn)}else if(n=d.match(k_),n!==null){i=+n[1];const I=+n[2],O=+n[3]||0;if(y=d.split("-").length-1,y>0&&(!l(n[3])&&y!==1||l(n[3])&&y!==2))throw new C(Pn);const B=new Date(Date.UTC(i,0,4));b=I*7+O-B.getUTCDay()-3}else throw new C(Pn);m=new Date(Date.UTC(i,0,1)),m.setUTCDate(b),o=m.getUTCMonth()+1,a=m.getUTCDate()}if(T=nc(i),o<1||o>12||a<1||(o!==2||!T)&&a>Dr[o-1]||T&&o===2&&a>Or)throw new C(Pn);let w;if(l(p)){if(n=p.match(H_),n!==null){if(y=p.split(":").length-1,y>0&&y!==2&&y!==3)throw new C(Pn);r=+n[1],f=+n[2],c=+n[3],h=+(n[4]||0)*1e3,w=5}else if(n=p.match(q_),n!==null){if(y=p.split(":").length-1,y>2)throw new C(Pn);r=+n[1],f=+n[2],c=+(n[3]||0)*60,w=4}else if(n=p.match(G_),n!==null)r=+n[1],f=+(n[2]||0)*60,w=3;else throw new C(Pn);if(f>=60||c>=61||r>24||r===24&&(f>0||c>0||h>0))throw new C(Pn);const b=n[w],I=+n[w+1],O=+(n[w+2]||0);switch(b){case"+":r=r-I,f=f-O;break;case"-":r=r+I,f=f+O;break;case"Z":break;default:f=f+new Date(Date.UTC(i,o-1,a,r,f)).getTimezoneOffset();break}}const A=c===60;for(A&&c--;f>=60;)f-=60,r++;for(;r>=24;)r-=24,a++;for(m=T&&o===2?Or:Dr[o-1];a>m;)a-=m,o++,o>12&&(o-=12,i++),m=T&&o===2?Or:Dr[o-1];for(;f<0;)f+=60,r--;for(;r<0;)r+=24,a--;for(;a<1;)o--,o<1&&(o+=12,i--),m=T&&o===2?Or:Dr[o-1],a+=m;const E=sc(i,o,a,r,f,c,h);return l(t)?(Ri(E[0],E[1],t),vr(t)):t=new J(E[0],E[1],Be.UTC),A&&J.addSeconds(t,1,t),t},J.now=function(e){return J.fromDate(new Date,e)};const Wr=new J(0,0,Be.TAI);J.toGregorianDate=function(e,t){if(!l(e))throw new C("julianDate is required.");let n=!1,i=Hf(e,Wr);l(i)||(J.addSeconds(e,-1,Wr),i=Hf(Wr,Wr),n=!0);let o=i.dayNumber;const a=i.secondsOfDay;a>=43200&&(o+=1);let r=o+68569|0;const f=4*r/146097|0;r=r-((146097*f+3)/4|0)|0;const c=4e3*(r+1)/1461001|0;r=r-(1461*c/4|0)+31|0;const h=80*r/2447|0,d=r-(2447*h/80|0)|0;r=h/11|0;const p=h+2-12*r|0,m=100*(f-49)+c+r|0;let T=a/ht.SECONDS_PER_HOUR|0,y=a-T*ht.SECONDS_PER_HOUR;const w=y/ht.SECONDS_PER_MINUTE|0;y=y-w*ht.SECONDS_PER_MINUTE;let A=y|0;const E=(y-A)/ht.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(A+=1),l(t)?(t.year=m,t.month=p,t.day=d,t.hour=T,t.minute=w,t.second=A,t.millisecond=E,t.isLeapSecond=n,t):new ic(m,p,d,T,w,A,E,n)},J.toDate=function(e){if(!l(e))throw new C("julianDate is required.");const t=J.toGregorianDate(e,qf);let n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},J.toIso8601=function(e,t){if(!l(e))throw new C("julianDate is required.");const n=J.toGregorianDate(e,qf);let i=n.year,o=n.month,a=n.day,r=n.hour;const f=n.minute,c=n.second,h=n.millisecond;i===1e4&&o===1&&a===1&&r===0&&f===0&&c===0&&h===0&&(i=9999,o=12,a=31,r=24);let d;return!l(t)&&h!==0?(d=(h*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(d=(h*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`)},J.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new J(e.dayNumber,e.secondsOfDay,Be.TAI)},J.compare=function(e,t){if(!l(e))throw new C("left is required.");if(!l(t))throw new C("right is required.");const n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay},J.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},J.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(J.secondsDifference(e,t))<=n},J.totalDays=function(e){if(!l(e))throw new C("julianDate is required.");return e.dayNumber+e.secondsOfDay/ht.SECONDS_PER_DAY},J.secondsDifference=function(e,t){if(!l(e))throw new C("left is required.");if(!l(t))throw new C("right is required.");return(e.dayNumber-t.dayNumber)*ht.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},J.daysDifference=function(e,t){if(!l(e))throw new C("left is required.");if(!l(t))throw new C("right is required.");const n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/ht.SECONDS_PER_DAY;return n+i},J.computeTaiMinusUtc=function(e){Io.julianDate=e;const t=J.leapSeconds;let n=is(t,Io,oc);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset},J.addSeconds=function(e,t,n){if(!l(e))throw new C("julianDate is required.");if(!l(t))throw new C("seconds is required.");if(!l(n))throw new C("result is required.");return Ri(e.dayNumber,e.secondsOfDay+t,n)},J.addMinutes=function(e,t,n){if(!l(e))throw new C("julianDate is required.");if(!l(t))throw new C("minutes is required.");if(!l(n))throw new C("result is required.");const i=e.secondsOfDay+t*ht.SECONDS_PER_MINUTE;return Ri(e.dayNumber,i,n)},J.addHours=function(e,t,n){if(!l(e))throw new C("julianDate is required.");if(!l(t))throw new C("hours is required.");if(!l(n))throw new C("result is required.");const i=e.secondsOfDay+t*ht.SECONDS_PER_HOUR;return Ri(e.dayNumber,i,n)},J.addDays=function(e,t,n){if(!l(e))throw new C("julianDate is required.");if(!l(t))throw new C("days is required.");if(!l(n))throw new C("result is required.");const i=e.dayNumber+t;return Ri(i,e.secondsOfDay,n)},J.lessThan=function(e,t){return J.compare(e,t)<0},J.lessThanOrEquals=function(e,t){return J.compare(e,t)<=0},J.greaterThan=function(e,t){return J.compare(e,t)>0},J.greaterThanOrEquals=function(e,t){return J.compare(e,t)>=0},J.prototype.clone=function(e){return J.clone(this,e)},J.prototype.equals=function(e){return J.equals(this,e)},J.prototype.equalsEpsilon=function(e,t){return J.equalsEpsilon(this,e,t)},J.prototype.toString=function(){return J.toIso8601(this)},J.leapSeconds=[new Ye(new J(2441317,43210,Be.TAI),10),new Ye(new J(2441499,43211,Be.TAI),11),new Ye(new J(2441683,43212,Be.TAI),12),new Ye(new J(2442048,43213,Be.TAI),13),new Ye(new J(2442413,43214,Be.TAI),14),new Ye(new J(2442778,43215,Be.TAI),15),new Ye(new J(2443144,43216,Be.TAI),16),new Ye(new J(2443509,43217,Be.TAI),17),new Ye(new J(2443874,43218,Be.TAI),18),new Ye(new J(2444239,43219,Be.TAI),19),new Ye(new J(2444786,43220,Be.TAI),20),new Ye(new J(2445151,43221,Be.TAI),21),new Ye(new J(2445516,43222,Be.TAI),22),new Ye(new J(2446247,43223,Be.TAI),23),new Ye(new J(2447161,43224,Be.TAI),24),new Ye(new J(2447892,43225,Be.TAI),25),new Ye(new J(2448257,43226,Be.TAI),26),new Ye(new J(2448804,43227,Be.TAI),27),new Ye(new J(2449169,43228,Be.TAI),28),new Ye(new J(2449534,43229,Be.TAI),29),new Ye(new J(2450083,43230,Be.TAI),30),new Ye(new J(2450630,43231,Be.TAI),31),new Ye(new J(2451179,43232,Be.TAI),32),new Ye(new J(2453736,43233,Be.TAI),33),new Ye(new J(2454832,43234,Be.TAI),34),new Ye(new J(2456109,43235,Be.TAI),35),new Ye(new J(2457204,43236,Be.TAI),36),new Ye(new J(2457754,43237,Be.TAI),37)];var jf={exports:{}},os={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */os.exports;var Yf;function j_(){return Yf||(Yf=1,function(e,t){(function(n){var i=t&&!t.nodeType&&t,o=e&&!e.nodeType&&e,a=typeof Ao=="object"&&Ao;(a.global===a||a.window===a||a.self===a)&&(n=a);var r,f=2147483647,c=36,h=1,d=26,p=38,m=700,T=72,y=128,w="-",A=/^xn--/,E=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,I={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=c-h,B=Math.floor,L=String.fromCharCode,F;function N(K){throw new RangeError(I[K])}function U(K,ce){for(var le=K.length,we=[];le--;)we[le]=ce(K[le]);return we}function M(K,ce){var le=K.split("@"),we="";le.length>1&&(we=le[0]+"@",K=le[1]),K=K.replace(b,".");var Se=K.split("."),Ee=U(Se,ce).join(".");return we+Ee}function j(K){for(var ce=[],le=0,we=K.length,Se,Ee;le<we;)Se=K.charCodeAt(le++),Se>=55296&&Se<=56319&&le<we?(Ee=K.charCodeAt(le++),(Ee&64512)==56320?ce.push(((Se&1023)<<10)+(Ee&1023)+65536):(ce.push(Se),le--)):ce.push(Se);return ce}function Y(K){return U(K,function(ce){var le="";return ce>65535&&(ce-=65536,le+=L(ce>>>10&1023|55296),ce=56320|ce&1023),le+=L(ce),le}).join("")}function s(K){return K-48<10?K-22:K-65<26?K-65:K-97<26?K-97:c}function x(K,ce){return K+22+75*(K<26)-((ce!=0)<<5)}function P(K,ce,le){var we=0;for(K=le?B(K/m):K>>1,K+=B(K/ce);K>O*d>>1;we+=c)K=B(K/O);return B(we+(O+1)*K/(K+p))}function z(K){var ce=[],le=K.length,we,Se=0,Ee=y,Le=T,Ke,ct,gt,Fe,At,Wt,Et,pn,mn;for(Ke=K.lastIndexOf(w),Ke<0&&(Ke=0),ct=0;ct<Ke;++ct)K.charCodeAt(ct)>=128&&N("not-basic"),ce.push(K.charCodeAt(ct));for(gt=Ke>0?Ke+1:0;gt<le;){for(Fe=Se,At=1,Wt=c;gt>=le&&N("invalid-input"),Et=s(K.charCodeAt(gt++)),(Et>=c||Et>B((f-Se)/At))&&N("overflow"),Se+=Et*At,pn=Wt<=Le?h:Wt>=Le+d?d:Wt-Le,!(Et<pn);Wt+=c)mn=c-pn,At>B(f/mn)&&N("overflow"),At*=mn;we=ce.length+1,Le=P(Se-Fe,we,Fe==0),B(Se/we)>f-Ee&&N("overflow"),Ee+=B(Se/we),Se%=we,ce.splice(Se++,0,Ee)}return Y(ce)}function H(K){var ce,le,we,Se,Ee,Le,Ke,ct,gt,Fe,At,Wt=[],Et,pn,mn,Yn;for(K=j(K),Et=K.length,ce=y,le=0,Ee=T,Le=0;Le<Et;++Le)At=K[Le],At<128&&Wt.push(L(At));for(we=Se=Wt.length,Se&&Wt.push(w);we<Et;){for(Ke=f,Le=0;Le<Et;++Le)At=K[Le],At>=ce&&At<Ke&&(Ke=At);for(pn=we+1,Ke-ce>B((f-le)/pn)&&N("overflow"),le+=(Ke-ce)*pn,ce=Ke,Le=0;Le<Et;++Le)if(At=K[Le],At<ce&&++le>f&&N("overflow"),At==ce){for(ct=le,gt=c;Fe=gt<=Ee?h:gt>=Ee+d?d:gt-Ee,!(ct<Fe);gt+=c)Yn=ct-Fe,mn=c-Fe,Wt.push(L(x(Fe+Yn%mn,0))),ct=B(Yn/mn);Wt.push(L(x(ct,0))),Ee=P(le,pn,we==Se),le=0,++we}++le,++ce}return Wt.join("")}function X(K){return M(K,function(ce){return A.test(ce)?z(ce.slice(4).toLowerCase()):ce})}function ee(K){return M(K,function(ce){return E.test(ce)?"xn--"+H(ce):ce})}if(r={version:"1.3.2",ucs2:{decode:j,encode:Y},decode:z,encode:H,toASCII:ee,toUnicode:X},i&&o)if(e.exports==i)o.exports=r;else for(F in r)r.hasOwnProperty(F)&&(i[F]=r[F]);else n.punycode=r})(Ao)}(os,os.exports)),os.exports}var ac={exports:{}};/*!
8
+ (${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};const R=Object.freeze({DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047}),c_=new u;function fe(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}const Lt={};Lt[R.FLOAT]="float",Lt[R.FLOAT_VEC2]="vec2",Lt[R.FLOAT_VEC3]="vec3",Lt[R.FLOAT_VEC4]="vec4",Lt[R.INT]="int",Lt[R.INT_VEC2]="ivec2",Lt[R.INT_VEC3]="ivec3",Lt[R.INT_VEC4]="ivec4",Lt[R.BOOL]="bool",Lt[R.BOOL_VEC2]="bvec2",Lt[R.BOOL_VEC3]="bvec3",Lt[R.BOOL_VEC4]="bvec4",Lt[R.FLOAT_MAT2]="mat2",Lt[R.FLOAT_MAT3]="mat3",Lt[R.FLOAT_MAT4]="mat4",Lt[R.SAMPLER_2D]="sampler2D",Lt[R.SAMPLER_CUBE]="samplerCube",fe.prototype.getDeclaration=function(e){let t=`uniform ${Lt[this._datatype]} ${e}`;const n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};const gr={czm_viewport:new fe({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new fe({size:1,datatype:R.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new fe({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new fe({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new fe({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new fe({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new fe({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new fe({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return k.getTranslation(e.inverseView,c_)}}),czm_frameNumber:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new fe({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new fe({size:1,datatype:R.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new fe({size:1,datatype:R.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new fe({size:1,datatype:R.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new fe({size:9,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new fe({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogMinimumBrightness:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new fe({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new fe({size:1,datatype:R.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new fe({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})};function Yn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function h_(){return!0}function st(e,t){t=g(t,"This object was destroyed, i.e., destroy() was called.");function n(){throw new C(t)}for(const i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=h_}const Pt={UNSIGNED_BYTE:R.UNSIGNED_BYTE,UNSIGNED_SHORT:R.UNSIGNED_SHORT,UNSIGNED_INT:R.UNSIGNED_INT};Pt.getSizeInBytes=function(e){switch(e){case Pt.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Pt.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Pt.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new C("indexDatatype is required and must be a valid IndexDatatype constant.")},Pt.fromSizeInBytes=function(e){switch(e){case 2:return Pt.UNSIGNED_SHORT;case 4:return Pt.UNSIGNED_INT;case 1:return Pt.UNSIGNED_BYTE;default:throw new C("Size in bytes cannot be mapped to an IndexDatatype")}},Pt.validate=function(e){return l(e)&&(e===Pt.UNSIGNED_BYTE||e===Pt.UNSIGNED_SHORT||e===Pt.UNSIGNED_INT)},Pt.createTypedArray=function(e,t){if(!l(e))throw new C("numberOfVertices is required.");return e>=S.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},Pt.createTypedArrayFromArrayBuffer=function(e,t,n,i){if(!l(e))throw new C("numberOfVertices is required.");if(!l(t))throw new C("sourceArray is required.");if(!l(n))throw new C("byteOffset is required.");return e>=S.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},Pt.fromTypedArray=function(e){if(e instanceof Uint8Array)return Pt.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Pt.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Pt.UNSIGNED_INT;throw new C("array must be a Uint8Array, Uint16Array, or Uint32Array.")};const bt=Object.freeze(Pt),Tr={STREAM_DRAW:R.STREAM_DRAW,STATIC_DRAW:R.STATIC_DRAW,DYNAMIC_DRAW:R.DYNAMIC_DRAW,validate:function(e){return e===Tr.STREAM_DRAW||e===Tr.STATIC_DRAW||e===Tr.DYNAMIC_DRAW}},We=Object.freeze(Tr);function Bt(e){if(e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context),!l(e.typedArray)&&!l(e.sizeInBytes))throw new C("Either options.sizeInBytes or options.typedArray is required.");if(l(e.typedArray)&&l(e.sizeInBytes))throw new C("Cannot pass in both options.sizeInBytes and options.typedArray.");if(l(e.typedArray)&&(_.typeOf.object("options.typedArray",e.typedArray),_.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!We.validate(e.usage))throw new C("usage is invalid.");const t=e.context._gl,n=e.bufferTarget,i=e.typedArray;let o=e.sizeInBytes;const a=e.usage,r=l(i);r&&(o=i.byteLength),_.typeOf.number.greaterThan("sizeInBytes",o,0);const f=t.createBuffer();t.bindBuffer(n,f),t.bufferData(n,r?i:o,a),t.bindBuffer(n,null),this._id=Yn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=a,this._buffer=f,this.vertexArrayDestroyable=!0}Bt.createVertexBuffer=function(e){return _.defined("options.context",e.context),new Bt({context:e.context,bufferTarget:R.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},Bt.createIndexBuffer=function(e){if(_.defined("options.context",e.context),!bt.validate(e.indexDatatype))throw new C("Invalid indexDatatype.");if(e.indexDatatype===bt.UNSIGNED_INT&&!e.context.elementIndexUint)throw new C("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.");const t=e.context,n=e.indexDatatype,i=bt.getSizeInBytes(n),o=new Bt({context:t,bufferTarget:R.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),a=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return a}}}),o},Object.defineProperties(Bt.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),Bt.prototype._getBuffer=function(){return this._buffer},Bt.prototype.copyFromArrayView=function(e,t){t=g(t,0),_.defined("arrayView",e),_.typeOf.number.lessThanOrEquals("offsetInBytes + arrayView.byteLength",t+e.byteLength,this._sizeInBytes);const n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)},Bt.prototype.copyFromBuffer=function(e,t,n,i){if(!this._webgl2)throw new C("A WebGL 2 context is required.");if(!l(e))throw new C("readBuffer must be defined.");if(!l(i)||i<=0)throw new C("sizeInBytes must be defined and be greater than zero.");if(!l(t)||t<0||t+i>e._sizeInBytes)throw new C("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!l(n)||n<0||n+i>this._sizeInBytes)throw new C("writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.");if(this._buffer===e._buffer&&(n>=t&&n<t+i||t>n&&t<n+i))throw new C("When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.");if(this._bufferTarget===R.ELEMENT_ARRAY_BUFFER&&e._bufferTarget!==R.ELEMENT_ARRAY_BUFFER||this._bufferTarget!==R.ELEMENT_ARRAY_BUFFER&&e._bufferTarget===R.ELEMENT_ARRAY_BUFFER)throw new C("Can not copy an index buffer into another buffer type.");const o=R.COPY_READ_BUFFER,a=R.COPY_WRITE_BUFFER,r=this._gl;r.bindBuffer(a,this._buffer),r.bindBuffer(o,e._buffer),r.copyBufferSubData(o,a,t,n,i),r.bindBuffer(a,null),r.bindBuffer(o,null)},Bt.prototype.getBufferData=function(e,t,n,i){if(t=g(t,0),n=g(n,0),!this._webgl2)throw new C("A WebGL 2 context is required.");if(!l(e))throw new C("arrayView is required.");let o,a,r=e.byteLength;if(l(i)?(o=i,l(r)?a=1:(r=e.length,a=e.BYTES_PER_ELEMENT)):l(r)?(o=r-n,a=1):(r=e.length,o=r-n,a=e.BYTES_PER_ELEMENT),n<0||n>r)throw new C("destinationOffset must be greater than zero and less than the arrayView length.");if(n+o>r)throw new C("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new C("sourceOffset must be greater than zero and less than the buffers size.");if(t+o*a>this._sizeInBytes)throw new C("sourceOffset + length must be less than the buffers size.");const f=this._gl,c=R.COPY_READ_BUFFER;f.bindBuffer(c,this._buffer),f.getBufferSubData(c,t,e,n,i),f.bindBuffer(c,null)},Bt.prototype.isDestroyed=function(){return!1},Bt.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),st(this)};let Bi;const pt={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},an={};Object.defineProperties(an,{element:{get:function(){if(an.supportsFullscreen())return document[pt.fullscreenElement]}},changeEventName:{get:function(){if(an.supportsFullscreen())return pt.fullscreenchange}},errorEventName:{get:function(){if(an.supportsFullscreen())return pt.fullscreenerror}},enabled:{get:function(){if(an.supportsFullscreen())return document[pt.fullscreenEnabled]}},fullscreen:{get:function(){if(an.supportsFullscreen())return an.element!==null}}}),an.supportsFullscreen=function(){if(l(Bi))return Bi;Bi=!1;const e=document.body;if(typeof e.requestFullscreen=="function")return pt.requestFullscreen="requestFullscreen",pt.exitFullscreen="exitFullscreen",pt.fullscreenEnabled="fullscreenEnabled",pt.fullscreenElement="fullscreenElement",pt.fullscreenchange="fullscreenchange",pt.fullscreenerror="fullscreenerror",Bi=!0,Bi;const t=["webkit","moz","o","ms","khtml"];let n;for(let i=0,o=t.length;i<o;++i){const a=t[i];n=`${a}RequestFullscreen`,typeof e[n]=="function"?(pt.requestFullscreen=n,Bi=!0):(n=`${a}RequestFullScreen`,typeof e[n]=="function"&&(pt.requestFullscreen=n,Bi=!0)),n=`${a}ExitFullscreen`,typeof document[n]=="function"?pt.exitFullscreen=n:(n=`${a}CancelFullScreen`,typeof document[n]=="function"&&(pt.exitFullscreen=n)),n=`${a}FullscreenEnabled`,document[n]!==void 0?pt.fullscreenEnabled=n:(n=`${a}FullScreenEnabled`,document[n]!==void 0&&(pt.fullscreenEnabled=n)),n=`${a}FullscreenElement`,document[n]!==void 0?pt.fullscreenElement=n:(n=`${a}FullScreenElement`,document[n]!==void 0&&(pt.fullscreenElement=n)),n=`${a}fullscreenchange`,document[`on${n}`]!==void 0&&(a==="ms"&&(n="MSFullscreenChange"),pt.fullscreenchange=n),n=`${a}fullscreenerror`,document[`on${n}`]!==void 0&&(a==="ms"&&(n="MSFullscreenError"),pt.fullscreenerror=n)}return Bi},an.requestFullscreen=function(e,t){an.supportsFullscreen()&&e[pt.requestFullscreen]({vrDisplay:t})},an.exitFullscreen=function(){an.supportsFullscreen()&&document[pt.exitFullscreen]()},an._names=pt;let Yt;typeof navigator<"u"?Yt=navigator:Yt={};function Qi(e){const t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}let yr,Of;function Ha(){if(!l(yr)&&(yr=!1,!Er())){const e=/ Chrome\/([\.0-9]+)/.exec(Yt.userAgent);e!==null&&(yr=!0,Of=Qi(e[1]))}return yr}function f_(){return Ha()&&Of}let Cr,vf;function Wf(){if(!l(Cr)&&(Cr=!1,!Ha()&&!Er()&&/ Safari\/[\.0-9]+/.test(Yt.userAgent))){const e=/ Version\/([\.0-9]+)/.exec(Yt.userAgent);e!==null&&(Cr=!0,vf=Qi(e[1]))}return Cr}function l_(){return Wf()&&vf}let wr,ja;function Pf(){if(!l(wr)){wr=!1;const e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Yt.userAgent);e!==null&&(wr=!0,ja=Qi(e[1]),ja.isNightly=!!e[2])}return wr}function u_(){return Pf()&&ja}let ns,Ya;function Bf(){if(!l(ns)){ns=!1;let e;Yt.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Yt.userAgent),e!==null&&(ns=!0,Ya=Qi(e[1]))):Yt.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Yt.userAgent),e!==null&&(ns=!0,Ya=Qi(e[1])))}return ns}function d_(){return Bf()&&Ya}let Ar,Rf;function Er(){if(!l(Ar)){Ar=!1;const e=/ Edg\/([\.0-9]+)/.exec(Yt.userAgent);e!==null&&(Ar=!0,Rf=Qi(e[1]))}return Ar}function p_(){return Er()&&Rf}let br,Xa;function xr(){if(!l(br)){br=!1;const e=/Firefox\/([\.0-9]+)/.exec(Yt.userAgent);e!==null&&(br=!0,Xa=Qi(e[1]))}return br}let $a;function m_(){return l($a)||($a=/Windows/i.test(Yt.appVersion)),$a}let Za;function __(){return l(Za)||(Za=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),Za}function g_(){return xr()&&Xa}let Ka;function T_(){return l(Ka)||(Ka=!xr()&&typeof PointerEvent<"u"&&(!l(Yt.pointerEnabled)||Yt.pointerEnabled)),Ka}let zf,Sr;function Lf(){if(!l(Sr)){const e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const t=e.style.imageRendering;Sr=l(t)&&t!=="",Sr&&(zf=t)}return Sr}function y_(){return Lf()?zf:void 0}function Xt(){if(!Xt.initialized)throw new C("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return Xt._result}Xt._promise=void 0,Xt._result=void 0,Xt.initialize=function(){return l(Xt._promise)||(Xt._promise=new Promise(e=>{const t=new Image;t.onload=function(){Xt._result=t.width>0&&t.height>0,e(Xt._result)},t.onerror=function(){Xt._result=!1,e(Xt._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Xt._promise},Object.defineProperties(Xt,{initialized:{get:function(){return l(Xt._result)}}});const xo=[];typeof ArrayBuffer<"u"&&(xo.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&xo.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&xo.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&xo.push(BigInt64Array),typeof BigUint64Array<"u"&&xo.push(BigUint64Array));const Ct={isChrome:Ha,chromeVersion:f_,isSafari:Wf,safariVersion:l_,isWebkit:Pf,webkitVersion:u_,isInternetExplorer:Bf,internetExplorerVersion:d_,isEdge:Er,edgeVersion:p_,isFirefox:xr,firefoxVersion:g_,isWindows:m_,isIPadOrIOS:__,hardwareConcurrency:g(Yt.hardwareConcurrency,3),supportsPointerEvents:T_,supportsImageRenderingPixelated:Lf,supportsWebP:Xt,imageRenderingValue:y_,typedArrayTypes:xo};Ct.supportsBasis=function(e){return Ct.supportsWebAssembly()&&e.context.supportsBasis},Ct.supportsFullscreen=function(){return an.supportsFullscreen()},Ct.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"},Ct.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"},Ct.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"},Ct.supportsBigInt=function(){return typeof BigInt<"u"},Ct.supportsWebWorkers=function(){return typeof Worker<"u"},Ct.supportsWebAssembly=function(){return typeof WebAssembly<"u"},Ct.supportsWebgl2=function(e){return _.defined("scene",e),e.context.webgl2},Ct.supportsEsmWebWorkers=function(){return!xr()||parseInt(Xa)>=114};function Qa(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function I(e,t,n,i){this.red=g(e,1),this.green=g(t,1),this.blue=g(n,1),this.alpha=g(i,1)}I.fromCartesian4=function(e,t){return _.typeOf.object("cartesian",e),l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new I(e.x,e.y,e.z,e.w)},I.fromBytes=function(e,t,n,i,o){return e=I.byteToFloat(g(e,255)),t=I.byteToFloat(g(t,255)),n=I.byteToFloat(g(n,255)),i=I.byteToFloat(g(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new I(e,t,n,i)},I.fromAlpha=function(e,t,n){return _.typeOf.object("color",e),_.typeOf.number("alpha",t),l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new I(e.red,e.green,e.blue,t)};let Ja,ec,pi;Ct.supportsTypedArrays()&&(Ja=new ArrayBuffer(4),ec=new Uint32Array(Ja),pi=new Uint8Array(Ja)),I.fromRgba=function(e,t){return ec[0]=e,I.fromBytes(pi[0],pi[1],pi[2],pi[3],t)},I.fromHsl=function(e,t,n,i,o){e=g(e,0)%1,t=g(t,0),n=g(n,0),i=g(i,1);let a=n,r=n,f=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;const h=2*n-c;a=Qa(h,c,e+1/3),r=Qa(h,c,e),f=Qa(h,c,e-1/3)}return l(o)?(o.red=a,o.green=r,o.blue=f,o.alpha=i,o):new I(a,r,f,i)},I.fromRandom=function(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.red;if(!l(n)){const r=g(e.minimumRed,0),f=g(e.maximumRed,1);_.typeOf.number.lessThanOrEquals("minimumRed",r,f),n=r+S.nextRandomNumber()*(f-r)}let i=e.green;if(!l(i)){const r=g(e.minimumGreen,0),f=g(e.maximumGreen,1);_.typeOf.number.lessThanOrEquals("minimumGreen",r,f),i=r+S.nextRandomNumber()*(f-r)}let o=e.blue;if(!l(o)){const r=g(e.minimumBlue,0),f=g(e.maximumBlue,1);_.typeOf.number.lessThanOrEquals("minimumBlue",r,f),o=r+S.nextRandomNumber()*(f-r)}let a=e.alpha;if(!l(a)){const r=g(e.minimumAlpha,0),f=g(e.maximumAlpha,1);_.typeOf.number.lessThanOrEquals("minumumAlpha",r,f),a=r+S.nextRandomNumber()*(f-r)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=a,t):new I(n,i,o,a)};const C_=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,w_=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,A_=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,E_=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;I.fromCssColorString=function(e,t){_.typeOf.string("color",e),l(t)||(t=new I),e=e.trim();const n=I[e.toUpperCase()];if(l(n))return I.clone(n,t),t;let i=C_.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(g(i[4],"f"),16)/15,t):(i=w_.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(g(i[4],"ff"),16)/255,t):(i=A_.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(g(i[4],"1.0")),t):(i=E_.exec(e),i!==null?I.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(g(i[4],"1.0")),t):(t=void 0,t))))},I.packedLength=4,I.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t},I.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new I),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n},I.byteToFloat=function(e){return e/255},I.floatToByte=function(e){return e===1?255:e*256|0},I.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new I(e.red,e.green,e.blue,e.alpha)},I.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},I.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]},I.prototype.clone=function(e){return I.clone(this,e)},I.prototype.equals=function(e){return I.equals(this,e)},I.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t},I.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`},I.prototype.toCssColorString=function(){const e=I.floatToByte(this.red),t=I.floatToByte(this.green),n=I.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`},I.prototype.toCssHexString=function(){let e=I.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=I.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=I.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=I.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`},I.prototype.toBytes=function(e){const t=I.floatToByte(this.red),n=I.floatToByte(this.green),i=I.floatToByte(this.blue),o=I.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]},I.prototype.toRgba=function(){return pi[0]=I.floatToByte(this.red),pi[1]=I.floatToByte(this.green),pi[2]=I.floatToByte(this.blue),pi[3]=I.floatToByte(this.alpha),ec[0]},I.prototype.brighten=function(e,t){return _.typeOf.number("magnitude",e),_.typeOf.number.greaterThanOrEquals("magnitude",e,0),_.typeOf.object("result",t),e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},I.prototype.darken=function(e,t){return _.typeOf.number("magnitude",e),_.typeOf.number.greaterThanOrEquals("magnitude",e,0),_.typeOf.object("result",t),e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},I.prototype.withAlpha=function(e,t){return I.fromAlpha(this,e,t)},I.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n},I.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n},I.multiply=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n},I.divide=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n},I.mod=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n},I.lerp=function(e,t,n,i){return _.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i),i.red=S.lerp(e.red,t.red,n),i.green=S.lerp(e.green,t.green,n),i.blue=S.lerp(e.blue,t.blue,n),i.alpha=S.lerp(e.alpha,t.alpha,n),i},I.multiplyByScalar=function(e,t,n){return _.typeOf.object("color",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n},I.divideByScalar=function(e,t,n){return _.typeOf.object("color",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n},I.ALICEBLUE=Object.freeze(I.fromCssColorString("#F0F8FF")),I.ANTIQUEWHITE=Object.freeze(I.fromCssColorString("#FAEBD7")),I.AQUA=Object.freeze(I.fromCssColorString("#00FFFF")),I.AQUAMARINE=Object.freeze(I.fromCssColorString("#7FFFD4")),I.AZURE=Object.freeze(I.fromCssColorString("#F0FFFF")),I.BEIGE=Object.freeze(I.fromCssColorString("#F5F5DC")),I.BISQUE=Object.freeze(I.fromCssColorString("#FFE4C4")),I.BLACK=Object.freeze(I.fromCssColorString("#000000")),I.BLANCHEDALMOND=Object.freeze(I.fromCssColorString("#FFEBCD")),I.BLUE=Object.freeze(I.fromCssColorString("#0000FF")),I.BLUEVIOLET=Object.freeze(I.fromCssColorString("#8A2BE2")),I.BROWN=Object.freeze(I.fromCssColorString("#A52A2A")),I.BURLYWOOD=Object.freeze(I.fromCssColorString("#DEB887")),I.CADETBLUE=Object.freeze(I.fromCssColorString("#5F9EA0")),I.CHARTREUSE=Object.freeze(I.fromCssColorString("#7FFF00")),I.CHOCOLATE=Object.freeze(I.fromCssColorString("#D2691E")),I.CORAL=Object.freeze(I.fromCssColorString("#FF7F50")),I.CORNFLOWERBLUE=Object.freeze(I.fromCssColorString("#6495ED")),I.CORNSILK=Object.freeze(I.fromCssColorString("#FFF8DC")),I.CRIMSON=Object.freeze(I.fromCssColorString("#DC143C")),I.CYAN=Object.freeze(I.fromCssColorString("#00FFFF")),I.DARKBLUE=Object.freeze(I.fromCssColorString("#00008B")),I.DARKCYAN=Object.freeze(I.fromCssColorString("#008B8B")),I.DARKGOLDENROD=Object.freeze(I.fromCssColorString("#B8860B")),I.DARKGRAY=Object.freeze(I.fromCssColorString("#A9A9A9")),I.DARKGREEN=Object.freeze(I.fromCssColorString("#006400")),I.DARKGREY=I.DARKGRAY,I.DARKKHAKI=Object.freeze(I.fromCssColorString("#BDB76B")),I.DARKMAGENTA=Object.freeze(I.fromCssColorString("#8B008B")),I.DARKOLIVEGREEN=Object.freeze(I.fromCssColorString("#556B2F")),I.DARKORANGE=Object.freeze(I.fromCssColorString("#FF8C00")),I.DARKORCHID=Object.freeze(I.fromCssColorString("#9932CC")),I.DARKRED=Object.freeze(I.fromCssColorString("#8B0000")),I.DARKSALMON=Object.freeze(I.fromCssColorString("#E9967A")),I.DARKSEAGREEN=Object.freeze(I.fromCssColorString("#8FBC8F")),I.DARKSLATEBLUE=Object.freeze(I.fromCssColorString("#483D8B")),I.DARKSLATEGRAY=Object.freeze(I.fromCssColorString("#2F4F4F")),I.DARKSLATEGREY=I.DARKSLATEGRAY,I.DARKTURQUOISE=Object.freeze(I.fromCssColorString("#00CED1")),I.DARKVIOLET=Object.freeze(I.fromCssColorString("#9400D3")),I.DEEPPINK=Object.freeze(I.fromCssColorString("#FF1493")),I.DEEPSKYBLUE=Object.freeze(I.fromCssColorString("#00BFFF")),I.DIMGRAY=Object.freeze(I.fromCssColorString("#696969")),I.DIMGREY=I.DIMGRAY,I.DODGERBLUE=Object.freeze(I.fromCssColorString("#1E90FF")),I.FIREBRICK=Object.freeze(I.fromCssColorString("#B22222")),I.FLORALWHITE=Object.freeze(I.fromCssColorString("#FFFAF0")),I.FORESTGREEN=Object.freeze(I.fromCssColorString("#228B22")),I.FUCHSIA=Object.freeze(I.fromCssColorString("#FF00FF")),I.GAINSBORO=Object.freeze(I.fromCssColorString("#DCDCDC")),I.GHOSTWHITE=Object.freeze(I.fromCssColorString("#F8F8FF")),I.GOLD=Object.freeze(I.fromCssColorString("#FFD700")),I.GOLDENROD=Object.freeze(I.fromCssColorString("#DAA520")),I.GRAY=Object.freeze(I.fromCssColorString("#808080")),I.GREEN=Object.freeze(I.fromCssColorString("#008000")),I.GREENYELLOW=Object.freeze(I.fromCssColorString("#ADFF2F")),I.GREY=I.GRAY,I.HONEYDEW=Object.freeze(I.fromCssColorString("#F0FFF0")),I.HOTPINK=Object.freeze(I.fromCssColorString("#FF69B4")),I.INDIANRED=Object.freeze(I.fromCssColorString("#CD5C5C")),I.INDIGO=Object.freeze(I.fromCssColorString("#4B0082")),I.IVORY=Object.freeze(I.fromCssColorString("#FFFFF0")),I.KHAKI=Object.freeze(I.fromCssColorString("#F0E68C")),I.LAVENDER=Object.freeze(I.fromCssColorString("#E6E6FA")),I.LAVENDAR_BLUSH=Object.freeze(I.fromCssColorString("#FFF0F5")),I.LAWNGREEN=Object.freeze(I.fromCssColorString("#7CFC00")),I.LEMONCHIFFON=Object.freeze(I.fromCssColorString("#FFFACD")),I.LIGHTBLUE=Object.freeze(I.fromCssColorString("#ADD8E6")),I.LIGHTCORAL=Object.freeze(I.fromCssColorString("#F08080")),I.LIGHTCYAN=Object.freeze(I.fromCssColorString("#E0FFFF")),I.LIGHTGOLDENRODYELLOW=Object.freeze(I.fromCssColorString("#FAFAD2")),I.LIGHTGRAY=Object.freeze(I.fromCssColorString("#D3D3D3")),I.LIGHTGREEN=Object.freeze(I.fromCssColorString("#90EE90")),I.LIGHTGREY=I.LIGHTGRAY,I.LIGHTPINK=Object.freeze(I.fromCssColorString("#FFB6C1")),I.LIGHTSEAGREEN=Object.freeze(I.fromCssColorString("#20B2AA")),I.LIGHTSKYBLUE=Object.freeze(I.fromCssColorString("#87CEFA")),I.LIGHTSLATEGRAY=Object.freeze(I.fromCssColorString("#778899")),I.LIGHTSLATEGREY=I.LIGHTSLATEGRAY,I.LIGHTSTEELBLUE=Object.freeze(I.fromCssColorString("#B0C4DE")),I.LIGHTYELLOW=Object.freeze(I.fromCssColorString("#FFFFE0")),I.LIME=Object.freeze(I.fromCssColorString("#00FF00")),I.LIMEGREEN=Object.freeze(I.fromCssColorString("#32CD32")),I.LINEN=Object.freeze(I.fromCssColorString("#FAF0E6")),I.MAGENTA=Object.freeze(I.fromCssColorString("#FF00FF")),I.MAROON=Object.freeze(I.fromCssColorString("#800000")),I.MEDIUMAQUAMARINE=Object.freeze(I.fromCssColorString("#66CDAA")),I.MEDIUMBLUE=Object.freeze(I.fromCssColorString("#0000CD")),I.MEDIUMORCHID=Object.freeze(I.fromCssColorString("#BA55D3")),I.MEDIUMPURPLE=Object.freeze(I.fromCssColorString("#9370DB")),I.MEDIUMSEAGREEN=Object.freeze(I.fromCssColorString("#3CB371")),I.MEDIUMSLATEBLUE=Object.freeze(I.fromCssColorString("#7B68EE")),I.MEDIUMSPRINGGREEN=Object.freeze(I.fromCssColorString("#00FA9A")),I.MEDIUMTURQUOISE=Object.freeze(I.fromCssColorString("#48D1CC")),I.MEDIUMVIOLETRED=Object.freeze(I.fromCssColorString("#C71585")),I.MIDNIGHTBLUE=Object.freeze(I.fromCssColorString("#191970")),I.MINTCREAM=Object.freeze(I.fromCssColorString("#F5FFFA")),I.MISTYROSE=Object.freeze(I.fromCssColorString("#FFE4E1")),I.MOCCASIN=Object.freeze(I.fromCssColorString("#FFE4B5")),I.NAVAJOWHITE=Object.freeze(I.fromCssColorString("#FFDEAD")),I.NAVY=Object.freeze(I.fromCssColorString("#000080")),I.OLDLACE=Object.freeze(I.fromCssColorString("#FDF5E6")),I.OLIVE=Object.freeze(I.fromCssColorString("#808000")),I.OLIVEDRAB=Object.freeze(I.fromCssColorString("#6B8E23")),I.ORANGE=Object.freeze(I.fromCssColorString("#FFA500")),I.ORANGERED=Object.freeze(I.fromCssColorString("#FF4500")),I.ORCHID=Object.freeze(I.fromCssColorString("#DA70D6")),I.PALEGOLDENROD=Object.freeze(I.fromCssColorString("#EEE8AA")),I.PALEGREEN=Object.freeze(I.fromCssColorString("#98FB98")),I.PALETURQUOISE=Object.freeze(I.fromCssColorString("#AFEEEE")),I.PALEVIOLETRED=Object.freeze(I.fromCssColorString("#DB7093")),I.PAPAYAWHIP=Object.freeze(I.fromCssColorString("#FFEFD5")),I.PEACHPUFF=Object.freeze(I.fromCssColorString("#FFDAB9")),I.PERU=Object.freeze(I.fromCssColorString("#CD853F")),I.PINK=Object.freeze(I.fromCssColorString("#FFC0CB")),I.PLUM=Object.freeze(I.fromCssColorString("#DDA0DD")),I.POWDERBLUE=Object.freeze(I.fromCssColorString("#B0E0E6")),I.PURPLE=Object.freeze(I.fromCssColorString("#800080")),I.RED=Object.freeze(I.fromCssColorString("#FF0000")),I.ROSYBROWN=Object.freeze(I.fromCssColorString("#BC8F8F")),I.ROYALBLUE=Object.freeze(I.fromCssColorString("#4169E1")),I.SADDLEBROWN=Object.freeze(I.fromCssColorString("#8B4513")),I.SALMON=Object.freeze(I.fromCssColorString("#FA8072")),I.SANDYBROWN=Object.freeze(I.fromCssColorString("#F4A460")),I.SEAGREEN=Object.freeze(I.fromCssColorString("#2E8B57")),I.SEASHELL=Object.freeze(I.fromCssColorString("#FFF5EE")),I.SIENNA=Object.freeze(I.fromCssColorString("#A0522D")),I.SILVER=Object.freeze(I.fromCssColorString("#C0C0C0")),I.SKYBLUE=Object.freeze(I.fromCssColorString("#87CEEB")),I.SLATEBLUE=Object.freeze(I.fromCssColorString("#6A5ACD")),I.SLATEGRAY=Object.freeze(I.fromCssColorString("#708090")),I.SLATEGREY=I.SLATEGRAY,I.SNOW=Object.freeze(I.fromCssColorString("#FFFAFA")),I.SPRINGGREEN=Object.freeze(I.fromCssColorString("#00FF7F")),I.STEELBLUE=Object.freeze(I.fromCssColorString("#4682B4")),I.TAN=Object.freeze(I.fromCssColorString("#D2B48C")),I.TEAL=Object.freeze(I.fromCssColorString("#008080")),I.THISTLE=Object.freeze(I.fromCssColorString("#D8BFD8")),I.TOMATO=Object.freeze(I.fromCssColorString("#FF6347")),I.TURQUOISE=Object.freeze(I.fromCssColorString("#40E0D0")),I.VIOLET=Object.freeze(I.fromCssColorString("#EE82EE")),I.WHEAT=Object.freeze(I.fromCssColorString("#F5DEB3")),I.WHITE=Object.freeze(I.fromCssColorString("#FFFFFF")),I.WHITESMOKE=Object.freeze(I.fromCssColorString("#F5F5F5")),I.YELLOW=Object.freeze(I.fromCssColorString("#FFFF00")),I.YELLOWGREEN=Object.freeze(I.fromCssColorString("#9ACD32")),I.TRANSPARENT=Object.freeze(new I(0,0,0,0));const Nt=Object.freeze({ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11});function q(e,t){this.x=g(e,0),this.y=g(t,0)}q.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new q(e,t)},q.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new q(e.x,e.y)},q.fromCartesian3=q.clone,q.fromCartesian4=q.clone,q.packedLength=2,q.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.x,t[n]=e.y,t},q.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new q),n.x=e[t++],n.y=e[t],n},q.packArray=function(e,t){_.defined("array",e);const n=e.length,i=n*2;if(!l(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)q.pack(e[o],t,o*2);return t},q.unpackArray=function(e,t){if(_.defined("array",e),_.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)throw new C("array length must be a multiple of 2.");const n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){const o=i/2;t[o]=q.unpack(e,i,t[o])}return t},q.fromArray=q.unpack,q.maximumComponent=function(e){return _.typeOf.object("cartesian",e),Math.max(e.x,e.y)},q.minimumComponent=function(e){return _.typeOf.object("cartesian",e),Math.min(e.x,e.y)},q.minimumByComponent=function(e,t,n){return _.typeOf.object("first",e),_.typeOf.object("second",t),_.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},q.maximumByComponent=function(e,t,n){return _.typeOf.object("first",e),_.typeOf.object("second",t),_.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},q.clamp=function(e,t,n,i){_.typeOf.object("value",e),_.typeOf.object("min",t),_.typeOf.object("max",n),_.typeOf.object("result",i);const o=S.clamp(e.x,t.x,n.x),a=S.clamp(e.y,t.y,n.y);return i.x=o,i.y=a,i},q.magnitudeSquared=function(e){return _.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y},q.magnitude=function(e){return Math.sqrt(q.magnitudeSquared(e))};const Ir=new q;q.distance=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),q.subtract(e,t,Ir),q.magnitude(Ir)},q.distanceSquared=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),q.subtract(e,t,Ir),q.magnitudeSquared(Ir)},q.normalize=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=q.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,isNaN(t.x)||isNaN(t.y))throw new C("normalized result is not a number");return t},q.dot=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),e.x*t.x+e.y*t.y},q.cross=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),e.x*t.y-e.y*t.x},q.multiplyComponents=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n},q.divideComponents=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n},q.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n},q.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n},q.multiplyByScalar=function(e,t,n){return _.typeOf.object("cartesian",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n},q.divideByScalar=function(e,t,n){return _.typeOf.object("cartesian",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n},q.negate=function(e,t){return _.typeOf.object("cartesian",e),_.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t},q.abs=function(e,t){return _.typeOf.object("cartesian",e),_.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};const Nf=new q;q.lerp=function(e,t,n,i){return _.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i),q.multiplyByScalar(t,n,Nf),i=q.multiplyByScalar(e,1-n,i),q.add(Nf,i,i)};const Ff=new q,Mf=new q;q.angleBetween=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),q.normalize(e,Ff),q.normalize(t,Mf),S.acosClamped(q.dot(Ff,Mf))};const b_=new q;q.mostOrthogonalAxis=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=q.normalize(e,b_);return q.abs(n,n),n.x<=n.y?t=q.clone(q.UNIT_X,t):t=q.clone(q.UNIT_Y,t),t},q.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y},q.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},q.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&S.equalsEpsilon(e.x,t.x,n,i)&&S.equalsEpsilon(e.y,t.y,n,i)},q.ZERO=Object.freeze(new q(0,0)),q.ONE=Object.freeze(new q(1,1)),q.UNIT_X=Object.freeze(new q(1,0)),q.UNIT_Y=Object.freeze(new q(0,1)),q.prototype.clone=function(e){return q.clone(this,e)},q.prototype.equals=function(e){return q.equals(this,e)},q.prototype.equalsEpsilon=function(e,t,n){return q.equalsEpsilon(this,e,t,n)},q.prototype.toString=function(){return`(${this.x}, ${this.y})`};const x_=new u,S_=new u;function Uf(e,t,n,i,o){if(!l(e))throw new C("cartesian is required.");if(!l(t))throw new C("oneOverRadii is required.");if(!l(n))throw new C("oneOverRadiiSquared is required.");if(!l(i))throw new C("centerToleranceSquared is required.");const a=e.x,r=e.y,f=e.z,c=t.x,h=t.y,d=t.z,p=a*a*c*c,m=r*r*h*h,T=f*f*d*d,y=p+m+T,w=Math.sqrt(1/y),A=u.multiplyByScalar(e,w,x_);if(y<i)return isFinite(w)?u.clone(A,o):void 0;const E=n.x,b=n.y,D=n.z,O=S_;O.x=A.x*E*2,O.y=A.y*b*2,O.z=A.z*D*2;let B=(1-w)*u.magnitude(e)/(.5*u.magnitude(O)),L=0,F,N,U,M,j,Y,s,x,P,z,H;do{B-=L,U=1/(1+B*E),M=1/(1+B*b),j=1/(1+B*D),Y=U*U,s=M*M,x=j*j,P=Y*U,z=s*M,H=x*j,F=p*Y+m*s+T*x-1,N=p*P*E+m*z*b+T*H*D;const X=-2*N;L=F/X}while(Math.abs(F)>S.EPSILON12);return l(o)?(o.x=a*U,o.y=r*M,o.z=f*j,o):new u(a*U,r*M,f*j)}function oe(e,t,n){this.longitude=g(e,0),this.latitude=g(t,0),this.height=g(n,0)}oe.fromRadians=function(e,t,n,i){return _.typeOf.number("longitude",e),_.typeOf.number("latitude",t),n=g(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new oe(e,t,n)},oe.fromDegrees=function(e,t,n,i){return _.typeOf.number("longitude",e),_.typeOf.number("latitude",t),e=S.toRadians(e),t=S.toRadians(t),oe.fromRadians(e,t,n,i)};const I_=new u,D_=new u,O_=new u;oe._ellipsoidOneOverRadii=new u(1/6378137,1/6378137,1/6356752314245179e-9),oe._ellipsoidOneOverRadiiSquared=new u(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),oe._ellipsoidCenterToleranceSquared=S.EPSILON1,oe.fromCartesian=function(e,t,n){const i=l(t)?t.oneOverRadii:oe._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:oe._ellipsoidOneOverRadiiSquared,a=l(t)?t._centerToleranceSquared:oe._ellipsoidCenterToleranceSquared,r=Uf(e,i,o,a,D_);if(!l(r))return;let f=u.multiplyComponents(r,o,I_);f=u.normalize(f,f);const c=u.subtract(e,r,O_),h=Math.atan2(f.y,f.x),d=Math.asin(f.z),p=S.sign(u.dot(c,e))*u.magnitude(c);return l(n)?(n.longitude=h,n.latitude=d,n.height=p,n):new oe(h,d,p)},oe.toCartesian=function(e,t,n){return _.defined("cartographic",e),u.fromRadians(e.longitude,e.latitude,e.height,t,n)},oe.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new oe(e.longitude,e.latitude,e.height)},oe.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},oe.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},oe.ZERO=Object.freeze(new oe(0,0,0)),oe.prototype.clone=function(e){return oe.clone(this,e)},oe.prototype.equals=function(e){return oe.equals(this,e)},oe.prototype.equalsEpsilon=function(e,t){return oe.equalsEpsilon(this,e,t)},oe.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};function kf(e,t,n,i){t=g(t,0),n=g(n,0),i=g(i,0),_.typeOf.number.greaterThanOrEquals("x",t,0),_.typeOf.number.greaterThanOrEquals("y",n,0),_.typeOf.number.greaterThanOrEquals("z",i,0),e._radii=new u(t,n,i),e._radiiSquared=new u(t*t,n*n,i*i),e._radiiToTheFourth=new u(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new u(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new u(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=S.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function pe(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,kf(this,e,t,n)}Object.defineProperties(pe.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),pe.clone=function(e,t){if(!l(e))return;const n=e._radii;return l(t)?(u.clone(n,t._radii),u.clone(e._radiiSquared,t._radiiSquared),u.clone(e._radiiToTheFourth,t._radiiToTheFourth),u.clone(e._oneOverRadii,t._oneOverRadii),u.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new pe(n.x,n.y,n.z)},pe.fromCartesian3=function(e,t){return l(t)||(t=new pe),l(e)&&kf(t,e.x,e.y,e.z),t},pe.WGS84=Object.freeze(new pe(6378137,6378137,6356752314245179e-9)),pe.UNIT_SPHERE=Object.freeze(new pe(1,1,1)),pe.MOON=Object.freeze(new pe(S.LUNAR_RADIUS,S.LUNAR_RADIUS,S.LUNAR_RADIUS)),pe._default=pe.WGS84,Object.defineProperties(pe,{default:{get:function(){return pe._default},set:function(e){_.typeOf.object("value",e),pe._default=e,u._ellipsoidRadiiSquared=e.radiiSquared,oe._ellipsoidOneOverRadii=e.oneOverRadii,oe._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,oe._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}}),pe.prototype.clone=function(e){return pe.clone(this,e)},pe.packedLength=u.packedLength,pe.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),u.pack(e._radii,t,n),t},pe.unpack=function(e,t,n){_.defined("array",e),t=g(t,0);const i=u.unpack(e,t);return pe.fromCartesian3(i,n)},pe.prototype.geocentricSurfaceNormal=u.normalize,pe.prototype.geodeticSurfaceNormalCartographic=function(e,t){_.typeOf.object("cartographic",e);const n=e.longitude,i=e.latitude,o=Math.cos(i),a=o*Math.cos(n),r=o*Math.sin(n),f=Math.sin(i);return l(t)||(t=new u),t.x=a,t.y=r,t.z=f,u.normalize(t,t)},pe.prototype.geodeticSurfaceNormal=function(e,t){if(_.typeOf.object("cartesian",e),isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new C("cartesian has a NaN component");if(!u.equalsEpsilon(e,u.ZERO,S.EPSILON14))return l(t)||(t=new u),t=u.multiplyComponents(e,this._oneOverRadiiSquared,t),u.normalize(t,t)};const v_=new u,W_=new u;pe.prototype.cartographicToCartesian=function(e,t){const n=v_,i=W_;this.geodeticSurfaceNormalCartographic(e,n),u.multiplyComponents(this._radiiSquared,n,i);const o=Math.sqrt(u.dot(n,i));return u.divideByScalar(i,o,i),u.multiplyByScalar(n,e.height,n),l(t)||(t=new u),u.add(i,n,t)},pe.prototype.cartographicArrayToCartesianArray=function(e,t){_.defined("cartographics",e);const n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};const P_=new u,B_=new u,R_=new u;pe.prototype.cartesianToCartographic=function(e,t){const n=this.scaleToGeodeticSurface(e,B_);if(!l(n))return;const i=this.geodeticSurfaceNormal(n,P_),o=u.subtract(e,n,R_),a=Math.atan2(i.y,i.x),r=Math.asin(i.z),f=S.sign(u.dot(o,e))*u.magnitude(o);return l(t)?(t.longitude=a,t.latitude=r,t.height=f,t):new oe(a,r,f)},pe.prototype.cartesianArrayToCartographicArray=function(e,t){_.defined("cartesians",e);const n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},pe.prototype.scaleToGeodeticSurface=function(e,t){return Uf(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},pe.prototype.scaleToGeocentricSurface=function(e,t){_.typeOf.object("cartesian",e),l(t)||(t=new u);const n=e.x,i=e.y,o=e.z,a=this._oneOverRadiiSquared,r=1/Math.sqrt(n*n*a.x+i*i*a.y+o*o*a.z);return u.multiplyByScalar(e,r,t)},pe.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new u),u.multiplyComponents(e,this._oneOverRadii,t)},pe.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new u),u.multiplyComponents(e,this._radii,t)},pe.prototype.equals=function(e){return this===e||l(e)&&u.equals(this._radii,e._radii)},pe.prototype.toString=function(){return this._radii.toString()},pe.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){if(_.typeOf.object("position",e),!S.equalsEpsilon(this._radii.x,this._radii.y,S.EPSILON15))throw new C("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");_.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=g(t,0);const i=this._squaredXOverSquaredZ;if(l(n)||(n=new u),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};const z_=new u;pe.prototype.getLocalCurvature=function(e,t){_.typeOf.object("surfacePosition",e),l(t)||(t=new q);const n=this.getSurfaceNormalIntersectionWithZAxis(e,0,z_),i=u.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,a=i*o**2;return q.fromElements(1/i,1/a,t)};const L_=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],N_=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Vf(e,t,n){_.typeOf.number("a",e),_.typeOf.number("b",t),_.typeOf.func("func",n);const i=.5*(t+e),o=.5*(t-e);let a=0;for(let r=0;r<5;r++){const f=o*L_[r];a+=N_[r]*(n(i+f)+n(i-f))}return a*=o,a}pe.prototype.surfaceArea=function(e){_.typeOf.object("rectangle",e);const t=e.west;let n=e.east;const i=e.south,o=e.north;for(;n<t;)n+=S.TWO_PI;const a=this._radiiSquared,r=a.x,f=a.y,c=a.z,h=r*f;return Vf(i,o,function(d){const p=Math.cos(d),m=Math.sin(d);return Math.cos(d)*Vf(t,n,function(T){const y=Math.cos(T),w=Math.sin(T);return Math.sqrt(h*m*m+c*(f*y*y+r*w*w)*p*p)})})};function Wn(e){this._ellipsoid=g(e,pe.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Wn.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Wn.prototype.project=function(e,t){const n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,a=e.height;return l(t)?(t.x=i,t.y=o,t.z=a,t):new u(i,o,a)},Wn.prototype.unproject=function(e,t){if(!l(e))throw new C("cartesian is required");const n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,a=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=a,t):new oe(i,o,a)};const xt=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function is(e,t,n){_.defined("array",e),_.defined("itemToFind",t),_.defined("comparator",n);let i=0,o=e.length-1,a,r;for(;i<=o;){if(a=~~((i+o)/2),r=n(e[a],t),r<0){i=a+1;continue}if(r>0){o=a-1;continue}return a}return~(o+1)}function tc(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}function nc(e){if(e===null||isNaN(e))throw new C("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}const Gf=[31,28,31,30,31,30,31,31,30,31,30,31];function ic(e,t,n,i,o,a,r,f){e=g(e,1),t=g(t,1),n=g(n,1),i=g(i,0),o=g(o,0),a=g(a,0),r=g(r,0),f=g(f,!1),w(),A(),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=a,this.millisecond=r,this.isLeapSecond=f;function w(){_.typeOf.number.greaterThanOrEquals("Year",e,1),_.typeOf.number.lessThanOrEquals("Year",e,9999),_.typeOf.number.greaterThanOrEquals("Month",t,1),_.typeOf.number.lessThanOrEquals("Month",t,12),_.typeOf.number.greaterThanOrEquals("Day",n,1),_.typeOf.number.lessThanOrEquals("Day",n,31),_.typeOf.number.greaterThanOrEquals("Hour",i,0),_.typeOf.number.lessThanOrEquals("Hour",i,23),_.typeOf.number.greaterThanOrEquals("Minute",o,0),_.typeOf.number.lessThanOrEquals("Minute",o,59),_.typeOf.bool("IsLeapSecond",f),_.typeOf.number.greaterThanOrEquals("Second",a,0),_.typeOf.number.lessThanOrEquals("Second",a,f?60:59),_.typeOf.number.greaterThanOrEquals("Millisecond",r,0),_.typeOf.number.lessThan("Millisecond",r,1e3)}function A(){const E=t===2&&nc(e)?Gf[t-1]+1:Gf[t-1];if(n>E)throw new C("Month and Day represents invalid date")}}function Ye(e,t){this.julianDate=e,this.offset=t}const ht=Object.freeze({SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1}),Be=Object.freeze({UTC:0,TAI:1}),qf=new ic,Dr=[31,28,31,30,31,30,31,31,30,31,30,31],Or=29;function oc(e,t){return J.compare(e.julianDate,t.julianDate)}const So=new Ye;function vr(e){So.julianDate=e;const t=J.leapSeconds;let n=is(t,So,oc);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&J.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),J.addSeconds(e,i,e)}function Hf(e,t){So.julianDate=e;const n=J.leapSeconds;let i=is(n,So,oc);if(i<0&&(i=~i),i===0)return J.addSeconds(e,-n[0].offset,t);if(i>=n.length)return J.addSeconds(e,-n[i-1].offset,t);const o=J.secondsDifference(n[i].julianDate,e);if(o===0)return J.addSeconds(e,-n[i].offset,t);if(!(o<=1))return J.addSeconds(e,-n[--i].offset,t)}function Ri(e,t,n){const i=t/ht.SECONDS_PER_DAY|0;return e+=i,t-=ht.SECONDS_PER_DAY*i,t<0&&(e--,t+=ht.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function sc(e,t,n,i,o,a,r){const f=(t-14)/12|0,c=e+4800+f;let h=(1461*c/4|0)+(367*(t-2-12*f)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);const d=a+(i*ht.SECONDS_PER_HOUR+o*ht.SECONDS_PER_MINUTE+r*ht.SECONDS_PER_MILLISECOND);return d>=43200&&(h-=1),[h,d]}const F_=/^(\d{4})$/,M_=/^(\d{4})-(\d{2})$/,U_=/^(\d{4})-?(\d{3})$/,k_=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,V_=/^(\d{4})-?(\d{2})-?(\d{2})$/,rc=/([Z+\-])?(\d{2})?:?(\d{2})?$/,G_=/^(\d{2})(\.\d+)?/.source+rc.source,q_=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rc.source,H_=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rc.source,Pn="Invalid ISO 8601 date.";function J(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=g(e,0),t=g(t,0),n=g(n,Be.UTC);const i=e|0;t=t+(e-i)*ht.SECONDS_PER_DAY,Ri(i,t,this),n===Be.UTC&&vr(this)}J.fromGregorianDate=function(e,t){if(!(e instanceof ic))throw new C("date must be a valid GregorianDate.");const n=sc(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(Ri(n[0],n[1],t),vr(t),t):new J(n[0],n[1],Be.UTC)},J.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new C("date must be a valid JavaScript Date.");const n=sc(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(Ri(n[0],n[1],t),vr(t),t):new J(n[0],n[1],Be.UTC)},J.fromIso8601=function(e,t){if(typeof e!="string")throw new C(Pn);e=e.replace(",",".");let n=e.split("T"),i,o=1,a=1,r=0,f=0,c=0,h=0;const d=n[0],p=n[1];let m,T;if(!l(d))throw new C(Pn);let y;if(n=d.match(V_),n!==null){if(y=d.split("-").length-1,y>0&&y!==2)throw new C(Pn);i=+n[1],o=+n[2],a=+n[3]}else if(n=d.match(M_),n!==null)i=+n[1],o=+n[2];else if(n=d.match(F_),n!==null)i=+n[1];else{let b;if(n=d.match(U_),n!==null){if(i=+n[1],b=+n[2],T=nc(i),b<1||T&&b>366||!T&&b>365)throw new C(Pn)}else if(n=d.match(k_),n!==null){i=+n[1];const D=+n[2],O=+n[3]||0;if(y=d.split("-").length-1,y>0&&(!l(n[3])&&y!==1||l(n[3])&&y!==2))throw new C(Pn);const B=new Date(Date.UTC(i,0,4));b=D*7+O-B.getUTCDay()-3}else throw new C(Pn);m=new Date(Date.UTC(i,0,1)),m.setUTCDate(b),o=m.getUTCMonth()+1,a=m.getUTCDate()}if(T=nc(i),o<1||o>12||a<1||(o!==2||!T)&&a>Dr[o-1]||T&&o===2&&a>Or)throw new C(Pn);let w;if(l(p)){if(n=p.match(H_),n!==null){if(y=p.split(":").length-1,y>0&&y!==2&&y!==3)throw new C(Pn);r=+n[1],f=+n[2],c=+n[3],h=+(n[4]||0)*1e3,w=5}else if(n=p.match(q_),n!==null){if(y=p.split(":").length-1,y>2)throw new C(Pn);r=+n[1],f=+n[2],c=+(n[3]||0)*60,w=4}else if(n=p.match(G_),n!==null)r=+n[1],f=+(n[2]||0)*60,w=3;else throw new C(Pn);if(f>=60||c>=61||r>24||r===24&&(f>0||c>0||h>0))throw new C(Pn);const b=n[w],D=+n[w+1],O=+(n[w+2]||0);switch(b){case"+":r=r-D,f=f-O;break;case"-":r=r+D,f=f+O;break;case"Z":break;default:f=f+new Date(Date.UTC(i,o-1,a,r,f)).getTimezoneOffset();break}}const A=c===60;for(A&&c--;f>=60;)f-=60,r++;for(;r>=24;)r-=24,a++;for(m=T&&o===2?Or:Dr[o-1];a>m;)a-=m,o++,o>12&&(o-=12,i++),m=T&&o===2?Or:Dr[o-1];for(;f<0;)f+=60,r--;for(;r<0;)r+=24,a--;for(;a<1;)o--,o<1&&(o+=12,i--),m=T&&o===2?Or:Dr[o-1],a+=m;const E=sc(i,o,a,r,f,c,h);return l(t)?(Ri(E[0],E[1],t),vr(t)):t=new J(E[0],E[1],Be.UTC),A&&J.addSeconds(t,1,t),t},J.now=function(e){return J.fromDate(new Date,e)};const Wr=new J(0,0,Be.TAI);J.toGregorianDate=function(e,t){if(!l(e))throw new C("julianDate is required.");let n=!1,i=Hf(e,Wr);l(i)||(J.addSeconds(e,-1,Wr),i=Hf(Wr,Wr),n=!0);let o=i.dayNumber;const a=i.secondsOfDay;a>=43200&&(o+=1);let r=o+68569|0;const f=4*r/146097|0;r=r-((146097*f+3)/4|0)|0;const c=4e3*(r+1)/1461001|0;r=r-(1461*c/4|0)+31|0;const h=80*r/2447|0,d=r-(2447*h/80|0)|0;r=h/11|0;const p=h+2-12*r|0,m=100*(f-49)+c+r|0;let T=a/ht.SECONDS_PER_HOUR|0,y=a-T*ht.SECONDS_PER_HOUR;const w=y/ht.SECONDS_PER_MINUTE|0;y=y-w*ht.SECONDS_PER_MINUTE;let A=y|0;const E=(y-A)/ht.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(A+=1),l(t)?(t.year=m,t.month=p,t.day=d,t.hour=T,t.minute=w,t.second=A,t.millisecond=E,t.isLeapSecond=n,t):new ic(m,p,d,T,w,A,E,n)},J.toDate=function(e){if(!l(e))throw new C("julianDate is required.");const t=J.toGregorianDate(e,qf);let n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},J.toIso8601=function(e,t){if(!l(e))throw new C("julianDate is required.");const n=J.toGregorianDate(e,qf);let i=n.year,o=n.month,a=n.day,r=n.hour;const f=n.minute,c=n.second,h=n.millisecond;i===1e4&&o===1&&a===1&&r===0&&f===0&&c===0&&h===0&&(i=9999,o=12,a=31,r=24);let d;return!l(t)&&h!==0?(d=(h*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(d=(h*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`)},J.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new J(e.dayNumber,e.secondsOfDay,Be.TAI)},J.compare=function(e,t){if(!l(e))throw new C("left is required.");if(!l(t))throw new C("right is required.");const n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay},J.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},J.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(J.secondsDifference(e,t))<=n},J.totalDays=function(e){if(!l(e))throw new C("julianDate is required.");return e.dayNumber+e.secondsOfDay/ht.SECONDS_PER_DAY},J.secondsDifference=function(e,t){if(!l(e))throw new C("left is required.");if(!l(t))throw new C("right is required.");return(e.dayNumber-t.dayNumber)*ht.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},J.daysDifference=function(e,t){if(!l(e))throw new C("left is required.");if(!l(t))throw new C("right is required.");const n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/ht.SECONDS_PER_DAY;return n+i},J.computeTaiMinusUtc=function(e){So.julianDate=e;const t=J.leapSeconds;let n=is(t,So,oc);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset},J.addSeconds=function(e,t,n){if(!l(e))throw new C("julianDate is required.");if(!l(t))throw new C("seconds is required.");if(!l(n))throw new C("result is required.");return Ri(e.dayNumber,e.secondsOfDay+t,n)},J.addMinutes=function(e,t,n){if(!l(e))throw new C("julianDate is required.");if(!l(t))throw new C("minutes is required.");if(!l(n))throw new C("result is required.");const i=e.secondsOfDay+t*ht.SECONDS_PER_MINUTE;return Ri(e.dayNumber,i,n)},J.addHours=function(e,t,n){if(!l(e))throw new C("julianDate is required.");if(!l(t))throw new C("hours is required.");if(!l(n))throw new C("result is required.");const i=e.secondsOfDay+t*ht.SECONDS_PER_HOUR;return Ri(e.dayNumber,i,n)},J.addDays=function(e,t,n){if(!l(e))throw new C("julianDate is required.");if(!l(t))throw new C("days is required.");if(!l(n))throw new C("result is required.");const i=e.dayNumber+t;return Ri(i,e.secondsOfDay,n)},J.lessThan=function(e,t){return J.compare(e,t)<0},J.lessThanOrEquals=function(e,t){return J.compare(e,t)<=0},J.greaterThan=function(e,t){return J.compare(e,t)>0},J.greaterThanOrEquals=function(e,t){return J.compare(e,t)>=0},J.prototype.clone=function(e){return J.clone(this,e)},J.prototype.equals=function(e){return J.equals(this,e)},J.prototype.equalsEpsilon=function(e,t){return J.equalsEpsilon(this,e,t)},J.prototype.toString=function(){return J.toIso8601(this)},J.leapSeconds=[new Ye(new J(2441317,43210,Be.TAI),10),new Ye(new J(2441499,43211,Be.TAI),11),new Ye(new J(2441683,43212,Be.TAI),12),new Ye(new J(2442048,43213,Be.TAI),13),new Ye(new J(2442413,43214,Be.TAI),14),new Ye(new J(2442778,43215,Be.TAI),15),new Ye(new J(2443144,43216,Be.TAI),16),new Ye(new J(2443509,43217,Be.TAI),17),new Ye(new J(2443874,43218,Be.TAI),18),new Ye(new J(2444239,43219,Be.TAI),19),new Ye(new J(2444786,43220,Be.TAI),20),new Ye(new J(2445151,43221,Be.TAI),21),new Ye(new J(2445516,43222,Be.TAI),22),new Ye(new J(2446247,43223,Be.TAI),23),new Ye(new J(2447161,43224,Be.TAI),24),new Ye(new J(2447892,43225,Be.TAI),25),new Ye(new J(2448257,43226,Be.TAI),26),new Ye(new J(2448804,43227,Be.TAI),27),new Ye(new J(2449169,43228,Be.TAI),28),new Ye(new J(2449534,43229,Be.TAI),29),new Ye(new J(2450083,43230,Be.TAI),30),new Ye(new J(2450630,43231,Be.TAI),31),new Ye(new J(2451179,43232,Be.TAI),32),new Ye(new J(2453736,43233,Be.TAI),33),new Ye(new J(2454832,43234,Be.TAI),34),new Ye(new J(2456109,43235,Be.TAI),35),new Ye(new J(2457204,43236,Be.TAI),36),new Ye(new J(2457754,43237,Be.TAI),37)];var jf={exports:{}},os={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */os.exports;var Yf;function j_(){return Yf||(Yf=1,function(e,t){(function(n){var i=t&&!t.nodeType&&t,o=e&&!e.nodeType&&e,a=typeof wo=="object"&&wo;(a.global===a||a.window===a||a.self===a)&&(n=a);var r,f=2147483647,c=36,h=1,d=26,p=38,m=700,T=72,y=128,w="-",A=/^xn--/,E=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,D={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=c-h,B=Math.floor,L=String.fromCharCode,F;function N(K){throw new RangeError(D[K])}function U(K,ce){for(var le=K.length,we=[];le--;)we[le]=ce(K[le]);return we}function M(K,ce){var le=K.split("@"),we="";le.length>1&&(we=le[0]+"@",K=le[1]),K=K.replace(b,".");var Se=K.split("."),Ee=U(Se,ce).join(".");return we+Ee}function j(K){for(var ce=[],le=0,we=K.length,Se,Ee;le<we;)Se=K.charCodeAt(le++),Se>=55296&&Se<=56319&&le<we?(Ee=K.charCodeAt(le++),(Ee&64512)==56320?ce.push(((Se&1023)<<10)+(Ee&1023)+65536):(ce.push(Se),le--)):ce.push(Se);return ce}function Y(K){return U(K,function(ce){var le="";return ce>65535&&(ce-=65536,le+=L(ce>>>10&1023|55296),ce=56320|ce&1023),le+=L(ce),le}).join("")}function s(K){return K-48<10?K-22:K-65<26?K-65:K-97<26?K-97:c}function x(K,ce){return K+22+75*(K<26)-((ce!=0)<<5)}function P(K,ce,le){var we=0;for(K=le?B(K/m):K>>1,K+=B(K/ce);K>O*d>>1;we+=c)K=B(K/O);return B(we+(O+1)*K/(K+p))}function z(K){var ce=[],le=K.length,we,Se=0,Ee=y,Le=T,Ke,ct,gt,Fe,At,Wt,Et,pn,mn;for(Ke=K.lastIndexOf(w),Ke<0&&(Ke=0),ct=0;ct<Ke;++ct)K.charCodeAt(ct)>=128&&N("not-basic"),ce.push(K.charCodeAt(ct));for(gt=Ke>0?Ke+1:0;gt<le;){for(Fe=Se,At=1,Wt=c;gt>=le&&N("invalid-input"),Et=s(K.charCodeAt(gt++)),(Et>=c||Et>B((f-Se)/At))&&N("overflow"),Se+=Et*At,pn=Wt<=Le?h:Wt>=Le+d?d:Wt-Le,!(Et<pn);Wt+=c)mn=c-pn,At>B(f/mn)&&N("overflow"),At*=mn;we=ce.length+1,Le=P(Se-Fe,we,Fe==0),B(Se/we)>f-Ee&&N("overflow"),Ee+=B(Se/we),Se%=we,ce.splice(Se++,0,Ee)}return Y(ce)}function H(K){var ce,le,we,Se,Ee,Le,Ke,ct,gt,Fe,At,Wt=[],Et,pn,mn,jn;for(K=j(K),Et=K.length,ce=y,le=0,Ee=T,Le=0;Le<Et;++Le)At=K[Le],At<128&&Wt.push(L(At));for(we=Se=Wt.length,Se&&Wt.push(w);we<Et;){for(Ke=f,Le=0;Le<Et;++Le)At=K[Le],At>=ce&&At<Ke&&(Ke=At);for(pn=we+1,Ke-ce>B((f-le)/pn)&&N("overflow"),le+=(Ke-ce)*pn,ce=Ke,Le=0;Le<Et;++Le)if(At=K[Le],At<ce&&++le>f&&N("overflow"),At==ce){for(ct=le,gt=c;Fe=gt<=Ee?h:gt>=Ee+d?d:gt-Ee,!(ct<Fe);gt+=c)jn=ct-Fe,mn=c-Fe,Wt.push(L(x(Fe+jn%mn,0))),ct=B(jn/mn);Wt.push(L(x(ct,0))),Ee=P(le,pn,we==Se),le=0,++we}++le,++ce}return Wt.join("")}function X(K){return M(K,function(ce){return A.test(ce)?z(ce.slice(4).toLowerCase()):ce})}function ee(K){return M(K,function(ce){return E.test(ce)?"xn--"+H(ce):ce})}if(r={version:"1.3.2",ucs2:{decode:j,encode:Y},decode:z,encode:H,toASCII:ee,toUnicode:X},i&&o)if(e.exports==i)o.exports=r;else for(F in r)r.hasOwnProperty(F)&&(i[F]=r[F]);else n.punycode=r})(wo)}(os,os.exports)),os.exports}var ac={exports:{}};/*!
9
9
  * URI.js - Mutating URLs
10
10
  * IPv6 Support
11
11
  *
@@ -17,7 +17,7 @@ ${this.stack.toString()}`),e};function k(e,t,n,i,o,a,r,f,c,h,d,p,m,T,y,w){this[0
17
17
  * Licensed under
18
18
  * MIT License http://www.opensource.org/licenses/mit-license
19
19
  *
20
- */var Xf;function Y_(){return Xf||(Xf=1,function(e){(function(t,n){e.exports?e.exports=n():t.IPv6=n(t)})(Ao,function(t){var n=t&&t.IPv6;function i(a){var r=a.toLowerCase(),f=r.split(":"),c=f.length,h=8;f[0]===""&&f[1]===""&&f[2]===""?(f.shift(),f.shift()):f[0]===""&&f[1]===""?f.shift():f[c-1]===""&&f[c-2]===""&&f.pop(),c=f.length,f[c-1].indexOf(".")!==-1&&(h=7);var d;for(d=0;d<c&&f[d]!=="";d++);if(d<h)for(f.splice(d,1,"0000");f.length<h;)f.splice(d,0,"0000");for(var p,m=0;m<h;m++){p=f[m].split("");for(var T=0;T<3&&(p[0]==="0"&&p.length>1);T++)p.splice(0,1);f[m]=p.join("")}var y=-1,w=0,A=0,E=-1,b=!1;for(m=0;m<h;m++)b?f[m]==="0"?A+=1:(b=!1,A>w&&(y=E,w=A)):f[m]==="0"&&(b=!0,E=m,A=1);A>w&&(y=E,w=A),w>1&&f.splice(y,w,""),c=f.length;var I="";for(f[0]===""&&(I=":"),m=0;m<c&&(I+=f[m],m!==c-1);m++)I+=":";return f[c-1]===""&&(I+=":"),I}function o(){return t.IPv6===this&&(t.IPv6=n),this}return{best:i,noConflict:o}})}(ac)),ac.exports}var cc={exports:{}};/*!
20
+ */var Xf;function Y_(){return Xf||(Xf=1,function(e){(function(t,n){e.exports?e.exports=n():t.IPv6=n(t)})(wo,function(t){var n=t&&t.IPv6;function i(a){var r=a.toLowerCase(),f=r.split(":"),c=f.length,h=8;f[0]===""&&f[1]===""&&f[2]===""?(f.shift(),f.shift()):f[0]===""&&f[1]===""?f.shift():f[c-1]===""&&f[c-2]===""&&f.pop(),c=f.length,f[c-1].indexOf(".")!==-1&&(h=7);var d;for(d=0;d<c&&f[d]!=="";d++);if(d<h)for(f.splice(d,1,"0000");f.length<h;)f.splice(d,0,"0000");for(var p,m=0;m<h;m++){p=f[m].split("");for(var T=0;T<3&&(p[0]==="0"&&p.length>1);T++)p.splice(0,1);f[m]=p.join("")}var y=-1,w=0,A=0,E=-1,b=!1;for(m=0;m<h;m++)b?f[m]==="0"?A+=1:(b=!1,A>w&&(y=E,w=A)):f[m]==="0"&&(b=!0,E=m,A=1);A>w&&(y=E,w=A),w>1&&f.splice(y,w,""),c=f.length;var D="";for(f[0]===""&&(D=":"),m=0;m<c&&(D+=f[m],m!==c-1);m++)D+=":";return f[c-1]===""&&(D+=":"),D}function o(){return t.IPv6===this&&(t.IPv6=n),this}return{best:i,noConflict:o}})}(ac)),ac.exports}var cc={exports:{}};/*!
21
21
  * URI.js - Mutating URLs
22
22
  * Second Level Domain (SLD) Support
23
23
  *
@@ -29,7 +29,7 @@ ${this.stack.toString()}`),e};function k(e,t,n,i,o,a,r,f,c,h,d,p,m,T,y,w){this[0
29
29
  * Licensed under
30
30
  * MIT License http://www.opensource.org/licenses/mit-license
31
31
  *
32
- */var $f;function X_(){return $f||($f=1,function(e){(function(t,n){e.exports?e.exports=n():t.SecondLevelDomains=n(t)})(Ao,function(t){var n=t&&t.SecondLevelDomains,i={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(o){var a=o.lastIndexOf(".");if(a<=0||a>=o.length-1)return!1;var r=o.lastIndexOf(".",a-1);if(r<=0||r>=a-1)return!1;var f=i.list[o.slice(a+1)];return f?f.indexOf(" "+o.slice(r+1,a)+" ")>=0:!1},is:function(o){var a=o.lastIndexOf(".");if(a<=0||a>=o.length-1)return!1;var r=o.lastIndexOf(".",a-1);if(r>=0)return!1;var f=i.list[o.slice(a+1)];return f?f.indexOf(" "+o.slice(0,a)+" ")>=0:!1},get:function(o){var a=o.lastIndexOf(".");if(a<=0||a>=o.length-1)return null;var r=o.lastIndexOf(".",a-1);if(r<=0||r>=a-1)return null;var f=i.list[o.slice(a+1)];return!f||f.indexOf(" "+o.slice(r+1,a)+" ")<0?null:o.slice(r+1)},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=n),this}};return i})}(cc)),cc.exports}/*!
32
+ */var $f;function X_(){return $f||($f=1,function(e){(function(t,n){e.exports?e.exports=n():t.SecondLevelDomains=n(t)})(wo,function(t){var n=t&&t.SecondLevelDomains,i={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(o){var a=o.lastIndexOf(".");if(a<=0||a>=o.length-1)return!1;var r=o.lastIndexOf(".",a-1);if(r<=0||r>=a-1)return!1;var f=i.list[o.slice(a+1)];return f?f.indexOf(" "+o.slice(r+1,a)+" ")>=0:!1},is:function(o){var a=o.lastIndexOf(".");if(a<=0||a>=o.length-1)return!1;var r=o.lastIndexOf(".",a-1);if(r>=0)return!1;var f=i.list[o.slice(a+1)];return f?f.indexOf(" "+o.slice(0,a)+" ")>=0:!1},get:function(o){var a=o.lastIndexOf(".");if(a<=0||a>=o.length-1)return null;var r=o.lastIndexOf(".",a-1);if(r<=0||r>=a-1)return null;var f=i.list[o.slice(a+1)];return!f||f.indexOf(" "+o.slice(r+1,a)+" ")<0?null:o.slice(r+1)},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=n),this}};return i})}(cc)),cc.exports}/*!
33
33
  * URI.js - Mutating URLs
34
34
  *
35
35
  * Version: 1.19.11
@@ -40,15 +40,15 @@ ${this.stack.toString()}`),e};function k(e,t,n,i,o,a,r,f,c,h,d,p,m,T,y,w){this[0
40
40
  * Licensed under
41
41
  * MIT License http://www.opensource.org/licenses/mit-license
42
42
  *
43
- */(function(e){(function(t,n){e.exports?e.exports=n(j_(),Y_(),X_()):t.URI=n(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(Ao,function(t,n,i,o){var a=o&&o.URI;function r(s,x){var P=arguments.length>=1,z=arguments.length>=2;if(!(this instanceof r))return P?z?new r(s,x):new r(s):new r;if(s===void 0){if(P)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?s=location.href+"":s=""}if(s===null&&P)throw new TypeError("null is not a valid argument for URI");return this.href(s),x!==void 0?this.absoluteTo(x):this}function f(s){return/^[0-9]+$/.test(s)}r.version="1.19.11";var c=r.prototype,h=Object.prototype.hasOwnProperty;function d(s){return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function p(s){return s===void 0?"Undefined":String(Object.prototype.toString.call(s)).slice(8,-1)}function m(s){return p(s)==="Array"}function T(s,x){var P={},z,H;if(p(x)==="RegExp")P=null;else if(m(x))for(z=0,H=x.length;z<H;z++)P[x[z]]=!0;else P[x]=!0;for(z=0,H=s.length;z<H;z++){var X=P&&P[s[z]]!==void 0||!P&&x.test(s[z]);X&&(s.splice(z,1),H--,z--)}return s}function y(s,x){var P,z;if(m(x)){for(P=0,z=x.length;P<z;P++)if(!y(s,x[P]))return!1;return!0}var H=p(x);for(P=0,z=s.length;P<z;P++)if(H==="RegExp"){if(typeof s[P]=="string"&&s[P].match(x))return!0}else if(s[P]===x)return!0;return!1}function w(s,x){if(!m(s)||!m(x)||s.length!==x.length)return!1;s.sort(),x.sort();for(var P=0,z=s.length;P<z;P++)if(s[P]!==x[P])return!1;return!0}function A(s){var x=/^\/+|\/+$/g;return s.replace(x,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(s){if(!(!s||!s.nodeName)){var x=s.nodeName.toLowerCase();if(!(x==="input"&&s.type!=="image"))return r.domAttributes[x]}};function E(s){return escape(s)}function b(s){return encodeURIComponent(s).replace(/[!'()*]/g,E).replace(/\*/g,"%2A")}r.encode=b,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=b,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(s,x){var P=r.encode(s+"");return x===void 0&&(x=r.escapeQuerySpace),x?P.replace(/%20/g,"+"):P},r.decodeQuery=function(s,x){s+="",x===void 0&&(x=r.escapeQuerySpace);try{return r.decode(x?s.replace(/\+/g,"%20"):s)}catch{return s}};var I={encode:"encode",decode:"decode"},O,B=function(s,x){return function(P){try{return r[x](P+"").replace(r.characters[s][x].expression,function(z){return r.characters[s][x].map[z]})}catch{return P}}};for(O in I)r[O+"PathSegment"]=B("pathname",I[O]),r[O+"UrnPathSegment"]=B("urnpath",I[O]);var L=function(s,x,P){return function(z){var H;P?H=function(ce){return r[x](r[P](ce))}:H=r[x];for(var X=(z+"").split(s),ee=0,K=X.length;ee<K;ee++)X[ee]=H(X[ee]);return X.join(s)}};r.decodePath=L("/","decodePathSegment"),r.decodeUrnPath=L(":","decodeUrnPathSegment"),r.recodePath=L("/","encodePathSegment","decode"),r.recodeUrnPath=L(":","encodeUrnPathSegment","decode"),r.encodeReserved=B("reserved","encode"),r.parse=function(s,x){var P;return x||(x={preventInvalidHostname:r.preventInvalidHostname}),s=s.replace(r.leading_whitespace_expression,""),s=s.replace(r.ascii_tab_whitespace,""),P=s.indexOf("#"),P>-1&&(x.fragment=s.substring(P+1)||null,s=s.substring(0,P)),P=s.indexOf("?"),P>-1&&(x.query=s.substring(P+1)||null,s=s.substring(0,P)),s=s.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),s=s.replace(/^[/\\]{2,}/i,"//"),s.substring(0,2)==="//"?(x.protocol=null,s=s.substring(2),s=r.parseAuthority(s,x)):(P=s.indexOf(":"),P>-1&&(x.protocol=s.substring(0,P)||null,x.protocol&&!x.protocol.match(r.protocol_expression)?x.protocol=void 0:s.substring(P+1,P+3).replace(/\\/g,"/")==="//"?(s=s.substring(P+3),s=r.parseAuthority(s,x)):(s=s.substring(P+1),x.urn=!0))),x.path=s,x},r.parseHost=function(s,x){s||(s=""),s=s.replace(/\\/g,"/");var P=s.indexOf("/"),z,H;if(P===-1&&(P=s.length),s.charAt(0)==="[")z=s.indexOf("]"),x.hostname=s.substring(1,z)||null,x.port=s.substring(z+2,P)||null,x.port==="/"&&(x.port=null);else{var X=s.indexOf(":"),ee=s.indexOf("/"),K=s.indexOf(":",X+1);K!==-1&&(ee===-1||K<ee)?(x.hostname=s.substring(0,P)||null,x.port=null):(H=s.substring(0,P).split(":"),x.hostname=H[0]||null,x.port=H[1]||null)}return x.hostname&&s.substring(P).charAt(0)!=="/"&&(P++,s="/"+s),x.preventInvalidHostname&&r.ensureValidHostname(x.hostname,x.protocol),x.port&&r.ensureValidPort(x.port),s.substring(P)||"/"},r.parseAuthority=function(s,x){return s=r.parseUserinfo(s,x),r.parseHost(s,x)},r.parseUserinfo=function(s,x){var P=s,z=s.indexOf("\\");z!==-1&&(s=s.replace(/\\/g,"/"));var H=s.indexOf("/"),X=s.lastIndexOf("@",H>-1?H:s.length-1),ee;return X>-1&&(H===-1||X<H)?(ee=s.substring(0,X).split(":"),x.username=ee[0]?r.decode(ee[0]):null,ee.shift(),x.password=ee[0]?r.decode(ee.join(":")):null,s=P.substring(X+1)):(x.username=null,x.password=null),s},r.parseQuery=function(s,x){if(!s)return{};if(s=s.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!s)return{};for(var P={},z=s.split("&"),H=z.length,X,ee,K,ce=0;ce<H;ce++)X=z[ce].split("="),ee=r.decodeQuery(X.shift(),x),K=X.length?r.decodeQuery(X.join("="),x):null,ee!=="__proto__"&&(h.call(P,ee)?((typeof P[ee]=="string"||P[ee]===null)&&(P[ee]=[P[ee]]),P[ee].push(K)):P[ee]=K);return P},r.build=function(s){var x="",P=!1;return s.protocol&&(x+=s.protocol+":"),!s.urn&&(x||s.hostname)&&(x+="//",P=!0),x+=r.buildAuthority(s)||"",typeof s.path=="string"&&(s.path.charAt(0)!=="/"&&P&&(x+="/"),x+=s.path),typeof s.query=="string"&&s.query&&(x+="?"+s.query),typeof s.fragment=="string"&&s.fragment&&(x+="#"+s.fragment),x},r.buildHost=function(s){var x="";if(s.hostname)r.ip6_expression.test(s.hostname)?x+="["+s.hostname+"]":x+=s.hostname;else return"";return s.port&&(x+=":"+s.port),x},r.buildAuthority=function(s){return r.buildUserinfo(s)+r.buildHost(s)},r.buildUserinfo=function(s){var x="";return s.username&&(x+=r.encode(s.username)),s.password&&(x+=":"+r.encode(s.password)),x&&(x+="@"),x},r.buildQuery=function(s,x,P){var z="",H,X,ee,K;for(X in s)if(X!=="__proto__"&&h.call(s,X))if(m(s[X]))for(H={},ee=0,K=s[X].length;ee<K;ee++)s[X][ee]!==void 0&&H[s[X][ee]+""]===void 0&&(z+="&"+r.buildQueryParameter(X,s[X][ee],P),x!==!0&&(H[s[X][ee]+""]=!0));else s[X]!==void 0&&(z+="&"+r.buildQueryParameter(X,s[X],P));return z.substring(1)},r.buildQueryParameter=function(s,x,P){return r.encodeQuery(s,P)+(x!==null?"="+r.encodeQuery(x,P):"")},r.addQuery=function(s,x,P){if(typeof x=="object")for(var z in x)h.call(x,z)&&r.addQuery(s,z,x[z]);else if(typeof x=="string"){if(s[x]===void 0){s[x]=P;return}else typeof s[x]=="string"&&(s[x]=[s[x]]);m(P)||(P=[P]),s[x]=(s[x]||[]).concat(P)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(s,x,P){if(typeof x=="object")for(var z in x)h.call(x,z)&&r.setQuery(s,z,x[z]);else if(typeof x=="string")s[x]=P===void 0?null:P;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(s,x,P){var z,H,X;if(m(x))for(z=0,H=x.length;z<H;z++)s[x[z]]=void 0;else if(p(x)==="RegExp")for(X in s)x.test(X)&&(s[X]=void 0);else if(typeof x=="object")for(X in x)h.call(x,X)&&r.removeQuery(s,X,x[X]);else if(typeof x=="string")P!==void 0?p(P)==="RegExp"?!m(s[x])&&P.test(s[x])?s[x]=void 0:s[x]=T(s[x],P):s[x]===String(P)&&(!m(P)||P.length===1)?s[x]=void 0:m(s[x])&&(s[x]=T(s[x],P)):s[x]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(s,x,P,z){switch(p(x)){case"String":break;case"RegExp":for(var H in s)if(h.call(s,H)&&x.test(H)&&(P===void 0||r.hasQuery(s,H,P)))return!0;return!1;case"Object":for(var X in x)if(h.call(x,X)&&!r.hasQuery(s,X,x[X]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(p(P)){case"Undefined":return x in s;case"Boolean":var ee=!!(m(s[x])?s[x].length:s[x]);return P===ee;case"Function":return!!P(s[x],x,s);case"Array":if(!m(s[x]))return!1;var K=z?y:w;return K(s[x],P);case"RegExp":return m(s[x])?z?y(s[x],P):!1:!!(s[x]&&s[x].match(P));case"Number":P=String(P);case"String":return m(s[x])?z?y(s[x],P):!1:s[x]===P;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var s=[],x=[],P=0,z=0;z<arguments.length;z++){var H=new r(arguments[z]);s.push(H);for(var X=H.segment(),ee=0;ee<X.length;ee++)typeof X[ee]=="string"&&x.push(X[ee]),X[ee]&&P++}if(!x.length||!P)return new r("");var K=new r("").segment(x);return(s[0].path()===""||s[0].path().slice(0,1)==="/")&&K.path("/"+K.path()),K.normalize()},r.commonPath=function(s,x){var P=Math.min(s.length,x.length),z;for(z=0;z<P;z++)if(s.charAt(z)!==x.charAt(z)){z--;break}return z<1?s.charAt(0)===x.charAt(0)&&s.charAt(0)==="/"?"/":"":((s.charAt(z)!=="/"||x.charAt(z)!=="/")&&(z=s.substring(0,z).lastIndexOf("/")),s.substring(0,z+1))},r.withinString=function(s,x,P){P||(P={});var z=P.start||r.findUri.start,H=P.end||r.findUri.end,X=P.trim||r.findUri.trim,ee=P.parens||r.findUri.parens,K=/[a-z0-9-]=["']?$/i;for(z.lastIndex=0;;){var ce=z.exec(s);if(!ce)break;var le=ce.index;if(P.ignoreHtml){var we=s.slice(Math.max(le-3,0),le);if(we&&K.test(we))continue}for(var Se=le+s.slice(le).search(H),Ee=s.slice(le,Se),Le=-1;;){var Ke=ee.exec(Ee);if(!Ke)break;var ct=Ke.index+Ke[0].length;Le=Math.max(Le,ct)}if(Le>-1?Ee=Ee.slice(0,Le)+Ee.slice(Le).replace(X,""):Ee=Ee.replace(X,""),!(Ee.length<=ce[0].length)&&!(P.ignore&&P.ignore.test(Ee))){Se=le+Ee.length;var gt=x(Ee,le,Se,s);if(gt===void 0){z.lastIndex=Se;continue}gt=String(gt),s=s.slice(0,le)+gt+s.slice(Se),z.lastIndex=le+gt.length}}return z.lastIndex=0,s},r.ensureValidHostname=function(s,x){var P=!!s,z=!!x,H=!1;if(z&&(H=y(r.hostProtocols,x)),H&&!P)throw new TypeError("Hostname cannot be empty, if protocol is "+x);if(s&&s.match(r.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+s+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(s).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+s+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(s){if(s){var x=Number(s);if(!(f(x)&&x>0&&x<65536))throw new TypeError('Port "'+s+'" is not a valid port')}},r.noConflict=function(s){if(s){var x={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(x.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(x.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(x.SecondLevelDomains=o.SecondLevelDomains.noConflict()),x}else o.URI===this&&(o.URI=a);return this},c.build=function(s){return s===!0?this._deferred_build=!0:(s===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},c.clone=function(){return new r(this)},c.valueOf=c.toString=function(){return this.build(!1)._string};function F(s){return function(x,P){return x===void 0?this._parts[s]||"":(this._parts[s]=x||null,this.build(!P),this)}}function N(s,x){return function(P,z){return P===void 0?this._parts[s]||"":(P!==null&&(P=P+"",P.charAt(0)===x&&(P=P.substring(1))),this._parts[s]=P,this.build(!z),this)}}c.protocol=F("protocol"),c.username=F("username"),c.password=F("password"),c.hostname=F("hostname"),c.port=F("port"),c.query=N("query","?"),c.fragment=N("fragment","#"),c.search=function(s,x){var P=this.query(s,x);return typeof P=="string"&&P.length?"?"+P:P},c.hash=function(s,x){var P=this.fragment(s,x);return typeof P=="string"&&P.length?"#"+P:P},c.pathname=function(s,x){if(s===void 0||s===!0){var P=this._parts.path||(this._parts.hostname?"/":"");return s?(this._parts.urn?r.decodeUrnPath:r.decodePath)(P):P}else return this._parts.urn?this._parts.path=s?r.recodeUrnPath(s):"":this._parts.path=s?r.recodePath(s):"/",this.build(!x),this},c.path=c.pathname,c.href=function(s,x){var P;if(s===void 0)return this.toString();this._string="",this._parts=r._parts();var z=s instanceof r,H=typeof s=="object"&&(s.hostname||s.path||s.pathname);if(s.nodeName){var X=r.getDomAttribute(s);s=s[X]||"",H=!1}if(!z&&H&&s.pathname!==void 0&&(s=s.toString()),typeof s=="string"||s instanceof String)this._parts=r.parse(String(s),this._parts);else if(z||H){var ee=z?s._parts:s;for(P in ee)P!=="query"&&h.call(this._parts,P)&&(this._parts[P]=ee[P]);ee.query&&this.query(ee.query,!1)}else throw new TypeError("invalid input");return this.build(!x),this},c.is=function(s){var x=!1,P=!1,z=!1,H=!1,X=!1,ee=!1,K=!1,ce=!this._parts.urn;switch(this._parts.hostname&&(ce=!1,P=r.ip4_expression.test(this._parts.hostname),z=r.ip6_expression.test(this._parts.hostname),x=P||z,H=!x,X=H&&i&&i.has(this._parts.hostname),ee=H&&r.idn_expression.test(this._parts.hostname),K=H&&r.punycode_expression.test(this._parts.hostname)),s.toLowerCase()){case"relative":return ce;case"absolute":return!ce;case"domain":case"name":return H;case"sld":return X;case"ip":return x;case"ip4":case"ipv4":case"inet4":return P;case"ip6":case"ipv6":case"inet6":return z;case"idn":return ee;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return K}return null};var U=c.protocol,M=c.port,j=c.hostname;c.protocol=function(s,x){if(s&&(s=s.replace(/:(\/\/)?$/,""),!s.match(r.protocol_expression)))throw new TypeError('Protocol "'+s+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return U.call(this,s,x)},c.scheme=c.protocol,c.port=function(s,x){return this._parts.urn?s===void 0?"":this:(s!==void 0&&(s===0&&(s=null),s&&(s+="",s.charAt(0)===":"&&(s=s.substring(1)),r.ensureValidPort(s))),M.call(this,s,x))},c.hostname=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s!==void 0){var P={preventInvalidHostname:this._parts.preventInvalidHostname},z=r.parseHost(s,P);if(z!=="/")throw new TypeError('Hostname "'+s+'" contains characters other than [A-Z0-9.-]');s=P.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(s,this._parts.protocol)}return j.call(this,s,x)},c.origin=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0){var P=this.protocol(),z=this.authority();return z?(P?P+"://":"")+this.authority():""}else{var H=r(s);return this.protocol(H.protocol()).authority(H.authority()).build(!x),this}},c.host=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var P=r.parseHost(s,this._parts);if(P!=="/")throw new TypeError('Hostname "'+s+'" contains characters other than [A-Z0-9.-]');return this.build(!x),this},c.authority=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var P=r.parseAuthority(s,this._parts);if(P!=="/")throw new TypeError('Hostname "'+s+'" contains characters other than [A-Z0-9.-]');return this.build(!x),this},c.userinfo=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0){var P=r.buildUserinfo(this._parts);return P&&P.substring(0,P.length-1)}else return s[s.length-1]!=="@"&&(s+="@"),r.parseUserinfo(s,this._parts),this.build(!x),this},c.resource=function(s,x){var P;return s===void 0?this.path()+this.search()+this.hash():(P=r.parse(s),this._parts.path=P.path,this._parts.query=P.query,this._parts.fragment=P.fragment,this.build(!x),this)},c.subdomain=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,P)||""}else{var z=this._parts.hostname.length-this.domain().length,H=this._parts.hostname.substring(0,z),X=new RegExp("^"+d(H));if(s&&s.charAt(s.length-1)!=="."&&(s+="."),s.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return s&&r.ensureValidHostname(s,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(X,s),this.build(!x),this}},c.domain=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(typeof s=="boolean"&&(x=s,s=void 0),s===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.match(/\./g);if(P&&P.length<2)return this._parts.hostname;var z=this._parts.hostname.length-this.tld(x).length-1;return z=this._parts.hostname.lastIndexOf(".",z-1)+1,this._parts.hostname.substring(z)||""}else{if(!s)throw new TypeError("cannot set domain empty");if(s.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(s,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=s;else{var H=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(H,s)}return this.build(!x),this}},c.tld=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(typeof s=="boolean"&&(x=s,s=void 0),s===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.lastIndexOf("."),z=this._parts.hostname.substring(P+1);return x!==!0&&i&&i.list[z.toLowerCase()]&&i.get(this._parts.hostname)||z}else{var H;if(s)if(s.match(/[^a-zA-Z0-9-]/))if(i&&i.is(s))H=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(H,s);else throw new TypeError('TLD "'+s+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");H=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(H,s)}else throw new TypeError("cannot set TLD empty");return this.build(!x),this}},c.directory=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0||s===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var P=this._parts.path.length-this.filename().length-1,z=this._parts.path.substring(0,P)||(this._parts.hostname?"/":"");return s?r.decodePath(z):z}else{var H=this._parts.path.length-this.filename().length,X=this._parts.path.substring(0,H),ee=new RegExp("^"+d(X));return this.is("relative")||(s||(s="/"),s.charAt(0)!=="/"&&(s="/"+s)),s&&s.charAt(s.length-1)!=="/"&&(s+="/"),s=r.recodePath(s),this._parts.path=this._parts.path.replace(ee,s),this.build(!x),this}},c.filename=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(typeof s!="string"){if(!this._parts.path||this._parts.path==="/")return"";var P=this._parts.path.lastIndexOf("/"),z=this._parts.path.substring(P+1);return s?r.decodePathSegment(z):z}else{var H=!1;s.charAt(0)==="/"&&(s=s.substring(1)),s.match(/\.?\//)&&(H=!0);var X=new RegExp(d(this.filename())+"$");return s=r.recodePath(s),this._parts.path=this._parts.path.replace(X,s),H?this.normalizePath(x):this.build(!x),this}},c.suffix=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0||s===!0){if(!this._parts.path||this._parts.path==="/")return"";var P=this.filename(),z=P.lastIndexOf("."),H,X;return z===-1?"":(H=P.substring(z+1),X=/^[a-z0-9%]+$/i.test(H)?H:"",s?r.decodePathSegment(X):X)}else{s.charAt(0)==="."&&(s=s.substring(1));var ee=this.suffix(),K;if(ee)s?K=new RegExp(d(ee)+"$"):K=new RegExp(d("."+ee)+"$");else{if(!s)return this;this._parts.path+="."+r.recodePath(s)}return K&&(s=r.recodePath(s),this._parts.path=this._parts.path.replace(K,s)),this.build(!x),this}},c.segment=function(s,x,P){var z=this._parts.urn?":":"/",H=this.path(),X=H.substring(0,1)==="/",ee=H.split(z);if(s!==void 0&&typeof s!="number"&&(P=x,x=s,s=void 0),s!==void 0&&typeof s!="number")throw new Error('Bad segment "'+s+'", must be 0-based integer');if(X&&ee.shift(),s<0&&(s=Math.max(ee.length+s,0)),x===void 0)return s===void 0?ee:ee[s];if(s===null||ee[s]===void 0)if(m(x)){ee=[];for(var K=0,ce=x.length;K<ce;K++)!x[K].length&&(!ee.length||!ee[ee.length-1].length)||(ee.length&&!ee[ee.length-1].length&&ee.pop(),ee.push(A(x[K])))}else(x||typeof x=="string")&&(x=A(x),ee[ee.length-1]===""?ee[ee.length-1]=x:ee.push(x));else x?ee[s]=A(x):ee.splice(s,1);return X&&ee.unshift(""),this.path(ee.join(z),P)},c.segmentCoded=function(s,x,P){var z,H,X;if(typeof s!="number"&&(P=x,x=s,s=void 0),x===void 0){if(z=this.segment(s,x,P),!m(z))z=z!==void 0?r.decode(z):void 0;else for(H=0,X=z.length;H<X;H++)z[H]=r.decode(z[H]);return z}if(!m(x))x=typeof x=="string"||x instanceof String?r.encode(x):x;else for(H=0,X=x.length;H<X;H++)x[H]=r.encode(x[H]);return this.segment(s,x,P)};var Y=c.query;return c.query=function(s,x){if(s===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof s=="function"){var P=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),z=s.call(this,P);return this._parts.query=r.buildQuery(z||P,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!x),this}else return s!==void 0&&typeof s!="string"?(this._parts.query=r.buildQuery(s,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!x),this):Y.call(this,s,x)},c.setQuery=function(s,x,P){var z=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof s=="string"||s instanceof String)z[s]=x!==void 0?x:null;else if(typeof s=="object")for(var H in s)h.call(s,H)&&(z[H]=s[H]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof s!="string"&&(P=x),this.build(!P),this},c.addQuery=function(s,x,P){var z=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(z,s,x===void 0?null:x),this._parts.query=r.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof s!="string"&&(P=x),this.build(!P),this},c.removeQuery=function(s,x,P){var z=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(z,s,x),this._parts.query=r.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof s!="string"&&(P=x),this.build(!P),this},c.hasQuery=function(s,x,P){var z=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(z,s,x,P)},c.setSearch=c.setQuery,c.addSearch=c.addQuery,c.removeSearch=c.removeQuery,c.hasSearch=c.hasQuery,c.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},c.normalizeProtocol=function(s){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!s)),this},c.normalizeHostname=function(s){return this._parts.hostname&&(this.is("IDN")&&t?this._parts.hostname=t.toASCII(this._parts.hostname):this.is("IPv6")&&n&&(this._parts.hostname=n.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!s)),this},c.normalizePort=function(s){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!s)),this},c.normalizePath=function(s){var x=this._parts.path;if(!x)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!s),this;if(this._parts.path==="/")return this;x=r.recodePath(x);var P,z="",H,X;for(x.charAt(0)!=="/"&&(P=!0,x="/"+x),(x.slice(-3)==="/.."||x.slice(-2)==="/.")&&(x+="/"),x=x.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),P&&(z=x.substring(1).match(/^(\.\.\/)+/)||"",z&&(z=z[0]));H=x.search(/\/\.\.(\/|$)/),H!==-1;){if(H===0){x=x.substring(3);continue}X=x.substring(0,H).lastIndexOf("/"),X===-1&&(X=H),x=x.substring(0,X)+x.substring(H+3)}return P&&this.is("relative")&&(x=z+x.substring(1)),this._parts.path=x,this.build(!s),this},c.normalizePathname=c.normalizePath,c.normalizeQuery=function(s){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!s)),this},c.normalizeFragment=function(s){return this._parts.fragment||(this._parts.fragment=null,this.build(!s)),this},c.normalizeSearch=c.normalizeQuery,c.normalizeHash=c.normalizeFragment,c.iso8859=function(){var s=r.encode,x=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=s,r.decode=x}return this},c.unicode=function(){var s=r.encode,x=r.decode;r.encode=b,r.decode=unescape;try{this.normalize()}finally{r.encode=s,r.decode=x}return this},c.readable=function(){var s=this.clone();s.username("").password("").normalize();var x="";if(s._parts.protocol&&(x+=s._parts.protocol+"://"),s._parts.hostname&&(s.is("punycode")&&t?(x+=t.toUnicode(s._parts.hostname),s._parts.port&&(x+=":"+s._parts.port)):x+=s.host()),s._parts.hostname&&s._parts.path&&s._parts.path.charAt(0)!=="/"&&(x+="/"),x+=s.path(!0),s._parts.query){for(var P="",z=0,H=s._parts.query.split("&"),X=H.length;z<X;z++){var ee=(H[z]||"").split("=");P+="&"+r.decodeQuery(ee[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),ee[1]!==void 0&&(P+="="+r.decodeQuery(ee[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}x+="?"+P.substring(1)}return x+=r.decodeQuery(s.hash(),!0),x},c.absoluteTo=function(s){var x=this.clone(),P=["protocol","username","password","hostname","port"],z,H,X;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(s instanceof r||(s=new r(s)),x._parts.protocol||(x._parts.protocol=s._parts.protocol,this._parts.hostname))return x;for(H=0;X=P[H];H++)x._parts[X]=s._parts[X];return x._parts.path?(x._parts.path.substring(-2)===".."&&(x._parts.path+="/"),x.path().charAt(0)!=="/"&&(z=s.directory(),z=z||(s.path().indexOf("/")===0?"/":""),x._parts.path=(z?z+"/":"")+x._parts.path,x.normalizePath())):(x._parts.path=s._parts.path,x._parts.query||(x._parts.query=s._parts.query)),x.build(),x},c.relativeTo=function(s){var x=this.clone().normalize(),P,z,H,X,ee;if(x._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(s=new r(s).normalize(),P=x._parts,z=s._parts,X=x.path(),ee=s.path(),X.charAt(0)!=="/")throw new Error("URI is already relative");if(ee.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(P.protocol===z.protocol&&(P.protocol=null),P.username!==z.username||P.password!==z.password||P.protocol!==null||P.username!==null||P.password!==null)return x.build();if(P.hostname===z.hostname&&P.port===z.port)P.hostname=null,P.port=null;else return x.build();if(X===ee)return P.path="",x.build();if(H=r.commonPath(X,ee),!H)return x.build();var K=z.path.substring(H.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return P.path=K+P.path.substring(H.length)||"./",x.build()},c.equals=function(s){var x=this.clone(),P=new r(s),z={},H={},X={},ee,K,ce;if(x.normalize(),P.normalize(),x.toString()===P.toString())return!0;if(ee=x.query(),K=P.query(),x.query(""),P.query(""),x.toString()!==P.toString()||ee.length!==K.length)return!1;z=r.parseQuery(ee,this._parts.escapeQuerySpace),H=r.parseQuery(K,this._parts.escapeQuerySpace);for(ce in z)if(h.call(z,ce)){if(m(z[ce])){if(!w(z[ce],H[ce]))return!1}else if(z[ce]!==H[ce])return!1;X[ce]=!0}for(ce in H)if(h.call(H,ce)&&!X[ce])return!1;return!0},c.preventInvalidHostname=function(s){return this._parts.preventInvalidHostname=!!s,this},c.duplicateQueryParameters=function(s){return this._parts.duplicateQueryParameters=!!s,this},c.escapeQuerySpace=function(s){return this._parts.escapeQuerySpace=!!s,this},r})})(jf);var $_=jf.exports;const mi=lr($_);function Z_(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}function cn(e,t){if(e===null||typeof e!="object")return e;t=g(t,!1);const n=new e.constructor;for(const i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=cn(o,t)),n[i]=o}return n}function hn(e,t,n){n=g(n,!1);const i={},o=l(e),a=l(t);let r,f,c;if(o)for(r in e)e.hasOwnProperty(r)&&(f=e[r],a&&n&&typeof f=="object"&&t.hasOwnProperty(r)?(c=t[r],typeof c=="object"?i[r]=hn(f,c,n):i[r]=f):i[r]=f);if(a)for(r in t)t.hasOwnProperty(r)&&!i.hasOwnProperty(r)&&(c=t[r],i[r]=c);return i}function ss(){let e,t;const n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}function rs(e,t){let n;return typeof document<"u"&&(n=document),rs._implementation(e,t,n)}rs._implementation=function(e,t,n){if(!l(e))throw new C("relative uri is required.");if(!l(t)){if(typeof n>"u")return e;t=g(n.baseURI,n.location.href)}const i=new mi(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};function K_(e,t){if(!l(e))throw new C("uri is required.");let n="";const i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new mi(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}function Q_(e){if(!l(e))throw new C("uri is required.");const t=new mi(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}const Zf={};function Kf(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Zf[t];l(i)||(i={},Zf[t]=i);let o=i[n];if(!l(o)){const a=document.createElement("canvas");a.width=t,a.height=n,o=a.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}const J_=/^blob:/i;function Qf(e){return _.typeOf.string("uri",e),J_.test(e)}let $n;function hc(e){l($n)||($n=document.createElement("a")),$n.href=window.location.href;const t=$n.host,n=$n.protocol;return $n.href=e,$n.href=$n.href,n!==$n.protocol||t!==$n.host}const e1=/^data:/i;function Jf(e){return _.typeOf.string("uri",e),e1.test(e)}function t1(e){const t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");const o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(a){i(a)},o.appendChild(t)})}function n1(e){if(!l(e))throw new C("obj is required.");let t="";for(const n in e)if(e.hasOwnProperty(n)){const i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let a=0,r=i.length;a<r;++a)t+=`${o+encodeURIComponent(i[a])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}function i1(e){if(!l(e))throw new C("queryString is required.");const t={};if(e==="")return t;const n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){const a=n[i].split("="),r=decodeURIComponent(a[0]);let f=a[1];l(f)?f=decodeURIComponent(f):f="";const c=t[r];typeof c=="string"?t[r]=[c,f]:Array.isArray(c)?c.push(f):t[r]=f}return t}const yt=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),o1=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function Pr(e){e=g(e,g.EMPTY_OBJECT);const t=g(e.throttleByServer,!1),n=g(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=g(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=g(e.type,o1.OTHER),this.serverKey=e.serverKey,this.state=yt.UNISSUED,this.deferred=void 0,this.cancelled=!1}Pr.prototype.cancel=function(){this.cancelled=!0},Pr.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=yt.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Pr(this)};function s1(e){const t={};if(!e)return t;const n=e.split(`\r
44
- `);for(let i=0;i<n.length;++i){const o=n[i],a=o.indexOf(": ");if(a>0){const r=o.substring(0,a),f=o.substring(a+2);t[r]=f}}return t}function as(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=s1(this.responseHeaders))}as.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};function Ne(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(Ne.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),Ne.prototype.addEventListener=function(e,t){_.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);const n=this;return function(){n.removeEventListener(e,t)}},Ne.prototype.removeEventListener=function(e,t){_.typeOf.func("listener",e);const n=this._listeners,i=this._scopes;let o=-1;for(let a=0;a<n.length;a++)if(n[a]===e&&i[a]===t){o=a;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function r1(e,t){return t-e}Ne.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e;const t=this._listeners,n=this._scopes;let i=t.length;for(e=0;e<i;e++){const a=t[e];l(a)&&t[e].apply(n[e],arguments)}const o=this._toRemove;if(i=o.length,i>0){for(o.sort(r1),e=0;e<i;e++){const a=o[e];t.splice(a,1),n.splice(a,1)}o.length=0}this._insideRaiseEvent=!1};function Ji(e){_.typeOf.object("options",e),_.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Ji.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){_.typeOf.number.greaterThanOrEquals("maximumLength",e,0);const t=this._length;if(e<t){const n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function fc(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}Ji.prototype.reserve=function(e){e=g(e,this._length),this._array.length=e},Ji.prototype.heapify=function(e){e=g(e,0);const t=this._length,n=this._comparator,i=this._array;let o=-1,a=!0;for(;a;){const r=2*(e+1),f=r-1;f<t&&n(i[f],i[e])<0?o=f:o=e,r<t&&n(i[r],i[o])<0&&(o=r),o!==e?(fc(i,o,e),e=o):a=!1}},Ji.prototype.resort=function(){const e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},Ji.prototype.insert=function(e){_.defined("element",e);const t=this._array,n=this._comparator,i=this._maximumLength;let o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){const r=Math.floor((o-1)/2);if(n(t[o],t[r])<0)fc(t,o,r),o=r;else break}let a;return l(i)&&this._length>i&&(a=t[i],this._length=i),a},Ji.prototype.pop=function(e){if(e=g(e,0),this._length===0)return;_.typeOf.number.lessThan("index",e,this._length);const t=this._array,n=t[e];return fc(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};function a1(e,t){return e.priority-t.priority}const ke={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let Do=20;const $t=new Ji({comparator:a1});$t.maximumLength=Do,$t.reserve(Do);const Zn=[];let _i={};const c1=typeof document<"u"?new mi(document.location.href):new mi,Br=new Ne;function Je(){}Je.maximumRequests=50,Je.maximumRequestsPerServer=18,Je.requestsByServer={},Je.throttleRequests=!0,Je.debugShowStatistics=!1,Je.requestCompletedEvent=Br,Object.defineProperties(Je,{statistics:{get:function(){return ke}},priorityHeapLength:{get:function(){return Do},set:function(e){if(e<Do)for(;$t.length>e;){const t=$t.pop();eo(t)}Do=e,$t.maximumLength=e,$t.reserve(e)}}});function el(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Je.serverHasOpenSlots=function(e,t){t=g(t,1);const n=g(Je.requestsByServer[e],Je.maximumRequestsPerServer);return _i[e]+t<=n},Je.heapHasOpenSlots=function(e){return $t.length+e<=Do};function tl(e){return e.state===yt.UNISSUED&&(e.state=yt.ISSUED,e.deferred=ss()),e.deferred.promise}function h1(e){return function(t){if(e.state===yt.CANCELLED)return;const n=e.deferred;--ke.numberOfActiveRequests,--_i[e.serverKey],Br.raiseEvent(),e.state=yt.RECEIVED,e.deferred=void 0,n.resolve(t)}}function f1(e){return function(t){e.state!==yt.CANCELLED&&(++ke.numberOfFailedRequests,--ke.numberOfActiveRequests,--_i[e.serverKey],Br.raiseEvent(t),e.state=yt.FAILED,e.deferred.reject(t))}}function nl(e){const t=tl(e);return e.state=yt.ACTIVE,Zn.push(e),++ke.numberOfActiveRequests,++ke.numberOfActiveRequestsEver,++_i[e.serverKey],e.requestFunction().then(h1(e)).catch(f1(e)),t}function eo(e){const t=e.state===yt.ACTIVE;if(e.state=yt.CANCELLED,++ke.numberOfCancelledRequests,l(e.deferred)){const n=e.deferred;e.deferred=void 0,n.reject()}t&&(--ke.numberOfActiveRequests,--_i[e.serverKey],++ke.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Je.update=function(){let e,t,n=0;const i=Zn.length;for(e=0;e<i;++e){if(t=Zn[e],t.cancelled&&eo(t),t.state!==yt.ACTIVE){++n;continue}n>0&&(Zn[e-n]=t)}Zn.length-=n;const o=$t.internalArray,a=$t.length;for(e=0;e<a;++e)el(o[e]);$t.resort();const r=Math.max(Je.maximumRequests-Zn.length,0);let f=0;for(;f<r&&$t.length>0;){if(t=$t.pop(),t.cancelled){eo(t);continue}if(t.throttleByServer&&!Je.serverHasOpenSlots(t.serverKey)){eo(t);continue}nl(t),++f}l1()},Je.getServerKey=function(e){_.typeOf.string("url",e);let t=new mi(e);t.scheme()===""&&(t=t.absoluteTo(c1),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);const i=_i[n];return l(i)||(_i[n]=0),n},Je.request=function(e){if(_.typeOf.object("request",e),_.typeOf.string("request.url",e.url),_.typeOf.func("request.requestFunction",e.requestFunction),Jf(e.url)||Qf(e.url))return Br.raiseEvent(),e.state=yt.RECEIVED,e.requestFunction();if(++ke.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Je.getServerKey(e.url)),Je.throttleRequests&&e.throttleByServer&&!Je.serverHasOpenSlots(e.serverKey))return;if(!Je.throttleRequests||!e.throttle)return nl(e);if(Zn.length>=Je.maximumRequests)return;el(e);const t=$t.insert(e);if(l(t)){if(t===e)return;eo(t)}return tl(e)};function l1(){Je.debugShowStatistics&&(ke.numberOfActiveRequests===0&&ke.lastNumberOfActiveRequests>0&&(ke.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${ke.numberOfAttemptedRequests}`),ke.numberOfAttemptedRequests=0),ke.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${ke.numberOfCancelledRequests}`),ke.numberOfCancelledRequests=0),ke.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${ke.numberOfCancelledActiveRequests}`),ke.numberOfCancelledActiveRequests=0),ke.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${ke.numberOfFailedRequests}`),ke.numberOfFailedRequests=0)),ke.lastNumberOfActiveRequests=ke.numberOfActiveRequests)}Je.clearForSpecs=function(){for(;$t.length>0;){const t=$t.pop();eo(t)}const e=Zn.length;for(let t=0;t<e;++t)eo(Zn[t]);Zn.length=0,_i={},ke.numberOfAttemptedRequests=0,ke.numberOfActiveRequests=0,ke.numberOfCancelledRequests=0,ke.numberOfCancelledActiveRequests=0,ke.numberOfFailedRequests=0,ke.numberOfActiveRequestsEver=0,ke.lastNumberOfActiveRequests=0},Je.numberOfActiveRequestsByServer=function(e){return _i[e]},Je.requestHeap=$t;const Oo={};let vo={};Oo.add=function(e,t){if(!l(e))throw new C("host is required.");if(!l(t)||t<=0)throw new C("port is required to be greater than 0.");const n=`${e.toLowerCase()}:${t}`;l(vo[n])||(vo[n]=!0)},Oo.remove=function(e,t){if(!l(e))throw new C("host is required.");if(!l(t)||t<=0)throw new C("port is required to be greater than 0.");const n=`${e.toLowerCase()}:${t}`;l(vo[n])&&delete vo[n]};function u1(e){const t=new mi(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}Oo.contains=function(e){if(!l(e))throw new C("url is required.");const t=u1(e);return!!(l(t)&&l(vo[t]))},Oo.clear=function(){vo={}};const il=function(){try{const e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function ae(e){e=g(e,g.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),_.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Kn(e.templateValues,{}),this._queryParameters=Kn(e.queryParameters,{}),this.headers=Kn(e.headers,{}),this.request=g(e.request,new Pr),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=g(e.retryAttempts,0),this._retryCount=0,g(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Kn(e,t){return l(e)?cn(e):t}ae.createIfNeeded=function(e){return e instanceof ae?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new ae({url:e})};let Wo;ae.supportsImageBitmapOptions=function(){return l(Wo)?Wo:typeof createImageBitmap!="function"?(Wo=Promise.resolve(!1),Wo):(Wo=ae.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){const n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){const n=Kf(t[0]),i=Kf(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),Wo)},Object.defineProperties(ae,{isBlobSupported:{get:function(){return il}}}),Object.defineProperties(ae.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return Q_(this._url)}},isDataUri:{get:function(){return Jf(this._url)}},isBlobUri:{get:function(){return Qf(this._url)}},isCrossOriginUrl:{get:function(){return hc(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),ae.prototype.toString=function(){return this.getUrlComponent(!0,!0)},ae.prototype.parseUrl=function(e,t,n,i){let o=new mi(e);const a=d1(o.query());this._queryParameters=t?Rr(a,this.queryParameters,n):a,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(rs(i))),this._url=o.toString()};function d1(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:i1(e)}function Rr(e,t,n){if(!n)return hn(e,t);const i=cn(e,!0);for(const o in t)if(t.hasOwnProperty(o)){let a=i[o];const r=t[o];l(a)?(Array.isArray(a)||(a=i[o]=[a]),i[o]=a.concat(r)):i[o]=Array.isArray(r)?r.slice():r}return i}ae.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${p1(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");const i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,a){const r=i[a];return l(r)?encodeURIComponent(r):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function p1(e){const t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${n1(e)}`}ae.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Rr(this._queryParameters,e,!1):this._queryParameters=Rr(e,this._queryParameters,!1)},ae.prototype.appendQueryParameters=function(e){this._queryParameters=Rr(e,this._queryParameters,!0)},ae.prototype.setTemplateValues=function(e,t){t?this._templateValues=hn(this._templateValues,e):this._templateValues=hn(e,this._templateValues)},ae.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,l(e.url)){const n=g(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=hn(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=hn(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=hn(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},ae.prototype.retryOnError=function(e){const t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})},ae.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=cn(this._queryParameters),e._templateValues=cn(this._templateValues),e.headers=cn(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new ae({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})},ae.prototype.getBaseUri=function(e){return K_(this.getUrlComponent(e),e)},ae.prototype.appendForwardSlash=function(){this._url=Z_(this._url)},ae.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},ae.fetchArrayBuffer=function(e){return new ae(e).fetchArrayBuffer()},ae.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},ae.fetchBlob=function(e){return new ae(e).fetchBlob()},ae.prototype.fetchImage=function(e){e=g(e,g.EMPTY_OBJECT);const t=g(e.preferImageBitmap,!1),n=g(e.preferBlob,!1),i=g(e.flipY,!1),o=g(e.skipColorSpaceConversion,!1);if(uc(this.request),!il||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return lc({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});const a=this.fetchBlob();if(!l(a))return;let r,f,c,h;return ae.supportsImageBitmapOptions().then(function(d){return r=d,f=r&&t,a}).then(function(d){if(!l(d))return;if(h=d,f)return ae.createImageBitmapFromBlob(d,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});const p=window.URL.createObjectURL(d);return c=new ae({url:p}),lc({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(d){if(l(d))return d.blob=h,f||window.URL.revokeObjectURL(c.url),d}).catch(function(d){return l(c)&&window.URL.revokeObjectURL(c.url),d.blob=h,Promise.reject(d)})};function lc(e){const t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,a=t.request;a.url=t.url,a.requestFunction=function(){let f=!1;!t.isDataUri&&!t.isBlobUri&&(f=t.isCrossOriginUrl);const c=ss();return ae._Implementations.createImage(a,f,c,n,i,o),c.promise};const r=Je.request(a);if(l(r))return r.catch(function(f){return a.state!==yt.FAILED?Promise.reject(f):t.retryOnError(f).then(function(c){return c?(a.state=yt.UNISSUED,a.deferred=void 0,lc({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(f)})})}ae.fetchImage=function(e){return new ae(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},ae.prototype.fetchText=function(){return this.fetch({responseType:"text"})},ae.fetchText=function(e){return new ae(e).fetchText()},ae.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})},ae.fetchJson=function(e){return new ae(e).fetchJson()},ae.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},ae.fetchXML=function(e){return new ae(e).fetchXML()},ae.prototype.fetchJsonp=function(e){e=g(e,"callback"),uc(this.request);let t;do t=`loadJsonp${S.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return ol(this,e,t)};function ol(e,t,n){const i={};i[t]=n,e.setQueryParameters(i);const o=e.request,a=e.url;o.url=a,o.requestFunction=function(){const f=ss();return window[n]=function(c){f.resolve(c);try{delete window[n]}catch{window[n]=void 0}},ae._Implementations.loadAndExecuteScript(a,n,f),f.promise};const r=Je.request(o);if(l(r))return r.catch(function(f){return o.state!==yt.FAILED?Promise.reject(f):e.retryOnError(f).then(function(c){return c?(o.state=yt.UNISSUED,o.deferred=void 0,ol(e,t,n)):Promise.reject(f)})})}ae.fetchJsonp=function(e){return new ae(e).fetchJsonp(e.callbackParameterName)},ae.prototype._makeRequest=function(e){const t=this;uc(t.request);const n=t.request,i=t.url;n.url=i,n.requestFunction=function(){const a=e.responseType,r=hn(e.headers,t.headers),f=e.overrideMimeType,c=e.method,h=e.data,d=ss(),p=ae._Implementations.loadWithXhr(i,a,c,h,r,d,f);return l(p)&&l(p.abort)&&(n.cancelFunction=function(){p.abort()}),d.promise};const o=Je.request(n);if(l(o))return o.then(function(a){return n.cancelFunction=void 0,a}).catch(function(a){return n.cancelFunction=void 0,n.state!==yt.FAILED?Promise.reject(a):t.retryOnError(a).then(function(r){return r?(n.state=yt.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(a)})})};function uc(e){if(e.state===yt.ISSUED||e.state===yt.ACTIVE)throw new dt("The Resource is already being fetched.");e.state=yt.UNISSUED,e.deferred=void 0}const m1=/^data:(.*?)(;base64)?,(.*)$/;function zr(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function sl(e,t){const n=zr(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let a=0;a<n.length;a++)o[a]=n.charCodeAt(a);return i}function _1(e,t){t=g(t,"");const n=e[1],i=!!e[2],o=e[3];let a,r;switch(t){case"":case"text":return zr(i,o);case"arraybuffer":return sl(i,o);case"blob":return a=sl(i,o),new Blob([a],{type:n});case"document":return r=new DOMParser,r.parseFromString(zr(i,o),n);case"json":return JSON.parse(zr(i,o));default:throw new C(`Unhandled responseType: ${t}`)}}ae.prototype.fetch=function(e){return e=Kn(e,{}),e.method="GET",this._makeRequest(e)},ae.fetch=function(e){return new ae(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ae.prototype.delete=function(e){return e=Kn(e,{}),e.method="DELETE",this._makeRequest(e)},ae.delete=function(e){return new ae(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},ae.prototype.head=function(e){return e=Kn(e,{}),e.method="HEAD",this._makeRequest(e)},ae.head=function(e){return new ae(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ae.prototype.options=function(e){return e=Kn(e,{}),e.method="OPTIONS",this._makeRequest(e)},ae.options=function(e){return new ae(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ae.prototype.post=function(e,t){return _.defined("data",e),t=Kn(t,{}),t.method="POST",t.data=e,this._makeRequest(t)},ae.post=function(e){return new ae(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ae.prototype.put=function(e,t){return _.defined("data",e),t=Kn(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)},ae.put=function(e){return new ae(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ae.prototype.patch=function(e,t){return _.defined("data",e),t=Kn(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)},ae.patch=function(e){return new ae(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ae._Implementations={},ae._Implementations.loadImageElement=function(e,t,n){const i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(Oo.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e},ae._Implementations.createImage=function(e,t,n,i,o,a){const r=e.url;ae.supportsImageBitmapOptions().then(function(f){if(!(f&&a)){ae._Implementations.loadImageElement(r,t,n);return}const c="blob",h="GET",d=ss(),p=ae._Implementations.loadWithXhr(r,c,h,void 0,void 0,d,void 0,void 0,void 0);return l(p)&&l(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise.then(function(m){if(!l(m)){n.reject(new dt(`Successfully retrieved ${r} but it contained no content.`));return}return ae.createImageBitmapFromBlob(m,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(m){n.resolve(m)})}).catch(function(f){n.reject(f)})},ae.createImageBitmapFromBlob=function(e,t){return _.defined("options",t),_.typeOf.bool("options.flipY",t.flipY),_.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),_.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function g1(e,t,n,i,o,a,r){fetch(e,{method:n,headers:o}).then(async f=>{if(!f.ok){const c={};f.headers.forEach((h,d)=>{c[d]=h}),a.reject(new as(f.status,f,c));return}switch(t){case"text":a.resolve(f.text());break;case"json":a.resolve(f.json());break;default:a.resolve(new Uint8Array(await f.arrayBuffer()).buffer);break}}).catch(()=>{a.reject(new as)})}const T1=typeof XMLHttpRequest>"u";ae._Implementations.loadWithXhr=function(e,t,n,i,o,a,r){const f=m1.exec(e);if(f!==null){a.resolve(_1(f,t));return}if(T1){g1(e,t,n,i,o,a);return}const c=new XMLHttpRequest;if(Oo.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(r)&&l(c.overrideMimeType)&&c.overrideMimeType(r),l(o))for(const d in o)o.hasOwnProperty(d)&&c.setRequestHeader(d,o[d]);l(t)&&(c.responseType=t);let h=!1;return typeof e=="string"&&(h=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(h&&c.status===0)){a.reject(new as(c.status,c.response,c.getAllResponseHeaders()));return}const d=c.response,p=c.responseType;if(n==="HEAD"||n==="OPTIONS"){const T=c.getAllResponseHeaders().trim().split(/[\r\n]+/),y={};T.forEach(function(w){const A=w.split(": "),E=A.shift();y[E]=A.join(": ")}),a.resolve(y);return}if(c.status===204)a.resolve(void 0);else if(l(d)&&(!l(t)||p===t))a.resolve(d);else if(t==="json"&&typeof d=="string")try{a.resolve(JSON.parse(d))}catch(m){a.reject(m)}else(p===""||p==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?a.resolve(c.responseXML):(p===""||p==="text")&&l(c.responseText)?a.resolve(c.responseText):a.reject(new dt("Invalid XMLHttpRequest response type."))},c.onerror=function(d){a.reject(new as)},c.send(i),c},ae._Implementations.loadAndExecuteScript=function(e,t,n){return t1(e).catch(function(i){n.reject(i)})},ae._DefaultImplementations={},ae._DefaultImplementations.createImage=ae._Implementations.createImage,ae._DefaultImplementations.loadWithXhr=ae._Implementations.loadWithXhr,ae._DefaultImplementations.loadAndExecuteScript=ae._Implementations.loadAndExecuteScript,ae.DEFAULT=Object.freeze(new ae({url:typeof document>"u"?"":document.location.href.split("?")[0]}));function cs(e){e=g(e,g.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=g(e.addNewLeapSeconds,!0),l(e.data)?rl(this,e.data):rl(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}cs.fromUrl=async function(e,t){_.defined("url",e),t=g(t,g.EMPTY_OBJECT);const n=ae.createIfNeeded(e);let i;try{i=await n.fetchJson()}catch{throw new dt(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new cs({addNewLeapSeconds:t.addNewLeapSeconds,data:i})},cs.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new tc(0,0,0,0,0),t}}),cs.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new tc(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;const n=this._dates,i=this._lastIndex;let o=0,a=0;if(l(i)){const f=n[i],c=n[i+1],h=J.lessThanOrEquals(f,e),d=!l(c),p=d||J.greaterThanOrEquals(c,e);if(h&&p)return o=i,!d&&c.equals(e)&&++o,a=o+1,cl(this,n,this._samples,e,o,a,t),t}let r=is(n,e,J.compare,this._dateColumn);return r>=0?(r<n.length-1&&n[r+1].equals(e)&&++r,o=r,a=r):(a=~r,o=a-1,o<0&&(o=0)),this._lastIndex=o,cl(this,n,this._samples,e,o,a,t),t};function y1(e,t){return J.compare(e.julianDate,t)}function rl(e,t){if(!l(t.columnNames))throw new dt("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new dt("Error in loaded EOP data: The samples property is required.");const n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),a=t.columnNames.indexOf("ut1MinusUtcSeconds"),r=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),f=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||a<0||r<0||f<0||c<0)throw new dt("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const h=e._samples=t.samples,d=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=a,e._xCelestialPoleOffsetRadiansColumn=r,e._yCelestialPoleOffsetRadiansColumn=f,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let p;const m=e._addNewLeapSeconds;for(let T=0,y=h.length;T<y;T+=e._columnCount){const w=h[T+n],A=h[T+c],E=w+ht.MODIFIED_JULIAN_DATE_DIFFERENCE,b=new J(E,A,Be.TAI);if(d.push(b),m){if(A!==p&&l(p)){const I=J.leapSeconds,O=is(I,b,y1);if(O<0){const B=new Ye(b,A);I.splice(~O,0,B)}}p=A}}}function al(e,t,n,i,o){const a=n*i;o.xPoleWander=t[a+e._xPoleWanderRadiansColumn],o.yPoleWander=t[a+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[a+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[a+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[a+e._ut1MinusUtcSecondsColumn]}function hs(e,t,n){return t+e*(n-t)}function cl(e,t,n,i,o,a,r){const f=e._columnCount;if(a>t.length-1)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;const c=t[o],h=t[a];if(c.equals(h)||i.equals(c))return al(e,n,o,f,r),r;if(i.equals(h))return al(e,n,a,f,r),r;const d=J.secondsDifference(i,c)/J.secondsDifference(h,c),p=o*f,m=a*f;let T=n[p+e._ut1MinusUtcSecondsColumn],y=n[m+e._ut1MinusUtcSecondsColumn];const w=y-T;if(w>.5||w<-.5){const A=n[p+e._taiMinusUtcSecondsColumn],E=n[m+e._taiMinusUtcSecondsColumn];A!==E&&(h.equals(i)?T=y:y-=E-A)}return r.xPoleWander=hs(d,n[p+e._xPoleWanderRadiansColumn],n[m+e._xPoleWanderRadiansColumn]),r.yPoleWander=hs(d,n[p+e._yPoleWanderRadiansColumn],n[m+e._yPoleWanderRadiansColumn]),r.xPoleOffset=hs(d,n[p+e._xCelestialPoleOffsetRadiansColumn],n[m+e._xCelestialPoleOffsetRadiansColumn]),r.yPoleOffset=hs(d,n[p+e._yCelestialPoleOffsetRadiansColumn],n[m+e._yCelestialPoleOffsetRadiansColumn]),r.ut1MinusUtc=hs(d,T,y),r}function He(e,t,n){this.heading=g(e,0),this.pitch=g(t,0),this.roll=g(n,0)}He.fromQuaternion=function(e,t){if(!l(e))throw new C("quaternion is required");l(t)||(t=new He);const n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),a=1-2*(e.y*e.y+e.z*e.z),r=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(r,a),t.roll=Math.atan2(o,i),t.pitch=-S.asinClamped(n),t},He.fromDegrees=function(e,t,n,i){if(!l(e))throw new C("heading is required");if(!l(t))throw new C("pitch is required");if(!l(n))throw new C("roll is required");return l(i)||(i=new He),i.heading=e*S.RADIANS_PER_DEGREE,i.pitch=t*S.RADIANS_PER_DEGREE,i.roll=n*S.RADIANS_PER_DEGREE,i},He.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new He(e.heading,e.pitch,e.roll)},He.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},He.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&S.equalsEpsilon(e.heading,t.heading,n,i)&&S.equalsEpsilon(e.pitch,t.pitch,n,i)&&S.equalsEpsilon(e.roll,t.roll,n,i)},He.prototype.clone=function(e){return He.clone(this,e)},He.prototype.equals=function(e){return He.equals(this,e)},He.prototype.equalsEpsilon=function(e,t,n){return He.equalsEpsilon(this,e,t,n)},He.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const hl=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function C1(){const e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){const i=e[t].getAttribute("src"),o=hl.exec(i);if(o!==null)return o[1]}}let Lr;function fl(e){return typeof document>"u"?e:(l(Lr)||(Lr=document.createElement("a")),Lr.href=e,Lr.href)}let to;function ll(){if(l(to))return to;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:zt&&zt.tagName.toUpperCase()==="SCRIPT"&&zt.src||new URL("OW_EEngine_Power.umd.cjs",document.baseURI).href)?e=rs(".",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:zt&&zt.tagName.toUpperCase()==="SCRIPT"&&zt.src||new URL("OW_EEngine_Power.umd.cjs",document.baseURI).href):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=rs("..",_n("Core/buildModuleUrl.js")):e=C1(),!l(e))throw new C("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return to=new ae({url:fl(e)}),to.appendForwardSlash(),to}function w1(e){return fl(require.toUrl(`../${e}`))}function ul(e){return ll().getDerivedResource({url:e}).url}let Nr;function _n(e){return l(Nr)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?Nr=w1:Nr=ul),Nr(e)}_n._cesiumScriptRegex=hl,_n._buildModuleUrlFromBaseUrl=ul,_n._clearBaseResource=function(){to=void 0},_n.setBaseUrl=function(e){to=ae.DEFAULT.getDerivedResource({url:e})},_n.getCesiumBaseUrl=ll;function dl(e,t,n){this.x=e,this.y=t,this.s=n}function dc(e){e=g(e,g.EMPTY_OBJECT),this._xysFileUrlTemplate=ae.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=g(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=g(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new J(this._sampleZeroJulianEphemerisDate,0,Be.TAI),this._stepSizeDays=g(e.stepSizeDays,1),this._samplesPerXysFile=g(e.samplesPerXysFile,1e3),this._totalSamples=g(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];const t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let a=0;a<=t;++a){n[a]=o,i[a]=a*this._stepSizeDays;for(let r=0;r<=t;++r)r!==a&&(n[a]*=a-r);n[a]=1/n[a]}this._work=new Array(t+1),this._coef=new Array(t+1)}const A1=new J(0,0,Be.TAI);function pc(e,t,n){const i=A1;return i.dayNumber=t,i.secondsOfDay=n,J.daysDifference(i,e._sampleZeroDateTT)}dc.prototype.preload=function(e,t,n,i){const o=pc(this,e,t),a=pc(this,n,i);let r=o/this._stepSizeDays-this._interpolationOrder/2|0;r<0&&(r=0);let f=a/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;f>=this._totalSamples&&(f=this._totalSamples-1);const c=r/this._samplesPerXysFile|0,h=f/this._samplesPerXysFile|0,d=[];for(let p=c;p<=h;++p)d.push(mc(this,p));return Promise.all(d)},dc.prototype.computeXysRadians=function(e,t,n){const i=pc(this,e,t);if(i<0)return;const o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;const a=this._interpolationOrder;let r=o-(a/2|0);r<0&&(r=0);let f=r+a;f>=this._totalSamples&&(f=this._totalSamples-1,r=f-a,r<0&&(r=0));let c=!1;const h=this._samples;if(l(h[r*3])||(mc(this,r/this._samplesPerXysFile|0),c=!0),l(h[f*3])||(mc(this,f/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new dl(0,0,0);const d=i-r*this._stepSizeDays,p=this._work,m=this._denominators,T=this._coef,y=this._xTable;let w,A;for(w=0;w<=a;++w)p[w]=d-y[w];for(w=0;w<=a;++w){for(T[w]=1,A=0;A<=a;++A)A!==w&&(T[w]*=p[A]);T[w]*=m[w];let E=(r+w)*3;n.x+=T[w]*h[E++],n.y+=T[w]*h[E++],n.s+=T[w]*h[E]}return n};function mc(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n;const i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new ae({url:_n(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});const o=n.fetchJson().then(function(a){e._chunkDownloadsInProgress[t]=!1;const r=e._samples,f=a.samples,c=t*e._samplesPerXysFile*3;for(let h=0,d=f.length;h<d;++h)r[c+h]=f[h]});return e._chunkDownloadsInProgress[t]=o,o}function ie(e,t,n,i){this.x=g(e,0),this.y=g(t,0),this.z=g(n,0),this.w=g(i,0)}let fs=new u;ie.fromAxisAngle=function(e,t,n){_.typeOf.object("axis",e),_.typeOf.number("angle",t);const i=t/2,o=Math.sin(i);fs=u.normalize(e,fs);const a=fs.x*o,r=fs.y*o,f=fs.z*o,c=Math.cos(i);return l(n)?(n.x=a,n.y=r,n.z=f,n.w=c,n):new ie(a,r,f,c)};const E1=[1,2,0],b1=new Array(3);ie.fromRotationMatrix=function(e,t){_.typeOf.object("matrix",e);let n,i,o,a,r;const f=e[G.COLUMN0ROW0],c=e[G.COLUMN1ROW1],h=e[G.COLUMN2ROW2],d=f+c+h;if(d>0)n=Math.sqrt(d+1),r=.5*n,n=.5/n,i=(e[G.COLUMN1ROW2]-e[G.COLUMN2ROW1])*n,o=(e[G.COLUMN2ROW0]-e[G.COLUMN0ROW2])*n,a=(e[G.COLUMN0ROW1]-e[G.COLUMN1ROW0])*n;else{const p=E1;let m=0;c>f&&(m=1),h>f&&h>c&&(m=2);const T=p[m],y=p[T];n=Math.sqrt(e[G.getElementIndex(m,m)]-e[G.getElementIndex(T,T)]-e[G.getElementIndex(y,y)]+1);const w=b1;w[m]=.5*n,n=.5/n,r=(e[G.getElementIndex(y,T)]-e[G.getElementIndex(T,y)])*n,w[T]=(e[G.getElementIndex(T,m)]+e[G.getElementIndex(m,T)])*n,w[y]=(e[G.getElementIndex(y,m)]+e[G.getElementIndex(m,y)])*n,i=-w[0],o=-w[1],a=-w[2]}return l(t)?(t.x=i,t.y=o,t.z=a,t.w=r,t):new ie(i,o,a,r)};const pl=new ie;let ml=new ie,_c=new ie,_l=new ie;ie.fromHeadingPitchRoll=function(e,t){return _.typeOf.object("headingPitchRoll",e),_l=ie.fromAxisAngle(u.UNIT_X,e.roll,pl),_c=ie.fromAxisAngle(u.UNIT_Y,-e.pitch,t),t=ie.multiply(_c,_l,_c),ml=ie.fromAxisAngle(u.UNIT_Z,-e.heading,pl),ie.multiply(ml,t,t)};const Fr=new u,gc=new u,Bn=new ie,gl=new ie,Mr=new ie;ie.packedLength=4,ie.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},ie.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new ie),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},ie.packedInterpolationLength=3,ie.convertPackedArrayForInterpolation=function(e,t,n,i){ie.unpack(e,n*4,Mr),ie.conjugate(Mr,Mr);for(let o=0,a=n-t+1;o<a;o++){const r=o*3;ie.unpack(e,(t+o)*4,Bn),ie.multiply(Bn,Mr,Bn),Bn.w<0&&ie.negate(Bn,Bn),ie.computeAxis(Bn,Fr);const f=ie.computeAngle(Bn);l(i)||(i=[]),i[r]=Fr.x*f,i[r+1]=Fr.y*f,i[r+2]=Fr.z*f}},ie.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new ie),u.fromArray(e,0,gc);const a=u.magnitude(gc);return ie.unpack(t,i*4,gl),a===0?ie.clone(ie.IDENTITY,Bn):ie.fromAxisAngle(gc,a,Bn),ie.multiply(Bn,gl,o)},ie.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new ie(e.x,e.y,e.z,e.w)},ie.conjugate=function(e,t){return _.typeOf.object("quaternion",e),_.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},ie.magnitudeSquared=function(e){return _.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},ie.magnitude=function(e){return Math.sqrt(ie.magnitudeSquared(e))},ie.normalize=function(e,t){_.typeOf.object("result",t);const n=1/ie.magnitude(e),i=e.x*n,o=e.y*n,a=e.z*n,r=e.w*n;return t.x=i,t.y=o,t.z=a,t.w=r,t},ie.inverse=function(e,t){_.typeOf.object("result",t);const n=ie.magnitudeSquared(e);return t=ie.conjugate(e,t),ie.multiplyByScalar(t,1/n,t)},ie.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},ie.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},ie.negate=function(e,t){return _.typeOf.object("quaternion",e),_.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},ie.dot=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},ie.multiply=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n);const i=e.x,o=e.y,a=e.z,r=e.w,f=t.x,c=t.y,h=t.z,d=t.w,p=r*f+i*d+o*h-a*c,m=r*c-i*h+o*d+a*f,T=r*h+i*c-o*f+a*d,y=r*d-i*f-o*c-a*h;return n.x=p,n.y=m,n.z=T,n.w=y,n},ie.multiplyByScalar=function(e,t,n){return _.typeOf.object("quaternion",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},ie.divideByScalar=function(e,t,n){return _.typeOf.object("quaternion",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},ie.computeAxis=function(e,t){_.typeOf.object("quaternion",e),_.typeOf.object("result",t);const n=e.w;if(Math.abs(n-1)<S.EPSILON6||Math.abs(n+1)<S.EPSILON6)return t.x=1,t.y=t.z=0,t;const i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t},ie.computeAngle=function(e){return _.typeOf.object("quaternion",e),Math.abs(e.w-1)<S.EPSILON6?0:2*Math.acos(e.w)};let Tc=new ie;ie.lerp=function(e,t,n,i){return _.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i),Tc=ie.multiplyByScalar(t,n,Tc),i=ie.multiplyByScalar(e,1-n,i),ie.add(Tc,i,i)};let Tl=new ie,yc=new ie,Cc=new ie;ie.slerp=function(e,t,n,i){_.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i);let o=ie.dot(e,t),a=t;if(o<0&&(o=-o,a=Tl=ie.negate(t,Tl)),1-o<S.EPSILON6)return ie.lerp(e,a,n,i);const r=Math.acos(o);return yc=ie.multiplyByScalar(e,Math.sin((1-n)*r),yc),Cc=ie.multiplyByScalar(a,Math.sin(n*r),Cc),i=ie.add(yc,Cc,i),ie.multiplyByScalar(i,1/Math.sin(r),i)},ie.log=function(e,t){_.typeOf.object("quaternion",e),_.typeOf.object("result",t);const n=S.acosClamped(e.w);let i=0;return n!==0&&(i=n/Math.sin(n)),u.multiplyByScalar(e,i,t)},ie.exp=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=u.magnitude(e);let i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};const x1=new u,S1=new u,ls=new ie,Po=new ie;ie.computeInnerQuadrangle=function(e,t,n,i){_.typeOf.object("q0",e),_.typeOf.object("q1",t),_.typeOf.object("q2",n),_.typeOf.object("result",i);const o=ie.conjugate(t,ls);ie.multiply(o,n,Po);const a=ie.log(Po,x1);ie.multiply(o,e,Po);const r=ie.log(Po,S1);return u.add(a,r,a),u.multiplyByScalar(a,.25,a),u.negate(a,a),ie.exp(a,ls),ie.multiply(t,ls,i)},ie.squad=function(e,t,n,i,o,a){_.typeOf.object("q0",e),_.typeOf.object("q1",t),_.typeOf.object("s0",n),_.typeOf.object("s1",i),_.typeOf.number("t",o),_.typeOf.object("result",a);const r=ie.slerp(e,t,o,ls),f=ie.slerp(n,i,o,Po);return ie.slerp(r,f,2*o*(1-o),a)};const I1=new ie,yl=1.9011074535173003,Ur=Ct.supportsTypedArrays()?new Float32Array(8):[],kr=Ct.supportsTypedArrays()?new Float32Array(8):[],gi=Ct.supportsTypedArrays()?new Float32Array(8):[],Ti=Ct.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){const t=e+1,n=2*t+1;Ur[e]=1/(t*n),kr[e]=t/n}Ur[7]=yl/(8*17),kr[7]=yl*8/17,ie.fastSlerp=function(e,t,n,i){_.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i);let o=ie.dot(e,t),a;o>=0?a=1:(a=-1,o=-o);const r=o-1,f=1-n,c=n*n,h=f*f;for(let T=7;T>=0;--T)gi[T]=(Ur[T]*c-kr[T])*r,Ti[T]=(Ur[T]*h-kr[T])*r;const d=a*n*(1+gi[0]*(1+gi[1]*(1+gi[2]*(1+gi[3]*(1+gi[4]*(1+gi[5]*(1+gi[6]*(1+gi[7])))))))),p=f*(1+Ti[0]*(1+Ti[1]*(1+Ti[2]*(1+Ti[3]*(1+Ti[4]*(1+Ti[5]*(1+Ti[6]*(1+Ti[7])))))))),m=ie.multiplyByScalar(e,p,I1);return ie.multiplyByScalar(t,d,i),ie.add(m,i,i)},ie.fastSquad=function(e,t,n,i,o,a){_.typeOf.object("q0",e),_.typeOf.object("q1",t),_.typeOf.object("s0",n),_.typeOf.object("s1",i),_.typeOf.number("t",o),_.typeOf.object("result",a);const r=ie.fastSlerp(e,t,o,ls),f=ie.fastSlerp(n,i,o,Po);return ie.fastSlerp(r,f,2*o*(1-o),a)},ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},ie.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},ie.ZERO=Object.freeze(new ie(0,0,0,0)),ie.IDENTITY=Object.freeze(new ie(0,0,0,1)),ie.prototype.clone=function(e){return ie.clone(this,e)},ie.prototype.equals=function(e){return ie.equals(this,e)},ie.prototype.equalsEpsilon=function(e,t){return ie.equalsEpsilon(this,e,t)},ie.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const Ce={},wc={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Bo={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Ac={},fn={east:new u,north:new u,up:new u,west:new u,south:new u,down:new u};let zi=new u,Li=new u,Ni=new u;Ce.localFrameToFixedFrameGenerator=function(e,t){if(!wc.hasOwnProperty(e)||!wc[e].hasOwnProperty(t))throw new C("firstAxis and secondAxis must be east, north, up, west, south or down.");const n=wc[e][t];let i;const o=e+t;return l(Ac[o])?i=Ac[o]:(i=function(a,r,f){if(!l(a))throw new C("origin is required.");if(isNaN(a.x)||isNaN(a.y)||isNaN(a.z))throw new C("origin has a NaN component");if(l(f)||(f=new k),u.equalsEpsilon(a,u.ZERO,S.EPSILON14))u.unpack(Bo[e],0,zi),u.unpack(Bo[t],0,Li),u.unpack(Bo[n],0,Ni);else if(S.equalsEpsilon(a.x,0,S.EPSILON14)&&S.equalsEpsilon(a.y,0,S.EPSILON14)){const c=S.sign(a.z);u.unpack(Bo[e],0,zi),e!=="east"&&e!=="west"&&u.multiplyByScalar(zi,c,zi),u.unpack(Bo[t],0,Li),t!=="east"&&t!=="west"&&u.multiplyByScalar(Li,c,Li),u.unpack(Bo[n],0,Ni),n!=="east"&&n!=="west"&&u.multiplyByScalar(Ni,c,Ni)}else{r=g(r,pe.default),r.geodeticSurfaceNormal(a,fn.up);const c=fn.up,h=fn.east;h.x=-a.y,h.y=a.x,h.z=0,u.normalize(h,fn.east),u.cross(c,h,fn.north),u.multiplyByScalar(fn.up,-1,fn.down),u.multiplyByScalar(fn.east,-1,fn.west),u.multiplyByScalar(fn.north,-1,fn.south),zi=fn[e],Li=fn[t],Ni=fn[n]}return f[0]=zi.x,f[1]=zi.y,f[2]=zi.z,f[3]=0,f[4]=Li.x,f[5]=Li.y,f[6]=Li.z,f[7]=0,f[8]=Ni.x,f[9]=Ni.y,f[10]=Ni.z,f[11]=0,f[12]=a.x,f[13]=a.y,f[14]=a.z,f[15]=1,f},Ac[o]=i),i},Ce.eastNorthUpToFixedFrame=Ce.localFrameToFixedFrameGenerator("east","north"),Ce.northEastDownToFixedFrame=Ce.localFrameToFixedFrameGenerator("north","east"),Ce.northUpEastToFixedFrame=Ce.localFrameToFixedFrameGenerator("north","up"),Ce.northWestUpToFixedFrame=Ce.localFrameToFixedFrameGenerator("north","west");const D1=new ie,O1=new u(1,1,1),v1=new k;Ce.headingPitchRollToFixedFrame=function(e,t,n,i,o){_.typeOf.object("HeadingPitchRoll",t),i=g(i,Ce.eastNorthUpToFixedFrame);const a=ie.fromHeadingPitchRoll(t,D1),r=k.fromTranslationQuaternionRotationScale(u.ZERO,a,O1,v1);return o=i(e,n,o),k.multiply(o,r,o)};const W1=new k,P1=new G;Ce.headingPitchRollQuaternion=function(e,t,n,i,o){_.typeOf.object("HeadingPitchRoll",t);const a=Ce.headingPitchRollToFixedFrame(e,t,n,i,W1),r=k.getMatrix3(a,P1);return ie.fromRotationMatrix(r,o)};const B1=new u(1,1,1),R1=new u,Cl=new k,z1=new k,L1=new G,N1=new ie;Ce.fixedFrameToHeadingPitchRoll=function(e,t,n,i){_.defined("transform",e),t=g(t,pe.default),n=g(n,Ce.eastNorthUpToFixedFrame),l(i)||(i=new He);const o=k.getTranslation(e,R1);if(u.equals(o,u.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let a=k.inverseTransformation(n(o,t,Cl),Cl),r=k.setScale(e,B1,z1);r=k.setTranslation(r,u.ZERO,r),a=k.multiply(a,r,a);let f=ie.fromRotationMatrix(k.getMatrix3(a,L1),N1);return f=ie.normalize(f,f),He.fromQuaternion(f,i)};const F1=6*3600+41*60+50.54841,M1=8640184812866e-6,U1=.093104,k1=-62e-7,V1=11772758384668e-32,G1=72921158553e-15,q1=S.TWO_PI/86400;let Vr=new J;Ce.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=Ce.computeIcrfToFixedMatrix(e,t);return l(n)||(n=Ce.computeTemeToPseudoFixedMatrix(e,t)),n},Ce.computeTemeToPseudoFixedMatrix=function(e,t){if(!l(e))throw new C("date is required.");Vr=J.addSeconds(e,-J.computeTaiMinusUtc(e),Vr);const n=Vr.dayNumber,i=Vr.secondsOfDay;let o;const a=n-2451545;i>=43200?o=(a+.5)/ht.DAYS_PER_JULIAN_CENTURY:o=(a-.5)/ht.DAYS_PER_JULIAN_CENTURY;const f=(F1+o*(M1+o*(U1+o*k1)))*q1%S.TWO_PI,c=G1+V1*(n-24515455e-1),h=(i+ht.SECONDS_PER_DAY*.5)%ht.SECONDS_PER_DAY,d=f+c*h,p=Math.cos(d),m=Math.sin(d);return l(t)?(t[0]=p,t[1]=-m,t[2]=0,t[3]=m,t[4]=p,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new G(p,m,0,-m,p,0,0,0,1)},Ce.iau2006XysData=new dc,Ce.earthOrientationParameters=cs.NONE;const Ec=32.184,H1=2451545;Ce.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+Ec,i=e.stop.dayNumber,o=e.stop.secondsOfDay+Ec;return Ce.iau2006XysData.preload(t,n,i,o)},Ce.computeIcrfToFixedMatrix=function(e,t){if(!l(e))throw new C("date is required.");l(t)||(t=new G);const n=Ce.computeFixedToIcrfMatrix(e,t);if(l(n))return G.transpose(n,t)};const j1=32.184,Y1=2451545,Gr=new He,X1=new G,$1=new J;Ce.computeMoonFixedToIcrfMatrix=function(e,t){if(!l(e))throw new C("date is required.");const n=J.addSeconds(e,j1,$1),i=J.totalDays(n)-Y1,o=S.toRadians(12.112)-S.toRadians(.052992)*i,a=S.toRadians(24.224)-S.toRadians(.105984)*i,r=S.toRadians(227.645)+S.toRadians(13.012)*i,f=S.toRadians(261.105)+S.toRadians(13.340716)*i,c=S.toRadians(358)+S.toRadians(.9856)*i;return Gr.pitch=S.toRadians(180)-S.toRadians(3.878)*Math.sin(o)-S.toRadians(.12)*Math.sin(a)+S.toRadians(.07)*Math.sin(r)-S.toRadians(.017)*Math.sin(f),Gr.roll=S.toRadians(66.53-90)+S.toRadians(1.543)*Math.cos(o)+S.toRadians(.24)*Math.cos(a)-S.toRadians(.028)*Math.cos(r)+S.toRadians(.007)*Math.cos(f),Gr.heading=S.toRadians(244.375-90)+S.toRadians(13.17635831)*i+S.toRadians(3.558)*Math.sin(o)+S.toRadians(.121)*Math.sin(a)-S.toRadians(.064)*Math.sin(r)+S.toRadians(.016)*Math.sin(f)+S.toRadians(.025)*Math.sin(c),G.fromHeadingPitchRoll(Gr,X1)},Ce.computeIcrfToMoonFixedMatrix=function(e,t){if(!l(e))throw new C("date is required.");l(t)||(t=new G);const n=Ce.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return G.transpose(n,t)};const Z1=new dl(0,0,0),K1=new tc(0,0,0,0,0),bc=new G,xc=new G;Ce.computeFixedToIcrfMatrix=function(e,t){if(!l(e))throw new C("date is required.");l(t)||(t=new G);const n=Ce.earthOrientationParameters.compute(e,K1);if(!l(n))return;const i=e.dayNumber,o=e.secondsOfDay+Ec,a=Ce.iau2006XysData.computeXysRadians(i,o,Z1);if(!l(a))return;const r=a.x+n.xPoleOffset,f=a.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-r*r-f*f)),h=bc;h[0]=1-c*r*r,h[3]=-c*r*f,h[6]=r,h[1]=-c*r*f,h[4]=1-c*f*f,h[7]=f,h[2]=-r,h[5]=-f,h[8]=1-c*(r*r+f*f);const d=G.fromRotationZ(-a.s,xc),p=G.multiply(h,d,bc),m=e.dayNumber,T=e.secondsOfDay-J.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=m-2451545,w=T/ht.SECONDS_PER_DAY;let A=.779057273264+w+.00273781191135448*(y+w);A=A%1*S.TWO_PI;const E=G.fromRotationZ(A,xc),b=G.multiply(p,E,bc),I=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),B=Math.sin(n.xPoleWander),L=Math.sin(n.yPoleWander);let F=i-H1+o/ht.SECONDS_PER_DAY;F/=36525;const N=-47e-6*F*S.RADIANS_PER_DEGREE/3600,U=Math.cos(N),M=Math.sin(N),j=xc;return j[0]=I*U,j[1]=I*M,j[2]=B,j[3]=-O*M+L*B*U,j[4]=O*U+L*B*M,j[5]=-L*I,j[6]=-L*M-O*B*U,j[7]=L*U-O*B*M,j[8]=O*I,G.multiply(b,j,t)};const Q1=new Z;Ce.pointToWindowCoordinates=function(e,t,n,i){return i=Ce.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i},Ce.pointToGLWindowCoordinates=function(e,t,n,i){if(!l(e))throw new C("modelViewProjectionMatrix is required.");if(!l(t))throw new C("viewportTransformation is required.");if(!l(n))throw new C("point is required.");l(i)||(i=new q);const o=Q1;return k.multiplyByVector(e,Z.fromElements(n.x,n.y,n.z,1,o),o),Z.multiplyByScalar(o,1/o.w,o),k.multiplyByVector(t,o,o),q.fromCartesian4(o,i)};const J1=new u,eg=new u,tg=new u;Ce.rotationMatrixFromPositionVelocity=function(e,t,n,i){if(!l(e))throw new C("position is required.");if(!l(t))throw new C("velocity is required.");const o=g(n,pe.default).geodeticSurfaceNormal(e,J1);let a=u.cross(t,o,eg);u.equalsEpsilon(a,u.ZERO,S.EPSILON6)&&(a=u.clone(u.UNIT_X,a));const r=u.cross(a,t,tg);return u.normalize(r,r),u.cross(t,r,a),u.negate(a,a),u.normalize(a,a),l(i)||(i=new G),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=a.x,i[4]=a.y,i[5]=a.z,i[6]=r.x,i[7]=r.y,i[8]=r.z,i};const wl=new k(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Al=new oe,Sc=new u,ng=new u,ig=new G,Ic=new k,El=new k;Ce.basisTo2D=function(e,t,n){if(!l(e))throw new C("projection is required.");if(!l(t))throw new C("matrix is required.");if(!l(n))throw new C("result is required.");const i=k.getTranslation(t,ng),o=e.ellipsoid;let a;if(u.equals(i,u.ZERO))a=u.clone(u.ZERO,Sc);else{const d=o.cartesianToCartographic(i,Al);a=e.project(d,Sc),u.fromElements(a.z,a.x,a.y,a)}const r=Ce.eastNorthUpToFixedFrame(i,o,Ic),f=k.inverseTransformation(r,El),c=k.getMatrix3(t,ig),h=k.multiplyByMatrix3(f,c,n);return k.multiply(wl,h,n),k.setTranslation(n,a,n),n},Ce.ellipsoidTo2DModelMatrix=function(e,t,n){if(!l(e))throw new C("projection is required.");if(!l(t))throw new C("center is required.");if(!l(n))throw new C("result is required.");const i=e.ellipsoid,o=Ce.eastNorthUpToFixedFrame(t,i,Ic),a=k.inverseTransformation(o,El),r=i.cartesianToCartographic(t,Al),f=e.project(r,Sc);u.fromElements(f.z,f.x,f.y,f);const c=k.fromTranslation(f,Ic);return k.multiply(wl,a,n),k.multiply(c,n,n),n};const bl={};function us(e,t){if(!l(e))throw new C("identifier is required.");l(bl[e])||(bl[e]=!0,console.warn(g(t,e)))}us.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",us.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",us.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",us.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";function og(e,t){if(!l(e)||!l(t))throw new C("identifier and message are required.");us(e,t)}function de(e,t,n,i){this.west=g(e,0),this.south=g(t,0),this.east=g(n,0),this.north=g(i,0)}Object.defineProperties(de.prototype,{width:{get:function(){return de.computeWidth(this)}},height:{get:function(){return de.computeHeight(this)}}}),de.packedLength=4,de.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},de.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new de),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n},de.computeWidth=function(e){_.typeOf.object("rectangle",e);let t=e.east;const n=e.west;return t<n&&(t+=S.TWO_PI),t-n},de.computeHeight=function(e){return _.typeOf.object("rectangle",e),e.north-e.south},de.fromDegrees=function(e,t,n,i,o){return e=S.toRadians(g(e,0)),t=S.toRadians(g(t,0)),n=S.toRadians(g(n,0)),i=S.toRadians(g(i,0)),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new de(e,t,n,i)},de.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=g(e,0),o.south=g(t,0),o.east=g(n,0),o.north=g(i,0),o):new de(e,t,n,i)},de.fromCartographicArray=function(e,t){_.defined("cartographics",e);let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let c=0,h=e.length;c<h;c++){const d=e[c];n=Math.min(n,d.longitude),i=Math.max(i,d.longitude),r=Math.min(r,d.latitude),f=Math.max(f,d.latitude);const p=d.longitude>=0?d.longitude:d.longitude+S.TWO_PI;o=Math.min(o,p),a=Math.max(a,p)}return i-n>a-o&&(n=o,i=a,i>S.PI&&(i=i-S.TWO_PI),n>S.PI&&(n=n-S.TWO_PI)),l(t)?(t.west=n,t.south=r,t.east=i,t.north=f,t):new de(n,r,i,f)},de.fromCartesianArray=function(e,t,n){_.defined("cartesians",e),t=g(t,pe.default);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,r=-Number.MAX_VALUE,f=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let h=0,d=e.length;h<d;h++){const p=t.cartesianToCartographic(e[h]);i=Math.min(i,p.longitude),o=Math.max(o,p.longitude),f=Math.min(f,p.latitude),c=Math.max(c,p.latitude);const m=p.longitude>=0?p.longitude:p.longitude+S.TWO_PI;a=Math.min(a,m),r=Math.max(r,m)}return o-i>r-a&&(i=a,o=r,o>S.PI&&(o=o-S.TWO_PI),i>S.PI&&(i=i-S.TWO_PI)),l(n)?(n.west=i,n.south=f,n.east=o,n.north=c,n):new de(i,f,o,c)};const sg=new u,rg=new u,ag=new u,cg=new u,hg=new u,Dc=new Array(5);for(let e=0;e<Dc.length;++e)Dc[e]=new u;de.fromBoundingSphere=function(e,t,n){_.typeOf.object("boundingSphere",e);const i=e.center,o=e.radius;if(l(t)||(t=pe.default),l(n)||(n=new de),u.equals(i,u.ZERO))return de.clone(de.MAX_VALUE,n),n;const a=Ce.eastNorthUpToFixedFrame(i,t,sg),r=k.multiplyByPointAsVector(a,u.UNIT_X,rg);u.normalize(r,r);const f=k.multiplyByPointAsVector(a,u.UNIT_Y,ag);u.normalize(f,f),u.multiplyByScalar(f,o,f),u.multiplyByScalar(r,o,r);const c=u.negate(f,hg),h=u.negate(r,cg),d=Dc;let p=d[0];return u.add(i,f,p),p=d[1],u.add(i,h,p),p=d[2],u.add(i,c,p),p=d[3],u.add(i,r,p),d[4]=i,de.fromCartesianArray(d,t,n)},de.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new de(e.west,e.south,e.east,e.north)},de.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n},de.prototype.clone=function(e){return de.clone(this,e)},de.prototype.equals=function(e){return de.equals(this,e)},de.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},de.prototype.equalsEpsilon=function(e,t){return de.equalsEpsilon(this,e,t)},de.validate=function(e){return og("Rectangle.validate","Rectangle.validate is a no-op and has been deprecated. It will be removed in Cesium 1.124."),de._validate(e)},de._validate=function(e){_.typeOf.object("rectangle",e);const t=e.north;_.typeOf.number.greaterThanOrEquals("north",t,-S.PI_OVER_TWO),_.typeOf.number.lessThanOrEquals("north",t,S.PI_OVER_TWO);const n=e.south;_.typeOf.number.greaterThanOrEquals("south",n,-S.PI_OVER_TWO),_.typeOf.number.lessThanOrEquals("south",n,S.PI_OVER_TWO);const i=e.west;_.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),_.typeOf.number.lessThanOrEquals("west",i,Math.PI);const o=e.east;_.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),_.typeOf.number.lessThanOrEquals("east",o,Math.PI)},de.southwest=function(e,t){return _.typeOf.object("rectangle",e),l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new oe(e.west,e.south)},de.northwest=function(e,t){return _.typeOf.object("rectangle",e),l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new oe(e.west,e.north)},de.northeast=function(e,t){return _.typeOf.object("rectangle",e),l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new oe(e.east,e.north)},de.southeast=function(e,t){return _.typeOf.object("rectangle",e),l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new oe(e.east,e.south)},de.center=function(e,t){_.typeOf.object("rectangle",e);let n=e.east;const i=e.west;n<i&&(n+=S.TWO_PI);const o=S.negativePiToPi((i+n)*.5),a=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=a,t.height=0,t):new oe(o,a)},de.intersection=function(e,t,n){_.typeOf.object("rectangle",e),_.typeOf.object("otherRectangle",t);let i=e.east,o=e.west,a=t.east,r=t.west;i<o&&a>0?i+=S.TWO_PI:a<r&&i>0&&(a+=S.TWO_PI),i<o&&r<0?r+=S.TWO_PI:a<r&&o<0&&(o+=S.TWO_PI);const f=S.negativePiToPi(Math.max(o,r)),c=S.negativePiToPi(Math.min(i,a));if((e.west<e.east||t.west<t.east)&&c<=f)return;const h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return l(n)?(n.west=f,n.south=h,n.east=c,n.north=d,n):new de(f,h,c,d)},de.simpleIntersection=function(e,t,n){_.typeOf.object("rectangle",e),_.typeOf.object("otherRectangle",t);const i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),a=Math.min(e.east,t.east),r=Math.min(e.north,t.north);if(!(o>=r||i>=a))return l(n)?(n.west=i,n.south=o,n.east=a,n.north=r,n):new de(i,o,a,r)},de.union=function(e,t,n){_.typeOf.object("rectangle",e),_.typeOf.object("otherRectangle",t),l(n)||(n=new de);let i=e.east,o=e.west,a=t.east,r=t.west;i<o&&a>0?i+=S.TWO_PI:a<r&&i>0&&(a+=S.TWO_PI),i<o&&r<0?r+=S.TWO_PI:a<r&&o<0&&(o+=S.TWO_PI);const f=S.negativePiToPi(Math.min(o,r)),c=S.negativePiToPi(Math.max(i,a));return n.west=f,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n},de.expand=function(e,t,n){return _.typeOf.object("rectangle",e),_.typeOf.object("cartographic",t),l(n)||(n=new de),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},de.contains=function(e,t){_.typeOf.object("rectangle",e),_.typeOf.object("cartographic",t);let n=t.longitude;const i=t.latitude,o=e.west;let a=e.east;return a<o&&(a+=S.TWO_PI,n<0&&(n+=S.TWO_PI)),(n>o||S.equalsEpsilon(n,o,S.EPSILON14))&&(n<a||S.equalsEpsilon(n,a,S.EPSILON14))&&i>=e.south&&i<=e.north};const fg=new oe;de.subsample=function(e,t,n,i){_.typeOf.object("rectangle",e),t=g(t,pe.default),n=g(n,0),l(i)||(i=[]);let o=0;const a=e.north,r=e.south,f=e.east,c=e.west,h=fg;h.height=n,h.longitude=c,h.latitude=a,i[o]=t.cartographicToCartesian(h,i[o]),o++,h.longitude=f,i[o]=t.cartographicToCartesian(h,i[o]),o++,h.latitude=r,i[o]=t.cartographicToCartesian(h,i[o]),o++,h.longitude=c,i[o]=t.cartographicToCartesian(h,i[o]),o++,a<0?h.latitude=a:r>0?h.latitude=r:h.latitude=0;for(let d=1;d<8;++d)h.longitude=-Math.PI+d*S.PI_OVER_TWO,de.contains(e,h)&&(i[o]=t.cartographicToCartesian(h,i[o]),o++);return h.latitude===0&&(h.longitude=c,i[o]=t.cartographicToCartesian(h,i[o]),o++,h.longitude=f,i[o]=t.cartographicToCartesian(h,i[o]),o++),i.length=o,i},de.subsection=function(e,t,n,i,o,a){if(_.typeOf.object("rectangle",e),_.typeOf.number.greaterThanOrEquals("westLerp",t,0),_.typeOf.number.lessThanOrEquals("westLerp",t,1),_.typeOf.number.greaterThanOrEquals("southLerp",n,0),_.typeOf.number.lessThanOrEquals("southLerp",n,1),_.typeOf.number.greaterThanOrEquals("eastLerp",i,0),_.typeOf.number.lessThanOrEquals("eastLerp",i,1),_.typeOf.number.greaterThanOrEquals("northLerp",o,0),_.typeOf.number.lessThanOrEquals("northLerp",o,1),_.typeOf.number.lessThanOrEquals("westLerp",t,i),_.typeOf.number.lessThanOrEquals("southLerp",n,o),l(a)||(a=new de),e.west<=e.east){const f=e.east-e.west;a.west=e.west+t*f,a.east=e.west+i*f}else{const f=S.TWO_PI+e.east-e.west;a.west=S.negativePiToPi(e.west+t*f),a.east=S.negativePiToPi(e.west+i*f)}const r=e.north-e.south;return a.south=e.south+n*r,a.north=e.south+o*r,t===1&&(a.west=e.east),i===1&&(a.east=e.east),n===1&&(a.south=e.north),o===1&&(a.north=e.north),a},de.MAX_VALUE=Object.freeze(new de(-Math.PI,-S.PI_OVER_TWO,Math.PI,S.PI_OVER_TWO));function be(e,t,n,i){this.x=g(e,0),this.y=g(t,0),this.width=g(n,0),this.height=g(i,0)}be.packedLength=4,be.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},be.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new be),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},be.fromPoints=function(e,t){if(l(t)||(t=new be),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;const n=e.length;let i=e[0].x,o=e[0].y,a=e[0].x,r=e[0].y;for(let f=1;f<n;f++){const c=e[f],h=c.x,d=c.y;i=Math.min(h,i),a=Math.max(h,a),o=Math.min(d,o),r=Math.max(d,r)}return t.x=i,t.y=o,t.width=a-i,t.height=r-o,t};const xl=new Wn,lg=new oe,ug=new oe;be.fromRectangle=function(e,t,n){if(l(n)||(n=new be),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;xl._ellipsoid=pe.default,t=g(t,xl);const i=t.project(de.southwest(e,lg)),o=t.project(de.northeast(e,ug));return q.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n},be.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new be(e.x,e.y,e.width,e.height)},be.union=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),l(n)||(n=new be);const i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),a=Math.max(e.x+e.width,t.x+t.width),r=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=a-i,n.height=r-o,n},be.expand=function(e,t,n){_.typeOf.object("rectangle",e),_.typeOf.object("point",t),n=be.clone(e,n);const i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n},be.intersect=function(e,t){_.typeOf.object("left",e),_.typeOf.object("right",t);const n=e.x,i=e.y,o=t.x,a=t.y;return n>o+t.width||n+e.width<o||i+e.height<a||i>a+t.height?xt.OUTSIDE:xt.INTERSECTING},be.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},be.prototype.clone=function(e){return be.clone(this,e)},be.prototype.intersect=function(e){return be.intersect(this,e)},be.prototype.equals=function(e){return be.equals(this,e)};const kt={POINTS:R.POINTS,LINES:R.LINES,LINE_LOOP:R.LINE_LOOP,LINE_STRIP:R.LINE_STRIP,TRIANGLES:R.TRIANGLES,TRIANGLE_STRIP:R.TRIANGLE_STRIP,TRIANGLE_FAN:R.TRIANGLE_FAN};kt.isLines=function(e){return e===kt.LINES||e===kt.LINE_LOOP||e===kt.LINE_STRIP},kt.isTriangles=function(e){return e===kt.TRIANGLES||e===kt.TRIANGLE_STRIP||e===kt.TRIANGLE_FAN},kt.validate=function(e){return e===kt.POINTS||e===kt.LINES||e===kt.LINE_LOOP||e===kt.LINE_STRIP||e===kt.TRIANGLES||e===kt.TRIANGLE_STRIP||e===kt.TRIANGLE_FAN};const Xe=Object.freeze(kt),ft={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function et(e){e=g(e,g.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=g(e.primitiveType,Xe.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=g(e.offset,0),this._instanceCount=g(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=g(e.cull,!0),this.occlude=g(e.occlude,!0),this.executeInClosestFrustum=g(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.castShadows=g(e.castShadows,!1),this.receiveShadows=g(e.receiveShadows,!1),this.pickOnly=g(e.pickOnly,!1),this.depthForTranslucentClassification=g(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Zt(e,t){return(e._flags&t)===t}function Fi(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(et.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return Zt(this,ft.CULL)},set:function(e){Zt(this,ft.CULL)!==e&&(Fi(this,ft.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Zt(this,ft.OCCLUDE)},set:function(e){Zt(this,ft.OCCLUDE)!==e&&(Fi(this,ft.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return Zt(this,ft.CAST_SHADOWS)},set:function(e){Zt(this,ft.CAST_SHADOWS)!==e&&(Fi(this,ft.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Zt(this,ft.RECEIVE_SHADOWS)},set:function(e){Zt(this,ft.RECEIVE_SHADOWS)!==e&&(Fi(this,ft.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return Zt(this,ft.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Zt(this,ft.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Fi(this,ft.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return Zt(this,ft.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Zt(this,ft.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Fi(this,ft.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return Zt(this,ft.PICK_ONLY)},set:function(e){Zt(this,ft.PICK_ONLY)!==e&&(Fi(this,ft.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Zt(this,ft.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Zt(this,ft.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Fi(this,ft.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}}),et.shallowClone=function(e,t){if(l(e))return l(t)||(t=new et),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t},et.prototype.execute=function(e,t){e.draw(this,t)};const Oe={UNSIGNED_BYTE:R.UNSIGNED_BYTE,UNSIGNED_SHORT:R.UNSIGNED_SHORT,UNSIGNED_INT:R.UNSIGNED_INT,FLOAT:R.FLOAT,HALF_FLOAT:R.HALF_FLOAT_OES,UNSIGNED_INT_24_8:R.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:R.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:R.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:R.UNSIGNED_SHORT_5_6_5};Oe.toWebGLConstant=function(e,t){switch(e){case Oe.UNSIGNED_BYTE:return R.UNSIGNED_BYTE;case Oe.UNSIGNED_SHORT:return R.UNSIGNED_SHORT;case Oe.UNSIGNED_INT:return R.UNSIGNED_INT;case Oe.FLOAT:return R.FLOAT;case Oe.HALF_FLOAT:return t.webgl2?R.HALF_FLOAT:R.HALF_FLOAT_OES;case Oe.UNSIGNED_INT_24_8:return R.UNSIGNED_INT_24_8;case Oe.UNSIGNED_SHORT_4_4_4_4:return R.UNSIGNED_SHORT_4_4_4_4;case Oe.UNSIGNED_SHORT_5_5_5_1:return R.UNSIGNED_SHORT_5_5_5_1;case Oe.UNSIGNED_SHORT_5_6_5:return Oe.UNSIGNED_SHORT_5_6_5}},Oe.isPacked=function(e){return e===Oe.UNSIGNED_INT_24_8||e===Oe.UNSIGNED_SHORT_4_4_4_4||e===Oe.UNSIGNED_SHORT_5_5_5_1||e===Oe.UNSIGNED_SHORT_5_6_5},Oe.sizeInBytes=function(e){switch(e){case Oe.UNSIGNED_BYTE:return 1;case Oe.UNSIGNED_SHORT:case Oe.UNSIGNED_SHORT_4_4_4_4:case Oe.UNSIGNED_SHORT_5_5_5_1:case Oe.UNSIGNED_SHORT_5_6_5:case Oe.HALF_FLOAT:return 2;case Oe.UNSIGNED_INT:case Oe.FLOAT:case Oe.UNSIGNED_INT_24_8:return 4}},Oe.validate=function(e){return e===Oe.UNSIGNED_BYTE||e===Oe.UNSIGNED_SHORT||e===Oe.UNSIGNED_INT||e===Oe.FLOAT||e===Oe.HALF_FLOAT||e===Oe.UNSIGNED_INT_24_8||e===Oe.UNSIGNED_SHORT_4_4_4_4||e===Oe.UNSIGNED_SHORT_5_5_5_1||e===Oe.UNSIGNED_SHORT_5_6_5},Oe.getTypedArrayConstructor=function(e){const t=Oe.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Oe.FLOAT?Float32Array:Uint32Array};const Te=Object.freeze(Oe),re={DEPTH_COMPONENT:R.DEPTH_COMPONENT,DEPTH_STENCIL:R.DEPTH_STENCIL,ALPHA:R.ALPHA,RED:R.RED,RG:R.RG,RGB:R.RGB,RGBA:R.RGBA,LUMINANCE:R.LUMINANCE,LUMINANCE_ALPHA:R.LUMINANCE_ALPHA,RGB_DXT1:R.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:R.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:R.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:R.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:R.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:R.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:R.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:R.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:R.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:R.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:R.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:R.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:R.COMPRESSED_RGBA_BPTC_UNORM};re.componentsLength=function(e){switch(e){case re.RGB:return 3;case re.RGBA:return 4;case re.LUMINANCE_ALPHA:case re.RG:return 2;case re.ALPHA:case re.RED:case re.LUMINANCE:return 1;default:return 1}},re.validate=function(e){return e===re.DEPTH_COMPONENT||e===re.DEPTH_STENCIL||e===re.ALPHA||e===re.RED||e===re.RG||e===re.RGB||e===re.RGBA||e===re.LUMINANCE||e===re.LUMINANCE_ALPHA||e===re.RGB_DXT1||e===re.RGBA_DXT1||e===re.RGBA_DXT3||e===re.RGBA_DXT5||e===re.RGB_PVRTC_4BPPV1||e===re.RGB_PVRTC_2BPPV1||e===re.RGBA_PVRTC_4BPPV1||e===re.RGBA_PVRTC_2BPPV1||e===re.RGBA_ASTC||e===re.RGB_ETC1||e===re.RGB8_ETC2||e===re.RGBA8_ETC2_EAC||e===re.RGBA_BC7},re.isColorFormat=function(e){return e===re.RED||e===re.ALPHA||e===re.RGB||e===re.RGBA||e===re.LUMINANCE||e===re.LUMINANCE_ALPHA},re.isDepthFormat=function(e){return e===re.DEPTH_COMPONENT||e===re.DEPTH_STENCIL},re.isCompressedFormat=function(e){return e===re.RGB_DXT1||e===re.RGBA_DXT1||e===re.RGBA_DXT3||e===re.RGBA_DXT5||e===re.RGB_PVRTC_4BPPV1||e===re.RGB_PVRTC_2BPPV1||e===re.RGBA_PVRTC_4BPPV1||e===re.RGBA_PVRTC_2BPPV1||e===re.RGBA_ASTC||e===re.RGB_ETC1||e===re.RGB8_ETC2||e===re.RGBA8_ETC2_EAC||e===re.RGBA_BC7},re.isDXTFormat=function(e){return e===re.RGB_DXT1||e===re.RGBA_DXT1||e===re.RGBA_DXT3||e===re.RGBA_DXT5},re.isPVRTCFormat=function(e){return e===re.RGB_PVRTC_4BPPV1||e===re.RGB_PVRTC_2BPPV1||e===re.RGBA_PVRTC_4BPPV1||e===re.RGBA_PVRTC_2BPPV1},re.isASTCFormat=function(e){return e===re.RGBA_ASTC},re.isETC1Format=function(e){return e===re.RGB_ETC1},re.isETC2Format=function(e){return e===re.RGB8_ETC2||e===re.RGBA8_ETC2_EAC},re.isBC7Format=function(e){return e===re.RGBA_BC7},re.compressedTextureSizeInBytes=function(e,t,n){switch(e){case re.RGB_DXT1:case re.RGBA_DXT1:case re.RGB_ETC1:case re.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case re.RGBA_DXT3:case re.RGBA_DXT5:case re.RGBA_ASTC:case re.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case re.RGB_PVRTC_4BPPV1:case re.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case re.RGB_PVRTC_2BPPV1:case re.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case re.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}},re.textureSizeInBytes=function(e,t,n,i){let o=re.componentsLength(e);return Te.isPacked(t)&&(o=1),o*Te.sizeInBytes(t)*n*i},re.alignmentInBytes=function(e,t,n){const i=re.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1},re.createTypedArray=function(e,t,n,i){const o=Te.getTypedArrayConstructor(t),a=re.componentsLength(e)*n*i;return new o(a)},re.flipY=function(e,t,n,i,o){if(o===1)return e;const a=re.createTypedArray(t,n,i,o),r=re.componentsLength(t),f=i*r;for(let c=0;c<o;++c){const h=c*i*r,d=(o-c-1)*i*r;for(let p=0;p<f;++p)a[d+p]=e[h+p]}return a},re.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===re.DEPTH_STENCIL)return R.DEPTH24_STENCIL8;if(e===re.DEPTH_COMPONENT){if(t===Te.UNSIGNED_SHORT)return R.DEPTH_COMPONENT16;if(t===Te.UNSIGNED_INT)return R.DEPTH_COMPONENT24}if(t===Te.FLOAT)switch(e){case re.RGBA:return R.RGBA32F;case re.RGB:return R.RGB32F;case re.RG:return R.RG32F;case re.RED:return R.R32F}if(t===Te.HALF_FLOAT)switch(e){case re.RGBA:return R.RGBA16F;case re.RGB:return R.RGB16F;case re.RG:return R.RG16F;case re.RED:return R.R16F}return e};const ge=Object.freeze(re),xe={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(xe,{maximumCombinedTextureImageUnits:{get:function(){return xe._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return xe._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return xe._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return xe._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return xe._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return xe._maximumTextureSize}},maximumVaryingVectors:{get:function(){return xe._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return xe._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return xe._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return xe._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return xe._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return xe._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return xe._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return xe._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return xe._maximumViewportWidth}},maximumViewportHeight:{get:function(){return xe._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return xe._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return xe._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return xe._maximumColorAttachments}},maximumSamples:{get:function(){return xe._maximumSamples}},highpFloatSupported:{get:function(){return xe._highpFloatSupported}},highpIntSupported:{get:function(){return xe._highpIntSupported}}});function Oc(e,t,n){const i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function qr(e,t,n){const i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Rn(e){e=g(e,g.EMPTY_OBJECT);const t=e.context;_.defined("options.context",t);const n=t._gl,i=xe.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=g(e.destroyAttachments,!0),l(e.colorTextures)&&l(e.colorRenderbuffers))throw new C("Cannot have both color texture and color renderbuffer attachments.");if(l(e.depthTexture)&&l(e.depthRenderbuffer))throw new C("Cannot have both a depth texture and depth renderbuffer attachment.");if(l(e.depthStencilTexture)&&l(e.depthStencilRenderbuffer))throw new C("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.");const o=l(e.depthTexture)||l(e.depthRenderbuffer),a=l(e.depthStencilTexture)||l(e.depthStencilRenderbuffer);if(o&&a)throw new C("Cannot have both a depth and depth-stencil attachment.");if(l(e.stencilRenderbuffer)&&a)throw new C("Cannot have both a stencil and depth-stencil attachment.");if(o&&l(e.stencilRenderbuffer))throw new C("Cannot have both a depth and stencil attachment.");if(this._bind(),l(e.colorTextures)){const r=e.colorTextures,f=this._colorTextures.length=this._activeColorAttachments.length=r.length;if(f>i)throw new C("The number of color attachments exceeds the number supported.");for(let c=0;c<f;++c){const h=r[c];if(!ge.isColorFormat(h.pixelFormat))throw new C("The color-texture pixel-format must be a color format.");if(h.pixelDatatype===Te.FLOAT&&!t.colorBufferFloat)throw new C("The color texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions. See Context.colorBufferFloat.");if(h.pixelDatatype===Te.HALF_FLOAT&&!t.colorBufferHalfFloat)throw new C("The color texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension. See Context.colorBufferHalfFloat.");const d=this._gl.COLOR_ATTACHMENT0+c;Oc(this,d,h),this._activeColorAttachments[c]=d,this._colorTextures[c]=h}}if(l(e.colorRenderbuffers)){const r=e.colorRenderbuffers,f=this._colorRenderbuffers.length=this._activeColorAttachments.length=r.length;if(f>i)throw new C("The number of color attachments exceeds the number supported.");for(let c=0;c<f;++c){const h=r[c],d=this._gl.COLOR_ATTACHMENT0+c;qr(this,d,h),this._activeColorAttachments[c]=d,this._colorRenderbuffers[c]=h}}if(l(e.depthTexture)){const r=e.depthTexture;if(r.pixelFormat!==ge.DEPTH_COMPONENT)throw new C("The depth-texture pixel-format must be DEPTH_COMPONENT.");Oc(this,this._gl.DEPTH_ATTACHMENT,r),this._depthTexture=r}if(l(e.depthRenderbuffer)){const r=e.depthRenderbuffer;qr(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){const r=e.stencilRenderbuffer;qr(this,this._gl.STENCIL_ATTACHMENT,r),this._stencilRenderbuffer=r}if(l(e.depthStencilTexture)){const r=e.depthStencilTexture;if(r.pixelFormat!==ge.DEPTH_STENCIL)throw new C("The depth-stencil pixel-format must be DEPTH_STENCIL.");Oc(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilTexture=r}if(l(e.depthStencilRenderbuffer)){const r=e.depthStencilRenderbuffer;qr(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind()}Object.defineProperties(Rn.prototype,{status:{get:function(){this._bind();const e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}}),Rn.prototype._bind=function(){const e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},Rn.prototype._unBind=function(){const e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},Rn.prototype.bindDraw=function(){const e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)},Rn.prototype.bindRead=function(){const e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)},Rn.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},Rn.prototype.getColorTexture=function(e){if(!l(e)||e<0||e>=this._colorTextures.length)throw new C("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorTextures[e]},Rn.prototype.getColorRenderbuffer=function(e){if(!l(e)||e<0||e>=this._colorRenderbuffers.length)throw new C("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorRenderbuffers[e]},Rn.prototype.isDestroyed=function(){return!1},Rn.prototype.destroy=function(){if(this.destroyAttachments){const e=this._colorTextures;for(let n=0;n<e.length;++n){const i=e[n];l(i)&&i.destroy()}const t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){const i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),st(this)};const Hr={CLOCKWISE:R.CW,COUNTER_CLOCKWISE:R.CCW};Hr.validate=function(e){return e===Hr.CLOCKWISE||e===Hr.COUNTER_CLOCKWISE};const Sl=Object.freeze(Hr);function Il(e){if(typeof e!="object"||e===null)return e;let t;const n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=Il(e[t]));return Object.freeze(e)}function Dl(e){return e===R.FUNC_ADD||e===R.FUNC_SUBTRACT||e===R.FUNC_REVERSE_SUBTRACT||e===R.MIN||e===R.MAX}function jr(e){return e===R.ZERO||e===R.ONE||e===R.SRC_COLOR||e===R.ONE_MINUS_SRC_COLOR||e===R.DST_COLOR||e===R.ONE_MINUS_DST_COLOR||e===R.SRC_ALPHA||e===R.ONE_MINUS_SRC_ALPHA||e===R.DST_ALPHA||e===R.ONE_MINUS_DST_ALPHA||e===R.CONSTANT_COLOR||e===R.ONE_MINUS_CONSTANT_COLOR||e===R.CONSTANT_ALPHA||e===R.ONE_MINUS_CONSTANT_ALPHA||e===R.SRC_ALPHA_SATURATE}function dg(e){return e===R.FRONT||e===R.BACK||e===R.FRONT_AND_BACK}function pg(e){return e===R.NEVER||e===R.LESS||e===R.EQUAL||e===R.LEQUAL||e===R.GREATER||e===R.NOTEQUAL||e===R.GEQUAL||e===R.ALWAYS}function Ol(e){return e===R.NEVER||e===R.LESS||e===R.EQUAL||e===R.LEQUAL||e===R.GREATER||e===R.NOTEQUAL||e===R.GEQUAL||e===R.ALWAYS}function Ro(e){return e===R.ZERO||e===R.KEEP||e===R.REPLACE||e===R.INCR||e===R.DECR||e===R.INVERT||e===R.INCR_WRAP||e===R.DECR_WRAP}function je(e){const t=g(e,g.EMPTY_OBJECT),n=g(t.cull,g.EMPTY_OBJECT),i=g(t.polygonOffset,g.EMPTY_OBJECT),o=g(t.scissorTest,g.EMPTY_OBJECT),a=g(o.rectangle,g.EMPTY_OBJECT),r=g(t.depthRange,g.EMPTY_OBJECT),f=g(t.depthTest,g.EMPTY_OBJECT),c=g(t.colorMask,g.EMPTY_OBJECT),h=g(t.blending,g.EMPTY_OBJECT),d=g(h.color,g.EMPTY_OBJECT),p=g(t.stencilTest,g.EMPTY_OBJECT),m=g(p.frontOperation,g.EMPTY_OBJECT),T=g(p.backOperation,g.EMPTY_OBJECT),y=g(t.sampleCoverage,g.EMPTY_OBJECT),w=t.viewport;if(this.frontFace=g(t.frontFace,Sl.COUNTER_CLOCKWISE),this.cull={enabled:g(n.enabled,!1),face:g(n.face,R.BACK)},this.lineWidth=g(t.lineWidth,1),this.polygonOffset={enabled:g(i.enabled,!1),factor:g(i.factor,0),units:g(i.units,0)},this.scissorTest={enabled:g(o.enabled,!1),rectangle:be.clone(a)},this.depthRange={near:g(r.near,0),far:g(r.far,1)},this.depthTest={enabled:g(f.enabled,!1),func:g(f.func,R.LESS)},this.colorMask={red:g(c.red,!0),green:g(c.green,!0),blue:g(c.blue,!0),alpha:g(c.alpha,!0)},this.depthMask=g(t.depthMask,!0),this.stencilMask=g(t.stencilMask,-1),this.blending={enabled:g(h.enabled,!1),color:new D(g(d.red,0),g(d.green,0),g(d.blue,0),g(d.alpha,0)),equationRgb:g(h.equationRgb,R.FUNC_ADD),equationAlpha:g(h.equationAlpha,R.FUNC_ADD),functionSourceRgb:g(h.functionSourceRgb,R.ONE),functionSourceAlpha:g(h.functionSourceAlpha,R.ONE),functionDestinationRgb:g(h.functionDestinationRgb,R.ZERO),functionDestinationAlpha:g(h.functionDestinationAlpha,R.ZERO)},this.stencilTest={enabled:g(p.enabled,!1),frontFunction:g(p.frontFunction,R.ALWAYS),backFunction:g(p.backFunction,R.ALWAYS),reference:g(p.reference,0),mask:g(p.mask,-1),frontOperation:{fail:g(m.fail,R.KEEP),zFail:g(m.zFail,R.KEEP),zPass:g(m.zPass,R.KEEP)},backOperation:{fail:g(T.fail,R.KEEP),zFail:g(T.zFail,R.KEEP),zPass:g(T.zPass,R.KEEP)}},this.sampleCoverage={enabled:g(y.enabled,!1),value:g(y.value,1),invert:g(y.invert,!1)},this.viewport=l(w)?new be(w.x,w.y,w.width,w.height):void 0,this.lineWidth<xe.minimumAliasedLineWidth||this.lineWidth>xe.maximumAliasedLineWidth)throw new C("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!Sl.validate(this.frontFace))throw new C("Invalid renderState.frontFace.");if(!dg(this.cull.face))throw new C("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new C("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new C("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new C("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new C("renderState.depthRange.far must be less than or equal to one.");if(!pg(this.depthTest.func))throw new C("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new C("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!Dl(this.blending.equationRgb))throw new C("Invalid renderState.blending.equationRgb.");if(!Dl(this.blending.equationAlpha))throw new C("Invalid renderState.blending.equationAlpha.");if(!jr(this.blending.functionSourceRgb))throw new C("Invalid renderState.blending.functionSourceRgb.");if(!jr(this.blending.functionSourceAlpha))throw new C("Invalid renderState.blending.functionSourceAlpha.");if(!jr(this.blending.functionDestinationRgb))throw new C("Invalid renderState.blending.functionDestinationRgb.");if(!jr(this.blending.functionDestinationAlpha))throw new C("Invalid renderState.blending.functionDestinationAlpha.");if(!Ol(this.stencilTest.frontFunction))throw new C("Invalid renderState.stencilTest.frontFunction.");if(!Ol(this.stencilTest.backFunction))throw new C("Invalid renderState.stencilTest.backFunction.");if(!Ro(this.stencilTest.frontOperation.fail))throw new C("Invalid renderState.stencilTest.frontOperation.fail.");if(!Ro(this.stencilTest.frontOperation.zFail))throw new C("Invalid renderState.stencilTest.frontOperation.zFail.");if(!Ro(this.stencilTest.frontOperation.zPass))throw new C("Invalid renderState.stencilTest.frontOperation.zPass.");if(!Ro(this.stencilTest.backOperation.fail))throw new C("Invalid renderState.stencilTest.backOperation.fail.");if(!Ro(this.stencilTest.backOperation.zFail))throw new C("Invalid renderState.stencilTest.backOperation.zFail.");if(!Ro(this.stencilTest.backOperation.zPass))throw new C("Invalid renderState.stencilTest.backOperation.zPass.");if(l(this.viewport)){if(this.viewport.width<0)throw new C("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new C("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>xe.maximumViewportWidth)throw new C(`renderState.viewport.width must be less than or equal to the maximum viewport width (${xe.maximumViewportWidth.toString()}). Check maximumViewportWidth.`);if(this.viewport.height>xe.maximumViewportHeight)throw new C(`renderState.viewport.height must be less than or equal to the maximum viewport height (${xe.maximumViewportHeight.toString()}). Check maximumViewportHeight.`)}this.id=0,this._applyFunctions=[]}let mg=0,Qn={};je.fromCache=function(e){const t=JSON.stringify(e);let n=Qn[t];if(l(n))return++n.referenceCount,n.state;let i=new je(e);const o=JSON.stringify(i);return n=Qn[o],l(n)||(i.id=mg++,i=Il(i),n={referenceCount:0,state:i},Qn[o]=n),++n.referenceCount,Qn[t]={referenceCount:1,state:n.state},n.state},je.removeFromCache=function(e){const t=new je(e),n=JSON.stringify(t),i=Qn[n],o=JSON.stringify(e),a=Qn[o];l(a)&&(--a.referenceCount,a.referenceCount===0&&(delete Qn[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Qn[n]},je.getCache=function(){return Qn},je.clearCache=function(){Qn={}};function no(e,t,n){n?e.enable(t):e.disable(t)}function vl(e,t){e.frontFace(t.frontFace)}function Wl(e,t){const n=t.cull,i=n.enabled;no(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function Pl(e,t){e.lineWidth(t.lineWidth)}function Bl(e,t){const n=t.polygonOffset,i=n.enabled;no(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function Rl(e,t,n){const i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(no(e,e.SCISSOR_TEST,o),o){const a=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function zl(e,t){const n=t.depthRange;e.depthRange(n.near,n.far)}function Ll(e,t){const n=t.depthTest,i=n.enabled;no(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function Nl(e,t){const n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Fl(e,t){e.depthMask(t.depthMask)}function Ml(e,t){e.stencilMask(t.stencilMask)}function _g(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Ul(e,t,n){const i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;no(e,e.BLEND,o),o&&(_g(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function kl(e,t){const n=t.stencilTest,i=n.enabled;if(no(e,e.STENCIL_TEST,i),i){const o=n.frontFunction,a=n.backFunction,r=n.reference,f=n.mask;e.stencilFunc(o,r,f),e.stencilFuncSeparate(e.BACK,a,r,f),e.stencilFuncSeparate(e.FRONT,o,r,f);const c=n.frontOperation,h=c.fail,d=c.zFail,p=c.zPass;e.stencilOpSeparate(e.FRONT,h,d,p);const m=n.backOperation,T=m.fail,y=m.zFail,w=m.zPass;e.stencilOpSeparate(e.BACK,T,y,w)}}function Vl(e,t){const n=t.sampleCoverage,i=n.enabled;no(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}const gg=new be;function Gl(e,t,n){let i=g(t.viewport,n.viewport);l(i)||(i=gg,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}je.apply=function(e,t,n){vl(e,t),Wl(e,t),Pl(e,t),Bl(e,t),zl(e,t),Ll(e,t),Nl(e,t),Fl(e,t),Ml(e,t),kl(e,t),Vl(e,t),Rl(e,t,n),Ul(e,t,n),Gl(e,t,n)};function Tg(e,t){const n=[];return e.frontFace!==t.frontFace&&n.push(vl),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(Wl),e.lineWidth!==t.lineWidth&&n.push(Pl),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Bl),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(zl),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(Ll),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(Nl),e.depthMask!==t.depthMask&&n.push(Fl),e.stencilMask!==t.stencilMask&&n.push(Ml),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(kl),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Vl),n}je.partialApply=function(e,t,n,i,o,a){if(t!==n){let d=n._applyFunctions[t.id];l(d)||(d=Tg(t,n),n._applyFunctions[t.id]=d);const p=d.length;for(let m=0;m<p;++m)d[m](e,n)}const r=l(i.scissorTest)?i.scissorTest:t.scissorTest,f=l(o.scissorTest)?o.scissorTest:n.scissorTest;(r!==f||a)&&Rl(e,n,o);const c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,h=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==h||h&&t.blending!==n.blending)&&Ul(e,n,o),(t!==n||i!==o||i.context!==o.context)&&Gl(e,n,o)},je.getState=function(e){if(!l(e))throw new C("renderState is required.");return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:be.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:D.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?be.clone(e.viewport):void 0}};function ue(e,t,n,i){this[0]=g(e,0),this[1]=g(n,0),this[2]=g(t,0),this[3]=g(i,0)}ue.packedLength=4,ue.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t},ue.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new ue),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n},ue.packArray=function(e,t){_.defined("array",e);const n=e.length,i=n*4;if(!l(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)ue.pack(e[o],t,o*4);return t},ue.unpackArray=function(e,t){if(_.defined("array",e),_.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new C("array length must be a multiple of 4.");const n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){const o=i/4;t[o]=ue.unpack(e,i,t[o])}return t},ue.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new ue(e[0],e[2],e[1],e[3])},ue.fromArray=ue.unpack,ue.fromColumnMajorArray=function(e,t){return _.defined("values",e),ue.clone(e,t)},ue.fromRowMajorArray=function(e,t){return _.defined("values",e),l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new ue(e[0],e[1],e[2],e[3])},ue.fromScale=function(e,t){return _.typeOf.object("scale",e),l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new ue(e.x,0,0,e.y)},ue.fromUniformScale=function(e,t){return _.typeOf.number("scale",e),l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new ue(e,0,0,e)},ue.fromRotation=function(e,t){_.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new ue(n,-i,i,n)},ue.toArray=function(e,t){return _.typeOf.object("matrix",e),l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},ue.getElementIndex=function(e,t){return _.typeOf.number.greaterThanOrEquals("row",t,0),_.typeOf.number.lessThanOrEquals("row",t,1),_.typeOf.number.greaterThanOrEquals("column",e,0),_.typeOf.number.lessThanOrEquals("column",e,1),e*2+t},ue.getColumn=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,1),_.typeOf.object("result",n);const i=t*2,o=e[i],a=e[i+1];return n.x=o,n.y=a,n},ue.setColumn=function(e,t,n,i){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,1),_.typeOf.object("cartesian",n),_.typeOf.object("result",i),i=ue.clone(e,i);const o=t*2;return i[o]=n.x,i[o+1]=n.y,i},ue.getRow=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,1),_.typeOf.object("result",n);const i=e[t],o=e[t+2];return n.x=i,n.y=o,n},ue.setRow=function(e,t,n,i){return _.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,1),_.typeOf.object("cartesian",n),_.typeOf.object("result",i),i=ue.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};const yg=new q;ue.setScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("scale",t),_.typeOf.object("result",n);const i=ue.getScale(e,yg),o=t.x/i.x,a=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*a,n[3]=e[3]*a,n};const Cg=new q;ue.setUniformScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number("scale",t),_.typeOf.object("result",n);const i=ue.getScale(e,Cg),o=t/i.x,a=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*a,n[3]=e[3]*a,n};const ql=new q;ue.getScale=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t.x=q.magnitude(q.fromElements(e[0],e[1],ql)),t.y=q.magnitude(q.fromElements(e[2],e[3],ql)),t};const Hl=new q;ue.getMaximumScale=function(e){return ue.getScale(e,Hl),q.maximumComponent(Hl)};const wg=new q;ue.setRotation=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("result",n);const i=ue.getScale(e,wg);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};const Ag=new q;ue.getRotation=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=ue.getScale(e,Ag);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t},ue.multiply=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n);const i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],a=e[1]*t[0]+e[3]*t[1],r=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=a,n[2]=o,n[3]=r,n},ue.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},ue.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},ue.multiplyByVector=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("cartesian",t),_.typeOf.object("result",n);const i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n},ue.multiplyByScalar=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},ue.multiplyByScale=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.object("scale",t),_.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n},ue.multiplyByUniformScale=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.number("scale",t),_.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},ue.negate=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},ue.transpose=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=e[0],i=e[2],o=e[1],a=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t},ue.abs=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t},ue.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},ue.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},ue.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n},ue.IDENTITY=Object.freeze(new ue(1,0,0,1)),ue.ZERO=Object.freeze(new ue(0,0,0,0)),ue.COLUMN0ROW0=0,ue.COLUMN0ROW1=1,ue.COLUMN1ROW0=2,ue.COLUMN1ROW1=3,Object.defineProperties(ue.prototype,{length:{get:function(){return ue.packedLength}}}),ue.prototype.clone=function(e){return ue.clone(this,e)},ue.prototype.equals=function(e){return ue.equals(this,e)},ue.prototype.equalsEpsilon=function(e,t){return ue.equalsEpsilon(this,e,t)},ue.prototype.toString=function(){return`(${this[0]}, ${this[2]})
45
- (${this[1]}, ${this[3]})`};function Eg(e,t,n,i){switch(t.type){case e.FLOAT:return new jl(e,t,n,i);case e.FLOAT_VEC2:return new Yl(e,t,n,i);case e.FLOAT_VEC3:return new Xl(e,t,n,i);case e.FLOAT_VEC4:return new $l(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new vc(e,t,n,i);case e.INT:case e.BOOL:return new Zl(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Kl(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Ql(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Jl(e,t,n,i);case e.FLOAT_MAT2:return new eu(e,t,n,i);case e.FLOAT_MAT3:return new tu(e,t,n,i);case e.FLOAT_MAT4:return new nu(e,t,n,i);default:throw new dt(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function jl(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}jl.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Yl(e,t,n,i){this.name=n,this.value=void 0,this._value=new q,this._gl=e,this._location=i}Yl.prototype.set=function(){const e=this.value;q.equals(e,this._value)||(q.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function Xl(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Xl.prototype.set=function(){const e=this.value;if(l(e.red))D.equals(e,this._value)||(this._value=D.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue));else if(l(e.x))u.equals(e,this._value)||(this._value=u.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z));else throw new C(`Invalid vec3 value for uniform "${this.name}".`)};function $l(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}$l.prototype.set=function(){const e=this.value;if(l(e.red))D.equals(e,this._value)||(this._value=D.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha));else if(l(e.x))Z.equals(e,this._value)||(this._value=Z.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w));else throw new C(`Invalid vec4 value for uniform "${this.name}".`)};function vc(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}vc.prototype.set=function(){const e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);const t=this.value;e.bindTexture(t._target,t._texture)},vc.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function Zl(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Zl.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function Kl(e,t,n,i){this.name=n,this.value=void 0,this._value=new q,this._gl=e,this._location=i}Kl.prototype.set=function(){const e=this.value;q.equals(e,this._value)||(q.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function Ql(e,t,n,i){this.name=n,this.value=void 0,this._value=new u,this._gl=e,this._location=i}Ql.prototype.set=function(){const e=this.value;u.equals(e,this._value)||(u.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function Jl(e,t,n,i){this.name=n,this.value=void 0,this._value=new Z,this._gl=e,this._location=i}Jl.prototype.set=function(){const e=this.value;Z.equals(e,this._value)||(Z.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};const bg=new Float32Array(4);function eu(e,t,n,i){this.name=n,this.value=void 0,this._value=new ue,this._gl=e,this._location=i}eu.prototype.set=function(){if(!ue.equalsArray(this.value,this._value,0)){ue.clone(this.value,this._value);const e=ue.toArray(this.value,bg);this._gl.uniformMatrix2fv(this._location,!1,e)}};const xg=new Float32Array(9);function tu(e,t,n,i){this.name=n,this.value=void 0,this._value=new G,this._gl=e,this._location=i}tu.prototype.set=function(){if(!G.equalsArray(this.value,this._value,0)){G.clone(this.value,this._value);const e=G.toArray(this.value,xg);this._gl.uniformMatrix3fv(this._location,!1,e)}};const Sg=new Float32Array(16);function nu(e,t,n,i){this.name=n,this.value=void 0,this._value=new k,this._gl=e,this._location=i}nu.prototype.set=function(){if(!k.equalsArray(this.value,this._value,0)){k.clone(this.value,this._value);const e=k.toArray(this.value,Sg);this._gl.uniformMatrix4fv(this._location,!1,e)}};function Ig(e,t,n,i){switch(t.type){case e.FLOAT:return new iu(e,t,n,i);case e.FLOAT_VEC2:return new ou(e,t,n,i);case e.FLOAT_VEC3:return new su(e,t,n,i);case e.FLOAT_VEC4:return new ru(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new Wc(e,t,n,i);case e.INT:case e.BOOL:return new au(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new cu(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new hu(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new fu(e,t,n,i);case e.FLOAT_MAT2:return new lu(e,t,n,i);case e.FLOAT_MAT3:return new uu(e,t,n,i);case e.FLOAT_MAT4:return new du(e,t,n,i);default:throw new dt(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function iu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}iu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1;for(let o=0;o<t;++o){const a=e[o];a!==n[o]&&(n[o]=a,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function ou(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}ou.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];q.equalsArray(r,n,o)||(q.pack(r,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function su(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}su.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];if(l(r.red))(r.red!==n[o]||r.green!==n[o+1]||r.blue!==n[o+2])&&(n[o]=r.red,n[o+1]=r.green,n[o+2]=r.blue,i=!0);else if(l(r.x))u.equalsArray(r,n,o)||(u.pack(r,n,o),i=!0);else throw new C("Invalid vec3 value.");o+=3}i&&this._gl.uniform3fv(this._location,n)};function ru(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}ru.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];if(l(r.red))D.equalsArray(r,n,o)||(D.pack(r,n,o),i=!0);else if(l(r.x))Z.equalsArray(r,n,o)||(Z.pack(r,n,o),i=!0);else throw new C("Invalid vec4 value.");o+=4}i&&this._gl.uniform4fv(this._location,n)};function Wc(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}Wc.prototype.set=function(){const e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){const a=n[o];e.activeTexture(t+o),e.bindTexture(a._target,a._texture)}},Wc.prototype._setSampler=function(e){this.textureUnitIndex=e;const t=this._locations,n=t.length;for(let i=0;i<n;++i){const o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function au(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}au.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1;for(let o=0;o<t;++o){const a=e[o];a!==n[o]&&(n[o]=a,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function cu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}cu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];q.equalsArray(r,n,o)||(q.pack(r,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function hu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}hu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];u.equalsArray(r,n,o)||(u.pack(r,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function fu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}fu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];Z.equalsArray(r,n,o)||(Z.pack(r,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function lu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}lu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];ue.equalsArray(r,n,o)||(ue.pack(r,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function uu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}uu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];G.equalsArray(r,n,o)||(G.pack(r,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function du(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}du.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];k.equalsArray(r,n,o)||(k.pack(r,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};let Dg=0;function lt(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));const i=Og(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=Dg++}lt.fromCache=function(e){return e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context),e.context.shaderCache.getShaderProgram(e)},lt.replaceCache=function(e){return e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context),e.context.shaderCache.replaceShaderProgram(e)},Object.defineProperties(lt.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return Yr(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return Yr(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return Yr(this),this._uniformsByName}}});function pu(e){const t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){const i=n.length;for(let o=0;o<i;o++){const a=n[o].trim(),r=a.slice(a.lastIndexOf(" ")+1);t.push(r)}}return t}function Og(e,t){const n={};if(!xe.highpFloatSupported||!xe.highpIntSupported){let i,o,a,r;const f=pu(e),c=pu(t),h=f.length,d=c.length;for(i=0;i<h;i++)for(o=0;o<d;o++)if(f[i]===c[o]){a=f[i],r=`czm_mediump_${a}`;const p=new RegExp(`${a}\\b`,"g");t=t.replace(p,r),n[r]=a}}return{fragmentShaderText:t,duplicateUniformNames:n}}const Jn="[Cesium WebGL] ";function vg(e,t){const n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);const a=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(a,i),e.compileShader(a);const r=e.createProgram();e.attachShader(r,o),e.attachShader(r,a);const f=t._attributeLocations;if(l(f))for(const m in f)f.hasOwnProperty(m)&&e.bindAttribLocation(r,f[m],m);e.linkProgram(r);let c;if(e.getProgramParameter(r,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Jn}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(a),l(c)&&c.length>0&&console.log(`${Jn}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(r),l(c)&&c.length>0&&console.log(`${Jn}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(a),r;let h;const d=t._debugShaders;throw e.getShaderParameter(a,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(r),console.error(`${Jn}Shader program link log: ${c}`),p(o,"vertex"),p(a,"fragment"),h=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Jn}Vertex shader compile log: ${c}`),console.error(`${Jn} Vertex shader source:
46
- ${n}`),h=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(a),console.error(`${Jn}Fragment shader compile log: ${c}`),console.error(`${Jn} Fragment shader source:
47
- ${i}`),h=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(a),e.deleteProgram(r),new dt(h);function p(m,T){if(!l(d))return;const y=d.getTranslatedShaderSource(m);if(y===""){console.error(`${Jn}${T} shader translation failed.`);return}console.error(`${Jn}Translated ${T} shaderSource:
48
- ${y}`)}}function Wg(e,t,n){const i={};for(let o=0;o<n;++o){const a=e.getActiveAttrib(t,o),r=e.getAttribLocation(t,a.name);i[a.name]={name:a.name,type:a.type,index:r}}return i}function Pg(e,t){const n={},i=[],o=[],a=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<a;++r){const f=e.getActiveUniform(t,r),c="[0]",h=f.name.indexOf(c,f.name.length-c.length)!==-1?f.name.slice(0,f.name.length-3):f.name;if(h.indexOf("gl_")!==0)if(f.name.indexOf("[")<0){const d=e.getUniformLocation(t,h);if(d!==null){const p=Eg(e,f,h,d);n[h]=p,i.push(p),p._setSampler&&o.push(p)}}else{let d,p,m,T;const y=h.indexOf("[");if(y>=0){if(d=n[h.slice(0,y)],!l(d))continue;p=d._locations,p.length<=1&&(m=d.value,T=e.getUniformLocation(t,h),T!==null&&(p.push(T),m.push(e.getUniform(t,T))))}else{p=[];for(let w=0;w<f.size;++w)T=e.getUniformLocation(t,`${h}[${w}]`),T!==null&&p.push(T);d=Ig(e,f,h,p),n[h]=d,i.push(d),d._setSampler&&o.push(d)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function Bg(e,t){const n=[],i=[];for(const o in t)if(t.hasOwnProperty(o)){const a=t[o];let r=o;const f=e._duplicateUniformNames[r];l(f)&&(a.name=f,r=f);const c=gr[r];l(c)?n.push({uniform:a,automaticUniform:c}):i.push(a)}return{automaticUniforms:n,manualUniforms:i}}function Rg(e,t,n){e.useProgram(t);let i=0;const o=n.length;for(let a=0;a<o;++a)i=n[a]._setSampler(i);return e.useProgram(null),i}function Yr(e){l(e._program)||mu(e)}function mu(e){const t=e._program,n=e._gl,i=vg(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),a=Pg(n,i),r=Bg(e,a.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=Wg(n,i,o),e._uniformsByName=a.uniformsByName,e._uniforms=a.uniforms,e._automaticUniforms=r.automaticUniforms,e._manualUniforms=r.manualUniforms,e.maximumTextureUnitIndex=Rg(n,i,a.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(f,c,h,d){const p=e._vertexShaderText,m=e._fragmentShaderText,T=/ ! = /g;e._vertexShaderText=f.replace(T," != "),e._fragmentShaderText=c.replace(T," != ");try{mu(e),h(e._program)}catch(y){e._vertexShaderText=p,e._fragmentShaderText=m;const A=/(?:Compile|Link) error: ([^]*)/.exec(y.message);d(A?A[1]:y.message)}})}lt.prototype._bind=function(){Yr(this),this._gl.useProgram(this._program)},lt.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){const f=this._manualUniforms;for(i=f.length,o=0;o<i;++o){const c=f[o];if(!l(e[c.name]))throw new C(`Unknown uniform: ${c.name}`);c.value=e[c.name]()}}const a=this._automaticUniforms;for(i=a.length,o=0;o<i;++o){const f=a[o];f.uniform.value=f.automaticUniform.getValue(t)}const r=this._uniforms;for(i=r.length,o=0;o<i;++o)r[o].set();if(n){const f=this._gl,c=this._program;if(f.validateProgram(c),!f.getProgramParameter(c,f.VALIDATE_STATUS))throw new C(`Program validation failed. Program info log: ${f.getProgramInfoLog(c)}`)}},lt.prototype.isDestroyed=function(){return!1},lt.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},lt.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),st(this)};const _e={BYTE:R.BYTE,UNSIGNED_BYTE:R.UNSIGNED_BYTE,SHORT:R.SHORT,UNSIGNED_SHORT:R.UNSIGNED_SHORT,INT:R.INT,UNSIGNED_INT:R.UNSIGNED_INT,FLOAT:R.FLOAT,DOUBLE:R.DOUBLE};_e.getSizeInBytes=function(e){if(!l(e))throw new C("value is required.");switch(e){case _e.BYTE:return Int8Array.BYTES_PER_ELEMENT;case _e.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case _e.SHORT:return Int16Array.BYTES_PER_ELEMENT;case _e.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case _e.INT:return Int32Array.BYTES_PER_ELEMENT;case _e.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case _e.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case _e.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new C("componentDatatype is not a valid value.")}},_e.fromTypedArray=function(e){if(e instanceof Int8Array)return _e.BYTE;if(e instanceof Uint8Array)return _e.UNSIGNED_BYTE;if(e instanceof Int16Array)return _e.SHORT;if(e instanceof Uint16Array)return _e.UNSIGNED_SHORT;if(e instanceof Int32Array)return _e.INT;if(e instanceof Uint32Array)return _e.UNSIGNED_INT;if(e instanceof Float32Array)return _e.FLOAT;if(e instanceof Float64Array)return _e.DOUBLE;throw new C("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")},_e.validate=function(e){return l(e)&&(e===_e.BYTE||e===_e.UNSIGNED_BYTE||e===_e.SHORT||e===_e.UNSIGNED_SHORT||e===_e.INT||e===_e.UNSIGNED_INT||e===_e.FLOAT||e===_e.DOUBLE)},_e.createTypedArray=function(e,t){if(!l(e))throw new C("componentDatatype is required.");if(!l(t))throw new C("valuesOrLength is required.");switch(e){case _e.BYTE:return new Int8Array(t);case _e.UNSIGNED_BYTE:return new Uint8Array(t);case _e.SHORT:return new Int16Array(t);case _e.UNSIGNED_SHORT:return new Uint16Array(t);case _e.INT:return new Int32Array(t);case _e.UNSIGNED_INT:return new Uint32Array(t);case _e.FLOAT:return new Float32Array(t);case _e.DOUBLE:return new Float64Array(t);default:throw new C("componentDatatype is not a valid value.")}},_e.createArrayBufferView=function(e,t,n,i){if(!l(e))throw new C("componentDatatype is required.");if(!l(t))throw new C("buffer is required.");switch(n=g(n,0),i=g(i,(t.byteLength-n)/_e.getSizeInBytes(e)),e){case _e.BYTE:return new Int8Array(t,n,i);case _e.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case _e.SHORT:return new Int16Array(t,n,i);case _e.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case _e.INT:return new Int32Array(t,n,i);case _e.UNSIGNED_INT:return new Uint32Array(t,n,i);case _e.FLOAT:return new Float32Array(t,n,i);case _e.DOUBLE:return new Float64Array(t,n,i);default:throw new C("componentDatatype is not a valid value.")}},_e.fromName=function(e){switch(e){case"BYTE":return _e.BYTE;case"UNSIGNED_BYTE":return _e.UNSIGNED_BYTE;case"SHORT":return _e.SHORT;case"UNSIGNED_SHORT":return _e.UNSIGNED_SHORT;case"INT":return _e.INT;case"UNSIGNED_INT":return _e.UNSIGNED_INT;case"FLOAT":return _e.FLOAT;case"DOUBLE":return _e.DOUBLE;default:throw new C("name is not a valid value.")}};const he=Object.freeze(_e),ds=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});function mt(e){e=g(e,g.EMPTY_OBJECT),_.typeOf.object("options.attributes",e.attributes),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=g(e.primitiveType,Xe.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=g(e.geometryType,ds.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}mt.computeNumberOfVertices=function(e){_.typeOf.object("geometry",e);let t=-1;for(const n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){const i=e.attributes[n],o=i.values.length/i.componentsPerAttribute;if(t!==o&&t!==-1)throw new C("All attribute lists must have the same number of attributes.");t=o}return t};const zg=new oe,Lg=new u,_u=new k,Ng=[new oe,new oe,new oe],Fg=[new q,new q,new q],Mg=[new q,new q,new q],Ug=new u,kg=new ie,Vg=new k,Gg=new ue;mt._textureCoordinateRotationPoints=function(e,t,n,i){let o;const a=de.center(i,zg),r=oe.toCartesian(a,n,Lg),f=Ce.eastNorthUpToFixedFrame(r,n,_u),c=k.inverse(f,_u),h=Fg,d=Ng;d[0].longitude=i.west,d[0].latitude=i.south,d[1].longitude=i.west,d[1].latitude=i.north,d[2].longitude=i.east,d[2].latitude=i.south;let p=Ug;for(o=0;o<3;o++)oe.toCartesian(d[o],n,p),p=k.multiplyByPointAsVector(c,p,p),h[o].x=p.x,h[o].y=p.y;const m=ie.fromAxisAngle(u.UNIT_Z,-t,kg),T=G.fromQuaternion(m,Vg),y=e.length;let w=Number.POSITIVE_INFINITY,A=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY,b=Number.NEGATIVE_INFINITY;for(o=0;o<y;o++)p=k.multiplyByPointAsVector(c,e[o],p),p=G.multiplyByVector(T,p,p),w=Math.min(w,p.x),A=Math.min(A,p.y),E=Math.max(E,p.x),b=Math.max(b,p.y);const I=ue.fromRotation(t,Gg),O=Mg;O[0].x=w,O[0].y=A,O[1].x=w,O[1].y=b,O[2].x=E,O[2].y=A;const B=h[0],L=h[2].x-B.x,F=h[1].y-B.y;for(o=0;o<3;o++){const Y=O[o];ue.multiplyByVector(I,Y,Y),Y.x=(Y.x-B.x)/L,Y.y=(Y.y-B.y)/F}const N=O[0],U=O[1],M=O[2],j=new Array(6);return q.pack(N,j),q.pack(U,j,2),q.pack(M,j,4),j};function Ft(e){if(e=g(e,g.EMPTY_OBJECT),!l(e.componentDatatype))throw new C("options.componentDatatype is required.");if(!l(e.componentsPerAttribute))throw new C("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new C("options.componentsPerAttribute must be between 1 and 4.");if(!l(e.values))throw new C("options.values is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=g(e.normalize,!1),this.values=e.values}function zo(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(zo.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}}),zo.clone=function(e){if(l(e))return new zo(e._format,e._datatype,e._width,e._height,e._buffer)},zo.prototype.clone=function(){return zo.clone(this)};function gu(){if(!l(St._canTransferArrayBuffer)){const e=Rc("transferTypedArrayTest");e.postMessage=g(e.webkitPostMessage,e.postMessage);const t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return St._canTransferArrayBuffer=!1,St._canTransferArrayBuffer}St._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){const a=o.data.array,r=l(a)&&a[0]===t;i(r),e.terminate(),St._canTransferArrayBuffer=r}})}return St._canTransferArrayBuffer}const Pc=new Ne;function Bc(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{const o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new o;a.append(e),t=a.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function Rc(e){const t=new mi(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={};let a,r;if(hc(e))r=e;else if(!n){const f=_n(`${St._workerModulePrefix}/${i}.js`);hc(f)&&(r=f)}if(r){const f=`import "${r}";`;return a=Bc(f),o.type="module",new Worker(a,o)}if(!n&&typeof CESIUM_WORKERS<"u"){const f=`
43
+ */(function(e){(function(t,n){e.exports?e.exports=n(j_(),Y_(),X_()):t.URI=n(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(wo,function(t,n,i,o){var a=o&&o.URI;function r(s,x){var P=arguments.length>=1,z=arguments.length>=2;if(!(this instanceof r))return P?z?new r(s,x):new r(s):new r;if(s===void 0){if(P)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?s=location.href+"":s=""}if(s===null&&P)throw new TypeError("null is not a valid argument for URI");return this.href(s),x!==void 0?this.absoluteTo(x):this}function f(s){return/^[0-9]+$/.test(s)}r.version="1.19.11";var c=r.prototype,h=Object.prototype.hasOwnProperty;function d(s){return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function p(s){return s===void 0?"Undefined":String(Object.prototype.toString.call(s)).slice(8,-1)}function m(s){return p(s)==="Array"}function T(s,x){var P={},z,H;if(p(x)==="RegExp")P=null;else if(m(x))for(z=0,H=x.length;z<H;z++)P[x[z]]=!0;else P[x]=!0;for(z=0,H=s.length;z<H;z++){var X=P&&P[s[z]]!==void 0||!P&&x.test(s[z]);X&&(s.splice(z,1),H--,z--)}return s}function y(s,x){var P,z;if(m(x)){for(P=0,z=x.length;P<z;P++)if(!y(s,x[P]))return!1;return!0}var H=p(x);for(P=0,z=s.length;P<z;P++)if(H==="RegExp"){if(typeof s[P]=="string"&&s[P].match(x))return!0}else if(s[P]===x)return!0;return!1}function w(s,x){if(!m(s)||!m(x)||s.length!==x.length)return!1;s.sort(),x.sort();for(var P=0,z=s.length;P<z;P++)if(s[P]!==x[P])return!1;return!0}function A(s){var x=/^\/+|\/+$/g;return s.replace(x,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(s){if(!(!s||!s.nodeName)){var x=s.nodeName.toLowerCase();if(!(x==="input"&&s.type!=="image"))return r.domAttributes[x]}};function E(s){return escape(s)}function b(s){return encodeURIComponent(s).replace(/[!'()*]/g,E).replace(/\*/g,"%2A")}r.encode=b,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=b,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(s,x){var P=r.encode(s+"");return x===void 0&&(x=r.escapeQuerySpace),x?P.replace(/%20/g,"+"):P},r.decodeQuery=function(s,x){s+="",x===void 0&&(x=r.escapeQuerySpace);try{return r.decode(x?s.replace(/\+/g,"%20"):s)}catch{return s}};var D={encode:"encode",decode:"decode"},O,B=function(s,x){return function(P){try{return r[x](P+"").replace(r.characters[s][x].expression,function(z){return r.characters[s][x].map[z]})}catch{return P}}};for(O in D)r[O+"PathSegment"]=B("pathname",D[O]),r[O+"UrnPathSegment"]=B("urnpath",D[O]);var L=function(s,x,P){return function(z){var H;P?H=function(ce){return r[x](r[P](ce))}:H=r[x];for(var X=(z+"").split(s),ee=0,K=X.length;ee<K;ee++)X[ee]=H(X[ee]);return X.join(s)}};r.decodePath=L("/","decodePathSegment"),r.decodeUrnPath=L(":","decodeUrnPathSegment"),r.recodePath=L("/","encodePathSegment","decode"),r.recodeUrnPath=L(":","encodeUrnPathSegment","decode"),r.encodeReserved=B("reserved","encode"),r.parse=function(s,x){var P;return x||(x={preventInvalidHostname:r.preventInvalidHostname}),s=s.replace(r.leading_whitespace_expression,""),s=s.replace(r.ascii_tab_whitespace,""),P=s.indexOf("#"),P>-1&&(x.fragment=s.substring(P+1)||null,s=s.substring(0,P)),P=s.indexOf("?"),P>-1&&(x.query=s.substring(P+1)||null,s=s.substring(0,P)),s=s.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),s=s.replace(/^[/\\]{2,}/i,"//"),s.substring(0,2)==="//"?(x.protocol=null,s=s.substring(2),s=r.parseAuthority(s,x)):(P=s.indexOf(":"),P>-1&&(x.protocol=s.substring(0,P)||null,x.protocol&&!x.protocol.match(r.protocol_expression)?x.protocol=void 0:s.substring(P+1,P+3).replace(/\\/g,"/")==="//"?(s=s.substring(P+3),s=r.parseAuthority(s,x)):(s=s.substring(P+1),x.urn=!0))),x.path=s,x},r.parseHost=function(s,x){s||(s=""),s=s.replace(/\\/g,"/");var P=s.indexOf("/"),z,H;if(P===-1&&(P=s.length),s.charAt(0)==="[")z=s.indexOf("]"),x.hostname=s.substring(1,z)||null,x.port=s.substring(z+2,P)||null,x.port==="/"&&(x.port=null);else{var X=s.indexOf(":"),ee=s.indexOf("/"),K=s.indexOf(":",X+1);K!==-1&&(ee===-1||K<ee)?(x.hostname=s.substring(0,P)||null,x.port=null):(H=s.substring(0,P).split(":"),x.hostname=H[0]||null,x.port=H[1]||null)}return x.hostname&&s.substring(P).charAt(0)!=="/"&&(P++,s="/"+s),x.preventInvalidHostname&&r.ensureValidHostname(x.hostname,x.protocol),x.port&&r.ensureValidPort(x.port),s.substring(P)||"/"},r.parseAuthority=function(s,x){return s=r.parseUserinfo(s,x),r.parseHost(s,x)},r.parseUserinfo=function(s,x){var P=s,z=s.indexOf("\\");z!==-1&&(s=s.replace(/\\/g,"/"));var H=s.indexOf("/"),X=s.lastIndexOf("@",H>-1?H:s.length-1),ee;return X>-1&&(H===-1||X<H)?(ee=s.substring(0,X).split(":"),x.username=ee[0]?r.decode(ee[0]):null,ee.shift(),x.password=ee[0]?r.decode(ee.join(":")):null,s=P.substring(X+1)):(x.username=null,x.password=null),s},r.parseQuery=function(s,x){if(!s)return{};if(s=s.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!s)return{};for(var P={},z=s.split("&"),H=z.length,X,ee,K,ce=0;ce<H;ce++)X=z[ce].split("="),ee=r.decodeQuery(X.shift(),x),K=X.length?r.decodeQuery(X.join("="),x):null,ee!=="__proto__"&&(h.call(P,ee)?((typeof P[ee]=="string"||P[ee]===null)&&(P[ee]=[P[ee]]),P[ee].push(K)):P[ee]=K);return P},r.build=function(s){var x="",P=!1;return s.protocol&&(x+=s.protocol+":"),!s.urn&&(x||s.hostname)&&(x+="//",P=!0),x+=r.buildAuthority(s)||"",typeof s.path=="string"&&(s.path.charAt(0)!=="/"&&P&&(x+="/"),x+=s.path),typeof s.query=="string"&&s.query&&(x+="?"+s.query),typeof s.fragment=="string"&&s.fragment&&(x+="#"+s.fragment),x},r.buildHost=function(s){var x="";if(s.hostname)r.ip6_expression.test(s.hostname)?x+="["+s.hostname+"]":x+=s.hostname;else return"";return s.port&&(x+=":"+s.port),x},r.buildAuthority=function(s){return r.buildUserinfo(s)+r.buildHost(s)},r.buildUserinfo=function(s){var x="";return s.username&&(x+=r.encode(s.username)),s.password&&(x+=":"+r.encode(s.password)),x&&(x+="@"),x},r.buildQuery=function(s,x,P){var z="",H,X,ee,K;for(X in s)if(X!=="__proto__"&&h.call(s,X))if(m(s[X]))for(H={},ee=0,K=s[X].length;ee<K;ee++)s[X][ee]!==void 0&&H[s[X][ee]+""]===void 0&&(z+="&"+r.buildQueryParameter(X,s[X][ee],P),x!==!0&&(H[s[X][ee]+""]=!0));else s[X]!==void 0&&(z+="&"+r.buildQueryParameter(X,s[X],P));return z.substring(1)},r.buildQueryParameter=function(s,x,P){return r.encodeQuery(s,P)+(x!==null?"="+r.encodeQuery(x,P):"")},r.addQuery=function(s,x,P){if(typeof x=="object")for(var z in x)h.call(x,z)&&r.addQuery(s,z,x[z]);else if(typeof x=="string"){if(s[x]===void 0){s[x]=P;return}else typeof s[x]=="string"&&(s[x]=[s[x]]);m(P)||(P=[P]),s[x]=(s[x]||[]).concat(P)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(s,x,P){if(typeof x=="object")for(var z in x)h.call(x,z)&&r.setQuery(s,z,x[z]);else if(typeof x=="string")s[x]=P===void 0?null:P;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(s,x,P){var z,H,X;if(m(x))for(z=0,H=x.length;z<H;z++)s[x[z]]=void 0;else if(p(x)==="RegExp")for(X in s)x.test(X)&&(s[X]=void 0);else if(typeof x=="object")for(X in x)h.call(x,X)&&r.removeQuery(s,X,x[X]);else if(typeof x=="string")P!==void 0?p(P)==="RegExp"?!m(s[x])&&P.test(s[x])?s[x]=void 0:s[x]=T(s[x],P):s[x]===String(P)&&(!m(P)||P.length===1)?s[x]=void 0:m(s[x])&&(s[x]=T(s[x],P)):s[x]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(s,x,P,z){switch(p(x)){case"String":break;case"RegExp":for(var H in s)if(h.call(s,H)&&x.test(H)&&(P===void 0||r.hasQuery(s,H,P)))return!0;return!1;case"Object":for(var X in x)if(h.call(x,X)&&!r.hasQuery(s,X,x[X]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(p(P)){case"Undefined":return x in s;case"Boolean":var ee=!!(m(s[x])?s[x].length:s[x]);return P===ee;case"Function":return!!P(s[x],x,s);case"Array":if(!m(s[x]))return!1;var K=z?y:w;return K(s[x],P);case"RegExp":return m(s[x])?z?y(s[x],P):!1:!!(s[x]&&s[x].match(P));case"Number":P=String(P);case"String":return m(s[x])?z?y(s[x],P):!1:s[x]===P;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var s=[],x=[],P=0,z=0;z<arguments.length;z++){var H=new r(arguments[z]);s.push(H);for(var X=H.segment(),ee=0;ee<X.length;ee++)typeof X[ee]=="string"&&x.push(X[ee]),X[ee]&&P++}if(!x.length||!P)return new r("");var K=new r("").segment(x);return(s[0].path()===""||s[0].path().slice(0,1)==="/")&&K.path("/"+K.path()),K.normalize()},r.commonPath=function(s,x){var P=Math.min(s.length,x.length),z;for(z=0;z<P;z++)if(s.charAt(z)!==x.charAt(z)){z--;break}return z<1?s.charAt(0)===x.charAt(0)&&s.charAt(0)==="/"?"/":"":((s.charAt(z)!=="/"||x.charAt(z)!=="/")&&(z=s.substring(0,z).lastIndexOf("/")),s.substring(0,z+1))},r.withinString=function(s,x,P){P||(P={});var z=P.start||r.findUri.start,H=P.end||r.findUri.end,X=P.trim||r.findUri.trim,ee=P.parens||r.findUri.parens,K=/[a-z0-9-]=["']?$/i;for(z.lastIndex=0;;){var ce=z.exec(s);if(!ce)break;var le=ce.index;if(P.ignoreHtml){var we=s.slice(Math.max(le-3,0),le);if(we&&K.test(we))continue}for(var Se=le+s.slice(le).search(H),Ee=s.slice(le,Se),Le=-1;;){var Ke=ee.exec(Ee);if(!Ke)break;var ct=Ke.index+Ke[0].length;Le=Math.max(Le,ct)}if(Le>-1?Ee=Ee.slice(0,Le)+Ee.slice(Le).replace(X,""):Ee=Ee.replace(X,""),!(Ee.length<=ce[0].length)&&!(P.ignore&&P.ignore.test(Ee))){Se=le+Ee.length;var gt=x(Ee,le,Se,s);if(gt===void 0){z.lastIndex=Se;continue}gt=String(gt),s=s.slice(0,le)+gt+s.slice(Se),z.lastIndex=le+gt.length}}return z.lastIndex=0,s},r.ensureValidHostname=function(s,x){var P=!!s,z=!!x,H=!1;if(z&&(H=y(r.hostProtocols,x)),H&&!P)throw new TypeError("Hostname cannot be empty, if protocol is "+x);if(s&&s.match(r.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+s+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(s).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+s+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(s){if(s){var x=Number(s);if(!(f(x)&&x>0&&x<65536))throw new TypeError('Port "'+s+'" is not a valid port')}},r.noConflict=function(s){if(s){var x={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(x.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(x.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(x.SecondLevelDomains=o.SecondLevelDomains.noConflict()),x}else o.URI===this&&(o.URI=a);return this},c.build=function(s){return s===!0?this._deferred_build=!0:(s===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},c.clone=function(){return new r(this)},c.valueOf=c.toString=function(){return this.build(!1)._string};function F(s){return function(x,P){return x===void 0?this._parts[s]||"":(this._parts[s]=x||null,this.build(!P),this)}}function N(s,x){return function(P,z){return P===void 0?this._parts[s]||"":(P!==null&&(P=P+"",P.charAt(0)===x&&(P=P.substring(1))),this._parts[s]=P,this.build(!z),this)}}c.protocol=F("protocol"),c.username=F("username"),c.password=F("password"),c.hostname=F("hostname"),c.port=F("port"),c.query=N("query","?"),c.fragment=N("fragment","#"),c.search=function(s,x){var P=this.query(s,x);return typeof P=="string"&&P.length?"?"+P:P},c.hash=function(s,x){var P=this.fragment(s,x);return typeof P=="string"&&P.length?"#"+P:P},c.pathname=function(s,x){if(s===void 0||s===!0){var P=this._parts.path||(this._parts.hostname?"/":"");return s?(this._parts.urn?r.decodeUrnPath:r.decodePath)(P):P}else return this._parts.urn?this._parts.path=s?r.recodeUrnPath(s):"":this._parts.path=s?r.recodePath(s):"/",this.build(!x),this},c.path=c.pathname,c.href=function(s,x){var P;if(s===void 0)return this.toString();this._string="",this._parts=r._parts();var z=s instanceof r,H=typeof s=="object"&&(s.hostname||s.path||s.pathname);if(s.nodeName){var X=r.getDomAttribute(s);s=s[X]||"",H=!1}if(!z&&H&&s.pathname!==void 0&&(s=s.toString()),typeof s=="string"||s instanceof String)this._parts=r.parse(String(s),this._parts);else if(z||H){var ee=z?s._parts:s;for(P in ee)P!=="query"&&h.call(this._parts,P)&&(this._parts[P]=ee[P]);ee.query&&this.query(ee.query,!1)}else throw new TypeError("invalid input");return this.build(!x),this},c.is=function(s){var x=!1,P=!1,z=!1,H=!1,X=!1,ee=!1,K=!1,ce=!this._parts.urn;switch(this._parts.hostname&&(ce=!1,P=r.ip4_expression.test(this._parts.hostname),z=r.ip6_expression.test(this._parts.hostname),x=P||z,H=!x,X=H&&i&&i.has(this._parts.hostname),ee=H&&r.idn_expression.test(this._parts.hostname),K=H&&r.punycode_expression.test(this._parts.hostname)),s.toLowerCase()){case"relative":return ce;case"absolute":return!ce;case"domain":case"name":return H;case"sld":return X;case"ip":return x;case"ip4":case"ipv4":case"inet4":return P;case"ip6":case"ipv6":case"inet6":return z;case"idn":return ee;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return K}return null};var U=c.protocol,M=c.port,j=c.hostname;c.protocol=function(s,x){if(s&&(s=s.replace(/:(\/\/)?$/,""),!s.match(r.protocol_expression)))throw new TypeError('Protocol "'+s+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return U.call(this,s,x)},c.scheme=c.protocol,c.port=function(s,x){return this._parts.urn?s===void 0?"":this:(s!==void 0&&(s===0&&(s=null),s&&(s+="",s.charAt(0)===":"&&(s=s.substring(1)),r.ensureValidPort(s))),M.call(this,s,x))},c.hostname=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s!==void 0){var P={preventInvalidHostname:this._parts.preventInvalidHostname},z=r.parseHost(s,P);if(z!=="/")throw new TypeError('Hostname "'+s+'" contains characters other than [A-Z0-9.-]');s=P.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(s,this._parts.protocol)}return j.call(this,s,x)},c.origin=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0){var P=this.protocol(),z=this.authority();return z?(P?P+"://":"")+this.authority():""}else{var H=r(s);return this.protocol(H.protocol()).authority(H.authority()).build(!x),this}},c.host=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var P=r.parseHost(s,this._parts);if(P!=="/")throw new TypeError('Hostname "'+s+'" contains characters other than [A-Z0-9.-]');return this.build(!x),this},c.authority=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var P=r.parseAuthority(s,this._parts);if(P!=="/")throw new TypeError('Hostname "'+s+'" contains characters other than [A-Z0-9.-]');return this.build(!x),this},c.userinfo=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0){var P=r.buildUserinfo(this._parts);return P&&P.substring(0,P.length-1)}else return s[s.length-1]!=="@"&&(s+="@"),r.parseUserinfo(s,this._parts),this.build(!x),this},c.resource=function(s,x){var P;return s===void 0?this.path()+this.search()+this.hash():(P=r.parse(s),this._parts.path=P.path,this._parts.query=P.query,this._parts.fragment=P.fragment,this.build(!x),this)},c.subdomain=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,P)||""}else{var z=this._parts.hostname.length-this.domain().length,H=this._parts.hostname.substring(0,z),X=new RegExp("^"+d(H));if(s&&s.charAt(s.length-1)!=="."&&(s+="."),s.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return s&&r.ensureValidHostname(s,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(X,s),this.build(!x),this}},c.domain=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(typeof s=="boolean"&&(x=s,s=void 0),s===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.match(/\./g);if(P&&P.length<2)return this._parts.hostname;var z=this._parts.hostname.length-this.tld(x).length-1;return z=this._parts.hostname.lastIndexOf(".",z-1)+1,this._parts.hostname.substring(z)||""}else{if(!s)throw new TypeError("cannot set domain empty");if(s.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(s,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=s;else{var H=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(H,s)}return this.build(!x),this}},c.tld=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(typeof s=="boolean"&&(x=s,s=void 0),s===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.lastIndexOf("."),z=this._parts.hostname.substring(P+1);return x!==!0&&i&&i.list[z.toLowerCase()]&&i.get(this._parts.hostname)||z}else{var H;if(s)if(s.match(/[^a-zA-Z0-9-]/))if(i&&i.is(s))H=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(H,s);else throw new TypeError('TLD "'+s+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");H=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(H,s)}else throw new TypeError("cannot set TLD empty");return this.build(!x),this}},c.directory=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0||s===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var P=this._parts.path.length-this.filename().length-1,z=this._parts.path.substring(0,P)||(this._parts.hostname?"/":"");return s?r.decodePath(z):z}else{var H=this._parts.path.length-this.filename().length,X=this._parts.path.substring(0,H),ee=new RegExp("^"+d(X));return this.is("relative")||(s||(s="/"),s.charAt(0)!=="/"&&(s="/"+s)),s&&s.charAt(s.length-1)!=="/"&&(s+="/"),s=r.recodePath(s),this._parts.path=this._parts.path.replace(ee,s),this.build(!x),this}},c.filename=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(typeof s!="string"){if(!this._parts.path||this._parts.path==="/")return"";var P=this._parts.path.lastIndexOf("/"),z=this._parts.path.substring(P+1);return s?r.decodePathSegment(z):z}else{var H=!1;s.charAt(0)==="/"&&(s=s.substring(1)),s.match(/\.?\//)&&(H=!0);var X=new RegExp(d(this.filename())+"$");return s=r.recodePath(s),this._parts.path=this._parts.path.replace(X,s),H?this.normalizePath(x):this.build(!x),this}},c.suffix=function(s,x){if(this._parts.urn)return s===void 0?"":this;if(s===void 0||s===!0){if(!this._parts.path||this._parts.path==="/")return"";var P=this.filename(),z=P.lastIndexOf("."),H,X;return z===-1?"":(H=P.substring(z+1),X=/^[a-z0-9%]+$/i.test(H)?H:"",s?r.decodePathSegment(X):X)}else{s.charAt(0)==="."&&(s=s.substring(1));var ee=this.suffix(),K;if(ee)s?K=new RegExp(d(ee)+"$"):K=new RegExp(d("."+ee)+"$");else{if(!s)return this;this._parts.path+="."+r.recodePath(s)}return K&&(s=r.recodePath(s),this._parts.path=this._parts.path.replace(K,s)),this.build(!x),this}},c.segment=function(s,x,P){var z=this._parts.urn?":":"/",H=this.path(),X=H.substring(0,1)==="/",ee=H.split(z);if(s!==void 0&&typeof s!="number"&&(P=x,x=s,s=void 0),s!==void 0&&typeof s!="number")throw new Error('Bad segment "'+s+'", must be 0-based integer');if(X&&ee.shift(),s<0&&(s=Math.max(ee.length+s,0)),x===void 0)return s===void 0?ee:ee[s];if(s===null||ee[s]===void 0)if(m(x)){ee=[];for(var K=0,ce=x.length;K<ce;K++)!x[K].length&&(!ee.length||!ee[ee.length-1].length)||(ee.length&&!ee[ee.length-1].length&&ee.pop(),ee.push(A(x[K])))}else(x||typeof x=="string")&&(x=A(x),ee[ee.length-1]===""?ee[ee.length-1]=x:ee.push(x));else x?ee[s]=A(x):ee.splice(s,1);return X&&ee.unshift(""),this.path(ee.join(z),P)},c.segmentCoded=function(s,x,P){var z,H,X;if(typeof s!="number"&&(P=x,x=s,s=void 0),x===void 0){if(z=this.segment(s,x,P),!m(z))z=z!==void 0?r.decode(z):void 0;else for(H=0,X=z.length;H<X;H++)z[H]=r.decode(z[H]);return z}if(!m(x))x=typeof x=="string"||x instanceof String?r.encode(x):x;else for(H=0,X=x.length;H<X;H++)x[H]=r.encode(x[H]);return this.segment(s,x,P)};var Y=c.query;return c.query=function(s,x){if(s===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof s=="function"){var P=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),z=s.call(this,P);return this._parts.query=r.buildQuery(z||P,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!x),this}else return s!==void 0&&typeof s!="string"?(this._parts.query=r.buildQuery(s,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!x),this):Y.call(this,s,x)},c.setQuery=function(s,x,P){var z=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof s=="string"||s instanceof String)z[s]=x!==void 0?x:null;else if(typeof s=="object")for(var H in s)h.call(s,H)&&(z[H]=s[H]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof s!="string"&&(P=x),this.build(!P),this},c.addQuery=function(s,x,P){var z=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(z,s,x===void 0?null:x),this._parts.query=r.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof s!="string"&&(P=x),this.build(!P),this},c.removeQuery=function(s,x,P){var z=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(z,s,x),this._parts.query=r.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof s!="string"&&(P=x),this.build(!P),this},c.hasQuery=function(s,x,P){var z=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(z,s,x,P)},c.setSearch=c.setQuery,c.addSearch=c.addQuery,c.removeSearch=c.removeQuery,c.hasSearch=c.hasQuery,c.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},c.normalizeProtocol=function(s){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!s)),this},c.normalizeHostname=function(s){return this._parts.hostname&&(this.is("IDN")&&t?this._parts.hostname=t.toASCII(this._parts.hostname):this.is("IPv6")&&n&&(this._parts.hostname=n.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!s)),this},c.normalizePort=function(s){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!s)),this},c.normalizePath=function(s){var x=this._parts.path;if(!x)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!s),this;if(this._parts.path==="/")return this;x=r.recodePath(x);var P,z="",H,X;for(x.charAt(0)!=="/"&&(P=!0,x="/"+x),(x.slice(-3)==="/.."||x.slice(-2)==="/.")&&(x+="/"),x=x.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),P&&(z=x.substring(1).match(/^(\.\.\/)+/)||"",z&&(z=z[0]));H=x.search(/\/\.\.(\/|$)/),H!==-1;){if(H===0){x=x.substring(3);continue}X=x.substring(0,H).lastIndexOf("/"),X===-1&&(X=H),x=x.substring(0,X)+x.substring(H+3)}return P&&this.is("relative")&&(x=z+x.substring(1)),this._parts.path=x,this.build(!s),this},c.normalizePathname=c.normalizePath,c.normalizeQuery=function(s){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!s)),this},c.normalizeFragment=function(s){return this._parts.fragment||(this._parts.fragment=null,this.build(!s)),this},c.normalizeSearch=c.normalizeQuery,c.normalizeHash=c.normalizeFragment,c.iso8859=function(){var s=r.encode,x=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=s,r.decode=x}return this},c.unicode=function(){var s=r.encode,x=r.decode;r.encode=b,r.decode=unescape;try{this.normalize()}finally{r.encode=s,r.decode=x}return this},c.readable=function(){var s=this.clone();s.username("").password("").normalize();var x="";if(s._parts.protocol&&(x+=s._parts.protocol+"://"),s._parts.hostname&&(s.is("punycode")&&t?(x+=t.toUnicode(s._parts.hostname),s._parts.port&&(x+=":"+s._parts.port)):x+=s.host()),s._parts.hostname&&s._parts.path&&s._parts.path.charAt(0)!=="/"&&(x+="/"),x+=s.path(!0),s._parts.query){for(var P="",z=0,H=s._parts.query.split("&"),X=H.length;z<X;z++){var ee=(H[z]||"").split("=");P+="&"+r.decodeQuery(ee[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),ee[1]!==void 0&&(P+="="+r.decodeQuery(ee[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}x+="?"+P.substring(1)}return x+=r.decodeQuery(s.hash(),!0),x},c.absoluteTo=function(s){var x=this.clone(),P=["protocol","username","password","hostname","port"],z,H,X;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(s instanceof r||(s=new r(s)),x._parts.protocol||(x._parts.protocol=s._parts.protocol,this._parts.hostname))return x;for(H=0;X=P[H];H++)x._parts[X]=s._parts[X];return x._parts.path?(x._parts.path.substring(-2)===".."&&(x._parts.path+="/"),x.path().charAt(0)!=="/"&&(z=s.directory(),z=z||(s.path().indexOf("/")===0?"/":""),x._parts.path=(z?z+"/":"")+x._parts.path,x.normalizePath())):(x._parts.path=s._parts.path,x._parts.query||(x._parts.query=s._parts.query)),x.build(),x},c.relativeTo=function(s){var x=this.clone().normalize(),P,z,H,X,ee;if(x._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(s=new r(s).normalize(),P=x._parts,z=s._parts,X=x.path(),ee=s.path(),X.charAt(0)!=="/")throw new Error("URI is already relative");if(ee.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(P.protocol===z.protocol&&(P.protocol=null),P.username!==z.username||P.password!==z.password||P.protocol!==null||P.username!==null||P.password!==null)return x.build();if(P.hostname===z.hostname&&P.port===z.port)P.hostname=null,P.port=null;else return x.build();if(X===ee)return P.path="",x.build();if(H=r.commonPath(X,ee),!H)return x.build();var K=z.path.substring(H.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return P.path=K+P.path.substring(H.length)||"./",x.build()},c.equals=function(s){var x=this.clone(),P=new r(s),z={},H={},X={},ee,K,ce;if(x.normalize(),P.normalize(),x.toString()===P.toString())return!0;if(ee=x.query(),K=P.query(),x.query(""),P.query(""),x.toString()!==P.toString()||ee.length!==K.length)return!1;z=r.parseQuery(ee,this._parts.escapeQuerySpace),H=r.parseQuery(K,this._parts.escapeQuerySpace);for(ce in z)if(h.call(z,ce)){if(m(z[ce])){if(!w(z[ce],H[ce]))return!1}else if(z[ce]!==H[ce])return!1;X[ce]=!0}for(ce in H)if(h.call(H,ce)&&!X[ce])return!1;return!0},c.preventInvalidHostname=function(s){return this._parts.preventInvalidHostname=!!s,this},c.duplicateQueryParameters=function(s){return this._parts.duplicateQueryParameters=!!s,this},c.escapeQuerySpace=function(s){return this._parts.escapeQuerySpace=!!s,this},r})})(jf);var $_=jf.exports;const mi=lr($_);function Z_(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}function cn(e,t){if(e===null||typeof e!="object")return e;t=g(t,!1);const n=new e.constructor;for(const i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=cn(o,t)),n[i]=o}return n}function hn(e,t,n){n=g(n,!1);const i={},o=l(e),a=l(t);let r,f,c;if(o)for(r in e)e.hasOwnProperty(r)&&(f=e[r],a&&n&&typeof f=="object"&&t.hasOwnProperty(r)?(c=t[r],typeof c=="object"?i[r]=hn(f,c,n):i[r]=f):i[r]=f);if(a)for(r in t)t.hasOwnProperty(r)&&!i.hasOwnProperty(r)&&(c=t[r],i[r]=c);return i}function ss(){let e,t;const n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}function rs(e,t){let n;return typeof document<"u"&&(n=document),rs._implementation(e,t,n)}rs._implementation=function(e,t,n){if(!l(e))throw new C("relative uri is required.");if(!l(t)){if(typeof n>"u")return e;t=g(n.baseURI,n.location.href)}const i=new mi(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};function K_(e,t){if(!l(e))throw new C("uri is required.");let n="";const i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new mi(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}function Q_(e){if(!l(e))throw new C("uri is required.");const t=new mi(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}const Zf={};function Kf(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Zf[t];l(i)||(i={},Zf[t]=i);let o=i[n];if(!l(o)){const a=document.createElement("canvas");a.width=t,a.height=n,o=a.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}const J_=/^blob:/i;function Qf(e){return _.typeOf.string("uri",e),J_.test(e)}let Xn;function hc(e){l(Xn)||(Xn=document.createElement("a")),Xn.href=window.location.href;const t=Xn.host,n=Xn.protocol;return Xn.href=e,Xn.href=Xn.href,n!==Xn.protocol||t!==Xn.host}const e1=/^data:/i;function Jf(e){return _.typeOf.string("uri",e),e1.test(e)}function t1(e){const t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");const o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(a){i(a)},o.appendChild(t)})}function n1(e){if(!l(e))throw new C("obj is required.");let t="";for(const n in e)if(e.hasOwnProperty(n)){const i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let a=0,r=i.length;a<r;++a)t+=`${o+encodeURIComponent(i[a])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}function i1(e){if(!l(e))throw new C("queryString is required.");const t={};if(e==="")return t;const n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){const a=n[i].split("="),r=decodeURIComponent(a[0]);let f=a[1];l(f)?f=decodeURIComponent(f):f="";const c=t[r];typeof c=="string"?t[r]=[c,f]:Array.isArray(c)?c.push(f):t[r]=f}return t}const yt=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),o1=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function Pr(e){e=g(e,g.EMPTY_OBJECT);const t=g(e.throttleByServer,!1),n=g(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=g(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=g(e.type,o1.OTHER),this.serverKey=e.serverKey,this.state=yt.UNISSUED,this.deferred=void 0,this.cancelled=!1}Pr.prototype.cancel=function(){this.cancelled=!0},Pr.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=yt.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Pr(this)};function s1(e){const t={};if(!e)return t;const n=e.split(`\r
44
+ `);for(let i=0;i<n.length;++i){const o=n[i],a=o.indexOf(": ");if(a>0){const r=o.substring(0,a),f=o.substring(a+2);t[r]=f}}return t}function as(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=s1(this.responseHeaders))}as.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};function Ne(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(Ne.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),Ne.prototype.addEventListener=function(e,t){_.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);const n=this;return function(){n.removeEventListener(e,t)}},Ne.prototype.removeEventListener=function(e,t){_.typeOf.func("listener",e);const n=this._listeners,i=this._scopes;let o=-1;for(let a=0;a<n.length;a++)if(n[a]===e&&i[a]===t){o=a;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function r1(e,t){return t-e}Ne.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e;const t=this._listeners,n=this._scopes;let i=t.length;for(e=0;e<i;e++){const a=t[e];l(a)&&t[e].apply(n[e],arguments)}const o=this._toRemove;if(i=o.length,i>0){for(o.sort(r1),e=0;e<i;e++){const a=o[e];t.splice(a,1),n.splice(a,1)}o.length=0}this._insideRaiseEvent=!1};function Ji(e){_.typeOf.object("options",e),_.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Ji.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){_.typeOf.number.greaterThanOrEquals("maximumLength",e,0);const t=this._length;if(e<t){const n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function fc(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}Ji.prototype.reserve=function(e){e=g(e,this._length),this._array.length=e},Ji.prototype.heapify=function(e){e=g(e,0);const t=this._length,n=this._comparator,i=this._array;let o=-1,a=!0;for(;a;){const r=2*(e+1),f=r-1;f<t&&n(i[f],i[e])<0?o=f:o=e,r<t&&n(i[r],i[o])<0&&(o=r),o!==e?(fc(i,o,e),e=o):a=!1}},Ji.prototype.resort=function(){const e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},Ji.prototype.insert=function(e){_.defined("element",e);const t=this._array,n=this._comparator,i=this._maximumLength;let o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){const r=Math.floor((o-1)/2);if(n(t[o],t[r])<0)fc(t,o,r),o=r;else break}let a;return l(i)&&this._length>i&&(a=t[i],this._length=i),a},Ji.prototype.pop=function(e){if(e=g(e,0),this._length===0)return;_.typeOf.number.lessThan("index",e,this._length);const t=this._array,n=t[e];return fc(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};function a1(e,t){return e.priority-t.priority}const ke={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let Io=20;const $t=new Ji({comparator:a1});$t.maximumLength=Io,$t.reserve(Io);const $n=[];let _i={};const c1=typeof document<"u"?new mi(document.location.href):new mi,Br=new Ne;function Je(){}Je.maximumRequests=50,Je.maximumRequestsPerServer=18,Je.requestsByServer={},Je.throttleRequests=!0,Je.debugShowStatistics=!1,Je.requestCompletedEvent=Br,Object.defineProperties(Je,{statistics:{get:function(){return ke}},priorityHeapLength:{get:function(){return Io},set:function(e){if(e<Io)for(;$t.length>e;){const t=$t.pop();eo(t)}Io=e,$t.maximumLength=e,$t.reserve(e)}}});function el(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Je.serverHasOpenSlots=function(e,t){t=g(t,1);const n=g(Je.requestsByServer[e],Je.maximumRequestsPerServer);return _i[e]+t<=n},Je.heapHasOpenSlots=function(e){return $t.length+e<=Io};function tl(e){return e.state===yt.UNISSUED&&(e.state=yt.ISSUED,e.deferred=ss()),e.deferred.promise}function h1(e){return function(t){if(e.state===yt.CANCELLED)return;const n=e.deferred;--ke.numberOfActiveRequests,--_i[e.serverKey],Br.raiseEvent(),e.state=yt.RECEIVED,e.deferred=void 0,n.resolve(t)}}function f1(e){return function(t){e.state!==yt.CANCELLED&&(++ke.numberOfFailedRequests,--ke.numberOfActiveRequests,--_i[e.serverKey],Br.raiseEvent(t),e.state=yt.FAILED,e.deferred.reject(t))}}function nl(e){const t=tl(e);return e.state=yt.ACTIVE,$n.push(e),++ke.numberOfActiveRequests,++ke.numberOfActiveRequestsEver,++_i[e.serverKey],e.requestFunction().then(h1(e)).catch(f1(e)),t}function eo(e){const t=e.state===yt.ACTIVE;if(e.state=yt.CANCELLED,++ke.numberOfCancelledRequests,l(e.deferred)){const n=e.deferred;e.deferred=void 0,n.reject()}t&&(--ke.numberOfActiveRequests,--_i[e.serverKey],++ke.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Je.update=function(){let e,t,n=0;const i=$n.length;for(e=0;e<i;++e){if(t=$n[e],t.cancelled&&eo(t),t.state!==yt.ACTIVE){++n;continue}n>0&&($n[e-n]=t)}$n.length-=n;const o=$t.internalArray,a=$t.length;for(e=0;e<a;++e)el(o[e]);$t.resort();const r=Math.max(Je.maximumRequests-$n.length,0);let f=0;for(;f<r&&$t.length>0;){if(t=$t.pop(),t.cancelled){eo(t);continue}if(t.throttleByServer&&!Je.serverHasOpenSlots(t.serverKey)){eo(t);continue}nl(t),++f}l1()},Je.getServerKey=function(e){_.typeOf.string("url",e);let t=new mi(e);t.scheme()===""&&(t=t.absoluteTo(c1),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);const i=_i[n];return l(i)||(_i[n]=0),n},Je.request=function(e){if(_.typeOf.object("request",e),_.typeOf.string("request.url",e.url),_.typeOf.func("request.requestFunction",e.requestFunction),Jf(e.url)||Qf(e.url))return Br.raiseEvent(),e.state=yt.RECEIVED,e.requestFunction();if(++ke.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Je.getServerKey(e.url)),Je.throttleRequests&&e.throttleByServer&&!Je.serverHasOpenSlots(e.serverKey))return;if(!Je.throttleRequests||!e.throttle)return nl(e);if($n.length>=Je.maximumRequests)return;el(e);const t=$t.insert(e);if(l(t)){if(t===e)return;eo(t)}return tl(e)};function l1(){Je.debugShowStatistics&&(ke.numberOfActiveRequests===0&&ke.lastNumberOfActiveRequests>0&&(ke.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${ke.numberOfAttemptedRequests}`),ke.numberOfAttemptedRequests=0),ke.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${ke.numberOfCancelledRequests}`),ke.numberOfCancelledRequests=0),ke.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${ke.numberOfCancelledActiveRequests}`),ke.numberOfCancelledActiveRequests=0),ke.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${ke.numberOfFailedRequests}`),ke.numberOfFailedRequests=0)),ke.lastNumberOfActiveRequests=ke.numberOfActiveRequests)}Je.clearForSpecs=function(){for(;$t.length>0;){const t=$t.pop();eo(t)}const e=$n.length;for(let t=0;t<e;++t)eo($n[t]);$n.length=0,_i={},ke.numberOfAttemptedRequests=0,ke.numberOfActiveRequests=0,ke.numberOfCancelledRequests=0,ke.numberOfCancelledActiveRequests=0,ke.numberOfFailedRequests=0,ke.numberOfActiveRequestsEver=0,ke.lastNumberOfActiveRequests=0},Je.numberOfActiveRequestsByServer=function(e){return _i[e]},Je.requestHeap=$t;const Do={};let Oo={};Do.add=function(e,t){if(!l(e))throw new C("host is required.");if(!l(t)||t<=0)throw new C("port is required to be greater than 0.");const n=`${e.toLowerCase()}:${t}`;l(Oo[n])||(Oo[n]=!0)},Do.remove=function(e,t){if(!l(e))throw new C("host is required.");if(!l(t)||t<=0)throw new C("port is required to be greater than 0.");const n=`${e.toLowerCase()}:${t}`;l(Oo[n])&&delete Oo[n]};function u1(e){const t=new mi(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}Do.contains=function(e){if(!l(e))throw new C("url is required.");const t=u1(e);return!!(l(t)&&l(Oo[t]))},Do.clear=function(){Oo={}};const il=function(){try{const e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function ae(e){e=g(e,g.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),_.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Zn(e.templateValues,{}),this._queryParameters=Zn(e.queryParameters,{}),this.headers=Zn(e.headers,{}),this.request=g(e.request,new Pr),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=g(e.retryAttempts,0),this._retryCount=0,g(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Zn(e,t){return l(e)?cn(e):t}ae.createIfNeeded=function(e){return e instanceof ae?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new ae({url:e})};let vo;ae.supportsImageBitmapOptions=function(){return l(vo)?vo:typeof createImageBitmap!="function"?(vo=Promise.resolve(!1),vo):(vo=ae.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){const n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){const n=Kf(t[0]),i=Kf(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),vo)},Object.defineProperties(ae,{isBlobSupported:{get:function(){return il}}}),Object.defineProperties(ae.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return Q_(this._url)}},isDataUri:{get:function(){return Jf(this._url)}},isBlobUri:{get:function(){return Qf(this._url)}},isCrossOriginUrl:{get:function(){return hc(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),ae.prototype.toString=function(){return this.getUrlComponent(!0,!0)},ae.prototype.parseUrl=function(e,t,n,i){let o=new mi(e);const a=d1(o.query());this._queryParameters=t?Rr(a,this.queryParameters,n):a,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(rs(i))),this._url=o.toString()};function d1(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:i1(e)}function Rr(e,t,n){if(!n)return hn(e,t);const i=cn(e,!0);for(const o in t)if(t.hasOwnProperty(o)){let a=i[o];const r=t[o];l(a)?(Array.isArray(a)||(a=i[o]=[a]),i[o]=a.concat(r)):i[o]=Array.isArray(r)?r.slice():r}return i}ae.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${p1(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");const i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,a){const r=i[a];return l(r)?encodeURIComponent(r):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function p1(e){const t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${n1(e)}`}ae.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Rr(this._queryParameters,e,!1):this._queryParameters=Rr(e,this._queryParameters,!1)},ae.prototype.appendQueryParameters=function(e){this._queryParameters=Rr(e,this._queryParameters,!0)},ae.prototype.setTemplateValues=function(e,t){t?this._templateValues=hn(this._templateValues,e):this._templateValues=hn(e,this._templateValues)},ae.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,l(e.url)){const n=g(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=hn(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=hn(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=hn(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},ae.prototype.retryOnError=function(e){const t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})},ae.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=cn(this._queryParameters),e._templateValues=cn(this._templateValues),e.headers=cn(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new ae({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})},ae.prototype.getBaseUri=function(e){return K_(this.getUrlComponent(e),e)},ae.prototype.appendForwardSlash=function(){this._url=Z_(this._url)},ae.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},ae.fetchArrayBuffer=function(e){return new ae(e).fetchArrayBuffer()},ae.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},ae.fetchBlob=function(e){return new ae(e).fetchBlob()},ae.prototype.fetchImage=function(e){e=g(e,g.EMPTY_OBJECT);const t=g(e.preferImageBitmap,!1),n=g(e.preferBlob,!1),i=g(e.flipY,!1),o=g(e.skipColorSpaceConversion,!1);if(uc(this.request),!il||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return lc({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});const a=this.fetchBlob();if(!l(a))return;let r,f,c,h;return ae.supportsImageBitmapOptions().then(function(d){return r=d,f=r&&t,a}).then(function(d){if(!l(d))return;if(h=d,f)return ae.createImageBitmapFromBlob(d,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});const p=window.URL.createObjectURL(d);return c=new ae({url:p}),lc({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(d){if(l(d))return d.blob=h,f||window.URL.revokeObjectURL(c.url),d}).catch(function(d){return l(c)&&window.URL.revokeObjectURL(c.url),d.blob=h,Promise.reject(d)})};function lc(e){const t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,a=t.request;a.url=t.url,a.requestFunction=function(){let f=!1;!t.isDataUri&&!t.isBlobUri&&(f=t.isCrossOriginUrl);const c=ss();return ae._Implementations.createImage(a,f,c,n,i,o),c.promise};const r=Je.request(a);if(l(r))return r.catch(function(f){return a.state!==yt.FAILED?Promise.reject(f):t.retryOnError(f).then(function(c){return c?(a.state=yt.UNISSUED,a.deferred=void 0,lc({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(f)})})}ae.fetchImage=function(e){return new ae(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},ae.prototype.fetchText=function(){return this.fetch({responseType:"text"})},ae.fetchText=function(e){return new ae(e).fetchText()},ae.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})},ae.fetchJson=function(e){return new ae(e).fetchJson()},ae.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},ae.fetchXML=function(e){return new ae(e).fetchXML()},ae.prototype.fetchJsonp=function(e){e=g(e,"callback"),uc(this.request);let t;do t=`loadJsonp${S.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return ol(this,e,t)};function ol(e,t,n){const i={};i[t]=n,e.setQueryParameters(i);const o=e.request,a=e.url;o.url=a,o.requestFunction=function(){const f=ss();return window[n]=function(c){f.resolve(c);try{delete window[n]}catch{window[n]=void 0}},ae._Implementations.loadAndExecuteScript(a,n,f),f.promise};const r=Je.request(o);if(l(r))return r.catch(function(f){return o.state!==yt.FAILED?Promise.reject(f):e.retryOnError(f).then(function(c){return c?(o.state=yt.UNISSUED,o.deferred=void 0,ol(e,t,n)):Promise.reject(f)})})}ae.fetchJsonp=function(e){return new ae(e).fetchJsonp(e.callbackParameterName)},ae.prototype._makeRequest=function(e){const t=this;uc(t.request);const n=t.request,i=t.url;n.url=i,n.requestFunction=function(){const a=e.responseType,r=hn(e.headers,t.headers),f=e.overrideMimeType,c=e.method,h=e.data,d=ss(),p=ae._Implementations.loadWithXhr(i,a,c,h,r,d,f);return l(p)&&l(p.abort)&&(n.cancelFunction=function(){p.abort()}),d.promise};const o=Je.request(n);if(l(o))return o.then(function(a){return n.cancelFunction=void 0,a}).catch(function(a){return n.cancelFunction=void 0,n.state!==yt.FAILED?Promise.reject(a):t.retryOnError(a).then(function(r){return r?(n.state=yt.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(a)})})};function uc(e){if(e.state===yt.ISSUED||e.state===yt.ACTIVE)throw new dt("The Resource is already being fetched.");e.state=yt.UNISSUED,e.deferred=void 0}const m1=/^data:(.*?)(;base64)?,(.*)$/;function zr(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function sl(e,t){const n=zr(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let a=0;a<n.length;a++)o[a]=n.charCodeAt(a);return i}function _1(e,t){t=g(t,"");const n=e[1],i=!!e[2],o=e[3];let a,r;switch(t){case"":case"text":return zr(i,o);case"arraybuffer":return sl(i,o);case"blob":return a=sl(i,o),new Blob([a],{type:n});case"document":return r=new DOMParser,r.parseFromString(zr(i,o),n);case"json":return JSON.parse(zr(i,o));default:throw new C(`Unhandled responseType: ${t}`)}}ae.prototype.fetch=function(e){return e=Zn(e,{}),e.method="GET",this._makeRequest(e)},ae.fetch=function(e){return new ae(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ae.prototype.delete=function(e){return e=Zn(e,{}),e.method="DELETE",this._makeRequest(e)},ae.delete=function(e){return new ae(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},ae.prototype.head=function(e){return e=Zn(e,{}),e.method="HEAD",this._makeRequest(e)},ae.head=function(e){return new ae(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ae.prototype.options=function(e){return e=Zn(e,{}),e.method="OPTIONS",this._makeRequest(e)},ae.options=function(e){return new ae(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ae.prototype.post=function(e,t){return _.defined("data",e),t=Zn(t,{}),t.method="POST",t.data=e,this._makeRequest(t)},ae.post=function(e){return new ae(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ae.prototype.put=function(e,t){return _.defined("data",e),t=Zn(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)},ae.put=function(e){return new ae(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ae.prototype.patch=function(e,t){return _.defined("data",e),t=Zn(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)},ae.patch=function(e){return new ae(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ae._Implementations={},ae._Implementations.loadImageElement=function(e,t,n){const i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(Do.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e},ae._Implementations.createImage=function(e,t,n,i,o,a){const r=e.url;ae.supportsImageBitmapOptions().then(function(f){if(!(f&&a)){ae._Implementations.loadImageElement(r,t,n);return}const c="blob",h="GET",d=ss(),p=ae._Implementations.loadWithXhr(r,c,h,void 0,void 0,d,void 0,void 0,void 0);return l(p)&&l(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise.then(function(m){if(!l(m)){n.reject(new dt(`Successfully retrieved ${r} but it contained no content.`));return}return ae.createImageBitmapFromBlob(m,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(m){n.resolve(m)})}).catch(function(f){n.reject(f)})},ae.createImageBitmapFromBlob=function(e,t){return _.defined("options",t),_.typeOf.bool("options.flipY",t.flipY),_.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),_.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function g1(e,t,n,i,o,a,r){fetch(e,{method:n,headers:o}).then(async f=>{if(!f.ok){const c={};f.headers.forEach((h,d)=>{c[d]=h}),a.reject(new as(f.status,f,c));return}switch(t){case"text":a.resolve(f.text());break;case"json":a.resolve(f.json());break;default:a.resolve(new Uint8Array(await f.arrayBuffer()).buffer);break}}).catch(()=>{a.reject(new as)})}const T1=typeof XMLHttpRequest>"u";ae._Implementations.loadWithXhr=function(e,t,n,i,o,a,r){const f=m1.exec(e);if(f!==null){a.resolve(_1(f,t));return}if(T1){g1(e,t,n,i,o,a);return}const c=new XMLHttpRequest;if(Do.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(r)&&l(c.overrideMimeType)&&c.overrideMimeType(r),l(o))for(const d in o)o.hasOwnProperty(d)&&c.setRequestHeader(d,o[d]);l(t)&&(c.responseType=t);let h=!1;return typeof e=="string"&&(h=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(h&&c.status===0)){a.reject(new as(c.status,c.response,c.getAllResponseHeaders()));return}const d=c.response,p=c.responseType;if(n==="HEAD"||n==="OPTIONS"){const T=c.getAllResponseHeaders().trim().split(/[\r\n]+/),y={};T.forEach(function(w){const A=w.split(": "),E=A.shift();y[E]=A.join(": ")}),a.resolve(y);return}if(c.status===204)a.resolve(void 0);else if(l(d)&&(!l(t)||p===t))a.resolve(d);else if(t==="json"&&typeof d=="string")try{a.resolve(JSON.parse(d))}catch(m){a.reject(m)}else(p===""||p==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?a.resolve(c.responseXML):(p===""||p==="text")&&l(c.responseText)?a.resolve(c.responseText):a.reject(new dt("Invalid XMLHttpRequest response type."))},c.onerror=function(d){a.reject(new as)},c.send(i),c},ae._Implementations.loadAndExecuteScript=function(e,t,n){return t1(e).catch(function(i){n.reject(i)})},ae._DefaultImplementations={},ae._DefaultImplementations.createImage=ae._Implementations.createImage,ae._DefaultImplementations.loadWithXhr=ae._Implementations.loadWithXhr,ae._DefaultImplementations.loadAndExecuteScript=ae._Implementations.loadAndExecuteScript,ae.DEFAULT=Object.freeze(new ae({url:typeof document>"u"?"":document.location.href.split("?")[0]}));function cs(e){e=g(e,g.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=g(e.addNewLeapSeconds,!0),l(e.data)?rl(this,e.data):rl(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}cs.fromUrl=async function(e,t){_.defined("url",e),t=g(t,g.EMPTY_OBJECT);const n=ae.createIfNeeded(e);let i;try{i=await n.fetchJson()}catch{throw new dt(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new cs({addNewLeapSeconds:t.addNewLeapSeconds,data:i})},cs.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new tc(0,0,0,0,0),t}}),cs.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new tc(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;const n=this._dates,i=this._lastIndex;let o=0,a=0;if(l(i)){const f=n[i],c=n[i+1],h=J.lessThanOrEquals(f,e),d=!l(c),p=d||J.greaterThanOrEquals(c,e);if(h&&p)return o=i,!d&&c.equals(e)&&++o,a=o+1,cl(this,n,this._samples,e,o,a,t),t}let r=is(n,e,J.compare,this._dateColumn);return r>=0?(r<n.length-1&&n[r+1].equals(e)&&++r,o=r,a=r):(a=~r,o=a-1,o<0&&(o=0)),this._lastIndex=o,cl(this,n,this._samples,e,o,a,t),t};function y1(e,t){return J.compare(e.julianDate,t)}function rl(e,t){if(!l(t.columnNames))throw new dt("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new dt("Error in loaded EOP data: The samples property is required.");const n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),a=t.columnNames.indexOf("ut1MinusUtcSeconds"),r=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),f=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||a<0||r<0||f<0||c<0)throw new dt("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const h=e._samples=t.samples,d=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=a,e._xCelestialPoleOffsetRadiansColumn=r,e._yCelestialPoleOffsetRadiansColumn=f,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let p;const m=e._addNewLeapSeconds;for(let T=0,y=h.length;T<y;T+=e._columnCount){const w=h[T+n],A=h[T+c],E=w+ht.MODIFIED_JULIAN_DATE_DIFFERENCE,b=new J(E,A,Be.TAI);if(d.push(b),m){if(A!==p&&l(p)){const D=J.leapSeconds,O=is(D,b,y1);if(O<0){const B=new Ye(b,A);D.splice(~O,0,B)}}p=A}}}function al(e,t,n,i,o){const a=n*i;o.xPoleWander=t[a+e._xPoleWanderRadiansColumn],o.yPoleWander=t[a+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[a+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[a+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[a+e._ut1MinusUtcSecondsColumn]}function hs(e,t,n){return t+e*(n-t)}function cl(e,t,n,i,o,a,r){const f=e._columnCount;if(a>t.length-1)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;const c=t[o],h=t[a];if(c.equals(h)||i.equals(c))return al(e,n,o,f,r),r;if(i.equals(h))return al(e,n,a,f,r),r;const d=J.secondsDifference(i,c)/J.secondsDifference(h,c),p=o*f,m=a*f;let T=n[p+e._ut1MinusUtcSecondsColumn],y=n[m+e._ut1MinusUtcSecondsColumn];const w=y-T;if(w>.5||w<-.5){const A=n[p+e._taiMinusUtcSecondsColumn],E=n[m+e._taiMinusUtcSecondsColumn];A!==E&&(h.equals(i)?T=y:y-=E-A)}return r.xPoleWander=hs(d,n[p+e._xPoleWanderRadiansColumn],n[m+e._xPoleWanderRadiansColumn]),r.yPoleWander=hs(d,n[p+e._yPoleWanderRadiansColumn],n[m+e._yPoleWanderRadiansColumn]),r.xPoleOffset=hs(d,n[p+e._xCelestialPoleOffsetRadiansColumn],n[m+e._xCelestialPoleOffsetRadiansColumn]),r.yPoleOffset=hs(d,n[p+e._yCelestialPoleOffsetRadiansColumn],n[m+e._yCelestialPoleOffsetRadiansColumn]),r.ut1MinusUtc=hs(d,T,y),r}function He(e,t,n){this.heading=g(e,0),this.pitch=g(t,0),this.roll=g(n,0)}He.fromQuaternion=function(e,t){if(!l(e))throw new C("quaternion is required");l(t)||(t=new He);const n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),a=1-2*(e.y*e.y+e.z*e.z),r=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(r,a),t.roll=Math.atan2(o,i),t.pitch=-S.asinClamped(n),t},He.fromDegrees=function(e,t,n,i){if(!l(e))throw new C("heading is required");if(!l(t))throw new C("pitch is required");if(!l(n))throw new C("roll is required");return l(i)||(i=new He),i.heading=e*S.RADIANS_PER_DEGREE,i.pitch=t*S.RADIANS_PER_DEGREE,i.roll=n*S.RADIANS_PER_DEGREE,i},He.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new He(e.heading,e.pitch,e.roll)},He.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},He.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&S.equalsEpsilon(e.heading,t.heading,n,i)&&S.equalsEpsilon(e.pitch,t.pitch,n,i)&&S.equalsEpsilon(e.roll,t.roll,n,i)},He.prototype.clone=function(e){return He.clone(this,e)},He.prototype.equals=function(e){return He.equals(this,e)},He.prototype.equalsEpsilon=function(e,t,n){return He.equalsEpsilon(this,e,t,n)},He.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const hl=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function C1(){const e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){const i=e[t].getAttribute("src"),o=hl.exec(i);if(o!==null)return o[1]}}let Lr;function fl(e){return typeof document>"u"?e:(l(Lr)||(Lr=document.createElement("a")),Lr.href=e,Lr.href)}let to;function ll(){if(l(to))return to;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:zt&&zt.tagName.toUpperCase()==="SCRIPT"&&zt.src||new URL("OW_EEngine_Power.umd.cjs",document.baseURI).href)?e=rs(".",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:zt&&zt.tagName.toUpperCase()==="SCRIPT"&&zt.src||new URL("OW_EEngine_Power.umd.cjs",document.baseURI).href):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=rs("..",_n("Core/buildModuleUrl.js")):e=C1(),!l(e))throw new C("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return to=new ae({url:fl(e)}),to.appendForwardSlash(),to}function w1(e){return fl(require.toUrl(`../${e}`))}function ul(e){return ll().getDerivedResource({url:e}).url}let Nr;function _n(e){return l(Nr)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?Nr=w1:Nr=ul),Nr(e)}_n._cesiumScriptRegex=hl,_n._buildModuleUrlFromBaseUrl=ul,_n._clearBaseResource=function(){to=void 0},_n.setBaseUrl=function(e){to=ae.DEFAULT.getDerivedResource({url:e})},_n.getCesiumBaseUrl=ll;function dl(e,t,n){this.x=e,this.y=t,this.s=n}function dc(e){e=g(e,g.EMPTY_OBJECT),this._xysFileUrlTemplate=ae.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=g(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=g(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new J(this._sampleZeroJulianEphemerisDate,0,Be.TAI),this._stepSizeDays=g(e.stepSizeDays,1),this._samplesPerXysFile=g(e.samplesPerXysFile,1e3),this._totalSamples=g(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];const t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let a=0;a<=t;++a){n[a]=o,i[a]=a*this._stepSizeDays;for(let r=0;r<=t;++r)r!==a&&(n[a]*=a-r);n[a]=1/n[a]}this._work=new Array(t+1),this._coef=new Array(t+1)}const A1=new J(0,0,Be.TAI);function pc(e,t,n){const i=A1;return i.dayNumber=t,i.secondsOfDay=n,J.daysDifference(i,e._sampleZeroDateTT)}dc.prototype.preload=function(e,t,n,i){const o=pc(this,e,t),a=pc(this,n,i);let r=o/this._stepSizeDays-this._interpolationOrder/2|0;r<0&&(r=0);let f=a/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;f>=this._totalSamples&&(f=this._totalSamples-1);const c=r/this._samplesPerXysFile|0,h=f/this._samplesPerXysFile|0,d=[];for(let p=c;p<=h;++p)d.push(mc(this,p));return Promise.all(d)},dc.prototype.computeXysRadians=function(e,t,n){const i=pc(this,e,t);if(i<0)return;const o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;const a=this._interpolationOrder;let r=o-(a/2|0);r<0&&(r=0);let f=r+a;f>=this._totalSamples&&(f=this._totalSamples-1,r=f-a,r<0&&(r=0));let c=!1;const h=this._samples;if(l(h[r*3])||(mc(this,r/this._samplesPerXysFile|0),c=!0),l(h[f*3])||(mc(this,f/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new dl(0,0,0);const d=i-r*this._stepSizeDays,p=this._work,m=this._denominators,T=this._coef,y=this._xTable;let w,A;for(w=0;w<=a;++w)p[w]=d-y[w];for(w=0;w<=a;++w){for(T[w]=1,A=0;A<=a;++A)A!==w&&(T[w]*=p[A]);T[w]*=m[w];let E=(r+w)*3;n.x+=T[w]*h[E++],n.y+=T[w]*h[E++],n.s+=T[w]*h[E]}return n};function mc(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n;const i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new ae({url:_n(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});const o=n.fetchJson().then(function(a){e._chunkDownloadsInProgress[t]=!1;const r=e._samples,f=a.samples,c=t*e._samplesPerXysFile*3;for(let h=0,d=f.length;h<d;++h)r[c+h]=f[h]});return e._chunkDownloadsInProgress[t]=o,o}function ie(e,t,n,i){this.x=g(e,0),this.y=g(t,0),this.z=g(n,0),this.w=g(i,0)}let fs=new u;ie.fromAxisAngle=function(e,t,n){_.typeOf.object("axis",e),_.typeOf.number("angle",t);const i=t/2,o=Math.sin(i);fs=u.normalize(e,fs);const a=fs.x*o,r=fs.y*o,f=fs.z*o,c=Math.cos(i);return l(n)?(n.x=a,n.y=r,n.z=f,n.w=c,n):new ie(a,r,f,c)};const E1=[1,2,0],b1=new Array(3);ie.fromRotationMatrix=function(e,t){_.typeOf.object("matrix",e);let n,i,o,a,r;const f=e[G.COLUMN0ROW0],c=e[G.COLUMN1ROW1],h=e[G.COLUMN2ROW2],d=f+c+h;if(d>0)n=Math.sqrt(d+1),r=.5*n,n=.5/n,i=(e[G.COLUMN1ROW2]-e[G.COLUMN2ROW1])*n,o=(e[G.COLUMN2ROW0]-e[G.COLUMN0ROW2])*n,a=(e[G.COLUMN0ROW1]-e[G.COLUMN1ROW0])*n;else{const p=E1;let m=0;c>f&&(m=1),h>f&&h>c&&(m=2);const T=p[m],y=p[T];n=Math.sqrt(e[G.getElementIndex(m,m)]-e[G.getElementIndex(T,T)]-e[G.getElementIndex(y,y)]+1);const w=b1;w[m]=.5*n,n=.5/n,r=(e[G.getElementIndex(y,T)]-e[G.getElementIndex(T,y)])*n,w[T]=(e[G.getElementIndex(T,m)]+e[G.getElementIndex(m,T)])*n,w[y]=(e[G.getElementIndex(y,m)]+e[G.getElementIndex(m,y)])*n,i=-w[0],o=-w[1],a=-w[2]}return l(t)?(t.x=i,t.y=o,t.z=a,t.w=r,t):new ie(i,o,a,r)};const pl=new ie;let ml=new ie,_c=new ie,_l=new ie;ie.fromHeadingPitchRoll=function(e,t){return _.typeOf.object("headingPitchRoll",e),_l=ie.fromAxisAngle(u.UNIT_X,e.roll,pl),_c=ie.fromAxisAngle(u.UNIT_Y,-e.pitch,t),t=ie.multiply(_c,_l,_c),ml=ie.fromAxisAngle(u.UNIT_Z,-e.heading,pl),ie.multiply(ml,t,t)};const Fr=new u,gc=new u,Bn=new ie,gl=new ie,Mr=new ie;ie.packedLength=4,ie.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},ie.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new ie),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},ie.packedInterpolationLength=3,ie.convertPackedArrayForInterpolation=function(e,t,n,i){ie.unpack(e,n*4,Mr),ie.conjugate(Mr,Mr);for(let o=0,a=n-t+1;o<a;o++){const r=o*3;ie.unpack(e,(t+o)*4,Bn),ie.multiply(Bn,Mr,Bn),Bn.w<0&&ie.negate(Bn,Bn),ie.computeAxis(Bn,Fr);const f=ie.computeAngle(Bn);l(i)||(i=[]),i[r]=Fr.x*f,i[r+1]=Fr.y*f,i[r+2]=Fr.z*f}},ie.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new ie),u.fromArray(e,0,gc);const a=u.magnitude(gc);return ie.unpack(t,i*4,gl),a===0?ie.clone(ie.IDENTITY,Bn):ie.fromAxisAngle(gc,a,Bn),ie.multiply(Bn,gl,o)},ie.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new ie(e.x,e.y,e.z,e.w)},ie.conjugate=function(e,t){return _.typeOf.object("quaternion",e),_.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},ie.magnitudeSquared=function(e){return _.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},ie.magnitude=function(e){return Math.sqrt(ie.magnitudeSquared(e))},ie.normalize=function(e,t){_.typeOf.object("result",t);const n=1/ie.magnitude(e),i=e.x*n,o=e.y*n,a=e.z*n,r=e.w*n;return t.x=i,t.y=o,t.z=a,t.w=r,t},ie.inverse=function(e,t){_.typeOf.object("result",t);const n=ie.magnitudeSquared(e);return t=ie.conjugate(e,t),ie.multiplyByScalar(t,1/n,t)},ie.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},ie.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},ie.negate=function(e,t){return _.typeOf.object("quaternion",e),_.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},ie.dot=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},ie.multiply=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n);const i=e.x,o=e.y,a=e.z,r=e.w,f=t.x,c=t.y,h=t.z,d=t.w,p=r*f+i*d+o*h-a*c,m=r*c-i*h+o*d+a*f,T=r*h+i*c-o*f+a*d,y=r*d-i*f-o*c-a*h;return n.x=p,n.y=m,n.z=T,n.w=y,n},ie.multiplyByScalar=function(e,t,n){return _.typeOf.object("quaternion",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},ie.divideByScalar=function(e,t,n){return _.typeOf.object("quaternion",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},ie.computeAxis=function(e,t){_.typeOf.object("quaternion",e),_.typeOf.object("result",t);const n=e.w;if(Math.abs(n-1)<S.EPSILON6||Math.abs(n+1)<S.EPSILON6)return t.x=1,t.y=t.z=0,t;const i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t},ie.computeAngle=function(e){return _.typeOf.object("quaternion",e),Math.abs(e.w-1)<S.EPSILON6?0:2*Math.acos(e.w)};let Tc=new ie;ie.lerp=function(e,t,n,i){return _.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i),Tc=ie.multiplyByScalar(t,n,Tc),i=ie.multiplyByScalar(e,1-n,i),ie.add(Tc,i,i)};let Tl=new ie,yc=new ie,Cc=new ie;ie.slerp=function(e,t,n,i){_.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i);let o=ie.dot(e,t),a=t;if(o<0&&(o=-o,a=Tl=ie.negate(t,Tl)),1-o<S.EPSILON6)return ie.lerp(e,a,n,i);const r=Math.acos(o);return yc=ie.multiplyByScalar(e,Math.sin((1-n)*r),yc),Cc=ie.multiplyByScalar(a,Math.sin(n*r),Cc),i=ie.add(yc,Cc,i),ie.multiplyByScalar(i,1/Math.sin(r),i)},ie.log=function(e,t){_.typeOf.object("quaternion",e),_.typeOf.object("result",t);const n=S.acosClamped(e.w);let i=0;return n!==0&&(i=n/Math.sin(n)),u.multiplyByScalar(e,i,t)},ie.exp=function(e,t){_.typeOf.object("cartesian",e),_.typeOf.object("result",t);const n=u.magnitude(e);let i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};const x1=new u,S1=new u,ls=new ie,Wo=new ie;ie.computeInnerQuadrangle=function(e,t,n,i){_.typeOf.object("q0",e),_.typeOf.object("q1",t),_.typeOf.object("q2",n),_.typeOf.object("result",i);const o=ie.conjugate(t,ls);ie.multiply(o,n,Wo);const a=ie.log(Wo,x1);ie.multiply(o,e,Wo);const r=ie.log(Wo,S1);return u.add(a,r,a),u.multiplyByScalar(a,.25,a),u.negate(a,a),ie.exp(a,ls),ie.multiply(t,ls,i)},ie.squad=function(e,t,n,i,o,a){_.typeOf.object("q0",e),_.typeOf.object("q1",t),_.typeOf.object("s0",n),_.typeOf.object("s1",i),_.typeOf.number("t",o),_.typeOf.object("result",a);const r=ie.slerp(e,t,o,ls),f=ie.slerp(n,i,o,Wo);return ie.slerp(r,f,2*o*(1-o),a)};const I1=new ie,yl=1.9011074535173003,Ur=Ct.supportsTypedArrays()?new Float32Array(8):[],kr=Ct.supportsTypedArrays()?new Float32Array(8):[],gi=Ct.supportsTypedArrays()?new Float32Array(8):[],Ti=Ct.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){const t=e+1,n=2*t+1;Ur[e]=1/(t*n),kr[e]=t/n}Ur[7]=yl/(8*17),kr[7]=yl*8/17,ie.fastSlerp=function(e,t,n,i){_.typeOf.object("start",e),_.typeOf.object("end",t),_.typeOf.number("t",n),_.typeOf.object("result",i);let o=ie.dot(e,t),a;o>=0?a=1:(a=-1,o=-o);const r=o-1,f=1-n,c=n*n,h=f*f;for(let T=7;T>=0;--T)gi[T]=(Ur[T]*c-kr[T])*r,Ti[T]=(Ur[T]*h-kr[T])*r;const d=a*n*(1+gi[0]*(1+gi[1]*(1+gi[2]*(1+gi[3]*(1+gi[4]*(1+gi[5]*(1+gi[6]*(1+gi[7])))))))),p=f*(1+Ti[0]*(1+Ti[1]*(1+Ti[2]*(1+Ti[3]*(1+Ti[4]*(1+Ti[5]*(1+Ti[6]*(1+Ti[7])))))))),m=ie.multiplyByScalar(e,p,I1);return ie.multiplyByScalar(t,d,i),ie.add(m,i,i)},ie.fastSquad=function(e,t,n,i,o,a){_.typeOf.object("q0",e),_.typeOf.object("q1",t),_.typeOf.object("s0",n),_.typeOf.object("s1",i),_.typeOf.number("t",o),_.typeOf.object("result",a);const r=ie.fastSlerp(e,t,o,ls),f=ie.fastSlerp(n,i,o,Wo);return ie.fastSlerp(r,f,2*o*(1-o),a)},ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},ie.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},ie.ZERO=Object.freeze(new ie(0,0,0,0)),ie.IDENTITY=Object.freeze(new ie(0,0,0,1)),ie.prototype.clone=function(e){return ie.clone(this,e)},ie.prototype.equals=function(e){return ie.equals(this,e)},ie.prototype.equalsEpsilon=function(e,t){return ie.equalsEpsilon(this,e,t)},ie.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const Ce={},wc={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Po={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Ac={},fn={east:new u,north:new u,up:new u,west:new u,south:new u,down:new u};let zi=new u,Li=new u,Ni=new u;Ce.localFrameToFixedFrameGenerator=function(e,t){if(!wc.hasOwnProperty(e)||!wc[e].hasOwnProperty(t))throw new C("firstAxis and secondAxis must be east, north, up, west, south or down.");const n=wc[e][t];let i;const o=e+t;return l(Ac[o])?i=Ac[o]:(i=function(a,r,f){if(!l(a))throw new C("origin is required.");if(isNaN(a.x)||isNaN(a.y)||isNaN(a.z))throw new C("origin has a NaN component");if(l(f)||(f=new k),u.equalsEpsilon(a,u.ZERO,S.EPSILON14))u.unpack(Po[e],0,zi),u.unpack(Po[t],0,Li),u.unpack(Po[n],0,Ni);else if(S.equalsEpsilon(a.x,0,S.EPSILON14)&&S.equalsEpsilon(a.y,0,S.EPSILON14)){const c=S.sign(a.z);u.unpack(Po[e],0,zi),e!=="east"&&e!=="west"&&u.multiplyByScalar(zi,c,zi),u.unpack(Po[t],0,Li),t!=="east"&&t!=="west"&&u.multiplyByScalar(Li,c,Li),u.unpack(Po[n],0,Ni),n!=="east"&&n!=="west"&&u.multiplyByScalar(Ni,c,Ni)}else{r=g(r,pe.default),r.geodeticSurfaceNormal(a,fn.up);const c=fn.up,h=fn.east;h.x=-a.y,h.y=a.x,h.z=0,u.normalize(h,fn.east),u.cross(c,h,fn.north),u.multiplyByScalar(fn.up,-1,fn.down),u.multiplyByScalar(fn.east,-1,fn.west),u.multiplyByScalar(fn.north,-1,fn.south),zi=fn[e],Li=fn[t],Ni=fn[n]}return f[0]=zi.x,f[1]=zi.y,f[2]=zi.z,f[3]=0,f[4]=Li.x,f[5]=Li.y,f[6]=Li.z,f[7]=0,f[8]=Ni.x,f[9]=Ni.y,f[10]=Ni.z,f[11]=0,f[12]=a.x,f[13]=a.y,f[14]=a.z,f[15]=1,f},Ac[o]=i),i},Ce.eastNorthUpToFixedFrame=Ce.localFrameToFixedFrameGenerator("east","north"),Ce.northEastDownToFixedFrame=Ce.localFrameToFixedFrameGenerator("north","east"),Ce.northUpEastToFixedFrame=Ce.localFrameToFixedFrameGenerator("north","up"),Ce.northWestUpToFixedFrame=Ce.localFrameToFixedFrameGenerator("north","west");const D1=new ie,O1=new u(1,1,1),v1=new k;Ce.headingPitchRollToFixedFrame=function(e,t,n,i,o){_.typeOf.object("HeadingPitchRoll",t),i=g(i,Ce.eastNorthUpToFixedFrame);const a=ie.fromHeadingPitchRoll(t,D1),r=k.fromTranslationQuaternionRotationScale(u.ZERO,a,O1,v1);return o=i(e,n,o),k.multiply(o,r,o)};const W1=new k,P1=new G;Ce.headingPitchRollQuaternion=function(e,t,n,i,o){_.typeOf.object("HeadingPitchRoll",t);const a=Ce.headingPitchRollToFixedFrame(e,t,n,i,W1),r=k.getMatrix3(a,P1);return ie.fromRotationMatrix(r,o)};const B1=new u(1,1,1),R1=new u,Cl=new k,z1=new k,L1=new G,N1=new ie;Ce.fixedFrameToHeadingPitchRoll=function(e,t,n,i){_.defined("transform",e),t=g(t,pe.default),n=g(n,Ce.eastNorthUpToFixedFrame),l(i)||(i=new He);const o=k.getTranslation(e,R1);if(u.equals(o,u.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let a=k.inverseTransformation(n(o,t,Cl),Cl),r=k.setScale(e,B1,z1);r=k.setTranslation(r,u.ZERO,r),a=k.multiply(a,r,a);let f=ie.fromRotationMatrix(k.getMatrix3(a,L1),N1);return f=ie.normalize(f,f),He.fromQuaternion(f,i)};const F1=6*3600+41*60+50.54841,M1=8640184812866e-6,U1=.093104,k1=-62e-7,V1=11772758384668e-32,G1=72921158553e-15,q1=S.TWO_PI/86400;let Vr=new J;Ce.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=Ce.computeIcrfToFixedMatrix(e,t);return l(n)||(n=Ce.computeTemeToPseudoFixedMatrix(e,t)),n},Ce.computeTemeToPseudoFixedMatrix=function(e,t){if(!l(e))throw new C("date is required.");Vr=J.addSeconds(e,-J.computeTaiMinusUtc(e),Vr);const n=Vr.dayNumber,i=Vr.secondsOfDay;let o;const a=n-2451545;i>=43200?o=(a+.5)/ht.DAYS_PER_JULIAN_CENTURY:o=(a-.5)/ht.DAYS_PER_JULIAN_CENTURY;const f=(F1+o*(M1+o*(U1+o*k1)))*q1%S.TWO_PI,c=G1+V1*(n-24515455e-1),h=(i+ht.SECONDS_PER_DAY*.5)%ht.SECONDS_PER_DAY,d=f+c*h,p=Math.cos(d),m=Math.sin(d);return l(t)?(t[0]=p,t[1]=-m,t[2]=0,t[3]=m,t[4]=p,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new G(p,m,0,-m,p,0,0,0,1)},Ce.iau2006XysData=new dc,Ce.earthOrientationParameters=cs.NONE;const Ec=32.184,H1=2451545;Ce.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+Ec,i=e.stop.dayNumber,o=e.stop.secondsOfDay+Ec;return Ce.iau2006XysData.preload(t,n,i,o)},Ce.computeIcrfToFixedMatrix=function(e,t){if(!l(e))throw new C("date is required.");l(t)||(t=new G);const n=Ce.computeFixedToIcrfMatrix(e,t);if(l(n))return G.transpose(n,t)};const j1=32.184,Y1=2451545,Gr=new He,X1=new G,$1=new J;Ce.computeMoonFixedToIcrfMatrix=function(e,t){if(!l(e))throw new C("date is required.");const n=J.addSeconds(e,j1,$1),i=J.totalDays(n)-Y1,o=S.toRadians(12.112)-S.toRadians(.052992)*i,a=S.toRadians(24.224)-S.toRadians(.105984)*i,r=S.toRadians(227.645)+S.toRadians(13.012)*i,f=S.toRadians(261.105)+S.toRadians(13.340716)*i,c=S.toRadians(358)+S.toRadians(.9856)*i;return Gr.pitch=S.toRadians(180)-S.toRadians(3.878)*Math.sin(o)-S.toRadians(.12)*Math.sin(a)+S.toRadians(.07)*Math.sin(r)-S.toRadians(.017)*Math.sin(f),Gr.roll=S.toRadians(66.53-90)+S.toRadians(1.543)*Math.cos(o)+S.toRadians(.24)*Math.cos(a)-S.toRadians(.028)*Math.cos(r)+S.toRadians(.007)*Math.cos(f),Gr.heading=S.toRadians(244.375-90)+S.toRadians(13.17635831)*i+S.toRadians(3.558)*Math.sin(o)+S.toRadians(.121)*Math.sin(a)-S.toRadians(.064)*Math.sin(r)+S.toRadians(.016)*Math.sin(f)+S.toRadians(.025)*Math.sin(c),G.fromHeadingPitchRoll(Gr,X1)},Ce.computeIcrfToMoonFixedMatrix=function(e,t){if(!l(e))throw new C("date is required.");l(t)||(t=new G);const n=Ce.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return G.transpose(n,t)};const Z1=new dl(0,0,0),K1=new tc(0,0,0,0,0),bc=new G,xc=new G;Ce.computeFixedToIcrfMatrix=function(e,t){if(!l(e))throw new C("date is required.");l(t)||(t=new G);const n=Ce.earthOrientationParameters.compute(e,K1);if(!l(n))return;const i=e.dayNumber,o=e.secondsOfDay+Ec,a=Ce.iau2006XysData.computeXysRadians(i,o,Z1);if(!l(a))return;const r=a.x+n.xPoleOffset,f=a.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-r*r-f*f)),h=bc;h[0]=1-c*r*r,h[3]=-c*r*f,h[6]=r,h[1]=-c*r*f,h[4]=1-c*f*f,h[7]=f,h[2]=-r,h[5]=-f,h[8]=1-c*(r*r+f*f);const d=G.fromRotationZ(-a.s,xc),p=G.multiply(h,d,bc),m=e.dayNumber,T=e.secondsOfDay-J.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=m-2451545,w=T/ht.SECONDS_PER_DAY;let A=.779057273264+w+.00273781191135448*(y+w);A=A%1*S.TWO_PI;const E=G.fromRotationZ(A,xc),b=G.multiply(p,E,bc),D=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),B=Math.sin(n.xPoleWander),L=Math.sin(n.yPoleWander);let F=i-H1+o/ht.SECONDS_PER_DAY;F/=36525;const N=-47e-6*F*S.RADIANS_PER_DEGREE/3600,U=Math.cos(N),M=Math.sin(N),j=xc;return j[0]=D*U,j[1]=D*M,j[2]=B,j[3]=-O*M+L*B*U,j[4]=O*U+L*B*M,j[5]=-L*D,j[6]=-L*M-O*B*U,j[7]=L*U-O*B*M,j[8]=O*D,G.multiply(b,j,t)};const Q1=new Z;Ce.pointToWindowCoordinates=function(e,t,n,i){return i=Ce.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i},Ce.pointToGLWindowCoordinates=function(e,t,n,i){if(!l(e))throw new C("modelViewProjectionMatrix is required.");if(!l(t))throw new C("viewportTransformation is required.");if(!l(n))throw new C("point is required.");l(i)||(i=new q);const o=Q1;return k.multiplyByVector(e,Z.fromElements(n.x,n.y,n.z,1,o),o),Z.multiplyByScalar(o,1/o.w,o),k.multiplyByVector(t,o,o),q.fromCartesian4(o,i)};const J1=new u,eg=new u,tg=new u;Ce.rotationMatrixFromPositionVelocity=function(e,t,n,i){if(!l(e))throw new C("position is required.");if(!l(t))throw new C("velocity is required.");const o=g(n,pe.default).geodeticSurfaceNormal(e,J1);let a=u.cross(t,o,eg);u.equalsEpsilon(a,u.ZERO,S.EPSILON6)&&(a=u.clone(u.UNIT_X,a));const r=u.cross(a,t,tg);return u.normalize(r,r),u.cross(t,r,a),u.negate(a,a),u.normalize(a,a),l(i)||(i=new G),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=a.x,i[4]=a.y,i[5]=a.z,i[6]=r.x,i[7]=r.y,i[8]=r.z,i};const wl=new k(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Al=new oe,Sc=new u,ng=new u,ig=new G,Ic=new k,El=new k;Ce.basisTo2D=function(e,t,n){if(!l(e))throw new C("projection is required.");if(!l(t))throw new C("matrix is required.");if(!l(n))throw new C("result is required.");const i=k.getTranslation(t,ng),o=e.ellipsoid;let a;if(u.equals(i,u.ZERO))a=u.clone(u.ZERO,Sc);else{const d=o.cartesianToCartographic(i,Al);a=e.project(d,Sc),u.fromElements(a.z,a.x,a.y,a)}const r=Ce.eastNorthUpToFixedFrame(i,o,Ic),f=k.inverseTransformation(r,El),c=k.getMatrix3(t,ig),h=k.multiplyByMatrix3(f,c,n);return k.multiply(wl,h,n),k.setTranslation(n,a,n),n},Ce.ellipsoidTo2DModelMatrix=function(e,t,n){if(!l(e))throw new C("projection is required.");if(!l(t))throw new C("center is required.");if(!l(n))throw new C("result is required.");const i=e.ellipsoid,o=Ce.eastNorthUpToFixedFrame(t,i,Ic),a=k.inverseTransformation(o,El),r=i.cartesianToCartographic(t,Al),f=e.project(r,Sc);u.fromElements(f.z,f.x,f.y,f);const c=k.fromTranslation(f,Ic);return k.multiply(wl,a,n),k.multiply(c,n,n),n};const bl={};function us(e,t){if(!l(e))throw new C("identifier is required.");l(bl[e])||(bl[e]=!0,console.warn(g(t,e)))}us.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",us.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",us.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",us.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";function og(e,t){if(!l(e)||!l(t))throw new C("identifier and message are required.");us(e,t)}function de(e,t,n,i){this.west=g(e,0),this.south=g(t,0),this.east=g(n,0),this.north=g(i,0)}Object.defineProperties(de.prototype,{width:{get:function(){return de.computeWidth(this)}},height:{get:function(){return de.computeHeight(this)}}}),de.packedLength=4,de.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},de.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new de),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n},de.computeWidth=function(e){_.typeOf.object("rectangle",e);let t=e.east;const n=e.west;return t<n&&(t+=S.TWO_PI),t-n},de.computeHeight=function(e){return _.typeOf.object("rectangle",e),e.north-e.south},de.fromDegrees=function(e,t,n,i,o){return e=S.toRadians(g(e,0)),t=S.toRadians(g(t,0)),n=S.toRadians(g(n,0)),i=S.toRadians(g(i,0)),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new de(e,t,n,i)},de.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=g(e,0),o.south=g(t,0),o.east=g(n,0),o.north=g(i,0),o):new de(e,t,n,i)},de.fromCartographicArray=function(e,t){_.defined("cartographics",e);let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let c=0,h=e.length;c<h;c++){const d=e[c];n=Math.min(n,d.longitude),i=Math.max(i,d.longitude),r=Math.min(r,d.latitude),f=Math.max(f,d.latitude);const p=d.longitude>=0?d.longitude:d.longitude+S.TWO_PI;o=Math.min(o,p),a=Math.max(a,p)}return i-n>a-o&&(n=o,i=a,i>S.PI&&(i=i-S.TWO_PI),n>S.PI&&(n=n-S.TWO_PI)),l(t)?(t.west=n,t.south=r,t.east=i,t.north=f,t):new de(n,r,i,f)},de.fromCartesianArray=function(e,t,n){_.defined("cartesians",e),t=g(t,pe.default);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,r=-Number.MAX_VALUE,f=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let h=0,d=e.length;h<d;h++){const p=t.cartesianToCartographic(e[h]);i=Math.min(i,p.longitude),o=Math.max(o,p.longitude),f=Math.min(f,p.latitude),c=Math.max(c,p.latitude);const m=p.longitude>=0?p.longitude:p.longitude+S.TWO_PI;a=Math.min(a,m),r=Math.max(r,m)}return o-i>r-a&&(i=a,o=r,o>S.PI&&(o=o-S.TWO_PI),i>S.PI&&(i=i-S.TWO_PI)),l(n)?(n.west=i,n.south=f,n.east=o,n.north=c,n):new de(i,f,o,c)};const sg=new u,rg=new u,ag=new u,cg=new u,hg=new u,Dc=new Array(5);for(let e=0;e<Dc.length;++e)Dc[e]=new u;de.fromBoundingSphere=function(e,t,n){_.typeOf.object("boundingSphere",e);const i=e.center,o=e.radius;if(l(t)||(t=pe.default),l(n)||(n=new de),u.equals(i,u.ZERO))return de.clone(de.MAX_VALUE,n),n;const a=Ce.eastNorthUpToFixedFrame(i,t,sg),r=k.multiplyByPointAsVector(a,u.UNIT_X,rg);u.normalize(r,r);const f=k.multiplyByPointAsVector(a,u.UNIT_Y,ag);u.normalize(f,f),u.multiplyByScalar(f,o,f),u.multiplyByScalar(r,o,r);const c=u.negate(f,hg),h=u.negate(r,cg),d=Dc;let p=d[0];return u.add(i,f,p),p=d[1],u.add(i,h,p),p=d[2],u.add(i,c,p),p=d[3],u.add(i,r,p),d[4]=i,de.fromCartesianArray(d,t,n)},de.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new de(e.west,e.south,e.east,e.north)},de.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n},de.prototype.clone=function(e){return de.clone(this,e)},de.prototype.equals=function(e){return de.equals(this,e)},de.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},de.prototype.equalsEpsilon=function(e,t){return de.equalsEpsilon(this,e,t)},de.validate=function(e){return og("Rectangle.validate","Rectangle.validate is a no-op and has been deprecated. It will be removed in Cesium 1.124."),de._validate(e)},de._validate=function(e){_.typeOf.object("rectangle",e);const t=e.north;_.typeOf.number.greaterThanOrEquals("north",t,-S.PI_OVER_TWO),_.typeOf.number.lessThanOrEquals("north",t,S.PI_OVER_TWO);const n=e.south;_.typeOf.number.greaterThanOrEquals("south",n,-S.PI_OVER_TWO),_.typeOf.number.lessThanOrEquals("south",n,S.PI_OVER_TWO);const i=e.west;_.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),_.typeOf.number.lessThanOrEquals("west",i,Math.PI);const o=e.east;_.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),_.typeOf.number.lessThanOrEquals("east",o,Math.PI)},de.southwest=function(e,t){return _.typeOf.object("rectangle",e),l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new oe(e.west,e.south)},de.northwest=function(e,t){return _.typeOf.object("rectangle",e),l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new oe(e.west,e.north)},de.northeast=function(e,t){return _.typeOf.object("rectangle",e),l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new oe(e.east,e.north)},de.southeast=function(e,t){return _.typeOf.object("rectangle",e),l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new oe(e.east,e.south)},de.center=function(e,t){_.typeOf.object("rectangle",e);let n=e.east;const i=e.west;n<i&&(n+=S.TWO_PI);const o=S.negativePiToPi((i+n)*.5),a=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=a,t.height=0,t):new oe(o,a)},de.intersection=function(e,t,n){_.typeOf.object("rectangle",e),_.typeOf.object("otherRectangle",t);let i=e.east,o=e.west,a=t.east,r=t.west;i<o&&a>0?i+=S.TWO_PI:a<r&&i>0&&(a+=S.TWO_PI),i<o&&r<0?r+=S.TWO_PI:a<r&&o<0&&(o+=S.TWO_PI);const f=S.negativePiToPi(Math.max(o,r)),c=S.negativePiToPi(Math.min(i,a));if((e.west<e.east||t.west<t.east)&&c<=f)return;const h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return l(n)?(n.west=f,n.south=h,n.east=c,n.north=d,n):new de(f,h,c,d)},de.simpleIntersection=function(e,t,n){_.typeOf.object("rectangle",e),_.typeOf.object("otherRectangle",t);const i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),a=Math.min(e.east,t.east),r=Math.min(e.north,t.north);if(!(o>=r||i>=a))return l(n)?(n.west=i,n.south=o,n.east=a,n.north=r,n):new de(i,o,a,r)},de.union=function(e,t,n){_.typeOf.object("rectangle",e),_.typeOf.object("otherRectangle",t),l(n)||(n=new de);let i=e.east,o=e.west,a=t.east,r=t.west;i<o&&a>0?i+=S.TWO_PI:a<r&&i>0&&(a+=S.TWO_PI),i<o&&r<0?r+=S.TWO_PI:a<r&&o<0&&(o+=S.TWO_PI);const f=S.negativePiToPi(Math.min(o,r)),c=S.negativePiToPi(Math.max(i,a));return n.west=f,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n},de.expand=function(e,t,n){return _.typeOf.object("rectangle",e),_.typeOf.object("cartographic",t),l(n)||(n=new de),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},de.contains=function(e,t){_.typeOf.object("rectangle",e),_.typeOf.object("cartographic",t);let n=t.longitude;const i=t.latitude,o=e.west;let a=e.east;return a<o&&(a+=S.TWO_PI,n<0&&(n+=S.TWO_PI)),(n>o||S.equalsEpsilon(n,o,S.EPSILON14))&&(n<a||S.equalsEpsilon(n,a,S.EPSILON14))&&i>=e.south&&i<=e.north};const fg=new oe;de.subsample=function(e,t,n,i){_.typeOf.object("rectangle",e),t=g(t,pe.default),n=g(n,0),l(i)||(i=[]);let o=0;const a=e.north,r=e.south,f=e.east,c=e.west,h=fg;h.height=n,h.longitude=c,h.latitude=a,i[o]=t.cartographicToCartesian(h,i[o]),o++,h.longitude=f,i[o]=t.cartographicToCartesian(h,i[o]),o++,h.latitude=r,i[o]=t.cartographicToCartesian(h,i[o]),o++,h.longitude=c,i[o]=t.cartographicToCartesian(h,i[o]),o++,a<0?h.latitude=a:r>0?h.latitude=r:h.latitude=0;for(let d=1;d<8;++d)h.longitude=-Math.PI+d*S.PI_OVER_TWO,de.contains(e,h)&&(i[o]=t.cartographicToCartesian(h,i[o]),o++);return h.latitude===0&&(h.longitude=c,i[o]=t.cartographicToCartesian(h,i[o]),o++,h.longitude=f,i[o]=t.cartographicToCartesian(h,i[o]),o++),i.length=o,i},de.subsection=function(e,t,n,i,o,a){if(_.typeOf.object("rectangle",e),_.typeOf.number.greaterThanOrEquals("westLerp",t,0),_.typeOf.number.lessThanOrEquals("westLerp",t,1),_.typeOf.number.greaterThanOrEquals("southLerp",n,0),_.typeOf.number.lessThanOrEquals("southLerp",n,1),_.typeOf.number.greaterThanOrEquals("eastLerp",i,0),_.typeOf.number.lessThanOrEquals("eastLerp",i,1),_.typeOf.number.greaterThanOrEquals("northLerp",o,0),_.typeOf.number.lessThanOrEquals("northLerp",o,1),_.typeOf.number.lessThanOrEquals("westLerp",t,i),_.typeOf.number.lessThanOrEquals("southLerp",n,o),l(a)||(a=new de),e.west<=e.east){const f=e.east-e.west;a.west=e.west+t*f,a.east=e.west+i*f}else{const f=S.TWO_PI+e.east-e.west;a.west=S.negativePiToPi(e.west+t*f),a.east=S.negativePiToPi(e.west+i*f)}const r=e.north-e.south;return a.south=e.south+n*r,a.north=e.south+o*r,t===1&&(a.west=e.east),i===1&&(a.east=e.east),n===1&&(a.south=e.north),o===1&&(a.north=e.north),a},de.MAX_VALUE=Object.freeze(new de(-Math.PI,-S.PI_OVER_TWO,Math.PI,S.PI_OVER_TWO));function be(e,t,n,i){this.x=g(e,0),this.y=g(t,0),this.width=g(n,0),this.height=g(i,0)}be.packedLength=4,be.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},be.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new be),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},be.fromPoints=function(e,t){if(l(t)||(t=new be),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;const n=e.length;let i=e[0].x,o=e[0].y,a=e[0].x,r=e[0].y;for(let f=1;f<n;f++){const c=e[f],h=c.x,d=c.y;i=Math.min(h,i),a=Math.max(h,a),o=Math.min(d,o),r=Math.max(d,r)}return t.x=i,t.y=o,t.width=a-i,t.height=r-o,t};const xl=new Wn,lg=new oe,ug=new oe;be.fromRectangle=function(e,t,n){if(l(n)||(n=new be),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;xl._ellipsoid=pe.default,t=g(t,xl);const i=t.project(de.southwest(e,lg)),o=t.project(de.northeast(e,ug));return q.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n},be.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new be(e.x,e.y,e.width,e.height)},be.union=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),l(n)||(n=new be);const i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),a=Math.max(e.x+e.width,t.x+t.width),r=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=a-i,n.height=r-o,n},be.expand=function(e,t,n){_.typeOf.object("rectangle",e),_.typeOf.object("point",t),n=be.clone(e,n);const i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n},be.intersect=function(e,t){_.typeOf.object("left",e),_.typeOf.object("right",t);const n=e.x,i=e.y,o=t.x,a=t.y;return n>o+t.width||n+e.width<o||i+e.height<a||i>a+t.height?xt.OUTSIDE:xt.INTERSECTING},be.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},be.prototype.clone=function(e){return be.clone(this,e)},be.prototype.intersect=function(e){return be.intersect(this,e)},be.prototype.equals=function(e){return be.equals(this,e)};const kt={POINTS:R.POINTS,LINES:R.LINES,LINE_LOOP:R.LINE_LOOP,LINE_STRIP:R.LINE_STRIP,TRIANGLES:R.TRIANGLES,TRIANGLE_STRIP:R.TRIANGLE_STRIP,TRIANGLE_FAN:R.TRIANGLE_FAN};kt.isLines=function(e){return e===kt.LINES||e===kt.LINE_LOOP||e===kt.LINE_STRIP},kt.isTriangles=function(e){return e===kt.TRIANGLES||e===kt.TRIANGLE_STRIP||e===kt.TRIANGLE_FAN},kt.validate=function(e){return e===kt.POINTS||e===kt.LINES||e===kt.LINE_LOOP||e===kt.LINE_STRIP||e===kt.TRIANGLES||e===kt.TRIANGLE_STRIP||e===kt.TRIANGLE_FAN};const Xe=Object.freeze(kt),ft={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function et(e){e=g(e,g.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=g(e.primitiveType,Xe.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=g(e.offset,0),this._instanceCount=g(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=g(e.cull,!0),this.occlude=g(e.occlude,!0),this.executeInClosestFrustum=g(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.castShadows=g(e.castShadows,!1),this.receiveShadows=g(e.receiveShadows,!1),this.pickOnly=g(e.pickOnly,!1),this.depthForTranslucentClassification=g(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Zt(e,t){return(e._flags&t)===t}function Fi(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(et.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return Zt(this,ft.CULL)},set:function(e){Zt(this,ft.CULL)!==e&&(Fi(this,ft.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Zt(this,ft.OCCLUDE)},set:function(e){Zt(this,ft.OCCLUDE)!==e&&(Fi(this,ft.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return Zt(this,ft.CAST_SHADOWS)},set:function(e){Zt(this,ft.CAST_SHADOWS)!==e&&(Fi(this,ft.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Zt(this,ft.RECEIVE_SHADOWS)},set:function(e){Zt(this,ft.RECEIVE_SHADOWS)!==e&&(Fi(this,ft.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return Zt(this,ft.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Zt(this,ft.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Fi(this,ft.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return Zt(this,ft.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Zt(this,ft.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Fi(this,ft.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return Zt(this,ft.PICK_ONLY)},set:function(e){Zt(this,ft.PICK_ONLY)!==e&&(Fi(this,ft.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Zt(this,ft.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Zt(this,ft.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Fi(this,ft.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}}),et.shallowClone=function(e,t){if(l(e))return l(t)||(t=new et),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t},et.prototype.execute=function(e,t){e.draw(this,t)};const Oe={UNSIGNED_BYTE:R.UNSIGNED_BYTE,UNSIGNED_SHORT:R.UNSIGNED_SHORT,UNSIGNED_INT:R.UNSIGNED_INT,FLOAT:R.FLOAT,HALF_FLOAT:R.HALF_FLOAT_OES,UNSIGNED_INT_24_8:R.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:R.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:R.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:R.UNSIGNED_SHORT_5_6_5};Oe.toWebGLConstant=function(e,t){switch(e){case Oe.UNSIGNED_BYTE:return R.UNSIGNED_BYTE;case Oe.UNSIGNED_SHORT:return R.UNSIGNED_SHORT;case Oe.UNSIGNED_INT:return R.UNSIGNED_INT;case Oe.FLOAT:return R.FLOAT;case Oe.HALF_FLOAT:return t.webgl2?R.HALF_FLOAT:R.HALF_FLOAT_OES;case Oe.UNSIGNED_INT_24_8:return R.UNSIGNED_INT_24_8;case Oe.UNSIGNED_SHORT_4_4_4_4:return R.UNSIGNED_SHORT_4_4_4_4;case Oe.UNSIGNED_SHORT_5_5_5_1:return R.UNSIGNED_SHORT_5_5_5_1;case Oe.UNSIGNED_SHORT_5_6_5:return Oe.UNSIGNED_SHORT_5_6_5}},Oe.isPacked=function(e){return e===Oe.UNSIGNED_INT_24_8||e===Oe.UNSIGNED_SHORT_4_4_4_4||e===Oe.UNSIGNED_SHORT_5_5_5_1||e===Oe.UNSIGNED_SHORT_5_6_5},Oe.sizeInBytes=function(e){switch(e){case Oe.UNSIGNED_BYTE:return 1;case Oe.UNSIGNED_SHORT:case Oe.UNSIGNED_SHORT_4_4_4_4:case Oe.UNSIGNED_SHORT_5_5_5_1:case Oe.UNSIGNED_SHORT_5_6_5:case Oe.HALF_FLOAT:return 2;case Oe.UNSIGNED_INT:case Oe.FLOAT:case Oe.UNSIGNED_INT_24_8:return 4}},Oe.validate=function(e){return e===Oe.UNSIGNED_BYTE||e===Oe.UNSIGNED_SHORT||e===Oe.UNSIGNED_INT||e===Oe.FLOAT||e===Oe.HALF_FLOAT||e===Oe.UNSIGNED_INT_24_8||e===Oe.UNSIGNED_SHORT_4_4_4_4||e===Oe.UNSIGNED_SHORT_5_5_5_1||e===Oe.UNSIGNED_SHORT_5_6_5},Oe.getTypedArrayConstructor=function(e){const t=Oe.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Oe.FLOAT?Float32Array:Uint32Array};const Te=Object.freeze(Oe),re={DEPTH_COMPONENT:R.DEPTH_COMPONENT,DEPTH_STENCIL:R.DEPTH_STENCIL,ALPHA:R.ALPHA,RED:R.RED,RG:R.RG,RGB:R.RGB,RGBA:R.RGBA,LUMINANCE:R.LUMINANCE,LUMINANCE_ALPHA:R.LUMINANCE_ALPHA,RGB_DXT1:R.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:R.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:R.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:R.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:R.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:R.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:R.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:R.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:R.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:R.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:R.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:R.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:R.COMPRESSED_RGBA_BPTC_UNORM};re.componentsLength=function(e){switch(e){case re.RGB:return 3;case re.RGBA:return 4;case re.LUMINANCE_ALPHA:case re.RG:return 2;case re.ALPHA:case re.RED:case re.LUMINANCE:return 1;default:return 1}},re.validate=function(e){return e===re.DEPTH_COMPONENT||e===re.DEPTH_STENCIL||e===re.ALPHA||e===re.RED||e===re.RG||e===re.RGB||e===re.RGBA||e===re.LUMINANCE||e===re.LUMINANCE_ALPHA||e===re.RGB_DXT1||e===re.RGBA_DXT1||e===re.RGBA_DXT3||e===re.RGBA_DXT5||e===re.RGB_PVRTC_4BPPV1||e===re.RGB_PVRTC_2BPPV1||e===re.RGBA_PVRTC_4BPPV1||e===re.RGBA_PVRTC_2BPPV1||e===re.RGBA_ASTC||e===re.RGB_ETC1||e===re.RGB8_ETC2||e===re.RGBA8_ETC2_EAC||e===re.RGBA_BC7},re.isColorFormat=function(e){return e===re.RED||e===re.ALPHA||e===re.RGB||e===re.RGBA||e===re.LUMINANCE||e===re.LUMINANCE_ALPHA},re.isDepthFormat=function(e){return e===re.DEPTH_COMPONENT||e===re.DEPTH_STENCIL},re.isCompressedFormat=function(e){return e===re.RGB_DXT1||e===re.RGBA_DXT1||e===re.RGBA_DXT3||e===re.RGBA_DXT5||e===re.RGB_PVRTC_4BPPV1||e===re.RGB_PVRTC_2BPPV1||e===re.RGBA_PVRTC_4BPPV1||e===re.RGBA_PVRTC_2BPPV1||e===re.RGBA_ASTC||e===re.RGB_ETC1||e===re.RGB8_ETC2||e===re.RGBA8_ETC2_EAC||e===re.RGBA_BC7},re.isDXTFormat=function(e){return e===re.RGB_DXT1||e===re.RGBA_DXT1||e===re.RGBA_DXT3||e===re.RGBA_DXT5},re.isPVRTCFormat=function(e){return e===re.RGB_PVRTC_4BPPV1||e===re.RGB_PVRTC_2BPPV1||e===re.RGBA_PVRTC_4BPPV1||e===re.RGBA_PVRTC_2BPPV1},re.isASTCFormat=function(e){return e===re.RGBA_ASTC},re.isETC1Format=function(e){return e===re.RGB_ETC1},re.isETC2Format=function(e){return e===re.RGB8_ETC2||e===re.RGBA8_ETC2_EAC},re.isBC7Format=function(e){return e===re.RGBA_BC7},re.compressedTextureSizeInBytes=function(e,t,n){switch(e){case re.RGB_DXT1:case re.RGBA_DXT1:case re.RGB_ETC1:case re.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case re.RGBA_DXT3:case re.RGBA_DXT5:case re.RGBA_ASTC:case re.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case re.RGB_PVRTC_4BPPV1:case re.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case re.RGB_PVRTC_2BPPV1:case re.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case re.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}},re.textureSizeInBytes=function(e,t,n,i){let o=re.componentsLength(e);return Te.isPacked(t)&&(o=1),o*Te.sizeInBytes(t)*n*i},re.alignmentInBytes=function(e,t,n){const i=re.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1},re.createTypedArray=function(e,t,n,i){const o=Te.getTypedArrayConstructor(t),a=re.componentsLength(e)*n*i;return new o(a)},re.flipY=function(e,t,n,i,o){if(o===1)return e;const a=re.createTypedArray(t,n,i,o),r=re.componentsLength(t),f=i*r;for(let c=0;c<o;++c){const h=c*i*r,d=(o-c-1)*i*r;for(let p=0;p<f;++p)a[d+p]=e[h+p]}return a},re.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===re.DEPTH_STENCIL)return R.DEPTH24_STENCIL8;if(e===re.DEPTH_COMPONENT){if(t===Te.UNSIGNED_SHORT)return R.DEPTH_COMPONENT16;if(t===Te.UNSIGNED_INT)return R.DEPTH_COMPONENT24}if(t===Te.FLOAT)switch(e){case re.RGBA:return R.RGBA32F;case re.RGB:return R.RGB32F;case re.RG:return R.RG32F;case re.RED:return R.R32F}if(t===Te.HALF_FLOAT)switch(e){case re.RGBA:return R.RGBA16F;case re.RGB:return R.RGB16F;case re.RG:return R.RG16F;case re.RED:return R.R16F}return e};const ge=Object.freeze(re),xe={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(xe,{maximumCombinedTextureImageUnits:{get:function(){return xe._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return xe._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return xe._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return xe._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return xe._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return xe._maximumTextureSize}},maximumVaryingVectors:{get:function(){return xe._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return xe._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return xe._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return xe._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return xe._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return xe._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return xe._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return xe._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return xe._maximumViewportWidth}},maximumViewportHeight:{get:function(){return xe._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return xe._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return xe._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return xe._maximumColorAttachments}},maximumSamples:{get:function(){return xe._maximumSamples}},highpFloatSupported:{get:function(){return xe._highpFloatSupported}},highpIntSupported:{get:function(){return xe._highpIntSupported}}});function Oc(e,t,n){const i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function qr(e,t,n){const i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Rn(e){e=g(e,g.EMPTY_OBJECT);const t=e.context;_.defined("options.context",t);const n=t._gl,i=xe.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=g(e.destroyAttachments,!0),l(e.colorTextures)&&l(e.colorRenderbuffers))throw new C("Cannot have both color texture and color renderbuffer attachments.");if(l(e.depthTexture)&&l(e.depthRenderbuffer))throw new C("Cannot have both a depth texture and depth renderbuffer attachment.");if(l(e.depthStencilTexture)&&l(e.depthStencilRenderbuffer))throw new C("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.");const o=l(e.depthTexture)||l(e.depthRenderbuffer),a=l(e.depthStencilTexture)||l(e.depthStencilRenderbuffer);if(o&&a)throw new C("Cannot have both a depth and depth-stencil attachment.");if(l(e.stencilRenderbuffer)&&a)throw new C("Cannot have both a stencil and depth-stencil attachment.");if(o&&l(e.stencilRenderbuffer))throw new C("Cannot have both a depth and stencil attachment.");if(this._bind(),l(e.colorTextures)){const r=e.colorTextures,f=this._colorTextures.length=this._activeColorAttachments.length=r.length;if(f>i)throw new C("The number of color attachments exceeds the number supported.");for(let c=0;c<f;++c){const h=r[c];if(!ge.isColorFormat(h.pixelFormat))throw new C("The color-texture pixel-format must be a color format.");if(h.pixelDatatype===Te.FLOAT&&!t.colorBufferFloat)throw new C("The color texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions. See Context.colorBufferFloat.");if(h.pixelDatatype===Te.HALF_FLOAT&&!t.colorBufferHalfFloat)throw new C("The color texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension. See Context.colorBufferHalfFloat.");const d=this._gl.COLOR_ATTACHMENT0+c;Oc(this,d,h),this._activeColorAttachments[c]=d,this._colorTextures[c]=h}}if(l(e.colorRenderbuffers)){const r=e.colorRenderbuffers,f=this._colorRenderbuffers.length=this._activeColorAttachments.length=r.length;if(f>i)throw new C("The number of color attachments exceeds the number supported.");for(let c=0;c<f;++c){const h=r[c],d=this._gl.COLOR_ATTACHMENT0+c;qr(this,d,h),this._activeColorAttachments[c]=d,this._colorRenderbuffers[c]=h}}if(l(e.depthTexture)){const r=e.depthTexture;if(r.pixelFormat!==ge.DEPTH_COMPONENT)throw new C("The depth-texture pixel-format must be DEPTH_COMPONENT.");Oc(this,this._gl.DEPTH_ATTACHMENT,r),this._depthTexture=r}if(l(e.depthRenderbuffer)){const r=e.depthRenderbuffer;qr(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){const r=e.stencilRenderbuffer;qr(this,this._gl.STENCIL_ATTACHMENT,r),this._stencilRenderbuffer=r}if(l(e.depthStencilTexture)){const r=e.depthStencilTexture;if(r.pixelFormat!==ge.DEPTH_STENCIL)throw new C("The depth-stencil pixel-format must be DEPTH_STENCIL.");Oc(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilTexture=r}if(l(e.depthStencilRenderbuffer)){const r=e.depthStencilRenderbuffer;qr(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind()}Object.defineProperties(Rn.prototype,{status:{get:function(){this._bind();const e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}}),Rn.prototype._bind=function(){const e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},Rn.prototype._unBind=function(){const e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},Rn.prototype.bindDraw=function(){const e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)},Rn.prototype.bindRead=function(){const e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)},Rn.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},Rn.prototype.getColorTexture=function(e){if(!l(e)||e<0||e>=this._colorTextures.length)throw new C("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorTextures[e]},Rn.prototype.getColorRenderbuffer=function(e){if(!l(e)||e<0||e>=this._colorRenderbuffers.length)throw new C("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorRenderbuffers[e]},Rn.prototype.isDestroyed=function(){return!1},Rn.prototype.destroy=function(){if(this.destroyAttachments){const e=this._colorTextures;for(let n=0;n<e.length;++n){const i=e[n];l(i)&&i.destroy()}const t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){const i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),st(this)};const Hr={CLOCKWISE:R.CW,COUNTER_CLOCKWISE:R.CCW};Hr.validate=function(e){return e===Hr.CLOCKWISE||e===Hr.COUNTER_CLOCKWISE};const Sl=Object.freeze(Hr);function Il(e){if(typeof e!="object"||e===null)return e;let t;const n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=Il(e[t]));return Object.freeze(e)}function Dl(e){return e===R.FUNC_ADD||e===R.FUNC_SUBTRACT||e===R.FUNC_REVERSE_SUBTRACT||e===R.MIN||e===R.MAX}function jr(e){return e===R.ZERO||e===R.ONE||e===R.SRC_COLOR||e===R.ONE_MINUS_SRC_COLOR||e===R.DST_COLOR||e===R.ONE_MINUS_DST_COLOR||e===R.SRC_ALPHA||e===R.ONE_MINUS_SRC_ALPHA||e===R.DST_ALPHA||e===R.ONE_MINUS_DST_ALPHA||e===R.CONSTANT_COLOR||e===R.ONE_MINUS_CONSTANT_COLOR||e===R.CONSTANT_ALPHA||e===R.ONE_MINUS_CONSTANT_ALPHA||e===R.SRC_ALPHA_SATURATE}function dg(e){return e===R.FRONT||e===R.BACK||e===R.FRONT_AND_BACK}function pg(e){return e===R.NEVER||e===R.LESS||e===R.EQUAL||e===R.LEQUAL||e===R.GREATER||e===R.NOTEQUAL||e===R.GEQUAL||e===R.ALWAYS}function Ol(e){return e===R.NEVER||e===R.LESS||e===R.EQUAL||e===R.LEQUAL||e===R.GREATER||e===R.NOTEQUAL||e===R.GEQUAL||e===R.ALWAYS}function Bo(e){return e===R.ZERO||e===R.KEEP||e===R.REPLACE||e===R.INCR||e===R.DECR||e===R.INVERT||e===R.INCR_WRAP||e===R.DECR_WRAP}function je(e){const t=g(e,g.EMPTY_OBJECT),n=g(t.cull,g.EMPTY_OBJECT),i=g(t.polygonOffset,g.EMPTY_OBJECT),o=g(t.scissorTest,g.EMPTY_OBJECT),a=g(o.rectangle,g.EMPTY_OBJECT),r=g(t.depthRange,g.EMPTY_OBJECT),f=g(t.depthTest,g.EMPTY_OBJECT),c=g(t.colorMask,g.EMPTY_OBJECT),h=g(t.blending,g.EMPTY_OBJECT),d=g(h.color,g.EMPTY_OBJECT),p=g(t.stencilTest,g.EMPTY_OBJECT),m=g(p.frontOperation,g.EMPTY_OBJECT),T=g(p.backOperation,g.EMPTY_OBJECT),y=g(t.sampleCoverage,g.EMPTY_OBJECT),w=t.viewport;if(this.frontFace=g(t.frontFace,Sl.COUNTER_CLOCKWISE),this.cull={enabled:g(n.enabled,!1),face:g(n.face,R.BACK)},this.lineWidth=g(t.lineWidth,1),this.polygonOffset={enabled:g(i.enabled,!1),factor:g(i.factor,0),units:g(i.units,0)},this.scissorTest={enabled:g(o.enabled,!1),rectangle:be.clone(a)},this.depthRange={near:g(r.near,0),far:g(r.far,1)},this.depthTest={enabled:g(f.enabled,!1),func:g(f.func,R.LESS)},this.colorMask={red:g(c.red,!0),green:g(c.green,!0),blue:g(c.blue,!0),alpha:g(c.alpha,!0)},this.depthMask=g(t.depthMask,!0),this.stencilMask=g(t.stencilMask,-1),this.blending={enabled:g(h.enabled,!1),color:new I(g(d.red,0),g(d.green,0),g(d.blue,0),g(d.alpha,0)),equationRgb:g(h.equationRgb,R.FUNC_ADD),equationAlpha:g(h.equationAlpha,R.FUNC_ADD),functionSourceRgb:g(h.functionSourceRgb,R.ONE),functionSourceAlpha:g(h.functionSourceAlpha,R.ONE),functionDestinationRgb:g(h.functionDestinationRgb,R.ZERO),functionDestinationAlpha:g(h.functionDestinationAlpha,R.ZERO)},this.stencilTest={enabled:g(p.enabled,!1),frontFunction:g(p.frontFunction,R.ALWAYS),backFunction:g(p.backFunction,R.ALWAYS),reference:g(p.reference,0),mask:g(p.mask,-1),frontOperation:{fail:g(m.fail,R.KEEP),zFail:g(m.zFail,R.KEEP),zPass:g(m.zPass,R.KEEP)},backOperation:{fail:g(T.fail,R.KEEP),zFail:g(T.zFail,R.KEEP),zPass:g(T.zPass,R.KEEP)}},this.sampleCoverage={enabled:g(y.enabled,!1),value:g(y.value,1),invert:g(y.invert,!1)},this.viewport=l(w)?new be(w.x,w.y,w.width,w.height):void 0,this.lineWidth<xe.minimumAliasedLineWidth||this.lineWidth>xe.maximumAliasedLineWidth)throw new C("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!Sl.validate(this.frontFace))throw new C("Invalid renderState.frontFace.");if(!dg(this.cull.face))throw new C("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new C("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new C("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new C("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new C("renderState.depthRange.far must be less than or equal to one.");if(!pg(this.depthTest.func))throw new C("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new C("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!Dl(this.blending.equationRgb))throw new C("Invalid renderState.blending.equationRgb.");if(!Dl(this.blending.equationAlpha))throw new C("Invalid renderState.blending.equationAlpha.");if(!jr(this.blending.functionSourceRgb))throw new C("Invalid renderState.blending.functionSourceRgb.");if(!jr(this.blending.functionSourceAlpha))throw new C("Invalid renderState.blending.functionSourceAlpha.");if(!jr(this.blending.functionDestinationRgb))throw new C("Invalid renderState.blending.functionDestinationRgb.");if(!jr(this.blending.functionDestinationAlpha))throw new C("Invalid renderState.blending.functionDestinationAlpha.");if(!Ol(this.stencilTest.frontFunction))throw new C("Invalid renderState.stencilTest.frontFunction.");if(!Ol(this.stencilTest.backFunction))throw new C("Invalid renderState.stencilTest.backFunction.");if(!Bo(this.stencilTest.frontOperation.fail))throw new C("Invalid renderState.stencilTest.frontOperation.fail.");if(!Bo(this.stencilTest.frontOperation.zFail))throw new C("Invalid renderState.stencilTest.frontOperation.zFail.");if(!Bo(this.stencilTest.frontOperation.zPass))throw new C("Invalid renderState.stencilTest.frontOperation.zPass.");if(!Bo(this.stencilTest.backOperation.fail))throw new C("Invalid renderState.stencilTest.backOperation.fail.");if(!Bo(this.stencilTest.backOperation.zFail))throw new C("Invalid renderState.stencilTest.backOperation.zFail.");if(!Bo(this.stencilTest.backOperation.zPass))throw new C("Invalid renderState.stencilTest.backOperation.zPass.");if(l(this.viewport)){if(this.viewport.width<0)throw new C("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new C("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>xe.maximumViewportWidth)throw new C(`renderState.viewport.width must be less than or equal to the maximum viewport width (${xe.maximumViewportWidth.toString()}). Check maximumViewportWidth.`);if(this.viewport.height>xe.maximumViewportHeight)throw new C(`renderState.viewport.height must be less than or equal to the maximum viewport height (${xe.maximumViewportHeight.toString()}). Check maximumViewportHeight.`)}this.id=0,this._applyFunctions=[]}let mg=0,Kn={};je.fromCache=function(e){const t=JSON.stringify(e);let n=Kn[t];if(l(n))return++n.referenceCount,n.state;let i=new je(e);const o=JSON.stringify(i);return n=Kn[o],l(n)||(i.id=mg++,i=Il(i),n={referenceCount:0,state:i},Kn[o]=n),++n.referenceCount,Kn[t]={referenceCount:1,state:n.state},n.state},je.removeFromCache=function(e){const t=new je(e),n=JSON.stringify(t),i=Kn[n],o=JSON.stringify(e),a=Kn[o];l(a)&&(--a.referenceCount,a.referenceCount===0&&(delete Kn[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Kn[n]},je.getCache=function(){return Kn},je.clearCache=function(){Kn={}};function no(e,t,n){n?e.enable(t):e.disable(t)}function vl(e,t){e.frontFace(t.frontFace)}function Wl(e,t){const n=t.cull,i=n.enabled;no(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function Pl(e,t){e.lineWidth(t.lineWidth)}function Bl(e,t){const n=t.polygonOffset,i=n.enabled;no(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function Rl(e,t,n){const i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(no(e,e.SCISSOR_TEST,o),o){const a=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function zl(e,t){const n=t.depthRange;e.depthRange(n.near,n.far)}function Ll(e,t){const n=t.depthTest,i=n.enabled;no(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function Nl(e,t){const n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Fl(e,t){e.depthMask(t.depthMask)}function Ml(e,t){e.stencilMask(t.stencilMask)}function _g(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Ul(e,t,n){const i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;no(e,e.BLEND,o),o&&(_g(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function kl(e,t){const n=t.stencilTest,i=n.enabled;if(no(e,e.STENCIL_TEST,i),i){const o=n.frontFunction,a=n.backFunction,r=n.reference,f=n.mask;e.stencilFunc(o,r,f),e.stencilFuncSeparate(e.BACK,a,r,f),e.stencilFuncSeparate(e.FRONT,o,r,f);const c=n.frontOperation,h=c.fail,d=c.zFail,p=c.zPass;e.stencilOpSeparate(e.FRONT,h,d,p);const m=n.backOperation,T=m.fail,y=m.zFail,w=m.zPass;e.stencilOpSeparate(e.BACK,T,y,w)}}function Vl(e,t){const n=t.sampleCoverage,i=n.enabled;no(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}const gg=new be;function Gl(e,t,n){let i=g(t.viewport,n.viewport);l(i)||(i=gg,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}je.apply=function(e,t,n){vl(e,t),Wl(e,t),Pl(e,t),Bl(e,t),zl(e,t),Ll(e,t),Nl(e,t),Fl(e,t),Ml(e,t),kl(e,t),Vl(e,t),Rl(e,t,n),Ul(e,t,n),Gl(e,t,n)};function Tg(e,t){const n=[];return e.frontFace!==t.frontFace&&n.push(vl),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(Wl),e.lineWidth!==t.lineWidth&&n.push(Pl),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Bl),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(zl),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(Ll),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(Nl),e.depthMask!==t.depthMask&&n.push(Fl),e.stencilMask!==t.stencilMask&&n.push(Ml),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(kl),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Vl),n}je.partialApply=function(e,t,n,i,o,a){if(t!==n){let d=n._applyFunctions[t.id];l(d)||(d=Tg(t,n),n._applyFunctions[t.id]=d);const p=d.length;for(let m=0;m<p;++m)d[m](e,n)}const r=l(i.scissorTest)?i.scissorTest:t.scissorTest,f=l(o.scissorTest)?o.scissorTest:n.scissorTest;(r!==f||a)&&Rl(e,n,o);const c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,h=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==h||h&&t.blending!==n.blending)&&Ul(e,n,o),(t!==n||i!==o||i.context!==o.context)&&Gl(e,n,o)},je.getState=function(e){if(!l(e))throw new C("renderState is required.");return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:be.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:I.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?be.clone(e.viewport):void 0}};function ue(e,t,n,i){this[0]=g(e,0),this[1]=g(n,0),this[2]=g(t,0),this[3]=g(i,0)}ue.packedLength=4,ue.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t},ue.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new ue),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n},ue.packArray=function(e,t){_.defined("array",e);const n=e.length,i=n*4;if(!l(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)ue.pack(e[o],t,o*4);return t},ue.unpackArray=function(e,t){if(_.defined("array",e),_.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new C("array length must be a multiple of 4.");const n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){const o=i/4;t[o]=ue.unpack(e,i,t[o])}return t},ue.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new ue(e[0],e[2],e[1],e[3])},ue.fromArray=ue.unpack,ue.fromColumnMajorArray=function(e,t){return _.defined("values",e),ue.clone(e,t)},ue.fromRowMajorArray=function(e,t){return _.defined("values",e),l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new ue(e[0],e[1],e[2],e[3])},ue.fromScale=function(e,t){return _.typeOf.object("scale",e),l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new ue(e.x,0,0,e.y)},ue.fromUniformScale=function(e,t){return _.typeOf.number("scale",e),l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new ue(e,0,0,e)},ue.fromRotation=function(e,t){_.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new ue(n,-i,i,n)},ue.toArray=function(e,t){return _.typeOf.object("matrix",e),l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},ue.getElementIndex=function(e,t){return _.typeOf.number.greaterThanOrEquals("row",t,0),_.typeOf.number.lessThanOrEquals("row",t,1),_.typeOf.number.greaterThanOrEquals("column",e,0),_.typeOf.number.lessThanOrEquals("column",e,1),e*2+t},ue.getColumn=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,1),_.typeOf.object("result",n);const i=t*2,o=e[i],a=e[i+1];return n.x=o,n.y=a,n},ue.setColumn=function(e,t,n,i){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,1),_.typeOf.object("cartesian",n),_.typeOf.object("result",i),i=ue.clone(e,i);const o=t*2;return i[o]=n.x,i[o+1]=n.y,i},ue.getRow=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,1),_.typeOf.object("result",n);const i=e[t],o=e[t+2];return n.x=i,n.y=o,n},ue.setRow=function(e,t,n,i){return _.typeOf.object("matrix",e),_.typeOf.number.greaterThanOrEquals("index",t,0),_.typeOf.number.lessThanOrEquals("index",t,1),_.typeOf.object("cartesian",n),_.typeOf.object("result",i),i=ue.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};const yg=new q;ue.setScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("scale",t),_.typeOf.object("result",n);const i=ue.getScale(e,yg),o=t.x/i.x,a=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*a,n[3]=e[3]*a,n};const Cg=new q;ue.setUniformScale=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.number("scale",t),_.typeOf.object("result",n);const i=ue.getScale(e,Cg),o=t/i.x,a=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*a,n[3]=e[3]*a,n};const ql=new q;ue.getScale=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t.x=q.magnitude(q.fromElements(e[0],e[1],ql)),t.y=q.magnitude(q.fromElements(e[2],e[3],ql)),t};const Hl=new q;ue.getMaximumScale=function(e){return ue.getScale(e,Hl),q.maximumComponent(Hl)};const wg=new q;ue.setRotation=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("result",n);const i=ue.getScale(e,wg);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};const Ag=new q;ue.getRotation=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=ue.getScale(e,Ag);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t},ue.multiply=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n);const i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],a=e[1]*t[0]+e[3]*t[1],r=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=a,n[2]=o,n[3]=r,n},ue.add=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},ue.subtract=function(e,t,n){return _.typeOf.object("left",e),_.typeOf.object("right",t),_.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},ue.multiplyByVector=function(e,t,n){_.typeOf.object("matrix",e),_.typeOf.object("cartesian",t),_.typeOf.object("result",n);const i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n},ue.multiplyByScalar=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.number("scalar",t),_.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},ue.multiplyByScale=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.object("scale",t),_.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n},ue.multiplyByUniformScale=function(e,t,n){return _.typeOf.object("matrix",e),_.typeOf.number("scale",t),_.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},ue.negate=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},ue.transpose=function(e,t){_.typeOf.object("matrix",e),_.typeOf.object("result",t);const n=e[0],i=e[2],o=e[1],a=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t},ue.abs=function(e,t){return _.typeOf.object("matrix",e),_.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t},ue.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},ue.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},ue.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n},ue.IDENTITY=Object.freeze(new ue(1,0,0,1)),ue.ZERO=Object.freeze(new ue(0,0,0,0)),ue.COLUMN0ROW0=0,ue.COLUMN0ROW1=1,ue.COLUMN1ROW0=2,ue.COLUMN1ROW1=3,Object.defineProperties(ue.prototype,{length:{get:function(){return ue.packedLength}}}),ue.prototype.clone=function(e){return ue.clone(this,e)},ue.prototype.equals=function(e){return ue.equals(this,e)},ue.prototype.equalsEpsilon=function(e,t){return ue.equalsEpsilon(this,e,t)},ue.prototype.toString=function(){return`(${this[0]}, ${this[2]})
45
+ (${this[1]}, ${this[3]})`};function Eg(e,t,n,i){switch(t.type){case e.FLOAT:return new jl(e,t,n,i);case e.FLOAT_VEC2:return new Yl(e,t,n,i);case e.FLOAT_VEC3:return new Xl(e,t,n,i);case e.FLOAT_VEC4:return new $l(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new vc(e,t,n,i);case e.INT:case e.BOOL:return new Zl(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Kl(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Ql(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Jl(e,t,n,i);case e.FLOAT_MAT2:return new eu(e,t,n,i);case e.FLOAT_MAT3:return new tu(e,t,n,i);case e.FLOAT_MAT4:return new nu(e,t,n,i);default:throw new dt(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function jl(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}jl.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Yl(e,t,n,i){this.name=n,this.value=void 0,this._value=new q,this._gl=e,this._location=i}Yl.prototype.set=function(){const e=this.value;q.equals(e,this._value)||(q.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function Xl(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Xl.prototype.set=function(){const e=this.value;if(l(e.red))I.equals(e,this._value)||(this._value=I.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue));else if(l(e.x))u.equals(e,this._value)||(this._value=u.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z));else throw new C(`Invalid vec3 value for uniform "${this.name}".`)};function $l(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}$l.prototype.set=function(){const e=this.value;if(l(e.red))I.equals(e,this._value)||(this._value=I.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha));else if(l(e.x))Z.equals(e,this._value)||(this._value=Z.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w));else throw new C(`Invalid vec4 value for uniform "${this.name}".`)};function vc(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}vc.prototype.set=function(){const e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);const t=this.value;e.bindTexture(t._target,t._texture)},vc.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function Zl(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Zl.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function Kl(e,t,n,i){this.name=n,this.value=void 0,this._value=new q,this._gl=e,this._location=i}Kl.prototype.set=function(){const e=this.value;q.equals(e,this._value)||(q.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function Ql(e,t,n,i){this.name=n,this.value=void 0,this._value=new u,this._gl=e,this._location=i}Ql.prototype.set=function(){const e=this.value;u.equals(e,this._value)||(u.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function Jl(e,t,n,i){this.name=n,this.value=void 0,this._value=new Z,this._gl=e,this._location=i}Jl.prototype.set=function(){const e=this.value;Z.equals(e,this._value)||(Z.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};const bg=new Float32Array(4);function eu(e,t,n,i){this.name=n,this.value=void 0,this._value=new ue,this._gl=e,this._location=i}eu.prototype.set=function(){if(!ue.equalsArray(this.value,this._value,0)){ue.clone(this.value,this._value);const e=ue.toArray(this.value,bg);this._gl.uniformMatrix2fv(this._location,!1,e)}};const xg=new Float32Array(9);function tu(e,t,n,i){this.name=n,this.value=void 0,this._value=new G,this._gl=e,this._location=i}tu.prototype.set=function(){if(!G.equalsArray(this.value,this._value,0)){G.clone(this.value,this._value);const e=G.toArray(this.value,xg);this._gl.uniformMatrix3fv(this._location,!1,e)}};const Sg=new Float32Array(16);function nu(e,t,n,i){this.name=n,this.value=void 0,this._value=new k,this._gl=e,this._location=i}nu.prototype.set=function(){if(!k.equalsArray(this.value,this._value,0)){k.clone(this.value,this._value);const e=k.toArray(this.value,Sg);this._gl.uniformMatrix4fv(this._location,!1,e)}};function Ig(e,t,n,i){switch(t.type){case e.FLOAT:return new iu(e,t,n,i);case e.FLOAT_VEC2:return new ou(e,t,n,i);case e.FLOAT_VEC3:return new su(e,t,n,i);case e.FLOAT_VEC4:return new ru(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new Wc(e,t,n,i);case e.INT:case e.BOOL:return new au(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new cu(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new hu(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new fu(e,t,n,i);case e.FLOAT_MAT2:return new lu(e,t,n,i);case e.FLOAT_MAT3:return new uu(e,t,n,i);case e.FLOAT_MAT4:return new du(e,t,n,i);default:throw new dt(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function iu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}iu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1;for(let o=0;o<t;++o){const a=e[o];a!==n[o]&&(n[o]=a,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function ou(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}ou.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];q.equalsArray(r,n,o)||(q.pack(r,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function su(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}su.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];if(l(r.red))(r.red!==n[o]||r.green!==n[o+1]||r.blue!==n[o+2])&&(n[o]=r.red,n[o+1]=r.green,n[o+2]=r.blue,i=!0);else if(l(r.x))u.equalsArray(r,n,o)||(u.pack(r,n,o),i=!0);else throw new C("Invalid vec3 value.");o+=3}i&&this._gl.uniform3fv(this._location,n)};function ru(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}ru.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];if(l(r.red))I.equalsArray(r,n,o)||(I.pack(r,n,o),i=!0);else if(l(r.x))Z.equalsArray(r,n,o)||(Z.pack(r,n,o),i=!0);else throw new C("Invalid vec4 value.");o+=4}i&&this._gl.uniform4fv(this._location,n)};function Wc(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}Wc.prototype.set=function(){const e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){const a=n[o];e.activeTexture(t+o),e.bindTexture(a._target,a._texture)}},Wc.prototype._setSampler=function(e){this.textureUnitIndex=e;const t=this._locations,n=t.length;for(let i=0;i<n;++i){const o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function au(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}au.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1;for(let o=0;o<t;++o){const a=e[o];a!==n[o]&&(n[o]=a,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function cu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}cu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];q.equalsArray(r,n,o)||(q.pack(r,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function hu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}hu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];u.equalsArray(r,n,o)||(u.pack(r,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function fu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}fu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];Z.equalsArray(r,n,o)||(Z.pack(r,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function lu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}lu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];ue.equalsArray(r,n,o)||(ue.pack(r,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function uu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}uu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];G.equalsArray(r,n,o)||(G.pack(r,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function du(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}du.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let a=0;a<t;++a){const r=e[a];k.equalsArray(r,n,o)||(k.pack(r,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};let Dg=0;function lt(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));const i=Og(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=Dg++}lt.fromCache=function(e){return e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context),e.context.shaderCache.getShaderProgram(e)},lt.replaceCache=function(e){return e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context),e.context.shaderCache.replaceShaderProgram(e)},Object.defineProperties(lt.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return Yr(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return Yr(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return Yr(this),this._uniformsByName}}});function pu(e){const t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){const i=n.length;for(let o=0;o<i;o++){const a=n[o].trim(),r=a.slice(a.lastIndexOf(" ")+1);t.push(r)}}return t}function Og(e,t){const n={};if(!xe.highpFloatSupported||!xe.highpIntSupported){let i,o,a,r;const f=pu(e),c=pu(t),h=f.length,d=c.length;for(i=0;i<h;i++)for(o=0;o<d;o++)if(f[i]===c[o]){a=f[i],r=`czm_mediump_${a}`;const p=new RegExp(`${a}\\b`,"g");t=t.replace(p,r),n[r]=a}}return{fragmentShaderText:t,duplicateUniformNames:n}}const Qn="[Cesium WebGL] ";function vg(e,t){const n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);const a=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(a,i),e.compileShader(a);const r=e.createProgram();e.attachShader(r,o),e.attachShader(r,a);const f=t._attributeLocations;if(l(f))for(const m in f)f.hasOwnProperty(m)&&e.bindAttribLocation(r,f[m],m);e.linkProgram(r);let c;if(e.getProgramParameter(r,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Qn}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(a),l(c)&&c.length>0&&console.log(`${Qn}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(r),l(c)&&c.length>0&&console.log(`${Qn}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(a),r;let h;const d=t._debugShaders;throw e.getShaderParameter(a,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(r),console.error(`${Qn}Shader program link log: ${c}`),p(o,"vertex"),p(a,"fragment"),h=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Qn}Vertex shader compile log: ${c}`),console.error(`${Qn} Vertex shader source:
46
+ ${n}`),h=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(a),console.error(`${Qn}Fragment shader compile log: ${c}`),console.error(`${Qn} Fragment shader source:
47
+ ${i}`),h=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(a),e.deleteProgram(r),new dt(h);function p(m,T){if(!l(d))return;const y=d.getTranslatedShaderSource(m);if(y===""){console.error(`${Qn}${T} shader translation failed.`);return}console.error(`${Qn}Translated ${T} shaderSource:
48
+ ${y}`)}}function Wg(e,t,n){const i={};for(let o=0;o<n;++o){const a=e.getActiveAttrib(t,o),r=e.getAttribLocation(t,a.name);i[a.name]={name:a.name,type:a.type,index:r}}return i}function Pg(e,t){const n={},i=[],o=[],a=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<a;++r){const f=e.getActiveUniform(t,r),c="[0]",h=f.name.indexOf(c,f.name.length-c.length)!==-1?f.name.slice(0,f.name.length-3):f.name;if(h.indexOf("gl_")!==0)if(f.name.indexOf("[")<0){const d=e.getUniformLocation(t,h);if(d!==null){const p=Eg(e,f,h,d);n[h]=p,i.push(p),p._setSampler&&o.push(p)}}else{let d,p,m,T;const y=h.indexOf("[");if(y>=0){if(d=n[h.slice(0,y)],!l(d))continue;p=d._locations,p.length<=1&&(m=d.value,T=e.getUniformLocation(t,h),T!==null&&(p.push(T),m.push(e.getUniform(t,T))))}else{p=[];for(let w=0;w<f.size;++w)T=e.getUniformLocation(t,`${h}[${w}]`),T!==null&&p.push(T);d=Ig(e,f,h,p),n[h]=d,i.push(d),d._setSampler&&o.push(d)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function Bg(e,t){const n=[],i=[];for(const o in t)if(t.hasOwnProperty(o)){const a=t[o];let r=o;const f=e._duplicateUniformNames[r];l(f)&&(a.name=f,r=f);const c=gr[r];l(c)?n.push({uniform:a,automaticUniform:c}):i.push(a)}return{automaticUniforms:n,manualUniforms:i}}function Rg(e,t,n){e.useProgram(t);let i=0;const o=n.length;for(let a=0;a<o;++a)i=n[a]._setSampler(i);return e.useProgram(null),i}function Yr(e){l(e._program)||mu(e)}function mu(e){const t=e._program,n=e._gl,i=vg(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),a=Pg(n,i),r=Bg(e,a.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=Wg(n,i,o),e._uniformsByName=a.uniformsByName,e._uniforms=a.uniforms,e._automaticUniforms=r.automaticUniforms,e._manualUniforms=r.manualUniforms,e.maximumTextureUnitIndex=Rg(n,i,a.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(f,c,h,d){const p=e._vertexShaderText,m=e._fragmentShaderText,T=/ ! = /g;e._vertexShaderText=f.replace(T," != "),e._fragmentShaderText=c.replace(T," != ");try{mu(e),h(e._program)}catch(y){e._vertexShaderText=p,e._fragmentShaderText=m;const A=/(?:Compile|Link) error: ([^]*)/.exec(y.message);d(A?A[1]:y.message)}})}lt.prototype._bind=function(){Yr(this),this._gl.useProgram(this._program)},lt.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){const f=this._manualUniforms;for(i=f.length,o=0;o<i;++o){const c=f[o];if(!l(e[c.name]))throw new C(`Unknown uniform: ${c.name}`);c.value=e[c.name]()}}const a=this._automaticUniforms;for(i=a.length,o=0;o<i;++o){const f=a[o];f.uniform.value=f.automaticUniform.getValue(t)}const r=this._uniforms;for(i=r.length,o=0;o<i;++o)r[o].set();if(n){const f=this._gl,c=this._program;if(f.validateProgram(c),!f.getProgramParameter(c,f.VALIDATE_STATUS))throw new C(`Program validation failed. Program info log: ${f.getProgramInfoLog(c)}`)}},lt.prototype.isDestroyed=function(){return!1},lt.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},lt.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),st(this)};const _e={BYTE:R.BYTE,UNSIGNED_BYTE:R.UNSIGNED_BYTE,SHORT:R.SHORT,UNSIGNED_SHORT:R.UNSIGNED_SHORT,INT:R.INT,UNSIGNED_INT:R.UNSIGNED_INT,FLOAT:R.FLOAT,DOUBLE:R.DOUBLE};_e.getSizeInBytes=function(e){if(!l(e))throw new C("value is required.");switch(e){case _e.BYTE:return Int8Array.BYTES_PER_ELEMENT;case _e.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case _e.SHORT:return Int16Array.BYTES_PER_ELEMENT;case _e.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case _e.INT:return Int32Array.BYTES_PER_ELEMENT;case _e.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case _e.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case _e.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new C("componentDatatype is not a valid value.")}},_e.fromTypedArray=function(e){if(e instanceof Int8Array)return _e.BYTE;if(e instanceof Uint8Array)return _e.UNSIGNED_BYTE;if(e instanceof Int16Array)return _e.SHORT;if(e instanceof Uint16Array)return _e.UNSIGNED_SHORT;if(e instanceof Int32Array)return _e.INT;if(e instanceof Uint32Array)return _e.UNSIGNED_INT;if(e instanceof Float32Array)return _e.FLOAT;if(e instanceof Float64Array)return _e.DOUBLE;throw new C("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")},_e.validate=function(e){return l(e)&&(e===_e.BYTE||e===_e.UNSIGNED_BYTE||e===_e.SHORT||e===_e.UNSIGNED_SHORT||e===_e.INT||e===_e.UNSIGNED_INT||e===_e.FLOAT||e===_e.DOUBLE)},_e.createTypedArray=function(e,t){if(!l(e))throw new C("componentDatatype is required.");if(!l(t))throw new C("valuesOrLength is required.");switch(e){case _e.BYTE:return new Int8Array(t);case _e.UNSIGNED_BYTE:return new Uint8Array(t);case _e.SHORT:return new Int16Array(t);case _e.UNSIGNED_SHORT:return new Uint16Array(t);case _e.INT:return new Int32Array(t);case _e.UNSIGNED_INT:return new Uint32Array(t);case _e.FLOAT:return new Float32Array(t);case _e.DOUBLE:return new Float64Array(t);default:throw new C("componentDatatype is not a valid value.")}},_e.createArrayBufferView=function(e,t,n,i){if(!l(e))throw new C("componentDatatype is required.");if(!l(t))throw new C("buffer is required.");switch(n=g(n,0),i=g(i,(t.byteLength-n)/_e.getSizeInBytes(e)),e){case _e.BYTE:return new Int8Array(t,n,i);case _e.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case _e.SHORT:return new Int16Array(t,n,i);case _e.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case _e.INT:return new Int32Array(t,n,i);case _e.UNSIGNED_INT:return new Uint32Array(t,n,i);case _e.FLOAT:return new Float32Array(t,n,i);case _e.DOUBLE:return new Float64Array(t,n,i);default:throw new C("componentDatatype is not a valid value.")}},_e.fromName=function(e){switch(e){case"BYTE":return _e.BYTE;case"UNSIGNED_BYTE":return _e.UNSIGNED_BYTE;case"SHORT":return _e.SHORT;case"UNSIGNED_SHORT":return _e.UNSIGNED_SHORT;case"INT":return _e.INT;case"UNSIGNED_INT":return _e.UNSIGNED_INT;case"FLOAT":return _e.FLOAT;case"DOUBLE":return _e.DOUBLE;default:throw new C("name is not a valid value.")}};const he=Object.freeze(_e),ds=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});function mt(e){e=g(e,g.EMPTY_OBJECT),_.typeOf.object("options.attributes",e.attributes),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=g(e.primitiveType,Xe.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=g(e.geometryType,ds.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}mt.computeNumberOfVertices=function(e){_.typeOf.object("geometry",e);let t=-1;for(const n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){const i=e.attributes[n],o=i.values.length/i.componentsPerAttribute;if(t!==o&&t!==-1)throw new C("All attribute lists must have the same number of attributes.");t=o}return t};const zg=new oe,Lg=new u,_u=new k,Ng=[new oe,new oe,new oe],Fg=[new q,new q,new q],Mg=[new q,new q,new q],Ug=new u,kg=new ie,Vg=new k,Gg=new ue;mt._textureCoordinateRotationPoints=function(e,t,n,i){let o;const a=de.center(i,zg),r=oe.toCartesian(a,n,Lg),f=Ce.eastNorthUpToFixedFrame(r,n,_u),c=k.inverse(f,_u),h=Fg,d=Ng;d[0].longitude=i.west,d[0].latitude=i.south,d[1].longitude=i.west,d[1].latitude=i.north,d[2].longitude=i.east,d[2].latitude=i.south;let p=Ug;for(o=0;o<3;o++)oe.toCartesian(d[o],n,p),p=k.multiplyByPointAsVector(c,p,p),h[o].x=p.x,h[o].y=p.y;const m=ie.fromAxisAngle(u.UNIT_Z,-t,kg),T=G.fromQuaternion(m,Vg),y=e.length;let w=Number.POSITIVE_INFINITY,A=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY,b=Number.NEGATIVE_INFINITY;for(o=0;o<y;o++)p=k.multiplyByPointAsVector(c,e[o],p),p=G.multiplyByVector(T,p,p),w=Math.min(w,p.x),A=Math.min(A,p.y),E=Math.max(E,p.x),b=Math.max(b,p.y);const D=ue.fromRotation(t,Gg),O=Mg;O[0].x=w,O[0].y=A,O[1].x=w,O[1].y=b,O[2].x=E,O[2].y=A;const B=h[0],L=h[2].x-B.x,F=h[1].y-B.y;for(o=0;o<3;o++){const Y=O[o];ue.multiplyByVector(D,Y,Y),Y.x=(Y.x-B.x)/L,Y.y=(Y.y-B.y)/F}const N=O[0],U=O[1],M=O[2],j=new Array(6);return q.pack(N,j),q.pack(U,j,2),q.pack(M,j,4),j};function Ft(e){if(e=g(e,g.EMPTY_OBJECT),!l(e.componentDatatype))throw new C("options.componentDatatype is required.");if(!l(e.componentsPerAttribute))throw new C("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new C("options.componentsPerAttribute must be between 1 and 4.");if(!l(e.values))throw new C("options.values is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=g(e.normalize,!1),this.values=e.values}function Ro(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(Ro.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}}),Ro.clone=function(e){if(l(e))return new Ro(e._format,e._datatype,e._width,e._height,e._buffer)},Ro.prototype.clone=function(){return Ro.clone(this)};function gu(){if(!l(St._canTransferArrayBuffer)){const e=Rc("transferTypedArrayTest");e.postMessage=g(e.webkitPostMessage,e.postMessage);const t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return St._canTransferArrayBuffer=!1,St._canTransferArrayBuffer}St._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){const a=o.data.array,r=l(a)&&a[0]===t;i(r),e.terminate(),St._canTransferArrayBuffer=r}})}return St._canTransferArrayBuffer}const Pc=new Ne;function Bc(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{const o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new o;a.append(e),t=a.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function Rc(e){const t=new mi(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={};let a,r;if(hc(e))r=e;else if(!n){const f=_n(`${St._workerModulePrefix}/${i}.js`);hc(f)&&(r=f)}if(r){const f=`import "${r}";`;return a=Bc(f),o.type="module",new Worker(a,o)}if(!n&&typeof CESIUM_WORKERS<"u"){const f=`
49
49
  importScripts("${Bc(CESIUM_WORKERS)}");
50
50
  CesiumWorkers["${i}"]();
51
- `;return a=Bc(f),new Worker(a,o)}if(a=e,n||(a=_n(`${St._workerModulePrefix+i}.js`)),!Ct.supportsEsmWebWorkers())throw new dt("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(a,o)}async function qg(e,t){const n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Ct.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new dt(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=_n(t.fallbackModulePath),n}n.wasmBinaryFile=_n(t.wasmBinaryFile);const i=await ae.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function St(e,t){this._workerPath=e,this._maximumActiveTasks=g(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const Hg=(e,t,n,i)=>{const o=({data:a})=>{if(a.id===t){if(l(a.error)){let r=a.error;r.name==="RuntimeError"?(r=new dt(a.error.message),r.stack=a.error.stack):r.name==="DeveloperError"?(r=new C(a.error.message),r.stack=a.error.stack):r.name==="Error"&&(r=new Error(a.error.message),r.stack=a.error.stack),Pc.raiseEvent(r),i(r)}else Pc.raiseEvent(),n(a.result);e.removeEventListener("message",o)}};return o},jg=[];async function Yg(e,t,n){const i=await Promise.resolve(gu());l(n)?i||(n.length=0):n=jg;const o=e._nextID++,a=new Promise((r,f)=>{e._worker.addEventListener("message",Hg(e._worker,o,r,f))});return e._worker.postMessage({id:o,baseUrl:_n.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),a}async function Xg(e,t,n){++e._activeTasks;try{const i=await Yg(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}St.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=Rc(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return Xg(this,e,t)},St.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;const t=async()=>{const n=this._worker=Rc(this._workerPath),i=await qg(this,e),o=await Promise.resolve(gu());let a;const r=i.wasmBinary;l(r)&&o&&(a=[r]);const f=new Promise((c,h)=>{n.onmessage=function({data:d}){l(d)?c(d.result):h(new dt("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},a),f};return this._webAssemblyPromise=t(),this._webAssemblyPromise},St.prototype.isDestroyed=function(){return!1},St.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),st(this)},St.taskCompletedEvent=Pc,St._defaultWorkerModulePrefix="Workers/",St._workerModulePrefix=St._defaultWorkerModulePrefix,St._canTransferArrayBuffer=void 0;function yi(){}yi._transcodeTaskProcessor=new St("transcodeKTX2",Number.POSITIVE_INFINITY),yi._readyPromise=void 0;function $g(){const e=yi._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return yi._transcodeTaskProcessor;throw new dt("KTX2 transcoder could not be initialized.")});yi._readyPromise=e}yi.transcode=function(e,t){return _.defined("supportedTargetFormats",t),l(yi._readyPromise)||$g(),yi._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));const o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){const i=n.length,o=Object.keys(n[0]);for(let a=0;a<i;a++){const r=n[a];for(let f=0;f<o.length;f++){const c=r[o[f]];r[o[f]]=new zo(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let a=0;a<i;++a)n[a]=n[a][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};let Tu;yu.setKTX2SupportedFormats=function(e,t,n,i,o,a){Tu={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:a}};function yu(e){_.defined("resourceOrUrlOrBuffer",e);let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=ae.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return yi.transcode(n,Tu)})}function Xr(e,t,n,i,o,a,r,f,c,h,d){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=r,this._internalFormat=o,this._pixelFormat=a,this._size=f,this._preMultiplyAlpha=c,this._flipY=h,this._initialized=d}Object.defineProperties(Xr.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),Xr.prototype.copyFrom=function(e){_.defined("options",e);const{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(_.defined("options.source",i),_.typeOf.number.greaterThanOrEquals("xOffset",t,0),_.typeOf.number.greaterThanOrEquals("yOffset",n,0),t+i.width>this._size)throw new C("xOffset + options.source.width must be less than or equal to width.");if(n+i.height>this._size)throw new C("yOffset + options.source.height must be less than or equal to height.");const{width:a,height:r}=i,f=this._context._gl,c=this._textureTarget,h=this._targetFace;f.activeTexture(f.TEXTURE0),f.bindTexture(c,this._texture);let d=i.arrayBufferView;const p=this._size,m=this._pixelFormat,T=this._internalFormat,y=this._pixelDatatype,w=this._preMultiplyAlpha,A=this._flipY;let E=4;l(d)&&(E=ge.alignmentInBytes(m,y,a)),f.pixelStorei(f.UNPACK_ALIGNMENT,E),o?f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.NONE):f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.BROWSER_DEFAULT_WEBGL);let b=!1;if(!this._initialized){let I;t===0&&n===0&&a===p&&r===p?(l(d)?(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!1),A&&(d=ge.flipY(d,m,y,p,p)),I=d):(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,A),I=i),b=!0):(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!1),I=ge.createTypedArray(m,y,p,p)),f.texImage2D(h,0,T,p,p,0,m,Te.toWebGLConstant(y,this._context),I),this._initialized=!0}b||(l(d)?(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!1),A&&(d=ge.flipY(d,m,y,a,r)),f.texSubImage2D(h,0,t,n,a,r,m,Te.toWebGLConstant(y,this._context),d)):(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,A),f.texSubImage2D(h,0,t,n,m,Te.toWebGLConstant(y,this._context),i))),f.bindTexture(c,null)},Xr.prototype.copyFromFramebuffer=function(e,t,n,i,o,a){if(e=g(e,0),t=g(t,0),n=g(n,0),i=g(i,0),o=g(o,this._size),a=g(a,this._size),_.typeOf.number.greaterThanOrEquals("xOffset",e,0),_.typeOf.number.greaterThanOrEquals("yOffset",t,0),_.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),_.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),e+o>this._size)throw new C("xOffset + source.width must be less than or equal to width.");if(t+a>this._size)throw new C("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Te.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Te.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");const r=this._context._gl,f=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(f,this._texture),r.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,a),r.bindTexture(f,null),this._initialized=!0};const $r={DONT_CARE:R.DONT_CARE,FASTEST:R.FASTEST,NICEST:R.NICEST,validate:function(e){return e===$r.DONT_CARE||e===$r.FASTEST||e===$r.NICEST}},Zr=Object.freeze($r),Kr={NEAREST:R.NEAREST,LINEAR:R.LINEAR};Kr.validate=function(e){return e===Kr.NEAREST||e===Kr.LINEAR};const io=Object.freeze(Kr),Mi={NEAREST:R.NEAREST,LINEAR:R.LINEAR,NEAREST_MIPMAP_NEAREST:R.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:R.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:R.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:R.LINEAR_MIPMAP_LINEAR};Mi.validate=function(e){return e===Mi.NEAREST||e===Mi.LINEAR||e===Mi.NEAREST_MIPMAP_NEAREST||e===Mi.LINEAR_MIPMAP_NEAREST||e===Mi.NEAREST_MIPMAP_LINEAR||e===Mi.LINEAR_MIPMAP_LINEAR};const Vt=Object.freeze(Mi),Qr={CLAMP_TO_EDGE:R.CLAMP_TO_EDGE,REPEAT:R.REPEAT,MIRRORED_REPEAT:R.MIRRORED_REPEAT,validate:function(e){return e===Qr.CLAMP_TO_EDGE||e===Qr.REPEAT||e===Qr.MIRRORED_REPEAT}},Lo=Object.freeze(Qr);function ei(e){e=g(e,g.EMPTY_OBJECT);const{wrapS:t=Lo.CLAMP_TO_EDGE,wrapT:n=Lo.CLAMP_TO_EDGE,minificationFilter:i=Vt.LINEAR,magnificationFilter:o=io.LINEAR,maximumAnisotropy:a=1}=e;if(!Lo.validate(t))throw new C("Invalid sampler.wrapS.");if(!Lo.validate(n))throw new C("Invalid sampler.wrapT.");if(!Vt.validate(i))throw new C("Invalid sampler.minificationFilter.");if(!io.validate(o))throw new C("Invalid sampler.magnificationFilter.");_.typeOf.number.greaterThanOrEquals("maximumAnisotropy",a,1),this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=a}Object.defineProperties(ei.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),ei.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy},ei.NEAREST=Object.freeze(new ei({wrapS:Lo.CLAMP_TO_EDGE,wrapT:Lo.CLAMP_TO_EDGE,minificationFilter:Vt.NEAREST,magnificationFilter:io.NEAREST}));function It(e){e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context);const{context:t,source:n,pixelFormat:i=ge.RGBA,pixelDatatype:o=Te.UNSIGNED_BYTE,flipY:a=!0,skipColorSpaceConversion:r=!1,sampler:f=new ei}=e,c=e.preMultiplyAlpha||i===ge.RGB||i===ge.LUMINANCE;let{width:h,height:d}=e;if(l(n)){if(!Object.values(It.FaceName).every(I=>l(n[I])))throw new C(`options.source requires faces ${Object.values(It.FaceName).join(", ")}.`);({width:h,height:d}=n.positiveX);for(const I of It.getFaceNames()){const O=n[I];if(Number(O.width)!==h||Number(O.height)!==d)throw new C("Each face in options.source must have the same width and height.")}}const p=h;if(!l(h)||!l(d))throw new C("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(h!==d)throw new C("Width must equal height.");if(p<=0)throw new C("Width and height must be greater than zero.");if(p>xe.maximumCubeMapSize)throw new C(`Width and height must be less than or equal to the maximum cube map size (${xe.maximumCubeMapSize}). Check maximumCubeMapSize.`);if(!ge.validate(i))throw new C("Invalid options.pixelFormat.");if(ge.isDepthFormat(i))throw new C("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!Te.validate(o))throw new C("Invalid options.pixelDatatype.");if(o===Te.FLOAT&&!t.floatingPointTexture)throw new C("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(o===Te.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new C("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.");const m=ge.textureSizeInBytes(i,o,p,p)*6,T=ge.toInternalFormat(i,o,t),y=t._gl,w=y.TEXTURE_CUBE_MAP,A=y.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=w,this._texture=A,this._pixelFormat=i,this._pixelDatatype=o,this._size=p,this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=c,this._flipY=a;const E=l(n);function b(I){return new Xr(t,A,w,I,T,i,o,p,c,a,E)}this._positiveX=b(y.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=b(y.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=b(y.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=b(y.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=b(y.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=b(y.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=f,wu(this,f),y.activeTexture(y.TEXTURE0),y.bindTexture(w,A),r?y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.NONE):y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.BROWSER_DEFAULT_WEBGL);for(const I of It.getFaceNames())Cu(this[I],n==null?void 0:n[I],0);y.bindTexture(w,null)}It.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*Zg(){yield It.FaceName.POSITIVEX,yield It.FaceName.NEGATIVEX,yield It.FaceName.POSITIVEY,yield It.FaceName.NEGATIVEY,yield It.FaceName.POSITIVEZ,yield It.FaceName.NEGATIVEZ}It.getFaceNames=function(){return Zg()};function Cu(e,t,n){n=g(n,0);const i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),a=e._pixelFormat,r=e._pixelDatatype,f=e._internalFormat,c=e._flipY,h=e._preMultiplyAlpha,d=e._context,p=d._gl;if(!l(t)){p.texImage2D(i,n,f,o,o,0,a,Te.toWebGLConstant(r,d),null);return}let{arrayBufferView:m}=t,T=4;l(m)&&(T=ge.alignmentInBytes(a,r,o)),p.pixelStorei(p.UNPACK_ALIGNMENT,T),l(m)?(p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,!1),c&&(m=ge.flipY(m,a,r,o,o)),p.texImage2D(i,n,f,o,o,0,a,Te.toWebGLConstant(r,d),m)):(p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,h),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,c),p.texImage2D(i,n,f,a,Te.toWebGLConstant(r,d),t))}Object.defineProperties(It.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){wu(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});function wu(e,t){let{minificationFilter:n,magnificationFilter:i}=t;const o=[Vt.NEAREST_MIPMAP_NEAREST,Vt.NEAREST_MIPMAP_LINEAR,Vt.LINEAR_MIPMAP_NEAREST,Vt.LINEAR_MIPMAP_LINEAR].includes(n),a=e._context,r=e._pixelDatatype;(r===Te.FLOAT&&!a.textureFloatLinear||r===Te.HALF_FLOAT&&!a.textureHalfFloatLinear)&&(n=o?Vt.NEAREST_MIPMAP_NEAREST:Vt.NEAREST,i=io.NEAREST);const f=a._gl,c=e._textureTarget;f.activeTexture(f.TEXTURE0),f.bindTexture(c,e._texture),f.texParameteri(c,f.TEXTURE_MIN_FILTER,n),f.texParameteri(c,f.TEXTURE_MAG_FILTER,i),f.texParameteri(c,f.TEXTURE_WRAP_S,t.wrapS),f.texParameteri(c,f.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&f.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),f.bindTexture(c,null)}It.prototype.loadMipmaps=function(e,t){if(_.defined("source",e),!Array.isArray(e))throw new C("source must be an array");const n=Math.log2(this._size);if(e.length!==n)throw new C("all mip levels must be defined");t=g(t,!1);const i=this._context._gl,o=this._texture,a=this._textureTarget;i.activeTexture(i.TEXTURE0),i.bindTexture(a,o),t?i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE):i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL);for(let r=0;r<e.length;r++){const f=e[r],c=r+1;for(const h of It.getFaceNames())Cu(this[h],f[h],c)}i.bindTexture(a,null),this._hasMipmap=!0},It.prototype.generateMipmap=function(e){if(e=g(e,Zr.DONT_CARE),this._size>1&&!S.isPowerOfTwo(this._size))throw new C("width and height must be a power of two to call generateMipmap().");if(!Zr.validate(e))throw new C("hint is invalid.");this._hasMipmap=!0;const t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)},It.prototype.isDestroyed=function(){return!1},It.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=st(this._positiveX),this._negativeX=st(this._negativeX),this._positiveY=st(this._positiveY),this._negativeY=st(this._negativeY),this._positiveZ=st(this._positiveZ),this._negativeZ=st(this._negativeZ),st(this)};const zc={czm_degreesPerRadian:`/**
51
+ `;return a=Bc(f),new Worker(a,o)}if(a=e,n||(a=_n(`${St._workerModulePrefix+i}.js`)),!Ct.supportsEsmWebWorkers())throw new dt("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(a,o)}async function qg(e,t){const n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Ct.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new dt(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=_n(t.fallbackModulePath),n}n.wasmBinaryFile=_n(t.wasmBinaryFile);const i=await ae.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function St(e,t){this._workerPath=e,this._maximumActiveTasks=g(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const Hg=(e,t,n,i)=>{const o=({data:a})=>{if(a.id===t){if(l(a.error)){let r=a.error;r.name==="RuntimeError"?(r=new dt(a.error.message),r.stack=a.error.stack):r.name==="DeveloperError"?(r=new C(a.error.message),r.stack=a.error.stack):r.name==="Error"&&(r=new Error(a.error.message),r.stack=a.error.stack),Pc.raiseEvent(r),i(r)}else Pc.raiseEvent(),n(a.result);e.removeEventListener("message",o)}};return o},jg=[];async function Yg(e,t,n){const i=await Promise.resolve(gu());l(n)?i||(n.length=0):n=jg;const o=e._nextID++,a=new Promise((r,f)=>{e._worker.addEventListener("message",Hg(e._worker,o,r,f))});return e._worker.postMessage({id:o,baseUrl:_n.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),a}async function Xg(e,t,n){++e._activeTasks;try{const i=await Yg(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}St.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=Rc(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return Xg(this,e,t)},St.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;const t=async()=>{const n=this._worker=Rc(this._workerPath),i=await qg(this,e),o=await Promise.resolve(gu());let a;const r=i.wasmBinary;l(r)&&o&&(a=[r]);const f=new Promise((c,h)=>{n.onmessage=function({data:d}){l(d)?c(d.result):h(new dt("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},a),f};return this._webAssemblyPromise=t(),this._webAssemblyPromise},St.prototype.isDestroyed=function(){return!1},St.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),st(this)},St.taskCompletedEvent=Pc,St._defaultWorkerModulePrefix="Workers/",St._workerModulePrefix=St._defaultWorkerModulePrefix,St._canTransferArrayBuffer=void 0;function yi(){}yi._transcodeTaskProcessor=new St("transcodeKTX2",Number.POSITIVE_INFINITY),yi._readyPromise=void 0;function $g(){const e=yi._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return yi._transcodeTaskProcessor;throw new dt("KTX2 transcoder could not be initialized.")});yi._readyPromise=e}yi.transcode=function(e,t){return _.defined("supportedTargetFormats",t),l(yi._readyPromise)||$g(),yi._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));const o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){const i=n.length,o=Object.keys(n[0]);for(let a=0;a<i;a++){const r=n[a];for(let f=0;f<o.length;f++){const c=r[o[f]];r[o[f]]=new Ro(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let a=0;a<i;++a)n[a]=n[a][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};let Tu;yu.setKTX2SupportedFormats=function(e,t,n,i,o,a){Tu={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:a}};function yu(e){_.defined("resourceOrUrlOrBuffer",e);let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=ae.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return yi.transcode(n,Tu)})}function Xr(e,t,n,i,o,a,r,f,c,h,d){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=r,this._internalFormat=o,this._pixelFormat=a,this._size=f,this._preMultiplyAlpha=c,this._flipY=h,this._initialized=d}Object.defineProperties(Xr.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),Xr.prototype.copyFrom=function(e){_.defined("options",e);const{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(_.defined("options.source",i),_.typeOf.number.greaterThanOrEquals("xOffset",t,0),_.typeOf.number.greaterThanOrEquals("yOffset",n,0),t+i.width>this._size)throw new C("xOffset + options.source.width must be less than or equal to width.");if(n+i.height>this._size)throw new C("yOffset + options.source.height must be less than or equal to height.");const{width:a,height:r}=i,f=this._context._gl,c=this._textureTarget,h=this._targetFace;f.activeTexture(f.TEXTURE0),f.bindTexture(c,this._texture);let d=i.arrayBufferView;const p=this._size,m=this._pixelFormat,T=this._internalFormat,y=this._pixelDatatype,w=this._preMultiplyAlpha,A=this._flipY;let E=4;l(d)&&(E=ge.alignmentInBytes(m,y,a)),f.pixelStorei(f.UNPACK_ALIGNMENT,E),o?f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.NONE):f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.BROWSER_DEFAULT_WEBGL);let b=!1;if(!this._initialized){let D;t===0&&n===0&&a===p&&r===p?(l(d)?(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!1),A&&(d=ge.flipY(d,m,y,p,p)),D=d):(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,A),D=i),b=!0):(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!1),D=ge.createTypedArray(m,y,p,p)),f.texImage2D(h,0,T,p,p,0,m,Te.toWebGLConstant(y,this._context),D),this._initialized=!0}b||(l(d)?(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!1),A&&(d=ge.flipY(d,m,y,a,r)),f.texSubImage2D(h,0,t,n,a,r,m,Te.toWebGLConstant(y,this._context),d)):(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,A),f.texSubImage2D(h,0,t,n,m,Te.toWebGLConstant(y,this._context),i))),f.bindTexture(c,null)},Xr.prototype.copyFromFramebuffer=function(e,t,n,i,o,a){if(e=g(e,0),t=g(t,0),n=g(n,0),i=g(i,0),o=g(o,this._size),a=g(a,this._size),_.typeOf.number.greaterThanOrEquals("xOffset",e,0),_.typeOf.number.greaterThanOrEquals("yOffset",t,0),_.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),_.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),e+o>this._size)throw new C("xOffset + source.width must be less than or equal to width.");if(t+a>this._size)throw new C("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Te.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Te.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");const r=this._context._gl,f=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(f,this._texture),r.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,a),r.bindTexture(f,null),this._initialized=!0};const $r={DONT_CARE:R.DONT_CARE,FASTEST:R.FASTEST,NICEST:R.NICEST,validate:function(e){return e===$r.DONT_CARE||e===$r.FASTEST||e===$r.NICEST}},Zr=Object.freeze($r),Kr={NEAREST:R.NEAREST,LINEAR:R.LINEAR};Kr.validate=function(e){return e===Kr.NEAREST||e===Kr.LINEAR};const io=Object.freeze(Kr),Mi={NEAREST:R.NEAREST,LINEAR:R.LINEAR,NEAREST_MIPMAP_NEAREST:R.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:R.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:R.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:R.LINEAR_MIPMAP_LINEAR};Mi.validate=function(e){return e===Mi.NEAREST||e===Mi.LINEAR||e===Mi.NEAREST_MIPMAP_NEAREST||e===Mi.LINEAR_MIPMAP_NEAREST||e===Mi.NEAREST_MIPMAP_LINEAR||e===Mi.LINEAR_MIPMAP_LINEAR};const Vt=Object.freeze(Mi),Qr={CLAMP_TO_EDGE:R.CLAMP_TO_EDGE,REPEAT:R.REPEAT,MIRRORED_REPEAT:R.MIRRORED_REPEAT,validate:function(e){return e===Qr.CLAMP_TO_EDGE||e===Qr.REPEAT||e===Qr.MIRRORED_REPEAT}},zo=Object.freeze(Qr);function Jn(e){e=g(e,g.EMPTY_OBJECT);const{wrapS:t=zo.CLAMP_TO_EDGE,wrapT:n=zo.CLAMP_TO_EDGE,minificationFilter:i=Vt.LINEAR,magnificationFilter:o=io.LINEAR,maximumAnisotropy:a=1}=e;if(!zo.validate(t))throw new C("Invalid sampler.wrapS.");if(!zo.validate(n))throw new C("Invalid sampler.wrapT.");if(!Vt.validate(i))throw new C("Invalid sampler.minificationFilter.");if(!io.validate(o))throw new C("Invalid sampler.magnificationFilter.");_.typeOf.number.greaterThanOrEquals("maximumAnisotropy",a,1),this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=a}Object.defineProperties(Jn.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),Jn.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy},Jn.NEAREST=Object.freeze(new Jn({wrapS:zo.CLAMP_TO_EDGE,wrapT:zo.CLAMP_TO_EDGE,minificationFilter:Vt.NEAREST,magnificationFilter:io.NEAREST}));function It(e){e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context);const{context:t,source:n,pixelFormat:i=ge.RGBA,pixelDatatype:o=Te.UNSIGNED_BYTE,flipY:a=!0,skipColorSpaceConversion:r=!1,sampler:f=new Jn}=e,c=e.preMultiplyAlpha||i===ge.RGB||i===ge.LUMINANCE;let{width:h,height:d}=e;if(l(n)){if(!Object.values(It.FaceName).every(D=>l(n[D])))throw new C(`options.source requires faces ${Object.values(It.FaceName).join(", ")}.`);({width:h,height:d}=n.positiveX);for(const D of It.getFaceNames()){const O=n[D];if(Number(O.width)!==h||Number(O.height)!==d)throw new C("Each face in options.source must have the same width and height.")}}const p=h;if(!l(h)||!l(d))throw new C("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(h!==d)throw new C("Width must equal height.");if(p<=0)throw new C("Width and height must be greater than zero.");if(p>xe.maximumCubeMapSize)throw new C(`Width and height must be less than or equal to the maximum cube map size (${xe.maximumCubeMapSize}). Check maximumCubeMapSize.`);if(!ge.validate(i))throw new C("Invalid options.pixelFormat.");if(ge.isDepthFormat(i))throw new C("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!Te.validate(o))throw new C("Invalid options.pixelDatatype.");if(o===Te.FLOAT&&!t.floatingPointTexture)throw new C("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(o===Te.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new C("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.");const m=ge.textureSizeInBytes(i,o,p,p)*6,T=ge.toInternalFormat(i,o,t),y=t._gl,w=y.TEXTURE_CUBE_MAP,A=y.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=w,this._texture=A,this._pixelFormat=i,this._pixelDatatype=o,this._size=p,this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=c,this._flipY=a;const E=l(n);function b(D){return new Xr(t,A,w,D,T,i,o,p,c,a,E)}this._positiveX=b(y.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=b(y.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=b(y.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=b(y.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=b(y.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=b(y.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=f,wu(this,f),y.activeTexture(y.TEXTURE0),y.bindTexture(w,A),r?y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.NONE):y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.BROWSER_DEFAULT_WEBGL);for(const D of It.getFaceNames())Cu(this[D],n==null?void 0:n[D],0);y.bindTexture(w,null)}It.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*Zg(){yield It.FaceName.POSITIVEX,yield It.FaceName.NEGATIVEX,yield It.FaceName.POSITIVEY,yield It.FaceName.NEGATIVEY,yield It.FaceName.POSITIVEZ,yield It.FaceName.NEGATIVEZ}It.getFaceNames=function(){return Zg()};function Cu(e,t,n){n=g(n,0);const i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),a=e._pixelFormat,r=e._pixelDatatype,f=e._internalFormat,c=e._flipY,h=e._preMultiplyAlpha,d=e._context,p=d._gl;if(!l(t)){p.texImage2D(i,n,f,o,o,0,a,Te.toWebGLConstant(r,d),null);return}let{arrayBufferView:m}=t,T=4;l(m)&&(T=ge.alignmentInBytes(a,r,o)),p.pixelStorei(p.UNPACK_ALIGNMENT,T),l(m)?(p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,!1),c&&(m=ge.flipY(m,a,r,o,o)),p.texImage2D(i,n,f,o,o,0,a,Te.toWebGLConstant(r,d),m)):(p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,h),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,c),p.texImage2D(i,n,f,a,Te.toWebGLConstant(r,d),t))}Object.defineProperties(It.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){wu(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});function wu(e,t){let{minificationFilter:n,magnificationFilter:i}=t;const o=[Vt.NEAREST_MIPMAP_NEAREST,Vt.NEAREST_MIPMAP_LINEAR,Vt.LINEAR_MIPMAP_NEAREST,Vt.LINEAR_MIPMAP_LINEAR].includes(n),a=e._context,r=e._pixelDatatype;(r===Te.FLOAT&&!a.textureFloatLinear||r===Te.HALF_FLOAT&&!a.textureHalfFloatLinear)&&(n=o?Vt.NEAREST_MIPMAP_NEAREST:Vt.NEAREST,i=io.NEAREST);const f=a._gl,c=e._textureTarget;f.activeTexture(f.TEXTURE0),f.bindTexture(c,e._texture),f.texParameteri(c,f.TEXTURE_MIN_FILTER,n),f.texParameteri(c,f.TEXTURE_MAG_FILTER,i),f.texParameteri(c,f.TEXTURE_WRAP_S,t.wrapS),f.texParameteri(c,f.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&f.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),f.bindTexture(c,null)}It.prototype.loadMipmaps=function(e,t){if(_.defined("source",e),!Array.isArray(e))throw new C("source must be an array");const n=Math.log2(this._size);if(e.length!==n)throw new C("all mip levels must be defined");t=g(t,!1);const i=this._context._gl,o=this._texture,a=this._textureTarget;i.activeTexture(i.TEXTURE0),i.bindTexture(a,o),t?i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE):i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL);for(let r=0;r<e.length;r++){const f=e[r],c=r+1;for(const h of It.getFaceNames())Cu(this[h],f[h],c)}i.bindTexture(a,null),this._hasMipmap=!0},It.prototype.generateMipmap=function(e){if(e=g(e,Zr.DONT_CARE),this._size>1&&!S.isPowerOfTwo(this._size))throw new C("width and height must be a power of two to call generateMipmap().");if(!Zr.validate(e))throw new C("hint is invalid.");this._hasMipmap=!0;const t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)},It.prototype.isDestroyed=function(){return!1},It.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=st(this._positiveX),this._negativeX=st(this._negativeX),this._positiveY=st(this._positiveY),this._negativeY=st(this._negativeY),this._positiveZ=st(this._positiveZ),this._negativeZ=st(this._negativeZ),st(this)};const zc={czm_degreesPerRadian:`/**
52
52
  * A built-in GLSL floating-point constant for converting radians to degrees.
53
53
  *
54
54
  * @alias czm_degreesPerRadian
@@ -3828,8 +3828,8 @@ void main()
3828
3828
  }
3829
3829
  out_FragColor = czm_pickColor;
3830
3830
  }`;return`${n}
3831
- ${i}`};function eT(e,t){const n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function Su(e,t){const n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function Iu(e,t){const n=t.length;for(let i=0;i<n;++i){const o=t[i];if(Su(e,o))return o}}const tT=["v_normalEC","v_normal"];Ae.findNormalVarying=function(e){return Su(e,"#ifdef HAS_NORMALS")?eT(e,"HAS_NORMALS")?"v_normalEC":void 0:Iu(e,tT)};const nT=["v_positionEC"];Ae.findPositionVarying=function(e){return Iu(e,nT)};function Mt(e){e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context);const{context:t,source:n,pixelFormat:i=ge.RGBA,pixelDatatype:o=Te.UNSIGNED_BYTE,flipY:a=!0,skipColorSpaceConversion:r=!1,sampler:f=new ei}=e;let{width:c,height:h}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(h)||(h=n.videoHeight??n.naturalHeight??n.height));const d=e.preMultiplyAlpha||i===ge.RGB||i===ge.LUMINANCE,p=ge.toInternalFormat(i,o,t),m=ge.isCompressedFormat(p);if(!l(c)||!l(h))throw new C("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(_.typeOf.number.greaterThan("width",c,0),c>xe.maximumTextureSize)throw new C(`Width must be less than or equal to the maximum texture size (${xe.maximumTextureSize}). Check maximumTextureSize.`);if(_.typeOf.number.greaterThan("height",h,0),h>xe.maximumTextureSize)throw new C(`Height must be less than or equal to the maximum texture size (${xe.maximumTextureSize}). Check maximumTextureSize.`);if(!ge.validate(i))throw new C("Invalid options.pixelFormat.");if(!m&&!Te.validate(o))throw new C("Invalid options.pixelDatatype.");if(i===ge.DEPTH_COMPONENT&&o!==Te.UNSIGNED_SHORT&&o!==Te.UNSIGNED_INT)throw new C("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(i===ge.DEPTH_STENCIL&&o!==Te.UNSIGNED_INT_24_8)throw new C("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(o===Te.FLOAT&&!t.floatingPointTexture)throw new C("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(o===Te.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new C("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(ge.isDepthFormat(i)){if(l(n))throw new C("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!t.depthTexture)throw new C("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.")}if(m){if(!l(n)||!l(n.arrayBufferView))throw new C("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(ge.isDXTFormat(p)&&!t.s3tc)throw new C("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(ge.isPVRTCFormat(p)&&!t.pvrtc)throw new C("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(ge.isASTCFormat(p)&&!t.astc)throw new C("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(ge.isETC2Format(p)&&!t.etc)throw new C("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");if(ge.isETC1Format(p)&&!t.etc1)throw new C("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");if(ge.isBC7Format(p)&&!t.bc7)throw new C("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(ge.compressedTextureSizeInBytes(p,c,h)!==n.arrayBufferView.byteLength)throw new C("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}const T=t._gl,y=m?ge.compressedTextureSizeInBytes(i,c,h):ge.textureSizeInBytes(i,o,c,h);this._id=Xn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=T.TEXTURE_2D,this._texture=T.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=h,this._dimensions=new q(c,h),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=d,this._flipY=a,this._initialized=!1,this._sampler=void 0,this._sampler=f,Du(this,f),T.activeTexture(T.TEXTURE0),T.bindTexture(this._textureTarget,this._texture),l(n)?(r?T.pixelStorei(T.UNPACK_COLORSPACE_CONVERSION_WEBGL,T.NONE):T.pixelStorei(T.UNPACK_COLORSPACE_CONVERSION_WEBGL,T.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?ge.isCompressedFormat(p)?iT(this,n):oT(this,n):l(n.framebuffer)?sT(this,n):rT(this,n),this._initialized=!0):aT(this),T.bindTexture(this._textureTarget,null)}function iT(e,t){const i=e._context._gl,o=e._textureTarget,a=e._internalFormat,{width:r,height:f}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,a,r,f,0,t.arrayBufferView),l(t.mipLevels)){let c=r,h=f;for(let d=0;d<t.mipLevels.length;++d)c=Jr(c),h=Jr(h),i.compressedTexImage2D(o,d+1,a,c,h,0,t.mipLevels[d])}}function oT(e,t){const n=e._context,i=n._gl,o=e._textureTarget,a=e._internalFormat,{width:r,height:f,pixelFormat:c,pixelDatatype:h,flipY:d}=e,p=ge.alignmentInBytes(c,h,r);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let m=t.arrayBufferView;if(d&&(m=ge.flipY(m,c,h,r,f)),i.texImage2D(o,0,a,r,f,0,c,Te.toWebGLConstant(h,n),m),l(t.mipLevels)){let T=r,y=f;for(let w=0;w<t.mipLevels.length;++w)T=Jr(T),y=Jr(y),i.texImage2D(o,w+1,a,T,y,0,c,Te.toWebGLConstant(h,n),t.mipLevels[w])}}function sT(e,t){const n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function rT(e,t){const n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,Te.toWebGLConstant(e.pixelDatatype,n),t)}function Jr(e){const t=Math.floor(e/2)|0;return Math.max(t,1)}function aT(e){const t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,Te.toWebGLConstant(e._pixelDatatype,t),null)}Mt.create=function(e){return new Mt(e)},Mt.fromFramebuffer=function(e){e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context);const t=e.context,n=t._gl,{pixelFormat:i=ge.RGB,framebufferXOffset:o=0,framebufferYOffset:a=0,width:r=n.drawingBufferWidth,height:f=n.drawingBufferHeight,framebuffer:c}=e;if(!ge.validate(i))throw new C("Invalid pixelFormat.");if(ge.isDepthFormat(i)||ge.isCompressedFormat(i))throw new C("pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.");if(_.defined("options.context",t),_.typeOf.number.greaterThanOrEquals("framebufferXOffset",o,0),_.typeOf.number.greaterThanOrEquals("framebufferYOffset",a,0),o+r>n.drawingBufferWidth)throw new C("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(a+f>n.drawingBufferHeight)throw new C("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new Mt({context:t,width:r,height:f,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:o,yOffset:a,width:r,height:f}})},Object.defineProperties(Mt.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Du(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function Du(e,t){let{minificationFilter:n,magnificationFilter:i}=t;const o=[Vt.NEAREST_MIPMAP_NEAREST,Vt.NEAREST_MIPMAP_LINEAR,Vt.LINEAR_MIPMAP_NEAREST,Vt.LINEAR_MIPMAP_LINEAR].includes(n),a=e._context,r=e._pixelFormat,f=e._pixelDatatype;(f===Te.FLOAT&&!a.textureFloatLinear||f===Te.HALF_FLOAT&&!a.textureHalfFloatLinear)&&(n=o?Vt.NEAREST_MIPMAP_NEAREST:Vt.NEAREST,i=io.NEAREST),a.webgl2&&ge.isDepthFormat(r)&&(n=Vt.NEAREST,i=io.NEAREST);const c=a._gl,h=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(h,e._texture),c.texParameteri(h,c.TEXTURE_MIN_FILTER,n),c.texParameteri(h,c.TEXTURE_MAG_FILTER,i),c.texParameteri(h,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(h,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(h,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(h,null)}Mt.prototype.copyFrom=function(e){_.defined("options",e);const{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(_.defined("options.source",i),ge.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ge.isCompressedFormat(this._pixelFormat))throw new C("Cannot call copyFrom with a compressed texture pixel format.");_.typeOf.number.greaterThanOrEquals("xOffset",t,0),_.typeOf.number.greaterThanOrEquals("yOffset",n,0),_.typeOf.number.lessThanOrEquals("xOffset + options.source.width",t+i.width,this._width),_.typeOf.number.lessThanOrEquals("yOffset + options.source.height",n+i.height,this._height);const a=this._context,r=a._gl,f=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(f,this._texture);let{width:c,height:h}=i;const d=i.arrayBufferView;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,h=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,h=i.naturalHeight);const p=this._width,m=this._height,T=this._internalFormat,y=this._pixelFormat,w=this._pixelDatatype,A=this._preMultiplyAlpha,E=this._flipY;let b=4;l(d)&&(b=ge.alignmentInBytes(y,w,c)),r.pixelStorei(r.UNPACK_ALIGNMENT,b),o?r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE):r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.BROWSER_DEFAULT_WEBGL);let I=!1;if(!this._initialized){let O;t===0&&n===0&&c===p&&h===m?(l(d)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),E?O=ge.flipY(d,y,w,p,m):O=d):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,E),O=i),I=!0):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),O=ge.createTypedArray(y,w,p,m)),r.texImage2D(f,0,T,p,m,0,y,Te.toWebGLConstant(w,a),O),this._initialized=!0}if(!I){let O;l(d)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),E?O=ge.flipY(d,y,w,c,h):O=d):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,E),O=i),r.texSubImage2D(f,0,t,n,c,h,y,Te.toWebGLConstant(w,a),O)}r.bindTexture(f,null)},Mt.prototype.copyFromFramebuffer=function(e,t,n,i,o,a){if(e=g(e,0),t=g(t,0),n=g(n,0),i=g(i,0),o=g(o,this._width),a=g(a,this._height),ge.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===Te.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Te.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(ge.isCompressedFormat(this._pixelFormat))throw new C("Cannot call copyFrom with a compressed texture pixel format.");_.typeOf.number.greaterThanOrEquals("xOffset",e,0),_.typeOf.number.greaterThanOrEquals("yOffset",t,0),_.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),_.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),_.typeOf.number.lessThanOrEquals("xOffset + width",e+o,this._width),_.typeOf.number.lessThanOrEquals("yOffset + height",t+a,this._height);const r=this._context._gl,f=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(f,this._texture),r.copyTexSubImage2D(f,0,e,t,n,i,o,a),r.bindTexture(f,null),this._initialized=!0},Mt.prototype.generateMipmap=function(e){if(e=g(e,Zr.DONT_CARE),ge.isDepthFormat(this._pixelFormat))throw new C("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ge.isCompressedFormat(this._pixelFormat))throw new C("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!S.isPowerOfTwo(this._width))throw new C("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!S.isPowerOfTwo(this._height))throw new C("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!Zr.validate(e))throw new C("hint is invalid.");this._hasMipmap=!0;const t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)},Mt.prototype.isDestroyed=function(){return!1},Mt.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),st(this)};function Qe(){this.high=u.clone(u.ZERO),this.low=u.clone(u.ZERO)}Qe.encode=function(e,t){_.typeOf.number("value",e),l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};const Ci={high:0,low:0};Qe.fromCartesian=function(e,t){_.typeOf.object("cartesian",e),l(t)||(t=new Qe);const n=t.high,i=t.low;return Qe.encode(e.x,Ci),n.x=Ci.high,i.x=Ci.low,Qe.encode(e.y,Ci),n.y=Ci.high,i.y=Ci.low,Qe.encode(e.z,Ci),n.z=Ci.high,i.z=Ci.low,t};const Lc=new Qe;Qe.writeElements=function(e,t,n){_.defined("cartesianArray",t),_.typeOf.number("index",n),_.typeOf.number.greaterThanOrEquals("index",n,0),Qe.fromCartesian(e,Lc);const i=Lc.high,o=Lc.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};function Me(e,t){if(_.typeOf.object("normal",e),!S.equalsEpsilon(u.magnitude(e),1,S.EPSILON6))throw new C("normal must be normalized.");_.typeOf.number("distance",t),this.normal=u.clone(e),this.distance=t}Me.fromPointNormal=function(e,t,n){if(_.typeOf.object("point",e),_.typeOf.object("normal",t),!S.equalsEpsilon(u.magnitude(t),1,S.EPSILON6))throw new C("normal must be normalized.");const i=-u.dot(t,e);return l(n)?(u.clone(t,n.normal),n.distance=i,n):new Me(t,i)};const cT=new u;Me.fromCartesian4=function(e,t){_.typeOf.object("coefficients",e);const n=u.fromCartesian4(e,cT),i=e.w;if(!S.equalsEpsilon(u.magnitude(n),1,S.EPSILON6))throw new C("normal must be normalized.");return l(t)?(u.clone(n,t.normal),t.distance=i,t):new Me(n,i)},Me.getPointDistance=function(e,t){return _.typeOf.object("plane",e),_.typeOf.object("point",t),u.dot(e.normal,t)+e.distance};const hT=new u;Me.projectPointOntoPlane=function(e,t,n){_.typeOf.object("plane",e),_.typeOf.object("point",t),l(n)||(n=new u);const i=Me.getPointDistance(e,t),o=u.multiplyByScalar(e.normal,i,hT);return u.subtract(t,o,n)};const fT=new k,lT=new Z,uT=new u;Me.transform=function(e,t,n){_.typeOf.object("plane",e),_.typeOf.object("transform",t);const i=e.normal,o=e.distance,a=k.inverseTranspose(t,fT);let r=Z.fromElements(i.x,i.y,i.z,o,lT);r=k.multiplyByVector(a,r,r);const f=u.fromCartesian4(r,uT);return r=Z.divideByScalar(r,u.magnitude(f),r),Me.fromCartesian4(r,n)},Me.clone=function(e,t){return _.typeOf.object("plane",e),l(t)?(u.clone(e.normal,t.normal),t.distance=e.distance,t):new Me(e.normal,e.distance)},Me.equals=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),e.distance===t.distance&&u.equals(e.normal,t.normal)},Me.ORIGIN_XY_PLANE=Object.freeze(new Me(u.UNIT_Z,0)),Me.ORIGIN_YZ_PLANE=Object.freeze(new Me(u.UNIT_X,0)),Me.ORIGIN_ZX_PLANE=Object.freeze(new Me(u.UNIT_Y,0));function bn(e){this.planes=g(e,[])}const ps=[new u,new u,new u];u.clone(u.UNIT_X,ps[0]),u.clone(u.UNIT_Y,ps[1]),u.clone(u.UNIT_Z,ps[2]);const Ui=new u,dT=new u,Ou=new Me(new u(1,0,0),0);bn.fromBoundingSphere=function(e,t){if(!l(e))throw new C("boundingSphere is required.");l(t)||(t=new bn);const n=ps.length,i=t.planes;i.length=2*n;const o=e.center,a=e.radius;let r=0;for(let f=0;f<n;++f){const c=ps[f];let h=i[r],d=i[r+1];l(h)||(h=i[r]=new Z),l(d)||(d=i[r+1]=new Z),u.multiplyByScalar(c,-a,Ui),u.add(o,Ui,Ui),h.x=c.x,h.y=c.y,h.z=c.z,h.w=-u.dot(c,Ui),u.multiplyByScalar(c,a,Ui),u.add(o,Ui,Ui),d.x=-c.x,d.y=-c.y,d.z=-c.z,d.w=-u.dot(u.negate(c,dT),Ui),r+=2}return t},bn.prototype.computeVisibility=function(e){if(!l(e))throw new C("boundingVolume is required.");const t=this.planes;let n=!1;for(let i=0,o=t.length;i<o;++i){const a=e.intersectPlane(Me.fromCartesian4(t[i],Ou));if(a===xt.OUTSIDE)return xt.OUTSIDE;a===xt.INTERSECTING&&(n=!0)}return n?xt.INTERSECTING:xt.INSIDE},bn.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!l(e))throw new C("boundingVolume is required.");if(!l(t))throw new C("parentPlaneMask is required.");if(t===bn.MASK_OUTSIDE||t===bn.MASK_INSIDE)return t;let n=bn.MASK_INSIDE;const i=this.planes;for(let o=0,a=i.length;o<a;++o){const r=o<31?1<<o:0;if(o<31&&!(t&r))continue;const f=e.intersectPlane(Me.fromCartesian4(i[o],Ou));if(f===xt.OUTSIDE)return bn.MASK_OUTSIDE;f===xt.INTERSECTING&&(n|=r)}return n},bn.MASK_OUTSIDE=4294967295,bn.MASK_INSIDE=0,bn.MASK_INDETERMINATE=2147483647;function zn(e){e=g(e,g.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=g(e.near,1),this._near=this.near,this.far=g(e.far,5e8),this._far=this.far,this._cullingVolume=new bn,this._orthographicMatrix=new k}function vu(e){if(!l(e.right)||!l(e.left)||!l(e.top)||!l(e.bottom)||!l(e.near)||!l(e.far))throw new C("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new C("right must be greater than left.");if(e.bottom>e.top)throw new C("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new C("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=k.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(zn.prototype,{projectionMatrix:{get:function(){return vu(this),this._orthographicMatrix}}});const pT=new u,mT=new u,_T=new u,Nc=new u;zn.prototype.computeCullingVolume=function(e,t,n){if(!l(e))throw new C("position is required.");if(!l(t))throw new C("direction is required.");if(!l(n))throw new C("up is required.");const i=this._cullingVolume.planes,o=this.top,a=this.bottom,r=this.right,f=this.left,c=this.near,h=this.far,d=u.cross(t,n,pT);u.normalize(d,d);const p=mT;u.multiplyByScalar(t,c,p),u.add(e,p,p);const m=_T;u.multiplyByScalar(d,f,m),u.add(p,m,m);let T=i[0];return l(T)||(T=i[0]=new Z),T.x=d.x,T.y=d.y,T.z=d.z,T.w=-u.dot(d,m),u.multiplyByScalar(d,r,m),u.add(p,m,m),T=i[1],l(T)||(T=i[1]=new Z),T.x=-d.x,T.y=-d.y,T.z=-d.z,T.w=-u.dot(u.negate(d,Nc),m),u.multiplyByScalar(n,a,m),u.add(p,m,m),T=i[2],l(T)||(T=i[2]=new Z),T.x=n.x,T.y=n.y,T.z=n.z,T.w=-u.dot(n,m),u.multiplyByScalar(n,o,m),u.add(p,m,m),T=i[3],l(T)||(T=i[3]=new Z),T.x=-n.x,T.y=-n.y,T.z=-n.z,T.w=-u.dot(u.negate(n,Nc),m),T=i[4],l(T)||(T=i[4]=new Z),T.x=t.x,T.y=t.y,T.z=t.z,T.w=-u.dot(t,p),u.multiplyByScalar(t,h,m),u.add(e,m,m),T=i[5],l(T)||(T=i[5]=new Z),T.x=-t.x,T.y=-t.y,T.z=-t.z,T.w=-u.dot(u.negate(t,Nc),m),this._cullingVolume},zn.prototype.getPixelDimensions=function(e,t,n,i,o){if(vu(this),!l(e)||!l(t))throw new C("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new C("drawingBufferWidth must be greater than zero.");if(t<=0)throw new C("drawingBufferHeight must be greater than zero.");if(!l(n))throw new C("distance is required.");if(!l(i))throw new C("pixelRatio is required.");if(i<=0)throw new C("pixelRatio must be greater than zero.");if(!l(o))throw new C("A result object is required.");const a=this.right-this.left,r=this.top-this.bottom,f=i*a/e,c=i*r/t;return o.x=f,o.y=c,o},zn.prototype.clone=function(e){return l(e)||(e=new zn),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},zn.prototype.equals=function(e){return l(e)&&e instanceof zn&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},zn.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof zn&&S.equalsEpsilon(this.right,e.right,t,n)&&S.equalsEpsilon(this.left,e.left,t,n)&&S.equalsEpsilon(this.top,e.top,t,n)&&S.equalsEpsilon(this.bottom,e.bottom,t,n)&&S.equalsEpsilon(this.near,e.near,t,n)&&S.equalsEpsilon(this.far,e.far,t,n)};function ln(e){e=g(e,g.EMPTY_OBJECT),this._offCenterFrustum=new zn,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=g(e.near,1),this._near=this.near,this.far=g(e.far,5e8),this._far=this.far}ln.packedLength=4,ln.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t},ln.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new ln),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function ki(e){if(!l(e.width)||!l(e.aspectRatio)||!l(e.near)||!l(e.far))throw new C("width, aspectRatio, near, or far parameters are not set.");const t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new C("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new C("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;const n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(ln.prototype,{projectionMatrix:{get:function(){return ki(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return ki(this),this._offCenterFrustum}}}),ln.prototype.computeCullingVolume=function(e,t,n){return ki(this),this._offCenterFrustum.computeCullingVolume(e,t,n)},ln.prototype.getPixelDimensions=function(e,t,n,i,o){return ki(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)},ln.prototype.clone=function(e){return l(e)||(e=new ln),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},ln.prototype.equals=function(e){return!l(e)||!(e instanceof ln)?!1:(ki(this),ki(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},ln.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof ln)?!1:(ki(this),ki(e),S.equalsEpsilon(this.width,e.width,t,n)&&S.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};const ea={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};ea.getMorphTime=function(e){return e===ea.SCENE3D?1:e===ea.MORPHING?void 0:0};const ye=Object.freeze(ea);function gT(e,t,n,i){const o=l(t.vertexBuffer),a=l(t.value),r=t.value?t.value.length:t.componentsPerAttribute;if(!o&&!a)throw new C("attribute must have a vertexBuffer or a value.");if(o&&a)throw new C("attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.");if(r!==1&&r!==2&&r!==3&&r!==4)throw a?new C("attribute.value.length must be in the range [1, 4]."):new C("attribute.componentsPerAttribute must be in the range [1, 4].");if(l(t.componentDatatype)&&!he.validate(t.componentDatatype))throw new C("attribute must have a valid componentDatatype or not specify it.");if(l(t.strideInBytes)&&t.strideInBytes>255)throw new C("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if(l(t.instanceDivisor)&&t.instanceDivisor>0&&!i.instancedArrays)throw new C("instanced arrays is not supported");if(l(t.instanceDivisor)&&t.instanceDivisor<0)throw new C("attribute must have an instanceDivisor greater than or equal to zero");if(l(t.instanceDivisor)&&a)throw new C("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if(l(t.instanceDivisor)&&t.instanceDivisor>0&&t.index===0)throw new C("attribute zero cannot have an instanceDivisor greater than 0");const f={index:g(t.index,n),enabled:g(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:a?t.value.slice(0):void 0,componentsPerAttribute:r,componentDatatype:g(t.componentDatatype,he.FLOAT),normalize:g(t.normalize,!1),offsetInBytes:g(t.offsetInBytes,0),strideInBytes:g(t.strideInBytes,0),instanceDivisor:g(t.instanceDivisor,0)};if(o)f.vertexAttrib=function(c){const h=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(h,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(h),this.instanceDivisor>0&&(i.glVertexAttribDivisor(h,this.instanceDivisor),i._vertexAttribDivisors[h]=this.instanceDivisor,i._previousDrawInstanced=!0)},f.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(f.componentsPerAttribute){case 1:f.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:f.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:f.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:f.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}f.disableVertexAttribArray=function(c){}}e.push(f)}function Wu(e,t,n){for(let i=0;i<t.length;++i){const o=t[i];o.enabled&&o.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function ti(e){e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context),_.defined("options.attributes",e.attributes);const t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer;let a;const r=[];let f=1,c=!1,h=!1,d=i.length;for(a=0;a<d;++a)gT(r,i[a],a,t);for(d=r.length,a=0;a<d;++a){const T=r[a];if(l(T.vertexBuffer)&&T.instanceDivisor===0){const y=T.strideInBytes||T.componentsPerAttribute*he.getSizeInBytes(T.componentDatatype);f=T.vertexBuffer.sizeInBytes/y;break}}for(a=0;a<d;++a)r[a].instanceDivisor>0&&(c=!0),l(r[a].value)&&(h=!0);const p={};for(a=0;a<d;++a){const T=r[a].index;if(p[T])throw new C(`Index ${T} is used by more than one attribute.`);p[T]=!0}let m;t.vertexArrayObject&&(m=t.glCreateVertexArray(),t.glBindVertexArray(m),Wu(n,r,o),t.glBindVertexArray(null)),this._numberOfVertices=f,this._hasInstancedAttributes=c,this._hasConstantAttributes=h,this._context=t,this._gl=n,this._vao=m,this._attributes=r,this._indexBuffer=o}function Pu(e){return e.values.length/e.componentsPerAttribute}function TT(e){return he.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function yT(e){let t,n,i;const o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===he.DOUBLE&&(e[n].componentDatatype=he.FLOAT,e[n].values=he.createTypedArray(he.FLOAT,e[n].values)));let a;const r=o.length;if(r>0)for(a=Pu(e[o[0]]),t=1;t<r;++t){const h=Pu(e[o[t]]);if(h!==a)throw new dt(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${h.toString()}) than attribute ${o[0]} (${a.toString()}).`)}o.sort(function(h,d){return he.getSizeInBytes(e[d].componentDatatype)-he.getSizeInBytes(e[h].componentDatatype)});let f=0;const c={};for(t=0;t<r;++t)n=o[t],i=e[n],c[n]=f,f+=TT(i);if(f>0){const h=he.getSizeInBytes(e[o[0]].componentDatatype),d=f%h;d!==0&&(f+=h-d);const p=a*f,m=new ArrayBuffer(p),T={};for(t=0;t<r;++t){n=o[t];const y=he.getSizeInBytes(e[n].componentDatatype);T[n]={pointer:he.createTypedArray(e[n].componentDatatype,m),index:c[n]/y,strideInComponentType:f/y}}for(t=0;t<a;++t)for(let y=0;y<r;++y){n=o[y],i=e[n];const w=i.values,A=T[n],E=A.pointer,b=i.componentsPerAttribute;for(let I=0;I<b;++I)E[A.index+I]=w[t*b+I];A.index+=A.strideInComponentType}return{buffer:m,offsetsInBytes:c,vertexSizeInBytes:f}}}ti.fromGeometry=function(e){e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context);const t=e.context,n=g(e.geometry,g.EMPTY_OBJECT),i=g(e.bufferUsage,We.DYNAMIC_DRAW),o=g(e.attributeLocations,g.EMPTY_OBJECT),a=g(e.interleave,!1),r=e.vertexArrayAttributes;let f,c,h;const d=l(r)?r:[],p=n.attributes;if(a){const y=yT(p);if(l(y)){h=Bt.createVertexBuffer({context:t,typedArray:y.buffer,usage:i});const w=y.offsetsInBytes,A=y.vertexSizeInBytes;for(f in p)p.hasOwnProperty(f)&&l(p[f])&&(c=p[f],l(c.values)?d.push({index:o[f],vertexBuffer:h,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:w[f],strideInBytes:A}):d.push({index:o[f],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(f in p)if(p.hasOwnProperty(f)&&l(p[f])){c=p[f];let y=c.componentDatatype;y===he.DOUBLE&&(y=he.FLOAT),h=void 0,l(c.values)&&(h=Bt.createVertexBuffer({context:t,typedArray:he.createTypedArray(y,c.values),usage:i})),d.push({index:o[f],vertexBuffer:h,value:c.value,componentDatatype:y,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let m;const T=n.indices;return l(T)&&(mt.computeNumberOfVertices(n)>=S.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?m=Bt.createIndexBuffer({context:t,typedArray:new Uint32Array(T),usage:i,indexDatatype:bt.UNSIGNED_INT}):m=Bt.createIndexBuffer({context:t,typedArray:new Uint16Array(T),usage:i,indexDatatype:bt.UNSIGNED_SHORT})),new ti({context:t,attributes:d,indexBuffer:m})},Object.defineProperties(ti.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),ti.prototype.getAttribute=function(e){return _.defined("index",e),this._attributes[e]};function CT(e){const t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;const i=t._vertexAttribDivisors,o=e._attributes,a=xe.maximumVertexAttributes;let r;if(n){const f=o.length;for(r=0;r<f;++r){const c=o[r];if(c.enabled){const h=c.instanceDivisor,d=c.index;h!==i[d]&&(t.glVertexAttribDivisor(d,h),i[d]=h)}}}else for(r=0;r<a;++r)i[r]>0&&(t.glVertexAttribDivisor(r,0),i[r]=0)}function wT(e,t){const n=e._attributes,i=n.length;for(let o=0;o<i;++o){const a=n[o];a.enabled&&l(a.value)&&a.vertexAttrib(t)}}ti.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&CT(this),this._hasConstantAttributes&&wT(this,this._gl)):Wu(this._gl,this._attributes,this._indexBuffer)},ti.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{const e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){const i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},ti.prototype.isDestroyed=function(){return!1},ti.prototype.destroy=function(){const e=this._attributes;for(let n=0;n<e.length;++n){const i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}const t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),st(this)};function Dt(e,t,n,i){if(_.defined("context",e),!t||t.length===0)throw new C("At least one attribute is required.");const o=Dt._verifyAttributes(t);n=g(n,0);const a=[],r={};let f,c;const h=o.length;for(let p=0;p<h;++p){const m=o[p];if(m.vertexBuffer){a.push(m);continue}c=m.usage,f=r[c],l(f)||(f=r[c]=[]),f.push(m)}function d(p,m){return he.getSizeInBytes(m.componentDatatype)-he.getSizeInBytes(p.componentDatatype)}this._allBuffers=[];for(c in r)if(r.hasOwnProperty(c)){f=r[c],f.sort(d);const p=Dt._vertexSizeInBytes(f),m=f[0].usage,T={vertexSizeInBytes:p,vertexBuffer:void 0,usage:m,needsCommit:!1,arrayBuffer:void 0,arrayViews:Dt._createArrayViews(f,p)};this._allBuffers.push(T)}this._size=0,this._instanced=g(i,!1),this._precreated=a,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Dt._verifyAttributes=function(e){const t=[];for(let i=0;i<e.length;++i){const o=e[i],a={index:g(o.index,i),enabled:g(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:g(o.componentDatatype,he.FLOAT),normalize:g(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:g(o.usage,We.STATIC_DRAW)};if(t.push(a),a.componentsPerAttribute!==1&&a.componentsPerAttribute!==2&&a.componentsPerAttribute!==3&&a.componentsPerAttribute!==4)throw new C("attribute.componentsPerAttribute must be in the range [1, 4].");const r=a.componentDatatype;if(!he.validate(r))throw new C("Attribute must have a valid componentDatatype or not specify it.");if(!We.validate(a.usage))throw new C("Attribute must have a valid usage or not specify it.")}const n=new Array(t.length);for(let i=0;i<t.length;++i){const a=t[i].index;if(n[a])throw new C(`Index ${a} is used by more than one attribute.`);n[a]=!0}return t},Dt._vertexSizeInBytes=function(e){let t=0;const n=e.length;for(let r=0;r<n;++r){const f=e[r];t+=f.componentsPerAttribute*he.getSizeInBytes(f.componentDatatype)}const i=n>0?he.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,a=o===0?0:i-o;return t+=a,t},Dt._createArrayViews=function(e,t){const n=[];let i=0;const o=e.length;for(let a=0;a<o;++a){const r=e[a],f=r.componentDatatype;n.push({index:r.index,enabled:r.enabled,componentsPerAttribute:r.componentsPerAttribute,componentDatatype:f,normalize:r.normalize,offsetInBytes:i,vertexSizeInComponentType:t/he.getSizeInBytes(f),view:void 0}),i+=r.componentsPerAttribute*he.getSizeInBytes(f)}return n},Dt.prototype.resize=function(e){this._size=e;const t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){const o=t[n];Dt._resize(o,this._size),Dt._appendWriters(this.writers,o)}Fc(this)},Dt._resize=function(e,t){if(e.vertexSizeInBytes>0){const n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){const a=new Uint8Array(n),r=new Uint8Array(e.arrayBuffer),f=r.length;for(let c=0;c<f;++c)a[c]=r[c]}const i=e.arrayViews,o=i.length;for(let a=0;a<o;++a){const r=i[a];r.view=he.createArrayBufferView(r.componentDatatype,n,r.offsetInBytes)}e.arrayBuffer=n}};const AT=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,a){const r=i*n;t[r]=o,t[r+1]=a,e.needsCommit=!0}},function(e,t,n){return function(i,o,a,r){const f=i*n;t[f]=o,t[f+1]=a,t[f+2]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,a,r,f){const c=i*n;t[c]=o,t[c+1]=a,t[c+2]=r,t[c+3]=f,e.needsCommit=!0}}];Dt._appendWriters=function(e,t){const n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){const a=n[o];e[a.index]=AT[a.componentsPerAttribute-1](t,a.view,a.vertexSizeInComponentType)}},Dt.prototype.commit=function(e){let t=!1;const n=this._allBuffers;let i,o,a;for(o=0,a=n.length;o<a;++o)i=n[o],t=ET(this,i)||t;if(t||!l(this.va)){Fc(this);const r=this.va=[],f=S.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/f):1;for(let h=0;h<c;++h){let d=[];for(o=0,a=n.length;o<a;++o){i=n[o];const p=h*(i.vertexSizeInBytes*f);Dt._appendAttributes(d,i,p,this._instanced)}d=d.concat(this._precreated),r.push({va:new ti({context:this._context,attributes:d,indexBuffer:e}),indicesCount:1.5*(h!==c-1?f:this._size%f)})}}};function ET(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;const n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=Bt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Dt._appendAttributes=function(e,t,n,i){const o=t.arrayViews,a=o.length;for(let r=0;r<a;++r){const f=o[r];e.push({index:f.index,enabled:f.enabled,componentsPerAttribute:f.componentsPerAttribute,componentDatatype:f.componentDatatype,normalize:f.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+f.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}},Dt.prototype.subCommit=function(e,t){if(e<0||e>=this._size)throw new C("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new C("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");const n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)bT(n[i],e,t)};function bT(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){const i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Dt.prototype.endSubCommits=function(){const e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function Fc(e){const t=e.va;if(!l(t))return;const n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Dt.prototype.isDestroyed=function(){return!1},Dt.prototype.destroy=function(){const e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){const i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return Fc(this),st(this)};function ni(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new Ne,this.setValue(e)}Object.defineProperties(ni.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),ni.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},ni.prototype.setValue=function(e){const t=this._value;if(t!==e){const n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}},ni.prototype.equals=function(e){return this===e||e instanceof ni&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},ni.prototype.valueOf=function(){return this._value},ni.prototype.toString=function(){return String(this._value)};function xT(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(a){const r=this[t],f=this[n];l(f)&&(f(),this[n]=void 0),a!==void 0&&(!l(a)||!l(a.getValue))&&l(o)&&(a=o(a)),r!==a&&(this[t]=a,this._definitionChanged.raiseEvent(this,e,a,r)),l(a)&&l(a.definitionChanged)&&(this[n]=a.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,a,a)},this))}}}function ST(e){return new ni(e)}function V(e,t,n){return xT(e,`_${e.toString()}`,`_${e.toString()}Subscription`,g(t,!1),g(n,ST))}function ms(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(ms.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),image:V("image"),scale:V("scale"),pixelOffset:V("pixelOffset"),eyeOffset:V("eyeOffset"),horizontalOrigin:V("horizontalOrigin"),verticalOrigin:V("verticalOrigin"),heightReference:V("heightReference"),color:V("color"),rotation:V("rotation"),alignedAxis:V("alignedAxis"),sizeInMeters:V("sizeInMeters"),width:V("width"),height:V("height"),scaleByDistance:V("scaleByDistance"),translucencyByDistance:V("translucencyByDistance"),pixelOffsetScaleByDistance:V("pixelOffsetScaleByDistance"),imageSubRegion:V("imageSubRegion"),distanceDisplayCondition:V("distanceDisplayCondition"),disableDepthTestDistance:V("disableDepthTestDistance"),splitDirection:V("splitDirection")}),ms.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new ms(this)},ms.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this._show,e.show),this.image=g(this._image,e.image),this.scale=g(this._scale,e.scale),this.pixelOffset=g(this._pixelOffset,e.pixelOffset),this.eyeOffset=g(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=g(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=g(this._verticalOrigin,e.verticalOrigin),this.heightReference=g(this._heightReference,e.heightReference),this.color=g(this._color,e.color),this.rotation=g(this._rotation,e.rotation),this.alignedAxis=g(this._alignedAxis,e.alignedAxis),this.sizeInMeters=g(this._sizeInMeters,e.sizeInMeters),this.width=g(this._width,e.width),this.height=g(this._height,e.height),this.scaleByDistance=g(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=g(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=g(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=g(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=g(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=g(this._disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=g(this.splitDirection,e.splitDirection)};function ii(){this._array=[],this._hash={}}Object.defineProperties(ii.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),ii.prototype.contains=function(e){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");return l(this._hash[e])},ii.prototype.set=function(e,t){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");const n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))},ii.prototype.get=function(e){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");return this._hash[e]},ii.prototype.remove=function(e){if(l(e)&&typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");const t=this._hash[e],n=l(t);if(n){const i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n},ii.prototype.removeAll=function(){const e=this._array;e.length>0&&(this._hash={},e.length=0)};function it(e,t){e=g(e,0),this._near=e,t=g(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(it.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}}),it.packedLength=2,it.pack=function(e,t,n){if(!l(e))throw new C("value is required");if(!l(t))throw new C("array is required");return n=g(n,0),t[n++]=e.near,t[n]=e.far,t},it.unpack=function(e,t,n){if(!l(e))throw new C("array is required");return t=g(t,0),l(n)||(n=new it),n.near=e[t++],n.far=e[t],n},it.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far},it.clone=function(e,t){if(l(e))return l(t)||(t=new it),t.near=e.near,t.far=e.far,t},it.prototype.clone=function(e){return it.clone(this,e)},it.prototype.equals=function(e){return it.equals(this,e)};function Ie(e,t,n,i){this.near=g(e,0),this.nearValue=g(t,0),this.far=g(n,1),this.farValue=g(i,0)}Ie.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Ie(e.near,e.nearValue,e.far,e.farValue)},Ie.packedLength=4,Ie.pack=function(e,t,n){if(!l(e))throw new C("value is required");if(!l(t))throw new C("array is required");return n=g(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t},Ie.unpack=function(e,t,n){if(!l(e))throw new C("array is required");return t=g(t,0),l(n)||(n=new Ie),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n},Ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue},Ie.prototype.clone=function(e){return Ie.clone(this,e)},Ie.prototype.equals=function(e){return Ie.equals(this,e)};const oo={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},Ln=Object.freeze(oo);function ta(e){return e===oo.CLAMP_TO_GROUND||e===oo.CLAMP_TO_3D_TILE||e===oo.CLAMP_TO_TERRAIN}function IT(e){return e===oo.RELATIVE_TO_GROUND||e===oo.RELATIVE_TO_3D_TILE||e===oo.RELATIVE_TO_TERRAIN}const Nn=Object.freeze({CENTER:0,LEFT:1,RIGHT:-1}),rt=Object.freeze({CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1});function ve(){C.throwInstantiationError()}Object.defineProperties(ve.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError}}),ve.prototype.getValue=C.throwInstantiationError,ve.prototype.equals=C.throwInstantiationError,ve.equals=function(e,t){return e===t||l(e)&&e.equals(t)},ve.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;const n=e.length;for(let i=0;i<n;i++)if(!ve.equals(e[i],t[i]))return!1;return!0},ve.isConstant=function(e){return!l(e)||e.isConstant},ve.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0},ve.getValueOrDefault=function(e,t,n,i){return l(e)?g(e.getValue(t,i),n):n},ve.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};const Bu=Object.freeze({LEFT:-1,NONE:0,RIGHT:1});function so(e,t){this.start=g(e,0),this.stop=g(t,0)}function te(e,t){this.center=u.clone(g(e,u.ZERO)),this.radius=g(t,0)}const Mc=new u,Uc=new u,kc=new u,Vc=new u,Gc=new u,qc=new u,Hc=new u,Ut=new u,jc=new u,Yc=new u,Xc=new u,$c=new u,DT=4/3*S.PI;te.fromPoints=function(e,t){if(l(t)||(t=new te),!l(e)||e.length===0)return t.center=u.clone(u.ZERO,t.center),t.radius=0,t;const n=u.clone(e[0],Hc),i=u.clone(n,Mc),o=u.clone(n,Uc),a=u.clone(n,kc),r=u.clone(n,Vc),f=u.clone(n,Gc),c=u.clone(n,qc),h=e.length;let d;for(d=1;d<h;d++){u.clone(e[d],n);const N=n.x,U=n.y,M=n.z;N<i.x&&u.clone(n,i),N>r.x&&u.clone(n,r),U<o.y&&u.clone(n,o),U>f.y&&u.clone(n,f),M<a.z&&u.clone(n,a),M>c.z&&u.clone(n,c)}const p=u.magnitudeSquared(u.subtract(r,i,Ut)),m=u.magnitudeSquared(u.subtract(f,o,Ut)),T=u.magnitudeSquared(u.subtract(c,a,Ut));let y=i,w=r,A=p;m>A&&(A=m,y=o,w=f),T>A&&(A=T,y=a,w=c);const E=jc;E.x=(y.x+w.x)*.5,E.y=(y.y+w.y)*.5,E.z=(y.z+w.z)*.5;let b=u.magnitudeSquared(u.subtract(w,E,Ut)),I=Math.sqrt(b);const O=Yc;O.x=i.x,O.y=o.y,O.z=a.z;const B=Xc;B.x=r.x,B.y=f.y,B.z=c.z;const L=u.midpoint(O,B,$c);let F=0;for(d=0;d<h;d++){u.clone(e[d],n);const N=u.magnitude(u.subtract(n,L,Ut));N>F&&(F=N);const U=u.magnitudeSquared(u.subtract(n,E,Ut));if(U>b){const M=Math.sqrt(U);I=(I+M)*.5,b=I*I;const j=M-I;E.x=(I*E.x+j*n.x)/M,E.y=(I*E.y+j*n.y)/M,E.z=(I*E.z+j*n.z)/M}}return I<F?(u.clone(E,t.center),t.radius=I):(u.clone(L,t.center),t.radius=F),t};const Ru=new Wn,OT=new u,vT=new u,Zc=new oe,Kc=new oe;te.fromRectangle2D=function(e,t,n){return te.fromRectangleWithHeights2D(e,t,0,0,n)},te.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new te),!l(e))return o.center=u.clone(u.ZERO,o.center),o.radius=0,o;Ru._ellipsoid=pe.default,t=g(t,Ru),de.southwest(e,Zc),Zc.height=n,de.northeast(e,Kc),Kc.height=i;const a=t.project(Zc,OT),r=t.project(Kc,vT),f=r.x-a.x,c=r.y-a.y,h=r.z-a.z;o.radius=Math.sqrt(f*f+c*c+h*h)*.5;const d=o.center;return d.x=a.x+f*.5,d.y=a.y+c*.5,d.z=a.z+h*.5,o};const WT=[];te.fromRectangle3D=function(e,t,n,i){if(t=g(t,pe.default),n=g(n,0),l(i)||(i=new te),!l(e))return i.center=u.clone(u.ZERO,i.center),i.radius=0,i;const o=de.subsample(e,t,n,WT);return te.fromPoints(o,i)},te.fromVertices=function(e,t,n,i){if(l(i)||(i=new te),!l(e)||e.length===0)return i.center=u.clone(u.ZERO,i.center),i.radius=0,i;t=g(t,u.ZERO),n=g(n,3),_.typeOf.number.greaterThanOrEquals("stride",n,3);const o=Hc;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;const a=u.clone(o,Mc),r=u.clone(o,Uc),f=u.clone(o,kc),c=u.clone(o,Vc),h=u.clone(o,Gc),d=u.clone(o,qc),p=e.length;let m;for(m=0;m<p;m+=n){const M=e[m]+t.x,j=e[m+1]+t.y,Y=e[m+2]+t.z;o.x=M,o.y=j,o.z=Y,M<a.x&&u.clone(o,a),M>c.x&&u.clone(o,c),j<r.y&&u.clone(o,r),j>h.y&&u.clone(o,h),Y<f.z&&u.clone(o,f),Y>d.z&&u.clone(o,d)}const T=u.magnitudeSquared(u.subtract(c,a,Ut)),y=u.magnitudeSquared(u.subtract(h,r,Ut)),w=u.magnitudeSquared(u.subtract(d,f,Ut));let A=a,E=c,b=T;y>b&&(b=y,A=r,E=h),w>b&&(b=w,A=f,E=d);const I=jc;I.x=(A.x+E.x)*.5,I.y=(A.y+E.y)*.5,I.z=(A.z+E.z)*.5;let O=u.magnitudeSquared(u.subtract(E,I,Ut)),B=Math.sqrt(O);const L=Yc;L.x=a.x,L.y=r.y,L.z=f.z;const F=Xc;F.x=c.x,F.y=h.y,F.z=d.z;const N=u.midpoint(L,F,$c);let U=0;for(m=0;m<p;m+=n){o.x=e[m]+t.x,o.y=e[m+1]+t.y,o.z=e[m+2]+t.z;const M=u.magnitude(u.subtract(o,N,Ut));M>U&&(U=M);const j=u.magnitudeSquared(u.subtract(o,I,Ut));if(j>O){const Y=Math.sqrt(j);B=(B+Y)*.5,O=B*B;const s=Y-B;I.x=(B*I.x+s*o.x)/Y,I.y=(B*I.y+s*o.y)/Y,I.z=(B*I.z+s*o.z)/Y}}return B<U?(u.clone(I,i.center),i.radius=B):(u.clone(N,i.center),i.radius=U),i},te.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new te),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=u.clone(u.ZERO,n.center),n.radius=0,n;const i=Hc;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];const o=u.clone(i,Mc),a=u.clone(i,Uc),r=u.clone(i,kc),f=u.clone(i,Vc),c=u.clone(i,Gc),h=u.clone(i,qc),d=e.length;let p;for(p=0;p<d;p+=3){const U=e[p]+t[p],M=e[p+1]+t[p+1],j=e[p+2]+t[p+2];i.x=U,i.y=M,i.z=j,U<o.x&&u.clone(i,o),U>f.x&&u.clone(i,f),M<a.y&&u.clone(i,a),M>c.y&&u.clone(i,c),j<r.z&&u.clone(i,r),j>h.z&&u.clone(i,h)}const m=u.magnitudeSquared(u.subtract(f,o,Ut)),T=u.magnitudeSquared(u.subtract(c,a,Ut)),y=u.magnitudeSquared(u.subtract(h,r,Ut));let w=o,A=f,E=m;T>E&&(E=T,w=a,A=c),y>E&&(E=y,w=r,A=h);const b=jc;b.x=(w.x+A.x)*.5,b.y=(w.y+A.y)*.5,b.z=(w.z+A.z)*.5;let I=u.magnitudeSquared(u.subtract(A,b,Ut)),O=Math.sqrt(I);const B=Yc;B.x=o.x,B.y=a.y,B.z=r.z;const L=Xc;L.x=f.x,L.y=c.y,L.z=h.z;const F=u.midpoint(B,L,$c);let N=0;for(p=0;p<d;p+=3){i.x=e[p]+t[p],i.y=e[p+1]+t[p+1],i.z=e[p+2]+t[p+2];const U=u.magnitude(u.subtract(i,F,Ut));U>N&&(N=U);const M=u.magnitudeSquared(u.subtract(i,b,Ut));if(M>I){const j=Math.sqrt(M);O=(O+j)*.5,I=O*O;const Y=j-O;b.x=(O*b.x+Y*i.x)/j,b.y=(O*b.y+Y*i.y)/j,b.z=(O*b.z+Y*i.z)/j}}return O<N?(u.clone(b,n.center),n.radius=O):(u.clone(F,n.center),n.radius=N),n},te.fromCornerPoints=function(e,t,n){_.typeOf.object("corner",e),_.typeOf.object("oppositeCorner",t),l(n)||(n=new te);const i=u.midpoint(e,t,n.center);return n.radius=u.distance(i,t),n},te.fromEllipsoid=function(e,t){return _.typeOf.object("ellipsoid",e),l(t)||(t=new te),u.clone(u.ZERO,t.center),t.radius=e.maximumRadius,t};const PT=new u;te.fromBoundingSpheres=function(e,t){if(l(t)||(t=new te),!l(e)||e.length===0)return t.center=u.clone(u.ZERO,t.center),t.radius=0,t;const n=e.length;if(n===1)return te.clone(e[0],t);if(n===2)return te.union(e[0],e[1],t);const i=[];let o;for(o=0;o<n;o++)i.push(e[o].center);t=te.fromPoints(i,t);const a=t.center;let r=t.radius;for(o=0;o<n;o++){const f=e[o];r=Math.max(r,u.distance(a,f.center,PT)+f.radius)}return t.radius=r,t};const BT=new u,RT=new u,zT=new u;te.fromOrientedBoundingBox=function(e,t){_.defined("orientedBoundingBox",e),l(t)||(t=new te);const n=e.halfAxes,i=G.getColumn(n,0,BT),o=G.getColumn(n,1,RT),a=G.getColumn(n,2,zT);return u.add(i,o,i),u.add(i,a,i),t.center=u.clone(e.center,t.center),t.radius=u.magnitude(i),t};const LT=new u,NT=new u;te.fromTransformation=function(e,t){_.typeOf.object("transformation",e),l(t)||(t=new te);const n=k.getTranslation(e,LT),i=k.getScale(e,NT),o=.5*u.magnitude(i);return t.center=u.clone(n,t.center),t.radius=o,t},te.clone=function(e,t){if(l(e))return l(t)?(t.center=u.clone(e.center,t.center),t.radius=e.radius,t):new te(e.center,e.radius)},te.packedLength=4,te.pack=function(e,t,n){_.typeOf.object("value",e),_.defined("array",t),n=g(n,0);const i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},te.unpack=function(e,t,n){_.defined("array",e),t=g(t,0),l(n)||(n=new te);const i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};const FT=new u,MT=new u;te.union=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),l(n)||(n=new te);const i=e.center,o=e.radius,a=t.center,r=t.radius,f=u.subtract(a,i,FT),c=u.magnitude(f);if(o>=c+r)return e.clone(n),n;if(r>=c+o)return t.clone(n),n;const h=(o+c+r)*.5,d=u.multiplyByScalar(f,(-o+h)/c,MT);return u.add(d,i,d),u.clone(d,n.center),n.radius=h,n};const UT=new u;te.expand=function(e,t,n){_.typeOf.object("sphere",e),_.typeOf.object("point",t),n=te.clone(e,n);const i=u.magnitude(u.subtract(t,n.center,UT));return i>n.radius&&(n.radius=i),n},te.intersectPlane=function(e,t){_.typeOf.object("sphere",e),_.typeOf.object("plane",t);const n=e.center,i=e.radius,o=t.normal,a=u.dot(o,n)+t.distance;return a<-i?xt.OUTSIDE:a<i?xt.INTERSECTING:xt.INSIDE},te.transform=function(e,t,n){return _.typeOf.object("sphere",e),_.typeOf.object("transform",t),l(n)||(n=new te),n.center=k.multiplyByPoint(t,e.center,n.center),n.radius=k.getMaximumScale(t)*e.radius,n};const kT=new u;te.distanceSquaredTo=function(e,t){_.typeOf.object("sphere",e),_.typeOf.object("cartesian",t);const n=u.subtract(e.center,t,kT),i=u.magnitude(n)-e.radius;return i<=0?0:i*i},te.transformWithoutScale=function(e,t,n){return _.typeOf.object("sphere",e),_.typeOf.object("transform",t),l(n)||(n=new te),n.center=k.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};const VT=new u;te.computePlaneDistances=function(e,t,n,i){_.typeOf.object("sphere",e),_.typeOf.object("position",t),_.typeOf.object("direction",n),l(i)||(i=new so);const o=u.subtract(e.center,t,VT),a=u.dot(n,o);return i.start=a-e.radius,i.stop=a+e.radius,i};const zu=new u,GT=new u,qT=new u,HT=new u,jT=new u,YT=new oe,Lu=new Array(8);for(let e=0;e<8;++e)Lu[e]=new u;const Nu=new Wn;te.projectTo2D=function(e,t,n){_.typeOf.object("sphere",e),Nu._ellipsoid=pe.default,t=g(t,Nu);const i=t.ellipsoid;let o=e.center;const a=e.radius;let r;u.equals(o,u.ZERO)?r=u.clone(u.UNIT_X,zu):r=i.geodeticSurfaceNormal(o,zu);const f=u.cross(u.UNIT_Z,r,GT);u.normalize(f,f);const c=u.cross(r,f,qT);u.normalize(c,c),u.multiplyByScalar(r,a,r),u.multiplyByScalar(c,a,c),u.multiplyByScalar(f,a,f);const h=u.negate(c,jT),d=u.negate(f,HT),p=Lu;let m=p[0];u.add(r,c,m),u.add(m,f,m),m=p[1],u.add(r,c,m),u.add(m,d,m),m=p[2],u.add(r,h,m),u.add(m,d,m),m=p[3],u.add(r,h,m),u.add(m,f,m),u.negate(r,r),m=p[4],u.add(r,c,m),u.add(m,f,m),m=p[5],u.add(r,c,m),u.add(m,d,m),m=p[6],u.add(r,h,m),u.add(m,d,m),m=p[7],u.add(r,h,m),u.add(m,f,m);const T=p.length;for(let E=0;E<T;++E){const b=p[E];u.add(o,b,b);const I=i.cartesianToCartographic(b,YT);t.project(I,b)}n=te.fromPoints(p,n),o=n.center;const y=o.x,w=o.y,A=o.z;return o.x=A,o.y=y,o.z=w,n},te.isOccluded=function(e,t){return _.typeOf.object("sphere",e),_.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)},te.equals=function(e,t){return e===t||l(e)&&l(t)&&u.equals(e.center,t.center)&&e.radius===t.radius},te.prototype.intersectPlane=function(e){return te.intersectPlane(this,e)},te.prototype.distanceSquaredTo=function(e){return te.distanceSquaredTo(this,e)},te.prototype.computePlaneDistances=function(e,t,n){return te.computePlaneDistances(this,e,t,n)},te.prototype.isOccluded=function(e){return te.isOccluded(this,e)},te.prototype.equals=function(e){return te.equals(this,e)},te.prototype.clone=function(e){return te.clone(this,e)},te.prototype.volume=function(){const e=this.radius;return DT*e*e*e};function Fu(e){e=g(e,g.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}const Mu=Object.freeze({NONE:0,TOP:1,ALL:2});function ut(e){e=g(e,g.EMPTY_OBJECT),this.position=g(e.position,!1),this.normal=g(e.normal,!1),this.st=g(e.st,!1),this.bitangent=g(e.bitangent,!1),this.tangent=g(e.tangent,!1),this.color=g(e.color,!1)}ut.POSITION_ONLY=Object.freeze(new ut({position:!0})),ut.POSITION_AND_NORMAL=Object.freeze(new ut({position:!0,normal:!0})),ut.POSITION_NORMAL_AND_ST=Object.freeze(new ut({position:!0,normal:!0,st:!0})),ut.POSITION_AND_ST=Object.freeze(new ut({position:!0,st:!0})),ut.POSITION_AND_COLOR=Object.freeze(new ut({position:!0,color:!0})),ut.ALL=Object.freeze(new ut({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),ut.DEFAULT=ut.POSITION_NORMAL_AND_ST,ut.packedLength=6,ut.pack=function(e,t,n){if(!l(e))throw new C("value is required");if(!l(t))throw new C("array is required");return n=g(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t},ut.unpack=function(e,t,n){if(!l(e))throw new C("array is required");return t=g(t,0),l(n)||(n=new ut),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n},ut.clone=function(e,t){if(l(e))return l(t)||(t=new ut),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};function No(e,t,n,i){e=g(e,1),t=g(t,1),n=g(n,1),i=g(i,1),this.value=new Uint8Array([D.floatToByte(e),D.floatToByte(t),D.floatToByte(n),D.floatToByte(i)])}Object.defineProperties(No.prototype,{componentDatatype:{get:function(){return he.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),No.fromColor=function(e){if(!l(e))throw new C("color is required.");return new No(e.red,e.green,e.blue,e.alpha)},No.toValue=function(e,t){if(!l(e))throw new C("color is required.");return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())},No.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};function na(e){if(e=g(e,g.EMPTY_OBJECT),!l(e.geometry))throw new C("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=k.clone(g(e.modelMatrix,k.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=g(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}function nt(e){e=g(e,g.EMPTY_OBJECT),this.start=l(e.start)?J.clone(e.start):new J,this.stop=l(e.stop)?J.clone(e.stop):new J,this.data=e.data,this.isStartIncluded=g(e.isStartIncluded,!0),this.isStopIncluded=g(e.isStopIncluded,!0)}Object.defineProperties(nt.prototype,{isEmpty:{get:function(){const e=J.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});const Fo={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};nt.fromIso8601=function(e,t){_.typeOf.object("options",e),_.typeOf.string("options.iso8601",e.iso8601);const n=e.iso8601.split("/");if(n.length!==2)throw new C("options.iso8601 is an invalid ISO 8601 interval.");const i=J.fromIso8601(n[0]),o=J.fromIso8601(n[1]),a=g(e.isStartIncluded,!0),r=g(e.isStopIncluded,!0),f=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=a,t.isStopIncluded=r,t.data=f,t):(Fo.start=i,Fo.stop=o,Fo.isStartIncluded=a,Fo.isStopIncluded=r,Fo.data=f,new nt(Fo))},nt.toIso8601=function(e,t){return _.typeOf.object("timeInterval",e),`${J.toIso8601(e.start,t)}/${J.toIso8601(e.stop,t)}`},nt.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new nt(e)},nt.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&J.equals(e.start,t.start)&&J.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))},nt.equalsEpsilon=function(e,t,n,i){return n=g(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&J.equalsEpsilon(e.start,t.start,n)&&J.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))},nt.intersect=function(e,t,n,i){if(_.typeOf.object("left",e),!l(t))return nt.clone(nt.EMPTY,n);const o=e.start,a=e.stop,r=t.start,f=t.stop,c=J.greaterThanOrEquals(r,o)&&J.greaterThanOrEquals(a,r),h=!c&&J.lessThanOrEquals(r,o)&&J.lessThanOrEquals(o,f);if(!c&&!h)return nt.clone(nt.EMPTY,n);const d=e.isStartIncluded,p=e.isStopIncluded,m=t.isStartIncluded,T=t.isStopIncluded,y=J.lessThan(a,f);return l(n)||(n=new nt),n.start=c?r:o,n.isStartIncluded=d&&m||!J.equals(r,o)&&(c&&m||h&&d),n.stop=y?a:f,n.isStopIncluded=y?p:p&&T||!J.equals(f,a)&&T,n.data=l(i)?i(e.data,t.data):e.data,n},nt.contains=function(e,t){if(_.typeOf.object("timeInterval",e),_.typeOf.object("julianDate",t),e.isEmpty)return!1;const n=J.compare(e.start,t);if(n===0)return e.isStartIncluded;const i=J.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0},nt.prototype.clone=function(e){return nt.clone(this,e)},nt.prototype.equals=function(e,t){return nt.equals(this,e,t)},nt.prototype.equalsEpsilon=function(e,t,n){return nt.equalsEpsilon(this,e,t,n)},nt.prototype.toString=function(){return nt.toIso8601(this)},nt.EMPTY=Object.freeze(new nt({start:new J,stop:new J,isStartIncluded:!1,isStopIncluded:!1}));const Uu=Object.freeze(J.fromIso8601("0000-01-01T00:00:00Z")),ku=Object.freeze(J.fromIso8601("9999-12-31T24:00:00Z")),XT=Object.freeze(new nt({start:Uu,stop:ku})),Vi={MINIMUM_VALUE:Uu,MAXIMUM_VALUE:ku,MAXIMUM_INTERVAL:XT};function _s(e,t,n){e=g(e,0),t=g(t,0),n=g(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(_s.prototype,{componentDatatype:{get:function(){return he.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),_s.fromCartesian3=function(e){return _.defined("offset",e),new _s(e.x,e.y,e.z)},_s.toValue=function(e,t){return _.defined("offset",e),l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};const $T={ADD:R.FUNC_ADD,SUBTRACT:R.FUNC_SUBTRACT,REVERSE_SUBTRACT:R.FUNC_REVERSE_SUBTRACT,MIN:R.MIN,MAX:R.MAX},Mo=Object.freeze($T),ZT={ZERO:R.ZERO,ONE:R.ONE,SOURCE_COLOR:R.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:R.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:R.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:R.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:R.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:R.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:R.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:R.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:R.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:R.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:R.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:R.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:R.SRC_ALPHA_SATURATE},xn=Object.freeze(ZT),KT={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Mo.ADD,equationAlpha:Mo.ADD,functionSourceRgb:xn.SOURCE_ALPHA,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:xn.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Mo.ADD,equationAlpha:Mo.ADD,functionSourceRgb:xn.ONE,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:xn.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Mo.ADD,equationAlpha:Mo.ADD,functionSourceRgb:xn.SOURCE_ALPHA,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE,functionDestinationAlpha:xn.ONE})},ro=Object.freeze(KT),QT={FRONT:R.FRONT,BACK:R.BACK,FRONT_AND_BACK:R.FRONT_AND_BACK},Uo=Object.freeze(QT);function Gt(e){e=g(e,g.EMPTY_OBJECT),this.material=e.material,this.translucent=g(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=g(e.closed,!1)}Object.defineProperties(Gt.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),Gt.prototype.getFragmentShaderSource=function(){const e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
3832
- `)},Gt.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent},Gt.prototype.getRenderState=function(){const e=this.isTranslucent(),t=cn(this.renderState,!1);return e?(t.depthMask=!1,t.blending=ro.ALPHA_BLEND):t.depthMask=!0,t},Gt.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=ro.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Uo.BACK}),l(n)&&(i=hn(n,i,!0)),i};const JT=`uniform sampler2D image;
3831
+ ${i}`};function eT(e,t){const n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function Su(e,t){const n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function Iu(e,t){const n=t.length;for(let i=0;i<n;++i){const o=t[i];if(Su(e,o))return o}}const tT=["v_normalEC","v_normal"];Ae.findNormalVarying=function(e){return Su(e,"#ifdef HAS_NORMALS")?eT(e,"HAS_NORMALS")?"v_normalEC":void 0:Iu(e,tT)};const nT=["v_positionEC"];Ae.findPositionVarying=function(e){return Iu(e,nT)};function Mt(e){e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context);const{context:t,source:n,pixelFormat:i=ge.RGBA,pixelDatatype:o=Te.UNSIGNED_BYTE,flipY:a=!0,skipColorSpaceConversion:r=!1,sampler:f=new Jn}=e;let{width:c,height:h}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(h)||(h=n.videoHeight??n.naturalHeight??n.height));const d=e.preMultiplyAlpha||i===ge.RGB||i===ge.LUMINANCE,p=ge.toInternalFormat(i,o,t),m=ge.isCompressedFormat(p);if(!l(c)||!l(h))throw new C("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(_.typeOf.number.greaterThan("width",c,0),c>xe.maximumTextureSize)throw new C(`Width must be less than or equal to the maximum texture size (${xe.maximumTextureSize}). Check maximumTextureSize.`);if(_.typeOf.number.greaterThan("height",h,0),h>xe.maximumTextureSize)throw new C(`Height must be less than or equal to the maximum texture size (${xe.maximumTextureSize}). Check maximumTextureSize.`);if(!ge.validate(i))throw new C("Invalid options.pixelFormat.");if(!m&&!Te.validate(o))throw new C("Invalid options.pixelDatatype.");if(i===ge.DEPTH_COMPONENT&&o!==Te.UNSIGNED_SHORT&&o!==Te.UNSIGNED_INT)throw new C("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(i===ge.DEPTH_STENCIL&&o!==Te.UNSIGNED_INT_24_8)throw new C("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(o===Te.FLOAT&&!t.floatingPointTexture)throw new C("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(o===Te.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new C("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(ge.isDepthFormat(i)){if(l(n))throw new C("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!t.depthTexture)throw new C("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.")}if(m){if(!l(n)||!l(n.arrayBufferView))throw new C("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(ge.isDXTFormat(p)&&!t.s3tc)throw new C("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(ge.isPVRTCFormat(p)&&!t.pvrtc)throw new C("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(ge.isASTCFormat(p)&&!t.astc)throw new C("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(ge.isETC2Format(p)&&!t.etc)throw new C("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");if(ge.isETC1Format(p)&&!t.etc1)throw new C("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");if(ge.isBC7Format(p)&&!t.bc7)throw new C("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(ge.compressedTextureSizeInBytes(p,c,h)!==n.arrayBufferView.byteLength)throw new C("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}const T=t._gl,y=m?ge.compressedTextureSizeInBytes(i,c,h):ge.textureSizeInBytes(i,o,c,h);this._id=Yn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=T.TEXTURE_2D,this._texture=T.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=h,this._dimensions=new q(c,h),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=d,this._flipY=a,this._initialized=!1,this._sampler=void 0,this._sampler=f,Du(this,f),T.activeTexture(T.TEXTURE0),T.bindTexture(this._textureTarget,this._texture),l(n)?(r?T.pixelStorei(T.UNPACK_COLORSPACE_CONVERSION_WEBGL,T.NONE):T.pixelStorei(T.UNPACK_COLORSPACE_CONVERSION_WEBGL,T.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?ge.isCompressedFormat(p)?iT(this,n):oT(this,n):l(n.framebuffer)?sT(this,n):rT(this,n),this._initialized=!0):aT(this),T.bindTexture(this._textureTarget,null)}function iT(e,t){const i=e._context._gl,o=e._textureTarget,a=e._internalFormat,{width:r,height:f}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,a,r,f,0,t.arrayBufferView),l(t.mipLevels)){let c=r,h=f;for(let d=0;d<t.mipLevels.length;++d)c=Jr(c),h=Jr(h),i.compressedTexImage2D(o,d+1,a,c,h,0,t.mipLevels[d])}}function oT(e,t){const n=e._context,i=n._gl,o=e._textureTarget,a=e._internalFormat,{width:r,height:f,pixelFormat:c,pixelDatatype:h,flipY:d}=e,p=ge.alignmentInBytes(c,h,r);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let m=t.arrayBufferView;if(d&&(m=ge.flipY(m,c,h,r,f)),i.texImage2D(o,0,a,r,f,0,c,Te.toWebGLConstant(h,n),m),l(t.mipLevels)){let T=r,y=f;for(let w=0;w<t.mipLevels.length;++w)T=Jr(T),y=Jr(y),i.texImage2D(o,w+1,a,T,y,0,c,Te.toWebGLConstant(h,n),t.mipLevels[w])}}function sT(e,t){const n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function rT(e,t){const n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,Te.toWebGLConstant(e.pixelDatatype,n),t)}function Jr(e){const t=Math.floor(e/2)|0;return Math.max(t,1)}function aT(e){const t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,Te.toWebGLConstant(e._pixelDatatype,t),null)}Mt.create=function(e){return new Mt(e)},Mt.fromFramebuffer=function(e){e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context);const t=e.context,n=t._gl,{pixelFormat:i=ge.RGB,framebufferXOffset:o=0,framebufferYOffset:a=0,width:r=n.drawingBufferWidth,height:f=n.drawingBufferHeight,framebuffer:c}=e;if(!ge.validate(i))throw new C("Invalid pixelFormat.");if(ge.isDepthFormat(i)||ge.isCompressedFormat(i))throw new C("pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.");if(_.defined("options.context",t),_.typeOf.number.greaterThanOrEquals("framebufferXOffset",o,0),_.typeOf.number.greaterThanOrEquals("framebufferYOffset",a,0),o+r>n.drawingBufferWidth)throw new C("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(a+f>n.drawingBufferHeight)throw new C("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new Mt({context:t,width:r,height:f,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:o,yOffset:a,width:r,height:f}})},Object.defineProperties(Mt.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Du(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function Du(e,t){let{minificationFilter:n,magnificationFilter:i}=t;const o=[Vt.NEAREST_MIPMAP_NEAREST,Vt.NEAREST_MIPMAP_LINEAR,Vt.LINEAR_MIPMAP_NEAREST,Vt.LINEAR_MIPMAP_LINEAR].includes(n),a=e._context,r=e._pixelFormat,f=e._pixelDatatype;(f===Te.FLOAT&&!a.textureFloatLinear||f===Te.HALF_FLOAT&&!a.textureHalfFloatLinear)&&(n=o?Vt.NEAREST_MIPMAP_NEAREST:Vt.NEAREST,i=io.NEAREST),a.webgl2&&ge.isDepthFormat(r)&&(n=Vt.NEAREST,i=io.NEAREST);const c=a._gl,h=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(h,e._texture),c.texParameteri(h,c.TEXTURE_MIN_FILTER,n),c.texParameteri(h,c.TEXTURE_MAG_FILTER,i),c.texParameteri(h,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(h,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(h,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(h,null)}Mt.prototype.copyFrom=function(e){_.defined("options",e);const{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(_.defined("options.source",i),ge.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ge.isCompressedFormat(this._pixelFormat))throw new C("Cannot call copyFrom with a compressed texture pixel format.");_.typeOf.number.greaterThanOrEquals("xOffset",t,0),_.typeOf.number.greaterThanOrEquals("yOffset",n,0),_.typeOf.number.lessThanOrEquals("xOffset + options.source.width",t+i.width,this._width),_.typeOf.number.lessThanOrEquals("yOffset + options.source.height",n+i.height,this._height);const a=this._context,r=a._gl,f=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(f,this._texture);let{width:c,height:h}=i;const d=i.arrayBufferView;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,h=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,h=i.naturalHeight);const p=this._width,m=this._height,T=this._internalFormat,y=this._pixelFormat,w=this._pixelDatatype,A=this._preMultiplyAlpha,E=this._flipY;let b=4;l(d)&&(b=ge.alignmentInBytes(y,w,c)),r.pixelStorei(r.UNPACK_ALIGNMENT,b),o?r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE):r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.BROWSER_DEFAULT_WEBGL);let D=!1;if(!this._initialized){let O;t===0&&n===0&&c===p&&h===m?(l(d)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),E?O=ge.flipY(d,y,w,p,m):O=d):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,E),O=i),D=!0):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),O=ge.createTypedArray(y,w,p,m)),r.texImage2D(f,0,T,p,m,0,y,Te.toWebGLConstant(w,a),O),this._initialized=!0}if(!D){let O;l(d)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),E?O=ge.flipY(d,y,w,c,h):O=d):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,E),O=i),r.texSubImage2D(f,0,t,n,c,h,y,Te.toWebGLConstant(w,a),O)}r.bindTexture(f,null)},Mt.prototype.copyFromFramebuffer=function(e,t,n,i,o,a){if(e=g(e,0),t=g(t,0),n=g(n,0),i=g(i,0),o=g(o,this._width),a=g(a,this._height),ge.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===Te.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Te.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(ge.isCompressedFormat(this._pixelFormat))throw new C("Cannot call copyFrom with a compressed texture pixel format.");_.typeOf.number.greaterThanOrEquals("xOffset",e,0),_.typeOf.number.greaterThanOrEquals("yOffset",t,0),_.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),_.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),_.typeOf.number.lessThanOrEquals("xOffset + width",e+o,this._width),_.typeOf.number.lessThanOrEquals("yOffset + height",t+a,this._height);const r=this._context._gl,f=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(f,this._texture),r.copyTexSubImage2D(f,0,e,t,n,i,o,a),r.bindTexture(f,null),this._initialized=!0},Mt.prototype.generateMipmap=function(e){if(e=g(e,Zr.DONT_CARE),ge.isDepthFormat(this._pixelFormat))throw new C("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ge.isCompressedFormat(this._pixelFormat))throw new C("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!S.isPowerOfTwo(this._width))throw new C("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!S.isPowerOfTwo(this._height))throw new C("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!Zr.validate(e))throw new C("hint is invalid.");this._hasMipmap=!0;const t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)},Mt.prototype.isDestroyed=function(){return!1},Mt.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),st(this)};function Qe(){this.high=u.clone(u.ZERO),this.low=u.clone(u.ZERO)}Qe.encode=function(e,t){_.typeOf.number("value",e),l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};const Ci={high:0,low:0};Qe.fromCartesian=function(e,t){_.typeOf.object("cartesian",e),l(t)||(t=new Qe);const n=t.high,i=t.low;return Qe.encode(e.x,Ci),n.x=Ci.high,i.x=Ci.low,Qe.encode(e.y,Ci),n.y=Ci.high,i.y=Ci.low,Qe.encode(e.z,Ci),n.z=Ci.high,i.z=Ci.low,t};const Lc=new Qe;Qe.writeElements=function(e,t,n){_.defined("cartesianArray",t),_.typeOf.number("index",n),_.typeOf.number.greaterThanOrEquals("index",n,0),Qe.fromCartesian(e,Lc);const i=Lc.high,o=Lc.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};function Me(e,t){if(_.typeOf.object("normal",e),!S.equalsEpsilon(u.magnitude(e),1,S.EPSILON6))throw new C("normal must be normalized.");_.typeOf.number("distance",t),this.normal=u.clone(e),this.distance=t}Me.fromPointNormal=function(e,t,n){if(_.typeOf.object("point",e),_.typeOf.object("normal",t),!S.equalsEpsilon(u.magnitude(t),1,S.EPSILON6))throw new C("normal must be normalized.");const i=-u.dot(t,e);return l(n)?(u.clone(t,n.normal),n.distance=i,n):new Me(t,i)};const cT=new u;Me.fromCartesian4=function(e,t){_.typeOf.object("coefficients",e);const n=u.fromCartesian4(e,cT),i=e.w;if(!S.equalsEpsilon(u.magnitude(n),1,S.EPSILON6))throw new C("normal must be normalized.");return l(t)?(u.clone(n,t.normal),t.distance=i,t):new Me(n,i)},Me.getPointDistance=function(e,t){return _.typeOf.object("plane",e),_.typeOf.object("point",t),u.dot(e.normal,t)+e.distance};const hT=new u;Me.projectPointOntoPlane=function(e,t,n){_.typeOf.object("plane",e),_.typeOf.object("point",t),l(n)||(n=new u);const i=Me.getPointDistance(e,t),o=u.multiplyByScalar(e.normal,i,hT);return u.subtract(t,o,n)};const fT=new k,lT=new Z,uT=new u;Me.transform=function(e,t,n){_.typeOf.object("plane",e),_.typeOf.object("transform",t);const i=e.normal,o=e.distance,a=k.inverseTranspose(t,fT);let r=Z.fromElements(i.x,i.y,i.z,o,lT);r=k.multiplyByVector(a,r,r);const f=u.fromCartesian4(r,uT);return r=Z.divideByScalar(r,u.magnitude(f),r),Me.fromCartesian4(r,n)},Me.clone=function(e,t){return _.typeOf.object("plane",e),l(t)?(u.clone(e.normal,t.normal),t.distance=e.distance,t):new Me(e.normal,e.distance)},Me.equals=function(e,t){return _.typeOf.object("left",e),_.typeOf.object("right",t),e.distance===t.distance&&u.equals(e.normal,t.normal)},Me.ORIGIN_XY_PLANE=Object.freeze(new Me(u.UNIT_Z,0)),Me.ORIGIN_YZ_PLANE=Object.freeze(new Me(u.UNIT_X,0)),Me.ORIGIN_ZX_PLANE=Object.freeze(new Me(u.UNIT_Y,0));function bn(e){this.planes=g(e,[])}const ps=[new u,new u,new u];u.clone(u.UNIT_X,ps[0]),u.clone(u.UNIT_Y,ps[1]),u.clone(u.UNIT_Z,ps[2]);const Ui=new u,dT=new u,Ou=new Me(new u(1,0,0),0);bn.fromBoundingSphere=function(e,t){if(!l(e))throw new C("boundingSphere is required.");l(t)||(t=new bn);const n=ps.length,i=t.planes;i.length=2*n;const o=e.center,a=e.radius;let r=0;for(let f=0;f<n;++f){const c=ps[f];let h=i[r],d=i[r+1];l(h)||(h=i[r]=new Z),l(d)||(d=i[r+1]=new Z),u.multiplyByScalar(c,-a,Ui),u.add(o,Ui,Ui),h.x=c.x,h.y=c.y,h.z=c.z,h.w=-u.dot(c,Ui),u.multiplyByScalar(c,a,Ui),u.add(o,Ui,Ui),d.x=-c.x,d.y=-c.y,d.z=-c.z,d.w=-u.dot(u.negate(c,dT),Ui),r+=2}return t},bn.prototype.computeVisibility=function(e){if(!l(e))throw new C("boundingVolume is required.");const t=this.planes;let n=!1;for(let i=0,o=t.length;i<o;++i){const a=e.intersectPlane(Me.fromCartesian4(t[i],Ou));if(a===xt.OUTSIDE)return xt.OUTSIDE;a===xt.INTERSECTING&&(n=!0)}return n?xt.INTERSECTING:xt.INSIDE},bn.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!l(e))throw new C("boundingVolume is required.");if(!l(t))throw new C("parentPlaneMask is required.");if(t===bn.MASK_OUTSIDE||t===bn.MASK_INSIDE)return t;let n=bn.MASK_INSIDE;const i=this.planes;for(let o=0,a=i.length;o<a;++o){const r=o<31?1<<o:0;if(o<31&&!(t&r))continue;const f=e.intersectPlane(Me.fromCartesian4(i[o],Ou));if(f===xt.OUTSIDE)return bn.MASK_OUTSIDE;f===xt.INTERSECTING&&(n|=r)}return n},bn.MASK_OUTSIDE=4294967295,bn.MASK_INSIDE=0,bn.MASK_INDETERMINATE=2147483647;function zn(e){e=g(e,g.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=g(e.near,1),this._near=this.near,this.far=g(e.far,5e8),this._far=this.far,this._cullingVolume=new bn,this._orthographicMatrix=new k}function vu(e){if(!l(e.right)||!l(e.left)||!l(e.top)||!l(e.bottom)||!l(e.near)||!l(e.far))throw new C("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new C("right must be greater than left.");if(e.bottom>e.top)throw new C("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new C("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=k.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(zn.prototype,{projectionMatrix:{get:function(){return vu(this),this._orthographicMatrix}}});const pT=new u,mT=new u,_T=new u,Nc=new u;zn.prototype.computeCullingVolume=function(e,t,n){if(!l(e))throw new C("position is required.");if(!l(t))throw new C("direction is required.");if(!l(n))throw new C("up is required.");const i=this._cullingVolume.planes,o=this.top,a=this.bottom,r=this.right,f=this.left,c=this.near,h=this.far,d=u.cross(t,n,pT);u.normalize(d,d);const p=mT;u.multiplyByScalar(t,c,p),u.add(e,p,p);const m=_T;u.multiplyByScalar(d,f,m),u.add(p,m,m);let T=i[0];return l(T)||(T=i[0]=new Z),T.x=d.x,T.y=d.y,T.z=d.z,T.w=-u.dot(d,m),u.multiplyByScalar(d,r,m),u.add(p,m,m),T=i[1],l(T)||(T=i[1]=new Z),T.x=-d.x,T.y=-d.y,T.z=-d.z,T.w=-u.dot(u.negate(d,Nc),m),u.multiplyByScalar(n,a,m),u.add(p,m,m),T=i[2],l(T)||(T=i[2]=new Z),T.x=n.x,T.y=n.y,T.z=n.z,T.w=-u.dot(n,m),u.multiplyByScalar(n,o,m),u.add(p,m,m),T=i[3],l(T)||(T=i[3]=new Z),T.x=-n.x,T.y=-n.y,T.z=-n.z,T.w=-u.dot(u.negate(n,Nc),m),T=i[4],l(T)||(T=i[4]=new Z),T.x=t.x,T.y=t.y,T.z=t.z,T.w=-u.dot(t,p),u.multiplyByScalar(t,h,m),u.add(e,m,m),T=i[5],l(T)||(T=i[5]=new Z),T.x=-t.x,T.y=-t.y,T.z=-t.z,T.w=-u.dot(u.negate(t,Nc),m),this._cullingVolume},zn.prototype.getPixelDimensions=function(e,t,n,i,o){if(vu(this),!l(e)||!l(t))throw new C("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new C("drawingBufferWidth must be greater than zero.");if(t<=0)throw new C("drawingBufferHeight must be greater than zero.");if(!l(n))throw new C("distance is required.");if(!l(i))throw new C("pixelRatio is required.");if(i<=0)throw new C("pixelRatio must be greater than zero.");if(!l(o))throw new C("A result object is required.");const a=this.right-this.left,r=this.top-this.bottom,f=i*a/e,c=i*r/t;return o.x=f,o.y=c,o},zn.prototype.clone=function(e){return l(e)||(e=new zn),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},zn.prototype.equals=function(e){return l(e)&&e instanceof zn&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},zn.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof zn&&S.equalsEpsilon(this.right,e.right,t,n)&&S.equalsEpsilon(this.left,e.left,t,n)&&S.equalsEpsilon(this.top,e.top,t,n)&&S.equalsEpsilon(this.bottom,e.bottom,t,n)&&S.equalsEpsilon(this.near,e.near,t,n)&&S.equalsEpsilon(this.far,e.far,t,n)};function ln(e){e=g(e,g.EMPTY_OBJECT),this._offCenterFrustum=new zn,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=g(e.near,1),this._near=this.near,this.far=g(e.far,5e8),this._far=this.far}ln.packedLength=4,ln.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t},ln.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new ln),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function ki(e){if(!l(e.width)||!l(e.aspectRatio)||!l(e.near)||!l(e.far))throw new C("width, aspectRatio, near, or far parameters are not set.");const t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new C("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new C("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;const n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(ln.prototype,{projectionMatrix:{get:function(){return ki(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return ki(this),this._offCenterFrustum}}}),ln.prototype.computeCullingVolume=function(e,t,n){return ki(this),this._offCenterFrustum.computeCullingVolume(e,t,n)},ln.prototype.getPixelDimensions=function(e,t,n,i,o){return ki(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)},ln.prototype.clone=function(e){return l(e)||(e=new ln),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},ln.prototype.equals=function(e){return!l(e)||!(e instanceof ln)?!1:(ki(this),ki(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},ln.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof ln)?!1:(ki(this),ki(e),S.equalsEpsilon(this.width,e.width,t,n)&&S.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};const ea={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};ea.getMorphTime=function(e){return e===ea.SCENE3D?1:e===ea.MORPHING?void 0:0};const ye=Object.freeze(ea);function gT(e,t,n,i){const o=l(t.vertexBuffer),a=l(t.value),r=t.value?t.value.length:t.componentsPerAttribute;if(!o&&!a)throw new C("attribute must have a vertexBuffer or a value.");if(o&&a)throw new C("attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.");if(r!==1&&r!==2&&r!==3&&r!==4)throw a?new C("attribute.value.length must be in the range [1, 4]."):new C("attribute.componentsPerAttribute must be in the range [1, 4].");if(l(t.componentDatatype)&&!he.validate(t.componentDatatype))throw new C("attribute must have a valid componentDatatype or not specify it.");if(l(t.strideInBytes)&&t.strideInBytes>255)throw new C("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if(l(t.instanceDivisor)&&t.instanceDivisor>0&&!i.instancedArrays)throw new C("instanced arrays is not supported");if(l(t.instanceDivisor)&&t.instanceDivisor<0)throw new C("attribute must have an instanceDivisor greater than or equal to zero");if(l(t.instanceDivisor)&&a)throw new C("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if(l(t.instanceDivisor)&&t.instanceDivisor>0&&t.index===0)throw new C("attribute zero cannot have an instanceDivisor greater than 0");const f={index:g(t.index,n),enabled:g(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:a?t.value.slice(0):void 0,componentsPerAttribute:r,componentDatatype:g(t.componentDatatype,he.FLOAT),normalize:g(t.normalize,!1),offsetInBytes:g(t.offsetInBytes,0),strideInBytes:g(t.strideInBytes,0),instanceDivisor:g(t.instanceDivisor,0)};if(o)f.vertexAttrib=function(c){const h=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(h,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(h),this.instanceDivisor>0&&(i.glVertexAttribDivisor(h,this.instanceDivisor),i._vertexAttribDivisors[h]=this.instanceDivisor,i._previousDrawInstanced=!0)},f.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(f.componentsPerAttribute){case 1:f.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:f.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:f.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:f.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}f.disableVertexAttribArray=function(c){}}e.push(f)}function Wu(e,t,n){for(let i=0;i<t.length;++i){const o=t[i];o.enabled&&o.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function ei(e){e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context),_.defined("options.attributes",e.attributes);const t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer;let a;const r=[];let f=1,c=!1,h=!1,d=i.length;for(a=0;a<d;++a)gT(r,i[a],a,t);for(d=r.length,a=0;a<d;++a){const T=r[a];if(l(T.vertexBuffer)&&T.instanceDivisor===0){const y=T.strideInBytes||T.componentsPerAttribute*he.getSizeInBytes(T.componentDatatype);f=T.vertexBuffer.sizeInBytes/y;break}}for(a=0;a<d;++a)r[a].instanceDivisor>0&&(c=!0),l(r[a].value)&&(h=!0);const p={};for(a=0;a<d;++a){const T=r[a].index;if(p[T])throw new C(`Index ${T} is used by more than one attribute.`);p[T]=!0}let m;t.vertexArrayObject&&(m=t.glCreateVertexArray(),t.glBindVertexArray(m),Wu(n,r,o),t.glBindVertexArray(null)),this._numberOfVertices=f,this._hasInstancedAttributes=c,this._hasConstantAttributes=h,this._context=t,this._gl=n,this._vao=m,this._attributes=r,this._indexBuffer=o}function Pu(e){return e.values.length/e.componentsPerAttribute}function TT(e){return he.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function yT(e){let t,n,i;const o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===he.DOUBLE&&(e[n].componentDatatype=he.FLOAT,e[n].values=he.createTypedArray(he.FLOAT,e[n].values)));let a;const r=o.length;if(r>0)for(a=Pu(e[o[0]]),t=1;t<r;++t){const h=Pu(e[o[t]]);if(h!==a)throw new dt(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${h.toString()}) than attribute ${o[0]} (${a.toString()}).`)}o.sort(function(h,d){return he.getSizeInBytes(e[d].componentDatatype)-he.getSizeInBytes(e[h].componentDatatype)});let f=0;const c={};for(t=0;t<r;++t)n=o[t],i=e[n],c[n]=f,f+=TT(i);if(f>0){const h=he.getSizeInBytes(e[o[0]].componentDatatype),d=f%h;d!==0&&(f+=h-d);const p=a*f,m=new ArrayBuffer(p),T={};for(t=0;t<r;++t){n=o[t];const y=he.getSizeInBytes(e[n].componentDatatype);T[n]={pointer:he.createTypedArray(e[n].componentDatatype,m),index:c[n]/y,strideInComponentType:f/y}}for(t=0;t<a;++t)for(let y=0;y<r;++y){n=o[y],i=e[n];const w=i.values,A=T[n],E=A.pointer,b=i.componentsPerAttribute;for(let D=0;D<b;++D)E[A.index+D]=w[t*b+D];A.index+=A.strideInComponentType}return{buffer:m,offsetsInBytes:c,vertexSizeInBytes:f}}}ei.fromGeometry=function(e){e=g(e,g.EMPTY_OBJECT),_.defined("options.context",e.context);const t=e.context,n=g(e.geometry,g.EMPTY_OBJECT),i=g(e.bufferUsage,We.DYNAMIC_DRAW),o=g(e.attributeLocations,g.EMPTY_OBJECT),a=g(e.interleave,!1),r=e.vertexArrayAttributes;let f,c,h;const d=l(r)?r:[],p=n.attributes;if(a){const y=yT(p);if(l(y)){h=Bt.createVertexBuffer({context:t,typedArray:y.buffer,usage:i});const w=y.offsetsInBytes,A=y.vertexSizeInBytes;for(f in p)p.hasOwnProperty(f)&&l(p[f])&&(c=p[f],l(c.values)?d.push({index:o[f],vertexBuffer:h,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:w[f],strideInBytes:A}):d.push({index:o[f],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(f in p)if(p.hasOwnProperty(f)&&l(p[f])){c=p[f];let y=c.componentDatatype;y===he.DOUBLE&&(y=he.FLOAT),h=void 0,l(c.values)&&(h=Bt.createVertexBuffer({context:t,typedArray:he.createTypedArray(y,c.values),usage:i})),d.push({index:o[f],vertexBuffer:h,value:c.value,componentDatatype:y,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let m;const T=n.indices;return l(T)&&(mt.computeNumberOfVertices(n)>=S.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?m=Bt.createIndexBuffer({context:t,typedArray:new Uint32Array(T),usage:i,indexDatatype:bt.UNSIGNED_INT}):m=Bt.createIndexBuffer({context:t,typedArray:new Uint16Array(T),usage:i,indexDatatype:bt.UNSIGNED_SHORT})),new ei({context:t,attributes:d,indexBuffer:m})},Object.defineProperties(ei.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),ei.prototype.getAttribute=function(e){return _.defined("index",e),this._attributes[e]};function CT(e){const t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;const i=t._vertexAttribDivisors,o=e._attributes,a=xe.maximumVertexAttributes;let r;if(n){const f=o.length;for(r=0;r<f;++r){const c=o[r];if(c.enabled){const h=c.instanceDivisor,d=c.index;h!==i[d]&&(t.glVertexAttribDivisor(d,h),i[d]=h)}}}else for(r=0;r<a;++r)i[r]>0&&(t.glVertexAttribDivisor(r,0),i[r]=0)}function wT(e,t){const n=e._attributes,i=n.length;for(let o=0;o<i;++o){const a=n[o];a.enabled&&l(a.value)&&a.vertexAttrib(t)}}ei.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&CT(this),this._hasConstantAttributes&&wT(this,this._gl)):Wu(this._gl,this._attributes,this._indexBuffer)},ei.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{const e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){const i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},ei.prototype.isDestroyed=function(){return!1},ei.prototype.destroy=function(){const e=this._attributes;for(let n=0;n<e.length;++n){const i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}const t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),st(this)};function Dt(e,t,n,i){if(_.defined("context",e),!t||t.length===0)throw new C("At least one attribute is required.");const o=Dt._verifyAttributes(t);n=g(n,0);const a=[],r={};let f,c;const h=o.length;for(let p=0;p<h;++p){const m=o[p];if(m.vertexBuffer){a.push(m);continue}c=m.usage,f=r[c],l(f)||(f=r[c]=[]),f.push(m)}function d(p,m){return he.getSizeInBytes(m.componentDatatype)-he.getSizeInBytes(p.componentDatatype)}this._allBuffers=[];for(c in r)if(r.hasOwnProperty(c)){f=r[c],f.sort(d);const p=Dt._vertexSizeInBytes(f),m=f[0].usage,T={vertexSizeInBytes:p,vertexBuffer:void 0,usage:m,needsCommit:!1,arrayBuffer:void 0,arrayViews:Dt._createArrayViews(f,p)};this._allBuffers.push(T)}this._size=0,this._instanced=g(i,!1),this._precreated=a,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Dt._verifyAttributes=function(e){const t=[];for(let i=0;i<e.length;++i){const o=e[i],a={index:g(o.index,i),enabled:g(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:g(o.componentDatatype,he.FLOAT),normalize:g(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:g(o.usage,We.STATIC_DRAW)};if(t.push(a),a.componentsPerAttribute!==1&&a.componentsPerAttribute!==2&&a.componentsPerAttribute!==3&&a.componentsPerAttribute!==4)throw new C("attribute.componentsPerAttribute must be in the range [1, 4].");const r=a.componentDatatype;if(!he.validate(r))throw new C("Attribute must have a valid componentDatatype or not specify it.");if(!We.validate(a.usage))throw new C("Attribute must have a valid usage or not specify it.")}const n=new Array(t.length);for(let i=0;i<t.length;++i){const a=t[i].index;if(n[a])throw new C(`Index ${a} is used by more than one attribute.`);n[a]=!0}return t},Dt._vertexSizeInBytes=function(e){let t=0;const n=e.length;for(let r=0;r<n;++r){const f=e[r];t+=f.componentsPerAttribute*he.getSizeInBytes(f.componentDatatype)}const i=n>0?he.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,a=o===0?0:i-o;return t+=a,t},Dt._createArrayViews=function(e,t){const n=[];let i=0;const o=e.length;for(let a=0;a<o;++a){const r=e[a],f=r.componentDatatype;n.push({index:r.index,enabled:r.enabled,componentsPerAttribute:r.componentsPerAttribute,componentDatatype:f,normalize:r.normalize,offsetInBytes:i,vertexSizeInComponentType:t/he.getSizeInBytes(f),view:void 0}),i+=r.componentsPerAttribute*he.getSizeInBytes(f)}return n},Dt.prototype.resize=function(e){this._size=e;const t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){const o=t[n];Dt._resize(o,this._size),Dt._appendWriters(this.writers,o)}Fc(this)},Dt._resize=function(e,t){if(e.vertexSizeInBytes>0){const n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){const a=new Uint8Array(n),r=new Uint8Array(e.arrayBuffer),f=r.length;for(let c=0;c<f;++c)a[c]=r[c]}const i=e.arrayViews,o=i.length;for(let a=0;a<o;++a){const r=i[a];r.view=he.createArrayBufferView(r.componentDatatype,n,r.offsetInBytes)}e.arrayBuffer=n}};const AT=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,a){const r=i*n;t[r]=o,t[r+1]=a,e.needsCommit=!0}},function(e,t,n){return function(i,o,a,r){const f=i*n;t[f]=o,t[f+1]=a,t[f+2]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,a,r,f){const c=i*n;t[c]=o,t[c+1]=a,t[c+2]=r,t[c+3]=f,e.needsCommit=!0}}];Dt._appendWriters=function(e,t){const n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){const a=n[o];e[a.index]=AT[a.componentsPerAttribute-1](t,a.view,a.vertexSizeInComponentType)}},Dt.prototype.commit=function(e){let t=!1;const n=this._allBuffers;let i,o,a;for(o=0,a=n.length;o<a;++o)i=n[o],t=ET(this,i)||t;if(t||!l(this.va)){Fc(this);const r=this.va=[],f=S.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/f):1;for(let h=0;h<c;++h){let d=[];for(o=0,a=n.length;o<a;++o){i=n[o];const p=h*(i.vertexSizeInBytes*f);Dt._appendAttributes(d,i,p,this._instanced)}d=d.concat(this._precreated),r.push({va:new ei({context:this._context,attributes:d,indexBuffer:e}),indicesCount:1.5*(h!==c-1?f:this._size%f)})}}};function ET(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;const n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=Bt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Dt._appendAttributes=function(e,t,n,i){const o=t.arrayViews,a=o.length;for(let r=0;r<a;++r){const f=o[r];e.push({index:f.index,enabled:f.enabled,componentsPerAttribute:f.componentsPerAttribute,componentDatatype:f.componentDatatype,normalize:f.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+f.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}},Dt.prototype.subCommit=function(e,t){if(e<0||e>=this._size)throw new C("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new C("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");const n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)bT(n[i],e,t)};function bT(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){const i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Dt.prototype.endSubCommits=function(){const e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function Fc(e){const t=e.va;if(!l(t))return;const n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Dt.prototype.isDestroyed=function(){return!1},Dt.prototype.destroy=function(){const e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){const i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return Fc(this),st(this)};function ti(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new Ne,this.setValue(e)}Object.defineProperties(ti.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),ti.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},ti.prototype.setValue=function(e){const t=this._value;if(t!==e){const n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}},ti.prototype.equals=function(e){return this===e||e instanceof ti&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},ti.prototype.valueOf=function(){return this._value},ti.prototype.toString=function(){return String(this._value)};function xT(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(a){const r=this[t],f=this[n];l(f)&&(f(),this[n]=void 0),a!==void 0&&(!l(a)||!l(a.getValue))&&l(o)&&(a=o(a)),r!==a&&(this[t]=a,this._definitionChanged.raiseEvent(this,e,a,r)),l(a)&&l(a.definitionChanged)&&(this[n]=a.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,a,a)},this))}}}function ST(e){return new ti(e)}function V(e,t,n){return xT(e,`_${e.toString()}`,`_${e.toString()}Subscription`,g(t,!1),g(n,ST))}function ms(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(ms.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),image:V("image"),scale:V("scale"),pixelOffset:V("pixelOffset"),eyeOffset:V("eyeOffset"),horizontalOrigin:V("horizontalOrigin"),verticalOrigin:V("verticalOrigin"),heightReference:V("heightReference"),color:V("color"),rotation:V("rotation"),alignedAxis:V("alignedAxis"),sizeInMeters:V("sizeInMeters"),width:V("width"),height:V("height"),scaleByDistance:V("scaleByDistance"),translucencyByDistance:V("translucencyByDistance"),pixelOffsetScaleByDistance:V("pixelOffsetScaleByDistance"),imageSubRegion:V("imageSubRegion"),distanceDisplayCondition:V("distanceDisplayCondition"),disableDepthTestDistance:V("disableDepthTestDistance"),splitDirection:V("splitDirection")}),ms.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new ms(this)},ms.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this._show,e.show),this.image=g(this._image,e.image),this.scale=g(this._scale,e.scale),this.pixelOffset=g(this._pixelOffset,e.pixelOffset),this.eyeOffset=g(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=g(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=g(this._verticalOrigin,e.verticalOrigin),this.heightReference=g(this._heightReference,e.heightReference),this.color=g(this._color,e.color),this.rotation=g(this._rotation,e.rotation),this.alignedAxis=g(this._alignedAxis,e.alignedAxis),this.sizeInMeters=g(this._sizeInMeters,e.sizeInMeters),this.width=g(this._width,e.width),this.height=g(this._height,e.height),this.scaleByDistance=g(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=g(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=g(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=g(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=g(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=g(this._disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=g(this.splitDirection,e.splitDirection)};function ni(){this._array=[],this._hash={}}Object.defineProperties(ni.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),ni.prototype.contains=function(e){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");return l(this._hash[e])},ni.prototype.set=function(e,t){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");const n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))},ni.prototype.get=function(e){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");return this._hash[e]},ni.prototype.remove=function(e){if(l(e)&&typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");const t=this._hash[e],n=l(t);if(n){const i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n},ni.prototype.removeAll=function(){const e=this._array;e.length>0&&(this._hash={},e.length=0)};function it(e,t){e=g(e,0),this._near=e,t=g(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(it.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}}),it.packedLength=2,it.pack=function(e,t,n){if(!l(e))throw new C("value is required");if(!l(t))throw new C("array is required");return n=g(n,0),t[n++]=e.near,t[n]=e.far,t},it.unpack=function(e,t,n){if(!l(e))throw new C("array is required");return t=g(t,0),l(n)||(n=new it),n.near=e[t++],n.far=e[t],n},it.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far},it.clone=function(e,t){if(l(e))return l(t)||(t=new it),t.near=e.near,t.far=e.far,t},it.prototype.clone=function(e){return it.clone(this,e)},it.prototype.equals=function(e){return it.equals(this,e)};function Ie(e,t,n,i){this.near=g(e,0),this.nearValue=g(t,0),this.far=g(n,1),this.farValue=g(i,0)}Ie.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Ie(e.near,e.nearValue,e.far,e.farValue)},Ie.packedLength=4,Ie.pack=function(e,t,n){if(!l(e))throw new C("value is required");if(!l(t))throw new C("array is required");return n=g(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t},Ie.unpack=function(e,t,n){if(!l(e))throw new C("array is required");return t=g(t,0),l(n)||(n=new Ie),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n},Ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue},Ie.prototype.clone=function(e){return Ie.clone(this,e)},Ie.prototype.equals=function(e){return Ie.equals(this,e)};const oo={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},ii=Object.freeze(oo);function ta(e){return e===oo.CLAMP_TO_GROUND||e===oo.CLAMP_TO_3D_TILE||e===oo.CLAMP_TO_TERRAIN}function IT(e){return e===oo.RELATIVE_TO_GROUND||e===oo.RELATIVE_TO_3D_TILE||e===oo.RELATIVE_TO_TERRAIN}const Ln=Object.freeze({CENTER:0,LEFT:1,RIGHT:-1}),rt=Object.freeze({CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1});function ve(){C.throwInstantiationError()}Object.defineProperties(ve.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError}}),ve.prototype.getValue=C.throwInstantiationError,ve.prototype.equals=C.throwInstantiationError,ve.equals=function(e,t){return e===t||l(e)&&e.equals(t)},ve.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;const n=e.length;for(let i=0;i<n;i++)if(!ve.equals(e[i],t[i]))return!1;return!0},ve.isConstant=function(e){return!l(e)||e.isConstant},ve.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0},ve.getValueOrDefault=function(e,t,n,i){return l(e)?g(e.getValue(t,i),n):n},ve.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};const Bu=Object.freeze({LEFT:-1,NONE:0,RIGHT:1});function so(e,t){this.start=g(e,0),this.stop=g(t,0)}function te(e,t){this.center=u.clone(g(e,u.ZERO)),this.radius=g(t,0)}const Mc=new u,Uc=new u,kc=new u,Vc=new u,Gc=new u,qc=new u,Hc=new u,Ut=new u,jc=new u,Yc=new u,Xc=new u,$c=new u,DT=4/3*S.PI;te.fromPoints=function(e,t){if(l(t)||(t=new te),!l(e)||e.length===0)return t.center=u.clone(u.ZERO,t.center),t.radius=0,t;const n=u.clone(e[0],Hc),i=u.clone(n,Mc),o=u.clone(n,Uc),a=u.clone(n,kc),r=u.clone(n,Vc),f=u.clone(n,Gc),c=u.clone(n,qc),h=e.length;let d;for(d=1;d<h;d++){u.clone(e[d],n);const N=n.x,U=n.y,M=n.z;N<i.x&&u.clone(n,i),N>r.x&&u.clone(n,r),U<o.y&&u.clone(n,o),U>f.y&&u.clone(n,f),M<a.z&&u.clone(n,a),M>c.z&&u.clone(n,c)}const p=u.magnitudeSquared(u.subtract(r,i,Ut)),m=u.magnitudeSquared(u.subtract(f,o,Ut)),T=u.magnitudeSquared(u.subtract(c,a,Ut));let y=i,w=r,A=p;m>A&&(A=m,y=o,w=f),T>A&&(A=T,y=a,w=c);const E=jc;E.x=(y.x+w.x)*.5,E.y=(y.y+w.y)*.5,E.z=(y.z+w.z)*.5;let b=u.magnitudeSquared(u.subtract(w,E,Ut)),D=Math.sqrt(b);const O=Yc;O.x=i.x,O.y=o.y,O.z=a.z;const B=Xc;B.x=r.x,B.y=f.y,B.z=c.z;const L=u.midpoint(O,B,$c);let F=0;for(d=0;d<h;d++){u.clone(e[d],n);const N=u.magnitude(u.subtract(n,L,Ut));N>F&&(F=N);const U=u.magnitudeSquared(u.subtract(n,E,Ut));if(U>b){const M=Math.sqrt(U);D=(D+M)*.5,b=D*D;const j=M-D;E.x=(D*E.x+j*n.x)/M,E.y=(D*E.y+j*n.y)/M,E.z=(D*E.z+j*n.z)/M}}return D<F?(u.clone(E,t.center),t.radius=D):(u.clone(L,t.center),t.radius=F),t};const Ru=new Wn,OT=new u,vT=new u,Zc=new oe,Kc=new oe;te.fromRectangle2D=function(e,t,n){return te.fromRectangleWithHeights2D(e,t,0,0,n)},te.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new te),!l(e))return o.center=u.clone(u.ZERO,o.center),o.radius=0,o;Ru._ellipsoid=pe.default,t=g(t,Ru),de.southwest(e,Zc),Zc.height=n,de.northeast(e,Kc),Kc.height=i;const a=t.project(Zc,OT),r=t.project(Kc,vT),f=r.x-a.x,c=r.y-a.y,h=r.z-a.z;o.radius=Math.sqrt(f*f+c*c+h*h)*.5;const d=o.center;return d.x=a.x+f*.5,d.y=a.y+c*.5,d.z=a.z+h*.5,o};const WT=[];te.fromRectangle3D=function(e,t,n,i){if(t=g(t,pe.default),n=g(n,0),l(i)||(i=new te),!l(e))return i.center=u.clone(u.ZERO,i.center),i.radius=0,i;const o=de.subsample(e,t,n,WT);return te.fromPoints(o,i)},te.fromVertices=function(e,t,n,i){if(l(i)||(i=new te),!l(e)||e.length===0)return i.center=u.clone(u.ZERO,i.center),i.radius=0,i;t=g(t,u.ZERO),n=g(n,3),_.typeOf.number.greaterThanOrEquals("stride",n,3);const o=Hc;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;const a=u.clone(o,Mc),r=u.clone(o,Uc),f=u.clone(o,kc),c=u.clone(o,Vc),h=u.clone(o,Gc),d=u.clone(o,qc),p=e.length;let m;for(m=0;m<p;m+=n){const M=e[m]+t.x,j=e[m+1]+t.y,Y=e[m+2]+t.z;o.x=M,o.y=j,o.z=Y,M<a.x&&u.clone(o,a),M>c.x&&u.clone(o,c),j<r.y&&u.clone(o,r),j>h.y&&u.clone(o,h),Y<f.z&&u.clone(o,f),Y>d.z&&u.clone(o,d)}const T=u.magnitudeSquared(u.subtract(c,a,Ut)),y=u.magnitudeSquared(u.subtract(h,r,Ut)),w=u.magnitudeSquared(u.subtract(d,f,Ut));let A=a,E=c,b=T;y>b&&(b=y,A=r,E=h),w>b&&(b=w,A=f,E=d);const D=jc;D.x=(A.x+E.x)*.5,D.y=(A.y+E.y)*.5,D.z=(A.z+E.z)*.5;let O=u.magnitudeSquared(u.subtract(E,D,Ut)),B=Math.sqrt(O);const L=Yc;L.x=a.x,L.y=r.y,L.z=f.z;const F=Xc;F.x=c.x,F.y=h.y,F.z=d.z;const N=u.midpoint(L,F,$c);let U=0;for(m=0;m<p;m+=n){o.x=e[m]+t.x,o.y=e[m+1]+t.y,o.z=e[m+2]+t.z;const M=u.magnitude(u.subtract(o,N,Ut));M>U&&(U=M);const j=u.magnitudeSquared(u.subtract(o,D,Ut));if(j>O){const Y=Math.sqrt(j);B=(B+Y)*.5,O=B*B;const s=Y-B;D.x=(B*D.x+s*o.x)/Y,D.y=(B*D.y+s*o.y)/Y,D.z=(B*D.z+s*o.z)/Y}}return B<U?(u.clone(D,i.center),i.radius=B):(u.clone(N,i.center),i.radius=U),i},te.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new te),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=u.clone(u.ZERO,n.center),n.radius=0,n;const i=Hc;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];const o=u.clone(i,Mc),a=u.clone(i,Uc),r=u.clone(i,kc),f=u.clone(i,Vc),c=u.clone(i,Gc),h=u.clone(i,qc),d=e.length;let p;for(p=0;p<d;p+=3){const U=e[p]+t[p],M=e[p+1]+t[p+1],j=e[p+2]+t[p+2];i.x=U,i.y=M,i.z=j,U<o.x&&u.clone(i,o),U>f.x&&u.clone(i,f),M<a.y&&u.clone(i,a),M>c.y&&u.clone(i,c),j<r.z&&u.clone(i,r),j>h.z&&u.clone(i,h)}const m=u.magnitudeSquared(u.subtract(f,o,Ut)),T=u.magnitudeSquared(u.subtract(c,a,Ut)),y=u.magnitudeSquared(u.subtract(h,r,Ut));let w=o,A=f,E=m;T>E&&(E=T,w=a,A=c),y>E&&(E=y,w=r,A=h);const b=jc;b.x=(w.x+A.x)*.5,b.y=(w.y+A.y)*.5,b.z=(w.z+A.z)*.5;let D=u.magnitudeSquared(u.subtract(A,b,Ut)),O=Math.sqrt(D);const B=Yc;B.x=o.x,B.y=a.y,B.z=r.z;const L=Xc;L.x=f.x,L.y=c.y,L.z=h.z;const F=u.midpoint(B,L,$c);let N=0;for(p=0;p<d;p+=3){i.x=e[p]+t[p],i.y=e[p+1]+t[p+1],i.z=e[p+2]+t[p+2];const U=u.magnitude(u.subtract(i,F,Ut));U>N&&(N=U);const M=u.magnitudeSquared(u.subtract(i,b,Ut));if(M>D){const j=Math.sqrt(M);O=(O+j)*.5,D=O*O;const Y=j-O;b.x=(O*b.x+Y*i.x)/j,b.y=(O*b.y+Y*i.y)/j,b.z=(O*b.z+Y*i.z)/j}}return O<N?(u.clone(b,n.center),n.radius=O):(u.clone(F,n.center),n.radius=N),n},te.fromCornerPoints=function(e,t,n){_.typeOf.object("corner",e),_.typeOf.object("oppositeCorner",t),l(n)||(n=new te);const i=u.midpoint(e,t,n.center);return n.radius=u.distance(i,t),n},te.fromEllipsoid=function(e,t){return _.typeOf.object("ellipsoid",e),l(t)||(t=new te),u.clone(u.ZERO,t.center),t.radius=e.maximumRadius,t};const PT=new u;te.fromBoundingSpheres=function(e,t){if(l(t)||(t=new te),!l(e)||e.length===0)return t.center=u.clone(u.ZERO,t.center),t.radius=0,t;const n=e.length;if(n===1)return te.clone(e[0],t);if(n===2)return te.union(e[0],e[1],t);const i=[];let o;for(o=0;o<n;o++)i.push(e[o].center);t=te.fromPoints(i,t);const a=t.center;let r=t.radius;for(o=0;o<n;o++){const f=e[o];r=Math.max(r,u.distance(a,f.center,PT)+f.radius)}return t.radius=r,t};const BT=new u,RT=new u,zT=new u;te.fromOrientedBoundingBox=function(e,t){_.defined("orientedBoundingBox",e),l(t)||(t=new te);const n=e.halfAxes,i=G.getColumn(n,0,BT),o=G.getColumn(n,1,RT),a=G.getColumn(n,2,zT);return u.add(i,o,i),u.add(i,a,i),t.center=u.clone(e.center,t.center),t.radius=u.magnitude(i),t};const LT=new u,NT=new u;te.fromTransformation=function(e,t){_.typeOf.object("transformation",e),l(t)||(t=new te);const n=k.getTranslation(e,LT),i=k.getScale(e,NT),o=.5*u.magnitude(i);return t.center=u.clone(n,t.center),t.radius=o,t},te.clone=function(e,t){if(l(e))return l(t)?(t.center=u.clone(e.center,t.center),t.radius=e.radius,t):new te(e.center,e.radius)},te.packedLength=4,te.pack=function(e,t,n){_.typeOf.object("value",e),_.defined("array",t),n=g(n,0);const i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},te.unpack=function(e,t,n){_.defined("array",e),t=g(t,0),l(n)||(n=new te);const i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};const FT=new u,MT=new u;te.union=function(e,t,n){_.typeOf.object("left",e),_.typeOf.object("right",t),l(n)||(n=new te);const i=e.center,o=e.radius,a=t.center,r=t.radius,f=u.subtract(a,i,FT),c=u.magnitude(f);if(o>=c+r)return e.clone(n),n;if(r>=c+o)return t.clone(n),n;const h=(o+c+r)*.5,d=u.multiplyByScalar(f,(-o+h)/c,MT);return u.add(d,i,d),u.clone(d,n.center),n.radius=h,n};const UT=new u;te.expand=function(e,t,n){_.typeOf.object("sphere",e),_.typeOf.object("point",t),n=te.clone(e,n);const i=u.magnitude(u.subtract(t,n.center,UT));return i>n.radius&&(n.radius=i),n},te.intersectPlane=function(e,t){_.typeOf.object("sphere",e),_.typeOf.object("plane",t);const n=e.center,i=e.radius,o=t.normal,a=u.dot(o,n)+t.distance;return a<-i?xt.OUTSIDE:a<i?xt.INTERSECTING:xt.INSIDE},te.transform=function(e,t,n){return _.typeOf.object("sphere",e),_.typeOf.object("transform",t),l(n)||(n=new te),n.center=k.multiplyByPoint(t,e.center,n.center),n.radius=k.getMaximumScale(t)*e.radius,n};const kT=new u;te.distanceSquaredTo=function(e,t){_.typeOf.object("sphere",e),_.typeOf.object("cartesian",t);const n=u.subtract(e.center,t,kT),i=u.magnitude(n)-e.radius;return i<=0?0:i*i},te.transformWithoutScale=function(e,t,n){return _.typeOf.object("sphere",e),_.typeOf.object("transform",t),l(n)||(n=new te),n.center=k.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};const VT=new u;te.computePlaneDistances=function(e,t,n,i){_.typeOf.object("sphere",e),_.typeOf.object("position",t),_.typeOf.object("direction",n),l(i)||(i=new so);const o=u.subtract(e.center,t,VT),a=u.dot(n,o);return i.start=a-e.radius,i.stop=a+e.radius,i};const zu=new u,GT=new u,qT=new u,HT=new u,jT=new u,YT=new oe,Lu=new Array(8);for(let e=0;e<8;++e)Lu[e]=new u;const Nu=new Wn;te.projectTo2D=function(e,t,n){_.typeOf.object("sphere",e),Nu._ellipsoid=pe.default,t=g(t,Nu);const i=t.ellipsoid;let o=e.center;const a=e.radius;let r;u.equals(o,u.ZERO)?r=u.clone(u.UNIT_X,zu):r=i.geodeticSurfaceNormal(o,zu);const f=u.cross(u.UNIT_Z,r,GT);u.normalize(f,f);const c=u.cross(r,f,qT);u.normalize(c,c),u.multiplyByScalar(r,a,r),u.multiplyByScalar(c,a,c),u.multiplyByScalar(f,a,f);const h=u.negate(c,jT),d=u.negate(f,HT),p=Lu;let m=p[0];u.add(r,c,m),u.add(m,f,m),m=p[1],u.add(r,c,m),u.add(m,d,m),m=p[2],u.add(r,h,m),u.add(m,d,m),m=p[3],u.add(r,h,m),u.add(m,f,m),u.negate(r,r),m=p[4],u.add(r,c,m),u.add(m,f,m),m=p[5],u.add(r,c,m),u.add(m,d,m),m=p[6],u.add(r,h,m),u.add(m,d,m),m=p[7],u.add(r,h,m),u.add(m,f,m);const T=p.length;for(let E=0;E<T;++E){const b=p[E];u.add(o,b,b);const D=i.cartesianToCartographic(b,YT);t.project(D,b)}n=te.fromPoints(p,n),o=n.center;const y=o.x,w=o.y,A=o.z;return o.x=A,o.y=y,o.z=w,n},te.isOccluded=function(e,t){return _.typeOf.object("sphere",e),_.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)},te.equals=function(e,t){return e===t||l(e)&&l(t)&&u.equals(e.center,t.center)&&e.radius===t.radius},te.prototype.intersectPlane=function(e){return te.intersectPlane(this,e)},te.prototype.distanceSquaredTo=function(e){return te.distanceSquaredTo(this,e)},te.prototype.computePlaneDistances=function(e,t,n){return te.computePlaneDistances(this,e,t,n)},te.prototype.isOccluded=function(e){return te.isOccluded(this,e)},te.prototype.equals=function(e){return te.equals(this,e)},te.prototype.clone=function(e){return te.clone(this,e)},te.prototype.volume=function(){const e=this.radius;return DT*e*e*e};function Fu(e){e=g(e,g.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}const Mu=Object.freeze({NONE:0,TOP:1,ALL:2});function ut(e){e=g(e,g.EMPTY_OBJECT),this.position=g(e.position,!1),this.normal=g(e.normal,!1),this.st=g(e.st,!1),this.bitangent=g(e.bitangent,!1),this.tangent=g(e.tangent,!1),this.color=g(e.color,!1)}ut.POSITION_ONLY=Object.freeze(new ut({position:!0})),ut.POSITION_AND_NORMAL=Object.freeze(new ut({position:!0,normal:!0})),ut.POSITION_NORMAL_AND_ST=Object.freeze(new ut({position:!0,normal:!0,st:!0})),ut.POSITION_AND_ST=Object.freeze(new ut({position:!0,st:!0})),ut.POSITION_AND_COLOR=Object.freeze(new ut({position:!0,color:!0})),ut.ALL=Object.freeze(new ut({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),ut.DEFAULT=ut.POSITION_NORMAL_AND_ST,ut.packedLength=6,ut.pack=function(e,t,n){if(!l(e))throw new C("value is required");if(!l(t))throw new C("array is required");return n=g(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t},ut.unpack=function(e,t,n){if(!l(e))throw new C("array is required");return t=g(t,0),l(n)||(n=new ut),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n},ut.clone=function(e,t){if(l(e))return l(t)||(t=new ut),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};function Lo(e,t,n,i){e=g(e,1),t=g(t,1),n=g(n,1),i=g(i,1),this.value=new Uint8Array([I.floatToByte(e),I.floatToByte(t),I.floatToByte(n),I.floatToByte(i)])}Object.defineProperties(Lo.prototype,{componentDatatype:{get:function(){return he.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),Lo.fromColor=function(e){if(!l(e))throw new C("color is required.");return new Lo(e.red,e.green,e.blue,e.alpha)},Lo.toValue=function(e,t){if(!l(e))throw new C("color is required.");return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())},Lo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};function na(e){if(e=g(e,g.EMPTY_OBJECT),!l(e.geometry))throw new C("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=k.clone(g(e.modelMatrix,k.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=g(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}function nt(e){e=g(e,g.EMPTY_OBJECT),this.start=l(e.start)?J.clone(e.start):new J,this.stop=l(e.stop)?J.clone(e.stop):new J,this.data=e.data,this.isStartIncluded=g(e.isStartIncluded,!0),this.isStopIncluded=g(e.isStopIncluded,!0)}Object.defineProperties(nt.prototype,{isEmpty:{get:function(){const e=J.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});const No={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};nt.fromIso8601=function(e,t){_.typeOf.object("options",e),_.typeOf.string("options.iso8601",e.iso8601);const n=e.iso8601.split("/");if(n.length!==2)throw new C("options.iso8601 is an invalid ISO 8601 interval.");const i=J.fromIso8601(n[0]),o=J.fromIso8601(n[1]),a=g(e.isStartIncluded,!0),r=g(e.isStopIncluded,!0),f=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=a,t.isStopIncluded=r,t.data=f,t):(No.start=i,No.stop=o,No.isStartIncluded=a,No.isStopIncluded=r,No.data=f,new nt(No))},nt.toIso8601=function(e,t){return _.typeOf.object("timeInterval",e),`${J.toIso8601(e.start,t)}/${J.toIso8601(e.stop,t)}`},nt.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new nt(e)},nt.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&J.equals(e.start,t.start)&&J.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))},nt.equalsEpsilon=function(e,t,n,i){return n=g(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&J.equalsEpsilon(e.start,t.start,n)&&J.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))},nt.intersect=function(e,t,n,i){if(_.typeOf.object("left",e),!l(t))return nt.clone(nt.EMPTY,n);const o=e.start,a=e.stop,r=t.start,f=t.stop,c=J.greaterThanOrEquals(r,o)&&J.greaterThanOrEquals(a,r),h=!c&&J.lessThanOrEquals(r,o)&&J.lessThanOrEquals(o,f);if(!c&&!h)return nt.clone(nt.EMPTY,n);const d=e.isStartIncluded,p=e.isStopIncluded,m=t.isStartIncluded,T=t.isStopIncluded,y=J.lessThan(a,f);return l(n)||(n=new nt),n.start=c?r:o,n.isStartIncluded=d&&m||!J.equals(r,o)&&(c&&m||h&&d),n.stop=y?a:f,n.isStopIncluded=y?p:p&&T||!J.equals(f,a)&&T,n.data=l(i)?i(e.data,t.data):e.data,n},nt.contains=function(e,t){if(_.typeOf.object("timeInterval",e),_.typeOf.object("julianDate",t),e.isEmpty)return!1;const n=J.compare(e.start,t);if(n===0)return e.isStartIncluded;const i=J.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0},nt.prototype.clone=function(e){return nt.clone(this,e)},nt.prototype.equals=function(e,t){return nt.equals(this,e,t)},nt.prototype.equalsEpsilon=function(e,t,n){return nt.equalsEpsilon(this,e,t,n)},nt.prototype.toString=function(){return nt.toIso8601(this)},nt.EMPTY=Object.freeze(new nt({start:new J,stop:new J,isStartIncluded:!1,isStopIncluded:!1}));const Uu=Object.freeze(J.fromIso8601("0000-01-01T00:00:00Z")),ku=Object.freeze(J.fromIso8601("9999-12-31T24:00:00Z")),XT=Object.freeze(new nt({start:Uu,stop:ku})),Vi={MINIMUM_VALUE:Uu,MAXIMUM_VALUE:ku,MAXIMUM_INTERVAL:XT};function _s(e,t,n){e=g(e,0),t=g(t,0),n=g(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(_s.prototype,{componentDatatype:{get:function(){return he.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),_s.fromCartesian3=function(e){return _.defined("offset",e),new _s(e.x,e.y,e.z)},_s.toValue=function(e,t){return _.defined("offset",e),l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};const $T={ADD:R.FUNC_ADD,SUBTRACT:R.FUNC_SUBTRACT,REVERSE_SUBTRACT:R.FUNC_REVERSE_SUBTRACT,MIN:R.MIN,MAX:R.MAX},Fo=Object.freeze($T),ZT={ZERO:R.ZERO,ONE:R.ONE,SOURCE_COLOR:R.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:R.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:R.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:R.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:R.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:R.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:R.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:R.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:R.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:R.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:R.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:R.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:R.SRC_ALPHA_SATURATE},xn=Object.freeze(ZT),KT={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Fo.ADD,equationAlpha:Fo.ADD,functionSourceRgb:xn.SOURCE_ALPHA,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:xn.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Fo.ADD,equationAlpha:Fo.ADD,functionSourceRgb:xn.ONE,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:xn.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Fo.ADD,equationAlpha:Fo.ADD,functionSourceRgb:xn.SOURCE_ALPHA,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE,functionDestinationAlpha:xn.ONE})},ro=Object.freeze(KT),QT={FRONT:R.FRONT,BACK:R.BACK,FRONT_AND_BACK:R.FRONT_AND_BACK},Mo=Object.freeze(QT);function Gt(e){e=g(e,g.EMPTY_OBJECT),this.material=e.material,this.translucent=g(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=g(e.closed,!1)}Object.defineProperties(Gt.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),Gt.prototype.getFragmentShaderSource=function(){const e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
3832
+ `)},Gt.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent},Gt.prototype.getRenderState=function(){const e=this.isTranslucent(),t=cn(this.renderState,!1);return e?(t.depthMask=!1,t.blending=ro.ALPHA_BLEND):t.depthMask=!0,t},Gt.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=ro.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Mo.BACK}),l(n)&&(i=hn(n,i,!0)),i};const JT=`uniform sampler2D image;
3833
3833
 
3834
3834
  czm_material czm_getMaterial(czm_materialInput materialInput)
3835
3835
  {
@@ -4428,7 +4428,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
4428
4428
 
4429
4429
  return material;
4430
4430
  }
4431
- `;function ne(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=g(e.minificationFilter,Vt.LINEAR),this._magnificationFilter=g(e.magnificationFilter,io.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,Ty(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(ne._uniformList[this.type])||(ne._uniformList[this.type]=Object.keys(this._uniforms))}ne._uniformList={},ne.fromType=function(e,t){if(!l(ne._materialCache.getMaterial(e)))throw new C(`material with type '${e}' does not exist.`);const n=new ne({fabric:{type:e}});if(l(t))for(const i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n},ne.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0;const t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){const o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e},ne.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n;const i=this._loadedImages;let o=i.length;for(t=0;t<o;++t){const c=i[t];n=c.id;let h=c.image,d;Array.isArray(h)&&(d=h.slice(1,h.length).map(function(w){return w.bufferView}),h=h[0]);const p=new ei({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter});let m;l(h.internalFormat)?m=new Mt({context:e,pixelFormat:h.internalFormat,width:h.width,height:h.height,source:{arrayBufferView:h.bufferView,mipLevels:d},sampler:p}):m=new Mt({context:e,source:h,sampler:p});const T=this._textures[n];l(T)&&T!==this._defaultTexture&&T.destroy(),this._textures[n]=m;const y=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(y)){const w=this.uniforms[y];w.x=m._width,w.y=m._height}}i.length=0;const a=this._loadedCubeMaps;for(o=a.length,t=0;t<o;++t){const c=a[t];n=c.id;const h=c.images,d=new It({context:e,source:{positiveX:h[0],negativeX:h[1],positiveY:h[2],negativeY:h[3],positiveZ:h[4],negativeZ:h[5]},sampler:new ei({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=d}a.length=0;const r=this._updateFunctions;for(o=r.length,t=0;t<o;++t)r[t](this,e);const f=this.materials;for(const c in f)f.hasOwnProperty(c)&&f[c].update(e)},ne.prototype.isDestroyed=function(){return!1},ne.prototype.destroy=function(){const e=this._textures;for(const n in e)if(e.hasOwnProperty(n)){const i=e[n];i!==this._defaultTexture&&i.destroy()}const t=this.materials;for(const n in t)t.hasOwnProperty(n)&&t[n].destroy();return st(this)};function Ty(e,t){e=g(e,g.EMPTY_OBJECT),t._strict=g(e.strict,!1),t._count=g(e.count,0),t._template=cn(g(e.fabric,g.EMPTY_OBJECT)),t._template.uniforms=cn(g(t._template.uniforms,g.EMPTY_OBJECT)),t._template.materials=cn(g(t._template.materials,g.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:Xn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n;const i=ne._materialCache.getMaterial(t.type);if(l(i)){const a=cn(i.fabric,!0);t._template=hn(t._template,a,!0),n=i.translucent}Ay(t),l(i)||ne._materialCache.addMaterial(t.type,t),by(t),Dy(t),vy(t);const o=t._translucentFunctions.length===0?!0:void 0;if(n=g(n,o),n=g(e.translucent,n),l(n))if(typeof n=="function"){const a=function(){return n(t)};t._translucentFunctions.push(a)}else t._translucentFunctions.push(n)}function Qc(e,t,n,i){if(l(e)){for(const o in e)if(e.hasOwnProperty(o)){const a=t.indexOf(o)!==-1;(i&&!a||!i&&a)&&n(o,t)}}}function Vu(e,t){let n=`fabric: property name '${e}' is not valid. It should be `;for(let i=0;i<t.length;i++){const o=`'${t[i]}'`;n+=i===t.length-1?`or ${o}.`:`${o}, `}throw new C(n)}function yy(e,t){const n=`fabric: uniforms and materials cannot share the same property '${e}'`;throw new C(n)}const Cy=["type","materials","uniforms","components","source"],wy=["diffuse","specular","shininess","normal","emission","alpha"];function Ay(e){const t=e._template,n=t.uniforms,i=t.materials,o=t.components;if(l(o)&&l(t.source))throw new C("fabric: cannot have source and components in the same template.");Qc(t,Cy,Vu,!0),Qc(o,wy,Vu,!0);const a=[];for(const r in i)i.hasOwnProperty(r)&&a.push(r);Qc(n,a,yy,!1)}function Ey(e,t){const n=t._template.materials;for(const i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function by(e){const t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n}
4431
+ `;function ne(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=g(e.minificationFilter,Vt.LINEAR),this._magnificationFilter=g(e.magnificationFilter,io.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,Ty(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(ne._uniformList[this.type])||(ne._uniformList[this.type]=Object.keys(this._uniforms))}ne._uniformList={},ne.fromType=function(e,t){if(!l(ne._materialCache.getMaterial(e)))throw new C(`material with type '${e}' does not exist.`);const n=new ne({fabric:{type:e}});if(l(t))for(const i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n},ne.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0;const t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){const o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e},ne.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n;const i=this._loadedImages;let o=i.length;for(t=0;t<o;++t){const c=i[t];n=c.id;let h=c.image,d;Array.isArray(h)&&(d=h.slice(1,h.length).map(function(w){return w.bufferView}),h=h[0]);const p=new Jn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter});let m;l(h.internalFormat)?m=new Mt({context:e,pixelFormat:h.internalFormat,width:h.width,height:h.height,source:{arrayBufferView:h.bufferView,mipLevels:d},sampler:p}):m=new Mt({context:e,source:h,sampler:p});const T=this._textures[n];l(T)&&T!==this._defaultTexture&&T.destroy(),this._textures[n]=m;const y=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(y)){const w=this.uniforms[y];w.x=m._width,w.y=m._height}}i.length=0;const a=this._loadedCubeMaps;for(o=a.length,t=0;t<o;++t){const c=a[t];n=c.id;const h=c.images,d=new It({context:e,source:{positiveX:h[0],negativeX:h[1],positiveY:h[2],negativeY:h[3],positiveZ:h[4],negativeZ:h[5]},sampler:new Jn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=d}a.length=0;const r=this._updateFunctions;for(o=r.length,t=0;t<o;++t)r[t](this,e);const f=this.materials;for(const c in f)f.hasOwnProperty(c)&&f[c].update(e)},ne.prototype.isDestroyed=function(){return!1},ne.prototype.destroy=function(){const e=this._textures;for(const n in e)if(e.hasOwnProperty(n)){const i=e[n];i!==this._defaultTexture&&i.destroy()}const t=this.materials;for(const n in t)t.hasOwnProperty(n)&&t[n].destroy();return st(this)};function Ty(e,t){e=g(e,g.EMPTY_OBJECT),t._strict=g(e.strict,!1),t._count=g(e.count,0),t._template=cn(g(e.fabric,g.EMPTY_OBJECT)),t._template.uniforms=cn(g(t._template.uniforms,g.EMPTY_OBJECT)),t._template.materials=cn(g(t._template.materials,g.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:Yn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n;const i=ne._materialCache.getMaterial(t.type);if(l(i)){const a=cn(i.fabric,!0);t._template=hn(t._template,a,!0),n=i.translucent}Ay(t),l(i)||ne._materialCache.addMaterial(t.type,t),by(t),Dy(t),vy(t);const o=t._translucentFunctions.length===0?!0:void 0;if(n=g(n,o),n=g(e.translucent,n),l(n))if(typeof n=="function"){const a=function(){return n(t)};t._translucentFunctions.push(a)}else t._translucentFunctions.push(n)}function Qc(e,t,n,i){if(l(e)){for(const o in e)if(e.hasOwnProperty(o)){const a=t.indexOf(o)!==-1;(i&&!a||!i&&a)&&n(o,t)}}}function Vu(e,t){let n=`fabric: property name '${e}' is not valid. It should be `;for(let i=0;i<t.length;i++){const o=`'${t[i]}'`;n+=i===t.length-1?`or ${o}.`:`${o}, `}throw new C(n)}function yy(e,t){const n=`fabric: uniforms and materials cannot share the same property '${e}'`;throw new C(n)}const Cy=["type","materials","uniforms","components","source"],wy=["diffuse","specular","shininess","normal","emission","alpha"];function Ay(e){const t=e._template,n=t.uniforms,i=t.materials,o=t.components;if(l(o)&&l(t.source))throw new C("fabric: cannot have source and components in the same template.");Qc(t,Cy,Vu,!0),Qc(o,wy,Vu,!0);const a=[];for(const r in i)i.hasOwnProperty(r)&&a.push(r);Qc(n,a,yy,!1)}function Ey(e,t){const n=t._template.materials;for(const i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function by(e){const t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n}
4432
4432
  `;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
4433
4433
  {
4434
4434
  `,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
@@ -4437,7 +4437,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
4437
4437
  `:e.shaderSource+=`material.${o} = ${t[o]};
4438
4438
  `}e.shaderSource+=`return material;
4439
4439
  }
4440
- `}}const Gu={mat2:ue,mat3:G,mat4:k},xy=/\.ktx2$/i;function Sy(e){let t;return function(n,i){const o=n.uniforms,a=o[e],r=t!==a,f=!l(a)||a===ne.DefaultImageId;t=a;let c=n._textures[e],h,d;if(a instanceof HTMLVideoElement){if(a.readyState>=2){if(r&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){const m=new ei({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Mt({context:i,source:a,sampler:m}),n._textures[e]=c;return}c.copyFrom({source:a})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(a instanceof Mt&&a!==c){n._texturePaths[e]=void 0;const m=n._textures[e];l(m)&&m!==n._defaultTexture&&m.destroy(),n._textures[e]=a,h=`${e}Dimensions`,o.hasOwnProperty(h)&&(d=o[h],d.x=a._width,d.y=a._height);return}if(r&&l(c)&&f&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,h=`${e}Dimensions`,o.hasOwnProperty(h)&&(d=o[h],d.x=c._width,d.y=c._height)),f)return;const p=a instanceof ae;if(!l(n._texturePaths[e])||p&&a.url!==n._texturePaths[e].url||!p&&a!==n._texturePaths[e]){if(typeof a=="string"||p){const m=p?a:ae.createIfNeeded(a);let T;xy.test(m.url)?T=yu(m.url):T=m.fetchImage(),Promise.resolve(T).then(function(y){n._loadedImages.push({id:e,image:y})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(a instanceof HTMLCanvasElement||a instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:a});n._texturePaths[e]=a}}}function Iy(e){return function(t,n){const i=t.uniforms[e];if(i instanceof It){const a=t._textures[e];a!==t._defaultTexture&&a.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===ne.DefaultCubeMapId)return;const o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){const a=[ae.createIfNeeded(i.positiveX).fetchImage(),ae.createIfNeeded(i.negativeX).fetchImage(),ae.createIfNeeded(i.positiveY).fetchImage(),ae.createIfNeeded(i.negativeY).fetchImage(),ae.createIfNeeded(i.positiveZ).fetchImage(),ae.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(a).then(function(r){t._loadedCubeMaps.push({id:e,images:r})}),t._texturePaths[e]=o}}}function Dy(e){const t=e._template.uniforms;for(const n in t)t.hasOwnProperty(n)&&qu(e,n)}function qu(e,t){const n=e._strict,i=e._template.uniforms,o=i[t],a=Oy(o);if(!l(a))throw new C(`fabric: uniform '${t}' has invalid type.`);let r;if(a==="channels"){if(r=gs(e,t,o,!1),r===0&&n)throw new C(`strict: shader source does not use channels '${t}'.`)}else{if(a==="sampler2D"){const h=`${t}Dimensions`;Wy(e,h)>0&&(i[h]={type:"ivec3",x:1,y:1},qu(e,h))}if(!new RegExp(`uniform\\s+${a}\\s+${t}\\s*;`).test(e.shaderSource)){const h=`uniform ${a} ${t};`;e.shaderSource=h+e.shaderSource}const c=`${t}_${e._count++}`;if(r=gs(e,t,c),r===1&&n)throw new C(`strict: shader source does not use uniform '${t}'.`);if(e.uniforms[t]=o,a==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Sy(t));else if(a==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Iy(t));else if(a.indexOf("mat")!==-1){const h=new Gu[a];e._uniforms[c]=function(){return Gu[a].fromColumnMajorArray(e.uniforms[t],h)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function Oy(e){let t=e.type;if(!l(t)){const n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof ae||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===ne.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(const o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function vy(e){const t=e._strict,n=e._template.materials;for(const i in n)if(n.hasOwnProperty(i)){const o=new ne({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=hn(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);const a="czm_getMaterial",r=`${a}_${e._count++}`;gs(o,a,r),e.shaderSource=o.shaderSource+e.shaderSource;const f=`${r}(materialInput)`;if(gs(e,i,f)===0&&t)throw new C(`strict: shader source does not use material '${i}'.`)}}function gs(e,t,n,i){i=g(i,!0);let o=0;const a="([\\w])?",r=`([\\w${i?".":""}])?`,f=new RegExp(r+t+a,"g");return e.shaderSource=e.shaderSource.replace(f,function(c,h,d){return h||d?c:(o+=1,n)}),o}function Wy(e,t,n){return gs(e,t,t,n)}ne._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},ne.DefaultImageId="czm_defaultImage",ne.DefaultCubeMapId="czm_defaultCubeMap",ne.ColorType="Color",ne._materialCache.addMaterial(ne.ColorType,{fabric:{type:ne.ColorType,uniforms:{color:new D(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),ne.ImageType="Image",ne._materialCache.addMaterial(ne.ImageType,{fabric:{type:ne.ImageType,uniforms:{image:ne.DefaultImageId,repeat:new q(1,1),color:new D(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),ne.DiffuseMapType="DiffuseMap",ne._materialCache.addMaterial(ne.DiffuseMapType,{fabric:{type:ne.DiffuseMapType,uniforms:{image:ne.DefaultImageId,channels:"rgb",repeat:new q(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),ne.AlphaMapType="AlphaMap",ne._materialCache.addMaterial(ne.AlphaMapType,{fabric:{type:ne.AlphaMapType,uniforms:{image:ne.DefaultImageId,channel:"a",repeat:new q(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),ne.SpecularMapType="SpecularMap",ne._materialCache.addMaterial(ne.SpecularMapType,{fabric:{type:ne.SpecularMapType,uniforms:{image:ne.DefaultImageId,channel:"r",repeat:new q(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),ne.EmissionMapType="EmissionMap",ne._materialCache.addMaterial(ne.EmissionMapType,{fabric:{type:ne.EmissionMapType,uniforms:{image:ne.DefaultImageId,channels:"rgb",repeat:new q(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),ne.BumpMapType="BumpMap",ne._materialCache.addMaterial(ne.BumpMapType,{fabric:{type:ne.BumpMapType,uniforms:{image:ne.DefaultImageId,channel:"r",strength:.8,repeat:new q(1,1)},source:ey},translucent:!1}),ne.NormalMapType="NormalMap",ne._materialCache.addMaterial(ne.NormalMapType,{fabric:{type:ne.NormalMapType,uniforms:{image:ne.DefaultImageId,channels:"rgb",strength:.8,repeat:new q(1,1)},source:cy},translucent:!1}),ne.GridType="Grid",ne._materialCache.addMaterial(ne.GridType,{fabric:{type:ne.GridType,uniforms:{color:new D(0,1,0,1),cellAlpha:.1,lineCount:new q(8,8),lineThickness:new q(1,1),lineOffset:new q(0,0)},source:ay},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),ne.StripeType="Stripe",ne._materialCache.addMaterial(ne.StripeType,{fabric:{type:ne.StripeType,uniforms:{horizontal:!0,evenColor:new D(1,1,1,.5),oddColor:new D(0,0,1,.5),offset:0,repeat:5},source:my},translucent:function(e){const t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}}),ne.CheckerboardType="Checkerboard",ne._materialCache.addMaterial(ne.CheckerboardType,{fabric:{type:ne.CheckerboardType,uniforms:{lightColor:new D(1,1,1,.5),darkColor:new D(0,0,0,.5),repeat:new q(5,5)},source:ty},translucent:function(e){const t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),ne.DotType="Dot",ne._materialCache.addMaterial(ne.DotType,{fabric:{type:ne.DotType,uniforms:{lightColor:new D(1,1,0,.75),darkColor:new D(0,1,1,.75),repeat:new q(5,5)},source:ny},translucent:function(e){const t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),ne.WaterType="Water",ne._materialCache.addMaterial(ne.WaterType,{fabric:{type:ne.WaterType,uniforms:{baseWaterColor:new D(.2,.3,.6,1),blendColor:new D(0,1,.699,1),specularMap:ne.DefaultImageId,normalMap:ne.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:gy},translucent:function(e){const t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}}),ne.RimLightingType="RimLighting",ne._materialCache.addMaterial(ne.RimLightingType,{fabric:{type:ne.RimLightingType,uniforms:{color:new D(1,0,0,.7),rimColor:new D(1,1,1,.4),width:.3},source:dy},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}}),ne.FadeType="Fade",ne._materialCache.addMaterial(ne.FadeType,{fabric:{type:ne.FadeType,uniforms:{fadeInColor:new D(1,0,0,1),fadeOutColor:new D(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new q(.5,.5)},source:ry},translucent:function(e){const t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}}),ne.PolylineArrowType="PolylineArrow",ne._materialCache.addMaterial(ne.PolylineArrowType,{fabric:{type:ne.PolylineArrowType,uniforms:{color:new D(1,1,1,1)},source:hy},translucent:!0}),ne.PolylineDashType="PolylineDash",ne._materialCache.addMaterial(ne.PolylineDashType,{fabric:{type:ne.PolylineDashType,uniforms:{color:new D(1,0,1,1),gapColor:new D(0,0,0,0),dashLength:16,dashPattern:255},source:fy},translucent:!0}),ne.PolylineGlowType="PolylineGlow",ne._materialCache.addMaterial(ne.PolylineGlowType,{fabric:{type:ne.PolylineGlowType,uniforms:{color:new D(0,.5,1,1),glowPower:.25,taperPower:1},source:ly},translucent:!0}),ne.PolylineOutlineType="PolylineOutline",ne._materialCache.addMaterial(ne.PolylineOutlineType,{fabric:{type:ne.PolylineOutlineType,uniforms:{color:new D(1,1,1,1),outlineColor:new D(1,0,0,1),outlineWidth:1},source:uy},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),ne.ElevationContourType="ElevationContour",ne._materialCache.addMaterial(ne.ElevationContourType,{fabric:{type:ne.ElevationContourType,uniforms:{spacing:100,color:new D(1,0,0,1),width:1},source:oy},translucent:!1}),ne.ElevationRampType="ElevationRamp",ne._materialCache.addMaterial(ne.ElevationRampType,{fabric:{type:ne.ElevationRampType,uniforms:{image:ne.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:sy},translucent:!1}),ne.SlopeRampMaterialType="SlopeRamp",ne._materialCache.addMaterial(ne.SlopeRampMaterialType,{fabric:{type:ne.SlopeRampMaterialType,uniforms:{image:ne.DefaultImageId},source:py},translucent:!1}),ne.AspectRampMaterialType="AspectRamp",ne._materialCache.addMaterial(ne.AspectRampMaterialType,{fabric:{type:ne.AspectRampMaterialType,uniforms:{image:ne.DefaultImageId},source:JT},translucent:!1}),ne.ElevationBandType="ElevationBand",ne._materialCache.addMaterial(ne.ElevationBandType,{fabric:{type:ne.ElevationBandType,uniforms:{heights:ne.DefaultImageId,colors:ne.DefaultImageId},source:iy},translucent:!0}),ne.WaterMaskType="WaterMask",ne._materialCache.addMaterial(ne.WaterMaskType,{fabric:{type:ne.WaterMaskType,source:_y,uniforms:{waterColor:new D(1,1,1,1),landColor:new D(0,0,0,0)}},translucent:!1});const Py=`in vec3 v_positionEC;
4440
+ `}}const Gu={mat2:ue,mat3:G,mat4:k},xy=/\.ktx2$/i;function Sy(e){let t;return function(n,i){const o=n.uniforms,a=o[e],r=t!==a,f=!l(a)||a===ne.DefaultImageId;t=a;let c=n._textures[e],h,d;if(a instanceof HTMLVideoElement){if(a.readyState>=2){if(r&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){const m=new Jn({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Mt({context:i,source:a,sampler:m}),n._textures[e]=c;return}c.copyFrom({source:a})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(a instanceof Mt&&a!==c){n._texturePaths[e]=void 0;const m=n._textures[e];l(m)&&m!==n._defaultTexture&&m.destroy(),n._textures[e]=a,h=`${e}Dimensions`,o.hasOwnProperty(h)&&(d=o[h],d.x=a._width,d.y=a._height);return}if(r&&l(c)&&f&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,h=`${e}Dimensions`,o.hasOwnProperty(h)&&(d=o[h],d.x=c._width,d.y=c._height)),f)return;const p=a instanceof ae;if(!l(n._texturePaths[e])||p&&a.url!==n._texturePaths[e].url||!p&&a!==n._texturePaths[e]){if(typeof a=="string"||p){const m=p?a:ae.createIfNeeded(a);let T;xy.test(m.url)?T=yu(m.url):T=m.fetchImage(),Promise.resolve(T).then(function(y){n._loadedImages.push({id:e,image:y})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(a instanceof HTMLCanvasElement||a instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:a});n._texturePaths[e]=a}}}function Iy(e){return function(t,n){const i=t.uniforms[e];if(i instanceof It){const a=t._textures[e];a!==t._defaultTexture&&a.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===ne.DefaultCubeMapId)return;const o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){const a=[ae.createIfNeeded(i.positiveX).fetchImage(),ae.createIfNeeded(i.negativeX).fetchImage(),ae.createIfNeeded(i.positiveY).fetchImage(),ae.createIfNeeded(i.negativeY).fetchImage(),ae.createIfNeeded(i.positiveZ).fetchImage(),ae.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(a).then(function(r){t._loadedCubeMaps.push({id:e,images:r})}),t._texturePaths[e]=o}}}function Dy(e){const t=e._template.uniforms;for(const n in t)t.hasOwnProperty(n)&&qu(e,n)}function qu(e,t){const n=e._strict,i=e._template.uniforms,o=i[t],a=Oy(o);if(!l(a))throw new C(`fabric: uniform '${t}' has invalid type.`);let r;if(a==="channels"){if(r=gs(e,t,o,!1),r===0&&n)throw new C(`strict: shader source does not use channels '${t}'.`)}else{if(a==="sampler2D"){const h=`${t}Dimensions`;Wy(e,h)>0&&(i[h]={type:"ivec3",x:1,y:1},qu(e,h))}if(!new RegExp(`uniform\\s+${a}\\s+${t}\\s*;`).test(e.shaderSource)){const h=`uniform ${a} ${t};`;e.shaderSource=h+e.shaderSource}const c=`${t}_${e._count++}`;if(r=gs(e,t,c),r===1&&n)throw new C(`strict: shader source does not use uniform '${t}'.`);if(e.uniforms[t]=o,a==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Sy(t));else if(a==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Iy(t));else if(a.indexOf("mat")!==-1){const h=new Gu[a];e._uniforms[c]=function(){return Gu[a].fromColumnMajorArray(e.uniforms[t],h)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function Oy(e){let t=e.type;if(!l(t)){const n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof ae||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===ne.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(const o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function vy(e){const t=e._strict,n=e._template.materials;for(const i in n)if(n.hasOwnProperty(i)){const o=new ne({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=hn(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);const a="czm_getMaterial",r=`${a}_${e._count++}`;gs(o,a,r),e.shaderSource=o.shaderSource+e.shaderSource;const f=`${r}(materialInput)`;if(gs(e,i,f)===0&&t)throw new C(`strict: shader source does not use material '${i}'.`)}}function gs(e,t,n,i){i=g(i,!0);let o=0;const a="([\\w])?",r=`([\\w${i?".":""}])?`,f=new RegExp(r+t+a,"g");return e.shaderSource=e.shaderSource.replace(f,function(c,h,d){return h||d?c:(o+=1,n)}),o}function Wy(e,t,n){return gs(e,t,t,n)}ne._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},ne.DefaultImageId="czm_defaultImage",ne.DefaultCubeMapId="czm_defaultCubeMap",ne.ColorType="Color",ne._materialCache.addMaterial(ne.ColorType,{fabric:{type:ne.ColorType,uniforms:{color:new I(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),ne.ImageType="Image",ne._materialCache.addMaterial(ne.ImageType,{fabric:{type:ne.ImageType,uniforms:{image:ne.DefaultImageId,repeat:new q(1,1),color:new I(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),ne.DiffuseMapType="DiffuseMap",ne._materialCache.addMaterial(ne.DiffuseMapType,{fabric:{type:ne.DiffuseMapType,uniforms:{image:ne.DefaultImageId,channels:"rgb",repeat:new q(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),ne.AlphaMapType="AlphaMap",ne._materialCache.addMaterial(ne.AlphaMapType,{fabric:{type:ne.AlphaMapType,uniforms:{image:ne.DefaultImageId,channel:"a",repeat:new q(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),ne.SpecularMapType="SpecularMap",ne._materialCache.addMaterial(ne.SpecularMapType,{fabric:{type:ne.SpecularMapType,uniforms:{image:ne.DefaultImageId,channel:"r",repeat:new q(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),ne.EmissionMapType="EmissionMap",ne._materialCache.addMaterial(ne.EmissionMapType,{fabric:{type:ne.EmissionMapType,uniforms:{image:ne.DefaultImageId,channels:"rgb",repeat:new q(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),ne.BumpMapType="BumpMap",ne._materialCache.addMaterial(ne.BumpMapType,{fabric:{type:ne.BumpMapType,uniforms:{image:ne.DefaultImageId,channel:"r",strength:.8,repeat:new q(1,1)},source:ey},translucent:!1}),ne.NormalMapType="NormalMap",ne._materialCache.addMaterial(ne.NormalMapType,{fabric:{type:ne.NormalMapType,uniforms:{image:ne.DefaultImageId,channels:"rgb",strength:.8,repeat:new q(1,1)},source:cy},translucent:!1}),ne.GridType="Grid",ne._materialCache.addMaterial(ne.GridType,{fabric:{type:ne.GridType,uniforms:{color:new I(0,1,0,1),cellAlpha:.1,lineCount:new q(8,8),lineThickness:new q(1,1),lineOffset:new q(0,0)},source:ay},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),ne.StripeType="Stripe",ne._materialCache.addMaterial(ne.StripeType,{fabric:{type:ne.StripeType,uniforms:{horizontal:!0,evenColor:new I(1,1,1,.5),oddColor:new I(0,0,1,.5),offset:0,repeat:5},source:my},translucent:function(e){const t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}}),ne.CheckerboardType="Checkerboard",ne._materialCache.addMaterial(ne.CheckerboardType,{fabric:{type:ne.CheckerboardType,uniforms:{lightColor:new I(1,1,1,.5),darkColor:new I(0,0,0,.5),repeat:new q(5,5)},source:ty},translucent:function(e){const t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),ne.DotType="Dot",ne._materialCache.addMaterial(ne.DotType,{fabric:{type:ne.DotType,uniforms:{lightColor:new I(1,1,0,.75),darkColor:new I(0,1,1,.75),repeat:new q(5,5)},source:ny},translucent:function(e){const t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),ne.WaterType="Water",ne._materialCache.addMaterial(ne.WaterType,{fabric:{type:ne.WaterType,uniforms:{baseWaterColor:new I(.2,.3,.6,1),blendColor:new I(0,1,.699,1),specularMap:ne.DefaultImageId,normalMap:ne.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:gy},translucent:function(e){const t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}}),ne.RimLightingType="RimLighting",ne._materialCache.addMaterial(ne.RimLightingType,{fabric:{type:ne.RimLightingType,uniforms:{color:new I(1,0,0,.7),rimColor:new I(1,1,1,.4),width:.3},source:dy},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}}),ne.FadeType="Fade",ne._materialCache.addMaterial(ne.FadeType,{fabric:{type:ne.FadeType,uniforms:{fadeInColor:new I(1,0,0,1),fadeOutColor:new I(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new q(.5,.5)},source:ry},translucent:function(e){const t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}}),ne.PolylineArrowType="PolylineArrow",ne._materialCache.addMaterial(ne.PolylineArrowType,{fabric:{type:ne.PolylineArrowType,uniforms:{color:new I(1,1,1,1)},source:hy},translucent:!0}),ne.PolylineDashType="PolylineDash",ne._materialCache.addMaterial(ne.PolylineDashType,{fabric:{type:ne.PolylineDashType,uniforms:{color:new I(1,0,1,1),gapColor:new I(0,0,0,0),dashLength:16,dashPattern:255},source:fy},translucent:!0}),ne.PolylineGlowType="PolylineGlow",ne._materialCache.addMaterial(ne.PolylineGlowType,{fabric:{type:ne.PolylineGlowType,uniforms:{color:new I(0,.5,1,1),glowPower:.25,taperPower:1},source:ly},translucent:!0}),ne.PolylineOutlineType="PolylineOutline",ne._materialCache.addMaterial(ne.PolylineOutlineType,{fabric:{type:ne.PolylineOutlineType,uniforms:{color:new I(1,1,1,1),outlineColor:new I(1,0,0,1),outlineWidth:1},source:uy},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),ne.ElevationContourType="ElevationContour",ne._materialCache.addMaterial(ne.ElevationContourType,{fabric:{type:ne.ElevationContourType,uniforms:{spacing:100,color:new I(1,0,0,1),width:1},source:oy},translucent:!1}),ne.ElevationRampType="ElevationRamp",ne._materialCache.addMaterial(ne.ElevationRampType,{fabric:{type:ne.ElevationRampType,uniforms:{image:ne.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:sy},translucent:!1}),ne.SlopeRampMaterialType="SlopeRamp",ne._materialCache.addMaterial(ne.SlopeRampMaterialType,{fabric:{type:ne.SlopeRampMaterialType,uniforms:{image:ne.DefaultImageId},source:py},translucent:!1}),ne.AspectRampMaterialType="AspectRamp",ne._materialCache.addMaterial(ne.AspectRampMaterialType,{fabric:{type:ne.AspectRampMaterialType,uniforms:{image:ne.DefaultImageId},source:JT},translucent:!1}),ne.ElevationBandType="ElevationBand",ne._materialCache.addMaterial(ne.ElevationBandType,{fabric:{type:ne.ElevationBandType,uniforms:{heights:ne.DefaultImageId,colors:ne.DefaultImageId},source:iy},translucent:!0}),ne.WaterMaskType="WaterMask",ne._materialCache.addMaterial(ne.WaterMaskType,{fabric:{type:ne.WaterMaskType,source:_y,uniforms:{waterColor:new I(1,1,1,1),landColor:new I(0,0,0,0)}},translucent:!1});const Py=`in vec3 v_positionEC;
4441
4441
  in vec3 v_normalEC;
4442
4442
  in vec4 v_color;
4443
4443
 
@@ -4502,7 +4502,7 @@ void main()
4502
4502
 
4503
4503
  gl_Position = czm_modelViewProjectionRelativeToEye * p;
4504
4504
  }
4505
- `;function Kt(e){e=g(e,g.EMPTY_OBJECT);const t=g(e.translucent,!0),n=g(e.closed,!1),i=g(e.flat,!1),o=i?Ry:By,a=i?Hu:Py,r=i?Kt.FLAT_VERTEX_FORMAT:Kt.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=g(e.vertexShaderSource,o),this._fragmentShaderSource=g(e.fragmentShaderSource,a),this._renderState=Gt.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=r,this._flat=i,this._faceForward=g(e.faceForward,!n)}Object.defineProperties(Kt.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),Kt.VERTEX_FORMAT=ut.POSITION_AND_NORMAL,Kt.FLAT_VERTEX_FORMAT=ut.POSITION_ONLY,Kt.prototype.getFragmentShaderSource=Gt.prototype.getFragmentShaderSource,Kt.prototype.isTranslucent=Gt.prototype.isTranslucent,Kt.prototype.getRenderState=Gt.prototype.getRenderState;function ko(e){this._definitionChanged=new Ne,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(ko.prototype,{isConstant:{get:function(){return ve.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:V("color")}),ko.prototype.getType=function(e){return"Color"};const zy=new J;ko.prototype.getValue=function(e,t){return l(e)||(e=J.now(zy)),l(t)||(t={}),t.color=ve.getValueOrClonedDefault(this._color,e,D.WHITE,t.color),t},ko.prototype.equals=function(e){return this===e||e instanceof ko&&ve.equals(this._color,e._color)};function Gi(e){e=g(e,g.EMPTY_OBJECT),this._ellipsoid=g(e.ellipsoid,pe.default),this._rectangle=g(e.rectangle,de.MAX_VALUE),this._projection=new Wn(this._ellipsoid),this._numberOfLevelZeroTilesX=g(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=g(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(Gi.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),Gi.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},Gi.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},Gi.prototype.rectangleToNativeRectangle=function(e,t){_.defined("rectangle",e);const n=S.toDegrees(e.west),i=S.toDegrees(e.south),o=S.toDegrees(e.east),a=S.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=a,t):new de(n,i,o,a)},Gi.prototype.tileXYToNativeRectangle=function(e,t,n,i){const o=this.tileXYToRectangle(e,t,n,i);return o.west=S.toDegrees(o.west),o.south=S.toDegrees(o.south),o.east=S.toDegrees(o.east),o.north=S.toDegrees(o.north),o},Gi.prototype.tileXYToRectangle=function(e,t,n,i){const o=this._rectangle,a=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),f=o.width/a,c=e*f+o.west,h=(e+1)*f+o.west,d=o.height/r,p=o.north-t*d,m=o.north-(t+1)*d;return l(i)||(i=new de(c,m,h,p)),i.west=c,i.south=m,i.east=h,i.north=p,i},Gi.prototype.positionToTileXY=function(e,t,n){const i=this._rectangle;if(!de.contains(i,e))return;const o=this.getNumberOfXTilesAtLevel(t),a=this.getNumberOfYTilesAtLevel(t),r=i.width/o,f=i.height/a;let c=e.longitude;i.east<i.west&&(c+=S.TWO_PI);let h=(c-i.west)/r|0;h>=o&&(h=o-1);let d=(i.north-e.latitude)/f|0;return d>=a&&(d=a-1),l(n)?(n.x=h,n.y=d,n):new q(h,d)};const ju=new u,Yu=new u,Xu=new oe,Jc=new u,Ly=new u,$u=new te,Ny=new Gi,Ts=[new oe,new oe,new oe,new oe],ys=new q,Ve={};Ve.initialize=function(){let e=Ve._initPromise;return l(e)||(e=ae.fetchJson(_n("Assets/approximateTerrainHeights.json")).then(function(t){Ve._terrainHeights=t}),Ve._initPromise=e),e},Ve.getMinimumMaximumHeights=function(e,t){if(_.defined("rectangle",e),!l(Ve._terrainHeights))throw new C("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=g(t,pe.default);const n=Zu(e);let i=Ve._defaultMinTerrainHeight,o=Ve._defaultMaxTerrainHeight;if(l(n)){const a=`${n.level}-${n.x}-${n.y}`,r=Ve._terrainHeights[a];l(r)&&(i=r[0],o=r[1]),t.cartographicToCartesian(de.northeast(e,Xu),ju),t.cartographicToCartesian(de.southwest(e,Xu),Yu),u.midpoint(Yu,ju,Jc);const f=t.scaleToGeodeticSurface(Jc,Ly);if(l(f)){const c=u.distance(Jc,f);i=Math.min(i,-c)}else i=Ve._defaultMinTerrainHeight}return i=Math.max(Ve._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}},Ve.getBoundingSphere=function(e,t){if(_.defined("rectangle",e),!l(Ve._terrainHeights))throw new C("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=g(t,pe.default);const n=Zu(e);let i=Ve._defaultMaxTerrainHeight;if(l(n)){const a=`${n.level}-${n.x}-${n.y}`,r=Ve._terrainHeights[a];l(r)&&(i=r[1])}const o=te.fromRectangle3D(e,t,0);return te.fromRectangle3D(e,t,i,$u),te.union(o,$u,o)};function Zu(e){oe.fromRadians(e.east,e.north,0,Ts[0]),oe.fromRadians(e.west,e.north,0,Ts[1]),oe.fromRadians(e.east,e.south,0,Ts[2]),oe.fromRadians(e.west,e.south,0,Ts[3]);let t=0,n=0,i=0,o=0;const a=Ve._terrainHeightsMaxLevel;let r;for(r=0;r<=a;++r){let f=!1;for(let c=0;c<4;++c){const h=Ts[c];if(Ny.positionToTileXY(h,r,ys),c===0)i=ys.x,o=ys.y;else if(i!==ys.x||o!==ys.y){f=!0;break}}if(f)break;t=i,n=o}if(r!==0)return{x:t,y:n,level:r>a?a:r-1}}Ve._terrainHeightsMaxLevel=6,Ve._defaultMaxTerrainHeight=9e3,Ve._defaultMinTerrainHeight=-1e5,Ve._terrainHeights=void 0,Ve._initPromise=void 0,Object.defineProperties(Ve,{initialized:{get:function(){return l(Ve._terrainHeights)}}});function Qt(e,t,n){this.minimum=u.clone(g(e,u.ZERO)),this.maximum=u.clone(g(t,u.ZERO)),l(n)?n=u.clone(n):n=u.midpoint(this.minimum,this.maximum,new u),this.center=n}Qt.fromCorners=function(e,t,n){return _.defined("minimum",e),_.defined("maximum",t),l(n)||(n=new Qt),n.minimum=u.clone(e,n.minimum),n.maximum=u.clone(t,n.maximum),n.center=u.midpoint(e,t,n.center),n},Qt.fromPoints=function(e,t){if(l(t)||(t=new Qt),!l(e)||e.length===0)return t.minimum=u.clone(u.ZERO,t.minimum),t.maximum=u.clone(u.ZERO,t.maximum),t.center=u.clone(u.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,a=e[0].x,r=e[0].y,f=e[0].z;const c=e.length;for(let p=1;p<c;p++){const m=e[p],T=m.x,y=m.y,w=m.z;n=Math.min(T,n),a=Math.max(T,a),i=Math.min(y,i),r=Math.max(y,r),o=Math.min(w,o),f=Math.max(w,f)}const h=t.minimum;h.x=n,h.y=i,h.z=o;const d=t.maximum;return d.x=a,d.y=r,d.z=f,t.center=u.midpoint(h,d,t.center),t},Qt.clone=function(e,t){if(l(e))return l(t)?(t.minimum=u.clone(e.minimum,t.minimum),t.maximum=u.clone(e.maximum,t.maximum),t.center=u.clone(e.center,t.center),t):new Qt(e.minimum,e.maximum,e.center)},Qt.equals=function(e,t){return e===t||l(e)&&l(t)&&u.equals(e.center,t.center)&&u.equals(e.minimum,t.minimum)&&u.equals(e.maximum,t.maximum)};let ia=new u;Qt.intersectPlane=function(e,t){_.defined("box",e),_.defined("plane",t),ia=u.subtract(e.maximum,e.minimum,ia);const n=u.multiplyByScalar(ia,.5,ia),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),a=u.dot(e.center,i)+t.distance;return a-o>0?xt.INSIDE:a+o<0?xt.OUTSIDE:xt.INTERSECTING},Qt.prototype.clone=function(e){return Qt.clone(this,e)},Qt.prototype.intersectPlane=function(e){return Qt.intersectPlane(this,e)},Qt.prototype.equals=function(e){return Qt.equals(this,e)};const Fn={};Fn.computeDiscriminant=function(e,t,n){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");return t*t-4*e*n};function Ku(e,t,n){const i=e+t;return S.sign(e)!==S.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Fn.computeRealRoots=function(e,t,n){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];const c=Math.abs(n),h=Math.abs(e);if(c<h&&c/h<S.EPSILON14)return[0,0];if(c>h&&h/c<S.EPSILON14)return[];if(i=-n/e,i<0)return[];const d=Math.sqrt(i);return[-d,d]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];const o=t*t,a=4*e*n,r=Ku(o,-a,S.EPSILON14);if(r<0)return[];const f=-.5*Ku(t,S.sign(t)*Math.sqrt(r),S.EPSILON14);return t>0?[f/e,n/f]:[n/f,f/e]};const Cs={};Cs.computeDiscriminant=function(e,t,n,i){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");const o=e*e,a=t*t,r=n*n,f=i*i;return 18*e*t*n*i+a*r-27*o*f-4*(e*r*n+a*t*i)};function eh(e,t,n,i){const o=e,a=t/3,r=n/3,f=i,c=o*r,h=a*f,d=a*a,p=r*r,m=o*r-d,T=o*f-a*r,y=a*f-p,w=4*m*y-T*T;let A,E;if(w<0){let ce,le,we;d*h>=c*p?(ce=o,le=m,we=-2*a*m+o*T):(ce=f,le=y,we=-f*T+2*r*y);const Ee=-(we<0?-1:1)*Math.abs(ce)*Math.sqrt(-w);E=-we+Ee;const Le=E/2,Ke=Le<0?-Math.pow(-Le,1/3):Math.pow(Le,1/3),ct=E===Ee?-Ke:-le/Ke;return A=le<=0?Ke+ct:-we/(Ke*Ke+ct*ct+le),d*h>=c*p?[(A-a)/o]:[-f/(A+r)]}const b=m,I=-2*a*m+o*T,O=y,B=-f*T+2*r*y,L=Math.sqrt(w),F=Math.sqrt(3)/2;let N=Math.abs(Math.atan2(o*L,-I)/3);A=2*Math.sqrt(-b);let U=Math.cos(N);E=A*U;let M=A*(-U/2-F*Math.sin(N));const j=E+M>2*a?E-a:M-a,Y=o,s=j/Y;N=Math.abs(Math.atan2(f*L,-B)/3),A=2*Math.sqrt(-O),U=Math.cos(N),E=A*U,M=A*(-U/2-F*Math.sin(N));const x=-f,P=E+M<2*r?E+r:M+r,z=x/P,H=Y*P,X=-j*P-Y*x,ee=j*x,K=(r*X-a*ee)/(-a*X+r*H);return s<=K?s<=z?K<=z?[s,K,z]:[s,z,K]:[z,s,K]:s<=z?[K,s,z]:K<=z?[K,z,s]:[z,K,s]}Cs.computeRealRoots=function(e,t,n,i){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");let o,a;if(e===0)return Fn.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];a=-i/e;const r=a<0?-Math.pow(-a,1/3):Math.pow(a,1/3);return[r,r,r]}else if(i===0)return o=Fn.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return eh(e,0,n,i)}else{if(n===0)return i===0?(a=-t/e,a<0?[a,0,0]:[0,0,a]):eh(e,t,0,i);if(i===0)return o=Fn.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return eh(e,t,n,i)};const th={};th.computeDiscriminant=function(e,t,n,i,o){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");if(typeof o!="number")throw new C("e is a required number.");const a=e*e,r=a*e,f=t*t,c=f*t,h=n*n,d=h*n,p=i*i,m=p*i,T=o*o,y=T*o;return f*h*p-4*c*m-4*e*d*p+18*e*t*n*m-27*a*p*p+256*r*y+o*(18*c*n*i-4*f*d+16*e*h*h-80*e*t*h*i-6*e*f*p+144*a*n*p)+T*(144*e*f*n-27*f*f-128*a*h-192*a*t*i)};function Mn(e,t,n,i){const o=e*e,a=t-3*o/8,r=n-t*e/2+o*e/8,f=i-n*e/4+t*o/16-3*o*o/256,c=Cs.computeRealRoots(1,2*a,a*a-4*f,-r*r);if(c.length>0){const h=-e/4,d=c[c.length-1];if(Math.abs(d)<S.EPSILON14){const p=Fn.computeRealRoots(1,a,f);if(p.length===2){const m=p[0],T=p[1];let y;if(m>=0&&T>=0){const w=Math.sqrt(m),A=Math.sqrt(T);return[h-A,h-w,h+w,h+A]}else{if(m>=0&&T<0)return y=Math.sqrt(m),[h-y,h+y];if(m<0&&T>=0)return y=Math.sqrt(T),[h-y,h+y]}}return[]}else if(d>0){const p=Math.sqrt(d),m=(a+d-r/p)/2,T=(a+d+r/p)/2,y=Fn.computeRealRoots(1,p,m),w=Fn.computeRealRoots(1,-p,T);return y.length!==0?(y[0]+=h,y[1]+=h,w.length!==0?(w[0]+=h,w[1]+=h,y[1]<=w[0]?[y[0],y[1],w[0],w[1]]:w[1]<=y[0]?[w[0],w[1],y[0],y[1]]:y[0]>=w[0]&&y[1]<=w[1]?[w[0],y[0],y[1],w[1]]:w[0]>=y[0]&&w[1]<=y[1]?[y[0],w[0],w[1],y[1]]:y[0]>w[0]&&y[0]<w[1]?[w[0],y[0],w[1],y[1]]:[y[0],w[0],y[1],w[1]]):y):w.length!==0?(w[0]+=h,w[1]+=h,w):[]}}return[]}function ws(e,t,n,i){const o=n*n,a=t*t,r=e*e,f=-2*t,c=n*e+a-4*i,h=r*i-n*t*e+o,d=Cs.computeRealRoots(1,f,c,h);if(d.length>0){const p=d[0],m=t-p,T=m*m,y=e/2,w=m/2,A=T-4*i,E=T+4*Math.abs(i),b=r-4*p,I=r+4*Math.abs(p);let O,B;if(p<0||A*I<b*E){const Y=Math.sqrt(b);O=Y/2,B=Y===0?0:(e*w-n)/Y}else{const Y=Math.sqrt(A);O=Y===0?0:(e*w-n)/Y,B=Y/2}let L,F;y===0&&O===0?(L=0,F=0):S.sign(y)===S.sign(O)?(L=y+O,F=p/L):(F=y-O,L=p/F);let N,U;w===0&&B===0?(N=0,U=0):S.sign(w)===S.sign(B)?(N=w+B,U=i/N):(U=w-B,N=i/U);const M=Fn.computeRealRoots(1,L,N),j=Fn.computeRealRoots(1,F,U);if(M.length!==0)return j.length!==0?M[1]<=j[0]?[M[0],M[1],j[0],j[1]]:j[1]<=M[0]?[j[0],j[1],M[0],M[1]]:M[0]>=j[0]&&M[1]<=j[1]?[j[0],M[0],M[1],j[1]]:j[0]>=M[0]&&j[1]<=M[1]?[M[0],j[0],j[1],M[1]]:M[0]>j[0]&&M[0]<j[1]?[j[0],M[0],j[1],M[1]]:[M[0],j[0],M[1],j[1]]:M;if(j.length!==0)return j}return[]}th.computeRealRoots=function(e,t,n,i,o){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");if(typeof o!="number")throw new C("e is a required number.");if(Math.abs(e)<S.EPSILON15)return Cs.computeRealRoots(t,n,i,o);const a=t/e,r=n/e,f=i/e,c=o/e;let h=a<0?1:0;switch(h+=r<0?h+1:h,h+=f<0?h+1:h,h+=c<0?h+1:h,h){case 0:return Mn(a,r,f,c);case 1:return ws(a,r,f,c);case 2:return ws(a,r,f,c);case 3:return Mn(a,r,f,c);case 4:return Mn(a,r,f,c);case 5:return ws(a,r,f,c);case 6:return Mn(a,r,f,c);case 7:return Mn(a,r,f,c);case 8:return ws(a,r,f,c);case 9:return Mn(a,r,f,c);case 10:return Mn(a,r,f,c);case 11:return ws(a,r,f,c);case 12:return Mn(a,r,f,c);case 13:return Mn(a,r,f,c);case 14:return Mn(a,r,f,c);case 15:return Mn(a,r,f,c);default:return}};function Vo(e,t){t=u.clone(g(t,u.ZERO)),u.equals(t,u.ZERO)||u.normalize(t,t),this.origin=u.clone(g(e,u.ZERO)),this.direction=t}Vo.clone=function(e,t){if(l(e))return l(t)?(t.origin=u.clone(e.origin),t.direction=u.clone(e.direction),t):new Vo(e.origin,e.direction)},Vo.getPoint=function(e,t,n){return _.typeOf.object("ray",e),_.typeOf.number("t",t),l(n)||(n=new u),n=u.multiplyByScalar(e.direction,t,n),u.add(e.origin,n,n)};const Ue={};Ue.rayPlane=function(e,t,n){if(!l(e))throw new C("ray is required.");if(!l(t))throw new C("plane is required.");l(n)||(n=new u);const i=e.origin,o=e.direction,a=t.normal,r=u.dot(a,o);if(Math.abs(r)<S.EPSILON15)return;const f=(-t.distance-u.dot(a,i))/r;if(!(f<0))return n=u.multiplyByScalar(o,f,n),u.add(i,n,n)};const Fy=new u,My=new u,Qu=new u,Ju=new u,ed=new u;Ue.rayTriangleParametric=function(e,t,n,i,o){if(!l(e))throw new C("ray is required.");if(!l(t))throw new C("p0 is required.");if(!l(n))throw new C("p1 is required.");if(!l(i))throw new C("p2 is required.");o=g(o,!1);const a=e.origin,r=e.direction,f=u.subtract(n,t,Fy),c=u.subtract(i,t,My),h=u.cross(r,c,Qu),d=u.dot(f,h);let p,m,T,y,w;if(o){if(d<S.EPSILON6||(p=u.subtract(a,t,Ju),T=u.dot(p,h),T<0||T>d)||(m=u.cross(p,f,ed),y=u.dot(r,m),y<0||T+y>d))return;w=u.dot(c,m)/d}else{if(Math.abs(d)<S.EPSILON6)return;const A=1/d;if(p=u.subtract(a,t,Ju),T=u.dot(p,h)*A,T<0||T>1||(m=u.cross(p,f,ed),y=u.dot(r,m)*A,y<0||T+y>1))return;w=u.dot(c,m)*A}return w},Ue.rayTriangle=function(e,t,n,i,o,a){const r=Ue.rayTriangleParametric(e,t,n,i,o);if(!(!l(r)||r<0))return l(a)||(a=new u),u.multiplyByScalar(e.direction,r,a),u.add(e.origin,a,a)};const Uy=new Vo;Ue.lineSegmentTriangle=function(e,t,n,i,o,a,r){if(!l(e))throw new C("v0 is required.");if(!l(t))throw new C("v1 is required.");if(!l(n))throw new C("p0 is required.");if(!l(i))throw new C("p1 is required.");if(!l(o))throw new C("p2 is required.");const f=Uy;u.clone(e,f.origin),u.subtract(t,e,f.direction),u.normalize(f.direction,f.direction);const c=Ue.rayTriangleParametric(f,n,i,o,a);if(!(!l(c)||c<0||c>u.distance(e,t)))return l(r)||(r=new u),u.multiplyByScalar(f.direction,c,r),u.add(f.origin,r,r)};function ky(e,t,n,i){const o=t*t-4*e*n;if(o<0)return;if(o>0){const r=1/(2*e),f=Math.sqrt(o),c=(-t+f)*r,h=(-t-f)*r;return c<h?(i.root0=c,i.root1=h):(i.root0=h,i.root1=c),i}const a=-t/(2*e);if(a!==0)return i.root0=i.root1=a,i}const Vy={root0:0,root1:0};function td(e,t,n){l(n)||(n=new so);const i=e.origin,o=e.direction,a=t.center,r=t.radius*t.radius,f=u.subtract(i,a,Qu),c=u.dot(o,o),h=2*u.dot(o,f),d=u.magnitudeSquared(f)-r,p=ky(c,h,d,Vy);if(l(p))return n.start=p.root0,n.stop=p.root1,n}Ue.raySphere=function(e,t,n){if(!l(e))throw new C("ray is required.");if(!l(t))throw new C("sphere is required.");if(n=td(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};const Gy=new Vo;Ue.lineSegmentSphere=function(e,t,n,i){if(!l(e))throw new C("p0 is required.");if(!l(t))throw new C("p1 is required.");if(!l(n))throw new C("sphere is required.");const o=Gy;u.clone(e,o.origin);const a=u.subtract(t,e,o.direction),r=u.magnitude(a);if(u.normalize(a,a),i=td(o,n,i),!(!l(i)||i.stop<0||i.start>r))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,r),i};const qy=new u,Hy=new u;Ue.rayEllipsoid=function(e,t){if(!l(e))throw new C("ray is required.");if(!l(t))throw new C("ellipsoid is required.");const n=t.oneOverRadii,i=u.multiplyComponents(n,e.origin,qy),o=u.multiplyComponents(n,e.direction,Hy),a=u.magnitudeSquared(i),r=u.dot(i,o);let f,c,h,d,p;if(a>1){if(r>=0)return;const m=r*r;if(f=a-1,c=u.magnitudeSquared(o),h=c*f,m<h)return;if(m>h){d=r*r-h,p=-r+Math.sqrt(d);const y=p/c,w=f/p;return y<w?new so(y,w):{start:w,stop:y}}const T=Math.sqrt(f/c);return new so(T,T)}else if(a<1)return f=a-1,c=u.magnitudeSquared(o),h=c*f,d=r*r-h,p=-r+Math.sqrt(d),new so(0,p/c);if(r<0)return c=u.magnitudeSquared(o),new so(0,-r/c)};function ao(e,t,n){const i=e+t;return S.sign(e)!==S.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Ue.quadraticVectorExpression=function(e,t,n,i,o){const a=i*i,r=o*o,f=(e[G.COLUMN1ROW1]-e[G.COLUMN2ROW2])*r,c=o*(i*ao(e[G.COLUMN1ROW0],e[G.COLUMN0ROW1],S.EPSILON15)+t.y),h=e[G.COLUMN0ROW0]*a+e[G.COLUMN2ROW2]*r+i*t.x+n,d=r*ao(e[G.COLUMN2ROW1],e[G.COLUMN1ROW2],S.EPSILON15),p=o*(i*ao(e[G.COLUMN2ROW0],e[G.COLUMN0ROW2])+t.z);let m;const T=[];if(p===0&&d===0){if(m=Fn.computeRealRoots(f,c,h),m.length===0)return T;const N=m[0],U=Math.sqrt(Math.max(1-N*N,0));if(T.push(new u(i,o*N,o*-U)),T.push(new u(i,o*N,o*U)),m.length===2){const M=m[1],j=Math.sqrt(Math.max(1-M*M,0));T.push(new u(i,o*M,o*-j)),T.push(new u(i,o*M,o*j))}return T}const y=p*p,w=d*d,A=f*f,E=p*d,b=A+w,I=2*(c*f+E),O=2*h*f+c*c-w+y,B=2*(h*c-E),L=h*h-y;if(b===0&&I===0&&O===0&&B===0)return T;m=th.computeRealRoots(b,I,O,B,L);const F=m.length;if(F===0)return T;for(let N=0;N<F;++N){const U=m[N],M=U*U,j=Math.max(1-M,0),Y=Math.sqrt(j);let s;S.sign(f)===S.sign(h)?s=ao(f*M+h,c*U,S.EPSILON12):S.sign(h)===S.sign(c*U)?s=ao(f*M,c*U+h,S.EPSILON12):s=ao(f*M+c*U,h,S.EPSILON12);const x=ao(d*U,p,S.EPSILON15),P=s*x;P<0?T.push(new u(i,o*U,o*Y)):P>0?T.push(new u(i,o*U,o*-Y)):Y!==0?(T.push(new u(i,o*U,o*-Y)),T.push(new u(i,o*U,o*Y)),++N):T.push(new u(i,o*U,o*Y))}return T};const nh=new u,nd=new u,id=new u,oa=new u,jy=new u,Yy=new G,Xy=new G,$y=new G,Zy=new G,Ky=new G,od=new G,sd=new G,rd=new u,Qy=new u,Jy=new oe;Ue.grazingAltitudeLocation=function(e,t){if(!l(e))throw new C("ray is required.");if(!l(t))throw new C("ellipsoid is required.");const n=e.origin,i=e.direction;if(!u.equals(n,u.ZERO)){const L=t.geodeticSurfaceNormal(n,nh);if(u.dot(i,L)>=0)return n}const o=l(this.rayEllipsoid(e,t)),a=t.transformPositionToScaledSpace(i,nh),r=u.normalize(a,a),f=u.mostOrthogonalAxis(a,oa),c=u.normalize(u.cross(f,r,nd),nd),h=u.normalize(u.cross(r,c,id),id),d=Yy;d[0]=r.x,d[1]=r.y,d[2]=r.z,d[3]=c.x,d[4]=c.y,d[5]=c.z,d[6]=h.x,d[7]=h.y,d[8]=h.z;const p=G.transpose(d,Xy),m=G.fromScale(t.radii,$y),T=G.fromScale(t.oneOverRadii,Zy),y=Ky;y[0]=0,y[1]=-i.z,y[2]=i.y,y[3]=i.z,y[4]=0,y[5]=-i.x,y[6]=-i.y,y[7]=i.x,y[8]=0;const w=G.multiply(G.multiply(p,T,od),y,od),A=G.multiply(G.multiply(w,m,sd),d,sd),E=G.multiplyByVector(w,n,jy),b=Ue.quadraticVectorExpression(A,u.negate(E,nh),0,0,1);let I,O;const B=b.length;if(B>0){let L=u.clone(u.ZERO,Qy),F=Number.NEGATIVE_INFINITY;for(let U=0;U<B;++U){I=G.multiplyByVector(m,G.multiplyByVector(d,b[U],rd),rd);const M=u.normalize(u.subtract(I,n,oa),oa),j=u.dot(M,i);j>F&&(F=j,L=u.clone(I,L))}const N=t.cartesianToCartographic(L,Jy);return F=S.clamp(F,0,1),O=u.magnitude(u.subtract(L,n,oa))*Math.sqrt(1-F*F),O=o?-O:O,N.height=O,t.cartographicToCartesian(N,new u)}};const eC=new u;Ue.lineSegmentPlane=function(e,t,n,i){if(!l(e))throw new C("endPoint0 is required.");if(!l(t))throw new C("endPoint1 is required.");if(!l(n))throw new C("plane is required.");l(i)||(i=new u);const o=u.subtract(t,e,eC),a=n.normal,r=u.dot(a,o);if(Math.abs(r)<S.EPSILON6)return;const f=u.dot(a,e),c=-(n.distance+f)/r;if(!(c<0||c>1))return u.multiplyByScalar(o,c,i),u.add(e,i,i),i},Ue.trianglePlaneIntersection=function(e,t,n,i){if(!l(e)||!l(t)||!l(n)||!l(i))throw new C("p0, p1, p2, and plane are required.");const o=i.normal,a=i.distance,r=u.dot(o,e)+a<0,f=u.dot(o,t)+a<0,c=u.dot(o,n)+a<0;let h=0;h+=r?1:0,h+=f?1:0,h+=c?1:0;let d,p;if((h===1||h===2)&&(d=new u,p=new u),h===1){if(r)return Ue.lineSegmentPlane(e,t,i,d),Ue.lineSegmentPlane(e,n,i,p),{positions:[e,t,n,d,p],indices:[0,3,4,1,2,4,1,4,3]};if(f)return Ue.lineSegmentPlane(t,n,i,d),Ue.lineSegmentPlane(t,e,i,p),{positions:[e,t,n,d,p],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Ue.lineSegmentPlane(n,e,i,d),Ue.lineSegmentPlane(n,t,i,p),{positions:[e,t,n,d,p],indices:[2,3,4,0,1,4,0,4,3]}}else if(h===2)if(r)if(f){if(!c)return Ue.lineSegmentPlane(e,n,i,d),Ue.lineSegmentPlane(t,n,i,p),{positions:[e,t,n,d,p],indices:[0,1,4,0,4,3,2,3,4]}}else return Ue.lineSegmentPlane(n,t,i,d),Ue.lineSegmentPlane(e,t,i,p),{positions:[e,t,n,d,p],indices:[2,0,4,2,4,3,1,3,4]};else return Ue.lineSegmentPlane(t,e,i,d),Ue.lineSegmentPlane(n,e,i,p),{positions:[e,t,n,d,p],indices:[1,2,4,1,4,3,0,3,4]}};const ih=new Z;function oi(e,t){if(_.defined("origin",e),t=g(t,pe.default),e=t.scaleToGeodeticSurface(e),!l(e))throw new C("origin must not be at the center of the ellipsoid.");const n=Ce.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=u.fromCartesian4(k.getColumn(n,0,ih)),this._yAxis=u.fromCartesian4(k.getColumn(n,1,ih));const i=u.fromCartesian4(k.getColumn(n,2,ih));this._plane=Me.fromPointNormal(e,i)}Object.defineProperties(oi.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});const tC=new Qt;oi.fromPoints=function(e,t){_.defined("cartesians",e);const n=Qt.fromPoints(e,tC);return new oi(n.center,t)};const ad=new Vo,sa=new u;oi.prototype.projectPointOntoPlane=function(e,t){_.defined("cartesian",e);const n=ad;n.origin=e,u.normalize(e,n.direction);let i=Ue.rayPlane(n,this._plane,sa);if(l(i)||(u.negate(n.direction,n.direction),i=Ue.rayPlane(n,this._plane,sa)),l(i)){const o=u.subtract(i,this._origin,i),a=u.dot(this._xAxis,o),r=u.dot(this._yAxis,o);return l(t)?(t.x=a,t.y=r,t):new q(a,r)}},oi.prototype.projectPointsOntoPlane=function(e,t){_.defined("cartesians",e),l(t)||(t=[]);let n=0;const i=e.length;for(let o=0;o<i;o++){const a=this.projectPointOntoPlane(e[o],t[n]);l(a)&&(t[n]=a,n++)}return t.length=n,t},oi.prototype.projectPointToNearestOnPlane=function(e,t){_.defined("cartesian",e),l(t)||(t=new q);const n=ad;n.origin=e,u.clone(this._plane.normal,n.direction);let i=Ue.rayPlane(n,this._plane,sa);l(i)||(u.negate(n.direction,n.direction),i=Ue.rayPlane(n,this._plane,sa));const o=u.subtract(i,this._origin,i),a=u.dot(this._xAxis,o),r=u.dot(this._yAxis,o);return t.x=a,t.y=r,t},oi.prototype.projectPointsToNearestOnPlane=function(e,t){_.defined("cartesians",e),l(t)||(t=[]);const n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};const nC=new u;oi.prototype.projectPointOntoEllipsoid=function(e,t){_.defined("cartesian",e),l(t)||(t=new u);const n=this._ellipsoid,i=this._origin,o=this._xAxis,a=this._yAxis,r=nC;return u.multiplyByScalar(o,e.x,r),t=u.add(i,r,t),u.multiplyByScalar(a,e.y,r),u.add(t,r,t),n.scaleToGeocentricSurface(t,t),t},oi.prototype.projectPointsOntoEllipsoid=function(e,t){_.defined("cartesians",e);const n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};function ze(e,t){this.center=u.clone(g(e,u.ZERO)),this.halfAxes=G.clone(g(t,G.ZERO))}ze.packedLength=u.packedLength+G.packedLength,ze.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),u.pack(e.center,t,n),G.pack(e.halfAxes,t,n+u.packedLength),t},ze.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new ze),u.unpack(e,t,n.center),G.unpack(e,t+u.packedLength,n.halfAxes),n};const iC=new u,oC=new u,sC=new u,rC=new u,aC=new u,cC=new u,hC=new G,fC={unitary:new G,diagonal:new G};ze.fromPoints=function(e,t){if(l(t)||(t=new ze),!l(e)||e.length===0)return t.halfAxes=G.ZERO,t.center=u.ZERO,t;let n;const i=e.length,o=u.clone(e[0],iC);for(n=1;n<i;n++)u.add(o,e[n],o);const a=1/i;u.multiplyByScalar(o,a,o);let r=0,f=0,c=0,h=0,d=0,p=0,m;for(n=0;n<i;n++)m=u.subtract(e[n],o,oC),r+=m.x*m.x,f+=m.x*m.y,c+=m.x*m.z,h+=m.y*m.y,d+=m.y*m.z,p+=m.z*m.z;r*=a,f*=a,c*=a,h*=a,d*=a,p*=a;const T=hC;T[0]=r,T[1]=f,T[2]=c,T[3]=f,T[4]=h,T[5]=d,T[6]=c,T[7]=d,T[8]=p;const y=G.computeEigenDecomposition(T,fC),w=G.clone(y.unitary,t.halfAxes);let A=G.getColumn(w,0,rC),E=G.getColumn(w,1,aC),b=G.getColumn(w,2,cC),I=-Number.MAX_VALUE,O=-Number.MAX_VALUE,B=-Number.MAX_VALUE,L=Number.MAX_VALUE,F=Number.MAX_VALUE,N=Number.MAX_VALUE;for(n=0;n<i;n++)m=e[n],I=Math.max(u.dot(A,m),I),O=Math.max(u.dot(E,m),O),B=Math.max(u.dot(b,m),B),L=Math.min(u.dot(A,m),L),F=Math.min(u.dot(E,m),F),N=Math.min(u.dot(b,m),N);A=u.multiplyByScalar(A,.5*(L+I),A),E=u.multiplyByScalar(E,.5*(F+O),E),b=u.multiplyByScalar(b,.5*(N+B),b);const U=u.add(A,E,t.center);u.add(U,b,U);const M=sC;return M.x=I-L,M.y=O-F,M.z=B-N,u.multiplyByScalar(M,.5,M),G.multiplyByScale(t.halfAxes,M,t.halfAxes),t};const cd=new u,lC=new u;function hd(e,t,n,i,o,a,r,f,c,h,d){if(!l(o)||!l(a)||!l(r)||!l(f)||!l(c)||!l(h))throw new C("all extents (minimum/maximum X/Y/Z) are required.");l(d)||(d=new ze);const p=d.halfAxes;G.setColumn(p,0,t,p),G.setColumn(p,1,n,p),G.setColumn(p,2,i,p);let m=cd;m.x=(o+a)/2,m.y=(r+f)/2,m.z=(c+h)/2;const T=lC;T.x=(a-o)/2,T.y=(f-r)/2,T.z=(h-c)/2;const y=d.center;return m=G.multiplyByVector(p,m,m),u.add(e,m,y),G.multiplyByScale(p,T,p),d}const fd=new oe,uC=new u,dC=new oe,pC=new oe,mC=new oe,_C=new oe,gC=new oe,TC=new u,ld=new u,yC=new u,ud=new u,CC=new u,wC=new q,AC=new q,EC=new q,bC=new q,xC=new q,SC=new u,IC=new u,DC=new u,OC=new u,vC=new q,WC=new u,PC=new u,BC=new u,RC=new Me(u.UNIT_X,0);ze.fromRectangle=function(e,t,n,i,o){if(!l(e))throw new C("rectangle is required");if(e.width<0||e.width>S.TWO_PI)throw new C("Rectangle width must be between 0 and 2 * pi");if(e.height<0||e.height>S.PI)throw new C("Rectangle height must be between 0 and pi");if(l(i)&&!S.equalsEpsilon(i.radii.x,i.radii.y,S.EPSILON15))throw new C("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t=g(t,0),n=g(n,0),i=g(i,pe.default);let a,r,f,c,h,d,p;if(e.width<=S.PI){const F=de.center(e,fd),N=i.cartographicToCartesian(F,uC),U=new oi(N,i);p=U.plane;const M=F.longitude,j=e.south<0&&e.north>0?0:F.latitude,Y=oe.fromRadians(M,e.north,n,dC),s=oe.fromRadians(e.west,e.north,n,pC),x=oe.fromRadians(e.west,j,n,mC),P=oe.fromRadians(e.west,e.south,n,_C),z=oe.fromRadians(M,e.south,n,gC),H=i.cartographicToCartesian(Y,TC);let X=i.cartographicToCartesian(s,ld);const ee=i.cartographicToCartesian(x,yC);let K=i.cartographicToCartesian(P,ud);const ce=i.cartographicToCartesian(z,CC),le=U.projectPointToNearestOnPlane(H,wC),we=U.projectPointToNearestOnPlane(X,AC),Se=U.projectPointToNearestOnPlane(ee,EC),Ee=U.projectPointToNearestOnPlane(K,bC),Le=U.projectPointToNearestOnPlane(ce,xC);return a=Math.min(we.x,Se.x,Ee.x),r=-a,c=Math.max(we.y,le.y),f=Math.min(Ee.y,Le.y),s.height=P.height=t,X=i.cartographicToCartesian(s,ld),K=i.cartographicToCartesian(P,ud),h=Math.min(Me.getPointDistance(p,X),Me.getPointDistance(p,K)),d=n,hd(U.origin,U.xAxis,U.yAxis,U.zAxis,a,r,f,c,h,d,o)}const m=e.south>0,T=e.north<0,y=m?e.south:T?e.north:0,w=de.center(e,fd).longitude,A=u.fromRadians(w,y,n,i,SC);A.z=0;const b=Math.abs(A.x)<S.EPSILON10&&Math.abs(A.y)<S.EPSILON10?u.UNIT_X:u.normalize(A,IC),I=u.UNIT_Z,O=u.cross(b,I,DC);p=Me.fromPointNormal(A,b,RC);const B=u.fromRadians(w+S.PI_OVER_TWO,y,n,i,OC);r=u.dot(Me.projectPointOntoPlane(p,B,vC),O),a=-r,c=u.fromRadians(0,e.north,T?t:n,i,WC).z,f=u.fromRadians(0,e.south,m?t:n,i,PC).z;const L=u.fromRadians(e.east,y,n,i,BC);return h=Me.getPointDistance(p,L),d=0,hd(A,O,I,b,a,r,f,c,h,d,o)},ze.fromTransformation=function(e,t){return _.typeOf.object("transformation",e),l(t)||(t=new ze),t.center=k.getTranslation(e,t.center),t.halfAxes=k.getMatrix3(e,t.halfAxes),t.halfAxes=G.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},ze.clone=function(e,t){if(l(e))return l(t)?(u.clone(e.center,t.center),G.clone(e.halfAxes,t.halfAxes),t):new ze(e.center,e.halfAxes)},ze.intersectPlane=function(e,t){if(!l(e))throw new C("box is required.");if(!l(t))throw new C("plane is required.");const n=e.center,i=t.normal,o=e.halfAxes,a=i.x,r=i.y,f=i.z,c=Math.abs(a*o[G.COLUMN0ROW0]+r*o[G.COLUMN0ROW1]+f*o[G.COLUMN0ROW2])+Math.abs(a*o[G.COLUMN1ROW0]+r*o[G.COLUMN1ROW1]+f*o[G.COLUMN1ROW2])+Math.abs(a*o[G.COLUMN2ROW0]+r*o[G.COLUMN2ROW1]+f*o[G.COLUMN2ROW2]),h=u.dot(i,n)+t.distance;return h<=-c?xt.OUTSIDE:h>=c?xt.INSIDE:xt.INTERSECTING};const dd=new u,pd=new u,md=new u,zC=new u,_d=new u,LC=new u;ze.distanceSquaredTo=function(e,t){if(!l(e))throw new C("box is required.");if(!l(t))throw new C("cartesian is required.");const n=u.subtract(t,e.center,cd),i=e.halfAxes;let o=G.getColumn(i,0,dd),a=G.getColumn(i,1,pd),r=G.getColumn(i,2,md);const f=u.magnitude(o),c=u.magnitude(a),h=u.magnitude(r);let d=!0,p=!0,m=!0;f>0?u.divideByScalar(o,f,o):d=!1,c>0?u.divideByScalar(a,c,a):p=!1,h>0?u.divideByScalar(r,h,r):m=!1;const T=!d+!p+!m;let y,w,A;if(T===1){let O=o;y=a,w=r,p?m||(O=r,w=o):(O=a,y=o),A=u.cross(y,w,_d),O===o?o=A:O===a?a=A:O===r&&(r=A)}else if(T===2){y=o,p?y=a:m&&(y=r);let O=u.UNIT_Y;O.equalsEpsilon(y,S.EPSILON3)&&(O=u.UNIT_X),w=u.cross(y,O,zC),u.normalize(w,w),A=u.cross(y,w,_d),u.normalize(A,A),y===o?(a=w,r=A):y===a?(r=w,o=A):y===r&&(o=w,a=A)}else T===3&&(o=u.UNIT_X,a=u.UNIT_Y,r=u.UNIT_Z);const E=LC;E.x=u.dot(n,o),E.y=u.dot(n,a),E.z=u.dot(n,r);let b=0,I;return E.x<-f?(I=E.x+f,b+=I*I):E.x>f&&(I=E.x-f,b+=I*I),E.y<-c?(I=E.y+c,b+=I*I):E.y>c&&(I=E.y-c,b+=I*I),E.z<-h?(I=E.z+h,b+=I*I):E.z>h&&(I=E.z-h,b+=I*I),b};const NC=new u,FC=new u;ze.computePlaneDistances=function(e,t,n,i){if(!l(e))throw new C("box is required.");if(!l(t))throw new C("position is required.");if(!l(n))throw new C("direction is required.");l(i)||(i=new so);let o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;const r=e.center,f=e.halfAxes,c=G.getColumn(f,0,dd),h=G.getColumn(f,1,pd),d=G.getColumn(f,2,md),p=u.add(c,h,NC);u.add(p,d,p),u.add(p,r,p);const m=u.subtract(p,t,FC);let T=u.dot(n,m);return o=Math.min(T,o),a=Math.max(T,a),u.add(r,c,p),u.add(p,h,p),u.subtract(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),u.add(r,c,p),u.subtract(p,h,p),u.add(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),u.add(r,c,p),u.subtract(p,h,p),u.subtract(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),u.subtract(r,c,p),u.add(p,h,p),u.add(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),u.subtract(r,c,p),u.add(p,h,p),u.subtract(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),u.subtract(r,c,p),u.subtract(p,h,p),u.add(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),u.subtract(r,c,p),u.subtract(p,h,p),u.subtract(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),i.start=o,i.stop=a,i};const MC=new u,UC=new u,kC=new u;ze.computeCorners=function(e,t){_.typeOf.object("box",e),l(t)||(t=[new u,new u,new u,new u,new u,new u,new u,new u]);const n=e.center,i=e.halfAxes,o=G.getColumn(i,0,MC),a=G.getColumn(i,1,UC),r=G.getColumn(i,2,kC);return u.clone(n,t[0]),u.subtract(t[0],o,t[0]),u.subtract(t[0],a,t[0]),u.subtract(t[0],r,t[0]),u.clone(n,t[1]),u.subtract(t[1],o,t[1]),u.subtract(t[1],a,t[1]),u.add(t[1],r,t[1]),u.clone(n,t[2]),u.subtract(t[2],o,t[2]),u.add(t[2],a,t[2]),u.subtract(t[2],r,t[2]),u.clone(n,t[3]),u.subtract(t[3],o,t[3]),u.add(t[3],a,t[3]),u.add(t[3],r,t[3]),u.clone(n,t[4]),u.add(t[4],o,t[4]),u.subtract(t[4],a,t[4]),u.subtract(t[4],r,t[4]),u.clone(n,t[5]),u.add(t[5],o,t[5]),u.subtract(t[5],a,t[5]),u.add(t[5],r,t[5]),u.clone(n,t[6]),u.add(t[6],o,t[6]),u.add(t[6],a,t[6]),u.subtract(t[6],r,t[6]),u.clone(n,t[7]),u.add(t[7],o,t[7]),u.add(t[7],a,t[7]),u.add(t[7],r,t[7]),t};const VC=new G;ze.computeTransformation=function(e,t){_.typeOf.object("box",e),l(t)||(t=new k);const n=e.center,i=G.multiplyByUniformScale(e.halfAxes,2,VC);return k.fromRotationTranslation(i,n,t)};const GC=new te;ze.isOccluded=function(e,t){if(!l(e))throw new C("box is required.");if(!l(t))throw new C("occluder is required.");const n=te.fromOrientedBoundingBox(e,GC);return!t.isBoundingSphereVisible(n)},ze.prototype.intersectPlane=function(e){return ze.intersectPlane(this,e)},ze.prototype.distanceSquaredTo=function(e){return ze.distanceSquaredTo(this,e)},ze.prototype.computePlaneDistances=function(e,t,n){return ze.computePlaneDistances(this,e,t,n)},ze.prototype.computeCorners=function(e){return ze.computeCorners(this,e)},ze.prototype.computeTransformation=function(e){return ze.computeTransformation(this,e)},ze.prototype.isOccluded=function(e){return ze.isOccluded(this,e)},ze.equals=function(e,t){return e===t||l(e)&&l(t)&&u.equals(e.center,t.center)&&G.equals(e.halfAxes,t.halfAxes)},ze.prototype.clone=function(e){return ze.clone(this,e)},ze.prototype.equals=function(e){return ze.equals(this,e)};const As={};As.getHeight=function(e,t,n){if(!Number.isFinite(t))throw new C("scale must be a finite number.");if(!Number.isFinite(n))throw new C("relativeHeight must be a finite number.");return(e-n)*t+n};const qC=new oe;As.getPosition=function(e,t,n,i,o){const a=t.cartesianToCartographic(e,qC);if(!l(a))return u.clone(e,o);const r=As.getHeight(a.height,n,i);return u.fromRadians(a.longitude,a.latitude,r,t,o)};const HC=`in vec3 position3DHigh;
4505
+ `;function Kt(e){e=g(e,g.EMPTY_OBJECT);const t=g(e.translucent,!0),n=g(e.closed,!1),i=g(e.flat,!1),o=i?Ry:By,a=i?Hu:Py,r=i?Kt.FLAT_VERTEX_FORMAT:Kt.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=g(e.vertexShaderSource,o),this._fragmentShaderSource=g(e.fragmentShaderSource,a),this._renderState=Gt.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=r,this._flat=i,this._faceForward=g(e.faceForward,!n)}Object.defineProperties(Kt.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),Kt.VERTEX_FORMAT=ut.POSITION_AND_NORMAL,Kt.FLAT_VERTEX_FORMAT=ut.POSITION_ONLY,Kt.prototype.getFragmentShaderSource=Gt.prototype.getFragmentShaderSource,Kt.prototype.isTranslucent=Gt.prototype.isTranslucent,Kt.prototype.getRenderState=Gt.prototype.getRenderState;function Uo(e){this._definitionChanged=new Ne,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(Uo.prototype,{isConstant:{get:function(){return ve.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:V("color")}),Uo.prototype.getType=function(e){return"Color"};const zy=new J;Uo.prototype.getValue=function(e,t){return l(e)||(e=J.now(zy)),l(t)||(t={}),t.color=ve.getValueOrClonedDefault(this._color,e,I.WHITE,t.color),t},Uo.prototype.equals=function(e){return this===e||e instanceof Uo&&ve.equals(this._color,e._color)};function Gi(e){e=g(e,g.EMPTY_OBJECT),this._ellipsoid=g(e.ellipsoid,pe.default),this._rectangle=g(e.rectangle,de.MAX_VALUE),this._projection=new Wn(this._ellipsoid),this._numberOfLevelZeroTilesX=g(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=g(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(Gi.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),Gi.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},Gi.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},Gi.prototype.rectangleToNativeRectangle=function(e,t){_.defined("rectangle",e);const n=S.toDegrees(e.west),i=S.toDegrees(e.south),o=S.toDegrees(e.east),a=S.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=a,t):new de(n,i,o,a)},Gi.prototype.tileXYToNativeRectangle=function(e,t,n,i){const o=this.tileXYToRectangle(e,t,n,i);return o.west=S.toDegrees(o.west),o.south=S.toDegrees(o.south),o.east=S.toDegrees(o.east),o.north=S.toDegrees(o.north),o},Gi.prototype.tileXYToRectangle=function(e,t,n,i){const o=this._rectangle,a=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),f=o.width/a,c=e*f+o.west,h=(e+1)*f+o.west,d=o.height/r,p=o.north-t*d,m=o.north-(t+1)*d;return l(i)||(i=new de(c,m,h,p)),i.west=c,i.south=m,i.east=h,i.north=p,i},Gi.prototype.positionToTileXY=function(e,t,n){const i=this._rectangle;if(!de.contains(i,e))return;const o=this.getNumberOfXTilesAtLevel(t),a=this.getNumberOfYTilesAtLevel(t),r=i.width/o,f=i.height/a;let c=e.longitude;i.east<i.west&&(c+=S.TWO_PI);let h=(c-i.west)/r|0;h>=o&&(h=o-1);let d=(i.north-e.latitude)/f|0;return d>=a&&(d=a-1),l(n)?(n.x=h,n.y=d,n):new q(h,d)};const ju=new u,Yu=new u,Xu=new oe,Jc=new u,Ly=new u,$u=new te,Ny=new Gi,Ts=[new oe,new oe,new oe,new oe],ys=new q,Ve={};Ve.initialize=function(){let e=Ve._initPromise;return l(e)||(e=ae.fetchJson(_n("Assets/approximateTerrainHeights.json")).then(function(t){Ve._terrainHeights=t}),Ve._initPromise=e),e},Ve.getMinimumMaximumHeights=function(e,t){if(_.defined("rectangle",e),!l(Ve._terrainHeights))throw new C("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=g(t,pe.default);const n=Zu(e);let i=Ve._defaultMinTerrainHeight,o=Ve._defaultMaxTerrainHeight;if(l(n)){const a=`${n.level}-${n.x}-${n.y}`,r=Ve._terrainHeights[a];l(r)&&(i=r[0],o=r[1]),t.cartographicToCartesian(de.northeast(e,Xu),ju),t.cartographicToCartesian(de.southwest(e,Xu),Yu),u.midpoint(Yu,ju,Jc);const f=t.scaleToGeodeticSurface(Jc,Ly);if(l(f)){const c=u.distance(Jc,f);i=Math.min(i,-c)}else i=Ve._defaultMinTerrainHeight}return i=Math.max(Ve._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}},Ve.getBoundingSphere=function(e,t){if(_.defined("rectangle",e),!l(Ve._terrainHeights))throw new C("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=g(t,pe.default);const n=Zu(e);let i=Ve._defaultMaxTerrainHeight;if(l(n)){const a=`${n.level}-${n.x}-${n.y}`,r=Ve._terrainHeights[a];l(r)&&(i=r[1])}const o=te.fromRectangle3D(e,t,0);return te.fromRectangle3D(e,t,i,$u),te.union(o,$u,o)};function Zu(e){oe.fromRadians(e.east,e.north,0,Ts[0]),oe.fromRadians(e.west,e.north,0,Ts[1]),oe.fromRadians(e.east,e.south,0,Ts[2]),oe.fromRadians(e.west,e.south,0,Ts[3]);let t=0,n=0,i=0,o=0;const a=Ve._terrainHeightsMaxLevel;let r;for(r=0;r<=a;++r){let f=!1;for(let c=0;c<4;++c){const h=Ts[c];if(Ny.positionToTileXY(h,r,ys),c===0)i=ys.x,o=ys.y;else if(i!==ys.x||o!==ys.y){f=!0;break}}if(f)break;t=i,n=o}if(r!==0)return{x:t,y:n,level:r>a?a:r-1}}Ve._terrainHeightsMaxLevel=6,Ve._defaultMaxTerrainHeight=9e3,Ve._defaultMinTerrainHeight=-1e5,Ve._terrainHeights=void 0,Ve._initPromise=void 0,Object.defineProperties(Ve,{initialized:{get:function(){return l(Ve._terrainHeights)}}});function Qt(e,t,n){this.minimum=u.clone(g(e,u.ZERO)),this.maximum=u.clone(g(t,u.ZERO)),l(n)?n=u.clone(n):n=u.midpoint(this.minimum,this.maximum,new u),this.center=n}Qt.fromCorners=function(e,t,n){return _.defined("minimum",e),_.defined("maximum",t),l(n)||(n=new Qt),n.minimum=u.clone(e,n.minimum),n.maximum=u.clone(t,n.maximum),n.center=u.midpoint(e,t,n.center),n},Qt.fromPoints=function(e,t){if(l(t)||(t=new Qt),!l(e)||e.length===0)return t.minimum=u.clone(u.ZERO,t.minimum),t.maximum=u.clone(u.ZERO,t.maximum),t.center=u.clone(u.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,a=e[0].x,r=e[0].y,f=e[0].z;const c=e.length;for(let p=1;p<c;p++){const m=e[p],T=m.x,y=m.y,w=m.z;n=Math.min(T,n),a=Math.max(T,a),i=Math.min(y,i),r=Math.max(y,r),o=Math.min(w,o),f=Math.max(w,f)}const h=t.minimum;h.x=n,h.y=i,h.z=o;const d=t.maximum;return d.x=a,d.y=r,d.z=f,t.center=u.midpoint(h,d,t.center),t},Qt.clone=function(e,t){if(l(e))return l(t)?(t.minimum=u.clone(e.minimum,t.minimum),t.maximum=u.clone(e.maximum,t.maximum),t.center=u.clone(e.center,t.center),t):new Qt(e.minimum,e.maximum,e.center)},Qt.equals=function(e,t){return e===t||l(e)&&l(t)&&u.equals(e.center,t.center)&&u.equals(e.minimum,t.minimum)&&u.equals(e.maximum,t.maximum)};let ia=new u;Qt.intersectPlane=function(e,t){_.defined("box",e),_.defined("plane",t),ia=u.subtract(e.maximum,e.minimum,ia);const n=u.multiplyByScalar(ia,.5,ia),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),a=u.dot(e.center,i)+t.distance;return a-o>0?xt.INSIDE:a+o<0?xt.OUTSIDE:xt.INTERSECTING},Qt.prototype.clone=function(e){return Qt.clone(this,e)},Qt.prototype.intersectPlane=function(e){return Qt.intersectPlane(this,e)},Qt.prototype.equals=function(e){return Qt.equals(this,e)};const Nn={};Nn.computeDiscriminant=function(e,t,n){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");return t*t-4*e*n};function Ku(e,t,n){const i=e+t;return S.sign(e)!==S.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Nn.computeRealRoots=function(e,t,n){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];const c=Math.abs(n),h=Math.abs(e);if(c<h&&c/h<S.EPSILON14)return[0,0];if(c>h&&h/c<S.EPSILON14)return[];if(i=-n/e,i<0)return[];const d=Math.sqrt(i);return[-d,d]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];const o=t*t,a=4*e*n,r=Ku(o,-a,S.EPSILON14);if(r<0)return[];const f=-.5*Ku(t,S.sign(t)*Math.sqrt(r),S.EPSILON14);return t>0?[f/e,n/f]:[n/f,f/e]};const Cs={};Cs.computeDiscriminant=function(e,t,n,i){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");const o=e*e,a=t*t,r=n*n,f=i*i;return 18*e*t*n*i+a*r-27*o*f-4*(e*r*n+a*t*i)};function eh(e,t,n,i){const o=e,a=t/3,r=n/3,f=i,c=o*r,h=a*f,d=a*a,p=r*r,m=o*r-d,T=o*f-a*r,y=a*f-p,w=4*m*y-T*T;let A,E;if(w<0){let ce,le,we;d*h>=c*p?(ce=o,le=m,we=-2*a*m+o*T):(ce=f,le=y,we=-f*T+2*r*y);const Ee=-(we<0?-1:1)*Math.abs(ce)*Math.sqrt(-w);E=-we+Ee;const Le=E/2,Ke=Le<0?-Math.pow(-Le,1/3):Math.pow(Le,1/3),ct=E===Ee?-Ke:-le/Ke;return A=le<=0?Ke+ct:-we/(Ke*Ke+ct*ct+le),d*h>=c*p?[(A-a)/o]:[-f/(A+r)]}const b=m,D=-2*a*m+o*T,O=y,B=-f*T+2*r*y,L=Math.sqrt(w),F=Math.sqrt(3)/2;let N=Math.abs(Math.atan2(o*L,-D)/3);A=2*Math.sqrt(-b);let U=Math.cos(N);E=A*U;let M=A*(-U/2-F*Math.sin(N));const j=E+M>2*a?E-a:M-a,Y=o,s=j/Y;N=Math.abs(Math.atan2(f*L,-B)/3),A=2*Math.sqrt(-O),U=Math.cos(N),E=A*U,M=A*(-U/2-F*Math.sin(N));const x=-f,P=E+M<2*r?E+r:M+r,z=x/P,H=Y*P,X=-j*P-Y*x,ee=j*x,K=(r*X-a*ee)/(-a*X+r*H);return s<=K?s<=z?K<=z?[s,K,z]:[s,z,K]:[z,s,K]:s<=z?[K,s,z]:K<=z?[K,z,s]:[z,K,s]}Cs.computeRealRoots=function(e,t,n,i){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");let o,a;if(e===0)return Nn.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];a=-i/e;const r=a<0?-Math.pow(-a,1/3):Math.pow(a,1/3);return[r,r,r]}else if(i===0)return o=Nn.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return eh(e,0,n,i)}else{if(n===0)return i===0?(a=-t/e,a<0?[a,0,0]:[0,0,a]):eh(e,t,0,i);if(i===0)return o=Nn.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return eh(e,t,n,i)};const th={};th.computeDiscriminant=function(e,t,n,i,o){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");if(typeof o!="number")throw new C("e is a required number.");const a=e*e,r=a*e,f=t*t,c=f*t,h=n*n,d=h*n,p=i*i,m=p*i,T=o*o,y=T*o;return f*h*p-4*c*m-4*e*d*p+18*e*t*n*m-27*a*p*p+256*r*y+o*(18*c*n*i-4*f*d+16*e*h*h-80*e*t*h*i-6*e*f*p+144*a*n*p)+T*(144*e*f*n-27*f*f-128*a*h-192*a*t*i)};function Fn(e,t,n,i){const o=e*e,a=t-3*o/8,r=n-t*e/2+o*e/8,f=i-n*e/4+t*o/16-3*o*o/256,c=Cs.computeRealRoots(1,2*a,a*a-4*f,-r*r);if(c.length>0){const h=-e/4,d=c[c.length-1];if(Math.abs(d)<S.EPSILON14){const p=Nn.computeRealRoots(1,a,f);if(p.length===2){const m=p[0],T=p[1];let y;if(m>=0&&T>=0){const w=Math.sqrt(m),A=Math.sqrt(T);return[h-A,h-w,h+w,h+A]}else{if(m>=0&&T<0)return y=Math.sqrt(m),[h-y,h+y];if(m<0&&T>=0)return y=Math.sqrt(T),[h-y,h+y]}}return[]}else if(d>0){const p=Math.sqrt(d),m=(a+d-r/p)/2,T=(a+d+r/p)/2,y=Nn.computeRealRoots(1,p,m),w=Nn.computeRealRoots(1,-p,T);return y.length!==0?(y[0]+=h,y[1]+=h,w.length!==0?(w[0]+=h,w[1]+=h,y[1]<=w[0]?[y[0],y[1],w[0],w[1]]:w[1]<=y[0]?[w[0],w[1],y[0],y[1]]:y[0]>=w[0]&&y[1]<=w[1]?[w[0],y[0],y[1],w[1]]:w[0]>=y[0]&&w[1]<=y[1]?[y[0],w[0],w[1],y[1]]:y[0]>w[0]&&y[0]<w[1]?[w[0],y[0],w[1],y[1]]:[y[0],w[0],y[1],w[1]]):y):w.length!==0?(w[0]+=h,w[1]+=h,w):[]}}return[]}function ws(e,t,n,i){const o=n*n,a=t*t,r=e*e,f=-2*t,c=n*e+a-4*i,h=r*i-n*t*e+o,d=Cs.computeRealRoots(1,f,c,h);if(d.length>0){const p=d[0],m=t-p,T=m*m,y=e/2,w=m/2,A=T-4*i,E=T+4*Math.abs(i),b=r-4*p,D=r+4*Math.abs(p);let O,B;if(p<0||A*D<b*E){const Y=Math.sqrt(b);O=Y/2,B=Y===0?0:(e*w-n)/Y}else{const Y=Math.sqrt(A);O=Y===0?0:(e*w-n)/Y,B=Y/2}let L,F;y===0&&O===0?(L=0,F=0):S.sign(y)===S.sign(O)?(L=y+O,F=p/L):(F=y-O,L=p/F);let N,U;w===0&&B===0?(N=0,U=0):S.sign(w)===S.sign(B)?(N=w+B,U=i/N):(U=w-B,N=i/U);const M=Nn.computeRealRoots(1,L,N),j=Nn.computeRealRoots(1,F,U);if(M.length!==0)return j.length!==0?M[1]<=j[0]?[M[0],M[1],j[0],j[1]]:j[1]<=M[0]?[j[0],j[1],M[0],M[1]]:M[0]>=j[0]&&M[1]<=j[1]?[j[0],M[0],M[1],j[1]]:j[0]>=M[0]&&j[1]<=M[1]?[M[0],j[0],j[1],M[1]]:M[0]>j[0]&&M[0]<j[1]?[j[0],M[0],j[1],M[1]]:[M[0],j[0],M[1],j[1]]:M;if(j.length!==0)return j}return[]}th.computeRealRoots=function(e,t,n,i,o){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");if(typeof o!="number")throw new C("e is a required number.");if(Math.abs(e)<S.EPSILON15)return Cs.computeRealRoots(t,n,i,o);const a=t/e,r=n/e,f=i/e,c=o/e;let h=a<0?1:0;switch(h+=r<0?h+1:h,h+=f<0?h+1:h,h+=c<0?h+1:h,h){case 0:return Fn(a,r,f,c);case 1:return ws(a,r,f,c);case 2:return ws(a,r,f,c);case 3:return Fn(a,r,f,c);case 4:return Fn(a,r,f,c);case 5:return ws(a,r,f,c);case 6:return Fn(a,r,f,c);case 7:return Fn(a,r,f,c);case 8:return ws(a,r,f,c);case 9:return Fn(a,r,f,c);case 10:return Fn(a,r,f,c);case 11:return ws(a,r,f,c);case 12:return Fn(a,r,f,c);case 13:return Fn(a,r,f,c);case 14:return Fn(a,r,f,c);case 15:return Fn(a,r,f,c);default:return}};function ko(e,t){t=u.clone(g(t,u.ZERO)),u.equals(t,u.ZERO)||u.normalize(t,t),this.origin=u.clone(g(e,u.ZERO)),this.direction=t}ko.clone=function(e,t){if(l(e))return l(t)?(t.origin=u.clone(e.origin),t.direction=u.clone(e.direction),t):new ko(e.origin,e.direction)},ko.getPoint=function(e,t,n){return _.typeOf.object("ray",e),_.typeOf.number("t",t),l(n)||(n=new u),n=u.multiplyByScalar(e.direction,t,n),u.add(e.origin,n,n)};const Ue={};Ue.rayPlane=function(e,t,n){if(!l(e))throw new C("ray is required.");if(!l(t))throw new C("plane is required.");l(n)||(n=new u);const i=e.origin,o=e.direction,a=t.normal,r=u.dot(a,o);if(Math.abs(r)<S.EPSILON15)return;const f=(-t.distance-u.dot(a,i))/r;if(!(f<0))return n=u.multiplyByScalar(o,f,n),u.add(i,n,n)};const Fy=new u,My=new u,Qu=new u,Ju=new u,ed=new u;Ue.rayTriangleParametric=function(e,t,n,i,o){if(!l(e))throw new C("ray is required.");if(!l(t))throw new C("p0 is required.");if(!l(n))throw new C("p1 is required.");if(!l(i))throw new C("p2 is required.");o=g(o,!1);const a=e.origin,r=e.direction,f=u.subtract(n,t,Fy),c=u.subtract(i,t,My),h=u.cross(r,c,Qu),d=u.dot(f,h);let p,m,T,y,w;if(o){if(d<S.EPSILON6||(p=u.subtract(a,t,Ju),T=u.dot(p,h),T<0||T>d)||(m=u.cross(p,f,ed),y=u.dot(r,m),y<0||T+y>d))return;w=u.dot(c,m)/d}else{if(Math.abs(d)<S.EPSILON6)return;const A=1/d;if(p=u.subtract(a,t,Ju),T=u.dot(p,h)*A,T<0||T>1||(m=u.cross(p,f,ed),y=u.dot(r,m)*A,y<0||T+y>1))return;w=u.dot(c,m)*A}return w},Ue.rayTriangle=function(e,t,n,i,o,a){const r=Ue.rayTriangleParametric(e,t,n,i,o);if(!(!l(r)||r<0))return l(a)||(a=new u),u.multiplyByScalar(e.direction,r,a),u.add(e.origin,a,a)};const Uy=new ko;Ue.lineSegmentTriangle=function(e,t,n,i,o,a,r){if(!l(e))throw new C("v0 is required.");if(!l(t))throw new C("v1 is required.");if(!l(n))throw new C("p0 is required.");if(!l(i))throw new C("p1 is required.");if(!l(o))throw new C("p2 is required.");const f=Uy;u.clone(e,f.origin),u.subtract(t,e,f.direction),u.normalize(f.direction,f.direction);const c=Ue.rayTriangleParametric(f,n,i,o,a);if(!(!l(c)||c<0||c>u.distance(e,t)))return l(r)||(r=new u),u.multiplyByScalar(f.direction,c,r),u.add(f.origin,r,r)};function ky(e,t,n,i){const o=t*t-4*e*n;if(o<0)return;if(o>0){const r=1/(2*e),f=Math.sqrt(o),c=(-t+f)*r,h=(-t-f)*r;return c<h?(i.root0=c,i.root1=h):(i.root0=h,i.root1=c),i}const a=-t/(2*e);if(a!==0)return i.root0=i.root1=a,i}const Vy={root0:0,root1:0};function td(e,t,n){l(n)||(n=new so);const i=e.origin,o=e.direction,a=t.center,r=t.radius*t.radius,f=u.subtract(i,a,Qu),c=u.dot(o,o),h=2*u.dot(o,f),d=u.magnitudeSquared(f)-r,p=ky(c,h,d,Vy);if(l(p))return n.start=p.root0,n.stop=p.root1,n}Ue.raySphere=function(e,t,n){if(!l(e))throw new C("ray is required.");if(!l(t))throw new C("sphere is required.");if(n=td(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};const Gy=new ko;Ue.lineSegmentSphere=function(e,t,n,i){if(!l(e))throw new C("p0 is required.");if(!l(t))throw new C("p1 is required.");if(!l(n))throw new C("sphere is required.");const o=Gy;u.clone(e,o.origin);const a=u.subtract(t,e,o.direction),r=u.magnitude(a);if(u.normalize(a,a),i=td(o,n,i),!(!l(i)||i.stop<0||i.start>r))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,r),i};const qy=new u,Hy=new u;Ue.rayEllipsoid=function(e,t){if(!l(e))throw new C("ray is required.");if(!l(t))throw new C("ellipsoid is required.");const n=t.oneOverRadii,i=u.multiplyComponents(n,e.origin,qy),o=u.multiplyComponents(n,e.direction,Hy),a=u.magnitudeSquared(i),r=u.dot(i,o);let f,c,h,d,p;if(a>1){if(r>=0)return;const m=r*r;if(f=a-1,c=u.magnitudeSquared(o),h=c*f,m<h)return;if(m>h){d=r*r-h,p=-r+Math.sqrt(d);const y=p/c,w=f/p;return y<w?new so(y,w):{start:w,stop:y}}const T=Math.sqrt(f/c);return new so(T,T)}else if(a<1)return f=a-1,c=u.magnitudeSquared(o),h=c*f,d=r*r-h,p=-r+Math.sqrt(d),new so(0,p/c);if(r<0)return c=u.magnitudeSquared(o),new so(0,-r/c)};function ao(e,t,n){const i=e+t;return S.sign(e)!==S.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Ue.quadraticVectorExpression=function(e,t,n,i,o){const a=i*i,r=o*o,f=(e[G.COLUMN1ROW1]-e[G.COLUMN2ROW2])*r,c=o*(i*ao(e[G.COLUMN1ROW0],e[G.COLUMN0ROW1],S.EPSILON15)+t.y),h=e[G.COLUMN0ROW0]*a+e[G.COLUMN2ROW2]*r+i*t.x+n,d=r*ao(e[G.COLUMN2ROW1],e[G.COLUMN1ROW2],S.EPSILON15),p=o*(i*ao(e[G.COLUMN2ROW0],e[G.COLUMN0ROW2])+t.z);let m;const T=[];if(p===0&&d===0){if(m=Nn.computeRealRoots(f,c,h),m.length===0)return T;const N=m[0],U=Math.sqrt(Math.max(1-N*N,0));if(T.push(new u(i,o*N,o*-U)),T.push(new u(i,o*N,o*U)),m.length===2){const M=m[1],j=Math.sqrt(Math.max(1-M*M,0));T.push(new u(i,o*M,o*-j)),T.push(new u(i,o*M,o*j))}return T}const y=p*p,w=d*d,A=f*f,E=p*d,b=A+w,D=2*(c*f+E),O=2*h*f+c*c-w+y,B=2*(h*c-E),L=h*h-y;if(b===0&&D===0&&O===0&&B===0)return T;m=th.computeRealRoots(b,D,O,B,L);const F=m.length;if(F===0)return T;for(let N=0;N<F;++N){const U=m[N],M=U*U,j=Math.max(1-M,0),Y=Math.sqrt(j);let s;S.sign(f)===S.sign(h)?s=ao(f*M+h,c*U,S.EPSILON12):S.sign(h)===S.sign(c*U)?s=ao(f*M,c*U+h,S.EPSILON12):s=ao(f*M+c*U,h,S.EPSILON12);const x=ao(d*U,p,S.EPSILON15),P=s*x;P<0?T.push(new u(i,o*U,o*Y)):P>0?T.push(new u(i,o*U,o*-Y)):Y!==0?(T.push(new u(i,o*U,o*-Y)),T.push(new u(i,o*U,o*Y)),++N):T.push(new u(i,o*U,o*Y))}return T};const nh=new u,nd=new u,id=new u,oa=new u,jy=new u,Yy=new G,Xy=new G,$y=new G,Zy=new G,Ky=new G,od=new G,sd=new G,rd=new u,Qy=new u,Jy=new oe;Ue.grazingAltitudeLocation=function(e,t){if(!l(e))throw new C("ray is required.");if(!l(t))throw new C("ellipsoid is required.");const n=e.origin,i=e.direction;if(!u.equals(n,u.ZERO)){const L=t.geodeticSurfaceNormal(n,nh);if(u.dot(i,L)>=0)return n}const o=l(this.rayEllipsoid(e,t)),a=t.transformPositionToScaledSpace(i,nh),r=u.normalize(a,a),f=u.mostOrthogonalAxis(a,oa),c=u.normalize(u.cross(f,r,nd),nd),h=u.normalize(u.cross(r,c,id),id),d=Yy;d[0]=r.x,d[1]=r.y,d[2]=r.z,d[3]=c.x,d[4]=c.y,d[5]=c.z,d[6]=h.x,d[7]=h.y,d[8]=h.z;const p=G.transpose(d,Xy),m=G.fromScale(t.radii,$y),T=G.fromScale(t.oneOverRadii,Zy),y=Ky;y[0]=0,y[1]=-i.z,y[2]=i.y,y[3]=i.z,y[4]=0,y[5]=-i.x,y[6]=-i.y,y[7]=i.x,y[8]=0;const w=G.multiply(G.multiply(p,T,od),y,od),A=G.multiply(G.multiply(w,m,sd),d,sd),E=G.multiplyByVector(w,n,jy),b=Ue.quadraticVectorExpression(A,u.negate(E,nh),0,0,1);let D,O;const B=b.length;if(B>0){let L=u.clone(u.ZERO,Qy),F=Number.NEGATIVE_INFINITY;for(let U=0;U<B;++U){D=G.multiplyByVector(m,G.multiplyByVector(d,b[U],rd),rd);const M=u.normalize(u.subtract(D,n,oa),oa),j=u.dot(M,i);j>F&&(F=j,L=u.clone(D,L))}const N=t.cartesianToCartographic(L,Jy);return F=S.clamp(F,0,1),O=u.magnitude(u.subtract(L,n,oa))*Math.sqrt(1-F*F),O=o?-O:O,N.height=O,t.cartographicToCartesian(N,new u)}};const eC=new u;Ue.lineSegmentPlane=function(e,t,n,i){if(!l(e))throw new C("endPoint0 is required.");if(!l(t))throw new C("endPoint1 is required.");if(!l(n))throw new C("plane is required.");l(i)||(i=new u);const o=u.subtract(t,e,eC),a=n.normal,r=u.dot(a,o);if(Math.abs(r)<S.EPSILON6)return;const f=u.dot(a,e),c=-(n.distance+f)/r;if(!(c<0||c>1))return u.multiplyByScalar(o,c,i),u.add(e,i,i),i},Ue.trianglePlaneIntersection=function(e,t,n,i){if(!l(e)||!l(t)||!l(n)||!l(i))throw new C("p0, p1, p2, and plane are required.");const o=i.normal,a=i.distance,r=u.dot(o,e)+a<0,f=u.dot(o,t)+a<0,c=u.dot(o,n)+a<0;let h=0;h+=r?1:0,h+=f?1:0,h+=c?1:0;let d,p;if((h===1||h===2)&&(d=new u,p=new u),h===1){if(r)return Ue.lineSegmentPlane(e,t,i,d),Ue.lineSegmentPlane(e,n,i,p),{positions:[e,t,n,d,p],indices:[0,3,4,1,2,4,1,4,3]};if(f)return Ue.lineSegmentPlane(t,n,i,d),Ue.lineSegmentPlane(t,e,i,p),{positions:[e,t,n,d,p],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Ue.lineSegmentPlane(n,e,i,d),Ue.lineSegmentPlane(n,t,i,p),{positions:[e,t,n,d,p],indices:[2,3,4,0,1,4,0,4,3]}}else if(h===2)if(r)if(f){if(!c)return Ue.lineSegmentPlane(e,n,i,d),Ue.lineSegmentPlane(t,n,i,p),{positions:[e,t,n,d,p],indices:[0,1,4,0,4,3,2,3,4]}}else return Ue.lineSegmentPlane(n,t,i,d),Ue.lineSegmentPlane(e,t,i,p),{positions:[e,t,n,d,p],indices:[2,0,4,2,4,3,1,3,4]};else return Ue.lineSegmentPlane(t,e,i,d),Ue.lineSegmentPlane(n,e,i,p),{positions:[e,t,n,d,p],indices:[1,2,4,1,4,3,0,3,4]}};const ih=new Z;function oi(e,t){if(_.defined("origin",e),t=g(t,pe.default),e=t.scaleToGeodeticSurface(e),!l(e))throw new C("origin must not be at the center of the ellipsoid.");const n=Ce.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=u.fromCartesian4(k.getColumn(n,0,ih)),this._yAxis=u.fromCartesian4(k.getColumn(n,1,ih));const i=u.fromCartesian4(k.getColumn(n,2,ih));this._plane=Me.fromPointNormal(e,i)}Object.defineProperties(oi.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});const tC=new Qt;oi.fromPoints=function(e,t){_.defined("cartesians",e);const n=Qt.fromPoints(e,tC);return new oi(n.center,t)};const ad=new ko,sa=new u;oi.prototype.projectPointOntoPlane=function(e,t){_.defined("cartesian",e);const n=ad;n.origin=e,u.normalize(e,n.direction);let i=Ue.rayPlane(n,this._plane,sa);if(l(i)||(u.negate(n.direction,n.direction),i=Ue.rayPlane(n,this._plane,sa)),l(i)){const o=u.subtract(i,this._origin,i),a=u.dot(this._xAxis,o),r=u.dot(this._yAxis,o);return l(t)?(t.x=a,t.y=r,t):new q(a,r)}},oi.prototype.projectPointsOntoPlane=function(e,t){_.defined("cartesians",e),l(t)||(t=[]);let n=0;const i=e.length;for(let o=0;o<i;o++){const a=this.projectPointOntoPlane(e[o],t[n]);l(a)&&(t[n]=a,n++)}return t.length=n,t},oi.prototype.projectPointToNearestOnPlane=function(e,t){_.defined("cartesian",e),l(t)||(t=new q);const n=ad;n.origin=e,u.clone(this._plane.normal,n.direction);let i=Ue.rayPlane(n,this._plane,sa);l(i)||(u.negate(n.direction,n.direction),i=Ue.rayPlane(n,this._plane,sa));const o=u.subtract(i,this._origin,i),a=u.dot(this._xAxis,o),r=u.dot(this._yAxis,o);return t.x=a,t.y=r,t},oi.prototype.projectPointsToNearestOnPlane=function(e,t){_.defined("cartesians",e),l(t)||(t=[]);const n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};const nC=new u;oi.prototype.projectPointOntoEllipsoid=function(e,t){_.defined("cartesian",e),l(t)||(t=new u);const n=this._ellipsoid,i=this._origin,o=this._xAxis,a=this._yAxis,r=nC;return u.multiplyByScalar(o,e.x,r),t=u.add(i,r,t),u.multiplyByScalar(a,e.y,r),u.add(t,r,t),n.scaleToGeocentricSurface(t,t),t},oi.prototype.projectPointsOntoEllipsoid=function(e,t){_.defined("cartesians",e);const n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};function ze(e,t){this.center=u.clone(g(e,u.ZERO)),this.halfAxes=G.clone(g(t,G.ZERO))}ze.packedLength=u.packedLength+G.packedLength,ze.pack=function(e,t,n){return _.typeOf.object("value",e),_.defined("array",t),n=g(n,0),u.pack(e.center,t,n),G.pack(e.halfAxes,t,n+u.packedLength),t},ze.unpack=function(e,t,n){return _.defined("array",e),t=g(t,0),l(n)||(n=new ze),u.unpack(e,t,n.center),G.unpack(e,t+u.packedLength,n.halfAxes),n};const iC=new u,oC=new u,sC=new u,rC=new u,aC=new u,cC=new u,hC=new G,fC={unitary:new G,diagonal:new G};ze.fromPoints=function(e,t){if(l(t)||(t=new ze),!l(e)||e.length===0)return t.halfAxes=G.ZERO,t.center=u.ZERO,t;let n;const i=e.length,o=u.clone(e[0],iC);for(n=1;n<i;n++)u.add(o,e[n],o);const a=1/i;u.multiplyByScalar(o,a,o);let r=0,f=0,c=0,h=0,d=0,p=0,m;for(n=0;n<i;n++)m=u.subtract(e[n],o,oC),r+=m.x*m.x,f+=m.x*m.y,c+=m.x*m.z,h+=m.y*m.y,d+=m.y*m.z,p+=m.z*m.z;r*=a,f*=a,c*=a,h*=a,d*=a,p*=a;const T=hC;T[0]=r,T[1]=f,T[2]=c,T[3]=f,T[4]=h,T[5]=d,T[6]=c,T[7]=d,T[8]=p;const y=G.computeEigenDecomposition(T,fC),w=G.clone(y.unitary,t.halfAxes);let A=G.getColumn(w,0,rC),E=G.getColumn(w,1,aC),b=G.getColumn(w,2,cC),D=-Number.MAX_VALUE,O=-Number.MAX_VALUE,B=-Number.MAX_VALUE,L=Number.MAX_VALUE,F=Number.MAX_VALUE,N=Number.MAX_VALUE;for(n=0;n<i;n++)m=e[n],D=Math.max(u.dot(A,m),D),O=Math.max(u.dot(E,m),O),B=Math.max(u.dot(b,m),B),L=Math.min(u.dot(A,m),L),F=Math.min(u.dot(E,m),F),N=Math.min(u.dot(b,m),N);A=u.multiplyByScalar(A,.5*(L+D),A),E=u.multiplyByScalar(E,.5*(F+O),E),b=u.multiplyByScalar(b,.5*(N+B),b);const U=u.add(A,E,t.center);u.add(U,b,U);const M=sC;return M.x=D-L,M.y=O-F,M.z=B-N,u.multiplyByScalar(M,.5,M),G.multiplyByScale(t.halfAxes,M,t.halfAxes),t};const cd=new u,lC=new u;function hd(e,t,n,i,o,a,r,f,c,h,d){if(!l(o)||!l(a)||!l(r)||!l(f)||!l(c)||!l(h))throw new C("all extents (minimum/maximum X/Y/Z) are required.");l(d)||(d=new ze);const p=d.halfAxes;G.setColumn(p,0,t,p),G.setColumn(p,1,n,p),G.setColumn(p,2,i,p);let m=cd;m.x=(o+a)/2,m.y=(r+f)/2,m.z=(c+h)/2;const T=lC;T.x=(a-o)/2,T.y=(f-r)/2,T.z=(h-c)/2;const y=d.center;return m=G.multiplyByVector(p,m,m),u.add(e,m,y),G.multiplyByScale(p,T,p),d}const fd=new oe,uC=new u,dC=new oe,pC=new oe,mC=new oe,_C=new oe,gC=new oe,TC=new u,ld=new u,yC=new u,ud=new u,CC=new u,wC=new q,AC=new q,EC=new q,bC=new q,xC=new q,SC=new u,IC=new u,DC=new u,OC=new u,vC=new q,WC=new u,PC=new u,BC=new u,RC=new Me(u.UNIT_X,0);ze.fromRectangle=function(e,t,n,i,o){if(!l(e))throw new C("rectangle is required");if(e.width<0||e.width>S.TWO_PI)throw new C("Rectangle width must be between 0 and 2 * pi");if(e.height<0||e.height>S.PI)throw new C("Rectangle height must be between 0 and pi");if(l(i)&&!S.equalsEpsilon(i.radii.x,i.radii.y,S.EPSILON15))throw new C("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t=g(t,0),n=g(n,0),i=g(i,pe.default);let a,r,f,c,h,d,p;if(e.width<=S.PI){const F=de.center(e,fd),N=i.cartographicToCartesian(F,uC),U=new oi(N,i);p=U.plane;const M=F.longitude,j=e.south<0&&e.north>0?0:F.latitude,Y=oe.fromRadians(M,e.north,n,dC),s=oe.fromRadians(e.west,e.north,n,pC),x=oe.fromRadians(e.west,j,n,mC),P=oe.fromRadians(e.west,e.south,n,_C),z=oe.fromRadians(M,e.south,n,gC),H=i.cartographicToCartesian(Y,TC);let X=i.cartographicToCartesian(s,ld);const ee=i.cartographicToCartesian(x,yC);let K=i.cartographicToCartesian(P,ud);const ce=i.cartographicToCartesian(z,CC),le=U.projectPointToNearestOnPlane(H,wC),we=U.projectPointToNearestOnPlane(X,AC),Se=U.projectPointToNearestOnPlane(ee,EC),Ee=U.projectPointToNearestOnPlane(K,bC),Le=U.projectPointToNearestOnPlane(ce,xC);return a=Math.min(we.x,Se.x,Ee.x),r=-a,c=Math.max(we.y,le.y),f=Math.min(Ee.y,Le.y),s.height=P.height=t,X=i.cartographicToCartesian(s,ld),K=i.cartographicToCartesian(P,ud),h=Math.min(Me.getPointDistance(p,X),Me.getPointDistance(p,K)),d=n,hd(U.origin,U.xAxis,U.yAxis,U.zAxis,a,r,f,c,h,d,o)}const m=e.south>0,T=e.north<0,y=m?e.south:T?e.north:0,w=de.center(e,fd).longitude,A=u.fromRadians(w,y,n,i,SC);A.z=0;const b=Math.abs(A.x)<S.EPSILON10&&Math.abs(A.y)<S.EPSILON10?u.UNIT_X:u.normalize(A,IC),D=u.UNIT_Z,O=u.cross(b,D,DC);p=Me.fromPointNormal(A,b,RC);const B=u.fromRadians(w+S.PI_OVER_TWO,y,n,i,OC);r=u.dot(Me.projectPointOntoPlane(p,B,vC),O),a=-r,c=u.fromRadians(0,e.north,T?t:n,i,WC).z,f=u.fromRadians(0,e.south,m?t:n,i,PC).z;const L=u.fromRadians(e.east,y,n,i,BC);return h=Me.getPointDistance(p,L),d=0,hd(A,O,D,b,a,r,f,c,h,d,o)},ze.fromTransformation=function(e,t){return _.typeOf.object("transformation",e),l(t)||(t=new ze),t.center=k.getTranslation(e,t.center),t.halfAxes=k.getMatrix3(e,t.halfAxes),t.halfAxes=G.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},ze.clone=function(e,t){if(l(e))return l(t)?(u.clone(e.center,t.center),G.clone(e.halfAxes,t.halfAxes),t):new ze(e.center,e.halfAxes)},ze.intersectPlane=function(e,t){if(!l(e))throw new C("box is required.");if(!l(t))throw new C("plane is required.");const n=e.center,i=t.normal,o=e.halfAxes,a=i.x,r=i.y,f=i.z,c=Math.abs(a*o[G.COLUMN0ROW0]+r*o[G.COLUMN0ROW1]+f*o[G.COLUMN0ROW2])+Math.abs(a*o[G.COLUMN1ROW0]+r*o[G.COLUMN1ROW1]+f*o[G.COLUMN1ROW2])+Math.abs(a*o[G.COLUMN2ROW0]+r*o[G.COLUMN2ROW1]+f*o[G.COLUMN2ROW2]),h=u.dot(i,n)+t.distance;return h<=-c?xt.OUTSIDE:h>=c?xt.INSIDE:xt.INTERSECTING};const dd=new u,pd=new u,md=new u,zC=new u,_d=new u,LC=new u;ze.distanceSquaredTo=function(e,t){if(!l(e))throw new C("box is required.");if(!l(t))throw new C("cartesian is required.");const n=u.subtract(t,e.center,cd),i=e.halfAxes;let o=G.getColumn(i,0,dd),a=G.getColumn(i,1,pd),r=G.getColumn(i,2,md);const f=u.magnitude(o),c=u.magnitude(a),h=u.magnitude(r);let d=!0,p=!0,m=!0;f>0?u.divideByScalar(o,f,o):d=!1,c>0?u.divideByScalar(a,c,a):p=!1,h>0?u.divideByScalar(r,h,r):m=!1;const T=!d+!p+!m;let y,w,A;if(T===1){let O=o;y=a,w=r,p?m||(O=r,w=o):(O=a,y=o),A=u.cross(y,w,_d),O===o?o=A:O===a?a=A:O===r&&(r=A)}else if(T===2){y=o,p?y=a:m&&(y=r);let O=u.UNIT_Y;O.equalsEpsilon(y,S.EPSILON3)&&(O=u.UNIT_X),w=u.cross(y,O,zC),u.normalize(w,w),A=u.cross(y,w,_d),u.normalize(A,A),y===o?(a=w,r=A):y===a?(r=w,o=A):y===r&&(o=w,a=A)}else T===3&&(o=u.UNIT_X,a=u.UNIT_Y,r=u.UNIT_Z);const E=LC;E.x=u.dot(n,o),E.y=u.dot(n,a),E.z=u.dot(n,r);let b=0,D;return E.x<-f?(D=E.x+f,b+=D*D):E.x>f&&(D=E.x-f,b+=D*D),E.y<-c?(D=E.y+c,b+=D*D):E.y>c&&(D=E.y-c,b+=D*D),E.z<-h?(D=E.z+h,b+=D*D):E.z>h&&(D=E.z-h,b+=D*D),b};const NC=new u,FC=new u;ze.computePlaneDistances=function(e,t,n,i){if(!l(e))throw new C("box is required.");if(!l(t))throw new C("position is required.");if(!l(n))throw new C("direction is required.");l(i)||(i=new so);let o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;const r=e.center,f=e.halfAxes,c=G.getColumn(f,0,dd),h=G.getColumn(f,1,pd),d=G.getColumn(f,2,md),p=u.add(c,h,NC);u.add(p,d,p),u.add(p,r,p);const m=u.subtract(p,t,FC);let T=u.dot(n,m);return o=Math.min(T,o),a=Math.max(T,a),u.add(r,c,p),u.add(p,h,p),u.subtract(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),u.add(r,c,p),u.subtract(p,h,p),u.add(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),u.add(r,c,p),u.subtract(p,h,p),u.subtract(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),u.subtract(r,c,p),u.add(p,h,p),u.add(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),u.subtract(r,c,p),u.add(p,h,p),u.subtract(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),u.subtract(r,c,p),u.subtract(p,h,p),u.add(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),u.subtract(r,c,p),u.subtract(p,h,p),u.subtract(p,d,p),u.subtract(p,t,m),T=u.dot(n,m),o=Math.min(T,o),a=Math.max(T,a),i.start=o,i.stop=a,i};const MC=new u,UC=new u,kC=new u;ze.computeCorners=function(e,t){_.typeOf.object("box",e),l(t)||(t=[new u,new u,new u,new u,new u,new u,new u,new u]);const n=e.center,i=e.halfAxes,o=G.getColumn(i,0,MC),a=G.getColumn(i,1,UC),r=G.getColumn(i,2,kC);return u.clone(n,t[0]),u.subtract(t[0],o,t[0]),u.subtract(t[0],a,t[0]),u.subtract(t[0],r,t[0]),u.clone(n,t[1]),u.subtract(t[1],o,t[1]),u.subtract(t[1],a,t[1]),u.add(t[1],r,t[1]),u.clone(n,t[2]),u.subtract(t[2],o,t[2]),u.add(t[2],a,t[2]),u.subtract(t[2],r,t[2]),u.clone(n,t[3]),u.subtract(t[3],o,t[3]),u.add(t[3],a,t[3]),u.add(t[3],r,t[3]),u.clone(n,t[4]),u.add(t[4],o,t[4]),u.subtract(t[4],a,t[4]),u.subtract(t[4],r,t[4]),u.clone(n,t[5]),u.add(t[5],o,t[5]),u.subtract(t[5],a,t[5]),u.add(t[5],r,t[5]),u.clone(n,t[6]),u.add(t[6],o,t[6]),u.add(t[6],a,t[6]),u.subtract(t[6],r,t[6]),u.clone(n,t[7]),u.add(t[7],o,t[7]),u.add(t[7],a,t[7]),u.add(t[7],r,t[7]),t};const VC=new G;ze.computeTransformation=function(e,t){_.typeOf.object("box",e),l(t)||(t=new k);const n=e.center,i=G.multiplyByUniformScale(e.halfAxes,2,VC);return k.fromRotationTranslation(i,n,t)};const GC=new te;ze.isOccluded=function(e,t){if(!l(e))throw new C("box is required.");if(!l(t))throw new C("occluder is required.");const n=te.fromOrientedBoundingBox(e,GC);return!t.isBoundingSphereVisible(n)},ze.prototype.intersectPlane=function(e){return ze.intersectPlane(this,e)},ze.prototype.distanceSquaredTo=function(e){return ze.distanceSquaredTo(this,e)},ze.prototype.computePlaneDistances=function(e,t,n){return ze.computePlaneDistances(this,e,t,n)},ze.prototype.computeCorners=function(e){return ze.computeCorners(this,e)},ze.prototype.computeTransformation=function(e){return ze.computeTransformation(this,e)},ze.prototype.isOccluded=function(e){return ze.isOccluded(this,e)},ze.equals=function(e,t){return e===t||l(e)&&l(t)&&u.equals(e.center,t.center)&&G.equals(e.halfAxes,t.halfAxes)},ze.prototype.clone=function(e){return ze.clone(this,e)},ze.prototype.equals=function(e){return ze.equals(this,e)};const As={};As.getHeight=function(e,t,n){if(!Number.isFinite(t))throw new C("scale must be a finite number.");if(!Number.isFinite(n))throw new C("relativeHeight must be a finite number.");return(e-n)*t+n};const qC=new oe;As.getPosition=function(e,t,n,i,o){const a=t.cartesianToCartographic(e,qC);if(!l(a))return u.clone(e,o);const r=As.getHeight(a.height,n,i);return u.fromRadians(a.longitude,a.latitude,r,t,o)};const HC=`in vec3 position3DHigh;
4506
4506
  in vec3 position3DLow;
4507
4507
  in float batchId;
4508
4508
 
@@ -4616,7 +4616,7 @@ void main(void)
4616
4616
  #endif
4617
4617
  czm_writeDepthClamp();
4618
4618
  }
4619
- `,gd={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};gd.NUMBER_OF_CLASSIFICATION_TYPES=3;const wi=Object.freeze(gd),YC={NEVER:R.NEVER,LESS:R.LESS,EQUAL:R.EQUAL,LESS_OR_EQUAL:R.LEQUAL,GREATER:R.GREATER,NOT_EQUAL:R.NOTEQUAL,GREATER_OR_EQUAL:R.GEQUAL,ALWAYS:R.ALWAYS},Td=Object.freeze(YC);function XC(e,t){if(!l(e))throw new C("array is required.");if(!l(t)||t<1)throw new C("numberOfArrays must be greater than 0.");const n=[],i=e.length;let o=0;for(;o<i;){const a=Math.ceil((i-o)/t--);n.push(e.slice(o,o+a)),o+=a}return n}function Ai(e,t,n){if(!l(e))throw new C("context is required");if(!l(t))throw new C("attributes is required");if(!l(n))throw new C("numberOfInstances is required");if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;const i=$C(t),o=e.floatingPointTexture,a=i===Te.FLOAT&&!o,r=ZC(t,a),f=KC(r,t,a),c=Math.floor(xe.maximumTextureSize/f),h=Math.min(n,c),d=f*h,p=Math.ceil(n/h),m=1/d,T=m*.5,y=1/p,w=y*.5;this._textureDimensions=new q(d,p),this._textureStep=new Z(m,T,y,w),this._pixelDatatype=a?Te.UNSIGNED_BYTE:i,this._packFloats=a,this._offsets=r,this._stride=f,this._texture=void 0;const A=4*d*p;this._batchValues=i===Te.FLOAT&&!a?new Float32Array(A):new Uint8Array(A),this._batchValuesDirty=!1}Object.defineProperties(Ai.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function $C(e){let t=!1;const n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==he.UNSIGNED_BYTE){t=!0;break}return t?Te.FLOAT:Te.UNSIGNED_BYTE}function yd(e,t){const n=e[t].componentsPerAttribute;return n===2?q:n===3?u:n===4?Z:Number}function ZC(e,t){const n=new Array(e.length);let i=0;const o=e.length;for(let a=0;a<o;++a){const f=e[a].componentDatatype;n[a]=i,f!==he.UNSIGNED_BYTE&&t?i+=4:++i}return n}function KC(e,t,n){const i=e.length,o=e[i-1];return t[i-1].componentDatatype!==he.UNSIGNED_BYTE&&n?o+4:o+1}const Es=new Z;function QC(e,t,n){let i=Z.unpack(e,t,Es);const o=Z.unpackFloat(i);i=Z.unpack(e,t+4,Es);const a=Z.unpackFloat(i);i=Z.unpack(e,t+8,Es);const r=Z.unpackFloat(i);i=Z.unpack(e,t+12,Es);const f=Z.unpackFloat(i);return Z.fromElements(o,a,r,f,n)}function JC(e,t,n){let i=Z.packFloat(e.x,Es);Z.pack(i,t,n),i=Z.packFloat(e.y,i),Z.pack(i,t,n+4),i=Z.packFloat(e.z,i),Z.pack(i,t,n+8),i=Z.packFloat(e.w,i),Z.pack(i,t,n+12)}const Cd=new Z;Ai.prototype.getBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new C("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new C("attributeIndex is out of range");const i=this._attributes,o=this._offsets[t],r=4*this._stride*e+4*o;let f;this._packFloats&&i[t].componentDatatype!==Te.UNSIGNED_BYTE?f=QC(this._batchValues,r,Cd):f=Z.unpack(this._batchValues,r,Cd);const c=yd(i,t);return l(c.fromCartesian4)?c.fromCartesian4(f,n):l(c.clone)?c.clone(f,n):f.x};const ew=[void 0,void 0,new q,new u,new Z],tw=new Z;Ai.prototype.setBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new C("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new C("attributeIndex is out of range");if(!l(n))throw new C("value is required.");const i=this._attributes,o=ew[i[t].componentsPerAttribute],a=this.getBatchedAttribute(e,t,o),r=yd(this._attributes,t);if(l(r.equals)?r.equals(a,n):a===n)return;const c=tw;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;const h=this._offsets[t],p=4*this._stride*e+4*h;this._packFloats&&i[t].componentDatatype!==Te.UNSIGNED_BYTE?JC(c,this._batchValues,p):Z.pack(c,this._batchValues,p),this._batchValuesDirty=!0};function nw(e,t){const n=e._textureDimensions;e._texture=new Mt({context:t,pixelFormat:ge.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:ei.NEAREST,flipY:!1})}function iw(e){const t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Ai.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||nw(this,e.context),iw(this))},Ai.prototype.getUniformMapCallback=function(){const e=this;return function(t){return e._attributes.length===0?t:hn(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function ow(e){const t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep;
4619
+ `,gd={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};gd.NUMBER_OF_CLASSIFICATION_TYPES=3;const wi=Object.freeze(gd),YC={NEVER:R.NEVER,LESS:R.LESS,EQUAL:R.EQUAL,LESS_OR_EQUAL:R.LEQUAL,GREATER:R.GREATER,NOT_EQUAL:R.NOTEQUAL,GREATER_OR_EQUAL:R.GEQUAL,ALWAYS:R.ALWAYS},Td=Object.freeze(YC);function XC(e,t){if(!l(e))throw new C("array is required.");if(!l(t)||t<1)throw new C("numberOfArrays must be greater than 0.");const n=[],i=e.length;let o=0;for(;o<i;){const a=Math.ceil((i-o)/t--);n.push(e.slice(o,o+a)),o+=a}return n}function Ai(e,t,n){if(!l(e))throw new C("context is required");if(!l(t))throw new C("attributes is required");if(!l(n))throw new C("numberOfInstances is required");if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;const i=$C(t),o=e.floatingPointTexture,a=i===Te.FLOAT&&!o,r=ZC(t,a),f=KC(r,t,a),c=Math.floor(xe.maximumTextureSize/f),h=Math.min(n,c),d=f*h,p=Math.ceil(n/h),m=1/d,T=m*.5,y=1/p,w=y*.5;this._textureDimensions=new q(d,p),this._textureStep=new Z(m,T,y,w),this._pixelDatatype=a?Te.UNSIGNED_BYTE:i,this._packFloats=a,this._offsets=r,this._stride=f,this._texture=void 0;const A=4*d*p;this._batchValues=i===Te.FLOAT&&!a?new Float32Array(A):new Uint8Array(A),this._batchValuesDirty=!1}Object.defineProperties(Ai.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function $C(e){let t=!1;const n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==he.UNSIGNED_BYTE){t=!0;break}return t?Te.FLOAT:Te.UNSIGNED_BYTE}function yd(e,t){const n=e[t].componentsPerAttribute;return n===2?q:n===3?u:n===4?Z:Number}function ZC(e,t){const n=new Array(e.length);let i=0;const o=e.length;for(let a=0;a<o;++a){const f=e[a].componentDatatype;n[a]=i,f!==he.UNSIGNED_BYTE&&t?i+=4:++i}return n}function KC(e,t,n){const i=e.length,o=e[i-1];return t[i-1].componentDatatype!==he.UNSIGNED_BYTE&&n?o+4:o+1}const Es=new Z;function QC(e,t,n){let i=Z.unpack(e,t,Es);const o=Z.unpackFloat(i);i=Z.unpack(e,t+4,Es);const a=Z.unpackFloat(i);i=Z.unpack(e,t+8,Es);const r=Z.unpackFloat(i);i=Z.unpack(e,t+12,Es);const f=Z.unpackFloat(i);return Z.fromElements(o,a,r,f,n)}function JC(e,t,n){let i=Z.packFloat(e.x,Es);Z.pack(i,t,n),i=Z.packFloat(e.y,i),Z.pack(i,t,n+4),i=Z.packFloat(e.z,i),Z.pack(i,t,n+8),i=Z.packFloat(e.w,i),Z.pack(i,t,n+12)}const Cd=new Z;Ai.prototype.getBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new C("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new C("attributeIndex is out of range");const i=this._attributes,o=this._offsets[t],r=4*this._stride*e+4*o;let f;this._packFloats&&i[t].componentDatatype!==Te.UNSIGNED_BYTE?f=QC(this._batchValues,r,Cd):f=Z.unpack(this._batchValues,r,Cd);const c=yd(i,t);return l(c.fromCartesian4)?c.fromCartesian4(f,n):l(c.clone)?c.clone(f,n):f.x};const ew=[void 0,void 0,new q,new u,new Z],tw=new Z;Ai.prototype.setBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new C("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new C("attributeIndex is out of range");if(!l(n))throw new C("value is required.");const i=this._attributes,o=ew[i[t].componentsPerAttribute],a=this.getBatchedAttribute(e,t,o),r=yd(this._attributes,t);if(l(r.equals)?r.equals(a,n):a===n)return;const c=tw;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;const h=this._offsets[t],p=4*this._stride*e+4*h;this._packFloats&&i[t].componentDatatype!==Te.UNSIGNED_BYTE?JC(c,this._batchValues,p):Z.pack(c,this._batchValues,p),this._batchValuesDirty=!0};function nw(e,t){const n=e._textureDimensions;e._texture=new Mt({context:t,pixelFormat:ge.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Jn.NEAREST,flipY:!1})}function iw(e){const t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Ai.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||nw(this,e.context),iw(this))},Ai.prototype.getUniformMapCallback=function(){const e=this;return function(t){return e._attributes.length===0?t:hn(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function ow(e){const t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep;
4620
4620
  vec2 computeSt(float batchId)
4621
4621
  {
4622
4622
  float stepX = batchTextureStep.x;
@@ -4656,7 +4656,7 @@ textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureSte
4656
4656
  `;t+=`${ow(this)}
4657
4657
  `;const n=e.length;for(let i=0;i<n;++i)t+=aw(this,i);return function(i){const o=i.indexOf("void main"),a=i.substring(0,o),r=i.substring(o);return`${a}
4658
4658
  ${t}
4659
- ${r}`}},Ai.prototype.isDestroyed=function(){return!1},Ai.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),st(this)};const Ge={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Ge.getMathType=function(e){switch(e){case Ge.SCALAR:return Number;case Ge.VEC2:return q;case Ge.VEC3:return u;case Ge.VEC4:return Z;case Ge.MAT2:return ue;case Ge.MAT3:return G;case Ge.MAT4:return k;default:throw new C("attributeType is not a valid value.")}},Ge.getNumberOfComponents=function(e){switch(e){case Ge.SCALAR:return 1;case Ge.VEC2:return 2;case Ge.VEC3:return 3;case Ge.VEC4:case Ge.MAT2:return 4;case Ge.MAT3:return 9;case Ge.MAT4:return 16;default:throw new C("attributeType is not a valid value.")}},Ge.getAttributeLocationCount=function(e){switch(e){case Ge.SCALAR:case Ge.VEC2:case Ge.VEC3:case Ge.VEC4:return 1;case Ge.MAT2:return 2;case Ge.MAT3:return 3;case Ge.MAT4:return 4;default:throw new C("attributeType is not a valid value.")}},Ge.getGlslType=function(e){switch(_.typeOf.string("attributeType",e),e){case Ge.SCALAR:return"float";case Ge.VEC2:return"vec2";case Ge.VEC3:return"vec3";case Ge.VEC4:return"vec4";case Ge.MAT2:return"mat2";case Ge.MAT3:return"mat3";case Ge.MAT4:return"mat4";default:throw new C("attributeType is not a valid value.")}};const cw=Object.freeze(Ge),wd=1/256,Ad=256,De={};De.octEncodeInRange=function(e,t,n){_.defined("vector",e),_.defined("result",n);const i=u.magnitudeSquared(e);if(Math.abs(i-1)>S.EPSILON6)throw new C("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){const o=n.x,a=n.y;n.x=(1-Math.abs(a))*S.signNotZero(o),n.y=(1-Math.abs(o))*S.signNotZero(a)}return n.x=S.toSNorm(n.x,t),n.y=S.toSNorm(n.y,t),n},De.octEncode=function(e,t){return De.octEncodeInRange(e,255,t)};const bs=new q,Ed=new Uint8Array(1);function ra(e){return Ed[0]=e,Ed[0]}De.octEncodeToCartesian4=function(e,t){return De.octEncodeInRange(e,65535,bs),t.x=ra(bs.x*wd),t.y=ra(bs.x),t.z=ra(bs.y*wd),t.w=ra(bs.y),t},De.octDecodeInRange=function(e,t,n,i){if(_.defined("result",i),e<0||e>n||t<0||t>n)throw new C(`x and y must be unsigned normalized integers between 0 and ${n}`);if(i.x=S.fromSNorm(e,n),i.y=S.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){const o=i.x;i.x=(1-Math.abs(i.y))*S.signNotZero(o),i.y=(1-Math.abs(o))*S.signNotZero(i.y)}return u.normalize(i,i)},De.octDecode=function(e,t,n){return De.octDecodeInRange(e,t,255,n)},De.octDecodeFromCartesian4=function(e,t){_.typeOf.object("encoded",e),_.typeOf.object("result",t);const n=e.x,i=e.y,o=e.z,a=e.w;if(n<0||n>255||i<0||i>255||o<0||o>255||a<0||a>255)throw new C("x, y, z, and w must be unsigned normalized integers between 0 and 255");const r=n*Ad+i,f=o*Ad+a;return De.octDecodeInRange(r,f,65535,t)},De.octPackFloat=function(e){return _.defined("encoded",e),256*e.x+e.y};const oh=new q;De.octEncodeFloat=function(e){return De.octEncode(e,oh),De.octPackFloat(oh)},De.octDecodeFloat=function(e,t){_.defined("value",e);const n=e/256,i=Math.floor(n),o=(n-i)*256;return De.octDecode(i,o,t)},De.octPack=function(e,t,n,i){_.defined("v1",e),_.defined("v2",t),_.defined("v3",n),_.defined("result",i);const o=De.octEncodeFloat(e),a=De.octEncodeFloat(t),r=De.octEncode(n,oh);return i.x=65536*r.x+o,i.y=65536*r.y+a,i},De.octUnpack=function(e,t,n,i){_.defined("packed",e),_.defined("v1",t),_.defined("v2",n),_.defined("v3",i);let o=e.x/65536;const a=Math.floor(o),r=(o-a)*65536;o=e.y/65536;const f=Math.floor(o),c=(o-f)*65536;De.octDecodeFloat(r,t),De.octDecodeFloat(c,n),De.octDecode(a,f,i)},De.compressTextureCoordinates=function(e){_.defined("textureCoordinates",e);const t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n},De.decompressTextureCoordinates=function(e,t){_.defined("compressed",e),_.defined("result",t);const n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function sh(e){return e>>1^-(e&1)}De.zigZagDeltaDecode=function(e,t,n){_.defined("uBuffer",e),_.defined("vBuffer",t),_.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),l(n)&&_.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);const i=e.length;let o=0,a=0,r=0;for(let f=0;f<i;++f)o+=sh(e[f]),a+=sh(t[f]),e[f]=o,t[f]=a,l(n)&&(r+=sh(n[f]),n[f]=r)},De.dequantize=function(e,t,n,i){_.defined("typedArray",e),_.defined("componentDatatype",t),_.defined("type",n),_.defined("count",i);const o=cw.getNumberOfComponents(n);let a;switch(t){case he.BYTE:a=127;break;case he.UNSIGNED_BYTE:a=255;break;case he.SHORT:a=32767;break;case he.UNSIGNED_SHORT:a=65535;break;case he.INT:a=2147483647;break;case he.UNSIGNED_INT:a=4294967295;break;default:throw new C(`Cannot dequantize component datatype: ${t}`)}const r=new Float32Array(i*o);for(let f=0;f<i;f++)for(let c=0;c<o;c++){const h=f*o+c;r[h]=Math.max(e[h]/a,-1)}return r},De.decodeRGB565=function(e,t){_.defined("typedArray",e);const n=e.length*3;l(t)&&_.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);const i=e.length;l(t)||(t=new Float32Array(i*3));const o=31,a=63,r=1/31,f=1/63;for(let c=0;c<i;c++){const h=e[c],d=h>>11,p=h>>5&a,m=h&o,T=3*c;t[T]=d*r,t[T+1]=p*f,t[T+2]=m*r}return t};const bd=new u,xd=new u,Sd=new u;function hw(e,t,n,i,o){_.defined("point",e),_.defined("p0",t),_.defined("p1",n),_.defined("p2",i),l(o)||(o=new u);let a,r,f,c,h,d,p,m;if(l(t.z)){if(u.equalsEpsilon(e,t,S.EPSILON14))return u.clone(u.UNIT_X,o);if(u.equalsEpsilon(e,n,S.EPSILON14))return u.clone(u.UNIT_Y,o);if(u.equalsEpsilon(e,i,S.EPSILON14))return u.clone(u.UNIT_Z,o);a=u.subtract(n,t,bd),r=u.subtract(i,t,xd),f=u.subtract(e,t,Sd),c=u.dot(a,a),h=u.dot(a,r),d=u.dot(a,f),p=u.dot(r,r),m=u.dot(r,f)}else{if(q.equalsEpsilon(e,t,S.EPSILON14))return u.clone(u.UNIT_X,o);if(q.equalsEpsilon(e,n,S.EPSILON14))return u.clone(u.UNIT_Y,o);if(q.equalsEpsilon(e,i,S.EPSILON14))return u.clone(u.UNIT_Z,o);a=q.subtract(n,t,bd),r=q.subtract(i,t,xd),f=q.subtract(e,t,Sd),c=q.dot(a,a),h=q.dot(a,r),d=q.dot(a,f),p=q.dot(r,r),m=q.dot(r,f)}o.y=p*d-h*m,o.z=c*m-h*d;const T=c*p-h*h;if(T!==0)return o.y/=T,o.z/=T,o.x=1-o.y-o.z,o}const rh={};rh.calculateACMR=function(e){e=g(e,g.EMPTY_OBJECT);const t=e.indices;let n=e.maximumIndex;const i=g(e.cacheSize,24);if(!l(t))throw new C("indices is required.");const o=t.length;if(o<3||o%3!==0)throw new C("indices length must be a multiple of three.");if(n<=0)throw new C("maximumIndex must be greater than zero.");if(i<3)throw new C("cacheSize must be greater than two.");if(!l(n)){n=0;let f=0,c=t[f];for(;f<o;)c>n&&(n=c),++f,c=t[f]}const a=[];for(let f=0;f<n+1;f++)a[f]=0;let r=i+1;for(let f=0;f<o;++f)r-a[t[f]]>i&&(a[t[f]]=r,++r);return(r-i+1)/(o/3)},rh.tipsify=function(e){e=g(e,g.EMPTY_OBJECT);const t=e.indices,n=e.maximumIndex,i=g(e.cacheSize,24);let o;function a(j,Y,s,x){for(;Y.length>=1;){const P=Y[Y.length-1];if(Y.splice(Y.length-1,1),j[P].numLiveTriangles>0)return P}for(;o<x;){if(j[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function r(j,Y,s,x,P,z,H){let X=-1,ee,K=-1,ce=0;for(;ce<s.length;){const le=s[ce];x[le].numLiveTriangles&&(ee=0,P-x[le].timeStamp+2*x[le].numLiveTriangles<=Y&&(ee=P-x[le].timeStamp),(ee>K||K===-1)&&(K=ee,X=le)),++ce}return X===-1?a(x,z,j,H):X}if(!l(t))throw new C("indices is required.");const f=t.length;if(f<3||f%3!==0)throw new C("indices length must be a multiple of three.");if(n<=0)throw new C("maximumIndex must be greater than zero.");if(i<3)throw new C("cacheSize must be greater than two.");let c=0,h=0,d=t[h];const p=f;if(l(n))c=n+1;else{for(;h<p;)d>c&&(c=d),++h,d=t[h];if(c===-1)return 0;++c}const m=[];let T;for(T=0;T<c;T++)m[T]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};h=0;let y=0;for(;h<p;)m[t[h]].vertexTriangles.push(y),++m[t[h]].numLiveTriangles,m[t[h+1]].vertexTriangles.push(y),++m[t[h+1]].numLiveTriangles,m[t[h+2]].vertexTriangles.push(y),++m[t[h+2]].numLiveTriangles,++y,h+=3;let w=0,A=i+1;o=1;let E=[];const b=[];let I,O,B=0;const L=[],F=f/3,N=[];for(T=0;T<F;T++)N[T]=!1;let U,M;for(;w!==-1;){E=[],O=m[w],M=O.vertexTriangles.length;for(let j=0;j<M;++j)if(y=O.vertexTriangles[j],!N[y]){N[y]=!0,h=y+y+y;for(let Y=0;Y<3;++Y)U=t[h],E.push(U),b.push(U),L[B]=U,++B,I=m[U],--I.numLiveTriangles,A-I.timeStamp>i&&(I.timeStamp=A,++A),++h}w=r(t,i,E,m,A,b,c)}return L};const $e={};function aa(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function fw(e){const t=e.length,n=t/3*6,i=bt.createTypedArray(t,n);let o=0;for(let a=0;a<t;a+=3,o+=6)aa(i,o,e[a],e[a+1],e[a+2]);return i}function lw(e){const t=e.length;if(t>=3){const n=(t-2)*6,i=bt.createTypedArray(t,n);aa(i,0,e[0],e[1],e[2]);let o=6;for(let a=3;a<t;++a,o+=6)aa(i,o,e[a-1],e[a],e[a-2]);return i}return new Uint16Array}function uw(e){if(e.length>0){const t=e.length-1,n=(t-1)*6,i=bt.createTypedArray(t,n),o=e[0];let a=0;for(let r=1;r<t;++r,a+=6)aa(i,a,o,e[r],e[r+1]);return i}return new Uint16Array}$e.toWireframe=function(e){if(!l(e))throw new C("geometry is required.");const t=e.indices;if(l(t)){switch(e.primitiveType){case Xe.TRIANGLES:e.indices=fw(t);break;case Xe.TRIANGLE_STRIP:e.indices=lw(t);break;case Xe.TRIANGLE_FAN:e.indices=uw(t);break;default:throw new C("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=Xe.LINES}return e},$e.createLineSegmentsForVectors=function(e,t,n){if(t=g(t,"normal"),!l(e))throw new C("geometry is required.");if(!l(e.attributes.position))throw new C("geometry.attributes.position is required.");if(!l(e.attributes[t]))throw new C(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${t}.`);n=g(n,1e4);const i=e.attributes.position.values,o=e.attributes[t].values,a=i.length,r=new Float64Array(2*a);let f=0;for(let d=0;d<a;d+=3)r[f++]=i[d],r[f++]=i[d+1],r[f++]=i[d+2],r[f++]=i[d]+o[d]*n,r[f++]=i[d+1]+o[d+1]*n,r[f++]=i[d+2]+o[d+2]*n;let c;const h=e.boundingSphere;return l(h)&&(c=new te(h.center,h.radius+n)),new mt({attributes:{position:new Ft({componentDatatype:he.DOUBLE,componentsPerAttribute:3,values:r})},primitiveType:Xe.LINES,boundingSphere:c})},$e.createAttributeLocations=function(e){if(!l(e))throw new C("geometry is required.");const t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={};let o=0,a;const r=t.length;for(a=0;a<r;++a){const f=t[a];l(n[f])&&(i[f]=o++)}for(const f in n)n.hasOwnProperty(f)&&!l(i[f])&&(i[f]=o++);return i},$e.reorderForPreVertexCache=function(e){if(!l(e))throw new C("geometry is required.");const t=mt.computeNumberOfVertices(e),n=e.indices;if(l(n)){const i=new Int32Array(t);for(let m=0;m<t;m++)i[m]=-1;const o=n,a=o.length,r=bt.createTypedArray(t,a);let f=0,c=0,h=0,d;for(;f<a;)d=i[o[f]],d!==-1?r[c]=d:(d=o[f],i[d]=h,r[c]=h,++h),++f,++c;e.indices=r;const p=e.attributes;for(const m in p)if(p.hasOwnProperty(m)&&l(p[m])&&l(p[m].values)){const T=p[m],y=T.values;let w=0;const A=T.componentsPerAttribute,E=he.createTypedArray(T.componentDatatype,h*A);for(;w<t;){const b=i[w];if(b!==-1)for(let I=0;I<A;I++)E[A*b+I]=y[A*w+I];++w}T.values=E}}return e},$e.reorderForPostVertexCache=function(e,t){if(!l(e))throw new C("geometry is required.");const n=e.indices;if(e.primitiveType===Xe.TRIANGLES&&l(n)){const i=n.length;let o=0;for(let a=0;a<i;a++)n[a]>o&&(o=n[a]);e.indices=rh.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Id(e){const t={};for(const n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){const i=e[n];t[n]=new Ft({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function dw(e,t,n){for(const i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){const o=t[i];for(let a=0;a<o.componentsPerAttribute;++a)e[i].values.push(o.values[n*o.componentsPerAttribute+a])}}$e.fitToUnsignedShortIndices=function(e){if(!l(e))throw new C("geometry is required.");if(l(e.indices)&&e.primitiveType!==Xe.TRIANGLES&&e.primitiveType!==Xe.LINES&&e.primitiveType!==Xe.POINTS)throw new C("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");const t=[],n=mt.computeNumberOfVertices(e);if(l(e.indices)&&n>=S.SIXTY_FOUR_KILOBYTES){let i=[],o=[],a=0,r=Id(e.attributes);const f=e.indices,c=f.length;let h;e.primitiveType===Xe.TRIANGLES?h=3:e.primitiveType===Xe.LINES?h=2:e.primitiveType===Xe.POINTS&&(h=1);for(let d=0;d<c;d+=h){for(let p=0;p<h;++p){const m=f[d+p];let T=i[m];l(T)||(T=a++,i[m]=T,dw(r,e.attributes,m)),o.push(T)}a+h>=S.SIXTY_FOUR_KILOBYTES&&(t.push(new mt({attributes:r,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],a=0,r=Id(e.attributes))}o.length!==0&&t.push(new mt({attributes:r,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const Dd=new u,pw=new oe;$e.projectTo2D=function(e,t,n,i,o){if(!l(e))throw new C("geometry is required.");if(!l(t))throw new C("attributeName is required.");if(!l(n))throw new C("attributeName3D is required.");if(!l(i))throw new C("attributeName2D is required.");if(!l(e.attributes[t]))throw new C(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==he.DOUBLE)throw new C("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");const a=e.attributes[t];o=l(o)?o:new Wn;const r=o.ellipsoid,f=a.values,c=new Float64Array(f.length);let h=0;for(let d=0;d<f.length;d+=3){const p=u.fromArray(f,d,Dd),m=r.cartesianToCartographic(p,pw);if(!l(m))throw new C(`Could not project point (${p.x}, ${p.y}, ${p.z}) to 2D.`);const T=o.project(m,Dd);c[h++]=T.x,c[h++]=T.y,c[h++]=T.z}return e.attributes[n]=a,e.attributes[i]=new Ft({componentDatatype:he.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};const ah={high:0,low:0};$e.encodeAttribute=function(e,t,n,i){if(!l(e))throw new C("geometry is required.");if(!l(t))throw new C("attributeName is required.");if(!l(n))throw new C("attributeHighName is required.");if(!l(i))throw new C("attributeLowName is required.");if(!l(e.attributes[t]))throw new C(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==he.DOUBLE)throw new C("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");const o=e.attributes[t],a=o.values,r=a.length,f=new Float32Array(r),c=new Float32Array(r);for(let d=0;d<r;++d)Qe.encode(a[d],ah),f[d]=ah.high,c[d]=ah.low;const h=o.componentsPerAttribute;return e.attributes[n]=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:h,values:f}),e.attributes[i]=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};let Un=new u;function ch(e,t){if(l(t)){const n=t.values,i=n.length;for(let o=0;o<i;o+=3)u.unpack(n,o,Un),k.multiplyByPoint(e,Un,Un),u.pack(Un,n,o)}}function hh(e,t){if(l(t)){const n=t.values,i=n.length;for(let o=0;o<i;o+=3)u.unpack(n,o,Un),G.multiplyByVector(e,Un,Un),Un=u.normalize(Un,Un),u.pack(Un,n,o)}}const ca=new k,ha=new G;$e.transformToWorldCoordinates=function(e){if(!l(e))throw new C("instance is required.");const t=e.modelMatrix;if(k.equals(t,k.IDENTITY))return e;const n=e.geometry.attributes;ch(t,n.position),ch(t,n.prevPosition),ch(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(k.inverse(t,ca),k.transpose(ca,ca),k.getMatrix3(ca,ha),hh(ha,n.normal),hh(ha,n.tangent),hh(ha,n.bitangent));const i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=te.transform(i,t,i)),e.modelMatrix=k.clone(k.IDENTITY),e};function mw(e,t){const n=e.length,i={},o=e[0][t].attributes;let a;for(a in o)if(o.hasOwnProperty(a)&&l(o[a])&&l(o[a].values)){const r=o[a];let f=r.values.length,c=!0;for(let h=1;h<n;++h){const d=e[h][t].attributes[a];if(!l(d)||r.componentDatatype!==d.componentDatatype||r.componentsPerAttribute!==d.componentsPerAttribute||r.normalize!==d.normalize){c=!1;break}f+=d.values.length}c&&(i[a]=new Ft({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:he.createTypedArray(r.componentDatatype,f)}))}return i}const _w=new u;function fh(e,t){const n=e.length;let i,o,a,r;const f=e[0].modelMatrix,c=l(e[0][t].indices),h=e[0][t].primitiveType;for(o=1;o<n;++o){if(!k.equals(e[o].modelMatrix,f))throw new C("All instances must have the same modelMatrix.");if(l(e[o][t].indices)!==c)throw new C("All instance geometries must have an indices or not have one.");if(e[o][t].primitiveType!==h)throw new C("All instance geometries must have the same primitiveType.")}const d=mw(e,t);let p,m,T;for(i in d)if(d.hasOwnProperty(i))for(p=d[i].values,r=0,o=0;o<n;++o)for(m=e[o][t].attributes[i].values,T=m.length,a=0;a<T;++a)p[r++]=m[a];let y;if(c){let b=0;for(o=0;o<n;++o)b+=e[o][t].indices.length;const I=mt.computeNumberOfVertices(new mt({attributes:d,primitiveType:Xe.POINTS})),O=bt.createTypedArray(I,b);let B=0,L=0;for(o=0;o<n;++o){const F=e[o][t].indices,N=F.length;for(r=0;r<N;++r)O[B++]=L+F[r];L+=mt.computeNumberOfVertices(e[o][t])}y=O}let w=new u,A=0,E;for(o=0;o<n;++o){if(E=e[o][t].boundingSphere,!l(E)){w=void 0;break}u.add(E.center,w,w)}if(l(w))for(u.divideByScalar(w,n,w),o=0;o<n;++o){E=e[o][t].boundingSphere;const b=u.magnitude(u.subtract(E.center,w,_w))+E.radius;b>A&&(A=b)}return new mt({attributes:d,indices:y,primitiveType:h,boundingSphere:l(w)?new te(w,A):void 0})}$e.combineInstances=function(e){if(!l(e)||e.length<1)throw new C("instances is required and must have length greater than zero.");const t=[],n=[],i=e.length;for(let a=0;a<i;++a){const r=e[a];l(r.geometry)?t.push(r):l(r.westHemisphereGeometry)&&l(r.eastHemisphereGeometry)&&n.push(r)}const o=[];return t.length>0&&o.push(fh(t,"geometry")),n.length>0&&(o.push(fh(n,"westHemisphereGeometry")),o.push(fh(n,"eastHemisphereGeometry"))),o};const Sn=new u,xs=new u,Go=new u,qo=new u;$e.computeNormal=function(e){if(!l(e))throw new C("geometry is required.");if(!l(e.attributes.position)||!l(e.attributes.position.values))throw new C("geometry.attributes.position.values is required.");if(!l(e.indices))throw new C("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!==0)throw new C("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==Xe.TRIANGLES)throw new C("geometry.primitiveType must be PrimitiveType.TRIANGLES.");const t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,a=t.length,r=new Array(o),f=new Array(a/3),c=new Array(a);let h;for(h=0;h<o;h++)r[h]={indexOffset:0,count:0,currentCount:0};let d=0;for(h=0;h<a;h+=3){const y=t[h],w=t[h+1],A=t[h+2],E=y*3,b=w*3,I=A*3;xs.x=i[E],xs.y=i[E+1],xs.z=i[E+2],Go.x=i[b],Go.y=i[b+1],Go.z=i[b+2],qo.x=i[I],qo.y=i[I+1],qo.z=i[I+2],r[y].count++,r[w].count++,r[A].count++,u.subtract(Go,xs,Go),u.subtract(qo,xs,qo),f[d]=u.cross(Go,qo,new u),d++}let p=0;for(h=0;h<o;h++)r[h].indexOffset+=p,p+=r[h].count;d=0;let m;for(h=0;h<a;h+=3){m=r[t[h]];let y=m.indexOffset+m.currentCount;c[y]=d,m.currentCount++,m=r[t[h+1]],y=m.indexOffset+m.currentCount,c[y]=d,m.currentCount++,m=r[t[h+2]],y=m.indexOffset+m.currentCount,c[y]=d,m.currentCount++,d++}const T=new Float32Array(o*3);for(h=0;h<o;h++){const y=h*3;if(m=r[h],u.clone(u.ZERO,Sn),m.count>0){for(d=0;d<m.count;d++)u.add(Sn,f[c[m.indexOffset+d]],Sn);u.equalsEpsilon(u.ZERO,Sn,S.EPSILON10)&&u.clone(f[c[m.indexOffset]],Sn)}u.equalsEpsilon(u.ZERO,Sn,S.EPSILON10)&&(Sn.z=1),u.normalize(Sn,Sn),T[y]=Sn.x,T[y+1]=Sn.y,T[y+2]=Sn.z}return e.attributes.normal=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:3,values:T}),e};const gw=new u,Od=new u,Tw=new u;$e.computeTangentAndBitangent=function(e){if(!l(e))throw new C("geometry is required.");const t=e.attributes,n=e.indices;if(!l(t.position)||!l(t.position.values))throw new C("geometry.attributes.position.values is required.");if(!l(t.normal)||!l(t.normal.values))throw new C("geometry.attributes.normal.values is required.");if(!l(t.st)||!l(t.st.values))throw new C("geometry.attributes.st.values is required.");if(!l(n))throw new C("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new C("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==Xe.TRIANGLES)throw new C("geometry.primitiveType must be PrimitiveType.TRIANGLES.");const i=e.attributes.position.values,o=e.attributes.normal.values,a=e.attributes.st.values,r=e.attributes.position.values.length/3,f=n.length,c=new Array(r*3);let h;for(h=0;h<c.length;h++)c[h]=0;let d,p,m;for(h=0;h<f;h+=3){const w=n[h],A=n[h+1],E=n[h+2];d=w*3,p=A*3,m=E*3;const b=w*2,I=A*2,O=E*2,B=i[d],L=i[d+1],F=i[d+2],N=a[b],U=a[b+1],M=a[I+1]-U,j=a[O+1]-U,Y=1/((a[I]-N)*j-(a[O]-N)*M),s=(j*(i[p]-B)-M*(i[m]-B))*Y,x=(j*(i[p+1]-L)-M*(i[m+1]-L))*Y,P=(j*(i[p+2]-F)-M*(i[m+2]-F))*Y;c[d]+=s,c[d+1]+=x,c[d+2]+=P,c[p]+=s,c[p+1]+=x,c[p+2]+=P,c[m]+=s,c[m+1]+=x,c[m+2]+=P}const T=new Float32Array(r*3),y=new Float32Array(r*3);for(h=0;h<r;h++){d=h*3,p=d+1,m=d+2;const w=u.fromArray(o,d,gw),A=u.fromArray(c,d,Tw),E=u.dot(w,A);u.multiplyByScalar(w,E,Od),u.normalize(u.subtract(A,Od,A),A),T[d]=A.x,T[p]=A.y,T[m]=A.z,u.normalize(u.cross(w,A,A),A),y[d]=A.x,y[p]=A.y,y[m]=A.z}return e.attributes.tangent=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:3,values:T}),e.attributes.bitangent=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:3,values:y}),e};const Ss=new q,kn=new u,vd=new u,Wd=new u;let fa=new q;$e.compressVertices=function(e){if(!l(e))throw new C("geometry is required.");const t=e.attributes.extrudeDirection;let n,i;if(l(t)){const L=t.values;i=L.length/3;const F=new Float32Array(i*2);let N=0;for(n=0;n<i;++n){if(u.fromArray(L,n*3,kn),u.equals(kn,u.ZERO)){N+=2;continue}fa=De.octEncodeInRange(kn,65535,fa),F[N++]=fa.x,F[N++]=fa.y}return e.attributes.compressedAttributes=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:2,values:F}),delete e.attributes.extrudeDirection,e}const o=e.attributes.normal,a=e.attributes.st,r=l(o),f=l(a);if(!r&&!f)return e;const c=e.attributes.tangent,h=e.attributes.bitangent,d=l(c),p=l(h);let m,T,y,w;r&&(m=o.values),f&&(T=a.values),d&&(y=c.values),p&&(w=h.values),i=(r?m.length:T.length)/(r?3:2);let b=i,I=f&&r?2:1;I+=d||p?1:0,b*=I;const O=new Float32Array(b);let B=0;for(n=0;n<i;++n){f&&(q.fromArray(T,n*2,Ss),O[B++]=De.compressTextureCoordinates(Ss));const L=n*3;r&&l(y)&&l(w)?(u.fromArray(m,L,kn),u.fromArray(y,L,vd),u.fromArray(w,L,Wd),De.octPack(kn,vd,Wd,Ss),O[B++]=Ss.x,O[B++]=Ss.y):(r&&(u.fromArray(m,L,kn),O[B++]=De.octEncodeFloat(kn)),d&&(u.fromArray(y,L,kn),O[B++]=De.octEncodeFloat(kn)),p&&(u.fromArray(w,L,kn),O[B++]=De.octEncodeFloat(kn)))}return e.attributes.compressedAttributes=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:I,values:O}),r&&delete e.attributes.normal,f&&delete e.attributes.st,p&&delete e.attributes.bitangent,d&&delete e.attributes.tangent,e};function yw(e){if(l(e.indices))return e;const t=mt.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");if(t%3!==0)throw new C("The number of vertices must be a multiple of three.");const n=bt.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function Cw(e){const t=mt.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");const n=bt.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=Xe.TRIANGLES,e}function ww(e){const t=mt.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least 3.");const n=bt.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=Xe.TRIANGLES,e}function Aw(e){if(l(e.indices))return e;const t=mt.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");if(t%2!==0)throw new C("The number of vertices must be a multiple of 2.");const n=bt.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function Ew(e){const t=mt.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");const n=bt.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=Xe.LINES,e}function bw(e){const t=mt.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");const n=bt.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Xe.LINES,e}function xw(e){switch(e.primitiveType){case Xe.TRIANGLE_FAN:return Cw(e);case Xe.TRIANGLE_STRIP:return ww(e);case Xe.TRIANGLES:return yw(e);case Xe.LINE_STRIP:return Ew(e);case Xe.LINE_LOOP:return bw(e);case Xe.LINES:return Aw(e)}return e}function qi(e,t){Math.abs(e.y)<S.EPSILON6&&(t?e.y=-S.EPSILON6:e.y=S.EPSILON6)}function Sw(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){qi(e,e.y<0),qi(t,t.y<0),qi(n,n.y<0);return}const i=Math.abs(e.y),o=Math.abs(t.y),a=Math.abs(n.y);let r;i>o?i>a?r=S.sign(e.y):r=S.sign(n.y):o>a?r=S.sign(t.y):r=S.sign(n.y);const f=r<0;qi(e,f),qi(t,f),qi(n,f)}const Pd=new u;function In(e,t,n,i){u.add(e,u.multiplyByScalar(u.subtract(t,e,Pd),e.y/(e.y-t.y),Pd),n),u.clone(n,i),qi(n,!0),qi(i,!1)}const co=new u,ho=new u,fo=new u,lo=new u,lh={positions:new Array(7),indices:new Array(3*3)};function Iw(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;Sw(e,t,n);const i=e.y<0,o=t.y<0,a=n.y<0;let r=0;r+=i?1:0,r+=o?1:0,r+=a?1:0;const f=lh.indices;r===1?(f[1]=3,f[2]=4,f[5]=6,f[7]=6,f[8]=5,i?(In(e,t,co,fo),In(e,n,ho,lo),f[0]=0,f[3]=1,f[4]=2,f[6]=1):o?(In(t,n,co,fo),In(t,e,ho,lo),f[0]=1,f[3]=2,f[4]=0,f[6]=2):a&&(In(n,e,co,fo),In(n,t,ho,lo),f[0]=2,f[3]=0,f[4]=1,f[6]=0)):r===2&&(f[2]=4,f[4]=4,f[5]=3,f[7]=5,f[8]=6,i?o?a||(In(n,e,co,fo),In(n,t,ho,lo),f[0]=0,f[1]=1,f[3]=0,f[6]=2):(In(t,n,co,fo),In(t,e,ho,lo),f[0]=2,f[1]=0,f[3]=2,f[6]=1):(In(e,t,co,fo),In(e,n,ho,lo),f[0]=1,f[1]=2,f[3]=1,f[6]=0));const c=lh.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(r===1||r===2)&&(c[3]=co,c[4]=ho,c[5]=fo,c[6]=lo,c.length=7),lh}function Bd(e,t){const n=e.attributes;if(n.position.values.length===0)return;for(const o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){const a=n[o];a.values=he.createTypedArray(a.componentDatatype,a.values)}const i=mt.computeNumberOfVertices(e);return e.indices=bt.createTypedArray(i,e.indices),t&&(e.boundingSphere=te.fromVertices(n.position.values)),e}function Ho(e){const t=e.attributes,n={};for(const i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){const o=t[i];n[i]=new Ft({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new mt({attributes:n,indices:[],primitiveType:e.primitiveType})}function uh(e,t,n){const i=l(e.geometry.boundingSphere);t=Bd(t,i),n=Bd(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function dh(e,t){const n=new e,i=new e,o=new e;return function(a,r,f,c,h,d,p,m){const T=e.fromArray(h,a*t,n),y=e.fromArray(h,r*t,i),w=e.fromArray(h,f*t,o);e.multiplyByScalar(T,c.x,T),e.multiplyByScalar(y,c.y,y),e.multiplyByScalar(w,c.z,w);const A=e.add(T,y,T);e.add(A,w,A),m&&e.normalize(A,A),e.pack(A,d,p*t)}}const Dw=dh(Z,4),la=dh(u,3),Rd=dh(q,2),Ow=function(e,t,n,i,o,a,r){const f=o[e]*i.x,c=o[t]*i.y,h=o[n]*i.z;a[r]=f+c+h>S.EPSILON6?1:0},Is=new u,ph=new u,mh=new u,vw=new u;function ua(e,t,n,i,o,a,r,f,c,h,d,p,m,T,y,w){if(!l(a)&&!l(r)&&!l(f)&&!l(c)&&!l(h)&&T===0)return;const A=u.fromArray(o,e*3,Is),E=u.fromArray(o,t*3,ph),b=u.fromArray(o,n*3,mh),I=hw(i,A,E,b,vw);if(l(I)){if(l(a)&&la(e,t,n,I,a,p.normal.values,w,!0),l(h)){const O=u.fromArray(h,e*3,Is),B=u.fromArray(h,t*3,ph),L=u.fromArray(h,n*3,mh);u.multiplyByScalar(O,I.x,O),u.multiplyByScalar(B,I.y,B),u.multiplyByScalar(L,I.z,L);let F;!u.equals(O,u.ZERO)||!u.equals(B,u.ZERO)||!u.equals(L,u.ZERO)?(F=u.add(O,B,O),u.add(F,L,F),u.normalize(F,F)):(F=Is,F.x=0,F.y=0,F.z=0),u.pack(F,p.extrudeDirection.values,w*3)}if(l(d)&&Ow(e,t,n,I,d,p.applyOffset.values,w),l(r)&&la(e,t,n,I,r,p.tangent.values,w,!0),l(f)&&la(e,t,n,I,f,p.bitangent.values,w,!0),l(c)&&Rd(e,t,n,I,c,p.st.values,w),T>0)for(let O=0;O<T;O++){const B=m[O];Ww(e,t,n,I,w,y[B],p[B])}}}function Ww(e,t,n,i,o,a,r){const f=a.componentsPerAttribute,c=a.values,h=r.values;switch(f){case 4:Dw(e,t,n,i,c,h,o,!1);break;case 3:la(e,t,n,i,c,h,o,!1);break;case 2:Rd(e,t,n,i,c,h,o,!1);break;default:h[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function si(e,t,n,i,o,a){const r=e.position.values.length/3;if(o!==-1){const f=i[o],c=n[f];return c===-1?(n[f]=r,e.position.values.push(a.x,a.y,a.z),t.push(r),r):(t.push(c),c)}return e.position.values.push(a.x,a.y,a.z),t.push(r),r}const Pw={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function zd(e){const t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,a=l(n.bitangent)?n.bitangent.values:void 0,r=l(n.tangent)?n.tangent.values:void 0,f=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,h=l(n.applyOffset)?n.applyOffset.values:void 0,d=t.indices,p=[];for(const F in n)n.hasOwnProperty(F)&&!Pw[F]&&l(n[F])&&p.push(F);const m=p.length,T=Ho(t),y=Ho(t);let w,A,E,b,I;const O=[];O.length=i.length/3;const B=[];for(B.length=i.length/3,I=0;I<O.length;++I)O[I]=-1,B[I]=-1;const L=d.length;for(I=0;I<L;I+=3){const F=d[I],N=d[I+1],U=d[I+2];let M=u.fromArray(i,F*3),j=u.fromArray(i,N*3),Y=u.fromArray(i,U*3);const s=Iw(M,j,Y);if(l(s)&&s.positions.length>3){const x=s.positions,P=s.indices,z=P.length;for(let H=0;H<z;++H){const X=P[H],ee=x[X];ee.y<0?(w=y.attributes,A=y.indices,E=O):(w=T.attributes,A=T.indices,E=B),b=si(w,A,E,d,X<3?I+X:-1,ee),ua(F,N,U,ee,i,o,r,a,f,c,h,w,p,m,n,b)}}else l(s)&&(M=s.positions[0],j=s.positions[1],Y=s.positions[2]),M.y<0?(w=y.attributes,A=y.indices,E=O):(w=T.attributes,A=T.indices,E=B),b=si(w,A,E,d,I,M),ua(F,N,U,M,i,o,r,a,f,c,h,w,p,m,n,b),b=si(w,A,E,d,I+1,j),ua(F,N,U,j,i,o,r,a,f,c,h,w,p,m,n,b),b=si(w,A,E,d,I+2,Y),ua(F,N,U,Y,i,o,r,a,f,c,h,w,p,m,n,b)}uh(e,y,T)}const Ld=Me.fromPointNormal(u.ZERO,u.UNIT_Y),Bw=new u,Rw=new u;function jo(e,t,n,i,o,a,r){if(!l(r))return;const f=u.fromArray(i,e*3,Is);u.equalsEpsilon(f,n,S.EPSILON10)?a.applyOffset.values[o]=r[e]:a.applyOffset.values[o]=r[t]}function Nd(e){const t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,a=t.indices,r=Ho(t),f=Ho(t);let c;const h=a.length,d=[];d.length=i.length/3;const p=[];for(p.length=i.length/3,c=0;c<d.length;++c)d[c]=-1,p[c]=-1;for(c=0;c<h;c+=2){const m=a[c],T=a[c+1],y=u.fromArray(i,m*3,Is),w=u.fromArray(i,T*3,ph);let A;Math.abs(y.y)<S.EPSILON6&&(y.y<0?y.y=-S.EPSILON6:y.y=S.EPSILON6),Math.abs(w.y)<S.EPSILON6&&(w.y<0?w.y=-S.EPSILON6:w.y=S.EPSILON6);let E=r.attributes,b=r.indices,I=p,O=f.attributes,B=f.indices,L=d;const F=Ue.lineSegmentPlane(y,w,Ld,mh);if(l(F)){const N=u.multiplyByScalar(u.UNIT_Y,5*S.EPSILON9,Bw);y.y<0&&(u.negate(N,N),E=f.attributes,b=f.indices,I=d,O=r.attributes,B=r.indices,L=p);const U=u.add(F,N,Rw);A=si(E,b,I,a,c,y),jo(m,T,y,i,A,E,o),A=si(E,b,I,a,-1,U),jo(m,T,U,i,A,E,o),u.negate(N,N),u.add(F,N,U),A=si(O,B,L,a,-1,U),jo(m,T,U,i,A,O,o),A=si(O,B,L,a,c+1,w),jo(m,T,w,i,A,O,o)}else{let N,U,M;y.y<0?(N=f.attributes,U=f.indices,M=d):(N=r.attributes,U=r.indices,M=p),A=si(N,U,M,a,c,y),jo(m,T,y,i,A,N,o),A=si(N,U,M,a,c+1,w),jo(m,T,w,i,A,N,o)}}uh(e,f,r)}const Fd=new q,zw=new q,Md=new u,Ud=new u,_h=new u,Lw=new u,Nw=new u,Fw=new u,kd=new Z;function Vd(e){const t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,a=n.length;for(let r=0;r<a;r+=3){const f=u.unpack(n,r,Md);if(f.x>0)continue;const c=u.unpack(i,r,Ud);(f.y<0&&c.y>0||f.y>0&&c.y<0)&&(r-3>0?(i[r]=n[r-3],i[r+1]=n[r-2],i[r+2]=n[r-1]):u.pack(f,i,r));const h=u.unpack(o,r,_h);(f.y<0&&h.y>0||f.y>0&&h.y<0)&&(r+3<a?(o[r]=n[r+3],o[r+1]=n[r+4],o[r+2]=n[r+5]):u.pack(f,o,r))}}const Mw=5*S.EPSILON9,da=S.EPSILON6;function Uw(e){const t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,a=n.nextPosition.values,r=n.expandAndWidth.values,f=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,h=Ho(t),d=Ho(t);let p,m,T,y=!1;const w=i.length/3;for(p=0;p<w;p+=4){const A=p,E=p+2,b=u.fromArray(i,A*3,Md),I=u.fromArray(i,E*3,Ud);if(Math.abs(b.y)<da)for(b.y=da*(I.y<0?-1:1),i[p*3+1]=b.y,i[(p+1)*3+1]=b.y,m=A*3;m<A*3+4*3;m+=3)o[m]=i[p*3],o[m+1]=i[p*3+1],o[m+2]=i[p*3+2];if(Math.abs(I.y)<da)for(I.y=da*(b.y<0?-1:1),i[(p+2)*3+1]=I.y,i[(p+3)*3+1]=I.y,m=A*3;m<A*3+4*3;m+=3)a[m]=i[(p+2)*3],a[m+1]=i[(p+2)*3+1],a[m+2]=i[(p+2)*3+2];let O=h.attributes,B=h.indices,L=d.attributes,F=d.indices;const N=Ue.lineSegmentPlane(b,I,Ld,Lw);if(l(N)){y=!0;const U=u.multiplyByScalar(u.UNIT_Y,Mw,Nw);b.y<0&&(u.negate(U,U),O=d.attributes,B=d.indices,L=h.attributes,F=h.indices);const M=u.add(N,U,Fw);O.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),O.position.values.push(M.x,M.y,M.z),O.position.values.push(M.x,M.y,M.z),O.prevPosition.values.push(o[A*3],o[A*3+1],o[A*3+2]),O.prevPosition.values.push(o[A*3+3],o[A*3+4],o[A*3+5]),O.prevPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),O.nextPosition.values.push(M.x,M.y,M.z),O.nextPosition.values.push(M.x,M.y,M.z),O.nextPosition.values.push(M.x,M.y,M.z),O.nextPosition.values.push(M.x,M.y,M.z),u.negate(U,U),u.add(N,U,M),L.position.values.push(M.x,M.y,M.z),L.position.values.push(M.x,M.y,M.z),L.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),L.prevPosition.values.push(M.x,M.y,M.z),L.prevPosition.values.push(M.x,M.y,M.z),L.prevPosition.values.push(M.x,M.y,M.z),L.prevPosition.values.push(M.x,M.y,M.z),L.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),L.nextPosition.values.push(a[E*3],a[E*3+1],a[E*3+2]),L.nextPosition.values.push(a[E*3+3],a[E*3+4],a[E*3+5]);const j=q.fromArray(r,A*2,Fd),Y=Math.abs(j.y);O.expandAndWidth.values.push(-1,Y,1,Y),O.expandAndWidth.values.push(-1,-Y,1,-Y),L.expandAndWidth.values.push(-1,Y,1,Y),L.expandAndWidth.values.push(-1,-Y,1,-Y);let s=u.magnitudeSquared(u.subtract(N,b,_h));if(s/=u.magnitudeSquared(u.subtract(I,b,_h)),l(c)){const x=Z.fromArray(c,A*4,kd),P=Z.fromArray(c,E*4,kd),z=S.lerp(x.x,P.x,s),H=S.lerp(x.y,P.y,s),X=S.lerp(x.z,P.z,s),ee=S.lerp(x.w,P.w,s);for(m=A*4;m<A*4+2*4;++m)O.color.values.push(c[m]);for(O.color.values.push(z,H,X,ee),O.color.values.push(z,H,X,ee),L.color.values.push(z,H,X,ee),L.color.values.push(z,H,X,ee),m=E*4;m<E*4+2*4;++m)L.color.values.push(c[m])}if(l(f)){const x=q.fromArray(f,A*2,Fd),P=q.fromArray(f,(p+3)*2,zw),z=S.lerp(x.x,P.x,s);for(m=A*2;m<A*2+2*2;++m)O.st.values.push(f[m]);for(O.st.values.push(z,x.y),O.st.values.push(z,P.y),L.st.values.push(z,x.y),L.st.values.push(z,P.y),m=E*2;m<E*2+2*2;++m)L.st.values.push(f[m])}T=O.position.values.length/3-4,B.push(T,T+2,T+1),B.push(T+1,T+2,T+3),T=L.position.values.length/3-4,F.push(T,T+2,T+1),F.push(T+1,T+2,T+3)}else{let U,M;for(b.y<0?(U=d.attributes,M=d.indices):(U=h.attributes,M=h.indices),U.position.values.push(b.x,b.y,b.z),U.position.values.push(b.x,b.y,b.z),U.position.values.push(I.x,I.y,I.z),U.position.values.push(I.x,I.y,I.z),m=p*3;m<p*3+4*3;++m)U.prevPosition.values.push(o[m]),U.nextPosition.values.push(a[m]);for(m=p*2;m<p*2+4*2;++m)U.expandAndWidth.values.push(r[m]),l(f)&&U.st.values.push(f[m]);if(l(c))for(m=p*4;m<p*4+4*4;++m)U.color.values.push(c[m]);T=U.position.values.length/3-4,M.push(T,T+2,T+1),M.push(T+1,T+2,T+3)}}y&&(Vd(d),Vd(h)),uh(e,d,h)}$e.splitLongitude=function(e){if(!l(e))throw new C("instance is required.");const t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||te.intersectPlane(n,Me.ORIGIN_ZX_PLANE)!==xt.INTERSECTING))return e;if(t.geometryType!==ds.NONE)switch(t.geometryType){case ds.POLYLINES:Uw(e);break;case ds.TRIANGLES:zd(e);break;case ds.LINES:Nd(e);break}else xw(t),t.primitiveType===Xe.TRIANGLES?zd(e):t.primitiveType===Xe.LINES&&Nd(e);return e};function on(e){this._ellipsoid=g(e,pe.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(on.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),on.mercatorAngleToGeodeticLatitude=function(e){return S.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},on.geodeticLatitudeToMercatorAngle=function(e){e>on.MaximumLatitude?e=on.MaximumLatitude:e<-on.MaximumLatitude&&(e=-on.MaximumLatitude);const t=Math.sin(e);return .5*Math.log((1+t)/(1-t))},on.MaximumLatitude=on.mercatorAngleToGeodeticLatitude(Math.PI),on.prototype.project=function(e,t){const n=this._semimajorAxis,i=e.longitude*n,o=on.geodeticLatitudeToMercatorAngle(e.latitude)*n,a=e.height;return l(t)?(t.x=i,t.y=o,t.z=a,t):new u(i,o,a)},on.prototype.unproject=function(e,t){if(!l(e))throw new C("cartesian is required");const n=this._oneOverSemimajorAxis,i=e.x*n,o=on.mercatorAngleToGeodeticLatitude(e.y*n),a=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=a,t):new oe(i,o,a)};function kw(e,t,n){let i=!n;const o=e.length;let a;if(!i&&o>1){const r=e[0].modelMatrix;for(a=1;a<o;++a)if(!k.equals(r,e[a].modelMatrix)){i=!0;break}}if(i)for(a=0;a<o;++a)l(e[a].geometry)&&$e.transformToWorldCoordinates(e[a]);else k.multiplyTransformation(t,e[0].modelMatrix,t)}function gh(e,t){const n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});const a=n.batchId.values;for(let r=0;r<o;++r)a[r]=t}function Vw(e){const t=e.length;for(let n=0;n<t;++n){const i=e[n];l(i.geometry)?gh(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(gh(i.westHemisphereGeometry,n),gh(i.eastHemisphereGeometry,n))}}function Gw(e){const t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,a=e.vertexCacheOptimize,r=e.compressVertices,f=e.modelMatrix;let c,h,d,p=t.length;for(c=0;c<p;++c)if(l(t[c].geometry)){d=t[c].geometry.primitiveType;break}for(c=1;c<p;++c)if(l(t[c].geometry)&&t[c].geometry.primitiveType!==d)throw new C("All instance geometries must have the same primitiveType.");if(kw(t,f,o),!o)for(c=0;c<p;++c)l(t[c].geometry)&&$e.splitLongitude(t[c]);if(Vw(t),a)for(c=0;c<p;++c){const T=t[c];l(T.geometry)?($e.reorderForPostVertexCache(T.geometry),$e.reorderForPreVertexCache(T.geometry)):l(T.westHemisphereGeometry)&&l(T.eastHemisphereGeometry)&&($e.reorderForPostVertexCache(T.westHemisphereGeometry),$e.reorderForPreVertexCache(T.westHemisphereGeometry),$e.reorderForPostVertexCache(T.eastHemisphereGeometry),$e.reorderForPreVertexCache(T.eastHemisphereGeometry))}let m=$e.combineInstances(t);for(p=m.length,c=0;c<p;++c){h=m[c];const T=h.attributes;if(o)for(const y in T)T.hasOwnProperty(y)&&T[y].componentDatatype===he.DOUBLE&&$e.encodeAttribute(h,y,`${y}3DHigh`,`${y}3DLow`);else for(const y in T)if(T.hasOwnProperty(y)&&T[y].componentDatatype===he.DOUBLE){const w=`${y}3D`,A=`${y}2D`;$e.projectTo2D(h,y,w,A,n),l(h.boundingSphere)&&y==="position"&&(h.boundingSphereCV=te.fromVertices(h.attributes.position2D.values)),$e.encodeAttribute(h,w,`${w}High`,`${w}Low`),$e.encodeAttribute(h,A,`${A}High`,`${A}Low`)}r&&$e.compressVertices(h)}if(!i){let T=[];for(p=m.length,c=0;c<p;++c)h=m[c],T=T.concat($e.fitToUnsignedShortIndices(h));m=T}return m}function Th(e,t,n,i){let o,a,r;const f=i.length-1;if(f>=0){const h=i[f];o=h.offset+h.count,r=h.index,a=n[r].indices.length}else o=0,r=0,a=n[r].indices.length;const c=e.length;for(let h=0;h<c;++h){const p=e[h][t];if(!l(p))continue;const m=p.indices.length;o+m>a&&(o=0,a=n[++r].indices.length),i.push({index:r,offset:o,count:m}),o+=m}}function qw(e,t){const n=[];return Th(e,"geometry",t,n),Th(e,"westHemisphereGeometry",t,n),Th(e,"eastHemisphereGeometry",t,n),n}const Vn={};Vn.combineGeometry=function(e){let t,n;const i=e.instances,o=i.length;let a,r,f=!1;o>0&&(t=Gw(e),t.length>0&&(n=$e.createAttributeLocations(t[0]),e.createPickOffsets&&(a=qw(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(r=new Array(o),f=!0));const c=new Array(o),h=new Array(o);for(let d=0;d<o;++d){const p=i[d],m=p.geometry;l(m)&&(c[d]=m.boundingSphere,h[d]=m.boundingSphereCV,f&&(r[d]=p.geometry.offsetAttribute));const T=p.eastHemisphereGeometry,y=p.westHemisphereGeometry;l(T)&&l(y)&&(l(T.boundingSphere)&&l(y.boundingSphere)&&(c[d]=te.union(T.boundingSphere,y.boundingSphere)),l(T.boundingSphereCV)&&l(y.boundingSphereCV)&&(h[d]=te.union(T.boundingSphereCV,y.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:a,offsetInstanceExtend:r,boundingSpheres:c,boundingSpheresCV:h}};function Hw(e,t){const n=e.attributes;for(const i in n)if(n.hasOwnProperty(i)){const o=n[i];l(o)&&l(o.values)&&t.push(o.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function jw(e,t){const n=e.length;for(let i=0;i<n;++i)Hw(e[i],t)}function Yw(e){let t=1;const n=e.length;for(let i=0;i<n;i++){const o=e[i];if(++t,!l(o))continue;const a=o.attributes;t+=7+2*te.packedLength+(l(o.indices)?o.indices.length:0);for(const r in a)if(a.hasOwnProperty(r)&&l(a[r])){const f=a[r];t+=5+f.values.length}}return t}Vn.packCreateGeometryResults=function(e,t){const n=new Float64Array(Yw(e)),i=[],o={},a=e.length;let r=0;n[r++]=a;for(let f=0;f<a;f++){const c=e[f],h=l(c);if(n[r++]=h?1:0,!h)continue;n[r++]=c.primitiveType,n[r++]=c.geometryType,n[r++]=g(c.offsetAttribute,-1);const d=l(c.boundingSphere)?1:0;n[r++]=d,d&&te.pack(c.boundingSphere,n,r),r+=te.packedLength;const p=l(c.boundingSphereCV)?1:0;n[r++]=p,p&&te.pack(c.boundingSphereCV,n,r),r+=te.packedLength;const m=c.attributes,T=[];for(const w in m)m.hasOwnProperty(w)&&l(m[w])&&(T.push(w),l(o[w])||(o[w]=i.length,i.push(w)));n[r++]=T.length;for(let w=0;w<T.length;w++){const A=T[w],E=m[A];n[r++]=o[A],n[r++]=E.componentDatatype,n[r++]=E.componentsPerAttribute,n[r++]=E.normalize?1:0,n[r++]=E.values.length,n.set(E.values,r),r+=E.values.length}const y=l(c.indices)?c.indices.length:0;n[r++]=y,y>0&&(n.set(c.indices,r),r+=y)}return t.push(n.buffer),{stringTable:i,packedData:n}},Vn.unpackCreateGeometryResults=function(e){const t=e.stringTable,n=e.packedData;let i;const o=new Array(n[0]);let a=0,r=1;for(;r<n.length;){if(!(n[r++]===1)){o[a++]=void 0;continue}const c=n[r++],h=n[r++];let d=n[r++];d===-1&&(d=void 0);let p,m;n[r++]===1&&(p=te.unpack(n,r)),r+=te.packedLength,n[r++]===1&&(m=te.unpack(n,r)),r+=te.packedLength;let w,A,E;const b=new Fu,I=n[r++];for(i=0;i<I;i++){const B=t[n[r++]],L=n[r++];E=n[r++];const F=n[r++]!==0;w=n[r++],A=he.createTypedArray(L,w);for(let N=0;N<w;N++)A[N]=n[r++];b[B]=new Ft({componentDatatype:L,componentsPerAttribute:E,normalize:F,values:A})}let O;if(w=n[r++],w>0){const B=A.length/E;for(O=bt.createTypedArray(B,w),i=0;i<w;i++)O[i]=n[r++]}o[a++]=new mt({primitiveType:c,geometryType:h,boundingSphere:p,boundingSphereCV:m,indices:O,attributes:b,offsetAttribute:d})}return o};function Xw(e,t){const n=e.length,i=new Float64Array(1+n*19);let o=0;i[o++]=n;for(let a=0;a<n;a++){const r=e[a];if(k.pack(r.modelMatrix,i,o),o+=k.packedLength,l(r.attributes)&&l(r.attributes.offset)){const f=r.attributes.offset.value;i[o]=f[0],i[o+1]=f[1],i[o+2]=f[2]}o+=3}return t.push(i.buffer),i}function $w(e){const t=e,n=new Array(t[0]);let i=0,o=1;for(;o<t.length;){const a=k.unpack(t,o);let r;o+=k.packedLength,l(t[o])&&(r={offset:new _s(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:a,attributes:r}}return n}Vn.packCombineGeometryParameters=function(e,t){const n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:Xw(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Wn,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},Vn.unpackCombineGeometryParameters=function(e){const t=$w(e.packedInstances),n=e.createGeometryResults,i=n.length;let o=0;for(let f=0;f<i;f++){const c=Vn.unpackCreateGeometryResults(n[f]),h=c.length;for(let d=0;d<h;d++){const p=c[d],m=t[o];m.geometry=p,++o}}const a=pe.clone(e.ellipsoid),r=e.isGeographic?new Wn(a):new on(a);return{instances:t,ellipsoid:a,projection:r,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:k.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Gd(e){const t=e.length,n=1+(te.packedLength+1)*t,i=new Float32Array(n);let o=0;i[o++]=t;for(let a=0;a<t;++a){const r=e[a];l(r)?(i[o++]=1,te.pack(e[a],i,o)):i[o++]=0,o+=te.packedLength}return i}function qd(e){const t=new Array(e[0]);let n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=te.unpack(e,i)),++n,i+=te.packedLength;return t}Vn.packCombineGeometryResults=function(e,t){l(e.geometries)&&jw(e.geometries,t);const n=Gd(e.boundingSpheres),i=Gd(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}},Vn.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:qd(e.boundingSpheres),boundingSpheresCV:qd(e.boundingSpheresCV)}};const Ot=Object.freeze({READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6}),gn={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};gn.NUMBER_OF_SHADOW_MODES=4,gn.castShadows=function(e){return e===gn.ENABLED||e===gn.CAST_ONLY},gn.receiveShadows=function(e){return e===gn.ENABLED||e===gn.RECEIVE_ONLY},gn.fromCastReceive=function(e,t){return e&&t?gn.ENABLED:e?gn.CAST_ONLY:t?gn.RECEIVE_ONLY:gn.DISABLED};const pa=Object.freeze(gn);function Pe(e){if(e=g(e,g.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=k.clone(g(e.modelMatrix,k.IDENTITY)),this._modelMatrix=new k,this.show=g(e.show,!0),this._vertexCacheOptimize=g(e.vertexCacheOptimize,!1),this._interleave=g(e.interleave,!1),this._releaseGeometryInstances=g(e.releaseGeometryInstances,!0),this._allowPicking=g(e.allowPicking,!0),this._asynchronous=g(e.asynchronous,!0),this._compressVertices=g(e.compressVertices,!0),this.cull=g(e.cull,!0),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,l(this.rtcCenter)&&(!l(this.geometryInstances)||Array.isArray(this.geometryInstances)&&this.geometryInstances.length!==1))throw new C("Relative-to-center rendering only supports one geometry instance.");this.shadows=g(e.shadows,pa.DISABLED),this._translucent=void 0,this._state=Ot.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(Pe.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function Zw(e){const t=e.length,n=[],i=e[0].attributes;let o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){const a=i[o];let r=!0;for(let f=1;f<t;++f){const c=e[f].attributes[o];if(!l(c)||a.componentDatatype!==c.componentDatatype||a.componentsPerAttribute!==c.componentsPerAttribute||a.normalize!==c.normalize){r=!1;break}}r&&n.push(o)}return n}const Kw=new q,Qw=new u,Hd=new Z;function jd(e){const t=e.length;if(t===1)return e[0];if(t===2)return q.unpack(e,0,Kw);if(t===3)return u.unpack(e,0,Qw);if(t===4)return Z.unpack(e,0,Hd)}function Jw(e,t){const n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;const a=Zw(i),r=a.length,f=[],c={},h={};let d,m=i[0].attributes,T,y,w;for(T=0;T<r;++T)y=a[T],w=m[y],c[y]=T,f.push({functionName:`czm_batchTable_${y}`,componentDatatype:w.componentDatatype,componentsPerAttribute:w.componentsPerAttribute,normalize:w.normalize});a.indexOf("distanceDisplayCondition")!==-1&&(f.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:he.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:he.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:he.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:he.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:he.FLOAT,componentsPerAttribute:1}),h.center3DHigh=f.length-5,h.center3DLow=f.length-4,h.center2DHigh=f.length-3,h.center2DLow=f.length-2,h.radius=f.length-1),a.indexOf("offset")!==-1&&(f.push({functionName:"czm_batchTable_offset2D",componentDatatype:he.FLOAT,componentsPerAttribute:3}),d=f.length-1),f.push({functionName:"czm_batchTable_pickColor",componentDatatype:he.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});const A=f.length,E=new Ai(t,f,o);for(T=0;T<o;++T){const b=i[T];m=b.attributes;for(let F=0;F<r;++F){y=a[F],w=m[y];const N=jd(w.value),U=c[y];E.setBatchedAttribute(T,U,N)}const I={primitive:g(b.pickPrimitive,e)};l(b.id)&&(I.id=b.id);const O=t.createPickId(I);e._pickIds.push(O);const B=O.color,L=Hd;L.x=D.floatToByte(B.red),L.y=D.floatToByte(B.green),L.z=D.floatToByte(B.blue),L.w=D.floatToByte(B.alpha),E.setBatchedAttribute(T,A-1,L)}e._batchTable=E,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=h,e._batchTableOffsetAttribute2DIndex=d}function eA(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ft({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function tA(e){const t=e.attributes,n=new Fu;for(const o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=eA(t[o]));let i;if(l(e.indices)){const o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new mt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:te.clone(e.boundingSphere)})}function nA(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:k.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}const iA=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Pe._modifyShaderPosition=function(e,t,n){let i,o="",a="",r="";for(;(i=iA.exec(t))!==null;){const f=i[1],c=`vec4 czm_compute${f[0].toUpperCase()}${f.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c};
4659
+ ${r}`}},Ai.prototype.isDestroyed=function(){return!1},Ai.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),st(this)};const Ge={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Ge.getMathType=function(e){switch(e){case Ge.SCALAR:return Number;case Ge.VEC2:return q;case Ge.VEC3:return u;case Ge.VEC4:return Z;case Ge.MAT2:return ue;case Ge.MAT3:return G;case Ge.MAT4:return k;default:throw new C("attributeType is not a valid value.")}},Ge.getNumberOfComponents=function(e){switch(e){case Ge.SCALAR:return 1;case Ge.VEC2:return 2;case Ge.VEC3:return 3;case Ge.VEC4:case Ge.MAT2:return 4;case Ge.MAT3:return 9;case Ge.MAT4:return 16;default:throw new C("attributeType is not a valid value.")}},Ge.getAttributeLocationCount=function(e){switch(e){case Ge.SCALAR:case Ge.VEC2:case Ge.VEC3:case Ge.VEC4:return 1;case Ge.MAT2:return 2;case Ge.MAT3:return 3;case Ge.MAT4:return 4;default:throw new C("attributeType is not a valid value.")}},Ge.getGlslType=function(e){switch(_.typeOf.string("attributeType",e),e){case Ge.SCALAR:return"float";case Ge.VEC2:return"vec2";case Ge.VEC3:return"vec3";case Ge.VEC4:return"vec4";case Ge.MAT2:return"mat2";case Ge.MAT3:return"mat3";case Ge.MAT4:return"mat4";default:throw new C("attributeType is not a valid value.")}};const cw=Object.freeze(Ge),wd=1/256,Ad=256,De={};De.octEncodeInRange=function(e,t,n){_.defined("vector",e),_.defined("result",n);const i=u.magnitudeSquared(e);if(Math.abs(i-1)>S.EPSILON6)throw new C("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){const o=n.x,a=n.y;n.x=(1-Math.abs(a))*S.signNotZero(o),n.y=(1-Math.abs(o))*S.signNotZero(a)}return n.x=S.toSNorm(n.x,t),n.y=S.toSNorm(n.y,t),n},De.octEncode=function(e,t){return De.octEncodeInRange(e,255,t)};const bs=new q,Ed=new Uint8Array(1);function ra(e){return Ed[0]=e,Ed[0]}De.octEncodeToCartesian4=function(e,t){return De.octEncodeInRange(e,65535,bs),t.x=ra(bs.x*wd),t.y=ra(bs.x),t.z=ra(bs.y*wd),t.w=ra(bs.y),t},De.octDecodeInRange=function(e,t,n,i){if(_.defined("result",i),e<0||e>n||t<0||t>n)throw new C(`x and y must be unsigned normalized integers between 0 and ${n}`);if(i.x=S.fromSNorm(e,n),i.y=S.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){const o=i.x;i.x=(1-Math.abs(i.y))*S.signNotZero(o),i.y=(1-Math.abs(o))*S.signNotZero(i.y)}return u.normalize(i,i)},De.octDecode=function(e,t,n){return De.octDecodeInRange(e,t,255,n)},De.octDecodeFromCartesian4=function(e,t){_.typeOf.object("encoded",e),_.typeOf.object("result",t);const n=e.x,i=e.y,o=e.z,a=e.w;if(n<0||n>255||i<0||i>255||o<0||o>255||a<0||a>255)throw new C("x, y, z, and w must be unsigned normalized integers between 0 and 255");const r=n*Ad+i,f=o*Ad+a;return De.octDecodeInRange(r,f,65535,t)},De.octPackFloat=function(e){return _.defined("encoded",e),256*e.x+e.y};const oh=new q;De.octEncodeFloat=function(e){return De.octEncode(e,oh),De.octPackFloat(oh)},De.octDecodeFloat=function(e,t){_.defined("value",e);const n=e/256,i=Math.floor(n),o=(n-i)*256;return De.octDecode(i,o,t)},De.octPack=function(e,t,n,i){_.defined("v1",e),_.defined("v2",t),_.defined("v3",n),_.defined("result",i);const o=De.octEncodeFloat(e),a=De.octEncodeFloat(t),r=De.octEncode(n,oh);return i.x=65536*r.x+o,i.y=65536*r.y+a,i},De.octUnpack=function(e,t,n,i){_.defined("packed",e),_.defined("v1",t),_.defined("v2",n),_.defined("v3",i);let o=e.x/65536;const a=Math.floor(o),r=(o-a)*65536;o=e.y/65536;const f=Math.floor(o),c=(o-f)*65536;De.octDecodeFloat(r,t),De.octDecodeFloat(c,n),De.octDecode(a,f,i)},De.compressTextureCoordinates=function(e){_.defined("textureCoordinates",e);const t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n},De.decompressTextureCoordinates=function(e,t){_.defined("compressed",e),_.defined("result",t);const n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function sh(e){return e>>1^-(e&1)}De.zigZagDeltaDecode=function(e,t,n){_.defined("uBuffer",e),_.defined("vBuffer",t),_.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),l(n)&&_.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);const i=e.length;let o=0,a=0,r=0;for(let f=0;f<i;++f)o+=sh(e[f]),a+=sh(t[f]),e[f]=o,t[f]=a,l(n)&&(r+=sh(n[f]),n[f]=r)},De.dequantize=function(e,t,n,i){_.defined("typedArray",e),_.defined("componentDatatype",t),_.defined("type",n),_.defined("count",i);const o=cw.getNumberOfComponents(n);let a;switch(t){case he.BYTE:a=127;break;case he.UNSIGNED_BYTE:a=255;break;case he.SHORT:a=32767;break;case he.UNSIGNED_SHORT:a=65535;break;case he.INT:a=2147483647;break;case he.UNSIGNED_INT:a=4294967295;break;default:throw new C(`Cannot dequantize component datatype: ${t}`)}const r=new Float32Array(i*o);for(let f=0;f<i;f++)for(let c=0;c<o;c++){const h=f*o+c;r[h]=Math.max(e[h]/a,-1)}return r},De.decodeRGB565=function(e,t){_.defined("typedArray",e);const n=e.length*3;l(t)&&_.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);const i=e.length;l(t)||(t=new Float32Array(i*3));const o=31,a=63,r=1/31,f=1/63;for(let c=0;c<i;c++){const h=e[c],d=h>>11,p=h>>5&a,m=h&o,T=3*c;t[T]=d*r,t[T+1]=p*f,t[T+2]=m*r}return t};const bd=new u,xd=new u,Sd=new u;function hw(e,t,n,i,o){_.defined("point",e),_.defined("p0",t),_.defined("p1",n),_.defined("p2",i),l(o)||(o=new u);let a,r,f,c,h,d,p,m;if(l(t.z)){if(u.equalsEpsilon(e,t,S.EPSILON14))return u.clone(u.UNIT_X,o);if(u.equalsEpsilon(e,n,S.EPSILON14))return u.clone(u.UNIT_Y,o);if(u.equalsEpsilon(e,i,S.EPSILON14))return u.clone(u.UNIT_Z,o);a=u.subtract(n,t,bd),r=u.subtract(i,t,xd),f=u.subtract(e,t,Sd),c=u.dot(a,a),h=u.dot(a,r),d=u.dot(a,f),p=u.dot(r,r),m=u.dot(r,f)}else{if(q.equalsEpsilon(e,t,S.EPSILON14))return u.clone(u.UNIT_X,o);if(q.equalsEpsilon(e,n,S.EPSILON14))return u.clone(u.UNIT_Y,o);if(q.equalsEpsilon(e,i,S.EPSILON14))return u.clone(u.UNIT_Z,o);a=q.subtract(n,t,bd),r=q.subtract(i,t,xd),f=q.subtract(e,t,Sd),c=q.dot(a,a),h=q.dot(a,r),d=q.dot(a,f),p=q.dot(r,r),m=q.dot(r,f)}o.y=p*d-h*m,o.z=c*m-h*d;const T=c*p-h*h;if(T!==0)return o.y/=T,o.z/=T,o.x=1-o.y-o.z,o}const rh={};rh.calculateACMR=function(e){e=g(e,g.EMPTY_OBJECT);const t=e.indices;let n=e.maximumIndex;const i=g(e.cacheSize,24);if(!l(t))throw new C("indices is required.");const o=t.length;if(o<3||o%3!==0)throw new C("indices length must be a multiple of three.");if(n<=0)throw new C("maximumIndex must be greater than zero.");if(i<3)throw new C("cacheSize must be greater than two.");if(!l(n)){n=0;let f=0,c=t[f];for(;f<o;)c>n&&(n=c),++f,c=t[f]}const a=[];for(let f=0;f<n+1;f++)a[f]=0;let r=i+1;for(let f=0;f<o;++f)r-a[t[f]]>i&&(a[t[f]]=r,++r);return(r-i+1)/(o/3)},rh.tipsify=function(e){e=g(e,g.EMPTY_OBJECT);const t=e.indices,n=e.maximumIndex,i=g(e.cacheSize,24);let o;function a(j,Y,s,x){for(;Y.length>=1;){const P=Y[Y.length-1];if(Y.splice(Y.length-1,1),j[P].numLiveTriangles>0)return P}for(;o<x;){if(j[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function r(j,Y,s,x,P,z,H){let X=-1,ee,K=-1,ce=0;for(;ce<s.length;){const le=s[ce];x[le].numLiveTriangles&&(ee=0,P-x[le].timeStamp+2*x[le].numLiveTriangles<=Y&&(ee=P-x[le].timeStamp),(ee>K||K===-1)&&(K=ee,X=le)),++ce}return X===-1?a(x,z,j,H):X}if(!l(t))throw new C("indices is required.");const f=t.length;if(f<3||f%3!==0)throw new C("indices length must be a multiple of three.");if(n<=0)throw new C("maximumIndex must be greater than zero.");if(i<3)throw new C("cacheSize must be greater than two.");let c=0,h=0,d=t[h];const p=f;if(l(n))c=n+1;else{for(;h<p;)d>c&&(c=d),++h,d=t[h];if(c===-1)return 0;++c}const m=[];let T;for(T=0;T<c;T++)m[T]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};h=0;let y=0;for(;h<p;)m[t[h]].vertexTriangles.push(y),++m[t[h]].numLiveTriangles,m[t[h+1]].vertexTriangles.push(y),++m[t[h+1]].numLiveTriangles,m[t[h+2]].vertexTriangles.push(y),++m[t[h+2]].numLiveTriangles,++y,h+=3;let w=0,A=i+1;o=1;let E=[];const b=[];let D,O,B=0;const L=[],F=f/3,N=[];for(T=0;T<F;T++)N[T]=!1;let U,M;for(;w!==-1;){E=[],O=m[w],M=O.vertexTriangles.length;for(let j=0;j<M;++j)if(y=O.vertexTriangles[j],!N[y]){N[y]=!0,h=y+y+y;for(let Y=0;Y<3;++Y)U=t[h],E.push(U),b.push(U),L[B]=U,++B,D=m[U],--D.numLiveTriangles,A-D.timeStamp>i&&(D.timeStamp=A,++A),++h}w=r(t,i,E,m,A,b,c)}return L};const $e={};function aa(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function fw(e){const t=e.length,n=t/3*6,i=bt.createTypedArray(t,n);let o=0;for(let a=0;a<t;a+=3,o+=6)aa(i,o,e[a],e[a+1],e[a+2]);return i}function lw(e){const t=e.length;if(t>=3){const n=(t-2)*6,i=bt.createTypedArray(t,n);aa(i,0,e[0],e[1],e[2]);let o=6;for(let a=3;a<t;++a,o+=6)aa(i,o,e[a-1],e[a],e[a-2]);return i}return new Uint16Array}function uw(e){if(e.length>0){const t=e.length-1,n=(t-1)*6,i=bt.createTypedArray(t,n),o=e[0];let a=0;for(let r=1;r<t;++r,a+=6)aa(i,a,o,e[r],e[r+1]);return i}return new Uint16Array}$e.toWireframe=function(e){if(!l(e))throw new C("geometry is required.");const t=e.indices;if(l(t)){switch(e.primitiveType){case Xe.TRIANGLES:e.indices=fw(t);break;case Xe.TRIANGLE_STRIP:e.indices=lw(t);break;case Xe.TRIANGLE_FAN:e.indices=uw(t);break;default:throw new C("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=Xe.LINES}return e},$e.createLineSegmentsForVectors=function(e,t,n){if(t=g(t,"normal"),!l(e))throw new C("geometry is required.");if(!l(e.attributes.position))throw new C("geometry.attributes.position is required.");if(!l(e.attributes[t]))throw new C(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${t}.`);n=g(n,1e4);const i=e.attributes.position.values,o=e.attributes[t].values,a=i.length,r=new Float64Array(2*a);let f=0;for(let d=0;d<a;d+=3)r[f++]=i[d],r[f++]=i[d+1],r[f++]=i[d+2],r[f++]=i[d]+o[d]*n,r[f++]=i[d+1]+o[d+1]*n,r[f++]=i[d+2]+o[d+2]*n;let c;const h=e.boundingSphere;return l(h)&&(c=new te(h.center,h.radius+n)),new mt({attributes:{position:new Ft({componentDatatype:he.DOUBLE,componentsPerAttribute:3,values:r})},primitiveType:Xe.LINES,boundingSphere:c})},$e.createAttributeLocations=function(e){if(!l(e))throw new C("geometry is required.");const t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={};let o=0,a;const r=t.length;for(a=0;a<r;++a){const f=t[a];l(n[f])&&(i[f]=o++)}for(const f in n)n.hasOwnProperty(f)&&!l(i[f])&&(i[f]=o++);return i},$e.reorderForPreVertexCache=function(e){if(!l(e))throw new C("geometry is required.");const t=mt.computeNumberOfVertices(e),n=e.indices;if(l(n)){const i=new Int32Array(t);for(let m=0;m<t;m++)i[m]=-1;const o=n,a=o.length,r=bt.createTypedArray(t,a);let f=0,c=0,h=0,d;for(;f<a;)d=i[o[f]],d!==-1?r[c]=d:(d=o[f],i[d]=h,r[c]=h,++h),++f,++c;e.indices=r;const p=e.attributes;for(const m in p)if(p.hasOwnProperty(m)&&l(p[m])&&l(p[m].values)){const T=p[m],y=T.values;let w=0;const A=T.componentsPerAttribute,E=he.createTypedArray(T.componentDatatype,h*A);for(;w<t;){const b=i[w];if(b!==-1)for(let D=0;D<A;D++)E[A*b+D]=y[A*w+D];++w}T.values=E}}return e},$e.reorderForPostVertexCache=function(e,t){if(!l(e))throw new C("geometry is required.");const n=e.indices;if(e.primitiveType===Xe.TRIANGLES&&l(n)){const i=n.length;let o=0;for(let a=0;a<i;a++)n[a]>o&&(o=n[a]);e.indices=rh.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Id(e){const t={};for(const n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){const i=e[n];t[n]=new Ft({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function dw(e,t,n){for(const i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){const o=t[i];for(let a=0;a<o.componentsPerAttribute;++a)e[i].values.push(o.values[n*o.componentsPerAttribute+a])}}$e.fitToUnsignedShortIndices=function(e){if(!l(e))throw new C("geometry is required.");if(l(e.indices)&&e.primitiveType!==Xe.TRIANGLES&&e.primitiveType!==Xe.LINES&&e.primitiveType!==Xe.POINTS)throw new C("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");const t=[],n=mt.computeNumberOfVertices(e);if(l(e.indices)&&n>=S.SIXTY_FOUR_KILOBYTES){let i=[],o=[],a=0,r=Id(e.attributes);const f=e.indices,c=f.length;let h;e.primitiveType===Xe.TRIANGLES?h=3:e.primitiveType===Xe.LINES?h=2:e.primitiveType===Xe.POINTS&&(h=1);for(let d=0;d<c;d+=h){for(let p=0;p<h;++p){const m=f[d+p];let T=i[m];l(T)||(T=a++,i[m]=T,dw(r,e.attributes,m)),o.push(T)}a+h>=S.SIXTY_FOUR_KILOBYTES&&(t.push(new mt({attributes:r,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],a=0,r=Id(e.attributes))}o.length!==0&&t.push(new mt({attributes:r,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const Dd=new u,pw=new oe;$e.projectTo2D=function(e,t,n,i,o){if(!l(e))throw new C("geometry is required.");if(!l(t))throw new C("attributeName is required.");if(!l(n))throw new C("attributeName3D is required.");if(!l(i))throw new C("attributeName2D is required.");if(!l(e.attributes[t]))throw new C(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==he.DOUBLE)throw new C("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");const a=e.attributes[t];o=l(o)?o:new Wn;const r=o.ellipsoid,f=a.values,c=new Float64Array(f.length);let h=0;for(let d=0;d<f.length;d+=3){const p=u.fromArray(f,d,Dd),m=r.cartesianToCartographic(p,pw);if(!l(m))throw new C(`Could not project point (${p.x}, ${p.y}, ${p.z}) to 2D.`);const T=o.project(m,Dd);c[h++]=T.x,c[h++]=T.y,c[h++]=T.z}return e.attributes[n]=a,e.attributes[i]=new Ft({componentDatatype:he.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};const ah={high:0,low:0};$e.encodeAttribute=function(e,t,n,i){if(!l(e))throw new C("geometry is required.");if(!l(t))throw new C("attributeName is required.");if(!l(n))throw new C("attributeHighName is required.");if(!l(i))throw new C("attributeLowName is required.");if(!l(e.attributes[t]))throw new C(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==he.DOUBLE)throw new C("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");const o=e.attributes[t],a=o.values,r=a.length,f=new Float32Array(r),c=new Float32Array(r);for(let d=0;d<r;++d)Qe.encode(a[d],ah),f[d]=ah.high,c[d]=ah.low;const h=o.componentsPerAttribute;return e.attributes[n]=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:h,values:f}),e.attributes[i]=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};let Mn=new u;function ch(e,t){if(l(t)){const n=t.values,i=n.length;for(let o=0;o<i;o+=3)u.unpack(n,o,Mn),k.multiplyByPoint(e,Mn,Mn),u.pack(Mn,n,o)}}function hh(e,t){if(l(t)){const n=t.values,i=n.length;for(let o=0;o<i;o+=3)u.unpack(n,o,Mn),G.multiplyByVector(e,Mn,Mn),Mn=u.normalize(Mn,Mn),u.pack(Mn,n,o)}}const ca=new k,ha=new G;$e.transformToWorldCoordinates=function(e){if(!l(e))throw new C("instance is required.");const t=e.modelMatrix;if(k.equals(t,k.IDENTITY))return e;const n=e.geometry.attributes;ch(t,n.position),ch(t,n.prevPosition),ch(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(k.inverse(t,ca),k.transpose(ca,ca),k.getMatrix3(ca,ha),hh(ha,n.normal),hh(ha,n.tangent),hh(ha,n.bitangent));const i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=te.transform(i,t,i)),e.modelMatrix=k.clone(k.IDENTITY),e};function mw(e,t){const n=e.length,i={},o=e[0][t].attributes;let a;for(a in o)if(o.hasOwnProperty(a)&&l(o[a])&&l(o[a].values)){const r=o[a];let f=r.values.length,c=!0;for(let h=1;h<n;++h){const d=e[h][t].attributes[a];if(!l(d)||r.componentDatatype!==d.componentDatatype||r.componentsPerAttribute!==d.componentsPerAttribute||r.normalize!==d.normalize){c=!1;break}f+=d.values.length}c&&(i[a]=new Ft({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:he.createTypedArray(r.componentDatatype,f)}))}return i}const _w=new u;function fh(e,t){const n=e.length;let i,o,a,r;const f=e[0].modelMatrix,c=l(e[0][t].indices),h=e[0][t].primitiveType;for(o=1;o<n;++o){if(!k.equals(e[o].modelMatrix,f))throw new C("All instances must have the same modelMatrix.");if(l(e[o][t].indices)!==c)throw new C("All instance geometries must have an indices or not have one.");if(e[o][t].primitiveType!==h)throw new C("All instance geometries must have the same primitiveType.")}const d=mw(e,t);let p,m,T;for(i in d)if(d.hasOwnProperty(i))for(p=d[i].values,r=0,o=0;o<n;++o)for(m=e[o][t].attributes[i].values,T=m.length,a=0;a<T;++a)p[r++]=m[a];let y;if(c){let b=0;for(o=0;o<n;++o)b+=e[o][t].indices.length;const D=mt.computeNumberOfVertices(new mt({attributes:d,primitiveType:Xe.POINTS})),O=bt.createTypedArray(D,b);let B=0,L=0;for(o=0;o<n;++o){const F=e[o][t].indices,N=F.length;for(r=0;r<N;++r)O[B++]=L+F[r];L+=mt.computeNumberOfVertices(e[o][t])}y=O}let w=new u,A=0,E;for(o=0;o<n;++o){if(E=e[o][t].boundingSphere,!l(E)){w=void 0;break}u.add(E.center,w,w)}if(l(w))for(u.divideByScalar(w,n,w),o=0;o<n;++o){E=e[o][t].boundingSphere;const b=u.magnitude(u.subtract(E.center,w,_w))+E.radius;b>A&&(A=b)}return new mt({attributes:d,indices:y,primitiveType:h,boundingSphere:l(w)?new te(w,A):void 0})}$e.combineInstances=function(e){if(!l(e)||e.length<1)throw new C("instances is required and must have length greater than zero.");const t=[],n=[],i=e.length;for(let a=0;a<i;++a){const r=e[a];l(r.geometry)?t.push(r):l(r.westHemisphereGeometry)&&l(r.eastHemisphereGeometry)&&n.push(r)}const o=[];return t.length>0&&o.push(fh(t,"geometry")),n.length>0&&(o.push(fh(n,"westHemisphereGeometry")),o.push(fh(n,"eastHemisphereGeometry"))),o};const Sn=new u,xs=new u,Vo=new u,Go=new u;$e.computeNormal=function(e){if(!l(e))throw new C("geometry is required.");if(!l(e.attributes.position)||!l(e.attributes.position.values))throw new C("geometry.attributes.position.values is required.");if(!l(e.indices))throw new C("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!==0)throw new C("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==Xe.TRIANGLES)throw new C("geometry.primitiveType must be PrimitiveType.TRIANGLES.");const t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,a=t.length,r=new Array(o),f=new Array(a/3),c=new Array(a);let h;for(h=0;h<o;h++)r[h]={indexOffset:0,count:0,currentCount:0};let d=0;for(h=0;h<a;h+=3){const y=t[h],w=t[h+1],A=t[h+2],E=y*3,b=w*3,D=A*3;xs.x=i[E],xs.y=i[E+1],xs.z=i[E+2],Vo.x=i[b],Vo.y=i[b+1],Vo.z=i[b+2],Go.x=i[D],Go.y=i[D+1],Go.z=i[D+2],r[y].count++,r[w].count++,r[A].count++,u.subtract(Vo,xs,Vo),u.subtract(Go,xs,Go),f[d]=u.cross(Vo,Go,new u),d++}let p=0;for(h=0;h<o;h++)r[h].indexOffset+=p,p+=r[h].count;d=0;let m;for(h=0;h<a;h+=3){m=r[t[h]];let y=m.indexOffset+m.currentCount;c[y]=d,m.currentCount++,m=r[t[h+1]],y=m.indexOffset+m.currentCount,c[y]=d,m.currentCount++,m=r[t[h+2]],y=m.indexOffset+m.currentCount,c[y]=d,m.currentCount++,d++}const T=new Float32Array(o*3);for(h=0;h<o;h++){const y=h*3;if(m=r[h],u.clone(u.ZERO,Sn),m.count>0){for(d=0;d<m.count;d++)u.add(Sn,f[c[m.indexOffset+d]],Sn);u.equalsEpsilon(u.ZERO,Sn,S.EPSILON10)&&u.clone(f[c[m.indexOffset]],Sn)}u.equalsEpsilon(u.ZERO,Sn,S.EPSILON10)&&(Sn.z=1),u.normalize(Sn,Sn),T[y]=Sn.x,T[y+1]=Sn.y,T[y+2]=Sn.z}return e.attributes.normal=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:3,values:T}),e};const gw=new u,Od=new u,Tw=new u;$e.computeTangentAndBitangent=function(e){if(!l(e))throw new C("geometry is required.");const t=e.attributes,n=e.indices;if(!l(t.position)||!l(t.position.values))throw new C("geometry.attributes.position.values is required.");if(!l(t.normal)||!l(t.normal.values))throw new C("geometry.attributes.normal.values is required.");if(!l(t.st)||!l(t.st.values))throw new C("geometry.attributes.st.values is required.");if(!l(n))throw new C("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new C("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==Xe.TRIANGLES)throw new C("geometry.primitiveType must be PrimitiveType.TRIANGLES.");const i=e.attributes.position.values,o=e.attributes.normal.values,a=e.attributes.st.values,r=e.attributes.position.values.length/3,f=n.length,c=new Array(r*3);let h;for(h=0;h<c.length;h++)c[h]=0;let d,p,m;for(h=0;h<f;h+=3){const w=n[h],A=n[h+1],E=n[h+2];d=w*3,p=A*3,m=E*3;const b=w*2,D=A*2,O=E*2,B=i[d],L=i[d+1],F=i[d+2],N=a[b],U=a[b+1],M=a[D+1]-U,j=a[O+1]-U,Y=1/((a[D]-N)*j-(a[O]-N)*M),s=(j*(i[p]-B)-M*(i[m]-B))*Y,x=(j*(i[p+1]-L)-M*(i[m+1]-L))*Y,P=(j*(i[p+2]-F)-M*(i[m+2]-F))*Y;c[d]+=s,c[d+1]+=x,c[d+2]+=P,c[p]+=s,c[p+1]+=x,c[p+2]+=P,c[m]+=s,c[m+1]+=x,c[m+2]+=P}const T=new Float32Array(r*3),y=new Float32Array(r*3);for(h=0;h<r;h++){d=h*3,p=d+1,m=d+2;const w=u.fromArray(o,d,gw),A=u.fromArray(c,d,Tw),E=u.dot(w,A);u.multiplyByScalar(w,E,Od),u.normalize(u.subtract(A,Od,A),A),T[d]=A.x,T[p]=A.y,T[m]=A.z,u.normalize(u.cross(w,A,A),A),y[d]=A.x,y[p]=A.y,y[m]=A.z}return e.attributes.tangent=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:3,values:T}),e.attributes.bitangent=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:3,values:y}),e};const Ss=new q,Un=new u,vd=new u,Wd=new u;let fa=new q;$e.compressVertices=function(e){if(!l(e))throw new C("geometry is required.");const t=e.attributes.extrudeDirection;let n,i;if(l(t)){const L=t.values;i=L.length/3;const F=new Float32Array(i*2);let N=0;for(n=0;n<i;++n){if(u.fromArray(L,n*3,Un),u.equals(Un,u.ZERO)){N+=2;continue}fa=De.octEncodeInRange(Un,65535,fa),F[N++]=fa.x,F[N++]=fa.y}return e.attributes.compressedAttributes=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:2,values:F}),delete e.attributes.extrudeDirection,e}const o=e.attributes.normal,a=e.attributes.st,r=l(o),f=l(a);if(!r&&!f)return e;const c=e.attributes.tangent,h=e.attributes.bitangent,d=l(c),p=l(h);let m,T,y,w;r&&(m=o.values),f&&(T=a.values),d&&(y=c.values),p&&(w=h.values),i=(r?m.length:T.length)/(r?3:2);let b=i,D=f&&r?2:1;D+=d||p?1:0,b*=D;const O=new Float32Array(b);let B=0;for(n=0;n<i;++n){f&&(q.fromArray(T,n*2,Ss),O[B++]=De.compressTextureCoordinates(Ss));const L=n*3;r&&l(y)&&l(w)?(u.fromArray(m,L,Un),u.fromArray(y,L,vd),u.fromArray(w,L,Wd),De.octPack(Un,vd,Wd,Ss),O[B++]=Ss.x,O[B++]=Ss.y):(r&&(u.fromArray(m,L,Un),O[B++]=De.octEncodeFloat(Un)),d&&(u.fromArray(y,L,Un),O[B++]=De.octEncodeFloat(Un)),p&&(u.fromArray(w,L,Un),O[B++]=De.octEncodeFloat(Un)))}return e.attributes.compressedAttributes=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:D,values:O}),r&&delete e.attributes.normal,f&&delete e.attributes.st,p&&delete e.attributes.bitangent,d&&delete e.attributes.tangent,e};function yw(e){if(l(e.indices))return e;const t=mt.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");if(t%3!==0)throw new C("The number of vertices must be a multiple of three.");const n=bt.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function Cw(e){const t=mt.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");const n=bt.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=Xe.TRIANGLES,e}function ww(e){const t=mt.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least 3.");const n=bt.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=Xe.TRIANGLES,e}function Aw(e){if(l(e.indices))return e;const t=mt.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");if(t%2!==0)throw new C("The number of vertices must be a multiple of 2.");const n=bt.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function Ew(e){const t=mt.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");const n=bt.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=Xe.LINES,e}function bw(e){const t=mt.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");const n=bt.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Xe.LINES,e}function xw(e){switch(e.primitiveType){case Xe.TRIANGLE_FAN:return Cw(e);case Xe.TRIANGLE_STRIP:return ww(e);case Xe.TRIANGLES:return yw(e);case Xe.LINE_STRIP:return Ew(e);case Xe.LINE_LOOP:return bw(e);case Xe.LINES:return Aw(e)}return e}function qi(e,t){Math.abs(e.y)<S.EPSILON6&&(t?e.y=-S.EPSILON6:e.y=S.EPSILON6)}function Sw(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){qi(e,e.y<0),qi(t,t.y<0),qi(n,n.y<0);return}const i=Math.abs(e.y),o=Math.abs(t.y),a=Math.abs(n.y);let r;i>o?i>a?r=S.sign(e.y):r=S.sign(n.y):o>a?r=S.sign(t.y):r=S.sign(n.y);const f=r<0;qi(e,f),qi(t,f),qi(n,f)}const Pd=new u;function In(e,t,n,i){u.add(e,u.multiplyByScalar(u.subtract(t,e,Pd),e.y/(e.y-t.y),Pd),n),u.clone(n,i),qi(n,!0),qi(i,!1)}const co=new u,ho=new u,fo=new u,lo=new u,lh={positions:new Array(7),indices:new Array(3*3)};function Iw(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;Sw(e,t,n);const i=e.y<0,o=t.y<0,a=n.y<0;let r=0;r+=i?1:0,r+=o?1:0,r+=a?1:0;const f=lh.indices;r===1?(f[1]=3,f[2]=4,f[5]=6,f[7]=6,f[8]=5,i?(In(e,t,co,fo),In(e,n,ho,lo),f[0]=0,f[3]=1,f[4]=2,f[6]=1):o?(In(t,n,co,fo),In(t,e,ho,lo),f[0]=1,f[3]=2,f[4]=0,f[6]=2):a&&(In(n,e,co,fo),In(n,t,ho,lo),f[0]=2,f[3]=0,f[4]=1,f[6]=0)):r===2&&(f[2]=4,f[4]=4,f[5]=3,f[7]=5,f[8]=6,i?o?a||(In(n,e,co,fo),In(n,t,ho,lo),f[0]=0,f[1]=1,f[3]=0,f[6]=2):(In(t,n,co,fo),In(t,e,ho,lo),f[0]=2,f[1]=0,f[3]=2,f[6]=1):(In(e,t,co,fo),In(e,n,ho,lo),f[0]=1,f[1]=2,f[3]=1,f[6]=0));const c=lh.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(r===1||r===2)&&(c[3]=co,c[4]=ho,c[5]=fo,c[6]=lo,c.length=7),lh}function Bd(e,t){const n=e.attributes;if(n.position.values.length===0)return;for(const o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){const a=n[o];a.values=he.createTypedArray(a.componentDatatype,a.values)}const i=mt.computeNumberOfVertices(e);return e.indices=bt.createTypedArray(i,e.indices),t&&(e.boundingSphere=te.fromVertices(n.position.values)),e}function qo(e){const t=e.attributes,n={};for(const i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){const o=t[i];n[i]=new Ft({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new mt({attributes:n,indices:[],primitiveType:e.primitiveType})}function uh(e,t,n){const i=l(e.geometry.boundingSphere);t=Bd(t,i),n=Bd(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function dh(e,t){const n=new e,i=new e,o=new e;return function(a,r,f,c,h,d,p,m){const T=e.fromArray(h,a*t,n),y=e.fromArray(h,r*t,i),w=e.fromArray(h,f*t,o);e.multiplyByScalar(T,c.x,T),e.multiplyByScalar(y,c.y,y),e.multiplyByScalar(w,c.z,w);const A=e.add(T,y,T);e.add(A,w,A),m&&e.normalize(A,A),e.pack(A,d,p*t)}}const Dw=dh(Z,4),la=dh(u,3),Rd=dh(q,2),Ow=function(e,t,n,i,o,a,r){const f=o[e]*i.x,c=o[t]*i.y,h=o[n]*i.z;a[r]=f+c+h>S.EPSILON6?1:0},Is=new u,ph=new u,mh=new u,vw=new u;function ua(e,t,n,i,o,a,r,f,c,h,d,p,m,T,y,w){if(!l(a)&&!l(r)&&!l(f)&&!l(c)&&!l(h)&&T===0)return;const A=u.fromArray(o,e*3,Is),E=u.fromArray(o,t*3,ph),b=u.fromArray(o,n*3,mh),D=hw(i,A,E,b,vw);if(l(D)){if(l(a)&&la(e,t,n,D,a,p.normal.values,w,!0),l(h)){const O=u.fromArray(h,e*3,Is),B=u.fromArray(h,t*3,ph),L=u.fromArray(h,n*3,mh);u.multiplyByScalar(O,D.x,O),u.multiplyByScalar(B,D.y,B),u.multiplyByScalar(L,D.z,L);let F;!u.equals(O,u.ZERO)||!u.equals(B,u.ZERO)||!u.equals(L,u.ZERO)?(F=u.add(O,B,O),u.add(F,L,F),u.normalize(F,F)):(F=Is,F.x=0,F.y=0,F.z=0),u.pack(F,p.extrudeDirection.values,w*3)}if(l(d)&&Ow(e,t,n,D,d,p.applyOffset.values,w),l(r)&&la(e,t,n,D,r,p.tangent.values,w,!0),l(f)&&la(e,t,n,D,f,p.bitangent.values,w,!0),l(c)&&Rd(e,t,n,D,c,p.st.values,w),T>0)for(let O=0;O<T;O++){const B=m[O];Ww(e,t,n,D,w,y[B],p[B])}}}function Ww(e,t,n,i,o,a,r){const f=a.componentsPerAttribute,c=a.values,h=r.values;switch(f){case 4:Dw(e,t,n,i,c,h,o,!1);break;case 3:la(e,t,n,i,c,h,o,!1);break;case 2:Rd(e,t,n,i,c,h,o,!1);break;default:h[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function si(e,t,n,i,o,a){const r=e.position.values.length/3;if(o!==-1){const f=i[o],c=n[f];return c===-1?(n[f]=r,e.position.values.push(a.x,a.y,a.z),t.push(r),r):(t.push(c),c)}return e.position.values.push(a.x,a.y,a.z),t.push(r),r}const Pw={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function zd(e){const t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,a=l(n.bitangent)?n.bitangent.values:void 0,r=l(n.tangent)?n.tangent.values:void 0,f=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,h=l(n.applyOffset)?n.applyOffset.values:void 0,d=t.indices,p=[];for(const F in n)n.hasOwnProperty(F)&&!Pw[F]&&l(n[F])&&p.push(F);const m=p.length,T=qo(t),y=qo(t);let w,A,E,b,D;const O=[];O.length=i.length/3;const B=[];for(B.length=i.length/3,D=0;D<O.length;++D)O[D]=-1,B[D]=-1;const L=d.length;for(D=0;D<L;D+=3){const F=d[D],N=d[D+1],U=d[D+2];let M=u.fromArray(i,F*3),j=u.fromArray(i,N*3),Y=u.fromArray(i,U*3);const s=Iw(M,j,Y);if(l(s)&&s.positions.length>3){const x=s.positions,P=s.indices,z=P.length;for(let H=0;H<z;++H){const X=P[H],ee=x[X];ee.y<0?(w=y.attributes,A=y.indices,E=O):(w=T.attributes,A=T.indices,E=B),b=si(w,A,E,d,X<3?D+X:-1,ee),ua(F,N,U,ee,i,o,r,a,f,c,h,w,p,m,n,b)}}else l(s)&&(M=s.positions[0],j=s.positions[1],Y=s.positions[2]),M.y<0?(w=y.attributes,A=y.indices,E=O):(w=T.attributes,A=T.indices,E=B),b=si(w,A,E,d,D,M),ua(F,N,U,M,i,o,r,a,f,c,h,w,p,m,n,b),b=si(w,A,E,d,D+1,j),ua(F,N,U,j,i,o,r,a,f,c,h,w,p,m,n,b),b=si(w,A,E,d,D+2,Y),ua(F,N,U,Y,i,o,r,a,f,c,h,w,p,m,n,b)}uh(e,y,T)}const Ld=Me.fromPointNormal(u.ZERO,u.UNIT_Y),Bw=new u,Rw=new u;function Ho(e,t,n,i,o,a,r){if(!l(r))return;const f=u.fromArray(i,e*3,Is);u.equalsEpsilon(f,n,S.EPSILON10)?a.applyOffset.values[o]=r[e]:a.applyOffset.values[o]=r[t]}function Nd(e){const t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,a=t.indices,r=qo(t),f=qo(t);let c;const h=a.length,d=[];d.length=i.length/3;const p=[];for(p.length=i.length/3,c=0;c<d.length;++c)d[c]=-1,p[c]=-1;for(c=0;c<h;c+=2){const m=a[c],T=a[c+1],y=u.fromArray(i,m*3,Is),w=u.fromArray(i,T*3,ph);let A;Math.abs(y.y)<S.EPSILON6&&(y.y<0?y.y=-S.EPSILON6:y.y=S.EPSILON6),Math.abs(w.y)<S.EPSILON6&&(w.y<0?w.y=-S.EPSILON6:w.y=S.EPSILON6);let E=r.attributes,b=r.indices,D=p,O=f.attributes,B=f.indices,L=d;const F=Ue.lineSegmentPlane(y,w,Ld,mh);if(l(F)){const N=u.multiplyByScalar(u.UNIT_Y,5*S.EPSILON9,Bw);y.y<0&&(u.negate(N,N),E=f.attributes,b=f.indices,D=d,O=r.attributes,B=r.indices,L=p);const U=u.add(F,N,Rw);A=si(E,b,D,a,c,y),Ho(m,T,y,i,A,E,o),A=si(E,b,D,a,-1,U),Ho(m,T,U,i,A,E,o),u.negate(N,N),u.add(F,N,U),A=si(O,B,L,a,-1,U),Ho(m,T,U,i,A,O,o),A=si(O,B,L,a,c+1,w),Ho(m,T,w,i,A,O,o)}else{let N,U,M;y.y<0?(N=f.attributes,U=f.indices,M=d):(N=r.attributes,U=r.indices,M=p),A=si(N,U,M,a,c,y),Ho(m,T,y,i,A,N,o),A=si(N,U,M,a,c+1,w),Ho(m,T,w,i,A,N,o)}}uh(e,f,r)}const Fd=new q,zw=new q,Md=new u,Ud=new u,_h=new u,Lw=new u,Nw=new u,Fw=new u,kd=new Z;function Vd(e){const t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,a=n.length;for(let r=0;r<a;r+=3){const f=u.unpack(n,r,Md);if(f.x>0)continue;const c=u.unpack(i,r,Ud);(f.y<0&&c.y>0||f.y>0&&c.y<0)&&(r-3>0?(i[r]=n[r-3],i[r+1]=n[r-2],i[r+2]=n[r-1]):u.pack(f,i,r));const h=u.unpack(o,r,_h);(f.y<0&&h.y>0||f.y>0&&h.y<0)&&(r+3<a?(o[r]=n[r+3],o[r+1]=n[r+4],o[r+2]=n[r+5]):u.pack(f,o,r))}}const Mw=5*S.EPSILON9,da=S.EPSILON6;function Uw(e){const t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,a=n.nextPosition.values,r=n.expandAndWidth.values,f=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,h=qo(t),d=qo(t);let p,m,T,y=!1;const w=i.length/3;for(p=0;p<w;p+=4){const A=p,E=p+2,b=u.fromArray(i,A*3,Md),D=u.fromArray(i,E*3,Ud);if(Math.abs(b.y)<da)for(b.y=da*(D.y<0?-1:1),i[p*3+1]=b.y,i[(p+1)*3+1]=b.y,m=A*3;m<A*3+4*3;m+=3)o[m]=i[p*3],o[m+1]=i[p*3+1],o[m+2]=i[p*3+2];if(Math.abs(D.y)<da)for(D.y=da*(b.y<0?-1:1),i[(p+2)*3+1]=D.y,i[(p+3)*3+1]=D.y,m=A*3;m<A*3+4*3;m+=3)a[m]=i[(p+2)*3],a[m+1]=i[(p+2)*3+1],a[m+2]=i[(p+2)*3+2];let O=h.attributes,B=h.indices,L=d.attributes,F=d.indices;const N=Ue.lineSegmentPlane(b,D,Ld,Lw);if(l(N)){y=!0;const U=u.multiplyByScalar(u.UNIT_Y,Mw,Nw);b.y<0&&(u.negate(U,U),O=d.attributes,B=d.indices,L=h.attributes,F=h.indices);const M=u.add(N,U,Fw);O.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),O.position.values.push(M.x,M.y,M.z),O.position.values.push(M.x,M.y,M.z),O.prevPosition.values.push(o[A*3],o[A*3+1],o[A*3+2]),O.prevPosition.values.push(o[A*3+3],o[A*3+4],o[A*3+5]),O.prevPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),O.nextPosition.values.push(M.x,M.y,M.z),O.nextPosition.values.push(M.x,M.y,M.z),O.nextPosition.values.push(M.x,M.y,M.z),O.nextPosition.values.push(M.x,M.y,M.z),u.negate(U,U),u.add(N,U,M),L.position.values.push(M.x,M.y,M.z),L.position.values.push(M.x,M.y,M.z),L.position.values.push(D.x,D.y,D.z,D.x,D.y,D.z),L.prevPosition.values.push(M.x,M.y,M.z),L.prevPosition.values.push(M.x,M.y,M.z),L.prevPosition.values.push(M.x,M.y,M.z),L.prevPosition.values.push(M.x,M.y,M.z),L.nextPosition.values.push(D.x,D.y,D.z,D.x,D.y,D.z),L.nextPosition.values.push(a[E*3],a[E*3+1],a[E*3+2]),L.nextPosition.values.push(a[E*3+3],a[E*3+4],a[E*3+5]);const j=q.fromArray(r,A*2,Fd),Y=Math.abs(j.y);O.expandAndWidth.values.push(-1,Y,1,Y),O.expandAndWidth.values.push(-1,-Y,1,-Y),L.expandAndWidth.values.push(-1,Y,1,Y),L.expandAndWidth.values.push(-1,-Y,1,-Y);let s=u.magnitudeSquared(u.subtract(N,b,_h));if(s/=u.magnitudeSquared(u.subtract(D,b,_h)),l(c)){const x=Z.fromArray(c,A*4,kd),P=Z.fromArray(c,E*4,kd),z=S.lerp(x.x,P.x,s),H=S.lerp(x.y,P.y,s),X=S.lerp(x.z,P.z,s),ee=S.lerp(x.w,P.w,s);for(m=A*4;m<A*4+2*4;++m)O.color.values.push(c[m]);for(O.color.values.push(z,H,X,ee),O.color.values.push(z,H,X,ee),L.color.values.push(z,H,X,ee),L.color.values.push(z,H,X,ee),m=E*4;m<E*4+2*4;++m)L.color.values.push(c[m])}if(l(f)){const x=q.fromArray(f,A*2,Fd),P=q.fromArray(f,(p+3)*2,zw),z=S.lerp(x.x,P.x,s);for(m=A*2;m<A*2+2*2;++m)O.st.values.push(f[m]);for(O.st.values.push(z,x.y),O.st.values.push(z,P.y),L.st.values.push(z,x.y),L.st.values.push(z,P.y),m=E*2;m<E*2+2*2;++m)L.st.values.push(f[m])}T=O.position.values.length/3-4,B.push(T,T+2,T+1),B.push(T+1,T+2,T+3),T=L.position.values.length/3-4,F.push(T,T+2,T+1),F.push(T+1,T+2,T+3)}else{let U,M;for(b.y<0?(U=d.attributes,M=d.indices):(U=h.attributes,M=h.indices),U.position.values.push(b.x,b.y,b.z),U.position.values.push(b.x,b.y,b.z),U.position.values.push(D.x,D.y,D.z),U.position.values.push(D.x,D.y,D.z),m=p*3;m<p*3+4*3;++m)U.prevPosition.values.push(o[m]),U.nextPosition.values.push(a[m]);for(m=p*2;m<p*2+4*2;++m)U.expandAndWidth.values.push(r[m]),l(f)&&U.st.values.push(f[m]);if(l(c))for(m=p*4;m<p*4+4*4;++m)U.color.values.push(c[m]);T=U.position.values.length/3-4,M.push(T,T+2,T+1),M.push(T+1,T+2,T+3)}}y&&(Vd(d),Vd(h)),uh(e,d,h)}$e.splitLongitude=function(e){if(!l(e))throw new C("instance is required.");const t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||te.intersectPlane(n,Me.ORIGIN_ZX_PLANE)!==xt.INTERSECTING))return e;if(t.geometryType!==ds.NONE)switch(t.geometryType){case ds.POLYLINES:Uw(e);break;case ds.TRIANGLES:zd(e);break;case ds.LINES:Nd(e);break}else xw(t),t.primitiveType===Xe.TRIANGLES?zd(e):t.primitiveType===Xe.LINES&&Nd(e);return e};function on(e){this._ellipsoid=g(e,pe.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(on.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),on.mercatorAngleToGeodeticLatitude=function(e){return S.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},on.geodeticLatitudeToMercatorAngle=function(e){e>on.MaximumLatitude?e=on.MaximumLatitude:e<-on.MaximumLatitude&&(e=-on.MaximumLatitude);const t=Math.sin(e);return .5*Math.log((1+t)/(1-t))},on.MaximumLatitude=on.mercatorAngleToGeodeticLatitude(Math.PI),on.prototype.project=function(e,t){const n=this._semimajorAxis,i=e.longitude*n,o=on.geodeticLatitudeToMercatorAngle(e.latitude)*n,a=e.height;return l(t)?(t.x=i,t.y=o,t.z=a,t):new u(i,o,a)},on.prototype.unproject=function(e,t){if(!l(e))throw new C("cartesian is required");const n=this._oneOverSemimajorAxis,i=e.x*n,o=on.mercatorAngleToGeodeticLatitude(e.y*n),a=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=a,t):new oe(i,o,a)};function kw(e,t,n){let i=!n;const o=e.length;let a;if(!i&&o>1){const r=e[0].modelMatrix;for(a=1;a<o;++a)if(!k.equals(r,e[a].modelMatrix)){i=!0;break}}if(i)for(a=0;a<o;++a)l(e[a].geometry)&&$e.transformToWorldCoordinates(e[a]);else k.multiplyTransformation(t,e[0].modelMatrix,t)}function gh(e,t){const n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});const a=n.batchId.values;for(let r=0;r<o;++r)a[r]=t}function Vw(e){const t=e.length;for(let n=0;n<t;++n){const i=e[n];l(i.geometry)?gh(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(gh(i.westHemisphereGeometry,n),gh(i.eastHemisphereGeometry,n))}}function Gw(e){const t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,a=e.vertexCacheOptimize,r=e.compressVertices,f=e.modelMatrix;let c,h,d,p=t.length;for(c=0;c<p;++c)if(l(t[c].geometry)){d=t[c].geometry.primitiveType;break}for(c=1;c<p;++c)if(l(t[c].geometry)&&t[c].geometry.primitiveType!==d)throw new C("All instance geometries must have the same primitiveType.");if(kw(t,f,o),!o)for(c=0;c<p;++c)l(t[c].geometry)&&$e.splitLongitude(t[c]);if(Vw(t),a)for(c=0;c<p;++c){const T=t[c];l(T.geometry)?($e.reorderForPostVertexCache(T.geometry),$e.reorderForPreVertexCache(T.geometry)):l(T.westHemisphereGeometry)&&l(T.eastHemisphereGeometry)&&($e.reorderForPostVertexCache(T.westHemisphereGeometry),$e.reorderForPreVertexCache(T.westHemisphereGeometry),$e.reorderForPostVertexCache(T.eastHemisphereGeometry),$e.reorderForPreVertexCache(T.eastHemisphereGeometry))}let m=$e.combineInstances(t);for(p=m.length,c=0;c<p;++c){h=m[c];const T=h.attributes;if(o)for(const y in T)T.hasOwnProperty(y)&&T[y].componentDatatype===he.DOUBLE&&$e.encodeAttribute(h,y,`${y}3DHigh`,`${y}3DLow`);else for(const y in T)if(T.hasOwnProperty(y)&&T[y].componentDatatype===he.DOUBLE){const w=`${y}3D`,A=`${y}2D`;$e.projectTo2D(h,y,w,A,n),l(h.boundingSphere)&&y==="position"&&(h.boundingSphereCV=te.fromVertices(h.attributes.position2D.values)),$e.encodeAttribute(h,w,`${w}High`,`${w}Low`),$e.encodeAttribute(h,A,`${A}High`,`${A}Low`)}r&&$e.compressVertices(h)}if(!i){let T=[];for(p=m.length,c=0;c<p;++c)h=m[c],T=T.concat($e.fitToUnsignedShortIndices(h));m=T}return m}function Th(e,t,n,i){let o,a,r;const f=i.length-1;if(f>=0){const h=i[f];o=h.offset+h.count,r=h.index,a=n[r].indices.length}else o=0,r=0,a=n[r].indices.length;const c=e.length;for(let h=0;h<c;++h){const p=e[h][t];if(!l(p))continue;const m=p.indices.length;o+m>a&&(o=0,a=n[++r].indices.length),i.push({index:r,offset:o,count:m}),o+=m}}function qw(e,t){const n=[];return Th(e,"geometry",t,n),Th(e,"westHemisphereGeometry",t,n),Th(e,"eastHemisphereGeometry",t,n),n}const kn={};kn.combineGeometry=function(e){let t,n;const i=e.instances,o=i.length;let a,r,f=!1;o>0&&(t=Gw(e),t.length>0&&(n=$e.createAttributeLocations(t[0]),e.createPickOffsets&&(a=qw(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(r=new Array(o),f=!0));const c=new Array(o),h=new Array(o);for(let d=0;d<o;++d){const p=i[d],m=p.geometry;l(m)&&(c[d]=m.boundingSphere,h[d]=m.boundingSphereCV,f&&(r[d]=p.geometry.offsetAttribute));const T=p.eastHemisphereGeometry,y=p.westHemisphereGeometry;l(T)&&l(y)&&(l(T.boundingSphere)&&l(y.boundingSphere)&&(c[d]=te.union(T.boundingSphere,y.boundingSphere)),l(T.boundingSphereCV)&&l(y.boundingSphereCV)&&(h[d]=te.union(T.boundingSphereCV,y.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:a,offsetInstanceExtend:r,boundingSpheres:c,boundingSpheresCV:h}};function Hw(e,t){const n=e.attributes;for(const i in n)if(n.hasOwnProperty(i)){const o=n[i];l(o)&&l(o.values)&&t.push(o.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function jw(e,t){const n=e.length;for(let i=0;i<n;++i)Hw(e[i],t)}function Yw(e){let t=1;const n=e.length;for(let i=0;i<n;i++){const o=e[i];if(++t,!l(o))continue;const a=o.attributes;t+=7+2*te.packedLength+(l(o.indices)?o.indices.length:0);for(const r in a)if(a.hasOwnProperty(r)&&l(a[r])){const f=a[r];t+=5+f.values.length}}return t}kn.packCreateGeometryResults=function(e,t){const n=new Float64Array(Yw(e)),i=[],o={},a=e.length;let r=0;n[r++]=a;for(let f=0;f<a;f++){const c=e[f],h=l(c);if(n[r++]=h?1:0,!h)continue;n[r++]=c.primitiveType,n[r++]=c.geometryType,n[r++]=g(c.offsetAttribute,-1);const d=l(c.boundingSphere)?1:0;n[r++]=d,d&&te.pack(c.boundingSphere,n,r),r+=te.packedLength;const p=l(c.boundingSphereCV)?1:0;n[r++]=p,p&&te.pack(c.boundingSphereCV,n,r),r+=te.packedLength;const m=c.attributes,T=[];for(const w in m)m.hasOwnProperty(w)&&l(m[w])&&(T.push(w),l(o[w])||(o[w]=i.length,i.push(w)));n[r++]=T.length;for(let w=0;w<T.length;w++){const A=T[w],E=m[A];n[r++]=o[A],n[r++]=E.componentDatatype,n[r++]=E.componentsPerAttribute,n[r++]=E.normalize?1:0,n[r++]=E.values.length,n.set(E.values,r),r+=E.values.length}const y=l(c.indices)?c.indices.length:0;n[r++]=y,y>0&&(n.set(c.indices,r),r+=y)}return t.push(n.buffer),{stringTable:i,packedData:n}},kn.unpackCreateGeometryResults=function(e){const t=e.stringTable,n=e.packedData;let i;const o=new Array(n[0]);let a=0,r=1;for(;r<n.length;){if(!(n[r++]===1)){o[a++]=void 0;continue}const c=n[r++],h=n[r++];let d=n[r++];d===-1&&(d=void 0);let p,m;n[r++]===1&&(p=te.unpack(n,r)),r+=te.packedLength,n[r++]===1&&(m=te.unpack(n,r)),r+=te.packedLength;let w,A,E;const b=new Fu,D=n[r++];for(i=0;i<D;i++){const B=t[n[r++]],L=n[r++];E=n[r++];const F=n[r++]!==0;w=n[r++],A=he.createTypedArray(L,w);for(let N=0;N<w;N++)A[N]=n[r++];b[B]=new Ft({componentDatatype:L,componentsPerAttribute:E,normalize:F,values:A})}let O;if(w=n[r++],w>0){const B=A.length/E;for(O=bt.createTypedArray(B,w),i=0;i<w;i++)O[i]=n[r++]}o[a++]=new mt({primitiveType:c,geometryType:h,boundingSphere:p,boundingSphereCV:m,indices:O,attributes:b,offsetAttribute:d})}return o};function Xw(e,t){const n=e.length,i=new Float64Array(1+n*19);let o=0;i[o++]=n;for(let a=0;a<n;a++){const r=e[a];if(k.pack(r.modelMatrix,i,o),o+=k.packedLength,l(r.attributes)&&l(r.attributes.offset)){const f=r.attributes.offset.value;i[o]=f[0],i[o+1]=f[1],i[o+2]=f[2]}o+=3}return t.push(i.buffer),i}function $w(e){const t=e,n=new Array(t[0]);let i=0,o=1;for(;o<t.length;){const a=k.unpack(t,o);let r;o+=k.packedLength,l(t[o])&&(r={offset:new _s(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:a,attributes:r}}return n}kn.packCombineGeometryParameters=function(e,t){const n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:Xw(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Wn,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},kn.unpackCombineGeometryParameters=function(e){const t=$w(e.packedInstances),n=e.createGeometryResults,i=n.length;let o=0;for(let f=0;f<i;f++){const c=kn.unpackCreateGeometryResults(n[f]),h=c.length;for(let d=0;d<h;d++){const p=c[d],m=t[o];m.geometry=p,++o}}const a=pe.clone(e.ellipsoid),r=e.isGeographic?new Wn(a):new on(a);return{instances:t,ellipsoid:a,projection:r,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:k.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Gd(e){const t=e.length,n=1+(te.packedLength+1)*t,i=new Float32Array(n);let o=0;i[o++]=t;for(let a=0;a<t;++a){const r=e[a];l(r)?(i[o++]=1,te.pack(e[a],i,o)):i[o++]=0,o+=te.packedLength}return i}function qd(e){const t=new Array(e[0]);let n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=te.unpack(e,i)),++n,i+=te.packedLength;return t}kn.packCombineGeometryResults=function(e,t){l(e.geometries)&&jw(e.geometries,t);const n=Gd(e.boundingSpheres),i=Gd(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}},kn.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:qd(e.boundingSpheres),boundingSpheresCV:qd(e.boundingSpheresCV)}};const Ot=Object.freeze({READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6}),gn={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};gn.NUMBER_OF_SHADOW_MODES=4,gn.castShadows=function(e){return e===gn.ENABLED||e===gn.CAST_ONLY},gn.receiveShadows=function(e){return e===gn.ENABLED||e===gn.RECEIVE_ONLY},gn.fromCastReceive=function(e,t){return e&&t?gn.ENABLED:e?gn.CAST_ONLY:t?gn.RECEIVE_ONLY:gn.DISABLED};const pa=Object.freeze(gn);function Pe(e){if(e=g(e,g.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=k.clone(g(e.modelMatrix,k.IDENTITY)),this._modelMatrix=new k,this.show=g(e.show,!0),this._vertexCacheOptimize=g(e.vertexCacheOptimize,!1),this._interleave=g(e.interleave,!1),this._releaseGeometryInstances=g(e.releaseGeometryInstances,!0),this._allowPicking=g(e.allowPicking,!0),this._asynchronous=g(e.asynchronous,!0),this._compressVertices=g(e.compressVertices,!0),this.cull=g(e.cull,!0),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,l(this.rtcCenter)&&(!l(this.geometryInstances)||Array.isArray(this.geometryInstances)&&this.geometryInstances.length!==1))throw new C("Relative-to-center rendering only supports one geometry instance.");this.shadows=g(e.shadows,pa.DISABLED),this._translucent=void 0,this._state=Ot.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(Pe.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function Zw(e){const t=e.length,n=[],i=e[0].attributes;let o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){const a=i[o];let r=!0;for(let f=1;f<t;++f){const c=e[f].attributes[o];if(!l(c)||a.componentDatatype!==c.componentDatatype||a.componentsPerAttribute!==c.componentsPerAttribute||a.normalize!==c.normalize){r=!1;break}}r&&n.push(o)}return n}const Kw=new q,Qw=new u,Hd=new Z;function jd(e){const t=e.length;if(t===1)return e[0];if(t===2)return q.unpack(e,0,Kw);if(t===3)return u.unpack(e,0,Qw);if(t===4)return Z.unpack(e,0,Hd)}function Jw(e,t){const n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;const a=Zw(i),r=a.length,f=[],c={},h={};let d,m=i[0].attributes,T,y,w;for(T=0;T<r;++T)y=a[T],w=m[y],c[y]=T,f.push({functionName:`czm_batchTable_${y}`,componentDatatype:w.componentDatatype,componentsPerAttribute:w.componentsPerAttribute,normalize:w.normalize});a.indexOf("distanceDisplayCondition")!==-1&&(f.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:he.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:he.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:he.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:he.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:he.FLOAT,componentsPerAttribute:1}),h.center3DHigh=f.length-5,h.center3DLow=f.length-4,h.center2DHigh=f.length-3,h.center2DLow=f.length-2,h.radius=f.length-1),a.indexOf("offset")!==-1&&(f.push({functionName:"czm_batchTable_offset2D",componentDatatype:he.FLOAT,componentsPerAttribute:3}),d=f.length-1),f.push({functionName:"czm_batchTable_pickColor",componentDatatype:he.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});const A=f.length,E=new Ai(t,f,o);for(T=0;T<o;++T){const b=i[T];m=b.attributes;for(let F=0;F<r;++F){y=a[F],w=m[y];const N=jd(w.value),U=c[y];E.setBatchedAttribute(T,U,N)}const D={primitive:g(b.pickPrimitive,e)};l(b.id)&&(D.id=b.id);const O=t.createPickId(D);e._pickIds.push(O);const B=O.color,L=Hd;L.x=I.floatToByte(B.red),L.y=I.floatToByte(B.green),L.z=I.floatToByte(B.blue),L.w=I.floatToByte(B.alpha),E.setBatchedAttribute(T,A-1,L)}e._batchTable=E,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=h,e._batchTableOffsetAttribute2DIndex=d}function eA(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ft({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function tA(e){const t=e.attributes,n=new Fu;for(const o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=eA(t[o]));let i;if(l(e.indices)){const o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new mt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:te.clone(e.boundingSphere)})}function nA(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:k.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}const iA=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Pe._modifyShaderPosition=function(e,t,n){let i,o="",a="",r="";for(;(i=iA.exec(t))!==null;){const f=i[1],c=`vec4 czm_compute${f[0].toUpperCase()}${f.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c};
4660
4660
  `),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView;
4661
4661
  `,a+=`in vec4 position;
4662
4662
  `,r+=`${c}
@@ -4782,7 +4782,7 @@ ${p} czm_non_compressed_main();
4782
4782
  czm_writeDepthClamp();
4783
4783
  #endif
4784
4784
  }
4785
- `,t}function Zd(e,t){const n=e.vertexAttributes;for(const i in n)if(n.hasOwnProperty(i)&&!l(t[i]))throw new C(`Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '${i}', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.`)}function rA(e,t){return function(){return e[t]}}const yh=Math.max(Ct.hardwareConcurrency-1,1);let ma;const aA=new St("combineGeometry");function cA(e,t){let n,i,o,a;const r=e._instanceIds;if(e._state===Ot.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];const f=e._numberOfInstances=n.length,c=[];let h=[];for(o=0;o<f;++o){if(i=n[o].geometry,r.push(n[o].id),l(i._workerName)&&l(i._workerPath)||!l(i._workerName)&&!l(i._workerPath))throw new C("Must define either _workerName or _workerPath for asynchronous geometry.");h.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i})}if(!l(ma))for(ma=new Array(yh),o=0;o<yh;o++)ma[o]=new St("createGeometry");let d;for(h=XC(h,yh),o=0;o<h.length;o++){let p=0;const m=h[o],T=m.length;for(a=0;a<T;++a)d=m[a],i=d.geometry,l(i.constructor.pack)&&(d.offset=p,p+=g(i.constructor.packedLength,i.packedLength));let y;if(p>0){const w=new Float64Array(p);for(y=[w.buffer],a=0;a<T;++a)d=m[a],i=d.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,w,d.offset),d.geometry=w)}c.push(ma[o].scheduleTask({subTasks:h[o]},y))}e._state=Ot.CREATING,Promise.all(c).then(function(p){e._createGeometryResults=p,e._state=Ot.CREATED}).catch(function(p){Os(e,t,Ot.FAILED,p)})}else if(e._state===Ot.CREATED){const f=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];const c=t.scene3DOnly,h=t.mapProjection,d=aA.scheduleTask(Vn.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:h.ellipsoid,projection:h,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},f),f);e._createGeometryResults=void 0,e._state=Ot.COMBINING,Promise.resolve(d).then(function(p){const m=Vn.unpackCombineGeometryResults(p);e._geometries=m.geometries,e._attributeLocations=m.attributeLocations,e.modelMatrix=k.clone(m.modelMatrix,e.modelMatrix),e._pickOffsets=m.pickOffsets,e._offsetInstanceExtend=m.offsetInstanceExtend,e._instanceBoundingSpheres=m.boundingSpheres,e._instanceBoundingSpheresCV=m.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Ot.COMBINED):Os(e,t,Ot.FAILED,void 0)}).catch(function(p){Os(e,t,Ot.FAILED,p)})}}function hA(e,t){const n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),a=e._instanceIds;let r,f,c=0;for(f=0;f<i;f++){r=n[f];const m=r.geometry;let T;l(m.attributes)&&l(m.primitiveType)?T=tA(m):T=m.constructor.createGeometry(m),o[c++]=nA(r,T),a.push(r.id)}o.length=c;const h=t.scene3DOnly,d=t.mapProjection,p=Vn.combineGeometry({instances:o,ellipsoid:d.ellipsoid,projection:d,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:h,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=k.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Ot.COMBINED):Os(e,t,Ot.FAILED,void 0)}function fA(e,t){const n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i;const o=e._offsetInstanceExtend,a=e._instanceBoundingSpheres,r=a.length;let f=e._tempBoundingSpheres;if(!l(f)){for(f=new Array(r),i=0;i<r;i++)f[i]=new te;e._tempBoundingSpheres=f}for(i=0;i<r;++i){let w=f[i];const A=e._batchTable.getBatchedAttribute(i,n,new u);w=a[i].clone(w),op(w,A,o[i])}const c=[],h=[],d=[];for(i=0;i<r;++i){const w=f[i];w.center.x-w.radius>0||te.intersectPlane(w,Me.ORIGIN_ZX_PLANE)!==xt.INTERSECTING?c.push(w):(h.push(w),d.push(w))}let p=c[0],m=d[0],T=h[0];for(i=1;i<c.length;i++)p=te.union(p,c[i]);for(i=1;i<d.length;i++)m=te.union(m,d[i]);for(i=1;i<h.length;i++)T=te.union(T,h[i]);const y=[];for(l(p)&&y.push(p),l(m)&&y.push(m),l(T)&&y.push(T),i=0;i<y.length;i++){const w=y[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=w,e._boundingSphereCV[i]=te.projectTo2D(w,t.mapProjection,e._boundingSphereCV[i])}Pe._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}const Kd=new Qe,Qd=new oe,Jd=new u,ep=new te;function lA(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;const i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,a=i.center3DLow,r=i.center2DHigh,f=i.center2DLow,c=i.radius,h=t.mapProjection,d=h.ellipsoid,p=e._batchTable,m=e._instanceBoundingSpheres,T=m.length;for(let y=0;y<T;++y){let w=m[y];if(!l(w))continue;const A=e.modelMatrix;l(A)&&(w=te.transform(w,A,ep));const E=w.center,b=w.radius;let I=Qe.fromCartesian(E,Kd);if(p.setBatchedAttribute(y,o,I.high),p.setBatchedAttribute(y,a,I.low),!t.scene3DOnly){const O=d.cartesianToCartographic(E,Qd),B=h.project(O,Jd);I=Qe.fromCartesian(B,Kd),p.setBatchedAttribute(y,r,I.high),p.setBatchedAttribute(y,f,I.low)}p.setBatchedAttribute(y,c,b)}e._batchTableBoundingSpheresUpdated=!0}const Ch=new u,uA=new u;function tp(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;const i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,a=o.ellipsoid,r=e._batchTable,f=e._instanceBoundingSpheres,c=f.length;for(let h=0;h<c;++h){let d=f[h];if(!l(d))continue;const p=r.getBatchedAttribute(h,e._batchTableAttributeIndices.offset);if(u.equals(p,u.ZERO)){r.setBatchedAttribute(h,i,u.ZERO);continue}const m=e.modelMatrix;l(m)&&(d=te.transform(d,m,ep));let T=d.center;T=a.scaleToGeodeticSurface(T,uA);let y=a.cartesianToCartographic(T,Qd);const w=o.project(y,Jd),A=u.add(p,T,Ch);y=a.cartesianToCartographic(A,y);const E=o.project(y,Ch),b=u.subtract(E,w,Ch),I=b.x;b.x=b.z,b.z=b.y,b.y=I,r.setBatchedAttribute(h,i,b)}e._batchTableOffsetsUpdated=!0}function dA(e,t){const n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,a=t.context,r=[],f=i.length;for(let c=0;c<f;++c){const h=i[c];if(r.push(ti.fromGeometry({context:a,geometry:h,attributeLocations:n,bufferUsage:We.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,h);else if(e._boundingSpheres.push(te.clone(h.boundingSphere)),e._boundingSphereWC.push(new te),!o){const d=h.boundingSphereCV.center,p=d.x,m=d.y,T=d.z;d.x=T,d.y=p,d.z=m,e._boundingSphereCV.push(te.clone(h.boundingSphereCV)),e._boundingSphere2D.push(new te),e._boundingSphereMorph.push(new te)}}e._va=r,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,Os(e,t,Ot.COMPLETE,void 0)}function pA(e,t,n,i){let o=n.getRenderState(),a;i?(a=cn(o,!1),a.cull={enabled:!0,face:Uo.BACK},e._frontFaceRS=je.fromCache(a),a.cull.face=Uo.FRONT,e._backFaceRS=je.fromCache(a)):(e._frontFaceRS=je.fromCache(o),e._backFaceRS=e._frontFaceRS),a=cn(o,!1),l(e._depthFailAppearance)&&(a.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),a=cn(o,!1),a.depthTest.func=Td.GREATER,i?(a.cull={enabled:!0,face:Uo.BACK},e._frontFaceDepthFailRS=je.fromCache(a),a.cull.face=Uo.FRONT,e._backFaceDepthFailRS=je.fromCache(a)):(e._frontFaceDepthFailRS=je.fromCache(a),e._backFaceDepthFailRS=e._frontFaceRS))}function mA(e,t,n){const i=t.context,o=e._attributeLocations;let a=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);a=Pe._appendOffsetToShader(e,a),a=Pe._appendShowToShader(e,a),a=Pe._appendDistanceDisplayConditionToShader(e,a,t.scene3DOnly),a=Yd(a),a=Pe._updateColorAttribute(e,a,!1),a=$d(e,a),a=Pe._modifyShaderPosition(e,a,t.scene3DOnly);let r=n.getFragmentShaderSource();r=Xd(r),e._sp=lt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:a,fragmentShaderSource:r,attributeLocations:o}),Zd(e._sp,o),l(e._depthFailAppearance)&&(a=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),a=Pe._appendShowToShader(e,a),a=Pe._appendDistanceDisplayConditionToShader(e,a,t.scene3DOnly),a=Yd(a),a=Pe._updateColorAttribute(e,a,!0),a=$d(e,a),a=Pe._modifyShaderPosition(e,a,t.scene3DOnly),a=oA(a),r=e._depthFailAppearance.getFragmentShaderSource(),r=Xd(r),r=sA(r),e._spDepthFail=lt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:a,fragmentShaderSource:r,attributeLocations:o}),Zd(e._spDepthFail,o))}const Ds=new k,np=new u;function ip(e,t,n,i){const o=l(n)?n._uniforms:void 0,a={},r=t.uniforms;if(l(r)){for(const c in r)if(r.hasOwnProperty(c)){if(l(o)&&l(o[c]))throw new C(`Appearance and material have a uniform with the same name: ${c}`);a[c]=rA(r,c)}}let f=hn(a,o);return f=e._batchTable.getUniformMapCallback()(f),l(e.rtcCenter)&&(f.u_modifiedModelView=function(){const c=i.context.uniformState.view;return k.multiply(c,e._modelMatrix,Ds),k.multiplyByPoint(Ds,e.rtcCenter,np),k.setTranslation(Ds,np,Ds),Ds}),f}function _A(e,t,n,i,o,a,r,f){const c=ip(e,t,n,f);let h;l(e._depthFailAppearance)&&(h=ip(e,e._depthFailAppearance,e._depthFailAppearance.material,f));const d=i?Nt.TRANSLUCENT:Nt.OPAQUE;let p=o?2:1;p*=l(e._depthFailAppearance)?2:1,a.length=e._va.length*p;const m=a.length;let T=0;for(let y=0;y<m;++y){let w;o&&(w=a[y],l(w)||(w=a[y]=new et({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[T],w.renderState=e._backFaceRS,w.shaderProgram=e._sp,w.uniformMap=c,w.pass=d,++y),w=a[y],l(w)||(w=a[y]=new et({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[T],w.renderState=e._frontFaceRS,w.shaderProgram=e._sp,w.uniformMap=c,w.pass=d,l(e._depthFailAppearance)&&(o&&(++y,w=a[y],l(w)||(w=a[y]=new et({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[T],w.renderState=e._backFaceDepthFailRS,w.shaderProgram=e._spDepthFail,w.uniformMap=h,w.pass=d),++y,w=a[y],l(w)||(w=a[y]=new et({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[T],w.renderState=e._frontFaceDepthFailRS,w.shaderProgram=e._spDepthFail,w.uniformMap=h,w.pass=d),++T}}Pe._updateBoundingVolumes=function(e,t,n,i){let o,a,r;if(i||!k.equals(n,e._modelMatrix))for(k.clone(n,e._modelMatrix),a=e._boundingSpheres.length,o=0;o<a;++o)r=e._boundingSpheres[o],l(r)&&(e._boundingSphereWC[o]=te.transform(r,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=te.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=te.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));const f=e.appearance.pixelSize;if(l(f))for(a=e._boundingSpheres.length,o=0;o<a;++o){r=e._boundingSpheres[o];const c=e._boundingSphereWC[o],d=t.camera.getPixelSize(r,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*f;c.radius=r.radius+d}};function gA(e,t,n,i,o,a,r,f){if(t.mode!==ye.SCENE3D&&!k.equals(o,k.IDENTITY))throw new C("Primitive.modelMatrix is only supported in 3D mode.");Pe._updateBoundingVolumes(e,t,o);let c;t.mode===ye.SCENE3D?c=e._boundingSphereWC:t.mode===ye.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ye.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);const h=t.commandList,d=t.passes;if(d.render||d.pick){const p=e.allowPicking,m=pa.castShadows(e.shadows),T=pa.receiveShadows(e.shadows),y=n.length;let w=f?2:1;w*=l(e._depthFailAppearance)?2:1;for(let A=0;A<y;++A){const E=Math.floor(A/w),b=n[A];b.modelMatrix=o,b.boundingVolume=c[E],b.cull=a,b.debugShowBoundingVolume=r,b.castShadows=m,b.receiveShadows=T,p?b.pickId="v_pickColor":b.pickId=void 0,h.push(b)}}}Pe.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==ye.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(l(this.rtcCenter)&&!e.scene3DOnly)throw new C("RTC rendering is only available for 3D only scenes.");if(this._state===Ot.FAILED)return;const t=e.context;if(l(this._batchTable)||Jw(this,t),this._batchTable.attributes.length>0){if(xe.maximumVertexTextureImageUnits===0)throw new dt("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Ot.COMPLETE&&this._state!==Ot.COMBINED&&(this.asynchronous?cA(this,e):hA(this,e)),this._state===Ot.COMBINED&&(lA(this,e),tp(this,e),dA(this,e)),!this.show||this._state!==Ot.COMPLETE)return;this._batchTableOffsetsUpdated||tp(this,e),this._recomputeBoundingSpheres&&fA(this,e);const n=this.appearance,i=n.material;let o=!1,a=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,a=!0):this._material!==i&&(this._material=i,a=!0);const r=this.depthFailAppearance,f=l(r)?r.material:void 0;this._depthFailAppearance!==r?(this._depthFailAppearance=r,this._depthFailMaterial=f,o=!0,a=!0):this._depthFailMaterial!==f&&(this._depthFailMaterial=f,a=!0);const c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);const h=n.closed&&c;o&&g(this._createRenderStatesFunction,pA)(this,t,n,h),a&&g(this._createShaderProgramFunction,mA)(this,e,n),(o||a)&&g(this._createCommandsFunction,_A)(this,n,i,c,h,this._colorCommands,this._pickCommands,e),g(this._updateAndQueueCommandsFunction,gA)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,h)};const TA=new te,yA=new te;function op(e,t,n){if(n===Mu.TOP){const i=te.clone(e,TA),o=te.clone(e,yA);o.center=u.add(o.center,t,o.center),e=te.union(i,o,e)}else n===Mu.ALL&&(e.center=u.add(e.center,t,e.center));return e}function CA(e,t,n){return function(){const i=e.getBatchedAttribute(t,n),o=e.attributes[n],a=o.componentsPerAttribute,r=he.createTypedArray(o.componentDatatype,a);return l(i.constructor.pack)?i.constructor.pack(i,r,0):r[0]=i,r}}function wA(e,t,n,i,o){return function(a){if(!l(a)||!l(a.length)||a.length<1||a.length>4)throw new C("value must be and array with length between 1 and 4.");const r=jd(a);e.setBatchedAttribute(t,n,r),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}const AA=new u;function EA(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();const o=e.modelMatrix,a=t.offset;l(a)&&op(i,u.fromArray(a.get(),0,AA),e._offsetInstanceExtend[n]),l(o)&&(i=te.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function bA(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Pe.prototype.getGeometryInstanceAttributes=function(e){if(!l(e))throw new C("id is required");if(!l(this._batchTable))throw new C("must call update before calling getGeometryInstanceAttributes");let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1;const i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,a=o.length;for(let h=0;h<a;++h){const d=(i+h)%a;if(e===o[d]){n=d;break}}if(n===-1)return;const r=this._batchTable,f=this._batchTableAttributeIndices;t={};const c={};for(const h in f)if(f.hasOwnProperty(h)){const d=f[h];c[h]={get:CA(r,n,d),set:wA(r,n,d,this,h)}}return EA(this,c,n),bA(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t},Pe.prototype.isDestroyed=function(){return!1},Pe.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();const n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;const i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,st(this)};function Os(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Ot.COMPLETE||e._state===Ot.FAILED})}function Gn(e){if(e=g(e,g.EMPTY_OBJECT),!l(e.componentDatatype))throw new C("options.componentDatatype is required.");if(!l(e.componentsPerAttribute))throw new C("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new C("options.componentsPerAttribute must be between 1 and 4.");if(!l(e.value))throw new C("options.value is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=g(e.normalize,!1),this.value=e.value}const sp=`#ifdef TEXTURE_COORDINATES
4785
+ `,t}function Zd(e,t){const n=e.vertexAttributes;for(const i in n)if(n.hasOwnProperty(i)&&!l(t[i]))throw new C(`Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '${i}', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.`)}function rA(e,t){return function(){return e[t]}}const yh=Math.max(Ct.hardwareConcurrency-1,1);let ma;const aA=new St("combineGeometry");function cA(e,t){let n,i,o,a;const r=e._instanceIds;if(e._state===Ot.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];const f=e._numberOfInstances=n.length,c=[];let h=[];for(o=0;o<f;++o){if(i=n[o].geometry,r.push(n[o].id),l(i._workerName)&&l(i._workerPath)||!l(i._workerName)&&!l(i._workerPath))throw new C("Must define either _workerName or _workerPath for asynchronous geometry.");h.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i})}if(!l(ma))for(ma=new Array(yh),o=0;o<yh;o++)ma[o]=new St("createGeometry");let d;for(h=XC(h,yh),o=0;o<h.length;o++){let p=0;const m=h[o],T=m.length;for(a=0;a<T;++a)d=m[a],i=d.geometry,l(i.constructor.pack)&&(d.offset=p,p+=g(i.constructor.packedLength,i.packedLength));let y;if(p>0){const w=new Float64Array(p);for(y=[w.buffer],a=0;a<T;++a)d=m[a],i=d.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,w,d.offset),d.geometry=w)}c.push(ma[o].scheduleTask({subTasks:h[o]},y))}e._state=Ot.CREATING,Promise.all(c).then(function(p){e._createGeometryResults=p,e._state=Ot.CREATED}).catch(function(p){Os(e,t,Ot.FAILED,p)})}else if(e._state===Ot.CREATED){const f=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];const c=t.scene3DOnly,h=t.mapProjection,d=aA.scheduleTask(kn.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:h.ellipsoid,projection:h,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},f),f);e._createGeometryResults=void 0,e._state=Ot.COMBINING,Promise.resolve(d).then(function(p){const m=kn.unpackCombineGeometryResults(p);e._geometries=m.geometries,e._attributeLocations=m.attributeLocations,e.modelMatrix=k.clone(m.modelMatrix,e.modelMatrix),e._pickOffsets=m.pickOffsets,e._offsetInstanceExtend=m.offsetInstanceExtend,e._instanceBoundingSpheres=m.boundingSpheres,e._instanceBoundingSpheresCV=m.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Ot.COMBINED):Os(e,t,Ot.FAILED,void 0)}).catch(function(p){Os(e,t,Ot.FAILED,p)})}}function hA(e,t){const n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),a=e._instanceIds;let r,f,c=0;for(f=0;f<i;f++){r=n[f];const m=r.geometry;let T;l(m.attributes)&&l(m.primitiveType)?T=tA(m):T=m.constructor.createGeometry(m),o[c++]=nA(r,T),a.push(r.id)}o.length=c;const h=t.scene3DOnly,d=t.mapProjection,p=kn.combineGeometry({instances:o,ellipsoid:d.ellipsoid,projection:d,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:h,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=k.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Ot.COMBINED):Os(e,t,Ot.FAILED,void 0)}function fA(e,t){const n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i;const o=e._offsetInstanceExtend,a=e._instanceBoundingSpheres,r=a.length;let f=e._tempBoundingSpheres;if(!l(f)){for(f=new Array(r),i=0;i<r;i++)f[i]=new te;e._tempBoundingSpheres=f}for(i=0;i<r;++i){let w=f[i];const A=e._batchTable.getBatchedAttribute(i,n,new u);w=a[i].clone(w),op(w,A,o[i])}const c=[],h=[],d=[];for(i=0;i<r;++i){const w=f[i];w.center.x-w.radius>0||te.intersectPlane(w,Me.ORIGIN_ZX_PLANE)!==xt.INTERSECTING?c.push(w):(h.push(w),d.push(w))}let p=c[0],m=d[0],T=h[0];for(i=1;i<c.length;i++)p=te.union(p,c[i]);for(i=1;i<d.length;i++)m=te.union(m,d[i]);for(i=1;i<h.length;i++)T=te.union(T,h[i]);const y=[];for(l(p)&&y.push(p),l(m)&&y.push(m),l(T)&&y.push(T),i=0;i<y.length;i++){const w=y[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=w,e._boundingSphereCV[i]=te.projectTo2D(w,t.mapProjection,e._boundingSphereCV[i])}Pe._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}const Kd=new Qe,Qd=new oe,Jd=new u,ep=new te;function lA(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;const i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,a=i.center3DLow,r=i.center2DHigh,f=i.center2DLow,c=i.radius,h=t.mapProjection,d=h.ellipsoid,p=e._batchTable,m=e._instanceBoundingSpheres,T=m.length;for(let y=0;y<T;++y){let w=m[y];if(!l(w))continue;const A=e.modelMatrix;l(A)&&(w=te.transform(w,A,ep));const E=w.center,b=w.radius;let D=Qe.fromCartesian(E,Kd);if(p.setBatchedAttribute(y,o,D.high),p.setBatchedAttribute(y,a,D.low),!t.scene3DOnly){const O=d.cartesianToCartographic(E,Qd),B=h.project(O,Jd);D=Qe.fromCartesian(B,Kd),p.setBatchedAttribute(y,r,D.high),p.setBatchedAttribute(y,f,D.low)}p.setBatchedAttribute(y,c,b)}e._batchTableBoundingSpheresUpdated=!0}const Ch=new u,uA=new u;function tp(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;const i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,a=o.ellipsoid,r=e._batchTable,f=e._instanceBoundingSpheres,c=f.length;for(let h=0;h<c;++h){let d=f[h];if(!l(d))continue;const p=r.getBatchedAttribute(h,e._batchTableAttributeIndices.offset);if(u.equals(p,u.ZERO)){r.setBatchedAttribute(h,i,u.ZERO);continue}const m=e.modelMatrix;l(m)&&(d=te.transform(d,m,ep));let T=d.center;T=a.scaleToGeodeticSurface(T,uA);let y=a.cartesianToCartographic(T,Qd);const w=o.project(y,Jd),A=u.add(p,T,Ch);y=a.cartesianToCartographic(A,y);const E=o.project(y,Ch),b=u.subtract(E,w,Ch),D=b.x;b.x=b.z,b.z=b.y,b.y=D,r.setBatchedAttribute(h,i,b)}e._batchTableOffsetsUpdated=!0}function dA(e,t){const n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,a=t.context,r=[],f=i.length;for(let c=0;c<f;++c){const h=i[c];if(r.push(ei.fromGeometry({context:a,geometry:h,attributeLocations:n,bufferUsage:We.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,h);else if(e._boundingSpheres.push(te.clone(h.boundingSphere)),e._boundingSphereWC.push(new te),!o){const d=h.boundingSphereCV.center,p=d.x,m=d.y,T=d.z;d.x=T,d.y=p,d.z=m,e._boundingSphereCV.push(te.clone(h.boundingSphereCV)),e._boundingSphere2D.push(new te),e._boundingSphereMorph.push(new te)}}e._va=r,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,Os(e,t,Ot.COMPLETE,void 0)}function pA(e,t,n,i){let o=n.getRenderState(),a;i?(a=cn(o,!1),a.cull={enabled:!0,face:Mo.BACK},e._frontFaceRS=je.fromCache(a),a.cull.face=Mo.FRONT,e._backFaceRS=je.fromCache(a)):(e._frontFaceRS=je.fromCache(o),e._backFaceRS=e._frontFaceRS),a=cn(o,!1),l(e._depthFailAppearance)&&(a.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),a=cn(o,!1),a.depthTest.func=Td.GREATER,i?(a.cull={enabled:!0,face:Mo.BACK},e._frontFaceDepthFailRS=je.fromCache(a),a.cull.face=Mo.FRONT,e._backFaceDepthFailRS=je.fromCache(a)):(e._frontFaceDepthFailRS=je.fromCache(a),e._backFaceDepthFailRS=e._frontFaceRS))}function mA(e,t,n){const i=t.context,o=e._attributeLocations;let a=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);a=Pe._appendOffsetToShader(e,a),a=Pe._appendShowToShader(e,a),a=Pe._appendDistanceDisplayConditionToShader(e,a,t.scene3DOnly),a=Yd(a),a=Pe._updateColorAttribute(e,a,!1),a=$d(e,a),a=Pe._modifyShaderPosition(e,a,t.scene3DOnly);let r=n.getFragmentShaderSource();r=Xd(r),e._sp=lt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:a,fragmentShaderSource:r,attributeLocations:o}),Zd(e._sp,o),l(e._depthFailAppearance)&&(a=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),a=Pe._appendShowToShader(e,a),a=Pe._appendDistanceDisplayConditionToShader(e,a,t.scene3DOnly),a=Yd(a),a=Pe._updateColorAttribute(e,a,!0),a=$d(e,a),a=Pe._modifyShaderPosition(e,a,t.scene3DOnly),a=oA(a),r=e._depthFailAppearance.getFragmentShaderSource(),r=Xd(r),r=sA(r),e._spDepthFail=lt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:a,fragmentShaderSource:r,attributeLocations:o}),Zd(e._spDepthFail,o))}const Ds=new k,np=new u;function ip(e,t,n,i){const o=l(n)?n._uniforms:void 0,a={},r=t.uniforms;if(l(r)){for(const c in r)if(r.hasOwnProperty(c)){if(l(o)&&l(o[c]))throw new C(`Appearance and material have a uniform with the same name: ${c}`);a[c]=rA(r,c)}}let f=hn(a,o);return f=e._batchTable.getUniformMapCallback()(f),l(e.rtcCenter)&&(f.u_modifiedModelView=function(){const c=i.context.uniformState.view;return k.multiply(c,e._modelMatrix,Ds),k.multiplyByPoint(Ds,e.rtcCenter,np),k.setTranslation(Ds,np,Ds),Ds}),f}function _A(e,t,n,i,o,a,r,f){const c=ip(e,t,n,f);let h;l(e._depthFailAppearance)&&(h=ip(e,e._depthFailAppearance,e._depthFailAppearance.material,f));const d=i?Nt.TRANSLUCENT:Nt.OPAQUE;let p=o?2:1;p*=l(e._depthFailAppearance)?2:1,a.length=e._va.length*p;const m=a.length;let T=0;for(let y=0;y<m;++y){let w;o&&(w=a[y],l(w)||(w=a[y]=new et({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[T],w.renderState=e._backFaceRS,w.shaderProgram=e._sp,w.uniformMap=c,w.pass=d,++y),w=a[y],l(w)||(w=a[y]=new et({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[T],w.renderState=e._frontFaceRS,w.shaderProgram=e._sp,w.uniformMap=c,w.pass=d,l(e._depthFailAppearance)&&(o&&(++y,w=a[y],l(w)||(w=a[y]=new et({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[T],w.renderState=e._backFaceDepthFailRS,w.shaderProgram=e._spDepthFail,w.uniformMap=h,w.pass=d),++y,w=a[y],l(w)||(w=a[y]=new et({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[T],w.renderState=e._frontFaceDepthFailRS,w.shaderProgram=e._spDepthFail,w.uniformMap=h,w.pass=d),++T}}Pe._updateBoundingVolumes=function(e,t,n,i){let o,a,r;if(i||!k.equals(n,e._modelMatrix))for(k.clone(n,e._modelMatrix),a=e._boundingSpheres.length,o=0;o<a;++o)r=e._boundingSpheres[o],l(r)&&(e._boundingSphereWC[o]=te.transform(r,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=te.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=te.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));const f=e.appearance.pixelSize;if(l(f))for(a=e._boundingSpheres.length,o=0;o<a;++o){r=e._boundingSpheres[o];const c=e._boundingSphereWC[o],d=t.camera.getPixelSize(r,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*f;c.radius=r.radius+d}};function gA(e,t,n,i,o,a,r,f){if(t.mode!==ye.SCENE3D&&!k.equals(o,k.IDENTITY))throw new C("Primitive.modelMatrix is only supported in 3D mode.");Pe._updateBoundingVolumes(e,t,o);let c;t.mode===ye.SCENE3D?c=e._boundingSphereWC:t.mode===ye.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ye.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);const h=t.commandList,d=t.passes;if(d.render||d.pick){const p=e.allowPicking,m=pa.castShadows(e.shadows),T=pa.receiveShadows(e.shadows),y=n.length;let w=f?2:1;w*=l(e._depthFailAppearance)?2:1;for(let A=0;A<y;++A){const E=Math.floor(A/w),b=n[A];b.modelMatrix=o,b.boundingVolume=c[E],b.cull=a,b.debugShowBoundingVolume=r,b.castShadows=m,b.receiveShadows=T,p?b.pickId="v_pickColor":b.pickId=void 0,h.push(b)}}}Pe.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==ye.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(l(this.rtcCenter)&&!e.scene3DOnly)throw new C("RTC rendering is only available for 3D only scenes.");if(this._state===Ot.FAILED)return;const t=e.context;if(l(this._batchTable)||Jw(this,t),this._batchTable.attributes.length>0){if(xe.maximumVertexTextureImageUnits===0)throw new dt("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Ot.COMPLETE&&this._state!==Ot.COMBINED&&(this.asynchronous?cA(this,e):hA(this,e)),this._state===Ot.COMBINED&&(lA(this,e),tp(this,e),dA(this,e)),!this.show||this._state!==Ot.COMPLETE)return;this._batchTableOffsetsUpdated||tp(this,e),this._recomputeBoundingSpheres&&fA(this,e);const n=this.appearance,i=n.material;let o=!1,a=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,a=!0):this._material!==i&&(this._material=i,a=!0);const r=this.depthFailAppearance,f=l(r)?r.material:void 0;this._depthFailAppearance!==r?(this._depthFailAppearance=r,this._depthFailMaterial=f,o=!0,a=!0):this._depthFailMaterial!==f&&(this._depthFailMaterial=f,a=!0);const c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);const h=n.closed&&c;o&&g(this._createRenderStatesFunction,pA)(this,t,n,h),a&&g(this._createShaderProgramFunction,mA)(this,e,n),(o||a)&&g(this._createCommandsFunction,_A)(this,n,i,c,h,this._colorCommands,this._pickCommands,e),g(this._updateAndQueueCommandsFunction,gA)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,h)};const TA=new te,yA=new te;function op(e,t,n){if(n===Mu.TOP){const i=te.clone(e,TA),o=te.clone(e,yA);o.center=u.add(o.center,t,o.center),e=te.union(i,o,e)}else n===Mu.ALL&&(e.center=u.add(e.center,t,e.center));return e}function CA(e,t,n){return function(){const i=e.getBatchedAttribute(t,n),o=e.attributes[n],a=o.componentsPerAttribute,r=he.createTypedArray(o.componentDatatype,a);return l(i.constructor.pack)?i.constructor.pack(i,r,0):r[0]=i,r}}function wA(e,t,n,i,o){return function(a){if(!l(a)||!l(a.length)||a.length<1||a.length>4)throw new C("value must be and array with length between 1 and 4.");const r=jd(a);e.setBatchedAttribute(t,n,r),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}const AA=new u;function EA(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();const o=e.modelMatrix,a=t.offset;l(a)&&op(i,u.fromArray(a.get(),0,AA),e._offsetInstanceExtend[n]),l(o)&&(i=te.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function bA(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Pe.prototype.getGeometryInstanceAttributes=function(e){if(!l(e))throw new C("id is required");if(!l(this._batchTable))throw new C("must call update before calling getGeometryInstanceAttributes");let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1;const i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,a=o.length;for(let h=0;h<a;++h){const d=(i+h)%a;if(e===o[d]){n=d;break}}if(n===-1)return;const r=this._batchTable,f=this._batchTableAttributeIndices;t={};const c={};for(const h in f)if(f.hasOwnProperty(h)){const d=f[h];c[h]={get:CA(r,n,d),set:wA(r,n,d,this,h)}}return EA(this,c,n),bA(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t},Pe.prototype.isDestroyed=function(){return!1},Pe.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();const n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;const i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,st(this)};function Os(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Ot.COMPLETE||e._state===Ot.FAILED})}function Vn(e){if(e=g(e,g.EMPTY_OBJECT),!l(e.componentDatatype))throw new C("options.componentDatatype is required.");if(!l(e.componentsPerAttribute))throw new C("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new C("options.componentsPerAttribute must be between 1 and 4.");if(!l(e.value))throw new C("options.value is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=g(e.normalize,!1),this.value=e.value}const sp=`#ifdef TEXTURE_COORDINATES
4786
4786
  #ifdef SPHERICAL
4787
4787
  in vec4 v_sphericalExtents;
4788
4788
  #else // SPHERICAL
@@ -4944,13 +4944,13 @@ void main(void)
4944
4944
  #endif // PICK
4945
4945
  }
4946
4946
  `;function qt(e,t,n){_.typeOf.bool("extentsCulling",e),_.typeOf.bool("planarExtents",t),_.typeOf.object("appearance",n),this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};const i=new wh;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;const o=new wh;if(o.requiresTextureCoordinates=e,n instanceof Kt)i.requiresNormalEC=!n.flat;else{const a=`${n.material.shaderSource}
4947
- ${n.fragmentShaderSource}`;i.normalEC=a.indexOf("materialInput.normalEC")!==-1||a.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=a.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=a.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=a.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}qt.prototype.createFragmentShader=function(e){_.typeOf.bool("columbusView2D",e);const t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof Kt&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof Kt||(o=t.material.shaderSource),new Ae({defines:i,sources:[o,sp]})},qt.prototype.createPickFragmentShader=function(e){_.typeOf.bool("columbusView2D",e);const t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Ae({defines:n,sources:[sp],pickColorQualifier:"in"})},qt.prototype.createVertexShader=function(e,t,n,i){return _.defined("defines",e),_.typeOf.string("vertexShaderSource",t),_.typeOf.bool("columbusView2D",n),_.defined("mapProjection",i),hp(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)},qt.prototype.createPickVertexShader=function(e,t,n,i){return _.defined("defines",e),_.typeOf.string("vertexShaderSource",t),_.typeOf.bool("columbusView2D",n),_.defined("mapProjection",i),hp(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};const rp=new u,ap=new oe,cp={high:0,low:0};function hp(e,t,n,i,o,a,r,f){const c=i.slice();if(f.eastMostYhighDefine===""){const h=ap;h.longitude=S.PI,h.latitude=0,h.height=0;const d=r.project(h,rp);let p=Qe.encode(d.x,cp);f.eastMostYhighDefine=`EAST_MOST_X_HIGH ${p.high.toFixed(`${p.high}`.length+1)}`,f.eastMostYlowDefine=`EAST_MOST_X_LOW ${p.low.toFixed(`${p.low}`.length+1)}`;const m=ap;m.longitude=-S.PI,m.latitude=0,m.height=0;const T=r.project(m,rp);p=Qe.encode(T.x,cp),f.westMostYhighDefine=`WEST_MOST_X_HIGH ${p.high.toFixed(`${p.high}`.length+1)}`,f.westMostYlowDefine=`WEST_MOST_X_LOW ${p.low.toFixed(`${p.low}`.length+1)}`}return n&&(c.push(f.eastMostYhighDefine),c.push(f.eastMostYlowDefine),c.push(f.westMostYhighDefine),c.push(f.westMostYlowDefine)),l(a)&&a instanceof Kt&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Ae({defines:c,sources:[o]})}function wh(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(wh.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function fp(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/q.distance(t,e)}const xA=[new q,new q,new q,new q];function lp(e,t){const n=xA,i=q.unpack(t,0,n[0]),o=q.unpack(t,2,n[1]),a=q.unpack(t,4,n[2]);e.uMaxVmax=new Gn({componentDatatype:he.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,a.x,a.y]});const r=1/fp(i,o,a),f=1/fp(i,a,o);e.uvMinAndExtents=new Gn({componentDatatype:he.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,r,f]})}const up=new oe,dp=new u,SA=new u,IA=new u,_a={high:0,low:0};function pp(e,t,n){const i=up;i.height=0,i.longitude=e.west,i.latitude=e.south;const o=t.project(i,dp);i.latitude=e.north;const a=t.project(i,SA);i.longitude=e.east,i.latitude=e.south;const r=t.project(i,IA),f=[0,0,0,0],c=[0,0,0,0];let h=Qe.encode(o.x,_a);f[0]=h.high,c[0]=h.low,h=Qe.encode(o.y,_a),f[1]=h.high,c[1]=h.low,h=Qe.encode(a.y,_a),f[2]=h.high,c[2]=h.low,h=Qe.encode(r.x,_a),f[3]=h.high,c[3]=h.low,n.planes2D_HIGH=new Gn({componentDatatype:he.FLOAT,componentsPerAttribute:4,normalize:!1,value:f}),n.planes2D_LOW=new Gn({componentDatatype:he.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}const DA=new k,OA=new k,mp=new u,vA=new oe,WA=[new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe];function PA(e,t,n,i,o,a){const r=de.center(e,vA);r.height=n;const f=oe.toCartesian(r,t,mp),c=Ce.eastNorthUpToFixedFrame(f,t,DA),h=k.inverse(c,OA),d=e.west,p=e.east,m=e.north,T=e.south,y=WA;y[0].latitude=T,y[0].longitude=d,y[1].latitude=m,y[1].longitude=d,y[2].latitude=m,y[2].longitude=p,y[3].latitude=T,y[3].longitude=p;const w=(d+p)*.5,A=(m+T)*.5;y[4].latitude=T,y[4].longitude=w,y[5].latitude=m,y[5].longitude=w,y[6].latitude=A,y[6].longitude=d,y[7].latitude=A,y[7].longitude=p;let E=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,I=Number.POSITIVE_INFINITY,O=Number.NEGATIVE_INFINITY;for(let N=0;N<8;N++){y[N].height=n;const U=oe.toCartesian(y[N],t,mp);k.multiplyByPoint(h,U,U),U.z=0,E=Math.min(E,U.x),b=Math.max(b,U.x),I=Math.min(I,U.y),O=Math.max(O,U.y)}const B=i;B.x=E,B.y=I,B.z=0,k.multiplyByPoint(c,B,B);const L=o;L.x=b,L.y=I,L.z=0,k.multiplyByPoint(c,L,L),u.subtract(L,B,o);const F=a;F.x=E,F.y=O,F.z=0,k.multiplyByPoint(c,F,F),u.subtract(F,B,a)}const BA=new u,RA=new u,zA=new Qe;qt.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){_.typeOf.object("boundingRectangle",e),_.defined("textureCoordinateRotationPoints",t),_.typeOf.object("ellipsoid",n),_.typeOf.object("projection",i);const a=dp,r=BA,f=RA;PA(e,n,g(o,0),a,r,f);const c={};lp(c,t);const h=Qe.fromCartesian(a,zA);return c.southWest_HIGH=new Gn({componentDatatype:he.FLOAT,componentsPerAttribute:3,normalize:!1,value:u.pack(h.high,[0,0,0])}),c.southWest_LOW=new Gn({componentDatatype:he.FLOAT,componentsPerAttribute:3,normalize:!1,value:u.pack(h.low,[0,0,0])}),c.eastward=new Gn({componentDatatype:he.FLOAT,componentsPerAttribute:3,normalize:!1,value:u.pack(r,[0,0,0])}),c.northward=new Gn({componentDatatype:he.FLOAT,componentsPerAttribute:3,normalize:!1,value:u.pack(f,[0,0,0])}),pp(e,i,c),c};const LA=new u;function _p(e,t,n,i){const o=up;o.latitude=e,o.longitude=t,o.height=0;const a=oe.toCartesian(o,n,LA),r=Math.sqrt(a.x*a.x+a.y*a.y),f=S.fastApproximateAtan2(r,a.z),c=S.fastApproximateAtan2(a.x,a.y);return i.x=f,i.y=c,i}const gp=new q;qt.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){_.typeOf.object("boundingRectangle",e),_.defined("textureCoordinateRotationPoints",t),_.typeOf.object("ellipsoid",n),_.typeOf.object("projection",i);const o=_p(e.south,e.west,n,gp);let a=o.x,r=o.y;const f=_p(e.north,e.east,n,gp);let c=f.x,h=f.y,d=0;r>h&&(d=S.PI-r,r=-S.PI,h+=d),a-=S.EPSILON5,r-=S.EPSILON5,c+=S.EPSILON5,h+=S.EPSILON5;const p=1/(h-r),m=1/(c-a),T={sphericalExtents:new Gn({componentDatatype:he.FLOAT,componentsPerAttribute:4,normalize:!1,value:[a,r,m,p]}),longitudeRotation:new Gn({componentDatatype:he.FLOAT,componentsPerAttribute:1,normalize:!1,value:[d]})};return lp(T,t),pp(e,i,T),T},qt.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)},qt.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function NA(e){return Math.max(e.width,e.height)>qt.MAX_WIDTH_FOR_PLANAR_EXTENTS}qt.shouldUseSphericalCoordinates=function(e){return _.typeOf.object("rectangle",e),NA(e)},qt.MAX_WIDTH_FOR_PLANAR_EXTENTS=S.toRadians(1);const FA={NEVER:R.NEVER,LESS:R.LESS,EQUAL:R.EQUAL,LESS_OR_EQUAL:R.LEQUAL,GREATER:R.GREATER,NOT_EQUAL:R.NOTEQUAL,GREATER_OR_EQUAL:R.GEQUAL,ALWAYS:R.ALWAYS},ri=Object.freeze(FA),MA={ZERO:R.ZERO,KEEP:R.KEEP,REPLACE:R.REPLACE,INCREMENT:R.INCR,DECREMENT:R.DECR,INVERT:R.INVERT,INCREMENT_WRAP:R.INCR_WRAP,DECREMENT_WRAP:R.DECR_WRAP},Ze=Object.freeze(MA),ga={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};ga.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ri.ALWAYS,frontOperation:{fail:Ze.KEEP,zFail:Ze.KEEP,zPass:Ze.REPLACE},backFunction:ri.ALWAYS,backOperation:{fail:Ze.KEEP,zFail:Ze.KEEP,zPass:Ze.REPLACE},reference:ga.CESIUM_3D_TILE_MASK,mask:ga.CESIUM_3D_TILE_MASK}};const Ei=Object.freeze(ga);function Hi(e){e=g(e,g.EMPTY_OBJECT);const t=e.geometryInstances;this.geometryInstances=t,this.show=g(e.show,!0),this.classificationType=g(e.classificationType,wi.BOTH),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=g(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=g(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:g(e.vertexCacheOptimize,!1),interleave:g(e.interleave,!1),releaseGeometryInstances:g(e.releaseGeometryInstances,!0),allowPicking:g(e.allowPicking,!0),asynchronous:g(e.asynchronous,!0),compressVertices:g(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Hi.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}}),Hi.isSupported=function(e){return e.context.stencilBuffer};function Yo(e,t){const n=t?ri.EQUAL:ri.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Ze.KEEP,zFail:Ze.DECREMENT_WRAP,zPass:Ze.KEEP},backFunction:n,backOperation:{fail:Ze.KEEP,zFail:Ze.INCREMENT_WRAP,zPass:Ze.KEEP},reference:Ei.CESIUM_3D_TILE_MASK,mask:Ei.CESIUM_3D_TILE_MASK},stencilMask:Ei.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Td.LESS_OR_EQUAL},depthMask:!1}}function Ah(e){return{stencilTest:{enabled:e,frontFunction:ri.NOT_EQUAL,frontOperation:{fail:Ze.ZERO,zFail:Ze.ZERO,zPass:Ze.ZERO},backFunction:ri.NOT_EQUAL,backOperation:{fail:Ze.ZERO,zFail:Ze.ZERO,zPass:Ze.ZERO},reference:0,mask:Ei.CLASSIFICATION_MASK},stencilMask:Ei.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:ro.PRE_MULTIPLIED_ALPHA_BLEND}}const UA={stencilTest:{enabled:!0,frontFunction:ri.NOT_EQUAL,frontOperation:{fail:Ze.ZERO,zFail:Ze.ZERO,zPass:Ze.ZERO},backFunction:ri.NOT_EQUAL,backOperation:{fail:Ze.ZERO,zFail:Ze.ZERO,zPass:Ze.ZERO},reference:0,mask:Ei.CLASSIFICATION_MASK},stencilMask:Ei.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function kA(e,t,n,i){if(l(e._rsStencilDepthPass))return;const o=!e.debugShowShadowVolume;e._rsStencilDepthPass=je.fromCache(Yo(o,!1)),e._rsStencilDepthPass3DTiles=je.fromCache(Yo(o,!0)),e._rsColorPass=je.fromCache(Ah(o)),e._rsPickPass=je.fromCache(UA)}function VA(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){const n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection;
4947
+ ${n.fragmentShaderSource}`;i.normalEC=a.indexOf("materialInput.normalEC")!==-1||a.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=a.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=a.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=a.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}qt.prototype.createFragmentShader=function(e){_.typeOf.bool("columbusView2D",e);const t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof Kt&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof Kt||(o=t.material.shaderSource),new Ae({defines:i,sources:[o,sp]})},qt.prototype.createPickFragmentShader=function(e){_.typeOf.bool("columbusView2D",e);const t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Ae({defines:n,sources:[sp],pickColorQualifier:"in"})},qt.prototype.createVertexShader=function(e,t,n,i){return _.defined("defines",e),_.typeOf.string("vertexShaderSource",t),_.typeOf.bool("columbusView2D",n),_.defined("mapProjection",i),hp(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)},qt.prototype.createPickVertexShader=function(e,t,n,i){return _.defined("defines",e),_.typeOf.string("vertexShaderSource",t),_.typeOf.bool("columbusView2D",n),_.defined("mapProjection",i),hp(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};const rp=new u,ap=new oe,cp={high:0,low:0};function hp(e,t,n,i,o,a,r,f){const c=i.slice();if(f.eastMostYhighDefine===""){const h=ap;h.longitude=S.PI,h.latitude=0,h.height=0;const d=r.project(h,rp);let p=Qe.encode(d.x,cp);f.eastMostYhighDefine=`EAST_MOST_X_HIGH ${p.high.toFixed(`${p.high}`.length+1)}`,f.eastMostYlowDefine=`EAST_MOST_X_LOW ${p.low.toFixed(`${p.low}`.length+1)}`;const m=ap;m.longitude=-S.PI,m.latitude=0,m.height=0;const T=r.project(m,rp);p=Qe.encode(T.x,cp),f.westMostYhighDefine=`WEST_MOST_X_HIGH ${p.high.toFixed(`${p.high}`.length+1)}`,f.westMostYlowDefine=`WEST_MOST_X_LOW ${p.low.toFixed(`${p.low}`.length+1)}`}return n&&(c.push(f.eastMostYhighDefine),c.push(f.eastMostYlowDefine),c.push(f.westMostYhighDefine),c.push(f.westMostYlowDefine)),l(a)&&a instanceof Kt&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Ae({defines:c,sources:[o]})}function wh(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(wh.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function fp(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/q.distance(t,e)}const xA=[new q,new q,new q,new q];function lp(e,t){const n=xA,i=q.unpack(t,0,n[0]),o=q.unpack(t,2,n[1]),a=q.unpack(t,4,n[2]);e.uMaxVmax=new Vn({componentDatatype:he.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,a.x,a.y]});const r=1/fp(i,o,a),f=1/fp(i,a,o);e.uvMinAndExtents=new Vn({componentDatatype:he.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,r,f]})}const up=new oe,dp=new u,SA=new u,IA=new u,_a={high:0,low:0};function pp(e,t,n){const i=up;i.height=0,i.longitude=e.west,i.latitude=e.south;const o=t.project(i,dp);i.latitude=e.north;const a=t.project(i,SA);i.longitude=e.east,i.latitude=e.south;const r=t.project(i,IA),f=[0,0,0,0],c=[0,0,0,0];let h=Qe.encode(o.x,_a);f[0]=h.high,c[0]=h.low,h=Qe.encode(o.y,_a),f[1]=h.high,c[1]=h.low,h=Qe.encode(a.y,_a),f[2]=h.high,c[2]=h.low,h=Qe.encode(r.x,_a),f[3]=h.high,c[3]=h.low,n.planes2D_HIGH=new Vn({componentDatatype:he.FLOAT,componentsPerAttribute:4,normalize:!1,value:f}),n.planes2D_LOW=new Vn({componentDatatype:he.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}const DA=new k,OA=new k,mp=new u,vA=new oe,WA=[new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe];function PA(e,t,n,i,o,a){const r=de.center(e,vA);r.height=n;const f=oe.toCartesian(r,t,mp),c=Ce.eastNorthUpToFixedFrame(f,t,DA),h=k.inverse(c,OA),d=e.west,p=e.east,m=e.north,T=e.south,y=WA;y[0].latitude=T,y[0].longitude=d,y[1].latitude=m,y[1].longitude=d,y[2].latitude=m,y[2].longitude=p,y[3].latitude=T,y[3].longitude=p;const w=(d+p)*.5,A=(m+T)*.5;y[4].latitude=T,y[4].longitude=w,y[5].latitude=m,y[5].longitude=w,y[6].latitude=A,y[6].longitude=d,y[7].latitude=A,y[7].longitude=p;let E=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,D=Number.POSITIVE_INFINITY,O=Number.NEGATIVE_INFINITY;for(let N=0;N<8;N++){y[N].height=n;const U=oe.toCartesian(y[N],t,mp);k.multiplyByPoint(h,U,U),U.z=0,E=Math.min(E,U.x),b=Math.max(b,U.x),D=Math.min(D,U.y),O=Math.max(O,U.y)}const B=i;B.x=E,B.y=D,B.z=0,k.multiplyByPoint(c,B,B);const L=o;L.x=b,L.y=D,L.z=0,k.multiplyByPoint(c,L,L),u.subtract(L,B,o);const F=a;F.x=E,F.y=O,F.z=0,k.multiplyByPoint(c,F,F),u.subtract(F,B,a)}const BA=new u,RA=new u,zA=new Qe;qt.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){_.typeOf.object("boundingRectangle",e),_.defined("textureCoordinateRotationPoints",t),_.typeOf.object("ellipsoid",n),_.typeOf.object("projection",i);const a=dp,r=BA,f=RA;PA(e,n,g(o,0),a,r,f);const c={};lp(c,t);const h=Qe.fromCartesian(a,zA);return c.southWest_HIGH=new Vn({componentDatatype:he.FLOAT,componentsPerAttribute:3,normalize:!1,value:u.pack(h.high,[0,0,0])}),c.southWest_LOW=new Vn({componentDatatype:he.FLOAT,componentsPerAttribute:3,normalize:!1,value:u.pack(h.low,[0,0,0])}),c.eastward=new Vn({componentDatatype:he.FLOAT,componentsPerAttribute:3,normalize:!1,value:u.pack(r,[0,0,0])}),c.northward=new Vn({componentDatatype:he.FLOAT,componentsPerAttribute:3,normalize:!1,value:u.pack(f,[0,0,0])}),pp(e,i,c),c};const LA=new u;function _p(e,t,n,i){const o=up;o.latitude=e,o.longitude=t,o.height=0;const a=oe.toCartesian(o,n,LA),r=Math.sqrt(a.x*a.x+a.y*a.y),f=S.fastApproximateAtan2(r,a.z),c=S.fastApproximateAtan2(a.x,a.y);return i.x=f,i.y=c,i}const gp=new q;qt.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){_.typeOf.object("boundingRectangle",e),_.defined("textureCoordinateRotationPoints",t),_.typeOf.object("ellipsoid",n),_.typeOf.object("projection",i);const o=_p(e.south,e.west,n,gp);let a=o.x,r=o.y;const f=_p(e.north,e.east,n,gp);let c=f.x,h=f.y,d=0;r>h&&(d=S.PI-r,r=-S.PI,h+=d),a-=S.EPSILON5,r-=S.EPSILON5,c+=S.EPSILON5,h+=S.EPSILON5;const p=1/(h-r),m=1/(c-a),T={sphericalExtents:new Vn({componentDatatype:he.FLOAT,componentsPerAttribute:4,normalize:!1,value:[a,r,m,p]}),longitudeRotation:new Vn({componentDatatype:he.FLOAT,componentsPerAttribute:1,normalize:!1,value:[d]})};return lp(T,t),pp(e,i,T),T},qt.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)},qt.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function NA(e){return Math.max(e.width,e.height)>qt.MAX_WIDTH_FOR_PLANAR_EXTENTS}qt.shouldUseSphericalCoordinates=function(e){return _.typeOf.object("rectangle",e),NA(e)},qt.MAX_WIDTH_FOR_PLANAR_EXTENTS=S.toRadians(1);const FA={NEVER:R.NEVER,LESS:R.LESS,EQUAL:R.EQUAL,LESS_OR_EQUAL:R.LEQUAL,GREATER:R.GREATER,NOT_EQUAL:R.NOTEQUAL,GREATER_OR_EQUAL:R.GEQUAL,ALWAYS:R.ALWAYS},ri=Object.freeze(FA),MA={ZERO:R.ZERO,KEEP:R.KEEP,REPLACE:R.REPLACE,INCREMENT:R.INCR,DECREMENT:R.DECR,INVERT:R.INVERT,INCREMENT_WRAP:R.INCR_WRAP,DECREMENT_WRAP:R.DECR_WRAP},Ze=Object.freeze(MA),ga={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};ga.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ri.ALWAYS,frontOperation:{fail:Ze.KEEP,zFail:Ze.KEEP,zPass:Ze.REPLACE},backFunction:ri.ALWAYS,backOperation:{fail:Ze.KEEP,zFail:Ze.KEEP,zPass:Ze.REPLACE},reference:ga.CESIUM_3D_TILE_MASK,mask:ga.CESIUM_3D_TILE_MASK}};const Ei=Object.freeze(ga);function Hi(e){e=g(e,g.EMPTY_OBJECT);const t=e.geometryInstances;this.geometryInstances=t,this.show=g(e.show,!0),this.classificationType=g(e.classificationType,wi.BOTH),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=g(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=g(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:g(e.vertexCacheOptimize,!1),interleave:g(e.interleave,!1),releaseGeometryInstances:g(e.releaseGeometryInstances,!0),allowPicking:g(e.allowPicking,!0),asynchronous:g(e.asynchronous,!0),compressVertices:g(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Hi.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}}),Hi.isSupported=function(e){return e.context.stencilBuffer};function jo(e,t){const n=t?ri.EQUAL:ri.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Ze.KEEP,zFail:Ze.DECREMENT_WRAP,zPass:Ze.KEEP},backFunction:n,backOperation:{fail:Ze.KEEP,zFail:Ze.INCREMENT_WRAP,zPass:Ze.KEEP},reference:Ei.CESIUM_3D_TILE_MASK,mask:Ei.CESIUM_3D_TILE_MASK},stencilMask:Ei.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Td.LESS_OR_EQUAL},depthMask:!1}}function Ah(e){return{stencilTest:{enabled:e,frontFunction:ri.NOT_EQUAL,frontOperation:{fail:Ze.ZERO,zFail:Ze.ZERO,zPass:Ze.ZERO},backFunction:ri.NOT_EQUAL,backOperation:{fail:Ze.ZERO,zFail:Ze.ZERO,zPass:Ze.ZERO},reference:0,mask:Ei.CLASSIFICATION_MASK},stencilMask:Ei.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:ro.PRE_MULTIPLIED_ALPHA_BLEND}}const UA={stencilTest:{enabled:!0,frontFunction:ri.NOT_EQUAL,frontOperation:{fail:Ze.ZERO,zFail:Ze.ZERO,zPass:Ze.ZERO},backFunction:ri.NOT_EQUAL,backOperation:{fail:Ze.ZERO,zFail:Ze.ZERO,zPass:Ze.ZERO},reference:0,mask:Ei.CLASSIFICATION_MASK},stencilMask:Ei.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function kA(e,t,n,i){if(l(e._rsStencilDepthPass))return;const o=!e.debugShowShadowVolume;e._rsStencilDepthPass=je.fromCache(jo(o,!1)),e._rsStencilDepthPass3DTiles=je.fromCache(jo(o,!0)),e._rsColorPass=je.fromCache(Ah(o)),e._rsPickPass=je.fromCache(UA)}function VA(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){const n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection;
4948
4948
  `,a=` extrudeDirection = czm_octDecode(${n}, 65535.0);
4949
4949
  `;let r=t;r=r.replace(/in\s+vec3\s+extrudeDirection;/g,""),r=Ae.replaceMain(r,"czm_non_compressed_main");const f=`void main()
4950
4950
  {
4951
4951
  ${a} czm_non_compressed_main();
4952
4952
  }`;return[i,o,r,f].join(`
4953
- `)}}function GA(e,t){const n=t.context,i=e._primitive;let o=HC;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Pe._appendDistanceDisplayConditionToShader(i,o),o=Pe._modifyShaderPosition(e,o,t.scene3DOnly),o=Pe._updateColorAttribute(i,o);const a=e._hasPlanarExtentsAttributes,r=a||e._hasSphericalExtentsAttribute;e._extruded&&(o=VA(i,o));const f=e._extruded?"EXTRUDED_GEOMETRY":"";let c=new Ae({defines:[f],sources:[o]});const h=new Ae({sources:[jC]}),d=e._primitive._attributeLocations,p=new qt(r,a,e.appearance);if(e._spStencil=lt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:h,attributeLocations:d}),e._primitive.allowPicking){let y=Ae.createPickVertexShaderSource(o);y=Pe._appendShowToShader(i,y),y=Pe._updatePickColorAttribute(y);const w=p.createPickFragmentShader(!1),A=p.createPickVertexShader([f],y,!1,t.mapProjection);if(e._spPick=lt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:A,fragmentShaderSource:w,attributeLocations:d}),r){let E=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(E)){const b=p.createPickFragmentShader(!0),I=p.createPickVertexShader([f],y,!0,t.mapProjection);E=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:I,fragmentShaderSource:b,attributeLocations:d})}e._spPick2D=E}}else e._spPick=lt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:h,attributeLocations:d});o=Pe._appendShowToShader(i,o),c=new Ae({defines:[f],sources:[o]}),e._sp=lt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:h,attributeLocations:d});const m=p.createFragmentShader(!1),T=p.createVertexShader([f],o,!1,t.mapProjection);if(e._spColor=lt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:T,fragmentShaderSource:m,attributeLocations:d}),r){let y=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(y)){const w=p.createFragmentShader(!0),A=p.createVertexShader([f],o,!0,t.mapProjection);y=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:A,fragmentShaderSource:w,attributeLocations:d})}e._spColor2D=y}}function qA(e,t){const n=e._primitive;let i=n._va.length*2;t.length=i;let o,a,r,f=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap);const h=e._needs2DShader;for(o=0;o<i;o+=2){const T=n._va[f++];a=t[o],l(a)||(a=t[o]=new et({owner:e,primitiveType:n._primitiveType})),a.vertexArray=T,a.renderState=e._rsStencilDepthPass,a.shaderProgram=e._sp,a.uniformMap=c,a.pass=Nt.TERRAIN_CLASSIFICATION,r=et.shallowClone(a,a.derivedCommands.tileset),r.renderState=e._rsStencilDepthPass3DTiles,r.pass=Nt.CESIUM_3D_TILE_CLASSIFICATION,a.derivedCommands.tileset=r,a=t[o+1],l(a)||(a=t[o+1]=new et({owner:e,primitiveType:n._primitiveType})),a.vertexArray=T,a.renderState=e._rsColorPass,a.shaderProgram=e._spColor,a.pass=Nt.TERRAIN_CLASSIFICATION;const w=e.appearance.material;if(l(w)&&(c=hn(c,w._uniforms)),a.uniformMap=c,r=et.shallowClone(a,a.derivedCommands.tileset),r.pass=Nt.CESIUM_3D_TILE_CLASSIFICATION,a.derivedCommands.tileset=r,h){let A=et.shallowClone(a,a.derivedCommands.appearance2D);A.shaderProgram=e._spColor2D,a.derivedCommands.appearance2D=A,A=et.shallowClone(r,r.derivedCommands.appearance2D),A.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=A}}const d=e._commandsIgnoreShow,p=e._spStencil;let m=0;i=d.length=i/2;for(let T=0;T<i;++T){const y=d[T]=et.shallowClone(t[m],d[T]);y.shaderProgram=p,y.pass=Nt.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,m+=2}}function HA(e,t){const n=e._usePickOffsets,i=e._primitive;let o=i._va.length*2,a,r=0,f;n&&(a=i._pickOffsets,o=a.length*2),t.length=o;let c,h,d,p=0;const m=i._batchTable.getUniformMapCallback()(e._uniformMap),T=e._needs2DShader;for(c=0;c<o;c+=2){let y=i._va[p++];if(n&&(f=a[r++],y=i._va[f.index]),h=t[c],l(h)||(h=t[c]=new et({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),h.vertexArray=y,h.renderState=e._rsStencilDepthPass,h.shaderProgram=e._sp,h.uniformMap=m,h.pass=Nt.TERRAIN_CLASSIFICATION,n&&(h.offset=f.offset,h.count=f.count),d=et.shallowClone(h,h.derivedCommands.tileset),d.renderState=e._rsStencilDepthPass3DTiles,d.pass=Nt.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=d,h=t[c+1],l(h)||(h=t[c+1]=new et({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),h.vertexArray=y,h.renderState=e._rsPickPass,h.shaderProgram=e._spPick,h.uniformMap=m,h.pass=Nt.TERRAIN_CLASSIFICATION,n&&(h.offset=f.offset,h.count=f.count),d=et.shallowClone(h,h.derivedCommands.tileset),d.pass=Nt.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=d,T){let w=et.shallowClone(h,h.derivedCommands.pick2D);w.shaderProgram=e._spPick2D,h.derivedCommands.pick2D=w,w=et.shallowClone(d,d.derivedCommands.pick2D),w.shaderProgram=e._spPick2D,d.derivedCommands.pick2D=w}}}function jA(e,t,n,i,o,a,r){qA(e,a),HA(e,r)}function Tp(e,t){return Math.floor(e%t/2)}function Eh(e,t,n,i,o,a){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=a,t.commandList.push(e)}function yp(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function YA(e,t,n,i,o,a,r,f){const c=e._primitive;Pe._updateBoundingVolumes(c,t,o);let h;t.mode===ye.SCENE3D?h=c._boundingSphereWC:t.mode===ye.COLUMBUS_VIEW?h=c._boundingSphereCV:t.mode===ye.SCENE2D&&l(c._boundingSphere2D)?h=c._boundingSphere2D:l(c._boundingSphereMorph)&&(h=c._boundingSphereMorph);const d=e.classificationType,p=d!==wi.CESIUM_3D_TILE,m=d!==wi.TERRAIN,T=t.passes;let y,w,A;if(T.render){const E=n.length;for(y=0;y<E;++y)w=h[Tp(y,E)],p&&(A=n[y],Eh(A,t,o,a,w,r)),m&&(A=n[y].derivedCommands.tileset,Eh(A,t,o,a,w,r));if(t.invertClassification){const b=e._commandsIgnoreShow,I=b.length;for(y=0;y<I;++y)w=h[y],A=b[y],Eh(A,t,o,a,w,r)}}if(T.pick){const E=i.length,b=c._pickOffsets;for(y=0;y<E;++y){const I=b[Tp(y,E)];w=h[I.index],p&&(A=i[y],yp(A,t,o,a,w)),m&&(A=i[y].derivedCommands.tileset,yp(A,t,o,a,w))}}}Hi.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);const n=this,i=this._primitiveOptions;if(!l(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],a=o.length;let r,f,c,h=!1,d=!0,p,m=!1,T=!1;for(a>0&&(c=o[0].attributes,m=qt.hasAttributesForSphericalExtents(c),T=qt.hasAttributesForTextureCoordinatePlanes(c),p=c.color),r=0;r<a;r++){f=o[r];const w=f.attributes.color;if(l(w))h=!0;else if(h)throw new C("All GeometryInstances must have color attributes to use per-instance color.");d=d&&l(w)&&No.equals(p,w)}if(!d&&!m&&!T)throw new C("All GeometryInstances must have the same color attribute except via GroundPrimitives");if(h&&!l(t)&&(t=new Kt({flat:!0}),this.appearance=t),!h&&t instanceof Kt)throw new C("PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances");if(l(t.material)&&!m&&!T)throw new C("Materials on ClassificationPrimitives are not supported except via GroundPrimitives");this._usePickOffsets=!m&&!T,this._hasSphericalExtentsAttribute=m,this._hasPlanarExtentsAttributes=T,this._hasPerColorAttribute=h;const y=new Array(a);for(r=0;r<a;++r)f=o[r],y[r]=new na({geometry:f.geometry,attributes:f.attributes,modelMatrix:f.modelMatrix,id:f.id,pickPrimitive:g(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=y,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(w,A){n._createBoundingVolumeFunction(w,A)}),i._createRenderStatesFunction=function(w,A,E,b){kA(n)},i._createShaderProgramFunction=function(w,A,E){GA(n,A)},i._createCommandsFunction=function(w,A,E,b,I,O,B){jA(n,void 0,void 0,!0,!1,O,B)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(w,A,E,b,I,O,B,L){n._updateAndQueueCommandsFunction(w,A,E,b,I,O,B,L)}:i._updateAndQueueCommandsFunction=function(w,A,E,b,I,O,B,L){YA(n,A,E,b,I,O,B)},this._primitive=new Pe(i)}if(this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=je.fromCache(Yo(!1,!1)),this._rsStencilDepthPass3DTiles=je.fromCache(Yo(!1,!0)),this._rsColorPass=je.fromCache(Ah(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=je.fromCache(Yo(!0,!1)),this._rsStencilDepthPass3DTiles=je.fromCache(Yo(!0,!0)),this._rsColorPass=je.fromCache(Ah(!0))),this._primitive.appearance!==t){if(!this._hasSphericalExtentsAttribute&&!this._hasPlanarExtentsAttributes&&l(t.material))throw new C("Materials on ClassificationPrimitives are not supported except via GroundPrimitive");if(!this._hasPerColorAttribute&&t instanceof Kt)throw new C("PerInstanceColorAppearance requires color GeometryInstanceAttribute");this._primitive.appearance=t}this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},Hi.prototype.getGeometryInstanceAttributes=function(e){if(!l(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},Hi.prototype.isDestroyed=function(){return!1},Hi.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,st(this)};const XA={u_globeMinimumAltitude:function(){return 55e3}};function un(e){e=g(e,g.EMPTY_OBJECT);let t=e.appearance;const n=e.geometryInstances;if(!l(t)&&l(n)){const o=Array.isArray(n)?n:[n],a=o.length;for(let r=0;r<a;r++){const f=o[r].attributes;if(l(f)&&l(f.color)){t=new Kt({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=g(e.show,!0),this.classificationType=g(e.classificationType,wi.BOTH),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=g(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=Ve._defaultMaxTerrainHeight,this._minTerrainHeight=Ve._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;const i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:g(e.vertexCacheOptimize,!1),interleave:g(e.interleave,!1),releaseGeometryInstances:g(e.releaseGeometryInstances,!0),allowPicking:g(e.allowPicking,!0),asynchronous:g(e.asynchronous,!0),compressVertices:g(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:XA}}Object.defineProperties(un.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}}),un.isSupported=Hi.isSupported;function Cp(e){return function(t,n){const i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function wp(e){return function(t,n){return e._minHeight}}const $A=new u,ZA=new u,KA=new u,QA=new oe,JA=new de;function Ta(e,t){const n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;const i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,a=i.length;let r=Number.POSITIVE_INFINITY,f=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(let p=0;p<a;p+=3){const m=u.unpack(i,p,$A),T=u.unpack(o,p,ZA),y=u.add(m,T,KA),w=n.cartesianToCartographic(y,QA),A=w.latitude,E=w.longitude;r=Math.min(r,A),f=Math.min(f,E),c=Math.max(c,A),h=Math.max(h,E)}const d=JA;return d.north=c,d.south=r,d.east=h,d.west=f,d}function e2(e,t,n){const i=Ve.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function t2(e,t,n){const i=t.mapProjection.ellipsoid,o=Ta(t,n),a=ze.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(a),!t.scene3DOnly){const r=t.mapProjection,f=te.fromRectangleWithHeights2D(o,r,e._maxHeight,e._minHeight);u.fromElements(f.center.z,f.center.x,f.center.y,f.center),e._boundingVolumes2D.push(f)}}function bh(e,t){return Math.floor(e%t/2)}function xh(e,t,n,i,o,a,r){const f=e._primitive;n.mode!==ye.SCENE3D&&t.shaderProgram===f._spColor&&f._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=a,t.cull=o,t.debugShowBoundingVolume=r,n.commandList.push(t)}function Ap(e,t,n,i,o,a){const r=e._primitive;n.mode!==ye.SCENE3D&&t.shaderProgram===r._spPick&&r._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=a,t.cull=o,n.commandList.push(t)}function n2(e,t,n,i,o,a,r,f){let c;t.mode===ye.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;const h=e.classificationType,d=h!==wi.CESIUM_3D_TILE,p=h!==wi.TERRAIN,m=t.passes,T=e._primitive;let y,w,A;if(m.render){const E=n.length;for(y=0;y<E;++y)w=c[bh(y,E)],d&&(A=n[y],xh(e,A,t,o,a,w,r)),p&&(A=n[y].derivedCommands.tileset,xh(e,A,t,o,a,w,r));if(t.invertClassification){const b=T._commandsIgnoreShow,I=b.length;for(y=0;y<I;++y)w=c[y],A=b[y],xh(e,A,t,o,a,w,r)}}if(m.pick){const E=i.length;let b;for(e._useFragmentCulling||(b=T._primitive._pickOffsets),y=0;y<E;++y){if(w=c[bh(y,E)],!e._useFragmentCulling){const I=b[bh(y,E)];w=c[I.index]}d&&(A=i[y],Ap(e,A,t,o,a,w)),p&&(A=i[y].derivedCommands.tileset,Ap(e,A,t,o,a,w))}}}un.initializeTerrainHeights=function(){return Ve.initialize()},un.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ve.initialized){if(!this.asynchronous)throw new C("For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.");un.initializeTerrainHeights();return}const t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){const i=e.mapProjection.ellipsoid;let o,a,r;const f=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=f.length,h=new Array(c);let d,p;for(d=0;d<c;++d){o=f[d],a=o.geometry;const w=Ta(e,a);l(p)?l(w)&&de.union(p,w,p):p=de.clone(w);const A=o.id;if(l(A)&&l(w)){const E=Ve.getBoundingSphere(w,i);this._boundingSpheresKeys.push(A),this._boundingSpheres.push(E)}if(r=a.constructor,!l(r)||!l(r.createShadowVolume))throw new C("Not all of the geometry instances have GroundPrimitive support.")}e2(this,p,i);const m=e.verticalExaggeration,T=e.verticalExaggerationRelativeHeight;this._minHeight=As.getHeight(this._minTerrainHeight,m,T),this._maxHeight=As.getHeight(this._maxTerrainHeight,m,T);const y=un._supportsMaterials(e.context);if(this._useFragmentCulling=y,y){let w,A=!0;for(d=0;d<c;++d)if(o=f[d],a=o.geometry,p=Ta(e,a),qt.shouldUseSphericalCoordinates(p)){A=!1;break}for(d=0;d<c;++d){o=f[d],a=o.geometry,r=a.constructor;const E=Ta(e,a),b=a.textureCoordinateRotationPoints;A?w=qt.getPlanarTextureCoordinateAttributes(E,b,i,e.mapProjection,this._maxHeight):w=qt.getSphericalExtentGeometryInstanceAttributes(E,b,i,e.mapProjection);const I=o.attributes;for(const O in I)I.hasOwnProperty(O)&&(w[O]=I[O]);h[d]=new na({geometry:r.createShadowVolume(a,wp(this),Cp(this)),attributes:w,id:o.id})}}else for(d=0;d<c;++d)o=f[d],a=o.geometry,r=a.constructor,h[d]=new na({geometry:r.createShadowVolume(a,wp(this),Cp(this)),attributes:o.attributes,id:o.id});n.geometryInstances=h,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(w,A){t2(t,w,A)},n._updateAndQueueCommandsFunction=function(w,A,E,b,I,O,B,L){n2(t,A,E,b,I,O,B)},this._primitive=new Hi(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},un.prototype.getBoundingSphere=function(e){const t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]},un.prototype.getGeometryInstanceAttributes=function(e){if(!l(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},un.prototype.isDestroyed=function(){return!1},un.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),st(this)},un._supportsMaterials=function(e){return e.depthTexture},un.supportsMaterials=function(e){return _.typeOf.object("scene",e),un._supportsMaterials(e.frameState.context)};const ai=Object.freeze({NONE:0,GEODESIC:1,RHUMB:2}),Ep=S.EPSILON10;function i2(e,t,n,i){if(_.defined("equalsEpsilon",t),!l(e))return;n=g(n,!1);const o=l(i),a=e.length;if(a<2)return e;let r,f=e[0],c,h,d=0,p=-1;for(r=1;r<a;++r)c=e[r],t(f,c,Ep)?(l(h)||(h=e.slice(0,r),d=r-1,p=0),o&&i.push(r)):(l(h)&&(h.push(c),d=r,o&&(p=i.length)),f=c);return n&&t(e[0],e[a-1],Ep)&&(o&&(l(h)?i.splice(p,0,d):i.push(a-1)),l(h)?h.length-=1:h=e.slice(0,-1)),l(h)?h:e}function o2(e){const t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,a=Math.cos(e._startHeading),r=Math.sin(e._startHeading),f=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+f*f),h=c*f,d=Math.atan2(f,a),p=c*r,m=p*p,T=1-m,y=Math.sqrt(T),w=t/4,A=w*w,E=A*w,b=A*A,I=1+w-3*A/4+5*E/4-175*b/64,O=1-w+15*A/8-35*E/8,B=1-3*w+35*A/4,L=1-5*w,F=I*d-O*Math.sin(2*d)*w/2-B*Math.sin(4*d)*A/16-L*Math.sin(6*d)*E/48-Math.sin(8*d)*5*b/512,N=e._constants;N.a=n,N.b=i,N.f=o,N.cosineHeading=a,N.sineHeading=r,N.tanU=f,N.cosineU=c,N.sineU=h,N.sigma=d,N.sineAlpha=p,N.sineSquaredAlpha=m,N.cosineSquaredAlpha=T,N.cosineAlpha=y,N.u2Over4=w,N.u4Over16=A,N.u6Over64=E,N.u8Over256=b,N.a0=I,N.a1=O,N.a2=B,N.a3=L,N.distanceRatio=F}function s2(e,t){return e*t*(4+e*(4-3*t))/16}function bp(e,t,n,i,o,a,r){const f=s2(e,n);return(1-f)*e*t*(i+f*o*(r+f*a*(2*r*r-1)))}function r2(e,t,n,i,o,a,r){const f=(t-n)/t,c=a-i,h=Math.atan((1-f)*Math.tan(o)),d=Math.atan((1-f)*Math.tan(r)),p=Math.cos(h),m=Math.sin(h),T=Math.cos(d),y=Math.sin(d),w=p*T,A=p*y,E=m*y,b=m*T;let I=c,O=S.TWO_PI,B=Math.cos(I),L=Math.sin(I),F,N,U,M,j;do{B=Math.cos(I),L=Math.sin(I);const K=A-b*B;U=Math.sqrt(T*T*L*L+K*K),N=E+w*B,F=Math.atan2(U,N);let ce;U===0?(ce=0,M=1):(ce=w*L/U,M=1-ce*ce),O=I,j=N-2*E/M,isFinite(j)||(j=0),I=c+bp(f,ce,M,F,U,N,j)}while(Math.abs(I-O)>S.EPSILON12);const Y=M*(t*t-n*n)/(n*n),s=1+Y*(4096+Y*(Y*(320-175*Y)-768))/16384,x=Y*(256+Y*(Y*(74-47*Y)-128))/1024,P=j*j,z=x*U*(j+x*(N*(2*P-1)-x*j*(4*U*U-3)*(4*P-3)/6)/4),H=n*s*(F-z),X=Math.atan2(T*L,A-b*B),ee=Math.atan2(p*L,A*B-b);e._distance=H,e._startHeading=X,e._endHeading=ee,e._uSquared=Y}const a2=new u,Sh=new u;function xp(e,t,n,i){const o=u.normalize(i.cartographicToCartesian(t,Sh),a2),a=u.normalize(i.cartographicToCartesian(n,Sh),Sh);_.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(u.angleBetween(o,a))-Math.PI),.0125),r2(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=oe.clone(t,e._start),e._end=oe.clone(n,e._end),e._start.height=0,e._end.height=0,o2(e)}function vs(e,t,n){const i=g(n,pe.default);this._ellipsoid=i,this._start=new oe,this._end=new oe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&xp(this,e,t,i)}Object.defineProperties(vs.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return _.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return _.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return _.defined("distance",this._distance),this._endHeading}}}),vs.prototype.setEndPoints=function(e,t){_.defined("start",e),_.defined("end",t),xp(this,e,t,this._ellipsoid)},vs.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},vs.prototype.interpolateUsingSurfaceDistance=function(e,t){_.defined("distance",this._distance);const n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),a=Math.cos(4*i),r=Math.cos(6*i),f=Math.sin(2*i),c=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),p=i*i,m=i*p,T=n.u8Over256,y=n.u2Over4,w=n.u6Over64,A=n.u4Over16;let E=2*m*T*o/3+i*(1-y+7*A/4-15*w/4+579*T/64-(A-15*w/4+187*T/16)*o-(5*w/4-115*T/16)*a-29*T*r/16)+(y/2-A+71*w/32-85*T/16)*f+(5*A/16-5*w/4+383*T/96)*c-p*((w-11*T/2)*f+5*T*c/2)+(29*w/96-29*T/16)*h+539*T*d/1536;const b=Math.asin(Math.sin(E)*n.cosineAlpha),I=Math.atan(n.a/n.b*Math.tan(b));E=E-n.sigma;const O=Math.cos(2*n.sigma+E),B=Math.sin(E),L=Math.cos(E),F=n.cosineU*L,N=n.sineU*B,M=Math.atan2(B*n.sineHeading,F-N*n.cosineHeading)-bp(n.f,n.sineAlpha,n.cosineSquaredAlpha,E,B,L,O);return l(t)?(t.longitude=this._start.longitude+M,t.latitude=I,t.height=0,t):new oe(this._start.longitude+M,I,0)};function Ih(e,t,n){if(e===0)return t*n;const i=e*e,o=i*i,a=o*i,r=a*i,f=r*i,c=f*i,h=n,d=Math.sin(2*h),p=Math.sin(4*h),m=Math.sin(6*h),T=Math.sin(8*h),y=Math.sin(10*h),w=Math.sin(12*h);return t*((1-i/4-3*o/64-5*a/256-175*r/16384-441*f/65536-4851*c/1048576)*h-(3*i/8+3*o/32+45*a/1024+105*r/4096+2205*f/131072+6237*c/524288)*d+(15*o/256+45*a/1024+525*r/16384+1575*f/65536+155925*c/8388608)*p-(35*a/3072+175*r/12288+3675*f/262144+13475*c/1048576)*m+(315*r/131072+2205*f/524288+43659*c/8388608)*T-(693*f/1310720+6237*c/5242880)*y+1001*c/8388608*w)}function c2(e,t,n){const i=e/n;if(t===0)return i;const o=i*i,a=o*i,r=a*i,f=t,c=f*f,h=c*c,d=h*c,p=d*c,m=p*c,T=m*c,y=Math.sin(2*i),w=Math.cos(2*i),A=Math.sin(4*i),E=Math.cos(4*i),b=Math.sin(6*i),I=Math.cos(6*i),O=Math.sin(8*i),B=Math.cos(8*i),L=Math.sin(10*i),F=Math.cos(10*i),N=Math.sin(12*i);return i+i*c/4+7*i*h/64+15*i*d/256+579*i*p/16384+1515*i*m/65536+16837*i*T/1048576+(3*i*h/16+45*i*d/256-i*(32*o-561)*p/4096-i*(232*o-1677)*m/16384+i*(399985-90560*o+512*r)*T/5242880)*w+(21*i*d/256+483*i*p/4096-i*(224*o-1969)*m/16384-i*(33152*o-112599)*T/1048576)*E+(151*i*p/4096+4681*i*m/65536+1479*i*T/16384-453*a*T/32768)*I+(1097*i*m/65536+42783*i*T/1048576)*B+8011*i*T/1048576*F+(3*c/8+3*h/16+213*d/2048-3*o*d/64+255*p/4096-33*o*p/512+20861*m/524288-33*o*m/512+r*m/1024+28273*T/1048576-471*o*T/8192+9*r*T/4096)*y+(21*h/256+21*d/256+533*p/8192-21*o*p/512+197*m/4096-315*o*m/4096+584039*T/16777216-12517*o*T/131072+7*r*T/2048)*A+(151*d/6144+151*p/4096+5019*m/131072-453*o*m/16384+26965*T/786432-8607*o*T/131072)*b+(1097*p/131072+1097*m/65536+225797*T/10485760-1097*o*T/65536)*O+(8011*m/2621440+8011*T/1048576)*L+293393*T/251658240*N}function Xo(e,t){if(e===0)return Math.log(Math.tan(.5*(S.PI_OVER_TWO+t)));const n=e*Math.sin(t);return Math.log(Math.tan(.5*(S.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function h2(e,t,n,i,o){const a=Xo(e._ellipticity,n),r=Xo(e._ellipticity,o);return Math.atan2(S.negativePiToPi(i-t),r-a)}function f2(e,t,n,i,o,a,r){const f=e._heading,c=a-i;let h=0;if(S.equalsEpsilon(Math.abs(f),S.PI_OVER_TWO,S.EPSILON8))if(t===n)h=t*Math.cos(o)*S.negativePiToPi(c);else{const d=Math.sin(o);h=t*Math.cos(o)*S.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*d*d)}else{const d=Ih(e._ellipticity,t,o);h=(Ih(e._ellipticity,t,r)-d)/Math.cos(f)}return Math.abs(h)}const l2=new u,Dh=new u;function Sp(e,t,n,i){const o=u.normalize(i.cartographicToCartesian(t,Dh),l2),a=u.normalize(i.cartographicToCartesian(n,Dh),Dh);_.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(u.angleBetween(o,a))-Math.PI),.0125);const r=i.maximumRadius,f=i.minimumRadius,c=r*r,h=f*f;e._ellipticitySquared=(c-h)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=oe.clone(t,e._start),e._start.height=0,e._end=oe.clone(n,e._end),e._end.height=0,e._heading=h2(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=f2(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Ip(e,t,n,i,o,a){if(n===0)return oe.clone(e,a);const r=o*o;let f,c,h;if(Math.abs(S.PI_OVER_TWO-Math.abs(t))>S.EPSILON8){const d=Ih(o,i,e.latitude),p=n*Math.cos(t),m=d+p;if(c=c2(m,o,i),Math.abs(t)<S.EPSILON10)f=S.negativePiToPi(e.longitude);else{const T=Xo(o,e.latitude),y=Xo(o,c);h=Math.tan(t)*(y-T),f=S.negativePiToPi(e.longitude+h)}}else{c=e.latitude;let d;if(o===0)d=i*Math.cos(e.latitude);else{const p=Math.sin(e.latitude);d=i*Math.cos(e.latitude)/Math.sqrt(1-r*p*p)}h=n/d,t>0?f=S.negativePiToPi(e.longitude+h):f=S.negativePiToPi(e.longitude-h)}return l(a)?(a.longitude=f,a.latitude=c,a.height=0,a):new oe(f,c,0)}function ci(e,t,n){const i=g(n,pe.default);this._ellipsoid=i,this._start=new oe,this._end=new oe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Sp(this,e,t,i)}Object.defineProperties(ci.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return _.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return _.defined("distance",this._distance),this._heading}}}),ci.fromStartHeadingDistance=function(e,t,n,i,o){_.defined("start",e),_.defined("heading",t),_.defined("distance",n),_.typeOf.number.greaterThan("distance",n,0);const a=g(i,pe.default),r=a.maximumRadius,f=a.minimumRadius,c=r*r,h=f*f,d=Math.sqrt((c-h)/c);t=S.negativePiToPi(t);const p=Ip(e,t,n,a.maximumRadius,d);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new ci(e,p,a):(o.setEndPoints(e,p),o)},ci.prototype.setEndPoints=function(e,t){_.defined("start",e),_.defined("end",t),Sp(this,e,t,this._ellipsoid)},ci.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)},ci.prototype.interpolateUsingSurfaceDistance=function(e,t){if(_.typeOf.number("distance",e),!l(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");return Ip(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)},ci.prototype.findIntersectionWithLongitude=function(e,t){if(_.typeOf.number("intersectionLongitude",e),!l(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");const n=this._ellipticity,i=this._heading,o=Math.abs(i),a=this._start;if(e=S.negativePiToPi(e),S.equalsEpsilon(Math.abs(e),Math.PI,S.EPSILON14)&&(e=S.sign(a.longitude)*Math.PI),l(t)||(t=new oe),Math.abs(S.PI_OVER_TWO-o)<=S.EPSILON8)return t.longitude=e,t.latitude=a.latitude,t.height=0,t;if(S.equalsEpsilon(Math.abs(S.PI_OVER_TWO-o),S.PI_OVER_TWO,S.EPSILON8))return S.equalsEpsilon(e,a.longitude,S.EPSILON12)?void 0:(t.longitude=e,t.latitude=S.PI_OVER_TWO*S.sign(S.PI_OVER_TWO-i),t.height=0,t);const r=a.latitude,f=n*Math.sin(r),c=Math.tan(.5*(S.PI_OVER_TWO+r))*Math.exp((e-a.longitude)/Math.tan(i)),h=(1+f)/(1-f);let d=a.latitude,p;do{p=d;const m=n*Math.sin(p),T=(1+m)/(1-m);d=2*Math.atan(c*Math.pow(T/h,n/2))-S.PI_OVER_TWO}while(!S.equalsEpsilon(d,p,S.EPSILON12));return t.longitude=e,t.latitude=d,t.height=0,t},ci.prototype.findIntersectionWithLatitude=function(e,t){if(_.typeOf.number("intersectionLatitude",e),!l(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");const n=this._ellipticity,i=this._heading,o=this._start;if(S.equalsEpsilon(Math.abs(i),S.PI_OVER_TWO,S.EPSILON8))return;const a=Xo(n,o.latitude),r=Xo(n,e),f=Math.tan(i)*(r-a),c=S.negativePiToPi(o.longitude+f);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new oe(c,e,0)};const Oh=[Wn,on],u2=Oh.length,Dp=Math.cos(S.toRadians(30)),Op=Math.cos(S.toRadians(150)),vp=0,Wp=1e3;function ji(e){e=g(e,g.EMPTY_OBJECT);const t=e.positions;if(!l(t)||t.length<2)throw new C("At least two positions are required.");if(l(e.arcType)&&e.arcType!==ai.GEODESIC&&e.arcType!==ai.RHUMB)throw new C("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=g(e.width,1),this._positions=t,this.granularity=g(e.granularity,9999),this.loop=g(e.loop,!1),this.arcType=g(e.arcType,ai.GEODESIC),this._ellipsoid=pe.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(ji.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+pe.packedLength+1+1}}}),ji.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<u2;i++)if(t instanceof Oh[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};const d2=new u,Pp=new u,Bp=new u;function vh(e,t,n,i,o){const a=sn(i,e,0,d2),r=sn(i,e,n,Pp),f=sn(i,t,0,Bp),c=bi(r,a,Pp),h=bi(f,a,Bp);return u.cross(h,c,o),u.normalize(o,o)}const p2=new oe,m2=new u,_2=new u,g2=new u;function Wh(e,t,n,i,o,a,r,f,c,h,d){if(o===0)return;let p;a===ai.GEODESIC?p=new vs(e,t,r):a===ai.RHUMB&&(p=new ci(e,t,r));const m=p.surfaceDistance;if(m<o)return;const T=vh(e,t,i,r,g2),y=Math.ceil(m/o),w=m/y;let A=w;const E=y-1;let b=f.length;for(let I=0;I<E;I++){const O=p.interpolateUsingSurfaceDistance(A,p2),B=sn(r,O,n,m2),L=sn(r,O,i,_2);u.pack(T,f,b),u.pack(B,c,b),u.pack(L,h,b),d.push(O.latitude),d.push(O.longitude),b+=3,A+=w}}const Ph=new oe;function sn(e,t,n,i){return oe.clone(t,Ph),Ph.height=n,oe.toCartesian(Ph,e,i)}ji.pack=function(e,t,n){_.typeOf.object("value",e),_.defined("array",t);let i=g(n,0);const o=e._positions,a=o.length;t[i++]=a;for(let r=0;r<a;++r){const f=o[r];u.pack(f,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,pe.pack(e._ellipsoid,t,i),i+=pe.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t},ji.unpack=function(e,t,n){_.defined("array",e);let i=g(t,0);const o=e[i++],a=new Array(o);for(let m=0;m<o;m++)a[m]=u.unpack(e,i),i+=3;const r=e[i++],f=e[i++]===1,c=e[i++],h=pe.unpack(e,i);i+=pe.packedLength;const d=e[i++],p=e[i++]===1;return l(n)||(n=new ji({positions:a})),n._positions=a,n.granularity=r,n.loop=f,n.arcType=c,n._ellipsoid=h,n._projectionIndex=d,n._scene3DOnly=p,n};function bi(e,t,n){return u.subtract(e,t,n),u.normalize(n,n),n}function Rp(e,t,n,i){return i=bi(e,t,i),i=u.cross(i,n,i),i=u.normalize(i,i),i=u.cross(n,i,i),i}const T2=new u,y2=new u,C2=new u,zp=new u,w2=0,A2=-1;function Bh(e,t,n,i,o){const a=bi(n,t,zp),r=Rp(e,t,a,T2),f=Rp(i,t,a,y2);if(S.equalsEpsilon(u.dot(r,f),A2,S.EPSILON5))return o=u.cross(a,r,o),o=u.normalize(o,o),o;o=u.add(f,r,o),o=u.normalize(o,o);const c=u.cross(a,o,C2);return u.dot(f,c)<w2&&(o=u.negate(o,o)),o}const ya=Me.fromPointNormal(u.ZERO,u.UNIT_Y),E2=new u,b2=new u,x2=new u,S2=new u,I2=new u,Ca=new u,wa=new oe,Lp=new oe,Np=new oe;ji.createGeometry=function(e){const t=!e._scene3DOnly;let n=e.loop;const i=e._ellipsoid,o=e.granularity,a=e.arcType,r=new Oh[e._projectionIndex](i),f=vp,c=Wp;let h,d;const p=e._positions,m=p.length;m===2&&(n=!1);let T,y,w,A;const E=new ci(void 0,void 0,i);let b,I,O;const B=[p[0]];for(d=0;d<m-1;d++)T=p[d],y=p[d+1],b=Ue.lineSegmentPlane(T,y,ya,Ca),l(b)&&!u.equalsEpsilon(b,T,S.EPSILON7)&&!u.equalsEpsilon(b,y,S.EPSILON7)&&(e.arcType===ai.GEODESIC?B.push(u.clone(b)):e.arcType===ai.RHUMB&&(O=i.cartesianToCartographic(b,wa).longitude,w=i.cartesianToCartographic(T,wa),A=i.cartesianToCartographic(y,Lp),E.setEndPoints(w,A),I=E.findIntersectionWithLongitude(O,Np),b=i.cartographicToCartesian(I,Ca),l(b)&&!u.equalsEpsilon(b,T,S.EPSILON7)&&!u.equalsEpsilon(b,y,S.EPSILON7)&&B.push(u.clone(b)))),B.push(y);n&&(T=p[m-1],y=p[0],b=Ue.lineSegmentPlane(T,y,ya,Ca),l(b)&&!u.equalsEpsilon(b,T,S.EPSILON7)&&!u.equalsEpsilon(b,y,S.EPSILON7)&&(e.arcType===ai.GEODESIC?B.push(u.clone(b)):e.arcType===ai.RHUMB&&(O=i.cartesianToCartographic(b,wa).longitude,w=i.cartesianToCartographic(T,wa),A=i.cartesianToCartographic(y,Lp),E.setEndPoints(w,A),I=E.findIntersectionWithLongitude(O,Np),b=i.cartographicToCartesian(I,Ca),l(b)&&!u.equalsEpsilon(b,T,S.EPSILON7)&&!u.equalsEpsilon(b,y,S.EPSILON7)&&B.push(u.clone(b)))));let L=B.length,F=new Array(L);for(d=0;d<L;d++){const le=oe.fromCartesian(B[d],i);le.height=0,F[d]=le}if(F=i2(F,oe.equalsEpsilon),L=F.length,L<2)return;const N=[],U=[],M=[],j=[];let Y=E2,s=b2,x=x2,P=S2,z=I2;const H=F[0],X=F[1],ee=F[L-1];for(Y=sn(i,ee,f,Y),P=sn(i,X,f,P),s=sn(i,H,f,s),x=sn(i,H,c,x),n?z=Bh(Y,s,x,P,z):z=vh(H,X,c,i,z),u.pack(z,U,0),u.pack(s,M,0),u.pack(x,j,0),N.push(H.latitude),N.push(H.longitude),Wh(H,X,f,c,o,a,i,U,M,j,N),d=1;d<L-1;++d){Y=u.clone(s,Y),s=u.clone(P,s);const le=F[d];sn(i,le,c,x),sn(i,F[d+1],f,P),Bh(Y,s,x,P,z),h=U.length,u.pack(z,U,h),u.pack(s,M,h),u.pack(x,j,h),N.push(le.latitude),N.push(le.longitude),Wh(F[d],F[d+1],f,c,o,a,i,U,M,j,N)}const K=F[L-1],ce=F[L-2];if(s=sn(i,K,f,s),x=sn(i,K,c,x),n){const le=F[0];Y=sn(i,ce,f,Y),P=sn(i,le,f,P),z=Bh(Y,s,x,P,z)}else z=vh(ce,K,c,i,z);if(h=U.length,u.pack(z,U,h),u.pack(s,M,h),u.pack(x,j,h),N.push(K.latitude),N.push(K.longitude),n){for(Wh(K,H,f,c,o,a,i,U,M,j,N),h=U.length,d=0;d<3;++d)U[h+d]=U[d],M[h+d]=M[d],j[h+d]=j[d];N.push(H.latitude),N.push(H.longitude)}return J2(n,r,M,j,U,N,t)};const D2=new u,O2=new G,v2=new ie;function Fp(e,t,n,i){const o=bi(n,t,D2),a=u.dot(o,e);if(a>Dp||a<Op){const r=bi(i,n,zp),f=a<Op?S.PI_OVER_TWO:-S.PI_OVER_TWO,c=ie.fromAxisAngle(r,f,v2),h=G.fromQuaternion(c,O2);return G.multiplyByVector(h,e,e),!0}return!1}const Mp=new oe,W2=new u,Up=new u;function Ws(e,t,n,i,o){const a=oe.toCartesian(t,e._ellipsoid,W2);let r=u.add(a,n,Up),f=!1;const c=e._ellipsoid;let h=c.cartesianToCartographic(r,Mp);Math.abs(t.longitude-h.longitude)>S.PI_OVER_TWO&&(f=!0,r=u.subtract(a,n,Up),h=c.cartesianToCartographic(r,Mp)),h.height=0;const d=e.project(h,o);return o=u.subtract(d,i,o),o.z=0,o=u.normalize(o,o),f&&u.negate(o,o),o}const P2=new u,kp=new u;function Vp(e,t,n,i,o,a){const r=u.subtract(t,e,P2);u.normalize(r,r);const f=n-vp;let c=u.multiplyByScalar(r,f,kp);u.add(e,c,o);const h=i-Wp;c=u.multiplyByScalar(r,h,kp),u.add(t,c,a)}const B2=new u;function Aa(e,t){const n=Me.getPointDistance(ya,e),i=Me.getPointDistance(ya,t);let o=B2;S.equalsEpsilon(n,0,S.EPSILON2)?(o=bi(t,e,o),u.multiplyByScalar(o,S.EPSILON2,o),u.add(e,o,e)):S.equalsEpsilon(i,0,S.EPSILON2)&&(o=bi(e,t,o),u.multiplyByScalar(o,S.EPSILON2,o),u.add(t,o,t))}function R2(e,t){const n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(S.equalsEpsilon(n,S.PI,S.EPSILON11)){const o=S.sign(t.longitude);return e.longitude=o*(n-S.EPSILON11),1}else if(S.equalsEpsilon(i,S.PI,S.EPSILON11)){const o=S.sign(e.longitude);return t.longitude=o*(i-S.EPSILON11),2}return 0}const Gp=new oe,qp=new oe,Hp=new u,Rh=new u,jp=new u,Yp=new u,z2=new u,Xp=new u,L2=[Gp,qp],N2=new de,F2=new u,M2=new u,U2=new u,k2=new u,V2=new u,G2=new u,zh=new u,Lh=new u,q2=new u,H2=new u,j2=new u,$p=new u,Y2=new u,X2=new u,$2=new Qe,Z2=new Qe,Zp=new u,K2=new u,Kp=new u,Q2=[new te,new te],Qp=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Jp=Qp.length;function J2(e,t,n,i,o,a,r){let f,c;const h=t._ellipsoid,d=n.length/3-1,p=d*8,m=p*4,T=d*36,y=p>65535?new Uint32Array(T):new Uint16Array(T),w=new Float64Array(p*3),A=new Float32Array(m),E=new Float32Array(m),b=new Float32Array(m),I=new Float32Array(m),O=new Float32Array(m);let B,L,F,N;r&&(B=new Float32Array(m),L=new Float32Array(m),F=new Float32Array(m),N=new Float32Array(p*2));const U=a.length/2;let M=0;const j=Gp;j.height=0;const Y=qp;Y.height=0;let s=Hp,x=Rh;if(r)for(c=0,f=1;f<U;f++)j.latitude=a[c],j.longitude=a[c+1],Y.latitude=a[c+2],Y.longitude=a[c+3],s=t.project(j,s),x=t.project(Y,x),M+=u.distance(s,x),c+=2;const P=i.length/3;x=u.unpack(i,0,x);let z=0;for(c=3,f=1;f<P;f++)s=u.clone(x,s),x=u.unpack(i,c,x),z+=u.distance(s,x),c+=3;let H;c=3;let X=0,ee=0,K=0,ce=0,le=!1,we=u.unpack(n,0,Yp),Se=u.unpack(i,0,Rh),Ee=u.unpack(o,0,Xp);if(e){const Et=u.unpack(n,n.length-6,jp);Fp(Ee,Et,we,Se)&&(Ee=u.negate(Ee,Ee))}let Le=0,Ke=0,ct=0;for(f=0;f<d;f++){const Et=u.clone(we,jp),pn=u.clone(Se,Hp);let mn=u.clone(Ee,z2);le&&(mn=u.negate(mn,mn)),we=u.unpack(n,c,Yp),Se=u.unpack(i,c,Rh),Ee=u.unpack(o,c,Xp),le=Fp(Ee,Et,we,Se),j.latitude=a[X],j.longitude=a[X+1],Y.latitude=a[X+2],Y.longitude=a[X+3];let Yn,Qo,Zi,Ki;if(r){const Tt=R2(j,Y);Yn=t.project(j,V2),Qo=t.project(Y,G2);const es=bi(Qo,Yn,Zp);es.y=Math.abs(es.y),Zi=zh,Ki=Lh,Tt===0||u.dot(es,u.UNIT_Y)>Dp?(Zi=Ws(t,j,mn,Yn,zh),Ki=Ws(t,Y,Ee,Qo,Lh)):Tt===1?(Ki=Ws(t,Y,Ee,Qo,Lh),Zi.x=0,Zi.y=S.sign(j.longitude-Math.abs(Y.longitude)),Zi.z=0):(Zi=Ws(t,j,mn,Yn,zh),Ki.x=0,Ki.y=S.sign(j.longitude-Y.longitude),Ki.z=0)}const R0=u.distance(pn,Se),z0=Qe.fromCartesian(Et,$2),Ba=u.subtract(we,Et,q2),Gx=u.normalize(Ba,$p);let cr=u.subtract(pn,Et,H2);cr=u.normalize(cr,cr);let Jo=u.cross(Gx,cr,$p);Jo=u.normalize(Jo,Jo);let Ra=u.cross(cr,mn,Y2);Ra=u.normalize(Ra,Ra);let za=u.subtract(Se,we,j2);za=u.normalize(za,za);let La=u.cross(Ee,za,X2);La=u.normalize(La,La);const qx=R0/z,Hx=Le/z;let Tf=0,hr,Na,yo,L0=0,N0=0;if(r){Tf=u.distance(Yn,Qo),hr=Qe.fromCartesian(Yn,Z2),Na=u.subtract(Qo,Yn,Zp),yo=u.normalize(Na,K2);const Tt=yo.x;yo.x=yo.y,yo.y=-Tt,L0=Tf/M,N0=Ke/M}for(H=0;H<8;H++){const Tt=ce+H*4,es=ee+H*2,fr=Tt+3,M0=H<4?1:-1,Fa=H===2||H===3||H===6||H===7?1:-1;u.pack(z0.high,A,Tt),A[fr]=Ba.x,u.pack(z0.low,E,Tt),E[fr]=Ba.y,u.pack(Ra,b,Tt),b[fr]=Ba.z,u.pack(La,I,Tt),I[fr]=qx*M0,u.pack(Jo,O,Tt);let Co=Hx*Fa;Co===0&&Fa<0&&(Co=9),O[fr]=Co,r&&(B[Tt]=hr.high.x,B[Tt+1]=hr.high.y,B[Tt+2]=hr.low.x,B[Tt+3]=hr.low.y,F[Tt]=-Zi.y,F[Tt+1]=Zi.x,F[Tt+2]=Ki.y,F[Tt+3]=-Ki.x,L[Tt]=Na.x,L[Tt+1]=Na.y,L[Tt+2]=yo.x,L[Tt+3]=yo.y,N[es]=L0*M0,Co=N0*Fa,Co===0&&Fa<0&&(Co=9),N[es+1]=Co)}const Di=U2,Oi=k2,vi=F2,Wi=M2,jx=de.fromCartographicArray(L2,N2),F0=Ve.getMinimumMaximumHeights(jx,h),yf=F0.minimumTerrainHeight,Cf=F0.maximumTerrainHeight;ct+=Math.abs(yf),ct+=Math.abs(Cf),Vp(Et,pn,yf,Cf,Di,vi),Vp(we,Se,yf,Cf,Oi,Wi);let Pi=u.multiplyByScalar(Jo,S.EPSILON5,Kp);u.add(Di,Pi,Di),u.add(Oi,Pi,Oi),u.add(vi,Pi,vi),u.add(Wi,Pi,Wi),Aa(Di,Oi),Aa(vi,Wi),u.pack(Di,w,K),u.pack(Oi,w,K+3),u.pack(Wi,w,K+6),u.pack(vi,w,K+9),Pi=u.multiplyByScalar(Jo,-2*S.EPSILON5,Kp),u.add(Di,Pi,Di),u.add(Oi,Pi,Oi),u.add(vi,Pi,vi),u.add(Wi,Pi,Wi),Aa(Di,Oi),Aa(vi,Wi),u.pack(Di,w,K+12),u.pack(Oi,w,K+15),u.pack(Wi,w,K+18),u.pack(vi,w,K+21),X+=2,c+=3,ee+=16,K+=24,ce+=32,Le+=R0,Ke+=Tf}c=0;let gt=0;for(f=0;f<d;f++){for(H=0;H<Jp;H++)y[c+H]=Qp[H]+gt;gt+=8,c+=Jp}const Fe=Q2;te.fromVertices(n,u.ZERO,3,Fe[0]),te.fromVertices(i,u.ZERO,3,Fe[1]);const At=te.fromBoundingSpheres(Fe);At.radius+=ct/(d*2);const Wt={position:new Ft({componentDatatype:he.DOUBLE,componentsPerAttribute:3,normalize:!1,values:w}),startHiAndForwardOffsetX:Yi(A),startLoAndForwardOffsetY:Yi(E),startNormalAndForwardOffsetZ:Yi(b),endNormalAndTextureCoordinateNormalizationX:Yi(I),rightNormalAndTextureCoordinateNormalizationY:Yi(O)};return r&&(Wt.startHiLo2D=Yi(B),Wt.offsetAndRight2D=Yi(L),Wt.startEndNormals2D=Yi(F),Wt.texcoordNormalization2D=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:2,normalize:!1,values:N})),new mt({attributes:Wt,indices:y,boundingSphere:At})}function Yi(e){return new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}ji._projectNormal=Ws;const eE=`in vec4 v_startPlaneNormalEcAndHalfWidth;
4953
+ `)}}function GA(e,t){const n=t.context,i=e._primitive;let o=HC;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Pe._appendDistanceDisplayConditionToShader(i,o),o=Pe._modifyShaderPosition(e,o,t.scene3DOnly),o=Pe._updateColorAttribute(i,o);const a=e._hasPlanarExtentsAttributes,r=a||e._hasSphericalExtentsAttribute;e._extruded&&(o=VA(i,o));const f=e._extruded?"EXTRUDED_GEOMETRY":"";let c=new Ae({defines:[f],sources:[o]});const h=new Ae({sources:[jC]}),d=e._primitive._attributeLocations,p=new qt(r,a,e.appearance);if(e._spStencil=lt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:h,attributeLocations:d}),e._primitive.allowPicking){let y=Ae.createPickVertexShaderSource(o);y=Pe._appendShowToShader(i,y),y=Pe._updatePickColorAttribute(y);const w=p.createPickFragmentShader(!1),A=p.createPickVertexShader([f],y,!1,t.mapProjection);if(e._spPick=lt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:A,fragmentShaderSource:w,attributeLocations:d}),r){let E=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(E)){const b=p.createPickFragmentShader(!0),D=p.createPickVertexShader([f],y,!0,t.mapProjection);E=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:D,fragmentShaderSource:b,attributeLocations:d})}e._spPick2D=E}}else e._spPick=lt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:h,attributeLocations:d});o=Pe._appendShowToShader(i,o),c=new Ae({defines:[f],sources:[o]}),e._sp=lt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:h,attributeLocations:d});const m=p.createFragmentShader(!1),T=p.createVertexShader([f],o,!1,t.mapProjection);if(e._spColor=lt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:T,fragmentShaderSource:m,attributeLocations:d}),r){let y=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(y)){const w=p.createFragmentShader(!0),A=p.createVertexShader([f],o,!0,t.mapProjection);y=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:A,fragmentShaderSource:w,attributeLocations:d})}e._spColor2D=y}}function qA(e,t){const n=e._primitive;let i=n._va.length*2;t.length=i;let o,a,r,f=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap);const h=e._needs2DShader;for(o=0;o<i;o+=2){const T=n._va[f++];a=t[o],l(a)||(a=t[o]=new et({owner:e,primitiveType:n._primitiveType})),a.vertexArray=T,a.renderState=e._rsStencilDepthPass,a.shaderProgram=e._sp,a.uniformMap=c,a.pass=Nt.TERRAIN_CLASSIFICATION,r=et.shallowClone(a,a.derivedCommands.tileset),r.renderState=e._rsStencilDepthPass3DTiles,r.pass=Nt.CESIUM_3D_TILE_CLASSIFICATION,a.derivedCommands.tileset=r,a=t[o+1],l(a)||(a=t[o+1]=new et({owner:e,primitiveType:n._primitiveType})),a.vertexArray=T,a.renderState=e._rsColorPass,a.shaderProgram=e._spColor,a.pass=Nt.TERRAIN_CLASSIFICATION;const w=e.appearance.material;if(l(w)&&(c=hn(c,w._uniforms)),a.uniformMap=c,r=et.shallowClone(a,a.derivedCommands.tileset),r.pass=Nt.CESIUM_3D_TILE_CLASSIFICATION,a.derivedCommands.tileset=r,h){let A=et.shallowClone(a,a.derivedCommands.appearance2D);A.shaderProgram=e._spColor2D,a.derivedCommands.appearance2D=A,A=et.shallowClone(r,r.derivedCommands.appearance2D),A.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=A}}const d=e._commandsIgnoreShow,p=e._spStencil;let m=0;i=d.length=i/2;for(let T=0;T<i;++T){const y=d[T]=et.shallowClone(t[m],d[T]);y.shaderProgram=p,y.pass=Nt.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,m+=2}}function HA(e,t){const n=e._usePickOffsets,i=e._primitive;let o=i._va.length*2,a,r=0,f;n&&(a=i._pickOffsets,o=a.length*2),t.length=o;let c,h,d,p=0;const m=i._batchTable.getUniformMapCallback()(e._uniformMap),T=e._needs2DShader;for(c=0;c<o;c+=2){let y=i._va[p++];if(n&&(f=a[r++],y=i._va[f.index]),h=t[c],l(h)||(h=t[c]=new et({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),h.vertexArray=y,h.renderState=e._rsStencilDepthPass,h.shaderProgram=e._sp,h.uniformMap=m,h.pass=Nt.TERRAIN_CLASSIFICATION,n&&(h.offset=f.offset,h.count=f.count),d=et.shallowClone(h,h.derivedCommands.tileset),d.renderState=e._rsStencilDepthPass3DTiles,d.pass=Nt.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=d,h=t[c+1],l(h)||(h=t[c+1]=new et({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),h.vertexArray=y,h.renderState=e._rsPickPass,h.shaderProgram=e._spPick,h.uniformMap=m,h.pass=Nt.TERRAIN_CLASSIFICATION,n&&(h.offset=f.offset,h.count=f.count),d=et.shallowClone(h,h.derivedCommands.tileset),d.pass=Nt.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=d,T){let w=et.shallowClone(h,h.derivedCommands.pick2D);w.shaderProgram=e._spPick2D,h.derivedCommands.pick2D=w,w=et.shallowClone(d,d.derivedCommands.pick2D),w.shaderProgram=e._spPick2D,d.derivedCommands.pick2D=w}}}function jA(e,t,n,i,o,a,r){qA(e,a),HA(e,r)}function Tp(e,t){return Math.floor(e%t/2)}function Eh(e,t,n,i,o,a){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=a,t.commandList.push(e)}function yp(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function YA(e,t,n,i,o,a,r,f){const c=e._primitive;Pe._updateBoundingVolumes(c,t,o);let h;t.mode===ye.SCENE3D?h=c._boundingSphereWC:t.mode===ye.COLUMBUS_VIEW?h=c._boundingSphereCV:t.mode===ye.SCENE2D&&l(c._boundingSphere2D)?h=c._boundingSphere2D:l(c._boundingSphereMorph)&&(h=c._boundingSphereMorph);const d=e.classificationType,p=d!==wi.CESIUM_3D_TILE,m=d!==wi.TERRAIN,T=t.passes;let y,w,A;if(T.render){const E=n.length;for(y=0;y<E;++y)w=h[Tp(y,E)],p&&(A=n[y],Eh(A,t,o,a,w,r)),m&&(A=n[y].derivedCommands.tileset,Eh(A,t,o,a,w,r));if(t.invertClassification){const b=e._commandsIgnoreShow,D=b.length;for(y=0;y<D;++y)w=h[y],A=b[y],Eh(A,t,o,a,w,r)}}if(T.pick){const E=i.length,b=c._pickOffsets;for(y=0;y<E;++y){const D=b[Tp(y,E)];w=h[D.index],p&&(A=i[y],yp(A,t,o,a,w)),m&&(A=i[y].derivedCommands.tileset,yp(A,t,o,a,w))}}}Hi.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);const n=this,i=this._primitiveOptions;if(!l(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],a=o.length;let r,f,c,h=!1,d=!0,p,m=!1,T=!1;for(a>0&&(c=o[0].attributes,m=qt.hasAttributesForSphericalExtents(c),T=qt.hasAttributesForTextureCoordinatePlanes(c),p=c.color),r=0;r<a;r++){f=o[r];const w=f.attributes.color;if(l(w))h=!0;else if(h)throw new C("All GeometryInstances must have color attributes to use per-instance color.");d=d&&l(w)&&Lo.equals(p,w)}if(!d&&!m&&!T)throw new C("All GeometryInstances must have the same color attribute except via GroundPrimitives");if(h&&!l(t)&&(t=new Kt({flat:!0}),this.appearance=t),!h&&t instanceof Kt)throw new C("PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances");if(l(t.material)&&!m&&!T)throw new C("Materials on ClassificationPrimitives are not supported except via GroundPrimitives");this._usePickOffsets=!m&&!T,this._hasSphericalExtentsAttribute=m,this._hasPlanarExtentsAttributes=T,this._hasPerColorAttribute=h;const y=new Array(a);for(r=0;r<a;++r)f=o[r],y[r]=new na({geometry:f.geometry,attributes:f.attributes,modelMatrix:f.modelMatrix,id:f.id,pickPrimitive:g(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=y,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(w,A){n._createBoundingVolumeFunction(w,A)}),i._createRenderStatesFunction=function(w,A,E,b){kA(n)},i._createShaderProgramFunction=function(w,A,E){GA(n,A)},i._createCommandsFunction=function(w,A,E,b,D,O,B){jA(n,void 0,void 0,!0,!1,O,B)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(w,A,E,b,D,O,B,L){n._updateAndQueueCommandsFunction(w,A,E,b,D,O,B,L)}:i._updateAndQueueCommandsFunction=function(w,A,E,b,D,O,B,L){YA(n,A,E,b,D,O,B)},this._primitive=new Pe(i)}if(this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=je.fromCache(jo(!1,!1)),this._rsStencilDepthPass3DTiles=je.fromCache(jo(!1,!0)),this._rsColorPass=je.fromCache(Ah(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=je.fromCache(jo(!0,!1)),this._rsStencilDepthPass3DTiles=je.fromCache(jo(!0,!0)),this._rsColorPass=je.fromCache(Ah(!0))),this._primitive.appearance!==t){if(!this._hasSphericalExtentsAttribute&&!this._hasPlanarExtentsAttributes&&l(t.material))throw new C("Materials on ClassificationPrimitives are not supported except via GroundPrimitive");if(!this._hasPerColorAttribute&&t instanceof Kt)throw new C("PerInstanceColorAppearance requires color GeometryInstanceAttribute");this._primitive.appearance=t}this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},Hi.prototype.getGeometryInstanceAttributes=function(e){if(!l(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},Hi.prototype.isDestroyed=function(){return!1},Hi.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,st(this)};const XA={u_globeMinimumAltitude:function(){return 55e3}};function un(e){e=g(e,g.EMPTY_OBJECT);let t=e.appearance;const n=e.geometryInstances;if(!l(t)&&l(n)){const o=Array.isArray(n)?n:[n],a=o.length;for(let r=0;r<a;r++){const f=o[r].attributes;if(l(f)&&l(f.color)){t=new Kt({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=g(e.show,!0),this.classificationType=g(e.classificationType,wi.BOTH),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=g(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=Ve._defaultMaxTerrainHeight,this._minTerrainHeight=Ve._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;const i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:g(e.vertexCacheOptimize,!1),interleave:g(e.interleave,!1),releaseGeometryInstances:g(e.releaseGeometryInstances,!0),allowPicking:g(e.allowPicking,!0),asynchronous:g(e.asynchronous,!0),compressVertices:g(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:XA}}Object.defineProperties(un.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}}),un.isSupported=Hi.isSupported;function Cp(e){return function(t,n){const i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function wp(e){return function(t,n){return e._minHeight}}const $A=new u,ZA=new u,KA=new u,QA=new oe,JA=new de;function Ta(e,t){const n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;const i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,a=i.length;let r=Number.POSITIVE_INFINITY,f=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(let p=0;p<a;p+=3){const m=u.unpack(i,p,$A),T=u.unpack(o,p,ZA),y=u.add(m,T,KA),w=n.cartesianToCartographic(y,QA),A=w.latitude,E=w.longitude;r=Math.min(r,A),f=Math.min(f,E),c=Math.max(c,A),h=Math.max(h,E)}const d=JA;return d.north=c,d.south=r,d.east=h,d.west=f,d}function e2(e,t,n){const i=Ve.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function t2(e,t,n){const i=t.mapProjection.ellipsoid,o=Ta(t,n),a=ze.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(a),!t.scene3DOnly){const r=t.mapProjection,f=te.fromRectangleWithHeights2D(o,r,e._maxHeight,e._minHeight);u.fromElements(f.center.z,f.center.x,f.center.y,f.center),e._boundingVolumes2D.push(f)}}function bh(e,t){return Math.floor(e%t/2)}function xh(e,t,n,i,o,a,r){const f=e._primitive;n.mode!==ye.SCENE3D&&t.shaderProgram===f._spColor&&f._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=a,t.cull=o,t.debugShowBoundingVolume=r,n.commandList.push(t)}function Ap(e,t,n,i,o,a){const r=e._primitive;n.mode!==ye.SCENE3D&&t.shaderProgram===r._spPick&&r._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=a,t.cull=o,n.commandList.push(t)}function n2(e,t,n,i,o,a,r,f){let c;t.mode===ye.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;const h=e.classificationType,d=h!==wi.CESIUM_3D_TILE,p=h!==wi.TERRAIN,m=t.passes,T=e._primitive;let y,w,A;if(m.render){const E=n.length;for(y=0;y<E;++y)w=c[bh(y,E)],d&&(A=n[y],xh(e,A,t,o,a,w,r)),p&&(A=n[y].derivedCommands.tileset,xh(e,A,t,o,a,w,r));if(t.invertClassification){const b=T._commandsIgnoreShow,D=b.length;for(y=0;y<D;++y)w=c[y],A=b[y],xh(e,A,t,o,a,w,r)}}if(m.pick){const E=i.length;let b;for(e._useFragmentCulling||(b=T._primitive._pickOffsets),y=0;y<E;++y){if(w=c[bh(y,E)],!e._useFragmentCulling){const D=b[bh(y,E)];w=c[D.index]}d&&(A=i[y],Ap(e,A,t,o,a,w)),p&&(A=i[y].derivedCommands.tileset,Ap(e,A,t,o,a,w))}}}un.initializeTerrainHeights=function(){return Ve.initialize()},un.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ve.initialized){if(!this.asynchronous)throw new C("For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.");un.initializeTerrainHeights();return}const t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){const i=e.mapProjection.ellipsoid;let o,a,r;const f=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=f.length,h=new Array(c);let d,p;for(d=0;d<c;++d){o=f[d],a=o.geometry;const w=Ta(e,a);l(p)?l(w)&&de.union(p,w,p):p=de.clone(w);const A=o.id;if(l(A)&&l(w)){const E=Ve.getBoundingSphere(w,i);this._boundingSpheresKeys.push(A),this._boundingSpheres.push(E)}if(r=a.constructor,!l(r)||!l(r.createShadowVolume))throw new C("Not all of the geometry instances have GroundPrimitive support.")}e2(this,p,i);const m=e.verticalExaggeration,T=e.verticalExaggerationRelativeHeight;this._minHeight=As.getHeight(this._minTerrainHeight,m,T),this._maxHeight=As.getHeight(this._maxTerrainHeight,m,T);const y=un._supportsMaterials(e.context);if(this._useFragmentCulling=y,y){let w,A=!0;for(d=0;d<c;++d)if(o=f[d],a=o.geometry,p=Ta(e,a),qt.shouldUseSphericalCoordinates(p)){A=!1;break}for(d=0;d<c;++d){o=f[d],a=o.geometry,r=a.constructor;const E=Ta(e,a),b=a.textureCoordinateRotationPoints;A?w=qt.getPlanarTextureCoordinateAttributes(E,b,i,e.mapProjection,this._maxHeight):w=qt.getSphericalExtentGeometryInstanceAttributes(E,b,i,e.mapProjection);const D=o.attributes;for(const O in D)D.hasOwnProperty(O)&&(w[O]=D[O]);h[d]=new na({geometry:r.createShadowVolume(a,wp(this),Cp(this)),attributes:w,id:o.id})}}else for(d=0;d<c;++d)o=f[d],a=o.geometry,r=a.constructor,h[d]=new na({geometry:r.createShadowVolume(a,wp(this),Cp(this)),attributes:o.attributes,id:o.id});n.geometryInstances=h,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(w,A){t2(t,w,A)},n._updateAndQueueCommandsFunction=function(w,A,E,b,D,O,B,L){n2(t,A,E,b,D,O,B)},this._primitive=new Hi(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},un.prototype.getBoundingSphere=function(e){const t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]},un.prototype.getGeometryInstanceAttributes=function(e){if(!l(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},un.prototype.isDestroyed=function(){return!1},un.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),st(this)},un._supportsMaterials=function(e){return e.depthTexture},un.supportsMaterials=function(e){return _.typeOf.object("scene",e),un._supportsMaterials(e.frameState.context)};const ai=Object.freeze({NONE:0,GEODESIC:1,RHUMB:2}),Ep=S.EPSILON10;function i2(e,t,n,i){if(_.defined("equalsEpsilon",t),!l(e))return;n=g(n,!1);const o=l(i),a=e.length;if(a<2)return e;let r,f=e[0],c,h,d=0,p=-1;for(r=1;r<a;++r)c=e[r],t(f,c,Ep)?(l(h)||(h=e.slice(0,r),d=r-1,p=0),o&&i.push(r)):(l(h)&&(h.push(c),d=r,o&&(p=i.length)),f=c);return n&&t(e[0],e[a-1],Ep)&&(o&&(l(h)?i.splice(p,0,d):i.push(a-1)),l(h)?h.length-=1:h=e.slice(0,-1)),l(h)?h:e}function o2(e){const t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,a=Math.cos(e._startHeading),r=Math.sin(e._startHeading),f=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+f*f),h=c*f,d=Math.atan2(f,a),p=c*r,m=p*p,T=1-m,y=Math.sqrt(T),w=t/4,A=w*w,E=A*w,b=A*A,D=1+w-3*A/4+5*E/4-175*b/64,O=1-w+15*A/8-35*E/8,B=1-3*w+35*A/4,L=1-5*w,F=D*d-O*Math.sin(2*d)*w/2-B*Math.sin(4*d)*A/16-L*Math.sin(6*d)*E/48-Math.sin(8*d)*5*b/512,N=e._constants;N.a=n,N.b=i,N.f=o,N.cosineHeading=a,N.sineHeading=r,N.tanU=f,N.cosineU=c,N.sineU=h,N.sigma=d,N.sineAlpha=p,N.sineSquaredAlpha=m,N.cosineSquaredAlpha=T,N.cosineAlpha=y,N.u2Over4=w,N.u4Over16=A,N.u6Over64=E,N.u8Over256=b,N.a0=D,N.a1=O,N.a2=B,N.a3=L,N.distanceRatio=F}function s2(e,t){return e*t*(4+e*(4-3*t))/16}function bp(e,t,n,i,o,a,r){const f=s2(e,n);return(1-f)*e*t*(i+f*o*(r+f*a*(2*r*r-1)))}function r2(e,t,n,i,o,a,r){const f=(t-n)/t,c=a-i,h=Math.atan((1-f)*Math.tan(o)),d=Math.atan((1-f)*Math.tan(r)),p=Math.cos(h),m=Math.sin(h),T=Math.cos(d),y=Math.sin(d),w=p*T,A=p*y,E=m*y,b=m*T;let D=c,O=S.TWO_PI,B=Math.cos(D),L=Math.sin(D),F,N,U,M,j;do{B=Math.cos(D),L=Math.sin(D);const K=A-b*B;U=Math.sqrt(T*T*L*L+K*K),N=E+w*B,F=Math.atan2(U,N);let ce;U===0?(ce=0,M=1):(ce=w*L/U,M=1-ce*ce),O=D,j=N-2*E/M,isFinite(j)||(j=0),D=c+bp(f,ce,M,F,U,N,j)}while(Math.abs(D-O)>S.EPSILON12);const Y=M*(t*t-n*n)/(n*n),s=1+Y*(4096+Y*(Y*(320-175*Y)-768))/16384,x=Y*(256+Y*(Y*(74-47*Y)-128))/1024,P=j*j,z=x*U*(j+x*(N*(2*P-1)-x*j*(4*U*U-3)*(4*P-3)/6)/4),H=n*s*(F-z),X=Math.atan2(T*L,A-b*B),ee=Math.atan2(p*L,A*B-b);e._distance=H,e._startHeading=X,e._endHeading=ee,e._uSquared=Y}const a2=new u,Sh=new u;function xp(e,t,n,i){const o=u.normalize(i.cartographicToCartesian(t,Sh),a2),a=u.normalize(i.cartographicToCartesian(n,Sh),Sh);_.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(u.angleBetween(o,a))-Math.PI),.0125),r2(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=oe.clone(t,e._start),e._end=oe.clone(n,e._end),e._start.height=0,e._end.height=0,o2(e)}function vs(e,t,n){const i=g(n,pe.default);this._ellipsoid=i,this._start=new oe,this._end=new oe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&xp(this,e,t,i)}Object.defineProperties(vs.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return _.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return _.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return _.defined("distance",this._distance),this._endHeading}}}),vs.prototype.setEndPoints=function(e,t){_.defined("start",e),_.defined("end",t),xp(this,e,t,this._ellipsoid)},vs.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},vs.prototype.interpolateUsingSurfaceDistance=function(e,t){_.defined("distance",this._distance);const n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),a=Math.cos(4*i),r=Math.cos(6*i),f=Math.sin(2*i),c=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),p=i*i,m=i*p,T=n.u8Over256,y=n.u2Over4,w=n.u6Over64,A=n.u4Over16;let E=2*m*T*o/3+i*(1-y+7*A/4-15*w/4+579*T/64-(A-15*w/4+187*T/16)*o-(5*w/4-115*T/16)*a-29*T*r/16)+(y/2-A+71*w/32-85*T/16)*f+(5*A/16-5*w/4+383*T/96)*c-p*((w-11*T/2)*f+5*T*c/2)+(29*w/96-29*T/16)*h+539*T*d/1536;const b=Math.asin(Math.sin(E)*n.cosineAlpha),D=Math.atan(n.a/n.b*Math.tan(b));E=E-n.sigma;const O=Math.cos(2*n.sigma+E),B=Math.sin(E),L=Math.cos(E),F=n.cosineU*L,N=n.sineU*B,M=Math.atan2(B*n.sineHeading,F-N*n.cosineHeading)-bp(n.f,n.sineAlpha,n.cosineSquaredAlpha,E,B,L,O);return l(t)?(t.longitude=this._start.longitude+M,t.latitude=D,t.height=0,t):new oe(this._start.longitude+M,D,0)};function Ih(e,t,n){if(e===0)return t*n;const i=e*e,o=i*i,a=o*i,r=a*i,f=r*i,c=f*i,h=n,d=Math.sin(2*h),p=Math.sin(4*h),m=Math.sin(6*h),T=Math.sin(8*h),y=Math.sin(10*h),w=Math.sin(12*h);return t*((1-i/4-3*o/64-5*a/256-175*r/16384-441*f/65536-4851*c/1048576)*h-(3*i/8+3*o/32+45*a/1024+105*r/4096+2205*f/131072+6237*c/524288)*d+(15*o/256+45*a/1024+525*r/16384+1575*f/65536+155925*c/8388608)*p-(35*a/3072+175*r/12288+3675*f/262144+13475*c/1048576)*m+(315*r/131072+2205*f/524288+43659*c/8388608)*T-(693*f/1310720+6237*c/5242880)*y+1001*c/8388608*w)}function c2(e,t,n){const i=e/n;if(t===0)return i;const o=i*i,a=o*i,r=a*i,f=t,c=f*f,h=c*c,d=h*c,p=d*c,m=p*c,T=m*c,y=Math.sin(2*i),w=Math.cos(2*i),A=Math.sin(4*i),E=Math.cos(4*i),b=Math.sin(6*i),D=Math.cos(6*i),O=Math.sin(8*i),B=Math.cos(8*i),L=Math.sin(10*i),F=Math.cos(10*i),N=Math.sin(12*i);return i+i*c/4+7*i*h/64+15*i*d/256+579*i*p/16384+1515*i*m/65536+16837*i*T/1048576+(3*i*h/16+45*i*d/256-i*(32*o-561)*p/4096-i*(232*o-1677)*m/16384+i*(399985-90560*o+512*r)*T/5242880)*w+(21*i*d/256+483*i*p/4096-i*(224*o-1969)*m/16384-i*(33152*o-112599)*T/1048576)*E+(151*i*p/4096+4681*i*m/65536+1479*i*T/16384-453*a*T/32768)*D+(1097*i*m/65536+42783*i*T/1048576)*B+8011*i*T/1048576*F+(3*c/8+3*h/16+213*d/2048-3*o*d/64+255*p/4096-33*o*p/512+20861*m/524288-33*o*m/512+r*m/1024+28273*T/1048576-471*o*T/8192+9*r*T/4096)*y+(21*h/256+21*d/256+533*p/8192-21*o*p/512+197*m/4096-315*o*m/4096+584039*T/16777216-12517*o*T/131072+7*r*T/2048)*A+(151*d/6144+151*p/4096+5019*m/131072-453*o*m/16384+26965*T/786432-8607*o*T/131072)*b+(1097*p/131072+1097*m/65536+225797*T/10485760-1097*o*T/65536)*O+(8011*m/2621440+8011*T/1048576)*L+293393*T/251658240*N}function Yo(e,t){if(e===0)return Math.log(Math.tan(.5*(S.PI_OVER_TWO+t)));const n=e*Math.sin(t);return Math.log(Math.tan(.5*(S.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function h2(e,t,n,i,o){const a=Yo(e._ellipticity,n),r=Yo(e._ellipticity,o);return Math.atan2(S.negativePiToPi(i-t),r-a)}function f2(e,t,n,i,o,a,r){const f=e._heading,c=a-i;let h=0;if(S.equalsEpsilon(Math.abs(f),S.PI_OVER_TWO,S.EPSILON8))if(t===n)h=t*Math.cos(o)*S.negativePiToPi(c);else{const d=Math.sin(o);h=t*Math.cos(o)*S.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*d*d)}else{const d=Ih(e._ellipticity,t,o);h=(Ih(e._ellipticity,t,r)-d)/Math.cos(f)}return Math.abs(h)}const l2=new u,Dh=new u;function Sp(e,t,n,i){const o=u.normalize(i.cartographicToCartesian(t,Dh),l2),a=u.normalize(i.cartographicToCartesian(n,Dh),Dh);_.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(u.angleBetween(o,a))-Math.PI),.0125);const r=i.maximumRadius,f=i.minimumRadius,c=r*r,h=f*f;e._ellipticitySquared=(c-h)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=oe.clone(t,e._start),e._start.height=0,e._end=oe.clone(n,e._end),e._end.height=0,e._heading=h2(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=f2(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Ip(e,t,n,i,o,a){if(n===0)return oe.clone(e,a);const r=o*o;let f,c,h;if(Math.abs(S.PI_OVER_TWO-Math.abs(t))>S.EPSILON8){const d=Ih(o,i,e.latitude),p=n*Math.cos(t),m=d+p;if(c=c2(m,o,i),Math.abs(t)<S.EPSILON10)f=S.negativePiToPi(e.longitude);else{const T=Yo(o,e.latitude),y=Yo(o,c);h=Math.tan(t)*(y-T),f=S.negativePiToPi(e.longitude+h)}}else{c=e.latitude;let d;if(o===0)d=i*Math.cos(e.latitude);else{const p=Math.sin(e.latitude);d=i*Math.cos(e.latitude)/Math.sqrt(1-r*p*p)}h=n/d,t>0?f=S.negativePiToPi(e.longitude+h):f=S.negativePiToPi(e.longitude-h)}return l(a)?(a.longitude=f,a.latitude=c,a.height=0,a):new oe(f,c,0)}function ci(e,t,n){const i=g(n,pe.default);this._ellipsoid=i,this._start=new oe,this._end=new oe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Sp(this,e,t,i)}Object.defineProperties(ci.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return _.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return _.defined("distance",this._distance),this._heading}}}),ci.fromStartHeadingDistance=function(e,t,n,i,o){_.defined("start",e),_.defined("heading",t),_.defined("distance",n),_.typeOf.number.greaterThan("distance",n,0);const a=g(i,pe.default),r=a.maximumRadius,f=a.minimumRadius,c=r*r,h=f*f,d=Math.sqrt((c-h)/c);t=S.negativePiToPi(t);const p=Ip(e,t,n,a.maximumRadius,d);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new ci(e,p,a):(o.setEndPoints(e,p),o)},ci.prototype.setEndPoints=function(e,t){_.defined("start",e),_.defined("end",t),Sp(this,e,t,this._ellipsoid)},ci.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)},ci.prototype.interpolateUsingSurfaceDistance=function(e,t){if(_.typeOf.number("distance",e),!l(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");return Ip(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)},ci.prototype.findIntersectionWithLongitude=function(e,t){if(_.typeOf.number("intersectionLongitude",e),!l(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");const n=this._ellipticity,i=this._heading,o=Math.abs(i),a=this._start;if(e=S.negativePiToPi(e),S.equalsEpsilon(Math.abs(e),Math.PI,S.EPSILON14)&&(e=S.sign(a.longitude)*Math.PI),l(t)||(t=new oe),Math.abs(S.PI_OVER_TWO-o)<=S.EPSILON8)return t.longitude=e,t.latitude=a.latitude,t.height=0,t;if(S.equalsEpsilon(Math.abs(S.PI_OVER_TWO-o),S.PI_OVER_TWO,S.EPSILON8))return S.equalsEpsilon(e,a.longitude,S.EPSILON12)?void 0:(t.longitude=e,t.latitude=S.PI_OVER_TWO*S.sign(S.PI_OVER_TWO-i),t.height=0,t);const r=a.latitude,f=n*Math.sin(r),c=Math.tan(.5*(S.PI_OVER_TWO+r))*Math.exp((e-a.longitude)/Math.tan(i)),h=(1+f)/(1-f);let d=a.latitude,p;do{p=d;const m=n*Math.sin(p),T=(1+m)/(1-m);d=2*Math.atan(c*Math.pow(T/h,n/2))-S.PI_OVER_TWO}while(!S.equalsEpsilon(d,p,S.EPSILON12));return t.longitude=e,t.latitude=d,t.height=0,t},ci.prototype.findIntersectionWithLatitude=function(e,t){if(_.typeOf.number("intersectionLatitude",e),!l(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");const n=this._ellipticity,i=this._heading,o=this._start;if(S.equalsEpsilon(Math.abs(i),S.PI_OVER_TWO,S.EPSILON8))return;const a=Yo(n,o.latitude),r=Yo(n,e),f=Math.tan(i)*(r-a),c=S.negativePiToPi(o.longitude+f);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new oe(c,e,0)};const Oh=[Wn,on],u2=Oh.length,Dp=Math.cos(S.toRadians(30)),Op=Math.cos(S.toRadians(150)),vp=0,Wp=1e3;function ji(e){e=g(e,g.EMPTY_OBJECT);const t=e.positions;if(!l(t)||t.length<2)throw new C("At least two positions are required.");if(l(e.arcType)&&e.arcType!==ai.GEODESIC&&e.arcType!==ai.RHUMB)throw new C("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=g(e.width,1),this._positions=t,this.granularity=g(e.granularity,9999),this.loop=g(e.loop,!1),this.arcType=g(e.arcType,ai.GEODESIC),this._ellipsoid=pe.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(ji.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+pe.packedLength+1+1}}}),ji.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<u2;i++)if(t instanceof Oh[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};const d2=new u,Pp=new u,Bp=new u;function vh(e,t,n,i,o){const a=sn(i,e,0,d2),r=sn(i,e,n,Pp),f=sn(i,t,0,Bp),c=bi(r,a,Pp),h=bi(f,a,Bp);return u.cross(h,c,o),u.normalize(o,o)}const p2=new oe,m2=new u,_2=new u,g2=new u;function Wh(e,t,n,i,o,a,r,f,c,h,d){if(o===0)return;let p;a===ai.GEODESIC?p=new vs(e,t,r):a===ai.RHUMB&&(p=new ci(e,t,r));const m=p.surfaceDistance;if(m<o)return;const T=vh(e,t,i,r,g2),y=Math.ceil(m/o),w=m/y;let A=w;const E=y-1;let b=f.length;for(let D=0;D<E;D++){const O=p.interpolateUsingSurfaceDistance(A,p2),B=sn(r,O,n,m2),L=sn(r,O,i,_2);u.pack(T,f,b),u.pack(B,c,b),u.pack(L,h,b),d.push(O.latitude),d.push(O.longitude),b+=3,A+=w}}const Ph=new oe;function sn(e,t,n,i){return oe.clone(t,Ph),Ph.height=n,oe.toCartesian(Ph,e,i)}ji.pack=function(e,t,n){_.typeOf.object("value",e),_.defined("array",t);let i=g(n,0);const o=e._positions,a=o.length;t[i++]=a;for(let r=0;r<a;++r){const f=o[r];u.pack(f,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,pe.pack(e._ellipsoid,t,i),i+=pe.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t},ji.unpack=function(e,t,n){_.defined("array",e);let i=g(t,0);const o=e[i++],a=new Array(o);for(let m=0;m<o;m++)a[m]=u.unpack(e,i),i+=3;const r=e[i++],f=e[i++]===1,c=e[i++],h=pe.unpack(e,i);i+=pe.packedLength;const d=e[i++],p=e[i++]===1;return l(n)||(n=new ji({positions:a})),n._positions=a,n.granularity=r,n.loop=f,n.arcType=c,n._ellipsoid=h,n._projectionIndex=d,n._scene3DOnly=p,n};function bi(e,t,n){return u.subtract(e,t,n),u.normalize(n,n),n}function Rp(e,t,n,i){return i=bi(e,t,i),i=u.cross(i,n,i),i=u.normalize(i,i),i=u.cross(n,i,i),i}const T2=new u,y2=new u,C2=new u,zp=new u,w2=0,A2=-1;function Bh(e,t,n,i,o){const a=bi(n,t,zp),r=Rp(e,t,a,T2),f=Rp(i,t,a,y2);if(S.equalsEpsilon(u.dot(r,f),A2,S.EPSILON5))return o=u.cross(a,r,o),o=u.normalize(o,o),o;o=u.add(f,r,o),o=u.normalize(o,o);const c=u.cross(a,o,C2);return u.dot(f,c)<w2&&(o=u.negate(o,o)),o}const ya=Me.fromPointNormal(u.ZERO,u.UNIT_Y),E2=new u,b2=new u,x2=new u,S2=new u,I2=new u,Ca=new u,wa=new oe,Lp=new oe,Np=new oe;ji.createGeometry=function(e){const t=!e._scene3DOnly;let n=e.loop;const i=e._ellipsoid,o=e.granularity,a=e.arcType,r=new Oh[e._projectionIndex](i),f=vp,c=Wp;let h,d;const p=e._positions,m=p.length;m===2&&(n=!1);let T,y,w,A;const E=new ci(void 0,void 0,i);let b,D,O;const B=[p[0]];for(d=0;d<m-1;d++)T=p[d],y=p[d+1],b=Ue.lineSegmentPlane(T,y,ya,Ca),l(b)&&!u.equalsEpsilon(b,T,S.EPSILON7)&&!u.equalsEpsilon(b,y,S.EPSILON7)&&(e.arcType===ai.GEODESIC?B.push(u.clone(b)):e.arcType===ai.RHUMB&&(O=i.cartesianToCartographic(b,wa).longitude,w=i.cartesianToCartographic(T,wa),A=i.cartesianToCartographic(y,Lp),E.setEndPoints(w,A),D=E.findIntersectionWithLongitude(O,Np),b=i.cartographicToCartesian(D,Ca),l(b)&&!u.equalsEpsilon(b,T,S.EPSILON7)&&!u.equalsEpsilon(b,y,S.EPSILON7)&&B.push(u.clone(b)))),B.push(y);n&&(T=p[m-1],y=p[0],b=Ue.lineSegmentPlane(T,y,ya,Ca),l(b)&&!u.equalsEpsilon(b,T,S.EPSILON7)&&!u.equalsEpsilon(b,y,S.EPSILON7)&&(e.arcType===ai.GEODESIC?B.push(u.clone(b)):e.arcType===ai.RHUMB&&(O=i.cartesianToCartographic(b,wa).longitude,w=i.cartesianToCartographic(T,wa),A=i.cartesianToCartographic(y,Lp),E.setEndPoints(w,A),D=E.findIntersectionWithLongitude(O,Np),b=i.cartographicToCartesian(D,Ca),l(b)&&!u.equalsEpsilon(b,T,S.EPSILON7)&&!u.equalsEpsilon(b,y,S.EPSILON7)&&B.push(u.clone(b)))));let L=B.length,F=new Array(L);for(d=0;d<L;d++){const le=oe.fromCartesian(B[d],i);le.height=0,F[d]=le}if(F=i2(F,oe.equalsEpsilon),L=F.length,L<2)return;const N=[],U=[],M=[],j=[];let Y=E2,s=b2,x=x2,P=S2,z=I2;const H=F[0],X=F[1],ee=F[L-1];for(Y=sn(i,ee,f,Y),P=sn(i,X,f,P),s=sn(i,H,f,s),x=sn(i,H,c,x),n?z=Bh(Y,s,x,P,z):z=vh(H,X,c,i,z),u.pack(z,U,0),u.pack(s,M,0),u.pack(x,j,0),N.push(H.latitude),N.push(H.longitude),Wh(H,X,f,c,o,a,i,U,M,j,N),d=1;d<L-1;++d){Y=u.clone(s,Y),s=u.clone(P,s);const le=F[d];sn(i,le,c,x),sn(i,F[d+1],f,P),Bh(Y,s,x,P,z),h=U.length,u.pack(z,U,h),u.pack(s,M,h),u.pack(x,j,h),N.push(le.latitude),N.push(le.longitude),Wh(F[d],F[d+1],f,c,o,a,i,U,M,j,N)}const K=F[L-1],ce=F[L-2];if(s=sn(i,K,f,s),x=sn(i,K,c,x),n){const le=F[0];Y=sn(i,ce,f,Y),P=sn(i,le,f,P),z=Bh(Y,s,x,P,z)}else z=vh(ce,K,c,i,z);if(h=U.length,u.pack(z,U,h),u.pack(s,M,h),u.pack(x,j,h),N.push(K.latitude),N.push(K.longitude),n){for(Wh(K,H,f,c,o,a,i,U,M,j,N),h=U.length,d=0;d<3;++d)U[h+d]=U[d],M[h+d]=M[d],j[h+d]=j[d];N.push(H.latitude),N.push(H.longitude)}return J2(n,r,M,j,U,N,t)};const D2=new u,O2=new G,v2=new ie;function Fp(e,t,n,i){const o=bi(n,t,D2),a=u.dot(o,e);if(a>Dp||a<Op){const r=bi(i,n,zp),f=a<Op?S.PI_OVER_TWO:-S.PI_OVER_TWO,c=ie.fromAxisAngle(r,f,v2),h=G.fromQuaternion(c,O2);return G.multiplyByVector(h,e,e),!0}return!1}const Mp=new oe,W2=new u,Up=new u;function Ws(e,t,n,i,o){const a=oe.toCartesian(t,e._ellipsoid,W2);let r=u.add(a,n,Up),f=!1;const c=e._ellipsoid;let h=c.cartesianToCartographic(r,Mp);Math.abs(t.longitude-h.longitude)>S.PI_OVER_TWO&&(f=!0,r=u.subtract(a,n,Up),h=c.cartesianToCartographic(r,Mp)),h.height=0;const d=e.project(h,o);return o=u.subtract(d,i,o),o.z=0,o=u.normalize(o,o),f&&u.negate(o,o),o}const P2=new u,kp=new u;function Vp(e,t,n,i,o,a){const r=u.subtract(t,e,P2);u.normalize(r,r);const f=n-vp;let c=u.multiplyByScalar(r,f,kp);u.add(e,c,o);const h=i-Wp;c=u.multiplyByScalar(r,h,kp),u.add(t,c,a)}const B2=new u;function Aa(e,t){const n=Me.getPointDistance(ya,e),i=Me.getPointDistance(ya,t);let o=B2;S.equalsEpsilon(n,0,S.EPSILON2)?(o=bi(t,e,o),u.multiplyByScalar(o,S.EPSILON2,o),u.add(e,o,e)):S.equalsEpsilon(i,0,S.EPSILON2)&&(o=bi(e,t,o),u.multiplyByScalar(o,S.EPSILON2,o),u.add(t,o,t))}function R2(e,t){const n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(S.equalsEpsilon(n,S.PI,S.EPSILON11)){const o=S.sign(t.longitude);return e.longitude=o*(n-S.EPSILON11),1}else if(S.equalsEpsilon(i,S.PI,S.EPSILON11)){const o=S.sign(e.longitude);return t.longitude=o*(i-S.EPSILON11),2}return 0}const Gp=new oe,qp=new oe,Hp=new u,Rh=new u,jp=new u,Yp=new u,z2=new u,Xp=new u,L2=[Gp,qp],N2=new de,F2=new u,M2=new u,U2=new u,k2=new u,V2=new u,G2=new u,zh=new u,Lh=new u,q2=new u,H2=new u,j2=new u,$p=new u,Y2=new u,X2=new u,$2=new Qe,Z2=new Qe,Zp=new u,K2=new u,Kp=new u,Q2=[new te,new te],Qp=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Jp=Qp.length;function J2(e,t,n,i,o,a,r){let f,c;const h=t._ellipsoid,d=n.length/3-1,p=d*8,m=p*4,T=d*36,y=p>65535?new Uint32Array(T):new Uint16Array(T),w=new Float64Array(p*3),A=new Float32Array(m),E=new Float32Array(m),b=new Float32Array(m),D=new Float32Array(m),O=new Float32Array(m);let B,L,F,N;r&&(B=new Float32Array(m),L=new Float32Array(m),F=new Float32Array(m),N=new Float32Array(p*2));const U=a.length/2;let M=0;const j=Gp;j.height=0;const Y=qp;Y.height=0;let s=Hp,x=Rh;if(r)for(c=0,f=1;f<U;f++)j.latitude=a[c],j.longitude=a[c+1],Y.latitude=a[c+2],Y.longitude=a[c+3],s=t.project(j,s),x=t.project(Y,x),M+=u.distance(s,x),c+=2;const P=i.length/3;x=u.unpack(i,0,x);let z=0;for(c=3,f=1;f<P;f++)s=u.clone(x,s),x=u.unpack(i,c,x),z+=u.distance(s,x),c+=3;let H;c=3;let X=0,ee=0,K=0,ce=0,le=!1,we=u.unpack(n,0,Yp),Se=u.unpack(i,0,Rh),Ee=u.unpack(o,0,Xp);if(e){const Et=u.unpack(n,n.length-6,jp);Fp(Ee,Et,we,Se)&&(Ee=u.negate(Ee,Ee))}let Le=0,Ke=0,ct=0;for(f=0;f<d;f++){const Et=u.clone(we,jp),pn=u.clone(Se,Hp);let mn=u.clone(Ee,z2);le&&(mn=u.negate(mn,mn)),we=u.unpack(n,c,Yp),Se=u.unpack(i,c,Rh),Ee=u.unpack(o,c,Xp),le=Fp(Ee,Et,we,Se),j.latitude=a[X],j.longitude=a[X+1],Y.latitude=a[X+2],Y.longitude=a[X+3];let jn,Qo,Zi,Ki;if(r){const Tt=R2(j,Y);jn=t.project(j,V2),Qo=t.project(Y,G2);const es=bi(Qo,jn,Zp);es.y=Math.abs(es.y),Zi=zh,Ki=Lh,Tt===0||u.dot(es,u.UNIT_Y)>Dp?(Zi=Ws(t,j,mn,jn,zh),Ki=Ws(t,Y,Ee,Qo,Lh)):Tt===1?(Ki=Ws(t,Y,Ee,Qo,Lh),Zi.x=0,Zi.y=S.sign(j.longitude-Math.abs(Y.longitude)),Zi.z=0):(Zi=Ws(t,j,mn,jn,zh),Ki.x=0,Ki.y=S.sign(j.longitude-Y.longitude),Ki.z=0)}const R0=u.distance(pn,Se),z0=Qe.fromCartesian(Et,$2),Ba=u.subtract(we,Et,q2),Gx=u.normalize(Ba,$p);let cr=u.subtract(pn,Et,H2);cr=u.normalize(cr,cr);let Jo=u.cross(Gx,cr,$p);Jo=u.normalize(Jo,Jo);let Ra=u.cross(cr,mn,Y2);Ra=u.normalize(Ra,Ra);let za=u.subtract(Se,we,j2);za=u.normalize(za,za);let La=u.cross(Ee,za,X2);La=u.normalize(La,La);const qx=R0/z,Hx=Le/z;let Tf=0,hr,Na,To,L0=0,N0=0;if(r){Tf=u.distance(jn,Qo),hr=Qe.fromCartesian(jn,Z2),Na=u.subtract(Qo,jn,Zp),To=u.normalize(Na,K2);const Tt=To.x;To.x=To.y,To.y=-Tt,L0=Tf/M,N0=Ke/M}for(H=0;H<8;H++){const Tt=ce+H*4,es=ee+H*2,fr=Tt+3,M0=H<4?1:-1,Fa=H===2||H===3||H===6||H===7?1:-1;u.pack(z0.high,A,Tt),A[fr]=Ba.x,u.pack(z0.low,E,Tt),E[fr]=Ba.y,u.pack(Ra,b,Tt),b[fr]=Ba.z,u.pack(La,D,Tt),D[fr]=qx*M0,u.pack(Jo,O,Tt);let yo=Hx*Fa;yo===0&&Fa<0&&(yo=9),O[fr]=yo,r&&(B[Tt]=hr.high.x,B[Tt+1]=hr.high.y,B[Tt+2]=hr.low.x,B[Tt+3]=hr.low.y,F[Tt]=-Zi.y,F[Tt+1]=Zi.x,F[Tt+2]=Ki.y,F[Tt+3]=-Ki.x,L[Tt]=Na.x,L[Tt+1]=Na.y,L[Tt+2]=To.x,L[Tt+3]=To.y,N[es]=L0*M0,yo=N0*Fa,yo===0&&Fa<0&&(yo=9),N[es+1]=yo)}const Di=U2,Oi=k2,vi=F2,Wi=M2,jx=de.fromCartographicArray(L2,N2),F0=Ve.getMinimumMaximumHeights(jx,h),yf=F0.minimumTerrainHeight,Cf=F0.maximumTerrainHeight;ct+=Math.abs(yf),ct+=Math.abs(Cf),Vp(Et,pn,yf,Cf,Di,vi),Vp(we,Se,yf,Cf,Oi,Wi);let Pi=u.multiplyByScalar(Jo,S.EPSILON5,Kp);u.add(Di,Pi,Di),u.add(Oi,Pi,Oi),u.add(vi,Pi,vi),u.add(Wi,Pi,Wi),Aa(Di,Oi),Aa(vi,Wi),u.pack(Di,w,K),u.pack(Oi,w,K+3),u.pack(Wi,w,K+6),u.pack(vi,w,K+9),Pi=u.multiplyByScalar(Jo,-2*S.EPSILON5,Kp),u.add(Di,Pi,Di),u.add(Oi,Pi,Oi),u.add(vi,Pi,vi),u.add(Wi,Pi,Wi),Aa(Di,Oi),Aa(vi,Wi),u.pack(Di,w,K+12),u.pack(Oi,w,K+15),u.pack(Wi,w,K+18),u.pack(vi,w,K+21),X+=2,c+=3,ee+=16,K+=24,ce+=32,Le+=R0,Ke+=Tf}c=0;let gt=0;for(f=0;f<d;f++){for(H=0;H<Jp;H++)y[c+H]=Qp[H]+gt;gt+=8,c+=Jp}const Fe=Q2;te.fromVertices(n,u.ZERO,3,Fe[0]),te.fromVertices(i,u.ZERO,3,Fe[1]);const At=te.fromBoundingSpheres(Fe);At.radius+=ct/(d*2);const Wt={position:new Ft({componentDatatype:he.DOUBLE,componentsPerAttribute:3,normalize:!1,values:w}),startHiAndForwardOffsetX:Yi(A),startLoAndForwardOffsetY:Yi(E),startNormalAndForwardOffsetZ:Yi(b),endNormalAndTextureCoordinateNormalizationX:Yi(D),rightNormalAndTextureCoordinateNormalizationY:Yi(O)};return r&&(Wt.startHiLo2D=Yi(B),Wt.offsetAndRight2D=Yi(L),Wt.startEndNormals2D=Yi(F),Wt.texcoordNormalization2D=new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:2,normalize:!1,values:N})),new mt({attributes:Wt,indices:y,boundingSphere:At})}function Yi(e){return new Ft({componentDatatype:he.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}ji._projectNormal=Ws;const eE=`in vec4 v_startPlaneNormalEcAndHalfWidth;
4954
4954
  in vec4 v_endPlaneNormalEcAndBatchId;
4955
4955
  in vec4 v_rightPlaneEC; // Technically can compute distance for this here
4956
4956
  in vec4 v_endEcAndStartEcX;
@@ -5693,7 +5693,7 @@ void main()
5693
5693
  `;let Fh=`${em}
5694
5694
  ${rE}`;const cE=aE;Ct.isInternetExplorer()||(Fh=`#define CLIP_POLYLINE
5695
5695
  ${Fh}`);function uo(e){e=g(e,g.EMPTY_OBJECT);const t=g(e.translucent,!0),n=!1,i=uo.VERTEX_FORMAT;this.material=l(e.material)?e.material:ne.fromType(ne.ColorType),this.translucent=t,this._vertexShaderSource=g(e.vertexShaderSource,Fh),this._fragmentShaderSource=g(e.fragmentShaderSource,cE),this._renderState=Gt.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(uo.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH
5696
- ${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),uo.VERTEX_FORMAT=ut.POSITION_AND_ST,uo.prototype.getFragmentShaderSource=Gt.prototype.getFragmentShaderSource,uo.prototype.isTranslucent=Gt.prototype.isTranslucent,uo.prototype.getRenderState=Gt.prototype.getRenderState;function xi(e){e=g(e,g.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new uo),this.appearance=t,this.show=g(e.show,!0),this.classificationType=g(e.classificationType,wi.BOTH),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=g(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:g(e.interleave,!1),releaseGeometryInstances:g(e.releaseGeometryInstances,!0),allowPicking:g(e.allowPicking,!0),asynchronous:g(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=tm(!1),this._renderState3DTiles=tm(!0),this._renderStateMorph=je.fromCache({cull:{enabled:!0,face:Uo.FRONT},depthTest:{enabled:!0},blending:ro.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(xi.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),xi.initializeTerrainHeights=function(){return Ve.initialize()};function hE(e,t,n){const i=t.context,o=e._primitive,a=o._attributeLocations;let r=o._batchTable.getVertexShaderCallback()(iE);r=Pe._appendShowToShader(o,r),r=Pe._appendDistanceDisplayConditionToShader(o,r),r=Pe._modifyShaderPosition(e,r,t.scene3DOnly);let f=o._batchTable.getVertexShaderCallback()(nE);f=Pe._appendShowToShader(o,f),f=Pe._appendDistanceDisplayConditionToShader(o,f),f=Pe._modifyShaderPosition(e,f,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(eE);const h=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let d="",p="";l(n.material)?(p=l(n.material)?n.material.shaderSource:"",p.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&h.push("ANGLE_VARYING"),p.search(/in\s+float\s+v_width;/g)!==-1&&h.push("WIDTH_VARYING")):d="PER_INSTANCE_COLOR",h.push(d);const m=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",d]:[d],T=new Ae({defines:h,sources:[r]}),y=new Ae({defines:m,sources:[p,c]});e._sp=lt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:T,fragmentShaderSource:y,attributeLocations:a});let w=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(w)){const E=new Ae({defines:h.concat(["COLUMBUS_VIEW_2D"]),sources:[r]});w=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:E,fragmentShaderSource:y,attributeLocations:a})}e._sp2D=w;let A=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(A)){const E=new Ae({defines:h.concat([`MAX_TERRAIN_HEIGHT ${Ve._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[f]});c=o._batchTable.getVertexShaderCallback()(tE);const b=new Ae({defines:m,sources:[p,c]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:E,fragmentShaderSource:b,attributeLocations:a})}e._spMorph=A}function tm(e){return je.fromCache({cull:{enabled:!0},blending:ro.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ri.EQUAL,frontOperation:{fail:Ze.KEEP,zFail:Ze.KEEP,zPass:Ze.KEEP},backFunction:ri.EQUAL,backOperation:{fail:Ze.KEEP,zFail:Ze.KEEP,zPass:Ze.KEEP},reference:Ei.CESIUM_3D_TILE_MASK,mask:Ei.CESIUM_3D_TILE_MASK}})}function fE(e,t,n,i,o,a){const r=e._primitive,f=r._va.length;o.length=f,a.length=f;const h=t instanceof Xi?{}:n._uniforms,d=r._batchTable.getUniformMapCallback()(h);for(let p=0;p<f;p++){const m=r._va[p];let T=o[p];l(T)||(T=o[p]=new et({owner:e,primitiveType:r._primitiveType})),T.vertexArray=m,T.renderState=e._renderState,T.shaderProgram=e._sp,T.uniformMap=d,T.pass=Nt.TERRAIN_CLASSIFICATION,T.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const y=et.shallowClone(T,T.derivedCommands.tileset);y.renderState=e._renderState3DTiles,y.pass=Nt.CESIUM_3D_TILE_CLASSIFICATION,T.derivedCommands.tileset=y;const w=et.shallowClone(T,T.derivedCommands.color2D);w.shaderProgram=e._sp2D,T.derivedCommands.color2D=w;const A=et.shallowClone(y,y.derivedCommands.color2D);A.shaderProgram=e._sp2D,y.derivedCommands.color2D=A;const E=et.shallowClone(T,T.derivedCommands.colorMorph);E.renderState=e._renderStateMorph,E.shaderProgram=e._spMorph,E.pickId="czm_batchTable_pickColor(v_batchId)",T.derivedCommands.colorMorph=E}}function nm(e,t,n,i,o,a,r){n.mode===ye.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ye.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=a,t.cull=o,t.debugShowBoundingVolume=r,n.commandList.push(t)}function lE(e,t,n,i,o,a,r){const f=e._primitive;Pe._updateBoundingVolumes(f,t,o);let c;t.mode===ye.SCENE3D?c=f._boundingSphereWC:t.mode===ye.COLUMBUS_VIEW?c=f._boundingSphereCV:t.mode===ye.SCENE2D&&l(f._boundingSphere2D)?c=f._boundingSphere2D:l(f._boundingSphereMorph)&&(c=f._boundingSphereMorph);const h=t.mode===ye.MORPHING,d=e.classificationType,p=d!==wi.CESIUM_3D_TILE,m=d!==wi.TERRAIN&&!h;let T;const y=t.passes;if(y.render||y.pick&&f.allowPicking){const w=n.length;for(let A=0;A<w;++A){const E=c[A];p&&(T=n[A],nm(e,T,t,o,a,E,r)),m&&(T=n[A].derivedCommands.tileset,nm(e,T,t,o,a,E,r))}}}xi.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ve.initialized){if(!this.asynchronous)throw new C("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");xi.initializeTerrainHeights();return}let t;const n=this,i=this._primitiveOptions;if(!l(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],a=o.length,r=new Array(a);let f;for(t=0;t<a;++t)if(f=o[t].attributes,!l(f)||!l(f.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<a;++t){const c=o[t];f={};const h=c.attributes;for(const d in h)h.hasOwnProperty(d)&&(f[d]=h[d]);l(f.width)||(f.width=new Gn({componentDatatype:he.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,ji.setProjectionAndEllipsoid(c.geometry,e.mapProjection),r[t]=new na({geometry:c.geometry,attributes:f,id:c.id,pickPrimitive:n})}i.geometryInstances=r,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,h,d){hE(n,h,d)},i._createCommandsFunction=function(c,h,d,p,m,T,y){fE(n,h,d,p,T,y)},i._updateAndQueueCommandsFunction=function(c,h,d,p,m,T,y,w){lE(n,h,d,p,m,T,y)},this._primitive=new Pe(i)}if(this.appearance instanceof Xi&&!this._hasPerInstanceColors)throw new C("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},xi.prototype.getGeometryInstanceAttributes=function(e){if(!l(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},xi.isSupported=function(e){return e.frameState.context.depthTexture},xi.prototype.isDestroyed=function(){return!1},xi.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,st(this)};const uE=new q(1,1),dE=!1,pE=D.WHITE;function $o(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new Ne,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties($o.prototype,{isConstant:{get:function(){return ve.isConstant(this._image)&&ve.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:V("image"),repeat:V("repeat"),color:V("color"),transparent:V("transparent")}),$o.prototype.getType=function(e){return"Image"};const mE=new J;$o.prototype.getValue=function(e,t){return l(e)||(e=J.now(mE)),l(t)||(t={}),t.image=ve.getValueOrUndefined(this._image,e),t.repeat=ve.getValueOrClonedDefault(this._repeat,e,uE,t.repeat),t.color=ve.getValueOrClonedDefault(this._color,e,pE,t.color),ve.getValueOrDefault(this._transparent,e,dE)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},$o.prototype.equals=function(e){return this===e||e instanceof $o&&ve.equals(this._image,e._image)&&ve.equals(this._repeat,e._repeat)&&ve.equals(this._color,e._color)&&ve.equals(this._transparent,e._transparent)};function _E(e){if(e instanceof D)return new ko(e);if(typeof e=="string"||e instanceof ae||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){const t=new $o;return t.image=e,t}throw new C(`Unable to infer material type: ${e}`)}function Tn(e,t){return V(e,t,_E)}function Ps(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Ps.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),dimensions:V("dimensions"),heightReference:V("heightReference"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition")}),Ps.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Ps(this)},Ps.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.dimensions=g(this.dimensions,e.dimensions),this.heightReference=g(this.heightReference,e.heightReference),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};const Bs=Object.freeze({FIXED:0,INERTIAL:1});function Zo(){C.throwInstantiationError()}Object.defineProperties(Zo.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError},referenceFrame:{get:C.throwInstantiationError}}),Zo.prototype.getValue=C.throwInstantiationError,Zo.prototype.getValueInReferenceFrame=C.throwInstantiationError,Zo.prototype.equals=C.throwInstantiationError;const im=new G;Zo.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new u),n===i)return u.clone(t,o);const a=Ce.computeIcrfToCentralBodyFixedMatrix(e,im);if(n===Bs.INERTIAL)return G.multiplyByVector(a,t,o);if(n===Bs.FIXED)return G.multiplyByVector(G.transpose(a,im),t,o)};function po(e,t){this._definitionChanged=new Ne,this._value=u.clone(e),this._referenceFrame=g(t,Bs.FIXED)}Object.defineProperties(po.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Bs.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});const gE=new J;po.prototype.getValue=function(e,t){return l(e)||(e=J.now(gE)),this.getValueInReferenceFrame(e,Bs.FIXED,t)},po.prototype.setValue=function(e,t){let n=!1;u.equals(this._value,e)||(n=!0,this._value=u.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)},po.prototype.getValueInReferenceFrame=function(e,t,n){if(!l(e))throw new C("time is required.");if(!l(t))throw new C("referenceFrame is required.");return Zo.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)},po.prototype.equals=function(e){return this===e||e instanceof po&&u.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};function Rs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Rs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),positions:V("positions"),width:V("width"),height:V("height"),heightReference:V("heightReference"),extrudedHeight:V("extrudedHeight"),extrudedHeightReference:V("extrudedHeightReference"),cornerType:V("cornerType"),granularity:V("granularity"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition"),classificationType:V("classificationType"),zIndex:V("zIndex")}),Rs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Rs(this)},Rs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.width=g(this.width,e.width),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=g(this.cornerType,e.cornerType),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};function TE(e){return e}function Mh(e,t){return V(e,t,TE)}function zs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(zs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),length:V("length"),topRadius:V("topRadius"),bottomRadius:V("bottomRadius"),heightReference:V("heightReference"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),numberOfVerticalLines:V("numberOfVerticalLines"),slices:V("slices"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition")}),zs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new zs(this)},zs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.length=g(this.length,e.length),this.topRadius=g(this.topRadius,e.topRadius),this.bottomRadius=g(this.bottomRadius,e.bottomRadius),this.heightReference=g(this.heightReference,e.heightReference),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=g(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=g(this.slices,e.slices),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Ls(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Ls.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),semiMajorAxis:V("semiMajorAxis"),semiMinorAxis:V("semiMinorAxis"),height:V("height"),heightReference:V("heightReference"),extrudedHeight:V("extrudedHeight"),extrudedHeightReference:V("extrudedHeightReference"),rotation:V("rotation"),stRotation:V("stRotation"),granularity:V("granularity"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),numberOfVerticalLines:V("numberOfVerticalLines"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition"),classificationType:V("classificationType"),zIndex:V("zIndex")}),Ls.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Ls(this)},Ls.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.semiMajorAxis=g(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=g(this.semiMinorAxis,e.semiMinorAxis),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=g(this.rotation,e.rotation),this.stRotation=g(this.stRotation,e.stRotation),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=g(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};function Ns(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Ns.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),radii:V("radii"),innerRadii:V("innerRadii"),minimumClock:V("minimumClock"),maximumClock:V("maximumClock"),minimumCone:V("minimumCone"),maximumCone:V("maximumCone"),heightReference:V("heightReference"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),stackPartitions:V("stackPartitions"),slicePartitions:V("slicePartitions"),subdivisions:V("subdivisions"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition")}),Ns.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Ns(this)},Ns.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.radii=g(this.radii,e.radii),this.innerRadii=g(this.innerRadii,e.innerRadii),this.minimumClock=g(this.minimumClock,e.minimumClock),this.maximumClock=g(this.maximumClock,e.maximumClock),this.minimumCone=g(this.minimumCone,e.minimumCone),this.maximumCone=g(this.maximumCone,e.maximumCone),this.heightReference=g(this.heightReference,e.heightReference),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.stackPartitions=g(this.stackPartitions,e.stackPartitions),this.slicePartitions=g(this.slicePartitions,e.slicePartitions),this.subdivisions=g(this.subdivisions,e.subdivisions),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Fs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Fs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),text:V("text"),font:V("font"),style:V("style"),scale:V("scale"),showBackground:V("showBackground"),backgroundColor:V("backgroundColor"),backgroundPadding:V("backgroundPadding"),pixelOffset:V("pixelOffset"),eyeOffset:V("eyeOffset"),horizontalOrigin:V("horizontalOrigin"),verticalOrigin:V("verticalOrigin"),heightReference:V("heightReference"),fillColor:V("fillColor"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),translucencyByDistance:V("translucencyByDistance"),pixelOffsetScaleByDistance:V("pixelOffsetScaleByDistance"),scaleByDistance:V("scaleByDistance"),distanceDisplayCondition:V("distanceDisplayCondition"),disableDepthTestDistance:V("disableDepthTestDistance")}),Fs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new Fs(this)},Fs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.text=g(this.text,e.text),this.font=g(this.font,e.font),this.style=g(this.style,e.style),this.scale=g(this.scale,e.scale),this.showBackground=g(this.showBackground,e.showBackground),this.backgroundColor=g(this.backgroundColor,e.backgroundColor),this.backgroundPadding=g(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=g(this.pixelOffset,e.pixelOffset),this.eyeOffset=g(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=g(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=g(this.verticalOrigin,e.verticalOrigin),this.heightReference=g(this.heightReference,e.heightReference),this.fillColor=g(this.fillColor,e.fillColor),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=g(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=g(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=g(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=g(this.disableDepthTestDistance,e.disableDepthTestDistance)};const yE=new u(1,1,1),CE=u.ZERO,wE=ie.IDENTITY;function Uh(e,t,n){this.translation=u.clone(g(e,CE)),this.rotation=ie.clone(g(t,wE)),this.scale=u.clone(g(n,yE))}Uh.prototype.equals=function(e){return this===e||l(e)&&u.equals(this.translation,e.translation)&&ie.equals(this.rotation,e.rotation)&&u.equals(this.scale,e.scale)};const kh=new Uh;function Ms(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new Ne,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(Ms.prototype,{isConstant:{get:function(){return ve.isConstant(this._translation)&&ve.isConstant(this._rotation)&&ve.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:V("translation"),rotation:V("rotation"),scale:V("scale")});const AE=new J;Ms.prototype.getValue=function(e,t){return l(e)||(e=J.now(AE)),l(t)||(t=new Uh),t.translation=ve.getValueOrClonedDefault(this._translation,e,kh.translation,t.translation),t.rotation=ve.getValueOrClonedDefault(this._rotation,e,kh.rotation,t.rotation),t.scale=ve.getValueOrClonedDefault(this._scale,e,kh.scale,t.scale),t},Ms.prototype.equals=function(e){return this===e||e instanceof Ms&&ve.equals(this._translation,e._translation)&&ve.equals(this._rotation,e._rotation)&&ve.equals(this._scale,e._scale)};function yn(e,t){this._propertyNames=[],this._definitionChanged=new Ne,l(e)&&this.merge(e,t)}Object.defineProperties(yn.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){const e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!ve.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),yn.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function EE(e){return new ni(e)}yn.prototype.addProperty=function(e,t,n){const i=this._propertyNames;if(!l(e))throw new C("propertyName is required.");if(i.indexOf(e)!==-1)throw new C(`${e} is already a registered property.`);i.push(e),Object.defineProperty(this,e,V(e,!0,g(n,EE))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)},yn.prototype.removeProperty=function(e){const n=this._propertyNames.indexOf(e);if(!l(e))throw new C("propertyName is required.");if(n===-1)throw new C(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};const bE=new J;yn.prototype.getValue=function(e,t){l(e)||(e=J.now(bE)),l(t)||(t={});const n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){const a=n[i];t[a]=ve.getValueOrUndefined(this[a],e,t[a])}return t},yn.prototype.merge=function(e,t){if(!l(e))throw new C("source is required.");const n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,a=i.length;o<a;o++){const r=i[o],f=this[r],c=e[r];f===void 0&&n.indexOf(r)===-1&&this.addProperty(r,void 0,t),c!==void 0&&(f!==void 0?l(f)&&l(f.merge)&&f.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[r]=c.clone():this[r]=c)}};function xE(e,t){const n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let a=0;a<o;++a){const r=n[a];if(i.indexOf(r)===-1||!ve.equals(e[r],t[r]))return!1}return!0}yn.prototype.equals=function(e){return this===e||e instanceof yn&&xE(this,e)};function om(e){return new Ms(e)}function SE(e){return new yn(e,om)}function IE(e){return new yn(e)}function Us(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Us.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),uri:V("uri"),scale:V("scale"),enableVerticalExaggeration:V("enableVerticalExaggeration"),minimumPixelSize:V("minimumPixelSize"),maximumScale:V("maximumScale"),incrementallyLoadTextures:V("incrementallyLoadTextures"),runAnimations:V("runAnimations"),clampAnimations:V("clampAnimations"),shadows:V("shadows"),heightReference:V("heightReference"),silhouetteColor:V("silhouetteColor"),silhouetteSize:V("silhouetteSize"),color:V("color"),colorBlendMode:V("colorBlendMode"),colorBlendAmount:V("colorBlendAmount"),imageBasedLightingFactor:V("imageBasedLightingFactor"),lightColor:V("lightColor"),distanceDisplayCondition:V("distanceDisplayCondition"),nodeTransformations:V("nodeTransformations",void 0,SE),articulations:V("articulations",void 0,IE),clippingPlanes:V("clippingPlanes"),customShader:V("customShader")}),Us.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new Us(this)},Us.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.uri=g(this.uri,e.uri),this.scale=g(this.scale,e.scale),this.enableVerticalExaggeration=g(this.enableVerticalExaggeration,e.enableVerticalExaggeration),this.minimumPixelSize=g(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=g(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=g(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=g(this.runAnimations,e.runAnimations),this.clampAnimations=g(this.clampAnimations,e.clampAnimations),this.shadows=g(this.shadows,e.shadows),this.heightReference=g(this.heightReference,e.heightReference),this.silhouetteColor=g(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=g(this.silhouetteSize,e.silhouetteSize),this.color=g(this.color,e.color),this.colorBlendMode=g(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=g(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=g(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=g(this.lightColor,e.lightColor),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=g(this.clippingPlanes,e.clippingPlanes),this.customShader=g(this.customShader,e.customShader);const t=e.nodeTransformations;if(l(t)){const i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new yn(t,om)}const n=e.articulations;if(l(n)){const i=this.articulations;l(i)?i.merge(n):this.articulations=new yn(n)}};function ks(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(ks.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),uri:V("uri"),maximumScreenSpaceError:V("maximumScreenSpaceError")}),ks.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new ks(this)},ks.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.uri=g(this.uri,e.uri),this.maximumScreenSpaceError=g(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};function Vs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Vs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),leadTime:V("leadTime"),trailTime:V("trailTime"),width:V("width"),resolution:V("resolution"),material:Tn("material"),distanceDisplayCondition:V("distanceDisplayCondition")}),Vs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Vs(this)},Vs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.leadTime=g(this.leadTime,e.leadTime),this.trailTime=g(this.trailTime,e.trailTime),this.width=g(this.width,e.width),this.resolution=g(this.resolution,e.resolution),this.material=g(this.material,e.material),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Gs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Gs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),plane:V("plane"),dimensions:V("dimensions"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition")}),Gs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Gs(this)},Gs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.plane=g(this.plane,e.plane),this.dimensions=g(this.dimensions,e.dimensions),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};function qs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(qs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),pixelSize:V("pixelSize"),heightReference:V("heightReference"),color:V("color"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),scaleByDistance:V("scaleByDistance"),translucencyByDistance:V("translucencyByDistance"),distanceDisplayCondition:V("distanceDisplayCondition"),disableDepthTestDistance:V("disableDepthTestDistance"),splitDirection:V("splitDirection")}),qs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new qs(this)},qs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.pixelSize=g(this.pixelSize,e.pixelSize),this.heightReference=g(this.heightReference,e.heightReference),this.color=g(this.color,e.color),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.scaleByDistance=g(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=g(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=g(this.disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=g(this.splitDirection,e.splitDirection)};function DE(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}function OE(e){return Array.isArray(e)&&(e=new DE(e)),new ni(e)}function Hs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Hs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),hierarchy:V("hierarchy",void 0,OE),height:V("height"),heightReference:V("heightReference"),extrudedHeight:V("extrudedHeight"),extrudedHeightReference:V("extrudedHeightReference"),stRotation:V("stRotation"),granularity:V("granularity"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),perPositionHeight:V("perPositionHeight"),closeTop:V("closeTop"),closeBottom:V("closeBottom"),arcType:V("arcType"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition"),classificationType:V("classificationType"),zIndex:V("zIndex"),textureCoordinates:V("textureCoordinates")}),Hs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new Hs(this)},Hs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.hierarchy=g(this.hierarchy,e.hierarchy),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=g(this.stRotation,e.stRotation),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.perPositionHeight=g(this.perPositionHeight,e.perPositionHeight),this.closeTop=g(this.closeTop,e.closeTop),this.closeBottom=g(this.closeBottom,e.closeBottom),this.arcType=g(this.arcType,e.arcType),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex),this.textureCoordinates=g(this.textureCoordinates,e.textureCoordinates)};function js(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(js.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),positions:V("positions"),width:V("width"),granularity:V("granularity"),material:Tn("material"),depthFailMaterial:Tn("depthFailMaterial"),arcType:V("arcType"),clampToGround:V("clampToGround"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition"),classificationType:V("classificationType"),zIndex:V("zIndex")}),js.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new js(this)},js.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.width=g(this.width,e.width),this.granularity=g(this.granularity,e.granularity),this.material=g(this.material,e.material),this.depthFailMaterial=g(this.depthFailMaterial,e.depthFailMaterial),this.arcType=g(this.arcType,e.arcType),this.clampToGround=g(this.clampToGround,e.clampToGround),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};function Ys(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Ys.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),positions:V("positions"),shape:V("shape"),cornerType:V("cornerType"),granularity:V("granularity"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition")}),Ys.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Ys(this)},Ys.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.shape=g(this.shape,e.shape),this.cornerType=g(this.cornerType,e.cornerType),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Xs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Xs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),coordinates:V("coordinates"),height:V("height"),heightReference:V("heightReference"),extrudedHeight:V("extrudedHeight"),extrudedHeightReference:V("extrudedHeightReference"),rotation:V("rotation"),stRotation:V("stRotation"),granularity:V("granularity"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition"),classificationType:V("classificationType"),zIndex:V("zIndex")}),Xs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Xs(this)},Xs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.coordinates=g(this.coordinates,e.coordinates),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=g(this.rotation,e.rotation),this.stRotation=g(this.stRotation,e.stRotation),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};function $s(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties($s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),positions:V("positions"),minimumHeights:V("minimumHeights"),maximumHeights:V("maximumHeights"),granularity:V("granularity"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition")}),$s.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new $s(this)},$s.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.minimumHeights=g(this.minimumHeights,e.minimumHeights),this.maximumHeights=g(this.maximumHeights,e.maximumHeights),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};const vE=new oe,Vh=[];function WE(e){return new po(e)}function PE(e){return V(e,void 0,WE)}function Rt(e,t){return V(e,void 0,function(n){return n instanceof t?n:new t(n)})}function dn(e){e=g(e,g.EMPTY_OBJECT);let t=e.id;l(t)||(t=Xn()),this._availability=void 0,this._id=t,this._definitionChanged=new Ne,this._name=e.name,this._show=g(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...Vh],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function Gh(e,t,n){const i=t.length;for(let o=0;o<i;o++){const a=t[o],r=a._show;(!n&&r)!==(n&&r)&&Gh(a,a._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(dn.prototype,{availability:Mh("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Mh("name"),show:{get:function(){return this._show},set:function(e){if(!l(e))throw new C("value is required.");if(e===this._show)return;const t=this.isShowing;this._show=e;const n=this.isShowing;t!==n&&Gh(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){const t=this._parent;if(t===e)return;const n=this.isShowing;if(l(t)){const o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,l(e)&&e._children.push(this);const i=this.isShowing;n!==i&&Gh(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Rt("billboard",ms),box:Rt("box",Ps),corridor:Rt("corridor",Rs),cylinder:Rt("cylinder",zs),description:V("description"),ellipse:Rt("ellipse",Ls),ellipsoid:Rt("ellipsoid",Ns),label:Rt("label",Fs),model:Rt("model",Us),tileset:Rt("tileset",ks),orientation:V("orientation"),path:Rt("path",Vs),plane:Rt("plane",Gs),point:Rt("point",qs),polygon:Rt("polygon",Hs),polyline:Rt("polyline",js),polylineVolume:Rt("polylineVolume",Ys),properties:Rt("properties",yn),position:PE("position"),rectangle:Rt("rectangle",Xs),viewFrom:V("viewFrom"),wall:Rt("wall",$s)}),dn.registerEntityType=function(e,t){Object.defineProperties(dn.prototype,{[e]:Rt(e,t)}),Vh.includes(e)||Vh.push(e)},dn.prototype.isAvailable=function(e){if(!l(e))throw new C("time is required.");const t=this._availability;return!l(t)||t.contains(e)},dn.prototype.addProperty=function(e){const t=this._propertyNames;if(!l(e))throw new C("propertyName is required.");if(t.indexOf(e)!==-1)throw new C(`${e} is already a registered property.`);if(e in this)throw new C(`${e} is a reserved property name.`);t.push(e),Object.defineProperty(this,e,Mh(e,!0))},dn.prototype.removeProperty=function(e){const n=this._propertyNames.indexOf(e);if(!l(e))throw new C("propertyName is required.");if(n===-1)throw new C(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e]},dn.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.name=g(this.name,e.name),this.availability=g(this.availability,e.availability);const t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){const a=n[o];if(a==="parent"||a==="name"||a==="availability"||a==="children")continue;const r=this[a],f=e[a];!l(r)&&t.indexOf(a)===-1&&this.addProperty(a),l(f)&&(l(r)?l(r.merge)&&r.merge(f):l(f.merge)&&l(f.clone)?this[a]=f.clone():this[a]=f)}};const sm=new G,rm=new u,am=new ie;dn.prototype.computeModelMatrix=function(e,t){_.typeOf.object("time",e);const n=ve.getValueOrUndefined(this._position,e,rm);if(!l(n))return;const i=ve.getValueOrUndefined(this._orientation,e,am);return l(i)?t=k.fromRotationTranslation(G.fromQuaternion(i,sm),n,t):t=Ce.eastNorthUpToFixedFrame(n,void 0,t),t},dn.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){_.typeOf.object("time",e);const a=ve.getValueOrDefault(t,e,Ln.NONE);let r=ve.getValueOrUndefined(this._position,e,rm);if(a===Ln.NONE||!l(r)||u.equalsEpsilon(r,u.ZERO,S.EPSILON8))return this.computeModelMatrix(e,o);const f=i.cartesianToCartographic(r,vE);ta(a)?f.height=n:f.height+=n,r=i.cartographicToCartesian(f,r);const c=ve.getValueOrUndefined(this._orientation,e,am);return l(c)?o=k.fromRotationTranslation(G.fromQuaternion(c,sm),r,o):o=Ce.eastNorthUpToFixedFrame(r,void 0,o),o},dn.supportsMaterialsforEntitiesOnTerrain=function(e){return un.supportsMaterials(e)},dn.supportsPolylinesOnTerrain=function(e){return xi.isSupported(e)};const vt={},BE=new Z(0,0,0,1);let Jt=new Z;const RE=new be,qh=new q,Hh=new q;vt.worldToWindowCoordinates=function(e,t,n){return vt.worldWithEyeOffsetToWindowCoordinates(e,t,u.ZERO,n)};const cm=new Z,hm=new u;function Zs(e,t,n,i){const o=n.viewMatrix,a=k.multiplyByVector(o,Z.fromElements(e.x,e.y,e.z,1,cm),cm),r=u.multiplyComponents(t,u.normalize(a,hm),hm);return a.x+=t.x+r.x,a.y+=t.y+r.y,a.z+=r.z,k.multiplyByVector(n.frustum.projectionMatrix,a,i)}const zE=new oe(Math.PI,S.PI_OVER_TWO),LE=new u,NE=new u;vt.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){if(!l(e))throw new C("scene is required.");if(!l(t))throw new C("position is required.");const o=e.frameState,a=vt.computeActualEllipsoidPosition(o,t,BE);if(!l(a))return;const r=e.canvas,f=RE;f.x=0,f.y=0,f.width=r.clientWidth,f.height=r.clientHeight;const c=e.camera;let h=!1;if(o.mode===ye.SCENE2D){const d=e.mapProjection,p=zE,m=d.project(p,LE),T=u.clone(c.position,NE),y=c.frustum.clone(),w=k.computeViewportTransformation(f,0,1,new k),A=c.frustum.projectionMatrix,E=c.positionWC.y,b=u.fromElements(S.sign(E)*m.x-E,0,-c.positionWC.x),I=Ce.pointToGLWindowCoordinates(A,w,b);if(E===0||I.x<=0||I.x>=r.clientWidth)h=!0;else{if(I.x>r.clientWidth*.5){f.width=I.x,c.frustum.right=m.x-E,Jt=Zs(a,n,c,Jt),vt.clipToGLWindowCoordinates(f,Jt,qh),f.x+=I.x,c.position.x=-c.position.x;const O=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-O,Jt=Zs(a,n,c,Jt),vt.clipToGLWindowCoordinates(f,Jt,Hh)}else{f.x+=I.x,f.width-=I.x,c.frustum.left=-m.x-E,Jt=Zs(a,n,c,Jt),vt.clipToGLWindowCoordinates(f,Jt,qh),f.x=f.x-f.width,c.position.x=-c.position.x;const O=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-O,Jt=Zs(a,n,c,Jt),vt.clipToGLWindowCoordinates(f,Jt,Hh)}u.clone(T,c.position),c.frustum=y.clone(),i=q.clone(qh,i),(i.x<0||i.x>r.clientWidth)&&(i.x=Hh.x)}}if(o.mode!==ye.SCENE2D||h){if(Jt=Zs(a,n,c,Jt),Jt.z<0&&!(c.frustum instanceof ln)&&!(c.frustum instanceof zn))return;i=vt.clipToGLWindowCoordinates(f,Jt,i)}return i.y=r.clientHeight-i.y,i},vt.worldToDrawingBufferCoordinates=function(e,t,n){if(n=vt.worldToWindowCoordinates(e,t,n),!!l(n))return vt.transformWindowToDrawingBuffer(e,n,n)};const Si=new u,FE=new oe;vt.computeActualEllipsoidPosition=function(e,t,n){const i=e.mode;if(i===ye.SCENE3D)return u.clone(t,n);const o=e.mapProjection,a=o.ellipsoid.cartesianToCartographic(t,FE);if(!l(a))return;if(o.project(a,Si),i===ye.COLUMBUS_VIEW)return u.fromElements(Si.z,Si.x,Si.y,n);if(i===ye.SCENE2D)return u.fromElements(0,Si.x,Si.y,n);const r=e.morphTime;return u.fromElements(S.lerp(Si.z,t.x,r),S.lerp(Si.x,t.y,r),S.lerp(Si.y,t.z,r),n)};const fm=new u,lm=new u,um=new k;vt.clipToGLWindowCoordinates=function(e,t,n){return u.divideByScalar(t,t.w,fm),k.computeViewportTransformation(e,0,1,um),k.multiplyByPoint(um,fm,lm),q.fromCartesian3(lm,n)},vt.transformWindowToDrawingBuffer=function(e,t,n){const i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,a=e.drawingBufferHeight/i.clientHeight;return q.fromElements(t.x*o,t.y*a,n)};const ME=new Z,dm=new Z;vt.drawingBufferToWorldCoordinates=function(e,t,n,i){const a=e.context.uniformState,r=a.currentFrustum,f=r.x,c=r.y;if(e.frameState.useLogDepth){const T=n*a.log2FarDepthFromNearPlusOne,y=Math.pow(2,T)-1;n=c*(1-f/(y+f))/(c-f)}const h=e.view.passState.viewport,d=Z.clone(Z.UNIT_W,ME);d.x=(t.x-h.x)/h.width*2-1,d.y=(t.y-h.y)/h.height*2-1,d.z=n*2-1,d.w=1;let p,m=e.camera.frustum;if(l(m.fovy)){p=k.multiplyByVector(a.inverseViewProjection,d,dm);const T=1/p.w;u.multiplyByScalar(p,T,p)}else{const T=m.offCenterFrustum;l(T)&&(m=T),p=dm,p.x=(d.x*(m.right-m.left)+m.left+m.right)*.5,p.y=(d.y*(m.top-m.bottom)+m.bottom+m.top)*.5,p.z=(d.z*(f-c)-f-c)*.5,p.w=1,p=k.multiplyByVector(a.inverseView,p,p)}return u.fromCartesian4(p,i)};const UE=`uniform sampler2D u_atlas;
5696
+ ${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),uo.VERTEX_FORMAT=ut.POSITION_AND_ST,uo.prototype.getFragmentShaderSource=Gt.prototype.getFragmentShaderSource,uo.prototype.isTranslucent=Gt.prototype.isTranslucent,uo.prototype.getRenderState=Gt.prototype.getRenderState;function xi(e){e=g(e,g.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new uo),this.appearance=t,this.show=g(e.show,!0),this.classificationType=g(e.classificationType,wi.BOTH),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=g(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:g(e.interleave,!1),releaseGeometryInstances:g(e.releaseGeometryInstances,!0),allowPicking:g(e.allowPicking,!0),asynchronous:g(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=tm(!1),this._renderState3DTiles=tm(!0),this._renderStateMorph=je.fromCache({cull:{enabled:!0,face:Mo.FRONT},depthTest:{enabled:!0},blending:ro.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(xi.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),xi.initializeTerrainHeights=function(){return Ve.initialize()};function hE(e,t,n){const i=t.context,o=e._primitive,a=o._attributeLocations;let r=o._batchTable.getVertexShaderCallback()(iE);r=Pe._appendShowToShader(o,r),r=Pe._appendDistanceDisplayConditionToShader(o,r),r=Pe._modifyShaderPosition(e,r,t.scene3DOnly);let f=o._batchTable.getVertexShaderCallback()(nE);f=Pe._appendShowToShader(o,f),f=Pe._appendDistanceDisplayConditionToShader(o,f),f=Pe._modifyShaderPosition(e,f,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(eE);const h=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let d="",p="";l(n.material)?(p=l(n.material)?n.material.shaderSource:"",p.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&h.push("ANGLE_VARYING"),p.search(/in\s+float\s+v_width;/g)!==-1&&h.push("WIDTH_VARYING")):d="PER_INSTANCE_COLOR",h.push(d);const m=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",d]:[d],T=new Ae({defines:h,sources:[r]}),y=new Ae({defines:m,sources:[p,c]});e._sp=lt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:T,fragmentShaderSource:y,attributeLocations:a});let w=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(w)){const E=new Ae({defines:h.concat(["COLUMBUS_VIEW_2D"]),sources:[r]});w=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:E,fragmentShaderSource:y,attributeLocations:a})}e._sp2D=w;let A=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(A)){const E=new Ae({defines:h.concat([`MAX_TERRAIN_HEIGHT ${Ve._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[f]});c=o._batchTable.getVertexShaderCallback()(tE);const b=new Ae({defines:m,sources:[p,c]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:E,fragmentShaderSource:b,attributeLocations:a})}e._spMorph=A}function tm(e){return je.fromCache({cull:{enabled:!0},blending:ro.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ri.EQUAL,frontOperation:{fail:Ze.KEEP,zFail:Ze.KEEP,zPass:Ze.KEEP},backFunction:ri.EQUAL,backOperation:{fail:Ze.KEEP,zFail:Ze.KEEP,zPass:Ze.KEEP},reference:Ei.CESIUM_3D_TILE_MASK,mask:Ei.CESIUM_3D_TILE_MASK}})}function fE(e,t,n,i,o,a){const r=e._primitive,f=r._va.length;o.length=f,a.length=f;const h=t instanceof Xi?{}:n._uniforms,d=r._batchTable.getUniformMapCallback()(h);for(let p=0;p<f;p++){const m=r._va[p];let T=o[p];l(T)||(T=o[p]=new et({owner:e,primitiveType:r._primitiveType})),T.vertexArray=m,T.renderState=e._renderState,T.shaderProgram=e._sp,T.uniformMap=d,T.pass=Nt.TERRAIN_CLASSIFICATION,T.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const y=et.shallowClone(T,T.derivedCommands.tileset);y.renderState=e._renderState3DTiles,y.pass=Nt.CESIUM_3D_TILE_CLASSIFICATION,T.derivedCommands.tileset=y;const w=et.shallowClone(T,T.derivedCommands.color2D);w.shaderProgram=e._sp2D,T.derivedCommands.color2D=w;const A=et.shallowClone(y,y.derivedCommands.color2D);A.shaderProgram=e._sp2D,y.derivedCommands.color2D=A;const E=et.shallowClone(T,T.derivedCommands.colorMorph);E.renderState=e._renderStateMorph,E.shaderProgram=e._spMorph,E.pickId="czm_batchTable_pickColor(v_batchId)",T.derivedCommands.colorMorph=E}}function nm(e,t,n,i,o,a,r){n.mode===ye.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ye.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=a,t.cull=o,t.debugShowBoundingVolume=r,n.commandList.push(t)}function lE(e,t,n,i,o,a,r){const f=e._primitive;Pe._updateBoundingVolumes(f,t,o);let c;t.mode===ye.SCENE3D?c=f._boundingSphereWC:t.mode===ye.COLUMBUS_VIEW?c=f._boundingSphereCV:t.mode===ye.SCENE2D&&l(f._boundingSphere2D)?c=f._boundingSphere2D:l(f._boundingSphereMorph)&&(c=f._boundingSphereMorph);const h=t.mode===ye.MORPHING,d=e.classificationType,p=d!==wi.CESIUM_3D_TILE,m=d!==wi.TERRAIN&&!h;let T;const y=t.passes;if(y.render||y.pick&&f.allowPicking){const w=n.length;for(let A=0;A<w;++A){const E=c[A];p&&(T=n[A],nm(e,T,t,o,a,E,r)),m&&(T=n[A].derivedCommands.tileset,nm(e,T,t,o,a,E,r))}}}xi.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ve.initialized){if(!this.asynchronous)throw new C("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");xi.initializeTerrainHeights();return}let t;const n=this,i=this._primitiveOptions;if(!l(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],a=o.length,r=new Array(a);let f;for(t=0;t<a;++t)if(f=o[t].attributes,!l(f)||!l(f.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<a;++t){const c=o[t];f={};const h=c.attributes;for(const d in h)h.hasOwnProperty(d)&&(f[d]=h[d]);l(f.width)||(f.width=new Vn({componentDatatype:he.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,ji.setProjectionAndEllipsoid(c.geometry,e.mapProjection),r[t]=new na({geometry:c.geometry,attributes:f,id:c.id,pickPrimitive:n})}i.geometryInstances=r,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,h,d){hE(n,h,d)},i._createCommandsFunction=function(c,h,d,p,m,T,y){fE(n,h,d,p,T,y)},i._updateAndQueueCommandsFunction=function(c,h,d,p,m,T,y,w){lE(n,h,d,p,m,T,y)},this._primitive=new Pe(i)}if(this.appearance instanceof Xi&&!this._hasPerInstanceColors)throw new C("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},xi.prototype.getGeometryInstanceAttributes=function(e){if(!l(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},xi.isSupported=function(e){return e.frameState.context.depthTexture},xi.prototype.isDestroyed=function(){return!1},xi.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,st(this)};const uE=new q(1,1),dE=!1,pE=I.WHITE;function Xo(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new Ne,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(Xo.prototype,{isConstant:{get:function(){return ve.isConstant(this._image)&&ve.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:V("image"),repeat:V("repeat"),color:V("color"),transparent:V("transparent")}),Xo.prototype.getType=function(e){return"Image"};const mE=new J;Xo.prototype.getValue=function(e,t){return l(e)||(e=J.now(mE)),l(t)||(t={}),t.image=ve.getValueOrUndefined(this._image,e),t.repeat=ve.getValueOrClonedDefault(this._repeat,e,uE,t.repeat),t.color=ve.getValueOrClonedDefault(this._color,e,pE,t.color),ve.getValueOrDefault(this._transparent,e,dE)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},Xo.prototype.equals=function(e){return this===e||e instanceof Xo&&ve.equals(this._image,e._image)&&ve.equals(this._repeat,e._repeat)&&ve.equals(this._color,e._color)&&ve.equals(this._transparent,e._transparent)};function _E(e){if(e instanceof I)return new Uo(e);if(typeof e=="string"||e instanceof ae||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){const t=new Xo;return t.image=e,t}throw new C(`Unable to infer material type: ${e}`)}function Tn(e,t){return V(e,t,_E)}function Ps(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Ps.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),dimensions:V("dimensions"),heightReference:V("heightReference"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition")}),Ps.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Ps(this)},Ps.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.dimensions=g(this.dimensions,e.dimensions),this.heightReference=g(this.heightReference,e.heightReference),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};const Bs=Object.freeze({FIXED:0,INERTIAL:1});function $o(){C.throwInstantiationError()}Object.defineProperties($o.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError},referenceFrame:{get:C.throwInstantiationError}}),$o.prototype.getValue=C.throwInstantiationError,$o.prototype.getValueInReferenceFrame=C.throwInstantiationError,$o.prototype.equals=C.throwInstantiationError;const im=new G;$o.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new u),n===i)return u.clone(t,o);const a=Ce.computeIcrfToCentralBodyFixedMatrix(e,im);if(n===Bs.INERTIAL)return G.multiplyByVector(a,t,o);if(n===Bs.FIXED)return G.multiplyByVector(G.transpose(a,im),t,o)};function po(e,t){this._definitionChanged=new Ne,this._value=u.clone(e),this._referenceFrame=g(t,Bs.FIXED)}Object.defineProperties(po.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Bs.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});const gE=new J;po.prototype.getValue=function(e,t){return l(e)||(e=J.now(gE)),this.getValueInReferenceFrame(e,Bs.FIXED,t)},po.prototype.setValue=function(e,t){let n=!1;u.equals(this._value,e)||(n=!0,this._value=u.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)},po.prototype.getValueInReferenceFrame=function(e,t,n){if(!l(e))throw new C("time is required.");if(!l(t))throw new C("referenceFrame is required.");return $o.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)},po.prototype.equals=function(e){return this===e||e instanceof po&&u.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};function Rs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Rs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),positions:V("positions"),width:V("width"),height:V("height"),heightReference:V("heightReference"),extrudedHeight:V("extrudedHeight"),extrudedHeightReference:V("extrudedHeightReference"),cornerType:V("cornerType"),granularity:V("granularity"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition"),classificationType:V("classificationType"),zIndex:V("zIndex")}),Rs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Rs(this)},Rs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.width=g(this.width,e.width),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=g(this.cornerType,e.cornerType),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};function TE(e){return e}function Mh(e,t){return V(e,t,TE)}function zs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(zs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),length:V("length"),topRadius:V("topRadius"),bottomRadius:V("bottomRadius"),heightReference:V("heightReference"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),numberOfVerticalLines:V("numberOfVerticalLines"),slices:V("slices"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition")}),zs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new zs(this)},zs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.length=g(this.length,e.length),this.topRadius=g(this.topRadius,e.topRadius),this.bottomRadius=g(this.bottomRadius,e.bottomRadius),this.heightReference=g(this.heightReference,e.heightReference),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=g(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=g(this.slices,e.slices),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Ls(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Ls.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),semiMajorAxis:V("semiMajorAxis"),semiMinorAxis:V("semiMinorAxis"),height:V("height"),heightReference:V("heightReference"),extrudedHeight:V("extrudedHeight"),extrudedHeightReference:V("extrudedHeightReference"),rotation:V("rotation"),stRotation:V("stRotation"),granularity:V("granularity"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),numberOfVerticalLines:V("numberOfVerticalLines"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition"),classificationType:V("classificationType"),zIndex:V("zIndex")}),Ls.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Ls(this)},Ls.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.semiMajorAxis=g(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=g(this.semiMinorAxis,e.semiMinorAxis),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=g(this.rotation,e.rotation),this.stRotation=g(this.stRotation,e.stRotation),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=g(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};function Ns(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Ns.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),radii:V("radii"),innerRadii:V("innerRadii"),minimumClock:V("minimumClock"),maximumClock:V("maximumClock"),minimumCone:V("minimumCone"),maximumCone:V("maximumCone"),heightReference:V("heightReference"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),stackPartitions:V("stackPartitions"),slicePartitions:V("slicePartitions"),subdivisions:V("subdivisions"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition")}),Ns.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Ns(this)},Ns.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.radii=g(this.radii,e.radii),this.innerRadii=g(this.innerRadii,e.innerRadii),this.minimumClock=g(this.minimumClock,e.minimumClock),this.maximumClock=g(this.maximumClock,e.maximumClock),this.minimumCone=g(this.minimumCone,e.minimumCone),this.maximumCone=g(this.maximumCone,e.maximumCone),this.heightReference=g(this.heightReference,e.heightReference),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.stackPartitions=g(this.stackPartitions,e.stackPartitions),this.slicePartitions=g(this.slicePartitions,e.slicePartitions),this.subdivisions=g(this.subdivisions,e.subdivisions),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Fs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Fs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),text:V("text"),font:V("font"),style:V("style"),scale:V("scale"),showBackground:V("showBackground"),backgroundColor:V("backgroundColor"),backgroundPadding:V("backgroundPadding"),pixelOffset:V("pixelOffset"),eyeOffset:V("eyeOffset"),horizontalOrigin:V("horizontalOrigin"),verticalOrigin:V("verticalOrigin"),heightReference:V("heightReference"),fillColor:V("fillColor"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),translucencyByDistance:V("translucencyByDistance"),pixelOffsetScaleByDistance:V("pixelOffsetScaleByDistance"),scaleByDistance:V("scaleByDistance"),distanceDisplayCondition:V("distanceDisplayCondition"),disableDepthTestDistance:V("disableDepthTestDistance")}),Fs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new Fs(this)},Fs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.text=g(this.text,e.text),this.font=g(this.font,e.font),this.style=g(this.style,e.style),this.scale=g(this.scale,e.scale),this.showBackground=g(this.showBackground,e.showBackground),this.backgroundColor=g(this.backgroundColor,e.backgroundColor),this.backgroundPadding=g(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=g(this.pixelOffset,e.pixelOffset),this.eyeOffset=g(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=g(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=g(this.verticalOrigin,e.verticalOrigin),this.heightReference=g(this.heightReference,e.heightReference),this.fillColor=g(this.fillColor,e.fillColor),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=g(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=g(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=g(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=g(this.disableDepthTestDistance,e.disableDepthTestDistance)};const yE=new u(1,1,1),CE=u.ZERO,wE=ie.IDENTITY;function Uh(e,t,n){this.translation=u.clone(g(e,CE)),this.rotation=ie.clone(g(t,wE)),this.scale=u.clone(g(n,yE))}Uh.prototype.equals=function(e){return this===e||l(e)&&u.equals(this.translation,e.translation)&&ie.equals(this.rotation,e.rotation)&&u.equals(this.scale,e.scale)};const kh=new Uh;function Ms(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new Ne,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(Ms.prototype,{isConstant:{get:function(){return ve.isConstant(this._translation)&&ve.isConstant(this._rotation)&&ve.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:V("translation"),rotation:V("rotation"),scale:V("scale")});const AE=new J;Ms.prototype.getValue=function(e,t){return l(e)||(e=J.now(AE)),l(t)||(t=new Uh),t.translation=ve.getValueOrClonedDefault(this._translation,e,kh.translation,t.translation),t.rotation=ve.getValueOrClonedDefault(this._rotation,e,kh.rotation,t.rotation),t.scale=ve.getValueOrClonedDefault(this._scale,e,kh.scale,t.scale),t},Ms.prototype.equals=function(e){return this===e||e instanceof Ms&&ve.equals(this._translation,e._translation)&&ve.equals(this._rotation,e._rotation)&&ve.equals(this._scale,e._scale)};function yn(e,t){this._propertyNames=[],this._definitionChanged=new Ne,l(e)&&this.merge(e,t)}Object.defineProperties(yn.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){const e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!ve.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),yn.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function EE(e){return new ti(e)}yn.prototype.addProperty=function(e,t,n){const i=this._propertyNames;if(!l(e))throw new C("propertyName is required.");if(i.indexOf(e)!==-1)throw new C(`${e} is already a registered property.`);i.push(e),Object.defineProperty(this,e,V(e,!0,g(n,EE))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)},yn.prototype.removeProperty=function(e){const n=this._propertyNames.indexOf(e);if(!l(e))throw new C("propertyName is required.");if(n===-1)throw new C(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};const bE=new J;yn.prototype.getValue=function(e,t){l(e)||(e=J.now(bE)),l(t)||(t={});const n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){const a=n[i];t[a]=ve.getValueOrUndefined(this[a],e,t[a])}return t},yn.prototype.merge=function(e,t){if(!l(e))throw new C("source is required.");const n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,a=i.length;o<a;o++){const r=i[o],f=this[r],c=e[r];f===void 0&&n.indexOf(r)===-1&&this.addProperty(r,void 0,t),c!==void 0&&(f!==void 0?l(f)&&l(f.merge)&&f.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[r]=c.clone():this[r]=c)}};function xE(e,t){const n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let a=0;a<o;++a){const r=n[a];if(i.indexOf(r)===-1||!ve.equals(e[r],t[r]))return!1}return!0}yn.prototype.equals=function(e){return this===e||e instanceof yn&&xE(this,e)};function om(e){return new Ms(e)}function SE(e){return new yn(e,om)}function IE(e){return new yn(e)}function Us(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Us.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),uri:V("uri"),scale:V("scale"),enableVerticalExaggeration:V("enableVerticalExaggeration"),minimumPixelSize:V("minimumPixelSize"),maximumScale:V("maximumScale"),incrementallyLoadTextures:V("incrementallyLoadTextures"),runAnimations:V("runAnimations"),clampAnimations:V("clampAnimations"),shadows:V("shadows"),heightReference:V("heightReference"),silhouetteColor:V("silhouetteColor"),silhouetteSize:V("silhouetteSize"),color:V("color"),colorBlendMode:V("colorBlendMode"),colorBlendAmount:V("colorBlendAmount"),imageBasedLightingFactor:V("imageBasedLightingFactor"),lightColor:V("lightColor"),distanceDisplayCondition:V("distanceDisplayCondition"),nodeTransformations:V("nodeTransformations",void 0,SE),articulations:V("articulations",void 0,IE),clippingPlanes:V("clippingPlanes"),customShader:V("customShader")}),Us.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new Us(this)},Us.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.uri=g(this.uri,e.uri),this.scale=g(this.scale,e.scale),this.enableVerticalExaggeration=g(this.enableVerticalExaggeration,e.enableVerticalExaggeration),this.minimumPixelSize=g(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=g(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=g(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=g(this.runAnimations,e.runAnimations),this.clampAnimations=g(this.clampAnimations,e.clampAnimations),this.shadows=g(this.shadows,e.shadows),this.heightReference=g(this.heightReference,e.heightReference),this.silhouetteColor=g(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=g(this.silhouetteSize,e.silhouetteSize),this.color=g(this.color,e.color),this.colorBlendMode=g(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=g(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=g(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=g(this.lightColor,e.lightColor),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=g(this.clippingPlanes,e.clippingPlanes),this.customShader=g(this.customShader,e.customShader);const t=e.nodeTransformations;if(l(t)){const i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new yn(t,om)}const n=e.articulations;if(l(n)){const i=this.articulations;l(i)?i.merge(n):this.articulations=new yn(n)}};function ks(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(ks.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),uri:V("uri"),maximumScreenSpaceError:V("maximumScreenSpaceError")}),ks.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new ks(this)},ks.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.uri=g(this.uri,e.uri),this.maximumScreenSpaceError=g(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};function Vs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Vs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),leadTime:V("leadTime"),trailTime:V("trailTime"),width:V("width"),resolution:V("resolution"),material:Tn("material"),distanceDisplayCondition:V("distanceDisplayCondition")}),Vs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Vs(this)},Vs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.leadTime=g(this.leadTime,e.leadTime),this.trailTime=g(this.trailTime,e.trailTime),this.width=g(this.width,e.width),this.resolution=g(this.resolution,e.resolution),this.material=g(this.material,e.material),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Gs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Gs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),plane:V("plane"),dimensions:V("dimensions"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition")}),Gs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Gs(this)},Gs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.plane=g(this.plane,e.plane),this.dimensions=g(this.dimensions,e.dimensions),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};function qs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(qs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),pixelSize:V("pixelSize"),heightReference:V("heightReference"),color:V("color"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),scaleByDistance:V("scaleByDistance"),translucencyByDistance:V("translucencyByDistance"),distanceDisplayCondition:V("distanceDisplayCondition"),disableDepthTestDistance:V("disableDepthTestDistance"),splitDirection:V("splitDirection")}),qs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new qs(this)},qs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.pixelSize=g(this.pixelSize,e.pixelSize),this.heightReference=g(this.heightReference,e.heightReference),this.color=g(this.color,e.color),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.scaleByDistance=g(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=g(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=g(this.disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=g(this.splitDirection,e.splitDirection)};function DE(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}function OE(e){return Array.isArray(e)&&(e=new DE(e)),new ti(e)}function Hs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Hs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),hierarchy:V("hierarchy",void 0,OE),height:V("height"),heightReference:V("heightReference"),extrudedHeight:V("extrudedHeight"),extrudedHeightReference:V("extrudedHeightReference"),stRotation:V("stRotation"),granularity:V("granularity"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),perPositionHeight:V("perPositionHeight"),closeTop:V("closeTop"),closeBottom:V("closeBottom"),arcType:V("arcType"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition"),classificationType:V("classificationType"),zIndex:V("zIndex"),textureCoordinates:V("textureCoordinates")}),Hs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new Hs(this)},Hs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.hierarchy=g(this.hierarchy,e.hierarchy),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=g(this.stRotation,e.stRotation),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.perPositionHeight=g(this.perPositionHeight,e.perPositionHeight),this.closeTop=g(this.closeTop,e.closeTop),this.closeBottom=g(this.closeBottom,e.closeBottom),this.arcType=g(this.arcType,e.arcType),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex),this.textureCoordinates=g(this.textureCoordinates,e.textureCoordinates)};function js(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(js.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),positions:V("positions"),width:V("width"),granularity:V("granularity"),material:Tn("material"),depthFailMaterial:Tn("depthFailMaterial"),arcType:V("arcType"),clampToGround:V("clampToGround"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition"),classificationType:V("classificationType"),zIndex:V("zIndex")}),js.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new js(this)},js.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.width=g(this.width,e.width),this.granularity=g(this.granularity,e.granularity),this.material=g(this.material,e.material),this.depthFailMaterial=g(this.depthFailMaterial,e.depthFailMaterial),this.arcType=g(this.arcType,e.arcType),this.clampToGround=g(this.clampToGround,e.clampToGround),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};function Ys(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Ys.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),positions:V("positions"),shape:V("shape"),cornerType:V("cornerType"),granularity:V("granularity"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition")}),Ys.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Ys(this)},Ys.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.shape=g(this.shape,e.shape),this.cornerType=g(this.cornerType,e.cornerType),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Xs(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(Xs.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),coordinates:V("coordinates"),height:V("height"),heightReference:V("heightReference"),extrudedHeight:V("extrudedHeight"),extrudedHeightReference:V("extrudedHeightReference"),rotation:V("rotation"),stRotation:V("stRotation"),granularity:V("granularity"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition"),classificationType:V("classificationType"),zIndex:V("zIndex")}),Xs.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Xs(this)},Xs.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.coordinates=g(this.coordinates,e.coordinates),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=g(this.rotation,e.rotation),this.stRotation=g(this.stRotation,e.stRotation),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};function $s(e){this._definitionChanged=new Ne,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties($s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:V("show"),positions:V("positions"),minimumHeights:V("minimumHeights"),maximumHeights:V("maximumHeights"),granularity:V("granularity"),fill:V("fill"),material:Tn("material"),outline:V("outline"),outlineColor:V("outlineColor"),outlineWidth:V("outlineWidth"),shadows:V("shadows"),distanceDisplayCondition:V("distanceDisplayCondition")}),$s.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new $s(this)},$s.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.minimumHeights=g(this.minimumHeights,e.minimumHeights),this.maximumHeights=g(this.maximumHeights,e.maximumHeights),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};const vE=new oe,Vh=[];function WE(e){return new po(e)}function PE(e){return V(e,void 0,WE)}function Rt(e,t){return V(e,void 0,function(n){return n instanceof t?n:new t(n)})}function dn(e){e=g(e,g.EMPTY_OBJECT);let t=e.id;l(t)||(t=Yn()),this._availability=void 0,this._id=t,this._definitionChanged=new Ne,this._name=e.name,this._show=g(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...Vh],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function Gh(e,t,n){const i=t.length;for(let o=0;o<i;o++){const a=t[o],r=a._show;(!n&&r)!==(n&&r)&&Gh(a,a._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(dn.prototype,{availability:Mh("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Mh("name"),show:{get:function(){return this._show},set:function(e){if(!l(e))throw new C("value is required.");if(e===this._show)return;const t=this.isShowing;this._show=e;const n=this.isShowing;t!==n&&Gh(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){const t=this._parent;if(t===e)return;const n=this.isShowing;if(l(t)){const o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,l(e)&&e._children.push(this);const i=this.isShowing;n!==i&&Gh(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Rt("billboard",ms),box:Rt("box",Ps),corridor:Rt("corridor",Rs),cylinder:Rt("cylinder",zs),description:V("description"),ellipse:Rt("ellipse",Ls),ellipsoid:Rt("ellipsoid",Ns),label:Rt("label",Fs),model:Rt("model",Us),tileset:Rt("tileset",ks),orientation:V("orientation"),path:Rt("path",Vs),plane:Rt("plane",Gs),point:Rt("point",qs),polygon:Rt("polygon",Hs),polyline:Rt("polyline",js),polylineVolume:Rt("polylineVolume",Ys),properties:Rt("properties",yn),position:PE("position"),rectangle:Rt("rectangle",Xs),viewFrom:V("viewFrom"),wall:Rt("wall",$s)}),dn.registerEntityType=function(e,t){Object.defineProperties(dn.prototype,{[e]:Rt(e,t)}),Vh.includes(e)||Vh.push(e)},dn.prototype.isAvailable=function(e){if(!l(e))throw new C("time is required.");const t=this._availability;return!l(t)||t.contains(e)},dn.prototype.addProperty=function(e){const t=this._propertyNames;if(!l(e))throw new C("propertyName is required.");if(t.indexOf(e)!==-1)throw new C(`${e} is already a registered property.`);if(e in this)throw new C(`${e} is a reserved property name.`);t.push(e),Object.defineProperty(this,e,Mh(e,!0))},dn.prototype.removeProperty=function(e){const n=this._propertyNames.indexOf(e);if(!l(e))throw new C("propertyName is required.");if(n===-1)throw new C(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e]},dn.prototype.merge=function(e){if(!l(e))throw new C("source is required.");this.name=g(this.name,e.name),this.availability=g(this.availability,e.availability);const t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){const a=n[o];if(a==="parent"||a==="name"||a==="availability"||a==="children")continue;const r=this[a],f=e[a];!l(r)&&t.indexOf(a)===-1&&this.addProperty(a),l(f)&&(l(r)?l(r.merge)&&r.merge(f):l(f.merge)&&l(f.clone)?this[a]=f.clone():this[a]=f)}};const sm=new G,rm=new u,am=new ie;dn.prototype.computeModelMatrix=function(e,t){_.typeOf.object("time",e);const n=ve.getValueOrUndefined(this._position,e,rm);if(!l(n))return;const i=ve.getValueOrUndefined(this._orientation,e,am);return l(i)?t=k.fromRotationTranslation(G.fromQuaternion(i,sm),n,t):t=Ce.eastNorthUpToFixedFrame(n,void 0,t),t},dn.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){_.typeOf.object("time",e);const a=ve.getValueOrDefault(t,e,ii.NONE);let r=ve.getValueOrUndefined(this._position,e,rm);if(a===ii.NONE||!l(r)||u.equalsEpsilon(r,u.ZERO,S.EPSILON8))return this.computeModelMatrix(e,o);const f=i.cartesianToCartographic(r,vE);ta(a)?f.height=n:f.height+=n,r=i.cartographicToCartesian(f,r);const c=ve.getValueOrUndefined(this._orientation,e,am);return l(c)?o=k.fromRotationTranslation(G.fromQuaternion(c,sm),r,o):o=Ce.eastNorthUpToFixedFrame(r,void 0,o),o},dn.supportsMaterialsforEntitiesOnTerrain=function(e){return un.supportsMaterials(e)},dn.supportsPolylinesOnTerrain=function(e){return xi.isSupported(e)};const vt={},BE=new Z(0,0,0,1);let Jt=new Z;const RE=new be,qh=new q,Hh=new q;vt.worldToWindowCoordinates=function(e,t,n){return vt.worldWithEyeOffsetToWindowCoordinates(e,t,u.ZERO,n)};const cm=new Z,hm=new u;function Zs(e,t,n,i){const o=n.viewMatrix,a=k.multiplyByVector(o,Z.fromElements(e.x,e.y,e.z,1,cm),cm),r=u.multiplyComponents(t,u.normalize(a,hm),hm);return a.x+=t.x+r.x,a.y+=t.y+r.y,a.z+=r.z,k.multiplyByVector(n.frustum.projectionMatrix,a,i)}const zE=new oe(Math.PI,S.PI_OVER_TWO),LE=new u,NE=new u;vt.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){if(!l(e))throw new C("scene is required.");if(!l(t))throw new C("position is required.");const o=e.frameState,a=vt.computeActualEllipsoidPosition(o,t,BE);if(!l(a))return;const r=e.canvas,f=RE;f.x=0,f.y=0,f.width=r.clientWidth,f.height=r.clientHeight;const c=e.camera;let h=!1;if(o.mode===ye.SCENE2D){const d=e.mapProjection,p=zE,m=d.project(p,LE),T=u.clone(c.position,NE),y=c.frustum.clone(),w=k.computeViewportTransformation(f,0,1,new k),A=c.frustum.projectionMatrix,E=c.positionWC.y,b=u.fromElements(S.sign(E)*m.x-E,0,-c.positionWC.x),D=Ce.pointToGLWindowCoordinates(A,w,b);if(E===0||D.x<=0||D.x>=r.clientWidth)h=!0;else{if(D.x>r.clientWidth*.5){f.width=D.x,c.frustum.right=m.x-E,Jt=Zs(a,n,c,Jt),vt.clipToGLWindowCoordinates(f,Jt,qh),f.x+=D.x,c.position.x=-c.position.x;const O=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-O,Jt=Zs(a,n,c,Jt),vt.clipToGLWindowCoordinates(f,Jt,Hh)}else{f.x+=D.x,f.width-=D.x,c.frustum.left=-m.x-E,Jt=Zs(a,n,c,Jt),vt.clipToGLWindowCoordinates(f,Jt,qh),f.x=f.x-f.width,c.position.x=-c.position.x;const O=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-O,Jt=Zs(a,n,c,Jt),vt.clipToGLWindowCoordinates(f,Jt,Hh)}u.clone(T,c.position),c.frustum=y.clone(),i=q.clone(qh,i),(i.x<0||i.x>r.clientWidth)&&(i.x=Hh.x)}}if(o.mode!==ye.SCENE2D||h){if(Jt=Zs(a,n,c,Jt),Jt.z<0&&!(c.frustum instanceof ln)&&!(c.frustum instanceof zn))return;i=vt.clipToGLWindowCoordinates(f,Jt,i)}return i.y=r.clientHeight-i.y,i},vt.worldToDrawingBufferCoordinates=function(e,t,n){if(n=vt.worldToWindowCoordinates(e,t,n),!!l(n))return vt.transformWindowToDrawingBuffer(e,n,n)};const Si=new u,FE=new oe;vt.computeActualEllipsoidPosition=function(e,t,n){const i=e.mode;if(i===ye.SCENE3D)return u.clone(t,n);const o=e.mapProjection,a=o.ellipsoid.cartesianToCartographic(t,FE);if(!l(a))return;if(o.project(a,Si),i===ye.COLUMBUS_VIEW)return u.fromElements(Si.z,Si.x,Si.y,n);if(i===ye.SCENE2D)return u.fromElements(0,Si.x,Si.y,n);const r=e.morphTime;return u.fromElements(S.lerp(Si.z,t.x,r),S.lerp(Si.x,t.y,r),S.lerp(Si.y,t.z,r),n)};const fm=new u,lm=new u,um=new k;vt.clipToGLWindowCoordinates=function(e,t,n){return u.divideByScalar(t,t.w,fm),k.computeViewportTransformation(e,0,1,um),k.multiplyByPoint(um,fm,lm),q.fromCartesian3(lm,n)},vt.transformWindowToDrawingBuffer=function(e,t,n){const i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,a=e.drawingBufferHeight/i.clientHeight;return q.fromElements(t.x*o,t.y*a,n)};const ME=new Z,dm=new Z;vt.drawingBufferToWorldCoordinates=function(e,t,n,i){const a=e.context.uniformState,r=a.currentFrustum,f=r.x,c=r.y;if(e.frameState.useLogDepth){const T=n*a.log2FarDepthFromNearPlusOne,y=Math.pow(2,T)-1;n=c*(1-f/(y+f))/(c-f)}const h=e.view.passState.viewport,d=Z.clone(Z.UNIT_W,ME);d.x=(t.x-h.x)/h.width*2-1,d.y=(t.y-h.y)/h.height*2-1,d.z=n*2-1,d.w=1;let p,m=e.camera.frustum;if(l(m.fovy)){p=k.multiplyByVector(a.inverseViewProjection,d,dm);const T=1/p.w;u.multiplyByScalar(p,T,p)}else{const T=m.offCenterFrustum;l(T)&&(m=T),p=dm,p.x=(d.x*(m.right-m.left)+m.left+m.right)*.5,p.y=(d.y*(m.top-m.bottom)+m.bottom+m.top)*.5,p.z=(d.z*(f-c)-f-c)*.5,p.w=1,p=k.multiplyByVector(a.inverseView,p,p)}return u.fromCartesian4(p,i)};const UE=`uniform sampler2D u_atlas;
5697
5697
 
5698
5698
  #ifdef VECTOR_TILE
5699
5699
  uniform vec4 u_highlightColor;
@@ -6337,19 +6337,19 @@ if (lengthSq < disableDepthTestDistance) {
6337
6337
  v_color.a *= translucency;
6338
6338
  v_splitDirection = splitDirection;
6339
6339
  }
6340
- `;function me(e,t){if(e=g(e,g.EMPTY_OBJECT),l(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,a=e.distanceDisplayCondition;if(l(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Ie.clone(n)}if(l(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Ie.clone(i)}if(l(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=Ie.clone(o)}if(l(a)){if(a.far<=a.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");a=it.clone(a)}this._show=g(e.show,!0),this._position=u.clone(g(e.position,u.ZERO)),this._actualPosition=u.clone(this._position),this._pixelOffset=q.clone(g(e.pixelOffset,q.ZERO)),this._translate=new q(0,0),this._eyeOffset=u.clone(g(e.eyeOffset,u.ZERO)),this._heightReference=g(e.heightReference,Ln.NONE),this._verticalOrigin=g(e.verticalOrigin,rt.CENTER),this._horizontalOrigin=g(e.horizontalOrigin,Nn.CENTER),this._scale=g(e.scale,1),this._color=D.clone(g(e.color,D.WHITE)),this._rotation=g(e.rotation,0),this._alignedAxis=u.clone(g(e.alignedAxis,u.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=g(e.sizeInMeters,!1),this._distanceDisplayCondition=a,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=g(e.collection,t),this._pickId=void 0,this._pickPrimitive=g(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;const r=e.image;let f=e.imageId;l(r)&&(l(f)||(typeof r=="string"?f=r:l(r.src)?f=r.src:f=Xn()),this._imageId=f,this._image=r),l(e.imageSubRegion)&&(this._imageId=f,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ye.SCENE3D,this._clusterShow=!0,this._outlineColor=D.clone(g(e.outlineColor,D.BLACK)),this._outlineWidth=g(e.outlineWidth,0),this._updateClamping(),this._splitDirection=g(e.splitDirection,Bu.NONE)}const pm=me.SHOW_INDEX=0,Ea=me.POSITION_INDEX=1,mm=me.PIXEL_OFFSET_INDEX=2,VE=me.EYE_OFFSET_INDEX=3,GE=me.HORIZONTAL_ORIGIN_INDEX=4,qE=me.VERTICAL_ORIGIN_INDEX=5,HE=me.SCALE_INDEX=6,ba=me.IMAGE_INDEX_INDEX=7,_m=me.COLOR_INDEX=8,jE=me.ROTATION_INDEX=9,YE=me.ALIGNED_AXIS_INDEX=10,XE=me.SCALE_BY_DISTANCE_INDEX=11,$E=me.TRANSLUCENCY_BY_DISTANCE_INDEX=12,ZE=me.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,KE=me.DISTANCE_DISPLAY_CONDITION=14,QE=me.DISABLE_DEPTH_DISTANCE=15;me.TEXTURE_COORDINATE_BOUNDS=16;const gm=me.SDF_INDEX=17,JE=me.SPLIT_DIRECTION_INDEX=18;me.NUMBER_OF_PROPERTIES=19;function tt(e,t){const n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(me.prototype,{show:{get:function(){return this._show},set:function(e){_.typeOf.bool("value",e),this._show!==e&&(this._show=e,tt(this,pm))}},position:{get:function(){return this._position},set:function(e){_.typeOf.object("value",e);const t=this._position;u.equals(t,e)||(u.clone(e,t),u.clone(e,this._actualPosition),this._updateClamping(),tt(this,Ea))}},heightReference:{get:function(){return this._heightReference},set:function(e){_.typeOf.number("value",e);const t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),tt(this,Ea))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){_.typeOf.object("value",e);const t=this._pixelOffset;q.equals(t,e)||(q.clone(e,t),tt(this,mm))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(l(e)&&(_.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");const t=this._scaleByDistance;Ie.equals(t,e)||(this._scaleByDistance=Ie.clone(e,t),tt(this,XE))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(l(e)&&(_.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");const t=this._translucencyByDistance;Ie.equals(t,e)||(this._translucencyByDistance=Ie.clone(e,t),tt(this,$E))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(l(e)&&(_.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");const t=this._pixelOffsetScaleByDistance;Ie.equals(t,e)||(this._pixelOffsetScaleByDistance=Ie.clone(e,t),tt(this,ZE))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){_.typeOf.object("value",e);const t=this._eyeOffset;u.equals(t,e)||(u.clone(e,t),tt(this,VE))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){_.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,tt(this,GE))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){_.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,tt(this,qE))}},scale:{get:function(){return this._scale},set:function(e){_.typeOf.number("value",e),this._scale!==e&&(this._scale=e,tt(this,HE))}},color:{get:function(){return this._color},set:function(e){_.typeOf.object("value",e);const t=this._color;D.equals(t,e)||(D.clone(e,t),tt(this,_m))}},rotation:{get:function(){return this._rotation},set:function(e){_.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,tt(this,jE))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){_.typeOf.object("value",e);const t=this._alignedAxis;u.equals(t,e)||(u.clone(e,t),tt(this,YE))}},width:{get:function(){return g(this._width,this._imageWidth)},set:function(e){l(e)&&_.typeOf.number("value",e),this._width!==e&&(this._width=e,tt(this,ba))}},height:{get:function(){return g(this._height,this._imageHeight)},set:function(e){l(e)&&_.typeOf.number("value",e),this._height!==e&&(this._height=e,tt(this,ba))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){_.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,tt(this,_m))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!it.equals(e,this._distanceDisplayCondition)){if(l(e)&&(_.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");this._distanceDisplayCondition=it.clone(e,this._distanceDisplayCondition),tt(this,KE)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(l(e)&&(_.typeOf.number("value",e),e<0))throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,tt(this,QE))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof ae?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(Xn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,tt(this,ba))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=u.clone(e,this._actualClampedPosition),tt(this,Ea)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,tt(this,pm))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!l(e))throw new C("value is required.");const t=this._outlineColor;D.equals(t,e)||(D.clone(e,t),tt(this,gm))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,tt(this,gm))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,tt(this,JE))}}}),me.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},me.prototype._updateClamping=function(){me._updateClamping(this._billboardCollection,this)};const xa=new oe;me._updateClamping=function(e,t){const n=e._scene;if(!l(n)){if(t._heightReference!==Ln.NONE)throw new C("Height reference is not supported without a scene.");return}const i=g(n.ellipsoid,pe.default),o=n.frameState.mode,a=o!==t._mode;if(t._mode=o,(t._heightReference===Ln.NONE||a)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===Ln.NONE||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();const r=i.cartesianToCartographic(t._position);if(!l(r)){t._actualClampedPosition=void 0;return}function f(h){const d=i.cartographicToCartesian(h,t._clampedPosition);IT(t._heightReference)&&(t._mode===ye.SCENE3D?(h.height+=r.height,i.cartographicToCartesian(h,d)):d.x+=r.height),t._clampedPosition=d}t._removeCallbackFunc=n.updateHeight(r,f,t._heightReference),oe.clone(r,xa);const c=n.getHeight(r,t._heightReference);l(c)&&(xa.height=c),f(xa)},me.prototype._loadImage=function(){const e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion;let o;const a=this;function r(c){if(a._imageId!==t||a._image!==n||!be.equals(a._imageSubRegion,i))return;const h=e.textureCoordinates[c];a._imageWidth=e.texture.width*h.width,a._imageHeight=e.texture.height*h.height,a._imageIndex=c,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,tt(a,ba);const d=a._billboardCollection._scene;l(d)&&d.frameState.afterRender.push(()=>!0)}if(l(n)&&(o=e.addImage(t,n)),l(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!l(o))return;const f=e.getImageIndex(t);if(l(f)&&!l(i)){r(f);return}o.then(r).catch(function(c){console.error(`Error loading image for billboard: ${c}`),a._imageIndexPromise=void 0})},me.prototype.setImage=function(e,t){if(!l(e))throw new C("id is required.");if(!l(t))throw new C("image is required.");this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())},me.prototype.setImageSubRegion=function(e,t){if(!l(e))throw new C("id is required.");if(!l(t))throw new C("subRegion is required.");this._imageId===e&&be.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=be.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())},me.prototype._setTranslate=function(e){if(!l(e))throw new C("value is required.");const t=this._translate;q.equals(t,e)||(q.clone(e,t),tt(this,mm))},me.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},me.prototype._setActualPosition=function(e){l(this._clampedPosition)||u.clone(e,this._actualPosition),tt(this,Ea)};const Tm=new Z;me._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ye.SCENE3D?t:(k.multiplyByPoint(i,t,Tm),vt.computeActualEllipsoidPosition(n,Tm))};const ym=new u;me._computeScreenSpacePosition=function(e,t,n,i,o,a){const r=k.multiplyByPoint(e,t,ym),f=vt.worldWithEyeOffsetToWindowCoordinates(o,r,n,a);if(l(f))return q.add(f,i,f),f};const Sa=new q(0,0);me.prototype.computeScreenSpacePosition=function(e,t){const n=this._billboardCollection;if(l(t)||(t=new q),!l(n))throw new C("Billboard must be in a collection. Was it removed?");if(!l(e))throw new C("scene is required.");q.clone(this._pixelOffset,Sa),q.add(Sa,this._translate,Sa);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==ye.SCENE3D)){const r=e.mapProjection,f=r.ellipsoid,c=r.unproject(o,xa);o=f.cartographicToCartesian(c,ym),i=k.IDENTITY}return me._computeScreenSpacePosition(i,o,this._eyeOffset,Sa,e,t)},me.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height;const a=e.scale;i*=a,o*=a;let r=t.x;e.horizontalOrigin===Nn.RIGHT?r-=i:e.horizontalOrigin===Nn.CENTER&&(r-=i*.5);let f=t.y;return e.verticalOrigin===rt.BOTTOM||e.verticalOrigin===rt.BASELINE?f-=o:e.verticalOrigin===rt.CENTER&&(f-=o*.5),l(n)||(n=new be),n.x=r,n.y=f,n.width=i,n.height=o,n},me.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&u.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&be.equals(this._imageSubRegion,e._imageSubRegion)&&D.equals(this._color,e._color)&&q.equals(this._pixelOffset,e._pixelOffset)&&q.equals(this._translate,e._translate)&&u.equals(this._eyeOffset,e._eyeOffset)&&Ie.equals(this._scaleByDistance,e._scaleByDistance)&&Ie.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ie.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&it.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection},me.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};const _t=Object.freeze({OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2}),Cn=Object.freeze({FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25});function Ii(e,t,n,i,o){this.bottomLeft=g(e,q.ZERO),this.topRight=g(t,q.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}const eb=new q(16,16);function hi(e){e=g(e,g.EMPTY_OBJECT);const t=g(e.borderWidthInPixels,1),n=g(e.initialSize,eb);if(!l(e.context))throw new C("context is required.");if(t<0)throw new C("borderWidthInPixels must be greater than or equal to zero.");if(n.x<1||n.y<1)throw new C("initialSize must be greater than zero.");this._context=e.context,this._pixelFormat=g(e.pixelFormat,ge.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Xn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(hi.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Mt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function tb(e,t){const n=e._context,i=e.numberOfImages,o=2,a=e._borderWidthInPixels;if(i>0){const r=e._texture.width,f=e._texture.height,c=o*(r+t.width+a),h=o*(f+t.height+a),d=r/c,p=f/h,m=new Ii(new q(r+a,a),new q(c,f)),T=new Ii(new q,new q(c,f),e._root,m),y=new Ii(new q(a,f+a),new q(c,h)),w=new Ii(new q,new q(c,h),T,y);for(let b=0;b<e._textureCoordinates.length;b++){const I=e._textureCoordinates[b];l(I)&&(I.x*=d,I.y*=p,I.width*=d,I.height*=p)}const A=new Mt({context:e._context,width:c,height:h,pixelFormat:e._pixelFormat}),E=new Rn({context:n,colorTextures:[e._texture],destroyAttachments:!1});E._bind(),A.copyFromFramebuffer(0,0,0,0,c,h),E._unBind(),E.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=A,e._root=w}else{let r=o*(t.width+2*a),f=o*(t.height+2*a);r<e._initialSize.x&&(r=e._initialSize.x),f<e._initialSize.y&&(f=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Mt({context:e._context,width:r,height:f,pixelFormat:e._pixelFormat}),e._root=new Ii(new q(a,a),new q(r,f))}}function Ia(e,t,n){if(l(t)){if(!l(t.childNode1)&&!l(t.childNode2)){if(l(t.imageIndex))return;const i=t.topRight.x-t.bottomLeft.x,o=t.topRight.y-t.bottomLeft.y,a=i-n.width,r=o-n.height;if(a<0||r<0)return;if(a===0&&r===0)return t;if(a>r){t.childNode1=new Ii(new q(t.bottomLeft.x,t.bottomLeft.y),new q(t.bottomLeft.x+n.width,t.topRight.y));const f=t.bottomLeft.x+n.width+e._borderWidthInPixels;f<t.topRight.x&&(t.childNode2=new Ii(new q(f,t.bottomLeft.y),new q(t.topRight.x,t.topRight.y)))}else{t.childNode1=new Ii(new q(t.bottomLeft.x,t.bottomLeft.y),new q(t.topRight.x,t.bottomLeft.y+n.height));const f=t.bottomLeft.y+n.height+e._borderWidthInPixels;f<t.topRight.y&&(t.childNode2=new Ii(new q(t.bottomLeft.x,f),new q(t.topRight.x,t.topRight.y)))}return Ia(e,t.childNode1,n)}return Ia(e,t.childNode1,n)||Ia(e,t.childNode2,n)}}function Cm(e,t,n){const i=Ia(e,e._root,t);if(l(i)){i.imageIndex=n;const o=e._texture.width,a=e._texture.height,r=i.topRight.x-i.bottomLeft.x,f=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/o,h=i.bottomLeft.y/a,d=r/o,p=f/a;e._textureCoordinates[n]=new be(c,h,d,p),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else tb(e,t),Cm(e,t,n);e._guid=Xn()}function wm(e,t){if(!l(e)||e.isDestroyed())return-1;const n=e.numberOfImages;return Cm(e,t,n),n}hi.prototype.getImageIndex=function(e){if(!l(e))throw new C("id is required.");return this._indexHash[e]},hi.prototype.addImageSync=function(e,t){if(!l(e))throw new C("id is required.");if(!l(t))throw new C("image is required.");let n=this._indexHash[e];return l(n)||(n=wm(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n},hi.prototype.addImage=function(e,t){if(!l(e))throw new C("id is required.");if(!l(t))throw new C("image is required.");let n=this._idHash[e];if(l(n))return n;if(typeof t=="function"){if(t=t(e),!l(t))throw new C("image is required.")}else(typeof t=="string"||t instanceof ae)&&(t=ae.createIfNeeded(t).fetchImage());const i=this;return n=Promise.resolve(t).then(function(o){const a=wm(i,o);return i._indexHash[e]=a,a}),this._idHash[e]=n,n},hi.prototype.addSubRegion=function(e,t){if(!l(e))throw new C("id is required.");if(!l(t))throw new C("subRegion is required.");const n=this._idHash[e];if(!l(n))throw new dt(`image with id "${e}" not found in the atlas.`);const i=this;return Promise.resolve(n).then(function(o){if(o===-1)return-1;const a=i._texture.width,r=i._texture.height,f=i._textureCoordinates[o],c=f.x+t.x/a,h=f.y+t.y/r,d=t.width/a,p=t.height/r,m=i._textureCoordinates.push(new be(c,h,d,p))-1;return i._indexHash[e]=m,i._guid=Xn(),m})},hi.prototype.isDestroyed=function(){return!1},hi.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),st(this)};const nb=me.SHOW_INDEX,Ks=me.POSITION_INDEX,Am=me.PIXEL_OFFSET_INDEX,Em=me.EYE_OFFSET_INDEX,ib=me.HORIZONTAL_ORIGIN_INDEX,ob=me.VERTICAL_ORIGIN_INDEX,sb=me.SCALE_INDEX,Qs=me.IMAGE_INDEX_INDEX,bm=me.COLOR_INDEX,rb=me.ROTATION_INDEX,ab=me.ALIGNED_AXIS_INDEX,xm=me.SCALE_BY_DISTANCE_INDEX,Sm=me.TRANSLUCENCY_BY_DISTANCE_INDEX,Im=me.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Dm=me.DISTANCE_DISPLAY_CONDITION,cb=me.DISABLE_DEPTH_DISTANCE,hb=me.TEXTURE_COORDINATE_BOUNDS,Om=me.SDF_INDEX,vm=me.SPLIT_DIRECTION_INDEX,jh=me.NUMBER_OF_PROPERTIES;let qe;const fb={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11,splitDirection:12},lb={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function rn(e){e=g(e,g.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(jh),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new te,this._baseVolumeWC=new te,this._baseVolume2D=new te,this._boundingVolume=new te,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=g(e.show,!0),this.modelMatrix=k.clone(g(e.modelMatrix,k.IDENTITY)),this._modelMatrix=k.clone(k.IDENTITY),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=g(e.debugShowTextureAtlas,!1),this.blendOption=g(e.blendOption,_t.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ye.SCENE3D,this._buffersUsage=[We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW],this._highlightColor=D.clone(D.WHITE);const t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};const n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){const i=this._billboards,o=i.length;for(let a=0;a<o;++a)l(i[a])&&i[a]._updateClamping()},this))}Object.defineProperties(rn.prototype,{length:{get:function(){return Yh(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}});function Wm(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}rn.prototype.add=function(e){const t=new me(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},rn.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},rn.prototype.removeAll=function(){Wm(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Yh(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;const t=[],n=e._billboards,i=n.length;for(let o=0,a=0;o<i;++o){const r=n[o];l(r)&&(r._index=a++,t.push(r))}e._billboards=t}}rn.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},rn.prototype.contains=function(e){return l(e)&&e._billboardCollection===this},rn.prototype.get=function(e){return _.typeOf.number("index",e),Yh(this),this._billboards[e]};let Xh;function ub(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;const i=16384*6-6,o=new Uint16Array(i);for(let a=0,r=0;a<i;a+=6,r+=4)o[a]=r,o[a+1]=r+1,o[a+2]=r+2,o[a+3]=r+0,o[a+4]=r+2,o[a+5]=r+3;return n=Bt.createIndexBuffer({context:e,typedArray:o,usage:We.STATIC_DRAW,indexDatatype:bt.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function db(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=Bt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:We.STATIC_DRAW,indexDatatype:bt.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function pb(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=Bt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:We.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}rn.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<jh;++i){const o=n[i]===0?We.STATIC_DRAW:We.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function mb(e,t,n,i,o,a){const r=[{index:qe.positionHighAndScale,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Ks]},{index:qe.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Ks]},{index:qe.compressedAttribute0,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Am]},{index:qe.compressedAttribute1,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Sm]},{index:qe.compressedAttribute2,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[bm]},{index:qe.eyeOffset,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Em]},{index:qe.scaleByDistance,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[xm]},{index:qe.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Im]},{index:qe.compressedAttribute3,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Dm]},{index:qe.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[hb]},{index:qe.splitDirection,componentsPerAttribute:1,componentDatatype:he.FLOAT,usage:n[vm]}];i&&r.push({index:qe.direction,componentsPerAttribute:2,componentDatatype:he.FLOAT,vertexBuffer:pb(e)}),l(o)&&r.push({index:qe.a_batchId,componentsPerAttribute:1,componentDatatype:he.FLOAT,bufferUsage:We.STATIC_DRAW}),a&&r.push({index:qe.sdf,componentsPerAttribute:2,componentDatatype:he.FLOAT,usage:n[Om]});const f=i?t:4*t;return new Dt(e,r,f,i)}const $h=new Qe;function Pm(e,t,n,i,o){let a;const r=i[qe.positionHighAndScale],f=i[qe.positionLowAndRotation],c=o._getActualPosition();e._mode===ye.SCENE3D&&(te.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),Qe.fromCartesian(c,$h);const h=o.scale,d=o.rotation;d!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,h);const p=$h.high,m=$h.low;e._instanced?(a=o._index,r(a,p.x,p.y,p.z,h),f(a,m.x,m.y,m.z,d)):(a=o._index*4,r(a+0,p.x,p.y,p.z,h),r(a+1,p.x,p.y,p.z,h),r(a+2,p.x,p.y,p.z,h),r(a+3,p.x,p.y,p.z,h),f(a+0,m.x,m.y,m.z,d),f(a+1,m.x,m.y,m.z,d),f(a+2,m.x,m.y,m.z,d),f(a+3,m.x,m.y,m.z,d))}const Dn=new q,On=32768,Ko=65536,Zh=4096,fi=256,_b=128,gb=32,Tb=8,Bm=4,yb=1/256,Rm=0,zm=2,Lm=3,Nm=1;function Fm(e,t,n,i,o){let a;const r=i[qe.compressedAttribute0],f=o.pixelOffset,c=f.x,h=f.y,d=o._translate,p=d.x,m=d.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+p),Math.abs(-h+m));const T=o.horizontalOrigin;let y=o._verticalOrigin,w=o.show&&o.clusterShow;o.color.alpha===0&&(w=!1),y===rt.BASELINE&&(y=rt.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&T===Nn.CENTER,e._allVerticalCenter=e._allVerticalCenter&&y===rt.CENTER;let A=0,E=0,b=0,I=0;const O=o._imageIndex;if(O!==-1){const H=n[O];if(!l(H))throw new C(`Invalid billboard image index: ${O}`);A=H.x,E=H.y,b=H.width,I=H.height}const B=A+b,L=E+I;let F=Math.floor(S.clamp(c,-On,On)+On)*_b;F+=(T+1)*gb,F+=(y+1)*Tb,F+=(w?1:0)*Bm;let N=Math.floor(S.clamp(h,-On,On)+On)*fi,U=Math.floor(S.clamp(p,-On,On)+On)*fi;const M=(S.clamp(m,-On,On)+On)*yb,j=Math.floor(M),Y=Math.floor((M-j)*fi);N+=j,U+=Y,Dn.x=A,Dn.y=E;const s=De.compressTextureCoordinates(Dn);Dn.x=B;const x=De.compressTextureCoordinates(Dn);Dn.y=L;const P=De.compressTextureCoordinates(Dn);Dn.x=A;const z=De.compressTextureCoordinates(Dn);e._instanced?(a=o._index,r(a,F,N,U,s)):(a=o._index*4,r(a+0,F+Rm,N,U,s),r(a+1,F+zm,N,U,x),r(a+2,F+Lm,N,U,P),r(a+3,F+Nm,N,U,z))}function Mm(e,t,n,i,o){let a;const r=i[qe.compressedAttribute1],f=o.alignedAxis;u.equals(f,u.ZERO)||(e._shaderAlignedAxis=!0);let c=0,h=1,d=1,p=1;const m=o.translucencyByDistance;l(m)&&(c=m.near,h=m.nearValue,d=m.far,p=m.farValue,(h!==1||p!==1)&&(e._shaderTranslucencyByDistance=!0));let T=0;const y=o._imageIndex;if(y!==-1){const I=n[y];if(!l(I))throw new C(`Invalid billboard image index: ${y}`);T=I.width}const w=e._textureAtlas.texture.width,A=Math.round(g(o.width,w*T));e._maxSize=Math.max(e._maxSize,A);let E=S.clamp(A,0,Ko),b=0;Math.abs(u.magnitudeSquared(f)-1)<S.EPSILON6&&(b=De.octEncodeFloat(f)),h=S.clamp(h,0,1),h=h===1?255:h*255|0,E=E*fi+h,p=S.clamp(p,0,1),p=p===1?255:p*255|0,b=b*fi+p,e._instanced?(a=o._index,r(a,E,b,c,d)):(a=o._index*4,r(a+0,E,b,c,d),r(a+1,E,b,c,d),r(a+2,E,b,c,d),r(a+3,E,b,c,d))}function Kh(e,t,n,i,o){let a;const r=i[qe.compressedAttribute2],f=o.color,c=l(e._batchTable)?D.WHITE:o.getPickId(t.context).color,h=o.sizeInMeters?1:0,d=Math.abs(u.magnitudeSquared(o.alignedAxis)-1)<S.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&h===1;let p=0;const m=o._imageIndex;if(m!==-1){const F=n[m];if(!l(F))throw new C(`Invalid billboard image index: ${m}`);p=F.height}const T=e._textureAtlas.texture.dimensions,y=Math.round(g(o.height,T.y*p));e._maxSize=Math.max(e._maxSize,y);let w=g(o._labelHorizontalOrigin,-2);w+=2;const A=y*Bm+w;let E=D.floatToByte(f.red),b=D.floatToByte(f.green),I=D.floatToByte(f.blue);const O=E*Ko+b*fi+I;E=D.floatToByte(c.red),b=D.floatToByte(c.green),I=D.floatToByte(c.blue);const B=E*Ko+b*fi+I;let L=D.floatToByte(f.alpha)*Ko+D.floatToByte(c.alpha)*fi;L+=h*2+d,e._instanced?(a=o._index,r(a,O,B,L,A)):(a=o._index*4,r(a+0,O,B,L,A),r(a+1,O,B,L,A),r(a+2,O,B,L,A),r(a+3,O,B,L,A))}function Qh(e,t,n,i,o){let a;const r=i[qe.eyeOffset],f=o.eyeOffset;let c=f.z;if(o._heightReference!==Ln.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(f.x),Math.abs(f.y),Math.abs(c)),e._instanced){let h=0,d=0;const p=o._imageIndex;if(p!==-1){const T=n[p];if(!l(T))throw new C(`Invalid billboard image index: ${p}`);h=T.width,d=T.height}Dn.x=h,Dn.y=d;const m=De.compressTextureCoordinates(Dn);a=o._index,r(a,f.x,f.y,c,m)}else a=o._index*4,r(a+0,f.x,f.y,c,0),r(a+1,f.x,f.y,c,0),r(a+2,f.x,f.y,c,0),r(a+3,f.x,f.y,c,0)}function Um(e,t,n,i,o){let a;const r=i[qe.scaleByDistance];let f=0,c=1,h=1,d=1;const p=o.scaleByDistance;l(p)&&(f=p.near,c=p.nearValue,h=p.far,d=p.farValue,(c!==1||d!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(a=o._index,r(a,f,c,h,d)):(a=o._index*4,r(a+0,f,c,h,d),r(a+1,f,c,h,d),r(a+2,f,c,h,d),r(a+3,f,c,h,d))}function km(e,t,n,i,o){let a;const r=i[qe.pixelOffsetScaleByDistance];let f=0,c=1,h=1,d=1;const p=o.pixelOffsetScaleByDistance;l(p)&&(f=p.near,c=p.nearValue,h=p.far,d=p.farValue,(c!==1||d!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(a=o._index,r(a,f,c,h,d)):(a=o._index*4,r(a+0,f,c,h,d),r(a+1,f,c,h,d),r(a+2,f,c,h,d),r(a+3,f,c,h,d))}function Vm(e,t,n,i,o){let a;const r=i[qe.compressedAttribute3];let f=0,c=Number.MAX_VALUE;const h=o.distanceDisplayCondition;l(h)&&(f=h.near,c=h.far,f*=f,c*=c,e._shaderDistanceDisplayCondition=!0);let d=o.disableDepthTestDistance;const p=ta(o.heightReference)&&t.context.depthTexture;l(d)||(d=p?5e3:0),d*=d,(p||d>0)&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let m,T;if(l(o._labelDimensions))T=o._labelDimensions.x,m=o._labelDimensions.y;else{let E=0,b=0;const I=o._imageIndex;if(I!==-1){const B=n[I];if(!l(B))throw new C(`Invalid billboard image index: ${I}`);E=B.height,b=B.width}m=Math.round(g(o.height,e._textureAtlas.texture.dimensions.y*E));const O=e._textureAtlas.texture.width;T=Math.round(g(o.width,O*b))}const y=Math.floor(S.clamp(T,0,Zh)),w=Math.floor(S.clamp(m,0,Zh)),A=y*Zh+w;e._instanced?(a=o._index,r(a,f,c,d,A)):(a=o._index*4,r(a+0,f,c,d,A),r(a+1,f,c,d,A),r(a+2,f,c,d,A),r(a+3,f,c,d,A))}function Gm(e,t,n,i,o){if(ta(o.heightReference)){const y=e._scene,w=t.context,A=t.globeTranslucencyState.translucent,E=l(y.globe)&&y.globe.depthTestAgainstTerrain;e._shaderClampToGround=w.depthTexture&&!A&&E}let a;const r=i[qe.textureCoordinateBoundsOrLabelTranslate];if(xe.maximumVertexTextureImageUnits>0){let y=0,w=0;l(o._labelTranslate)&&(y=o._labelTranslate.x,w=o._labelTranslate.y),e._instanced?(a=o._index,r(a,y,w,0,0)):(a=o._index*4,r(a+0,y,w,0,0),r(a+1,y,w,0,0),r(a+2,y,w,0,0),r(a+3,y,w,0,0));return}let f=0,c=0,h=0,d=0;const p=o._imageIndex;if(p!==-1){const y=n[p];if(!l(y))throw new C(`Invalid billboard image index: ${p}`);f=y.x,c=y.y,h=y.width,d=y.height}const m=f+h,T=c+d;e._instanced?(a=o._index,r(a,f,c,m,T)):(a=o._index*4,r(a+0,f,c,m,T),r(a+1,f,c,m,T),r(a+2,f,c,m,T),r(a+3,f,c,m,T))}function Cb(e,t,n,i,o){if(!l(e._batchTable))return;const a=i[qe.a_batchId],r=o._batchIndex;let f;e._instanced?(f=o._index,a(f,r)):(f=o._index*4,a(f+0,r),a(f+1,r),a(f+2,r),a(f+3,r))}function qm(e,t,n,i,o){if(!e._sdf)return;let a;const r=i[qe.sdf],f=o.outlineColor,c=o.outlineWidth,h=D.floatToByte(f.red),d=D.floatToByte(f.green),p=D.floatToByte(f.blue),m=h*Ko+d*fi+p,T=c/Cn.RADIUS,y=D.floatToByte(f.alpha)*Ko+D.floatToByte(T)*fi;e._instanced?(a=o._index,r(a,m,y)):(a=o._index*4,r(a+0,m+Rm,y),r(a+1,m+zm,y),r(a+2,m+Lm,y),r(a+3,m+Nm,y))}function Hm(e,t,n,i,o){const a=i[qe.splitDirection];let r=0;const f=o.splitDirection;l(f)&&(r=f);let c;e._instanced?(c=o._index,a(c,r)):(c=o._index*4,a(c+0,r),a(c+1,r),a(c+2,r),a(c+3,r))}function wb(e,t,n,i,o){Pm(e,t,n,i,o),Fm(e,t,n,i,o),Mm(e,t,n,i,o),Kh(e,t,n,i,o),Qh(e,t,n,i,o),Um(e,t,n,i,o),km(e,t,n,i,o),Vm(e,t,n,i,o),Gm(e,t,n,i,o),Cb(e,t,n,i,o),qm(e,t,n,i,o),Hm(e,t,n,i,o)}function Jh(e,t,n,i,o,a){let r;i.mode===ye.SCENE3D?(r=e._baseVolume,e._boundingVolumeDirty=!0):r=e._baseVolume2D;const f=[];for(let c=0;c<n;++c){const h=t[c],d=h.position,p=me._computeActualPosition(h,d,i,o);l(p)&&(h._setActualPosition(p),a?f.push(p):te.expand(r,p,r))}a&&te.fromPoints(f,r)}function Ab(e,t){const n=t.mode,i=e._billboards,o=e._billboardsToUpdate,a=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ye.SCENE3D&&!k.equals(a,e.modelMatrix)?(e._mode=n,k.clone(e.modelMatrix,a),e._createVertexArray=!0,(n===ye.SCENE3D||n===ye.SCENE2D||n===ye.COLUMBUS_VIEW)&&Jh(e,i,i.length,t,a,!0)):n===ye.MORPHING?Jh(e,i,i.length,t,a,!0):(n===ye.SCENE2D||n===ye.COLUMBUS_VIEW)&&Jh(e,o,e._billboardsToUpdateIndex,t,a,!1)}function Eb(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);const a=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+a}function bb(e,t){const i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture;
6340
+ `;function me(e,t){if(e=g(e,g.EMPTY_OBJECT),l(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,a=e.distanceDisplayCondition;if(l(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Ie.clone(n)}if(l(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Ie.clone(i)}if(l(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=Ie.clone(o)}if(l(a)){if(a.far<=a.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");a=it.clone(a)}this._show=g(e.show,!0),this._position=u.clone(g(e.position,u.ZERO)),this._actualPosition=u.clone(this._position),this._pixelOffset=q.clone(g(e.pixelOffset,q.ZERO)),this._translate=new q(0,0),this._eyeOffset=u.clone(g(e.eyeOffset,u.ZERO)),this._heightReference=g(e.heightReference,ii.NONE),this._verticalOrigin=g(e.verticalOrigin,rt.CENTER),this._horizontalOrigin=g(e.horizontalOrigin,Ln.CENTER),this._scale=g(e.scale,1),this._color=I.clone(g(e.color,I.WHITE)),this._rotation=g(e.rotation,0),this._alignedAxis=u.clone(g(e.alignedAxis,u.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=g(e.sizeInMeters,!1),this._distanceDisplayCondition=a,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=g(e.collection,t),this._pickId=void 0,this._pickPrimitive=g(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;const r=e.image;let f=e.imageId;l(r)&&(l(f)||(typeof r=="string"?f=r:l(r.src)?f=r.src:f=Yn()),this._imageId=f,this._image=r),l(e.imageSubRegion)&&(this._imageId=f,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ye.SCENE3D,this._clusterShow=!0,this._outlineColor=I.clone(g(e.outlineColor,I.BLACK)),this._outlineWidth=g(e.outlineWidth,0),this._updateClamping(),this._splitDirection=g(e.splitDirection,Bu.NONE)}const pm=me.SHOW_INDEX=0,Ea=me.POSITION_INDEX=1,mm=me.PIXEL_OFFSET_INDEX=2,VE=me.EYE_OFFSET_INDEX=3,GE=me.HORIZONTAL_ORIGIN_INDEX=4,qE=me.VERTICAL_ORIGIN_INDEX=5,HE=me.SCALE_INDEX=6,ba=me.IMAGE_INDEX_INDEX=7,_m=me.COLOR_INDEX=8,jE=me.ROTATION_INDEX=9,YE=me.ALIGNED_AXIS_INDEX=10,XE=me.SCALE_BY_DISTANCE_INDEX=11,$E=me.TRANSLUCENCY_BY_DISTANCE_INDEX=12,ZE=me.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,KE=me.DISTANCE_DISPLAY_CONDITION=14,QE=me.DISABLE_DEPTH_DISTANCE=15;me.TEXTURE_COORDINATE_BOUNDS=16;const gm=me.SDF_INDEX=17,JE=me.SPLIT_DIRECTION_INDEX=18;me.NUMBER_OF_PROPERTIES=19;function tt(e,t){const n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(me.prototype,{show:{get:function(){return this._show},set:function(e){_.typeOf.bool("value",e),this._show!==e&&(this._show=e,tt(this,pm))}},position:{get:function(){return this._position},set:function(e){_.typeOf.object("value",e);const t=this._position;u.equals(t,e)||(u.clone(e,t),u.clone(e,this._actualPosition),this._updateClamping(),tt(this,Ea))}},heightReference:{get:function(){return this._heightReference},set:function(e){_.typeOf.number("value",e);const t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),tt(this,Ea))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){_.typeOf.object("value",e);const t=this._pixelOffset;q.equals(t,e)||(q.clone(e,t),tt(this,mm))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(l(e)&&(_.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");const t=this._scaleByDistance;Ie.equals(t,e)||(this._scaleByDistance=Ie.clone(e,t),tt(this,XE))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(l(e)&&(_.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");const t=this._translucencyByDistance;Ie.equals(t,e)||(this._translucencyByDistance=Ie.clone(e,t),tt(this,$E))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(l(e)&&(_.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");const t=this._pixelOffsetScaleByDistance;Ie.equals(t,e)||(this._pixelOffsetScaleByDistance=Ie.clone(e,t),tt(this,ZE))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){_.typeOf.object("value",e);const t=this._eyeOffset;u.equals(t,e)||(u.clone(e,t),tt(this,VE))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){_.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,tt(this,GE))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){_.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,tt(this,qE))}},scale:{get:function(){return this._scale},set:function(e){_.typeOf.number("value",e),this._scale!==e&&(this._scale=e,tt(this,HE))}},color:{get:function(){return this._color},set:function(e){_.typeOf.object("value",e);const t=this._color;I.equals(t,e)||(I.clone(e,t),tt(this,_m))}},rotation:{get:function(){return this._rotation},set:function(e){_.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,tt(this,jE))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){_.typeOf.object("value",e);const t=this._alignedAxis;u.equals(t,e)||(u.clone(e,t),tt(this,YE))}},width:{get:function(){return g(this._width,this._imageWidth)},set:function(e){l(e)&&_.typeOf.number("value",e),this._width!==e&&(this._width=e,tt(this,ba))}},height:{get:function(){return g(this._height,this._imageHeight)},set:function(e){l(e)&&_.typeOf.number("value",e),this._height!==e&&(this._height=e,tt(this,ba))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){_.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,tt(this,_m))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!it.equals(e,this._distanceDisplayCondition)){if(l(e)&&(_.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");this._distanceDisplayCondition=it.clone(e,this._distanceDisplayCondition),tt(this,KE)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(l(e)&&(_.typeOf.number("value",e),e<0))throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,tt(this,QE))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof ae?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(Yn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,tt(this,ba))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=u.clone(e,this._actualClampedPosition),tt(this,Ea)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,tt(this,pm))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!l(e))throw new C("value is required.");const t=this._outlineColor;I.equals(t,e)||(I.clone(e,t),tt(this,gm))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,tt(this,gm))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,tt(this,JE))}}}),me.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},me.prototype._updateClamping=function(){me._updateClamping(this._billboardCollection,this)};const xa=new oe;me._updateClamping=function(e,t){const n=e._scene;if(!l(n)){if(t._heightReference!==ii.NONE)throw new C("Height reference is not supported without a scene.");return}const i=g(n.ellipsoid,pe.default),o=n.frameState.mode,a=o!==t._mode;if(t._mode=o,(t._heightReference===ii.NONE||a)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===ii.NONE||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();const r=i.cartesianToCartographic(t._position);if(!l(r)){t._actualClampedPosition=void 0;return}function f(h){const d=i.cartographicToCartesian(h,t._clampedPosition);IT(t._heightReference)&&(t._mode===ye.SCENE3D?(h.height+=r.height,i.cartographicToCartesian(h,d)):d.x+=r.height),t._clampedPosition=d}t._removeCallbackFunc=n.updateHeight(r,f,t._heightReference),oe.clone(r,xa);const c=n.getHeight(r,t._heightReference);l(c)&&(xa.height=c),f(xa)},me.prototype._loadImage=function(){const e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion;let o;const a=this;function r(c){if(a._imageId!==t||a._image!==n||!be.equals(a._imageSubRegion,i))return;const h=e.textureCoordinates[c];a._imageWidth=e.texture.width*h.width,a._imageHeight=e.texture.height*h.height,a._imageIndex=c,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,tt(a,ba);const d=a._billboardCollection._scene;l(d)&&d.frameState.afterRender.push(()=>!0)}if(l(n)&&(o=e.addImage(t,n)),l(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!l(o))return;const f=e.getImageIndex(t);if(l(f)&&!l(i)){r(f);return}o.then(r).catch(function(c){console.error(`Error loading image for billboard: ${c}`),a._imageIndexPromise=void 0})},me.prototype.setImage=function(e,t){if(!l(e))throw new C("id is required.");if(!l(t))throw new C("image is required.");this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())},me.prototype.setImageSubRegion=function(e,t){if(!l(e))throw new C("id is required.");if(!l(t))throw new C("subRegion is required.");this._imageId===e&&be.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=be.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())},me.prototype._setTranslate=function(e){if(!l(e))throw new C("value is required.");const t=this._translate;q.equals(t,e)||(q.clone(e,t),tt(this,mm))},me.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},me.prototype._setActualPosition=function(e){l(this._clampedPosition)||u.clone(e,this._actualPosition),tt(this,Ea)};const Tm=new Z;me._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ye.SCENE3D?t:(k.multiplyByPoint(i,t,Tm),vt.computeActualEllipsoidPosition(n,Tm))};const ym=new u;me._computeScreenSpacePosition=function(e,t,n,i,o,a){const r=k.multiplyByPoint(e,t,ym),f=vt.worldWithEyeOffsetToWindowCoordinates(o,r,n,a);if(l(f))return q.add(f,i,f),f};const Sa=new q(0,0);me.prototype.computeScreenSpacePosition=function(e,t){const n=this._billboardCollection;if(l(t)||(t=new q),!l(n))throw new C("Billboard must be in a collection. Was it removed?");if(!l(e))throw new C("scene is required.");q.clone(this._pixelOffset,Sa),q.add(Sa,this._translate,Sa);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==ye.SCENE3D)){const r=e.mapProjection,f=r.ellipsoid,c=r.unproject(o,xa);o=f.cartographicToCartesian(c,ym),i=k.IDENTITY}return me._computeScreenSpacePosition(i,o,this._eyeOffset,Sa,e,t)},me.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height;const a=e.scale;i*=a,o*=a;let r=t.x;e.horizontalOrigin===Ln.RIGHT?r-=i:e.horizontalOrigin===Ln.CENTER&&(r-=i*.5);let f=t.y;return e.verticalOrigin===rt.BOTTOM||e.verticalOrigin===rt.BASELINE?f-=o:e.verticalOrigin===rt.CENTER&&(f-=o*.5),l(n)||(n=new be),n.x=r,n.y=f,n.width=i,n.height=o,n},me.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&u.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&be.equals(this._imageSubRegion,e._imageSubRegion)&&I.equals(this._color,e._color)&&q.equals(this._pixelOffset,e._pixelOffset)&&q.equals(this._translate,e._translate)&&u.equals(this._eyeOffset,e._eyeOffset)&&Ie.equals(this._scaleByDistance,e._scaleByDistance)&&Ie.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ie.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&it.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection},me.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};const _t=Object.freeze({OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2}),Cn=Object.freeze({FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25});function Ii(e,t,n,i,o){this.bottomLeft=g(e,q.ZERO),this.topRight=g(t,q.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}const eb=new q(16,16);function hi(e){e=g(e,g.EMPTY_OBJECT);const t=g(e.borderWidthInPixels,1),n=g(e.initialSize,eb);if(!l(e.context))throw new C("context is required.");if(t<0)throw new C("borderWidthInPixels must be greater than or equal to zero.");if(n.x<1||n.y<1)throw new C("initialSize must be greater than zero.");this._context=e.context,this._pixelFormat=g(e.pixelFormat,ge.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Yn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(hi.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Mt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function tb(e,t){const n=e._context,i=e.numberOfImages,o=2,a=e._borderWidthInPixels;if(i>0){const r=e._texture.width,f=e._texture.height,c=o*(r+t.width+a),h=o*(f+t.height+a),d=r/c,p=f/h,m=new Ii(new q(r+a,a),new q(c,f)),T=new Ii(new q,new q(c,f),e._root,m),y=new Ii(new q(a,f+a),new q(c,h)),w=new Ii(new q,new q(c,h),T,y);for(let b=0;b<e._textureCoordinates.length;b++){const D=e._textureCoordinates[b];l(D)&&(D.x*=d,D.y*=p,D.width*=d,D.height*=p)}const A=new Mt({context:e._context,width:c,height:h,pixelFormat:e._pixelFormat}),E=new Rn({context:n,colorTextures:[e._texture],destroyAttachments:!1});E._bind(),A.copyFromFramebuffer(0,0,0,0,c,h),E._unBind(),E.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=A,e._root=w}else{let r=o*(t.width+2*a),f=o*(t.height+2*a);r<e._initialSize.x&&(r=e._initialSize.x),f<e._initialSize.y&&(f=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Mt({context:e._context,width:r,height:f,pixelFormat:e._pixelFormat}),e._root=new Ii(new q(a,a),new q(r,f))}}function Ia(e,t,n){if(l(t)){if(!l(t.childNode1)&&!l(t.childNode2)){if(l(t.imageIndex))return;const i=t.topRight.x-t.bottomLeft.x,o=t.topRight.y-t.bottomLeft.y,a=i-n.width,r=o-n.height;if(a<0||r<0)return;if(a===0&&r===0)return t;if(a>r){t.childNode1=new Ii(new q(t.bottomLeft.x,t.bottomLeft.y),new q(t.bottomLeft.x+n.width,t.topRight.y));const f=t.bottomLeft.x+n.width+e._borderWidthInPixels;f<t.topRight.x&&(t.childNode2=new Ii(new q(f,t.bottomLeft.y),new q(t.topRight.x,t.topRight.y)))}else{t.childNode1=new Ii(new q(t.bottomLeft.x,t.bottomLeft.y),new q(t.topRight.x,t.bottomLeft.y+n.height));const f=t.bottomLeft.y+n.height+e._borderWidthInPixels;f<t.topRight.y&&(t.childNode2=new Ii(new q(t.bottomLeft.x,f),new q(t.topRight.x,t.topRight.y)))}return Ia(e,t.childNode1,n)}return Ia(e,t.childNode1,n)||Ia(e,t.childNode2,n)}}function Cm(e,t,n){const i=Ia(e,e._root,t);if(l(i)){i.imageIndex=n;const o=e._texture.width,a=e._texture.height,r=i.topRight.x-i.bottomLeft.x,f=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/o,h=i.bottomLeft.y/a,d=r/o,p=f/a;e._textureCoordinates[n]=new be(c,h,d,p),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else tb(e,t),Cm(e,t,n);e._guid=Yn()}function wm(e,t){if(!l(e)||e.isDestroyed())return-1;const n=e.numberOfImages;return Cm(e,t,n),n}hi.prototype.getImageIndex=function(e){if(!l(e))throw new C("id is required.");return this._indexHash[e]},hi.prototype.addImageSync=function(e,t){if(!l(e))throw new C("id is required.");if(!l(t))throw new C("image is required.");let n=this._indexHash[e];return l(n)||(n=wm(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n},hi.prototype.addImage=function(e,t){if(!l(e))throw new C("id is required.");if(!l(t))throw new C("image is required.");let n=this._idHash[e];if(l(n))return n;if(typeof t=="function"){if(t=t(e),!l(t))throw new C("image is required.")}else(typeof t=="string"||t instanceof ae)&&(t=ae.createIfNeeded(t).fetchImage());const i=this;return n=Promise.resolve(t).then(function(o){const a=wm(i,o);return i._indexHash[e]=a,a}),this._idHash[e]=n,n},hi.prototype.addSubRegion=function(e,t){if(!l(e))throw new C("id is required.");if(!l(t))throw new C("subRegion is required.");const n=this._idHash[e];if(!l(n))throw new dt(`image with id "${e}" not found in the atlas.`);const i=this;return Promise.resolve(n).then(function(o){if(o===-1)return-1;const a=i._texture.width,r=i._texture.height,f=i._textureCoordinates[o],c=f.x+t.x/a,h=f.y+t.y/r,d=t.width/a,p=t.height/r,m=i._textureCoordinates.push(new be(c,h,d,p))-1;return i._indexHash[e]=m,i._guid=Yn(),m})},hi.prototype.isDestroyed=function(){return!1},hi.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),st(this)};const nb=me.SHOW_INDEX,Ks=me.POSITION_INDEX,Am=me.PIXEL_OFFSET_INDEX,Em=me.EYE_OFFSET_INDEX,ib=me.HORIZONTAL_ORIGIN_INDEX,ob=me.VERTICAL_ORIGIN_INDEX,sb=me.SCALE_INDEX,Qs=me.IMAGE_INDEX_INDEX,bm=me.COLOR_INDEX,rb=me.ROTATION_INDEX,ab=me.ALIGNED_AXIS_INDEX,xm=me.SCALE_BY_DISTANCE_INDEX,Sm=me.TRANSLUCENCY_BY_DISTANCE_INDEX,Im=me.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Dm=me.DISTANCE_DISPLAY_CONDITION,cb=me.DISABLE_DEPTH_DISTANCE,hb=me.TEXTURE_COORDINATE_BOUNDS,Om=me.SDF_INDEX,vm=me.SPLIT_DIRECTION_INDEX,jh=me.NUMBER_OF_PROPERTIES;let qe;const fb={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11,splitDirection:12},lb={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function rn(e){e=g(e,g.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(jh),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new te,this._baseVolumeWC=new te,this._baseVolume2D=new te,this._boundingVolume=new te,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=g(e.show,!0),this.modelMatrix=k.clone(g(e.modelMatrix,k.IDENTITY)),this._modelMatrix=k.clone(k.IDENTITY),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=g(e.debugShowTextureAtlas,!1),this.blendOption=g(e.blendOption,_t.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ye.SCENE3D,this._buffersUsage=[We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW],this._highlightColor=I.clone(I.WHITE);const t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};const n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){const i=this._billboards,o=i.length;for(let a=0;a<o;++a)l(i[a])&&i[a]._updateClamping()},this))}Object.defineProperties(rn.prototype,{length:{get:function(){return Yh(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}});function Wm(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}rn.prototype.add=function(e){const t=new me(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},rn.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},rn.prototype.removeAll=function(){Wm(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Yh(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;const t=[],n=e._billboards,i=n.length;for(let o=0,a=0;o<i;++o){const r=n[o];l(r)&&(r._index=a++,t.push(r))}e._billboards=t}}rn.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},rn.prototype.contains=function(e){return l(e)&&e._billboardCollection===this},rn.prototype.get=function(e){return _.typeOf.number("index",e),Yh(this),this._billboards[e]};let Xh;function ub(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;const i=16384*6-6,o=new Uint16Array(i);for(let a=0,r=0;a<i;a+=6,r+=4)o[a]=r,o[a+1]=r+1,o[a+2]=r+2,o[a+3]=r+0,o[a+4]=r+2,o[a+5]=r+3;return n=Bt.createIndexBuffer({context:e,typedArray:o,usage:We.STATIC_DRAW,indexDatatype:bt.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function db(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=Bt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:We.STATIC_DRAW,indexDatatype:bt.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function pb(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=Bt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:We.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}rn.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<jh;++i){const o=n[i]===0?We.STATIC_DRAW:We.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function mb(e,t,n,i,o,a){const r=[{index:qe.positionHighAndScale,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Ks]},{index:qe.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Ks]},{index:qe.compressedAttribute0,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Am]},{index:qe.compressedAttribute1,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Sm]},{index:qe.compressedAttribute2,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[bm]},{index:qe.eyeOffset,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Em]},{index:qe.scaleByDistance,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[xm]},{index:qe.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Im]},{index:qe.compressedAttribute3,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[Dm]},{index:qe.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[hb]},{index:qe.splitDirection,componentsPerAttribute:1,componentDatatype:he.FLOAT,usage:n[vm]}];i&&r.push({index:qe.direction,componentsPerAttribute:2,componentDatatype:he.FLOAT,vertexBuffer:pb(e)}),l(o)&&r.push({index:qe.a_batchId,componentsPerAttribute:1,componentDatatype:he.FLOAT,bufferUsage:We.STATIC_DRAW}),a&&r.push({index:qe.sdf,componentsPerAttribute:2,componentDatatype:he.FLOAT,usage:n[Om]});const f=i?t:4*t;return new Dt(e,r,f,i)}const $h=new Qe;function Pm(e,t,n,i,o){let a;const r=i[qe.positionHighAndScale],f=i[qe.positionLowAndRotation],c=o._getActualPosition();e._mode===ye.SCENE3D&&(te.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),Qe.fromCartesian(c,$h);const h=o.scale,d=o.rotation;d!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,h);const p=$h.high,m=$h.low;e._instanced?(a=o._index,r(a,p.x,p.y,p.z,h),f(a,m.x,m.y,m.z,d)):(a=o._index*4,r(a+0,p.x,p.y,p.z,h),r(a+1,p.x,p.y,p.z,h),r(a+2,p.x,p.y,p.z,h),r(a+3,p.x,p.y,p.z,h),f(a+0,m.x,m.y,m.z,d),f(a+1,m.x,m.y,m.z,d),f(a+2,m.x,m.y,m.z,d),f(a+3,m.x,m.y,m.z,d))}const Dn=new q,On=32768,Zo=65536,Zh=4096,fi=256,_b=128,gb=32,Tb=8,Bm=4,yb=1/256,Rm=0,zm=2,Lm=3,Nm=1;function Fm(e,t,n,i,o){let a;const r=i[qe.compressedAttribute0],f=o.pixelOffset,c=f.x,h=f.y,d=o._translate,p=d.x,m=d.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+p),Math.abs(-h+m));const T=o.horizontalOrigin;let y=o._verticalOrigin,w=o.show&&o.clusterShow;o.color.alpha===0&&(w=!1),y===rt.BASELINE&&(y=rt.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&T===Ln.CENTER,e._allVerticalCenter=e._allVerticalCenter&&y===rt.CENTER;let A=0,E=0,b=0,D=0;const O=o._imageIndex;if(O!==-1){const H=n[O];if(!l(H))throw new C(`Invalid billboard image index: ${O}`);A=H.x,E=H.y,b=H.width,D=H.height}const B=A+b,L=E+D;let F=Math.floor(S.clamp(c,-On,On)+On)*_b;F+=(T+1)*gb,F+=(y+1)*Tb,F+=(w?1:0)*Bm;let N=Math.floor(S.clamp(h,-On,On)+On)*fi,U=Math.floor(S.clamp(p,-On,On)+On)*fi;const M=(S.clamp(m,-On,On)+On)*yb,j=Math.floor(M),Y=Math.floor((M-j)*fi);N+=j,U+=Y,Dn.x=A,Dn.y=E;const s=De.compressTextureCoordinates(Dn);Dn.x=B;const x=De.compressTextureCoordinates(Dn);Dn.y=L;const P=De.compressTextureCoordinates(Dn);Dn.x=A;const z=De.compressTextureCoordinates(Dn);e._instanced?(a=o._index,r(a,F,N,U,s)):(a=o._index*4,r(a+0,F+Rm,N,U,s),r(a+1,F+zm,N,U,x),r(a+2,F+Lm,N,U,P),r(a+3,F+Nm,N,U,z))}function Mm(e,t,n,i,o){let a;const r=i[qe.compressedAttribute1],f=o.alignedAxis;u.equals(f,u.ZERO)||(e._shaderAlignedAxis=!0);let c=0,h=1,d=1,p=1;const m=o.translucencyByDistance;l(m)&&(c=m.near,h=m.nearValue,d=m.far,p=m.farValue,(h!==1||p!==1)&&(e._shaderTranslucencyByDistance=!0));let T=0;const y=o._imageIndex;if(y!==-1){const D=n[y];if(!l(D))throw new C(`Invalid billboard image index: ${y}`);T=D.width}const w=e._textureAtlas.texture.width,A=Math.round(g(o.width,w*T));e._maxSize=Math.max(e._maxSize,A);let E=S.clamp(A,0,Zo),b=0;Math.abs(u.magnitudeSquared(f)-1)<S.EPSILON6&&(b=De.octEncodeFloat(f)),h=S.clamp(h,0,1),h=h===1?255:h*255|0,E=E*fi+h,p=S.clamp(p,0,1),p=p===1?255:p*255|0,b=b*fi+p,e._instanced?(a=o._index,r(a,E,b,c,d)):(a=o._index*4,r(a+0,E,b,c,d),r(a+1,E,b,c,d),r(a+2,E,b,c,d),r(a+3,E,b,c,d))}function Kh(e,t,n,i,o){let a;const r=i[qe.compressedAttribute2],f=o.color,c=l(e._batchTable)?I.WHITE:o.getPickId(t.context).color,h=o.sizeInMeters?1:0,d=Math.abs(u.magnitudeSquared(o.alignedAxis)-1)<S.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&h===1;let p=0;const m=o._imageIndex;if(m!==-1){const F=n[m];if(!l(F))throw new C(`Invalid billboard image index: ${m}`);p=F.height}const T=e._textureAtlas.texture.dimensions,y=Math.round(g(o.height,T.y*p));e._maxSize=Math.max(e._maxSize,y);let w=g(o._labelHorizontalOrigin,-2);w+=2;const A=y*Bm+w;let E=I.floatToByte(f.red),b=I.floatToByte(f.green),D=I.floatToByte(f.blue);const O=E*Zo+b*fi+D;E=I.floatToByte(c.red),b=I.floatToByte(c.green),D=I.floatToByte(c.blue);const B=E*Zo+b*fi+D;let L=I.floatToByte(f.alpha)*Zo+I.floatToByte(c.alpha)*fi;L+=h*2+d,e._instanced?(a=o._index,r(a,O,B,L,A)):(a=o._index*4,r(a+0,O,B,L,A),r(a+1,O,B,L,A),r(a+2,O,B,L,A),r(a+3,O,B,L,A))}function Qh(e,t,n,i,o){let a;const r=i[qe.eyeOffset],f=o.eyeOffset;let c=f.z;if(o._heightReference!==ii.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(f.x),Math.abs(f.y),Math.abs(c)),e._instanced){let h=0,d=0;const p=o._imageIndex;if(p!==-1){const T=n[p];if(!l(T))throw new C(`Invalid billboard image index: ${p}`);h=T.width,d=T.height}Dn.x=h,Dn.y=d;const m=De.compressTextureCoordinates(Dn);a=o._index,r(a,f.x,f.y,c,m)}else a=o._index*4,r(a+0,f.x,f.y,c,0),r(a+1,f.x,f.y,c,0),r(a+2,f.x,f.y,c,0),r(a+3,f.x,f.y,c,0)}function Um(e,t,n,i,o){let a;const r=i[qe.scaleByDistance];let f=0,c=1,h=1,d=1;const p=o.scaleByDistance;l(p)&&(f=p.near,c=p.nearValue,h=p.far,d=p.farValue,(c!==1||d!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(a=o._index,r(a,f,c,h,d)):(a=o._index*4,r(a+0,f,c,h,d),r(a+1,f,c,h,d),r(a+2,f,c,h,d),r(a+3,f,c,h,d))}function km(e,t,n,i,o){let a;const r=i[qe.pixelOffsetScaleByDistance];let f=0,c=1,h=1,d=1;const p=o.pixelOffsetScaleByDistance;l(p)&&(f=p.near,c=p.nearValue,h=p.far,d=p.farValue,(c!==1||d!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(a=o._index,r(a,f,c,h,d)):(a=o._index*4,r(a+0,f,c,h,d),r(a+1,f,c,h,d),r(a+2,f,c,h,d),r(a+3,f,c,h,d))}function Vm(e,t,n,i,o){let a;const r=i[qe.compressedAttribute3];let f=0,c=Number.MAX_VALUE;const h=o.distanceDisplayCondition;l(h)&&(f=h.near,c=h.far,f*=f,c*=c,e._shaderDistanceDisplayCondition=!0);let d=o.disableDepthTestDistance;const p=ta(o.heightReference)&&t.context.depthTexture;l(d)||(d=p?5e3:0),d*=d,(p||d>0)&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let m,T;if(l(o._labelDimensions))T=o._labelDimensions.x,m=o._labelDimensions.y;else{let E=0,b=0;const D=o._imageIndex;if(D!==-1){const B=n[D];if(!l(B))throw new C(`Invalid billboard image index: ${D}`);E=B.height,b=B.width}m=Math.round(g(o.height,e._textureAtlas.texture.dimensions.y*E));const O=e._textureAtlas.texture.width;T=Math.round(g(o.width,O*b))}const y=Math.floor(S.clamp(T,0,Zh)),w=Math.floor(S.clamp(m,0,Zh)),A=y*Zh+w;e._instanced?(a=o._index,r(a,f,c,d,A)):(a=o._index*4,r(a+0,f,c,d,A),r(a+1,f,c,d,A),r(a+2,f,c,d,A),r(a+3,f,c,d,A))}function Gm(e,t,n,i,o){if(ta(o.heightReference)){const y=e._scene,w=t.context,A=t.globeTranslucencyState.translucent,E=l(y.globe)&&y.globe.depthTestAgainstTerrain;e._shaderClampToGround=w.depthTexture&&!A&&E}let a;const r=i[qe.textureCoordinateBoundsOrLabelTranslate];if(xe.maximumVertexTextureImageUnits>0){let y=0,w=0;l(o._labelTranslate)&&(y=o._labelTranslate.x,w=o._labelTranslate.y),e._instanced?(a=o._index,r(a,y,w,0,0)):(a=o._index*4,r(a+0,y,w,0,0),r(a+1,y,w,0,0),r(a+2,y,w,0,0),r(a+3,y,w,0,0));return}let f=0,c=0,h=0,d=0;const p=o._imageIndex;if(p!==-1){const y=n[p];if(!l(y))throw new C(`Invalid billboard image index: ${p}`);f=y.x,c=y.y,h=y.width,d=y.height}const m=f+h,T=c+d;e._instanced?(a=o._index,r(a,f,c,m,T)):(a=o._index*4,r(a+0,f,c,m,T),r(a+1,f,c,m,T),r(a+2,f,c,m,T),r(a+3,f,c,m,T))}function Cb(e,t,n,i,o){if(!l(e._batchTable))return;const a=i[qe.a_batchId],r=o._batchIndex;let f;e._instanced?(f=o._index,a(f,r)):(f=o._index*4,a(f+0,r),a(f+1,r),a(f+2,r),a(f+3,r))}function qm(e,t,n,i,o){if(!e._sdf)return;let a;const r=i[qe.sdf],f=o.outlineColor,c=o.outlineWidth,h=I.floatToByte(f.red),d=I.floatToByte(f.green),p=I.floatToByte(f.blue),m=h*Zo+d*fi+p,T=c/Cn.RADIUS,y=I.floatToByte(f.alpha)*Zo+I.floatToByte(T)*fi;e._instanced?(a=o._index,r(a,m,y)):(a=o._index*4,r(a+0,m+Rm,y),r(a+1,m+zm,y),r(a+2,m+Lm,y),r(a+3,m+Nm,y))}function Hm(e,t,n,i,o){const a=i[qe.splitDirection];let r=0;const f=o.splitDirection;l(f)&&(r=f);let c;e._instanced?(c=o._index,a(c,r)):(c=o._index*4,a(c+0,r),a(c+1,r),a(c+2,r),a(c+3,r))}function wb(e,t,n,i,o){Pm(e,t,n,i,o),Fm(e,t,n,i,o),Mm(e,t,n,i,o),Kh(e,t,n,i,o),Qh(e,t,n,i,o),Um(e,t,n,i,o),km(e,t,n,i,o),Vm(e,t,n,i,o),Gm(e,t,n,i,o),Cb(e,t,n,i,o),qm(e,t,n,i,o),Hm(e,t,n,i,o)}function Jh(e,t,n,i,o,a){let r;i.mode===ye.SCENE3D?(r=e._baseVolume,e._boundingVolumeDirty=!0):r=e._baseVolume2D;const f=[];for(let c=0;c<n;++c){const h=t[c],d=h.position,p=me._computeActualPosition(h,d,i,o);l(p)&&(h._setActualPosition(p),a?f.push(p):te.expand(r,p,r))}a&&te.fromPoints(f,r)}function Ab(e,t){const n=t.mode,i=e._billboards,o=e._billboardsToUpdate,a=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ye.SCENE3D&&!k.equals(a,e.modelMatrix)?(e._mode=n,k.clone(e.modelMatrix,a),e._createVertexArray=!0,(n===ye.SCENE3D||n===ye.SCENE2D||n===ye.COLUMBUS_VIEW)&&Jh(e,i,i.length,t,a,!0)):n===ye.MORPHING?Jh(e,i,i.length,t,a,!0):(n===ye.SCENE2D||n===ye.COLUMBUS_VIEW)&&Jh(e,o,e._billboardsToUpdateIndex,t,a,!1)}function Eb(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);const a=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+a}function bb(e,t){const i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture;
6341
6341
  in vec2 v_textureCoordinates;
6342
6342
  void main()
6343
6343
  {
6344
6344
  out_FragColor = texture(billboard_texture, v_textureCoordinates);
6345
6345
  }
6346
- `,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=Nt.OVERLAY,i}const xb=[];rn.prototype.update=function(e){if(Yh(this),!this.show)return;let t=this._billboards,n=t.length;const i=e.context;this._instanced=i.instancedArrays,qe=this._instanced?lb:fb,Xh=this._instanced?db:ub;let o=this._textureAtlas;if(!l(o)){o=this._textureAtlas=new hi({context:i});for(let N=0;N<n;++N)t[N]._loadImage()}const a=o.textureCoordinates;if(a.length===0)return;Ab(this,e),t=this._billboards,n=t.length;const r=this._billboardsToUpdate,f=this._billboardsToUpdateIndex,c=this._propertiesChanged,h=o.guid,d=this._createVertexArray||this._textureAtlasGUID!==h;this._textureAtlasGUID=h;let p;const m=e.passes,T=m.pick;if(d||!T&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let N=0;N<jh;++N)c[N]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=mb(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),p=this._vaf.writers;for(let N=0;N<n;++N){const U=this._billboards[N];U._dirty=!1,wb(this,e,a,p,U)}this._vaf.commit(Xh(i))}this._billboardsToUpdateIndex=0}else if(f>0){const N=xb;N.length=0,(c[Ks]||c[rb]||c[sb])&&N.push(Pm),(c[Qs]||c[Am]||c[ib]||c[ob]||c[nb])&&(N.push(Fm),this._instanced&&N.push(Qh)),(c[Qs]||c[ab]||c[Sm])&&(N.push(Mm),N.push(Kh)),(c[Qs]||c[bm])&&N.push(Kh),c[Em]&&N.push(Qh),c[xm]&&N.push(Um),c[Im]&&N.push(km),(c[Dm]||c[cb]||c[Qs]||c[Ks])&&N.push(Vm),(c[Qs]||c[Ks])&&N.push(Gm),c[Om]&&N.push(qm),c[vm]&&N.push(Hm);const U=N.length;if(p=this._vaf.writers,f/n>.1){for(let M=0;M<f;++M){const j=r[M];j._dirty=!1;for(let Y=0;Y<U;++Y)N[Y](this,e,a,p,j)}this._vaf.commit(Xh(i))}else{for(let M=0;M<f;++M){const j=r[M];j._dirty=!1;for(let Y=0;Y<U;++Y)N[Y](this,e,a,p,j);this._instanced?this._vaf.subCommit(j._index,1):this._vaf.subCommit(j._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(f>n*1.5&&(r.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,te.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let y,w=k.IDENTITY;e.mode===ye.SCENE3D?(w=this.modelMatrix,y=te.clone(this._baseVolumeWC,this._boundingVolume)):y=te.clone(this._baseVolume2D,this._boundingVolume),Eb(this,e,y);const A=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,A){this._blendOption===_t.OPAQUE||this._blendOption===_t.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=je.fromCache({depthTest:{enabled:!0,func:R.LESS},depthMask:!0}):this._rsOpaque=void 0;const N=this._blendOption===_t.TRANSLUCENT;this._blendOption===_t.TRANSLUCENT||this._blendOption===_t.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=je.fromCache({depthTest:{enabled:!0,func:N?R.LEQUAL:R.LESS},depthMask:N,blending:ro.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let E,b,I,O,B;const L=xe.maximumVertexTextureImageUnits>0;if(A||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){E=kE,b=UE,B=[],l(this._batchTable)&&(B.push("VECTOR_TILE"),E=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(E),b=this._batchTable.getFragmentShaderCallback(!1,void 0)(b)),I=new Ae({defines:B,sources:[E]}),this._instanced&&I.defines.push("INSTANCED"),this._shaderRotation&&I.defines.push("ROTATION"),this._shaderAlignedAxis&&I.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&I.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&I.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&I.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&I.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&I.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(L?I.defines.push("VERTEX_DEPTH_CHECK"):I.defines.push("FRAGMENT_DEPTH_CHECK"));const N=1-Cn.CUTOFF;this._sdf&&I.defines.push("SDF");const U=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===_t.OPAQUE_AND_TRANSLUCENT&&(O=new Ae({defines:["OPAQUE",U],sources:[b]}),this._shaderClampToGround&&(L?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(O.defines.push("SDF"),O.defines.push(`SDF_EDGE ${N}`)),this._sp=lt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:I,fragmentShaderSource:O,attributeLocations:qe}),O=new Ae({defines:["TRANSLUCENT",U],sources:[b]}),this._shaderClampToGround&&(L?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(O.defines.push("SDF"),O.defines.push(`SDF_EDGE ${N}`)),this._spTranslucent=lt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:I,fragmentShaderSource:O,attributeLocations:qe})),this._blendOption===_t.OPAQUE&&(O=new Ae({defines:[U],sources:[b]}),this._shaderClampToGround&&(L?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(O.defines.push("SDF"),O.defines.push(`SDF_EDGE ${N}`)),this._sp=lt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:I,fragmentShaderSource:O,attributeLocations:qe})),this._blendOption===_t.TRANSLUCENT&&(O=new Ae({defines:[U],sources:[b]}),this._shaderClampToGround&&(L?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(O.defines.push("SDF"),O.defines.push(`SDF_EDGE ${N}`)),this._spTranslucent=lt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:I,fragmentShaderSource:O,attributeLocations:qe})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}const F=e.commandList;if(m.render||m.pick){const N=this._colorCommands,U=this._blendOption===_t.OPAQUE,M=this._blendOption===_t.OPAQUE_AND_TRANSLUCENT,j=this._vaf.va,Y=j.length;let s=this._uniforms,x;l(this._batchTable)?(s=this._batchTable.getUniformMapCallback()(s),x=this._batchTable.getPickId()):x="v_pickColor",N.length=Y;const P=M?Y*2:Y;for(let z=0;z<P;++z){let H=N[z];l(H)||(H=N[z]=new et);const X=U||M&&z%2===0;H.pass=X||!M?Nt.OPAQUE:Nt.TRANSLUCENT,H.owner=this;const ee=M?Math.floor(z/2):z;H.boundingVolume=y,H.modelMatrix=w,H.count=j[ee].indicesCount,H.shaderProgram=X?this._sp:this._spTranslucent,H.uniformMap=s,H.vertexArray=j[ee].va,H.renderState=X?this._rsOpaque:this._rsTranslucent,H.debugShowBoundingVolume=this.debugShowBoundingVolume,H.pickId=x,this._instanced&&(H.count=6,H.instanceCount=n),F.push(H)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=bb(this,e.context)),F.push(this.debugCommand))}},rn.prototype.isDestroyed=function(){return!1},rn.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Wm(this._billboards),st(this)};function Sb(e,t,n,i,o){const a=e.measureText(t);if(!!/\S/.test(t)){const f=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),h=100,d=a.width+h|0,p=3*f,m=p/2;c.width=d,c.height=p;const T=c.getContext("2d");T.font=n,T.fillStyle="white",T.fillRect(0,0,c.width+1,c.height+1),i&&(T.strokeStyle="black",T.lineWidth=e.lineWidth,T.strokeText(t,h/2,m)),o&&(T.fillStyle="black",T.fillText(t,h/2,m));const y=T.getImageData(0,0,d,p).data,w=y.length,A=d*4;let E,b,I,O;for(E=0;E<w;++E)if(y[E]!==255){I=E/A|0;break}for(E=w-1;E>=0;--E)if(y[E]!==255){O=E/A|0;break}let B=-1;for(E=0;E<d&&B===-1;++E)for(b=0;b<p;++b){const L=E*4+b*A;if(y[L]!==255||y[L+1]!==255||y[L+2]!==255||y[L+3]!==255){B=E;break}}return{width:a.width,height:O-I,ascent:m-I,descent:O-m,minx:B-h/2}}return{width:a.width,height:0,ascent:0,descent:0,minx:0}}let mo;function Ib(e,t){if(!l(e))throw new C("text is required.");if(e==="")return;t=g(t,g.EMPTY_OBJECT);const n=g(t.font,"10px sans-serif"),i=g(t.stroke,!1),o=g(t.fill,!0),a=g(t.strokeWidth,1),r=g(t.backgroundColor,D.TRANSPARENT),f=g(t.padding,0),c=f*2,h=document.createElement("canvas");h.width=1,h.height=1,h.style.font=n;const d=h.getContext("2d",{willReadFrequently:!0});l(mo)||(l(d.imageSmoothingEnabled)?mo="imageSmoothingEnabled":l(d.mozImageSmoothingEnabled)?mo="mozImageSmoothingEnabled":l(d.webkitImageSmoothingEnabled)?mo="webkitImageSmoothingEnabled":l(d.msImageSmoothingEnabled)&&(mo="msImageSmoothingEnabled")),d.font=n,d.lineJoin="round",d.lineWidth=a,d[mo]=!1,h.style.visibility="hidden",document.body.appendChild(h);const p=Sb(d,e,n,i,o);h.dimensions=p,document.body.removeChild(h),h.style.visibility="";const m=-p.minx,T=Math.ceil(p.width)+m+c,y=p.height+c,w=y-p.ascent+f,A=y-w+c;if(h.width=T,h.height=y,d.font=n,d.lineJoin="round",d.lineWidth=a,d[mo]=!1,r!==D.TRANSPARENT&&(d.fillStyle=r.toCssColorString(),d.fillRect(0,0,h.width,h.height)),i){const E=g(t.strokeColor,D.BLACK);d.strokeStyle=E.toCssColorString(),d.strokeText(e,m+f,A)}if(o){const E=g(t.fillColor,D.WHITE);d.fillStyle=E.toCssColorString(),d.fillText(e,m+f,A)}return h}var Db=Ob,Js=1e20;function Ob(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,a,r,f,c,h,d,p,m,T,y,w;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");a=t.width,r=t.height,c=e,t.stride?d=t.stride:d=Math.floor(e.length/a/r)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(m=e,p=m.getContext("2d"),a=m.width,r=m.height,T=p.getImageData(0,0,a,r),c=T.data,d=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(m=e.canvas,p=e,a=m.width,r=m.height,T=p.getImageData(0,0,a,r),c=T.data,d=4):window.ImageData&&e instanceof window.ImageData&&(T=e,a=e.width,r=e.height,c=T.data,d=4);if(f=Math.max(a,r),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(h=c,c=Array(a*r),y=0,w=Math.floor(h.length/d);y<w;y++)c[y]=h[y*d+o]/255;else if(d!==1)throw Error("Raw data can have only 1 value per pixel");var A=Array(a*r),E=Array(a*r),b=Array(f),I=Array(f),O=Array(f+1),B=Array(f);for(y=0,w=a*r;y<w;y++){var L=c[y];A[y]=L===1?0:L===0?Js:Math.pow(Math.max(0,.5-L),2),E[y]=L===1?Js:L===0?0:Math.pow(Math.max(0,L-.5),2)}jm(A,a,r,b,I,B,O),jm(E,a,r,b,I,B,O);var F=window.Float32Array?new Float32Array(a*r):new Array(a*r);for(y=0,w=a*r;y<w;y++)F[y]=Math.min(Math.max(1-((A[y]-E[y])/i+n),0),1);return F}function jm(e,t,n,i,o,a,r){for(var f=0;f<t;f++){for(var c=0;c<n;c++)i[c]=e[c*t+f];for(Ym(i,o,a,r,n),c=0;c<n;c++)e[c*t+f]=o[c]}for(c=0;c<n;c++){for(f=0;f<t;f++)i[f]=e[c*t+f];for(Ym(i,o,a,r,t),f=0;f<t;f++)e[c*t+f]=Math.sqrt(o[f])}}function Ym(e,t,n,i,o){n[0]=0,i[0]=-Js,i[1]=+Js;for(var a=1,r=0;a<o;a++){for(var f=(e[a]+a*a-(e[n[r]]+n[r]*n[r]))/(2*a-2*n[r]);f<=i[r];)r--,f=(e[a]+a*a-(e[n[r]]+n[r]*n[r]))/(2*a-2*n[r]);r++,n[r]=a,i[r]=f,i[r+1]=+Js}for(a=0,r=0;a<o;a++){for(;i[r+1]<a;)r++;t[a]=(a-n[r])*(a-n[r])+e[n[r]]}}const vb=lr(Db),li=Object.freeze({FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2}),Xm={};let $m=0;const Wb=256,Pb=new D(.165,.165,.165,.8),Bb=new q(7,5),wt=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function _o(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function er(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function tr(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Zm(e){let t=Xm[e._font];if(!l(t)){const n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(tr(n,"line-height"));isNaN(i)&&(i=void 0),t={family:tr(n,"font-family"),size:tr(n,"font-size").replace("px",""),style:tr(n,"font-style"),weight:tr(n,"font-weight"),lineHeight:i},document.body.removeChild(n),$m<Wb&&(Xm[e._font]=t,$m++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function qn(e,t){if(e=g(e,g.EMPTY_OBJECT),l(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,a=e.distanceDisplayCondition;if(l(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Ie.clone(n)}if(l(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Ie.clone(i)}if(l(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=Ie.clone(o)}if(l(a)){if(a.far<=a.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");a=it.clone(a)}this._renderedText=void 0,this._text=void 0,this._show=g(e.show,!0),this._font=g(e.font,"30px sans-serif"),this._fillColor=D.clone(g(e.fillColor,D.WHITE)),this._outlineColor=D.clone(g(e.outlineColor,D.BLACK)),this._outlineWidth=g(e.outlineWidth,1),this._showBackground=g(e.showBackground,!1),this._backgroundColor=D.clone(g(e.backgroundColor,Pb)),this._backgroundPadding=q.clone(g(e.backgroundPadding,Bb)),this._style=g(e.style,li.FILL),this._verticalOrigin=g(e.verticalOrigin,rt.BASELINE),this._horizontalOrigin=g(e.horizontalOrigin,Nn.LEFT),this._pixelOffset=q.clone(g(e.pixelOffset,q.ZERO)),this._eyeOffset=u.clone(g(e.eyeOffset,u.ZERO)),this._position=u.clone(g(e.position,u.ZERO)),this._scale=g(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=g(e.heightReference,Ln.NONE),this._distanceDisplayCondition=a,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=g(e.text,""),this._relativeSize=1,Zm(this),this._updateClamping()}Object.defineProperties(qn.prototype,{show:{get:function(){return this._show},set:function(e){if(!l(e))throw new C("value is required.");if(this._show!==e){this._show=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i].billboard;l(a)&&(a.show=e)}const n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){if(!l(e))throw new C("value is required.");const t=this._position;if(!u.equals(t,e)){u.clone(e,t);const n=this._glyphs;for(let o=0,a=n.length;o<a;o++){const r=n[o].billboard;l(r)&&(r.position=e)}const i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(!l(e))throw new C("value is required.");if(e!==this._heightReference){this._heightReference=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i].billboard;l(a)&&(a.heightReference=e)}const n=this._backgroundBillboard;l(n)&&(n.heightReference=e),er(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(!l(e))throw new C("value is required.");if(this._text!==e){this._text=e;const t=e.replace(/\u00ad/g,"");this._renderedText=qn.enableRightToLeftDetection?Mb(t):t,_o(this)}}},font:{get:function(){return this._font},set:function(e){if(!l(e))throw new C("value is required.");this._font!==e&&(this._font=e,_o(this),Zm(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!l(e))throw new C("value is required.");const t=this._fillColor;D.equals(t,e)||(D.clone(e,t),_o(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!l(e))throw new C("value is required.");const t=this._outlineColor;D.equals(t,e)||(D.clone(e,t),_o(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!l(e))throw new C("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,_o(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){if(!l(e))throw new C("value is required.");this._showBackground!==e&&(this._showBackground=e,_o(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!l(e))throw new C("value is required.");const t=this._backgroundColor;if(!D.equals(t,e)){D.clone(e,t);const n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){if(!l(e))throw new C("value is required.");const t=this._backgroundPadding;q.equals(t,e)||(q.clone(e,t),er(this))}},style:{get:function(){return this._style},set:function(e){if(!l(e))throw new C("value is required.");this._style!==e&&(this._style=e,_o(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!l(e))throw new C("value is required.");const t=this._pixelOffset;if(!q.equals(t,e)){q.clone(e,t);const n=this._glyphs;for(let o=0,a=n.length;o<a;o++){const r=n[o];l(r.billboard)&&(r.billboard.pixelOffset=e)}const i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._translucencyByDistance;if(!Ie.equals(t,e)){this._translucencyByDistance=Ie.clone(e,t);const n=this._glyphs;for(let o=0,a=n.length;o<a;o++){const r=n[o];l(r.billboard)&&(r.billboard.translucencyByDistance=e)}const i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._pixelOffsetScaleByDistance;if(!Ie.equals(t,e)){this._pixelOffsetScaleByDistance=Ie.clone(e,t);const n=this._glyphs;for(let o=0,a=n.length;o<a;o++){const r=n[o];l(r.billboard)&&(r.billboard.pixelOffsetScaleByDistance=e)}const i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._scaleByDistance;if(!Ie.equals(t,e)){this._scaleByDistance=Ie.clone(e,t);const n=this._glyphs;for(let o=0,a=n.length;o<a;o++){const r=n[o];l(r.billboard)&&(r.billboard.scaleByDistance=e)}const i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!l(e))throw new C("value is required.");const t=this._eyeOffset;if(!u.equals(t,e)){u.clone(e,t);const n=this._glyphs;for(let o=0,a=n.length;o<a;o++){const r=n[o];l(r.billboard)&&(r.billboard.eyeOffset=e)}const i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!l(e))throw new C("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,er(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!l(e))throw new C("value is required.");if(this._verticalOrigin!==e){this._verticalOrigin=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard.verticalOrigin=e)}const n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),er(this)}}},scale:{get:function(){return this._scale},set:function(e){if(!l(e))throw new C("value is required.");if(this._scale!==e){this._scale=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard.scale=e*this._relativeSize)}const n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),er(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far must be greater than near");if(!it.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=it.clone(e,this._distanceDisplayCondition);const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard.distanceDisplayCondition=e)}const n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(l(e)&&e<0)throw new C("disableDepthTestDistance must be greater than 0.0.");this._disableDepthTestDistance=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard.disableDepthTestDistance=e)}const n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard.id=e)}const n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=u.clone(e,this._actualClampedPosition);const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard._clampedPosition=e)}const n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard.clusterShow=e)}const n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}}),qn.prototype._updateClamping=function(){me._updateClamping(this._labelCollection,this)},qn.prototype.computeScreenSpacePosition=function(e,t){if(!l(e))throw new C("scene is required.");l(t)||(t=new q);const i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return me._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)},qn.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,a=0,r=0;const f=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,a=c.width*f,r=c.height*f,e.verticalOrigin===rt.BOTTOM||e.verticalOrigin===rt.BASELINE?o-=r:e.verticalOrigin===rt.CENTER&&(o-=r*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let h=0,d=0;const p=e._glyphs,m=p.length;for(let T=0;T<m;++T){const y=p[T],w=y.billboard;if(!l(w))continue;const A=t.x+w._translate.x;let E=t.y-w._translate.y;const b=y.dimensions.width*f,I=y.dimensions.height*f;e.verticalOrigin===rt.BOTTOM||e.verticalOrigin===rt.BASELINE?E-=I:e.verticalOrigin===rt.CENTER&&(E-=I*.5),e._verticalOrigin===rt.TOP?E+=Cn.PADDING*f:(e._verticalOrigin===rt.BOTTOM||e._verticalOrigin===rt.BASELINE)&&(E-=Cn.PADDING*f),i=Math.min(i,A),o=Math.min(o,E),h=Math.max(h,A+b),d=Math.max(d,E+I)}a=h-i,r=d-o}return l(n)||(n=new be),n.x=i,n.y=o,n.width=a,n.height=r,n},qn.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&u.equals(this._position,e._position)&&D.equals(this._fillColor,e._fillColor)&&D.equals(this._outlineColor,e._outlineColor)&&D.equals(this._backgroundColor,e._backgroundColor)&&q.equals(this._backgroundPadding,e._backgroundPadding)&&q.equals(this._pixelOffset,e._pixelOffset)&&u.equals(this._eyeOffset,e._eyeOffset)&&Ie.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ie.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Ie.equals(this._scaleByDistance,e._scaleByDistance)&&it.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},qn.prototype.isDestroyed=function(){return!1},qn.enableRightToLeftDetection=!1;function Rb(e,t){const n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[];let a="",r=wt.LTR,f="";const c=e.length;for(let h=0;h<c;++h){const d=e.charAt(h);t.test(d)?f=wt.RTL:n.test(d)?f=wt.LTR:i.test(d)?f=wt.BRACKETS:f=wt.WEAK,h===0&&(r=f),r===f&&f!==wt.BRACKETS?a+=d:(a!==""&&o.push({Type:r,Word:a}),r=f,a=d)}return o.push({Type:f,Word:a}),o}function zb(e){return e.split("").reverse().join("")}function nr(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Lb(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}const Nb="א-ת",Fb="؀-ۿݐ-ݿࢠ-ࣿ",Km=new RegExp(`[${Nb}${Fb}]`);function Mb(e){const t=e.split(`
6346
+ `,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=Nt.OVERLAY,i}const xb=[];rn.prototype.update=function(e){if(Yh(this),!this.show)return;let t=this._billboards,n=t.length;const i=e.context;this._instanced=i.instancedArrays,qe=this._instanced?lb:fb,Xh=this._instanced?db:ub;let o=this._textureAtlas;if(!l(o)){o=this._textureAtlas=new hi({context:i});for(let N=0;N<n;++N)t[N]._loadImage()}const a=o.textureCoordinates;if(a.length===0)return;Ab(this,e),t=this._billboards,n=t.length;const r=this._billboardsToUpdate,f=this._billboardsToUpdateIndex,c=this._propertiesChanged,h=o.guid,d=this._createVertexArray||this._textureAtlasGUID!==h;this._textureAtlasGUID=h;let p;const m=e.passes,T=m.pick;if(d||!T&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let N=0;N<jh;++N)c[N]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=mb(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),p=this._vaf.writers;for(let N=0;N<n;++N){const U=this._billboards[N];U._dirty=!1,wb(this,e,a,p,U)}this._vaf.commit(Xh(i))}this._billboardsToUpdateIndex=0}else if(f>0){const N=xb;N.length=0,(c[Ks]||c[rb]||c[sb])&&N.push(Pm),(c[Qs]||c[Am]||c[ib]||c[ob]||c[nb])&&(N.push(Fm),this._instanced&&N.push(Qh)),(c[Qs]||c[ab]||c[Sm])&&(N.push(Mm),N.push(Kh)),(c[Qs]||c[bm])&&N.push(Kh),c[Em]&&N.push(Qh),c[xm]&&N.push(Um),c[Im]&&N.push(km),(c[Dm]||c[cb]||c[Qs]||c[Ks])&&N.push(Vm),(c[Qs]||c[Ks])&&N.push(Gm),c[Om]&&N.push(qm),c[vm]&&N.push(Hm);const U=N.length;if(p=this._vaf.writers,f/n>.1){for(let M=0;M<f;++M){const j=r[M];j._dirty=!1;for(let Y=0;Y<U;++Y)N[Y](this,e,a,p,j)}this._vaf.commit(Xh(i))}else{for(let M=0;M<f;++M){const j=r[M];j._dirty=!1;for(let Y=0;Y<U;++Y)N[Y](this,e,a,p,j);this._instanced?this._vaf.subCommit(j._index,1):this._vaf.subCommit(j._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(f>n*1.5&&(r.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,te.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let y,w=k.IDENTITY;e.mode===ye.SCENE3D?(w=this.modelMatrix,y=te.clone(this._baseVolumeWC,this._boundingVolume)):y=te.clone(this._baseVolume2D,this._boundingVolume),Eb(this,e,y);const A=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,A){this._blendOption===_t.OPAQUE||this._blendOption===_t.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=je.fromCache({depthTest:{enabled:!0,func:R.LESS},depthMask:!0}):this._rsOpaque=void 0;const N=this._blendOption===_t.TRANSLUCENT;this._blendOption===_t.TRANSLUCENT||this._blendOption===_t.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=je.fromCache({depthTest:{enabled:!0,func:N?R.LEQUAL:R.LESS},depthMask:N,blending:ro.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let E,b,D,O,B;const L=xe.maximumVertexTextureImageUnits>0;if(A||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){E=kE,b=UE,B=[],l(this._batchTable)&&(B.push("VECTOR_TILE"),E=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(E),b=this._batchTable.getFragmentShaderCallback(!1,void 0)(b)),D=new Ae({defines:B,sources:[E]}),this._instanced&&D.defines.push("INSTANCED"),this._shaderRotation&&D.defines.push("ROTATION"),this._shaderAlignedAxis&&D.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&D.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&D.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&D.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&D.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&D.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(L?D.defines.push("VERTEX_DEPTH_CHECK"):D.defines.push("FRAGMENT_DEPTH_CHECK"));const N=1-Cn.CUTOFF;this._sdf&&D.defines.push("SDF");const U=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===_t.OPAQUE_AND_TRANSLUCENT&&(O=new Ae({defines:["OPAQUE",U],sources:[b]}),this._shaderClampToGround&&(L?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(O.defines.push("SDF"),O.defines.push(`SDF_EDGE ${N}`)),this._sp=lt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:D,fragmentShaderSource:O,attributeLocations:qe}),O=new Ae({defines:["TRANSLUCENT",U],sources:[b]}),this._shaderClampToGround&&(L?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(O.defines.push("SDF"),O.defines.push(`SDF_EDGE ${N}`)),this._spTranslucent=lt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:D,fragmentShaderSource:O,attributeLocations:qe})),this._blendOption===_t.OPAQUE&&(O=new Ae({defines:[U],sources:[b]}),this._shaderClampToGround&&(L?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(O.defines.push("SDF"),O.defines.push(`SDF_EDGE ${N}`)),this._sp=lt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:D,fragmentShaderSource:O,attributeLocations:qe})),this._blendOption===_t.TRANSLUCENT&&(O=new Ae({defines:[U],sources:[b]}),this._shaderClampToGround&&(L?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(O.defines.push("SDF"),O.defines.push(`SDF_EDGE ${N}`)),this._spTranslucent=lt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:D,fragmentShaderSource:O,attributeLocations:qe})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}const F=e.commandList;if(m.render||m.pick){const N=this._colorCommands,U=this._blendOption===_t.OPAQUE,M=this._blendOption===_t.OPAQUE_AND_TRANSLUCENT,j=this._vaf.va,Y=j.length;let s=this._uniforms,x;l(this._batchTable)?(s=this._batchTable.getUniformMapCallback()(s),x=this._batchTable.getPickId()):x="v_pickColor",N.length=Y;const P=M?Y*2:Y;for(let z=0;z<P;++z){let H=N[z];l(H)||(H=N[z]=new et);const X=U||M&&z%2===0;H.pass=X||!M?Nt.OPAQUE:Nt.TRANSLUCENT,H.owner=this;const ee=M?Math.floor(z/2):z;H.boundingVolume=y,H.modelMatrix=w,H.count=j[ee].indicesCount,H.shaderProgram=X?this._sp:this._spTranslucent,H.uniformMap=s,H.vertexArray=j[ee].va,H.renderState=X?this._rsOpaque:this._rsTranslucent,H.debugShowBoundingVolume=this.debugShowBoundingVolume,H.pickId=x,this._instanced&&(H.count=6,H.instanceCount=n),F.push(H)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=bb(this,e.context)),F.push(this.debugCommand))}},rn.prototype.isDestroyed=function(){return!1},rn.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Wm(this._billboards),st(this)};function Sb(e,t,n,i,o){const a=e.measureText(t);if(!!/\S/.test(t)){const f=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),h=100,d=a.width+h|0,p=3*f,m=p/2;c.width=d,c.height=p;const T=c.getContext("2d");T.font=n,T.fillStyle="white",T.fillRect(0,0,c.width+1,c.height+1),i&&(T.strokeStyle="black",T.lineWidth=e.lineWidth,T.strokeText(t,h/2,m)),o&&(T.fillStyle="black",T.fillText(t,h/2,m));const y=T.getImageData(0,0,d,p).data,w=y.length,A=d*4;let E,b,D,O;for(E=0;E<w;++E)if(y[E]!==255){D=E/A|0;break}for(E=w-1;E>=0;--E)if(y[E]!==255){O=E/A|0;break}let B=-1;for(E=0;E<d&&B===-1;++E)for(b=0;b<p;++b){const L=E*4+b*A;if(y[L]!==255||y[L+1]!==255||y[L+2]!==255||y[L+3]!==255){B=E;break}}return{width:a.width,height:O-D,ascent:m-D,descent:O-m,minx:B-h/2}}return{width:a.width,height:0,ascent:0,descent:0,minx:0}}let mo;function Ib(e,t){if(!l(e))throw new C("text is required.");if(e==="")return;t=g(t,g.EMPTY_OBJECT);const n=g(t.font,"10px sans-serif"),i=g(t.stroke,!1),o=g(t.fill,!0),a=g(t.strokeWidth,1),r=g(t.backgroundColor,I.TRANSPARENT),f=g(t.padding,0),c=f*2,h=document.createElement("canvas");h.width=1,h.height=1,h.style.font=n;const d=h.getContext("2d",{willReadFrequently:!0});l(mo)||(l(d.imageSmoothingEnabled)?mo="imageSmoothingEnabled":l(d.mozImageSmoothingEnabled)?mo="mozImageSmoothingEnabled":l(d.webkitImageSmoothingEnabled)?mo="webkitImageSmoothingEnabled":l(d.msImageSmoothingEnabled)&&(mo="msImageSmoothingEnabled")),d.font=n,d.lineJoin="round",d.lineWidth=a,d[mo]=!1,h.style.visibility="hidden",document.body.appendChild(h);const p=Sb(d,e,n,i,o);h.dimensions=p,document.body.removeChild(h),h.style.visibility="";const m=-p.minx,T=Math.ceil(p.width)+m+c,y=p.height+c,w=y-p.ascent+f,A=y-w+c;if(h.width=T,h.height=y,d.font=n,d.lineJoin="round",d.lineWidth=a,d[mo]=!1,r!==I.TRANSPARENT&&(d.fillStyle=r.toCssColorString(),d.fillRect(0,0,h.width,h.height)),i){const E=g(t.strokeColor,I.BLACK);d.strokeStyle=E.toCssColorString(),d.strokeText(e,m+f,A)}if(o){const E=g(t.fillColor,I.WHITE);d.fillStyle=E.toCssColorString(),d.fillText(e,m+f,A)}return h}var Db=Ob,Js=1e20;function Ob(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,a,r,f,c,h,d,p,m,T,y,w;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");a=t.width,r=t.height,c=e,t.stride?d=t.stride:d=Math.floor(e.length/a/r)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(m=e,p=m.getContext("2d"),a=m.width,r=m.height,T=p.getImageData(0,0,a,r),c=T.data,d=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(m=e.canvas,p=e,a=m.width,r=m.height,T=p.getImageData(0,0,a,r),c=T.data,d=4):window.ImageData&&e instanceof window.ImageData&&(T=e,a=e.width,r=e.height,c=T.data,d=4);if(f=Math.max(a,r),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(h=c,c=Array(a*r),y=0,w=Math.floor(h.length/d);y<w;y++)c[y]=h[y*d+o]/255;else if(d!==1)throw Error("Raw data can have only 1 value per pixel");var A=Array(a*r),E=Array(a*r),b=Array(f),D=Array(f),O=Array(f+1),B=Array(f);for(y=0,w=a*r;y<w;y++){var L=c[y];A[y]=L===1?0:L===0?Js:Math.pow(Math.max(0,.5-L),2),E[y]=L===1?Js:L===0?0:Math.pow(Math.max(0,L-.5),2)}jm(A,a,r,b,D,B,O),jm(E,a,r,b,D,B,O);var F=window.Float32Array?new Float32Array(a*r):new Array(a*r);for(y=0,w=a*r;y<w;y++)F[y]=Math.min(Math.max(1-((A[y]-E[y])/i+n),0),1);return F}function jm(e,t,n,i,o,a,r){for(var f=0;f<t;f++){for(var c=0;c<n;c++)i[c]=e[c*t+f];for(Ym(i,o,a,r,n),c=0;c<n;c++)e[c*t+f]=o[c]}for(c=0;c<n;c++){for(f=0;f<t;f++)i[f]=e[c*t+f];for(Ym(i,o,a,r,t),f=0;f<t;f++)e[c*t+f]=Math.sqrt(o[f])}}function Ym(e,t,n,i,o){n[0]=0,i[0]=-Js,i[1]=+Js;for(var a=1,r=0;a<o;a++){for(var f=(e[a]+a*a-(e[n[r]]+n[r]*n[r]))/(2*a-2*n[r]);f<=i[r];)r--,f=(e[a]+a*a-(e[n[r]]+n[r]*n[r]))/(2*a-2*n[r]);r++,n[r]=a,i[r]=f,i[r+1]=+Js}for(a=0,r=0;a<o;a++){for(;i[r+1]<a;)r++;t[a]=(a-n[r])*(a-n[r])+e[n[r]]}}const vb=lr(Db),li=Object.freeze({FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2}),Xm={};let $m=0;const Wb=256,Pb=new I(.165,.165,.165,.8),Bb=new q(7,5),wt=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function _o(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function er(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function tr(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Zm(e){let t=Xm[e._font];if(!l(t)){const n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(tr(n,"line-height"));isNaN(i)&&(i=void 0),t={family:tr(n,"font-family"),size:tr(n,"font-size").replace("px",""),style:tr(n,"font-style"),weight:tr(n,"font-weight"),lineHeight:i},document.body.removeChild(n),$m<Wb&&(Xm[e._font]=t,$m++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Gn(e,t){if(e=g(e,g.EMPTY_OBJECT),l(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,a=e.distanceDisplayCondition;if(l(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Ie.clone(n)}if(l(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Ie.clone(i)}if(l(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=Ie.clone(o)}if(l(a)){if(a.far<=a.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");a=it.clone(a)}this._renderedText=void 0,this._text=void 0,this._show=g(e.show,!0),this._font=g(e.font,"30px sans-serif"),this._fillColor=I.clone(g(e.fillColor,I.WHITE)),this._outlineColor=I.clone(g(e.outlineColor,I.BLACK)),this._outlineWidth=g(e.outlineWidth,1),this._showBackground=g(e.showBackground,!1),this._backgroundColor=I.clone(g(e.backgroundColor,Pb)),this._backgroundPadding=q.clone(g(e.backgroundPadding,Bb)),this._style=g(e.style,li.FILL),this._verticalOrigin=g(e.verticalOrigin,rt.BASELINE),this._horizontalOrigin=g(e.horizontalOrigin,Ln.LEFT),this._pixelOffset=q.clone(g(e.pixelOffset,q.ZERO)),this._eyeOffset=u.clone(g(e.eyeOffset,u.ZERO)),this._position=u.clone(g(e.position,u.ZERO)),this._scale=g(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=g(e.heightReference,ii.NONE),this._distanceDisplayCondition=a,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=g(e.text,""),this._relativeSize=1,Zm(this),this._updateClamping()}Object.defineProperties(Gn.prototype,{show:{get:function(){return this._show},set:function(e){if(!l(e))throw new C("value is required.");if(this._show!==e){this._show=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i].billboard;l(a)&&(a.show=e)}const n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){if(!l(e))throw new C("value is required.");const t=this._position;if(!u.equals(t,e)){u.clone(e,t);const n=this._glyphs;for(let o=0,a=n.length;o<a;o++){const r=n[o].billboard;l(r)&&(r.position=e)}const i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(!l(e))throw new C("value is required.");if(e!==this._heightReference){this._heightReference=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i].billboard;l(a)&&(a.heightReference=e)}const n=this._backgroundBillboard;l(n)&&(n.heightReference=e),er(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(!l(e))throw new C("value is required.");if(this._text!==e){this._text=e;const t=e.replace(/\u00ad/g,"");this._renderedText=Gn.enableRightToLeftDetection?Mb(t):t,_o(this)}}},font:{get:function(){return this._font},set:function(e){if(!l(e))throw new C("value is required.");this._font!==e&&(this._font=e,_o(this),Zm(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!l(e))throw new C("value is required.");const t=this._fillColor;I.equals(t,e)||(I.clone(e,t),_o(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!l(e))throw new C("value is required.");const t=this._outlineColor;I.equals(t,e)||(I.clone(e,t),_o(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!l(e))throw new C("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,_o(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){if(!l(e))throw new C("value is required.");this._showBackground!==e&&(this._showBackground=e,_o(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!l(e))throw new C("value is required.");const t=this._backgroundColor;if(!I.equals(t,e)){I.clone(e,t);const n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){if(!l(e))throw new C("value is required.");const t=this._backgroundPadding;q.equals(t,e)||(q.clone(e,t),er(this))}},style:{get:function(){return this._style},set:function(e){if(!l(e))throw new C("value is required.");this._style!==e&&(this._style=e,_o(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!l(e))throw new C("value is required.");const t=this._pixelOffset;if(!q.equals(t,e)){q.clone(e,t);const n=this._glyphs;for(let o=0,a=n.length;o<a;o++){const r=n[o];l(r.billboard)&&(r.billboard.pixelOffset=e)}const i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._translucencyByDistance;if(!Ie.equals(t,e)){this._translucencyByDistance=Ie.clone(e,t);const n=this._glyphs;for(let o=0,a=n.length;o<a;o++){const r=n[o];l(r.billboard)&&(r.billboard.translucencyByDistance=e)}const i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._pixelOffsetScaleByDistance;if(!Ie.equals(t,e)){this._pixelOffsetScaleByDistance=Ie.clone(e,t);const n=this._glyphs;for(let o=0,a=n.length;o<a;o++){const r=n[o];l(r.billboard)&&(r.billboard.pixelOffsetScaleByDistance=e)}const i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._scaleByDistance;if(!Ie.equals(t,e)){this._scaleByDistance=Ie.clone(e,t);const n=this._glyphs;for(let o=0,a=n.length;o<a;o++){const r=n[o];l(r.billboard)&&(r.billboard.scaleByDistance=e)}const i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!l(e))throw new C("value is required.");const t=this._eyeOffset;if(!u.equals(t,e)){u.clone(e,t);const n=this._glyphs;for(let o=0,a=n.length;o<a;o++){const r=n[o];l(r.billboard)&&(r.billboard.eyeOffset=e)}const i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!l(e))throw new C("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,er(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!l(e))throw new C("value is required.");if(this._verticalOrigin!==e){this._verticalOrigin=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard.verticalOrigin=e)}const n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),er(this)}}},scale:{get:function(){return this._scale},set:function(e){if(!l(e))throw new C("value is required.");if(this._scale!==e){this._scale=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard.scale=e*this._relativeSize)}const n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),er(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far must be greater than near");if(!it.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=it.clone(e,this._distanceDisplayCondition);const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard.distanceDisplayCondition=e)}const n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(l(e)&&e<0)throw new C("disableDepthTestDistance must be greater than 0.0.");this._disableDepthTestDistance=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard.disableDepthTestDistance=e)}const n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard.id=e)}const n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=u.clone(e,this._actualClampedPosition);const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard._clampedPosition=e)}const n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const a=t[i];l(a.billboard)&&(a.billboard.clusterShow=e)}const n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}}),Gn.prototype._updateClamping=function(){me._updateClamping(this._labelCollection,this)},Gn.prototype.computeScreenSpacePosition=function(e,t){if(!l(e))throw new C("scene is required.");l(t)||(t=new q);const i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return me._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)},Gn.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,a=0,r=0;const f=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,a=c.width*f,r=c.height*f,e.verticalOrigin===rt.BOTTOM||e.verticalOrigin===rt.BASELINE?o-=r:e.verticalOrigin===rt.CENTER&&(o-=r*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let h=0,d=0;const p=e._glyphs,m=p.length;for(let T=0;T<m;++T){const y=p[T],w=y.billboard;if(!l(w))continue;const A=t.x+w._translate.x;let E=t.y-w._translate.y;const b=y.dimensions.width*f,D=y.dimensions.height*f;e.verticalOrigin===rt.BOTTOM||e.verticalOrigin===rt.BASELINE?E-=D:e.verticalOrigin===rt.CENTER&&(E-=D*.5),e._verticalOrigin===rt.TOP?E+=Cn.PADDING*f:(e._verticalOrigin===rt.BOTTOM||e._verticalOrigin===rt.BASELINE)&&(E-=Cn.PADDING*f),i=Math.min(i,A),o=Math.min(o,E),h=Math.max(h,A+b),d=Math.max(d,E+D)}a=h-i,r=d-o}return l(n)||(n=new be),n.x=i,n.y=o,n.width=a,n.height=r,n},Gn.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&u.equals(this._position,e._position)&&I.equals(this._fillColor,e._fillColor)&&I.equals(this._outlineColor,e._outlineColor)&&I.equals(this._backgroundColor,e._backgroundColor)&&q.equals(this._backgroundPadding,e._backgroundPadding)&&q.equals(this._pixelOffset,e._pixelOffset)&&u.equals(this._eyeOffset,e._eyeOffset)&&Ie.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ie.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Ie.equals(this._scaleByDistance,e._scaleByDistance)&&it.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},Gn.prototype.isDestroyed=function(){return!1},Gn.enableRightToLeftDetection=!1;function Rb(e,t){const n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[];let a="",r=wt.LTR,f="";const c=e.length;for(let h=0;h<c;++h){const d=e.charAt(h);t.test(d)?f=wt.RTL:n.test(d)?f=wt.LTR:i.test(d)?f=wt.BRACKETS:f=wt.WEAK,h===0&&(r=f),r===f&&f!==wt.BRACKETS?a+=d:(a!==""&&o.push({Type:r,Word:a}),r=f,a=d)}return o.push({Type:f,Word:a}),o}function zb(e){return e.split("").reverse().join("")}function nr(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Lb(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}const Nb="א-ת",Fb="؀-ۿݐ-ݿࢠ-ࣿ",Km=new RegExp(`[${Nb}${Fb}]`);function Mb(e){const t=e.split(`
6347
6347
  `);let n="";for(let i=0;i<t.length;i++){const o=t[i],a=Km.test(o.charAt(0)),r=Rb(o,Km);let f=0,c="";for(let h=0;h<r.length;++h){const d=r[h],p=d.Type===wt.BRACKETS?Lb(d.Word):zb(d.Word);a?d.Type===wt.RTL?(c=p+c,f=0):d.Type===wt.LTR?(c=nr(c,f,d.Word),f+=d.Word.length):(d.Type===wt.WEAK||d.Type===wt.BRACKETS)&&(d.Type===wt.WEAK&&r[h-1].Type===wt.BRACKETS?c=p+c:r[h-1].Type===wt.RTL?(c=p+c,f=0):r.length>h+1?r[h+1].Type===wt.RTL?(c=p+c,f=0):(c=nr(c,f,d.Word),f+=d.Word.length):c=nr(c,0,p)):d.Type===wt.RTL?c=nr(c,f,p):d.Type===wt.LTR?(c+=d.Word,f=c.length):(d.Type===wt.WEAK||d.Type===wt.BRACKETS)&&(h>0&&r[h-1].Type===wt.RTL?r.length>h+1?r[h+1].Type===wt.RTL?c=nr(c,f,p):(c+=d.Word,f=c.length):c+=d.Word:(c+=d.Word,f=c.length))}n+=c,i<t.length-1&&(n+=`
6348
- `)}return n}var Qm={exports:{}};(function(e){function t(){var n=0,i=1,o=2,a=3,r=4,f=5,c=6,h=7,d=8,p=9,m=10,T=11,y=12,w=13,A=14,E=15,b=16,I=17,O=0,B=1,L=2,F=3,N=4;function U(s,x){return 55296<=s.charCodeAt(x)&&s.charCodeAt(x)<=56319&&56320<=s.charCodeAt(x+1)&&s.charCodeAt(x+1)<=57343}function M(s,x){x===void 0&&(x=0);var P=s.charCodeAt(x);if(55296<=P&&P<=56319&&x<s.length-1){var z=P,H=s.charCodeAt(x+1);return 56320<=H&&H<=57343?(z-55296)*1024+(H-56320)+65536:z}if(56320<=P&&P<=57343&&x>=1){var z=s.charCodeAt(x-1),H=P;return 55296<=z&&z<=56319?(z-55296)*1024+(H-56320)+65536:H}return P}function j(s,x,P){var z=[s].concat(x).concat([P]),H=z[z.length-2],X=P,ee=z.lastIndexOf(A);if(ee>1&&z.slice(1,ee).every(function(le){return le==a})&&[a,w,I].indexOf(s)==-1)return L;var K=z.lastIndexOf(r);if(K>0&&z.slice(1,K).every(function(le){return le==r})&&[y,r].indexOf(H)==-1)return z.filter(function(le){return le==r}).length%2==1?F:N;if(H==n&&X==i)return O;if(H==o||H==n||H==i)return X==A&&x.every(function(le){return le==a})?L:B;if(X==o||X==n||X==i)return B;if(H==c&&(X==c||X==h||X==p||X==m))return O;if((H==p||H==h)&&(X==h||X==d))return O;if((H==m||H==d)&&X==d)return O;if(X==a||X==E)return O;if(X==f)return O;if(H==y)return O;var ce=z.indexOf(a)!=-1?z.lastIndexOf(a)-1:z.length-2;return[w,I].indexOf(z[ce])!=-1&&z.slice(ce+1,-1).every(function(le){return le==a})&&X==A||H==E&&[b,I].indexOf(X)!=-1?O:x.indexOf(r)!=-1?L:H==r&&X==r?O:B}this.nextBreak=function(s,x){if(x===void 0&&(x=0),x<0)return 0;if(x>=s.length-1)return s.length;for(var P=Y(M(s,x)),z=[],H=x+1;H<s.length;H++)if(!U(s,H-1)){var X=Y(M(s,H));if(j(P,z,X))return H;z.push(X)}return s.length},this.splitGraphemes=function(s){for(var x=[],P=0,z;(z=this.nextBreak(s,P))<s.length;)x.push(s.slice(P,z)),P=z;return P<s.length&&x.push(s.slice(P)),x},this.iterateGraphemes=function(s){var x=0,P={next:(function(){var z,H;return(H=this.nextBreak(s,x))<s.length?(z=s.slice(x,H),x=H,{value:z,done:!1}):x<s.length?(z=s.slice(x),x=s.length,{value:z,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(P[Symbol.iterator]=function(){return P}),P},this.countGraphemes=function(s){for(var x=0,P=0,z;(z=this.nextBreak(s,P))<s.length;)P=z,x++;return P<s.length&&x++,x};function Y(s){return 1536<=s&&s<=1541||s==1757||s==1807||s==2274||s==3406||s==69821||70082<=s&&s<=70083||s==72250||72326<=s&&s<=72329||s==73030?y:s==13?n:s==10?i:0<=s&&s<=9||11<=s&&s<=12||14<=s&&s<=31||127<=s&&s<=159||s==173||s==1564||s==6158||s==8203||8206<=s&&s<=8207||s==8232||s==8233||8234<=s&&s<=8238||8288<=s&&s<=8292||s==8293||8294<=s&&s<=8303||55296<=s&&s<=57343||s==65279||65520<=s&&s<=65528||65529<=s&&s<=65531||113824<=s&&s<=113827||119155<=s&&s<=119162||s==917504||s==917505||917506<=s&&s<=917535||917632<=s&&s<=917759||918e3<=s&&s<=921599?o:768<=s&&s<=879||1155<=s&&s<=1159||1160<=s&&s<=1161||1425<=s&&s<=1469||s==1471||1473<=s&&s<=1474||1476<=s&&s<=1477||s==1479||1552<=s&&s<=1562||1611<=s&&s<=1631||s==1648||1750<=s&&s<=1756||1759<=s&&s<=1764||1767<=s&&s<=1768||1770<=s&&s<=1773||s==1809||1840<=s&&s<=1866||1958<=s&&s<=1968||2027<=s&&s<=2035||2070<=s&&s<=2073||2075<=s&&s<=2083||2085<=s&&s<=2087||2089<=s&&s<=2093||2137<=s&&s<=2139||2260<=s&&s<=2273||2275<=s&&s<=2306||s==2362||s==2364||2369<=s&&s<=2376||s==2381||2385<=s&&s<=2391||2402<=s&&s<=2403||s==2433||s==2492||s==2494||2497<=s&&s<=2500||s==2509||s==2519||2530<=s&&s<=2531||2561<=s&&s<=2562||s==2620||2625<=s&&s<=2626||2631<=s&&s<=2632||2635<=s&&s<=2637||s==2641||2672<=s&&s<=2673||s==2677||2689<=s&&s<=2690||s==2748||2753<=s&&s<=2757||2759<=s&&s<=2760||s==2765||2786<=s&&s<=2787||2810<=s&&s<=2815||s==2817||s==2876||s==2878||s==2879||2881<=s&&s<=2884||s==2893||s==2902||s==2903||2914<=s&&s<=2915||s==2946||s==3006||s==3008||s==3021||s==3031||s==3072||3134<=s&&s<=3136||3142<=s&&s<=3144||3146<=s&&s<=3149||3157<=s&&s<=3158||3170<=s&&s<=3171||s==3201||s==3260||s==3263||s==3266||s==3270||3276<=s&&s<=3277||3285<=s&&s<=3286||3298<=s&&s<=3299||3328<=s&&s<=3329||3387<=s&&s<=3388||s==3390||3393<=s&&s<=3396||s==3405||s==3415||3426<=s&&s<=3427||s==3530||s==3535||3538<=s&&s<=3540||s==3542||s==3551||s==3633||3636<=s&&s<=3642||3655<=s&&s<=3662||s==3761||3764<=s&&s<=3769||3771<=s&&s<=3772||3784<=s&&s<=3789||3864<=s&&s<=3865||s==3893||s==3895||s==3897||3953<=s&&s<=3966||3968<=s&&s<=3972||3974<=s&&s<=3975||3981<=s&&s<=3991||3993<=s&&s<=4028||s==4038||4141<=s&&s<=4144||4146<=s&&s<=4151||4153<=s&&s<=4154||4157<=s&&s<=4158||4184<=s&&s<=4185||4190<=s&&s<=4192||4209<=s&&s<=4212||s==4226||4229<=s&&s<=4230||s==4237||s==4253||4957<=s&&s<=4959||5906<=s&&s<=5908||5938<=s&&s<=5940||5970<=s&&s<=5971||6002<=s&&s<=6003||6068<=s&&s<=6069||6071<=s&&s<=6077||s==6086||6089<=s&&s<=6099||s==6109||6155<=s&&s<=6157||6277<=s&&s<=6278||s==6313||6432<=s&&s<=6434||6439<=s&&s<=6440||s==6450||6457<=s&&s<=6459||6679<=s&&s<=6680||s==6683||s==6742||6744<=s&&s<=6750||s==6752||s==6754||6757<=s&&s<=6764||6771<=s&&s<=6780||s==6783||6832<=s&&s<=6845||s==6846||6912<=s&&s<=6915||s==6964||6966<=s&&s<=6970||s==6972||s==6978||7019<=s&&s<=7027||7040<=s&&s<=7041||7074<=s&&s<=7077||7080<=s&&s<=7081||7083<=s&&s<=7085||s==7142||7144<=s&&s<=7145||s==7149||7151<=s&&s<=7153||7212<=s&&s<=7219||7222<=s&&s<=7223||7376<=s&&s<=7378||7380<=s&&s<=7392||7394<=s&&s<=7400||s==7405||s==7412||7416<=s&&s<=7417||7616<=s&&s<=7673||7675<=s&&s<=7679||s==8204||8400<=s&&s<=8412||8413<=s&&s<=8416||s==8417||8418<=s&&s<=8420||8421<=s&&s<=8432||11503<=s&&s<=11505||s==11647||11744<=s&&s<=11775||12330<=s&&s<=12333||12334<=s&&s<=12335||12441<=s&&s<=12442||s==42607||42608<=s&&s<=42610||42612<=s&&s<=42621||42654<=s&&s<=42655||42736<=s&&s<=42737||s==43010||s==43014||s==43019||43045<=s&&s<=43046||43204<=s&&s<=43205||43232<=s&&s<=43249||43302<=s&&s<=43309||43335<=s&&s<=43345||43392<=s&&s<=43394||s==43443||43446<=s&&s<=43449||s==43452||s==43493||43561<=s&&s<=43566||43569<=s&&s<=43570||43573<=s&&s<=43574||s==43587||s==43596||s==43644||s==43696||43698<=s&&s<=43700||43703<=s&&s<=43704||43710<=s&&s<=43711||s==43713||43756<=s&&s<=43757||s==43766||s==44005||s==44008||s==44013||s==64286||65024<=s&&s<=65039||65056<=s&&s<=65071||65438<=s&&s<=65439||s==66045||s==66272||66422<=s&&s<=66426||68097<=s&&s<=68099||68101<=s&&s<=68102||68108<=s&&s<=68111||68152<=s&&s<=68154||s==68159||68325<=s&&s<=68326||s==69633||69688<=s&&s<=69702||69759<=s&&s<=69761||69811<=s&&s<=69814||69817<=s&&s<=69818||69888<=s&&s<=69890||69927<=s&&s<=69931||69933<=s&&s<=69940||s==70003||70016<=s&&s<=70017||70070<=s&&s<=70078||70090<=s&&s<=70092||70191<=s&&s<=70193||s==70196||70198<=s&&s<=70199||s==70206||s==70367||70371<=s&&s<=70378||70400<=s&&s<=70401||s==70460||s==70462||s==70464||s==70487||70502<=s&&s<=70508||70512<=s&&s<=70516||70712<=s&&s<=70719||70722<=s&&s<=70724||s==70726||s==70832||70835<=s&&s<=70840||s==70842||s==70845||70847<=s&&s<=70848||70850<=s&&s<=70851||s==71087||71090<=s&&s<=71093||71100<=s&&s<=71101||71103<=s&&s<=71104||71132<=s&&s<=71133||71219<=s&&s<=71226||s==71229||71231<=s&&s<=71232||s==71339||s==71341||71344<=s&&s<=71349||s==71351||71453<=s&&s<=71455||71458<=s&&s<=71461||71463<=s&&s<=71467||72193<=s&&s<=72198||72201<=s&&s<=72202||72243<=s&&s<=72248||72251<=s&&s<=72254||s==72263||72273<=s&&s<=72278||72281<=s&&s<=72283||72330<=s&&s<=72342||72344<=s&&s<=72345||72752<=s&&s<=72758||72760<=s&&s<=72765||s==72767||72850<=s&&s<=72871||72874<=s&&s<=72880||72882<=s&&s<=72883||72885<=s&&s<=72886||73009<=s&&s<=73014||s==73018||73020<=s&&s<=73021||73023<=s&&s<=73029||s==73031||92912<=s&&s<=92916||92976<=s&&s<=92982||94095<=s&&s<=94098||113821<=s&&s<=113822||s==119141||119143<=s&&s<=119145||119150<=s&&s<=119154||119163<=s&&s<=119170||119173<=s&&s<=119179||119210<=s&&s<=119213||119362<=s&&s<=119364||121344<=s&&s<=121398||121403<=s&&s<=121452||s==121461||s==121476||121499<=s&&s<=121503||121505<=s&&s<=121519||122880<=s&&s<=122886||122888<=s&&s<=122904||122907<=s&&s<=122913||122915<=s&&s<=122916||122918<=s&&s<=122922||125136<=s&&s<=125142||125252<=s&&s<=125258||917536<=s&&s<=917631||917760<=s&&s<=917999?a:127462<=s&&s<=127487?r:s==2307||s==2363||2366<=s&&s<=2368||2377<=s&&s<=2380||2382<=s&&s<=2383||2434<=s&&s<=2435||2495<=s&&s<=2496||2503<=s&&s<=2504||2507<=s&&s<=2508||s==2563||2622<=s&&s<=2624||s==2691||2750<=s&&s<=2752||s==2761||2763<=s&&s<=2764||2818<=s&&s<=2819||s==2880||2887<=s&&s<=2888||2891<=s&&s<=2892||s==3007||3009<=s&&s<=3010||3014<=s&&s<=3016||3018<=s&&s<=3020||3073<=s&&s<=3075||3137<=s&&s<=3140||3202<=s&&s<=3203||s==3262||3264<=s&&s<=3265||3267<=s&&s<=3268||3271<=s&&s<=3272||3274<=s&&s<=3275||3330<=s&&s<=3331||3391<=s&&s<=3392||3398<=s&&s<=3400||3402<=s&&s<=3404||3458<=s&&s<=3459||3536<=s&&s<=3537||3544<=s&&s<=3550||3570<=s&&s<=3571||s==3635||s==3763||3902<=s&&s<=3903||s==3967||s==4145||4155<=s&&s<=4156||4182<=s&&s<=4183||s==4228||s==6070||6078<=s&&s<=6085||6087<=s&&s<=6088||6435<=s&&s<=6438||6441<=s&&s<=6443||6448<=s&&s<=6449||6451<=s&&s<=6456||6681<=s&&s<=6682||s==6741||s==6743||6765<=s&&s<=6770||s==6916||s==6965||s==6971||6973<=s&&s<=6977||6979<=s&&s<=6980||s==7042||s==7073||7078<=s&&s<=7079||s==7082||s==7143||7146<=s&&s<=7148||s==7150||7154<=s&&s<=7155||7204<=s&&s<=7211||7220<=s&&s<=7221||s==7393||7410<=s&&s<=7411||s==7415||43043<=s&&s<=43044||s==43047||43136<=s&&s<=43137||43188<=s&&s<=43203||43346<=s&&s<=43347||s==43395||43444<=s&&s<=43445||43450<=s&&s<=43451||43453<=s&&s<=43456||43567<=s&&s<=43568||43571<=s&&s<=43572||s==43597||s==43755||43758<=s&&s<=43759||s==43765||44003<=s&&s<=44004||44006<=s&&s<=44007||44009<=s&&s<=44010||s==44012||s==69632||s==69634||s==69762||69808<=s&&s<=69810||69815<=s&&s<=69816||s==69932||s==70018||70067<=s&&s<=70069||70079<=s&&s<=70080||70188<=s&&s<=70190||70194<=s&&s<=70195||s==70197||70368<=s&&s<=70370||70402<=s&&s<=70403||s==70463||70465<=s&&s<=70468||70471<=s&&s<=70472||70475<=s&&s<=70477||70498<=s&&s<=70499||70709<=s&&s<=70711||70720<=s&&s<=70721||s==70725||70833<=s&&s<=70834||s==70841||70843<=s&&s<=70844||s==70846||s==70849||71088<=s&&s<=71089||71096<=s&&s<=71099||s==71102||71216<=s&&s<=71218||71227<=s&&s<=71228||s==71230||s==71340||71342<=s&&s<=71343||s==71350||71456<=s&&s<=71457||s==71462||72199<=s&&s<=72200||s==72249||72279<=s&&s<=72280||s==72343||s==72751||s==72766||s==72873||s==72881||s==72884||94033<=s&&s<=94078||s==119142||s==119149?f:4352<=s&&s<=4447||43360<=s&&s<=43388?c:4448<=s&&s<=4519||55216<=s&&s<=55238?h:4520<=s&&s<=4607||55243<=s&&s<=55291?d:s==44032||s==44060||s==44088||s==44116||s==44144||s==44172||s==44200||s==44228||s==44256||s==44284||s==44312||s==44340||s==44368||s==44396||s==44424||s==44452||s==44480||s==44508||s==44536||s==44564||s==44592||s==44620||s==44648||s==44676||s==44704||s==44732||s==44760||s==44788||s==44816||s==44844||s==44872||s==44900||s==44928||s==44956||s==44984||s==45012||s==45040||s==45068||s==45096||s==45124||s==45152||s==45180||s==45208||s==45236||s==45264||s==45292||s==45320||s==45348||s==45376||s==45404||s==45432||s==45460||s==45488||s==45516||s==45544||s==45572||s==45600||s==45628||s==45656||s==45684||s==45712||s==45740||s==45768||s==45796||s==45824||s==45852||s==45880||s==45908||s==45936||s==45964||s==45992||s==46020||s==46048||s==46076||s==46104||s==46132||s==46160||s==46188||s==46216||s==46244||s==46272||s==46300||s==46328||s==46356||s==46384||s==46412||s==46440||s==46468||s==46496||s==46524||s==46552||s==46580||s==46608||s==46636||s==46664||s==46692||s==46720||s==46748||s==46776||s==46804||s==46832||s==46860||s==46888||s==46916||s==46944||s==46972||s==47e3||s==47028||s==47056||s==47084||s==47112||s==47140||s==47168||s==47196||s==47224||s==47252||s==47280||s==47308||s==47336||s==47364||s==47392||s==47420||s==47448||s==47476||s==47504||s==47532||s==47560||s==47588||s==47616||s==47644||s==47672||s==47700||s==47728||s==47756||s==47784||s==47812||s==47840||s==47868||s==47896||s==47924||s==47952||s==47980||s==48008||s==48036||s==48064||s==48092||s==48120||s==48148||s==48176||s==48204||s==48232||s==48260||s==48288||s==48316||s==48344||s==48372||s==48400||s==48428||s==48456||s==48484||s==48512||s==48540||s==48568||s==48596||s==48624||s==48652||s==48680||s==48708||s==48736||s==48764||s==48792||s==48820||s==48848||s==48876||s==48904||s==48932||s==48960||s==48988||s==49016||s==49044||s==49072||s==49100||s==49128||s==49156||s==49184||s==49212||s==49240||s==49268||s==49296||s==49324||s==49352||s==49380||s==49408||s==49436||s==49464||s==49492||s==49520||s==49548||s==49576||s==49604||s==49632||s==49660||s==49688||s==49716||s==49744||s==49772||s==49800||s==49828||s==49856||s==49884||s==49912||s==49940||s==49968||s==49996||s==50024||s==50052||s==50080||s==50108||s==50136||s==50164||s==50192||s==50220||s==50248||s==50276||s==50304||s==50332||s==50360||s==50388||s==50416||s==50444||s==50472||s==50500||s==50528||s==50556||s==50584||s==50612||s==50640||s==50668||s==50696||s==50724||s==50752||s==50780||s==50808||s==50836||s==50864||s==50892||s==50920||s==50948||s==50976||s==51004||s==51032||s==51060||s==51088||s==51116||s==51144||s==51172||s==51200||s==51228||s==51256||s==51284||s==51312||s==51340||s==51368||s==51396||s==51424||s==51452||s==51480||s==51508||s==51536||s==51564||s==51592||s==51620||s==51648||s==51676||s==51704||s==51732||s==51760||s==51788||s==51816||s==51844||s==51872||s==51900||s==51928||s==51956||s==51984||s==52012||s==52040||s==52068||s==52096||s==52124||s==52152||s==52180||s==52208||s==52236||s==52264||s==52292||s==52320||s==52348||s==52376||s==52404||s==52432||s==52460||s==52488||s==52516||s==52544||s==52572||s==52600||s==52628||s==52656||s==52684||s==52712||s==52740||s==52768||s==52796||s==52824||s==52852||s==52880||s==52908||s==52936||s==52964||s==52992||s==53020||s==53048||s==53076||s==53104||s==53132||s==53160||s==53188||s==53216||s==53244||s==53272||s==53300||s==53328||s==53356||s==53384||s==53412||s==53440||s==53468||s==53496||s==53524||s==53552||s==53580||s==53608||s==53636||s==53664||s==53692||s==53720||s==53748||s==53776||s==53804||s==53832||s==53860||s==53888||s==53916||s==53944||s==53972||s==54e3||s==54028||s==54056||s==54084||s==54112||s==54140||s==54168||s==54196||s==54224||s==54252||s==54280||s==54308||s==54336||s==54364||s==54392||s==54420||s==54448||s==54476||s==54504||s==54532||s==54560||s==54588||s==54616||s==54644||s==54672||s==54700||s==54728||s==54756||s==54784||s==54812||s==54840||s==54868||s==54896||s==54924||s==54952||s==54980||s==55008||s==55036||s==55064||s==55092||s==55120||s==55148||s==55176?p:44033<=s&&s<=44059||44061<=s&&s<=44087||44089<=s&&s<=44115||44117<=s&&s<=44143||44145<=s&&s<=44171||44173<=s&&s<=44199||44201<=s&&s<=44227||44229<=s&&s<=44255||44257<=s&&s<=44283||44285<=s&&s<=44311||44313<=s&&s<=44339||44341<=s&&s<=44367||44369<=s&&s<=44395||44397<=s&&s<=44423||44425<=s&&s<=44451||44453<=s&&s<=44479||44481<=s&&s<=44507||44509<=s&&s<=44535||44537<=s&&s<=44563||44565<=s&&s<=44591||44593<=s&&s<=44619||44621<=s&&s<=44647||44649<=s&&s<=44675||44677<=s&&s<=44703||44705<=s&&s<=44731||44733<=s&&s<=44759||44761<=s&&s<=44787||44789<=s&&s<=44815||44817<=s&&s<=44843||44845<=s&&s<=44871||44873<=s&&s<=44899||44901<=s&&s<=44927||44929<=s&&s<=44955||44957<=s&&s<=44983||44985<=s&&s<=45011||45013<=s&&s<=45039||45041<=s&&s<=45067||45069<=s&&s<=45095||45097<=s&&s<=45123||45125<=s&&s<=45151||45153<=s&&s<=45179||45181<=s&&s<=45207||45209<=s&&s<=45235||45237<=s&&s<=45263||45265<=s&&s<=45291||45293<=s&&s<=45319||45321<=s&&s<=45347||45349<=s&&s<=45375||45377<=s&&s<=45403||45405<=s&&s<=45431||45433<=s&&s<=45459||45461<=s&&s<=45487||45489<=s&&s<=45515||45517<=s&&s<=45543||45545<=s&&s<=45571||45573<=s&&s<=45599||45601<=s&&s<=45627||45629<=s&&s<=45655||45657<=s&&s<=45683||45685<=s&&s<=45711||45713<=s&&s<=45739||45741<=s&&s<=45767||45769<=s&&s<=45795||45797<=s&&s<=45823||45825<=s&&s<=45851||45853<=s&&s<=45879||45881<=s&&s<=45907||45909<=s&&s<=45935||45937<=s&&s<=45963||45965<=s&&s<=45991||45993<=s&&s<=46019||46021<=s&&s<=46047||46049<=s&&s<=46075||46077<=s&&s<=46103||46105<=s&&s<=46131||46133<=s&&s<=46159||46161<=s&&s<=46187||46189<=s&&s<=46215||46217<=s&&s<=46243||46245<=s&&s<=46271||46273<=s&&s<=46299||46301<=s&&s<=46327||46329<=s&&s<=46355||46357<=s&&s<=46383||46385<=s&&s<=46411||46413<=s&&s<=46439||46441<=s&&s<=46467||46469<=s&&s<=46495||46497<=s&&s<=46523||46525<=s&&s<=46551||46553<=s&&s<=46579||46581<=s&&s<=46607||46609<=s&&s<=46635||46637<=s&&s<=46663||46665<=s&&s<=46691||46693<=s&&s<=46719||46721<=s&&s<=46747||46749<=s&&s<=46775||46777<=s&&s<=46803||46805<=s&&s<=46831||46833<=s&&s<=46859||46861<=s&&s<=46887||46889<=s&&s<=46915||46917<=s&&s<=46943||46945<=s&&s<=46971||46973<=s&&s<=46999||47001<=s&&s<=47027||47029<=s&&s<=47055||47057<=s&&s<=47083||47085<=s&&s<=47111||47113<=s&&s<=47139||47141<=s&&s<=47167||47169<=s&&s<=47195||47197<=s&&s<=47223||47225<=s&&s<=47251||47253<=s&&s<=47279||47281<=s&&s<=47307||47309<=s&&s<=47335||47337<=s&&s<=47363||47365<=s&&s<=47391||47393<=s&&s<=47419||47421<=s&&s<=47447||47449<=s&&s<=47475||47477<=s&&s<=47503||47505<=s&&s<=47531||47533<=s&&s<=47559||47561<=s&&s<=47587||47589<=s&&s<=47615||47617<=s&&s<=47643||47645<=s&&s<=47671||47673<=s&&s<=47699||47701<=s&&s<=47727||47729<=s&&s<=47755||47757<=s&&s<=47783||47785<=s&&s<=47811||47813<=s&&s<=47839||47841<=s&&s<=47867||47869<=s&&s<=47895||47897<=s&&s<=47923||47925<=s&&s<=47951||47953<=s&&s<=47979||47981<=s&&s<=48007||48009<=s&&s<=48035||48037<=s&&s<=48063||48065<=s&&s<=48091||48093<=s&&s<=48119||48121<=s&&s<=48147||48149<=s&&s<=48175||48177<=s&&s<=48203||48205<=s&&s<=48231||48233<=s&&s<=48259||48261<=s&&s<=48287||48289<=s&&s<=48315||48317<=s&&s<=48343||48345<=s&&s<=48371||48373<=s&&s<=48399||48401<=s&&s<=48427||48429<=s&&s<=48455||48457<=s&&s<=48483||48485<=s&&s<=48511||48513<=s&&s<=48539||48541<=s&&s<=48567||48569<=s&&s<=48595||48597<=s&&s<=48623||48625<=s&&s<=48651||48653<=s&&s<=48679||48681<=s&&s<=48707||48709<=s&&s<=48735||48737<=s&&s<=48763||48765<=s&&s<=48791||48793<=s&&s<=48819||48821<=s&&s<=48847||48849<=s&&s<=48875||48877<=s&&s<=48903||48905<=s&&s<=48931||48933<=s&&s<=48959||48961<=s&&s<=48987||48989<=s&&s<=49015||49017<=s&&s<=49043||49045<=s&&s<=49071||49073<=s&&s<=49099||49101<=s&&s<=49127||49129<=s&&s<=49155||49157<=s&&s<=49183||49185<=s&&s<=49211||49213<=s&&s<=49239||49241<=s&&s<=49267||49269<=s&&s<=49295||49297<=s&&s<=49323||49325<=s&&s<=49351||49353<=s&&s<=49379||49381<=s&&s<=49407||49409<=s&&s<=49435||49437<=s&&s<=49463||49465<=s&&s<=49491||49493<=s&&s<=49519||49521<=s&&s<=49547||49549<=s&&s<=49575||49577<=s&&s<=49603||49605<=s&&s<=49631||49633<=s&&s<=49659||49661<=s&&s<=49687||49689<=s&&s<=49715||49717<=s&&s<=49743||49745<=s&&s<=49771||49773<=s&&s<=49799||49801<=s&&s<=49827||49829<=s&&s<=49855||49857<=s&&s<=49883||49885<=s&&s<=49911||49913<=s&&s<=49939||49941<=s&&s<=49967||49969<=s&&s<=49995||49997<=s&&s<=50023||50025<=s&&s<=50051||50053<=s&&s<=50079||50081<=s&&s<=50107||50109<=s&&s<=50135||50137<=s&&s<=50163||50165<=s&&s<=50191||50193<=s&&s<=50219||50221<=s&&s<=50247||50249<=s&&s<=50275||50277<=s&&s<=50303||50305<=s&&s<=50331||50333<=s&&s<=50359||50361<=s&&s<=50387||50389<=s&&s<=50415||50417<=s&&s<=50443||50445<=s&&s<=50471||50473<=s&&s<=50499||50501<=s&&s<=50527||50529<=s&&s<=50555||50557<=s&&s<=50583||50585<=s&&s<=50611||50613<=s&&s<=50639||50641<=s&&s<=50667||50669<=s&&s<=50695||50697<=s&&s<=50723||50725<=s&&s<=50751||50753<=s&&s<=50779||50781<=s&&s<=50807||50809<=s&&s<=50835||50837<=s&&s<=50863||50865<=s&&s<=50891||50893<=s&&s<=50919||50921<=s&&s<=50947||50949<=s&&s<=50975||50977<=s&&s<=51003||51005<=s&&s<=51031||51033<=s&&s<=51059||51061<=s&&s<=51087||51089<=s&&s<=51115||51117<=s&&s<=51143||51145<=s&&s<=51171||51173<=s&&s<=51199||51201<=s&&s<=51227||51229<=s&&s<=51255||51257<=s&&s<=51283||51285<=s&&s<=51311||51313<=s&&s<=51339||51341<=s&&s<=51367||51369<=s&&s<=51395||51397<=s&&s<=51423||51425<=s&&s<=51451||51453<=s&&s<=51479||51481<=s&&s<=51507||51509<=s&&s<=51535||51537<=s&&s<=51563||51565<=s&&s<=51591||51593<=s&&s<=51619||51621<=s&&s<=51647||51649<=s&&s<=51675||51677<=s&&s<=51703||51705<=s&&s<=51731||51733<=s&&s<=51759||51761<=s&&s<=51787||51789<=s&&s<=51815||51817<=s&&s<=51843||51845<=s&&s<=51871||51873<=s&&s<=51899||51901<=s&&s<=51927||51929<=s&&s<=51955||51957<=s&&s<=51983||51985<=s&&s<=52011||52013<=s&&s<=52039||52041<=s&&s<=52067||52069<=s&&s<=52095||52097<=s&&s<=52123||52125<=s&&s<=52151||52153<=s&&s<=52179||52181<=s&&s<=52207||52209<=s&&s<=52235||52237<=s&&s<=52263||52265<=s&&s<=52291||52293<=s&&s<=52319||52321<=s&&s<=52347||52349<=s&&s<=52375||52377<=s&&s<=52403||52405<=s&&s<=52431||52433<=s&&s<=52459||52461<=s&&s<=52487||52489<=s&&s<=52515||52517<=s&&s<=52543||52545<=s&&s<=52571||52573<=s&&s<=52599||52601<=s&&s<=52627||52629<=s&&s<=52655||52657<=s&&s<=52683||52685<=s&&s<=52711||52713<=s&&s<=52739||52741<=s&&s<=52767||52769<=s&&s<=52795||52797<=s&&s<=52823||52825<=s&&s<=52851||52853<=s&&s<=52879||52881<=s&&s<=52907||52909<=s&&s<=52935||52937<=s&&s<=52963||52965<=s&&s<=52991||52993<=s&&s<=53019||53021<=s&&s<=53047||53049<=s&&s<=53075||53077<=s&&s<=53103||53105<=s&&s<=53131||53133<=s&&s<=53159||53161<=s&&s<=53187||53189<=s&&s<=53215||53217<=s&&s<=53243||53245<=s&&s<=53271||53273<=s&&s<=53299||53301<=s&&s<=53327||53329<=s&&s<=53355||53357<=s&&s<=53383||53385<=s&&s<=53411||53413<=s&&s<=53439||53441<=s&&s<=53467||53469<=s&&s<=53495||53497<=s&&s<=53523||53525<=s&&s<=53551||53553<=s&&s<=53579||53581<=s&&s<=53607||53609<=s&&s<=53635||53637<=s&&s<=53663||53665<=s&&s<=53691||53693<=s&&s<=53719||53721<=s&&s<=53747||53749<=s&&s<=53775||53777<=s&&s<=53803||53805<=s&&s<=53831||53833<=s&&s<=53859||53861<=s&&s<=53887||53889<=s&&s<=53915||53917<=s&&s<=53943||53945<=s&&s<=53971||53973<=s&&s<=53999||54001<=s&&s<=54027||54029<=s&&s<=54055||54057<=s&&s<=54083||54085<=s&&s<=54111||54113<=s&&s<=54139||54141<=s&&s<=54167||54169<=s&&s<=54195||54197<=s&&s<=54223||54225<=s&&s<=54251||54253<=s&&s<=54279||54281<=s&&s<=54307||54309<=s&&s<=54335||54337<=s&&s<=54363||54365<=s&&s<=54391||54393<=s&&s<=54419||54421<=s&&s<=54447||54449<=s&&s<=54475||54477<=s&&s<=54503||54505<=s&&s<=54531||54533<=s&&s<=54559||54561<=s&&s<=54587||54589<=s&&s<=54615||54617<=s&&s<=54643||54645<=s&&s<=54671||54673<=s&&s<=54699||54701<=s&&s<=54727||54729<=s&&s<=54755||54757<=s&&s<=54783||54785<=s&&s<=54811||54813<=s&&s<=54839||54841<=s&&s<=54867||54869<=s&&s<=54895||54897<=s&&s<=54923||54925<=s&&s<=54951||54953<=s&&s<=54979||54981<=s&&s<=55007||55009<=s&&s<=55035||55037<=s&&s<=55063||55065<=s&&s<=55091||55093<=s&&s<=55119||55121<=s&&s<=55147||55149<=s&&s<=55175||55177<=s&&s<=55203?m:s==9757||s==9977||9994<=s&&s<=9997||s==127877||127938<=s&&s<=127940||s==127943||127946<=s&&s<=127948||128066<=s&&s<=128067||128070<=s&&s<=128080||s==128110||128112<=s&&s<=128120||s==128124||128129<=s&&s<=128131||128133<=s&&s<=128135||s==128170||128372<=s&&s<=128373||s==128378||s==128400||128405<=s&&s<=128406||128581<=s&&s<=128583||128587<=s&&s<=128591||s==128675||128692<=s&&s<=128694||s==128704||s==128716||129304<=s&&s<=129308||129310<=s&&s<=129311||s==129318||129328<=s&&s<=129337||129341<=s&&s<=129342||129489<=s&&s<=129501?w:127995<=s&&s<=127999?A:s==8205?E:s==9792||s==9794||9877<=s&&s<=9878||s==9992||s==10084||s==127752||s==127806||s==127859||s==127891||s==127908||s==127912||s==127979||s==127981||s==128139||128187<=s&&s<=128188||s==128295||s==128300||s==128488||s==128640||s==128658?b:128102<=s&&s<=128105?I:T}return this}e.exports&&(e.exports=t)})(Qm);var Ub=Qm.exports;const kb=lr(Ub);function Vb(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function Gb(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}const qb=1.2,Jm="ID_WHITE_PIXEL",ef=new q(4,4),Hb=new be(1,1,1,1);function jb(e){const t=document.createElement("canvas");t.width=ef.x,t.height=ef.y;const n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(Jm,t)}const vn={};function Yb(e,t,n,i,o,a,r){return vn.font=t,vn.fillColor=n,vn.strokeColor=i,vn.strokeWidth=o,vn.padding=Cn.PADDING,r===rt.CENTER?vn.textBaseline="middle":r===rt.TOP?vn.textBaseline="top":vn.textBaseline="bottom",vn.fill=a===li.FILL||a===li.FILL_AND_OUTLINE,vn.stroke=a===li.OUTLINE||a===li.FILL_AND_OUTLINE,vn.backgroundColor=D.BLACK,Ib(e,vn)}function tf(e,t){t.textureInfo=void 0,t.dimensions=void 0;const n=t.billboard;l(n)&&(n.show=!1,n.image=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function Xb(e,t,n,i){i.index=e.addImageSync(t,n)}const $b=new kb;function Zb(e,t){const n=t._renderedText,i=$b.splitGraphemes(n),o=i.length,a=t._glyphs,r=a.length;let f,c,h;if(t._relativeSize=t._fontSize/Cn.FONT_SIZE,o<r)for(c=o;c<r;++c)tf(e,a[c]);a.length=o;const d=t.show&&t._showBackground&&n.split(`
6349
- `).join("").length>0;let p=t._backgroundBillboard;const m=e._backgroundBillboardCollection;d?(l(p)||(p=m.add({collection:e,image:Jm,imageSubRegion:Hb}),t._backgroundBillboard=p),p.color=t._backgroundColor,p.show=t._show,p.position=t._position,p.eyeOffset=t._eyeOffset,p.pixelOffset=t._pixelOffset,p.horizontalOrigin=Nn.LEFT,p.verticalOrigin=t._verticalOrigin,p.heightReference=t._heightReference,p.scale=t.totalScale,p.pickPrimitive=t,p.id=t._id,p.translucencyByDistance=t._translucencyByDistance,p.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,p.scaleByDistance=t._scaleByDistance,p.distanceDisplayCondition=t._distanceDisplayCondition,p.disableDepthTestDistance=t._disableDepthTestDistance,p.clusterShow=t.clusterShow):l(p)&&(m.remove(p),t._backgroundBillboard=p=void 0);const T=e._glyphTextureCache;for(h=0;h<o;++h){const y=i[h],w=t._verticalOrigin,A=JSON.stringify([y,t._fontFamily,t._fontStyle,t._fontWeight,+w]);let E=T[A];if(!l(E)){const b=`${t._fontStyle} ${t._fontWeight} ${Cn.FONT_SIZE}px ${t._fontFamily}`,I=Yb(y,b,D.WHITE,D.WHITE,0,li.FILL,w);if(E=new Gb(e,-1,I.dimensions),T[A]=E,I.width>0&&I.height>0){const O=vb(I,{cutoff:Cn.CUTOFF,radius:Cn.RADIUS}),B=I.getContext("2d"),L=I.width,F=I.height,N=B.getImageData(0,0,L,F);for(let U=0;U<L;U++)for(let M=0;M<F;M++){const j=M*L+U,Y=O[j]*255,s=j*4;N.data[s+0]=Y,N.data[s+1]=Y,N.data[s+2]=Y,N.data[s+3]=Y}B.putImageData(N,0,0),y!==" "&&Xb(e._textureAtlas,A,I,E)}}if(f=a[h],l(f)?E.index===-1?tf(e,f):l(f.textureInfo)&&(f.textureInfo=void 0):(f=new Vb,a[h]=f),f.textureInfo=E,f.dimensions=E.dimensions,E.index!==-1){let b=f.billboard;const I=e._spareBillboards;l(b)||(I.length>0?b=I.pop():(b=e._billboardCollection.add({collection:e}),b._labelDimensions=new q,b._labelTranslate=new q),f.billboard=b),b.show=t._show,b.position=t._position,b.eyeOffset=t._eyeOffset,b.pixelOffset=t._pixelOffset,b.horizontalOrigin=Nn.LEFT,b.verticalOrigin=t._verticalOrigin,b.heightReference=t._heightReference,b.scale=t.totalScale,b.pickPrimitive=t,b.id=t._id,b.image=A,b.translucencyByDistance=t._translucencyByDistance,b.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,b.scaleByDistance=t._scaleByDistance,b.distanceDisplayCondition=t._distanceDisplayCondition,b.disableDepthTestDistance=t._disableDepthTestDistance,b._batchIndex=t._batchIndex,b.outlineColor=t.outlineColor,t.style===li.FILL_AND_OUTLINE?(b.color=t._fillColor,b.outlineWidth=t.outlineWidth):t.style===li.FILL?(b.color=t._fillColor,b.outlineWidth=0):t.style===li.OUTLINE&&(b.color=D.TRANSPARENT,b.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function e0(e,t,n){return t===Nn.CENTER?-e/2:t===Nn.RIGHT?-(e+n.x):n.x}const at=new q,Kb=new q;function Qb(e){const t=e._glyphs,n=e._renderedText;let i,o,a=0,r=0;const f=[];let c=Number.NEGATIVE_INFINITY,h=0,d=1,p;const m=t.length,T=e._backgroundBillboard,y=q.clone(l(T)?e._backgroundPadding:q.ZERO,Kb);for(y.x/=e._relativeSize,y.y/=e._relativeSize,p=0;p<m;++p)n.charAt(p)===`
6350
- `?(f.push(a),++d,a=0):(i=t[p],o=i.dimensions,h=Math.max(h,o.height-o.descent),c=Math.max(c,o.descent),a+=o.width-o.minx,p<m-1&&(a+=t[p+1].dimensions.minx),r=Math.max(r,a));f.push(a);const w=h+c,A=e.totalScale,E=e._horizontalOrigin,b=e._verticalOrigin;let I=0,O=f[I],B=e0(O,E,y);const L=(l(e._lineHeight)?e._lineHeight:qb*e._fontSize)/e._relativeSize,F=L*(d-1);let N=r,U=w+F;l(T)&&(N+=y.x*2,U+=y.y*2,T._labelHorizontalOrigin=E),at.x=B*A,at.y=0;let M=!0,j=0;for(p=0;p<m;++p)if(n.charAt(p)===`
6351
- `)++I,j+=L,O=f[I],B=e0(O,E,y),at.x=B*A,M=!0;else if(i=t[p],o=i.dimensions,b===rt.TOP?(at.y=o.height-h-y.y,at.y+=Cn.PADDING):b===rt.CENTER?at.y=(F+o.height-h)/2:b===rt.BASELINE?(at.y=F,at.y-=Cn.PADDING):(at.y=F+c+y.y,at.y-=Cn.PADDING),at.y=(at.y-o.descent-j)*A,M&&(at.x-=Cn.PADDING*A,M=!1),l(i.billboard)&&(i.billboard._setTranslate(at),i.billboard._labelDimensions.x=N,i.billboard._labelDimensions.y=U,i.billboard._labelHorizontalOrigin=E),p<m-1){const Y=t[p+1];at.x+=(o.width-o.minx+Y.dimensions.minx)*A}if(l(T)&&n.split(`
6352
- `).join("").length>0&&(E===Nn.CENTER?B=-r/2-y.x:E===Nn.RIGHT?B=-(r+y.x*2):B=0,at.x=B*A,b===rt.TOP?at.y=w-h-c:b===rt.CENTER?at.y=(w-h)/2-c:b===rt.BASELINE?at.y=-y.y-c:at.y=0,at.y=at.y*A,T.width=N,T.height=U,T._setTranslate(at),T._labelTranslate=q.clone(at,T._labelTranslate)),ta(e.heightReference))for(p=0;p<m;++p){i=t[p];const Y=i.billboard;l(Y)&&(Y._labelTranslate=q.clone(at,Y._labelTranslate))}}function t0(e,t){const n=t._glyphs;for(let i=0,o=n.length;i<o;++i)tf(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),st(t)}function Hn(e){e=g(e,g.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new rn({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new rn({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=D.clone(D.WHITE),this.show=g(e.show,!0),this.modelMatrix=k.clone(g(e.modelMatrix,k.IDENTITY)),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.blendOption=g(e.blendOption,_t.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(Hn.prototype,{length:{get:function(){return this._labels.length}}}),Hn.prototype.add=function(e){const t=new qn(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},Hn.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){const t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),t0(this,e),!0}return!1},Hn.prototype.removeAll=function(){const e=this._labels;for(let t=0,n=e.length;t<n;++t)t0(this,e[t]);e.length=0},Hn.prototype.contains=function(e){return l(e)&&e._labelCollection===this},Hn.prototype.get=function(e){if(!l(e))throw new C("index is required.");return this._labels[e]},Hn.prototype.update=function(e){if(!this.show)return;const t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;const i=e.context;l(this._textureAtlas)||(this._textureAtlas=new hi({context:i}),t.textureAtlas=this._textureAtlas),l(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new hi({context:i,initialSize:ef}),n.textureAtlas=this._backgroundTextureAtlas,jb(this._backgroundTextureAtlas));const o=this._labelsToUpdate.length;for(let r=0;r<o;++r){const f=this._labelsToUpdate[r];if(f.isDestroyed())continue;const c=f._glyphs.length;f._rebindAllGlyphs&&(Zb(this,f),f._rebindAllGlyphs=!1),f._repositionAllGlyphs&&(Qb(f),f._repositionAllGlyphs=!1);const h=f._glyphs.length-c;this._totalGlyphCount+=h}const a=n.length>0?_t.TRANSLUCENT:this.blendOption;t.blendOption=a,n.blendOption=a,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)},Hn.prototype.isDestroyed=function(){return!1},Hn.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),st(this)};const n0={id:void 0};function ir(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){const t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;const o=t.values.slice(0),a=n.values.slice(0),r=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,a,r)}while(e._refire);e._firing=!1}}}function en(e){this._owner=e,this._entities=new ii,this._addedEntities=new ii,this._removedEntities=new ii,this._changedEntities=new ii,this._suspendCount=0,this._collectionChanged=new Ne,this._id=Xn(),this._show=!0,this._firing=!1,this._refire=!1}en.prototype.suspendEvents=function(){this._suspendCount++},en.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new C("resumeEvents can not be called before suspendEvents.");this._suspendCount--,ir(this)},Object.defineProperties(en.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(!l(e))throw new C("value is required.");if(e===this._show)return;this.suspendEvents();let t;const n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){const a=n[t],r=i[t];a!==r.isShowing&&r.definitionChanged.raiseEvent(r,"isShowing",r.isShowing,a)}this.resumeEvents()}},owner:{get:function(){return this._owner}}}),en.prototype.computeAvailability=function(){let e=Vi.MAXIMUM_VALUE,t=Vi.MINIMUM_VALUE;const n=this._entities.values;for(let i=0,o=n.length;i<o;i++){const r=n[i].availability;if(l(r)){const f=r.start,c=r.stop;J.lessThan(f,e)&&!f.equals(Vi.MINIMUM_VALUE)&&(e=f),J.greaterThan(c,t)&&!c.equals(Vi.MAXIMUM_VALUE)&&(t=c)}}return Vi.MAXIMUM_VALUE.equals(e)&&(e=Vi.MINIMUM_VALUE),Vi.MINIMUM_VALUE.equals(t)&&(t=Vi.MAXIMUM_VALUE),new nt({start:e,stop:t})},en.prototype.add=function(e){if(!l(e))throw new C("entity is required.");e instanceof dn||(e=new dn(e));const t=e.id,n=this._entities;if(n.contains(t))throw new C(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(en.prototype._onEntityDefinitionChanged,this),ir(this),e},en.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1},en.prototype.contains=function(e){if(!l(e))throw new C("entity is required");return this._entities.get(e.id)===e},en.prototype.removeById=function(e){if(!l(e))return!1;const n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(en.prototype._onEntityDefinitionChanged,this),ir(this),!0):!1},en.prototype.removeAll=function(){const e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let a=0;a<t;a++){const r=n[a],f=r.id,c=i.get(f);l(c)||(r.definitionChanged.removeEventListener(en.prototype._onEntityDefinitionChanged,this),o.set(f,r))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),ir(this)},en.prototype.getById=function(e){if(!l(e))throw new C("id is required.");return this._entities.get(e)},en.prototype.getOrCreateEntity=function(e){if(!l(e))throw new C("id is required.");let t=this._entities.get(e);return l(t)||(n0.id=e,t=new dn(n0),this.add(t)),t},en.prototype._onEntityDefinitionChanged=function(e){const t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),ir(this)};function Da(){C.throwInstantiationError()}Object.defineProperties(Da.prototype,{name:{get:C.throwInstantiationError},clock:{get:C.throwInstantiationError},entities:{get:C.throwInstantiationError},isLoading:{get:C.throwInstantiationError},changedEvent:{get:C.throwInstantiationError},errorEvent:{get:C.throwInstantiationError},loadingEvent:{get:C.throwInstantiationError},show:{get:C.throwInstantiationError},clustering:{get:C.throwInstantiationError}}),Da.prototype.update=function(e){C.throwInstantiationError()},Da.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};function ui(e,t){_.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new u,this._cameraPositionInScaledSpace=new u,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(ui.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){const n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=u.magnitudeSquared(n)-1;u.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});const i0=new u;ui.prototype.isPointVisible=function(e){const n=this._ellipsoid.transformPositionToScaledSpace(e,i0);return nf(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},ui.prototype.isScaledSpacePointVisible=function(e){return nf(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};const Jb=new u;ui.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){const n=this._ellipsoid;let i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=Jb,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),nf(e,o,i)},ui.prototype.computeHorizonCullingPoint=function(e,t,n){return r0(this._ellipsoid,e,t,n)};const o0=pe.clone(pe.UNIT_SPHERE);ui.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){const o=s0(this._ellipsoid,n,o0);return r0(o,e,t,i)},ui.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return a0(this._ellipsoid,e,t,n,i,o)},ui.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,a){const r=s0(this._ellipsoid,o,o0);return a0(r,e,t,n,i,a)};const ex=[];ui.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){_.typeOf.object("rectangle",e);const i=de.subsample(e,t,0,ex),o=te.fromPoints(i);if(!(u.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};const tx=new u;function s0(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){const i=u.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,tx);e=pe.fromCartesian3(i,n)}return e}function r0(e,t,n,i){_.typeOf.object("directionToPoint",t),_.defined("positions",n),l(i)||(i=new u);const o=f0(e,t);let a=0;for(let r=0,f=n.length;r<f;++r){const c=n[r],h=c0(e,c,o);if(h<0)return;a=Math.max(a,h)}return h0(o,a,i)}const Oa=new u;function a0(e,t,n,i,o,a){_.typeOf.object("directionToPoint",t),_.defined("vertices",n),_.typeOf.number("stride",i),l(a)||(a=new u),i=g(i,3),o=g(o,u.ZERO);const r=f0(e,t);let f=0;for(let c=0,h=n.length;c<h;c+=i){Oa.x=n[c]+o.x,Oa.y=n[c+1]+o.y,Oa.z=n[c+2]+o.z;const d=c0(e,Oa,r);if(d<0)return;f=Math.max(f,d)}return h0(r,f,a)}function nf(e,t,n){const i=t,o=n,a=u.subtract(e,i,i0),r=-u.dot(a,i);return!(o<0?r>0:r>o&&r*r/u.magnitudeSquared(a)>o)}const nx=new u,ix=new u;function c0(e,t,n){const i=e.transformPositionToScaledSpace(t,nx);let o=u.magnitudeSquared(i),a=Math.sqrt(o);const r=u.divideByScalar(i,a,ix);o=Math.max(1,o),a=Math.max(1,a);const f=u.dot(r,n),c=u.magnitude(u.cross(r,n,r)),h=1/a,d=Math.sqrt(o-1)*h;return 1/(f*h-c*d)}function h0(e,t,n){if(!(t<=0||t===1/0||t!==t))return u.multiplyByScalar(e,t,n)}const of=new u;function f0(e,t){return u.equals(t,u.ZERO)?t:(e.transformPositionToScaledSpace(t,of),u.normalize(of,of))}function Re(e,t){if(e=g(e,g.EMPTY_OBJECT),l(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;if(l(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Ie.clone(n)}if(l(i)){if(i.far<=i.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");i=Ie.clone(i)}if(l(o)){if(o.far<=o.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=it.clone(o)}this._show=g(e.show,!0),this._position=u.clone(g(e.position,u.ZERO)),this._actualPosition=u.clone(this._position),this._color=D.clone(g(e.color,D.WHITE)),this._outlineColor=D.clone(g(e.outlineColor,D.TRANSPARENT)),this._outlineWidth=g(e.outlineWidth,0),this._pixelSize=g(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=g(e.disableDepthTestDistance,0),this._id=e.id,this._collection=g(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=g(e.splitDirection,Bu.NONE)}const l0=Re.SHOW_INDEX=0,u0=Re.POSITION_INDEX=1,ox=Re.COLOR_INDEX=2,sx=Re.OUTLINE_COLOR_INDEX=3,rx=Re.OUTLINE_WIDTH_INDEX=4,ax=Re.PIXEL_SIZE_INDEX=5,cx=Re.SCALE_BY_DISTANCE_INDEX=6,hx=Re.TRANSLUCENCY_BY_DISTANCE_INDEX=7,fx=Re.DISTANCE_DISPLAY_CONDITION_INDEX=8,lx=Re.DISABLE_DEPTH_DISTANCE_INDEX=9,ux=Re.SPLIT_DIRECTION_INDEX=10;Re.NUMBER_OF_PROPERTIES=11;function wn(e,t){const n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Re.prototype,{show:{get:function(){return this._show},set:function(e){if(!l(e))throw new C("value is required.");this._show!==e&&(this._show=e,wn(this,l0))}},position:{get:function(){return this._position},set:function(e){if(!l(e))throw new C("value is required.");const t=this._position;u.equals(t,e)||(u.clone(e,t),u.clone(e,this._actualPosition),wn(this,u0))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._scaleByDistance;Ie.equals(t,e)||(this._scaleByDistance=Ie.clone(e,t),wn(this,cx))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._translucencyByDistance;Ie.equals(t,e)||(this._translucencyByDistance=Ie.clone(e,t),wn(this,hx))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){if(!l(e))throw new C("value is required.");this._pixelSize!==e&&(this._pixelSize=e,wn(this,ax))}},color:{get:function(){return this._color},set:function(e){if(!l(e))throw new C("value is required.");const t=this._color;D.equals(t,e)||(D.clone(e,t),wn(this,ox))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!l(e))throw new C("value is required.");const t=this._outlineColor;D.equals(t,e)||(D.clone(e,t),wn(this,sx))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!l(e))throw new C("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,wn(this,rx))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far must be greater than near");it.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=it.clone(e,this._distanceDisplayCondition),wn(this,fx))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(!l(e)||e<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,wn(this,lx)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,wn(this,l0))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,wn(this,ux))}}}),Re.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},Re.prototype._getActualPosition=function(){return this._actualPosition},Re.prototype._setActualPosition=function(e){u.clone(e,this._actualPosition),wn(this,u0)};const d0=new Z;Re._computeActualPosition=function(e,t,n){return t.mode===ye.SCENE3D?e:(k.multiplyByPoint(n,e,d0),vt.computeActualEllipsoidPosition(t,d0))};const p0=new Z;Re._computeScreenSpacePosition=function(e,t,n,i){const o=k.multiplyByVector(e,Z.fromElements(t.x,t.y,t.z,1,p0),p0);return vt.worldToWindowCoordinates(n,o,i)},Re.prototype.computeScreenSpacePosition=function(e,t){const n=this._pointPrimitiveCollection;if(l(t)||(t=new q),!l(n))throw new C("PointPrimitive must be in a collection.");if(!l(e))throw new C("scene is required.");const i=n.modelMatrix,o=Re._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o},Re.getScreenSpaceBoundingBox=function(e,t,n){const i=e.pixelSize,o=i*.5,a=t.x-o,r=t.y-o,f=i,c=i;return l(n)||(n=new be),n.x=a,n.y=r,n.width=f,n.height=c,n},Re.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&u.equals(this._position,e._position)&&D.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&D.equals(this._outlineColor,e._outlineColor)&&Ie.equals(this._scaleByDistance,e._scaleByDistance)&&Ie.equals(this._translucencyByDistance,e._translucencyByDistance)&&it.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection},Re.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};const va=`in vec4 v_color;
6348
+ `)}return n}var Qm={exports:{}};(function(e){function t(){var n=0,i=1,o=2,a=3,r=4,f=5,c=6,h=7,d=8,p=9,m=10,T=11,y=12,w=13,A=14,E=15,b=16,D=17,O=0,B=1,L=2,F=3,N=4;function U(s,x){return 55296<=s.charCodeAt(x)&&s.charCodeAt(x)<=56319&&56320<=s.charCodeAt(x+1)&&s.charCodeAt(x+1)<=57343}function M(s,x){x===void 0&&(x=0);var P=s.charCodeAt(x);if(55296<=P&&P<=56319&&x<s.length-1){var z=P,H=s.charCodeAt(x+1);return 56320<=H&&H<=57343?(z-55296)*1024+(H-56320)+65536:z}if(56320<=P&&P<=57343&&x>=1){var z=s.charCodeAt(x-1),H=P;return 55296<=z&&z<=56319?(z-55296)*1024+(H-56320)+65536:H}return P}function j(s,x,P){var z=[s].concat(x).concat([P]),H=z[z.length-2],X=P,ee=z.lastIndexOf(A);if(ee>1&&z.slice(1,ee).every(function(le){return le==a})&&[a,w,D].indexOf(s)==-1)return L;var K=z.lastIndexOf(r);if(K>0&&z.slice(1,K).every(function(le){return le==r})&&[y,r].indexOf(H)==-1)return z.filter(function(le){return le==r}).length%2==1?F:N;if(H==n&&X==i)return O;if(H==o||H==n||H==i)return X==A&&x.every(function(le){return le==a})?L:B;if(X==o||X==n||X==i)return B;if(H==c&&(X==c||X==h||X==p||X==m))return O;if((H==p||H==h)&&(X==h||X==d))return O;if((H==m||H==d)&&X==d)return O;if(X==a||X==E)return O;if(X==f)return O;if(H==y)return O;var ce=z.indexOf(a)!=-1?z.lastIndexOf(a)-1:z.length-2;return[w,D].indexOf(z[ce])!=-1&&z.slice(ce+1,-1).every(function(le){return le==a})&&X==A||H==E&&[b,D].indexOf(X)!=-1?O:x.indexOf(r)!=-1?L:H==r&&X==r?O:B}this.nextBreak=function(s,x){if(x===void 0&&(x=0),x<0)return 0;if(x>=s.length-1)return s.length;for(var P=Y(M(s,x)),z=[],H=x+1;H<s.length;H++)if(!U(s,H-1)){var X=Y(M(s,H));if(j(P,z,X))return H;z.push(X)}return s.length},this.splitGraphemes=function(s){for(var x=[],P=0,z;(z=this.nextBreak(s,P))<s.length;)x.push(s.slice(P,z)),P=z;return P<s.length&&x.push(s.slice(P)),x},this.iterateGraphemes=function(s){var x=0,P={next:(function(){var z,H;return(H=this.nextBreak(s,x))<s.length?(z=s.slice(x,H),x=H,{value:z,done:!1}):x<s.length?(z=s.slice(x),x=s.length,{value:z,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(P[Symbol.iterator]=function(){return P}),P},this.countGraphemes=function(s){for(var x=0,P=0,z;(z=this.nextBreak(s,P))<s.length;)P=z,x++;return P<s.length&&x++,x};function Y(s){return 1536<=s&&s<=1541||s==1757||s==1807||s==2274||s==3406||s==69821||70082<=s&&s<=70083||s==72250||72326<=s&&s<=72329||s==73030?y:s==13?n:s==10?i:0<=s&&s<=9||11<=s&&s<=12||14<=s&&s<=31||127<=s&&s<=159||s==173||s==1564||s==6158||s==8203||8206<=s&&s<=8207||s==8232||s==8233||8234<=s&&s<=8238||8288<=s&&s<=8292||s==8293||8294<=s&&s<=8303||55296<=s&&s<=57343||s==65279||65520<=s&&s<=65528||65529<=s&&s<=65531||113824<=s&&s<=113827||119155<=s&&s<=119162||s==917504||s==917505||917506<=s&&s<=917535||917632<=s&&s<=917759||918e3<=s&&s<=921599?o:768<=s&&s<=879||1155<=s&&s<=1159||1160<=s&&s<=1161||1425<=s&&s<=1469||s==1471||1473<=s&&s<=1474||1476<=s&&s<=1477||s==1479||1552<=s&&s<=1562||1611<=s&&s<=1631||s==1648||1750<=s&&s<=1756||1759<=s&&s<=1764||1767<=s&&s<=1768||1770<=s&&s<=1773||s==1809||1840<=s&&s<=1866||1958<=s&&s<=1968||2027<=s&&s<=2035||2070<=s&&s<=2073||2075<=s&&s<=2083||2085<=s&&s<=2087||2089<=s&&s<=2093||2137<=s&&s<=2139||2260<=s&&s<=2273||2275<=s&&s<=2306||s==2362||s==2364||2369<=s&&s<=2376||s==2381||2385<=s&&s<=2391||2402<=s&&s<=2403||s==2433||s==2492||s==2494||2497<=s&&s<=2500||s==2509||s==2519||2530<=s&&s<=2531||2561<=s&&s<=2562||s==2620||2625<=s&&s<=2626||2631<=s&&s<=2632||2635<=s&&s<=2637||s==2641||2672<=s&&s<=2673||s==2677||2689<=s&&s<=2690||s==2748||2753<=s&&s<=2757||2759<=s&&s<=2760||s==2765||2786<=s&&s<=2787||2810<=s&&s<=2815||s==2817||s==2876||s==2878||s==2879||2881<=s&&s<=2884||s==2893||s==2902||s==2903||2914<=s&&s<=2915||s==2946||s==3006||s==3008||s==3021||s==3031||s==3072||3134<=s&&s<=3136||3142<=s&&s<=3144||3146<=s&&s<=3149||3157<=s&&s<=3158||3170<=s&&s<=3171||s==3201||s==3260||s==3263||s==3266||s==3270||3276<=s&&s<=3277||3285<=s&&s<=3286||3298<=s&&s<=3299||3328<=s&&s<=3329||3387<=s&&s<=3388||s==3390||3393<=s&&s<=3396||s==3405||s==3415||3426<=s&&s<=3427||s==3530||s==3535||3538<=s&&s<=3540||s==3542||s==3551||s==3633||3636<=s&&s<=3642||3655<=s&&s<=3662||s==3761||3764<=s&&s<=3769||3771<=s&&s<=3772||3784<=s&&s<=3789||3864<=s&&s<=3865||s==3893||s==3895||s==3897||3953<=s&&s<=3966||3968<=s&&s<=3972||3974<=s&&s<=3975||3981<=s&&s<=3991||3993<=s&&s<=4028||s==4038||4141<=s&&s<=4144||4146<=s&&s<=4151||4153<=s&&s<=4154||4157<=s&&s<=4158||4184<=s&&s<=4185||4190<=s&&s<=4192||4209<=s&&s<=4212||s==4226||4229<=s&&s<=4230||s==4237||s==4253||4957<=s&&s<=4959||5906<=s&&s<=5908||5938<=s&&s<=5940||5970<=s&&s<=5971||6002<=s&&s<=6003||6068<=s&&s<=6069||6071<=s&&s<=6077||s==6086||6089<=s&&s<=6099||s==6109||6155<=s&&s<=6157||6277<=s&&s<=6278||s==6313||6432<=s&&s<=6434||6439<=s&&s<=6440||s==6450||6457<=s&&s<=6459||6679<=s&&s<=6680||s==6683||s==6742||6744<=s&&s<=6750||s==6752||s==6754||6757<=s&&s<=6764||6771<=s&&s<=6780||s==6783||6832<=s&&s<=6845||s==6846||6912<=s&&s<=6915||s==6964||6966<=s&&s<=6970||s==6972||s==6978||7019<=s&&s<=7027||7040<=s&&s<=7041||7074<=s&&s<=7077||7080<=s&&s<=7081||7083<=s&&s<=7085||s==7142||7144<=s&&s<=7145||s==7149||7151<=s&&s<=7153||7212<=s&&s<=7219||7222<=s&&s<=7223||7376<=s&&s<=7378||7380<=s&&s<=7392||7394<=s&&s<=7400||s==7405||s==7412||7416<=s&&s<=7417||7616<=s&&s<=7673||7675<=s&&s<=7679||s==8204||8400<=s&&s<=8412||8413<=s&&s<=8416||s==8417||8418<=s&&s<=8420||8421<=s&&s<=8432||11503<=s&&s<=11505||s==11647||11744<=s&&s<=11775||12330<=s&&s<=12333||12334<=s&&s<=12335||12441<=s&&s<=12442||s==42607||42608<=s&&s<=42610||42612<=s&&s<=42621||42654<=s&&s<=42655||42736<=s&&s<=42737||s==43010||s==43014||s==43019||43045<=s&&s<=43046||43204<=s&&s<=43205||43232<=s&&s<=43249||43302<=s&&s<=43309||43335<=s&&s<=43345||43392<=s&&s<=43394||s==43443||43446<=s&&s<=43449||s==43452||s==43493||43561<=s&&s<=43566||43569<=s&&s<=43570||43573<=s&&s<=43574||s==43587||s==43596||s==43644||s==43696||43698<=s&&s<=43700||43703<=s&&s<=43704||43710<=s&&s<=43711||s==43713||43756<=s&&s<=43757||s==43766||s==44005||s==44008||s==44013||s==64286||65024<=s&&s<=65039||65056<=s&&s<=65071||65438<=s&&s<=65439||s==66045||s==66272||66422<=s&&s<=66426||68097<=s&&s<=68099||68101<=s&&s<=68102||68108<=s&&s<=68111||68152<=s&&s<=68154||s==68159||68325<=s&&s<=68326||s==69633||69688<=s&&s<=69702||69759<=s&&s<=69761||69811<=s&&s<=69814||69817<=s&&s<=69818||69888<=s&&s<=69890||69927<=s&&s<=69931||69933<=s&&s<=69940||s==70003||70016<=s&&s<=70017||70070<=s&&s<=70078||70090<=s&&s<=70092||70191<=s&&s<=70193||s==70196||70198<=s&&s<=70199||s==70206||s==70367||70371<=s&&s<=70378||70400<=s&&s<=70401||s==70460||s==70462||s==70464||s==70487||70502<=s&&s<=70508||70512<=s&&s<=70516||70712<=s&&s<=70719||70722<=s&&s<=70724||s==70726||s==70832||70835<=s&&s<=70840||s==70842||s==70845||70847<=s&&s<=70848||70850<=s&&s<=70851||s==71087||71090<=s&&s<=71093||71100<=s&&s<=71101||71103<=s&&s<=71104||71132<=s&&s<=71133||71219<=s&&s<=71226||s==71229||71231<=s&&s<=71232||s==71339||s==71341||71344<=s&&s<=71349||s==71351||71453<=s&&s<=71455||71458<=s&&s<=71461||71463<=s&&s<=71467||72193<=s&&s<=72198||72201<=s&&s<=72202||72243<=s&&s<=72248||72251<=s&&s<=72254||s==72263||72273<=s&&s<=72278||72281<=s&&s<=72283||72330<=s&&s<=72342||72344<=s&&s<=72345||72752<=s&&s<=72758||72760<=s&&s<=72765||s==72767||72850<=s&&s<=72871||72874<=s&&s<=72880||72882<=s&&s<=72883||72885<=s&&s<=72886||73009<=s&&s<=73014||s==73018||73020<=s&&s<=73021||73023<=s&&s<=73029||s==73031||92912<=s&&s<=92916||92976<=s&&s<=92982||94095<=s&&s<=94098||113821<=s&&s<=113822||s==119141||119143<=s&&s<=119145||119150<=s&&s<=119154||119163<=s&&s<=119170||119173<=s&&s<=119179||119210<=s&&s<=119213||119362<=s&&s<=119364||121344<=s&&s<=121398||121403<=s&&s<=121452||s==121461||s==121476||121499<=s&&s<=121503||121505<=s&&s<=121519||122880<=s&&s<=122886||122888<=s&&s<=122904||122907<=s&&s<=122913||122915<=s&&s<=122916||122918<=s&&s<=122922||125136<=s&&s<=125142||125252<=s&&s<=125258||917536<=s&&s<=917631||917760<=s&&s<=917999?a:127462<=s&&s<=127487?r:s==2307||s==2363||2366<=s&&s<=2368||2377<=s&&s<=2380||2382<=s&&s<=2383||2434<=s&&s<=2435||2495<=s&&s<=2496||2503<=s&&s<=2504||2507<=s&&s<=2508||s==2563||2622<=s&&s<=2624||s==2691||2750<=s&&s<=2752||s==2761||2763<=s&&s<=2764||2818<=s&&s<=2819||s==2880||2887<=s&&s<=2888||2891<=s&&s<=2892||s==3007||3009<=s&&s<=3010||3014<=s&&s<=3016||3018<=s&&s<=3020||3073<=s&&s<=3075||3137<=s&&s<=3140||3202<=s&&s<=3203||s==3262||3264<=s&&s<=3265||3267<=s&&s<=3268||3271<=s&&s<=3272||3274<=s&&s<=3275||3330<=s&&s<=3331||3391<=s&&s<=3392||3398<=s&&s<=3400||3402<=s&&s<=3404||3458<=s&&s<=3459||3536<=s&&s<=3537||3544<=s&&s<=3550||3570<=s&&s<=3571||s==3635||s==3763||3902<=s&&s<=3903||s==3967||s==4145||4155<=s&&s<=4156||4182<=s&&s<=4183||s==4228||s==6070||6078<=s&&s<=6085||6087<=s&&s<=6088||6435<=s&&s<=6438||6441<=s&&s<=6443||6448<=s&&s<=6449||6451<=s&&s<=6456||6681<=s&&s<=6682||s==6741||s==6743||6765<=s&&s<=6770||s==6916||s==6965||s==6971||6973<=s&&s<=6977||6979<=s&&s<=6980||s==7042||s==7073||7078<=s&&s<=7079||s==7082||s==7143||7146<=s&&s<=7148||s==7150||7154<=s&&s<=7155||7204<=s&&s<=7211||7220<=s&&s<=7221||s==7393||7410<=s&&s<=7411||s==7415||43043<=s&&s<=43044||s==43047||43136<=s&&s<=43137||43188<=s&&s<=43203||43346<=s&&s<=43347||s==43395||43444<=s&&s<=43445||43450<=s&&s<=43451||43453<=s&&s<=43456||43567<=s&&s<=43568||43571<=s&&s<=43572||s==43597||s==43755||43758<=s&&s<=43759||s==43765||44003<=s&&s<=44004||44006<=s&&s<=44007||44009<=s&&s<=44010||s==44012||s==69632||s==69634||s==69762||69808<=s&&s<=69810||69815<=s&&s<=69816||s==69932||s==70018||70067<=s&&s<=70069||70079<=s&&s<=70080||70188<=s&&s<=70190||70194<=s&&s<=70195||s==70197||70368<=s&&s<=70370||70402<=s&&s<=70403||s==70463||70465<=s&&s<=70468||70471<=s&&s<=70472||70475<=s&&s<=70477||70498<=s&&s<=70499||70709<=s&&s<=70711||70720<=s&&s<=70721||s==70725||70833<=s&&s<=70834||s==70841||70843<=s&&s<=70844||s==70846||s==70849||71088<=s&&s<=71089||71096<=s&&s<=71099||s==71102||71216<=s&&s<=71218||71227<=s&&s<=71228||s==71230||s==71340||71342<=s&&s<=71343||s==71350||71456<=s&&s<=71457||s==71462||72199<=s&&s<=72200||s==72249||72279<=s&&s<=72280||s==72343||s==72751||s==72766||s==72873||s==72881||s==72884||94033<=s&&s<=94078||s==119142||s==119149?f:4352<=s&&s<=4447||43360<=s&&s<=43388?c:4448<=s&&s<=4519||55216<=s&&s<=55238?h:4520<=s&&s<=4607||55243<=s&&s<=55291?d:s==44032||s==44060||s==44088||s==44116||s==44144||s==44172||s==44200||s==44228||s==44256||s==44284||s==44312||s==44340||s==44368||s==44396||s==44424||s==44452||s==44480||s==44508||s==44536||s==44564||s==44592||s==44620||s==44648||s==44676||s==44704||s==44732||s==44760||s==44788||s==44816||s==44844||s==44872||s==44900||s==44928||s==44956||s==44984||s==45012||s==45040||s==45068||s==45096||s==45124||s==45152||s==45180||s==45208||s==45236||s==45264||s==45292||s==45320||s==45348||s==45376||s==45404||s==45432||s==45460||s==45488||s==45516||s==45544||s==45572||s==45600||s==45628||s==45656||s==45684||s==45712||s==45740||s==45768||s==45796||s==45824||s==45852||s==45880||s==45908||s==45936||s==45964||s==45992||s==46020||s==46048||s==46076||s==46104||s==46132||s==46160||s==46188||s==46216||s==46244||s==46272||s==46300||s==46328||s==46356||s==46384||s==46412||s==46440||s==46468||s==46496||s==46524||s==46552||s==46580||s==46608||s==46636||s==46664||s==46692||s==46720||s==46748||s==46776||s==46804||s==46832||s==46860||s==46888||s==46916||s==46944||s==46972||s==47e3||s==47028||s==47056||s==47084||s==47112||s==47140||s==47168||s==47196||s==47224||s==47252||s==47280||s==47308||s==47336||s==47364||s==47392||s==47420||s==47448||s==47476||s==47504||s==47532||s==47560||s==47588||s==47616||s==47644||s==47672||s==47700||s==47728||s==47756||s==47784||s==47812||s==47840||s==47868||s==47896||s==47924||s==47952||s==47980||s==48008||s==48036||s==48064||s==48092||s==48120||s==48148||s==48176||s==48204||s==48232||s==48260||s==48288||s==48316||s==48344||s==48372||s==48400||s==48428||s==48456||s==48484||s==48512||s==48540||s==48568||s==48596||s==48624||s==48652||s==48680||s==48708||s==48736||s==48764||s==48792||s==48820||s==48848||s==48876||s==48904||s==48932||s==48960||s==48988||s==49016||s==49044||s==49072||s==49100||s==49128||s==49156||s==49184||s==49212||s==49240||s==49268||s==49296||s==49324||s==49352||s==49380||s==49408||s==49436||s==49464||s==49492||s==49520||s==49548||s==49576||s==49604||s==49632||s==49660||s==49688||s==49716||s==49744||s==49772||s==49800||s==49828||s==49856||s==49884||s==49912||s==49940||s==49968||s==49996||s==50024||s==50052||s==50080||s==50108||s==50136||s==50164||s==50192||s==50220||s==50248||s==50276||s==50304||s==50332||s==50360||s==50388||s==50416||s==50444||s==50472||s==50500||s==50528||s==50556||s==50584||s==50612||s==50640||s==50668||s==50696||s==50724||s==50752||s==50780||s==50808||s==50836||s==50864||s==50892||s==50920||s==50948||s==50976||s==51004||s==51032||s==51060||s==51088||s==51116||s==51144||s==51172||s==51200||s==51228||s==51256||s==51284||s==51312||s==51340||s==51368||s==51396||s==51424||s==51452||s==51480||s==51508||s==51536||s==51564||s==51592||s==51620||s==51648||s==51676||s==51704||s==51732||s==51760||s==51788||s==51816||s==51844||s==51872||s==51900||s==51928||s==51956||s==51984||s==52012||s==52040||s==52068||s==52096||s==52124||s==52152||s==52180||s==52208||s==52236||s==52264||s==52292||s==52320||s==52348||s==52376||s==52404||s==52432||s==52460||s==52488||s==52516||s==52544||s==52572||s==52600||s==52628||s==52656||s==52684||s==52712||s==52740||s==52768||s==52796||s==52824||s==52852||s==52880||s==52908||s==52936||s==52964||s==52992||s==53020||s==53048||s==53076||s==53104||s==53132||s==53160||s==53188||s==53216||s==53244||s==53272||s==53300||s==53328||s==53356||s==53384||s==53412||s==53440||s==53468||s==53496||s==53524||s==53552||s==53580||s==53608||s==53636||s==53664||s==53692||s==53720||s==53748||s==53776||s==53804||s==53832||s==53860||s==53888||s==53916||s==53944||s==53972||s==54e3||s==54028||s==54056||s==54084||s==54112||s==54140||s==54168||s==54196||s==54224||s==54252||s==54280||s==54308||s==54336||s==54364||s==54392||s==54420||s==54448||s==54476||s==54504||s==54532||s==54560||s==54588||s==54616||s==54644||s==54672||s==54700||s==54728||s==54756||s==54784||s==54812||s==54840||s==54868||s==54896||s==54924||s==54952||s==54980||s==55008||s==55036||s==55064||s==55092||s==55120||s==55148||s==55176?p:44033<=s&&s<=44059||44061<=s&&s<=44087||44089<=s&&s<=44115||44117<=s&&s<=44143||44145<=s&&s<=44171||44173<=s&&s<=44199||44201<=s&&s<=44227||44229<=s&&s<=44255||44257<=s&&s<=44283||44285<=s&&s<=44311||44313<=s&&s<=44339||44341<=s&&s<=44367||44369<=s&&s<=44395||44397<=s&&s<=44423||44425<=s&&s<=44451||44453<=s&&s<=44479||44481<=s&&s<=44507||44509<=s&&s<=44535||44537<=s&&s<=44563||44565<=s&&s<=44591||44593<=s&&s<=44619||44621<=s&&s<=44647||44649<=s&&s<=44675||44677<=s&&s<=44703||44705<=s&&s<=44731||44733<=s&&s<=44759||44761<=s&&s<=44787||44789<=s&&s<=44815||44817<=s&&s<=44843||44845<=s&&s<=44871||44873<=s&&s<=44899||44901<=s&&s<=44927||44929<=s&&s<=44955||44957<=s&&s<=44983||44985<=s&&s<=45011||45013<=s&&s<=45039||45041<=s&&s<=45067||45069<=s&&s<=45095||45097<=s&&s<=45123||45125<=s&&s<=45151||45153<=s&&s<=45179||45181<=s&&s<=45207||45209<=s&&s<=45235||45237<=s&&s<=45263||45265<=s&&s<=45291||45293<=s&&s<=45319||45321<=s&&s<=45347||45349<=s&&s<=45375||45377<=s&&s<=45403||45405<=s&&s<=45431||45433<=s&&s<=45459||45461<=s&&s<=45487||45489<=s&&s<=45515||45517<=s&&s<=45543||45545<=s&&s<=45571||45573<=s&&s<=45599||45601<=s&&s<=45627||45629<=s&&s<=45655||45657<=s&&s<=45683||45685<=s&&s<=45711||45713<=s&&s<=45739||45741<=s&&s<=45767||45769<=s&&s<=45795||45797<=s&&s<=45823||45825<=s&&s<=45851||45853<=s&&s<=45879||45881<=s&&s<=45907||45909<=s&&s<=45935||45937<=s&&s<=45963||45965<=s&&s<=45991||45993<=s&&s<=46019||46021<=s&&s<=46047||46049<=s&&s<=46075||46077<=s&&s<=46103||46105<=s&&s<=46131||46133<=s&&s<=46159||46161<=s&&s<=46187||46189<=s&&s<=46215||46217<=s&&s<=46243||46245<=s&&s<=46271||46273<=s&&s<=46299||46301<=s&&s<=46327||46329<=s&&s<=46355||46357<=s&&s<=46383||46385<=s&&s<=46411||46413<=s&&s<=46439||46441<=s&&s<=46467||46469<=s&&s<=46495||46497<=s&&s<=46523||46525<=s&&s<=46551||46553<=s&&s<=46579||46581<=s&&s<=46607||46609<=s&&s<=46635||46637<=s&&s<=46663||46665<=s&&s<=46691||46693<=s&&s<=46719||46721<=s&&s<=46747||46749<=s&&s<=46775||46777<=s&&s<=46803||46805<=s&&s<=46831||46833<=s&&s<=46859||46861<=s&&s<=46887||46889<=s&&s<=46915||46917<=s&&s<=46943||46945<=s&&s<=46971||46973<=s&&s<=46999||47001<=s&&s<=47027||47029<=s&&s<=47055||47057<=s&&s<=47083||47085<=s&&s<=47111||47113<=s&&s<=47139||47141<=s&&s<=47167||47169<=s&&s<=47195||47197<=s&&s<=47223||47225<=s&&s<=47251||47253<=s&&s<=47279||47281<=s&&s<=47307||47309<=s&&s<=47335||47337<=s&&s<=47363||47365<=s&&s<=47391||47393<=s&&s<=47419||47421<=s&&s<=47447||47449<=s&&s<=47475||47477<=s&&s<=47503||47505<=s&&s<=47531||47533<=s&&s<=47559||47561<=s&&s<=47587||47589<=s&&s<=47615||47617<=s&&s<=47643||47645<=s&&s<=47671||47673<=s&&s<=47699||47701<=s&&s<=47727||47729<=s&&s<=47755||47757<=s&&s<=47783||47785<=s&&s<=47811||47813<=s&&s<=47839||47841<=s&&s<=47867||47869<=s&&s<=47895||47897<=s&&s<=47923||47925<=s&&s<=47951||47953<=s&&s<=47979||47981<=s&&s<=48007||48009<=s&&s<=48035||48037<=s&&s<=48063||48065<=s&&s<=48091||48093<=s&&s<=48119||48121<=s&&s<=48147||48149<=s&&s<=48175||48177<=s&&s<=48203||48205<=s&&s<=48231||48233<=s&&s<=48259||48261<=s&&s<=48287||48289<=s&&s<=48315||48317<=s&&s<=48343||48345<=s&&s<=48371||48373<=s&&s<=48399||48401<=s&&s<=48427||48429<=s&&s<=48455||48457<=s&&s<=48483||48485<=s&&s<=48511||48513<=s&&s<=48539||48541<=s&&s<=48567||48569<=s&&s<=48595||48597<=s&&s<=48623||48625<=s&&s<=48651||48653<=s&&s<=48679||48681<=s&&s<=48707||48709<=s&&s<=48735||48737<=s&&s<=48763||48765<=s&&s<=48791||48793<=s&&s<=48819||48821<=s&&s<=48847||48849<=s&&s<=48875||48877<=s&&s<=48903||48905<=s&&s<=48931||48933<=s&&s<=48959||48961<=s&&s<=48987||48989<=s&&s<=49015||49017<=s&&s<=49043||49045<=s&&s<=49071||49073<=s&&s<=49099||49101<=s&&s<=49127||49129<=s&&s<=49155||49157<=s&&s<=49183||49185<=s&&s<=49211||49213<=s&&s<=49239||49241<=s&&s<=49267||49269<=s&&s<=49295||49297<=s&&s<=49323||49325<=s&&s<=49351||49353<=s&&s<=49379||49381<=s&&s<=49407||49409<=s&&s<=49435||49437<=s&&s<=49463||49465<=s&&s<=49491||49493<=s&&s<=49519||49521<=s&&s<=49547||49549<=s&&s<=49575||49577<=s&&s<=49603||49605<=s&&s<=49631||49633<=s&&s<=49659||49661<=s&&s<=49687||49689<=s&&s<=49715||49717<=s&&s<=49743||49745<=s&&s<=49771||49773<=s&&s<=49799||49801<=s&&s<=49827||49829<=s&&s<=49855||49857<=s&&s<=49883||49885<=s&&s<=49911||49913<=s&&s<=49939||49941<=s&&s<=49967||49969<=s&&s<=49995||49997<=s&&s<=50023||50025<=s&&s<=50051||50053<=s&&s<=50079||50081<=s&&s<=50107||50109<=s&&s<=50135||50137<=s&&s<=50163||50165<=s&&s<=50191||50193<=s&&s<=50219||50221<=s&&s<=50247||50249<=s&&s<=50275||50277<=s&&s<=50303||50305<=s&&s<=50331||50333<=s&&s<=50359||50361<=s&&s<=50387||50389<=s&&s<=50415||50417<=s&&s<=50443||50445<=s&&s<=50471||50473<=s&&s<=50499||50501<=s&&s<=50527||50529<=s&&s<=50555||50557<=s&&s<=50583||50585<=s&&s<=50611||50613<=s&&s<=50639||50641<=s&&s<=50667||50669<=s&&s<=50695||50697<=s&&s<=50723||50725<=s&&s<=50751||50753<=s&&s<=50779||50781<=s&&s<=50807||50809<=s&&s<=50835||50837<=s&&s<=50863||50865<=s&&s<=50891||50893<=s&&s<=50919||50921<=s&&s<=50947||50949<=s&&s<=50975||50977<=s&&s<=51003||51005<=s&&s<=51031||51033<=s&&s<=51059||51061<=s&&s<=51087||51089<=s&&s<=51115||51117<=s&&s<=51143||51145<=s&&s<=51171||51173<=s&&s<=51199||51201<=s&&s<=51227||51229<=s&&s<=51255||51257<=s&&s<=51283||51285<=s&&s<=51311||51313<=s&&s<=51339||51341<=s&&s<=51367||51369<=s&&s<=51395||51397<=s&&s<=51423||51425<=s&&s<=51451||51453<=s&&s<=51479||51481<=s&&s<=51507||51509<=s&&s<=51535||51537<=s&&s<=51563||51565<=s&&s<=51591||51593<=s&&s<=51619||51621<=s&&s<=51647||51649<=s&&s<=51675||51677<=s&&s<=51703||51705<=s&&s<=51731||51733<=s&&s<=51759||51761<=s&&s<=51787||51789<=s&&s<=51815||51817<=s&&s<=51843||51845<=s&&s<=51871||51873<=s&&s<=51899||51901<=s&&s<=51927||51929<=s&&s<=51955||51957<=s&&s<=51983||51985<=s&&s<=52011||52013<=s&&s<=52039||52041<=s&&s<=52067||52069<=s&&s<=52095||52097<=s&&s<=52123||52125<=s&&s<=52151||52153<=s&&s<=52179||52181<=s&&s<=52207||52209<=s&&s<=52235||52237<=s&&s<=52263||52265<=s&&s<=52291||52293<=s&&s<=52319||52321<=s&&s<=52347||52349<=s&&s<=52375||52377<=s&&s<=52403||52405<=s&&s<=52431||52433<=s&&s<=52459||52461<=s&&s<=52487||52489<=s&&s<=52515||52517<=s&&s<=52543||52545<=s&&s<=52571||52573<=s&&s<=52599||52601<=s&&s<=52627||52629<=s&&s<=52655||52657<=s&&s<=52683||52685<=s&&s<=52711||52713<=s&&s<=52739||52741<=s&&s<=52767||52769<=s&&s<=52795||52797<=s&&s<=52823||52825<=s&&s<=52851||52853<=s&&s<=52879||52881<=s&&s<=52907||52909<=s&&s<=52935||52937<=s&&s<=52963||52965<=s&&s<=52991||52993<=s&&s<=53019||53021<=s&&s<=53047||53049<=s&&s<=53075||53077<=s&&s<=53103||53105<=s&&s<=53131||53133<=s&&s<=53159||53161<=s&&s<=53187||53189<=s&&s<=53215||53217<=s&&s<=53243||53245<=s&&s<=53271||53273<=s&&s<=53299||53301<=s&&s<=53327||53329<=s&&s<=53355||53357<=s&&s<=53383||53385<=s&&s<=53411||53413<=s&&s<=53439||53441<=s&&s<=53467||53469<=s&&s<=53495||53497<=s&&s<=53523||53525<=s&&s<=53551||53553<=s&&s<=53579||53581<=s&&s<=53607||53609<=s&&s<=53635||53637<=s&&s<=53663||53665<=s&&s<=53691||53693<=s&&s<=53719||53721<=s&&s<=53747||53749<=s&&s<=53775||53777<=s&&s<=53803||53805<=s&&s<=53831||53833<=s&&s<=53859||53861<=s&&s<=53887||53889<=s&&s<=53915||53917<=s&&s<=53943||53945<=s&&s<=53971||53973<=s&&s<=53999||54001<=s&&s<=54027||54029<=s&&s<=54055||54057<=s&&s<=54083||54085<=s&&s<=54111||54113<=s&&s<=54139||54141<=s&&s<=54167||54169<=s&&s<=54195||54197<=s&&s<=54223||54225<=s&&s<=54251||54253<=s&&s<=54279||54281<=s&&s<=54307||54309<=s&&s<=54335||54337<=s&&s<=54363||54365<=s&&s<=54391||54393<=s&&s<=54419||54421<=s&&s<=54447||54449<=s&&s<=54475||54477<=s&&s<=54503||54505<=s&&s<=54531||54533<=s&&s<=54559||54561<=s&&s<=54587||54589<=s&&s<=54615||54617<=s&&s<=54643||54645<=s&&s<=54671||54673<=s&&s<=54699||54701<=s&&s<=54727||54729<=s&&s<=54755||54757<=s&&s<=54783||54785<=s&&s<=54811||54813<=s&&s<=54839||54841<=s&&s<=54867||54869<=s&&s<=54895||54897<=s&&s<=54923||54925<=s&&s<=54951||54953<=s&&s<=54979||54981<=s&&s<=55007||55009<=s&&s<=55035||55037<=s&&s<=55063||55065<=s&&s<=55091||55093<=s&&s<=55119||55121<=s&&s<=55147||55149<=s&&s<=55175||55177<=s&&s<=55203?m:s==9757||s==9977||9994<=s&&s<=9997||s==127877||127938<=s&&s<=127940||s==127943||127946<=s&&s<=127948||128066<=s&&s<=128067||128070<=s&&s<=128080||s==128110||128112<=s&&s<=128120||s==128124||128129<=s&&s<=128131||128133<=s&&s<=128135||s==128170||128372<=s&&s<=128373||s==128378||s==128400||128405<=s&&s<=128406||128581<=s&&s<=128583||128587<=s&&s<=128591||s==128675||128692<=s&&s<=128694||s==128704||s==128716||129304<=s&&s<=129308||129310<=s&&s<=129311||s==129318||129328<=s&&s<=129337||129341<=s&&s<=129342||129489<=s&&s<=129501?w:127995<=s&&s<=127999?A:s==8205?E:s==9792||s==9794||9877<=s&&s<=9878||s==9992||s==10084||s==127752||s==127806||s==127859||s==127891||s==127908||s==127912||s==127979||s==127981||s==128139||128187<=s&&s<=128188||s==128295||s==128300||s==128488||s==128640||s==128658?b:128102<=s&&s<=128105?D:T}return this}e.exports&&(e.exports=t)})(Qm);var Ub=Qm.exports;const kb=lr(Ub);function Vb(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function Gb(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}const qb=1.2,Jm="ID_WHITE_PIXEL",ef=new q(4,4),Hb=new be(1,1,1,1);function jb(e){const t=document.createElement("canvas");t.width=ef.x,t.height=ef.y;const n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(Jm,t)}const vn={};function Yb(e,t,n,i,o,a,r){return vn.font=t,vn.fillColor=n,vn.strokeColor=i,vn.strokeWidth=o,vn.padding=Cn.PADDING,r===rt.CENTER?vn.textBaseline="middle":r===rt.TOP?vn.textBaseline="top":vn.textBaseline="bottom",vn.fill=a===li.FILL||a===li.FILL_AND_OUTLINE,vn.stroke=a===li.OUTLINE||a===li.FILL_AND_OUTLINE,vn.backgroundColor=I.BLACK,Ib(e,vn)}function tf(e,t){t.textureInfo=void 0,t.dimensions=void 0;const n=t.billboard;l(n)&&(n.show=!1,n.image=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function Xb(e,t,n,i){i.index=e.addImageSync(t,n)}const $b=new kb;function Zb(e,t){const n=t._renderedText,i=$b.splitGraphemes(n),o=i.length,a=t._glyphs,r=a.length;let f,c,h;if(t._relativeSize=t._fontSize/Cn.FONT_SIZE,o<r)for(c=o;c<r;++c)tf(e,a[c]);a.length=o;const d=t.show&&t._showBackground&&n.split(`
6349
+ `).join("").length>0;let p=t._backgroundBillboard;const m=e._backgroundBillboardCollection;d?(l(p)||(p=m.add({collection:e,image:Jm,imageSubRegion:Hb}),t._backgroundBillboard=p),p.color=t._backgroundColor,p.show=t._show,p.position=t._position,p.eyeOffset=t._eyeOffset,p.pixelOffset=t._pixelOffset,p.horizontalOrigin=Ln.LEFT,p.verticalOrigin=t._verticalOrigin,p.heightReference=t._heightReference,p.scale=t.totalScale,p.pickPrimitive=t,p.id=t._id,p.translucencyByDistance=t._translucencyByDistance,p.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,p.scaleByDistance=t._scaleByDistance,p.distanceDisplayCondition=t._distanceDisplayCondition,p.disableDepthTestDistance=t._disableDepthTestDistance,p.clusterShow=t.clusterShow):l(p)&&(m.remove(p),t._backgroundBillboard=p=void 0);const T=e._glyphTextureCache;for(h=0;h<o;++h){const y=i[h],w=t._verticalOrigin,A=JSON.stringify([y,t._fontFamily,t._fontStyle,t._fontWeight,+w]);let E=T[A];if(!l(E)){const b=`${t._fontStyle} ${t._fontWeight} ${Cn.FONT_SIZE}px ${t._fontFamily}`,D=Yb(y,b,I.WHITE,I.WHITE,0,li.FILL,w);if(E=new Gb(e,-1,D.dimensions),T[A]=E,D.width>0&&D.height>0){const O=vb(D,{cutoff:Cn.CUTOFF,radius:Cn.RADIUS}),B=D.getContext("2d"),L=D.width,F=D.height,N=B.getImageData(0,0,L,F);for(let U=0;U<L;U++)for(let M=0;M<F;M++){const j=M*L+U,Y=O[j]*255,s=j*4;N.data[s+0]=Y,N.data[s+1]=Y,N.data[s+2]=Y,N.data[s+3]=Y}B.putImageData(N,0,0),y!==" "&&Xb(e._textureAtlas,A,D,E)}}if(f=a[h],l(f)?E.index===-1?tf(e,f):l(f.textureInfo)&&(f.textureInfo=void 0):(f=new Vb,a[h]=f),f.textureInfo=E,f.dimensions=E.dimensions,E.index!==-1){let b=f.billboard;const D=e._spareBillboards;l(b)||(D.length>0?b=D.pop():(b=e._billboardCollection.add({collection:e}),b._labelDimensions=new q,b._labelTranslate=new q),f.billboard=b),b.show=t._show,b.position=t._position,b.eyeOffset=t._eyeOffset,b.pixelOffset=t._pixelOffset,b.horizontalOrigin=Ln.LEFT,b.verticalOrigin=t._verticalOrigin,b.heightReference=t._heightReference,b.scale=t.totalScale,b.pickPrimitive=t,b.id=t._id,b.image=A,b.translucencyByDistance=t._translucencyByDistance,b.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,b.scaleByDistance=t._scaleByDistance,b.distanceDisplayCondition=t._distanceDisplayCondition,b.disableDepthTestDistance=t._disableDepthTestDistance,b._batchIndex=t._batchIndex,b.outlineColor=t.outlineColor,t.style===li.FILL_AND_OUTLINE?(b.color=t._fillColor,b.outlineWidth=t.outlineWidth):t.style===li.FILL?(b.color=t._fillColor,b.outlineWidth=0):t.style===li.OUTLINE&&(b.color=I.TRANSPARENT,b.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function e0(e,t,n){return t===Ln.CENTER?-e/2:t===Ln.RIGHT?-(e+n.x):n.x}const at=new q,Kb=new q;function Qb(e){const t=e._glyphs,n=e._renderedText;let i,o,a=0,r=0;const f=[];let c=Number.NEGATIVE_INFINITY,h=0,d=1,p;const m=t.length,T=e._backgroundBillboard,y=q.clone(l(T)?e._backgroundPadding:q.ZERO,Kb);for(y.x/=e._relativeSize,y.y/=e._relativeSize,p=0;p<m;++p)n.charAt(p)===`
6350
+ `?(f.push(a),++d,a=0):(i=t[p],o=i.dimensions,h=Math.max(h,o.height-o.descent),c=Math.max(c,o.descent),a+=o.width-o.minx,p<m-1&&(a+=t[p+1].dimensions.minx),r=Math.max(r,a));f.push(a);const w=h+c,A=e.totalScale,E=e._horizontalOrigin,b=e._verticalOrigin;let D=0,O=f[D],B=e0(O,E,y);const L=(l(e._lineHeight)?e._lineHeight:qb*e._fontSize)/e._relativeSize,F=L*(d-1);let N=r,U=w+F;l(T)&&(N+=y.x*2,U+=y.y*2,T._labelHorizontalOrigin=E),at.x=B*A,at.y=0;let M=!0,j=0;for(p=0;p<m;++p)if(n.charAt(p)===`
6351
+ `)++D,j+=L,O=f[D],B=e0(O,E,y),at.x=B*A,M=!0;else if(i=t[p],o=i.dimensions,b===rt.TOP?(at.y=o.height-h-y.y,at.y+=Cn.PADDING):b===rt.CENTER?at.y=(F+o.height-h)/2:b===rt.BASELINE?(at.y=F,at.y-=Cn.PADDING):(at.y=F+c+y.y,at.y-=Cn.PADDING),at.y=(at.y-o.descent-j)*A,M&&(at.x-=Cn.PADDING*A,M=!1),l(i.billboard)&&(i.billboard._setTranslate(at),i.billboard._labelDimensions.x=N,i.billboard._labelDimensions.y=U,i.billboard._labelHorizontalOrigin=E),p<m-1){const Y=t[p+1];at.x+=(o.width-o.minx+Y.dimensions.minx)*A}if(l(T)&&n.split(`
6352
+ `).join("").length>0&&(E===Ln.CENTER?B=-r/2-y.x:E===Ln.RIGHT?B=-(r+y.x*2):B=0,at.x=B*A,b===rt.TOP?at.y=w-h-c:b===rt.CENTER?at.y=(w-h)/2-c:b===rt.BASELINE?at.y=-y.y-c:at.y=0,at.y=at.y*A,T.width=N,T.height=U,T._setTranslate(at),T._labelTranslate=q.clone(at,T._labelTranslate)),ta(e.heightReference))for(p=0;p<m;++p){i=t[p];const Y=i.billboard;l(Y)&&(Y._labelTranslate=q.clone(at,Y._labelTranslate))}}function t0(e,t){const n=t._glyphs;for(let i=0,o=n.length;i<o;++i)tf(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),st(t)}function qn(e){e=g(e,g.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new rn({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new rn({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=I.clone(I.WHITE),this.show=g(e.show,!0),this.modelMatrix=k.clone(g(e.modelMatrix,k.IDENTITY)),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.blendOption=g(e.blendOption,_t.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(qn.prototype,{length:{get:function(){return this._labels.length}}}),qn.prototype.add=function(e){const t=new Gn(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},qn.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){const t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),t0(this,e),!0}return!1},qn.prototype.removeAll=function(){const e=this._labels;for(let t=0,n=e.length;t<n;++t)t0(this,e[t]);e.length=0},qn.prototype.contains=function(e){return l(e)&&e._labelCollection===this},qn.prototype.get=function(e){if(!l(e))throw new C("index is required.");return this._labels[e]},qn.prototype.update=function(e){if(!this.show)return;const t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;const i=e.context;l(this._textureAtlas)||(this._textureAtlas=new hi({context:i}),t.textureAtlas=this._textureAtlas),l(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new hi({context:i,initialSize:ef}),n.textureAtlas=this._backgroundTextureAtlas,jb(this._backgroundTextureAtlas));const o=this._labelsToUpdate.length;for(let r=0;r<o;++r){const f=this._labelsToUpdate[r];if(f.isDestroyed())continue;const c=f._glyphs.length;f._rebindAllGlyphs&&(Zb(this,f),f._rebindAllGlyphs=!1),f._repositionAllGlyphs&&(Qb(f),f._repositionAllGlyphs=!1);const h=f._glyphs.length-c;this._totalGlyphCount+=h}const a=n.length>0?_t.TRANSLUCENT:this.blendOption;t.blendOption=a,n.blendOption=a,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)},qn.prototype.isDestroyed=function(){return!1},qn.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),st(this)};const n0={id:void 0};function ir(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){const t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;const o=t.values.slice(0),a=n.values.slice(0),r=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,a,r)}while(e._refire);e._firing=!1}}}function en(e){this._owner=e,this._entities=new ni,this._addedEntities=new ni,this._removedEntities=new ni,this._changedEntities=new ni,this._suspendCount=0,this._collectionChanged=new Ne,this._id=Yn(),this._show=!0,this._firing=!1,this._refire=!1}en.prototype.suspendEvents=function(){this._suspendCount++},en.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new C("resumeEvents can not be called before suspendEvents.");this._suspendCount--,ir(this)},Object.defineProperties(en.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(!l(e))throw new C("value is required.");if(e===this._show)return;this.suspendEvents();let t;const n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){const a=n[t],r=i[t];a!==r.isShowing&&r.definitionChanged.raiseEvent(r,"isShowing",r.isShowing,a)}this.resumeEvents()}},owner:{get:function(){return this._owner}}}),en.prototype.computeAvailability=function(){let e=Vi.MAXIMUM_VALUE,t=Vi.MINIMUM_VALUE;const n=this._entities.values;for(let i=0,o=n.length;i<o;i++){const r=n[i].availability;if(l(r)){const f=r.start,c=r.stop;J.lessThan(f,e)&&!f.equals(Vi.MINIMUM_VALUE)&&(e=f),J.greaterThan(c,t)&&!c.equals(Vi.MAXIMUM_VALUE)&&(t=c)}}return Vi.MAXIMUM_VALUE.equals(e)&&(e=Vi.MINIMUM_VALUE),Vi.MINIMUM_VALUE.equals(t)&&(t=Vi.MAXIMUM_VALUE),new nt({start:e,stop:t})},en.prototype.add=function(e){if(!l(e))throw new C("entity is required.");e instanceof dn||(e=new dn(e));const t=e.id,n=this._entities;if(n.contains(t))throw new C(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(en.prototype._onEntityDefinitionChanged,this),ir(this),e},en.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1},en.prototype.contains=function(e){if(!l(e))throw new C("entity is required");return this._entities.get(e.id)===e},en.prototype.removeById=function(e){if(!l(e))return!1;const n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(en.prototype._onEntityDefinitionChanged,this),ir(this),!0):!1},en.prototype.removeAll=function(){const e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let a=0;a<t;a++){const r=n[a],f=r.id,c=i.get(f);l(c)||(r.definitionChanged.removeEventListener(en.prototype._onEntityDefinitionChanged,this),o.set(f,r))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),ir(this)},en.prototype.getById=function(e){if(!l(e))throw new C("id is required.");return this._entities.get(e)},en.prototype.getOrCreateEntity=function(e){if(!l(e))throw new C("id is required.");let t=this._entities.get(e);return l(t)||(n0.id=e,t=new dn(n0),this.add(t)),t},en.prototype._onEntityDefinitionChanged=function(e){const t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),ir(this)};function Da(){C.throwInstantiationError()}Object.defineProperties(Da.prototype,{name:{get:C.throwInstantiationError},clock:{get:C.throwInstantiationError},entities:{get:C.throwInstantiationError},isLoading:{get:C.throwInstantiationError},changedEvent:{get:C.throwInstantiationError},errorEvent:{get:C.throwInstantiationError},loadingEvent:{get:C.throwInstantiationError},show:{get:C.throwInstantiationError},clustering:{get:C.throwInstantiationError}}),Da.prototype.update=function(e){C.throwInstantiationError()},Da.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};function ui(e,t){_.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new u,this._cameraPositionInScaledSpace=new u,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(ui.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){const n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=u.magnitudeSquared(n)-1;u.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});const i0=new u;ui.prototype.isPointVisible=function(e){const n=this._ellipsoid.transformPositionToScaledSpace(e,i0);return nf(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},ui.prototype.isScaledSpacePointVisible=function(e){return nf(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};const Jb=new u;ui.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){const n=this._ellipsoid;let i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=Jb,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),nf(e,o,i)},ui.prototype.computeHorizonCullingPoint=function(e,t,n){return r0(this._ellipsoid,e,t,n)};const o0=pe.clone(pe.UNIT_SPHERE);ui.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){const o=s0(this._ellipsoid,n,o0);return r0(o,e,t,i)},ui.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return a0(this._ellipsoid,e,t,n,i,o)},ui.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,a){const r=s0(this._ellipsoid,o,o0);return a0(r,e,t,n,i,a)};const ex=[];ui.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){_.typeOf.object("rectangle",e);const i=de.subsample(e,t,0,ex),o=te.fromPoints(i);if(!(u.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};const tx=new u;function s0(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){const i=u.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,tx);e=pe.fromCartesian3(i,n)}return e}function r0(e,t,n,i){_.typeOf.object("directionToPoint",t),_.defined("positions",n),l(i)||(i=new u);const o=f0(e,t);let a=0;for(let r=0,f=n.length;r<f;++r){const c=n[r],h=c0(e,c,o);if(h<0)return;a=Math.max(a,h)}return h0(o,a,i)}const Oa=new u;function a0(e,t,n,i,o,a){_.typeOf.object("directionToPoint",t),_.defined("vertices",n),_.typeOf.number("stride",i),l(a)||(a=new u),i=g(i,3),o=g(o,u.ZERO);const r=f0(e,t);let f=0;for(let c=0,h=n.length;c<h;c+=i){Oa.x=n[c]+o.x,Oa.y=n[c+1]+o.y,Oa.z=n[c+2]+o.z;const d=c0(e,Oa,r);if(d<0)return;f=Math.max(f,d)}return h0(r,f,a)}function nf(e,t,n){const i=t,o=n,a=u.subtract(e,i,i0),r=-u.dot(a,i);return!(o<0?r>0:r>o&&r*r/u.magnitudeSquared(a)>o)}const nx=new u,ix=new u;function c0(e,t,n){const i=e.transformPositionToScaledSpace(t,nx);let o=u.magnitudeSquared(i),a=Math.sqrt(o);const r=u.divideByScalar(i,a,ix);o=Math.max(1,o),a=Math.max(1,a);const f=u.dot(r,n),c=u.magnitude(u.cross(r,n,r)),h=1/a,d=Math.sqrt(o-1)*h;return 1/(f*h-c*d)}function h0(e,t,n){if(!(t<=0||t===1/0||t!==t))return u.multiplyByScalar(e,t,n)}const of=new u;function f0(e,t){return u.equals(t,u.ZERO)?t:(e.transformPositionToScaledSpace(t,of),u.normalize(of,of))}function Re(e,t){if(e=g(e,g.EMPTY_OBJECT),l(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;if(l(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Ie.clone(n)}if(l(i)){if(i.far<=i.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");i=Ie.clone(i)}if(l(o)){if(o.far<=o.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=it.clone(o)}this._show=g(e.show,!0),this._position=u.clone(g(e.position,u.ZERO)),this._actualPosition=u.clone(this._position),this._color=I.clone(g(e.color,I.WHITE)),this._outlineColor=I.clone(g(e.outlineColor,I.TRANSPARENT)),this._outlineWidth=g(e.outlineWidth,0),this._pixelSize=g(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=g(e.disableDepthTestDistance,0),this._id=e.id,this._collection=g(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=g(e.splitDirection,Bu.NONE)}const l0=Re.SHOW_INDEX=0,u0=Re.POSITION_INDEX=1,ox=Re.COLOR_INDEX=2,sx=Re.OUTLINE_COLOR_INDEX=3,rx=Re.OUTLINE_WIDTH_INDEX=4,ax=Re.PIXEL_SIZE_INDEX=5,cx=Re.SCALE_BY_DISTANCE_INDEX=6,hx=Re.TRANSLUCENCY_BY_DISTANCE_INDEX=7,fx=Re.DISTANCE_DISPLAY_CONDITION_INDEX=8,lx=Re.DISABLE_DEPTH_DISTANCE_INDEX=9,ux=Re.SPLIT_DIRECTION_INDEX=10;Re.NUMBER_OF_PROPERTIES=11;function wn(e,t){const n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Re.prototype,{show:{get:function(){return this._show},set:function(e){if(!l(e))throw new C("value is required.");this._show!==e&&(this._show=e,wn(this,l0))}},position:{get:function(){return this._position},set:function(e){if(!l(e))throw new C("value is required.");const t=this._position;u.equals(t,e)||(u.clone(e,t),u.clone(e,this._actualPosition),wn(this,u0))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._scaleByDistance;Ie.equals(t,e)||(this._scaleByDistance=Ie.clone(e,t),wn(this,cx))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._translucencyByDistance;Ie.equals(t,e)||(this._translucencyByDistance=Ie.clone(e,t),wn(this,hx))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){if(!l(e))throw new C("value is required.");this._pixelSize!==e&&(this._pixelSize=e,wn(this,ax))}},color:{get:function(){return this._color},set:function(e){if(!l(e))throw new C("value is required.");const t=this._color;I.equals(t,e)||(I.clone(e,t),wn(this,ox))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!l(e))throw new C("value is required.");const t=this._outlineColor;I.equals(t,e)||(I.clone(e,t),wn(this,sx))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!l(e))throw new C("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,wn(this,rx))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(l(e)&&e.far<=e.near)throw new C("far must be greater than near");it.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=it.clone(e,this._distanceDisplayCondition),wn(this,fx))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(!l(e)||e<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,wn(this,lx)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,wn(this,l0))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,wn(this,ux))}}}),Re.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},Re.prototype._getActualPosition=function(){return this._actualPosition},Re.prototype._setActualPosition=function(e){u.clone(e,this._actualPosition),wn(this,u0)};const d0=new Z;Re._computeActualPosition=function(e,t,n){return t.mode===ye.SCENE3D?e:(k.multiplyByPoint(n,e,d0),vt.computeActualEllipsoidPosition(t,d0))};const p0=new Z;Re._computeScreenSpacePosition=function(e,t,n,i){const o=k.multiplyByVector(e,Z.fromElements(t.x,t.y,t.z,1,p0),p0);return vt.worldToWindowCoordinates(n,o,i)},Re.prototype.computeScreenSpacePosition=function(e,t){const n=this._pointPrimitiveCollection;if(l(t)||(t=new q),!l(n))throw new C("PointPrimitive must be in a collection.");if(!l(e))throw new C("scene is required.");const i=n.modelMatrix,o=Re._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o},Re.getScreenSpaceBoundingBox=function(e,t,n){const i=e.pixelSize,o=i*.5,a=t.x-o,r=t.y-o,f=i,c=i;return l(n)||(n=new be),n.x=a,n.y=r,n.width=f,n.height=c,n},Re.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&u.equals(this._position,e._position)&&I.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&I.equals(this._outlineColor,e._outlineColor)&&Ie.equals(this._scaleByDistance,e._scaleByDistance)&&Ie.equals(this._translucencyByDistance,e._translucencyByDistance)&&it.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection},Re.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};const va=`in vec4 v_color;
6353
6353
  in vec4 v_outlineColor;
6354
6354
  in float v_innerPercent;
6355
6355
  in float v_pixelDistance;
@@ -6581,7 +6581,7 @@ void main()
6581
6581
  v_pickColor = pickColor;
6582
6582
  v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;
6583
6583
  }
6584
- `,px=Re.SHOW_INDEX,sf=Re.POSITION_INDEX,m0=Re.COLOR_INDEX,mx=Re.OUTLINE_COLOR_INDEX,_x=Re.OUTLINE_WIDTH_INDEX,gx=Re.PIXEL_SIZE_INDEX,_0=Re.SCALE_BY_DISTANCE_INDEX,g0=Re.TRANSLUCENCY_BY_DISTANCE_INDEX,T0=Re.DISTANCE_DISPLAY_CONDITION_INDEX,Tx=Re.DISABLE_DEPTH_DISTANCE_INDEX,yx=Re.SPLIT_DIRECTION_INDEX,rf=Re.NUMBER_OF_PROPERTIES,tn={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function An(e){e=g(e,g.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(rf),this._maxPixelSize=1,this._baseVolume=new te,this._baseVolumeWC=new te,this._baseVolume2D=new te,this._boundingVolume=new te,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=g(e.show,!0),this.modelMatrix=k.clone(g(e.modelMatrix,k.IDENTITY)),this._modelMatrix=k.clone(k.IDENTITY),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.blendOption=g(e.blendOption,_t.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ye.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW];const t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(An.prototype,{length:{get:function(){return af(this),this._pointPrimitives.length}}});function y0(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}An.prototype.add=function(e){const t=new Re(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},An.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},An.prototype.removeAll=function(){y0(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function af(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;const t=[],n=e._pointPrimitives,i=n.length;for(let o=0,a=0;o<i;++o){const r=n[o];r&&(r._index=a++,t.push(r))}e._pointPrimitives=t}}An.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},An.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this},An.prototype.get=function(e){if(!l(e))throw new C("index is required.");return af(this),this._pointPrimitives[e]},An.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<rf;++i){const o=n[i]===0?We.STATIC_DRAW:We.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function Cx(e,t,n){return new Dt(e,[{index:tn.positionHighAndSize,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[sf]},{index:tn.positionLowAndShow,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[sf]},{index:tn.compressedAttribute0,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[m0]},{index:tn.compressedAttribute1,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[g0]},{index:tn.scaleByDistance,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[_0]},{index:tn.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[T0]}],t)}const cf=new Qe;function C0(e,t,n,i){const o=i._index,a=i._getActualPosition();e._mode===ye.SCENE3D&&(te.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),Qe.fromCartesian(a,cf);const r=i.pixelSize,f=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,r+f);const c=n[tn.positionHighAndSize],h=cf.high;c(o,h.x,h.y,h.z,r);const d=n[tn.positionLowAndOutline],p=cf.low;d(o,p.x,p.y,p.z,f)}const Wa=65536,or=256;function w0(e,t,n,i){const o=i._index,a=i.color,r=i.getPickId(t).color,f=i.outlineColor;let c=D.floatToByte(a.red),h=D.floatToByte(a.green),d=D.floatToByte(a.blue);const p=c*Wa+h*or+d;c=D.floatToByte(f.red),h=D.floatToByte(f.green),d=D.floatToByte(f.blue);const m=c*Wa+h*or+d;c=D.floatToByte(r.red),h=D.floatToByte(r.green),d=D.floatToByte(r.blue);const T=c*Wa+h*or+d,y=D.floatToByte(a.alpha)*Wa+D.floatToByte(f.alpha)*or+D.floatToByte(r.alpha),w=n[tn.compressedAttribute0];w(o,p,m,T,y)}function A0(e,t,n,i){const o=i._index;let a=0,r=1,f=1,c=1;const h=i.translucencyByDistance;l(h)&&(a=h.near,r=h.nearValue,f=h.far,c=h.farValue,(r!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let d=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(d=!1),r=S.clamp(r,0,1),r=r===1?255:r*255|0;const p=(d?1:0)*or+r;c=S.clamp(c,0,1),c=c===1?255:c*255|0;const m=c,T=n[tn.compressedAttribute1];T(o,p,m,a,f)}function E0(e,t,n,i){const o=i._index,a=n[tn.scaleByDistance];let r=0,f=1,c=1,h=1;const d=i.scaleByDistance;l(d)&&(r=d.near,f=d.nearValue,c=d.far,h=d.farValue,(f!==1||h!==1)&&(e._shaderScaleByDistance=!0)),a(o,r,f,c,h)}function b0(e,t,n,i){const o=i._index,a=n[tn.distanceDisplayConditionAndDisableDepthAndSplitDirection];let r=0,f=Number.MAX_VALUE;const c=i.distanceDisplayCondition;l(c)&&(r=c.near,f=c.far,r*=r,f*=f,e._shaderDistanceDisplayCondition=!0);let h=i.disableDepthTestDistance;h*=h,h>0&&(e._shaderDisableDepthDistance=!0,h===Number.POSITIVE_INFINITY&&(h=-1));let d=0;const p=i.splitDirection;l(p)&&(d=p),a(o,r,f,h,d)}function wx(e,t,n,i){C0(e,t,n,i),w0(e,t,n,i),A0(e,t,n,i),E0(e,t,n,i),b0(e,t,n,i)}function hf(e,t,n,i,o,a){let r;i.mode===ye.SCENE3D?(r=e._baseVolume,e._boundingVolumeDirty=!0):r=e._baseVolume2D;const f=[];for(let c=0;c<n;++c){const h=t[c],d=h.position,p=Re._computeActualPosition(d,i,o);l(p)&&(h._setActualPosition(p),a?f.push(p):te.expand(r,p,r))}a&&te.fromPoints(f,r)}function Ax(e,t){const n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,a=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ye.SCENE3D&&!k.equals(a,e.modelMatrix)?(e._mode=n,k.clone(e.modelMatrix,a),e._createVertexArray=!0,(n===ye.SCENE3D||n===ye.SCENE2D||n===ye.COLUMBUS_VIEW)&&hf(e,i,i.length,t,a,!0)):n===ye.MORPHING?hf(e,i,i.length,t,a,!0):(n===ye.SCENE2D||n===ye.COLUMBUS_VIEW)&&hf(e,o,e._pointPrimitivesToUpdateIndex,t,a,!1)}function Ex(e,t,n){const o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}const bx=[];An.prototype.update=function(e){if(af(this),!this.show)return;this._maxTotalPointSize=xe.maximumAliasedPointSize,Ax(this,e);const n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,a=this._propertiesChanged,r=this._createVertexArray;let f;const c=e.context,h=e.passes,d=h.pick;if(r||!d&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let B=0;B<rf;++B)a[B]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=Cx(c,n,this._buffersUsage),f=this._vaf.writers;for(let B=0;B<n;++B){const L=this._pointPrimitives[B];L._dirty=!1,wx(this,c,f,L)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){const B=bx;B.length=0,(a[sf]||a[_x]||a[gx])&&B.push(C0),(a[m0]||a[mx])&&B.push(w0),(a[px]||a[g0])&&B.push(A0),a[_0]&&B.push(E0),(a[T0]||a[Tx]||a[yx])&&B.push(b0);const L=B.length;if(f=this._vaf.writers,o/n>.1){for(let F=0;F<o;++F){const N=i[F];N._dirty=!1;for(let U=0;U<L;++U)B[U](this,c,f,N)}this._vaf.commit()}else{for(let F=0;F<o;++F){const N=i[F];N._dirty=!1;for(let U=0;U<L;++U)B[U](this,c,f,N);this._vaf.subCommit(N._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,te.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let p,m=k.IDENTITY;e.mode===ye.SCENE3D?(m=this.modelMatrix,p=te.clone(this._baseVolumeWC,this._boundingVolume)):p=te.clone(this._baseVolume2D,this._boundingVolume),Ex(this,e,p);const T=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,T&&(this._blendOption===_t.OPAQUE||this._blendOption===_t.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=je.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===_t.TRANSLUCENT||this._blendOption===_t.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=je.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!1,blending:ro.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let y,w;(T||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(y=new Ae({sources:[dx]}),this._shaderScaleByDistance&&y.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&y.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&y.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&y.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===_t.OPAQUE_AND_TRANSLUCENT&&(w=new Ae({defines:["OPAQUE"],sources:[va]}),this._sp=lt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:y,fragmentShaderSource:w,attributeLocations:tn}),w=new Ae({defines:["TRANSLUCENT"],sources:[va]}),this._spTranslucent=lt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:y,fragmentShaderSource:w,attributeLocations:tn})),this._blendOption===_t.OPAQUE&&(w=new Ae({sources:[va]}),this._sp=lt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:y,fragmentShaderSource:w,attributeLocations:tn})),this._blendOption===_t.TRANSLUCENT&&(w=new Ae({sources:[va]}),this._spTranslucent=lt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:y,fragmentShaderSource:w,attributeLocations:tn})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let A,E,b,I;const O=e.commandList;if(h.render||d){const B=this._colorCommands,L=this._blendOption===_t.OPAQUE,F=this._blendOption===_t.OPAQUE_AND_TRANSLUCENT;A=this._vaf.va,E=A.length,B.length=E;const N=F?E*2:E;for(I=0;I<N;++I){const U=L||F&&I%2===0;b=B[I],l(b)||(b=B[I]=new et),b.primitiveType=Xe.POINTS,b.pass=U||!F?Nt.OPAQUE:Nt.TRANSLUCENT,b.owner=this;const M=F?Math.floor(I/2):I;b.boundingVolume=p,b.modelMatrix=m,b.shaderProgram=U?this._sp:this._spTranslucent,b.uniformMap=this._uniforms,b.vertexArray=A[M].va,b.renderState=U?this._rsOpaque:this._rsTranslucent,b.debugShowBoundingVolume=this.debugShowBoundingVolume,b.pickId="v_pickColor",O.push(b)}}},An.prototype.isDestroyed=function(){return!1},An.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),y0(this._pointPrimitives),st(this)};const x0=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ff=1,sr=8;class lf{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=i>>4;if(o!==ff)throw new Error(`Got v${o} data when expected v${ff}.`);const a=x0[i&15];if(!a)throw new Error("Unrecognized array type.");const[r]=new Uint16Array(t,2,1),[f]=new Uint32Array(t,4,1);return new lf(f,r,a,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const a=x0.indexOf(this.ArrayType),r=t*2*this.ArrayType.BYTES_PER_ELEMENT,f=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-f%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,sr,t),this.coords=new this.ArrayType(this.data,sr+f+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(sr+r+f+c),this.ids=new this.IndexArrayType(this.data,sr,t),this.coords=new this.ArrayType(this.data,sr+f+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(ff<<4)+a]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return uf(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:r,nodeSize:f}=this,c=[0,a.length-1,0],h=[];for(;c.length;){const d=c.pop()||0,p=c.pop()||0,m=c.pop()||0;if(p-m<=f){for(let A=m;A<=p;A++){const E=r[2*A],b=r[2*A+1];E>=t&&E<=i&&b>=n&&b<=o&&h.push(a[A])}continue}const T=m+p>>1,y=r[2*T],w=r[2*T+1];y>=t&&y<=i&&w>=n&&w<=o&&h.push(a[T]),(d===0?t<=y:n<=w)&&(c.push(m),c.push(T-1),c.push(1-d)),(d===0?i>=y:o>=w)&&(c.push(T+1),c.push(p),c.push(1-d))}return h}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:a,nodeSize:r}=this,f=[0,o.length-1,0],c=[],h=i*i;for(;f.length;){const d=f.pop()||0,p=f.pop()||0,m=f.pop()||0;if(p-m<=r){for(let A=m;A<=p;A++)I0(a[2*A],a[2*A+1],t,n)<=h&&c.push(o[A]);continue}const T=m+p>>1,y=a[2*T],w=a[2*T+1];I0(y,w,t,n)<=h&&c.push(o[T]),(d===0?t-i<=y:n-i<=w)&&(f.push(m),f.push(T-1),f.push(1-d)),(d===0?t+i>=y:n+i>=w)&&(f.push(T+1),f.push(p),f.push(1-d))}return c}}function uf(e,t,n,i,o,a){if(o-i<=n)return;const r=i+o>>1;S0(e,t,r,i,o,a),uf(e,t,n,i,r-1,1-a),uf(e,t,n,r+1,o,1-a)}function S0(e,t,n,i,o,a){for(;o>i;){if(o-i>600){const h=o-i+1,d=n-i+1,p=Math.log(h),m=.5*Math.exp(2*p/3),T=.5*Math.sqrt(p*m*(h-m)/h)*(d-h/2<0?-1:1),y=Math.max(i,Math.floor(n-d*m/h+T)),w=Math.min(o,Math.floor(n+(h-d)*m/h+T));S0(e,t,n,y,w,a)}const r=t[2*n+a];let f=i,c=o;for(rr(e,t,i,n),t[2*o+a]>r&&rr(e,t,i,o);f<c;){for(rr(e,t,f,c),f++,c--;t[2*f+a]<r;)f++;for(;t[2*c+a]>r;)c--}t[2*i+a]===r?rr(e,t,i,c):(c++,rr(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function rr(e,t,n,i){df(e,n,i),df(t,2*n,2*i),df(t,2*n+1,2*i+1)}function df(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function I0(e,t,n,i){const o=e-n,a=t-i;return o*o+a*a}function jn(e){e=g(e,g.EMPTY_OBJECT),this._enabled=g(e.enabled,!1),this._pixelRange=g(e.pixelRange,80),this._minimumClusterSize=g(e.minimumClusterSize,2),this._clusterBillboards=g(e.clusterBillboards,!0),this._clusterLabels=g(e.clusterLabels,!0),this._clusterPoints=g(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new Ne,this.show=g(e.show,!0)}function D0(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}const xx=new be;function O0(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=qn.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=me.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Re.getScreenSpaceBoundingBox(e,t,o)),D0(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&W0(i,e.id.id)&&l(e.id._label)){const a=i._collectionIndicesByEntity[e.id.id].labelIndex,r=i._labelCollection.get(a),f=qn.getScreenSpaceBoundingBox(r,t,xx);D0(f,n),o=be.union(o,f,o)}return o}function Sx(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&W0(t,e.id.id)&&l(e.id._label)){const n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function v0(e,t,n,i){const o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function W0(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function pf(e,t,n,i,o){if(!l(e))return;const a=e.length;for(let r=0;r<a;++r){const f=e.get(r);if(f.clusterShow=!1,!f.show||o._scene.mode===ye.SCENE3D&&!i.isPointVisible(f.position))continue;const c=o._clusterLabels&&l(f._labelCollection),h=o._clusterBillboards&&l(f.id._billboard),d=o._clusterPoints&&l(f.id._point);if(c&&(d||h))continue;const p=f.computeScreenSpacePosition(n);l(p)&&t.push({index:r,collection:e,clustered:!1,coord:p})}}const Ix=new be,Dx=new be,Ox=new be;function vx(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;const n=e._scene,i=e._labelCollection,o=e._billboardCollection,a=e._pointCollection;if(!l(i)&&!l(o)&&!l(a)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let r=e._clusterLabelCollection,f=e._clusterBillboardCollection,c=e._clusterPointCollection;l(r)?r.removeAll():r=e._clusterLabelCollection=new Hn({scene:n}),l(f)?f.removeAll():f=e._clusterBillboardCollection=new rn({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new An;const h=e._pixelRange,d=e._minimumClusterSize,p=e._previousClusters,m=[],T=e._previousHeight,y=n.camera.positionCartographic.height,w=n.ellipsoid,A=n.camera.positionWC,E=new ui(w,A),b=[];e._clusterLabels&&pf(i,b,n,E,e),e._clusterBillboards&&pf(o,b,n,E,e),e._clusterPoints&&pf(a,b,n,E,e);let I,O,B,L,F,N,U,M,j,Y,s,x;if(b.length>0){const P=new lf(b.length,64,Uint32Array);for(let z=0;z<b.length;++z)P.add(b[z].coord.x,b[z].coord.y);if(P.finish(),y<T)for(B=p.length,I=0;I<B;++I){const z=p[I];if(!E.isPointVisible(z.position))continue;const H=me._computeScreenSpacePosition(k.IDENTITY,z.position,u.ZERO,q.ZERO,n);if(!l(H))continue;const X=1-y/T;let ee=z.width=z.width*X,K=z.height=z.height*X;ee=Math.max(ee,z.minimumWidth),K=Math.max(K,z.minimumHeight);const ce=H.x-ee*.5,le=H.y-K*.5,we=H.x+ee,Se=H.y+K;for(F=P.range(ce,le,we,Se),N=F.length,Y=0,j=[],O=0;O<N;++O)U=F[O],M=b[U],M.clustered||(++Y,s=M.collection,x=M.index,j.push(s.get(x).id));if(Y>=d)for(v0(z.position,Y,j,e),m.push(z),O=0;O<N;++O)b[F[O]].clustered=!0}for(B=b.length,I=0;I<B;++I){const z=b[I];if(z.clustered)continue;z.clustered=!0,s=z.collection,x=z.index;const H=s.get(x);L=O0(H,z.coord,h,e,Ix);const X=be.clone(L,Dx);F=P.range(L.x,L.y,L.x+L.width,L.y+L.height),N=F.length;const ee=u.clone(H.position);for(Y=1,j=[H.id],O=0;O<N;++O)if(U=F[O],M=b[U],!M.clustered){const K=M.collection.get(M.index),ce=O0(K,M.coord,h,e,Ox);u.add(K.position,ee,ee),be.union(X,ce,X),++Y,j.push(K.id)}if(Y>=d){const K=u.multiplyByScalar(ee,1/Y,ee);for(v0(K,Y,j,e),m.push({position:K,width:X.width,height:X.height,minimumWidth:L.width,minimumHeight:L.height}),O=0;O<N;++O)b[F[O]].clustered=!0}else Sx(H,e)}}r.length===0&&(r.destroy(),e._clusterLabelCollection=void 0),f.length===0&&(f.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=m,e._previousHeight=y}}jn.prototype._initialize=function(e){this._scene=e;const t=vx(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},Object.defineProperties(jn.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function mf(e,t,n,i){return function(o){let a=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let r=this._collectionIndicesByEntity[o.id];if(l(r)||(r=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(a)&&l(r[i]))return a.get(r[i]);l(a)||(a=this[e]=new t({scene:this._scene}));let f,c;const h=this[n];h.length>0?(f=h.shift(),c=a.get(f)):(c=a.add(),f=a.length-1),r[i]=f;const d=this;return Promise.resolve().then(function(){d._clusterDirty=!0}),c}}function _f(e,t){const n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}jn.prototype.getLabel=mf("_labelCollection",Hn,"_unusedLabelIndices","labelIndex"),jn.prototype.removeLabel=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;const n=t.labelIndex;t.labelIndex=void 0,_f(this,e.id);const i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0},jn.prototype.getBillboard=mf("_billboardCollection",rn,"_unusedBillboardIndices","billboardIndex"),jn.prototype.removeBillboard=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;const n=t.billboardIndex;t.billboardIndex=void 0,_f(this,e.id);const i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0},jn.prototype.getPoint=mf("_pointCollection",An,"_unusedPointIndices","pointIndex"),jn.prototype.removePoint=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;const n=t.pointIndex;t.pointIndex=void 0,_f(this,e.id);const i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function gf(e){if(!l(e))return;const t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function Wx(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,gf(e._labelCollection),gf(e._billboardCollection),gf(e._pointCollection))}jn.prototype.update=function(e){if(!this.show)return;let t;l(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,Wx(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)},jn.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};function go(e){this._name=e,this._clock=void 0,this._changed=new Ne,this._error=new Ne,this._isLoading=!1,this._loading=new Ne,this._entityCollection=new en(this),this._entityCluster=new jn}Object.defineProperties(go.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Da.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!l(e))throw new C("value must be defined.");this._entityCluster=e}}}),go.prototype.update=function(e){return!0};function v(e,t,n=10,i="#ba1919"){return{name:t,label:{text:t,font:"18px sans-serif"},polyline:{show:!0,positions:e,clampToGround:!1,width:n,material:D.fromCssColorString(i),arcType:ai.NONE,shadows:pa.DISABLED}}}function To(e,t,n,i,o=new He(0,0,0),a=1){return{id:e,name:n,position:t,orientation:Ce.headingPitchRollQuaternion(t,o),model:{show:!0,uri:i,scale:a,heightReference:Ln.NONE}}}function Pa(e,t){return{name:t,position:e,label:{text:t,font:"18px sans-serif",fillColor:D.GOLD,pixelOffset:new q(0,-20),style:li.FILL_AND_OUTLINE,outlineWidth:2,outlineColor:D.BLACK,heightReference:Ln.NONE,distanceDisplayCondition:new it(0,1e4)},point:{color:D.RED,pixelSize:12,heightReference:Ln.NONE,distanceDisplayCondition:new it(0,1e4)}}}function Q(e,t,n,i,o){n||(n=new He);const a=Ce.headingPitchRollQuaternion(e,n,i,o),r=k.fromRotationTranslation(G.fromQuaternion(a,new G),e,new k);return k.multiplyByPoint(r,t,new u)}function W(e,t=4){const n=[];for(var i=0;i<e.length-1;i++)n.push(...Px(e[i],e[i+1],t*-1e3,100));return n}function Px(e,t,n,i){var o=[],a=oe.fromCartesian(e),r=oe.fromCartesian(t),f=a.longitude*180/Math.PI,c=a.latitude*180/Math.PI,h=r.longitude*180/Math.PI,d=r.latitude*180/Math.PI,p=Math.sqrt((f-h)*(f-h)+(c-d)*(c-d)),m=p*n,T=u.clone(e),y=u.clone(t),w=u.distance(T,u.ZERO),A=u.distance(y,u.ZERO);if(u.normalize(T,T),u.normalize(y,y),u.distance(T,y)==0)return o;var E=u.angleBetween(T,y);o.push(e);for(var b=1;b<i-1;b++){var I=b*1/(i-1),O=1-I,B=Math.sin(O*E)/Math.sin(E),L=Math.sin(I*E)/Math.sin(E),F=u.multiplyByScalar(T,B,new u),N=u.multiplyByScalar(y,L,new u),U=u.add(F,N,new u),M=I*Math.PI,j=w*O+A*I+Math.sin(M)*m;U=u.multiplyByScalar(U,j,U),o.push(U)}return o.push(t),o}class Bx{constructor(){se(this,"LineID","myEntity1");se(this,"Tag","");se(this,"towers",[]);se(this,"ISPhaseSequence",!1);se(this,"Wairnum",0);se(this,"Type",0);se(this,"wireAColor","#FFFFFF");se(this,"wireBColor","#FFFFFF");se(this,"wireCColor","#FFFFFF");se(this,"wireTColor","#FFFFFF");se(this,"wireD1Color","#FFFFFF");se(this,"wireD2Color","#FFFFFF");se(this,"wireWidth",1)}}class Rx{constructor(){se(this,"id","");se(this,"name","");se(this,"type",0);se(this,"Longitude",0);se(this,"Latitude",0);se(this,"Altitude",0);se(this,"RollX",0);se(this,"RollY",90);se(this,"RollZ",0);se(this,"towerScale",1);se(this,"towerHeight",42);se(this,"towerModelUri","");se(this,"towerPoint",[]);se(this,"Insulators",[])}}class zx{constructor(){se(this,"id","");se(this,"name","");se(this,"type",0);se(this,"WairFX","进");se(this,"linenum",1);se(this,"Wairnum",0);se(this,"PhaseSequence",0);se(this,"RollX",90);se(this,"RollY",0);se(this,"RollZ",0);se(this,"InsulatorScale",1);se(this,"InsulatorLength",0);se(this,"InsulatorModelUri","");se(this,"InsulatorPoint",[])}}class Lx{constructor(){se(this,"name","");se(this,"X",-45);se(this,"Y",90);se(this,"Z",0)}}var nn=(e=>(e[e.A相=0]="A相",e[e.B相=1]="B相",e[e.C相=2]="C相",e[e.地线1=3]="地线1",e[e.地线2=4]="地线2",e))(nn||{}),$i=(e=>(e[e.直线塔=0]="直线塔",e[e.耐张塔=1]="耐张塔",e[e.门架塔=2]="门架塔",e[e.换位塔=3]="换位塔",e))($i||{}),P0=(e=>(e[e.交流单回路=0]="交流单回路",e[e.交流双回路=1]="交流双回路",e[e.直流单回路=2]="直流单回路",e[e.直流双回路=3]="直流双回路",e[e.交流四回路=4]="交流四回路",e))(P0||{}),ar=(e=>(e[e.地线=0]="地线",e[e.回路一=1]="回路一",e[e.回路二=2]="回路二",e[e.回路三=3]="回路三",e[e.回路四=4]="回路四",e))(ar||{}),Ht=(e=>(e[e.悬垂串=0]="悬垂串",e[e.耐张串=1]="耐张串",e[e.跳线串=2]="跳线串",e[e.硬跳串=3]="硬跳串",e[e.V串=4]="V串",e[e.地线串=5]="地线串",e[e.绕跳临时=6]="绕跳临时",e))(Ht||{}),$=(e=>(e[e.单分裂=0]="单分裂",e[e.双分裂=1]="双分裂",e[e.四分裂=2]="四分裂",e[e.六分裂=3]="六分裂",e[e.八分裂=4]="八分裂",e))($||{});class Nx{constructor(t,n,i){se(this,"viewer");se(this,"LineInfo");se(this,"Keym","");se(this,"dataSource2");se(this,"entityCollection2");se(this,"LinedataSource2");se(this,"LineentityCollection2");se(this,"offsetTowers",[]);se(this,"offsetWires11",[]);se(this,"offsetWires12",[]);se(this,"offsetWires13",[]);se(this,"offsetWires21",[]);se(this,"offsetWires22",[]);se(this,"offsetWires23",[]);se(this,"ToffsetArcWires1A",[]);se(this,"ToffsetArcWires2A",[]);se(this,"ToffsetWires1A1",[]);se(this,"ToffsetWires1A2",[]);se(this,"ToffsetArcWires1B",[]);se(this,"ToffsetArcWires2B",[]);se(this,"ToffsetWires1B1",[]);se(this,"ToffsetWires1B2",[]);se(this,"ToffsetArcWires1C",[]);se(this,"ToffsetArcWires2C",[]);se(this,"ToffsetWires1C1",[]);se(this,"ToffsetWires1C2",[]);se(this,"ToffsetArcWires1A2",[]);se(this,"ToffsetArcWires2A2",[]);se(this,"ToffsetWires2A1",[]);se(this,"ToffsetWires2A2",[]);se(this,"ToffsetArcWires1B2",[]);se(this,"ToffsetArcWires2B2",[]);se(this,"ToffsetWires2B1",[]);se(this,"ToffsetWires2B2",[]);se(this,"ToffsetArcWires1C2",[]);se(this,"ToffsetArcWires2C2",[]);se(this,"ToffsetWires2C1",[]);se(this,"ToffsetWires2C2",[]);se(this,"offsetArcWires1A",[]);se(this,"offsetArcWires1B",[]);se(this,"offsetArcWires1C",[]);se(this,"offsetArcWires2A",[]);se(this,"offsetArcWires2B",[]);se(this,"offsetArcWires2C",[]);se(this,"offsetGrouundWires1",[]);se(this,"offsetGrouundWires2",[]);se(this,"offsetGrouundWires11",[]);se(this,"offsetGrouundWires12",[]);this.Keym=i,this.viewer=t,this.LineInfo=n,this.dataSource2=new go(this.LineInfo.LineID),this.entityCollection2=this.dataSource2.entities,this.LinedataSource2=new go(this.LineInfo.LineID+"daoxian"),this.LineentityCollection2=this.dataSource2.entities}loadLineTower(){if(this.Keym!="OW_JPS_EEngin_001")return;debugger;this.LineInfo.towers.forEach(i=>{this.offsetTowers.push(u.fromDegrees(i.Longitude,i.Latitude,i.Altitude))});let t=0,n=0;this.offsetTowers.forEach((i,o)=>{const a=new He(S.toRadians(this.LineInfo.towers[o].RollX),S.toRadians(this.LineInfo.towers[o].RollY),S.toRadians(this.LineInfo.towers[o].RollZ));this.entityCollection2.add(To(this.LineInfo.towers[o].id,i,this.LineInfo.towers[o].name,this.LineInfo.towers[o].towerModelUri,a,this.LineInfo.towers[o].towerScale));let r=new He(S.toRadians(this.LineInfo.towers[o].RollX),0,0),f=0;this.LineInfo.towers[o].Insulators.forEach(c=>{if(this.LineInfo.towers[o].type==$i.耐张塔)switch(c.type){case Ht.耐张串:let d=new He(S.toRadians(this.LineInfo.towers[o].RollX),0,0);if(c.WairFX=="进"){const w=new He(S.toRadians(c.RollX),S.toRadians(-90),S.toRadians(180)),A=Q(i,new u(this.LineInfo.towers[o].towerPoint[f].X,this.LineInfo.towers[o].towerPoint[f].Y,this.LineInfo.towers[o].towerPoint[f].Z),d);this.entityCollection2.add(To(c.id,A,c.name,c.InsulatorModelUri,w,c.InsulatorScale))}else{const w=new He(S.toRadians(c.RollX),S.toRadians(-90),S.toRadians(0)),A=Q(i,new u(this.LineInfo.towers[o].towerPoint[f].X,this.LineInfo.towers[o].towerPoint[f].Y,this.LineInfo.towers[o].towerPoint[f].Z),d);this.entityCollection2.add(To(c.id,A,c.name,c.InsulatorModelUri,w,c.InsulatorScale))}break;case Ht.跳线串:const p=new He(S.toRadians(c.RollX),S.toRadians(c.RollY),S.toRadians(c.RollZ)),m=Q(i,new u(this.LineInfo.towers[o].towerPoint[f].X,this.LineInfo.towers[o].towerPoint[f].Y,this.LineInfo.towers[o].towerPoint[f].Z),r);this.entityCollection2.add(To(c.id,m,c.name,c.InsulatorModelUri,p,c.InsulatorScale));break;case Ht.地线串:const T=new He(S.toRadians(c.RollX),S.toRadians(c.RollY),S.toRadians(c.RollZ)),y=Q(i,new u(this.LineInfo.towers[o].towerPoint[f].X,this.LineInfo.towers[o].towerPoint[f].Y,this.LineInfo.towers[o].towerPoint[f].Z),r);this.entityCollection2.add(To(c.id,y,c.name,c.InsulatorModelUri,T,c.InsulatorScale));break}else{const d=new He(S.toRadians(c.RollX),S.toRadians(c.RollY),S.toRadians(c.RollZ)),p=Q(i,new u(this.LineInfo.towers[o].towerPoint[f].X,this.LineInfo.towers[o].towerPoint[f].Y,this.LineInfo.towers[o].towerPoint[f].Z),r);this.entityCollection2.add(To(c.id,p,c.name,c.InsulatorModelUri,d,c.InsulatorScale))}const h=[];switch(c.InsulatorPoint.forEach(d=>{h.push(Q(i,new u(d.X,d.Y,d.Z),r))}),c.linenum){case ar.回路一:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[o].type==$i.耐张塔)switch(c.PhaseSequence){case nn.A相:if(c.type==Ht.耐张串)if(c.WairFX=="进")switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires11.push(h[0]),this.ToffsetWires1A1.push(h[0]);break;case $.双分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]);break;case $.四分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]);break;case $.六分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.offsetWires11.push(h[4]),this.offsetWires11.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]),this.ToffsetWires1A1.push(h[8]),this.ToffsetWires1A1.push(h[9]),this.ToffsetWires1A1.push(h[10]),this.ToffsetWires1A1.push(h[11]);break;case $.八分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.offsetWires11.push(h[4]),this.offsetWires11.push(h[5]),this.offsetWires11.push(h[6]),this.offsetWires11.push(h[7]),this.ToffsetWires1A1.push(h[8]),this.ToffsetWires1A1.push(h[9]),this.ToffsetWires1A1.push(h[10]),this.ToffsetWires1A1.push(h[11]),this.ToffsetWires1A1.push(h[12]),this.ToffsetWires1A1.push(h[13]),this.ToffsetWires1A1.push(h[14]),this.ToffsetWires1A1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires11.push(d),this.ToffsetWires1A2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires11.push(p),this.offsetWires11.push(m),this.ToffsetWires1A2.push(p),this.ToffsetWires1A2.push(m);break;case $.四分裂:const T=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),y=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),w=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),A=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r);this.offsetWires11.push(T),this.offsetWires11.push(y),this.offsetWires11.push(w),this.offsetWires11.push(A),this.ToffsetWires1A2.push(T),this.ToffsetWires1A2.push(y),this.ToffsetWires1A2.push(w),this.ToffsetWires1A2.push(A);break;case $.六分裂:const E=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),b=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),I=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),O=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),B=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),L=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r);this.offsetWires11.push(E),this.offsetWires11.push(b),this.offsetWires11.push(I),this.offsetWires11.push(O),this.offsetWires11.push(B),this.offsetWires11.push(L),this.ToffsetWires1A2.push(E),this.ToffsetWires1A2.push(b),this.ToffsetWires1A2.push(I),this.ToffsetWires1A2.push(O),this.ToffsetWires1A2.push(B),this.ToffsetWires1A2.push(L);break;case $.八分裂:const F=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),N=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),U=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),M=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),j=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),Y=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r),s=Q(i,new u(c.InsulatorPoint[6].X*-1,c.InsulatorPoint[6].Y,c.InsulatorPoint[6].Z),r),x=Q(i,new u(c.InsulatorPoint[7].X*-1,c.InsulatorPoint[7].Y,c.InsulatorPoint[7].Z),r);this.offsetWires11.push(F),this.offsetWires11.push(N),this.offsetWires11.push(U),this.offsetWires11.push(M),this.offsetWires11.push(j),this.offsetWires11.push(Y),this.offsetWires11.push(s),this.offsetWires11.push(x),this.ToffsetWires1A2.push(F),this.ToffsetWires1A2.push(N),this.ToffsetWires1A2.push(U),this.ToffsetWires1A2.push(M),this.ToffsetWires1A2.push(j),this.ToffsetWires1A2.push(Y),this.ToffsetWires1A2.push(s),this.ToffsetWires1A2.push(x);break}else if(c.type==Ht.跳线串)switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A2.push(h[0]);break;case $.双分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A2.push(h[2]),this.ToffsetWires1A2.push(h[3]);break;case $.四分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A2.push(h[4]),this.ToffsetWires1A2.push(h[5]),this.ToffsetWires1A2.push(h[6]),this.ToffsetWires1A2.push(h[7]);break;case $.六分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A2.push(h[6]),this.ToffsetWires1A2.push(h[7]),this.ToffsetWires1A2.push(h[8]),this.ToffsetWires1A2.push(h[9]),this.ToffsetWires1A2.push(h[10]),this.ToffsetWires1A2.push(h[11]);break;case $.八分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]),this.ToffsetWires1A2.push(h[8]),this.ToffsetWires1A2.push(h[9]),this.ToffsetWires1A2.push(h[10]),this.ToffsetWires1A2.push(h[11]),this.ToffsetWires1A2.push(h[12]),this.ToffsetWires1A2.push(h[13]),this.ToffsetWires1A2.push(h[14]),this.ToffsetWires1A2.push(h[15]);break}break;case nn.B相:if(c.type==Ht.耐张串)if(c.WairFX=="进")switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires12.push(h[0]),this.ToffsetWires1B1.push(h[0]);break;case $.双分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]);break;case $.四分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]);break;case $.六分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.offsetWires12.push(h[4]),this.offsetWires12.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]),this.ToffsetWires1B1.push(h[8]),this.ToffsetWires1B1.push(h[9]),this.ToffsetWires1B1.push(h[10]),this.ToffsetWires1B1.push(h[11]);break;case $.八分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.offsetWires12.push(h[4]),this.offsetWires12.push(h[5]),this.offsetWires12.push(h[6]),this.offsetWires12.push(h[7]),this.ToffsetWires1B1.push(h[8]),this.ToffsetWires1B1.push(h[9]),this.ToffsetWires1B1.push(h[10]),this.ToffsetWires1B1.push(h[11]),this.ToffsetWires1B1.push(h[12]),this.ToffsetWires1B1.push(h[13]),this.ToffsetWires1B1.push(h[14]),this.ToffsetWires1B1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires12.push(d),this.ToffsetWires1B2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires12.push(p),this.offsetWires12.push(m),this.ToffsetWires1B2.push(p),this.ToffsetWires1B2.push(m);break;case $.四分裂:const T=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),y=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),w=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),A=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r);this.offsetWires12.push(T),this.offsetWires12.push(y),this.offsetWires12.push(w),this.offsetWires12.push(A),this.ToffsetWires1B2.push(T),this.ToffsetWires1B2.push(y),this.ToffsetWires1B2.push(w),this.ToffsetWires1B2.push(A);break;case $.六分裂:const E=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),b=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),I=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),O=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),B=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),L=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r);this.offsetWires12.push(E),this.offsetWires12.push(b),this.offsetWires12.push(I),this.offsetWires12.push(O),this.offsetWires12.push(B),this.offsetWires12.push(L),this.ToffsetWires1B2.push(E),this.ToffsetWires1B2.push(b),this.ToffsetWires1B2.push(I),this.ToffsetWires1B2.push(O),this.ToffsetWires1B2.push(B),this.ToffsetWires1B2.push(L);break;case $.八分裂:const F=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),N=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),U=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),M=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),j=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),Y=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r),s=Q(i,new u(c.InsulatorPoint[6].X*-1,c.InsulatorPoint[6].Y,c.InsulatorPoint[6].Z),r),x=Q(i,new u(c.InsulatorPoint[7].X*-1,c.InsulatorPoint[7].Y,c.InsulatorPoint[7].Z),r);this.offsetWires12.push(F),this.offsetWires12.push(N),this.offsetWires12.push(U),this.offsetWires12.push(M),this.offsetWires12.push(j),this.offsetWires12.push(Y),this.offsetWires12.push(s),this.offsetWires12.push(x),this.ToffsetWires1B2.push(F),this.ToffsetWires1B2.push(N),this.ToffsetWires1B2.push(U),this.ToffsetWires1B2.push(M),this.ToffsetWires1B2.push(j),this.ToffsetWires1B2.push(Y),this.ToffsetWires1B2.push(s),this.ToffsetWires1B2.push(x);break}else if(c.type==Ht.跳线串)switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B2.push(h[0]);break;case $.双分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B2.push(h[2]),this.ToffsetWires1B2.push(h[3]);break;case $.四分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B2.push(h[4]),this.ToffsetWires1B2.push(h[5]),this.ToffsetWires1B2.push(h[6]),this.ToffsetWires1B2.push(h[7]);break;case $.六分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B2.push(h[6]),this.ToffsetWires1B2.push(h[7]),this.ToffsetWires1B2.push(h[8]),this.ToffsetWires1B2.push(h[9]),this.ToffsetWires1B2.push(h[10]),this.ToffsetWires1B2.push(h[11]);break;case $.八分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]),this.ToffsetWires1B2.push(h[8]),this.ToffsetWires1B2.push(h[9]),this.ToffsetWires1B2.push(h[10]),this.ToffsetWires1B2.push(h[11]),this.ToffsetWires1B2.push(h[12]),this.ToffsetWires1B2.push(h[13]),this.ToffsetWires1B2.push(h[14]),this.ToffsetWires1B2.push(h[15]);break}break;case nn.C相:if(c.type==Ht.耐张串)if(c.WairFX=="进")switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires13.push(h[0]),this.ToffsetWires1C1.push(h[0]);break;case $.双分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]);break;case $.四分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]);break;case $.六分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.offsetWires13.push(h[4]),this.offsetWires13.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]),this.ToffsetWires1C1.push(h[8]),this.ToffsetWires1C1.push(h[9]),this.ToffsetWires1C1.push(h[10]),this.ToffsetWires1C1.push(h[11]);break;case $.八分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.offsetWires13.push(h[4]),this.offsetWires13.push(h[5]),this.offsetWires13.push(h[6]),this.offsetWires13.push(h[7]),this.ToffsetWires1C1.push(h[8]),this.ToffsetWires1C1.push(h[9]),this.ToffsetWires1C1.push(h[10]),this.ToffsetWires1C1.push(h[11]),this.ToffsetWires1C1.push(h[12]),this.ToffsetWires1C1.push(h[13]),this.ToffsetWires1C1.push(h[14]),this.ToffsetWires1C1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires13.push(d),this.ToffsetWires1C2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires13.push(p),this.offsetWires13.push(m),this.ToffsetWires1C2.push(p),this.ToffsetWires1C2.push(m);break;case $.四分裂:const T=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),y=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),w=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),A=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r);this.offsetWires13.push(T),this.offsetWires13.push(y),this.offsetWires13.push(w),this.offsetWires13.push(A),this.ToffsetWires1C2.push(T),this.ToffsetWires1C2.push(y),this.ToffsetWires1C2.push(w),this.ToffsetWires1C2.push(A);break;case $.六分裂:const E=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),b=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),I=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),O=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),B=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),L=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r);this.offsetWires13.push(E),this.offsetWires13.push(b),this.offsetWires13.push(I),this.offsetWires13.push(O),this.offsetWires13.push(B),this.offsetWires13.push(L),this.ToffsetWires1C2.push(E),this.ToffsetWires1C2.push(b),this.ToffsetWires1C2.push(I),this.ToffsetWires1C2.push(O),this.ToffsetWires1C2.push(B),this.ToffsetWires1C2.push(L);break;case $.八分裂:const F=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),N=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),U=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),M=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),j=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),Y=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r),s=Q(i,new u(c.InsulatorPoint[6].X*-1,c.InsulatorPoint[6].Y,c.InsulatorPoint[6].Z),r),x=Q(i,new u(c.InsulatorPoint[7].X*-1,c.InsulatorPoint[7].Y,c.InsulatorPoint[7].Z),r);this.offsetWires13.push(F),this.offsetWires13.push(N),this.offsetWires13.push(U),this.offsetWires13.push(M),this.offsetWires13.push(j),this.offsetWires13.push(Y),this.offsetWires13.push(s),this.offsetWires13.push(x),this.ToffsetWires1C2.push(F),this.ToffsetWires1C2.push(N),this.ToffsetWires1C2.push(U),this.ToffsetWires1C2.push(M),this.ToffsetWires1C2.push(j),this.ToffsetWires1C2.push(Y),this.ToffsetWires1C2.push(s),this.ToffsetWires1C2.push(x);break}else if(c.type==Ht.跳线串)switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C2.push(h[0]);break;case $.双分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C2.push(h[2]),this.ToffsetWires1C2.push(h[3]);break;case $.四分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C2.push(h[4]),this.ToffsetWires1C2.push(h[5]),this.ToffsetWires1C2.push(h[6]),this.ToffsetWires1C2.push(h[7]);break;case $.六分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C2.push(h[6]),this.ToffsetWires1C2.push(h[7]),this.ToffsetWires1C2.push(h[8]),this.ToffsetWires1C2.push(h[9]),this.ToffsetWires1C2.push(h[10]),this.ToffsetWires1C2.push(h[11]);break;case $.八分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]),this.ToffsetWires1C2.push(h[8]),this.ToffsetWires1C2.push(h[9]),this.ToffsetWires1C2.push(h[10]),this.ToffsetWires1C2.push(h[11]),this.ToffsetWires1C2.push(h[12]),this.ToffsetWires1C2.push(h[13]),this.ToffsetWires1C2.push(h[14]),this.ToffsetWires1C2.push(h[15]);break}break}else switch(c.PhaseSequence){case nn.A相:h.forEach(d=>{this.offsetWires11.push(d)});break;case nn.B相:h.forEach(d=>{this.offsetWires12.push(d)});break;case nn.C相:h.forEach(d=>{this.offsetWires13.push(d)});break}else if(this.LineInfo.towers[o].type==$i.耐张塔){debugger;switch(f){case 2:switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires11.push(h[0]),this.ToffsetWires1A1.push(h[0]);break;case $.双分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]);break}break;case 3:switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A2.push(h[0]);break;case $.双分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A2.push(h[2]),this.ToffsetWires1A2.push(h[3]);break}break;case 4:switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires11.push(d),this.ToffsetWires1A2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires11.push(p),this.offsetWires11.push(m),this.ToffsetWires1A2.push(p),this.ToffsetWires1A2.push(m);break}break;case 5:h.forEach(d=>{this.offsetWires12.push(d),this.ToffsetWires1B1.push(d)});break;case 6:h.forEach(d=>{this.ToffsetWires1B1.push(d),this.ToffsetWires1B2.push(d)});break;case 7:c.InsulatorPoint.forEach(d=>{const p=Q(i,new u(d.X*-1,d.Y,d.Z),r);this.offsetWires12.push(p),this.ToffsetWires1B2.push(p)});break;case 8:h.forEach(d=>{this.offsetWires13.push(d),this.ToffsetWires1C1.push(d)});break;case 9:h.forEach(d=>{this.ToffsetWires1C1.push(d),this.ToffsetWires1C2.push(d)});break;case 10:c.InsulatorPoint.forEach(d=>{const p=Q(i,new u(d.X*-1,d.Y,d.Z),r);this.offsetWires13.push(p),this.ToffsetWires1C2.push(p)});break}}else switch(f){case 2:h.forEach(d=>{this.offsetWires11.push(d)});break;case 3:h.forEach(d=>{this.offsetWires12.push(d)});break;case 4:h.forEach(d=>{this.offsetWires13.push(d)});break}break;case ar.回路二:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[o].type==$i.耐张塔)switch(c.PhaseSequence){case nn.A相:if(c.type==Ht.耐张串)if(c.WairFX=="进")switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires21.push(h[0]),this.ToffsetWires2A1.push(h[0]);break;case $.双分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]);break;case $.四分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]);break;case $.六分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.offsetWires21.push(h[4]),this.offsetWires21.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]),this.ToffsetWires2A1.push(h[8]),this.ToffsetWires2A1.push(h[9]),this.ToffsetWires2A1.push(h[10]),this.ToffsetWires2A1.push(h[11]);break;case $.八分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.offsetWires21.push(h[4]),this.offsetWires21.push(h[5]),this.offsetWires21.push(h[6]),this.offsetWires21.push(h[7]),this.ToffsetWires2A1.push(h[8]),this.ToffsetWires2A1.push(h[9]),this.ToffsetWires2A1.push(h[10]),this.ToffsetWires2A1.push(h[11]),this.ToffsetWires2A1.push(h[12]),this.ToffsetWires2A1.push(h[13]),this.ToffsetWires2A1.push(h[14]),this.ToffsetWires2A1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires21.push(d),this.ToffsetWires2A2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires21.push(p),this.offsetWires21.push(m),this.ToffsetWires2A2.push(p),this.ToffsetWires2A2.push(m);break;case $.四分裂:const T=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),y=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),w=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),A=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r);this.offsetWires21.push(T),this.offsetWires21.push(y),this.offsetWires21.push(w),this.offsetWires21.push(A),this.ToffsetWires2A2.push(T),this.ToffsetWires2A2.push(y),this.ToffsetWires2A2.push(w),this.ToffsetWires2A2.push(A);break;case $.六分裂:const E=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),b=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),I=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),O=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),B=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),L=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r);this.offsetWires21.push(E),this.offsetWires21.push(b),this.offsetWires21.push(I),this.offsetWires21.push(O),this.offsetWires21.push(B),this.offsetWires21.push(L),this.ToffsetWires2A2.push(E),this.ToffsetWires2A2.push(b),this.ToffsetWires2A2.push(I),this.ToffsetWires2A2.push(O),this.ToffsetWires2A2.push(B),this.ToffsetWires2A2.push(L);break;case $.八分裂:const F=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),N=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),U=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),M=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),j=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),Y=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r),s=Q(i,new u(c.InsulatorPoint[6].X*-1,c.InsulatorPoint[6].Y,c.InsulatorPoint[6].Z),r),x=Q(i,new u(c.InsulatorPoint[7].X*-1,c.InsulatorPoint[7].Y,c.InsulatorPoint[7].Z),r);this.offsetWires21.push(F),this.offsetWires21.push(N),this.offsetWires21.push(U),this.offsetWires21.push(M),this.offsetWires21.push(j),this.offsetWires21.push(Y),this.offsetWires21.push(s),this.offsetWires21.push(x),this.ToffsetWires2A2.push(F),this.ToffsetWires2A2.push(N),this.ToffsetWires2A2.push(U),this.ToffsetWires2A2.push(M),this.ToffsetWires2A2.push(j),this.ToffsetWires2A2.push(Y),this.ToffsetWires2A2.push(s),this.ToffsetWires2A2.push(x);break}else if(c.type==Ht.跳线串)switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A2.push(h[0]);break;case $.双分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A2.push(h[2]),this.ToffsetWires2A2.push(h[3]);break;case $.四分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A2.push(h[4]),this.ToffsetWires2A2.push(h[5]),this.ToffsetWires2A2.push(h[6]),this.ToffsetWires2A2.push(h[7]);break;case $.六分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A2.push(h[6]),this.ToffsetWires2A2.push(h[7]),this.ToffsetWires2A2.push(h[8]),this.ToffsetWires2A2.push(h[9]),this.ToffsetWires2A2.push(h[10]),this.ToffsetWires2A2.push(h[11]);break;case $.八分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]),this.ToffsetWires2A2.push(h[8]),this.ToffsetWires2A2.push(h[9]),this.ToffsetWires2A2.push(h[10]),this.ToffsetWires2A2.push(h[11]),this.ToffsetWires2A2.push(h[12]),this.ToffsetWires2A2.push(h[13]),this.ToffsetWires2A2.push(h[14]),this.ToffsetWires2A2.push(h[15]);break}break;case nn.B相:if(c.type==Ht.耐张串)if(c.WairFX=="进")switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires22.push(h[0]),this.ToffsetWires2B1.push(h[0]);break;case $.双分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]);break;case $.四分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]);break;case $.六分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.offsetWires22.push(h[4]),this.offsetWires22.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]),this.ToffsetWires2B1.push(h[8]),this.ToffsetWires2B1.push(h[9]),this.ToffsetWires2B1.push(h[10]),this.ToffsetWires2B1.push(h[11]);break;case $.八分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.offsetWires22.push(h[4]),this.offsetWires22.push(h[5]),this.offsetWires22.push(h[6]),this.offsetWires22.push(h[7]),this.ToffsetWires2B1.push(h[8]),this.ToffsetWires2B1.push(h[9]),this.ToffsetWires2B1.push(h[10]),this.ToffsetWires2B1.push(h[11]),this.ToffsetWires2B1.push(h[12]),this.ToffsetWires2B1.push(h[13]),this.ToffsetWires2B1.push(h[14]),this.ToffsetWires2B1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires22.push(d),this.ToffsetWires2B2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires22.push(p),this.offsetWires22.push(m),this.ToffsetWires2B2.push(p),this.ToffsetWires2B2.push(m);break;case $.四分裂:const T=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),y=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),w=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),A=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r);this.offsetWires22.push(T),this.offsetWires22.push(y),this.offsetWires22.push(w),this.offsetWires22.push(A),this.ToffsetWires2B2.push(T),this.ToffsetWires2B2.push(y),this.ToffsetWires2B2.push(w),this.ToffsetWires2B2.push(A);break;case $.六分裂:const E=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),b=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),I=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),O=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),B=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),L=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r);this.offsetWires22.push(E),this.offsetWires22.push(b),this.offsetWires22.push(I),this.offsetWires22.push(O),this.offsetWires22.push(B),this.offsetWires22.push(L),this.ToffsetWires2B2.push(E),this.ToffsetWires2B2.push(b),this.ToffsetWires2B2.push(I),this.ToffsetWires2B2.push(O),this.ToffsetWires2B2.push(B),this.ToffsetWires2B2.push(L);break;case $.八分裂:const F=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),N=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),U=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),M=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),j=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),Y=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r),s=Q(i,new u(c.InsulatorPoint[6].X*-1,c.InsulatorPoint[6].Y,c.InsulatorPoint[6].Z),r),x=Q(i,new u(c.InsulatorPoint[7].X*-1,c.InsulatorPoint[7].Y,c.InsulatorPoint[7].Z),r);this.offsetWires22.push(F),this.offsetWires22.push(N),this.offsetWires22.push(U),this.offsetWires22.push(M),this.offsetWires22.push(j),this.offsetWires22.push(Y),this.offsetWires22.push(s),this.offsetWires22.push(x),this.ToffsetWires2B2.push(F),this.ToffsetWires2B2.push(N),this.ToffsetWires2B2.push(U),this.ToffsetWires2B2.push(M),this.ToffsetWires2B2.push(j),this.ToffsetWires2B2.push(Y),this.ToffsetWires2B2.push(s),this.ToffsetWires2B2.push(x);break}else if(c.type==Ht.跳线串)switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B2.push(h[0]);break;case $.双分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B2.push(h[2]),this.ToffsetWires2B2.push(h[3]);break;case $.四分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B2.push(h[4]),this.ToffsetWires2B2.push(h[5]),this.ToffsetWires2B2.push(h[6]),this.ToffsetWires2B2.push(h[7]);break;case $.六分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B2.push(h[6]),this.ToffsetWires2B2.push(h[7]),this.ToffsetWires2B2.push(h[8]),this.ToffsetWires2B2.push(h[9]),this.ToffsetWires2B2.push(h[10]),this.ToffsetWires2B2.push(h[11]);break;case $.八分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]),this.ToffsetWires2B2.push(h[8]),this.ToffsetWires2B2.push(h[9]),this.ToffsetWires2B2.push(h[10]),this.ToffsetWires2B2.push(h[11]),this.ToffsetWires2B2.push(h[12]),this.ToffsetWires2B2.push(h[13]),this.ToffsetWires2B2.push(h[14]),this.ToffsetWires2B2.push(h[15]);break}break;case nn.C相:if(c.type==Ht.耐张串)if(c.WairFX=="进")switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires23.push(h[0]),this.ToffsetWires2C1.push(h[0]);break;case $.双分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]);break;case $.四分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]);break;case $.六分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.offsetWires23.push(h[4]),this.offsetWires23.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]),this.ToffsetWires2C1.push(h[8]),this.ToffsetWires2C1.push(h[9]),this.ToffsetWires2C1.push(h[10]),this.ToffsetWires2C1.push(h[11]);break;case $.八分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.offsetWires23.push(h[4]),this.offsetWires23.push(h[5]),this.offsetWires23.push(h[6]),this.offsetWires23.push(h[7]),this.ToffsetWires2C1.push(h[8]),this.ToffsetWires2C1.push(h[9]),this.ToffsetWires2C1.push(h[10]),this.ToffsetWires2C1.push(h[11]),this.ToffsetWires2C1.push(h[12]),this.ToffsetWires2C1.push(h[13]),this.ToffsetWires2C1.push(h[14]),this.ToffsetWires2C1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires23.push(d),this.ToffsetWires2C2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires23.push(p),this.offsetWires23.push(m),this.ToffsetWires2C2.push(p),this.ToffsetWires2C2.push(m);break;case $.四分裂:const T=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),y=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),w=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),A=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r);this.offsetWires23.push(T),this.offsetWires23.push(y),this.offsetWires23.push(w),this.offsetWires23.push(A),this.ToffsetWires2C2.push(T),this.ToffsetWires2C2.push(y),this.ToffsetWires2C2.push(w),this.ToffsetWires2C2.push(A);break;case $.六分裂:const E=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),b=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),I=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),O=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),B=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),L=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r);this.offsetWires23.push(E),this.offsetWires23.push(b),this.offsetWires23.push(I),this.offsetWires23.push(O),this.offsetWires23.push(B),this.offsetWires23.push(L),this.ToffsetWires2C2.push(E),this.ToffsetWires2C2.push(b),this.ToffsetWires2C2.push(I),this.ToffsetWires2C2.push(O),this.ToffsetWires2C2.push(B),this.ToffsetWires2C2.push(L);break;case $.八分裂:const F=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),N=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),U=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),M=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),j=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),Y=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r),s=Q(i,new u(c.InsulatorPoint[6].X*-1,c.InsulatorPoint[6].Y,c.InsulatorPoint[6].Z),r),x=Q(i,new u(c.InsulatorPoint[7].X*-1,c.InsulatorPoint[7].Y,c.InsulatorPoint[7].Z),r);this.offsetWires23.push(F),this.offsetWires23.push(N),this.offsetWires23.push(U),this.offsetWires23.push(M),this.offsetWires23.push(j),this.offsetWires23.push(Y),this.offsetWires23.push(s),this.offsetWires23.push(x),this.ToffsetWires2C2.push(F),this.ToffsetWires2C2.push(N),this.ToffsetWires2C2.push(U),this.ToffsetWires2C2.push(M),this.ToffsetWires2C2.push(j),this.ToffsetWires2C2.push(Y),this.ToffsetWires2C2.push(s),this.ToffsetWires2C2.push(x);break}else if(c.type==Ht.跳线串)switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C2.push(h[0]);break;case $.双分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C2.push(h[2]),this.ToffsetWires2C2.push(h[3]);break;case $.四分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C2.push(h[4]),this.ToffsetWires2C2.push(h[5]),this.ToffsetWires2C2.push(h[6]),this.ToffsetWires2C2.push(h[7]);break;case $.六分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C2.push(h[6]),this.ToffsetWires2C2.push(h[7]),this.ToffsetWires2C2.push(h[8]),this.ToffsetWires2C2.push(h[9]),this.ToffsetWires2C2.push(h[10]),this.ToffsetWires2C2.push(h[11]);break;case $.八分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]),this.ToffsetWires2C2.push(h[8]),this.ToffsetWires2C2.push(h[9]),this.ToffsetWires2C2.push(h[10]),this.ToffsetWires2C2.push(h[11]),this.ToffsetWires2C2.push(h[12]),this.ToffsetWires2C2.push(h[13]),this.ToffsetWires2C2.push(h[14]),this.ToffsetWires2C2.push(h[15]);break}break}else switch(c.PhaseSequence){case nn.A相:h.forEach(d=>{this.offsetWires21.push(d)});break;case nn.B相:h.forEach(d=>{this.offsetWires22.push(d)});break;case nn.C相:h.forEach(d=>{this.offsetWires23.push(d)});break}else if(this.LineInfo.towers[o].type==$i.耐张塔)switch(f){case 11:this.offsetWires21.push(h[0]),this.ToffsetWires2A1.push(h[0]);break;case 12:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A2.push(h[0]);break;case 13:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires21.push(d),this.ToffsetWires2A2.push(d);break;case 14:this.offsetWires22.push(h[0]),this.ToffsetWires2B1.push(h[0]);break;case 15:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B2.push(h[0]);break;case 16:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires22.push(p),this.ToffsetWires2B2.push(p);break;case 17:this.offsetWires23.push(h[0]),this.ToffsetWires2C1.push(h[0]);break;case 18:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C2.push(h[0]);break;case 19:const m=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires23.push(m),this.ToffsetWires2C2.push(m);break}else switch(f){case 5:h.forEach(d=>{this.offsetWires21.push(d)});break;case 6:h.forEach(d=>{this.offsetWires22.push(d)});break;case 7:h.forEach(d=>{this.offsetWires23.push(d)});break}break;case ar.地线:if(this.LineInfo.ISPhaseSequence)switch(c.PhaseSequence){case nn.地线1:this.offsetGrouundWires11.push(h[0]);break;case nn.地线2:this.offsetGrouundWires12.push(h[0]);break}else switch(f){case 0:this.offsetGrouundWires11.push(h[0]);break;case 1:this.offsetGrouundWires12.push(h[0]);break}break}f=f+1});debugger;if(this.offsetWires11.length>0&&o>0){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires11.length>=2&&(c.push(this.offsetWires11[t]),c.push(this.offsetWires11[t-1]),this.offsetArcWires1A=W(c),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case $.双分裂:this.offsetWires11.length>=4&&(c.push(this.offsetWires11[t]),c.push(this.offsetWires11[t-2]),this.offsetArcWires1A=W(c),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+1]),h.push(this.offsetWires11[t-1]),this.offsetArcWires1A=W(h),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case $.四分裂:this.offsetWires11.length>=8&&(c.push(this.offsetWires11[t]),c.push(this.offsetWires11[t-4]),this.offsetArcWires1A=W(c),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+1]),h.push(this.offsetWires11[t-3]),this.offsetArcWires1A=W(h),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+2]),d.push(this.offsetWires11[t-2]),this.offsetArcWires1A=W(d),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+3]),p.push(this.offsetWires11[t-1]),this.offsetArcWires1A=W(p),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case $.六分裂:this.offsetWires11.length>=12&&(c.push(this.offsetWires11[t]),c.push(this.offsetWires11[t-6]),this.offsetArcWires1A=W(c),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+1]),h.push(this.offsetWires11[t-5]),this.offsetArcWires1A=W(h),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+2]),d.push(this.offsetWires11[t-4]),this.offsetArcWires1A=W(d),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+3]),p.push(this.offsetWires11[t-3]),this.offsetArcWires1A=W(p),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires11[t+4]),m.push(this.offsetWires11[t-2]),this.offsetArcWires1A=W(m),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires11[t+5]),T.push(this.offsetWires11[t-1]),this.offsetArcWires1A=W(T),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case $.八分裂:this.offsetWires11.length>=16&&(c.push(this.offsetWires11[t]),c.push(this.offsetWires11[t-8]),this.offsetArcWires1A=W(c),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+1]),h.push(this.offsetWires11[t-7]),this.offsetArcWires1A=W(h),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+2]),d.push(this.offsetWires11[t-6]),this.offsetArcWires1A=W(d),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+3]),p.push(this.offsetWires11[t-5]),this.offsetArcWires1A=W(p),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires11[t+4]),m.push(this.offsetWires11[t-4]),this.offsetArcWires1A=W(m),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires11[t+5]),T.push(this.offsetWires11[t-3]),this.offsetArcWires1A=W(T),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires11[t+6]),y.push(this.offsetWires11[t-2]),this.offsetArcWires1A=W(y),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A7"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),w.push(this.offsetWires11[t+7]),w.push(this.offsetWires11[t-1]),this.offsetArcWires1A=W(w),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A8"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break}}if(this.offsetWires12.length>0&&o>0){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[];switch(this.LineInfo.Wairnum){case $.单分裂:c.push(this.offsetWires12[t]),c.push(this.offsetWires12[t-1]),this.offsetArcWires1B=W(c),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.双分裂:c.push(this.offsetWires12[t]),c.push(this.offsetWires12[t-2]),this.offsetArcWires1B=W(c),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+1]),h.push(this.offsetWires12[t-1]),this.offsetArcWires1B=W(h),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.四分裂:c.push(this.offsetWires12[t]),c.push(this.offsetWires12[t-4]),this.offsetArcWires1B=W(c),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+1]),h.push(this.offsetWires12[t-3]),this.offsetArcWires1B=W(h),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+2]),d.push(this.offsetWires12[t-2]),this.offsetArcWires1B=W(d),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+3]),p.push(this.offsetWires12[t-1]),this.offsetArcWires1B=W(p),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.六分裂:c.push(this.offsetWires12[t]),c.push(this.offsetWires12[t-6]),this.offsetArcWires1B=W(c),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+1]),h.push(this.offsetWires12[t-5]),this.offsetArcWires1B=W(h),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+2]),d.push(this.offsetWires12[t-4]),this.offsetArcWires1B=W(d),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+3]),p.push(this.offsetWires12[t-3]),this.offsetArcWires1B=W(p),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires12[t+4]),m.push(this.offsetWires12[t-2]),this.offsetArcWires1B=W(m),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires12[t+5]),T.push(this.offsetWires12[t-1]),this.offsetArcWires1B=W(T),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.八分裂:c.push(this.offsetWires12[t]),c.push(this.offsetWires12[t-8]),this.offsetArcWires1B=W(c),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+1]),h.push(this.offsetWires12[t-7]),this.offsetArcWires1B=W(h),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+2]),d.push(this.offsetWires12[t-6]),this.offsetArcWires1B=W(d),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+3]),p.push(this.offsetWires12[t-5]),this.offsetArcWires1B=W(p),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires12[t+4]),m.push(this.offsetWires12[t-4]),this.offsetArcWires1B=W(m),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires12[t+5]),T.push(this.offsetWires12[t-3]),this.offsetArcWires1B=W(T),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires12[t+6]),y.push(this.offsetWires12[t-2]),this.offsetArcWires1B=W(y),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B7"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),w.push(this.offsetWires12[t+7]),w.push(this.offsetWires12[t-1]),this.offsetArcWires1B=W(w),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B8"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires13.length>0&&o>0){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[];switch(this.LineInfo.Wairnum){case $.单分裂:c.push(this.offsetWires13[t]),c.push(this.offsetWires13[t-1]),this.offsetArcWires1C=W(c),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.双分裂:c.push(this.offsetWires13[t]),c.push(this.offsetWires13[t-2]),this.offsetArcWires1C=W(c),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+1]),h.push(this.offsetWires13[t-1]),this.offsetArcWires1C=W(h),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.四分裂:c.push(this.offsetWires13[t]),c.push(this.offsetWires13[t-4]),this.offsetArcWires1C=W(c),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+1]),h.push(this.offsetWires13[t-3]),this.offsetArcWires1C=W(h),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+2]),d.push(this.offsetWires13[t-2]),this.offsetArcWires1C=W(d),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+3]),p.push(this.offsetWires13[t-1]),this.offsetArcWires1C=W(p),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.六分裂:c.push(this.offsetWires13[t]),c.push(this.offsetWires13[t-6]),this.offsetArcWires1C=W(c),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+1]),h.push(this.offsetWires13[t-5]),this.offsetArcWires1C=W(h),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+2]),d.push(this.offsetWires13[t-4]),this.offsetArcWires1C=W(d),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+3]),p.push(this.offsetWires13[t-3]),this.offsetArcWires1C=W(p),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires13[t+4]),m.push(this.offsetWires13[t-2]),this.offsetArcWires1C=W(m),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires13[t+5]),T.push(this.offsetWires13[t-1]),this.offsetArcWires1C=W(T),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.八分裂:c.push(this.offsetWires13[t]),c.push(this.offsetWires13[t-8]),this.offsetArcWires1C=W(c),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+1]),h.push(this.offsetWires13[t-7]),this.offsetArcWires1C=W(h),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+2]),d.push(this.offsetWires13[t-6]),this.offsetArcWires1C=W(d),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+3]),p.push(this.offsetWires13[t-5]),this.offsetArcWires1C=W(p),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires13[t+4]),m.push(this.offsetWires13[t-4]),this.offsetArcWires1C=W(m),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires13[t+5]),T.push(this.offsetWires13[t-3]),this.offsetArcWires1C=W(T),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires13[t+6]),y.push(this.offsetWires13[t-2]),this.offsetArcWires1C=W(y),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C7"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),w.push(this.offsetWires13[t+7]),w.push(this.offsetWires13[t-1]),this.offsetArcWires1C=W(w),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C8"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires21.length>0&&o>0){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[];switch(this.LineInfo.Wairnum){case $.单分裂:c.push(this.offsetWires21[t]),c.push(this.offsetWires21[t-1]),this.offsetArcWires2A=W(c),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.双分裂:c.push(this.offsetWires21[t]),c.push(this.offsetWires21[t-2]),this.offsetArcWires2A=W(c),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+1]),h.push(this.offsetWires21[t-1]),this.offsetArcWires2A=W(h),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.四分裂:c.push(this.offsetWires21[t]),c.push(this.offsetWires21[t-4]),this.offsetArcWires2A=W(c),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+1]),h.push(this.offsetWires21[t-3]),this.offsetArcWires2A=W(h),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+2]),d.push(this.offsetWires21[t-2]),this.offsetArcWires2A=W(d),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+3]),p.push(this.offsetWires21[t-1]),this.offsetArcWires2A=W(p),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.六分裂:c.push(this.offsetWires21[t]),c.push(this.offsetWires21[t-6]),this.offsetArcWires2A=W(c),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+1]),h.push(this.offsetWires21[t-5]),this.offsetArcWires2A=W(h),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+2]),d.push(this.offsetWires21[t-4]),this.offsetArcWires2A=W(d),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+3]),p.push(this.offsetWires21[t-3]),this.offsetArcWires2A=W(p),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires21[t+4]),m.push(this.offsetWires21[t-2]),this.offsetArcWires2A=W(m),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires21[t+5]),T.push(this.offsetWires21[t-1]),this.offsetArcWires2A=W(T),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.八分裂:c.push(this.offsetWires21[t]),c.push(this.offsetWires21[t-8]),this.offsetArcWires2A=W(c),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+1]),h.push(this.offsetWires21[t-7]),this.offsetArcWires2A=W(h),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+2]),d.push(this.offsetWires21[t-6]),this.offsetArcWires2A=W(d),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+3]),p.push(this.offsetWires21[t-5]),this.offsetArcWires2A=W(p),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires21[t+4]),m.push(this.offsetWires21[t-4]),this.offsetArcWires2A=W(m),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires21[t+5]),T.push(this.offsetWires21[t-3]),this.offsetArcWires2A=W(T),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires21[t+6]),y.push(this.offsetWires21[t-2]),this.offsetArcWires2A=W(y),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A7"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),w.push(this.offsetWires21[t+7]),w.push(this.offsetWires21[t-1]),this.offsetArcWires2A=W(w),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A8"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires22.length>0&&o>0){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[];switch(this.LineInfo.Wairnum){case $.单分裂:c.push(this.offsetWires22[t]),c.push(this.offsetWires22[t-1]),this.offsetArcWires2B=W(c),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.双分裂:c.push(this.offsetWires22[t]),c.push(this.offsetWires22[t-2]),this.offsetArcWires2B=W(c),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+1]),h.push(this.offsetWires22[t-1]),this.offsetArcWires2B=W(h),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.四分裂:c.push(this.offsetWires22[t]),c.push(this.offsetWires22[t-4]),this.offsetArcWires2B=W(c),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+1]),h.push(this.offsetWires22[t-3]),this.offsetArcWires2B=W(h),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+2]),d.push(this.offsetWires22[t-2]),this.offsetArcWires2B=W(d),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+3]),p.push(this.offsetWires22[t-1]),this.offsetArcWires2B=W(p),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.六分裂:c.push(this.offsetWires22[t]),c.push(this.offsetWires22[t-6]),this.offsetArcWires2B=W(c),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+1]),h.push(this.offsetWires22[t-5]),this.offsetArcWires2B=W(h),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+2]),d.push(this.offsetWires22[t-4]),this.offsetArcWires2B=W(d),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+3]),p.push(this.offsetWires22[t-3]),this.offsetArcWires2B=W(p),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires22[t+4]),m.push(this.offsetWires22[t-2]),this.offsetArcWires2B=W(m),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires22[t+5]),T.push(this.offsetWires22[t-1]),this.offsetArcWires2B=W(T),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.八分裂:c.push(this.offsetWires22[t]),c.push(this.offsetWires22[t-8]),this.offsetArcWires2B=W(c),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+1]),h.push(this.offsetWires22[t-7]),this.offsetArcWires2B=W(h),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+2]),d.push(this.offsetWires22[t-6]),this.offsetArcWires2B=W(d),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+3]),p.push(this.offsetWires22[t-5]),this.offsetArcWires2B=W(p),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires22[t+4]),m.push(this.offsetWires22[t-4]),this.offsetArcWires2B=W(m),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires22[t+5]),T.push(this.offsetWires22[t-3]),this.offsetArcWires2B=W(T),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires22[t+6]),y.push(this.offsetWires22[t-2]),this.offsetArcWires2B=W(y),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B7"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),w.push(this.offsetWires22[t+7]),w.push(this.offsetWires22[t-1]),this.offsetArcWires2B=W(w),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B8"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires23.length>0&&o>0){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[];switch(this.LineInfo.Wairnum){case $.单分裂:c.push(this.offsetWires23[t]),c.push(this.offsetWires23[t-1]),this.offsetArcWires2C=W(c),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.双分裂:c.push(this.offsetWires23[t]),c.push(this.offsetWires23[t-2]),this.offsetArcWires2C=W(c),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+1]),h.push(this.offsetWires23[t-1]),this.offsetArcWires2C=W(h),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.四分裂:c.push(this.offsetWires23[t]),c.push(this.offsetWires23[t-4]),this.offsetArcWires2C=W(c),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+1]),h.push(this.offsetWires23[t-3]),this.offsetArcWires2C=W(h),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+2]),d.push(this.offsetWires23[t-2]),this.offsetArcWires2C=W(d),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+3]),p.push(this.offsetWires23[t-1]),this.offsetArcWires2C=W(p),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.六分裂:c.push(this.offsetWires23[t]),c.push(this.offsetWires23[t-6]),this.offsetArcWires2C=W(c),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+1]),h.push(this.offsetWires23[t-5]),this.offsetArcWires2C=W(h),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+2]),d.push(this.offsetWires23[t-4]),this.offsetArcWires2C=W(d),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+3]),p.push(this.offsetWires23[t-3]),this.offsetArcWires2C=W(p),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires23[t+4]),m.push(this.offsetWires23[t-2]),this.offsetArcWires2C=W(m),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires23[t+5]),T.push(this.offsetWires23[t-1]),this.offsetArcWires2C=W(T),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.八分裂:c.push(this.offsetWires23[t]),c.push(this.offsetWires23[t-8]),this.offsetArcWires2C=W(c),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+1]),h.push(this.offsetWires23[t-7]),this.offsetArcWires2C=W(h),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+2]),d.push(this.offsetWires23[t-6]),this.offsetArcWires2C=W(d),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+3]),p.push(this.offsetWires23[t-5]),this.offsetArcWires2C=W(p),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires23[t+4]),m.push(this.offsetWires23[t-4]),this.offsetArcWires2C=W(m),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires23[t+5]),T.push(this.offsetWires23[t-3]),this.offsetArcWires2C=W(T),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires23[t+6]),y.push(this.offsetWires23[t-2]),this.offsetArcWires2C=W(y),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C7"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),w.push(this.offsetWires23[t+7]),w.push(this.offsetWires23[t-1]),this.offsetArcWires2C=W(w),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C8"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetGrouundWires11.length>1){const c=[];c.push(this.offsetGrouundWires11[o]),c.push(this.offsetGrouundWires11[o-1]);const h=[];h.push(this.offsetGrouundWires12[o]),h.push(this.offsetGrouundWires12[o-1]),this.offsetGrouundWires1=W(c,2),this.offsetGrouundWires2=W(h,2),this.entityCollection2.add(v(this.offsetGrouundWires1,"地线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireD1Color)),this.entityCollection2.add(v(this.offsetGrouundWires2,"地线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireD2Color))}if(this.LineInfo.towers[o].type==$i.耐张塔){switch(this.LineInfo.Wairnum){case $.单分裂:t=t+2,n=n+2;break;case $.双分裂:t=t+4,n=n+4;break;case $.四分裂:t=t+8,n=n+8;break;case $.六分裂:t=t+12,n=n+12;break;case $.八分裂:t=t+16,n=n+16;break}if(this.ToffsetWires1A1.length>1&&this.ToffsetWires1A2.length>1){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[],A=[],E=[],b=[],I=[],O=[],B=[],L=[],F=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1A1.length>=2&&(c.push(this.ToffsetWires1A1[n-2]),c.push(this.ToffsetWires1A1[n-1]),this.ToffsetArcWires1A=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=2&&(A.push(this.ToffsetWires1A2[n-2]),A.push(this.ToffsetWires1A2[n-1]),this.ToffsetArcWires2A=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.双分裂:this.ToffsetWires1A1.length>=4&&(c.push(this.ToffsetWires1A1[n-4]),c.push(this.ToffsetWires1A1[n-2]),this.ToffsetArcWires1A=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[n-3]),h.push(this.ToffsetWires1A1[n-1]),this.ToffsetArcWires1A=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=4&&(A.push(this.ToffsetWires1A2[n-4]),A.push(this.ToffsetWires1A2[n-2]),this.ToffsetArcWires2A=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1A2[n-3]),E.push(this.ToffsetWires1A2[n-1]),this.ToffsetArcWires2A=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.四分裂:this.ToffsetWires1A1.length>=8&&(c.push(this.ToffsetWires1A1[n-8]),c.push(this.ToffsetWires1A1[n-4]),this.ToffsetArcWires1A=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[n-7]),h.push(this.ToffsetWires1A1[n-3]),this.ToffsetArcWires1A=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[n-6]),d.push(this.ToffsetWires1A1[n-2]),this.ToffsetArcWires1A=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[n-5]),p.push(this.ToffsetWires1A1[n-1]),this.ToffsetArcWires1A=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=8&&(A.push(this.ToffsetWires1A2[n-8]),A.push(this.ToffsetWires1A2[n-4]),this.ToffsetArcWires2A=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1A2[n-7]),E.push(this.ToffsetWires1A2[n-3]),this.ToffsetArcWires2A=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[n-6]),b.push(this.ToffsetWires1A2[n-2]),this.ToffsetArcWires2A=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1A2[n-5]),I.push(this.ToffsetWires1A2[n-1]),this.ToffsetArcWires2A=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.六分裂:this.ToffsetWires1A1.length>=12&&(c.push(this.ToffsetWires1A1[n-12]),c.push(this.ToffsetWires1A1[n-6]),this.ToffsetArcWires1A=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[n-11]),h.push(this.ToffsetWires1A1[n-5]),this.ToffsetArcWires1A=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[n-10]),d.push(this.ToffsetWires1A1[n-4]),this.ToffsetArcWires1A=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[n-9]),p.push(this.ToffsetWires1A1[n-3]),this.ToffsetArcWires1A=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A1[n-8]),m.push(this.ToffsetWires1A1[n-2]),this.ToffsetArcWires1A=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A1[n-7]),T.push(this.ToffsetWires1A1[n-1]),this.ToffsetArcWires1A=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=12&&(A.push(this.ToffsetWires1A2[n-12]),A.push(this.ToffsetWires1A2[n-6]),this.ToffsetArcWires2A=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1A2[n-11]),E.push(this.ToffsetWires1A2[n-5]),this.ToffsetArcWires2A=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[n-10]),b.push(this.ToffsetWires1A2[n-4]),this.ToffsetArcWires2A=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1A2[n-9]),I.push(this.ToffsetWires1A2[n-3]),this.ToffsetArcWires2A=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires1A2[n-8]),O.push(this.ToffsetWires1A2[n-2]),this.ToffsetArcWires2A=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1A2[n-7]),B.push(this.ToffsetWires1A2[n-1]),this.ToffsetArcWires2A=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.八分裂:this.ToffsetWires1A1.length>=16&&(c.push(this.ToffsetWires1A1[n-16]),c.push(this.ToffsetWires1A1[n-8]),this.ToffsetArcWires1A=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[n-15]),h.push(this.ToffsetWires1A1[n-7]),this.ToffsetArcWires1A=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[n-14]),d.push(this.ToffsetWires1A1[n-6]),this.ToffsetArcWires1A=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[n-13]),p.push(this.ToffsetWires1A1[n-5]),this.ToffsetArcWires1A=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A1[n-12]),m.push(this.ToffsetWires1A1[n-4]),this.ToffsetArcWires1A=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A1[n-11]),T.push(this.ToffsetWires1A1[n-3]),this.ToffsetArcWires1A=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires1A1[n-10]),y.push(this.ToffsetWires1A1[n-2]),this.ToffsetArcWires1A=W(y,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1A1[n-9]),w.push(this.ToffsetWires1A1[n-1]),this.ToffsetArcWires1A=W(w,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=16&&(A.push(this.ToffsetWires1A2[n-16]),A.push(this.ToffsetWires1A2[n-8]),this.ToffsetArcWires2A=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1A2[n-15]),E.push(this.ToffsetWires1A2[n-7]),this.ToffsetArcWires2A=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[n-14]),b.push(this.ToffsetWires1A2[n-6]),this.ToffsetArcWires2A=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1A2[n-13]),I.push(this.ToffsetWires1A2[n-5]),this.ToffsetArcWires2A=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires1A2[n-12]),O.push(this.ToffsetWires1A2[n-4]),this.ToffsetArcWires2A=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1A2[n-11]),B.push(this.ToffsetWires1A2[n-3]),this.ToffsetArcWires2A=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1A2[n-10]),L.push(this.ToffsetWires1A2[n-2]),this.ToffsetArcWires2A=W(L,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),F.push(this.ToffsetWires1A2[n-9]),F.push(this.ToffsetWires1A2[n-1]),this.ToffsetArcWires2A=W(F,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires1B1.length>1&&this.ToffsetWires1B2.length>1){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[],A=[],E=[],b=[],I=[],O=[],B=[],L=[],F=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1B1.length>=2&&(c.push(this.ToffsetWires1B1[n-2]),c.push(this.ToffsetWires1B1[n-1]),this.ToffsetArcWires1B=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=2&&(A.push(this.ToffsetWires1B2[n-2]),A.push(this.ToffsetWires1B2[n-1]),this.ToffsetArcWires2B=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.双分裂:this.ToffsetWires1B1.length>=4&&(c.push(this.ToffsetWires1B1[n-4]),c.push(this.ToffsetWires1B1[n-2]),this.ToffsetArcWires1B=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[n-3]),h.push(this.ToffsetWires1B1[n-1]),this.ToffsetArcWires1B=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=4&&(A.push(this.ToffsetWires1B2[n-4]),A.push(this.ToffsetWires1B2[n-2]),this.ToffsetArcWires2B=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1B2[n-3]),E.push(this.ToffsetWires1B2[n-1]),this.ToffsetArcWires2B=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.四分裂:this.ToffsetWires1B1.length>=8&&(c.push(this.ToffsetWires1B1[n-8]),c.push(this.ToffsetWires1B1[n-4]),this.ToffsetArcWires1B=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[n-7]),h.push(this.ToffsetWires1B1[n-3]),this.ToffsetArcWires1B=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[n-6]),d.push(this.ToffsetWires1B1[n-2]),this.ToffsetArcWires1B=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[n-5]),p.push(this.ToffsetWires1B1[n-1]),this.ToffsetArcWires1B=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=8&&(A.push(this.ToffsetWires1B2[n-8]),A.push(this.ToffsetWires1B2[n-4]),this.ToffsetArcWires2B=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1B2[n-7]),E.push(this.ToffsetWires1B2[n-3]),this.ToffsetArcWires2B=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[n-6]),b.push(this.ToffsetWires1B2[n-2]),this.ToffsetArcWires2B=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1B2[n-5]),I.push(this.ToffsetWires1B2[n-1]),this.ToffsetArcWires2B=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.六分裂:this.ToffsetWires1B1.length>=12&&(c.push(this.ToffsetWires1B1[n-12]),c.push(this.ToffsetWires1B1[n-6]),this.ToffsetArcWires1B=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[n-11]),h.push(this.ToffsetWires1B1[n-5]),this.ToffsetArcWires1B=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[n-10]),d.push(this.ToffsetWires1B1[n-4]),this.ToffsetArcWires1B=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[n-9]),p.push(this.ToffsetWires1B1[n-3]),this.ToffsetArcWires1B=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B1[n-8]),m.push(this.ToffsetWires1B1[n-2]),this.ToffsetArcWires1B=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B1[n-7]),T.push(this.ToffsetWires1B1[n-1]),this.ToffsetArcWires1B=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=12&&(A.push(this.ToffsetWires1B2[n-12]),A.push(this.ToffsetWires1B2[n-6]),this.ToffsetArcWires2B=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1B2[n-11]),E.push(this.ToffsetWires1B2[n-5]),this.ToffsetArcWires2B=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[n-10]),b.push(this.ToffsetWires1B2[n-4]),this.ToffsetArcWires2B=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1B2[n-9]),I.push(this.ToffsetWires1B2[n-3]),this.ToffsetArcWires2B=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires1B2[n-8]),O.push(this.ToffsetWires1B2[n-2]),this.ToffsetArcWires2B=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1B2[n-7]),B.push(this.ToffsetWires1B2[n-1]),this.ToffsetArcWires2B=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.八分裂:this.ToffsetWires1B1.length>=16&&(c.push(this.ToffsetWires1B1[n-16]),c.push(this.ToffsetWires1B1[n-8]),this.ToffsetArcWires1B=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[n-15]),h.push(this.ToffsetWires1B1[n-7]),this.ToffsetArcWires1B=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[n-14]),d.push(this.ToffsetWires1B1[n-6]),this.ToffsetArcWires1B=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[n-13]),p.push(this.ToffsetWires1B1[n-5]),this.ToffsetArcWires1B=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B1[n-12]),m.push(this.ToffsetWires1B1[n-4]),this.ToffsetArcWires1B=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B1[n-11]),T.push(this.ToffsetWires1B1[n-3]),this.ToffsetArcWires1B=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires1B1[n-10]),y.push(this.ToffsetWires1B1[n-2]),this.ToffsetArcWires1B=W(y,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1B1[n-9]),w.push(this.ToffsetWires1B1[n-1]),this.ToffsetArcWires1B=W(w,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=16&&(A.push(this.ToffsetWires1B2[n-16]),A.push(this.ToffsetWires1B2[n-8]),this.ToffsetArcWires2B=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1B2[n-15]),E.push(this.ToffsetWires1B2[n-7]),this.ToffsetArcWires2B=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[n-14]),b.push(this.ToffsetWires1B2[n-6]),this.ToffsetArcWires2B=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1B2[n-13]),I.push(this.ToffsetWires1B2[n-5]),this.ToffsetArcWires2B=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires1B2[n-12]),O.push(this.ToffsetWires1B2[n-4]),this.ToffsetArcWires2B=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1B2[n-11]),B.push(this.ToffsetWires1B2[n-3]),this.ToffsetArcWires2B=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1B2[n-10]),L.push(this.ToffsetWires1B2[n-2]),this.ToffsetArcWires2B=W(L,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),F.push(this.ToffsetWires1B2[n-9]),F.push(this.ToffsetWires1B2[n-1]),this.ToffsetArcWires2B=W(F,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}debugger;if(this.ToffsetWires1C1.length>1&&this.ToffsetWires1C2.length>1){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[],A=[],E=[],b=[],I=[],O=[],B=[],L=[],F=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1C1.length>=2&&(c.push(this.ToffsetWires1C1[n-2]),c.push(this.ToffsetWires1C1[n-1]),this.ToffsetArcWires1C=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=2&&(A.push(this.ToffsetWires1C2[n-2]),A.push(this.ToffsetWires1C2[n-1]),this.ToffsetArcWires2C=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.双分裂:this.ToffsetWires1C1.length>=4&&(c.push(this.ToffsetWires1C1[n-4]),c.push(this.ToffsetWires1C1[n-2]),this.ToffsetArcWires1C=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[n-3]),h.push(this.ToffsetWires1C1[n-1]),this.ToffsetArcWires1C=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=4&&(A.push(this.ToffsetWires1C2[n-4]),A.push(this.ToffsetWires1C2[n-2]),this.ToffsetArcWires2C=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1C2[n-3]),E.push(this.ToffsetWires1C2[n-1]),this.ToffsetArcWires2C=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.四分裂:this.ToffsetWires1C1.length>=8&&(c.push(this.ToffsetWires1C1[n-8]),c.push(this.ToffsetWires1C1[n-4]),this.ToffsetArcWires1C=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[n-7]),h.push(this.ToffsetWires1C1[n-3]),this.ToffsetArcWires1C=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[n-6]),d.push(this.ToffsetWires1C1[n-2]),this.ToffsetArcWires1C=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[n-5]),p.push(this.ToffsetWires1C1[n-1]),this.ToffsetArcWires1C=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=8&&(A.push(this.ToffsetWires1C2[n-8]),A.push(this.ToffsetWires1C2[n-4]),this.ToffsetArcWires2C=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1C2[n-7]),E.push(this.ToffsetWires1C2[n-3]),this.ToffsetArcWires2C=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[n-6]),b.push(this.ToffsetWires1C2[n-2]),this.ToffsetArcWires2C=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1C2[n-5]),I.push(this.ToffsetWires1C2[n-1]),this.ToffsetArcWires2C=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.六分裂:this.ToffsetWires1C1.length>=12&&(c.push(this.ToffsetWires1C1[n-12]),c.push(this.ToffsetWires1C1[n-6]),this.ToffsetArcWires1C=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[n-11]),h.push(this.ToffsetWires1C1[n-5]),this.ToffsetArcWires1C=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[n-10]),d.push(this.ToffsetWires1C1[n-4]),this.ToffsetArcWires1C=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[n-9]),p.push(this.ToffsetWires1C1[n-3]),this.ToffsetArcWires1C=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C1[n-8]),m.push(this.ToffsetWires1C1[n-2]),this.ToffsetArcWires1C=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C1[n-7]),T.push(this.ToffsetWires1C1[n-1]),this.ToffsetArcWires1C=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=12&&(A.push(this.ToffsetWires1C2[n-12]),A.push(this.ToffsetWires1C2[n-6]),this.ToffsetArcWires2C=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1C2[n-11]),E.push(this.ToffsetWires1C2[n-5]),this.ToffsetArcWires2C=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[n-10]),b.push(this.ToffsetWires1C2[n-4]),this.ToffsetArcWires2C=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1C2[n-9]),I.push(this.ToffsetWires1C2[n-3]),this.ToffsetArcWires2C=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires1C2[n-8]),O.push(this.ToffsetWires1C2[n-2]),this.ToffsetArcWires2C=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1C2[n-7]),B.push(this.ToffsetWires1C2[n-1]),this.ToffsetArcWires2C=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.八分裂:this.ToffsetWires1C1.length>=16&&(c.push(this.ToffsetWires1C1[n-16]),c.push(this.ToffsetWires1C1[n-8]),this.ToffsetArcWires1C=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[n-15]),h.push(this.ToffsetWires1C1[n-7]),this.ToffsetArcWires1C=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[n-14]),d.push(this.ToffsetWires1C1[n-6]),this.ToffsetArcWires1C=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[n-13]),p.push(this.ToffsetWires1C1[n-5]),this.ToffsetArcWires1C=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C1[n-12]),m.push(this.ToffsetWires1C1[n-4]),this.ToffsetArcWires1C=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C1[n-11]),T.push(this.ToffsetWires1C1[n-3]),this.ToffsetArcWires1C=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires1C1[n-10]),y.push(this.ToffsetWires1C1[n-2]),this.ToffsetArcWires1C=W(y,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1C1[n-9]),w.push(this.ToffsetWires1C1[n-1]),this.ToffsetArcWires1C=W(w,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=16&&(A.push(this.ToffsetWires1C2[n-16]),A.push(this.ToffsetWires1C2[n-8]),this.ToffsetArcWires2C=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1C2[n-15]),E.push(this.ToffsetWires1C2[n-7]),this.ToffsetArcWires2C=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[n-14]),b.push(this.ToffsetWires1C2[n-6]),this.ToffsetArcWires2C=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires1C2[n-13]),I.push(this.ToffsetWires1C2[n-5]),this.ToffsetArcWires2C=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires1C2[n-12]),O.push(this.ToffsetWires1C2[n-4]),this.ToffsetArcWires2C=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1C2[n-11]),B.push(this.ToffsetWires1C2[n-3]),this.ToffsetArcWires2C=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1C2[n-10]),L.push(this.ToffsetWires1C2[n-2]),this.ToffsetArcWires2C=W(L,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),F.push(this.ToffsetWires1C2[n-9]),F.push(this.ToffsetWires1C2[n-1]),this.ToffsetArcWires2C=W(F,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2A1.length>1&&this.ToffsetWires2A2.length>1){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[],A=[],E=[],b=[],I=[],O=[],B=[],L=[],F=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires2A1.length>=2&&(c.push(this.ToffsetWires2A1[n-2]),c.push(this.ToffsetWires2A1[n-1]),this.ToffsetArcWires1A2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=2&&(A.push(this.ToffsetWires2A2[n-2]),A.push(this.ToffsetWires2A2[n-1]),this.ToffsetArcWires2A2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.双分裂:this.ToffsetWires2A1.length>=4&&(c.push(this.ToffsetWires2A1[n-4]),c.push(this.ToffsetWires2A1[n-2]),this.ToffsetArcWires1A2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[n-3]),h.push(this.ToffsetWires2A1[n-1]),this.ToffsetArcWires1A2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=4&&(A.push(this.ToffsetWires2A2[n-4]),A.push(this.ToffsetWires2A2[n-2]),this.ToffsetArcWires2A2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2A2[n-3]),E.push(this.ToffsetWires2A2[n-1]),this.ToffsetArcWires2A2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.四分裂:this.ToffsetWires2A1.length>=8&&(c.push(this.ToffsetWires2A1[n-8]),c.push(this.ToffsetWires2A1[n-4]),this.ToffsetArcWires1A2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[n-7]),h.push(this.ToffsetWires2A1[n-3]),this.ToffsetArcWires1A2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[n-6]),d.push(this.ToffsetWires2A1[n-2]),this.ToffsetArcWires1A2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[n-5]),p.push(this.ToffsetWires2A1[n-1]),this.ToffsetArcWires1A2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=8&&(A.push(this.ToffsetWires2A2[n-8]),A.push(this.ToffsetWires2A2[n-4]),this.ToffsetArcWires2A2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2A2[n-7]),E.push(this.ToffsetWires2A2[n-3]),this.ToffsetArcWires2A2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[n-6]),b.push(this.ToffsetWires2A2[n-2]),this.ToffsetArcWires2A2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2A2[n-5]),I.push(this.ToffsetWires2A2[n-1]),this.ToffsetArcWires2A2=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.六分裂:this.ToffsetWires2A1.length>=12&&(c.push(this.ToffsetWires2A1[n-12]),c.push(this.ToffsetWires2A1[n-6]),this.ToffsetArcWires1A2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[n-11]),h.push(this.ToffsetWires2A1[n-5]),this.ToffsetArcWires1A2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[n-10]),d.push(this.ToffsetWires2A1[n-4]),this.ToffsetArcWires1A2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[n-9]),p.push(this.ToffsetWires2A1[n-3]),this.ToffsetArcWires1A2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A1[n-8]),m.push(this.ToffsetWires2A1[n-2]),this.ToffsetArcWires1A2=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A1[n-7]),T.push(this.ToffsetWires2A1[n-1]),this.ToffsetArcWires1A2=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=12&&(A.push(this.ToffsetWires2A2[n-12]),A.push(this.ToffsetWires2A2[n-6]),this.ToffsetArcWires2A2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2A2[n-11]),E.push(this.ToffsetWires2A2[n-5]),this.ToffsetArcWires2A2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[n-10]),b.push(this.ToffsetWires2A2[n-4]),this.ToffsetArcWires2A2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2A2[n-9]),I.push(this.ToffsetWires2A2[n-3]),this.ToffsetArcWires2A2=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires2A2[n-8]),O.push(this.ToffsetWires2A2[n-2]),this.ToffsetArcWires2A2=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2A2[n-7]),B.push(this.ToffsetWires2A2[n-1]),this.ToffsetArcWires2A2=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.八分裂:this.ToffsetWires2A1.length>=16&&(c.push(this.ToffsetWires2A1[n-16]),c.push(this.ToffsetWires2A1[n-8]),this.ToffsetArcWires1A2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[n-15]),h.push(this.ToffsetWires2A1[n-7]),this.ToffsetArcWires1A2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[n-14]),d.push(this.ToffsetWires2A1[n-6]),this.ToffsetArcWires1A2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[n-13]),p.push(this.ToffsetWires2A1[n-5]),this.ToffsetArcWires1A2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A1[n-12]),m.push(this.ToffsetWires2A1[n-4]),this.ToffsetArcWires1A2=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A1[n-11]),T.push(this.ToffsetWires2A1[n-3]),this.ToffsetArcWires1A2=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires2A1[n-10]),y.push(this.ToffsetWires2A1[n-2]),this.ToffsetArcWires1A2=W(y,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2A1[n-9]),w.push(this.ToffsetWires2A1[n-1]),this.ToffsetArcWires1A2=W(w,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=16&&(A.push(this.ToffsetWires2A2[n-16]),A.push(this.ToffsetWires2A2[n-8]),this.ToffsetArcWires2A2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2A2[n-15]),E.push(this.ToffsetWires2A2[n-7]),this.ToffsetArcWires2A2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[n-14]),b.push(this.ToffsetWires2A2[n-6]),this.ToffsetArcWires2A2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2A2[n-13]),I.push(this.ToffsetWires2A2[n-5]),this.ToffsetArcWires2A2=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires2A2[n-12]),O.push(this.ToffsetWires2A2[n-4]),this.ToffsetArcWires2A2=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2A2[n-11]),B.push(this.ToffsetWires2A2[n-3]),this.ToffsetArcWires2A2=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2A2[n-10]),L.push(this.ToffsetWires2A2[n-2]),this.ToffsetArcWires2A2=W(L,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),F.push(this.ToffsetWires2A2[n-9]),F.push(this.ToffsetWires2A2[n-1]),this.ToffsetArcWires2A2=W(F,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2B1.length>1&&this.ToffsetWires2B2.length>1){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[],A=[],E=[],b=[],I=[],O=[],B=[],L=[],F=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires2B1.length>=2&&(c.push(this.ToffsetWires2B1[n-2]),c.push(this.ToffsetWires2B1[n-1]),this.ToffsetArcWires1B2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=2&&(A.push(this.ToffsetWires2B2[n-2]),A.push(this.ToffsetWires2B2[n-1]),this.ToffsetArcWires2B2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.双分裂:this.ToffsetWires2B1.length>=4&&(c.push(this.ToffsetWires2B1[n-4]),c.push(this.ToffsetWires2B1[n-2]),this.ToffsetArcWires1B2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[n-3]),h.push(this.ToffsetWires2B1[n-1]),this.ToffsetArcWires1B2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=4&&(A.push(this.ToffsetWires2B2[n-4]),A.push(this.ToffsetWires2B2[n-2]),this.ToffsetArcWires2B2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2B2[n-3]),E.push(this.ToffsetWires2B2[n-1]),this.ToffsetArcWires2B2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.四分裂:this.ToffsetWires2B1.length>=8&&(c.push(this.ToffsetWires2B1[n-8]),c.push(this.ToffsetWires2B1[n-4]),this.ToffsetArcWires1B2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[n-7]),h.push(this.ToffsetWires2B1[n-3]),this.ToffsetArcWires1B2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[n-6]),d.push(this.ToffsetWires2B1[n-2]),this.ToffsetArcWires1B2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[n-5]),p.push(this.ToffsetWires2B1[n-1]),this.ToffsetArcWires1B2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=8&&(A.push(this.ToffsetWires2B2[n-8]),A.push(this.ToffsetWires2B2[n-4]),this.ToffsetArcWires2B2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2B2[n-7]),E.push(this.ToffsetWires2B2[n-3]),this.ToffsetArcWires2B2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[n-6]),b.push(this.ToffsetWires2B2[n-2]),this.ToffsetArcWires2B2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2B2[n-5]),I.push(this.ToffsetWires2B2[n-1]),this.ToffsetArcWires2B2=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.六分裂:this.ToffsetWires2B1.length>=12&&(c.push(this.ToffsetWires2B1[n-12]),c.push(this.ToffsetWires2B1[n-6]),this.ToffsetArcWires1B2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[n-11]),h.push(this.ToffsetWires2B1[n-5]),this.ToffsetArcWires1B2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[n-10]),d.push(this.ToffsetWires2B1[n-4]),this.ToffsetArcWires1B2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[n-9]),p.push(this.ToffsetWires2B1[n-3]),this.ToffsetArcWires1B2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B1[n-8]),m.push(this.ToffsetWires2B1[n-2]),this.ToffsetArcWires1B2=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B1[n-7]),T.push(this.ToffsetWires2B1[n-1]),this.ToffsetArcWires1B2=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=12&&(A.push(this.ToffsetWires2B2[n-12]),A.push(this.ToffsetWires2B2[n-6]),this.ToffsetArcWires2B2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2B2[n-11]),E.push(this.ToffsetWires2B2[n-5]),this.ToffsetArcWires2B2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[n-10]),b.push(this.ToffsetWires2B2[n-4]),this.ToffsetArcWires2B2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2B2[n-9]),I.push(this.ToffsetWires2B2[n-3]),this.ToffsetArcWires2B2=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires2B2[n-8]),O.push(this.ToffsetWires2B2[n-2]),this.ToffsetArcWires2B2=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2B2[n-7]),B.push(this.ToffsetWires2B2[n-1]),this.ToffsetArcWires2B2=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.八分裂:this.ToffsetWires2B1.length>=16&&(c.push(this.ToffsetWires2B1[n-16]),c.push(this.ToffsetWires2B1[n-8]),this.ToffsetArcWires1B2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[n-15]),h.push(this.ToffsetWires2B1[n-7]),this.ToffsetArcWires1B2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[n-14]),d.push(this.ToffsetWires2B1[n-6]),this.ToffsetArcWires1B2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[n-13]),p.push(this.ToffsetWires2B1[n-5]),this.ToffsetArcWires1B2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B1[n-12]),m.push(this.ToffsetWires2B1[n-4]),this.ToffsetArcWires1B2=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B1[n-11]),T.push(this.ToffsetWires2B1[n-3]),this.ToffsetArcWires1B2=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires2B1[n-10]),y.push(this.ToffsetWires2B1[n-2]),this.ToffsetArcWires1B2=W(y,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2B1[n-9]),w.push(this.ToffsetWires2B1[n-1]),this.ToffsetArcWires1B2=W(w,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=16&&(A.push(this.ToffsetWires2B2[n-16]),A.push(this.ToffsetWires2B2[n-8]),this.ToffsetArcWires2B2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2B2[n-15]),E.push(this.ToffsetWires2B2[n-7]),this.ToffsetArcWires2B2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[n-14]),b.push(this.ToffsetWires2B2[n-6]),this.ToffsetArcWires2B2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2B2[n-13]),I.push(this.ToffsetWires2B2[n-5]),this.ToffsetArcWires2B2=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires2B2[n-12]),O.push(this.ToffsetWires2B2[n-4]),this.ToffsetArcWires2B2=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2B2[n-11]),B.push(this.ToffsetWires2B2[n-3]),this.ToffsetArcWires2B2=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2B2[n-10]),L.push(this.ToffsetWires2B2[n-2]),this.ToffsetArcWires2B2=W(L,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),F.push(this.ToffsetWires2B2[n-9]),F.push(this.ToffsetWires2B2[n-1]),this.ToffsetArcWires2B2=W(F,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2C1.length>1&&this.ToffsetWires2C2.length>1){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[],A=[],E=[],b=[],I=[],O=[],B=[],L=[],F=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires2C1.length>=2&&(c.push(this.ToffsetWires2C1[n-2]),c.push(this.ToffsetWires2C1[n-1]),this.ToffsetArcWires1C2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=2&&(A.push(this.ToffsetWires2C2[n-2]),A.push(this.ToffsetWires2C2[n-1]),this.ToffsetArcWires2C2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.双分裂:this.ToffsetWires2C1.length>=4&&(c.push(this.ToffsetWires2C1[n-4]),c.push(this.ToffsetWires2C1[n-2]),this.ToffsetArcWires1C2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[n-3]),h.push(this.ToffsetWires2C1[n-1]),this.ToffsetArcWires1C2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=4&&(A.push(this.ToffsetWires2C2[n-4]),A.push(this.ToffsetWires2C2[n-2]),this.ToffsetArcWires2C2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2C2[n-3]),E.push(this.ToffsetWires2C2[n-1]),this.ToffsetArcWires2C2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.四分裂:this.ToffsetWires2C1.length>=8&&(c.push(this.ToffsetWires2C1[n-8]),c.push(this.ToffsetWires2C1[n-4]),this.ToffsetArcWires1C2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[n-7]),h.push(this.ToffsetWires2C1[n-3]),this.ToffsetArcWires1C2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[n-6]),d.push(this.ToffsetWires2C1[n-2]),this.ToffsetArcWires1C2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[n-5]),p.push(this.ToffsetWires2C1[n-1]),this.ToffsetArcWires1C2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=8&&(A.push(this.ToffsetWires2C2[n-8]),A.push(this.ToffsetWires2C2[n-4]),this.ToffsetArcWires2C2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2C2[n-7]),E.push(this.ToffsetWires2C2[n-3]),this.ToffsetArcWires2C2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[n-6]),b.push(this.ToffsetWires2C2[n-2]),this.ToffsetArcWires2C2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2C2[n-5]),I.push(this.ToffsetWires2C2[n-1]),this.ToffsetArcWires2C2=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.六分裂:this.ToffsetWires2C1.length>=12&&(c.push(this.ToffsetWires2C1[n-12]),c.push(this.ToffsetWires2C1[n-6]),this.ToffsetArcWires1C2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[n-11]),h.push(this.ToffsetWires2C1[n-5]),this.ToffsetArcWires1C2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[n-10]),d.push(this.ToffsetWires2C1[n-4]),this.ToffsetArcWires1C2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[n-9]),p.push(this.ToffsetWires2C1[n-3]),this.ToffsetArcWires1C2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C1[n-8]),m.push(this.ToffsetWires2C1[n-2]),this.ToffsetArcWires1C2=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C1[n-7]),T.push(this.ToffsetWires2C1[n-1]),this.ToffsetArcWires1C2=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=12&&(A.push(this.ToffsetWires2C2[n-12]),A.push(this.ToffsetWires2C2[n-6]),this.ToffsetArcWires2C2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2C2[n-11]),E.push(this.ToffsetWires2C2[n-5]),this.ToffsetArcWires2C2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[n-10]),b.push(this.ToffsetWires2C2[n-4]),this.ToffsetArcWires2C2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2C2[n-9]),I.push(this.ToffsetWires2C2[n-3]),this.ToffsetArcWires2C2=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires2C2[n-8]),O.push(this.ToffsetWires2C2[n-2]),this.ToffsetArcWires2C2=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2C2[n-7]),B.push(this.ToffsetWires2C2[n-1]),this.ToffsetArcWires2C2=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.八分裂:this.ToffsetWires2C1.length>=16&&(c.push(this.ToffsetWires2C1[n-16]),c.push(this.ToffsetWires2C1[n-8]),this.ToffsetArcWires1C2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[n-15]),h.push(this.ToffsetWires2C1[n-7]),this.ToffsetArcWires1C2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[n-14]),d.push(this.ToffsetWires2C1[n-6]),this.ToffsetArcWires1C2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[n-13]),p.push(this.ToffsetWires2C1[n-5]),this.ToffsetArcWires1C2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C1[n-12]),m.push(this.ToffsetWires2C1[n-4]),this.ToffsetArcWires1C2=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C1[n-11]),T.push(this.ToffsetWires2C1[n-3]),this.ToffsetArcWires1C2=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires2C1[n-10]),y.push(this.ToffsetWires2C1[n-2]),this.ToffsetArcWires1C2=W(y,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2C1[n-9]),w.push(this.ToffsetWires2C1[n-1]),this.ToffsetArcWires1C2=W(w,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=16&&(A.push(this.ToffsetWires2C2[n-16]),A.push(this.ToffsetWires2C2[n-8]),this.ToffsetArcWires2C2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2C2[n-15]),E.push(this.ToffsetWires2C2[n-7]),this.ToffsetArcWires2C2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[n-14]),b.push(this.ToffsetWires2C2[n-6]),this.ToffsetArcWires2C2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),I.push(this.ToffsetWires2C2[n-13]),I.push(this.ToffsetWires2C2[n-5]),this.ToffsetArcWires2C2=W(I,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires2C2[n-12]),O.push(this.ToffsetWires2C2[n-4]),this.ToffsetArcWires2C2=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2C2[n-11]),B.push(this.ToffsetWires2C2[n-3]),this.ToffsetArcWires2C2=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2C2[n-10]),L.push(this.ToffsetWires2C2[n-2]),this.ToffsetArcWires2C2=W(L,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),F.push(this.ToffsetWires2C2[n-9]),F.push(this.ToffsetWires2C2[n-1]),this.ToffsetArcWires2C2=W(F,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}}else switch(this.LineInfo.Wairnum){case $.单分裂:t=t+1;break;case $.双分裂:t=t+2;break;case $.四分裂:t=t+4;break;case $.六分裂:t=t+6;break;case $.八分裂:t=t+8;break}})}loadLineModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.add(this.dataSource2),this.viewer.entities.show)}LineSpriteLineinit(){ne._materialCache.addMaterial("SpriteLineMaterialType",{fabric:{type:"SpriteLineMaterialType",uniforms:{color:new D(1,1,0,1),speed:2},source:`
6584
+ `,px=Re.SHOW_INDEX,sf=Re.POSITION_INDEX,m0=Re.COLOR_INDEX,mx=Re.OUTLINE_COLOR_INDEX,_x=Re.OUTLINE_WIDTH_INDEX,gx=Re.PIXEL_SIZE_INDEX,_0=Re.SCALE_BY_DISTANCE_INDEX,g0=Re.TRANSLUCENCY_BY_DISTANCE_INDEX,T0=Re.DISTANCE_DISPLAY_CONDITION_INDEX,Tx=Re.DISABLE_DEPTH_DISTANCE_INDEX,yx=Re.SPLIT_DIRECTION_INDEX,rf=Re.NUMBER_OF_PROPERTIES,tn={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function An(e){e=g(e,g.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(rf),this._maxPixelSize=1,this._baseVolume=new te,this._baseVolumeWC=new te,this._baseVolume2D=new te,this._boundingVolume=new te,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=g(e.show,!0),this.modelMatrix=k.clone(g(e.modelMatrix,k.IDENTITY)),this._modelMatrix=k.clone(k.IDENTITY),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.blendOption=g(e.blendOption,_t.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ye.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW,We.STATIC_DRAW];const t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(An.prototype,{length:{get:function(){return af(this),this._pointPrimitives.length}}});function y0(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}An.prototype.add=function(e){const t=new Re(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},An.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},An.prototype.removeAll=function(){y0(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function af(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;const t=[],n=e._pointPrimitives,i=n.length;for(let o=0,a=0;o<i;++o){const r=n[o];r&&(r._index=a++,t.push(r))}e._pointPrimitives=t}}An.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},An.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this},An.prototype.get=function(e){if(!l(e))throw new C("index is required.");return af(this),this._pointPrimitives[e]},An.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<rf;++i){const o=n[i]===0?We.STATIC_DRAW:We.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function Cx(e,t,n){return new Dt(e,[{index:tn.positionHighAndSize,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[sf]},{index:tn.positionLowAndShow,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[sf]},{index:tn.compressedAttribute0,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[m0]},{index:tn.compressedAttribute1,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[g0]},{index:tn.scaleByDistance,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[_0]},{index:tn.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:he.FLOAT,usage:n[T0]}],t)}const cf=new Qe;function C0(e,t,n,i){const o=i._index,a=i._getActualPosition();e._mode===ye.SCENE3D&&(te.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),Qe.fromCartesian(a,cf);const r=i.pixelSize,f=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,r+f);const c=n[tn.positionHighAndSize],h=cf.high;c(o,h.x,h.y,h.z,r);const d=n[tn.positionLowAndOutline],p=cf.low;d(o,p.x,p.y,p.z,f)}const Wa=65536,or=256;function w0(e,t,n,i){const o=i._index,a=i.color,r=i.getPickId(t).color,f=i.outlineColor;let c=I.floatToByte(a.red),h=I.floatToByte(a.green),d=I.floatToByte(a.blue);const p=c*Wa+h*or+d;c=I.floatToByte(f.red),h=I.floatToByte(f.green),d=I.floatToByte(f.blue);const m=c*Wa+h*or+d;c=I.floatToByte(r.red),h=I.floatToByte(r.green),d=I.floatToByte(r.blue);const T=c*Wa+h*or+d,y=I.floatToByte(a.alpha)*Wa+I.floatToByte(f.alpha)*or+I.floatToByte(r.alpha),w=n[tn.compressedAttribute0];w(o,p,m,T,y)}function A0(e,t,n,i){const o=i._index;let a=0,r=1,f=1,c=1;const h=i.translucencyByDistance;l(h)&&(a=h.near,r=h.nearValue,f=h.far,c=h.farValue,(r!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let d=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(d=!1),r=S.clamp(r,0,1),r=r===1?255:r*255|0;const p=(d?1:0)*or+r;c=S.clamp(c,0,1),c=c===1?255:c*255|0;const m=c,T=n[tn.compressedAttribute1];T(o,p,m,a,f)}function E0(e,t,n,i){const o=i._index,a=n[tn.scaleByDistance];let r=0,f=1,c=1,h=1;const d=i.scaleByDistance;l(d)&&(r=d.near,f=d.nearValue,c=d.far,h=d.farValue,(f!==1||h!==1)&&(e._shaderScaleByDistance=!0)),a(o,r,f,c,h)}function b0(e,t,n,i){const o=i._index,a=n[tn.distanceDisplayConditionAndDisableDepthAndSplitDirection];let r=0,f=Number.MAX_VALUE;const c=i.distanceDisplayCondition;l(c)&&(r=c.near,f=c.far,r*=r,f*=f,e._shaderDistanceDisplayCondition=!0);let h=i.disableDepthTestDistance;h*=h,h>0&&(e._shaderDisableDepthDistance=!0,h===Number.POSITIVE_INFINITY&&(h=-1));let d=0;const p=i.splitDirection;l(p)&&(d=p),a(o,r,f,h,d)}function wx(e,t,n,i){C0(e,t,n,i),w0(e,t,n,i),A0(e,t,n,i),E0(e,t,n,i),b0(e,t,n,i)}function hf(e,t,n,i,o,a){let r;i.mode===ye.SCENE3D?(r=e._baseVolume,e._boundingVolumeDirty=!0):r=e._baseVolume2D;const f=[];for(let c=0;c<n;++c){const h=t[c],d=h.position,p=Re._computeActualPosition(d,i,o);l(p)&&(h._setActualPosition(p),a?f.push(p):te.expand(r,p,r))}a&&te.fromPoints(f,r)}function Ax(e,t){const n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,a=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ye.SCENE3D&&!k.equals(a,e.modelMatrix)?(e._mode=n,k.clone(e.modelMatrix,a),e._createVertexArray=!0,(n===ye.SCENE3D||n===ye.SCENE2D||n===ye.COLUMBUS_VIEW)&&hf(e,i,i.length,t,a,!0)):n===ye.MORPHING?hf(e,i,i.length,t,a,!0):(n===ye.SCENE2D||n===ye.COLUMBUS_VIEW)&&hf(e,o,e._pointPrimitivesToUpdateIndex,t,a,!1)}function Ex(e,t,n){const o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}const bx=[];An.prototype.update=function(e){if(af(this),!this.show)return;this._maxTotalPointSize=xe.maximumAliasedPointSize,Ax(this,e);const n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,a=this._propertiesChanged,r=this._createVertexArray;let f;const c=e.context,h=e.passes,d=h.pick;if(r||!d&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let B=0;B<rf;++B)a[B]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=Cx(c,n,this._buffersUsage),f=this._vaf.writers;for(let B=0;B<n;++B){const L=this._pointPrimitives[B];L._dirty=!1,wx(this,c,f,L)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){const B=bx;B.length=0,(a[sf]||a[_x]||a[gx])&&B.push(C0),(a[m0]||a[mx])&&B.push(w0),(a[px]||a[g0])&&B.push(A0),a[_0]&&B.push(E0),(a[T0]||a[Tx]||a[yx])&&B.push(b0);const L=B.length;if(f=this._vaf.writers,o/n>.1){for(let F=0;F<o;++F){const N=i[F];N._dirty=!1;for(let U=0;U<L;++U)B[U](this,c,f,N)}this._vaf.commit()}else{for(let F=0;F<o;++F){const N=i[F];N._dirty=!1;for(let U=0;U<L;++U)B[U](this,c,f,N);this._vaf.subCommit(N._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,te.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let p,m=k.IDENTITY;e.mode===ye.SCENE3D?(m=this.modelMatrix,p=te.clone(this._baseVolumeWC,this._boundingVolume)):p=te.clone(this._baseVolume2D,this._boundingVolume),Ex(this,e,p);const T=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,T&&(this._blendOption===_t.OPAQUE||this._blendOption===_t.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=je.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===_t.TRANSLUCENT||this._blendOption===_t.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=je.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!1,blending:ro.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let y,w;(T||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(y=new Ae({sources:[dx]}),this._shaderScaleByDistance&&y.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&y.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&y.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&y.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===_t.OPAQUE_AND_TRANSLUCENT&&(w=new Ae({defines:["OPAQUE"],sources:[va]}),this._sp=lt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:y,fragmentShaderSource:w,attributeLocations:tn}),w=new Ae({defines:["TRANSLUCENT"],sources:[va]}),this._spTranslucent=lt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:y,fragmentShaderSource:w,attributeLocations:tn})),this._blendOption===_t.OPAQUE&&(w=new Ae({sources:[va]}),this._sp=lt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:y,fragmentShaderSource:w,attributeLocations:tn})),this._blendOption===_t.TRANSLUCENT&&(w=new Ae({sources:[va]}),this._spTranslucent=lt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:y,fragmentShaderSource:w,attributeLocations:tn})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let A,E,b,D;const O=e.commandList;if(h.render||d){const B=this._colorCommands,L=this._blendOption===_t.OPAQUE,F=this._blendOption===_t.OPAQUE_AND_TRANSLUCENT;A=this._vaf.va,E=A.length,B.length=E;const N=F?E*2:E;for(D=0;D<N;++D){const U=L||F&&D%2===0;b=B[D],l(b)||(b=B[D]=new et),b.primitiveType=Xe.POINTS,b.pass=U||!F?Nt.OPAQUE:Nt.TRANSLUCENT,b.owner=this;const M=F?Math.floor(D/2):D;b.boundingVolume=p,b.modelMatrix=m,b.shaderProgram=U?this._sp:this._spTranslucent,b.uniformMap=this._uniforms,b.vertexArray=A[M].va,b.renderState=U?this._rsOpaque:this._rsTranslucent,b.debugShowBoundingVolume=this.debugShowBoundingVolume,b.pickId="v_pickColor",O.push(b)}}},An.prototype.isDestroyed=function(){return!1},An.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),y0(this._pointPrimitives),st(this)};const x0=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ff=1,sr=8;class lf{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=i>>4;if(o!==ff)throw new Error(`Got v${o} data when expected v${ff}.`);const a=x0[i&15];if(!a)throw new Error("Unrecognized array type.");const[r]=new Uint16Array(t,2,1),[f]=new Uint32Array(t,4,1);return new lf(f,r,a,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const a=x0.indexOf(this.ArrayType),r=t*2*this.ArrayType.BYTES_PER_ELEMENT,f=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-f%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,sr,t),this.coords=new this.ArrayType(this.data,sr+f+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(sr+r+f+c),this.ids=new this.IndexArrayType(this.data,sr,t),this.coords=new this.ArrayType(this.data,sr+f+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(ff<<4)+a]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return uf(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:r,nodeSize:f}=this,c=[0,a.length-1,0],h=[];for(;c.length;){const d=c.pop()||0,p=c.pop()||0,m=c.pop()||0;if(p-m<=f){for(let A=m;A<=p;A++){const E=r[2*A],b=r[2*A+1];E>=t&&E<=i&&b>=n&&b<=o&&h.push(a[A])}continue}const T=m+p>>1,y=r[2*T],w=r[2*T+1];y>=t&&y<=i&&w>=n&&w<=o&&h.push(a[T]),(d===0?t<=y:n<=w)&&(c.push(m),c.push(T-1),c.push(1-d)),(d===0?i>=y:o>=w)&&(c.push(T+1),c.push(p),c.push(1-d))}return h}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:a,nodeSize:r}=this,f=[0,o.length-1,0],c=[],h=i*i;for(;f.length;){const d=f.pop()||0,p=f.pop()||0,m=f.pop()||0;if(p-m<=r){for(let A=m;A<=p;A++)I0(a[2*A],a[2*A+1],t,n)<=h&&c.push(o[A]);continue}const T=m+p>>1,y=a[2*T],w=a[2*T+1];I0(y,w,t,n)<=h&&c.push(o[T]),(d===0?t-i<=y:n-i<=w)&&(f.push(m),f.push(T-1),f.push(1-d)),(d===0?t+i>=y:n+i>=w)&&(f.push(T+1),f.push(p),f.push(1-d))}return c}}function uf(e,t,n,i,o,a){if(o-i<=n)return;const r=i+o>>1;S0(e,t,r,i,o,a),uf(e,t,n,i,r-1,1-a),uf(e,t,n,r+1,o,1-a)}function S0(e,t,n,i,o,a){for(;o>i;){if(o-i>600){const h=o-i+1,d=n-i+1,p=Math.log(h),m=.5*Math.exp(2*p/3),T=.5*Math.sqrt(p*m*(h-m)/h)*(d-h/2<0?-1:1),y=Math.max(i,Math.floor(n-d*m/h+T)),w=Math.min(o,Math.floor(n+(h-d)*m/h+T));S0(e,t,n,y,w,a)}const r=t[2*n+a];let f=i,c=o;for(rr(e,t,i,n),t[2*o+a]>r&&rr(e,t,i,o);f<c;){for(rr(e,t,f,c),f++,c--;t[2*f+a]<r;)f++;for(;t[2*c+a]>r;)c--}t[2*i+a]===r?rr(e,t,i,c):(c++,rr(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function rr(e,t,n,i){df(e,n,i),df(t,2*n,2*i),df(t,2*n+1,2*i+1)}function df(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function I0(e,t,n,i){const o=e-n,a=t-i;return o*o+a*a}function Hn(e){e=g(e,g.EMPTY_OBJECT),this._enabled=g(e.enabled,!1),this._pixelRange=g(e.pixelRange,80),this._minimumClusterSize=g(e.minimumClusterSize,2),this._clusterBillboards=g(e.clusterBillboards,!0),this._clusterLabels=g(e.clusterLabels,!0),this._clusterPoints=g(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new Ne,this.show=g(e.show,!0)}function D0(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}const xx=new be;function O0(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=Gn.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=me.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Re.getScreenSpaceBoundingBox(e,t,o)),D0(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&W0(i,e.id.id)&&l(e.id._label)){const a=i._collectionIndicesByEntity[e.id.id].labelIndex,r=i._labelCollection.get(a),f=Gn.getScreenSpaceBoundingBox(r,t,xx);D0(f,n),o=be.union(o,f,o)}return o}function Sx(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&W0(t,e.id.id)&&l(e.id._label)){const n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function v0(e,t,n,i){const o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function W0(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function pf(e,t,n,i,o){if(!l(e))return;const a=e.length;for(let r=0;r<a;++r){const f=e.get(r);if(f.clusterShow=!1,!f.show||o._scene.mode===ye.SCENE3D&&!i.isPointVisible(f.position))continue;const c=o._clusterLabels&&l(f._labelCollection),h=o._clusterBillboards&&l(f.id._billboard),d=o._clusterPoints&&l(f.id._point);if(c&&(d||h))continue;const p=f.computeScreenSpacePosition(n);l(p)&&t.push({index:r,collection:e,clustered:!1,coord:p})}}const Ix=new be,Dx=new be,Ox=new be;function vx(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;const n=e._scene,i=e._labelCollection,o=e._billboardCollection,a=e._pointCollection;if(!l(i)&&!l(o)&&!l(a)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let r=e._clusterLabelCollection,f=e._clusterBillboardCollection,c=e._clusterPointCollection;l(r)?r.removeAll():r=e._clusterLabelCollection=new qn({scene:n}),l(f)?f.removeAll():f=e._clusterBillboardCollection=new rn({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new An;const h=e._pixelRange,d=e._minimumClusterSize,p=e._previousClusters,m=[],T=e._previousHeight,y=n.camera.positionCartographic.height,w=n.ellipsoid,A=n.camera.positionWC,E=new ui(w,A),b=[];e._clusterLabels&&pf(i,b,n,E,e),e._clusterBillboards&&pf(o,b,n,E,e),e._clusterPoints&&pf(a,b,n,E,e);let D,O,B,L,F,N,U,M,j,Y,s,x;if(b.length>0){const P=new lf(b.length,64,Uint32Array);for(let z=0;z<b.length;++z)P.add(b[z].coord.x,b[z].coord.y);if(P.finish(),y<T)for(B=p.length,D=0;D<B;++D){const z=p[D];if(!E.isPointVisible(z.position))continue;const H=me._computeScreenSpacePosition(k.IDENTITY,z.position,u.ZERO,q.ZERO,n);if(!l(H))continue;const X=1-y/T;let ee=z.width=z.width*X,K=z.height=z.height*X;ee=Math.max(ee,z.minimumWidth),K=Math.max(K,z.minimumHeight);const ce=H.x-ee*.5,le=H.y-K*.5,we=H.x+ee,Se=H.y+K;for(F=P.range(ce,le,we,Se),N=F.length,Y=0,j=[],O=0;O<N;++O)U=F[O],M=b[U],M.clustered||(++Y,s=M.collection,x=M.index,j.push(s.get(x).id));if(Y>=d)for(v0(z.position,Y,j,e),m.push(z),O=0;O<N;++O)b[F[O]].clustered=!0}for(B=b.length,D=0;D<B;++D){const z=b[D];if(z.clustered)continue;z.clustered=!0,s=z.collection,x=z.index;const H=s.get(x);L=O0(H,z.coord,h,e,Ix);const X=be.clone(L,Dx);F=P.range(L.x,L.y,L.x+L.width,L.y+L.height),N=F.length;const ee=u.clone(H.position);for(Y=1,j=[H.id],O=0;O<N;++O)if(U=F[O],M=b[U],!M.clustered){const K=M.collection.get(M.index),ce=O0(K,M.coord,h,e,Ox);u.add(K.position,ee,ee),be.union(X,ce,X),++Y,j.push(K.id)}if(Y>=d){const K=u.multiplyByScalar(ee,1/Y,ee);for(v0(K,Y,j,e),m.push({position:K,width:X.width,height:X.height,minimumWidth:L.width,minimumHeight:L.height}),O=0;O<N;++O)b[F[O]].clustered=!0}else Sx(H,e)}}r.length===0&&(r.destroy(),e._clusterLabelCollection=void 0),f.length===0&&(f.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=m,e._previousHeight=y}}Hn.prototype._initialize=function(e){this._scene=e;const t=vx(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},Object.defineProperties(Hn.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function mf(e,t,n,i){return function(o){let a=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let r=this._collectionIndicesByEntity[o.id];if(l(r)||(r=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(a)&&l(r[i]))return a.get(r[i]);l(a)||(a=this[e]=new t({scene:this._scene}));let f,c;const h=this[n];h.length>0?(f=h.shift(),c=a.get(f)):(c=a.add(),f=a.length-1),r[i]=f;const d=this;return Promise.resolve().then(function(){d._clusterDirty=!0}),c}}function _f(e,t){const n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Hn.prototype.getLabel=mf("_labelCollection",qn,"_unusedLabelIndices","labelIndex"),Hn.prototype.removeLabel=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;const n=t.labelIndex;t.labelIndex=void 0,_f(this,e.id);const i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0},Hn.prototype.getBillboard=mf("_billboardCollection",rn,"_unusedBillboardIndices","billboardIndex"),Hn.prototype.removeBillboard=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;const n=t.billboardIndex;t.billboardIndex=void 0,_f(this,e.id);const i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0},Hn.prototype.getPoint=mf("_pointCollection",An,"_unusedPointIndices","pointIndex"),Hn.prototype.removePoint=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;const n=t.pointIndex;t.pointIndex=void 0,_f(this,e.id);const i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function gf(e){if(!l(e))return;const t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function Wx(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,gf(e._labelCollection),gf(e._billboardCollection),gf(e._pointCollection))}Hn.prototype.update=function(e){if(!this.show)return;let t;l(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,Wx(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)},Hn.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};function Ko(e){this._name=e,this._clock=void 0,this._changed=new Ne,this._error=new Ne,this._isLoading=!1,this._loading=new Ne,this._entityCollection=new en(this),this._entityCluster=new Hn}Object.defineProperties(Ko.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Da.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!l(e))throw new C("value must be defined.");this._entityCluster=e}}}),Ko.prototype.update=function(e){return!0};function v(e,t,n=10,i="#ba1919"){return{name:t,label:{text:t,font:"18px sans-serif"},polyline:{show:!0,positions:e,clampToGround:!1,width:n,material:I.fromCssColorString(i),arcType:ai.NONE,shadows:pa.DISABLED}}}function go(e,t,n,i,o=new He(0,0,0),a=1){return{id:e,name:n,position:t,orientation:Ce.headingPitchRollQuaternion(t,o),model:{show:!0,uri:i,scale:a,heightReference:ii.NONE}}}function Pa(e,t,n,i={}){const{pointColor:o=I.YELLOW,pointSize:a=12,labelColor:r=I.WHITE,fontSize:f=16,pixelOffset:c=[0,-20],heightReference:h=ii.NONE}=i;return e.entities.add({position:t,point:{color:o,pixelSize:a,heightReference:h,distanceDisplayCondition:new it(0,1e4)},label:{text:n,font:`${f}px sans-serif`,fillColor:r,pixelOffset:new q(...c),style:li.FILL_AND_OUTLINE,outlineWidth:2,outlineColor:I.BLACK,heightReference:h,distanceDisplayCondition:new it(0,1e4)}})}function Q(e,t,n,i,o){n||(n=new He);const a=Ce.headingPitchRollQuaternion(e,n,i,o),r=k.fromRotationTranslation(G.fromQuaternion(a,new G),e,new k);return k.multiplyByPoint(r,t,new u)}function W(e,t=4){const n=[];for(var i=0;i<e.length-1;i++)n.push(...Px(e[i],e[i+1],t*-1e3,100));return n}function Px(e,t,n,i){var o=[],a=oe.fromCartesian(e),r=oe.fromCartesian(t),f=a.longitude*180/Math.PI,c=a.latitude*180/Math.PI,h=r.longitude*180/Math.PI,d=r.latitude*180/Math.PI,p=Math.sqrt((f-h)*(f-h)+(c-d)*(c-d)),m=p*n,T=u.clone(e),y=u.clone(t),w=u.distance(T,u.ZERO),A=u.distance(y,u.ZERO);if(u.normalize(T,T),u.normalize(y,y),u.distance(T,y)==0)return o;var E=u.angleBetween(T,y);o.push(e);for(var b=1;b<i-1;b++){var D=b*1/(i-1),O=1-D,B=Math.sin(O*E)/Math.sin(E),L=Math.sin(D*E)/Math.sin(E),F=u.multiplyByScalar(T,B,new u),N=u.multiplyByScalar(y,L,new u),U=u.add(F,N,new u),M=D*Math.PI,j=w*O+A*D+Math.sin(M)*m;U=u.multiplyByScalar(U,j,U),o.push(U)}return o.push(t),o}class Bx{constructor(){se(this,"LineID","myEntity1");se(this,"Tag","");se(this,"towers",[]);se(this,"ISPhaseSequence",!1);se(this,"Wairnum",0);se(this,"Type",0);se(this,"wireAColor","#FFFFFF");se(this,"wireBColor","#FFFFFF");se(this,"wireCColor","#FFFFFF");se(this,"wireTColor","#FFFFFF");se(this,"wireD1Color","#FFFFFF");se(this,"wireD2Color","#FFFFFF");se(this,"wireWidth",1)}}class Rx{constructor(){se(this,"id","");se(this,"name","");se(this,"type",0);se(this,"Longitude",0);se(this,"Latitude",0);se(this,"Altitude",0);se(this,"RollX",0);se(this,"RollY",90);se(this,"RollZ",0);se(this,"towerScale",1);se(this,"towerHeight",42);se(this,"towerModelUri","");se(this,"towerPoint",[]);se(this,"Insulators",[])}}class zx{constructor(){se(this,"id","");se(this,"name","");se(this,"type",0);se(this,"WairFX","进");se(this,"linenum",1);se(this,"Wairnum",0);se(this,"PhaseSequence",0);se(this,"RollX",90);se(this,"RollY",0);se(this,"RollZ",0);se(this,"InsulatorScale",1);se(this,"InsulatorLength",0);se(this,"InsulatorModelUri","");se(this,"InsulatorPoint",[])}}class Lx{constructor(){se(this,"name","");se(this,"X",-45);se(this,"Y",90);se(this,"Z",0)}}var nn=(e=>(e[e.A相=0]="A相",e[e.B相=1]="B相",e[e.C相=2]="C相",e[e.地线1=3]="地线1",e[e.地线2=4]="地线2",e))(nn||{}),$i=(e=>(e[e.直线塔=0]="直线塔",e[e.耐张塔=1]="耐张塔",e[e.门架塔=2]="门架塔",e[e.换位塔=3]="换位塔",e))($i||{}),P0=(e=>(e[e.交流单回路=0]="交流单回路",e[e.交流双回路=1]="交流双回路",e[e.直流单回路=2]="直流单回路",e[e.直流双回路=3]="直流双回路",e[e.交流四回路=4]="交流四回路",e))(P0||{}),ar=(e=>(e[e.地线=0]="地线",e[e.回路一=1]="回路一",e[e.回路二=2]="回路二",e[e.回路三=3]="回路三",e[e.回路四=4]="回路四",e))(ar||{}),Ht=(e=>(e[e.悬垂串=0]="悬垂串",e[e.耐张串=1]="耐张串",e[e.跳线串=2]="跳线串",e[e.硬跳串=3]="硬跳串",e[e.V串=4]="V串",e[e.地线串=5]="地线串",e[e.绕跳临时=6]="绕跳临时",e))(Ht||{}),$=(e=>(e[e.单分裂=0]="单分裂",e[e.双分裂=1]="双分裂",e[e.四分裂=2]="四分裂",e[e.六分裂=3]="六分裂",e[e.八分裂=4]="八分裂",e))($||{});class Nx{constructor(t,n,i){se(this,"viewer");se(this,"LineInfo");se(this,"Keym","");se(this,"dataSource2");se(this,"entityCollection2");se(this,"LinedataSource2");se(this,"LineentityCollection2");se(this,"offsetTowers",[]);se(this,"offsetWires11",[]);se(this,"offsetWires12",[]);se(this,"offsetWires13",[]);se(this,"offsetWires21",[]);se(this,"offsetWires22",[]);se(this,"offsetWires23",[]);se(this,"ToffsetArcWires1A",[]);se(this,"ToffsetArcWires2A",[]);se(this,"ToffsetWires1A1",[]);se(this,"ToffsetWires1A2",[]);se(this,"ToffsetArcWires1B",[]);se(this,"ToffsetArcWires2B",[]);se(this,"ToffsetWires1B1",[]);se(this,"ToffsetWires1B2",[]);se(this,"ToffsetArcWires1C",[]);se(this,"ToffsetArcWires2C",[]);se(this,"ToffsetWires1C1",[]);se(this,"ToffsetWires1C2",[]);se(this,"ToffsetArcWires1A2",[]);se(this,"ToffsetArcWires2A2",[]);se(this,"ToffsetWires2A1",[]);se(this,"ToffsetWires2A2",[]);se(this,"ToffsetArcWires1B2",[]);se(this,"ToffsetArcWires2B2",[]);se(this,"ToffsetWires2B1",[]);se(this,"ToffsetWires2B2",[]);se(this,"ToffsetArcWires1C2",[]);se(this,"ToffsetArcWires2C2",[]);se(this,"ToffsetWires2C1",[]);se(this,"ToffsetWires2C2",[]);se(this,"offsetArcWires1A",[]);se(this,"offsetArcWires1B",[]);se(this,"offsetArcWires1C",[]);se(this,"offsetArcWires2A",[]);se(this,"offsetArcWires2B",[]);se(this,"offsetArcWires2C",[]);se(this,"offsetGrouundWires1",[]);se(this,"offsetGrouundWires2",[]);se(this,"offsetGrouundWires11",[]);se(this,"offsetGrouundWires12",[]);this.Keym=i,this.viewer=t,this.LineInfo=n,this.dataSource2=new Ko(this.LineInfo.LineID),this.entityCollection2=this.dataSource2.entities,this.LinedataSource2=new Ko(this.LineInfo.LineID+"daoxian"),this.LineentityCollection2=this.dataSource2.entities}loadLineTower(){if(this.Keym!="OW_JPS_EEngin_001")return;debugger;this.LineInfo.towers.forEach(i=>{this.offsetTowers.push(u.fromDegrees(i.Longitude,i.Latitude,i.Altitude))});let t=0,n=0;this.offsetTowers.forEach((i,o)=>{const a=new He(S.toRadians(this.LineInfo.towers[o].RollX),S.toRadians(this.LineInfo.towers[o].RollY),S.toRadians(this.LineInfo.towers[o].RollZ));this.entityCollection2.add(go(this.LineInfo.towers[o].id,i,this.LineInfo.towers[o].name,this.LineInfo.towers[o].towerModelUri,a,this.LineInfo.towers[o].towerScale));let r=new He(S.toRadians(this.LineInfo.towers[o].RollX),0,0),f=0;this.LineInfo.towers[o].Insulators.forEach(c=>{if(this.LineInfo.towers[o].type==$i.耐张塔)switch(c.type){case Ht.耐张串:let d=new He(S.toRadians(this.LineInfo.towers[o].RollX),0,0);if(c.WairFX=="进"){const w=new He(S.toRadians(c.RollX),S.toRadians(-90),S.toRadians(180)),A=Q(i,new u(this.LineInfo.towers[o].towerPoint[f].X,this.LineInfo.towers[o].towerPoint[f].Y,this.LineInfo.towers[o].towerPoint[f].Z),d);this.entityCollection2.add(go(c.id,A,c.name,c.InsulatorModelUri,w,c.InsulatorScale))}else{const w=new He(S.toRadians(c.RollX),S.toRadians(-90),S.toRadians(0)),A=Q(i,new u(this.LineInfo.towers[o].towerPoint[f].X,this.LineInfo.towers[o].towerPoint[f].Y,this.LineInfo.towers[o].towerPoint[f].Z),d);this.entityCollection2.add(go(c.id,A,c.name,c.InsulatorModelUri,w,c.InsulatorScale))}break;case Ht.跳线串:const p=new He(S.toRadians(c.RollX),S.toRadians(c.RollY),S.toRadians(c.RollZ)),m=Q(i,new u(this.LineInfo.towers[o].towerPoint[f].X,this.LineInfo.towers[o].towerPoint[f].Y,this.LineInfo.towers[o].towerPoint[f].Z),r);this.entityCollection2.add(go(c.id,m,c.name,c.InsulatorModelUri,p,c.InsulatorScale));break;case Ht.地线串:const T=new He(S.toRadians(c.RollX),S.toRadians(c.RollY),S.toRadians(c.RollZ)),y=Q(i,new u(this.LineInfo.towers[o].towerPoint[f].X,this.LineInfo.towers[o].towerPoint[f].Y,this.LineInfo.towers[o].towerPoint[f].Z),r);this.entityCollection2.add(go(c.id,y,c.name,c.InsulatorModelUri,T,c.InsulatorScale));break}else{const d=new He(S.toRadians(c.RollX),S.toRadians(c.RollY),S.toRadians(c.RollZ)),p=Q(i,new u(this.LineInfo.towers[o].towerPoint[f].X,this.LineInfo.towers[o].towerPoint[f].Y,this.LineInfo.towers[o].towerPoint[f].Z),r);this.entityCollection2.add(go(c.id,p,c.name,c.InsulatorModelUri,d,c.InsulatorScale))}const h=[];switch(c.InsulatorPoint.forEach(d=>{h.push(Q(i,new u(d.X,d.Y,d.Z),r))}),c.linenum){case ar.回路一:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[o].type==$i.耐张塔)switch(c.PhaseSequence){case nn.A相:if(c.type==Ht.耐张串)if(c.WairFX=="进")switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires11.push(h[0]),this.ToffsetWires1A1.push(h[0]);break;case $.双分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]);break;case $.四分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]);break;case $.六分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.offsetWires11.push(h[4]),this.offsetWires11.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]),this.ToffsetWires1A1.push(h[8]),this.ToffsetWires1A1.push(h[9]),this.ToffsetWires1A1.push(h[10]),this.ToffsetWires1A1.push(h[11]);break;case $.八分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.offsetWires11.push(h[4]),this.offsetWires11.push(h[5]),this.offsetWires11.push(h[6]),this.offsetWires11.push(h[7]),this.ToffsetWires1A1.push(h[8]),this.ToffsetWires1A1.push(h[9]),this.ToffsetWires1A1.push(h[10]),this.ToffsetWires1A1.push(h[11]),this.ToffsetWires1A1.push(h[12]),this.ToffsetWires1A1.push(h[13]),this.ToffsetWires1A1.push(h[14]),this.ToffsetWires1A1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires11.push(d),this.ToffsetWires1A2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires11.push(p),this.offsetWires11.push(m),this.ToffsetWires1A2.push(p),this.ToffsetWires1A2.push(m);break;case $.四分裂:const T=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),y=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),w=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),A=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r);this.offsetWires11.push(T),this.offsetWires11.push(y),this.offsetWires11.push(w),this.offsetWires11.push(A),this.ToffsetWires1A2.push(T),this.ToffsetWires1A2.push(y),this.ToffsetWires1A2.push(w),this.ToffsetWires1A2.push(A);break;case $.六分裂:const E=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),b=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),D=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),O=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),B=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),L=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r);this.offsetWires11.push(E),this.offsetWires11.push(b),this.offsetWires11.push(D),this.offsetWires11.push(O),this.offsetWires11.push(B),this.offsetWires11.push(L),this.ToffsetWires1A2.push(E),this.ToffsetWires1A2.push(b),this.ToffsetWires1A2.push(D),this.ToffsetWires1A2.push(O),this.ToffsetWires1A2.push(B),this.ToffsetWires1A2.push(L);break;case $.八分裂:const F=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),N=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),U=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),M=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),j=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),Y=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r),s=Q(i,new u(c.InsulatorPoint[6].X*-1,c.InsulatorPoint[6].Y,c.InsulatorPoint[6].Z),r),x=Q(i,new u(c.InsulatorPoint[7].X*-1,c.InsulatorPoint[7].Y,c.InsulatorPoint[7].Z),r);this.offsetWires11.push(F),this.offsetWires11.push(N),this.offsetWires11.push(U),this.offsetWires11.push(M),this.offsetWires11.push(j),this.offsetWires11.push(Y),this.offsetWires11.push(s),this.offsetWires11.push(x),this.ToffsetWires1A2.push(F),this.ToffsetWires1A2.push(N),this.ToffsetWires1A2.push(U),this.ToffsetWires1A2.push(M),this.ToffsetWires1A2.push(j),this.ToffsetWires1A2.push(Y),this.ToffsetWires1A2.push(s),this.ToffsetWires1A2.push(x);break}else if(c.type==Ht.跳线串)switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A2.push(h[0]);break;case $.双分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A2.push(h[2]),this.ToffsetWires1A2.push(h[3]);break;case $.四分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A2.push(h[4]),this.ToffsetWires1A2.push(h[5]),this.ToffsetWires1A2.push(h[6]),this.ToffsetWires1A2.push(h[7]);break;case $.六分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A2.push(h[6]),this.ToffsetWires1A2.push(h[7]),this.ToffsetWires1A2.push(h[8]),this.ToffsetWires1A2.push(h[9]),this.ToffsetWires1A2.push(h[10]),this.ToffsetWires1A2.push(h[11]);break;case $.八分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]),this.ToffsetWires1A2.push(h[8]),this.ToffsetWires1A2.push(h[9]),this.ToffsetWires1A2.push(h[10]),this.ToffsetWires1A2.push(h[11]),this.ToffsetWires1A2.push(h[12]),this.ToffsetWires1A2.push(h[13]),this.ToffsetWires1A2.push(h[14]),this.ToffsetWires1A2.push(h[15]);break}break;case nn.B相:if(c.type==Ht.耐张串)if(c.WairFX=="进")switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires12.push(h[0]),this.ToffsetWires1B1.push(h[0]);break;case $.双分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]);break;case $.四分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]);break;case $.六分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.offsetWires12.push(h[4]),this.offsetWires12.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]),this.ToffsetWires1B1.push(h[8]),this.ToffsetWires1B1.push(h[9]),this.ToffsetWires1B1.push(h[10]),this.ToffsetWires1B1.push(h[11]);break;case $.八分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.offsetWires12.push(h[4]),this.offsetWires12.push(h[5]),this.offsetWires12.push(h[6]),this.offsetWires12.push(h[7]),this.ToffsetWires1B1.push(h[8]),this.ToffsetWires1B1.push(h[9]),this.ToffsetWires1B1.push(h[10]),this.ToffsetWires1B1.push(h[11]),this.ToffsetWires1B1.push(h[12]),this.ToffsetWires1B1.push(h[13]),this.ToffsetWires1B1.push(h[14]),this.ToffsetWires1B1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires12.push(d),this.ToffsetWires1B2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires12.push(p),this.offsetWires12.push(m),this.ToffsetWires1B2.push(p),this.ToffsetWires1B2.push(m);break;case $.四分裂:const T=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),y=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),w=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),A=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r);this.offsetWires12.push(T),this.offsetWires12.push(y),this.offsetWires12.push(w),this.offsetWires12.push(A),this.ToffsetWires1B2.push(T),this.ToffsetWires1B2.push(y),this.ToffsetWires1B2.push(w),this.ToffsetWires1B2.push(A);break;case $.六分裂:const E=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),b=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),D=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),O=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),B=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),L=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r);this.offsetWires12.push(E),this.offsetWires12.push(b),this.offsetWires12.push(D),this.offsetWires12.push(O),this.offsetWires12.push(B),this.offsetWires12.push(L),this.ToffsetWires1B2.push(E),this.ToffsetWires1B2.push(b),this.ToffsetWires1B2.push(D),this.ToffsetWires1B2.push(O),this.ToffsetWires1B2.push(B),this.ToffsetWires1B2.push(L);break;case $.八分裂:const F=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),N=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),U=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),M=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),j=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),Y=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r),s=Q(i,new u(c.InsulatorPoint[6].X*-1,c.InsulatorPoint[6].Y,c.InsulatorPoint[6].Z),r),x=Q(i,new u(c.InsulatorPoint[7].X*-1,c.InsulatorPoint[7].Y,c.InsulatorPoint[7].Z),r);this.offsetWires12.push(F),this.offsetWires12.push(N),this.offsetWires12.push(U),this.offsetWires12.push(M),this.offsetWires12.push(j),this.offsetWires12.push(Y),this.offsetWires12.push(s),this.offsetWires12.push(x),this.ToffsetWires1B2.push(F),this.ToffsetWires1B2.push(N),this.ToffsetWires1B2.push(U),this.ToffsetWires1B2.push(M),this.ToffsetWires1B2.push(j),this.ToffsetWires1B2.push(Y),this.ToffsetWires1B2.push(s),this.ToffsetWires1B2.push(x);break}else if(c.type==Ht.跳线串)switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B2.push(h[0]);break;case $.双分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B2.push(h[2]),this.ToffsetWires1B2.push(h[3]);break;case $.四分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B2.push(h[4]),this.ToffsetWires1B2.push(h[5]),this.ToffsetWires1B2.push(h[6]),this.ToffsetWires1B2.push(h[7]);break;case $.六分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B2.push(h[6]),this.ToffsetWires1B2.push(h[7]),this.ToffsetWires1B2.push(h[8]),this.ToffsetWires1B2.push(h[9]),this.ToffsetWires1B2.push(h[10]),this.ToffsetWires1B2.push(h[11]);break;case $.八分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]),this.ToffsetWires1B2.push(h[8]),this.ToffsetWires1B2.push(h[9]),this.ToffsetWires1B2.push(h[10]),this.ToffsetWires1B2.push(h[11]),this.ToffsetWires1B2.push(h[12]),this.ToffsetWires1B2.push(h[13]),this.ToffsetWires1B2.push(h[14]),this.ToffsetWires1B2.push(h[15]);break}break;case nn.C相:if(c.type==Ht.耐张串)if(c.WairFX=="进")switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires13.push(h[0]),this.ToffsetWires1C1.push(h[0]);break;case $.双分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]);break;case $.四分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]);break;case $.六分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.offsetWires13.push(h[4]),this.offsetWires13.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]),this.ToffsetWires1C1.push(h[8]),this.ToffsetWires1C1.push(h[9]),this.ToffsetWires1C1.push(h[10]),this.ToffsetWires1C1.push(h[11]);break;case $.八分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.offsetWires13.push(h[4]),this.offsetWires13.push(h[5]),this.offsetWires13.push(h[6]),this.offsetWires13.push(h[7]),this.ToffsetWires1C1.push(h[8]),this.ToffsetWires1C1.push(h[9]),this.ToffsetWires1C1.push(h[10]),this.ToffsetWires1C1.push(h[11]),this.ToffsetWires1C1.push(h[12]),this.ToffsetWires1C1.push(h[13]),this.ToffsetWires1C1.push(h[14]),this.ToffsetWires1C1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires13.push(d),this.ToffsetWires1C2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires13.push(p),this.offsetWires13.push(m),this.ToffsetWires1C2.push(p),this.ToffsetWires1C2.push(m);break;case $.四分裂:const T=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),y=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),w=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),A=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r);this.offsetWires13.push(T),this.offsetWires13.push(y),this.offsetWires13.push(w),this.offsetWires13.push(A),this.ToffsetWires1C2.push(T),this.ToffsetWires1C2.push(y),this.ToffsetWires1C2.push(w),this.ToffsetWires1C2.push(A);break;case $.六分裂:const E=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),b=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),D=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),O=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),B=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),L=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r);this.offsetWires13.push(E),this.offsetWires13.push(b),this.offsetWires13.push(D),this.offsetWires13.push(O),this.offsetWires13.push(B),this.offsetWires13.push(L),this.ToffsetWires1C2.push(E),this.ToffsetWires1C2.push(b),this.ToffsetWires1C2.push(D),this.ToffsetWires1C2.push(O),this.ToffsetWires1C2.push(B),this.ToffsetWires1C2.push(L);break;case $.八分裂:const F=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),N=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),U=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),M=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),j=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),Y=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r),s=Q(i,new u(c.InsulatorPoint[6].X*-1,c.InsulatorPoint[6].Y,c.InsulatorPoint[6].Z),r),x=Q(i,new u(c.InsulatorPoint[7].X*-1,c.InsulatorPoint[7].Y,c.InsulatorPoint[7].Z),r);this.offsetWires13.push(F),this.offsetWires13.push(N),this.offsetWires13.push(U),this.offsetWires13.push(M),this.offsetWires13.push(j),this.offsetWires13.push(Y),this.offsetWires13.push(s),this.offsetWires13.push(x),this.ToffsetWires1C2.push(F),this.ToffsetWires1C2.push(N),this.ToffsetWires1C2.push(U),this.ToffsetWires1C2.push(M),this.ToffsetWires1C2.push(j),this.ToffsetWires1C2.push(Y),this.ToffsetWires1C2.push(s),this.ToffsetWires1C2.push(x);break}else if(c.type==Ht.跳线串)switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C2.push(h[0]);break;case $.双分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C2.push(h[2]),this.ToffsetWires1C2.push(h[3]);break;case $.四分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C2.push(h[4]),this.ToffsetWires1C2.push(h[5]),this.ToffsetWires1C2.push(h[6]),this.ToffsetWires1C2.push(h[7]);break;case $.六分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C2.push(h[6]),this.ToffsetWires1C2.push(h[7]),this.ToffsetWires1C2.push(h[8]),this.ToffsetWires1C2.push(h[9]),this.ToffsetWires1C2.push(h[10]),this.ToffsetWires1C2.push(h[11]);break;case $.八分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]),this.ToffsetWires1C2.push(h[8]),this.ToffsetWires1C2.push(h[9]),this.ToffsetWires1C2.push(h[10]),this.ToffsetWires1C2.push(h[11]),this.ToffsetWires1C2.push(h[12]),this.ToffsetWires1C2.push(h[13]),this.ToffsetWires1C2.push(h[14]),this.ToffsetWires1C2.push(h[15]);break}break}else switch(c.PhaseSequence){case nn.A相:h.forEach(d=>{this.offsetWires11.push(d)});break;case nn.B相:h.forEach(d=>{this.offsetWires12.push(d)});break;case nn.C相:h.forEach(d=>{this.offsetWires13.push(d)});break}else if(this.LineInfo.towers[o].type==$i.耐张塔){debugger;switch(f){case 2:switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires11.push(h[0]),this.ToffsetWires1A1.push(h[0]);break;case $.双分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]);break}break;case 3:switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A2.push(h[0]);break;case $.双分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A2.push(h[2]),this.ToffsetWires1A2.push(h[3]);break}break;case 4:switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires11.push(d),this.ToffsetWires1A2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires11.push(p),this.offsetWires11.push(m),this.ToffsetWires1A2.push(p),this.ToffsetWires1A2.push(m);break}break;case 5:h.forEach(d=>{this.offsetWires12.push(d),this.ToffsetWires1B1.push(d)});break;case 6:h.forEach(d=>{this.ToffsetWires1B1.push(d),this.ToffsetWires1B2.push(d)});break;case 7:c.InsulatorPoint.forEach(d=>{const p=Q(i,new u(d.X*-1,d.Y,d.Z),r);this.offsetWires12.push(p),this.ToffsetWires1B2.push(p)});break;case 8:h.forEach(d=>{this.offsetWires13.push(d),this.ToffsetWires1C1.push(d)});break;case 9:h.forEach(d=>{this.ToffsetWires1C1.push(d),this.ToffsetWires1C2.push(d)});break;case 10:c.InsulatorPoint.forEach(d=>{const p=Q(i,new u(d.X*-1,d.Y,d.Z),r);this.offsetWires13.push(p),this.ToffsetWires1C2.push(p)});break}}else switch(f){case 2:h.forEach(d=>{this.offsetWires11.push(d)});break;case 3:h.forEach(d=>{this.offsetWires12.push(d)});break;case 4:h.forEach(d=>{this.offsetWires13.push(d)});break}break;case ar.回路二:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[o].type==$i.耐张塔)switch(c.PhaseSequence){case nn.A相:if(c.type==Ht.耐张串)if(c.WairFX=="进")switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires21.push(h[0]),this.ToffsetWires2A1.push(h[0]);break;case $.双分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]);break;case $.四分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]);break;case $.六分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.offsetWires21.push(h[4]),this.offsetWires21.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]),this.ToffsetWires2A1.push(h[8]),this.ToffsetWires2A1.push(h[9]),this.ToffsetWires2A1.push(h[10]),this.ToffsetWires2A1.push(h[11]);break;case $.八分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.offsetWires21.push(h[4]),this.offsetWires21.push(h[5]),this.offsetWires21.push(h[6]),this.offsetWires21.push(h[7]),this.ToffsetWires2A1.push(h[8]),this.ToffsetWires2A1.push(h[9]),this.ToffsetWires2A1.push(h[10]),this.ToffsetWires2A1.push(h[11]),this.ToffsetWires2A1.push(h[12]),this.ToffsetWires2A1.push(h[13]),this.ToffsetWires2A1.push(h[14]),this.ToffsetWires2A1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires21.push(d),this.ToffsetWires2A2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires21.push(p),this.offsetWires21.push(m),this.ToffsetWires2A2.push(p),this.ToffsetWires2A2.push(m);break;case $.四分裂:const T=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),y=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),w=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),A=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r);this.offsetWires21.push(T),this.offsetWires21.push(y),this.offsetWires21.push(w),this.offsetWires21.push(A),this.ToffsetWires2A2.push(T),this.ToffsetWires2A2.push(y),this.ToffsetWires2A2.push(w),this.ToffsetWires2A2.push(A);break;case $.六分裂:const E=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),b=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),D=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),O=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),B=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),L=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r);this.offsetWires21.push(E),this.offsetWires21.push(b),this.offsetWires21.push(D),this.offsetWires21.push(O),this.offsetWires21.push(B),this.offsetWires21.push(L),this.ToffsetWires2A2.push(E),this.ToffsetWires2A2.push(b),this.ToffsetWires2A2.push(D),this.ToffsetWires2A2.push(O),this.ToffsetWires2A2.push(B),this.ToffsetWires2A2.push(L);break;case $.八分裂:const F=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),N=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),U=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),M=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),j=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),Y=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r),s=Q(i,new u(c.InsulatorPoint[6].X*-1,c.InsulatorPoint[6].Y,c.InsulatorPoint[6].Z),r),x=Q(i,new u(c.InsulatorPoint[7].X*-1,c.InsulatorPoint[7].Y,c.InsulatorPoint[7].Z),r);this.offsetWires21.push(F),this.offsetWires21.push(N),this.offsetWires21.push(U),this.offsetWires21.push(M),this.offsetWires21.push(j),this.offsetWires21.push(Y),this.offsetWires21.push(s),this.offsetWires21.push(x),this.ToffsetWires2A2.push(F),this.ToffsetWires2A2.push(N),this.ToffsetWires2A2.push(U),this.ToffsetWires2A2.push(M),this.ToffsetWires2A2.push(j),this.ToffsetWires2A2.push(Y),this.ToffsetWires2A2.push(s),this.ToffsetWires2A2.push(x);break}else if(c.type==Ht.跳线串)switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A2.push(h[0]);break;case $.双分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A2.push(h[2]),this.ToffsetWires2A2.push(h[3]);break;case $.四分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A2.push(h[4]),this.ToffsetWires2A2.push(h[5]),this.ToffsetWires2A2.push(h[6]),this.ToffsetWires2A2.push(h[7]);break;case $.六分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A2.push(h[6]),this.ToffsetWires2A2.push(h[7]),this.ToffsetWires2A2.push(h[8]),this.ToffsetWires2A2.push(h[9]),this.ToffsetWires2A2.push(h[10]),this.ToffsetWires2A2.push(h[11]);break;case $.八分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]),this.ToffsetWires2A2.push(h[8]),this.ToffsetWires2A2.push(h[9]),this.ToffsetWires2A2.push(h[10]),this.ToffsetWires2A2.push(h[11]),this.ToffsetWires2A2.push(h[12]),this.ToffsetWires2A2.push(h[13]),this.ToffsetWires2A2.push(h[14]),this.ToffsetWires2A2.push(h[15]);break}break;case nn.B相:if(c.type==Ht.耐张串)if(c.WairFX=="进")switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires22.push(h[0]),this.ToffsetWires2B1.push(h[0]);break;case $.双分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]);break;case $.四分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]);break;case $.六分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.offsetWires22.push(h[4]),this.offsetWires22.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]),this.ToffsetWires2B1.push(h[8]),this.ToffsetWires2B1.push(h[9]),this.ToffsetWires2B1.push(h[10]),this.ToffsetWires2B1.push(h[11]);break;case $.八分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.offsetWires22.push(h[4]),this.offsetWires22.push(h[5]),this.offsetWires22.push(h[6]),this.offsetWires22.push(h[7]),this.ToffsetWires2B1.push(h[8]),this.ToffsetWires2B1.push(h[9]),this.ToffsetWires2B1.push(h[10]),this.ToffsetWires2B1.push(h[11]),this.ToffsetWires2B1.push(h[12]),this.ToffsetWires2B1.push(h[13]),this.ToffsetWires2B1.push(h[14]),this.ToffsetWires2B1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires22.push(d),this.ToffsetWires2B2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires22.push(p),this.offsetWires22.push(m),this.ToffsetWires2B2.push(p),this.ToffsetWires2B2.push(m);break;case $.四分裂:const T=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),y=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),w=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),A=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r);this.offsetWires22.push(T),this.offsetWires22.push(y),this.offsetWires22.push(w),this.offsetWires22.push(A),this.ToffsetWires2B2.push(T),this.ToffsetWires2B2.push(y),this.ToffsetWires2B2.push(w),this.ToffsetWires2B2.push(A);break;case $.六分裂:const E=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),b=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),D=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),O=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),B=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),L=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r);this.offsetWires22.push(E),this.offsetWires22.push(b),this.offsetWires22.push(D),this.offsetWires22.push(O),this.offsetWires22.push(B),this.offsetWires22.push(L),this.ToffsetWires2B2.push(E),this.ToffsetWires2B2.push(b),this.ToffsetWires2B2.push(D),this.ToffsetWires2B2.push(O),this.ToffsetWires2B2.push(B),this.ToffsetWires2B2.push(L);break;case $.八分裂:const F=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),N=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),U=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),M=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),j=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),Y=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r),s=Q(i,new u(c.InsulatorPoint[6].X*-1,c.InsulatorPoint[6].Y,c.InsulatorPoint[6].Z),r),x=Q(i,new u(c.InsulatorPoint[7].X*-1,c.InsulatorPoint[7].Y,c.InsulatorPoint[7].Z),r);this.offsetWires22.push(F),this.offsetWires22.push(N),this.offsetWires22.push(U),this.offsetWires22.push(M),this.offsetWires22.push(j),this.offsetWires22.push(Y),this.offsetWires22.push(s),this.offsetWires22.push(x),this.ToffsetWires2B2.push(F),this.ToffsetWires2B2.push(N),this.ToffsetWires2B2.push(U),this.ToffsetWires2B2.push(M),this.ToffsetWires2B2.push(j),this.ToffsetWires2B2.push(Y),this.ToffsetWires2B2.push(s),this.ToffsetWires2B2.push(x);break}else if(c.type==Ht.跳线串)switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B2.push(h[0]);break;case $.双分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B2.push(h[2]),this.ToffsetWires2B2.push(h[3]);break;case $.四分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B2.push(h[4]),this.ToffsetWires2B2.push(h[5]),this.ToffsetWires2B2.push(h[6]),this.ToffsetWires2B2.push(h[7]);break;case $.六分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B2.push(h[6]),this.ToffsetWires2B2.push(h[7]),this.ToffsetWires2B2.push(h[8]),this.ToffsetWires2B2.push(h[9]),this.ToffsetWires2B2.push(h[10]),this.ToffsetWires2B2.push(h[11]);break;case $.八分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]),this.ToffsetWires2B2.push(h[8]),this.ToffsetWires2B2.push(h[9]),this.ToffsetWires2B2.push(h[10]),this.ToffsetWires2B2.push(h[11]),this.ToffsetWires2B2.push(h[12]),this.ToffsetWires2B2.push(h[13]),this.ToffsetWires2B2.push(h[14]),this.ToffsetWires2B2.push(h[15]);break}break;case nn.C相:if(c.type==Ht.耐张串)if(c.WairFX=="进")switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires23.push(h[0]),this.ToffsetWires2C1.push(h[0]);break;case $.双分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]);break;case $.四分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]);break;case $.六分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.offsetWires23.push(h[4]),this.offsetWires23.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]),this.ToffsetWires2C1.push(h[8]),this.ToffsetWires2C1.push(h[9]),this.ToffsetWires2C1.push(h[10]),this.ToffsetWires2C1.push(h[11]);break;case $.八分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.offsetWires23.push(h[4]),this.offsetWires23.push(h[5]),this.offsetWires23.push(h[6]),this.offsetWires23.push(h[7]),this.ToffsetWires2C1.push(h[8]),this.ToffsetWires2C1.push(h[9]),this.ToffsetWires2C1.push(h[10]),this.ToffsetWires2C1.push(h[11]),this.ToffsetWires2C1.push(h[12]),this.ToffsetWires2C1.push(h[13]),this.ToffsetWires2C1.push(h[14]),this.ToffsetWires2C1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case $.单分裂:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires23.push(d),this.ToffsetWires2C2.push(d);break;case $.双分裂:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),m=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r);this.offsetWires23.push(p),this.offsetWires23.push(m),this.ToffsetWires2C2.push(p),this.ToffsetWires2C2.push(m);break;case $.四分裂:const T=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),y=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),w=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),A=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r);this.offsetWires23.push(T),this.offsetWires23.push(y),this.offsetWires23.push(w),this.offsetWires23.push(A),this.ToffsetWires2C2.push(T),this.ToffsetWires2C2.push(y),this.ToffsetWires2C2.push(w),this.ToffsetWires2C2.push(A);break;case $.六分裂:const E=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),b=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),D=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),O=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),B=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),L=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r);this.offsetWires23.push(E),this.offsetWires23.push(b),this.offsetWires23.push(D),this.offsetWires23.push(O),this.offsetWires23.push(B),this.offsetWires23.push(L),this.ToffsetWires2C2.push(E),this.ToffsetWires2C2.push(b),this.ToffsetWires2C2.push(D),this.ToffsetWires2C2.push(O),this.ToffsetWires2C2.push(B),this.ToffsetWires2C2.push(L);break;case $.八分裂:const F=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r),N=Q(i,new u(c.InsulatorPoint[1].X*-1,c.InsulatorPoint[1].Y,c.InsulatorPoint[1].Z),r),U=Q(i,new u(c.InsulatorPoint[2].X*-1,c.InsulatorPoint[2].Y,c.InsulatorPoint[2].Z),r),M=Q(i,new u(c.InsulatorPoint[3].X*-1,c.InsulatorPoint[3].Y,c.InsulatorPoint[3].Z),r),j=Q(i,new u(c.InsulatorPoint[4].X*-1,c.InsulatorPoint[4].Y,c.InsulatorPoint[4].Z),r),Y=Q(i,new u(c.InsulatorPoint[5].X*-1,c.InsulatorPoint[5].Y,c.InsulatorPoint[5].Z),r),s=Q(i,new u(c.InsulatorPoint[6].X*-1,c.InsulatorPoint[6].Y,c.InsulatorPoint[6].Z),r),x=Q(i,new u(c.InsulatorPoint[7].X*-1,c.InsulatorPoint[7].Y,c.InsulatorPoint[7].Z),r);this.offsetWires23.push(F),this.offsetWires23.push(N),this.offsetWires23.push(U),this.offsetWires23.push(M),this.offsetWires23.push(j),this.offsetWires23.push(Y),this.offsetWires23.push(s),this.offsetWires23.push(x),this.ToffsetWires2C2.push(F),this.ToffsetWires2C2.push(N),this.ToffsetWires2C2.push(U),this.ToffsetWires2C2.push(M),this.ToffsetWires2C2.push(j),this.ToffsetWires2C2.push(Y),this.ToffsetWires2C2.push(s),this.ToffsetWires2C2.push(x);break}else if(c.type==Ht.跳线串)switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C2.push(h[0]);break;case $.双分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C2.push(h[2]),this.ToffsetWires2C2.push(h[3]);break;case $.四分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C2.push(h[4]),this.ToffsetWires2C2.push(h[5]),this.ToffsetWires2C2.push(h[6]),this.ToffsetWires2C2.push(h[7]);break;case $.六分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C2.push(h[6]),this.ToffsetWires2C2.push(h[7]),this.ToffsetWires2C2.push(h[8]),this.ToffsetWires2C2.push(h[9]),this.ToffsetWires2C2.push(h[10]),this.ToffsetWires2C2.push(h[11]);break;case $.八分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]),this.ToffsetWires2C2.push(h[8]),this.ToffsetWires2C2.push(h[9]),this.ToffsetWires2C2.push(h[10]),this.ToffsetWires2C2.push(h[11]),this.ToffsetWires2C2.push(h[12]),this.ToffsetWires2C2.push(h[13]),this.ToffsetWires2C2.push(h[14]),this.ToffsetWires2C2.push(h[15]);break}break}else switch(c.PhaseSequence){case nn.A相:h.forEach(d=>{this.offsetWires21.push(d)});break;case nn.B相:h.forEach(d=>{this.offsetWires22.push(d)});break;case nn.C相:h.forEach(d=>{this.offsetWires23.push(d)});break}else if(this.LineInfo.towers[o].type==$i.耐张塔)switch(f){case 11:this.offsetWires21.push(h[0]),this.ToffsetWires2A1.push(h[0]);break;case 12:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A2.push(h[0]);break;case 13:const d=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires21.push(d),this.ToffsetWires2A2.push(d);break;case 14:this.offsetWires22.push(h[0]),this.ToffsetWires2B1.push(h[0]);break;case 15:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B2.push(h[0]);break;case 16:const p=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires22.push(p),this.ToffsetWires2B2.push(p);break;case 17:this.offsetWires23.push(h[0]),this.ToffsetWires2C1.push(h[0]);break;case 18:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C2.push(h[0]);break;case 19:const m=Q(i,new u(c.InsulatorPoint[0].X*-1,c.InsulatorPoint[0].Y,c.InsulatorPoint[0].Z),r);this.offsetWires23.push(m),this.ToffsetWires2C2.push(m);break}else switch(f){case 5:h.forEach(d=>{this.offsetWires21.push(d)});break;case 6:h.forEach(d=>{this.offsetWires22.push(d)});break;case 7:h.forEach(d=>{this.offsetWires23.push(d)});break}break;case ar.地线:if(this.LineInfo.ISPhaseSequence)switch(c.PhaseSequence){case nn.地线1:this.offsetGrouundWires11.push(h[0]);break;case nn.地线2:this.offsetGrouundWires12.push(h[0]);break}else switch(f){case 0:this.offsetGrouundWires11.push(h[0]);break;case 1:this.offsetGrouundWires12.push(h[0]);break}break}f=f+1});debugger;if(this.offsetWires11.length>0&&o>0){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.offsetWires11.length>=2&&(c.push(this.offsetWires11[t]),c.push(this.offsetWires11[t-1]),this.offsetArcWires1A=W(c),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case $.双分裂:this.offsetWires11.length>=4&&(c.push(this.offsetWires11[t]),c.push(this.offsetWires11[t-2]),this.offsetArcWires1A=W(c),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+1]),h.push(this.offsetWires11[t-1]),this.offsetArcWires1A=W(h),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case $.四分裂:this.offsetWires11.length>=8&&(c.push(this.offsetWires11[t]),c.push(this.offsetWires11[t-4]),this.offsetArcWires1A=W(c),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+1]),h.push(this.offsetWires11[t-3]),this.offsetArcWires1A=W(h),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+2]),d.push(this.offsetWires11[t-2]),this.offsetArcWires1A=W(d),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+3]),p.push(this.offsetWires11[t-1]),this.offsetArcWires1A=W(p),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case $.六分裂:this.offsetWires11.length>=12&&(c.push(this.offsetWires11[t]),c.push(this.offsetWires11[t-6]),this.offsetArcWires1A=W(c),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+1]),h.push(this.offsetWires11[t-5]),this.offsetArcWires1A=W(h),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+2]),d.push(this.offsetWires11[t-4]),this.offsetArcWires1A=W(d),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+3]),p.push(this.offsetWires11[t-3]),this.offsetArcWires1A=W(p),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires11[t+4]),m.push(this.offsetWires11[t-2]),this.offsetArcWires1A=W(m),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires11[t+5]),T.push(this.offsetWires11[t-1]),this.offsetArcWires1A=W(T),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case $.八分裂:this.offsetWires11.length>=16&&(c.push(this.offsetWires11[t]),c.push(this.offsetWires11[t-8]),this.offsetArcWires1A=W(c),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+1]),h.push(this.offsetWires11[t-7]),this.offsetArcWires1A=W(h),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+2]),d.push(this.offsetWires11[t-6]),this.offsetArcWires1A=W(d),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+3]),p.push(this.offsetWires11[t-5]),this.offsetArcWires1A=W(p),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires11[t+4]),m.push(this.offsetWires11[t-4]),this.offsetArcWires1A=W(m),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires11[t+5]),T.push(this.offsetWires11[t-3]),this.offsetArcWires1A=W(T),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires11[t+6]),y.push(this.offsetWires11[t-2]),this.offsetArcWires1A=W(y),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A7"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),w.push(this.offsetWires11[t+7]),w.push(this.offsetWires11[t-1]),this.offsetArcWires1A=W(w),this.entityCollection2.add(v(this.offsetArcWires1A,"导线1_A8"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break}}if(this.offsetWires12.length>0&&o>0){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[];switch(this.LineInfo.Wairnum){case $.单分裂:c.push(this.offsetWires12[t]),c.push(this.offsetWires12[t-1]),this.offsetArcWires1B=W(c),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.双分裂:c.push(this.offsetWires12[t]),c.push(this.offsetWires12[t-2]),this.offsetArcWires1B=W(c),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+1]),h.push(this.offsetWires12[t-1]),this.offsetArcWires1B=W(h),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.四分裂:c.push(this.offsetWires12[t]),c.push(this.offsetWires12[t-4]),this.offsetArcWires1B=W(c),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+1]),h.push(this.offsetWires12[t-3]),this.offsetArcWires1B=W(h),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+2]),d.push(this.offsetWires12[t-2]),this.offsetArcWires1B=W(d),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+3]),p.push(this.offsetWires12[t-1]),this.offsetArcWires1B=W(p),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.六分裂:c.push(this.offsetWires12[t]),c.push(this.offsetWires12[t-6]),this.offsetArcWires1B=W(c),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+1]),h.push(this.offsetWires12[t-5]),this.offsetArcWires1B=W(h),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+2]),d.push(this.offsetWires12[t-4]),this.offsetArcWires1B=W(d),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+3]),p.push(this.offsetWires12[t-3]),this.offsetArcWires1B=W(p),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires12[t+4]),m.push(this.offsetWires12[t-2]),this.offsetArcWires1B=W(m),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires12[t+5]),T.push(this.offsetWires12[t-1]),this.offsetArcWires1B=W(T),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.八分裂:c.push(this.offsetWires12[t]),c.push(this.offsetWires12[t-8]),this.offsetArcWires1B=W(c),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+1]),h.push(this.offsetWires12[t-7]),this.offsetArcWires1B=W(h),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+2]),d.push(this.offsetWires12[t-6]),this.offsetArcWires1B=W(d),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+3]),p.push(this.offsetWires12[t-5]),this.offsetArcWires1B=W(p),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires12[t+4]),m.push(this.offsetWires12[t-4]),this.offsetArcWires1B=W(m),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires12[t+5]),T.push(this.offsetWires12[t-3]),this.offsetArcWires1B=W(T),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires12[t+6]),y.push(this.offsetWires12[t-2]),this.offsetArcWires1B=W(y),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B7"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),w.push(this.offsetWires12[t+7]),w.push(this.offsetWires12[t-1]),this.offsetArcWires1B=W(w),this.entityCollection2.add(v(this.offsetArcWires1B,"导线1_B8"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires13.length>0&&o>0){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[];switch(this.LineInfo.Wairnum){case $.单分裂:c.push(this.offsetWires13[t]),c.push(this.offsetWires13[t-1]),this.offsetArcWires1C=W(c),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.双分裂:c.push(this.offsetWires13[t]),c.push(this.offsetWires13[t-2]),this.offsetArcWires1C=W(c),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+1]),h.push(this.offsetWires13[t-1]),this.offsetArcWires1C=W(h),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.四分裂:c.push(this.offsetWires13[t]),c.push(this.offsetWires13[t-4]),this.offsetArcWires1C=W(c),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+1]),h.push(this.offsetWires13[t-3]),this.offsetArcWires1C=W(h),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+2]),d.push(this.offsetWires13[t-2]),this.offsetArcWires1C=W(d),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+3]),p.push(this.offsetWires13[t-1]),this.offsetArcWires1C=W(p),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.六分裂:c.push(this.offsetWires13[t]),c.push(this.offsetWires13[t-6]),this.offsetArcWires1C=W(c),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+1]),h.push(this.offsetWires13[t-5]),this.offsetArcWires1C=W(h),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+2]),d.push(this.offsetWires13[t-4]),this.offsetArcWires1C=W(d),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+3]),p.push(this.offsetWires13[t-3]),this.offsetArcWires1C=W(p),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires13[t+4]),m.push(this.offsetWires13[t-2]),this.offsetArcWires1C=W(m),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires13[t+5]),T.push(this.offsetWires13[t-1]),this.offsetArcWires1C=W(T),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.八分裂:c.push(this.offsetWires13[t]),c.push(this.offsetWires13[t-8]),this.offsetArcWires1C=W(c),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+1]),h.push(this.offsetWires13[t-7]),this.offsetArcWires1C=W(h),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+2]),d.push(this.offsetWires13[t-6]),this.offsetArcWires1C=W(d),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+3]),p.push(this.offsetWires13[t-5]),this.offsetArcWires1C=W(p),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires13[t+4]),m.push(this.offsetWires13[t-4]),this.offsetArcWires1C=W(m),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires13[t+5]),T.push(this.offsetWires13[t-3]),this.offsetArcWires1C=W(T),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires13[t+6]),y.push(this.offsetWires13[t-2]),this.offsetArcWires1C=W(y),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C7"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),w.push(this.offsetWires13[t+7]),w.push(this.offsetWires13[t-1]),this.offsetArcWires1C=W(w),this.entityCollection2.add(v(this.offsetArcWires1C,"导线1_C8"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires21.length>0&&o>0){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[];switch(this.LineInfo.Wairnum){case $.单分裂:c.push(this.offsetWires21[t]),c.push(this.offsetWires21[t-1]),this.offsetArcWires2A=W(c),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.双分裂:c.push(this.offsetWires21[t]),c.push(this.offsetWires21[t-2]),this.offsetArcWires2A=W(c),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+1]),h.push(this.offsetWires21[t-1]),this.offsetArcWires2A=W(h),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.四分裂:c.push(this.offsetWires21[t]),c.push(this.offsetWires21[t-4]),this.offsetArcWires2A=W(c),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+1]),h.push(this.offsetWires21[t-3]),this.offsetArcWires2A=W(h),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+2]),d.push(this.offsetWires21[t-2]),this.offsetArcWires2A=W(d),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+3]),p.push(this.offsetWires21[t-1]),this.offsetArcWires2A=W(p),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.六分裂:c.push(this.offsetWires21[t]),c.push(this.offsetWires21[t-6]),this.offsetArcWires2A=W(c),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+1]),h.push(this.offsetWires21[t-5]),this.offsetArcWires2A=W(h),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+2]),d.push(this.offsetWires21[t-4]),this.offsetArcWires2A=W(d),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+3]),p.push(this.offsetWires21[t-3]),this.offsetArcWires2A=W(p),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires21[t+4]),m.push(this.offsetWires21[t-2]),this.offsetArcWires2A=W(m),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires21[t+5]),T.push(this.offsetWires21[t-1]),this.offsetArcWires2A=W(T),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.八分裂:c.push(this.offsetWires21[t]),c.push(this.offsetWires21[t-8]),this.offsetArcWires2A=W(c),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+1]),h.push(this.offsetWires21[t-7]),this.offsetArcWires2A=W(h),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+2]),d.push(this.offsetWires21[t-6]),this.offsetArcWires2A=W(d),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+3]),p.push(this.offsetWires21[t-5]),this.offsetArcWires2A=W(p),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires21[t+4]),m.push(this.offsetWires21[t-4]),this.offsetArcWires2A=W(m),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires21[t+5]),T.push(this.offsetWires21[t-3]),this.offsetArcWires2A=W(T),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires21[t+6]),y.push(this.offsetWires21[t-2]),this.offsetArcWires2A=W(y),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A7"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),w.push(this.offsetWires21[t+7]),w.push(this.offsetWires21[t-1]),this.offsetArcWires2A=W(w),this.entityCollection2.add(v(this.offsetArcWires2A,"导线2_A8"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires22.length>0&&o>0){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[];switch(this.LineInfo.Wairnum){case $.单分裂:c.push(this.offsetWires22[t]),c.push(this.offsetWires22[t-1]),this.offsetArcWires2B=W(c),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.双分裂:c.push(this.offsetWires22[t]),c.push(this.offsetWires22[t-2]),this.offsetArcWires2B=W(c),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+1]),h.push(this.offsetWires22[t-1]),this.offsetArcWires2B=W(h),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.四分裂:c.push(this.offsetWires22[t]),c.push(this.offsetWires22[t-4]),this.offsetArcWires2B=W(c),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+1]),h.push(this.offsetWires22[t-3]),this.offsetArcWires2B=W(h),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+2]),d.push(this.offsetWires22[t-2]),this.offsetArcWires2B=W(d),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+3]),p.push(this.offsetWires22[t-1]),this.offsetArcWires2B=W(p),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.六分裂:c.push(this.offsetWires22[t]),c.push(this.offsetWires22[t-6]),this.offsetArcWires2B=W(c),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+1]),h.push(this.offsetWires22[t-5]),this.offsetArcWires2B=W(h),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+2]),d.push(this.offsetWires22[t-4]),this.offsetArcWires2B=W(d),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+3]),p.push(this.offsetWires22[t-3]),this.offsetArcWires2B=W(p),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires22[t+4]),m.push(this.offsetWires22[t-2]),this.offsetArcWires2B=W(m),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires22[t+5]),T.push(this.offsetWires22[t-1]),this.offsetArcWires2B=W(T),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.八分裂:c.push(this.offsetWires22[t]),c.push(this.offsetWires22[t-8]),this.offsetArcWires2B=W(c),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+1]),h.push(this.offsetWires22[t-7]),this.offsetArcWires2B=W(h),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+2]),d.push(this.offsetWires22[t-6]),this.offsetArcWires2B=W(d),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+3]),p.push(this.offsetWires22[t-5]),this.offsetArcWires2B=W(p),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires22[t+4]),m.push(this.offsetWires22[t-4]),this.offsetArcWires2B=W(m),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires22[t+5]),T.push(this.offsetWires22[t-3]),this.offsetArcWires2B=W(T),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires22[t+6]),y.push(this.offsetWires22[t-2]),this.offsetArcWires2B=W(y),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B7"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),w.push(this.offsetWires22[t+7]),w.push(this.offsetWires22[t-1]),this.offsetArcWires2B=W(w),this.entityCollection2.add(v(this.offsetArcWires2B,"导线2_B8"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires23.length>0&&o>0){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[];switch(this.LineInfo.Wairnum){case $.单分裂:c.push(this.offsetWires23[t]),c.push(this.offsetWires23[t-1]),this.offsetArcWires2C=W(c),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.双分裂:c.push(this.offsetWires23[t]),c.push(this.offsetWires23[t-2]),this.offsetArcWires2C=W(c),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+1]),h.push(this.offsetWires23[t-1]),this.offsetArcWires2C=W(h),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.四分裂:c.push(this.offsetWires23[t]),c.push(this.offsetWires23[t-4]),this.offsetArcWires2C=W(c),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+1]),h.push(this.offsetWires23[t-3]),this.offsetArcWires2C=W(h),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+2]),d.push(this.offsetWires23[t-2]),this.offsetArcWires2C=W(d),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+3]),p.push(this.offsetWires23[t-1]),this.offsetArcWires2C=W(p),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.六分裂:c.push(this.offsetWires23[t]),c.push(this.offsetWires23[t-6]),this.offsetArcWires2C=W(c),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+1]),h.push(this.offsetWires23[t-5]),this.offsetArcWires2C=W(h),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+2]),d.push(this.offsetWires23[t-4]),this.offsetArcWires2C=W(d),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+3]),p.push(this.offsetWires23[t-3]),this.offsetArcWires2C=W(p),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires23[t+4]),m.push(this.offsetWires23[t-2]),this.offsetArcWires2C=W(m),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires23[t+5]),T.push(this.offsetWires23[t-1]),this.offsetArcWires2C=W(T),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case $.八分裂:c.push(this.offsetWires23[t]),c.push(this.offsetWires23[t-8]),this.offsetArcWires2C=W(c),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C1"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+1]),h.push(this.offsetWires23[t-7]),this.offsetArcWires2C=W(h),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C2"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+2]),d.push(this.offsetWires23[t-6]),this.offsetArcWires2C=W(d),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C3"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+3]),p.push(this.offsetWires23[t-5]),this.offsetArcWires2C=W(p),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C4"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires23[t+4]),m.push(this.offsetWires23[t-4]),this.offsetArcWires2C=W(m),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C5"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires23[t+5]),T.push(this.offsetWires23[t-3]),this.offsetArcWires2C=W(T),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C6"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires23[t+6]),y.push(this.offsetWires23[t-2]),this.offsetArcWires2C=W(y),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C7"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),w.push(this.offsetWires23[t+7]),w.push(this.offsetWires23[t-1]),this.offsetArcWires2C=W(w),this.entityCollection2.add(v(this.offsetArcWires2C,"导线2_C8"+(o-2)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetGrouundWires11.length>1){const c=[];c.push(this.offsetGrouundWires11[o]),c.push(this.offsetGrouundWires11[o-1]);const h=[];h.push(this.offsetGrouundWires12[o]),h.push(this.offsetGrouundWires12[o-1]),this.offsetGrouundWires1=W(c,2),this.offsetGrouundWires2=W(h,2),this.entityCollection2.add(v(this.offsetGrouundWires1,"地线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireD1Color)),this.entityCollection2.add(v(this.offsetGrouundWires2,"地线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireD2Color))}if(this.LineInfo.towers[o].type==$i.耐张塔){switch(this.LineInfo.Wairnum){case $.单分裂:t=t+2,n=n+2;break;case $.双分裂:t=t+4,n=n+4;break;case $.四分裂:t=t+8,n=n+8;break;case $.六分裂:t=t+12,n=n+12;break;case $.八分裂:t=t+16,n=n+16;break}if(this.ToffsetWires1A1.length>1&&this.ToffsetWires1A2.length>1){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[],A=[],E=[],b=[],D=[],O=[],B=[],L=[],F=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1A1.length>=2&&(c.push(this.ToffsetWires1A1[n-2]),c.push(this.ToffsetWires1A1[n-1]),this.ToffsetArcWires1A=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=2&&(A.push(this.ToffsetWires1A2[n-2]),A.push(this.ToffsetWires1A2[n-1]),this.ToffsetArcWires2A=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.双分裂:this.ToffsetWires1A1.length>=4&&(c.push(this.ToffsetWires1A1[n-4]),c.push(this.ToffsetWires1A1[n-2]),this.ToffsetArcWires1A=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[n-3]),h.push(this.ToffsetWires1A1[n-1]),this.ToffsetArcWires1A=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=4&&(A.push(this.ToffsetWires1A2[n-4]),A.push(this.ToffsetWires1A2[n-2]),this.ToffsetArcWires2A=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1A2[n-3]),E.push(this.ToffsetWires1A2[n-1]),this.ToffsetArcWires2A=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.四分裂:this.ToffsetWires1A1.length>=8&&(c.push(this.ToffsetWires1A1[n-8]),c.push(this.ToffsetWires1A1[n-4]),this.ToffsetArcWires1A=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[n-7]),h.push(this.ToffsetWires1A1[n-3]),this.ToffsetArcWires1A=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[n-6]),d.push(this.ToffsetWires1A1[n-2]),this.ToffsetArcWires1A=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[n-5]),p.push(this.ToffsetWires1A1[n-1]),this.ToffsetArcWires1A=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=8&&(A.push(this.ToffsetWires1A2[n-8]),A.push(this.ToffsetWires1A2[n-4]),this.ToffsetArcWires2A=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1A2[n-7]),E.push(this.ToffsetWires1A2[n-3]),this.ToffsetArcWires2A=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[n-6]),b.push(this.ToffsetWires1A2[n-2]),this.ToffsetArcWires2A=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1A2[n-5]),D.push(this.ToffsetWires1A2[n-1]),this.ToffsetArcWires2A=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.六分裂:this.ToffsetWires1A1.length>=12&&(c.push(this.ToffsetWires1A1[n-12]),c.push(this.ToffsetWires1A1[n-6]),this.ToffsetArcWires1A=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[n-11]),h.push(this.ToffsetWires1A1[n-5]),this.ToffsetArcWires1A=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[n-10]),d.push(this.ToffsetWires1A1[n-4]),this.ToffsetArcWires1A=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[n-9]),p.push(this.ToffsetWires1A1[n-3]),this.ToffsetArcWires1A=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A1[n-8]),m.push(this.ToffsetWires1A1[n-2]),this.ToffsetArcWires1A=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A1[n-7]),T.push(this.ToffsetWires1A1[n-1]),this.ToffsetArcWires1A=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=12&&(A.push(this.ToffsetWires1A2[n-12]),A.push(this.ToffsetWires1A2[n-6]),this.ToffsetArcWires2A=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1A2[n-11]),E.push(this.ToffsetWires1A2[n-5]),this.ToffsetArcWires2A=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[n-10]),b.push(this.ToffsetWires1A2[n-4]),this.ToffsetArcWires2A=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1A2[n-9]),D.push(this.ToffsetWires1A2[n-3]),this.ToffsetArcWires2A=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires1A2[n-8]),O.push(this.ToffsetWires1A2[n-2]),this.ToffsetArcWires2A=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1A2[n-7]),B.push(this.ToffsetWires1A2[n-1]),this.ToffsetArcWires2A=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.八分裂:this.ToffsetWires1A1.length>=16&&(c.push(this.ToffsetWires1A1[n-16]),c.push(this.ToffsetWires1A1[n-8]),this.ToffsetArcWires1A=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[n-15]),h.push(this.ToffsetWires1A1[n-7]),this.ToffsetArcWires1A=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[n-14]),d.push(this.ToffsetWires1A1[n-6]),this.ToffsetArcWires1A=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[n-13]),p.push(this.ToffsetWires1A1[n-5]),this.ToffsetArcWires1A=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A1[n-12]),m.push(this.ToffsetWires1A1[n-4]),this.ToffsetArcWires1A=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A1[n-11]),T.push(this.ToffsetWires1A1[n-3]),this.ToffsetArcWires1A=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires1A1[n-10]),y.push(this.ToffsetWires1A1[n-2]),this.ToffsetArcWires1A=W(y,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1A1[n-9]),w.push(this.ToffsetWires1A1[n-1]),this.ToffsetArcWires1A=W(w,15),this.entityCollection2.add(v(this.ToffsetArcWires1A,"1A1跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=16&&(A.push(this.ToffsetWires1A2[n-16]),A.push(this.ToffsetWires1A2[n-8]),this.ToffsetArcWires2A=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1A2[n-15]),E.push(this.ToffsetWires1A2[n-7]),this.ToffsetArcWires2A=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[n-14]),b.push(this.ToffsetWires1A2[n-6]),this.ToffsetArcWires2A=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1A2[n-13]),D.push(this.ToffsetWires1A2[n-5]),this.ToffsetArcWires2A=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires1A2[n-12]),O.push(this.ToffsetWires1A2[n-4]),this.ToffsetArcWires2A=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1A2[n-11]),B.push(this.ToffsetWires1A2[n-3]),this.ToffsetArcWires2A=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1A2[n-10]),L.push(this.ToffsetWires1A2[n-2]),this.ToffsetArcWires2A=W(L,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),F.push(this.ToffsetWires1A2[n-9]),F.push(this.ToffsetWires1A2[n-1]),this.ToffsetArcWires2A=W(F,15),this.entityCollection2.add(v(this.ToffsetArcWires2A,"1A2跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires1B1.length>1&&this.ToffsetWires1B2.length>1){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[],A=[],E=[],b=[],D=[],O=[],B=[],L=[],F=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1B1.length>=2&&(c.push(this.ToffsetWires1B1[n-2]),c.push(this.ToffsetWires1B1[n-1]),this.ToffsetArcWires1B=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=2&&(A.push(this.ToffsetWires1B2[n-2]),A.push(this.ToffsetWires1B2[n-1]),this.ToffsetArcWires2B=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.双分裂:this.ToffsetWires1B1.length>=4&&(c.push(this.ToffsetWires1B1[n-4]),c.push(this.ToffsetWires1B1[n-2]),this.ToffsetArcWires1B=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[n-3]),h.push(this.ToffsetWires1B1[n-1]),this.ToffsetArcWires1B=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=4&&(A.push(this.ToffsetWires1B2[n-4]),A.push(this.ToffsetWires1B2[n-2]),this.ToffsetArcWires2B=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1B2[n-3]),E.push(this.ToffsetWires1B2[n-1]),this.ToffsetArcWires2B=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.四分裂:this.ToffsetWires1B1.length>=8&&(c.push(this.ToffsetWires1B1[n-8]),c.push(this.ToffsetWires1B1[n-4]),this.ToffsetArcWires1B=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[n-7]),h.push(this.ToffsetWires1B1[n-3]),this.ToffsetArcWires1B=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[n-6]),d.push(this.ToffsetWires1B1[n-2]),this.ToffsetArcWires1B=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[n-5]),p.push(this.ToffsetWires1B1[n-1]),this.ToffsetArcWires1B=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=8&&(A.push(this.ToffsetWires1B2[n-8]),A.push(this.ToffsetWires1B2[n-4]),this.ToffsetArcWires2B=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1B2[n-7]),E.push(this.ToffsetWires1B2[n-3]),this.ToffsetArcWires2B=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[n-6]),b.push(this.ToffsetWires1B2[n-2]),this.ToffsetArcWires2B=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1B2[n-5]),D.push(this.ToffsetWires1B2[n-1]),this.ToffsetArcWires2B=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.六分裂:this.ToffsetWires1B1.length>=12&&(c.push(this.ToffsetWires1B1[n-12]),c.push(this.ToffsetWires1B1[n-6]),this.ToffsetArcWires1B=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[n-11]),h.push(this.ToffsetWires1B1[n-5]),this.ToffsetArcWires1B=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[n-10]),d.push(this.ToffsetWires1B1[n-4]),this.ToffsetArcWires1B=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[n-9]),p.push(this.ToffsetWires1B1[n-3]),this.ToffsetArcWires1B=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B1[n-8]),m.push(this.ToffsetWires1B1[n-2]),this.ToffsetArcWires1B=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B1[n-7]),T.push(this.ToffsetWires1B1[n-1]),this.ToffsetArcWires1B=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=12&&(A.push(this.ToffsetWires1B2[n-12]),A.push(this.ToffsetWires1B2[n-6]),this.ToffsetArcWires2B=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1B2[n-11]),E.push(this.ToffsetWires1B2[n-5]),this.ToffsetArcWires2B=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[n-10]),b.push(this.ToffsetWires1B2[n-4]),this.ToffsetArcWires2B=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1B2[n-9]),D.push(this.ToffsetWires1B2[n-3]),this.ToffsetArcWires2B=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires1B2[n-8]),O.push(this.ToffsetWires1B2[n-2]),this.ToffsetArcWires2B=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1B2[n-7]),B.push(this.ToffsetWires1B2[n-1]),this.ToffsetArcWires2B=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.八分裂:this.ToffsetWires1B1.length>=16&&(c.push(this.ToffsetWires1B1[n-16]),c.push(this.ToffsetWires1B1[n-8]),this.ToffsetArcWires1B=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[n-15]),h.push(this.ToffsetWires1B1[n-7]),this.ToffsetArcWires1B=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[n-14]),d.push(this.ToffsetWires1B1[n-6]),this.ToffsetArcWires1B=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[n-13]),p.push(this.ToffsetWires1B1[n-5]),this.ToffsetArcWires1B=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B1[n-12]),m.push(this.ToffsetWires1B1[n-4]),this.ToffsetArcWires1B=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B1[n-11]),T.push(this.ToffsetWires1B1[n-3]),this.ToffsetArcWires1B=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires1B1[n-10]),y.push(this.ToffsetWires1B1[n-2]),this.ToffsetArcWires1B=W(y,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1B1[n-9]),w.push(this.ToffsetWires1B1[n-1]),this.ToffsetArcWires1B=W(w,15),this.entityCollection2.add(v(this.ToffsetArcWires1B,"1B1跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=16&&(A.push(this.ToffsetWires1B2[n-16]),A.push(this.ToffsetWires1B2[n-8]),this.ToffsetArcWires2B=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1B2[n-15]),E.push(this.ToffsetWires1B2[n-7]),this.ToffsetArcWires2B=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[n-14]),b.push(this.ToffsetWires1B2[n-6]),this.ToffsetArcWires2B=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1B2[n-13]),D.push(this.ToffsetWires1B2[n-5]),this.ToffsetArcWires2B=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires1B2[n-12]),O.push(this.ToffsetWires1B2[n-4]),this.ToffsetArcWires2B=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1B2[n-11]),B.push(this.ToffsetWires1B2[n-3]),this.ToffsetArcWires2B=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1B2[n-10]),L.push(this.ToffsetWires1B2[n-2]),this.ToffsetArcWires2B=W(L,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),F.push(this.ToffsetWires1B2[n-9]),F.push(this.ToffsetWires1B2[n-1]),this.ToffsetArcWires2B=W(F,15),this.entityCollection2.add(v(this.ToffsetArcWires2B,"1B2跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}debugger;if(this.ToffsetWires1C1.length>1&&this.ToffsetWires1C2.length>1){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[],A=[],E=[],b=[],D=[],O=[],B=[],L=[],F=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires1C1.length>=2&&(c.push(this.ToffsetWires1C1[n-2]),c.push(this.ToffsetWires1C1[n-1]),this.ToffsetArcWires1C=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=2&&(A.push(this.ToffsetWires1C2[n-2]),A.push(this.ToffsetWires1C2[n-1]),this.ToffsetArcWires2C=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.双分裂:this.ToffsetWires1C1.length>=4&&(c.push(this.ToffsetWires1C1[n-4]),c.push(this.ToffsetWires1C1[n-2]),this.ToffsetArcWires1C=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[n-3]),h.push(this.ToffsetWires1C1[n-1]),this.ToffsetArcWires1C=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=4&&(A.push(this.ToffsetWires1C2[n-4]),A.push(this.ToffsetWires1C2[n-2]),this.ToffsetArcWires2C=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1C2[n-3]),E.push(this.ToffsetWires1C2[n-1]),this.ToffsetArcWires2C=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.四分裂:this.ToffsetWires1C1.length>=8&&(c.push(this.ToffsetWires1C1[n-8]),c.push(this.ToffsetWires1C1[n-4]),this.ToffsetArcWires1C=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[n-7]),h.push(this.ToffsetWires1C1[n-3]),this.ToffsetArcWires1C=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[n-6]),d.push(this.ToffsetWires1C1[n-2]),this.ToffsetArcWires1C=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[n-5]),p.push(this.ToffsetWires1C1[n-1]),this.ToffsetArcWires1C=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=8&&(A.push(this.ToffsetWires1C2[n-8]),A.push(this.ToffsetWires1C2[n-4]),this.ToffsetArcWires2C=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1C2[n-7]),E.push(this.ToffsetWires1C2[n-3]),this.ToffsetArcWires2C=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[n-6]),b.push(this.ToffsetWires1C2[n-2]),this.ToffsetArcWires2C=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1C2[n-5]),D.push(this.ToffsetWires1C2[n-1]),this.ToffsetArcWires2C=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.六分裂:this.ToffsetWires1C1.length>=12&&(c.push(this.ToffsetWires1C1[n-12]),c.push(this.ToffsetWires1C1[n-6]),this.ToffsetArcWires1C=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[n-11]),h.push(this.ToffsetWires1C1[n-5]),this.ToffsetArcWires1C=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[n-10]),d.push(this.ToffsetWires1C1[n-4]),this.ToffsetArcWires1C=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[n-9]),p.push(this.ToffsetWires1C1[n-3]),this.ToffsetArcWires1C=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C1[n-8]),m.push(this.ToffsetWires1C1[n-2]),this.ToffsetArcWires1C=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C1[n-7]),T.push(this.ToffsetWires1C1[n-1]),this.ToffsetArcWires1C=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=12&&(A.push(this.ToffsetWires1C2[n-12]),A.push(this.ToffsetWires1C2[n-6]),this.ToffsetArcWires2C=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1C2[n-11]),E.push(this.ToffsetWires1C2[n-5]),this.ToffsetArcWires2C=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[n-10]),b.push(this.ToffsetWires1C2[n-4]),this.ToffsetArcWires2C=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1C2[n-9]),D.push(this.ToffsetWires1C2[n-3]),this.ToffsetArcWires2C=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires1C2[n-8]),O.push(this.ToffsetWires1C2[n-2]),this.ToffsetArcWires2C=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1C2[n-7]),B.push(this.ToffsetWires1C2[n-1]),this.ToffsetArcWires2C=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.八分裂:this.ToffsetWires1C1.length>=16&&(c.push(this.ToffsetWires1C1[n-16]),c.push(this.ToffsetWires1C1[n-8]),this.ToffsetArcWires1C=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[n-15]),h.push(this.ToffsetWires1C1[n-7]),this.ToffsetArcWires1C=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[n-14]),d.push(this.ToffsetWires1C1[n-6]),this.ToffsetArcWires1C=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[n-13]),p.push(this.ToffsetWires1C1[n-5]),this.ToffsetArcWires1C=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C1[n-12]),m.push(this.ToffsetWires1C1[n-4]),this.ToffsetArcWires1C=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C1[n-11]),T.push(this.ToffsetWires1C1[n-3]),this.ToffsetArcWires1C=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires1C1[n-10]),y.push(this.ToffsetWires1C1[n-2]),this.ToffsetArcWires1C=W(y,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1C1[n-9]),w.push(this.ToffsetWires1C1[n-1]),this.ToffsetArcWires1C=W(w,15),this.entityCollection2.add(v(this.ToffsetArcWires1C,"1C1跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=16&&(A.push(this.ToffsetWires1C2[n-16]),A.push(this.ToffsetWires1C2[n-8]),this.ToffsetArcWires2C=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires1C2[n-15]),E.push(this.ToffsetWires1C2[n-7]),this.ToffsetArcWires2C=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[n-14]),b.push(this.ToffsetWires1C2[n-6]),this.ToffsetArcWires2C=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1C2[n-13]),D.push(this.ToffsetWires1C2[n-5]),this.ToffsetArcWires2C=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires1C2[n-12]),O.push(this.ToffsetWires1C2[n-4]),this.ToffsetArcWires2C=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1C2[n-11]),B.push(this.ToffsetWires1C2[n-3]),this.ToffsetArcWires2C=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1C2[n-10]),L.push(this.ToffsetWires1C2[n-2]),this.ToffsetArcWires2C=W(L,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),F.push(this.ToffsetWires1C2[n-9]),F.push(this.ToffsetWires1C2[n-1]),this.ToffsetArcWires2C=W(F,15),this.entityCollection2.add(v(this.ToffsetArcWires2C,"1C2跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2A1.length>1&&this.ToffsetWires2A2.length>1){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[],A=[],E=[],b=[],D=[],O=[],B=[],L=[],F=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires2A1.length>=2&&(c.push(this.ToffsetWires2A1[n-2]),c.push(this.ToffsetWires2A1[n-1]),this.ToffsetArcWires1A2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=2&&(A.push(this.ToffsetWires2A2[n-2]),A.push(this.ToffsetWires2A2[n-1]),this.ToffsetArcWires2A2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.双分裂:this.ToffsetWires2A1.length>=4&&(c.push(this.ToffsetWires2A1[n-4]),c.push(this.ToffsetWires2A1[n-2]),this.ToffsetArcWires1A2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[n-3]),h.push(this.ToffsetWires2A1[n-1]),this.ToffsetArcWires1A2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=4&&(A.push(this.ToffsetWires2A2[n-4]),A.push(this.ToffsetWires2A2[n-2]),this.ToffsetArcWires2A2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2A2[n-3]),E.push(this.ToffsetWires2A2[n-1]),this.ToffsetArcWires2A2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.四分裂:this.ToffsetWires2A1.length>=8&&(c.push(this.ToffsetWires2A1[n-8]),c.push(this.ToffsetWires2A1[n-4]),this.ToffsetArcWires1A2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[n-7]),h.push(this.ToffsetWires2A1[n-3]),this.ToffsetArcWires1A2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[n-6]),d.push(this.ToffsetWires2A1[n-2]),this.ToffsetArcWires1A2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[n-5]),p.push(this.ToffsetWires2A1[n-1]),this.ToffsetArcWires1A2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=8&&(A.push(this.ToffsetWires2A2[n-8]),A.push(this.ToffsetWires2A2[n-4]),this.ToffsetArcWires2A2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2A2[n-7]),E.push(this.ToffsetWires2A2[n-3]),this.ToffsetArcWires2A2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[n-6]),b.push(this.ToffsetWires2A2[n-2]),this.ToffsetArcWires2A2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2A2[n-5]),D.push(this.ToffsetWires2A2[n-1]),this.ToffsetArcWires2A2=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.六分裂:this.ToffsetWires2A1.length>=12&&(c.push(this.ToffsetWires2A1[n-12]),c.push(this.ToffsetWires2A1[n-6]),this.ToffsetArcWires1A2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[n-11]),h.push(this.ToffsetWires2A1[n-5]),this.ToffsetArcWires1A2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[n-10]),d.push(this.ToffsetWires2A1[n-4]),this.ToffsetArcWires1A2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[n-9]),p.push(this.ToffsetWires2A1[n-3]),this.ToffsetArcWires1A2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A1[n-8]),m.push(this.ToffsetWires2A1[n-2]),this.ToffsetArcWires1A2=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A1[n-7]),T.push(this.ToffsetWires2A1[n-1]),this.ToffsetArcWires1A2=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=12&&(A.push(this.ToffsetWires2A2[n-12]),A.push(this.ToffsetWires2A2[n-6]),this.ToffsetArcWires2A2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2A2[n-11]),E.push(this.ToffsetWires2A2[n-5]),this.ToffsetArcWires2A2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[n-10]),b.push(this.ToffsetWires2A2[n-4]),this.ToffsetArcWires2A2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2A2[n-9]),D.push(this.ToffsetWires2A2[n-3]),this.ToffsetArcWires2A2=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires2A2[n-8]),O.push(this.ToffsetWires2A2[n-2]),this.ToffsetArcWires2A2=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2A2[n-7]),B.push(this.ToffsetWires2A2[n-1]),this.ToffsetArcWires2A2=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.八分裂:this.ToffsetWires2A1.length>=16&&(c.push(this.ToffsetWires2A1[n-16]),c.push(this.ToffsetWires2A1[n-8]),this.ToffsetArcWires1A2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[n-15]),h.push(this.ToffsetWires2A1[n-7]),this.ToffsetArcWires1A2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[n-14]),d.push(this.ToffsetWires2A1[n-6]),this.ToffsetArcWires1A2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[n-13]),p.push(this.ToffsetWires2A1[n-5]),this.ToffsetArcWires1A2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A1[n-12]),m.push(this.ToffsetWires2A1[n-4]),this.ToffsetArcWires1A2=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A1[n-11]),T.push(this.ToffsetWires2A1[n-3]),this.ToffsetArcWires1A2=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires2A1[n-10]),y.push(this.ToffsetWires2A1[n-2]),this.ToffsetArcWires1A2=W(y,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2A1[n-9]),w.push(this.ToffsetWires2A1[n-1]),this.ToffsetArcWires1A2=W(w,15),this.entityCollection2.add(v(this.ToffsetArcWires1A2,"2A1跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=16&&(A.push(this.ToffsetWires2A2[n-16]),A.push(this.ToffsetWires2A2[n-8]),this.ToffsetArcWires2A2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2A2[n-15]),E.push(this.ToffsetWires2A2[n-7]),this.ToffsetArcWires2A2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[n-14]),b.push(this.ToffsetWires2A2[n-6]),this.ToffsetArcWires2A2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2A2[n-13]),D.push(this.ToffsetWires2A2[n-5]),this.ToffsetArcWires2A2=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires2A2[n-12]),O.push(this.ToffsetWires2A2[n-4]),this.ToffsetArcWires2A2=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2A2[n-11]),B.push(this.ToffsetWires2A2[n-3]),this.ToffsetArcWires2A2=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2A2[n-10]),L.push(this.ToffsetWires2A2[n-2]),this.ToffsetArcWires2A2=W(L,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),F.push(this.ToffsetWires2A2[n-9]),F.push(this.ToffsetWires2A2[n-1]),this.ToffsetArcWires2A2=W(F,15),this.entityCollection2.add(v(this.ToffsetArcWires2A2,"2A2跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2B1.length>1&&this.ToffsetWires2B2.length>1){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[],A=[],E=[],b=[],D=[],O=[],B=[],L=[],F=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires2B1.length>=2&&(c.push(this.ToffsetWires2B1[n-2]),c.push(this.ToffsetWires2B1[n-1]),this.ToffsetArcWires1B2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=2&&(A.push(this.ToffsetWires2B2[n-2]),A.push(this.ToffsetWires2B2[n-1]),this.ToffsetArcWires2B2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.双分裂:this.ToffsetWires2B1.length>=4&&(c.push(this.ToffsetWires2B1[n-4]),c.push(this.ToffsetWires2B1[n-2]),this.ToffsetArcWires1B2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[n-3]),h.push(this.ToffsetWires2B1[n-1]),this.ToffsetArcWires1B2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=4&&(A.push(this.ToffsetWires2B2[n-4]),A.push(this.ToffsetWires2B2[n-2]),this.ToffsetArcWires2B2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2B2[n-3]),E.push(this.ToffsetWires2B2[n-1]),this.ToffsetArcWires2B2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.四分裂:this.ToffsetWires2B1.length>=8&&(c.push(this.ToffsetWires2B1[n-8]),c.push(this.ToffsetWires2B1[n-4]),this.ToffsetArcWires1B2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[n-7]),h.push(this.ToffsetWires2B1[n-3]),this.ToffsetArcWires1B2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[n-6]),d.push(this.ToffsetWires2B1[n-2]),this.ToffsetArcWires1B2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[n-5]),p.push(this.ToffsetWires2B1[n-1]),this.ToffsetArcWires1B2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=8&&(A.push(this.ToffsetWires2B2[n-8]),A.push(this.ToffsetWires2B2[n-4]),this.ToffsetArcWires2B2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2B2[n-7]),E.push(this.ToffsetWires2B2[n-3]),this.ToffsetArcWires2B2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[n-6]),b.push(this.ToffsetWires2B2[n-2]),this.ToffsetArcWires2B2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2B2[n-5]),D.push(this.ToffsetWires2B2[n-1]),this.ToffsetArcWires2B2=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.六分裂:this.ToffsetWires2B1.length>=12&&(c.push(this.ToffsetWires2B1[n-12]),c.push(this.ToffsetWires2B1[n-6]),this.ToffsetArcWires1B2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[n-11]),h.push(this.ToffsetWires2B1[n-5]),this.ToffsetArcWires1B2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[n-10]),d.push(this.ToffsetWires2B1[n-4]),this.ToffsetArcWires1B2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[n-9]),p.push(this.ToffsetWires2B1[n-3]),this.ToffsetArcWires1B2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B1[n-8]),m.push(this.ToffsetWires2B1[n-2]),this.ToffsetArcWires1B2=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B1[n-7]),T.push(this.ToffsetWires2B1[n-1]),this.ToffsetArcWires1B2=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=12&&(A.push(this.ToffsetWires2B2[n-12]),A.push(this.ToffsetWires2B2[n-6]),this.ToffsetArcWires2B2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2B2[n-11]),E.push(this.ToffsetWires2B2[n-5]),this.ToffsetArcWires2B2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[n-10]),b.push(this.ToffsetWires2B2[n-4]),this.ToffsetArcWires2B2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2B2[n-9]),D.push(this.ToffsetWires2B2[n-3]),this.ToffsetArcWires2B2=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires2B2[n-8]),O.push(this.ToffsetWires2B2[n-2]),this.ToffsetArcWires2B2=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2B2[n-7]),B.push(this.ToffsetWires2B2[n-1]),this.ToffsetArcWires2B2=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.八分裂:this.ToffsetWires2B1.length>=16&&(c.push(this.ToffsetWires2B1[n-16]),c.push(this.ToffsetWires2B1[n-8]),this.ToffsetArcWires1B2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[n-15]),h.push(this.ToffsetWires2B1[n-7]),this.ToffsetArcWires1B2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[n-14]),d.push(this.ToffsetWires2B1[n-6]),this.ToffsetArcWires1B2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[n-13]),p.push(this.ToffsetWires2B1[n-5]),this.ToffsetArcWires1B2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B1[n-12]),m.push(this.ToffsetWires2B1[n-4]),this.ToffsetArcWires1B2=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B1[n-11]),T.push(this.ToffsetWires2B1[n-3]),this.ToffsetArcWires1B2=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires2B1[n-10]),y.push(this.ToffsetWires2B1[n-2]),this.ToffsetArcWires1B2=W(y,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2B1[n-9]),w.push(this.ToffsetWires2B1[n-1]),this.ToffsetArcWires1B2=W(w,15),this.entityCollection2.add(v(this.ToffsetArcWires1B2,"2B1跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=16&&(A.push(this.ToffsetWires2B2[n-16]),A.push(this.ToffsetWires2B2[n-8]),this.ToffsetArcWires2B2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2B2[n-15]),E.push(this.ToffsetWires2B2[n-7]),this.ToffsetArcWires2B2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[n-14]),b.push(this.ToffsetWires2B2[n-6]),this.ToffsetArcWires2B2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2B2[n-13]),D.push(this.ToffsetWires2B2[n-5]),this.ToffsetArcWires2B2=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires2B2[n-12]),O.push(this.ToffsetWires2B2[n-4]),this.ToffsetArcWires2B2=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2B2[n-11]),B.push(this.ToffsetWires2B2[n-3]),this.ToffsetArcWires2B2=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2B2[n-10]),L.push(this.ToffsetWires2B2[n-2]),this.ToffsetArcWires2B2=W(L,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),F.push(this.ToffsetWires2B2[n-9]),F.push(this.ToffsetWires2B2[n-1]),this.ToffsetArcWires2B2=W(F,15),this.entityCollection2.add(v(this.ToffsetArcWires2B2,"2B2跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2C1.length>1&&this.ToffsetWires2C2.length>1){const c=[],h=[],d=[],p=[],m=[],T=[],y=[],w=[],A=[],E=[],b=[],D=[],O=[],B=[],L=[],F=[];switch(this.LineInfo.Wairnum){case $.单分裂:this.ToffsetWires2C1.length>=2&&(c.push(this.ToffsetWires2C1[n-2]),c.push(this.ToffsetWires2C1[n-1]),this.ToffsetArcWires1C2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=2&&(A.push(this.ToffsetWires2C2[n-2]),A.push(this.ToffsetWires2C2[n-1]),this.ToffsetArcWires2C2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.双分裂:this.ToffsetWires2C1.length>=4&&(c.push(this.ToffsetWires2C1[n-4]),c.push(this.ToffsetWires2C1[n-2]),this.ToffsetArcWires1C2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[n-3]),h.push(this.ToffsetWires2C1[n-1]),this.ToffsetArcWires1C2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=4&&(A.push(this.ToffsetWires2C2[n-4]),A.push(this.ToffsetWires2C2[n-2]),this.ToffsetArcWires2C2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2C2[n-3]),E.push(this.ToffsetWires2C2[n-1]),this.ToffsetArcWires2C2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.四分裂:this.ToffsetWires2C1.length>=8&&(c.push(this.ToffsetWires2C1[n-8]),c.push(this.ToffsetWires2C1[n-4]),this.ToffsetArcWires1C2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[n-7]),h.push(this.ToffsetWires2C1[n-3]),this.ToffsetArcWires1C2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[n-6]),d.push(this.ToffsetWires2C1[n-2]),this.ToffsetArcWires1C2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[n-5]),p.push(this.ToffsetWires2C1[n-1]),this.ToffsetArcWires1C2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=8&&(A.push(this.ToffsetWires2C2[n-8]),A.push(this.ToffsetWires2C2[n-4]),this.ToffsetArcWires2C2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2C2[n-7]),E.push(this.ToffsetWires2C2[n-3]),this.ToffsetArcWires2C2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[n-6]),b.push(this.ToffsetWires2C2[n-2]),this.ToffsetArcWires2C2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2C2[n-5]),D.push(this.ToffsetWires2C2[n-1]),this.ToffsetArcWires2C2=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.六分裂:this.ToffsetWires2C1.length>=12&&(c.push(this.ToffsetWires2C1[n-12]),c.push(this.ToffsetWires2C1[n-6]),this.ToffsetArcWires1C2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[n-11]),h.push(this.ToffsetWires2C1[n-5]),this.ToffsetArcWires1C2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[n-10]),d.push(this.ToffsetWires2C1[n-4]),this.ToffsetArcWires1C2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[n-9]),p.push(this.ToffsetWires2C1[n-3]),this.ToffsetArcWires1C2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C1[n-8]),m.push(this.ToffsetWires2C1[n-2]),this.ToffsetArcWires1C2=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C1[n-7]),T.push(this.ToffsetWires2C1[n-1]),this.ToffsetArcWires1C2=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=12&&(A.push(this.ToffsetWires2C2[n-12]),A.push(this.ToffsetWires2C2[n-6]),this.ToffsetArcWires2C2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2C2[n-11]),E.push(this.ToffsetWires2C2[n-5]),this.ToffsetArcWires2C2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[n-10]),b.push(this.ToffsetWires2C2[n-4]),this.ToffsetArcWires2C2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2C2[n-9]),D.push(this.ToffsetWires2C2[n-3]),this.ToffsetArcWires2C2=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires2C2[n-8]),O.push(this.ToffsetWires2C2[n-2]),this.ToffsetArcWires2C2=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2C2[n-7]),B.push(this.ToffsetWires2C2[n-1]),this.ToffsetArcWires2C2=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case $.八分裂:this.ToffsetWires2C1.length>=16&&(c.push(this.ToffsetWires2C1[n-16]),c.push(this.ToffsetWires2C1[n-8]),this.ToffsetArcWires1C2=W(c,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[n-15]),h.push(this.ToffsetWires2C1[n-7]),this.ToffsetArcWires1C2=W(h,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[n-14]),d.push(this.ToffsetWires2C1[n-6]),this.ToffsetArcWires1C2=W(d,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[n-13]),p.push(this.ToffsetWires2C1[n-5]),this.ToffsetArcWires1C2=W(p,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C1[n-12]),m.push(this.ToffsetWires2C1[n-4]),this.ToffsetArcWires1C2=W(m,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C1[n-11]),T.push(this.ToffsetWires2C1[n-3]),this.ToffsetArcWires1C2=W(T,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires2C1[n-10]),y.push(this.ToffsetWires2C1[n-2]),this.ToffsetArcWires1C2=W(y,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2C1[n-9]),w.push(this.ToffsetWires2C1[n-1]),this.ToffsetArcWires1C2=W(w,15),this.entityCollection2.add(v(this.ToffsetArcWires1C2,"2C1跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=16&&(A.push(this.ToffsetWires2C2[n-16]),A.push(this.ToffsetWires2C2[n-8]),this.ToffsetArcWires2C2=W(A,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线1"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),E.push(this.ToffsetWires2C2[n-15]),E.push(this.ToffsetWires2C2[n-7]),this.ToffsetArcWires2C2=W(E,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线2"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[n-14]),b.push(this.ToffsetWires2C2[n-6]),this.ToffsetArcWires2C2=W(b,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线3"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2C2[n-13]),D.push(this.ToffsetWires2C2[n-5]),this.ToffsetArcWires2C2=W(D,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线4"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),O.push(this.ToffsetWires2C2[n-12]),O.push(this.ToffsetWires2C2[n-4]),this.ToffsetArcWires2C2=W(O,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线5"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2C2[n-11]),B.push(this.ToffsetWires2C2[n-3]),this.ToffsetArcWires2C2=W(B,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线6"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2C2[n-10]),L.push(this.ToffsetWires2C2[n-2]),this.ToffsetArcWires2C2=W(L,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线7"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),F.push(this.ToffsetWires2C2[n-9]),F.push(this.ToffsetWires2C2[n-1]),this.ToffsetArcWires2C2=W(F,15),this.entityCollection2.add(v(this.ToffsetArcWires2C2,"2C2跳线8"+(o-1)+"-"+o,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}}else switch(this.LineInfo.Wairnum){case $.单分裂:t=t+1;break;case $.双分裂:t=t+2;break;case $.四分裂:t=t+4;break;case $.六分裂:t=t+6;break;case $.八分裂:t=t+8;break}})}loadLineModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.add(this.dataSource2),this.viewer.entities.show)}LineSpriteLineinit(){ne._materialCache.addMaterial("SpriteLineMaterialType",{fabric:{type:"SpriteLineMaterialType",uniforms:{color:new I(1,1,0,1),speed:2},source:`
6585
6585
  uniform vec4 color;
6586
6586
  const float pi = 3.1415926;
6587
6587
  czm_material czm_getMaterial(czm_materialInput materialInput)
@@ -6596,4 +6596,4 @@ void main()
6596
6596
  `},translucent:function(){return!0}})}setLineVisible(t){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=t)}RemoveLineModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.remove(this.dataSource2),this.entityCollection2.show=!1)}}class Fx{constructor(){se(this,"id","");se(this,"name","");se(this,"towerFZinfo","");se(this,"towerDisFile","");se(this,"stressFileContent","");se(this,"TowerMemberColor","#FFFFFF");se(this,"TowerMembersWidth",2);se(this,"Longitude",0);se(this,"Latitude",0);se(this,"Altitude",0);se(this,"RollX",0);se(this,"RollY",90);se(this,"RollZ",0)}}function Mx(e){debugger;const t=e.split(`
6597
6597
  `),n=[],i=[],o=/^\s*(\d+)\s+([\d.-]+)\s+([\d.-]+)\s+([\d.-]+)\s+(-?\d+)/,a=/^\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:#|$)/;for(const r of t){const f=r.trim();if(!f)continue;const c=f.match(o);if(c){n.push({id:parseInt(c[1]),x:parseFloat(c[2]),y:parseFloat(c[3]),z:parseFloat(c[4]),flag:parseInt(c[5])});continue}const h=f.match(a);h&&i.push({from:parseInt(h[1]),to:parseInt(h[2]),type:parseInt(h[3])})}return{TowerNodes:n,connections:i}}function Ux(e){const t=e.split(`
6598
6598
  `),n=[];for(const i of t){if(!i.trim())continue;const o=i.trim().split(/\s+/).filter(f=>f!==""),a=parseInt(o[0]);if(isNaN(a))continue;const r=[];for(let f=1;f<o.length;f+=3){const c=parseFloat(o[f]),h=parseFloat(o[f+1]),d=parseFloat(o[f+2]);if(!isNaN(c)&&!isNaN(h)&&!isNaN(d)){const p=Math.floor((f-1)/3)+1;r.push({timeStep:p,x:c,y:h,z:d})}}n.push({nodeId:a,displacements:r})}return n}function B0(e){const t={};return e.forEach(n=>{n.displacements.forEach(i=>{t[i.timeStep]||(t[i.timeStep]=[]),t[i.timeStep].push({nodeId:n.nodeId,...i})})}),t}function kx(e){const t=e.split(`
6599
- `),n=[];for(const o of t){if(!o.trim())continue;const a=o.match(/^\s*(\d+-\s*\d+)\s+((?:\d+\.\d+\s*)+)/);if(a){const r=a[1].replace(/\s+/g,""),f=a[2].trim().split(/\s+/).map(Number);n.push({elementId:r,stressRatios:f})}}const i=[];if(n.length>0){const o=n[0].stressRatios.length;for(let a=0;a<o;a++){const r={timeIndex:a,elements:[]};for(const f of n){let c="";const h=f.stressRatios[a];h>.01&&h<.02?c="#ffffff":h>.02&&h<.05?c="#d71345":c="#ff0000",r.elements.push({elementId:f.elementId,stressRatio:h,ylbColor:c})}i.push(r)}}return{byElement:n,byTime:i}}class Vx{constructor(t,n,i){se(this,"viewer");se(this,"TowerFZS");se(this,"Keym","");se(this,"dataSource2");se(this,"entityCollection2");se(this,"PointdataSource2");se(this,"PointentityCollection2");se(this,"TowerNodes",[]);se(this,"connections",[]);se(this,"displacementData",[]);se(this,"byElemens",[]);se(this,"byTimes",[]);se(this,"_animationInterval",null);this.Keym=i,this.viewer=t,this.TowerFZS=n,this.dataSource2=new go(this.TowerFZS.id+"tower"),this.entityCollection2=this.dataSource2.entities,this.PointdataSource2=new go(this.TowerFZS.id+"point"),this.PointentityCollection2=this.PointdataSource2.entities}loadfile(){if(this.Keym!="OW_JPS_EEngin_001")return;const{TowerNodes:t,connections:n}=Mx(this.TowerFZS.towerFZinfo);this.TowerNodes=t,this.connections=n,this.displacementData=Ux(this.TowerFZS.towerDisFile);const{byElement:i,byTime:o}=kx(this.TowerFZS.stressFileContent);this.byElemens=i,this.byTimes=o;debugger}loadFZTower(){if(this.Keym!="OW_JPS_EEngin_001")return;let t=new He(S.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const n=u.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(i=>{const o=this.TowerNodes.find(h=>h.id===i.from),a=this.TowerNodes.find(h=>h.id===i.to),r=[],f=new u(o==null?void 0:o.x,o==null?void 0:o.y,o==null?void 0:o.z);r.push(Q(n,f,t)),this.PointentityCollection2.add(Pa(r[0],(o==null?void 0:o.id)+""));const c=new u(a==null?void 0:a.x,a==null?void 0:a.y,a==null?void 0:a.z);r.push(Q(n,c,t)),this.PointentityCollection2.add(Pa(r[1],(a==null?void 0:a.id)+"")),this.entityCollection2.add(v(r,i.from+""+i.to,this.TowerFZS.TowerMembersWidth,this.TowerFZS.TowerMemberColor))})}loadFZDISTower(t){if(this.Keym!=="OW_JPS_EEngin_001")return;const i=B0(this.displacementData)[t],o=this.byTimes.find(f=>f.timeIndex===t);debugger;if(!i){console.warn(`未找到时间步 ${t} 的位移数据`);return}const a=new He(S.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ),r=u.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(f=>{const c=this.TowerNodes.find(I=>I.id===f.from),h=this.TowerNodes.find(I=>I.id===f.to);if(!c||!h){console.warn(`找不到连接 ${f.from}->${f.to} 的节点`);return}debugger;const d=i.find(I=>I.nodeId===f.from),p=i.find(I=>I.nodeId===f.to);if(!d||!p){console.warn(`找不到连接 ${f.from}->${f.to} 的位移数据`);return}const m=new u(c.x-d.x,c.y-d.y,c.z-d.z),T=new u(h.x-p.x,h.y-p.y,h.z-p.z),y=Q(r,m,a);this.entityCollection2.add(Pa(y,f.from+""));const w=Q(r,T,a);this.entityCollection2.add(Pa(w,f.to+""));const A=[y,w],E=`${f.from}_${f.to}`,b=f.from+"-"+f.to;o==null||o.elements.find(I=>I.elementId===b);debugger;this.entityCollection2.add(v(A,E+t,this.TowerFZS.TowerMembersWidth,"#ffffff"))})}loadFZDISTower1(t){if(this.Keym!="OW_JPS_EEngin_001")return;const n=B0(this.displacementData);let i=new He(S.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const o=u.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(a=>{const r=this.TowerNodes.find(T=>T.id===a.from),f=n[t].find(T=>T.nodeId===a.from),c=this.TowerNodes.find(T=>T.id===a.to),h=n[t].find(T=>T.nodeId===a.to),d=[],p=new u(r.x-f.x,r.y-f.y,r.z-f.z);d.push(Q(o,p,i));const m=new u(c.x-h.x,c.y-h.y,c.z-h.z);d.push(Q(o,m,i));debugger;this.entityCollection2.add(v(d,a.from+""+a.to,this.TowerFZS.TowerMembersWidth,this.TowerFZS.TowerMemberColor))})}loadAllFZDisTower(){if(this.Keym!=="OW_JPS_EEngin_001")return;if(!this.displacementData||this.displacementData.length===0){console.warn("没有可用的位移数据");return}let t=1;const n=this.displacementData.length;this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null);const i=()=>{if(this.viewer.dataSources.contains(this.dataSource2)&&this.viewer.dataSources.remove(this.dataSource2,!0),t>n){t=1;return}this.dataSource2=new go("fztower"),this.entityCollection2=this.dataSource2.entities;try{this.loadFZDISTower(t),this.loadFZModel(),console.log(`正在显示位移帧: ${t}/${n}`),t++}catch(o){console.error("加载位移帧时出错:",o),this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}};i(),this._animationInterval=setInterval(i,300)}stopDisplacementAnimation(){this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}toggleAnimation(t){t?this.stopDisplacementAnimation():this.loadAllFZDisTower()}loadFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.add(this.dataSource2),this.viewer.dataSources.add(this.PointdataSource2),this.viewer.entities.show)}setFZModelVisible(t){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=t)}RemoveFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.remove(this.dataSource2),this.entityCollection2.show=!1)}}ot.GUAPoint=Lx,ot.InsulatorInfo=zx,ot.InsulatorType=Ht,ot.LineNum=ar,ot.LineType=P0,ot.OWEEgineFZManager=Vx,ot.OWEEgineManager=Nx,ot.PhaseSType=nn,ot.TowerFZInfo=Fx,ot.TowerInfo=Rx,ot.TowerLineInfo=Bx,ot.TowerType=$i,ot.WairnumType=$,ot.drawModel=To,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});
6599
+ `),n=[];for(const o of t){if(!o.trim())continue;const a=o.match(/^\s*(\d+-\s*\d+)\s+((?:\d+\.\d+\s*)+)/);if(a){const r=a[1].replace(/\s+/g,""),f=a[2].trim().split(/\s+/).map(Number);n.push({elementId:r,stressRatios:f})}}const i=[];if(n.length>0){const o=n[0].stressRatios.length;for(let a=0;a<o;a++){const r={timeIndex:a,elements:[]};for(const f of n){let c="";const h=f.stressRatios[a];h>.01&&h<.02?c="#ffffff":h>.02&&h<.05?c="#d71345":c="#ff0000",r.elements.push({elementId:f.elementId,stressRatio:h,ylbColor:c})}i.push(r)}}return{byElement:n,byTime:i}}class Vx{constructor(t,n,i){se(this,"viewer");se(this,"TowerFZS");se(this,"Keym","");se(this,"dataSource2");se(this,"entityCollection2");se(this,"TowerNodes",[]);se(this,"connections",[]);se(this,"displacementData",[]);se(this,"byElemens",[]);se(this,"byTimes",[]);se(this,"_animationInterval",null);this.Keym=i,this.viewer=t,this.TowerFZS=n,this.dataSource2=new Ko(this.TowerFZS.id),this.entityCollection2=this.dataSource2.entities}loadfile(){if(this.Keym!="OW_JPS_EEngin_001")return;const{TowerNodes:t,connections:n}=Mx(this.TowerFZS.towerFZinfo);this.TowerNodes=t,this.connections=n,this.displacementData=Ux(this.TowerFZS.towerDisFile);const{byElement:i,byTime:o}=kx(this.TowerFZS.stressFileContent);this.byElemens=i,this.byTimes=o;debugger}loadFZTower(){if(this.Keym!="OW_JPS_EEngin_001")return;let t=new He(S.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const n=u.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(i=>{const o=this.TowerNodes.find(h=>h.id===i.from),a=this.TowerNodes.find(h=>h.id===i.to),r=[],f=new u(o==null?void 0:o.x,o==null?void 0:o.y,o==null?void 0:o.z);r.push(Q(n,f,t)),Pa(this.viewer,r[0],(o==null?void 0:o.id)+"",{pointColor:I.RED,labelColor:I.GOLD,fontSize:18,pixelOffset:[0,-30]});const c=new u(a==null?void 0:a.x,a==null?void 0:a.y,a==null?void 0:a.z);r.push(Q(n,c,t)),Pa(this.viewer,r[1],(o==null?void 0:o.id)+"",{pointColor:I.RED,labelColor:I.GOLD,fontSize:18,pixelOffset:[0,-30]}),this.entityCollection2.add(v(r,i.from+""+i.to,this.TowerFZS.TowerMembersWidth,this.TowerFZS.TowerMemberColor))})}loadFZDISTower(t){if(this.Keym!=="OW_JPS_EEngin_001")return;const i=B0(this.displacementData)[t],o=this.byTimes.find(f=>f.timeIndex===t);debugger;if(!i){console.warn(`未找到时间步 ${t} 的位移数据`);return}const a=new He(S.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ),r=u.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(f=>{const c=this.TowerNodes.find(D=>D.id===f.from),h=this.TowerNodes.find(D=>D.id===f.to);if(!c||!h){console.warn(`找不到连接 ${f.from}->${f.to} 的节点`);return}debugger;const d=i.find(D=>D.nodeId===f.from),p=i.find(D=>D.nodeId===f.to);if(!d||!p){console.warn(`找不到连接 ${f.from}->${f.to} 的位移数据`);return}const m=new u(c.x-d.x,c.y-d.y,c.z-d.z),T=new u(h.x-p.x,h.y-p.y,h.z-p.z),y=Q(r,m,a);Pa(this.viewer,y,f.from+"",{pointColor:I.RED,labelColor:I.GOLD,fontSize:18,pixelOffset:[0,-30]});const w=Q(r,T,a);Pa(this.viewer,w,f.to+"",{pointColor:I.RED,labelColor:I.GOLD,fontSize:18,pixelOffset:[0,-30]});const A=[y,w],E=`${f.from}_${f.to}`,b=f.from+"-"+f.to;o==null||o.elements.find(D=>D.elementId===b);debugger;this.entityCollection2.add(v(A,E+t,this.TowerFZS.TowerMembersWidth,"#ffffff"))})}loadFZDISTower1(t){if(this.Keym!="OW_JPS_EEngin_001")return;const n=B0(this.displacementData);let i=new He(S.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const o=u.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(a=>{const r=this.TowerNodes.find(T=>T.id===a.from),f=n[t].find(T=>T.nodeId===a.from),c=this.TowerNodes.find(T=>T.id===a.to),h=n[t].find(T=>T.nodeId===a.to),d=[],p=new u(r.x-f.x,r.y-f.y,r.z-f.z);d.push(Q(o,p,i));const m=new u(c.x-h.x,c.y-h.y,c.z-h.z);d.push(Q(o,m,i));debugger;this.entityCollection2.add(v(d,a.from+""+a.to,this.TowerFZS.TowerMembersWidth,this.TowerFZS.TowerMemberColor))})}loadAllFZDisTower(){if(this.Keym!=="OW_JPS_EEngin_001")return;if(!this.displacementData||this.displacementData.length===0){console.warn("没有可用的位移数据");return}let t=1;const n=this.displacementData.length;this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null);const i=()=>{if(this.viewer.dataSources.contains(this.dataSource2)&&this.viewer.dataSources.remove(this.dataSource2,!0),t>n){t=1;return}this.dataSource2=new Ko("fztower"),this.entityCollection2=this.dataSource2.entities;try{this.loadFZDISTower(t),this.loadFZModel(),console.log(`正在显示位移帧: ${t}/${n}`),t++}catch(o){console.error("加载位移帧时出错:",o),this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}};i(),this._animationInterval=setInterval(i,300)}stopDisplacementAnimation(){this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}toggleAnimation(t){t?this.stopDisplacementAnimation():this.loadAllFZDisTower()}loadFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.add(this.dataSource2),this.viewer.entities.show)}setFZModelVisible(t){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=t)}RemoveFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.remove(this.dataSource2),this.entityCollection2.show=!1)}}ot.GUAPoint=Lx,ot.InsulatorInfo=zx,ot.InsulatorType=Ht,ot.LineNum=ar,ot.LineType=P0,ot.OWEEgineFZManager=Vx,ot.OWEEgineManager=Nx,ot.PhaseSType=nn,ot.TowerFZInfo=Fx,ot.TowerInfo=Rx,ot.TowerLineInfo=Bx,ot.TowerType=$i,ot.WairnumType=$,ot.drawModel=go,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});